PageSourceSearch

https://www.texashealth.org/-/media/Base-Themes/Core-Libraries/scripts/pre-optimized-min.js?t=20260924T062521Z

js texashealth.org collected 2026-09-24 08:59:49 UTC 1,981,420 bytes, 34,292 lines download raw bytes

1/*  ie-origin-fix  */
2/* Taken from: http://tosbourn.com/a-fix-for-window-location-origin-in-internet-explorer/ */
3
4if (!window.location.origin) {
5  window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
6}
7
8if (typeof Array.prototype.filter === "undefined" )
9{
10  Array.prototype.filter = function(fun /*, thisp */)
11  {
12    "use strict";
13
14    if (this === void 0 || this === null)
15      throw new TypeError();
16
17    var t = Object(this);
18    var len = t.length >>> 0;
19    if (typeof fun !== "function")
20      throw new TypeError();
21
22    var res = [];
23    var thisp = arguments[1];
24    for (var i = 0; i < len; i++)
25    {
26      if (i in t)
27      {
28        var val = t[i]; // in case fun mutates this
29        if (fun.call(thisp, val, i, t))
30          res.push(val);
31      }
32    }
33
34    return res;
35  };
36};
37/* Take from https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Array/find */
38if (typeof Array.prototype.find === "undefined") {
39    Object.defineProperty(Array.prototype, 'find', {
40        value: function (predicate) {
41            // 1. Let O be ? ToObject(this value).
42            if (this == null) {
43                throw new TypeError('"this" is null or not defined');
44            }
45
46            var o = Object(this);
47
48            // 2. Let len be ? ToLength(? Get(O, "length")).
49            var len = o.length >>> 0;
50
51            // 3. If IsCallable(predicate) is false, throw a TypeError exception.
52            if (typeof predicate !== 'function') {
53                throw new TypeError('predicate must be a function');
54            }
55
56            // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
57            var thisArg = arguments[1];
58
59            // 5. Let k be 0.
60            var k = 0;
61
62            // 6. Repeat, while k < len
63            while (k < len) {
64                // a. Let Pk be ! ToString(k).
65                // b. Let kValue be ? Get(O, Pk).
66                // c. Let testResult be ToBoolean(? Call(predicate, T, � kValue, k, O �)).
67                // d. If testResult is true, return kValue.
68                var kValue = o[k];
69                if (predicate.call(thisArg, kValue, k, o)) {
70                    return kValue;
71                }
72                // e. Increase k by 1.
73                k++;
74            }
75
76            // 7. Return undefined.
77            return undefined;
78        },
79        configurable: true,
80        writable: true
81    });
82};
83
84/*  xaquery  */
85window.$xa = function () {
86    var xaJquery, xaJqueryUI;
87    /*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
88    
vendor: 15,036 bytes, line 88
88!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 88
88: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 88
88if(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 88
88nding",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 88
88=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});
88
89
90    xaJquery = jQuery;
91
92    xaJqueryUI = function (jQuery) {
93      /*! jQuery UI - v1.13.2 - 2022-07-14
94      * http://jqueryui.com
vendor: 59,386 bytes, lines 95-98
95      * Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
96      * Copyright jQuery Foundation and other contributors; Licensed MIT */
97
98      !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(V){"use strict";V.ui=V.ui||{};V.ui.version="1.13.2";var n,i=0,a=Array.prototype.hasOwnProperty,r=Array.prototype.slice;V.cleanData=(n=V.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)(e=V._data(i,"events"))&&e.remove&&V(i).triggerHandler("remove");n(t)}),V.widget=function(t,i,e){var s,n,o,a={},r=t.split(".")[0],l=r+"-"+(t=t.split(".")[1]);return e||(e=i,i=V.Widget),Array.isArray(e)&&(e=V.extend.apply(null,[{}].concat(e))),V.expr.pseudos[l.toLowerCase()]=function(t){return!!V.data(t,l)},V[r]=V[r]||{},s=V[r][t],n=V[r][t]=function(t,e){if(!this||!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},V.extend(n,s,{version:e.version,_proto:V.extend({},e),_childConstructors:[]}),(o=new i).options=V.widget.extend({},o.options),V.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}a[e]="function"==typeof s?function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=o,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:s}),n.prototype=V.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},a,{constructor:n,namespace:r,widgetName:t,widgetFullName:l}),s?(V.each(s._childConstructors,function(t,e){var i=e.prototype;V.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),V.widget.bridge(t,n),n},V.widget.extend=function(t){for(var e,i,s=r.call(arguments,1),n=0,o=s.length;n<o;n++)for(e in s[n])i=s[n][e],a.call(s[n],e)&&void 0!==i&&(V.isPlainObject(i)?t[e]=V.isPlainObject(t[e])?V.widget.extend({},t[e],i):V.widget.extend({},i):t[e]=i);return t},V.widget.bridge=function(o,e){var a=e.prototype.widgetFullName||o;V.fn[o]=function(i){var t="string"==typeof i,s=r.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=V.data(this,a);return"instance"===i?(n=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?V.error("no such method '"+i+"' for "+o+" widget instance"):(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:V.error("cannot call methods on "+o+" prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=V.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=V.data(this,a);t?(t.option(i||{}),t._init&&t._init()):V.data(this,a,new e(i,this))})),n}},V.Widget=function(){},V.Widget._childConstructors=[],V.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=V(e||this.defaultElement||this)[0],this.element=V(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=V(),this.hoverable=V(),this.focusable=V(),this.classesElementLookup={},e!==this&&(V.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=V(e.style?e.ownerDocument:e.document||e),this.window=V(this.document[0].defaultView||this.document[0].parentWindow)),this.options=V.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:V.noop,_create:V.noop,_init:V.noop,destroy:function(){var i=this;this._destroy(),V.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:V.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return V.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=V.widget.extend({},this.options[t]),n=0;n<i.length-1;n++)s[i[n]]=s[i[n]]||{},s=s[i[n]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=e}return this._setOptions(o),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=V(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(n){var o=[],a=this;function t(t,e){for(var i,s=0;s<t.length;s++)i=a.classesElementLookup[t[s]]||V(),i=n.add?(function(){var i=[];n.element.each(function(t,e){V.map(a.classesElementLookup,function(t){return t}).some(function(t){return t.is(e)})||i.push(e)}),a._on(V(i),{remove:"_untrackClassesElement"})}(),V(V.uniqueSort(i.get().concat(n.element.get())))):V(i.not(n.element).get()),a.classesElementLookup[t[s]]=i,o.push(t[s]),e&&n.classes[t[s]]&&o.push(n.classes[t[s]])}return(n=V.extend({element:this.element,classes:this.options.classes||{}},n)).keys&&t(n.keys.match(/\S+/g)||[],!0),n.extra&&t(n.extra.match(/\S+/g)||[]),o.join(" ")},_untrackClassesElement:function(i){var s=this;V.each(s.classesElementLookup,function(t,e){-1!==V.inArray(i.target,e)&&(s.classesElementLookup[t]=V(e.not(i.target).get()))}),this._off(V(i.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){var n="string"==typeof t||null===t,i={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s="boolean"==typeof s?s:i};return i.element.toggleClass(this._classes(i),s),this},_on:function(n,o,t){var a,r=this;"boolean"!=typeof n&&(t=o,o=n,n=!1),t?(o=a=V(o),this.bindings=this.bindings.add(o)):(t=o,o=this.element,a=this.widget()),V.each(t,function(t,e){function i(){if(n||!0!==r.options.disabled&&!V(this).hasClass("ui-state-disabled"))return("string"==typeof e?r[e]:e).apply(r,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||V.guid++);var s=t.match(/^([\w:-]*)\s*(.*)$/),t=s[1]+r.eventNamespace,s=s[2];s?a.on(t,s,i):o.on(t,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e),this.bindings=V(this.bindings.not(t).get()),this.focusable=V(this.focusable.not(t).get()),this.hoverable=V(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(V(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(V(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(V(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(V(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,n,o=this.options[t];if(i=i||{},(e=V.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],n=e.originalEvent)for(s in n)s in e||(e[s]=n[s]);return this.element.trigger(e,i),!("function"==typeof o&&!1===o.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},V.each({show:"fadeIn",hide:"fadeOut"},function(o,a){V.Widget.prototype["_"+o]=function(e,t,i){var s,n=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||a:o;"number"==typeof(t=t||{})?t={duration:t}:!0===t&&(t={}),s=!V.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),s&&V.effects&&V.effects.effect[n]?e[o](t):n!==o&&e[n]?e[n](t.duration,t.easing,i):e.queue(function(t){V(this)[o](),i&&i.call(e[0]),t()})}});var s,x,k,o,l,h,c,u,C;V.widget;function D(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function I(t,e){return parseInt(V.css(t,e),10)||0}function T(t){return null!=t&&t===t.window}x=Math.max,k=Math.abs,o=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,C=V.fn.position,V.position={scrollbarWidth:function(){if(void 0!==s)return s;var t,e=V("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>"),i=e.children()[0];return V("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?V.position.scrollbarWidth():0,height:e?V.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=V(t||window),i=T(e[0]),s=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:s,offset:!i&&!s?V(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},V.fn.position=function(u){if(!u||!u.of)return C.apply(this,arguments);var d,p,f,g,m,t,_="string"==typeof(u=V.extend({},u)).of?V(document).find(u.of):V(u.of),v=V.position.getWithinInfo(u.within),b=V.position.getScrollInfo(v),y=(u.collision||"flip").split(" "),w={},e=9===(t=(e=_)[0]).nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:T(t)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:t.preventDefault?{width:0,height:0,offset:{top:t.pageY,left:t.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()};return _[0].preventDefault&&(u.at="left top"),p=e.width,f=e.height,m=V.extend({},g=e.offset),V.each(["my","at"],function(){var t,e,i=(u[this]||"").split(" ");(i=1===i.length?o.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]:i)[0]=o.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),w[this]=[t?t[0]:0,e?e[0]:0],u[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===y.length&&(y[1]=y[0]),"right"===u.at[0]?m.left+=p:"center"===u.at[0]&&(m.left+=p/2),"bottom"===u.at[1]?m.top+=f:"center"===u.at[1]&&(m.top+=f/2),d=D(w.at,p,f),m.left+=d[0],m.top+=d[1],this.each(function(){var i,t,a=V(this),r=a.outerWidth(),l=a.outerHeight(),e=I(this,"marginLeft"),s=I(this,"marginTop"),n=r+e+I(this,"marginRight")+b.width,o=l+s+I(this,"marginBottom")+b.height,h=V.extend({},m),c=D(w.my,a.outerWidth(),a.outerHeight());"right"===u.my[0]?h.left-=r:"center"===u.my[0]&&(h.left-=r/2),"bottom"===u.my[1]?h.top-=l:"center"===u.my[1]&&(h.top-=l/2),h.left+=c[0],h.top+=c[1],i={marginLeft:e,marginTop:s},V.each(["left","top"],function(t,e){V.ui.position[y[t]]&&V.ui.position[y[t]][e](h,{targetWidth:p,targetHeight:f,elemWidth:r,elemHeight:l,collisionPosition:i,collisionWidth:n,collisionHeight:o,offset:[d[0]+c[0],d[1]+c[1]],my:u.my,at:u.at,within:v,elem:a})}),u.using&&(t=function(t){var e=g.left-h.left,i=e+p-r,s=g.top-h.top,n=s+f-l,o={target:{element:_,left:g.left,top:g.top,width:p,height:f},element:{element:a,left:h.left,top:h.top,width:r,height:l},horizontal:i<0?"left":0<e?"right":"center",vertical:n<0?"top":0<s?"bottom":"middle"};p<r&&k(e+i)<p&&(o.horizontal="center"),f<l&&k(s+n)<f&&(o.vertical="middle"),x(k(e),k(i))>x(k(s),k(n))?o.important="horizontal":o.important="vertical",u.using.call(this,t,o)}),a.offset(V.extend(h,{using:t}))})},V.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,a=s-o,r=o+e.collisionWidth-n-s;e.collisionWidth>n?0<a&&r<=0?(i=t.left+a+e.collisionWidth-n-s,t.left+=a-i):t.left=!(0<r&&a<=0)&&r<a?s+n-e.collisionWidth:s:0<a?t.left+=a:0<r?t.left-=r:t.left=x(t.left-o,t.left)},top:function(t,e){var i=e.within,s=i.isWindow?i.scrollTop:i.offset.top,n=e.within.height,o=t.top-e.collisionPosition.marginTop,a=s-o,r=o+e.collisionHeight-n-s;e.collisionHeight>n?0<a&&r<=0?(i=t.top+a+e.collisionHeight-n-s,t.top+=a-i):t.top=!(0<r&&a<=0)&&r<a?s+n-e.collisionHeight:s:0<a?t.top+=a:0<r?t.top-=r:t.top=x(t.top-o,t.top)}},flip:{left:function(t,e){var i=e.within,s=i.offset.left+i.scrollLeft,n=i.width,o=i.isWindow?i.scrollLeft:i.offset.left,a=t.left-e.collisionPosition.marginLeft,r=a-o,l=a+e.collisionWidth-n-o,h="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,i="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,a=-2*e.offset[0];r<0?((s=t.left+h+i+a+e.collisionWidth-n-s)<0||s<k(r))&&(t.left+=h+i+a):0<l&&(0<(o=t.left-e.collisionPosition.marginLeft+h+i+a-o)||k(o)<l)&&(t.left+=h+i+a)},top:function(t,e){var i=e.within,s=i.offset.top+i.scrollTop,n=i.height,o=i.isWindow?i.scrollTop:i.offset.top,a=t.top-e.collisionPosition.marginTop,r=a-o,l=a+e.collisionHeight-n-o,h="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,i="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,a=-2*e.offset[1];r<0?((s=t.top+h+i+a+e.collisionHeight-n-s)<0||s<k(r))&&(t.top+=h+i+a):0<l&&(0<(o=t.top-e.collisionPosition.marginTop+h+i+a-o)||k(o)<l)&&(t.top+=h+i+a)}},flipfit:{left:function(){V.ui.position.flip.left.apply(this,arguments),V.ui.position.fit.left.apply(this,arguments)},top:function(){V.ui.position.flip.top.apply(this,arguments),V.ui.position.fit.top.apply(this,arguments)}}};V.ui.position,V.extend(V.expr.pseudos,{data:V.expr.createPseudo?V.expr.createPseudo(function(e){return function(t){return!!V.data(t,e)}}):function(t,e,i){return!!V.data(t,i[3])}}),V.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}});var t,d=V,p={},e=p.toString,f=/^([\-+])=\s*(\d+\.?\d*)/,g=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),t[4]?(parseInt(t[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),t[4]?(parseInt(t[4]+t[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],m=d.Color=function(t,e,i,s){return new d.Color.fn.parse(t,e,i,s)},_={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},v={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},b=m.support={},y=d("<p>")[0],w=d.each;function P(t){return null==t?t+"":"object"==typeof t?p[e.call(t)]||"object":typeof t}function M(t,e,i){var s=v[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:Math.min(s.max,Math.max(0,t)))}function S(s){var n=m(),o=n._rgba=[];return s=s.toLowerCase(),w(g,function(t,e){var i=e.re.exec(s),i=i&&e.parse(i),e=e.space||"rgba";if(i)return i=n[e](i),n[_[e].cache]=i[_[e].cache],o=n._rgba=i._rgba,!1}),o.length?("0,0,0,0"===o.join()&&d.extend(o,B.transparent),n):B[s]}function H(t,e,i){return 6*(i=(i+1)%1)<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}y.style.cssText="background-color:rgba(1,1,1,.5)",b.rgba=-1<y.style.backgroundColor.indexOf("rgba"),w(_,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),d.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){p["[object "+e+"]"]=e.toLowerCase()}),(m.fn=d.extend(m.prototype,{parse:function(n,t,e,i){if(void 0===n)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=d(n).css(t),t=void 0);var o=this,s=P(n),a=this._rgba=[];return void 0!==t&&(n=[n,t,e,i],s="array"),"string"===s?this.parse(S(n)||B._default):"array"===s?(w(_.rgba.props,function(t,e){a[e.idx]=M(n[e.idx],e)}),this):"object"===s?(w(_,n instanceof m?function(t,e){n[e.cache]&&(o[e.cache]=n[e.cache].slice())}:function(t,i){var s=i.cache;w(i.props,function(t,e){if(!o[s]&&i.to){if("alpha"===t||null==n[t])return;o[s]=i.to(o._rgba)}o[s][e.idx]=M(n[t],e,!0)}),o[s]&&d.inArray(null,o[s].slice(0,3))<0&&(null==o[s][3]&&(o[s][3]=1),i.from&&(o._rgba=i.from(o[s])))}),this):void 0},is:function(t){var n=m(t),o=!0,a=this;return w(_,function(t,e){var i,s=n[e.cache];return s&&(i=a[e.cache]||e.to&&e.to(a._rgba)||[],w(e.props,function(t,e){if(null!=s[e.idx])return o=s[e.idx]===i[e.idx]})),o}),o},_space:function(){var i=[],s=this;return w(_,function(t,e){s[e.cache]&&i.push(t)}),i.pop()},transition:function(t,a){var e=(h=m(t))._space(),i=_[e],t=0===this.alpha()?m("transparent"):this,r=t[i.cache]||i.to(t._rgba),l=r.slice(),h=h[i.cache];return w(i.props,function(t,e){var i=e.idx,s=r[i],n=h[i],o=v[e.type]||{};null!==n&&(null===s?l[i]=n:(o.mod&&(n-s>o.mod/2?s+=o.mod:s-n>o.mod/2&&(s-=o.mod)),l[i]=M((n-s)*a+s,e)))}),this[e](l)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),i=e.pop(),s=m(t)._rgba;return m(d.map(e,function(t,e){return(1-i)*s[e]+i*t}))},toRgbaString:function(){var t="rgba(",e=d.map(this._rgba,function(t,e){return null!=t?t:2<e?1:0});return 1===e[3]&&(e.pop(),t="rgb("),t+e.join()+")"},toHslaString:function(){var t="hsla(",e=d.map(this.hsla(),function(t,e){return null==t&&(t=2<e?1:0),t=e&&e<3?Math.round(100*t)+"%":t});return 1===e[3]&&(e.pop(),t="hsl("),t+e.join()+")"},toHexString:function(t){var e=this._rgba.slice(),i=e.pop();return t&&e.push(~~(255*i)),"#"+d.map(e,function(t){return 1===(t=(t||0).toString(16)).length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}})).parse.prototype=m.fn,_.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/255,i=t[1]/255,s=t[2]/255,n=t[3],o=Math.max(e,i,s),a=Math.min(e,i,s),r=o-a,l=o+a,t=.5*l,i=a===o?0:e===o?60*(i-s)/r+360:i===o?60*(s-e)/r+120:60*(e-i)/r+240,l=0==r?0:t<=.5?r/l:r/(2-l);return[Math.round(i)%360,l,t,null==n?1:n]},_.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],t=t[3],i=s<=.5?s*(1+i):s+i-s*i,s=2*s-i;return[Math.round(255*H(s,i,e+1/3)),Math.round(255*H(s,i,e)),Math.round(255*H(s,i,e-1/3)),t]},w(_,function(l,t){var e=t.props,o=t.cache,a=t.to,r=t.from;m.fn[l]=function(t){if(a&&!this[o]&&(this[o]=a(this._rgba)),void 0===t)return this[o].slice();var i=P(t),s="array"===i||"object"===i?t:arguments,n=this[o].slice();return w(e,function(t,e){t=s["object"===i?t:e.idx];null==t&&(t=n[e.idx]),n[e.idx]=M(t,e)}),r?((t=m(r(n)))[o]=n,t):m(n)},w(e,function(a,r){m.fn[a]||(m.fn[a]=function(t){var e,i=P(t),s="alpha"===a?this._hsla?"hsla":"rgba":l,n=this[s](),o=n[r.idx];return"undefined"===i?o:("function"===i&&(i=P(t=t.call(this,o))),null==t&&r.empty?this:("string"===i&&(e=f.exec(t))&&(t=o+parseFloat(e[2])*("+"===e[1]?1:-1)),n[r.idx]=t,this[s](n)))})})}),(m.hook=function(t){t=t.split(" ");w(t,function(t,o){d.cssHooks[o]={set:function(t,e){var i,s,n="";if("transparent"!==e&&("string"!==P(e)||(i=S(e)))){if(e=m(i||e),!b.rgba&&1!==e._rgba[3]){for(s="backgroundColor"===o?t.parentNode:t;(""===n||"transparent"===n)&&s&&s.style;)try{n=d.css(s,"backgroundColor"),s=s.parentNode}catch(t){}e=e.blend(n&&"transparent"!==n?n:"_default")}e=e.toRgbaString()}try{t.style[o]=e}catch(t){}}},d.fx.step[o]=function(t){t.colorInit||(t.start=m(t.elem,o),t.end=m(t.end),t.colorInit=!0),d.cssHooks[o].set(t.elem,t.start.transition(t.end,t.pos))}})})("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),d.cssHooks.borderColor={expand:function(i){var s={};return w(["Top","Right","Bottom","Left"],function(t,e){s["border"+e+"Color"]=i}),s}};var z,A,O,N,E,W,F,L,R,Y,B=d.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"},j="ui-effects-",q="ui-effects-style",K="ui-effects-animated";function U(t){var e,i,s=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,n={};if(s&&s.length&&s[0]&&s[s[0]])for(i=s.length;i--;)"string"==typeof s[e=s[i]]&&(n[e.replace(/-([\da-z])/gi,function(t,e){return e.toUpperCase()})]=s[e]);else for(e in s)"string"==typeof s[e]&&(n[e]=s[e]);return n}function X(t,e,i,s){return t={effect:t=V.isPlainObject(t)?(e=t).effect:t},"function"==typeof(e=null==e?{}:e)&&(s=e,i=null,e={}),"number"!=typeof e&&!V.fx.speeds[e]||(s=i,i=e,e={}),"function"==typeof i&&(s=i,i=null),e&&V.extend(t,e),i=i||e.duration,t.duration=V.fx.off?0:"number"==typeof i?i:i in V.fx.speeds?V.fx.speeds[i]:V.fx.speeds._default,t.complete=s||e.complete,t}function $(t){return!t||"number"==typeof t||V.fx.speeds[t]||("string"==typeof t&&!V.effects.effect[t]||("function"==typeof t||"object"==typeof t&&!t.effect))}function G(t,e){var i=e.outerWidth(),e=e.outerHeight(),t=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(t)||["",0,i,e,0];return{top:parseFloat(t[1])||0,right:"auto"===t[2]?i:parseFloat(t[2]),bottom:"auto"===t[3]?e:parseFloat(t[3]),left:parseFloat(t[4])||0}}V.effects={effect:{}},N=["add","remove","toggle"],E={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1},V.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,e){V.fx.step[e]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(d.style(t.elem,e,t.end),t.setAttr=!0)}}),V.fn.addBack||(V.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),V.effects.animateClass=function(n,t,e,i){var o=V.speed(t,e,i);return this.queue(function(){var i=V(this),t=i.attr("class")||"",e=(e=o.children?i.find("*").addBack():i).map(function(){return{el:V(this),start:U(this)}}),s=function(){V.each(N,function(t,e){n[e]&&i[e+"Class"](n[e])})};s(),e=e.map(function(){return this.end=U(this.el[0]),this.diff=function(t,e){var i,s,n={};for(i in e)s=e[i],t[i]!==s&&(E[i]||!V.fx.step[i]&&isNaN(parseFloat(s))||(n[i]=s));return n}(this.start,this.end),this}),i.attr("class",t),e=e.map(function(){var t=this,e=V.Deferred(),i=V.extend({},o,{queue:!1,complete:function(){e.resolve(t)}});return this.el.animate(this.diff,i),e.promise()}),V.when.apply(V,e.get()).done(function(){s(),V.each(arguments,function(){var e=this.el;V.each(this.diff,function(t){e.css(t,"")})}),o.complete.call(i[0])})})},V.fn.extend({addClass:(O=V.fn.addClass,function(t,e,i,s){return e?V.effects.animateClass.call(this,{add:t},e,i,s):O.apply(this,arguments)}),removeClass:(A=V.fn.removeClass,function(t,e,i,s){return 1<arguments.length?V.effects.animateClass.call(this,{remove:t},e,i,s):A.apply(this,arguments)}),toggleClass:(z=V.fn.toggleClass,function(t,e,i,s,n){return"boolean"==typeof e||void 0===e?i?V.effects.animateClass.call(this,e?{add:t}:{remove:t},i,s,n):z.apply(this,arguments):V.effects.animateClass.call(this,{toggle:t},e,i,s)}),switchClass:function(t,e,i,s,n){return V.effects.animateClass.call(this,{add:e,remove:t},i,s,n)}}),V.expr&&V.expr.pseudos&&V.expr.pseudos.animated&&(V.expr.pseudos.animated=(W=V.expr.pseudos.animated,function(t){return!!V(t).data(K)||W(t)})),!1!==V.uiBackCompat&&V.extend(V.effects,{save:function(t,e){for(var i=0,s=e.length;i<s;i++)null!==e[i]&&t.data(j+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;s<n;s++)null!==e[s]&&(i=t.data(j+e[s]),t.css(e[s],i))},setMode:function(t,e){return e="toggle"===e?t.is(":hidden")?"show":"hide":e},createWrapper:function(i){if(i.parent().is(".ui-effects-wrapper"))return i.parent();var s={width:i.outerWidth(!0),height:i.outerHeight(!0),float:i.css("float")},t=V("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:i.width(),height:i.height()},n=document.activeElement;try{n.id}catch(t){n=document.body}return i.wrap(t),i[0]!==n&&!V.contains(i[0],n)||V(n).trigger("focus"),t=i.parent(),"static"===i.css("position")?(t.css({position:"relative"}),i.css({position:"relative"})):(V.extend(s,{position:i.css("position"),zIndex:i.css("z-index")}),V.each(["top","left","bottom","right"],function(t,e){s[e]=i.css(e),isNaN(parseInt(s[e],10))&&(s[e]="auto")}),i.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),i.css(e),t.css(s).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!V.contains(t[0],e)||V(e).trigger("focus")),t}}),V.extend(V.effects,{version:"1.13.2",define:function(t,e,i){return i||(i=e,e="effect"),V.effects.effect[t]=i,V.effects.effect[t].mode=e,i},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,e="vertical"!==i?(e||100)/100:1;return{height:t.height()*e,width:t.width()*s,outerHeight:t.outerHeight()*e,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();1<e&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(q,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(q)||"",t.removeData(q)},mode:function(t,e){t=t.is(":hidden");return"toggle"===e&&(e=t?"show":"hide"),e=(t?"hide"===e:"show"===e)?"none":e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(t){var e,i=t.css("position"),s=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(i)&&(i="absolute",e=V("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(j+"placeholder",e)),t.css({position:i,left:s.left,top:s.top}),e},removePlaceholder:function(t){var e=j+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(t){V.effects.restoreStyle(t),V.effects.removePlaceholder(t)},setTransition:function(s,t,n,o){return o=o||{},V.each(t,function(t,e){var i=s.cssUnit(e);0<i[0]&&(o[e]=i[0]*n+i[1])}),o}}),V.fn.extend({effect:function(){function t(t){var e=V(this),i=V.effects.mode(e,r)||o;e.data(K,!0),l.push(i),o&&("show"===i||i===o&&"hide"===i)&&e.show(),o&&"none"===i||V.effects.saveStyle(e),"function"==typeof t&&t()}var s=X.apply(this,arguments),n=V.effects.effect[s.effect],o=n.mode,e=s.queue,i=e||"fx",a=s.complete,r=s.mode,l=[];return V.fx.off||!n?r?this[r](s.duration,a):this.each(function(){a&&a.call(this)}):!1===e?this.each(t).each(h):this.queue(i,t).queue(i,h);function h(t){var e=V(this);function i(){"function"==typeof a&&a.call(e[0]),"function"==typeof t&&t()}s.mode=l.shift(),!1===V.uiBackCompat||o?"none"===s.mode?(e[r](),i()):n.call(e[0],s,function(){e.removeData(K),V.effects.cleanUp(e),"hide"===s.mode&&e.hide(),i()}):(e.is(":hidden")?"hide"===r:"show"===r)?(e[r](),i()):n.call(e[0],s,i)}},show:(R=V.fn.show,function(t){if($(t))return R.apply(this,arguments);t=X.apply(this,arguments);return t.mode="show",this.effect.call(this,t)}),hide:(L=V.fn.hide,function(t){if($(t))return L.apply(this,arguments);t=X.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)}),toggle:(F=V.fn.toggle,function(t){if($(t)||"boolean"==typeof t)return F.apply(this,arguments);t=X.apply(this,arguments);return t.mode="toggle",this.effect.call(this,t)}),cssUnit:function(t){var i=this.css(t),s=[];return V.each(["em","px","%","pt"],function(t,e){0<i.indexOf(e)&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):G(this.css("clip"),this)},transfer:function(t,e){var i=V(this),s=V(t.to),n="fixed"===s.css("position"),o=V("body"),a=n?o.scrollTop():0,r=n?o.scrollLeft():0,o=s.offset(),o={top:o.top-a,left:o.left-r,height:s.innerHeight(),width:s.innerWidth()},s=i.offset(),l=V("<div class='ui-effects-transfer'></div>");l.appendTo("body").addClass(t.className).css({top:s.top-a,left:s.left-r,height:i.innerHeight(),width:i.innerWidth(),position:n?"fixed":"absolute"}).animate(o,t.duration,t.easing,function(){l.remove(),"function"==typeof e&&e()})}}),V.fx.step.clip=function(t){t.clipInit||(t.start=V(t.elem).cssClip(),"string"==typeof t.end&&(t.end=G(t.end,t.elem)),t.clipInit=!0),V(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},Y={},V.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){Y[t]=function(t){return Math.pow(t,e+2)}}),V.extend(Y,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),V.each(Y,function(t,e){V.easing["easeIn"+t]=e,V.easing["easeOut"+t]=function(t){return 1-e(1-t)},V.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}});y=V.effects,V.effects.define("blind","hide",function(t,e){var i={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},s=V(this),n=t.direction||"up",o=s.cssClip(),a={clip:V.extend({},o)},r=V.effects.createPlaceholder(s);a.clip[i[n][0]]=a.clip[i[n][1]],"show"===t.mode&&(s.cssClip(a.clip),r&&r.css(V.effects.clipToBox(a)),a.clip=o),r&&r.animate(V.effects.clipToBox(a),t.duration,t.easing),s.animate(a,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("bounce",function(t,e){var i,s,n=V(this),o=t.mode,a="hide"===o,r="show"===o,l=t.direction||"up",h=t.distance,c=t.times||5,o=2*c+(r||a?1:0),u=t.duration/o,d=t.easing,p="up"===l||"down"===l?"top":"left",f="up"===l||"left"===l,g=0,t=n.queue().length;for(V.effects.createPlaceholder(n),l=n.css(p),h=h||n["top"==p?"outerHeight":"outerWidth"]()/3,r&&((s={opacity:1})[p]=l,n.css("opacity",0).css(p,f?2*-h:2*h).animate(s,u,d)),a&&(h/=Math.pow(2,c-1)),(s={})[p]=l;g<c;g++)(i={})[p]=(f?"-=":"+=")+h,n.animate(i,u,d).animate(s,u,d),h=a?2*h:h/2;a&&((i={opacity:0})[p]=(f?"-=":"+=")+h,n.animate(i,u,d)),n.queue(e),V.effects.unshift(n,t,1+o)}),V.effects.define("clip","hide",function(t,e){var i={},s=V(this),n=t.direction||"vertical",o="both"===n,a=o||"horizontal"===n,o=o||"vertical"===n,n=s.cssClip();i.clip={top:o?(n.bottom-n.top)/2:n.top,right:a?(n.right-n.left)/2:n.right,bottom:o?(n.bottom-n.top)/2:n.bottom,left:a?(n.right-n.left)/2:n.left},V.effects.createPlaceholder(s),"show"===t.mode&&(s.cssClip(i.clip),i.clip=n),s.animate(i,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("drop","hide",function(t,e){var i=V(this),s="show"===t.mode,n=t.direction||"left",o="up"===n||"down"===n?"top":"left",a="up"===n||"left"===n?"-=":"+=",r="+="==a?"-=":"+=",l={opacity:0};V.effects.createPlaceholder(i),n=t.distance||i["top"==o?"outerHeight":"outerWidth"](!0)/2,l[o]=a+n,s&&(i.css(l),l[o]=r+n,l.opacity=1),i.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("explode","hide",function(t,e){var i,s,n,o,a,r,l=t.pieces?Math.round(Math.sqrt(t.pieces)):3,h=l,c=V(this),u="show"===t.mode,d=c.show().css("visibility","hidden").offset(),p=Math.ceil(c.outerWidth()/h),f=Math.ceil(c.outerHeight()/l),g=[];function m(){g.push(this),g.length===l*h&&(c.css({visibility:"visible"}),V(g).remove(),e())}for(i=0;i<l;i++)for(o=d.top+i*f,r=i-(l-1)/2,s=0;s<h;s++)n=d.left+s*p,a=s-(h-1)/2,c.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-s*p,top:-i*f}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:p,height:f,left:n+(u?a*p:0),top:o+(u?r*f:0),opacity:u?0:1}).animate({left:n+(u?0:a*p),top:o+(u?0:r*f),opacity:u?1:0},t.duration||500,t.easing,m)}),V.effects.define("fade","toggle",function(t,e){var i="show"===t.mode;V(this).css("opacity",i?0:1).animate({opacity:i?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("fold","hide",function(e,t){var i=V(this),s=e.mode,n="show"===s,o="hide"===s,a=e.size||15,r=/([0-9]+)%/.exec(a),l=!!e.horizFirst?["right","bottom"]:["bottom","right"],h=e.duration/2,c=V.effects.createPlaceholder(i),u=i.cssClip(),d={clip:V.extend({},u)},p={clip:V.extend({},u)},f=[u[l[0]],u[l[1]]],s=i.queue().length;r&&(a=parseInt(r[1],10)/100*f[o?0:1]),d.clip[l[0]]=a,p.clip[l[0]]=a,p.clip[l[1]]=0,n&&(i.cssClip(p.clip),c&&c.css(V.effects.clipToBox(p)),p.clip=u),i.queue(function(t){c&&c.animate(V.effects.clipToBox(d),h,e.easing).animate(V.effects.clipToBox(p),h,e.easing),t()}).animate(d,h,e.easing).animate(p,h,e.easing).queue(t),V.effects.unshift(i,s,4)}),V.effects.define("highlight","show",function(t,e){var i=V(this),s={backgroundColor:i.css("backgroundColor")};"hide"===t.mode&&(s.opacity=0),V.effects.saveStyle(i),i.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("size",function(s,e){var n,i=V(this),t=["fontSize"],o=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],a=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],r=s.mode,l="effect"!==r,h=s.scale||"both",c=s.origin||["middle","center"],u=i.css("position"),d=i.position(),p=V.effects.scaledDimensions(i),f=s.from||p,g=s.to||V.effects.scaledDimensions(i,0);V.effects.createPlaceholder(i),"show"===r&&(r=f,f=g,g=r),n={from:{y:f.height/p.height,x:f.width/p.width},to:{y:g.height/p.height,x:g.width/p.width}},"box"!==h&&"both"!==h||(n.from.y!==n.to.y&&(f=V.effects.setTransition(i,o,n.from.y,f),g=V.effects.setTransition(i,o,n.to.y,g)),n.from.x!==n.to.x&&(f=V.effects.setTransition(i,a,n.from.x,f),g=V.effects.setTransition(i,a,n.to.x,g))),"content"!==h&&"both"!==h||n.from.y!==n.to.y&&(f=V.effects.setTransition(i,t,n.from.y,f),g=V.effects.setTransition(i,t,n.to.y,g)),c&&(c=V.effects.getBaseline(c,p),f.top=(p.outerHeight-f.outerHeight)*c.y+d.top,f.left=(p.outerWidth-f.outerWidth)*c.x+d.left,g.top=(p.outerHeight-g.outerHeight)*c.y+d.top,g.left=(p.outerWidth-g.outerWidth)*c.x+d.left),delete f.outerHeight,delete f.outerWidth,i.css(f),"content"!==h&&"both"!==h||(o=o.concat(["marginTop","marginBottom"]).concat(t),a=a.concat(["marginLeft","marginRight"]),i.find("*[width]").each(function(){var t=V(this),e=V.effects.scaledDimensions(t),i={height:e.height*n.from.y,width:e.width*n.from.x,outerHeight:e.outerHeight*n.from.y,outerWidth:e.outerWidth*n.from.x},e={height:e.height*n.to.y,width:e.width*n.to.x,outerHeight:e.height*n.to.y,outerWidth:e.width*n.to.x};n.from.y!==n.to.y&&(i=V.effects.setTransition(t,o,n.from.y,i),e=V.effects.setTransition(t,o,n.to.y,e)),n.from.x!==n.to.x&&(i=V.effects.setTransition(t,a,n.from.x,i),e=V.effects.setTransition(t,a,n.to.x,e)),l&&V.effects.saveStyle(t),t.css(i),t.animate(e,s.duration,s.easing,function(){l&&V.effects.restoreStyle(t)})})),i.animate(g,{queue:!1,duration:s.duration,easing:s.easing,complete:function(){var t=i.offset();0===g.opacity&&i.css("opacity",f.opacity),l||(i.css("position","static"===u?"relative":u).offset(t),V.effects.saveStyle(i)),e()}})}),V.effects.define("scale",function(t,e){var i=V(this),s=t.mode,s=parseInt(t.percent,10)||(0===parseInt(t.percent,10)||"effect"!==s?0:100),s=V.extend(!0,{from:V.effects.scaledDimensions(i),to:V.effects.scaledDimensions(i,s,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(s.from.opacity=1,s.to.opacity=0),V.effects.effect.size.call(this,s,e)}),V.effects.define("puff","hide",function(t,e){t=V.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});V.effects.effect.scale.call(this,t,e)}),V.effects.define("pulsate","show",function(t,e){var i=V(this),s=t.mode,n="show"===s,o=2*(t.times||5)+(n||"hide"===s?1:0),a=t.duration/o,r=0,l=1,s=i.queue().length;for(!n&&i.is(":visible")||(i.css("opacity",0).show(),r=1);l<o;l++)i.animate({opacity:r},a,t.easing),r=1-r;i.animate({opacity:r},a,t.easing),i.queue(e),V.effects.unshift(i,s,1+o)}),V.effects.define("shake",function(t,e){var i=1,s=V(this),n=t.direction||"left",o=t.distance||20,a=t.times||3,r=2*a+1,l=Math.round(t.duration/r),h="up"===n||"down"===n?"top":"left",c="up"===n||"left"===n,u={},d={},p={},n=s.queue().length;for(V.effects.createPlaceholder(s),u[h]=(c?"-=":"+=")+o,d[h]=(c?"+=":"-=")+2*o,p[h]=(c?"-=":"+=")+2*o,s.animate(u,l,t.easing);i<a;i++)s.animate(d,l,t.easing).animate(p,l,t.easing);s.animate(d,l,t.easing).animate(u,l/2,t.easing).queue(e),V.effects.unshift(s,n,1+r)}),V.effects.define("slide","show",function(t,e){var i,s,n=V(this),o={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},a=t.mode,r=t.direction||"left",l="up"===r||"down"===r?"top":"left",h="up"===r||"left"===r,c=t.distance||n["top"==l?"outerHeight":"outerWidth"](!0),u={};V.effects.createPlaceholder(n),i=n.cssClip(),s=n.position()[l],u[l]=(h?-1:1)*c+s,u.clip=n.cssClip(),u.clip[o[r][1]]=u.clip[o[r][0]],"show"===a&&(n.cssClip(u.clip),n.css(l,u[l]),u.clip=i,u[l]=s),n.animate(u,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),y=!1!==V.uiBackCompat?V.effects.define("transfer",function(t,e){V(this).transfer(t,e)}):y;V.ui.focusable=function(t,e){var i,s,n,o,a=t.nodeName.toLowerCase();return"area"===a?(s=(i=t.parentNode).name,!(!t.href||!s||"map"!==i.nodeName.toLowerCase())&&(0<(s=V("img[usemap='#"+s+"']")).length&&s.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(a)?(n=!t.disabled)&&(o=V(t).closest("fieldset")[0])&&(n=!o.disabled):n="a"===a&&t.href||e,n&&V(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"visible"===e}(V(t)))},V.extend(V.expr.pseudos,{focusable:function(t){return V.ui.focusable(t,null!=V.attr(t,"tabindex"))}});var Q,J;V.ui.focusable,V.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):V(this[0].form)},V.ui.formResetMixin={_formResetHandler:function(){var e=V(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");V.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element._form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(V.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}};V.expr.pseudos||(V.expr.pseudos=V.expr[":"]),V.uniqueSort||(V.uniqueSort=V.unique),V.escapeSelector||(Q=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,J=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},V.escapeSelector=function(t){return(t+"").replace(Q,J)}),V.fn.even&&V.fn.odd||V.fn.extend({even:function(){return this.filter(function(t){return t%2==0})},odd:function(){return this.filter(function(t){return t%2==1})}});var Z;V.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},V.fn.labels=function(){var t,e,i;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+V.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e)):this.pushStack([])},V.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=V(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:V(this[0].ownerDocument||document)},V.extend(V.expr.pseudos,{tabbable:function(t){var e=V.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&V.ui.focusable(t,i)}}),V.fn.extend({uniqueId:(Z=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++Z)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&V(this).removeAttr("id")})}}),V.widget("ui.accordion",{version:"1.13.2",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:function(t){return t.find("> li > :first-child").add(t.find("> :not(li)").even())},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=V(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():V()}},_createIcons:function(){var t,e=this.options.icons;e&&(t=V("<span>"),this._addClass(t,"ui-accordion-header-icon","ui-icon "+e.header),t.prependTo(this.headers),t=this.active.children(".ui-accordion-header-icon"),this._removeClass(t,e.header)._addClass(t,null,e.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"!==t?("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons())):this._activate(e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var e=V.ui.keyCode,i=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case e.RIGHT:case e.DOWN:n=this.headers[(s+1)%i];break;case e.LEFT:case e.UP:n=this.headers[(s-1+i)%i];break;case e.SPACE:case e.ENTER:this._eventHandler(t);break;case e.HOME:n=this.headers[0];break;case e.END:n=this.headers[i-1]}n&&(V(t.target).attr("tabIndex",-1),V(n).attr("tabIndex",0),V(n).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===V.ui.keyCode.UP&&t.ctrlKey&&V(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=V()):!1===t.active?this._activate(0):this.active.length&&!V.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=V()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;"function"==typeof this.options.header?this.headers=this.options.header(this.element):this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var i,t=this.options,e=t.heightStyle,s=this.element.parent();this.active=this._findActive(t.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=V(this),e=t.uniqueId().attr("id"),i=t.next(),s=i.uniqueId().attr("id");t.attr("aria-controls",s),i.attr("aria-labelledby",e)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(t.event),"fill"===e?(i=s.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=V(this).outerHeight(!0)}),this.headers.next().each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.headers.next().each(function(){var t=V(this).is(":visible");t||V(this).show(),i=Math.max(i,V(this).css("height","").height()),t||V(this).hide()}).height(i))},_activate:function(t){t=this._findActive(t)[0];t!==this.active[0]&&(t=t||this.active[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):V()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():s.next(),r=i.next(),a={oldHeader:i,oldPanel:r,newHeader:o?V():s,newPanel:a};t.preventDefault(),n&&!e.collapsible||!1===this._trigger("beforeActivate",t,a)||(e.active=!o&&this.headers.index(s),this.active=n?V():s,this._toggle(a),this._removeClass(i,"ui-accordion-header-active","ui-state-active"),e.icons&&(i=i.children(".ui-accordion-header-icon"),this._removeClass(i,null,e.icons.activeHeader)._addClass(i,null,e.icons.header)),n||(this._removeClass(s,"ui-accordion-header-collapsed")._addClass(s,"ui-accordion-header-active","ui-state-active"),e.icons&&(n=s.children(".ui-accordion-header-icon"),this._removeClass(n,null,e.icons.header)._addClass(n,null,e.icons.activeHeader)),this._addClass(s.next(),"ui-accordion-content-active")))},_toggle:function(t){var e=t.newPanel,i=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=e,this.prevHide=i,this.options.animate?this._animate(e,i,t):(i.hide(),e.show(),this._toggleComplete(t)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),e.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):e.length&&this.headers.filter(function(){return 0===parseInt(V(this).attr("tabIndex"),10)}).attr("tabIndex",-1),e.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,i,e){var s,n,o,a=this,r=0,l=t.css("box-sizing"),h=t.length&&(!i.length||t.index()<i.index()),c=this.options.animate||{},u=h&&c.down||c,h=function(){a._toggleComplete(e)};return n=(n="string"==typeof u?u:n)||u.easing||c.easing,o=(o="number"==typeof u?u:o)||u.duration||c.duration,i.length?t.length?(s=t.show().outerHeight(),i.animate(this.hideProps,{duration:o,easing:n,step:function(t,e){e.now=Math.round(t)}}),void t.hide().animate(this.showProps,{duration:o,easing:n,complete:h,step:function(t,e){e.now=Math.round(t),"height"!==e.prop?"content-box"===l&&(r+=e.now):"content"!==a.options.heightStyle&&(e.now=Math.round(s-i.outerHeight()-r),r=0)}})):i.animate(this.hideProps,o,n,h):t.animate(this.showProps,o,n,h)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),V.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return i=!(i=i||e.body).nodeName?e.body:i},V.widget("ui.menu",{version:"1.13.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.lastMousePosition={x:null,y:null},this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault(),this._activateItem(t)},"click .ui-menu-item":function(t){var e=V(t.target),i=V(V.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this._menuItems().first();e||this.focus(t,i)},blur:function(t){this._delay(function(){V.contains(this.element[0],V.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t,!0),this.mouseHandled=!1}})},_activateItem:function(t){var e,i;this.previousFilter||t.clientX===this.lastMousePosition.x&&t.clientY===this.lastMousePosition.y||(this.lastMousePosition={x:t.clientX,y:t.clientY},e=V(t.target).closest(".ui-menu-item"),i=V(t.currentTarget),e[0]===i[0]&&(i.is(".ui-state-active")||(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i))))},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=V(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n=!0;switch(t.keyCode){case V.ui.keyCode.PAGE_UP:this.previousPage(t);break;case V.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case V.ui.keyCode.HOME:this._move("first","first",t);break;case V.ui.keyCode.END:this._move("last","last",t);break;case V.ui.keyCode.UP:this.previous(t);break;case V.ui.keyCode.DOWN:this.next(t);break;case V.ui.keyCode.LEFT:this.collapse(t);break;case V.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case V.ui.keyCode.ENTER:case V.ui.keyCode.SPACE:this._activate(t);break;case V.ui.keyCode.ESCAPE:this.collapse(t);break;default:e=this.previousFilter||"",s=n=!1,i=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===e?s=!0:i=e+i,e=this._filterMenuItems(i),(e=s&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(i=String.fromCharCode(t.keyCode),e=this._filterMenuItems(i)),e.length?(this.focus(t,e),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=V(this),e=t.prev(),i=V("<span>").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(t=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=V(this);s._isDivider(t)&&s._addClass(t,"ui-menu-divider","ui-widget-content")}),i=(e=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(e,"ui-menu-item")._addClass(i,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!V.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s;this._hasScroll()&&(i=parseFloat(V.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(V.css(this.activeMenu[0],"paddingTop"))||0,e=t.offset().top-this.activeMenu.offset().top-i-s,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),t=t.outerHeight(),e<0?this.activeMenu.scrollTop(i+e):s<e+t&&this.activeMenu.scrollTop(i+e-s+t))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(t){var e=V.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(e)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var t=i?this.element:V(e&&e.target).closest(this.element.find(".ui-menu"));t.length||(t=this.element),this._close(t),this.blur(e),this._removeClass(t.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=t},i?0:this.delay)},_close:function(t){(t=t||(this.active?this.active.parent():this.element)).find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","fal
98se")},_closeOnDocumentClick:function(t){return!V(t.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this._menuItems(this.active.children(".ui-menu")).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_menuItems:function(t){return(t||this.element).find(this.options.items).filter(".ui-menu-item")},_move:function(t,e,i){var s;(s=this.active?"first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").last():this.active[t+"All"](".ui-menu-item").first():s)&&s.length&&this.active||(s=this._menuItems(this.activeMenu)[e]()),this.focus(i,s)},nextPage:function(t){var e,i,s;this.active?this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===V.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.nextAll(".ui-menu-item").each(function(){return(e=V(this)).offset().top-i-s<0}),this.focus(t,e)):this.focus(t,this._menuItems(this.activeMenu)[this.active?"last":"first"]())):this.next(t)},previousPage:function(t){var e,i,s;this.active?this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===V.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.prevAll(".ui-menu-item").each(function(){return 0<(e=V(this)).offset().top-i+s}),this.focus(t,e)):this.focus(t,this._menuItems(this.activeMenu).first())):this.next(t)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||V(t.target).closest(".ui-menu-item");var e={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,e)},_filterMenuItems:function(t){var t=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),e=new RegExp("^"+t,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return e.test(String.prototype.trim.call(V(this).children(".ui-menu-item-wrapper").text()))})}});V.widget("ui.autocomplete",{version:"1.13.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,t="input"===t;this.isMultiLine=e||!t&&this._isContentEditable(this.element),this.valueMethod=this.element[e||t?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault());if(!s){var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value(
vendor: 12,087 bytes, line 98
98)},blur:function(t){clearTimeout(this.searching),this.close(t),this._change(t)}}),this._initSource(),this.menu=V("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault()},menufocus:function(t,e){var i,s;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){V(t.target).trigger(t.originalEvent)});s=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:s})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value),(i=e.item.attr("aria-label")||s.value)&&String.prototype.trim.call(i).length&&(clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(V("<div>").text(i))},100))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==V.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=V("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||V.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?V(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(V.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=V.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")}.bind(this)},__response:function(t){t=t&&this._normalize(t),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:V.map(t,function(t){return"string"==typeof t?{label:t,value:t}:V.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var e=this.menu.element.empty();this._renderMenu(e,t),this.isNewMenu=!0,this.menu.refresh(),e.show(),this._resizeMenu(),e.position(V.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(i,t){var s=this;V.each(t,function(t,e){s._renderItemData(i,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(t,e){return V("<li>").append(V("<div>").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),V.extend(V.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(V.ui.autocomplete.escapeRegex(e),"i");return V.grep(t,function(t){return i.test(t.label||t.value||t)})}}),V.widget("ui.autocomplete",V.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1<t?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(V("<div>").text(e))},100))}});V.ui.autocomplete;var tt=/ui-corner-([a-z]){2,6}/g;V.widget("ui.controlgroup",{version:"1.13.2",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var o=this,a=[];V.each(this.options.items,function(s,t){var e,n={};if(t)return"controlgroupLabel"===s?((e=o.element.find(t)).each(function(){var t=V(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),o._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),void(a=a.concat(e.get()))):void(V.fn[s]&&(n=o["_"+s+"Options"]?o["_"+s+"Options"]("middle"):{classes:{}},o.element.find(t).each(function(){var t=V(this),e=t[s]("instance"),i=V.widget.extend({},n);"button"===s&&t.parent(".ui-spinner").length||((e=e||t[s]()[s]("instance"))&&(i.classes=o._resolveClassesValues(i.classes,e)),t[s](i),i=t[s]("widget"),V.data(i[0],"ui-controlgroup-data",e||t[s]("instance")),a.push(i[0]))})))}),this.childWidgets=V(V.uniqueSort(a)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=V(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){e=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,e)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){t=this._buildSimpleOptions(t,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,s){var n={};return V.each(i,function(t){var e=s.options.classes[t]||"",e=String.prototype.trim.call(e.replace(tt,""));n[t]=(e+" "+i[t]).replace(/\s+/g," ")}),n},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var n,o=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),n=this.childWidgets,(n=this.options.onlyVisible?n.filter(":visible"):n).length&&(V.each(["first","last"],function(t,e){var i,s=n[e]().data("ui-controlgroup-data");s&&o["_"+s.widgetName+"Options"]?((i=o["_"+s.widgetName+"Options"](1===n.length?"only":e)).classes=o._resolveClassesValues(i.classes,s),s.element[s.widgetName](i)):o._updateCornerClass(n[e](),e)}),this._callChildMethod("refresh"))}});V.widget("ui.checkboxradio",[V.ui.formResetMixin,{version:"1.13.2",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,e=this._super()||{};return this._readType(),t=this.element.labels(),this.label=V(t[t.length-1]),this.label.length||V.error("No label found for checkboxradio widget"),this.originalLabel="",(t=this.label.contents().not(this.element[0])).length&&(this.originalLabel+=t.clone().wrapAll("<div></div>").parent().html()),this.originalLabel&&(e.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(e.disabled=t),e},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();
vendor: 1,426 bytes, line 98
98this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||V.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,e="input[name='"+V.escapeSelector(t)+"']";return t?(this.form.length?V(this.form[0].elements).filter(e):V(e).filter(function(){return 0===V(this)._form().length})).not(this.element):V([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=V(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(t){var e="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=V("<span>"),this.iconSpace=V("<span> </span>
98"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(e+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):e+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",e),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),(t=this.iconSpace?t.not(this.iconSpace[0]):t).remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]);var et;V.ui.checkboxradio;V.widget("ui.button",{version:"1.13.2",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),null!=(t=this.element[0].disabled)&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===V.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,e){var i="iconPosition"!==t,s=i?this.options.iconPosition:e,t="top"===s||"bottom"===s;this.icon?i&&this._removeClass(this.icon,null,this.options.icon):(this.icon=V("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),i&&this._addClass(this.icon,null,e),this._attachIcon(s),t?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconS
vendor: 13,579 bytes, line 98
98pace||(this.iconSpace=V("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(s))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=(void 0===t.showLabel?this.options:t).showLabel,i=(void 0===t.icon?this.options:t).icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),(this.element[0].disabled=e)&&this.element.trigger("blur"))},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!1!==V.uiBackCompat&&(V.widget("ui.button",V.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){"text"!==t?("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",e)}}),V.fn.button=(et=V.fn.button,function(i){var t="string"==typeof i,s=Array.prototype.slice.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t=V(this).attr("type"),e=V.data(this,"ui-"+("checkbox"!==t&&"radio"!==t?"button":"checkboxradio"));return"instance"===i?(n=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?V.error("no such method '"+i+"' for button widget instance"):(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:V.error("cannot call methods on button prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=V.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=V(this).attr("type"),e="checkbox"!==t&&"radio"!==t?"button":"checkboxradio",t=V.data(this,"ui-"+e);t?(t.option(i||{}),t._init&&t._init()):"button"!=e?V(this).checkboxradio(V.extend({icon:!1},i)):et.call(V(this),i)})),n}),V.fn.buttonset=function(){return V.ui.controlgroup||V.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))});var it;V.ui.button;function st(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:"",selectMonthLabel:"Select month",selectYearLabel:"Select year"},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},V.extend(this._defaults,this.regional[""]),this.regional.en=V.extend(!0,{},this.regional[""]),this.regional["en-US"]=V.extend(!0,{},this.regional.en),this.dpDiv=nt(V("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function nt(t){var e="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.on("mouseout",e,function(){V(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",e,ot)}function ot(){V.datepicker._isDisabledDatepicker((it.inline?it.dpDiv.parent():it.input)[0])||(V(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),V(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).addClass("ui-datepicker-next-hover"))}function at(t,e){for(var i in V.extend(t,e),e)null==e[i]&&(t[i]=e[i]);return t}V.extend(V.ui,{datepicker:{version:"1.13.2"}}),V.extend(st.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return at(this._defaults,t||{}),this},_attachDatepicker:function(t,e){var i,s=t.nodeName.toLowerCase(),n="div"===s||"span"===s;t.id||(this.uuid+=1,t.id="dp"+this.uuid),(i=this._newInst(V(t),n)).settings=V.extend({},e||{}),"input"===s?this._connectDatepicker(t,i):n&&this._inlineDatepicker(t,i)},_newInst:function(t,e){return{id:t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:e,dpDiv:e?nt(V("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,e){var i=V(t);e.append=V([]),e.trigger=V([]),i.hasClass(this.markerClassName)||(this._attachments(i,e),i.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(e),V.data(t,"datepicker",e),e.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,e){var i,s=this._get(e,"appendText"),n=this._get(e,"isRTL");e.append&&e.append.remove(),s&&(e.append=V("<span>").addClass(this._appendClass).text(s),t[n?"before":"after"](e.append)),t.off("focus",this._showDatepicker),e.trigger&&e.trigger.remove(),"focus"!==(i=this._get(e,"showOn"))&&"both"!==i||t.on("focus",this._showDatepicker),"button"!==i&&"both"!==i||(s=this._get(e,"buttonText"),i=this._get(e,"buttonImage"),this._get(e,"buttonImageOnly")?e.trigger=V("<img>").addClass(this._triggerClass).attr({src:i,alt:s,title:s}):(e.trigger=V("<button type='button'>").addClass(this._triggerClass),i?e.trigger.html(V("<img>").attr({src:i,alt:s,title:s})):e.trigger.text(s)),t[n?"before":"after"](e.trigger),e.trigger.on("click",function(){return V.datepicker._datepickerShowing&&V.datepicker._lastInput===t[0]?V.datepicker._hideDatepicker():(V.datepicker._datepickerShowing&&V.datepicker._lastInput!==t[0]&&V.datepicker._hideDatepicker(),V.datepicker._showDatepicker(t[0])),!1}))},_autoSize:function(t){var e,i,s,n,o,a;this._get(t,"autoSize")&&!t.inline&&(o=new Date(2009,11,20),(a=this._get(t,"dateFormat")).match(/[DM]/)&&(e=function(t){for(n=s=i=0;n<t.length;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length))},_inlineDatepicker:function(t,e){var i=V(t);i.hasClass(this.markerClassName)||(i.addClass(this.markerClassName).append(e.dpDiv),V.data(t,"datepicker",e),this._setDate(e,this._getDefaultDate(e),!0),this._updateDatepicker(e),this._updateAlternate(e),e.settings.disabled&&this._disableDatepicker(t),e.dpDiv.css("display","block"))},_dialogDatepicker:function(t,e,i,s,n){var o,a=this._dialogInst;return a||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=V("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),V("body").append(this._dialogInput),(a=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},V.data(this._dialogInput[0],"datepicker",a)),at(a.settings,s||{}),e=e&&e.constructor===Date?this._formatDate(a,e):e,this._dialogInput.val(e),this._pos=n?n.length?n:[n.pageX,n.pageY]:null,this._pos||(o=document.documentElement.clientWidth,s=document.documentElement.clientHeight,e=document.documentElement.scrollLeft||document.body.scrollLeft,n=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[o/2-100+e,s/2-150+n]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),a.settings.onSelect=i,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),V.blockUI&&V.blockUI(this.dpDiv),V.data(this._dialogInput[0],"datepicker",a),this},_destroyDatepicker:function(t){var e,i=V(t),s=V.data(t,"datepicker");i.hasClass(this.markerClassName)&&(e=t.nodeName.toLowerCase(),V.removeData(t,"datepicker"),"input"===e?(s.append.remove(),s.trigger.remove(),i.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==e&&"span"!==e||i.removeClass(this.markerClassName).empty(),it===s&&(it=null,this._curInst=null))},_enableDatepicker:function(e){var t,i=V(e),s=V.data(e,"datepicker");i.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!1,s.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==t&&"span"!==t||((i=i.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=V.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var t,i=V(e),s=V.data(e,"datepicker");i.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!0,s.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==t&&"span"!==t||((i=i.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=V.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(t){try{return V.data(t,"datepicker")}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,e,i){var s,n,o=this._getInst(t);if(2===arguments.length&&"string"==typeof e)return"defaults"===e?V.extend({},V.datepicker._defaults):o?"all"===e?V.extend({},o.settings):this._get(o,e):null;s=e||{},"string"==typeof e&&((s={})[e]=i),o&&(this._curInst===o&&this._hideDatepicker(),n=this._getDateDatepicker(t,!0),e=this._getMinMaxDate(o,"min"),i=this._getMinMaxDate(o,"max"),at(o.settings,s),null!==e&&void 0!==s.dateFormat&&void 0===s.minDate&&(o.settings.minDate=this._formatDate(o,e)),null!==i&&void 0!==s.dateFormat&&void 0===s.maxDate&&(o.settings.maxDate=this._formatDate(o,i)),"disabled"in s&&(s.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(V(t),o),this._autoSize(o),this._setDate(o,n),this._updateAlternate(o),this._updateDatepicker(o))}
vendor: 3,508 bytes, line 98
98,_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){t=this._getInst(t);t&&this._updateDatepicker(t)},_setDateDatepicker:function(t,e){t=this._getInst(t);t&&(this._setDate(t,e),this._updateDatepicker(t),this._updateAlternate(t))},_getDateDatepicker:function(t,e){t=this._getInst(t);return t&&!t.inline&&this._setDateFromField(t,e),t?this._getDate(t):null},_doKeyDown:function(t){var e,i,s=V.datepicker._getInst(t.target),n=!0,o=s.dpDiv.is(".ui-datepicker-rtl");if(s._keyEvent=!0,V.datepicker._datepickerShowing)switch(t.keyCode){case 9:V.datepicker._hideDatepicker(),n=!1;break;case 13:return(i=V("td."+V.datepicker._dayOverClass+":not(."+V.datepicker._currentClass+")",s.dpDiv))[0]&&V.datepicker._selectDay(t.target,s.selectedMonth,s.selectedYear,i[0]),(e=V.datepicker._get(s,"onSelect"))?(i=V.datepicker._formatDate(s),e.apply(s.input?s.input[0]:null,[i,s])):V.datepicker._hideDatepicker(),!1;case 27:V.datepicker._hideDatepicker();break;case 33:V.datepicker._adjustDate(t.target,t.ctrlKey?-V.datepicker._get(s,"stepBigMonths"):-V.datepicker._get(s,"stepMonths"),"M");break;case 34:V.datepicker._adjustDate(t.target,t.ctrlKey?+V.datepicker._get(s,"stepBigMonths"):+V.datepicker._get(s,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&V.datepicker._clearDate(t.target),n=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&V.datepicker._gotoToday(t.target),n=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,o?1:-1,"D"),n=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&V.datepicker._adjustDate(t.target,t.ctrlKey?-V.datepicker._get(s,"stepBigMonths"):-V.datepicker._get(s,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,-7,"D"),n=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,o?-1:1,"D"),n=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&V.datepicker._adjustDate(t.target,t.ctrlKey?+V.datepicker._get(s,"stepBigMonths"):+V.datepicker._get(s,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,7,"D"),n=t.ctrlKey||t.metaKey;break;default:n=!1}else 36===t.keyCode&&t.ctrlKey?V.datepicker._showDatepicker(this):n=!1;n&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var e,i=V.datepicker._getInst(t.target);if(V.datepicker._get(i,"constrainInput"))return e=V.datepicker._possibleChars(V.datepicker._get(i,"dateFormat")),i=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||i<" "||!e||-1<e.indexOf(i)},_doKeyUp:function(t){t=V.datepicker._getInst(t.target);if(t.input.val()!==t.lastVal)try{V.datepicker.parseDate(V.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,V.datepicker._getFormatConfig(t))&&(V.datepicker._setDateFromField(t),V.datepicker._updateAlternate(t),V.datepicker._updateDatepicker(t))}catch(t){}return!0},_showDatepicker:function(t){var e,i,s,n;"input"!==(t=t.target||t).nodeName.toLowerCase()&&(t=V("input",t.parentNode)[0]),V.datepicker._isDisabledDatepicker(t)||V.datepicker._lastInput===t||(n=V.datepicker._getInst(t),V.datepicker._curInst&&V.datepicker._curInst!==n&&(V.datepicker._curInst.dpDiv.stop(!0,!0),n&&V.datepicker._datepickerShowing&&V.datepicker._hideDatepicker(V.datepicker._curInst.input[0])),!1!==(i=(s=V.datepicker._get(n,"beforeShow"))?s.apply(t,[t,n]):{})&&(at(n.settings,i),n.lastVal=null,V.datepicker._lastInput=t,V.datepicker._setDateFromField(n),V.datepicker._inDialog&&(t.value=""),
vendor: 32,153 bytes, line 98
98V.datepicker._pos||(V.datepicker._pos=V.datepicker._findPos(t),V.datepicker._pos[1]+=t.offsetHeight),e=!1,V(t).parents().each(function(){return!(e|="fixed"===V(this).css("position"))}),s={left:V.datepicker._pos[0],top:V.datepicker._pos[1]},V.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),V.datepicker._updateDatepicker(n),s=V.datepicker._checkOffset(n,s,e),n.dpDiv.css({position:V.datepicker._inDialog&&V.blockUI?"static":e?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"}),n.inline||(i=V.datepicker._get(n,"showAnim"),s=V.datepicker._get(n,"duration"),n.dpDiv.css("z-index",function(t){for(var e,i;t.length&&t[0]!==document;){if(("absolute"===(e=t.css("position"))||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}(V(t))+1),V.datepicker._datepickerShowing=!0,V.effects&&V.effects.effect[i]?n.dpDiv.show(i,V.datepicker._get(n,"showOptions"),s):n.dpDiv[i||"show"](i?s:null),V.datepicker._shouldFocusInput(n)&&n.input.trigger("focus"),V.datepicker._curInst=n)))},_updateDatepicker:function(t){this.maxRows=4,(it=t).dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var e,i=this._getNumberOfMonths(t),s=i[1],n=t.dpDiv.find("."+this._dayOverClass+" a"),o=V.datepicker._get(t,"onUpdateDatepicker");0<n.length&&ot.apply(n.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<s&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",17*s+"em"),t.dpDiv[(1!==i[0]||1!==i[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===V.datepicker._curInst&&V.datepicker._datepickerShowing&&V.datepicker._shouldFocusInput(t)&&t.input.trigger("focus"),t.yearshtml&&(e=t.yearshtml,setTimeout(function(){e===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year").first().replaceWith(t.yearshtml),e=t.yearshtml=null},0)),o&&o.apply(t.input?t.input[0]:null,[t])},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(t,e,i){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,a=t.input?t.input.outerHeight():0,r=document.documentElement.clientWidth+(i?0:V(document).scrollLeft()),l=document.documentElement.clientHeight+(i?0:V(document).scrollTop());return e.left-=this._get(t,"isRTL")?s-o:0,e.left-=i&&e.left===t.input.offset().left?V(document).scrollLeft():0,e.top-=i&&e.top===t.input.offset().top+a?V(document).scrollTop():0,e.left-=Math.min(e.left,e.left+s>r&&s<r?Math.abs(e.left+s-r):0),e.top-=Math.min(e.top,e.top+n>l&&n<l?Math.abs(n+a):0),e},_findPos:function(t){for(var e=this._getInst(t),i=this._get(e,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||V.expr.pseudos.hidden(t));)t=t[i?"previousSibling":"nextSibling"];return[(e=V(t).offset()).left,e.top]},_hideDatepicker:function(t){var e,i,s=this._curInst;!s||t&&s!==V.data(t,"datepicker")||this._datepickerShowing&&(e=this._get(s,"showAnim"),i=this._get(s,"duration"),t=function(){V.datepicker._tidyDialog(s)},V.effects&&(V.effects.effect[e]||V.effects[e])?s.dpDiv.hide(e,V.datepicker._get(s,"showOptions"),i,t):s.dpDiv["slideDown"===e?"slideUp":"fadeIn"===e?"fadeOut":"hide"](e?i:null,t),e||t(),this._datepickerShowing=!1,(t=this._get(s,"onClose"))&&t.apply(s.input?s.input[0]:null,[s.input?s.input.val():"",s]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),V.blockUI&&(V.unblockUI(),V("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(t){var e;V.datepicker._curInst&&(e=V(t.target),t=V.datepicker._getInst(e[0]),(e[0].id===V.datepicker._mainDivId||0!==e.parents("#"+V.datepicker._mainDivId).length||e.hasClass(V.datepicker.markerClassName)||e.closest("."+V.datepicker._triggerClass).length||!V.datepicker._datepickerShowing||V.datepicker._inDialog&&V.blockUI)&&(!e.hasClass(V.datepicker.markerClassName)||V.datepicker._curInst===t)||V.datepicker._hideDatepicker())},_adjustDate:function(t,e,i){var s=V(t),t=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(t,e,i),this._updateDatepicker(t))},_gotoToday:function(t){var e=V(t),i=this._getInst(e[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(t=new Date,i.selectedDay=t.getDate(),i.drawMonth=i.selectedMonth=t.getMonth(),i.drawYear=i.selectedYear=t.getFullYear()),this._notifyChange(i),this._adjustDate(e)},_selectMonthYear:function(t,e,i){var s=V(t),t=this._getInst(s[0]);t["selected"+("M"===i?"Month":"Year")]=t["draw"+("M"===i?"Month":"Year")]=parseInt(e.options[e.selectedIndex].value,10),this._notifyChange(t),this._adjustDate(s)},_selectDay:function(t,e,i,s){var n=V(t);V(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(n[0])||((n=this._getInst(n[0])).selectedDay=n.currentDay=parseInt(V("a",s).attr("data-date")),n.selectedMonth=n.currentMonth=e,n.selectedYear=n.currentYear=i,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){t=V(t);this._selectDate(t,"")},_selectDate:function(t,e){var i=V(t),t=this._getInst(i[0]);e=null!=e?e:this._formatDate(t),t.input&&t.input.val(e),this._updateAlternate(t),(i=this._get(t,"onSelect"))?i.apply(t.input?t.input[0]:null,[e,t]):t.input&&t.input.trigger("change"),t.inline?this._updateDatepicker(t):(this._hideDatepicker(),this._lastInput=t.input[0],"object"!=typeof t.input[0]&&t.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(t){var e,i,s=this._get(t,"altField");s&&(e=this._get(t,"altFormat")||this._get(t,"dateFormat"),i=this._getDate(t),t=this.formatDate(e,i,this._getFormatConfig(t)),V(document).find(s).val(t))},noWeekends:function(t){t=t.getDay();return[0<t&&t<6,""]},iso8601Week:function(t){var e=new Date(t.getTime());return e.setDate(e.getDate()+4-(e.getDay()||7)),t=e.getTime(),e.setMonth(0),e.setDate(1),Math.floor(Math.round((t-e)/864e5)/7)+1},parseDate:function(e,n,t){if(null==e||null==n)throw"Invalid arguments";if(""===(n="object"==typeof n?n.toString():n+""))return null;for(var i,s,o,a=0,r=(t?t.shortYearCutoff:null)||this._defaults.shortYearCutoff,r="string"!=typeof r?r:(new Date).getFullYear()%100+parseInt(r,10),l=(t?t.dayNamesShort:null)||this._defaults.dayNamesShort,h=(t?t.dayNames:null)||this._defaults.dayNames,c=(t?t.monthNamesShort:null)||this._defaults.monthNamesShort,u=(t?t.monthNames:null)||this._defaults.monthNames,d=-1,p=-1,f=-1,g=-1,m=!1,_=function(t){t=w+1<e.length&&e.charAt(w+1)===t;return t&&w++,t},v=function(t){var e=_(t),e="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,e=new RegExp("^\\d{"+("y"===t?e:1)+","+e+"}"),e=n.substring(a).match(e);if(!e)throw"Missing number at position "+a;return a+=e[0].length,parseInt(e[0],10)},b=function(t,e,i){var s=-1,e=V.map(_(t)?i:e,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(V.each(e,function(t,e){var i=e[1];if(n.substr(a,i.length).toLowerCase()===i.toLowerCase())return s=e[0],a+=i.length,!1}),-1!==s)return s+1;throw"Unknown name at position "+a},y=function(){if(n.charAt(a)!==e.charAt(w))throw"Unexpected literal at position "+a;a++},w=0;w<e.length;w++)if(m)"'"!==e.charAt(w)||_("'")?y():m=!1;else switch(e.charAt(w)){case"d":f=v("d");break;case"D":b("D",l,h);break;case"o":g=v("o");break;case"m":p=v("m");break;case"M":p=b("M",c,u);break;case"y":d=v("y");break;case"@":d=(o=new Date(v("@"))).getFullYear(),p=o.getMonth()+1,f=o.getDate();break;case"!":d=(o=new Date((v("!")-this._ticksTo1970)/1e4)).getFullYear(),p=o.getMonth()+1,f=o.getDate();break;case"'":_("'")?y():m=!0;break;default:y()}if(a<n.length&&(s=n.substr(a),!/^\s+/.test(s)))throw"Extra/unparsed characters found in date: "+s;if(-1===d?d=(new Date).getFullYear():d<100&&(d+=(new Date).getFullYear()-(new Date).getFullYear()%100+(d<=r?0:-100)),-1<g)for(p=1,f=g;;){if(f<=(i=this._getDaysInMonth(d,p-1)))break;p++,f-=i}if((o=this._daylightSavingAdjust(new Date(d,p-1,f))).getFullYear()!==d||o.getMonth()+1!==p||o.getDate()!==f)throw"Invalid date";return o},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(e,t,i){if(!t)return"";function s(t,e,i){var s=""+e;if(c(t))for(;s.length<i;)s="0"+s;return s}function n(t,e,i,s){return(c(t)?s:i)[e]}var o,a=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,r=(i?i.dayNames:null)||this._defaults.dayNames,l=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,h=(i?i.monthNames:null)||this._defaults.monthNames,c=function(t){t=o+1<e.length&&e.charAt(o+1)===t;return t&&o++,t},u="",d=!1;if(t)for(o=0;o<e.length;o++)if(d)"'"!==e.charAt(o)||c("'")?u+=e.charAt(o):d=!1;else switch(e.charAt(o)){case"d":u+=s("d",t.getDate(),2);break;case"D":u+=n("D",t.getDay(),a,r);break;case"o":u+=s("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=s("m",t.getMonth()+1,2);break;case"M":u+=n("M",t.getMonth(),l,h);break;case"y":u+=c("y")?t.getFullYear():(t.getFullYear()%100<10?"0":"")+t.getFullYear()%100;break;case"@":u+=t.getTime();break;case"!":u+=1e4*t.getTime()+this._ticksTo1970;break;case"'":c("'")?u+="'":d=!0;break;default:u+=e.charAt(o)}return u},_possibleChars:function(e){for(var t="",i=!1,s=function(t){t=n+1<e.length&&e.charAt(n+1)===t;return t&&n++,t},n=0;n<e.length;n++)if(i)"'"!==e.charAt(n)||s("'")?t+=e.charAt(n):i=!1;else switch(e.charAt(n)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":s("'")?t+="'":i=!0;break;default:t+=e.charAt(n)}return t},_get:function(t,e){return(void 0!==t.settings[e]?t.settings:this._defaults)[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(t){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(r,t,e){var i,s,t=null==t||""===t?e:"string"==typeof t?function(t){try{return V.datepicker.parseDate(V.datepicker._get(r,"dateFormat"),t,V.datepicker._getFormatConfig(r))}catch(t){}for(var e=(t.toLowerCase().match(/^c/)?V.datepicker._getDate(r):null)||new Date,i=e.getFullYear(),s=e.getMonth(),n=e.getDate(),o=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=o.exec(t);a;){switch(a[2]||"d"){case"d":case"D":n+=parseInt(a[1],10);break;case"w":case"W":n+=7*parseInt(a[1],10);break;case"m":case"M":s+=parseInt(a[1],10),n=Math.min(n,V.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(a[1],10),n=Math.min(n,V.datepicker._getDaysInMonth(i,s))}a=o.exec(t)}return new Date(i,s,n)}(t):"number"==typeof t?isNaN(t)?e:(i=t,(s=new Date).setDate(s.getDate()+i),s):new Date(t.getTime());return(t=t&&"Invalid Date"===t.toString()?e:t)&&(t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)),this._daylightSavingAdjust(t)},_daylightSavingAdjust:function(t){return t?(t.setHours(12<t.getHours()?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,e=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=e.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=e.getMonth(),t.drawYear=t.selectedYear=t.currentYear=e.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(t){var e=this._get(t,"stepMonths"),i="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){V.datepicker._adjustDate(i,-e,"M")},next:function(){V.datepicker._adjustDate(i,+e,"M")},hide:function(){V.datepicker._hideDatepicker()},today:function(){V.datepicker._gotoToday(i)},selectDay:function(){return V.datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return V.datepicker._selectMonthYear(i,this,"M"),!1},selectYear:function(){return V.datepicker._selectMonthYear(i,this,"Y"),!1}};V(this).on(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,l,h,c,u,d,p,f,g,m,_,v,b,y,w,x,k,C,D,I,T,P,M,S,H,z,A=new Date,O=this._daylightSavingAdjust(new Date(A.getFullYear(),A.getMonth(),A.getDate())),N=this._get(t,"isRTL"),E=this._get(t,"showButtonPanel"),W=this._get(t,"hideIfNoPrevNext"),F=this._get(t,"navigationAsDateFormat"),L=this._getNumberOfMonths(t),R=this._get(t,"showCurrentAtPos"),A=this._get(t,"stepMonths"),Y=1!==L[0]||1!==L[1],B=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),j=this._getMinMaxDate(t,"min"),q=this._getMinMaxDate(t,"max"),K=t.drawMonth-R,U=t.drawYear;if(K<0&&(K+=12,U--),q)for(e=this._daylightSavingAdjust(new Date(q.getFullYear(),q.getMonth()-L[0]*L[1]+1,q.getDate())),e=j&&e<j?j:e;this._daylightSavingAdjust(new Date(U,K,1))>e;)--K<0&&(K=11,U--);for(t.drawMonth=K,t.drawYear=U,R=this._get(t,"prevText"),R=F?this.formatDate(R,this._daylightSavingAdjust(new Date(U,K-A,1)),this._getFormatConfig(t)):R,i=this._canAdjustMonth(t,-1,U,K)?V("<a>").attr({class:"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"e":"w")).text(R))[0].outerHTML:W?"":V("<a>").attr({class:"ui-datepicker-prev ui-corner-all ui-state-disabled",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"e":"w")).text(R))[0].outerHTML,R=this._get(t,"nextText"),R=F?this.formatDate(R,this._daylightSavingAdjust(new Date(U,K+A,1)),this._getFormatConfig(t)):R,s=this._canAdjustMonth(t,1,U,K)?V("<a>").attr({class:"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"w":"e")).text(R))[0].outerHTML:W?"":V("<a>").attr({class:"ui-datepicker-next ui-corner-all ui-state-disabled",title:R}).append(V("<span>").attr("class","ui-icon ui-icon-circle-triangle-"+(N?"w":"e")).text(R))[0].outerHTML,A=this._get(t,"currentText"),W=this._get(t,"gotoCurrent")&&t.currentDay?B:O,A=F?this.formatDate(A,W,this._getFormatConfig(t)):A,R="",t.inline||(R=V("<button>").attr({type:"button",class:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all","data-handler":"hide","data-event":"click"}).text(this._get(t,"closeText"))[0].outerHTML),F="",E&&(F=V("<div class='ui-datepicker-buttonpane ui-widget-content'>").append(N?R:"").append(this._isInRange(t,W)?V("<button>").attr({type:"button",class:"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all","data-handler":"today","data-event":"click"}).text(A):"").append(N?"":R)[0].outerHTML),n=parseInt(this._get(t,"firstDay"),10),n=isNaN(n)?0:n,o=this._get(t,"showWeek"),a=this._get(t,"dayNames"),r=this._get(t,"dayNamesMin"),l=this._get(t,"monthNames"),h=this._get(t,"monthNamesShort"),c=this._get(t,"beforeShowDay"),u=this._get(t,"showOtherMonths"),d=this._get(t,"selectOtherMonths"),p=this._getDefaultDate(t),f="",m=0;m<L[0];m++){for(_="",this.maxRows=4,v=0;v<L[1];v++){if(b=this._daylightSavingAdjust(new Date(U,K,t.selectedDay)),y=" ui-corner-all",w="",Y){if(w+="<div class='ui-datepicker-group",1<L[1])switch(v){case 0:w+=" ui-datepicker-group-first",y=" ui-corner-"+(N?"right":"left");break;case L[1]-1:w+=" ui-datepicker-group-last",y=" ui-corner-"+(N?"left":"right");break;default:w+=" ui-datepicker-group-middle",y=""}w+="'>"}for(w+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+y+"'>"+(/all|left/.test(y)&&0===m?N?s:i:"")+(/all|right/.test(y)&&0===m?N?i:s:"")+this._generateMonthYearHeader(t,K,U,j,q,0<m||0<v,l,h)+"</div><table class='ui-datepicker-calendar'><thead><tr>",x=o?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",g=0;g<7;g++)x+="<th scope='col'"+(5<=(g+n+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+a[k=(g+n)%7]+"'>"+r[k]+"</span></th>";for(w+=x+"</tr></thead><tbody>",D=this._getDaysInMonth(U,K),U===t.selectedYear&&K===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,D)),C=(this._getFirstDayOfMonth(U,K)-n+7)%7,D=Math.ceil((C+D)/7),I=Y&&this.maxRows>D?this.maxRows:D,this.maxRows=I,T=this._daylightSavingAdjust(new Date(U,K,1-C)),P=0;P<I;P++){for(w+="<tr>",M=o?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(T)+"</td>":"",g=0;g<7;g++)S=c?c.apply(t.input?t.input[0]:null,[T]):[!0,""],z=(H=T.getMonth()!==K)&&!d||!S[0]||j&&T<j||q&&q<T,M+="<td class='"+(5<=(g+n+6)%7?" ui-datepicker-week-end":"")+(H?" ui-datepicker-other-month":"")+(T.getTime()===b.getTime()&&K===t.selectedMonth&&t._keyEvent||p.getTime()===T.getTime()&&p.getTime()===b.getTime()?" "+this._dayOverClass:"")+(z?" "+this._unselectableClass+" ui-state-disabled":"")+(H&&!u?"":" "+S[1]+(T.getTime()===B.getTime()?" "+this._currentClass:"")+(T.getTime()===O.getTime()?" ui-datepicker-today":""))+"'"+(H&&!u||!S[2]?"":" title='"+S[2].replace(/'/g,"&#39;")+"'")+(z?"":" data-handler='selectDay' data-event='click' data-month='"+T.getMonth()+"' data-year='"+T.getFullYear()+"'")+">"+(H&&!u?"&#xa0;":z?"<span class='ui-state-default'>"+T.getDate()+"</span>":"<a class='ui-state-default"+(T.getTime()===O.getTime()?" ui-state-highlight":"")+(T.getTime()===B.getTime()?" ui-state-active":"")+(H?" ui-priority-secondary":"")+"' href='#' aria-current='"+(T.getTime()===B.getTime()?"true":"false")+"' data-date='"+T.getDate()+"'>"+T.getDate()+"</a>")+"</td>",T.setDate(T.getDate()+1),T=this._daylightSavingAdjust(T);w+=M+"</tr>"}11<++K&&(K=0,U++),_+=w+="</tbody></table>"+(Y?"</div>"+(0<L[0]&&v===L[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}f+=_}return f+=F,t._keyEvent=!1,f},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var l,h,c,u,d,p,f=this._get(t,"changeMonth"),g=this._get(t,"changeYear"),m=this._get(t,"showMonthAfterYear"),_=this._get(t,"selectMonthLabel"),v=this._get(t,"selectYearLabel"),b="<div class='ui-datepicker-title'>",y="";if(o||!f)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(l=s&&s.getFullYear()===i,h=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' aria-label='"+_+"' data-handler='selectMonth' data-event='change'>",c=0;c<12;c++)(!l||c>=s.getMonth())&&(!h||c<=n.getMonth())&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(m||(b+=y+(!o&&f&&g?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!g)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(a=this._get(t,"yearRange").split(":"),u=(new Date).getFullYear(),d=(_=function(t){t=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?u+parseInt(t,10):parseInt(t,10);return isNaN(t)?u:t})(a[0]),p=Math.max(d,_(a[1]||"")),d=s?Math.max(d,s.getFullYear()):d,p=n?Math.min(p,n.getFullYear()):p,t.yearshtml+="<select class='ui-datepicker-year' aria-label='"+v+"' data-handler='selectYear' data-event='change'>";d<=p;d++)t.yearshtml+="<option value='"+d+"'"+(d===i?" selected='selected'":"")+">"+d+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),m&&(b+=(!o&&f&&g?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),e=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),e=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,e)));t.selectedDay=e.getDate(),t.drawMonth=t.selectedMonth=e.getMonth(),t.drawYear=t.selectedYear=e.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),t=this._getMinMaxDate(t,"max"),e=i&&e<i?i:e;return t&&t<e?t:e},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){t=this._get(t,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),n=this._daylightSavingAdjust(new Date(i,s+(e<0?e:n[0]*n[1]),1));return e<0&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(t,n)},_isInRange:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=null,o=null,a=this._get(t,"yearRange");return a&&(t=a.split(":"),a=(new Date).getFullYear(),n=parseInt(t[0],10),o=parseInt(t[1],10),t[0].match(/[+\-].*/)&&(n+=a),t[1].match(/[+\-].*/)&&(o+=a)),(!i||e.getTime()>=i.getTime())&&(!s||e.getTime()<=s.getTime())&&(!n||e.getFullYear()>=n)&&(!o||e.getFullYear()<=o)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);e=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),e,this._getFormatConfig(t))}}),V.fn.datepicker=function(t){if(!this.length)return this;V.datepicker.initialized||(V(document).on("mousedown",V.datepicker._checkExternalClick),V.datepicker.initialized=!0),0===V("#"+V.datepicker._mainDivId).length&&V("body").append(V.datepicker.dpDiv);var e=Array.prototype.slice.call(arguments,1);return"string"==typeof t&&("isDisabled"===t||"getDate"===t||"widget"===t)||"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this].concat(e)):V.datepicker._attachDatepicker(this,t)})},V.datepicker=new st,V.datepicker.initialized=!1,V.datepicker.uuid=(new Date).getTime(),V.datepicker.version="1.13.2";V.datepicker,V.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var rt=!1;V(document).on("mouseup",function(){rt=!1});V.widget("ui.mouse",{version:"1.13.2",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(!0===V.data(t.target,e.widgetName+".preventClickEvent"))return V.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!rt){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var e=this,i=1===t.which,s=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&V(t.target).closest(this.options.cancel).length;return i&&!s&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===V.data(t.target,this.widgetName+".preventClickEvent")&&V.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return e._mouseMove(t)},this._mouseUpDelegate=function(t){return e._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),rt=!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(V.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&V.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,rt=!1,t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),V.ui.plugin={add:function(t,e,i){var s,n=V.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n<o.length;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},V.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&V(t).trigger("blur")};V.widget("ui.draggable",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var e=this.options;return!(this.helper||e.disabled||0<V(t.target).closest(".ui-resizable-handle").length)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blurActiveElement(t),this._blockFrames(!0===e.iframeFix?"iframe":e.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=V(this);return V("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=V.ui.safeActiveElement(this.document[0]);V(t.target).closest(e).length||V.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),V.ui.ddmanager&&(V.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0<this.helper.parents().filter(function(){return"fixed"===V(this).css("position")}).length,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),V.ui.ddmanager&&!e.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),V.ui.ddmanager&&V.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!e){e=this._uiHash();if(!1===this._trigger("drag",t,e))return this._mouseUp(new V.Event("mouseup",t)),!1;this.position=e.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",V.ui.ddmanager&&V.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var e=this,i=!1;return V.ui.ddmanager&&!this.options.dropBehaviour&&(i=V.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||"function"==typeof this.options.revert&&this.options.revert.call(this.element,i)?V(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==e._trigger("stop",t)&&e._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),V.ui.ddmanager&&V.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),V.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new V.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!V(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,i="function"==typeof e.helper,t=i?V(e.helper.apply(this.element[0],[t])):"clone"===e.helper?this.element.clone().removeAttr("id"):this.element;return t.parents("body").length||t.appendTo("parent"===e.appendTo?this.element[0].parentNode:e.appendTo),i&&t[0]===this.element[0]&&this._setPositionRelative(),t[0]===this.element[0]||/(fixed|absolute)/.test(t.css("position"))||t.css("position","absolute"),t},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=Array.isArray(t)?{left:+t[0],top:+t[1]||0}
vendor: 4,254 bytes, line 98
98:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==e&&V.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this._isRootNode(this.offsetParent[0])?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i,s=this.options,n=this.document[0];this.relativeContainer=null,s.containment?"window"!==s.containment?"document"!==s.containment?s.containment.constructor!==Array?("parent"===s.containment&&(s.containment=this.helper[0].parentNode),(i=(e=V(s.containment))[0])&&(t=/(scroll|auto)/.test(e.css("overflow")),this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=e)):this.containment=s.containment:this.containment=[0,0,V(n).width()-this.helperProportions.width-this.margins.left,(V(n).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[V(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,V(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,V(window).scrollLeft()+V(window).width()-this.helperProportions.width-this.margins.left,V(window).scrollTop()+(V(window).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,t=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:t?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:t?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s=this.options,n=this._isRootNode(this.scrollParent[0]),o=t.pageX,a=t.pageY;return n&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(i=this.relativeContainer?(i=this.relativeContainer.offset(),[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):this.containment,t.pageX-this.offset.click.left<i[0]&&(o=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(a=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(o=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>
vendor: 586 bytes, line 98
98i[3]&&(a=i[3]+this.offset.click.top)),s.grid&&(t=s.grid[1]?this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,a=!i||t-this.offset.click.top>=i[1]||t-this.offset.click.top>i[3]?t:t-this.offset.click.top>=i[1]?t-s.grid[1]:t+s.grid[1],t=s.grid[0]?this.originalPageX+Math.round((o-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,o=!i||t-this.offset.click.left>=i[0]||t-this.offset.click.left>i[2]?t:t-this.offset.click.left>=i[0]?t-s.grid[0]:t+s.grid[0]),"y"===s.axis&&(o=this.originalPageX),"x"===s.axis&&(a=this.originalPageY)),{top:a
vendor: 6,471 bytes, line 98
98-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),V.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),V.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),V.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=V.extend({},t,{item:i.element});i.sortables=[],V(i.options.connectToSortable).each(function(){var t=V(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=V.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,V.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,n){V.each(n.sortables,function(){var t=!1,e=this;e.positionAbs=n.positionAbs,e.helperProportions=n.helperProportions,e.offset.click=n.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,V.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,t=this!==e&&this._intersectsWith(this.containerCache)&&V.contains(e.element[0],this.element[0])?!1:t})),t?(e.isOver||(e.isOver=1,n._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=n.offset.click.top,e.offset.click.left=n.offset.click.left,e.offset.parent.left-=n.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=n.offset.parent.top-e.offset.parent.top,n._trigger("toSortable",i),n.dropped=e.element,V.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,e.fromOutside=n),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(n._parent),n._refreshOffsets(i),s.position=n._generatePosition(i,!0),n._trigger("fromSortable",i),n.dropped=!1,V.each(n.sortables,function(){this.refreshPositions()}))})}}),V.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=V("body"),i=i.options;s.css("cursor")&&(i._cursor=s.css("cursor")),s.css("cursor",i.cursor)},stop:function(t,e,i){i=i.options;i._cursor&&V("body").css("cursor",i._cursor)}}),V.ui.plugin.add("draggable","opacity",{start:function(t,e,i){e=V(e.helper),i=i.options;e.css("opacity")&&(i._opacity=e.css("opacity")),e.css("opacity",i.opacity)},stop:function(t,e,i){i=i.options;i._opacity&&V(e.helper).css("opacity",i._opacity)}}),V.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,e,i){var s=i.options,n=!1,o=i.scrollParentNotHidden[0],a=i.document[0];o!==a&&"HTML"!==o.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+o.offsetHeight-t.pageY<s.scrollSensitivity?o.scrollTop=n=o.scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(o.scrollTop=n=o.scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+o.offsetWidth-t.pageX<s.scrollSensitivity?o.scrollLeft=n=o.scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(o.scrollLeft=n=o.scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-V(a).scrollTop()<s.scrollSensitivity?n=V(a).scrollTop(V(a).scrollTop()-s.scrollSpeed):V(window).height()-(t.pageY-V(a).scrollTop())<s.scrollSensitivity&&(n=V(a).scrollTop(V(a).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-V(a).scrollLeft()<s.scrollSensitivity?n=V(a).scrollLeft(V(a).scrollLeft()-s.scrollSpeed):V(window).width()-(t.pageX-V(a).scrollLeft())<s.scrollSensitivity&&(n=V(a).scrollLeft(V(a).scrollLeft()+s.scrollSpeed)))),!1!==n&&V.ui.ddmanager&&!s.dropBehaviour&&V.ui.ddmanager.prepareOffsets(i,t)}}),V.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[],V(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=V(this),e=t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})})},drag:function(t,e,i){for(var s,n,o,a,r,l,h,c,u,d=i.options,p=d.snapTolerance,f=e.offset.left,g=f+i.helperProportions.width,m=e.offset.top,_=m+i.helperProportions.height,v=i.snapElements.length-1;0<=v;v--)l=(r=i.snapElements[v].left-i.margins.left)+i.snapElements[v].width,c=(h=i.snapElements[v].top-i.margins.top)+i.snapElements[v].height,g<r-p||l+p<f||_<h-p||c+p<m||!V.contains(i.snapElements[v].item.ownerDocument,i.snapElements[v].item)?(i.snapElements[v].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,t,V.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=!1):("inner"!==d.snapMode&&(s=Math.abs(h-_)<=p,n=Math.abs(c-m)<=p,o=Math.abs(r-g)<=p,a=Math.abs(l-f)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:h-i.helperProportions.height,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:c,left:0}).top),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r-i.helperProportions.width}).left),a
vendor: 9,875 bytes, line 98
98&&(e.position.left=i._convertPositionTo("relative",{top:0,left:l}).left)),u=s||n||o||a,"outer"!==d.snapMode&&(s=Math.abs(h-m)<=p,n=Math.abs(c-_)<=p,o=Math.abs(r-f)<=p,a=Math.abs(l-g)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:h,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:c-i.helperProportions.height,left:0}).top),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r}).left),a&&(e.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left)),!i.snapElements[v].snapping&&(s||n||o||a||u)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,t,V.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=s||n||o||a||u)}}),V.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,i=i.options,i=V.makeArray(V(i.stack)).sort(function(t,e){return(parseInt(V(t).css("zIndex"),10)||0)-(parseInt(V(e).css("zIndex"),10)||0)});i.length&&(s=parseInt(V(i[0]).css("zIndex"),10)||0,V(i).each(function(t){V(this).css("zIndex",s+t)}),this.css("zIndex",s+i.length))}}),V.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){e=V(e.helper),i=i.options;e.css("zIndex")&&(i._zIndex=e.css("zIndex")),e.css("zIndex",i.zIndex)},stop:function(t,e,i){i=i.options;i._zIndex&&V(e.helper).css("zIndex",i._zIndex)}});V.ui.draggable;V.widget("ui.resizable",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,e){if("hidden"===V(t).css("overflow"))return!1;var i=e&&"left"===e?"scrollLeft":"scrollTop",e=!1;if(0<t[i])return!0;try{t[i]=1,e=0<t[i],t[i]=0}catch(t){}return e},_create:function(){var t,e=this.options,i=this;this._addClass("ui-resizable"),V.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(V("<div class='ui-wrapper'></div>").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&V(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){V(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,a=this;if(this.handles=o.handles||(V(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=V(),this._addedHandles=V(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e<i.length;e++)s="ui-resizable-"+(t=String.prototype.trim.call(i[e])),n=V("<div>"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=V(this.handles[e]),this._on(this.handles[e],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=V(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=V(this.handles[e])[0])!==t.target&&!V.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=V(s.containment).scrollLeft()||0,i+=V(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=V(".ui-resizable-"+this.axis).css("cursor"),V("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),V.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(V.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),V("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),s<n.maxWidth&&(n.maxWidth=s),t<n.maxHeight&&(n.maxHeight=t)),this._vBoundaries=n},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left
vendor: 5,511 bytes, line 98
98=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&h&&(t.left=r-e.minWidth),s&&h&&(t.left=r-e.maxWidth),a&&i&&(t.top=l-e.minHeight),n&&i&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||V("<div></div>").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){V.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),V.ui.plugin.add("resizable","animate",{stop:function(e){var i=V(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,a=n?0:i.sizeDiff.width,n={width:i.size.width-a,height:i.size.height-o},a=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(V.extend(n,o&&a?{top:o,left:a}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&V(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),V.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=V(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,a=o instanceof V?o.get(0):/parent/.test(o)?e.parent().get(0):o;a&&(n.containerElement=V(a),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:V(document),left:0,top:0,width:V(document).width(),height:V(document).height()||document.body.parentNode.scrollHeight}):(i=V(a),s=[],V(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(a,"left")?a.scrollWidth:o,e=n._hasScroll(a)?a.scrollHeight:e,n.parentData={element:a,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=V(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,a={top:0,left:0}
vendor: 2,289 bytes, line 98
98,r=e.containerElement,t=!0;r[0]!==document&&/static/.test(r.css("position"))&&(a=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-a.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-a.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-a.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=V(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=V(t.helper),a=o.offset(),r=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o})}}),V.ui.plugin.add("resizable","alsoResize",{start:function(){var t=V(this).resizable("instance").options;V(t.alsoResize).each(function(){var t=V(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=V(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,a={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left
vendor: 32,344 bytes, line 98
98:e.position.left-o.left||0};V(s.alsoResize).each(function(){var t=V(this),s=V(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];V.each(e,function(t,e){var i=(s[e]||0)+(a[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){V(this).removeData("ui-resizable-alsoresize")}}),V.ui.plugin.add("resizable","ghost",{start:function(){var t=V(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==V.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=V(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=V(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),V.ui.plugin.add("resizable","grid",{resize:function(){var t,e=V(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,l=r[0]||1,h=r[1]||1,c=Math.round((s.width-n.width)/l)*l,u=Math.round((s.height-n.height)/h)*h,d=n.width+c,p=n.height+u,f=i.maxWidth&&i.maxWidth<d,g=i.maxHeight&&i.maxHeight<p,m=i.minWidth&&i.minWidth>d,s=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=l),s&&(p+=h),f&&(d-=l),g&&(p-=h),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):((p-h<=0||d-l<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0<p-h?(e.size.height=p,e.position.top=o.top-u):(p=h-t.height,e.size.height=p,e.position.top=o.top+n.height-p),0<d-l?(e.size.width=d,e.position.left=o.left-c):(d=l-t.width,e.size.width=d,e.position.left=o.left+n.width-d))}});V.ui.resizable;V.widget("ui.dialog",{version:"1.13.2",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var e=V(this).css(t).offset().top;e<0&&V(this).css("top",t.top-e)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&V.fn.draggable&&this._makeDraggable(),this.options.resizable&&V.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?V(t):this.document.find(t||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:V.noop,enable:V.noop,close:function(t){var e=this;this._isOpen&&!1!==this._trigger("beforeClose",t)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||V.ui.safeBlur(V.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){e._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!1,s=this.uiDialog.siblings(".ui-front:visible").map(function(){return+V(this).css("z-index")}).get(),s=Math.max.apply(null,s);return s>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),i=!0),i&&!e&&this._trigger("focus",t),i},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=V(V.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;(t=!(t=!(t=!(t=!(t=t||this.element.find("[autofocus]")).length?this.element.find(":tabbable"):t).length?this.uiDialogButtonPane.find(":tabbable"):t).length?this.uiDialogTitlebarClose.filter(":tabbable"):t).length?this.uiDialog:t).eq(0).trigger("focus")},_restoreTabbableFocus:function(){var t=V.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===t||V.contains(this.uiDialog[0],t)||this._focusTabbable()},_keepFocus:function(t){t.preventDefault(),this._restoreTabbableFocus(),this._delay(this._restoreTabbableFocus)},_createWrapper:function(){this.uiDialog=V("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===V.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);var e,i,s;t.keyCode!==V.ui.keyCode.TAB||t.isDefaultPrevented()||(e=this.uiDialog.find(":tabbable"),i=e.first(),s=e.last(),t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==i[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){s.trigger("focus")}),t.preventDefault()):(this._delay(function(){i.trigger("focus")}),t.preventDefault()))},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=V("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){V(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=V("<button type='button'></button>").button({label:V("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),t=V("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=V("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=V("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var s=this,t=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),V.isEmptyObject(t)||Array.isArray(t)&&!t.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(V.each(t,function(t,e){var i;e=V.extend({type:"button"},e="function"==typeof e?{click:e,text:t}:e),i=e.click,t={icon:e.icon,iconPosition:e.iconPosition,showLabel:e.showLabel,icons:e.icons,text:e.text},delete e.click,delete e.icon,delete e.iconPosition,delete e.showLabel,delete e.icons,"boolean"==typeof e.text&&delete e.text,V("<button></button>",e).button(t).appendTo(s.uiButtonSet).on("click",function(){i.apply(s.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var n=this,o=this.options;function a(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(t,e){n._addClass(V(this),"ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",t,a(e))},drag:function(t,e){n._trigger("drag",t,a(e))},stop:function(t,e){var i=e.offset.left-n.document.scrollLeft(),s=e.offset.top-n.document.scrollTop();o.position={my:"left top",at:"left"+(0<=i?"+":"")+i+" top"+(0<=s?"+":"")+s,of:n.window},n._removeClass(V(this),"ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",t,a(e))}})},_makeResizable:function(){var n=this,o=this.options,t=o.resizable,e=this.uiDialog.css("position"),t="string"==typeof t?t:"n,e,s,w,se,sw,ne,nw";function a(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth,minHeight:this._minHeight(),handles:t,start:function(t,e){n._addClass(V(this),"ui-dialog-resizing"),n._blockFrames(),n._trigger("resizeStart",t,a(e))},resize:function(t,e){n._trigger("resize",t,a(e))},stop:function(t,e){var i=n.uiDialog.offset(),s=i.left-n.document.scrollLeft(),i=i.top-n.document.scrollTop();o.height=n.uiDialog.height(),o.width=n.uiDialog.width(),o.position={my:"left top",at:"left"+(0<=s?"+":"")+s+" top"+(0<=i?"+":"")+i,of:n.window},n._removeClass(V(this),"ui-dialog-resizing"),n._unblockFrames(),n._trigger("resizeStop",t,a(e))}}).css("position",e)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=V(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),e=V.inArray(this,t);-1!==e&&t.splice(e,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||this.document.data("ui-dialog-instances",t=[]),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};V.each(t,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(t,e){var i,s=this.uiDialog;"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:V("<a>").text(""+this.options.closeText).html()}),"draggable"===t&&((i=s.is(":data(ui-draggable)"))&&!e&&s.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&((i=s.is(":data(ui-resizable)"))&&!e&&s.resizable("destroy"),i&&"string"==typeof e&&s.resizable("option","handles",e),i||!1===e||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=V(this);return V("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!V(t.target).closest(".ui-dialog").length||!!V(t.target).closest(".ui-datepicker").length},_createOverlay:function(){var i,s;this.options.modal&&(i=V.fn.jquery.substring(0,4),s=!0,this._delay(function(){s=!1}),this.document.data("ui-dialog-overlays")||this.document.on("focusin.ui-dialog",function(t){var e;s||((e=this._trackingInstances()[0])._allowInteraction(t)||(t.preventDefault(),e._focusTabbable(),"3.4."!==i&&"3.5."!==i||e._delay(e._restoreTabbableFocus)))}.bind(this)),this.overlay=V("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1))},_destroyOverlay:function(){var t;this.options.modal&&this.overlay&&((t=this.document.data("ui-dialog-overlays")-1)?this.document.data("ui-dialog-overlays",t):(this.document.off("focusin.ui-dialog"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null)}}),!1!==V.uiBackCompat&&V.widget("ui.dialog",V.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}});V.ui.dialog;function lt(t,e,i){return e<=t&&t<e+i}V.widget("ui.droppable",{version:"1.13.2",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=!1,this.isout=!0,this.accept="function"==typeof i?i:function(t){return t.is(i)},this.proportions=function(){if(!arguments.length)return t=t||{width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};t=arguments[0]},this._addToManager(e.scope),e.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){V.ui.ddmanager.droppables[t]=V.ui.ddmanager.droppables[t]||[],V.ui.ddmanager.droppables[t].push(this)},_splice:function(t){for(var e=0;e<t.length;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var t=V.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,e){var i;"accept"===t?this.accept="function"==typeof e?e:function(t){return t.is(e)}:"scope"===t&&(i=V.ui.ddmanager.droppables[this.options.scope],this._splice(i),this._addToManager(e)),this._super(t,e)},_activate:function(t){var e=V.ui.ddmanager.current;this._addActiveClass(),e&&this._trigger("activate",t,this.ui(e))},_deactivate:function(t){var e=V.ui.ddmanager.current;this._removeActiveClass(),e&&this._trigger("deactivate",t,this.ui(e))},_over:function(t){var e=V.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(e)))},_out:function(t){var e=V.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(e)))},_drop:function(e,t){var i=t||V.ui.ddmanager.current,s=!1;return!(!i||(i.currentItem||i.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=V(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===i.options.scope&&t.accept.call(t.element[0],i.currentItem||i.element)&&V.ui.intersect(i,V.extend(t,{offset:t.element.offset()}),t.options.tolerance,e))return!(s=!0)}),!s&&(!!this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(i)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}}),V.ui.intersect=function(t,e,i,s){if(!e.offset)return!1;var n=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,a=n+t.helperProportions.width,r=o+t.helperProportions.height,l=e.offset.left,h=e.offset.top,c=l+e.proportions().width,u=h+e.proportions().height;switch(i){case"fit":return l<=n&&a<=c&&h<=o&&r<=u;case"intersect":return l<n+t.helperProportions.width/2&&a-t.helperProportions.width/2<c&&h<o+t.helperProportions.height/2&&r-t.helperProportions.height/2<u;case"pointer":return lt(s.pageY,h,e.proportions().height)&&lt(s.pageX,l,e.proportions().width);case"touch":return(h<=o&&o<=u||h<=r&&r<=u||o<h&&u<r)&&(l<=n&&n<=c||l<=a&&a<=c||n<l&&c<a);default:return!1}},!(V.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,e){var i,s,n=V.ui.ddmanager.droppables[t.options.scope]||[],o=e?e.type:null,a=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<n.length;i++)if(!(n[i].options.disabled||t&&!n[i].accept.call(n[i].element[0],t.currentItem||t.element))){for(s=0;s<a.length;s++)if(a[s]===n[i].element[0]){n[i].proportions().height=0;continue t}n[i].visible="none"!==n[i].element.css("display"),n[i].visible&&("mousedown"===o&&n[i]._activate.call(n[i],e),n[i].offset=n[i].element.offset(),n[i].proportions({width:n[i].element[0].offsetWidth,height:n[i].element[0].offsetHeight}))}},drop:function(t,e){var i=!1;return V.each((V.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&V.ui.intersect(t,this,this.options.tolerance,e)&&(i=this._drop.call(this,e)||i),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,e)))}),i},dragStart:function(t,e){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||V.ui.ddmanager.prepareOffsets(t,e)})},drag:function(n,o){n.options.refreshPositions&&V.ui.ddmanager.prepareOffsets(n,o),V.each(V.ui.ddmanager.droppables[n.options.scope]||[],function(){var t,e,i,s;this.options.disabled||this.greedyChild||!this.visible||(s=!(i=V.ui.intersect(n,this,this.options.tolerance,o))&&this.isover?"isout":i&&!this.isover?"isover":null)&&(this.options.greedy&&(e=this.options.scope,(i=this.element.parents(":data(ui-droppable)").filter(function(){return V(this).droppable("instance").options.scope===e})).length&&((t=V(i[0]).droppable("instance")).greedyChild="isover"===s)),t&&"isover"===s&&(t.isover=!1,t.isout=!0,t._out.call(t,o)),this[s]=!0,this["isout"===s?"isover":"isout"]=!1,this["isover"===s?"_over":"_out"].call(this,o),t&&"isout"===s&&(t.isout=!1,t.isover=!0,t._over.call(t,o)))})},dragStop:function(t,e){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||V.ui.ddmanager.prepareOffsets(t,e)}})!==V.uiBackCompat&&V.widget("ui.droppable",V.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}});V.ui.droppable,V.widget("ui.progressbar",{version:"1.13.2",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=V("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){if(void 0===t)return this.options.value;this.options.value=this._constrainedValue(t),this._refreshValue()},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=!1===t,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,e=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(e.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=V("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),V.widget("ui.selectable",V.ui.mouse,{version:"1.13.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var i=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){i.elementPos=V(i.element[0]).offset(),i.selectees=V(i.options.filter,i.element[0]),i._addClass(i.selectees,"ui-selectee"),i.selectees.each(function(){var t=V(this),e=t.offset(),e={left:e.left-i.elementPos.left,top:e.top-i.elementPos.top};V.data(this,"selectable-item",{element:this,$element:t,left:e.left,top:e.top,right:e.left+t.outerWidth(),bottom:e.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=V("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(i){var s=this,t=this.options;this.opos=[i.pageX,i.pageY],this.elementPos=V(this.element[0]).offset(),this.options.disabled||(this.selectees=V(t.filter,this.element[0]),this._trigger("start",i),V(t.appendTo).append(this.helper),this.helper.css({left:i.pageX,top:i.pageY,width:0,height:0}),t.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var t=V.data(this,"selectable-item");t.startselected=!0,i.metaKey||i.ctrlKey||(s._removeClass(t.$element,"ui-selected"),t.selected=!1,s._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,s._trigger("unselecting",i,{unselecting:t.element}))}),V(i.target).parents().addBack().each(function(){var t,e=V.data(this,"selectable-item");if(e)return t=!i.metaKey&&!i.ctrlKey||!e.$element.hasClass("ui-selected"),s._removeClass(e.$element,t?"ui-unselecting":"ui-selected")._addClass(e.$element,t?"ui-selecting":"ui-unselecting"),e.unselecting=!t,e.selecting=t,(e.selected=t)?s._trigger("selecting",i,{selecting:e.element}):s._trigger("unselecting",i,{unselecting:e.element}),!1}))},_mouseDrag:function(s){if(this.dragged=!0,!this.options.disabled){var t,n=this,o=this.options,a=this.opos[0],r=this.opos[1],l=s.pageX,h=s.pageY;return l<a&&(t=l,l=a,a=t),h<r&&(t=h,h=r,r=t),this.helper.css({left:a,top:r,width:l-a,height:h-r}),this.selectees.each(function(){var t=V.data(this,"selectable-item"),e=!1,i={};t&&t.element!==n.element[0]&&(i.left=t.left+n.elementPos.left,i.right=t.right+n.elementPos.left,i.top=t.top+n.elementPos.top,i.bottom=t.bottom+n.elementPos.top,"touch"===o.tolerance?e=!(i.left>l||i.right<a||i.top>h||i.bottom<r):"fit"===o.tolerance&&(e=i.left>a&&i.right<l&&i.top>r&&i.bottom<h),e?(t.selected&&(n._removeClass(t.$element,"ui-selected"),t.selected=!1),t.unselecting&&(n._removeClass(t.$element,"ui-unselecting"),t.unselecting=!1),t.selecting||(n._addClass(t.$element,"ui-selecting"),t.selecting=!0,n._trigger("selecting",s,{selecting:t.element}))):(t.selecting&&((s.metaKey||s.ctrlKey)&&t.startselected?(n._removeClass(t.$element,"ui-selecting"),t.selecting=!1,n._addClass(t.$element,"ui-selected"),t.selected=!0):(n._removeClass(t.$element,"ui-selecting"),t.selecting=!1,t.startselected&&(n._addClass(t.$element,"ui-unselecting"),t.unselecting=!0),n._trigger("unselecting",s,{unselecting:t.element}))),t.selected&&(s.metaKey||s.ctrlKey||t.startselected||(n._removeClass(t.$element,"ui-selected"),t.selected=!1,n._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,n._trigger("unselecting",s,{unselecting:t.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,V(".ui-unselecting",this.element[0]).each(function(){var t=V.data(this,"selectable-item");i._removeClass(t.$element,"ui-unselecting"),t.unselecting=!1,t.startselected=!1,i._trigger("unselected",e,{unselected:t.element})}),V(".ui-selecting",this.element[0]).each(function(){var t=V.data(this,"selectable-item");i._removeClass(t.$element,"ui-selecting")._addClass(t.$element,"ui-selected"),t.selecting=!1,t.selected=!0,t.startselected=!0,i._trigger("selected",e,{selected:t.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),V.widget("ui.selectmenu",[V.ui.formResetMixin,{version:"1.13.2",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var t=this.element.uniqueId().attr("id");this.ids={element:t,button:t+"-button",menu:t+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=V()},_drawButton:function(){var t,e=this,i=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.trigger("focus"),t.preventDefault()}}),this.element.hide(),this.button=V("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),t=V("<span>").appendTo(this.button),this._addClass(t,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(i).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){e._rendered||e._refreshMenu()})},_drawMenu:function(){var i=this;this.menu=V("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=V("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,e){t.preventDefault(),i._setSelection(),i._select(e.item.data("ui-selectmenu-item"),t)},focus:function(t,e){e=e.item.data("ui-selectmenu-item");null!=i.focusIndex&&e.index!==i.focusIndex&&(i._trigger("focus",t,{item:e}),i.isOpen||i._select(e,t)),i.focusIndex=e.index,i.button.attr("aria-activedescendant",i.menuItems.eq(e.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t=this.element.find("option");this.menu.empty(),this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,t.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(V.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(t){var e=V("<span>");return this._setText(e,t.label),this._addClass(e,"ui-selectmenu-text"),e},_renderMenu:function(s,t){var n=this,o="";V.each(t,function(t,e){var i;e.optgroup!==o&&(i=V("<li>",{text:e.optgroup}),n._addClass(i,"ui-selectmenu-optgroup","ui-menu-divider"+(e.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),i.appendTo(s),o=e.optgroup),n._renderItemData(s,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(t,e){var i=V("<li>"),s=V("<div>",{title:e.element.attr("title")});return e.disabled&&this._addClass(i,null,"ui-state-disabled"),this._setText(s,e.label),i.append(s).appendTo(t)},_setText:function(t,e){e?t.text(e):t.html("&#160;")},_move:function(t,e){var i,s=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),s+=":not(.ui-state-disabled)"),(s="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](s).eq(-1):i[t+"All"](s).eq(0)).length&&this.menuInstance.focus(e,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")}
vendor: 4,336 bytes, line 98
98,_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?((t=window.getSelection()).removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.trigger("focus"))},_documentClick:{mousedown:function(t){this.isOpen&&(V(t.target).closest(".ui-selectmenu-menu, #"+V.escapeSelector(this.ids.button)).length||this.close(t))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection()).rangeCount&&(this.range=t.getRangeAt(0)):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(t){var e=!0;switch(t.keyCode){case V.ui.keyCode.TAB:case V.ui.keyCode.ESCAPE:this.close(t),e=!1;break;case V.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case V.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case V.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case V.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case V.ui.keyCode.LEFT:this._move("prev",t);break;case V.ui.keyCode.RIGHT:this._move("next",t);break;case V.ui.keyCode.HOME:case V.ui.keyCode.PAGE_UP:this._move("first",t);break;case V.ui.keyCode.END:case V.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),e=!1}e&&t.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){t=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(t,e){var i;"icons"===t&&(i=this.button.find("span.ui-icon"),this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)),this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?V(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;!1!==t?(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t)):this.button.css("width","")},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(t){var i=this,s=[];t.each(function(t,e){e.hidden||s.push(i._parseOption(V(e),t))}),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),V.widget("ui.slider",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null}
vendor: 4,689 bytes, line 98
98,numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,e=this.options,i=this.element.find(".ui-slider-handle"),s=[],n=e.values&&e.values.length||1;for(i.length>n&&(i.slice(n).remove(),i=i.slice(0,n)),t=i.length;t<n;t++)s.push("<span tabindex='0'></span>");this.handles=i.add(V(s.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(t){V(this).data("ui-slider-handle-index",t).attr("tabIndex",0)})},_createRange:function(){var t=this.options;t.range?(!0===t.range&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:Array.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=V("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==t.range&&"max"!==t.range||this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,o,e,a,r=this,l=this.options;return!l.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),a={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(a),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var e=Math.abs(i-r.values(t));(e<s||s===e&&(t===r._lastChangedValue||r.values(t)===l.min))&&(s=e,n=V(this),o=t)}),!1!==this._start(t,o)&&(this._mouseSliding=!0,this._handleIndex=o,this._addClass(n,null,"ui-state-active"),n.trigger("focus"),e=n.offset(),a=!V(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=a?{left:0,top:0}:{left:t.pageX-e.left-n.width()/2,top:t.pageY-e.top-n.height()/2-(parseInt(n.css("borderTopWidth"),10)||0)-(parseInt(n.css("borderBottomWidth"),10)||0)+(parseInt(n.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,i),this._animateOff=!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},e=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,e),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,t="horizontal"===this.orientation?(e=this.elementSize.width,t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),t=t/e;return(t=1<t?1:t)<0&&(t=0),"vertical"===this.orientation&&(t=1-t),e=this._valueMax()-this._valueMin(),e=this._valueMin()+t*e,this._trimAlignValue(e)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n=this.value(),o=this.values();this._hasMultipleValues()&&(s=this.values(e?0:1),n=this.values(e),2===this.options.values.length&&!0===this.options.range&&(i=0===e?Math.min(s,i):Math.max(s,i)),o[e]=i),i!==n&&!1!==this._trigger("slide",t,this._uiHash(e,i,o))&&(this._hasMultipleValues()?this.values(e,i):this.value(i))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value(
vendor: 4,839 bytes, line 98
98)},values:function(t,e){var i,s,n;if(1<arguments.length)return this.options.values[t]=this._trimAlignValue(e),this._refreshValue(),void this._change(null,t);if(!arguments.length)return this._values();if(!Array.isArray(t))return this._hasMultipleValues()?this._values(t):this.value();for(i=this.options.values,s=t,n=0;n<i.length;n+=1)i[n]=this._trimAlignValue(s[n]),this._change(null,n);this._refreshValue()},_setOption:function(t,e){var i,s=0;switch("range"===t&&!0===this.options.range&&("min"===e?(this.options.value=this._values(0),this.options.values=null):"max"===e&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),Array.isArray(this.options.values)&&(s=this.options.values.length),this._super(t,e),t){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(e),this.handles.css("horizontal"===e?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=s-1;0<=i;i--)this._change(null,i);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i;if(arguments.length)return t=this.options.values[t],t=this._trimAlignValue(t);if(this._hasMultipleValues()){for(e=this.options.values.slice(),i=0;i<e.length;i+=1)e[i]=this._trimAlignValue(e[i]);return e}return[]},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=0<this.options.step?this.options.step:1,i=(t-this._valueMin())%e,t=t-i;return 2*Math.abs(i)>=e&&(t+=0<i?e:-e),parseFloat(t.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step;(t=Math.round((t-e)/i)*i+e)>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return t=null!==this.options.min?Math.max(t,this._precisionOf(this.options.min)):t},_precisionOf:function(t){var e=t.toString(),t=e.indexOf(".");return-1===t?0:e.length-t-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,t,s,n,o=this.options.range,a=this.options,r=this,l=!this._animateOff&&a.animate,h={};this._hasMultipleValues()?this.handles.each(function(t){i=(r.values(t)-r._valueMin())/(r._valueMax()-r._valueMin())*100,h["horizontal"===r.orientation?"left":"bottom"]=i+"%",V(this).stop(1,1)[l?"animate":"css"](h,a.animate),!0===r.options.range&&("horizontal"===r.orientation?(0===t&&r.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},a.animate),1===t&&r.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:a.animate})):(0===t&&r.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},a.animate),1===t&&r.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:a.animate}))),e=i}):(t=this.value(),s=this._valueMin(),n=this._valueMax(),i=n!==s?(t-s)/(n-s)*100:0,h["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](h,a.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},a.animate),"max"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:100-i+"%"},a.animate),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},a.animate),"max"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:100-i+"%"},a.animate))},_handleEvents:{keydown:function(t){var e,i,s,n=V(t.target).data("ui-slider-handle-index");switch(t.keyCode){case V.ui.keyCode.HOME:case V.ui.keyCode.END:case V.ui.keyCode.PAGE_UP:case V.ui.keyCode.PAGE_DOWN:case V.ui.keyCode.UP:case V.ui.keyCode.RIGHT:case V.ui.keyCode.DOWN:case V.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(V(t.target),null,"ui-state-active"),!1===this._start(t,n)))return}switch(s=this.options.step,e=i=this._hasMultipleValues()?this.values(n):this.value(),t.keyCode){case V.ui.keyCode.HOME:i=this._valueMin();break;case V.ui.keyCode.END:i=this._valueMax();break;case V.ui.keyCode.PAGE_UP:i=this._trimAlignValue(e+(this._valueMax()-this._valueMin())/this.numPages);break;
vendor: 10,695 bytes, line 98
98case V.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(e-(this._valueMax()-this._valueMin())/this.numPages);break;case V.ui.keyCode.UP:case V.ui.keyCode.RIGHT:if(e===this._valueMax())return;i=this._trimAlignValue(e+s);break;case V.ui.keyCode.DOWN:case V.ui.keyCode.LEFT:if(e===this._valueMin())return;i=this._trimAlignValue(e-s)}this._slide(t,n,i)},keyup:function(t){var e=V(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,e),this._change(t,e),this._removeClass(V(t.target),null,"ui-state-active"))}}}),V.widget("ui.sortable",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),V.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;0<=t;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,e){var i=null,s=!1,n=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),V(t.target).parents().each(function(){if(V.data(this,n.widgetName+"-item")===n)return i=V(this),!1}),!!(i=V.data(t.target,n.widgetName+"-item")===n?V(t.target):i)&&(!(this.options.handle&&!e&&(V(this.options.handle,i).find("*").addBack().each(function(){this===t.target&&(s=!0)}),!s))&&(this.currentItem=i,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,e,i){var s,n,o=this.options;if((this.currentContainer=this).refreshPositions(),this.appendTo=V("parent"!==o.appendTo?o.appendTo:this.currentItem.parent()),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},V.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),this.scrollParent=this.placeholder.scrollParent(),V.extend(this.offset,{parent:this._getParentOffset()}),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(n=this.document.find("body"),this.storedCursor=n.css("cursor"),n.css("cursor",o.cursor),this.storedStylesheet=V("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(n)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return V.ui.ddmanager&&(V.ui.ddmanager.current=this),V.ui.ddmanager&&!o.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this.helper.parent().is(this.appendTo)||(this.helper.detach().appendTo(this.appendTo),this.offset.parent=this._getParentOffset()),this.position=this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute"),this._mouseDrag(t),!0},_scroll:function(t){var e=this.options,i=!1;return this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<e.scrollSensitivity?this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop+e.scrollSpeed:t.pageY-this.overflowOffset.top<e.scrollSensitivity&&(this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop-e.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<e.scrollSensitivity?this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft+e.scrollSpeed:t.pageX-this.overflowOffset.left<e.scrollSensitivity&&(this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft-e.scrollSpeed)):(t.pageY-this.document.scrollTop()<e.scrollSensitivity?i=this.document.scrollTop(this.document.scrollTop()-e.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<e.scrollSensitivity&&(i=this.document.scrollTop(this.document.scrollTop()+e.scrollSpeed)),t.pageX-this.document.scrollLeft()<e.scrollSensitivity?i=this.document.scrollLeft(this.document.scrollLeft()-e.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<e.scrollSensitivity&&(i=this.document.scrollLeft(this.document.scrollLeft()+e.scrollSpeed))),i},_mouseDrag:function(t){var e,i,s,n,o=this.options;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),o.scroll&&!1!==this._scroll(t)&&(this._refreshItemPositions(!0),V.ui.ddmanager&&!o.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t)),this.dragDirection={vertical:this._getDragVerticalDirection(),horizontal:this._getDragHorizontalDirection()},e=this.items.length-1;0<=e;e--)if(s=(i=this.items[e]).item[0],(n=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===n?"next":"prev"]()[0]===s||V.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&V.contains(this.element[0],s))){if(this.direction=1===n?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),V.ui.ddmanager&&V.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){var i,s,n,o;if(t)return V.ui.ddmanager&&!this.options.dropBehaviour&&V.ui.ddmanager.drop(this,t),this.options.revert?(s=(i=this).placeholder.offset(),o={},(n=this.options.axis)&&"x"!==n||(o.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),n&&"y"!==n||(o.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,V(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){i._clear(t)})):this._clear(t,e),!1},cancel:function(){if(this.dragging){this._mouseUp(new V.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;0<=t;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),V.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?V(this.domPosition.prev).after(this.currentItem):V(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},V(t).each(function(){var t=(V(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&i.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(V(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,l=r+t.height,h=this.offset.click.top,c=this.offset.click.left,h="x"===this.options.axis||r<s+h&&s+h<l,c="y"===this.options.axis||o<e+c&&e+c<a;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?h&&c:o<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<a&&r<s+this.helperProportions.height/2&&n-this.helperProportions.height/2<l},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),t="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!e||!t)&&(e=this.dragDirection.vertical,t=this.dragDirection.horizontal,this.floating?"right"===t||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this.dragDirection.vertical,t=this.dragDirection.horizontal;return this.floating&&t?"right"===t&&i||"left"===t&&!i:s&&("down"===s&&e||"up"===s
vendor: 4,080 bytes, line 98
98&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(0<t?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(0<t?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e,i,s,n,o=[],a=[],r=this._connectWith();if(r&&t)for(e=r.length-1;0<=e;e--)for(i=(s=V(r[e],this.document[0])).length-1;0<=i;i--)(n=V.data(s[i],this.widgetFullName))&&n!==this&&!n.options.disabled&&a.push(["function"==typeof n.options.items?n.options.items.call(n.element):V(n.options.items,n.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),n]);function l(){o.push(this)}for(a.push(["function"==typeof this.options.items?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):V(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),e=a.length-1;0<=e;e--)a[e][0].each(l);return V(o)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=V.grep(this.items,function(t){for(var e=0;e<i.length;e++)if(i[e]===t.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var e,i,s,n,o,a,r,l,h=this.items,c=[["function"==typeof this.options.items?this.options.items.call(this.element[0],t,{item:this.currentItem}):V(this.options.items,this.element),this]],u=this._connectWith();if(u&&this.ready)for(e=u.length-1;0<=e;e--)for(i=(s=V(u[e],this.document[0])).length-1;0<=i;i--)(n=V.data(s[i],this.widgetFullName))&&n!==this&&!n.options.disabled&&(c.push(["function"==typeof n.options.items?n.options.items.call(n.element[0],t,{item:this.currentItem}):V(n.options.items,n.element),n]),this.containers.push(n));for(e=c.length-1;0<=e;e--)for(o=c[e][1],l=(a=c[e][i=0]).length;i<l;i++)(r=V(a[i])).data(this.widgetName+"-item",o),h.push({item:r,instance:o,width:0,height:0,left:0,top:0})},_refreshItemPositions:function(t){for(var e,i,s=this.items.length-1;0<=s;s--)e=this.items[s],this.currentContainer&&e.instance!==this.currentContainer&&e.item[0]!==this.currentItem[0]||(i=this.options.toleranceElement?V(this.options.toleranceElement,e.item):e.item,t||(e.width=i.outerWidth(),e.height=i.outerHeight()),i=i.offset(),e.left=i.left,e.top=i.top)},refreshPositions:function(t){var e,i;if(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),this._refreshItemPositions(t),this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;0<=e;e--)i=this.containers[e].element.offset(),this.containers[e].containerCache.left=i.left,this.containers[e].containerCache.top=i.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight();return this},_createPlaceholder:function(i){var s,n,o=(i=i||this).options;o.placeholder&&o.placeholder.constructor!==String||(s=o.placeholder,n=i.currentItem[0].nodeName.toLowerCase(),o.placeholder={element:function(){var t=V("<"+n+">",i.document[0]);return i._addClass(t,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(t,"ui-sortable-helper"),"tbody"===n?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),V("<tr>",i.document[0]).appendTo(t)):"tr"===n?i._createTrPlaceholder(i.currentItem,t):"img"===n&&t.attr("src",i.currentItem.attr("src")),s||t.css("visibility","hidden"),t},update:function(t,e){s&&!o.forcePlaceholderSize||(e.height()&&(!o.forcePlaceholderSize||"tbody"!==n&&"tr"!==n)||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()
vendor: 38,617 bytes, lines 98-214
98||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=V(o.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),o.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){V("<td>&#160;</td>",i.document[0]).attr("colspan",V(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,n,o,a,r,l,h,c=null,u=null,d=this.containers.length-1;0<=d;d--)V.contains(this.currentItem[0],this.containers[d].element[0])||(this._intersectsWith(this.containers[d].containerCache)?c&&V.contains(this.containers[d].element[0],c.element[0])||(c=this.containers[d],u=d):this.containers[d].containerCache.over&&(this.containers[d]._trigger("out",t,this._uiHash(this)),this.containers[d].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[u].containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1);else{for(i=1e4,s=null,n=(l=c.floating||this._isFloating(this.currentItem))?"left":"top",o=l?"width":"height",h=l?"pageX":"pageY",e=this.items.length-1;0<=e;e--)V.contains(this.containers[u].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(a=this.items[e].item.offset()[n],r=!1,t[h]-a>this.items[e][o]/2&&(r=!0),Math.abs(t[h]-a)<i&&(i=Math.abs(t[h]-a),s=this.items[e],this.direction=r?"up":"down"));(s||this.options.dropOnEmpty)&&(this.currentContainer!==this.containers[u]?(s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[u].element,!0),this._trigger("change",t,this._uiHash()),this.containers[u]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[u],this.options.placeholder.update(this.currentContainer,this.placeholder),this.scrollParent=this.placeholder.scrollParent(),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1):this.currentContainer.containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1))}},_createHelper:function(t){var e=this.options,t="function"==typeof e.helper?V(e.helper.apply(this.element[0],[t,this.currentItem])):"clone"===e.helper?this.currentItem.clone():this.currentItem;return t.parents("body").length||this.appendTo[0].appendChild(t[0]),t[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),t[0].style.width&&!e.forceHelperSize||t.width(this.currentItem.width()),t[0].style.height&&!e.forceHelperSize||t.height(this.currentItem.height()),t},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=Array.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&V.ui.ie?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),"document"!==i.containment&&"window"!==i.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=V(i.containment)[0],e=V(i.containment).offset(),i="hidden"!==V(t).css("overflow"),this.containment=[e.left+(parseInt(V(t).css("borderLeftWidth"),10)||0)+(parseInt(V(t).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(V(t).css("borderTopWidth"),10)||0)+(parseInt(V(t).css("paddingTop"),10)||0)-this.margins.top,e.left+(i?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(V(t).css("borderLeftWidth"),10)||0)-(parseInt(V(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(i?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(V(t).css("borderTopWidth"),10)||0)-(parseInt(V(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,t=/(html|body)/i.test(s[0].tagName);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():t?0:s.scrollTop())*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():t?0:s.scrollLeft())*i}},_generatePosition:function(t){var e=this.options,i=t.pageX,s=t.pageY,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(i=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),e.grid&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0])),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function n(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)e||s.push(n("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(n("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===V.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||V([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}});function ht(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}V.widget("ui.spinner",{version:"1.13.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var s=this._super(),n=this.element;return V.each(["min","max","step"],function(t,e){var i=n.attr(e);null!=i&&i.length&&(s[e]=i)}),s},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,e){var i=V.ui.safeActiveElement(this.document[0]);if(this.element[0]===i&&e){if(!this.spinning&&!this._start(t))return!1;this._spin((0<e?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(t){var e;function i(){this.element[0]===V.ui.safeActiveElement(this.document[0])||(this.element.trigger("focus"),this.previous=e,this._delay(function(){this.previous=e}))}e=this.element[0]===V.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),!1!==this._start(t)&&this._repeat(null,V(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(V(t.currentTarget).hasClass("ui-state-active"))return!1!==this._start(t)&&void this._repeat(null,V(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&0<this.uiSpinner.height()&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(t){var e=this.options,i=V.ui.keyCode;switch(t.keyCode){case i.UP:return this._repeat(null,1,t),!0;case i.DOWN:return this._repeat(null,-1,t),!0;case i.PAGE_UP:return this._repeat(null,e.page,t),!0;case i.PAGE_DOWN:return this._repeat(null,-e.page,t),!0}return!1},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t))&&(this.counter||(this.counter=1),this.spinning=!0)},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",e,{value:i})||(this._value(i),this.counter++)},_increment:function(t){var e=this.options.incremental;return e?"function"==typeof e?e(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return t=null!==this.options.min?Math.max(t,this._precisionOf(this.options.min)):t},_precisionOf:function(t){var e=t.toString(),t=e.indexOf(".");return-1===t?0:e.length-t-1},_adjustValue:function(t){var e=this.options,i=null!==e.min?e.min:0,s=t-i;return t=i+Math.round(s/e.step)*e.step,t=parseFloat(t.toFixed(this._precision())),null!==e.max&&t>e.max?e.max:null!==e.min&&t<e.min?e.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i;if("culture"===t||"numberFormat"===t)return i=this._parse(this.element.val()),this.options[t]=e,void this.element.val(this._format(i));"max"!==t&&"min"!==t&&"step"!==t||"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(i=this.buttons.first().find(".ui-icon"),this._removeClass(i,null,this.options.icons.up),this._addClass(i,null,e.up),i=this.buttons.last().find(".ui-icon"),this._removeClass(i,null,this.options.icons.down),this._addClass(i,null,e.down)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:ht(function(t){this._super(t)}),_parse:function(t){return""===(t="string"==typeof t&&""!==t?window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t:t)||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null!==t&&t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&null!==(i=this._parse(t))&&(e||(i=this._adjustValue(i)),t=this._format(i)),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:ht(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:ht(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:ht(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:ht(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){if(!arguments.length)return this._parse(this.element.val());ht(this._value).call(this,t)},widget:function(){return this.uiSpinner}}),!1!==V.uiBackCompat&&V.widget("ui.spinner",V.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}});var ct;V.ui.spinner;V.widget("ui.tabs",{version:"1.13.2",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(ct=/#.*$/,function(t){var e=t.href.replace(ct,""),i=location.href.replace(ct,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1<t.hash.length&&e===i}),_create:function(){var e=this,t=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,t.collapsible),this._processTabs(),t.active=this._initialActive(),Array.isArray(t.disabled)&&(t.disabled=V.uniqueSort(t.disabled.concat(V.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(t.active):this.active=V(),this._refresh(),this.active.length&&this.load(t.active)},_initialActive:function(){var i=this.options.active,t=this.options.collapsible,s=location.hash.substring(1);return null===i&&(s&&this.tabs.each(function(t,e){if(V(e).attr("aria-controls")===s)return i=t,!1}),null!==(i=null===i?this.tabs.index(this.tabs.filter(".ui-tabs-active")):i)&&-1!==i||(i=!!this.tabs.length&&0)),!1!==i&&-1===(i=this.tabs.index(this.tabs.eq(i)))&&(i=!t&&0),i=!t&&!1===i&&this.anchors.length?0:i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):V()}},_tabKeydown:function(t){var e=V(V.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(e),s=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case V.ui.keyCode.RIGHT:case V.ui.keyCode.DOWN:i++;break;case V.ui.keyCode.UP:case V.ui.keyCode.LEFT:s=!1,i--;break;case V.ui.keyCode.END:i=this.anchors.length-1;break;case V.ui.keyCode.HOME:i=0;break;case V.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i);case V.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,s),t.ctrlKey||t.metaKey||(e.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===V.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===V.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===V.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,e){var i=this.tabs.length-1;for(;-1!==V.inArray(t=(t=i<t?0:t)<0?i:t,this.options.disabled);)t=e?t+1:t-1;return t},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){"active"!==t?(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e)):this._activate(e)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=V.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!V.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=V()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=V()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var l=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){V(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){V(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return V("a",this)[0]}).attr({tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=V(),this.anchors.each(function(t,e){var i,s,n,o=V(e).uniqueId().attr("id"),a=V(e).closest("li"),r=a.attr("aria-controls");l._isLocal(e)?(n=(i=e.hash).substring(1),s=l.element.find(l._sanitizeSelector(i))):(n=a.attr("aria-controls")||V({}).uniqueId()[0].id,(s=l.element.find(i="#"+n)).length||(s=l._createPanel(n)).insertAfter(l.panels[t-1]||l.tablist),s.attr("aria-live","polite")),s.length&&(l.panels=l.panels.add(s)),r&&a.data("ui-tabs-aria-controls",r),a.attr({"aria-controls":n,"aria-labelledby":o}),s.attr("aria-labelledby",o)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return V("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i;for(Array.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;e=this.tabs[i];i++)e=V(e),!0===t||-1!==V.inArray(i,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=V(this).outerHeight(!0)}),this.panels.each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,V(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget).closest("li"),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():this._getPanelForTab(s),r=i.length?this._getPanelForTab(i):V(),i={oldTab:i,oldPanel:r,newTab:o?V():s,newPanel:a};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||n&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!o&&this.tabs.index(s),this.active=n?V():s,this.xhr&&this.xhr.abort(),r.length||a.length||V.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,s=e.newPanel,n=e.oldPanel;function o(){i.running=!1,i._trigger("activate",t,e)}function a(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),s.length&&i.options.show?i._show(s,i.options.show,o):(s.show(),o())}this.running=!0,n.length&&this.options.hide?this._hide(n,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n.hide(),a()),n.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&n.length?e.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===V(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t=(t=!t.length?this.active:t).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return!1===t?V():this.tabs.eq(t)},_getIndex:function(t){return t="string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+V.escapeSelector(t)+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){V.data(this,"ui-tabs-destroy")?V(this).remove():V(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=V(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),Array.isArray(t)?V.map(t,function(t){return t!==i?t:null}):V.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==V.inArray(t,e))return;e=Array.isArray(e)?V.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,s){t=this._getIndex(t);function n(t,e){"abort"===e&&o.panels.stop(!1,!0),o._removeClass(i,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===o.xhr&&delete o.xhr}var o=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),a=this._getPanelForTab(i),r={tab:i,panel:a};this._isLocal(t[0])||(this.xhr=V.ajax(this._ajaxSettings(t,s,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){a.html(t),o._trigger("load",s,r),n(i,e)},1)}).fail(function(t,e){setTimeout(function(){n(t,e)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,e){return n._trigger("beforeLoad",i,V.extend({jqXHR:t,ajaxSettings:e},s))}}},_getPanelForTab:function(t){t=V(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}}),!1!==V.uiBackCompat&&V.widget("ui.tabs",V.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});V.ui.tabs;V.widget("ui.tooltip",{version:"1.13.2",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=V(this).attr("title");return V("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,e){var i=(t.attr("aria-describedby")||"").split(/\s+/);i.push(e),t.data("ui-tooltip-id",e).attr("aria-describedby",String.prototype.trim.call(i.join(" ")))},_removeDescribedBy:function(t){var e=t.data("ui-tooltip-id"),i=(t.attr("aria-describedby")||"").split(/\s+/),e=V.inArray(e,i);-1!==e&&i.splice(e,1),t.removeData("ui-tooltip-id"),(i=String.prototype.trim.call(i.join(" ")))?t.attr("aria-describedby",i):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=V("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=V([])},_setOption:function(t,e){var i=this;this._super(t,e),"content"===t&&V.each(this.tooltips,function(t,e){i._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var s=this;V.each(this.tooltips,function(t,e){var i=V.Event("blur");i.target=i.currentTarget=e.element[0],s.close(i,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=V(this);if(t.is("[title]"))return t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var t=V(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=V([])},open:function(t){var i=this,e=V(t?t.target:this.element).closest(this.options.items);e.length&&!e.data("ui-tooltip-id")&&(e.attr("title")&&e.data("ui-tooltip-title",e.attr("title")),e.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&e.parents().each(function(){var t,e=V(this);e.data("ui-tooltip-open")&&((t=V.Event("blur")).target=t.currentTarget=this,i.close(t,!0)),e.attr("title")&&(e.uniqueId(),i.parents[this.id]={element:this,title:e.attr("title")},e.attr("title",""))}),this._registerCloseHandlers(t,e),this._updateContent(e,t))},_updateContent:function(e,i){var t=this.options.content,s=this,n=i?i.type:null;if("string"==typeof t||t.nodeType||t.jquery)return this._open(i,e,t);(t=t.call(e[0],function(t){s._delay(function(){e.data("ui-tooltip-open")&&(i&&(i.type=n),this._open(i,e,t))})}))&&this._open(i,e,t)},_open:function(t,e,i){var s,n,o,a=V.extend({},this.options.position);function r(t){a.of=t,n.is(":hidden")||n.position(a)}i&&((s=this._find(e))?s.tooltip.find(".ui-tooltip-content").html(i):(e.is("[title]")&&(t&&"mouseover"===t.type?e.attr("title",""):e.removeAttr("title")),s=this._tooltip(e),n=s.tooltip,this._addDescribedBy(e,n.attr("id")),n.find(".ui-tooltip-content").html(i),this.liveRegion.children().hide(),(i=V("<div>").html(n.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),i.removeAttr("id").find("[id]").removeAttr("id"),i.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:r}),r(t)):n.position(V.extend({of:e},this.options.position)),n.hide(),this._show(n,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(o=this.delayedShow=setInterval(function(){n.is(":visible")&&(r(a.of),clearInterval(o))},13)),this._trigger("open",t,{tooltip:n})))},_registerCloseHandlers:function(t,e){var i={keyup:function(t){t.keyCode===V.ui.keyCode.ESCAPE&&((t=V.Event(t)).currentTarget=e[0],this.close(t,!0))}};e[0]!==this.element[0]&&(i.remove=function(){var t=this._find(e);t&&this._removeTooltip(t.tooltip)}),t&&"mouseover"!==t.type||(i.mouseleave="close"),t&&"focusin"!==t.type||(i.focusout="close"),this._on(!0,e,i)},close:function(t){var e,i=this,s=V(t?t.currentTarget:this.element),n=this._find(s);n?(e=n.tooltip,n.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),n.hiding=!0,e.stop(!0),this._hide(e,this.options.hide,function(){i._removeTooltip(V(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&V.each(this.parents,function(t,e){V(e.element).attr("title",e.title),delete i.parents[t]}),n.closing=!0,this._trigger("close",t,{tooltip:e}),n.hiding||(n.closing=!1))):s.removeData("ui-tooltip-open")},_tooltip:function(t){var e=V("<div>").attr("role","tooltip"),i=V("<div>").appendTo(e),s=e.uniqueId().attr("id");return this._addClass(i,"ui-tooltip-content"),this._addClass(e,"ui-tooltip","ui-widget ui-widget-content"),e.appendTo(this._appendTo(t)),this.tooltips[s]={element:t,tooltip:e}},_find:function(t){t=t.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(t){clearInterval(this.delayedShow),t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){t=t.closest(".ui-front, dialog");return t=!t.length?this.document[0].body:t},_destroy:function(){var s=this;V.each(this.tooltips,function(t,e){var i=V.Event("blur"),e=e.element;i.target=i.currentTarget=e[0],s.close(i,!0),V("#"+t).remove(),e.data("ui-tooltip-title")&&(e.attr("title")||e.attr("title",e.data("ui-tooltip-title")),e.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!1!==V.uiBackCompat&&V.widget("ui.tooltip",V.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}});V.ui.tooltip});
99    }(xaJquery);
100
101    xaJquery.shouldInitialize = function () {
102        return !!window.Sitecore.WebEditSettings.editing;
103    };
104
105    return xaJquery;
106}();
107
108
109/*  moment  */
110//! moment.js
111//! version : 2.30.1
112//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
113//! license : MIT
114//! momentjs.com
115
116;(function (global, factory) {
117    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
118    typeof define === 'function' && define.amd ? define(factory) :
119    global.moment = factory()
120}(this, (function () { 'use strict';
121
122    var hookCallback;
123
124    function hooks() {
125        return hookCallback.apply(null, arguments);
126    }
127
128    // This is done to register the method called with moment()
129    // without creating circular dependencies.
130    function setHookCallback(callback) {
131        hookCallback = callback;
132    }
133
134    function isArray(input) {
135        return (
136            input instanceof Array ||
137            Object.prototype.toString.call(input) === '[object Array]'
138        );
139    }
140
141    function isObject(input) {
142        // IE8 will treat undefined and null as object if it wasn't for
143        // input != null
144        return (
145            input != null &&
146            Object.prototype.toString.call(input) === '[object Object]'
147        );
148    }
149
150    function hasOwnProp(a, b) {
151        return Object.prototype.hasOwnProperty.call(a, b);
152    }
153
154    function isObjectEmpty(obj) {
155        if (Object.getOwnPropertyNames) {
156            return Object.getOwnPropertyNames(obj).length === 0;
157        } else {
158            var k;
159            for (k in obj) {
160                if (hasOwnProp(obj, k)) {
161                    return false;
162                }
163            }
164            return true;
165        }
166    }
167
168    function isUndefined(input) {
169        return input === void 0;
170    }
171
172    function isNumber(input) {
173        return (
174            typeof input === 'number' ||
175            Object.prototype.toString.call(input) === '[object Number]'
176        );
177    }
178
179    function isDate(input) {
180        return (
181            input instanceof Date ||
182            Object.prototype.toString.call(input) === '[object Date]'
183        );
184    }
185
186    function map(arr, fn) {
187        var res = [],
188            i,
189            arrLen = arr.length;
190        for (i = 0; i < arrLen; ++i) {
191            res.push(fn(arr[i], i));
192        }
193        return res;
194    }
195
196    function extend(a, b) {
197        for (var i in b) {
198            if (hasOwnProp(b, i)) {
199                a[i] = b[i];
200            }
201        }
202
203        if (hasOwnProp(b, 'toString')) {
204            a.toString = b.toString;
205        }
206
207        if (hasOwnProp(b, 'valueOf')) {
208            a.valueOf = b.valueOf;
209        }
210
211        return a;
212    }
213
214    function createUTC(input, format, locale, strict) {
vendor: 4,261 bytes, lines 215-357
215        return createLocalOrUTC(input, format, locale, strict, true).utc();
216    }
217
218    function defaultParsingFlags() {
219        // We need to deep clone this object.
220        return {
221            empty: false,
222            unusedTokens: [],
223            unusedInput: [],
224            overflow: -2,
225            charsLeftOver: 0,
226            nullInput: false,
227            invalidEra: null,
228            invalidMonth: null,
229            invalidFormat: false,
230            userInvalidated: false,
231            iso: false,
232            parsedDateParts: [],
233            era: null,
234            meridiem: null,
235            rfc2822: false,
236            weekdayMismatch: false,
237        };
238    }
239
240    function getParsingFlags(m) {
241        if (m._pf == null) {
242            m._pf = defaultParsingFlags();
243        }
244        return m._pf;
245    }
246
247    var some;
248    if (Array.prototype.some) {
249        some = Array.prototype.some;
250    } else {
251        some = function (fun) {
252            var t = Object(this),
253                len = t.length >>> 0,
254                i;
255
256            for (i = 0; i < len; i++) {
257                if (i in t && fun.call(this, t[i], i, t)) {
258                    return true;
259                }
260            }
261
262            return false;
263        };
264    }
265
266    function isValid(m) {
267        var flags = null,
268            parsedParts = false,
269            isNowValid = m._d && !isNaN(m._d.getTime());
270        if (isNowValid) {
271            flags = getParsingFlags(m);
272            parsedParts = some.call(flags.parsedDateParts, function (i) {
273                return i != null;
274            });
275            isNowValid =
276                flags.overflow < 0 &&
277                !flags.empty &&
278                !flags.invalidEra &&
279                !flags.invalidMonth &&
280                !flags.invalidWeekday &&
281                !flags.weekdayMismatch &&
282                !flags.nullInput &&
283                !flags.invalidFormat &&
284                !flags.userInvalidated &&
285                (!flags.meridiem || (flags.meridiem && parsedParts));
286            if (m._strict) {
287                isNowValid =
288                    isNowValid &&
289                    flags.charsLeftOver === 0 &&
290                    flags.unusedTokens.length === 0 &&
291                    flags.bigHour === undefined;
292            }
293        }
294        if (Object.isFrozen == null || !Object.isFrozen(m)) {
295            m._isValid = isNowValid;
296        } else {
297            return isNowValid;
298        }
299        return m._isValid;
300    }
301
302    function createInvalid(flags) {
303        var m = createUTC(NaN);
304        if (flags != null) {
305            extend(getParsingFlags(m), flags);
306        } else {
307            getParsingFlags(m).userInvalidated = true;
308        }
309
310        return m;
311    }
312
313    // Plugins that add properties should also add the key here (null value),
314    // so we can properly clone ourselves.
315    var momentProperties = (hooks.momentProperties = []),
316        updateInProgress = false;
317
318    function copyConfig(to, from) {
319        var i,
320            prop,
321            val,
322            momentPropertiesLen = momentProperties.length;
323
324        if (!isUndefined(from._isAMomentObject)) {
325            to._isAMomentObject = from._isAMomentObject;
326        }
327        if (!isUndefined(from._i)) {
328            to._i = from._i;
329        }
330        if (!isUndefined(from._f)) {
331            to._f = from._f;
332        }
333        if (!isUndefined(from._l)) {
334            to._l = from._l;
335        }
336        if (!isUndefined(from._strict)) {
337            to._strict = from._strict;
338        }
339        if (!isUndefined(from._tzm)) {
340            to._tzm = from._tzm;
341        }
342        if (!isUndefined(from._isUTC)) {
343            to._isUTC = from._isUTC;
344        }
345        if (!isUndefined(from._offset)) {
346            to._offset = from._offset;
347        }
348        if (!isUndefined(from._pf)) {
349            to._pf = getParsingFlags(from);
350        }
351        if (!isUndefined(from._locale)) {
352            to._locale = from._locale;
353        }
354
355        if (momentPropertiesLen > 0) {
356            for (i = 0; i < momentPropertiesLen; i++) {
357                prop = momentProperties[i];
vendor: 10,629 bytes, lines 358-699
358                val = from[prop];
359                if (!isUndefined(val)) {
360                    to[prop] = val;
361                }
362            }
363        }
364
365        return to;
366    }
367
368    // Moment prototype object
369    function Moment(config) {
370        copyConfig(this, config);
371        this._d = new Date(config._d != null ? config._d.getTime() : NaN);
372        if (!this.isValid()) {
373            this._d = new Date(NaN);
374        }
375        // Prevent infinite loop in case updateOffset creates new moment
376        // objects.
377        if (updateInProgress === false) {
378            updateInProgress = true;
379            hooks.updateOffset(this);
380            updateInProgress = false;
381        }
382    }
383
384    function isMoment(obj) {
385        return (
386            obj instanceof Moment || (obj != null && obj._isAMomentObject != null)
387        );
388    }
389
390    function warn(msg) {
391        if (
392            hooks.suppressDeprecationWarnings === false &&
393            typeof console !== 'undefined' &&
394            console.warn
395        ) {
396            console.warn('Deprecation warning: ' + msg);
397        }
398    }
399
400    function deprecate(msg, fn) {
401        var firstTime = true;
402
403        return extend(function () {
404            if (hooks.deprecationHandler != null) {
405                hooks.deprecationHandler(null, msg);
406            }
407            if (firstTime) {
408                var args = [],
409                    arg,
410                    i,
411                    key,
412                    argLen = arguments.length;
413                for (i = 0; i < argLen; i++) {
414                    arg = '';
415                    if (typeof arguments[i] === 'object') {
416                        arg += '\n[' + i + '] ';
417                        for (key in arguments[0]) {
418                            if (hasOwnProp(arguments[0], key)) {
419                                arg += key + ': ' + arguments[0][key] + ', ';
420                            }
421                        }
422                        arg = arg.slice(0, -2); // Remove trailing comma and space
423                    } else {
424                        arg = arguments[i];
425                    }
426                    args.push(arg);
427                }
428                warn(
429                    msg +
430                        '\nArguments: ' +
431                        Array.prototype.slice.call(args).join('') +
432                        '\n' +
433                        new Error().stack
434                );
435                firstTime = false;
436            }
437            return fn.apply(this, arguments);
438        }, fn);
439    }
440
441    var deprecations = {};
442
443    function deprecateSimple(name, msg) {
444        if (hooks.deprecationHandler != null) {
445            hooks.deprecationHandler(name, msg);
446        }
447        if (!deprecations[name]) {
448            warn(msg);
449            deprecations[name] = true;
450        }
451    }
452
453    hooks.suppressDeprecationWarnings = false;
454    hooks.deprecationHandler = null;
455
456    function isFunction(input) {
457        return (
458            (typeof Function !== 'undefined' && input instanceof Function) ||
459            Object.prototype.toString.call(input) === '[object Function]'
460        );
461    }
462
463    function set(config) {
464        var prop, i;
465        for (i in config) {
466            if (hasOwnProp(config, i)) {
467                prop = config[i];
468                if (isFunction(prop)) {
469                    this[i] = prop;
470                } else {
471                    this['_' + i] = prop;
472                }
473            }
474        }
475        this._config = config;
476        // Lenient ordinal parsing accepts just a number in addition to
477        // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
478        // TODO: Remove "ordinalParse" fallback in next major release.
479        this._dayOfMonthOrdinalParseLenient = new RegExp(
480            (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
481                '|' +
482                /\d{1,2}/.source
483        );
484    }
485
486    function mergeConfigs(parentConfig, childConfig) {
487        var res = extend({}, parentConfig),
488            prop;
489        for (prop in childConfig) {
490            if (hasOwnProp(childConfig, prop)) {
491                if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
492                    res[prop] = {};
493                    extend(res[prop], parentConfig[prop]);
494                    extend(res[prop], childConfig[prop]);
495                } else if (childConfig[prop] != null) {
496                    res[prop] = childConfig[prop];
497                } else {
498                    delete res[prop];
499                }
500            }
501        }
502        for (prop in parentConfig) {
503            if (
504                hasOwnProp(parentConfig, prop) &&
505                !hasOwnProp(childConfig, prop) &&
506                isObject(parentConfig[prop])
507            ) {
508                // make sure changes to properties don't modify parent config
509                res[prop] = extend({}, res[prop]);
510            }
511        }
512        return res;
513    }
514
515    function Locale(config) {
516        if (config != null) {
517            this.set(config);
518        }
519    }
520
521    var keys;
522
523    if (Object.keys) {
524        keys = Object.keys;
525    } else {
526        keys = function (obj) {
527            var i,
528                res = [];
529            for (i in obj) {
530                if (hasOwnProp(obj, i)) {
531                    res.push(i);
532                }
533            }
534            return res;
535        };
536    }
537
538    var defaultCalendar = {
539        sameDay: '[Today at] LT',
540        nextDay: '[Tomorrow at] LT',
541        nextWeek: 'dddd [at] LT',
542        lastDay: '[Yesterday at] LT',
543        lastWeek: '[Last] dddd [at] LT',
544        sameElse: 'L',
545    };
546
547    function calendar(key, mom, now) {
548        var output = this._calendar[key] || this._calendar['sameElse'];
549        return isFunction(output) ? output.call(mom, now) : output;
550    }
551
552    function zeroFill(number, targetLength, forceSign) {
553        var absNumber = '' + Math.abs(number),
554            zerosToFill = targetLength - absNumber.length,
555            sign = number >= 0;
556        return (
557            (sign ? (forceSign ? '+' : '') : '-') +
558            Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +
559            absNumber
560        );
561    }
562
563    var formattingTokens =
564            /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
565        localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
566        formatFunctions = {},
567        formatTokenFunctions = {};
568
569    // token:    'M'
570    // padded:   ['MM', 2]
571    // ordinal:  'Mo'
572    // callback: function () { this.month() + 1 }
573    function addFormatToken(token, padded, ordinal, callback) {
574        var func = callback;
575        if (typeof callback === 'string') {
576            func = function () {
577                return this[callback]();
578            };
579        }
580        if (token) {
581            formatTokenFunctions[token] = func;
582        }
583        if (padded) {
584            formatTokenFunctions[padded[0]] = function () {
585                return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
586            };
587        }
588        if (ordinal) {
589            formatTokenFunctions[ordinal] = function () {
590                return this.localeData().ordinal(
591                    func.apply(this, arguments),
592                    token
593                );
594            };
595        }
596    }
597
598    function removeFormattingTokens(input) {
599        if (input.match(/\[[\s\S]/)) {
600            return input.replace(/^\[|\]$/g, '');
601        }
602        return input.replace(/\\/g, '');
603    }
604
605    function makeFormatFunction(format) {
606        var array = format.match(formattingTokens),
607            i,
608            length;
609
610        for (i = 0, length = array.length; i < length; i++) {
611            if (formatTokenFunctions[array[i]]) {
612                array[i] = formatTokenFunctions[array[i]];
613            } else {
614                array[i] = removeFormattingTokens(array[i]);
615            }
616        }
617
618        return function (mom) {
619            var output = '',
620                i;
621            for (i = 0; i < length; i++) {
622                output += isFunction(array[i])
623                    ? array[i].call(mom, format)
624                    : array[i];
625            }
626            return output;
627        };
628    }
629
630    // format date using native date object
631    function formatMoment(m, format) {
632        if (!m.isValid()) {
633            return m.localeData().invalidDate();
634        }
635
636        format = expandFormat(format, m.localeData());
637        formatFunctions[format] =
638            formatFunctions[format] || makeFormatFunction(format);
639
640        return formatFunctions[format](m);
641    }
642
643    function expandFormat(format, locale) {
644        var i = 5;
645
646        function replaceLongDateFormatTokens(input) {
647            return locale.longDateFormat(input) || input;
648        }
649
650        localFormattingTokens.lastIndex = 0;
651        while (i >= 0 && localFormattingTokens.test(format)) {
652            format = format.replace(
653                localFormattingTokens,
654                replaceLongDateFormatTokens
655            );
656            localFormattingTokens.lastIndex = 0;
657            i -= 1;
658        }
659
660        return format;
661    }
662
663    var defaultLongDateFormat = {
664        LTS: 'h:mm:ss A',
665        LT: 'h:mm A',
666        L: 'MM/DD/YYYY',
667        LL: 'MMMM D, YYYY',
668        LLL: 'MMMM D, YYYY h:mm A',
669        LLLL: 'dddd, MMMM D, YYYY h:mm A',
670    };
671
672    function longDateFormat(key) {
673        var format = this._longDateFormat[key],
674            formatUpper = this._longDateFormat[key.toUpperCase()];
675
676        if (format || !formatUpper) {
677            return format;
678        }
679
680        this._longDateFormat[key] = formatUpper
681            .match(formattingTokens)
682            .map(function (tok) {
683                if (
684                    tok === 'MMMM' ||
685                    tok === 'MM' ||
686                    tok === 'DD' ||
687                    tok === 'dddd'
688                ) {
689                    return tok.slice(1);
690                }
691                return tok;
692            })
693            .join('');
694
695        return this._longDateFormat[key];
696    }
697
698    var defaultInvalidDate = 'Invalid date';
699
vendor: 8,300 bytes, lines 700-981
700    function invalidDate() {
701        return this._invalidDate;
702    }
703
704    var defaultOrdinal = '%d',
705        defaultDayOfMonthOrdinalParse = /\d{1,2}/;
706
707    function ordinal(number) {
708        return this._ordinal.replace('%d', number);
709    }
710
711    var defaultRelativeTime = {
712        future: 'in %s',
713        past: '%s ago',
714        s: 'a few seconds',
715        ss: '%d seconds',
716        m: 'a minute',
717        mm: '%d minutes',
718        h: 'an hour',
719        hh: '%d hours',
720        d: 'a day',
721        dd: '%d days',
722        w: 'a week',
723        ww: '%d weeks',
724        M: 'a month',
725        MM: '%d months',
726        y: 'a year',
727        yy: '%d years',
728    };
729
730    function relativeTime(number, withoutSuffix, string, isFuture) {
731        var output = this._relativeTime[string];
732        return isFunction(output)
733            ? output(number, withoutSuffix, string, isFuture)
734            : output.replace(/%d/i, number);
735    }
736
737    function pastFuture(diff, output) {
738        var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
739        return isFunction(format) ? format(output) : format.replace(/%s/i, output);
740    }
741
742    var aliases = {
743        D: 'date',
744        dates: 'date',
745        date: 'date',
746        d: 'day',
747        days: 'day',
748        day: 'day',
749        e: 'weekday',
750        weekdays: 'weekday',
751        weekday: 'weekday',
752        E: 'isoWeekday',
753        isoweekdays: 'isoWeekday',
754        isoweekday: 'isoWeekday',
755        DDD: 'dayOfYear',
756        dayofyears: 'dayOfYear',
757        dayofyear: 'dayOfYear',
758        h: 'hour',
759        hours: 'hour',
760        hour: 'hour',
761        ms: 'millisecond',
762        milliseconds: 'millisecond',
763        millisecond: 'millisecond',
764        m: 'minute',
765        minutes: 'minute',
766        minute: 'minute',
767        M: 'month',
768        months: 'month',
769        month: 'month',
770        Q: 'quarter',
771        quarters: 'quarter',
772        quarter: 'quarter',
773        s: 'second',
774        seconds: 'second',
775        second: 'second',
776        gg: 'weekYear',
777        weekyears: 'weekYear',
778        weekyear: 'weekYear',
779        GG: 'isoWeekYear',
780        isoweekyears: 'isoWeekYear',
781        isoweekyear: 'isoWeekYear',
782        w: 'week',
783        weeks: 'week',
784        week: 'week',
785        W: 'isoWeek',
786        isoweeks: 'isoWeek',
787        isoweek: 'isoWeek',
788        y: 'year',
789        years: 'year',
790        year: 'year',
791    };
792
793    function normalizeUnits(units) {
794        return typeof units === 'string'
795            ? aliases[units] || aliases[units.toLowerCase()]
796            : undefined;
797    }
798
799    function normalizeObjectUnits(inputObject) {
800        var normalizedInput = {},
801            normalizedProp,
802            prop;
803
804        for (prop in inputObject) {
805            if (hasOwnProp(inputObject, prop)) {
806                normalizedProp = normalizeUnits(prop);
807                if (normalizedProp) {
808                    normalizedInput[normalizedProp] = inputObject[prop];
809                }
810            }
811        }
812
813        return normalizedInput;
814    }
815
816    var priorities = {
817        date: 9,
818        day: 11,
819        weekday: 11,
820        isoWeekday: 11,
821        dayOfYear: 4,
822        hour: 13,
823        millisecond: 16,
824        minute: 14,
825        month: 8,
826        quarter: 7,
827        second: 15,
828        weekYear: 1,
829        isoWeekYear: 1,
830        week: 5,
831        isoWeek: 5,
832        year: 1,
833    };
834
835    function getPrioritizedUnits(unitsObj) {
836        var units = [],
837            u;
838        for (u in unitsObj) {
839            if (hasOwnProp(unitsObj, u)) {
840                units.push({ unit: u, priority: priorities[u] });
841            }
842        }
843        units.sort(function (a, b) {
844            return a.priority - b.priority;
845        });
846        return units;
847    }
848
849    var match1 = /\d/, //       0 - 9
850        match2 = /\d\d/, //      00 - 99
851        match3 = /\d{3}/, //     000 - 999
852        match4 = /\d{4}/, //    0000 - 9999
853        match6 = /[+-]?\d{6}/, // -999999 - 999999
854        match1to2 = /\d\d?/, //       0 - 99
855        match3to4 = /\d\d\d\d?/, //     999 - 9999
856        match5to6 = /\d\d\d\d\d\d?/, //   99999 - 999999
857        match1to3 = /\d{1,3}/, //       0 - 999
858        match1to4 = /\d{1,4}/, //       0 - 9999
859        match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999
860        matchUnsigned = /\d+/, //       0 - inf
861        matchSigned = /[+-]?\d+/, //    -inf - inf
862        matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
863        matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z
864        matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
865        // any word (or two) characters or numbers including two/three word month in arabic.
866        // includes scottish gaelic two word and hyphenated months
867        matchWord =
868            /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
869        match1to2NoLeadingZero = /^[1-9]\d?/, //         1-99
870        match1to2HasZero = /^([1-9]\d|\d)/, //           0-99
871        regexes;
872
873    regexes = {};
874
875    function addRegexToken(token, regex, strictRegex) {
876        regexes[token] = isFunction(regex)
877            ? regex
878            : function (isStrict, localeData) {
879                  return isStrict && strictRegex ? strictRegex : regex;
880              };
881    }
882
883    function getParseRegexForToken(token, config) {
884        if (!hasOwnProp(regexes, token)) {
885            return new RegExp(unescapeFormat(token));
886        }
887
888        return regexes[token](config._strict, config._locale);
889    }
890
891    // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
892    function unescapeFormat(s) {
893        return regexEscape(
894            s
895                .replace('\\', '')
896                .replace(
897                    /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
898                    function (matched, p1, p2, p3, p4) {
899                        return p1 || p2 || p3 || p4;
900                    }
901                )
902        );
903    }
904
905    function regexEscape(s) {
906        return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
907    }
908
909    function absFloor(number) {
910        if (number < 0) {
911            // -0 -> 0
912            return Math.ceil(number) || 0;
913        } else {
914            return Math.floor(number);
915        }
916    }
917
918    function toInt(argumentForCoercion) {
919        var coercedNumber = +argumentForCoercion,
920            value = 0;
921
922        if (coercedNumber !== 0 && isFinite(coercedNumber)) {
923            value = absFloor(coercedNumber);
924        }
925
926        return value;
927    }
928
929    var tokens = {};
930
931    function addParseToken(token, callback) {
932        var i,
933            func = callback,
934            tokenLen;
935        if (typeof token === 'string') {
936            token = [token];
937        }
938        if (isNumber(callback)) {
939            func = function (input, array) {
940                array[callback] = toInt(input);
941            };
942        }
943        tokenLen = token.length;
944        for (i = 0; i < tokenLen; i++) {
945            tokens[token[i]] = func;
946        }
947    }
948
949    function addWeekParseToken(token, callback) {
950        addParseToken(token, function (input, array, config, token) {
951            config._w = config._w || {};
952            callback(input, config._w, config, token);
953        });
954    }
955
956    function addTimeToArrayFromToken(token, input, config) {
957        if (input != null && hasOwnProp(tokens, token)) {
958            tokens[token](input, config._a, config, token);
959        }
960    }
961
962    function isLeapYear(year) {
963        return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
964    }
965
966    var YEAR = 0,
967        MONTH = 1,
968        DATE = 2,
969        HOUR = 3,
970        MINUTE = 4,
971        SECOND = 5,
972        MILLISECOND = 6,
973        WEEK = 7,
974        WEEKDAY = 8;
975
976    // FORMATTING
977
978    addFormatToken('Y', 0, 0, function () {
979        var y = this.year();
980        return y <= 9999 ? zeroFill(y, 4) : '+' + y;
981    });
vendor: 4,071 bytes, lines 982-1108
982
983    addFormatToken(0, ['YY', 2], 0, function () {
984        return this.year() % 100;
985    });
986
987    addFormatToken(0, ['YYYY', 4], 0, 'year');
988    addFormatToken(0, ['YYYYY', 5], 0, 'year');
989    addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
990
991    // PARSING
992
993    addRegexToken('Y', matchSigned);
994    addRegexToken('YY', match1to2, match2);
995    addRegexToken('YYYY', match1to4, match4);
996    addRegexToken('YYYYY', match1to6, match6);
997    addRegexToken('YYYYYY', match1to6, match6);
998
999    addParseToken(['YYYYY', 'YYYYYY'], YEAR);
1000    addParseToken('YYYY', function (input, array) {
1001        array[YEAR] =
1002            input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
1003    });
1004    addParseToken('YY', function (input, array) {
1005        array[YEAR] = hooks.parseTwoDigitYear(input);
1006    });
1007    addParseToken('Y', function (input, array) {
1008        array[YEAR] = parseInt(input, 10);
1009    });
1010
1011    // HELPERS
1012
1013    function daysInYear(year) {
1014        return isLeapYear(year) ? 366 : 365;
1015    }
1016
1017    // HOOKS
1018
1019    hooks.parseTwoDigitYear = function (input) {
1020        return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
1021    };
1022
1023    // MOMENTS
1024
1025    var getSetYear = makeGetSet('FullYear', true);
1026
1027    function getIsLeapYear() {
1028        return isLeapYear(this.year());
1029    }
1030
1031    function makeGetSet(unit, keepTime) {
1032        return function (value) {
1033            if (value != null) {
1034                set$1(this, unit, value);
1035                hooks.updateOffset(this, keepTime);
1036                return this;
1037            } else {
1038                return get(this, unit);
1039            }
1040        };
1041    }
1042
1043    function get(mom, unit) {
1044        if (!mom.isValid()) {
1045            return NaN;
1046        }
1047
1048        var d = mom._d,
1049            isUTC = mom._isUTC;
1050
1051        switch (unit) {
1052            case 'Milliseconds':
1053                return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
1054            case 'Seconds':
1055                return isUTC ? d.getUTCSeconds() : d.getSeconds();
1056            case 'Minutes':
1057                return isUTC ? d.getUTCMinutes() : d.getMinutes();
1058            case 'Hours':
1059                return isUTC ? d.getUTCHours() : d.getHours();
1060            case 'Date':
1061                return isUTC ? d.getUTCDate() : d.getDate();
1062            case 'Day':
1063                return isUTC ? d.getUTCDay() : d.getDay();
1064            case 'Month':
1065                return isUTC ? d.getUTCMonth() : d.getMonth();
1066            case 'FullYear':
1067                return isUTC ? d.getUTCFullYear() : d.getFullYear();
1068            default:
1069                return NaN; // Just in case
1070        }
1071    }
1072
1073    function set$1(mom, unit, value) {
1074        var d, isUTC, year, month, date;
1075
1076        if (!mom.isValid() || isNaN(value)) {
1077            return;
1078        }
1079
1080        d = mom._d;
1081        isUTC = mom._isUTC;
1082
1083        switch (unit) {
1084            case 'Milliseconds':
1085                return void (isUTC
1086                    ? d.setUTCMilliseconds(value)
1087                    : d.setMilliseconds(value));
1088            case 'Seconds':
1089                return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
1090            case 'Minutes':
1091                return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
1092            case 'Hours':
1093                return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
1094            case 'Date':
1095                return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
1096            // case 'Day': // Not real
1097            //    return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
1098            // case 'Month': // Not used because we need to pass two variables
1099            //     return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));
1100            case 'FullYear':
1101                break; // See below ...
1102            default:
1103                return; // Just in case
1104        }
1105
1106        year = value;
1107        month = mom.month();
1108        date = mom.date();
vendor: 4,442 bytes, lines 1109-1253
1109        date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
1110        void (isUTC
1111            ? d.setUTCFullYear(year, month, date)
1112            : d.setFullYear(year, month, date));
1113    }
1114
1115    // MOMENTS
1116
1117    function stringGet(units) {
1118        units = normalizeUnits(units);
1119        if (isFunction(this[units])) {
1120            return this[units]();
1121        }
1122        return this;
1123    }
1124
1125    function stringSet(units, value) {
1126        if (typeof units === 'object') {
1127            units = normalizeObjectUnits(units);
1128            var prioritized = getPrioritizedUnits(units),
1129                i,
1130                prioritizedLen = prioritized.length;
1131            for (i = 0; i < prioritizedLen; i++) {
1132                this[prioritized[i].unit](units[prioritized[i].unit]);
1133            }
1134        } else {
1135            units = normalizeUnits(units);
1136            if (isFunction(this[units])) {
1137                return this[units](value);
1138            }
1139        }
1140        return this;
1141    }
1142
1143    function mod(n, x) {
1144        return ((n % x) + x) % x;
1145    }
1146
1147    var indexOf;
1148
1149    if (Array.prototype.indexOf) {
1150        indexOf = Array.prototype.indexOf;
1151    } else {
1152        indexOf = function (o) {
1153            // I know
1154            var i;
1155            for (i = 0; i < this.length; ++i) {
1156                if (this[i] === o) {
1157                    return i;
1158                }
1159            }
1160            return -1;
1161        };
1162    }
1163
1164    function daysInMonth(year, month) {
1165        if (isNaN(year) || isNaN(month)) {
1166            return NaN;
1167        }
1168        var modMonth = mod(month, 12);
1169        year += (month - modMonth) / 12;
1170        return modMonth === 1
1171            ? isLeapYear(year)
1172                ? 29
1173                : 28
1174            : 31 - ((modMonth % 7) % 2);
1175    }
1176
1177    // FORMATTING
1178
1179    addFormatToken('M', ['MM', 2], 'Mo', function () {
1180        return this.month() + 1;
1181    });
1182
1183    addFormatToken('MMM', 0, 0, function (format) {
1184        return this.localeData().monthsShort(this, format);
1185    });
1186
1187    addFormatToken('MMMM', 0, 0, function (format) {
1188        return this.localeData().months(this, format);
1189    });
1190
1191    // PARSING
1192
1193    addRegexToken('M', match1to2, match1to2NoLeadingZero);
1194    addRegexToken('MM', match1to2, match2);
1195    addRegexToken('MMM', function (isStrict, locale) {
1196        return locale.monthsShortRegex(isStrict);
1197    });
1198    addRegexToken('MMMM', function (isStrict, locale) {
1199        return locale.monthsRegex(isStrict);
1200    });
1201
1202    addParseToken(['M', 'MM'], function (input, array) {
1203        array[MONTH] = toInt(input) - 1;
1204    });
1205
1206    addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
1207        var month = config._locale.monthsParse(input, token, config._strict);
1208        // if we didn't find a month name, mark the date as invalid.
1209        if (month != null) {
1210            array[MONTH] = month;
1211        } else {
1212            getParsingFlags(config).invalidMonth = input;
1213        }
1214    });
1215
1216    // LOCALES
1217
1218    var defaultLocaleMonths =
1219            'January_February_March_April_May_June_July_August_September_October_November_December'.split(
1220                '_'
1221            ),
1222        defaultLocaleMonthsShort =
1223            'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
1224        MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
1225        defaultMonthsShortRegex = matchWord,
1226        defaultMonthsRegex = matchWord;
1227
1228    function localeMonths(m, format) {
1229        if (!m) {
1230            return isArray(this._months)
1231                ? this._months
1232                : this._months['standalone'];
1233        }
1234        return isArray(this._months)
1235            ? this._months[m.month()]
1236            : this._months[
1237                  (this._months.isFormat || MONTHS_IN_FORMAT).test(format)
1238                      ? 'format'
1239                      : 'standalone'
1240              ][m.month()];
1241    }
1242
1243    function localeMonthsShort(m, format) {
1244        if (!m) {
1245            return isArray(this._monthsShort)
1246                ? this._monthsShort
1247                : this._monthsShort['standalone'];
1248        }
1249        return isArray(this._monthsShort)
1250            ? this._monthsShort[m.month()]
1251            : this._monthsShort[
1252                  MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'
1253              ][m.month()];
vendor: 4,090 bytes, lines 1254-1375
1254    }
1255
1256    function handleStrictParse(monthName, format, strict) {
1257        var i,
1258            ii,
1259            mom,
1260            llc = monthName.toLocaleLowerCase();
1261        if (!this._monthsParse) {
1262            // this is not used
1263            this._monthsParse = [];
1264            this._longMonthsParse = [];
1265            this._shortMonthsParse = [];
1266            for (i = 0; i < 12; ++i) {
1267                mom = createUTC([2000, i]);
1268                this._shortMonthsParse[i] = this.monthsShort(
1269                    mom,
1270                    ''
1271                ).toLocaleLowerCase();
1272                this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
1273            }
1274        }
1275
1276        if (strict) {
1277            if (format === 'MMM') {
1278                ii = indexOf.call(this._shortMonthsParse, llc);
1279                return ii !== -1 ? ii : null;
1280            } else {
1281                ii = indexOf.call(this._longMonthsParse, llc);
1282                return ii !== -1 ? ii : null;
1283            }
1284        } else {
1285            if (format === 'MMM') {
1286                ii = indexOf.call(this._shortMonthsParse, llc);
1287                if (ii !== -1) {
1288                    return ii;
1289                }
1290                ii = indexOf.call(this._longMonthsParse, llc);
1291                return ii !== -1 ? ii : null;
1292            } else {
1293                ii = indexOf.call(this._longMonthsParse, llc);
1294                if (ii !== -1) {
1295                    return ii;
1296                }
1297                ii = indexOf.call(this._shortMonthsParse, llc);
1298                return ii !== -1 ? ii : null;
1299            }
1300        }
1301    }
1302
1303    function localeMonthsParse(monthName, format, strict) {
1304        var i, mom, regex;
1305
1306        if (this._monthsParseExact) {
1307            return handleStrictParse.call(this, monthName, format, strict);
1308        }
1309
1310        if (!this._monthsParse) {
1311            this._monthsParse = [];
1312            this._longMonthsParse = [];
1313            this._shortMonthsParse = [];
1314        }
1315
1316        // TODO: add sorting
1317        // Sorting makes sure if one month (or abbr) is a prefix of another
1318        // see sorting in computeMonthsParse
1319        for (i = 0; i < 12; i++) {
1320            // make the regex if we don't have it already
1321            mom = createUTC([2000, i]);
1322            if (strict && !this._longMonthsParse[i]) {
1323                this._longMonthsParse[i] = new RegExp(
1324                    '^' + this.months(mom, '').replace('.', '') + '$',
1325                    'i'
1326                );
1327                this._shortMonthsParse[i] = new RegExp(
1328                    '^' + this.monthsShort(mom, '').replace('.', '') + '$',
1329                    'i'
1330                );
1331            }
1332            if (!strict && !this._monthsParse[i]) {
1333                regex =
1334                    '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
1335                this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
1336            }
1337            // test the regex
1338            if (
1339                strict &&
1340                format === 'MMMM' &&
1341                this._longMonthsParse[i].test(monthName)
1342            ) {
1343                return i;
1344            } else if (
1345                strict &&
1346                format === 'MMM' &&
1347                this._shortMonthsParse[i].test(monthName)
1348            ) {
1349                return i;
1350            } else if (!strict && this._monthsParse[i].test(monthName)) {
1351                return i;
1352            }
1353        }
1354    }
1355
1356    // MOMENTS
1357
1358    function setMonth(mom, value) {
1359        if (!mom.isValid()) {
1360            // No op
1361            return mom;
1362        }
1363
1364        if (typeof value === 'string') {
1365            if (/^\d+$/.test(value)) {
1366                value = toInt(value);
1367            } else {
1368                value = mom.localeData().monthsParse(value);
1369                // TODO: Another silent failure?
1370                if (!isNumber(value)) {
1371                    return mom;
1372                }
1373            }
1374        }
1375
vendor: 4,275 bytes, lines 1376-1504
1376        var month = value,
1377            date = mom.date();
1378
1379        date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
1380        void (mom._isUTC
1381            ? mom._d.setUTCMonth(month, date)
1382            : mom._d.setMonth(month, date));
1383        return mom;
1384    }
1385
1386    function getSetMonth(value) {
1387        if (value != null) {
1388            setMonth(this, value);
1389            hooks.updateOffset(this, true);
1390            return this;
1391        } else {
1392            return get(this, 'Month');
1393        }
1394    }
1395
1396    function getDaysInMonth() {
1397        return daysInMonth(this.year(), this.month());
1398    }
1399
1400    function monthsShortRegex(isStrict) {
1401        if (this._monthsParseExact) {
1402            if (!hasOwnProp(this, '_monthsRegex')) {
1403                computeMonthsParse.call(this);
1404            }
1405            if (isStrict) {
1406                return this._monthsShortStrictRegex;
1407            } else {
1408                return this._monthsShortRegex;
1409            }
1410        } else {
1411            if (!hasOwnProp(this, '_monthsShortRegex')) {
1412                this._monthsShortRegex = defaultMonthsShortRegex;
1413            }
1414            return this._monthsShortStrictRegex && isStrict
1415                ? this._monthsShortStrictRegex
1416                : this._monthsShortRegex;
1417        }
1418    }
1419
1420    function monthsRegex(isStrict) {
1421        if (this._monthsParseExact) {
1422            if (!hasOwnProp(this, '_monthsRegex')) {
1423                computeMonthsParse.call(this);
1424            }
1425            if (isStrict) {
1426                return this._monthsStrictRegex;
1427            } else {
1428                return this._monthsRegex;
1429            }
1430        } else {
1431            if (!hasOwnProp(this, '_monthsRegex')) {
1432                this._monthsRegex = defaultMonthsRegex;
1433            }
1434            return this._monthsStrictRegex && isStrict
1435                ? this._monthsStrictRegex
1436                : this._monthsRegex;
1437        }
1438    }
1439
1440    function computeMonthsParse() {
1441        function cmpLenRev(a, b) {
1442            return b.length - a.length;
1443        }
1444
1445        var shortPieces = [],
1446            longPieces = [],
1447            mixedPieces = [],
1448            i,
1449            mom,
1450            shortP,
1451            longP;
1452        for (i = 0; i < 12; i++) {
1453            // make the regex if we don't have it already
1454            mom = createUTC([2000, i]);
1455            shortP = regexEscape(this.monthsShort(mom, ''));
1456            longP = regexEscape(this.months(mom, ''));
1457            shortPieces.push(shortP);
1458            longPieces.push(longP);
1459            mixedPieces.push(longP);
1460            mixedPieces.push(shortP);
1461        }
1462        // Sorting makes sure if one month (or abbr) is a prefix of another it
1463        // will match the longer piece.
1464        shortPieces.sort(cmpLenRev);
1465        longPieces.sort(cmpLenRev);
1466        mixedPieces.sort(cmpLenRev);
1467
1468        this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
1469        this._monthsShortRegex = this._monthsRegex;
1470        this._monthsStrictRegex = new RegExp(
1471            '^(' + longPieces.join('|') + ')',
1472            'i'
1473        );
1474        this._monthsShortStrictRegex = new RegExp(
1475            '^(' + shortPieces.join('|') + ')',
1476            'i'
1477        );
1478    }
1479
1480    function createDate(y, m, d, h, M, s, ms) {
1481        // can't just apply() to create a date:
1482        // https://stackoverflow.com/q/181348
1483        var date;
1484        // the date constructor remaps years 0-99 to 1900-1999
1485        if (y < 100 && y >= 0) {
1486            // preserve leap years using a full 400 year cycle, then reset
1487            date = new Date(y + 400, m, d, h, M, s, ms);
1488            if (isFinite(date.getFullYear())) {
1489                date.setFullYear(y);
1490            }
1491        } else {
1492            date = new Date(y, m, d, h, M, s, ms);
1493        }
1494
1495        return date;
1496    }
1497
1498    function createUTCDate(y) {
1499        var date, args;
1500        // the Date.UTC function remaps years 0-99 to 1900-1999
1501        if (y < 100 && y >= 0) {
1502            args = Array.prototype.slice.call(arguments);
1503            // preserve leap years using a full 400 year cycle, then reset
1504            args[0] = y + 400;
vendor: 10,872 bytes, lines 1505-1840
1505            date = new Date(Date.UTC.apply(null, args));
1506            if (isFinite(date.getUTCFullYear())) {
1507                date.setUTCFullYear(y);
1508            }
1509        } else {
1510            date = new Date(Date.UTC.apply(null, arguments));
1511        }
1512
1513        return date;
1514    }
1515
1516    // start-of-first-week - start-of-year
1517    function firstWeekOffset(year, dow, doy) {
1518        var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
1519            fwd = 7 + dow - doy,
1520            // first-week day local weekday -- which local weekday is fwd
1521            fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
1522
1523        return -fwdlw + fwd - 1;
1524    }
1525
1526    // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
1527    function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
1528        var localWeekday = (7 + weekday - dow) % 7,
1529            weekOffset = firstWeekOffset(year, dow, doy),
1530            dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
1531            resYear,
1532            resDayOfYear;
1533
1534        if (dayOfYear <= 0) {
1535            resYear = year - 1;
1536            resDayOfYear = daysInYear(resYear) + dayOfYear;
1537        } else if (dayOfYear > daysInYear(year)) {
1538            resYear = year + 1;
1539            resDayOfYear = dayOfYear - daysInYear(year);
1540        } else {
1541            resYear = year;
1542            resDayOfYear = dayOfYear;
1543        }
1544
1545        return {
1546            year: resYear,
1547            dayOfYear: resDayOfYear,
1548        };
1549    }
1550
1551    function weekOfYear(mom, dow, doy) {
1552        var weekOffset = firstWeekOffset(mom.year(), dow, doy),
1553            week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
1554            resWeek,
1555            resYear;
1556
1557        if (week < 1) {
1558            resYear = mom.year() - 1;
1559            resWeek = week + weeksInYear(resYear, dow, doy);
1560        } else if (week > weeksInYear(mom.year(), dow, doy)) {
1561            resWeek = week - weeksInYear(mom.year(), dow, doy);
1562            resYear = mom.year() + 1;
1563        } else {
1564            resYear = mom.year();
1565            resWeek = week;
1566        }
1567
1568        return {
1569            week: resWeek,
1570            year: resYear,
1571        };
1572    }
1573
1574    function weeksInYear(year, dow, doy) {
1575        var weekOffset = firstWeekOffset(year, dow, doy),
1576            weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
1577        return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
1578    }
1579
1580    // FORMATTING
1581
1582    addFormatToken('w', ['ww', 2], 'wo', 'week');
1583    addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
1584
1585    // PARSING
1586
1587    addRegexToken('w', match1to2, match1to2NoLeadingZero);
1588    addRegexToken('ww', match1to2, match2);
1589    addRegexToken('W', match1to2, match1to2NoLeadingZero);
1590    addRegexToken('WW', match1to2, match2);
1591
1592    addWeekParseToken(
1593        ['w', 'ww', 'W', 'WW'],
1594        function (input, week, config, token) {
1595            week[token.substr(0, 1)] = toInt(input);
1596        }
1597    );
1598
1599    // HELPERS
1600
1601    // LOCALES
1602
1603    function localeWeek(mom) {
1604        return weekOfYear(mom, this._week.dow, this._week.doy).week;
1605    }
1606
1607    var defaultLocaleWeek = {
1608        dow: 0, // Sunday is the first day of the week.
1609        doy: 6, // The week that contains Jan 6th is the first week of the year.
1610    };
1611
1612    function localeFirstDayOfWeek() {
1613        return this._week.dow;
1614    }
1615
1616    function localeFirstDayOfYear() {
1617        return this._week.doy;
1618    }
1619
1620    // MOMENTS
1621
1622    function getSetWeek(input) {
1623        var week = this.localeData().week(this);
1624        return input == null ? week : this.add((input - week) * 7, 'd');
1625    }
1626
1627    function getSetISOWeek(input) {
1628        var week = weekOfYear(this, 1, 4).week;
1629        return input == null ? week : this.add((input - week) * 7, 'd');
1630    }
1631
1632    // FORMATTING
1633
1634    addFormatToken('d', 0, 'do', 'day');
1635
1636    addFormatToken('dd', 0, 0, function (format) {
1637        return this.localeData().weekdaysMin(this, format);
1638    });
1639
1640    addFormatToken('ddd', 0, 0, function (format) {
1641        return this.localeData().weekdaysShort(this, format);
1642    });
1643
1644    addFormatToken('dddd', 0, 0, function (format) {
1645        return this.localeData().weekdays(this, format);
1646    });
1647
1648    addFormatToken('e', 0, 0, 'weekday');
1649    addFormatToken('E', 0, 0, 'isoWeekday');
1650
1651    // PARSING
1652
1653    addRegexToken('d', match1to2);
1654    addRegexToken('e', match1to2);
1655    addRegexToken('E', match1to2);
1656    addRegexToken('dd', function (isStrict, locale) {
1657        return locale.weekdaysMinRegex(isStrict);
1658    });
1659    addRegexToken('ddd', function (isStrict, locale) {
1660        return locale.weekdaysShortRegex(isStrict);
1661    });
1662    addRegexToken('dddd', function (isStrict, locale) {
1663        return locale.weekdaysRegex(isStrict);
1664    });
1665
1666    addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
1667        var weekday = config._locale.weekdaysParse(input, token, config._strict);
1668        // if we didn't get a weekday name, mark the date as invalid
1669        if (weekday != null) {
1670            week.d = weekday;
1671        } else {
1672            getParsingFlags(config).invalidWeekday = input;
1673        }
1674    });
1675
1676    addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
1677        week[token] = toInt(input);
1678    });
1679
1680    // HELPERS
1681
1682    function parseWeekday(input, locale) {
1683        if (typeof input !== 'string') {
1684            return input;
1685        }
1686
1687        if (!isNaN(input)) {
1688            return parseInt(input, 10);
1689        }
1690
1691        input = locale.weekdaysParse(input);
1692        if (typeof input === 'number') {
1693            return input;
1694        }
1695
1696        return null;
1697    }
1698
1699    function parseIsoWeekday(input, locale) {
1700        if (typeof input === 'string') {
1701            return locale.weekdaysParse(input) % 7 || 7;
1702        }
1703        return isNaN(input) ? null : input;
1704    }
1705
1706    // LOCALES
1707    function shiftWeekdays(ws, n) {
1708        return ws.slice(n, 7).concat(ws.slice(0, n));
1709    }
1710
1711    var defaultLocaleWeekdays =
1712            'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
1713        defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
1714        defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
1715        defaultWeekdaysRegex = matchWord,
1716        defaultWeekdaysShortRegex = matchWord,
1717        defaultWeekdaysMinRegex = matchWord;
1718
1719    function localeWeekdays(m, format) {
1720        var weekdays = isArray(this._weekdays)
1721            ? this._weekdays
1722            : this._weekdays[
1723                  m && m !== true && this._weekdays.isFormat.test(format)
1724                      ? 'format'
1725                      : 'standalone'
1726              ];
1727        return m === true
1728            ? shiftWeekdays(weekdays, this._week.dow)
1729            : m
1730              ? weekdays[m.day()]
1731              : weekdays;
1732    }
1733
1734    function localeWeekdaysShort(m) {
1735        return m === true
1736            ? shiftWeekdays(this._weekdaysShort, this._week.dow)
1737            : m
1738              ? this._weekdaysShort[m.day()]
1739              : this._weekdaysShort;
1740    }
1741
1742    function localeWeekdaysMin(m) {
1743        return m === true
1744            ? shiftWeekdays(this._weekdaysMin, this._week.dow)
1745            : m
1746              ? this._weekdaysMin[m.day()]
1747              : this._weekdaysMin;
1748    }
1749
1750    function handleStrictParse$1(weekdayName, format, strict) {
1751        var i,
1752            ii,
1753            mom,
1754            llc = weekdayName.toLocaleLowerCase();
1755        if (!this._weekdaysParse) {
1756            this._weekdaysParse = [];
1757            this._shortWeekdaysParse = [];
1758            this._minWeekdaysParse = [];
1759
1760            for (i = 0; i < 7; ++i) {
1761                mom = createUTC([2000, 1]).day(i);
1762                this._minWeekdaysParse[i] = this.weekdaysMin(
1763                    mom,
1764                    ''
1765                ).toLocaleLowerCase();
1766                this._shortWeekdaysParse[i] = this.weekdaysShort(
1767                    mom,
1768                    ''
1769                ).toLocaleLowerCase();
1770                this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
1771            }
1772        }
1773
1774        if (strict) {
1775            if (format === 'dddd') {
1776                ii = indexOf.call(this._weekdaysParse, llc);
1777                return ii !== -1 ? ii : null;
1778            } else if (format === 'ddd') {
1779                ii = indexOf.call(this._shortWeekdaysParse, llc);
1780                return ii !== -1 ? ii : null;
1781            } else {
1782                ii = indexOf.call(this._minWeekdaysParse, llc);
1783                return ii !== -1 ? ii : null;
1784            }
1785        } else {
1786            if (format === 'dddd') {
1787                ii = indexOf.call(this._weekdaysParse, llc);
1788                if (ii !== -1) {
1789                    return ii;
1790                }
1791                ii = indexOf.call(this._shortWeekdaysParse, llc);
1792                if (ii !== -1) {
1793                    return ii;
1794                }
1795                ii = indexOf.call(this._minWeekdaysParse, llc);
1796                return ii !== -1 ? ii : null;
1797            } else if (format === 'ddd') {
1798                ii = indexOf.call(this._shortWeekdaysParse, llc);
1799                if (ii !== -1) {
1800                    return ii;
1801                }
1802                ii = indexOf.call(this._weekdaysParse, llc);
1803                if (ii !== -1) {
1804                    return ii;
1805                }
1806                ii = indexOf.call(this._minWeekdaysParse, llc);
1807                return ii !== -1 ? ii : null;
1808            } else {
1809                ii = indexOf.call(this._minWeekdaysParse, llc);
1810                if (ii !== -1) {
1811                    return ii;
1812                }
1813                ii = indexOf.call(this._weekdaysParse, llc);
1814                if (ii !== -1) {
1815                    return ii;
1816                }
1817                ii = indexOf.call(this._shortWeekdaysParse, llc);
1818                return ii !== -1 ? ii : null;
1819            }
1820        }
1821    }
1822
1823    function localeWeekdaysParse(weekdayName, format, strict) {
1824        var i, mom, regex;
1825
1826        if (this._weekdaysParseExact) {
1827            return handleStrictParse$1.call(this, weekdayName, format, strict);
1828        }
1829
1830        if (!this._weekdaysParse) {
1831            this._weekdaysParse = [];
1832            this._minWeekdaysParse = [];
1833            this._shortWeekdaysParse = [];
1834            this._fullWeekdaysParse = [];
1835        }
1836
1837        for (i = 0; i < 7; i++) {
1838            // make the regex if we don't have it already
1839
1840            mom = createUTC([2000, 1]).day(i);
vendor: 10,043 bytes, lines 1841-2142
1841            if (strict && !this._fullWeekdaysParse[i]) {
1842                this._fullWeekdaysParse[i] = new RegExp(
1843                    '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$',
1844                    'i'
1845                );
1846                this._shortWeekdaysParse[i] = new RegExp(
1847                    '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$',
1848                    'i'
1849                );
1850                this._minWeekdaysParse[i] = new RegExp(
1851                    '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$',
1852                    'i'
1853                );
1854            }
1855            if (!this._weekdaysParse[i]) {
1856                regex =
1857                    '^' +
1858                    this.weekdays(mom, '') +
1859                    '|^' +
1860                    this.weekdaysShort(mom, '') +
1861                    '|^' +
1862                    this.weekdaysMin(mom, '');
1863                this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
1864            }
1865            // test the regex
1866            if (
1867                strict &&
1868                format === 'dddd' &&
1869                this._fullWeekdaysParse[i].test(weekdayName)
1870            ) {
1871                return i;
1872            } else if (
1873                strict &&
1874                format === 'ddd' &&
1875                this._shortWeekdaysParse[i].test(weekdayName)
1876            ) {
1877                return i;
1878            } else if (
1879                strict &&
1880                format === 'dd' &&
1881                this._minWeekdaysParse[i].test(weekdayName)
1882            ) {
1883                return i;
1884            } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
1885                return i;
1886            }
1887        }
1888    }
1889
1890    // MOMENTS
1891
1892    function getSetDayOfWeek(input) {
1893        if (!this.isValid()) {
1894            return input != null ? this : NaN;
1895        }
1896
1897        var day = get(this, 'Day');
1898        if (input != null) {
1899            input = parseWeekday(input, this.localeData());
1900            return this.add(input - day, 'd');
1901        } else {
1902            return day;
1903        }
1904    }
1905
1906    function getSetLocaleDayOfWeek(input) {
1907        if (!this.isValid()) {
1908            return input != null ? this : NaN;
1909        }
1910        var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
1911        return input == null ? weekday : this.add(input - weekday, 'd');
1912    }
1913
1914    function getSetISODayOfWeek(input) {
1915        if (!this.isValid()) {
1916            return input != null ? this : NaN;
1917        }
1918
1919        // behaves the same as moment#day except
1920        // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
1921        // as a setter, sunday should belong to the previous week.
1922
1923        if (input != null) {
1924            var weekday = parseIsoWeekday(input, this.localeData());
1925            return this.day(this.day() % 7 ? weekday : weekday - 7);
1926        } else {
1927            return this.day() || 7;
1928        }
1929    }
1930
1931    function weekdaysRegex(isStrict) {
1932        if (this._weekdaysParseExact) {
1933            if (!hasOwnProp(this, '_weekdaysRegex')) {
1934                computeWeekdaysParse.call(this);
1935            }
1936            if (isStrict) {
1937                return this._weekdaysStrictRegex;
1938            } else {
1939                return this._weekdaysRegex;
1940            }
1941        } else {
1942            if (!hasOwnProp(this, '_weekdaysRegex')) {
1943                this._weekdaysRegex = defaultWeekdaysRegex;
1944            }
1945            return this._weekdaysStrictRegex && isStrict
1946                ? this._weekdaysStrictRegex
1947                : this._weekdaysRegex;
1948        }
1949    }
1950
1951    function weekdaysShortRegex(isStrict) {
1952        if (this._weekdaysParseExact) {
1953            if (!hasOwnProp(this, '_weekdaysRegex')) {
1954                computeWeekdaysParse.call(this);
1955            }
1956            if (isStrict) {
1957                return this._weekdaysShortStrictRegex;
1958            } else {
1959                return this._weekdaysShortRegex;
1960            }
1961        } else {
1962            if (!hasOwnProp(this, '_weekdaysShortRegex')) {
1963                this._weekdaysShortRegex = defaultWeekdaysShortRegex;
1964            }
1965            return this._weekdaysShortStrictRegex && isStrict
1966                ? this._weekdaysShortStrictRegex
1967                : this._weekdaysShortRegex;
1968        }
1969    }
1970
1971    function weekdaysMinRegex(isStrict) {
1972        if (this._weekdaysParseExact) {
1973            if (!hasOwnProp(this, '_weekdaysRegex')) {
1974                computeWeekdaysParse.call(this);
1975            }
1976            if (isStrict) {
1977                return this._weekdaysMinStrictRegex;
1978            } else {
1979                return this._weekdaysMinRegex;
1980            }
1981        } else {
1982            if (!hasOwnProp(this, '_weekdaysMinRegex')) {
1983                this._weekdaysMinRegex = defaultWeekdaysMinRegex;
1984            }
1985            return this._weekdaysMinStrictRegex && isStrict
1986                ? this._weekdaysMinStrictRegex
1987                : this._weekdaysMinRegex;
1988        }
1989    }
1990
1991    function computeWeekdaysParse() {
1992        function cmpLenRev(a, b) {
1993            return b.length - a.length;
1994        }
1995
1996        var minPieces = [],
1997            shortPieces = [],
1998            longPieces = [],
1999            mixedPieces = [],
2000            i,
2001            mom,
2002            minp,
2003            shortp,
2004            longp;
2005        for (i = 0; i < 7; i++) {
2006            // make the regex if we don't have it already
2007            mom = createUTC([2000, 1]).day(i);
2008            minp = regexEscape(this.weekdaysMin(mom, ''));
2009            shortp = regexEscape(this.weekdaysShort(mom, ''));
2010            longp = regexEscape(this.weekdays(mom, ''));
2011            minPieces.push(minp);
2012            shortPieces.push(shortp);
2013            longPieces.push(longp);
2014            mixedPieces.push(minp);
2015            mixedPieces.push(shortp);
2016            mixedPieces.push(longp);
2017        }
2018        // Sorting makes sure if one weekday (or abbr) is a prefix of another it
2019        // will match the longer piece.
2020        minPieces.sort(cmpLenRev);
2021        shortPieces.sort(cmpLenRev);
2022        longPieces.sort(cmpLenRev);
2023        mixedPieces.sort(cmpLenRev);
2024
2025        this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
2026        this._weekdaysShortRegex = this._weekdaysRegex;
2027        this._weekdaysMinRegex = this._weekdaysRegex;
2028
2029        this._weekdaysStrictRegex = new RegExp(
2030            '^(' + longPieces.join('|') + ')',
2031            'i'
2032        );
2033        this._weekdaysShortStrictRegex = new RegExp(
2034            '^(' + shortPieces.join('|') + ')',
2035            'i'
2036        );
2037        this._weekdaysMinStrictRegex = new RegExp(
2038            '^(' + minPieces.join('|') + ')',
2039            'i'
2040        );
2041    }
2042
2043    // FORMATTING
2044
2045    function hFormat() {
2046        return this.hours() % 12 || 12;
2047    }
2048
2049    function kFormat() {
2050        return this.hours() || 24;
2051    }
2052
2053    addFormatToken('H', ['HH', 2], 0, 'hour');
2054    addFormatToken('h', ['hh', 2], 0, hFormat);
2055    addFormatToken('k', ['kk', 2], 0, kFormat);
2056
2057    addFormatToken('hmm', 0, 0, function () {
2058        return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
2059    });
2060
2061    addFormatToken('hmmss', 0, 0, function () {
2062        return (
2063            '' +
2064            hFormat.apply(this) +
2065            zeroFill(this.minutes(), 2) +
2066            zeroFill(this.seconds(), 2)
2067        );
2068    });
2069
2070    addFormatToken('Hmm', 0, 0, function () {
2071        return '' + this.hours() + zeroFill(this.minutes(), 2);
2072    });
2073
2074    addFormatToken('Hmmss', 0, 0, function () {
2075        return (
2076            '' +
2077            this.hours() +
2078            zeroFill(this.minutes(), 2) +
2079            zeroFill(this.seconds(), 2)
2080        );
2081    });
2082
2083    function meridiem(token, lowercase) {
2084        addFormatToken(token, 0, 0, function () {
2085            return this.localeData().meridiem(
2086                this.hours(),
2087                this.minutes(),
2088                lowercase
2089            );
2090        });
2091    }
2092
2093    meridiem('a', true);
2094    meridiem('A', false);
2095
2096    // PARSING
2097
2098    function matchMeridiem(isStrict, locale) {
2099        return locale._meridiemParse;
2100    }
2101
2102    addRegexToken('a', matchMeridiem);
2103    addRegexToken('A', matchMeridiem);
2104    addRegexToken('H', match1to2, match1to2HasZero);
2105    addRegexToken('h', match1to2, match1to2NoLeadingZero);
2106    addRegexToken('k', match1to2, match1to2NoLeadingZero);
2107    addRegexToken('HH', match1to2, match2);
2108    addRegexToken('hh', match1to2, match2);
2109    addRegexToken('kk', match1to2, match2);
2110
2111    addRegexToken('hmm', match3to4);
2112    addRegexToken('hmmss', match5to6);
2113    addRegexToken('Hmm', match3to4);
2114    addRegexToken('Hmmss', match5to6);
2115
2116    addParseToken(['H', 'HH'], HOUR);
2117    addParseToken(['k', 'kk'], function (input, array, config) {
2118        var kInput = toInt(input);
2119        array[HOUR] = kInput === 24 ? 0 : kInput;
2120    });
2121    addParseToken(['a', 'A'], function (input, array, config) {
2122        config._isPm = config._locale.isPM(input);
2123        config._meridiem = input;
2124    });
2125    addParseToken(['h', 'hh'], function (input, array, config) {
2126        array[HOUR] = toInt(input);
2127        getParsingFlags(config).bigHour = true;
2128    });
2129    addParseToken('hmm', function (input, array, config) {
2130        var pos = input.length - 2;
2131        array[HOUR] = toInt(input.substr(0, pos));
2132        array[MINUTE] = toInt(input.substr(pos));
2133        getParsingFlags(config).bigHour = true;
2134    });
2135    addParseToken('hmmss', function (input, array, config) {
2136        var pos1 = input.length - 4,
2137            pos2 = input.length - 2;
2138        array[HOUR] = toInt(input.substr(0, pos1));
2139        array[MINUTE] = toInt(input.substr(pos1, 2));
2140        array[SECOND] = toInt(input.substr(pos2));
2141        getParsingFlags(config).bigHour = true;
2142    });
vendor: 14,235 bytes, lines 2143-2526
2143    addParseToken('Hmm', function (input, array, config) {
2144        var pos = input.length - 2;
2145        array[HOUR] = toInt(input.substr(0, pos));
2146        array[MINUTE] = toInt(input.substr(pos));
2147    });
2148    addParseToken('Hmmss', function (input, array, config) {
2149        var pos1 = input.length - 4,
2150            pos2 = input.length - 2;
2151        array[HOUR] = toInt(input.substr(0, pos1));
2152        array[MINUTE] = toInt(input.substr(pos1, 2));
2153        array[SECOND] = toInt(input.substr(pos2));
2154    });
2155
2156    // LOCALES
2157
2158    function localeIsPM(input) {
2159        // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
2160        // Using charAt should be more compatible.
2161        return (input + '').toLowerCase().charAt(0) === 'p';
2162    }
2163
2164    var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i,
2165        // Setting the hour should keep the time, because the user explicitly
2166        // specified which hour they want. So trying to maintain the same hour (in
2167        // a new timezone) makes sense. Adding/subtracting hours does not follow
2168        // this rule.
2169        getSetHour = makeGetSet('Hours', true);
2170
2171    function localeMeridiem(hours, minutes, isLower) {
2172        if (hours > 11) {
2173            return isLower ? 'pm' : 'PM';
2174        } else {
2175            return isLower ? 'am' : 'AM';
2176        }
2177    }
2178
2179    var baseConfig = {
2180        calendar: defaultCalendar,
2181        longDateFormat: defaultLongDateFormat,
2182        invalidDate: defaultInvalidDate,
2183        ordinal: defaultOrdinal,
2184        dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
2185        relativeTime: defaultRelativeTime,
2186
2187        months: defaultLocaleMonths,
2188        monthsShort: defaultLocaleMonthsShort,
2189
2190        week: defaultLocaleWeek,
2191
2192        weekdays: defaultLocaleWeekdays,
2193        weekdaysMin: defaultLocaleWeekdaysMin,
2194        weekdaysShort: defaultLocaleWeekdaysShort,
2195
2196        meridiemParse: defaultLocaleMeridiemParse,
2197    };
2198
2199    // internal storage for locale config files
2200    var locales = {},
2201        localeFamilies = {},
2202        globalLocale;
2203
2204    function commonPrefix(arr1, arr2) {
2205        var i,
2206            minl = Math.min(arr1.length, arr2.length);
2207        for (i = 0; i < minl; i += 1) {
2208            if (arr1[i] !== arr2[i]) {
2209                return i;
2210            }
2211        }
2212        return minl;
2213    }
2214
2215    function normalizeLocale(key) {
2216        return key ? key.toLowerCase().replace('_', '-') : key;
2217    }
2218
2219    // pick the locale from the array
2220    // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
2221    // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
2222    function chooseLocale(names) {
2223        var i = 0,
2224            j,
2225            next,
2226            locale,
2227            split;
2228
2229        while (i < names.length) {
2230            split = normalizeLocale(names[i]).split('-');
2231            j = split.length;
2232            next = normalizeLocale(names[i + 1]);
2233            next = next ? next.split('-') : null;
2234            while (j > 0) {
2235                locale = loadLocale(split.slice(0, j).join('-'));
2236                if (locale) {
2237                    return locale;
2238                }
2239                if (
2240                    next &&
2241                    next.length >= j &&
2242                    commonPrefix(split, next) >= j - 1
2243                ) {
2244                    //the next array item is better than a shallower substring of this one
2245                    break;
2246                }
2247                j--;
2248            }
2249            i++;
2250        }
2251        return globalLocale;
2252    }
2253
2254    function isLocaleNameSane(name) {
2255        // Prevent names that look like filesystem paths, i.e contain '/' or '\'
2256        // Ensure name is available and function returns boolean
2257        return !!(name && name.match('^[^/\\\\]*$'));
2258    }
2259
2260    function loadLocale(name) {
2261        var oldLocale = null,
2262            aliasedRequire;
2263        // TODO: Find a better way to register and load all the locales in Node
2264        if (
2265            locales[name] === undefined &&
2266            typeof module !== 'undefined' &&
2267            module &&
2268            module.exports &&
2269            isLocaleNameSane(name)
2270        ) {
2271            try {
2272                oldLocale = globalLocale._abbr;
2273                aliasedRequire = require;
2274                aliasedRequire('./locale/' + name);
2275                getSetGlobalLocale(oldLocale);
2276            } catch (e) {
2277                // mark as not found to avoid repeating expensive file require call causing high CPU
2278                // when trying to find en-US, en_US, en-us for every format call
2279                locales[name] = null; // null means not found
2280            }
2281        }
2282        return locales[name];
2283    }
2284
2285    // This function will load locale and then set the global locale.  If
2286    // no arguments are passed in, it will simply return the current global
2287    // locale key.
2288    function getSetGlobalLocale(key, values) {
2289        var data;
2290        if (key) {
2291            if (isUndefined(values)) {
2292                data = getLocale(key);
2293            } else {
2294                data = defineLocale(key, values);
2295            }
2296
2297            if (data) {
2298                // moment.duration._locale = moment._locale = data;
2299                globalLocale = data;
2300            } else {
2301                if (typeof console !== 'undefined' && console.warn) {
2302                    //warn user if arguments are passed but the locale could not be set
2303                    console.warn(
2304                        'Locale ' + key + ' not found. Did you forget to load it?'
2305                    );
2306                }
2307            }
2308        }
2309
2310        return globalLocale._abbr;
2311    }
2312
2313    function defineLocale(name, config) {
2314        if (config !== null) {
2315            var locale,
2316                parentConfig = baseConfig;
2317            config.abbr = name;
2318            if (locales[name] != null) {
2319                deprecateSimple(
2320                    'defineLocaleOverride',
2321                    'use moment.updateLocale(localeName, config) to change ' +
2322                        'an existing locale. moment.defineLocale(localeName, ' +
2323                        'config) should only be used for creating a new locale ' +
2324                        'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'
2325                );
2326                parentConfig = locales[name]._config;
2327            } else if (config.parentLocale != null) {
2328                if (locales[config.parentLocale] != null) {
2329                    parentConfig = locales[config.parentLocale]._config;
2330                } else {
2331                    locale = loadLocale(config.parentLocale);
2332                    if (locale != null) {
2333                        parentConfig = locale._config;
2334                    } else {
2335                        if (!localeFamilies[config.parentLocale]) {
2336                            localeFamilies[config.parentLocale] = [];
2337                        }
2338                        localeFamilies[config.parentLocale].push({
2339                            name: name,
2340                            config: config,
2341                        });
2342                        return null;
2343                    }
2344                }
2345            }
2346            locales[name] = new Locale(mergeConfigs(parentConfig, config));
2347
2348            if (localeFamilies[name]) {
2349                localeFamilies[name].forEach(function (x) {
2350                    defineLocale(x.name, x.config);
2351                });
2352            }
2353
2354            // backwards compat for now: also set the locale
2355            // make sure we set the locale AFTER all child locales have been
2356            // created, so we won't end up with the child locale set.
2357            getSetGlobalLocale(name);
2358
2359            return locales[name];
2360        } else {
2361            // useful for testing
2362            delete locales[name];
2363            return null;
2364        }
2365    }
2366
2367    function updateLocale(name, config) {
2368        if (config != null) {
2369            var locale,
2370                tmpLocale,
2371                parentConfig = baseConfig;
2372
2373            if (locales[name] != null && locales[name].parentLocale != null) {
2374                // Update existing child locale in-place to avoid memory-leaks
2375                locales[name].set(mergeConfigs(locales[name]._config, config));
2376            } else {
2377                // MERGE
2378                tmpLocale = loadLocale(name);
2379                if (tmpLocale != null) {
2380                    parentConfig = tmpLocale._config;
2381                }
2382                config = mergeConfigs(parentConfig, config);
2383                if (tmpLocale == null) {
2384                    // updateLocale is called for creating a new locale
2385                    // Set abbr so it will have a name (getters return
2386                    // undefined otherwise).
2387                    config.abbr = name;
2388                }
2389                locale = new Locale(config);
2390                locale.parentLocale = locales[name];
2391                locales[name] = locale;
2392            }
2393
2394            // backwards compat for now: also set the locale
2395            getSetGlobalLocale(name);
2396        } else {
2397            // pass null for config to unupdate, useful for tests
2398            if (locales[name] != null) {
2399                if (locales[name].parentLocale != null) {
2400                    locales[name] = locales[name].parentLocale;
2401                    if (name === getSetGlobalLocale()) {
2402                        getSetGlobalLocale(name);
2403                    }
2404                } else if (locales[name] != null) {
2405                    delete locales[name];
2406                }
2407            }
2408        }
2409        return locales[name];
2410    }
2411
2412    // returns locale data
2413    function getLocale(key) {
2414        var locale;
2415
2416        if (key && key._locale && key._locale._abbr) {
2417            key = key._locale._abbr;
2418        }
2419
2420        if (!key) {
2421            return globalLocale;
2422        }
2423
2424        if (!isArray(key)) {
2425            //short-circuit everything else
2426            locale = loadLocale(key);
2427            if (locale) {
2428                return locale;
2429            }
2430            key = [key];
2431        }
2432
2433        return chooseLocale(key);
2434    }
2435
2436    function listLocales() {
2437        return keys(locales);
2438    }
2439
2440    function checkOverflow(m) {
2441        var overflow,
2442            a = m._a;
2443
2444        if (a && getParsingFlags(m).overflow === -2) {
2445            overflow =
2446                a[MONTH] < 0 || a[MONTH] > 11
2447                    ? MONTH
2448                    : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
2449                      ? DATE
2450                      : a[HOUR] < 0 ||
2451                          a[HOUR] > 24 ||
2452                          (a[HOUR] === 24 &&
2453                              (a[MINUTE] !== 0 ||
2454                                  a[SECOND] !== 0 ||
2455                                  a[MILLISECOND] !== 0))
2456                        ? HOUR
2457                        : a[MINUTE] < 0 || a[MINUTE] > 59
2458                          ? MINUTE
2459                          : a[SECOND] < 0 || a[SECOND] > 59
2460                            ? SECOND
2461                            : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
2462                              ? MILLISECOND
2463                              : -1;
2464
2465            if (
2466                getParsingFlags(m)._overflowDayOfYear &&
2467                (overflow < YEAR || overflow > DATE)
2468            ) {
2469                overflow = DATE;
2470            }
2471            if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
2472                overflow = WEEK;
2473            }
2474            if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
2475                overflow = WEEKDAY;
2476            }
2477
2478            getParsingFlags(m).overflow = overflow;
2479        }
2480
2481        return m;
2482    }
2483
2484    // iso 8601 regex
2485    // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
2486    var extendedIsoRegex =
2487            /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
2488        basicIsoRegex =
2489            /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
2490        tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
2491        isoDates = [
2492            ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
2493            ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
2494            ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
2495            ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
2496            ['YYYY-DDD', /\d{4}-\d{3}/],
2497            ['YYYY-MM', /\d{4}-\d\d/, false],
2498            ['YYYYYYMMDD', /[+-]\d{10}/],
2499            ['YYYYMMDD', /\d{8}/],
2500            ['GGGG[W]WWE', /\d{4}W\d{3}/],
2501            ['GGGG[W]WW', /\d{4}W\d{2}/, false],
2502            ['YYYYDDD', /\d{7}/],
2503            ['YYYYMM', /\d{6}/, false],
2504            ['YYYY', /\d{4}/, false],
2505        ],
2506        // iso time formats and regexes
2507        isoTimes = [
2508            ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
2509            ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
2510            ['HH:mm:ss', /\d\d:\d\d:\d\d/],
2511            ['HH:mm', /\d\d:\d\d/],
2512            ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
2513            ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
2514            ['HHmmss', /\d\d\d\d\d\d/],
2515            ['HHmm', /\d\d\d\d/],
2516            ['HH', /\d\d/],
2517        ],
2518        aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
2519        // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
2520        rfc2822 =
2521            /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
2522        obsOffsets = {
2523            UT: 0,
2524            GMT: 0,
2525            EDT: -4 * 60,
2526            EST: -5 * 60,
vendor: 70,618 bytes, lines 2527-4722
2527            CDT: -5 * 60,
2528            CST: -6 * 60,
2529            MDT: -6 * 60,
2530            MST: -7 * 60,
2531            PDT: -7 * 60,
2532            PST: -8 * 60,
2533        };
2534
2535    // date from iso format
2536    function configFromISO(config) {
2537        var i,
2538            l,
2539            string = config._i,
2540            match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
2541            allowTime,
2542            dateFormat,
2543            timeFormat,
2544            tzFormat,
2545            isoDatesLen = isoDates.length,
2546            isoTimesLen = isoTimes.length;
2547
2548        if (match) {
2549            getParsingFlags(config).iso = true;
2550            for (i = 0, l = isoDatesLen; i < l; i++) {
2551                if (isoDates[i][1].exec(match[1])) {
2552                    dateFormat = isoDates[i][0];
2553                    allowTime = isoDates[i][2] !== false;
2554                    break;
2555                }
2556            }
2557            if (dateFormat == null) {
2558                config._isValid = false;
2559                return;
2560            }
2561            if (match[3]) {
2562                for (i = 0, l = isoTimesLen; i < l; i++) {
2563                    if (isoTimes[i][1].exec(match[3])) {
2564                        // match[2] should be 'T' or space
2565                        timeFormat = (match[2] || ' ') + isoTimes[i][0];
2566                        break;
2567                    }
2568                }
2569                if (timeFormat == null) {
2570                    config._isValid = false;
2571                    return;
2572                }
2573            }
2574            if (!allowTime && timeFormat != null) {
2575                config._isValid = false;
2576                return;
2577            }
2578            if (match[4]) {
2579                if (tzRegex.exec(match[4])) {
2580                    tzFormat = 'Z';
2581                } else {
2582                    config._isValid = false;
2583                    return;
2584                }
2585            }
2586            config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
2587            configFromStringAndFormat(config);
2588        } else {
2589            config._isValid = false;
2590        }
2591    }
2592
2593    function extractFromRFC2822Strings(
2594        yearStr,
2595        monthStr,
2596        dayStr,
2597        hourStr,
2598        minuteStr,
2599        secondStr
2600    ) {
2601        var result = [
2602            untruncateYear(yearStr),
2603            defaultLocaleMonthsShort.indexOf(monthStr),
2604            parseInt(dayStr, 10),
2605            parseInt(hourStr, 10),
2606            parseInt(minuteStr, 10),
2607        ];
2608
2609        if (secondStr) {
2610            result.push(parseInt(secondStr, 10));
2611        }
2612
2613        return result;
2614    }
2615
2616    function untruncateYear(yearStr) {
2617        var year = parseInt(yearStr, 10);
2618        if (year <= 49) {
2619            return 2000 + year;
2620        } else if (year <= 999) {
2621            return 1900 + year;
2622        }
2623        return year;
2624    }
2625
2626    function preprocessRFC2822(s) {
2627        // Remove comments and folding whitespace and replace multiple-spaces with a single space
2628        return s
2629            .replace(/\([^()]*\)|[\n\t]/g, ' ')
2630            .replace(/(\s\s+)/g, ' ')
2631            .replace(/^\s\s*/, '')
2632            .replace(/\s\s*$/, '');
2633    }
2634
2635    function checkWeekday(weekdayStr, parsedInput, config) {
2636        if (weekdayStr) {
2637            // TODO: Replace the vanilla JS Date object with an independent day-of-week check.
2638            var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
2639                weekdayActual = new Date(
2640                    parsedInput[0],
2641                    parsedInput[1],
2642                    parsedInput[2]
2643                ).getDay();
2644            if (weekdayProvided !== weekdayActual) {
2645                getParsingFlags(config).weekdayMismatch = true;
2646                config._isValid = false;
2647                return false;
2648            }
2649        }
2650        return true;
2651    }
2652
2653    function calculateOffset(obsOffset, militaryOffset, numOffset) {
2654        if (obsOffset) {
2655            return obsOffsets[obsOffset];
2656        } else if (militaryOffset) {
2657            // the only allowed military tz is Z
2658            return 0;
2659        } else {
2660            var hm = parseInt(numOffset, 10),
2661                m = hm % 100,
2662                h = (hm - m) / 100;
2663            return h * 60 + m;
2664        }
2665    }
2666
2667    // date and time from ref 2822 format
2668    function configFromRFC2822(config) {
2669        var match = rfc2822.exec(preprocessRFC2822(config._i)),
2670            parsedArray;
2671        if (match) {
2672            parsedArray = extractFromRFC2822Strings(
2673                match[4],
2674                match[3],
2675                match[2],
2676                match[5],
2677                match[6],
2678                match[7]
2679            );
2680            if (!checkWeekday(match[1], parsedArray, config)) {
2681                return;
2682            }
2683
2684            config._a = parsedArray;
2685            config._tzm = calculateOffset(match[8], match[9], match[10]);
2686
2687            config._d = createUTCDate.apply(null, config._a);
2688            config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
2689
2690            getParsingFlags(config).rfc2822 = true;
2691        } else {
2692            config._isValid = false;
2693        }
2694    }
2695
2696    // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
2697    function configFromString(config) {
2698        var matched = aspNetJsonRegex.exec(config._i);
2699        if (matched !== null) {
2700            config._d = new Date(+matched[1]);
2701            return;
2702        }
2703
2704        configFromISO(config);
2705        if (config._isValid === false) {
2706            delete config._isValid;
2707        } else {
2708            return;
2709        }
2710
2711        configFromRFC2822(config);
2712        if (config._isValid === false) {
2713            delete config._isValid;
2714        } else {
2715            return;
2716        }
2717
2718        if (config._strict) {
2719            config._isValid = false;
2720        } else {
2721            // Final attempt, use Input Fallback
2722            hooks.createFromInputFallback(config);
2723        }
2724    }
2725
2726    hooks.createFromInputFallback = deprecate(
2727        'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
2728            'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
2729            'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',
2730        function (config) {
2731            config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
2732        }
2733    );
2734
2735    // Pick the first defined of two or three arguments.
2736    function defaults(a, b, c) {
2737        if (a != null) {
2738            return a;
2739        }
2740        if (b != null) {
2741            return b;
2742        }
2743        return c;
2744    }
2745
2746    function currentDateArray(config) {
2747        // hooks is actually the exported moment object
2748        var nowValue = new Date(hooks.now());
2749        if (config._useUTC) {
2750            return [
2751                nowValue.getUTCFullYear(),
2752                nowValue.getUTCMonth(),
2753                nowValue.getUTCDate(),
2754            ];
2755        }
2756        return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
2757    }
2758
2759    // convert an array to a date.
2760    // the array should mirror the parameters below
2761    // note: all values past the year are optional and will default to the lowest possible value.
2762    // [year, month, day , hour, minute, second, millisecond]
2763    function configFromArray(config) {
2764        var i,
2765            date,
2766            input = [],
2767            currentDate,
2768            expectedWeekday,
2769            yearToUse;
2770
2771        if (config._d) {
2772            return;
2773        }
2774
2775        currentDate = currentDateArray(config);
2776
2777        //compute day of the year from weeks and weekdays
2778        if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
2779            dayOfYearFromWeekInfo(config);
2780        }
2781
2782        //if the day of the year is set, figure out what it is
2783        if (config._dayOfYear != null) {
2784            yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
2785
2786            if (
2787                config._dayOfYear > daysInYear(yearToUse) ||
2788                config._dayOfYear === 0
2789            ) {
2790                getParsingFlags(config)._overflowDayOfYear = true;
2791            }
2792
2793            date = createUTCDate(yearToUse, 0, config._dayOfYear);
2794            config._a[MONTH] = date.getUTCMonth();
2795            config._a[DATE] = date.getUTCDate();
2796        }
2797
2798        // Default to current date.
2799        // * if no year, month, day of month are given, default to today
2800        // * if day of month is given, default month and year
2801        // * if month is given, default only year
2802        // * if year is given, don't default anything
2803        for (i = 0; i < 3 && config._a[i] == null; ++i) {
2804            config._a[i] = input[i] = currentDate[i];
2805        }
2806
2807        // Zero out whatever was not defaulted, including time
2808        for (; i < 7; i++) {
2809            config._a[i] = input[i] =
2810                config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];
2811        }
2812
2813        // Check for 24:00:00.000
2814        if (
2815            config._a[HOUR] === 24 &&
2816            config._a[MINUTE] === 0 &&
2817            config._a[SECOND] === 0 &&
2818            config._a[MILLISECOND] === 0
2819        ) {
2820            config._nextDay = true;
2821            config._a[HOUR] = 0;
2822        }
2823
2824        config._d = (config._useUTC ? createUTCDate : createDate).apply(
2825            null,
2826            input
2827        );
2828        expectedWeekday = config._useUTC
2829            ? config._d.getUTCDay()
2830            : config._d.getDay();
2831
2832        // Apply timezone offset from input. The actual utcOffset can be changed
2833        // with parseZone.
2834        if (config._tzm != null) {
2835            config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
2836        }
2837
2838        if (config._nextDay) {
2839            config._a[HOUR] = 24;
2840        }
2841
2842        // check for mismatching day of week
2843        if (
2844            config._w &&
2845            typeof config._w.d !== 'undefined' &&
2846            config._w.d !== expectedWeekday
2847        ) {
2848            getParsingFlags(config).weekdayMismatch = true;
2849        }
2850    }
2851
2852    function dayOfYearFromWeekInfo(config) {
2853        var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
2854
2855        w = config._w;
2856        if (w.GG != null || w.W != null || w.E != null) {
2857            dow = 1;
2858            doy = 4;
2859
2860            // TODO: We need to take the current isoWeekYear, but that depends on
2861            // how we interpret now (local, utc, fixed offset). So create
2862            // a now version of current config (take local/utc/offset flags, and
2863            // create now).
2864            weekYear = defaults(
2865                w.GG,
2866                config._a[YEAR],
2867                weekOfYear(createLocal(), 1, 4).year
2868            );
2869            week = defaults(w.W, 1);
2870            weekday = defaults(w.E, 1);
2871            if (weekday < 1 || weekday > 7) {
2872                weekdayOverflow = true;
2873            }
2874        } else {
2875            dow = config._locale._week.dow;
2876            doy = config._locale._week.doy;
2877
2878            curWeek = weekOfYear(createLocal(), dow, doy);
2879
2880            weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
2881
2882            // Default to current week.
2883            week = defaults(w.w, curWeek.week);
2884
2885            if (w.d != null) {
2886                // weekday -- low day numbers are considered next week
2887                weekday = w.d;
2888                if (weekday < 0 || weekday > 6) {
2889                    weekdayOverflow = true;
2890                }
2891            } else if (w.e != null) {
2892                // local weekday -- counting starts from beginning of week
2893                weekday = w.e + dow;
2894                if (w.e < 0 || w.e > 6) {
2895                    weekdayOverflow = true;
2896                }
2897            } else {
2898                // default to beginning of week
2899                weekday = dow;
2900            }
2901        }
2902        if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
2903            getParsingFlags(config)._overflowWeeks = true;
2904        } else if (weekdayOverflow != null) {
2905            getParsingFlags(config)._overflowWeekday = true;
2906        } else {
2907            temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
2908            config._a[YEAR] = temp.year;
2909            config._dayOfYear = temp.dayOfYear;
2910        }
2911    }
2912
2913    // constant that refers to the ISO standard
2914    hooks.ISO_8601 = function () {};
2915
2916    // constant that refers to the RFC 2822 form
2917    hooks.RFC_2822 = function () {};
2918
2919    // date from string and format string
2920    function configFromStringAndFormat(config) {
2921        // TODO: Move this to another part of the creation flow to prevent circular deps
2922        if (config._f === hooks.ISO_8601) {
2923            configFromISO(config);
2924            return;
2925        }
2926        if (config._f === hooks.RFC_2822) {
2927            configFromRFC2822(config);
2928            return;
2929        }
2930        config._a = [];
2931        getParsingFlags(config).empty = true;
2932
2933        // This array is used to make a Date, either with `new Date` or `Date.UTC`
2934        var string = '' + config._i,
2935            i,
2936            parsedInput,
2937            tokens,
2938            token,
2939            skipped,
2940            stringLength = string.length,
2941            totalParsedInputLength = 0,
2942            era,
2943            tokenLen;
2944
2945        tokens =
2946            expandFormat(config._f, config._locale).match(formattingTokens) || [];
2947        tokenLen = tokens.length;
2948        for (i = 0; i < tokenLen; i++) {
2949            token = tokens[i];
2950            parsedInput = (string.match(getParseRegexForToken(token, config)) ||
2951                [])[0];
2952            if (parsedInput) {
2953                skipped = string.substr(0, string.indexOf(parsedInput));
2954                if (skipped.length > 0) {
2955                    getParsingFlags(config).unusedInput.push(skipped);
2956                }
2957                string = string.slice(
2958                    string.indexOf(parsedInput) + parsedInput.length
2959                );
2960                totalParsedInputLength += parsedInput.length;
2961            }
2962            // don't parse if it's not a known token
2963            if (formatTokenFunctions[token]) {
2964                if (parsedInput) {
2965                    getParsingFlags(config).empty = false;
2966                } else {
2967                    getParsingFlags(config).unusedTokens.push(token);
2968                }
2969                addTimeToArrayFromToken(token, parsedInput, config);
2970            } else if (config._strict && !parsedInput) {
2971                getParsingFlags(config).unusedTokens.push(token);
2972            }
2973        }
2974
2975        // add remaining unparsed input length to the string
2976        getParsingFlags(config).charsLeftOver =
2977            stringLength - totalParsedInputLength;
2978        if (string.length > 0) {
2979            getParsingFlags(config).unusedInput.push(string);
2980        }
2981
2982        // clear _12h flag if hour is <= 12
2983        if (
2984            config._a[HOUR] <= 12 &&
2985            getParsingFlags(config).bigHour === true &&
2986            config._a[HOUR] > 0
2987        ) {
2988            getParsingFlags(config).bigHour = undefined;
2989        }
2990
2991        getParsingFlags(config).parsedDateParts = config._a.slice(0);
2992        getParsingFlags(config).meridiem = config._meridiem;
2993        // handle meridiem
2994        config._a[HOUR] = meridiemFixWrap(
2995            config._locale,
2996            config._a[HOUR],
2997            config._meridiem
2998        );
2999
3000        // handle era
3001        era = getParsingFlags(config).era;
3002        if (era !== null) {
3003            config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
3004        }
3005
3006        configFromArray(config);
3007        checkOverflow(config);
3008    }
3009
3010    function meridiemFixWrap(locale, hour, meridiem) {
3011        var isPm;
3012
3013        if (meridiem == null) {
3014            // nothing to do
3015            return hour;
3016        }
3017        if (locale.meridiemHour != null) {
3018            return locale.meridiemHour(hour, meridiem);
3019        } else if (locale.isPM != null) {
3020            // Fallback
3021            isPm = locale.isPM(meridiem);
3022            if (isPm && hour < 12) {
3023                hour += 12;
3024            }
3025            if (!isPm && hour === 12) {
3026                hour = 0;
3027            }
3028            return hour;
3029        } else {
3030            // this is not supposed to happen
3031            return hour;
3032        }
3033    }
3034
3035    // date from string and array of format strings
3036    function configFromStringAndArray(config) {
3037        var tempConfig,
3038            bestMoment,
3039            scoreToBeat,
3040            i,
3041            currentScore,
3042            validFormatFound,
3043            bestFormatIsValid = false,
3044            configfLen = config._f.length;
3045
3046        if (configfLen === 0) {
3047            getParsingFlags(config).invalidFormat = true;
3048            config._d = new Date(NaN);
3049            return;
3050        }
3051
3052        for (i = 0; i < configfLen; i++) {
3053            currentScore = 0;
3054            validFormatFound = false;
3055            tempConfig = copyConfig({}, config);
3056            if (config._useUTC != null) {
3057                tempConfig._useUTC = config._useUTC;
3058            }
3059            tempConfig._f = config._f[i];
3060            configFromStringAndFormat(tempConfig);
3061
3062            if (isValid(tempConfig)) {
3063                validFormatFound = true;
3064            }
3065
3066            // if there is any input that was not parsed add a penalty for that format
3067            currentScore += getParsingFlags(tempConfig).charsLeftOver;
3068
3069            //or tokens
3070            currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
3071
3072            getParsingFlags(tempConfig).score = currentScore;
3073
3074            if (!bestFormatIsValid) {
3075                if (
3076                    scoreToBeat == null ||
3077                    currentScore < scoreToBeat ||
3078                    validFormatFound
3079                ) {
3080                    scoreToBeat = currentScore;
3081                    bestMoment = tempConfig;
3082                    if (validFormatFound) {
3083                        bestFormatIsValid = true;
3084                    }
3085                }
3086            } else {
3087                if (currentScore < scoreToBeat) {
3088                    scoreToBeat = currentScore;
3089                    bestMoment = tempConfig;
3090                }
3091            }
3092        }
3093
3094        extend(config, bestMoment || tempConfig);
3095    }
3096
3097    function configFromObject(config) {
3098        if (config._d) {
3099            return;
3100        }
3101
3102        var i = normalizeObjectUnits(config._i),
3103            dayOrDate = i.day === undefined ? i.date : i.day;
3104        config._a = map(
3105            [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
3106            function (obj) {
3107                return obj && parseInt(obj, 10);
3108            }
3109        );
3110
3111        configFromArray(config);
3112    }
3113
3114    function createFromConfig(config) {
3115        var res = new Moment(checkOverflow(prepareConfig(config)));
3116        if (res._nextDay) {
3117            // Adding is smart enough around DST
3118            res.add(1, 'd');
3119            res._nextDay = undefined;
3120        }
3121
3122        return res;
3123    }
3124
3125    function prepareConfig(config) {
3126        var input = config._i,
3127            format = config._f;
3128
3129        config._locale = config._locale || getLocale(config._l);
3130
3131        if (input === null || (format === undefined && input === '')) {
3132            return createInvalid({ nullInput: true });
3133        }
3134
3135        if (typeof input === 'string') {
3136            config._i = input = config._locale.preparse(input);
3137        }
3138
3139        if (isMoment(input)) {
3140            return new Moment(checkOverflow(input));
3141        } else if (isDate(input)) {
3142            config._d = input;
3143        } else if (isArray(format)) {
3144            configFromStringAndArray(config);
3145        } else if (format) {
3146            configFromStringAndFormat(config);
3147        } else {
3148            configFromInput(config);
3149        }
3150
3151        if (!isValid(config)) {
3152            config._d = null;
3153        }
3154
3155        return config;
3156    }
3157
3158    function configFromInput(config) {
3159        var input = config._i;
3160        if (isUndefined(input)) {
3161            config._d = new Date(hooks.now());
3162        } else if (isDate(input)) {
3163            config._d = new Date(input.valueOf());
3164        } else if (typeof input === 'string') {
3165            configFromString(config);
3166        } else if (isArray(input)) {
3167            config._a = map(input.slice(0), function (obj) {
3168                return parseInt(obj, 10);
3169            });
3170            configFromArray(config);
3171        } else if (isObject(input)) {
3172            configFromObject(config);
3173        } else if (isNumber(input)) {
3174            // from milliseconds
3175            config._d = new Date(input);
3176        } else {
3177            hooks.createFromInputFallback(config);
3178        }
3179    }
3180
3181    function createLocalOrUTC(input, format, locale, strict, isUTC) {
3182        var c = {};
3183
3184        if (format === true || format === false) {
3185            strict = format;
3186            format = undefined;
3187        }
3188
3189        if (locale === true || locale === false) {
3190            strict = locale;
3191            locale = undefined;
3192        }
3193
3194        if (
3195            (isObject(input) && isObjectEmpty(input)) ||
3196            (isArray(input) && input.length === 0)
3197        ) {
3198            input = undefined;
3199        }
3200        // object construction must be done this way.
3201        // https://github.com/moment/moment/issues/1423
3202        c._isAMomentObject = true;
3203        c._useUTC = c._isUTC = isUTC;
3204        c._l = locale;
3205        c._i = input;
3206        c._f = format;
3207        c._strict = strict;
3208
3209        return createFromConfig(c);
3210    }
3211
3212    function createLocal(input, format, locale, strict) {
3213        return createLocalOrUTC(input, format, locale, strict, false);
3214    }
3215
3216    var prototypeMin = deprecate(
3217            'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
3218            function () {
3219                var other = createLocal.apply(null, arguments);
3220                if (this.isValid() && other.isValid()) {
3221                    return other < this ? this : other;
3222                } else {
3223                    return createInvalid();
3224                }
3225            }
3226        ),
3227        prototypeMax = deprecate(
3228            'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
3229            function () {
3230                var other = createLocal.apply(null, arguments);
3231                if (this.isValid() && other.isValid()) {
3232                    return other > this ? this : other;
3233                } else {
3234                    return createInvalid();
3235                }
3236            }
3237        );
3238
3239    // Pick a moment m from moments so that m[fn](other) is true for all
3240    // other. This relies on the function fn to be transitive.
3241    //
3242    // moments should either be an array of moment objects or an array, whose
3243    // first element is an array of moment objects.
3244    function pickBy(fn, moments) {
3245        var res, i;
3246        if (moments.length === 1 && isArray(moments[0])) {
3247            moments = moments[0];
3248        }
3249        if (!moments.length) {
3250            return createLocal();
3251        }
3252        res = moments[0];
3253        for (i = 1; i < moments.length; ++i) {
3254            if (!moments[i].isValid() || moments[i][fn](res)) {
3255                res = moments[i];
3256            }
3257        }
3258        return res;
3259    }
3260
3261    // TODO: Use [].sort instead?
3262    function min() {
3263        var args = [].slice.call(arguments, 0);
3264
3265        return pickBy('isBefore', args);
3266    }
3267
3268    function max() {
3269        var args = [].slice.call(arguments, 0);
3270
3271        return pickBy('isAfter', args);
3272    }
3273
3274    var now = function () {
3275        return Date.now ? Date.now() : +new Date();
3276    };
3277
3278    var ordering = [
3279        'year',
3280        'quarter',
3281        'month',
3282        'week',
3283        'day',
3284        'hour',
3285        'minute',
3286        'second',
3287        'millisecond',
3288    ];
3289
3290    function isDurationValid(m) {
3291        var key,
3292            unitHasDecimal = false,
3293            i,
3294            orderLen = ordering.length;
3295        for (key in m) {
3296            if (
3297                hasOwnProp(m, key) &&
3298                !(
3299                    indexOf.call(ordering, key) !== -1 &&
3300                    (m[key] == null || !isNaN(m[key]))
3301                )
3302            ) {
3303                return false;
3304            }
3305        }
3306
3307        for (i = 0; i < orderLen; ++i) {
3308            if (m[ordering[i]]) {
3309                if (unitHasDecimal) {
3310                    return false; // only allow non-integers for smallest unit
3311                }
3312                if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
3313                    unitHasDecimal = true;
3314                }
3315            }
3316        }
3317
3318        return true;
3319    }
3320
3321    function isValid$1() {
3322        return this._isValid;
3323    }
3324
3325    function createInvalid$1() {
3326        return createDuration(NaN);
3327    }
3328
3329    function Duration(duration) {
3330        var normalizedInput = normalizeObjectUnits(duration),
3331            years = normalizedInput.year || 0,
3332            quarters = normalizedInput.quarter || 0,
3333            months = normalizedInput.month || 0,
3334            weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
3335            days = normalizedInput.day || 0,
3336            hours = normalizedInput.hour || 0,
3337            minutes = normalizedInput.minute || 0,
3338            seconds = normalizedInput.second || 0,
3339            milliseconds = normalizedInput.millisecond || 0;
3340
3341        this._isValid = isDurationValid(normalizedInput);
3342
3343        // representation for dateAddRemove
3344        this._milliseconds =
3345            +milliseconds +
3346            seconds * 1e3 + // 1000
3347            minutes * 6e4 + // 1000 * 60
3348            hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
3349        // Because of dateAddRemove treats 24 hours as different from a
3350        // day when working around DST, we need to store them separately
3351        this._days = +days + weeks * 7;
3352        // It is impossible to translate months into days without knowing
3353        // which months you are are talking about, so we have to store
3354        // it separately.
3355        this._months = +months + quarters * 3 + years * 12;
3356
3357        this._data = {};
3358
3359        this._locale = getLocale();
3360
3361        this._bubble();
3362    }
3363
3364    function isDuration(obj) {
3365        return obj instanceof Duration;
3366    }
3367
3368    function absRound(number) {
3369        if (number < 0) {
3370            return Math.round(-1 * number) * -1;
3371        } else {
3372            return Math.round(number);
3373        }
3374    }
3375
3376    // compare two arrays, return the number of differences
3377    function compareArrays(array1, array2, dontConvert) {
3378        var len = Math.min(array1.length, array2.length),
3379            lengthDiff = Math.abs(array1.length - array2.length),
3380            diffs = 0,
3381            i;
3382        for (i = 0; i < len; i++) {
3383            if (
3384                (dontConvert && array1[i] !== array2[i]) ||
3385                (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
3386            ) {
3387                diffs++;
3388            }
3389        }
3390        return diffs + lengthDiff;
3391    }
3392
3393    // FORMATTING
3394
3395    function offset(token, separator) {
3396        addFormatToken(token, 0, 0, function () {
3397            var offset = this.utcOffset(),
3398                sign = '+';
3399            if (offset < 0) {
3400                offset = -offset;
3401                sign = '-';
3402            }
3403            return (
3404                sign +
3405                zeroFill(~~(offset / 60), 2) +
3406                separator +
3407                zeroFill(~~offset % 60, 2)
3408            );
3409        });
3410    }
3411
3412    offset('Z', ':');
3413    offset('ZZ', '');
3414
3415    // PARSING
3416
3417    addRegexToken('Z', matchShortOffset);
3418    addRegexToken('ZZ', matchShortOffset);
3419    addParseToken(['Z', 'ZZ'], function (input, array, config) {
3420        config._useUTC = true;
3421        config._tzm = offsetFromString(matchShortOffset, input);
3422    });
3423
3424    // HELPERS
3425
3426    // timezone chunker
3427    // '+10:00' > ['10',  '00']
3428    // '-1530'  > ['-15', '30']
3429    var chunkOffset = /([\+\-]|\d\d)/gi;
3430
3431    function offsetFromString(matcher, string) {
3432        var matches = (string || '').match(matcher),
3433            chunk,
3434            parts,
3435            minutes;
3436
3437        if (matches === null) {
3438            return null;
3439        }
3440
3441        chunk = matches[matches.length - 1] || [];
3442        parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
3443        minutes = +(parts[1] * 60) + toInt(parts[2]);
3444
3445        return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
3446    }
3447
3448    // Return a moment from input, that is local/utc/zone equivalent to model.
3449    function cloneWithOffset(input, model) {
3450        var res, diff;
3451        if (model._isUTC) {
3452            res = model.clone();
3453            diff =
3454                (isMoment(input) || isDate(input)
3455                    ? input.valueOf()
3456                    : createLocal(input).valueOf()) - res.valueOf();
3457            // Use low-level api, because this fn is low-level api.
3458            res._d.setTime(res._d.valueOf() + diff);
3459            hooks.updateOffset(res, false);
3460            return res;
3461        } else {
3462            return createLocal(input).local();
3463        }
3464    }
3465
3466    function getDateOffset(m) {
3467        // On Firefox.24 Date#getTimezoneOffset returns a floating point.
3468        // https://github.com/moment/moment/pull/1871
3469        return -Math.round(m._d.getTimezoneOffset());
3470    }
3471
3472    // HOOKS
3473
3474    // This function will be called whenever a moment is mutated.
3475    // It is intended to keep the offset in sync with the timezone.
3476    hooks.updateOffset = function () {};
3477
3478    // MOMENTS
3479
3480    // keepLocalTime = true means only change the timezone, without
3481    // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
3482    // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
3483    // +0200, so we adjust the time as needed, to be valid.
3484    //
3485    // Keeping the time actually adds/subtracts (one hour)
3486    // from the actual represented time. That is why we call updateOffset
3487    // a second time. In case it wants us to change the offset again
3488    // _changeInProgress == true case, then we have to adjust, because
3489    // there is no such time in the given timezone.
3490    function getSetOffset(input, keepLocalTime, keepMinutes) {
3491        var offset = this._offset || 0,
3492            localAdjust;
3493        if (!this.isValid()) {
3494            return input != null ? this : NaN;
3495        }
3496        if (input != null) {
3497            if (typeof input === 'string') {
3498                input = offsetFromString(matchShortOffset, input);
3499                if (input === null) {
3500                    return this;
3501                }
3502            } else if (Math.abs(input) < 16 && !keepMinutes) {
3503                input = input * 60;
3504            }
3505            if (!this._isUTC && keepLocalTime) {
3506                localAdjust = getDateOffset(this);
3507            }
3508            this._offset = input;
3509            this._isUTC = true;
3510            if (localAdjust != null) {
3511                this.add(localAdjust, 'm');
3512            }
3513            if (offset !== input) {
3514                if (!keepLocalTime || this._changeInProgress) {
3515                    addSubtract(
3516                        this,
3517                        createDuration(input - offset, 'm'),
3518                        1,
3519                        false
3520                    );
3521                } else if (!this._changeInProgress) {
3522                    this._changeInProgress = true;
3523                    hooks.updateOffset(this, true);
3524                    this._changeInProgress = null;
3525                }
3526            }
3527            return this;
3528        } else {
3529            return this._isUTC ? offset : getDateOffset(this);
3530        }
3531    }
3532
3533    function getSetZone(input, keepLocalTime) {
3534        if (input != null) {
3535            if (typeof input !== 'string') {
3536                input = -input;
3537            }
3538
3539            this.utcOffset(input, keepLocalTime);
3540
3541            return this;
3542        } else {
3543            return -this.utcOffset();
3544        }
3545    }
3546
3547    function setOffsetToUTC(keepLocalTime) {
3548        return this.utcOffset(0, keepLocalTime);
3549    }
3550
3551    function setOffsetToLocal(keepLocalTime) {
3552        if (this._isUTC) {
3553            this.utcOffset(0, keepLocalTime);
3554            this._isUTC = false;
3555
3556            if (keepLocalTime) {
3557                this.subtract(getDateOffset(this), 'm');
3558            }
3559        }
3560        return this;
3561    }
3562
3563    function setOffsetToParsedOffset() {
3564        if (this._tzm != null) {
3565            this.utcOffset(this._tzm, false, true);
3566        } else if (typeof this._i === 'string') {
3567            var tZone = offsetFromString(matchOffset, this._i);
3568            if (tZone != null) {
3569                this.utcOffset(tZone);
3570            } else {
3571                this.utcOffset(0, true);
3572            }
3573        }
3574        return this;
3575    }
3576
3577    function hasAlignedHourOffset(input) {
3578        if (!this.isValid()) {
3579            return false;
3580        }
3581        input = input ? createLocal(input).utcOffset() : 0;
3582
3583        return (this.utcOffset() - input) % 60 === 0;
3584    }
3585
3586    function isDaylightSavingTime() {
3587        return (
3588            this.utcOffset() > this.clone().month(0).utcOffset() ||
3589            this.utcOffset() > this.clone().month(5).utcOffset()
3590        );
3591    }
3592
3593    function isDaylightSavingTimeShifted() {
3594        if (!isUndefined(this._isDSTShifted)) {
3595            return this._isDSTShifted;
3596        }
3597
3598        var c = {},
3599            other;
3600
3601        copyConfig(c, this);
3602        c = prepareConfig(c);
3603
3604        if (c._a) {
3605            other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
3606            this._isDSTShifted =
3607                this.isValid() && compareArrays(c._a, other.toArray()) > 0;
3608        } else {
3609            this._isDSTShifted = false;
3610        }
3611
3612        return this._isDSTShifted;
3613    }
3614
3615    function isLocal() {
3616        return this.isValid() ? !this._isUTC : false;
3617    }
3618
3619    function isUtcOffset() {
3620        return this.isValid() ? this._isUTC : false;
3621    }
3622
3623    function isUtc() {
3624        return this.isValid() ? this._isUTC && this._offset === 0 : false;
3625    }
3626
3627    // ASP.NET json date format regex
3628    var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
3629        // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
3630        // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
3631        // and further modified to allow for strings containing both week and day
3632        isoRegex =
3633            /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
3634
3635    function createDuration(input, key) {
3636        var duration = input,
3637            // matching against regexp is expensive, do it on demand
3638            match = null,
3639            sign,
3640            ret,
3641            diffRes;
3642
3643        if (isDuration(input)) {
3644            duration = {
3645                ms: input._milliseconds,
3646                d: input._days,
3647                M: input._months,
3648            };
3649        } else if (isNumber(input) || !isNaN(+input)) {
3650            duration = {};
3651            if (key) {
3652                duration[key] = +input;
3653            } else {
3654                duration.milliseconds = +input;
3655            }
3656        } else if ((match = aspNetRegex.exec(input))) {
3657            sign = match[1] === '-' ? -1 : 1;
3658            duration = {
3659                y: 0,
3660                d: toInt(match[DATE]) * sign,
3661                h: toInt(match[HOUR]) * sign,
3662                m: toInt(match[MINUTE]) * sign,
3663                s: toInt(match[SECOND]) * sign,
3664                ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match
3665            };
3666        } else if ((match = isoRegex.exec(input))) {
3667            sign = match[1] === '-' ? -1 : 1;
3668            duration = {
3669                y: parseIso(match[2], sign),
3670                M: parseIso(match[3], sign),
3671                w: parseIso(match[4], sign),
3672                d: parseIso(match[5], sign),
3673                h: parseIso(match[6], sign),
3674                m: parseIso(match[7], sign),
3675                s: parseIso(match[8], sign),
3676            };
3677        } else if (duration == null) {
3678            // checks for null or undefined
3679            duration = {};
3680        } else if (
3681            typeof duration === 'object' &&
3682            ('from' in duration || 'to' in duration)
3683        ) {
3684            diffRes = momentsDifference(
3685                createLocal(duration.from),
3686                createLocal(duration.to)
3687            );
3688
3689            duration = {};
3690            duration.ms = diffRes.milliseconds;
3691            duration.M = diffRes.months;
3692        }
3693
3694        ret = new Duration(duration);
3695
3696        if (isDuration(input) && hasOwnProp(input, '_locale')) {
3697            ret._locale = input._locale;
3698        }
3699
3700        if (isDuration(input) && hasOwnProp(input, '_isValid')) {
3701            ret._isValid = input._isValid;
3702        }
3703
3704        return ret;
3705    }
3706
3707    createDuration.fn = Duration.prototype;
3708    createDuration.invalid = createInvalid$1;
3709
3710    function parseIso(inp, sign) {
3711        // We'd normally use ~~inp for this, but unfortunately it also
3712        // converts floats to ints.
3713        // inp may be undefined, so careful calling replace on it.
3714        var res = inp && parseFloat(inp.replace(',', '.'));
3715        // apply sign while we're at it
3716        return (isNaN(res) ? 0 : res) * sign;
3717    }
3718
3719    function positiveMomentsDifference(base, other) {
3720        var res = {};
3721
3722        res.months =
3723            other.month() - base.month() + (other.year() - base.year()) * 12;
3724        if (base.clone().add(res.months, 'M').isAfter(other)) {
3725            --res.months;
3726        }
3727
3728        res.milliseconds = +other - +base.clone().add(res.months, 'M');
3729
3730        return res;
3731    }
3732
3733    function momentsDifference(base, other) {
3734        var res;
3735        if (!(base.isValid() && other.isValid())) {
3736            return { milliseconds: 0, months: 0 };
3737        }
3738
3739        other = cloneWithOffset(other, base);
3740        if (base.isBefore(other)) {
3741            res = positiveMomentsDifference(base, other);
3742        } else {
3743            res = positiveMomentsDifference(other, base);
3744            res.milliseconds = -res.milliseconds;
3745            res.months = -res.months;
3746        }
3747
3748        return res;
3749    }
3750
3751    // TODO: remove 'name' arg after deprecation is removed
3752    function createAdder(direction, name) {
3753        return function (val, period) {
3754            var dur, tmp;
3755            //invert the arguments, but complain about it
3756            if (period !== null && !isNaN(+period)) {
3757                deprecateSimple(
3758                    name,
3759                    'moment().' +
3760                        name +
3761                        '(period, number) is deprecated. Please use moment().' +
3762                        name +
3763                        '(number, period). ' +
3764                        'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'
3765                );
3766                tmp = val;
3767                val = period;
3768                period = tmp;
3769            }
3770
3771            dur = createDuration(val, period);
3772            addSubtract(this, dur, direction);
3773            return this;
3774        };
3775    }
3776
3777    function addSubtract(mom, duration, isAdding, updateOffset) {
3778        var milliseconds = duration._milliseconds,
3779            days = absRound(duration._days),
3780            months = absRound(duration._months);
3781
3782        if (!mom.isValid()) {
3783            // No op
3784            return;
3785        }
3786
3787        updateOffset = updateOffset == null ? true : updateOffset;
3788
3789        if (months) {
3790            setMonth(mom, get(mom, 'Month') + months * isAdding);
3791        }
3792        if (days) {
3793            set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
3794        }
3795        if (milliseconds) {
3796            mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
3797        }
3798        if (updateOffset) {
3799            hooks.updateOffset(mom, days || months);
3800        }
3801    }
3802
3803    var add = createAdder(1, 'add'),
3804        subtract = createAdder(-1, 'subtract');
3805
3806    function isString(input) {
3807        return typeof input === 'string' || input instanceof String;
3808    }
3809
3810    // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
3811    function isMomentInput(input) {
3812        return (
3813            isMoment(input) ||
3814            isDate(input) ||
3815            isString(input) ||
3816            isNumber(input) ||
3817            isNumberOrStringArray(input) ||
3818            isMomentInputObject(input) ||
3819            input === null ||
3820            input === undefined
3821        );
3822    }
3823
3824    function isMomentInputObject(input) {
3825        var objectTest = isObject(input) && !isObjectEmpty(input),
3826            propertyTest = false,
3827            properties = [
3828                'years',
3829                'year',
3830                'y',
3831                'months',
3832                'month',
3833                'M',
3834                'days',
3835                'day',
3836                'd',
3837                'dates',
3838                'date',
3839                'D',
3840                'hours',
3841                'hour',
3842                'h',
3843                'minutes',
3844                'minute',
3845                'm',
3846                'seconds',
3847                'second',
3848                's',
3849                'milliseconds',
3850                'millisecond',
3851                'ms',
3852            ],
3853            i,
3854            property,
3855            propertyLen = properties.length;
3856
3857        for (i = 0; i < propertyLen; i += 1) {
3858            property = properties[i];
3859            propertyTest = propertyTest || hasOwnProp(input, property);
3860        }
3861
3862        return objectTest && propertyTest;
3863    }
3864
3865    function isNumberOrStringArray(input) {
3866        var arrayTest = isArray(input),
3867            dataTypeTest = false;
3868        if (arrayTest) {
3869            dataTypeTest =
3870                input.filter(function (item) {
3871                    return !isNumber(item) && isString(input);
3872                }).length === 0;
3873        }
3874        return arrayTest && dataTypeTest;
3875    }
3876
3877    function isCalendarSpec(input) {
3878        var objectTest = isObject(input) && !isObjectEmpty(input),
3879            propertyTest = false,
3880            properties = [
3881                'sameDay',
3882                'nextDay',
3883                'lastDay',
3884                'nextWeek',
3885                'lastWeek',
3886                'sameElse',
3887            ],
3888            i,
3889            property;
3890
3891        for (i = 0; i < properties.length; i += 1) {
3892            property = properties[i];
3893            propertyTest = propertyTest || hasOwnProp(input, property);
3894        }
3895
3896        return objectTest && propertyTest;
3897    }
3898
3899    function getCalendarFormat(myMoment, now) {
3900        var diff = myMoment.diff(now, 'days', true);
3901        return diff < -6
3902            ? 'sameElse'
3903            : diff < -1
3904              ? 'lastWeek'
3905              : diff < 0
3906                ? 'lastDay'
3907                : diff < 1
3908                  ? 'sameDay'
3909                  : diff < 2
3910                    ? 'nextDay'
3911                    : diff < 7
3912                      ? 'nextWeek'
3913                      : 'sameElse';
3914    }
3915
3916    function calendar$1(time, formats) {
3917        // Support for single parameter, formats only overload to the calendar function
3918        if (arguments.length === 1) {
3919            if (!arguments[0]) {
3920                time = undefined;
3921                formats = undefined;
3922            } else if (isMomentInput(arguments[0])) {
3923                time = arguments[0];
3924                formats = undefined;
3925            } else if (isCalendarSpec(arguments[0])) {
3926                formats = arguments[0];
3927                time = undefined;
3928            }
3929        }
3930        // We want to compare the start of today, vs this.
3931        // Getting start-of-today depends on whether we're local/utc/offset or not.
3932        var now = time || createLocal(),
3933            sod = cloneWithOffset(now, this).startOf('day'),
3934            format = hooks.calendarFormat(this, sod) || 'sameElse',
3935            output =
3936                formats &&
3937                (isFunction(formats[format])
3938                    ? formats[format].call(this, now)
3939                    : formats[format]);
3940
3941        return this.format(
3942            output || this.localeData().calendar(format, this, createLocal(now))
3943        );
3944    }
3945
3946    function clone() {
3947        return new Moment(this);
3948    }
3949
3950    function isAfter(input, units) {
3951        var localInput = isMoment(input) ? input : createLocal(input);
3952        if (!(this.isValid() && localInput.isValid())) {
3953            return false;
3954        }
3955        units = normalizeUnits(units) || 'millisecond';
3956        if (units === 'millisecond') {
3957            return this.valueOf() > localInput.valueOf();
3958        } else {
3959            return localInput.valueOf() < this.clone().startOf(units).valueOf();
3960        }
3961    }
3962
3963    function isBefore(input, units) {
3964        var localInput = isMoment(input) ? input : createLocal(input);
3965        if (!(this.isValid() && localInput.isValid())) {
3966            return false;
3967        }
3968        units = normalizeUnits(units) || 'millisecond';
3969        if (units === 'millisecond') {
3970            return this.valueOf() < localInput.valueOf();
3971        } else {
3972            return this.clone().endOf(units).valueOf() < localInput.valueOf();
3973        }
3974    }
3975
3976    function isBetween(from, to, units, inclusivity) {
3977        var localFrom = isMoment(from) ? from : createLocal(from),
3978            localTo = isMoment(to) ? to : createLocal(to);
3979        if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
3980            return false;
3981        }
3982        inclusivity = inclusivity || '()';
3983        return (
3984            (inclusivity[0] === '('
3985                ? this.isAfter(localFrom, units)
3986                : !this.isBefore(localFrom, units)) &&
3987            (inclusivity[1] === ')'
3988                ? this.isBefore(localTo, units)
3989                : !this.isAfter(localTo, units))
3990        );
3991    }
3992
3993    function isSame(input, units) {
3994        var localInput = isMoment(input) ? input : createLocal(input),
3995            inputMs;
3996        if (!(this.isValid() && localInput.isValid())) {
3997            return false;
3998        }
3999        units = normalizeUnits(units) || 'millisecond';
4000        if (units === 'millisecond') {
4001            return this.valueOf() === localInput.valueOf();
4002        } else {
4003            inputMs = localInput.valueOf();
4004            return (
4005                this.clone().startOf(units).valueOf() <= inputMs &&
4006                inputMs <= this.clone().endOf(units).valueOf()
4007            );
4008        }
4009    }
4010
4011    function isSameOrAfter(input, units) {
4012        return this.isSame(input, units) || this.isAfter(input, units);
4013    }
4014
4015    function isSameOrBefore(input, units) {
4016        return this.isSame(input, units) || this.isBefore(input, units);
4017    }
4018
4019    function diff(input, units, asFloat) {
4020        var that, zoneDelta, output;
4021
4022        if (!this.isValid()) {
4023            return NaN;
4024        }
4025
4026        that = cloneWithOffset(input, this);
4027
4028        if (!that.isValid()) {
4029            return NaN;
4030        }
4031
4032        zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
4033
4034        units = normalizeUnits(units);
4035
4036        switch (units) {
4037            case 'year':
4038                output = monthDiff(this, that) / 12;
4039                break;
4040            case 'month':
4041                output = monthDiff(this, that);
4042                break;
4043            case 'quarter':
4044                output = monthDiff(this, that) / 3;
4045                break;
4046            case 'second':
4047                output = (this - that) / 1e3;
4048                break; // 1000
4049            case 'minute':
4050                output = (this - that) / 6e4;
4051                break; // 1000 * 60
4052            case 'hour':
4053                output = (this - that) / 36e5;
4054                break; // 1000 * 60 * 60
4055            case 'day':
4056                output = (this - that - zoneDelta) / 864e5;
4057                break; // 1000 * 60 * 60 * 24, negate dst
4058            case 'week':
4059                output = (this - that - zoneDelta) / 6048e5;
4060                break; // 1000 * 60 * 60 * 24 * 7, negate dst
4061            default:
4062                output = this - that;
4063        }
4064
4065        return asFloat ? output : absFloor(output);
4066    }
4067
4068    function monthDiff(a, b) {
4069        if (a.date() < b.date()) {
4070            // end-of-month calculations work correct when the start month has more
4071            // days than the end month.
4072            return -monthDiff(b, a);
4073        }
4074        // difference in months
4075        var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
4076            // b is in (anchor - 1 month, anchor + 1 month)
4077            anchor = a.clone().add(wholeMonthDiff, 'months'),
4078            anchor2,
4079            adjust;
4080
4081        if (b - anchor < 0) {
4082            anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
4083            // linear across the month
4084            adjust = (b - anchor) / (anchor - anchor2);
4085        } else {
4086            anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
4087            // linear across the month
4088            adjust = (b - anchor) / (anchor2 - anchor);
4089        }
4090
4091        //check for negative zero, return zero if negative zero
4092        return -(wholeMonthDiff + adjust) || 0;
4093    }
4094
4095    hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
4096    hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
4097
4098    function toString() {
4099        return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
4100    }
4101
4102    function toISOString(keepOffset) {
4103        if (!this.isValid()) {
4104            return null;
4105        }
4106        var utc = keepOffset !== true,
4107            m = utc ? this.clone().utc() : this;
4108        if (m.year() < 0 || m.year() > 9999) {
4109            return formatMoment(
4110                m,
4111                utc
4112                    ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'
4113                    : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'
4114            );
4115        }
4116        if (isFunction(Date.prototype.toISOString)) {
4117            // native implementation is ~50x faster, use it when we can
4118            if (utc) {
4119                return this.toDate().toISOString();
4120            } else {
4121                return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)
4122                    .toISOString()
4123                    .replace('Z', formatMoment(m, 'Z'));
4124            }
4125        }
4126        return formatMoment(
4127            m,
4128            utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'
4129        );
4130    }
4131
4132    /**
4133     * Return a human readable representation of a moment that can
4134     * also be evaluated to get a new moment which is the same
4135     *
4136     * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
4137     */
4138    function inspect() {
4139        if (!this.isValid()) {
4140            return 'moment.invalid(/* ' + this._i + ' */)';
4141        }
4142        var func = 'moment',
4143            zone = '',
4144            prefix,
4145            year,
4146            datetime,
4147            suffix;
4148        if (!this.isLocal()) {
4149            func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
4150            zone = 'Z';
4151        }
4152        prefix = '[' + func + '("]';
4153        year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
4154        datetime = '-MM-DD[T]HH:mm:ss.SSS';
4155        suffix = zone + '[")]';
4156
4157        return this.format(prefix + year + datetime + suffix);
4158    }
4159
4160    function format(inputString) {
4161        if (!inputString) {
4162            inputString = this.isUtc()
4163                ? hooks.defaultFormatUtc
4164                : hooks.defaultFormat;
4165        }
4166        var output = formatMoment(this, inputString);
4167        return this.localeData().postformat(output);
4168    }
4169
4170    function from(time, withoutSuffix) {
4171        if (
4172            this.isValid() &&
4173            ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
4174        ) {
4175            return createDuration({ to: this, from: time })
4176                .locale(this.locale())
4177                .humanize(!withoutSuffix);
4178        } else {
4179            return this.localeData().invalidDate();
4180        }
4181    }
4182
4183    function fromNow(withoutSuffix) {
4184        return this.from(createLocal(), withoutSuffix);
4185    }
4186
4187    function to(time, withoutSuffix) {
4188        if (
4189            this.isValid() &&
4190            ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
4191        ) {
4192            return createDuration({ from: this, to: time })
4193                .locale(this.locale())
4194                .humanize(!withoutSuffix);
4195        } else {
4196            return this.localeData().invalidDate();
4197        }
4198    }
4199
4200    function toNow(withoutSuffix) {
4201        return this.to(createLocal(), withoutSuffix);
4202    }
4203
4204    // If passed a locale key, it will set the locale for this
4205    // instance.  Otherwise, it will return the locale configuration
4206    // variables for this instance.
4207    function locale(key) {
4208        var newLocaleData;
4209
4210        if (key === undefined) {
4211            return this._locale._abbr;
4212        } else {
4213            newLocaleData = getLocale(key);
4214            if (newLocaleData != null) {
4215                this._locale = newLocaleData;
4216            }
4217            return this;
4218        }
4219    }
4220
4221    var lang = deprecate(
4222        'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
4223        function (key) {
4224            if (key === undefined) {
4225                return this.localeData();
4226            } else {
4227                return this.locale(key);
4228            }
4229        }
4230    );
4231
4232    function localeData() {
4233        return this._locale;
4234    }
4235
4236    var MS_PER_SECOND = 1000,
4237        MS_PER_MINUTE = 60 * MS_PER_SECOND,
4238        MS_PER_HOUR = 60 * MS_PER_MINUTE,
4239        MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
4240
4241    // actual modulo - handles negative numbers (for dates before 1970):
4242    function mod$1(dividend, divisor) {
4243        return ((dividend % divisor) + divisor) % divisor;
4244    }
4245
4246    function localStartOfDate(y, m, d) {
4247        // the date constructor remaps years 0-99 to 1900-1999
4248        if (y < 100 && y >= 0) {
4249            // preserve leap years using a full 400 year cycle, then reset
4250            return new Date(y + 400, m, d) - MS_PER_400_YEARS;
4251        } else {
4252            return new Date(y, m, d).valueOf();
4253        }
4254    }
4255
4256    function utcStartOfDate(y, m, d) {
4257        // Date.UTC remaps years 0-99 to 1900-1999
4258        if (y < 100 && y >= 0) {
4259            // preserve leap years using a full 400 year cycle, then reset
4260            return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
4261        } else {
4262            return Date.UTC(y, m, d);
4263        }
4264    }
4265
4266    function startOf(units) {
4267        var time, startOfDate;
4268        units = normalizeUnits(units);
4269        if (units === undefined || units === 'millisecond' || !this.isValid()) {
4270            return this;
4271        }
4272
4273        startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
4274
4275        switch (units) {
4276            case 'year':
4277                time = startOfDate(this.year(), 0, 1);
4278                break;
4279            case 'quarter':
4280                time = startOfDate(
4281                    this.year(),
4282                    this.month() - (this.month() % 3),
4283                    1
4284                );
4285                break;
4286            case 'month':
4287                time = startOfDate(this.year(), this.month(), 1);
4288                break;
4289            case 'week':
4290                time = startOfDate(
4291                    this.year(),
4292                    this.month(),
4293                    this.date() - this.weekday()
4294                );
4295                break;
4296            case 'isoWeek':
4297                time = startOfDate(
4298                    this.year(),
4299                    this.month(),
4300                    this.date() - (this.isoWeekday() - 1)
4301                );
4302                break;
4303            case 'day':
4304            case 'date':
4305                time = startOfDate(this.year(), this.month(), this.date());
4306                break;
4307            case 'hour':
4308                time = this._d.valueOf();
4309                time -= mod$1(
4310                    time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
4311                    MS_PER_HOUR
4312                );
4313                break;
4314            case 'minute':
4315                time = this._d.valueOf();
4316                time -= mod$1(time, MS_PER_MINUTE);
4317                break;
4318            case 'second':
4319                time = this._d.valueOf();
4320                time -= mod$1(time, MS_PER_SECOND);
4321                break;
4322        }
4323
4324        this._d.setTime(time);
4325        hooks.updateOffset(this, true);
4326        return this;
4327    }
4328
4329    function endOf(units) {
4330        var time, startOfDate;
4331        units = normalizeUnits(units);
4332        if (units === undefined || units === 'millisecond' || !this.isValid()) {
4333            return this;
4334        }
4335
4336        startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
4337
4338        switch (units) {
4339            case 'year':
4340                time = startOfDate(this.year() + 1, 0, 1) - 1;
4341                break;
4342            case 'quarter':
4343                time =
4344                    startOfDate(
4345                        this.year(),
4346                        this.month() - (this.month() % 3) + 3,
4347                        1
4348                    ) - 1;
4349                break;
4350            case 'month':
4351                time = startOfDate(this.year(), this.month() + 1, 1) - 1;
4352                break;
4353            case 'week':
4354                time =
4355                    startOfDate(
4356                        this.year(),
4357                        this.month(),
4358                        this.date() - this.weekday() + 7
4359                    ) - 1;
4360                break;
4361            case 'isoWeek':
4362                time =
4363                    startOfDate(
4364                        this.year(),
4365                        this.month(),
4366                        this.date() - (this.isoWeekday() - 1) + 7
4367                    ) - 1;
4368                break;
4369            case 'day':
4370            case 'date':
4371                time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
4372                break;
4373            case 'hour':
4374                time = this._d.valueOf();
4375                time +=
4376                    MS_PER_HOUR -
4377                    mod$1(
4378                        time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
4379                        MS_PER_HOUR
4380                    ) -
4381                    1;
4382                break;
4383            case 'minute':
4384                time = this._d.valueOf();
4385                time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
4386                break;
4387            case 'second':
4388                time = this._d.valueOf();
4389                time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
4390                break;
4391        }
4392
4393        this._d.setTime(time);
4394        hooks.updateOffset(this, true);
4395        return this;
4396    }
4397
4398    function valueOf() {
4399        return this._d.valueOf() - (this._offset || 0) * 60000;
4400    }
4401
4402    function unix() {
4403        return Math.floor(this.valueOf() / 1000);
4404    }
4405
4406    function toDate() {
4407        return new Date(this.valueOf());
4408    }
4409
4410    function toArray() {
4411        var m = this;
4412        return [
4413            m.year(),
4414            m.month(),
4415            m.date(),
4416            m.hour(),
4417            m.minute(),
4418            m.second(),
4419            m.millisecond(),
4420        ];
4421    }
4422
4423    function toObject() {
4424        var m = this;
4425        return {
4426            years: m.year(),
4427            months: m.month(),
4428            date: m.date(),
4429            hours: m.hours(),
4430            minutes: m.minutes(),
4431            seconds: m.seconds(),
4432            milliseconds: m.milliseconds(),
4433        };
4434    }
4435
4436    function toJSON() {
4437        // new Date(NaN).toJSON() === null
4438        return this.isValid() ? this.toISOString() : null;
4439    }
4440
4441    function isValid$2() {
4442        return isValid(this);
4443    }
4444
4445    function parsingFlags() {
4446        return extend({}, getParsingFlags(this));
4447    }
4448
4449    function invalidAt() {
4450        return getParsingFlags(this).overflow;
4451    }
4452
4453    function creationData() {
4454        return {
4455            input: this._i,
4456            format: this._f,
4457            locale: this._locale,
4458            isUTC: this._isUTC,
4459            strict: this._strict,
4460        };
4461    }
4462
4463    addFormatToken('N', 0, 0, 'eraAbbr');
4464    addFormatToken('NN', 0, 0, 'eraAbbr');
4465    addFormatToken('NNN', 0, 0, 'eraAbbr');
4466    addFormatToken('NNNN', 0, 0, 'eraName');
4467    addFormatToken('NNNNN', 0, 0, 'eraNarrow');
4468
4469    addFormatToken('y', ['y', 1], 'yo', 'eraYear');
4470    addFormatToken('y', ['yy', 2], 0, 'eraYear');
4471    addFormatToken('y', ['yyy', 3], 0, 'eraYear');
4472    addFormatToken('y', ['yyyy', 4], 0, 'eraYear');
4473
4474    addRegexToken('N', matchEraAbbr);
4475    addRegexToken('NN', matchEraAbbr);
4476    addRegexToken('NNN', matchEraAbbr);
4477    addRegexToken('NNNN', matchEraName);
4478    addRegexToken('NNNNN', matchEraNarrow);
4479
4480    addParseToken(
4481        ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'],
4482        function (input, array, config, token) {
4483            var era = config._locale.erasParse(input, token, config._strict);
4484            if (era) {
4485                getParsingFlags(config).era = era;
4486            } else {
4487                getParsingFlags(config).invalidEra = input;
4488            }
4489        }
4490    );
4491
4492    addRegexToken('y', matchUnsigned);
4493    addRegexToken('yy', matchUnsigned);
4494    addRegexToken('yyy', matchUnsigned);
4495    addRegexToken('yyyy', matchUnsigned);
4496    addRegexToken('yo', matchEraYearOrdinal);
4497
4498    addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);
4499    addParseToken(['yo'], function (input, array, config, token) {
4500        var match;
4501        if (config._locale._eraYearOrdinalRegex) {
4502            match = input.match(config._locale._eraYearOrdinalRegex);
4503        }
4504
4505        if (config._locale.eraYearOrdinalParse) {
4506            array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
4507        } else {
4508            array[YEAR] = parseInt(input, 10);
4509        }
4510    });
4511
4512    function localeEras(m, format) {
4513        var i,
4514            l,
4515            date,
4516            eras = this._eras || getLocale('en')._eras;
4517        for (i = 0, l = eras.length; i < l; ++i) {
4518            switch (typeof eras[i].since) {
4519                case 'string':
4520                    // truncate time
4521                    date = hooks(eras[i].since).startOf('day');
4522                    eras[i].since = date.valueOf();
4523                    break;
4524            }
4525
4526            switch (typeof eras[i].until) {
4527                case 'undefined':
4528                    eras[i].until = +Infinity;
4529                    break;
4530                case 'string':
4531                    // truncate time
4532                    date = hooks(eras[i].until).startOf('day').valueOf();
4533                    eras[i].until = date.valueOf();
4534                    break;
4535            }
4536        }
4537        return eras;
4538    }
4539
4540    function localeErasParse(eraName, format, strict) {
4541        var i,
4542            l,
4543            eras = this.eras(),
4544            name,
4545            abbr,
4546            narrow;
4547        eraName = eraName.toUpperCase();
4548
4549        for (i = 0, l = eras.length; i < l; ++i) {
4550            name = eras[i].name.toUpperCase();
4551            abbr = eras[i].abbr.toUpperCase();
4552            narrow = eras[i].narrow.toUpperCase();
4553
4554            if (strict) {
4555                switch (format) {
4556                    case 'N':
4557                    case 'NN':
4558                    case 'NNN':
4559                        if (abbr === eraName) {
4560                            return eras[i];
4561                        }
4562                        break;
4563
4564                    case 'NNNN':
4565                        if (name === eraName) {
4566                            return eras[i];
4567                        }
4568                        break;
4569
4570                    case 'NNNNN':
4571                        if (narrow === eraName) {
4572                            return eras[i];
4573                        }
4574                        break;
4575                }
4576            } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
4577                return eras[i];
4578            }
4579        }
4580    }
4581
4582    function localeErasConvertYear(era, year) {
4583        var dir = era.since <= era.until ? +1 : -1;
4584        if (year === undefined) {
4585            return hooks(era.since).year();
4586        } else {
4587            return hooks(era.since).year() + (year - era.offset) * dir;
4588        }
4589    }
4590
4591    function getEraName() {
4592        var i,
4593            l,
4594            val,
4595            eras = this.localeData().eras();
4596        for (i = 0, l = eras.length; i < l; ++i) {
4597            // truncate time
4598            val = this.clone().startOf('day').valueOf();
4599
4600            if (eras[i].since <= val && val <= eras[i].until) {
4601                return eras[i].name;
4602            }
4603            if (eras[i].until <= val && val <= eras[i].since) {
4604                return eras[i].name;
4605            }
4606        }
4607
4608        return '';
4609    }
4610
4611    function getEraNarrow() {
4612        var i,
4613            l,
4614            val,
4615            eras = this.localeData().eras();
4616        for (i = 0, l = eras.length; i < l; ++i) {
4617            // truncate time
4618            val = this.clone().startOf('day').valueOf();
4619
4620            if (eras[i].since <= val && val <= eras[i].until) {
4621                return eras[i].narrow;
4622            }
4623            if (eras[i].until <= val && val <= eras[i].since) {
4624                return eras[i].narrow;
4625            }
4626        }
4627
4628        return '';
4629    }
4630
4631    function getEraAbbr() {
4632        var i,
4633            l,
4634            val,
4635            eras = this.localeData().eras();
4636        for (i = 0, l = eras.length; i < l; ++i) {
4637            // truncate time
4638            val = this.clone().startOf('day').valueOf();
4639
4640            if (eras[i].since <= val && val <= eras[i].until) {
4641                return eras[i].abbr;
4642            }
4643            if (eras[i].until <= val && val <= eras[i].since) {
4644                return eras[i].abbr;
4645            }
4646        }
4647
4648        return '';
4649    }
4650
4651    function getEraYear() {
4652        var i,
4653            l,
4654            dir,
4655            val,
4656            eras = this.localeData().eras();
4657        for (i = 0, l = eras.length; i < l; ++i) {
4658            dir = eras[i].since <= eras[i].until ? +1 : -1;
4659
4660            // truncate time
4661            val = this.clone().startOf('day').valueOf();
4662
4663            if (
4664                (eras[i].since <= val && val <= eras[i].until) ||
4665                (eras[i].until <= val && val <= eras[i].since)
4666            ) {
4667                return (
4668                    (this.year() - hooks(eras[i].since).year()) * dir +
4669                    eras[i].offset
4670                );
4671            }
4672        }
4673
4674        return this.year();
4675    }
4676
4677    function erasNameRegex(isStrict) {
4678        if (!hasOwnProp(this, '_erasNameRegex')) {
4679            computeErasParse.call(this);
4680        }
4681        return isStrict ? this._erasNameRegex : this._erasRegex;
4682    }
4683
4684    function erasAbbrRegex(isStrict) {
4685        if (!hasOwnProp(this, '_erasAbbrRegex')) {
4686            computeErasParse.call(this);
4687        }
4688        return isStrict ? this._erasAbbrRegex : this._erasRegex;
4689    }
4690
4691    function erasNarrowRegex(isStrict) {
4692        if (!hasOwnProp(this, '_erasNarrowRegex')) {
4693            computeErasParse.call(this);
4694        }
4695        return isStrict ? this._erasNarrowRegex : this._erasRegex;
4696    }
4697
4698    function matchEraAbbr(isStrict, locale) {
4699        return locale.erasAbbrRegex(isStrict);
4700    }
4701
4702    function matchEraName(isStrict, locale) {
4703        return locale.erasNameRegex(isStrict);
4704    }
4705
4706    function matchEraNarrow(isStrict, locale) {
4707        return locale.erasNarrowRegex(isStrict);
4708    }
4709
4710    function matchEraYearOrdinal(isStrict, locale) {
4711        return locale._eraYearOrdinalRegex || matchUnsigned;
4712    }
4713
4714    function computeErasParse() {
4715        var abbrPieces = [],
4716            namePieces = [],
4717            narrowPieces = [],
4718            mixedPieces = [],
4719            i,
4720            l,
4721            erasName,
4722            erasAbbr,
vendor: 9,768 bytes, lines 4723-5062
4723            erasNarrow,
4724            eras = this.eras();
4725
4726        for (i = 0, l = eras.length; i < l; ++i) {
4727            erasName = regexEscape(eras[i].name);
4728            erasAbbr = regexEscape(eras[i].abbr);
4729            erasNarrow = regexEscape(eras[i].narrow);
4730
4731            namePieces.push(erasName);
4732            abbrPieces.push(erasAbbr);
4733            narrowPieces.push(erasNarrow);
4734            mixedPieces.push(erasName);
4735            mixedPieces.push(erasAbbr);
4736            mixedPieces.push(erasNarrow);
4737        }
4738
4739        this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
4740        this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
4741        this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
4742        this._erasNarrowRegex = new RegExp(
4743            '^(' + narrowPieces.join('|') + ')',
4744            'i'
4745        );
4746    }
4747
4748    // FORMATTING
4749
4750    addFormatToken(0, ['gg', 2], 0, function () {
4751        return this.weekYear() % 100;
4752    });
4753
4754    addFormatToken(0, ['GG', 2], 0, function () {
4755        return this.isoWeekYear() % 100;
4756    });
4757
4758    function addWeekYearFormatToken(token, getter) {
4759        addFormatToken(0, [token, token.length], 0, getter);
4760    }
4761
4762    addWeekYearFormatToken('gggg', 'weekYear');
4763    addWeekYearFormatToken('ggggg', 'weekYear');
4764    addWeekYearFormatToken('GGGG', 'isoWeekYear');
4765    addWeekYearFormatToken('GGGGG', 'isoWeekYear');
4766
4767    // ALIASES
4768
4769    // PARSING
4770
4771    addRegexToken('G', matchSigned);
4772    addRegexToken('g', matchSigned);
4773    addRegexToken('GG', match1to2, match2);
4774    addRegexToken('gg', match1to2, match2);
4775    addRegexToken('GGGG', match1to4, match4);
4776    addRegexToken('gggg', match1to4, match4);
4777    addRegexToken('GGGGG', match1to6, match6);
4778    addRegexToken('ggggg', match1to6, match6);
4779
4780    addWeekParseToken(
4781        ['gggg', 'ggggg', 'GGGG', 'GGGGG'],
4782        function (input, week, config, token) {
4783            week[token.substr(0, 2)] = toInt(input);
4784        }
4785    );
4786
4787    addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
4788        week[token] = hooks.parseTwoDigitYear(input);
4789    });
4790
4791    // MOMENTS
4792
4793    function getSetWeekYear(input) {
4794        return getSetWeekYearHelper.call(
4795            this,
4796            input,
4797            this.week(),
4798            this.weekday() + this.localeData()._week.dow,
4799            this.localeData()._week.dow,
4800            this.localeData()._week.doy
4801        );
4802    }
4803
4804    function getSetISOWeekYear(input) {
4805        return getSetWeekYearHelper.call(
4806            this,
4807            input,
4808            this.isoWeek(),
4809            this.isoWeekday(),
4810            1,
4811            4
4812        );
4813    }
4814
4815    function getISOWeeksInYear() {
4816        return weeksInYear(this.year(), 1, 4);
4817    }
4818
4819    function getISOWeeksInISOWeekYear() {
4820        return weeksInYear(this.isoWeekYear(), 1, 4);
4821    }
4822
4823    function getWeeksInYear() {
4824        var weekInfo = this.localeData()._week;
4825        return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
4826    }
4827
4828    function getWeeksInWeekYear() {
4829        var weekInfo = this.localeData()._week;
4830        return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
4831    }
4832
4833    function getSetWeekYearHelper(input, week, weekday, dow, doy) {
4834        var weeksTarget;
4835        if (input == null) {
4836            return weekOfYear(this, dow, doy).year;
4837        } else {
4838            weeksTarget = weeksInYear(input, dow, doy);
4839            if (week > weeksTarget) {
4840                week = weeksTarget;
4841            }
4842            return setWeekAll.call(this, input, week, weekday, dow, doy);
4843        }
4844    }
4845
4846    function setWeekAll(weekYear, week, weekday, dow, doy) {
4847        var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
4848            date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
4849
4850        this.year(date.getUTCFullYear());
4851        this.month(date.getUTCMonth());
4852        this.date(date.getUTCDate());
4853        return this;
4854    }
4855
4856    // FORMATTING
4857
4858    addFormatToken('Q', 0, 'Qo', 'quarter');
4859
4860    // PARSING
4861
4862    addRegexToken('Q', match1);
4863    addParseToken('Q', function (input, array) {
4864        array[MONTH] = (toInt(input) - 1) * 3;
4865    });
4866
4867    // MOMENTS
4868
4869    function getSetQuarter(input) {
4870        return input == null
4871            ? Math.ceil((this.month() + 1) / 3)
4872            : this.month((input - 1) * 3 + (this.month() % 3));
4873    }
4874
4875    // FORMATTING
4876
4877    addFormatToken('D', ['DD', 2], 'Do', 'date');
4878
4879    // PARSING
4880
4881    addRegexToken('D', match1to2, match1to2NoLeadingZero);
4882    addRegexToken('DD', match1to2, match2);
4883    addRegexToken('Do', function (isStrict, locale) {
4884        // TODO: Remove "ordinalParse" fallback in next major release.
4885        return isStrict
4886            ? locale._dayOfMonthOrdinalParse || locale._ordinalParse
4887            : locale._dayOfMonthOrdinalParseLenient;
4888    });
4889
4890    addParseToken(['D', 'DD'], DATE);
4891    addParseToken('Do', function (input, array) {
4892        array[DATE] = toInt(input.match(match1to2)[0]);
4893    });
4894
4895    // MOMENTS
4896
4897    var getSetDayOfMonth = makeGetSet('Date', true);
4898
4899    // FORMATTING
4900
4901    addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
4902
4903    // PARSING
4904
4905    addRegexToken('DDD', match1to3);
4906    addRegexToken('DDDD', match3);
4907    addParseToken(['DDD', 'DDDD'], function (input, array, config) {
4908        config._dayOfYear = toInt(input);
4909    });
4910
4911    // HELPERS
4912
4913    // MOMENTS
4914
4915    function getSetDayOfYear(input) {
4916        var dayOfYear =
4917            Math.round(
4918                (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5
4919            ) + 1;
4920        return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
4921    }
4922
4923    // FORMATTING
4924
4925    addFormatToken('m', ['mm', 2], 0, 'minute');
4926
4927    // PARSING
4928
4929    addRegexToken('m', match1to2, match1to2HasZero);
4930    addRegexToken('mm', match1to2, match2);
4931    addParseToken(['m', 'mm'], MINUTE);
4932
4933    // MOMENTS
4934
4935    var getSetMinute = makeGetSet('Minutes', false);
4936
4937    // FORMATTING
4938
4939    addFormatToken('s', ['ss', 2], 0, 'second');
4940
4941    // PARSING
4942
4943    addRegexToken('s', match1to2, match1to2HasZero);
4944    addRegexToken('ss', match1to2, match2);
4945    addParseToken(['s', 'ss'], SECOND);
4946
4947    // MOMENTS
4948
4949    var getSetSecond = makeGetSet('Seconds', false);
4950
4951    // FORMATTING
4952
4953    addFormatToken('S', 0, 0, function () {
4954        return ~~(this.millisecond() / 100);
4955    });
4956
4957    addFormatToken(0, ['SS', 2], 0, function () {
4958        return ~~(this.millisecond() / 10);
4959    });
4960
4961    addFormatToken(0, ['SSS', 3], 0, 'millisecond');
4962    addFormatToken(0, ['SSSS', 4], 0, function () {
4963        return this.millisecond() * 10;
4964    });
4965    addFormatToken(0, ['SSSSS', 5], 0, function () {
4966        return this.millisecond() * 100;
4967    });
4968    addFormatToken(0, ['SSSSSS', 6], 0, function () {
4969        return this.millisecond() * 1000;
4970    });
4971    addFormatToken(0, ['SSSSSSS', 7], 0, function () {
4972        return this.millisecond() * 10000;
4973    });
4974    addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
4975        return this.millisecond() * 100000;
4976    });
4977    addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
4978        return this.millisecond() * 1000000;
4979    });
4980
4981    // PARSING
4982
4983    addRegexToken('S', match1to3, match1);
4984    addRegexToken('SS', match1to3, match2);
4985    addRegexToken('SSS', match1to3, match3);
4986
4987    var token, getSetMillisecond;
4988    for (token = 'SSSS'; token.length <= 9; token += 'S') {
4989        addRegexToken(token, matchUnsigned);
4990    }
4991
4992    function parseMs(input, array) {
4993        array[MILLISECOND] = toInt(('0.' + input) * 1000);
4994    }
4995
4996    for (token = 'S'; token.length <= 9; token += 'S') {
4997        addParseToken(token, parseMs);
4998    }
4999
5000    getSetMillisecond = makeGetSet('Milliseconds', false);
5001
5002    // FORMATTING
5003
5004    addFormatToken('z', 0, 0, 'zoneAbbr');
5005    addFormatToken('zz', 0, 0, 'zoneName');
5006
5007    // MOMENTS
5008
5009    function getZoneAbbr() {
5010        return this._isUTC ? 'UTC' : '';
5011    }
5012
5013    function getZoneName() {
5014        return this._isUTC ? 'Coordinated Universal Time' : '';
5015    }
5016
5017    var proto = Moment.prototype;
5018
5019    proto.add = add;
5020    proto.calendar = calendar$1;
5021    proto.clone = clone;
5022    proto.diff = diff;
5023    proto.endOf = endOf;
5024    proto.format = format;
5025    proto.from = from;
5026    proto.fromNow = fromNow;
5027    proto.to = to;
5028    proto.toNow = toNow;
5029    proto.get = stringGet;
5030    proto.invalidAt = invalidAt;
5031    proto.isAfter = isAfter;
5032    proto.isBefore = isBefore;
5033    proto.isBetween = isBetween;
5034    proto.isSame = isSame;
5035    proto.isSameOrAfter = isSameOrAfter;
5036    proto.isSameOrBefore = isSameOrBefore;
5037    proto.isValid = isValid$2;
5038    proto.lang = lang;
5039    proto.locale = locale;
5040    proto.localeData = localeData;
5041    proto.max = prototypeMax;
5042    proto.min = prototypeMin;
5043    proto.parsingFlags = parsingFlags;
5044    proto.set = stringSet;
5045    proto.startOf = startOf;
5046    proto.subtract = subtract;
5047    proto.toArray = toArray;
5048    proto.toObject = toObject;
5049    proto.toDate = toDate;
5050    proto.toISOString = toISOString;
5051    proto.inspect = inspect;
5052    if (typeof Symbol !== 'undefined' && Symbol.for != null) {
5053        proto[Symbol.for('nodejs.util.inspect.custom')] = function () {
5054            return 'Moment<' + this.format() + '>';
5055        };
5056    }
5057    proto.toJSON = toJSON;
5058    proto.toString = toString;
5059    proto.unix = unix;
5060    proto.valueOf = valueOf;
5061    proto.creationData = creationData;
5062    proto.eraName = getEraName;
vendor: 4,096 bytes, lines 5063-5174
5063    proto.eraNarrow = getEraNarrow;
5064    proto.eraAbbr = getEraAbbr;
5065    proto.eraYear = getEraYear;
5066    proto.year = getSetYear;
5067    proto.isLeapYear = getIsLeapYear;
5068    proto.weekYear = getSetWeekYear;
5069    proto.isoWeekYear = getSetISOWeekYear;
5070    proto.quarter = proto.quarters = getSetQuarter;
5071    proto.month = getSetMonth;
5072    proto.daysInMonth = getDaysInMonth;
5073    proto.week = proto.weeks = getSetWeek;
5074    proto.isoWeek = proto.isoWeeks = getSetISOWeek;
5075    proto.weeksInYear = getWeeksInYear;
5076    proto.weeksInWeekYear = getWeeksInWeekYear;
5077    proto.isoWeeksInYear = getISOWeeksInYear;
5078    proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
5079    proto.date = getSetDayOfMonth;
5080    proto.day = proto.days = getSetDayOfWeek;
5081    proto.weekday = getSetLocaleDayOfWeek;
5082    proto.isoWeekday = getSetISODayOfWeek;
5083    proto.dayOfYear = getSetDayOfYear;
5084    proto.hour = proto.hours = getSetHour;
5085    proto.minute = proto.minutes = getSetMinute;
5086    proto.second = proto.seconds = getSetSecond;
5087    proto.millisecond = proto.milliseconds = getSetMillisecond;
5088    proto.utcOffset = getSetOffset;
5089    proto.utc = setOffsetToUTC;
5090    proto.local = setOffsetToLocal;
5091    proto.parseZone = setOffsetToParsedOffset;
5092    proto.hasAlignedHourOffset = hasAlignedHourOffset;
5093    proto.isDST = isDaylightSavingTime;
5094    proto.isLocal = isLocal;
5095    proto.isUtcOffset = isUtcOffset;
5096    proto.isUtc = isUtc;
5097    proto.isUTC = isUtc;
5098    proto.zoneAbbr = getZoneAbbr;
5099    proto.zoneName = getZoneName;
5100    proto.dates = deprecate(
5101        'dates accessor is deprecated. Use date instead.',
5102        getSetDayOfMonth
5103    );
5104    proto.months = deprecate(
5105        'months accessor is deprecated. Use month instead',
5106        getSetMonth
5107    );
5108    proto.years = deprecate(
5109        'years accessor is deprecated. Use year instead',
5110        getSetYear
5111    );
5112    proto.zone = deprecate(
5113        'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',
5114        getSetZone
5115    );
5116    proto.isDSTShifted = deprecate(
5117        'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',
5118        isDaylightSavingTimeShifted
5119    );
5120
5121    function createUnix(input) {
5122        return createLocal(input * 1000);
5123    }
5124
5125    function createInZone() {
5126        return createLocal.apply(null, arguments).parseZone();
5127    }
5128
5129    function preParsePostFormat(string) {
5130        return string;
5131    }
5132
5133    var proto$1 = Locale.prototype;
5134
5135    proto$1.calendar = calendar;
5136    proto$1.longDateFormat = longDateFormat;
5137    proto$1.invalidDate = invalidDate;
5138    proto$1.ordinal = ordinal;
5139    proto$1.preparse = preParsePostFormat;
5140    proto$1.postformat = preParsePostFormat;
5141    proto$1.relativeTime = relativeTime;
5142    proto$1.pastFuture = pastFuture;
5143    proto$1.set = set;
5144    proto$1.eras = localeEras;
5145    proto$1.erasParse = localeErasParse;
5146    proto$1.erasConvertYear = localeErasConvertYear;
5147    proto$1.erasAbbrRegex = erasAbbrRegex;
5148    proto$1.erasNameRegex = erasNameRegex;
5149    proto$1.erasNarrowRegex = erasNarrowRegex;
5150
5151    proto$1.months = localeMonths;
5152    proto$1.monthsShort = localeMonthsShort;
5153    proto$1.monthsParse = localeMonthsParse;
5154    proto$1.monthsRegex = monthsRegex;
5155    proto$1.monthsShortRegex = monthsShortRegex;
5156    proto$1.week = localeWeek;
5157    proto$1.firstDayOfYear = localeFirstDayOfYear;
5158    proto$1.firstDayOfWeek = localeFirstDayOfWeek;
5159
5160    proto$1.weekdays = localeWeekdays;
5161    proto$1.weekdaysMin = localeWeekdaysMin;
5162    proto$1.weekdaysShort = localeWeekdaysShort;
5163    proto$1.weekdaysParse = localeWeekdaysParse;
5164
5165    proto$1.weekdaysRegex = weekdaysRegex;
5166    proto$1.weekdaysShortRegex = weekdaysShortRegex;
5167    proto$1.weekdaysMinRegex = weekdaysMinRegex;
5168
5169    proto$1.isPM = localeIsPM;
5170    proto$1.meridiem = localeMeridiem;
5171
5172    function get$1(format, index, field, setter) {
5173        var locale = getLocale(),
5174            utc = createUTC().set(setter, index);
vendor: 11,821 bytes, lines 5175-5557
5175        return locale[field](utc, format);
5176    }
5177
5178    function listMonthsImpl(format, index, field) {
5179        if (isNumber(format)) {
5180            index = format;
5181            format = undefined;
5182        }
5183
5184        format = format || '';
5185
5186        if (index != null) {
5187            return get$1(format, index, field, 'month');
5188        }
5189
5190        var i,
5191            out = [];
5192        for (i = 0; i < 12; i++) {
5193            out[i] = get$1(format, i, field, 'month');
5194        }
5195        return out;
5196    }
5197
5198    // ()
5199    // (5)
5200    // (fmt, 5)
5201    // (fmt)
5202    // (true)
5203    // (true, 5)
5204    // (true, fmt, 5)
5205    // (true, fmt)
5206    function listWeekdaysImpl(localeSorted, format, index, field) {
5207        if (typeof localeSorted === 'boolean') {
5208            if (isNumber(format)) {
5209                index = format;
5210                format = undefined;
5211            }
5212
5213            format = format || '';
5214        } else {
5215            format = localeSorted;
5216            index = format;
5217            localeSorted = false;
5218
5219            if (isNumber(format)) {
5220                index = format;
5221                format = undefined;
5222            }
5223
5224            format = format || '';
5225        }
5226
5227        var locale = getLocale(),
5228            shift = localeSorted ? locale._week.dow : 0,
5229            i,
5230            out = [];
5231
5232        if (index != null) {
5233            return get$1(format, (index + shift) % 7, field, 'day');
5234        }
5235
5236        for (i = 0; i < 7; i++) {
5237            out[i] = get$1(format, (i + shift) % 7, field, 'day');
5238        }
5239        return out;
5240    }
5241
5242    function listMonths(format, index) {
5243        return listMonthsImpl(format, index, 'months');
5244    }
5245
5246    function listMonthsShort(format, index) {
5247        return listMonthsImpl(format, index, 'monthsShort');
5248    }
5249
5250    function listWeekdays(localeSorted, format, index) {
5251        return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
5252    }
5253
5254    function listWeekdaysShort(localeSorted, format, index) {
5255        return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
5256    }
5257
5258    function listWeekdaysMin(localeSorted, format, index) {
5259        return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
5260    }
5261
5262    getSetGlobalLocale('en', {
5263        eras: [
5264            {
5265                since: '0001-01-01',
5266                until: +Infinity,
5267                offset: 1,
5268                name: 'Anno Domini',
5269                narrow: 'AD',
5270                abbr: 'AD',
5271            },
5272            {
5273                since: '0000-12-31',
5274                until: -Infinity,
5275                offset: 1,
5276                name: 'Before Christ',
5277                narrow: 'BC',
5278                abbr: 'BC',
5279            },
5280        ],
5281        dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
5282        ordinal: function (number) {
5283            var b = number % 10,
5284                output =
5285                    toInt((number % 100) / 10) === 1
5286                        ? 'th'
5287                        : b === 1
5288                          ? 'st'
5289                          : b === 2
5290                            ? 'nd'
5291                            : b === 3
5292                              ? 'rd'
5293                              : 'th';
5294            return number + output;
5295        },
5296    });
5297
5298    // Side effect imports
5299
5300    hooks.lang = deprecate(
5301        'moment.lang is deprecated. Use moment.locale instead.',
5302        getSetGlobalLocale
5303    );
5304    hooks.langData = deprecate(
5305        'moment.langData is deprecated. Use moment.localeData instead.',
5306        getLocale
5307    );
5308
5309    var mathAbs = Math.abs;
5310
5311    function abs() {
5312        var data = this._data;
5313
5314        this._milliseconds = mathAbs(this._milliseconds);
5315        this._days = mathAbs(this._days);
5316        this._months = mathAbs(this._months);
5317
5318        data.milliseconds = mathAbs(data.milliseconds);
5319        data.seconds = mathAbs(data.seconds);
5320        data.minutes = mathAbs(data.minutes);
5321        data.hours = mathAbs(data.hours);
5322        data.months = mathAbs(data.months);
5323        data.years = mathAbs(data.years);
5324
5325        return this;
5326    }
5327
5328    function addSubtract$1(duration, input, value, direction) {
5329        var other = createDuration(input, value);
5330
5331        duration._milliseconds += direction * other._milliseconds;
5332        duration._days += direction * other._days;
5333        duration._months += direction * other._months;
5334
5335        return duration._bubble();
5336    }
5337
5338    // supports only 2.0-style add(1, 's') or add(duration)
5339    function add$1(input, value) {
5340        return addSubtract$1(this, input, value, 1);
5341    }
5342
5343    // supports only 2.0-style subtract(1, 's') or subtract(duration)
5344    function subtract$1(input, value) {
5345        return addSubtract$1(this, input, value, -1);
5346    }
5347
5348    function absCeil(number) {
5349        if (number < 0) {
5350            return Math.floor(number);
5351        } else {
5352            return Math.ceil(number);
5353        }
5354    }
5355
5356    function bubble() {
5357        var milliseconds = this._milliseconds,
5358            days = this._days,
5359            months = this._months,
5360            data = this._data,
5361            seconds,
5362            minutes,
5363            hours,
5364            years,
5365            monthsFromDays;
5366
5367        // if we have a mix of positive and negative values, bubble down first
5368        // check: https://github.com/moment/moment/issues/2166
5369        if (
5370            !(
5371                (milliseconds >= 0 && days >= 0 && months >= 0) ||
5372                (milliseconds <= 0 && days <= 0 && months <= 0)
5373            )
5374        ) {
5375            milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
5376            days = 0;
5377            months = 0;
5378        }
5379
5380        // The following code bubbles up values, see the tests for
5381        // examples of what that means.
5382        data.milliseconds = milliseconds % 1000;
5383
5384        seconds = absFloor(milliseconds / 1000);
5385        data.seconds = seconds % 60;
5386
5387        minutes = absFloor(seconds / 60);
5388        data.minutes = minutes % 60;
5389
5390        hours = absFloor(minutes / 60);
5391        data.hours = hours % 24;
5392
5393        days += absFloor(hours / 24);
5394
5395        // convert days to months
5396        monthsFromDays = absFloor(daysToMonths(days));
5397        months += monthsFromDays;
5398        days -= absCeil(monthsToDays(monthsFromDays));
5399
5400        // 12 months -> 1 year
5401        years = absFloor(months / 12);
5402        months %= 12;
5403
5404        data.days = days;
5405        data.months = months;
5406        data.years = years;
5407
5408        return this;
5409    }
5410
5411    function daysToMonths(days) {
5412        // 400 years have 146097 days (taking into account leap year rules)
5413        // 400 years have 12 months === 4800
5414        return (days * 4800) / 146097;
5415    }
5416
5417    function monthsToDays(months) {
5418        // the reverse of daysToMonths
5419        return (months * 146097) / 4800;
5420    }
5421
5422    function as(units) {
5423        if (!this.isValid()) {
5424            return NaN;
5425        }
5426        var days,
5427            months,
5428            milliseconds = this._milliseconds;
5429
5430        units = normalizeUnits(units);
5431
5432        if (units === 'month' || units === 'quarter' || units === 'year') {
5433            days = this._days + milliseconds / 864e5;
5434            months = this._months + daysToMonths(days);
5435            switch (units) {
5436                case 'month':
5437                    return months;
5438                case 'quarter':
5439                    return months / 3;
5440                case 'year':
5441                    return months / 12;
5442            }
5443        } else {
5444            // handle milliseconds separately because of floating point math errors (issue #1867)
5445            days = this._days + Math.round(monthsToDays(this._months));
5446            switch (units) {
5447                case 'week':
5448                    return days / 7 + milliseconds / 6048e5;
5449                case 'day':
5450                    return days + milliseconds / 864e5;
5451                case 'hour':
5452                    return days * 24 + milliseconds / 36e5;
5453                case 'minute':
5454                    return days * 1440 + milliseconds / 6e4;
5455                case 'second':
5456                    return days * 86400 + milliseconds / 1000;
5457                // Math.floor prevents floating point math errors here
5458                case 'millisecond':
5459                    return Math.floor(days * 864e5) + milliseconds;
5460                default:
5461                    throw new Error('Unknown unit ' + units);
5462            }
5463        }
5464    }
5465
5466    function makeAs(alias) {
5467        return function () {
5468            return this.as(alias);
5469        };
5470    }
5471
5472    var asMilliseconds = makeAs('ms'),
5473        asSeconds = makeAs('s'),
5474        asMinutes = makeAs('m'),
5475        asHours = makeAs('h'),
5476        asDays = makeAs('d'),
5477        asWeeks = makeAs('w'),
5478        asMonths = makeAs('M'),
5479        asQuarters = makeAs('Q'),
5480        asYears = makeAs('y'),
5481        valueOf$1 = asMilliseconds;
5482
5483    function clone$1() {
5484        return createDuration(this);
5485    }
5486
5487    function get$2(units) {
5488        units = normalizeUnits(units);
5489        return this.isValid() ? this[units + 's']() : NaN;
5490    }
5491
5492    function makeGetter(name) {
5493        return function () {
5494            return this.isValid() ? this._data[name] : NaN;
5495        };
5496    }
5497
5498    var milliseconds = makeGetter('milliseconds'),
5499        seconds = makeGetter('seconds'),
5500        minutes = makeGetter('minutes'),
5501        hours = makeGetter('hours'),
5502        days = makeGetter('days'),
5503        months = makeGetter('months'),
5504        years = makeGetter('years');
5505
5506    function weeks() {
5507        return absFloor(this.days() / 7);
5508    }
5509
5510    var round = Math.round,
5511        thresholds = {
5512            ss: 44, // a few seconds to seconds
5513            s: 45, // seconds to minute
5514            m: 45, // minutes to hour
5515            h: 22, // hours to day
5516            d: 26, // days to month/week
5517            w: null, // weeks to month
5518            M: 11, // months to year
5519        };
5520
5521    // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
5522    function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
5523        return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
5524    }
5525
5526    function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {
5527        var duration = createDuration(posNegDuration).abs(),
5528            seconds = round(duration.as('s')),
5529            minutes = round(duration.as('m')),
5530            hours = round(duration.as('h')),
5531            days = round(duration.as('d')),
5532            months = round(duration.as('M')),
5533            weeks = round(duration.as('w')),
5534            years = round(duration.as('y')),
5535            a =
5536                (seconds <= thresholds.ss && ['s', seconds]) ||
5537                (seconds < thresholds.s && ['ss', seconds]) ||
5538                (minutes <= 1 && ['m']) ||
5539                (minutes < thresholds.m && ['mm', minutes]) ||
5540                (hours <= 1 && ['h']) ||
5541                (hours < thresholds.h && ['hh', hours]) ||
5542                (days <= 1 && ['d']) ||
5543                (days < thresholds.d && ['dd', days]);
5544
5545        if (thresholds.w != null) {
5546            a =
5547                a ||
5548                (weeks <= 1 && ['w']) ||
5549                (weeks < thresholds.w && ['ww', weeks]);
5550        }
5551        a = a ||
5552            (months <= 1 && ['M']) ||
5553            (months < thresholds.M && ['MM', months]) ||
5554            (years <= 1 && ['y']) || ['yy', years];
5555
5556        a[2] = withoutSuffix;
5557        a[3] = +posNegDuration > 0;
vendor: 5,754 bytes, lines 5558-5739
5558        a[4] = locale;
5559        return substituteTimeAgo.apply(null, a);
5560    }
5561
5562    // This function allows you to set the rounding function for relative time strings
5563    function getSetRelativeTimeRounding(roundingFunction) {
5564        if (roundingFunction === undefined) {
5565            return round;
5566        }
5567        if (typeof roundingFunction === 'function') {
5568            round = roundingFunction;
5569            return true;
5570        }
5571        return false;
5572    }
5573
5574    // This function allows you to set a threshold for relative time strings
5575    function getSetRelativeTimeThreshold(threshold, limit) {
5576        if (thresholds[threshold] === undefined) {
5577            return false;
5578        }
5579        if (limit === undefined) {
5580            return thresholds[threshold];
5581        }
5582        thresholds[threshold] = limit;
5583        if (threshold === 's') {
5584            thresholds.ss = limit - 1;
5585        }
5586        return true;
5587    }
5588
5589    function humanize(argWithSuffix, argThresholds) {
5590        if (!this.isValid()) {
5591            return this.localeData().invalidDate();
5592        }
5593
5594        var withSuffix = false,
5595            th = thresholds,
5596            locale,
5597            output;
5598
5599        if (typeof argWithSuffix === 'object') {
5600            argThresholds = argWithSuffix;
5601            argWithSuffix = false;
5602        }
5603        if (typeof argWithSuffix === 'boolean') {
5604            withSuffix = argWithSuffix;
5605        }
5606        if (typeof argThresholds === 'object') {
5607            th = Object.assign({}, thresholds, argThresholds);
5608            if (argThresholds.s != null && argThresholds.ss == null) {
5609                th.ss = argThresholds.s - 1;
5610            }
5611        }
5612
5613        locale = this.localeData();
5614        output = relativeTime$1(this, !withSuffix, th, locale);
5615
5616        if (withSuffix) {
5617            output = locale.pastFuture(+this, output);
5618        }
5619
5620        return locale.postformat(output);
5621    }
5622
5623    var abs$1 = Math.abs;
5624
5625    function sign(x) {
5626        return (x > 0) - (x < 0) || +x;
5627    }
5628
5629    function toISOString$1() {
5630        // for ISO strings we do not use the normal bubbling rules:
5631        //  * milliseconds bubble up until they become hours
5632        //  * days do not bubble at all
5633        //  * months bubble up until they become years
5634        // This is because there is no context-free conversion between hours and days
5635        // (think of clock changes)
5636        // and also not between days and months (28-31 days per month)
5637        if (!this.isValid()) {
5638            return this.localeData().invalidDate();
5639        }
5640
5641        var seconds = abs$1(this._milliseconds) / 1000,
5642            days = abs$1(this._days),
5643            months = abs$1(this._months),
5644            minutes,
5645            hours,
5646            years,
5647            s,
5648            total = this.asSeconds(),
5649            totalSign,
5650            ymSign,
5651            daysSign,
5652            hmsSign;
5653
5654        if (!total) {
5655            // this is the same as C#'s (Noda) and python (isodate)...
5656            // but not other JS (goog.date)
5657            return 'P0D';
5658        }
5659
5660        // 3600 seconds -> 60 minutes -> 1 hour
5661        minutes = absFloor(seconds / 60);
5662        hours = absFloor(minutes / 60);
5663        seconds %= 60;
5664        minutes %= 60;
5665
5666        // 12 months -> 1 year
5667        years = absFloor(months / 12);
5668        months %= 12;
5669
5670        // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
5671        s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
5672
5673        totalSign = total < 0 ? '-' : '';
5674        ymSign = sign(this._months) !== sign(total) ? '-' : '';
5675        daysSign = sign(this._days) !== sign(total) ? '-' : '';
5676        hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
5677
5678        return (
5679            totalSign +
5680            'P' +
5681            (years ? ymSign + years + 'Y' : '') +
5682            (months ? ymSign + months + 'M' : '') +
5683            (days ? daysSign + days + 'D' : '') +
5684            (hours || minutes || seconds ? 'T' : '') +
5685            (hours ? hmsSign + hours + 'H' : '') +
5686            (minutes ? hmsSign + minutes + 'M' : '') +
5687            (seconds ? hmsSign + s + 'S' : '')
5688        );
5689    }
5690
5691    var proto$2 = Duration.prototype;
5692
5693    proto$2.isValid = isValid$1;
5694    proto$2.abs = abs;
5695    proto$2.add = add$1;
5696    proto$2.subtract = subtract$1;
5697    proto$2.as = as;
5698    proto$2.asMilliseconds = asMilliseconds;
5699    proto$2.asSeconds = asSeconds;
5700    proto$2.asMinutes = asMinutes;
5701    proto$2.asHours = asHours;
5702    proto$2.asDays = asDays;
5703    proto$2.asWeeks = asWeeks;
5704    proto$2.asMonths = asMonths;
5705    proto$2.asQuarters = asQuarters;
5706    proto$2.asYears = asYears;
5707    proto$2.valueOf = valueOf$1;
5708    proto$2._bubble = bubble;
5709    proto$2.clone = clone$1;
5710    proto$2.get = get$2;
5711    proto$2.milliseconds = milliseconds;
5712    proto$2.seconds = seconds;
5713    proto$2.minutes = minutes;
5714    proto$2.hours = hours;
5715    proto$2.days = days;
5716    proto$2.weeks = weeks;
5717    proto$2.months = months;
5718    proto$2.years = years;
5719    proto$2.humanize = humanize;
5720    proto$2.toISOString = toISOString$1;
5721    proto$2.toString = toISOString$1;
5722    proto$2.toJSON = toISOString$1;
5723    proto$2.locale = locale;
5724    proto$2.localeData = localeData;
5725
5726    proto$2.toIsoString = deprecate(
5727        'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',
5728        toISOString$1
5729    );
5730    proto$2.lang = lang;
5731
5732    // FORMATTING
5733
5734    addFormatToken('X', 0, 0, 'unix');
5735    addFormatToken('x', 0, 0, 'valueOf');
5736
5737    // PARSING
5738
5739    addRegexToken('x', matchSigned);
vendor: 8,354 bytes, lines 5740-5815
5740    addRegexToken('X', matchTimestamp);
5741    addParseToken('X', function (input, array, config) {
5742        config._d = new Date(parseFloat(input) * 1000);
5743    });
5744    addParseToken('x', function (input, array, config) {
5745        config._d = new Date(toInt(input));
5746    });
5747
5748    //! moment.js
5749
5750    hooks.version = '2.30.1';
5751
5752    setHookCallback(createLocal);
5753
5754    hooks.fn = proto;
5755    hooks.min = min;
5756    hooks.max = max;
5757    hooks.now = now;
5758    hooks.utc = createUTC;
5759    hooks.unix = createUnix;
5760    hooks.months = listMonths;
5761    hooks.isDate = isDate;
5762    hooks.locale = getSetGlobalLocale;
5763    hooks.invalid = createInvalid;
5764    hooks.duration = createDuration;
5765    hooks.isMoment = isMoment;
5766    hooks.weekdays = listWeekdays;
5767    hooks.parseZone = createInZone;
5768    hooks.localeData = getLocale;
5769    hooks.isDuration = isDuration;
5770    hooks.monthsShort = listMonthsShort;
5771    hooks.weekdaysMin = listWeekdaysMin;
5772    hooks.defineLocale = defineLocale;
5773    hooks.updateLocale = updateLocale;
5774    hooks.locales = listLocales;
5775    hooks.weekdaysShort = listWeekdaysShort;
5776    hooks.normalizeUnits = normalizeUnits;
5777    hooks.relativeTimeRounding = getSetRelativeTimeRounding;
5778    hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
5779    hooks.calendarFormat = getCalendarFormat;
5780    hooks.prototype = proto;
5781
5782    // currently HTML5 input type only supports 24-hour formats
5783    hooks.HTML5_FMT = {
5784        DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
5785        DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
5786        DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
5787        DATE: 'YYYY-MM-DD', // <input type="date" />
5788        TIME: 'HH:mm', // <input type="time" />
5789        TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
5790        TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
5791        WEEK: 'GGGG-[W]WW', // <input type="week" />
5792        MONTH: 'YYYY-MM', // <input type="month" />
5793    };
5794
5795    return hooks;
5796
5797})));
5798
5799/*  lo-dash  */
5800/**
5801 * @license
5802 * Lodash <https://lodash.com/>
5803 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
5804 * Released under MIT license <https://lodash.com/license>
5805 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
5806 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
5807 */
5808(function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function r(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&t(n[r],r,n)!==!1;);return n}function e(n,t){for(var r=null==n?0:n.length;r--&&t(n[r],r,n)!==!1;);return n}function u(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return!1;
5809return!0}function i(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function o(n,t){return!!(null==n?0:n.length)&&y(n,t,0)>-1}function f(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return!0;return!1}function c(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function a(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function l(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);
5810return r}function s(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function h(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return!0;return!1}function p(n){return n.split("")}function _(n){return n.match($t)||[]}function v(n,t,r){var e;return r(n,function(n,r,u){if(t(n,r,u))return e=r,!1}),e}function g(n,t,r,e){for(var u=n.length,i=r+(e?1:-1);e?i--:++i<u;)if(t(n[i],i,n))return i;return-1}function y(n,t,r){return t===t?Z(n,t,r):g(n,b,r)}function d(n,t,r,e){
5811for(var u=r-1,i=n.length;++u<i;)if(e(n[u],t))return u;return-1}function b(n){return n!==n}function w(n,t){var r=null==n?0:n.length;return r?k(n,t)/r:Cn}function m(n){return function(t){return null==t?X:t[n]}}function x(n){return function(t){return null==n?X:n[t]}}function j(n,t,r,e,u){return u(n,function(n,u,i){r=e?(e=!1,n):t(r,n,u,i)}),r}function A(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].value;return n}function k(n,t){for(var r,e=-1,u=n.length;++e<u;){var i=t(n[e]);i!==X&&(r=r===X?i:r+i);
5812}return r}function O(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function I(n,t){return c(t,function(t){return[t,n[t]]})}function R(n){return n?n.slice(0,H(n)+1).replace(Lt,""):n}function z(n){return function(t){return n(t)}}function E(n,t){return c(t,function(t){return n[t]})}function S(n,t){return n.has(t)}function W(n,t){for(var r=-1,e=n.length;++r<e&&y(t,n[r],0)>-1;);return r}function L(n,t){for(var r=n.length;r--&&y(t,n[r],0)>-1;);return r}function C(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e;
5813return e}function U(n){return"\\"+Yr[n]}function B(n,t){return null==n?X:n[t]}function T(n){return Nr.test(n)}function $(n){return Pr.test(n)}function D(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}function M(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function F(n,t){return function(r){return n(t(r))}}function N(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r];o!==t&&o!==cn||(n[r]=cn,i[u++]=r)}return i}function P(n){var t=-1,r=Array(n.size);
5814return n.forEach(function(n){r[++t]=n}),r}function q(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=[n,n]}),r}function Z(n,t,r){for(var e=r-1,u=n.length;++e<u;)if(n[e]===t)return e;return-1}function K(n,t,r){for(var e=r+1;e--;)if(n[e]===t)return e;return e}function V(n){return T(n)?J(n):_e(n)}function G(n){return T(n)?Y(n):p(n)}function H(n){for(var t=n.length;t--&&Ct.test(n.charAt(t)););return t}function J(n){for(var t=Mr.lastIndex=0;Mr.test(n);)++t;return t}function Y(n){return n.match(Mr)||[];
5815}function Q(n){return n.match(Fr)||[]}var X,nn="4.17.21",tn=200,rn="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",en="Expected a function",un="Invalid `variable` option passed into `_.template`",on="__lodash_hash_undefined__",fn=500,cn="__lodash_placeholder__",an=1,ln=2,sn=4,hn=1,pn=2,_n=1,vn=2,gn=4,yn=8,dn=16,bn=32,wn=64,mn=128,xn=256,jn=512,An=30,kn="...",On=800,In=16,Rn=1,zn=2,En=3,Sn=1/0,Wn=9007199254740991,Ln=1.7976931348623157e308,Cn=NaN,Un=4294967295,Bn=Un-1,Tn=Un>>>1,$n=[["ary",mn],["bind",_n],["bindKey",vn],["curry",yn],["curryRight",dn],["flip",jn],["partial",bn],["partialRight",wn],["rearg",xn]],Dn="[object Arguments]",Mn="[object Array]",Fn="[object AsyncFunction]",Nn="[object Boolean]",Pn="[object Date]",qn="[object DOMException]",Zn="[object Error]",Kn="[object Function]",Vn="[object GeneratorFunction]",Gn="[object Map]",Hn="[object Number]",Jn="[object Null]",Yn="[object Object]",Qn="[object Promise]",Xn="[object Proxy]",nt="[object RegExp]",tt="[object Set]",rt="[object String]",et="[object Symbol]",ut="[object Undefined]",it="[object WeakMap]",ot="[object WeakSet]",ft="[object ArrayBuffer]",ct="[object DataView]",at="[object Float32Array]",lt="[object Float64Array]",st="[object Int8Array]",ht="[object Int16Array]",pt="[object Int32Array]",_t="[object Uint8Array]",vt="[object Uint8ClampedArray]",gt="[object Uint16Array]",yt="[object Uint32Array]",dt=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,wt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mt=/&(?:amp|lt|gt|quot|#39);/g,xt=/[&<>"']/g,jt=RegExp(mt.source),At=RegExp(xt.source),kt=/<%-([\s\S]+?)%>/g,Ot=/<%([\s\S]+?)%>/g,It=/<%=([\s\S]+?)%>/g,Rt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zt=/^\w*$/,Et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,St=/[\\^$.*+?()[\]{}|]/g,Wt=RegExp(St.source),Lt=/^\s+/,Ct=/\s/,Ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bt=/\{\n\/\* \[wrapped with (.+)\] \*/,Tt=/,? & /,$t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dt=/[()=,{}\[\]\/\s]/,Mt=/\\(\\)?/g,Ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Nt=/\w*$/,Pt=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,Zt=/^\[object .+?Constructor\]$/,Kt=/^0o[0-7]+$/i,Vt=/^(?:0|[1-9]\d*)$/,Gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 5,178 bytes, lines 5815-5821
58157f]/g,Ht=/($^)/,Jt=/['\n\r\u2028\u2029\\]/g,Yt="\\ud800-\\udfff",Qt="\\u0300-\\u036f",Xt="\\ufe20-\\ufe2f",nr="\\u20d0-\\u20ff",tr=Qt+Xt+nr,rr="\\u2700-\\u27bf",er="a-z\\xdf-\\xf6\\xf8-\\xff",ur="\\xac\\xb1\\xd7\\xf7",ir="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",or="\\u2000-\\u206f",fr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",cr="A-Z\\xc0-\\xd6\\xd8-\\xde",ar="\\ufe0e\\ufe0f",lr=ur+ir+or+fr,sr="['\u2019]",hr="["+Yt+"]",pr="["+lr+"]",_r="["+tr+"]",vr="\\d+",gr="["+rr+"]",yr="["+er+"]",dr="[^"+Yt+lr+vr+rr+er+cr+"]",br="\\ud83c[\\udffb-\\udfff]",wr="(?:"+_r+"|"+br+")",mr="[^"+Yt+"]",xr="(?:\\ud83c[\\udde6-\\uddff]){2}",jr="[\\ud800-\\udbff][\\udc00-\\udfff]",Ar="["+cr+"]",kr="\\u200d",Or="(?:"+yr+"|"+dr+")",Ir="(?:"+Ar+"|"+dr+")",Rr="(?:"+sr+"(?:d|ll|m|re|s|t|ve))?",zr="(?:"+sr+"(?:D|LL|M|RE|S|T|VE))?",Er=wr+"?",Sr="["+ar+"]?",Wr="(?:"+kr+"(?:"+[mr,xr,jr].join("|")+")"+Sr+Er+")*",Lr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Cr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ur=Sr+Er+Wr,Br="(?:"+[gr,xr,jr].join("|")+")"+Ur,Tr="(?:"+[mr+_r+"?",_r,xr,jr,hr].join("|")+")",$r=RegExp(sr,"g"),Dr=RegExp(_r,"g"),Mr=RegExp(br+"(?="+br+")|"+Tr+Ur,"g"),Fr=RegExp([Ar+"?"+yr+"+"+Rr+"(?="+[pr,Ar,"$"].join("|")+")",Ir+"+"+zr+"(?="+[pr,Ar+Or,"$"].join("|")+")",Ar+"?"+Or+"+"+Rr,Ar+"+"+zr,Cr,Lr,vr,Br].join("|"),"g"),Nr=RegExp("["+kr+Yt+tr+ar+"]"),Pr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Zr=-1,Kr={};
5816Kr[at]=Kr[lt]=Kr[st]=Kr[ht]=Kr[pt]=Kr[_t]=Kr[vt]=Kr[gt]=Kr[yt]=!0,Kr[Dn]=Kr[Mn]=Kr[ft]=Kr[Nn]=Kr[ct]=Kr[Pn]=Kr[Zn]=Kr[Kn]=Kr[Gn]=Kr[Hn]=Kr[Yn]=Kr[nt]=Kr[tt]=Kr[rt]=Kr[it]=!1;var Vr={};Vr[Dn]=Vr[Mn]=Vr[ft]=Vr[ct]=Vr[Nn]=Vr[Pn]=Vr[at]=Vr[lt]=Vr[st]=Vr[ht]=Vr[pt]=Vr[Gn]=Vr[Hn]=Vr[Yn]=Vr[nt]=Vr[tt]=Vr[rt]=Vr[et]=Vr[_t]=Vr[vt]=Vr[gt]=Vr[yt]=!0,Vr[Zn]=Vr[Kn]=Vr[it]=!1;var Gr={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a",
5817"\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae",
5818"\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g",
5819"\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O",
5820"\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w",
5821"\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"},Hr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Jr={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Yr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Qr=parseFloat,Xr=parseInt,ne="object"==typeof global&&global&&global.Object===Object&&global,te="object"==typeof self&&self&&self.Object===Object&&self,re=ne||te||Function("return this")(),ee="object"==typeof exports&&exports&&!exports.nodeType&&exports,ue=ee&&"object"==typeof module&&module&&!module.nodeType&&module,ie=ue&&ue.exports===ee,oe
vendor: 33,626 bytes, lines 5821-5887
5821=ie&&ne.process,fe=function(){
5822try{var n=ue&&ue.require&&ue.require("util").types;return n?n:oe&&oe.binding&&oe.binding("util")}catch(n){}}(),ce=fe&&fe.isArrayBuffer,ae=fe&&fe.isDate,le=fe&&fe.isMap,se=fe&&fe.isRegExp,he=fe&&fe.isSet,pe=fe&&fe.isTypedArray,_e=m("length"),ve=x(Gr),ge=x(Hr),ye=x(Jr),de=function p(x){function Z(n){if(cc(n)&&!bh(n)&&!(n instanceof Ct)){if(n instanceof Y)return n;if(bl.call(n,"__wrapped__"))return eo(n)}return new Y(n)}function J(){}function Y(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,
5823this.__index__=0,this.__values__=X}function Ct(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Un,this.__views__=[]}function $t(){var n=new Ct(this.__wrapped__);return n.__actions__=Tu(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Tu(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Tu(this.__views__),n}function Yt(){if(this.__filtered__){var n=new Ct(this);n.__dir__=-1,
5824n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function Qt(){var n=this.__wrapped__.value(),t=this.__dir__,r=bh(n),e=t<0,u=r?n.length:0,i=Oi(0,u,this.__views__),o=i.start,f=i.end,c=f-o,a=e?f:o-1,l=this.__iteratees__,s=l.length,h=0,p=Hl(c,this.__takeCount__);if(!r||!e&&u==c&&p==c)return wu(n,this.__actions__);var _=[];n:for(;c--&&h<p;){a+=t;for(var v=-1,g=n[a];++v<s;){var y=l[v],d=y.iteratee,b=y.type,w=d(g);if(b==zn)g=w;else if(!w){if(b==Rn)continue n;break n}}_[h++]=g}return _}function Xt(n){
5825var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function nr(){this.__data__=is?is(null):{},this.size=0}function tr(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}function rr(n){var t=this.__data__;if(is){var r=t[n];return r===on?X:r}return bl.call(t,n)?t[n]:X}function er(n){var t=this.__data__;return is?t[n]!==X:bl.call(t,n)}function ur(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=is&&t===X?on:t,this}function ir(n){
5826var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function or(){this.__data__=[],this.size=0}function fr(n){var t=this.__data__,r=Wr(t,n);return!(r<0)&&(r==t.length-1?t.pop():Ll.call(t,r,1),--this.size,!0)}function cr(n){var t=this.__data__,r=Wr(t,n);return r<0?X:t[r][1]}function ar(n){return Wr(this.__data__,n)>-1}function lr(n,t){var r=this.__data__,e=Wr(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this}function sr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){
5827var e=n[t];this.set(e[0],e[1])}}function hr(){this.size=0,this.__data__={hash:new Xt,map:new(ts||ir),string:new Xt}}function pr(n){var t=xi(this,n).delete(n);return this.size-=t?1:0,t}function _r(n){return xi(this,n).get(n)}function vr(n){return xi(this,n).has(n)}function gr(n,t){var r=xi(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this}function yr(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new sr;++t<r;)this.add(n[t])}function dr(n){return this.__data__.set(n,on),this}function br(n){
5828return this.__data__.has(n)}function wr(n){this.size=(this.__data__=new ir(n)).size}function mr(){this.__data__=new ir,this.size=0}function xr(n){var t=this.__data__,r=t.delete(n);return this.size=t.size,r}function jr(n){return this.__data__.get(n)}function Ar(n){return this.__data__.has(n)}function kr(n,t){var r=this.__data__;if(r instanceof ir){var e=r.__data__;if(!ts||e.length<tn-1)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new sr(e)}return r.set(n,t),this.size=r.size,this}function Or(n,t){
5829var r=bh(n),e=!r&&dh(n),u=!r&&!e&&mh(n),i=!r&&!e&&!u&&Oh(n),o=r||e||u||i,f=o?O(n.length,hl):[],c=f.length;for(var a in n)!t&&!bl.call(n,a)||o&&("length"==a||u&&("offset"==a||"parent"==a)||i&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||Ci(a,c))||f.push(a);return f}function Ir(n){var t=n.length;return t?n[tu(0,t-1)]:X}function Rr(n,t){return Xi(Tu(n),Mr(t,0,n.length))}function zr(n){return Xi(Tu(n))}function Er(n,t,r){(r===X||Gf(n[t],r))&&(r!==X||t in n)||Br(n,t,r)}function Sr(n,t,r){var e=n[t];
5830bl.call(n,t)&&Gf(e,r)&&(r!==X||t in n)||Br(n,t,r)}function Wr(n,t){for(var r=n.length;r--;)if(Gf(n[r][0],t))return r;return-1}function Lr(n,t,r,e){return ys(n,function(n,u,i){t(e,n,r(n),i)}),e}function Cr(n,t){return n&&$u(t,Pc(t),n)}function Ur(n,t){return n&&$u(t,qc(t),n)}function Br(n,t,r){"__proto__"==t&&Tl?Tl(n,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):n[t]=r}function Tr(n,t){for(var r=-1,e=t.length,u=il(e),i=null==n;++r<e;)u[r]=i?X:Mc(n,t[r]);return u}function Mr(n,t,r){return n===n&&(r!==X&&(n=n<=r?n:r),
5831t!==X&&(n=n>=t?n:t)),n}function Fr(n,t,e,u,i,o){var f,c=t&an,a=t&ln,l=t&sn;if(e&&(f=i?e(n,u,i,o):e(n)),f!==X)return f;if(!fc(n))return n;var s=bh(n);if(s){if(f=zi(n),!c)return Tu(n,f)}else{var h=zs(n),p=h==Kn||h==Vn;if(mh(n))return Iu(n,c);if(h==Yn||h==Dn||p&&!i){if(f=a||p?{}:Ei(n),!c)return a?Mu(n,Ur(f,n)):Du(n,Cr(f,n))}else{if(!Vr[h])return i?n:{};f=Si(n,h,c)}}o||(o=new wr);var _=o.get(n);if(_)return _;o.set(n,f),kh(n)?n.forEach(function(r){f.add(Fr(r,t,e,r,n,o))}):jh(n)&&n.forEach(function(r,u){
5832f.set(u,Fr(r,t,e,u,n,o))});var v=l?a?di:yi:a?qc:Pc,g=s?X:v(n);return r(g||n,function(r,u){g&&(u=r,r=n[u]),Sr(f,u,Fr(r,t,e,u,n,o))}),f}function Nr(n){var t=Pc(n);return function(r){return Pr(r,n,t)}}function Pr(n,t,r){var e=r.length;if(null==n)return!e;for(n=ll(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===X&&!(u in n)||!i(o))return!1}return!0}function Gr(n,t,r){if("function"!=typeof n)throw new pl(en);return Ws(function(){n.apply(X,r)},t)}function Hr(n,t,r,e){var u=-1,i=o,a=!0,l=n.length,s=[],h=t.length;
5833if(!l)return s;r&&(t=c(t,z(r))),e?(i=f,a=!1):t.length>=tn&&(i=S,a=!1,t=new yr(t));n:for(;++u<l;){var p=n[u],_=null==r?p:r(p);if(p=e||0!==p?p:0,a&&_===_){for(var v=h;v--;)if(t[v]===_)continue n;s.push(p)}else i(t,_,e)||s.push(p)}return s}function Jr(n,t){var r=!0;return ys(n,function(n,e,u){return r=!!t(n,e,u)}),r}function Yr(n,t,r){for(var e=-1,u=n.length;++e<u;){var i=n[e],o=t(i);if(null!=o&&(f===X?o===o&&!bc(o):r(o,f)))var f=o,c=i}return c}function ne(n,t,r,e){var u=n.length;for(r=kc(r),r<0&&(r=-r>u?0:u+r),
5834e=e===X||e>u?u:kc(e),e<0&&(e+=u),e=r>e?0:Oc(e);r<e;)n[r++]=t;return n}function te(n,t){var r=[];return ys(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function ee(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=Li),u||(u=[]);++i<o;){var f=n[i];t>0&&r(f)?t>1?ee(f,t-1,r,e,u):a(u,f):e||(u[u.length]=f)}return u}function ue(n,t){return n&&bs(n,t,Pc)}function oe(n,t){return n&&ws(n,t,Pc)}function fe(n,t){return i(t,function(t){return uc(n[t])})}function _e(n,t){t=ku(t,n);for(var r=0,e=t.length;null!=n&&r<e;)n=n[no(t[r++])];
5835return r&&r==e?n:X}function de(n,t,r){var e=t(n);return bh(n)?e:a(e,r(n))}function we(n){return null==n?n===X?ut:Jn:Bl&&Bl in ll(n)?ki(n):Ki(n)}function me(n,t){return n>t}function xe(n,t){return null!=n&&bl.call(n,t)}function je(n,t){return null!=n&&t in ll(n)}function Ae(n,t,r){return n>=Hl(t,r)&&n<Gl(t,r)}function ke(n,t,r){for(var e=r?f:o,u=n[0].length,i=n.length,a=i,l=il(i),s=1/0,h=[];a--;){var p=n[a];a&&t&&(p=c(p,z(t))),s=Hl(p.length,s),l[a]=!r&&(t||u>=120&&p.length>=120)?new yr(a&&p):X}p=n[0];
5836var _=-1,v=l[0];n:for(;++_<u&&h.length<s;){var g=p[_],y=t?t(g):g;if(g=r||0!==g?g:0,!(v?S(v,y):e(h,y,r))){for(a=i;--a;){var d=l[a];if(!(d?S(d,y):e(n[a],y,r)))continue n}v&&v.push(y),h.push(g)}}return h}function Oe(n,t,r,e){return ue(n,function(n,u,i){t(e,r(n),u,i)}),e}function Ie(t,r,e){r=ku(r,t),t=Gi(t,r);var u=null==t?t:t[no(jo(r))];return null==u?X:n(u,t,e)}function Re(n){return cc(n)&&we(n)==Dn}function ze(n){return cc(n)&&we(n)==ft}function Ee(n){return cc(n)&&we(n)==Pn}function Se(n,t,r,e,u){
5837return n===t||(null==n||null==t||!cc(n)&&!cc(t)?n!==n&&t!==t:We(n,t,r,e,Se,u))}function We(n,t,r,e,u,i){var o=bh(n),f=bh(t),c=o?Mn:zs(n),a=f?Mn:zs(t);c=c==Dn?Yn:c,a=a==Dn?Yn:a;var l=c==Yn,s=a==Yn,h=c==a;if(h&&mh(n)){if(!mh(t))return!1;o=!0,l=!1}if(h&&!l)return i||(i=new wr),o||Oh(n)?pi(n,t,r,e,u,i):_i(n,t,c,r,e,u,i);if(!(r&hn)){var p=l&&bl.call(n,"__wrapped__"),_=s&&bl.call(t,"__wrapped__");if(p||_){var v=p?n.value():n,g=_?t.value():t;return i||(i=new wr),u(v,g,r,e,i)}}return!!h&&(i||(i=new wr),vi(n,t,r,e,u,i));
5838}function Le(n){return cc(n)&&zs(n)==Gn}function Ce(n,t,r,e){var u=r.length,i=u,o=!e;if(null==n)return!i;for(n=ll(n);u--;){var f=r[u];if(o&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++u<i;){f=r[u];var c=f[0],a=n[c],l=f[1];if(o&&f[2]){if(a===X&&!(c in n))return!1}else{var s=new wr;if(e)var h=e(a,l,c,n,t,s);if(!(h===X?Se(l,a,hn|pn,e,s):h))return!1}}return!0}function Ue(n){return!(!fc(n)||Di(n))&&(uc(n)?kl:Zt).test(to(n))}function Be(n){return cc(n)&&we(n)==nt}function Te(n){return cc(n)&&zs(n)==tt;
5839}function $e(n){return cc(n)&&oc(n.length)&&!!Kr[we(n)]}function De(n){return"function"==typeof n?n:null==n?La:"object"==typeof n?bh(n)?Ze(n[0],n[1]):qe(n):Fa(n)}function Me(n){if(!Mi(n))return Vl(n);var t=[];for(var r in ll(n))bl.call(n,r)&&"constructor"!=r&&t.push(r);return t}function Fe(n){if(!fc(n))return Zi(n);var t=Mi(n),r=[];for(var e in n)("constructor"!=e||!t&&bl.call(n,e))&&r.push(e);return r}function Ne(n,t){return n<t}function Pe(n,t){var r=-1,e=Hf(n)?il(n.length):[];return ys(n,function(n,u,i){
5840e[++r]=t(n,u,i)}),e}function qe(n){var t=ji(n);return 1==t.length&&t[0][2]?Ni(t[0][0],t[0][1]):function(r){return r===n||Ce(r,n,t)}}function Ze(n,t){return Bi(n)&&Fi(t)?Ni(no(n),t):function(r){var e=Mc(r,n);return e===X&&e===t?Nc(r,n):Se(t,e,hn|pn)}}function Ke(n,t,r,e,u){n!==t&&bs(t,function(i,o){if(u||(u=new wr),fc(i))Ve(n,t,o,r,Ke,e,u);else{var f=e?e(Ji(n,o),i,o+"",n,t,u):X;f===X&&(f=i),Er(n,o,f)}},qc)}function Ve(n,t,r,e,u,i,o){var f=Ji(n,r),c=Ji(t,r),a=o.get(c);if(a)return Er(n,r,a),X;var l=i?i(f,c,r+"",n,t,o):X,s=l===X;
5841if(s){var h=bh(c),p=!h&&mh(c),_=!h&&!p&&Oh(c);l=c,h||p||_?bh(f)?l=f:Jf(f)?l=Tu(f):p?(s=!1,l=Iu(c,!0)):_?(s=!1,l=Wu(c,!0)):l=[]:gc(c)||dh(c)?(l=f,dh(f)?l=Rc(f):fc(f)&&!uc(f)||(l=Ei(c))):s=!1}s&&(o.set(c,l),u(l,c,e,i,o),o.delete(c)),Er(n,r,l)}function Ge(n,t){var r=n.length;if(r)return t+=t<0?r:0,Ci(t,r)?n[t]:X}function He(n,t,r){t=t.length?c(t,function(n){return bh(n)?function(t){return _e(t,1===n.length?n[0]:n)}:n}):[La];var e=-1;return t=c(t,z(mi())),A(Pe(n,function(n,r,u){return{criteria:c(t,function(t){
5842return t(n)}),index:++e,value:n}}),function(n,t){return Cu(n,t,r)})}function Je(n,t){return Ye(n,t,function(t,r){return Nc(n,r)})}function Ye(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],f=_e(n,o);r(f,o)&&fu(i,ku(o,n),f)}return i}function Qe(n){return function(t){return _e(t,n)}}function Xe(n,t,r,e){var u=e?d:y,i=-1,o=t.length,f=n;for(n===t&&(t=Tu(t)),r&&(f=c(n,z(r)));++i<o;)for(var a=0,l=t[i],s=r?r(l):l;(a=u(f,s,a,e))>-1;)f!==n&&Ll.call(f,a,1),Ll.call(n,a,1);return n}function nu(n,t){for(var r=n?t.length:0,e=r-1;r--;){
5843var u=t[r];if(r==e||u!==i){var i=u;Ci(u)?Ll.call(n,u,1):yu(n,u)}}return n}function tu(n,t){return n+Nl(Ql()*(t-n+1))}function ru(n,t,r,e){for(var u=-1,i=Gl(Fl((t-n)/(r||1)),0),o=il(i);i--;)o[e?i:++u]=n,n+=r;return o}function eu(n,t){var r="";if(!n||t<1||t>Wn)return r;do t%2&&(r+=n),t=Nl(t/2),t&&(n+=n);while(t);return r}function uu(n,t){return Ls(Vi(n,t,La),n+"")}function iu(n){return Ir(ra(n))}function ou(n,t){var r=ra(n);return Xi(r,Mr(t,0,r.length))}function fu(n,t,r,e){if(!fc(n))return n;t=ku(t,n);
5844for(var u=-1,i=t.length,o=i-1,f=n;null!=f&&++u<i;){var c=no(t[u]),a=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return n;if(u!=o){var l=f[c];a=e?e(l,c,f):X,a===X&&(a=fc(l)?l:Ci(t[u+1])?[]:{})}Sr(f,c,a),f=f[c]}return n}function cu(n){return Xi(ra(n))}function au(n,t,r){var e=-1,u=n.length;t<0&&(t=-t>u?0:u+t),r=r>u?u:r,r<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=il(u);++e<u;)i[e]=n[e+t];return i}function lu(n,t){var r;return ys(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function su(n,t,r){
5845var e=0,u=null==n?e:n.length;if("number"==typeof t&&t===t&&u<=Tn){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!bc(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return hu(n,t,La,r)}function hu(n,t,r,e){var u=0,i=null==n?0:n.length;if(0===i)return 0;t=r(t);for(var o=t!==t,f=null===t,c=bc(t),a=t===X;u<i;){var l=Nl((u+i)/2),s=r(n[l]),h=s!==X,p=null===s,_=s===s,v=bc(s);if(o)var g=e||_;else g=a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):!p&&!v&&(e?s<=t:s<t);g?u=l+1:i=l}return Hl(i,Bn)}function pu(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){
5846var o=n[r],f=t?t(o):o;if(!r||!Gf(f,c)){var c=f;i[u++]=0===o?0:o}}return i}function _u(n){return"number"==typeof n?n:bc(n)?Cn:+n}function vu(n){if("string"==typeof n)return n;if(bh(n))return c(n,vu)+"";if(bc(n))return vs?vs.call(n):"";var t=n+"";return"0"==t&&1/n==-Sn?"-0":t}function gu(n,t,r){var e=-1,u=o,i=n.length,c=!0,a=[],l=a;if(r)c=!1,u=f;else if(i>=tn){var s=t?null:ks(n);if(s)return P(s);c=!1,u=S,l=new yr}else l=t?[]:a;n:for(;++e<i;){var h=n[e],p=t?t(h):h;if(h=r||0!==h?h:0,c&&p===p){for(var _=l.length;_--;)if(l[_]===p)continue n;
5847t&&l.push(p),a.push(h)}else u(l,p,r)||(l!==a&&l.push(p),a.push(h))}return a}function yu(n,t){return t=ku(t,n),n=Gi(n,t),null==n||delete n[no(jo(t))]}function du(n,t,r,e){return fu(n,t,r(_e(n,t)),e)}function bu(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?au(n,e?0:i,e?i+1:u):au(n,e?i+1:0,e?u:i)}function wu(n,t){var r=n;return r instanceof Ct&&(r=r.value()),l(t,function(n,t){return t.func.apply(t.thisArg,a([n],t.args))},r)}function mu(n,t,r){var e=n.length;if(e<2)return e?gu(n[0]):[];
5848for(var u=-1,i=il(e);++u<e;)for(var o=n[u],f=-1;++f<e;)f!=u&&(i[u]=Hr(i[u]||o,n[f],t,r));return gu(ee(i,1),t,r)}function xu(n,t,r){for(var e=-1,u=n.length,i=t.length,o={};++e<u;){r(o,n[e],e<i?t[e]:X)}return o}function ju(n){return Jf(n)?n:[]}function Au(n){return"function"==typeof n?n:La}function ku(n,t){return bh(n)?n:Bi(n,t)?[n]:Cs(Ec(n))}function Ou(n,t,r){var e=n.length;return r=r===X?e:r,!t&&r>=e?n:au(n,t,r)}function Iu(n,t){if(t)return n.slice();var r=n.length,e=zl?zl(r):new n.constructor(r);
5849return n.copy(e),e}function Ru(n){var t=new n.constructor(n.byteLength);return new Rl(t).set(new Rl(n)),t}function zu(n,t){return new n.constructor(t?Ru(n.buffer):n.buffer,n.byteOffset,n.byteLength)}function Eu(n){var t=new n.constructor(n.source,Nt.exec(n));return t.lastIndex=n.lastIndex,t}function Su(n){return _s?ll(_s.call(n)):{}}function Wu(n,t){return new n.constructor(t?Ru(n.buffer):n.buffer,n.byteOffset,n.length)}function Lu(n,t){if(n!==t){var r=n!==X,e=null===n,u=n===n,i=bc(n),o=t!==X,f=null===t,c=t===t,a=bc(t);
5850if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&n<t||a&&r&&u&&!e&&!i||f&&r&&u||!o&&u||!c)return-1}return 0}function Cu(n,t,r){for(var e=-1,u=n.criteria,i=t.criteria,o=u.length,f=r.length;++e<o;){var c=Lu(u[e],i[e]);if(c){if(e>=f)return c;return c*("desc"==r[e]?-1:1)}}return n.index-t.index}function Uu(n,t,r,e){for(var u=-1,i=n.length,o=r.length,f=-1,c=t.length,a=Gl(i-o,0),l=il(c+a),s=!e;++f<c;)l[f]=t[f];for(;++u<o;)(s||u<i)&&(l[r[u]]=n[u]);for(;a--;)l[f++]=n[u++];return l;
5851}function Bu(n,t,r,e){for(var u=-1,i=n.length,o=-1,f=r.length,c=-1,a=t.length,l=Gl(i-f,0),s=il(l+a),h=!e;++u<l;)s[u]=n[u];for(var p=u;++c<a;)s[p+c]=t[c];for(;++o<f;)(h||u<i)&&(s[p+r[o]]=n[u++]);return s}function Tu(n,t){var r=-1,e=n.length;for(t||(t=il(e));++r<e;)t[r]=n[r];return t}function $u(n,t,r,e){var u=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var f=t[i],c=e?e(r[f],n[f],f,r,n):X;c===X&&(c=n[f]),u?Br(r,f,c):Sr(r,f,c)}return r}function Du(n,t){return $u(n,Is(n),t)}function Mu(n,t){return $u(n,Rs(n),t);
5852}function Fu(n,r){return function(e,u){var i=bh(e)?t:Lr,o=r?r():{};return i(e,n,mi(u,2),o)}}function Nu(n){return uu(function(t,r){var e=-1,u=r.length,i=u>1?r[u-1]:X,o=u>2?r[2]:X;for(i=n.length>3&&"function"==typeof i?(u--,i):X,o&&Ui(r[0],r[1],o)&&(i=u<3?X:i,u=1),t=ll(t);++e<u;){var f=r[e];f&&n(t,f,e,i)}return t})}function Pu(n,t){return function(r,e){if(null==r)return r;if(!Hf(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=ll(r);(t?i--:++i<u)&&e(o[i],i,o)!==!1;);return r}}function qu(n){return function(t,r,e){
5853for(var u=-1,i=ll(t),o=e(t),f=o.length;f--;){var c=o[n?f:++u];if(r(i[c],c,i)===!1)break}return t}}function Zu(n,t,r){function e(){return(this&&this!==re&&this instanceof e?i:n).apply(u?r:this,arguments)}var u=t&_n,i=Gu(n);return e}function Ku(n){return function(t){t=Ec(t);var r=T(t)?G(t):X,e=r?r[0]:t.charAt(0),u=r?Ou(r,1).join(""):t.slice(1);return e[n]()+u}}function Vu(n){return function(t){return l(Ra(ca(t).replace($r,"")),n,"")}}function Gu(n){return function(){var t=arguments;switch(t.length){
5854case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=gs(n.prototype),e=n.apply(r,t);return fc(e)?e:r}}function Hu(t,r,e){function u(){for(var o=arguments.length,f=il(o),c=o,a=wi(u);c--;)f[c]=arguments[c];var l=o<3&&f[0]!==a&&f[o-1]!==a?[]:N(f,a);
5855return o-=l.length,o<e?oi(t,r,Qu,u.placeholder,X,f,l,X,X,e-o):n(this&&this!==re&&this instanceof u?i:t,this,f)}var i=Gu(t);return u}function Ju(n){return function(t,r,e){var u=ll(t);if(!Hf(t)){var i=mi(r,3);t=Pc(t),r=function(n){return i(u[n],n,u)}}var o=n(t,r,e);return o>-1?u[i?t[o]:o]:X}}function Yu(n){return gi(function(t){var r=t.length,e=r,u=Y.prototype.thru;for(n&&t.reverse();e--;){var i=t[e];if("function"!=typeof i)throw new pl(en);if(u&&!o&&"wrapper"==bi(i))var o=new Y([],!0)}for(e=o?e:r;++e<r;){
5856i=t[e];var f=bi(i),c="wrapper"==f?Os(i):X;o=c&&$i(c[0])&&c[1]==(mn|yn|bn|xn)&&!c[4].length&&1==c[9]?o[bi(c[0])].apply(o,c[3]):1==i.length&&$i(i)?o[f]():o.thru(i)}return function(){var n=arguments,e=n[0];if(o&&1==n.length&&bh(e))return o.plant(e).value();for(var u=0,i=r?t[u].apply(this,n):e;++u<r;)i=t[u].call(this,i);return i}})}function Qu(n,t,r,e,u,i,o,f,c,a){function l(){for(var y=arguments.length,d=il(y),b=y;b--;)d[b]=arguments[b];if(_)var w=wi(l),m=C(d,w);if(e&&(d=Uu(d,e,u,_)),i&&(d=Bu(d,i,o,_)),
5857y-=m,_&&y<a){return oi(n,t,Qu,l.placeholder,r,d,N(d,w),f,c,a-y)}var x=h?r:this,j=p?x[n]:n;return y=d.length,f?d=Hi(d,f):v&&y>1&&d.reverse(),s&&c<y&&(d.length=c),this&&this!==re&&this instanceof l&&(j=g||Gu(j)),j.apply(x,d)}var s=t&mn,h=t&_n,p=t&vn,_=t&(yn|dn),v=t&jn,g=p?X:Gu(n);return l}function Xu(n,t){return function(r,e){return Oe(r,n,t(e),{})}}function ni(n,t){return function(r,e){var u;if(r===X&&e===X)return t;if(r!==X&&(u=r),e!==X){if(u===X)return e;"string"==typeof r||"string"==typeof e?(r=vu(r),
5858e=vu(e)):(r=_u(r),e=_u(e)),u=n(r,e)}return u}}function ti(t){return gi(function(r){return r=c(r,z(mi())),uu(function(e){var u=this;return t(r,function(t){return n(t,u,e)})})})}function ri(n,t){t=t===X?" ":vu(t);var r=t.length;if(r<2)return r?eu(t,n):t;var e=eu(t,Fl(n/V(t)));return T(t)?Ou(G(e),0,n).join(""):e.slice(0,n)}function ei(t,r,e,u){function i(){for(var r=-1,c=arguments.length,a=-1,l=u.length,s=il(l+c),h=this&&this!==re&&this instanceof i?f:t;++a<l;)s[a]=u[a];for(;c--;)s[a++]=arguments[++r];
5859return n(h,o?e:this,s)}var o=r&_n,f=Gu(t);return i}function ui(n){return function(t,r,e){return e&&"number"!=typeof e&&Ui(t,r,e)&&(r=e=X),t=Ac(t),r===X?(r=t,t=0):r=Ac(r),e=e===X?t<r?1:-1:Ac(e),ru(t,r,e,n)}}function ii(n){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=Ic(t),r=Ic(r)),n(t,r)}}function oi(n,t,r,e,u,i,o,f,c,a){var l=t&yn,s=l?o:X,h=l?X:o,p=l?i:X,_=l?X:i;t|=l?bn:wn,t&=~(l?wn:bn),t&gn||(t&=~(_n|vn));var v=[n,t,u,p,s,_,h,f,c,a],g=r.apply(X,v);return $i(n)&&Ss(g,v),g.placeholder=e,
5860Yi(g,n,t)}function fi(n){var t=al[n];return function(n,r){if(n=Ic(n),r=null==r?0:Hl(kc(r),292),r&&Zl(n)){var e=(Ec(n)+"e").split("e");return e=(Ec(t(e[0]+"e"+(+e[1]+r)))+"e").split("e"),+(e[0]+"e"+(+e[1]-r))}return t(n)}}function ci(n){return function(t){var r=zs(t);return r==Gn?M(t):r==tt?q(t):I(t,n(t))}}function ai(n,t,r,e,u,i,o,f){var c=t&vn;if(!c&&"function"!=typeof n)throw new pl(en);var a=e?e.length:0;if(a||(t&=~(bn|wn),e=u=X),o=o===X?o:Gl(kc(o),0),f=f===X?f:kc(f),a-=u?u.length:0,t&wn){var l=e,s=u;
5861e=u=X}var h=c?X:Os(n),p=[n,t,r,e,u,l,s,i,o,f];if(h&&qi(p,h),n=p[0],t=p[1],r=p[2],e=p[3],u=p[4],f=p[9]=p[9]===X?c?0:n.length:Gl(p[9]-a,0),!f&&t&(yn|dn)&&(t&=~(yn|dn)),t&&t!=_n)_=t==yn||t==dn?Hu(n,t,f):t!=bn&&t!=(_n|bn)||u.length?Qu.apply(X,p):ei(n,t,r,e);else var _=Zu(n,t,r);return Yi((h?ms:Ss)(_,p),n,t)}function li(n,t,r,e){return n===X||Gf(n,gl[r])&&!bl.call(e,r)?t:n}function si(n,t,r,e,u,i){return fc(n)&&fc(t)&&(i.set(t,n),Ke(n,t,X,si,i),i.delete(t)),n}function hi(n){return gc(n)?X:n}function pi(n,t,r,e,u,i){
5862var o=r&hn,f=n.length,c=t.length;if(f!=c&&!(o&&c>f))return!1;var a=i.get(n),l=i.get(t);if(a&&l)return a==t&&l==n;var s=-1,p=!0,_=r&pn?new yr:X;for(i.set(n,t),i.set(t,n);++s<f;){var v=n[s],g=t[s];if(e)var y=o?e(g,v,s,t,n,i):e(v,g,s,n,t,i);if(y!==X){if(y)continue;p=!1;break}if(_){if(!h(t,function(n,t){if(!S(_,t)&&(v===n||u(v,n,r,e,i)))return _.push(t)})){p=!1;break}}else if(v!==g&&!u(v,g,r,e,i)){p=!1;break}}return i.delete(n),i.delete(t),p}function _i(n,t,r,e,u,i,o){switch(r){case ct:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;
5863n=n.buffer,t=t.buffer;case ft:return!(n.byteLength!=t.byteLength||!i(new Rl(n),new Rl(t)));case Nn:case Pn:case Hn:return Gf(+n,+t);case Zn:return n.name==t.name&&n.message==t.message;case nt:case rt:return n==t+"";case Gn:var f=M;case tt:var c=e&hn;if(f||(f=P),n.size!=t.size&&!c)return!1;var a=o.get(n);if(a)return a==t;e|=pn,o.set(n,t);var l=pi(f(n),f(t),e,u,i,o);return o.delete(n),l;case et:if(_s)return _s.call(n)==_s.call(t)}return!1}function vi(n,t,r,e,u,i){var o=r&hn,f=yi(n),c=f.length;if(c!=yi(t).length&&!o)return!1;
5864for(var a=c;a--;){var l=f[a];if(!(o?l in t:bl.call(t,l)))return!1}var s=i.get(n),h=i.get(t);if(s&&h)return s==t&&h==n;var p=!0;i.set(n,t),i.set(t,n);for(var _=o;++a<c;){l=f[a];var v=n[l],g=t[l];if(e)var y=o?e(g,v,l,t,n,i):e(v,g,l,n,t,i);if(!(y===X?v===g||u(v,g,r,e,i):y)){p=!1;break}_||(_="constructor"==l)}if(p&&!_){var d=n.constructor,b=t.constructor;d!=b&&"constructor"in n&&"constructor"in t&&!("function"==typeof d&&d instanceof d&&"function"==typeof b&&b instanceof b)&&(p=!1)}return i.delete(n),
5865i.delete(t),p}function gi(n){return Ls(Vi(n,X,_o),n+"")}function yi(n){return de(n,Pc,Is)}function di(n){return de(n,qc,Rs)}function bi(n){for(var t=n.name+"",r=fs[t],e=bl.call(fs,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function wi(n){return(bl.call(Z,"placeholder")?Z:n).placeholder}function mi(){var n=Z.iteratee||Ca;return n=n===Ca?De:n,arguments.length?n(arguments[0],arguments[1]):n}function xi(n,t){var r=n.__data__;return Ti(t)?r["string"==typeof t?"string":"hash"]:r.map;
5866}function ji(n){for(var t=Pc(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,Fi(u)]}return t}function Ai(n,t){var r=B(n,t);return Ue(r)?r:X}function ki(n){var t=bl.call(n,Bl),r=n[Bl];try{n[Bl]=X;var e=!0}catch(n){}var u=xl.call(n);return e&&(t?n[Bl]=r:delete n[Bl]),u}function Oi(n,t,r){for(var e=-1,u=r.length;++e<u;){var i=r[e],o=i.size;switch(i.type){case"drop":n+=o;break;case"dropRight":t-=o;break;case"take":t=Hl(t,n+o);break;case"takeRight":n=Gl(n,t-o)}}return{start:n,end:t}}function Ii(n){var t=n.match(Bt);
5867return t?t[1].split(Tt):[]}function Ri(n,t,r){t=ku(t,n);for(var e=-1,u=t.length,i=!1;++e<u;){var o=no(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:(u=null==n?0:n.length,!!u&&oc(u)&&Ci(o,u)&&(bh(n)||dh(n)))}function zi(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&bl.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function Ei(n){return"function"!=typeof n.constructor||Mi(n)?{}:gs(El(n))}function Si(n,t,r){var e=n.constructor;switch(t){case ft:return Ru(n);
5868case Nn:case Pn:return new e(+n);case ct:return zu(n,r);case at:case lt:case st:case ht:case pt:case _t:case vt:case gt:case yt:return Wu(n,r);case Gn:return new e;case Hn:case rt:return new e(n);case nt:return Eu(n);case tt:return new e;case et:return Su(n)}}function Wi(n,t){var r=t.length;if(!r)return n;var e=r-1;return t[e]=(r>1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(Ut,"{\n/* [wrapped with "+t+"] */\n")}function Li(n){return bh(n)||dh(n)||!!(Cl&&n&&n[Cl])}function Ci(n,t){var r=typeof n;
5869return t=null==t?Wn:t,!!t&&("number"==r||"symbol"!=r&&Vt.test(n))&&n>-1&&n%1==0&&n<t}function Ui(n,t,r){if(!fc(r))return!1;var e=typeof t;return!!("number"==e?Hf(r)&&Ci(t,r.length):"string"==e&&t in r)&&Gf(r[t],n)}function Bi(n,t){if(bh(n))return!1;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!bc(n))||(zt.test(n)||!Rt.test(n)||null!=t&&n in ll(t))}function Ti(n){var t=typeof n;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==n:null===n}function $i(n){
5870var t=bi(n),r=Z[t];if("function"!=typeof r||!(t in Ct.prototype))return!1;if(n===r)return!0;var e=Os(r);return!!e&&n===e[0]}function Di(n){return!!ml&&ml in n}function Mi(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||gl)}function Fi(n){return n===n&&!fc(n)}function Ni(n,t){return function(r){return null!=r&&(r[n]===t&&(t!==X||n in ll(r)))}}function Pi(n){var t=Cf(n,function(n){return r.size===fn&&r.clear(),n}),r=t.cache;return t}function qi(n,t){var r=n[1],e=t[1],u=r|e,i=u<(_n|vn|mn),o=e==mn&&r==yn||e==mn&&r==xn&&n[7].length<=t[8]||e==(mn|xn)&&t[7].length<=t[8]&&r==yn;
5871if(!i&&!o)return n;e&_n&&(n[2]=t[2],u|=r&_n?0:gn);var f=t[3];if(f){var c=n[3];n[3]=c?Uu(c,f,t[4]):f,n[4]=c?N(n[3],cn):t[4]}return f=t[5],f&&(c=n[5],n[5]=c?Bu(c,f,t[6]):f,n[6]=c?N(n[5],cn):t[6]),f=t[7],f&&(n[7]=f),e&mn&&(n[8]=null==n[8]?t[8]:Hl(n[8],t[8])),null==n[9]&&(n[9]=t[9]),n[0]=t[0],n[1]=u,n}function Zi(n){var t=[];if(null!=n)for(var r in ll(n))t.push(r);return t}function Ki(n){return xl.call(n)}function Vi(t,r,e){return r=Gl(r===X?t.length-1:r,0),function(){for(var u=arguments,i=-1,o=Gl(u.length-r,0),f=il(o);++i<o;)f[i]=u[r+i];
5872i=-1;for(var c=il(r+1);++i<r;)c[i]=u[i];return c[r]=e(f),n(t,this,c)}}function Gi(n,t){return t.length<2?n:_e(n,au(t,0,-1))}function Hi(n,t){for(var r=n.length,e=Hl(t.length,r),u=Tu(n);e--;){var i=t[e];n[e]=Ci(i,r)?u[i]:X}return n}function Ji(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]}function Yi(n,t,r){var e=t+"";return Ls(n,Wi(e,ro(Ii(e),r)))}function Qi(n){var t=0,r=0;return function(){var e=Jl(),u=In-(e-r);if(r=e,u>0){if(++t>=On)return arguments[0]}else t=0;
5873return n.apply(X,arguments)}}function Xi(n,t){var r=-1,e=n.length,u=e-1;for(t=t===X?e:t;++r<t;){var i=tu(r,u),o=n[i];n[i]=n[r],n[r]=o}return n.length=t,n}function no(n){if("string"==typeof n||bc(n))return n;var t=n+"";return"0"==t&&1/n==-Sn?"-0":t}function to(n){if(null!=n){try{return dl.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function ro(n,t){return r($n,function(r){var e="_."+r[0];t&r[1]&&!o(n,e)&&n.push(e)}),n.sort()}function eo(n){if(n instanceof Ct)return n.clone();var t=new Y(n.__wrapped__,n.__chain__);
5874return t.__actions__=Tu(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}function uo(n,t,r){t=(r?Ui(n,t,r):t===X)?1:Gl(kc(t),0);var e=null==n?0:n.length;if(!e||t<1)return[];for(var u=0,i=0,o=il(Fl(e/t));u<e;)o[i++]=au(n,u,u+=t);return o}function io(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){var i=n[t];i&&(u[e++]=i)}return u}function oo(){var n=arguments.length;if(!n)return[];for(var t=il(n-1),r=arguments[0],e=n;e--;)t[e-1]=arguments[e];return a(bh(r)?Tu(r):[r],ee(t,1));
5875}function fo(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===X?1:kc(t),au(n,t<0?0:t,e)):[]}function co(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===X?1:kc(t),t=e-t,au(n,0,t<0?0:t)):[]}function ao(n,t){return n&&n.length?bu(n,mi(t,3),!0,!0):[]}function lo(n,t){return n&&n.length?bu(n,mi(t,3),!0):[]}function so(n,t,r,e){var u=null==n?0:n.length;return u?(r&&"number"!=typeof r&&Ui(n,t,r)&&(r=0,e=u),ne(n,t,r,e)):[]}function ho(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:kc(r);
5876return u<0&&(u=Gl(e+u,0)),g(n,mi(t,3),u)}function po(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==X&&(u=kc(r),u=r<0?Gl(e+u,0):Hl(u,e-1)),g(n,mi(t,3),u,!0)}function _o(n){return(null==n?0:n.length)?ee(n,1):[]}function vo(n){return(null==n?0:n.length)?ee(n,Sn):[]}function go(n,t){return(null==n?0:n.length)?(t=t===X?1:kc(t),ee(n,t)):[]}function yo(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){var u=n[t];e[u[0]]=u[1]}return e}function bo(n){return n&&n.length?n[0]:X}function wo(n,t,r){
5877var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:kc(r);return u<0&&(u=Gl(e+u,0)),y(n,t,u)}function mo(n){return(null==n?0:n.length)?au(n,0,-1):[]}function xo(n,t){return null==n?"":Kl.call(n,t)}function jo(n){var t=null==n?0:n.length;return t?n[t-1]:X}function Ao(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;return r!==X&&(u=kc(r),u=u<0?Gl(e+u,0):Hl(u,e-1)),t===t?K(n,t,u):g(n,b,u,!0)}function ko(n,t){return n&&n.length?Ge(n,kc(t)):X}function Oo(n,t){return n&&n.length&&t&&t.length?Xe(n,t):n;
5878}function Io(n,t,r){return n&&n.length&&t&&t.length?Xe(n,t,mi(r,2)):n}function Ro(n,t,r){return n&&n.length&&t&&t.length?Xe(n,t,X,r):n}function zo(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=mi(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),u.push(e))}return nu(n,u),r}function Eo(n){return null==n?n:Xl.call(n)}function So(n,t,r){var e=null==n?0:n.length;return e?(r&&"number"!=typeof r&&Ui(n,t,r)?(t=0,r=e):(t=null==t?0:kc(t),r=r===X?e:kc(r)),au(n,t,r)):[]}function Wo(n,t){
5879return su(n,t)}function Lo(n,t,r){return hu(n,t,mi(r,2))}function Co(n,t){var r=null==n?0:n.length;if(r){var e=su(n,t);if(e<r&&Gf(n[e],t))return e}return-1}function Uo(n,t){return su(n,t,!0)}function Bo(n,t,r){return hu(n,t,mi(r,2),!0)}function To(n,t){if(null==n?0:n.length){var r=su(n,t,!0)-1;if(Gf(n[r],t))return r}return-1}function $o(n){return n&&n.length?pu(n):[]}function Do(n,t){return n&&n.length?pu(n,mi(t,2)):[]}function Mo(n){var t=null==n?0:n.length;return t?au(n,1,t):[]}function Fo(n,t,r){
5880return n&&n.length?(t=r||t===X?1:kc(t),au(n,0,t<0?0:t)):[]}function No(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===X?1:kc(t),t=e-t,au(n,t<0?0:t,e)):[]}function Po(n,t){return n&&n.length?bu(n,mi(t,3),!1,!0):[]}function qo(n,t){return n&&n.length?bu(n,mi(t,3)):[]}function Zo(n){return n&&n.length?gu(n):[]}function Ko(n,t){return n&&n.length?gu(n,mi(t,2)):[]}function Vo(n,t){return t="function"==typeof t?t:X,n&&n.length?gu(n,X,t):[]}function Go(n){if(!n||!n.length)return[];var t=0;return n=i(n,function(n){
5881if(Jf(n))return t=Gl(n.length,t),!0}),O(t,function(t){return c(n,m(t))})}function Ho(t,r){if(!t||!t.length)return[];var e=Go(t);return null==r?e:c(e,function(t){return n(r,X,t)})}function Jo(n,t){return xu(n||[],t||[],Sr)}function Yo(n,t){return xu(n||[],t||[],fu)}function Qo(n){var t=Z(n);return t.__chain__=!0,t}function Xo(n,t){return t(n),n}function nf(n,t){return t(n)}function tf(){return Qo(this)}function rf(){return new Y(this.value(),this.__chain__)}function ef(){this.__values__===X&&(this.__values__=jc(this.value()));
5882var n=this.__index__>=this.__values__.length;return{done:n,value:n?X:this.__values__[this.__index__++]}}function uf(){return this}function of(n){for(var t,r=this;r instanceof J;){var e=eo(r);e.__index__=0,e.__values__=X,t?u.__wrapped__=e:t=e;var u=e;r=r.__wrapped__}return u.__wrapped__=n,t}function ff(){var n=this.__wrapped__;if(n instanceof Ct){var t=n;return this.__actions__.length&&(t=new Ct(this)),t=t.reverse(),t.__actions__.push({func:nf,args:[Eo],thisArg:X}),new Y(t,this.__chain__)}return this.thru(Eo);
5883}function cf(){return wu(this.__wrapped__,this.__actions__)}function af(n,t,r){var e=bh(n)?u:Jr;return r&&Ui(n,t,r)&&(t=X),e(n,mi(t,3))}function lf(n,t){return(bh(n)?i:te)(n,mi(t,3))}function sf(n,t){return ee(yf(n,t),1)}function hf(n,t){return ee(yf(n,t),Sn)}function pf(n,t,r){return r=r===X?1:kc(r),ee(yf(n,t),r)}function _f(n,t){return(bh(n)?r:ys)(n,mi(t,3))}function vf(n,t){return(bh(n)?e:ds)(n,mi(t,3))}function gf(n,t,r,e){n=Hf(n)?n:ra(n),r=r&&!e?kc(r):0;var u=n.length;return r<0&&(r=Gl(u+r,0)),
5884dc(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&y(n,t,r)>-1}function yf(n,t){return(bh(n)?c:Pe)(n,mi(t,3))}function df(n,t,r,e){return null==n?[]:(bh(t)||(t=null==t?[]:[t]),r=e?X:r,bh(r)||(r=null==r?[]:[r]),He(n,t,r))}function bf(n,t,r){var e=bh(n)?l:j,u=arguments.length<3;return e(n,mi(t,4),r,u,ys)}function wf(n,t,r){var e=bh(n)?s:j,u=arguments.length<3;return e(n,mi(t,4),r,u,ds)}function mf(n,t){return(bh(n)?i:te)(n,Uf(mi(t,3)))}function xf(n){return(bh(n)?Ir:iu)(n)}function jf(n,t,r){return t=(r?Ui(n,t,r):t===X)?1:kc(t),
5885(bh(n)?Rr:ou)(n,t)}function Af(n){return(bh(n)?zr:cu)(n)}function kf(n){if(null==n)return 0;if(Hf(n))return dc(n)?V(n):n.length;var t=zs(n);return t==Gn||t==tt?n.size:Me(n).length}function Of(n,t,r){var e=bh(n)?h:lu;return r&&Ui(n,t,r)&&(t=X),e(n,mi(t,3))}function If(n,t){if("function"!=typeof t)throw new pl(en);return n=kc(n),function(){if(--n<1)return t.apply(this,arguments)}}function Rf(n,t,r){return t=r?X:t,t=n&&null==t?n.length:t,ai(n,mn,X,X,X,X,t)}function zf(n,t){var r;if("function"!=typeof t)throw new pl(en);
5886return n=kc(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=X),r}}function Ef(n,t,r){t=r?X:t;var e=ai(n,yn,X,X,X,X,X,t);return e.placeholder=Ef.placeholder,e}function Sf(n,t,r){t=r?X:t;var e=ai(n,dn,X,X,X,X,X,t);return e.placeholder=Sf.placeholder,e}function Wf(n,t,r){function e(t){var r=h,e=p;return h=p=X,d=t,v=n.apply(e,r)}function u(n){return d=n,g=Ws(f,t),b?e(n):v}function i(n){var r=n-y,e=n-d,u=t-r;return w?Hl(u,_-e):u}function o(n){var r=n-y,e=n-d;return y===X||r>=t||r<0||w&&e>=_;
5887}function f(){var n=fh();return o(n)?c(n):(g=Ws(f,i(n)),X)}
vendor: 5,664 bytes, lines 5887-5898
5887function c(n){return g=X,m&&h?e(n):(h=p=X,v)}function a(){g!==X&&As(g),d=0,h=y=p=g=X}function l(){return g===X?v:c(fh())}function s(){var n=fh(),r=o(n);if(h=arguments,p=this,y=n,r){if(g===X)return u(y);if(w)return As(g),g=Ws(f,t),e(y)}return g===X&&(g=Ws(f,t)),v}var h,p,_,v,g,y,d=0,b=!1,w=!1,m=!0;if("function"!=typeof n)throw new pl(en);return t=Ic(t)||0,fc(r)&&(b=!!r.leading,w="maxWait"in r,_=w?Gl(Ic(r.maxWait)||0,t):_,m="trailing"in r?!!r.trailing:m),
5888s.cancel=a,s.flush=l,s}function Lf(n){return ai(n,jn)}function Cf(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new pl(en);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Cf.Cache||sr),r}function Uf(n){if("function"!=typeof n)throw new pl(en);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:
5889return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Bf(n){return zf(2,n)}function Tf(n,t){if("function"!=typeof n)throw new pl(en);return t=t===X?t:kc(t),uu(n,t)}function $f(t,r){if("function"!=typeof t)throw new pl(en);return r=null==r?0:Gl(kc(r),0),uu(function(e){var u=e[r],i=Ou(e,0,r);return u&&a(i,u),n(t,this,i)})}function Df(n,t,r){var e=!0,u=!0;if("function"!=typeof n)throw new pl(en);return fc(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),
5890Wf(n,t,{leading:e,maxWait:t,trailing:u})}function Mf(n){return Rf(n,1)}function Ff(n,t){return ph(Au(t),n)}function Nf(){if(!arguments.length)return[];var n=arguments[0];return bh(n)?n:[n]}function Pf(n){return Fr(n,sn)}function qf(n,t){return t="function"==typeof t?t:X,Fr(n,sn,t)}function Zf(n){return Fr(n,an|sn)}function Kf(n,t){return t="function"==typeof t?t:X,Fr(n,an|sn,t)}function Vf(n,t){return null==t||Pr(n,t,Pc(t))}function Gf(n,t){return n===t||n!==n&&t!==t}function Hf(n){return null!=n&&oc(n.length)&&!uc(n);
5891}function Jf(n){return cc(n)&&Hf(n)}function Yf(n){return n===!0||n===!1||cc(n)&&we(n)==Nn}function Qf(n){return cc(n)&&1===n.nodeType&&!gc(n)}function Xf(n){if(null==n)return!0;if(Hf(n)&&(bh(n)||"string"==typeof n||"function"==typeof n.splice||mh(n)||Oh(n)||dh(n)))return!n.length;var t=zs(n);if(t==Gn||t==tt)return!n.size;if(Mi(n))return!Me(n).length;for(var r in n)if(bl.call(n,r))return!1;return!0}function nc(n,t){return Se(n,t)}function tc(n,t,r){r="function"==typeof r?r:X;var e=r?r(n,t):X;return e===X?Se(n,t,X,r):!!e;
5892}function rc(n){if(!cc(n))return!1;var t=we(n);return t==Zn||t==qn||"string"==typeof n.message&&"string"==typeof n.name&&!gc(n)}function ec(n){return"number"==typeof n&&Zl(n)}function uc(n){if(!fc(n))return!1;var t=we(n);return t==Kn||t==Vn||t==Fn||t==Xn}function ic(n){return"number"==typeof n&&n==kc(n)}function oc(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=Wn}function fc(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function cc(n){return null!=n&&"object"==typeof n}function ac(n,t){
5893return n===t||Ce(n,t,ji(t))}function lc(n,t,r){return r="function"==typeof r?r:X,Ce(n,t,ji(t),r)}function sc(n){return vc(n)&&n!=+n}function hc(n){if(Es(n))throw new fl(rn);return Ue(n)}function pc(n){return null===n}function _c(n){return null==n}function vc(n){return"number"==typeof n||cc(n)&&we(n)==Hn}function gc(n){if(!cc(n)||we(n)!=Yn)return!1;var t=El(n);if(null===t)return!0;var r=bl.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&dl.call(r)==jl}function yc(n){
5894return ic(n)&&n>=-Wn&&n<=Wn}function dc(n){return"string"==typeof n||!bh(n)&&cc(n)&&we(n)==rt}function bc(n){return"symbol"==typeof n||cc(n)&&we(n)==et}function wc(n){return n===X}function mc(n){return cc(n)&&zs(n)==it}function xc(n){return cc(n)&&we(n)==ot}function jc(n){if(!n)return[];if(Hf(n))return dc(n)?G(n):Tu(n);if(Ul&&n[Ul])return D(n[Ul]());var t=zs(n);return(t==Gn?M:t==tt?P:ra)(n)}function Ac(n){if(!n)return 0===n?n:0;if(n=Ic(n),n===Sn||n===-Sn){return(n<0?-1:1)*Ln}return n===n?n:0}function kc(n){
5895var t=Ac(n),r=t%1;return t===t?r?t-r:t:0}function Oc(n){return n?Mr(kc(n),0,Un):0}function Ic(n){if("number"==typeof n)return n;if(bc(n))return Cn;if(fc(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=fc(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=R(n);var r=qt.test(n);return r||Kt.test(n)?Xr(n.slice(2),r?2:8):Pt.test(n)?Cn:+n}function Rc(n){return $u(n,qc(n))}function zc(n){return n?Mr(kc(n),-Wn,Wn):0===n?n:0}function Ec(n){return null==n?"":vu(n)}function Sc(n,t){var r=gs(n);return null==t?r:Cr(r,t);
5896}function Wc(n,t){return v(n,mi(t,3),ue)}function Lc(n,t){return v(n,mi(t,3),oe)}function Cc(n,t){return null==n?n:bs(n,mi(t,3),qc)}function Uc(n,t){return null==n?n:ws(n,mi(t,3),qc)}function Bc(n,t){return n&&ue(n,mi(t,3))}function Tc(n,t){return n&&oe(n,mi(t,3))}function $c(n){return null==n?[]:fe(n,Pc(n))}function Dc(n){return null==n?[]:fe(n,qc(n))}function Mc(n,t,r){var e=null==n?X:_e(n,t);return e===X?r:e}function Fc(n,t){return null!=n&&Ri(n,t,xe)}function Nc(n,t){return null!=n&&Ri(n,t,je);
5897}function Pc(n){return Hf(n)?Or(n):Me(n)}function qc(n){return Hf(n)?Or(n,!0):Fe(n)}function Zc(n,t){var r={};return t=mi(t,3),ue(n,function(n,e,u){Br(r,t(n,e,u),n)}),r}function Kc(n,t){var r={};return t=mi(t,3),ue(n,function(n,e,u){Br(r,e,t(n,e,u))}),r}function Vc(n,t){return Gc(n,Uf(mi(t)))}function Gc(n,t){if(null==n)return{};var r=c(di(n),function(n){return[n]});return t=mi(t),Ye(n,r,function(n,r){return t(n,r[0])})}function Hc(n,t,r){t=ku(t,n);var e=-1,u=t.length;for(u||(u=1,n=X);++e<u;){var i=null==n?X:n[no(t[e])];
5898i===X&&(e=u,i=r),n=uc(i)?i.call(n):i}return n}
vendor: 4,153 bytes, lines 5898-5905
5898function Jc(n,t,r){return null==n?n:fu(n,t,r)}function Yc(n,t,r,e){return e="function"==typeof e?e:X,null==n?n:fu(n,t,r,e)}function Qc(n,t,e){var u=bh(n),i=u||mh(n)||Oh(n);if(t=mi(t,4),null==e){var o=n&&n.constructor;e=i?u?new o:[]:fc(n)&&uc(o)?gs(El(n)):{}}return(i?r:ue)(n,function(n,r,u){return t(e,n,r,u)}),e}function Xc(n,t){return null==n||yu(n,t)}function na(n,t,r){return null==n?n:du(n,t,Au(r))}function ta(n,t,r,e){return e="function"==typeof e?e:X,
5899null==n?n:du(n,t,Au(r),e)}function ra(n){return null==n?[]:E(n,Pc(n))}function ea(n){return null==n?[]:E(n,qc(n))}function ua(n,t,r){return r===X&&(r=t,t=X),r!==X&&(r=Ic(r),r=r===r?r:0),t!==X&&(t=Ic(t),t=t===t?t:0),Mr(Ic(n),t,r)}function ia(n,t,r){return t=Ac(t),r===X?(r=t,t=0):r=Ac(r),n=Ic(n),Ae(n,t,r)}function oa(n,t,r){if(r&&"boolean"!=typeof r&&Ui(n,t,r)&&(t=r=X),r===X&&("boolean"==typeof t?(r=t,t=X):"boolean"==typeof n&&(r=n,n=X)),n===X&&t===X?(n=0,t=1):(n=Ac(n),t===X?(t=n,n=0):t=Ac(t)),n>t){
5900var e=n;n=t,t=e}if(r||n%1||t%1){var u=Ql();return Hl(n+u*(t-n+Qr("1e-"+((u+"").length-1))),t)}return tu(n,t)}function fa(n){return Qh(Ec(n).toLowerCase())}function ca(n){return n=Ec(n),n&&n.replace(Gt,ve).replace(Dr,"")}function aa(n,t,r){n=Ec(n),t=vu(t);var e=n.length;r=r===X?e:Mr(kc(r),0,e);var u=r;return r-=t.length,r>=0&&n.slice(r,u)==t}function la(n){return n=Ec(n),n&&At.test(n)?n.replace(xt,ge):n}function sa(n){return n=Ec(n),n&&Wt.test(n)?n.replace(St,"\\$&"):n}function ha(n,t,r){n=Ec(n),t=kc(t);
5901var e=t?V(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return ri(Nl(u),r)+n+ri(Fl(u),r)}function pa(n,t,r){n=Ec(n),t=kc(t);var e=t?V(n):0;return t&&e<t?n+ri(t-e,r):n}function _a(n,t,r){n=Ec(n),t=kc(t);var e=t?V(n):0;return t&&e<t?ri(t-e,r)+n:n}function va(n,t,r){return r||null==t?t=0:t&&(t=+t),Yl(Ec(n).replace(Lt,""),t||0)}function ga(n,t,r){return t=(r?Ui(n,t,r):t===X)?1:kc(t),eu(Ec(n),t)}function ya(){var n=arguments,t=Ec(n[0]);return n.length<3?t:t.replace(n[1],n[2])}function da(n,t,r){return r&&"number"!=typeof r&&Ui(n,t,r)&&(t=r=X),
5902(r=r===X?Un:r>>>0)?(n=Ec(n),n&&("string"==typeof t||null!=t&&!Ah(t))&&(t=vu(t),!t&&T(n))?Ou(G(n),0,r):n.split(t,r)):[]}function ba(n,t,r){return n=Ec(n),r=null==r?0:Mr(kc(r),0,n.length),t=vu(t),n.slice(r,r+t.length)==t}function wa(n,t,r){var e=Z.templateSettings;r&&Ui(n,t,r)&&(t=X),n=Ec(n),t=Sh({},t,e,li);var u,i,o=Sh({},t.imports,e.imports,li),f=Pc(o),c=E(o,f),a=0,l=t.interpolate||Ht,s="__p += '",h=sl((t.escape||Ht).source+"|"+l.source+"|"+(l===It?Ft:Ht).source+"|"+(t.evaluate||Ht).source+"|$","g"),p="//# sourceURL="+(bl.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Zr+"]")+"\n";
5903n.replace(h,function(t,r,e,o,f,c){return e||(e=o),s+=n.slice(a,c).replace(Jt,U),r&&(u=!0,s+="' +\n__e("+r+") +\n'"),f&&(i=!0,s+="';\n"+f+";\n__p += '"),e&&(s+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),a=c+t.length,t}),s+="';\n";var _=bl.call(t,"variable")&&t.variable;if(_){if(Dt.test(_))throw new fl(un)}else s="with (obj) {\n"+s+"\n}\n";s=(i?s.replace(dt,""):s).replace(bt,"$1").replace(wt,"$1;"),s="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+s+"return __p\n}";
5904var v=Xh(function(){return cl(f,p+"return "+s).apply(X,c)});if(v.source=s,rc(v))throw v;return v}function ma(n){return Ec(n).toLowerCase()}function xa(n){return Ec(n).toUpperCase()}function ja(n,t,r){if(n=Ec(n),n&&(r||t===X))return R(n);if(!n||!(t=vu(t)))return n;var e=G(n),u=G(t);return Ou(e,W(e,u),L(e,u)+1).join("")}function Aa(n,t,r){if(n=Ec(n),n&&(r||t===X))return n.slice(0,H(n)+1);if(!n||!(t=vu(t)))return n;var e=G(n);return Ou(e,0,L(e,G(t))+1).join("")}function ka(n,t,r){if(n=Ec(n),n&&(r||t===X))return n.replace(Lt,"");
5905if(!n||!(t=vu(t)))return n;var e=G(n);return Ou(e,W(e,G(t))).join("")}function Oa(n,t){var r=An,e=kn;if(fc(t)){var u="separator"in t?t.separator:u;r="length"in t?kc(t.length):r,e="omission"in t?vu(t.omission):e}n=Ec(n);var i=n.length;if(T(n)){var o=G(n);i=o.length}if(r>=i)return n;var f=r-V(e);if(f<1)return e;var c=o?Ou(o,0,f).join(""):n.slice(0,f);
vendor: 11,143 bytes, lines 5905-5926
5905if(u===X)return c+e;if(o&&(f+=c.length-f),Ah(u)){if(n.slice(f).search(u)){var a,l=c;for(u.global||(u=sl(u.source,Ec(Nt.exec(u))+"g")),u.lastIndex=0;a=u.exec(l);)var s=a.index;
5906c=c.slice(0,s===X?f:s)}}else if(n.indexOf(vu(u),f)!=f){var h=c.lastIndexOf(u);h>-1&&(c=c.slice(0,h))}return c+e}function Ia(n){return n=Ec(n),n&&jt.test(n)?n.replace(mt,ye):n}function Ra(n,t,r){return n=Ec(n),t=r?X:t,t===X?$(n)?Q(n):_(n):n.match(t)||[]}function za(t){var r=null==t?0:t.length,e=mi();return t=r?c(t,function(n){if("function"!=typeof n[1])throw new pl(en);return[e(n[0]),n[1]]}):[],uu(function(e){for(var u=-1;++u<r;){var i=t[u];if(n(i[0],this,e))return n(i[1],this,e)}})}function Ea(n){
5907return Nr(Fr(n,an))}function Sa(n){return function(){return n}}function Wa(n,t){return null==n||n!==n?t:n}function La(n){return n}function Ca(n){return De("function"==typeof n?n:Fr(n,an))}function Ua(n){return qe(Fr(n,an))}function Ba(n,t){return Ze(n,Fr(t,an))}function Ta(n,t,e){var u=Pc(t),i=fe(t,u);null!=e||fc(t)&&(i.length||!u.length)||(e=t,t=n,n=this,i=fe(t,Pc(t)));var o=!(fc(e)&&"chain"in e&&!e.chain),f=uc(n);return r(i,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;
5908if(o||t){var r=n(this.__wrapped__);return(r.__actions__=Tu(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))})}),n}function $a(){return re._===this&&(re._=Al),this}function Da(){}function Ma(n){return n=kc(n),uu(function(t){return Ge(t,n)})}function Fa(n){return Bi(n)?m(no(n)):Qe(n)}function Na(n){return function(t){return null==n?X:_e(n,t)}}function Pa(){return[]}function qa(){return!1}function Za(){return{}}function Ka(){return"";
5909}function Va(){return!0}function Ga(n,t){if(n=kc(n),n<1||n>Wn)return[];var r=Un,e=Hl(n,Un);t=mi(t),n-=Un;for(var u=O(e,t);++r<n;)t(r);return u}function Ha(n){return bh(n)?c(n,no):bc(n)?[n]:Tu(Cs(Ec(n)))}function Ja(n){var t=++wl;return Ec(n)+t}function Ya(n){return n&&n.length?Yr(n,La,me):X}function Qa(n,t){return n&&n.length?Yr(n,mi(t,2),me):X}function Xa(n){return w(n,La)}function nl(n,t){return w(n,mi(t,2))}function tl(n){return n&&n.length?Yr(n,La,Ne):X}function rl(n,t){return n&&n.length?Yr(n,mi(t,2),Ne):X;
5910}function el(n){return n&&n.length?k(n,La):0}function ul(n,t){return n&&n.length?k(n,mi(t,2)):0}x=null==x?re:be.defaults(re.Object(),x,be.pick(re,qr));var il=x.Array,ol=x.Date,fl=x.Error,cl=x.Function,al=x.Math,ll=x.Object,sl=x.RegExp,hl=x.String,pl=x.TypeError,_l=il.prototype,vl=cl.prototype,gl=ll.prototype,yl=x["__core-js_shared__"],dl=vl.toString,bl=gl.hasOwnProperty,wl=0,ml=function(){var n=/[^.]+$/.exec(yl&&yl.keys&&yl.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),xl=gl.toString,jl=dl.call(ll),Al=re._,kl=sl("^"+dl.call(bl).replace(St,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ol=ie?x.Buffer:X,Il=x.Symbol,Rl=x.Uint8Array,zl=Ol?Ol.allocUnsafe:X,El=F(ll.getPrototypeOf,ll),Sl=ll.create,Wl=gl.propertyIsEnumerable,Ll=_l.splice,Cl=Il?Il.isConcatSpreadable:X,Ul=Il?Il.iterator:X,Bl=Il?Il.toStringTag:X,Tl=function(){
5911try{var n=Ai(ll,"defineProperty");return n({},"",{}),n}catch(n){}}(),$l=x.clearTimeout!==re.clearTimeout&&x.clearTimeout,Dl=ol&&ol.now!==re.Date.now&&ol.now,Ml=x.setTimeout!==re.setTimeout&&x.setTimeout,Fl=al.ceil,Nl=al.floor,Pl=ll.getOwnPropertySymbols,ql=Ol?Ol.isBuffer:X,Zl=x.isFinite,Kl=_l.join,Vl=F(ll.keys,ll),Gl=al.max,Hl=al.min,Jl=ol.now,Yl=x.parseInt,Ql=al.random,Xl=_l.reverse,ns=Ai(x,"DataView"),ts=Ai(x,"Map"),rs=Ai(x,"Promise"),es=Ai(x,"Set"),us=Ai(x,"WeakMap"),is=Ai(ll,"create"),os=us&&new us,fs={},cs=to(ns),as=to(ts),ls=to(rs),ss=to(es),hs=to(us),ps=Il?Il.prototype:X,_s=ps?ps.valueOf:X,vs=ps?ps.toString:X,gs=function(){
5912function n(){}return function(t){if(!fc(t))return{};if(Sl)return Sl(t);n.prototype=t;var r=new n;return n.prototype=X,r}}();Z.templateSettings={escape:kt,evaluate:Ot,interpolate:It,variable:"",imports:{_:Z}},Z.prototype=J.prototype,Z.prototype.constructor=Z,Y.prototype=gs(J.prototype),Y.prototype.constructor=Y,Ct.prototype=gs(J.prototype),Ct.prototype.constructor=Ct,Xt.prototype.clear=nr,Xt.prototype.delete=tr,Xt.prototype.get=rr,Xt.prototype.has=er,Xt.prototype.set=ur,ir.prototype.clear=or,ir.prototype.delete=fr,
5913ir.prototype.get=cr,ir.prototype.has=ar,ir.prototype.set=lr,sr.prototype.clear=hr,sr.prototype.delete=pr,sr.prototype.get=_r,sr.prototype.has=vr,sr.prototype.set=gr,yr.prototype.add=yr.prototype.push=dr,yr.prototype.has=br,wr.prototype.clear=mr,wr.prototype.delete=xr,wr.prototype.get=jr,wr.prototype.has=Ar,wr.prototype.set=kr;var ys=Pu(ue),ds=Pu(oe,!0),bs=qu(),ws=qu(!0),ms=os?function(n,t){return os.set(n,t),n}:La,xs=Tl?function(n,t){return Tl(n,"toString",{configurable:!0,enumerable:!1,value:Sa(t),
5914writable:!0})}:La,js=uu,As=$l||function(n){return re.clearTimeout(n)},ks=es&&1/P(new es([,-0]))[1]==Sn?function(n){return new es(n)}:Da,Os=os?function(n){return os.get(n)}:Da,Is=Pl?function(n){return null==n?[]:(n=ll(n),i(Pl(n),function(t){return Wl.call(n,t)}))}:Pa,Rs=Pl?function(n){for(var t=[];n;)a(t,Is(n)),n=El(n);return t}:Pa,zs=we;(ns&&zs(new ns(new ArrayBuffer(1)))!=ct||ts&&zs(new ts)!=Gn||rs&&zs(rs.resolve())!=Qn||es&&zs(new es)!=tt||us&&zs(new us)!=it)&&(zs=function(n){var t=we(n),r=t==Yn?n.constructor:X,e=r?to(r):"";
5915if(e)switch(e){case cs:return ct;case as:return Gn;case ls:return Qn;case ss:return tt;case hs:return it}return t});var Es=yl?uc:qa,Ss=Qi(ms),Ws=Ml||function(n,t){return re.setTimeout(n,t)},Ls=Qi(xs),Cs=Pi(function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(Et,function(n,r,e,u){t.push(e?u.replace(Mt,"$1"):r||n)}),t}),Us=uu(function(n,t){return Jf(n)?Hr(n,ee(t,1,Jf,!0)):[]}),Bs=uu(function(n,t){var r=jo(t);return Jf(r)&&(r=X),Jf(n)?Hr(n,ee(t,1,Jf,!0),mi(r,2)):[]}),Ts=uu(function(n,t){
5916var r=jo(t);return Jf(r)&&(r=X),Jf(n)?Hr(n,ee(t,1,Jf,!0),X,r):[]}),$s=uu(function(n){var t=c(n,ju);return t.length&&t[0]===n[0]?ke(t):[]}),Ds=uu(function(n){var t=jo(n),r=c(n,ju);return t===jo(r)?t=X:r.pop(),r.length&&r[0]===n[0]?ke(r,mi(t,2)):[]}),Ms=uu(function(n){var t=jo(n),r=c(n,ju);return t="function"==typeof t?t:X,t&&r.pop(),r.length&&r[0]===n[0]?ke(r,X,t):[]}),Fs=uu(Oo),Ns=gi(function(n,t){var r=null==n?0:n.length,e=Tr(n,t);return nu(n,c(t,function(n){return Ci(n,r)?+n:n}).sort(Lu)),e}),Ps=uu(function(n){
5917return gu(ee(n,1,Jf,!0))}),qs=uu(function(n){var t=jo(n);return Jf(t)&&(t=X),gu(ee(n,1,Jf,!0),mi(t,2))}),Zs=uu(function(n){var t=jo(n);return t="function"==typeof t?t:X,gu(ee(n,1,Jf,!0),X,t)}),Ks=uu(function(n,t){return Jf(n)?Hr(n,t):[]}),Vs=uu(function(n){return mu(i(n,Jf))}),Gs=uu(function(n){var t=jo(n);return Jf(t)&&(t=X),mu(i(n,Jf),mi(t,2))}),Hs=uu(function(n){var t=jo(n);return t="function"==typeof t?t:X,mu(i(n,Jf),X,t)}),Js=uu(Go),Ys=uu(function(n){var t=n.length,r=t>1?n[t-1]:X;return r="function"==typeof r?(n.pop(),
5918r):X,Ho(n,r)}),Qs=gi(function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,u=function(t){return Tr(t,n)};return!(t>1||this.__actions__.length)&&e instanceof Ct&&Ci(r)?(e=e.slice(r,+r+(t?1:0)),e.__actions__.push({func:nf,args:[u],thisArg:X}),new Y(e,this.__chain__).thru(function(n){return t&&!n.length&&n.push(X),n})):this.thru(u)}),Xs=Fu(function(n,t,r){bl.call(n,r)?++n[r]:Br(n,r,1)}),nh=Ju(ho),th=Ju(po),rh=Fu(function(n,t,r){bl.call(n,r)?n[r].push(t):Br(n,r,[t])}),eh=uu(function(t,r,e){var u=-1,i="function"==typeof r,o=Hf(t)?il(t.length):[];
5919return ys(t,function(t){o[++u]=i?n(r,t,e):Ie(t,r,e)}),o}),uh=Fu(function(n,t,r){Br(n,r,t)}),ih=Fu(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),oh=uu(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Ui(n,t[0],t[1])?t=[]:r>2&&Ui(t[0],t[1],t[2])&&(t=[t[0]]),He(n,ee(t,1),[])}),fh=Dl||function(){return re.Date.now()},ch=uu(function(n,t,r){var e=_n;if(r.length){var u=N(r,wi(ch));e|=bn}return ai(n,e,t,r,u)}),ah=uu(function(n,t,r){var e=_n|vn;if(r.length){var u=N(r,wi(ah));e|=bn;
5920}return ai(t,e,n,r,u)}),lh=uu(function(n,t){return Gr(n,1,t)}),sh=uu(function(n,t,r){return Gr(n,Ic(t)||0,r)});Cf.Cache=sr;var hh=js(function(t,r){r=1==r.length&&bh(r[0])?c(r[0],z(mi())):c(ee(r,1),z(mi()));var e=r.length;return uu(function(u){for(var i=-1,o=Hl(u.length,e);++i<o;)u[i]=r[i].call(this,u[i]);return n(t,this,u)})}),ph=uu(function(n,t){return ai(n,bn,X,t,N(t,wi(ph)))}),_h=uu(function(n,t){return ai(n,wn,X,t,N(t,wi(_h)))}),vh=gi(function(n,t){return ai(n,xn,X,X,X,t)}),gh=ii(me),yh=ii(function(n,t){
5921return n>=t}),dh=Re(function(){return arguments}())?Re:function(n){return cc(n)&&bl.call(n,"callee")&&!Wl.call(n,"callee")},bh=il.isArray,wh=ce?z(ce):ze,mh=ql||qa,xh=ae?z(ae):Ee,jh=le?z(le):Le,Ah=se?z(se):Be,kh=he?z(he):Te,Oh=pe?z(pe):$e,Ih=ii(Ne),Rh=ii(function(n,t){return n<=t}),zh=Nu(function(n,t){if(Mi(t)||Hf(t))return $u(t,Pc(t),n),X;for(var r in t)bl.call(t,r)&&Sr(n,r,t[r])}),Eh=Nu(function(n,t){$u(t,qc(t),n)}),Sh=Nu(function(n,t,r,e){$u(t,qc(t),n,e)}),Wh=Nu(function(n,t,r,e){$u(t,Pc(t),n,e);
5922}),Lh=gi(Tr),Ch=uu(function(n,t){n=ll(n);var r=-1,e=t.length,u=e>2?t[2]:X;for(u&&Ui(t[0],t[1],u)&&(e=1);++r<e;)for(var i=t[r],o=qc(i),f=-1,c=o.length;++f<c;){var a=o[f],l=n[a];(l===X||Gf(l,gl[a])&&!bl.call(n,a))&&(n[a]=i[a])}return n}),Uh=uu(function(t){return t.push(X,si),n(Mh,X,t)}),Bh=Xu(function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=xl.call(t)),n[t]=r},Sa(La)),Th=Xu(function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=xl.call(t)),bl.call(n,t)?n[t].push(r):n[t]=[r]},mi),$h=uu(Ie),Dh=Nu(function(n,t,r){
5923Ke(n,t,r)}),Mh=Nu(function(n,t,r,e){Ke(n,t,r,e)}),Fh=gi(function(n,t){var r={};if(null==n)return r;var e=!1;t=c(t,function(t){return t=ku(t,n),e||(e=t.length>1),t}),$u(n,di(n),r),e&&(r=Fr(r,an|ln|sn,hi));for(var u=t.length;u--;)yu(r,t[u]);return r}),Nh=gi(function(n,t){return null==n?{}:Je(n,t)}),Ph=ci(Pc),qh=ci(qc),Zh=Vu(function(n,t,r){return t=t.toLowerCase(),n+(r?fa(t):t)}),Kh=Vu(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Vh=Vu(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Gh=Ku("toLowerCase"),Hh=Vu(function(n,t,r){
5924return n+(r?"_":"")+t.toLowerCase()}),Jh=Vu(function(n,t,r){return n+(r?" ":"")+Qh(t)}),Yh=Vu(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),Qh=Ku("toUpperCase"),Xh=uu(function(t,r){try{return n(t,X,r)}catch(n){return rc(n)?n:new fl(n)}}),np=gi(function(n,t){return r(t,function(t){t=no(t),Br(n,t,ch(n[t],n))}),n}),tp=Yu(),rp=Yu(!0),ep=uu(function(n,t){return function(r){return Ie(r,n,t)}}),up=uu(function(n,t){return function(r){return Ie(n,r,t)}}),ip=ti(c),op=ti(u),fp=ti(h),cp=ui(),ap=ui(!0),lp=ni(function(n,t){
5925return n+t},0),sp=fi("ceil"),hp=ni(function(n,t){return n/t},1),pp=fi("floor"),_p=ni(function(n,t){return n*t},1),vp=fi("round"),gp=ni(function(n,t){return n-t},0);return Z.after=If,Z.ary=Rf,Z.assign=zh,Z.assignIn=Eh,Z.assignInWith=Sh,Z.assignWith=Wh,Z.at=Lh,Z.before=zf,Z.bind=ch,Z.bindAll=np,Z.bindKey=ah,Z.castArray=Nf,Z.chain=Qo,Z.chunk=uo,Z.compact=io,Z.concat=oo,Z.cond=za,Z.conforms=Ea,Z.constant=Sa,Z.countBy=Xs,Z.create=Sc,Z.curry=Ef,Z.curryRight=Sf,Z.debounce=Wf,Z.defaults=Ch,Z.defaultsDeep=Uh,
5926Z.defer=lh,Z.delay=sh,Z.difference=Us,Z.differenceBy=Bs,Z.differenceWith=Ts,Z.drop=fo,Z.dropRight=co,Z.dropRightWhile=a
vendor: 4,488 bytes, lines 5926-5934
5926o,Z.dropWhile=lo,Z.fill=so,Z.filter=lf,Z.flatMap=sf,Z.flatMapDeep=hf,Z.flatMapDepth=pf,Z.flatten=_o,Z.flattenDeep=vo,Z.flattenDepth=go,Z.flip=Lf,Z.flow=tp,Z.flowRight=rp,Z.fromPairs=yo,Z.functions=$c,Z.functionsIn=Dc,Z.groupBy=rh,Z.initial=mo,Z.intersection=$s,Z.intersectionBy=Ds,Z.intersectionWith=Ms,Z.invert=Bh,Z.invertBy=Th,Z.invokeMap=eh,Z.iteratee=Ca,Z.keyBy=uh,Z.keys=Pc,Z.keysIn=qc,
5927Z.map=yf,Z.mapKeys=Zc,Z.mapValues=Kc,Z.matches=Ua,Z.matchesProperty=Ba,Z.memoize=Cf,Z.merge=Dh,Z.mergeWith=Mh,Z.method=ep,Z.methodOf=up,Z.mixin=Ta,Z.negate=Uf,Z.nthArg=Ma,Z.omit=Fh,Z.omitBy=Vc,Z.once=Bf,Z.orderBy=df,Z.over=ip,Z.overArgs=hh,Z.overEvery=op,Z.overSome=fp,Z.partial=ph,Z.partialRight=_h,Z.partition=ih,Z.pick=Nh,Z.pickBy=Gc,Z.property=Fa,Z.propertyOf=Na,Z.pull=Fs,Z.pullAll=Oo,Z.pullAllBy=Io,Z.pullAllWith=Ro,Z.pullAt=Ns,Z.range=cp,Z.rangeRight=ap,Z.rearg=vh,Z.reject=mf,Z.remove=zo,Z.rest=Tf,
5928Z.reverse=Eo,Z.sampleSize=jf,Z.set=Jc,Z.setWith=Yc,Z.shuffle=Af,Z.slice=So,Z.sortBy=oh,Z.sortedUniq=$o,Z.sortedUniqBy=Do,Z.split=da,Z.spread=$f,Z.tail=Mo,Z.take=Fo,Z.takeRight=No,Z.takeRightWhile=Po,Z.takeWhile=qo,Z.tap=Xo,Z.throttle=Df,Z.thru=nf,Z.toArray=jc,Z.toPairs=Ph,Z.toPairsIn=qh,Z.toPath=Ha,Z.toPlainObject=Rc,Z.transform=Qc,Z.unary=Mf,Z.union=Ps,Z.unionBy=qs,Z.unionWith=Zs,Z.uniq=Zo,Z.uniqBy=Ko,Z.uniqWith=Vo,Z.unset=Xc,Z.unzip=Go,Z.unzipWith=Ho,Z.update=na,Z.updateWith=ta,Z.values=ra,Z.valuesIn=ea,
5929Z.without=Ks,Z.words=Ra,Z.wrap=Ff,Z.xor=Vs,Z.xorBy=Gs,Z.xorWith=Hs,Z.zip=Js,Z.zipObject=Jo,Z.zipObjectDeep=Yo,Z.zipWith=Ys,Z.entries=Ph,Z.entriesIn=qh,Z.extend=Eh,Z.extendWith=Sh,Ta(Z,Z),Z.add=lp,Z.attempt=Xh,Z.camelCase=Zh,Z.capitalize=fa,Z.ceil=sp,Z.clamp=ua,Z.clone=Pf,Z.cloneDeep=Zf,Z.cloneDeepWith=Kf,Z.cloneWith=qf,Z.conformsTo=Vf,Z.deburr=ca,Z.defaultTo=Wa,Z.divide=hp,Z.endsWith=aa,Z.eq=Gf,Z.escape=la,Z.escapeRegExp=sa,Z.every=af,Z.find=nh,Z.findIndex=ho,Z.findKey=Wc,Z.findLast=th,Z.findLastIndex=po,
5930Z.findLastKey=Lc,Z.floor=pp,Z.forEach=_f,Z.forEachRight=vf,Z.forIn=Cc,Z.forInRight=Uc,Z.forOwn=Bc,Z.forOwnRight=Tc,Z.get=Mc,Z.gt=gh,Z.gte=yh,Z.has=Fc,Z.hasIn=Nc,Z.head=bo,Z.identity=La,Z.includes=gf,Z.indexOf=wo,Z.inRange=ia,Z.invoke=$h,Z.isArguments=dh,Z.isArray=bh,Z.isArrayBuffer=wh,Z.isArrayLike=Hf,Z.isArrayLikeObject=Jf,Z.isBoolean=Yf,Z.isBuffer=mh,Z.isDate=xh,Z.isElement=Qf,Z.isEmpty=Xf,Z.isEqual=nc,Z.isEqualWith=tc,Z.isError=rc,Z.isFinite=ec,Z.isFunction=uc,Z.isInteger=ic,Z.isLength=oc,Z.isMap=jh,
5931Z.isMatch=ac,Z.isMatchWith=lc,Z.isNaN=sc,Z.isNative=hc,Z.isNil=_c,Z.isNull=pc,Z.isNumber=vc,Z.isObject=fc,Z.isObjectLike=cc,Z.isPlainObject=gc,Z.isRegExp=Ah,Z.isSafeInteger=yc,Z.isSet=kh,Z.isString=dc,Z.isSymbol=bc,Z.isTypedArray=Oh,Z.isUndefined=wc,Z.isWeakMap=mc,Z.isWeakSet=xc,Z.join=xo,Z.kebabCase=Kh,Z.last=jo,Z.lastIndexOf=Ao,Z.lowerCase=Vh,Z.lowerFirst=Gh,Z.lt=Ih,Z.lte=Rh,Z.max=Ya,Z.maxBy=Qa,Z.mean=Xa,Z.meanBy=nl,Z.min=tl,Z.minBy=rl,Z.stubArray=Pa,Z.stubFalse=qa,Z.stubObject=Za,Z.stubString=Ka,
5932Z.stubTrue=Va,Z.multiply=_p,Z.nth=ko,Z.noConflict=$a,Z.noop=Da,Z.now=fh,Z.pad=ha,Z.padEnd=pa,Z.padStart=_a,Z.parseInt=va,Z.random=oa,Z.reduce=bf,Z.reduceRight=wf,Z.repeat=ga,Z.replace=ya,Z.result=Hc,Z.round=vp,Z.runInContext=p,Z.sample=xf,Z.size=kf,Z.snakeCase=Hh,Z.some=Of,Z.sortedIndex=Wo,Z.sortedIndexBy=Lo,Z.sortedIndexOf=Co,Z.sortedLastIndex=Uo,Z.sortedLastIndexBy=Bo,Z.sortedLastIndexOf=To,Z.startCase=Jh,Z.startsWith=ba,Z.subtract=gp,Z.sum=el,Z.sumBy=ul,Z.template=wa,Z.times=Ga,Z.toFinite=Ac,Z.toInteger=kc,
5933Z.toLength=Oc,Z.toLower=ma,Z.toNumber=Ic,Z.toSafeInteger=zc,Z.toString=Ec,Z.toUpper=xa,Z.trim=ja,Z.trimEnd=Aa,Z.trimStart=ka,Z.truncate=Oa,Z.unescape=Ia,Z.uniqueId=Ja,Z.upperCase=Yh,Z.upperFirst=Qh,Z.each=_f,Z.eachRight=vf,Z.first=bo,Ta(Z,function(){var n={};return ue(Z,function(t,r){bl.call(Z.prototype,r)||(n[r]=t)}),n}(),{chain:!1}),Z.VERSION=nn,r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){Z[n].placeholder=Z}),r(["drop","take"],function(n,t){Ct.prototype[n]=function(r){
5934r=r===X?1:Gl(kc(r),0);var e=this.__filtered__&&!t?new Ct(this):this.clone();return e.__filtered__?e.__takeCount__=Hl(r,e.__takeCount__):e.__views__.push({size:Hl(r,Un),type:n+(e.__dir__<0?"Right":"")}),e},Ct.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),r(["filter","map","takeWhile"],function(n,t){var r=t+1,e=r==Rn||r==En;Ct.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:mi(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),r(["head","last"],function(n,t){
5935var r="take"+(t?"Right":"");Ct.prototype[n]=function(){return this[r](1).value()[0]}}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Ct.prototype[n]=function(){return this.__filtered__?new Ct(this):this[r](1)}}),Ct.prototype.compact=function(){return this.filter(La)},Ct.prototype.find=function(n){return this.filter(n).head()},Ct.prototype.findLast=function(n){return this.reverse().find(n)},Ct.prototype.invokeMap=uu(function(n,t){return"function"==typeof n?new Ct(this):this.map(function(r){
5936return Ie(r,n,t)})}),Ct.prototype.reject=function(n){return this.filter(Uf(mi(n)))},Ct.prototype.slice=function(n,t){n=kc(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Ct(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==X&&(t=kc(t),r=t<0?r.dropRight(-t):r.take(t-n)),r)},Ct.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ct.prototype.toArray=function(){return this.take(Un)},ue(Ct.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=Z[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);
5937u&&(Z.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,f=t instanceof Ct,c=o[0],l=f||bh(t),s=function(n){var t=u.apply(Z,a([n],o));return e&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(f=l=!1);var h=this.__chain__,p=!!this.__actions__.length,_=i&&!h,v=f&&!p;if(!i&&l){t=v?t:new Ct(this);var g=n.apply(t,o);return g.__actions__.push({func:nf,args:[s],thisArg:X}),new Y(g,h)}return _&&v?n.apply(this,o):(g=this.thru(s),_?e?g.value()[0]:g.value():g)})}),r(["pop","push","shift","sort","splice","unshift"],function(n){
5938var t=_l[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);Z.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(bh(u)?u:[],n)}return this[r](function(r){return t.apply(bh(r)?r:[],n)})}}),ue(Ct.prototype,function(n,t){var r=Z[t];if(r){var e=r.name+"";bl.call(fs,e)||(fs[e]=[]),fs[e].push({name:t,func:r})}}),fs[Qu(X,vn).name]=[{name:"wrapper",func:X}],Ct.prototype.clone=$t,Ct.prototype.reverse=Yt,Ct.prototype.value=Qt,Z.prototype.at=Qs,
5939Z.prototype.chain=tf,Z.prototype.commit=rf,Z.prototype.next=ef,Z.prototype.plant=of,Z.prototype.reverse=ff,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=cf,Z.prototype.first=Z.prototype.head,Ul&&(Z.prototype[Ul]=uf),Z},be=de();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(re._=be,define(function(){return be})):ue?((ue.exports=be)._=be,ee._=be):re._=be}).call(this);
5940_.any = _.some;
5941_.unique = _.uniq;
5942_.contains = _.includes;
5943_.methods = _.functions;
5944_.compose = _.flowRight;
5945_.backflow = _.flowRight;
5946_.select = _.filter;
5947_.inject = _.reduce;
5948_.include = _.includes;
5949_.foldr = _.reduceRight;
5950_.foldl = _.reduceRight;
5951_.detect = _.find;
5952_.collect = _.map;
5953_.all = _.every;
5954_.object = _.zipObject;
5955_.findWhere = _.find;
5956_.where = _.filter;
5957
5958/*  modernizr  */
5959/*! modernizr 3.11.0 (Custom Build) | MIT *
5960 * https://modernizr.com/download/?-applicationcache-audio-audioautoplay-backgroundsize-borderimage-borderradius-boxshadow-canvas-canvastext-cssanimations-csscolumns-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-flexbox-fontface-generatedcontent-geolocation-hashchange-history-hsla-indexeddb-inlinesvg-input-inputformnovalidate-inputtypes-localstorage-multiplebgs-opacity-postmessage-rgba-sessionstorage-smil-svg-svgclippaths-textshadow-video-webgl-websockets-websqldatabase-webworkers-addtest-domprefixes-hasevent-load-mq-prefixed-prefixes-setclasses-shiv-testallprops-testprop-teststyles !*/
5961!function (e, t, n, o) { function r(e, t) { return typeof e === t } function a(e) { var t = A.className, n = Modernizr._config.classPrefix || ""; if (C && (t = t.baseVal), Modernizr._config.enableJSClass) { var o = new RegExp("(^|\\s)" + n + "no-js(\\s|$)"); t = t.replace(o, "$1" + n + "js$2") } Modernizr._config.enableClasses && (e.length > 0 && (t += " " + n + e.join(" " + n)), C ? A.className.baseVal = t : A.className = t) } function i(e, t) { if ("object" == typeof e) for (var n in e) x(e, n) && i(n, e[n]); else { e = e.toLowerCase(); var o = e.split("."), r = Modernizr[o[0]]; if (2 === o.length && (r = r[o[1]]), void 0 !== r) return Modernizr; t = "function" == typeof t ? t() : t, 1 === o.length ? Modernizr[o[0]] = t : (!Modernizr[o[0]] || Modernizr[o[0]] instanceof Boolean || (Modernizr[o[0]] = new Boolean(Modernizr[o[0]])), Modernizr[o[0]][o[1]] = t), a([(t && !1 !== t ? "" : "no-") + o.join("-")]), Modernizr._trigger(e, t) } return Modernizr } function s() { return "function" != typeof n.createElement ? n.createElement(arguments[0]) : C ? n.createElementNS.call(n, "http://www.w3.org/2000/svg", arguments[0]) : n.createElement.apply(n, arguments) } function d() { var e = n.body; return e || (e = s(C ? "svg" : "body"), e.fake = !0), e } function c(e, t, o, r) { var a, i, c, l, u = "modernizr", f = s("div"), p = d(); if (parseInt(o, 10)) for (; o--;)c = s("div"), c.id = r ? r[o] : u + (o + 1), f.appendChild(c); return a = s("style"), a.type = "text/css", a.id = "s" + u, (p.fake ? p : f).appendChild(a), p.appendChild(f), a.styleSheet ? a.styleSheet.cssText = e : a.appendChild(n.createTextNode(e)), f.id = u, p.fake && (p.style.background = "", p.style.overflow = "hidden", l = A.style.overflow, A.style.overflow = "hidden", A.appendChild(p)), i = t(f, e), p.fake && p.parentNode ? (p.parentNode.removeChild(p), A.style.overflow = l, A.offsetHeight) : f.parentNode.removeChild(f), !!i } function l(e, n, o) { var r; if ("getComputedStyle" in t) { r = getComputedStyle.call(t, e, n); var a = t.console; if (null !== r) o && (r = r.getPropertyValue(o)); else if (a) { var i = a.error ? "error" : "log"; a[i].call(a, "getComputedStyle returning null, its possible modernizr test results are inaccurate") } } else r = !n && e.currentStyle && e.currentStyle[o]; return r }
5961 function u(e, t) { return !!~("" + e).indexOf(t) } function f(e) { return e.replace(/([A-Z])/g, function (e, t) { return "-" + t.toLowerCase() }).replace(/^ms-/, "-ms-") } function p(e, n) { var r = e.length; if ("CSS" in t && "supports" in t.CSS) { for (; r--;)if (t.CSS.supports(f(e[r]), n)) return !0; return !1 } if ("CSSSupportsRule" in t) { for (var a = []; r--;)a.push("(" + f(e[r]) + ":" + n + ")"); return a = a.join(" or "), c("@supports (" + a + ") { #modernizr { position: absolute; } }", function (e) { return "absolute" === l(e, null, "position") }) } return o } function m(e) { return e.replace(/([a-z])-([a-z])/g, function (e, t, n) { return t + n.toUpperCase() }).replace(/^-/, "") } function v(e, t, n, a) { function i() { c && (delete R.style, delete R.modElem) } if (a = !r(a, "undefined") && a, !r(n, "undefined")) { var d = p(e, n); if (!r(d, "undefined")) return d } for (var c, l, f, v, h, g = ["modernizr", "tspan", "samp"]; !R.style && g.length;)c = !0, R.modElem = s(g.shift()), R.style = R.modElem.style; for (f = e.length, l = 0; l < f; l++)if (v = e[l], h = R.style[v], u(v, "-") && (v = m(v)), R.style[v] !== o) { if (a || r(n, "undefined")) return i(), "pfx" !== t || v; try { R.style[v] = n } catch (e) { } if (R.style[v] !== h) return i(), "pfx" !== t || v } return i(), !1 } function h(e, t) { return function () { return e.apply(t, arguments) } } function g(e, t, n) { var o; for (var a in e) if (e[a] in t) return !1 === n ? e[a] : (o = t[e[a]], r(o, "function") ? h(o, n || t) : o); return !1 } function y(e, t, n, o, a) { var i = e.charAt(0).toUpperCase() + e.slice(1), s = (e + " " + z.join(i + " ") + i).split(" "); return r(t, "string") || r(t, "undefined") ? v(s, t, o, a) : (s = (e + " " + k.join(i + " ") + i).split(" "), g(s, t, n)) } function b(e, t, n) { return y(e, o, o, t, n) } function T(e, t) { var n = e.deleteDatabase(t); n.onsuccess = function () { i("indexeddb.deletedatabase", !0) }, n.onerror = function () { i("indexeddb.deletedatabase", !1) } } var q = [], w = { _version: "3.11.0", _config: { classPrefix: "", enableClasses: !0, enableJSClass: !0, usePrefixes: !0 }, _q: [], on: function (e, t) { var n = this; setTimeout(function () { t(n[e]) }, 0) }, addTest: function (e, t, n) { q.push({ name: e, fn: t, options: n }) }, addAsyncTest: function (e) { q.push({ name: null, fn: e }) } }, Modernizr = function () { }; Modernizr.prototype = w, Modernizr = new Modernizr; var x, S = [], A = n.documentElement, C = "svg" === A.nodeName.toLowerCase(); !function () { var e = {}.hasOwnProperty; x = r(e, "undefined") || r(e.call, "undefined") ? function (e, t) { return t in e && r(e.constructor.prototype[t], "undefined") } : function (t, n) { return e.call(t, n) } }(), w._l = {}, w.on = function (e, t) { this._l[e] || (this._l[e] = []), this._l[e].push(t), Modernizr.hasOwnProperty(e) && setTimeout(function () { Modernizr._trigger(e, Modernizr[e]) }, 0) }, w._trigger = function (e, t) { if (this._l[e]) { var n = this._l[e]; setTimeout(function () { var e; for (e = 0; e < n.length; e++)(0, n[e])(t) }, 0), delete this._l[e] } }, Modernizr._q.push(function () { w.addTest = i }); var E = "Moz O ms Webkit", k = w._config.usePrefixes ? E.toLowerCase().split(" ") : []; w._domPrefixes = k; var P = function () { function e(e, n) { var r; return !!e && (n && "string" != typeof n || (n = s(n || "div")), e = "on" + e, r = e in n, !r && t && (n.setAttribute || (n = s("div")), n.setAttribute(e, ""), r = "function" == typeof n[e], n[e] !== o && (n[e] = o), n.removeAttribute(e)), r) } var t = !("onblur" in A); return e }(); w.hasEvent = P; C || function (e, t) { function n(e, t) { var n = e.createElement("p"), o = e.getElementsByTagName("head")[0] || e.documentElement; return n.innerHTML = "x<style>" + t + "</style>", o.insertBefore(n.lastChild, o.firstChild) } function o() { var e = y.elements; return "string" == typeof e ? e.split(" ") : e } function r(e, t) { var n = y.elements; "string" != typeof n && (n = n.join(" ")), "string" != typeof e && (e = e.join(" ")), y.elements = n + " " + e, c(t) } function a(e) { var t = g[e[v]]; return t || (t = {}, h++ , e[v] = h, g[h] = t), t } function i(e, n, o) { if (n || (n = t), u) return n.createElement(e); o || (o = a(n)); var r; return r = o.cache[e] ? o.cache[e].cloneNode() : m.test(e) ? (o.cache[e] = o.createElem(e)).cloneNode() : o.createElem(e), !r.canHaveChildren || p.test(e) || r.tagUrn ? r : o.frag.appendChild(r) } function s(e, n) { if (e || (e = t), u) return e.createDocumentFragment(); n = n || a(e); for (var r = n.frag.cloneNode(), i = 0, s = o(), d = s.length; i < d; i++)r.createElement(s[i]); return r }
5961 function d(e, t) { t.cache || (t.cache = {}, t.createElem = e.createElement, t.createFrag = e.createDocumentFragment, t.frag = t.createFrag()), e.createElement = function (n) { return y.shivMethods ? i(n, e, t) : t.createElem(n) }, e.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + o().join().replace(/[\w\-:]+/g, function (e) { return t.createElem(e), t.frag.createElement(e), 'c("' + e + '")' }) + ");return n}")(y, t.frag) } function c(e) { e || (e = t); var o = a(e); return !y.shivCSS || l || o.hasCSS || (o.hasCSS = !!n(e, "article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")), u || d(e, o), e } var l, u, f = e.html5 || {}, p = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i, m = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i, v = "_html5shiv", h = 0, g = {}; !function () { try { var e = t.createElement("a"); e.innerHTML = "<xyz></xyz>", l = "hidden" in e, u = 1 == e.childNodes.length || function () { t.createElement("a"); var e = t.createDocumentFragment(); return void 0 === e.cloneNode || void 0 === e.createDocumentFragment || void 0 === e.createElement }() } catch (e) { l = !0, u = !0 } }(); var y = { elements: f.elements || "abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video", version: "3.7.3", shivCSS: !1 !== f.shivCSS, supportsUnknownElements: u, shivMethods: !1 !== f.shivMethods, type: "default", shivDocument: c, createElement: i, createDocumentFragment: s, addElements: r }; e.html5 = y, c(t), "object" == typeof module && module.exports && (module.exports = y) }(void 0 !== t ? t : this, n); var M = function () { }, _ = function () { }; t.console && (M = function () { var e = console.error ? "error" : "log"; t.console[e].apply(t.console, Array.prototype.slice.call(arguments)) }, _ = function () { var e = console.warn ? "warn" : "log"; t.console[e].apply(t.console, Array.prototype.slice.call(arguments)) }), w.load = function () { "yepnope" in t ? (_("yepnope.js (aka Modernizr.load) is no longer included as part of Modernizr. yepnope appears to be available on the page, so we�ll use it to handle this call to Modernizr.load, but please update your code to use yepnope directly.\n See http://github.com/Modernizr/Modernizr/issues/1182 for more information."), t.yepnope.apply(t, [].slice.call(arguments, 0))) : M("yepnope.js (aka Modernizr.load) is no longer included as part of Modernizr. Get it from http://yepnopejs.com. See http://github.com/Modernizr/Modernizr/issues/1182 for more information.") }; var N = function () { var e = t.matchMedia || t.msMatchMedia; return e ? function (t) { var n = e(t); return n && n.matches || !1 } : function (e) { var t = !1; return c("@media " + e + " { #modernizr { position: absolute; } }", function (e) { t = "absolute" === l(e, null, "position") }), t } }(); w.mq = N; var z = w._config.usePrefixes ? E.split(" ") : []; w._cssomPrefixes = z; var j = { elem: s("modernizr") }; Modernizr._q.push(function () { delete j.elem }); var R = { style: j.elem.style }; Modernizr._q.unshift(function () { delete R.style }), w.testAllProps = y; var B = function (e) { var n, r = L.length, a = t.CSSRule; if (void 0 === a) return o; if (!e) return !1; if (e = e.replace(/^@/, ""), (n = e.replace(/-/g, "_").toUpperCase() + "_RULE") in a) return "@" + e; for (var i = 0; i < r; i++) { var s = L[i]; if (s.toUpperCase() + "_" + n in a) return "@-" + s.toLowerCase() + "-" + e } return !1 }; w.atRule = B; var I = w.prefixed = function (e, t, n) { return 0 === e.indexOf("@") ? B(e) : (-1 !== e.indexOf("-") && (e = m(e)), t ? y(e, t, n) : y(e, "pfx")) }, L = w._config.usePrefixes ? " -webkit- -moz- -o- -ms- ".split(" ") : ["", ""]; w._prefixes = L, w.testAllProps = b; var $ = w.testProp = function (e, t, n) { return v([e], o, t, n) }, O = w.testStyles = c; Modernizr.addTest("applicationcache", "applicationCache" in t), function () { var e = s("audio"); Modernizr.addTest("audio", function () { var t = !1; try { t = !!e.canPlayType, t && (t = new Boolean(t)) } catch (e) { } return t }); try { e.canPlayType && (Modernizr.addTest("audio.ogg", e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, "")), Modernizr.addTest("audio.mp3", e.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/, "")), Modernizr.addTest("audio.opus", e.canPlayType('audio/ogg; codecs="opus"') || e.canPlayType('audio/webm; codecs="opus"').replace(/^no$/, "")), Modernizr.addTest("audio.wav", e.canPlayType('audio/wav; codecs="1"').replace(/^no$/, "")), Modernizr.addTest("audio.m4a", (e.canPlayType("audio/x-m4a;") || e.canPlayType("audio/aac;")).replace(/^no$/, ""))) } catch (e) { } }(), Modernizr.addAsyncTest(function () { function e(s) { r++ , clearTimeout(t); var d = s && "playing" === s.type || 0 !== a.currentTime; if (!d && r < o) return void (t = setTimeout(e, n)); a.removeEventListener("playing", e, !1), i("audioautoplay", d), a.parentNode && a.parentNode.removeChild(a) } var t, n = 200, o = 5, r = 0, a = s("audio"), d = a.style; if (!(Modernizr.audio && "autoplay" in a)) return void i("audioautoplay", !1); d.position = "absolute", d.height = 0, d.width = 0; try { if (Modernizr.audio.mp3) a.src = "data:audio/mpeg;base64,/+MYxAAAAANIAUAAAASEEB/jwOFM/0MM/90b/+RhST//w4NFwOjf///PZu////9lns5GFDv//l9GlUIEEIAAAgIg8Ir/JGq3/+MYxDsLIj5QMYcoAP0dv9HIjUcH//yYSg+CIbkGP//8w0bLVjUP///3Z0x5QCAv/yLjwtGKTEFNRTMuOTeqqqqqqqqqqqqq/+MYxEkNmdJkUYc4AKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"; else { if (!Modernizr.audio.wav) return void i("audioautoplay", !1); a.src = "data:audio/wav;base64,UklGRjQAAABXQVZFZm10IBAAAAABAAEAEAAAABAAAAABAAgAZGF0YRAAAAB/f39/f39/f39/f39/f39/" } } catch (e) { return void i("audioautoplay", !1) } a.setAttribute("autoplay", ""), d.cssText = "display:none", A.appendChild(a), setTimeout(function () { a.addEventListener("playing", e, !1), t = setTimeout(e, n) }, 0) }), Modernizr.addTest("canvas", function () { var e = s("canvas"); return !(!e.getContext || !e.getContext("2d")) }), Modernizr.addTest("canvastext", function () { return !1 !== Modernizr.canvas && "function" == typeof s("canvas").getContext("2d").fillText }), Modernizr.addTest("geolocation", "geolocation" in navigator), Modernizr.addTest("hashchange", function () { return !1 !== P("hashchange", t) && (n.documentMode === o || n.documentMode > 7) }), Modernizr.addTest("history", function () { var e = navigator.userAgent; return !!e && ((-1 === e.indexOf("Android 2.") && -1 === e.indexOf("Android 4.0") || -1 === e.indexOf("Mobile Safari") || -1 !== e.indexOf("Chrome") || -1 !== e.indexOf("Windows Phone") || "file:" === location.protocol) && (t.history && "pushState" in t.history)) }), Modernizr.addAsyncTest(function () { var e;
5961 try { e = I("indexedDB", t) } catch (e) { } if (e) { var n, o = "modernizr-" + Math.random(); try { n = e.open(o) } catch (e) { return void i("indexeddb", !1) } n.onerror = function (t) { !n.error || "InvalidStateError" !== n.error.name && "UnknownError" !== n.error.name ? (i("indexeddb", !0), T(e, o)) : (i("indexeddb", !1), t.preventDefault()) }, n.onsuccess = function () { i("indexeddb", !0), T(e, o) } } else i("indexeddb", !1) }); var F = s("input"), U = "autocomplete autofocus list placeholder max min multiple pattern required step".split(" "), G = {}; Modernizr.input = function (e) { for (var n = 0, o = e.length; n < o; n++)G[e[n]] = !!(e[n] in F); return G.list && (G.list = !(!s("datalist") || !t.HTMLDataListElement)), G }(U), Modernizr.addTest("inputformnovalidate", !!("formNoValidate" in s("input")), { aliases: ["input-formnovalidate"] }), function () { for (var e, t, r, a = ["search", "tel", "url", "email", "datetime", "date", "month", "week", "time", "datetime-local", "number", "range", "color"], i = 0; i < a.length; i++)F.setAttribute("type", e = a[i]), r = "text" !== F.type && "style" in F, r && (F.value = "1)", F.style.cssText = "position:absolute;visibility:hidden;", /^range$/.test(e) && F.style.WebkitAppearance !== o ? (A.appendChild(F), t = n.defaultView, r = t.getComputedStyle && "textfield" !== t.getComputedStyle(F, null).WebkitAppearance && 0 !== F.offsetHeight, A.removeChild(F)) : /^(search|tel)$/.test(e) || (r = /^(url|email)$/.test(e) ? F.checkValidity && !1 === F.checkValidity() : "1)" !== F.value)), Modernizr.addTest("inputtypes." + e, !!r) }(); var D = !0; try { t.postMessage({ toString: function () { D = !1 } }, "*") } catch (e) { } Modernizr.addTest("postmessage", new Boolean("postMessage" in t)), Modernizr.addTest("postmessage.structuredclones", D), Modernizr.addTest("svg", !!n.createElementNS && !!n.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect); var V = {}.toString; Modernizr.addTest("svgclippaths", function () { return !!n.createElementNS && /SVGClipPath/.test(V.call(n.createElementNS("http://www.w3.org/2000/svg", "clipPath"))) }), Modernizr.addTest("inlinesvg", function () { var e = s("div"); return e.innerHTML = "<svg/>", "http://www.w3.org/2000/svg" === ("undefined" != typeof SVGRect && e.firstChild && e.firstChild.namespaceURI) }), Modernizr.addTest("smil", function () { return !!n.createElementNS && /SVGAnimate/.test(V.call(n.createElementNS("http://www.w3.org/2000/svg", "animate"))) }), function () { var e = s("video"); Modernizr.addTest("video", function () { var t = !1; try { t = !!e.canPlayType, t && (t = new Boolean(t)) } catch (e) { } return t }); try { e.canPlayType && (Modernizr.addTest("video.ogg", e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, "")), Modernizr.addTest("video.h264", e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, "")), Modernizr.addTest("video.h265", e.canPlayType('video/mp4; codecs="hev1"').replace(/^no$/, "")), Modernizr.addTest("video.webm", e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, "")), Modernizr.addTest("video.vp9", e.canPlayType('video/webm; codecs="vp9"').replace(/^no$/, "")), Modernizr.addTest("video.hls", e.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/, "")), Modernizr.addTest("video.av1", e.canPlayType('video/mp4; codecs="av01"').replace(/^no$/, ""))) } catch (e) { } }(), Modernizr.addTest("webgl", function () { return "WebGLRenderingContext" in t }); var H = !1; try { H = "WebSocket" in t && 2 === t.WebSocket.CLOSING } catch (e) { } Modernizr.addTest("websockets", H), Modernizr.addTest("cssanimations", b("animationName", "a", !0)), Modernizr.addTest("backgroundsize", b("backgroundSize", "100%", !0)), Modernizr.addTest("borderimage", b("borderImage", "url() 1", !0)), Modernizr.addTest("borderradius", b("borderRadius", "0px", !0)), Modernizr.addTest("boxshadow", b("boxShadow", "1px 1px", !0)), function () { Modernizr.addTest("csscolumns", function () { var e = !1, t = b("columnCount"); try { e = !!t, e && (e = new Boolean(e)) } catch (e) { } return e });
5961 for (var e, t, n = ["Width", "Span", "Fill", "Gap", "Rule", "RuleColor", "RuleStyle", "RuleWidth", "BreakBefore", "BreakAfter", "BreakInside"], o = 0; o < n.length; o++)e = n[o].toLowerCase(), t = b("column" + n[o]), "breakbefore" !== e && "breakafter" !== e && "breakinside" !== e || (t = t || b(n[o])), Modernizr.addTest("csscolumns." + e, t) }(), Modernizr.addTest("flexbox", b("flexBasis", "1px", !0)), function () { var e = navigator.userAgent, t = e.match(/w(eb)?osbrowser/gi), n = e.match(/windows phone/gi) && e.match(/iemobile\/([0-9])+/gi) && parseFloat(RegExp.$1) >= 9; return t || n }() ? Modernizr.addTest("fontface", !1) : O('@font-face {font-family:"font";src:url("https://")}', function (e, t) { var o = n.getElementById("smodernizr"), r = o.sheet || o.styleSheet, a = r ? r.cssRules && r.cssRules[0] ? r.cssRules[0].cssText : r.cssText || "" : "", i = /src/i.test(a) && 0 === a.indexOf(t.split(" ")[0]); Modernizr.addTest("fontface", i) }), O('#modernizr{font:0/0 a}#modernizr:after{content:":)";visibility:hidden;font:7px/1 a}', function (e) { Modernizr.addTest("generatedcontent", e.offsetHeight >= 6) }), Modernizr.addTest("cssgradients", function () { for (var e, t = "background-image:", n = "", o = 0, r = L.length - 1; o < r; o++)e = 0 === o ? "to " : "", n += t + L[o] + "linear-gradient(" + e + "left top, #9f9, white);"; Modernizr._config.usePrefixes && (n += t + "-webkit-gradient(linear,left top,right bottom,from(#9f9),to(white));"); var a = s("a"), i = a.style; return i.cssText = n, ("" + i.backgroundImage).indexOf("gradient") > -1 }), Modernizr.addTest("hsla", function () { var e = s("a").style; return e.cssText = "background-color:hsla(120,40%,100%,.5)", u(e.backgroundColor, "rgba") || u(e.backgroundColor, "hsla") }), Modernizr.addTest("multiplebgs", function () { var e = s("a").style; return e.cssText = "background:url(https://),url(https://),red url(https://)", /(url\s*\(.*?){3}/.test(e.background) }), Modernizr.addTest("opacity", function () { var e = s("a").style; return e.cssText = L.join("opacity:.55;"), /^0.55$/.test(e.opacity) }), Modernizr.addTest("cssreflections", b("boxReflect", "above", !0)), Modernizr.addTest("rgba", function () { var e = s("a").style; return e.cssText = "background-color:rgba(150,255,150,.5)", ("" + e.backgroundColor).indexOf("rgba") > -1 }), Modernizr.addTest("textshadow", $("textShadow", "1px 1px")), Modernizr.addTest("csstransforms", function () { return -1 === navigator.userAgent.indexOf("Android 2.") && b("transform", "scale(1)", !0) }); var W = "CSS" in t && "supports" in t.CSS, Y = "supportsCSS" in t; Modernizr.addTest("supports", W || Y), Modernizr.addTest("csstransforms3d", function () { return !!b("perspective", "1px", !0) }), Modernizr.addTest("csstransitions", b("transition", "all", !0)), Modernizr.addTest("localstorage", function () { var e = "modernizr"; try { return localStorage.setItem(e, e), localStorage.removeItem(e), !0 } catch (e) { return !1 } }), Modernizr.addTest("sessionstorage", function () { var e = "modernizr"; try { return sessionStorage.setItem(e, e), sessionStorage.removeItem(e), !0 } catch (e) { return !1 } }), Modernizr.addTest("websqldatabase", "openDatabase" in t), Modernizr.addTest("webworkers", "Worker" in t), function () { var e, t, n, o, a, i, s; for (var d in q) if (q.hasOwnProperty(d)) { if (e = [], t = q[d], t.name && (e.push(t.name.toLowerCase()), t.options && t.options.aliases && t.options.aliases.length)) for (n = 0; n < t.options.aliases.length; n++)e.push(t.options.aliases[n].toLowerCase()); for (o = r(t.fn, "function") ? t.fn() : t.fn, a = 0; a < e.length; a++)i = e[a], s = i.split("."), 1 === s.length ? Modernizr[s[0]] = o : (Modernizr[s[0]] && (!Modernizr[s[0]] || Modernizr[s[0]] instanceof Boolean) || (Modernizr[s[0]] = new Boolean(Modernizr[s[0]])), Modernizr[s[0]][s[1]] = o), S.push((o ? "" : "no-") + s.join("-")) } }(), a(S), delete w.addTest, delete w.addAsyncTest; for (var Z = 0; Z < Modernizr._q.length; Z++)Modernizr._q[Z](); e.Modernizr = Modernizr }(window, window, document);
5962
5963/*  galleria-161  */
5964/**
5965 * Galleria - v1.6.1 2019-10-17
5966 * 
5967 *
5968 * Copyright (c) 2010 - 2019 worse is better UG
5969 * Licensed under the MIT License.
5970 */
5971
5972
5973!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("jquery")):a.Galleria=b(a,a.jQuery)}(window,function(a,b,c,d){var e=a.document,f=b(e),g=b(a),h=b,i=Array.prototype,j=!0,k=3e4,l=!1,m=navigator.userAgent.toLowerCase(),n=a.location.hash.replace(/#\//,""),o="file:"==a.location.protocol?"http:":a.location.protocol,p=Math,q=function(){},r=function(){return!1},s=!(a.screen.width>1279&&1==a.devicePixelRatio||a.screen.width>1e3&&a.innerWidth<.9*a.screen.width),t=function(){var a=3,b=e.createElement("div"),c=b.getElementsByTagName("i");do{b.innerHTML="\x3c!--[if gt IE "+ ++a+"]><i></i><![endif]--\x3e"}while(c[0]);return a>4?a:e.documentMode||d}(),u=function(){return{html:e.documentElement,body:e.body,head:e.getElementsByTagName("head")[0],title:e.title}},v=a.parent!==a.self,w="data ready thumbnail loadstart loadfinish image play pause progress fullscreen_enter fullscreen_exit idle_enter idle_exit rescale lightbox_open lightbox_close lightbox_image",x=function(){var a=[];return b.each(w.split(" "),function(b,c){a.push(c),/_/.test(c)&&a.push(c.replace(/_/g,""))}),a}(),y=function(a){var c;return"object"!=typeof a?a:(b.each(a,function(d,e){/^[a-z]+_/.test(d)&&(c="",b.each(d.split("_"),function(a,b){c+=a>0?b.substr(0,1).toUpperCase()+b.substr(1):b}),a[c]=e,delete a[d])}),a)},z=function(a){return b.inArray(a,x)>-1?c[a.toUpperCase()]:a},A={youtube:{reg:/https?:\/\/(?:[a-zA_Z]{2,3}.)?(?:youtube\.com\/watch\?)((?:[\w\d\-\_\=]+&amp;(?:amp;)?)*v(?:&lt;[A-Z]+&gt;)?=([0-9a-zA-Z\-\_]+))/i,embed:function(){return o+"//www.youtube.com/embed/"+this.id},get_thumb:function(a){return o+"//img.youtube.com/vi/"+this.id+"/default.jpg"},get_image:function(a){return o+"//img.youtube.com/vi/"+this.id+"/maxresdefault.jpg"}},vimeo:{reg:/https?:\/\/(?:www\.)?(vimeo\.com)\/(?:hd#)?([0-9]+)/i,embed:function(){return o+"//player.vimeo.com/video/"+this.id},getUrl:function(){return o+"//vimeo.com/api/v2/video/"+this.id+".json?callback=?"},get_thumb:function(a){return a[0].thumbnail_medium},get_image:function(a){return a[0].thumbnail_large}},dailymotion:{reg:/https?:\/\/(?:www\.)?(dailymotion\.com)\/video\/([^_]+)/,embed:function(){return o+"//www.dailymotion.com/embed/video/"+this.id},getUrl:function(){return"https://api.dailymotion.com/video/"+this.id+"?fields=thumbnail_240_url,thumbnail_720_url&callback=?"},get_thumb:function(a){return a.thumbnail_240_url},get_image:function(a){return a.thumbnail_720_url}},_inst:[]},B=function(c,d){for(var e=0;e<A._inst.length;e++)if(A._inst[e].id===d&&A._inst[e].type==c)return A._inst[e];this.type=c,this.id=d,this.readys=[],A._inst.push(this);var f=this;b.extend(this,A[c]),_videoThumbs=function(a){f.data=a,b.each(f.readys,function(a,b){b(f.data)}),f.readys=[]},this.hasOwnProperty("getUrl")?b.getJSON(this.getUrl(),_videoThumbs):a.setTimeout(_videoThumbs,400),this.getMedia=function(a,b,c){c=c||q;var d=this,e=function(c){b(d["get_"+a](c))};try{d.data?e(d.data):d.readys.push(e)}catch(a){c()}}},C=function(a){var b;for(var c in A)if((b=a&&A[c].reg&&a.match(A[c].reg))&&b.length)return{id:b[2],provider:c};return!1},D={support:function(){var a=u().html;return!v&&(a.requestFullscreen||a.msRequestFullscreen||a.mozRequestFullScreen||a.webkitRequestFullScreen)}(),callback:q,enter:function(a,b,c){this.instance=a,this.callback=b||q,c=c||u().html,c.requestFullscreen?c.requestFullscreen():c.msRequestFullscreen?c.msRequestFullscreen():c.mozRequestFullScreen?c.mozRequestFullScreen():c.webkitRequestFullScreen&&c.webkitRequestFullScreen()},exit:function(a){this.callback=a||q,e.exitFullscreen?e.exitFullscreen():e.msExitFullscreen?e.msExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitCancelFullScreen&&e.webkitCancelFullScreen()},instance:null,listen:function(){if(this.support){var a=function(){if(D.instance){var a=D.instance._fullscreen;e.fullscreen||e.mozFullScreen||e.webkitIsFullScreen||e.msFullscreenElement&&null!==e.msFullscreenElement?a._enter(D.callback):a._exit(D.callback)}};e.addEventListener("fullscreenchange",a,!1),e.addEventListener("MSFullscreenChange",a,!1),e.addEventListener("mozfullscreenchange",a,!1),e.addEventListener("webkitfullscreenchange",a,!1)}}},E=[],F=[],G=!1,H=!1,I=[],J=[],K=function(a){J.push(a),b.each(I,function(b,c){c._options.theme!=a.name&&(c._initialized||c._options.theme)||(c.theme=a,c._init.call(c))})},L=function(){return{clearTimer:function(a){b.each(c.get(),function(){this.clearTimer(a)})},addTimer:function(a){b.each(c.get(),function(){this.addTimer(a)})},array:function(a){return i.slice.call(a,0)},create:function(a,b){b=b||"div";var c=e.createElement(b);return c.className=a,c},removeFromArray:function(a,c){return b.each(a,function(b,d){if(d==c)return a.splice(b,1),!1}),a},getScriptPath:function(a){a=a||b("script:last").attr("src");var c=a.split("/");return 1==c.length?"":(c.pop(),c.join("/")+"/")},animate:function(){var d,f,g,h,i,j,k,l=function(b){var c,d="transition WebkitTransition MozTransition OTransition".split(" ");if(a.opera)return!1;for(c=0;d[c];c++)if(void 0!==b[d[c]])return d[c];return!1}((e.body||e.documentElement).style),m={MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[l],n={_default:[.25,.1,.25,1],galleria:[.645,.045,.355,1],galleriaIn:[.55,.085,.68,.53],galleriaOut:[.25,.46,.45,.94],ease:[.25,0,.25,1],linear:[.25,.25,.75,.75],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},o=function(a,c,d){var e={};d=d||"transition",b.each("webkit moz ms o".split(" "),function(){e["-"+this+"-"+d]=c}),a.css(e)}
5973,p=function(a){o(a,"none","transition"),c.WEBKIT&&c.TOUCH&&(o(a,"translate3d(0,0,0)","transform"),a.data("revert")&&(a.css(a.data("revert")),a.data("revert",null)))};return function(e,r,s){return s=b.extend({duration:400,complete:q,stop:!1},s),e=b(e),s.duration?l?(s.stop&&(e.off(m),p(e)),d=!1,b.each(r,function(a,b){k=e.css(a),L.parseValue(k)!=L.parseValue(b)&&(d=!0),e.css(a,k)}),d?(f=[],g=s.easing in n?n[s.easing]:n._default,h=" "+s.duration+"ms cubic-bezier("+g.join(",")+")",void a.setTimeout(function(a,d,e,g){return function(){a.one(d,function(a){return function(){p(a),s.complete.call(a[0])}}(a)),c.WEBKIT&&c.TOUCH&&(i={},j=[0,0,0],b.each(["left","top"],function(b,c){c in e&&(j[b]=L.parseValue(e[c])-L.parseValue(a.css(c))+"px",i[c]=e[c],delete e[c])}),(j[0]||j[1])&&(a.data("revert",i),f.push("-webkit-transform"+g),o(a,"translate3d("+j.join(",")+")","transform"))),b.each(e,function(a,b){f.push(a+g)}),o(a,f.join(",")),a.css(e)}}(e,m,r,h),2)):void a.setTimeout(function(){s.complete.call(e[0])},s.duration)):void e.animate(r,s):(e.css(r),void s.complete.call(e[0]))}}(),removeAlpha:function(a){if(a instanceof h&&(a=a[0]),t<9&&a){var b=a.style,c=a.currentStyle,d=c&&c.filter||b.filter||"";/alpha/.test(d)&&(b.filter=d.replace(/alpha\([^)]*\)/i,""))}},forceStyles:function(a,c){a=b(a),a.attr("style")&&a.data("styles",a.attr("style")).removeAttr("style"),a.css(c)},revertStyles:function(){b.each(L.array(arguments),function(a,c){c=b(c),c.removeAttr("style"),c.attr("style",""),c.data("styles")&&c.attr("style",c.data("styles")).data("styles",null)})},moveOut:function(a){L.forceStyles(a,{position:"absolute",left:-1e4})},moveIn:function(){L.revertStyles.apply(L,L.array(arguments))},hide:function(a,c,d){d=d||q;var e=b(a);a=e[0],e.data("opacity")||e.data("opacity",e.css("opacity"));var f={opacity:0}
5973;if(c){var g=t<9&&a?function(){L.removeAlpha(a),a.style.visibility="hidden",d.call(a)}:d;L.animate(a,f,{duration:c,complete:g,stop:!0})}else t<9&&a?(L.removeAlpha(a),a.style.visibility="hidden"):e.css(f)},show:function(a,c,d){d=d||q;var e=b(a);a=e[0];var f=parseFloat(e.data("opacity"))||1,g={opacity:f};if(c){t<9&&(e.css("opacity",0),a.style.visibility="visible");var h=t<9&&a?function(){1==g.opacity&&L.removeAlpha(a),d.call(a)}:d;L.animate(a,g,{duration:c,complete:h,stop:!0})}else t<9&&1==g.opacity&&a?(L.removeAlpha(a),a.style.visibility="visible"):e.css(g)},wait:function(d){c._waiters=c._waiters||[],d=b.extend({until:r,success:q,error:function(){c.raise("Could not complete wait function.")},timeout:3e3},d);var e,f,g,h=L.timestamp(),i=function(){return f=L.timestamp(),e=f-h,L.removeFromArray(c._waiters,g),d.until(e)?(d.success(),!1):"number"==typeof d.timeout&&f>=h+d.timeout?(d.error(),!1):void c._waiters.push(g=a.setTimeout(i,10))};c._waiters.push(g=a.setTimeout(i,10))},toggleQuality:function(a,b){7!==t&&8!==t||!a||"IMG"!=a.nodeName.toUpperCase()||(void 0===b&&(b="nearest-neighbor"===a.style.msInterpolationMode),a.style.msInterpolationMode=b?"bicubic":"nearest-neighbor")},insertStyleTag:function(a,c){if(!c||!b("#"+c).length){var d=e.createElement("style");if(c&&(d.id=c),u().head.appendChild(d),d.styleSheet)d.styleSheet.cssText=a;else{var f=e.createTextNode(a);d.appendChild(f)}}},loadScript:function(a,c){var d=!1,e=b("<script>").attr({src:a,async:!0}).get(0);e.onload=e.onreadystatechange=function(){d||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(d=!0,e.onload=e.onreadystatechange=null,"function"==typeof c&&c.call(this,this))},u().head.appendChild(e)},parseValue:function(a){if("number"==typeof a)return a;if("string"==typeof a){var b=a.match(/\-?\d|\./g);return b&&b.constructor===Array?1*b.join(""):0}return 0},timestamp:function(){return(new Date).getTime()},loadCSS:function(a,f,g){var h,i;if(b("link[rel=stylesheet]").each(function(){if(new RegExp(a).test(this.href))return h=this,!1}),"function"==typeof f&&(g=f,f=d),g=g||q,h)return g.call(h,h),h;if(i=e.styleSheets.length,b("#"+f).length)b("#"+f).attr("href",a),i--;else{h=b("<link>").attr({rel:"stylesheet",href:a,id:f}).get(0);var j=b('link[rel="stylesheet"], style');if(j.length?j.get(0).parentNode.insertBefore(h,j[0]):u().head.appendChild(h),t&&i>=31)return void c.raise("You have reached the browser stylesheet limit (31)",!0)}if("function"==typeof g){var k=b("<s>").attr("id","galleria-loader").hide().appendTo(u().body);L.wait({until:function(){return k.height()>0},success:function(){k.remove(),g.call(h,h)},error:function(){k.remove(),c.raise("Theme CSS could not load after 20 sec. "+(c.QUIRK?"Your browser is in Quirks Mode, please add a correct doctype.":"Please download the latest theme."),!0)},timeout:5e3})}return h}}}(),M=function(a){return L.insertStyleTag(".galleria-videoicon{width:60px;height:60px;position:absolute;top:50%;left:50%;z-index:1;margin:-30px 0 0 -30px;cursor:pointer;background:#000;background:rgba(0,0,0,.8);border-radius:3px;-webkit-transition:all 150ms}.galleria-videoicon i{width:0px;height:0px;border-style:solid;border-width:10px 0 10px 16px;display:block;border-color:transparent transparent transparent #ffffff;margin:20px 0 0 22px}.galleria-image:hover .galleria-videoicon{background:#000}","galleria-videoicon"),b(L.create("galleria-videoicon")).html("<i></i>").appendTo(a).click(function(){b(this).siblings("img").mouseup()})},N=function(){var a=function(a,c,d,e){var f=this.getOptions("easing"),g=this.getStageWidth(),h={left:g*(a.rewind?-1:1)},i={left:0};d?(h.opacity=0,i.opacity=1):h.opacity=1,b(a.next).css(h),L.animate(a.next,i,{duration:a.speed,complete:function(a){return function(){c(),a.css({left:0})}}(b(a.next).add(a.prev)),queue:!1,easing:f}),e&&(a.rewind=!a.rewind),a.prev&&(h={left:0},i={left:g*(a.rewind?1:-1)},d&&(h.opacity=1,i.opacity=0),b(a.prev).css(h),L.animate(a.prev,i,{duration:a.speed,queue:!1,easing:f,complete:function(){b(this).css("opacity",0)}}))};return{active:!1,init:function(a,b,c){N.effects.hasOwnProperty(a)&&N.effects[a].call(this,b,c)},effects:{fade:function(a,c){b(a.next).css({opacity:0,left:0}),L.animate(a.next,{opacity:1},{duration:a.speed,complete:c}),a.prev&&(b(a.prev).css("opacity",1).show(),L.animate(a.prev,{opacity:0}
5973,{duration:a.speed}))},flash:function(a,c){b(a.next).css({opacity:0,left:0}),a.prev?L.animate(a.prev,{opacity:0},{duration:a.speed/2,complete:function(){L.animate(a.next,{opacity:1},{duration:a.speed,complete:c})}}):L.animate(a.next,{opacity:1},{duration:a.speed,complete:c})},pulse:function(a,c){a.prev&&b(a.prev).hide(),b(a.next).css({opacity:0,left:0}).show(),L.animate(a.next,{opacity:1},{duration:a.speed,complete:c})},slide:function(b,c){a.apply(this,L.array(arguments))},fadeslide:function(b,c){a.apply(this,L.array(arguments).concat([!0]))},doorslide:function(b,c){a.apply(this,L.array(arguments).concat([!1,!0]))}}}}();return D.listen(),b.event.special["click:fast"]={propagate:!0,add:function(c){var d=function(a){if(a.touches&&a.touches.length){var b=a.touches[0];return{x:b.pageX,y:b.pageY}}},e={touched:!1,touchdown:!1,coords:{x:0,y:0},evObj:{}};b(this).data({clickstate:e,timer:0}).on("touchstart.fast",function(c){a.clearTimeout(b(this).data("timer")),b(this).data("clickstate",{touched:!0,touchdown:!0,coords:d(c.originalEvent),evObj:c})}).on("touchmove.fast",function(a){var c=d(a.originalEvent),e=b(this).data("clickstate");Math.max(Math.abs(e.coords.x-c.x),Math.abs(e.coords.y-c.y))>6&&b(this).data("clickstate",b.extend(e,{touchdown:!1}))}).on("touchend.fast",function(d){var f=b(this);f.data("clickstate").touchdown&&c.handler.call(this,d),f.data("timer",a.setTimeout(function(){f.data("clickstate",e)},400))}).on("click.fast",function(a){if(b(this).data("clickstate").touched)return!1;b(this).data("clickstate",e),c.handler.call(this,a)})},remove:function(){b(this).off("touchstart.fast touchmove.fast touchend.fast click.fast")}},g.on("orientationchange",function(){b(this).resize()}),c=function(){var h=this;this._options={},this._playing=!1,this._playtime=5e3,this._active=null,this._queue={length:0},this._data=[],this._dom={},this._thumbnails=[],this._layers=[],this._initialized=!1,this._firstrun=!1,this._stageWidth=0,this._stageHeight=0,this._target=d,this._binds=[],this._id=parseInt(1e4*p.random(),10),b.each("container stage images image-nav image-nav-left image-nav-right info info-text info-title info-description thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right loader counter tooltip".split(" "),function(a,b){h._dom[b]=L.create("galleria-"+b)}),b.each("current total".split(" "),function(a,b){h._dom[b]=L.create("galleria-"+b,"span")});var i=this._keyboard={keys:{UP:38,DOWN:40,LEFT:37,RIGHT:39,RETURN:13,ESCAPE:27,BACKSPACE:8,SPACE:32},map:{},bound:!1,press:function(a){var b=a.keyCode||a.which;b in i.map&&"function"==typeof i.map[b]&&i.map[b].call(h,a)},attach:function(a){var b,c;for(b in a)a.hasOwnProperty(b)&&(c=b.toUpperCase(),c in i.keys?i.map[i.keys[c]]=a[b]:i.map[c]=a[b]);i.bound||(i.bound=!0,f.on("keydown",i.press))},detach:function(){i.bound=!1,i.map={},f.off("keydown",i.press)}},j=this._controls={0:d,1:d,active:0,swap:function(){j.active=j.active?0:1},getActive:function(){return h._options.swipe?j.slides[h._active]:j[j.active]},getNext:function(){return h._options.swipe?j.slides[h.getNext(h._active)]:j[1-j.active]},slides:[],frames:[],layers:[]},k=this._carousel={next:h.$("thumb-nav-right"),prev:h.$("thumb-nav-left"),width:0,current:0,max:0,hooks:[],update:function(){var a=0,c=0,d=[0];b.each(h._thumbnails,function(e,f){if(f.ready){a+=f.outerWidth||b(f.container).outerWidth(!0);var g=b(f.container).width();a+=g-p.floor(g),d[e+1]=a,c=p.max(c,f.outerHeight||b(f.container).outerHeight(!0))}}),h.$("thumbnails").css({width:a,height:c}),k.max=a,k.hooks=d,k.width=h.$("thumbnails-list").width(),k.setClasses(),h.$("thumbnails-container").toggleClass("galleria-carousel",a>k.width),k.width=h.$("thumbnails-list").width()},bindControls:function(){var a;k.next.on("click:fast",function(b){if(b.preventDefault(),"auto"===h._options.carouselSteps){for(a=k.current;a<k.hooks.length;a++)if(k.hooks[a]-k.hooks[k.current]>k.width){k.set(a-2);break}}else k.set(k.current+h._options.carouselSteps)}),k.prev.on("click:fast",function(b){if(b.preventDefault(),"auto"===h._options.carouselSteps)for(a=k.current;a>=0;a--){if(k.hooks[k.current]-k.hooks[a]>k.width){k.set(a+2);break}if(0===a){k.set(0);break}}else k.set(k.current-h._options.carouselSteps)})},set:function(a){for(a=p.max(a,0);k.hooks[a-1]+k.width>=k.max&&a>=0;)a--;k.current=a,k.animate()},getLast:function(a){return(a||k.current)-1}
5973,follow:function(a){if(0===a||a===k.hooks.length-2)return void k.set(a);for(var b=k.current;k.hooks[b]-k.hooks[k.current]<k.width&&b<=k.hooks.length;)b++;a-1<k.current?k.set(a-1):a+2>b&&k.set(a-b+k.current+2)},setClasses:function(){k.prev.toggleClass("disabled",!k.current),k.next.toggleClass("disabled",k.hooks[k.current]+k.width>=k.max)},animate:function(a){k.setClasses();var c=-1*k.hooks[k.current];isNaN(c)||(h.$("thumbnails").css("left",function(){return b(this).css("left")}),L.animate(h.get("thumbnails"),{left:c},{duration:h._options.carouselSpeed,easing:h._options.easing,queue:!1}))}},l=this._tooltip={initialized:!1,open:!1,timer:"tooltip"+h._id,swapTimer:"swap"+h._id,init:function(){l.initialized=!0;L.insertStyleTag(".galleria-tooltip{padding:3px 8px;max-width:50%;background:#ffe;color:#000;z-index:3;position:absolute;font-size:11px;line-height:1.3;opacity:0;box-shadow:0 0 2px rgba(0,0,0,.4);-moz-box-shadow:0 0 2px rgba(0,0,0,.4);-webkit-box-shadow:0 0 2px rgba(0,0,0,.4);}","galleria-tooltip"),h.$("tooltip").css({opacity:.8,visibility:"visible",display:"none"})},move:function(a){var b=h.getMousePosition(a).x,c=h.getMousePosition(a).y,d=h.$("tooltip"),e=b,f=c,g=d.outerHeight(!0)+1,i=d.outerWidth(!0),j=g+15,k=h.$("container").width()-i-2,l=h.$("container").height()-g-2;isNaN(e)||isNaN(f)||(e+=10,f-=g+8,e=p.max(0,p.min(k,e)),f=p.max(0,p.min(l,f)),c<j&&(f=j),d.css({left:e,top:f}))},bind:function(a,d){if(!c.TOUCH){l.initialized||l.init();var e=function(){h.$("container").off("mousemove",l.move),h.clearTimer(l.timer),h.$("tooltip").stop().animate({opacity:0}
5973,200,function(){h.$("tooltip").hide(),h.addTimer(l.swapTimer,function(){l.open=!1},1e3)})},f=function(a,c){l.define(a,c),b(a).hover(function(){h.clearTimer(l.swapTimer),h.$("container").off("mousemove",l.move).on("mousemove",l.move).trigger("mousemove"),l.show(a),h.addTimer(l.timer,function(){h.$("tooltip").stop().show().animate({opacity:1}),l.open=!0},l.open?0:500)},e).click(e)};"string"==typeof d?f(a in h._dom?h.get(a):a,d):b.each(a,function(a,b){f(h.get(a),b)})}},show:function(c){c=b(c in h._dom?h.get(c):c);var d=c.data("tt"),e=function(b){a.setTimeout(function(a){return function(){l.move(a)}}(b),10),c.off("mouseup",e)};(d="function"==typeof d?d():d)&&(h.$("tooltip").html(d.replace(/\s/,"&#160;")),c.on("mouseup",e))},define:function(a,c){if("function"!=typeof c){var d=c;c=function(){return d}}a=b(a in h._dom?h.get(a):a).data("tt",c),l.show(a)}},n=this._fullscreen={scrolled:0,crop:d,active:!1,prev:b(),beforeEnter:function(a){a()},beforeExit:function(a){a()},keymap:h._keyboard.map,parseCallback:function(a,c){return N.active?function(){"function"==typeof a&&a.call(h);var d=h._controls.getActive(),e=h._controls.getNext();h._scaleImage(e),h._scaleImage(d),c&&h._options.trueFullscreen&&b(d.container).add(e.container).trigger("transitionend")}:a},enter:function(b){n.beforeEnter(function(){b=n.parseCallback(b,!0),h._options.trueFullscreen&&D.support?(n.active=!0,L.forceStyles(h.get("container"),{width:"100%",height:"100%"}),h.rescale(),c.MAC?c.SAFARI&&/version\/[1-5]/.test(m)?(h.$("stage").css("opacity",0),a.setTimeout(function(){n.scale(),h.$("stage").css("opacity",1)},4)):(h.$("container").css("opacity",0).addClass("fullscreen"),a.setTimeout(function(){n.scale(),h.$("container").css("opacity",1)},50)):h.$("container").addClass("fullscreen"),g.resize(n.scale),D.enter(h,b,h.get("container"))):(n.scrolled=g.scrollTop(),c.TOUCH||a.scrollTo(0,0),n._enter(b))})},_enter:function(f){n.active=!0,v&&(n.iframe=function(){var d,f=e.referrer,g=e.createElement("a"),h=a.location;return g.href=f,g.protocol!=h.protocol||g.hostname!=h.hostname||g.port!=h.port?(c.raise("Parent fullscreen not available. Iframe protocol, domains and ports must match."),!1):(n.pd=a.parent.document,b(n.pd).find("iframe").each(function(){if((this.contentDocument||this.contentWindow.document)===e)return d=this,!1}),d)}()),L.hide(h.getActiveImage()),v&&n.iframe&&(n.iframe.scrolled=b(a.parent).scrollTop(),a.parent.scrollTo(0,0));var i=h.getData(),j=h._options,k=!h._options.trueFullscreen||!D.support,l={height:"100%",overflow:"hidden",margin:0,padding:0};if(k&&(h.$("container").addClass("fullscreen"),n.prev=h.$("container").prev(),n.prev.length||(n.parent=h.$("container").parent()),h.$("container").appendTo("body"),L.forceStyles(h.get("container"),{position:c.TOUCH?"absolute":"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e4}),L.forceStyles(u().html,l),L.forceStyles(u().body,l)),v&&n.iframe&&(L.forceStyles(n.pd.documentElement,l),L.forceStyles(n.pd.body,l),L.forceStyles(n.iframe,b.extend(l,{width:"100%",height:"100%",top:0,left:0,position:"fixed",zIndex:1e4,border:"none"}))),n.keymap=b.extend({},h._keyboard.map),h.attachKeyboard({escape:h.exitFullscreen,right:h.next,left:h.prev}),n.crop=j.imageCrop,j.fullscreenCrop!=d&&(j.imageCrop=j.fullscreenCrop),i&&i.big&&i.image!==i.big){var m=new c.Picture,o=m.isCached(i.big),p=h.getIndex(),q=h._thumbnails[p];h.trigger({type:c.LOADSTART,cached:o,rewind:!1,index:p,imageTarget:h.getActiveImage(),thumbTarget:q,galleriaData:i}),m.load(i.big,function(a){h._scaleImage(a,{complete:function(a){h.trigger({type:c.LOADFINISH,cached:o,index:p,rewind:!1,imageTarget:a.image,thumbTarget:q});var d=h._controls.getActive().image;d&&(b(d).width(a.image.width).height(a.image.height).attr("style",b(a.image).attr("style")),a.image.src.srcset&&b(d).attr("srcset",a.image.src.srcset),a.image.src.sizes&&b(d).attr("sizes",a.image.src.sizes),b(d).attr("src",a.image.src))}})});var r=h.getNext(p),s=new c.Picture,t=h.getData(r);s.preload(h.isFullscreen()&&t.big?t.big:t.image)}h.rescale(function(){h.addTimer(!1,function(){k&&L.show(h.getActiveImage()),"function"==typeof f&&f.call(h),h.rescale()},100),h.trigger(c.FULLSCREEN_ENTER)}),k?g.resize(n.scale):L.show(h.getActiveImage())},scale:function(){h.rescale()}
5973,exit:function(a){n.beforeExit(function(){a=n.parseCallback(a),h._options.trueFullscreen&&D.support?D.exit(a):n._exit(a)})},_exit:function(b){n.active=!1;var d=!h._options.trueFullscreen||!D.support,e=h.$("container").removeClass("fullscreen");if(n.parent?n.parent.prepend(e):e.insertAfter(n.prev),d){L.hide(h.getActiveImage()),L.revertStyles(h.get("container"),u().html,u().body),c.TOUCH||a.scrollTo(0,n.scrolled);var f=h._controls.frames[h._controls.active];f&&f.image&&(f.image.src=f.image.src)}v&&n.iframe&&(L.revertStyles(n.pd.documentElement,n.pd.body,n.iframe),n.iframe.scrolled&&a.parent.scrollTo(0,n.iframe.scrolled)),h.detachKeyboard(),h.attachKeyboard(n.keymap),h._options.imageCrop=n.crop;var i=h.getData().big,j=h._controls.getActive().image;!h.getData().iframe&&j&&i&&i==j.src&&a.setTimeout(function(a){return function(){j.src=a}}(h.getData().image),1),h.rescale(function(){h.addTimer(!1,function(){d&&L.show(h.getActiveImage()),"function"==typeof b&&b.call(h),g.trigger("resize")},50),h.trigger(c.FULLSCREEN_EXIT)}),g.off("resize",n.scale)}},o=this._idle={trunk:[],bound:!1,active:!1,add:function(a,d,e,f){if(a&&!c.TOUCH){o.bound||o.addEvent(),a=b(a),"boolean"==typeof e&&(f=e,e={}),e=e||{};var g,h={};for(g in d)d.hasOwnProperty(g)&&(h[g]=a.css(g));a.data("idle",{from:b.extend(h,e),to:d,complete:!0,busy:!1}),f?a.css(d):o.addTimer(),o.trunk.push(a)}},remove:function(a){a=b(a),b.each(o.trunk,function(b,c){c&&c.length&&!c.not(a).length&&(a.css(a.data("idle").from),o.trunk.splice(b,1))}),o.trunk.length||(o.removeEvent(),h.clearTimer(o.timer))},addEvent:function(){o.bound=!0,h.$("container").on("mousemove click",o.showAll),"hover"==h._options.idleMode&&h.$("container").on("mouseleave",o.hide)},removeEvent:function(){o.bound=!1,h.$("container").on("mousemove click",o.showAll),"hover"==h._options.idleMode&&h.$("container").off("mouseleave",o.hide)},addTimer:function(){"hover"!=h._options.idleMode&&h.addTimer("idle",function(){o.hide()},h._options.idleTime)},hide:function(){if(h._options.idleMode&&!1!==h.getIndex()){h.trigger(c.IDLE_ENTER);var a=o.trunk.length;b.each(o.trunk,function(b,c){var d=c.data("idle");d&&(c.data("idle").complete=!1,L.animate(c,d.to,{duration:h._options.idleSpeed,complete:function(){b==a-1&&(o.active=!1)}}))})}},showAll:function(){h.clearTimer("idle"),b.each(o.trunk,function(a,b){o.show(b)})},show:function(a){var d=a.data("idle");o.active&&(d.busy||d.complete)||(d.busy=!0,h.trigger(c.IDLE_EXIT),h.clearTimer("idle"),L.animate(a,d.from,{duration:h._options.idleSpeed/2,complete:function(){o.active=!0,b(a).data("idle").busy=!1,b(a).data("idle").complete=!0}})),o.addTimer()}},q=this._lightbox={width:0,height:0,initialized:!1,active:null,image:null,elems:{},keymap:!1,init:function(){if(!q.initialized){q.initialized=!0;var a={},d=h._options,e="",f="position:absolute;",g="lightbox-",i={overlay:"position:fixed;display:none;opacity:"+d.overlayOpacity+";filter:alpha(opacity="+100*d.overlayOpacity+");top:0;left:0;width:100%;height:100%;background:"+d.overlayBackground+";z-index:99990",box:"position:fixed;display:none;width:400px;height:400px;top:50%;left:50%;margin-top:-200px;margin-left:-200px;z-index:99991",shadow:f+"background:#000;width:100%;height:100%;",content:f+"background-color:#fff;top:10px;left:10px;right:10px;bottom:10px;overflow:hidden",info:f+"bottom:10px;left:10px;right:10px;color:#444;font:11px/13px arial,sans-serif;height:13px",close:f+"top:10px;right:10px;height:20px;width:20px;background:#fff;text-align:center;cursor:pointer;color:#444;font:16px/22px arial,sans-serif;z-index:99999",image:f+"top:10px;left:10px;right:10px;bottom:30px;overflow:hidden;display:block;",prevholder:f+"width:50%;top:0;bottom:40px;cursor:pointer;",nextholder:f+"width:50%;top:0;bottom:40px;right:-1px;cursor:pointer;",prev:f+"top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;left:20px;display:none;text-align:center;color:#000;font:bold 16px/36px arial,sans-serif",next:f+"top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;right:20px;left:auto;display:none;font:bold 16px/36px arial,sans-serif;text-align:center;color:#000",title:"float:left",counter:"float:right;margin-left:8px;"},j={},k="";k=t>7?t<9?"background:#000;filter:alpha(opacity=0);":"background:rgba(0,0,0,0);":"z-index:99999",i.nextholder+=k,i.prevholder+=k,b.each(i,function(a,b){e+=".galleria-"+g+a+"{"+b+"}"}),e+=".galleria-lightbox-box.iframe .galleria-lightbox-prevholder,.galleria-lightbox-box.iframe .galleria-lightbox-nextholder{width:100px;height:100px;top:50%;
5973margin-top:-70px}",L.insertStyleTag(e,"galleria-lightbox"),b.each("overlay box content shadow title info close prevholder prev nextholder next counter image".split(" "),function(b,c){h.addElement("lightbox-"+c),a[c]=q.elems[c]=h.get("lightbox-"+c)}),q.image=new c.Picture,b.each({box:"shadow content close prevholder nextholder",info:"title counter",content:"info image",prevholder:"prev",nextholder:"next"},function(a,c){var d=[];b.each(c.split(" "),function(a,b){d.push(g+b)}),j[g+a]=d}),h.append(j),b(a.image).append(q.image.container),b(u().body).append(a.overlay,a.box),function(a){a.hover(function(){b(this).css("color","#bbb")},function(){b(this).css("color","#444")})}(b(a.close).on("click:fast",q.hide).html("&#215;")),b.each(["Prev","Next"],function(d,e){var f=b(a[e.toLowerCase()]).html(/v/.test(e)?"&#8249;&#160;":"&#160;&#8250;"),g=b(a[e.toLowerCase()+"holder"]);if(g.on("click:fast",function(){q["show"+e]()}),t<8||c.TOUCH)return void f.show();g.hover(function(){f.show()},function(a){f.stop().fadeOut(200)})}),b(a.overlay).on("click:fast",q.hide),c.IPAD&&(h._options.lightboxTransitionSpeed=0)}},rescale:function(a){var d=p.min(g.width()-40,q.width),e=p.min(g.height()-60,q.height),f=p.min(d/q.width,e/q.height),i=p.round(q.width*f)+40,j=p.round(q.height*f)+60,k={width:i,height:j,"margin-top":-1*p.ceil(j/2),"margin-left":-1*p.ceil(i/2)};a?b(q.elems.box).css(k):b(q.elems.box).animate(k,{duration:h._options.lightboxTransitionSpeed,easing:h._options.easing,complete:function(){var a=q.image,d=h._options.lightboxFadeSpeed;h.trigger({type:c.LIGHTBOX_IMAGE,imageTarget:a.image}),b(a.container).show(),b(a.image).animate({opacity:1},d),L.show(q.elems.info,d)}})},hide:function(){q.image.image=null,g.off("resize",q.rescale),b(q.elems.box).hide().find("iframe").remove(),L.hide(q.elems.info),h.detachKeyboard(),h.attachKeyboard(q.keymap),q.keymap=!1,L.hide(q.elems.overlay,200,function(){b(this).hide().css("opacity",h._options.overlayOpacity),h.trigger(c.LIGHTBOX_CLOSE)})},showNext:function(){q.show(h.getNext(q.active))},showPrev:function(){q.show(h.getPrev(q.active))},show:function(d){q.active=d="number"==typeof d?d:h.getIndex()||0,q.initialized||q.init(),h.trigger(c.LIGHTBOX_OPEN),q.keymap||(q.keymap=b.extend({},h._keyboard.map),h.attachKeyboard({escape:q.hide,right:q.showNext,left:q.showPrev})),g.off("resize",q.rescale);var e,f,i,j=h.getData(d),k=h.getDataLength(),l=h.getNext(d);L.hide(q.elems.info);try{for(i=h._options.preload;i>0;i--)f=new c.Picture,e=h.getData(l),f.preload(e.big?e.big:e.image),l=h.getNext(l)}catch(a){}q.image.isIframe=j.iframe&&!j.image,b(q.elems.box).toggleClass("iframe",q.image.isIframe),b(q.image.container).find(".galleria-videoicon").remove(),q.image.load(j.big||j.image||j.iframe,function(c){if(c.isIframe){var e=b(a).width(),f=b(a).height();if(c.video&&h._options.maxVideoSize){var i=p.min(h._options.maxVideoSize/e,h._options.maxVideoSize/f);i<1&&(e*=i,f*=i)}q.width=e,q.height=f}else q.width=c.original.width,q.height=c.original.height;if(b(c.image).css({width:c.isIframe?"100%":"100.1%",height:c.isIframe?"100%":"100.1%",top:0,bottom:0,zIndex:99998,opacity:0,visibility:"visible"}).parent().height("100%"),q.elems.title.innerHTML=j.title||"",q.elems.counter.innerHTML=d+1+" / "+k,g.resize(q.rescale),q.rescale(),j.image&&j.iframe){if(b(q.elems.box).addClass("iframe"),j.video){var l=M(c.container).hide();a.setTimeout(function(){l.fadeIn(200)},200)}b(c.image).css("cursor","pointer").mouseup(function(a,c){return function(d){b(q.image.container).find(".galleria-videoicon").remove(),d.preventDefault(),c.isIframe=!0,c.load(a.iframe+(a.video?"&autoplay=1":""),{width:"100%",height:t<8?b(q.image.container).height():"100%"})}}(j,c))}}),b(q.elems.overlay).show().css("visibility","visible"),b(q.elems.box).show()}},r=this._timer={trunk:{},add:function(b,c,d,e){if(b=b||(new Date).getTime(),e=e||!1,this.clear(b),e){var f=c;c=function(){f(),r.add(b,c,d)}}this.trunk[b]=a.setTimeout(c,d)},clear:function(b){var c,d=function(b){a.clearTimeout(this.trunk[b]),delete this.trunk[b]};if(b&&b in this.trunk)d.call(this,b);else if(void 0===b)for(c in this.trunk)this.trunk.hasOwnProperty(c)&&d.call(this,c)}};return this},c.prototype={constructor:c,init:function(a,e){if(e=y(e),this._original={target:a,options:e,data:null},this._target=this._dom.target=a.nodeName?a:b(a).get(0),this._original.html=this._target.innerHTML,F.push(this),!this._target)return void c.raise("Target not found",!0);if(this._options={autoplay:!1,carousel:!0,carouselFollow:!0,carouselSpeed:400,carouselSteps:"auto",clicknext:!1,dailymotion:{foreground:"%23EEEEEE",highlight:"%235BCEC5",background:"%23222222",logo:0,hideInfos:1},dataConfig:function(a){return{}},dataSelector:"img",dataSort:!1,dataSource:this._target,debug:d,dummy:d,easing:"galleria",extend:function(a){},fullscreenCrop:d,fullscreenDoubleTap:!0,fullscreenTransition:d,height:0,idleMode:!0,idleTime:3e3,idleSpeed:200,imageCrop:!1,imageMargin:0,imagePan:!1,imagePanSmoothness:12,imagePosition:"50%",imageTimeout:d,initialTransition:d,
5973keepSource:!1,layerFollow:!0,lightbox:!1,lightboxFadeSpeed:200,lightboxTransitionSpeed:200,linkSourceImages:!0,maxScaleRatio:d,maxVideoSize:d,minScaleRatio:d,overlayOpacity:.85,overlayBackground:"#0b0b0b",pauseOnInteraction:!0,popupLinks:!1,preload:2,queue:!0,responsive:!0,show:0,showInfo:!0,showCounter:!0,showImagenav:!0,swipe:"auto",theme:null,thumbCrop:!0,thumbEventType:"click:fast",thumbMargin:0,thumbQuality:"auto",thumbDisplayOrder:!0,
5974thumbPosition:"50%",thumbnails:!0,touchTransition:d,transition:"fade",transitionInitial:d,transitionSpeed:400,trueFullscreen:!0,useCanvas:!1,variation:"",videoPoster:!0,vimeo:{title:0,byline:0,portrait:0,color:"aaaaaa"},wait:5e3,width:"auto",youtube:{modestbranding:1,autohide:1,color:"white",hd:1,rel:0,showinfo:0}},this._options.initialTransition=this._options.initialTransition||this._options.transitionInitial,e&&(!1===e.debug&&(j=!1),"number"==typeof e.imageTimeout&&(k=e.imageTimeout),"string"==typeof e.dummy&&(l=e.dummy),"string"==typeof e.theme&&(this._options.theme=e.theme)),b(this._target).children().hide(),c.QUIRK&&c.raise("Your page is in Quirks mode, Galleria may not render correctly. Please validate your HTML and add a correct doctype."),J.length)if(this._options.theme){for(var f=0;f<J.length;f++)if(this._options.theme===J[f].name){this.theme=J[f];break}}else this.theme=J[0];return"object"==typeof this.theme?this._init():I.push(this),this},_init:function(){var f=this,h=this._options;if(this._initialized)return c.raise("Init failed: Gallery instance already initialized."),this;if(this._initialized=!0,!this.theme)return c.raise("Init failed: No theme found.",!0),this;if(b.extend(!0,h,this.theme.defaults,this._original.options,c.configure.options),h.swipe=function(a){return"enforced"==a||!1!==a&&"disabled"!=a&&!!c.TOUCH}(h.swipe),h.swipe&&(h.clicknext=!1,h.imagePan=!1),function(a){if(!("getContext"in a))return void(a=null);H=H||{elem:a,context:a.getContext("2d"),cache:{},length:0}}(e.createElement("canvas")),this.bind(c.DATA,function(){a.screen&&a.screen.width&&Array.prototype.forEach&&this._data.forEach(function(b){var c="devicePixelRatio"in a?a.devicePixelRatio:1;p.max(a.screen.width,a.screen.height)*c<1024&&(b.big=b.image)}),this._original.data=this._data,this.get("total").innerHTML=this.getDataLength();var b=this.$("container");f._options.height<2&&(f._userRatio=f._ratio=f._options.height);var d={width:0,height:0},e=function(){return f.$("stage").height()};L.wait({until:function(){return d=f._getWH(),b.width(d.width).height(d.height),e()&&d.width&&d.height>50},success:function(){f._width=d.width,f._height=d.height,f._ratio=f._ratio||d.height/d.width,c.WEBKIT?a.setTimeout(function(){f._run()},1):f._run()},error:function(){e()?c.raise("Could not extract sufficient width/height of the gallery container. Traced measures: width:"+d.width+"px, height: "+d.height+"px.",!0):c.raise("Could not extract a stage height from the CSS. Traced height: "+e()+"px.",!0)},timeout:"number"==typeof this._options.wait&&this._options.wait})}),this.append({"info-text":["info-title","info-description"],info:["info-text"],"image-nav":["image-nav-right","image-nav-left"],stage:["images","loader","counter","image-nav"],"thumbnails-list":["thumbnails"],"thumbnails-container":["thumb-nav-left","thumbnails-list","thumb-nav-right"],container:["stage","thumbnails-container","info","tooltip"]}),L.hide(this.$("counter").append(this.get("current"),e.createTextNode(" / "),this.get("total"))),this.setCounter("&#8211;"),L.hide(f.get("tooltip")),this.$("container").addClass([c.TOUCH?"touch":"notouch",this._options.variation,"galleria-theme-"+this.theme.name].join(" ")),this._options.swipe||b.each(new Array(2),function(a){var d=new c.Picture;b(d.container).css({position:"absolute",top:0,left:0}).prepend(f._layers[a]=b(L.create("galleria-layer")).css({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:2})[0]),f.$("images").append(d.container),f._controls[a]=d;var e=new c.Picture;e.isIframe=!0,b(e.container).attr("class","galleria-frame").css({position:"absolute",top:0,left:0,zIndex:4,background:"#000",display:"none"}).appendTo(d.container),f._controls.frames[a]=e}),this.$("images").css({position:"relative",top:0,left:0,width:"100%",height:"100%"}),h.swipe&&(this.$("images").css({position:"absolute",top:0,left:0,width:0,height:"100%"}),this.finger=new c.Finger(this.get("stage"),{onchange:function(a){f.pause().show(a)},oncomplete:function(a){var c=p.max(0,p.min(parseInt(a,10),f.getDataLength()-1)),d=f.getData(c);
5974b(f._thumbnails[c].container).addClass("active").siblings(".active").removeClass("active"),d&&(f.$("images").find(".galleria-frame").css("opacity",0).hide().find("iframe").remove(),f._options.carousel&&f._options.carouselFollow&&f._carousel.follow(c))}}),this.bind(c.RESCALE,function(){this.finger.setup()}),this.$("stage").on("click",function(c){var e=f.getData();if(e){if(e.iframe){f.isPlaying()&&f.pause();var g=f._controls.frames[f._active],h=f._stageWidth,i=f._stageHeight;if(b(g.container).find("iframe").length)return;return b(g.container).css({width:h,height:i,opacity:0}).show().animate({opacity:1},200),void a.setTimeout(function(){g.load(e.iframe+(e.video?"&autoplay=1":""),{width:h,height:i},function(a){f.$("container").addClass("videoplay"),a.scale({width:f._stageWidth,height:f._stageHeight,iframelimit:e.video?f._options.maxVideoSize:d})})},100)}if(e.link)if(f._options.popupLinks){a.open(e.link,"_blank")}else a.location.href=e.link;else;}}),this.bind(c.IMAGE,function(a){f.setCounter(a.index),f.setInfo(a.index);var c=this.getNext(),d=this.getPrev(),e=[d,c];e.push(this.getNext(c),this.getPrev(d),f._controls.slides.length-1);var g=[];b.each(e,function(a,c){-1==b.inArray(c,g)&&g.push(c)}),b.each(g,function(a,c){var d=f.getData(c),e=f._controls.slides[c],g=f.isFullscreen()&&d.big?d.big:d.image||d.iframe;d.iframe&&!d.image&&(e.isIframe=!0),e.ready||f._controls.slides[c].load(g,function(a){a.isIframe||b(a.image).css("visibility","hidden"),f._scaleImage(a,{complete:function(a){a.isIframe||b(a.image).css({opacity:0,visibility:"visible"}).animate({opacity:1},200)}})})})})),this.$("thumbnails, thumbnails-list").css({overflow:"hidden",position:"relative"}),this.$("image-nav-right, image-nav-left").on("click:fast",function(a){h.pauseOnInteraction&&f.pause();var b=/right/.test(this.className)?"next":"prev";f[b]()}).on("click",function(a){a.preventDefault(),(h.clicknext||h.swipe)&&a.stopPropagation()}),b.each(["info","counter","image-nav"],function(a,b){!1===h["show"+b.substr(0,1).toUpperCase()+b.substr(1).replace(/-/,"")]&&L.moveOut(f.get(b.toLowerCase()))}),this.load(),h.keepSource||t||(this._target.innerHTML=""),this.get("errors")&&this.appendChild("target","errors"),this.appendChild("target","container"),h.carousel){var i=0,j=h.show;this.bind(c.THUMBNAIL,function(){this.updateCarousel(),++i==this.getDataLength()&&"number"==typeof j&&j>0&&this._carousel.follow(j)})}return h.responsive&&g.on("resize",function(){f.isFullscreen()||f.resize()}),h.fullscreenDoubleTap&&this.$("stage").on("touchstart",function(){var a,b,c,d,e,g,h=function(a){return a.originalEvent.touches?a.originalEvent.touches[0]:a};return f.$("stage").on("touchmove",function(){a=0}),function(i){if(!/(-left|-right)/.test(i.target.className)){if(g=L.timestamp(),b=h(i).pageX,c=h(i).pageY,i.originalEvent.touches.length<2&&g-a<300&&b-d<20&&c-e<20)return f.toggleFullscreen(),void i.preventDefault();a=g,d=b,e=c}}}()),b.each(c.on.binds,function(a,c){-1==b.inArray(c.hash,f._binds)&&f.bind(c.type,c.callback)}),this},addTimer:function(){return this._timer.add.apply(this._timer,L.array(arguments)),this},clearTimer:function(){return this._timer.clear.apply(this._timer,L.array(arguments)),this},_getWH:function(){var a,c=this.$("container"),d=this.$("target"),e=this,f={};return b.each(["width","height"],function(b,g){e._options[g]&&"number"==typeof e._options[g]?f[g]=e._options[g]:(a=[L.parseValue(c.css(g)),L.parseValue(d.css(g)),c[g](),d[g]()],e["_"+g]||a.splice(a.length,L.parseValue(c.css("min-"+g)),L.parseValue(d.css("min-"+g))),f[g]=p.max.apply(p,a))}),e._userRatio&&(f.height=f.width*e._userRatio),f},_createThumbnails:function(d){this.get("total").innerHTML=this.getDataLength();var f,g,h,i,j=this,k=this._options,l=d?this._data.length-d.length:0,m=l,n=[],o=0,p=t<8?"http://upload.wikimedia.org/wikipedia/commons/c/c0/Blank.gif":"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D",q=function(){var a=j.$("thumbnails").find(".active");return!!a.length&&a.find("img").attr("src")}(),r="string"==typeof k.thumbnails?k.thumbnails.toLowerCase():null,s=function(a){return e.defaultView&&e.defaultView.getComputedStyle?e.defaultView.getComputedStyle(g.container,null)[a]:i.css(a)},u=function(a){k.pauseOnInteraction&&j.pause();var c=b(a.currentTarget).data("index");j.getIndex()!==c&&j.show(c),a.preventDefault()},v=function(a,d){b(a.container).css("visibility","visible"),j.trigger({type:c.THUMBNAIL,thumbTarget:a.image,index:a.data.order,galleriaData:j.getData(a.data.order)}),"function"==typeof d&&d.call(j,a)},w=function(a,c){a.scale({width:a.data.width,height:a.data.height,crop:k.thumbCrop,margin:k.thumbMargin,canvas:k.useCanvas,position:k.thumbPosition,complete:function(a){var d,e,f=["left","top"],g=["Width","Height"];j.getData(a.index);b.each(g,function(c,g){d=g.toLowerCase(),!0===k.thumbCrop&&k.thumbCrop!==d||(e={},e[d]=a[d],b(a.container).css(e),e={},e[f[c]]=0,b(a.image).css(e)),a["outer"+g]=b(a.container)["outer"+g](!0)}),L.toggleQuality(a.image,!0===k.thumbQuality||"auto"===k.thumbQuality&&a.original.width<3*a.width),k.thumbDisplayOrder&&!a.lazy?b.each(n,function(a,b){if(a===o&&b.ready&&!b.displayed)return o++,b.dis
5974played=!0,void v(b,c)}):v(a,c)}})};for(d||(this._thumbnails=[],this.$("thumbnails").empty());this._data[l];l++)h=this._data[l],f=h.thumb||h.image,!0!==k.thumbnails&&"lazy"!=r||!h.thumb&&!h.image?h.iframe&&null!==r||"empty"===r||"numbers"===r?(g={container:L.create("galleria-image"),image:L.create("img","span"),ready:!0,data:{order:l}},"numbers"===r&&b(g.image).text(l+1),h.iframe&&b(g.image).addClass("iframe"),this.$("thumbnails").append(g.container),a.setTimeout(function(a,d,e){return function(){b(e).append(a),j.trigger({type:c.THUMBNAIL,thumbTarget:a,index:d,galleriaData:j.getData(d)})}}(g.image,l,g.container),50+20*l)):g={container:null,image:null}:(g=new c.Picture(l),g.index=l,g.displayed=!1,g.lazy=!1,g.video=!1,this.$("thumbnails").append(g.container),i=b(g.container),i.css("visibility","hidden"),g.data={width:L.parseValue(s("width")),height:L.parseValue(s("height")),order:l,src:f},!0!==k.thumbCrop?i.css({width:"auto",height:"auto"}):i.css({width:g.data.width,height:g.data.height}),"lazy"==r?(i.addClass("lazy"),g.lazy=!0,g.load(p,{height:g.data.height,width:g.data.width})):g.load(f,w),"all"===k.preload&&g.preload(h.image)),b(g.container).add(k.keepSource&&k.linkSourceImages?h.original:null).data("index",l).on(k.thumbEventType,u).data("thumbload",w),q===f&&b(g.container).addClass("active"),this._thumbnails.push(g);return n=this._thumbnails.slice(m),this},lazyLoad:function(a,c){var d=a.constructor==Array?a:[a],e=this,f=0;return b.each(d,function(a,g){if(!(g>e._thumbnails.length-1)){var h=e._thumbnails[g],i=h.data,j=function(){++f==d.length&&"function"==typeof c&&c.call(e)},k=b(h.container).data("thumbload");k&&(h.video?k.call(e,h,j):h.load(i.src,function(a){k.call(e,a,j)}))}}),this},lazyLoadChunks:function(b,c){var d=this.getDataLength(),e=0,f=0,g=[],h=[],i=this;for(c=c||0;e<d;e++)h.push(e),++f!=b&&e!=d-1||(g.push(h),f=0,h=[]);var j=function(b){var d=g.shift();d&&a.setTimeout(function(){i.lazyLoad(d,function(){j(!0)})},c&&b?c:0)};return j(!1),this},_run:function(){var e=this;e._createThumbnails(),L.wait({timeout:1e4,until:function(){return c.OPERA&&e.$("stage").css("display","inline-block"),e._stageWidth=e.$("stage").width(),e._stageHeight=e.$("stage").height(),e._stageWidth&&e._stageHeight>50},success:function(){if(E.push(e),e._options.swipe){var f=e.$("images").width(e.getDataLength()*e._stageWidth);b.each(new Array(e.getDataLength()),function(a){var d=new c.Picture,g=e.getData(a);b(d.container).css({position:"absolute",top:0,left:e._stageWidth*a}).prepend(e._layers[a]=b(L.create("galleria-layer")).css({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:2})[0]).appendTo(f),g.video&&M(d.container),e._controls.slides.push(d);var h=new c.Picture;h.isIframe=!0,b(h.container).attr("class","galleria-frame").css({position:"absolute",top:0,left:0,zIndex:4,background:"#000",display:"none"}).appendTo(d.container),e._controls.frames.push(h)}),e.finger.setup()}if(L.show(e.get("counter")),e._options.carousel&&e._carousel.bindControl
5974s(),e._options.autoplay&&(e.pause(),"number"==typeof e._options.autoplay&&(e._playtime=e._options.autoplay),e._playing=!0),e._firstrun)return e._options.autoplay&&e.trigger(c.PLAY),void("number"==typeof e._options.show&&e.show(e._options.show));e._firstrun=!0,c.History&&c.History.change(function(b){isNaN(b)?a.history.go(-1):e.show(b,d,!0)}),e.trigger(c.READY),e.theme.init.call(e,e._options),b.each(c.ready.callbacks,function(a,b){"function"==typeof b&&b.call(e,e._options)}),e._options.extend.call(e,e._options),/^[0-9]{1,4}$/.test(n)&&c.History?e.show(n,d,!0):e._data[e._options.show]&&e.show(e._options.show),e._options.autoplay&&e.trigger(c.PLAY)},error:function(){c.raise("Stage width or height is too small to show the gallery. Traced measures: width:"+e._stageWidth+"px, height: "+e._stageHeight+"px.",!0)}})},load:function(a,d,e){var f=this,g=this._options;return this._data=[],this._thumbnails=[],this.$("thumbnails").empty(),"function"==typeof d&&(e=d,d=null),a=a||g.dataSource,d=d||g.dataSelector,e=e||g.dataConfig,b.isPlainObject(a)&&(a=[a]),b.isArray(a)?this.validate(a)?this._data=a:c.raise("Load failed: JSON Array not valid."):(d+=",.video,.iframe",b(a).find(d).each(function(a,c){c=b(c);var d={},g=c.parent(),h=g.attr("href"),i=g.attr("rel");h&&("IMG"==c[0].nodeName||c.hasClass("video"))&&C(h)?d.video=h:h&&c.hasClass("iframe")?d.iframe=h:d.image=h,i&&(d.big=i),d.imagesrcset=g.data("srcset"),d.imagesizes=g.data("sizes"),d.thumbsizes=c.attr("sizes"),d.thumbsrcset=c.attr("srcset"),b.each("big bigsrcset bigsizes title description link layer image imagesrcset imagesizes".split(" "),function(a,b){c.data(b)&&(d[b]=c.data(b).toString())}),c.data("srcset")&&(d.imagesrcset=c.data("srcset")),c.data("sizes")&&(d.imagesizes=c.data("sizes")),d.big||(d.big=d.image,d.bigsrcset=d.imagesrcset,d.bigsizes=d.imagesizes),f._data.push(b.extend({title:c.attr("title")||"",thumb:c.attr("src"),image:c.attr("src"),big:c.attr("src"),description:c.attr("alt")||"",link:c.attr("longdesc"),original:c.get(0)},d,e(c)))})),"function"==typeof g.dataSort?i.sort.call(this._data,g.dataSort):"random"==g.dataSort&&this._data.sort(function(){return p.round(p.random())-.5}),this.getDataLength()&&this._parseData(function(){this.trigger(c.DATA)}),this},_parseData:function(a){var c,e=this,f=!1,g=function(){var c=!0;b.each(e._data,function(a,b){if(b.loading)return c=!1,!1}),c&&!f&&(f=!0,a.call(e))};return b.each(this._data,function(a,f){if(c=e._data[a],b.each("big image thumb".split(" "),function(a,b){f[b]&&(f[b]=new String(f[b]),f[b].srcset=f[b+"srcset"],f[b].sizes=f[b+"sizes"])}),"thumb"in f==!1&&(c.thumb=f.image),f.big||(c.big=f.image),"video"in f){var h=C(f.video);h&&(c.iframe=new B(h.provider,h.id).embed()+function(){if("object"==typeof e._options[h.provider]){var a=[];return b.each(e._options[h.provider],function(b,c){a.push(b+"="+c)}),"youtube"==h.provider&&(a=["wmode=opaque"].concat(a)),"?"+a.join("&")}return""}(),c.thumb&&c.image||b.each(["thumb","image"],function(a,b){if("image"==b&&!e._options.videoPoster)return void(c.image=d);var f=new B(h.provider,h.id);c[b]||(c.loading=!0,f.getMedia(b,function(a,b){return function(c){a[b]=c,"image"!=b||a.big||(a.big=a.image),delete a.loading,g()}}(c,b)))}))}}),g(),this},destroy:function(){return this.$("target").data("galleria",null),this.$("container").off("galleria"),this.get("target").innerHTML=this._original.html,this.clearTimer(),L.removeFromArray(F,this),L.removeFromArray(E,this),A._inst=[],void 0!==c._waiters&&c._waiters.length&&b.each(c._waiters,function(b,c){c&&a.clearTimeout(c)}),this},splice:function(){var b=this,c=L.array(arguments);return a.setTimeout(function(){i.splice.apply(b._data,c),b._parseData(function(){b._createThumbnails()})},2),b},push:function(){var b=this,c=L.array(arguments);return 1==c.length&&c[0].constructor==Array&&(c=c[0]),a.setTimeout(function(){i.push.apply(b._data,c),b._parseData(function(){b._createThumbnails(c)})},2),b},_getActive:function(){return this._controls.getActive()},validate:function(a){return!0},bind:function(a,b){return a=z(a),this.$("container").on(a,this.proxy(b)),this},unbind:function(a){return a=z(a),this.$("container").off(a),this},trigger:function(a){return a="object"==typeof a?b.extend(a,{scope:this}):{type:z(a),scope:this},this.$("container").trigger(a),this},addIdleState:function(a,b,c,d){return this._idle.add.apply(this._idle,L.array(arguments)),this},removeIdleState:function(a){return this._idle.remove.apply(this._idle,L.array(arguments)),this},enterIdleMode:function(){return this._idle.hide(),this},exitIdleMode:function(){return this._idle.showAll(),this},enterFullscreen:function(a){return this._fullscreen.enter.apply(this,L.array(arguments)),this},exitFullscreen:function(a){return this._fullscreen.exit.apply(this,L.array(arguments)),this},toggleFullscreen:function(a){return this._fullscreen[this.isFullscreen()?"exit":"enter"].apply(this,L.array(arguments)),this},bindTooltip:function(a,b){return this._tooltip.bind.apply(this._tooltip,L.array(arguments)),this},defineTooltip:function(a,b){return this._tooltip.define.apply(this._tooltip,L.array(arguments)),this},refreshTooltip:function(a){return this._tooltip.show.apply(this._tooltip,L.array(arguments)),this},openLightbox:function(){return this._lightbox.show.apply(this._lightbox,L.array(arguments)),this},closeLightbox:function(){return this._lightbox.hide.apply(this._lightbox,L.array(arguments)),this},hasVariation:function(a){return b.inArray(a,this._options.variation.split(/\s+/))>-1},getActiveImage:function(){var a=this._getActive();return a?a.image:d},getActiveThumb:function(){return this._thumbnails[this._active].image||d},getMousePosition:function(a){return{x:a.pageX-this.$("container").offset().left,y:a.pageY-this.$("container").offset().top}}
5974,addPan:function(a){if(!1!==this._options.imageCrop){a=b(a||this.getActiveImage());var c=this,d=a.width()/2,e=a.height()/2,f=parseInt(a.css("left"),10),g=parseInt(a.css("top"),10),h=f||0,i=g||0,j=0,k=0,l=!1,m=L.timestamp(),n=0,o=0,q=function(b,c,d){if(b>0&&(o=p.round(p.max(-1*b,p.min(0,c))),n!==o))if(n=o,8===t)a.parent()["scroll"+d](-1*o);else{var e={};e[d.toLowerCase()]=o,a.css(e)}},r=function(a){L.timestamp()-m<50||(l=!0,d=c.getMousePosition(a).x,e=c.getMousePosition(a).y)},s=function(b){l&&(j=a.width()-c._stageWidth,k=a.height()-c._stageHeight,f=d/c._stageWidth*j*-1,g=e/c._stageHeight*k*-1,h+=(f-h)/c._options.imagePanSmoothness,i+=(g-i)/c._options.imagePanSmoothness,q(k,i,"Top"),q(j,h,"Left"))};return 8===t&&(a.parent().scrollTop(-1*i).scrollLeft(-1*h),a.css({top:0,left:0})),this.$("stage").off("mousemove",r).on("mousemove",r),this.addTimer("pan"+c._id,s,50,!0),this}},proxy:function(a,b){return"function"!=typeof a?q:(b=b||this,function(){return a.apply(b,L.array(arguments))})},getThemeName:function(){return this.theme.name},removePan:function(){return this.$("stage").off("mousemove"),this.clearTimer("pan"+this._id),this},addElement:function(a){var c=this._dom;return b.each(L.array(arguments),function(a,b){c[b]=L.create("galleria-"+b)}),this},attachKeyboard:function(a){return this._keyboard.attach.apply(this._keyboard,L.array(arguments)),this},detachKeyboard:function(){return this._keyboard.detach.apply(this._keyboard,L.array(arguments)),this},appendChild:function(a,b){return this.$(a).append(this.get(b)||b),this},prependChild:function(a,b){return this.$(a).prepend(this.get(b)||b),this},remove:function(a){return this.$(L.array(arguments).join(",")).remove(),this},append:function(a){var b,c;for(b in a)if(a.hasOwnProperty(b))if(a[b].constructor===Array)for(c=0;a[b][c];c++)this.appendChild(b,a[b][c]);else this.appendChild(b,a[b]);return this},_scaleImage:function(a,c){if(a=a||this._controls.getActive()){var d,e=function(a){b(a.container).children(":first").css({top:p.max(0,L.parseValue(a.image.style.top)),left
5974:p.max(0,L.parseValue(a.image.style.left)),width:L.parseValue(a.image.width),height:L.parseValue(a.image.height)})};return c=b.extend({width:this._stageWidth,height:this._stageHeight,crop:this._options.imageCrop,max:this._options.maxScaleRatio,min:this._options.minScaleRatio,margin:this._options.imageMargin,position:this._options.imagePosition,iframelimit:this._options.maxVideoSize},c),this._options.layerFollow&&!0!==this._options.imageCrop?"function"==typeof c.complete?(d=c.complete,c.complete=function(){d.call(a,a),e(a)}):c.complete=e:b(a.container).children(":first").css({top:0,left:0}),a.scale(c),this}},updateCarousel:function(){return this._carousel.update(),this},resize:function(a,c){"function"==typeof a&&(c=a,a=d),a=b.extend({width:0,height:0},a);var e=this,f=this.$("container");return b.each(a,function(b,c){c||(f[b]("auto"),a[b]=e._getWH()[b])}),b.each(a,function(a,b){f[a](b)}),this.rescale(c)},rescale:function(a,e,f){var g=this;return"function"==typeof a&&(f=a,a=d),function(){g._stageWidth=a||g.$("stage").width(),g._stageHeight=e||g.$("stage").height(),g._options.swipe?(b.each(g._controls.slides,function(a,c){g._scaleImage(c),b(c.container).css("left",g._stageWidth*a)}),g.$("images").css("width",g._stageWidth*g.getDataLength())):g._scaleImage(),g._options.carousel&&g.updateCarousel(),g._controls.frames[g._controls.active]&&g._controls.frames[g._controls.active].scale({width:g._stageWidth,height:g._stageHeight,iframelimit:g._options.maxVideoSize}),g.trigger(c.RESCALE),"function"==typeof f&&f.call(g)}.call(g),this},refreshImage:function(){return this._scaleImage(),this._options.imagePan&&this.addPan(),this},_preload:function(){if(this._options.preload){var a,b,d,e=this.getNext();try{for(b=this._options.preload;b>0;b--)a=new c.Picture,d=this.getData(e),a.preload(this.isFullscreen()&&d.big?d.big:d.image),e=this.getNext(e)}catch(a){}}},show:function(d,e,f){var g=this._options.swipe;if(g||!(this._queue.length>3||!1===d||!this._options.queue&&this._queue.stalled)){if(d=p.max(0,p.min(parseInt(d,10),this.getDataLength()-1)),e=void 0!==e?!!e:d<this.getIndex(),!(f=f||!1)&&c.History)return void c.History.set(d.toString());if(this.finger&&d!==this._active&&(this.finger.to=-d*this.finger.width,this.finger.index=d),this._active=d,g){var h=this.getData(d),j=this;if(!h)return;var k=this.isFullscreen()&&h.big?h.big:h.image||h.iframe,l=this._controls.slides[d],m=l.isCached(k),n=this._thumbnails[d],o={cached:m,index:d,rewind:e,imageTarget:l.image,thumbTarget:n.image,galleriaData:h};this.trigger(b.extend(o,{type:c.LOADSTART})),j.$("container").removeClass("videoplay");var q=function(){j._layers[d].innerHTML=j.getData().layer||"",j.trigger(b.extend(o,{type:c.LOADFINISH})),j._playCheck()};j._preload(),a.setTimeout(function(){l.ready&&b(l.image).attr("src")==k?(j.trigger(b.extend(o,{type:c.IMAGE})),q()):(h.iframe&&!h.image&&(l.isIframe=!0),l.load(k,function(a){o.imageTarget=a.image,j._scaleImage(a,q).trigger(b.extend(o,{type:c.IMAGE})),q()}))},100)}else i.push.call(this._queue,{index:d,rewind:e}),this._queue.stalled||this._show();return this}},_show:function(){var e=this,f=this._queue[0],g=this.getData(f.index);if(g){var h=this.isFullscreen()&&g.big?g.big:g.image||g.iframe,j=this._controls.getActive(),k=this._controls.getNext(),l=k.isCached(h),m=this._thumbnails[f.index],n=function(){b(k.image).trigger("mouseup")};e.$("container").toggleClass("iframe",!!g.isIframe).removeClass("videoplay");var o=function(f,g,h,j,k){return function(){var l;N.active=!1,L.toggleQuality(g.image,e._options.imageQuality),e._layers[e._controls.active].innerHTML="",b(h.container).css({zIndex:0,opacity:0}).show(),b(h.container).find("iframe, .galleria-videoicon").remove(),b(e._controls.frames[e._controls.active].container).hide(),b(g.container).css({zIndex:1,left:0,top:0}).show(),e._controls.swap(),e._options.imagePan&&e.addPan(g.image),(f.iframe&&f.image||f.link||e._options.lightbox||e._options.clicknext)&&b(g.image).css({cursor:"pointer"}).on("mouseup",function(g){if(!("number"==typeof g.which&&g.which>1)){if(f.iframe){e.isPlaying()&&e.pause();var h=e._controls.frames[e._controls.active],i=e._stageWidth,j=e._stageHeight;return b(h.container).css({width:i,height:j,opacity:0}
5974).show().animate({opacity:1},200),void a.setTimeout(function(){h.load(f.iframe+(f.video?"&autoplay=1":""),{width:i,height:j},function(a){e.$("container").addClass("videoplay"),a.scale({width:e._stageWidth,height:e._stageHeight,iframelimit:f.video?e._options.maxVideoSize:d})})},100)}return e._options.clicknext&&!c.TOUCH?(e._options.pauseOnInteraction&&e.pause(),void e.next()):f.link?void(e._options.popupLinks?l=a.open(f.link,"_blank"):a.location.href=f.link):void(e._options.lightbox&&e.openLightbox())}}),e._playCheck(),e.trigger({type:c.IMAGE,index:j.index,imageTarget:g.image,thumbTarget:k.image,galleriaData:f}),i.shift.call(e._queue),e._queue.stalled=!1,e._queue.length&&e._show()}}(g,k,j,f,m);this._options.carousel&&this._options.carouselFollow&&this._carousel.follow(f.index),e._preload(),L.show(k.container),k.isIframe=g.iframe&&!g.image,b(e._thumbnails[f.index].container).addClass("active").siblings(".active").removeClass("active"),e.trigger({type:c.LOADSTART,cached:l,index:f.index,rewind:f.rewind,imageTarget:k.image,thumbTarget:m.image,galleriaData:g}),e._queue.stalled=!0,k.load(h,function(a){var h=b(e._layers[1-e._controls.active]).html(g.layer||"").hide();e._scaleImage(a,{complete:function(a){"image"in j&&L.toggleQuality(j.image,!1),L.toggleQuality(a.image,!1),e.removePan(),e.setInfo(f.index),e.setCounter(f.index),g.layer&&(h.show(),(g.iframe&&g.image||g.link||e._options.lightbox||e._options.clicknext)&&h.css("cursor","pointer").off("mouseup").mouseup(n)),g.video&&g.image&&M(a.container);var i=e._options.transition;if(b.each({initial:null===j.image,touch:c.TOUCH,fullscreen:e.isFullscreen()},function(a,b){if(b&&e._options[a+"Transition"]!==d)return i=e._options[a+"Transition"],!1}),i in N.effects==!1)o();else{var k={prev:j.container,next:a.container,rewind:f.rewind,speed:e._options.transitionSpeed||400};N.active=!0,N.init.call(e,i,k,o)}e.trigger({type:c.LOADFINISH,cached:l,index:f.index,rewind:f.rewind,imageTarget:a.image,thumbTarget:e._thumbnails[f.index].image,galleriaData:e.getData(f.index)})}})})}},getNext:function(a){return a="number"==typeof a?a:this.getIndex(),a===this.getDataLength()-1?0:a+1},getPrev:function(a){return a="number"==typeof a?a:this.getIndex(),0===a?this.getDataLength()-1:a-1},next:function(){return this.getDataLength()>1&&this.show(this.getNext(),!1),this},prev:function(){return this.getDataLength()>1&&this.show(this.getPrev(),!0),this},get:function(a){return a in this._dom?this._dom[a]:null},getData:function(a){return a in this._data?this._data[a]:this._data[this._active]},getDataLength:function(){return this._data.length},getIndex:function(){return"number"==typeof this._active&&this._active},getStageHeight:function(){return this._stageHeight},getStageWidth:function(){return this._stageWidth},getOptions:function(a){return void 0===a?this._options:this._options[a]},setOptions:function(a,c){return"object"==typeof a?b.extend(this._options,a):this._options[a]=c,this},play:function(a){return this._playing=!0,this._playtime=a||this._playtime,this._playCheck(),this.trigger(c.PLAY),this},pause:function(){return this._playing=!1,this.trigger(c.PAUSE),this},playToggle:function(a){return this._playing?this.pause():this.play(a)},isPlaying:function(){return this._playing},isFullscreen:function(){return this._fullscreen.active},_playCheck:function(){var a=this,b=0,d=L.timestamp(),e="play"+this._id;if(this._playing){this.clearTimer(e);var f=function(){if((b=L.timestamp()-d)>=a._playtime&&a._playing)return a.clearTimer(e),void a.next();a._playing&&(a.trigger({type:c.PROGRESS,percent:p.ceil(b/a._playtime*100),seconds:p.floor(b/1e3),milliseconds:b}),a.addTimer(e,f,20))};a.addTimer(e,f,20)}},setPlaytime:function(a){return this._playtime=a,this},setIndex:function(a){return this._active=a,this},setCounter:function(a){if("number"==typeof a?a++:void 0===a&&(a=this.getIndex()+1),this.get("current").innerHTML=a,t){var b=this.$("counter"),c=b.css("opacity");1===parseInt(c,10)?L.removeAlpha(b[0]):this.$("counter").css("opacity",c)}return this},setInfo:function(a){var c=this,d=this.getData(a);return b.each(["title","description"],function(a,b){var e=c.$("info-"+b);d[b]?e[d[b].length?"show":"hide"]().html(d[b]):e.empty().hide()}),this},hasInfo:function(a){var b,c="title description".split(" ");for(b=0;c[b];b++)if(this.getData(a)[c[b]])return!0;return!1},jQuery:function(a){var c=this,d=[];b.each(a.split(","),function(a,e){e=b.trim(e),c.get(e)&&d.push(e)});var e=b(c.get(d.shift()));return b.each(d,function(a,b){e=e.add(c.get(b))}),e},$:function(a){return this.jQuery.apply(this,L.array(arguments))}},b.each(x,function(a,b){var d=/_/.test(b)?b.replace(/_/g,""):b;c[b.toUpperCase()]="galleria."+d}),b.extend(c,{IE9:9===t,IE8:8===t,IE7:7===t,IE6:6===t,IE:t,WEBKIT:/webkit/.test(m),CHROME:/chrome/.test(m),SAFARI:/safari/.test(m)&&!/chrome/.test(m),QUIRK:t&&e.compatMode&&"BackCompat"===e.compatMode,MAC:/mac/.test(navigator.platform.toLowerCase()),OPERA:!!a.opera,IPHONE:/iphone/.test(m),IPAD:/ipad/.test(m),ANDROID:/android/.test(m),TOUCH:"ontouchstart"in e&&s}),c.addTheme=function(d){d.name||c.raise("No theme name specified"),(!d.version||parseInt(10*c.version)>parseInt(10*d.version))&&c.raise("This version of Galleria requires "+d.name+" theme version "+parseInt(10*c.version)/10+" or later",!0),"object"!=typeof d.defaults?d.defaults={}:d.defaults=y(d.defaults);var e,f,g=!1;return"string"==typeof d.css?(b("link").each(function(a,b){if(e=new RegExp(d.css),e.test(b.href))return g=!0,K(d),!1}),g||b(function(){var h=0,i=function(){b("script").each(function(b,c){e=new RegExp("galleria\\-"+d.name.toLowerCase()+"[\\.\\-]"),f=new RegExp("galleria\\.io\\/theme\\/"+d.name.toLowerCase()+"\\/(\\d*\\.*)?(\\d*\\.*)?(\\d*\\/)?js"),(e.test(c.src
5974)||f.test(c.src))&&(g=c.src.replace(/[^\/]*$/,"")+d.css,a.setTimeout(function(){L.loadCSS(g,"galleria-theme-"+d.name,function(){K(d)})},1))}),g||(h++>5?c.raise("No theme CSS loaded"):a.setTimeout(i,500))};i()})):K(d),d},c.loadTheme=function(d,e){if(!b("script").filter(function(){return b(this).attr("src")==d}).length){var f,g=!1;return b(a).on("load",function(){g||(f=a.setTimeout(function(){g||c.raise("Galleria had problems loading theme at "+d+". Please check theme path or load manually.",!0)},2e4))}),L.loadScript(d,function(){g=!0,a.clearTimeout(f)}),c}},c.get=function(a){return F[a]?F[a]:"number"!=typeof a?F:void c.raise("Gallery index "+a+" not found")},c.configure=function(a,d){var e={};return"string"==typeof a&&d?(e[a]=d,a=e):b.extend(e,a),c.configure.options=e,b.each(c.get(),function(a,b){b.setOptions(e)}),c},c.configure.options={},c.on=function(a,d){if(a){d=d||q;var e=a+d.toString().replace(/\s/g,"")+L.timestamp();return b.each(c.get(),function(b,c){c._binds.push(e),c.bind(a,d)}),c.on.binds.push({type:a,callback:d,hash:e}),c}},c.on.binds=[],c.run=function(a,d){return b.isFunction(d)&&(d={extend:d}),b(a||"#galleria").galleria(d),c},c.addTransition=function(a,b){return N.effects[a]=b,c},c.utils=L,c.log=function(){var c=L.array(arguments);if(!("console"in a&&"log"in a.console))return a.alert(c.join("<br>"));try{return a.console.log.apply(a.console,c)}catch(d){b.each(c,function(){a.console.log(this)})}},c.ready=function(a){return"function"!=typeof a?c:(b.each(E,function(b,c){a.call(c,c._options)}),c.ready.callbacks.push(a),c)},c.ready.callbacks=[],c.raise=function(a,c){var d=c?"Fatal error":"Error",e={color:"#fff",position:"absolute",top:0,left:0,zIndex:1e5},f=function(a){var f='<div style="padding:4px;margin:0 0 2px;background:#'+(c?"811":"222")+';">'+(c?"<strong>"+d+": </strong>":"")+a+"</div>";b.each(F,function(){var a=this.$("errors"),b=this.$("target");a.length||(b.css("position","relative"),a=this.addElement("errors").appendChild("target","errors").$("errors").css(e)),a.append(f)}),
5975F.length||b("<div>").css(b.extend(e,{position:"fixed"})).append(f).appendTo(u().body)};if(j){if(f(a),c)throw new Error(d+": "+a)}else if(c){if(G)return;G=!0,c=!1,f("Gallery could not load.")}},c.version=1.61,c.getLoadedThemes=function(){return b.map(J,function(a){return a.name})},c.requires=function(a,b){return b=b||"You need to upgrade Galleria to version "+a+" to use one or more components.",c.version<a&&c.raise(b,!0),c},c.Picture=function(a){this.id=a||null,this.image=null,this.container=L.create("galleria-image"),b(this.container).css({overflow:"hidden",position:"relative"}),this.original={width:0,height:0},this.ready=!1,this.isIframe=!1},c.Picture.prototype={cache:{},show:function(){L.show(this.image)},hide:function(){L.moveOut(this.image)},clear:function(){this.image=null},isCached:function(a){return!!this.cache[a]},preload:function(a){var c=b(new Image).on("load",function(a,b){return function(){b[a]=a}}(a,this.cache));a.srcset&&c.attr("srcset",a.srcset),a.sizes&&c.attr("sizes",a.sizes),c.attr("src",a)},load:function(d,e,f){if("function"==typeof e&&(f=e,e=null),this.isIframe){var g="if"+(new Date).getTime(),h=this.image=b("<iframe>",{src:d,frameborder:0,id:g,allowfullscreen:!0,css:{visibility:"hidden"}})[0];return e&&b(h).css(e),b(this.container).find("iframe,img").remove(),this.container.appendChild(this.image),b("#"+g).on("load",function(c,d){return function(){a.setTimeout(function(){b(c.image).css("visibility","visible"),"function"==typeof d&&d.call(c,c)},10)}}(this,f)),this.container}this.image=new Image,c.IE8&&b(this.image).css("filter","inherit"),c.IE||c.CHROME||c.SAFARI||b(this.image).css("image-rendering","optimizequality");var i=!1,j=!1,k=b(this.container),m=b(this.image),n=function(){i?l?b(this).attr("src",l):c.raise("Image not found: "+d):(i=!0,a.setTimeout(function(a,b){return function(){a.attr("src",b+(b.indexOf("?")>-1?"&":"?")+L.timestamp())}}(b(this),d),50))},o=function(d,f,g){return function(){var h=function(){b(this).off("load"),d.original=e||{height:this.height,width:this.width},c.HAS3D&&(this.style.MozTransform=this.style.webkitTransform="translate3d(0,
59750,0)"),k.append(this),d.cache[g]=g,"function"==typeof f&&a.setTimeout(function(){f.call(d,d)},1)};this.width&&this.height?h.call(this):function(a){L.wait({until:function(){return a.width&&a.height},success:function(){h.call(a)},error:function(){j?c.raise("Could not extract width/height from image: "+a.src+". Traced measures: width:"+a.width+"px, height: "+a.height+"px."):(b(new Image).on("load",o).attr("src",a.src),j=!0)},timeout:100})}(this)}}(this,f,d);return k.find("iframe,img").remove(),m.css("display","block"),L.hide(this.image),b.each("minWidth minHeight maxWidth maxHeight".split(" "),function(a,b){m.css(b,/min/.test(b)?"0":"none")}),m.on("load",o).on("error",n),d.srcset&&m.attr("srcset",d.srcset),d.sizes&&m.attr("sizes",d.sizes),m.attr("src",d),this.container},scale:function(a){var e=this;if(a=b.extend({width:0,height:0,min:d,max:d,margin:0,complete:q,position:"center",crop:!1,canvas:!1,iframelimit:d},a),this.isIframe){var f,g,h=a.width,i=a.height;if(a.iframelimit){var j=p.min(a.iframelimit/h,a.iframelimit/i);j<1?(f=h*j,g=i*j,b(this.image).css({top:i/2-g/2,left:h/2-f/2,position:"absolute"})):b(this.image).css({top:0,left:0})}b(this.image).width(f||h).height(g||i).removeAttr("width").removeAttr("height"),b(this.container).width(h).height(i),a.complete.call(e,e);try{this.image.contentWindow&&b(this.image.contentWindow).trigger("resize")}catch(a){}return this.container}if(!this.image)return this.container;var k,l,m,n=b(e.container);return L.wait({until:function(){return k=a.width||n.width()||L.parseValue(n.css("width")),l=a.height||n.height()||L.parseValue(n.css("height")),k&&l},success:function(){var c=(k-2*a.margin)/e.original.width,d=(l-2*a.margin)/e.original.height,f=p.min(c,d),g=p.max(c,d),h={true:g,width:c,height:d,false:f,landscape:e.original.width>e.original.height?g:f,portrait:e.original.width<e.original.height?g:f},i=h[a.crop.toString()],j="";a.max&&(i=p.min(a.max,i)),a.min&&(i=p.max(a.min,i)),b.each(["width","height"],function(a,c){b(e.image)[c](e[c]=e.image[c]=p.round(e.original[c]*i))}),b(e.container).width(k).height(l),a.canvas&&H&&(H.elem.width=e.width,H.elem.height=e.height,j=e.image.src+":"+e.width+"x"+e.height,e.image.src=H.cache[j]||function(a){H.context.drawImage(e.image,0,0,e.original.width*i,e.original.height*i);try{return m=H.elem.toDataURL(),H.length+=m.length,H.cache[a]=m,m}catch(a){return e.image.src}}(j));var n={},o={},q=function(a,c,d){var f=0;if(/\%/.test(a)){var g=parseInt(a,10)/100,h=e.image[c]||b(e.image)[c]();f=p.ceil(-1*h*g+d*g)}else f=L.parseValue(a);return f},r={top:{top:0},left:{left:0},right:{left:"100%"},bottom:{top:"100%"}};b.each(a.position.toLowerCase().split(" "),function(a,b){"center"===b&&(b="50%"),n[a?"top":"left"]=b}),b.each(n,function(a,c){r.hasOwnProperty(c)&&b.extend(o,r[c])}),n=n.top?b.extend(n,o):o,n=b.extend({top:"50%",left:"50%"},n),b(e.image).css({position:"absolute",top:q(n.top,"height",l),left:q(n.left,"width",k)}),e.show(),e.ready=!0,a.complete.call(e,e)},error:function(){c.raise("Could not scale image: "+e.image.src)},timeout:1e3}),this}},b.extend(b.easing,{galleria:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},galleriaIn:function(a,b,c,d,e){return d*(b/=e)*b+c},galleriaOut:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}}),c.Finger=function(){var d=(p.abs,c.HAS3D=function(){var a,c,d=e.createElement("p"),f=["webkit","O","ms","Moz",""],g=0,h="transform";for(u().html.insertBefore(d,null);f[g];g++)c=f[g]?f[g]+"Transform":h,void 0!==d.style[c]&&(d.style[c]="translate3d(1px,1px,1px)",a=b(d).css(f[g]?"-"+f[g].toLowerCase()+"-"+h:h));return u().html.removeChild(d),void 0!==a&&a.length>0&&"none"!==a}()),g=function(){var b="RequestAnimationFrame";return a.requestAnimationFrame||a["webkit"+b]||a["moz"+b]||a["o"+b]||a["ms"+b]||function(b){a.setTimeout(b,1e3/60)}}(),h=function(c,e){if(this.config={start:0,duration:500,onchange:function(){},oncomplete:function(){},easing:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c}},this.easeout=function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},c.children.length){var f=this;b.extend(this.config,e),this.elem=c,this.child=c.children[0],this.to=this.pos=0,this.touching=!1,this.start={},this.index=this.config.start,this.anim=0,this.easing=this.config.easing,d||(this.child.style.position="absolute",this.elem.style.position="relative"),b.each(["ontouchstart","ontouchmove","ontouchend","setup"],function(a,b){f[b]=function(a){return function(){a.apply(f,arguments)}}(f[b])}),this.setX=function(){var a=f.child.style;if(!d)return void(a.left=f.pos+"px");a.MozTransform=a.webkitTransform=a.transform="translate3d("+f.pos+"px,0,0)"},b(c).on("touchstart",this.ontouchstart),b(a).on("resize",this.setup),b(a).on("orientationchange",this.setup),this.setup(),function a(){g(a),f.loop.call(f)}()}};return h.prototype={constructor:h,setup:function(){this.width=b(this.elem).width(),this.length=p.ceil(b(this.child).width()/this.width),0!==this.index&&(this.index=p.max(0,p.min(this.index,this.length-1)),this.pos=this.to=-this.width*this.index)},setPosition:function(a){this.pos=a,this.to=a},ontouchstart:function(a){var b=a.originalEvent.touches;this.start={pageX:b[0].pageX,pageY:b[0].pageY,time:+new Date},this.isScrolling=null,this.touching=!0,this.deltaX=0,f.on("touchmove",this.ontouchmove),f.on("touchend",this.ontouchend)},ontouchmove:function(a){var b=a.originalEvent.touches;b&&b.length>1||a.scale&&1!==a.scale||(this.deltaX=b[0].pageX-this.start.pageX,null===this.isScrolling&&(this.isScrolling=!!(this.isScrolling||p.abs(this.deltaX)<p.abs(b[0].pageY-this.start.pageY))),this.isScrolling||(a.preventDefault(),this.deltaX/=!this.index&&this.deltaX>0||this.index==this.length-1&&this.deltaX<0?p.abs(this.deltaX)/this.width+1.8:1,this.to=this.deltaX-this.index*this.width),a.stopPropagation())},ontouchend:function(a){this.touching=!1;var b=+new Date-this.start.time<250&&p.abs(this.deltaX)>40||p.abs(this.deltaX)>this.width/2,c=!this.index&&this.deltaX>0||this.index==this.length-1&&this.deltaX<0;this.isScrolling||this.show(this.index+(b&&!c?this.deltaX<0?1:-1:0)),f.off("touchmove",this.ontouchmove),f.off("touchend",this.ontouchend)},show:function(a){a!=this.index?this.config.onchange.call(this,a):this.to=-a*this.width},moveTo:function(a){a!=this.index&&(this.pos=this.to=-a*this.width,this.index=a)},loop:function(){var a=this.to-this.pos,b=1;if(this.width&&a&&(b=p.max(.5,p.min(1.5,p.abs(a/this.width)))),this.touching||p.abs(a)<=1)this.pos=this.to,a=0,this.anim&&!this.touching&&this.config.oncomplete(this.index),this.anim=0,this.easing=this.config.easing;else{this.anim||(this.anim={start:this.pos,time:+new Date,distance:a,factor:b,destination:this.to});var c=+new Date-this.anim.time,d=this.config.duration*this.anim.factor;if(c>d||this.anim.destination!=this.to)return this.anim=0,void(this.easing=this.easeout);this.pos=this.easing(null,c,this.anim.start,this.anim.distance,d)}this.setX()}},h}(),b.fn.galleria=function(a){var d=this.selector;return b(this).length?this.each(function(){b.data(this,"galleria")&&(b.data(this,"galleria").destroy(),b(this).find("*").hide()),b.data(this,"galleria",(new c).init(this,a))}):(b(function(){b(d).length?b(d).galleria(a):c.utils.wait({until:function(){return b(d).length},success:function(){b(d).galleria(a)},error:function(){c.raise('Init failed: Galleria could not find the element "'+d+'".')},timeout:5e3})}),this)},c});
5976
5977/*  fullcalendar  */
5978/*!
5979 * FullCalendar v3.8.1
5980 * Docs & License: https://fullcalendar.io/
5981 * (c) 2017 Adam Shaw
5982 */
5983(function webpackUniversalModuleDefinition(root, factory) {
5984	if(typeof exports === 'object' && typeof module === 'object')
5985		module.exports = factory(require("moment"), require("jquery"));
5986	else if(typeof define === 'function' && define.amd)
5987		define(["moment", "jquery"], factory);
5988	else if(typeof exports === 'object')
5989		exports["FullCalendar"] = factory(require("moment"), require("jquery"));
5990	else
5991		root["FullCalendar"] = factory(root["moment"], root["jQuery"]);
5992})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_3__) {
5993return /******/ (function(modules) { // webpackBootstrap
5994/******/ 	// The module cache
5995/******/ 	var installedModules = {};
5996/******/
5997/******/ 	// The require function
5998/******/ 	function __webpack_require__(moduleId) {
5999/******/
6000/******/ 		// Check if module is in cache
6001/******/ 		if(installedModules[moduleId]) {
6002/******/ 			return installedModules[moduleId].exports;
6003/******/ 		}
6004/******/ 		// Create a new module (and put it into the cache)
6005/******/ 		var module = installedModules[moduleId] = {
6006/******/ 			i: moduleId,
6007/******/ 			l: false,
6008/******/ 			exports: {}
6009/******/ 		};
6010/******/
6011/******/ 		// Execute the module function
6012/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
6013/******/
6014/******/ 		// Flag the module as loaded
6015/******/ 		module.l = true;
6016/******/
6017/******/ 		// Return the exports of the module
6018/******/ 		return module.exports;
6019/******/ 	}
6020/******/
6021/******/
6022/******/ 	// expose the modules object (__webpack_modules__)
6023/******/ 	__webpack_require__.m = modules;
6024/******/
6025/******/ 	// expose the module cache
6026/******/ 	__webpack_require__.c = installedModules;
6027/******/
6028/******/ 	// define getter function for harmony exports
6029/******/ 	__webpack_require__.d = function(exports, name, getter) {
6030/******/ 		if(!__webpack_require__.o(exports, name)) {
6031/******/ 			Object.defineProperty(exports, name, {
6032/******/ 				configurable: false,
6033/******/ 				enumerable: true,
6034/******/ 				get: getter
6035/******/ 			});
6036/******/ 		}
6037/******/ 	};
6038/******/
6039/******/ 	// getDefaultExport function for compatibility with non-harmony modules
6040/******/ 	__webpack_require__.n = function(module) {
6041/******/ 		var getter = module && module.__esModule ?
6042/******/ 			function getDefault() { return module['default']; } :
6043/******/ 			function getModuleExports() { return module; };
6044/******/ 		__webpack_require__.d(getter, 'a', getter);
6045/******/ 		return getter;
6046/******/ 	};
6047/******/
6048/******/ 	// Object.prototype.hasOwnProperty.call
6049/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
6050/******/
6051/******/ 	// __webpack_public_path__
6052/******/ 	__webpack_require__.p = "";
6053/******/
6054/******/ 	// Load entry module and return exports
6055/******/ 	return __webpack_require__(__webpack_require__.s = 236);
6056/******/ })
6057/************************************************************************/
6058/******/ ([
6059/* 0 */
6060/***/ (function(module, exports) {
6061
6062module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
6063
6064/***/ }),
6065/* 1 */,
6066/* 2 */
6067/***/ (function(module, exports) {
6068
6069/*
6070derived from:
6071https://github.com/Microsoft/tslib/blob/v1.6.0/tslib.js
6072
6073only include the helpers we need, to keep down filesize
6074*/
6075var extendStatics = Object.setPrototypeOf ||
6076    ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6077    function (d, b) { for (var p in b)
6078        if (b.hasOwnProperty(p))
6079            d[p] = b[p]; };
6080exports.__extends = function (d, b) {
6081    extendStatics(d, b);
6082    function __() { this.constructor = d; }
6083    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6084};
6085
6086
6087/***/ }),
6088/* 3 */
6089/***/ (function(module, exports) {
6090
6091module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
6092
6093/***/ }),
6094/* 4 */
6095/***/ (function(module, exports, __webpack_require__) {
6096
6097Object.defineProperty(exports, "__esModule", { value: true });
6098var moment = __webpack_require__(0);
6099var $ = __webpack_require__(3);
6100/* FullCalendar-specific DOM Utilities
6101----------------------------------------------------------------------------------------------------------------------*/
6102// Given the scrollbar widths of some other container, create borders/margins on rowEls in order to match the left
6103// and right space that was offset by the scrollbars. A 1-pixel border first, then margin beyond that.
6104function compensateScroll(rowEls, scrollbarWidths) {
6105    if (scrollbarWidths.left) {
6106        rowEls.css({
6107            'border-left-width': 1,
6108            'margin-left': scrollbarWidths.left - 1
6109        });
6110    }
6111    if (scrollbarWidths.right) {
6112        rowEls.css({
6113            'border-right-width': 1,
6114            'margin-right': scrollbarWidths.right - 1
6115        });
6116    }
6117}
6118exports.compensateScroll = compensateScroll;
6119// Undoes compensateScroll and restores all borders/margins
6120function uncompensateScroll(rowEls) {
6121    rowEls.css({
6122        'margin-left': '',
6123        'margin-right': '',
6124        'border-left-width': '',
6125        'border-right-width': ''
6126    });
6127}
6128exports.uncompensateScroll = uncompensateScroll;
6129// Make the mouse cursor express that an event is not allowed in the current area
6130function disableCursor() {
6131    $('body').addClass('fc-not-allowed');
6132}
6133exports.disableCursor = disableCursor;
6134// Returns the mouse cursor to its original look
6135function enableCursor() {
6136    $('body').removeClass('fc-not-allowed');
6137}
6138exports.enableCursor = enableCursor;
6139// Given a total available height to fill, have `els` (essentially child rows) expand to accomodate.
6140// By default, all elements that are shorter than the recommended height are expanded uniformly, not considering
6141// any other els that are already too tall. if `shouldRedistribute` is on, it considers these tall rows and
6142// reduces the available height.
6143function distributeHeight(els, availableHeight, shouldRedistribute) {
6144    // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,
6145    // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.
6146    var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element
6147    var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*
6148    var flexEls = []; // elements that are allowed to expand. array of DOM nodes
6149    var flexOffsets = []; // amount of vertical space it takes up
6150    var flexHeights = []; // actual css height
6151    var usedHeight = 0;
6152    undistributeHeight(els); // give all elements their natural height
6153    // find elements that are below the recommended height (expandable).
6154    // important to query for heights in a single first pass (to avoid reflow oscillation).
6155    els.each(function (i, el) {
6156        var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;
6157        var naturalOffset = $(el).outerHeight(true);
6158        if (naturalOffset < minOffset) {
6159            flexEls.push(el);
6160            flexOffsets.push(naturalOffset);
6161            flexHeights.push($(el).height());
6162        }
6163        else {
6164            // this element stretches past recommended height (non-expandable). mark the space as occupied.
6165            usedHeight += naturalOffset;
6166        }
6167    });
6168    // readjust the recommended height to only consider the height available to non-maxed-out rows.
6169    if (shouldRedistribute) {
6170        availableHeight -= usedHeight;
6171        minOffset1 = Math.floor(availableHeight / flexEls.length);
6172        minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*
6173    }
6174    // assign heights to all expandable elements
6175    $(flexEls).each(function (i, el) {
6176        var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;
6177        var naturalOffset = flexOffsets[i];
6178        var naturalHeight = flexHeights[i];
6179        var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding
6180        if (naturalOffset < minOffset) {
6181            $(el).height(newHeight);
6182        }
6183    });
6184}
6185exports.distributeHeight = distributeHeight;
6186// Undoes distrubuteHeight, restoring all els to their natural height
6187function undistributeHeight(els) {
6188    els.height('');
6189}
6190exports.undistributeHeight = undistributeHeight;
6191// Given `els`, a jQuery set of <td> cells, find the cell with the largest natural width and set the widths of all the
6192// cells to be that width.
6193// PREREQUISITE: if you want a cell to take up width, it needs to have a single inner element w/ display:inline
6194function matchCellWidths(els) {
6195    var maxInnerWidth = 0;
6196    els.find('> *').each(function (i, innerEl) {
6197        var innerWidth = $(innerEl).outerWidth();
6198        if (innerWidth > maxInnerWidth) {
6199            maxInnerWidth = innerWidth;
6200        }
6201    });
6202    maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance
6203    els.width(maxInnerWidth);
6204    return maxInnerWidth;
6205}
6206exports.matchCellWidths = matchCellWidths;
6207// Given one element that resides inside another,
6208// Subtracts the height of the inner element from the outer element.
6209function subtractInnerElHeight(outerEl, innerEl) {
6210    var both = outerEl.add(innerEl);
6211    var diff;
6212    // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked
6213    both.css({
6214        position: 'relative',
6215        left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll
6216    });
6217    diff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions
6218    both.css({ position: '', left: '' }); // undo hack
6219    return diff;
6220}
6221exports.subtractInnerElHeight = subtractInnerElHeight;
6222/* Element Geom Utilities
6223----------------------------------------------------------------------------------------------------------------------*/
6224// borrowed from https://github.com/jquery/jquery-ui/blob/1.11.0/ui/core.js#L51
6225function getScrollParent(el) {
6226    var position = el.css('position');
6227    var scrollParent = el.parents().filter(function () {
6228        var parent = $(this);
6229        return (/(auto|scroll)/).test(parent.css('overflow') + parent.css('overflow-y') + parent.css('overflow-x'));
6230    }).eq(0);
6231    return position === 'fixed' || !scrollParent.length ? $(el[0].ownerDocument || document) : scrollParent;
6232}
6233exports.getScrollParent = getScrollParent;
6234// Queries the outer bounding area of a jQuery element.
6235// Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).
6236// Origin is optional.
6237function getOuterRect(el, origin) {
6238    var offset = el.offset();
6239    var left = offset.left - (origin ? origin.left : 0);
6240    var top = offset.top - (origin ? origin.top : 0);
6241    return {
6242        left: left,
6243        right: left + el.outerWidth(),
6244        top: top,
6245        bottom: top + el.outerHeight()
6246    };
6247}
6248exports.getOuterRect = getOuterRect;
6249// Queries the area within the margin/border/scrollbars of a jQuery element. Does not go within the padding.
6250// Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).
6251// Origin is optional.
6252// WARNING: given element can't have borders
6253// NOTE: should use clientLeft/clientTop, but very unreliable cross-browser.
6254function getClientRect(el, origin) {
6255    var offset = el.offset();
6256    var scrollbarWidths = getScrollbarWidths(el);
6257    var left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);
6258    var top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);
6259    return {
6260        left: left,
6261        right: left + el[0].clientWidth,
6262        top: top,
6263        bottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars
6264    };
6265}
6266exports.getClientRect = getClientRect;
6267// Queries the area within the margin/border/padding of a jQuery element. Assumed not to have scrollbars.
6268// Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).
6269// Origin is optional.
6270function getContentRect(el, origin) {
6271    var offset = el.offset(); // just outside of border, margin not included
6272    var left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -
6273        (origin ? origin.left : 0);
6274    var top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -
6275        (origin ? origin.top : 0);
6276    return {
6277        left: left,
6278        right: left + el.width(),
6279        top: top,
6280        bottom: top + el.height()
6281    };
6282}
6283exports.getContentRect = getContentRect;
6284// Returns the computed left/right/top/bottom scrollbar widths for the given jQuery element.
6285// WARNING: given element can't have borders (which will cause offsetWidth/offsetHeight to be larger).
6286// NOTE: should use clientLeft/clientTop, but very unreliable cross-browser.
6287function getScrollbarWidths(el) {
6288    var leftRightWidth = el[0].offsetWidth - el[0].clientWidth;
6289    var bottomWidth = el[0].offsetHeight - el[0].clientHeight;
6290    var widths;
6291    leftRightWidth = sanitizeScrollbarWidth(leftRightWidth);
6292    bottomWidth = sanitizeScrollbarWidth(bottomWidth);
6293    widths = { left: 0, right: 0, top: 0, bottom: bottomWidth };
6294    if (getIsLeftRtlScrollbars() && el.css('direction') === 'rtl') {
6295        widths.left = leftRightWidth;
6296    }
6297    else {
6298        widths.right = leftRightWidth;
6299    }
6300    return widths;
6301}
6302exports.getScrollbarWidths = getScrollbarWidths;
6303// The scrollbar width computations in getScrollbarWidths are sometimes flawed when it comes to
6304// retina displays, rounding, and IE11. Massage them into a usable value.
6305function sanitizeScrollbarWidth(width) {
6306    width = Math.max(0, width); // no negatives
6307    width = Math.round(width);
6308    return width;
6309}
6310// Logic for determining if, when the element is right-to-left, the scrollbar appears on the left side
6311var _isLeftRtlScrollbars = null;
6312function getIsLeftRtlScrollbars() {
6313    if (_isLeftRtlScrollbars === null) {
6314        _isLeftRtlScrollbars = computeIsLeftRtlScrollbars();
6315    }
6316    return _isLeftRtlScrollbars;
6317}
6318function computeIsLeftRtlScrollbars() {
6319    var el = $('<div><div/></div>')
6320        .css({
6321        position: 'absolute',
6322        top: -1000,
6323        left: 0,
6324        border: 0,
6325        padding: 0,
6326        overflow: 'scroll',
6327        direction: 'rtl'
6328    })
6329        .appendTo('body');
6330    var innerEl = el.children();
6331    var res = innerEl.offset().left > el.offset().left; // is the inner div shifted to accommodate a left scrollbar?
6332    el.remove();
6333    return res;
6334}
6335// Retrieves a jQuery element's computed CSS value as a floating-point number.
6336// If the queried value is non-numeric (ex: IE can return "medium" for border width), will just return zero.
6337function getCssFloat(el, prop) {
6338    return parseFloat(el.css(prop)) || 0;
6339}
6340/* Mouse / Touch Utilities
6341----------------------------------------------------------------------------------------------------------------------*/
6342// Returns a boolean whether this was a left mouse click and no ctrl key (which means right click on Mac)
6343function isPrimaryMouseButton(ev) {
6344    return ev.which === 1 && !ev.ctrlKey;
6345}
6346exports.isPrimaryMouseButton = isPrimaryMouseButton;
6347function getEvX(ev) {
6348    var touches = ev.originalEvent.touches;
6349    // on mobile FF, pageX for touch events is present, but incorrect,
6350    // so, look at touch coordinates first.
6351    if (touches && touches.length) {
6352        return touches[0].pageX;
6353    }
6354    return ev.pageX;
6355}
6356exports.getEvX = getEvX;
6357function getEvY(ev) {
6358    var touches = ev.originalEvent.touches;
6359    // on mobile FF, pageX for touch events is present, but incorrect,
6360    // so, look at touch coordinates first.
6361    if (touches && touches.length) {
6362        return touches[0].pageY;
6363    }
6364    return ev.pageY;
6365}
6366exports.getEvY = getEvY;
6367function getEvIsTouch(ev) {
6368    return /^touch/.test(ev.type);
6369}
6370exports.getEvIsTouch = getEvIsTouch;
6371function preventSelection(el) {
6372    el.addClass('fc-unselectable')
6373        .on('selectstart', preventDefault);
6374}
6375exports.preventSelection = preventSelection;
6376function allowSelection(el) {
6377    el.removeClass('fc-unselectable')
6378        .off('selectstart', preventDefault);
6379}
6380exports.allowSelection = allowSelection;
6381// Stops a mouse/touch event from doing it's native browser action
6382function preventDefault(ev) {
6383    ev.preventDefault();
6384}
6385exports.preventDefault = preventDefault;
6386/* General Geometry Utils
6387----------------------------------------------------------------------------------------------------------------------*/
6388// Returns a new rectangle that is the intersection of the two rectangles. If they don't intersect, returns false
6389function intersectRects(rect1, rect2) {
6390    var res = {
6391        left: Math.max(rect1.left, rect2.left),
6392        right: Math.min(rect1.right, rect2.right),
6393        top: Math.max(rect1.top, rect2.top),
6394        bottom: Math.min(rect1.bottom, rect2.bottom)
6395    };
6396    if (res.left < res.right && res.top < res.bottom) {
6397        return res;
6398    }
6399    return false;
6400}
6401exports.intersectRects = intersectRects;
6402// Returns a new point that will have been moved to reside within the given rectangle
6403function constrainPoint(point, rect) {
6404    return {
6405        left: Math.min(Math.max(point.left, rect.left), rect.right),
6406        top: Math.min(Math.max(point.top, rect.top), rect.bottom)
6407    };
6408}
6409exports.constrainPoint = constrainPoint;
6410// Returns a point that is the center of the given rectangle
6411function getRectCenter(rect) {
6412    return {
6413        left: (rect.left + rect.right) / 2,
6414        top: (rect.top + rect.bottom) / 2
6415    };
6416}
6417exports.getRectCenter = getRectCenter;
6418// Subtracts point2's coordinates from point1's coordinates, returning a delta
6419function diffPoints(point1, point2) {
6420    return {
6421        left: point1.left - point2.left,
6422        top: point1.top - point2.top
6423    };
6424}
6425exports.diffPoints = diffPoints;
6426/* Object Ordering by Field
6427----------------------------------------------------------------------------------------------------------------------*/
6428function parseFieldSpecs(input) {
6429    var specs = [];
6430    var tokens = [];
6431    var i;
6432    var token;
6433    if (typeof input === 'string') {
6434        tokens = input.split(/\s*,\s*/);
6435    }
6436    else if (typeof input === 'function') {
6437        tokens = [input];
6438    }
6439    else if ($.isArray(input)) {
6440        tokens = input;
6441    }
6442    for (i = 0; i < tokens.length; i++) {
6443        token = tokens[i];
6444        if (typeof token === 'string') {
6445            specs.push(token.charAt(0) === '-' ?
6446                { field: token.substring(1), order: -1 } :
6447                { field: token, order: 1 });
6448        }
6449        else if (typeof token === 'function') {
6450            specs.push({ func: token });
6451        }
6452    }
6453    return specs;
6454}
6455exports.parseFieldSpecs = parseFieldSpecs;
6456function compareByFieldSpecs(obj1, obj2, fieldSpecs, obj1fallback, obj2fallback) {
6457    var i;
6458    var cmp;
6459    for (i = 0; i < fieldSpecs.length; i++) {
6460        cmp = compareByFieldSpec(obj1, obj2, fieldSpecs[i], obj1fallback, obj2fallback);
6461        if (cmp) {
6462            return cmp;
6463        }
6464    }
6465    return 0;
6466}
6467exports.compareByFieldSpecs = compareByFieldSpecs;
6468function compareByFieldSpec(obj1, obj2, fieldSpec, obj1fallback, obj2fallback) {
6469    if (fieldSpec.func) {
6470        return fieldSpec.func(obj1, obj2);
6471    }
6472    var val1 = obj1[fieldSpec.field];
6473    var val2 = obj2[fieldSpec.field];
6474    if (val1 == null && obj1fallback) {
6475        val1 = obj1fallback[fieldSpec.field];
6476    }
6477    if (val2 == null && obj2fallback) {
6478        val2 = obj2fallback[fieldSpec.field];
6479    }
6480    return flexibleCompare(val1, val2) * (fieldSpec.order || 1);
6481}
6482exports.compareByFieldSpec = compareByFieldSpec;
6483function flexibleCompare(a, b) {
6484    if (!a && !b) {
6485        return 0;
6486    }
6487    if (b == null) {
6488        return -1;
6489    }
6490    if (a == null) {
6491        return 1;
6492    }
6493    if ($.type(a) === 'string' || $.type(b) === 'string') {
6494        return String(a).localeCompare(String(b));
6495    }
6496    return a - b;
6497}
6498exports.flexibleCompare = flexibleCompare;
6499/* Date Utilities
6500----------------------------------------------------------------------------------------------------------------------*/
6501exports.dayIDs = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
6502exports.unitsDesc = ['year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];
6502 // descending
6503// Diffs the two moments into a Duration where full-days are recorded first, then the remaining time.
6504// Moments will have their timezones normalized.
6505function diffDayTime(a, b) {
6506    return moment.duration({
6507        days: a.clone().stripTime().diff(b.clone().stripTime(), 'days'),
6508        ms: a.time() - b.time() // time-of-day from day start. disregards timezone
6509    });
6510}
6511exports.diffDayTime = diffDayTime;
6512// Diffs the two moments via their start-of-day (regardless of timezone). Produces whole-day durations.
6513function diffDay(a, b) {
6514    return moment.duration({
6515        days: a.clone().stripTime().diff(b.clone().stripTime(), 'days')
6516    });
6517}
6518exports.diffDay = diffDay;
6519// Diffs two moments, producing a duration, made of a whole-unit-increment of the given unit. Uses rounding.
6520function diffByUnit(a, b, unit) {
6521    return moment.duration(Math.round(a.diff(b, unit, true)), // returnFloat=true
6522    unit);
6523}
6524exports.diffByUnit = diffByUnit;
6525// Computes the unit name of the largest whole-unit period of time.
6526// For example, 48 hours will be "days" whereas 49 hours will be "hours".
6527// Accepts start/end, a range object, or an original duration object.
6528function computeGreatestUnit(start, end) {
6529    var i;
6530    var unit;
6531    var val;
6532    for (i = 0; i < exports.unitsDesc.length; i++) {
6533        unit = exports.unitsDesc[i];
6534        val = computeRangeAs(unit, start, end);
6535        if (val >= 1 && isInt(val)) {
6536            break;
6537        }
6538    }
6539    return unit; // will be "milliseconds" if nothing else matches
6540}
6541exports.computeGreatestUnit = computeGreatestUnit;
6542// like computeGreatestUnit, but has special abilities to interpret the source input for clues
6543function computeDurationGreatestUnit(duration, durationInput) {
6544    var unit = computeGreatestUnit(duration);
6545    // prevent days:7 from being interpreted as a week
6546    if (unit === 'week' && typeof durationInput === 'object' && durationInput.days) {
6547        unit = 'day';
6548    }
6549    return unit;
6550}
6551exports.computeDurationGreatestUnit = computeDurationGreatestUnit;
6552// Computes the number of units (like "hours") in the given range.
6553// Range can be a {start,end} object, separate start/end args, or a Duration.
6554// Results are based on Moment's .as() and .diff() methods, so results can depend on internal handling
6555// of month-diffing logic (which tends to vary from version to version).
6556function computeRangeAs(unit, start, end) {
6557    if (end != null) {
6558        return end.diff(start, unit, true);
6559    }
6560    else if (moment.isDuration(start)) {
6561        return start.as(unit);
6562    }
6563    else {
6564        return start.end.diff(start.start, unit, true);
6565    }
6566}
6567// Intelligently divides a range (specified by a start/end params) by a duration
6568function divideRangeByDuration(start, end, dur) {
6569    var months;
6570    if (durationHasTime(dur)) {
6571        return (end - start) / dur;
6572    }
6573    months = dur.asMonths();
6574    if (Math.abs(months) >= 1 && isInt(months)) {
6575        return end.diff(start, 'months', true) / months;
6576    }
6577    return end.diff(start, 'days', true) / dur.asDays();
6578}
6579exports.divideRangeByDuration = divideRangeByDuration;
6580// Intelligently divides one duration by another
6581function divideDurationByDuration(dur1, dur2) {
6582    var months1;
6583    var months2;
6584    if (durationHasTime(dur1) || durationHasTime(dur2)) {
6585        return dur1 / dur2;
6586    }
6587    months1 = dur1.asMonths();
6588    months2 = dur2.asMonths();
6589    if (Math.abs(months1) >= 1 && isInt(months1) &&
6590        Math.abs(months2) >= 1 && isInt(months2)) {
6591        return months1 / months2;
6592    }
6593    return dur1.asDays() / dur2.asDays();
6594}
6595exports.divideDurationByDuration = divideDurationByDuration;
6596// Intelligently multiplies a duration by a number
6597function multiplyDuration(dur, n) {
6598    var months;
6599    if (durationHasTime(dur)) {
6600        return moment.duration(dur * n);
6601    }
6602    months = dur.asMonths();
6603    if (Math.abs(months) >= 1 && isInt(months)) {
6604        return moment.duration({ months: months * n });
6605    }
6606    return moment.duration({ days: dur.asDays() * n });
6607}
6608exports.multiplyDuration = multiplyDuration;
6609// Returns a boolean about whether the given duration has any time parts (hours/minutes/seconds/ms)
6610function durationHasTime(dur) {
6611    return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());
6612}
6613exports.durationHasTime = durationHasTime;
6614function isNativeDate(input) {
6615    return Object.prototype.toString.call(input) === '[object Date]' || input instanceof Date;
6616}
6617exports.isNativeDate = isNativeDate;
6618// Returns a boolean about whether the given input is a time string, like "06:40:00" or "06:00"
6619function isTimeString(str) {
6620    return typeof str === 'string' &&
6621        /^\d+\:\d+(?:\:\d+\.?(?:\d{3})?)?$/.test(str);
6622}
6623exports.isTimeString = isTimeString;
6624/* Logging and Debug
6625----------------------------------------------------------------------------------------------------------------------*/
6626function log() {
6627    var args = [];
6628    for (var _i = 0; _i < arguments.length; _i++) {
6629        args[_i] = arguments[_i];
6630    }
6631    var console = window.console;
6632    if (console && console.log) {
6633        return console.log.apply(console, args);
6634    }
6635}
6636exports.log = log;
6637function warn() {
6638    var args = [];
6639    for (var _i = 0; _i < arguments.length; _i++) {
6640        args[_i] = arguments[_i];
6641    }
6642    var console = window.console;
6643    if (console && console.warn) {
6644        return console.warn.apply(console, args);
6645    }
6646    else {
6647        return log.apply(null, args);
6648    }
6649}
6650exports.warn = warn;
6651/* General Utilities
6652----------------------------------------------------------------------------------------------------------------------*/
6653var hasOwnPropMethod = {}.hasOwnProperty;
6654// Merges an array of objects into a single object.
6655// The second argument allows for an array of property names who's object values will be merged together.
6656function mergeProps(propObjs, complexProps) {
6657    var dest = {};
6658    var i;
6659    var name;
6660    var complexObjs;
6661    var j;
6662    var val;
6663    var props;
6664    if (complexProps) {
6665        for (i = 0; i < complexProps.length; i++) {
6666            name = complexProps[i];
6667            complexObjs = [];
6668            // collect the trailing object values, stopping when a non-object is discovered
6669            for (j = propObjs.length - 1; j >= 0; j--) {
6670                val = propObjs[j][name];
6671                if (typeof val === 'object') {
6672                    complexObjs.unshift(val);
6673                }
6674                else if (val !== undefined) {
6675                    dest[name] = val; // if there were no objects, this value will be used
6676                    break;
6677                }
6678            }
6679            // if the trailing values were objects, use the merged value
6680            if (complexObjs.length) {
6681                dest[name] = mergeProps(complexObjs);
6682            }
6683        }
6684    }
6685    // copy values into the destination, going from last to first
6686    for (i = propObjs.length - 1; i >= 0; i--) {
6687        props = propObjs[i];
6688        for (name in props) {
6689            if (!(name in dest)) {
6690                dest[name] = props[name];
6691            }
6692        }
6693    }
6694    return dest;
6695}
6696exports.mergeProps = mergeProps;
6697function copyOwnProps(src, dest) {
6698    for (var name_1 in src) {
6699        if (hasOwnProp(src, name_1)) {
6700            dest[name_1] = src[name_1];
6701        }
6702    }
6703}
6704exports.copyOwnProps = copyOwnProps;
6705function hasOwnProp(obj, name) {
6706    return hasOwnPropMethod.call(obj, name);
6707}
6708exports.hasOwnProp = hasOwnProp;
6709function applyAll(functions, thisObj, args) {
6710    if ($.isFunction(functions)) {
6711        functions = [functions];
6712    }
6713    if (functions) {
6714        var i = void 0;
6715        var ret = void 0;
6716        for (i = 0; i < functions.length; i++) {
6717            ret = functions[i].apply(thisObj, args) || ret;
6718        }
6719        return ret;
6720    }
6721}
6722exports.applyAll = applyAll;
6723function removeMatching(array, testFunc) {
6724    var removeCnt = 0;
6725    var i = 0;
6726    while (i < array.length) {
6727        if (testFunc(array[i])) {
6728            array.splice(i, 1);
6729            removeCnt++;
6730        }
6731        else {
6732            i++;
6733        }
6734    }
6735    return removeCnt;
6736}
6737exports.removeMatching = removeMatching;
6738function removeExact(array, exactVal) {
6739    var removeCnt = 0;
6740    var i = 0;
6741    while (i < array.length) {
6742        if (array[i] === exactVal) {
6743            array.splice(i, 1);
6744            removeCnt++;
6745        }
6746        else {
6747            i++;
6748        }
6749    }
6750    return removeCnt;
6751}
6752exports.removeExact = removeExact;
6753function isArraysEqual(a0, a1) {
6754    var len = a0.length;
6755    var i;
6756    if (len == null || len !== a1.length) {
6757        return false;
6758    }
6759    for (i = 0; i < len; i++) {
6760        if (a0[i] !== a1[i]) {
6761            return false;
6762        }
6763    }
6764    return true;
6765}
6766exports.isArraysEqual = isArraysEqual;
6767function firstDefined() {
6768    var args = [];
6769    for (var _i = 0; _i < arguments.length; _i++) {
6770        args[_i] = arguments[_i];
6771    }
6772    for (var i = 0; i < args.length; i++) {
6773        if (args[i] !== undefined) {
6774            return args[i];
6775        }
6776    }
6777}
6778exports.firstDefined = firstDefined;
6779function htmlEscape(s) {
6780    return (s + '').replace(/&/g, '&amp;')
6781        .replace(/</g, '&lt;')
6782        .replace(/>/g, '&gt;')
6783        .replace(/'/g, '&#039;')
6784        .replace(/"/g, '&quot;')
6785        .replace(/\n/g, '<br />');
6786}
6787exports.htmlEscape = htmlEscape;
6788function stripHtmlEntities(text) {
6789    return text.replace(/&.*?;/g, '');
6790}
6791exports.stripHtmlEntities = stripHtmlEntities;
6792// Given a hash of CSS properties, returns a string of CSS.
6793// Uses property names as-is (no camel-case conversion). Will not make statements for null/undefined values.
6794function cssToStr(cssProps) {
6795    var statements = [];
6796    $.each(cssProps, function (name, val) {
6797        if (val != null) {
6798            statements.push(name + ':' + val);
6799        }
6800    });
6801    return statements.join(';');
6802}
6803exports.cssToStr = cssToStr;
6804// Given an object hash of HTML attribute names to values,
6805// generates a string that can be injected between < > in HTML
6806function attrsToStr(attrs) {
6807    var parts = [];
6808    $.each(attrs, function (name, val) {
6809        if (val != null) {
6810            parts.push(name + '="' + htmlEscape(val) + '"');
6811        }
6812    });
6813    return parts.join(' ');
6814}
6815exports.attrsToStr = attrsToStr;
6816function capitaliseFirstLetter(str) {
6817    return str.charAt(0).toUpperCase() + str.slice(1);
6818}
6819exports.capitaliseFirstLetter = capitaliseFirstLetter;
6820function compareNumbers(a, b) {
6821    return a - b;
6822}
6823exports.compareNumbers = compareNumbers;
6824function isInt(n) {
6825    return n % 1 === 0;
6826}
6827exports.isInt = isInt;
6828// Returns a method bound to the given object context.
6829// Just like one of the jQuery.proxy signatures, but without the undesired behavior of treating the same method with
6830// different contexts as identical when binding/unbinding events.
6831function proxy(obj, methodName) {
6832    var method = obj[methodName];
6833    return function () {
6834        return method.apply(obj, arguments);
6835    };
6836}
6837exports.proxy = proxy;
6838// Returns a function, that, as long as it continues to be invoked, will not
6839// be triggered. The function will be called after it stops being called for
6840// N milliseconds. If `immediate` is passed, trigger the function on the
6841// leading edge, instead of the trailing.
6842// https://github.com/jashkenas/underscore/blob/1.6.0/underscore.js#L714
6843function debounce(func, wait, immediate) {
6844    if (immediate === void 0) { immediate = false; }
6845    var timeout;
6846    var args;
6847    var context;
6848    var timestamp;
6849    var result;
6850    var later = function () {
6851        var last = +new Date() - timestamp;
6852        if (last < wait) {
6853            timeout = setTimeout(later, wait - last);
6854        }
6855        else {
6856            timeout = null;
6857            if (!immediate) {
6858                result = func.apply(context, args);
6859                context = args = null;
6860            }
6861        }
6862    };
6863    return function () {
6864        context = this;
6865        args = arguments;
6866        timestamp = +new Date();
6867        var callNow = immediate && !timeout;
6868        if (!timeout) {
6869            timeout = setTimeout(later, wait);
6870        }
6871        if (callNow) {
6872            result = func.apply(context, args);
6873            context = args = null;
6874        }
6875        return result;
6876    };
6877}
6878exports.debounce = debounce;
6879
6880
6881/***/ }),
6882/* 5 */
6883/***/ (function(module, exports, __webpack_require__) {
6884
6885Object.defineProperty(exports, "__esModule", { value: true });
6886var moment = __webpack_require__(0);
6887var moment_ext_1 = __webpack_require__(10);
6888var UnzonedRange = /** @class */ (function () {
6889    function UnzonedRange(startInput, endInput) {
6890        // TODO: move these into footprint.
6891        // Especially, doesn't make sense for null startMs/endMs.
6892        this.isStart = true;
6893        this.isEnd = true;
6894        if (moment.isMoment(startInput)) {
6895            startInput = startInput.clone().stripZone();
6896        }
6897        if (moment.isMoment(endInput)) {
6898            endInput = endInput.clone().stripZone();
6899        }
6900        if (startInput) {
6901            this.startMs = startInput.valueOf();
6902        }
6903        if (endInput) {
6904            this.endMs = endInput.valueOf();
6905        }
6906    }
6907    /*
6908    SIDEEFFECT: will mutate eventRanges.
6909    Will return a new array result.
6910    Only works for non-open-ended ranges.
6911    */
6912    UnzonedRange.invertRanges = function (ranges, constraintRange) {
6913        var invertedRanges = [];
6914        var startMs = constraintRange.startMs; // the end of the previous range. the start of the new range
6915        var i;
6916        var dateRange;
6917        // ranges need to be in order. required for our date-walking algorithm
6918        ranges.sort(compareUnzonedRanges);
6919        for (i = 0; i < ranges.length; i++) {
6920            dateRange = ranges[i];
6921            // add the span of time before the event (if there is any)
6922            if (dateRange.startMs > startMs) {
6923                invertedRanges.push(new UnzonedRange(startMs, dateRange.startMs));
6924            }
6925            if (dateRange.endMs > startMs) {
6926                startMs = dateRange.endMs;
6927            }
6928        }
6929        // add the span of time after the last event (if there is any)
6930        if (startMs < constraintRange.endMs) {
6931            invertedRanges.push(new UnzonedRange(startMs, constraintRange.endMs));
6932        }
6933        return invertedRanges;
6934    };
6935    UnzonedRange.prototype.intersect = function (otherRange) {
6936        var startMs = this.startMs;
6937        var endMs = this.endMs;
6938        var newRange = null;
6939        if (otherRange.startMs != null) {
6940            if (startMs == null) {
6941                startMs = otherRange.startMs;
6942            }
6943            else {
6944                startMs = Math.max(startMs, otherRange.startMs);
6945            }
6946        }
6947        if (otherRange.endMs != null) {
6948            if (endMs == null) {
6949                endMs = otherRange.endMs;
6950            }
6951            else {
6952                endMs = Math.min(endMs, otherRange.endMs);
6953            }
6954        }
6955        if (startMs == null || endMs == null || startMs < endMs) {
6956            newRange = new UnzonedRange(startMs, endMs);
6957            newRange.isStart = this.isStart && startMs === this.startMs;
6958            newRange.isEnd = this.isEnd && endMs === this.endMs;
6959        }
6960        return newRange;
6961    };
6962    UnzonedRange.prototype.intersectsWith = function (otherRange) {
6963        return (this.endMs == null || otherRange.startMs == null || this.endMs > otherRange.startMs) &&
6964            (this.startMs == null || otherRange.endMs == null || this.startMs < otherRange.endMs);
6965    };
6966    UnzonedRange.prototype.containsRange = function (innerRange) {
6967        return (this.startMs == null || (innerRange.startMs != null && innerRange.startMs >= this.startMs)) &&
6968            (this.endMs == null || (innerRange.endMs != null && innerRange.endMs <= this.endMs));
6969    };
6970    // `date` can be a moment, a Date, or a millisecond time.
6971    UnzonedRange.prototype.containsDate = function (date) {
6972        var ms = date.valueOf();
6973        return (this.startMs == null || ms >= this.startMs) &&
6974            (this.endMs == null || ms < this.endMs);
6975    };
6976    // If the given date is not within the given range, move it inside.
6977    // (If it's past the end, make it one millisecond before the end).
6978    // `date` can be a moment, a Date, or a millisecond time.
6979    // Returns a MS-time.
6980    UnzonedRange.prototype.constrainDate = function (date) {
6981        var ms = date.valueOf();
6982        if (this.startMs != null && ms < this.startMs) {
6983            ms = this.startMs;
6984        }
6985        if (this.endMs != null && ms >= this.endMs) {
6986            ms = this.endMs - 1;
6987        }
6988        return ms;
6989    };
6990    UnzonedRange.prototype.equals = function (otherRange) {
6991        return this.startMs === otherRange.startMs && this.endMs === otherRange.endMs;
6992    };
6993    UnzonedRange.prototype.clone = function () {
6994        var range = new UnzonedRange(this.startMs, this.endMs);
6995        range.isStart = this.isStart;
6996        range.isEnd = this.isEnd;
6997        return range;
6998    };
6999    // Returns an ambig-zoned moment from startMs.
7000    // BEWARE: returned moment is not localized.
7001    // Formatting and start-of-week will be default.
7002    UnzonedRange.prototype.getStart = function () {
7003        if (this.startMs != null) {
7004            return moment_ext_1.default.utc(this.startMs).stripZone();
7005        }
7006        return null;
7007    };
7008    // Returns an ambig-zoned moment from startMs.
7009    // BEWARE: returned moment is not localized.
7010    // Formatting and start-of-week will be default.
7011    UnzonedRange.prototype.getEnd = function () {
7012        if (this.endMs != null) {
7013            return moment_ext_1.default.utc(this.endMs).stripZone();
7014        }
7015        return null;
7016    };
7017    UnzonedRange.prototype.as = function (unit) {
7018        return moment.utc(this.endMs).diff(moment.utc(this.startMs), unit, true);
7019    };
7020    return UnzonedRange;
7021}());
7022exports.default = UnzonedRange;
7023/*
7024Only works for non-open-ended ranges.
7025*/
7026function compareUnzonedRanges(range1, range2) {
7027    return range1.startMs - range2.startMs; // earlier ranges go first
7028}
7029
7030
7031/***/ }),
7032/* 6 */
7033/***/ (function(module, exports, __webpack_require__) {
7034
7035Object.defineProperty(exports, "__esModule", { value: true });
7036var tslib_1 = __webpack_require__(2);
7037var $ = __webpack_require__(3);
7038var ParsableModelMixin_1 = __webpack_require__(208);
7039var Class_1 = __webpack_require__(32);
7040var EventDefParser_1 = __webpack_require__(49);
7041var EventSource = /** @class */ (function (_super) {
7042    tslib_1.__extends(EventSource, _super);
7043    // can we do away with calendar? at least for the abstract?
7044    // useful for buildEventDef
7045    function EventSource(calendar) {
7046        var _this = _super.call(this) || this;
7047        _this.calendar = calendar;
7048        _this.className = [];
7049        _this.uid = String(EventSource.uuid++);
7050        return _this;
7051    }
7052    /*
7053    rawInput can be any data type!
7054    */
7055    EventSource.parse = function (rawInput, calendar) {
7056        var source = new this(calendar);
7057        if (typeof rawInput === 'object') {
7058            if (source.applyProps(rawInput)) {
7059                return source;
7060            }
7061        }
7062        return false;
7063    };
7064    EventSource.normalizeId = function (id) {
7065        if (id) {
7066            return String(id);
7067        }
7068        return null;
7069    };
7070    EventSource.prototype.fetch = function (start, end, timezone) {
7071        // subclasses must implement. must return a promise.
7072    };
7073    EventSource.prototype.removeEventDefsById = function (eventDefId) {
7074        // optional for subclasses to implement
7075    };
7076    EventSource.prototype.removeAllEventDefs = function () {
7077        // optional for subclasses to implement
7078    };
7079    /*
7080    For compairing/matching
7081    */
7082    EventSource.prototype.getPrimitive = function (otherSource) {
7083        // subclasses must implement
7084    };
7085    EventSource.prototype.parseEventDefs = function (rawEventDefs) {
7086        var i;
7087        var eventDef;
7088        var eventDefs = [];
7089        for (i = 0; i < rawEventDefs.length; i++) {
7090            eventDef = this.parseEventDef(rawEventDefs[i]);
7091            if (eventDef) {
7092                eventDefs.push(eventDef);
7093            }
7094        }
7095        return eventDefs;
7096    };
7097    EventSource.prototype.parseEventDef = function (rawInput) {
7098        var calendarTransform = this.calendar.opt('eventDataTransform');
7099        var sourceTransform = this.eventDataTransform;
7100        if (calendarTransform) {
7101            rawInput = calendarTransform(rawInput, this.calendar);
7102        }
7103        if (sourceTransform) {
7104            rawInput = sourceTransform(rawInput, this.calendar);
7105        }
7106        return EventDefParser_1.default.parse(rawInput, this);
7107    };
7108    EventSource.prototype.applyManualStandardProps = function (rawProps) {
7109        if (rawProps.id != null) {
7110            this.id = EventSource.normalizeId(rawProps.id);
7111        }
7112        // TODO: converge with EventDef
7113        if ($.isArray(rawProps.className)) {
7114            this.className = rawProps.className;
7115        }
7116        else if (typeof rawProps.className === 'string') {
7117            this.className = rawProps.className.split(/\s+/);
7118        }
7119        return true;
7120    };
7121    EventSource.uuid = 0;
7122    EventSource.defineStandardProps = ParsableModelMixin_1.default.defineStandardProps;
7123    EventSource.copyVerbatimStandardProps = ParsableModelMixin_1.default.copyVerbatimStandardProps;
7124    return EventSource;
7125}(Class_1.default));
7126exports.default = EventSource;
7127ParsableModelMixin_1.default.mixInto(EventSource);
7128// Parsing
7129// ---------------------------------------------------------------------------------------------------------------------
7130EventSource.defineStandardProps({
7131    // manually process...
7132    id: false,
7133    className: false,
7134    // automatically transfer...
7135    color: true,
7136    backgroundColor: true,
7137    borderColor: true,
7138    textColor: true,
7139    editable: true,
7140    startEditable: true,
7141    durationEditable: true,
7142    rendering: true,
7143    overlap: true,
7144    constraint: true,
7145    allDayDefault: true,
7146    eventDataTransform: true
7147});
7148
7149
7150/***/ }),
7151/* 7 */
7152/***/ (function(module, exports, __webpack_require__) {
7153
7154/*
7155Utility methods for easily listening to events on another object,
7156and more importantly, easily unlistening from them.
7157
7158USAGE:
7159  import { default as ListenerMixin, ListenerInterface } from './ListenerMixin'
7160in class:
7161  listenTo: ListenerInterface['listenTo']
7162  stopListeningTo: ListenerInterface['stopListeningTo']
7163after class:
7164  ListenerMixin.mixInto(TheClass)
7165*/
7166Object.defineProperty(exports, "__esModule", { value: true });
7167var tslib_1 = __webpack_require__(2);
7168var $ = __webpack_require__(3);
7169var Mixin_1 = __webpack_require__(14);
7170var guid = 0;
7171var ListenerMixin = /** @class */ (function (_super) {
7172    tslib_1.__extends(ListenerMixin, _super);
7173    function ListenerMixin() {
7174        return _super !== null && _super.apply(this, arguments) || this;
7175    }
7176    /*
7177    Given an `other` object that has on/off methods, bind the given `callback` to an event by the given name.
7178    The `callback` will be called with the `this` context of the object that .listenTo is being called on.
7179    Can be called:
7180      .listenTo(other, eventName, callback)
7181    OR
7182      .listenTo(other, {
7183        eventName1: callback1,
7184        eventName2: callback2
7185      })
7186    */
7187    ListenerMixin.prototype.listenTo = function (other, arg, callback) {
7188        if (typeof arg === 'object') {
7189            for (var eventName in arg) {
7190                if (arg.hasOwnProperty(eventName)) {
7191                    this.listenTo(other, eventName, arg[eventName]);
7192                }
7193            }
7194        }
7195        else if (typeof arg === 'string') {
7196            other.on(arg + '.' + this.getListenerNamespace(), // use event namespacing to identify this object
7197            $.proxy(callback, this) // always use `this` context
7198            // the usually-undesired jQuery guid behavior doesn't matter,
7199            // because we always unbind via namespace
7200            );
7201        }
7202    };
7203    /*
7204    Causes the current object to stop listening to events on the `other` object.
7205    `eventName` is optional. If omitted, will stop listening to ALL events on `other`.
7206    */
7207    ListenerMixin.prototype.stopListeningTo = function (other, eventName) {
7208        other.off((eventName || '') + '.' + this.getListenerNamespace());
7209    };
7210    /*
7211    Returns a string, unique to this object, to be used for event namespacing
7212    */
7213    ListenerMixin.prototype.getListenerNamespace = function () {
7214        if (this.listenerId == null) {
7215            this.listenerId = guid++;
7216        }
7217        return '_listener' + this.listenerId;
7218    };
7219    return ListenerMixin;
7220}(Mixin_1.default));
7221exports.default = ListenerMixin;
7222
7223
7224/***/ }),
7225/* 8 */,
7226/* 9 */,
7227/* 10 */
7228/***/ (function(module, exports, __webpack_require__) {
7229
7230Object.defineProperty(exports, "__esModule", { value: true });
7231var moment = __webpack_require__(0);
7232var $ = __webpack_require__(3);
7233var util_1 = __webpack_require__(4);
7234var ambigDateOfMonthRegex = /^\s*\d{4}-\d\d$/;
7235var ambigTimeOrZoneRegex = /^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?)?$/;
7236var newMomentProto = moment.fn; // where we will attach our new methods
7237exports.newMomentProto = newMomentProto;
7238var oldMomentProto = $.extend({}, newMomentProto); // copy of original moment methods
7239exports.oldMomentProto = oldMomentProto;
7240// tell momentjs to transfer these properties upon clone
7241var momentProperties = moment.momentProperties;
7242momentProperties.push('_fullCalendar');
7243momentProperties.push('_ambigTime');
7244momentProperties.push('_ambigZone');
7245/*
7246Call this if you want Moment's original format method to be used
7247*/
7248function oldMomentFormat(mom, formatStr) {
7249    return oldMomentProto.format.call(mom, formatStr); // oldMomentProto defined in moment-ext.js
7250}
7251exports.oldMomentFormat = oldMomentFormat;
7252// Creating
7253// -------------------------------------------------------------------------------------------------
7254// Creates a new moment, similar to the vanilla moment(...) constructor, but with
7255// extra features (ambiguous time, enhanced formatting). When given an existing moment,
7256// it will function as a clone (and retain the zone of the moment). Anything else will
7257// result in a moment in the local zone.
7258var momentExt = function () {
7259    return makeMoment(arguments);
7260};
7261exports.default = momentExt;
7262// Sames as momentExt, but forces the resulting moment to be in the UTC timezone.
7263momentExt.utc = function () {
7264    var mom = makeMoment(arguments, true);
7265    // Force it into UTC because makeMoment doesn't guarantee it
7266    // (if given a pre-existing moment for example)
7267    if (mom.hasTime()) {
7268        mom.utc();
7269    }
7270    return mom;
7271};
7272// Same as momentExt, but when given an ISO8601 string, the timezone offset is preserved.
7273// ISO8601 strings with no timezone offset will become ambiguously zoned.
7274momentExt.parseZone = function () {
7275    return makeMoment(arguments, true, true);
7276};
7277// Builds an enhanced moment from args. When given an existing moment, it clones. When given a
7278// native Date, or called with no arguments (the current time), the resulting moment will be local.
7279// Anything else needs to be "parsed" (a string or an array), and will be affected by:
7280//    parseAsUTC - if there is no zone information, should we parse the input in UTC?
7281//    parseZone - if there is zone information, should we force the zone of the moment?
7282function makeMoment(args, parseAsUTC, parseZone) {
7283    if (parseAsUTC === void 0) { parseAsUTC = false; }
7284    if (parseZone === void 0) { parseZone = false; }
7285    var input = args[0];
7286    var isSingleString = args.length === 1 && typeof input === 'string';
7287    var isAmbigTime;
7288    var isAmbigZone;
7289    var ambigMatch;
7290    var mom;
7291    if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {
7292        mom = moment.apply(null, args);
7293    }
7294    else {
7295        isAmbigTime = false;
7296        isAmbigZone = false;
7297        if (isSingleString) {
7298            if (ambigDateOfMonthRegex.test(input)) {
7299                // accept strings like '2014-05', but convert to the first of the month
7300                input += '-01';
7301                args = [input]; // for when we pass it on to moment's constructor
7302                isAmbigTime = true;
7303                isAmbigZone = true;
7304            }
7305            else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {
7306                isAmbigTime = !ambigMatch[5]; // no time part?
7307                isAmbigZone = true;
7308            }
7309        }
7310        else if ($.isArray(input)) {
7311            // arrays have no timezone information, so assume ambiguous zone
7312            isAmbigZone = true;
7313        }
7314        // otherwise, probably a string with a format
7315        if (parseAsUTC || isAmbigTime) {
7316            mom = moment.utc.apply(moment, args);
7317        }
7318        else {
7319            mom = moment.apply(null, args);
7320        }
7321        if (isAmbigTime) {
7322            mom._ambigTime = true;
7323            mom._ambigZone = true; // ambiguous time always means ambiguous zone
7324        }
7325        else if (parseZone) {
7326            if (isAmbigZone) {
7327                mom._ambigZone = true;
7328            }
7329            else if (isSingleString) {
7330                mom.utcOffset(input); // if not a valid zone, will assign UTC
7331            }
7332        }
7333    }
7334    mom._fullCalendar = true; // flag for extended functionality
7335    return mom;
7336}
7337// Week Number
7338// -------------------------------------------------------------------------------------------------
7339// Returns the week number, considering the locale's custom week number calcuation
7340// `weeks` is an alias for `week`
7341newMomentProto.week = newMomentProto.weeks = function (input) {
7342    var weekCalc = this._locale._fullCalendar_weekCalc;
7343    if (input == null && typeof weekCalc === 'function') {
7344        return weekCalc(this);
7345    }
7346    else if (weekCalc === 'ISO') {
7347        return oldMomentProto.isoWeek.apply(this, arguments); // ISO getter/setter
7348    }
7349    return oldMomentProto.week.apply(this, arguments); // local getter/setter
7350};
7351// Time-of-day
7352// -------------------------------------------------------------------------------------------------
7353// GETTER
7354// Returns a Duration with the hours/minutes/seconds/ms values of the moment.
7355// If the moment has an ambiguous time, a duration of 00:00 will be returned.
7356//
7357// SETTER
7358// You can supply a Duration, a Moment, or a Duration-like argument.
7359// When setting the time, and the moment has an ambiguous time, it then becomes unambiguous.
7360newMomentProto.time = function (time) {
7361    // Fallback to the original method (if there is one) if this moment wasn't created via FullCalendar.
7362    // `time` is a generic enough method name where this precaution is necessary to avoid collisions w/ other plugins.
7363    if (!this._fullCalendar) {
7364        return oldMomentProto.time.apply(this, arguments);
7365    }
7366    if (time == null) {
7367        return moment.duration({
7368            hours: this.hours(),
7369            minutes: this.minutes(),
7370            seconds: this.seconds(),
7371            milliseconds: this.milliseconds()
7372        });
7373    }
7374    else {
7375        this._ambigTime = false; // mark that the moment now has a time
7376        if (!moment.isDuration(time) && !moment.isMoment(time)) {
7377            time = moment.duration(time);
7378        }
7379        // The day value should cause overflow (so 24 hours becomes 00:00:00 of next day).
7380        // Only for Duration times, not Moment times.
7381        var dayHours = 0;
7382        if (moment.isDuration(time)) {
7383            dayHours = Math.floor(time.asDays()) * 24;
7384        }
7385        // We need to set the individual fields.
7386        // Can't use startOf('day') then add duration. In case of DST at start of day.
7387        return this.hours(dayHours + time.hours())
7388            .minutes(time.minutes())
7389            .seconds(time.seconds())
7390            .milliseconds(time.milliseconds());
7391    }
7392};
7393// Converts the moment to UTC, stripping out its time-of-day and timezone offset,
7394// but preserving its YMD. A moment with a stripped time will display no time
7395// nor timezone offset when .format() is called.
7396newMomentProto.stripTime = function () {
7397    if (!this._ambigTime) {
7398        this.utc(true); // keepLocalTime=true (for keeping *date* value)
7399        // set time to zero
7400        this.set({
7401            hours: 0,
7402            minutes: 0,
7403            seconds: 0,
7404            ms: 0
7405        });
7406        // Mark the time as ambiguous. This needs to happen after the .utc() call, which might call .utcOffset(),
7407        // which clears all ambig flags.
7408        this._ambigTime = true;
7409        this._ambigZone = true; // if ambiguous time, also ambiguous timezone offset
7410    }
7411    return this; // for chaining
7412};
7413// Returns if the moment has a non-ambiguous time (boolean)
7414newMomentProto.hasTime = function () {
7415    return !this._ambigTime;
7416};
7417// Timezone
7418// -------------------------------------------------------------------------------------------------
7419// Converts the moment to UTC, stripping out its timezone offset, but preserving its
7420// YMD and time-of-day. A moment with a stripped timezone offset will display no
7421// timezone offset when .format() is called.
7422newMomentProto.stripZone = function () {
7423    var wasAmbigTime;
7424    if (!this._ambigZone) {
7425        wasAmbigTime = this._ambigTime;
7426        this.utc(true); // keepLocalTime=true (for keeping date and time values)
7427        // the above call to .utc()/.utcOffset() unfortunately might clear the ambig flags, so restore
7428        this._ambigTime = wasAmbigTime || false;
7429        // Mark the zone as ambiguous. This needs to happen after the .utc() call, which might call .utcOffset(),
7430        // which clears the ambig flags.
7431        this._ambigZone = true;
7432    }
7433    return this; // for chaining
7434};
7435// Returns of the moment has a non-ambiguous timezone offset (boolean)
7436newMomentProto.hasZone = function () {
7437    return !this._ambigZone;
7438};
7439// implicitly marks a zone
7440newMomentProto.local = function (keepLocalTime) {
7441    // for when converting from ambiguously-zoned to local,
7442    // keep the time values when converting from UTC -> local
7443    oldMomentProto.local.call(this, this._ambigZone || keepLocalTime);
7444    // ensure non-ambiguous
7445    // this probably already happened via local() -> utcOffset(), but don't rely on Moment's internals
7446    this._ambigTime = false;
7447    this._ambigZone = false;
7448    return this; // for chaining
7449};
7450// implicitly marks a zone
7451newMomentProto.utc = function (keepLocalTime) {
7452    oldMomentProto.utc.call(this, keepLocalTime);
7453    // ensure non-ambiguous
7454    // this probably already happened via utc() -> utcOffset(), but don't rely on Moment's internals
7455    this._ambigTime = false;
7456    this._ambigZone = false;
7457    return this;
7458};
7459// implicitly marks a zone (will probably get called upon .utc() and .local())
7460newMomentProto.utcOffset = function (tzo) {
7461    if (tzo != null) {
7462        // these assignments needs to happen before the original zone method is called.
7463        // I forget why, something to do with a browser crash.
7464        this._ambigTime = false;
7465        this._ambigZone = false;
7466    }
7467    return oldMomentProto.utcOffset.apply(this, arguments);
7468};
7469
7470
7471/***/ }),
7472/* 11 */
7473/***/ (function(module, exports, __webpack_require__) {
7474
7475/*
7476USAGE:
7477  import { default as EmitterMixin, EmitterInterface } from './EmitterMixin'
7478in class:
7479  on: EmitterInterface['on']
7480  one: EmitterInterface['one']
7481  off: EmitterInterface['off']
7482  trigger: EmitterInterface['trigger']
7483  triggerWith: EmitterInterface['triggerWith']
7484  hasHandlers: EmitterInterface['hasHandlers']
7485after class:
7486  EmitterMixin.mixInto(TheClass)
7487*/
7488Object.defineProperty(exports, "__esModule", { value: true });
7489var tslib_1 = __webpack_require__(2);
7490var $ = __webpack_require__(3);
7491var Mixin_1 = __webpack_require__(14);
7492var EmitterMixin = /** @class */ (function (_super) {
7493    tslib_1.__extends(EmitterMixin, _super);
7494    function EmitterMixin() {
7495        return _super !== null && _super.apply(this, arguments) || this;
7496    }
7497    // jQuery-ification via $(this) allows a non-DOM object to have
7498    // the same event handling capabilities (including namespaces).
7499    EmitterMixin.prototype.on = function (types, handler) {
7500        $(this).on(types, this._prepareIntercept(handler));
7501        return this; // for chaining
7502    };
7503    EmitterMixin.prototype.one = function (types, handler) {
7504        $(this).one(types, this._prepareIntercept(handler));
7505        return this; // for chaining
7506    };
7507    EmitterMixin.prototype._prepareIntercept = function (handler) {
7508        // handlers are always called with an "event" object as their first param.
7509        // sneak the `this` context and arguments into the extra parameter object
7510        // and forward them on to the original handler.
7511        var intercept = function (ev, extra) {
7512            return handler.apply(extra.context || this, extra.args || []);
7513        };
7514        // mimick jQuery's internal "proxy" system (risky, I know)
7515        // causing all functions with the same .guid to appear to be the same.
7516        // https://github.com/jquery/jquery/blob/2.2.4/src/core.js#L448
7517        // this is needed for calling .off with the original non-intercept handler.
7518        if (!handler.guid) {
7519            handler.guid = $.guid++;
7520        }
7521        intercept.guid = handler.guid;
7522        return intercept;
7523    };
7524    EmitterMixin.prototype.off = function (types, handler) {
7525        $(this).off(types, handler);
7526        return this; // for chaining
7527    };
7528    EmitterMixin.prototype.trigger = function (types) {
7529        var args = [];
7530        for (var _i = 1; _i < arguments.length; _i++) {
7531            args[_i - 1] = arguments[_i];
7532        }
7533        // pass in "extra" info to the intercept
7534        $(this).triggerHandler(types, { args: args });
7535        return this; // for chaining
7536    };
7537    EmitterMixin.prototype.triggerWith = function (types, context, args
7537) {
7538        // `triggerHandler` is less reliant on the DOM compared to `trigger`.
7539        // pass in "extra" info to the intercept.
7540        $(this).triggerHandler(types, { context: context, args: args });
7541        return this; // for chaining
7542    };
7543    EmitterMixin.prototype.hasHandlers = function (type) {
7544        var hash = $._data(this, 'events'); // http://blog.jquery.com/2012/08/09/jquery-1-8-released/
7545        return hash && hash[type] && hash[type].length > 0;
7546    };
7547    return EmitterMixin;
7548}(Mixin_1.default));
7549exports.default = EmitterMixin;
7550
7551
7552/***/ }),
7553/* 12 */
7554/***/ (function(module, exports) {
7555
7556Object.defineProperty(exports, "__esModule", { value: true });
7557/*
7558Meant to be immutable
7559*/
7560var ComponentFootprint = /** @class */ (function () {
7561    function ComponentFootprint(unzonedRange, isAllDay) {
7562        this.isAllDay = false; // component can choose to ignore this
7563        this.unzonedRange = unzonedRange;
7564        this.isAllDay = isAllDay;
7565    }
7566    /*
7567    Only works for non-open-ended ranges.
7568    */
7569    ComponentFootprint.prototype.toLegacy = function (calendar) {
7570        return {
7571            start: calendar.msToMoment(this.unzonedRange.startMs, this.isAllDay),
7572            end: calendar.msToMoment(this.unzonedRange.endMs, this.isAllDay)
7573        };
7574    };
7575    return ComponentFootprint;
7576}());
7577exports.default = ComponentFootprint;
7578
7579
7580/***/ }),
7581/* 13 */
7582/***/ (function(module, exports, __webpack_require__) {
7583
7584Object.defineProperty(exports, "__esModule", { value: true });
7585var tslib_1 = __webpack_require__(2);
7586var EventDef_1 = __webpack_require__(33);
7587var EventInstance_1 = __webpack_require__(209);
7588var EventDateProfile_1 = __webpack_require__(18);
7589var SingleEventDef = /** @class */ (function (_super) {
7590    tslib_1.__extends(SingleEventDef, _super);
7591    function SingleEventDef() {
7592        return _super !== null && _super.apply(this, arguments) || this;
7593    }
7594    /*
7595    Will receive start/end params, but will be ignored.
7596    */
7597    SingleEventDef.prototype.buildInstances = function () {
7598        return [this.buildInstance()];
7599    };
7600    SingleEventDef.prototype.buildInstance = function () {
7601        return new EventInstance_1.default(this, // definition
7602        this.dateProfile);
7603    };
7604    SingleEventDef.prototype.isAllDay = function () {
7605        return this.dateProfile.isAllDay();
7606    };
7607    SingleEventDef.prototype.clone = function () {
7608        var def = _super.prototype.clone.call(this);
7609        def.dateProfile = this.dateProfile;
7610        return def;
7611    };
7612    SingleEventDef.prototype.rezone = function () {
7613        var calendar = this.source.calendar;
7614        var dateProfile = this.dateProfile;
7615        this.dateProfile = new EventDateProfile_1.default(calendar.moment(dateProfile.start), dateProfile.end ? calendar.moment(dateProfile.end) : null, calendar);
7616    };
7617    /*
7618    NOTE: if super-method fails, should still attempt to apply
7619    */
7620    SingleEventDef.prototype.applyManualStandardProps = function (rawProps) {
7621        var superSuccess = _super.prototype.applyManualStandardProps.call(this, rawProps);
7622        var dateProfile = EventDateProfile_1.default.parse(rawProps, this.source); // returns null on failure
7623        if (dateProfile) {
7624            this.dateProfile = dateProfile;
7625            // make sure `date` shows up in the legacy event objects as-is
7626            if (rawProps.date != null) {
7627                this.miscProps.date = rawProps.date;
7628            }
7629            return superSuccess;
7630        }
7631        else {
7632            return false;
7633        }
7634    };
7635    return SingleEventDef;
7636}(EventDef_1.default));
7637exports.default = SingleEventDef;
7638// Parsing
7639// ---------------------------------------------------------------------------------------------------------------------
7640SingleEventDef.defineStandardProps({
7641    start: false,
7642    date: false,
7643    end: false,
7644    allDay: false
7645});
7646
7647
7648/***/ }),
7649/* 14 */
7650/***/ (function(module, exports) {
7651
7652Object.defineProperty(exports, "__esModule", { value: true });
7653var Mixin = /** @class */ (function () {
7654    function Mixin() {
7655    }
7656    Mixin.mixInto = function (destClass) {
7657        var _this = this;
7658        Object.getOwnPropertyNames(this.prototype).forEach(function (name) {
7659            if (!destClass.prototype[name]) {
7660                destClass.prototype[name] = _this.prototype[name];
7661            }
7662        });
7663    };
7664    /*
7665    will override existing methods
7666    TODO: remove! not used anymore
7667    */
7668    Mixin.mixOver = function (destClass) {
7669        var _this = this;
7670        Object.getOwnPropertyNames(this.prototype).forEach(function (name) {
7671            destClass.prototype[name] = _this.prototype[name];
7672        });
7673    };
7674    return Mixin;
7675}());
7676exports.default = Mixin;
7677
7678
7679/***/ }),
7680/* 15 */
7681/***/ (function(module, exports, __webpack_require__) {
7682
7683Object.defineProperty(exports, "__esModule", { value: true });
7684var $ = __webpack_require__(3);
7685var exportHooks = __webpack_require__(17);
7686var EmitterMixin_1 = __webpack_require__(11);
7687var ListenerMixin_1 = __webpack_require__(7);
7688exportHooks.touchMouseIgnoreWait = 500;
7689var globalEmitter = null;
7690var neededCount = 0;
7691/*
7692Listens to document and window-level user-interaction events, like touch events and mouse events,
7693and fires these events as-is to whoever is observing a GlobalEmitter.
7694Best when used as a singleton via GlobalEmitter.get()
7695
7696Normalizes mouse/touch events. For examples:
7697- ignores the the simulated mouse events that happen after a quick tap: mousemove+mousedown+mouseup+click
7698- compensates for various buggy scenarios where a touchend does not fire
7699*/
7700var GlobalEmitter = /** @class */ (function () {
7701    function GlobalEmitter() {
7702        this.isTouching = false;
7703        this.mouseIgnoreDepth = 0;
7704    }
7705    // gets the singleton
7706    GlobalEmitter.get = function () {
7707        if (!globalEmitter) {
7708            globalEmitter = new GlobalEmitter();
7709            globalEmitter.bind();
7710        }
7711        return globalEmitter;
7712    };
7713    // called when an object knows it will need a GlobalEmitter in the near future.
7714    GlobalEmitter.needed = function () {
7715        GlobalEmitter.get(); // ensures globalEmitter
7716        neededCount++;
7717    };
7718    // called when the object that originally called needed() doesn't need a GlobalEmitter anymore.
7719    GlobalEmitter.unneeded = function () {
7720        neededCount--;
7721        if (!neededCount) {
7722            globalEmitter.unbind();
7723            globalEmitter = null;
7724        }
7725    };
7726    GlobalEmitter.prototype.bind = function () {
7727        var _this = this;
7728        this.listenTo($(document), {
7729            touchstart: this.handleTouchStart,
7730            touchcancel: this.handleTouchCancel,
7731            touchend: this.handleTouchEnd,
7732            mousedown: this.handleMouseDown,
7733            mousemove: this.handleMouseMove,
7734            mouseup: this.handleMouseUp,
7735            click: this.handleClick,
7736            selectstart: this.handleSelectStart,
7737            contextmenu: this.handleContextMenu
7738        });
7739        // because we need to call preventDefault
7740        // because https://www.chromestatus.com/features/5093566007214080
7741        // TODO: investigate performance because this is a global handler
7742        window.addEventListener('touchmove', this.handleTouchMoveProxy = function (ev) {
7743            _this.handleTouchMove($.Event(ev));
7744        }, { passive: false } // allows preventDefault()
7745        );
7746        // attach a handler to get called when ANY scroll action happens on the page.
7747        // this was impossible to do with normal on/off because 'scroll' doesn't bubble.
7748        // http://stackoverflow.com/a/32954565/96342
7749        window.addEventListener('scroll', this.handleScrollProxy = function (ev) {
7750            _this.handleScroll($.Event(ev));
7751        }, true // useCapture
7752        );
7753    };
7754    GlobalEmitter.prototype.unbind = function () {
7755        this.stopListeningTo($(document));
7756        window.removeEventListener('touchmove', this.handleTouchMoveProxy);
7757        window.removeEventListener('scroll', this.handleScrollProxy, true // useCapture
7758        );
7759    };
7760    // Touch Handlers
7761    // -----------------------------------------------------------------------------------------------------------------
7762    GlobalEmitter.prototype.handleTouchStart = function (ev) {
7763        // if a previous touch interaction never ended with a touchend, then implicitly end it,
7764        // but since a new touch interaction is about to begin, don't start the mouse ignore period.
7765        this.stopTouch(ev, true); // skipMouseIgnore=true
7766        this.isTouching = true;
7767        this.trigger('touchstart', ev);
7768    };
7769    GlobalEmitter.prototype.handleTouchMove = function (ev) {
7770        if (this.isTouching) {
7771            this.trigger('touchmove', ev);
7772        }
7773    };
7774    GlobalEmitter.prototype.handleTouchCancel = function (ev) {
7775        if (this.isTouching) {
7776            this.trigger('touchcancel', ev);
7777            // Have touchcancel fire an artificial touchend. That way, handlers won't need to listen to both.
7778            // If touchend fires later, it won't have any effect b/c isTouching will be false.
7779            this.stopTouch(ev);
7780        }
7781    };
7782    GlobalEmitter.prototype.handleTouchEnd = function (ev) {
7783        this.stopTouch(ev);
7784    };
7785    // Mouse Handlers
7786    // -----------------------------------------------------------------------------------------------------------------
7787    GlobalEmitter.prototype.handleMouseDown = function (ev) {
7788        if (!this.shouldIgnoreMouse()) {
7789            this.trigger('mousedown', ev);
7790        }
7791    };
7792    GlobalEmitter.prototype.handleMouseMove = function (ev) {
7793        if (!this.shouldIgnoreMouse()) {
7794            this.trigger('mousemove', ev);
7795        }
7796    };
7797    GlobalEmitter.prototype.handleMouseUp = function (ev) {
7798        if (!this.shouldIgnoreMouse()) {
7799            this.trigger('mouseup', ev);
7800        }
7801    };
7802    GlobalEmitter.prototype.handleClick = function (ev) {
7803        if (!this.shouldIgnoreMouse()) {
7804            this.trigger('click', ev);
7805        }
7806    };
7807    // Misc Handlers
7808    // -----------------------------------------------------------------------------------------------------------------
7809    GlobalEmitter.prototype.handleSelectStart = function (ev) {
7810        this.trigger('selectstart', ev);
7811    };
7812    GlobalEmitter.prototype.handleContextMenu = function (ev) {
7813        this.trigger('contextmenu', ev);
7814    };
7815    GlobalEmitter.prototype.handleScroll = function (ev) {
7816        this.trigger('scroll', ev);
7817    };
7818    // Utils
7819    // -----------------------------------------------------------------------------------------------------------------
7820    GlobalEmitter.prototype.stopTouch = function (ev, skipMouseIgnore) {
7821        if (skipMouseIgnore === void 0) { skipMouseIgnore = false; }
7822        if (this.isTouching) {
7823            this.isTouching = false;
7824            this.trigger('touchend', ev);
7825            if (!skipMouseIgnore) {
7826                this.startTouchMouseIgnore();
7827            }
7828        }
7829    };
7830    GlobalEmitter.prototype.startTouchMouseIgnore = function () {
7831        var _this = this;
7832        var wait = exportHooks.touchMouseIgnoreWait;
7833        if (wait) {
7834            this.mouseIgnoreDepth++;
7835            setTimeout(function () {
7836                _this.mouseIgnoreDepth--;
7837            }, wait);
7838        }
7839    };
7840    GlobalEmitter.prototype.shouldIgnoreMouse = function () {
7841        return this.isTouching || Boolean(this.mouseIgnoreDepth);
7842    };
7843    return GlobalEmitter;
7844}());
7845exports.default = GlobalEmitter;
7846ListenerMixin_1.default.mixInto(GlobalEmitter);
7847EmitterMixin_1.default.mixInto(GlobalEmitter);
7848
7849
7850/***/ }),
7851/* 16 */
7852/***/ (function(module, exports) {
7853
7854Object.defineProperty(exports, "__esModule", { value: true });
7855var Interaction = /** @class */ (function () {
7856    function Interaction(component) {
7857        this.view = component._getView();
7858        this.component = component;
7859    }
7860    Interaction.prototype.opt = function (name) {
7861        return this.view.opt(name);
7862    };
7863    Interaction.prototype.end = function () {
7864        // subclasses can implement
7865    };
7866    return Interaction;
7867}());
7868exports.default = Interaction;
7869
7870
7871/***/ }),
7872/* 17 */
7873/***/ (function(module, exports, __webpack_require__) {
7874
7875Object.defineProperty(exports, "__esModule", { value: true });
7876exports.version = '3.8.1';
7877// When introducing internal API incompatibilities (where fullcalendar plugins would break),
7878// the minor version of the calendar should be upped (ex: 2.7.2 -> 2.8.0)
7879// and the below integer should be incremented.
7880exports.internalApiVersion = 12;
7881var util_1 = __webpack_require__(4);
7882exports.applyAll = util_1.applyAll;
7883exports.debounce = util_1.debounce;
7884exports.isInt = util_1.isInt;
7885exports.htmlEscape = util_1.htmlEscape;
7886exports.cssToStr = util_1.cssToStr;
7887exports.proxy = util_1.proxy;
7888exports.capitaliseFirstLetter = util_1.capitaliseFirstLetter;
7889exports.getOuterRect = util_1.getOuterRect;
7890exports.getClientRect = util_1.getClientRect;
7891exports.getContentRect = util_1.getContentRect;
7892exports.getScrollbarWidths = util_1.getScrollbarWidths;
7893exports.preventDefault = util_1.preventDefault;
7894exports.parseFieldSpecs = util_1.parseFieldSpecs;
7895exports.compareByFieldSpecs = util_1.compareByFieldSpecs;
7896exports.compareByFieldSpec = util_1.compareByFieldSpec;
7897exports.flexibleCompare = util_1.flexibleCompare;
7898exports.computeGreatestUnit = util_1.computeGreatestUnit;
7899exports.divideRangeByDuration = util_1.divideRangeByDuration;
7900exports.divideDurationByDuration = util_1.divideDurationByDuration;
7901exports.multiplyDuration = util_1.multiplyDuration;
7902exports.durationHasTime = util_1.durationHasTime;
7903exports.log = util_1.log;
7904exports.warn = util_1.warn;
7905exports.removeExact = util_1.removeExact;
7906exports.intersectRects = util_1.intersectRects;
7907var date_formatting_1 = __webpack_require__(47);
7908exports.formatDate = date_formatting_1.formatDate;
7909exports.formatRange = date_formatting_1.formatRange;
7910exports.queryMostGranularFormatUnit = date_formatting_1.queryMostGranularFormatUnit;
7911var locale_1 = __webpack_require__(30);
7912exports.datepickerLocale = locale_1.datepickerLocale;
7913exports.locale = locale_1.locale;
7914var moment_ext_1 = __webpack_require__(10);
7915exports.moment = moment_ext_1.default;
7916var EmitterMixin_1 = __webpack_require__(11);
7917exports.EmitterMixin = EmitterMixin_1.default;
7918var ListenerMixin_1 = __webpack_require__(7);
7919exports.ListenerMixin = ListenerMixin_1.default;
7920var Model_1 = __webpack_require__(48);
7921exports.Model = Model_1.default;
7922var Constraints_1 = __webpack_require__(207);
7923exports.Constraints = Constraints_1.default;
7924var UnzonedRange_1 = __webpack_require__(5);
7925exports.UnzonedRange = UnzonedRange_1.default;
7926var ComponentFootprint_1 = __webpack_require__(12);
7927exports.ComponentFootprint = ComponentFootprint_1.default;
7928var BusinessHourGenerator_1 = __webpack_require__(212);
7929exports.BusinessHourGenerator = BusinessHourGenerator_1.default;
7930var EventDef_1 = __webpack_require__(33);
7931exports.EventDef = EventDef_1.default;
7932var EventDefMutation_1 = __webpack_require__(36);
7933exports.EventDefMutation = EventDefMutation_1.default;
7934var EventSourceParser_1 = __webpack_require__(37);
7935exports.EventSourceParser = EventSourceParser_1.default;
7936var EventSource_1 = __webpack_require__(6);
7937exports.EventSource = EventSource_1.default;
7938var ThemeRegistry_1 = __webpack_require__(51);
7939exports.defineThemeSystem = ThemeRegistry_1.defineThemeSystem;
7940var EventInstanceGroup_1 = __webpack_require__(19);
7941exports.EventInstanceGroup = EventInstanceGroup_1.default;
7942var ArrayEventSource_1 = __webpack_require__(52);
7943exports.ArrayEventSource = ArrayEventSource_1.default;
7944var FuncEventSource_1 = __webpack_require__(215);
7945exports.FuncEventSource = FuncEventSource_1.default;
7946var JsonFeedEventSource_1 = __webpack_require__(216);
7947exports.JsonFeedEventSource = JsonFeedEventSource_1.default;
7948var EventFootprint_1 = __webpack_require__(35);
7949exports.EventFootprint = EventFootprint_1.default;
7950var Class_1 = __webpack_require__(32);
7951exports.Class = Class_1.default;
7952var Mixin_1 = __webpack_require__(14);
7953exports.Mixin = Mixin_1.default;
7954var CoordCache_1 = __webpack_require__(53);
7955exports.CoordCache = CoordCache_1.default;
7956var DragListener_1 = __webpack_require__(54);
7957exports.DragListener = DragListener_1.default;
7958var Promise_1 = __webpack_require__(20);
7959exports.Promise = Promise_1.default;
7960var TaskQueue_1 = __webpack_require__(217);
7961exports.TaskQueue = TaskQueue_1.default;
7962var RenderQueue_1 = __webpack_require__(218);
7963exports.RenderQueue = RenderQueue_1.default;
7964var Scroller_1 = __webpack_require__(39);
7965exports.Scroller = Scroller_1.default;
7966var Theme_1 = __webpack_require__(38);
7967exports.Theme = Theme_1.default;
7968var DateComponent_1 = __webpack_require__(219);
7969exports.DateComponent = DateComponent_1.default;
7970var InteractiveDateComponent_1 = __webpack_require__(40);
7971exports.InteractiveDateComponent = InteractiveDateComponent_1.default;
7972var Calendar_1 = __webpack_require__(220);
7973exports.Calendar = Calendar_1.default;
7974var View_1 = __webpack_require__(41);
7975exports.View = View_1.default;
7976var ViewRegistry_1 = __webpack_require__(21);
7977exports.defineView = ViewRegistry_1.defineView;
7978exports.getViewConfig = ViewRegistry_1.getViewConfig;
7979var DayTableMixin_1 = __webpack_require__(55);
7980exports.DayTableMixin = DayTableMixin_1.default;
7981var BusinessHourRenderer_1 = __webpack_require__(56);
7982exports.BusinessHourRenderer = BusinessHourRenderer_1.default;
7983var EventRenderer_1 = __webpack_require__(42);
7984exports.EventRenderer = EventRenderer_1.default;
7985var FillRenderer_1 = __webpack_require__(57);
7986exports.FillRenderer = FillRenderer_1.default;
7987var HelperRenderer_1 = __webpack_require__(58);
7988exports.HelperRenderer = HelperRenderer_1.default;
7989var ExternalDropping_1 = __webpack_require__(222);
7990exports.ExternalDropping = ExternalDropping_1.default;
7991var EventResizing_1 = __webpack_require__(223);
7992exports.EventResizing = EventResizing_1.default;
7993var EventPointing_1 = __webpack_require__(59);
7994exports.EventPointing = EventPointing_1.default;
7995var EventDragging_1 = __webpack_require__(224);
7996exports.EventDragging = EventDragging_1.default;
7997var DateSelecting_1 = __webpack_require__(225);
7998exports.DateSelecting = DateSelecting_1.default;
7999var StandardInteractionsMixin_1 = __webpack_require__(60);
8000exports.StandardInteractionsMixin = StandardInteractionsMixin_1.default;
8001var AgendaView_1 = __webpack_require__(226);
8002exports.AgendaView = AgendaView_1.default;
8003var TimeGrid_1 = __webpack_require__(227);
8004exports.TimeGrid = TimeGrid_1.default;
8005var DayGrid_1 = __webpack_require__(61);
8006exports.DayGrid = DayGrid_1.default;
8007var BasicView_1 = __webpack_require__(62);
8008exports.BasicView = BasicView_1.default;
8009var MonthView_1 = __webpack_require__(229);
8010exports.MonthView = MonthView_1.default;
8011var ListView_1 = __webpack_require__(230);
8012exports.ListView = ListView_1.default;
8013
8014
8015/***/ }),
8016/* 18 */
8017/***/ (function(module, exports, __webpack_require__) {
8018
8019Object.defineProperty(exports, "__esModule", { value: true });
8020var UnzonedRange_1 = __webpack_require__(5);
8021/*
8022Meant to be immutable
8023*/
8024var EventDateProfile = /** @class */ (function () {
8025    function EventDateProfile(start, end, calendar) {
8026        this.start = start;
8027        this.end = end || null;
8028        this.unzonedRange = this.buildUnzonedRange(calendar);
8029    }
8030    /*
8031    Needs an EventSource object
8032    */
8033    EventDateProfile.parse = function (rawProps, source) {
8034        var startInput = rawProps.start || rawProps.date;
8035        var endInput = rawProps.end;
8036        if (!startInput) {
8037            return false;
8038        }
8039        var calendar = source.calendar;
8040        var start = calendar.moment(startInput);
8041        var end = endInput ? calendar.moment(endInput) : null;
8042        var forcedAllDay = rawProps.allDay;
8043        var forceEventDuration = calendar.opt('forceEventDuration');
8044        if (!start.isValid()) {
8045            return false;
8046        }
8047        if (end && (!end.isValid() || !end.isAfter(start))) {
8048            end = null;
8049        }
8050        if (forcedAllDay == null) {
8051            forcedAllDay = source.allDayDefault;
8052            if (forcedAllDay == null) {
8053                forcedAllDay = calendar.opt('allDayDefault');
8054            }
8055        }
8056        if (forcedAllDay === true) {
8057            start.stripTime();
8058            if (end) {
8059                end.stripTime();
8060            }
8061        }
8062        else if (forcedAllDay === false) {
8063            if (!start.hasTime()) {
8064                start.time(0);
8065            }
8066            if (end && !end.hasTime()) {
8067                end.time(0);
8068            }
8069        }
8070        if (!end && forceEventDuration) {
8071            end = calendar.getDefaultEventEnd(!start.hasTime(), start);
8072        }
8073        return new EventDateProfile(start, end, calendar);
8074    };
8075    EventDateProfile.isStandardProp = function (propName) {
8076        return propName === 'start' || propName === 'date' || propName === 'end' || propName === 'allDay';
8077    };
8078    EventDateProfile.prototype.isAllDay = function () {
8079        return !(this.start.hasTime() || (this.end && this.end.hasTime()));
8080    };
8081    /*
8082    Needs a Calendar object
8083    */
8084    EventDateProfile.prototype.buildUnzonedRange = function (calendar) {
8085        var startMs = this.start.clone().stripZone().valueOf();
8086        var endMs = this.getEnd(calendar).stripZone().valueOf();
8087        return new UnzonedRange_1.default(startMs, endMs);
8088    };
8089    /*
8090    Needs a Calendar object
8091    */
8092    EventDateProfile.prototype.getEnd = function (calendar) {
8093        return this.end ?
8094            this.end.clone() :
8095            // derive the end from the start and allDay. compute allDay if necessary
8096            calendar.getDefaultEventEnd(this.isAllDay(), this.start);
8097    };
8098    return EventDateProfile;
8099}());
8100exports.default = EventDateProfile;
8101
8102
8103/***/ }),
8104/* 19 */
8105/***/ (function(module, exports, __webpack_require__) {
8106
8107Object.defineProperty(exports, "__esModule", { value: true });
8108var UnzonedRange_1 = __webpack_require__(5);
8109var util_1 = __webpack_require__(34);
8110var EventRange_1 = __webpack_require__(211);
8111/*
8112It's expected that there will be at least one EventInstance,
8113OR that an explicitEventDef is assigned.
8114*/
8115var EventInstanceGroup = /** @class */ (function () {
8116    function EventInstanceGroup(eventInstances) {
8117        this.eventInstances = eventInstances || [];
8118    }
8119    EventInstanceGroup.prototype.getAllEventRanges = function (constraintRange) {
8120        if (constraintRange) {
8121            return this.sliceNormalRenderRanges(constraintRange);
8122        }
8123        else {
8124            return this.eventInstances.map(util_1.eventInstanceToEventRange);
8125        }
8126    };
8127    EventInstanceGroup.prototype.sliceRenderRanges = function (constraintRange) {
8128        if (this.isInverse()) {
8129            return this.sliceInverseRenderRanges(constraintRange);
8130        }
8131        else {
8132            return this.sliceNormalRenderRanges(constraintRange);
8133        }
8134    };
8135    EventInstanceGroup.prototype.sliceNormalRenderRanges = function (constraintRange) {
8136        var eventInstances = this.eventInstances;
8137        var i;
8138        var eventInstance;
8139        var slicedRange;
8140        var slicedEventRanges = [];
8141        for (i = 0; i < eventInstances.length; i++) {
8142            eventInstance = eventInstances[i];
8143            slicedRange = eventInstance.dateProfile.unzonedRange.intersect(constraintRange);
8144            if (slicedRange) {
8145                slicedEventRanges.push(new EventRange_1.default(slicedRange, eventInstance.def, eventInstance));
8146            }
8147        }
8148        return slicedEventRanges;
8149    };
8150    EventInstanceGroup.prototype.sliceInverseRenderRanges = function (constraintRange) {
8151        var unzonedRanges = this.eventInstances.map(util_1.eventInstanceToUnzonedRange);
8152        var ownerDef = this.getEventDef();
8153        unzonedRanges = UnzonedRange_1.default.invertRanges(unzonedRanges, constraintRange);
8154        return unzonedRanges.map(function (unzonedRange) {
8155            return new EventRange_1.default(unzonedRange, ownerDef); // don't give an EventInstance
8156        });
8157    };
8158    EventInstanceGroup.prototype.isInverse = function () {
8159        return this.getEventDef().hasInverseRendering();
8160    };
8161    EventInstanceGroup.prototype.getEventDef = function () {
8162        return this.explicitEventDef || this.eventInstances[0].def;
8163    };
8164    return EventInstanceGroup;
8165}());
8166exports.default = EventInstanceGroup;
8167
8168
8169/***/ }),
8170/* 20 */
8171/***/ (function(module, exports, __webpack_require__) {
8172
8173Object.defineProperty(exports, "__esModule", { value: true });
8174var $ = __webpack_require__(3);
8175var PromiseStub = {
8176    construct: function (executor) {
8177        var deferred = $.Deferred();
8178        var promise = deferred.promise();
8179        if (typeof executor === 'function') {
8180            executor(function (val) {
8181                deferred.resolve(val);
8182                attachImmediatelyResolvingThen(promise, val);
8183            }, function () {
8184                deferred.reject();
8185                attachImmediatelyRejectingThen(promise);
8186            });
8187        }
8188        return promise;
8189    },
8190    resolve: function (val) {
8191        var deferred = $.Deferred().resolve(val);
8192        var promise = deferred.promise();
8193        attachImmediatelyResolvingThen(promise, val);
8194        return promise;
8195    },
8196    reject: function () {
8197        var deferred = $.Deferred().reject();
8198        var promise = deferred.promise();
8199        attachImmediatelyRejectingThen(promise);
8200        return promise;
8201    }
8202};
8203exports.default = PromiseStub;
8204function attachImmediatelyResolvingThen(promise, val) {
8205    promise.then = function (onResolve) {
8206        if (typeof onResolve === 'function') {
8207            return PromiseStub.resolve(onResolve(val));
8208        }
8209        return promise;
8210    };
8211}
8212function attachImmediatelyRejectingThen(promise) {
8213    promise.then = function (onResolve, onReject) {
8214        if (typeof onReject === 'function') {
8215            onReject();
8216        }
8217        return promise;
8218    };
8219}
8220
8221
8222/***/ }),
8223/* 21 */
8224/***/ (function(module, exports, __webpack_require__) {
8225
8226Object.defineProperty(exports, "__esModule", { value: true });
8227var exportHooks = __webpack_require__(17);
8228exports.viewHash = {};
8229exportHooks.views = exports.viewHash;
8230function defineView(viewName, viewConfig) {
8231    exports.viewHash[viewName] = viewConfig;
8232}
8233exports.defineView = defineView;
8234function getViewConfig(viewName) {
8235    return exports.viewHash[viewName];
8236}
8237exports.getViewConfig = getViewConfig;
8238
8239
8240/***/ }),
8241/* 22 */
8242/***/ (function(module, exports, __webpack_require__) {
8243
8244Object.defineProperty(exports, "__esModule", { value: true });
8245var tslib_1 = __webpack_require__(2);
8246var util_1 = __webpack_require__(4);
8247var DragListener_1 = __webpack_require__(54);
8248/* Tracks mouse movements over a component and raises events about which hit the mouse is over.
8249------------------------------------------------------------------------------------------------------------------------
8250options:
8251- subjectEl
8252- subjectCenter
8253*/
8254var HitDragListener = /** @class */ (function (_super) {
8255    tslib_1.__extends(HitDragListener, _super);
8256    function HitDragListener(component, options) {
8257        var _this = _super.call(this, options) || this;
8258        _this.component = component;
8259        return _this;
8260    }
8261    // Called when drag listening starts (but a real drag has not necessarily began).
8262    // ev might be undefined if dragging was started manually.
8263    HitDragListener.prototype.handleInteractionStart = function (ev) {
8264        var subjectEl = this.subjectEl;
8265        var subjectRect;
8266        var origPoint;
8267        var point;
8268        this.component.hitsNeeded();
8269        this.computeScrollBounds(); // for autoscroll
8270        if (ev) {
8271            origPoint = { left: util_1.getEvX(ev), top: util_1.getEvY(ev) };
8272            point = origPoint;
8273            // constrain the point to bounds of the element being dragged
8274            if (subjectEl) {
8275                subjectRect = util_1.getOuterRect(subjectEl); // used for centering as well
8276                point = util_1.constrainPoint(point, subjectRect);
8277            }
8278            this.origHit = this.queryHit(point.left, point.top);
8279            // treat the center of the subject as the collision point?
8280            if (subjectEl && this.options.subjectCenter) {
8281                // only consider the area the subject overlaps the hit. best for large subjects.
8282                // TODO: skip this if hit didn't supply left/right/top/bottom
8283                if (this.origHit) {
8284                    subjectRect = util_1.intersectRects(this.origHit, subjectRect) ||
8285                        subjectRect; // in case there is no intersection
8286                }
8287                point = util_1.getRectCenter(subjectRect);
8288            }
8289            this.coordAdjust = util_1.diffPoints(point, origPoint); // point - origPoint
8290        }
8291        else {
8292            this.origHit = null;
8293            this.coordAdjust = null;
8294        }
8295        // call the super-method. do it after origHit has been computed
8296        _super.prototype.handleInteractionStart.call(this, ev);
8297    };
8298    // Called when the actual drag has started
8299    HitDragListener.prototype.handleDragStart = function (ev) {
8300        var hit;
8301        _super.prototype.handleDragStart.call(this, ev);
8302        // might be different from this.origHit if the min-distance is large
8303        hit = this.queryHit(util_1.getEvX(ev), util_1.getEvY(ev));
8304        // report the initial hit the mouse is over
8305        // especially important if no min-distance and drag starts immediately
8306        if (hit) {
8307            this.handleHitOver(hit);
8308        }
8309    };
8310    // Called when the drag moves
8311    HitDragListener.prototype.handleDrag = function (dx, dy, ev) {
8312        var hit;
8313        _super.prototype.handleDrag.call(this, dx, dy, ev);
8314        hit = this.queryHit(util_1.getEvX(ev), util_1.getEvY(ev));
8315        if (!isHitsEqual(hit, this.hit)) {
8316            if (this.hit) {
8317                this.handleHitOut();
8318            }
8319            if (hit) {
8320                this.handleHitOver(hit);
8321            }
8322        }
8323    };
8324    // Called when dragging has been stopped
8325    HitDragListener.prototype.handleDragEnd = function (ev) {
8326        this.handleHitDone();
8327        _super.prototype.handleDragEnd.call(this, ev);
8328    };
8329    // Called when a the mouse has just moved over a new hit
8330    HitDragListener.prototype.handleHitOver = function (hit) {
8331        var isOrig = isHitsEqual(hit, this.origHit);
8332        this.hit = hit;
8333        this.trigger('hitOver', this.hit, isOrig, this.origHit);
8334    };
8335    // Called when the mouse has just moved out of a hit
8336    HitDragListener.prototype.handleHitOut = function () {
8337        if (this.hit) {
8338            this.trigger('hitOut', this.hit);
8339            this.handleHitDone();
8340            this.hit = null;
8341        }
8342    };
8343    // Called after a hitOut. Also called before a dragStop
8344    HitDragListener.prototype.handleHitDone = function () {
8345        if (this.hit) {
8346            this.trigger('hitDone', this.hit);
8347        }
8348    };
8349    // Called when the interaction ends, whether there was a real drag or not
8350    HitDragListener.prototype.handleInteractionEnd = function (ev, isCancelled) {
8351        _super.prototype.handleInteractionEnd.call(this, ev, isCancelled);
8352        this.origHit = null;
8353        this.hit = null;
8354        this.component.hitsNotNeeded();
8355    };
8356    // Called when scrolling has stopped, whether through auto scroll, or the user scrolling
8357    HitDragListener.prototype.handleScrollEnd = function () {
8358        _super.prototype.handleScrollEnd.call(this);
8359        // hits' absolute positions will be in new places after a user's scroll.
8360        // HACK for recomputing.
8361        if (this.isDragging) {
8362            this.component.releaseHits();
8363            this.component.prepareHits();
8364        }
8365    };
8366    // Gets the hit underneath the coordinates for the given mouse event
8367    HitDragListener.prototype.queryHit = function (left, top) {
8368        if (this.coordAdjust) {
8369            left += this.coordAdjust.left;
8370            top += this.coordAdjust.top;
8371        }
8372        return this.component.queryHit(left, top);
8373    };
8374    return HitDragListener;
8375}(DragListener_1.default));
8376exports.default = HitDragListener;
8377// Returns `true` if the hits are identically equal. `false` otherwise. Must be from the same component.
8378// Two null values will be considered equal, as two "out of the component" states are the same.
8379function isHitsEqual(hit0, hit1) {
8380    if (!hit0 && !hit1) {
8381        return true;
8382    }
8383    if (hit0 && hit1) {
8384        return hit0.component === hit1.component &&
8385            isHitPropsWithin(hit0, hit1) &&
8386            isHitPropsWithin(hit1, hit0); // ensures all props are identical
8387    }
8388    return false;
8389}
8390// Returns true if all of subHit's non-standard properties are within superHit
8391function isHitPropsWithin(subHit, superHit) {
8392    for (var propName in subHit) {
8393        if (!/^(component|left|right|top|bottom)$/.test(propName)) {
8394            if (subHit[propName] !== superHit[propName]) {
8395                return false;
8396            }
8397        }
8398    }
8399    return true;
8400}
8401
8402
8403/***/ }),
8404/* 23 */,
8405/* 24 */,
8406/* 25 */,
8407/* 26 */,
8408/* 27 */,
8409/* 28 */,
8410/* 29 */,
8411/* 30 */
8412/***/ (function(module, exports, __webpack_require__) {
8413
8414Object.defineProperty(exports, "__esModule", { value: true });
8415var $ = __webpack_require__(3);
8416var moment = __webpack_require__(0);
8417var exportHooks = __webpack_require__(17);
8418var options_1 = __webpack_require__(31);
8419var util_1 = __webpack_require__(4);
8420exports.localeOptionHash = {};
8421exportHooks.locales = exports.localeOptionHash;
8422// NOTE: can't guarantee any of these computations will run because not every locale has datepicker
8423// configs, so make sure there are English fallbacks for these in the defaults file.
8424var dpComputableOptions = {
8425    buttonText: function (dpOptions) {
8426        return {
8427            // the translations sometimes wrongly contain HTML entities
8428            prev: util_1.stripHtmlEntities(dpOptions.prevText),
8429            next: util_1.stripHtmlEntities(dpOptions.nextText),
8430            today: util_1.stripHtmlEntities(dpOptions.currentText)
8431        };
8432    },
8433    // Produces format strings like "MMMM YYYY" -> "September 2014"
8434    monthYearFormat: function (dpOptions) {
8435        return dpOptions.showMonthAfterYear ?
8436            'YYYY[' + dpOptions.yearSuffix + '] MMMM' :
8437            'MMMM YYYY[' + dpOptions.yearSuffix + ']';
8438    }
8439};
8440var momComputableOptions = {
8441    // Produces format strings like "ddd M/D" -> "Fri 9/15"
8442    dayOfMonthFormat: function (momOptions, fcOptions) {
8443        var format = momOptions.longDateFormat('l'); // for the format like "M/D/YYYY"
8444        // strip the year off the edge, as well as other misc non-whitespace chars
8445        format = format.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g, '');
8446        if (fcOptions.isRTL) {
8447            format += ' ddd'; // for RTL, add day-of-week to end
8448        }
8449        else {
8450            format = 'ddd ' + format; // for LTR, add day-of-week to beginning
8451        }
8452        return format;
8453    },
8454    // Produces format strings like "h:mma" -> "6:00pm"
8455    mediumTimeFormat: function (momOptions) {
8456        return momOptions.longDateFormat('LT')
8457            .replace(/\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand
8458    },
8459    // Produces format strings like "h(:mm)a" -> "6pm" / "6:30pm"
8460    smallTimeFormat: function (momOptions) {
8461        return momOptions.longDateFormat('LT')
8462            .replace(':mm', '(:mm)')
8463            .replace(/(\Wmm)$/, '($1)') // like above, but for foreign locales
8464            .replace(/\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand
8465    },
8466    // Produces format strings like "h(:mm)t" -> "6p" / "6:30p"
8467    extraSmallTimeFormat: function (momOptions) {
8468        return momOptions.longDateFormat('LT')
8469            .replace(':mm', '(:mm)')
8470            .replace(/(\Wmm)$/, '($1)') // like above, but for foreign locales
8471            .replace(/\s*a$/i, 't'); // convert to AM/PM/am/pm to lowercase one-letter. remove any spaces beforehand
8472    },
8473    // Produces format strings like "ha" / "H" -> "6pm" / "18"
8474    hourFormat: function (momOptions) {
8475        return momOptions.longDateFormat('LT')
8476            .replace(':mm', '')
8477            .replace(/(\Wmm)$/, '') // like above, but for foreign locales
8478            .replace(/\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand
8479    },
8480    // Produces format strings like "h:mm" -> "6:30" (with no AM/PM)
8481    noMeridiemTimeFormat: function (momOptions) {
8482        return momOptions.longDateFormat('LT')
8483            .replace(/\s*a$/i, ''); // remove trailing AM/PM
8484    }
8485};
8486// options that should be computed off live calendar options (considers override options)
8487// TODO: best place for this? related to locale?
8488// TODO: flipping text based on isRTL is a bad idea because the CSS `direction` might want to handle it
8489var instanceComputableOptions = {
8490    // Produces format strings for results like "Mo 16"
8491    smallDayDateFormat: function (options) {
8492        return options.isRTL ?
8493            'D dd' :
8494            'dd D';
8495    },
8496    // Produces format strings for results like "Wk 5"
8497    weekFormat: function (options) {
8498        return options.isRTL ?
8499            'w[ ' + options.weekNumberTitle + ']' :
8500            '[' + options.weekNumberTitle + ' ]w';
8501    },
8502    // Produces format strings for results like "Wk5"
8503    smallWeekFormat: function (options) {
8504        return options.isRTL ?
8505            'w[' + options.weekNumberTitle + ']' :
8506            '[' + options.weekNumberTitle + ']w';
8507    }
8508};
8509// TODO: make these computable properties in optionsManager
8510function populateInstanceComputableOptions(options) {
8511    $.each(instanceComputableOptions, function (name, func) {
8512        if (options[name] == null) {
8513            options[name] = func(options);
8514        }
8515    });
8516}
8517exports.populateInstanceComputableOptions = populateInstanceComputableOptions;
8518// Initialize jQuery UI datepicker translations while using some of the translations
8519// Will set this as the default locales for datepicker.
8520function datepickerLocale(localeCode, dpLocaleCode, dpOptions) {
8521    // get the FullCalendar internal option hash for this locale. create if necessary
8522    var fcOptions = exports.localeOptionHash[localeCode] || (exports.localeOptionHash[localeCode] = {});
8523    // transfer some simple options from datepicker to fc
8524    fcOptions.isRTL = dpOptions.isRTL;
8525    fcOptions.weekNumberTitle = dpOptions.weekHeader;
8526    // compute some more complex options from datepicker
8527    $.each(dpComputableOptions, function (name, func) {
8528        fcOptions[name] = func(dpOptions);
8529    });
8530    var jqDatePicker = $.datepicker;
8531    // is jQuery UI Datepicker is on the page?
8532    if (jqDatePicker) {
8533        // Register the locale data.
8534        // FullCalendar and MomentJS use locale codes like "pt-br" but Datepicker
8535        // does it like "pt-BR" or if it doesn't have the locale, maybe just "pt".
8536        // Make an alias so the locale can be referenced either way.
8537        jqDatePicker.regional[dpLocaleCode] =
8538            jqDatePicker.regional[localeCode] = // alias
8539                dpOptions;
8540        // Alias 'en' to the default locale data. Do this every time.
8541        jqDatePicker.regional.en = jqDatePicker.regional[''];
8542        // Set as Datepicker's global defaults.
8543        jqDatePicker.setDefaults(dpOptions);
8544    }
8545}
8546exports.datepickerLocale = datepickerLocale;
8547// Sets FullCalendar-specific translations. Will set the locales as the global default.
8548function locale(localeCode, newFcOptions) {
8549    var fcOptions;
8550    var momOptions;
8551    // get the FullCalendar internal option hash for this locale. create if necessary
8552    fcOptions = exports.localeOptionHash[localeCode] || (exports.localeOptionHash[localeCode] = {});
8553    // provided new options for this locales? merge them in
8554    if (newFcOptions) {
8555        fcOptions = exports.localeOptionHash[localeCode] = options_1.mergeOptions([fcOptions, newFcOptions]);
8556    }
8557    // compute locale options that weren't defined.
8558    // always do this. newFcOptions can be undefined when initializing from i18n file,
8559    // so no way to tell if this is an initialization or a default-setting.
8560    momOptions = getMomentLocaleData(localeCode); // will fall back to en
8561    $.each(momComputableOptions, function (name, func) {
8562        if (fcOptions[name] == null) {
8563            fcOptions[name] = (func)(momOptions, fcOptions);
8564        }
8565    });
8566    // set it as the default locale for FullCalendar
8567    options_1.globalDefaults.locale = localeCode;
8568}
8569exports.locale = locale;
8570// Returns moment's internal locale data. If doesn't exist, returns English.
8571function getMomentLocaleData(localeCode) {
8572    return moment.localeData(localeCode) || moment.localeData('en');
8573}
8574exports.getMomentLocaleData = getMomentLocaleData;
8575// Initialize English by forcing computation of moment-derived options.
8576// Also, sets it as the default.
8577locale('en', options_1.englishDefaults);
8578
8579
8580/***/ }),
8581/* 31 */
8582/***/ (function(module, exports, __webpack_require__) {
8583
8584Object.defineProperty(exports, "__esModule", { value: true });
8585var util_1 = __webpack_require__(4);
8586exports.globalDefaults = {
8587    titleRangeSeparator: ' \u2013 ',
8588    monthYearFormat: 'MMMM YYYY',
8589    defaultTimedEventDuration: '02:00:00',
8590    defaultAllDayEventDuration: { days: 1 },
8591    forceEventDuration: false,
8592    nextDayThreshold: '09:00:00',
8593    // display
8594    columnHeader: true,
8595    defaultView: 'month',
8596    aspectRatio: 1.35,
8597    header: {
8598        left: 'title',
8599        center: '',
8600        right: 'today prev,next'
8601    },
8602    weekends: true,
8603    weekNumbers: false,
8604    weekNumberTitle: 'W',
8605    weekNumberCalculation: 'local',
8606    // editable: false,
8607    // nowIndicator: false,
8608    scrollTime: '06:00:00',
8609    minTime: '00:00:00',
8610    maxTime: '24:00:00',
8611    showNonCurrentDates: true,
8612    // event ajax
8613    lazyFetching: true,
8614    startParam: 'start',
8615    endParam: 'end',
8616    timezoneParam: 'timezone',
8617    timezone: false,
8618    // allDayDefault: undefined,
8619    // locale
8620    locale: null,
8621    isRTL: false,
8622    buttonText: {
8623        prev: 'prev',
8624        next: 'next',
8625        prevYear: 'prev year',
8626        nextYear: 'next year',
8627        year: 'year',
8628        today: 'today',
8629        month: 'month',
8630        week: 'week',
8631        day: 'day'
8632    },
8633    // buttonIcons: null,
8634    allDayText: 'all-day',
8635    // allows setting a min-height to the event segment to prevent short events overlapping each other
8636    agendaEventMinHeight: 0,
8637    // jquery-ui theming
8638    theme: false,
8639    // themeButtonIcons: null,
8640    // eventResizableFromStart: false,
8641    dragOpacity: .75,
8642    dragRevertDuration: 500,
8643    dragScroll: true,
8644    // selectable: false,
8645    unselectAuto: true,
8646    // selectMinDistance: 0,
8647    dropAccept: '*',
8648    eventOrder: 'title',
8649    // eventRenderWait: null,
8650    eventLimit: false,
8651    eventLimitText: 'more',
8652    eventLimitClick: 'popover',
8653    dayPopoverFormat: 'LL',
8654    handleWindowResize: true,
8655    windowResizeDelay: 100,
8656    longPressDelay: 1000
8657};
8658exports.englishDefaults = {
8659    dayPopoverFormat: 'dddd, MMMM D'
8660};
8661exports.rtlDefaults = {
8662    header: {
8663        left: 'next,prev today',
8664        center: '',
8665        right: 'title'
8666    },
8667    buttonIcons: {
8668        prev: 'right-single-arrow',
8669        next: 'left-single-arrow',
8670        prevYear: 'right-double-arrow',
8671        nextYear: 'left-double-arrow'
8672    },
8673    themeButtonIcons: {
8674        prev: 'circle-triangle-e',
8675        next: 'circle-triangle-w',
8676        nextYear: 'seek-prev',
8677        prevYear: 'seek-next'
8678    }
8679};
8680var complexOptions = [
8681    'header',
8682    'footer',
8683    'buttonText',
8684    'buttonIcons',
8685    'themeButtonIcons'
8686];
8687// Merges an array of option objects into a single object
8688function mergeOptions(optionObjs) {
8689    return util_1.mergeProps(optionObjs, complexOptions);
8690}
8691exports.mergeOptions = mergeOptions;
8692
8693
8694/***/ }),
8695/* 32 */
8696/***/ (function(module, exports, __webpack_require__) {
8697
8698Object.defineProperty(exports, "__esModule", { value: true });
8699var tslib_1 = __webpack_require__(2);
8700var util_1 = __webpack_require__(4);
8701// Class that all other classes will inherit from
8702var Class = /** @class */ (function () {
8703    function Class() {
8704    }
8705    // Called on a class to create a subclass.
8706    // LIMITATION: cannot provide a constructor!
8707    Class.extend = function (members) {
8708        var SubClass = /** @class */ (function (_super) {
8709            tslib_1.__extends(SubClass, _super);
8710            function SubClass() {
8711                return _super !== null && _super.apply(this, arguments) || this;
8712            }
8713            return SubClass;
8714        }(this));
8715        util_1.copyOwnProps(members, SubClass.prototype);
8716        return SubClass;
8717    };
8718    // Adds new member variables/methods to the class's prototype.
8719    // Can be called with another class, or a plain object hash containing new members.
8720    Class.mixin = function (members) {
8721        util_1.copyOwnProps(members, this.prototype);
8722    };
8723    return Class;
8724}());
8725exports.default = Class;
8726
8727
8728/***/ }),
8729/* 33 */
8730/***/ (function(module, exports, __webpack_require__) {
8731
8732Object.defineProperty(exports, "__esModule", { value: true });
8733var $ = __webpack_require__(3);
8734var ParsableModelMixin_1 = __webpack_require__(208);
8735var EventDef = /** @class */ (function () {
8736    function EventDef(source) {
8737        this.source = source;
8738        this.className = [];
8739        this.miscProps = {};
8740    }
8741    EventDef.parse = function (rawInput, source) {
8742        var def = new this(source);
8743        if (def.applyProps(rawInput)) {
8744            return def;
8745        }
8746        return false;
8747    };
8748    EventDef.normalizeId = function (id) {
8749        return String(id);
8750    };
8751    EventDef.generateId = function () {
8752        return '_fc' + (EventDef.uuid++);
8753    };
8754    EventDef.prototype.clone = function () {
8755        var copy = new this.constructor(this.source);
8756        copy.id = this.id;
8757        copy.rawId = this.rawId;
8758        copy.uid = this.uid; // not really unique anymore :(
8759        EventDef.copyVerbatimStandardProps(this, copy);
8760        copy.className = this.className.slice(); // copy
8761        copy.miscProps = $.extend({}, this.miscProps);
8762        return copy;
8763    };
8764    EventDef.prototype.hasInverseRendering = function () {
8765        return this.getRendering() === 'inverse-background';
8766    };
8767    EventDef.prototype.hasBgRendering = function () {
8768        var rendering = this.getRendering();
8769        return rendering === 'inverse-background' || rendering === 'background';
8770    };
8771    EventDef.prototype.getRendering = function () {
8772        if (this.rendering != null) {
8773            return this.rendering;
8774        }
8775        return this.source.rendering;
8776    };
8777    EventDef.prototype.getConstraint = function () {
8778        if (this.constraint != null) {
8779            return this.constraint;
8780        }
8781        if (this.source.constraint != null) {
8782            return this.source.constraint;
8783        }
8784        return this.source.calendar.opt('eventConstraint'); // what about View option?
8785    };
8786    EventDef.prototype.getOverlap = function () {
8787        if (this.overlap != null) {
8788            return this.overlap;
8789        }
8790        if (this.source.overlap != null) {
8791            return this.source.overlap;
8792        }
8793        return this.source.calendar.opt('eventOverlap'); // what about View option?
8794    };
8795    EventDef.prototype.isStartExplicitlyEditable = function () {
8796        if (this.startEditable != null) {
8797            return this.startEditable;
8798        }
8799        return this.source.startEditable;
8800    };
8801    EventDef.prototype.isDurationExplicitlyEditable = function () {
8802        if (this.durationEditable != null) {
8803            return this.durationEditable;
8804        }
8805        return this.source.durationEditable;
8806    };
8807    EventDef.prototype.isExplicitlyEditable = function () {
8808        if (this.editable != null) {
8809            return this.editable;
8810        }
8811        return this.source.editable;
8812    };
8813    EventDef.prototype.toLegacy = function () {
8814        var obj = $.extend({}, this.miscProps);
8815        obj._id = this.uid;
8816        obj.source = this.source;
8817        obj.className = this.className.slice(); // copy
8818        obj.allDay = this.isAllDay();
8819        if (this.rawId != null) {
8820            obj.id = this.rawId;
8821        }
8822        EventDef.copyVerbatimStandardProps(this, obj);
8823        return obj;
8824    };
8825    EventDef.prototype.applyManualStandardProps = function (rawProps) {
8826        if (rawProps.id != null) {
8827            this.id = EventDef.normalizeId((this.rawId = rawProps.id));
8828        }
8829        else {
8830            this.id = EventDef.generateId();
8831        }
8832        if (rawProps._id != null) {
8833            this.uid = String(rawProps._id);
8834        }
8835        else {
8836            this.uid = EventDef.generateId();
8837        }
8838        // TODO: converge with EventSource
8839        if ($.isArray(rawProps.className)) {
8840            this.className = rawProps.className;
8841        }
8842        if (typeof rawProps.className === 'string') {
8843            this.className = rawProps.className.split(/\s+/);
8844        }
8845        return true;
8846    };
8847    EventDef.prototype.applyMiscProps = function (rawProps) {
8848        $.extend(this.miscProps, rawProps);
8849    };
8850    EventDef.uuid = 0;
8851    EventDef.defineStandardProps = ParsableModelMixin_1.default.defineStandardProps;
8852    EventDef.copyVerbatimStandardProps = ParsableModelMixin_1.default.copyVerbatimStandardProps;
8853    return EventDef;
8854}());
8855exports.default = EventDef;
8856ParsableModelMixin_1.default.mixInto(EventDef);
8857EventDef.defineStandardProps({
8858    // not automatically assigned (`false`)
8859    _id: false,
8860    id: false,
8861    className: false,
8862    source: false,
8863    // automatically assigned (`true`)
8864    title: true,
8865    url: true,
8866    rendering: true,
8867    constraint: true,
8868    overlap: true,
8869    editable: true,
8870    startEditable: true,
8871    durationEditable: true,
8872    color: true,
8873    backgroundColor: true,
8874    borderColor: true,
8875    textColor: true
8876});
8877
8878
8879/***/ }),
8880/* 34 */
8881/***/ (function(module, exports, __webpack_require__) {
8882
8883Object.defineProperty(exports, "__esModule", { value: true });
8884var EventRange_1 = __webpack_require__(211);
8885var EventFootprint_1 = __webpack_require__(35);
8886var ComponentFootprint_1 = __webpack_require__(12);
8887function eventDefsToEventInstances(eventDefs, unzonedRange) {
8888    var eventInstances = [];
8889    var i;
8890    for (i = 0; i < eventDefs.length; i++) {
8891        eventInstances.push.apply(eventInstances, // append
8892        eventDefs[i].buildInstances(unzonedRange));
8893    }
8894    return eventInstances;
8895}
8896exports.eventDefsToEventInstances = eventDefsToEventInstances;
8897function eventInstanceToEventRange(eventInstance) {
8898    return new EventRange_1.default(eventInstance.dateProfile.unzonedRange, eventInstance.def, eventInstance);
8899}
8900exports.eventInstanceToEventRange = eventInstanceToEventRange;
8901function eventRangeToEventFootprint(eventRange) {
8902    return new EventFootprint_1.default(new ComponentFootprint_1.default(eventRange.unzonedRange, eventRange.eventDef.isAllDay()), eventRange.eventDef, eventRange.eventInstance // might not exist
8903    );
8904}
8905exports.eventRangeToEventFootprint = eventRangeToEventFootprint;
8906function eventInstanceToUnzonedRange(eventInstance) {
8907    return eventInstance.dateProfile.unzonedRange;
8908}
8909exports.eventInstanceToUnzonedRange = eventInstanceToUnzonedRange;
8910function eventFootprintToComponentFootprint(eventFootprint) {
8911    return eventFootprint.componentFootprint;
8912}
8913exports.eventFootprintToComponentFootprint = eventFootprintToComponentFootprint;
8914
8915
8916/***/ }),
8917/* 35 */
8918/***/ (function(module, exports) {
8919
8920Object.defineProperty(exports, "__esModule", { value: true });
8921var EventFootprint = /** @class */ (function () {
8922    function EventFootprint(componentFootprint, eventDef, eventInstance) {
8923        this.componentFootprint = componentFootprint;
8924        this.eventDef = eventDef;
8925        if (eventInstance) {
8926            this.eventInstance = eventInstance;
8927        }
8928    }
8929    EventFootprint.prototype.getEventLegacy = function () {
8930        return (this.eventInstance || this.eventDef).toLegacy();
8931    };
8932    return EventFootprint;
8933}());
8934exports.default = EventFootprint;
8935
8936
8937/***/ }),
8938/* 36 */
8939/***/ (function(module, exports, __webpack_require__) {
8940
8941Object.defineProperty(exports, "__esModule", { value: true });
8942var util_1 = __webpack_require__(4);
8943var EventDateProfile_1 = __webpack_require__(18);
8944var EventDef_1 = __webpack_require__(33);
8945var EventDefDateMutation_1 = __webpack_require__(50);
8946var SingleEventDef_1 = __webpack_require__(13);
8947var EventDefMutation = /** @class */ (function () {
8948    function EventDefMutation() {
8949    }
8950    EventDefMutation.createFromRawProps = function (eventInstance, rawProps, largeUnit) {
8951        var eventDef = eventInstance.def;
8952        var dateProps = {};
8953        var standardProps = {};
8954        var miscProps = {};
8955        var verbatimStandardProps = {};
8956        var eventDefId = null;
8957        var className = null;
8958        var propName;
8959        var dateProfile;
8960        var dateMutation;
8961        var defMutation;
8962        for (propName in rawProps) {
8963            if (EventDateProfile_1.default.isStandardProp(propName)) {
8964                dateProps[propName] = rawProps[propName];
8965            }
8966            else if (eventDef.isStandardProp(propName)) {
8967                standardProps[propName] = rawProps[propName];
8968            }
8969            else if (eventDef.miscProps[propName] !== rawProps[propName]) {
8970                miscProps[propName] = rawProps[propName];
8971            }
8972        }
8973        dateProfile = EventDateProfile_1.default.parse(dateProps, eventDef.source);
8974        if (dateProfile) {
8975            dateMutation = EventDefDateMutation_1.default.createFromDiff(eventInstance.dateProfile, dateProfile, largeUnit);
8976        }
8977        if (standardProps.id !== eventDef.id) {
8978            eventDefId = standardProps.id; // only apply if there's a change
8979        }
8980        if (!util_1.isArraysEqual(standardProps.className, eventDef.className)) {
8981            className = standardProps.className; // only apply if there's a change
8982        }
8983        EventDef_1.default.copyVerbatimStandardProps(standardProps, // src
8984        verbatimStandardProps // dest
8985        );
8986        defMutation = new EventDefMutation();
8987        defMutation.eventDefId = eventDefId;
8988        defMutation.className = className;
8989        defMutation.verbatimStandardProps = verbatimStandardProps;
8990        defMutation.miscProps = miscProps;
8991        if (dateMutation) {
8992            defMutation.dateMutation = dateMutation;
8993        }
8994        return defMutation;
8995    };
8996    /*
8997    eventDef assumed to be a SingleEventDef.
8998    returns an undo function.
8999    */
9000    EventDefMutation.prototype.mutateSingle = function (eventDef) {
9001        var origDateProfile;
9002        if (this.dateMutation) {
9003            origDateProfile = eventDef.dateProfile;
9004            eventDef.dateProfile = this.dateMutation.buildNewDateProfile(origDateProfile, eventDef.source.calendar);
9005        }
9006        // can't undo
9007        // TODO: more DRY with EventDef::applyManualStandardProps
9008        if (this.eventDefId != null) {
9009            eventDef.id = EventDef_1.default.normalizeId((eventDef.rawId = this.eventDefId));
9010        }
9011        // can't undo
9012        // TODO: more DRY with EventDef::applyManualStandardProps
9013        if (this.className) {
9014            eventDef.className = this.className;
9015        }
9016        // can't undo
9017        if (this.verbatimStandardProps) {
9018            SingleEventDef_1.default.copyVerbatimStandardProps(this.verbatimStandardProps, // src
9019            eventDef // dest
9020            );
9021        }
9022        // can't undo
9023        if (this.miscProps) {
9024            eventDef.applyMiscProps(this.miscProps);
9025        }
9026        if (origDateProfile) {
9027            return function () {
9028                eventDef.dateProfile = origDateProfile;
9029            };
9030        }
9031        else {
9032            return function () { };
9033        }
9034    };
9035    EventDefMutation.prototype.setDateMutation = function (dateMutation) {
9036        if (dateMutation && !dateMutation.isEmpty()) {
9037            this.dateMutation = dateMutation;
9038        }
9039        else {
9040            this.dateMutation = null;
9041        }
9042    };
9043    EventDefMutation.prototype.isEmpty = function () {
9044        return !this.dateMutation;
9045    };
9046    return EventDefMutation;
9047}());
9048exports.default = EventDefMutation;
9049
9050
9051/***/ }),
9052/* 37 */
9053/***/ (function(module, exports) {
9054
9055Object.defineProperty(exports, "__esModule", { value: true });
9056exports.default = {
9057    sourceClasses: [],
9058    registerClass: function (EventSourceClass) {
9059        this.sourceClasses.unshift(EventSourceClass); // give highest priority
9060    },
9061    parse: function (rawInput, calendar) {
9062        var sourceClasses = this.sourceClasses;
9063        var i;
9064        var eventSource;
9065        for (i = 0; i < sourceClasses.length; i++) {
9066            eventSource = sourceClasses[i].parse(rawInput, calendar);
9067            if (eventSource) {
9068                return eventSource;
9069            }
9070        }
9071    }
9072};
9073
9074
9075/***/ }),
9076/* 38 */
9077/***/ (function(module, exports, __webpack_require__) {
9078
9079Object.defineProperty(exports, "__esModule", { value: true });
9080var $ = __webpack_require__(3);
9081var Theme = /** @class */ (function () {
9082    function Theme(optionsManager) {
9083        this.optionsManager = optionsManager;
9084        this.processIconOverride();
9085    }
9086    Theme.prototype.processIconOverride = function () {
9087        if (this.iconOverrideOption) {
9088            this.setIconOverride(this.optionsManager.get(this.iconOverrideOption));
9089        }
9090    };
9091    Theme.prototype.setIconOverride = function (iconOverrideHash) {
9092        var iconClassesCopy;
9093        var buttonName;
9094        if ($.isPlainObject(iconOverrideHash)) {
9095            iconClassesCopy = $.extend({}, this.iconClasses);
9096            for (buttonName in iconOverrideHash) {
9097                iconClassesCopy[buttonName] = this.applyIconOverridePrefix(iconOverrideHash[buttonName]);
9098            }
9099            this.iconClasses = iconClassesCopy;
9100        }
9101        else if (iconOverrideHash === false) {
9102            this.iconClasses = {};
9103        }
9104    };
9105    Theme.prototype.applyIconOverridePrefix = function (className) {
9106        var prefix = this.iconOverridePrefix;
9107        if (prefix && className.indexOf(prefix) !== 0) {
9108            className = prefix + className;
9109        }
9110        return className;
9111    };
9112    Theme.prototype.getClass = function (key) {
9113        return this.classes[key] || '';
9114    };
9115    Theme.prototype.getIconClass = function (buttonName) {
9116        var className = this.iconClasses[buttonName];
9117        if (className) {
9118            return this.baseIconClass + ' ' + className;
9119        }
9120        return '';
9121    };
9122    Theme.prototype.getCustomButtonIconClass = function (customButtonProps) {
9123        var className;
9124        if (this.iconOverrideCustomButtonOption) {
9125            className = customButtonProps[this.iconOverrideCustomButtonOption];
9126            if (className) {
9127                return this.baseIconClass + ' ' + this.applyIconOverridePrefix(className);
9128            }
9129        }
9130        return '';
9131    };
9132    return Theme;
9133}());
9134exports.default = Theme;
9135Theme.prototype.classes = {};
9136Theme.prototype.iconClasses = {};
9137Theme.prototype.baseIconClass = '';
9138Theme.prototype.iconOverridePrefix = '';
9139
9140
9141/***/ }),
9142/* 39 */
9143/***/ (function(module, exports, __webpack_require__) {
9144
9145Object.defineProperty(exports, "__esModule", { value: true });
9146var tslib_1 = __webpack_require__(2);
9147var $ = __webpack_require__(3);
9148var util_1 = __webpack_require__(4);
9149var Class_1 = __webpack_require__(32);
9150/*
9151Embodies a div that has potential scrollbars
9152*/
9153var Scroller = /** @class */ (function (_super) {
9154    tslib_1.__extends(Scroller, _super);
9155    function Scroller(options) {
9156        var _this = _super.call(this) || this;
9157        options = options || {};
9158        _this.overflowX = options.overflowX || options.overflow || 'auto';
9159        _this.overflowY = options.overflowY || options.overflow || 'auto';
9160        return _this;
9161    }
9162    Scroller.prototype.render = function () {
9163        this.el = this.renderEl();
9164        this.applyOverflow();
9165    };
9166    Scroller.prototype.renderEl = function () {
9167        return (this.scrollEl = $('<div class="fc-scroller"></div>'));
9168    };
9169    // sets to natural height, unlocks overflow
9170    Scroller.prototype.clear = function () {
9171        this.setHeight('auto');
9172        this.applyOverflow();
9173    };
9174    Scroller.prototype.destroy = function () {
9175        this.el.remove();
9176    };
9177    // Overflow
9178    // -----------------------------------------------------------------------------------------------------------------
9179    Scroller.prototype.applyOverflow = function () {
9180        this.scrollEl.css({
9181            'overflow-x': this.overflowX,
9182            'overflow-y': this.overflowY
9183        });
9184    };
9185    // Causes any 'auto' overflow values to resolves to 'scroll' or 'hidden'.
9186    // Useful for preserving scrollbar widths regardless of future resizes.
9187    // Can pass in scrollbarWidths for optimization.
9188    Scroller.prototype.lockOverflow = function (scrollbarWidths) {
9189        var overflowX = this.overflowX;
9190        var overflowY = this.overflowY;
9191        scrollbarWidths = scrollbarWidths || this.getScrollbarWidths();
9192        if (overflowX === 'auto') {
9193            overflowX = (scrollbarWidths.top || scrollbarWidths.bottom || // horizontal scrollbars?
9194                // OR scrolling pane with massless scrollbars?
9195                this.scrollEl[0].scrollWidth - 1 > this.scrollEl[0].clientWidth) ? 'scroll' : 'hidden';
9196        }
9197        if (overflowY === 'auto') {
9198            overflowY = (scrollbarWidths.left || scrollbarWidths.right || // vertical scrollbars?
9199                // OR scrolling pane with massless scrollbars?
9200                this.scrollEl[0].scrollHeight - 1 > this.scrollEl[0].clientHeight) ? 'scroll' : 'hidden';
9201        }
9202        this.scrollEl.css({ 'overflow-x': overflowX, 'overflow-y': overflowY });
9203    };
9204    // Getters / Setters
9205    // -----------------------------------------------------------------------------------------------------------------
9206    Scroller.prototype.setHeight = function (height) {
9207        this.scrollEl.height(height);
9208    };
9209    Scroller.prototype.getScrollTop = function () {
9210        return this.scrollEl.scrollTop();
9211    };
9212    Scroller.prototype.setScrollTop = function (top) {
9213        this.scrollEl.scrollTop(top);
9214    };
9215    Scroller.prototype.getClientWidth = function () {
9216        return this.scrollEl[0].clientWidth;
9217    };
9218    Scroller.prototype.getClientHeight = function () {
9219        return this.scrollEl[0].clientHeight;
9220    };
9221    Scroller.prototype.getScrollbarWidths = function () {
9222        return util_1.getScrollbarWidths(this.scrollEl);
9223    };
9224    return Scroller;
9225}(Class_1.default));
9226exports.default = Scroller;
9227
9228
9229/***/ }),
9230/* 40 */
9231/***/ (function(module, exports, __webpack_require__) {
9232
9233Object.defineProperty(exports, "__esModule", { value: true });
9234var tslib_1 = __webpack_require__(2);
9235var $ = __webpack_require__(3);
9236var util_1 = __webpack_require__(4);
9237var DateComponent_1 = __webpack_require__(219);
9238var GlobalEmitter_1 = __webpack_require__(15);
9239var InteractiveDateComponent = /** @class */ (function (_super) {
9240    tslib_1.__extends(InteractiveDateComponent, _super);
9241    function InteractiveDateComponent(_view, _options) {
9242        var _this = _super.call(this, _view, _options) || this;
9243        // self-config, overridable by subclasses
9244        _this.segSelector = '.fc-event-container > *'; // what constitutes an event element?
9245        if (_this.dateSelectingClass) {
9246            _this.dateClicking = new _this.dateClickingClass(_this);
9247        }
9248        if (_this.dateSelectingClass) {
9249            _this.dateSelecting = new _this.dateSelectingClass(_this);
9250        }
9251        if (_this.eventPointingClass) {
9252            _this.eventPointing = new _this.eventPointingClass(_this);
9253        }
9254        if (_this.eventDraggingClass && _this.eventPointing) {
9255            _this.eventDragging = new _this.eventDraggingClass(_this, _this.eventPointing);
9256        }
9257        if (_this.eventResizingClass && _this.eventPointing) {
9258            _this.eventResizing = new _this.eventResizingClass(_this, _this.eventPointing);
9259        }
9260        if (_this.externalDroppingClass) {
9261            _this.externalDropping = new _this.externalDroppingClass(_this);
9262        }
9263        return _this;
9264    }
9265    // Sets the container element that the view should render inside of, does global DOM-related initializations,
9266    // and renders all the non-date-related content inside.
9267    InteractiveDateComponent.prototype.setElement = function (el) {
9268        _super.prototype.setElement.call(this, el);
9269        if (this.dateClicking) {
9270            this.dateClicking.bindToEl(el);
9271        }
9272        if (this.dateSelecting) {
9273            this.dateSelecting.bindToEl(el);
9274        }
9275        this.bindAllSegHandlersToEl(el);
9276    };
9277    InteractiveDateComponent.prototype.removeElement = function () {
9278        this.endInteractions();
9279        _super.prototype.removeElement.call(this);
9280    };
9281    InteractiveDateComponent.prototype.executeEventUnrender = function () {
9282        this.endInteractions();
9283        _super.prototype.executeEventUnrender.call(this);
9284    };
9285    InteractiveDateComponent.prototype.bindGlobalHandlers = function () {
9286        _super.prototype.bindGlobalHandlers.call(this);
9287        if (this.externalDropping) {
9288            this.externalDropping.bindToDocument();
9289        }
9290    };
9291    InteractiveDateComponent.prototype.unbindGlobalHandlers = function () {
9292        _super.prototype.unbindGlobalHandlers.call(this);
9293        if (this.externalDropping) {
9294            this.externalDropping.unbindFromDocument();
9295        }
9296    };
9297    InteractiveDateComponent.prototype.bindDateHandlerToEl = function (el, name, handler) {
9298        var _this = this;
9299        // attach a handler to the grid's root element.
9300        // jQuery will take care of unregistering them when removeElement gets called.
9301        this.el.on(name, function (ev) {
9302            if (!$(ev.target).is(_this.segSelector + ':not(.fc-helper),' + // directly on an event element
9303                _this.segSelector + ':not(.fc-helper) *,' + // within an event element
9304                '.fc-more,' + // a "more.." link
9305                'a[data-goto]' // a clickable nav link
9306            )) {
9307                return handler.call(_this, ev);
9308            }
9309        });
9310    };
9311    InteractiveDateComponent.prototype.bindAllSegHandlersToEl = function (el) {
9312        [
9313            this.eventPointing,
9314            this.eventDragging,
9315            this.eventResizing
9316        ].forEach(function (eventInteraction) {
9317            if (eventInteraction) {
9318                eventInteraction.bindToEl(el);
9319            }
9320        });
9321    };
9322    InteractiveDateComponent.prototype.bindSegHandlerToEl = function (el, name, handler) {
9323        var _this = this;
9324        el.on(name, this.segSelector, function (ev) {
9325            var segEl = $(ev.currentTarget);
9326            if (!segEl.is('.fc-helper')) {
9327                var seg = segEl.data('fc-seg'); // grab segment data. put there by View::renderEventsPayload
9328                if (seg && !_this.shouldIgnoreEventPointing()) {
9329                    return handler.call(_this, seg, ev); // context will be the Grid
9330                }
9331            }
9332        });
9333    };
9334    InteractiveDateComponent.prototype.shouldIgnoreMouse = function () {
9335        // HACK
9336        // This will still work even though bindDateHandlerToEl doesn't use GlobalEmitter.
9337        return GlobalEmitter_1.default.get().shouldIgnoreMouse();
9338    };
9339    InteractiveDateComponent.prototype.shouldIgnoreTouch = function () {
9340        var view = this._getView();
9341        // On iOS (and Android?) when a new selection is initiated overtop another selection,
9342        // the touchend never fires because the elements gets removed mid-touch-interaction (my theory).
9343        // HACK: simply don't allow this to happen.
9344        // ALSO: prevent selection when an *event* is already raised.
9345        return view.isSelected || view.selectedEvent;
9346    };
9347    InteractiveDateComponent.prototype.shouldIgnoreEventPointing = function () {
9348        // only call the handlers if there is not a drag/resize in progress
9349        return (this.eventDragging && this.eventDragging.isDragging) ||
9350            (this.eventResizing && this.eventResizing.isResizing);
9351    };
9352    InteractiveDateComponent.prototype.canStartSelection = function (seg, ev) {
9353        return util_1.getEvIsTouch(ev) &&
9354            !this.canStartResize(seg, ev) &&
9355            (this.isEventDefDraggable(seg.footprint.eventDef) ||
9356                this.isEventDefResizable(seg.footprint.eventDef));
9357    };
9358    InteractiveDateComponent.prototype.canStartDrag = function (seg, ev) {
9359        return !this.canStartResize(seg, ev) &&
9360            this.isEventDefDraggable(seg.footprint.eventDef);
9361    };
9362    InteractiveDateComponent.prototype.canStartResize = function (seg, ev) {
9363        var view = this._getView();
9364        var eventDef = seg.footprint.eventDef;
9365        return (!util_1.getEvIsTouch(ev) || view.isEventDefSelected(eventDef)) &&
9366            this.isEventDefResizable(eventDef) &&
9367            $(ev.target).is('.fc-resizer');
9368    };
9369    // Kills all in-progress dragging.
9370    // Useful for when public API methods that result in re-rendering are invoked during a drag.
9371    // Also useful for when touch devices misbehave and don't fire their touchend.
9372    InteractiveDateComponent.prototype.endInteractions = function () {
9373        [
9374            this.dateClicking,
9375            this.dateSelecting,
9376            this.eventPointing,
9377            this.eventDragging,
9378            this.eventResizing
9379        ].forEach(function (interaction) {
9380            if (interaction) {
9381                interaction.end();
9382            }
9383        });
9384    };
9385    // Event Drag-n-Drop
9386    // ---------------------------------------------------------------------------------------------------------------
9387    // Computes if the given event is allowed to be dragged by the user
9388    InteractiveDateComponent.prototype.isEventDefDraggable = function (eventDef) {
9389        return this.isEventDefStartEditable(eventDef);
9390    };
9391    InteractiveDateComponent.prototype.isEventDefStartEditable = function (eventDef) {
9392        var isEditable = eventDef.isStartExplicitlyEditable();
9393        if (isEditable == null) {
9394            isEditable = this.opt('eventStartEditable');
9395            if (isEditable == null) {
9396                isEditable = this.isEventDefGenerallyEditable(eventDef);
9397            }
9398        }
9399        return isEditable;
9400    };
9401    InteractiveDateComponent.prototype.isEventDefGenerallyEditable = function (eventDef) {
9402        var isEditable = eventDef.isExplicitlyEditable();
9403        if (isEditable == null) {
9404            isEditable = this.opt('editable');
9405        }
9406        return isEditable;
9407    };
9408    // Event Resizing
9409    // ---------------------------------------------------------------------------------------------------------------
9410    // Computes if the given event is allowed to be resized from its starting edge
9411    InteractiveDateComponent.prototype.isEventDefResizableFromStart = function (eventDef) {
9412        return this.opt('eventResizableFromStart') && this.isEventDefResizable(eventDef);
9413    };
9414    // Computes if the given event is allowed to be resized from its ending edge
9415    InteractiveDateComponent.prototype.isEventDefResizableFromEnd = function (eventDef) {
9416        return this.isEventDefResizable(eventDef);
9417    };
9418    // Computes if the given event is allowed to be resized by the user at all
9419    InteractiveDateComponent.prototype.isEventDefResizable = function (eventDef) {
9420        var isResizable = eventDef.isDurationExplicitlyEditable();
9421        if (isResizable == null) {
9422            isResizable = this.opt('eventDurationEditable');
9423            if (isResizable == null) {
9424                isResizable = this.isEventDefGenerallyEditable(eventDef);
9425            }
9426        }
9427        return isResizable;
9428    };
9429    // Event Mutation / Constraints
9430    // ---------------------------------------------------------------------------------------------------------------
9431    // Diffs the two dates, returning a duration, based on granularity of the grid
9432    // TODO: port isTimeScale into this system?
9433    InteractiveDateComponent.prototype.diffDates = function (a, b) {
9434        if (this.largeUnit) {
9435            return util_1.diffByUnit(a, b, this.largeUnit);
9436        }
9437        else {
9438            return util_1.diffDayTime(a, b);
9439        }
9440    };
9441    // is it allowed, in relation to the view's validRange?
9442    // NOTE: very similar to isExternalInstanceGroupAllowed
9443    InteractiveDateComponent.prototype.isEventInstanceGroupAllowed = function (eventInstanceGroup) {
9444        var view = this._getView();
9445        var dateProfile = this.dateProfile;
9446        var eventFootprints = this.eventRangesToEventFootprints(eventInstanceGroup.getAllEventRanges());
9447        var i;
9448        for (i = 0; i < eventFootprints.length; i++) {
9449            // TODO: just use getAllEventRanges directly
9450            if (!dateProfile.validUnzonedRange.containsRange(eventFootprints[i].componentFootprint.unzonedRange)) {
9451                return false;
9452            }
9453        }
9454        return view.calendar.constraints.isEventInstanceGroupAllowed(eventInstanceGroup);
9455    };
9456    // NOTE: very similar to isEventInstanceGroupAllowed
9457    // when it's a completely anonymous external drag, no event.
9458    InteractiveDateComponent.prototype.isExternalInstanceGroupAllowed = function (eventInstanceGroup) {
9459        var view = this._getView();
9460        var dateProfile = this.dateProfile;
9461        var eventFootprints = this.eventRangesToEventFootprints(eventInstanceGroup.getAllEventRanges());
9462        var i;
9463        for (i = 0; i < eventFootprints.length; i++) {
9464            if (!dateProfile.validUnzonedRange.containsRange(eventFootprints[i].componentFootprint.unzonedRange)) {
9465                return false;
9466            }
9467        }
9468        for (i = 0; i < eventFootprints.length; i++) {
9469            // treat it as a selection
9470            // TODO: pass in eventInstanceGroup instead
9471            //  because we don't want calendar's constraint system to depend on a component's
9472            //  determination of footprints.
9473            if (!view.calendar.constraints.isSelectionFootprintAllowed(eventFootprints[i].componentFootprint)) {
9474                return false;
9475            }
9476        }
9477        return true;
9478    };
9479    return InteractiveDateComponent;
9480}(DateComponent_1.default));
9481exports.default = InteractiveDateComponent;
9482
9483
9484/***/ }),
9485/* 41 */
9486/***/ (function(module, exports, __webpack_require__) {
9487
9488Object.defineProperty(exports, "__esModule", { value: true });
9489var tslib_1 = __webpack_require__(2);
9490var $ = __webpack_require__(3);
9491var moment = __webpack_require__(0);
9492var util_1 = __webpack_require__(4);
9493var RenderQueue_1 = __webpack_require__(218);
9494var DateProfileGenerator_1 = __webpack_require__(221);
9495var InteractiveDateComponent_1 = __webpack_require__(40);
9496var GlobalEmitter_1 = __webpack_require__(15);
9497var UnzonedRange_1 = __webpack_require__(5);
9498/* An abstract class from which other views inherit from
9499----------------------------------------------------------------------------------------------------------------------*/
9500var View = /** @class */ (function (_super) {
9501    tslib_1.__extends(View, _super);
9502    function View(calendar, viewSpec) {
9503        var _this = _super.call(this, null, viewSpec.options) || this;
9504        _this.batchRenderDepth = 0;
9505        _this.isSelected = false; // boolean whether a range of time is user-selected or not
9506        _this.calendar = calendar;
9507        _this.viewSpec = viewSpec;
9508        // shortcuts
9509        _this.type = viewSpec.type;
9510        // .name is deprecated
9511        _this.name = _this.type;
9512        _this.initRenderQueue();
9513        _this.initHiddenDays();
9514        _this.dateProfileGenerator = new _this.dateProfileGeneratorClass(_this);
9515        _this.bindBaseRenderHandlers();
9516        _this.eventOrderSpecs = util_1.parseFieldSpecs(_this.opt('eventOrder'));
9517        // legacy
9518        if (_this['initialize']) {
9519            _this['initialize']();
9520        }
9521        return _this;
9522    }
9523    View.prototype._getView = function () {
9524        return this;
9525    };
9526    // Retrieves an option with the given name
9527    View.prototype.opt = function (name) {
9528        return this.options[name];
9529    };
9530    /* Render Queue
9531    ------------------------------------------------------------------------------------------------------------------*/
9532    View.prototype.initRenderQueue = function () {
9533        this.renderQueue = new RenderQueue_1.default({
9534            event: this.opt('eventRenderWait')
9535        });
9536        this.renderQueue.on('start', this.onRenderQueueStart.bind(this));
9537        this.renderQueue.on('stop', this.onRenderQueueStop.bind(this));
9538        this.on('before:change', this.startBatchRender);
9539        this.on('change', this.stopBatchRender);
9540    };
9541    View.prototype.onRenderQueueStart = function () {
9542        this.calendar.freezeContentHeight();
9543        this.addScroll(this.queryScroll());
9544    };
9545    View.prototype.onRenderQueueStop = function () {
9546        if (this.calendar.updateViewSize()) {
9547            this.popScroll();
9548        }
9549        this.calendar.thawContentHeight();
9550    };
9551    View.prototype.startBatchRender = function () {
9552        if (!(this.batchRenderDepth++)) {
9553            this.renderQueue.pause();
9554        }
9555    };
9556    View.prototype.stopBatchRender = function () {
9557        if (!(--this.batchRenderDepth)) {
9558            this.renderQueue.resume();
9559        }
9560    };
9561    View.prototype.requestRender = function (func, namespace, actionType) {
9562        this.renderQueue.queue(func, namespace, actionType);
9563    };
9564    // given func will auto-bind to `this`
9565    View.prototype.whenSizeUpdated = function (func) {
9566        if (this.renderQueue.isRunning) {
9567            this.renderQueue.one('stop', func.bind(this));
9568        }
9569        else {
9570            func.call(this);
9571        }
9572    };
9573    /* Title and Date Formatting
9574    ------------------------------------------------------------------------------------------------------------------*/
9575    // Computes what the title at the top of the calendar should be for this view
9576    View.prototype.computeTitle = function (dateProfile) {
9577        var unzonedRange;
9578        // for views that span a large unit of time, show the proper interval, ignoring stray days before and after
9579        if (/^(year|month)$/.test(dateProfile.currentRangeUnit)) {
9580            unzonedRange = dateProfile.currentUnzonedRange;
9581        }
9582        else {
9583            unzonedRange = dateProfile.activeUnzonedRange;
9584        }
9585        return this.formatRange({
9586            start: this.calendar.msToMoment(unzonedRange.startMs, dateProfile.isRangeAllDay),
9587            end: this.calendar.msToMoment(unzonedRange.endMs, dateProfile.isRangeAllDay)
9588        }, dateProfile.isRangeAllDay, this.opt('titleFormat') || this.computeTitleFormat(dateProfile), this.opt('titleRangeSeparator'));
9589    };
9590    // Generates the format string that should be used to generate the title for the current date range.
9591    // Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`.
9592    View.prototype.computeTitleFormat = function (dateProfile) {
9593        var currentRangeUnit = dateProfile.currentRangeUnit;
9594        if (currentRangeUnit === 'year') {
9595            return 'YYYY';
9596        }
9597        else if (currentRangeUnit === 'month') {
9598            return this.opt('monthYearFormat'); // like "September 2014"
9599        }
9600        else if (dateProfile.currentUnzonedRange.as('days') > 1) {
9601            return 'll'; // multi-day range. shorter, like "Sep 9 - 10 2014"
9602        }
9603        else {
9604            return 'LL'; // one day. longer, like "September 9 2014"
9605        }
9606    };
9607    // Date Setting/Unsetting
9608    // -----------------------------------------------------------------------------------------------------------------
9609    View.prototype.setDate = function (date) {
9610        var currentDateProfile = this.get('dateProfile');
9611        var newDateProfile = this.dateProfileGenerator.build(date, undefined, true); // forceToValid=true
9612        if (!currentDateProfile ||
9613            !currentDateProfile.activeUnzonedRange.equals(newDateProfile.activeUnzonedRange)) {
9614            this.set('dateProfile', newDateProfile);
9615        }
9616    };
9617    View.prototype.unsetDate = function () {
9618        this.unset('dateProfile');
9619    };
9620    // Event Data
9621    // -----------------------------------------------------------------------------------------------------------------
9622    View.prototype.fetchInitialEvents = function (dateProfile) {
9623        var calendar = this.calendar;
9624        var forceAllDay = dateProfile.isRangeAllDay && !this.usesMinMaxTime;
9625        return calendar.requestEvents(calendar.msToMoment(dateProfile.activeUnzonedRange.startMs, forceAllDay), calendar.msToMoment(dateProfile.activeUnzonedRange.endMs, forceAllDay));
9626    };
9627    View.prototype.bindEventChanges = function () {
9628        this.listenTo(this.calendar, 'eventsReset', this.resetEvents); // TODO: make this a real event
9629    };
9630    View.prototype.unbindEventChanges = function () {
9631        this.stopListeningTo(this.calendar, 'eventsReset');
9632    };
9633    View.prototype.setEvents = function (eventsPayload) {
9634        this.set('currentEvents', eventsPayload);
9635        this.set('hasEvents', true);
9636    };
9637    View.prototype.unsetEvents = function () {
9638        this.unset('currentEvents');
9639        this.unset('hasEvents');
9640    };
9641    View.prototype.resetEvents = function (eventsPayload) {
9642        this.startBatchRender();
9643        this.unsetEvents();
9644        this.setEvents(eventsPayload);
9645        this.stopBatchRender();
9646    };
9647    // Date High-level Rendering
9648    // -----------------------------------------------------------------------------------------------------------------
9649    View.prototype.requestDateRender = function (dateProfile) {
9650        var _this = this;
9651        this.requestRender(function () {
9652            _this.executeDateRender(dateProfile);
9653        }, 'date', 'init');
9654    };
9655    View.prototype.requestDateUnrender = function () {
9656        var _this = this;
9657        this.requestRender(function () {
9658            _this.executeDateUnrender();
9659        }, 'date', 'destroy');
9660    };
9661    // if dateProfile not specified, uses current
9662    View.prototype.executeDateRender = function (dateProfile) {
9663        _super.prototype.executeDateRender.call(this, dateProfile);
9664        if (this['render']) {
9665            this['render'](); // TODO: deprecate
9666        }
9667        this.trigger('datesRendered');
9668        this.addScroll({ isDateInit: true });
9669        this.startNowIndicator(); // shouldn't render yet because updateSize will be called soon
9670    };
9671    View.prototype.executeDateUnrender = function () {
9672        this.unselect();
9673        this.stopNowIndicator();
9674        this.trigger('before:datesUnrendered');
9675        if (this['destroy']) {
9676            this['destroy'](); // TODO: deprecate
9677        }
9678        _super.prototype.executeDateUnrender.call(this);
9679    };
9680    // "Base" rendering
9681    // -----------------------------------------------------------------------------------------------------------------
9682    View.prototype.bindBaseRenderHandlers = function () {
9683        var _this = this;
9684        this.on('datesRendered', function () {
9685            _this.whenSizeUpdated(_this.triggerViewRender);
9686        });
9687        this.on('before:datesUnrendered', function () {
9688            _this.triggerViewDestroy();
9689        });
9690    };
9691    View.prototype.triggerViewRender = function () {
9692        this.publiclyTrigger('viewRender', {
9693            context: this,
9694            args: [this, this.el]
9695        });
9696    };
9697    View.prototype.triggerViewDestroy = function () {
9698        this.publiclyTrigger('viewDestroy', {
9699            context: this,
9700            args: [this, this.el]
9701        });
9702    };
9703    // Event High-level Rendering
9704    // -----------------------------------------------------------------------------------------------------------------
9705    View.prototype.requestEventsRender = function (eventsPayload) {
9706        var _this = this;
9707        this.requestRender(function () {
9708            _this.executeEventRender(eventsPayload);
9709            _this.whenSizeUpdated(_this.triggerAfterEventsRendered);
9710        }, 'event', 'init');
9711    };
9712    View.prototype.requestEventsUnrender = function () {
9713        var _this = this;
9714        this.requestRender(function () {
9715            _this.triggerBeforeEventsDestroyed();
9716            _this.executeEventUnrender();
9717        }, 'event', 'destroy');
9718    };
9719    // Business Hour High-level Rendering
9720    // -----------------------------------------------------------------------------------------------------------------
9721    View.prototype.requestBusinessHoursRender = function (businessHourGenerator) {
9722        var _this = this;
9723        this.requestRender(function () {
9724            _this.renderBusinessHours(businessHourGenerator);
9725        }, 'businessHours', 'init');
9726    };
9727    View.prototype.requestBusinessHoursUnrender = function () {
9728        var _this = this;
9729        this.requestRender(function () {
9730            _this.unrenderBusinessHours();
9731        }, 'businessHours', 'destroy');
9732    };
9733    // Misc view rendering utils
9734    // -----------------------------------------------------------------------------------------------------------------
9735    // Binds DOM handlers to elements that reside outside the view container, such as the document
9736    View.prototype.bindGlobalHandlers = function () {
9737        _super.prototype.bindGlobalHandlers.call(this);
9738        this.listenTo(GlobalEmitter_1.default.get(), {
9739            touchstart: this.processUnselect,
9740            mousedown: this.handleDocumentMousedown
9741        });
9742    };
9743    // Unbinds DOM handlers from elements that reside outside the view container
9744    View.prototype.unbindGlobalHandlers = function () {
9745        _super.prototype.unbindGlobalHandlers.call(this);
9746        this.stopListeningTo(GlobalEmitter_1.default.get());
9747    };
9748    /* Now Indicator
9749    ------------------------------------------------------------------------------------------------------------------*/
9750    // Immediately render the current time indicator and begins re-rendering it at an interval,
9751    // which is defined by this.getNowIndicatorUnit().
9752    // TODO: somehow do this for the current whole day's background too
9753    View.prototype.startNowIndicator = function () {
9754        var _this = this;
9755        var unit;
9756        var update;
9757        var delay; // ms wait value
9758        if (this.opt('nowIndicator')) {
9759            unit = this.getNowIndicatorUnit();
9760            if (unit) {
9761                update = util_1.proxy(this, 'updateNowIndicator'); // bind to `this`
9762                this.initialNowDate = this.calendar.getNow();
9763                this.initialNowQueriedMs = new Date().valueOf();
9764                // wait until the beginning of the next interval
9765                delay = this.initialNowDate.clone().startOf(unit).add(1, unit).valueOf() - this.initialNowDate.valueOf();
9766                this.nowIndicatorTimeoutID = setTimeout(function () {
9767                    _this.nowIndicatorTimeoutID = null;
9768                    update();
9769                    delay = +moment.duration(1, unit);
9770                    delay = Math.max(100, delay); // prevent too frequent
9771                    _this.nowIndicatorIntervalID = setInterval(update, delay); // update every interval
9772                }, delay);
9773            }
9774            // rendering will be initiated in updateSize
9775        }
9776    };
9777    // rerenders the now indicator, computing the new current time from the amount of time that has passed
9778    // since the initial getNow call.
9779    View.prototype.updateNowIndicator = function () {
9780        if (this.isDatesRendered &&
9781            this.initialNowDate // activated before?
9782        ) {
9783            this.unrenderNowIndicator(); // won't unrender if unnecessary
9784            this.renderNowIndicator(this.initialNowDate.clone().add(new Date().valueOf() - this.initialNowQueriedMs) // add ms
9785            );
9786            this.isNowIndicatorRendered = true;
9787        }
9788    };
9789    // Immediately unrenders the view's current time indicator and stops any re-rendering timers.
9790    // Won't cause side effects if indicator isn't rendered.
9791    View.prototype.stopNowIndicator = function () {
9792        if (this.isNowIndicatorRendered) {
9793            if (this.nowIndicatorTimeoutID) {
9794                clearTimeout(this.nowIndicatorTimeoutID);
9795                this.nowIndicatorTimeoutID = null;
9796            }
9797            if (this.nowIndicatorIntervalID) {
9798                clearInterval(this.nowIndicatorIntervalID);
9799                this.nowIndicatorIntervalID = null;
9800            }
9801            this.unrenderNowIndicator();
9802            this.isNowIndicatorRendered = false;
9803        }
9804    };
9805    /* Dimensions
9806    ------------------------------------------------------------------------------------------------------------------*/
9807    View.prototype.updateSize = function (totalHeight, isAuto, isResize) {
9808        if (this['setHeight']) {
9809            this['setHeight'](totalHeight, isAuto);
9810        }
9811        else {
9812            _super.prototype.updateSize.call(this, totalHeight, isAuto, isResize);
9813        }
9814        this.updateNowIndicator();
9815    };
9816    /* Scroller
9817    ------------------------------------------------------------------------------------------------------------------*/
9818    View.prototype.addScroll = function (scroll) {
9819        var queuedScroll = this.queuedScroll || (this.queuedScroll = {});
9820        $.extend(queuedScroll, scroll);
9821    };
9822    View.prototype.popScroll = function () {
9823        this.applyQueuedScroll();
9824        this.queuedScroll = null;
9825    };
9826    View.prototype.applyQueuedScroll = function () {
9827        if (this.queuedScroll) {
9828            this.applyScroll(this.queuedScroll);
9829        }
9830    };
9831    View.prototype.queryScroll = function () {
9832        var scroll = {};
9833        if (this.isDatesRendered) {
9834            $.extend(scroll, this.queryDateScroll());
9835        }
9836        return scroll;
9837    };
9838    View.prototype.applyScroll = function (scroll) {
9839        if (scroll.isDateInit && this.isDatesRendered) {
9840            $.extend(scroll, this.computeInitialDateScroll());
9841        }
9842        if (this.isDatesRendered) {
9843            this.applyDateScroll(scroll);
9844        }
9845    };
9846    View.prototype.computeInitialDateScroll = function () {
9847        return {}; // subclasses must implement
9848    };
9849    View.prototype.queryDateScroll = function () {
9850        return {}; // subclasses must implement
9851    };
9852    View.prototype.applyDateScroll = function (scroll) {
9853        // subclasses must implement
9854    };
9855    /* Event Drag-n-Drop
9856    ------------------------------------------------------------------------------------------------------------------*/
9857    View.prototype.reportEventDrop = function (eventInstance, eventMutation, el, ev) {
9858        var eventManager = this.calendar.eventManager;
9859        var undoFunc = eventManager.mutateEventsWithId(eventInstance.def.id, eventMutation);
9860        var dateMutation = eventMutation.dateMutation;
9861        // update the EventInstance, for handlers
9862        if (dateMutation) {
9863            eventInstance.dateProfile = dateMutation.buildNewDateProfile(eventInstance.dateProfile, this.calendar);
9864        }
9865        this.triggerEventDrop(eventInstance, 
9866        // a drop doesn't necessarily mean a date mutation (ex: resource change)
9867        (dateMutation && dateMutation.dateDelta) || moment.duration(), undoFunc, el, ev);
9868    };
9869    // Triggers event-drop handlers that have subscribed via the API
9870    View.prototype.triggerEventDrop = function (eventInstance, dateDelta, undoFunc, el, ev) {
9871        this.publiclyTrigger('eventDrop', {
9872            context: el[0],
9873            args: [
9874                eventInstance.toLegacy(),
9875                dateDelta,
9876                undoFunc,
9877                ev,
9878                {},
9879                this
9880            ]
9881        });
9882    };
9883    /* External Element Drag-n-Drop
9884    ------------------------------------------------------------------------------------------------------------------*/
9885    // Must be called when an external element, via jQuery UI, has been dropped onto the calendar.
9886    // `meta` is the parsed data that has been embedded into the dragging event.
9887    // `dropLocation` is an object that contains the new zoned start/end/allDay values for the event.
9888    View.prototype.reportExternalDrop = function (singleEventDef, isEvent, isSticky, el, ev, ui) {
9889        if (isEvent) {
9890            this.calendar.eventManager.addEventDef(singleEventDef, isSticky);
9891        }
9892        this.triggerExternalDrop(singleEventDef, isEvent, el, ev, ui);
9893    };
9894    // Triggers external-drop handlers that have subscribed via the API
9895    View.prototype.triggerExternalDrop = function (singleEventDef, isEvent, el, ev, ui) {
9896        // trigger 'drop' regardless of whether element represents an event
9897        this.publiclyTrigger('drop', {
9898            context: el[0],
9899            args: [
9900                singleEventDef.dateProfile.start.clone(),
9901                ev,
9902                ui,
9903                this
9904            ]
9905        });
9906        if (isEvent) {
9907            // signal an external event landed
9908            this.publiclyTrigger('eventReceive', {
9909                context: this,
9910                args: [
9911                    singleEventDef.buildInstance().toLegacy(),
9912                    this
9913                ]
9914            });
9915        }
9916    };
9917    /* Event Resizing
9918    ------------------------------------------------------------------------------------------------------------------*/
9919    // Must be called when an event in the view has been resized to a new length
9920    View.prototype.reportEventResize = function (eventInstance, eventMutation, el, ev) {
9921        var eventManager = this.calendar.eventManager;
9922        var undoFunc = eventManager.mutateEventsWithId(eventInstance.def.id, eventMutation);
9923        // update the EventInstance, for handlers
9924        eventInstance.dateProfile = eventMutation.dateMutation.buildNewDateProfile(eventInstance.dateProfile, this.calendar);
9925        this.triggerEventResize(eventInstance, eventMutation.dateMutation.endDelta, undoFunc, el, ev);
9926    };
9927    // Triggers event-resize handlers that have subscribed via the API
9928    View.prototype.triggerEventResize = function (eventInstance, durationDelta, undoFunc, el, ev) {
9929        this.publiclyTrigger('eventResize', {
9930            context: el[0],
9931            args: [
9932                eventInstance.toLegacy(),
9933                durationDelta,
9934                undoFunc,
9935                ev,
9936                {},
9937                this
9938            ]
9939        });
9940    };
9941    /* Selection (time range)
9942    ------------------------------------------------------------------------------------------------------------------*/
9943    // Selects a date span on the view. `start` and `end` are both Moments.
9944    // `ev` is the native mouse event that begin the interaction.
9945    View.prototype.select = function (footprint, ev) {
9946        this.unselect(ev);
9947        this.renderSelectionFootprint(footprint);
9948        this.reportSelection(footprint, ev);
9949    };
9950    View.prototype.renderSelectionFootprint = function (footprint) {
9951        if (this['renderSelection']) {
9952            this['renderSelection'](footprint.toLegacy(this.calendar));
9953        }
9954        else {
9955            _super.prototype.renderSelectionFootprint.call(this, footprint);
9956        }
9957    };
9958    // Called when a new selection is made. Updates internal state and triggers handlers.
9959    View.prototype.reportSelection = function (footprint, ev) {
9960        this.isSelected = true;
9961        this.triggerSelect(footprint, ev);
9962    };
9963    // Triggers handlers to 'select'
9964    View.prototype.triggerSelect = function (footprint, ev) {
9965        var dateProfile = this.calendar.footprintToDateProfile(footprint); // abuse of "Event"DateProfile?
9966        this.publiclyTrigger('select', {
9967            context: this,
9968            args: [
9969                dateProfile.start,
9970                dateProfile.end,
9971                ev,
9972                this
9973            ]
9974        });
9975    };
9976    // Undoes a selection. updates in the internal state and triggers handlers.
9977    // `ev` is the native mouse event that began the interaction.
9978    View.prototype.unselect = function (ev) {
9979        if (this.isSelected) {
9980            this.isSelected = false;
9981            if (this['destroySelection']) {
9982                this['destroySelection'](); // TODO: deprecate
9983            }
9984            this.unrenderSelection();
9985            this.publiclyTrigger('unselect', {
9986                context: this,
9987                args: [ev, this]
9988            });
9989        }
9990    };
9991    /* Event Selection
9992    ------------------------------------------------------------------------------------------------------------------*/
9993    View.prototype.selectEventInstance = function (eventInstance) {
9994        if (!this.selectedEventInstance ||
9995            this.selectedEventInstance !== eventInstance) {
9996            this.unselectEventInstance();
9997            this.getEventSegs().forEach(function (seg) {
9998                if (seg.footprint.eventInstance === eventInstance &&
9999                    seg.el // necessary?
10000                ) {
10001                    seg.el.addClass('fc-selected');
10002                }
10003            });
10004            this.selectedEventInstance = eventInstance;
10005        }
10006    };
10007    View.prototype.unselectEventInstance = function () {
10008        if (this.selectedEventInstance) {
10009            this.getEventSegs().forEach(function (seg) {
10010                if (seg.el) {
10011                    seg.el.removeClass('fc-selected');
10012                }
10013            });
10014            this.selectedEventInstance = null;
10015        }
10016    };
10017    View.prototype.isEventDefSelected = function (eventDef) {
10018        // event references might change on refetchEvents(), while selectedEventInstance doesn't,
10019        // so compare IDs
10020        return this.selectedEventInstance && this.selectedEventInstance.def.id === eventDef.id;
10021    };
10022    /* Mouse / Touch Unselecting (time range & event unselection)
10023    ------------------------------------------------------------------------------------------------------------------*/
10024    // TODO: move consistently to down/start or up/end?
10025    // TODO: don't kill previous selection if touch scrolling
10026    View.prototype.handleDocumentMousedown = function (ev) {
10027        if (util_1.isPrimaryMouseButton(ev)) {
10028            this.processUnselect(ev);
10029        }
10030    };
10031    View.prototype.processUnselect = function (ev) {
10032        this.processRangeUnselect(ev);
10033        this.processEventUnselect(ev);
10034    };
10035    View.prototype.processRangeUnselect = function (ev) {
10036        var ignore;
10037        // is there a time-range selection?
10038        if (this.isSelected && this.opt('unselectAuto')) {
10039            // only unselect if the clicked element is not identical to or inside of an 'unselectCancel' element
10040            ignore = this.opt('unselectCancel');
10041            if (!ignore || !$(ev.target).closest(ignore).length) {
10042                this.unselect(ev);
10043            }
10044        }
10045    };
10046    View.prototype.processEventUnselect = function (ev) {
10047        if (this.selectedEventInstance) {
10048            if (!$(ev.target).closest('.fc-selected').length) {
10049                this.unselectEventInstance();
10050            }
10051        }
10052    };
10053    /* Triggers
10054    ------------------------------------------------------------------------------------------------------------------*/
10055    View.prototype.triggerBaseRendered = function () {
10056        this.publiclyTrigger('viewRender', {
10057            context: this,
10058            args: [this, this.el]
10059        });
10060    };
10061    View.prototype.triggerBaseUnrendered = function () {
10062        this.publiclyTrigger('viewDestroy', {
10063            context: this,
10064            args: [this, this.el]
10065        });
10066    };
10067    // Triggers handlers to 'dayClick'
10068    // Span has start/end of the clicked area. Only the start is useful.
10069    View.prototype.triggerDayClick = function (footprint, dayEl, ev) {
10070        var dateProfile = this.calendar.footprintToDateProfile(footprint); // abuse of "Event"DateProfile?
10071        this.publiclyTrigger('dayClick', {
10072            context: dayEl,
10073            args: [dateProfile.start, ev, this]
10074        });
10075    };
10076    /* Date Utils
10077    ------------------------------------------------------------------------------------------------------------------*/
10078    // For DateComponent::getDayClasses
10079    View.prototype.isDateInOtherMonth = function (date, dateProfile) {
10080        return false;
10081    };
10082    // Arguments after name will be forwarded to a hypothetical function value
10083    // WARNING: passed-in arguments will be given to generator functions as-is and can cause side-effects.
10084    // Always clone your objects if you fear mutation.
10085    View.prototype.getUnzonedRangeOption = function (name) {
10086        var val = this.opt(name);
10087        if (typeof val === 'function') {
10088            val = val.apply(null, Array.prototype.slice.call(arguments, 1));
10089        }
10090        if (val) {
10091            return this.calendar.parseUnzonedRange(val);
10092        }
10093    };
10094    /* Hidden Days
10095    ------------------------------------------------------------------------------------------------------------------*/
10096    // Initializes internal variables related to calculating hidden days-of-week
10097    View.prototype.initHiddenDays = function () {
10098        var hiddenDays = this.opt('hiddenDays') || []; // array of day-of-week indices that are hidden
10099        var isHiddenDayHash = []; // is the day-of-week hidden? (hash with day-of-week-index -> bool)
10100        var dayCnt = 0;
10101        var i;
10102        if (this.opt('weekends') === false) {
10103            hiddenDays.push(0, 6); // 0=sunday, 6=saturday
10104        }
10105        for (i = 0; i < 7; i++) {
10106            if (!(isHiddenDayHash[i] = $.inArray(i, hiddenDays) !== -1)) {
10107                dayCnt++;
10108            }
10109        }
10110        if (!dayCnt) {
10111            throw new Error('invalid hiddenDays'); // all days were hidden? bad.
10112        }
10113        this.isHiddenDayHash = isHiddenDayHash;
10114    };
10115    // Remove days from the beginning and end of the range that are computed as hidden.
10116    // If the whole range is trimmed off, returns null
10117    View.prototype.trimHiddenDays = function (inputUnzonedRange) {
10118        var start = inputUnzonedRange.getStart();
10119        var end = inputUnzonedRange.getEnd();
10120        if (start) {
10121            start = this.skipHiddenDays(start);
10122        }
10123        if (end) {
10124            end = this.skipHiddenDays(end, -1, true);
10125        }
10126        if (start === null || end === null || start < end) {
10127            return new UnzonedRange_1.default(start, end);
10128        }
10129        return null;
10130    };
10131    // Is the current day hidden?
10132    // `day` is a day-of-week index (0-6), or a Moment
10133    View.prototype.isHiddenDay = function (day) {
10134        if (moment.isMoment(day)) {
10135            day = day.day();
10136        }
10137        return this.isHiddenDayHash[day];
10138    };
10139    // Incrementing the current day until it is no longer a hidden day, returning a copy.
10140    // DOES NOT CONSIDER validUnzonedRange!
10141    // If the initial value of `date` is not a hidden day, don't do anything.
10142    // Pass `isExclusive` as `true` if you are dealing with an end date.
10143    // `inc` defaults to `1` (increment one day forward each time)
10144    View.prototype.skipHiddenDays = function (date, inc, isExclusive) {
10145        if (inc === void 0) { inc = 1; }
10146        if (isExclusive === void 0) { isExclusive = false; }
10147        var out = date.clone();
10148        while (this.isHiddenDayHash[(out.day() + (isExclusive ? inc : 0) + 7) % 7]) {
10149            out.add(inc, 'days');
10150        }
10151        return out;
10152    };
10153    return View;
10154}(InteractiveDateComponent_1.default));
10155exports.default = View;
10156View.prototype.usesMinMaxTime = false;
10157View.prototype.dateProfileGeneratorClass = DateProfileGenerator_1.default;
10158View.watch('displayingDates', ['isInDom', 'dateProfile'], function (deps) {
10159    this.requestDateRender(deps.dateProfile);
10160}, function () {
10161    this.requestDateUnrender();
10162});
10163View.watch('displayingBusinessHours', ['displayingDates', 'businessHourGenerator'], function (deps) {
10164    this.requestBusinessHoursRender(deps.businessHourGenerator);
10165}, function () {
10166    this.requestBusinessHoursUnrender();
10167});
10168View.watch('initialEvents', ['dateProfile'], function (deps) {
10169    return this.fetchInitialEvents(deps.dateProfile);
10170});
10171View.watch('bindingEvents', ['initialEvents'], function (deps) {
10172    this.setEvents(deps.initialEvents);
10173    this.bindEventChanges();
10174}, function () {
10175    this.unbindEventChanges();
10176    this.unsetEvents();
10177});
10178View.watch('displayingEvents', ['displayingDates', 'hasEvents'], function () {
10179    this.requestEventsRender(this.get('currentEvents'));
10180}, function () {
10181    this.requestEventsUnrender();
10182});
10183View.watch('title', ['dateProfile'], function (deps) {
10184    return (this.title = this.computeTitle(deps.dateProfile)); // assign to View for legacy reasons
10185});
10186View.watch('legacyDateProps', ['dateProfile'], function (deps) {
10187    var calendar = this.calendar;
10188    var dateProfile = deps.dateProfile;
10189    // DEPRECATED, but we need to keep it updated...
10190    this.start = calendar.msToMoment(dateProfile.activeUnzonedRange.startMs, dateProfile.isRangeAllDay);
10191    this.end = calendar.msToMoment(dateProfile.activeUnzonedRange.endMs, dateProfile.isRangeAllDay);
10192    this.intervalStart = calendar.msToMoment(dateProfile.currentUnzonedRange.startMs, dateProfile.isRangeAllDay);
10193    this.intervalEnd = calendar.msToMoment(dateProfile.currentUnzonedRange.endMs, dateProfile.isRangeAllDay);
10194});
10195
10196
10197/***/ }),
10198/* 42 */
10199/***/ (function(module, exports, __webpack_require__) {
10200
10201Object.defineProperty(exports, "__esModule", { value: true });
10202var $ = __webpack_require__(3);
10203var util_1 = __webpack_require__(4);
10204var EventRenderer = /** @class */ (function () {
10205    function EventRenderer(component, fillRenderer) {
10206        this.view = component._getView();
10207        this.component = component;
10208        this.fillRenderer = fillRenderer;
10209    }
10210    EventRenderer.prototype.opt = function (name) {
10211        return this.view.opt(name);
10212    };
10213    // Updates values that rely on options and also relate to range
10214    EventRenderer.prototype.rangeUpdated = function () {
10215        var displayEventTime;
10216        var displayEventEnd;
10217        this.eventTimeFormat =
10218            this.opt('eventTimeFormat') ||
10219                this.opt('timeFormat') || // deprecated
10220                this.computeEventTimeFormat();
10221        displayEventTime = this.opt('displayEventTime');
10222        if (displayEventTime == null) {
10223            displayEventTime = this.computeDisplayEventTime(); // might be based off of range
10224        }
10225        displayEventEnd = this.opt('displayEventEnd');
10226        if (displayEventEnd == null) {
10227            displayEventEnd = this.computeDisplayEventEnd(); // might be based off of range
10228        }
10229        this.displayEventTime = displayEventTime;
10230        this.displayEventEnd = displayEventEnd;
10231    };
10232    EventRenderer.prototype.render = function (eventsPayload) {
10233        var dateProfile = this.component._getDateProfile();
10234        var eventDefId;
10235        var instanceGroup;
10236        var eventRanges;
10237        var bgRanges = [];
10238        var fgRanges = [];
10239        for (eventDefId in eventsPayload) {
10240            instanceGroup = eventsPayload[eventDefId];
10241            eventRanges = instanceGroup.sliceRenderRanges(dateProfile.activeUnzonedRange);
10242            if (instanceGroup.getEventDef().hasBgRendering()) {
10243                bgRanges.push.apply(bgRanges, eventRanges);
10244            }
10245            else {
10246                fgRanges.push.apply(fgRanges, eventRanges);
10247            }
10248        }
10249        this.renderBgRanges(bgRanges);
10250        this.renderFgRanges(fgRanges);
10251    };
10252    EventRenderer.prototype.unrender = function () {
10253        this.unrenderBgRanges();
10254        this.unrenderFgRanges();
10255    };
10256    EventRenderer.prototype.renderFgRanges = function (eventRanges) {
10257        var eventFootprints = this.component.eventRangesToEventFootprints(eventRanges);
10258        var segs = this.component.eventFootprintsToSegs(eventFootprints);
10259        // render an `.el` on each seg
10260        // returns a subset of the segs. segs that were actually rendered
10261        segs = this.renderFgSegEls(segs);
10262        if (this.renderFgSegs(segs) !== false) {
10263            this.fgSegs = segs;
10264        }
10265    };
10266    EventRenderer.prototype.unrenderFgRanges = function () {
10267        this.unrenderFgSegs(this.fgSegs || []);
10268        this.fgSegs = null;
10269    };
10270    EventRenderer.prototype.renderBgRanges = function (eventRanges) {
10271        var eventFootprints = this.component.eventRangesToEventFootprints(eventRanges);
10272        var segs = this.component.eventFootprintsToSegs(eventFootprints);
10273        if (this.renderBgSegs(segs) !== false) {
10274            this.bgSegs = segs;
10275        }
10276    };
10277    EventRenderer.prototype.unrenderBgRanges = function () {
10278        this.unrenderBgSegs();
10279        this.bgSegs = null;
10280    };
10281    EventRenderer.prototype.getSegs = function () {
10282        return (this.bgSegs || []).concat(this.fgSegs || []);
10283    };
10284    // Renders foreground event segments onto the grid
10285    EventRenderer.prototype.renderFgSegs = function (segs) {
10286        // subclasses must implement
10287        // segs already has rendered els, and has been filtered.
10288        return false; // signal failure if not implemented
10289    };
10290    // Unrenders all currently rendered foreground segments
10291    EventRenderer.prototype.unrenderFgSegs = function (segs) {
10292        // subclasses must implement
10293    };
10294    EventRenderer.prototype.renderBgSegs = function (segs) {
10295        var _this = this;
10296        if (this.fillRenderer) {
10297            this.fillRenderer.renderSegs('bgEvent', segs, {
10298                getClasses: function (seg) {
10299                    return _this.getBgClasses(seg.footprint.eventDef);
10300                },
10301                getCss: function (seg) {
10302                    return {
10303                        'background-color': _this.getBgColor(seg.footprint.eventDef)
10304                    };
10305                },
10306                filterEl: function (seg, el) {
10307                    return _this.filterEventRenderEl(seg.footprint, el);
10308                }
10309            });
10310        }
10311        else {
10312            return false; // signal failure if no fillRenderer
10313        }
10314    };
10315    EventRenderer.prototype.unrenderBgSegs = function () {
10316        if (this.fillRenderer) {
10317            this.fillRenderer.unrender('bgEvent');
10318        }
10319    };
10320    // Renders and assigns an `el` property for each foreground event segment.
10321    // Only returns segments that successfully rendered.
10322    EventRenderer.prototype.renderFgSegEls = function (segs, disableResizing) {
10323        var _this = this;
10324        if (disableResizing === void 0) { disableResizing = false; }
10325        var hasEventRenderHandlers = this.view.hasPublicHandlers('eventRender');
10326        var html = '';
10327        var renderedSegs = [];
10328        var i;
10329        if (segs.length) {
10330            // build a large concatenation of event segment HTML
10331            for (i = 0; i < segs.length; i++) {
10332                this.beforeFgSegHtml(segs[i]);
10333                html += this.fgSegHtml(segs[i], disableResizing);
10334            }
10335            // Grab individual elements from the combined HTML string. Use each as the default rendering.
10336            // Then, compute the 'el' for each segment. An el might be null if the eventRender callback returned false.
10337            $(html).each(function (i, node) {
10338                var seg = segs[i];
10339                var el = $(node);
10340                if (hasEventRenderHandlers) {
10341                    el = _this.filterEventRenderEl(seg.footprint, el);
10342                }
10343                if (el) {
10344                    el.data('fc-seg', seg); // used by handlers
10345                    seg.el = el;
10346                    renderedSegs.push(seg);
10347                }
10348            });
10349        }
10350        return renderedSegs;
10351    };
10352    EventRenderer.prototype.beforeFgSegHtml = function (seg) {
10353    };
10354    // Generates the HTML for the default rendering of a foreground event segment. Used by renderFgSegEls()
10355    EventRenderer.prototype.fgSegHtml = function (seg, disableResizing) {
10356        // subclasses should implement
10357    };
10358    // Generic utility for generating the HTML classNames for an event segment's element
10359    EventRenderer.prototype.getSegClasses = function (seg, isDraggable, isResizable) {
10360        var classes = [
10361            'fc-event',
10362            seg.isStart ? 'fc-start' : 'fc-not-start',
10363            seg.isEnd ? 'fc-end' : 'fc-not-end'
10364        ].concat(this.getClasses(seg.footprint.eventDef));
10365        if (isDraggable) {
10366            classes.push('fc-draggable');
10367        }
10368        if (isResizable) {
10369            classes.push('fc-resizable');
10370        }
10371        // event is currently selected? attach a className.
10372        if (this.view.isEventDefSelected(seg.footprint.eventDef)) {
10373            classes.push('fc-selected');
10374        }
10375        return classes;
10376    };
10377    // Given an event and the default element used for rendering, returns the element that should actually be used.
10378    // Basically runs events and elements through the eventRender hook.
10379    EventRenderer.prototype.filterEventRenderEl = function (eventFootprint, el) {
10380        var legacy = eventFootprint.getEventLegacy();
10381        var custom = this.view.publiclyTrigger('eventRender', {
10382            context: legacy,
10383            args: [legacy, el, this.view]
10384        });
10385        if (custom === false) {
10386            el = null;
10387        }
10388        else if (custom && custom !== true) {
10389            el = $(custom);
10390        }
10391        return el;
10392    };
10393    // Compute the text that should be displayed on an event's element.
10394    // `range` can be the Event object itself, or something range-like, with at least a `start`.
10395    // If event times are disabled, or the event has no time, will return a blank string.
10396    // If not specified, formatStr will default to the eventTimeFormat setting,
10397    // and displayEnd will default to the displayEventEnd setting.
10398    EventRenderer.prototype.getTimeText = function (eventFootprint, formatStr, displayEnd) {
10399        return this._getTimeText(eventFootprint.eventInstance.dateProfile.start, eventFootprint.eventInstance.dateProfile.end, eventFootprint.componentFootprint.isAllDay, formatStr, displayEnd);
10400    };
10401    EventRenderer.prototype._getTimeText = function (start, end, isAllDay, formatStr, displayEnd) {
10402        if (formatStr == null) {
10403            formatStr = this.eventTimeFormat;
10404        }
10405        if (displayEnd == null) {
10406            displayEnd = this.displayEventEnd;
10407        }
10408        if (this.displayEventTime && !isAllDay) {
10409            if (displayEnd && end) {
10410                return this.view.formatRange({ start: start, end: end }, false, // allDay
10411                formatStr);
10412            }
10413            else {
10414                return start.format(formatStr);
10415            }
10416        }
10417        return '';
10418    };
10419    EventRenderer.prototype.computeEventTimeFormat = function () {
10420        return this.opt('smallTimeFormat');
10421    };
10422    EventRenderer.prototype.computeDisplayEventTime = function () {
10423        return true;
10424    };
10425    EventRenderer.prototype.computeDisplayEventEnd = function () {
10426        return true;
10427    };
10428    EventRenderer.prototype.getBgClasses = function (eventDef) {
10429        var classNames = this.getClasses(eventDef);
10430        classNames.push('fc-bgevent');
10431        return classNames;
10432    };
10433    EventRenderer.prototype.getClasses = function (eventDef) {
10434        var objs = this.getStylingObjs(eventDef);
10435        var i;
10436        var classNames = [];
10437        for (i = 0; i < objs.length; i++) {
10438            classNames.push.apply(// append
10439            classNames, objs[i].eventClassName || objs[i].className || []);
10440        }
10441        return classNames;
10442    };
10443    // Utility for generating event skin-related CSS properties
10444    EventRenderer.prototype.getSkinCss = function (eventDef) {
10445        return {
10446            'background-color': this.getBgColor(eventDef),
10447            'border-color': this.getBorderColor(eventDef),
10448            color: this.getTextColor(eventDef)
10449        };
10450    };
10451    // Queries for caller-specified color, then falls back to default
10452    EventRenderer.prototype.getBgColor = function (eventDef) {
10453        var objs = this.getStylingObjs(eventDef);
10454        var i;
10455        var val;
10456        for (i = 0; i < objs.length && !val; i++) {
10457            val = objs[i].eventBackgroundColor || objs[i].eventColor ||
10458                objs[i].backgroundColor || objs[i].color;
10459        }
10460        if (!val) {
10461            val = this.opt('eventBackgroundColor') || this.opt('eventColor');
10462        }
10463        return val;
10464    };
10465    // Queries for caller-specified color, then falls back to default
10466    EventRenderer.prototype.getBorderColor = function (eventDef) {
10467        var objs = this.getStylingObjs(eventDef);
10468        var i;
10469        var val;
10470        for (i = 0; i < objs.length && !val; i++) {
10471            val = objs[i].eventBorderColor || objs[i].eventColor ||
10472                objs[i].borderColor || objs[i].color;
10473        }
10474        if (!val) {
10475            val = this.opt('eventBorderColor') || this.opt('eventColor');
10476        }
10477        return val;
10478    };
10479    // Queries for caller-specified color, then falls back to default
10480    EventRenderer.prototype.getTextColor = function (eventDef) {
10481        var objs = this.getStylingObjs(eventDef);
10482        var i;
10483        var val;
10484        for (i = 0; i < objs.length && !val; i++) {
10485            val = objs[i].eventTextColor ||
10486                objs[i].textColor;
10487        }
10488        if (!val) {
10489            val = this.opt('eventTextColor');
10490        }
10491        return val;
10492    };
10493    EventRenderer.prototype.getStylingObjs = function (eventDef) {
10494        var objs = this.getFallbackStylingObjs(eventDef);
10495        objs.unshift(eventDef);
10496        return objs;
10497    };
10498    EventRenderer.prototype.getFallbackStylingObjs = function (eventDef) {
10499        return [eventDef.source];
10500    };
10501    EventRenderer.prototype.sortEventSegs = function (segs) {
10502        segs.sort(util_1.proxy(this, 'compareEventSegs'));
10503    };
10504    // A cmp function for determining which segments should take visual priority
10505    EventRenderer.prototype.compareEventSegs = function (seg1, seg2) {
10506        var f1 = seg1.footprint;
10507        var f2 = seg2.footprint;
10508        var cf1 = f1.componentFootprint;
10509        var cf2 = f2.componentFootprint;
10510        var r1 = cf1.unzonedRange;
10511        var r2 = cf2.unzonedRange;
10512        return r1.startMs - r2.startMs || // earlier events go first
10513            (r2.endMs - r2.startMs) - (r1.endMs - r1.startMs) || // tie? longer events go first
10514            cf2.isAllDay - cf1.isAllDay || // tie? put all-day events first (booleans cast to 0/1)
10515            util_1.compareByFieldSpecs(f1.eventDef, f2.eventDef, this.view.eventOrderSpecs, f1.eventDef.miscProps, f2.eventDef.miscProps);
10516    };
10517    return EventRenderer;
10518}());
10519exports.default = EventRenderer;
10520
10521
10522/***/ }),
10523/* 43 */,
10524/* 44 */,
10525/* 45 */,
10526/* 46 */,
10527/* 47 */
10528/***/ (function(module, exports, __webpack_require__) {
10529
10530Object.defineProperty(exports, "__esModule", { value: true });
10531var moment_ext_1 = __webpack_require__(10);
10532// Plugin
10533// -------------------------------------------------------------------------------------------------
10534moment_ext_1.newMomentProto.format = function () {
10535    if (this._fullCalendar && arguments[0]) {
10536        return formatDate(this, arguments[0]); // our extended formatting
10537    }
10538    if (this._ambigTime) {
10539        return moment_ext_1.oldMomentFormat(englishMoment(this), 'YYYY-MM-DD');
10540    }
10541    if (this._ambigZone) {
10542        return moment_ext_1.oldMomentFormat(englishMoment(this), 'YYYY-MM-DD[T]HH:mm:ss');
10543    }
10544    if (this._fullCalendar) {
10545        // moment.format() doesn't ensure english, but we want to.
10546        return moment_ext_1.oldMomentFormat(englishMoment(this));
10547    }
10548    return moment_ext_1.oldMomentProto.format.apply(this, arguments);
10549};
10550moment_ext_1.newMomentProto.toISOString = function () {
10551    if (this._ambigTime) {
10552        return moment_ext_1.oldMomentFormat(englishMoment(this), 'YYYY-MM-DD');
10553    }
10554    if (this._ambigZone) {
10555        return moment_ext_1.oldMomentFormat(englishMoment(this), 'YYYY-MM-DD[T]HH:mm:ss');
10556    }
10557    if (this._fullCalendar) {
10558        // depending on browser, moment might not output english. ensure english.
10559        // https://github.com/moment/moment/blob/2.18.1/src/lib/moment/format.js#L22
10560        return moment_ext_1.oldMomentProto.toISOString.apply(englishMoment(this), arguments);
10561    }
10562    return moment_ext_1.oldMomentProto.toISOString.apply(this, arguments);
10563};
10564function englishMoment(mom) {
10565    if (mom.locale() !== 'en') {
10566        return mom.clone().locale('en');
10567    }
10568    return mom;
10569}
10570// Config
10571// ---------------------------------------------------------------------------------------------------------------------
10572/*
10573Inserted between chunks in the fake ("intermediate") formatting string.
10574Important that it passes as whitespace (\s) because moment often identifies non-standalone months
10575via a regexp with an \s.
10576*/
10577var PART_SEPARATOR = '\u000b'; // vertical tab
10578/*
10579Inserted as the first character of a literal-text chunk to indicate that the literal text is not actually literal text,
10580but rather, a "special" token that has custom rendering (see specialTokens map).
10581*/
10582var SPECIAL_TOKEN_MARKER = '\u001f'; // information separator 1
10583/*
10584Inserted at the beginning and end of a span of text that must have non-zero numeric characters.
10585Handling of these markers is done in a post-processing step at the very end of text rendering.
10586*/
10587var MAYBE_MARKER = '\u001e'; // information separator 2
10588var MAYBE_REGEXP = new RegExp(MAYBE_MARKER + '([^' + MAYBE_MARKER + ']*)' + MAYBE_MARKER, 'g'); // must be global
10589/*
10590Addition formatting tokens we want recognized
10591*/
10592var specialTokens = {
10593    t: function (date) {
10594        return moment_ext_1.oldMomentFormat(date, 'a').charAt(0);
10595    },
10596    T: function (date) {
10597        return moment_ext_1.oldMomentFormat(date, 'A').charAt(0);
10598    }
10599};
10600/*
10601The first characters of formatting tokens for units that are 1 day or larger.
10602`value` is for ranking relative size (lower means bigger).
10603`unit` is a normalized unit, used for comparing moments.
10604*/
10605var largeTokenMap = {
10606    Y: { value: 1, unit: 'year' },
10607    M: { value: 2, unit: 'month' },
10608    W: { value: 3, unit: 'week' },
10609    w: { value: 3, unit: 'week' },
10610    D: { value: 4, unit: 'day' },
10611    d: { value: 4, unit: 'day' } // day of week
10612};
10613// Single Date Formatting
10614// ---------------------------------------------------------------------------------------------------------------------
10615/*
10616Formats `date` with a Moment formatting string, but allow our non-zero areas and special token
10617*/
10618function formatDate(date, formatStr) {
10619    return renderFakeFormatString(getParsedFormatString(formatStr).fakeFormatString, date);
10620}
10621exports.formatDate = formatDate;
10622// Date Range Formatting
10623// -------------------------------------------------------------------------------------------------
10624// TODO: make it work with timezone offset
10625/*
10626Using a formatting string meant for a single date, generate a range string, like
10627"Sep 2 - 9 2013", that intelligently inserts a separator where the dates differ.
10628If the dates are the same as far as the format string is concerned, just return a single
10629rendering of one date, without any separator.
10630*/
10631function formatRange(date1, date2, formatStr, separator, isRTL) {
10632    var localeData;
10633    date1 = moment_ext_1.default.parseZone(date1);
10634    date2 = moment_ext_1.default.parseZone(date2);
10635    localeData = date1.localeData();
10636    // Expand localized format strings, like "LL" -> "MMMM D YYYY".
10637    // BTW, this is not important for `formatDate` because it is impossible to put custom tokens
10638    // or non-zero areas in Moment's localized format strings.
10639    formatStr = localeData.longDateFormat(formatStr) || formatStr;
10640    return renderParsedFormat(getParsedFormatString(formatStr), date1, date2, separator || ' - ', isRTL);
10641}
10642exports.formatRange = formatRange;
10643/*
10644Renders a range with an already-parsed format string.
10645*/
10646function renderParsedFormat(parsedFormat, date1, date2, separator, isRTL) {
10647    var sameUnits = parsedFormat.sameUnits;
10648    var unzonedDate1 = date1.clone().stripZone(); // for same-unit comparisons
10649    var unzonedDate2 = date2.clone().stripZone(); // "
10650    var renderedParts1 = renderFakeFormatStringParts(parsedFormat.fakeFormatString, date1);
10651    var renderedParts2 = renderFakeFormatStringParts(parsedFormat.fakeFormatString, date2);
10652    var leftI;
10653    var leftStr = '';
10654    var rightI;
10655    var rightStr = '';
10656    var middleI;
10657    var middleStr1 = '';
10658    var middleStr2 = '';
10659    var middleStr = '';
10660    // Start at the leftmost side of the formatting string and continue until you hit a token
10661    // that is not the same between dates.
10662    for (leftI = 0; leftI < sameUnits.length && (!sameUnits[leftI] || unzonedDate1.isSame(unzonedDate2, sameUnits[leftI])); leftI++) {
10663        leftStr += renderedParts1[leftI];
10664    }
10665    // Similarly, start at the rightmost side of the formatting string and move left
10666    for (rightI = sameUnits.length - 1; rightI > leftI && (!sameUnits[rightI] || unzonedDate1.isSame(unzonedDate2, sameUnits[rightI])); rightI--) {
10667        // If current chunk is on the boundary of unique date-content, and is a special-case
10668        // date-formatting postfix character, then don't consume it. Consider it unique date-content.
10669        // TODO: make configurable
10670        if (rightI - 1 === leftI && renderedParts1[rightI] === '.') {
10671            break;
10672        }
10673        rightStr = renderedParts1[rightI] + rightStr;
10674    }
10675    // The area in the middle is different for both of the dates.
10676    // Collect them distinctly so we can jam them together later.
10677    for (middleI = leftI; middleI <= rightI; middleI++) {
10678        middleStr1 += renderedParts1[middleI];
10679        middleStr2 += renderedParts2[middleI];
10680    }
10681    if (middleStr1 || middleStr2) {
10682        if (isRTL) {
10683            middleStr = middleStr2 + separator + middleStr1;
10684        }
10685        else {
10686            middleStr = middleStr1 + separator + middleStr2;
10687        }
10688    }
10689    return processMaybeMarkers(leftStr + middleStr + rightStr);
10690}
10691// Format String Parsing
10692// ---------------------------------------------------------------------------------------------------------------------
10693var parsedFormatStrCache = {};
10694/*
10695Returns a parsed format string, leveraging a cache.
10696*/
10697function getParsedFormatString(formatStr) {
10698    return parsedFormatStrCache[formatStr] ||
10699        (parsedFormatStrCache[formatStr] = parseFormatString(formatStr));
10700}
10701/*
10702Parses a format string into the following:
10703- fakeFormatString: a momentJS formatting string, littered with special control characters that get post-processed.
10704- sameUnits: for every part in fakeFormatString, if the part is a token, the value will be a unit string (like "day"),
10705  that indicates how similar a range's start & end must be in order to share the same formatted text.
10706  If not a token, then the value is null.
10707  Always a flat array (not nested liked "chunks").
10708*/
10709function parseFormatString(formatStr) {
10710    var chunks = chunkFormatString(formatStr);
10711    return {
10712        fakeFormatString: buildFakeFormatString(chunks),
10713        sameUnits: buildSameUnits(chunks)
10714    };
10715}
10716/*
10717Break the formatting string into an array of chunks.
10718A 'maybe' chunk will have nested chunks.
10719*/
10720function chunkFormatString(formatStr) {
10721    var chunks = [];
10722    var match;
10723    // TODO: more descrimination
10724    // \4 is a backreference to the first character of a multi-character set.
10725    var chunker = /\[([^\]]*)\]|\(([^\)]*)\)|(LTS|LT|(\w)\4*o?)|([^\w\[\(]+)/g;
10726    while ((match = chunker.exec(formatStr))) {
10727        if (match[1]) {
10728            chunks.push.apply(chunks, // append
10729            splitStringLiteral(match[1]));
10730        }
10731        else if (match[2]) {
10732            chunks.push({ maybe: chunkFormatString(match[2]) });
10733        }
10734        else if (match[3]) {
10735            chunks.push({ token: match[3] });
10736        }
10737        else if (match[5]) {
10738            chunks.push.apply(chunks, // append
10739            splitStringLiteral(match[5]));
10740        }
10741    }
10742    return chunks;
10743}
10744/*
10745Potentially splits a literal-text string into multiple parts. For special cases.
10746*/
10747function splitStringLiteral(s) {
10748    if (s === '. ') {
10749        return ['.', ' ']; // for locales with periods bound to the end of each year/month/date
10750    }
10751    else {
10752        return [s];
10753    }
10754}
10755/*
10756Given chunks parsed from a real format string, generate a fake (aka "intermediate") format string with special control
10757characters that will eventually be given to moment for formatting, and then post-processed.
10758*/
10759function buildFakeFormatString(chunks) {
10760    var parts = [];
10761    var i;
10762    var chunk;
10763    for (i = 0; i < chunks.length; i++) {
10764        chunk = chunks[i];
10765        if (typeof chunk === 'string') {
10766            parts.push('[' + chunk + ']');
10767        }
10768        else if (chunk.token) {
10769            if (chunk.token in specialTokens) {
10770                parts.push(SPECIAL_TOKEN_MARKER + // useful during post-processing
10771                    '[' + chunk.token + ']' // preserve as literal text
10772                );
10773            }
10774            else {
10775                parts.push(chunk.token); // unprotected text implies a format string
10776            }
10777        }
10778        else if (chunk.maybe) {
10779            parts.push(MAYBE_MARKER + // useful during post-processing
10780                buildFakeFormatString(chunk.maybe) +
10781                MAYBE_MARKER);
10782        }
10783    }
10784    return parts.join(PART_SEPARATOR);
10785}
10786/*
10787Given parsed chunks from a real formatting string, generates an array of unit strings (like "day") that indicate
10788in which regard two dates must be similar in order to share range formatting text.
10789The `chunks` can be nested (because of "maybe" chunks), however, the returned array will be flat.
10790*/
10791function buildSameUnits(chunks) {
10792    var units = [];
10793    var i;
10794    var chunk;
10795    var tokenInfo;
10796    for (i = 0; i < chunks.length; i++) {
10797        chunk = chunks[i];
10798        if (chunk.token) {
10799            tokenInfo = largeTokenMap[chunk.token.charAt(0)];
10800            units.push(tokenInfo ? tokenInfo.unit : 'second'); // default to a very strict same-second
10801        }
10802        else if (chunk.maybe) {
10803            units.push.apply(units, // append
10804            buildSameUnits(chunk.maybe));
10805        }
10806        else {
10807            units.push(null);
10808        }
10809    }
10810    return units;
10811}
10812// Rendering to text
10813// ---------------------------------------------------------------------------------------------------------------------
10814/*
10815Formats a date with a fake format string, post-processes the control characters, then returns.
10816*/
10817function renderFakeFormatString(fakeFormatString, date) {
10818    return processMaybeMarkers(renderFakeFormatStringParts(fakeFormatString, date).join(''));
10819}
10820/*
10821Formats a date into parts that will have been post-processed, EXCEPT for the "maybe" markers.
10822*/
10823function renderFakeFormatStringParts(fakeFormatString, date) {
10824    var parts = [];
10825    var fakeRender = moment_ext_1.oldMomentFormat(date, fakeFormatString);
10826    var fakeParts = fakeRender.split(PART_SEPARATOR);
10827    var i;
10828    var fakePart;
10829    for (i = 0; i < fakeParts.length; i++) {
10830        fakePart = fakeParts[i];
10831        if (fakePart.charAt(0) === SPECIAL_TOKEN_MARKER) {
10832            parts.push(
10833            // the literal string IS the token's name.
10834            // call special token's registered function.
10835            specialTokens[fakePart.substring(1)](date));
10836        }
10837        else {
10838            parts.push(fakePart);
10839        }
10840    }
10841    return parts;
10842}
10843/*
10844Accepts an almost-finally-formatted string and processes the "maybe" control characters, returning a new string.
10845*/
10846function processMaybeMarkers(s) {
10847    return s.replace(MAYBE_REGEXP, function (m0, m1) {
10848        if (m1.match(/[1-9]/)) {
10849            return m1;
10850        }
10851        else {
10852            return '';
10853        }
10854    });
10855}
10856// Misc Utils
10857// -------------------------------------------------------------------------------------------------
10858/*
10859Returns a unit string, either 'year', 'month', 'day', or null for the most granular formatting token in the string.
10860*/
10861function queryMostGranularFormatUnit(formatStr) {
10862    var chunks = chunkFormatString(formatStr);
10863    var i;
10864    var chunk;
10865    var candidate;
10866    var best;
10867    for (i = 0; i < chunks.length; i++) {
10868        chunk = chunks[i];
10869        if (chunk.token) {
10870            candidate = largeTokenMap[chunk.token.charAt(0)];
10871            if (candidate) {
10872                if (!best || candidate.value > best.value) {
10873                    best = candidate;
10874                }
10875            }
10876        }
10877    }
10878    if (best) {
10879        return best.unit;
10880    }
10881    return null;
10882}
10883exports.queryMostGranularFormatUnit = queryMostGranularFormatUnit;
10884
10885
10886/***/ }),
10887/* 48 */
10888/***/ (function(module, exports, __webpack_require__) {
10889
10890Object.defineProperty(exports, "__esModule", { value: true });
10891var tslib_1 = __webpack_require__(2);
10892var Class_1 = __webpack_require__(32);
10893var EmitterMixin_1 = __webpack_require__(11);
10894var ListenerMixin_1 = __webpack_require__(7);
10895var Model = /** @class */ (function (_super) {
10896    tslib_1.__extends(Model, _super);
10897    function Model() {
10898        var _this = _super.call(this) || this;
10899        _this._watchers = {};
10900        _this._props = {};
10901        _this.applyGlobalWatchers();
10902        _this.constructed();
10903        return _this;
10904    }
10905    Model.watch = function (name) {
10906        var args = [];
10907        for (var _i = 1; _i < arguments.length; _i++) {
10908            args[_i - 1] = arguments[_i];
10909        }
10910        // subclasses should make a masked-copy of the superclass's map
10911        // TODO: write test
10912        if (!this.prototype.hasOwnProperty('_globalWatchArgs')) {
10913            this.prototype._globalWatchArgs = Object.create(this.prototype._globalWatchArgs);
10914        }
10915        this.prototype._globalWatchArgs[name] = args;
10916    };
10917    Model.prototype.constructed = function () {
10918        // useful for monkeypatching. TODO: BaseClass?
10919    };
10920    Model.prototype.applyGlobalWatchers = function () {
10921        var map = this._globalWatchArgs;
10922        var name;
10923        for (name in map) {
10924            this.watch.apply(this, [name].concat(map[name]));
10925        }
10926    };
10927    Model.prototype.has = function (name) {
10928        return name in this._props;
10929    };
10930    Model.prototype.get = function (name) {
10931        if (name === undefined) {
10932            return this._props;
10933        }
10934        return this._props[name];
10935    };
10936    Model.prototype.set = function (name, val) {
10937        var newProps;
10938        if (typeof name === 'string') {
10939            newProps = {};
10940            newProps[name] = val === undefined ? null : val;
10941        }
10942        else {
10943            newProps = name;
10944        }
10945        this.setProps(newProps);
10946    };
10947    Model.prototype.reset = function (newProps) {
10948        var oldProps = this._props;
10949        var changeset = {}; // will have undefined's to signal unsets
10950        var name;
10951        for (name in oldProps) {
10952            changeset[name] = undefined;
10953        }
10954        for (name in newProps) {
10955            changeset[name] = newProps[name];
10956        }
10957        this.setProps(changeset);
10958    };
10959    Model.prototype.unset = function (name) {
10960        var newProps = {};
10961        var names;
10962        var i;
10963        if (typeof name === 'string') {
10964            names = [name];
10965        }
10966        else {
10967            names = name;
10968        }
10969        for (i = 0; i < names.length; i++) {
10970            newProps[names[i]] = undefined;
10971        }
10972        this.setProps(newProps);
10973    };
10974    Model.prototype.setProps = function (newProps) {
10975        var changedProps = {};
10976        var changedCnt = 0;
10977        var name;
10978        var val;
10979        for (name in newProps) {
10980            val = newProps[name];
10981            // a change in value?
10982            // if an object, don't check equality, because might have been mutated internally.
10983            // TODO: eventually enforce immutability.
10984            if (typeof val === 'object' ||
10985                val !== this._props[name]) {
10986                changedProps[name] = val;
10987                changedCnt++;
10988            }
10989        }
10990        if (changedCnt) {
10991            this.trigger('before:batchChange', changedProps);
10992            for (name in changedProps) {
10993                val = changedProps[name];
10994                this.trigger('before:change', name, val);
10995                this.trigger('before:change:' + name, val);
10996            }
10997            for (name in changedProps) {
10998                val = changedProps[name];
10999                if (val === undefined) {
11000                    delete this._props[name];
11001                }
11002                else {
11003                    this._props[name] = val;
11004                }
11005                this.trigger('change:' + name, val);
11006                this.trigger('change', name, val);
11007            }
11008            this.trigger('batchChange', changedProps);
11009        }
11010    };
11011    Model.prototype.watch = function (name, depList, startFunc, stopFunc) {
11012        var _this = this;
11013        this.unwatch(name);
11014        this._watchers[name] = this._watchDeps(depList, function (deps) {
11015            var res = startFunc.call(_this, deps);
11016            if (res && res.then) {
11017                _this.unset(name); // put in an unset state while resolving
11018                res.then(function (val) {
11019                    _this.set(name, val);
11020                });
11021            }
11022            else {
11023                _this.set(name, res);
11024            }
11025        }, function (deps) {
11026            _this.unset(name);
11027            if (stopFunc) {
11028                stopFunc.call(_this, deps);
11029            }
11030        });
11031    };
11032    Model.prototype.unwatch = function (name) {
11033        var watcher = this._watchers[name];
11034        if (watcher) {
11035            delete this._watchers[name];
11036            watcher.teardown();
11037        }
11038    };
11039    Model.prototype._watchDeps = function (depList, startFunc, stopFunc) {
11040        var _this = this;
11041        var queuedChangeCnt = 0;
11042        var depCnt = depList.length;
11043        var satisfyCnt = 0;
11044        var values = {}; // what's passed as the `deps` arguments
11045        var bindTuples = []; // array of [ eventName, handlerFunc ] arrays
11046        var isCallingStop = false;
11047        var onBeforeDepChange = function (depName, val, isOptional) {
11048            queuedChangeCnt++;
11049            if (queuedChangeCnt === 1) {
11050                if (satisfyCnt === depCnt) {
11051                    isCallingStop = true;
11052                    stopFunc(values);
11053                    isCallingStop = false;
11054                }
11055            }
11056        };
11057        var onDepChange = function (depName, val, isOptional) {
11058            if (val === undefined) {
11059                // required dependency that was previously set?
11060                if (!isOptional && values[depName] !== undefined) {
11061                    satisfyCnt--;
11062                }
11063                delete values[depName];
11064            }
11065            else {
11066                // required dependency that was previously unset?
11067                if (!isOptional && values[depName] === undefined) {
11068                    satisfyCnt++;
11069                }
11070                values[depName] = val;
11071            }
11072            queuedChangeCnt--;
11073            if (!queuedChangeCnt) {
11074                // now finally satisfied or satisfied all along?
11075                if (satisfyCnt === depCnt) {
11076                    // if the stopFunc initiated another value change, ignore it.
11077                    // it will be processed by another change event anyway.
11078                    if (!isCallingStop) {
11079                        startFunc(values);
11080                    }
11081                }
11082            }
11083        };
11084        // intercept for .on() that remembers handlers
11085        var bind = function (eventName, handler) {
11086            _this.on(eventName, handler);
11087            bindTuples.push([eventName, handler]);
11088        };
11089        // listen to dependency changes
11090        depList.forEach(function (depName) {
11091            var isOptional = false;
11092            if (depName.charAt(0) === '?') {
11093                depName = depName.substring(1);
11094                isOptional = true;
11095            }
11096            bind('before:change:' + depName, function (val) {
11097                onBeforeDepChange(depName, val, isOptional);
11098            });
11099            bind('change:' + depName, function (val) {
11100                onDepChange(depName, val, isOptional);
11101            });
11102        });
11103        // process current dependency values
11104        depList.forEach(function (depName) {
11105            var isOptional = false;
11106            if (depName.charAt(0) === '?') {
11107                depName = depName.substring(1);
11108                isOptional = true;
11109            }
11110            if (_this.has(depName)) {
11111                values[depName] = _this.get(depName);
11112                satisfyCnt++;
11113            }
11114            else if (isOptional) {
11115                satisfyCnt++;
11116            }
11117        });
11118        // initially satisfied
11119        if (satisfyCnt === depCnt) {
11120            startFunc(values);
11121        }
11122        return {
11123            teardown: function () {
11124                // remove all handlers
11125                for (var i = 0; i < bindTuples.length; i++) {
11126                    _this.off(bindTuples[i][0], bindTuples[i][1]);
11127                }
11128                bindTuples = null;
11129                // was satisfied, so call stopFunc
11130                if (satisfyCnt === depCnt) {
11131                    stopFunc();
11132                }
11133            },
11134            flash: function () {
11135                if (satisfyCnt === depCnt) {
11136                    stopFunc();
11137                    startFunc(values);
11138                }
11139            }
11140        };
11141    };
11142    Model.prototype.flash = function (name) {
11143        var watcher = this._watchers[name];
11144        if (watcher) {
11145            watcher.flash();
11146        }
11147    };
11148    return Model;
11149}(Class_1.default));
11150exports.default = Model;
11151Model.prototype._globalWatchArgs = {}; // mutation protection in Model.watch
11152EmitterMixin_1.default.mixInto(Model);
11153ListenerMixin_1.default.mixInto(Model);
11154
11155
11156/***/ }),
11157/* 49 */
11158/***/ (function(module, exports, __webpack_require__) {
11159
11160Object.defineProperty(exports, "__esModule", { value: true });
11161var moment = __webpack_require__(0);
11162var util_1 = __webpack_require__(4);
11163var SingleEventDef_1 = __webpack_require__(13);
11164var RecurringEventDef_1 = __webpack_require__(210);
11165exports.default = {
11166    parse: function (eventInput, source) {
11167        if (util_1.isTimeString(eventInput.start) || moment.isDuration(eventInput.start) ||
11168            util_1.isTimeString(eventInput.end) || moment.isDuration(eventInput.end)) {
11169            return RecurringEventDef_1.default.parse(eventInput, source);
11170        }
11171        else {
11172            return SingleEventDef_1.default.parse(eventInput, source);
11173        }
11174    }
11175};
11176
11177
11178/***/ }),
11179/* 50 */
11180/***/ (function(module, exports, __webpack_require__) {
11181
11182Object.defineProperty(exports, "__esModule", { value: true });
11183var util_1 = __webpack_require__(4);
11184var EventDateProfile_1 = __webpack_require__(18);
11185var EventDefDateMutation = /** @class */ (function () {
11186    function EventDefDateMutation() {
11187        this.clearEnd = false;
11188        this.forceTimed = false;
11189        this.forceAllDay = false;
11190    }
11191    EventDefDateMutation.createFromDiff = function (dateProfile0, dateProfile1, largeUnit) {
11192        var clearEnd = dateProfile0.end && !dateProfile1.end;
11193        var forceTimed = dateProfile0.isAllDay() && !dateProfile1.isAllDay();
11194        var forceAllDay = !dateProfile0.isAllDay() && dateProfile1.isAllDay();
11195        var dateDelta;
11196        var endDiff;
11197        var endDelta;
11198        var mutation;
11199        // subtracts the dates in the appropriate way, returning a duration
11200        function subtractDates(date1, date0) {
11201            if (largeUnit) {
11202                return util_1.diffByUnit(date1, date0, largeUnit); // poorly named
11203            }
11204            else if (dateProfile1.isAllDay()) {
11205                return util_1.diffDay(date1, date0); // poorly named
11206            }
11207            else {
11208                return util_1.diffDayTime(date1, date0); // poorly named
11209            }
11210        }
11211        dateDelta = subtractDates(dateProfile1.start, dateProfile0.start);
11212        if (dateProfile1.end) {
11213            // use unzonedRanges because dateProfile0.end might be null
11214            endDiff = subtractDates(dateProfile1.unzonedRange.getEnd(), dateProfile0.unzonedRange.getEnd());
11215            endDelta = endDiff.subtract(dateDelta);
11216        }
11217        mutation = new EventDefDateMutation();
11218        mutation.clearEnd = clearEnd;
11219        mutation.forceTimed = forceTimed;
11220        mutation.forceAllDay = forceAllDay;
11221        mutation.setDateDelta(dateDelta);
11222        mutation.setEndDelta(endDelta);
11223        return mutation;
11224    };
11225    /*
11226    returns an undo function.
11227    */
11228    EventDefDateMutation.prototype.buildNewDateProfile = function (eventDateProfile, calendar) {
11229        var start = eventDateProfile.start.clone();
11230        var end = null;
11231        var shouldRezone = false;
11232        if (eventDateProfile.end && !this.clearEnd) {
11233            end = eventDateProfile.end.clone();
11234        }
11235        else if (this.endDelta && !end) {
11236            end = calendar.getDefaultEventEnd(eventDateProfile.isAllDay(), start);
11237        }
11238        if (this.forceTimed) {
11239            shouldRezone = true;
11240            if (!start.hasTime()) {
11241                start.time(0);
11242            }
11243            if (end && !end.hasTime()) {
11244                end.time(0);
11245            }
11246        }
11247        else if (this.forceAllDay) {
11248            if (start.hasTime()) {
11249                start.stripTime();
11250            }
11251            if (end && end.hasTime()) {
11252                end.stripTime();
11253            }
11254        }
11255        if (this.dateDelta) {
11256            shouldRezone = true;
11257            start.add(this.dateDelta);
11258            if (end) {
11259                end.add(this.dateDelta);
11260            }
11261        }
11262        // do this before adding startDelta to start, so we can work off of start
11263        if (this.endDelta) {
11264            shouldRezone = true;
11265            end.add(this.endDelta);
11266        }
11267        if (this.startDelta) {
11268            shouldRezone = true;
11269            start.add(this.startDelta);
11270        }
11271        if (shouldRezone) {
11272            start = calendar.applyTimezone(start);
11273            if (end) {
11274                end = calendar.applyTimezone(end);
11275            }
11276        }
11277        // TODO: okay to access calendar option?
11278        if (!end && calendar.opt('forceEventDuration')) {
11279            end = calendar.getDefaultEventEnd(eventDateProfile.isAllDay(), start);
11280        }
11281        return new EventDateProfile_1.default(start, end, calendar);
11282    };
11283    EventDefDateMutation.prototype.setDateDelta = function (dateDelta) {
11284        if (dateDelta && dateDelta.valueOf()) {
11285            this.dateDelta = dateDelta;
11286        }
11287        else {
11288            this.dateDelta = null;
11289        }
11290    };
11291    EventDefDateMutation.prototype.setStartDelta = function (startDelta) {
11292        if (startDelta && startDelta.valueOf()) {
11293            this.startDelta = startDelta;
11294        }
11295        else {
11296            this.startDelta = null;
11297        }
11298    };
11299    EventDefDateMutation.prototype.setEndDelta = function (endDelta) {
11300        if (endDelta && endDelta.valueOf()) {
11301            this.endDelta = endDelta;
11302        }
11303        else {
11304            this.endDelta = null;
11305        }
11306    };
11307    EventDefDateMutation.prototype.isEmpty = function () {
11308        return !this.clearEnd && !this.forceTimed && !this.forceAllDay &&
11309            !this.dateDelta && !this.startDelta && !this.endDelta;
11310    };
11311    return EventDefDateMutation;
11312}());
11313exports.default = EventDefDateMutation;
11314
11315
11316/***/ }),
11317/* 51 */
11318/***/ (function(module, exports, __webpack_require__) {
11319
11320Object.defineProperty(exports, "__esModule", { value: true });
11321var StandardTheme_1 = __webpack_require__(213);
11322var JqueryUiTheme_1 = __webpack_require__(214);
11323var themeClassHash = {};
11324function defineThemeSystem(themeName, themeClass) {
11325    themeClassHash[themeName] = themeClass;
11326}
11327exports.defineThemeSystem = defineThemeSystem;
11328function getThemeSystemClass(themeSetting) {
11329    if (!themeSetting) {
11330        return StandardTheme_1.default;
11331    }
11332    else if (themeSetting === true) {
11333        return JqueryUiTheme_1.default;
11334    }
11335    else {
11336        return themeClassHash[themeSetting];
11337    }
11338}
11339exports.getThemeSystemClass = getThemeSystemClass;
11340
11341
11342/***/ }),
11343/* 52 */
11344/***/ (function(module, exports, __webpack_require__) {
11345
11346Object.defineProperty(exports, "__esModule", { value: true });
11347var tslib_1 = __webpack_require__(2);
11348var $ = __webpack_require__(3);
11349var util_1 = __webpack_require__(4);
11350var Promise_1 = __webpack_require__(20);
11351var EventSource_1 = __webpack_require__(6);
11352var SingleEventDef_1 = __webpack_require__(13);
11353var ArrayEventSource = /** @class */ (function (_super) {
11354    tslib_1.__extends(ArrayEventSource, _super);
11355    function ArrayEventSource(calendar) {
11356        var _this = _super.call(this, calendar) || this;
11357        _this.eventDefs = []; // for if setRawEventDefs is never called
11358        return _this;
11359    }
11360    ArrayEventSource.parse = function (rawInput, calendar) {
11361        var rawProps;
11362        // normalize raw input
11363        if ($.isArray(rawInput.events)) {
11364            rawProps = rawInput;
11365        }
11366        else if ($.isArray(rawInput)) {
11367            rawProps = { events: rawInput };
11368        }
11369        if (rawProps) {
11370            return EventSource_1.default.parse.call(this, rawProps, calendar);
11371        }
11372        return false;
11373    };
11374    ArrayEventSource.prototype.setRawEventDefs = function (rawEventDefs) {
11375        this.rawEventDefs = rawEventDefs;
11376        this.eventDefs = this.parseEventDefs(rawEventDefs);
11377    };
11378    ArrayEventSource.prototype.fetch = function (start, end, timezone) {
11379        var eventDefs = this.eventDefs;
11380        var i;
11381        if (this.currentTimezone != null &&
11382            this.currentTimezone !== timezone) {
11383            for (i = 0; i < eventDefs.length; i++) {
11384                if (eventDefs[i] instanceof SingleEventDef_1.default) {
11385                    eventDefs[i].rezone();
11386                }
11387            }
11388        }
11389        this.currentTimezone = timezone;
11390        return Promise_1.default.resolve(eventDefs);
11391    };
11392    ArrayEventSource.prototype.addEventDef = function (eventDef) {
11393        this.eventDefs.push(eventDef);
11394    };
11395    /*
11396    eventDefId already normalized to a string
11397    */
11398    ArrayEventSource.prototype.removeEventDefsById = function (eventDefId) {
11399        return util_1.removeMatching(this.eventDefs, function (eventDef) {
11400            return eventDef.id === eventDefId;
11401        });
11402    };
11403    ArrayEventSource.prototype.removeAllEventDefs = function () {
11404        this.eventDefs = [];
11405    };
11406    ArrayEventSource.prototype.getPrimitive = function () {
11407        return this.rawEventDefs;
11408    };
11409    ArrayEventSource.prototype.applyManualStandardProps = function (rawProps) {
11410        var superSuccess = _super.prototype.applyManualStandardProps.call(this, rawProps);
11411        this.setRawEventDefs(rawProps.events);
11412        return superSuccess;
11413    };
11414    return ArrayEventSource;
11415}(EventSource_1.default));
11416exports.default = ArrayEventSource;
11417ArrayEventSource.defineStandardProps({
11418    events: false // don't automatically transfer
11419});
11420
11421
11422/***/ }),
11423/* 53 */
11424/***/ (function(module, exports, __webpack_require__) {
11425
11426Object.defineProperty(exports, "__esModule", { value: true });
11427var $ = __webpack_require__(3);
11428var util_1 = __webpack_require__(4);
11429/*
11430A cache for the left/right/top/bottom/width/height values for one or more elements.
11431Works with both offset (from topleft document) and position (from offsetParent).
11432
11433options:
11434- els
11435- isHorizontal
11436- isVertical
11437*/
11438var CoordCache = /** @class */ (function () {
11439    function CoordCache(options) {
11440        this.isHorizontal = false; // whether to query for left/right/width
11441        this.isVertical = false; // whether to query for top/bottom/height
11442        this.els = $(options.els);
11443        this.isHorizontal = options.isHorizontal;
11444        this.isVertical = options.isVertical;
11445        this.forcedOffsetParentEl = options.offsetParent ? $(options.offsetParent) : null;
11446    }
11447    // Queries the els for coordinates and stores them.
11448    // Call this method before using and of the get* methods below.
11449    CoordCache.prototype.build = function () {
11450        var offsetParentEl = this.forcedOffsetParentEl;
11451        if (!offsetParentEl && this.els.length > 0) {
11452            offsetParentEl = this.els.eq(0).offsetParent();
11453        }
11454        this.origin = offsetParentEl ?
11455            offsetParentEl.offset() :
11456            null;
11457        this.boundingRect = this.queryBoundingRect();
11458        if (this.isHorizontal) {
11459            this.buildElHorizontals();
11460        }
11461        if (this.isVertical) {
11462            this.buildElVerticals();
11463        }
11464    };
11465    // Destroys all internal data about coordinates, freeing memory
11466    CoordCache.prototype.clear = function () {
11467        this.origin = null;
11468        this.boundingRect = null;
11469        this.lefts = null;
11470        this.rights = null;
11471        this.tops = null;
11472        this.bottoms = null;
11473    };
11474    // When called, if coord caches aren't built, builds them
11475    CoordCache.prototype.ensureBuilt = function () {
11476        if (!this.origin) {
11477            this.build();
11478        }
11479    };
11480    // Populates the left/right internal coordinate arrays
11481    CoordCache.prototype.buildElHorizontals = function () {
11482        var lefts = [];
11483        var rights = [];
11484        this.els.each(function (i, node) {
11485            var el = $(node);
11486            var left = el.offset().left;
11487            var width = el.outerWidth();
11488            lefts.push(left);
11489            rights.push(left + width);
11490        });
11491        this.lefts = lefts;
11492        this.rights = rights;
11493    };
11494    // Populates the top/bottom internal coordinate arrays
11495    CoordCache.prototype.buildElVerticals = function () {
11496        var tops = [];
11497        var bottoms = [];
11498        this.els.each(function (i, node) {
11499            var el = $(node);
11500            var top = el.offset().top;
11501            var height = el.outerHeight();
11502            tops.push(top);
11503            bottoms.push(top + height);
11504        });
11505        this.tops = tops;
11506        this.bottoms = bottoms;
11507    };
11508    // Given a left offset (from document left), returns the index of the el that it horizontally intersects.
11509    // If no intersection is made, returns undefined.
11510    CoordCache.prototype.getHorizontalIndex = function (leftOffset) {
11511        this.ensureBuilt();
11512        var lefts = this.lefts;
11513        var rights = this.rights;
11514        var len = lefts.length;
11515        var i;
11516        for (i = 0; i < len; i++) {
11517            if (leftOffset >= lefts[i] && leftOffset < rights[i]) {
11518                return i;
11519            }
11520        }
11521    };
11522    // Given a top offset (from document top), returns the index of the el that it vertically intersects.
11523    // If no intersection is made, returns undefined.
11524    CoordCache.prototype.getVerticalIndex = function (topOffset) {
11525        this.ensureBuilt();
11526        var tops = this.tops;
11527        var bottoms = this.bottoms;
11528        var len = tops.length;
11529        var i;
11530        for (i = 0; i < len; i++) {
11531            if (topOffset >= tops[i] && topOffset < bottoms[i]) {
11532                return i;
11533            }
11534        }
11535    };
11536    // Gets the left offset (from document left) of the element at the given index
11537    CoordCache.prototype.getLeftOffset = function (leftIndex) {
11538        this.ensureBuilt();
11539        return this.lefts[leftIndex];
11540    };
11541    // Gets the left position (from offsetParent left) of the element at the given index
11542    CoordCache.prototype.getLeftPosition = function (leftIndex) {
11543        this.ensureBuilt();
11544        return this.lefts[leftIndex] - this.origin.left;
11545    };
11546    // Gets the right offset (from document left) of the element at the given index.
11547    // This value is NOT relative to the document's right edge, like the CSS concept of "right" would be.
11548    CoordCache.prototype.getRightOffset = function (leftIndex) {
11549        this.ensureBuilt();
11550        return this.rights[leftIndex];
11551    };
11552    // Gets the right position (from offsetParent left) of the element at the given index.
11553    // This value is NOT relative to the offsetParent's right edge, like the CSS concept of "right" would be.
11554    CoordCache.prototype.getRightPosition = function (leftIndex) {
11555        this.ensureBuilt();
11556        return this.rights[leftIndex] - this.origin.left;
11557    };
11558    // Gets the width of the element at the given index
11559    CoordCache.prototype.getWidth = function (leftIndex) {
11560        this.ensureBuilt();
11561        return this.rights[leftIndex] - this.lefts[leftIndex];
11562    };
11563    // Gets the top offset (from document top) of the element at the given index
11564    CoordCache.prototype.getTopOffset = function (topIndex) {
11565        this.ensureBuilt();
11566        return this.tops[topIndex];
11567    };
11568    // Gets the top position (from offsetParent top) of the element at the given position
11569    CoordCache.prototype.getTopPosition = function (topIndex) {
11570        this.ensureBuilt();
11571        return this.tops[topIndex] - this.origin.top;
11572    };
11573    // Gets the bottom offset (from the document top) of the element at the given index.
11574    // This value is NOT relative to the offsetParent's bottom edge, like the CSS concept of "bottom" would be.
11575    CoordCache.prototype.getBottomOffset = function (topIndex) {
11576        this.ensureBuilt();
11577        return this.bottoms[topIndex];
11578    };
11579    // Gets the bottom position (from the offsetParent top) of the element at the given index.
11580    // This value is NOT relative to the offsetParent's bottom edge, like the CSS concept of "bottom" would be.
11581    CoordCache.prototype.getBottomPosition = function (topIndex) {
11582        this.ensureBuilt();
11583        return this.bottoms[topIndex] - this.origin.top;
11584    };
11585    // Gets the height of the element at the given index
11586    CoordCache.prototype.getHeight = function (topIndex) {
11587        this.ensureBuilt();
11588        return this.bottoms[topIndex] - this.tops[topIndex];
11589    };
11590    // Bounding Rect
11591    // TODO: decouple this from CoordCache
11592    // Compute and return what the elements' bounding rectangle is, from the user's perspective.
11593    // Right now, only returns a rectangle if constrained by an overflow:scroll element.
11594    // Returns null if there are no elements
11595    CoordCache.prototype.queryBoundingRect = function () {
11596        var scrollParentEl;
11597        if (this.els.length > 0) {
11598            scrollParentEl = util_1.getScrollParent(this.els.eq(0));
11599            if (!scrollParentEl.is(document)) {
11600                return util_1.getClientRect(scrollParentEl);
11601            }
11602        }
11603        return null;
11604    };
11605    CoordCache.prototype.isPointInBounds = function (leftOffset, topOffset) {
11606        return this.isLeftInBounds(leftOffset) && this.isTopInBounds(topOffset);
11607    };
11608    CoordCache.prototype.isLeftInBounds = function (leftOffset) {
11609        return !this.boundingRect || (leftOffset >= this.boundingRect.left && leftOffset < this.boundingRect.right);
11610    };
11611    CoordCache.prototype.isTopInBounds = function (topOffset) {
11612        return !this.boundingRect || (topOffset >= this.boundingRect.top && topOffset < this.boundingRect.bottom);
11613    };
11614    return CoordCache;
11615}());
11616exports.default = CoordCache;
11617
11618
11619/***/ }),
11620/* 54 */
11621/***/ (function(module, exports, __webpack_require__) {
11622
11623Object.defineProperty(exports, "__esModule", { value: true });
11624var $ = __webpack_require__(3);
11625var util_1 = __webpack_require__(4);
11626var ListenerMixin_1 = __webpack_require__(7);
11627var GlobalEmitter_1 = __webpack_require__(15);
11628/* Tracks a drag's mouse movement, firing various handlers
11629----------------------------------------------------------------------------------------------------------------------*/
11630// TODO: use Emitter
11631var DragListener = /** @class */ (function () {
11632    function DragListener(options) {
11633        this.isInteracting = false;
11634        this.isDistanceSurpassed = false;
11635        this.isDelayEnded = false;
11636        this.isDragging = false;
11637        this.isTouch = false;
11638        this.isGeneric = false; // initiated by 'dragstart' (jqui)
11639        this.shouldCancelTouchScroll = true;
11640        this.scrollAlwaysKills = false;
11641        this.isAutoScroll = false;
11642        // defaults
11643        this.scrollSensitivity = 30; // pixels from edge for scrolling to start
11644        this.scrollSpeed = 200; // pixels per second, at maximum speed
11645        this.scrollIntervalMs = 50; // millisecond wait between scroll increment
11646        this.options = options || {};
11647    }
11648    // Interaction (high-level)
11649    // -----------------------------------------------------------------------------------------------------------------
11650    DragListener.prototype.startInteraction = function (ev, extraOptions) {
11651        if (extraOptions === void 0) { extraOptions = {}; }
11652        if (ev.type === 'mousedown') {
11653            if (GlobalEmitter_1.default.get().shouldIgnoreMouse()) {
11654                return;
11655            }
11656            else if (!util_1.isPrimaryMouseButton(ev)) {
11657                return;
11658            }
11659            else {
11660                ev.preventDefault(); // prevents native selection in most browsers
11661            }
11662        }
11663        if (!this.isInteracting) {
11664            // process options
11665            this.delay = util_1.firstDefined(extraOptions.delay, this.options.delay, 0);
11666            this.minDistance = util_1.firstDefined(extraOptions.distance, this.options.distance, 0);
11667            this.subjectEl = this.options.subjectEl;
11668            util_1.preventSelection($('body'));
11669            this.isInteracting = true;
11670            this.isTouch = util_1.getEvIsTouch(ev);
11671            this.isGeneric = ev.type === 'dragstart';
11672            this.isDelayEnded = false;
11673            this.isDistanceSurpassed = false;
11674            this.originX = util_1.getEvX(ev);
11675            this.originY = util_1.getEvY(ev);
11676            this.scrollEl = util_1.getScrollParent($(ev.target));
11677            this.bindHandlers();
11678            this.initAutoScroll();
11679            this.handleInteractionStart(ev);
11680            this.startDelay(ev);
11681            if (!this.minDistance) {
11682                this.handleDistanceSurpassed(ev);
11683            }
11684        }
11685    };
11686    DragListener.prototype.handleInteractionStart = function (ev) {
11687        this.trigger('interactionStart', ev);
11688    };
11689    DragListener.prototype.endInteraction = function (ev, isCancelled) {
11690        if (this.isInteracting) {
11691            this.endDrag(ev);
11692            if (this.delayTimeoutId) {
11693                clearTimeout(this.delayTimeoutId);
11694                this.delayTimeoutId = null;
11695            }
11696            this.destroyAutoScroll();
11697            this.unbindHandlers();
11698            this.isInteracting = false;
11699            this.handleInteractionEnd(ev, isCancelled);
11700            util_1.allowSelection($('body'));
11701        }
11702    };
11703    DragListener.prototype.handleInteractionEnd = function (ev, isCancelled) {
11704        this.trigger('interactionEnd', ev, isCancelled || false);
11705    };
11706    // Binding To DOM
11707    // -----------------------------------------------------------------------------------------------------------------
11708    DragListener.prototype.bindHandlers = function () {
11709        // some browsers (Safari in iOS 10) don't allow preventDefault on touch events that are bound after touchstart,
11710        // so listen to the GlobalEmitter singleton, which is always bound, instead of the document directly.
11711        var globalEmitter = GlobalEmitter_1.default.get();
11712        if (this.isGeneric) {
11713            this.listenTo($(document), {
11714                drag: this.handleMove,
11715                dragstop: this.endInteraction
11716            });
11717        }
11718        else if (this.isTouch) {
11719            this.listenTo(globalEmitter, {
11720                touchmove: this.handleTouchMove,
11721                touchend: this.endInteraction,
11722                scroll: this.handleTouchScroll
11723            });
11724        }
11725        else {
11726            this.listenTo(globalEmitter, {
11727                mousemove: this.handleMouseMove,
11728                mouseup: this.endInteraction
11729            });
11730        }
11731        this.listenTo(globalEmitter, {
11732            selectstart: util_1.preventDefault,
11733            contextmenu: util_1.preventDefault // long taps would open menu on Chrome dev tools
11734        });
11735    };
11736    DragListener.prototype.unbindHandlers = function () {
11737        this.stopListeningTo(GlobalEmitter_1.default.get());
11738        this.stopListeningTo($(document)); // for isGeneric
11739    };
11740    // Drag (high-level)
11741    // -----------------------------------------------------------------------------------------------------------------
11742    // extraOptions ignored if drag already started
11743    DragListener.prototype.startDrag = function (ev, extraOptions) {
11744        this.startInteraction(ev, extraOptions); // ensure interaction began
11745        if (!this.isDragging) {
11746            this.isDragging = true;
11747            this.handleDragStart(ev);
11748        }
11749    };
11750    DragListener.prototype.handleDragStart = function (ev) {
11751        this.trigger('dragStart', ev);
11752    };
11753    DragListener.prototype.handleMove = function (ev) {
11754        var dx = util_1.getEvX(ev) - this.originX;
11755        var dy = util_1.getEvY(ev) - this.originY;
11756        var minDistance = this.minDistance;
11757        var distanceSq; // current distance from the origin, squared
11758        if (!this.isDistanceSurpassed) {
11759            distanceSq = dx * dx + dy * dy;
11760            if (distanceSq >= minDistance * minDistance) {
11761                this.handleDistanceSurpassed(ev);
11762            }
11763        }
11764        if (this.isDragging) {
11765            this.handleDrag(dx, dy, ev);
11766        }
11767    };
11768    // Called while the mouse is being moved and when we know a legitimate drag is taking place
11769    DragListener.prototype.handleDrag = function (dx, dy, ev) {
11770        this.trigger('drag', dx, dy, ev);
11771        this.updateAutoScroll(ev); // will possibly cause scrolling
11772    };
11773    DragListener.prototype.endDrag = function (ev) {
11774        if (this.isDragging) {
11775            this.isDragging = false;
11776            this.handleDragEnd(ev);
11777        }
11778    };
11779    DragListener.prototype.handleDragEnd = function (ev) {
11780        this.trigger('dragEnd', ev);
11781    };
11782    // Delay
11783    // -----------------------------------------------------------------------------------------------------------------
11784    DragListener.prototype.startDelay = function (initialEv) {
11785        var _this = this;
11786        if (this.delay) {
11787            this.delayTimeoutId = setTimeout(function () {
11788                _this.handleDelayEnd(initialEv);
11789            }, this.delay);
11790        }
11791        else {
11792            this.handleDelayEnd(initialEv);
11793        }
11794    };
11795    DragListener.prototype.handleDelayEnd = function (initialEv) {
11796        this.isDelayEnded = true;
11797        if (this.isDistanceSurpassed) {
11798            this.startDrag(initialEv);
11799        }
11800    };
11801    // Distance
11802    // -----------------------------------------------------------------------------------------------------------------
11803    DragListener.prototype.handleDistanceSurpassed = function (ev) {
11804        this.isDistanceSurpassed = true;
11805        if (this.isDelayEnded) {
11806            this.startDrag(ev);
11807        }
11808    };
11809    // Mouse / Touch
11810    // -----------------------------------------------------------------------------------------------------------------
11811    DragListener.prototype.handleTouchMove = function (ev) {
11812        // prevent inertia and touchmove-scrolling while dragging
11813        if (this.isDragging && this.shouldCancelTouchScroll) {
11814            ev.preventDefault();
11815        }
11816        this.handleMove(ev);
11817    };
11818    DragListener.prototype.handleMouseMove = function (ev) {
11819        this.handleMove(ev);
11820    };
11821    // Scrolling (unrelated to auto-scroll)
11822    // -----------------------------------------------------------------------------------------------------------------
11823    DragListener.prototype.handleTouchScroll = function (ev) {
11824        // if the drag is being initiated by touch, but a scroll happens before
11825        // the drag-initiating delay is over, cancel the drag
11826        if (!this.isDragging || this.scrollAlwaysKills) {
11827            this.endInteraction(ev, true); // isCancelled=true
11828        }
11829    };
11830    // Utils
11831    // -----------------------------------------------------------------------------------------------------------------
11832    // Triggers a callback. Calls a function in the option hash of the same name.
11833    // Arguments beyond the first `name` are forwarded on.
11834    DragListener.prototype.trigger = function (name) {
11835        var args = [];
11836        for (var _i = 1; _i < arguments.length; _i++) {
11837            args[_i - 1] = arguments[_i];
11838        }
11839        if (this.options[name]) {
11840            this.options[name].apply(this, args);
11841        }
11842        // makes _methods callable by event name. TODO: kill this
11843        if (this['_' + name]) {
11844            this['_' + name].apply(this, args);
11845        }
11846    };
11847    // Auto-scroll
11848    // -----------------------------------------------------------------------------------------------------------------
11849    DragListener.prototype.initAutoScroll = function () {
11850        var scrollEl = this.scrollEl;
11851        this.isAutoScroll =
11852            this.options.scroll &&
11853                scrollEl &&
11854                !scrollEl.is(window) &&
11855                !scrollEl.is(document);
11856        if (this.isAutoScroll) {
11857            // debounce makes sure rapid calls don't happen
11858            this.listenTo(scrollEl, 'scroll', util_1.debounce(this.handleDebouncedScroll, 100));
11859        }
11860    };
11861    DragListener.prototype.destroyAutoScroll = function () {
11862        this.endAutoScroll(); // kill any animation loop
11863        // remove the scroll handler if there is a scrollEl
11864        if (this.isAutoScroll) {
11865            this.stopListeningTo(this.scrollEl, 'scroll'); // will probably get removed by unbindHandlers too :(
11866        }
11867    };
11868    // Computes and stores the bounding rectangle of scrollEl
11869    DragListener.prototype.computeScrollBounds = function () {
11870        if (this.isAutoScroll) {
11871            this.scrollBounds = util_1.getOuterRect(this.scrollEl);
11872            // TODO: use getClientRect in future. but prevents auto scrolling when on top of scrollbars
11873        }
11874    };
11875    // Called when the dragging is in progress and scrolling should be updated
11876    DragListener.prototype.updateAutoScroll = function (ev) {
11877        var sensitivity = this.scrollSensitivity;
11878        var bounds = this.scrollBounds;
11879        var topCloseness;
11880        var bottomCloseness;
11881        var leftCloseness;
11882        var rightCloseness;
11883        var topVel = 0;
11884        var leftVel = 0;
11885        if (bounds) {
11886            // compute closeness to edges. valid range is from 0.0 - 1.0
11887            topCloseness = (sensitivity - (util_1.getEvY(ev) - bounds.top)) / sensitivity;
11888            bottomCloseness = (sensitivity - (bounds.bottom - util_1.getEvY(ev))) / sensitivity;
11889            leftCloseness = (sensitivity - (util_1.getEvX(ev) - bounds.left)) / sensitivity;
11890            rightCloseness = (sensitivity - (bounds.right - util_1.getEvX(ev))) / sensitivity;
11891            // translate vertical closeness into velocity.
11892            // mouse must be completely in bounds for velocity to happen.
11893            if (topCloseness >= 0 && topCloseness <= 1) {
11894                topVel = topCloseness * this.scrollSpeed * -1; // negative. for scrolling up
11895            }
11896            else if (bottomCloseness >= 0 && bottomCloseness <= 1) {
11897                topVel = bottomCloseness * this.scrollSpeed;
11898            }
11899            // translate horizontal closeness into velocity
11900            if (leftCloseness >= 0 && leftCloseness <= 1) {
11901                leftVel = leftCloseness * this.scrollSpeed * -1; // negative. for scrolling left
11902            }
11903            else if (rightCloseness >= 0 && rightCloseness <= 1) {
11904                leftVel = rightCloseness * this.scrollSpeed;
11905            }
11906        }
11907        this.setScrollVel(topVel, leftVel);
11908    };
11909    // Sets the speed-of-scrolling for the scrollEl
11910    DragListener.prototype.setScrollVel = function (topVel, leftVel) {
11911        this.scrollTopVel = topVel;
11912        this.scrollLeftVel = leftVel;
11913        this.constrainScrollVel(); // massages into realistic values
11914        // if there is non-zero velocity, and an animation loop hasn't already started, then START
11915        if ((this.scrollTopVel || this.scrollLeftVel) && !this.scrollIntervalId) {
11916            this.scrollIntervalId = setInterval(util_1.proxy(this, 'scrollIntervalFunc'), // scope to `this`
11917            this.scrollIntervalMs);
11918        }
11919    };
11920    // Forces scrollTopVel and scrollLeftVel to be zero if scrolling has already gone all the way
11921    DragListener.prototype.constrainScrollVel = function () {
11922        var el = this.scrollEl;
11923        if (this.scrollTopVel < 0) {
11924            if (el.scrollTop() <= 0) {
11925                this.scrollTopVel = 0;
11926            }
11927        }
11928        else if (this.scrollTopVel > 0) {
11929            if (el.scrollTop() + el[0].clientHeight >= el[0].scrollHeight) {
11930                this.scrollTopVel = 0;
11931            }
11932        }
11933        if (this.scrollLeftVel < 0) {
11934            if (el.scrollLeft() <= 0) {
11935                this.scrollLeftVel = 0;
11936            }
11937        }
11938        else if (this.scrollLeftVel > 0) {
11939            if (el.scrollLeft() + el[0].clientWidth >= el[0].scrollWidth) {
11940                this.scrollLeftVel = 0;
11941            }
11942        }
11943    };
11944    // This function gets called during every iteration of the scrolling animation loop
11945    DragListener.prototype.scrollIntervalFunc = function () {
11946        var el = this.scrollEl;
11947        var frac = this.scrollIntervalMs / 1000; // considering animation frequency, what the vel should be mult'd by
11948        // change the value of scrollEl's scroll
11949        if (this.scrollTopVel) {
11950            el.scrollTop(el.scrollTop() + this.scrollTopVel * frac);
11951        }
11952        if (this.scrollLeftVel) {
11953            el.scrollLeft(el.scrollLeft() + this.scrollLeftVel * frac);
11954        }
11955        this.constrainScrollVel(); // since the scroll values changed, recompute the velocities
11956        // if scrolled all the way, which causes the vels to be zero, stop the animation loop
11957        if (!this.scrollTopVel && !this.scrollLeftVel) {
11958            this.endAutoScroll();
11959        }
11960    };
11961    // Kills any existing scrolling animation loop
11962    DragListener.prototype.endAutoScroll = function () {
11963        if (this.scrollIntervalId) {
11964            clearInterval(this.scrollIntervalId);
11965            this.scrollIntervalId = null;
11966            this.handleScrollEnd();
11967        }
11968    };
11969    // Get called when the scrollEl is scrolled (NOTE: this is delayed via debounce)
11970    DragListener.prototype.handleDebouncedScroll = function () {
11971        // recompute all coordinates, but *only* if this is *not* part of our scrolling animation
11972        if (!this.scrollIntervalId) {
11973            this.handleScrollEnd();
11974        }
11975    };
11976    DragListener.prototype.handleScrollEnd = function () {
11977        // Called when scrolling has stopped, whether through auto scroll, or the user scrolling
11978    };
11979    return DragListener;
11980}());
11981exports.default = DragListener;
11982ListenerMixin_1.default.mixInto(DragListener);
11983
11984
11985/***/ }),
11986/* 55 */
11987/***/ (function(module, exports, __webpack_require__) {
11988
11989Object.defineProperty(exports, "__esModule", { value: true });
11990var tslib_1 = __webpack_require__(2);
11991var util_1 = __webpack_require__(4);
11992var Mixin_1 = __webpack_require__(14);
11993/*
11994A set of rendering and date-related methods for a visual component comprised of one or more rows of day columns.
11995Prerequisite: the object being mixed into needs to be a *Grid*
11996*/
11997var DayTableMixin = /** @class */ (function (_super) {
11998    tslib_1.__extends(DayTableMixin, _super);
11999    function DayTableMixin() {
12000        return _super !== null && _super.apply(this, arguments) || this;
12001    }
12002    // Populates internal variables used for date calculation and rendering
12003    DayTableMixin.prototype.updateDayTable = function () {
12004        var t = this;
12005        var view = t.view;
12006        var calendar = view.calendar;
12007        var date = calendar.msToUtcMoment(t.dateProfile.renderUnzonedRange.startMs, true);
12008        var end = calendar.msToUtcMoment(t.dateProfile.renderUnzonedRange.endMs, true);
12009        var dayIndex = -1;
12010        var dayIndices = [];
12011        var dayDates = [];
12012        var daysPerRow;
12013        var firstDay;
12014        var rowCnt;
12015        while (date.isBefore(end)) {
12016            if (view.isHiddenDay(date)) {
12017                dayIndices.push(dayIndex + 0.5); // mark that it's between indices
12018            }
12019            else {
12020                dayIndex++;
12021                dayIndices.push(dayIndex);
12022                dayDates.push(date.clone());
12023            }
12024            date.add(1, 'days');
12025        }
12026        if (this.breakOnWeeks) {
12027            // count columns until the day-of-week repeats
12028            firstDay = dayDates[0].day();
12029            for (daysPerRow = 1; daysPerRow < dayDates.length; daysPerRow++) {
12030                if (dayDates[daysPerRow].day() === firstDay) {
12031                    break;
12032                }
12033            }
12034            rowCnt = Math.ceil(dayDates.length / daysPerRow);
12035        }
12036        else {
12037            rowCnt = 1;
12038            daysPerRow = dayDates.length;
12039        }
12040        this.dayDates = dayDates;
12041        this.dayIndices = dayIndices;
12042        this.daysPerRow = daysPerRow;
12043        this.rowCnt = rowCnt;
12044        this.updateDayTableCols();
12045    };
12046    // Computes and assigned the colCnt property and updates any options that may be computed from it
12047    DayTableMixin.prototype.updateDayTableCols = function () {
12048        this.colCnt = this.computeColCnt();
12049        this.colHeadFormat =
12050            this.opt('columnHeaderFormat') ||
12051                this.opt('columnFormat') || // deprecated
12052                this.computeColHeadFormat();
12053    };
12054    // Determines how many columns there should be in the table
12055    DayTableMixin.prototype.computeColCnt = function () {
12056        return this.daysPerRow;
12057    };
12058    // Computes the ambiguously-timed moment for the given cell
12059    DayTableMixin.prototype.getCellDate = function (row, col) {
12060        return this.dayDates[this.getCellDayIndex(row, col)].clone();
12061    };
12062    // Computes the ambiguously-timed date range for the given cell
12063    DayTableMixin.prototype.getCellRange = function (row, col) {
12064        var start = this.getCellDate(row, col);
12065        var end = start.clone().add(1, 'days');
12066        return { start: start, end: end };
12067    };
12068    // Returns the number of day cells, chronologically, from the first of the grid (0-based)
12069    DayTableMixin.prototype.getCellDayIndex = function (row, col) {
12070        return row * this.daysPerRow + this.getColDayIndex(col);
12071    };
12072    // Returns the numner of day cells, chronologically, from the first cell in *any given row*
12073    DayTableMixin.prototype.getColDayIndex = function (col) {
12074        if (this.isRTL) {
12075            return this.colCnt - 1 - col;
12076        }
12077        else {
12078            return col;
12079        }
12080    };
12081    // Given a date, returns its chronolocial cell-index from the first cell of the grid.
12082    // If the date lies between cells (because of hiddenDays), returns a floating-point value between offsets.
12083    // If before the first offset, returns a negative number.
12084    // If after the last offset, returns an offset past the last cell offset.
12085    // Only works for *start* dates of cells. Will not work for exclusive end dates for cells.
12086    DayTableMixin.prototype.getDateDayIndex = function (date) {
12087        var dayIndices = this.dayIndices;
12088        var dayOffset = date.diff(this.dayDates[0], 'days');
12089        if (dayOffset < 0) {
12090            return dayIndices[0] - 1;
12091        }
12092        else if (dayOffset >= dayIndices.length) {
12093            return dayIndices[dayIndices.length - 1] + 1;
12094        }
12095        else {
12096            return dayIndices[dayOffset];
12097        }
12098    };
12099    /* Options
12100    ------------------------------------------------------------------------------------------------------------------*/
12101    // Computes a default column header formatting string if `colFormat` is not explicitly defined
12102    DayTableMixin.prototype.computeColHeadFormat = function () {
12103        // if more than one week row, or if there are a lot of columns with not much space,
12104        // put just the day numbers will be in each cell
12105        if (this.rowCnt > 1 || this.colCnt > 10) {
12106            return 'ddd'; // "Sat"
12107        }
12108        else if (this.colCnt > 1) {
12109            return this.opt('dayOfMonthFormat'); // "Sat 12/10"
12110        }
12111        else {
12112            return 'dddd'; // "Saturday"
12113        }
12114    };
12115    /* Slicing
12116    ------------------------------------------------------------------------------------------------------------------*/
12117    // Slices up a date range into a segment for every week-row it intersects with
12118    DayTableMixin.prototype.sliceRangeByRow = function (unzonedRange) {
12119        var daysPerRow = this.daysPerRow;
12120        var normalRange = this.view.computeDayRange(unzonedRange); // make whole-day range, considering nextDayThreshold
12121        var rangeFirst = this.getDateDayIndex(normalRange.start); // inclusive first index
12122        var rangeLast = this.getDateDayIndex(normalRange.end.clone().subtract(1, 'days')); // inclusive last index
12123        var segs = [];
12124        var row;
12125        var rowFirst;
12126        var rowLast; // inclusive day-index range for current row
12127        var segFirst;
12128        var segLast; // inclusive day-index range for segment
12129        for (row = 0; row < this.rowCnt; row++) {
12130            rowFirst = row * daysPerRow;
12131            rowLast = rowFirst + daysPerRow - 1;
12132            // intersect segment's offset range with the row's
12133            segFirst = Math.max(rangeFirst, rowFirst);
12134            segLast = Math.min(rangeLast, rowLast);
12135            // deal with in-between indices
12136            segFirst = Math.ceil(segFirst); // in-between starts round to next cell
12137            segLast = Math.floor(segLast); // in-between ends round to prev cell
12138            if (segFirst <= segLast) {
12139                segs.push({
12140                    row: row,
12141                    // normalize to start of row
12142                    firstRowDayIndex: segFirst - rowFirst,
12143                    lastRowDayIndex: segLast - rowFirst,
12144                    // must be matching integers to be the segment's start/end
12145                    isStart: segFirst === rangeFirst,
12146                    isEnd: segLast === rangeLast
12147                });
12148            }
12149        }
12150        return segs;
12151    };
12152    // Slices up a date range into a segment for every day-cell it intersects with.
12153    // TODO: make more DRY with sliceRangeByRow somehow.
12154    DayTableMixin.prototype.sliceRangeByDay = function (unzonedRange) {
12155        var daysPerRow = this.daysPerRow;
12156        var normalRange = this.view.computeDayRange(unzonedRange); // make whole-day range, considering nextDayThreshold
12157        var rangeFirst = this.getDateDayIndex(normalRange.start); // inclusive first index
12158        var rangeLast = this.getDateDayIndex(normalRange.end.clone().subtract(1, 'days')); // inclusive last index
12159        var segs = [];
12160        var row;
12161        var rowFirst;
12162        var rowLast; // inclusive day-index range for current row
12163        var i;
12164        var segFirst;
12165        var segLast; // inclusive day-index range for segment
12166        for (row = 0; row < this.rowCnt; row++) {
12167            rowFirst = row * daysPerRow;
12168            rowLast = rowFirst + daysPerRow - 1;
12169            for (i = rowFirst; i <= rowLast; i++) {
12170                // intersect segment's offset range with the row's
12171                segFirst = Math.max(rangeFirst, i);
12172                segLast = Math.min(rangeLast, i);
12173                // deal with in-between indices
12174                segFirst = Math.ceil(segFirst); // in-between starts round to next cell
12175                segLast = Math.floor(segLast); // in-between ends round to prev cell
12176                if (segFirst <= segLast) {
12177                    segs.push({
12178                        row: row,
12179                        // normalize to start of row
12180                        firstRowDayIndex: segFirst - rowFirst,
12181                        lastRowDayIndex: segLast - rowFirst,
12182                        // must be matching integers to be the segment's start/end
12183                        isStart: segFirst === rangeFirst,
12184                        isEnd: segLast === rangeLast
12185                    });
12186                }
12187            }
12188        }
12189        return segs;
12190    };
12191    /* Header Rendering
12192    ------------------------------------------------------------------------------------------------------------------*/
12193    DayTableMixin.prototype.renderHeadHtml = function () {
12194        var theme = this.view.calendar.theme;
12195        return '' +
12196            '<div class="fc-row ' + theme.getClass('headerRow') + '">' +
12197            '<table class="' + theme.getClass('tableGrid') + '">' +
12198            '<thead>' +
12199            this.renderHeadTrHtml() +
12200            '</thead>' +
12201            '</table>' +
12202            '</div>';
12203    };
12204    DayTableMixin.prototype.renderHeadIntroHtml = function () {
12205        return this.renderIntroHtml(); // fall back to generic
12206    };
12207    DayTableMixin.prototype.renderHeadTrHtml = function () {
12208        return '' +
12209            '<tr>' +
12210            (this.isRTL ? '' : this.renderHeadIntroHtml()) +
12211            this.renderHeadDateCellsHtml() +
12212            (this.isRTL ? this.renderHeadIntroHtml() : '') +
12213            '</tr>';
12214    };
12215    DayTableMixin.prototype.renderHeadDateCellsHtml = function () {
12216        var htmls = [];
12217        var col;
12218        var date;
12219        for (col = 0; col < this.colCnt; col++) {
12220            date = this.getCellDate(0, col);
12221            htmls.push(this.renderHeadDateCellHtml(date));
12222        }
12223        return htmls.join('');
12224    };
12225    // TODO: when internalApiVersion, accept an object for HTML attributes
12226    // (colspan should be no different)
12227    DayTableMixin.prototype.renderHeadDateCellHtml = function (date, colspan, otherAttrs) {
12228        var t = this;
12229        var view = t.view;
12230        var isDateValid = t.dateProfile.activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow.
12231        var classNames = [
12232            'fc-day-header',
12233            view.calendar.theme.getClass('widgetHeader')
12234        ];
12235        var innerHtml;
12236        if (typeof t.opt('columnHeaderHtml') === 'function') {
12237            innerHtml = t.opt('columnHeaderHtml')(date);
12238        }
12239        else if (typeof t.opt('columnHeaderText') === 'function') {
12240            innerHtml = util_1.htmlEscape(t.opt('columnHeaderText')(date));
12241        }
12242        else {
12243            innerHtml = util_1.htmlEscape(date.format(t.colHeadFormat));
12244        }
12245        // if only one row of days, the classNames on the header can represent the specific days beneath
12246        if (t.rowCnt === 1) {
12247            classNames = classNames.concat(
12248            // includes the day-of-week class
12249            // noThemeHighlight=true (don't highlight the header)
12250            t.getDayClasses(date, true));
12251        }
12252        else {
12253            classNames.push('fc-' + util_1.dayIDs[date.day()]); // only add the day-of-week class
12254        }
12255        return '' +
12256            '<th class="' + classNames.join(' ') + '"' +
12257            ((isDateValid && t.rowCnt) === 1 ?
12258                ' data-date="' + date.format('YYYY-MM-DD') + '"' :
12259                '') +
12260            (colspan > 1 ?
12261                ' colspan="' + colspan + '"' :
12262                '') +
12263            (otherAttrs ?
12264                ' ' + otherAttrs :
12265                '') +
12266            '>' +
12267            (isDateValid ?
12268                // don't make a link if the heading could represent multiple days, or if there's only one day (forceOff)
12269                view.buildGotoAnchorHtml({ date: date, forceOff: t.rowCnt > 1 || t.colCnt === 1 }, innerHtml) :
12270                // if not valid, display text, but no link
12271                innerHtml) +
12272            '</th>';
12273    };
12274    /* Background Rendering
12275    ------------------------------------------------------------------------------------------------------------------*/
12276    DayTableMixin.prototype.renderBgTrHtml = function (row) {
12277        return '' +
12278            '<tr>' +
12279            (this.isRTL ? '' : this.renderBgIntroHtml(row)) +
12280            this.renderBgCellsHtml(row) +
12281            (this.isRTL ? this.renderBgIntroHtml(row) : '') +
12282            '</tr>';
12283    };
12284    DayTableMixin.prototype.renderBgIntroHtml = function (row) {
12285        return this.renderIntroHtml(); // fall back to generic
12286    };
12287    DayTableMixin.prototype.renderBgCellsHtml = function (row) {
12288        var htmls = [];
12289        var col;
12290        var date;
12291        for (col = 0; col < this.colCnt; col++) {
12292            date = this.getCellDate(row, col);
12293            htmls.push(this.renderBgCellHtml(date));
12294        }
12295        return htmls.join('');
12296    };
12297    DayTableMixin.prototype.renderBgCellHtml = function (date, otherAttrs) {
12298        var t = this;
12299        var view = t.view;
12300        var isDateValid = t.dateProfile.activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow.
12301        var classes = t.getDayClasses(date);
12302        classes.unshift('fc-day', view.calendar.theme.getClass('widgetContent'));
12303        return '<td class="' + classes.join(' ') + '"' +
12304            (isDateValid ?
12305                ' data-date="' + date.format('YYYY-MM-DD') + '"' : // if date has a time, won't format it
12306                '') +
12307            (otherAttrs ?
12308                ' ' + otherAttrs :
12309                '') +
12310            '></td>';
12311    };
12312    /* Generic
12313    ------------------------------------------------------------------------------------------------------------------*/
12314    DayTableMixin.prototype.renderIntroHtml = function () {
12315        // Generates the default HTML intro for any row. User classes should override
12316    };
12317    // TODO: a generic method for dealing with <tr>, RTL, intro
12318    // when increment internalApiVersion
12319    // wrapTr (scheduler)
12320    /* Utils
12321    ------------------------------------------------------------------------------------------------------------------*/
12322    // Applies the generic "intro" and "outro" HTML to the given cells.
12323    // Intro means the leftmost cell when the calendar is LTR and the rightmost cell when RTL. Vice-versa for outro.
12324    DayTableMixin.prototype.bookendCells = function (trEl) {
12325        var introHtml = this.renderIntroHtml();
12326        if (introHtml) {
12327            if (this.isRTL) {
12328                trEl.append(introHtml);
12329            }
12330            else {
12331                trEl.prepend(introHtml);
12332            }
12333        }
12334    };
12335    return DayTableMixin;
12336}(Mixin_1.default));
12337exports.default = DayTableMixin;
12338
12339
12340/***/ }),
12341/* 56 */
12342/***/ (function(module, exports) {
12343
12344Object.defineProperty(exports, "__esModule", { value: true });
12345var BusinessHourRenderer = /** @class */ (function () {
12346    /*
12347    component implements:
12348      - eventRangesToEventFootprints
12349      - eventFootprintsToSegs
12350    */
12351    function BusinessHourRenderer(component, fillRenderer) {
12352        this.component = component;
12353        this.fillRenderer = fillRenderer;
12354    }
12355    BusinessHourRenderer.prototype.render = function (businessHourGenerator) {
12356        var component = this.component;
12357        var unzonedRange = component._getDateProfile().activeUnzonedRange;
12358        var eventInstanceGroup = businessHourGenerator.buildEventInstanceGroup(component.hasAllDayBusinessHours, unzonedRange);
12359        var eventFootprints = eventInstanceGroup ?
12360            component.eventRangesToEventFootprints(eventInstanceGroup.sliceRenderRanges(unzonedRange)) :
12361            [];
12362        this.renderEventFootprints(eventFootprints);
12363    };
12364    BusinessHourRenderer.prototype.renderEventFootprints = function (eventFootprints) {
12365        var segs = this.component.eventFootprintsToSegs(eventFootprints);
12366        this.renderSegs(segs);
12367        this.segs = segs;
12368    };
12369    BusinessHourRenderer.prototype.renderSegs = function (segs) {
12370        if (this.fillRenderer) {
12371            this.fillRenderer.renderSegs('businessHours', segs, {
12372                getClasses: function (seg) {
12373                    return ['fc-nonbusiness', 'fc-bgevent'];
12374                }
12375            });
12376        }
12377    };
12378    BusinessHourRenderer.prototype.unrender = function () {
12379        if (this.fillRenderer) {
12380            this.fillRenderer.unrender('businessHours');
12381        }
12382        this.segs = null;
12383    };
12384    BusinessHourRenderer.prototype.getSegs = function () {
12385        return this.segs || [];
12386    };
12387    return BusinessHourRenderer;
12388}());
12389exports.default = BusinessHourRenderer;
12390
12391
12392/***/ }),
12393/* 57 */
12394/***/ (function(module, exports, __webpack_require__) {
12395
12396Object.defineProperty(exports, "__esModule", { value: true });
12397var $ = __webpack_require__(3);
12398var util_1 = __webpack_require__(4);
12399var FillRenderer = /** @class */ (function () {
12400    function FillRenderer(component) {
12401        this.fillSegTag = 'div';
12402        this.component = component;
12403        this.elsByFill = {};
12404    }
12405    FillRenderer.prototype.renderFootprint = function (type, componentFootprint, props) {
12406        this.renderSegs(type, this.component.componentFootprintToSegs(componentFootprint), props);
12407    };
12408    FillRenderer.prototype.renderSegs = function (type, segs, props) {
12409        var els;
12410        segs = this.buildSegEls(type, segs, props); // assignes `.el` to each seg. returns successfully rendered segs
12411        els = this.attachSegEls(type, segs);
12412        if (els) {
12413            this.reportEls(type, els);
12414        }
12415        return segs;
12416    };
12417    // Unrenders a specific type of fill that is currently rendered on the grid
12418    FillRenderer.prototype.unrender = function (type) {
12419        var el = this.elsByFill[type];
12420        if (el) {
12421            el.remove();
12422            delete this.elsByFill[type];
12423        }
12424    };
12425    // Renders and assigns an `el` property for each fill segment. Generic enough to work with different types.
12426    // Only returns segments that successfully rendered.
12427    FillRenderer.prototype.buildSegEls = function (type, segs, props) {
12428        var _this = this;
12429        var html = '';
12430        var renderedSegs = [];
12431        var i;
12432        if (segs.length) {
12433            // build a large concatenation of segment HTML
12434            for (i = 0; i < segs.length; i++) {
12435                html += this.buildSegHtml(type, segs[i], props);
12436            }
12437            // Grab individual elements from the combined HTML string. Use each as the default rendering.
12438            // Then, compute the 'el' for each segment.
12439            $(html).each(function (i, node) {
12440                var seg = segs[i];
12441                var el = $(node);
12442                // allow custom filter methods per-type
12443                if (props.filterEl) {
12444                    el = props.filterEl(seg, el);
12445                }
12446                if (el) {
12447                    el = $(el); // allow custom filter to return raw DOM node
12448                    // correct element type? (would be bad if a non-TD were inserted into a table for example)
12449                    if (el.is(_this.fillSegTag)) {
12450                        seg.el = el;
12451                        renderedSegs.push(seg);
12452                    }
12453                }
12454            });
12455        }
12456        return renderedSegs;
12457    };
12458    // Builds the HTML needed for one fill segment. Generic enough to work with different types.
12459    FillRenderer.prototype.buildSegHtml = function (type, seg, props) {
12460        // custom hooks per-type
12461        var classes = props.getClasses ? props.getClasses(seg) : [];
12462        var css = util_1.cssToStr(props.getCss ? props.getCss(seg) : {});
12463        return '<' + this.fillSegTag +
12464            (classes.length ? ' class="' + classes.join(' ') + '"' : '') +
12465            (css ? ' style="' + css + '"' : '') +
12466            ' />';
12467    };
12468    // Should return wrapping DOM structure
12469    FillRenderer.prototype.attachSegEls = function (type, segs) {
12470        // subclasses must implement
12471    };
12472    FillRenderer.prototype.reportEls = function (type, nodes) {
12473        if (this.elsByFill[type]) {
12474            this.elsByFill[type] = this.elsByFill[type].add(nodes);
12475        }
12476        else {
12477            this.elsByFill[type] = $(nodes);
12478        }
12479    };
12480    return FillRenderer;
12481}());
12482exports.default = FillRenderer;
12483
12484
12485/***/ }),
12486/* 58 */
12487/***/ (function(module, exports, __webpack_require__) {
12488
12489Object.defineProperty(exports, "__esModule", { value: true });
12490var SingleEventDef_1 = __webpack_require__(13);
12491var EventFootprint_1 = __webpack_require__(35);
12492var EventSource_1 = __webpack_require__(6);
12493var HelperRenderer = /** @class */ (function () {
12494    function HelperRenderer(component, eventRenderer) {
12495        this.view = component._getView();
12496        this.component = component;
12497        this.eventRenderer = eventRenderer;
12498    }
12499    HelperRenderer.prototype.renderComponentFootprint = function (componentFootprint) {
12500        this.renderEventFootprints([
12501            this.fabricateEventFootprint(componentFootprint)
12502        ]);
12503    };
12504    HelperRenderer.prototype.renderEventDraggingFootprints = function (eventFootprints, sourceSeg, isTouch) {
12505        this.renderEventFootprints(eventFootprints, sourceSeg, 'fc-dragging', isTouch ? null : this.view.opt('dragOpacity'));
12506    };
12507    HelperRenderer.prototype.renderEventResizingFootprints = function (eventFootprints, sourceSeg, isTouch) {
12508        this.renderEventFootprints(eventFootprints, sourceSeg, 'fc-resizing');
12509    };
12510    HelperRenderer.prototype.renderEventFootprints = function (eventFootprints, sourceSeg, extraClassNames, opacity) {
12511        var segs = this.component.eventFootprintsToSegs(eventFootprints);
12512        var classNames = 'fc-helper ' + (extraClassNames || '');
12513        var i;
12514        // assigns each seg's el and returns a subset of segs that were rendered
12515        segs = this.eventRenderer.renderFgSegEls(segs);
12516        for (i = 0; i < segs.length; i++) {
12517            segs[i].el.addClass(classNames);
12518        }
12519        if (opacity != null) {
12520            for (i = 0; i < segs.length; i++) {
12521                segs[i].el.css('opacity', opacity);
12522            }
12523        }
12524        this.helperEls = this.renderSegs(segs, sourceSeg);
12525    };
12526    /*
12527    Must return all mock event elements
12528    */
12529    HelperRenderer.prototype.renderSegs = function (segs, sourceSeg) {
12530        // Subclasses must implement
12531    };
12532    HelperRenderer.prototype.unrender = function () {
12533        if (this.helperEls) {
12534            this.helperEls.remove();
12535            this.helperEls = null;
12536        }
12537    };
12538    HelperRenderer.prototype.fabricateEventFootprint = function (componentFootprint) {
12539        var calendar = this.view.calendar;
12540        var eventDateProfile = calendar.footprintToDateProfile(componentFootprint);
12541        var dummyEvent = new SingleEventDef_1.default(new EventSource_1.default(calendar));
12542        var dummyInstance;
12543        dummyEvent.dateProfile = eventDateProfile;
12544        dummyInstance = dummyEvent.buildInstance();
12545        return new EventFootprint_1.default(componentFootprint, dummyEvent, dummyInstance);
12546    };
12547    return HelperRenderer;
12548}());
12549exports.default = HelperRenderer;
12550
12551
12552/***/ }),
12553/* 59 */
12554/***/ (function(module, exports, __webpack_require__) {
12555
12556Object.defineProperty(exports, "__esModule", { value: true });
12557var tslib_1 = __webpack_require__(2);
12558var GlobalEmitter_1 = __webpack_require__(15);
12559var Interaction_1 = __webpack_require__(16);
12560var EventPointing = /** @class */ (function (_super) {
12561    tslib_1.__extends(EventPointing, _super);
12562    function EventPointing() {
12563        return _super !== null && _super.apply(this, arguments) || this;
12564    }
12565    /*
12566    component must implement:
12567      - publiclyTrigger
12568    */
12569    EventPointing.prototype.bindToEl = function (el) {
12570        var component = this.component;
12571        component.bindSegHandlerToEl(el, 'click', this.handleClick.bind(this));
12572        component.bindSegHandlerToEl(el, 'mouseenter', this.handleMouseover.bind(this));
12573        component.bindSegHandlerToEl(el, 'mouseleave', this.handleMouseout.bind(this));
12574    };
12575    EventPointing.prototype.handleClick = function (seg, ev) {
12576        var res = this.component.publiclyTrigger('eventClick', {
12577            context: seg.el[0],
12578            args: [seg.footprint.getEventLegacy(), ev, this.view]
12579        });
12580        if (res === false) {
12581            ev.preventDefault();
12582        }
12583    };
12584    // Updates internal state and triggers handlers for when an event element is moused over
12585    EventPointing.prototype.handleMouseover = function (seg, ev) {
12586        if (!GlobalEmitter_1.default.get().shouldIgnoreMouse() &&
12587            !this.mousedOverSeg) {
12588            this.mousedOverSeg = seg;
12589            // TODO: move to EventSelecting's responsibility
12590            if (this.view.isEventDefResizable(seg.footprint.eventDef)) {
12591                seg.el.addClass('fc-allow-mouse-resize');
12592            }
12593            this.component.publiclyTrigger('eventMouseover', {
12594                context: seg.el[0],
12595                args: [seg.footprint.getEventLegacy(), ev, this.view]
12596            });
12597        }
12598    };
12599    // Updates internal state and triggers handlers for when an event element is moused out.
12600    // Can be given no arguments, in which case it will mouseout the segment that was previously moused over.
12601    EventPointing.prototype.handleMouseout = function (seg, ev) {
12602        if (this.mousedOverSeg) {
12603            this.mousedOverSeg = null;
12604            // TODO: move to EventSelecting's responsibility
12605            if (this.view.isEventDefResizable(seg.footprint.eventDef)) {
12606                seg.el.removeClass('fc-allow-mouse-resize');
12607            }
12608            this.component.publiclyTrigger('eventMouseout', {
12609                context: seg.el[0],
12610                args: [
12611                    seg.footprint.getEventLegacy(),
12612                    ev || {},
12613                    this.view
12614                ]
12615            });
12616        }
12617    };
12618    EventPointing.prototype.end = function () {
12619        if (this.mousedOverSeg) {
12620            this.handleMouseout(this.mousedOverSeg);
12621        }
12622    };
12623    return EventPointing;
12624}(Interaction_1.default));
12625exports.default = EventPointing;
12626
12627
12628/***/ }),
12629/* 60 */
12630/***/ (function(module, exports, __webpack_require__) {
12631
12632Object.defineProperty(exports, "__esModule", { value: true });
12633var tslib_1 = __webpack_require__(2);
12634var Mixin_1 = __webpack_require__(14);
12635var DateClicking_1 = __webpack_require__(245);
12636var DateSelecting_1 = __webpack_require__(225);
12637var EventPointing_1 = __webpack_require__(59);
12638var EventDragging_1 = __webpack_require__(224);
12639var EventResizing_1 = __webpack_require__(223);
12640var ExternalDropping_1 = __webpack_require__(222);
12641var StandardInteractionsMixin = /** @class */ (function (_super) {
12642    tslib_1.__extends(StandardInteractionsMixin, _super);
12643    function StandardInteractionsMixin() {
12644        return _super !== null && _super.apply(this, arguments) || this;
12645    }
12646    return StandardInteractionsMixin;
12647}(Mixin_1.default));
12648exports.default = StandardInteractionsMixin;
12649StandardInteractionsMixin.prototype.dateClickingClass = DateClicking_1.default;
12650StandardInteractionsMixin.prototype.dateSelectingClass = DateSelecting_1.default;
12651StandardInteractionsMixin.prototype.eventPointingClass = EventPointing_1.default;
12652StandardInteractionsMixin.prototype.eventDraggingClass = EventDragging_1.default;
12653StandardInteractionsMixin.prototype.eventResizingClass = EventResizing_1.default;
12654StandardInteractionsMixin.prototype.externalDroppingClass = ExternalDropping_1.default;
12655
12656
12657/***/ }),
12658/* 61 */
12659/***/ (function(module, exports, __webpack_require__) {
12660
12661Object.defineProperty(exports, "__esModule", { value: true });
12662var tslib_1 = __webpack_require__(2);
12663var $ = __webpack_require__(3);
12664var util_1 = __webpack_require__(4);
12665var CoordCache_1 = __webpack_require__(53);
12666var Popover_1 = __webpack_require__(249);
12667var UnzonedRange_1 = __webpack_require__(5);
12668var ComponentFootprint_1 = __webpack_require__(12);
12669var EventFootprint_1 = __webpack_require__(35);
12670var BusinessHourRenderer_1 = __webpack_require__(56);
12671var StandardInteractionsMixin_1 = __webpack_require__(60);
12672var InteractiveDateComponent_1 = __webpack_require__(40);
12673var DayTableMixin_1 = __webpack_require__(55);
12674var DayGridEventRenderer_1 = __webpack_require__(250);
12675var DayGridHelperRenderer_1 = __webpack_require__(251);
12676var DayGridFillRenderer_1 = __webpack_require__(252);
12677/* A component that renders a grid of whole-days that runs horizontally. There can be multiple rows, one per week.
12678----------------------------------------------------------------------------------------------------------------------*/
12679var DayGrid = /** @class */ (function (_super) {
12680    tslib_1.__extends(DayGrid, _super);
12681    function DayGrid(view) {
12682        var _this = _super.call(this, view) || this;
12683        _this.cellWeekNumbersVisible = false; // display week numbers in day cell?
12684        _this.bottomCoordPadding = 0; // hack for extending the hit area for the last row of the coordinate grid
12685        // isRigid determines whether the individual rows should ignore the contents and be a constant height.
12686        // Relies on the view's colCnt and rowCnt. In the future, this component should probably be self-sufficient.
12687        _this.isRigid = false;
12688        _this.hasAllDayBusinessHours = true;
12689        return _this;
12690    }
12691    // Slices up the given span (unzoned start/end with other misc data) into an array of segments
12692    DayGrid.prototype.componentFootprintToSegs = function (componentFootprint) {
12693        var segs = this.sliceRangeByRow(componentFootprint.unzonedRange);
12694        var i;
12695        var seg;
12696        for (i = 0; i < segs.length; i++) {
12697            seg = segs[i];
12698            if (this.isRTL) {
12699                seg.leftCol = this.daysPerRow - 1 - seg.lastRowDayIndex;
12700                seg.rightCol = this.daysPerRow - 1 - seg.firstRowDayIndex;
12701            }
12702            else {
12703                seg.leftCol = seg.firstRowDayIndex;
12704                seg.rightCol = seg.lastRowDayIndex;
12705            }
12706        }
12707        return segs;
12708    };
12709    /* Date Rendering
12710    ------------------------------------------------------------------------------------------------------------------*/
12711    DayGrid.prototype.renderDates = function (dateProfile) {
12712        this.dateProfile = dateProfile;
12713        this.updateDayTable();
12714        this.renderGrid();
12715    };
12716    DayGrid.prototype.unrenderDates = function () {
12717        this.removeSegPopover();
12718    };
12719    // Renders the rows and columns into the component's `this.el`, which should already be assigned.
12720    DayGrid.prototype.renderGrid = function () {
12721        var view = this.view;
12722        var rowCnt = this.rowCnt;
12723        var colCnt = this.colCnt;
12724        var html = '';
12725        var row;
12726        var col;
12727        if (this.headContainerEl) {
12728            this.headContainerEl.html(this.renderHeadHtml());
12729        }
12730        for (row = 0; row < rowCnt; row++) {
12731            html += this.renderDayRowHtml(row, this.isRigid);
12732        }
12733        this.el.html(html);
12734        this.rowEls = this.el.find('.fc-row');
12735        this.cellEls = this.el.find('.fc-day, .fc-disabled-day');
12736        this.rowCoordCache = new CoordCache_1.default({
12737            els: this.rowEls,
12738            isVertical: true
12739        });
12740        this.colCoordCache = new CoordCache_1.default({
12741            els: this.cellEls.slice(0, this.colCnt),
12742            isHorizontal: true
12743        });
12744        // trigger dayRender with each cell's element
12745        for (row = 0; row < rowCnt; row++) {
12746            for (col = 0; col < colCnt; col++) {
12747                this.publiclyTrigger('dayRender', {
12748                    context: view,
12749                    args: [
12750                        this.getCellDate(row, col),
12751                        this.getCellEl(row, col),
12752                        view
12753                    ]
12754                });
12755            }
12756        }
12757    };
12758    // Generates the HTML for a single row, which is a div that wraps a table.
12759    // `row` is the row number.
12760    DayGrid.prototype.renderDayRowHtml = function (row, isRigid) {
12761        var theme = this.view.calendar.theme;
12762        var classes = ['fc-row', 'fc-week', theme.getClass('dayRow')];
12763        if (isRigid) {
12764            classes.push('fc-rigid');
12765        }
12766        return '' +
12767            '<div class="' + classes.join(' ') + '">' +
12768            '<div class="fc-bg">' +
12769            '<table class="' + theme.getClass('tableGrid') + '">' +
12770            this.renderBgTrHtml(row) +
12771            '</table>' +
12772            '</div>' +
12773            '<div class="fc-content-skeleton">' +
12774            '<table>' +
12775            (this.getIsNumbersVisible() ?
12776                '<thead>' +
12777                    this.renderNumberTrHtml(row) +
12778                    '</thead>' :
12779                '') +
12780            '</table>' +
12781            '</div>' +
12782            '</div>';
12783    };
12784    DayGrid.prototype.getIsNumbersVisible = function () {
12785        return this.getIsDayNumbersVisible() || this.cellWeekNumbersVisible;
12786    };
12787    DayGrid.prototype.getIsDayNumbersVisible = function () {
12788        return this.rowCnt > 1;
12789    };
12790    /* Grid Number Rendering
12791    ------------------------------------------------------------------------------------------------------------------*/
12792    DayGrid.prototype.renderNumberTrHtml = function (row) {
12793        return '' +
12794            '<tr>' +
12795            (this.isRTL ? '' : this.renderNumberIntroHtml(row)) +
12796            this.renderNumberCellsHtml(row) +
12797            (this.isRTL ? this.renderNumberIntroHtml(row) : '') +
12798            '</tr>';
12799    };
12800    DayGrid.prototype.renderNumberIntroHtml = function (row) {
12801        return this.renderIntroHtml();
12802    };
12803    DayGrid.prototype.renderNumberCellsHtml = function (row) {
12804        var htmls = [];
12805        var col;
12806        var date;
12807        for (col = 0; col < this.colCnt; col++) {
12808            date = this.getCellDate(row, col);
12809            htmls.push(this.renderNumberCellHtml(date));
12810        }
12811        return htmls.join('');
12812    };
12813    // Generates the HTML for the <td>s of the "number" row in the DayGrid's content skeleton.
12814    // The number row will only exist if either day numbers or week numbers are turned on.
12815    DayGrid.prototype.renderNumberCellHtml = function (date) {
12816        var view = this.view;
12817        var html = '';
12818        var isDateValid = this.dateProfile.activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow.
12819        var isDayNumberVisible = this.getIsDayNumbersVisible() && isDateValid;
12820        var classes;
12821        var weekCalcFirstDoW;
12822        if (!isDayNumberVisible && !this.cellWeekNumbersVisible) {
12823            // no numbers in day cell (week number must be along the side)
12824            return '<td/>'; //  will create an empty space above events :(
12825        }
12826        classes = this.getDayClasses(date);
12827        classes.unshift('fc-day-top');
12828        if (this.cellWeekNumbersVisible) {
12829            // To determine the day of week number change under ISO, we cannot
12830            // rely on moment.js methods such as firstDayOfWeek() or weekday(),
12831            // because they rely on the locale's dow (possibly overridden by
12832            // our firstDay option), which may not be Monday. We cannot change
12833            // dow, because that would affect the calendar start day as well.
12834            if (date._locale._fullCalendar_weekCalc === 'ISO') {
12835                weekCalcFirstDoW = 1; // Monday by ISO 8601 definition
12836            }
12837            else {
12838                weekCalcFirstDoW = date._locale.firstDayOfWeek();
12839            }
12840        }
12841        html += '<td class="' + classes.join(' ') + '"' +
12842            (isDateValid ?
12843                ' data-date="' + date.format() + '"' :
12844                '') +
12845            '>';
12846        if (this.cellWeekNumbersVisible && (date.day() === weekCalcFirstDoW)) {
12847            html += view.buildGotoAnchorHtml({ date: date, type: 'week' }, { 'class': 'fc-week-number' }, date.format('w') // inner HTML
12848            );
12849        }
12850        if (isDayNumberVisible) {
12851            html += view.buildGotoAnchorHtml(date, { 'class': 'fc-day-number' }, date.format('D') // inner HTML
12852            );
12853        }
12854        html += '</td>';
12855        return html;
12856    };
12857    /* Hit System
12858    ------------------------------------------------------------------------------------------------------------------*/
12859    DayGrid.prototype.prepareHits = function () {
12860        this.colCoordCache.build();
12861        this.rowCoordCache.build();
12862        this.rowCoordCache.bottoms[this.rowCnt - 1] += this.bottomCoordPadding; // hack
12863    };
12864    DayGrid.prototype.releaseHits = function () {
12865        this.colCoordCache.clear();
12866        this.rowCoordCache.clear();
12867    };
12868    DayGrid.prototype.queryHit = function (leftOffset, topOffset) {
12869        if (this.colCoordCache.isLeftInBounds(leftOffset) && this.rowCoordCache.isTopInBounds(topOffset)) {
12870            var col = this.colCoordCache.getHorizontalIndex(leftOffset);
12871            var row = this.rowCoordCache.getVerticalIndex(topOffset);
12872            if (row != null && col != null) {
12873                return this.getCellHit(row, col);
12874            }
12875        }
12876    };
12877    DayGrid.prototype.getHitFootprint = function (hit) {
12878        var range = this.getCellRange(hit.row, hit.col);
12879        return new ComponentFootprint_1.default(new UnzonedRange_1.default(range.start, range.end), true // all-day?
12880        );
12881    };
12882    DayGrid.prototype.getHitEl = function (hit) {
12883        return this.getCellEl(hit.row, hit.col);
12884    };
12885    /* Cell System
12886    ------------------------------------------------------------------------------------------------------------------*/
12887    // FYI: the first column is the leftmost column, regardless of date
12888    DayGrid.prototype.getCellHit = function (row, col) {
12889        return {
12890            row: row,
12891            col: col,
12892            component: this,
12893            left: this.colCoordCache.getLeftOffset(col),
12894            right: this.colCoordCache.getRightOffset(col),
12895            top: this.rowCoordCache.getTopOffset(row),
12896            bottom: this.rowCoordCache.getBottomOffset(row)
12897        };
12898    };
12899    DayGrid.prototype.getCellEl = function (row, col) {
12900        return this.cellEls.eq(row * this.colCnt + col);
12901    };
12902    /* Event Rendering
12903    ------------------------------------------------------------------------------------------------------------------*/
12904    // Unrenders all events currently rendered on the grid
12905    DayGrid.prototype.executeEventUnrender = function () {
12906        this.removeSegPopover(); // removes the "more.." events popover
12907        _super.prototype.executeEventUnrender.call(this);
12908    };
12909    // Retrieves all rendered segment objects currently rendered on the grid
12910    DayGrid.prototype.getOwnEventSegs = function () {
12911        // append the segments from the "more..." popover
12912        return _super.prototype.getOwnEventSegs.call(this).concat(this.popoverSegs || []);
12913    };
12914    /* Event Drag Visualization
12915    ------------------------------------------------------------------------------------------------------------------*/
12916    // Renders a visual indication of an event or external element being dragged.
12917    // `eventLocation` has zoned start and end (optional)
12918    DayGrid.prototype.renderDrag = function (eventFootprints, seg, isTouch) {
12919        var i;
12920        for (i = 0; i < eventFootprints.length; i++) {
12921            this.renderHighlight(eventFootprints[i].componentFootprint);
12922        }
12923        // render drags from OTHER components as helpers
12924        if (eventFootprints.length && seg && seg.component !== this) {
12925            this.helperRenderer.renderEventDraggingFootprints(eventFootprints, seg, isTouch);
12926            return true; // signal helpers rendered
12927        }
12928    };
12929    // Unrenders any visual indication of a hovering event
12930    DayGrid.prototype.unrenderDrag = function () {
12931        this.unrenderHighlight();
12932        this.helperRenderer.unrender();
12933    };
12934    /* Event Resize Visualization
12935    ------------------------------------------------------------------------------------------------------------------*/
12936    // Renders a visual indication of an event being resized
12937    DayGrid.prototype.renderEventResize = function (eventFootprints, seg, isTouch) {
12938        var i;
12939        for (i = 0; i < eventFootprints.length; i++) {
12940            this.renderHighlight(eventFootprints[i].componentFootprint);
12941        }
12942        this.helperRenderer.renderEventResizingFootprints(eventFootprints, seg, isTouch);
12943    };
12944    // Unrenders a visual indication of an event being resized
12945    DayGrid.prototype.unrenderEventResize = function () {
12946        this.unrenderHighlight();
12947        this.helperRenderer.unrender();
12948    };
12949    /* More+ Link Popover
12950    ------------------------------------------------------------------------------------------------------------------*/
12951    DayGrid.prototype.removeSegPopover = function () {
12952        if (this.segPopover) {
12953            this.segPopover.hide(); // in handler, will call segPopover's removeElement
12954        }
12955    };
12956    // Limits the number of "levels" (vertically stacking layers of events) for each row of the grid.
12957    // `levelLimit` can be false (don't limit), a number, or true (should be computed).
12958    DayGrid.prototype.limitRows = function (levelLimit) {
12959        var rowStructs = this.eventRenderer.rowStructs || [];
12960        var row; // row #
12961        var rowLevelLimit;
12962        for (row = 0; row < rowStructs.length; row++) {
12963            this.unlimitRow(row);
12964            if (!levelLimit) {
12965                rowLevelLimit = false;
12966            }
12967            else if (typeof levelLimit === 'number') {
12968                rowLevelLimit = levelLimit;
12969            }
12970            else {
12971                rowLevelLimit = this.computeRowLevelLimit(row);
12972            }
12973            if (rowLevelLimit !== false) {
12974                this.limitRow(row, rowLevelLimit);
12975            }
12976        }
12977    };
12978    // Computes the number of levels a row will accomodate without going outside its bounds.
12979    // Assumes the row is "rigid" (maintains a constant height regardless of what is inside).
12980    // `row` is the row number.
12981    DayGrid.prototype.computeRowLevelLimit = function (row) {
12982        var rowEl = this.rowEls.eq(row); // the containing "fake" row div
12983        var rowHeight = rowEl.height(); // TODO: cache somehow?
12984        var trEls = this.eventRenderer.rowStructs[row].tbodyEl.children();
12985        var i;
12986        var trEl;
12987        var trHeight;
12988        function iterInnerHeights(i, childNode) {
12989            trHeight = Math.max(trHeight, $(childNode).outerHeight());
12990        }
12991        // Reveal one level <tr> at a time and stop when we find one out of bounds
12992        for (i = 0; i < trEls.length; i++) {
12993            trEl = trEls.eq(i).removeClass('fc-limited'); // reset to original state (reveal)
12994            // with rowspans>1 and IE8, trEl.outerHeight() would return the height of the largest cell,
12995            // so instead, find the tallest inner content element.
12996            trHeight = 0;
12997            trEl.find('> td > :first-child').each(iterInnerHeights);
12998            if (trEl.position().top + trHeight > rowHeight) {
12999                return i;
13000            }
13001        }
13002        return false; // should not limit at all
13003    };
13004    // Limits the given grid row to the maximum number of levels and injects "more" links if necessary.
13005    // `row` is the row number.
13006    // `levelLimit` is a number for the maximum (inclusive) number of levels allowed.
13007    DayGrid.prototype.limitRow = function (row, levelLimit) {
13008        var _this = this;
13009        var rowStruct = this.eventRenderer.rowStructs[row];
13010        var moreNodes = []; // array of "more" <a> links and <td> DOM nodes
13011        var col = 0; // col #, left-to-right (not chronologically)
13012        var levelSegs; // array of segment objects in the last allowable level, ordered left-to-right
13013        var cellMatrix; // a matrix (by level, then column) of all <td> jQuery elements in the row
13014        var limitedNodes; // array of temporarily hidden level <tr> and segment <td> DOM nodes
13015        var i;
13016        var seg;
13017        var segsBelow; // array of segment objects below `seg` in the current `col`
13018        var totalSegsBelow; // total number of segments below `seg` in any of the columns `seg` occupies
13019        var colSegsBelow; // array of segment arrays, below seg, one for each column (offset from segs's first column)
13020        var td;
13021        var rowspan;
13022        var segMoreNodes; // array of "more" <td> cells that will stand-in for the current seg's cell
13023        var j;
13024        var moreTd;
13025        var moreWrap;
13026        var moreLink;
13027        // Iterates through empty level cells and places "more" links inside if need be
13028        var emptyCellsUntil = function (endCol) {
13029            while (col < endCol) {
13030                segsBelow = _this.getCellSegs(row, col, levelLimit);
13031                if (segsBelow.length) {
13032                    td = cellMatrix[levelLimit - 1][col];
13033                    moreLink = _this.renderMoreLink(row, col, segsBelow);
13034                    moreWrap = $('<div/>').append(moreLink);
13035                    td.append(moreWrap);
13036                    moreNodes.push(moreWrap[0]);
13037                }
13038                col++;
13039            }
13040        };
13041        if (levelLimit && levelLimit < rowStruct.segLevels.length) {
13042            levelSegs = rowStruct.segLevels[levelLimit - 1];
13043            cellMatrix = rowStruct.cellMatrix;
13044            limitedNodes = rowStruct.tbodyEl.children().slice(levelLimit) // get level <tr> elements past the limit
13045                .addClass('fc-limited').get(); // hide elements and get a simple DOM-nodes array
13046            // iterate though segments in the last allowable level
13047            for (i = 0; i < levelSegs.length; i++) {
13048                seg = levelSegs[i];
13049                emptyCellsUntil(seg.leftCol); // process empty cells before the segment
13050                // determine *all* segments below `seg` that occupy the same columns
13051                colSegsBelow = [];
13052                totalSegsBelow = 0;
13053                while (col <= seg.rightCol) {
13054                    segsBelow = this.getCellSegs(row, col, levelLimit);
13055                    colSegsBelow.push(segsBelow);
13056                    totalSegsBelow += segsBelow.length;
13057                    col++;
13058                }
13059                if (totalSegsBelow) {
13060                    td = cellMatrix[levelLimit - 1][seg.leftCol]; // the segment's parent cell
13061                    rowspan = td.attr('rowspan') || 1;
13062                    segMoreNodes = [];
13063                    // make a replacement <td> for each column the segment occupies. will be one for each colspan
13064                    for (j = 0; j < colSegsBelow.length; j++) {
13065                        moreTd = $('<td class="fc-more-cell"/>').attr('rowspan', rowspan);
13066                        segsBelow = colSegsBelow[j];
13067                        moreLink = this.renderMoreLink(row, seg.leftCol + j, [seg].concat(segsBelow) // count seg as hidden too
13068                        );
13069                        moreWrap = $('<div/>').append(moreLink);
13070                        moreTd.append(moreWrap);
13071                        segMoreNodes.push(moreTd[0]);
13072                        moreNodes.push(moreTd[0]);
13073                    }
13074                    td.addClass('fc-limited').after($(segMoreNodes)); // hide original <td> and inject replacements
13075                    limitedNodes.push(td[0]);
13076                }
13077            }
13078            emptyCellsUntil(this.colCnt); // finish off the level
13079            rowStruct.moreEls = $(moreNodes); // for easy undoing later
13080            rowStruct.limitedEls = $(limitedNodes); // for easy undoing later
13081        }
13082    };
13083    // Reveals all levels and removes all "more"-related elements for a grid's row.
13084    // `row` is a row number.
13085    DayGrid.prototype.unlimitRow = function (row) {
13086        var rowStruct = this.eventRenderer.rowStructs[row];
13087        if (rowStruct.moreEls) {
13088            rowStruct.moreEls.remove();
13089            rowStruct.moreEls = null;
13090        }
13091        if (rowStruct.limitedEls) {
13092            rowStruct.limitedEls.removeClass('fc-limited');
13093            rowStruct.limitedEls = null;
13094        }
13095    };
13096    // Renders an <a> element that represents hidden event element for a cell.
13097    // Responsible for attaching click handler as well.
13098    DayGrid.prototype.renderMoreLink = function (row, col, hiddenSegs) {
13099        var _this = this;
13100        var view = this.view;
13101        return $('<a class="fc-more"/>')
13102            .text(this.getMoreLinkText(hiddenSegs.length))
13103            .on('click', function (ev) {
13104            var clickOption = _this.opt('eventLimitClick');
13105            var date = _this.getCellDate(row, col);
13106            var moreEl = $(ev.currentTarget);
13107            var dayEl = _this.getCellEl(row, col);
13108            var allSegs = _this.getCellSegs(row, col);
13109            // rescope the segments to be within the cell's date
13110            var reslicedAllSegs = _this.resliceDaySegs(allSegs, date);
13111            var reslicedHiddenSegs = _this.resliceDaySegs(hiddenSegs, date);
13112            if (typeof clickOption === 'function') {
13113                // the returned value can be an atomic option
13114                clickOption = _this.publiclyTrigger('eventLimitClick', {
13115                    context: view,
13116                    args: [
13117                        {
13118                            date: date.clone(),
13119                            dayEl: dayEl,
13120                            moreEl: moreEl,
13121                            segs: reslicedAllSegs,
13122                            hiddenSegs: reslicedHiddenSegs
13123                        },
13124                        ev,
13125                        view
13126                    ]
13127                });
13128            }
13129            if (clickOption === 'popover') {
13130                _this.showSegPopover(row, col, moreEl, reslicedAllSegs);
13131            }
13132            else if (typeof clickOption === 'string') {
13133                view.calendar.zoomTo(date, clickOption);
13134            }
13135        });
13136    };
13137    // Reveals the popover that displays all events within a cell
13138    DayGrid.prototype.showSegPopover = function (row, col, moreLink, segs) {
13139        var _this = this;
13140        var view = this.view;
13141        var moreWrap = moreLink.parent(); // the <div> wrapper around the <a>
13142        var topEl; // the element we want to match the top coordinate of
13143        var options;
13144        if (this.rowCnt === 1) {
13145            topEl = view.el; // will cause the popover to cover any sort of header
13146        }
13147        else {
13148            topEl = this.rowEls.eq(row); // will align with top of row
13149        }
13150        options = {
13151            className: 'fc-more-popover ' + view.calendar.theme.getClass('popover'),
13152            content: this.renderSegPopoverContent(row, col, segs),
13153            parentEl: view.el,
13154            top: topEl.offset().top,
13155            autoHide: true,
13156            viewportConstrain: this.opt('popoverViewportConstrain'),
13157            hide: function () {
13158                // kill everything when the popover is hidden
13159                // notify events to be removed
13160                if (_this.popoverSegs) {
13161                    _this.triggerBeforeEventSegsDestroyed(_this.popoverSegs);
13162                }
13163                _this.segPopover.removeElement();
13164                _this.segPopover = null;
13165                _this.popoverSegs = null;
13166            }
13167        };
13168        // Determine horizontal coordinate.
13169        // We use the moreWrap instead of the <td> to avoid border confusion.
13170        if (this.isRTL) {
13171            options.right = moreWrap.offset().left + moreWrap.outerWidth() + 1; // +1 to be over cell border
13172        }
13173        else {
13174            options.left = moreWrap.offset().left - 1; // -1 to be over cell border
13175        }
13176        this.segPopover = new Popover_1.default(options);
13177        this.segPopover.show();
13178        // the popover doesn't live within the grid's container element, and thus won't get the event
13179        // delegated-handlers for free. attach event-related handlers to the popover.
13180        this.bindAllSegHandlersToEl(this.segPopover.el);
13181        this.triggerAfterEventSegsRendered(segs);
13182    };
13183    // Builds the inner DOM contents of the segment popover
13184    DayGrid.prototype.renderSegPopoverContent = function (row, col, segs) {
13185        var view = this.view;
13186        var theme = view.calendar.theme;
13187        var title = this.getCellDate(row, col).format(this.opt('dayPopoverFormat'));
13188        var content = $('<div class="fc-header ' + theme.getClass('popoverHeader') + '">' +
13189            '<span class="fc-close ' + theme.getIconClass('close') + '"></span>' +
13190            '<span class="fc-title">' +
13191            util_1.htmlEscape(title) +
13192            '</span>' +
13193            '<div class="fc-clear"/>' +
13194            '</div>' +
13195            '<div class="fc-body ' + theme.getClass('popoverContent') + '">' +
13196            '<div class="fc-event-container"></div>' +
13197            '</div>');
13198        var segContainer = content.find('.fc-event-container');
13199        var i;
13200        // render each seg's `el` and only return the visible segs
13201        segs = this.eventRenderer.renderFgSegEls(segs, true); // disableResizing=true
13202        this.popoverSegs = segs;
13203        for (i = 0; i < segs.length; i++) {
13204            // because segments in the popover are not part of a grid coordinate system, provide a hint to any
13205            // grids that want to do drag-n-drop about which cell it came from
13206            this.hitsNeeded();
13207            segs[i].hit = this.getCellHit(row, col);
13208            this.hitsNotNeeded();
13209            segContainer.append(segs[i].el);
13210        }
13211        return content;
13212    };
13213    // Given the events within an array of segment objects, reslice them to be in a single day
13214    DayGrid.prototype.resliceDaySegs = function (segs, dayDate) {
13215        var dayStart = dayDate.clone();
13216        var dayEnd = dayStart.clone().add(1, 'days');
13217        var dayRange = new UnzonedRange_1.default(dayStart, dayEnd);
13218        var newSegs = [];
13219        var i;
13220        var seg;
13221        var slicedRange;
13222        for (i = 0; i < segs.length; i++) {
13223            seg = segs[i];
13224            slicedRange = seg.footprint.componentFootprint.unzonedRange.intersect(dayRange);
13225            if (slicedRange) {
13226                newSegs.push($.extend({}, seg, {
13227                    footprint: new EventFootprint_1.default(new ComponentFootprint_1.default(slicedRange, seg.footprint.componentFootprint.isAllDay), seg.footprint.eventDef, seg.footprint.eventInstance),
13228                    isStart: seg.isStart && slicedRange.isStart,
13229                    isEnd: seg.isEnd && slicedRange.isEnd
13230                }));
13231            }
13232        }
13233        // force an order because eventsToSegs doesn't guarantee one
13234        // TODO: research if still needed
13235        this.eventRenderer.sortEventSegs(newSegs);
13236        return newSegs;
13237    };
13238    // Generates the text that should be inside a "more" link, given the number of events it represents
13239    DayGrid.prototype.getMoreLinkText = function (num) {
13240        var opt = this.opt('eventLimitText');
13241        if (typeof opt === 'function') {
13242            return opt(num);
13243        }
13244        else {
13245            return '+' + num + ' ' + opt;
13246        }
13247    };
13248    // Returns segments within a given cell.
13249    // If `startLevel` is specified, returns only events including and below that level. Otherwise returns all segs.
13250    DayGrid.prototype.getCellSegs = function (row, col, startLevel) {
13251        var segMatrix = this.eventRenderer.rowStructs[row].segMatrix;
13252        var level = startLevel || 0;
13253        var segs = [];
13254        var seg;
13255        while (level < segMatrix.length) {
13256            seg = segMatrix[level][col];
13257            if (seg) {
13258                segs.push(seg);
13259            }
13260            level++;
13261        }
13262        return segs;
13263    };
13264    return DayGrid;
13265}(InteractiveDateComponent_1.default));
13266exports.default = DayGrid;
13267DayGrid.prototype.eventRendererClass = DayGridEventRenderer_1.default;
13268DayGrid.prototype.businessHourRendererClass = BusinessHourRenderer_1.default;
13269DayGrid.prototype.helperRendererClass = DayGridHelperRenderer_1.default;
13270DayGrid.prototype.fillRendererClass = DayGridFillRenderer_1.default;
13271StandardInteractionsMixin_1.default.mixInto(DayGrid);
13272DayTableMixin_1.default.mixInto(DayGrid);
13273
13274
13275/***/ }),
13276/* 62 */
13277/***/ (function(module, exports, __webpack_require__) {
13278
13279Object.defineProperty(exports, "__esModule", { value: true });
13280var tslib_1 = __webpack_require__(2);
13281var $ = __webpack_require__(3);
13282var util_1 = __webpack_require__(4);
13283var Scroller_1 = __webpack_require__(39);
13284var View_1 = __webpack_require__(41);
13285var BasicViewDateProfileGenerator_1 = __webpack_require__(228);
13286var DayGrid_1 = __webpack_require__(61);
13287/* An abstract class for the "basic" views, as well as month view. Renders one or more rows of day cells.
13288----------------------------------------------------------------------------------------------------------------------*/
13289// It is a manager for a DayGrid subcomponent, which does most of the heavy lifting.
13290// It is responsible for managing width/height.
13291var BasicView = /** @class */ (function (_super) {
13292    tslib_1.__extends(BasicView, _super);
13293    function BasicView(calendar, viewSpec) {
13294        var _this = _super.call(this, calendar, viewSpec) || this;
13295        _this.dayGrid = _this.instantiateDayGrid();
13296        _this.dayGrid.isRigid = _this.hasRigidRows();
13297        if (_this.opt('weekNumbers')) {
13298            if (_this.opt('weekNumbersWithinDays')) {
13299                _this.dayGrid.cellWeekNumbersVisible = true;
13300                _this.dayGrid.colWeekNumbersVisible = false;
13301            }
13302            else {
13303                _this.dayGrid.cellWeekNumbersVisible = false;
13304                _this.dayGrid.colWeekNumbersVisible = true;
13305            }
13306        }
13307        _this.addChild(_this.dayGrid);
13308        _this.scroller = new Scroller_1.default({
13309            overflowX: 'hidden',
13310            overflowY: 'auto'
13311        });
13312        return _this;
13313    }
13314    // Generates the DayGrid object this view needs. Draws from this.dayGridClass
13315    BasicView.prototype.instantiateDayGrid = function () {
13316        // generate a subclass on the fly with BasicView-specific behavior
13317        // TODO: cache this subclass
13318        var subclass = makeDayGridSubclass(this.dayGridClass);
13319        return new subclass(this);
13320    };
13321    BasicView.prototype.executeDateRender = function (dateProfile) {
13322        this.dayGrid.breakOnWeeks = /year|month|week/.test(dateProfile.currentRangeUnit);
13323        _super.prototype.executeDateRender.call(this, dateProfile);
13324    };
13325    BasicView.prototype.renderSkeleton = function () {
13326        var dayGridContainerEl;
13327        var dayGridEl;
13328        this.el.addClass('fc-basic-view').html(this.renderSkeletonHtml());
13329        this.scroller.render();
13330        dayGridContainerEl = this.scroller.el.addClass('fc-day-grid-container');
13331        dayGridEl = $('<div class="fc-day-grid" />').appendTo(dayGridContainerEl);
13332        this.el.find('.fc-body > tr > td').append(dayGridContainerEl);
13333        this.dayGrid.headContainerEl = this.el.find('.fc-head-container');
13334        this.dayGrid.setElement(dayGridEl);
13335    };
13336    BasicView.prototype.unrenderSkeleton = function () {
13337        this.dayGrid.removeElement();
13338        this.scroller.destroy();
13339    };
13340    // Builds the HTML skeleton for the view.
13341    // The day-grid component will render inside of a container defined by this HTML.
13342    BasicView.prototype.renderSkeletonHtml = function () {
13343        var theme = this.calendar.theme;
13344        return '' +
13345            '<table class="' + theme.getClass('tableGrid') + '">' +
13346            (this.opt('columnHeader') ?
13347                '<thead class="fc-head">' +
13348                    '<tr>' +
13349                    '<td class="fc-head-container ' + theme.getClass('widgetHeader') + '">&nbsp;</td>' +
13350                    '</tr>' +
13351                    '</thead>' :
13352                '') +
13353            '<tbody class="fc-body">' +
13354            '<tr>' +
13355            '<td class="' + theme.getClass('widgetContent') + '"></td>' +
13356            '</tr>' +
13357            '</tbody>' +
13358            '</table>';
13359    };
13360    // Generates an HTML attribute string for setting the width of the week number column, if it is known
13361    BasicView.prototype.weekNumberStyleAttr = function () {
13362        if (this.weekNumberWidth != null) {
13363            return 'style="width:' + this.weekNumberWidth + 'px"';
13364        }
13365        return '';
13366    };
13367    // Determines whether each row should have a constant height
13368    BasicView.prototype.hasRigidRows = function () {
13369        var eventLimit = this.opt('eventLimit');
13370        return eventLimit && typeof eventLimit !== 'number';
13371    };
13372    /* Dimensions
13373    ------------------------------------------------------------------------------------------------------------------*/
13374    // Refreshes the horizontal dimensions of the view
13375    BasicView.prototype.updateSize = function (totalHeight, isAuto, isResize) {
13376        var eventLimit = this.opt('eventLimit');
13377        var headRowEl = this.dayGrid.headContainerEl.find('.fc-row');
13378        var scrollerHeight;
13379        var scrollbarWidths;
13380        // hack to give the view some height prior to dayGrid's columns being rendered
13381        // TODO: separate setting height from scroller VS dayGrid.
13382        if (!this.dayGrid.rowEls) {
13383            if (!isAuto) {
13384                scrollerHeight = this.computeScrollerHeight(totalHeight);
13385                this.scroller.setHeight(scrollerHeight);
13386            }
13387            return;
13388        }
13389        _super.prototype.updateSize.call(this, totalHeight, isAuto, isResize);
13390        if (this.dayGrid.colWeekNumbersVisible) {
13391            // Make sure all week number cells running down the side have the same width.
13392            // Record the width for cells created later.
13393            this.weekNumberWidth = util_1.matchCellWidths(this.el.find('.fc-week-number'));
13394        }
13395        // reset all heights to be natural
13396        this.scroller.clear();
13397        util_1.uncompensateScroll(headRowEl);
13398        this.dayGrid.removeSegPopover(); // kill the "more" popover if displayed
13399        // is the event limit a constant level number?
13400        if (eventLimit && typeof eventLimit === 'number') {
13401            this.dayGrid.limitRows(eventLimit); // limit the levels first so the height can redistribute after
13402        }
13403        // distribute the height to the rows
13404        // (totalHeight is a "recommended" value if isAuto)
13405        scrollerHeight = this.computeScrollerHeight(totalHeight);
13406        this.setGridHeight(scrollerHeight, isAuto);
13407        // is the event limit dynamically calculated?
13408        if (eventLimit && typeof eventLimit !== 'number') {
13409            this.dayGrid.limitRows(eventLimit); // limit the levels after the grid's row heights have been set
13410        }
13411        if (!isAuto) {
13412            this.scroller.setHeight(scrollerHeight);
13413            scrollbarWidths = this.scroller.getScrollbarWidths();
13414            if (scrollbarWidths.left || scrollbarWidths.right) {
13415                util_1.compensateScroll(headRowEl, scrollbarWidths);
13416                // doing the scrollbar compensation might have created text overflow which created more height. redo
13417                scrollerHeight = this.computeScrollerHeight(totalHeight);
13418                this.scroller.setHeight(scrollerHeight);
13419            }
13420            // guarantees the same scrollbar widths
13421            this.scroller.lockOverflow(scrollbarWidths);
13422        }
13423    };
13424    // given a desired total height of the view, returns what the height of the scroller should be
13425    BasicView.prototype.computeScrollerHeight = function (totalHeight) {
13426        return totalHeight -
13427            util_1.subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller
13428    };
13429    // Sets the height of just the DayGrid component in this view
13430    BasicView.prototype.setGridHeight = function (height, isAuto) {
13431        if (isAuto) {
13432            util_1.undistributeHeight(this.dayGrid.rowEls); // let the rows be their natural height with no expanding
13433        }
13434        else {
13435            util_1.distributeHeight(this.dayGrid.rowEls, height, true); // true = compensate for height-hogging rows
13436        }
13437    };
13438    /* Scroll
13439    ------------------------------------------------------------------------------------------------------------------*/
13440    BasicView.prototype.computeInitialDateScroll = function () {
13441        return { top: 0 };
13442    };
13443    BasicView.prototype.queryDateScroll = function () {
13444        return { top: this.scroller.getScrollTop() };
13445    };
13446    BasicView.prototype.applyDateScroll = function (scroll) {
13447        if (scroll.top !== undefined) {
13448            this.scroller.setScrollTop(scroll.top);
13449        }
13450    };
13451    return BasicView;
13452}(View_1.default));
13453exports.default = BasicView;
13454BasicView.prototype.dateProfileGeneratorClass = BasicViewDateProfileGenerator_1.default;
13455BasicView.prototype.dayGridClass = DayGrid_1.default;
13456// customize the rendering behavior of BasicView's dayGrid
13457function makeDayGridSubclass(SuperClass) {
13458    return /** @class */ (function (_super) {
13459        tslib_1.__extends(SubClass, _super);
13460        function SubClass() {
13461            var _this = _super !== null && _super.apply(this, arguments) || this;
13462            _this.colWeekNumbersVisible = false; // display week numbers along the side?
13463            return _this;
13464        }
13465        // Generates the HTML that will go before the day-of week header cells
13466        SubClass.prototype.renderHeadIntroHtml = function () {
13467            var view = this.view;
13468            if (this.colWeekNumbersVisible) {
13469                return '' +
13470                    '<th class="fc-week-number ' + view.calendar.theme.getClass('widgetHeader') + '" ' + view.weekNumberStyleAttr() + '>' +
13471                    '<span>' + // needed for matchCellWidths
13472                    util_1.htmlEscape(this.opt('weekNumberTitle')) +
13473                    '</span>' +
13474                    '</th>';
13475            }
13476            return '';
13477        };
13478        // Generates the HTML that will go before content-skeleton cells that display the day/week numbers
13479        SubClass.prototype.renderNumberIntroHtml = function (row) {
13480            var view = this.view;
13481            var weekStart = this.getCellDate(row, 0);
13482            if (this.colWeekNumbersVisible) {
13483                return '' +
13484                    '<td class="fc-week-number" ' + view.weekNumberStyleAttr() + '>' +
13485                    view.buildGotoAnchorHtml(// aside from link, important for matchCellWidths
13486                    { date: weekStart, type: 'week', forceOff: this.colCnt === 1 }, weekStart.format('w') // inner HTML
13487                    ) +
13488                    '</td>';
13489            }
13490            return '';
13491        };
13492        // Generates the HTML that goes before the day bg cells for each day-row
13493        SubClass.prototype.renderBgIntroHtml = function () {
13494            var view = this.view;
13495            if (this.colWeekNumbersVisible) {
13496                return '<td class="fc-week-number ' + view.calendar.theme.getClass('widgetContent') + '" ' +
13497                    view.weekNumberStyleAttr() + '></td>';
13498            }
13499            return '';
13500        };
13501        // Generates the HTML that goes before every other type of row generated by DayGrid.
13502        // Affects helper-skeleton and highlight-skeleton rows.
13503        SubClass.prototype.renderIntroHtml = function () {
13504            var view = this.view;
13505            if (this.colWeekNumbersVisible) {
13506                return '<td class="fc-week-number" ' + view.weekNumberStyleAttr() + '></td>';
13507            }
13508            return '';
13509        };
13510        SubClass.prototype.getIsNumbersVisible = function () {
13511            return DayGrid_1.default.prototype.getIsNumbersVisible.apply(this, arguments) || this.colWeekNumbersVisible;
13512        };
13513        return SubClass;
13514    }(SuperClass));
13515}
13516
13517
13518/***/ }),
13519/* 63 */,
13520/* 64 */,
13521/* 65 */,
13522/* 66 */,
13523/* 67 */,
13524/* 68 */,
13525/* 69 */,
13526/* 70 */,
13527/* 71 */,
13528/* 72 */,
13529/* 73 */,
13530/* 74 */,
13531/* 75 */,
13532/* 76 */,
13533/* 77 */,
13534/* 78 */,
13535/* 79 */,
13536/* 80 */,
13537/* 81 */,
13538/* 82 */,
13539/* 83 */,
13540/* 84 */,
13541/* 85 */,
13542/* 86 */,
13543/* 87 */,
13544/* 88 */,
13545/* 89 */,
13546/* 90 */,
13547/* 91 */,
13548/* 92 */,
13549/* 93 */,
13550/* 94 */,
13551/* 95 */,
13552/* 96 */,
13553/* 97 */,
13554/* 98 */,
13555/* 99 */,
13556/* 100 */,
13557/* 101 */,
13558/* 102 */,
13559/* 103 */,
13560/* 104 */,
13561/* 105 */,
13562/* 106 */,
13563/* 107 */,
13564/* 108 */,
13565/* 109 */,
13566/* 110 */,
13567/* 111 */,
13568/* 112 */,
13569/* 113 */,
13570/* 114 */,
13571/* 115 */,
13572/* 116 */,
13573/* 117 */,
13574/* 118 */,
13575/* 119 */,
13576/* 120 */,
13577/* 121 */,
13578/* 122 */,
13579/* 123 */,
13580/* 124 */,
13581/* 125 */,
13582/* 126 */,
13583/* 127 */,
13584/* 128 */,
13585/* 129 */,
13586/* 130 */,
13587/* 131 */,
13588/* 132 */,
13589/* 133 */,
13590/* 134 */,
13591/* 135 */,
13592/* 136 */,
13593/* 137 */,
13594/* 138 */,
13595/* 139 */,
13596/* 140 */,
13597/* 141 */,
13598/* 142 */,
13599/* 143 */,
13600/* 144 */,
13601/* 145 */,
13602/* 146 */,
13603/* 147 */,
13604/* 148 */,
13605/* 149 */,
13606/* 150 */,
13607/* 151 */,
13608/* 152 */,
13609/* 153 */,
13610/* 154 */,
13611/* 155 */,
13612/* 156 */,
13613/* 157 */,
13614/* 158 */,
13615/* 159 */,
13616/* 160 */,
13617/* 161 */,
13618/* 162 */,
13619/* 163 */,
13620/* 164 */,
13621/* 165 */,
13622/* 166 */,
13623/* 167 */,
13624/* 168 */,
13625/* 169 */,
13626/* 170 */,
13627/* 171 */,
13628/* 172 */,
13629/* 173 */,
13630/* 174 */,
13631/* 175 */,
13632/* 176 */,
13633/* 177 */,
13634/* 178 */,
13635/* 179 */,
13636/* 180 */,
13637/* 181 */,
13638/* 182 */,
13639/* 183 */,
13640/* 184 */,
13641/* 185 */,
13642/* 186 */,
13643/* 187 */,
13644/* 188 */,
13645/* 189 */,
13646/* 190 */,
13647/* 191 */,
13648/* 192 */,
13649/* 193 */,
13650/* 194 */,
13651/* 195 */,
13652/* 196 */,
13653/* 197 */,
13654/* 198 */,
13655/* 199 */,
13656/* 200 */,
13657/* 201 */,
13658/* 202 */,
13659/* 203 */,
13660/* 204 */,
13661/* 205 */,
13662/* 206 */,
13663/* 207 */
13664/***/ (function(module, exports, __webpack_require__) {
13665
13666Object.defineProperty(exports, "__esModule", { value: true });
13667var UnzonedRange_1 = __webpack_require__(5);
13668var ComponentFootprint_1 = __webpack_require__(12);
13669var EventDefParser_1 = __webpack_require__(49);
13670var EventSource_1 = __webpack_require__(6);
13671var util_1 = __webpack_require__(34);
13672var Constraints = /** @class */ (function () {
13673    function Constraints(eventManager, _calendar) {
13674        this.eventManager = eventManager;
13675        this._calendar = _calendar;
13676    }
13677    Constraints.prototype.opt = function (name) {
13678        return this._calendar.opt(name);
13679    };
13680    /*
13681    determines if eventInstanceGroup is allowed,
13682    in relation to other EVENTS and business hours.
13683    */
13684    Constraints.prototype.isEventInstanceGroupAllowed = function (eventInstanceGroup) {
13685        var eventDef = eventInstanceGroup.getEventDef();
13686        var eventFootprints = this.eventRangesToEventFootprints(eventInstanceGroup.getAllEventRanges());
13687        var i;
13688        var peerEventInstances = this.getPeerEventInstances(eventDef);
13689        var peerEventRanges = peerEventInstances.map(util_1.eventInstanceToEventRange);
13690        var peerEventFootprints = this.eventRangesToEventFootprints(peerEventRanges);
13691        var constraintVal = eventDef.getConstraint();
13692        var overlapVal = eventDef.getOverlap();
13693        var eventAllowFunc = this.opt('eventAllow');
13694        for (i = 0; i < eventFootprints.length; i++) {
13695            if (!this.isFootprintAllowed(eventFootprints[i].componentFootprint, peerEventFootprints, constraintVal, overlapVal, eventFootprints[i].eventInstance)) {
13696                return false;
13697            }
13698        }
13699        if (eventAllowFunc) {
13700            for (i = 0; i < eventFootprints.length; i++) {
13701                if (eventAllowFunc(eventFootprints[i].componentFootprint.toLegacy(this._calendar), eventFootprints[i].getEventLegacy()) === false) {
13702                    return false;
13703                }
13704            }
13705        }
13706        return true;
13707    };
13708    Constraints.prototype.getPeerEventInstances = function (eventDef) {
13709        return this.eventManager.getEventInstancesWithoutId(eventDef.id);
13710    };
13711    Constraints.prototype.isSelectionFootprintAllowed = function (componentFootprint) {
13712        var peerEventInstances = this.eventManager.getEventInstances();
13713        var peerEventRanges = peerEventInstances.map(util_1.eventInstanceToEventRange);
13714        var peerEventFootprints = this.eventRangesToEventFootprints(peerEventRanges);
13715        var selectAllowFunc;
13716        if (this.isFootprintAllowed(componentFootprint, peerEventFootprints, this.opt('selectConstraint'), this.opt('selectOverlap'))) {
13717            selectAllowFunc = this.opt('selectAllow');
13718            if (selectAllowFunc) {
13719                return selectAllowFunc(componentFootprint.toLegacy(this._calendar)) !== false;
13720            }
13721            else {
13722                return true;
13723            }
13724        }
13725        return false;
13726    };
13727    Constraints.prototype.isFootprintAllowed = function (componentFootprint, peerEventFootprints, constraintVal, overlapVal, subjectEventInstance // optional
13728    ) {
13729        var constraintFootprints; // ComponentFootprint[]
13730        var overlapEventFootprints; // EventFootprint[]
13731        if (constraintVal != null) {
13732            constraintFootprints = this.constraintValToFootprints(constraintVal, componentFootprint.isAllDay);
13733            if (!this.isFootprintWithinConstraints(componentFootprint, constraintFootprints)) {
13734                return false;
13735            }
13736        }
13737        overlapEventFootprints = this.collectOverlapEventFootprints(peerEventFootprints, componentFootprint);
13738        if (overlapVal === false) {
13739            if (overlapEventFootprints.length) {
13740                return false;
13741            }
13742        }
13743        else if (typeof overlapVal === 'function') {
13744            if (!isOverlapsAllowedByFunc(overlapEventFootprints, overlapVal, subjectEventInstance)) {
13745                return false;
13746            }
13747        }
13748        if (subjectEventInstance) {
13749            if (!isOverlapEventInstancesAllowed(overlapEventFootprints, subjectEventInstance)) {
13750                return false;
13751            }
13752        }
13753        return true;
13754    };
13755    // Constraint
13756    // ------------------------------------------------------------------------------------------------
13757    Constraints.prototype.isFootprintWithinConstraints = function (componentFootprint, constraintFootprints) {
13758        var i;
13759        for (i = 0; i < constraintFootprints.length; i++) {
13760            if (this.footprintContainsFootprint(constraintFootprints[i], componentFootprint)) {
13761                return true;
13762            }
13763        }
13764        return false;
13765    };
13766    Constraints.prototype.constraintValToFootprints = function (constraintVal, isAllDay) {
13767        var eventInstances;
13768        if (constraintVal === 'businessHours') {
13769            return this.buildCurrentBusinessFootprints(isAllDay);
13770        }
13771        else if (typeof constraintVal === 'object') {
13772            eventInstances = this.parseEventDefToInstances(constraintVal); // handles recurring events
13773            if (!eventInstances) {
13774                return this.parseFootprints(constraintVal);
13775            }
13776            else {
13777                return this.eventInstancesToFootprints(eventInstances);
13778            }
13779        }
13780        else if (constraintVal != null) {
13781            eventInstances = this.eventManager.getEventInstancesWithId(constraintVal);
13782            return this.eventInstancesToFootprints(eventInstances);
13783        }
13784    };
13785    // returns ComponentFootprint[]
13786    // uses current view's range
13787    Constraints.prototype.buildCurrentBusinessFootprints = function (isAllDay) {
13788        var view = this._calendar.view;
13789        var businessHourGenerator = view.get('businessHourGenerator');
13790        var unzonedRange = view.dateProfile.activeUnzonedRange;
13791        var eventInstanceGroup = businessHourGenerator.buildEventInstanceGroup(isAllDay, unzonedRange);
13792        if (eventInstanceGroup) {
13793            return this.eventInstancesToFootprints(eventInstanceGroup.eventInstances);
13794        }
13795        else {
13796            return [];
13797        }
13798    };
13799    // conversion util
13800    Constraints.prototype.eventInstancesToFootprints = function (eventInstances) {
13801        var eventRanges = eventInstances.map(util_1.eventInstanceToEventRange);
13802        var eventFootprints = this.eventRangesToEventFootprints(eventRanges);
13803        return eventFootprints.map(util_1.eventFootprintToComponentFootprint);
13804    };
13805    // Overlap
13806    // ------------------------------------------------------------------------------------------------
13807    Constraints.prototype.collectOverlapEventFootprints = function (peerEventFootprints, targetFootprint) {
13808        var overlapEventFootprints = [];
13809        var i;
13810        for (i = 0; i < peerEventFootprints.length; i++) {
13811            if (this.footprintsIntersect(targetFootprint, peerEventFootprints[i].componentFootprint)) {
13812                overlapEventFootprints.push(peerEventFootprints[i]);
13813            }
13814        }
13815        return overlapEventFootprints;
13816    };
13817    // Conversion: eventDefs -> eventInstances -> eventRanges -> eventFootprints -> componentFootprints
13818    // ------------------------------------------------------------------------------------------------
13819    // NOTE: this might seem like repetitive code with the Grid class, however, this code is related to
13820    // constraints whereas the Grid code is related to rendering. Each approach might want to convert
13821    // eventRanges -> eventFootprints in a different way. Regardless, there are opportunities to make
13822    // this more DRY.
13823    /*
13824    Returns false on invalid input.
13825    */
13826    Constraints.prototype.parseEventDefToInstances = function (eventInput) {
13827        var eventManager = this.eventManager;
13828        var eventDef = EventDefParser_1.default.parse(eventInput, new EventSource_1.default(this._calendar));
13829        if (!eventDef) {
13830            return false;
13831        }
13832        return eventDef.buildInstances(eventManager.currentPeriod.unzonedRange);
13833    };
13834    Constraints.prototype.eventRangesToEventFootprints = function (eventRanges) {
13835        var i;
13836        var eventFootprints = [];
13837        for (i = 0; i < eventRanges.length; i++) {
13838            eventFootprints.push.apply(// footprints
13839            eventFootprints, this.eventRangeToEventFootprints(eventRanges[i]));
13840        }
13841        return eventFootprints;
13842    };
13843    Constraints.prototype.eventRangeToEventFootprints = function (eventRange) {
13844        return [util_1.eventRangeToEventFootprint(eventRange)];
13845    };
13846    /*
13847    Parses footprints directly.
13848    Very similar to EventDateProfile::parse :(
13849    */
13850    Constraints.prototype.parseFootprints = function (rawInput) {
13851        var start;
13852        var end;
13853        if (rawInput.start) {
13854            start = this._calendar.moment(rawInput.start);
13855            if (!start.isValid()) {
13856                start = null;
13857            }
13858        }
13859        if (rawInput.end) {
13860            end = this._calendar.moment(rawInput.end);
13861            if (!end.isValid()) {
13862                end = null;
13863            }
13864        }
13865        return [
13866            new ComponentFootprint_1.default(new UnzonedRange_1.default(start, end), (start && !start.hasTime()) || (end && !end.hasTime()) // isAllDay
13867            )
13868        ];
13869    };
13870    // Footprint Utils
13871    // ----------------------------------------------------------------------------------------
13872    Constraints.prototype.footprintContainsFootprint = function (outerFootprint, innerFootprint) {
13873        return outerFootprint.unzonedRange.containsRange(innerFootprint.unzonedRange);
13874    };
13875    Constraints.prototype.footprintsIntersect = function (footprint0, footprint1) {
13876        return footprint0.unzonedRange.intersectsWith(footprint1.unzonedRange);
13877    };
13878    return Constraints;
13879}());
13880exports.default = Constraints;
13881// optional subjectEventInstance
13882function isOverlapsAllowedByFunc(overlapEventFootprints, overlapFunc, subjectEventInstance) {
13883    var i;
13884    for (i = 0; i < overlapEventFootprints.length; i++) {
13885        if (!overlapFunc(overlapEventFootprints[i].eventInstance.toLegacy(), subjectEventInstance ? subjectEventInstance.toLegacy() : null)) {
13886            return false;
13887        }
13888    }
13889    return true;
13890}
13891function isOverlapEventInstancesAllowed(overlapEventFootprints, subjectEventInstance) {
13892    var subjectLegacyInstance = subjectEventInstance.toLegacy();
13893    var i;
13894    var overlapEventInstance;
13895    var overlapEventDef;
13896    var overlapVal;
13897    for (i = 0; i < overlapEventFootprints.length; i++) {
13898        overlapEventInstance = overlapEventFootprints[i].eventInstance;
13899        overlapEventDef = overlapEventInstance.def;
13900        // don't need to pass in calendar, because don't want to consider global eventOverlap property,
13901        // because we already considered that earlier in the process.
13902        overlapVal = overlapEventDef.getOverlap();
13903        if (overlapVal === false) {
13904            return false;
13905        }
13906        else if (typeof overlapVal === 'function') {
13907            if (!overlapVal(overlapEventInstance.toLegacy(), subjectLegacyInstance)) {
13908                return false;
13909            }
13910        }
13911    }
13912    return true;
13913}
13914
13915
13916/***/ }),
13917/* 208 */
13918/***/ (function(module, exports, __webpack_require__) {
13919
13920/*
13921USAGE:
13922  import { default as ParsableModelMixin, ParsableModelInterface } from './ParsableModelMixin'
13923in class:
13924  applyProps: ParsableModelInterface['applyProps']
13925  applyManualStandardProps: ParsableModelInterface['applyManualStandardProps']
13926  applyMiscProps: ParsableModelInterface['applyMiscProps']
13927  isStandardProp: ParsableModelInterface['isStandardProp']
13928  static defineStandardProps = ParsableModelMixin.defineStandardProps
13929  static copyVerbatimStandardProps = ParsableModelMixin.copyVerbatimStandardProps
13930after class:
13931  ParsableModelMixin.mixInto(TheClass)
13932*/
13933Object.defineProperty(exports, "__esModule", { value: true });
13934var tslib_1 = __webpack_require__(2);
13935var util_1 = __webpack_require__(4);
13936var Mixin_1 = __webpack_require__(14);
13937var ParsableModelMixin = /** @class */ (function (_super) {
13938    tslib_1.__extends(ParsableModelMixin, _super);
13939    function ParsableModelMixin() {
13940        return _super !== null && _super.apply(this, arguments) || this;
13941    }
13942    ParsableModelMixin.defineStandardProps = function (propDefs) {
13943        var proto = this.prototype;
13944        if (!proto.hasOwnProperty('standardPropMap')) {
13945            proto.standardPropMap = Object.create(proto.standardPropMap);
13946        }
13947        util_1.copyOwnProps(propDefs, proto.standardPropMap);
13948    };
13949    ParsableModelMixin.copyVerbatimStandardProps = function (src, dest) {
13950        var map = this.prototype.standardPropMap;
13951        var propName;
13952        for (propName in map) {
13953            if (src[propName] != null && // in the src object?
13954                map[propName] === true // false means "copy verbatim"
13955            ) {
13956                dest[propName] = src[propName];
13957            }
13958        }
13959    };
13960    /*
13961    Returns true/false for success.
13962    Meant to be only called ONCE, at object creation.
13963    */
13964    ParsableModelMixin.prototype.applyProps = function (rawProps) {
13965        var standardPropMap = this.standardPropMap;
13966        var manualProps = {};
13967        var miscProps = {};
13968        var propName;
13969        for (propName in rawProps) {
13970            if (standardPropMap[propName] === true) {
13971                this[propName] = rawProps[propName];
13972            }
13973            else if (standardPropMap[propName] === false) {
13974                manualProps[propName] = rawProps[propName];
13975            }
13976            else {
13977                miscProps[propName] = rawProps[propName];
13978            }
13979        }
13980        this.applyMiscProps(miscProps);
13981        return this.applyManualStandardProps(manualProps);
13982    };
13983    /*
13984    If subclasses override, they must call this supermethod and return the boolean response.
13985    Meant to be only called ONCE, at object creation.
13986    */
13987    ParsableModelMixin.prototype.applyManualStandardProps = function (rawProps) {
13988        return true;
13989    };
13990    /*
13991    Can be called even after initial object creation.
13992    */
13993    ParsableModelMixin.prototype.applyMiscProps = function (rawProps) {
13994        // subclasses can implement
13995    };
13996    /*
13997    TODO: why is this a method when defineStandardProps is static
13998    */
13999    ParsableModelMixin.prototype.isStandardProp = function (propName) {
14000        return propName in this.standardPropMap;
14001    };
14002    return ParsableModelMixin;
14003}(Mixin_1.default));
14004exports.default = ParsableModelMixin;
14005ParsableModelMixin.prototype.standardPropMap = {}; // will be cloned by defineStandardProps
14006
14007
14008/***/ }),
14009/* 209 */
14010/***/ (function(module, exports) {
14011
14012Object.defineProperty(exports, "__esModule", { value: true });
14013var EventInstance = /** @class */ (function () {
14014    function EventInstance(def, dateProfile) {
14015        this.def = def;
14016        this.dateProfile = dateProfile;
14017    }
14018    EventInstance.prototype.toLegacy = function () {
14019        var dateProfile = this.dateProfile;
14020        var obj = this.def.toLegacy();
14021        obj.start = dateProfile.start.clone();
14022        obj.end = dateProfile.end ? dateProfile.end.clone() : null;
14023        return obj;
14024    };
14025    return EventInstance;
14026}());
14027exports.default = EventInstance;
14028
14029
14030/***/ }),
14031/* 210 */
14032/***/ (function(module, exports, __webpack_require__) {
14033
14034Object.defineProperty(exports, "__esModule", { value: true });
14035var tslib_1 = __webpack_require__(2);
14036var $ = __webpack_require__(3);
14037var moment = __webpack_require__(0);
14038var EventDef_1 = __webpack_require__(33);
14039var EventInstance_1 = __webpack_require__(209);
14040var EventDateProfile_1 = __webpack_require__(18);
14041var RecurringEventDef = /** @class */ (function (_super) {
14042    tslib_1.__extends(RecurringEventDef, _super);
14043    function RecurringEventDef() {
14044        return _super !== null && _super.apply(this, arguments) || this;
14045    }
14046    RecurringEventDef.prototype.isAllDay = function () {
14047        return !this.startTime && !this.endTime;
14048    };
14049    RecurringEventDef.prototype.buildInstances = function (unzonedRange) {
14050        var calendar = this.source.calendar;
14051        var unzonedDate = unzonedRange.getStart();
14052        var unzonedEnd = unzonedRange.getEnd();
14053        var zonedDayStart;
14054        var instanceStart;
14055        var instanceEnd;
14056        var instances = [];
14057        while (unzonedDate.isBefore(unzonedEnd)) {
14058            // if everyday, or this particular day-of-week
14059            if (!this.dowHash || this.dowHash[unzonedDate.day()]) {
14060                zonedDayStart = calendar.applyTimezone(unzonedDate);
14061                instanceStart = zonedDayStart.clone();
14062                instanceEnd = null;
14063                if (this.startTime) {
14064                    instanceStart.time(this.startTime);
14065                }
14066                else {
14067                    instanceStart.stripTime();
14068                }
14069                if (this.endTime) {
14070                    instanceEnd = zonedDayStart.clone().time(this.endTime);
14071                }
14072                instances.push(new EventInstance_1.default(this, // definition
14073                new EventDateProfile_1.default(instanceStart, instanceEnd, calendar)));
14074            }
14075            unzonedDate.add(1, 'days');
14076        }
14077        return instances;
14078    };
14079    RecurringEventDef.prototype.setDow = function (dowNumbers) {
14080        if (!this.dowHash) {
14081            this.dowHash = {};
14082        }
14083        for (var i = 0; i < dowNumbers.length; i++) {
14084            this.dowHash[dowNumbers[i]] = true;
14085        }
14086    };
14087    RecurringEventDef.prototype.clone = function () {
14088        var def = _super.prototype.clone.call(this);
14089        if (def.startTime) {
14090            def.startTime = moment.duration(this.startTime);
14091        }
14092        if (def.endTime) {
14093            def.endTime = moment.duration(this.endTime);
14094        }
14095        if (this.dowHash) {
14096            def.dowHash = $.extend({}, this.dowHash);
14097        }
14098        return def;
14099    };
14100    return RecurringEventDef;
14101}(EventDef_1.default));
14102exports.default = RecurringEventDef;
14103/*
14104HACK to work with TypeScript mixins
14105NOTE: if super-method fails, should still attempt to apply
14106*/
14107RecurringEventDef.prototype.applyProps = function (rawProps) {
14108    var superSuccess = EventDef_1.default.prototype.applyProps.call(this, rawProps);
14109    if (rawProps.start) {
14110        this.startTime = moment.duration(rawProps.start);
14111    }
14112    if (rawProps.end) {
14113        this.endTime = moment.duration(rawProps.end);
14114    }
14115    if (rawProps.dow) {
14116        this.setDow(rawProps.dow);
14117    }
14118    return superSuccess;
14119};
14120// Parsing
14121// ---------------------------------------------------------------------------------------------------------------------
14122RecurringEventDef.defineStandardProps({
14123    start: false,
14124    end: false,
14125    dow: false
14126});
14127
14128
14129/***/ }),
14130/* 211 */
14131/***/ (function(module, exports) {
14132
14133Object.defineProperty(exports, "__esModule", { value: true });
14134var EventRange = /** @class */ (function () {
14135    function EventRange(unzonedRange, eventDef, eventInstance) {
14136        this.unzonedRange = unzonedRange;
14137        this.eventDef = eventDef;
14138        if (eventInstance) {
14139            this.eventInstance = eventInstance;
14140        }
14141    }
14142    return EventRange;
14143}());
14144exports.default = EventRange;
14145
14146
14147/***/ }),
14148/* 212 */
14149/***/ (function(module, exports, __webpack_require__) {
14150
14151Object.defineProperty(exports, "__esModule", { value: true });
14152var $ = __webpack_require__(3);
14153var util_1 = __webpack_require__(34);
14154var EventInstanceGroup_1 = __webpack_require__(19);
14155var RecurringEventDef_1 = __webpack_require__(210);
14156var EventSource_1 = __webpack_require__(6);
14157var BUSINESS_HOUR_EVENT_DEFAULTS = {
14158    start: '09:00',
14159    end: '17:00',
14160    dow: [1, 2, 3, 4, 5],
14161    rendering: 'inverse-background'
14162    // classNames are defined in businessHoursSegClasses
14163};
14164var BusinessHourGenerator = /** @class */ (function () {
14165    function BusinessHourGenerator(rawComplexDef, calendar) {
14166        this.rawComplexDef = rawComplexDef;
14167        this.calendar = calendar;
14168    }
14169    BusinessHourGenerator.prototype.buildEventInstanceGroup = function (isAllDay, unzonedRange) {
14170        var eventDefs = this.buildEventDefs(isAllDay);
14171        var eventInstanceGroup;
14172        if (eventDefs.length) {
14173            eventInstanceGroup = new EventInstanceGroup_1.default(util_1.eventDefsToEventInstances(eventDefs, unzonedRange));
14174            // so that inverse-background rendering can happen even when no eventRanges in view
14175            eventInstanceGroup.explicitEventDef = eventDefs[0];
14176            return eventInstanceGroup;
14177        }
14178    };
14179    BusinessHourGenerator.prototype.buildEventDefs = function (isAllDay) {
14180        var rawComplexDef = this.rawComplexDef;
14181        var rawDefs = [];
14182        var requireDow = false;
14183        var i;
14184        var defs = [];
14185        if (rawComplexDef === true) {
14186            rawDefs = [{}]; // will get BUSINESS_HOUR_EVENT_DEFAULTS verbatim
14187        }
14188        else if ($.isPlainObject(rawComplexDef)) {
14189            rawDefs = [rawComplexDef];
14190        }
14191        else if ($.isArray(rawComplexDef)) {
14192            rawDefs = rawComplexDef;
14193            requireDow = true; // every sub-definition NEEDS a day-of-week
14194        }
14195        for (i = 0; i < rawDefs.length; i++) {
14196            if (!requireDow || rawDefs[i].dow) {
14197                defs.push(this.buildEventDef(isAllDay, rawDefs[i]));
14198            }
14199        }
14200        return defs;
14201    };
14202    BusinessHourGenerator.prototype.buildEventDef = function (isAllDay, rawDef) {
14203        var fullRawDef = $.extend({}, BUSINESS_HOUR_EVENT_DEFAULTS, rawDef);
14204        if (isAllDay) {
14205            fullRawDef.start = null;
14206            fullRawDef.end = null;
14207        }
14208        return RecurringEventDef_1.default.parse(fullRawDef, new EventSource_1.default(this.calendar) // dummy source
14209        );
14210    };
14211    return BusinessHourGenerator;
14212}());
14213exports.default = BusinessHourGenerator;
14214
14215
14216/***/ }),
14217/* 213 */
14218/***/ (function(module, exports, __webpack_require__) {
14219
14220Object.defineProperty(exports, "__esModule", { value: true });
14221var tslib_1 = __webpack_require__(2);
14222var Theme_1 = __webpack_require__(38);
14223var StandardTheme = /** @class */ (function (_super) {
14224    tslib_1.__extends(StandardTheme, _super);
14225    function StandardTheme() {
14226        return _super !== null && _super.apply(this, arguments) || this;
14227    }
14228    return StandardTheme;
14229}(Theme_1.default));
14230exports.default = StandardTheme;
14231StandardTheme.prototype.classes = {
14232    widget: 'fc-unthemed',
14233    widgetHeader: 'fc-widget-header',
14234    widgetContent: 'fc-widget-content',
14235    buttonGroup: 'fc-button-group',
14236    button: 'fc-button',
14237    cornerLeft: 'fc-corner-left',
14238    cornerRight: 'fc-corner-right',
14239    stateDefault: 'fc-state-default',
14240    stateActive: 'fc-state-active',
14241    stateDisabled: 'fc-state-disabled',
14242    stateHover: 'fc-state-hover',
14243    stateDown: 'fc-state-down',
14244    popoverHeader: 'fc-widget-header',
14245    popoverContent: 'fc-widget-content',
14246    // day grid
14247    headerRow: 'fc-widget-header',
14248    dayRow: 'fc-widget-content',
14249    // list view
14250    listView: 'fc-widget-content'
14251};
14252StandardTheme.prototype.baseIconClass = 'fc-icon';
14253StandardTheme.prototype.iconClasses = {
14254    close: 'fc-icon-x',
14255    prev: 'fc-icon-left-single-arrow',
14256    next: 'fc-icon-right-single-arrow',
14257    prevYear: 'fc-icon-left-double-arrow',
14258    nextYear: 'fc-icon-right-double-arrow'
14259};
14260StandardTheme.prototype.iconOverrideOption = 'buttonIcons';
14261StandardTheme.prototype.iconOverrideCustomButtonOption = 'icon';
14262StandardTheme.prototype.iconOverridePrefix = 'fc-icon-';
14263
14264
14265/***/ }),
14266/* 214 */
14267/***/ (function(module, exports, __webpack_require__) {
14268
14269Object.defineProperty(exports, "__esModule", { value: true });
14270var tslib_1 = __webpack_require__(2);
14271var Theme_1 = __webpack_require__(38);
14272var JqueryUiTheme = /** @class */ (function (_super) {
14273    tslib_1.__extends(JqueryUiTheme, _super);
14274    function JqueryUiTheme() {
14275        return _super !== null && _super.apply(this, arguments) || this;
14276    }
14277    return JqueryUiTheme;
14278}(Theme_1.default));
14279exports.default = JqueryUiTheme;
14280JqueryUiTheme.prototype.classes = {
14281    widget: 'ui-widget',
14282    widgetHeader: 'ui-widget-header',
14283    widgetContent: 'ui-widget-content',
14284    buttonGroup: 'fc-button-group',
14285    button: 'ui-button',
14286    cornerLeft: 'ui-corner-left',
14287    cornerRight: 'ui-corner-right',
14288    stateDefault: 'ui-state-default',
14289    stateActive: 'ui-state-active',
14290    stateDisabled: 'ui-state-disabled',
14291    stateHover: 'ui-state-hover',
14292    stateDown: 'ui-state-down',
14293    today: 'ui-state-highlight',
14294    popoverHeader: 'ui-widget-header',
14295    popoverContent: 'ui-widget-content',
14296    // day grid
14297    headerRow: 'ui-widget-header',
14298    dayRow: 'ui-widget-content',
14299    // list view
14300    listView: 'ui-widget-content'
14301};
14302JqueryUiTheme.prototype.baseIconClass = 'ui-icon';
14303JqueryUiTheme.prototype.iconClasses = {
14304    close: 'ui-icon-closethick',
14305    prev: 'ui-icon-circle-triangle-w',
14306    next: 'ui-icon-circle-triangle-e',
14307    prevYear: 'ui-icon-seek-prev',
14308    nextYear: 'ui-icon-seek-next'
14309};
14310JqueryUiTheme.prototype.iconOverrideOption = 'themeButtonIcons';
14311JqueryUiTheme.prototype.iconOverrideCustomButtonOption = 'themeIcon';
14312JqueryUiTheme.prototype.iconOverridePrefix = 'ui-icon-';
14313
14314
14315/***/ }),
14316/* 215 */
14317/***/ (function(module, exports, __webpack_require__) {
14318
14319Object.defineProperty(exports, "__esModule", { value: true });
14320var tslib_1 = __webpack_require__(2);
14321var $ = __webpack_require__(3);
14322var Promise_1 = __webpack_require__(20);
14323var EventSource_1 = __webpack_require__(6);
14324var FuncEventSource = /** @class */ (function (_super) {
14325    tslib_1.__extends(FuncEventSource, _super);
14326    function FuncEventSource() {
14327        return _super !== null && _super.apply(this, arguments) || this;
14328    }
14329    FuncEventSource.parse = function (rawInput, calendar) {
14330        var rawProps;
14331        // normalize raw input
14332        if ($.isFunction(rawInput.events)) {
14333            rawProps = rawInput;
14334        }
14335        else if ($.isFunction(rawInput)) {
14336            rawProps = { events: rawInput };
14337        }
14338        if (rawProps) {
14339            return EventSource_1.default.parse.call(this, rawProps, calendar);
14340        }
14341        return false;
14342    };
14343    FuncEventSource.prototype.fetch = function (start, end, timezone) {
14344        var _this = this;
14345        this.calendar.pushLoading();
14346        return Promise_1.default.construct(function (onResolve) {
14347            _this.func.call(_this.calendar, start.clone(), end.clone(), timezone, function (rawEventDefs) {
14348                _this.calendar.popLoading();
14349                onResolve(_this.parseEventDefs(rawEventDefs));
14350            });
14351        });
14352    };
14353    FuncEventSource.prototype.getPrimitive = function () {
14354        return this.func;
14355    };
14356    FuncEventSource.prototype.applyManualStandardProps = function (rawProps) {
14357        var superSuccess = _super.prototype.applyManualStandardProps.call(this, rawProps);
14358        this.func = rawProps.events;
14359        return superSuccess;
14360    };
14361    return FuncEventSource;
14362}(EventSource_1.default));
14363exports.default = FuncEventSource;
14364FuncEventSource.defineStandardProps({
14365    events: false // don't automatically transfer
14366});
14367
14368
14369/***/ }),
14370/* 216 */
14371/***/ (function(module, exports, __webpack_require__) {
14372
14373Object.defineProperty(exports, "__esModule", { value: true });
14374var tslib_1 = __webpack_require__(2);
14375var $ = __webpack_require__(3);
14376var util_1 = __webpack_require__(4);
14377var Promise_1 = __webpack_require__(20);
14378var EventSource_1 = __webpack_require__(6);
14379var JsonFeedEventSource = /** @class */ (function (_super) {
14380    tslib_1.__extends(JsonFeedEventSource, _super);
14381    function JsonFeedEventSource() {
14382        return _super !== null && _super.apply(this, arguments) || this;
14383    }
14384    JsonFeedEventSource.parse = function (rawInput, calendar) {
14385        var rawProps;
14386        // normalize raw input
14387        if (typeof rawInput.url === 'string') {
14388            rawProps = rawInput;
14389        }
14390        else if (typeof rawInput === 'string') {
14391            rawProps = { url: rawInput };
14392        }
14393        if (rawProps) {
14394            return EventSource_1.default.parse.call(this, rawProps, calendar);
14395        }
14396        return false;
14397    };
14398    JsonFeedEventSource.prototype.fetch = function (start, end, timezone) {
14399        var _this = this;
14400        var ajaxSettings = this.ajaxSettings;
14401        var onSuccess = ajaxSettings.success;
14402        var onError = ajaxSettings.error;
14403        var requestParams = this.buildRequestParams(start, end, timezone);
14404        // todo: eventually handle the promise's then,
14405        // don't intercept success/error
14406        // tho will be a breaking API change
14407        this.calendar.pushLoading();
14408        return Promise_1.default.construct(function (onResolve, onReject) {
14409            $.ajax($.extend({}, // destination
14410            JsonFeedEventSource.AJAX_DEFAULTS, ajaxSettings, {
14411                url: _this.url,
14412                data: requestParams,
14413                success: function (rawEventDefs, status, xhr) {
14414                    var callbackRes;
14415                    _this.calendar.popLoading();
14416                    if (rawEventDefs) {
14417                        callbackRes = util_1.applyAll(onSuccess, _this, [rawEventDefs, status, xhr]); // redirect `this`
14418                        if ($.isArray(callbackRes)) {
14419                            rawEventDefs = callbackRes;
14420                        }
14421                        onResolve(_this.parseEventDefs(rawEventDefs));
14422                    }
14423                    else {
14424                        onReject();
14425                    }
14426                },
14427                error: function (xhr, statusText, errorThrown) {
14428                    _this.calendar.popLoading();
14429                    util_1.applyAll(onError, _this, [xhr, statusText, errorThrown]); // redirect `this`
14430                    onReject();
14431                }
14432            }));
14433        });
14434    };
14435    JsonFeedEventSource.prototype.buildRequestParams = function (start, end, timezone) {
14436        var calendar = this.calendar;
14437        var ajaxSettings = this.ajaxSettings;
14438        var startParam;
14439        var endParam;
14440        var timezoneParam;
14441        var customRequestParams;
14442        var params = {};
14443        startParam = this.startParam;
14444        if (startParam == null) {
14445            startParam = calendar.opt('startParam');
14446        }
14447        endParam = this.endParam;
14448        if (endParam == null) {
14449            endParam = calendar.opt('endParam');
14450        }
14451        timezoneParam = this.timezoneParam;
14452        if (timezoneParam == null) {
14453            timezoneParam = calendar.opt('timezoneParam');
14454        }
14455        // retrieve any outbound GET/POST $.ajax data from the options
14456        if ($.isFunction(ajaxSettings.data)) {
14457            // supplied as a function that returns a key/value object
14458            customRequestParams = ajaxSettings.data();
14459        }
14460        else {
14461            // probably supplied as a straight key/value object
14462            customRequestParams = ajaxSettings.data || {};
14463        }
14464        $.extend(params, customRequestParams);
14465        params[startParam] = start.format();
14466        params[endParam] = end.format();
14467        if (timezone && timezone !== 'local') {
14468            params[timezoneParam] = timezone;
14469        }
14470        return params;
14471    };
14472    JsonFeedEventSource.prototype.getPrimitive = function () {
14473        return this.url;
14474    };
14475    JsonFeedEventSource.prototype.applyMiscProps = function (rawProps) {
14476        this.ajaxSettings = rawProps;
14477    };
14478    JsonFeedEventSource.AJAX_DEFAULTS = {
14479        dataType: 'json',
14480        cache: false
14481    };
14482    return JsonFeedEventSource;
14483}(EventSource_1.default));
14484exports.default = JsonFeedEventSource;
14485JsonFeedEventSource.defineStandardProps({
14486    // automatically transfer (true)...
14487    url: true,
14488    startParam: true,
14489    endParam: true,
14490    timezoneParam: true
14491});
14492
14493
14494/***/ }),
14495/* 217 */
14496/***/ (function(module, exports, __webpack_require__) {
14497
14498Object.defineProperty(exports, "__esModule", { value: true });
14499var EmitterMixin_1 = __webpack_require__(11);
14500var TaskQueue = /** @class */ (function () {
14501    function TaskQueue() {
14502        this.q = [];
14503        this.isPaused = false;
14504        this.isRunning = false;
14505    }
14506    TaskQueue.prototype.queue = function () {
14507        var args = [];
14508        for (var _i = 0; _i < arguments.length; _i++) {
14509            args[_i] = arguments[_i];
14510        }
14511        this.q.push.apply(this.q, args); // append
14512        this.tryStart();
14513    };
14514    TaskQueue.prototype.pause = function () {
14515        this.isPaused = true;
14516    };
14517    TaskQueue.prototype.resume = function () {
14518        this.isPaused = false;
14519        this.tryStart();
14520    };
14521    TaskQueue.prototype.getIsIdle = function () {
14522        return !this.isRunning && !this.isPaused;
14523    };
14524    TaskQueue.prototype.tryStart = function () {
14525        if (!this.isRunning && this.canRunNext()) {
14526            this.isRunning = true;
14527            this.trigger('start');
14528            this.runRemaining();
14529        }
14530    };
14531    TaskQueue.prototype.canRunNext = function () {
14532        return !this.isPaused && this.q.length;
14533    };
14534    TaskQueue.prototype.runRemaining = function () {
14535        var _this = this;
14536        var task;
14537        var res;
14538        do {
14539            task = this.q.shift(); // always freshly reference q. might have been reassigned.
14540            res = this.runTask(task);
14541            if (res && res.then) {
14542                res.then(function () {
14543                    if (_this.canRunNext()) {
14544                        _this.runRemaining();
14545                    }
14546                });
14547                return; // prevent marking as stopped
14548            }
14549        } while (this.canRunNext());
14550        this.trigger('stop'); // not really a 'stop' ... more of a 'drained'
14551        this.isRunning = false;
14552        // if 'stop' handler added more tasks.... TODO: write test for this
14553        this.tryStart();
14554    };
14555    TaskQueue.prototype.runTask = function (task) {
14556        return task(); // task *is* the function, but subclasses can change the format of a task
14557    };
14558    return TaskQueue;
14559}());
14560exports.default = TaskQueue;
14561EmitterMixin_1.default.mixInto(TaskQueue);
14562
14563
14564/***/ }),
14565/* 218 */
14566/***/ (function(module, exports, __webpack_require__) {
14567
14568Object.defineProperty(exports, "__esModule", { value: true });
14569var tslib_1 = __webpack_require__(2);
14570var TaskQueue_1 = __webpack_require__(217);
14571var RenderQueue = /** @class */ (function (_super) {
14572    tslib_1.__extends(RenderQueue, _super);
14573    function RenderQueue(waitsByNamespace) {
14574        var _this = _super.call(this) || this;
14575        _this.waitsByNamespace = waitsByNamespace || {};
14576        return _this;
14577    }
14578    RenderQueue.prototype.queue = function (taskFunc, namespace, type) {
14579        var task = {
14580            func: taskFunc,
14581            namespace: namespace,
14582            type: type
14583        };
14584        var waitMs;
14585        if (namespace) {
14586            waitMs = this.waitsByNamespace[namespace];
14587        }
14588        if (this.waitNamespace) {
14589            if (namespace === this.waitNamespace && waitMs != null) {
14590                this.delayWait(waitMs);
14591            }
14592            else {
14593                this.clearWait();
14594                this.tryStart();
14595            }
14596        }
14597        if (this.compoundTask(task)) {
14598            if (!this.waitNamespace && waitMs != null) {
14599                this.startWait(namespace, waitMs);
14600            }
14601            else {
14602                this.tryStart();
14603            }
14604        }
14605    };
14606    RenderQueue.prototype.startWait = function (namespace, waitMs) {
14607        this.waitNamespace = namespace;
14608        this.spawnWait(waitMs);
14609    };
14610    RenderQueue.prototype.delayWait = function (waitMs) {
14611        clearTimeout(this.waitId);
14612        this.spawnWait(waitMs);
14613    };
14614    RenderQueue.prototype.spawnWait = function (waitMs) {
14615        var _this = this;
14616        this.waitId = setTimeout(function () {
14617            _this.waitNamespace = null;
14618            _this.tryStart();
14619        }, waitMs);
14620    };
14621    RenderQueue.prototype.clearWait = function () {
14622        if (this.waitNamespace) {
14623            clearTimeout(this.waitId);
14624            this.waitId = null;
14625            this.waitNamespace = null;
14626        }
14627    };
14628    RenderQueue.prototype.canRunNext = function () {
14629        if (!_super.prototype.canRunNext.call(this)) {
14630            return false;
14631        }
14632        // waiting for a certain namespace to stop receiving tasks?
14633        if (this.waitNamespace) {
14634            var q = this.q;
14635            // if there was a different namespace task in the meantime,
14636            // that forces all previously-waiting tasks to suddenly execute.
14637            // TODO: find a way to do this in constant time.
14638            for (var i = 0; i < q.length; i++) {
14639                if (q[i].namespace !== this.waitNamespace) {
14640                    return true; // allow execution
14641                }
14642            }
14643            return false;
14644        }
14645        return true;
14646    };
14647    RenderQueue.prototype.runTask = function (task) {
14648        task.func();
14649    };
14650    RenderQueue.prototype.compoundTask = function (newTask) {
14651        var q = this.q;
14652        var shouldAppend = true;
14653        var i;
14654        var task;
14655        if (newTask.namespace && newTask.type === 'destroy') {
14656            // remove all init/add/remove ops with same namespace, regardless of order
14657            for (i = q.length - 1; i >= 0; i--) {
14658                task = q[i];
14659                switch (task.type) {
14660                    case 'init':
14661                        shouldAppend = false;
14662                    // the latest destroy is cancelled out by not doing the init
14663                    /* falls through */
14664                    case 'add':
14665                    /* falls through */
14666                    case 'remove':
14667                        q.splice(i, 1); // remove task
14668                }
14669            }
14670        }
14671        if (shouldAppend) {
14672            q.push(newTask);
14673        }
14674        return shouldAppend;
14675    };
14676    return RenderQueue;
14677}(TaskQueue_1.default));
14678exports.default = RenderQueue;
14679
14680
14681/***/ }),
14682/* 219 */
14683/***/ (function(module, exports, __webpack_require__) {
14684
14685Object.defineProperty(exports, "__esModule", { value: true });
14686var tslib_1 = __webpack_require__(2);
14687var $ = __webpack_require__(3);
14688var moment = __webpack_require__(0);
14689var util_1 = __webpack_require__(4);
14690var moment_ext_1 = __webpack_require__(10);
14691var date_formatting_1 = __webpack_require__(47);
14692var Component_1 = __webpack_require__(237);
14693var util_2 = __webpack_require__(34);
14694var DateComponent = /** @class */ (function (_super) {
14695    tslib_1.__extends(DateComponent, _super);
14696    function DateComponent(_view, _options) {
14697        var _this = _super.call(this) || this;
14698        _this.isRTL = false; // frequently accessed options
14699        _this.hitsNeededDepth = 0; // necessary because multiple callers might need the same hits
14700        _this.hasAllDayBusinessHours = false; // TODO: unify with largeUnit and isTimeScale?
14701        _this.isDatesRendered = false;
14702        // hack to set options prior to the this.opt calls
14703        if (_view) {
14704            _this['view'] = _view;
14705        }
14706        if (_options) {
14707            _this['options'] = _options;
14708        }
14709        _this.uid = String(DateComponent.guid++);
14710        _this.childrenByUid = {};
14711        _this.nextDayThreshold = moment.duration(_this.opt('nextDayThreshold'));
14712        _this.isRTL = _this.opt('isRTL');
14713        if (_this.fillRendererClass) {
14714            _this.fillRenderer = new _this.fillRendererClass(_this);
14715        }
14716        if (_this.eventRendererClass) {
14717            _this.eventRenderer = new _this.eventRendererClass(_this, _this.fillRenderer);
14718        }
14719        if (_this.helperRendererClass && _this.eventRenderer) {
14720            _this.helperRenderer = new _this.helperRendererClass(_this, _this.eventRenderer);
14721        }
14722        if (_this.businessHourRendererClass && _this.fillRenderer) {
14723            _this.businessHourRenderer = new _this.businessHourRendererClass(_this, _this.fillRenderer);
14724        }
14725        return _this;
14726    }
14727    DateComponent.prototype.addChild = function (child) {
14728        if (!this.childrenByUid[child.uid]) {
14729            this.childrenByUid[child.uid] = child;
14730            return true;
14731        }
14732        return false;
14733    };
14734    DateComponent.prototype.removeChild = function (child) {
14735        if (this.childrenByUid[child.uid]) {
14736            delete this.childrenByUid[child.uid];
14737            return true;
14738        }
14739        return false;
14740    };
14741    // TODO: only do if isInDom?
14742    // TODO: make part of Component, along with children/batch-render system?
14743    DateComponent.prototype.updateSize = function (totalHeight, isAuto, isResize) {
14744        this.callChildren('updateSize', arguments);
14745    };
14746    // Options
14747    // -----------------------------------------------------------------------------------------------------------------
14748    DateComponent.prototype.opt = function (name) {
14749        return this._getView().opt(name); // default implementation
14750    };
14751    DateComponent.prototype.publiclyTrigger = function () {
14752        var args = [];
14753        for (var _i = 0; _i < arguments.length; _i++) {
14754            args[_i] = arguments[_i];
14755        }
14756        var calendar = this._getCalendar();
14757        return calendar.publiclyTrigger.apply(calendar, args);
14758    };
14759    DateComponent.prototype.hasPublicHandlers = function () {
14760        var args = [];
14761        for (var _i = 0; _i < arguments.length; _i++) {
14762            args[_i] = arguments[_i];
14763        }
14764        var calendar = this._getCalendar();
14765        return calendar.hasPublicHandlers.apply(calendar, args);
14766    };
14767    // Date
14768    // -----------------------------------------------------------------------------------------------------------------
14769    DateComponent.prototype.executeDateRender = function (dateProfile) {
14770        this.dateProfile = dateProfile; // for rendering
14771        this.renderDates(dateProfile);
14772        this.isDatesRendered = true;
14773        this.callChildren('executeDateRender', arguments);
14774    };
14775    DateComponent.prototype.executeDateUnrender = function () {
14776        this.callChildren('executeDateUnrender', arguments);
14777        this.dateProfile = null;
14778        this.unrenderDates();
14779        this.isDatesRendered = false;
14780    };
14781    // date-cell content only
14782    DateComponent.prototype.renderDates = function (dateProfile) {
14783        // subclasses should implement
14784    };
14785    // date-cell content only
14786    DateComponent.prototype.unrenderDates = function () {
14787        // subclasses should override
14788    };
14789    // Now-Indicator
14790    // -----------------------------------------------------------------------------------------------------------------
14791    // Returns a string unit, like 'second' or 'minute' that defined how often the current time indicator
14792    // should be refreshed. If something falsy is returned, no time indicator is rendered at all.
14793    DateComponent.prototype.getNowIndicatorUnit = function () {
14794        // subclasses should implement
14795    };
14796    // Renders a current time indicator at the given datetime
14797    DateComponent.prototype.renderNowIndicator = function (date) {
14798        this.callChildren('renderNowIndicator', arguments);
14799    };
14800    // Undoes the rendering actions from renderNowIndicator
14801    DateComponent.prototype.unrenderNowIndicator = function () {
14802        this.callChildren('unrenderNowIndicator', arguments);
14803    };
14804    // Business Hours
14805    // ---------------------------------------------------------------------------------------------------------------
14806    DateComponent.prototype.renderBusinessHours = function (businessHourGenerator) {
14807        if (this.businessHourRenderer) {
14808            this.businessHourRenderer.render(businessHourGenerator);
14809        }
14810        this.callChildren('renderBusinessHours', arguments);
14811    };
14812    // Unrenders previously-rendered business-hours
14813    DateComponent.prototype.unrenderBusinessHours = function () {
14814        this.callChildren('unrenderBusinessHours', arguments);
14815        if (this.businessHourRenderer) {
14816            this.businessHourRenderer.unrender();
14817        }
14818    };
14819    // Event Displaying
14820    // -----------------------------------------------------------------------------------------------------------------
14821    DateComponent.prototype.executeEventRender = function (eventsPayload) {
14822        if (this.eventRenderer) {
14823            this.eventRenderer.rangeUpdated(); // poorly named now
14824            this.eventRenderer.render(eventsPayload);
14825        }
14826        else if (this['renderEvents']) {
14827            this['renderEvents'](convertEventsPayloadToLegacyArray(eventsPayload));
14828        }
14829        this.callChildren('executeEventRender', arguments);
14830    };
14831    DateComponent.prototype.executeEventUnrender = function () {
14832        this.callChildren('executeEventUnrender', arguments);
14833        if (this.eventRenderer) {
14834            this.eventRenderer.unrender();
14835        }
14836        else if (this['destroyEvents']) {
14837            this['destroyEvents']();
14838        }
14839    };
14840    DateComponent.prototype.getBusinessHourSegs = function () {
14841        var segs = this.getOwnBusinessHourSegs();
14842        this.iterChildren(function (child) {
14843            segs.push.apply(segs, child.getBusinessHourSegs());
14844        });
14845        return segs;
14846    };
14847    DateComponent.prototype.getOwnBusinessHourSegs = function () {
14848        if (this.businessHourRenderer) {
14849            return this.businessHourRenderer.getSegs();
14850        }
14851        return [];
14852    };
14853    DateComponent.prototype.getEventSegs = function () {
14854        var segs = this.getOwnEventSegs();
14855        this.iterChildren(function (child) {
14856            segs.push.apply(segs, child.getEventSegs());
14857        });
14858        return segs;
14859    };
14860    DateComponent.prototype.getOwnEventSegs = function () {
14861        if (this.eventRenderer) {
14862            return this.eventRenderer.getSegs();
14863        }
14864        return [];
14865    };
14866    // Event Rendering Triggering
14867    // -----------------------------------------------------------------------------------------------------------------
14868    DateComponent.prototype.triggerAfterEventsRendered = function () {
14869        this.triggerAfterEventSegsRendered(this.getEventSegs());
14870        this.publiclyTrigger('eventAfterAllRender', {
14871            context: this,
14872            args: [this]
14873        });
14874    };
14875    DateComponent.prototype.triggerAfterEventSegsRendered = function (segs) {
14876        var _this = this;
14877        // an optimization, because getEventLegacy is expensive
14878        if (this.hasPublicHandlers('eventAfterRender')) {
14879            segs.forEach(function (seg) {
14880                var legacy;
14881                if (seg.el) {
14882                    legacy = seg.footprint.getEventLegacy();
14883                    _this.publiclyTrigger('eventAfterRender', {
14884                        context: legacy,
14885                        args: [legacy, seg.el, _this]
14886                    });
14887                }
14888            });
14889        }
14890    };
14891    DateComponent.prototype.triggerBeforeEventsDestroyed = function () {
14892        this.triggerBeforeEventSegsDestroyed(this.getEventSegs());
14893    };
14894    DateComponent.prototype.triggerBeforeEventSegsDestroyed = function (segs) {
14895        var _this = this;
14896        if (this.hasPublicHandlers('eventDestroy')) {
14897            segs.forEach(function (seg) {
14898                var legacy;
14899                if (seg.el) {
14900                    legacy = seg.footprint.getEventLegacy();
14901                    _this.publiclyTrigger('eventDestroy', {
14902                        context: legacy,
14903                        args: [legacy, seg.el, _this]
14904                    });
14905                }
14906            });
14907        }
14908    };
14909    // Event Rendering Utils
14910    // -----------------------------------------------------------------------------------------------------------------
14911    // Hides all rendered event segments linked to the given event
14912    // RECURSIVE with subcomponents
14913    DateComponent.prototype.showEventsWithId = function (eventDefId) {
14914        this.getEventSegs().forEach(function (seg) {
14915            if (seg.footprint.eventDef.id === eventDefId &&
14916                seg.el // necessary?
14917            ) {
14918                seg.el.css('visibility', '');
14919            }
14920        });
14921        this.callChildren('showEventsWithId', arguments);
14922    };
14923    // Shows all rendered event segments linked to the given event
14924    // RECURSIVE with subcomponents
14925    DateComponent.prototype.hideEventsWithId = function (eventDefId) {
14926        this.getEventSegs().forEach(function (seg) {
14927            if (seg.footprint.eventDef.id === eventDefId &&
14928                seg.el // necessary?
14929            ) {
14930                seg.el.css('visibility', 'hidden');
14931            }
14932        });
14933        this.callChildren('hideEventsWithId', arguments);
14934    };
14935    // Drag-n-Drop Rendering (for both events and external elements)
14936    // ---------------------------------------------------------------------------------------------------------------
14937    // Renders a visual indication of a event or external-element drag over the given drop zone.
14938    // If an external-element, seg will be `null`.
14939    // Must return elements used for any mock events.
14940    DateComponent.prototype.renderDrag = function (eventFootprints, seg, isTouch) {
14941        var renderedHelper = false;
14942        this.iterChildren(function (child) {
14943            if (child.renderDrag(eventFootprints, seg, isTouch)) {
14944                renderedHelper = true;
14945            }
14946        });
14947        return renderedHelper;
14948    };
14949    // Unrenders a visual indication of an event or external-element being dragged.
14950    DateComponent.prototype.unrenderDrag = function () {
14951        this.callChildren('unrenderDrag', arguments);
14952    };
14953    // Event Resizing
14954    // ---------------------------------------------------------------------------------------------------------------
14955    // Renders a visual indication of an event being resized.
14956    DateComponent.prototype.renderEventResize = function (eventFootprints, seg, isTouch) {
14957        this.callChildren('renderEventResize', arguments);
14958    };
14959    // Unrenders a visual indication of an event being resized.
14960    DateComponent.prototype.unrenderEventResize = function () {
14961        this.callChildren('unrenderEventResize', arguments);
14962    };
14963    // Selection
14964    // ---------------------------------------------------------------------------------------------------------------
14965    // Renders a visual indication of the selection
14966    // TODO: rename to `renderSelection` after legacy is gone
14967    DateComponent.prototype.renderSelectionFootprint = function (componentFootprint) {
14968        this.renderHighlight(componentFootprint);
14969        this.callChildren('renderSelectionFootprint', arguments);
14970    };
14971    // Unrenders a visual indication of selection
14972    DateComponent.prototype.unrenderSelection = function () {
14973        this.unrenderHighlight();
14974        this.callChildren('unrenderSelection', arguments);
14975    };
14976    // Highlight
14977    // ---------------------------------------------------------------------------------------------------------------
14978    // Renders an emphasis on the given date range. Given a span (unzoned start/end and other misc data)
14979    DateComponent.prototype.renderHighlight = function (componentFootprint) {
14980        if (this.fillRenderer) {
14981            this.fillRenderer.renderFootprint('highlight', componentFootprint, {
14982                getClasses: function () {
14983                    return ['fc-highlight'];
14984                }
14985            });
14986        }
14987        this.callChildren('renderHighlight', arguments);
14988    };
14989    // Unrenders the emphasis on a date range
14990    DateComponent.prototype.unrenderHighlight = function () {
14991        if (this.fillRenderer) {
14992            this.fillRenderer.unrender('highlight');
14993        }
14994        this.callChildren('unrenderHighlight', arguments);
14995    };
14996    // Hit Areas
14997    // ---------------------------------------------------------------------------------------------------------------
14998    // just because all DateComponents support this interface
14999    // doesn't mean they need to have their own internal coord system. they can defer to sub-components.
15000    DateComponent.prototype.hitsNeeded = function () {
15001        if (!(this.hitsNeededDepth++)) {
15002            this.prepareHits();
15003        }
15004        this.callChildren('hitsNeeded', arguments);
15005    };
15006    DateComponent.prototype.hitsNotNeeded = function () {
15007        if (this.hitsNeededDepth && !(--this.hitsNeededDepth)) {
15008            this.releaseHits();
15009        }
15010        this.callChildren('hitsNotNeeded', arguments);
15011    };
15012    DateComponent.prototype.prepareHits = function () {
15013        // subclasses can implement
15014    };
15015    DateComponent.prototype.releaseHits = function () {
15016        // subclasses can implement
15017    };
15018    // Given coordinates from the topleft of the document, return data about the date-related area underneath.
15019    // Can return an object with arbitrary properties (although top/right/left/bottom are encouraged).
15020    // Must have a `grid` property, a reference to this current grid. TODO: avoid this
15021    // The returned object will be processed by getHitFootprint and getHitEl.
15022    DateComponent.prototype.queryHit = function (leftOffset, topOffset) {
15023        var childrenByUid = this.childrenByUid;
15024        var uid;
15025        var hit;
15026        for (uid in childrenByUid) {
15027            hit = childrenByUid[uid].queryHit(leftOffset, topOffset);
15028            if (hit) {
15029                break;
15030            }
15031        }
15032        return hit;
15033    };
15034    DateComponent.prototype.getSafeHitFootprint = function (hit) {
15035        var footprint = this.getHitFootprint(hit);
15036        if (!this.dateProfile.activeUnzonedRange.containsRange(footprint.unzonedRange)) {
15037            return null;
15038        }
15039        return footprint;
15040    };
15041    DateComponent.prototype.getHitFootprint = function (hit) {
15042        // what about being abstract!?
15043    };
15044    // Given position-level information about a date-related area within the grid,
15045    // should return a jQuery element that best represents it. passed to dayClick callback.
15046    DateComponent.prototype.getHitEl = function (hit) {
15047        // what about being abstract!?
15048    };
15049    /* Converting eventRange -> eventFootprint
15050    ------------------------------------------------------------------------------------------------------------------*/
15051    DateComponent.prototype.eventRangesToEventFootprints = function (eventRanges) {
15052        var eventFootprints = [];
15053        var i;
15054        for (i = 0; i < eventRanges.length; i++) {
15055            eventFootprints.push.apply(// append
15056            eventFootprints, this.eventRangeToEventFootprints(eventRanges[i]));
15057        }
15058        return eventFootprints;
15059    };
15060    DateComponent.prototype.eventRangeToEventFootprints = function (eventRange) {
15061        return [util_2.eventRangeToEventFootprint(eventRange)];
15062    };
15063    /* Converting componentFootprint/eventFootprint -> segs
15064    ------------------------------------------------------------------------------------------------------------------*/
15065    DateComponent.prototype.eventFootprintsToSegs = function (eventFootprints) {
15066        var segs = [];
15067        var i;
15068        for (i = 0; i < eventFootprints.length; i++) {
15069            segs.push.apply(segs, this.eventFootprintToSegs(eventFootprints[i]));
15070        }
15071        return segs;
15072    };
15073    // Given an event's span (unzoned start/end and other misc data), and the event itself,
15074    // slices into segments and attaches event-derived properties to them.
15075    // eventSpan - { start, end, isStart, isEnd, otherthings... }
15076    DateComponent.prototype.eventFootprintToSegs = function (eventFootprint) {
15077        var unzonedRange = eventFootprint.componentFootprint.unzonedRange;
15078        var segs;
15079        var i;
15080        var seg;
15081        segs = this.componentFootprintToSegs(eventFootprint.componentFootprint);
15082        for (i = 0; i < segs.length; i++) {
15083            seg = segs[i];
15084            if (!unzonedRange.isStart) {
15085                seg.isStart = false;
15086            }
15087            if (!unzonedRange.isEnd) {
15088                seg.isEnd = false;
15089            }
15090            seg.footprint = eventFootprint;
15091            // TODO: rename to seg.eventFootprint
15092        }
15093        return segs;
15094    };
15095    DateComponent.prototype.componentFootprintToSegs = function (componentFootprint) {
15096        return [];
15097    };
15098    // Utils
15099    // ---------------------------------------------------------------------------------------------------------------
15100    DateComponent.prototype.callChildren = function (methodName, args) {
15101        this.iterChildren(function (child) {
15102            child[methodName].apply(child, args);
15103        });
15104    };
15105    DateComponent.prototype.iterChildren = function (func) {
15106        var childrenByUid = this.childrenByUid;
15107        var uid;
15108        for (uid in childrenByUid) {
15109            func(childrenByUid[uid]);
15110        }
15111    };
15112    DateComponent.prototype._getCalendar = function () {
15113        var t = this;
15114        return t.calendar || t.view.calendar;
15115    };
15116    DateComponent.prototype._getView = function () {
15117        return this.view;
15118    };
15119    DateComponent.prototype._getDateProfile = function () {
15120        return this._getView().get('dateProfile');
15121    };
15122    // Generates HTML for an anchor to another view into the calendar.
15123    // Will either generate an <a> tag or a non-clickable <span> tag, depending on enabled settings.
15124    // `gotoOptions` can either be a moment input, or an object with the form:
15125    // { date, type, forceOff }
15126    // `type` is a view-type like "day" or "week". default value is "day".
15127    // `attrs` and `innerHtml` are use to generate the rest of the HTML tag.
15128    DateComponent.prototype.buildGotoAnchorHtml = function (gotoOptions, attrs, innerHtml) {
15129        var date;
15130        var type;
15131        var forceOff;
15132        var finalOptions;
15133        if ($.isPlainObject(gotoOptions)) {
15134            date = gotoOptions.date;
15135            type = gotoOptions.type;
15136            forceOff = gotoOptions.forceOff;
15137        }
15138        else {
15139            date = gotoOptions; // a single moment input
15140        }
15141        date = moment_ext_1.default(date); // if a string, parse it
15142        finalOptions = {
15143            date: date.format('YYYY-MM-DD'),
15144            type: type || 'day'
15145        };
15146        if (typeof attrs === 'string') {
15147            innerHtml = attrs;
15148            attrs = null;
15149        }
15150        attrs = attrs ? ' ' + util_1.attrsToStr(attrs) : ''; // will have a leading space
15151        innerHtml = innerHtml || '';
15152        if (!forceOff && this.opt('navLinks')) {
15153            return '<a' + attrs +
15154                ' data-goto="' + util_1.htmlEscape(JSON.stringify(finalOptions)) + '">' +
15155                innerHtml +
15156                '</a>';
15157        }
15158        else {
15159            return '<span' + attrs + '>' +
15160                innerHtml +
15161                '</span>';
15162        }
15163    };
15164    DateComponent.prototype.getAllDayHtml = function () {
15165        return this.opt('allDayHtml') || util_1.htmlEscape(this.opt('allDayText'));
15166    };
15167    // Computes HTML classNames for a single-day element
15168    DateComponent.prototype.getDayClasses = function (date, noThemeHighlight) {
15169        var view = this._getView();
15170        var classes = [];
15171        var today;
15172        if (!this.dateProfile.activeUnzonedRange.containsDate(date)) {
15173            classes.push('fc-disabled-day'); // TODO: jQuery UI theme?
15174        }
15175        else {
15176            classes.push('fc-' + util_1.dayIDs[date.day()]);
15177            if (view.isDateInOtherMonth(date, this.dateProfile)) {
15178                classes.push('fc-other-month');
15179            }
15180            today = view.calendar.getNow();
15181            if (date.isSame(today, 'day')) {
15182                classes.push('fc-today');
15183                if (noThemeHighlight !== true) {
15184                    classes.push(view.calendar.theme.getClass('today'));
15185                }
15186            }
15187            else if (date < today) {
15188                classes.push('fc-past');
15189            }
15190            else {
15191                classes.push('fc-future');
15192            }
15193        }
15194        return classes;
15195    };
15196    // Utility for formatting a range. Accepts a range object, formatting string, and optional separator.
15197    // Displays all-day ranges naturally, with an inclusive end. Takes the current isRTL into account.
15198    // The timezones of the dates within `range` will be respected.
15199    DateComponent.prototype.formatRange = function (range, isAllDay, formatStr, separator) {
15200        var end = range.end;
15201        if (isAllDay) {
15202            end = end.clone().subtract(1); // convert to inclusive. last ms of previous day
15203        }
15204        return date_formatting_1.formatRange(range.start, end, formatStr, separator, this.isRTL);
15205    };
15206    // Compute the number of the give units in the "current" range.
15207    // Will return a floating-point number. Won't round.
15208    DateComponent.prototype.currentRangeAs = function (unit) {
15209        return this._getDateProfile().currentUnzonedRange.as(unit);
15210    };
15211    // Returns the date range of the full days the given range visually appears to occupy.
15212    // Returns a plain object with start/end, NOT an UnzonedRange!
15213    DateComponent.prototype.computeDayRange = function (unzonedRange) {
15214        var calendar = this._getCalendar();
15215        var startDay = calendar.msToUtcMoment(unzonedRange.startMs, true); // the beginning of the day the range starts
15216        var end = calendar.msToUtcMoment(unzonedRange.endMs);
15217        var endTimeMS = +end.time(); // # of milliseconds into `endDay`
15218        var endDay = end.clone().stripTime(); // the beginning of the day the range exclusively ends
15219        // If the end time is actually inclusively part of the next day and is equal to or
15220        // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.
15221        // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.
15222        if (endTimeMS && endTimeMS >= this.nextDayThreshold) {
15223            endDay.add(1, 'days');
15224        }
15225        // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.
15226        if (endDay <= startDay) {
15227            endDay = startDay.clone().add(1, 'days');
15228        }
15229        return { start: startDay, end: endDay };
15230    };
15231    // Does the given range visually appear to occupy more than one day?
15232    DateComponent.prototype.isMultiDayRange = function (unzonedRange) {
15233        var dayRange = this.computeDayRange(unzonedRange);
15234        return dayRange.end.diff(dayRange.start, 'days') > 1;
15235    };
15236    DateComponent.guid = 0; // TODO: better system for this?
15237    return DateComponent;
15238}(Component_1.default));
15239exports.default = DateComponent;
15240// legacy
15241function convertEventsPayloadToLegacyArray(eventsPayload) {
15242    var eventDefId;
15243    var eventInstances;
15244    var legacyEvents = [];
15245    var i;
15246    for (eventDefId in eventsPayload) {
15247        eventInstances = eventsPayload[eventDefId].eventInstances;
15248        for (i = 0; i < eventInstances.length; i++) {
15249            legacyEvents.push(eventInstances[i].toLegacy());
15250        }
15251    }
15252    return legacyEvents;
15253}
15254
15255
15256/***/ }),
15257/* 220 */
15258/***/ (function(module, exports, __webpack_require__) {
15259
15260Object.defineProperty(exports, "__esModule", { value: true });
15261var $ = __webpack_require__(3);
15262var moment = __webpack_require__(0);
15263var util_1 = __webpack_require__(4);
15264var options_1 = __webpack_require__(31);
15265var Iterator_1 = __webpack_require__(238);
15266var GlobalEmitter_1 = __webpack_require__(15);
15267var EmitterMixin_1 = __webpack_require__(11);
15268var ListenerMixin_1 = __webpack_require__(7);
15269var Toolbar_1 = __webpack_require__(239);
15270var OptionsManager_1 = __webpack_require__(240);
15271var ViewSpecManager_1 = __webpack_require__(241);
15272var Constraints_1 = __webpack_require__(207);
15273var locale_1 = __webpack_require__(30);
15274var moment_ext_1 = __webpack_require__(10);
15275var UnzonedRange_1 = __webpack_require__(5);
15276var ComponentFootprint_1 = __webpack_require__(12);
15277var EventDateProfile_1 = __webpack_require__(18);
15278var EventManager_1 = __webpack_require__(242);
15279var BusinessHourGenerator_1 = __webpack_require__(212);
15280var EventSourceParser_1 = __webpack_require__(37);
15281var EventDefParser_1 = __webpack_require__(49);
15282var SingleEventDef_1 = __webpack_require__(13);
15283var EventDefMutation_1 = __webpack_require__(36);
15284var EventSource_1 = __webpack_require__(6);
15285var ThemeRegistry_1 = __webpack_require__(51);
15286var Calendar = /** @class */ (function () {
15287    function Calendar(el, overrides) {
15288        this.loadingLevel = 0; // number of simultaneous loading tasks
15289        this.ignoreUpdateViewSize = 0;
15290        this.freezeContentHeightDepth = 0;
15291        // declare the current calendar instance relies on GlobalEmitter. needed for garbage collection.
15292        // unneeded() is called in destroy.
15293        GlobalEmitter_1.default.needed();
15294        this.el = el;
15295        this.viewsByType = {};
15296        this.optionsManager = new OptionsManager_1.default(this, overrides);
15297        this.viewSpecManager = new ViewSpecManager_1.default(this.optionsManager, this);
15298        this.initMomentInternals(); // needs to happen after options hash initialized
15299        this.initCurrentDate();
15300        this.initEventManager();
15301        this.constraints = new Constraints_1.default(this.eventManager, this);
15302        this.constructed();
15303    }
15304    Calendar.prototype.constructed = function () {
15305        // useful for monkeypatching. used?
15306    };
15307    Calendar.prototype.getView = function () {
15308        return this.view;
15309    };
15310    Calendar.prototype.publiclyTrigger = function (name, triggerInfo) {
15311        var optHandler = this.opt(name);
15312        var context;
15313        var args;
15314        if ($.isPlainObject(triggerInfo)) {
15315            context = triggerInfo.context;
15316            args = triggerInfo.args;
15317        }
15318        else if ($.isArray(triggerInfo)) {
15319            args = triggerInfo;
15320        }
15321        if (context == null) {
15322            context = this.el[0]; // fallback context
15323        }
15324        if (!args) {
15325            args = [];
15326        }
15327        this.triggerWith(name, context, args); // Emitter's method
15328        if (optHandler) {
15329            return optHandler.apply(context, args);
15330        }
15331    };
15332    Calendar.prototype.hasPublicHandlers = function (name) {
15333        return this.hasHandlers(name) ||
15334            this.opt(name); // handler specified in options
15335    };
15336    // Options Public API
15337    // -----------------------------------------------------------------------------------------------------------------
15338    // public getter/setter
15339    Calendar.prototype.option = function (name, value) {
15340        var newOptionHash;
15341        if (typeof name === 'string') {
15342            if (value === undefined) {
15343                return this.optionsManager.get(name);
15344            }
15345            else {
15346                newOptionHash = {};
15347                newOptionHash[name] = value;
15348                this.optionsManager.add(newOptionHash);
15349            }
15350        }
15351        else if (typeof name === 'object') {
15352            this.optionsManager.add(name);
15353        }
15354    };
15355    // private getter
15356    Calendar.prototype.opt = function (name) {
15357        return this.optionsManager.get(name);
15358    };
15359    // View
15360    // -----------------------------------------------------------------------------------------------------------------
15361    // Given a view name for a custom view or a standard view, creates a ready-to-go View object
15362    Calendar.prototype.instantiateView = function (viewType) {
15363        var spec = this.viewSpecManager.getViewSpec(viewType);
15364        if (!spec) {
15365            throw new Error("View type \"" + viewType + "\" is not valid");
15366        }
15367        return new spec['class'](this, spec);
15368    };
15369    // Returns a boolean about whether the view is okay to instantiate at some point
15370    Calendar.prototype.isValidViewType = function (viewType) {
15371        return Boolean(this.viewSpecManager.getViewSpec(viewType));
15372    };
15373    Calendar.prototype.changeView = function (viewName, dateOrRange) {
15374        if (dateOrRange) {
15375            if (dateOrRange.start && dateOrRange.end) {
15376                this.optionsManager.recordOverrides({
15377                    visibleRange: dateOrRange
15378                });
15379            }
15380            else {
15381                this.currentDate = this.moment(dateOrRange).stripZone(); // just like gotoDate
15382            }
15383        }
15384        this.renderView(viewName);
15385    };
15386    // Forces navigation to a view for the given date.
15387    // `viewType` can be a specific view name or a generic one like "week" or "day".
15388    Calendar.prototype.zoomTo = function (newDate, viewType) {
15389        var spec;
15390        viewType = viewType || 'day'; // day is default zoom
15391        spec = this.viewSpecManager.getViewSpec(viewType) ||
15392            this.viewSpecManager.getUnitViewSpec(viewType);
15393        this.currentDate = newDate.clone();
15394        this.renderView(spec ? spec.type : null);
15395    };
15396    // Current Date
15397    // -----------------------------------------------------------------------------------------------------------------
15398    Calendar.prototype.initCurrentDate = function () {
15399        var defaultDateInput = this.opt('defaultDate');
15400        // compute the initial ambig-timezone date
15401        if (defaultDateInput != null) {
15402            this.currentDate = this.moment(defaultDateInput).stripZone();
15403        }
15404        else {
15405            this.currentDate = this.getNow(); // getNow already returns unzoned
15406        }
15407    };
15408    Calendar.prototype.prev = function () {
15409        var view = this.view;
15410        var prevInfo = view.dateProfileGenerator.buildPrev(view.get('dateProfile'));
15411        if (prevInfo.isValid) {
15412            this.currentDate = prevInfo.date;
15413            this.renderView();
15414        }
15415    };
15416    Calendar.prototype.next = function () {
15417        var view = this.view;
15418        var nextInfo = view.dateProfileGenerator.buildNext(view.get('dateProfile'));
15419        if (nextInfo.isValid) {
15420            this.currentDate = nextInfo.date;
15421            this.renderView();
15422        }
15423    };
15424    Calendar.prototype.prevYear = function () {
15425        this.currentDate.add(-1, 'years');
15426        this.renderView();
15427    };
15428    Calendar.prototype.nextYear = function () {
15429        this.currentDate.add(1, 'years');
15430        this.renderView();
15431    };
15432    Calendar.prototype.today = function () {
15433        this.currentDate = this.getNow(); // should deny like prev/next?
15434        this.renderView();
15435    };
15436    Calendar.prototype.gotoDate = function (zonedDateInput) {
15437        this.currentDate = this.moment(zonedDateInput).stripZone();
15438        this.renderView();
15439    };
15440    Calendar.prototype.incrementDate = function (delta) {
15441        this.currentDate.add(moment.duration(delta));
15442        this.renderView();
15443    };
15444    // for external API
15445    Calendar.prototype.getDate = function () {
15446        return this.applyTimezone(this.currentDate); // infuse the calendar's timezone
15447    };
15448    // Loading Triggering
15449    // -----------------------------------------------------------------------------------------------------------------
15450    // Should be called when any type of async data fetching begins
15451    Calendar.prototype.pushLoading = function () {
15452        if (!(this.loadingLevel++)) {
15453            this.publiclyTrigger('loading', [true, this.view]);
15454        }
15455    };
15456    // Should be called when any type of async data fetching completes
15457    Calendar.prototype.popLoading = function () {
15458        if (!(--this.loadingLevel)) {
15459            this.publiclyTrigger('loading', [false, this.view]);
15460        }
15461    };
15462    // High-level Rendering
15463    // -----------------------------------------------------------------------------------
15464    Calendar.prototype.render = function () {
15465        if (!this.contentEl) {
15466            this.initialRender();
15467        }
15468        else if (this.elementVisible()) {
15469            // mainly for the public API
15470            this.calcSize();
15471            this.updateViewSize();
15472        }
15473    };
15474    Calendar.prototype.initialRender = function () {
15475        var _this = this;
15476        var el = this.el;
15477        el.addClass('fc');
15478        // event delegation for nav links
15479        el.on('click.fc', 'a[data-goto]', function (ev) {
15480            var anchorEl = $(ev.currentTarget);
15481            var gotoOptions = anchorEl.data('goto'); // will automatically parse JSON
15482            var date = _this.moment(gotoOptions.date);
15483            var viewType = gotoOptions.type;
15484            // property like "navLinkDayClick". might be a string or a function
15485            var customAction = _this.view.opt('navLink' + util_1.capitaliseFirstLetter(viewType) + 'Click');
15486            if (typeof customAction === 'function') {
15487                customAction(date, ev);
15488            }
15489            else {
15490                if (typeof customAction === 'string') {
15491                    viewType = customAction;
15492                }
15493                _this.zoomTo(date, viewType);
15494            }
15495        });
15496        // called immediately, and upon option change
15497        this.optionsManager.watch('settingTheme', ['?theme', '?themeSystem'], function (opts) {
15498            var themeClass = ThemeRegistry_1.getThemeSystemClass(opts.themeSystem || opts.theme);
15499            var theme = new themeClass(_this.optionsManager);
15500            var widgetClass = theme.getClass('widget');
15501            _this.theme = theme;
15502            if (widgetClass) {
15503                el.addClass(widgetClass);
15504            }
15505        }, function () {
15506            var widgetClass = _this.theme.getClass('widget');
15507            _this.theme = null;
15508            if (widgetClass) {
15509                el.removeClass(widgetClass);
15510            }
15511        });
15512        this.optionsManager.watch('settingBusinessHourGenerator', ['?businessHours'], function (deps) {
15513            _this.businessHourGenerator = new BusinessHourGenerator_1.default(deps.businessHours, _this);
15514            if (_this.view) {
15515                _this.view.set('businessHourGenerator', _this.businessHourGenerator);
15516            }
15517        }, function () {
15518            _this.businessHourGenerator = null;
15519        });
15520        // called immediately, and upon option change.
15521        // HACK: locale often affects isRTL, so we explicitly listen to that too.
15522        this.optionsManager.watch('applyingDirClasses', ['?isRTL', '?locale'], function (opts) {
15523            el.toggleClass('fc-ltr', !opts.isRTL);
15524            el.toggleClass('fc-rtl', opts.isRTL);
15525        });
15526        this.contentEl = $("<div class='fc-view-container'/>").prependTo(el);
15527        this.initToolbars();
15528        this.renderHeader();
15529        this.renderFooter();
15530        this.renderView(this.opt('defaultView'));
15531        if (this.opt('handleWindowResize')) {
15532            $(window).resize(this.windowResizeProxy = util_1.debounce(// prevents rapid calls
15533            this.windowResize.bind(this), this.opt('windowResizeDelay')));
15534        }
15535    };
15536    Calendar.prototype.destroy = function () {
15537        if (this.view) {
15538            this.clearView();
15539        }
15540        this.toolbarsManager.proxyCall('removeElement');
15541        this.contentEl.remove();
15542        this.el.removeClass('fc fc-ltr fc-rtl');
15543        // removes theme-related root className
15544        this.optionsManager.unwatch('settingTheme');
15545        this.optionsManager.unwatch('settingBusinessHourGenerator');
15546        this.el.off('.fc'); // unbind nav link handlers
15547        if (this.windowResizeProxy) {
15548            $(window).unbind('resize', this.windowResizeProxy);
15549            this.windowResizeProxy = null;
15550        }
15551        GlobalEmitter_1.default.unneeded();
15552    };
15553    Calendar.prototype.elementVisible = function () {
15554        return this.el.is(':visible');
15555    };
15556    // Render Queue
15557    // -----------------------------------------------------------------------------------------------------------------
15558    Calendar.prototype.bindViewHandlers = function (view) {
15559        var _this = this;
15560        view.watch('titleForCalendar', ['title'], function (deps) {
15561            if (view === _this.view) {
15562                _this.setToolbarsTitle(deps.title);
15563            }
15564        });
15565        view.watch('dateProfileForCalendar', ['dateProfile'], function (deps) {
15566            if (view === _this.view) {
15567                _this.currentDate = deps.dateProfile.date; // might have been constrained by view dates
15568                _this.updateToolbarButtons(deps.dateProfile);
15569            }
15570        });
15571    };
15572    Calendar.prototype.unbindViewHandlers = function (view) {
15573        view.unwatch('titleForCalendar');
15574        view.unwatch('dateProfileForCalendar');
15575    };
15576    // View Rendering
15577    // -----------------------------------------------------------------------------------
15578    // Renders a view because of a date change, view-type change, or for the first time.
15579    // If not given a viewType, keep the current view but render different dates.
15580    // Accepts an optional scroll state to restore to.
15581    Calendar.prototype.renderView = function (viewType) {
15582        var oldView = this.view;
15583        var newView;
15584        this.freezeContentHeight();
15585        if (oldView && viewType && oldView.type !== viewType) {
15586            this.clearView();
15587        }
15588        // if viewType changed, or the view was never created, create a fresh view
15589        if (!this.view && viewType) {
15590            newView = this.view =
15591                this.viewsByType[viewType] ||
15592                    (this.viewsByType[viewType] = this.instantiateView(viewType));
15593            this.bindViewHandlers(newView);
15594            newView.startBatchRender(); // so that setElement+setDate rendering are joined
15595            newView.setElement($("<div class='fc-view fc-" + viewType + "-view' />").appendTo(this.contentEl));
15596            this.toolbarsManager.proxyCall('activateButton', viewType);
15597        }
15598        if (this.view) {
15599            // prevent unnecessary change firing
15600            if (this.view.get('businessHourGenerator') !== this.businessHourGenerator) {
15601                this.view.set('businessHourGenerator', this.businessHourGenerator);
15602            }
15603            this.view.setDate(this.currentDate);
15604            if (newView) {
15605                newView.stopBatchRender();
15606            }
15607        }
15608        this.thawContentHeight();
15609    };
15610    // Unrenders the current view and reflects this change in the Header.
15611    // Unregsiters the `view`, but does not remove from viewByType hash.
15612    Calendar.prototype.clearView = function () {
15613        var currentView = this.view;
15614        this.toolbarsManager.proxyCall('deactivateButton', currentView.type);
15615        this.unbindViewHandlers(currentView);
15616        currentView.removeElement();
15617        currentView.unsetDate(); // so bindViewHandlers doesn't fire with old values next time
15618        this.view = null;
15619    };
15620    // Destroys the view, including the view object. Then, re-instantiates it and renders it.
15621    // Maintains the same scroll state.
15622    // TODO: maintain any other user-manipulated state.
15623    Calendar.prototype.reinitView = function () {
15624        var oldView = this.view;
15625        var scroll = oldView.queryScroll(); // wouldn't be so complicated if Calendar owned the scroll
15626        this.freezeContentHeight();
15627        this.clearView();
15628        this.calcSize();
15629        this.renderView(oldView.type); // needs the type to freshly render
15630        this.view.applyScroll(scroll);
15631        this.thawContentHeight();
15632    };
15633    // Resizing
15634    // -----------------------------------------------------------------------------------
15635    Calendar.prototype.getSuggestedViewHeight = function () {
15636        if (this.suggestedViewHeight == null) {
15637            this.calcSize();
15638        }
15639        return this.suggestedViewHeight;
15640    };
15641    Calendar.prototype.isHeightAuto = function () {
15642        return this.opt('contentHeight') === 'auto' || this.opt('height') === 'auto';
15643    };
15644    Calendar.prototype.updateViewSize = function (isResize) {
15645        if (isResize === void 0) { isResize = false; }
15646        var view = this.view;
15647        var scroll;
15648        if (!this.ignoreUpdateViewSize && view) {
15649            if (isResize) {
15650                this.calcSize();
15651                scroll = view.queryScroll();
15652            }
15653            this.ignoreUpdateViewSize++;
15654            view.updateSize(this.getSuggestedViewHeight(), this.isHeightAuto(), isResize);
15655            this.ignoreUpdateViewSize--;
15656            if (isResize) {
15657                view.applyScroll(scroll);
15658            }
15659            return true; // signal success
15660        }
15661    };
15662    Calendar.prototype.calcSize = function () {
15663        if (this.elementVisible()) {
15664            this._calcSize();
15665        }
15666    };
15667    Calendar.prototype._calcSize = function () {
15668        var contentHeightInput = this.opt('contentHeight');
15669        var heightInput = this.opt('height');
15670        if (typeof contentHeightInput === 'number') {
15671            this.suggestedViewHeight = contentHeightInput;
15672        }
15673        else if (typeof contentHeightInput === 'function') {
15674            this.suggestedViewHeight = contentHeightInput();
15675        }
15676        else if (typeof heightInput === 'number') {
15677            this.suggestedViewHeight = heightInput - this.queryToolbarsHeight();
15678        }
15679        else if (typeof heightInput === 'function') {
15680            this.suggestedViewHeight = heightInput() - this.queryToolbarsHeight();
15681        }
15682        else if (heightInput === 'parent') {
15683            this.suggestedViewHeight = this.el.parent().height() - this.queryToolbarsHeight();
15684        }
15685        else {
15686            this.suggestedViewHeight = Math.round(this.contentEl.width() /
15687                Math.max(this.opt('aspectRatio'), .5));
15688        }
15689    };
15690    Calendar.prototype.windowResize = function (ev) {
15691        if (
15692        // the purpose: so we don't process jqui "resize" events that have bubbled up
15693        // cast to any because .target, which is Element, can't be compared to window for some reason.
15694        ev.target === window &&
15695            this.view &&
15696            this.view.isDatesRendered) {
15697            if (this.updateViewSize(true)) {
15698                this.publiclyTrigger('windowResize', [this.view]);
15699            }
15700        }
15701    };
15702    /* Height "Freezing"
15703    -----------------------------------------------------------------------------*/
15704    Calendar.prototype.freezeContentHeight = function () {
15705        if (!(this.freezeContentHeightDepth++)) {
15706            this.forceFreezeContentHeight();
15707        }
15708    };
15709    Calendar.prototype.forceFreezeContentHeight = function () {
15710        this.contentEl.css({
15711            width: '100%',
15712            height: this.contentEl.height(),
15713            overflow: 'hidden'
15714        });
15715    };
15716    Calendar.prototype.thawContentHeight = function () {
15717        this.freezeContentHeightDepth--;
15718        // always bring back to natural height
15719        this.contentEl.css({
15720            width: '',
15721            height: '',
15722            overflow: ''
15723        });
15724        // but if there are future thaws, re-freeze
15725        if (this.freezeContentHeightDepth) {
15726            this.forceFreezeContentHeight();
15727        }
15728    };
15729    // Toolbar
15730    // -----------------------------------------------------------------------------------------------------------------
15731    Calendar.prototype.initToolbars = function () {
15732        this.header = new Toolbar_1.default(this, this.computeHeaderOptions());
15733        this.footer = new Toolbar_1.default(this, this.computeFooterOptions());
15734        this.toolbarsManager = new Iterator_1.default([this.header, this.footer]);
15735    };
15736    Calendar.prototype.computeHeaderOptions = function () {
15737        return {
15738            extraClasses: 'fc-header-toolbar',
15739            layout: this.opt('header')
15740        };
15741    };
15742    Calendar.prototype.computeFooterOptions = function () {
15743        return {
15744            extraClasses: 'fc-footer-toolbar',
15745            layout: this.opt('footer')
15746        };
15747    };
15748    // can be called repeatedly and Header will rerender
15749    Calendar.prototype.renderHeader = function () {
15750        var header = this.header;
15751        header.setToolbarOptions(this.computeHeaderOptions());
15752        header.render();
15753        if (header.el) {
15754            this.el.prepend(header.el);
15755        }
15756    };
15757    // can be called repeatedly and Footer will rerender
15758    Calendar.prototype.renderFooter = function () {
15759        var footer = this.footer;
15760        footer.setToolbarOptions(this.computeFooterOptions());
15761        footer.render();
15762        if (footer.el) {
15763            this.el.append(footer.el);
15764        }
15765    };
15766    Calendar.prototype.setToolbarsTitle = function (title) {
15767        this.toolbarsManager.proxyCall('updateTitle', title);
15768    };
15769    Calendar.prototype.updateToolbarButtons = function (dateProfile) {
15770        var now = this.getNow();
15771        var view = this.view;
15772        var todayInfo = view.dateProfileGenerator.build(now);
15773        var prevInfo = view.dateProfileGenerator.buildPrev(view.get('dateProfile'));
15774        var nextInfo = view.dateProfileGenerator.buildNext(view.get('dateProfile'));
15775        this.toolbarsManager.proxyCall((todayInfo.isValid && !dateProfile.currentUnzonedRange.containsDate(now)) ?
15776            'enableButton' :
15777            'disableButton', 'today');
15778        this.toolbarsManager.proxyCall(prevInfo.isValid ?
15779            'enableButton' :
15780            'disableButton', 'prev');
15781        this.toolbarsManager.proxyCall(nextInfo.isValid ?
15782            'enableButton' :
15783            'disableButton', 'next');
15784    };
15785    Calendar.prototype.queryToolbarsHeight = function () {
15786        return this.toolbarsManager.items.reduce(function (accumulator, toolbar) {
15787            var toolbarHeight = toolbar.el ? toolbar.el.outerHeight(true) : 0; // includes margin
15788            return accumulator + toolbarHeight;
15789        }, 0);
15790    };
15791    // Selection
15792    // -----------------------------------------------------------------------------------------------------------------
15793    // this public method receives start/end dates in any format, with any timezone
15794    Calendar.prototype.select = function (zonedStartInput, zonedEndInput) {
15795        this.view.select(this.buildSelectFootprint.apply(this, arguments));
15796    };
15797    Calendar.prototype.unselect = function () {
15798        if (this.view) {
15799            this.view.unselect();
15800        }
15801    };
15802    // Given arguments to the select method in the API, returns a span (unzoned start/end and other info)
15803    Calendar.prototype.buildSelectFootprint = function (zonedStartInput, zonedEndInput) {
15804        var start = this.moment(zonedStartInput).stripZone();
15805        var end;
15806        if (zonedEndInput) {
15807            end = this.moment(zonedEndInput).stripZone();
15808        }
15809        else if (start.hasTime()) {
15810            end = start.clone().add(this.defaultTimedEventDuration);
15811        }
15812        else {
15813            end = start.clone().add(this.defaultAllDayEventDuration);
15814        }
15815        return new ComponentFootprint_1.default(new UnzonedRange_1.default(start, end), !start.hasTime());
15816    };
15817    // Date Utils
15818    // -----------------------------------------------------------------------------------------------------------------
15819    Calendar.prototype.initMomentInternals = function () {
15820        var _this = this;
15821        this.defaultAllDayEventDuration = moment.duration(this.opt('defaultAllDayEventDuration'));
15822        this.defaultTimedEventDuration = moment.duration(this.opt('defaultTimedEventDuration'));
15823        // Called immediately, and when any of the options change.
15824        // Happens before any internal objects rebuild or rerender, because this is very core.
15825        this.optionsManager.watch('buildingMomentLocale', [
15826            '?locale', '?monthNames', '?monthNamesShort', '?dayNames', '?dayNamesShort',
15827            '?firstDay', '?weekNumberCalculation'
15828        ], function (opts) {
15829            var weekNumberCalculation = opts.weekNumberCalculation;
15830            var firstDay = opts.firstDay;
15831            var _week;
15832            // normalize
15833            if (weekNumberCalculation === 'iso') {
15834                weekNumberCalculation = 'ISO'; // normalize
15835            }
15836            var localeData = Object.create(// make a cheap copy
15837            locale_1.getMomentLocaleData(opts.locale) // will fall back to en
15838            );
15839            if (opts.monthNames) {
15840                localeData._months = opts.monthNames;
15841            }
15842            if (opts.monthNamesShort) {
15843                localeData._monthsShort = opts.monthNamesShort;
15844            }
15845            if (opts.dayNames) {
15846                localeData._weekdays = opts.dayNames;
15847            }
15848            if (opts.dayNamesShort) {
15849                localeData._weekdaysShort = opts.dayNamesShort;
15850            }
15851            if (firstDay == null && weekNumberCalculation === 'ISO') {
15852                firstDay = 1;
15853            }
15854            if (firstDay != null) {
15855                _week = Object.create(localeData._week); // _week: { dow: # }
15856                _week.dow = firstDay;
15857                localeData._week = _week;
15858            }
15859            if (weekNumberCalculation === 'ISO' ||
15860                weekNumberCalculation === 'local' ||
15861                typeof weekNumberCalculation === 'function') {
15862                localeData._fullCalendar_weekCalc = weekNumberCalculation; // moment-ext will know what to do with it
15863            }
15864            _this.localeData = localeData;
15865            // If the internal current date object already exists, move to new locale.
15866            // We do NOT need to do this technique for event dates, because this happens when converting to "segments".
15867            if (_this.currentDate) {
15868                _this.localizeMoment(_this.currentDate); // sets to localeData
15869            }
15870        });
15871    };
15872    // Builds a moment using the settings of the current calendar: timezone and locale.
15873    // Accepts anything the vanilla moment() constructor accepts.
15874    Calendar.prototype.moment = function () {
15875        var args = [];
15876        for (var _i = 0; _i < arguments.length; _i++) {
15877            args[_i] = arguments[_i];
15878        }
15879        var mom;
15880        if (this.opt('timezone') === 'local') {
15881            mom = moment_ext_1.default.apply(null, args);
15882            // Force the moment to be local, because momentExt doesn't guarantee it.
15883            if (mom.hasTime()) {
15884                mom.local();
15885            }
15886        }
15887        else if (this.opt('timezone') === 'UTC') {
15888            mom = moment_ext_1.default.utc.apply(null, args); // process as UTC
15889        }
15890        else {
15891            mom = moment_ext_1.default.parseZone.apply(null, args); // let the input decide the zone
15892        }
15893        this.localizeMoment(mom); // TODO
15894        return mom;
15895    };
15896    Calendar.prototype.msToMoment = function (ms, forceAllDay) {
15897        var mom = moment_ext_1.default.utc(ms); // TODO: optimize by using Date.UTC
15898        if (forceAllDay) {
15899            mom.stripTime();
15900        }
15901        else {
15902            mom = this.applyTimezone(mom); // may or may not apply locale
15903        }
15904        this.localizeMoment(mom);
15905        return mom;
15906    };
15907    Calendar.prototype.msToUtcMoment = function (ms, forceAllDay) {
15908        var mom = moment_ext_1.default.utc(ms); // TODO: optimize by using Date.UTC
15909        if (forceAllDay) {
15910            mom.stripTime();
15911        }
15912        this.localizeMoment(mom);
15913        return mom;
15914    };
15915    // Updates the given moment's locale settings to the current calendar locale settings.
15916    Calendar.prototype.localizeMoment = function (mom) {
15917        mom._locale = this.localeData;
15918    };
15919    // Returns a boolean about whether or not the calendar knows how to calculate
15920    // the timezone offset of arbitrary dates in the current timezone.
15921    Calendar.prototype.getIsAmbigTimezone = function () {
15922        return this.opt('timezone') !== 'local' && this.opt('timezone') !== 'UTC';
15923    };
15924    // Returns a copy of the given date in the current timezone. Has no effect on dates without times.
15925    Calendar.prototype.applyTimezone = function (date) {
15926        if (!date.hasTime()) {
15927            return date.clone();
15928        }
15929        var zonedDate = this.moment(date.toArray());
15930        var timeAdjust = date.time().asMilliseconds() - zonedDate.time().asMilliseconds();
15931        var adjustedZonedDate;
15932        // Safari sometimes has problems with this coersion when near DST. Adjust if necessary. (bug #2396)
15933        if (timeAdjust) {
15934            adjustedZonedDate = zonedDate.clone().add(timeAdjust); // add milliseconds
15935            if (date.time().asMilliseconds() - adjustedZonedDate.time().asMilliseconds() === 0) {
15936                zonedDate = adjustedZonedDate;
15937            }
15938        }
15939        return zonedDate;
15940    };
15941    /*
15942    Assumes the footprint is non-open-ended.
15943    */
15944    Calendar.prototype.footprintToDateProfile = function (componentFootprint, ignoreEnd) {
15945        if (ignoreEnd === void 0) { ignoreEnd = false; }
15946        var start = moment_ext_1.default.utc(componentFootprint.unzonedRange.startMs);
15947        var end;
15948        if (!ignoreEnd) {
15949            end = moment_ext_1.default.utc(componentFootprint.unzonedRange.endMs);
15950        }
15951        if (componentFootprint.isAllDay) {
15952            start.stripTime();
15953            if (end) {
15954                end.stripTime();
15955            }
15956        }
15957        else {
15958            start = this.applyTimezone(start);
15959            if (end) {
15960                end = this.applyTimezone(end);
15961            }
15962        }
15963        return new EventDateProfile_1.default(start, end, this);
15964    };
15965    // Returns a moment for the current date, as defined by the client's computer or from the `now` option.
15966    // Will return an moment with an ambiguous timezone.
15967    Calendar.prototype.getNow = function () {
15968        var now = this.opt('now');
15969        if (typeof now === 'function') {
15970            now = now();
15971        }
15972        return this.moment(now).stripZone();
15973    };
15974    // Produces a human-readable string for the given duration.
15975    // Side-effect: changes the locale of the given duration.
15976    Calendar.prototype.humanizeDuration = function (duration) {
15977        return duration.locale(this.opt('locale')).humanize();
15978    };
15979    // will return `null` if invalid range
15980    Calendar.prototype.parseUnzonedRange = function (rangeInput) {
15981        var start = null;
15982        var end = null;
15983        if (rangeInput.start) {
15984            start = this.moment(rangeInput.start).stripZone();
15985        }
15986        if (rangeInput.end) {
15987            end = this.moment(rangeInput.end).stripZone();
15988        }
15989        if (!start && !end) {
15990            return null;
15991        }
15992        if (start && end && end.isBefore(start)) {
15993            return null;
15994        }
15995        return new UnzonedRange_1.default(start, end);
15996    };
15997    // Event-Date Utilities
15998    // -----------------------------------------------------------------------------------------------------------------
15999    Calendar.prototype.initEventManager = function () {
16000        var _this = this;
16001        var eventManager = new EventManager_1.default(this);
16002        var rawSources = this.opt('eventSources') || [];
16003        var singleRawSource = this.opt('events');
16004        this.eventManager = eventManager;
16005        if (singleRawSource) {
16006            rawSources.unshift(singleRawSource);
16007        }
16008        eventManager.on('release', function (eventsPayload) {
16009            _this.trigger('eventsReset', eventsPayload);
16010        });
16011        eventManager.freeze();
16012        rawSources.forEach(function (rawSource) {
16013            var source = EventSourceParser_1.default.parse(rawSource, _this);
16014            if (source) {
16015                eventManager.addSource(source);
16016            }
16017        });
16018        eventManager.thaw();
16019    };
16020    Calendar.prototype.requestEvents = function (start, end) {
16021        return this.eventManager.requestEvents(start, end, this.opt('timezone'), !this.opt('lazyFetching'));
16022    };
16023    // Get an event's normalized end date. If not present, calculate it from the defaults.
16024    Calendar.prototype.getEventEnd = function (event) {
16025        if (event.end) {
16026            return event.end.clone();
16027        }
16028        else {
16029            return this.getDefaultEventEnd(event.allDay, event.start);
16030        }
16031    };
16032    // Given an event's allDay status and start date, return what its fallback end date should be.
16033    // TODO: rename to computeDefaultEventEnd
16034    Calendar.prototype.getDefaultEventEnd = function (allDay, zonedStart) {
16035        var end = zonedStart.clone();
16036        if (allDay) {
16037            end.stripTime().add(this.defaultAllDayEventDuration);
16038        }
16039        else {
16040            end.add(this.defaultTimedEventDuration);
16041        }
16042        if (this.getIsAmbigTimezone()) {
16043            end.stripZone(); // we don't know what the tzo should be
16044        }
16045        return end;
16046    };
16047    // Public Events API
16048    // -----------------------------------------------------------------------------------------------------------------
16049    Calendar.prototype.rerenderEvents = function () {
16050        this.view.flash('displayingEvents');
16051    };
16052    Calendar.prototype.refetchEvents = function () {
16053        this.eventManager.refetchAllSources();
16054    };
16055    Calendar.prototype.renderEvents = function (eventInputs, isSticky) {
16056        this.eventManager.freeze();
16057        for (var i = 0; i < eventInputs.length; i++) {
16058            this.renderEvent(eventInputs[i], isSticky);
16059        }
16060        this.eventManager.thaw();
16061    };
16062    Calendar.prototype.renderEvent = function (eventInput, isSticky) {
16063        if (isSticky === void 0) { isSticky = false; }
16064        var eventManager = this.eventManager;
16065        var eventDef = EventDefParser_1.default.parse(eventInput, eventInput.source || eventManager.stickySource);
16066        if (eventDef) {
16067            eventManager.addEventDef(eventDef, isSticky);
16068        }
16069    };
16070    // legacyQuery operates on legacy event instance objects
16071    Calendar.prototype.removeEvents = function (legacyQuery) {
16072        var eventManager = this.eventManager;
16073        var legacyInstances = [];
16074        var idMap = {};
16075        var eventDef;
16076        var i;
16077        if (legacyQuery == null) {
16078            eventManager.removeAllEventDefs(); // persist=true
16079        }
16080        else {
16081            eventManager.getEventInstances().forEach(function (eventInstance) {
16082                legacyInstances.push(eventInstance.toLegacy());
16083            });
16084            legacyInstances = filterLegacyEventInstances(legacyInstances, legacyQuery);
16085            // compute unique IDs
16086            for (i = 0; i < legacyInstances.length; i++) {
16087                eventDef = this.eventManager.getEventDefByUid(legacyInstances[i]._id);
16088                idMap[eventDef.id] = true;
16089            }
16090            eventManager.freeze();
16091            for (i in idMap) {
16092                eventManager.removeEventDefsById(i); // persist=true
16093            }
16094            eventManager.thaw();
16095        }
16096    };
16097    // legacyQuery operates on legacy event instance objects
16098    Calendar.prototype.clientEvents = function (legacyQuery) {
16099        var legacyEventInstances = [];
16100        this.eventManager.getEventInstances().forEach(function (eventInstance) {
16101            legacyEventInstances.push(eventInstance.toLegacy());
16102        });
16103        return filterLegacyEventInstances(legacyEventInstances, legacyQuery);
16104    };
16105    Calendar.prototype.updateEvents = function (eventPropsArray) {
16106        this.eventManager.freeze();
16107        for (var i = 0; i < eventPropsArray.length; i++) {
16108            this.updateEvent(eventPropsArray[i]);
16109        }
16110        this.eventManager.thaw();
16111    };
16112    Calendar.prototype.updateEvent = function (eventProps) {
16113        var eventDef = this.eventManager.getEventDefByUid(eventProps._id);
16114        var eventInstance;
16115        var eventDefMutation;
16116        if (eventDef instanceof SingleEventDef_1.default) {
16117            eventInstance = eventDef.buildInstance();
16118            eventDefMutation = EventDefMutation_1.default.createFromRawProps(eventInstance, eventProps, // raw props
16119            null // largeUnit -- who uses it?
16120            );
16121            this.eventManager.mutateEventsWithId(eventDef.id, eventDefMutation); // will release
16122        }
16123    };
16124    // Public Event Sources API
16125    // ------------------------------------------------------------------------------------
16126    Calendar.prototype.getEventSources = function () {
16127        return this.eventManager.otherSources.slice(); // clone
16128    };
16129    Calendar.prototype.getEventSourceById = function (id) {
16130        return this.eventManager.getSourceById(EventSource_1.default.normalizeId(id));
16131    };
16132    Calendar.prototype.addEventSource = function (sourceInput) {
16133        var source = EventSourceParser_1.default.parse(sourceInput, this);
16134        if (source) {
16135            this.eventManager.addSource(source);
16136        }
16137    };
16138    Calendar.prototype.removeEventSources = function (sourceMultiQuery) {
16139        var eventManager = this.eventManager;
16140        var sources;
16141        var i;
16142        if (sourceMultiQuery == null) {
16143            this.eventManager.removeAllSources();
16144        }
16145        else {
16146            sources = eventManager.multiQuerySources(sourceMultiQuery);
16147            eventManager.freeze();
16148            for (i = 0; i < sources.length; i++) {
16149                eventManager.removeSource(sources[i]);
16150            }
16151            eventManager.thaw();
16152        }
16153    };
16154    Calendar.prototype.removeEventSource = function (sourceQuery) {
16155        var eventManager = this.eventManager;
16156        var sources = eventManager.querySources(sourceQuery);
16157        var i;
16158        eventManager.freeze();
16159        for (i = 0; i < sources.length; i++) {
16160            eventManager.removeSource(sources[i]);
16161        }
16162        eventManager.thaw();
16163    };
16164    Calendar.prototype.refetchEventSources = function (sourceMultiQuery) {
16165        var eventManager = this.eventManager;
16166        var sources = eventManager.multiQuerySources(sourceMultiQuery);
16167        var i;
16168        eventManager.freeze();
16169        for (i = 0; i < sources.length; i++) {
16170            eventManager.refetchSource(sources[i]);
16171        }
16172        eventManager.thaw();
16173    };
16174    // not for internal use. use options module directly instead.
16175    Calendar.defaults = options_1.globalDefaults;
16176    Calendar.englishDefaults = options_1.englishDefaults;
16177    Calendar.rtlDefaults = options_1.rtlDefaults;
16178    return Calendar;
16179}());
16180exports.default = Calendar;
16181EmitterMixin_1.default.mixInto(Calendar);
16182ListenerMixin_1.default.mixInto(Calendar);
16183function filterLegacyEventInstances(legacyEventInstances, legacyQuery) {
16184    if (legacyQuery == null) {
16185        return legacyEventInstances;
16186    }
16187    else if ($.isFunction(legacyQuery)) {
16188        return legacyEventInstances.filter(legacyQuery);
16189    }
16190    else {
16191        legacyQuery += ''; // normalize to string
16192        return legacyEventInstances.filter(function (legacyEventInstance) {
16193            // soft comparison because id not be normalized to string
16194            // tslint:disable-next-line
16195            return legacyEventInstance.id == legacyQuery ||
16196                legacyEventInstance._id === legacyQuery; // can specify internal id, but must exactly match
16197        });
16198    }
16199}
16200
16201
16202/***/ }),
16203/* 221 */
16204/***/ (function(module, exports, __webpack_require__) {
16205
16206Object.defineProperty(exports, "__esModule", { value: true });
16207var moment = __webpack_require__(0);
16208var util_1 = __webpack_require__(4);
16209var UnzonedRange_1 = __webpack_require__(5);
16210var DateProfileGenerator = /** @class */ (function () {
16211    function DateProfileGenerator(_view) {
16212        this._view = _view;
16213    }
16214    DateProfileGenerator.prototype.opt = function (name) {
16215        return this._view.opt(name);
16216    };
16217    DateProfileGenerator.prototype.trimHiddenDays = function (unzonedRange) {
16218        return this._view.trimHiddenDays(unzonedRange);
16219    };
16220    DateProfileGenerator.prototype.msToUtcMoment = function (ms, forceAllDay) {
16221        return this._view.calendar.msToUtcMoment(ms, forceAllDay);
16222    };
16223    /* Date Range Computation
16224    ------------------------------------------------------------------------------------------------------------------*/
16225    // Builds a structure with info about what the dates/ranges will be for the "prev" view.
16226    DateProfileGenerator.prototype.buildPrev = function (currentDateProfile) {
16227        var prevDate = currentDateProfile.date.clone()
16228            .startOf(currentDateProfile.currentRangeUnit)
16229            .subtract(currentDateProfile.dateIncrement);
16230        return this.build(prevDate, -1);
16231    };
16232    // Builds a structure with info about what the dates/ranges will be for the "next" view.
16233    DateProfileGenerator.prototype.buildNext = function (currentDateProfile) {
16234        var nextDate = currentDateProfile.date.clone()
16235            .startOf(currentDateProfile.currentRangeUnit)
16236            .add(currentDateProfile.dateIncrement);
16237        return this.build(nextDate, 1);
16238    };
16239    // Builds a structure holding dates/ranges for rendering around the given date.
16240    // Optional direction param indicates whether the date is being incremented/decremented
16241    // from its previous value. decremented = -1, incremented = 1 (default).
16242    DateProfileGenerator.prototype.build = function (date, direction, forceToValid) {
16243        if (forceToValid === void 0) { forceToValid = false; }
16244        var isDateAllDay = !date.hasTime();
16245        var validUnzonedRange;
16246        var minTime = null;
16247        var maxTime = null;
16248        var currentInfo;
16249        var isRangeAllDay;
16250        var renderUnzonedRange;
16251        var activeUnzonedRange;
16252        var isValid;
16253        validUnzonedRange = this.buildValidRange();
16254        validUnzonedRange = this.trimHiddenDays(validUnzonedRange);
16255        if (forceToValid) {
16256            date = this.msToUtcMoment(validUnzonedRange.constrainDate(date), // returns MS
16257            isDateAllDay);
16258        }
16259        currentInfo = this.buildCurrentRangeInfo(date, direction);
16260        isRangeAllDay = /^(year|month|week|day)$/.test(currentInfo.unit);
16261        renderUnzonedRange = this.buildRenderRange(this.trimHiddenDays(currentInfo.unzonedRange), currentInfo.unit, isRangeAllDay);
16262        renderUnzonedRange = this.trimHiddenDays(renderUnzonedRange);
16263        activeUnzonedRange = renderUnzonedRange.clone();
16264        if (!this.opt('showNonCurrentDates')) {
16265            activeUnzonedRange = activeUnzonedRange.intersect(currentInfo.unzonedRange);
16266        }
16267        minTime = moment.duration(this.opt('minTime'));
16268        maxTime = moment.duration(this.opt('maxTime'));
16269        activeUnzonedRange = this.adjustActiveRange(activeUnzonedRange, minTime, maxTime);
16270        activeUnzonedRange = activeUnzonedRange.intersect(validUnzonedRange); // might return null
16271        if (activeUnzonedRange) {
16272            date = this.msToUtcMoment(activeUnzonedRange.constrainDate(date), // returns MS
16273            isDateAllDay);
16274        }
16275        // it's invalid if the originally requested date is not contained,
16276        // or if the range is completely outside of the valid range.
16277        isValid = currentInfo.unzonedRange.intersectsWith(validUnzonedRange);
16278        return {
16279            // constraint for where prev/next operations can go and where events can be dragged/resized to.
16280            // an object with optional start and end properties.
16281            validUnzonedRange: validUnzonedRange,
16282            // range the view is formally responsible for.
16283            // for example, a month view might have 1st-31st, excluding padded dates
16284            currentUnzonedRange: currentInfo.unzonedRange,
16285            // name of largest unit being displayed, like "month" or "week"
16286            currentRangeUnit: currentInfo.unit,
16287            isRangeAllDay: isRangeAllDay,
16288            // dates that display events and accept drag-n-drop
16289            // will be `null` if no dates accept events
16290            activeUnzonedRange: activeUnzonedRange,
16291            // date range with a rendered skeleton
16292            // includes not-active days that need some sort of DOM
16293            renderUnzonedRange: renderUnzonedRange,
16294            // Duration object that denotes the first visible time of any given day
16295            minTime: minTime,
16296            // Duration object that denotes the exclusive visible end time of any given day
16297            maxTime: maxTime,
16298            isValid: isValid,
16299            date: date,
16300            // how far the current date will move for a prev/next operation
16301            dateIncrement: this.buildDateIncrement(currentInfo.duration)
16302            // pass a fallback (might be null) ^
16303        };
16304    };
16305    // Builds an object with optional start/end properties.
16306    // Indicates the minimum/maximum dates to display.
16307    // not responsible for trimming hidden days.
16308    DateProfileGenerator.prototype.buildValidRange = function () {
16309        return this._view.getUnzonedRangeOption('validRange', this._view.calendar.getNow()) ||
16310            new UnzonedRange_1.default(); // completely open-ended
16311    };
16312    // Builds a structure with info about the "current" range, the range that is
16313    // highlighted as being the current month for example.
16314    // See build() for a description of `direction`.
16315    // Guaranteed to have `range` and `unit` properties. `duration` is optional.
16316    // TODO: accept a MS-time instead of a moment `date`?
16317    DateProfileGenerator.prototype.buildCurrentRangeInfo = function (date, direction) {
16318        var viewSpec = this._view.viewSpec;
16319        var duration = null;
16320        var unit = null;
16321        var unzonedRange = null;
16322        var dayCount;
16323        if (viewSpec.duration) {
16324            duration = viewSpec.duration;
16325            unit = viewSpec.durationUnit;
16326            unzonedRange = this.buildRangeFromDuration(date, direction, duration, unit);
16327        }
16328        else if ((dayCount = this.opt('dayCount'))) {
16329            unit = 'day';
16330            unzonedRange = this.buildRangeFromDayCount(date, direction, dayCount);
16331        }
16332        else if ((unzonedRange = this.buildCustomVisibleRange(date))) {
16333            unit = util_1.computeGreatestUnit(unzonedRange.getStart(), unzonedRange.getEnd());
16334        }
16335        else {
16336            duration = this.getFallbackDuration();
16337            unit = util_1.computeGreatestUnit(duration);
16338            unzonedRange = this.buildRangeFromDuration(date, direction, duration, unit);
16339        }
16340        return { duration: duration, unit: unit, unzonedRange: unzonedRange };
16341    };
16342    DateProfileGenerator.prototype.getFallbackDuration = function () {
16343        return moment.duration({ days: 1 });
16344    };
16345    // Returns a new activeUnzonedRange to have time values (un-ambiguate)
16346    // minTime or maxTime causes the range to expand.
16347    DateProfileGenerator.prototype.adjustActiveRange = function (unzonedRange, minTime, maxTime) {
16348        var start = unzonedRange.getStart();
16349        var end = unzonedRange.getEnd();
16350        if (this._view.usesMinMaxTime) {
16351            if (minTime < 0) {
16352                start.time(0).add(minTime);
16353            }
16354            if (maxTime > 24 * 60 * 60 * 1000) {
16355                end.time(maxTime - (24 * 60 * 60 * 1000));
16356            }
16357        }
16358        return new UnzonedRange_1.default(start, end);
16359    };
16360    // Builds the "current" range when it is specified as an explicit duration.
16361    // `unit` is the already-computed computeGreatestUnit value of duration.
16362    // TODO: accept a MS-time instead of a moment `date`?
16363    DateProfileGenerator.prototype.buildRangeFromDuration = function (date, direction, duration, unit) {
16364        var alignment = this.opt('dateAlignment');
16365        var dateIncrementInput;
16366        var dateIncrementDuration;
16367        var start;
16368        var end;
16369        var res;
16370        // compute what the alignment should be
16371        if (!alignment) {
16372            dateIncrementInput = this.opt('dateIncrement');
16373            if (dateIncrementInput) {
16374                dateIncrementDuration = moment.duration(dateIncrementInput);
16375                // use the smaller of the two units
16376                if (dateIncrementDuration < duration) {
16377                    alignment = util_1.computeDurationGreatestUnit(dateIncrementDuration, dateIncrementInput);
16378                }
16379                else {
16380                    alignment = unit;
16381                }
16382            }
16383            else {
16384                alignment = unit;
16385            }
16386        }
16387        // if the view displays a single day or smaller
16388        if (duration.as('days') <= 1) {
16389            if (this._view.isHiddenDay(start)) {
16390                start = this._view.skipHiddenDays(start, direction);
16391                start.startOf('day');
16392            }
16393        }
16394        function computeRes() {
16395            start = date.clone().startOf(alignment);
16396            end = start.clone().add(duration);
16397            res = new UnzonedRange_1.default(start, end);
16398        }
16399        computeRes();
16400        // if range is completely enveloped by hidden days, go past the hidden days
16401        if (!this.trimHiddenDays(res)) {
16402            date = this._view.skipHiddenDays(date, direction);
16403            computeRes();
16404        }
16405        return res;
16406    };
16407    // Builds the "current" range when a dayCount is specified.
16408    // TODO: accept a MS-time instead of a moment `date`?
16409    DateProfileGenerator.prototype.buildRangeFromDayCount = function (date, direction, dayCount) {
16410        var customAlignment = this.opt('dateAlignment');
16411        var runningCount = 0;
16412        var start = date.clone();
16413        var end;
16414        if (customAlignment) {
16415            start.startOf(customAlignment);
16416        }
16417        start.startOf('day');
16418        start = this._view.skipHiddenDays(start, direction);
16419        end = start.clone();
16420        do {
16421            end.add(1, 'day');
16422            if (!this._view.isHiddenDay(end)) {
16423                runningCount++;
16424            }
16425        } while (runningCount < dayCount);
16426        return new UnzonedRange_1.default(start, end);
16427    };
16428    // Builds a normalized range object for the "visible" range,
16429    // which is a way to define the currentUnzonedRange and activeUnzonedRange at the same time.
16430    // TODO: accept a MS-time instead of a moment `date`?
16431    DateProfileGenerator.prototype.buildCustomVisibleRange = function (date) {
16432        var visibleUnzonedRange = this._view.getUnzonedRangeOption('visibleRange', this._view.calendar.applyTimezone(date) // correct zone. also generates new obj that avoids mutations
16433        );
16434        if (visibleUnzonedRange && (visibleUnzonedRange.startMs == null || visibleUnzonedRange.endMs == null)) {
16435            return null;
16436        }
16437        return visibleUnzonedRange;
16438    };
16439    // Computes the range that will represent the element/cells for *rendering*,
16440    // but which may have voided days/times.
16441    // not responsible for trimming hidden days.
16442    DateProfileGenerator.prototype.buildRenderRange = function (currentUnzonedRange, currentRangeUnit, isRangeAllDay) {
16443        return currentUnzonedRange.clone();
16444    };
16445    // Compute the duration value that should be added/substracted to the current date
16446    // when a prev/next operation happens.
16447    DateProfileGenerator.prototype.buildDateIncrement = function (fallback) {
16448        var dateIncrementInput = this.opt('dateIncrement');
16449        var customAlignment;
16450        if (dateIncrementInput) {
16451            return moment.duration(dateIncrementInput);
16452        }
16453        else if ((customAlignment = this.opt('dateAlignment'))) {
16454            return moment.duration(1, customAlignment);
16455        }
16456        else if (fallback) {
16457            return fallback;
16458        }
16459        else {
16460            return moment.duration({ days: 1 });
16461        }
16462    };
16463    return DateProfileGenerator;
16464}());
16465exports.default = DateProfileGenerator;
16466
16467
16468/***/ }),
16469/* 222 */
16470/***/ (function(module, exports, __webpack_require__) {
16471
16472Object.defineProperty(exports, "__esModule", { value: true });
16473var tslib_1 = __webpack_require__(2);
16474var $ = __webpack_require__(3);
16475var moment = __webpack_require__(0);
16476var exportHooks = __webpack_require__(17);
16477var util_1 = __webpack_require__(4);
16478var moment_ext_1 = __webpack_require__(10);
16479var ListenerMixin_1 = __webpack_require__(7);
16480var HitDragListener_1 = __webpack_require__(22);
16481var SingleEventDef_1 = __webpack_require__(13);
16482var EventInstanceGroup_1 = __webpack_require__(19);
16483var EventSource_1 = __webpack_require__(6);
16484var Interaction_1 = __webpack_require__(16);
16485var ExternalDropping = /** @class */ (function (_super) {
16486    tslib_1.__extends(ExternalDropping, _super);
16487    function ExternalDropping() {
16488        var _this = _super !== null && _super.apply(this, arguments) || this;
16489        _this.isDragging = false; // jqui-dragging an external element? boolean
16490        return _this;
16491    }
16492    /*
16493    component impements:
16494      - eventRangesToEventFootprints
16495      - isEventInstanceGroupAllowed
16496      - isExternalInstanceGroupAllowed
16497      - renderDrag
16498      - unrenderDrag
16499    */
16500    ExternalDropping.prototype.end = function () {
16501        if (this.dragListener) {
16502            this.dragListener.endInteraction();
16503        }
16504    };
16505    ExternalDropping.prototype.bindToDocument = function () {
16506        this.listenTo($(document), {
16507            dragstart: this.handleDragStart,
16508            sortstart: this.handleDragStart // jqui
16509        });
16510    };
16511    ExternalDropping.prototype.unbindFromDocument = function () {
16512        this.stopListeningTo($(document));
16513    };
16514    // Called when a jQuery UI drag is initiated anywhere in the DOM
16515    ExternalDropping.prototype.handleDragStart = function (ev, ui) {
16516        var el;
16517        var accept;
16518        if (this.opt('droppable')) {
16519            el = $((ui ? ui.item : null) || ev.target);
16520            // Test that the dragged element passes the dropAccept selector or filter function.
16521            // FYI, the default is "*" (matches all)
16522            accept = this.opt('dropAccept');
16523            if ($.isFunction(accept) ? accept.call(el[0], el) : el.is(accept)) {
16524                if (!this.isDragging) {
16525                    this.listenToExternalDrag(el, ev, ui);
16526                }
16527            }
16528        }
16529    };
16530    // Called when a jQuery UI drag starts and it needs to be monitored for dropping
16531    ExternalDropping.prototype.listenToExternalDrag = function (el, ev, ui) {
16532        var _this = this;
16533        var component = this.component;
16534        var view = this.view;
16535        var meta = getDraggedElMeta(el); // extra data about event drop, including possible event to create
16536        var singleEventDef; // a null value signals an unsuccessful drag
16537        // listener that tracks mouse movement over date-associated pixel regions
16538        var dragListener = this.dragListener = new HitDragListener_1.default(component, {
16539            interactionStart: function () {
16540                _this.isDragging = true;
16541            },
16542            hitOver: function (hit) {
16543                var isAllowed = true;
16544                var hitFootprint = hit.component.getSafeHitFootprint(hit); // hit might not belong to this grid
16545                var mutatedEventInstanceGroup;
16546                if (hitFootprint) {
16547                    singleEventDef = _this.computeExternalDrop(hitFootprint, meta);
16548                    if (singleEventDef) {
16549                        mutatedEventInstanceGroup = new EventInstanceGroup_1.default(singleEventDef.buildInstances());
16550                        isAllowed = meta.eventProps ? // isEvent?
16551                            component.isEventInstanceGroupAllowed(mutatedEventInstanceGroup) :
16552                            component.isExternalInstanceGroupAllowed(mutatedEventInstanceGroup);
16553                    }
16554                    else {
16555                        isAllowed = false;
16556                    }
16557                }
16558                else {
16559                    isAllowed = false;
16560                }
16561                if (!isAllowed) {
16562                    singleEventDef = null;
16563                    util_1.disableCursor();
16564                }
16565                if (singleEventDef) {
16566                    component.renderDrag(// called without a seg parameter
16567                    component.eventRangesToEventFootprints(mutatedEventInstanceGroup.sliceRenderRanges(component.dateProfile.renderUnzonedRange, view.calendar)));
16568                }
16569            },
16570            hitOut: function () {
16571                singleEventDef = null; // signal unsuccessful
16572            },
16573            hitDone: function () {
16574                util_1.enableCursor();
16575                component.unrenderDrag();
16576            },
16577            interactionEnd: function (ev) {
16578                if (singleEventDef) {
16579                    view.reportExternalDrop(singleEventDef, Boolean(meta.eventProps), // isEvent
16580                    Boolean(meta.stick), // isSticky
16581                    el, ev, ui);
16582                }
16583                _this.isDragging = false;
16584                _this.dragListener = null;
16585            }
16586        });
16587        dragListener.startDrag(ev); // start listening immediately
16588    };
16589    // Given a hit to be dropped upon, and misc data associated with the jqui drag (guaranteed to be a plain object),
16590    // returns the zoned start/end dates for the event that would result from the hypothetical drop. end might be null.
16591    // Returning a null value signals an invalid drop hit.
16592    // DOES NOT consider overlap/constraint.
16593    // Assumes both footprints are non-open-ended.
16594    ExternalDropping.prototype.computeExternalDrop = function (componentFootprint, meta) {
16595        var calendar = this.view.calendar;
16596        var start = moment_ext_1.default.utc(componentFootprint.unzonedRange.startMs).stripZone();
16597        var end;
16598        var eventDef;
16599        if (componentFootprint.isAllDay) {
16600            // if dropped on an all-day span, and element's metadata specified a time, set it
16601            if (meta.startTime) {
16602                start.time(meta.startTime);
16603            }
16604            else {
16605                start.stripTime();
16606            }
16607        }
16608        if (meta.duration) {
16609            end = start.clone().add(meta.duration);
16610        }
16611        start = calendar.applyTimezone(start);
16612        if (end) {
16613            end = calendar.applyTimezone(end);
16614        }
16615        eventDef = SingleEventDef_1.default.parse($.extend({}, meta.eventProps, {
16616            start: start,
16617            end: end
16618        }), new EventSource_1.default(calendar));
16619        return eventDef;
16620    };
16621    return ExternalDropping;
16622}(Interaction_1.default));
16623exports.default = ExternalDropping;
16624ListenerMixin_1.default.mixInto(ExternalDropping);
16625/* External-Dragging-Element Data
16626----------------------------------------------------------------------------------------------------------------------*/
16627// Require all HTML5 data-* attributes used by FullCalendar to have this prefix.
16628// A value of '' will query attributes like data-event. A value of 'fc' will query attributes like data-fc-event.
16629exportHooks.dataAttrPrefix = '';
16630// Given a jQuery element that might represent a dragged FullCalendar event, returns an intermediate data structure
16631// to be used for Event Object creation.
16632// A defined `.eventProps`, even when empty, indicates that an event should be created.
16633function getDraggedElMeta(el) {
16634    var prefix = exportHooks.dataAttrPrefix;
16635    var eventProps; // properties for creating the event, not related to date/time
16636    var startTime; // a Duration
16637    var duration;
16638    var stick;
16639    if (prefix) {
16640        prefix += '-';
16641    }
16642    eventProps = el.data(prefix + 'event') || null;
16643    if (eventProps) {
16644        if (typeof eventProps === 'object') {
16645            eventProps = $.extend({}, eventProps); // make a copy
16646        }
16647        else {
16648            eventProps = {};
16649        }
16650        // pluck special-cased date/time properties
16651        startTime = eventProps.start;
16652        if (startTime == null) {
16653            startTime = eventProps.time;
16654        } // accept 'time' as well
16655        duration = eventProps.duration;
16656        stick = eventProps.stick;
16657        delete eventProps.start;
16658        delete eventProps.time;
16659        delete eventProps.duration;
16660        delete eventProps.stick;
16661    }
16662    // fallback to standalone attribute values for each of the date/time properties
16663    if (startTime == null) {
16664        startTime = el.data(prefix + 'start');
16665    }
16666    if (startTime == null) {
16667        startTime = el.data(prefix + 'time');
16668    } // accept 'time' as well
16669    if (duration == null) {
16670        duration = el.data(prefix + 'duration');
16671    }
16672    if (stick == null) {
16673        stick = el.data(prefix + 'stick');
16674    }
16675    // massage into correct data types
16676    startTime = startTime != null ? moment.duration(startTime) : null;
16677    duration = duration != null ? moment.duration(duration) : null;
16678    stick = Boolean(stick);
16679    return { eventProps: eventProps, startTime: startTime, duration: duration, stick: stick };
16680}
16681
16682
16683/***/ }),
16684/* 223 */
16685/***/ (function(module, exports, __webpack_require__) {
16686
16687Object.defineProperty(exports, "__esModule", { value: true });
16688var tslib_1 = __webpack_require__(2);
16689var $ = __webpack_require__(3);
16690var util_1 = __webpack_require__(4);
16691var EventDefMutation_1 = __webpack_require__(36);
16692var EventDefDateMutation_1 = __webpack_require__(50);
16693var HitDragListener_1 = __webpack_require__(22);
16694var Interaction_1 = __webpack_require__(16);
16695var EventResizing = /** @class */ (function (_super) {
16696    tslib_1.__extends(EventResizing, _super);
16697    /*
16698    component impements:
16699      - bindSegHandlerToEl
16700      - publiclyTrigger
16701      - diffDates
16702      - eventRangesToEventFootprints
16703      - isEventInstanceGroupAllowed
16704      - getSafeHitFootprint
16705    */
16706    function EventResizing(component, eventPointing) {
16707        var _this = _super.call(this, component) || this;
16708        _this.isResizing = false;
16709        _this.eventPointing = eventPointing;
16710        return _this;
16711    }
16712    EventResizing.prototype.end = function () {
16713        if (this.dragListener) {
16714            this.dragListener.endInteraction();
16715        }
16716    };
16717    EventResizing.prototype.bindToEl = function (el) {
16718        var component = this.component;
16719        component.bindSegHandlerToEl(el, 'mousedown', this.handleMouseDown.bind(this));
16720        component.bindSegHandlerToEl(el, 'touchstart', this.handleTouchStart.bind(this));
16721    };
16722    EventResizing.prototype.handleMouseDown = function (seg, ev) {
16723        if (this.component.canStartResize(seg, ev)) {
16724            this.buildDragListener(seg, $(ev.target).is('.fc-start-resizer'))
16725                .startInteraction(ev, { distance: 5 });
16726        }
16727    };
16728    EventResizing.prototype.handleTouchStart = function (seg, ev) {
16729        if (this.component.canStartResize(seg, ev)) {
16730            this.buildDragListener(seg, $(ev.target).is('.fc-start-resizer'))
16731                .startInteraction(ev);
16732        }
16733    };
16734    // Creates a listener that tracks the user as they resize an event segment.
16735    // Generic enough to work with any type of Grid.
16736    EventResizing.prototype.buildDragListener = function (seg, isStart) {
16737        var _this = this;
16738        var component = this.component;
16739        var view = this.view;
16740        var calendar = view.calendar;
16741        var eventManager = calendar.eventManager;
16742        var el = seg.el;
16743        var eventDef = seg.footprint.eventDef;
16744        var eventInstance = seg.footprint.eventInstance;
16745        var isDragging;
16746        var resizeMutation; // zoned event date properties. falsy if invalid resize
16747        // Tracks mouse movement over the *grid's* coordinate map
16748        var dragListener = this.dragListener = new HitDragListener_1.default(component, {
16749            scroll: this.opt('dragScroll'),
16750            subjectEl: el,
16751            interactionStart: function () {
16752                isDragging = false;
16753            },
16754            dragStart: function (ev) {
16755                isDragging = true;
16756                // ensure a mouseout on the manipulated event has been reported
16757                _this.eventPointing.handleMouseout(seg, ev);
16758                _this.segResizeStart(seg, ev);
16759            },
16760            hitOver: function (hit, isOrig, origHit) {
16761                var isAllowed = true;
16762                var origHitFootprint = component.getSafeHitFootprint(origHit);
16763                var hitFootprint = component.getSafeHitFootprint(hit);
16764                var mutatedEventInstanceGroup;
16765                if (origHitFootprint && hitFootprint) {
16766                    resizeMutation = isStart ?
16767                        _this.computeEventStartResizeMutation(origHitFootprint, hitFootprint, seg.footprint) :
16768                        _this.computeEventEndResizeMutation(origHitFootprint, hitFootprint, seg.footprint);
16769                    if (resizeMutation) {
16770                        mutatedEventInstanceGroup = eventManager.buildMutatedEventInstanceGroup(eventDef.id, resizeMutation);
16771                        isAllowed = component.isEventInstanceGroupAllowed(mutatedEventInstanceGroup);
16772                    }
16773                    else {
16774                        isAllowed = false;
16775                    }
16776                }
16777                else {
16778                    isAllowed = false;
16779                }
16780                if (!isAllowed) {
16781                    resizeMutation = null;
16782                    util_1.disableCursor();
16783                }
16784                else if (resizeMutation.isEmpty()) {
16785                    // no change. (FYI, event dates might have zones)
16786                    resizeMutation = null;
16787                }
16788                if (resizeMutation) {
16789                    view.hideEventsWithId(seg.footprint.eventDef.id);
16790                    view.renderEventResize(component.eventRangesToEventFootprints(mutatedEventInstanceGroup.sliceRenderRanges(component.dateProfile.renderUnzonedRange, calendar)), seg);
16791                }
16792            },
16793            hitOut: function () {
16794                resizeMutation = null;
16795            },
16796            hitDone: function () {
16797                view.unrenderEventResize(seg);
16798                view.showEventsWithId(seg.footprint.eventDef.id);
16799                util_1.enableCursor();
16800            },
16801            interactionEnd: function (ev) {
16802                if (isDragging) {
16803                    _this.segResizeStop(seg, ev);
16804                }
16805                if (resizeMutation) {
16806                    // no need to re-show original, will rerender all anyways. esp important if eventRenderWait
16807                    view.reportEventResize(eventInstance, resizeMutation, el, ev);
16808                }
16809                _this.dragListener = null;
16810            }
16811        });
16812        return dragListener;
16813    };
16814    // Called before event segment resizing starts
16815    EventResizing.prototype.segResizeStart = function (seg, ev) {
16816        this.isResizing = true;
16817        this.component.publiclyTrigger('eventResizeStart', {
16818            context: seg.el[0],
16819            args: [
16820                seg.footprint.getEventLegacy(),
16821                ev,
16822                {},
16823                this.view
16824            ]
16825        });
16826    };
16827    // Called after event segment resizing stops
16828    EventResizing.prototype.segResizeStop = function (seg, ev) {
16829        this.isResizing = false;
16830        this.component.publiclyTrigger('eventResizeStop', {
16831            context: seg.el[0],
16832            args: [
16833                seg.footprint.getEventLegacy(),
16834                ev,
16835                {},
16836                this.view
16837            ]
16838        });
16839    };
16840    // Returns new date-information for an event segment being resized from its start
16841    EventResizing.prototype.computeEventStartResizeMutation = function (startFootprint, endFootprint, origEventFootprint) {
16842        var origRange = origEventFootprint.componentFootprint.unzonedRange;
16843        var startDelta = this.component.diffDates(endFootprint.unzonedRange.getStart(), startFootprint.unzonedRange.getStart());
16844        var dateMutation;
16845        var eventDefMutation;
16846        if (origRange.getStart().add(startDelta) < origRange.getEnd()) {
16847            dateMutation = new EventDefDateMutation_1.default();
16848            dateMutation.setStartDelta(startDelta);
16849            eventDefMutation = new EventDefMutation_1.default();
16850            eventDefMutation.setDateMutation(dateMutation);
16851            return eventDefMutation;
16852        }
16853        return false;
16854    };
16855    // Returns new date-information for an event segment being resized from its end
16856    EventResizing.prototype.computeEventEndResizeMutation = function (startFootprint, endFootprint, origEventFootprint) {
16857        var origRange = origEventFootprint.componentFootprint.unzonedRange;
16858        var endDelta = this.component.diffDates(endFootprint.unzonedRange.getEnd(), startFootprint.unzonedRange.getEnd());
16859        var dateMutation;
16860        var eventDefMutation;
16861        if (origRange.getEnd().add(endDelta) > origRange.getStart()) {
16862            dateMutation = new EventDefDateMutation_1.default();
16863            dateMutation.setEndDelta(endDelta);
16864            eventDefMutation = new EventDefMutation_1.default();
16865            eventDefMutation.setDateMutation(dateMutation);
16866            return eventDefMutation;
16867        }
16868        return false;
16869    };
16870    return EventResizing;
16871}(Interaction_1.default));
16872exports.default = EventResizing;
16873
16874
16875/***/ }),
16876/* 224 */
16877/***/ (function(module, exports, __webpack_require__) {
16878
16879Object.defineProperty(exports, "__esModule", { value: true });
16880var tslib_1 = __webpack_require__(2);
16881var util_1 = __webpack_require__(4);
16882var EventDefMutation_1 = __webpack_require__(36);
16883var EventDefDateMutation_1 = __webpack_require__(50);
16884var DragListener_1 = __webpack_require__(54);
16885var HitDragListener_1 = __webpack_require__(22);
16886var MouseFollower_1 = __webpack_require__(244);
16887var GlobalEmitter_1 = __webpack_require__(15);
16888var Interaction_1 = __webpack_require__(16);
16889var EventDragging = /** @class */ (function (_super) {
16890    tslib_1.__extends(EventDragging, _super);
16891    /*
16892    component implements:
16893      - bindSegHandlerToEl
16894      - publiclyTrigger
16895      - diffDates
16896      - eventRangesToEventFootprints
16897      - isEventInstanceGroupAllowed
16898    */
16899    function EventDragging(component, eventPointing) {
16900        var _this = _super.call(this, component) || this;
16901        _this.isDragging = false;
16902        _this.eventPointing = eventPointing;
16903        return _this;
16904    }
16905    EventDragging.prototype.end = function () {
16906        if (this.dragListener) {
16907            this.dragListener.endInteraction();
16908        }
16909    };
16910    EventDragging.prototype.getSelectionDelay = function () {
16911        var delay = this.opt('eventLongPressDelay');
16912        if (delay == null) {
16913            delay = this.opt('longPressDelay'); // fallback
16914        }
16915        return delay;
16916    };
16917    EventDragging.prototype.bindToEl = function (el) {
16918        var component = this.component;
16919        component.bindSegHandlerToEl(el, 'mousedown', this.handleMousedown.bind(this));
16920        component.bindSegHandlerToEl(el, 'touchstart', this.handleTouchStart.bind(this));
16921    };
16922    EventDragging.prototype.handleMousedown = function (seg, ev) {
16923        if (!GlobalEmitter_1.default.get().shouldIgnoreMouse() && // TODO: move to a deeper level
16924            this.component.canStartDrag(seg, ev)) {
16925            this.buildDragListener(seg).startInteraction(ev, { distance: 5 });
16926        }
16927    };
16928    EventDragging.prototype.handleTouchStart = function (seg, ev) {
16929        var component = this.component;
16930        var settings = {
16931            delay: this.view.isEventDefSelected(seg.footprint.eventDef) ? // already selected?
16932                0 : this.getSelectionDelay()
16933        };
16934        if (!GlobalEmitter_1.default.get().shouldIgnoreMouse()) {
16935            if (component.canStartDrag(seg, ev)) {
16936                this.buildDragListener(seg).startInteraction(ev, settings);
16937            }
16938            else if (component.canStartSelection(seg, ev)) {
16939                this.buildSelectListener(seg).startInteraction(ev, settings);
16940            }
16941        }
16942    };
16943    // seg isn't draggable, but let's use a generic DragListener
16944    // simply for the delay, so it can be selected.
16945    // Has side effect of setting/unsetting `dragListener`
16946    EventDragging.prototype.buildSelectListener = function (seg) {
16947        var _this = this;
16948        var view = this.view;
16949        var eventDef = seg.footprint.eventDef;
16950        var eventInstance = seg.footprint.eventInstance; // null for inverse-background events
16951        if (this.dragListener) {
16952            return this.dragListener;
16953        }
16954        var dragListener = this.dragListener = new DragListener_1.default({
16955            dragStart: function (ev) {
16956                if (dragListener.isTouch &&
16957                    !view.isEventDefSelected(eventDef) &&
16958                    eventInstance) {
16959                    // if not previously selected, will fire after a delay. then, select the event
16960                    view.selectEventInstance(eventInstance);
16961                }
16962            },
16963            interactionEnd: function (ev) {
16964                _this.dragListener = null;
16965            }
16966        });
16967        return dragListener;
16968    };
16969    // Builds a listener that will track user-dragging on an event segment.
16970    // Generic enough to work with any type of Grid.
16971    // Has side effect of setting/unsetting `dragListener`
16972    EventDragging.prototype.buildDragListener = function (seg) {
16973        var _this = this;
16974        var component = this.component;
16975        var view = this.view;
16976        var calendar = view.calendar;
16977        var eventManager = calendar.eventManager;
16978        var el = seg.el;
16979        var eventDef = seg.footprint.eventDef;
16980        var eventInstance = seg.footprint.eventInstance; // null for inverse-background events
16981        var isDragging;
16982        var mouseFollower; // A clone of the original element that will move with the mouse
16983        var eventDefMutation;
16984        if (this.dragListener) {
16985            return this.dragListener;
16986        }
16987        // Tracks mouse movement over the *view's* coordinate map. Allows dragging and dropping between subcomponents
16988        // of the view.
16989        var dragListener = this.dragListener = new HitDragListener_1.default(view, {
16990            scroll: this.opt('dragScroll'),
16991            subjectEl: el,
16992            subjectCenter: true,
16993            interactionStart: function (ev) {
16994                seg.component = component; // for renderDrag
16995                isDragging = false;
16996                mouseFollower = new MouseFollower_1.default(seg.el, {
16997                    additionalClass: 'fc-dragging',
16998                    parentEl: view.el,
16999                    opacity: dragListener.isTouch ? null : _this.opt('dragOpacity'),
17000                    revertDuration: _this.opt('dragRevertDuration'),
17001                    zIndex: 2 // one above the .fc-view
17002                });
17003                mouseFollower.hide(); // don't show until we know this is a real drag
17004                mouseFollower.start(ev);
17005            },
17006            dragStart: function (ev) {
17007                if (dragListener.isTouch &&
17008                    !view.isEventDefSelected(eventDef) &&
17009                    eventInstance) {
17010                    // if not previously selected, will fire after a delay. then, select the event
17011                    view.selectEventInstance(eventInstance);
17012                }
17013                isDragging = true;
17014                // ensure a mouseout on the manipulated event has been reported
17015                _this.eventPointing.handleMouseout(seg, ev);
17016                _this.segDragStart(seg, ev);
17017                view.hideEventsWithId(seg.footprint.eventDef.id);
17018            },
17019            hitOver: function (hit, isOrig, origHit) {
17020                var isAllowed = true;
17021                var origFootprint;
17022                var footprint;
17023                var mutatedEventInstanceGroup;
17024                // starting hit could be forced (DayGrid.limit)
17025                if (seg.hit) {
17026                    origHit = seg.hit;
17027                }
17028                // hit might not belong to this grid, so query origin grid
17029                origFootprint = origHit.component.getSafeHitFootprint(
17029origHit);
17030                footprint = hit.component.getSafeHitFootprint(hit);
17031                if (origFootprint && footprint) {
17032                    eventDefMutation = _this.computeEventDropMutation(origFootprint, footprint, eventDef);
17033                    if (eventDefMutation) {
17034                        mutatedEventInstanceGroup = eventManager.buildMutatedEventInstanceGroup(eventDef.id, eventDefMutation);
17035                        isAllowed = component.isEventInstanceGroupAllowed(mutatedEventInstanceGroup);
17036                    }
17037                    else {
17038                        isAllowed = false;
17039                    }
17040                }
17041                else {
17042                    isAllowed = false;
17043                }
17044                if (!isAllowed) {
17045                    eventDefMutation = null;
17046                    util_1.disableCursor();
17047                }
17048                // if a valid drop location, have the subclass render a visual indication
17049                if (eventDefMutation &&
17050                    view.renderDrag(// truthy if rendered something
17051                    component.eventRangesToEventFootprints(mutatedEventInstanceGroup.sliceRenderRanges(component.dateProfile.renderUnzonedRange, calendar)), seg, dragListener.isTouch)) {
17052                    mouseFollower.hide(); // if the subclass is already using a mock event "helper", hide our own
17053                }
17054                else {
17055                    mouseFollower.show(); // otherwise, have the helper follow the mouse (no snapping)
17056                }
17057                if (isOrig) {
17058                    // needs to have moved hits to be a valid drop
17059                    eventDefMutation = null;
17060                }
17061            },
17062            hitOut: function () {
17063                view.unrenderDrag(seg); // unrender whatever was done in renderDrag
17064                mouseFollower.show(); // show in case we are moving out of all hits
17065                eventDefMutation = null;
17066            },
17067            hitDone: function () {
17068                util_1.enableCursor();
17069            },
17070            interactionEnd: function (ev) {
17071                delete seg.component; // prevent side effects
17072                // do revert animation if hasn't changed. calls a callback when finished (whether animation or not)
17073                mouseFollower.stop(!eventDefMutation, function () {
17074                    if (isDragging) {
17075                        view.unrenderDrag(seg);
17076                        _this.segDragStop(seg, ev);
17077                    }
17078                    view.showEventsWithId(seg.footprint.eventDef.id);
17079                    if (eventDefMutation) {
17080                        // no need to re-show original, will rerender all anyways. esp important if eventRenderWait
17081                        view.reportEventDrop(eventInstance, eventDefMutation, el, ev);
17082                    }
17083                });
17084                _this.dragListener = null;
17085            }
17086        });
17087        return dragListener;
17088    };
17089    // Called before event segment dragging starts
17090    EventDragging.prototype.segDragStart = function (seg, ev) {
17091        this.isDragging = true;
17092        this.component.publiclyTrigger('eventDragStart', {
17093            context: seg.el[0],
17094            args: [
17095                seg.footprint.getEventLegacy(),
17096                ev,
17097                {},
17098                this.view
17099            ]
17100        });
17101    };
17102    // Called after event segment dragging stops
17103    EventDragging.prototype.segDragStop = function (seg, ev) {
17104        this.isDragging = false;
17105        this.component.publiclyTrigger('eventDragStop', {
17106            context: seg.el[0],
17107            args: [
17108                seg.footprint.getEventLegacy(),
17109                ev,
17110                {},
17111                this.view
17112            ]
17113        });
17114    };
17115    // DOES NOT consider overlap/constraint
17116    EventDragging.prototype.computeEventDropMutation = function (startFootprint, endFootprint, eventDef) {
17117        var eventDefMutation = new EventDefMutation_1.default();
17118        eventDefMutation.setDateMutation(this.computeEventDateMutation(startFootprint, endFootprint));
17119        return eventDefMutation;
17120    };
17121    EventDragging.prototype.computeEventDateMutation = function (startFootprint, endFootprint) {
17122        var date0 = startFootprint.unzonedRange.getStart();
17123        var date1 = endFootprint.unzonedRange.getStart();
17124        var clearEnd = false;
17125        var forceTimed = false;
17126        var forceAllDay = false;
17127        var dateDelta;
17128        var dateMutation;
17129        if (startFootprint.isAllDay !== endFootprint.isAllDay) {
17130            clearEnd = true;
17131            if (endFootprint.isAllDay) {
17132                forceAllDay = true;
17133                date0.stripTime();
17134            }
17135            else {
17136                forceTimed = true;
17137            }
17138        }
17139        dateDelta = this.component.diffDates(date1, date0);
17140        dateMutation = new EventDefDateMutation_1.default();
17141        dateMutation.clearEnd = clearEnd;
17142        dateMutation.forceTimed = forceTimed;
17143        dateMutation.forceAllDay = forceAllDay;
17144        dateMutation.setDateDelta(dateDelta);
17145        return dateMutation;
17146    };
17147    return EventDragging;
17148}(Interaction_1.default));
17149exports.default = EventDragging;
17150
17151
17152/***/ }),
17153/* 225 */
17154/***/ (function(module, exports, __webpack_require__) {
17155
17156Object.defineProperty(exports, "__esModule", { value: true });
17157var tslib_1 = __webpack_require__(2);
17158var util_1 = __webpack_require__(4);
17159var HitDragListener_1 = __webpack_require__(22);
17160var ComponentFootprint_1 = __webpack_require__(12);
17161var UnzonedRange_1 = __webpack_require__(5);
17162var Interaction_1 = __webpack_require__(16);
17163var DateSelecting = /** @class */ (function (_super) {
17164    tslib_1.__extends(DateSelecting, _super);
17165    /*
17166    component must implement:
17167      - bindDateHandlerToEl
17168      - getSafeHitFootprint
17169      - renderHighlight
17170      - unrenderHighlight
17171    */
17172    function DateSelecting(component) {
17173        var _this = _super.call(this, component) || this;
17174        _this.dragListener = _this.buildDragListener();
17175        return _this;
17176    }
17177    DateSelecting.prototype.end = function () {
17178        this.dragListener.endInteraction();
17179    };
17180    DateSelecting.prototype.getDelay = function () {
17181        var delay = this.opt('selectLongPressDelay');
17182        if (delay == null) {
17183            delay = this.opt('longPressDelay'); // fallback
17184        }
17185        return delay;
17186    };
17187    DateSelecting.prototype.bindToEl = function (el) {
17188        var _this = this;
17189        var component = this.component;
17190        var dragListener = this.dragListener;
17191        component.bindDateHandlerToEl(el, 'mousedown', function (ev) {
17192            if (_this.opt('selectable') && !component.shouldIgnoreMouse()) {
17193                dragListener.startInteraction(ev, {
17194                    distance: _this.opt('selectMinDistance')
17195                });
17196            }
17197        });
17198        component.bindDateHandlerToEl(el, 'touchstart', function (ev) {
17199            if (_this.opt('selectable') && !component.shouldIgnoreTouch()) {
17200                dragListener.startInteraction(ev, {
17201                    delay: _this.getDelay()
17202                });
17203            }
17204        });
17205        util_1.preventSelection(el);
17206    };
17207    // Creates a listener that tracks the user's drag across day elements, for day selecting.
17208    DateSelecting.prototype.buildDragListener = function () {
17209        var _this = this;
17210        var component = this.component;
17211        var selectionFootprint; // null if invalid selection
17212        var dragListener = new HitDragListener_1.default(component, {
17213            scroll: this.opt('dragScroll'),
17214            interactionStart: function () {
17215                selectionFootprint = null;
17216            },
17217            dragStart: function (ev) {
17218                _this.view.unselect(ev); // since we could be rendering a new selection, we want to clear any old one
17219            },
17220            hitOver: function (hit, isOrig, origHit) {
17221                var origHitFootprint;
17222                var hitFootprint;
17223                if (origHit) {
17224                    origHitFootprint = component.getSafeHitFootprint(origHit);
17225                    hitFootprint = component.getSafeHitFootprint(hit);
17226                    if (origHitFootprint && hitFootprint) {
17227                        selectionFootprint = _this.computeSelection(origHitFootprint, hitFootprint);
17228                    }
17229                    else {
17230                        selectionFootprint = null;
17231                    }
17232                    if (selectionFootprint) {
17233                        component.renderSelectionFootprint(selectionFootprint);
17234                    }
17235                    else if (selectionFootprint === false) {
17236                        util_1.disableCursor();
17237                    }
17238                }
17239            },
17240            hitOut: function () {
17241                selectionFootprint = null;
17242                component.unrenderSelection();
17243            },
17244            hitDone: function () {
17245                util_1.enableCursor();
17246            },
17247            interactionEnd: function (ev, isCancelled) {
17248                if (!isCancelled && selectionFootprint) {
17249                    // the selection will already have been rendered. just report it
17250                    _this.view.reportSelection(selectionFootprint, ev);
17251                }
17252            }
17253        });
17254        return dragListener;
17255    };
17256    // Given the first and last date-spans of a selection, returns another date-span object.
17257    // Subclasses can override and provide additional data in the span object. Will be passed to render
17257SelectionFootprint().
17258    // Will return false if the selection is invalid and this should be indicated to the user.
17259    // Will return null/undefined if a selection invalid but no error should be reported.
17260    DateSelecting.prototype.computeSelection = function (footprint0, footprint1) {
17261        var wholeFootprint = this.computeSelectionFootprint(footprint0, footprint1);
17262        if (wholeFootprint && !this.isSelectionFootprintAllowed(wholeFootprint)) {
17263            return false;
17264        }
17265        return wholeFootprint;
17266    };
17267    // Given two spans, must return the combination of the two.
17268    // TODO: do this separation of concerns (combining VS validation) for event dnd/resize too.
17269    // Assumes both footprints are non-open-ended.
17270    DateSelecting.prototype.computeSelectionFootprint = function (footprint0, footprint1) {
17271        var ms = [
17272            footprint0.unzonedRange.startMs,
17273            footprint0.unzonedRange.endMs,
17274            footprint1.unzonedRange.startMs,
17275            footprint1.unzonedRange.endMs
17276        ];
17277        ms.sort(util_1.compareNumbers);
17278        return new ComponentFootprint_1.default(new UnzonedRange_1.default(ms[0], ms[3]), footprint0.isAllDay);
17279    };
17280    DateSelecting.prototype.isSelectionFootprintAllowed = function (componentFootprint) {
17281        return this.component.dateProfile.validUnzonedRange.containsRange(componentFootprint.unzonedRange) &&
17282            this.view.calendar.constraints.isSelectionFootprintAllowed(componentFootprint);
17283    };
17284    return DateSelecting;
17285}(Interaction_1.default));
17286exports.default = DateSelecting;
17287
17288
17289/***/ }),
17290/* 226 */
17291/***/ (function(module, exports, __webpack_require__) {
17292
17293Object.defineProperty(exports, "__esModule", { value: true });
17294var tslib_1 = __webpack_require__(2);
17295var moment = __webpack_require__(0);
17296var $ = __webpack_require__(3);
17297var util_1 = __webpack_require__(4);
17298var Scroller_1 = __webpack_require__(39);
17299var View_1 = __webpack_require__(41);
17300var TimeGrid_1 = __webpack_require__(227);
17301var DayGrid_1 = __webpack_require__(61);
17302var AGENDA_ALL_DAY_EVENT_LIMIT = 5;
17303var agendaTimeGridMethods;
17304var agendaDayGridMethods;
17305/* An abstract class for all agenda-related views. Displays one more columns with time slots running vertically.
17306----------------------------------------------------------------------------------------------------------------------*/
17307// Is a manager for the TimeGrid subcomponent and possibly the DayGrid subcomponent (if allDaySlot is on).
17308// Responsible for managing width/height.
17309var AgendaView = /** @class */ (function (_super) {
17310    tslib_1.__extends(AgendaView, _super);
17311    function AgendaView(calendar, viewSpec) {
17312        var _this = _super.call(this, calendar, viewSpec) || this;
17313        _this.usesMinMaxTime = true; // indicates that minTime/maxTime affects rendering
17314        _this.timeGrid = _this.instantiateTimeGrid();
17315        _this.addChild(_this.timeGrid);
17316        if (_this.opt('allDaySlot')) {
17317            _this.dayGrid = _this.instantiateDayGrid(); // the all-day subcomponent of this view
17318            _this.addChild(_this.dayGrid);
17319        }
17320        _this.scroller = new Scroller_1.default({
17321            overflowX: 'hidden',
17322            overflowY: 'auto'
17323        });
17324        return _this;
17325    }
17326    // Instantiates the TimeGrid object this view needs. Draws from this.timeGridClass
17327    AgendaView.prototype.instantiateTimeGrid = function () {
17328        var timeGrid = new this.timeGridClass(this);
17329        util_1.copyOwnProps(agendaTimeGridMethods, timeGrid);
17330        return timeGrid;
17331    };
17332    // Instantiates the DayGrid object this view might need. Draws from this.dayGridClass
17333    AgendaView.prototype.instantiateDayGrid = function () {
17334        var dayGrid = new this.dayGridClass(this);
17335        util_1.copyOwnProps(agendaDayGridMethods, dayGrid);
17336        return dayGrid;
17337    };
17338    /* Rendering
17339    ------------------------------------------------------------------------------------------------------------------*/
17340    AgendaView.prototype.renderSkeleton = function () {
17341        var timeGridWrapEl;
17342        var timeGridEl;
17343        this.el.addClass('fc-agenda-view').html(this.renderSkeletonHtml());
17344        this.scroller.render();
17345        timeGridWrapEl = this.scroller.el.addClass('fc-time-grid-container');
17346        timeGridEl = $('<div class="fc-time-grid" />').appendTo(timeGridWrapEl);
17347        this.el.find('.fc-body > tr > td').append(timeGridWrapEl);
17348        this.timeGrid.headContainerEl = this.el.find('.fc-head-container');
17349        this.timeGrid.setElement(timeGridEl);
17350        if (this.dayGrid) {
17351            this.dayGrid.setElement(this.el.find('.fc-day-grid'));
17352            // have the day-grid extend it's coordinate area over the <hr> dividing the two grids
17353            this.dayGrid.bottomCoordPadding = this.dayGrid.el.next('hr').outerHeight();
17354        }
17355    };
17356    AgendaView.prototype.unrenderSkeleton = function () {
17357        this.timeGrid.removeElement();
17358        if (this.dayGrid) {
17359            this.dayGrid.removeElement();
17360        }
17361        this.scroller.destroy();
17362    };
17363    // Builds the HTML skeleton for the view.
17364    // The day-grid and time-grid components will render inside containers defined by this HTML.
17365    AgendaView.prototype.renderSkeletonHtml = function () {
17366        var theme = this.calendar.theme;
17367        return '' +
17368            '<table class="' + theme.getClass('tableGrid') + '">' +
17369            (this.opt('columnHeader') ?
17370                '<thead class="fc-head">' +
17371                    '<tr>' +
17372                    '<td class="fc-head-container ' + theme.getClass('widgetHeader') + '">&nbsp;</td>' +
17373                    '</tr>' +
17374                    '</thead>' :
17375                '') +
17376            '<tbody class="fc-body">' +
17377            '<tr>' +
17378            '<td class="' + theme.getClass('widgetContent') + '">' +
17379            (this.dayGrid ?
17380                '<div class="fc-day-grid"/>' +
17381                    '<hr class="fc-divider ' + theme.getClass('widgetHeader') + '"/>' :
17382                '') +
17383            '</td>' +
17384            '</tr>' +
17385            '</tbody>' +
17386            '</table>';
17387    };
17388    // Generates an HTML attribute string for setting the width of the axis, if it is known
17389    AgendaView.prototype.axisStyleAttr = function () {
17390        if (this.axisWidth != null) {
17391            return 'style="width:' + this.axisWidth + 'px"';
17392        }
17393        return '';
17394    };
17395    /* Now Indicator
17396    ------------------------------------------------------------------------------------------------------------------*/
17397    AgendaView.prototype.getNowIndicatorUnit = function () {
17398        return this.timeGrid.getNowIndicatorUnit();
17399    };
17400    /* Dimensions
17401    ------------------------------------------------------------------------------------------------------------------*/
17402    // Adjusts the vertical dimensions of the view to the specified values
17403    AgendaView.prototype.updateSize = function (totalHeight, isAuto, isResize) {
17404        var eventLimit;
17405        var scrollerHeight;
17406        var scrollbarWidths;
17407        _super.prototype.updateSize.call(this, totalHeight, isAuto, isResize);
17408        // make all axis cells line up, and record the width so newly created axis cells will have it
17409        this.axisWidth = util_1.matchCellWidths(this.el.find('.fc-axis'));
17410        // hack to give the view some height prior to timeGrid's columns being rendered
17411        // TODO: separate setting height from scroller VS timeGrid.
17412        if (!this.timeGrid.colEls) {
17413            if (!isAuto) {
17414                scrollerHeight = this.computeScrollerHeight(totalHeight);
17415                this.scroller.setHeight(scrollerHeight);
17416            }
17417            return;
17418        }
17419        // set of fake row elements that must compensate when scroller has scrollbars
17420        var noScrollRowEls = this.el.find('.fc-row:not(.fc-scroller *)');
17421        // reset all dimensions back to the original state
17422        this.timeGrid.bottomRuleEl.hide(); // .show() will be called later if this <hr> is necessary
17423        this.scroller.clear(); // sets height to 'auto' and clears overflow
17424        util_1.uncompensateScroll(noScrollRowEls);
17425        // limit number of events in the all-day area
17426        if (this.dayGrid) {
17427            this.dayGrid.removeSegPopover(); // kill the "more" popover if displayed
17428            eventLimit = this.opt('eventLimit');
17429            if (eventLimit && typeof eventLimit !== 'number') {
17430                eventLimit = AGENDA_ALL_DAY_EVENT_LIMIT; // make sure "auto" goes to a real number
17431            }
17432            if (eventLimit) {
17433                this.dayGrid.limitRows(eventLimit);
17434            }
17435        }
17436        if (!isAuto) {
17437            scrollerHeight = this.computeScrollerHeight(totalHeight);
17438            this.scroller.setHeight(scrollerHeight);
17439            scrollbarWidths = this.scroller.getScrollbarWidths();
17440            if (scrollbarWidths.left || scrollbarWidths.right) {
17441                // make the all-day and header rows lines up
17442                util_1.compensateScroll(noScrollRowEls, scrollbarWidths);
17443                // the scrollbar compensation might have changed text flow, which might affect height, so recalculate
17444                // and reapply the desired height to the scroller.
17445                scrollerHeight = this.computeScrollerHeight(totalHeight);
17446                this.scroller.setHeight(scrollerHeight);
17447            }
17448            // guarantees the same scrollbar widths
17449            this.scroller.lockOverflow(scrollbarWidths);
17450            // if there's any space below the slats, show the horizontal rule.
17451            // this won't cause any new overflow, because lockOverflow already called.
17452            if (this.timeGrid.getTotalSlatHeight() < scrollerHeight) {
17453                this.timeGrid.bottomRuleEl.show();
17454            }
17455        }
17456    };
17457    // given a desired total height of the view, returns what the height of the scroller should be
17458    AgendaView.prototype.computeScrollerHeight = function (totalHeight) {
17459        return totalHeight -
17460            util_1.subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller
17461    };
17462    /* Scroll
17463    ------------------------------------------------------------------------------------------------------------------*/
17464    // Computes the initial pre-configured scroll state prior to allowing the user to change it
17465    AgendaView.prototype.computeInitialDateScroll = function () {
17466        var scrollTime = moment.duration(this.opt('scrollTime'));
17467        var top = this.timeGrid.computeTimeTop(scrollTime);
17468        // zoom can give weird floating-point values. rather scroll a little bit further
17469        top = Math.ceil(top);
17470        if (top) {
17471            top++; // to overcome top border that slots beyond the first have. looks better
17472        }
17473        return { top: top };
17474    };
17475    AgendaView.prototype.queryDateScroll = function () {
17476        return { top: this.scroller.getScrollTop() };
17477    };
17478    AgendaView.prototype.applyDateScroll = function (scroll) {
17479        if (scroll.top !== undefined) {
17480            this.scroller.setScrollTop(scroll.top);
17481        }
17482    };
17483    /* Hit Areas
17484    ------------------------------------------------------------------------------------------------------------------*/
17485    // forward all hit-related method calls to the grids (dayGrid might not be defined)
17486    AgendaView.prototype.getHitFootprint = function (hit) {
17487        // TODO: hit.component is set as a hack to identify where the hit came from
17488        return hit.component.getHitFootprint(hit);
17489    };
17490    AgendaView.prototype.getHitEl = function (hit) {
17491        // TODO: hit.component is set as a hack to identify where the hit came from
17492        return hit.component.getHitEl(hit);
17493    };
17494    /* Event Rendering
17495    ------------------------------------------------------------------------------------------------------------------*/
17496    AgendaView.prototype.executeEventRender = function (eventsPayload) {
17497        var dayEventsPayload = {};
17498        var timedEventsPayload = {};
17499        var id;
17500        var eventInstanceGroup;
17501        // separate the events into all-day and timed
17502        for (id in eventsPayload) {
17503            eventInstanceGroup = eventsPayload[id];
17504            if (eventInstanceGroup.getEventDef().isAllDay()) {
17505                dayEventsPayload[id] = eventInstanceGroup;
17506            }
17507            else {
17508                timedEventsPayload[id] = eventInstanceGroup;
17509            }
17510        }
17511        this.timeGrid.executeEventRender(timedEventsPayload);
17512        if (this.dayGrid) {
17513            this.dayGrid.executeEventRender(dayEventsPayload);
17514        }
17515    };
17516    /* Dragging/Resizing Routing
17517    ------------------------------------------------------------------------------------------------------------------*/
17518    // A returned value of `true` signals that a mock "helper" event has been rendered.
17519    AgendaView.prototype.renderDrag = function (eventFootprints, seg, isTouch) {
17520        var groups = groupEventFootprintsByAllDay(eventFootprints);
17521        var renderedHelper = false;
17522        renderedHelper = this.timeGrid.renderDrag(groups.timed, seg, isTouch);
17523        if (this.dayGrid) {
17524            renderedHelper = this.dayGrid.renderDrag(groups.allDay, seg, isTouch) || renderedHelper;
17525        }
17526        return renderedHelper;
17527    };
17528    AgendaView.prototype.renderEventResize = function (eventFootprints, seg, isTouch) {
17529        var groups = groupEventFootprintsByAllDay(eventFootprints);
17530        this.timeGrid.renderEventResize(groups.timed, seg, isTouch);
17531        if (this.dayGrid) {
17532            this.dayGrid.renderEventResize(groups.allDay, seg, isTouch);
17533        }
17534    };
17535    /* Selection
17536    ------------------------------------------------------------------------------------------------------------------*/
17537    // Renders a visual indication of a selection
17538    AgendaView.prototype.renderSelectionFootprint = function (componentFootprint) {
17539        if (!componentFootprint.isAllDay) {
17540            this.timeGrid.renderSelectionFootprint(componentFootprint);
17541        }
17542        else if (this.dayGrid) {
17543            this.dayGrid.renderSelectionFootprint(componentFootprint);
17544        }
17545    };
17546    return AgendaView;
17547}(View_1.default));
17548exports.default = AgendaView;
17549AgendaView.prototype.timeGridClass = TimeGrid_1.default;
17550AgendaView.prototype.dayGridClass = DayGrid_1.default;
17551// Will customize the rendering behavior of the AgendaView's timeGrid
17552agendaTimeGridMethods = {
17553    // Generates the HTML that will go before the day-of week header cells
17554    renderHeadIntroHtml: function () {
17555        var view = this.view;
17556        var calendar = view.calendar;
17557        var weekStart = calendar.msToUtcMoment(this.dateProfile.renderUnzonedRange.startMs, true);
17558        var weekText;
17559        if (this.opt('weekNumbers')) {
17560            weekText = weekStart.format(this.opt('smallWeekFormat'));
17561            return '' +
17562                '<th class="fc-axis fc-week-number ' + calendar.theme.getClass('widgetHeader') + '" ' + view.axisStyleAttr() + '>' +
17563                view.buildGotoAnchorHtml(// aside from link, important for matchCellWidths
17564                { date: weekStart, type: 'week', forceOff: this.colCnt > 1 }, util_1.htmlEscape(weekText) // inner HTML
17565                ) +
17566                '</th>';
17567        }
17568        else {
17569            return '<th class="fc-axis ' + calendar.theme.getClass('widgetHeader') + '" ' + view.axisStyleAttr() + '></th>';
17570        }
17571    },
17572    // Generates the HTML that goes before the bg of the TimeGrid slot area. Long vertical column.
17573    renderBgIntroHtml: function () {
17574        var view = this.view;
17575        return '<td class="fc-axis ' + view.calendar.theme.getClass('widgetContent') + '" ' + view.axisStyleAttr() + '></td>';
17576    },
17577    // Generates the HTML that goes before all other types of cells.
17578    // Affects content-skeleton, helper-skeleton, highlight-skeleton for both the time-grid and day-grid.
17579    renderIntroHtml: function () {
17580        var view = this.view;
17581        return '<td class="fc-axis" ' + view.axisStyleAttr() + '></td>';
17582    }
17583};
17584// Will customize the rendering behavior of the AgendaView's dayGrid
17585agendaDayGridMethods = {
17586    // Generates the HTML that goes before the all-day cells
17587    renderBgIntroHtml: function () {
17588        var view = this.view;
17589        return '' +
17590            '<td class="fc-axis ' + view.calendar.theme.getClass('widgetContent') + '" ' + view.axisStyleAttr() + '>' +
17591            '<span>' + // needed for matchCellWidths
17592            view.getAllDayHtml() +
17593            '</span>' +
17594            '</td>';
17595    },
17596    // Generates the HTML that goes before all other types of cells.
17597    // Affects content-skeleton, helper-skeleton, highlight-skeleton for both the time-grid and day-grid.
17598    renderIntroHtml: function () {
17599        var view = this.view;
17600        return '<td class="fc-axis" ' + view.axisStyleAttr() + '></td>';
17601    }
17602};
17603function groupEventFootprintsByAllDay(eventFootprints) {
17604    var allDay = [];
17605    var timed = [];
17606    var i;
17607    for (i = 0; i < eventFootprints.length; i++) {
17608        if (eventFootprints[i].componentFootprint.isAllDay) {
17609            allDay.push(eventFootprints[i]);
17610        }
17611        else {
17612            timed.push(eventFootprints[i]);
17613        }
17614    }
17615    return { allDay: allDay, timed: timed };
17616}
17617
17618
17619/***/ }),
17620/* 227 */
17621/***/ (function(module, exports, __webpack_require__) {
17622
17623Object.defineProperty(exports, "__esModule", { value: true });
17624var tslib_1 = __webpack_require__(2);
17625var $ = __webpack_require__(3);
17626var moment = __webpack_require__(0);
17627var util_1 = __webpack_require__(4);
17628var InteractiveDateComponent_1 = __webpack_require__(40);
17629var BusinessHourRenderer_1 = __webpack_require__(56);
17630var StandardInteractionsMixin_1 = __webpack_require__(60);
17631var DayTableMixin_1 = __webpack_require__(55);
17632var CoordCache_1 = __webpack_require__(53);
17633var UnzonedRange_1 = __webpack_require__(5);
17634var ComponentFootprint_1 = __webpack_require__(12);
17635var TimeGridEventRenderer_1 = __webpack_require__(246);
17636var TimeGridHelperRenderer_1 = __webpack_require__(247);
17637var TimeGridFillRenderer_1 = __webpack_require__(248);
17638/* A component that renders one or more columns of vertical time slots
17639----------------------------------------------------------------------------------------------------------------------*/
17640// We mixin DayTable, even though there is only a single row of days
17641// potential nice values for the slot-duration and interval-duration
17642// from largest to smallest
17643var AGENDA_STOCK_SUB_DURATIONS = [
17644    { hours: 1 },
17645    { minutes: 30 },
17646    { minutes: 15 },
17647    { seconds: 30 },
17648    { seconds: 15 }
17649];
17650var TimeGrid = /** @class */ (function (_super) {
17651    tslib_1.__extends(TimeGrid, _super);
17652    function TimeGrid(view) {
17653        var _this = _super.call(this, view) || this;
17654        _this.processOptions();
17655        return _this;
17656    }
17657    // Slices up the given span (unzoned start/end with other misc data) into an array of segments
17658    TimeGrid.prototype.componentFootprintToSegs = function (componentFootprint) {
17659        var segs = this.sliceRangeByTimes(componentFootprint.unzonedRange);
17660        var i;
17661        for (i = 0; i < segs.length; i++) {
17662            if (this.isRTL) {
17663                segs[i].col = this.daysPerRow - 1 - segs[i].dayIndex;
17664            }
17665            else {
17666                segs[i].col = segs[i].dayIndex;
17667            }
17668        }
17669        return segs;
17670    };
17671    /* Date Handling
17672    ------------------------------------------------------------------------------------------------------------------*/
17673    TimeGrid.prototype.sliceRangeByTimes = function (unzonedRange) {
17674        var segs = [];
17675        var segRange;
17676        var dayIndex;
17677        for (dayIndex = 0; dayIndex < this.daysPerRow; dayIndex++) {
17678            segRange = unzonedRange.intersect(this.dayRanges[dayIndex]);
17679            if (segRange) {
17680                segs.push({
17681                    startMs: segRange.startMs,
17682                    endMs: segRange.endMs,
17683                    isStart: segRange.isStart,
17684                    isEnd: segRange.isEnd,
17685                    dayIndex: dayIndex
17686                });
17687            }
17688        }
17689        return segs;
17690    };
17691    /* Options
17692    ------------------------------------------------------------------------------------------------------------------*/
17693    // Parses various options into properties of this object
17694    TimeGrid.prototype.processOptions = function () {
17695        var slotDuration = this.opt('slotDuration');
17696        var snapDuration = this.opt('snapDuration');
17697        var input;
17698        slotDuration = moment.duration(slotDuration);
17699        snapDuration = snapDuration ? moment.duration(snapDuration) : slotDuration;
17700        this.slotDuration = slotDuration;
17701        this.snapDuration = snapDuration;
17702        this.snapsPerSlot = slotDuration / snapDuration; // TODO: ensure an integer multiple?
17703        // might be an array value (for TimelineView).
17704        // if so, getting the most granular entry (the last one probably).
17705        input = this.opt('slotLabelFormat');
17706        if ($.isArray(input)) {
17707            input = input[input.length - 1];
17708        }
17709        this.labelFormat = input ||
17710            this.opt('smallTimeFormat'); // the computed default
17711        input = this.opt('slotLabelInterval');
17712        this.labelInterval = input ?
17713            moment.duration(input) :
17714            this.computeLabelInterval(slotDuration);
17715    };
17716    // Computes an automatic value for slotLabelInterval
17717    TimeGrid.prototype.computeLabelInterval = function (slotDuration) {
17718        var i;
17719        var labelInterval;
17720        var slotsPerLabel;
17721        // find the smallest stock label interval that results in more than one slots-per-label
17722        for (i = AGENDA_STOCK_SUB_DURATIONS.length - 1; i >= 0; i--) {
17723            labelInterval = moment.duration(AGENDA_STOCK_SUB_DURATIONS[i]);
17724            slotsPerLabel = util_1.divideDurationByDuration(labelInterval, slotDuration);
17725            if (util_1.isInt(slotsPerLabel) && slotsPerLabel > 1) {
17726                return labelInterval;
17727            }
17728        }
17729        return moment.duration(slotDuration); // fall back. clone
17730    };
17731    /* Date Rendering
17732    ------------------------------------------------------------------------------------------------------------------*/
17733    TimeGrid.prototype.renderDates = function (dateProfile) {
17734        this.dateProfile = dateProfile;
17735        this.updateDayTable();
17736        this.renderSlats();
17737        this.renderColumns();
17738    };
17739    TimeGrid.prototype.unrenderDates = function () {
17740        // this.unrenderSlats(); // don't need this because repeated .html() calls clear
17741        this.unrenderColumns();
17742    };
17743    TimeGrid.prototype.renderSkeleton = function () {
17744        var theme = this.view.calendar.theme;
17745        this.el.html('<div class="fc-bg"></div>' +
17746            '<div class="fc-slats"></div>' +
17747            '<hr class="fc-divider ' + theme.getClass('widgetHeader') + '" style="display:none" />');
17748        this.bottomRuleEl = this.el.find('hr');
17749    };
17750    TimeGrid.prototype.renderSlats = function () {
17751        var theme = this.view.calendar.theme;
17752        this.slatContainerEl = this.el.find('> .fc-slats')
17753            .html(// avoids needing ::unrenderSlats()
17754        '<table class="' + theme.getClass('tableGrid') + '">' +
17755            this.renderSlatRowHtml() +
17756            '</table>');
17757        this.slatEls = this.slatContainerEl.find('tr');
17758        this.slatCoordCache = new CoordCache_1.default({
17759            els: this.slatEls,
17760            isVertical: true
17761        });
17762    };
17763    // Generates the HTML for the horizontal "slats" that run width-wise. Has a time axis on a side. Depends on RTL.
17764    TimeGrid.prototype.renderSlatRowHtml = function () {
17765        var view = this.view;
17766        var calendar = view.calendar;
17767        var theme = calendar.theme;
17768        var isRTL = this.isRTL;
17769        var dateProfile = this.dateProfile;
17770        var html = '';
17771        var slotTime = moment.duration(+dateProfile.minTime); // wish there was .clone() for durations
17772        var slotIterator = moment.duration(0);
17773        var slotDate; // will be on the view's first day, but we only care about its time
17774        var isLabeled;
17775        var axisHtml;
17776        // Calculate the time for each slot
17777        while (slotTime < dateProfile.maxTime) {
17778            slotDate = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs).time(slotTime);
17779            isLabeled = util_1.isInt(util_1.divideDurationByDuration(slotIterator, this.labelInterval));
17780            axisHtml =
17781                '<td class="fc-axis fc-time ' + theme.getClass('widgetContent') + '" ' + view.axisStyleAttr() + '>' +
17782                    (isLabeled ?
17783                        '<span>' + // for matchCellWidths
17784                            util_1.htmlEscape(slotDate.format(this.labelFormat)) +
17785                            '</span>' :
17786                        '') +
17787                    '</td>';
17788            html +=
17789                '<tr data-time="' + slotDate.format('HH:mm:ss') + '"' +
17790                    (isLabeled ? '' : ' class="fc-minor"') +
17791                    '>' +
17792                    (!isRTL ? axisHtml : '') +
17793                    '<td class="' + theme.getClass('widgetContent') + '"/>' +
17794                    (isRTL ? axisHtml : '') +
17795                    '</tr>';
17796            slotTime.add(this.slotDuration);
17797            slotIterator.add(this.slotDuration);
17798        }
17799        return html;
17800    };
17801    TimeGrid.prototype.renderColumns = function () {
17802        var dateProfile = this.dateProfile;
17803        var theme = this.view.calendar.theme;
17804        this.dayRanges = this.dayDates.map(function (dayDate) {
17805            return new UnzonedRange_1.default(dayDate.clone().add(dateProfile.minTime), dayDate.clone().add(dateProfile.maxTime));
17806        });
17807        if (this.headContainerEl) {
17808            this.headContainerEl.html(this.renderHeadHtml());
17809        }
17810        this.el.find('> .fc-bg').html('<table class="' + theme.getClass('tableGrid') + '">' +
17811            this.renderBgTrHtml(0) + // row=0
17812            '</table>');
17813        this.colEls = this.el.find('.fc-day, .fc-disabled-day');
17814        this.colCoordCache = new CoordCache_1.default({
17815            els: this.colEls,
17816            isHorizontal: true
17817        });
17818        this.renderContentSkeleton();
17819    };
17820    TimeGrid.prototype.unrenderColumns = function () {
17821        this.unrenderContentSkeleton();
17822    };
17823    /* Content Skeleton
17824    ------------------------------------------------------------------------------------------------------------------*/
17825    // Renders the DOM that the view's content will live in
17826    TimeGrid.prototype.renderContentSkeleton = function () {
17827        var cellHtml = '';
17828        var i;
17829        var skeletonEl;
17830        for (i = 0; i < this.colCnt; i++) {
17831            cellHtml +=
17832                '<td>' +
17833                    '<div class="fc-content-col">' +
17834                    '<div class="fc-event-container fc-helper-container"></div>' +
17835                    '<div class="fc-event-container"></div>' +
17836                    '<div class="fc-highlight-container"></div>' +
17837                    '<div class="fc-bgevent-container"></div>' +
17838                    '<div class="fc-business-container"></div>' +
17839                    '</div>' +
17840                    '</td>';
17841        }
17842        skeletonEl = this.contentSkeletonEl = $('<div class="fc-content-skeleton">' +
17843            '<table>' +
17844            '<tr>' + cellHtml + '</tr>' +
17845            '</table>' +
17846            '</div>');
17847        this.colContainerEls = skeletonEl.find('.fc-content-col');
17848        this.helperContainerEls = skeletonEl.find('.fc-helper-container');
17849        this.fgContainerEls = skeletonEl.find('.fc-event-container:not(.fc-helper-container)');
17850        this.bgContainerEls = skeletonEl.find('.fc-bgevent-container');
17851        this.highlightContainerEls = skeletonEl.find('.fc-highlight-container');
17852        this.businessContainerEls = skeletonEl.find('.fc-business-container');
17853        this.bookendCells(skeletonEl.find('tr')); // TODO: do this on string level
17854        this.el.append(skeletonEl);
17855    };
17856    TimeGrid.prototype.unrenderContentSkeleton = function () {
17857        if (this.contentSkeletonEl) {
17858            this.contentSkeletonEl.remove();
17859            this.contentSkeletonEl = null;
17860            this.colContainerEls = null;
17861            this.helperContainerEls = null;
17862            this.fgContainerEls = null;
17863            this.bgContainerEls = null;
17864            this.highlightContainerEls = null;
17865            this.businessContainerEls = null;
17866        }
17867    };
17868    // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's col
17869    TimeGrid.prototype.groupSegsByCol = function (segs) {
17870        var segsByCol = [];
17871        var i;
17872        for (i = 0; i < this.colCnt; i++) {
17873            segsByCol.push([]);
17874        }
17875        for (i = 0; i < segs.length; i++) {
17876            segsByCol[segs[i].col].push(segs[i]);
17877        }
17878        return segsByCol;
17879    };
17880    // Given segments grouped by column, insert the segments' elements into a parallel array of container
17881    // elements, each living within a column.
17882    TimeGrid.prototype.attachSegsByCol = function (segsByCol, containerEls) {
17883        var col;
17884        var segs;
17885        var i;
17886        for (col = 0; col < this.colCnt; col++) {
17887            segs = segsByCol[col];
17888            for (i = 0; i < segs.length; i++) {
17889                containerEls.eq(col).append(segs[i].el);
17890            }
17891        }
17892    };
17893    /* Now Indicator
17894    ------------------------------------------------------------------------------------------------------------------*/
17895    TimeGrid.prototype.getNowIndicatorUnit = function () {
17896        return 'minute'; // will refresh on the minute
17897    };
17898    TimeGrid.prototype.renderNowIndicator = function (date) {
17899        // HACK: if date columns not ready for some reason (scheduler)
17900        if (!this.colContainerEls) {
17901            return;
17902        }
17903        // seg system might be overkill, but it handles scenario where line needs to be rendered
17904        //  more than once because of columns with the same date (resources columns for example)
17905        var segs = this.componentFootprintToSegs(new ComponentFootprint_1.default(new UnzonedRange_1.default(date, date.valueOf() + 1), // protect against null range
17906        false // all-day
17907        ));
17908        var top = this.computeDateTop(date, date);
17909        var nodes = [];
17910        var i;
17911        // render lines within the columns
17912        for (i = 0; i < segs.length; i++) {
17913            nodes.push($('<div class="fc-now-indicator fc-now-indicator-line"></div>')
17914                .css('top', top)
17915                .appendTo(this.colContainerEls.eq(segs[i].col))[0]);
17916        }
17917        // render an arrow over the axis
17918        if (segs.length > 0) {
17919            nodes.push($('<div class="fc-now-indicator fc-now-indicator-arrow"></div>')
17920                .css('top', top)
17921                .appendTo(this.el.find('.fc-content-skeleton'))[0]);
17922        }
17923        this.nowIndicatorEls = $(nodes);
17924    };
17925    TimeGrid.prototype.unrenderNowIndicator = function () {
17926        if (this.nowIndicatorEls) {
17927            this.nowIndicatorEls.remove();
17928            this.nowIndicatorEls = null;
17929        }
17930    };
17931    /* Coordinates
17932    ------------------------------------------------------------------------------------------------------------------*/
17933    TimeGrid.prototype.updateSize = function (totalHeight, isAuto, isResize) {
17934        _super.prototype.updateSize.call(this, totalHeight, isAuto, isResize);
17935        this.slatCoordCache.build();
17936        if (isResize) {
17937            this.updateSegVerticals([].concat(this.eventRenderer.getSegs(), this.businessSegs || []));
17938        }
17939    };
17940    TimeGrid.prototype.getTotalSlatHeight = function () {
17941        return this.slatContainerEl.outerHeight();
17942    };
17943    // Computes the top coordinate, relative to the bounds of the grid, of the given date.
17944    // `ms` can be a millisecond UTC time OR a UTC moment.
17945    // A `startOfDayDate` must be given for avoiding ambiguity over how to treat midnight.
17946    TimeGrid.prototype.computeDateTop = function (ms, startOfDayDate) {
17947        return this.computeTimeTop(moment.duration(ms - startOfDayDate.clone().stripTime()));
17948    };
17949    // Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration).
17950    TimeGrid.prototype.computeTimeTop = function (time) {
17951        var len = this.slatEls.length;
17952        var dateProfile = this.dateProfile;
17953        var slatCoverage = (time - dateProfile.minTime) / this.slotDuration; // floating-point value of # of slots covered
17954        var slatIndex;
17955        var slatRemainder;
17956        // compute a floating-point number for how many slats should be progressed through.
17957        // from 0 to number of slats (inclusive)
17958        // constrained because minTime/maxTime might be customized.
17959        slatCoverage = Math.max(0, slatCoverage);
17960        slatCoverage = Math.min(len, slatCoverage);
17961        // an integer index of the furthest whole slat
17962        // from 0 to number slats (*exclusive*, so len-1)
17963        slatIndex = Math.floor(slatCoverage);
17964        slatIndex = Math.min(slatIndex, len - 1);
17965        // how much further through the slatIndex slat (from 0.0-1.0) must be covered in addition.
17966        // could be 1.0 if slatCoverage is covering *all* the slots
17967        slatRemainder = slatCoverage - slatIndex;
17968        return this.slatCoordCache.getTopPosition(slatIndex) +
17969            this.slatCoordCache.getHeight(slatIndex) * slatRemainder;
17970    };
17971    // Refreshes the CSS top/bottom coordinates for each segment element.
17972    // Works when called after initial render, after a window resize/zoom for example.
17973    TimeGrid.prototype.updateSegVerticals = function (segs) {
17974        this.computeSegVerticals(segs);
17975        this.assignSegVerticals(segs);
17976    };
17977    // For each segment in an array, computes and assigns its top and bottom properties
17978    TimeGrid.prototype.computeSegVerticals = function (segs) {
17979        var eventMinHeight = this.opt('agendaEventMinHeight');
17980        var i;
17981        var seg;
17982        var dayDate;
17983        for (i = 0; i < segs.length; i++) {
17984            seg = segs[i];
17985            dayDate = this.dayDates[seg.dayIndex];
17986            seg.top = this.computeDateTop(seg.startMs, dayDate);
17987            seg.bottom = Math.max(seg.top + eventMinHeight, this.computeDateTop(seg.endMs, dayDate));
17988        }
17989    };
17990    // Given segments that already have their top/bottom properties computed, applies those values to
17991    // the segments' elements.
17992    TimeGrid.prototype.assignSegVerticals = function (segs) {
17993        var i;
17994        var seg;
17995        for (i = 0; i < segs.length; i++) {
17996            seg = segs[i];
17997            seg.el.css(this.generateSegVerticalCss(seg));
17998        }
17999    };
18000    // Generates an object with CSS properties for the top/bottom coordinates of a segment element
18001    TimeGrid.prototype.generateSegVerticalCss = function (seg) {
18002        return {
18003            top: seg.top,
18004            bottom: -seg.bottom // flipped because needs to be space beyond bottom edge of event container
18005        };
18006    };
18007    /* Hit System
18008    ------------------------------------------------------------------------------------------------------------------*/
18009    TimeGrid.prototype.prepareHits = function () {
18010        this.colCoordCache.build();
18011        this.slatCoordCache.build();
18012    };
18013    TimeGrid.prototype.releaseHits = function () {
18014        this.colCoordCache.clear();
18015        // NOTE: don't clear slatCoordCache because we rely on it for computeTimeTop
18016    };
18017    TimeGrid.prototype.queryHit = function (leftOffset, topOffset) {
18018        var snapsPerSlot = this.snapsPerSlot;
18019        var colCoordCache = this.colCoordCache;
18020        var slatCoordCache = this.slatCoordCache;
18021        if (colCoordCache.isLeftInBounds(leftOffset) && slatCoordCache.isTopInBounds(topOffset)) {
18022            var colIndex = colCoordCache.getHorizontalIndex(leftOffset);
18023            var slatIndex = slatCoordCache.getVerticalIndex(topOffset);
18024            if (colIndex != null && slatIndex != null) {
18025                var slatTop = slatCoordCache.getTopOffset(slatIndex);
18026                var slatHeight = slatCoordCache.getHeight(slatIndex);
18027                var partial = (topOffset - slatTop) / slatHeight; // floating point number between 0 and 1
18028                var localSnapIndex = Math.floor(partial * snapsPerSlot); // the snap # relative to start of slat
18029                var snapIndex = slatIndex * snapsPerSlot + localSnapIndex;
18030                var snapTop = slatTop + (localSnapIndex / snapsPerSlot) * slatHeight;
18031                var snapBottom = slatTop + ((localSnapIndex + 1) / snapsPerSlot) * slatHeight;
18032                return {
18033                    col: colIndex,
18034                    snap: snapIndex,
18035                    component: this,
18036                    left: colCoordCache.getLeftOffset(colIndex),
18037                    right: colCoordCache.getRightOffset(colIndex),
18038                    top: snapTop,
18039                    bottom: snapBottom
18040                };
18041            }
18042        }
18043    };
18044    TimeGrid.prototype.getHitFootprint = function (hit) {
18045        var start = this.getCellDate(0, hit.col); // row=0
18046        var time = this.computeSnapTime(hit.snap); // pass in the snap-index
18047        var end;
18048        start.time(time);
18049        end = start.clone().add(this.snapDuration);
18050        return new ComponentFootprint_1.default(new UnzonedRange_1.default(start, end), false // all-day?
18051        );
18052    };
18053    // Given a row number of the grid, representing a "snap", returns a time (Duration) from its start-of-day
18054    TimeGrid.prototype.computeSnapTime = function (snapIndex) {
18055        return moment.duration(this.dateProfile.minTime + this.snapDuration * snapIndex);
18056    };
18057    TimeGrid.prototype.getHitEl = function (hit) {
18058        return this.colEls.eq(hit.col);
18059    };
18060    /* Event Drag Visualization
18061    ------------------------------------------------------------------------------------------------------------------*/
18062    // Renders a visual indication of an event being dragged over the specified date(s).
18063    // A returned value of `true` signals that a mock "helper" event has been rendered.
18064    TimeGrid.prototype.renderDrag = function (eventFootprints, seg, isTouch) {
18065        var i;
18066        if (seg) {
18067            if (eventFootprints.length) {
18068                this.helperRenderer.renderEventDraggingFootprints(eventFootprints, seg, isTouch);
18069                // signal that a helper has been rendered
18070                return true;
18071            }
18072        }
18073        else {
18074            for (i = 0; i < eventFootprints.length; i++) {
18075                this.renderHighlight(eventFootprints[i].componentFootprint);
18076            }
18077        }
18078    };
18079    // Unrenders any visual indication of an event being dragged
18080    TimeGrid.prototype.unrenderDrag = function () {
18081        this.unrenderHighlight();
18082        this.helperRenderer.unrender();
18083    };
18084    /* Event Resize Visualization
18085    ------------------------------------------------------------------------------------------------------------------*/
18086    // Renders a visual indication of an event being resized
18087    TimeGrid.prototype.renderEventResize = function (eventFootprints, seg, isTouch) {
18088        this.helperRenderer.renderEventResizingFootprints(eventFootprints, seg, isTouch);
18089    };
18090    // Unrenders any visual indication of an event being resized
18091    TimeGrid.prototype.unrenderEventResize = function () {
18092        this.helperRenderer.unrender();
18093    };
18094    /* Selection
18095    ------------------------------------------------------------------------------------------------------------------*/
18096    // Renders a visual indication of a selection. Overrides the default, which was to simply render a highlight.
18097    TimeGrid.prototype.renderSelectionFootprint = function (componentFootprint) {
18098        if (this.opt('selectHelper')) {
18099            this.helperRenderer.renderComponentFootprint(componentFootprint);
18100        }
18101        else {
18102            this.renderHighlight(componentFootprint);
18103        }
18104    };
18105    // Unrenders any visual indication of a selection
18106    TimeGrid.prototype.unrenderSelection = function () {
18107        this.helperRenderer.unrender();
18108        this.unrenderHighlight();
18109    };
18110    return TimeGrid;
18111}(InteractiveDateComponent_1.default));
18112exports.default = TimeGrid;
18113TimeGrid.prototype.eventRendererClass = TimeGridEventRenderer_1.default;
18114TimeGrid.prototype.businessHourRendererClass = BusinessHourRenderer_1.default;
18115TimeGrid.prototype.helperRendererClass = TimeGridHelperRenderer_1.default;
18116TimeGrid.prototype.fillRendererClass = TimeGridFillRenderer_1.default;
18117StandardInteractionsMixin_1.default.mixInto(TimeGrid);
18118DayTableMixin_1.default.mixInto(TimeGrid);
18119
18120
18121/***/ }),
18122/* 228 */
18123/***/ (function(module, exports, __webpack_require__) {
18124
18125Object.defineProperty(exports, "__esModule", { value: true });
18126var tslib_1 = __webpack_require__(2);
18127var UnzonedRange_1 = __webpack_require__(5);
18128var DateProfileGenerator_1 = __webpack_require__(221);
18129var BasicViewDateProfileGenerator = /** @class */ (function (_super) {
18130    tslib_1.__extends(BasicViewDateProfileGenerator, _super);
18131    function BasicViewDateProfileGenerator() {
18132        return _super !== null && _super.apply(this, arguments) || this;
18133    }
18134    // Computes the date range that will be rendered.
18135    BasicViewDateProfileGenerator.prototype.buildRenderRange = function (currentUnzonedRange, currentRangeUnit, isRangeAllDay) {
18136        var renderUnzonedRange = _super.prototype.buildRenderRange.call(this, currentUnzonedRange, currentRangeUnit, isRangeAllDay); // an UnzonedRange
18137        var start = this.msToUtcMoment(renderUnzonedRange.startMs, isRangeAllDay);
18138        var end = this.msToUtcMoment(renderUnzonedRange.endMs, isRangeAllDay);
18139        // year and month views should be aligned with weeks. this is already done for week
18140        if (/^(year|month)$/.test(currentRangeUnit)) {
18141            start.startOf('week');
18142            // make end-of-week if not already
18143            if (end.weekday()) {
18144                end.add(1, 'week').startOf('week'); // exclusively move backwards
18145            }
18146        }
18147        return new UnzonedRange_1.default(start, end);
18148    };
18149    return BasicViewDateProfileGenerator;
18150}(DateProfileGenerator_1.default));
18151exports.default = BasicViewDateProfileGenerator;
18152
18153
18154/***/ }),
18155/* 229 */
18156/***/ (function(module, exports, __webpack_require__) {
18157
18158Object.defineProperty(exports, "__esModule", { value: true });
18159var tslib_1 = __webpack_require__(2);
18160var moment = __webpack_require__(0);
18161var util_1 = __webpack_require__(4);
18162var BasicView_1 = __webpack_require__(62);
18163var MonthViewDateProfileGenerator_1 = __webpack_require__(253);
18164/* A month view with day cells running in rows (one-per-week) and columns
18165----------------------------------------------------------------------------------------------------------------------*/
18166var MonthView = /** @class */ (function (_super) {
18167    tslib_1.__extends(MonthView, _super);
18168    function MonthView() {
18169        return _super !== null && _super.apply(this, arguments) || this;
18170    }
18171    // Overrides the default BasicView behavior to have special multi-week auto-height logic
18172    MonthView.prototype.setGridHeight = function (height, isAuto) {
18173        // if auto, make the height of each row the height that it would be if there were 6 weeks
18174        if (isAuto) {
18175            height *= this.dayGrid.rowCnt / 6;
18176        }
18177        util_1.distributeHeight(this.dayGrid.rowEls, height, !isAuto); // if auto, don't compensate for height-hogging rows
18178    };
18179    MonthView.prototype.isDateInOtherMonth = function (date, dateProfile) {
18180        return date.month() !== moment.utc(dateProfile.currentUnzonedRange.startMs).month(); // TODO: optimize
18181    };
18182    return MonthView;
18183}(BasicView_1.default));
18184exports.default = MonthView;
18185MonthView.prototype.dateProfileGeneratorClass = MonthViewDateProfileGenerator_1.default;
18186
18187
18188/***/ }),
18189/* 230 */
18190/***/ (function(module, exports, __webpack_require__) {
18191
18192Object.defineProperty(exports, "__esModule", { value: true });
18193var tslib_1 = __webpack_require__(2);
18194var $ = __webpack_require__(3);
18195var util_1 = __webpack_require__(4);
18196var UnzonedRange_1 = __webpack_require__(5);
18197var View_1 = __webpack_require__(41);
18198var Scroller_1 = __webpack_require__(39);
18199var ListEventRenderer_1 = __webpack_require__(254);
18200var ListEventPointing_1 = __webpack_require__(255);
18201/*
18202Responsible for the scroller, and forwarding event-related actions into the "grid".
18203*/
18204var ListView = /** @class */ (function (_super) {
18205    tslib_1.__extends(ListView, _super);
18206    function ListView(calendar, viewSpec) {
18207        var _this = _super.call(this, calendar, viewSpec) || this;
18208        _this.segSelector = '.fc-list-item'; // which elements accept event actions
18209        _this.scroller = new Scroller_1.default({
18210            overflowX: 'hidden',
18211            overflowY: 'auto'
18212        });
18213        return _this;
18214    }
18215    ListView.prototype.renderSkeleton = function () {
18216        this.el.addClass('fc-list-view ' +
18217            this.calendar.theme.getClass('listView'));
18218        this.scroller.render();
18219        this.scroller.el.appendTo(this.el);
18220        this.contentEl = this.scroller.scrollEl; // shortcut
18221    };
18222    ListView.prototype.unrenderSkeleton = function () {
18223        this.scroller.destroy(); // will remove the Grid too
18224    };
18225    ListView.prototype.updateSize = function (totalHeight, isAuto, isResize) {
18226        this.scroller.setHeight(this.computeScrollerHeight(totalHeight));
18227    };
18228    ListView.prototype.computeScrollerHeight = function (totalHeight) {
18229        return totalHeight -
18230            util_1.subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller
18231    };
18232    ListView.prototype.renderDates = function (dateProfile) {
18233        var calendar = this.calendar;
18234        var dayStart = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs, true);
18235        var viewEnd = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.endMs, true);
18236        var dayDates = [];
18237        var dayRanges = [];
18238        while (dayStart < viewEnd) {
18239            dayDates.push(dayStart.clone());
18240            dayRanges.push(new UnzonedRange_1.default(dayStart, dayStart.clone().add(1, 'day')));
18241            dayStart.add(1, 'day');
18242        }
18243        this.dayDates = dayDates;
18244        this.dayRanges = dayRanges;
18245        // all real rendering happens in EventRenderer
18246    };
18247    // slices by day
18248    ListView.prototype.componentFootprintToSegs = function (footprint) {
18249        var dayRanges = this.dayRanges;
18250        var dayIndex;
18251        var segRange;
18252        var seg;
18253        var segs = [];
18254        for (dayIndex = 0; dayIndex < dayRanges.length; dayIndex++) {
18255            segRange = footprint.unzonedRange.intersect(dayRanges[dayIndex]);
18256            if (segRange) {
18257                seg = {
18258                    startMs: segRange.startMs,
18259                    endMs: segRange.endMs,
18260                    isStart: segRange.isStart,
18261                    isEnd: segRange.isEnd,
18262                    dayIndex: dayIndex
18263                };
18264                segs.push(seg);
18265                // detect when footprint won't go fully into the next day,
18266                // and mutate the latest seg to the be the end.
18267                if (!seg.isEnd && !footprint.isAllDay &&
18268                    dayIndex + 1 < dayRanges.length &&
18269                    footprint.unzonedRange.endMs < dayRanges[dayIndex + 1].startMs + this.nextDayThreshold) {
18270                    seg.endMs = footprint.unzonedRange.endMs;
18271                    seg.isEnd = true;
18272                    break;
18273                }
18274            }
18275        }
18276        return segs;
18277    };
18278    ListView.prototype.renderEmptyMessage = function () {
18279        this.contentEl.html('<div class="fc-list-empty-wrap2">' + // TODO: try less wraps
18280            '<div class="fc-list-empty-wrap1">' +
18281            '<div class="fc-list-empty">' +
18282            util_1.htmlEscape(this.opt('noEventsMessage')) +
18283            '</div>' +
18284            '</div>' +
18285            '</div>');
18286    };
18287    // render the event segments in the view
18288    ListView.prototype.renderSegList = function (allSegs) {
18289        var segsByDay = this.groupSegsByDay(allSegs); // sparse array
18290        var dayIndex;
18291        var daySegs;
18292        var i;
18293        var tableEl = $('<table class="fc-list-table ' + this.calendar.theme.getClass('tableList') + '"><tbody/></table>');
18294        var tbodyEl = tableEl.find('tbody');
18295        for (dayIndex = 0; dayIndex < segsByDay.length; dayIndex++) {
18296            daySegs = segsByDay[dayIndex];
18297            if (daySegs) {
18298                // append a day header
18299                tbodyEl.append(this.dayHeaderHtml(this.dayDates[dayIndex]));
18300                this.eventRenderer.sortEventSegs(daySegs);
18301                for (i = 0; i < daySegs.length; i++) {
18302                    tbodyEl.append(daySegs[i].el); // append event row
18303                }
18304            }
18305        }
18306        this.contentEl.empty().append(tableEl);
18307    };
18308    // Returns a sparse array of arrays, segs grouped by their dayIndex
18309    ListView.prototype.groupSegsByDay = function (segs) {
18310        var segsByDay = []; // sparse array
18311        var i;
18312        var seg;
18313        for (i = 0; i < segs.length; i++) {
18314            seg = segs[i];
18315            (segsByDay[seg.dayIndex] || (segsByDay[seg.dayIndex] = []))
18316                .push(seg);
18317        }
18318        return segsByDay;
18319    };
18320    // generates the HTML for the day headers that live amongst the event rows
18321    ListView.prototype.dayHeaderHtml = function (dayDate) {
18322        var mainFormat = this.opt('listDayFormat');
18323        var altFormat = this.opt('listDayAltFormat');
18324        return '<tr class="fc-list-heading" data-date="' + dayDate.format('YYYY-MM-DD') + '">' +
18325            '<td class="' + this.calendar.theme.getClass('widgetHeader') + '" colspan="3">' +
18326            (mainFormat ?
18327                this.buildGotoAnchorHtml(dayDate, { 'class': 'fc-list-heading-main' }, util_1.htmlEscape(dayDate.format(mainFormat)) // inner HTML
18328                ) :
18329                '') +
18330            (altFormat ?
18331                this.buildGotoAnchorHtml(dayDate, { 'class': 'fc-list-heading-alt' }, util_1.htmlEscape(dayDate.format(altFormat)) // inner HTML
18332                ) :
18333                '') +
18334            '</td>' +
18335            '</tr>';
18336    };
18337    return ListView;
18338}(View_1.default));
18339exports.default = ListView;
18340ListView.prototype.eventRendererClass = ListEventRenderer_1.default;
18341ListView.prototype.eventPointingClass = ListEventPointing_1.default;
18342
18343
18344/***/ }),
18345/* 231 */,
18346/* 232 */,
18347/* 233 */,
18348/* 234 */,
18349/* 235 */,
18350/* 236 */
18351/***/ (function(module, exports, __webpack_require__) {
18352
18353var $ = __webpack_require__(3);
18354var exportHooks = __webpack_require__(17);
18355var util_1 = __webpack_require__(4);
18356var Calendar_1 = __webpack_require__(220);
18357// for intentional side-effects
18358__webpack_require__(10);
18359__webpack_require__(47);
18360__webpack_require__(256);
18361__webpack_require__(257);
18362__webpack_require__(259);
18363__webpack_require__(260);
18364__webpack_require__(261);
18365__webpack_require__(262);
18366$.fullCalendar = exportHooks;
18367$.fn.fullCalendar = function (options) {
18368    var args = Array.prototype.slice.call(arguments, 1); // for a possible method call
18369    var res = this; // what this function will return (this jQuery object by default)
18370    this.each(function (i, _element) {
18371        var element = $(_element);
18372        var calendar = element.data('fullCalendar'); // get the existing calendar object (if any)
18373        var singleRes; // the returned value of this single method call
18374        // a method call
18375        if (typeof options === 'string') {
18376            if (options === 'getCalendar') {
18377                if (!i) {
18378                    res = calendar;
18379                }
18380            }
18381            else if (options === 'destroy') {
18382                if (calendar) {
18383                    calendar.destroy();
18384                    element.removeData('fullCalendar');
18385                }
18386            }
18387            else if (!calendar) {
18388                util_1.warn('Attempting to call a FullCalendar method on an element with no calendar.');
18389            }
18390            else if ($.isFunction(calendar[options])) {
18391                singleRes = calendar[options].apply(calendar, args);
18392                if (!i) {
18393                    res = singleRes; // record the first method call result
18394                }
18395                if (options === 'destroy') {
18396                    element.removeData('fullCalendar');
18397                }
18398            }
18399            else {
18400                util_1.warn("'" + options + "' is an unknown FullCalendar method.");
18401            }
18402        }
18403        else if (!calendar) {
18404            calendar = new Calendar_1.default(element, options);
18405            element.data('fullCalendar', calendar);
18406            calendar.render();
18407        }
18408    });
18409    return res;
18410};
18411module.exports = exportHooks;
18412
18413
18414/***/ }),
18415/* 237 */
18416/***/ (function(module, exports, __webpack_require__) {
18417
18418Object.defineProperty(exports, "__esModule", { value: true });
18419var tslib_1 = __webpack_require__(2);
18420var Model_1 = __webpack_require__(48);
18421var Component = /** @class */ (function (_super) {
18422    tslib_1.__extends(Component, _super);
18423    function Component() {
18424        return _super !== null && _super.apply(this, arguments) || this;
18425    }
18426    Component.prototype.setElement = function (el) {
18427        this.el = el;
18428        this.bindGlobalHandlers();
18429        this.renderSkeleton();
18430        this.set('isInDom', true);
18431    };
18432    Component.prototype.removeElement = function () {
18433        this.unset('isInDom');
18434        this.unrenderSkeleton();
18435        this.unbindGlobalHandlers();
18436        this.el.remove();
18437        // NOTE: don't null-out this.el in case the View was destroyed within an API callback.
18438        // We don't null-out the View's other jQuery element references upon destroy,
18439        //  so we shouldn't kill this.el either.
18440    };
18441    Component.prototype.bindGlobalHandlers = function () {
18442        // subclasses can override
18443    };
18444    Component.prototype.unbindGlobalHandlers = function () {
18445        // subclasses can override
18446    };
18447    /*
18448    NOTE: Can't have a `render` method. Read the deprecation notice in View::executeDateRender
18449    */
18450    // Renders the basic structure of the view before any content is rendered
18451    Component.prototype.renderSkeleton = function () {
18452        // subclasses should implement
18453    };
18454    // Unrenders the basic structure of the view
18455    Component.prototype.unrenderSkeleton = function () {
18456        // subclasses should implement
18457    };
18458    return Component;
18459}(Model_1.default));
18460exports.default = Component;
18461
18462
18463/***/ }),
18464/* 238 */
18465/***/ (function(module, exports) {
18466
18467Object.defineProperty(exports, "__esModule", { value: true });
18468var Iterator = /** @class */ (function () {
18469    function Iterator(items) {
18470        this.items = items || [];
18471    }
18472    /* Calls a method on every item passing the arguments through */
18473    Iterator.prototype.proxyCall = function (methodName) {
18474        var args = [];
18475        for (var _i = 1; _i < arguments.length; _i++) {
18476            args[_i - 1] = arguments[_i];
18477        }
18478        var results = [];
18479        this.items.forEach(function (item) {
18480            results.push(item[methodName].apply(item, args));
18481        });
18482        return results;
18483    };
18484    return Iterator;
18485}());
18486exports.default = Iterator;
18487
18488
18489/***/ }),
18490/* 239 */
18491/***/ (function(module, exports, __webpack_require__) {
18492
18493Object.defineProperty(exports, "__esModule", { value: true });
18494var $ = __webpack_require__(3);
18495var util_1 = __webpack_require__(4);
18496/* Toolbar with buttons and title
18497----------------------------------------------------------------------------------------------------------------------*/
18498var Toolbar = /** @class */ (function () {
18499    function Toolbar(calendar, toolbarOptions) {
18500        this.el = null; // mirrors local `el`
18501        this.viewsWithButtons = [];
18502        this.calendar = calendar;
18503        this.toolbarOptions = toolbarOptions;
18504    }
18505    // method to update toolbar-specific options, not calendar-wide options
18506    Toolbar.prototype.setToolbarOptions = function (newToolbarOptions) {
18507        this.toolbarOptions = newToolbarOptions;
18508    };
18509    // can be called repeatedly and will rerender
18510    Toolbar.prototype.render = function () {
18511        var sections = this.toolbarOptions.layout;
18512        var el = this.el;
18513        if (sections) {
18514            if (!el) {
18515                el = this.el = $("<div class='fc-toolbar " + this.toolbarOptions.extraClasses + "'/>");
18516            }
18517            else {
18518                el.empty();
18519            }
18520            el.append(this.renderSection('left'))
18521                .append(this.renderSection('right'))
18522                .append(this.renderSection('center'))
18523                .append('<div class="fc-clear"/>');
18524        }
18525        else {
18526            this.removeElement();
18527        }
18528    };
18529    Toolbar.prototype.removeElement = function () {
18530        if (this.el) {
18531            this.el.remove();
18532            this.el = null;
18533        }
18534    };
18535    Toolbar.prototype.renderSection = function (position) {
18536        var _this = this;
18537        var calendar = this.calendar;
18538        var theme = calendar.theme;
18539        var optionsManager = calendar.optionsManager;
18540        var viewSpecManager = calendar.viewSpecManager;
18541        var sectionEl = $('<div class="fc-' + position + '"/>');
18542        var buttonStr = this.toolbarOptions.layout[position];
18543        var calendarCustomButtons = optionsManager.get('customButtons') || {};
18544        var calendarButtonTextOverrides = optionsManager.overrides.buttonText || {};
18545        var calendarButtonText = optionsManager.get('buttonText') || {};
18546        if (buttonStr) {
18547            $.each(buttonStr.split(' '), function (i, buttonGroupStr) {
18548                var groupChildren = $();
18549                var isOnlyButtons = true;
18550                var groupEl;
18551                $.each(buttonGroupStr.split(','), function (j, buttonName) {
18552                    var customButtonProps;
18553                    var viewSpec;
18554                    var buttonClick;
18555                    var buttonIcon; // only one of these will be set
18556                    var buttonText; // "
18557                    var buttonInnerHtml;
18558                    var buttonClasses;
18559                    var buttonEl;
18560                    var buttonAriaAttr;
18561                    if (buttonName === 'title') {
18562                        groupChildren = groupChildren.add($('<h2>&nbsp;</h2>')); // we always want it to take up height
18563                        isOnlyButtons = false;
18564                    }
18565                    else {
18566                        if ((customButtonProps = calendarCustomButtons[buttonName])) {
18567                            buttonClick = function (ev) {
18568                                if (customButtonProps.click) {
18569                                    customButtonProps.click.call(buttonEl[0], ev);
18570                                }
18571                            };
18572                            (buttonIcon = theme.getCustomButtonIconClass(customButtonProps)) ||
18573                                (buttonIcon = theme.getIconClass(buttonName)) ||
18574                                (buttonText = customButtonProps.text);
18575                        }
18576                        else if ((viewSpec = viewSpecManager.getViewSpec(buttonName))) {
18577                            _this.viewsWithButtons.push(buttonName);
18578                            buttonClick = function () {
18579                                calendar.changeView(buttonName);
18580                            };
18581                            (buttonText = viewSpec.buttonTextOverride) ||
18582                                (buttonIcon = theme.getIconClass(buttonName)) ||
18583                                (buttonText = viewSpec.buttonTextDefault);
18584                        }
18585                        else if (calendar[buttonName]) {
18586                            buttonClick = function () {
18587                                calendar[buttonName]();
18588                            };
18589                            (buttonText = calendarButtonTextOverrides[buttonName]) ||
18590                                (buttonIcon = theme.getIconClass(buttonName)) ||
18591                                (buttonText = calendarButtonText[buttonName]);
18592                            //            ^ everything else is considered default
18593                        }
18594                        if (buttonClick) {
18595                            buttonClasses = [
18596                                'fc-' + buttonName + '-button',
18597                                theme.getClass('button'),
18598                                theme.getClass('stateDefault')
18599                            ];
18600                            if (buttonText) {
18601                                buttonInnerHtml = util_1.htmlEscape(buttonText);
18602                                buttonAriaAttr = '';
18603                            }
18604                            else if (buttonIcon) {
18605                                buttonInnerHtml = "<span class='" + buttonIcon + "'></span>";
18606                                buttonAriaAttr = ' aria-label="' + buttonName + '"';
18607                            }
18608                            buttonEl = $(// type="button" so that it doesn't submit a form
18609                            '<button type="button" class="' + buttonClasses.join(' ') + '"' +
18610                                buttonAriaAttr +
18611                                '>' + buttonInnerHtml + '</button>')
18612                                .click(function (ev) {
18613                                // don't process clicks for disabled buttons
18614                                if (!buttonEl.hasClass(theme.getClass('stateDisabled'))) {
18615                                    buttonClick(ev);
18616                                    // after the click action, if the button becomes the "active" tab, or disabled,
18617                                    // it should never have a hover class, so remove it now.
18618                                    if (buttonEl.hasClass(theme.getClass('stateActive')) ||
18619                                        buttonEl.hasClass(theme.getClass('stateDisabled'))) {
18620                                        buttonEl.removeClass(theme.getClass('stateHover'));
18621                                    }
18622                                }
18623                            })
18624                                .mousedown(function () {
18625                                // the *down* effect (mouse pressed in).
18626                                // only on buttons that are not the "active" tab, or disabled
18627                                buttonEl
18628                                    .not('.' + theme.getClass('stateActive'))
18629                                    .not('.' + theme.getClass('stateDisabled'))
18630                                    .addClass(theme.getClass('stateDown'));
18631                            })
18632                                .mouseup(function () {
18633                                // undo the *down* effect
18634                                buttonEl.removeClass(theme.getClass('stateDown'));
18635                            })
18636                                .hover(function () {
18637                                // the *hover* effect.
18638                                // only on buttons that are not the "active" tab, or disabled
18639                                buttonEl
18640                                    .not('.' + theme.getClass('stateActive'))
18641                                    .not('.' + theme.getClass('stateDisabled'))
18642                                    .addClass(theme.getClass('stateHover'));
18643                            }, function () {
18644                                // undo the *hover* effect
18645                                buttonEl
18646                                    .removeClass(theme.getClass('stateHover'))
18647                                    .removeClass(theme.getClass('stateDown')); // if mouseleave happens before mouseup
18648                            });
18649                            groupChildren = groupChildren.add(buttonEl);
18650                        }
18651                    }
18652                });
18653                if (isOnlyButtons) {
18654                    groupChildren
18655                        .first().addClass(theme.getClass('cornerLeft')).end()
18656                        .last().addClass(theme.getClass('cornerRight')).end();
18657                }
18658                if (groupChildren.length > 1) {
18659                    groupEl = $('<div/>');
18660                    if (isOnlyButtons) {
18661                        groupEl.addClass(theme.getClass('buttonGroup'));
18662                    }
18663                    groupEl.append(groupChildren);
18664                    sectionEl.append(groupEl);
18665                }
18666                else {
18667                    sectionEl.append(groupChildren); // 1 or 0 children
18668                }
18669            });
18670        }
18671        return sectionEl;
18672    };
18673    Toolbar.prototype.updateTitle = function (text) {
18674        if (this.el) {
18675            this.el.find('h2').text(text);
18676        }
18677    };
18678    Toolbar.prototype.activateButton = function (buttonName) {
18679        if (this.el) {
18680            this.el.find('.fc-' + buttonName + '-button')
18681                .addClass(this.calendar.theme.getClass('stateActive'));
18682        }
18683    };
18684    Toolbar.prototype.deactivateButton = function (buttonName) {
18685        if (this.el) {
18686            this.el.find('.fc-' + buttonName + '-button')
18687                .removeClass(this.calendar.theme.getClass('stateActive'));
18688        }
18689    };
18690    Toolbar.prototype.disableButton = function (buttonName) {
18691        if (this.el) {
18692            this.el.find('.fc-' + buttonName + '-button')
18693                .prop('disabled', true)
18694                .addClass(this.calendar.theme.getClass('stateDisabled'));
18695        }
18696    };
18697    Toolbar.prototype.enableButton = function (buttonName) {
18698        if (this.el) {
18699            this.el.find('.fc-' + buttonName + '-button')
18700                .prop('disabled', false)
18701                .removeClass(this.calendar.theme.getClass('stateDisabled'));
18702        }
18703    };
18704    Toolbar.prototype.getViewsWithButtons = function () {
18705        return this.viewsWithButtons;
18706    };
18707    return Toolbar;
18708}());
18709exports.default = Toolbar;
18710
18711
18712/***/ }),
18713/* 240 */
18714/***/ (function(module, exports, __webpack_require__) {
18715
18716Object.defineProperty(exports, "__esModule", { value: true });
18717var tslib_1 = __webpack_require__(2);
18718var $ = __webpack_require__(3);
18719var util_1 = __webpack_require__(4);
18720var options_1 = __webpack_require__(31);
18721var locale_1 = __webpack_require__(30);
18722var Model_1 = __webpack_require__(48);
18723var OptionsManager = /** @class */ (function (_super) {
18724    tslib_1.__extends(OptionsManager, _super);
18725    function OptionsManager(_calendar, overrides) {
18726        var _this = _super.call(this) || this;
18727        _this._calendar = _calendar;
18728        _this.overrides = $.extend({}, overrides); // make a copy
18729        _this.dynamicOverrides = {};
18730        _this.compute();
18731        return _this;
18732    }
18733    OptionsManager.prototype.add = function (newOptionHash) {
18734        var optionCnt = 0;
18735        var optionName;
18736        this.recordOverrides(newOptionHash); // will trigger this model's watchers
18737        for (optionName in newOptionHash) {
18738            optionCnt++;
18739        }
18740        // special-case handling of single option change.
18741        // if only one option change, `optionName` will be its name.
18742        if (optionCnt === 1) {
18743            if (optionName === 'height' || optionName === 'contentHeight' || optionName === 'aspectRatio') {
18744                this._calendar.updateViewSize(true); // isResize=true
18745                return;
18746            }
18747            else if (optionName === 'defaultDate') {
18748                return; // can't change date this way. use gotoDate instead
18749            }
18750            else if (optionName === 'businessHours') {
18751                return; // this model already reacts to this
18752            }
18753            else if (/^(event|select)(Overlap|Constraint|Allow)$/.test(optionName)) {
18754                return; // doesn't affect rendering. only interactions.
18755            }
18756            else if (optionName === 'timezone') {
18757                this._calendar.view.flash('initialEvents');
18758                return;
18759            }
18760        }
18761        // catch-all. rerender the header and footer and rebuild/rerender the current view
18762        this._calendar.renderHeader();
18763        this._calendar.renderFooter();
18764        // even non-current views will be affected by this option change. do before rerender
18765        // TODO: detangle
18766        this._calendar.viewsByType = {};
18767        this._calendar.reinitView();
18768    };
18769    // Computes the flattened options hash for the calendar and assigns to `this.options`.
18770    // Assumes this.overrides and this.dynamicOverrides have already been initialized.
18771    OptionsManager.prototype.compute = function () {
18772        var locale;
18773        var localeDefaults;
18774        var isRTL;
18775        var dirDefaults;
18776        var rawOptions;
18777        locale = util_1.firstDefined(// explicit locale option given?
18778        this.dynamicOverrides.locale, this.overrides.locale);
18779        localeDefaults = locale_1.localeOptionHash[locale];
18780        if (!localeDefaults) {
18781            locale = options_1.globalDefaults.locale;
18782            localeDefaults = locale_1.localeOptionHash[locale] || {};
18783        }
18784        isRTL = util_1.firstDefined(// based on options computed so far, is direction RTL?
18785        this.dynamicOverrides.isRTL, this.overrides.isRTL, localeDefaults.isRTL, options_1.globalDefaults.isRTL);
18786        dirDefaults = isRTL ? options_1.rtlDefaults : {};
18787        this.dirDefaults = dirDefaults;
18788        this.localeDefaults = localeDefaults;
18789        rawOptions = options_1.mergeOptions([
18790            options_1.globalDefaults,
18791            dirDefaults,
18792            localeDefaults,
18793            this.overrides,
18794            this.dynamicOverrides
18795        ]);
18796        locale_1.populateInstanceComputableOptions(rawOptions); // fill in gaps with computed options
18797        this.reset(rawOptions);
18798    };
18799    // stores the new options internally, but does not rerender anything.
18800    OptionsManager.prototype.recordOverrides = function (newOptionHash) {
18801        var optionName;
18802        for (optionName in newOptionHash) {
18803            this.dynamicOverrides[optionName] = newOptionHash[optionName];
18804        }
18805        this._calendar.viewSpecManager.clearCache(); // the dynamic override invalidates the options in this cache, so just clear it
18806        this.compute(); // this.options needs to be recomputed after the dynamic override
18807    };
18808    return OptionsManager;
18809}(Model_1.default));
18810exports.default = OptionsManager;
18811
18812
18813/***/ }),
18814/* 241 */
18815/***/ (function(module, exports, __webpack_require__) {
18816
18817Object.defineProperty(exports, "__esModule", { value: true });
18818var moment = __webpack_require__(0);
18819var $ = __webpack_require__(3);
18820var ViewRegistry_1 = __webpack_require__(21);
18821var util_1 = __webpack_require__(4);
18822var options_1 = __webpack_require__(31);
18823var locale_1 = __webpack_require__(30);
18824var ViewSpecManager = /** @class */ (function () {
18825    function ViewSpecManager(optionsManager, _calendar) {
18826        this.optionsManager = optionsManager;
18827        this._calendar = _calendar;
18828        this.clearCache();
18829    }
18830    ViewSpecManager.prototype.clearCache = function () {
18831        this.viewSpecCache = {};
18832    };
18833    // Gets information about how to create a view. Will use a cache.
18834    ViewSpecManager.prototype.getViewSpec = function (viewType) {
18835        var cache = this.viewSpecCache;
18836        return cache[viewType] || (cache[viewType] = this.buildViewSpec(viewType));
18837    };
18838    // Given a duration singular unit, like "week" or "day", finds a matching view spec.
18839    // Preference is given to views that have corresponding buttons.
18840    ViewSpecManager.prototype.getUnitViewSpec = function (unit) {
18841        var viewTypes;
18842        var i;
18843        var spec;
18844        if ($.inArray(unit, util_1.unitsDesc) !== -1) {
18845            // put views that have buttons first. there will be duplicates, but oh well
18846            viewTypes = this._calendar.header.getViewsWithButtons(); // TODO: include footer as well?
18847            $.each(ViewRegistry_1.viewHash, function (viewType) {
18848                viewTypes.push(viewType);
18849            });
18850            for (i = 0; i < viewTypes.length; i++) {
18851                spec = this.getViewSpec(viewTypes[i]);
18852                if (spec) {
18853                    if (spec.singleUnit === unit) {
18854                        return spec;
18855                    }
18856                }
18857            }
18858        }
18859    };
18860    // Builds an object with information on how to create a given view
18861    ViewSpecManager.prototype.buildViewSpec = function (requestedViewType) {
18862        var viewOverrides = this.optionsManager.overrides.views || {};
18863        var specChain = []; // for the view. lowest to highest priority
18864        var defaultsChain = []; // for the view. lowest to highest priority
18865        var overridesChain = []; // for the view. lowest to highest priority
18866        var viewType = requestedViewType;
18867        var spec; // for the view
18868        var overrides; // for the view
18869        var durationInput;
18870        var duration;
18871        var unit;
18872        // iterate from the specific view definition to a more general one until we hit an actual View class
18873        while (viewType) {
18874            spec = ViewRegistry_1.viewHash[viewType];
18875            overrides = viewOverrides[viewType];
18876            viewType = null; // clear. might repopulate for another iteration
18877            if (typeof spec === 'function') {
18878                spec = { 'class': spec };
18879            }
18880            if (spec) {
18881                specChain.unshift(spec);
18882                defaultsChain.unshift(spec.defaults || {});
18883                durationInput = durationInput || spec.duration;
18884                viewType = viewType || spec.type;
18885            }
18886            if (overrides) {
18887                overridesChain.unshift(overrides); // view-specific option hashes have options at zero-level
18888                durationInput = durationInput || overrides.duration;
18889                viewType = viewType || overrides.type;
18890            }
18891        }
18892        spec = util_1.mergeProps(specChain);
18893        spec.type = requestedViewType;
18894        if (!spec['class']) {
18895            return false;
18896        }
18897        // fall back to top-level `duration` option
18898        durationInput = durationInput ||
18899            this.optionsManager.dynamicOverrides.duration ||
18900            this.optionsManager.overrides.duration;
18901        if (durationInput) {
18902            duration = moment.duration(durationInput);
18903            if (duration.valueOf()) {
18904                unit = util_1.computeDurationGreatestUnit(duration, durationInput);
18905                spec.duration = duration;
18906                spec.durationUnit = unit;
18907                // view is a single-unit duration, like "week" or "day"
18908                // incorporate options for this. lowest priority
18909                if (duration.as(unit) === 1) {
18910                    spec.singleUnit = unit;
18911                    overridesChain.unshift(viewOverrides[unit] || {});
18912                }
18913            }
18914        }
18915        spec.defaults = options_1.mergeOptions(defaultsChain);
18916        spec.overrides = options_1.mergeOptions(overridesChain);
18917        this.buildViewSpecOptions(spec);
18918        this.buildViewSpecButtonText(spec, requestedViewType);
18919        return spec;
18920    };
18921    // Builds and assigns a view spec's options object from its already-assigned defaults and overrides
18922    ViewSpecManager.prototype.buildViewSpecOptions = function (spec) {
18923        var optionsManager = this.optionsManager;
18924        spec.options = options_1.mergeOptions([
18925            options_1.globalDefaults,
18926            spec.defaults,
18927            optionsManager.dirDefaults,
18928            optionsManager.localeDefaults,
18929            optionsManager.overrides,
18930            spec.overrides,
18931            optionsManager.dynamicOverrides // dynamically set via setter. highest precedence
18932        ]);
18933        locale_1.populateInstanceComputableOptions(spec.options);
18934    };
18935    // Computes and assigns a view spec's buttonText-related options
18936    ViewSpecManager.prototype.buildViewSpecButtonText = function (spec, requestedViewType) {
18937        var optionsManager = this.optionsManager;
18938        // given an options object with a possible `buttonText` hash, lookup the buttonText for the
18939        // requested view, falling back to a generic unit entry like "week" or "day"
18940        function queryButtonText(options) {
18941            var buttonText = options.buttonText || {};
18942            return buttonText[requestedViewType] ||
18943                // view can decide to look up a certain key
18944                (spec.buttonTextKey ? buttonText[spec.buttonTextKey] : null) ||
18945                // a key like "month"
18946                (spec.singleUnit ? buttonText[spec.singleUnit] : null);
18947        }
18948        // highest to lowest priority
18949        spec.buttonTextOverride =
18950            queryButtonText(optionsManager.dynamicOverrides) ||
18951                queryButtonText(optionsManager.overrides) || // constructor-specified buttonText lookup hash takes precedence
18952                spec.overrides.buttonText; // `buttonText` for view-specific options is a string
18953        // highest to lowest priority. mirrors buildViewSpecOptions
18954        spec.buttonTextDefault =
18955            queryButtonText(optionsManager.localeDefaults) ||
18956                queryButtonText(optionsManager.dirDefaults) ||
18957                spec.defaults.buttonText || // a single string. from ViewSubclass.defaults
18958                queryButtonText(options_1.globalDefaults) ||
18959                (spec.duration ? this._calendar.humanizeDuration(spec.duration) : null) || // like "3 days"
18960                requestedViewType; // fall back to given view name
18961    };
18962    return ViewSpecManager;
18963}());
18964exports.default = ViewSpecManager;
18965
18966
18967/***/ }),
18968/* 242 */
18969/***/ (function(module, exports, __webpack_require__) {
18970
18971Object.defineProperty(exports, "__esModule", { value: true });
18972var $ = __webpack_require__(3);
18973var util_1 = __webpack_require__(4);
18974var EventPeriod_1 = __webpack_require__(243);
18975var ArrayEventSource_1 = __webpack_require__(52);
18976var EventSource_1 = __webpack_require__(6);
18977var EventSourceParser_1 = __webpack_require__(37);
18978var SingleEventDef_1 = __webpack_require__(13);
18979var EventInstanceGroup_1 = __webpack_require__(19);
18980var EmitterMixin_1 = __webpack_require__(11);
18981var ListenerMixin_1 = __webpack_require__(7);
18982var EventManager = /** @class */ (function () {
18983    function EventManager(calendar) {
18984        this.calendar = calendar;
18985        this.stickySource = new ArrayEventSource_1.default(calendar);
18986        this.otherSources = [];
18987    }
18988    EventManager.prototype.requestEvents = function (start, end, timezone, force) {
18989        if (force ||
18990            !this.currentPeriod ||
18991            !this.currentPeriod.isWithinRange(start, end) ||
18992            timezone !== this.currentPeriod.timezone) {
18993            this.setPeriod(// will change this.currentPeriod
18994            new EventPeriod_1.default(start, end, timezone));
18995        }
18996        return this.currentPeriod.whenReleased();
18997    };
18998    // Source Adding/Removing
18999    // -----------------------------------------------------------------------------------------------------------------
19000    EventManager.prototype.addSource = function (eventSource) {
19001        this.otherSources.push(eventSource);
19002        if (this.currentPeriod) {
19003            this.currentPeriod.requestSource(eventSource); // might release
19004        }
19005    };
19006    EventManager.prototype.removeSource = function (doomedSource) {
19007        util_1.removeExact(this.otherSources, doomedSource);
19008        if (this.currentPeriod) {
19009            this.currentPeriod.purgeSource(doomedSource); // might release
19010        }
19011    };
19012    EventManager.prototype.removeAllSources = function () {
19013        this.otherSources = [];
19014        if (this.currentPeriod) {
19015            this.currentPeriod.purgeAllSources(); // might release
19016        }
19017    };
19018    // Source Refetching
19019    // -----------------------------------------------------------------------------------------------------------------
19020    EventManager.prototype.refetchSource = function (eventSource) {
19021        var currentPeriod = this.currentPeriod;
19022        if (currentPeriod) {
19023            currentPeriod.freeze();
19024            currentPeriod.purgeSource(eventSource);
19025            currentPeriod.requestSource(eventSource);
19026            currentPeriod.thaw();
19027        }
19028    };
19029    EventManager.prototype.refetchAllSources = function () {
19030        var currentPeriod = this.currentPeriod;
19031        if (currentPeriod) {
19032            currentPeriod.freeze();
19033            currentPeriod.purgeAllSources();
19034            currentPeriod.requestSources(this.getSources());
19035            currentPeriod.thaw();
19036        }
19037    };
19038    // Source Querying
19039    // -----------------------------------------------------------------------------------------------------------------
19040    EventManager.prototype.getSources = function () {
19041        return [this.stickySource].concat(this.otherSources);
19042    };
19043    // like querySources, but accepts multple match criteria (like multiple IDs)
19044    EventManager.prototype.multiQuerySources = function (matchInputs) {
19045        // coerce into an array
19046        if (!matchInputs) {
19047            matchInputs = [];
19048        }
19049        else if (!$.isArray(matchInputs)) {
19050            matchInputs = [matchInputs];
19051        }
19052        var matchingSources = [];
19053        var i;
19054        // resolve raw inputs to real event source objects
19055        for (i = 0; i < matchInputs.length; i++) {
19056            matchingSources.push.apply(// append
19057            matchingSources, this.querySources(matchInputs[i]));
19058        }
19059        return matchingSources;
19060    };
19061    // matchInput can either by a real event source object, an ID, or the function/URL for the source.
19062    // returns an array of matching source objects.
19063    EventManager.prototype.querySources = function (matchInput) {
19064        var sources = this.otherSources;
19065        var i;
19066        var source;
19067        // given a proper event source object
19068        for (i = 0; i < sources.length; i++) {
19069            source = sources[i];
19070            if (source === matchInput) {
19071                return [source];
19072            }
19073        }
19074        // an ID match
19075        source = this.getSourceById(EventSource_1.default.normalizeId(matchInput));
19076        if (source) {
19077            return [source];
19078        }
19079        // parse as an event source
19080        matchInput = EventSourceParser_1.default.parse(matchInput, this.calendar);
19081        if (matchInput) {
19082            return $.grep(sources, function (source) {
19083                return isSourcesEquivalent(matchInput, source);
19084            });
19085        }
19086    };
19087    /*
19088    ID assumed to already be normalized
19089    */
19090    EventManager.prototype.getSourceById = function (id) {
19091        return $.grep(this.otherSources, function (source) {
19092            return source.id && source.id === id;
19093        })[0];
19094    };
19095    // Event-Period
19096    // -----------------------------------------------------------------------------------------------------------------
19097    EventManager.prototype.setPeriod = function (eventPeriod) {
19098        if (this.currentPeriod) {
19099            this.unbindPeriod(this.currentPeriod);
19100            this.currentPeriod = null;
19101        }
19102        this.currentPeriod = eventPeriod;
19103        this.bindPeriod(eventPeriod);
19104        eventPeriod.requestSources(this.getSources());
19105    };
19106    EventManager.prototype.bindPeriod = function (eventPeriod) {
19107        this.listenTo(eventPeriod, 'release', function (eventsPayload) {
19108            this.trigger('release', eventsPayload);
19109        });
19110    };
19111    EventManager.prototype.unbindPeriod = function (eventPeriod) {
19112        this.stopListeningTo(eventPeriod);
19113    };
19114    // Event Getting/Adding/Removing
19115    // -----------------------------------------------------------------------------------------------------------------
19116    EventManager.prototype.getEventDefByUid = function (uid) {
19117        if (this.currentPeriod) {
19118            return this.currentPeriod.getEventDefByUid(uid);
19119        }
19120    };
19121    EventManager.prototype.addEventDef = function (eventDef, isSticky) {
19122        if (isSticky) {
19123            this.stickySource.addEventDef(eventDef);
19124        }
19125        if (this.currentPeriod) {
19126            this.currentPeriod.addEventDef(eventDef); // might release
19127        }
19128    };
19129    EventManager.prototype.removeEventDefsById = function (eventId) {
19130        this.getSources().forEach(function (eventSource) {
19131            eventSource.removeEventDefsById(eventId);
19132        });
19133        if (this.currentPeriod) {
19134            this.currentPeriod.removeEventDefsById(eventId); // might release
19135        }
19136    };
19137    EventManager.prototype.removeAllEventDefs = function () {
19138        this.getSources().forEach(function (eventSource) {
19139            eventSource.removeAllEventDefs();
19140        });
19141        if (this.currentPeriod) {
19142            this.currentPeriod.removeAllEventDefs();
19143        }
19144    };
19145    // Event Mutating
19146    // -----------------------------------------------------------------------------------------------------------------
19147    /*
19148    Returns an undo function.
19149    */
19150    EventManager.prototype.mutateEventsWithId = function (eventDefId, eventDefMutation) {
19151        var currentPeriod = this.currentPeriod;
19152        var eventDefs;
19153        var undoFuncs = [];
19154        if (currentPeriod) {
19155            currentPeriod.freeze();
19156            eventDefs = currentPeriod.getEventDefsById(eventDefId);
19157            eventDefs.forEach(function (eventDef) {
19158                // add/remove esp because id might change
19159                currentPeriod.removeEventDef(eventDef);
19160                undoFuncs.push(eventDefMutation.mutateSingle(eventDef));
19161                currentPeriod.addEventDef(eventDef);
19162            });
19163            currentPeriod.thaw();
19164            return function () {
19165                currentPeriod.freeze();
19166                for (var i = 0; i < eventDefs.length; i++) {
19167                    currentPeriod.removeEventDef(eventDefs[i]);
19168                    undoFuncs[i]();
19169                    currentPeriod.addEventDef(eventDefs[i]);
19170                }
19171                currentPeriod.thaw();
19172            };
19173        }
19174        return function () { };
19175    };
19176    /*
19177    copies and then mutates
19178    */
19179    EventManager.prototype.buildMutatedEventInstanceGroup = function (eventDefId, eventDefMutation) {
19180        var eventDefs = this.getEventDefsById(eventDefId);
19181        var i;
19182        var defCopy;
19183        var allInstances = [];
19184        for (i = 0; i < eventDefs.length; i++) {
19185            defCopy = eventDefs[i].clone();
19186            if (defCopy instanceof SingleEventDef_1.default) {
19187                eventDefMutation.mutateSingle(defCopy);
19188                allInstances.push.apply(allInstances, // append
19189                defCopy.buildInstances());
19190            }
19191        }
19192        return new EventInstanceGroup_1.default(allInstances);
19193    };
19194    // Freezing
19195    // -----------------------------------------------------------------------------------------------------------------
19196    EventManager.prototype.freeze = function () {
19197        if (this.currentPeriod) {
19198            this.currentPeriod.freeze();
19199        }
19200    };
19201    EventManager.prototype.thaw = function () {
19202        if (this.currentPeriod) {
19203            this.currentPeriod.thaw();
19204        }
19205    };
19206    // methods that simply forward to EventPeriod
19207    EventManager.prototype.getEventDefsById = function (eventDefId) {
19208        return this.currentPeriod.getEventDefsById(eventDefId);
19209    };
19210    EventManager.prototype.getEventInstances = function () {
19211        return this.currentPeriod.getEventInstances();
19212    };
19213    EventManager.prototype.getEventInstancesWithId = function (eventDefId) {
19214        return this.currentPeriod.getEventInstancesWithId(eventDefId);
19215    };
19216    EventManager.prototype.getEventInstancesWithoutId = function (eventDefId) {
19217        return this.currentPeriod.getEventInstancesWithoutId(eventDefId);
19218    };
19219    return EventManager;
19220}());
19221exports.default = EventManager;
19222EmitterMixin_1.default.mixInto(EventManager);
19223ListenerMixin_1.default.mixInto(EventManager);
19224function isSourcesEquivalent(source0, source1) {
19225    return source0.getPrimitive() === source1.getPrimitive();
19226}
19227
19228
19229/***/ }),
19230/* 243 */
19231/***/ (function(module, exports, __webpack_require__) {
19232
19233Object.defineProperty(exports, "__esModule", { value: true });
19234var $ = __webpack_require__(3);
19235var util_1 = __webpack_require__(4);
19236var Promise_1 = __webpack_require__(20);
19237var EmitterMixin_1 = __webpack_require__(11);
19238var UnzonedRange_1 = __webpack_require__(5);
19239var EventInstanceGroup_1 = __webpack_require__(19);
19240var EventPeriod = /** @class */ (function () {
19241    function EventPeriod(start, end, timezone) {
19242        this.pendingCnt = 0;
19243        this.freezeDepth = 0;
19244        this.stuntedReleaseCnt = 0;
19245        this.releaseCnt = 0;
19246        this.start = start;
19247        this.end = end;
19248        this.timezone = timezone;
19249        this.unzonedRange = new UnzonedRange_1.default(start.clone().stripZone(), end.clone().stripZone());
19250        this.requestsByUid = {};
19251        this.eventDefsByUid = {};
19252        this.eventDefsById = {};
19253        this.eventInstanceGroupsById = {};
19254    }
19255    EventPeriod.prototype.isWithinRange = function (start, end) {
19256        // TODO: use a range util function?
19257        return !start.isBefore(this.start) && !end.isAfter(this.end);
19258    };
19259    // Requesting and Purging
19260    // -----------------------------------------------------------------------------------------------------------------
19261    EventPeriod.prototype.requestSources = function (sources) {
19262        this.freeze();
19263        for (var i = 0; i < sources.length; i++) {
19264            this.requestSource(sources[i]);
19265        }
19266        this.thaw();
19267    };
19268    EventPeriod.prototype.requestSource = function (source) {
19269        var _this = this;
19270        var request = { source: source, status: 'pending', eventDefs: null };
19271        this.requestsByUid[source.uid] = request;
19272        this.pendingCnt += 1;
19273        source.fetch(this.start, this.end, this.timezone).then(function (eventDefs) {
19274            if (request.status !== 'cancelled') {
19275                request.status = 'completed';
19276                request.eventDefs = eventDefs;
19277                _this.addEventDefs(eventDefs);
19278                _this.pendingCnt--;
19279                _this.tryRelease();
19280            }
19281        }, function () {
19282            if (request.status !== 'cancelled') {
19283                request.status = 'failed';
19284                _this.pendingCnt--;
19285                _this.tryRelease();
19286            }
19287        });
19288    };
19289    EventPeriod.prototype.purgeSource = function (source) {
19290        var request = this.requestsByUid[source.uid];
19291        if (request) {
19292            delete this.requestsByUid[source.uid];
19293            if (request.status === 'pending') {
19294                request.status = 'cancelled';
19295                this.pendingCnt--;
19296                this.tryRelease();
19297            }
19298            else if (request.status === 'completed') {
19299                request.eventDefs.forEach(this.removeEventDef.bind(this));
19300            }
19301        }
19302    };
19303    EventPeriod.prototype.purgeAllSources = function () {
19304        var requestsByUid = this.requestsByUid;
19305        var uid;
19306        var request;
19307        var completedCnt = 0;
19308        for (uid in requestsByUid) {
19309            request = requestsByUid[uid];
19310            if (request.status === 'pending') {
19311                request.status = 'cancelled';
19312            }
19313            else if (request.status === 'completed') {
19314                completedCnt++;
19315            }
19316        }
19317        this.requestsByUid = {};
19318        this.pendingCnt = 0;
19319        if (completedCnt) {
19320            this.removeAllEventDefs(); // might release
19321        }
19322    };
19323    // Event Definitions
19324    // -----------------------------------------------------------------------------------------------------------------
19325    EventPeriod.prototype.getEventDefByUid = function (eventDefUid) {
19326        return this.eventDefsByUid[eventDefUid];
19327    };
19328    EventPeriod.prototype.getEventDefsById = function (eventDefId) {
19329        var a = this.eventDefsById[eventDefId];
19330        if (a) {
19331            return a.slice(); // clone
19332        }
19333        return [];
19334    };
19335    EventPeriod.prototype.addEventDefs = function (eventDefs) {
19336        for (var i = 0; i < eventDefs.length; i++) {
19337            this.addEventDef(eventDefs[i]);
19338        }
19339    };
19340    EventPeriod.prototype.addEventDef = function (eventDef) {
19341        var eventDefsById = this.eventDefsById;
19342        var eventDefId = eventDef.id;
19343        var eventDefs = eventDefsById[eventDefId] || (eventDefsById[eventDefId] = []);
19344        var eventInstances = eventDef.buildInstances(this.unzonedRange);
19345        var i;
19346        eventDefs.push(eventDef);
19347        this.eventDefsByUid[eventDef.uid] = eventDef;
19348        for (i = 0; i < eventInstances.length; i++) {
19349            this.addEventInstance(eventInstances[i], eventDefId);
19350        }
19351    };
19352    EventPeriod.prototype.removeEventDefsById = function (eventDefId) {
19353        var _this = this;
19354        this.getEventDefsById(eventDefId).forEach(function (eventDef) {
19355            _this.removeEventDef(eventDef);
19356        });
19357    };
19358    EventPeriod.prototype.removeAllEventDefs = function () {
19359        var isEmpty = $.isEmptyObject(this.eventDefsByUid);
19360        this.eventDefsByUid = {};
19361        this.eventDefsById = {};
19362        this.eventInstanceGroupsById = {};
19363        if (!isEmpty) {
19364            this.tryRelease();
19365        }
19366    };
19367    EventPeriod.prototype.removeEventDef = function (eventDef) {
19368        var eventDefsById = this.eventDefsById;
19369        var eventDefs = eventDefsById[eventDef.id];
19370        delete this.eventDefsByUid[eventDef.uid];
19371        if (eventDefs) {
19372            util_1.removeExact(eventDefs, eventDef);
19373            if (!eventDefs.length) {
19374                delete eventDefsById[eventDef.id];
19375            }
19376            this.removeEventInstancesForDef(eventDef);
19377        }
19378    };
19379    // Event Instances
19380    // -----------------------------------------------------------------------------------------------------------------
19381    EventPeriod.prototype.getEventInstances = function () {
19382        var eventInstanceGroupsById = this.eventInstanceGroupsById;
19383        var eventInstances = [];
19384        var id;
19385        for (id in eventInstanceGroupsById) {
19386            eventInstances.push.apply(eventInstances, // append
19387            eventInstanceGroupsById[id].eventInstances);
19388        }
19389        return eventInstances;
19390    };
19391    EventPeriod.prototype.getEventInstancesWithId = function (eventDefId) {
19392        var eventInstanceGroup = this.eventInstanceGroupsById[eventDefId];
19393        if (eventInstanceGroup) {
19394            return eventInstanceGroup.eventInstances.slice(); // clone
19395        }
19396        return [];
19397    };
19398    EventPeriod.prototype.getEventInstancesWithoutId = function (eventDefId) {
19399        var eventInstanceGroupsById = this.eventInstanceGroupsById;
19400        var matchingInstances = [];
19401        var id;
19402        for (id in eventInstanceGroupsById) {
19403            if (id !== eventDefId) {
19404                matchingInstances.push.apply(matchingInstances, // append
19405                eventInstanceGroupsById[id].eventInstances);
19406            }
19407        }
19408        return matchingInstances;
19409    };
19410    EventPeriod.prototype.addEventInstance = function (eventInstance, eventDefId) {
19411        var eventInstanceGroupsById = this.eventInstanceGroupsById;
19412        var eventInstanceGroup = eventInstanceGroupsById[eventDefId] ||
19413            (eventInstanceGroupsById[eventDefId] = new EventInstanceGroup_1.default());
19414        eventInstanceGroup.eventInstances.push(eventInstance);
19415        this.tryRelease();
19416    };
19417    EventPeriod.prototype.removeEventInstancesForDef = function (eventDef) {
19418        var eventInstanceGroupsById = this.eventInstanceGroupsById;
19419        var eventInstanceGroup = eventInstanceGroupsById[eventDef.id];
19420        var removeCnt;
19421        if (eventInstanceGroup) {
19422            removeCnt = util_1.removeMatching(eventInstanceGroup.eventInstances, function (currentEventInstance) {
19423                return currentEventInstance.def === eventDef;
19424            });
19425            if (!eventInstanceGroup.eventInstances.length) {
19426                delete eventInstanceGroupsById[eventDef.id];
19427            }
19428            if (removeCnt) {
19429                this.tryRelease();
19430            }
19431        }
19432    };
19433    // Releasing and Freezing
19434    // -----------------------------------------------------------------------------------------------------------------
19435    EventPeriod.prototype.tryRelease = function () {
19436        if (!this.pendingCnt) {
19437            if (!this.freezeDepth) {
19438                this.release();
19439            }
19440            else {
19441                this.stuntedReleaseCnt++;
19442            }
19443        }
19444    };
19445    EventPeriod.prototype.release = function () {
19446        this.releaseCnt++;
19447        this.trigger('release', this.eventInstanceGroupsById);
19448    };
19449    EventPeriod.prototype.whenReleased = function () {
19450        var _this = this;
19451        if (this.releaseCnt) {
19452            return Promise_1.default.resolve(this.eventInstanceGroupsById);
19453        }
19454        else {
19455            return Promise_1.default.construct(function (onResolve) {
19456                _this.one('release', onResolve);
19457            });
19458        }
19459    };
19460    EventPeriod.prototype.freeze = function () {
19461        if (!(this.freezeDepth++)) {
19462            this.stuntedReleaseCnt = 0;
19463        }
19464    };
19465    EventPeriod.prototype.thaw = function () {
19466        if (!(--this.freezeDepth) && this.stuntedReleaseCnt && !this.pendingCnt) {
19467            this.release();
19468        }
19469    };
19470    return EventPeriod;
19471}());
19472exports.default = EventPeriod;
19473EmitterMixin_1.default.mixInto(EventPeriod);
19474
19475
19476/***/ }),
19477/* 244 */
19478/***/ (function(module, exports, __webpack_require__) {
19479
19480Object.defineProperty(exports, "__esModule", { value: true });
19481var $ = __webpack_require__(3);
19482var util_1 = __webpack_require__(4);
19483var ListenerMixin_1 = __webpack_require__(7);
19484/* Creates a clone of an element and lets it track the mouse as it moves
19485----------------------------------------------------------------------------------------------------------------------*/
19486var MouseFollower = /** @class */ (function () {
19487    function MouseFollower(sourceEl, options) {
19488        this.isFollowing = false;
19489        this.isHidden = false;
19490        this.isAnimating = false; // doing the revert animation?
19491        this.options = options = options || {};
19492        this.sourceEl = sourceEl;
19493        this.parentEl = options.parentEl ? $(options.parentEl) : sourceEl.parent(); // default to sourceEl's parent
19494    }
19495    // Causes the element to start following the mouse
19496    MouseFollower.prototype.start = function (ev) {
19497        if (!this.isFollowing) {
19498            this.isFollowing = true;
19499            this.y0 = util_1.getEvY(ev);
19500            this.x0 = util_1.getEvX(ev);
19501            this.topDelta = 0;
19502            this.leftDelta = 0;
19503            if (!this.isHidden) {
19504                this.updatePosition();
19505            }
19506            if (util_1.getEvIsTouch(ev)) {
19507                this.listenTo($(document), 'touchmove', this.handleMove);
19508            }
19509            else {
19510                this.listenTo($(document), 'mousemove', this.handleMove);
19511            }
19512        }
19513    };
19514    // Causes the element to stop following the mouse. If shouldRevert is true, will animate back to original position.
19515    // `callback` gets invoked when the animation is complete. If no animation, it is invoked immediately.
19516    MouseFollower.prototype.stop = function (shouldRevert, callback) {
19517        var _this = this;
19518        var revertDuration = this.options.revertDuration;
19519        var complete = function () {
19520            _this.isAnimating = false;
19521            _this.removeElement();
19522            _this.top0 = _this.left0 = null; // reset state for future updatePosition calls
19523            if (callback) {
19524                callback();
19525            }
19526        };
19527        if (this.isFollowing && !this.isAnimating) {
19528            this.isFollowing = false;
19529            this.stopListeningTo($(document));
19530            if (shouldRevert && revertDuration && !this.isHidden) {
19531                this.isAnimating = true;
19532                this.el.animate({
19533                    top: this.top0,
19534                    left: this.left0
19535                }, {
19536                    duration: revertDuration,
19537                    complete: complete
19538                });
19539            }
19540            else {
19541                complete();
19542            }
19543        }
19544    };
19545    // Gets the tracking element. Create it if necessary
19546    MouseFollower.prototype.getEl = function () {
19547        var el = this.el;
19548        if (!el) {
19549            el = this.el = this.sourceEl.clone()
19550                .addClass(this.options.additionalClass || '')
19551                .css({
19552                position: 'absolute',
19553                visibility: '',
19554                display: this.isHidden ? 'none' : '',
19555                margin: 0,
19556                right: 'auto',
19557                bottom: 'auto',
19558                width: this.sourceEl.width(),
19559                height: this.sourceEl.height(),
19560                opacity: this.options.opacity || '',
19561                zIndex: this.options.zIndex
19562            });
19563            // we don't want long taps or any mouse interaction causing selection/menus.
19564            // would use preventSelection(), but that prevents selectstart, causing problems.
19565            el.addClass('fc-unselectable');
19566            el.appendTo(this.parentEl);
19567        }
19568        return el;
19569    };
19570    // Removes the tracking element if it has already been created
19571    MouseFollower.prototype.removeElement = function () {
19572        if (this.el) {
19573            this.el.remove();
19574            this.el = null;
19575        }
19576    };
19577    // Update the CSS position of the tracking element
19578    MouseFollower.prototype.updatePosition = function () {
19579        var sourceOffset;
19580        var origin;
19581        this.getEl(); // ensure this.el
19582        // make sure origin info was computed
19583        if (this.top0 == null) {
19584            sourceOffset = this.sourceEl.offset();
19585            origin = this.el.offsetParent().offset();
19586            this.top0 = sourceOffset.top - origin.top;
19587            this.left0 = sourceOffset.left - origin.left;
19588        }
19589        this.el.css({
19590            top: this.top0 + this.topDelta,
19591            left: this.left0 + this.leftDelta
19592        });
19593    };
19594    // Gets called when the user moves the mouse
19595    MouseFollower.prototype.handleMove = function (ev) {
19596        this.topDelta = util_1.getEvY(ev) - this.y0;
19597        this.leftDelta = util_1.getEvX(ev) - this.x0;
19598        if (!this.isHidden) {
19599            this.updatePosition();
19600        }
19601    };
19602    // Temporarily makes the tracking element invisible. Can be called before following starts
19603    MouseFollower.prototype.hide = function () {
19604        if (!this.isHidden) {
19605            this.isHidden = true;
19606            if (this.el) {
19607                this.el.hide();
19608            }
19609        }
19610    };
19611    // Show the tracking element after it has been temporarily hidden
19612    MouseFollower.prototype.show = function () {
19613        if (this.isHidden) {
19614            this.isHidden = false;
19615            this.updatePosition();
19616            this.getEl().show();
19617        }
19618    };
19619    return MouseFollower;
19620}());
19621exports.default = MouseFollower;
19622ListenerMixin_1.default.mixInto(MouseFollower);
19623
19624
19625/***/ }),
19626/* 245 */
19627/***/ (function(module, exports, __webpack_require__) {
19628
19629Object.defineProperty(exports, "__esModule", { value: true });
19630var tslib_1 = __webpack_require__(2);
19631var HitDragListener_1 = __webpack_require__(22);
19632var Interaction_1 = __webpack_require__(16);
19633var DateClicking = /** @class */ (function (_super) {
19634    tslib_1.__extends(DateClicking, _super);
19635    /*
19636    component must implement:
19637      - bindDateHandlerToEl
19638      - getSafeHitFootprint
19639      - getHitEl
19640    */
19641    function DateClicking(component) {
19642        var _this = _super.call(this, component) || this;
19643        _this.dragListener = _this.buildDragListener();
19644        return _this;
19645    }
19646    DateClicking.prototype.end = function () {
19647        this.dragListener.endInteraction();
19648    };
19649    DateClicking.prototype.bindToEl = function (el) {
19650        var component = this.component;
19651        var dragListener = this.dragListener;
19652        component.bindDateHandlerToEl(el, 'mousedown', function (ev) {
19653            if (!component.shouldIgnoreMouse()) {
19654                dragListener.startInteraction(ev);
19655            }
19656        });
19657        component.bindDateHandlerToEl(el, 'touchstart', function (ev) {
19658            if (!component.shouldIgnoreTouch()) {
19659                dragListener.startInteraction(ev);
19660            }
19661        });
19662    };
19663    // Creates a listener that tracks the user's drag across day elements, for day clicking.
19664    DateClicking.prototype.buildDragListener = function () {
19665        var _this = this;
19666        var component = this.component;
19667        var dayClickHit; // null if invalid dayClick
19668        var dragListener = new HitDragListener_1.default(component, {
19669            scroll: this.opt('dragScroll'),
19670            interactionStart: function () {
19671                dayClickHit = dragListener.origHit;
19672            },
19673            hitOver: function (hit, isOrig, origHit) {
19674                // if user dragged to another cell at any point, it can no longer be a dayClick
19675                if (!isOrig) {
19676                    dayClickHit = null;
19677                }
19678            },
19679            hitOut: function () {
19680                dayClickHit = null;
19681            },
19682            interactionEnd: function (ev, isCancelled) {
19683                var componentFootprint;
19684                if (!isCancelled && dayClickHit) {
19685                    componentFootprint = component.getSafeHitFootprint(dayClickHit);
19686                    if (componentFootprint) {
19687                        _this.view.triggerDayClick(componentFootprint, component.getHitEl(dayClickHit), ev);
19688                    }
19689                }
19690            }
19691        });
19692        // because dragListener won't be called with any time delay, "dragging" will begin immediately,
19693        // which will kill any touchmoving/scrolling. Prevent this.
19694        dragListener.shouldCancelTouchScroll = false;
19695        dragListener.scrollAlwaysKills = true;
19696        return dragListener;
19697    };
19698    return DateClicking;
19699}(Interaction_1.default));
19700exports.default = DateClicking;
19701
19702
19703/***/ }),
19704/* 246 */
19705/***/ (function(module, exports, __webpack_require__) {
19706
19707Object.defineProperty(exports, "__esModule", { value: true });
19708var tslib_1 = __webpack_require__(2);
19709var util_1 = __webpack_require__(4);
19710var EventRenderer_1 = __webpack_require__(42);
19711/*
19712Only handles foreground segs.
19713Does not own rendering. Use for low-level util methods by TimeGrid.
19714*/
19715var TimeGridEventRenderer = /** @class */ (function (_super) {
19716    tslib_1.__extends(TimeGridEventRenderer, _super);
19717    function TimeGridEventRenderer(timeGrid, fillRenderer) {
19718        var _this = _super.call(this, timeGrid, fillRenderer) || this;
19719        _this.timeGrid = timeGrid;
19720        return _this;
19721    }
19722    TimeGridEventRenderer.prototype.renderFgSegs = function (segs) {
19723        this.renderFgSegsIntoContainers(segs, this.timeGrid.fgContainerEls);
19724    };
19725    // Given an array of foreground segments, render a DOM element for each, computes position,
19726    // and attaches to the column inner-container elements.
19727    TimeGridEventRenderer.prototype.renderFgSegsIntoContainers = function (segs, containerEls) {
19728        var segsByCol;
19729        var col;
19730        segsByCol = this.timeGrid.groupSegsByCol(segs);
19731        for (col = 0; col < this.timeGrid.colCnt; col++) {
19732            this.updateFgSegCoords(segsByCol[col]);
19733        }
19734        this.timeGrid.attachSegsByCol(segsByCol, containerEls);
19735    };
19736    TimeGridEventRenderer.prototype.unrenderFgSegs = function () {
19737        if (this.fgSegs) {
19738            this.fgSegs.forEach(function (seg) {
19739                seg.el.remove();
19740            });
19741        }
19742    };
19743    // Computes a default event time formatting string if `timeFormat` is not explicitly defined
19744    TimeGridEventRenderer.prototype.computeEventTimeFormat = function () {
19745        return this.opt('noMeridiemTimeFormat'); // like "6:30" (no AM/PM)
19746    };
19747    // Computes a default `displayEventEnd` value if one is not expliclty defined
19748    TimeGridEventRenderer.prototype.computeDisplayEventEnd = function () {
19749        return true;
19750    };
19751    // Renders the HTML for a single event segment's default rendering
19752    TimeGridEventRenderer.prototype.fgSegHtml = function (seg, disableResizing) {
19753        var view = this.view;
19754        var calendar = view.calendar;
19755        var componentFootprint = seg.footprint.componentFootprint;
19756        var isAllDay = componentFootprint.isAllDay;
19757        var eventDef = seg.footprint.eventDef;
19758        var isDraggable = view.isEventDefDraggable(eventDef);
19759        var isResizableFromStart = !disableResizing && seg.isStart && view.isEventDefResizableFromStart(eventDef);
19760        var isResizableFromEnd = !disableResizing && seg.isEnd && view.isEventDefResizableFromEnd(eventDef);
19761        var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd);
19762        var skinCss = util_1.cssToStr(this.getSkinCss(eventDef));
19763        var timeText;
19764        var fullTimeText; // more verbose time text. for the print stylesheet
19765        var startTimeText; // just the start time text
19766        classes.unshift('fc-time-grid-event', 'fc-v-event');
19767        // if the event appears to span more than one day...
19768        if (view.isMultiDayRange(componentFootprint.unzonedRange)) {
19769            // Don't display time text on segments that run entirely through a day.
19770            // That would appear as midnight-midnight and would look dumb.
19771            // Otherwise, display the time text for the *segment's* times (like 6pm-midnight or midnight-10am)
19772            if (seg.isStart || seg.isEnd) {
19773                var zonedStart = calendar.msToMoment(seg.startMs);
19774                var zonedEnd = calendar.msToMoment(seg.endMs);
19775                timeText = this._getTimeText(zonedStart, zonedEnd, isAllDay);
19776                fullTimeText = this._getTimeText(zonedStart, zonedEnd, isAllDay, 'LT');
19777                startTimeText = this._getTimeText(zonedStart, zonedEnd, isAllDay, null, false); // displayEnd=false
19778            }
19779        }
19780        else {
19781            // Display the normal time text for the *event's* times
19782            timeText = this.getTimeText(seg.footprint);
19783            fullTimeText = this.getTimeText(seg.footprint, 'LT');
19784            startTimeText = this.getTimeText(seg.footprint, null, false); // displayEnd=false
19785        }
19786        return '<a class="' + classes.join(' ') + '"' +
19787            (eventDef.url ?
19788                ' href="' + util_1.htmlEscape(eventDef.url) + '"' :
19789                '') +
19790            (skinCss ?
19791                ' style="' + skinCss + '"' :
19792                '') +
19793            '>' +
19794            '<div class="fc-content">' +
19795            (timeText ?
19796                '<div class="fc-time"' +
19797                    ' data-start="' + util_1.htmlEscape(startTimeText) + '"' +
19798                    ' data-full="' + util_1.htmlEscape(fullTimeText) + '"' +
19799                    '>' +
19800                    '<span>' + util_1.htmlEscape(timeText) + '</span>' +
19801                    '</div>' :
19802                '') +
19803            (eventDef.title ?
19804                '<div class="fc-title">' +
19805                    util_1.htmlEscape(eventDef.title) +
19806                    '</div>' :
19807                '') +
19808            '</div>' +
19809            '<div class="fc-bg"/>' +
19810            /* TODO: write CSS for this
19811            (isResizableFromStart ?
19812              '<div class="fc-resizer fc-start-resizer" />' :
19813              ''
19814              ) +
19815            */
19816            (isResizableFromEnd ?
19817                '<div class="fc-resizer fc-end-resizer" />' :
19818                '') +
19819            '</a>';
19820    };
19821    // Given segments that are assumed to all live in the *same column*,
19822    // compute their verical/horizontal coordinates and assign to their elements.
19823    TimeGridEventRenderer.prototype.updateFgSegCoords = function (segs) {
19824        this.timeGrid.computeSegVerticals(segs); // horizontals relies on this
19825        this.computeFgSegHorizontals(segs); // compute horizontal coordinates, z-index's, and reorder the array
19826        this.timeGrid.assignSegVerticals(segs);
19827        this.assignFgSegHorizontals(segs);
19828    };
19829    // Given an array of segments that are all in the same column, set
19829s the backwardCoord and forwardCoord on each.
19830    // NOTE: Also reorders the given array by date!
19831    TimeGridEventRenderer.prototype.computeFgSegHorizontals = function (segs) {
19832        var levels;
19833        var level0;
19834        var i;
19835        this.sortEventSegs(segs); // order by certain criteria
19836        levels = buildSlotSegLevels(segs);
19837        computeForwardSlotSegs(levels);
19838        if ((level0 = levels[0])) {
19839            for (i = 0; i < level0.length; i++) {
19840                computeSlotSegPressures(level0[i]);
19841            }
19842            for (i = 0; i < level0.length; i++) {
19843                this.computeFgSegForwardBack(level0[i], 0, 0);
19844            }
19845        }
19846    };
19847    // Calculate seg.forwardCoord and seg.backwardCoord for the segment, where both values range
19848    // from 0 to 1. If the calendar is left-to-right, the seg.backwardCoord maps to "left" and
19849    // seg.forwardCoord maps to "right" (via percentage). Vice-versa if the calendar is right-to-left.
19850    //
19851    // The segment might be part of a "series", which means consecutive segments with the same pressure
19852    // who's width is unknown until an edge has been hit. `seriesBackwardPressure` is the number of
19853    // segments behind this one in the current series, and `seriesBackwardCoord` is the starting
19854    // coordinate of the first segment in the series.
19855    TimeGridEventRenderer.prototype.computeFgSegForwardBack = function (seg, seriesBackwardPressure, seriesBackwardCoord) {
19856        var forwardSegs = seg.forwardSegs;
19857        var i;
19858        if (seg.forwardCoord === undefined) {
19859            if (!forwardSegs.length) {
19860                // if there are no forward segments, this segment should butt up against the edge
19861                seg.forwardCoord = 1;
19862            }
19863            else {
19864                // sort highest pressure first
19865                this.sortForwardSegs(forwardSegs);
19866                // this segment's forwardCoord will be calculated from the backwardCoord of the
19867                // highest-pressure forward segment.
19868                this.computeFgSegForwardBack(forwardSegs[0], seriesBackwardPressure + 1, seriesBackwardCoord);
19869                seg.forwardCoord = forwardSegs[0].backwardCoord;
19870            }
19871            // calculate the backwardCoord from the forwardCoord. consider the series
19872            seg.backwardCoord = seg.forwardCoord -
19873                (seg.forwardCoord - seriesBackwardCoord) / // available width for series
19874                    (seriesBackwardPressure + 1); // # of segments in the series
19875            // use this segment's coordinates to computed the coordinates of the less-pressurized
19876            // forward segments
19877            for (i = 0; i < forwardSegs.length; i++) {
19878                this.computeFgSegForwardBack(forwardSegs[i], 0, seg.forwardCoord);
19879            }
19880        }
19881    };
19882    TimeGridEventRenderer.prototype.sortForwardSegs = function (forwardSegs) {
19883        forwardSegs.sort(util_1.proxy(this, 'compareForwardSegs'));
19884    };
19885    // A cmp function for determining which forward segment to rely on more when computing coordinates.
19886    TimeGridEventRenderer.prototype.compareForwardSegs = function (seg1, seg2) {
19887        // put higher-pressure first
19888        return seg2.forwardPressure - seg1.forwardPressure ||
19889            // put segments that are closer to initial edge first (and favor ones with no coords yet)
19890            (seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) ||
19891            // do normal sorting...
19892            this.compareEventSegs(seg1, seg2);
19893    };
19894    // Given foreground event segments that have already had their position coordinates computed,
19895    // assigns position-related CSS values to their elements.
19896    TimeGridEventRenderer.prototype.assignFgSegHorizontals = function (segs) {
19897        var i;
19898        var seg;
19899        for (i = 0; i < segs.length; i++) {
19900            seg = segs[i];
19901            seg.el.css(this.generateFgSegHorizontalCss(seg));
19902            // if the height is short, add a className for alternate styling
19903            if (seg.bottom - seg.top < 30) {
19904                seg.el.addClass('fc-short');
19905            }
19906        }
19907    };
19908    // Generates an object with CSS properties/values that should be applied to an event segment element.
19909    // Contains important positioning-related properties that should be applied to any event element, customized or not.
19910    TimeGridEventRenderer.prototype.generateFgSegHorizontalCss = function (seg) {
19911        var shouldOverlap = this.opt('slotEventOverlap');
19912        var backwardCoord = seg.backwardCoord; // the left side if LTR. the right side if RTL. floating-point
19913        var forwardCoord = seg.forwardCoord; // the right side if LTR. the left side if RTL. floating-point
19914        var props = this.timeGrid.generateSegVerticalCss(seg); // get top/bottom first
19915        var isRTL = this.timeGrid.isRTL;
19916        var left; // amount of space from left edge, a fraction of the total width
19917        var right; // amount of space from right edge, a fraction of the total width
19918        if (shouldOverlap) {
19919            // double the width, but don't go beyond the maximum forward coordinate (1.0)
19920            forwardCoord = Math.min(1, backwardCoord + (forwardCoord - backwardCoord) * 2);
19921        }
19922        if (isRTL) {
19923            left = 1 - forwardCoord;
19924            right = backwardCoord;
19925        }
19926        else {
19927            left = backwardCoord;
19928            right = 1 - forwardCoord;
19929        }
19930        props.zIndex = seg.level + 1; // convert from 0-base to 1-based
19931        props.left = left * 100 + '%';
19932        props.right = right * 100 + '%';
19933        if (shouldOverlap && seg.forwardPressure) {
19934            // add padding to the edge so that forward stacked events don't cover the resizer's icon
19935            props[isRTL ? 'marginLeft' : 'marginRight'] = 10 * 2; // 10 is a guesstimate of the icon's width
19936        }
19937        return props;
19938    };
19939    return TimeGridEventRenderer;
19940}(EventRenderer_1.default));
19941exports.default = TimeGridEventRenderer;
19942// Builds an array of segments "levels". The first level will be the leftmost tier of segments if the calendar is
19943// left-to-right, or the rightmost if the calendar is right-to-left. Assumes the segments are already ordered by date.
19944function buildSlotSegLevels(segs) {
19945    var levels = [];
19946    var i;
19947    var seg;
19948    var j;
19949    for (i = 0; i < segs.length; i++) {
19950        seg = segs[i];
19951        // go through all the levels and stop on the first level where there are no collisions
19952        for (j = 0; j < levels.length; j++) {
19953            if (!computeSlotSegCollisions(seg, levels[j]).length) {
19954                break;
19955            }
19956        }
19957        seg.level = j;
19958        (levels[j] || (levels[j] = [])).push(seg);
19959    }
19960    return levels;
19961}
19962// For every segment, figure out the other segments that are in subsequent
19963// levels that also occupy the same vertical space. Accumulate in seg.forwardSegs
19964function computeForwardSlotSegs(levels) {
19965    var i;
19966    var level;
19967    var j;
19968    var seg;
19969    var k;
19970    for (i = 0; i < levels.length; i++) {
19971        level = levels[i];
19972        for (j = 0; j < level.length; j++) {
19973            seg = level[j];
19974            seg.forwardSegs = [];
19975            for (k = i + 1; k < levels.length; k++) {
19976                computeSlotSegCollisions(seg, levels[k], seg.forwardSegs);
19977            }
19978        }
19979    }
19980}
19981// Figure out which path forward (via seg.forwardSegs) results in the longest path until
19982// the furthest edge is reached. The number of segments in this path will be seg.forwardPressure
19983function computeSlotSegPressures(seg) {
19984    var forwardSegs = seg.forwardSegs;
19985    var forwardPressure = 0;
19986    var i;
19987    var forwardSeg;
19988    if (seg.forwardPressure === undefined) {
19989        for (i = 0; i < forwardSegs.length; i++) {
19990            forwardSeg = forwardSegs[i];
19991            // figure out the child's maximum forward path
19992            computeSlotSegPressures(forwardSeg);
19993            // either use the existing maximum, or use the child's forward pressure
19994            // plus one (for the forwardSeg itself)
19995            forwardPressure = Math.max(forwardPressure, 1 + forwardSeg.forwardPressure);
19996        }
19997        seg.forwardPressure = forwardPressure;
19998    }
19999}
20000// Find all the segments in `otherSegs` that vertically collide with `seg`.
20001// Append into an optionally-supplied `results` array and return.
20002function computeSlotSegCollisions(seg, otherSegs, results) {
20003    if (results === void 0) { results = []; }
20004    for (var i = 0; i < otherSegs.length; i++) {
20005        if (isSlotSegCollision(seg, otherSegs[i])) {
20006            results.push(otherSegs[i]);
20007        }
20008    }
20009    return results;
20010}
20011// Do these segments occupy the same vertical space?
20012function isSlotSegCollision(seg1, seg2) {
20013    return seg1.bottom > seg2.top && seg1.top < seg2.bottom;
20014}
20015
20016
20017/***/ }),
20018/* 247 */
20019/***/ (function(module, exports, __webpack_require__) {
20020
20021Object.defineProperty(exports, "__esModule", { value: true });
20022var tslib_1 = __webpack_require__(2);
20023var $ = __webpack_require__(3);
20024var HelperRenderer_1 = __webpack_require__(58);
20025var TimeGridHelperRenderer = /** @class */ (function (_super) {
20026    tslib_1.__extends(TimeGridHelperRenderer, _super);
20027    function TimeGridHelperRenderer() {
20028        return _super !== null && _super.apply(this, arguments) || this;
20029    }
20030    TimeGridHelperRenderer.prototype.renderSegs = function (segs, sourceSeg) {
20031        var helperNodes = [];
20032        var i;
20033        var seg;
20034        var sourceEl;
20035        // TODO: not good to call eventRenderer this way
20036        this.eventRenderer.renderFgSegsIntoContainers(segs, this.component.helperContainerEls);
20037        // Try to make the segment that is in the same row as sourceSeg look the same
20038        for (i = 0; i < segs.length; i++) {
20039            seg = segs[i];
20040            if (sourceSeg && sourceSeg.col === seg.col) {
20041                sourceEl = sourceSeg.el;
20042                seg.el.css({
20043                    left: sourceEl.css('left'),
20044                    right: sourceEl.css('right'),
20045                    'margin-left': sourceEl.css('margin-left'),
20046                    'margin-right': sourceEl.css('margin-right')
20047                });
20048            }
20049            helperNodes.push(seg.el[0]);
20050        }
20051        return $(helperNodes); // must return the elements rendered
20052    };
20053    return TimeGridHelperRenderer;
20054}(HelperRenderer_1.default));
20055exports.default = TimeGridHelperRenderer;
20056
20057
20058/***/ }),
20059/* 248 */
20060/***/ (function(module, exports, __webpack_require__) {
20061
20062Object.defineProperty(exports, "__esModule", { value: true });
20063var tslib_1 = __webpack_require__(2);
20064var FillRenderer_1 = __webpack_require__(57);
20065var TimeGridFillRenderer = /** @class */ (function (_super) {
20066    tslib_1.__extends(TimeGridFillRenderer, _super);
20067    function TimeGridFillRenderer() {
20068        return _super !== null && _super.apply(this, arguments) || this;
20069    }
20070    TimeGridFillRenderer.prototype.attachSegEls = function (type, segs) {
20071        var timeGrid = this.component;
20072        var containerEls;
20073        // TODO: more efficient lookup
20074        if (type === 'bgEvent') {
20075            containerEls = timeGrid.bgContainerEls;
20076        }
20077        else if (type === 'businessHours') {
20078            containerEls = timeGrid.businessContainerEls;
20079        }
20080        else if (type === 'highlight') {
20081            containerEls = timeGrid.highlightContainerEls;
20082        }
20083        timeGrid.updateSegVerticals(segs);
20084        timeGrid.attachSegsByCol(timeGrid.groupSegsByCol(segs), containerEls);
20085        return segs.map(function (seg) {
20086            return seg.el[0];
20087        });
20088    };
20089    return TimeGridFillRenderer;
20090}(FillRenderer_1.default));
20091exports.default = TimeGridFillRenderer;
20092
20093
20094/***/ }),
20095/* 249 */
20096/***/ (function(module, exports, __webpack_require__) {
20097
20098/* A rectangular panel that is absolutely positioned over other content
20099------------------------------------------------------------------------------------------------------------------------
20100Options:
20101  - className (string)
20102  - content (HTML string or jQuery element set)
20103  - parentEl
20104  - top
20105  - left
20106  - right (the x coord of where the right edge should be. not a "CSS" right)
20107  - autoHide (boolean)
20108  - show (callback)
20109  - hide (callback)
20110*/
20111Object.defineProperty(exports, "__esModule", { value: true });
20112var $ = __webpack_require__(3);
20113var util_1 = __webpack_require__(4);
20114var ListenerMixin_1 = __webpack_require__(7);
20115var Popover = /** @class */ (function () {
20116    function Popover(options) {
20117        this.isHidden = true;
20118        this.margin = 10; // the space required between the popover and the edges of the scroll container
20119        this.options = options || {};
20120    }
20121    // Shows the popover on the specified position. Renders it if not already
20122    Popover.prototype.show = function () {
20123        if (this.isHidden) {
20124            if (!this.el) {
20125                this.render();
20126            }
20127            this.el.show();
20128            this.position();
20129            this.isHidden = false;
20130            this.trigger('show');
20131        }
20132    };
20133    // Hides the popover, through CSS, but does not remove it from the DOM
20134    Popover.prototype.hide = function () {
20135        if (!this.isHidden) {
20136            this.el.hide();
20137            this.isHidden = true;
20138            this.trigger('hide');
20139        }
20140    };
20141    // Creates `this.el` and renders content inside of it
20142    Popover.prototype.render = function () {
20143        var _this = this;
20144        var options = this.options;
20145        this.el = $('<div class="fc-popover"/>')
20146            .addClass(options.className || '')
20147            .css({
20148            // position initially to the top left to avoid creating scrollbars
20149            top: 0,
20150            left: 0
20151        })
20152            .append(options.content)
20153            .appendTo(options.parentEl);
20154        // when a click happens on anything inside with a 'fc-close' className, hide the popover
20155        this.el.on('click', '.fc-close', function () {
20156            _this.hide();
20157        });
20158        if (options.autoHide) {
20159            this.listenTo($(document), 'mousedown', this.documentMousedown);
20160        }
20161    };
20162    // Triggered when the user clicks *anywhere* in the document, for the autoHide feature
20163    Popover.prototype.documentMousedown = function (ev) {
20164        // only hide the popover if the click happened outside the popover
20165        if (this.el && !$(ev.target).closest(this.el).length) {
20166            this.hide();
20167        }
20168    };
20169    // Hides and unregisters any handlers
20170    Popover.prototype.removeElement = function () {
20171        this.hide();
20172        if (this.el) {
20173            this.el.remove();
20174            this.el = null;
20175        }
20176        this.stopListeningTo($(document), 'mousedown');
20177    };
20178    // Positions the popover optimally, using the top/left/right options
20179    Popover.prototype.position = function () {
20180        var options = this.options;
20181        var origin = this.el.offsetParent().offset();
20182        var width = this.el.outerWidth();
20183        var height = this.el.outerHeight();
20184        var windowEl = $(window);
20185        var viewportEl = util_1.getScrollParent(this.el);
20186        var viewportTop;
20187        var viewportLeft;
20188        var viewportOffset;
20189        var top; // the "position" (not "offset") values for the popover
20190        var left; //
20191        // compute top and left
20192        top = options.top || 0;
20193        if (options.left !== undefined) {
20194            left = options.left;
20195        }
20196        else if (options.right !== undefined) {
20197            left = options.right - width; // derive the left value from the right value
20198        }
20199        else {
20200            left = 0;
20201        }
20202        if (viewportEl.is(window) || viewportEl.is(document)) {
20203            viewportEl = windowEl;
20204            viewportTop = 0; // the window is always at the top left
20205            viewportLeft = 0; // (and .offset() won't work if called here)
20206        }
20207        else {
20208            viewportOffset = viewportEl.offset();
20209            viewportTop = viewportOffset.top;
20210            viewportLeft = viewportOffset.left;
20211        }
20212        // if the window is scrolled, it causes the visible area to be further down
20213        viewportTop += windowEl.scrollTop();
20214        viewportLeft += windowEl.scrollLeft();
20215        // constrain to the view port. if constrained by two edges, give precedence to top/left
20216        if (options.viewportConstrain !== false) {
20217            top = Math.min(top, viewportTop + viewportEl.outerHeight() - height - this.margin);
20218            top = Math.max(top, viewportTop + this.margin);
20219            left = Math.min(left, viewportLeft + viewportEl.outerWidth() - width - this.margin);
20220            left = Math.max(left, viewportLeft + this.margin);
20221        }
20222        this.el.css({
20223            top: top - origin.top,
20224            left: left - origin.left
20225        });
20226    };
20227    // Triggers a callback. Calls a function in the option hash of the same name.
20228    // Arguments beyond the first `name` are forwarded on.
20229    // TODO: better code reuse for this. Repeat code
20230    Popover.prototype.trigger = function (name) {
20231        if (this.options[name]) {
20232            this.options[name].apply(this, Array.prototype.slice.call(arguments, 1));
20233        }
20234    };
20235    return Popover;
20236}());
20237exports.default = Popover;
20238ListenerMixin_1.default.mixInto(Popover);
20239
20240
20241/***/ }),
20242/* 250 */
20243/***/ (function(module, exports, __webpack_require__) {
20244
20245Object.defineProperty(exports, "__esModule", { value: true });
20246var tslib_1 = __webpack_require__(2);
20247var $ = __webpack_require__(3);
20248var util_1 = __webpack_require__(4);
20249var EventRenderer_1 = __webpack_require__(42);
20250/* Event-rendering methods for the DayGrid class
20251----------------------------------------------------------------------------------------------------------------------*/
20252var DayGridEventRenderer = /** @class */ (function (_super) {
20253    tslib_1.__extends(DayGridEventRenderer, _super);
20254    function DayGridEventRenderer(dayGrid, fillRenderer) {
20255        var _this = _super.call(this, dayGrid, fillRenderer) || this;
20256        _this.dayGrid = dayGrid;
20257        return _this;
20258    }
20259    DayGridEventRenderer.prototype.renderBgRanges = function (eventRanges) {
20260        // don't render timed background events
20261        eventRanges = $.grep(eventRanges, function (eventRange) {
20262            return eventRange.eventDef.isAllDay();
20263        });
20264        _super.prototype.renderBgRanges.call(this, eventRanges);
20265    };
20266    // Renders the given foreground event segments onto the grid
20267    DayGridEventRenderer.prototype.renderFgSegs = function (segs) {
20268        var rowStructs = this.rowStructs = this.renderSegRows(segs);
20269        // append to each row's content skeleton
20270        this.dayGrid.rowEls.each(function (i, rowNode) {
20271            $(rowNode).find('.fc-content-skeleton > table').append(rowStructs[i].tbodyEl);
20272        });
20273    };
20274    // Unrenders all currently rendered foreground event segments
20275    DayGridEventRenderer.prototype.unrenderFgSegs = function () {
20276        var rowStructs = this.rowStructs || [];
20277        var rowStruct;
20278        while ((rowStruct = rowStructs.pop())) {
20279            rowStruct.tbodyEl.remove();
20280        }
20281        this.rowStructs = null;
20282    };
20283    // Uses the given events array to generate <tbody> elements that should be appended to each row's content skeleton.
20284    // Returns an array of rowStruct objects (see the bottom of `renderSegRow`).
20285    // PRECONDITION: each segment shoud already have a rendered and assigned `.el`
20286    DayGridEventRenderer.prototype.renderSegRows = function (segs) {
20287        var rowStructs = [];
20288        var segRows;
20289        var row;
20290        segRows = this.groupSegRows(segs); // group into nested arrays
20291        // iterate each row of segment groupings
20292        for (row = 0; row < segRows.length; row++) {
20293            rowStructs.push(this.renderSegRow(row, segRows[row]));
20294        }
20295        return rowStructs;
20296    };
20297    // Given a row # and an array of segments all in the same row, render a <tbody> element, a skeleton that contains
20298    // the segments. Returns object with a bunch of internal data about how the render was calculated.
20299    // NOTE: modifies rowSegs
20300    DayGridEventRenderer.prototype.renderSegRow = function (row, rowSegs) {
20301        var colCnt = this.dayGrid.colCnt;
20302        var segLevels = this.buildSegLevels(rowSegs); // group into sub-arrays of levels
20303        var levelCnt = Math.max(1, segLevels.length); // ensure at least one level
20304        var tbody = $('<tbody/>');
20305        var segMatrix = []; // lookup for which segments are rendered into which level+col cells
20306        var cellMatrix = []; // lookup for all <td> elements of the level+col matrix
20307        var loneCellMatrix = []; // lookup for <td> elements that only take up a single column
20308        var i;
20309        var levelSegs;
20310        var col;
20311        var tr;
20312        var j;
20313        var seg;
20314        var td;
20315        // populates empty cells from the current column (`col`) to `endCol`
20316        function emptyCellsUntil(endCol) {
20317            while (col < endCol) {
20318                // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell
20319                td = (loneCellMatrix[i - 1] || [])[col];
20320                if (td) {
20321                    td.attr('rowspan', parseInt(td.attr('rowspan') || 1, 10) + 1);
20322                }
20323                else {
20324                    td = $('<td/>');
20325                    tr.append(td);
20326                }
20327                cellMatrix[i][col] = td;
20328                loneCellMatrix[i][col] = td;
20329                col++;
20330            }
20331        }
20332        for (i = 0; i < levelCnt; i++) {
20333            levelSegs = segLevels[i];
20334            col = 0;
20335            tr = $('<tr/>');
20336            segMatrix.push([]);
20337            cellMatrix.push([]);
20338            loneCellMatrix.push([]);
20339            // levelCnt might be 1 even though there are no actual levels. protect against this.
20340            // this single empty row is useful for styling.
20341            if (levelSegs) {
20342                for (j = 0; j < levelSegs.length; j++) {
20343                    seg = levelSegs[j];
20344                    emptyCellsUntil(seg.leftCol);
20345                    // create a container that occupies or more columns. append the event element.
20346                    td = $('<td class="fc-event-container"/>').append(seg.el);
20347                    if (seg.leftCol !== seg.rightCol) {
20348                        td.attr('colspan', seg.rightCol - seg.leftCol + 1);
20349                    }
20350                    else {
20351                        loneCellMatrix[i][col] = td;
20352                    }
20353                    while (col <= seg.rightCol) {
20354                        cellMatrix[i][col] = td;
20355                        segMatrix[i][col] = seg;
20356                        col++;
20357                    }
20358                    tr.append(td);
20359                }
20360            }
20361            emptyCellsUntil(colCnt); // finish off the row
20362            this.dayGrid.bookendCells(tr);
20363            tbody.append(tr);
20364        }
20365        return {
20366            row: row,
20367            tbodyEl: tbody,
20368            cellMatrix: cellMatrix,
20369            segMatrix: segMatrix,
20370            segLevels: segLevels,
20371            segs: rowSegs
20372        };
20373    };
20374    // Stacks a flat array of segments, which are all assumed to be in the same row, into subarrays of vertical levels.
20375    // NOTE: modifies segs
20376    DayGridEventRenderer.prototype.buildSegLevels = function (segs) {
20377        var levels = [];
20378        var i;
20379        var seg;
20380        var j;
20381        // Give preference to elements with certain criteria, so they have
20382        // a chance to be closer to the top.
20383        this.sortEventSegs(segs);
20384        for (i = 0; i < segs.length; i++) {
20385            seg = segs[i];
20386            // loop through levels, starting with the topmost, until the segment doesn't collide with other segments
20387            for (j = 0; j < levels.length; j++) {
20388                if (!isDaySegCollision(seg, levels[j])) {
20389                    break;
20390                }
20391            }
20392            // `j` now holds the desired subrow index
20393            seg.level = j;
20394            // create new level array if needed and append segment
20395            (levels[j] || (levels[j] = [])).push(seg);
20396        }
20397        // order segments left-to-right. very important if calendar is RTL
20398        for (j = 0; j < levels.length; j++) {
20399            levels[j].sort(compareDaySegCols);
20400        }
20401        return levels;
20402    };
20403    // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's row
20404    DayGridEventRenderer.prototype.groupSegRows = function (segs) {
20405        var segRows = [];
20406        var i;
20407        for (i = 0; i < this.dayGrid.rowCnt; i++) {
20408            segRows.push([]);
20409        }
20410        for (i = 0; i < segs.length; i++) {
20411            segRows[segs[i].row].push(segs[i]);
20412        }
20413        return segRows;
20414    };
20415    // Computes a default event time formatting string if `timeFormat` is not explicitly defined
20416    DayGridEventRenderer.prototype.computeEventTimeFormat = function () {
20417        return this.opt('extraSmallTimeFormat'); // like "6p" or "6:30p"
20418    };
20419    // Computes a default `displayEventEnd` value if one is not expliclty defined
20420    DayGridEventRenderer.prototype.computeDisplayEventEnd = function () {
20421        return this.dayGrid.colCnt === 1; // we'll likely have space if there's only one day
20422    };
20423    // Builds the HTML to be used for the default element for an individual segment
20424    DayGridEventRenderer.prototype.fgSegHtml = function (seg, disableResizing) {
20425        var view = this.view;
20426        var eventDef = seg.footprint.eventDef;
20427        var isAllDay = seg.footprint.componentFootprint.isAllDay;
20428        var isDraggable = view.isEventDefDraggable(eventDef);
20429        var isResizableFromStart = !disableResizing && isAllDay &&
20430            seg.isStart && view.isEventDefResizableFromStart(eventDef);
20431        var isResizableFromEnd = !disableResizing && isAllDay &&
20432            seg.isEnd && view.isEventDefResizableFromEnd(eventDef);
20433        var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd);
20434        var skinCss = util_1.cssToStr(this.getSkinCss(eventDef));
20435        var timeHtml = '';
20436        var timeText;
20437        var titleHtml;
20438        classes.unshift('fc-day-grid-event', 'fc-h-event');
20439        // Only display a timed events time if it is the starting segment
20440        if (seg.isStart) {
20441            timeText = this.getTimeText(seg.footprint);
20442            if (timeText) {
20443                timeHtml = '<span class="fc-time">' + util_1.htmlEscape(timeText) + '</span>';
20444            }
20445        }
20446        titleHtml =
20447            '<span class="fc-title">' +
20448                (util_1.htmlEscape(eventDef.title || '') || '&nbsp;') + // we always want one line of height
20449                '</span>';
20450        return '<a class="' + classes.join(' ') + '"' +
20451            (eventDef.url ?
20452                ' href="' + util_1.htmlEscape(eventDef.url) + '"' :
20453                '') +
20454            (skinCss ?
20455                ' style="' + skinCss + '"' :
20456                '') +
20457            '>' +
20458            '<div class="fc-content">' +
20459            (this.dayGrid.isRTL ?
20460                titleHtml + ' ' + timeHtml : // put a natural space in between
20461                timeHtml + ' ' + titleHtml //
20462            ) +
20463            '</div>' +
20464            (isResizableFromStart ?
20465                '<div class="fc-resizer fc-start-resizer" />' :
20466                '') +
20467            (isResizableFromEnd ?
20468                '<div class="fc-resizer fc-end-resizer" />' :
20469                '') +
20470            '</a>';
20471    };
20472    return DayGridEventRenderer;
20473}(EventRenderer_1.default));
20474exports.default = DayGridEventRenderer;
20475// Computes whether two segments' columns collide. They are assumed to be in the same row.
20476function isDaySegCollision(seg, otherSegs) {
20477    var i;
20478    var otherSeg;
20479    for (i = 0; i < otherSegs.length; i++) {
20480        otherSeg = otherSegs[i];
20481        if (otherSeg.leftCol <= seg.rightCol &&
20482            otherSeg.rightCol >= seg.leftCol) {
20483            return true;
20484        }
20485    }
20486    return false;
20487}
20488// A cmp function for determining the leftmost event
20489function compareDaySegCols(a, b) {
20490    return a.leftCol - b.leftCol;
20491}
20492
20493
20494/***/ }),
20495/* 251 */
20496/***/ (function(module, exports, __webpack_require__) {
20497
20498Object.defineProperty(exports, "__esModule", { value: true });
20499var tslib_1 = __webpack_require__(2);
20500var $ = __webpack_require__(3);
20501var HelperRenderer_1 = __webpack_require__(58);
20502var DayGridHelperRenderer = /** @class */ (function (_super) {
20503    tslib_1.__extends(DayGridHelperRenderer, _super);
20504    function DayGridHelperRenderer() {
20505        return _super !== null && _super.apply(this, arguments) || this;
20506    }
20507    // Renders a mock "helper" event. `sourceSeg` is the associated internal segment object. It can be null.
20508    DayGridHelperRenderer.prototype.renderSegs = function (segs, sourceSeg) {
20509        var helperNodes = [];
20510        var rowStructs;
20511        // TODO: not good to call eventRenderer this way
20512        rowStructs = this.eventRenderer.renderSegRows(segs);
20513        // inject each new event skeleton into each associated row
20514        this.component.rowEls.each(function (row, rowNode) {
20515            var rowEl = $(rowNode); // the .fc-row
20516            var skeletonEl = $('<div class="fc-helper-skeleton"><table/></div>'); // will be absolutely positioned
20517            var skeletonTopEl;
20518            var skeletonTop;
20519            // If there is an original segment, match the top position. Otherwise, put it at the row's top level
20520            if (sourceSeg && sourceSeg.row === row) {
20521                skeletonTop = sourceSeg.el.position().top;
20522            }
20523            else {
20524                skeletonTopEl = rowEl.find('.fc-content-skeleton tbody');
20525                if (!skeletonTopEl.length) {
20526                    skeletonTopEl = rowEl.find('.fc-content-skeleton table');
20527                }
20528                skeletonTop = skeletonTopEl.position().top;
20529            }
20530            skeletonEl.css('top', skeletonTop)
20531                .find('table')
20532                .append(rowStructs[row].tbodyEl);
20533            rowEl.append(skeletonEl);
20534            helperNodes.push(skeletonEl[0]);
20535        });
20536        return $(helperNodes); // must return the elements rendered
20537    };
20538    return DayGridHelperRenderer;
20539}(HelperRenderer_1.default));
20540exports.default = DayGridHelperRenderer;
20541
20542
20543/***/ }),
20544/* 252 */
20545/***/ (function(module, exports, __webpack_require__) {
20546
20547Object.defineProperty(exports, "__esModule", { value: true });
20548var tslib_1 = __webpack_require__(2);
20549var $ = __webpack_require__(3);
20550var FillRenderer_1 = __webpack_require__(57);
20551var DayGridFillRenderer = /** @class */ (function (_super) {
20552    tslib_1.__extends(DayGridFillRenderer, _super);
20553    function DayGridFillRenderer() {
20554        var _this = _super !== null && _super.apply(this, arguments) || this;
20555        _this.fillSegTag = 'td'; // override the default tag name
20556        return _this;
20557    }
20558    DayGridFillRenderer.prototype.attachSegEls = function (type, segs) {
20559        var nodes = [];
20560        var i;
20561        var seg;
20562        var skeletonEl;
20563        for (i = 0; i < segs.length; i++) {
20564            seg = segs[i];
20565            skeletonEl = this.renderFillRow(type, seg);
20566            this.component.rowEls.eq(seg.row).append(skeletonEl);
20567            nodes.push(skeletonEl[0]);
20568        }
20569        return nodes;
20570    };
20571    // Generates the HTML needed for one row of a fill. Requires the seg's el to be rendered.
20572    DayGridFillRenderer.prototype.renderFillRow = function (type, seg) {
20573        var colCnt = this.component.colCnt;
20574        var startCol = seg.leftCol;
20575        var endCol = seg.rightCol + 1;
20576        var className;
20577        var skeletonEl;
20578        var trEl;
20579        if (type === 'businessHours') {
20580            className = 'bgevent';
20581        }
20582        else {
20583            className = type.toLowerCase();
20584        }
20585        skeletonEl = $('<div class="fc-' + className + '-skeleton">' +
20586            '<table><tr/></table>' +
20587            '</div>');
20588        trEl = skeletonEl.find('tr');
20589        if (startCol > 0) {
20590            trEl.append('<td colspan="' + startCol + '"/>');
20591        }
20592        trEl.append(seg.el.attr('colspan', endCol - startCol));
20593        if (endCol < colCnt) {
20594            trEl.append('<td colspan="' + (colCnt - endCol) + '"/>');
20595        }
20596        this.component.bookendCells(trEl);
20597        return skeletonEl;
20598    };
20599    return DayGridFillRenderer;
20600}(FillRenderer_1.default));
20601exports.default = DayGridFillRenderer;
20602
20603
20604/***/ }),
20605/* 253 */
20606/***/ (function(module, exports, __webpack_require__) {
20607
20608Object.defineProperty(exports, "__esModule", { value: true });
20609var tslib_1 = __webpack_require__(2);
20610var BasicViewDateProfileGenerator_1 = __webpack_require__(228);
20611var UnzonedRange_1 = __webpack_require__(5);
20612var MonthViewDateProfileGenerator = /** @class */ (function (_super) {
20613    tslib_1.__extends(MonthViewDateProfileGenerator, _super);
20614    function MonthViewDateProfileGenerator() {
20615        return _super !== null && _super.apply(this, arguments) || this;
20616    }
20617    // Computes the date range that will be rendered.
20618    MonthViewDateProfileGenerator.prototype.buildRenderRange = function (currentUnzonedRange, currentRangeUnit, isRangeAllDay) {
20619        var renderUnzonedRange = _super.prototype.buildRenderRange.call(this, currentUnzonedRange, currentRangeUnit, isRangeAllDay);
20620        var start = this.msToUtcMoment(renderUnzonedRange.startMs, isRangeAllDay);
20621        var end = this.msToUtcMoment(renderUnzonedRange.endMs, isRangeAllDay);
20622        var rowCnt;
20623        // ensure 6 weeks
20624        if (this.opt('fixedWeekCount')) {
20625            rowCnt = Math.ceil(// could be partial weeks due to hiddenDays
20626            end.diff(start, 'weeks', true) // dontRound=true
20627            );
20628            end.add(6 - rowCnt, 'weeks');
20629        }
20630        return new UnzonedRange_1.default(start, end);
20631    };
20632    return MonthViewDateProfileGenerator;
20633}(BasicViewDateProfileGenerator_1.default));
20634exports.default = MonthViewDateProfileGenerator;
20635
20636
20637/***/ }),
20638/* 254 */
20639/***/ (function(module, exports, __webpack_require__) {
20640
20641Object.defineProperty(exports, "__esModule", { value: true });
20642var tslib_1 = __webpack_require__(2);
20643var util_1 = __webpack_require__(4);
20644var EventRenderer_1 = __webpack_require__(42);
20645var ListEventRenderer = /** @class */ (function (_super) {
20646    tslib_1.__extends(ListEventRenderer, _super);
20647    function ListEventRenderer() {
20648        return _super !== null && _super.apply(this, arguments) || this;
20649    }
20650    ListEventRenderer.prototype.renderFgSegs = function (segs) {
20651        if (!segs.length) {
20652            this.component.renderEmptyMessage();
20653        }
20654        else {
20655            this.component.renderSegList(segs);
20656        }
20657    };
20658    // generates the HTML for a single event row
20659    ListEventRenderer.prototype.fgSegHtml = function (seg) {
20660        var view = this.view;
20661        var calendar = view.calendar;
20662        var theme = calendar.theme;
20663        var eventFootprint = seg.footprint;
20664        var eventDef = eventFootprint.eventDef;
20665        var componentFootprint = eventFootprint.componentFootprint;
20666        var url = eventDef.url;
20667        var classes = ['fc-list-item'].concat(this.getClasses(eventDef));
20668        var bgColor = this.getBgColor(eventDef);
20669        var timeHtml;
20670        if (componentFootprint.isAllDay) {
20671            timeHtml = view.getAllDayHtml();
20672        }
20673        else if (view.isMultiDayRange(componentFootprint.unzonedRange)) {
20674            if (seg.isStart || seg.isEnd) {
20675                timeHtml = util_1.htmlEscape(this._getTimeText(calendar.msToMoment(seg.startMs), calendar.msToMoment(seg.endMs), componentFootprint.isAllDay));
20676            }
20677            else {
20678                timeHtml = view.getAllDayHtml();
20679            }
20680        }
20681        else {
20682            // Display the normal time text for the *event's* times
20683            timeHtml = util_1.htmlEscape(this.getTimeText(eventFootprint));
20684        }
20685        if (url) {
20686            classes.push('fc-has-url');
20687        }
20688        return '<tr class="' + classes.join(' ') + '">' +
20689            (this.displayEventTime ?
20690                '<td class="fc-list-item-time ' + theme.getClass('widgetContent') + '">' +
20691                    (timeHtml || '') +
20692                    '</td>' :
20693                '') +
20694            '<td class="fc-list-item-marker ' + theme.getClass('widgetContent') + '">' +
20695            '<span class="fc-event-dot"' +
20696            (bgColor ?
20697                ' style="background-color:' + bgColor + '"' :
20698                '') +
20699            '></span>' +
20700            '</td>' +
20701            '<td class="fc-list-item-title ' + theme.getClass('widgetContent') + '">' +
20702            '<a' + (url ? ' href="' + util_1.htmlEscape(url) + '"' : '') + '>' +
20703            util_1.htmlEscape(eventDef.title || '') +
20704            '</a>' +
20705            '</td>' +
20706            '</tr>';
20707    };
20708    // like "4:00am"
20709    ListEventRenderer.prototype.computeEventTimeFormat = function () {
20710        return this.opt('mediumTimeFormat');
20711    };
20712    return ListEventRenderer;
20713}(EventRenderer_1.default));
20714exports.default = ListEventRenderer;
20715
20716
20717/***/ }),
20718/* 255 */
20719/***/ (function(module, exports, __webpack_require__) {
20720
20721Object.defineProperty(exports, "__esModule", { value: true });
20722var tslib_1 = __webpack_require__(2);
20723var $ = __webpack_require__(3);
20724var EventPointing_1 = __webpack_require__(59);
20725var ListEventPointing = /** @class */ (function (_super) {
20726    tslib_1.__extends(ListEventPointing, _super);
20727    function ListEventPointing() {
20728        return _super !== null && _super.apply(this, arguments) || this;
20729    }
20730    // for events with a url, the whole <tr> should be clickable,
20731    // but it's impossible to wrap with an <a> tag. simulate this.
20732    ListEventPointing.prototype.handleClick = function (seg, ev) {
20733        var url;
20734        _super.prototype.handleClick.call(this, seg, ev); // might prevent the default action
20735        // not clicking on or within an <a> with an href
20736        if (!$(ev.target).closest('a[href]').length) {
20737            url = seg.footprint.eventDef.url;
20738            if (url && !ev.isDefaultPrevented()) {
20739                window.location.href = url; // simulate link click
20740            }
20741        }
20742    };
20743    return ListEventPointing;
20744}(EventPointing_1.default));
20745exports.default = ListEventPointing;
20746
20747
20748/***/ }),
20749/* 256 */
20750/***/ (function(module, exports, __webpack_require__) {
20751
20752Object.defineProperty(exports, "__esModule", { value: true });
20753var EventSourceParser_1 = __webpack_require__(37);
20754var ArrayEventSource_1 = __webpack_require__(52);
20755var FuncEventSource_1 = __webpack_require__(215);
20756var JsonFeedEventSource_1 = __webpack_require__(216);
20757EventSourceParser_1.default.registerClass(ArrayEventSource_1.default);
20758EventSourceParser_1.default.registerClass(FuncEventSource_1.default);
20759EventSourceParser_1.default.registerClass(JsonFeedEventSource_1.default);
20760
20761
20762/***/ }),
20763/* 257 */
20764/***/ (function(module, exports, __webpack_require__) {
20765
20766Object.defineProperty(exports, "__esModule", { value: true });
20767var ThemeRegistry_1 = __webpack_require__(51);
20768var StandardTheme_1 = __webpack_require__(213);
20769var JqueryUiTheme_1 = __webpack_require__(214);
20770var BootstrapTheme_1 = __webpack_require__(258);
20771ThemeRegistry_1.defineThemeSystem('standard', StandardTheme_1.default);
20772ThemeRegistry_1.defineThemeSystem('jquery-ui', JqueryUiTheme_1.default);
20773ThemeRegistry_1.defineThemeSystem('bootstrap3', BootstrapTheme_1.default);
20774
20775
20776/***/ }),
20777/* 258 */
20778/***/ (function(module, exports, __webpack_require__) {
20779
20780Object.defineProperty(exports, "__esModule", { value: true });
20781var tslib_1 = __webpack_require__(2);
20782var Theme_1 = __webpack_require__(38);
20783var BootstrapTheme = /** @class */ (function (_super) {
20784    tslib_1.__extends(BootstrapTheme, _super);
20785    function BootstrapTheme() {
20786        return _super !== null && _super.apply(this, arguments) || this;
20787    }
20788    return BootstrapTheme;
20789}(Theme_1.default));
20790exports.default = BootstrapTheme;
20791BootstrapTheme.prototype.classes = {
20792    widget: 'fc-bootstrap3',
20793    tableGrid: 'table-bordered',
20794    tableList: 'table table-striped',
20795    buttonGroup: 'btn-group',
20796    button: 'btn btn-default',
20797    stateActive: 'active',
20798    stateDisabled: 'disabled',
20799    today: 'alert alert-info',
20800    popover: 'panel panel-default',
20801    popoverHeader: 'panel-heading',
20802    popoverContent: 'panel-body',
20803    // day grid
20804    headerRow: 'panel-default',
20805    dayRow: 'panel-default',
20806    // list view
20807    listView: 'panel panel-default'
20808};
20809BootstrapTheme.prototype.baseIconClass = 'glyphicon';
20810BootstrapTheme.prototype.iconClasses = {
20811    close: 'glyphicon-remove',
20812    prev: 'glyphicon-chevron-left',
20813    next: 'glyphicon-chevron-right',
20814    prevYear: 'glyphicon-backward',
20815    nextYear: 'glyphicon-forward'
20816};
20817BootstrapTheme.prototype.iconOverrideOption = 'bootstrapGlyphicons';
20818BootstrapTheme.prototype.iconOverrideCustomButtonOption = 'bootstrapGlyphicon';
20819BootstrapTheme.prototype.iconOverridePrefix = 'glyphicon-';
20820
20821
20822/***/ }),
20823/* 259 */
20824/***/ (function(module, exports, __webpack_require__) {
20825
20826Object.defineProperty(exports, "__esModule", { value: true });
20827var ViewRegistry_1 = __webpack_require__(21);
20828var BasicView_1 = __webpack_require__(62);
20829var MonthView_1 = __webpack_require__(229);
20830ViewRegistry_1.defineView('basic', {
20831    'class': BasicView_1.default
20832});
20833ViewRegistry_1.defineView('basicDay', {
20834    type: 'basic',
20835    duration: { days: 1 }
20836});
20837ViewRegistry_1.defineView('basicWeek', {
20838    type: 'basic',
20839    duration: { weeks: 1 }
20840});
20841ViewRegistry_1.defineView('month', {
20842    'class': MonthView_1.default,
20843    duration: { months: 1 },
20844    defaults: {
20845        fixedWeekCount: true
20846    }
20847});
20848
20849
20850/***/ }),
20851/* 260 */
20852/***/ (function(module, exports, __webpack_require__) {
20853
20854Object.defineProperty(exports, "__esModule", { value: true });
20855var ViewRegistry_1 = __webpack_require__(21);
20856var AgendaView_1 = __webpack_require__(226);
20857ViewRegistry_1.defineView('agenda', {
20858    'class': AgendaView_1.default,
20859    defaults: {
20860        allDaySlot: true,
20861        slotDuration: '00:30:00',
20862        slotEventOverlap: true // a bad name. confused with overlap/constraint system
20863    }
20864});
20865ViewRegistry_1.defineView('agendaDay', {
20866    type: 'agenda',
20867    duration: { days: 1 }
20868});
20869ViewRegistry_1.defineView('agendaWeek', {
20870    type: 'agenda',
20871    duration: { weeks: 1 }
20872});
20873
20874
20875/***/ }),
20876/* 261 */
20877/***/ (function(module, exports, __webpack_require__) {
20878
20879Object.defineProperty(exports, "__esModule", { value: true });
20880var ViewRegistry_1 = __webpack_require__(21);
20881var ListView_1 = __webpack_require__(230);
20882ViewRegistry_1.defineView('list', {
20883    'class': ListView_1.default,
20884    buttonTextKey: 'list',
20885    defaults: {
20886        buttonText: 'list',
20887        listDayFormat: 'LL',
20888        noEventsMessage: 'No events to display'
20889    }
20890});
20891ViewRegistry_1.defineView('listDay', {
20892    type: 'list',
20893    duration: { days: 1 },
20894    defaults: {
20895        listDayFormat: 'dddd' // day-of-week is all we need. full date is probably in header
20896    }
20897});
20898ViewRegistry_1.defineView('listWeek', {
20899    type: 'list',
20900    duration: { weeks: 1 },
20901    defaults: {
20902        listDayFormat: 'dddd',
20903        listDayAltFormat: 'LL'
20904    }
20905});
20906ViewRegistry_1.defineView('listMonth', {
20907    type: 'list',
20908    duration: { month: 1 },
20909    defaults: {
20910        listDayAltFormat: 'dddd' // day-of-week is nice-to-have
20911    }
20912});
20913ViewRegistry_1.defineView('listYear', {
20914    type: 'list',
20915    duration: { year: 1 },
20916    defaults: {
20917        listDayAltFormat: 'dddd' // day-of-week is nice-to-have
20918    }
20919});
20920
20921
20922/***/ }),
20923/* 262 */
20924/***/ (function(module, exports) {
20925
20926Object.defineProperty(exports, "__esModule", { value: true });
20927
20928
20929/***/ })
20930/******/ ]);
20931});
20932
20933/*  gcal  */
20934/*!
20935 * FullCalendar v3.8.1
20936 * Docs & License: https://fullcalendar.io/
20937 * (c) 2017 Adam Shaw
20938 */
20939(function webpackUniversalModuleDefinition(root, factory) {
20940	if(typeof exports === 'object' && typeof module === 'object')
20941		module.exports = factory(require("fullcalendar"), require("jquery"));
20942	else if(typeof define === 'function' && define.amd)
20943		define(["fullcalendar", "jquery"], factory);
20944	else if(typeof exports === 'object')
20945		factory(require("fullcalendar"), require("jquery"));
20946	else
20947		factory(root["FullCalendar"], root["jQuery"]);
20948})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_3__) {
20949return /******/ (function(modules) { // webpackBootstrap
20950/******/ 	// The module cache
20951/******/ 	var installedModules = {};
20952/******/
20953/******/ 	// The require function
20954/******/ 	function __webpack_require__(moduleId) {
20955/******/
20956/******/ 		// Check if module is in cache
20957/******/ 		if(installedModules[moduleId]) {
20958/******/ 			return installedModules[moduleId].exports;
20959/******/ 		}
20960/******/ 		// Create a new module (and put it into the cache)
20961/******/ 		var module = installedModules[moduleId] = {
20962/******/ 			i: moduleId,
20963/******/ 			l: false,
20964/******/ 			exports: {}
20965/******/ 		};
20966/******/
20967/******/ 		// Execute the module function
20968/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
20969/******/
20970/******/ 		// Flag the module as loaded
20971/******/ 		module.l = true;
20972/******/
20973/******/ 		// Return the exports of the module
20974/******/ 		return module.exports;
20975/******/ 	}
20976/******/
20977/******/
20978/******/ 	// expose the modules object (__webpack_modules__)
20979/******/ 	__webpack_require__.m = modules;
20980/******/
20981/******/ 	// expose the module cache
20982/******/ 	__webpack_require__.c = installedModules;
20983/******/
20984/******/ 	// define getter function for harmony exports
20985/******/ 	__webpack_require__.d = function(exports, name, getter) {
20986/******/ 		if(!__webpack_require__.o(exports, name)) {
20987/******/ 			Object.defineProperty(exports, name, {
20988/******/ 				configurable: false,
20989/******/ 				enumerable: true,
20990/******/ 				get: getter
20991/******/ 			});
20992/******/ 		}
20993/******/ 	};
20994/******/
20995/******/ 	// getDefaultExport function for compatibility with non-harmony modules
20996/******/ 	__webpack_require__.n = function(module) {
20997/******/ 		var getter = module && module.__esModule ?
20998/******/ 			function getDefault() { return module['default']; } :
20999/******/ 			function getModuleExports() { return module; };
21000/******/ 		__webpack_require__.d(getter, 'a', getter);
21001/******/ 		return getter;
21002/******/ 	};
21003/******/
21004/******/ 	// Object.prototype.hasOwnProperty.call
21005/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
21006/******/
21007/******/ 	// __webpack_public_path__
21008/******/ 	__webpack_require__.p = "";
21009/******/
21010/******/ 	// Load entry module and return exports
21011/******/ 	return __webpack_require__(__webpack_require__.s = 265);
21012/******/ })
21013/************************************************************************/
21014/******/ ({
21015
21016/***/ 1:
21017/***/ (function(module, exports) {
21018
21019module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
21020
21021/***/ }),
21022
21023/***/ 2:
21024/***/ (function(module, exports) {
21025
21026/*
21027derived from:
21028https://github.com/Microsoft/tslib/blob/v1.6.0/tslib.js
21029
21030only include the helpers we need, to keep down filesize
21031*/
21032var extendStatics = Object.setPrototypeOf ||
21033    ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
21034    function (d, b) { for (var p in b)
21035        if (b.hasOwnProperty(p))
21036            d[p] = b[p]; };
21037exports.__extends = function (d, b) {
21038    extendStatics(d, b);
21039    function __() { this.constructor = d; }
21040    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
21041};
21042
21043
21044/***/ }),
21045
21046/***/ 265:
21047/***/ (function(module, exports, __webpack_require__) {
21048
21049Object.defineProperty(exports, "__esModule", { value: true });
21050var exportHooks = __webpack_require__(1);
21051var GcalEventSource_1 = __webpack_require__(266);
21052exportHooks.EventSourceParser.registerClass(GcalEventSource_1.default);
21053exportHooks.GcalEventSource = GcalEventSource_1.default;
21054
21055
21056/***/ }),
21057
21058/***/ 266:
21059/***/ (function(module, exports, __webpack_require__) {
21060
21061Object.defineProperty(exports, "__esModule", { value: true });
21062var tslib_1 = __webpack_require__(2);
21063var $ = __webpack_require__(3);
21064var fullcalendar_1 = __webpack_require__(1);
21065var GcalEventSource = /** @class */ (function (_super) {
21066    tslib_1.__extends(GcalEventSource, _super);
21067    function GcalEventSource() {
21068        return _super !== null && _super.apply(this, arguments) || this;
21069    }
21070    GcalEventSource.parse = function (rawInput, calendar) {
21071        var rawProps;
21072        if (typeof rawInput === 'object') {
21073            rawProps = rawInput;
21074        }
21075        else if (typeof rawInput === 'string') {
21076            rawProps = { url: rawInput }; // url will be parsed with parseGoogleCalendarId
21077        }
21078        if (rawProps) {
21079            return fullcalendar_1.EventSource.parse.call(this, rawProps, calendar);
21080        }
21081        return false;
21082    };
21083    GcalEventSource.prototype.fetch = function (start, end, timezone) {
21084        var _this = this;
21085        var url = this.buildUrl();
21086        var requestParams = this.buildRequestParams(start, end, timezone);
21087        var ajaxSettings = this.ajaxSettings || {};
21088        var onSuccess = ajaxSettings.success;
21089        if (!requestParams) {
21090            return fullcalendar_1.Promise.reject();
21091        }
21092        this.calendar.pushLoading();
21093        return fullcalendar_1.Promise.construct(function (onResolve, onReject) {
21094            $.ajax($.extend({}, // destination
21095            fullcalendar_1.JsonFeedEventSource.AJAX_DEFAULTS, ajaxSettings, {
21096                url: url,
21097                data: requestParams,
21098                success: function (responseData, status, xhr) {
21099                    var rawEventDefs;
21100                    var successRes;
21101                    _this.calendar.popLoading();
21102                    if (responseData.error) {
21103                        _this.reportError('Google Calendar API: ' + responseData.error.message, responseData.error.errors);
21104                        onReject();
21105                    }
21106                    else if (responseData.items) {
21107                        rawEventDefs = _this.gcalItemsToRawEventDefs(responseData.items, requestParams.timeZone);
21108                        successRes = fullcalendar_1.applyAll(onSuccess, _this, [responseData, status, xhr]); // passthru
21109                        if ($.isArray(successRes)) {
21110                            rawEventDefs = successRes;
21111                        }
21112                        onResolve(_this.parseEventDefs(rawEventDefs));
21113                    }
21114                },
21115                error: function (xhr, statusText, errorThrown) {
21116                    _this.reportError('Google Calendar network failure: ' + statusText, [xhr, errorThrown]);
21117                    _this.calendar.popLoading();
21118                    onReject();
21119                }
21120            }));
21121        });
21122    };
21123    GcalEventSource.prototype.gcalItemsToRawEventDefs = function (items, gcalTimezone) {
21124        var _this = this;
21125        return items.map(function (item) {
21126            return _this.gcalItemToRawEventDef(item, gcalTimezone);
21127        });
21128    };
21129    GcalEventSource.prototype.gcalItemToRawEventDef = function (item, gcalTimezone) {
21130        var url = item.htmlLink || null;
21131        // make the URLs for each event show times in the correct timezone
21132        if (url && gcalTimezone) {
21133            url = injectQsComponent(url, 'ctz=' + gcalTimezone);
21134        }
21135        return {
21136            id: item.id,
21137            title: item.summary,
21138            start: item.start.dateTime || item.start.date,
21139            end: item.end.dateTime || item.end.date,
21140            url: url,
21141            location: item.location,
21142            description: item.description
21143        };
21144    };
21145    GcalEventSource.prototype.buildUrl = function () {
21146        return GcalEventSource.API_BASE + '/' +
21147            encodeURIComponent(this.googleCalendarId) +
21148            '/events?callback=?'; // jsonp
21149    };
21150    GcalEventSource.prototype.buildRequestParams = function (start, end, timezone) {
21151        var apiKey = this.googleCalendarApiKey || this.calendar.opt('googleCalendarApiKey');
21152        var params;
21153        if (!apiKey) {
21154            this.reportError('Specify a googleCalendarApiKey. See http://fullcalendar.io/docs/google_calendar/');
21155            return null;
21156        }
21157        // The API expects an ISO8601 datetime with a time and timezone part.
21158        // Since the calendar's timezone offset isn't always known, request the date in UTC and pad it by a day on each
21159        // side, guaranteeing we will receive all events in the desired range, albeit a superset.
21160        // .utc() will set a zone and give it a 00:00:00 time.
21161        if (!start.hasZone()) {
21162            start = start.clone().utc().add(-1, 'day');
21163        }
21164        if (!end.hasZone()) {
21165            end = end.clone().utc().add(1, 'day');
21166        }
21167        params = $.extend(this.ajaxSettings.data || {}, {
21168            key: apiKey,
21169            timeMin: start.format(),
21170            timeMax: end.format(),
21171            singleEvents: true,
21172            maxResults: 9999
21173        });
21174        if (timezone && timezone !== 'local') {
21175            // when sending timezone names to Google, only accepts underscores, not spaces
21176            params.timeZone = timezone.replace(' ', '_');
21177        }
21178        return params;
21179    };
21180    GcalEventSource.prototype.reportError = function (message, apiErrorObjs) {
21181        var calendar = this.calendar;
21182        var calendarOnError = calendar.opt('googleCalendarError');
21183        var errorObjs = apiErrorObjs || [{ message: message }]; // to be passed into error handlers
21184        if (this.googleCalendarError) {
21185            this.googleCalendarError.apply(calendar, errorObjs);
21186        }
21187        if (calendarOnError) {
21188            calendarOnError.apply(calendar, errorObjs);
21189        }
21190        // print error to debug console
21191        fullcalendar_1.warn.apply(null, [message].concat(apiErrorObjs || []));
21192    };
21193    GcalEventSource.prototype.getPrimitive = function () {
21194        return this.googleCalendarId;
21195    };
21196    GcalEventSource.prototype.applyManualStandardProps = function (rawProps) {
21197        var superSuccess = fullcalendar_1.EventSource.prototype.applyManualStandardProps.apply(this, arguments);
21198        var googleCalendarId = rawProps.googleCalendarId;
21199        if (googleCalendarId == null && rawProps.url) {
21200            googleCalendarId = parseGoogleCalendarId(rawProps.url);
21201        }
21202        if (googleCalendarId != null) {
21203            this.googleCalendarId = googleCalendarId;
21204            return superSuccess;
21205        }
21206        return false;
21207    };
21208    GcalEventSource.prototype.applyMiscProps = function (rawProps) {
21209        if (!this.ajaxSettings) {
21210            this.ajaxSettings = {};
21211        }
21212        $.extend(this.ajaxSettings, rawProps);
21213    };
21214    GcalEventSource.API_BASE = 'https://www.googleapis.com/calendar/v3/calendars';
21215    return GcalEventSource;
21216}(fullcalendar_1.EventSource));
21217exports.default = GcalEventSource;
21218GcalEventSource.defineStandardProps({
21219    // manually process...
21220    url: false,
21221    googleCalendarId: false,
21222    // automatically transfer...
21223    googleCalendarApiKey: true,
21224    googleCalendarError: true
21225});
21226function parseGoogleCalendarId(url) {
21227    var match;
21228    // detect if the ID was specified as a single string.
21229    // will match calendars like "[email protected]" in addition to person email calendars.
21230    if (/^[^\/]+@([^\/\.]+\.)*(google|googlemail|gmail)\.com$/.test(url)) {
21231        return url;
21232    }
21233    else if ((match = /^https:\/\/www.googleapis.com\/calendar\/v3\/calendars\/([^\/]*)/.exec(url)) ||
21234        (match = /^https?:\/\/www.google.com\/calendar\/feeds\/([^\/]*)/.exec(url))) {
21235        return decodeURIComponent(match[1]);
21236    }
21237}
21238// Injects a string like "arg=value" into the querystring of a URL
21239function injectQsComponent(url, component) {
21240    // inject it after the querystring but before the fragment
21241    return url.replace(/(\?.*?)?(#|$)/, function (whole, qs, hash) {
21242        return (qs ? qs + '&' : '?') + component + hash;
21243    });
21244}
21245
21246
21247/***/ }),
21248
21249/***/ 3:
21250/***/ (function(module, exports) {
21251
21252module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
21253
21254/***/ })
21255
21256/******/ });
21257});
21258
21259/*  jqueryuitouch-punchmin  */
21260/*!
21261 * jQuery UI Touch Punch 0.2.3
21262 *
21263 * Copyright 2011–2014, Dave Furfero
21264 * Dual licensed under the MIT or GPL Version 2 licenses.
21265 *
21266 * Depends:
21267 *  jquery.ui.widget.js
21268 *  jquery.ui.mouse.js
21269 */
21270!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
21271
21272/*  hammer  */
21273/*! Hammer.JS - v2.0.8 - 2016-04-23
21274 * http://hammerjs.github.io/
21275 *
21276 * Copyright (c) 2016 Jorik Tangelder;
21277 * Licensed under the MIT license */
21278!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"\n"+d+" AT \n";return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ma.length;){if(c=ma[g],e=c?c+f:b,e in a)return e;g++}return d}function v(){return ua++}function w(b){var c=b.ownerDocument||b;return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;return new(b=c?c:xa?M:ya?P:wa?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&Ea&&d-e===0,g=b&(Ga|Ha)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);
vendor: 14,334 bytes, line 21278
21278b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:pa(a.pointers[c].clientX),clientY:pa(a.pointers[c].clientY)},c++;return{timeStamp:ra(),pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b)return{x:pa(a[0].clientX),y:pa(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ea)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ga|Ha)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),this.mouse=new L(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}function S(a,b){a&Ea?(this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):a&(Ga|Ha)&&T.call(this,b)}function T(a){var b=a.changedPointers[0];if(b.identifier===this.primaryTouch){var c={x:b.clientX,y:b.clientY};this.lastTouches.push(c);var d=this.lastTouches,e=function(){var a=d.indexOf(c);a>-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d<this.lastTouches.length;d++){var e=this.lastTouches[d],f=Math.abs(b-e.x),g=Math.abs(c-e.y);if(db>=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=c?a.CSS.supports("touch-action",d):!0}),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var sa=h(function(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a},"extend","Use `assign`."),ta=h(function(a,b){return sa(a,b,!0)},"merge","Use `assign`."),ua=1,va=/mobile|tablet|ip(ad|hone|od)|android/i,wa="ontouchstart"in a,xa=u(a,"PointerEvent")!==d,ya=wa&&va.test(navigator.userAgent),za="touch",Aa="pen",Ba="mouse",Ca="kinect",Da=25,Ea=1,Fa=2,Ga=4,Ha=8,Ia=1,Ja=2,Ka=4,La=8,Ma=16,Na=Ja|Ka,Oa=La|Ma,Pa=Na|Oa,Qa=["x","y"],Ra=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(this.element),this.evWin,this.domHandler)}};var Sa={mousedown:Ea,mousemove:Fa,mouseup:Ga},Ta="mousedown",Ua="mousemove mouseup";i(L,x,{handler:function(a){var b=Sa[a.type];b&Ea&&0===a.button&&(this.pressed=!0),b&Fa&&1!==a.which&&(b=Ga),this.pressed&&(b&Ga&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:Ba,srcEvent:a}))}});var Va={pointerdown:Ea,pointermove:Fa,pointerup:Ga,pointercancel:Ha,pointerout:Ha},Wa={2:za,3:Aa,4:Ba,5:Ca},Xa="pointerdown",Ya="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown",Ya="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Va[d],f=Wa[a.pointerType]||a.pointerType,g=f==za,h=r(b,a.pointerId,"pointerId");e&Ea&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(tb|nb)))return!1;a++}return!0},recognize:function(a){var b=la({},a);return k(this.options.enable,[this,b])?(this.state&(rb|sb|tb)&&(this.state=nb),this.state=this.process(b),void(this.state&(ob|pb|qb|sb)&&this.tryEmit(b))):(this.reset(),void(this.state=tb))},process:function(a){},getTouchAction:function(){},reset:function(){}},i(aa,Y,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(ob|pb),e=this.attrTest(a);return d&&(c&Ha||!e)?b|sb:d||e?c&Ga?b|qb:b&ob?b|pb:ob:tb}}),i(ba,aa,{defaults:{event:"pan",threshold:10,pointers:1,direction:Pa},getTouchAction:function(){var a=this.options.direction,b=[];return a&Na&&b.push(lb),a&Oa&&b.push(kb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Na?(e=0===f?Ia:0>f?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaT
21278ime<b.time;if(this.reset(),a.eventType&Ea&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ga)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||H(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=rb,this.tryEmit()},b.interval,this),ob):rb}return tb},failTimeout:function(){return this._timer=e(function(){this.state=tb},this.options.interval,this),tb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ha.VERSION="2.0.8",ha.defaults={domEvents:!1,touchAction:gb,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[ca,{enable:!1},["rotate"]],[fa,{direction:Na}],[ba,{direction:Na},["swipe"]],[ga],[ga,{event:"doubletap",taps:2},["tap"]],[da]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ub=1,vb=2;ia.prototype={set:function(a){return la(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?vb:ub},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&rb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(ob|pb|qb)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Y)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}return this},on:function(a,b){if(a!==d&&b!==d){var c=this.handlers;return g(q(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this}},off:function(a,b){if(a!==d){var c=this.handlers;return g(q(a),function(a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]}),this}},emit:function(a,b){this.options.domEvents&&ka(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&ja(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},la(ha,{INPUT_START:Ea,INPUT_MOVE:Fa,INPUT_END:Ga,INPUT_CANCEL:Ha,STATE_POSSIBLE:nb,STATE_BEGAN:ob,STATE_CHANGED:pb,STATE_ENDED:qb,STATE_RECOGNIZED:rb,STATE_CANCELLED:sb,STATE_FAILED:tb,DIRECTION_NONE:Ia,DIRECTION_LEFT:Ja,DIRECTION_RIGHT:Ka,DIRECTION_UP:La,DIRECTION_DOWN:Ma,DIRECTION_HORIZONTAL:Na,DIRECTION_VERTICAL:Oa,DIRECTION_ALL:Pa,Manager:ia,Input:x,TouchAction:V,TouchInput:P,MouseInput:L,PointerEventInput:M,TouchMouseInput:R,SingleTouchInput:N,Recognizer:Y,AttrRecognizer:aa,Tap:ga,Pan:ba,Swipe:fa,Pinch:ca,Rotate:ea,Press:da,on:m,off:n,each:g,merge:ta,extend:sa,assign:la,inherit:i,bindFn:j,prefixed:u});var wb="undefined"!=typeof a?a:"undefined"!=typeof self?self:{};wb.Hammer=ha,"function"==typeof define&&define.amd?define(function(){return ha}):"undefined"!=typeof module&&module.exports?module.exports=ha:a[c]=ha}(window,document,"Hammer");
21279//# sourceMappingURL=hammer.min.js.map
21280
21281/*  backbone-min  */
21282(function (t) { var e = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global; if (typeof define === "function" && define.amd) { define(["underscore", "jquery", "exports"], function (i, n, r) { e.Backbone = t(e, r, i, n) }) } else if (typeof exports !== "undefined") { var i = require("underscore"), n; try { n = require("jquery") } catch (r) { } t(e, exports, i, n) } else { e.Backbone = t(e, {}, e._, e.jQuery || e.Zepto || e.ender || e.$) } })(function (t, e, i, n) { var r = t.Backbone; var s = Array.prototype.slice; e.VERSION = "1.4.0"; e.$ = n; e.noConflict = function () { t.Backbone = r; return this }; e.emulateHTTP = false; e.emulateJSON = false; var a = e.Events = {}; var o = /\s+/; var h; var u = function (t, e, n, r, s) { var a = 0, h; if (n && typeof n === "object") { if (r !== void 0 && "context" in s && s.context === void 0) s.context = r; for (h = i.keys(n); a < h.length; a++) { e = u(t, e, h[a], n[h[a]], s) } } else if (n && o.test(n)) { for (h = n.split(o); a < h.length; a++) { e = t(e, h[a], r, s) } } else { e = t(e, n, r, s) } return e }; a.on = function (t, e, i) { this._events = u(l, this._events || {}, t, e, { context: i, ctx: this, listening: h }); if (h) { var n = this._listeners || (this._listeners = {}); n[h.id] = h; h.interop = false } return this }; a.listenTo = function (t, e, n) { if (!t) return this; var r = t._listenId || (t._listenId = i.uniqueId("l")); var s = this._listeningTo || (this._listeningTo = {}); var a = h = s[r]; if (!a) { this._listenId || (this._listenId = i.uniqueId("l")); a = h = s[r] = new g(this, t) } var o = c(t, e, n, this); h = void 0; if (o) throw o; if (a.interop) a.on(e, n); return this }; var l = function (t, e, i, n) { if (i) { var r = t[e] || (t[e] = []); var s = n.context, a = n.ctx, o = n.listening; if (o) o.count++; r.push({ callback: i, context: s, ctx: s || a, listening: o }) } return t }; var c = function (t, e, i, n) { try { t.on(e, i, n) } catch (r) { return r } }; a.off = function (t, e, i) { if (!this._events) return this; this._events = u(f, this._events, t, e, { context: i, listeners: this._listeners }); return this }; a.stopListening = function (t, e, n) { var r = this._listeningTo; if (!r) return this; var s = t ? [t._listenId] : i.keys(r); for (var a = 0; a < s.length; a++) { var o = r[s[a]]; if (!o) break; o.obj.off(e, n, this); if (o.interop) o.off(e, n) } if (i.isEmpty(r)) this._listeningTo = void 0; return this }; var f = function (t, e, n, r) { if (!t) return; var s = r.context, a = r.listeners; var o = 0, h; if (!e && !s && !n) { for (h = i.keys(a); o < h.length; o++) { a[h[o]].cleanup() } return } h = e ? [e] : i.keys(t); for (; o < h.length; o++) { e = h[o]; var u = t[e]; if (!u) break; var l = []; for (var c = 0; c < u.length; c++) { var f = u[c]; if (n && n !== f.callback && n !== f.callback._callback || s && s !== f.context) { l.push(f) } else { var d = f.listening; if (d) d.off(e, n) } }
vendor: 26,058 bytes, line 21282
21282 if (l.length) { t[e] = l } else { delete t[e] } } return t }; a.once = function (t, e, i) { var n = u(d, {}, t, e, this.off.bind(this)); if (typeof t === "string" && i == null) e = void 0; return this.on(n, e, i) }; a.listenToOnce = function (t, e, i) { var n = u(d, {}, e, i, this.stopListening.bind(this, t)); return this.listenTo(t, n) }; var d = function (t, e, n, r) { if (n) { var s = t[e] = i.once(function () { r(e, s); n.apply(this, arguments) }); s._callback = n } return t }; a.trigger = function (t) { if (!this._events) return this; var e = Math.max(0, arguments.length - 1); var i = Array(e); for (var n = 0; n < e; n++)i[n] = arguments[n + 1]; u(v, this._events, t, void 0, i); return this }; var v = function (t, e, i, n) { if (t) { var r = t[e]; var s = t.all; if (r && s) s = s.slice(); if (r) p(r, n); if (s) p(s, [e].concat(n)) } return t }; var p = function (t, e) { var i, n = -1, r = t.length, s = e[0], a = e[1], o = e[2]; switch (e.length) { case 0: while (++n < r) (i = t[n]).callback.call(i.ctx); return; case 1: while (++n < r) (i = t[n]).callback.call(i.ctx, s); return; case 2: while (++n < r) (i = t[n]).callback.call(i.ctx, s, a); return; case 3: while (++n < r) (i = t[n]).callback.call(i.ctx, s, a, o); return; default: while (++n < r) (i = t[n]).callback.apply(i.ctx, e); return } }; var g = function (t, e) { this.id = t._listenId; this.listener = t; this.obj = e; this.interop = true; this.count = 0; this._events = void 0 }; g.prototype.on = a.on; g.prototype.off = function (t, e) { var i; if (this.interop) { this._events = u(f, this._events, t, e, { context: void 0, listeners: void 0 }); i = !this._events } else { this.count--; i = this.count === 0 } if (i) this.cleanup() }; g.prototype.cleanup = function () { delete this.listener._listeningTo[this.obj._listenId]; if (!this.interop) delete this.obj._listeners[this.id] }; a.bind = a.on; a.unbind = a.off; i.extend(e, a); var m = e.Model = function (t, e) { var n = t || {}; e || (e = {}); this.preinitialize.apply(this, arguments); this.cid = i.uniqueId(this.cidPrefix); this.attributes = {}; if (e.collection) this.collection = e.collection; if (e.parse) n = this.parse(n, e) || {}; var r = i.result(this, "defaults"); n = i.defaults(i.extend({}, r, n), r); this.set(n, e); this.changed = {}; this.initialize.apply(this, arguments) }; i.extend(m.prototype, a, { changed: null, validationError: null, idAttribute: "id", cidPrefix: "c", preinitialize: function () { }, initialize: function () { }, toJSON: function (t) { return i.clone(this.attributes) }, sync: function () { return e.sync.apply(this, arguments) }, get: function (t) { return this.attributes[t] }, escape: function (t) { return i.escape(this.get(t)) }, has: function (t) { return this.get(t) != null }, matches: function (t) { return !!i.iteratee(t, this)(this.attributes) }, set: function (t, e, n) { if (t == null) return this; var r; if (typeof t === "object") { r = t; n = e } else { (r = {})[t] = e } n || (n = {}); if (!this._validate(r, n)) return false; var s = n.unset; var a = n.silent; var o = []; var h = this._changing; this._changing = true; if (!h) { this._previousAttributes = i.clone(this.attributes); this.changed = {} } var u = this.attributes; var l = this.changed; var c = this._previousAttributes; for (var f in r) { e = r[f]; if (!i.isEqual(u[f], e)) o.push(f); if (!i.isEqual(c[f], e)) { l[f] = e } else { delete l[f] } s ? delete u[f] : u[f] = e } if (this.idAttribute in r) this.id = this.get(this.idAttribute); if (!a) { if (o.length) this._pending = n; for (var d = 0; d < o.length; d++) { this.trigger("change:" + o[d], this, u[o[d]], n) } } if (h) return this; if (!a) { while (this._pending) { n = this._pending; this._pending = false; this.trigger("change", this, n) } } this._pending = false; this._changing = false; return this }, unset: function (t, e) { return this.set(t, void 0, i.extend({}, e, { unset: true })) }, clear: function (t) { var e = {}; for (var n in this.attributes) e[n] = void 0; return this.set(e, i.extend({}, t, { unset: true })) }, hasChanged: function (t) { if (t == null) return !i.isEmpty(this.changed); return i.has(this.changed, t) }, changedAttributes: function (t) { if (!t) return this.hasChanged() ? i.clone(this.changed) : false; var e = this._changing ? this._previousAttributes : this.attributes; var n = {}; var r; for (var s in t) { var a = t[s]; if (i.isEqual(e[s], a)) continue; n[s] = a; r = true } return r ? n : false }, previous: function (t) { if (t == null || !this._previousAttributes) return null; return this._previousAttributes[t] }, previousAttributes: function () { return i.clone(this._previousAttributes) }, fetch: function (t) { t = i.extend({ parse: true }, t); var e = this; var n = t.success; t.success = function (i) { var r = t.parse ? e.parse(i, t) : i; if (!e.set(r, t)) return false; if (n) n.call(t.context, e, i, t); e.trigger("sync", e, i, t) }; G(this, t); return this.sync("read", this, t) }, save: function (t, e, n) { var r; if (t == null || typeof t === "object") { r = t; n = e } else { (r = {})[t] = e } n = i.extend({ validate: true, parse: true }, n); var s = n.wait; if (r && !s) { if (!this.set(r, n)) return false } else if (!this._validate(r, n)) { return false } var a = this; var o = n.success; var h = this.attributes; n.success = function (t) { a.attributes = h; var e = n.parse ? a.parse(t, n) : t; if (s) e = i.extend({}, r, e); if (e && !a.set(e, n)) return false; if (o) o.call(n.context, a, t, n); a.trigger("sync", a, t, n) }; G(this, n); if (r && s) this.attributes = i.extend({}, h, r); var u = this.isNew() ? "create" : n.patch ? "patch" : "update"; if (u === "patch" && !n.attrs) n.attrs = r; var l = this.sync(u, this, n); this.attributes = h; return l }, destroy: function (t) { t = t ? i.clone(t) : {}; var e = this; var n = t.success; var r = t.wait; var s = function () { e.stopListening(); e.trigger("destroy", e, e.collection, t) }; t.success = function (i) { if (r) s(); if (n) n.call(t.context, e, i, t); if (!e.isNew()) e.trigger("sync", e, i, t) }; var a = false; if (this.isNew()) { i.defer(t.success) } else { G(this, t); a = this.sync("delete", this, t) } if (!r) s(); return a }, url: function () { var t = i.result(this, "urlRoot") || i.result(this.collection, "url") || V(); if (this.isNew()) return t; var e = this.get(this.idAttribute); return t.replace(/[^\/]$/, "$&/") + encodeURIComponent(e) }, parse: function (t, e) { return t }, clone: function () { return new this.constructor(this.attributes) }, isNew: function () { return !this.has(this.idAttribute) }, isValid: function (t) { return this._validate({}, i.extend({}, t, { validate: true })) }, _validate: function (t, e) { if (!e.validate || !this.validate) return true; t = i.extend({}, this.attributes, t); var n = this.validationError = this.validate(t, e) || null; if (!n) return true; this.trigger("invalid", this, n, i.extend(e, { validationError: n })); return false } }); var _ = e.Collection = function (t, e) { e || (e = {}); this.preinitialize.apply(this, arguments); if (e.model) this.model = e.model; if (e.comparator !== void 0) this.comparator = e.comparator; this._reset(); this.initialize.apply(this, arguments); if (t) this.reset(t, i.extend({ silent: true }, e)) }; var y = { add: true, remove: true, merge: true }; var b = { add: true, remove: false }; var x = function (t, e, i) { i = Math.min(Math.max(i, 0), t.length); var n = Array(t.length - i); var r = e.length; var s; for (s = 0; s < n.length; s++)n[s] = t[s + i]; for (s = 0; s < r; s++)t[s + i] = e[s]; for (s = 0; s < n.length; s++)t[s + r + i] = n[s] }; i.extend(_.prototype, a, { model: m, preinitialize: function () { }, initialize: function () { }, toJSON: function (t) { return this.map(function (e) { return e.toJSON(t) }) }, sync: function () { return e.sync.apply(this, arguments) }, add: function (t, e) { return this.set(t, i.extend({ merge: false }, e, b)) }, remove: function (t, e) { e = i.extend({}, e); var n = !i.isArray(t); t = n ? [t] : t.slice(); var r = this._removeModels(t, e); if (!e.silent && r.length) { e.changes = { added: [], merged: [], removed: r }; this.trigger("update", this, e) } return n ? r[0] : r }, set: function (t, e) { if (t == null) return; e = i.extend({}, y, e); if (e.parse && !this._isModel(t)) { t = this.parse(t, e) || [] } var n = !i.isArray(t); t = n ? [t] : t.slice(); var r = e.at; if (r != null) r = +r; if (r > this.length) r = this.length; if (r < 0) r += this.length + 1; var s = []; var a = []; var o = []; var h = []; var u = {}; var l = e.add; var c = e.merge; var f = e.remove; var d = false; var v = this.comparator && r == null && e.sort !== false; var p = i.isString(this.comparator) ? this.comparator : null; var g, m; for (m = 0; m < t.length; m++) { g = t[m]; var _ = this.get(g); if (_) { if (c && g !== _) { var b = this._isModel(g) ? g.attributes : g; if (e.parse) b = _.parse(b, e); _.set(b, e); o.push(_); if (v && !d) d = _.hasChanged(p) } if (!u[_.cid]) { u[_.cid] = true; s.push(_) } t[m] = _ } else if (l) { g = t[m] = this._prepareModel(g, e); if (g) { a.push(g); this._addReference(g, e); u[g.cid] = true; s.push(g) } } } if (f) { for (m = 0; m < this.length; m++) { g = this.models[m]; if (!u[g.cid]) h.push(g) } if (h.length) this._removeModels(h, e) } var w = false; var E = !v && l && f; if (s.length && E) { w = this.length !== s.length || i.some(this.models, function (t, e) { return t !== s[e] }); this.models.length = 0; x(this.models, s, 0); this.length = this.models.length } else if (a.length) { if (v) d = true; x(this.models, a, r == null ? this.length : r); this.length = this.models.length } if (d) this.sort({ silent: true }); if (!e.silent) { for (m = 0; m < a.length; m++) { if (r != null) e.index = r + m; g = a[m]; g.trigger("add", g, this, e) } if (d || w) this.trigger("sort", this, e); if (a.length || h.length || o.length) { e.changes = { added: a, removed: h, merged: o }; this.trigger("update", this, e) } } return n ? t[0] : t }, reset: function (t, e) { e = e ? i.clone(e) : {}; for (var n = 0; n < this.models.length; n++) { this._removeReference(this.models[n], e) } e.previousModels = this.models; this._reset(); t = this.add(t, i.extend({ silent: true }, e)); if (!e.silent) this.trigger("reset", this, e); return t }, push: function (t, e) { return this.add(t, i.extend({ at: this.length }, e)) }, pop: function (t) { var e = this.at(this.length - 1); return this.remove(e, t) }, unshift: function (t, e) { return this.add(t, i.extend({ at: 0 }, e)) }, shift: function (t) { var e = this.at(0); return this.remove(e, t) }, slice: function () { return s.apply(this.models, arguments) }, get: function (t) { if (t == null) return void 0; return this._byId[t] || this._byId[this.modelId(this._isModel(t) ? t.attributes : t)] || t.cid && this._byId[t.cid] }, has: function (t) { return this.get(t) != null }, at: function (t) { if (t < 0) t += this.length; return this.models[t] }, where: function (t, e) { return this[e ? "find" : "filter"](t) }, findWhere: function (t) { return this.where(t, true) }, sort: function (t) { var e = this.comparator; if (!e) throw new Error("Cannot sort a set without a comparator"); t || (t = {}); var n = e.length; if (i.isFunction(e)) e = e.bind(this); if (n === 1 || i.isString(e)) { this.models = this.sortBy(e) } else { this.models.sort(e) } if (!t.silent) this.trigger("sort", this, t); return this }, pluck: function (t) { return this.map(t + "") }, fetch: function (t) { t = i.extend({ parse: true }, t); var e = t.success; var n = this; t.success = function (i) { var r = t.reset ? "reset" : "set"; n[r](i, t); if (e) e.call(t.context, n, i, t); n.trigger("sync", n, i, t) }; G(this, t); return this.sync("read", this, t) }, create: function (t, e) { e = e ? i.clone(e) : {}; var n = e.wait; t = this._prepareModel(t, e); if (!t) return false; if (!n) this.add(t, e); var r = this; var s = e.success; e.success = function (t, e, i) { if (n) r.add(t, i); if (s) s.call(i.context, t, e, i) }; t.save(null, e); return t }, parse: function (t, e) { return t }, clone: function () { return new this.constructor(this.models, { model: this.model, comparator: this.comparator }) }, modelId: function (t) { return t[this.model.prototype.idAttribute || "id"] }, values: function () { return new E(this, k) }, keys: function () { return new E(this, I) }, entries: function () { return new E(this, S) }, _reset: function () { this.length = 0; this.models = []; this._byId = {} }, _prepareModel: function (t, e) { if (this._isModel(t)) { if (!t.collection) t.collection = this; return t } e = e ? i.clone(e) : {}; e.collection = this; var n = new this.model(t, e); if (!n.validationError) return n; this.trigger("invalid", this, n.validationError, e); return false }, _removeModels: function (t, e) { var i = []; for (var n = 0; n < t.length; n++) { var r = this.get(t[n]); if (!r) continue; var s = this.indexOf(r); this.models.splice(s, 1); this.length--; delete this._byId[r.cid]; var a = this.modelId(r.attributes); if (a != null) delete this._byId[a]; if (!e.silent) { e.index = s; r.trigger("remove", r, this, e) } i.push(r); this._removeReference(r, e) } return i }, _isModel: function (t) { return t instanceof m }, _addReference: function (t, e) { this._byId[t.cid] = t; var i = this.modelId(t.attributes); if (i != null) this._byId[i] = t; t.on("all", this._onModelEvent, this) }, _removeReference: function (t, e) { delete this._byId[t.cid]; var i = this.modelId(t.attributes); if (i != null) delete this._byId[i]; if (this === t.collection) delete t.collection; t.off("all", this._onModelEvent, this) }, _onModelEvent: function (t, e, i, n) { if (e) { if ((t === "add" || t === "remove") && i !== this) return; if (t === "destroy") this.remove(e, n); if (t === "change") { var r = this.modelId(e.previousAttributes()); var s = this.modelId(e.attributes); if (r !== s) { if (r != null) delete this._byId[r]; if (s != null) this._byId[s] = e } } } this.trigger.apply(this, arguments) } }); var w = typeof Symbol === "function" && Symbol.iterator; if (w) { _.prototype[w] = _.prototype.values } var E = function (t, e) { this._collection = t; this._kind = e; this._index = 0 }; var k = 1; var I = 2; var S = 3; if (w) { E.prototype[w] = function () { return this } } E.prototype.next = function () { if (this._collection) { if (this._index < this._collection.length) { var t = this._collection.at(this._index); this._index++; var e; if (this._kind === k) { e = t } else { var i = this._collection.modelId(t.attributes); if (this._kind === I) { e = i } else { e = [i, t] } } return { value: e, done: false } } this._collection = void 0 } return { value: void 0, done: true } }; var T = e.View = function (t) { this.cid = i.uniqueId("view"); this.preinitialize.apply(this, arguments); i.extend(this, i.pick(t, H)); this._ensureElement(); this.initialize.apply(this, arguments) }; var P = /^(\S+)\s*(.*)$/; var H = ["model", "collection", "el", "id", "attributes", "className", "tagName", "events"]; i.extend(T.prototype, a, { tagName: "div", $: function (t) { return this.$el.find(t) }, preinitialize: function () { }, initialize: function () { }, render: function () { return this }, remove: function () { this._removeElement(); this.stopListening(); return this }, _removeElement: function () { this.$el.remove() }, setElement: function (t) { this.undelegateEvents(); this._setElement(t); this.delegateEvents(); return this }, _setElement: function (t) { this.$el = t instanceof e.$ ? t : e.$(t); this.el = this.$el[0] }, delegateEvents: function (t) { t || (t = i.result(this, "events")); if (!t) return this; this.undelegateEvents(); for (var e in t) { var n = t[e]; if (!i.isFunction(n)) n = this[n]; if (!n) continue; var r = e.match(P); this.delegate(r[1], r[2], n.bind(this)) } return this }, delegate: function (t, e, i) { this.$el.on(t + ".delegateEvents" + this.cid, e, i); return this }, undelegateEvents: function () { if (this.$el) this.$el.off(".delegateEvents" + this.cid); return this }, undelegate: function (t, e, i) { this.$el.off(t + ".delegateEvents" + this.cid, e, i); return this }, _createElement: function (t) { return document.createElement(t) }, _ensureElement: function () { if (!this.el) { var t = i.extend({}, i.result(this, "attributes")); if (this.id) t.id = i.result(this, "id"); if (this.className) t["class"] = i.result(this, "className"); this.setElement(this._createElement(i.result(this, "tagName"))); this._setAttributes(t) } else { this.setElement(i.result(this, "el")) } }, _setAttributes: function (t) { this.$el.attr(t) } }); var $ = function (t, e, i, n) { switch (e) { case 1: return function () { return t[i](this[n]) }; case 2: return function (e) { return t[i](this[n], e) }; case 3: return function (e, r) { return t[i](this[n], C(e, this), r) }; case 4: return function (e, r, s) { return t[i](this[n], C(e, this), r, s) }; default: return function () { var e = s.call(arguments); e.unshift(this[n]); return t[i].apply(t, e) } } }; var A = function (t, e, n, r) { i.each(n, function (i, n) { if (e[n]) t.prototype[n] = $(e, i, n, r) }) }; var C = function (t, e) { if (i.isFunction(t)) return t; if (i.isObject(t) && !e._isModel(t)) return R(t); if (i.isString(t)) return function (e) { return e.get(t) }; return t }; var R = function (t) { var e = i.matches(t); return function (t) { return e(t.attributes) } }; var M = { forEach: 3, each: 3, map: 3, collect: 3, reduce: 0, foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3, select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3, contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3, head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3, without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3, isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3, sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3 }; var N = { keys: 1, values: 1, pairs: 1, invert: 1, pick: 0, omit: 0, chain: 1, isEmpty: 1 }; i.each([[_, M, "models"], [m, N, "attributes"]], function (t) { var e = t[0], n = t[1], r = t[2]; e.mixin = function (t) { var n = i.reduce(i.functions(t), function (t, e) { t[e] = 0; return t }, {}); A(e, t, n, r) }; A(e, i, n, r) }); e.sync = function (t, n, r) { var s = j[t]; i.defaults(r || (r = {}), { emulateHTTP: e.emulateHTTP, emulateJSON: e.emulateJSON }); var a = { type: s, dataType: "json" }; if (!r.url) { a.url = i.result(n, "url") || V() } if (r.data == null && n && (t === "create" || t === "update" || t === "patch")) { a.contentType = "application/json"; a.data = JSON.stringify(r.attrs || n.toJSON(r)) } if (r.emulateJSON) { a.contentType = "application/x-www-form-urlencoded"; a.data = a.data ? { model: a.data } : {} } if (r.emulateHTTP && (s === "PUT" || s === "DELETE" || s === "PATCH")) { a.type = "POST"; if (r.emulateJSON) a.data._method = s; var o = r.beforeSend; r.beforeSend = function (t) { t.setRequestHeader("X-HTTP-Method-Override", s); if (o) return o.apply(this, arguments) } } if (a.type !== "GET" && !r.emulateJSON) { a.processData = false } var h = r.error; r.error = function (t, e, i) { r.textStatus = e; r.errorThrown = i; if (h) h.call(r.context, t, e, i) }; var u = r.xhr = e.ajax(i.extend(a, r)); n.trigger("request", n, u, r); return u }; var j = { create: "POST", update: "PUT", patch: "PATCH", "delete": "DELETE", read: "GET" }; e.ajax = function () { return e.$.ajax.apply(e.$, arguments) }; var O = e.Router = function (t) { t || (t = {}); this.preinitialize.apply(this, arguments); if (t.routes) this.routes = t.routes; this._bindRoutes(); this.initialize.apply(this, arguments) }; var U = /\((.*?)\)/g; var z = /(\(\?)?:\w+/g; var q = /\*\w+/g; var F = /[\-{}\[\]+?.,\\\^$|#\s]/g; i.extend(O.prototype, a, { preinitialize: function () { }, initialize: function () { }, route: function (t, n, r) { if (!i.isRegExp(t)) t = this._routeToRegExp(t); if (i.isFunction(n)) { r = n; n = "" } if (!r) r = this[n]; var s = this; e.history.route(t, function (i) { var a = s._extractParameters(t, i); if (s.execute(r, a, n) !== false) { s.trigger.apply(s, ["route:" + n].concat(a)); s.trigger("route", n, a); e.history.trigger("route", s, n, a) } }); return this }, execute: function (t, e, i) { if (t) t.apply(this, e) }, navigate: function (t, i) { e.history.navigate(t, i); return this }, _bindRoutes: function () { if (!this.routes) return; this.routes = i.result(this, "routes"); var t, e = i.keys(this.routes); while ((t = e.pop()) != null) { this.route(t, this.routes[t]) } }, _routeToRegExp: function (t) { t = t.replace(F, "\\$&").replace(U, "(?:$1)?").replace(z, function (t, e) { return e ? t : "([^/?]+)" }).replace(q, "([^?]*?)"); return new RegExp("^" + t + "(?:\\?([\\s\\S]*))?$") }, _extractParameters: function (t, e) { var n = t.exec(e).slice(1); return i.map(n, function (t, e) { if (e === n.length - 1) return t || null; return t ? decodeURIComponent(t) : null }) } }); var B = e.History = function () { this.handlers = []; this.checkUrl = this.checkUrl.bind(this); if (typeof window !== "undefined") { this.location = window.location; this.history = window.history } }; var J = /^[#\/]|\s+$/g; var L = /^\/+|\/+$/g; var W = /#.*$/; B.started = false; i.extend(B.prototype, a, { interval: 50, atRoot: function () { var t = this.location.pathname.replace(/[^\/]$/, "$&/"); return t === this.root && !this.getSearch() }, matchRoot: function () { var t = this.decodeFragment(this.location.pathname); var e = t.slice(0, this.root.length - 1) + "/"; return e === this.root }, decodeFragment: function (t) { return decodeURI(t.replace(/%25/g, "%2525")) }, getSearch: function () { var t = this.location.href.replace(/#.*/, "").match(/\?.+/); return t ? t[0] : "" }, getHash: function (t) { var e = (t || this).location.href.match(/#(.*)$/); return e ? e[1] : "" }, getPath: function () { var t = this.decodeFragment(this.location.pathname + this.getSearch()).slice(this.root.length - 1); return t.charAt(0) === "/" ? t.slice(1) : t }, getFragment: function (t) { if (t == null) { if (this._usePushState || !this._wantsHashChange) { t = this.getPath() } else { t = this.getHash() } } return t.replace(J, "") }, start: function (t) { if (B.started) throw new Error("Backbone.history has already been started"); B.started = true; this.options = i.extend({ root: "/" }, this.options, t); this.root = this.options.root; this._wantsHashChange = this.options.hashChange !== false; this._hasHashChange = "onhashchange" in window && (document.documentMode === void 0 || document.documentMode > 7); this._useHashChange = this._wantsHashChange && this._hasHashChange; this._wantsPushState = !!this.options.pushState; this._hasPushState = !!(this.history && this.history.pushState); this._usePushState = this._wantsPushState && this._hasPushState; this.fragment = this.getFragment(); this.root = ("/" + this.root + "/").replace(L, "/"); if (this._wantsHashChange && this._wantsPushState) { if (!this._hasPushState && !this.atRoot()) { var e = this.root.slice(0, -1) || "/"; this.location.replace(e + "#" + this.getPath()); return true } else if (this._hasPushState && this.atRoot()) { this.navigate(this.getHash(), { replace: true }) } } if (!this._hasHashChange && this._wantsHashChange && !this._usePushState) { this.iframe = document.createElement("iframe"); this.iframe.src = "javascript:0"; this.iframe.style.display = "none"; this.iframe.tabIndex = -1; var n = document.body; var r = n.insertBefore(this.iframe, n.firstChild).contentWindow; r.document.open(); r.document.close(); r.location.hash = "#" + this.fragment } var s = window.addEventListener || function (t, e) { return attachEvent("on" + t, e) }; if (this._usePushState) { s("popstate", this.checkUrl, false) } else if (this._useHashChange && !this.iframe) { s("hashchange", this.checkUrl, false) } else if (this._wantsHashChange) { this._checkUrlInterval = setInterval(this.checkUrl, this.interval) } if (!this.options.silent) return this.loadUrl() }, stop: function () { var t = window.removeEventListener || function (t, e) { return detachEvent("on" + t, e) }; if (this._usePushState) { t("popstate", this.checkUrl, false) } else if (this._useHashChange && !this.iframe) { t("hashchange", this.checkUrl, false) } if (this.iframe) { document.body.removeChild(this.iframe); this.iframe = null } if (this._checkUrlInterval) clearInterval(this._checkUrlInterval); B.started = false }, route: function (t, e) { this.handlers.unshift({ route: t, callback: e }) }, checkUrl: function (t) { var e = this.getFragment(); if (e === this.fragment && this.iframe) { e = this.getHash(this.iframe.contentWindow) } if (e === this.fragment) return false; if (this.iframe) this.navigate(e); this.loadUrl() }, loadUrl: function (t) { if (!this.matchRoot()) return false; t = this.fragment = this.getFragment(t); return i.some(this.handlers, function (e) { if (e.route.test(t)) { e.callback(t); return true } }) }, navigate: function (t, e) { if (!B.started) return false; if (!e || e === true) e = { trigger: !!e }; t = this.getFragment(t || ""); var i = this.root; if (t === "" || t.charAt(0) === "?") { i = i.slice(0, -1) || "/" } var n = i + t; t = t.replace(W, ""); var r = this.decodeFragment(t); if (this.fragment === r) return; this.fragment = r; if (this._usePushState) { this.history[e.replace ? "replaceState" : "pushState"]({}, document.title, n) } else if (this._wantsHashChange) { this._updateHash(this.location, t, e.replace); if (this.iframe && t !== this.getHash(this.iframe.contentWindow)) { var s = this.iframe.contentWindow; if (!e.replace) { s.document.open(); s.document.close() } this._updateHash(s.location, t, e.replace) } } else { return this.location.assign(n) } if (e.trigger) return this.loadUrl(t) }, _updateHash: function (t, e, i) { if (i) { var n = t.href.replace(/(javascript:|#).*$/, ""); t.replace(n + "#" + e) } else { t.hash = "#" + e } } }); e.history = new B; var D = function (t, e) { var n = this; var r; if (t && i.has(t, "constructor")) { r = t.constructor } else { r = function () { return n.apply(this, arguments) } }
vendor: 3,046 bytes, lines 21282-21358
21282 i.extend(r, n, e); r.prototype = i.create(n.prototype, t); r.prototype.constructor = r; r.__super__ = n.prototype; return r }; m.extend = _.extend = O.extend = T.extend = B.extend = D; var V = function () { throw new Error('A "url" property or function must be specified') }; var G = function (t, e) { var i = e.error; e.error = function (n) { if (i) i.call(e.context, t, n, e); t.trigger("error", t, n, e) } }; return e });
21283
21284/*  typeahead  */
21285/*!
21286 * typeahead.js 1.3.1
21287 * https://github.com/corejavascript/typeahead.js
21288 * Copyright 2013-2020 Twitter, Inc. and other contributors; Licensed MIT
21289 */
21290
21291
21292(function (root, factory) {
21293    if (typeof define === "function" && define.amd) {
21294        define(["jquery"], function (a0) {
21295            return root["Bloodhound"] = factory(a0);
21296        });
21297    } else if (typeof module === "object" && module.exports) {
21298        module.exports = factory(require("jquery"));
21299    } else {
21300        root["Bloodhound"] = factory(root["jQuery"]);
21301    }
21302})(this, function ($) {
21303    var _ = function () {
21304        "use strict";
21305        return {
21306            isMsie: function () {
21307                return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false;
21308            },
21309            isBlankString: function (str) {
21310                return !str || /^\s*$/.test(str);
21311            },
21312            escapeRegExChars: function (str) {
21313                return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
21314            },
21315            isString: function (obj) {
21316                return typeof obj === "string";
21317            },
21318            isNumber: function (obj) {
21319                return typeof obj === "number";
21320            },
21321            isArray: $.isArray,
21322            isFunction: $.isFunction,
21323            isObject: $.isPlainObject,
21324            isUndefined: function (obj) {
21325                return typeof obj === "undefined";
21326            },
21327            isElement: function (obj) {
21328                return !!(obj && obj.nodeType === 1);
21329            },
21330            isJQuery: function (obj) {
21331                return obj instanceof $;
21332            },
21333            toStr: function toStr(s) {
21334                return _.isUndefined(s) || s === null ? "" : s + "";
21335            },
21336            bind: $.proxy,
21337            each: function (collection, cb) {
21338                $.each(collection, reverseArgs);
21339                function reverseArgs(index, value) {
21340                    return cb(value, index);
21341                }
21342            },
21343            map: $.map,
21344            filter: $.grep,
21345            every: function (obj, test) {
21346                var result = true;
21347                if (!obj) {
21348                    return result;
21349                }
21350                $.each(obj, function (key, val) {
21351                    if (!(result = test.call(null, val, key, obj))) {
21352                        return false;
21353                    }
21354                });
21355                return !!result;
21356            },
21357            some: function (obj, test) {
21358                var result = false;
vendor: 24,667 bytes, lines 21359-22039
21359                if (!obj) {
21360                    return result;
21361                }
21362                $.each(obj, function (key, val) {
21363                    if (result = test.call(null, val, key, obj)) {
21364                        return false;
21365                    }
21366                });
21367                return !!result;
21368            },
21369            mixin: $.extend,
21370            identity: function (x) {
21371                return x;
21372            },
21373            clone: function (obj) {
21374                return $.extend(true, {}, obj);
21375            },
21376            getIdGenerator: function () {
21377                var counter = 0;
21378                return function () {
21379                    return counter++;
21380                };
21381            },
21382            templatify: function templatify(obj) {
21383                return $.isFunction(obj) ? obj : template;
21384                function template() {
21385                    return String(obj);
21386                }
21387            },
21388            defer: function (fn) {
21389                setTimeout(fn, 0);
21390            },
21391            debounce: function (func, wait, immediate) {
21392                var timeout, result;
21393                return function () {
21394                    var context = this, args = arguments, later, callNow;
21395                    later = function () {
21396                        timeout = null;
21397                        if (!immediate) {
21398                            result = func.apply(context, args);
21399                        }
21400                    };
21401                    callNow = immediate && !timeout;
21402                    clearTimeout(timeout);
21403                    timeout = setTimeout(later, wait);
21404                    if (callNow) {
21405                        result = func.apply(context, args);
21406                    }
21407                    return result;
21408                };
21409            },
21410            throttle: function (func, wait) {
21411                var context, args, timeout, result, previous, later;
21412                previous = 0;
21413                later = function () {
21414                    previous = new Date();
21415                    timeout = null;
21416                    result = func.apply(context, args);
21417                };
21418                return function () {
21419                    var now = new Date(), remaining = wait - (now - previous);
21420                    context = this;
21421                    args = arguments;
21422                    if (remaining <= 0) {
21423                        clearTimeout(timeout);
21424                        timeout = null;
21425                        previous = now;
21426                        result = func.apply(context, args);
21427                    } else if (!timeout) {
21428                        timeout = setTimeout(later, remaining);
21429                    }
21430                    return result;
21431                };
21432            },
21433            stringify: function (val) {
21434                return _.isString(val) ? val : JSON.stringify(val);
21435            },
21436            guid: function () {
21437                function _p8(s) {
21438                    var p = (Math.random().toString(16) + "000000000").substr(2, 8);
21439                    return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p;
21440                }
21441                return "tt-" + _p8() + _p8(true) + _p8(true) + _p8();
21442            },
21443            noop: function () { }
21444        };
21445    }();
21446    var VERSION = "1.3.1";
21447    var tokenizers = function () {
21448        "use strict";
21449        return {
21450            nonword: nonword,
21451            whitespace: whitespace,
21452            ngram: ngram,
21453            obj: {
21454                nonword: getObjTokenizer(nonword),
21455                whitespace: getObjTokenizer(whitespace),
21456                ngram: getObjTokenizer(ngram)
21457            }
21458        };
21459        function whitespace(str) {
21460            str = _.toStr(str);
21461            return str ? str.split(/\s+/) : [];
21462        }
21463        function nonword(str) {
21464            str = _.toStr(str);
21465            return str ? str.split(/\W+/) : [];
21466        }
21467        function ngram(str) {
21468            str = _.toStr(str);
21469            var tokens = [], word = "";
21470            _.each(str.split(""), function (char) {
21471                if (char.match(/\s+/)) {
21472                    word = "";
21473                } else {
21474                    tokens.push(word + char);
21475                    word += char;
21476                }
21477            });
21478            return tokens;
21479        }
21480        function getObjTokenizer(tokenizer) {
21481            return function setKey(keys) {
21482                keys = _.isArray(keys) ? keys : [].slice.call(arguments, 0);
21483                return function tokenize(o) {
21484                    var tokens = [];
21485                    _.each(keys, function (k) {
21486                        tokens = tokens.concat(tokenizer(_.toStr(o[k])));
21487                    });
21488                    return tokens;
21489                };
21490            };
21491        }
21492    }();
21493    var LruCache = function () {
21494        "use strict";
21495        function LruCache(maxSize) {
21496            this.maxSize = _.isNumber(maxSize) ? maxSize : 100;
21497            this.reset();
21498            if (this.maxSize <= 0) {
21499                this.set = this.get = $.noop;
21500            }
21501        }
21502        _.mixin(LruCache.prototype, {
21503            set: function set(key, val) {
21504                var tailItem = this.list.tail, node;
21505                if (this.size >= this.maxSize) {
21506                    this.list.remove(tailItem);
21507                    delete this.hash[tailItem.key];
21508                    this.size--;
21509                }
21510                if (node = this.hash[key]) {
21511                    node.val = val;
21512                    this.list.moveToFront(node);
21513                } else {
21514                    node = new Node(key, val);
21515                    this.list.add(node);
21516                    this.hash[key] = node;
21517                    this.size++;
21518                }
21519            },
21520            get: function get(key) {
21521                var node = this.hash[key];
21522                if (node) {
21523                    this.list.moveToFront(node);
21524                    return node.val;
21525                }
21526            },
21527            reset: function reset() {
21528                this.size = 0;
21529                this.hash = {};
21530                this.list = new List();
21531            }
21532        });
21533        function List() {
21534            this.head = this.tail = null;
21535        }
21536        _.mixin(List.prototype, {
21537            add: function add(node) {
21538                if (this.head) {
21539                    node.next = this.head;
21540                    this.head.prev = node;
21541                }
21542                this.head = node;
21543                this.tail = this.tail || node;
21544            },
21545            remove: function remove(node) {
21546                node.prev ? node.prev.next = node.next : this.head = node.next;
21547                node.next ? node.next.prev = node.prev : this.tail = node.prev;
21548            },
21549            moveToFront: function (node) {
21550                this.remove(node);
21551                this.add(node);
21552            }
21553        });
21554        function Node(key, val) {
21555            this.key = key;
21556            this.val = val;
21557            this.prev = this.next = null;
21558        }
21559        return LruCache;
21560    }();
21561    var PersistentStorage = function () {
21562        "use strict";
21563        var LOCAL_STORAGE;
21564        try {
21565            LOCAL_STORAGE = window.localStorage;
21566            LOCAL_STORAGE.setItem("~~~", "!");
21567            LOCAL_STORAGE.removeItem("~~~");
21568        } catch (err) {
21569            LOCAL_STORAGE = null;
21570        }
21571        function PersistentStorage(namespace, override) {
21572            this.prefix = ["__", namespace, "__"].join("");
21573            this.ttlKey = "__ttl__";
21574            this.keyMatcher = new RegExp("^" + _.escapeRegExChars(this.prefix));
21575            this.ls = override || LOCAL_STORAGE;
21576            !this.ls && this._noop();
21577        }
21578        _.mixin(PersistentStorage.prototype, {
21579            _prefix: function (key) {
21580                return this.prefix + key;
21581            },
21582            _ttlKey: function (key) {
21583                return this._prefix(key) + this.ttlKey;
21584            },
21585            _noop: function () {
21586                this.get = this.set = this.remove = this.clear = this.isExpired = _.noop;
21587            },
21588            _safeSet: function (key, val) {
21589                try {
21590                    this.ls.setItem(key, val);
21591                } catch (err) {
21592                    if (err.name === "QuotaExceededError") {
21593                        this.clear();
21594                        this._noop();
21595                    }
21596                }
21597            },
21598            get: function (key) {
21599                if (this.isExpired(key)) {
21600                    this.remove(key);
21601                }
21602                return decode(this.ls.getItem(this._prefix(key)));
21603            },
21604            set: function (key, val, ttl) {
21605                if (_.isNumber(ttl)) {
21606                    this._safeSet(this._ttlKey(key), encode(now() + ttl));
21607                } else {
21608                    this.ls.removeItem(this._ttlKey(key));
21609                }
21610                return this._safeSet(this._prefix(key), encode(val));
21611            },
21612            remove: function (key) {
21613                this.ls.removeItem(this._ttlKey(key));
21614                this.ls.removeItem(this._prefix(key));
21615                return this;
21616            },
21617            clear: function () {
21618                var i, keys = gatherMatchingKeys(this.keyMatcher);
21619                for (i = keys.length; i--;) {
21620                    this.remove(keys[i]);
21621                }
21622                return this;
21623            },
21624            isExpired: function (key) {
21625                var ttl = decode(this.ls.getItem(this._ttlKey(key)));
21626                return _.isNumber(ttl) && now() > ttl ? true : false;
21627            }
21628        });
21629        return PersistentStorage;
21630        function now() {
21631            return new Date().getTime();
21632        }
21633        function encode(val) {
21634            return JSON.stringify(_.isUndefined(val) ? null : val);
21635        }
21636        function decode(val) {
21637            return $.parseJSON(val);
21638        }
21639        function gatherMatchingKeys(keyMatcher) {
21640            var i, key, keys = [], len = LOCAL_STORAGE.length;
21641            for (i = 0; i < len; i++) {
21642                if ((key = LOCAL_STORAGE.key(i)).match(keyMatcher)) {
21643                    keys.push(key.replace(keyMatcher, ""));
21644                }
21645            }
21646            return keys;
21647        }
21648    }();
21649    var Transport = function () {
21650        "use strict";
21651        var pendingRequestsCount = 0, pendingRequests = {}, sharedCache = new LruCache(10);
21652        function Transport(o) {
21653            o = o || {};
21654            this.maxPendingRequests = o.maxPendingRequests || 6;
21655            this.cancelled = false;
21656            this.lastReq = null;
21657            this._send = o.transport;
21658            this._get = o.limiter ? o.limiter(this._get) : this._get;
21659            this._cache = o.cache === false ? new LruCache(0) : sharedCache;
21660        }
21661        Transport.setMaxPendingRequests = function setMaxPendingRequests(num) {
21662            this.maxPendingRequests = num;
21663        };
21664        Transport.resetCache = function resetCache() {
21665            sharedCache.reset();
21666        };
21667        _.mixin(Transport.prototype, {
21668            _fingerprint: function fingerprint(o) {
21669                o = o || {};
21670                return o.url + o.type + $.param(o.data || {});
21671            },
21672            _get: function (o, cb) {
21673                var that = this, fingerprint, jqXhr;
21674                fingerprint = this._fingerprint(o);
21675                if (this.cancelled || fingerprint !== this.lastReq) {
21676                    return;
21677                }
21678                if (jqXhr = pendingRequests[fingerprint]) {
21679                    jqXhr.done(done).fail(fail);
21680                } else if (pendingRequestsCount < this.maxPendingRequests) {
21681                    pendingRequestsCount++;
21682                    pendingRequests[fingerprint] = this._send(o).done(done).fail(fail).always(always);
21683                } else {
21684                    this.onDeckRequestArgs = [].slice.call(arguments, 0);
21685                }
21686                function done(resp) {
21687                    cb(null, resp);
21688                    that._cache.set(fingerprint, resp);
21689                }
21690                function fail() {
21691                    cb(true);
21692                }
21693                function always() {
21694                    pendingRequestsCount--;
21695                    delete pendingRequests[fingerprint];
21696                    if (that.onDeckRequestArgs) {
21697                        that._get.apply(that, that.onDeckRequestArgs);
21698                        that.onDeckRequestArgs = null;
21699                    }
21700                }
21701            },
21702            get: function (o, cb) {
21703                var resp, fingerprint;
21704                cb = cb || $.noop;
21705                o = _.isString(o) ? {
21706                    url: o
21707                } : o || {};
21708                fingerprint = this._fingerprint(o);
21709                this.cancelled = false;
21710                this.lastReq = fingerprint;
21711                if (resp = this._cache.get(fingerprint)) {
21712                    cb(null, resp);
21713                } else {
21714                    this._get(o, cb);
21715                }
21716            },
21717            cancel: function () {
21718                this.cancelled = true;
21719            }
21720        });
21721        return Transport;
21722    }();
21723    var SearchIndex = window.SearchIndex = function () {
21724        "use strict";
21725        var CHILDREN = "c", IDS = "i";
21726        function SearchIndex(o) {
21727            o = o || {};
21728            if (!o.datumTokenizer || !o.queryTokenizer) {
21729                $.error("datumTokenizer and queryTokenizer are both required");
21730            }
21731            this.identify = o.identify || _.stringify;
21732            this.datumTokenizer = o.datumTokenizer;
21733            this.queryTokenizer = o.queryTokenizer;
21734            this.matchAnyQueryToken = o.matchAnyQueryToken;
21735            this.reset();
21736        }
21737        _.mixin(SearchIndex.prototype, {
21738            bootstrap: function bootstrap(o) {
21739                this.datums = o.datums;
21740                this.trie = o.trie;
21741            },
21742            add: function (data) {
21743                var that = this;
21744                data = _.isArray(data) ? data : [data];
21745                _.each(data, function (datum) {
21746                    var id, tokens;
21747                    that.datums[id = that.identify(datum)] = datum;
21748                    tokens = normalizeTokens(that.datumTokenizer(datum));
21749                    _.each(tokens, function (token) {
21750                        var node, chars, ch;
21751                        node = that.trie;
21752                        chars = token.split("");
21753                        while (ch = chars.shift()) {
21754                            node = node[CHILDREN][ch] || (node[CHILDREN][ch] = newNode());
21755                            node[IDS].push(id);
21756                        }
21757                    });
21758                });
21759            },
21760            get: function get(ids) {
21761                var that = this;
21762                return _.map(ids, function (id) {
21763                    return that.datums[id];
21764                });
21765            },
21766            search: function search(query) {
21767                var that = this, tokens, matches;
21768                tokens = normalizeTokens(this.queryTokenizer(query));
21769                _.each(tokens, function (token) {
21770                    var node, chars, ch, ids;
21771                    if (matches && matches.length === 0 && !that.matchAnyQueryToken) {
21772                        return false;
21773                    }
21774                    node = that.trie;
21775                    chars = token.split("");
21776                    while (node && (ch = chars.shift())) {
21777                        node = node[CHILDREN][ch];
21778                    }
21779                    if (node && chars.length === 0) {
21780                        ids = node[IDS].slice(0);
21781                        matches = matches ? getIntersection(matches, ids) : ids;
21782                    } else {
21783                        if (!that.matchAnyQueryToken) {
21784                            matches = [];
21785                            return false;
21786                        }
21787                    }
21788                });
21789                return matches ? _.map(unique(matches), function (id) {
21790                    return that.datums[id];
21791                }) : [];
21792            },
21793            all: function all() {
21794                var values = [];
21795                for (var key in this.datums) {
21796                    values.push(this.datums[key]);
21797                }
21798                return values;
21799            },
21800            reset: function reset() {
21801                this.datums = {};
21802                this.trie = newNode();
21803            },
21804            serialize: function serialize() {
21805                return {
21806                    datums: this.datums,
21807                    trie: this.trie
21808                };
21809            }
21810        });
21811        return SearchIndex;
21812        function normalizeTokens(tokens) {
21813            tokens = _.filter(tokens, function (token) {
21814                return !!token;
21815            });
21816            tokens = _.map(tokens, function (token) {
21817                return token.toLowerCase();
21818            });
21819            return tokens;
21820        }
21821        function newNode() {
21822            var node = {};
21823            node[IDS] = [];
21824            node[CHILDREN] = {};
21825            return node;
21826        }
21827        function unique(array) {
21828            var seen = {}, uniques = [];
21829            for (var i = 0, len = array.length; i < len; i++) {
21830                if (!seen[array[i]]) {
21831                    seen[array[i]] = true;
21832                    uniques.push(array[i]);
21833                }
21834            }
21835            return uniques;
21836        }
21837        function getIntersection(arrayA, arrayB) {
21838            var ai = 0, bi = 0, intersection = [];
21839            arrayA = arrayA.sort();
21840            arrayB = arrayB.sort();
21841            var lenArrayA = arrayA.length, lenArrayB = arrayB.length;
21842            while (ai < lenArrayA && bi < lenArrayB) {
21843                if (arrayA[ai] < arrayB[bi]) {
21844                    ai++;
21845                } else if (arrayA[ai] > arrayB[bi]) {
21846                    bi++;
21847                } else {
21848                    intersection.push(arrayA[ai]);
21849                    ai++;
21850                    bi++;
21851                }
21852            }
21853            return intersection;
21854        }
21855    }();
21856    var Prefetch = function () {
21857        "use strict";
21858        var keys;
21859        keys = {
21860            data: "data",
21861            protocol: "protocol",
21862            thumbprint: "thumbprint"
21863        };
21864        function Prefetch(o) {
21865            this.url = o.url;
21866            this.ttl = o.ttl;
21867            this.cache = o.cache;
21868            this.prepare = o.prepare;
21869            this.transform = o.transform;
21870            this.transport = o.transport;
21871            this.thumbprint = o.thumbprint;
21872            this.storage = new PersistentStorage(o.cacheKey);
21873        }
21874        _.mixin(Prefetch.prototype, {
21875            _settings: function settings() {
21876                return {
21877                    url: this.url,
21878                    type: "GET",
21879                    dataType: "json"
21880                };
21881            },
21882            store: function store(data) {
21883                if (!this.cache) {
21884                    return;
21885                }
21886                this.storage.set(keys.data, data, this.ttl);
21887                this.storage.set(keys.protocol, location.protocol, this.ttl);
21888                this.storage.set(keys.thumbprint, this.thumbprint, this.ttl);
21889            },
21890            fromCache: function fromCache() {
21891                var stored = {}, isExpired;
21892                if (!this.cache) {
21893                    return null;
21894                }
21895                stored.data = this.storage.get(keys.data);
21896                stored.protocol = this.storage.get(keys.protocol);
21897                stored.thumbprint = this.storage.get(keys.thumbprint);
21898                isExpired = stored.thumbprint !== this.thumbprint || stored.protocol !== location.protocol;
21899                return stored.data && !isExpired ? stored.data : null;
21900            },
21901            fromNetwork: function (cb) {
21902                var that = this, settings;
21903                if (!cb) {
21904                    return;
21905                }
21906                settings = this.prepare(this._settings());
21907                this.transport(settings).fail(onError).done(onResponse);
21908                function onError() {
21909                    cb(true);
21910                }
21911                function onResponse(resp) {
21912                    cb(null, that.transform(resp));
21913                }
21914            },
21915            clear: function clear() {
21916                this.storage.clear();
21917                return this;
21918            }
21919        });
21920        return Prefetch;
21921    }();
21922    var Remote = function () {
21923        "use strict";
21924        function Remote(o) {
21925            this.url = o.url;
21926            this.prepare = o.prepare;
21927            this.transform = o.transform;
21928            this.indexResponse = o.indexResponse;
21929            this.transport = new Transport({
21930                cache: o.cache,
21931                limiter: o.limiter,
21932                transport: o.transport,
21933                maxPendingRequests: o.maxPendingRequests
21934            });
21935        }
21936        _.mixin(Remote.prototype, {
21937            _settings: function settings() {
21938                return {
21939                    url: this.url,
21940                    type: "GET",
21941                    dataType: "json"
21942                };
21943            },
21944            get: function get(query, cb) {
21945                var that = this, settings;
21946                if (!cb) {
21947                    return;
21948                }
21949                query = query || "";
21950                settings = this.prepare(query, this._settings());
21951                return this.transport.get(settings, onResponse);
21952                function onResponse(err, resp) {
21953                    err ? cb([]) : cb(that.transform(resp));
21954                }
21955            },
21956            cancelLastRequest: function cancelLastRequest() {
21957                this.transport.cancel();
21958            }
21959        });
21960        return Remote;
21961    }();
21962    var oParser = function () {
21963        "use strict";
21964        return function parse(o) {
21965            var defaults, sorter;
21966            defaults = {
21967                initialize: true,
21968                identify: _.stringify,
21969                datumTokenizer: null,
21970                queryTokenizer: null,
21971                matchAnyQueryToken: false,
21972                sufficient: 5,
21973                indexRemote: false,
21974                sorter: null,
21975                local: [],
21976                prefetch: null,
21977                remote: null
21978            };
21979            o = _.mixin(defaults, o || {});
21980            !o.datumTokenizer && $.error("datumTokenizer is required");
21981            !o.queryTokenizer && $.error("queryTokenizer is required");
21982            sorter = o.sorter;
21983            o.sorter = sorter ? function (x) {
21984                return x.sort(sorter);
21985            } : _.identity;
21986            o.local = _.isFunction(o.local) ? o.local() : o.local;
21987            o.prefetch = parsePrefetch(o.prefetch);
21988            o.remote = parseRemote(o.remote);
21989            return o;
21990        };
21991        function parsePrefetch(o) {
21992            var defaults;
21993            if (!o) {
21994                return null;
21995            }
21996            defaults = {
21997                url: null,
21998                ttl: 24 * 60 * 60 * 1e3,
21999                cache: true,
22000                cacheKey: null,
22001                thumbprint: "",
22002                prepare: _.identity,
22003                transform: _.identity,
22004                transport: null
22005            };
22006            o = _.isString(o) ? {
22007                url: o
22008            } : o;
22009            o = _.mixin(defaults, o);
22010            !o.url && $.error("prefetch requires url to be set");
22011            o.transform = o.filter || o.transform;
22012            o.cacheKey = o.cacheKey || o.url;
22013            o.thumbprint = VERSION + o.thumbprint;
22014            o.transport = o.transport ? callbackToDeferred(o.transport) : $.ajax;
22015            return o;
22016        }
22017        function parseRemote(o) {
22018            var defaults;
22019            if (!o) {
22020                return;
22021            }
22022            defaults = {
22023                url: null,
22024                cache: true,
22025                prepare: null,
22026                replace: null,
22027                wildcard: null,
22028                limiter: null,
22029                rateLimitBy: "debounce",
22030                rateLimitWait: 300,
22031                transform: _.identity,
22032                transport: null
22033            };
22034            o = _.isString(o) ? {
22035                url: o
22036            } : o;
22037            o = _.mixin(defaults, o);
22038            !o.url && $.error("remote requires url to be set");
22039            o.transform = o.filter || o.transform;
vendor: 2,606 bytes, lines 22040-22115
22040            o.prepare = toRemotePrepare(o);
22041            o.limiter = toLimiter(o);
22042            o.transport = o.transport ? callbackToDeferred(o.transport) : $.ajax;
22043            delete o.replace;
22044            delete o.wildcard;
22045            delete o.rateLimitBy;
22046            delete o.rateLimitWait;
22047            return o;
22048        }
22049        function toRemotePrepare(o) {
22050            var prepare, replace, wildcard;
22051            prepare = o.prepare;
22052            replace = o.replace;
22053            wildcard = o.wildcard;
22054            if (prepare) {
22055                return prepare;
22056            }
22057            if (replace) {
22058                prepare = prepareByReplace;
22059            } else if (o.wildcard) {
22060                prepare = prepareByWildcard;
22061            } else {
22062                prepare = identityPrepare;
22063            }
22064            return prepare;
22065            function prepareByReplace(query, settings) {
22066                settings.url = replace(settings.url, query);
22067                return settings;
22068            }
22069            function prepareByWildcard(query, settings) {
22070                settings.url = settings.url.replace(wildcard, encodeURIComponent(query));
22071                return settings;
22072            }
22073            function identityPrepare(query, settings) {
22074                return settings;
22075            }
22076        }
22077        function toLimiter(o) {
22078            var limiter, method, wait;
22079            limiter = o.limiter;
22080            method = o.rateLimitBy;
22081            wait = o.rateLimitWait;
22082            if (!limiter) {
22083                limiter = /^throttle$/i.test(method) ? throttle(wait) : debounce(wait);
22084            }
22085            return limiter;
22086            function debounce(wait) {
22087                return function debounce(fn) {
22088                    return _.debounce(fn, wait);
22089                };
22090            }
22091            function throttle(wait) {
22092                return function throttle(fn) {
22093                    return _.throttle(fn, wait);
22094                };
22095            }
22096        }
22097        function callbackToDeferred(fn) {
22098            return function wrapper(o) {
22099                var deferred = $.Deferred();
22100                fn(o, onSuccess, onError);
22101                return deferred;
22102                function onSuccess(resp) {
22103                    _.defer(function () {
22104                        deferred.resolve(resp);
22105                    });
22106                }
22107                function onError(err) {
22108                    _.defer(function () {
22109                        deferred.reject(err);
22110                    });
22111                }
22112            };
22113        }
22114    }();
22115    var Bloodhound = function 
vendor: 3,768 bytes, lines 22115-22206
22115() {
22116        "use strict";
22117        var old;
22118        old = window && window.Bloodhound;
22119        function Bloodhound(o) {
22120            o = oParser(o);
22121            this.sorter = o.sorter;
22122            this.identify = o.identify;
22123            this.sufficient = o.sufficient;
22124            this.indexRemote = o.indexRemote;
22125            this.local = o.local;
22126            this.remote = o.remote ? new Remote(o.remote) : null;
22127            this.prefetch = o.prefetch ? new Prefetch(o.prefetch) : null;
22128            this.index = new SearchIndex({
22129                identify: this.identify,
22130                datumTokenizer: o.datumTokenizer,
22131                queryTokenizer: o.queryTokenizer
22132            });
22133            o.initialize !== false && this.initialize();
22134        }
22135        Bloodhound.noConflict = function noConflict() {
22136            window && (window.Bloodhound = old);
22137            return Bloodhound;
22138        };
22139        Bloodhound.tokenizers = tokenizers;
22140        _.mixin(Bloodhound.prototype, {
22141            __ttAdapter: function ttAdapter() {
22142                var that = this;
22143                return this.remote ? withAsync : withoutAsync;
22144                function withAsync(query, sync, async) {
22145                    return that.search(query, sync, async);
22146                }
22147                function withoutAsync(query, sync) {
22148                    return that.search(query, sync);
22149                }
22150            },
22151            _loadPrefetch: function loadPrefetch() {
22152                var that = this, deferred, serialized;
22153                deferred = $.Deferred();
22154                if (!this.prefetch) {
22155                    deferred.resolve();
22156                } else if (serialized = this.prefetch.fromCache()) {
22157                    this.index.bootstrap(serialized);
22158                    deferred.resolve();
22159                } else {
22160                    this.prefetch.fromNetwork(done);
22161                }
22162                return deferred.promise();
22163                function done(err, data) {
22164                    if (err) {
22165                        return deferred.reject();
22166                    }
22167                    that.add(data);
22168                    that.prefetch.store(that.index.serialize());
22169                    deferred.resolve();
22170                }
22171            },
22172            _initialize: function initialize() {
22173                var that = this, deferred;
22174                this.clear();
22175                (this.initPromise = this._loadPrefetch()).done(addLocalToIndex);
22176                return this.initPromise;
22177                function addLocalToIndex() {
22178                    that.add(that.local);
22179                }
22180            },
22181            initialize: function initialize(force) {
22182                return !this.initPromise || force ? this._initialize() : this.initPromise;
22183            },
22184            add: function add(data) {
22185                this.index.add(data);
22186                return this;
22187            },
22188            get: function get(ids) {
22189                ids = _.isArray(ids) ? ids : [].slice.call(arguments);
22190                return this.index.get(ids);
22191            },
22192            search: function search(query, sync, async) {
22193                var that = this, local;
22194                sync = sync || _.noop;
22195                async = async || _.noop;
22196                local = this.sorter(this.index.search(query));
22197                sync(this.remote ? local.slice() : local);
22198                if (this.remote && local.length < this.sufficient) {
22199                    this.remote.get(query, processRemote);
22200                } else if (this.remote) {
22201                    this.remote.cancelLastRequest();
22202                }
22203                return this;
22204                function processRemote(remote) {
22205                    var nonDuplicates = [];
22206                    _.each(remote, function
vendor: 50,013 bytes, lines 22206-23414
22206 (r) {
22207                        !_.some(local, function (l) {
22208                            return that.identify(r) === that.identify(l);
22209                        }) && nonDuplicates.push(r);
22210                    });
22211                    that.indexRemote && that.add(nonDuplicates);
22212                    async(nonDuplicates);
22213                }
22214            },
22215            all: function all() {
22216                return this.index.all();
22217            },
22218            clear: function clear() {
22219                this.index.reset();
22220                return this;
22221            },
22222            clearPrefetchCache: function clearPrefetchCache() {
22223                this.prefetch && this.prefetch.clear();
22224                return this;
22225            },
22226            clearRemoteCache: function clearRemoteCache() {
22227                Transport.resetCache();
22228                return this;
22229            },
22230            ttAdapter: function ttAdapter() {
22231                return this.__ttAdapter();
22232            }
22233        });
22234        return Bloodhound;
22235    }();
22236    return Bloodhound;
22237});
22238
22239(function (root, factory) {
22240    if (typeof define === "function" && define.amd) {
22241        define(["jquery"], function (a0) {
22242            return factory(a0);
22243        });
22244    } else if (typeof module === "object" && module.exports) {
22245        module.exports = factory(require("jquery"));
22246    } else {
22247        factory(root["jQuery"]);
22248    }
22249})(this, function ($) {
22250    var _ = function () {
22251        "use strict";
22252        return {
22253            isMsie: function () {
22254                return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false;
22255            },
22256            isBlankString: function (str) {
22257                return !str || /^\s*$/.test(str);
22258            },
22259            escapeRegExChars: function (str) {
22260                return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
22261            },
22262            isString: function (obj) {
22263                return typeof obj === "string";
22264            },
22265            isNumber: function (obj) {
22266                return typeof obj === "number";
22267            },
22268            isArray: $.isArray,
22269            isFunction: $.isFunction,
22270            isObject: $.isPlainObject,
22271            isUndefined: function (obj) {
22272                return typeof obj === "undefined";
22273            },
22274            isElement: function (obj) {
22275                return !!(obj && obj.nodeType === 1);
22276            },
22277            isJQuery: function (obj) {
22278                return obj instanceof $;
22279            },
22280            toStr: function toStr(s) {
22281                return _.isUndefined(s) || s === null ? "" : s + "";
22282            },
22283            bind: $.proxy,
22284            each: function (collection, cb) {
22285                $.each(collection, reverseArgs);
22286                function reverseArgs(index, value) {
22287                    return cb(value, index);
22288                }
22289            },
22290            map: $.map,
22291            filter: $.grep,
22292            every: function (obj, test) {
22293                var result = true;
22294                if (!obj) {
22295                    return result;
22296                }
22297                $.each(obj, function (key, val) {
22298                    if (!(result = test.call(null, val, key, obj))) {
22299                        return false;
22300                    }
22301                });
22302                return !!result;
22303            },
22304            some: function (obj, test) {
22305                var result = false;
22306                if (!obj) {
22307                    return result;
22308                }
22309                $.each(obj, function (key, val) {
22310                    if (result = test.call(null, val, key, obj)) {
22311                        return false;
22312                    }
22313                });
22314                return !!result;
22315            },
22316            mixin: $.extend,
22317            identity: function (x) {
22318                return x;
22319            },
22320            clone: function (obj) {
22321                return $.extend(true, {}, obj);
22322            },
22323            getIdGenerator: function () {
22324                var counter = 0;
22325                return function () {
22326                    return counter++;
22327                };
22328            },
22329            templatify: function templatify(obj) {
22330                return $.isFunction(obj) ? obj : template;
22331                function template() {
22332                    return String(obj);
22333                }
22334            },
22335            defer: function (fn) {
22336                setTimeout(fn, 0);
22337            },
22338            debounce: function (func, wait, immediate) {
22339                var timeout, result;
22340                return function () {
22341                    var context = this, args = arguments, later, callNow;
22342                    later = function () {
22343                        timeout = null;
22344                        if (!immediate) {
22345                            result = func.apply(context, args);
22346                        }
22347                    };
22348                    callNow = immediate && !timeout;
22349                    clearTimeout(timeout);
22350                    timeout = setTimeout(later, wait);
22351                    if (callNow) {
22352                        result = func.apply(context, args);
22353                    }
22354                    return result;
22355                };
22356            },
22357            throttle: function (func, wait) {
22358                var context, args, timeout, result, previous, later;
22359                previous = 0;
22360                later = function () {
22361                    previous = new Date();
22362                    timeout = null;
22363                    result = func.apply(context, args);
22364                };
22365                return function () {
22366                    var now = new Date(), remaining = wait - (now - previous);
22367                    context = this;
22368                    args = arguments;
22369                    if (remaining <= 0) {
22370                        clearTimeout(timeout);
22371                        timeout = null;
22372                        previous = now;
22373                        result = func.apply(context, args);
22374                    } else if (!timeout) {
22375                        timeout = setTimeout(later, remaining);
22376                    }
22377                    return result;
22378                };
22379            },
22380            stringify: function (val) {
22381                return _.isString(val) ? val : JSON.stringify(val);
22382            },
22383            guid: function () {
22384                function _p8(s) {
22385                    var p = (Math.random().toString(16) + "000000000").substr(2, 8);
22386                    return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p;
22387                }
22388                return "tt-" + _p8() + _p8(true) + _p8(true) + _p8();
22389            },
22390            noop: function () { }
22391        };
22392    }();
22393    var WWW = function () {
22394        "use strict";
22395        var defaultClassNames = {
22396            wrapper: "twitter-typeahead",
22397            input: "tt-input",
22398            hint: "tt-hint",
22399            menu: "tt-menu",
22400            dataset: "tt-dataset",
22401            suggestion: "tt-suggestion",
22402            selectable: "tt-selectable",
22403            empty: "tt-empty",
22404            open: "tt-open",
22405            cursor: "tt-cursor",
22406            highlight: "tt-highlight"
22407        };
22408        return build;
22409        function build(o) {
22410            var www, classes;
22411            classes = _.mixin({}, defaultClassNames, o);
22412            www = {
22413                css: buildCss(),
22414                classes: classes,
22415                html: buildHtml(classes),
22416                selectors: buildSelectors(classes)
22417            };
22418            return {
22419                css: www.css,
22420                html: www.html,
22421                classes: www.classes,
22422                selectors: www.selectors,
22423                mixin: function (o) {
22424                    _.mixin(o, www);
22425                }
22426            };
22427        }
22428        function buildHtml(c) {
22429            return {
22430                wrapper: '<span class="' + c.wrapper + '"></span>',
22431                menu: '<div role="listbox" class="' + c.menu + '"></div>'
22432            };
22433        }
22434        function buildSelectors(classes) {
22435            var selectors = {};
22436            _.each(classes, function (v, k) {
22437                selectors[k] = "." + v;
22438            });
22439            return selectors;
22440        }
22441        function buildCss() {
22442            var css = {
22443                wrapper: {
22444                    position: "relative",
22445                    display: "inline-block"
22446                },
22447                hint: {
22448                    position: "absolute",
22449                    top: "0",
22450                    left: "0",
22451                    borderColor: "transparent",
22452                    boxShadow: "none",
22453                    opacity: "1"
22454                },
22455                input: {
22456                    position: "relative",
22457                    verticalAlign: "top",
22458                    backgroundColor: "transparent"
22459                },
22460                inputWithNoHint: {
22461                    position: "relative",
22462                    verticalAlign: "top"
22463                },
22464                menu: {
22465                    position: "absolute",
22466                    top: "100%",
22467                    left: "0",
22468                    zIndex: "100",
22469                    display: "none"
22470                },
22471                ltr: {
22472                    left: "0",
22473                    right: "auto"
22474                },
22475                rtl: {
22476                    left: "auto",
22477                    right: " 0"
22478                }
22479            };
22480            if (_.isMsie()) {
22481                _.mixin(css.input, {
22482                    backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"
22483                });
22484            }
22485            return css;
22486        }
22487    }();
22488    var EventBus = function () {
22489        "use strict";
22490        var namespace, deprecationMap;
22491        namespace = "typeahead:";
22492        deprecationMap = {
22493            render: "rendered",
22494            cursorchange: "cursorchanged",
22495            select: "selected",
22496            autocomplete: "autocompleted"
22497        };
22498        function EventBus(o) {
22499            if (!o || !o.el) {
22500                $.error("EventBus initialized without el");
22501            }
22502            this.$el = $(o.el);
22503        }
22504        _.mixin(EventBus.prototype, {
22505            _trigger: function (type, args) {
22506                var $e = $.Event(namespace + type);
22507                this.$el.trigger.call(this.$el, $e, args || []);
22508                return $e;
22509            },
22510            before: function (type) {
22511                var args, $e;
22512                args = [].slice.call(arguments, 1);
22513                $e = this._trigger("before" + type, args);
22514                return $e.isDefaultPrevented();
22515            },
22516            trigger: function (type) {
22517                var deprecatedType;
22518                this._trigger(type, [].slice.call(arguments, 1));
22519                if (deprecatedType = deprecationMap[type]) {
22520                    this._trigger(deprecatedType, [].slice.call(arguments, 1));
22521                }
22522            }
22523        });
22524        return EventBus;
22525    }();
22526    var EventEmitter = function () {
22527        "use strict";
22528        var splitter = /\s+/, nextTick = getNextTick();
22529        return {
22530            onSync: onSync,
22531            onAsync: onAsync,
22532            off: off,
22533            trigger: trigger
22534        };
22535        function on(method, types, cb, context) {
22536            var type;
22537            if (!cb) {
22538                return this;
22539            }
22540            types = types.split(splitter);
22541            cb = context ? bindContext(cb, context) : cb;
22542            this._callbacks = this._callbacks || {};
22543            while (type = types.shift()) {
22544                this._callbacks[type] = this._callbacks[type] || {
22545                    sync: [],
22546                    async: []
22547                };
22548                this._callbacks[type][method].push(cb);
22549            }
22550            return this;
22551        }
22552        function onAsync(types, cb, context) {
22553            return on.call(this, "async", types, cb, context);
22554        }
22555        function onSync(types, cb, context) {
22556            return on.call(this, "sync", types, cb, context);
22557        }
22558        function off(types) {
22559            var type;
22560            if (!this._callbacks) {
22561                return this;
22562            }
22563            types = types.split(splitter);
22564            while (type = types.shift()) {
22565                delete this._callbacks[type];
22566            }
22567            return this;
22568        }
22569        function trigger(types) {
22570            var type, callbacks, args, syncFlush, asyncFlush;
22571            if (!this._callbacks) {
22572                return this;
22573            }
22574            types = types.split(splitter);
22575            args = [].slice.call(arguments, 1);
22576            while ((type = types.shift()) && (callbacks = this._callbacks[type])) {
22577                syncFlush = getFlush(callbacks.sync, this, [type].concat(args));
22578                asyncFlush = getFlush(callbacks.async, this, [type].concat(args));
22579                syncFlush() && nextTick(asyncFlush);
22580            }
22581            return this;
22582        }
22583        function getFlush(callbacks, context, args) {
22584            return flush;
22585            function flush() {
22586                var cancelled;
22587                for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) {
22588                    cancelled = callbacks[i].apply(context, args) === false;
22589                }
22590                return !cancelled;
22591            }
22592        }
22593        function getNextTick() {
22594            var nextTickFn;
22595            if (window.setImmediate) {
22596                nextTickFn = function nextTickSetImmediate(fn) {
22597                    setImmediate(function () {
22598                        fn();
22599                    });
22600                };
22601            } else {
22602                nextTickFn = function nextTickSetTimeout(fn) {
22603                    setTimeout(function () {
22604                        fn();
22605                    }, 0);
22606                };
22607            }
22608            return nextTickFn;
22609        }
22610        function bindContext(fn, context) {
22611            return fn.bind ? fn.bind(context) : function () {
22612                fn.apply(context, [].slice.call(arguments, 0));
22613            };
22614        }
22615    }();
22616    var highlight = function (doc) {
22617        "use strict";
22618        var defaults = {
22619            node: null,
22620            pattern: null,
22621            tagName: "strong",
22622            className: null,
22623            wordsOnly: false,
22624            caseSensitive: false,
22625            diacriticInsensitive: false
22626        };
22627        var accented = {
22628            A: "[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]",
22629            B: "[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]",
22630            C: "[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]",
22631            D: "[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]",
22632            E: "[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]",
22633            F: "[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]",
22634            G: "[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]",
22635            H: "[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]",
22636            I: "[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]",
22637            J: "[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]",
22638            K: "[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]",
22639            L: "[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]",
22640            M: "[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]",
22641            N: "[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]",
22642            O: "[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]",
22643            P: "[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]",
22644            Q: "[Qqℚ⒬Ⓠⓠ㏃Qq]",
22645            R: "[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]",
22646            S: "[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]",
22647            T: "[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]",
22648            U: "[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]",
22649            V: "[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]",
22650            W: "[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]",
22651            X: "[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]",
22652            Y: "[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]",
22653            Z: "[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]"
22654        };
22655        return function hightlight(o) {
22656            var regex;
22657            o = _.mixin({}, defaults, o);
22658            if (!o.node || !o.pattern) {
22659                return;
22660            }
22661            o.pattern = _.isArray(o.pattern) ? o.pattern : [o.pattern];
22662            regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly, o.diacriticInsensitive);
22663            traverse(o.node, hightlightTextNode);
22664            function hightlightTextNode(textNode) {
22665                var match, patternNode, wrapperNode;
22666                if (match = regex.exec(textNode.data)) {
22667                    wrapperNode = doc.createElement(o.tagName);
22668                    o.className && (wrapperNode.className = o.className);
22669                    patternNode = textNode.splitText(match.index);
22670                    patternNode.splitText(match[0].length);
22671                    wrapperNode.appendChild(patternNode.cloneNode(true));
22672                    textNode.parentNode.replaceChild(wrapperNode, patternNode);
22673                }
22674                return !!match;
22675            }
22676            function traverse(el, hightlightTextNode) {
22677                var childNode, TEXT_NODE_TYPE = 3;
22678                for (var i = 0; i < el.childNodes.length; i++) {
22679                    childNode = el.childNodes[i];
22680                    if (childNode.nodeType === TEXT_NODE_TYPE) {
22681                        i += hightlightTextNode(childNode) ? 1 : 0;
22682                    } else {
22683                        traverse(childNode, hightlightTextNode);
22684                    }
22685                }
22686            }
22687        };
22688        function accent_replacer(chr) {
22689            return accented[chr.toUpperCase()] || chr;
22690        }
22691        function getRegex(patterns, caseSensitive, wordsOnly, diacriticInsensitive) {
22692            var escapedPatterns = [], regexStr;
22693            for (var i = 0, len = patterns.length; i < len; i++) {
22694                var escapedWord = _.escapeRegExChars(patterns[i]);
22695                if (diacriticInsensitive) {
22696                    escapedWord = escapedWord.replace(/\S/g, accent_replacer);
22697                }
22698                escapedPatterns.push(escapedWord);
22699            }
22700            regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")";
22701            return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i");
22702        }
22703    }(window.document);
22704    var Input = function () {
22705        "use strict";
22706        var specialKeyCodeMap;
22707        specialKeyCodeMap = {
22708            9: "tab",
22709            27: "esc",
22710            37: "left",
22711            39: "right",
22712            13: "enter",
22713            38: "up",
22714            40: "down"
22715        };
22716        function Input(o, www) {
22717            var id;
22718            o = o || {};
22719            if (!o.input) {
22720                $.error("input is missing");
22721            }
22722            www.mixin(this);
22723            this.$hint = $(o.hint);
22724            this.$input = $(o.input);
22725            this.$menu = $(o.menu);
22726            id = this.$input.attr("id") || _.guid();
22727            this.$menu.attr("id", id + "_listbox");
22728            this.$hint.attr({
22729                "aria-hidden": true
22730            });
22731            this.$input.attr({
22732                "aria-owns": id + "_listbox",
22733                role: "combobox",
22734                "aria-autocomplete": "list",
22735                "aria-expanded": false
22736            });
22737            this.query = this.$input.val();
22738            this.queryWhenFocused = this.hasFocus() ? this.query : null;
22739            this.$overflowHelper = buildOverflowHelper(this.$input);
22740            this._checkLanguageDirection();
22741            if (this.$hint.length === 0) {
22742                this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop;
22743            }
22744            this.onSync("cursorchange", this._updateDescendent);
22745        }
22746        Input.normalizeQuery = function (str) {
22747            return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " ");
22748        };
22749        _.mixin(Input.prototype, EventEmitter, {
22750            _onBlur: function onBlur() {
22751                this.resetInputValue();
22752                this.trigger("blurred");
22753            },
22754            _onFocus: function onFocus() {
22755                this.queryWhenFocused = this.query;
22756                this.trigger("focused");
22757            },
22758            _onKeydown: function onKeydown($e) {
22759                var keyName = specialKeyCodeMap[$e.which || $e.keyCode];
22760                this._managePreventDefault(keyName, $e);
22761                if (keyName && this._shouldTrigger(keyName, $e)) {
22762                    this.trigger(keyName + "Keyed", $e);
22763                }
22764            },
22765            _onInput: function onInput() {
22766                this._setQuery(this.getInputValue());
22767                this.clearHintIfInvalid();
22768                this._checkLanguageDirection();
22769            },
22770            _managePreventDefault: function managePreventDefault(keyName, $e) {
22771                var preventDefault;
22772                switch (keyName) {
22773                    case "up":
22774                    case "down":
22775                        preventDefault = !withModifier($e);
22776                        break;
22777
22778                    default:
22779                        preventDefault = false;
22780                }
22781                preventDefault && $e.preventDefault();
22782            },
22783            _shouldTrigger: function shouldTrigger(keyName, $e) {
22784                var trigger;
22785                switch (keyName) {
22786                    case "tab":
22787                        trigger = !withModifier($e);
22788                        break;
22789
22790                    default:
22791                        trigger = true;
22792                }
22793                return trigger;
22794            },
22795            _checkLanguageDirection: function checkLanguageDirection() {
22796                var dir = (this.$input.css("direction") || "ltr").toLowerCase();
22797                if (this.dir !== dir) {
22798                    this.dir = dir;
22799                    this.$hint.attr("dir", dir);
22800                    this.trigger("langDirChanged", dir);
22801                }
22802            },
22803            _setQuery: function setQuery(val, silent) {
22804                var areEquivalent, hasDifferentWhitespace;
22805                areEquivalent = areQueriesEquivalent(val, this.query);
22806                hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false;
22807                this.query = val;
22808                if (!silent && !areEquivalent) {
22809                    this.trigger("queryChanged", this.query);
22810                } else if (!silent && hasDifferentWhitespace) {
22811                    this.trigger("whitespaceChanged", this.query);
22812                }
22813            },
22814            _updateDescendent: function updateDescendent(event, id) {
22815                this.$input.attr("aria-activedescendant", id);
22816            },
22817            bind: function () {
22818                var that = this, onBlur, onFocus, onKeydown, onInput;
22819                onBlur = _.bind(this._onBlur, this);
22820                onFocus = _.bind(this._onFocus, this);
22821                onKeydown = _.bind(this._onKeydown, this);
22822                onInput = _.bind(this._onInput, this);
22823                this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown);
22824                if (!_.isMsie() || _.isMsie() > 9) {
22825                    this.$input.on("input.tt", onInput);
22826                } else {
22827                    this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function ($e) {
22828                        if (specialKeyCodeMap[$e.which || $e.keyCode]) {
22829                            return;
22830                        }
22831                        _.defer(_.bind(that._onInput, that, $e));
22832                    });
22833                }
22834                return this;
22835            },
22836            focus: function focus() {
22837                this.$input.focus();
22838            },
22839            blur: function blur() {
22840                this.$input.blur();
22841            },
22842            getLangDir: function getLangDir() {
22843                return this.dir;
22844            },
22845            getQuery: function getQuery() {
22846                return this.query || "";
22847            },
22848            setQuery: function setQuery(val, silent) {
22849                this.setInputValue(val);
22850                this._setQuery(val, silent);
22851            },
22852            hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() {
22853                return this.query !== this.queryWhenFocused;
22854            },
22855            getInputValue: function getInputValue() {
22856                return this.$input.val();
22857            },
22858            setInputValue: function setInputValue(value) {
22859                this.$input.val(value);
22860                this.clearHintIfInvalid();
22861                this._checkLanguageDirection();
22862            },
22863            resetInputValue: function resetInputValue() {
22864                this.setInputValue(this.query);
22865            },
22866            getHint: function getHint() {
22867                return this.$hint.val();
22868            },
22869            setHint: function setHint(value) {
22870                this.$hint.val(value);
22871            },
22872            clearHint: function clearHint() {
22873                this.setHint("");
22874            },
22875            clearHintIfInvalid: function clearHintIfInvalid() {
22876                var val, hint, valIsPrefixOfHint, isValid;
22877                val = this.getInputValue();
22878                hint = this.getHint();
22879                valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0;
22880                isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow();
22881                !isValid && this.clearHint();
22882            },
22883            hasFocus: function hasFocus() {
22884                return this.$input.is(":focus");
22885            },
22886            hasOverflow: function hasOverflow() {
22887                var constraint = this.$input.width() - 2;
22888                this.$overflowHelper.text(this.getInputValue());
22889                return this.$overflowHelper.width() >= constraint;
22890            },
22891            isCursorAtEnd: function () {
22892                var valueLength, selectionStart, range;
22893                valueLength = this.$input.val().length;
22894                selectionStart = this.$input[0].selectionStart;
22895                if (_.isNumber(selectionStart)) {
22896                    return selectionStart === valueLength;
22897                } else if (document.selection) {
22898                    range = document.selection.createRange();
22899                    range.moveStart("character", -valueLength);
22900                    return valueLength === range.text.length;
22901                }
22902                return true;
22903            },
22904            destroy: function destroy() {
22905                this.$hint.off(".tt");
22906                this.$input.off(".tt");
22907                this.$overflowHelper.remove();
22908                this.$hint = this.$input = this.$overflowHelper = $("<div>");
22909            },
22910            setAriaExpanded: function setAriaExpanded(value) {
22911                this.$input.attr("aria-expanded", value);
22912            }
22913        });
22914        return Input;
22915        function buildOverflowHelper($input) {
22916            return $('<pre aria-hidden="true"></pre>').css({
22917                position: "absolute",
22918                visibility: "hidden",
22919                whiteSpace: "pre",
22920                fontFamily: $input.css("font-family"),
22921                fontSize: $input.css("font-size"),
22922                fontStyle: $input.css("font-style"),
22923                fontVariant: $input.css("font-variant"),
22924                fontWeight: $input.css("font-weight"),
22925                wordSpacing: $input.css("word-spacing"),
22926                letterSpacing: $input.css("letter-spacing"),
22927                textIndent: $input.css("text-indent"),
22928                textRendering: $input.css("text-rendering"),
22929                textTransform: $input.css("text-transform")
22930            }).insertAfter($input);
22931        }
22932        function areQueriesEquivalent(a, b) {
22933            return Input.normalizeQuery(a) === Input.normalizeQuery(b);
22934        }
22935        function withModifier($e) {
22936            return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey;
22937        }
22938    }();
22939    var Dataset = function () {
22940        "use strict";
22941        var keys, nameGenerator;
22942        keys = {
22943            dataset: "tt-selectable-dataset",
22944            val: "tt-selectable-display",
22945            obj: "tt-selectable-object"
22946        };
22947        nameGenerator = _.getIdGenerator();
22948        function Dataset(o, www) {
22949            o = o || {};
22950            o.templates = o.templates || {};
22951            o.templates.notFound = o.templates.notFound || o.templates.empty;
22952            if (!o.source) {
22953                $.error("missing source");
22954            }
22955            if (!o.node) {
22956                $.error("missing node");
22957            }
22958            if (o.name && !isValidName(o.name)) {
22959                $.error("invalid dataset name: " + o.name);
22960            }
22961            www.mixin(this);
22962            this.highlight = !!o.highlight;
22963            this.name = _.toStr(o.name || nameGenerator());
22964            this.limit = o.limit || 5;
22965            this.displayFn = getDisplayFn(o.display || o.displayKey);
22966            this.templates = getTemplates(o.templates, this.displayFn);
22967            this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source;
22968            this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async;
22969            this._resetLastSuggestion();
22970            this.$el = $(o.node).attr("role", "presentation").addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name);
22971        }
22972        Dataset.extractData = function extractData(el) {
22973            var $el = $(el);
22974            if ($el.data(keys.obj)) {
22975                return {
22976                    dataset: $el.data(keys.dataset) || "",
22977                    val: $el.data(keys.val) || "",
22978                    obj: $el.data(keys.obj) || null
22979                };
22980            }
22981            return null;
22982        };
22983        _.mixin(Dataset.prototype, EventEmitter, {
22984            _overwrite: function overwrite(query, suggestions) {
22985                suggestions = suggestions || [];
22986                if (suggestions.length) {
22987                    this._renderSuggestions(query, suggestions);
22988                } else if (this.async && this.templates.pending) {
22989                    this._renderPending(query);
22990                } else if (!this.async && this.templates.notFound) {
22991                    this._renderNotFound(query);
22992                } else {
22993                    this._empty();
22994                }
22995                this.trigger("rendered", suggestions, false, this.name);
22996            },
22997            _append: function append(query, suggestions) {
22998                suggestions = suggestions || [];
22999                if (suggestions.length && this.$lastSuggestion.length) {
23000                    this._appendSuggestions(query, suggestions);
23001                } else if (suggestions.length) {
23002                    this._renderSuggestions(query, suggestions);
23003                } else if (!this.$lastSuggestion.length && this.templates.notFound) {
23004                    this._renderNotFound(query);
23005                }
23006                this.trigger("rendered", suggestions, true, this.name);
23007            },
23008            _renderSuggestions: function renderSuggestions(query, suggestions) {
23009                var $fragment;
23010                $fragment = this._getSuggestionsFragment(query, suggestions);
23011                this.$lastSuggestion = $fragment.children().last();
23012                this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions));
23013            },
23014            _appendSuggestions: function appendSuggestions(query, suggestions) {
23015                var $fragment, $lastSuggestion;
23016                $fragment = this._getSuggestionsFragment(query, suggestions);
23017                $lastSuggestion = $fragment.children().last();
23018                this.$lastSuggestion.after($fragment);
23019                this.$lastSuggestion = $lastSuggestion;
23020            },
23021            _renderPending: function renderPending(query) {
23022                var template = this.templates.pending;
23023                this._resetLastSuggestion();
23024                template && this.$el.html(template({
23025                    query: query,
23026                    dataset: this.name
23027                }));
23028            },
23029            _renderNotFound: function renderNotFound(query) {
23030                var template = this.templates.notFound;
23031                this._resetLastSuggestion();
23032                template && this.$el.html(template({
23033                    query: query,
23034                    dataset: this.name
23035                }));
23036            },
23037            _empty: function empty() {
23038                this.$el.empty();
23039                this._resetLastSuggestion();
23040            },
23041            _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) {
23042                var that = this, fragment;
23043                fragment = document.createDocumentFragment();
23044                _.each(suggestions, function getSuggestionNode(suggestion) {
23045                    var $el, context;
23046                    context = that._injectQuery(query, suggestion);
23047                    $el = $(that.templates.suggestion(context)).data(keys.dataset, that.name).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable);
23048                    fragment.appendChild($el[0]);
23049                });
23050                this.highlight && highlight({
23051                    className: this.classes.highlight,
23052                    node: fragment,
23053                    pattern: query
23054                });
23055                return $(fragment);
23056            },
23057            _getFooter: function getFooter(query, suggestions) {
23058                return this.templates.footer ? this.templates.footer({
23059                    query: query,
23060                    suggestions: suggestions,
23061                    dataset: this.name
23062                }) : null;
23063            },
23064            _getHeader: function getHeader(query, suggestions) {
23065                return this.templates.header ? this.templates.header({
23066                    query: query,
23067                    suggestions: suggestions,
23068                    dataset: this.name
23069                }) : null;
23070            },
23071            _resetLastSuggestion: function resetLastSuggestion() {
23072                this.$lastSuggestion = $();
23073            },
23074            _injectQuery: function injectQuery(query, obj) {
23075                return _.isObject(obj) ? _.mixin({
23076                    _query: query
23077                }, obj) : obj;
23078            },
23079            update: function update(query) {
23080                var that = this, canceled = false, syncCalled = false, rendered = 0;
23081                this.cancel();
23082                this.cancel = function cancel() {
23083                    canceled = true;
23084                    that.cancel = $.noop;
23085                    that.async && that.trigger("asyncCanceled", query, that.name);
23086                };
23087                this.source(query, sync, async);
23088                !syncCalled && sync([]);
23089                function sync(suggestions) {
23090                    if (syncCalled) {
23091                        return;
23092                    }
23093                    syncCalled = true;
23094                    suggestions = (suggestions || []).slice(0, that.limit);
23095                    rendered = suggestions.length;
23096                    that._overwrite(query, suggestions);
23097                    if (rendered < that.limit && that.async) {
23098                        that.trigger("asyncRequested", query, that.name);
23099                    }
23100                }
23101                function async(suggestions) {
23102                    suggestions = suggestions || [];
23103                    if (!canceled && rendered < that.limit) {
23104                        that.cancel = $.noop;
23105                        var idx = Math.abs(rendered - that.limit);
23106                        rendered += idx;
23107                        that._append(query, suggestions.slice(0, idx));
23108                        that.async && that.trigger("asyncReceived", query, that.name);
23109                    }
23110                }
23111            },
23112            cancel: $.noop,
23113            clear: function clear() {
23114                this._empty();
23115                this.cancel();
23116                this.trigger("cleared");
23117            },
23118            isEmpty: function isEmpty() {
23119                return this.$el.is(":empty");
23120            },
23121            destroy: function destroy() {
23122                this.$el = $("<div>");
23123            }
23124        });
23125        return Dataset;
23126        function getDisplayFn(display) {
23127            display = display || _.stringify;
23128            return _.isFunction(display) ? display : displayFn;
23129            function displayFn(obj) {
23130                return obj[display];
23131            }
23132        }
23133        function getTemplates(templates, displayFn) {
23134            return {
23135                notFound: templates.notFound && _.templatify(templates.notFound),
23136                pending: templates.pending && _.templatify(templates.pending),
23137                header: templates.header && _.templatify(templates.header),
23138                footer: templates.footer && _.templatify(templates.footer),
23139                suggestion: templates.suggestion ? userSuggestionTemplate : suggestionTemplate
23140            };
23141            function userSuggestionTemplate(context) {
23142                var template = templates.suggestion;
23143                return $(template(context)).attr("id", _.guid());
23144            }
23145            function suggestionTemplate(context) {
23146                return $('<div role="option">').attr("id", _.guid()).text(displayFn(context));
23147            }
23148        }
23149        function isValidName(str) {
23150            return /^[_a-zA-Z0-9-]+$/.test(str);
23151        }
23152    }();
23153    var Menu = function () {
23154        "use strict";
23155        function Menu(o, www) {
23156            var that = this;
23157            o = o || {};
23158            if (!o.node) {
23159                $.error("node is required");
23160            }
23161            www.mixin(this);
23162            this.$node = $(o.node);
23163            this.query = null;
23164            this.datasets = _.map(o.datasets, initializeDataset);
23165            function initializeDataset(oDataset) {
23166                var node = that.$node.find(oDataset.node).first();
23167                oDataset.node = node.length ? node : $("<div>").appendTo(that.$node);
23168                return new Dataset(oDataset, www);
23169            }
23170        }
23171        _.mixin(Menu.prototype, EventEmitter, {
23172            _onSelectableClick: function onSelectableClick($e) {
23173                this.trigger("selectableClicked", $($e.currentTarget));
23174            },
23175            _onRendered: function onRendered(type, dataset, suggestions, async) {
23176                this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty());
23177                this.trigger("datasetRendered", dataset, suggestions, async);
23178            },
23179            _onCleared: function onCleared() {
23180                this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty());
23181                this.trigger("datasetCleared");
23182            },
23183            _propagate: function propagate() {
23184                this.trigger.apply(this, arguments);
23185            },
23186            _allDatasetsEmpty: function allDatasetsEmpty() {
23187                return _.every(this.datasets, _.bind(function isDatasetEmpty(dataset) {
23188                    var isEmpty = dataset.isEmpty();
23189                    this.$node.attr("aria-expanded", !isEmpty);
23190                    return isEmpty;
23191                }, this));
23192            },
23193            _getSelectables: function getSelectables() {
23194                return this.$node.find(this.selectors.selectable);
23195            },
23196            _removeCursor: function _removeCursor() {
23197                var $selectable = this.getActiveSelectable();
23198                $selectable && $selectable.removeClass(this.classes.cursor);
23199            },
23200            _ensureVisible: function ensureVisible($el) {
23201                var elTop, elBottom, nodeScrollTop, nodeHeight;
23202                elTop = $el.position().top;
23203                elBottom = elTop + $el.outerHeight(true);
23204                nodeScrollTop = this.$node.scrollTop();
23205                nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10);
23206                if (elTop < 0) {
23207                    this.$node.scrollTop(nodeScrollTop + elTop);
23208                } else if (nodeHeight < elBottom) {
23209                    this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight));
23210                }
23211            },
23212            bind: function () {
23213                var that = this, onSelectableClick;
23214                onSelectableClick = _.bind(this._onSelectableClick, this);
23215                this.$node.on("click.tt", this.selectors.selectable, onSelectableClick);
23216                this.$node.on("mouseover", this.selectors.selectable, function () {
23217                    that.setCursor($(this));
23218                });
23219                this.$node.on("mouseleave", function () {
23220                    that._removeCursor();
23221                });
23222                _.each(this.datasets, function (dataset) {
23223                    dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that);
23224                });
23225                return this;
23226            },
23227            isOpen: function isOpen() {
23228                return this.$node.hasClass(this.classes.open);
23229            },
23230            open: function open() {
23231                this.$node.scrollTop(0);
23232                this.$node.addClass(this.classes.open);
23233            },
23234            close: function close() {
23235                this.$node.attr("aria-expanded", false);
23236                this.$node.removeClass(this.classes.open);
23237                this._removeCursor();
23238            },
23239            setLanguageDirection: function setLanguageDirection(dir) {
23240                this.$node.attr("dir", dir);
23241            },
23242            selectableRelativeToCursor: function selectableRelativeToCursor(delta) {
23243                var $selectables, $oldCursor, oldIndex, newIndex;
23244                $oldCursor = this.getActiveSelectable();
23245                $selectables = this._getSelectables();
23246                oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1;
23247                newIndex = oldIndex + delta;
23248                newIndex = (newIndex + 1) % ($selectables.length + 1) - 1;
23249                newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex;
23250                return newIndex === -1 ? null : $selectables.eq(newIndex);
23251            },
23252            setCursor: function setCursor($selectable) {
23253                this._removeCursor();
23254                if ($selectable = $selectable && $selectable.first()) {
23255                    $selectable.addClass(this.classes.cursor);
23256                    this._ensureVisible($selectable);
23257                }
23258            },
23259            getSelectableData: function getSelectableData($el) {
23260                return $el && $el.length ? Dataset.extractData($el) : null;
23261            },
23262            getActiveSelectable: function getActiveSelectable() {
23263                var $selectable = this._getSelectables().filter(this.selectors.cursor).first();
23264                return $selectable.length ? $selectable : null;
23265            },
23266            getTopSelectable: function getTopSelectable() {
23267                var $selectable = this._getSelectables().first();
23268                return $selectable.length ? $selectable : null;
23269            },
23270            update: function update(query) {
23271                var isValidUpdate = query !== this.query;
23272                if (isValidUpdate) {
23273                    this.query = query;
23274                    _.each(this.datasets, updateDataset);
23275                }
23276                return isValidUpdate;
23277                function updateDataset(dataset) {
23278                    dataset.update(query);
23279                }
23280            },
23281            empty: function empty() {
23282                _.each(this.datasets, clearDataset);
23283                this.query = null;
23284                this.$node.addClass(this.classes.empty);
23285                function clearDataset(dataset) {
23286                    dataset.clear();
23287                }
23288            },
23289            destroy: function destroy() {
23290                this.$node.off(".tt");
23291                this.$node = $("<div>");
23292                _.each(this.datasets, destroyDataset);
23293                function destroyDataset(dataset) {
23294                    dataset.destroy();
23295                }
23296            }
23297        });
23298        return Menu;
23299    }();
23300    var Status = function () {
23301        "use strict";
23302        function Status(options) {
23303            this.$el = $("<span></span>", {
23304                role: "status",
23305                "aria-live": "polite"
23306            }).css({
23307                position: "absolute",
23308                padding: "0",
23309                border: "0",
23310                height: "1px",
23311                width: "1px",
23312                "margin-bottom": "-1px",
23313                "margin-right": "-1px",
23314                overflow: "hidden",
23315                clip: "rect(0 0 0 0)",
23316                "white-space": "nowrap"
23317            });
23318            options.$input.after(this.$el);
23319            _.each(options.menu.datasets, _.bind(function (dataset) {
23320                if (dataset.onSync) {
23321                    dataset.onSync("rendered", _.bind(this.update, this));
23322                    dataset.onSync("cleared", _.bind(this.cleared, this));
23323                }
23324            }, this));
23325        }
23326        _.mixin(Status.prototype, {
23327            update: function update(event, suggestions) {
23328                var length = suggestions.length;
23329                var words;
23330                if (length === 1) {
23331                    words = {
23332                        result: "result",
23333                        is: "is"
23334                    };
23335                } else {
23336                    words = {
23337                        result: "results",
23338                        is: "are"
23339                    };
23340                }
23341                this.$el.text(length + " " + words.result + " " + words.is + " available, use up and down arrow keys to navigate.");
23342            },
23343            cleared: function () {
23344                this.$el.text("");
23345            }
23346        });
23347        return Status;
23348    }();
23349    var DefaultMenu = function () {
23350        "use strict";
23351        var s = Menu.prototype;
23352        function DefaultMenu() {
23353            Menu.apply(this, [].slice.call(arguments, 0));
23354        }
23355        _.mixin(DefaultMenu.prototype, Menu.prototype, {
23356            open: function open() {
23357                !this._allDatasetsEmpty() && this._show();
23358                return s.open.apply(this, [].slice.call(arguments, 0));
23359            },
23360            close: function close() {
23361                this._hide();
23362                return s.close.apply(this, [].slice.call(arguments, 0));
23363            },
23364            _onRendered: function onRendered() {
23365                if (this._allDatasetsEmpty()) {
23366                    this._hide();
23367                } else {
23368                    this.isOpen() && this._show();
23369                }
23370                return s._onRendered.apply(this, [].slice.call(arguments, 0));
23371            },
23372            _onCleared: function onCleared() {
23373                if (this._allDatasetsEmpty()) {
23374                    this._hide();
23375                } else {
23376                    this.isOpen() && this._show();
23377                }
23378                return s._onCleared.apply(this, [].slice.call(arguments, 0));
23379            },
23380            setLanguageDirection: function setLanguageDirection(dir) {
23381                this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl);
23382                return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0));
23383            },
23384            _hide: function hide() {
23385                this.$node.hide();
23386            },
23387            _show: function show() {
23388                this.$node.css("display", "block");
23389            }
23390        });
23391        return DefaultMenu;
23392    }();
23393    var Typeahead = function () {
23394        "use strict";
23395        function Typeahead(o, www) {
23396            var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged;
23397            o = o || {};
23398            if (!o.input) {
23399                $.error("missing input");
23400            }
23401            if (!o.menu) {
23402                $.error("missing menu");
23403            }
23404            if (!o.eventBus) {
23405                $.error("missing event bus");
23406            }
23407            www.mixin(this);
23408            this.eventBus = o.eventBus;
23409            this.minLength = _.isNumber(o.minLength) ? o.minLength : 1;
23410            this.input = o.input;
23411            this.menu = o.menu;
23412            this.enabled = true;
23413            this.autoselect = !!o.autoselect;
23414            this.active = false;
vendor: 2,678 bytes, lines 23415-23450
23415            this.input.hasFocus() && this.activate();
23416            this.dir = this.input.getLangDir();
23417            this._hacks();
23418            this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this);
23419            onFocused = c(this, "activate", "open", "_onFocused");
23420            onBlurred = c(this, "deactivate", "_onBlurred");
23421            onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed");
23422            onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed");
23423            onEscKeyed = c(this, "isActive", "_onEscKeyed");
23424            onUpKeyed = c(this, "isActive", "open", "_onUpKeyed");
23425            onDownKeyed = c(this, "isActive", "open", "_onDownKeyed");
23426            onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed");
23427            onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed");
23428            onQueryChanged = c(this, "_openIfActive", "_onQueryChanged");
23429            onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged");
23430            this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this);
23431        }
23432        _.mixin(Typeahead.prototype, {
23433            _hacks: function hacks() {
23434                var $input, $menu;
23435                $input = this.input.$input || $("<div>");
23436                $menu = this.menu.$node || $("<div>");
23437                $input.on("blur.tt", function ($e) {
23438                    var active, isActive, hasActive;
23439                    active = document.activeElement;
23440                    isActive = $menu.is(active);
23441                    hasActive = $menu.has(active).length > 0;
23442                    if (_.isMsie() && (isActive || hasActive)) {
23443                        $e.preventDefault();
23444                        $e.stopImmediatePropagation();
23445                        _.defer(function () {
23446                            $input.focus();
23447                        });
23448                    }
23449                });
23450                $menu.on("mousedown.tt", function 
vendor: 10,151 bytes, lines 23450-23680
23450($e) {
23451                    $e.preventDefault();
23452                });
23453            },
23454            _onSelectableClicked: function onSelectableClicked(type, $el) {
23455                this.select($el);
23456            },
23457            _onDatasetCleared: function onDatasetCleared() {
23458                this._updateHint();
23459            },
23460            _onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) {
23461                this._updateHint();
23462                if (this.autoselect) {
23463                    var cursorClass = this.selectors.cursor.substr(1);
23464                    this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass);
23465                }
23466                this.eventBus.trigger("render", suggestions, async, dataset);
23467            },
23468            _onAsyncRequested: function onAsyncRequested(type, dataset, query) {
23469                this.eventBus.trigger("asyncrequest", query, dataset);
23470            },
23471            _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) {
23472                this.eventBus.trigger("asynccancel", query, dataset);
23473            },
23474            _onAsyncReceived: function onAsyncReceived(type, dataset, query) {
23475                this.eventBus.trigger("asyncreceive", query, dataset);
23476            },
23477            _onFocused: function onFocused() {
23478                this._minLengthMet() && this.menu.update(this.input.getQuery());
23479            },
23480            _onBlurred: function onBlurred() {
23481                if (this.input.hasQueryChangedSinceLastFocus()) {
23482                    this.eventBus.trigger("change", this.input.getQuery());
23483                }
23484            },
23485            _onEnterKeyed: function onEnterKeyed(type, $e) {
23486                var $selectable;
23487                if ($selectable = this.menu.getActiveSelectable()) {
23488                    if (this.select($selectable)) {
23489                        $e.preventDefault();
23490                        $e.stopPropagation();
23491                    }
23492                } else if (this.autoselect) {
23493                    if (this.select(this.menu.getTopSelectable())) {
23494                        $e.preventDefault();
23495                        $e.stopPropagation();
23496                    }
23497                }
23498            },
23499            _onTabKeyed: function onTabKeyed(type, $e) {
23500                var $selectable;
23501                if ($selectable = this.menu.getActiveSelectable()) {
23502                    this.select($selectable) && $e.preventDefault();
23503                } else if (this.autoselect) {
23504                    if ($selectable = this.menu.getTopSelectable()) {
23505                        this.autocomplete($selectable) && $e.preventDefault();
23506                    }
23507                }
23508            },
23509            _onEscKeyed: function onEscKeyed() {
23510                this.close();
23511            },
23512            _onUpKeyed: function onUpKeyed() {
23513                this.moveCursor(-1);
23514            },
23515            _onDownKeyed: function onDownKeyed() {
23516                this.moveCursor(+1);
23517            },
23518            _onLeftKeyed: function onLeftKeyed() {
23519                if (this.dir === "rtl" && this.input.isCursorAtEnd()) {
23520                    this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable());
23521                }
23522            },
23523            _onRightKeyed: function onRightKeyed() {
23524                if (this.dir === "ltr" && this.input.isCursorAtEnd()) {
23525                    this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable());
23526                }
23527            },
23528            _onQueryChanged: function onQueryChanged(e, query) {
23529                this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty();
23530            },
23531            _onWhitespaceChanged: function onWhitespaceChanged() {
23532                this._updateHint();
23533            },
23534            _onLangDirChanged: function onLangDirChanged(e, dir) {
23535                if (this.dir !== dir) {
23536                    this.dir = dir;
23537                    this.menu.setLanguageDirection(dir);
23538                }
23539            },
23540            _openIfActive: function openIfActive() {
23541                this.isActive() && this.open();
23542            },
23543            _minLengthMet: function minLengthMet(query) {
23544                query = _.isString(query) ? query : this.input.getQuery() || "";
23545                return query.length >= this.minLength;
23546            },
23547            _updateHint: function updateHint() {
23548                var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match;
23549                $selectable = this.menu.getTopSelectable();
23550                data = this.menu.getSelectableData($selectable);
23551                val = this.input.getInputValue();
23552                if (data && !_.isBlankString(val) && !this.input.hasOverflow()) {
23553                    query = Input.normalizeQuery(val);
23554                    escapedQuery = _.escapeRegExChars(query);
23555                    frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i");
23556                    match = frontMatchRegEx.exec(data.val);
23557                    match && this.input.setHint(val + match[1]);
23558                } else {
23559                    this.input.clearHint();
23560                }
23561            },
23562            isEnabled: function isEnabled() {
23563                return this.enabled;
23564            },
23565            enable: function enable() {
23566                this.enabled = true;
23567            },
23568            disable: function disable() {
23569                this.enabled = false;
23570            },
23571            isActive: function isActive() {
23572                return this.active;
23573            },
23574            activate: function activate() {
23575                if (this.isActive()) {
23576                    return true;
23577                } else if (!this.isEnabled() || this.eventBus.before("active")) {
23578                    return false;
23579                } else {
23580                    this.active = true;
23581                    this.eventBus.trigger("active");
23582                    return true;
23583                }
23584            },
23585            deactivate: function deactivate() {
23586                if (!this.isActive()) {
23587                    return true;
23588                } else if (this.eventBus.before("idle")) {
23589                    return false;
23590                } else {
23591                    this.active = false;
23592                    this.close();
23593                    this.eventBus.trigger("idle");
23594                    return true;
23595                }
23596            },
23597            isOpen: function isOpen() {
23598                return this.menu.isOpen();
23599            },
23600            open: function open() {
23601                if (!this.isOpen() && !this.eventBus.before("open")) {
23602                    this.input.setAriaExpanded(true);
23603                    this.menu.open();
23604                    this._updateHint();
23605                    this.eventBus.trigger("open");
23606                }
23607                return this.isOpen();
23608            },
23609            close: function close() {
23610                if (this.isOpen() && !this.eventBus.before("close")) {
23611                    this.input.setAriaExpanded(false);
23612                    this.menu.close();
23613                    this.input.clearHint();
23614                    this.input.resetInputValue();
23615                    this.eventBus.trigger("close");
23616                }
23617                return !this.isOpen();
23618            },
23619            setVal: function setVal(val) {
23620                this.input.setQuery(_.toStr(val));
23621            },
23622            getVal: function getVal() {
23623                return this.input.getQuery();
23624            },
23625            select: function select($selectable) {
23626                var data = this.menu.getSelectableData($selectable);
23627                if (data && !this.eventBus.before("select", data.obj, data.dataset)) {
23628                    this.input.setQuery(data.val, true);
23629                    this.eventBus.trigger("select", data.obj, data.dataset);
23630                    this.close();
23631                    return true;
23632                }
23633                return false;
23634            },
23635            autocomplete: function autocomplete($selectable) {
23636                var query, data, isValid;
23637                query = this.input.getQuery();
23638                data = this.menu.getSelectableData($selectable);
23639                isValid = data && query !== data.val;
23640                if (isValid && !this.eventBus.before("autocomplete", data.obj, data.dataset)) {
23641                    this.input.setQuery(data.val);
23642                    this.eventBus.trigger("autocomplete", data.obj, data.dataset);
23643                    return true;
23644                }
23645                return false;
23646            },
23647            moveCursor: function moveCursor(delta) {
23648                var query, $candidate, data, suggestion, datasetName, cancelMove, id;
23649                query = this.input.getQuery();
23650                $candidate = this.menu.selectableRelativeToCursor(delta);
23651                data = this.menu.getSelectableData($candidate);
23652                suggestion = data ? data.obj : null;
23653                datasetName = data ? data.dataset : null;
23654                id = $candidate ? $candidate.attr("id") : null;
23655                this.input.trigger("cursorchange", id);
23656                cancelMove = this._minLengthMet() && this.menu.update(query);
23657                if (!cancelMove && !this.eventBus.before("cursorchange", suggestion, datasetName)) {
23658                    this.menu.setCursor($candidate);
23659                    if (data) {
23660                        if (typeof data.val === "string") {
23661                            this.input.setInputValue(data.val);
23662                        }
23663                    } else {
23664                        this.input.resetInputValue();
23665                        this._updateHint();
23666                    }
23667                    this.eventBus.trigger("cursorchange", suggestion, datasetName);
23668                    return true;
23669                }
23670                return false;
23671            },
23672            destroy: function destroy() {
23673                this.input.destroy();
23674                this.menu.destroy();
23675            }
23676        });
23677        return Typeahead;
23678        function c(ctx) {
23679            var methods = [].slice.call(arguments, 1);
23680            return function
vendor: 9,736 bytes, lines 23680-23929
23680 () {
23681                var args = [].slice.call(arguments);
23682                _.each(methods, function (method) {
23683                    return ctx[method].apply(ctx, args);
23684                });
23685            };
23686        }
23687    }();
23688    (function () {
23689        "use strict";
23690        var old, keys, methods;
23691        old = $.fn.typeahead;
23692        keys = {
23693            www: "tt-www",
23694            attrs: "tt-attrs",
23695            typeahead: "tt-typeahead"
23696        };
23697        methods = {
23698            initialize: function initialize(o, datasets) {
23699                var www;
23700                datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1);
23701                o = o || {};
23702                www = WWW(o.classNames);
23703                return this.each(attach);
23704                function attach() {
23705                    var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, status, typeahead, MenuConstructor;
23706                    _.each(datasets, function (d) {
23707                        d.highlight = !!o.highlight;
23708                    });
23709                    $input = $(this);
23710                    $wrapper = $(www.html.wrapper);
23711                    $hint = $elOrNull(o.hint);
23712                    $menu = $elOrNull(o.menu);
23713                    defaultHint = o.hint !== false && !$hint;
23714                    defaultMenu = o.menu !== false && !$menu;
23715                    defaultHint && ($hint = buildHintFromInput($input, www));
23716                    defaultMenu && ($menu = $(www.html.menu).css(www.css.menu));
23717                    $hint && $hint.val("");
23718                    $input = prepInput($input, www);
23719                    if (defaultHint || defaultMenu) {
23720                        $wrapper.css(www.css.wrapper);
23721                        $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint);
23722                        $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null);
23723                    }
23724                    MenuConstructor = defaultMenu ? DefaultMenu : Menu;
23725                    eventBus = new EventBus({
23726                        el: $input
23727                    });
23728                    input = new Input({
23729                        hint: $hint,
23730                        input: $input,
23731                        menu: $menu
23732                    }, www);
23733                    menu = new MenuConstructor({
23734                        node: $menu,
23735                        datasets: datasets
23736                    }, www);
23737                    status = new Status({
23738                        $input: $input,
23739                        menu: menu
23740                    });
23741                    typeahead = new Typeahead({
23742                        input: input,
23743                        menu: menu,
23744                        eventBus: eventBus,
23745                        minLength: o.minLength,
23746                        autoselect: o.autoselect
23747                    }, www);
23748                    $input.data(keys.www, www);
23749                    $input.data(keys.typeahead, typeahead);
23750                }
23751            },
23752            isEnabled: function isEnabled() {
23753                var enabled;
23754                ttEach(this.first(), function (t) {
23755                    enabled = t.isEnabled();
23756                });
23757                return enabled;
23758            },
23759            enable: function enable() {
23760                ttEach(this, function (t) {
23761                    t.enable();
23762                });
23763                return this;
23764            },
23765            disable: function disable() {
23766                ttEach(this, function (t) {
23767                    t.disable();
23768                });
23769                return this;
23770            },
23771            isActive: function isActive() {
23772                var active;
23773                ttEach(this.first(), function (t) {
23774                    active = t.isActive();
23775                });
23776                return active;
23777            },
23778            activate: function activate() {
23779                ttEach(this, function (t) {
23780                    t.activate();
23781                });
23782                return this;
23783            },
23784            deactivate: function deactivate() {
23785                ttEach(this, function (t) {
23786                    t.deactivate();
23787                });
23788                return this;
23789            },
23790            isOpen: function isOpen() {
23791                var open;
23792                ttEach(this.first(), function (t) {
23793                    open = t.isOpen();
23794                });
23795                return open;
23796            },
23797            open: function open() {
23798                ttEach(this, function (t) {
23799                    t.open();
23800                });
23801                return this;
23802            },
23803            close: function close() {
23804                ttEach(this, function (t) {
23805                    t.close();
23806                });
23807                return this;
23808            },
23809            select: function select(el) {
23810                var success = false, $el = $(el);
23811                ttEach(this.first(), function (t) {
23812                    success = t.select($el);
23813                });
23814                return success;
23815            },
23816            autocomplete: function autocomplete(el) {
23817                var success = false, $el = $(el);
23818                ttEach(this.first(), function (t) {
23819                    success = t.autocomplete($el);
23820                });
23821                return success;
23822            },
23823            moveCursor: function moveCursoe(delta) {
23824                var success = false;
23825                ttEach(this.first(), function (t) {
23826                    success = t.moveCursor(delta);
23827                });
23828                return success;
23829            },
23830            val: function val(newVal) {
23831                var query;
23832                if (!arguments.length) {
23833                    ttEach(this.first(), function (t) {
23834                        query = t.getVal();
23835                    });
23836                    return query;
23837                } else {
23838                    ttEach(this, function (t) {
23839                        t.setVal(_.toStr(newVal));
23840                    });
23841                    return this;
23842                }
23843            },
23844            destroy: function destroy() {
23845                ttEach(this, function (typeahead, $input) {
23846                    revert($input);
23847                    typeahead.destroy();
23848                });
23849                return this;
23850            }
23851        };
23852        $.fn.typeahead = function (method) {
23853            if (methods[method]) {
23854                return methods[method].apply(this, [].slice.call(arguments, 1));
23855            } else {
23856                return methods.initialize.apply(this, arguments);
23857            }
23858        };
23859        $.fn.typeahead.noConflict = function noConflict() {
23860            $.fn.typeahead = old;
23861            return this;
23862        };
23863        function ttEach($els, fn) {
23864            $els.each(function () {
23865                var $input = $(this), typeahead;
23866                (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input);
23867            });
23868        }
23869        function buildHintFromInput($input, www) {
23870            return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({
23871                readonly: true,
23872                required: false
23873            }).removeAttr("id name placeholder").removeClass("required").attr({
23874                spellcheck: "false",
23875                tabindex: -1
23876            });
23877        }
23878        function prepInput($input, www) {
23879            $input.data(keys.attrs, {
23880                dir: $input.attr("dir"),
23881                autocomplete: $input.attr("autocomplete"),
23882                spellcheck: $input.attr("spellcheck"),
23883                style: $input.attr("style")
23884            });
23885            $input.addClass(www.classes.input).attr({
23886                spellcheck: false
23887            });
23888            try {
23889                !$input.attr("dir") && $input.attr("dir", "auto");
23890            } catch (e) { }
23891            return $input;
23892        }
23893        function getBackgroundStyles($el) {
23894            return {
23895                backgroundAttachment: $el.css("background-attachment"),
23896                backgroundClip: $el.css("background-clip"),
23897                backgroundColor: $el.css("background-color"),
23898                backgroundImage: $el.css("background-image"),
23899                backgroundOrigin: $el.css("background-origin"),
23900                backgroundPosition: $el.css("background-position"),
23901                backgroundRepeat: $el.css("background-repeat"),
23902                backgroundSize: $el.css("background-size")
23903            };
23904        }
23905        function revert($input) {
23906            var www, $wrapper;
23907            www = $input.data(keys.www);
23908            $wrapper = $input.parent().filter(www.selectors.wrapper);
23909            _.each($input.data(keys.attrs), function (val, key) {
23910                _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val);
23911            });
23912            $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input);
23913            if ($wrapper.length) {
23914                $input.detach().insertAfter($wrapper);
23915                $wrapper.remove();
23916            }
23917        }
23918        function $elOrNull(obj) {
23919            var isValid, $el;
23920            isValid = _.isJQuery(obj) || _.isElement(obj);
23921            $el = isValid ? $(obj).first() : [];
23922            return $el.length ? $el : null;
23923        }
23924    })();
23925});
23926
23927/*  jquerymCustomScrollbar  */
23928/* == jquery mousewheel plugin == Version: 3.1.13, License: MIT License (MIT) */
23929!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1
vendor: 5,118 bytes, lines 23929-23930
23929),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
23930/* == malihu jquery custom scrollbar plugin == Version: 3.1.5, License: MIT License (MIT) */
vendor: 40,087 bytes, lines 23930-23932
23930
23931!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){!function(t){var o="function"==typeof define&&define.amd,a="undefined"!=typeof module&&module.exports,n="https:"==document.location.protocol?"https:":"http:",i="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js";o||(a?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+n+"//"+i+"%3E%3C/script%3E"))),t()}(function(){var t,o="mCustomScrollbar",a="mCS",n=".mCustomScrollbar",i={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},r=0,l={},s=window.attachEvent&&!window.addEventListener?1:0,c=!1,d=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],u={init:function(t){var t=e.extend(!0,{},i,t),o=f.call(this);if(t.live){var s=t.liveSelector||this.selector||n,c=e(s);if("off"===t.live)return void m(s);l[s]=setTimeout(function(){c.mCustomScrollbar(t),"once"===t.live&&c.length&&m(s)},500)}else m(s);return t.setWidth=t.set_width?t.set_width:t.setWidth,t.setHeight=t.set_height?t.set_height:t.setHeight,t.axis=t.horizontalScroll?"x":p(t.axis),t.scrollInertia=t.scrollInertia>0&&t.scrollInertia<17?17:t.scrollInertia,"object"!=typeof t.mouseWheel&&1==t.mouseWheel&&(t.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),t.mouseWheel.scrollAmount=t.mouseWheelPixels?t.mouseWheelPixels:t.mouseWheel.scrollAmount,t.mouseWheel.normalizeDelta=t.advanced.normalizeMouseWheelDelta?t.advanced.normalizeMouseWheelDelta:t.mouseWheel.normalizeDelta,t.scrollButtons.scrollType=g(t.scrollButtons.scrollType),h(t),e(o).each(function(){var o=e(this);if(!o.data(a)){o.data(a,{idx:++r,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:o.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var n=o.data(a),i=n.opt,l=o.data("mcs-axis"),s=o.data("mcs-scrollbar-position"),c=o.data("mcs-theme");l&&(i.axis=l),s&&(i.scrollbarPosition=s),c&&(i.theme=c,h(i)),v.call(this),n&&i.callbacks.onCreate&&"function"==typeof i.callbacks.onCreate&&i.callbacks.onCreate.call(this),e("#mCSB_"+n.idx+"_container img:not(."+d[2]+")").addClass(d[2]),u.update.call(null,o)}})},update:function(t,o){var n=t||f.call(this);return e(n).each(function(){var t=e(this);if(t.data(a)){var n=t.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container"),l=e("#mCSB_"+n.idx),s=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];if(!r.length)return;n.tweenRunning&&Q(t),o&&n&&i.callbacks.onBeforeUpdate&&"function"==typeof i.callbacks.onBeforeUpdate&&i.callbacks.onBeforeUpdate.call(this),t.hasClass(d[3])&&t.removeClass(d[3]),t.hasClass(d[4])&&t.removeClass(d[4]),l.css("max-height","none"),l.height()!==t.height()&&l.css("max-height",t.height()),_.call(this),"y"===i.axis||i.advanced.autoExpandHorizontalScroll||r.css("width",x(r)),n.overflowed=y.call(this),M.call(this),i.autoDraggerLength&&S.call(this),b.call(this),T.call(this);var c=[Math.abs(r[0].offsetTop),Math.abs(r[0].offsetLeft)];"x"!==i.axis&&(n.overflowed[0]?s[0].height()>s[0].parent().height()?B.call(this):(G(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}),n.contentReset.y=null):(B.call(this),"y"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[1]&&G(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==i.axis&&(n.overflowed[1]?s[1].width()>s[1].parent().width()?B.call(this):(G(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}),n.contentReset.x=null):(B.call(this),"x"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[0]&&G(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),o&&n&&(2===o&&i.callbacks.onImageLoad&&"function"==typeof i.callbacks.onImageLoad?i.callbacks.onImageLoad.call(this):3===o&&i.callbacks.onSelectorChange&&"function"==typeof i.callbacks.onSelectorChange?i.callbacks.onSelectorChange.call(this):i.callbacks.onUpdate&&"function"==typeof i.callbacks.onUpdate&&i.callbacks.onUpdate.call(this)),N.call(this)}})},scrollTo:function(t,o){if("undefined"!=typeof t&&null!=t){var n=f.call(this);return e(n).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l={trigger:"external",scrollInertia:r.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},s=e.extend(!0,{},l,o),c=Y.call(this,t),d=s.scrollInertia>0&&s.scrollInertia<17?17:s.scrollInertia;c[0]=X.call(this,c[0],"y"),c[1]=X.call(this,c[1],"x"),s.moveDragger&&(c[0]*=i.scrollRatio.y,c[1]*=i.scrollRatio.x),s.dur=ne()?0:d,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==r.axis&&i.overflowed[0]&&(s.dir="y",s.overwrite="all",G(n,c[0].toString(),s)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==r.axis&&i.overflowed[1]&&(s.dir="x",s.overwrite="none",G(n,c[1].toString(),s))},s.timeout)}})}},stop:function(){var t=f.call(this);return e(t).each(function(){var t=e(this);t.data(a)&&Q(t)})},disable:function(t){var o=f.call(this);return e(o).each(function(){var o=e(this);if(o.data(a)){o.data(a);N.call(this,"remove"),k.call(this),t&&B.call(this),M.call(this,!0),o.addClass(d[3])}})},destroy:function(){var t=f.call(this);return e(t).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx),s=e("#mCSB_"+i.idx+"_container"),c=e(".mCSB_"+i.idx+"_scrollbar");r.live&&m(r.liveSelector||e(t).selector),N.call(this,"remove"),k.call(this),B.call(this),n.removeData(a),$(this,"mcs"),c.remove(),s.find("img."+d[2]).removeClass(d[2]),l.replaceWith(s.contents()),n.removeClass(o+" _"+a+"_"+i.idx+" "+d[6]+" "+d[7]+" "+d[5]+" "+d[3]).addClass(d[4])}})}},f=function(){return"object"!=typeof e(this)||e(this).length<1?n:this},h=function(t){var o=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],a=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],n=["minimal","minimal-dark"],i=["minimal","minimal-dark"],r=["minimal","minimal-dark"];t.autoDraggerLength=e.inArray(t.theme,o)>-1?!1:t.autoDraggerLength,t.autoExpandScrollbar=e.inArray(t.theme,a)>-1?!1:t.autoExpandScrollbar,t.scrollButtons.enable=e.inArray(t.theme,n)>-1?!1:t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,i)>-1?!0:t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,r)>-1?"outside":t.scrollbarPosition},m=function(e){l[e]&&(clearTimeout(l[e]),$(l,e))},p=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},g=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},v=function(){var t=e(this),n=t.data(a),i=n.opt,r=i.autoExpandScrollbar?" "+d[1]+"_expand":"",l=["<div id='mCSB_"+n.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+n.idx+"_scrollbar mCS-"+i.theme+" mCSB_scrollTools_vertical"+r+"'><div class='"+d[12]+"'><div id='mCSB_"+n.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>","<div id='mCSB_"+n.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+n.idx+"_scrollbar mCS-"+i.theme+" mCSB_scrollTools_horizontal"+r+"'><div class='"+d[12]+"'><div id='mCSB_"+n.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>"],s="yx"===i.axis?"mCSB_vertical_horizontal":"x"===i.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===i.axis?l[0]+l[1]:"x"===i.axis?l[1]:l[0],u="yx"===i.axis?"<div id='mCSB_"+n.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",f=i.autoHideScrollbar?" "+d[6]:"",h="x"!==i.axis&&"rtl"===n.langDir?" "+d[7]:"";i.setWidth&&t.css("width",i.setWidth),i.setHeight&&t.css("height",i.setHeight),i.setLeft="y"!==i.axis&&"rtl"===n.langDir?"989999px":i.setLeft,t.addClass(o+" _"+a+"_"+n.idx+f+h).wrapInner("<div id='mCSB_"+n.idx+"' class='mCustomScrollBox mCS-"+i.theme+" "+s+"'><div id='mCSB_"+n.idx+"_container' class='mCSB_container' style='position:relative; top:"+i.setTop+"; left:"+i.setLeft+";' dir='"+n.langDir+"' /></div>");var m=e("#mCSB_"+n.idx),p=e("#mCSB_"+n.idx+"_container");"y"===i.axis||i.advanced.autoExpandHorizontalScroll||p.css("width",x(p)),"outside"===i.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),m.addClass("mCSB_outside").after(c)):(m.addClass("mCSB_inside").append(c),p.wrap(u)),w.call(this);var g=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},x=function(t){var o=[t[0].scrollWidth,Math.max.apply(Math,t.children().map(function(){return e(this).outerWidth(!0)}).get())],a=t.parent().width();return o[0]>a?o[0]:o[1]>a?o[1]:"100%"},_=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx+"_container");if(n.advanced.autoExpandHorizontalScroll&&"y"!==n.axis){i.css({width:"auto","min-width":0,"overflow-x":"scroll"});var r=Math.ceil(i[0].scrollWidth);3===n.advanced.autoExpandHorizontalScroll||2!==n.advanced.autoExpandHorizontalScroll&&r>i.parent().width()?i.css({width:r,"min-width":"100%","overflow-x":"inherit"}):i.css({"overflow-x":"inherit",position:"absolute"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap()}},w=function(){var t=e(this),o=t.data(a),n=o.opt,i=e(".mCSB_"+o.idx+"_scrollbar:first"),r=oe(n.scrollButtons.tabindex)?"tabindex='"+n.scrollButtons.tabindex+"'":"",l=["<a href='#' class='"+d[13]+"' "+r+" />","<a href='#' class='"+d[14]+"' "+r+" />","<a href='#' class='"+d[15]+"' "+r+" />","<a href='#' class='"+d[16]+"' "+r+" />"],s=["x"===n.axis?l[2]:l[0],"x"===n.axis?l[3]:l[1],l[2],l[3]];n.scrollButtons.enable&&i.prepend(s[0]).append(s[1]).next(".mCSB_scrollTools").prepend(s[2]).append(s[3])},S=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[n.height()/i.outerHeight(!1),n.width()/i.outerWidth(!1)],c=[parseInt(r[0].css("min-height")),Math.round(l[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(l[1]*r[1].parent().width())],d=s&&c[1]<c[0]?c[0]:c[1],u=s&&c[3]<c[2]?c[2]:c[3];r[0].css({height:d,"max-height":r[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":c[0]+"px"}),r[1].css({width:u,"max-width":r[1].parent().width()-10})},b=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[i.outerHeight(!1)-n.height(),i.outerWidth(!1)-n.width()],s=[l[0]/(r[0].parent().height()-r[0].height()),l[1]/(r[1].parent().width()-r[1].width())];o.scrollRatio={y:s[0],x:s[1]}},C=function(e,t,o){var a=o?d[0]+"_expanded":"",n=e.closest(".mCSB_scrollTools");"active"===t?(e.toggleClass(d[0]+" "+a),n.toggleClass(d[1]),e[0]._draggable=e[0]._draggable?0:1):e[0]._draggable||("hide"===t?(e.removeClass(d[0]),n.removeClass(d[1])):(e.addClass(d[0]),n.addClass(d[1])))},y=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=null==o.overflowed?i.height():i.outerHeight(!1),l=null==o.overflowed?i.width():i.outerWidth(!1),s=i[0].scrollHeight,c=i[0].scrollWidth;return s>r&&(r=s),c>l&&(l=c),[r>n.height(),l>n.width()]},B=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx),r=e("#mCSB_"+o.idx+"_container"),l=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")];if(Q(t),("x"!==n.axis&&!o.overflowed[0]||"y"===n.axis&&o.overflowed[0])&&(l[0].add(r).css("top",0),G(t,"_resetY")),"y"!==n.axis&&!o.overflowed[1]||"x"===n.axis&&o.overflowed[1]){var s=dx=0;"rtl"===o.langDir&&(s=i.width()-r.outerWidth(!1),dx=Math.abs(s/o.scrollRatio.x)),r.css("left",s),l[1].css("left",dx),G(t,"_resetX")}},T=function(){function t(){r=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(r),W.call(o[0])):t()},100)}var o=e(this),n=o.data(a),i=n.opt;if(!n.bindEvents){if(I.call(this),i.contentTouchScroll&&D.call(this),E.call(this),i.mouseWheel.enable){var r;t()}P.call(this),U.call(this),i.advanced.autoScrollOnFocus&&H.call(this),i.scrollButtons.enable&&F.call(this),i.keyboard.enable&&q.call(this),n.bindEvents=!0}},k=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=".mCSB_"+o.idx+"_scrollbar",l=e("#mCSB_"+o.idx+",#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,"+r+" ."+d[12]+",#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal,"+r+">a"),s=e("#mCSB_"+o.idx+"_container");n.advanced.releaseDraggableSelectors&&l.add(e(n.advanced.releaseDraggableSelectors)),n.advanced.extraDraggableSelectors&&l.add(e(n.advanced.extraDraggableSelectors)),o.bindEvents&&(e(document).add(e(!A()||top.document)).unbind("."+i),l.each(function(){e(this).unbind("."+i)}),clearTimeout(t[0]._focusTimeout),$(t[0],"_focusTimeout"),clearTimeout(o.sequential.step),$(o.sequential,"step"),clearTimeout(s[0].onCompleteTimeout),$(s[0],"onCompleteTimeout"),o.bindEvents=!1)},M=function(t){var o=e(this),n=o.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container_wrapper"),l=r.length?r:e("#mCSB_"+n.idx+"_container"),s=[e("#mCSB_"+n.idx+"_scrollbar_vertical"),e("#mCSB_"+n.idx+"_scrollbar_horizontal")],c=[s[0].find(".mCSB_dragger"),s[1].find(".mCSB_dragger")];"x"!==i.axis&&(n.overflowed[0]&&!t?(s[0].add(c[0]).add(s[0].children("a")).css("display","block"),l.removeClass(d[8]+" "+d[10])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[0].css("display","none"),l.removeClass(d[10])):(s[0].css("display","none"),l.addClass(d[10])),l.addClass(d[8]))),"y"!==i.axis&&(n.overflowed[1]&&!t?(s[1].add(c[1]).add(s[1].children("a")).css("display","block"),l.removeClass(d[9]+" "+d[11])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[1].css("display","none"),l.removeClass(d[11])):(s[1].css("display","none"),l.addClass(d[11])),l.addClass(d[9]))),n.overflowed[0]||n.overflowed[1]?o.removeClass(d[5]):o.addClass(d[5])},O=function(t){var o=t.type,a=t.target.ownerDocument!==document&&null!==frameElement?[e(frameElement).offset().top,e(frameElement).offset().left]:null,n=A()&&t.target.ownerDocument!==top.document&&null!==frameElement?[e(t.view.frameElement).offset().top,e(t.view.frameElement).offset().left]:[0,0];switch(o){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return a?[t.originalEvent.pageY-a[0]+n[0],t.originalEvent.pageX-a[1]+n[1],!1]:[t.originalEvent.pageY,t.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var i=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],r=t.originalEvent.touches.length||t.originalEvent.changedTouches.length;return t.target.ownerDocument!==document?[i.screenY,i.screenX,r>1]:[i.pageY,i.pageX,r>1];default:return a?[t.pageY-a[0]+n[0],t.pageX-a[1]+n[1],!1]:[t.pageY,t.pageX,!1]}},I=function(){function t(e,t,a,n){if(h[0].idleTimer=d.scrollInertia<233?250:0,o.attr("id")===f[1])var i="x",s=(o[0].offsetLeft-t+n)*l.scrollRatio.x;else var i="y",s=(o[0].offsetTop-e+a)*l.scrollRatio.y;G(r,s.toString(),{dir:i,drag:!0})}var o,n,i,r=e(this),l=r.data(a),d=l.opt,u=a+"_"+l.idx,f=["mCSB_"+l.idx+"_dragger_vertical","mCSB_"+l.idx+"_dragger_horizontal"],h=e("#mCSB_"+l.idx+"_container"),m=e("#"+f[0]+",#"+f[1]),p=d.advanced.releaseDraggableSelectors?m.add(e(d.advanced.releaseDraggableSelectors)):m,g=d.advanced.extraDraggableSelectors?e(!A()||top.document).add(e(d.advanced.extraDraggableSelectors)):e(!A()||top.document);m.bind("contextmenu."+u,function(e){e.preventDefault()}).bind("mousedown."+u+" touchstart."+u+" pointerdown."+u+" MSPointerDown."+u,function(t){if(t.stopImmediatePropagation(),t.preventDefault(),ee(t)){c=!0,s&&(document.onselectstart=function(){return!1}),L.call(h,!1),Q(r),o=e(this);var a=o.offset(),l=O(t)[0]-a.top,u=O(t)[1]-a.left,f=o.height()+a.top,m=o.width()+a.left;f>l&&l>0&&m>u&&u>0&&(n=l,i=u),C(o,"active",d.autoExpandScrollbar)}}).bind("touchmove."+u,function(e){e.stopImmediatePropagation(),e.preventDefault();var a=o.offset(),r=O(e)[0]-a.top,l=O(e)[1]-a.left;t(n,i,r,l)}),e(document).add(g).bind("mousemove."+u+" pointermove."+u+" MSPointerMove."+u,function(e){if(o){var a=o.offset(),r=O(e)[0]-a.top,l=O(e)[1]-a.left;if(n===r&&i===l)return;t(n,i,r,l)}}).add(p).bind("mouseup."+u+" touchend."+u+" pointerup."+u+" MSPointerUp."+u,function(){o&&(C(o,"active",d.autoExpandScrollbar),o=null),c=!1,s&&(document.onselectstart=null),L.call(h,!0)})},D=function(){function o(e){if(!te(e)||c||O(e)[2])return void(t=0);t=1,b=0,C=0,d=1,y.removeClass("mCS_touch_action");var o=I.offset();u=O(e)[0]-o.top,f=O(e)[1]-o.left,z=[O(e)[0],O(e)[1]]}function n(e){if(te(e)&&!c&&!O(e)[2]&&(T.documentTouchScroll||e.preventDefault(),e.stopImmediatePropagation(),(!C||b)&&d)){g=K();var t=M.offset(),o=O(e)[0]-t.top,a=O(e)[1]-t.left,n="mcsLinearOut";if(E.push(o),W.push(a),z[2]=Math.abs(O(e)[0]-z[0]),z[3]=Math.abs(O(e)[1]-z[1]),B.overflowed[0])var i=D[0].parent().height()-D[0].height(),r=u-o>0&&o-u>-(i*B.scrollRatio.y)&&(2*z[3]<z[2]||"yx"===T.axis);if(B.overflowed[1])var l=D[1].parent().width()-D[1].width(),h=f-a>0&&a-f>-(l*B.scrollRatio.x)&&(2*z[2]<z[3]||"yx"===T.axis);r||h?(U||e.preventDefault(),b=1):(C=1,y.addClass("mCS_touch_action")),U&&e.preventDefault(),w="yx"===T.axis?[u-o,f-a]:"x"===T.axis?[null,f-a]:[u-o,null],I[0].idleTimer=250,B.overflowed[0]&&s(w[0],R,n,"y","all",!0),B.overflowed[1]&&s(w[1],R,n,"x",L,!0)}}function i(e){if(!te(e)||c||O(e)[2])return void(t=0);t=1,e.stopImmediatePropagation(),Q(y),p=K();var o=M.offset();h=O(e)[0]-o.top,m=O(e)[1]-o.left,E=[],W=[]}function r(e){if(te(e)&&!c&&!O(e)[2]){d=0,e.stopImmediatePropagation(),b=0,C=0,v=K();var t=M.offset(),o=O(e)[0]-t.top,a=O(e)[1]-t.left;if(!(v-g>30)){_=1e3/(v-p);var n="mcsEaseOut",i=2.5>_,r=i?[E[E.length-2],W[W.length-2]]:[0,0];x=i?[o-r[0],a-r[1]]:[o-h,a-m];var u=[Math.abs(x[0]),Math.abs(x[1])];_=i?[Math.abs(x[0]/4),Math.abs(x[1]/4)]:[_,_];var f=[Math.abs(I[0].offsetTop)-x[0]*l(u[0]/_[0],_[0]),Math.abs(I[0].offsetLeft)-x[1]*l(u[1]/_[1],_[1])];w="yx"===T.axis?[f[0],f[1]]:"x"===T.axis?[null,f[1]]:[f[0],null],S=[4*u[0]+T.scrollInertia,4*u[1]+T.scrollInertia];var y=parseInt(T.contentTouchScroll)||0;w[0]=u[0]>y?w[0]:0,w[1]=u[1]>y?w[1]:0,B.overflowed[0]&&s(w[0],S[0],n,"y",L,!1),B.overflowed[1]&&s(w[1],S[1],n,"x",L,!1)}}}function l(e,t){var o=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?o[0]:o[3]:e>60?t>3?o[3]:o[2]:e>30?t>8?o[1]:t>6?o[0]:t>4?t:o[2]:t>8?t:o[3]}function s(e,t,o,a,n,i){e&&G(y,e.toString(),{dur:t,scrollEasing:o,dir:a,overwrite:n,drag:i})}var d,u,f,h,m,p,g,v,x,_,w,S,b,C,y=e(this),B=y.data(a),T=B.opt,k=a+"_"+B.idx,M=e("#mCSB_"+B.idx),I=e("#mCSB_"+B.idx+"_container"),D=[e("#mCSB_"+B.idx+"_dragger_vertical"),e("#mCSB_"+B.idx+"_dragger_horizontal")],E=[],W=[],R=0,L="yx"===T.axis?"none":"all",z=[],P=I.find("iframe"),H=["touchstart."+k+" pointerdown."+k+" MSPointerDown."+k,"touchmove."+k+" pointermove."+k+" MSPointerMove."+k,"touchend."+k+" pointerup."+k+" MSPointerUp."+k],U=void 0!==document.body.style.touchAction&&""!==document.body.style.touchAction;I.bind(H[0],function(e){o(e)}).bind(H[1],function(e){n(e)}),M.bind(H[0],function(e){i(e)}).bind(H[2],function(e){r(e)}),P.length&&P.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind(H[0],function(e){o(e),i(e)}).bind(H[1],function(e){n(e)}).bind(H[2],function(e){r(e)})})})},E=function(){function o(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function n(e,t,o){d.type=o&&i?"stepped":"stepless",d.scrollAmount=10,j(r,e,t,"mcsLinearOut",o?60:null)}var i,r=e(this),l=r.data(a),s=l.opt,d=l.sequential,u=a+"_"+l.idx,f=e("#mCSB_"+l.idx+"_container"),h=f.parent();f.bind("mousedown."+u,function(){t||i||(i=1,c=!0)}).add(document).bind("mousemove."+u,function(e){if(!t&&i&&o()){var a=f.offset(),r=O(e)[0]-a.top+f[0].offsetTop,c=O(e)[1]-a.left+f[0].offsetLeft;r>0&&r<h.height()&&c>0&&c<h.width()?d.step&&n("off",null,"stepped"):("x"!==s.axis&&l.overflowed[0]&&(0>r?n("on",38):r>h.height()&&n("on",40)),"y"!==s.axis&&l.overflowed[1]&&(0>c?n("on",37):c>h.width()&&n("on",39)))}}).bind("mouseup."+u+" dragend."+u,function(){t||(i&&(i=0,n("off",null)),c=!1)})},W=function(){function t(t,a){if(Q(o),!z(o,t.target)){var r="auto"!==i.mouseWheel.deltaFactor?parseInt(i.mouseWheel.deltaFactor):s&&t.deltaFactor<100?100:t.deltaFactor||100,d=i.scrollInertia;if("x"===i.axis||"x"===i.mouseWheel.axis)var u="x",f=[Math.round(r*n.scrollRatio.x),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.width()?.9*l.width():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetLeft),p=c[1][0].offsetLeft,g=c[1].parent().width()-c[1].width(),v="y"===i.mouseWheel.axis?t.deltaY||a:t.deltaX;else var u="y",f=[Math.round(r*n.scrollRatio.y),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.height()?.9*l.height():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetTop),p=c[0][0].offsetTop,g=c[0].parent().height()-c[0].height(),v=t.deltaY||a;"y"===u&&!n.overflowed[0]||"x"===u&&!n.overflowed[1]||((i.mouseWheel.invert||t.webkitDirectionInvertedFromDevice)&&(v=-v),i.mouseWheel.normalizeDelta&&(v=0>v?-1:1),(v>0&&0!==p||0>v&&p!==g||i.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),t.deltaFactor<5&&!i.mouseWheel.normalizeDelta&&(h=t.deltaFactor,d=17),G(o,(m-v*h).toString(),{dir:u,dur:d}))}}if(e(this).data(a)){var o=e(this),n=o.data(a),i=n.opt,r=a+"_"+n.idx,l=e("#mCSB_"+n.idx),c=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")],d=e("#mCSB_"+n.idx+"_container").find("iframe");d.length&&d.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+r,function(e,o){t(e,o)})})}),l.bind("mousewheel."+r,function(e,o){t(e,o)})}},R=new Object,A=function(t){var o=!1,a=!1,n=null;if(void 0===t?a="#empty":void 0!==e(t).attr("id")&&(a=e(t).attr("id")),a!==!1&&void 0!==R[a])return R[a];if(t){try{var i=t.contentDocument||t.contentWindow.document;n=i.body.innerHTML}catch(r){}o=null!==n}else{try{var i=top.document;n=i.body.innerHTML}catch(r){}o=null!==n}return a!==!1&&(R[a]=o),o},L=function(e){var t=this.find("iframe");if(t.length){var o=e?"auto":"none";t.css("pointer-events",o)}},z=function(t,o){var n=o.nodeName.toLowerCase(),i=t.data(a).opt.mouseWheel.disableOver,r=["select","textarea"];return e.inArray(n,i)>-1&&!(e.inArray(n,r)>-1&&!e(o).is(":focus"))},P=function(){var t,o=e(this),n=o.data(a),i=a+"_"+n.idx,r=e("#mCSB_"+n.idx+"_container"),l=r.parent(),s=e(".mCSB_"+n.idx+"_scrollbar ."+d[12]);s.bind("mousedown."+i+" touchstart."+i+" pointerdown."+i+" MSPointerDown."+i,function(o){c=!0,e(o.target).hasClass("mCSB_dragger")||(t=1)}).bind("touchend."+i+" pointerup."+i+" MSPointerUp."+i,function(){c=!1}).bind("click."+i,function(a){if(t&&(t=0,e(a.target).hasClass(d[12])||e(a.target).hasClass("mCSB_draggerRail"))){Q(o);var i=e(this),s=i.find(".mCSB_dragger");if(i.parent(".mCSB_scrollTools_horizontal").length>0){if(!n.overflowed[1])return;var c="x",u=a.pageX>s.offset().left?-1:1,f=Math.abs(r[0].offsetLeft)-u*(.9*l.width())}else{if(!n.overflowed[0])return;var c="y",u=a.pageY>s.offset().top?-1:1,f=Math.abs(r[0].offsetTop)-u*(.9*l.height())}G(o,f.toString(),{dir:c,scrollEasing:"mcsEaseInOut"})}})},H=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=e("#mCSB_"+o.idx+"_container"),l=r.parent();r.bind("focusin."+i,function(){var o=e(document.activeElement),a=r.find(".mCustomScrollBox").length,i=0;o.is(n.advanced.autoScrollOnFocus)&&(Q(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=a?(i+17)*a:0,t[0]._focusTimeout=setTimeout(function(){var e=[ae(o)[0],ae(o)[1]],a=[r[0].offsetTop,r[0].offsetLeft],s=[a[0]+e[0]>=0&&a[0]+e[0]<l.height()-o.outerHeight(!1),a[1]+e[1]>=0&&a[0]+e[1]<l.width()-o.outerWidth(!1)],c="yx"!==n.axis||s[0]||s[1]?"all":"none";"x"===n.axis||s[0]||G(t,e[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:c,dur:i}),"y"===n.axis||s[1]||G(t,e[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:c,dur:i})},t[0]._focusTimer))})},U=function(){var t=e(this),o=t.data(a),n=a+"_"+o.idx,i=e("#mCSB_"+o.idx+"_container").parent();i.bind("scroll."+n,function(){0===i.scrollTop()&&0===i.scrollLeft()||e(".mCSB_"+o.idx+"_scrollbar").css("visibility","hidden")})},F=function(){var t=e(this),o=t.data(a),n=o.opt,i=o.sequential,r=a+"_"+o.idx,l=".mCSB_"+o.idx+"_scrollbar",s=e(l+">a");s.bind("contextmenu."+r,function(e){e.preventDefault()}).bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r+" mouseup."+r+" touchend."+r+" pointerup."+r+" MSPointerUp."+r+" mouseout."+r+" pointerout."+r+" MSPointerOut."+r+" click."+r,function(a){function r(e,o){i.scrollAmount=n.scrollButtons.scrollAmount,j(t,e,o)}if(a.preventDefault(),ee(a)){var l=e(this).attr("class");switch(i.type=n.scrollButtons.scrollType,a.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===i.type)return;c=!0,o.tweenRunning=!1,r("on",l);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===i.type)return;c=!1,i.dir&&r("off",l);break;case"click":if("stepped"!==i.type||o.tweenRunning)return;r("on",l)}}})},q=function(){function t(t){function a(e,t){r.type=i.keyboard.scrollType,r.scrollAmount=i.keyboard.scrollAmount,"stepped"===r.type&&n.tweenRunning||j(o,e,t)}switch(t.type){case"blur":n.tweenRunning&&r.dir&&a("off",null);break;case"keydown":case"keyup":var l=t.keyCode?t.keyCode:t.which,s="on";if("x"!==i.axis&&(38===l||40===l)||"y"!==i.axis&&(37===l||39===l)){if((38===l||40===l)&&!n.overflowed[0]||(37===l||39===l)&&!n.overflowed[1])return;"keyup"===t.type&&(s="off"),e(document.activeElement).is(u)||(t.preventDefault(),t.stopImmediatePropagation(),a(s,l))}else if(33===l||34===l){if((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){Q(o);var f=34===l?-1:1;if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=Math.abs(c[0].offsetLeft)-f*(.9*d.width());else var h="y",m=Math.abs(c[0].offsetTop)-f*(.9*d.height());G(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}else if((35===l||36===l)&&!e(document.activeElement).is(u)&&((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=35===l?Math.abs(d.width()-c.outerWidth(!1)):0;else var h="y",m=35===l?Math.abs(d.height()-c.outerHeight(!1)):0;G(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}}var o=e(this),n=o.data(a),i=n.opt,r=n.sequential,l=a+"_"+n.idx,s=e("#mCSB_"+n.idx),c=e("#mCSB_"+n.idx+"_container"),d=c.parent(),u="input,textarea,select,datalist,keygen,[contenteditable='true']",f=c.find("iframe"),h=["blur."+l+" keydown."+l+" keyup."+l];f.length&&f.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind(h[0],function(e){t(e)})})}),s.attr("tabindex","0").bind(h[0],function(e){t(e)})},j=function(t,o,n,i,r){function l(e){u.snapAmount&&(f.scrollAmount=u.snapAmount instanceof Array?"x"===f.dir[0]?u.snapAmount[1]:u.snapAmount[0]:u.snapAmount);var o="stepped"!==f.type,a=r?r:e?o?p/1.5:g:1e3/60,n=e?o?7.5:40:2.5,s=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)],d=[c.scrollRatio.y>10?10:c.scrollRatio.y,c.scrollRatio.x>10?10:c.scrollRatio.x],m="x"===f.dir[0]?s[1]+f.dir[1]*(d[1]*n):s[0]+f.dir[1]*(d[0]*n),v="x"===f.dir[0]?s[1]+f.dir[1]*parseInt(f.scrollAmount):s[0]+f.dir[1]*parseInt(f.scrollAmount),x="auto"!==f.scrollAmount?v:m,_=i?i:e?o?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",w=!!e;return e&&17>a&&(x="x"===f.dir[0]?s[1]:s[0]),G(t,x.toString(),{dir:f.dir[0],scrollEasing:_,dur:a,onComplete:w}),e?void(f.dir=!1):(clearTimeout(f.step),void(f.step=setTimeout(function(){l()},a)))}function s(){clearTimeout(f.step),$(f,"step"),Q(t)}var c=t.data(a),u=c.opt,f=c.sequential,h=e("#mCSB_"+c.idx+"_container"),m="stepped"===f.type,p=u.scrollInertia<26?26:u.scrollInertia,g=u.scrollInertia<1?17:u.scrollInertia;switch(o){case"on":if(f.dir=[n===d[16]||n===d[15]||39===n||37===n?"x":"y",n===d[13]||n===d[15]||38===n||37===n?-1:1],Q(t),oe(n)&&"stepped"===f.type)return;l(m);break;case"off":s(),(m||c.tweenRunning&&f.dir)&&l(!0)}},Y=function(t){var o=e(this).data(a).opt,n=[];return"function"==typeof t&&(t=t()),t instanceof Array?n=t.length>1?[t[0],t[1]]:"x"===o.axis?[null,t[0]]:[t[0],null]:(n[0]=t.y?t.y:t.x||"x"===o.axis?null:t,n[1]=t.x?t.x:t.y||"y"===o.axis?null:t),"function"==typeof n[0]&&(n[0]=n[0]()),"function"==typeof n[1]&&(n[1]=n[1]()),n},X=function(t,o){if(null!=t&&"undefined"!=typeof t){var n=e(this),i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx+"_container"),s=l.parent(),c=typeof t;o||(o="x"===r.axis?"x":"y");var d="x"===o?l.outerWidth(!1)-s.width():l.outerHeight(!1)-s.height(),f="x"===o?l[0].offsetLeft:l[0].offsetTop,h="x"===o?"left":"top";switch(c){case"function":return t();case"object":var m=t.jquery?t:e(t);if(!m.length)return;return"x"===o?ae(m)[1]:ae(m)[0];case"string":case"number":if(oe(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(d*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(f-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var p=f+parseInt(t.split("+=")[1]);return p>=0?0:Math.abs(p)}if(-1!==t.indexOf("px")&&oe(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(s.height()-l.outerHeight(!1));if("right"===t)return Math.abs(s.width()-l.outerWidth(!1));if("first"===t||"last"===t){var m=l.find(":"+t);return"x"===o?ae(m)[1]:ae(m)[0]}return e(t).length?"x"===o?ae(e(t))[1]:ae(e(t))[0]:(l.css(h,t),void u.update.call(null,n[0]))}}},N=function(t){function o(){return clearTimeout(f[0].autoUpdate),0===l.parents("html").length?void(l=null):void(f[0].autoUpdate=setTimeout(function(){return c.advanced.updateOnSelectorChange&&(s.poll.change.n=i(),s.poll.change.n!==s.poll.change.o)?(s.poll.change.o=s.poll.change.n,void r(3)):c.advanced.updateOnContentResize&&(s.poll.size.n=l[0].scrollHeight+l[0].scrollWidth+f[0].offsetHeight+l[0].offsetHeight+l[0].offsetWidth,s.poll.size.n!==s.poll.size.o)?(s.poll.size.o=s.poll.size.n,void r(1)):!c.advanced.updateOnImageLoad||"auto"===c.advanced.updateOnImageLoad&&"y"===c.axis||(s.poll.img.n=f.find("img").length,s.poll.img.n===s.poll.img.o)?void((c.advanced.updateOnSelectorChange||c.advanced.updateOnContentResize||c.advanced.updateOnImageLoad)&&o()):(s.poll.img.o=s.poll.img.n,void f.find("img").each(function(){n(this)}))},c.advanced.autoUpdateTimeout))}function n(t){function o(e,t){return function(){
23932return t.apply(e,arguments)}}function a(){this.onload=null,e(t).addClass(d[2]),r(2)}if(e(t).hasClass(d[2]))return void r();var n=new Image;n.onload=o(n,a),n.src=t.src}function i(){c.advanced.updateOnSelectorChange===!0&&(c.advanced.updateOnSelectorChange="*");var e=0,t=f.find(c.advanced.updateOnSelectorChange);return c.advanced.updateOnSelectorChange&&t.length>0&&t.each(function(){e+=this.offsetHeight+this.offsetWidth}),e}function r(e){clearTimeout(f[0].autoUpdate),u.update.call(null,l[0],e)}var l=e(this),s=l.data(a),c=s.opt,f=e("#mCSB_"+s.idx+"_container");return t?(clearTimeout(f[0].autoUpdate),void $(f[0],"autoUpdate")):void o()},V=function(e,t,o){return Math.round(e/t)*t-o},Q=function(t){var o=t.data(a),n=e("#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal");n.each(function(){Z.call(this)})},G=function(t,o,n){function i(e){return s&&c.callbacks[e]&&"function"==typeof c.callbacks[e]}function r(){return[c.callbacks.alwaysTriggerOffsets||w>=S[0]+y,c.callbacks.alwaysTriggerOffsets||-B>=w]}function l(){var e=[h[0].offsetTop,h[0].offsetLeft],o=[x[0].offsetTop,x[0].offsetLeft],a=[h.outerHeight(!1),h.outerWidth(!1)],i=[f.height(),f.width()];t[0].mcs={content:h,top:e[0],left:e[1],draggerTop:o[0],draggerLeft:o[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(a[0])-i[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(a[1])-i[1])),direction:n.dir}}var s=t.data(a),c=s.opt,d={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},n=e.extend(d,n),u=[n.dur,n.drag?0:n.dur],f=e("#mCSB_"+s.idx),h=e("#mCSB_"+s.idx+"_container"),m=h.parent(),p=c.callbacks.onTotalScrollOffset?Y.call(t,c.callbacks.onTotalScrollOffset):[0,0],g=c.callbacks.onTotalScrollBackOffset?Y.call(t,c.callbacks.onTotalScrollBackOffset):[0,0];if(s.trigger=n.trigger,0===m.scrollTop()&&0===m.scrollLeft()||(e(".mCSB_"+s.idx+"_scrollbar").css("visibility","visible"),m.scrollTop(0).scrollLeft(0)),"_resetY"!==o||s.contentReset.y||(i("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(t[0]),s.contentReset.y=1),"_resetX"!==o||s.contentReset.x||(i("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(t[0]),s.contentReset.x=1),"_resetY"!==o&&"_resetX"!==o){if(!s.contentReset.y&&t[0].mcs||!s.overflowed[0]||(i("onOverflowY")&&c.callbacks.onOverflowY.call(t[0]),s.contentReset.x=null),!s.contentReset.x&&t[0].mcs||!s.overflowed[1]||(i("onOverflowX")&&c.callbacks.onOverflowX.call(t[0]),s.contentReset.x=null),c.snapAmount){var v=c.snapAmount instanceof Array?"x"===n.dir?c.snapAmount[1]:c.snapAmount[0]:c.snapAmount;o=V(o,v,c.snapOffset)}switch(n.dir){case"x":var x=e("#mCSB_"+s.idx+"_dragger_horizontal"),_="left",w=h[0].offsetLeft,S=[f.width()-h.outerWidth(!1),x.parent().width()-x.width()],b=[o,0===o?0:o/s.scrollRatio.x],y=p[1],B=g[1],T=y>0?y/s.scrollRatio.x:0,k=B>0?B/s.scrollRatio.x:0;break;case"y":var x=e("#mCSB_"+s.idx+"_dragger_vertical"),_="top",w=h[0].offsetTop,S=[f.height()-h.outerHeight(!1),x.parent().height()-x.height()],b=[o,0===o?0:o/s.scrollRatio.y],y=p[0],B=g[0],T=y>0?y/s.scrollRatio.y:0,k=B>0?B/s.scrollRatio.y:0}b[1]<0||0===b[0]&&0===b[1]?b=[0,0]:b[1]>=S[1]?b=[S[0],S[1]]:b[0]=-b[0],t[0].mcs||(l(),i("onInit")&&c.callbacks.onInit.call(t[0])),clearTimeout(h[0].onCompleteTimeout),J(x[0],_,Math.round(b[1]),u[1],n.scrollEasing),!s.tweenRunning&&(0===w&&b[0]>=0||w===S[0]&&b[0]<=S[0])||J(h[0],_,Math.round(b[0]),u[0],n.scrollEasing,n.overwrite,{onStart:function(){n.callbacks&&n.onStart&&!s.tweenRunning&&(i("onScrollStart")&&(l(),c.callbacks.onScrollStart.call(t[0])),s.tweenRunning=!0,C(x),s.cbOffsets=r())},onUpdate:function(){n.callbacks&&n.onUpdate&&i("whileScrolling")&&(l(),c.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(n.callbacks&&n.onComplete){"yx"===c.axis&&clearTimeout(h[0].onCompleteTimeout);var e=h[0].idleTimer||0;h[0].onCompleteTimeout=setTimeout(function(){i("onScroll")&&(l(),c.callbacks.onScroll.call(t[0])),i("onTotalScroll")&&b[1]>=S[1]-T&&s.cbOffsets[0]&&(l(),c.callbacks.onTotalScroll.call(t[0])),i("onTotalScrollBack")&&b[1]<=k&&s.cbOffsets[1]&&(l(),c.callbacks.onTotalScrollBack.call(t[0])),s.tweenRunning=!1,h[0].idleTimer=0,C(x,"hide")},e)}}})}},J=function(e,t,o,a,n,i,r){function l(){S.stop||(x||m.call(),x=K()-v,s(),x>=S.time&&(S.time=x>S.time?x+f-(x-S.time):x+f-1,S.time<x+1&&(S.time=x+1)),S.time<a?S.id=h(l):g.call())}function s(){a>0?(S.currVal=u(S.time,_,b,a,n),w[t]=Math.round(S.currVal)+"px"):w[t]=o+"px",p.call()}function c(){f=1e3/60,S.time=x+f,h=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return s(),setTimeout(e,.01)},S.id=h(l)}function d(){null!=S.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(S.id):clearTimeout(S.id),S.id=null)}function u(e,t,o,a,n){switch(n){case"linear":case"mcsLinear":return o*e/a+t;case"mcsLinearOut":return e/=a,e--,o*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=a/2,1>e?o/2*e*e+t:(e--,-o/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=a/2,1>e?o/2*Math.pow(2,10*(e-1))+t:(e--,o/2*(-Math.pow(2,-10*e)+2)+t);case"easeInOut":case"mcsEaseInOut":return e/=a/2,1>e?o/2*e*e*e+t:(e-=2,o/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=a,e--,-o*(e*e*e*e-1)+t;case"easeOutStrong":return o*(-Math.pow(2,-10*e/a)+1)+t;case"easeOut":case"mcsEaseOut":default:var i=(e/=a)*e,r=i*e;return t+o*(.499999999999997*r*i+-2.5*i*i+5.5*r+-6.5*i+4*e)}}e._mTween||(e._mTween={top:{},left:{}});var f,h,r=r||{},m=r.onStart||function(){},p=r.onUpdate||function(){},g=r.onComplete||function(){},v=K(),x=0,_=e.offsetTop,w=e.style,S=e._mTween[t];"left"===t&&(_=e.offsetLeft);var b=o-_;S.stop=0,"none"!==i&&d(),c()},K=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},Z=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],o=0;o<t.length;o++){var a=t[o];e._mTween[a].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(e._mTween[a].id):clearTimeout(e._mTween[a].id),e._mTween[a].id=null,e._mTween[a].stop=1)}},$=function(e,t){try{delete e[t]}catch(o){e[t]=null}},ee=function(e){return!(e.which&&1!==e.which)},te=function(e){var t=e.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},oe=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},ae=function(e){var t=e.parents(".mCSB_container");return[e.offset().top-t.offset().top,e.offset().left-t.offset().left]},ne=function(){function e(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++)if(e[t]+"Hidden"in document)return e[t]+"Hidden";return null}var t=e();return t?document[t]:!1};e.fn[o]=function(t){return u[t]?u[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):u.init.apply(this,arguments)},e[o]=function(t){return u[t]?u[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):u.init.apply(this,arguments)},e[o].defaults=i,window[o]=!0,e(window).bind("load",function(){e(n)[o](),e.extend(e.expr[":"],{mcsInView:e.expr[":"].mcsInView||function(t){var o,a,n=e(t),i=n.parents(".mCSB_container");if(i.length)return o=i.parent(),a=[i[0].offsetTop,i[0].offsetLeft],a[0]+ae(n)[0]>=0&&a[0]+ae(n)[0]<o.height()-n.outerHeight(!1)&&a[1]+ae(n)[1]>=0&&a[1]+ae(n)[1]<o.width()-n.outerWidth(!1)},mcsInSight:e.expr[":"].mcsInSight||function(t,o,a){var n,i,r,l,s=e(t),c=s.parents(".mCSB_container"),d="exact"===a[3]?[[1,0],[1,0]]:[[.9,.1],[.6,.4]];if(c.length)return n=[s.outerHeight(!1),s.outerWidth(!1)],r=[c[0].offsetTop+ae(s)[0],c[0].offsetLeft+ae(s)[1]],i=[c.parent()[0].offsetHeight,c.parent()[0].offsetWidth],l=[n[0]<i[0]?d[0]:d[1],n[1]<i[1]?d[0]:d[1]],r[0]-i[0]*l[0][0]<0&&r[0]+n[0]-i[0]*l[0][1]>=0&&r[1]-i[1]*l[1][0]<0&&r[1]+n[1]-i[1]*l[1][1]>=0},mcsOverflow:e.expr[":"].mcsOverflow||function(t){var o=e(t).data(a);if(o)return o.overflowed[0]||o.overflowed[1]}})})})});
vendor: 61,963 bytes, lines 23932-25205
23932
23933
23934/*  mediaelement-and-player  */
23935/*!
23936 * MediaElement.js
23937 * http://www.mediaelementjs.com/
23938 *
23939 * Wrapper that mimics native HTML5 MediaElement (audio and video)
23940 * using a variety of technologies (pure JavaScript, Flash, iframe)
23941 *
23942 * Copyright 2010-2017, John Dyer (http://j.hn/)
23943 * License: MIT
23944 *
23945 */(function () { function e(t, n, r) { function s(o, u) { if (!n[o]) { if (!t[o]) { var a = typeof require == "function" && require; if (!u && a) return a(o, !0); if (i) return i(o, !0); var f = new Error("Cannot find module '" + o + "'"); throw f.code = "MODULE_NOT_FOUND", f } var l = n[o] = { exports: {} }; t[o][0].call(l.exports, function (e) { var n = t[o][1][e]; return s(n ? n : e) }, l, l.exports, e, t, n, r) } return n[o].exports } var i = typeof require == "function" && require; for (var o = 0; o < r.length; o++)s(r[o]); return s } return e })()({
23946     1: [function (_dereq_, module, exports) {
23947
23948     }, {}], 2: [function (_dereq_, module, exports) {
23949         (function (global) {
23950             var topLevel = typeof global !== 'undefined' ? global :
23951                 typeof window !== 'undefined' ? window : {}
23952             var minDoc = _dereq_(1);
23953
23954             var doccy;
23955
23956             if (typeof document !== 'undefined') {
23957                 doccy = document;
23958             } else {
23959                 doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];
23960
23961                 if (!doccy) {
23962                     doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;
23963                 }
23964             }
23965
23966             module.exports = doccy;
23967
23968         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
23969     }, { "1": 1 }], 3: [function (_dereq_, module, exports) {
23970         (function (global) {
23971             var win;
23972
23973             if (typeof window !== "undefined") {
23974                 win = window;
23975             } else if (typeof global !== "undefined") {
23976                 win = global;
23977             } else if (typeof self !== "undefined") {
23978                 win = self;
23979             } else {
23980                 win = {};
23981             }
23982
23983             module.exports = win;
23984
23985         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
23986     }, {}], 4: [function (_dereq_, module, exports) {
23987         (function (root) {
23988
23989             // Store setTimeout reference so promise-polyfill will be unaffected by
23990             // other code modifying setTimeout (like sinon.useFakeTimers())
23991             var setTimeoutFunc = setTimeout;
23992
23993             function noop() { }
23994
23995             // Polyfill for Function.prototype.bind
23996             function bind(fn, thisArg) {
23997                 return function () {
23998                     fn.apply(thisArg, arguments);
23999                 };
24000             }
24001
24002             function Promise(fn) {
24003                 if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new');
24004                 if (typeof fn !== 'function') throw new TypeError('not a function');
24005                 this._state = 0;
24006                 this._handled = false;
24007                 this._value = undefined;
24008                 this._deferreds = [];
24009
24010                 doResolve(fn, this);
24011             }
24012
24013             function handle(self, deferred) {
24014                 while (self._state === 3) {
24015                     self = self._value;
24016                 }
24017                 if (self._state === 0) {
24018                     self._deferreds.push(deferred);
24019                     return;
24020                 }
24021                 self._handled = true;
24022                 Promise._immediateFn(function () {
24023                     var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
24024                     if (cb === null) {
24025                         (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
24026                         return;
24027                     }
24028                     var ret;
24029                     try {
24030                         ret = cb(self._value);
24031                     } catch (e) {
24032                         reject(deferred.promise, e);
24033                         return;
24034                     }
24035                     resolve(deferred.promise, ret);
24036                 });
24037             }
24038
24039             function resolve(self, newValue) {
24040                 try {
24041                     // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
24042                     if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
24043                     if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
24044                         var then = newValue.then;
24045                         if (newValue instanceof Promise) {
24046                             self._state = 3;
24047                             self._value = newValue;
24048                             finale(self);
24049                             return;
24050                         } else if (typeof then === 'function') {
24051                             doResolve(bind(then, newValue), self);
24052                             return;
24053                         }
24054                     }
24055                     self._state = 1;
24056                     self._value = newValue;
24057                     finale(self);
24058                 } catch (e) {
24059                     reject(self, e);
24060                 }
24061             }
24062
24063             function reject(self, newValue) {
24064                 self._state = 2;
24065                 self._value = newValue;
24066                 finale(self);
24067             }
24068
24069             function finale(self) {
24070                 if (self._state === 2 && self._deferreds.length === 0) {
24071                     Promise._immediateFn(function () {
24072                         if (!self._handled) {
24073                             Promise._unhandledRejectionFn(self._value);
24074                         }
24075                     });
24076                 }
24077
24078                 for (var i = 0, len = self._deferreds.length; i < len; i++) {
24079                     handle(self, self._deferreds[i]);
24080                 }
24081                 self._deferreds = null;
24082             }
24083
24084             function Handler(onFulfilled, onRejected, promise) {
24085                 this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
24086                 this.onRejected = typeof onRejected === 'function' ? onRejected : null;
24087                 this.promise = promise;
24088             }
24089
24090             /**
24091              * Take a potentially misbehaving resolver function and make sure
24092              * onFulfilled and onRejected are only called once.
24093              *
24094              * Makes no guarantees about asynchrony.
24095              */
24096             function doResolve(fn, self) {
24097                 var done = false;
24098                 try {
24099                     fn(function (value) {
24100                         if (done) return;
24101                         done = true;
24102                         resolve(self, value);
24103                     }, function (reason) {
24104                         if (done) return;
24105                         done = true;
24106                         reject(self, reason);
24107                     });
24108                 } catch (ex) {
24109                     if (done) return;
24110                     done = true;
24111                     reject(self, ex);
24112                 }
24113             }
24114
24115             Promise.prototype['catch'] = function (onRejected) {
24116                 return this.then(null, onRejected);
24117             };
24118
24119             Promise.prototype.then = function (onFulfilled, onRejected) {
24120                 var prom = new (this.constructor)(noop);
24121
24122                 handle(this, new Handler(onFulfilled, onRejected, prom));
24123                 return prom;
24124             };
24125
24126             Promise.all = function (arr) {
24127                 var args = Array.prototype.slice.call(arr);
24128
24129                 return new Promise(function (resolve, reject) {
24130                     if (args.length === 0) return resolve([]);
24131                     var remaining = args.length;
24132
24133                     function res(i, val) {
24134                         try {
24135                             if (val && (typeof val === 'object' || typeof val === 'function')) {
24136                                 var then = val.then;
24137                                 if (typeof then === 'function') {
24138                                     then.call(val, function (val) {
24139                                         res(i, val);
24140                                     }, reject);
24141                                     return;
24142                                 }
24143                             }
24144                             args[i] = val;
24145                             if (--remaining === 0) {
24146                                 resolve(args);
24147                             }
24148                         } catch (ex) {
24149                             reject(ex);
24150                         }
24151                     }
24152
24153                     for (var i = 0; i < args.length; i++) {
24154                         res(i, args[i]);
24155                     }
24156                 });
24157             };
24158
24159             Promise.resolve = function (value) {
24160                 if (value && typeof value === 'object' && value.constructor === Promise) {
24161                     return value;
24162                 }
24163
24164                 return new Promise(function (resolve) {
24165                     resolve(value);
24166                 });
24167             };
24168
24169             Promise.reject = function (value) {
24170                 return new Promise(function (resolve, reject) {
24171                     reject(value);
24172                 });
24173             };
24174
24175             Promise.race = function (values) {
24176                 return new Promise(function (resolve, reject) {
24177                     for (var i = 0, len = values.length; i < len; i++) {
24178                         values[i].then(resolve, reject);
24179                     }
24180                 });
24181             };
24182
24183             // Use polyfill for setImmediate for performance gains
24184             Promise._immediateFn = (typeof setImmediate === 'function' && function (fn) { setImmediate(fn); }) ||
24185                 function (fn) {
24186                     setTimeoutFunc(fn, 0);
24187                 };
24188
24189             Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
24190                 if (typeof console !== 'undefined' && console) {
24191                     console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
24192                 }
24193             };
24194
24195             /**
24196              * Set the immediate function to execute callbacks
24197              * @param fn {function} Function to execute
24198              * @deprecated
24199              */
24200             Promise._setImmediateFn = function _setImmediateFn(fn) {
24201                 Promise._immediateFn = fn;
24202             };
24203
24204             /**
24205              * Change the function to execute on unhandled rejection
24206              * @param {function} fn Function to execute on unhandled rejection
24207              * @deprecated
24208              */
24209             Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
24210                 Promise._unhandledRejectionFn = fn;
24211             };
24212
24213             if (typeof module !== 'undefined' && module.exports) {
24214                 module.exports = Promise;
24215             } else if (!root.Promise) {
24216                 root.Promise = Promise;
24217             }
24218
24219         })(this);
24220
24221     }, {}], 5: [function (_dereq_, module, exports) {
24222         'use strict';
24223
24224         Object.defineProperty(exports, "__esModule", {
24225             value: true
24226         });
24227
24228         var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
24229
24230         var _mejs = _dereq_(7);
24231
24232         var _mejs2 = _interopRequireDefault(_mejs);
24233
24234         var _en = _dereq_(15);
24235
24236         var _general = _dereq_(27);
24237
24238         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24239
24240         var i18n = { lang: 'en', en: _en.EN };
24241
24242         i18n.language = function () {
24243             for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
24244                 args[_key] = arguments[_key];
24245             }
24246
24247             if (args !== null && args !== undefined && args.length) {
24248
24249                 if (typeof args[0] !== 'string') {
24250                     throw new TypeError('Language code must be a string value');
24251                 }
24252
24253                 if (!/^[a-z]{2,3}((\-|_)[a-z]{2})?$/i.test(args[0])) {
24254                     throw new TypeError('Language code must have format 2-3 letters and. optionally, hyphen, underscore followed by 2 more letters');
24255                 }
24256
24257                 i18n.lang = args[0];
24258
24259                 if (i18n[args[0]] === undefined) {
24260                     args[1] = args[1] !== null && args[1] !== undefined && _typeof(args[1]) === 'object' ? args[1] : {};
24261                     i18n[args[0]] = !(0, _general.isObjectEmpty)(args[1]) ? args[1] : _en.EN;
24262                 } else if (args[1] !== null && args[1] !== undefined && _typeof(args[1]) === 'object') {
24263                     i18n[args[0]] = args[1];
24264                 }
24265             }
24266
24267             return i18n.lang;
24268         };
24269
24270         i18n.t = function (message) {
24271             var pluralParam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
24272
24273
24274             if (typeof message === 'string' && message.length) {
24275
24276                 var str = void 0,
24277                     pluralForm = void 0;
24278
24279                 var language = i18n.language();
24280
24281                 var _plural = function _plural(input, number, form) {
24282
24283                     if ((typeof input === 'undefined' ? 'undefined' : _typeof(input)) !== 'object' || typeof number !== 'number' || typeof form !== 'number') {
24284                         return input;
24285                     }
24286
24287                     var _pluralForms = function () {
24288                         return [function () {
24289                             return arguments.length <= 1 ? undefined : arguments[1];
24290                         }, function () {
24291                             return (arguments.length <= 0 ? undefined : arguments[0]) === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2];
24292                         }, function () {
24293                             return (arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2];
24294                         }, function () {
24295                             if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) {
24296                                 return arguments.length <= 1 ? undefined : arguments[1];
24297                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) !== 0) {
24298                                 return arguments.length <= 2 ? undefined : arguments[2];
24299                             } else {
24300                                 return arguments.length <= 3 ? undefined : arguments[3];
24301                             }
24302                         }, function () {
24303                             if ((arguments.length <= 0 ? undefined : arguments[0]) === 1 || (arguments.length <= 0 ? undefined : arguments[0]) === 11) {
24304                                 return arguments.length <= 1 ? undefined : arguments[1];
24305                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2 || (arguments.length <= 0 ? undefined : arguments[0]) === 12) {
24306                                 return arguments.length <= 2 ? undefined : arguments[2];
24307                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) > 2 && (arguments.length <= 0 ? undefined : arguments[0]) < 20) {
24308                                 return arguments.length <= 3 ? undefined : arguments[3];
24309                             } else {
24310                                 return arguments.length <= 4 ? undefined : arguments[4];
24311                             }
24312                         }, function () {
24313                             if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
24314                                 return arguments.length <= 1 ? undefined : arguments[1];
24315                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 > 0 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 20) {
24316                                 return arguments.length <= 2 ? undefined : arguments[2];
24317                             } else {
24318                                 return arguments.length <= 3 ? undefined : arguments[3];
24319                             }
24320                         }, function () {
24321                             if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) {
24322                                 return arguments.length <= 1 ? undefined : arguments[1];
24323                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) {
24324                                 return arguments.length <= 2 ? undefined : arguments[2];
24325                             } else {
24326                                 return [3];
24327                             }
24328                         }, function () {
24329                             if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) {
24330                                 return arguments.length <= 1 ? undefined : arguments[1];
24331                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) {
24332                                 return arguments.length <= 2 ? undefined : arguments[2];
24333                             } else {
24334                                 return arguments.length <= 3 ? undefined : arguments[3];
24335                             }
24336                         }, function () {
24337                             if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
24338                                 return arguments.length <= 1 ? undefined : arguments[1];
24339                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) <= 4) {
24340                                 return arguments.length <= 2 ? undefined : arguments[2];
24341                             } else {
24342                                 return arguments.length <= 3 ? undefined : arguments[3];
24343                             }
24344                         }, function () {
24345                             if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
24346                                 return arguments.length <= 1 ? undefined : arguments[1];
24347                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) {
24348                                 return arguments.length <= 2 ? undefined : arguments[2];
24349                             } else {
24350                                 return arguments.length <= 3 ? undefined : arguments[3];
24351                             }
24352                         }, function () {
24353                             if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 1) {
24354                                 return arguments.length <= 2 ? undefined : arguments[2];
24355                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 2) {
24356                                 return arguments.length <= 3 ? undefined : arguments[3];
24357                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 3 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 === 4) {
24358                                 return arguments.length <= 4 ? undefined : arguments[4];
24359                             } else {
24360                                 return arguments.length <= 1 ? undefined : arguments[1];
24361                             }
24362                         }, function () {
24363                             if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
24364                                 return arguments.length <= 1 ? undefined : arguments[1];
24365                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) {
24366                                 return arguments.length <= 2 ? undefined : arguments[2];
24367                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) > 2 && (arguments.length <= 0 ? undefined : arguments[0]) < 7) {
24368                                 return arguments.length <= 3 ? undefined : arguments[3];
24369                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) > 6 && (arguments.length <= 0 ? undefined : arguments[0]) < 11) {
24370                                 return arguments.length <= 4 ? undefined : arguments[4];
24371                             } else {
24372                                 return arguments.length <= 5 ? undefined : arguments[5];
24373                             }
24374                         }, function () {
24375                             if ((arguments.length <= 0 ? undefined : arguments[0]) === 0) {
24376                                 return arguments.length <= 1 ? undefined : arguments[1];
24377                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
24378                                 return arguments.length <= 2 ? undefined : arguments[2];
24379                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) {
24380                                 return arguments.length <= 3 ? undefined : arguments[3];
24381                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 3 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 <= 10) {
24382                                 return arguments.length <= 4 ? undefined : arguments[4];
24383                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 11) {
24384                                 return arguments.length <= 5 ? undefined : arguments[5];
24385                             } else {
24386                                 return arguments.length <= 6 ? undefined : arguments[6];
24387                             }
24388                         }, function () {
24389                             if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
24390                                 return arguments.length <= 1 ? undefined : arguments[1];
24391                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 > 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 11) {
24392                                 return arguments.length <= 2 ? undefined : arguments[2];
24393                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 > 10 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 20) {
24394                                 return arguments.length <= 3 ? undefined : arguments[3];
24395                             } else {
24396                                 return arguments.length <= 4 ? undefined : arguments[4];
24397                             }
24398                         }, function () {
24399                             if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1) {
24400                                 return arguments.length <= 1 ? undefined : arguments[1];
24401                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 2) {
24402                                 return arguments.length <= 2 ? undefined : arguments[2];
24403                             } else {
24404                                 return arguments.length <= 3 ? undefined : arguments[3];
24405                             }
24406                         }, function () {
24407                             return (arguments.length <= 0 ? undefined : arguments[0]) !== 11 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2];
24408                         }, function () {
24409                             if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
24410                                 return arguments.length <= 1 ? undefined : arguments[1];
24411                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) {
24412                                 return arguments.length <= 2 ? undefined : arguments[2];
24413                             } else {
24414                                 return arguments.length <= 3 ? undefined : arguments[3];
24415                             }
24416                         }, function () {
24417                             if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
24418                                 return arguments.length <= 1 ? undefined : arguments[1];
24419                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) {
24420                                 return arguments.length <= 2 ? undefined : arguments[2];
24421                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) !== 8 && (arguments.length <= 0 ? undefined : arguments[0]) !== 11) {
24422                                 return arguments.length <= 3 ? undefined : arguments[3];
24423                             } else {
24424                                 return arguments.length <= 4 ? undefined : arguments[4];
24425                             }
24426                         }, function () {
24427                             return (arguments.length <= 0 ? undefined : arguments[0]) === 0 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2];
24428                         }, function () {
24429                             if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
24430                                 return arguments.length <= 1 ? undefined : arguments[1];
24431                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) {
24432                                 return arguments.length <= 2 ? undefined : arguments[2];
24433                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 3) {
24434                                 return arguments.length <= 3 ? undefined : arguments[3];
24435                             } else {
24436                                 return arguments.length <= 4 ? undefined : arguments[4];
24437                             }
24438                         }, function () {
24439                             if ((arguments.length <= 0 ? undefined : arguments[0]) === 0) {
24440                                 return arguments.length <= 1 ? undefined : arguments[1];
24441                             } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
24442                                 return arguments.length <= 2 ? undefined : arguments[2];
24443                             } else {
24444                                 return arguments.length <= 3 ? undefined : arguments[3];
24445                             }
24446                         }];
24447                     }();
24448
24449                     return _pluralForms[form].apply(null, [number].concat(input));
24450                 };
24451
24452                 if (i18n[language] !== undefined) {
24453                     str = i18n[language][message];
24454                     if (pluralParam !== null && typeof pluralParam === 'number') {
24455                         pluralForm = i18n[language]['mejs.plural-form'];
24456                         str = _plural.apply(null, [str, pluralParam, pluralForm]);
24457                     }
24458                 }
24459
24460                 if (!str && i18n.en) {
24461                     str = i18n.en[message];
24462                     if (pluralParam !== null && typeof pluralParam === 'number') {
24463                         pluralForm = i18n.en['mejs.plural-form'];
24464                         str = _plural.apply(null, [str, pluralParam, pluralForm]);
24465                     }
24466                 }
24467
24468                 str = str || message;
24469
24470                 if (pluralParam !== null && typeof pluralParam === 'number') {
24471                     str = str.replace('%1', pluralParam);
24472                 }
24473
24474                 return (0, _general.escapeHTML)(str);
24475             }
24476
24477             return message;
24478         };
24479
24480         _mejs2.default.i18n = i18n;
24481
24482         if (typeof mejsL10n !== 'undefined') {
24483             _mejs2.default.i18n.language(mejsL10n.language, mejsL10n.strings);
24484         }
24485
24486         exports.default = i18n;
24487
24488     }, { "15": 15, "27": 27, "7": 7 }], 6: [function (_dereq_, module, exports) {
24489         'use strict';
24490
24491         Object.defineProperty(exports, "__esModule", {
24492             value: true
24493         });
24494
24495         var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
24496
24497         var _window = _dereq_(3);
24498
24499         var _window2 = _interopRequireDefault(_window);
24500
24501         var _document = _dereq_(2);
24502
24503         var _document2 = _interopRequireDefault(_document);
24504
24505         var _mejs = _dereq_(7);
24506
24507         var _mejs2 = _interopRequireDefault(_mejs);
24508
24509         var _general = _dereq_(27);
24510
24511         var _media2 = _dereq_(28);
24512
24513         var _renderer = _dereq_(8);
24514
24515         var _constants = _dereq_(25);
24516
24517         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24518
24519         function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24520
24521         var MediaElement = function MediaElement(idOrNode, options, sources) {
24522             var _this = this;
24523
24524             _classCallCheck(this, MediaElement);
24525
24526             var t = this;
24527
24528             sources = Array.isArray(sources) ? sources : null;
24529
24530             t.defaults = {
24531                 renderers: [],
24532
24533                 fakeNodeName: 'mediaelementwrapper',
24534
24535                 pluginPath: 'build/',
24536
24537                 shimScriptAccess: 'sameDomain'
24538             };
24539
24540             options = Object.assign(t.defaults, options);
24541
24542             t.mediaElement = _document2.default.createElement(options.fakeNodeName);
24543
24544             var id = idOrNode,
24545                 error = false;
24546
24547             if (typeof idOrNode === 'string') {
24548                 t.mediaElement.originalNode = _document2.default.getElementById(idOrNode);
24549             } else {
24550                 t.mediaElement.originalNode = idOrNode;
24551                 id = idOrNode.id;
24552             }
24553
24554             if (t.mediaElement.originalNode === undefined || t.mediaElement.originalNode === null) {
24555                 return null;
24556             }
24557
24558             t.mediaElement.options = options;
24559             id = id || 'mejs_' + Math.random().toString().slice(2);
24560
24561             t.mediaElement.originalNode.setAttribute('id', id + '_from_mejs');
24562
24563             var tagName = t.mediaElement.originalNode.tagName.toLowerCase();
24564             if (['video', 'audio'].indexOf(tagName) > -1 && !t.mediaElement.originalNode.getAttribute('preload')) {
24565                 t.mediaElement.originalNode.setAttribute('preload', 'none');
24566             }
24567
24568             t.mediaElement.originalNode.parentNode.insertBefore(t.mediaElement, t.mediaElement.originalNode);
24569
24570             t.mediaElement.appendChild(t.mediaElement.originalNode);
24571
24572             var processURL = function processURL(url, type) {
24573                 if (_window2.default.location.protocol === 'https:' && url.indexOf('http:') === 0 && _constants.IS_IOS && _mejs2.default.html5media.mediaTypes.indexOf(type) > -1) {
24574                     var xhr = new XMLHttpRequest();
24575                     xhr.onreadystatechange = function () {
24576                         if (this.readyState === 4 && this.status === 200) {
24577                             var _url = _window2.default.URL || _window2.default.webkitURL,
24578                                 blobUrl = _url.createObjectURL(this.response);
24579                             t.mediaElement.originalNode.setAttribute('src', blobUrl);
24580                             return blobUrl;
24581                         }
24582                         return url;
24583                     };
24584                     xhr.open('GET', url);
24585                     xhr.responseType = 'blob';
24586                     xhr.send();
24587                 }
24588
24589                 return url;
24590             };
24591
24592             var mediaFiles = void 0;
24593
24594             if (sources !== null) {
24595                 mediaFiles = sources;
24596             } else if (t.mediaElement.originalNode !== null) {
24597
24598                 mediaFiles = [];
24599
24600                 switch (t.mediaElement.originalNode.nodeName.toLowerCase()) {
24601                     case 'iframe':
24602                         mediaFiles.push({
24603                             type: '',
24604                             src: t.mediaElement.originalNode.getAttribute('src')
24605                         });
24606                         break;
24607                     case 'audio':
24608                     case 'video':
24609                         var _sources = t.mediaElement.originalNode.children.length,
24610                             nodeSource = t.mediaElement.originalNode.getAttribute('src');
24611
24612                         if (nodeSource) {
24613                             var node = t.mediaElement.originalNode,
24614                                 type = (0, _media2.formatType)(nodeSource, node.getAttribute('type'));
24615                             mediaFiles.push({
24616                                 type: type,
24617                                 src: processURL(nodeSource, type)
24618                             });
24619                         }
24620
24621                         for (var i = 0; i < _sources; i++) {
24622                             var n = t.mediaElement.originalNode.children[i];
24623                             if (n.tagName.toLowerCase() === 'source') {
24624                                 var src = n.getAttribute('src'),
24625                                     _type = (0, _media2.formatType)(src, n.getAttribute('type'));
24626                                 mediaFiles.push({ type: _type, src: processURL(src, _type) });
24627                             }
24628                         }
24629                         break;
24630                 }
24631             }
24632
24633             t.mediaElement.id = id;
24634             t.mediaElement.renderers = {};
24635             t.mediaElement.events = {};
24636             t.mediaElement.promises = [];
24637             t.mediaElement.renderer = null;
24638             t.mediaElement.rendererName = null;
24639
24640             t.mediaElement.changeRenderer = function (rendererName, mediaFiles) {
24641
24642                 var t = _this,
24643                     media = Object.keys(mediaFiles[0]).length > 2 ? mediaFiles[0] : mediaFiles[0].src;
24644
24645                 if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && t.mediaElement.renderer.name === rendererName) {
24646                     t.mediaElement.renderer.pause();
24647                     if (t.mediaElement.renderer.stop) {
24648                         t.mediaElement.renderer.stop();
24649                     }
24650                     t.mediaElement.renderer.show();
24651                     t.mediaElement.renderer.setSrc(media);
24652                     return true;
24653                 }
24654
24655                 if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null) {
24656                     t.mediaElement.renderer.pause();
24657                     if (t.mediaElement.renderer.stop) {
24658                         t.mediaElement.renderer.stop();
24659                     }
24660                     t.mediaElement.renderer.hide();
24661                 }
24662
24663                 var newRenderer = t.mediaElement.renderers[rendererName],
24664                     newRendererType = null;
24665
24666                 if (newRenderer !== undefined && newRenderer !== null) {
24667                     newRenderer.show();
24668                     newRenderer.setSrc(media);
24669                     t.mediaElement.renderer = newRenderer;
24670                     t.mediaElement.rendererName = rendererName;
24671                     return true;
24672                 }
24673
24674                 var rendererArray = t.mediaElement.options.renderers.length ? t.mediaElement.options.renderers : _renderer.renderer.order;
24675
24676                 for (var _i = 0, total = rendererArray.length; _i < total; _i++) {
24677                     var index = rendererArray[_i];
24678
24679                     if (index === rendererName) {
24680                         var rendererList = _renderer.renderer.renderers;
24681                         newRendererType = rendererList[index];
24682
24683                         var renderOptions = Object.assign(newRendererType.options, t.mediaElement.options);
24684                         newRenderer = newRendererType.create(t.mediaElement, renderOptions, mediaFiles);
24685                         newRenderer.name = rendererName;
24686
24687                         t.mediaElement.renderers[newRendererType.name] = newRenderer;
24688                         t.mediaElement.renderer = newRenderer;
24689                         t.mediaElement.rendererName = rendererName;
24690                         newRenderer.show();
24691                         return true;
24692                     }
24693                 }
24694
24695                 return false;
24696             };
24697
24698             t.mediaElement.setSize = function (width, height) {
24699                 if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null) {
24700                     t.mediaElement.renderer.setSize(width, height);
24701                 }
24702             };
24703
24704             t.mediaElement.generateError = function (message, urlList) {
24705                 message = message || '';
24706                 urlList = Array.isArray(urlList) ? urlList : [];
24707                 var event = (0, _general.createEvent)('error', t.mediaElement);
24708                 event.message = message;
24709                 event.urls = urlList;
24710                 t.mediaElement.dispatchEvent(event);
24711                 error = true;
24712             };
24713
24714             var props = _mejs2.default.html5media.properties,
24715                 methods = _mejs2.default.html5media.methods,
24716                 addProperty = function addProperty(obj, name, onGet, onSet) {
24717                     var oldValue = obj[name];
24718                     var getFn = function getFn() {
24719                         return onGet.apply(obj, [oldValue]);
24720                     },
24721                         setFn = function setFn(newValue) {
24722                             oldValue = onSet.apply(obj, [newValue]);
24723                             return oldValue;
24724                         };
24725
24726                     Object.defineProperty(obj, name, {
24727                         get: getFn,
24728                         set: setFn
24729                     });
24730                 },
24731                 assignGettersSetters = function assignGettersSetters(propName) {
24732                     if (propName !== 'src') {
24733
24734                         var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1),
24735                             getFn = function getFn() {
24736                                 return t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer['get' + capName] === 'function' ? t.mediaElement.renderer['get' + capName]() : null;
24737                             },
24738                             setFn = function setFn(value) {
24739                                 if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer['set' + capName] === 'function') {
24740                                     t.mediaElement.renderer['set' + capName](value);
24741                                 }
24742                             };
24743
24744                         addProperty(t.mediaElement, propName, getFn, setFn);
24745                         t.mediaElement['get' + capName] = getFn;
24746                         t.mediaElement['set' + capName] = setFn;
24747                     }
24748                 },
24749                 getSrc = function getSrc() {
24750                     return t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null ? t.mediaElement.renderer.getSrc() : null;
24751                 },
24752                 setSrc = function setSrc(value) {
24753                     var mediaFiles = [];
24754
24755                     if (typeof value === 'string') {
24756                         mediaFiles.push({
24757                             src: value,
24758                             type: value ? (0, _media2.getTypeFromFile)(value) : ''
24759                         });
24760                     } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src !== undefined) {
24761                         var _src = (0, _media2.absolutizeUrl)(value.src),
24762                             _type2 = value.type,
24763                             media = Object.assign(value, {
24764                                 src: _src,
24765                                 type: (_type2 === '' || _type2 === null || _type2 === undefined) && _src ? (0, _media2.getTypeFromFile)(_src) : _type2
24766                             });
24767                         mediaFiles.push(media);
24768                     } else if (Array.isArray(value)) {
24769                         for (var _i2 = 0, total = value.length; _i2 < total; _i2++) {
24770
24771                             var _src2 = (0, _media2.absolutizeUrl)(value[_i2].src),
24772                                 _type3 = value[_i2].type,
24773                                 _media = Object.assign(value[_i2], {
24774                                     src: _src2,
24775                                     type: (_type3 === '' || _type3 === null || _type3 === undefined) && _src2 ? (0, _media2.getTypeFromFile)(_src2) : _type3
24776                                 });
24777
24778                             mediaFiles.push(_media);
24779                         }
24780                     }
24781
24782                     var renderInfo = _renderer.renderer.select(mediaFiles, t.mediaElement.options.renderers.length ? t.mediaElement.options.renderers : []),
24783                         event = void 0;
24784
24785                     if (!t.mediaElement.paused && !(t.mediaElement.src == null || t.mediaElement.src === '')) {
24786                         t.mediaElement.pause();
24787                         event = (0, _general.createEvent)('pause', t.mediaElement);
24788                         t.mediaElement.dispatchEvent(event);
24789                     }
24790                     t.mediaElement.originalNode.src = mediaFiles[0].src || '';
24791
24792                     if (renderInfo === null && mediaFiles[0].src) {
24793                         t.mediaElement.generateError('No renderer found', mediaFiles);
24794                         return;
24795                     }
24796
24797                     var shouldChangeRenderer = !(mediaFiles[0].src == null || mediaFiles[0].src === '');
24798                     return shouldChangeRenderer ? t.mediaElement.changeRenderer(renderInfo.rendererName, mediaFiles) : null;
24799                 },
24800                 triggerAction = function triggerAction(methodName, args) {
24801                     try {
24802                         if (methodName === 'play' && (t.mediaElement.rendererName === 'native_dash' || t.mediaElement.rendererName === 'native_hls' || t.mediaElement.rendererName === 'vimeo_iframe')) {
24803                             var response = t.mediaElement.renderer[methodName](args);
24804                             if (response && typeof response.then === 'function') {
24805                                 response.catch(function () {
24806                                     if (t.mediaElement.paused) {
24807                                         setTimeout(function () {
24808                                             var tmpResponse = t.mediaElement.renderer.play();
24809                                             if (tmpResponse !== undefined) {
24810                                                 tmpResponse.catch(function () {
24811                                                     if (!t.mediaElement.renderer.paused) {
24812                                                         t.mediaElement.renderer.pause();
24813                                                     }
24814                                                 });
24815                                             }
24816                                         }, 150);
24817                                     }
24818                                 });
24819                             }
24820                         } else {
24821                             t.mediaElement.renderer[methodName](args);
24822                         }
24823                     } catch (e) {
24824                         t.mediaElement.generateError(e, mediaFiles);
24825                     }
24826                 },
24827                 assignMethods = function assignMethods(methodName) {
24828                     t.mediaElement[methodName] = function () {
24829                         for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
24830                             args[_key] = arguments[_key];
24831                         }
24832
24833                         if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer[methodName] === 'function') {
24834                             if (t.mediaElement.promises.length) {
24835                                 Promise.all(t.mediaElement.promises).then(function () {
24836                                     triggerAction(methodName, args);
24837                                 }).catch(function (e) {
24838                                     t.mediaElement.generateError(e, mediaFiles);
24839                                 });
24840                             } else {
24841                                 triggerAction(methodName, args);
24842                             }
24843                         }
24844                         return null;
24845                     };
24846                 };
24847
24848             addProperty(t.mediaElement, 'src', getSrc, setSrc);
24849             t.mediaElement.getSrc = getSrc;
24850             t.mediaElement.setSrc = setSrc;
24851
24852             for (var _i3 = 0, total = props.length; _i3 < total; _i3++) {
24853                 assignGettersSetters(props[_i3]);
24854             }
24855
24856             for (var _i4 = 0, _total = methods.length; _i4 < _total; _i4++) {
24857                 assignMethods(methods[_i4]);
24858             }
24859
24860             t.mediaElement.addEventListener = function (eventName, callback) {
24861                 t.mediaElement.events[eventName] = t.mediaElement.events[eventName] || [];
24862
24863                 t.mediaElement.events[eventName].push(callback);
24864             };
24865             t.mediaElement.removeEventListener = function (eventName, callback) {
24866                 if (!eventName) {
24867                     t.mediaElement.events = {};
24868                     return true;
24869                 }
24870
24871                 var callbacks = t.mediaElement.events[eventName];
24872
24873                 if (!callbacks) {
24874                     return true;
24875                 }
24876
24877                 if (!callback) {
24878                     t.mediaElement.events[eventName] = [];
24879                     return true;
24880                 }
24881
24882                 for (var _i5 = 0; _i5 < callbacks.length; _i5++) {
24883                     if (callbacks[_i5] === callback) {
24884                         t.mediaElement.events[eventName].splice(_i5, 1);
24885                         return true;
24886                     }
24887                 }
24888                 return false;
24889             };
24890
24891             t.mediaElement.dispatchEvent = function (event) {
24892                 var callbacks = t.mediaElement.events[event.type];
24893                 if (callbacks) {
24894                     for (var _i6 = 0; _i6 < callbacks.length; _i6++) {
24895                         callbacks[_i6].apply(null, [event]);
24896                     }
24897                 }
24898             };
24899
24900             t.mediaElement.destroy = function () {
24901                 var mediaElement = t.mediaElement.originalNode.cloneNode(true);
24902                 var wrapper = t.mediaElement.parentElement;
24903                 mediaElement.removeAttribute('id');
24904                 mediaElement.remove();
24905                 t.mediaElement.remove();
24906                 wrapper.appendChild(mediaElement);
24907             };
24908
24909             if (mediaFiles.length) {
24910                 t.mediaElement.src = mediaFiles;
24911             }
24912
24913             if (t.mediaElement.promises.length) {
24914                 Promise.all(t.mediaElement.promises).then(function () {
24915                     if (t.mediaElement.options.success) {
24916                         t.mediaElement.options.success(t.mediaElement, t.mediaElement.originalNode);
24917                     }
24918                 }).catch(function () {
24919                     if (error && t.mediaElement.options.error) {
24920                         t.mediaElement.options.error(t.mediaElement, t.mediaElement.originalNode);
24921                     }
24922                 });
24923             } else {
24924                 if (t.mediaElement.options.success) {
24925                     t.mediaElement.options.success(t.mediaElement, t.mediaElement.originalNode);
24926                 }
24927
24928                 if (error && t.mediaElement.options.error) {
24929                     t.mediaElement.options.error(t.mediaElement, t.mediaElement.originalNode);
24930                 }
24931             }
24932
24933             return t.mediaElement;
24934         };
24935
24936         _window2.default.MediaElement = MediaElement;
24937         _mejs2.default.MediaElement = MediaElement;
24938
24939         exports.default = MediaElement;
24940
24941     }, { "2": 2, "25": 25, "27": 27, "28": 28, "3": 3, "7": 7, "8": 8 }], 7: [function (_dereq_, module, exports) {
24942         'use strict';
24943
24944         Object.defineProperty(exports, "__esModule", {
24945             value: true
24946         });
24947
24948         var _window = _dereq_(3);
24949
24950         var _window2 = _interopRequireDefault(_window);
24951
24952         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24953
24954         var mejs = {};
24955
24956         mejs.version = '4.2.16';
24957
24958         mejs.html5media = {
24959             properties: ['volume', 'src', 'currentTime', 'muted', 'duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable', 'currentSrc', 'preload', 'bufferedBytes', 'bufferedTime', 'initialTime', 'startOffsetTime', 'defaultPlaybackRate', 'playbackRate', 'played', 'autoplay', 'loop', 'controls'],
24960             readOnlyProperties: ['duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable'],
24961
24962             methods: ['load', 'play', 'pause', 'canPlayType'],
24963
24964             events: ['loadstart', 'durationchange', 'loadedmetadata', 'loadeddata', 'progress', 'canplay', 'canplaythrough', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'play', 'playing', 'pause', 'waiting', 'seeking', 'seeked', 'timeupdate', 'ended', 'ratechange', 'volumechange'],
24965
24966             mediaTypes: ['audio/mp3', 'audio/ogg', 'audio/oga', 'audio/wav', 'audio/x-wav', 'audio/wave', 'audio/x-pn-wav', 'audio/mpeg', 'audio/mp4', 'video/mp4', 'video/webm', 'video/ogg', 'video/ogv']
24967         };
24968
24969         _window2.default.mejs = mejs;
24970
24971         exports.default = mejs;
24972
24973     }, { "3": 3 }], 8: [function (_dereq_, module, exports) {
24974         'use strict';
24975
24976         Object.defineProperty(exports, "__esModule", {
24977             value: true
24978         });
24979         exports.renderer = undefined;
24980
24981         var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
24982
24983         var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
24984
24985         var _mejs = _dereq_(7);
24986
24987         var _mejs2 = _interopRequireDefault(_mejs);
24988
24989         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24990
24991         function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24992
24993         var Renderer = function () {
24994             function Renderer() {
24995                 _classCallCheck(this, Renderer);
24996
24997                 this.renderers = {};
24998                 this.order = [];
24999             }
25000
25001             _createClass(Renderer, [{
25002                 key: 'add',
25003                 value: function add(renderer) {
25004                     if (renderer.name === undefined) {
25005                         throw new TypeError('renderer must contain at least `name` property');
25006                     }
25007
25008                     this.renderers[renderer.name] = renderer;
25009                     this.order.push(renderer.name);
25010                 }
25011             }, {
25012                 key: 'select',
25013                 value: function select(mediaFiles) {
25014                     var renderers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
25015
25016                     var renderersLength = renderers.length;
25017
25018                     renderers = renderers.length ? renderers : this.order;
25019
25020                     if (!renderersLength) {
25021                         var rendererIndicator = [/^(html5|native)/i, /^flash/i, /iframe$/i],
25022                             rendererRanking = function rendererRanking(renderer) {
25023                                 for (var i = 0, total = rendererIndicator.length; i < total; i++) {
25024                                     if (rendererIndicator[i].test(renderer)) {
25025                                         return i;
25026                                     }
25027                                 }
25028                                 return rendererIndicator.length;
25029                             };
25030
25031                         renderers.sort(function (a, b) {
25032                             return rendererRanking(a) - rendererRanking(b);
25033                         });
25034                     }
25035
25036                     for (var i = 0, total = renderers.length; i < total; i++) {
25037                         var key = renderers[i],
25038                             _renderer = this.renderers[key];
25039
25040                         if (_renderer !== null && _renderer !== undefined) {
25041                             for (var j = 0, jl = mediaFiles.length; j < jl; j++) {
25042                                 if (typeof _renderer.canPlayType === 'function' && typeof mediaFiles[j].type === 'string' && _renderer.canPlayType(mediaFiles[j].type)) {
25043                                     return {
25044                                         rendererName: _renderer.name,
25045                                         src: mediaFiles[j].src
25046                                     };
25047                                 }
25048                             }
25049                         }
25050                     }
25051
25052                     return null;
25053                 }
25054             }, {
25055                 key: 'order',
25056                 set: function set(order) {
25057                     if (!Array.isArray(order)) {
25058                         throw new TypeError('order must be an array of strings.');
25059                     }
25060
25061                     this._order = order;
25062                 },
25063                 get: function get() {
25064                     return this._order;
25065                 }
25066             }, {
25067                 key: 'renderers',
25068                 set: function set(renderers) {
25069                     if (renderers !== null && (typeof renderers === 'undefined' ? 'undefined' : _typeof(renderers)) !== 'object') {
25070                         throw new TypeError('renderers must be an array of objects.');
25071                     }
25072
25073                     this._renderers = renderers;
25074                 },
25075                 get: function get() {
25076                     return this._renderers;
25077                 }
25078             }]);
25079
25080             return Renderer;
25081         }();
25082
25083         var renderer = exports.renderer = new Renderer();
25084
25085         _mejs2.default.Renderers = renderer;
25086
25087     }, { "7": 7 }], 9: [function (_dereq_, module, exports) {
25088         'use strict';
25089
25090         var _window = _dereq_(3);
25091
25092         var _window2 = _interopRequireDefault(_window);
25093
25094         var _document = _dereq_(2);
25095
25096         var _document2 = _interopRequireDefault(_document);
25097
25098         var _i18n = _dereq_(5);
25099
25100         var _i18n2 = _interopRequireDefault(_i18n);
25101
25102         var _player = _dereq_(16);
25103
25104         var _player2 = _interopRequireDefault(_player);
25105
25106         var _constants = _dereq_(25);
25107
25108         var Features = _interopRequireWildcard(_constants);
25109
25110         var _general = _dereq_(27);
25111
25112         var _dom = _dereq_(26);
25113
25114         var _media = _dereq_(28);
25115
25116         function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
25117
25118         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25119
25120         Object.assign(_player.config, {
25121             usePluginFullScreen: true,
25122
25123             fullscreenText: null,
25124
25125             useFakeFullscreen: false
25126         });
25127
25128         Object.assign(_player2.default.prototype, {
25129             isFullScreen: false,
25130
25131             isNativeFullScreen: false,
25132
25133             isInIframe: false,
25134
25135             isPluginClickThroughCreated: false,
25136
25137             fullscreenMode: '',
25138
25139             containerSizeTimeout: null,
25140
25141             buildfullscreen: function buildfullscreen(player) {
25142                 if (!player.isVideo) {
25143                     return;
25144                 }
25145
25146                 player.isInIframe = _window2.default.location !== _window2.default.parent.location;
25147
25148                 player.detectFullscreenMode();
25149
25150                 var t = this,
25151                     fullscreenTitle = (0, _general.isString)(t.options.fullscreenText) ? t.options.fullscreenText : _i18n2.default.t('mejs.fullscreen'),
25152                     fullscreenBtn = _document2.default.createElement('div');
25153
25154                 fullscreenBtn.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'fullscreen-button';
25155                 fullscreenBtn.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + fullscreenTitle + '" aria-label="' + fullscreenTitle + '" tabindex="0"></button>';
25156                 t.addControlElement(fullscreenBtn, 'fullscreen');
25157
25158                 fullscreenBtn.addEventListener('click', function () {
25159                     var isFullScreen = Features.HAS_TRUE_NATIVE_FULLSCREEN && Features.IS_FULLSCREEN || player.isFullScreen;
25160
25161                     if (isFullScreen) {
25162                         player.exitFullScreen();
25163                     } else {
25164                         player.enterFullScreen();
25165                     }
25166                 });
25167
25168                 player.fullscreenBtn = fullscreenBtn;
25169
25170                 t.options.keyActions.push({
25171                     keys: [70],
25172                     action: function action(player, media, key, event) {
25173                         if (!event.ctrlKey) {
25174                             if (typeof player.enterFullScreen !== 'undefined') {
25175                                 if (player.isFullScreen) {
25176                                     player.exitFullScreen();
25177                                 } else {
25178                                     player.enterFullScreen();
25179                                 }
25180                             }
25181                         }
25182                     }
25183                 });
25184
25185                 t.exitFullscreenCallback = function (e) {
25186                     var key = e.which || e.keyCode || 0;
25187                     if (t.options.enableKeyboard && key === 27 && (Features.HAS_TRUE_NATIVE_FULLSCREEN && Features.IS_FULLSCREEN || t.isFullScreen)) {
25188                         player.exitFullScreen();
25189                     }
25190                 };
25191
25192                 t.globalBind('keydown', t.exitFullscreenCallback);
25193
25194                 t.normalHeight = 0;
25195                 t.normalWidth = 0;
25196
25197                 if (Features.HAS_TRUE_NATIVE_FULLSCREEN) {
25198                     var fullscreenChanged = function fullscreenChanged() {
25199                         if (player.isFullScreen) {
25200                             if (Features.isFullScreen()) {
25201                                 player.isNativeFullScreen = true;
25202
25203                                 player.setControlsSize();
25204                             } else {
25205                                 player.isNativeFullScreen = false;
25206
25207                                 player.exitFullScreen();
25208                             }
25209                         }
25210                     };
25211
25212                     player.globalBind(Features.FULLSCREEN_EVENT_NAME, fullscreenChanged);
25213                 }
25214             },
25215             cleanfullscreen: function cleanfullscreen(player) {
25216                 player.exitFullScreen();
25217                 player.globalUnbind('keydown', player.exitFullscreenCallback);
25218             },
25219             detectFullscreenMode: function detectFullscreenMode() {
25220                 var t = this,
25221                     isNative = t.media.rendererName !== null && /(native|html5)/i.test(t.media.rendererName);
25222
25223                 var mode = '';
25224
25225                 if (Features.HAS_TRUE_NATIVE_FULLSCREEN && isNative) {
25226                     mode = 'native-native';
25227                 } else if (Features.HAS_TRUE_NATIVE_FULLSCREEN && !isNative) {
25228                     mode = 'plugin-native';
25229                 } else if (t.usePluginFullScreen && Features.SUPPORT_POINTER_EVENTS) {
25230                     mode = 'plugin-click';
25231                 }
25232
25233                 t.fullscreenMode = mode;
25234                 return mode;
25235             },
25236             enterFullScreen: function enterFullScreen() {
25237                 var t = this,
25238                     isNative = t.media.rendererName !== null && /(html5|native)/i.test(t.media.rendererName),
25239                     containerStyles = getComputedStyle(t.getElement(t.container));
25240
25241                 if (!t.isVideo) {
25242                     return;
25243                 }
25244
25245                 if (t.options.useFakeFullscreen === false && Features.IS_IOS && Features.HAS_IOS_FULLSCREEN && typeof t.media.originalNode.webkitEnterFullscreen === 'function' && t.media.originalNode.canPlayType((0, _media.getTypeFromFile)(t.media.getSrc()))) {
25246                     t.media.originalNode.webkitEnterFullscreen();
25247                     return;
25248                 }
25249
25250                 (0, _dom.addClass)(_document2.default.documentElement, t.options.classPrefix + 'fullscreen');
25251                 (0, _dom.addClass)(t.getElement(t.container), t.options.classPrefix + 'container-fullscreen');
25252
25253                 t.normalHeight = parseFloat(containerStyles.height);
25254                 t.normalWidth = parseFloat(containerStyles.width);
25255
25256                 if (t.fullscreenMode === 'native-native' || t.fullscreenMode === 'plugin-native') {
25257                     Features.requestFullScreen(t.getElement(t.container));
25258
25259                     if (t.isInIframe) {
25260                         setTimeout(function checkFullscreen() {
25261
25262                             if (t.isNativeFullScreen) {
25263                                 var percentErrorMargin = 0.002,
25264                                     windowWidth = _window2.default.innerWidth || _document2.default.documentElement.clientWidth || _document2.default.body.clientWidth,
25265                                     screenWidth = screen.width,
25266                                     absDiff = Math.abs(screenWidth - windowWidth),
25267                                     marginError = screenWidth * percentErrorMargin;
25268
25269                                 if (absDiff > marginError) {
25270                                     t.exitFullScreen();
25271                                 } else {
25272                                     setTimeout(checkFullscreen, 500);
25273                                 }
25274                             }
25275                         }, 1000);
25276                     }
25277                 }
25278
25279                 t.getElement(t.container).style.width = '100%';
25280                 t.getElement(t.container).style.height = '100%';
25281
25282                 t.containerSizeTimeout = setTimeout(function () {
25283                     t.getElement(t.container).style.width = '100%';
25284                     t.getElement(t.container).style.height = '100%';
25285                     t.setControlsSize();
25286                 }, 500);
25287
25288                 if (isNative) {
25289                     t.node.style.width = '100%';
25290                     t.node.style.height = '100%';
25291                 } else {
25292                     var elements = t.getElement(t.container).querySelectorAll('embed, object, video'),
25293                         _total = elements.length;
25294                     for (var i = 0; i < _total; i++) {
25295                         elements[i].style.width = '100%';
25296                         elements[i].style.height = '100%';
25297                     }
25298                 }
25299
25300                 if (t.options.setDimensions && typeof t.media.setSize === 'function') {
25301                     t.media.setSize(screen.width, screen.height);
25302                 }
25303
25304                 var layers = t.getElement(t.layers).children,
25305                     total = layers.length;
25306                 for (var _i = 0; _i < total; _i++) {
25307                     layers[_i].style.width = '100%';
25308                     layers[_i].style.height = '100%';
25309                 }
25310
25311                 if (t.fullscreenBtn) {
25312                     (0, _dom.removeClass)(t.fullscreenBtn, t.options.classPrefix + 'fullscreen');
25313                     (0, _dom.addClass)(t.fullscreenBtn, t.options.classPrefix + 'unfullscreen');
25314                 }
25315
25316                 t.setControlsSize();
25317                 t.isFullScreen = true;
25318
25319                 var zoomFactor = Math.min(screen.width / t.width, screen.height / t.height),
25320                     captionText = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'captions-text');
25321                 if (captionText) {
25322                     captionText.style.fontSize = zoomFactor * 100 + '%';
25323                     captionText.style.lineHeight = 'normal';
25324                     t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'captions-position').style.bottom = (screen.height - t.normalHeight) / 2 - t.getElement(t.controls).offsetHeight / 2 + zoomFactor + 15 + 'px';
25325                 }
25326                 var event = (0, _general.createEvent)('enteredfullscreen', t.getElement(t.container));
25327                 t.getElement(t.container).dispatchEvent(event);
25328             },
25329             exitFullScreen: function exitFullScreen() {
25330                 var t = this,
vendor: 40,359 bytes, lines 25331-26139
25331                     isNative = t.media.rendererName !== null && /(native|html5)/i.test(t.media.rendererName);
25332
25333                 if (!t.isVideo) {
25334                     return;
25335                 }
25336
25337                 clearTimeout(t.containerSizeTimeout);
25338
25339                 if (Features.HAS_TRUE_NATIVE_FULLSCREEN && (Features.IS_FULLSCREEN || t.isFullScreen)) {
25340                     Features.cancelFullScreen();
25341                 }
25342
25343                 (0, _dom.removeClass)(_document2.default.documentElement, t.options.classPrefix + 'fullscreen');
25344                 (0, _dom.removeClass)(t.getElement(t.container), t.options.classPrefix + 'container-fullscreen');
25345
25346                 if (t.options.setDimensions) {
25347                     t.getElement(t.container).style.width = t.normalWidth + 'px';
25348                     t.getElement(t.container).style.height = t.normalHeight + 'px';
25349
25350                     if (isNative) {
25351                         t.node.style.width = t.normalWidth + 'px';
25352                         t.node.style.height = t.normalHeight + 'px';
25353                     } else {
25354                         var elements = t.getElement(t.container).querySelectorAll('embed, object, video'),
25355                             _total2 = elements.length;
25356                         for (var i = 0; i < _total2; i++) {
25357                             elements[i].style.width = t.normalWidth + 'px';
25358                             elements[i].style.height = t.normalHeight + 'px';
25359                         }
25360                     }
25361
25362                     if (typeof t.media.setSize === 'function') {
25363                         t.media.setSize(t.normalWidth, t.normalHeight);
25364                     }
25365
25366                     var layers = t.getElement(t.layers).children,
25367                         total = layers.length;
25368                     for (var _i2 = 0; _i2 < total; _i2++) {
25369                         layers[_i2].style.width = t.normalWidth + 'px';
25370                         layers[_i2].style.height = t.normalHeight + 'px';
25371                     }
25372                 }
25373
25374                 if (t.fullscreenBtn) {
25375                     (0, _dom.removeClass)(t.fullscreenBtn, t.options.classPrefix + 'unfullscreen');
25376                     (0, _dom.addClass)(t.fullscreenBtn, t.options.classPrefix + 'fullscreen');
25377                 }
25378
25379                 t.setControlsSize();
25380                 t.isFullScreen = false;
25381
25382                 var captionText = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'captions-text');
25383                 if (captionText) {
25384                     captionText.style.fontSize = '';
25385                     captionText.style.lineHeight = '';
25386                     t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'captions-position').style.bottom = '';
25387                 }
25388                 var event = (0, _general.createEvent)('exitedfullscreen', t.getElement(t.container));
25389                 t.getElement(t.container).dispatchEvent(event);
25390             }
25391         });
25392
25393     }, { "16": 16, "2": 2, "25": 25, "26": 26, "27": 27, "28": 28, "3": 3, "5": 5 }], 10: [function (_dereq_, module, exports) {
25394         'use strict';
25395
25396         var _document = _dereq_(2);
25397
25398         var _document2 = _interopRequireDefault(_document);
25399
25400         var _player = _dereq_(16);
25401
25402         var _player2 = _interopRequireDefault(_player);
25403
25404         var _i18n = _dereq_(5);
25405
25406         var _i18n2 = _interopRequireDefault(_i18n);
25407
25408         var _general = _dereq_(27);
25409
25410         var _dom = _dereq_(26);
25411
25412         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25413
25414         Object.assign(_player.config, {
25415             playText: null,
25416
25417             pauseText: null
25418         });
25419
25420         Object.assign(_player2.default.prototype, {
25421             buildplaypause: function buildplaypause(player, controls, layers, media) {
25422                 var t = this,
25423                     op = t.options,
25424                     playTitle = (0, _general.isString)(op.playText) ? op.playText : _i18n2.default.t('mejs.play'),
25425                     pauseTitle = (0, _general.isString)(op.pauseText) ? op.pauseText : _i18n2.default.t('mejs.pause'),
25426                     play = _document2.default.createElement('div');
25427
25428                 play.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'playpause-button ' + t.options.classPrefix + 'play';
25429                 play.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + playTitle + '" aria-label="' + pauseTitle + '" tabindex="0"></button>';
25430                 play.addEventListener('click', function () {
25431                     if (t.paused) {
25432                         t.play();
25433                     } else {
25434                         t.pause();
25435                     }
25436                 });
25437
25438                 var playBtn = play.querySelector('button');
25439                 t.addControlElement(play, 'playpause');
25440
25441                 function togglePlayPause(which) {
25442                     if ('play' === which) {
25443                         (0, _dom.removeClass)(play, t.options.classPrefix + 'play');
25444                         (0, _dom.removeClass)(play, t.options.classPrefix + 'replay');
25445                         (0, _dom.addClass)(play, t.options.classPrefix + 'pause');
25446                         playBtn.setAttribute('title', pauseTitle);
25447                         playBtn.setAttribute('aria-label', pauseTitle);
25448                     } else {
25449
25450                         (0, _dom.removeClass)(play, t.options.classPrefix + 'pause');
25451                         (0, _dom.removeClass)(play, t.options.classPrefix + 'replay');
25452                         (0, _dom.addClass)(play, t.options.classPrefix + 'play');
25453                         playBtn.setAttribute('title', playTitle);
25454                         playBtn.setAttribute('aria-label', playTitle);
25455                     }
25456                 }
25457
25458                 togglePlayPause('pse');
25459
25460                 media.addEventListener('loadedmetadata', function () {
25461                     if (media.rendererName.indexOf('flash') === -1) {
25462                         togglePlayPause('pse');
25463                     }
25464                 });
25465                 media.addEventListener('play', function () {
25466                     togglePlayPause('play');
25467                 });
25468                 media.addEventListener('playing', function () {
25469                     togglePlayPause('play');
25470                 });
25471                 media.addEventListener('pause', function () {
25472                     togglePlayPause('pse');
25473                 });
25474                 media.addEventListener('ended', function () {
25475                     if (!player.options.loop) {
25476                         (0, _dom.removeClass)(play, t.options.classPrefix + 'pause');
25477                         (0, _dom.removeClass)(play, t.options.classPrefix + 'play');
25478                         (0, _dom.addClass)(play, t.options.classPrefix + 'replay');
25479                         playBtn.setAttribute('title', playTitle);
25480                         playBtn.setAttribute('aria-label', playTitle);
25481                     }
25482                 });
25483             }
25484         });
25485
25486     }, { "16": 16, "2": 2, "26": 26, "27": 27, "5": 5 }], 11: [function (_dereq_, module, exports) {
25487         'use strict';
25488
25489         var _document = _dereq_(2);
25490
25491         var _document2 = _interopRequireDefault(_document);
25492
25493         var _player = _dereq_(16);
25494
25495         var _player2 = _interopRequireDefault(_player);
25496
25497         var _i18n = _dereq_(5);
25498
25499         var _i18n2 = _interopRequireDefault(_i18n);
25500
25501         var _constants = _dereq_(25);
25502
25503         var _time = _dereq_(30);
25504
25505         var _dom = _dereq_(26);
25506
25507         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25508
25509         Object.assign(_player.config, {
25510             enableProgressTooltip: true,
25511
25512             useSmoothHover: true,
25513
25514             forceLive: false
25515         });
25516
25517         Object.assign(_player2.default.prototype, {
25518             buildprogress: function buildprogress(player, controls, layers, media) {
25519
25520                 var lastKeyPressTime = 0,
25521                     mouseIsDown = false,
25522                     startedPaused = false;
25523
25524                 var t = this,
25525                     autoRewindInitial = player.options.autoRewind,
25526                     tooltip = player.options.enableProgressTooltip ? '<span class="' + t.options.classPrefix + 'time-float">' + ('<span class="' + t.options.classPrefix + 'time-float-current">00:00</span>') + ('<span class="' + t.options.classPrefix + 'time-float-corner"></span>') + '</span>' : '',
25527                     rail = _document2.default.createElement('div');
25528
25529                 rail.className = t.options.classPrefix + 'time-rail';
25530                 rail.innerHTML = '<span class="' + t.options.classPrefix + 'time-total ' + t.options.classPrefix + 'time-slider">' + ('<span class="' + t.options.classPrefix + 'time-buffering"></span>') + ('<span class="' + t.options.classPrefix + 'time-loaded"></span>') + ('<span class="' + t.options.classPrefix + 'time-current"></span>') + ('<span class="' + t.options.classPrefix + 'time-hovered no-hover"></span>') + ('<span class="' + t.options.classPrefix + 'time-handle"><span class="' + t.options.classPrefix + 'time-handle-content"></span></span>') + ('' + tooltip) + '</span>';
25531
25532                 t.addControlElement(rail, 'progress');
25533
25534                 t.options.keyActions.push({
25535                     keys: [37, 227],
25536                     action: function action(player) {
25537                         if (!isNaN(player.duration) && player.duration > 0) {
25538                             if (player.isVideo) {
25539                                 player.showControls();
25540                                 player.startControlsTimer();
25541                             }
25542
25543                             var timeSlider = player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'time-total');
25544                             if (timeSlider) {
25545                                 timeSlider.focus();
25546                             }
25547
25548                             var newTime = Math.max(player.currentTime - player.options.defaultSeekBackwardInterval(player), 0);
25549
25550                             if (!player.paused) {
25551                                 player.pause();
25552                             }
25553
25554                             setTimeout(function () {
25555                                 player.setCurrentTime(newTime);
25556                             }, 0);
25557
25558                             setTimeout(function () {
25559                                 player.play();
25560                             }, 0);
25561                         }
25562                     }
25563                 }, {
25564                     keys: [39, 228],
25565                     action: function action(player) {
25566
25567                         if (!isNaN(player.duration) && player.duration > 0) {
25568                             if (player.isVideo) {
25569                                 player.showControls();
25570                                 player.startControlsTimer();
25571                             }
25572
25573                             var timeSlider = player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'time-total');
25574                             if (timeSlider) {
25575                                 timeSlider.focus();
25576                             }
25577
25578                             var newTime = Math.min(player.currentTime + player.options.defaultSeekForwardInterval(player), player.duration);
25579
25580                             if (!player.paused) {
25581                                 player.pause();
25582                             }
25583
25584                             setTimeout(function () {
25585                                 player.setCurrentTime(newTime);
25586                             }, 0);
25587
25588                             setTimeout(function () {
25589                                 player.play();
25590                             }, 0);
25591                         }
25592                     }
25593                 });
25594
25595                 t.rail = controls.querySelector('.' + t.options.classPrefix + 'time-rail');
25596                 t.total = controls.querySelector('.' + t.options.classPrefix + 'time-total');
25597                 t.loaded = controls.querySelector('.' + t.options.classPrefix + 'time-loaded');
25598                 t.current = controls.querySelector('.' + t.options.classPrefix + 'time-current');
25599                 t.handle = controls.querySelector('.' + t.options.classPrefix + 'time-handle');
25600                 t.timefloat = controls.querySelector('.' + t.options.classPrefix + 'time-float');
25601                 t.timefloatcurrent = controls.querySelector('.' + t.options.classPrefix + 'time-float-current');
25602                 t.slider = controls.querySelector('.' + t.options.classPrefix + 'time-slider');
25603                 t.hovered = controls.querySelector('.' + t.options.classPrefix + 'time-hovered');
25604                 t.buffer = controls.querySelector('.' + t.options.classPrefix + 'time-buffering');
25605                 t.newTime = 0;
25606                 t.forcedHandlePause = false;
25607                 t.setTransformStyle = function (element, value) {
25608                     element.style.transform = value;
25609                     element.style.webkitTransform = value;
25610                     element.style.MozTransform = value;
25611                     element.style.msTransform = value;
25612                     element.style.OTransform = value;
25613                 };
25614
25615                 t.buffer.style.display = 'none';
25616
25617                 var handleMouseMove = function handleMouseMove(e) {
25618                     var totalStyles = getComputedStyle(t.total),
25619                         offsetStyles = (0, _dom.offset)(t.total),
25620                         width = t.total.offsetWidth,
25621                         transform = function () {
25622                             if (totalStyles.webkitTransform !== undefined) {
25623                                 return 'webkitTransform';
25624                             } else if (totalStyles.mozTransform !== undefined) {
25625                                 return 'mozTransform ';
25626                             } else if (totalStyles.oTransform !== undefined) {
25627                                 return 'oTransform';
25628                             } else if (totalStyles.msTransform !== undefined) {
25629                                 return 'msTransform';
25630                             } else {
25631                                 return 'transform';
25632                             }
25633                         }(),
25634                         cssMatrix = function () {
25635                             if ('WebKitCSSMatrix' in window) {
25636                                 return 'WebKitCSSMatrix';
25637                             } else if ('MSCSSMatrix' in window) {
25638                                 return 'MSCSSMatrix';
25639                             } else if ('CSSMatrix' in window) {
25640                                 return 'CSSMatrix';
25641                             }
25642                         }();
25643
25644                     var percentage = 0,
25645                         leftPos = 0,
25646                         pos = 0,
25647                         x = void 0;
25648
25649                     if (e.originalEvent && e.originalEvent.changedTouches) {
25650                         x = e.originalEvent.changedTouches[0].pageX;
25651                     } else if (e.changedTouches) {
25652                         x = e.changedTouches[0].pageX;
25653                     } else {
25654                         x = e.pageX;
25655                     }
25656
25657                     if (t.getDuration()) {
25658                         if (x < offsetStyles.left) {
25659                             x = offsetStyles.left;
25660                         } else if (x > width + offsetStyles.left) {
25661                             x = width + offsetStyles.left;
25662                         }
25663
25664                         pos = x - offsetStyles.left;
25665                         percentage = pos / width;
25666                         t.newTime = percentage * t.getDuration();
25667
25668                         if (mouseIsDown && t.getCurrentTime() !== null && t.newTime.toFixed(4) !== t.getCurrentTime().toFixed(4)) {
25669                             t.setCurrentRailHandle(t.newTime);
25670                             t.updateCurrent(t.newTime);
25671                         }
25672
25673                         if (!_constants.IS_IOS && !_constants.IS_ANDROID) {
25674                             if (pos < 0) {
25675                                 pos = 0;
25676                             }
25677                             if (t.options.useSmoothHover && cssMatrix !== null && typeof window[cssMatrix] !== 'undefined') {
25678                                 var matrix = new window[cssMatrix](getComputedStyle(t.handle)[transform]),
25679                                     handleLocation = matrix.m41,
25680                                     hoverScaleX = pos / parseFloat(getComputedStyle(t.total).width) - handleLocation / parseFloat(getComputedStyle(t.total).width);
25681
25682                                 t.hovered.style.left = handleLocation + 'px';
25683                                 t.setTransformStyle(t.hovered, 'scaleX(' + hoverScaleX + ')');
25684                                 t.hovered.setAttribute('pos', pos);
25685
25686                                 if (hoverScaleX >= 0) {
25687                                     (0, _dom.removeClass)(t.hovered, 'negative');
25688                                 } else {
25689                                     (0, _dom.addClass)(t.hovered, 'negative');
25690                                 }
25691                             }
25692
25693                             if (t.timefloat) {
25694                                 var half = t.timefloat.offsetWidth / 2,
25695                                     offsetContainer = mejs.Utils.offset(t.getElement(t.container)),
25696                                     tooltipStyles = getComputedStyle(t.timefloat);
25697
25698                                 if (x - offsetContainer.left < t.timefloat.offsetWidth) {
25699                                     leftPos = half;
25700                                 } else if (x - offsetContainer.left >= t.getElement(t.container).offsetWidth - half) {
25701                                     leftPos = t.total.offsetWidth - half;
25702                                 } else {
25703                                     leftPos = pos;
25704                                 }
25705
25706                                 if ((0, _dom.hasClass)(t.getElement(t.container), t.options.classPrefix + 'long-video')) {
25707                                     leftPos += parseFloat(tooltipStyles.marginLeft) / 2 + t.timefloat.offsetWidth / 2;
25708                                 }
25709
25710                                 t.timefloat.style.left = leftPos + 'px';
25711                                 t.timefloatcurrent.innerHTML = (0, _time.secondsToTimeCode)(t.newTime, player.options.alwaysShowHours, player.options.showTimecodeFrameCount, player.options.framesPerSecond, player.options.secondsDecimalLength, player.options.timeFormat);
25712                                 t.timefloat.style.display = 'block';
25713                             }
25714                         }
25715                     } else if (!_constants.IS_IOS && !_constants.IS_ANDROID && t.timefloat) {
25716                         leftPos = t.timefloat.offsetWidth + width >= t.getElement(t.container).offsetWidth ? t.timefloat.offsetWidth / 2 : 0;
25717                         t.timefloat.style.left = leftPos + 'px';
25718                         t.timefloat.style.left = leftPos + 'px';
25719                         t.timefloat.style.display = 'block';
25720                     }
25721                 },
25722                     updateSlider = function updateSlider() {
25723                         var seconds = t.getCurrentTime(),
25724                             timeSliderText = _i18n2.default.t('mejs.time-slider'),
25725                             time = (0, _time.secondsToTimeCode)(seconds, player.options.alwaysShowHours, player.options.showTimecodeFrameCount, player.options.framesPerSecond, player.options.secondsDecimalLength, player.options.timeFormat),
25726                             duration = t.getDuration();
25727
25728                         t.slider.setAttribute('role', 'slider');
25729                         t.slider.tabIndex = 0;
25730
25731                         if (media.paused) {
25732                             t.slider.setAttribute('aria-label', timeSliderText);
25733                             t.slider.setAttribute('aria-valuemin', 0);
25734                             t.slider.setAttribute('aria-valuemax', isNaN(duration) ? 0 : duration);
25735                             t.slider.setAttribute('aria-valuenow', seconds);
25736                             t.slider.setAttribute('aria-valuetext', time);
25737                         } else {
25738                             t.slider.removeAttribute('aria-label');
25739                             t.slider.removeAttribute('aria-valuemin');
25740                             t.slider.removeAttribute('aria-valuemax');
25741                             t.slider.removeAttribute('aria-valuenow');
25742                             t.slider.removeAttribute('aria-valuetext');
25743                         }
25744                     },
25745                     restartPlayer = function restartPlayer() {
25746                         if (new Date() - lastKeyPressTime >= 1000) {
25747                             t.play();
25748                         }
25749                     },
25750                     handleMouseup = function handleMouseup() {
25751                         if (mouseIsDown && t.getCurrentTime() !== null && t.newTime.toFixed(4) !== t.getCurrentTime().toFixed(4)) {
25752                             t.setCurrentTime(t.newTime);
25753                             t.setCurrentRailHandle(t.newTime);
25754                             t.updateCurrent(t.newTime);
25755                         }
25756                         if (t.forcedHandlePause) {
25757                             t.slider.focus();
25758                             t.play();
25759                         }
25760                         t.forcedHandlePause = false;
25761                     };
25762
25763                 t.slider.addEventListener('focus', function () {
25764                     player.options.autoRewind = false;
25765                 });
25766                 t.slider.addEventListener('blur', function () {
25767                     player.options.autoRewind = autoRewindInitial;
25768                 });
25769                 t.slider.addEventListener('keydown', function (e) {
25770                     if (new Date() - lastKeyPressTime >= 1000) {
25771                         startedPaused = t.paused;
25772                     }
25773
25774                     if (t.options.enableKeyboard && t.options.keyActions.length) {
25775
25776                         var keyCode = e.which || e.keyCode || 0,
25777                             duration = t.getDuration(),
25778                             seekForward = player.options.defaultSeekForwardInterval(media),
25779                             seekBackward = player.options.defaultSeekBackwardInterval(media);
25780
25781                         var seekTime = t.getCurrentTime();
25782                         var volume = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-slider');
25783
25784                         if (keyCode === 38 || keyCode === 40) {
25785                             if (volume) {
25786                                 volume.style.display = 'block';
25787                             }
25788                             if (t.isVideo) {
25789                                 t.showControls();
25790                                 t.startControlsTimer();
25791                             }
25792
25793                             var newVolume = keyCode === 38 ? Math.min(t.volume + 0.1, 1) : Math.max(t.volume - 0.1, 0),
25794                                 mutePlayer = newVolume <= 0;
25795                             t.setVolume(newVolume);
25796                             t.setMuted(mutePlayer);
25797                             return;
25798                         } else {
25799                             if (volume) {
25800                                 volume.style.display = 'none';
25801                             }
25802                         }
25803
25804                         switch (keyCode) {
25805                             case 37:
25806                                 if (t.getDuration() !== Infinity) {
25807                                     seekTime -= seekBackward;
25808                                 }
25809                                 break;
25810                             case 39:
25811                                 if (t.getDuration() !== Infinity) {
25812                                     seekTime += seekForward;
25813                                 }
25814                                 break;
25815                             case 36:
25816                                 seekTime = 0;
25817                                 break;
25818                             case 35:
25819                                 seekTime = duration;
25820                                 break;
25821                             case 13:
25822                             case 32:
25823                                 if (_constants.IS_FIREFOX) {
25824                                     if (t.paused) {
25825                                         t.play();
25826                                     } else {
25827                                         t.pause();
25828                                     }
25829                                 }
25830                                 return;
25831                             default:
25832                                 return;
25833                         }
25834
25835                         seekTime = seekTime < 0 || isNaN(seekTime) ? 0 : seekTime >= duration ? duration : Math.floor(seekTime);
25836                         lastKeyPressTime = new Date();
25837                         if (!startedPaused) {
25838                             player.pause();
25839                         }
25840
25841                         setTimeout(function () {
25842                             t.setCurrentTime(seekTime);
25843                         }, 0);
25844
25845                         if (seekTime < t.getDuration() && !startedPaused) {
25846                             setTimeout(restartPlayer, 1100);
25847                         }
25848
25849                         player.showControls();
25850
25851                         e.preventDefault();
25852                         e.stopPropagation();
25853                     }
25854                 });
25855
25856                 var events = ['mousedown', 'touchstart'];
25857
25858                 t.slider.addEventListener('dragstart', function () {
25859                     return false;
25860                 });
25861
25862                 for (var i = 0, total = events.length; i < total; i++) {
25863                     t.slider.addEventListener(events[i], function (e) {
25864                         t.forcedHandlePause = false;
25865                         if (t.getDuration() !== Infinity) {
25866                             if (e.which === 1 || e.which === 0) {
25867                                 if (!t.paused) {
25868                                     t.pause();
25869                                     t.forcedHandlePause = true;
25870                                 }
25871
25872                                 mouseIsDown = true;
25873                                 handleMouseMove(e);
25874                                 var endEvents = ['mouseup', 'touchend'];
25875
25876                                 for (var j = 0, totalEvents = endEvents.length; j < totalEvents; j++) {
25877                                     t.getElement(t.container).addEventListener(endEvents[j], function (event) {
25878                                         var target = event.target;
25879                                         if (target === t.slider || target.closest('.' + t.options.classPrefix + 'time-slider')) {
25880                                             handleMouseMove(event);
25881                                         }
25882                                     });
25883                                 }
25884                                 t.globalBind('mouseup.dur touchend.dur', function () {
25885                                     handleMouseup();
25886                                     mouseIsDown = false;
25887                                     if (t.timefloat) {
25888                                         t.timefloat.style.display = 'none';
25889                                     }
25890                                 });
25891                             }
25892                         }
25893                     }, _constants.SUPPORT_PASSIVE_EVENT && events[i] === 'touchstart' ? { passive: true } : false);
25894                 }
25895                 t.slider.addEventListener('mouseenter', function (e) {
25896                     if (e.target === t.slider && t.getDuration() !== Infinity) {
25897                         t.getElement(t.container).addEventListener('mousemove', function (event) {
25898                             var target = event.target;
25899                             if (target === t.slider || target.closest('.' + t.options.classPrefix + 'time-slider')) {
25900                                 handleMouseMove(event);
25901                             }
25902                         });
25903                         if (t.timefloat && !_constants.IS_IOS && !_constants.IS_ANDROID) {
25904                             t.timefloat.style.display = 'block';
25905                         }
25906                         if (t.hovered && !_constants.IS_IOS && !_constants.IS_ANDROID && t.options.useSmoothHover) {
25907                             (0, _dom.removeClass)(t.hovered, 'no-hover');
25908                         }
25909                     }
25910                 });
25911                 t.slider.addEventListener('mouseleave', function () {
25912                     if (t.getDuration() !== Infinity) {
25913                         if (!mouseIsDown) {
25914                             if (t.timefloat) {
25915                                 t.timefloat.style.display = 'none';
25916                             }
25917                             if (t.hovered && t.options.useSmoothHover) {
25918                                 (0, _dom.addClass)(t.hovered, 'no-hover');
25919                             }
25920                         }
25921                     }
25922                 });
25923
25924                 t.broadcastCallback = function (e) {
25925                     var broadcast = controls.querySelector('.' + t.options.classPrefix + 'broadcast');
25926                     if (!t.options.forceLive && t.getDuration() !== Infinity) {
25927                         if (broadcast) {
25928                             t.slider.style.display = '';
25929                             broadcast.remove();
25930                         }
25931
25932                         player.setProgressRail(e);
25933                         if (!t.forcedHandlePause) {
25934                             player.setCurrentRail(e);
25935                         }
25936                         updateSlider();
25937                     } else if (!broadcast && t.options.forceLive) {
25938                         var label = _document2.default.createElement('span');
25939                         label.className = t.options.classPrefix + 'broadcast';
25940                         label.innerText = _i18n2.default.t('mejs.live-broadcast');
25941                         t.slider.style.display = 'none';
25942                         t.rail.appendChild(label);
25943                     }
25944                 };
25945
25946                 media.addEventListener('progress', t.broadcastCallback);
25947                 media.addEventListener('timeupdate', t.broadcastCallback);
25948                 media.addEventListener('play', function () {
25949                     t.buffer.style.display = 'none';
25950                 });
25951                 media.addEventListener('playing', function () {
25952                     t.buffer.style.display = 'none';
25953                 });
25954                 media.addEventListener('seeking', function () {
25955                     t.buffer.style.display = '';
25956                 });
25957                 media.addEventListener('seeked', function () {
25958                     t.buffer.style.display = 'none';
25959                 });
25960                 media.addEventListener('pause', function () {
25961                     t.buffer.style.display = 'none';
25962                 });
25963                 media.addEventListener('waiting', function () {
25964                     t.buffer.style.display = '';
25965                 });
25966                 media.addEventListener('loadeddata', function () {
25967                     t.buffer.style.display = '';
25968                 });
25969                 media.addEventListener('canplay', function () {
25970                     t.buffer.style.display = 'none';
25971                 });
25972                 media.addEventListener('error', function () {
25973                     t.buffer.style.display = 'none';
25974                 });
25975
25976                 t.getElement(t.container).addEventListener('controlsresize', function (e) {
25977                     if (t.getDuration() !== Infinity) {
25978                         player.setProgressRail(e);
25979                         if (!t.forcedHandlePause) {
25980                             player.setCurrentRail(e);
25981                         }
25982                     }
25983                 });
25984             },
25985             cleanprogress: function cleanprogress(player, controls, layers, media) {
25986                 media.removeEventListener('progress', player.broadcastCallback);
25987                 media.removeEventListener('timeupdate', player.broadcastCallback);
25988                 if (player.rail) {
25989                     player.rail.remove();
25990                 }
25991             },
25992             setProgressRail: function setProgressRail(e) {
25993                 var t = this,
25994                     target = e !== undefined ? e.detail.target || e.target : t.media;
25995
25996                 var percent = null;
25997
25998                 if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && t.getDuration()) {
25999                     percent = target.buffered.end(target.buffered.length - 1) / t.getDuration();
26000                 } else if (target && target.bytesTotal !== undefined && target.bytesTotal > 0 && target.bufferedBytes !== undefined) {
26001                     percent = target.bufferedBytes / target.bytesTotal;
26002                 } else if (e && e.lengthComputable && e.total !== 0) {
26003                     percent = e.loaded / e.total;
26004                 }
26005
26006                 if (percent !== null) {
26007                     percent = Math.min(1, Math.max(0, percent));
26008
26009                     if (t.loaded) {
26010                         t.setTransformStyle(t.loaded, 'scaleX(' + percent + ')');
26011                     }
26012                 }
26013             },
26014             setCurrentRailHandle: function setCurrentRailHandle(fakeTime) {
26015                 var t = this;
26016                 t.setCurrentRailMain(t, fakeTime);
26017             },
26018             setCurrentRail: function setCurrentRail() {
26019                 var t = this;
26020                 t.setCurrentRailMain(t);
26021             },
26022             setCurrentRailMain: function setCurrentRailMain(t, fakeTime) {
26023                 if (t.getCurrentTime() !== undefined && t.getDuration()) {
26024                     var nTime = typeof fakeTime === 'undefined' ? t.getCurrentTime() : fakeTime;
26025
26026                     if (t.total && t.handle) {
26027                         var tW = parseFloat(getComputedStyle(t.total).width);
26028
26029                         var newWidth = Math.round(tW * nTime / t.getDuration()),
26030                             handlePos = newWidth - Math.round(t.handle.offsetWidth / 2);
26031
26032                         handlePos = handlePos < 0 ? 0 : handlePos;
26033                         t.setTransformStyle(t.current, 'scaleX(' + newWidth / tW + ')');
26034                         t.setTransformStyle(t.handle, 'translateX(' + handlePos + 'px)');
26035
26036                         if (t.options.useSmoothHover && !(0, _dom.hasClass)(t.hovered, 'no-hover')) {
26037                             var pos = parseInt(t.hovered.getAttribute('pos'), 10);
26038                             pos = isNaN(pos) ? 0 : pos;
26039
26040                             var hoverScaleX = pos / tW - handlePos / tW;
26041
26042                             t.hovered.style.left = handlePos + 'px';
26043                             t.setTransformStyle(t.hovered, 'scaleX(' + hoverScaleX + ')');
26044
26045                             if (hoverScaleX >= 0) {
26046                                 (0, _dom.removeClass)(t.hovered, 'negative');
26047                             } else {
26048                                 (0, _dom.addClass)(t.hovered, 'negative');
26049                             }
26050                         }
26051                     }
26052                 }
26053             }
26054         });
26055
26056     }, { "16": 16, "2": 2, "25": 25, "26": 26, "30": 30, "5": 5 }], 12: [function (_dereq_, module, exports) {
26057         'use strict';
26058
26059         var _document = _dereq_(2);
26060
26061         var _document2 = _interopRequireDefault(_document);
26062
26063         var _player = _dereq_(16);
26064
26065         var _player2 = _interopRequireDefault(_player);
26066
26067         var _time = _dereq_(30);
26068
26069         var _dom = _dereq_(26);
26070
26071         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26072
26073         Object.assign(_player.config, {
26074             duration: 0,
26075
26076             timeAndDurationSeparator: '<span> | </span>'
26077         });
26078
26079         Object.assign(_player2.default.prototype, {
26080             buildcurrent: function buildcurrent(player, controls, layers, media) {
26081                 var t = this,
26082                     time = _document2.default.createElement('div');
26083
26084                 time.className = t.options.classPrefix + 'time';
26085                 time.setAttribute('role', 'timer');
26086                 time.setAttribute('aria-live', 'off');
26087                 time.innerHTML = '<span class="' + t.options.classPrefix + 'currenttime">' + (0, _time.secondsToTimeCode)(0, player.options.alwaysShowHours, player.options.showTimecodeFrameCount, player.options.framesPerSecond, player.options.secondsDecimalLength, player.options.timeFormat) + '</span>';
26088
26089                 t.addControlElement(time, 'current');
26090                 player.updateCurrent();
26091                 t.updateTimeCallback = function () {
26092                     if (t.controlsAreVisible) {
26093                         player.updateCurrent();
26094                     }
26095                 };
26096                 media.addEventListener('timeupdate', t.updateTimeCallback);
26097             },
26098             cleancurrent: function cleancurrent(player, controls, layers, media) {
26099                 media.removeEventListener('timeupdate', player.updateTimeCallback);
26100             },
26101             buildduration: function buildduration(player, controls, layers, media) {
26102                 var t = this,
26103                     currTime = controls.lastChild.querySelector('.' + t.options.classPrefix + 'currenttime');
26104
26105                 if (currTime) {
26106                     controls.querySelector('.' + t.options.classPrefix + 'time').innerHTML += t.options.timeAndDurationSeparator + '<span class="' + t.options.classPrefix + 'duration">' + ((0, _time.secondsToTimeCode)(t.options.duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond, t.options.secondsDecimalLength, t.options.timeFormat) + '</span>');
26107                 } else {
26108                     if (controls.querySelector('.' + t.options.classPrefix + 'currenttime')) {
26109                         (0, _dom.addClass)(controls.querySelector('.' + t.options.classPrefix + 'currenttime').parentNode, t.options.classPrefix + 'currenttime-container');
26110                     }
26111
26112                     var duration = _document2.default.createElement('div');
26113                     duration.className = t.options.classPrefix + 'time ' + t.options.classPrefix + 'duration-container';
26114                     duration.innerHTML = '<span class="' + t.options.classPrefix + 'duration">' + ((0, _time.secondsToTimeCode)(t.options.duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond, t.options.secondsDecimalLength, t.options.timeFormat) + '</span>');
26115
26116                     t.addControlElement(duration, 'duration');
26117                 }
26118
26119                 t.updateDurationCallback = function () {
26120                     if (t.controlsAreVisible) {
26121                         player.updateDuration();
26122                     }
26123                 };
26124
26125                 media.addEventListener('timeupdate', t.updateDurationCallback);
26126             },
26127             cleanduration: function cleanduration(player, controls, layers, media) {
26128                 media.removeEventListener('timeupdate', player.updateDurationCallback);
26129             },
26130             updateCurrent: function updateCurrent() {
26131                 var t = this;
26132
26133                 var currentTime = t.getCurrentTime();
26134
26135                 if (isNaN(currentTime)) {
26136                     currentTime = 0;
26137                 }
26138
26139                 var timecode = (0, _time.secondsToTimeCode)(currentTime, t.options.alwaysShowHours, t.options.showTimeco
26139deFrameCount, t.options.framesPerSecond, t.options.secondsDecimalLength, t.options.timeFormat);
26140
26141                 if (timecode.length > 5) {
26142                     (0, _dom.addClass)(t.getElement(t.container), t.options.classPrefix + 'long-video');
26143                 } else {
26144                     (0, _dom.removeClass)(t.getElement(t.container), t.options.classPrefix + 'long-video');
26145                 }
26146
26147                 if (t.getElement(t.controls).querySelector('.' + t.options.classPrefix + 'currenttime')) {
26148                     t.getElement(t.controls).querySelector('.' + t.options.classPrefix + 'currenttime').innerText = timecode;
26149                 }
26150             },
26151             updateDuration: function updateDuration() {
26152                 var t = this;
26153
26154                 var duration = t.getDuration();
26155
26156                 if (t.media !== undefined && (isNaN(duration) || duration === Infinity || duration < 0)) {
26157                     t.media.duration = t.options.duration = duration = 0;
26158                 }
26159
26160                 if (t.options.duration > 0) {
26161                     duration = t.options.duration;
26162                 }
26163
26164                 var timecode = (0, _time.secondsToTimeCode)(duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond, t.options.secondsDecimalLength, t.options.timeFormat);
26165
26166                 if (timecode.length > 5) {
26167                     (0, _dom.addClass)(t.getElement(t.container), t.options.classPrefix + 'long-video');
26168                 } else {
26169                     (0, _dom.removeClass)(t.getElement(t.container), t.options.classPrefix + 'long-video');
26170                 }
26171
26172                 if (t.getElement(t.controls).querySelector('.' + t.options.classPrefix + 'duration') && duration > 0) {
26173                     t.getElement(t.controls).querySelector('.' + t.options.classPrefix + 'duration').innerHTML = timecode;
26174                 }
26175             }
26176         });
26177
26178     }, { "16": 16, "2": 2, "26": 26, "30": 30 }], 13: [function (_dereq_, module, exports) {
26179         'use strict';
26180
26181         var _document = _dereq_(2);
26182
26183         var _document2 = _interopRequireDefault(_document);
26184
26185         var _mejs = _dereq_(7);
26186
26187         var _mejs2 = _interopRequireDefault(_mejs);
26188
26189         var _i18n = _dereq_(5);
26190
26191         var _i18n2 = _interopRequireDefault(_i18n);
26192
26193         var _player = _dereq_(16);
26194
26195         var _player2 = _interopRequireDefault(_player);
26196
26197         var _time = _dereq_(30);
26198
26199         var _general = _dereq_(27);
26200
26201         var _dom = _dereq_(26);
26202
26203         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26204
26205         Object.assign(_player.config, {
26206             startLanguage: '',
26207
26208             tracksText: null,
26209
26210             chaptersText: null,
26211
26212             tracksAriaLive: false,
26213
26214             hideCaptionsButtonWhenEmpty: true,
26215
26216             toggleCaptionsButtonWhenOnlyOne: false,
26217
26218             slidesSelector: ''
26219         });
26220
26221         Object.assign(_player2.default.prototype, {
26222             hasChapters: false,
26223
26224             buildtracks: function buildtracks(player, controls, layers, media) {
26225
26226                 this.findTracks();
26227
26228                 if (!player.tracks.length && (!player.trackFiles || !player.trackFiles.length === 0)) {
26229                     return;
26230                 }
26231
26232                 var t = this,
26233                     attr = t.options.tracksAriaLive ? ' role="log" aria-live="assertive" aria-atomic="false"' : '',
26234                     tracksTitle = (0, _general.isString)(t.options.tracksText) ? t.options.tracksText : _i18n2.default.t('mejs.captions-subtitles'),
26235                     chaptersTitle = (0, _general.isString)(t.options.chaptersText) ? t.options.chaptersText : _i18n2.default.t('mejs.captions-chapters'),
26236                     total = player.trackFiles === null ? player.tracks.length : player.trackFiles.length;
26237
26238                 if (t.domNode.textTracks) {
26239                     for (var i = t.domNode.textTracks.length - 1; i >= 0; i--) {
26240                         t.domNode.textTracks[i].mode = 'hidden';
26241                     }
26242                 }
26243
26244                 t.cleartracks(player);
26245
26246                 player.captions = _document2.default.createElement('div');
26247                 player.captions.className = t.options.classPrefix + 'captions-layer ' + t.options.classPrefix + 'layer';
26248                 player.captions.innerHTML = '<div class="' + t.options.classPrefix + 'captions-position ' + t.options.classPrefix + 'captions-position-hover"' + attr + '>' + ('<span class="' + t.options.classPrefix + 'captions-text"></span>') + '</div>';
26249                 player.captions.style.display = 'none';
26250                 layers.insertBefore(player.captions, layers.firstChild);
26251
26252                 player.captionsText = player.captions.querySelector('.' + t.options.classPrefix + 'captions-text');
26253
26254                 player.captionsButton = _document2.default.createElement('div');
26255                 player.captionsButton.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'captions-button';
26256                 player.captionsButton.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + tracksTitle + '" aria-label="' + tracksTitle + '" tabindex="0"></button>' + ('<div class="' + t.options.classPrefix + 'captions-selector ' + t.options.classPrefix + 'offscreen">') + ('<ul class="' + t.options.classPrefix + 'captions-selector-list">') + ('<li class="' + t.options.classPrefix + 'captions-selector-list-item">') + ('<input type="radio" class="' + t.options.classPrefix + 'captions-selector-input" ') + ('name="' + player.id + '_captions" id="' + player.id + '_captions_none" ') + 'value="none" checked disabled>' + ('<label class="' + t.options.classPrefix + 'captions-selector-label ') + (t.options.classPrefix + 'captions-selected" ') + ('for="' + player.id + '_captions_none">' + _i18n2.default.t('mejs.none') + '</label>') + '</li>' + '</ul>' + '</div>';
26257
26258                 t.addControlElement(player.captionsButton, 'tracks');
26259
26260                 player.captionsButton.querySelector('.' + t.options.classPrefix + 'captions-selector-input').disabled = false;
26261
26262                 player.chaptersButton = _document2.default.createElement('div');
26263                 player.chaptersButton.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'chapters-button';
26264                 player.chaptersButton.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + chaptersTitle + '" aria-label="' + chaptersTitle + '" tabindex="0"></button>' + ('<div class="' + t.options.classPrefix + 'chapters-selector ' + t.options.classPrefix + 'offscreen">') + ('<ul class="' + t.options.classPrefix + 'chapters-selector-list"></ul>') + '</div>';
26265
26266                 var subtitleCount = 0;
26267
26268                 for (var _i = 0; _i < total; _i++) {
26269                     var kind = player.tracks[_i].kind,
26270                         src = player.tracks[_i].src;
26271                     if (src.trim()) {
26272                         if (kind === 'subtitles' || kind === 'captions') {
26273                             subtitleCount++;
26274                         } else if (kind === 'chapters' && !controls.querySelector('.' + t.options.classPrefix + 'chapter-selector')) {
26275                             player.captionsButton.parentNode.insertBefore(player.chaptersButton, player.captionsButton);
26276                         }
26277                     }
26278                 }
26279
26280                 player.trackToLoad = -1;
26281                 player.selectedTrack = null;
26282                 player.isLoadingTrack = false;
26283
26284                 for (var _i2 = 0; _i2 < total; _i2++) {
26285                     var _kind = player.tracks[_i2].kind;
26286                     if (player.tracks[_i2].src.trim() && (_kind === 'subtitles' || _kind === 'captions')) {
26287                         player.addTrackButton(player.tracks[_i2].trackId, player.tracks[_i2].srclang, player.tracks[_i2].label);
26288                     }
26289                 }
26290
26291                 player.loadNextTrack();
26292
26293                 var inEvents = ['mouseenter', 'focusin'],
26294                     outEvents = ['mouseleave', 'focusout'];
26295
26296                 if (t.options.toggleCaptionsButtonWhenOnlyOne && subtitleCount === 1) {
26297                     player.captionsButton.addEventListener('click', function (e) {
26298                         var trackId = 'none';
26299                         if (player.selectedTrack === null) {
26300                             trackId = player.tracks[0].trackId;
26301                         }
26302                         var keyboard = e.keyCode || e.which;
26303                         player.setTrack(trackId, typeof keyboard !== 'undefined');
26304                     });
26305                 } else {
26306                     var labels = player.captionsButton.querySelectorAll('.' + t.options.classPrefix + 'captions-selector-label'),
26307                         captions = player.captionsButton.querySelectorAll('input[type=radio]');
26308
26309                     for (var _i3 = 0, _total = inEvents.length; _i3 < _total; _i3++) {
26310                         player.captionsButton.addEventListener(inEvents[_i3], function () {
26311                             (0, _dom.removeClass)(this.querySelector('.' + t.options.classPrefix + 'captions-selector'), t.options.classPrefix + 'offscreen');
26312                         });
26313                     }
26314
26315                     for (var _i4 = 0, _total2 = outEvents.length; _i4 < _total2; _i4++) {
26316                         player.captionsButton.addEventListener(outEvents[_i4], function () {
26317                             (0, _dom.addClass)(this.querySelector('.' + t.options.classPrefix + 'captions-selector'), t.options.classPrefix + 'offscreen');
26318                         });
26319                     }
26320
26321                     for (var _i5 = 0, _total3 = captions.length; _i5 < _total3; _i5++) {
26322                         captions[_i5].addEventListener('click', function (e) {
26323                             var keyboard = e.keyCode || e.which;
26324                             player.setTrack(this.value, typeof keyboard !== 'undefined');
26325                         });
26326                     }
26327
26328                     for (var _i6 = 0, _total4 = labels.length; _i6 < _total4; _i6++) {
26329                         labels[_i6].addEventListener('click', function (e) {
26330                             var radio = (0, _dom.siblings)(this, function (el) {
26331                                 return el.tagName === 'INPUT';
26332                             })[0],
26333                                 event = (0, _general.createEvent)('click', radio);
26334                             radio.dispatchEvent(event);
26335                             e.preventDefault();
26336                         });
26337                     }
26338
26339                     player.captionsButton.addEventListener('keydown', function (e) {
26340                         e.stopPropagation();
26341                     });
26342                 }
26343
26344                 for (var _i7 = 0, _total5 = inEvents.length; _i7 < _total5; _i7++) {
26345                     player.chaptersButton.addEventListener(inEvents[_i7], function () {
26346                         if (this.querySelector('.' + t.options.classPrefix + 'chapters-selector-list').children.length) {
26347                             (0, _dom.removeClass)(this.querySelector('.' + t.options.classPrefix + 'chapters-selector'), t.options.classPrefix + 'offscreen');
26348                         }
26349                     });
26350                 }
26351
26352                 for (var _i8 = 0, _total6 = outEvents.length; _i8 < _total6; _i8++) {
26353                     player.chaptersButton.addEventListener(outEvents[_i8], function () {
26354                         (0, _dom.addClass)(this.querySelector('.' + t.options.classPrefix + 'chapters-selector'), t.options.classPrefix + 'offscreen');
26355                     });
26356                 }
26357
26358                 player.chaptersButton.addEventListener('keydown', function (e) {
26359                     e.stopPropagation();
26360                 });
26361
26362                 if (!player.options.alwaysShowControls) {
26363                     player.getElement(player.container).addEventListener('controlsshown', function () {
26364                         (0, _dom.addClass)(player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'captions-position'), t.options.classPrefix + 'captions-position-hover');
26365                     });
26366
26367                     player.getElement(player.container).addEventListener('controlshidden', function () {
26368                         if (!media.paused) {
26369                             (0, _dom.removeClass)(player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'captions-position'), t.options.classPrefix + 'captions-position-hover');
26370                         }
26371                     });
26372                 } else {
26373                     (0, _dom.addClass)(player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'captions-position'), t.options.classPrefix + 'captions-position-hover');
26374                 }
26375
26376                 media.addEventListener('timeupdate', function () {
26377                     player.displayCaptions();
26378                 });
26379
26380                 if (player.options.slidesSelector !== '') {
26381                     player.slidesContainer = _document2.default.querySelectorAll(player.options.slidesSelector);
26382
26383                     media.addEventListener('timeupdate', function () {
26384                         player.displaySlides();
26385                     });
26386                 }
26387             },
26388             cleartracks: function cleartracks(player) {
26389                 if (player) {
26390                     if (player.captions) {
26391                         player.captions.remove();
26392                     }
26393                     if (player.chapters) {
26394                         player.chapters.remove();
26395                     }
26396                     if (player.captionsText) {
26397                         player.captionsText.remove();
26398                     }
26399                     if (player.captionsButton) {
26400                         player.captionsButton.remove();
26401                     }
26402                     if (player.chaptersButton) {
26403                         player.chaptersButton.remove();
26404                     }
26405                 }
26406             },
26407             rebuildtracks: function rebuildtracks() {
26408                 var t = this;
26409                 t.findTracks();
26410                 t.buildtracks(t, t.getElement(t.controls), t.getElement(t.layers), t.media);
26411             },
26412             findTracks: function findTracks() {
26413                 var t = this,
26414                     tracktags = t.trackFiles === null ? t.node.querySelectorAll('track') : t.trackFiles,
26415                     total = tracktags.length;
26416
26417                 t.tracks = [];
26418                 for (var i = 0; i < total; i++) {
26419                     var track = tracktags[i],
26420                         srclang = track.getAttribute('srclang').toLowerCase() || '',
26421                         trackId = t.id + '_track_' + i + '_' + track.getAttribute('kind') + '_' + srclang;
26422                     t.tracks.push({
26423                         trackId: trackId,
26424                         srclang: srclang,
26425                         src: track.getAttribute('src'),
26426                         kind: track.getAttribute('kind'),
26427                         label: track.getAttribute('label') || '',
26428                         entries: [],
26429                         isLoaded: false
26430                     });
26431                 }
26432             },
26433             setTrack: function setTrack(trackId, setByKeyboard) {
26434
26435                 var t = this,
26436                     radios = t.captionsButton.querySelectorAll('input[type="radio"]'),
26437                     captions = t.captionsButton.querySelectorAll('.' + t.options.classPrefix + 'captions-selected'),
26438                     track = t.captionsButton.querySelector('input[value="' + trackId + '"]');
26439
26440                 for (var i = 0, total = radios.length; i < total; i++) {
26441                     radios[i].checked = false;
26442                 }
26443
26444                 for (var _i9 = 0, _total7 = captions.length; _i9 < _total7; _i9++) {
26445                     (0, _dom.removeClass)(captions[_i9], t.options.classPrefix + 'captions-selected');
26446                 }
26447
26448                 track.checked = true;
26449                 var labels = (0, _dom.siblings)(track, function (el) {
26450                     return (0, _dom.hasClass)(el, t.options.classPrefix + 'captions-selector-label');
26451                 });
26452                 for (var _i10 = 0, _total8 = labels.length; _i10 < _total8; _i10++) {
26453                     (0, _dom.addClass)(labels[_i10], t.options.classPrefix + 'captions-selected');
26454                 }
26455
26456                 if (trackId === 'none') {
26457                     t.selectedTrack = null;
26458                     (0, _dom.removeClass)(t.captionsButton, t.options.classPrefix + 'captions-enabled');
26459                 } else {
26460                     for (var _i11 = 0, _total9 = t.tracks.length; _i11 < _total9; _i11++) {
26461                         var _track = t.tracks[_i11];
26462                         if (_track.trackId === trackId) {
26463                             if (t.selectedTrack === null) {
26464                                 (0, _dom.addClass)(t.captionsButton, t.options.classPrefix + 'captions-enabled');
26465                             }
26466                             t.selectedTrack = _track;
26467                             t.captions.setAttribute('lang', t.selectedTrack.srclang);
26468                             t.displayCaptions();
26469                             break;
26470                         }
26471                     }
26472                 }
26473
26474                 var event = (0, _general.createEvent)('captionschange', t.media);
26475                 event.detail.caption = t.selectedTrack;
26476                 t.media.dispatchEvent(event);
26477
26478                 if (!setByKeyboard) {
26479                     setTimeout(function () {
26480                         t.getElement(t.container).focus();
26481                     }, 500);
26482                 }
26483             },
26484             loadNextTrack: function loadNextTrack() {
26485                 var t = this;
26486
26487                 t.trackToLoad++;
26488                 if (t.trackToLoad < t.tracks.length) {
26489                     t.isLoadingTrack = true;
26490                     t.loadTrack(t.trackToLoad);
26491                 } else {
26492                     t.isLoadingTrack = false;
26493                     t.checkForTracks();
26494                 }
26495             },
26496             loadTrack: function loadTrack(index) {
26497                 var t = this,
26498                     track = t.tracks[index];
26499
26500                 if (track !== undefined && (track.src !== undefined || track.src !== "")) {
26501                     (0, _dom.ajax)(track.src, 'text', function (d) {
26502                         track.entries = typeof d === 'string' && /<tt\s+xml/ig.exec(d) ? _mejs2.default.TrackFormatParser.dfxp.parse(d) : _mejs2.default.TrackFormatParser.webvtt.parse(d);
26503
26504                         track.isLoaded = true;
26505                         t.enableTrackButton(track);
26506                         t.loadNextTrack();
26507
26508                         if (track.kind === 'slides') {
26509                             t.setupSlides(track);
26510                         } else if (track.kind === 'chapters' && !t.hasChapters) {
26511                             t.drawChapters(track);
26512                             t.hasChapters = true;
26513                         }
26514                     }, function () {
26515                         t.removeTrackButton(track.trackId);
26516                         t.loadNextTrack();
26517                     });
26518                 }
26519             },
26520             enableTrackButton: function enableTrackButton(track) {
26521                 var t = this,
26522                     lang = track.srclang,
26523                     target = _document2.default.getElementById('' + track.trackId);
26524
26525                 if (!target) {
26526                     return;
26527                 }
26528
26529                 var label = track.label;
26530
26531                 if (label === '') {
26532                     label = _i18n2.default.t(_mejs2.default.language.codes[lang]) || lang;
26533                 }
26534                 target.disabled = false;
26535                 var targetSiblings = (0, _dom.siblings)(target, function (el) {
26536                     return (0, _dom.hasClass)(el, t.options.classPrefix + 'captions-selector-label');
26537                 });
26538                 for (var i = 0, total = targetSiblings.length; i < total; i++) {
26539                     targetSiblings[i].innerHTML = label;
26540                 }
26541
26542                 if (t.options.startLanguage === lang) {
26543                     target.checked = true;
26544                     var event = (0, _general.createEvent)('click', target);
26545                     target.dispatchEvent(event);
26546                 }
26547             },
26548             removeTrackButton: function removeTrackButton(trackId) {
26549                 var element = _document2.default.getElementById('' + trackId);
26550                 if (element) {
26551                     var button = element.closest('li');
26552                     if (button) {
26553                         button.remove();
26554                     }
26555                 }
26556             },
26557             addTrackButton: function addTrackButton(trackId, lang, label) {
26558                 var t = this;
26559                 if (label === '') {
26560                     label = _i18n2.default.t(_mejs2.default.language.codes[lang]) || lang;
26561                 }
26562
26563                 t.captionsButton.querySelector('ul').innerHTML += '<li class="' + t.options.classPrefix + 'captions-selector-list-item">' + ('<input type="radio" class="' + t.options.classPrefix + 'captions-selector-input" ') + ('name="' + t.id + '_captions" id="' + trackId + '" value="' + trackId + '" disabled>') + ('<label class="' + t.options.classPrefix + 'captions-selector-label"') + ('for="' + trackId + '">' + label + ' (loading)</label>') + '</li>';
26564             },
26565             checkForTracks: function checkForTracks() {
26566                 var t = this;
26567
26568                 var hasSubtitles = false;
26569
26570                 if (t.options.hideCaptionsButtonWhenEmpty) {
26571                     for (var i = 0, total = t.tracks.length; i < total; i++) {
26572                         var kind = t.tracks[i].kind;
26573                         if ((kind === 'subtitles' || kind === 'captions') && t.tracks[i].isLoaded) {
26574                             hasSubtitles = true;
26575                             break;
26576                         }
26577                     }
26578
26579                     t.captionsButton.style.display = hasSubtitles ? '' : 'none';
26580                     t.setControlsSize();
26581                 }
26582             },
26583             displayCaptions: function displayCaptions() {
26584                 if (this.tracks === undefined) {
26585                     return;
26586                 }
26587
26588                 var t = this,
26589                     track = t.selectedTrack,
26590                     sanitize = function sanitize(html) {
26591                         var div = _document2.default.createElement('div');
26592                         div.innerHTML = html;
26593
26594                         var scripts = div.getElementsByTagName('script');
26595                         var i = scripts.length;
26596                         while (i--) {
26597                             scripts[i].remove();
26598                         }
26599
26600                         var allElements = div.getElementsByTagName('*');
26601                         for (var _i12 = 0, n = allElements.length; _i12 < n; _i12++) {
26602                             var attributesObj = allElements[_i12].attributes,
26603                                 attributes = Array.prototype.slice.call(attributesObj);
26604
26605                             for (var j = 0, total = attributes.length; j < total; j++) {
26606                                 if (attributes[j].name.startsWith('on') || attributes[j].value.startsWith('javascript')) {
26607                                     allElements[_i12].remove();
26608                                 } else if (attributes[j].name === 'style') {
26609                                     allElements[_i12].removeAttribute(attributes[j].name);
26610                                 }
26611                             }
26612                         }
26613                         return div.innerHTML;
26614                     };
26615
26616                 if (track !== null && track.isLoaded) {
26617                     var i = t.searchTrackPosition(track.entries, t.media.currentTime);
26618                     if (i > -1) {
26619                         var text = track.entries[i].text;
26620                         if (typeof t.options.captionTextPreprocessor === 'function') text = t.options.captionTextPreprocessor(text);
26621                         t.captionsText.innerHTML = sanitize(text);
26622                         t.captionsText.className = t.options.classPrefix + 'captions-text ' + (track.entries[i].identifier || '');
26623                         t.captions.style.display = '';
26624                         t.captions.style.height = '0px';
26625                         return;
26626                     }
26627                     t.captions.style.display = 'none';
26628                 } else {
26629                     t.captions.style.display = 'none';
26630                 }
26631             },
26632             setupSlides: function setupSlides(track) {
26633                 var t = this;
26634                 t.slides = track;
26635                 t.slides.entries.imgs = [t.slides.entries.length];
26636                 t.showSlide(0);
26637             },
26638             showSlide: function showSlide(index) {
26639                 var _this = this;
26640
26641                 var t = this;
26642
26643                 if (t.tracks === undefined || t.slidesContainer === undefined) {
26644                     return;
26645                 }
26646
26647                 var url = t.slides.entries[index].text;
26648
26649                 var img = t.slides.entries[index].imgs;
26650
26651                 if (img === undefined || img.fadeIn === undefined) {
26652                     var image = _document2.default.createElement('img');
26653                     image.src = url;
26654                     image.addEventListener('load', function () {
26655                         var self = _this,
26656                             visible = (0, _dom.siblings)(self, function (el) {
26657                                 return visible(el);
26658                             });
26659                         self.style.display = 'none';
26660                         t.slidesContainer.innerHTML += self.innerHTML;
26661                         (0, _dom.fadeIn)(t.slidesContainer.querySelector(image));
26662                         for (var i = 0, total = visible.length; i < total; i++) {
26663                             (0, _dom.fadeOut)(visible[i], 400);
26664                         }
26665                     });
26666                     t.slides.entries[index].imgs = img = image;
26667                 } else if (!(0, _dom.visible)(img)) {
26668                     var _visible = (0, _dom.siblings)(self, function (el) {
26669                         return _visible(el);
26670                     });
26671                     (0, _dom.fadeIn)(t.slidesContainer.querySelector(img));
26672                     for (var i = 0, total = _visible.length; i < total; i++) {
26673                         (0, _dom.fadeOut)(_visible[i]);
26674                     }
26675                 }
26676             },
26677             displaySlides: function displaySlides() {
26678                 var t = this;
26679
26680                 if (this.slides === undefined) {
26681                     return;
26682                 }
26683
26684                 var slides = t.slides,
26685                     i = t.searchTrackPosition(slides.entries, t.media.currentTime);
26686
26687                 if (i > -1) {
26688                     t.showSlide(i);
26689                 }
26690             },
26691             drawChapters: function drawChapters(chapters) {
26692                 var t = this,
vendor: 6,288 bytes, lines 26693-26829
26693                     total = chapters.entries.length;
26694
26695                 if (!total) {
26696                     return;
26697                 }
26698
26699                 t.chaptersButton.querySelector('ul').innerHTML = '';
26700
26701                 for (var i = 0; i < total; i++) {
26702                     t.chaptersButton.querySelector('ul').innerHTML += '<li class="' + t.options.classPrefix + 'chapters-selector-list-item" ' + 'role="menuitemcheckbox" aria-live="polite" aria-disabled="false" aria-checked="false">' + ('<input type="radio" class="' + t.options.classPrefix + 'captions-selector-input" ') + ('name="' + t.id + '_chapters" id="' + t.id + '_chapters_' + i + '" value="' + chapters.entries[i].start + '" disabled>') + ('<label class="' + t.options.classPrefix + 'chapters-selector-label"') + ('for="' + t.id + '_chapters_' + i + '">' + chapters.entries[i].text + '</label>') + '</li>';
26703                 }
26704
26705                 var radios = t.chaptersButton.querySelectorAll('input[type="radio"]'),
26706                     labels = t.chaptersButton.querySelectorAll('.' + t.options.classPrefix + 'chapters-selector-label');
26707
26708                 for (var _i13 = 0, _total10 = radios.length; _i13 < _total10; _i13++) {
26709                     radios[_i13].disabled = false;
26710                     radios[_i13].checked = false;
26711                     radios[_i13].addEventListener('click', function (e) {
26712                         var self = this,
26713                             listItems = t.chaptersButton.querySelectorAll('li'),
26714                             label = (0, _dom.siblings)(self, function (el) {
26715                                 return (0, _dom.hasClass)(el, t.options.classPrefix + 'chapters-selector-label');
26716                             })[0];
26717
26718                         self.checked = true;
26719                         self.parentNode.setAttribute('aria-checked', true);
26720                         (0, _dom.addClass)(label, t.options.classPrefix + 'chapters-selected');
26721                         (0, _dom.removeClass)(t.chaptersButton.querySelector('.' + t.options.classPrefix + 'chapters-selected'), t.options.classPrefix + 'chapters-selected');
26722
26723                         for (var _i14 = 0, _total11 = listItems.length; _i14 < _total11; _i14++) {
26724                             listItems[_i14].setAttribute('aria-checked', false);
26725                         }
26726
26727                         var keyboard = e.keyCode || e.which;
26728                         if (typeof keyboard === 'undefined') {
26729                             setTimeout(function () {
26730                                 t.getElement(t.container).focus();
26731                             }, 500);
26732                         }
26733
26734                         t.media.setCurrentTime(parseFloat(self.value));
26735                         if (t.media.paused) {
26736                             t.media.play();
26737                         }
26738                     });
26739                 }
26740
26741                 for (var _i15 = 0, _total12 = labels.length; _i15 < _total12; _i15++) {
26742                     labels[_i15].addEventListener('click', function (e) {
26743                         var radio = (0, _dom.siblings)(this, function (el) {
26744                             return el.tagName === 'INPUT';
26745                         })[0],
26746                             event = (0, _general.createEvent)('click', radio);
26747                         radio.dispatchEvent(event);
26748                         e.preventDefault();
26749                     });
26750                 }
26751             },
26752             searchTrackPosition: function searchTrackPosition(tracks, currentTime) {
26753                 var lo = 0,
26754                     hi = tracks.length - 1,
26755                     mid = void 0,
26756                     start = void 0,
26757                     stop = void 0;
26758
26759                 while (lo <= hi) {
26760                     mid = lo + hi >> 1;
26761                     start = tracks[mid].start;
26762                     stop = tracks[mid].stop;
26763
26764                     if (currentTime >= start && currentTime < stop) {
26765                         return mid;
26766                     } else if (start < currentTime) {
26767                         lo = mid + 1;
26768                     } else if (start > currentTime) {
26769                         hi = mid - 1;
26770                     }
26771                 }
26772
26773                 return -1;
26774             }
26775         });
26776
26777         _mejs2.default.language = {
26778             codes: {
26779                 af: 'mejs.afrikaans',
26780                 sq: 'mejs.albanian',
26781                 ar: 'mejs.arabic',
26782                 be: 'mejs.belarusian',
26783                 bg: 'mejs.bulgarian',
26784                 ca: 'mejs.catalan',
26785                 zh: 'mejs.chinese',
26786                 'zh-cn': 'mejs.chinese-simplified',
26787                 'zh-tw': 'mejs.chines-traditional',
26788                 hr: 'mejs.croatian',
26789                 cs: 'mejs.czech',
26790                 da: 'mejs.danish',
26791                 nl: 'mejs.dutch',
26792                 en: 'mejs.english',
26793                 et: 'mejs.estonian',
26794                 fl: 'mejs.filipino',
26795                 fi: 'mejs.finnish',
26796                 fr: 'mejs.french',
26797                 gl: 'mejs.galician',
26798                 de: 'mejs.german',
26799                 el: 'mejs.greek',
26800                 ht: 'mejs.haitian-creole',
26801                 iw: 'mejs.hebrew',
26802                 hi: 'mejs.hindi',
26803                 hu: 'mejs.hungarian',
26804                 is: 'mejs.icelandic',
26805                 id: 'mejs.indonesian',
26806                 ga: 'mejs.irish',
26807                 it: 'mejs.italian',
26808                 ja: 'mejs.japanese',
26809                 ko: 'mejs.korean',
26810                 lv: 'mejs.latvian',
26811                 lt: 'mejs.lithuanian',
26812                 mk: 'mejs.macedonian',
26813                 ms: 'mejs.malay',
26814                 mt: 'mejs.maltese',
26815                 no: 'mejs.norwegian',
26816                 fa: 'mejs.persian',
26817                 pl: 'mejs.polish',
26818                 pt: 'mejs.portuguese',
26819                 ro: 'mejs.romanian',
26820                 ru: 'mejs.russian',
26821                 sr: 'mejs.serbian',
26822                 sk: 'mejs.slovak',
26823                 sl: 'mejs.slovenian',
26824                 es: 'mejs.spanish',
26825                 sw: 'mejs.swahili',
26826                 sv: 'mejs.swedish',
26827                 tl: 'mejs.tagalog',
26828                 th: 'mejs.thai',
26829                 tr: 'mejs.turkish',
26830                 uk: 'mejs.ukrainian',
26831                 vi: 'mejs.vietnamese',
26832                 cy: 'mejs.welsh',
26833                 yi: 'mejs.yiddish'
26834             }
26835         };
26836
26837         _mejs2.default.TrackFormatParser = {
26838             webvtt: {
26839                 pattern: /^((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,
26840
26841                 parse: function parse(trackText) {
26842                     var lines = trackText.split(/\r?\n/),
26843                         entries = [];
26844
26845                     var timecode = void 0,
26846                         text = void 0,
26847                         identifier = void 0;
26848
26849                     for (var i = 0, total = lines.length; i < total; i++) {
26850                         timecode = this.pattern.exec(lines[i]);
26851
26852                         if (timecode && i < lines.length) {
26853                             if (i - 1 >= 0 && lines[i - 1] !== '') {
26854                                 identifier = lines[i - 1];
26855                             }
26856                             i++;
26857
26858                             text = lines[i];
26859                             i++;
26860                             while (lines[i] !== '' && i < lines.length) {
26861                                 text = text + '\n' + lines[i];
26862                                 i++;
26863                             }
26864                             text = text === null ? '' : text.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>");
26865                             entries.push({
26866                                 identifier: identifier,
26867                                 start: (0, _time.convertSMPTEtoSeconds)(timecode[1]) === 0 ? 0.200 : (0, _time.convertSMPTEtoSeconds)(timecode[1]),
26868                                 stop: (0, _time.convertSMPTEtoSeconds)(timecode[3]),
26869                                 text: text,
26870                                 settings: timecode[5]
26871                             });
26872                         }
26873                         identifier = '';
26874                     }
26875                     return entries;
26876                 }
26877             },
26878
26879             dfxp: {
26880                 parse: function parse(trackText) {
26881                     trackText = $(trackText).filter('tt');
26882                     var container = trackText.firstChild,
26883                         lines = container.querySelectorAll('p'),
26884                         styleNode = trackText.getElementById('' + container.attr('style')),
26885                         entries = [];
26886
26887                     var styles = void 0;
26888
26889                     if (styleNode.length) {
26890                         styleNode.removeAttribute('id');
26891                         var attributes = styleNode.attributes;
26892                         if (attributes.length) {
26893                             styles = {};
26894                             for (var i = 0, total = attributes.length; i < total; i++) {
26895                                 styles[attributes[i].name.split(":")[1]] = attributes[i].value;
26896                             }
26897                         }
26898                     }
26899
26900                     for (var _i16 = 0, _total13 = lines.length; _i16 < _total13; _i16++) {
26901                         var style = void 0,
26902                             _temp = {
26903                                 start: null,
26904                                 stop: null,
26905                                 style: null,
26906                                 text: null
26907                             };
26908
26909                         if (lines.eq(_i16).attr('begin')) {
26910                             _temp.start = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16).attr('begin'));
26911                         }
26912                         if (!_temp.start && lines.eq(_i16 - 1).attr('end')) {
26913                             _temp.start = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16 - 1).attr('end'));
26914                         }
26915                         if (lines.eq(_i16).attr('end')) {
26916                             _temp.stop = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16).attr('end'));
26917                         }
26918                         if (!_temp.stop && lines.eq(_i16 + 1).attr('begin')) {
26919                             _temp.stop = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16 + 1).attr('begin'));
26920                         }
26921
26922                         if (styles) {
26923                             style = '';
26924                             for (var _style in styles) {
26925                                 style += _style + ':' + styles[_style] + ';';
26926                             }
26927                         }
26928                         if (style) {
26929                             _temp.style = style;
26930                         }
26931                         if (_temp.start === 0) {
26932                             _temp.start = 0.200;
26933                         }
26934                         _temp.text = lines.eq(_i16).innerHTML.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>");
vendor: 75,463 bytes, lines 26935-28509
26935                         entries.push(_temp);
26936                     }
26937                     return entries;
26938                 }
26939             }
26940         };
26941
26942     }, { "16": 16, "2": 2, "26": 26, "27": 27, "30": 30, "5": 5, "7": 7 }], 14: [function (_dereq_, module, exports) {
26943         'use strict';
26944
26945         var _document = _dereq_(2);
26946
26947         var _document2 = _interopRequireDefault(_document);
26948
26949         var _player = _dereq_(16);
26950
26951         var _player2 = _interopRequireDefault(_player);
26952
26953         var _i18n = _dereq_(5);
26954
26955         var _i18n2 = _interopRequireDefault(_i18n);
26956
26957         var _constants = _dereq_(25);
26958
26959         var _general = _dereq_(27);
26960
26961         var _dom = _dereq_(26);
26962
26963         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26964
26965         Object.assign(_player.config, {
26966             muteText: null,
26967
26968             unmuteText: null,
26969
26970             allyVolumeControlText: null,
26971
26972             hideVolumeOnTouchDevices: true,
26973
26974             audioVolume: 'horizontal',
26975
26976             videoVolume: 'vertical',
26977
26978             startVolume: 0.8
26979         });
26980
26981         Object.assign(_player2.default.prototype, {
26982             buildvolume: function buildvolume(player, controls, layers, media) {
26983                 if ((_constants.IS_ANDROID || _constants.IS_IOS) && this.options.hideVolumeOnTouchDevices) {
26984                     return;
26985                 }
26986
26987                 var t = this,
26988                     mode = t.isVideo ? t.options.videoVolume : t.options.audioVolume,
26989                     muteText = (0, _general.isString)(t.options.muteText) ? t.options.muteText : _i18n2.default.t('mejs.mute'),
26990                     unmuteText = (0, _general.isString)(t.options.unmuteText) ? t.options.unmuteText : _i18n2.default.t('mejs.unmute'),
26991                     volumeControlText = (0, _general.isString)(t.options.allyVolumeControlText) ? t.options.allyVolumeControlText : _i18n2.default.t('mejs.volume-help-text'),
26992                     mute = _document2.default.createElement('div');
26993
26994                 mute.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'volume-button ' + t.options.classPrefix + 'mute';
26995                 mute.innerHTML = mode === 'horizontal' ? '<button type="button" aria-controls="' + t.id + '" title="' + muteText + '" aria-label="' + muteText + '" tabindex="0"></button>' : '<button type="button" aria-controls="' + t.id + '" title="' + muteText + '" aria-label="' + muteText + '" tabindex="0"></button>' + ('<a href="javascript:void(0);" class="' + t.options.classPrefix + 'volume-slider" ') + ('aria-label="' + _i18n2.default.t('mejs.volume-slider') + '" aria-valuemin="0" aria-valuemax="100" role="slider" ') + 'aria-orientation="vertical">' + ('<span class="' + t.options.classPrefix + 'offscreen">' + volumeControlText + '</span>') + ('<div class="' + t.options.classPrefix + 'volume-total">') + ('<div class="' + t.options.classPrefix + 'volume-current"></div>') + ('<div class="' + t.options.classPrefix + 'volume-handle"></div>') + '</div>' + '</a>';
26996
26997                 t.addControlElement(mute, 'volume');
26998
26999                 t.options.keyActions.push({
27000                     keys: [38],
27001                     action: function action(player) {
27002                         var volumeSlider = player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'volume-slider');
27003                         if (volumeSlider && volumeSlider.matches(':focus')) {
27004                             volumeSlider.style.display = 'block';
27005                         }
27006                         if (player.isVideo) {
27007                             player.showControls();
27008                             player.startControlsTimer();
27009                         }
27010
27011                         var newVolume = Math.min(player.volume + 0.1, 1);
27012                         player.setVolume(newVolume);
27013                         if (newVolume > 0) {
27014                             player.setMuted(false);
27015                         }
27016                     }
27017                 }, {
27018                     keys: [40],
27019                     action: function action(player) {
27020                         var volumeSlider = player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'volume-slider');
27021                         if (volumeSlider) {
27022                             volumeSlider.style.display = 'block';
27023                         }
27024
27025                         if (player.isVideo) {
27026                             player.showControls();
27027                             player.startControlsTimer();
27028                         }
27029
27030                         var newVolume = Math.max(player.volume - 0.1, 0);
27031                         player.setVolume(newVolume);
27032
27033                         if (newVolume <= 0.1) {
27034                             player.setMuted(true);
27035                         }
27036                     }
27037                 }, {
27038                     keys: [77],
27039                     action: function action(player) {
27040                         var volumeSlider = player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'volume-slider');
27041                         if (volumeSlider) {
27042                             volumeSlider.style.display = 'block';
27043                         }
27044
27045                         if (player.isVideo) {
27046                             player.showControls();
27047                             player.startControlsTimer();
27048                         }
27049                         if (player.media.muted) {
27050                             player.setMuted(false);
27051                         } else {
27052                             player.setMuted(true);
27053                         }
27054                     }
27055                 });
27056
27057                 if (mode === 'horizontal') {
27058                     var anchor = _document2.default.createElement('a');
27059                     anchor.className = t.options.classPrefix + 'horizontal-volume-slider';
27060                     anchor.href = 'javascript:void(0);';
27061                     anchor.setAttribute('aria-label', _i18n2.default.t('mejs.volume-slider'));
27062                     anchor.setAttribute('aria-valuemin', 0);
27063                     anchor.setAttribute('aria-valuemax', 100);
27064                     anchor.setAttribute('aria-valuenow', 100);
27065                     anchor.setAttribute('role', 'slider');
27066                     anchor.innerHTML += '<span class="' + t.options.classPrefix + 'offscreen">' + volumeControlText + '</span>' + ('<div class="' + t.options.classPrefix + 'horizontal-volume-total">') + ('<div class="' + t.options.classPrefix + 'horizontal-volume-current"></div>') + ('<div class="' + t.options.classPrefix + 'horizontal-volume-handle"></div>') + '</div>';
27067                     mute.parentNode.insertBefore(anchor, mute.nextSibling);
27068                 }
27069
27070                 var mouseIsDown = false,
27071                     mouseIsOver = false,
27072                     modified = false,
27073                     updateVolumeSlider = function updateVolumeSlider() {
27074                         var volume = Math.floor(media.volume * 100);
27075                         volumeSlider.setAttribute('aria-valuenow', volume);
27076                         volumeSlider.setAttribute('aria-valuetext', volume + '%');
27077                     };
27078
27079                 var volumeSlider = mode === 'vertical' ? t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-slider') : t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'horizontal-volume-slider'),
27080                     volumeTotal = mode === 'vertical' ? t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-total') : t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'horizontal-volume-total'),
27081                     volumeCurrent = mode === 'vertical' ? t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-current') : t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'horizontal-volume-current'),
27082                     volumeHandle = mode === 'vertical' ? t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-handle') : t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'horizontal-volume-handle'),
27083                     positionVolumeHandle = function positionVolumeHandle(volume) {
27084
27085                         if (volume === null || isNaN(volume) || volume === undefined) {
27086                             return;
27087                         }
27088
27089                         volume = Math.max(0, volume);
27090                         volume = Math.min(volume, 1);
27091
27092                         if (volume === 0) {
27093                             (0, _dom.removeClass)(mute, t.options.classPrefix + 'mute');
27094                             (0, _dom.addClass)(mute, t.options.classPrefix + 'unmute');
27095                             var button = mute.firstElementChild;
27096                             button.setAttribute('title', unmuteText);
27097                             button.setAttribute('aria-label', unmuteText);
27098                         } else {
27099                             (0, _dom.removeClass)(mute, t.options.classPrefix + 'unmute');
27100                             (0, _dom.addClass)(mute, t.options.classPrefix + 'mute');
27101                             var _button = mute.firstElementChild;
27102                             _button.setAttribute('title', muteText);
27103                             _button.setAttribute('aria-label', muteText);
27104                         }
27105
27106                         var volumePercentage = volume * 100 + '%',
27107                             volumeStyles = getComputedStyle(volumeHandle);
27108
27109                         if (mode === 'vertical') {
27110                             volumeCurrent.style.bottom = 0;
27111                             volumeCurrent.style.height = volumePercentage;
27112                             volumeHandle.style.bottom = volumePercentage;
27113                             volumeHandle.style.marginBottom = -parseFloat(volumeStyles.height) / 2 + 'px';
27114                         } else {
27115                             volumeCurrent.style.left = 0;
27116                             volumeCurrent.style.width = volumePercentage;
27117                             volumeHandle.style.left = volumePercentage;
27118                             volumeHandle.style.marginLeft = -parseFloat(volumeStyles.width) / 2 + 'px';
27119                         }
27120                     },
27121                     handleVolumeMove = function handleVolumeMove(e) {
27122                         var totalOffset = (0, _dom.offset)(volumeTotal),
27123                             volumeStyles = getComputedStyle(volumeTotal);
27124
27125                         modified = true;
27126
27127                         var volume = null;
27128
27129                         if (mode === 'vertical') {
27130                             var railHeight = parseFloat(volumeStyles.height),
27131                                 newY = e.pageY - totalOffset.top;
27132
27133                             volume = (railHeight - newY) / railHeight;
27134
27135                             if (totalOffset.top === 0 || totalOffset.left === 0) {
27136                                 return;
27137                             }
27138                         } else {
27139                             var railWidth = parseFloat(volumeStyles.width),
27140                                 newX = e.pageX - totalOffset.left;
27141
27142                             volume = newX / railWidth;
27143                         }
27144
27145                         volume = Math.max(0, volume);
27146                         volume = Math.min(volume, 1);
27147
27148                         positionVolumeHandle(volume);
27149
27150                         t.setMuted(volume === 0);
27151                         t.setVolume(volume);
27152
27153                         e.preventDefault();
27154                         e.stopPropagation();
27155                     },
27156                     toggleMute = function toggleMute() {
27157                         if (t.muted) {
27158                             positionVolumeHandle(0);
27159                             (0, _dom.removeClass)(mute, t.options.classPrefix + 'mute');
27160                             (0, _dom.addClass)(mute, t.options.classPrefix + 'unmute');
27161                         } else {
27162                             positionVolumeHandle(media.volume);
27163                             (0, _dom.removeClass)(mute, t.options.classPrefix + 'unmute');
27164                             (0, _dom.addClass)(mute, t.options.classPrefix + 'mute');
27165                         }
27166                     };
27167
27168                 player.getElement(player.container).addEventListener('keydown', function (e) {
27169                     var hasFocus = !!e.target.closest('.' + t.options.classPrefix + 'container');
27170                     if (!hasFocus && mode === 'vertical') {
27171                         volumeSlider.style.display = 'none';
27172                     }
27173                 });
27174
27175                 mute.addEventListener('mouseenter', function (e) {
27176                     if (e.target === mute) {
27177                         volumeSlider.style.display = 'block';
27178                         mouseIsOver = true;
27179                         e.preventDefault();
27180                         e.stopPropagation();
27181                     }
27182                 });
27183                 mute.addEventListener('focusin', function () {
27184                     volumeSlider.style.display = 'block';
27185                     mouseIsOver = true;
27186                 });
27187
27188                 mute.addEventListener('focusout', function (e) {
27189                     if ((!e.relatedTarget || e.relatedTarget && !e.relatedTarget.matches('.' + t.options.classPrefix + 'volume-slider')) && mode === 'vertical') {
27190                         volumeSlider.style.display = 'none';
27191                     }
27192                 });
27193                 mute.addEventListener('mouseleave', function () {
27194                     mouseIsOver = false;
27195                     if (!mouseIsDown && mode === 'vertical') {
27196                         volumeSlider.style.display = 'none';
27197                     }
27198                 });
27199                 mute.addEventListener('focusout', function () {
27200                     mouseIsOver = false;
27201                 });
27202                 mute.addEventListener('keydown', function (e) {
27203                     if (t.options.enableKeyboard && t.options.keyActions.length) {
27204                         var keyCode = e.which || e.keyCode || 0,
27205                             volume = media.volume;
27206
27207                         switch (keyCode) {
27208                             case 38:
27209                                 volume = Math.min(volume + 0.1, 1);
27210                                 break;
27211                             case 40:
27212                                 volume = Math.max(0, volume - 0.1);
27213                                 break;
27214                             default:
27215                                 return true;
27216                         }
27217
27218                         mouseIsDown = false;
27219                         positionVolumeHandle(volume);
27220                         media.setVolume(volume);
27221
27222                         e.preventDefault();
27223                         e.stopPropagation();
27224                     }
27225                 });
27226                 mute.querySelector('button').addEventListener('click', function () {
27227                     media.setMuted(!media.muted);
27228                     var event = (0, _general.createEvent)('volumechange', media);
27229                     media.dispatchEvent(event);
27230                 });
27231
27232                 volumeSlider.addEventListener('dragstart', function () {
27233                     return false;
27234                 });
27235
27236                 volumeSlider.addEventListener('mouseover', function () {
27237                     mouseIsOver = true;
27238                 });
27239                 volumeSlider.addEventListener('focusin', function () {
27240                     volumeSlider.style.display = 'block';
27241                     mouseIsOver = true;
27242                 });
27243                 volumeSlider.addEventListener('focusout', function () {
27244                     mouseIsOver = false;
27245                     if (!mouseIsDown && mode === 'vertical') {
27246                         volumeSlider.style.display = 'none';
27247                     }
27248                 });
27249                 volumeSlider.addEventListener('mousedown', function (e) {
27250                     handleVolumeMove(e);
27251                     t.globalBind('mousemove.vol', function (event) {
27252                         var target = event.target;
27253                         if (mouseIsDown && (target === volumeSlider || target.closest(mode === 'vertical' ? '.' + t.options.classPrefix + 'volume-slider' : '.' + t.options.classPrefix + 'horizontal-volume-slider'))) {
27254                             handleVolumeMove(event);
27255                         }
27256                     });
27257                     t.globalBind('mouseup.vol', function () {
27258                         mouseIsDown = false;
27259                         if (!mouseIsOver && mode === 'vertical') {
27260                             volumeSlider.style.display = 'none';
27261                         }
27262                     });
27263                     mouseIsDown = true;
27264                     e.preventDefault();
27265                     e.stopPropagation();
27266                 });
27267
27268                 media.addEventListener('volumechange', function (e) {
27269                     if (!mouseIsDown) {
27270                         toggleMute();
27271                     }
27272                     updateVolumeSlider(e);
27273                 });
27274
27275                 var rendered = false;
27276                 media.addEventListener('rendererready', function () {
27277                     if (!modified) {
27278                         setTimeout(function () {
27279                             rendered = true;
27280                             if (player.options.startVolume === 0 || media.originalNode.muted) {
27281                                 media.setMuted(true);
27282                                 player.options.startVolume = 0;
27283                             }
27284                             media.setVolume(player.options.startVolume);
27285                             t.setControlsSize();
27286                         }, 250);
27287                     }
27288                 });
27289
27290                 media.addEventListener('loadedmetadata', function () {
27291                     setTimeout(function () {
27292                         if (!modified && !rendered) {
27293                             if (player.options.startVolume === 0 || media.originalNode.muted) {
27294                                 media.setMuted(true);
27295                             }
27296                             media.setVolume(player.options.startVolume);
27297                             t.setControlsSize();
27298                         }
27299                         rendered = false;
27300                     }, 250);
27301                 });
27302
27303                 if (player.options.startVolume === 0 || media.originalNode.muted) {
27304                     media.setMuted(true);
27305                     player.options.startVolume = 0;
27306                     toggleMute();
27307                 }
27308
27309                 t.getElement(t.container).addEventListener('controlsresize', function () {
27310                     toggleMute();
27311                 });
27312             }
27313         });
27314
27315     }, { "16": 16, "2": 2, "25": 25, "26": 26, "27": 27, "5": 5 }], 15: [function (_dereq_, module, exports) {
27316         'use strict';
27317
27318         Object.defineProperty(exports, "__esModule", {
27319             value: true
27320         });
27321         var EN = exports.EN = {
27322             'mejs.plural-form': 1,
27323
27324             'mejs.download-file': 'Download File',
27325
27326             'mejs.install-flash': 'You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/',
27327
27328             'mejs.fullscreen': 'Fullscreen',
27329
27330             'mejs.play': 'Play',
27331             'mejs.pause': 'Pause',
27332
27333             'mejs.time-slider': 'Time Slider',
27334             'mejs.time-help-text': 'Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.',
27335             'mejs.live-broadcast': 'Live Broadcast',
27336
27337             'mejs.volume-help-text': 'Use Up/Down Arrow keys to increase or decrease volume.',
27338             'mejs.unmute': 'Unmute',
27339             'mejs.mute': 'Mute',
27340             'mejs.volume-slider': 'Volume Slider',
27341
27342             'mejs.video-player': 'Video Player',
27343             'mejs.audio-player': 'Audio Player',
27344
27345             'mejs.captions-subtitles': 'Captions/Subtitles',
27346             'mejs.captions-chapters': 'Chapters',
27347             'mejs.none': 'None',
27348             'mejs.afrikaans': 'Afrikaans',
27349             'mejs.albanian': 'Albanian',
27350             'mejs.arabic': 'Arabic',
27351             'mejs.belarusian': 'Belarusian',
27352             'mejs.bulgarian': 'Bulgarian',
27353             'mejs.catalan': 'Catalan',
27354             'mejs.chinese': 'Chinese',
27355             'mejs.chinese-simplified': 'Chinese (Simplified)',
27356             'mejs.chinese-traditional': 'Chinese (Traditional)',
27357             'mejs.croatian': 'Croatian',
27358             'mejs.czech': 'Czech',
27359             'mejs.danish': 'Danish',
27360             'mejs.dutch': 'Dutch',
27361             'mejs.english': 'English',
27362             'mejs.estonian': 'Estonian',
27363             'mejs.filipino': 'Filipino',
27364             'mejs.finnish': 'Finnish',
27365             'mejs.french': 'French',
27366             'mejs.galician': 'Galician',
27367             'mejs.german': 'German',
27368             'mejs.greek': 'Greek',
27369             'mejs.haitian-creole': 'Haitian Creole',
27370             'mejs.hebrew': 'Hebrew',
27371             'mejs.hindi': 'Hindi',
27372             'mejs.hungarian': 'Hungarian',
27373             'mejs.icelandic': 'Icelandic',
27374             'mejs.indonesian': 'Indonesian',
27375             'mejs.irish': 'Irish',
27376             'mejs.italian': 'Italian',
27377             'mejs.japanese': 'Japanese',
27378             'mejs.korean': 'Korean',
27379             'mejs.latvian': 'Latvian',
27380             'mejs.lithuanian': 'Lithuanian',
27381             'mejs.macedonian': 'Macedonian',
27382             'mejs.malay': 'Malay',
27383             'mejs.maltese': 'Maltese',
27384             'mejs.norwegian': 'Norwegian',
27385             'mejs.persian': 'Persian',
27386             'mejs.polish': 'Polish',
27387             'mejs.portuguese': 'Portuguese',
27388             'mejs.romanian': 'Romanian',
27389             'mejs.russian': 'Russian',
27390             'mejs.serbian': 'Serbian',
27391             'mejs.slovak': 'Slovak',
27392             'mejs.slovenian': 'Slovenian',
27393             'mejs.spanish': 'Spanish',
27394             'mejs.swahili': 'Swahili',
27395             'mejs.swedish': 'Swedish',
27396             'mejs.tagalog': 'Tagalog',
27397             'mejs.thai': 'Thai',
27398             'mejs.turkish': 'Turkish',
27399             'mejs.ukrainian': 'Ukrainian',
27400             'mejs.vietnamese': 'Vietnamese',
27401             'mejs.welsh': 'Welsh',
27402             'mejs.yiddish': 'Yiddish'
27403         };
27404
27405     }, {}], 16: [function (_dereq_, module, exports) {
27406         'use strict';
27407
27408         Object.defineProperty(exports, "__esModule", {
27409             value: true
27410         });
27411         exports.config = undefined;
27412
27413         var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
27414
27415         var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
27416
27417         var _window = _dereq_(3);
27418
27419         var _window2 = _interopRequireDefault(_window);
27420
27421         var _document = _dereq_(2);
27422
27423         var _document2 = _interopRequireDefault(_document);
27424
27425         var _mejs = _dereq_(7);
27426
27427         var _mejs2 = _interopRequireDefault(_mejs);
27428
27429         var _mediaelement = _dereq_(6);
27430
27431         var _mediaelement2 = _interopRequireDefault(_mediaelement);
27432
27433         var _default = _dereq_(17);
27434
27435         var _default2 = _interopRequireDefault(_default);
27436
27437         var _i18n = _dereq_(5);
27438
27439         var _i18n2 = _interopRequireDefault(_i18n);
27440
27441         var _constants = _dereq_(25);
27442
27443         var _general = _dereq_(27);
27444
27445         var _time = _dereq_(30);
27446
27447         var _media = _dereq_(28);
27448
27449         var _dom = _dereq_(26);
27450
27451         var dom = _interopRequireWildcard(_dom);
27452
27453         function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
27454
27455         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27456
27457         function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27458
27459         _mejs2.default.mepIndex = 0;
27460
27461         _mejs2.default.players = {};
27462
27463         var config = exports.config = {
27464             poster: '',
27465
27466             showPosterWhenEnded: false,
27467
27468             showPosterWhenPaused: false,
27469
27470             defaultVideoWidth: 480,
27471
27472             defaultVideoHeight: 270,
27473
27474             videoWidth: -1,
27475
27476             videoHeight: -1,
27477
27478             defaultAudioWidth: 400,
27479
27480             defaultAudioHeight: 40,
27481
27482             defaultSeekBackwardInterval: function defaultSeekBackwardInterval(media) {
27483                 return media.getDuration() * 0.05;
27484             },
27485
27486             defaultSeekForwardInterval: function defaultSeekForwardInterval(media) {
27487                 return media.getDuration() * 0.05;
27488             },
27489
27490             setDimensions: true,
27491
27492             audioWidth: -1,
27493
27494             audioHeight: -1,
27495
27496             loop: false,
27497
27498             autoRewind: true,
27499
27500             enableAutosize: true,
27501
27502             timeFormat: '',
27503
27504             alwaysShowHours: false,
27505
27506             showTimecodeFrameCount: false,
27507
27508             framesPerSecond: 25,
27509
27510             alwaysShowControls: false,
27511
27512             hideVideoControlsOnLoad: false,
27513
27514             hideVideoControlsOnPause: false,
27515
27516             clickToPlayPause: true,
27517
27518             controlsTimeoutDefault: 1500,
27519
27520             controlsTimeoutMouseEnter: 2500,
27521
27522             controlsTimeoutMouseLeave: 1000,
27523
27524             iPadUseNativeControls: false,
27525
27526             iPhoneUseNativeControls: false,
27527
27528             AndroidUseNativeControls: false,
27529
27530             features: ['playpause', 'current', 'progress', 'duration', 'tracks', 'volume', 'fullscreen'],
27531
27532             useDefaultControls: false,
27533
27534             isVideo: true,
27535
27536             stretching: 'auto',
27537
27538             classPrefix: 'mejs__',
27539
27540             enableKeyboard: true,
27541
27542             pauseOtherPlayers: true,
27543
27544             secondsDecimalLength: 0,
27545
27546             customError: null,
27547
27548             keyActions: [{
27549                 keys: [32, 179],
27550                 action: function action(player) {
27551
27552                     if (!_constants.IS_FIREFOX) {
27553                         if (player.paused || player.ended) {
27554                             player.play();
27555                         } else {
27556                             player.pause();
27557                         }
27558                     }
27559                 }
27560             }]
27561         };
27562
27563         _mejs2.default.MepDefaults = config;
27564
27565         var MediaElementPlayer = function () {
27566             function MediaElementPlayer(node, o) {
27567                 _classCallCheck(this, MediaElementPlayer);
27568
27569                 var t = this,
27570                     element = typeof node === 'string' ? _document2.default.getElementById(node) : node;
27571
27572                 if (!(t instanceof MediaElementPlayer)) {
27573                     return new MediaElementPlayer(element, o);
27574                 }
27575
27576                 t.node = t.media = element;
27577
27578                 if (!t.node) {
27579                     return;
27580                 }
27581
27582                 if (t.media.player) {
27583                     return t.media.player;
27584                 }
27585
27586                 t.hasFocus = false;
27587
27588                 t.controlsAreVisible = true;
27589
27590                 t.controlsEnabled = true;
27591
27592                 t.controlsTimer = null;
27593
27594                 t.currentMediaTime = 0;
27595
27596                 t.proxy = null;
27597
27598                 if (o === undefined) {
27599                     var options = t.node.getAttribute('data-mejsoptions');
27600                     o = options ? JSON.parse(options) : {};
27601                 }
27602
27603                 t.options = Object.assign({}, config, o);
27604
27605                 if (t.options.loop && !t.media.getAttribute('loop')) {
27606                     t.media.loop = true;
27607                     t.node.loop = true;
27608                 } else if (t.media.loop) {
27609                     t.options.loop = true;
27610                 }
27611
27612                 if (!t.options.timeFormat) {
27613                     t.options.timeFormat = 'mm:ss';
27614                     if (t.options.alwaysShowHours) {
27615                         t.options.timeFormat = 'hh:mm:ss';
27616                     }
27617                     if (t.options.showTimecodeFrameCount) {
27618                         t.options.timeFormat += ':ff';
27619                     }
27620                 }
27621
27622                 (0, _time.calculateTimeFormat)(0, t.options, t.options.framesPerSecond || 25);
27623
27624                 t.id = 'mep_' + _mejs2.default.mepIndex++;
27625
27626                 _mejs2.default.players[t.id] = t;
27627
27628                 t.init();
27629
27630                 return t;
27631             }
27632
27633             _createClass(MediaElementPlayer, [{
27634                 key: 'getElement',
27635                 value: function getElement(element) {
27636                     return element;
27637                 }
27638             }, {
27639                 key: 'init',
27640                 value: function init() {
27641                     var t = this,
27642                         playerOptions = Object.assign({}, t.options, {
27643                             success: function success(media, domNode) {
27644                                 t._meReady(media, domNode);
27645                             },
27646                             error: function error(e) {
27647                                 t._handleError(e);
27648                             }
27649                         }),
27650                         tagName = t.node.tagName.toLowerCase();
27651
27652                     t.isDynamic = tagName !== 'audio' && tagName !== 'video' && tagName !== 'iframe';
27653                     t.isVideo = t.isDynamic ? t.options.isVideo : tagName !== 'audio' && t.options.isVideo;
27654                     t.mediaFiles = null;
27655                     t.trackFiles = null;
27656
27657                     if (_constants.IS_IPAD && t.options.iPadUseNativeControls || _constants.IS_IPHONE && t.options.iPhoneUseNativeControls) {
27658                         t.node.setAttribute('controls', true);
27659
27660                         if (_constants.IS_IPAD && t.node.getAttribute('autoplay')) {
27661                             t.play();
27662                         }
27663                     } else if ((t.isVideo || !t.isVideo && (t.options.features.length || t.options.useDefaultControls)) && !(_constants.IS_ANDROID && t.options.AndroidUseNativeControls)) {
27664                         t.node.removeAttribute('controls');
27665                         var videoPlayerTitle = t.isVideo ? _i18n2.default.t('mejs.video-player') : _i18n2.default.t('mejs.audio-player');
27666
27667                         var offscreen = _document2.default.createElement('span');
27668                         offscreen.className = t.options.classPrefix + 'offscreen';
27669                         offscreen.innerText = videoPlayerTitle;
27670                         t.media.parentNode.insertBefore(offscreen, t.media);
27671
27672                         t.container = _document2.default.createElement('div');
27673                         t.getElement(t.container).id = t.id;
27674                         t.getElement(t.container).className = t.options.classPrefix + 'container ' + t.options.classPrefix + 'container-keyboard-inactive ' + t.media.className;
27675                         t.getElement(t.container).tabIndex = 0;
27676                         t.getElement(t.container).setAttribute('role', 'application');
27677                         t.getElement(t.container).setAttribute('aria-label', videoPlayerTitle);
27678                         t.getElement(t.container).innerHTML = '<div class="' + t.options.classPrefix + 'inner">' + ('<div class="' + t.options.classPrefix + 'mediaelement"></div>') + ('<div class="' + t.options.classPrefix + 'layers"></div>') + ('<div class="' + t.options.classPrefix + 'controls"></div>') + '</div>';
27679                         t.getElement(t.container).addEventListener('focus', function (e) {
27680                             if (!t.controlsAreVisible && !t.hasFocus && t.controlsEnabled) {
27681                                 t.showControls(true);
27682
27683                                 var btnSelector = (0, _general.isNodeAfter)(e.relatedTarget, t.getElement(t.container)) ? '.' + t.options.classPrefix + 'controls .' + t.options.classPrefix + 'button:last-child > button' : '.' + t.options.classPrefix + 'playpause-button > button',
27684                                     button = t.getElement(t.container).querySelector(btnSelector);
27685
27686                                 button.focus();
27687                             }
27688                         });
27689                         t.node.parentNode.insertBefore(t.getElement(t.container), t.node);
27690
27691                         if (!t.options.features.length && !t.options.useDefaultControls) {
27692                             t.getElement(t.container).style.background = 'transparent';
27693                             t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'controls').style.display = 'none';
27694                         }
27695
27696                         if (t.isVideo && t.options.stretching === 'fill' && !dom.hasClass(t.getElement(t.container).parentNode, t.options.classPrefix + 'fill-container')) {
27697                             t.outerContainer = t.media.parentNode;
27698
27699                             var wrapper = _document2.default.createElement('div');
27700                             wrapper.className = t.options.classPrefix + 'fill-container';
27701                             t.getElement(t.container).parentNode.insertBefore(wrapper, t.getElement(t.container));
27702                             wrapper.appendChild(t.getElement(t.container));
27703                         }
27704
27705                         if (_constants.IS_ANDROID) {
27706                             dom.addClass(t.getElement(t.container), t.options.classPrefix + 'android');
27707                         }
27708                         if (_constants.IS_IOS) {
27709                             dom.addClass(t.getElement(t.container), t.options.classPrefix + 'ios');
27710                         }
27711                         if (_constants.IS_IPAD) {
27712                             dom.addClass(t.getElement(t.container), t.options.classPrefix + 'ipad');
27713                         }
27714                         if (_constants.IS_IPHONE) {
27715                             dom.addClass(t.getElement(t.container), t.options.classPrefix + 'iphone');
27716                         }
27717                         dom.addClass(t.getElement(t.container), t.isVideo ? t.options.classPrefix + 'video' : t.options.classPrefix + 'audio');
27718
27719                         t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'mediaelement').appendChild(t.node);
27720
27721                         t.media.player = t;
27722
27723                         t.controls = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'controls');
27724                         t.layers = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'layers');
27725
27726                         var tagType = t.isVideo ? 'video' : 'audio',
27727                             capsTagName = tagType.substring(0, 1).toUpperCase() + tagType.substring(1);
27728
27729                         if (t.options[tagType + 'Width'] > 0 || t.options[tagType + 'Width'].toString().indexOf('%') > -1) {
27730                             t.width = t.options[tagType + 'Width'];
27731                         } else if (t.node.style.width !== '' && t.node.style.width !== null) {
27732                             t.width = t.node.style.width;
27733                         } else if (t.node.getAttribute('width')) {
27734                             t.width = t.node.getAttribute('width');
27735                         } else {
27736                             t.width = t.options['default' + capsTagName + 'Width'];
27737                         }
27738
27739                         if (t.options[tagType + 'Height'] > 0 || t.options[tagType + 'Height'].toString().indexOf('%') > -1) {
27740                             t.height = t.options[tagType + 'Height'];
27741                         } else if (t.node.style.height !== '' && t.node.style.height !== null) {
27742                             t.height = t.node.style.height;
27743                         } else if (t.node.getAttribute('height')) {
27744                             t.height = t.node.getAttribute('height');
27745                         } else {
27746                             t.height = t.options['default' + capsTagName + 'Height'];
27747                         }
27748
27749                         t.initialAspectRatio = t.height >= t.width ? t.width / t.height : t.height / t.width;
27750
27751                         t.setPlayerSize(t.width, t.height);
27752
27753                         playerOptions.pluginWidth = t.width;
27754                         playerOptions.pluginHeight = t.height;
27755                     } else if (!t.isVideo && !t.options.features.length && !t.options.useDefaultControls) {
27756                         t.node.style.display = 'none';
27757                     }
27758
27759                     _mejs2.default.MepDefaults = playerOptions;
27760
27761                     new _mediaelement2.default(t.media, playerOptions, t.mediaFiles);
27762
27763                     if (t.getElement(t.container) !== undefined && t.options.features.length && t.controlsAreVisible && !t.options.hideVideoControlsOnLoad) {
27764                         var event = (0, _general.createEvent)('controlsshown', t.getElement(t.container));
27765                         t.getElement(t.container).dispatchEvent(event);
27766                     }
27767                 }
27768             }, {
27769                 key: 'showControls',
27770                 value: function showControls(doAnimation) {
27771                     var t = this;
27772
27773                     doAnimation = doAnimation === undefined || doAnimation;
27774
27775                     if (t.controlsAreVisible || !t.isVideo) {
27776                         return;
27777                     }
27778
27779                     if (doAnimation) {
27780                         (function () {
27781                             dom.fadeIn(t.getElement(t.controls), 200, function () {
27782                                 dom.removeClass(t.getElement(t.controls), t.options.classPrefix + 'offscreen');
27783                                 var event = (0, _general.createEvent)('controlsshown', t.getElement(t.container));
27784                                 t.getElement(t.container).dispatchEvent(event);
27785                             });
27786
27787                             var controls = t.getElement(t.container).querySelectorAll('.' + t.options.classPrefix + 'control');
27788
27789                             var _loop = function _loop(i, total) {
27790                                 dom.fadeIn(controls[i], 200, function () {
27791                                     dom.removeClass(controls[i], t.options.classPrefix + 'offscreen');
27792                                 });
27793                             };
27794
27795                             for (var i = 0, total = controls.length; i < total; i++) {
27796                                 _loop(i, total);
27797                             }
27798                         })();
27799                     } else {
27800                         dom.removeClass(t.getElement(t.controls), t.options.classPrefix + 'offscreen');
27801                         t.getElement(t.controls).style.display = '';
27802                         t.getElement(t.controls).style.opacity = 1;
27803
27804                         var controls = t.getElement(t.container).querySelectorAll('.' + t.options.classPrefix + 'control');
27805                         for (var i = 0, total = controls.length; i < total; i++) {
27806                             dom.removeClass(controls[i], t.options.classPrefix + 'offscreen');
27807                             controls[i].style.display = '';
27808                         }
27809
27810                         var event = (0, _general.createEvent)('controlsshown', t.getElement(t.container));
27811                         t.getElement(t.container).dispatchEvent(event);
27812                     }
27813
27814                     t.controlsAreVisible = true;
27815                     t.setControlsSize();
27816                 }
27817             }, {
27818                 key: 'hideControls',
27819                 value: function hideControls(doAnimation, forceHide) {
27820                     var t = this;
27821
27822                     doAnimation = doAnimation === undefined || doAnimation;
27823
27824                     if (forceHide !== true && (!t.controlsAreVisible || t.options.alwaysShowControls || t.paused && t.readyState === 4 && (!t.options.hideVideoControlsOnLoad && t.currentTime <= 0 || !t.options.hideVideoControlsOnPause && t.currentTime > 0) || t.isVideo && !t.options.hideVideoControlsOnLoad && !t.readyState || t.ended)) {
27825                         return;
27826                     }
27827
27828                     if (doAnimation) {
27829                         (function () {
27830                             dom.fadeOut(t.getElement(t.controls), 200, function () {
27831                                 dom.addClass(t.getElement(t.controls), t.options.classPrefix + 'offscreen');
27832                                 t.getElement(t.controls).style.display = '';
27833                                 var event = (0, _general.createEvent)('controlshidden', t.getElement(t.container));
27834                                 t.getElement(t.container).dispatchEvent(event);
27835                             });
27836
27837                             var controls = t.getElement(t.container).querySelectorAll('.' + t.options.classPrefix + 'control');
27838
27839                             var _loop2 = function _loop2(i, total) {
27840                                 dom.fadeOut(controls[i], 200, function () {
27841                                     dom.addClass(controls[i], t.options.classPrefix + 'offscreen');
27842                                     controls[i].style.display = '';
27843                                 });
27844                             };
27845
27846                             for (var i = 0, total = controls.length; i < total; i++) {
27847                                 _loop2(i, total);
27848                             }
27849                         })();
27850                     } else {
27851                         dom.addClass(t.getElement(t.controls), t.options.classPrefix + 'offscreen');
27852                         t.getElement(t.controls).style.display = '';
27853                         t.getElement(t.controls).style.opacity = 0;
27854
27855                         var controls = t.getElement(t.container).querySelectorAll('.' + t.options.classPrefix + 'control');
27856                         for (var i = 0, total = controls.length; i < total; i++) {
27857                             dom.addClass(controls[i], t.options.classPrefix + 'offscreen');
27858                             controls[i].style.display = '';
27859                         }
27860
27861                         var event = (0, _general.createEvent)('controlshidden', t.getElement(t.container));
27862                         t.getElement(t.container).dispatchEvent(event);
27863                     }
27864
27865                     t.controlsAreVisible = false;
27866                 }
27867             }, {
27868                 key: 'startControlsTimer',
27869                 value: function startControlsTimer(timeout) {
27870                     var t = this;
27871
27872                     timeout = typeof timeout !== 'undefined' ? timeout : t.options.controlsTimeoutDefault;
27873
27874                     t.killControlsTimer('start');
27875
27876                     t.controlsTimer = setTimeout(function () {
27877                         t.hideControls();
27878                         t.killControlsTimer('hide');
27879                     }, timeout);
27880                 }
27881             }, {
27882                 key: 'killControlsTimer',
27883                 value: function killControlsTimer() {
27884                     var t = this;
27885
27886                     if (t.controlsTimer !== null) {
27887                         clearTimeout(t.controlsTimer);
27888                         delete t.controlsTimer;
27889                         t.controlsTimer = null;
27890                     }
27891                 }
27892             }, {
27893                 key: 'disableControls',
27894                 value: function disableControls() {
27895                     var t = this;
27896
27897                     t.killControlsTimer();
27898                     t.controlsEnabled = false;
27899                     t.hideControls(false, true);
27900                 }
27901             }, {
27902                 key: 'enableControls',
27903                 value: function enableControls() {
27904                     var t = this;
27905
27906                     t.controlsEnabled = true;
27907                     t.showControls(false);
27908                 }
27909             }, {
27910                 key: '_setDefaultPlayer',
27911                 value: function _setDefaultPlayer() {
27912                     var t = this;
27913                     if (t.proxy) {
27914                         t.proxy.pause();
27915                     }
27916                     t.proxy = new _default2.default(t);
27917                     t.media.addEventListener('loadedmetadata', function () {
27918                         if (t.getCurrentTime() > 0 && t.currentMediaTime > 0) {
27919                             t.setCurrentTime(t.currentMediaTime);
27920                             if (!_constants.IS_IOS && !_constants.IS_ANDROID) {
27921                                 t.play();
27922                             }
27923                         }
27924                     });
27925                 }
27926             }, {
27927                 key: '_meReady',
27928                 value: function _meReady(media, domNode) {
27929                     var t = this,
27930                         autoplayAttr = domNode.getAttribute('autoplay'),
27931                         autoplay = !(autoplayAttr === undefined || autoplayAttr === null || autoplayAttr === 'false'),
27932                         isNative = media.rendererName !== null && /(native|html5)/i.test(t.media.rendererName);
27933
27934                     if (t.getElement(t.controls)) {
27935                         t.enableControls();
27936                     }
27937
27938                     if (t.getElement(t.container) && t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-play')) {
27939                         t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-play').style.display = '';
27940                     }
27941
27942                     if (t.created) {
27943                         return;
27944                     }
27945
27946                     t.created = true;
27947                     t.media = media;
27948                     t.domNode = domNode;
27949
27950                     if (!(_constants.IS_ANDROID && t.options.AndroidUseNativeControls) && !(_constants.IS_IPAD && t.options.iPadUseNativeControls) && !(_constants.IS_IPHONE && t.options.iPhoneUseNativeControls)) {
27951                         if (!t.isVideo && !t.options.features.length && !t.options.useDefaultControls) {
27952                             if (autoplay && isNative) {
27953                                 t.play();
27954                             }
27955
27956                             if (t.options.success) {
27957
27958                                 if (typeof t.options.success === 'string') {
27959                                     _window2.default[t.options.success](t.media, t.domNode, t);
27960                                 } else {
27961                                     t.options.success(t.media, t.domNode, t);
27962                                 }
27963                             }
27964
27965                             return;
27966                         }
27967
27968                         t.featurePosition = {};
27969
27970                         t._setDefaultPlayer();
27971
27972                         t.buildposter(t, t.getElement(t.controls), t.getElement(t.layers), t.media);
27973                         t.buildkeyboard(t, t.getElement(t.controls), t.getElement(t.layers), t.media);
27974                         t.buildoverlays(t, t.getElement(t.controls), t.getElement(t.layers), t.media);
27975
27976                         if (t.options.useDefaultControls) {
27977                             var defaultControls = ['playpause', 'current', 'progress', 'duration', 'tracks', 'volume', 'fullscreen'];
27978                             t.options.features = defaultControls.concat(t.options.features.filter(function (item) {
27979                                 return defaultControls.indexOf(item) === -1;
27980                             }));
27981                         }
27982
27983                         t.buildfeatures(t, t.getElement(t.controls), t.getElement(t.layers), t.media);
27984
27985                         var event = (0, _general.createEvent)('controlsready', t.getElement(t.container));
27986                         t.getElement(t.container).dispatchEvent(event);
27987
27988                         t.setPlayerSize(t.width, t.height);
27989                         t.setControlsSize();
27990
27991                         if (t.isVideo) {
27992                             t.clickToPlayPauseCallback = function () {
27993
27994                                 if (t.options.clickToPlayPause) {
27995                                     var button = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-button'),
27996                                         pressed = button.getAttribute('aria-pressed');
27997
27998                                     if (t.paused && pressed) {
27999                                         t.pause();
28000                                     } else if (t.paused) {
28001                                         t.play();
28002                                     } else {
28003                                         t.pause();
28004                                     }
28005
28006                                     button.setAttribute('aria-pressed', !pressed);
28007                                     t.getElement(t.container).focus();
28008                                 }
28009                             };
28010
28011                             t.createIframeLayer();
28012
28013                             t.media.addEventListener('click', t.clickToPlayPauseCallback);
28014
28015                             if ((_constants.IS_ANDROID || _constants.IS_IOS) && !t.options.alwaysShowControls) {
28016                                 t.node.addEventListener('touchstart', function () {
28017                                     if (t.controlsAreVisible) {
28018                                         t.hideControls(false);
28019                                     } else {
28020                                         if (t.controlsEnabled) {
28021                                             t.showControls(false);
28022                                         }
28023                                     }
28024                                 }, _constants.SUPPORT_PASSIVE_EVENT ? { passive: true } : false);
28025                             } else {
28026                                 t.getElement(t.container).addEventListener('mouseenter', function () {
28027                                     if (t.controlsEnabled) {
28028                                         if (!t.options.alwaysShowControls) {
28029                                             t.killControlsTimer('enter');
28030                                             t.showControls();
28031                                             t.startControlsTimer(t.options.controlsTimeoutMouseEnter);
28032                                         }
28033                                     }
28034                                 });
28035                                 t.getElement(t.container).addEventListener('mousemove', function () {
28036                                     if (t.controlsEnabled) {
28037                                         if (!t.controlsAreVisible) {
28038                                             t.showControls();
28039                                         }
28040                                         if (!t.options.alwaysShowControls) {
28041                                             t.startControlsTimer(t.options.controlsTimeoutMouseEnter);
28042                                         }
28043                                     }
28044                                 });
28045                                 t.getElement(t.container).addEventListener('mouseleave', function () {
28046                                     if (t.controlsEnabled) {
28047                                         if (!t.paused && !t.options.alwaysShowControls) {
28048                                             t.startControlsTimer(t.options.controlsTimeoutMouseLeave);
28049                                         }
28050                                     }
28051                                 });
28052                             }
28053
28054                             if (t.options.hideVideoControlsOnLoad) {
28055                                 t.hideControls(false);
28056                             }
28057
28058                             if (t.options.enableAutosize) {
28059                                 t.media.addEventListener('loadedmetadata', function (e) {
28060                                     var target = e !== undefined ? e.detail.target || e.target : t.media;
28061                                     if (t.options.videoHeight <= 0 && !t.domNode.getAttribute('height') && !t.domNode.style.height && target !== null && !isNaN(target.videoHeight)) {
28062                                         t.setPlayerSize(target.videoWidth, target.videoHeight);
28063                                         t.setControlsSize();
28064                                         t.media.setSize(target.videoWidth, target.videoHeight);
28065                                     }
28066                                 });
28067                             }
28068                         }
28069
28070                         t.media.addEventListener('play', function () {
28071                             t.hasFocus = true;
28072
28073                             for (var playerIndex in _mejs2.default.players) {
28074                                 if (_mejs2.default.players.hasOwnProperty(playerIndex)) {
28075                                     var p = _mejs2.default.players[playerIndex];
28076
28077                                     if (p.id !== t.id && t.options.pauseOtherPlayers && !p.paused && !p.ended && p.options.ignorePauseOtherPlayersOption !== true) {
28078                                         p.pause();
28079                                         p.hasFocus = false;
28080                                     }
28081                                 }
28082                             }
28083
28084                             if (!(_constants.IS_ANDROID || _constants.IS_IOS) && !t.options.alwaysShowControls && t.isVideo) {
28085                                 t.hideControls();
28086                             }
28087                         });
28088
28089                         t.media.addEventListener('ended', function () {
28090                             if (t.options.autoRewind) {
28091                                 try {
28092                                     t.setCurrentTime(0);
28093
28094                                     setTimeout(function () {
28095                                         var loadingElement = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-loading');
28096                                         if (loadingElement && loadingElement.parentNode) {
28097                                             loadingElement.parentNode.style.display = 'none';
28098                                         }
28099                                     }, 20);
28100                                 } catch (exp) {
28101
28102                                 }
28103                             }
28104
28105                             if (typeof t.media.renderer.stop === 'function') {
28106                                 t.media.renderer.stop();
28107                             } else {
28108                                 t.pause();
28109                             }
28110
28111                             if (t.setProgressRail) {
28112                                 t.setProgressRail();
28113                             }
28114                             if (t.setCurrentRail) {
28115                                 t.setCurrentRail();
28116                             }
28117
28118                             if (t.options.loop) {
28119                                 t.play();
28120                             } else if (!t.options.alwaysShowControls && t.controlsEnabled) {
28121                                 t.showControls();
28122                             }
28123                         });
28124
28125                         t.media.addEventListener('loadedmetadata', function () {
28126
28127                             (0, _time.calculateTimeFormat)(t.getDuration(), t.options, t.options.framesPerSecond || 25);
28128
28129                             if (t.updateDuration) {
28130                                 t.updateDuration();
28131                             }
28132                             if (t.updateCurrent) {
28133                                 t.updateCurrent();
28134                             }
28135
28136                             if (!t.isFullScreen) {
28137                                 t.setPlayerSize(t.width, t.height);
28138                                 t.setControlsSize();
28139                             }
28140                         });
28141
28142                         var duration = null;
28143                         t.media.addEventListener('timeupdate', function () {
28144                             if (!isNaN(t.getDuration()) && duration !== t.getDuration()) {
28145                                 duration = t.getDuration();
28146                                 (0, _time.calculateTimeFormat)(duration, t.options, t.options.framesPerSecond || 25);
28147
28148                                 if (t.updateDuration) {
28149                                     t.updateDuration();
28150                                 }
28151                                 if (t.updateCurrent) {
28152                                     t.updateCurrent();
28153                                 }
28154
28155                                 t.setControlsSize();
28156                             }
28157                         });
28158
28159                         t.getElement(t.container).addEventListener('click', function (e) {
28160                             dom.addClass(e.currentTarget, t.options.classPrefix + 'container-keyboard-inactive');
28161                         });
28162
28163                         t.getElement(t.container).addEventListener('focusin', function (e) {
28164                             dom.removeClass(e.currentTarget, t.options.classPrefix + 'container-keyboard-inactive');
28165                             if (t.isVideo && !_constants.IS_ANDROID && !_constants.IS_IOS && t.controlsEnabled && !t.options.alwaysShowControls) {
28166                                 t.killControlsTimer('enter');
28167                                 t.showControls();
28168                                 t.startControlsTimer(t.options.controlsTimeoutMouseEnter);
28169                             }
28170                         });
28171
28172                         t.getElement(t.container).addEventListener('focusout', function (e) {
28173                             setTimeout(function () {
28174                                 if (e.relatedTarget) {
28175                                     if (t.keyboardAction && !e.relatedTarget.closest('.' + t.options.classPrefix + 'container')) {
28176                                         t.keyboardAction = false;
28177                                         if (t.isVideo && !t.options.alwaysShowControls && !t.paused) {
28178                                             t.startControlsTimer(t.options.controlsTimeoutMouseLeave);
28179                                         }
28180                                     }
28181                                 }
28182                             }, 0);
28183                         });
28184
28185                         setTimeout(function () {
28186                             t.setPlayerSize(t.width, t.height);
28187                             t.setControlsSize();
28188                         }, 0);
28189
28190                         t.globalResizeCallback = function () {
28191                             if (!(t.isFullScreen || _constants.HAS_TRUE_NATIVE_FULLSCREEN && _document2.default.webkitIsFullScreen)) {
28192                                 t.setPlayerSize(t.width, t.height);
28193                             }
28194
28195                             t.setControlsSize();
28196                         };
28197
28198                         t.globalBind('resize', t.globalResizeCallback);
28199                     }
28200
28201                     if (autoplay && isNative) {
28202                         t.play();
28203                     }
28204
28205                     if (t.options.success) {
28206                         if (typeof t.options.success === 'string') {
28207                             _window2.default[t.options.success](t.media, t.domNode, t);
28208                         } else {
28209                             t.options.success(t.media, t.domNode, t);
28210                         }
28211                     }
28212                 }
28213             }, {
28214                 key: '_handleError',
28215                 value: function _handleError(e, media, node) {
28216                     var t = this,
28217                         play = t.getElement(t.layers).querySelector('.' + t.options.classPrefix + 'overlay-play');
28218
28219                     if (play) {
28220                         play.style.display = 'none';
28221                     }
28222
28223                     if (t.options.error) {
28224                         t.options.error(e, media, node);
28225                     }
28226
28227                     if (t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'cannotplay')) {
28228                         t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'cannotplay').remove();
28229                     }
28230
28231                     var errorContainer = _document2.default.createElement('div');
28232                     errorContainer.className = t.options.classPrefix + 'cannotplay';
28233                     errorContainer.style.width = '100%';
28234                     errorContainer.style.height = '100%';
28235
28236                     var errorContent = typeof t.options.customError === 'function' ? t.options.customError(t.media, t.media.originalNode) : t.options.customError,
28237                         imgError = '';
28238
28239                     if (!errorContent) {
28240                         var poster = t.media.originalNode.getAttribute('poster');
28241                         if (poster) {
28242                             imgError = '<img src="' + poster + '" alt="' + _mejs2.default.i18n.t('mejs.download-file') + '">';
28243                         }
28244
28245                         if (e.message) {
28246                             errorContent = '<p>' + e.message + '</p>';
28247                         }
28248
28249                         if (e.urls) {
28250                             for (var i = 0, total = e.urls.length; i < total; i++) {
28251                                 var url = e.urls[i];
28252                                 errorContent += '<a href="' + url.src + '" data-type="' + url.type + '"><span>' + _mejs2.default.i18n.t('mejs.download-file') + ': ' + url.src + '</span></a>';
28253                             }
28254                         }
28255                     }
28256
28257                     if (errorContent && t.getElement(t.layers).querySelector('.' + t.options.classPrefix + 'overlay-error')) {
28258                         errorContainer.innerHTML = errorContent;
28259                         t.getElement(t.layers).querySelector('.' + t.options.classPrefix + 'overlay-error').innerHTML = '' + imgError + errorContainer.outerHTML;
28260                         t.getElement(t.layers).querySelector('.' + t.options.classPrefix + 'overlay-error').parentNode.style.display = 'block';
28261                     }
28262
28263                     if (t.controlsEnabled) {
28264                         t.disableControls();
28265                     }
28266                 }
28267             }, {
28268                 key: 'setPlayerSize',
28269                 value: function setPlayerSize(width, height) {
28270                     var t = this;
28271
28272                     if (!t.options.setDimensions) {
28273                         return false;
28274                     }
28275
28276                     if (typeof width !== 'undefined') {
28277                         t.width = width;
28278                     }
28279
28280                     if (typeof height !== 'undefined') {
28281                         t.height = height;
28282                     }
28283
28284                     switch (t.options.stretching) {
28285                         case 'fill':
28286                             if (t.isVideo) {
28287                                 t.setFillMode();
28288                             } else {
28289                                 t.setDimensions(t.width, t.height);
28290                             }
28291                             break;
28292                         case 'responsive':
28293                             t.setResponsiveMode();
28294                             break;
28295                         case 'none':
28296                             t.setDimensions(t.width, t.height);
28297                             break;
28298
28299                         default:
28300                             if (t.hasFluidMode() === true) {
28301                                 t.setResponsiveMode();
28302                             } else {
28303                                 t.setDimensions(t.width, t.height);
28304                             }
28305                             break;
28306                     }
28307                 }
28308             }, {
28309                 key: 'hasFluidMode',
28310                 value: function hasFluidMode() {
28311                     var t = this;
28312
28313                     return t.height.toString().indexOf('%') !== -1 || t.node && t.node.style.maxWidth && t.node.style.maxWidth !== 'none' && t.node.style.maxWidth !== t.width || t.node && t.node.currentStyle && t.node.currentStyle.maxWidth === '100%';
28314                 }
28315             }, {
28316                 key: 'setResponsiveMode',
28317                 value: function setResponsiveMode() {
28318                     var t = this,
28319                         parent = function () {
28320
28321                             var parentEl = void 0,
28322                                 el = t.getElement(t.container);
28323
28324                             while (el) {
28325                                 try {
28326                                     if (_constants.IS_FIREFOX && el.tagName.toLowerCase() === 'html' && _window2.default.self !== _window2.default.top && _window2.default.frameElement !== null) {
28327                                         return _window2.default.frameElement;
28328                                     } else {
28329                                         parentEl = el.parentElement;
28330                                     }
28331                                 } catch (e) {
28332                                     parentEl = el.parentElement;
28333                                 }
28334
28335                                 if (parentEl && dom.visible(parentEl)) {
28336                                     return parentEl;
28337                                 }
28338                                 el = parentEl;
28339                             }
28340
28341                             return null;
28342                         }(),
28343                         parentStyles = parent ? getComputedStyle(parent, null) : getComputedStyle(_document2.default.body, null),
28344                         nativeWidth = function () {
28345                             if (t.isVideo) {
28346                                 if (t.node.videoWidth && t.node.videoWidth > 0) {
28347                                     return t.node.videoWidth;
28348                                 } else if (t.node.getAttribute('width')) {
28349                                     return t.node.getAttribute('width');
28350                                 } else {
28351                                     return t.options.defaultVideoWidth;
28352                                 }
28353                             } else {
28354                                 return t.options.defaultAudioWidth;
28355                             }
28356                         }(),
28357                         nativeHeight = function () {
28358                             if (t.isVideo) {
28359                                 if (t.node.videoHeight && t.node.videoHeight > 0) {
28360                                     return t.node.videoHeight;
28361                                 } else if (t.node.getAttribute('height')) {
28362                                     return t.node.getAttribute('height');
28363                                 } else {
28364                                     return t.options.defaultVideoHeight;
28365                                 }
28366                             } else {
28367                                 return t.options.defaultAudioHeight;
28368                             }
28369                         }(),
28370                         aspectRatio = function () {
28371                             var ratio = 1;
28372                             if (!t.isVideo) {
28373                                 return ratio;
28374                             }
28375
28376                             if (t.node.videoWidth && t.node.videoWidth > 0 && t.node.videoHeight && t.node.videoHeight > 0) {
28377                                 ratio = t.height >= t.width ? t.node.videoWidth / t.node.videoHeight : t.node.videoHeight / t.node.videoWidth;
28378                             } else {
28379                                 ratio = t.initialAspectRatio;
28380                             }
28381
28382                             if (isNaN(ratio) || ratio < 0.01 || ratio > 100) {
28383                                 ratio = 1;
28384                             }
28385
28386                             return ratio;
28387                         }(),
28388                         parentHeight = parseFloat(parentStyles.height);
28389
28390                     var newHeight = void 0,
28391                         parentWidth = parseFloat(parentStyles.width);
28392
28393                     if (t.isVideo) {
28394                         if (t.height === '100%') {
28395                             newHeight = parseFloat(parentWidth * nativeHeight / nativeWidth, 10);
28396                         } else {
28397                             newHeight = t.height >= t.width ? parseFloat(parentWidth / aspectRatio, 10) : parseFloat(parentWidth * aspectRatio, 10);
28398                         }
28399                     } else {
28400                         newHeight = nativeHeight;
28401                     }
28402
28403                     if (isNaN(newHeight)) {
28404                         newHeight = parentHeight;
28405                     }
28406
28407                     if (t.getElement(t.container).parentNode.length > 0 && t.getElement(t.container).parentNode.tagName.toLowerCase() === 'body') {
28408                         parentWidth = _window2.default.innerWidth || _document2.default.documentElement.clientWidth || _document2.default.body.clientWidth;
28409                         newHeight = _window2.default.innerHeight || _document2.default.documentElement.clientHeight || _document2.default.body.clientHeight;
28410                     }
28411
28412                     if (newHeight && parentWidth) {
28413                         t.getElement(t.container).style.width = parentWidth + 'px';
28414                         t.getElement(t.container).style.height = newHeight + 'px';
28415
28416                         t.node.style.width = '100%';
28417                         t.node.style.height = '100%';
28418
28419                         if (t.isVideo && t.media.setSize) {
28420                             t.media.setSize(parentWidth, newHeight);
28421                         }
28422
28423                         var layerChildren = t.getElement(t.layers).children;
28424                         for (var i = 0, total = layerChildren.length; i < total; i++) {
28425                             layerChildren[i].style.width = '100%';
28426                             layerChildren[i].style.height = '100%';
28427                         }
28428                     }
28429                 }
28430             }, {
28431                 key: 'setFillMode',
28432                 value: function setFillMode() {
28433                     var t = this;
28434                     var isIframe = _window2.default.self !== _window2.default.top && _window2.default.frameElement !== null;
28435                     var parent = function () {
28436                         var parentEl = void 0,
28437                             el = t.getElement(t.container);
28438
28439                         while (el) {
28440                             try {
28441                                 if (_constants.IS_FIREFOX && el.tagName.toLowerCase() === 'html' && _window2.default.self !== _window2.default.top && _window2.default.frameElement !== null) {
28442                                     return _window2.default.frameElement;
28443                                 } else {
28444                                     parentEl = el.parentElement;
28445                                 }
28446                             } catch (e) {
28447                                 parentEl = el.parentElement;
28448                             }
28449
28450                             if (parentEl && dom.visible(parentEl)) {
28451                                 return parentEl;
28452                             }
28453                             el = parentEl;
28454                         }
28455
28456                         return null;
28457                     }();
28458                     var parentStyles = parent ? getComputedStyle(parent, null) : getComputedStyle(_document2.default.body, null);
28459
28460                     if (t.node.style.height !== 'none' && t.node.style.height !== t.height) {
28461                         t.node.style.height = 'auto';
28462                     }
28463                     if (t.node.style.maxWidth !== 'none' && t.node.style.maxWidth !== t.width) {
28464                         t.node.style.maxWidth = 'none';
28465                     }
28466
28467                     if (t.node.style.maxHeight !== 'none' && t.node.style.maxHeight !== t.height) {
28468                         t.node.style.maxHeight = 'none';
28469                     }
28470
28471                     if (t.node.currentStyle) {
28472                         if (t.node.currentStyle.height === '100%') {
28473                             t.node.currentStyle.height = 'auto';
28474                         }
28475                         if (t.node.currentStyle.maxWidth === '100%') {
28476                             t.node.currentStyle.maxWidth = 'none';
28477                         }
28478                         if (t.node.currentStyle.maxHeight === '100%') {
28479                             t.node.currentStyle.maxHeight = 'none';
28480                         }
28481                     }
28482
28483                     if (!isIframe && !parseFloat(parentStyles.width)) {
28484                         parent.style.width = t.media.offsetWidth + 'px';
28485                     }
28486
28487                     if (!isIframe && !parseFloat(parentStyles.height)) {
28488                         parent.style.height = t.media.offsetHeight + 'px';
28489                     }
28490
28491                     parentStyles = getComputedStyle(parent);
28492
28493                     var parentWidth = parseFloat(parentStyles.width),
28494                         parentHeight = parseFloat(parentStyles.height);
28495
28496                     t.setDimensions('100%', '100%');
28497
28498                     var poster = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'poster>img');
28499                     if (poster) {
28500                         poster.style.display = '';
28501                     }
28502
28503                     var targetElement = t.getElement(t.container).querySelectorAll('object, embed, iframe, video'),
28504                         initHeight = t.height,
28505                         initWidth = t.width,
28506                         scaleX1 = parentWidth,
28507                         scaleY1 = initHeight * parentWidth / initWidth,
28508                         scaleX2 = initWidth * parentHeight / initHeight,
28509                         scaleY2 = parentHeight,
28510                         bScaleOnWidth = scaleX2 > parentWidth === false,
28511                         finalWidth = bScaleOnWidth ? Math.floor(scaleX1) : Math.floor(scaleX2),
28512                         finalHeight = bScaleOnWidth ? Math.floor(scaleY1) : Math.floor(scaleY2),
28513                         width = bScaleOnWidth ? parentWidth + 'px' : finalWidth + 'px',
28514                         height = bScaleOnWidth ? finalHeight + 'px' : parentHeight + 'px';
28515
28516                     for (var i = 0, total = targetElement.length; i < total; i++) {
28517                         targetElement[i].style.height = height;
28518                         targetElement[i].style.width = width;
28519                         if (t.media.setSize) {
28520                             t.media.setSize(width, height);
28521                         }
28522
28523                         targetElement[i].style.marginLeft = Math.floor((parentWidth - finalWidth) / 2) + 'px';
28524                         targetElement[i].style.marginTop = 0;
28525                     }
28526                 }
28527             }, {
28528                 key: 'setDimensions',
28529                 value: function setDimensions(width, height) {
28530                     var t = this;
28531
28532                     width = (0, _general.isString)(width) && width.indexOf('%') > -1 ? width : parseFloat(width) + 'px';
28533                     height = (0, _general.isString)(height) && height.indexOf('%') > -1 ? height : parseFloat(height) + 'px';
28534
28535                     t.getElement(t.container).style.width = width;
28536                     t.getElement(t.container).style.height = height;
28537
28538                     var layers = t.getElement(t.layers).children;
28539                     for (var i = 0, total = layers.length; i < total; i++) {
28540                         layers[i].style.width = width;
28541                         layers[i].style.height = height;
28542                     }
28543                 }
28544             }, {
28545                 key: 'setControlsSize',
28546                 value: function setControlsSize() {
28547                     var t = this;
28548
28549                     if (!dom.visible(t.getElement(t.container))) {
28550                         return;
28551                     }
28552
28553                     if (t.rail && dom.visible(t.rail)) {
28554                         var totalStyles = t.total ? getComputedStyle(t.total, null) : null,
28555                             totalMargin = totalStyles ? parseFloat(totalStyles.marginLeft) + parseFloat(totalStyles.marginRight) : 0,
28556                             railStyles = getComputedStyle(t.rail),
28557                             railMargin = parseFloat(railStyles.marginLeft) + parseFloat(railStyles.marginRight);
28558
28559                         var siblingsWidth = 0;
28560
28561                         var siblings = dom.siblings(t.rail, function (el) {
28562                             return el !== t.rail;
28563                         }),
28564                             total = siblings.length;
28565                         for (var i = 0; i < total; i++) {
28566                             siblingsWidth += siblings[i].offsetWidth;
28567                         }
28568
28569                         siblingsWidth += totalMargin + (totalMargin === 0 ? railMargin * 2 : railMargin) + 1;
28570
28571                         t.getElement(t.container).style.minWidth = siblingsWidth + 'px';
28572
28573                         var event = (0, _general.createEvent)('controlsresize', t.getElement(t.container));
28574                         t.getElement(t.container).dispatchEvent(event);
28575                     } else {
28576                         var children = t.getElement(t.controls).children;
28577                         var minWidth = 0;
28578
28579                         for (var _i = 0, _total = children.length; _i < _total; _i++) {
28580                             minWidth += children[_i].offsetWidth;
28581                         }
28582
28583                         t.getElement(t.container).style.minWidth = minWidth + 'px';
28584                     }
28585                 }
28586             }, {
28587                 key: 'addControlElement',
28588                 value: function addControlElement(element, key) {
28589
28590                     var t = this;
28591
28592                     if (t.featurePosition[key] !== undefined) {
28593                         var child = t.getElement(t.controls).children[t.featurePosition[key] - 1];
28594                         child.parentNode.insertBefore(element, child.nextSibling);
28595                     } else {
28596                         t.getElement(t.controls).appendChild(element);
28597                         var children = t.getElement(t.controls).children;
28598                         for (var i = 0, total = children.length; i < total; i++) {
28599                             if (element === children[i]) {
28600                                 t.featurePosition[key] = i;
28601                                 break;
28602                             }
28603                         }
28604                     }
28605                 }
28606             }, {
28607                 key: 'createIframeLayer',
28608                 value: function createIframeLayer() {
28609                     var t = this;
28610
vendor: 46,852 bytes, lines 28611-29673
28611                     if (t.isVideo && t.media.rendererName !== null && t.media.rendererName.indexOf('iframe') > -1 && !_document2.default.getElementById(t.media.id + '-iframe-overlay')) {
28612
28613                         var layer = _document2.default.createElement('div'),
28614                             target = _document2.default.getElementById(t.media.id + '_' + t.media.rendererName);
28615
28616                         layer.id = t.media.id + '-iframe-overlay';
28617                         layer.className = t.options.classPrefix + 'iframe-overlay';
28618                         layer.addEventListener('click', function (e) {
28619                             if (t.options.clickToPlayPause) {
28620                                 if (t.paused) {
28621                                     t.play();
28622                                 } else {
28623                                     t.pause();
28624                                 }
28625
28626                                 e.preventDefault();
28627                                 e.stopPropagation();
28628                             }
28629                         });
28630
28631                         target.parentNode.insertBefore(layer, target);
28632                     }
28633                 }
28634             }, {
28635                 key: 'resetSize',
28636                 value: function resetSize() {
28637                     var t = this;
28638
28639                     setTimeout(function () {
28640                         t.setPlayerSize(t.width, t.height);
28641                         t.setControlsSize();
28642                     }, 50);
28643                 }
28644             }, {
28645                 key: 'setPoster',
28646                 value: function setPoster(url) {
28647                     var t = this;
28648
28649                     if (t.getElement(t.container)) {
28650                         var posterDiv = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'poster');
28651
28652                         if (!posterDiv) {
28653                             posterDiv = _document2.default.createElement('div');
28654                             posterDiv.className = t.options.classPrefix + 'poster ' + t.options.classPrefix + 'layer';
28655                             t.getElement(t.layers).appendChild(posterDiv);
28656                         }
28657
28658                         var posterImg = posterDiv.querySelector('img');
28659
28660                         if (!posterImg && url) {
28661                             posterImg = _document2.default.createElement('img');
28662                             posterImg.className = t.options.classPrefix + 'poster-img';
28663                             posterImg.width = '100%';
28664                             posterImg.height = '100%';
28665                             posterDiv.style.display = '';
28666                             posterDiv.appendChild(posterImg);
28667                         }
28668
28669                         if (url) {
28670                             posterImg.setAttribute('src', url);
28671                             posterDiv.style.backgroundImage = 'url("' + url + '")';
28672                             posterDiv.style.display = '';
28673                         } else if (posterImg) {
28674                             posterDiv.style.backgroundImage = 'none';
28675                             posterDiv.style.display = 'none';
28676                             posterImg.remove();
28677                         } else {
28678                             posterDiv.style.display = 'none';
28679                         }
28680                     } else if (_constants.IS_IPAD && t.options.iPadUseNativeControls || _constants.IS_IPHONE && t.options.iPhoneUseNativeControls || _constants.IS_ANDROID && t.options.AndroidUseNativeControls) {
28681                         t.media.originalNode.poster = url;
28682                     }
28683                 }
28684             }, {
28685                 key: 'changeSkin',
28686                 value: function changeSkin(className) {
28687                     var t = this;
28688
28689                     t.getElement(t.container).className = t.options.classPrefix + 'container ' + className;
28690                     t.setPlayerSize(t.width, t.height);
28691                     t.setControlsSize();
28692                 }
28693             }, {
28694                 key: 'globalBind',
28695                 value: function globalBind(events, callback) {
28696                     var t = this,
28697                         doc = t.node ? t.node.ownerDocument : _document2.default;
28698
28699                     events = (0, _general.splitEvents)(events, t.id);
28700                     if (events.d) {
28701                         var eventList = events.d.split(' ');
28702                         for (var i = 0, total = eventList.length; i < total; i++) {
28703                             eventList[i].split('.').reduce(function (part, e) {
28704                                 doc.addEventListener(e, callback, false);
28705                                 return e;
28706                             }, '');
28707                         }
28708                     }
28709                     if (events.w) {
28710                         var _eventList = events.w.split(' ');
28711                         for (var _i2 = 0, _total2 = _eventList.length; _i2 < _total2; _i2++) {
28712                             _eventList[_i2].split('.').reduce(function (part, e) {
28713                                 _window2.default.addEventListener(e, callback, false);
28714                                 return e;
28715                             }, '');
28716                         }
28717                     }
28718                 }
28719             }, {
28720                 key: 'globalUnbind',
28721                 value: function globalUnbind(events, callback) {
28722                     var t = this,
28723                         doc = t.node ? t.node.ownerDocument : _document2.default;
28724
28725                     events = (0, _general.splitEvents)(events, t.id);
28726                     if (events.d) {
28727                         var eventList = events.d.split(' ');
28728                         for (var i = 0, total = eventList.length; i < total; i++) {
28729                             eventList[i].split('.').reduce(function (part, e) {
28730                                 doc.removeEventListener(e, callback, false);
28731                                 return e;
28732                             }, '');
28733                         }
28734                     }
28735                     if (events.w) {
28736                         var _eventList2 = events.w.split(' ');
28737                         for (var _i3 = 0, _total3 = _eventList2.length; _i3 < _total3; _i3++) {
28738                             _eventList2[_i3].split('.').reduce(function (part, e) {
28739                                 _window2.default.removeEventListener(e, callback, false);
28740                                 return e;
28741                             }, '');
28742                         }
28743                     }
28744                 }
28745             }, {
28746                 key: 'buildfeatures',
28747                 value: function buildfeatures(player, controls, layers, media) {
28748                     var t = this;
28749
28750                     for (var i = 0, total = t.options.features.length; i < total; i++) {
28751                         var feature = t.options.features[i];
28752                         if (t['build' + feature]) {
28753                             try {
28754                                 t['build' + feature](player, controls, layers, media);
28755                             } catch (e) {
28756                                 console.error('error building ' + feature, e);
28757                             }
28758                         }
28759                     }
28760                 }
28761             }, {
28762                 key: 'buildposter',
28763                 value: function buildposter(player, controls, layers, media) {
28764                     var t = this,
28765                         poster = _document2.default.createElement('div');
28766
28767                     poster.className = t.options.classPrefix + 'poster ' + t.options.classPrefix + 'layer';
28768                     layers.appendChild(poster);
28769
28770                     var posterUrl = media.originalNode.getAttribute('poster');
28771
28772                     if (player.options.poster !== '') {
28773                         if (posterUrl && _constants.IS_IOS) {
28774                             media.originalNode.removeAttribute('poster');
28775                         }
28776                         posterUrl = player.options.poster;
28777                     }
28778
28779                     if (posterUrl) {
28780                         t.setPoster(posterUrl);
28781                     } else if (t.media.renderer !== null && typeof t.media.renderer.getPosterUrl === 'function') {
28782                         t.setPoster(t.media.renderer.getPosterUrl());
28783                     } else {
28784                         poster.style.display = 'none';
28785                     }
28786
28787                     media.addEventListener('play', function () {
28788                         poster.style.display = 'none';
28789                     });
28790
28791                     media.addEventListener('playing', function () {
28792                         poster.style.display = 'none';
28793                     });
28794
28795                     if (player.options.showPosterWhenEnded && player.options.autoRewind) {
28796                         media.addEventListener('ended', function () {
28797                             poster.style.display = '';
28798                         });
28799                     }
28800
28801                     media.addEventListener('error', function () {
28802                         poster.style.display = 'none';
28803                     });
28804
28805                     if (player.options.showPosterWhenPaused) {
28806                         media.addEventListener('pause', function () {
28807                             if (!player.ended) {
28808                                 poster.style.display = '';
28809                             }
28810                         });
28811                     }
28812                 }
28813             }, {
28814                 key: 'buildoverlays',
28815                 value: function buildoverlays(player, controls, layers, media) {
28816
28817                     if (!player.isVideo) {
28818                         return;
28819                     }
28820
28821                     var t = this,
28822                         loading = _document2.default.createElement('div'),
28823                         error = _document2.default.createElement('div'),
28824                         bigPlay = _document2.default.createElement('div');
28825
28826                     loading.style.display = 'none';
28827                     loading.className = t.options.classPrefix + 'overlay ' + t.options.classPrefix + 'layer';
28828                     loading.innerHTML = '<div class="' + t.options.classPrefix + 'overlay-loading">' + ('<span class="' + t.options.classPrefix + 'overlay-loading-bg-img"></span>') + '</div>';
28829                     layers.appendChild(loading);
28830
28831                     error.style.display = 'none';
28832                     error.className = t.options.classPrefix + 'overlay ' + t.options.classPrefix + 'layer';
28833                     error.innerHTML = '<div class="' + t.options.classPrefix + 'overlay-error"></div>';
28834                     layers.appendChild(error);
28835
28836                     bigPlay.className = t.options.classPrefix + 'overlay ' + t.options.classPrefix + 'layer ' + t.options.classPrefix + 'overlay-play';
28837                     bigPlay.innerHTML = '<div class="' + t.options.classPrefix + 'overlay-button" role="button" tabindex="0" ' + ('aria-label="' + _i18n2.default.t('mejs.play') + '" aria-pressed="false"></div>');
28838                     bigPlay.addEventListener('click', function () {
28839                         if (t.options.clickToPlayPause) {
28840
28841                             var button = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-button'),
28842                                 pressed = button.getAttribute('aria-pressed');
28843
28844                             if (t.paused) {
28845                                 t.play();
28846                             } else {
28847                                 t.pause();
28848                             }
28849
28850                             button.setAttribute('aria-pressed', !!pressed);
28851                             t.getElement(t.container).focus();
28852                         }
28853                     });
28854
28855                     bigPlay.addEventListener('keydown', function (e) {
28856                         var keyPressed = e.keyCode || e.which || 0;
28857
28858                         if (keyPressed === 13 || _constants.IS_FIREFOX && keyPressed === 32) {
28859                             var event = (0, _general.createEvent)('click', bigPlay);
28860                             bigPlay.dispatchEvent(event);
28861                             return false;
28862                         }
28863                     });
28864
28865                     layers.appendChild(bigPlay);
28866
28867                     if (t.media.rendererName !== null && (/(youtube|facebook)/i.test(t.media.rendererName) && !(t.media.originalNode.getAttribute('poster') || player.options.poster || typeof t.media.renderer.getPosterUrl === 'function' && t.media.renderer.getPosterUrl()) || _constants.IS_STOCK_ANDROID || t.media.originalNode.getAttribute('autoplay'))) {
28868                         bigPlay.style.display = 'none';
28869                     }
28870
28871                     var hasError = false;
28872
28873                     media.addEventListener('play', function () {
28874                         bigPlay.style.display = 'none';
28875                         loading.style.display = 'none';
28876                         error.style.display = 'none';
28877                         hasError = false;
28878                     });
28879                     media.addEventListener('playing', function () {
28880                         bigPlay.style.display = 'none';
28881                         loading.style.display = 'none';
28882                         error.style.display = 'none';
28883                         hasError = false;
28884                     });
28885                     media.addEventListener('seeking', function () {
28886                         bigPlay.style.display = 'none';
28887                         loading.style.display = '';
28888                         hasError = false;
28889                     });
28890                     media.addEventListener('seeked', function () {
28891                         bigPlay.style.display = t.paused && !_constants.IS_STOCK_ANDROID ? '' : 'none';
28892                         loading.style.display = 'none';
28893                         hasError = false;
28894                     });
28895                     media.addEventListener('pause', function () {
28896                         loading.style.display = 'none';
28897                         if (!_constants.IS_STOCK_ANDROID && !hasError) {
28898                             bigPlay.style.display = '';
28899                         }
28900                         hasError = false;
28901                     });
28902                     media.addEventListener('waiting', function () {
28903                         loading.style.display = '';
28904                         hasError = false;
28905                     });
28906
28907                     media.addEventListener('loadeddata', function () {
28908                         loading.style.display = '';
28909
28910                         if (_constants.IS_ANDROID) {
28911                             media.canplayTimeout = setTimeout(function () {
28912                                 if (_document2.default.createEvent) {
28913                                     var evt = _document2.default.createEvent('HTMLEvents');
28914                                     evt.initEvent('canplay', true, true);
28915                                     return media.dispatchEvent(evt);
28916                                 }
28917                             }, 300);
28918                         }
28919                         hasError = false;
28920                     });
28921                     media.addEventListener('canplay', function () {
28922                         loading.style.display = 'none';
28923
28924                         clearTimeout(media.canplayTimeout);
28925                         hasError = false;
28926                     });
28927
28928                     media.addEventListener('error', function (e) {
28929                         t._handleError(e, t.media, t.node);
28930                         loading.style.display = 'none';
28931                         bigPlay.style.display = 'none';
28932                         hasError = true;
28933                     });
28934
28935                     media.addEventListener('loadedmetadata', function () {
28936                         if (!t.controlsEnabled) {
28937                             t.enableControls();
28938                         }
28939                     });
28940
28941                     media.addEventListener('keydown', function (e) {
28942                         t.onkeydown(player, media, e);
28943                         hasError = false;
28944                     });
28945                 }
28946             }, {
28947                 key: 'buildkeyboard',
28948                 value: function buildkeyboard(player, controls, layers, media) {
28949
28950                     var t = this;
28951
28952                     t.getElement(t.container).addEventListener('keydown', function () {
28953                         t.keyboardAction = true;
28954                     });
28955
28956                     t.globalKeydownCallback = function (event) {
28957                         var container = _document2.default.activeElement.closest('.' + t.options.classPrefix + 'container'),
28958                             target = t.media.closest('.' + t.options.classPrefix + 'container');
28959                         t.hasFocus = !!(container && target && container.id === target.id);
28960                         return t.onkeydown(player, media, event);
28961                     };
28962
28963                     t.globalClickCallback = function (event) {
28964                         t.hasFocus = !!event.target.closest('.' + t.options.classPrefix + 'container');
28965                     };
28966
28967                     t.globalBind('keydown', t.globalKeydownCallback);
28968
28969                     t.globalBind('click', t.globalClickCallback);
28970                 }
28971             }, {
28972                 key: 'onkeydown',
28973                 value: function onkeydown(player, media, e) {
28974
28975                     if (player.hasFocus && player.options.enableKeyboard) {
28976                         for (var i = 0, total = player.options.keyActions.length; i < total; i++) {
28977                             var keyAction = player.options.keyActions[i];
28978
28979                             for (var j = 0, jl = keyAction.keys.length; j < jl; j++) {
28980                                 if (e.keyCode === keyAction.keys[j]) {
28981                                     keyAction.action(player, media, e.keyCode, e);
28982                                     e.preventDefault();
28983                                     e.stopPropagation();
28984                                     return;
28985                                 }
28986                             }
28987                         }
28988                     }
28989
28990                     return true;
28991                 }
28992             }, {
28993                 key: 'play',
28994                 value: function play() {
28995                     this.proxy.play();
28996                 }
28997             }, {
28998                 key: 'pause',
28999                 value: function pause() {
29000                     this.proxy.pause();
29001                 }
29002             }, {
29003                 key: 'load',
29004                 value: function load() {
29005                     this.proxy.load();
29006                 }
29007             }, {
29008                 key: 'setCurrentTime',
29009                 value: function setCurrentTime(time) {
29010                     this.proxy.setCurrentTime(time);
29011                 }
29012             }, {
29013                 key: 'getCurrentTime',
29014                 value: function getCurrentTime() {
29015                     return this.proxy.currentTime;
29016                 }
29017             }, {
29018                 key: 'getDuration',
29019                 value: function getDuration() {
29020                     return this.proxy.duration;
29021                 }
29022             }, {
29023                 key: 'setVolume',
29024                 value: function setVolume(volume) {
29025                     this.proxy.volume = volume;
29026                 }
29027             }, {
29028                 key: 'getVolume',
29029                 value: function getVolume() {
29030                     return this.proxy.getVolume();
29031                 }
29032             }, {
29033                 key: 'setMuted',
29034                 value: function setMuted(value) {
29035                     this.proxy.setMuted(value);
29036                 }
29037             }, {
29038                 key: 'setSrc',
29039                 value: function setSrc(src) {
29040                     if (!this.controlsEnabled) {
29041                         this.enableControls();
29042                     }
29043                     this.proxy.setSrc(src);
29044                 }
29045             }, {
29046                 key: 'getSrc',
29047                 value: function getSrc() {
29048                     return this.proxy.getSrc();
29049                 }
29050             }, {
29051                 key: 'canPlayType',
29052                 value: function canPlayType(type) {
29053                     return this.proxy.canPlayType(type);
29054                 }
29055             }, {
29056                 key: 'remove',
29057                 value: function remove() {
29058                     var t = this,
29059                         rendererName = t.media.rendererName,
29060                         src = t.media.originalNode.src;
29061
29062                     for (var featureIndex in t.options.features) {
29063                         var feature = t.options.features[featureIndex];
29064                         if (t['clean' + feature]) {
29065                             try {
29066                                 t['clean' + feature](t, t.getElement(t.layers), t.getElement(t.controls), t.media);
29067                             } catch (e) {
29068                                 console.error('error cleaning ' + feature, e);
29069                             }
29070                         }
29071                     }
29072
29073                     var nativeWidth = t.node.getAttribute('width'),
29074                         nativeHeight = t.node.getAttribute('height');
29075
29076                     if (nativeWidth) {
29077                         if (nativeWidth.indexOf('%') === -1) {
29078                             nativeWidth = nativeWidth + 'px';
29079                         }
29080                     } else {
29081                         nativeWidth = 'auto';
29082                     }
29083
29084                     if (nativeHeight) {
29085                         if (nativeHeight.indexOf('%') === -1) {
29086                             nativeHeight = nativeHeight + 'px';
29087                         }
29088                     } else {
29089                         nativeHeight = 'auto';
29090                     }
29091
29092                     t.node.style.width = nativeWidth;
29093                     t.node.style.height = nativeHeight;
29094
29095                     t.setPlayerSize(0, 0);
29096
29097                     if (!t.isDynamic) {
29098                         (function () {
29099                             t.node.setAttribute('controls', true);
29100                             t.node.setAttribute('id', t.node.getAttribute('id').replace('_' + rendererName, '').replace('_from_mejs', ''));
29101                             var poster = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'poster>img');
29102                             if (poster) {
29103                                 t.node.setAttribute('poster', poster.src);
29104                             }
29105
29106                             delete t.node.autoplay;
29107
29108                             t.node.setAttribute('src', '');
29109                             if (t.media.canPlayType((0, _media.getTypeFromFile)(src)) !== '') {
29110                                 t.node.setAttribute('src', src);
29111                             }
29112
29113                             if (rendererName && rendererName.indexOf('iframe') > -1) {
29114                                 var layer = _document2.default.getElementById(t.media.id + '-iframe-overlay');
29115                                 layer.remove();
29116                             }
29117
29118                             var node = t.node.cloneNode();
29119                             node.style.display = '';
29120                             t.getElement(t.container).parentNode.insertBefore(node, t.getElement(t.container));
29121                             t.node.remove();
29122
29123                             if (t.mediaFiles) {
29124                                 for (var i = 0, total = t.mediaFiles.length; i < total; i++) {
29125                                     var source = _document2.default.createElement('source');
29126                                     source.setAttribute('src', t.mediaFiles[i].src);
29127                                     source.setAttribute('type', t.mediaFiles[i].type);
29128                                     node.appendChild(source);
29129                                 }
29130                             }
29131                             if (t.trackFiles) {
29132                                 var _loop3 = function _loop3(_i4, _total4) {
29133                                     var track = t.trackFiles[_i4];
29134                                     var newTrack = _document2.default.createElement('track');
29135                                     newTrack.kind = track.kind;
29136                                     newTrack.label = track.label;
29137                                     newTrack.srclang = track.srclang;
29138                                     newTrack.src = track.src;
29139
29140                                     node.appendChild(newTrack);
29141                                     newTrack.addEventListener('load', function () {
29142                                         this.mode = 'showing';
29143                                         node.textTracks[_i4].mode = 'showing';
29144                                     });
29145                                 };
29146
29147                                 for (var _i4 = 0, _total4 = t.trackFiles.length; _i4 < _total4; _i4++) {
29148                                     _loop3(_i4, _total4);
29149                                 }
29150                             }
29151
29152                             delete t.node;
29153                             delete t.mediaFiles;
29154                             delete t.trackFiles;
29155                         })();
29156                     } else {
29157                         t.getElement(t.container).parentNode.insertBefore(t.node, t.getElement(t.container));
29158                     }
29159
29160                     if (t.media.renderer && typeof t.media.renderer.destroy === 'function') {
29161                         t.media.renderer.destroy();
29162                     }
29163
29164                     delete _mejs2.default.players[t.id];
29165
29166                     if (_typeof(t.getElement(t.container)) === 'object') {
29167                         var offscreen = t.getElement(t.container).parentNode.querySelector('.' + t.options.classPrefix + 'offscreen');
29168                         offscreen.remove();
29169                         t.getElement(t.container).remove();
29170                     }
29171                     t.globalUnbind('resize', t.globalResizeCallback);
29172                     t.globalUnbind('keydown', t.globalKeydownCallback);
29173                     t.globalUnbind('click', t.globalClickCallback);
29174
29175                     delete t.media.player;
29176                 }
29177             }, {
29178                 key: 'paused',
29179                 get: function get() {
29180                     return this.proxy.paused;
29181                 }
29182             }, {
29183                 key: 'muted',
29184                 get: function get() {
29185                     return this.proxy.muted;
29186                 },
29187                 set: function set(muted) {
29188                     this.setMuted(muted);
29189                 }
29190             }, {
29191                 key: 'ended',
29192                 get: function get() {
29193                     return this.proxy.ended;
29194                 }
29195             }, {
29196                 key: 'readyState',
29197                 get: function get() {
29198                     return this.proxy.readyState;
29199                 }
29200             }, {
29201                 key: 'currentTime',
29202                 set: function set(time) {
29203                     this.setCurrentTime(time);
29204                 },
29205                 get: function get() {
29206                     return this.getCurrentTime();
29207                 }
29208             }, {
29209                 key: 'duration',
29210                 get: function get() {
29211                     return this.getDuration();
29212                 }
29213             }, {
29214                 key: 'volume',
29215                 set: function set(volume) {
29216                     this.setVolume(volume);
29217                 },
29218                 get: function get() {
29219                     return this.getVolume();
29220                 }
29221             }, {
29222                 key: 'src',
29223                 set: function set(src) {
29224                     this.setSrc(src);
29225                 },
29226                 get: function get() {
29227                     return this.getSrc();
29228                 }
29229             }]);
29230
29231             return MediaElementPlayer;
29232         }();
29233
29234         _window2.default.MediaElementPlayer = MediaElementPlayer;
29235         _mejs2.default.MediaElementPlayer = MediaElementPlayer;
29236
29237         exports.default = MediaElementPlayer;
29238
29239     }, { "17": 17, "2": 2, "25": 25, "26": 26, "27": 27, "28": 28, "3": 3, "30": 30, "5": 5, "6": 6, "7": 7 }], 17: [function (_dereq_, module, exports) {
29240         'use strict';
29241
29242         Object.defineProperty(exports, "__esModule", {
29243             value: true
29244         });
29245
29246         var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
29247
29248         var _window = _dereq_(3);
29249
29250         var _window2 = _interopRequireDefault(_window);
29251
29252         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29253
29254         function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
29255
29256         var DefaultPlayer = function () {
29257             function DefaultPlayer(player) {
29258                 _classCallCheck(this, DefaultPlayer);
29259
29260                 this.media = player.media;
29261                 this.isVideo = player.isVideo;
29262                 this.classPrefix = player.options.classPrefix;
29263                 this.createIframeLayer = function () {
29264                     return player.createIframeLayer();
29265                 };
29266                 this.setPoster = function (url) {
29267                     return player.setPoster(url);
29268                 };
29269                 return this;
29270             }
29271
29272             _createClass(DefaultPlayer, [{
29273                 key: 'play',
29274                 value: function play() {
29275                     this.media.play();
29276                 }
29277             }, {
29278                 key: 'pause',
29279                 value: function pause() {
29280                     this.media.pause();
29281                 }
29282             }, {
29283                 key: 'load',
29284                 value: function load() {
29285                     var t = this;
29286
29287                     if (!t.isLoaded) {
29288                         t.media.load();
29289                     }
29290
29291                     t.isLoaded = true;
29292                 }
29293             }, {
29294                 key: 'setCurrentTime',
29295                 value: function setCurrentTime(time) {
29296                     this.media.setCurrentTime(time);
29297                 }
29298             }, {
29299                 key: 'getCurrentTime',
29300                 value: function getCurrentTime() {
29301                     return this.media.currentTime;
29302                 }
29303             }, {
29304                 key: 'getDuration',
29305                 value: function getDuration() {
29306                     var duration = this.media.getDuration();
29307                     if (duration === Infinity && this.media.seekable && this.media.seekable.length) {
29308                         duration = this.media.seekable.end(0);
29309                     }
29310                     return duration;
29311                 }
29312             }, {
29313                 key: 'setVolume',
29314                 value: function setVolume(volume) {
29315                     this.media.setVolume(volume);
29316                 }
29317             }, {
29318                 key: 'getVolume',
29319                 value: function getVolume() {
29320                     return this.media.getVolume();
29321                 }
29322             }, {
29323                 key: 'setMuted',
29324                 value: function setMuted(value) {
29325                     this.media.setMuted(value);
29326                 }
29327             }, {
29328                 key: 'setSrc',
29329                 value: function setSrc(src) {
29330                     var t = this,
29331                         layer = document.getElementById(t.media.id + '-iframe-overlay');
29332
29333                     if (layer) {
29334                         layer.remove();
29335                     }
29336
29337                     t.media.setSrc(src);
29338                     t.createIframeLayer();
29339                     if (t.media.renderer !== null && typeof t.media.renderer.getPosterUrl === 'function') {
29340                         t.setPoster(t.media.renderer.getPosterUrl());
29341                     }
29342                 }
29343             }, {
29344                 key: 'getSrc',
29345                 value: function getSrc() {
29346                     return this.media.getSrc();
29347                 }
29348             }, {
29349                 key: 'canPlayType',
29350                 value: function canPlayType(type) {
29351                     return this.media.canPlayType(type);
29352                 }
29353             }, {
29354                 key: 'paused',
29355                 get: function get() {
29356                     return this.media.paused;
29357                 }
29358             }, {
29359                 key: 'muted',
29360                 set: function set(muted) {
29361                     this.setMuted(muted);
29362                 },
29363                 get: function get() {
29364                     return this.media.muted;
29365                 }
29366             }, {
29367                 key: 'ended',
29368                 get: function get() {
29369                     return this.media.ended;
29370                 }
29371             }, {
29372                 key: 'readyState',
29373                 get: function get() {
29374                     return this.media.readyState;
29375                 }
29376             }, {
29377                 key: 'currentTime',
29378                 set: function set(time) {
29379                     this.setCurrentTime(time);
29380                 },
29381                 get: function get() {
29382                     return this.getCurrentTime();
29383                 }
29384             }, {
29385                 key: 'duration',
29386                 get: function get() {
29387                     return this.getDuration();
29388                 }
29389             }, {
29390                 key: 'remainingTime',
29391                 get: function get() {
29392                     return this.getDuration() - this.currentTime();
29393                 }
29394             }, {
29395                 key: 'volume',
29396                 set: function set(volume) {
29397                     this.setVolume(volume);
29398                 },
29399                 get: function get() {
29400                     return this.getVolume();
29401                 }
29402             }, {
29403                 key: 'src',
29404                 set: function set(src) {
29405                     this.setSrc(src);
29406                 },
29407                 get: function get() {
29408                     return this.getSrc();
29409                 }
29410             }]);
29411
29412             return DefaultPlayer;
29413         }();
29414
29415         exports.default = DefaultPlayer;
29416
29417
29418         _window2.default.DefaultPlayer = DefaultPlayer;
29419
29420     }, { "3": 3 }], 18: [function (_dereq_, module, exports) {
29421         'use strict';
29422
29423         var _window = _dereq_(3);
29424
29425         var _window2 = _interopRequireDefault(_window);
29426
29427         var _mejs = _dereq_(7);
29428
29429         var _mejs2 = _interopRequireDefault(_mejs);
29430
29431         var _player = _dereq_(16);
29432
29433         var _player2 = _interopRequireDefault(_player);
29434
29435         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29436
29437         if (typeof jQuery !== 'undefined') {
29438             _mejs2.default.$ = jQuery;
29439         } else if (typeof Zepto !== 'undefined') {
29440             _mejs2.default.$ = Zepto;
29441         } else if (typeof ender !== 'undefined') {
29442             _mejs2.default.$ = ender;
29443         }
29444
29445         (function ($) {
29446             if (typeof $ !== 'undefined') {
29447                 $.fn.mediaelementplayer = function (options) {
29448                     if (options === false) {
29449                         this.each(function () {
29450                             var player = $(this).data('mediaelementplayer');
29451                             if (player) {
29452                                 player.remove();
29453                             }
29454                             $(this).removeData('mediaelementplayer');
29455                         });
29456                     } else {
29457                         this.each(function () {
29458                             $(this).data('mediaelementplayer', new _player2.default(this, options));
29459                         });
29460                     }
29461                     return this;
29462                 };
29463
29464                 $(document).ready(function () {
29465                     $('.' + _mejs2.default.MepDefaults.classPrefix + 'player').mediaelementplayer();
29466                 });
29467             }
29468         })(_mejs2.default.$);
29469
29470     }, { "16": 16, "3": 3, "7": 7 }], 19: [function (_dereq_, module, exports) {
29471         'use strict';
29472
29473         var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
29474
29475         var _window = _dereq_(3);
29476
29477         var _window2 = _interopRequireDefault(_window);
29478
29479         var _mejs = _dereq_(7);
29480
29481         var _mejs2 = _interopRequireDefault(_mejs);
29482
29483         var _renderer = _dereq_(8);
29484
29485         var _general = _dereq_(27);
29486
29487         var _media = _dereq_(28);
29488
29489         var _constants = _dereq_(25);
29490
29491         var _dom = _dereq_(26);
29492
29493         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29494
29495         var NativeDash = {
29496
29497             promise: null,
29498
29499             load: function load(settings) {
29500                 if (typeof dashjs !== 'undefined') {
29501                     NativeDash.promise = new Promise(function (resolve) {
29502                         resolve();
29503                     }).then(function () {
29504                         NativeDash._createPlayer(settings);
29505                     });
29506                 } else {
29507                     settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.dashjs.org/latest/dash.all.min.js';
29508
29509                     NativeDash.promise = NativeDash.promise || (0, _dom.loadScript)(settings.options.path);
29510                     NativeDash.promise.then(function () {
29511                         NativeDash._createPlayer(settings);
29512                     });
29513                 }
29514
29515                 return NativeDash.promise;
29516             },
29517
29518             _createPlayer: function _createPlayer(settings) {
29519                 var player = dashjs.MediaPlayer().create();
29520                 _window2.default['__ready__' + settings.id](player);
29521                 return player;
29522             }
29523         };
29524
29525         var DashNativeRenderer = {
29526             name: 'native_dash',
29527             options: {
29528                 prefix: 'native_dash',
29529                 dash: {
29530                     path: 'https://cdn.dashjs.org/latest/dash.all.min.js',
29531                     debug: false,
29532                     drm: {},
29533
29534                     robustnessLevel: ''
29535                 }
29536             },
29537
29538             canPlayType: function canPlayType(type) {
29539                 return _constants.HAS_MSE && ['application/dash+xml'].indexOf(type.toLowerCase()) > -1;
29540             },
29541
29542             create: function create(mediaElement, options, mediaFiles) {
29543
29544                 var originalNode = mediaElement.originalNode,
29545                     id = mediaElement.id + '_' + options.prefix,
29546                     autoplay = originalNode.autoplay,
29547                     children = originalNode.children;
29548
29549                 var node = null,
29550                     dashPlayer = null;
29551
29552                 originalNode.removeAttribute('type');
29553                 for (var i = 0, total = children.length; i < total; i++) {
29554                     children[i].removeAttribute('type');
29555                 }
29556
29557                 node = originalNode.cloneNode(true);
29558                 options = Object.assign(options, mediaElement.options);
29559
29560                 var props = _mejs2.default.html5media.properties,
29561                     events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) {
29562                         return e !== 'error';
29563                     }),
29564                     attachNativeEvents = function attachNativeEvents(e) {
29565                         var event = (0, _general.createEvent)(e.type, mediaElement);
29566                         mediaElement.dispatchEvent(event);
29567                     },
29568                     assignGettersSetters = function assignGettersSetters(propName) {
29569                         var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
29570
29571                         node['get' + capName] = function () {
29572                             return dashPlayer !== null ? node[propName] : null;
29573                         };
29574
29575                         node['set' + capName] = function (value) {
29576                             if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
29577                                 if (propName === 'src') {
29578                                     var source = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value;
29579                                     node[propName] = source;
29580                                     if (dashPlayer !== null) {
29581                                         dashPlayer.reset();
29582                                         for (var _i = 0, _total = events.length; _i < _total; _i++) {
29583                                             node.removeEventListener(events[_i], attachNativeEvents);
29584                                         }
29585                                         dashPlayer = NativeDash._createPlayer({
29586                                             options: options.dash,
29587                                             id: id
29588                                         });
29589
29590                                         if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && _typeof(value.drm) === 'object') {
29591                                             dashPlayer.setProtectionData(value.drm);
29592                                             if ((0, _general.isString)(options.dash.robustnessLevel) && options.dash.robustnessLevel) {
29593                                                 dashPlayer.getProtectionController().setRobustnessLevel(options.dash.robustnessLevel);
29594                                             }
29595                                         }
29596                                         dashPlayer.attachSource(source);
29597                                         if (autoplay) {
29598                                             dashPlayer.play();
29599                                         }
29600                                     }
29601                                 } else {
29602                                     node[propName] = value;
29603                                 }
29604                             }
29605                         };
29606                     };
29607
29608                 for (var _i2 = 0, _total2 = props.length; _i2 < _total2; _i2++) {
29609                     assignGettersSetters(props[_i2]);
29610                 }
29611
29612                 _window2.default['__ready__' + id] = function (_dashPlayer) {
29613                     mediaElement.dashPlayer = dashPlayer = _dashPlayer;
29614
29615                     var dashEvents = dashjs.MediaPlayer.events,
29616                         assignEvents = function assignEvents(eventName) {
29617                             if (eventName === 'loadedmetadata') {
29618                                 dashPlayer.initialize();
29619                                 dashPlayer.attachView(node);
29620                                 dashPlayer.setAutoPlay(false);
29621
29622                                 if (_typeof(options.dash.drm) === 'object' && !_mejs2.default.Utils.isObjectEmpty(options.dash.drm)) {
29623                                     dashPlayer.setProtectionData(options.dash.drm);
29624                                     if ((0, _general.isString)(options.dash.robustnessLevel) && options.dash.robustnessLevel) {
29625                                         dashPlayer.getProtectionController().setRobustnessLevel(options.dash.robustnessLevel);
29626                                     }
29627                                 }
29628                                 dashPlayer.attachSource(node.getSrc());
29629                             }
29630
29631                             node.addEventListener(eventName, attachNativeEvents);
29632                         };
29633
29634                     for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
29635                         assignEvents(events[_i3]);
29636                     }
29637
29638                     var assignMdashEvents = function assignMdashEvents(e) {
29639                         if (e.type.toLowerCase() === 'error') {
29640                             mediaElement.generateError(e.message, node.src);
29641                             console.error(e);
29642                         } else {
29643                             var _event = (0, _general.createEvent)(e.type, mediaElement);
29644                             _event.data = e;
29645                             mediaElement.dispatchEvent(_event);
29646                         }
29647                     };
29648
29649                     for (var eventType in dashEvents) {
29650                         if (dashEvents.hasOwnProperty(eventType)) {
29651                             dashPlayer.on(dashEvents[eventType], function (e) {
29652                                 return assignMdashEvents(e);
29653                             });
29654                         }
29655                     }
29656                 };
29657
29658                 if (mediaFiles && mediaFiles.length > 0) {
29659                     for (var _i4 = 0, _total4 = mediaFiles.length; _i4 < _total4; _i4++) {
29660                         if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i4].type)) {
29661                             node.setAttribute('src', mediaFiles[_i4].src);
29662                             if (typeof mediaFiles[_i4].drm !== 'undefined') {
29663                                 options.dash.drm = mediaFiles[_i4].drm;
29664                             }
29665                             break;
29666                         }
29667                     }
29668                 }
29669
29670                 node.setAttribute('id', id);
29671
29672                 originalNode.parentNode.insertBefore(node, originalNode);
29673                 originalNode.autoplay = false;
29674                 originalNode.style.display = 'none';
29675
29676                 node.setSize = function (width, height) {
29677                     node.style.width = width + 'px';
29678                     node.style.height = height + 'px';
29679                     return node;
29680                 };
29681
29682                 node.hide = function () {
29683                     node.pause();
29684                     node.style.display = 'none';
29685                     return node;
29686                 };
29687
29688                 node.show = function () {
29689                     node.style.display = '';
29690                     return node;
29691                 };
29692
29693                 node.destroy = function () {
29694                     if (dashPlayer !== null) {
29695                         dashPlayer.reset();
29696                     }
29697                 };
29698
29699                 var event = (0, _general.createEvent)('rendererready', node);
29700                 mediaElement.dispatchEvent(event);
29701
29702                 mediaElement.promises.push(NativeDash.load({
29703                     options: options.dash,
29704                     id: id
29705                 }));
29706
29707                 return node;
29708             }
29709         };
29710
29711         _media.typeChecks.push(function (url) {
29712             return ~url.toLowerCase().indexOf('.mpd') ? 'application/dash+xml' : null;
29713         });
29714
29715         _renderer.renderer.add(DashNativeRenderer);
29716
29717     }, { "25": 25, "26": 26, "27": 27, "28": 28, "3": 3, "7": 7, "8": 8 }], 20: [function (_dereq_, module, exports) {
29718         'use strict';
29719
29720         Object.defineProperty(exports, "__esModule", {
29721             value: true
29722         });
29723         exports.PluginDetector = undefined;
29724
29725         var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
29726
29727         var _window = _dereq_(3);
29728
29729         var _window2 = _interopRequireDefault(_window);
29730
29731         var _document = _dereq_(2);
29732
29733         var _document2 = _interopRequireDefault(_document);
29734
29735         var _mejs = _dereq_(7);
29736
29737         var _mejs2 = _interopRequireDefault(_mejs);
29738
29739         var _i18n = _dereq_(5);
29740
29741         var _i18n2 = _interopRequireDefault(_i18n);
29742
29743         var _renderer = _dereq_(8);
29744
29745         var _general = _dereq_(27);
29746
29747         var _constants = _dereq_(25);
29748
29749         var _media = _dereq_(28);
29750
29751         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29752
29753         var PluginDetector = exports.PluginDetector = {
29754             plugins: [],
29755
29756             hasPluginVersion: function hasPluginVersion(plugin, v) {
29757                 var pv = PluginDetector.plugins[plugin];
29758                 v[1] = v[1] || 0;
29759                 v[2] = v[2] || 0;
29760                 return pv[0] > v[0] || pv[0] === v[0] && pv[1] > v[1] || pv[0] === v[0] && pv[1] === v[1] && pv[2] >= v[2];
29761             },
29762
29763             addPlugin: function addPlugin(p, pluginName, mimeType, activeX, axDetect) {
29764                 PluginDetector.plugins[p] = PluginDetector.detectPlugin(pluginName, mimeType, activeX, axDetect);
29765             },
29766
29767             detectPlugin: function detectPlugin(pluginName, mimeType, activeX, axDetect) {
29768
29769                 var version = [0, 0, 0],
29770                     description = void 0,
29771                     ax = void 0;
29772
29773                 if (_constants.NAV.plugins !== null && _constants.NAV.plugins !== undefined && _typeof(_constants.NAV.plugins[pluginName]) === 'object') {
29774                     description = _constants.NAV.plugins[pluginName].description;
29775                     if (description && !(typeof _constants.NAV.mimeTypes !== 'undefined' && _constants.NAV.mimeTypes[mimeType] && !_constants.NAV.mimeTypes[mimeType].enabledPlugin)) {
29776                         version = description.replace(pluginName, '').replace(/^\s+/, '').replace(/\sr/gi, '.').split('.');
29777                         for (var i = 0, total = version.length; i < total; i++) {
29778                             version[i] = parseInt(version[i].match(/\d+/), 10);
29779                         }
29780                     }
29781                 } else if (_window2.default.ActiveXObject !== undefined) {
29782                     try {
29783                         ax = new ActiveXObject(activeX);
29784                         if (ax) {
29785                             version = axDetect(ax);
29786                         }
29787                     } catch (e) {
29788
29789                     }
29790                 }
29791                 return version;
29792             }
29793         };
29794
29795         PluginDetector.addPlugin('flash', 'Shockwave Flash', 'application/x-shockwave-flash', 'ShockwaveFlash.ShockwaveFlash', function (ax) {
29796             var version = [],
29797                 d = ax.GetVariable("$version");
29798
29799             if (d) {
29800                 d = d.split(" ")[1].split(",");
29801                 version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
29802             }
29803             return version;
29804         });
29805
29806         var FlashMediaElementRenderer = {
29807             create: function create(mediaElement, options, mediaFiles) {
29808
29809                 var flash = {};
29810                 var isActive = false;
29811
29812                 flash.options = options;
29813                 flash.id = mediaElement.id + '_' + flash.options.prefix;
29814                 flash.mediaElement = mediaElement;
29815                 flash.flashState = {};
29816                 flash.flashApi = null;
29817                 flash.flashApiStack = [];
29818
29819                 var props = _mejs2.default.html5media.properties,
29820                     assignGettersSetters = function assignGettersSetters(propName) {
29821                         flash.flashState[propName] = null;
29822
29823                         var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
29824
29825                         flash['get' + capName] = function () {
29826                             if (flash.flashApi !== null) {
29827                                 if (typeof flash.flashApi['get_' + propName] === 'function') {
29828                                     var value = flash.flashApi['get_' + propName]();
29829
29830                                     if (propName === 'buffered') {
29831                                         return {
29832                                             start: function start() {
29833                                                 return 0;
29834                                             },
29835                                             end: function end() {
29836                                                 return value;
29837                                             },
29838                                             length: 1
29839                                         };
29840                                     }
29841                                     return value;
29842                                 } else {
29843                                     return null;
29844                                 }
29845                             } else {
29846                                 return null;
29847                             }
29848                         };
29849
29850                         flash['set' + capName] = function (value) {
29851                             if (propName === 'src') {
29852                                 value = (0, _media.absolutizeUrl)(value);
29853                             }
29854
29855                             if (flash.flashApi !== null && flash.flashApi['set_' + propName] !== undefined) {
29856                                 try {
29857                                     flash.flashApi['set_' + propName](value);
29858                                 } catch (e) {
29859
29860                                 }
29861                             } else {
29862                                 flash.flashApiStack.push({
29863                                     type: 'set',
29864                                     propName: propName,
29865                                     value: value
29866                                 });
29867                             }
29868                         };
29869                     };
29870
29871                 for (var i = 0, total = props.length; i < total; i++) {
29872                     assignGettersSetters(props[i]);
29873                 }
29874
29875                 var methods = _mejs2.default.html5media.methods,
29876                     assignMethods = function assignMethods(methodName) {
29877                         flash[methodName] = function () {
29878                             if (isActive) {
29879                                 if (flash.flashApi !== null) {
29880                                     if (flash.flashApi['fire_' + methodName]) {
29881                                         try {
29882                                             flash.flashApi['fire_' + methodName]();
29883                                         } catch (e) {
29884
29885                                         }
29886                                     } else {
29887
29888                                     }
29889                                 } else {
29890                                     flash.flashApiStack.push({
29891                                         type: 'call',
29892                                         methodName: methodName
29893                                     });
29894                                 }
29895                             }
29896                         };
29897                     };
29898                 methods.push('stop');
29899                 for (var _i = 0, _total = methods.length; _i < _total; _i++) {
29900                     assignMethods(methods[_i]);
29901                 }
29902
29903                 var initEvents = ['rendererready'];
29904
29905                 for (var _i2 = 0, _total2 = initEvents.length; _i2 < _total2; _i2++) {
29906                     var event = (0, _general.createEvent)(initEvents[_i2], flash);
29907                     mediaElement.dispatchEvent(event);
29908                 }
29909
29910                 _window2.default['__ready__' + flash.id] = function () {
29911
29912                     flash.flashReady = true;
29913                     flash.flashApi = _document2.default.getElementById('__' + flash.id);
29914
29915                     if (flash.flashApiStack.length) {
29916                         for (var _i3 = 0, _total3 = flash.flashApiStack.length; _i3 < _total3; _i3++) {
29917                             var stackItem = flash.flashApiStack[_i3];
29918
29919                             if (stackItem.type === 'set') {
29920                                 var propName = stackItem.propName,
29921                                     capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
29922
29923                                 flash['set' + capName](stackItem.value);
29924                             } else if (stackItem.type === 'call') {
29925                                 flash[stackItem.methodName]();
29926                             }
29927                         }
29928                     }
29929                 };
29930
29931                 _window2.default['__event__' + flash.id] = function (eventName, message) {
29932                     var event = (0, _general.createEvent)(eventName, flash);
29933                     if (message) {
29934                         try {
29935                             event.data = JSON.parse(message);
29936                             event.details.data = JSON.parse(message);
29937                         } catch (e) {
29938                             event.message = message;
29939                         }
29940                     }
29941
29942                     flash.mediaElement.dispatchEvent(event);
29943                 };
29944
29945                 flash.flashWrapper = _document2.default.createElement('div');
29946
29947                 if (['always', 'sameDomain'].indexOf(flash.options.shimScriptAccess) === -1) {
29948                     flash.options.shimScriptAccess = 'sameDomain';
29949                 }
29950
29951                 var autoplay = mediaElement.originalNode.autoplay,
29952                     flashVars = ['uid=' + flash.id, 'autoplay=' + autoplay, 'allowScriptAccess=' + flash.options.shimScriptAccess, 'preload=' + (mediaElement.originalNode.getAttribute('preload') || '')],
29953                     isVideo = mediaElement.originalNode !== null && mediaElement.originalNode.tagName.toLowerCase() === 'video',
29954                     flashHeight = isVideo ? mediaElement.originalNode.height : 1,
29955                     flashWidth = isVideo ? mediaElement.originalNode.width : 1;
29956
29957                 if (mediaElement.originalNode.getAttribute('src')) {
29958                     flashVars.push('src=' + mediaElement.originalNode.getAttribute('src'));
29959                 }
29960
29961                 if (flash.options.enablePseudoStreaming === true) {
29962                     flashVars.push('pseudostreamstart=' + flash.options.pseudoStreamingStartQueryParam);
29963                     flashVars.push('pseudostreamtype=' + flash.options.pseudoStreamingType);
29964                 }
29965
29966                 if (flash.options.streamDelimiter) {
29967                     flashVars.push('streamdelimiter=' + encodeURIComponent(flash.options.streamDelimiter));
29968                 }
29969
29970                 if (flash.options.proxyType) {
29971                     flashVars.push('proxytype=' + flash.options.proxyType);
29972                 }
29973
29974                 mediaElement.appendChild(flash.flashWrapper);
29975                 mediaElement.originalNode.style.display = 'none';
29976
29977                 var settings = [];
29978
29979                 if (_constants.IS_IE || _constants.IS_EDGE) {
29980                     var specialIEContainer = _document2.default.createElement('div');
29981                     flash.flashWrapper.appendChild(specialIEContainer);
29982
29983                     if (_constants.IS_EDGE) {
29984                         settings = ['type="application/x-shockwave-flash"', 'data="' + flash.options.pluginPath + flash.options.filename + '"', 'id="__' + flash.id + '"', 'width="' + flashWidth + '"', 'height="' + flashHeight + '\'"'];
29985                     } else {
29986                         settings = ['classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"', 'codebase="//download.macromedia.com/pub/s
29986hockwave/cabs/flash/swflash.cab"', 'id="__' + flash.id + '"', 'width="' + flashWidth + '"', 'height="' + flashHeight + '"'];
29987                     }
29988
29989                     if (!isVideo) {
29990                         settings.push('style="clip: rect(0 0 0 0); position: absolute;"');
29991                     }
29992
29993                     specialIEContainer.outerHTML = '<object ' + settings.join(' ') + '>' + ('<param name="movie" value="' + flash.options.pluginPath + flash.options.filename + '?x=' + new Date() + '" />') + ('<param name="flashvars" value="' + flashVars.join('&amp;') + '" />') + '<param name="quality" value="high" />' + '<param name="bgcolor" value="#000000" />' + '<param name="wmode" value="transparent" />' + ('<param name="allowScriptAccess" value="' + flash.options.shimScriptAccess + '" />') + '<param name="allowFullScreen" value="true" />' + ('<div>' + _i18n2.default.t('mejs.install-flash') + '</div>') + '</object>';
29994                 } else {
29995
29996                     settings = ['id="__' + flash.id + '"', 'name="__' + flash.id + '"', 'play="true"', 'loop="false"', 'quality="high"', 'bgcolor="#000000"', 'wmode="transparent"', 'allowScriptAccess="' + flash.options.shimScriptAccess + '"', 'allowFullScreen="true"', 'type="application/x-shockwave-flash"', 'pluginspage="//www.macromedia.com/go/getflashplayer"', 'src="' + flash.options.pluginPath + flash.options.filename + '"', 'flashvars="' + flashVars.join('&') + '"'];
29997
29998                     if (isVideo) {
29999                         settings.push('width="' + flashWidth + '"');
30000                         settings.push('height="' + flashHeight + '"');
30001                     } else {
30002                         settings.push('style="position: fixed; left: -9999em; top: -9999em;"');
30003                     }
30004
30005                     flash.flashWrapper.innerHTML = '<embed ' + settings.join(' ') + '>';
30006                 }
30007
30008                 flash.flashNode = flash.flashWrapper.lastChild;
30009
30010                 flash.hide = function () {
30011                     isActive = false;
30012                     if (isVideo) {
30013                         flash.flashNode.style.display = 'none';
30014                     }
30015                 };
30016                 flash.show = function () {
30017                     isActive = true;
30018                     if (isVideo) {
30019                         flash.flashNode.style.display = '';
30020                     }
30021                 };
30022                 flash.setSize = function (width, height) {
30023                     flash.flashNode.style.width = width + 'px';
30024                     flash.flashNode.style.height = height + 'px';
30025
30026                     if (flash.flashApi !== null && typeof flash.flashApi.fire_setSize === 'function') {
30027                         flash.flashApi.fire_setSize(width, height);
30028                     }
30029                 };
30030
30031                 flash.destroy = function () {
30032                     flash.flashNode.remove();
30033                 };
30034
30035                 if (mediaFiles && mediaFiles.length > 0) {
30036                     for (var _i4 = 0, _total4 = mediaFiles.length; _i4 < _total4; _i4++) {
30037                         if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i4].type)) {
30038                             flash.setSrc(mediaFiles[_i4].src);
30039                             break;
30040                         }
30041                     }
30042                 }
30043
30044                 return flash;
30045             }
30046         };
30047
30048         var hasFlash = PluginDetector.hasPluginVersion('flash', [10, 0, 0]);
30049
30050         if (hasFlash) {
30051             _media.typeChecks.push(function (url) {
30052                 url = url.toLowerCase();
30053
30054                 if (url.startsWith('rtmp')) {
30055                     if (~url.indexOf('.mp3')) {
30056                         return 'audio/rtmp';
30057                     } else {
30058                         return 'video/rtmp';
30059                     }
30060                 } else if (/\.og(a|g)/i.test(url)) {
30061                     return 'audio/ogg';
30062                 } else if (~url.indexOf('.m3u8')) {
30063                     return 'application/x-mpegURL';
30064                 } else if (~url.indexOf('.mpd')) {
30065                     return 'application/dash+xml';
30066                 } else if (~url.indexOf('.flv')) {
30067                     return 'video/flv';
30068                 } else {
30069                     return null;
30070                 }
30071             });
30072
30073             var FlashMediaElementVideoRenderer = {
30074                 name: 'flash_video',
30075                 options: {
30076                     prefix: 'flash_video',
30077                     filename: 'mediaelement-flash-video.swf',
30078                     enablePseudoStreaming: false,
30079
30080                     pseudoStreamingStartQueryParam: 'start',
30081
30082                     pseudoStreamingType: 'byte',
30083
30084                     proxyType: '',
30085
30086                     streamDelimiter: ''
30087                 },
30088
30089                 canPlayType: function canPlayType(type) {
30090                     return ~['video/mp4', 'video/rtmp', 'audio/rtmp', 'rtmp/mp4', 'audio/mp4', 'video/flv', 'video/x-flv'].indexOf(type.toLowerCase());
30091                 },
30092
30093                 create: FlashMediaElementRenderer.create
30094
30095             };
30096             _renderer.renderer.add(FlashMediaElementVideoRenderer);
30097
30098             var FlashMediaElementHlsVideoRenderer = {
30099                 name: 'flash_hls',
30100                 options: {
30101                     prefix: 'flash_hls',
30102                     filename: 'mediaelement-flash-video-hls.swf'
30103                 },
30104
30105                 canPlayType: function canPlayType(type) {
30106                     return ~['application/x-mpegurl', 'application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase());
30107                 },
30108
30109                 create: FlashMediaElementRenderer.create
30110             };
30111             _renderer.renderer.add(FlashMediaElementHlsVideoRenderer);
30112
30113             var FlashMediaElementMdashVideoRenderer = {
30114                 name: 'flash_dash',
30115                 options: {
30116                     prefix: 'flash_dash',
30117                     filename: 'mediaelement-flash-video-mdash.swf'
30118                 },
30119
30120                 canPlayType: function canPlayType(type) {
30121                     return ~['application/dash+xml'].indexOf(type.toLowerCase());
30122                 },
30123
30124                 create: FlashMediaElementRenderer.create
30125             };
30126             _renderer.renderer.add(FlashMediaElementMdashVideoRenderer);
30127
30128             var FlashMediaElementAudioRenderer = {
30129                 name: 'flash_audio',
30130                 options: {
30131                     prefix: 'flash_audio',
30132                     filename: 'mediaelement-flash-audio.swf'
30133                 },
30134
30135                 canPlayType: function canPlayType(type) {
30136                     return ~['audio/mp3'].indexOf(type.toLowerCase());
30137                 },
30138
30139                 create: FlashMediaElementRenderer.create
30140             };
30141             _renderer.renderer.add(FlashMediaElementAudioRenderer);
30142
30143             var FlashMediaElementAudioOggRenderer = {
30144                 name: 'flash_audio_ogg',
30145                 options: {
30146                     prefix: 'flash_audio_ogg',
30147                     filename: 'mediaelement-flash-audio-ogg.swf'
30148                 },
30149
30150                 canPlayType: function canPlayType(type) {
30151                     return ~['audio/ogg', 'audio/oga', 'audio/ogv'].indexOf(type.toLowerCase());
30152                 },
30153
30154                 create: FlashMediaElementRenderer.create
30155             };
30156             _renderer.renderer.add(FlashMediaElementAudioOggRenderer);
30157         }
30158
30159     }, { "2": 2, "25": 25, "27": 27, "28": 28, "3": 3, "5": 5, "7": 7, "8": 8 }], 21: [function (_dereq_, module, exports) {
30160         'use strict';
30161
30162         var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
30163
30164         var _window = _dereq_(3);
30165
30166         var _window2 = _interopRequireDefault(_window);
30167
30168         var _mejs = _dereq_(7);
30169
30170         var _mejs2 = _interopRequireDefault(_mejs);
30171
30172         var _renderer = _dereq_(8);
30173
30174         var _general = _dereq_(27);
30175
30176         var _constants = _dereq_(25);
30177
30178         var _media = _dereq_(28);
30179
30180         var _dom = _dereq_(26);
30181
30182         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30183
30184         var NativeFlv = {
30185
30186             promise: null,
30187
30188             load: function load(settings) {
30189                 if (typeof flvjs !== 'undefined') {
30190                     NativeFlv.promise = new Promise(function (resolve) {
30191                         resolve();
30192                     }).then(function () {
30193                         NativeFlv._createPlayer(settings);
30194                     });
30195                 } else {
30196                     settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.jsdelivr.net/npm/flv.js@latest';
30197
30198                     NativeFlv.promise = NativeFlv.promise || (0, _dom.loadScript)(settings.options.path);
30199                     NativeFlv.promise.then(function () {
30200                         NativeFlv._createPlayer(settings);
30201                     });
30202                 }
30203
30204                 return NativeFlv.promise;
30205             },
30206
30207             _createPlayer: function _createPlayer(settings) {
30208                 flvjs.LoggingControl.enableDebug = settings.options.debug;
30209                 flvjs.LoggingControl.enableVerbose = settings.options.debug;
30210                 var player = flvjs.createPlayer(settings.options, settings.configs);
30211                 _window2.default['__ready__' + settings.id](player);
30212                 return player;
30213             }
30214         };
30215
30216         var FlvNativeRenderer = {
30217             name: 'native_flv',
30218             options: {
30219                 prefix: 'native_flv',
30220                 flv: {
30221                     path: 'https://cdn.jsdelivr.net/npm/flv.js@latest',
30222
30223                     cors: true,
30224                     debug: false
30225                 }
30226             },
30227
30228             canPlayType: function canPlayType(type) {
30229                 return _constants.HAS_MSE && ['video/x-flv', 'video/flv'].indexOf(type.toLowerCase()) > -1;
30230             },
30231
30232             create: function create(mediaElement, options, mediaFiles) {
30233
30234                 var originalNode = mediaElement.originalNode,
30235                     id = mediaElement.id + '_' + options.prefix;
30236
30237                 var node = null,
30238                     flvPlayer = null;
30239
30240                 node = originalNode.cloneNode(true);
30241                 options = Object.assign(options, mediaElement.options);
30242
30243                 var props = _mejs2.default.html5media.properties,
30244                     events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) {
30245                         return e !== 'error';
30246                     }),
30247                     attachNativeEvents = function attachNativeEvents(e) {
30248                         var event = (0, _general.createEvent)(e.type, mediaElement);
30249                         mediaElement.dispatchEvent(event);
30250                     },
30251                     assignGettersSetters = function assignGettersSetters(propName) {
30252                         var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
30253
30254                         node['get' + capName] = function () {
30255                             return flvPlayer !== null ? node[propName] : null;
30256                         };
30257
30258                         node['set' + capName] = function (value) {
30259                             if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
30260                                 if (propName === 'src') {
30261                                     node[propName] = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value;
30262                                     if (flvPlayer !== null) {
30263                                         var _flvOptions = {};
30264                                         _flvOptions.type = 'flv';
30265                                         _flvOptions.url = value;
30266                                         _flvOptions.cors = options.flv.cors;
30267                                         _flvOptions.debug = options.flv.debug;
30268                                         _flvOptions.path = options.flv.path;
30269                                         var _flvConfigs = options.flv.configs;
30270
30271                                         flvPlayer.destroy();
30272                                         for (var i = 0, total = events.length; i < total; i++) {
30273                                             node.removeEventListener(events[i], attachNativeEvents);
30274                                         }
30275                                         flvPlayer = NativeFlv._createPlayer({
30276                                             options: _flvOptions,
30277                                             configs: _flvConfigs,
30278                                             id: id
30279                                         });
30280                                         flvPlayer.attachMediaElement(node);
30281                                         flvPlayer.load();
30282                                     }
30283                                 } else {
30284                                     node[propName] = value;
30285                                 }
30286                             }
30287                         };
30288                     };
30289
30290                 for (var i = 0, total = props.length; i < total; i++) {
30291                     assignGettersSetters(props[i]);
30292                 }
30293
30294                 _window2.default['__ready__' + id] = function (_flvPlayer) {
30295                     mediaElement.flvPlayer = flvPlayer = _flvPlayer;
30296
30297                     var flvEvents = flvjs.Events,
30298                         assignEvents = function assignEvents(eventName) {
30299                             if (eventName === 'loadedmetadata') {
30300                                 flvPlayer.unload();
30301                                 flvPlayer.detachMediaElement();
30302                                 flvPlayer.attachMediaElement(node);
30303                                 flvPlayer.load();
30304                             }
30305
30306                             node.addEventListener(eventName, attachNativeEvents);
30307                         };
30308
30309                     for (var _i = 0, _total = events.length; _i < _total; _i++) {
30310                         assignEvents(events[_i]);
30311                     }
30312
30313                     var assignFlvEvents = function assignFlvEvents(name, data) {
30314                         if (name === 'error') {
30315                             var message = data[0] + ': ' + data[1] + ' ' + data[2].msg;
30316                             mediaElement.generateError(message, node.src);
30317                         } else {
30318                             var _event = (0, _general.createEvent)(name, mediaElement);
30319                             _event.data = data;
30320                             mediaElement.dispatchEvent(_event);
30321                         }
30322                     };
30323
30324                     var _loop = function _loop(eventType) {
30325                         if (flvEvents.hasOwnProperty(eventType)) {
30326                             flvPlayer.on(flvEvents[eventType], function () {
30327                                 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
30328                                     args[_key] = arguments[_key];
30329                                 }
30330
30331                                 return assignFlvEvents(flvEvents[eventType], args);
30332                             });
30333                         }
30334                     };
30335
30336                     for (var eventType in flvEvents) {
30337                         _loop(eventType);
30338                     }
30339                 };
30340
30341                 if (mediaFiles && mediaFiles.length > 0) {
30342                     for (var _i2 = 0, _total2 = mediaFiles.length; _i2 < _total2; _i2++) {
30343                         if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i2].type)) {
30344                             node.setAttribute('src', mediaFiles[_i2].src);
30345                             break;
30346                         }
30347                     }
30348                 }
30349
30350                 node.setAttribute('id', id);
30351
30352                 originalNode.parentNode.insertBefore(node, originalNode);
30353                 originalNode.autoplay = false;
vendor: 90,151 bytes, lines 30354-32488
30354                 originalNode.style.display = 'none';
30355
30356                 var flvOptions = {};
30357                 flvOptions.type = 'flv';
30358                 flvOptions.url = node.src;
30359                 flvOptions.cors = options.flv.cors;
30360                 flvOptions.debug = options.flv.debug;
30361                 flvOptions.path = options.flv.path;
30362                 var flvConfigs = options.flv.configs;
30363
30364                 node.setSize = function (width, height) {
30365                     node.style.width = width + 'px';
30366                     node.style.height = height + 'px';
30367                     return node;
30368                 };
30369
30370                 node.hide = function () {
30371                     if (flvPlayer !== null) {
30372                         flvPlayer.pause();
30373                     }
30374                     node.style.display = 'none';
30375                     return node;
30376                 };
30377
30378                 node.show = function () {
30379                     node.style.display = '';
30380                     return node;
30381                 };
30382
30383                 node.destroy = function () {
30384                     if (flvPlayer !== null) {
30385                         flvPlayer.destroy();
30386                     }
30387                 };
30388
30389                 var event = (0, _general.createEvent)('rendererready', node);
30390                 mediaElement.dispatchEvent(event);
30391
30392                 mediaElement.promises.push(NativeFlv.load({
30393                     options: flvOptions,
30394                     configs: flvConfigs,
30395                     id: id
30396                 }));
30397
30398                 return node;
30399             }
30400         };
30401
30402         _media.typeChecks.push(function (url) {
30403             return ~url.toLowerCase().indexOf('.flv') ? 'video/flv' : null;
30404         });
30405
30406         _renderer.renderer.add(FlvNativeRenderer);
30407
30408     }, { "25": 25, "26": 26, "27": 27, "28": 28, "3": 3, "7": 7, "8": 8 }], 22: [function (_dereq_, module, exports) {
30409         'use strict';
30410
30411         var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
30412
30413         var _window = _dereq_(3);
30414
30415         var _window2 = _interopRequireDefault(_window);
30416
30417         var _mejs = _dereq_(7);
30418
30419         var _mejs2 = _interopRequireDefault(_mejs);
30420
30421         var _renderer = _dereq_(8);
30422
30423         var _general = _dereq_(27);
30424
30425         var _constants = _dereq_(25);
30426
30427         var _media = _dereq_(28);
30428
30429         var _dom = _dereq_(26);
30430
30431         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30432
30433         var NativeHls = {
30434
30435             promise: null,
30436
30437             load: function load(settings) {
30438                 if (typeof Hls !== 'undefined') {
30439                     NativeHls.promise = new Promise(function (resolve) {
30440                         resolve();
30441                     }).then(function () {
30442                         NativeHls._createPlayer(settings);
30443                     });
30444                 } else {
30445                     settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.jsdelivr.net/npm/hls.js@latest';
30446
30447                     NativeHls.promise = NativeHls.promise || (0, _dom.loadScript)(settings.options.path);
30448                     NativeHls.promise.then(function () {
30449                         NativeHls._createPlayer(settings);
30450                     });
30451                 }
30452
30453                 return NativeHls.promise;
30454             },
30455
30456             _createPlayer: function _createPlayer(settings) {
30457                 var player = new Hls(settings.options);
30458                 _window2.default['__ready__' + settings.id](player);
30459                 return player;
30460             }
30461         };
30462
30463         var HlsNativeRenderer = {
30464             name: 'native_hls',
30465             options: {
30466                 prefix: 'native_hls',
30467                 hls: {
30468                     path: 'https://cdn.jsdelivr.net/npm/hls.js@latest',
30469
30470                     autoStartLoad: false,
30471                     debug: false
30472                 }
30473             },
30474
30475             canPlayType: function canPlayType(type) {
30476                 return _constants.HAS_MSE && ['application/x-mpegurl', 'application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase()) > -1;
30477             },
30478
30479             create: function create(mediaElement, options, mediaFiles) {
30480
30481                 var originalNode = mediaElement.originalNode,
30482                     id = mediaElement.id + '_' + options.prefix,
30483                     preload = originalNode.getAttribute('preload'),
30484                     autoplay = originalNode.autoplay;
30485
30486                 var hlsPlayer = null,
30487                     node = null,
30488                     index = 0,
30489                     total = mediaFiles.length;
30490
30491                 node = originalNode.cloneNode(true);
30492                 options = Object.assign(options, mediaElement.options);
30493                 options.hls.autoStartLoad = preload && preload !== 'none' || autoplay;
30494
30495                 var props = _mejs2.default.html5media.properties,
30496                     events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) {
30497                         return e !== 'error';
30498                     }),
30499                     attachNativeEvents = function attachNativeEvents(e) {
30500                         var event = (0, _general.createEvent)(e.type, mediaElement);
30501                         mediaElement.dispatchEvent(event);
30502                     },
30503                     assignGettersSetters = function assignGettersSetters(propName) {
30504                         var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
30505
30506                         node['get' + capName] = function () {
30507                             return hlsPlayer !== null ? node[propName] : null;
30508                         };
30509
30510                         node['set' + capName] = function (value) {
30511                             if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
30512                                 if (propName === 'src') {
30513                                     node[propName] = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value;
30514                                     if (hlsPlayer !== null) {
30515                                         hlsPlayer.destroy();
30516                                         for (var i = 0, _total = events.length; i < _total; i++) {
30517                                             node.removeEventListener(events[i], attachNativeEvents);
30518                                         }
30519                                         hlsPlayer = NativeHls._createPlayer({
30520                                             options: options.hls,
30521                                             id: id
30522                                         });
30523                                         hlsPlayer.loadSource(value);
30524                                         hlsPlayer.attachMedia(node);
30525                                     }
30526                                 } else {
30527                                     node[propName] = value;
30528                                 }
30529                             }
30530                         };
30531                     };
30532
30533                 for (var i = 0, _total2 = props.length; i < _total2; i++) {
30534                     assignGettersSetters(props[i]);
30535                 }
30536
30537                 _window2.default['__ready__' + id] = function (_hlsPlayer) {
30538                     mediaElement.hlsPlayer = hlsPlayer = _hlsPlayer;
30539                     var hlsEvents = Hls.Events,
30540                         assignEvents = function assignEvents(eventName) {
30541                             if (eventName === 'loadedmetadata') {
30542                                 var url = mediaElement.originalNode.src;
30543                                 hlsPlayer.detachMedia();
30544                                 hlsPlayer.loadSource(url);
30545                                 hlsPlayer.attachMedia(node);
30546                             }
30547
30548                             node.addEventListener(eventName, attachNativeEvents);
30549                         };
30550
30551                     for (var _i = 0, _total3 = events.length; _i < _total3; _i++) {
30552                         assignEvents(events[_i]);
30553                     }
30554
30555                     var recoverDecodingErrorDate = void 0,
30556                         recoverSwapAudioCodecDate = void 0;
30557                     var assignHlsEvents = function assignHlsEvents(name, data) {
30558                         if (name === 'hlsError') {
30559                             console.warn(data);
30560                             data = data[1];
30561
30562                             if (data.fatal) {
30563                                 switch (data.type) {
30564                                     case 'mediaError':
30565                                         var now = new Date().getTime();
30566                                         if (!recoverDecodingErrorDate || now - recoverDecodingErrorDate > 3000) {
30567                                             recoverDecodingErrorDate = new Date().getTime();
30568                                             hlsPlayer.recoverMediaError();
30569                                         } else if (!recoverSwapAudioCodecDate || now - recoverSwapAudioCodecDate > 3000) {
30570                                             recoverSwapAudioCodecDate = new Date().getTime();
30571                                             console.warn('Attempting to swap Audio Codec and recover from media error');
30572                                             hlsPlayer.swapAudioCodec();
30573                                             hlsPlayer.recoverMediaError();
30574                                         } else {
30575                                             var message = 'Cannot recover, last media error recovery failed';
30576                                             mediaElement.generateError(message, node.src);
30577                                             console.error(message);
30578                                         }
30579                                         break;
30580                                     case 'networkError':
30581                                         if (data.details === 'manifestLoadError') {
30582                                             if (index < total && mediaFiles[index + 1] !== undefined) {
30583                                                 node.setSrc(mediaFiles[index++].src);
30584                                                 node.load();
30585                                                 node.play();
30586                                             } else {
30587                                                 var _message = 'Network error';
30588                                                 mediaElement.generateError(_message, mediaFiles);
30589                                                 console.error(_message);
30590                                             }
30591                                         } else {
30592                                             var _message2 = 'Network error';
30593                                             mediaElement.generateError(_message2, mediaFiles);
30594                                             console.error(_message2);
30595                                         }
30596                                         break;
30597                                     default:
30598                                         hlsPlayer.destroy();
30599                                         break;
30600                                 }
30601                                 return;
30602                             }
30603                         }
30604                         var event = (0, _general.createEvent)(name, mediaElement);
30605                         event.data = data;
30606                         mediaElement.dispatchEvent(event);
30607                     };
30608
30609                     var _loop = function _loop(eventType) {
30610                         if (hlsEvents.hasOwnProperty(eventType)) {
30611                             hlsPlayer.on(hlsEvents[eventType], function () {
30612                                 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
30613                                     args[_key] = arguments[_key];
30614                                 }
30615
30616                                 return assignHlsEvents(hlsEvents[eventType], args);
30617                             });
30618                         }
30619                     };
30620
30621                     for (var eventType in hlsEvents) {
30622                         _loop(eventType);
30623                     }
30624                 };
30625
30626                 if (total > 0) {
30627                     for (; index < total; index++) {
30628                         if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[index].type)) {
30629                             node.setAttribute('src', mediaFiles[index].src);
30630                             break;
30631                         }
30632                     }
30633                 }
30634
30635                 if (preload !== 'auto' && !autoplay) {
30636                     node.addEventListener('play', function () {
30637                         if (hlsPlayer !== null) {
30638                             hlsPlayer.startLoad();
30639                         }
30640                     });
30641
30642                     node.addEventListener('pause', function () {
30643                         if (hlsPlayer !== null) {
30644                             hlsPlayer.stopLoad();
30645                         }
30646                     });
30647                 }
30648
30649                 node.setAttribute('id', id);
30650
30651                 originalNode.parentNode.insertBefore(node, originalNode);
30652                 originalNode.autoplay = false;
30653                 originalNode.style.display = 'none';
30654
30655                 node.setSize = function (width, height) {
30656                     node.style.width = width + 'px';
30657                     node.style.height = height + 'px';
30658                     return node;
30659                 };
30660
30661                 node.hide = function () {
30662                     node.pause();
30663                     node.style.display = 'none';
30664                     return node;
30665                 };
30666
30667                 node.show = function () {
30668                     node.style.display = '';
30669                     return node;
30670                 };
30671
30672                 node.destroy = function () {
30673                     if (hlsPlayer !== null) {
30674                         hlsPlayer.stopLoad();
30675                         hlsPlayer.destroy();
30676                     }
30677                 };
30678
30679                 var event = (0, _general.createEvent)('rendererready', node);
30680                 mediaElement.dispatchEvent(event);
30681
30682                 mediaElement.promises.push(NativeHls.load({
30683                     options: options.hls,
30684                     id: id
30685                 }));
30686
30687                 return node;
30688             }
30689         };
30690
30691         _media.typeChecks.push(function (url) {
30692             return ~url.toLowerCase().indexOf('.m3u8') ? 'application/x-mpegURL' : null;
30693         });
30694
30695         _renderer.renderer.add(HlsNativeRenderer);
30696
30697     }, { "25": 25, "26": 26, "27": 27, "28": 28, "3": 3, "7": 7, "8": 8 }], 23: [function (_dereq_, module, exports) {
30698         'use strict';
30699
30700         var _window = _dereq_(3);
30701
30702         var _window2 = _interopRequireDefault(_window);
30703
30704         var _document = _dereq_(2);
30705
30706         var _document2 = _interopRequireDefault(_document);
30707
30708         var _mejs = _dereq_(7);
30709
30710         var _mejs2 = _interopRequireDefault(_mejs);
30711
30712         var _renderer = _dereq_(8);
30713
30714         var _general = _dereq_(27);
30715
30716         var _constants = _dereq_(25);
30717
30718         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30719
30720         var HtmlMediaElement = {
30721             name: 'html5',
30722             options: {
30723                 prefix: 'html5'
30724             },
30725
30726             canPlayType: function canPlayType(type) {
30727
30728                 var mediaElement = _document2.default.createElement('video');
30729
30730                 if (_constants.IS_ANDROID && /\/mp(3|4)$/i.test(type) || ~['application/x-mpegurl', 'vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase()) && _constants.SUPPORTS_NATIVE_HLS) {
30731                     return 'yes';
30732                 } else if (mediaElement.canPlayType) {
30733                     return mediaElement.canPlayType(type.toLowerCase()).replace(/no/, '');
30734                 } else {
30735                     return '';
30736                 }
30737             },
30738
30739             create: function create(mediaElement, options, mediaFiles) {
30740
30741                 var id = mediaElement.id + '_' + options.prefix;
30742                 var isActive = false;
30743
30744                 var node = null;
30745
30746                 if (mediaElement.originalNode === undefined || mediaElement.originalNode === null) {
30747                     node = _document2.default.createElement('audio');
30748                     mediaElement.appendChild(node);
30749                 } else {
30750                     node = mediaElement.originalNode;
30751                 }
30752
30753                 node.setAttribute('id', id);
30754
30755                 var props = _mejs2.default.html5media.properties,
30756                     assignGettersSetters = function assignGettersSetters(propName) {
30757                         var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
30758
30759                         node['get' + capName] = function () {
30760                             return node[propName];
30761                         };
30762
30763                         node['set' + capName] = function (value) {
30764                             if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
30765                                 node[propName] = value;
30766                             }
30767                         };
30768                     };
30769
30770                 for (var i = 0, _total = props.length; i < _total; i++) {
30771                     assignGettersSetters(props[i]);
30772                 }
30773
30774                 var events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) {
30775                     return e !== 'error';
30776                 }),
30777                     assignEvents = function assignEvents(eventName) {
30778                         node.addEventListener(eventName, function (e) {
30779                             if (isActive) {
30780                                 var _event = (0, _general.createEvent)(e.type, e.target);
30781                                 mediaElement.dispatchEvent(_event);
30782                             }
30783                         });
30784                     };
30785
30786                 for (var _i = 0, _total2 = events.length; _i < _total2; _i++) {
30787                     assignEvents(events[_i]);
30788                 }
30789
30790                 node.setSize = function (width, height) {
30791                     node.style.width = width + 'px';
30792                     node.style.height = height + 'px';
30793                     return node;
30794                 };
30795
30796                 node.hide = function () {
30797                     isActive = false;
30798                     node.style.display = 'none';
30799
30800                     return node;
30801                 };
30802
30803                 node.show = function () {
30804                     isActive = true;
30805                     node.style.display = '';
30806
30807                     return node;
30808                 };
30809
30810                 var index = 0,
30811                     total = mediaFiles.length;
30812                 if (total > 0) {
30813                     for (; index < total; index++) {
30814                         if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[index].type)) {
30815                             node.setAttribute('src', mediaFiles[index].src);
30816                             break;
30817                         }
30818                     }
30819                 }
30820
30821                 node.addEventListener('error', function (e) {
30822                     if (e && e.target && e.target.error && e.target.error.code === 4 && isActive) {
30823                         if (index < total && mediaFiles[index + 1] !== undefined) {
30824                             node.src = mediaFiles[index++].src;
30825                             node.load();
30826                             node.play();
30827                         } else {
30828                             mediaElement.generateError('Media error: Format(s) not supported or source(s) not found', mediaFiles);
30829                         }
30830                     }
30831                 });
30832
30833                 var event = (0, _general.createEvent)('rendererready', node);
30834                 mediaElement.dispatchEvent(event);
30835
30836                 return node;
30837             }
30838         };
30839
30840         _window2.default.HtmlMediaElement = _mejs2.default.HtmlMediaElement = HtmlMediaElement;
30841
30842         _renderer.renderer.add(HtmlMediaElement);
30843
30844     }, { "2": 2, "25": 25, "27": 27, "3": 3, "7": 7, "8": 8 }], 24: [function (_dereq_, module, exports) {
30845         'use strict';
30846
30847         var _window = _dereq_(3);
30848
30849         var _window2 = _interopRequireDefault(_window);
30850
30851         var _document = _dereq_(2);
30852
30853         var _document2 = _interopRequireDefault(_document);
30854
30855         var _mejs = _dereq_(7);
30856
30857         var _mejs2 = _interopRequireDefault(_mejs);
30858
30859         var _renderer = _dereq_(8);
30860
30861         var _general = _dereq_(27);
30862
30863         var _media = _dereq_(28);
30864
30865         var _dom = _dereq_(26);
30866
30867         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30868
30869         var YouTubeApi = {
30870             isIframeStarted: false,
30871
30872             isIframeLoaded: false,
30873
30874             iframeQueue: [],
30875
30876             enqueueIframe: function enqueueIframe(settings) {
30877                 YouTubeApi.isLoaded = typeof YT !== 'undefined' && YT.loaded;
30878
30879                 if (YouTubeApi.isLoaded) {
30880                     YouTubeApi.createIframe(settings);
30881                 } else {
30882                     YouTubeApi.loadIframeApi();
30883                     YouTubeApi.iframeQueue.push(settings);
30884                 }
30885             },
30886
30887             loadIframeApi: function loadIframeApi() {
30888                 if (!YouTubeApi.isIframeStarted) {
30889                     (0, _dom.loadScript)('https://www.youtube.com/player_api');
30890                     YouTubeApi.isIframeStarted = true;
30891                 }
30892             },
30893
30894             iFrameReady: function iFrameReady() {
30895
30896                 YouTubeApi.isLoaded = true;
30897                 YouTubeApi.isIframeLoaded = true;
30898
30899                 while (YouTubeApi.iframeQueue.length > 0) {
30900                     var settings = YouTubeApi.iframeQueue.pop();
30901                     YouTubeApi.createIframe(settings);
30902                 }
30903             },
30904
30905             createIframe: function createIframe(settings) {
30906                 return new YT.Player(settings.containerId, settings);
30907             },
30908
30909             getYouTubeId: function getYouTubeId(url) {
30910
30911                 var youTubeId = '';
30912
30913                 if (url.indexOf('?') > 0) {
30914                     youTubeId = YouTubeApi.getYouTubeIdFromParam(url);
30915
30916                     if (youTubeId === '') {
30917                         youTubeId = YouTubeApi.getYouTubeIdFromUrl(url);
30918                     }
30919                 } else {
30920                     youTubeId = YouTubeApi.getYouTubeIdFromUrl(url);
30921                 }
30922
30923                 var id = youTubeId.substring(youTubeId.lastIndexOf('/') + 1);
30924                 youTubeId = id.split('?');
30925                 return youTubeId[0];
30926             },
30927
30928             getYouTubeIdFromParam: function getYouTubeIdFromParam(url) {
30929
30930                 if (url === undefined || url === null || !url.trim().length) {
30931                     return null;
30932                 }
30933
30934                 var parts = url.split('?'),
30935                     parameters = parts[1].split('&');
30936
30937                 var youTubeId = '';
30938
30939                 for (var i = 0, total = parameters.length; i < total; i++) {
30940                     var paramParts = parameters[i].split('=');
30941                     if (paramParts[0] === 'v') {
30942                         youTubeId = paramParts[1];
30943                         break;
30944                     }
30945                 }
30946
30947                 return youTubeId;
30948             },
30949
30950             getYouTubeIdFromUrl: function getYouTubeIdFromUrl(url) {
30951
30952                 if (url === undefined || url === null || !url.trim().length) {
30953                     return null;
30954                 }
30955
30956                 var parts = url.split('?');
30957                 url = parts[0];
30958                 return url.substring(url.lastIndexOf('/') + 1);
30959             },
30960
30961             getYouTubeNoCookieUrl: function getYouTubeNoCookieUrl(url) {
30962                 if (url === undefined || url === null || !url.trim().length || url.indexOf('//www.youtube') === -1) {
30963                     return url;
30964                 }
30965
30966                 var parts = url.split('/');
30967                 parts[2] = parts[2].replace('.com', '-nocookie.com');
30968                 return parts.join('/');
30969             }
30970         };
30971
30972         var YouTubeIframeRenderer = {
30973             name: 'youtube_iframe',
30974
30975             options: {
30976                 prefix: 'youtube_iframe',
30977
30978                 youtube: {
30979                     autoplay: 0,
30980                     controls: 0,
30981                     disablekb: 1,
30982                     end: 0,
30983                     loop: 0,
30984                     modestbranding: 0,
30985                     playsinline: 0,
30986                     rel: 0,
30987                     showinfo: 0,
30988                     start: 0,
30989                     iv_load_policy: 3,
30990
30991                     nocookie: false,
30992
30993                     imageQuality: null
30994                 }
30995             },
30996
30997             canPlayType: function canPlayType(type) {
30998                 return ~['video/youtube', 'video/x-youtube'].indexOf(type.toLowerCase());
30999             },
31000
31001             create: function create(mediaElement, options, mediaFiles) {
31002
31003                 var youtube = {},
31004                     apiStack = [],
31005                     readyState = 4;
31006
31007                 var youTubeApi = null,
31008                     paused = true,
31009                     ended = false,
31010                     youTubeIframe = null,
31011                     volume = 1;
31012
31013                 youtube.options = options;
31014                 youtube.id = mediaElement.id + '_' + options.prefix;
31015                 youtube.mediaElement = mediaElement;
31016
31017                 var props = _mejs2.default.html5media.properties,
31018                     assignGettersSetters = function assignGettersSetters(propName) {
31019
31020                         var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
31021
31022                         youtube['get' + capName] = function () {
31023                             if (youTubeApi !== null) {
31024                                 var value = null;
31025
31026                                 switch (propName) {
31027                                     case 'currentTime':
31028                                         return youTubeApi.getCurrentTime();
31029                                     case 'duration':
31030                                         return youTubeApi.getDuration();
31031                                     case 'volume':
31032                                         volume = youTubeApi.getVolume() / 100;
31033                                         return volume;
31034                                     case 'playbackRate':
31035                                         return youTubeApi.getPlaybackRate();
31036                                     case 'paused':
31037                                         return paused;
31038                                     case 'ended':
31039                                         return ended;
31040                                     case 'muted':
31041                                         return youTubeApi.isMuted();
31042                                     case 'buffered':
31043                                         var percentLoaded = youTubeApi.getVideoLoadedFraction(),
31044                                             duration = youTubeApi.getDuration();
31045                                         return {
31046                                             start: function start() {
31047                                                 return 0;
31048                                             },
31049                                             end: function end() {
31050                                                 return percentLoaded * duration;
31051                                             },
31052                                             length: 1
31053                                         };
31054                                     case 'src':
31055                                         return youTubeApi.getVideoUrl();
31056                                     case 'readyState':
31057                                         return readyState;
31058                                 }
31059
31060                                 return value;
31061                             } else {
31062                                 return null;
31063                             }
31064                         };
31065
31066                         youtube['set' + capName] = function (value) {
31067                             if (youTubeApi !== null) {
31068                                 switch (propName) {
31069                                     case 'src':
31070                                         var url = typeof value === 'string' ? value : value[0].src,
31071                                             _videoId = YouTubeApi.getYouTubeId(url);
31072
31073                                         if (mediaElement.originalNode.autoplay) {
31074                                             youTubeApi.loadVideoById(_videoId);
31075                                         } else {
31076                                             youTubeApi.cueVideoById(_videoId);
31077                                         }
31078                                         break;
31079                                     case 'currentTime':
31080                                         youTubeApi.seekTo(value);
31081                                         break;
31082                                     case 'muted':
31083                                         if (value) {
31084                                             youTubeApi.mute();
31085                                         } else {
31086                                             youTubeApi.unMute();
31087                                         }
31088                                         setTimeout(function () {
31089                                             var event = (0, _general.createEvent)('volumechange', youtube);
31090                                             mediaElement.dispatchEvent(event);
31091                                         }, 50);
31092                                         break;
31093                                     case 'volume':
31094                                         volume = value;
31095                                         youTubeApi.setVolume(value * 100);
31096                                         setTimeout(function () {
31097                                             var event = (0, _general.createEvent)('volumechange', youtube);
31098                                             mediaElement.dispatchEvent(event);
31099                                         }, 50);
31100                                         break;
31101                                     case 'playbackRate':
31102                                         youTubeApi.setPlaybackRate(value);
31103                                         setTimeout(function () {
31104                                             var event = (0, _general.createEvent)('ratechange', youtube);
31105                                             mediaElement.dispatchEvent(event);
31106                                         }, 50);
31107                                         break;
31108                                     case 'readyState':
31109                                         var event = (0, _general.createEvent)('canplay', youtube);
31110                                         mediaElement.dispatchEvent(event);
31111                                         break;
31112                                     default:
31113
31114                                         break;
31115                                 }
31116                             } else {
31117                                 apiStack.push({ type: 'set', propName: propName, value: value });
31118                             }
31119                         };
31120                     };
31121
31122                 for (var i = 0, total = props.length; i < total; i++) {
31123                     assignGettersSetters(props[i]);
31124                 }
31125
31126                 var methods = _mejs2.default.html5media.methods,
31127                     assignMethods = function assignMethods(methodName) {
31128                         youtube[methodName] = function () {
31129                             if (youTubeApi !== null) {
31130                                 switch (methodName) {
31131                                     case 'play':
31132                                         paused = false;
31133                                         return youTubeApi.playVideo();
31134                                     case 'pause':
31135                                         paused = true;
31136                                         return youTubeApi.pauseVideo();
31137                                     case 'load':
31138                                         return null;
31139                                 }
31140                             } else {
31141                                 apiStack.push({ type: 'call', methodName: methodName });
31142                             }
31143                         };
31144                     };
31145
31146                 for (var _i = 0, _total = methods.length; _i < _total; _i++) {
31147                     assignMethods(methods[_i]);
31148                 }
31149
31150                 var errorHandler = function errorHandler(error) {
31151                     var message = '';
31152                     switch (error.data) {
31153                         case 2:
31154                             message = 'The request contains an invalid parameter value. Verify that video ID has 11 characters and that contains no invalid characters, such as exclamation points or asterisks.';
31155                             break;
31156                         case 5:
31157                             message = 'The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.';
31158                             break;
31159                         case 100:
31160                             message = 'The video requested was not found. Either video has been removed or has been marked as private.';
31161                             break;
31162                         case 101:
31163                         case 105:
31164                             message = 'The owner of the requested video does not allow it to be played in embedded players.';
31165                             break;
31166                         default:
31167                             message = 'Unknown error.';
31168                             break;
31169                     }
31170                     mediaElement.generateError('Code ' + error.data + ': ' + message, mediaFiles);
31171                 };
31172
31173                 var youtubeContainer = _document2.default.createElement('div');
31174                 youtubeContainer.id = youtube.id;
31175
31176                 if (youtube.options.youtube.nocookie) {
31177                     mediaElement.originalNode.src = YouTubeApi.getYouTubeNoCookieUrl(mediaFiles[0].src);
31178                 }
31179
31180                 mediaElement.originalNode.parentNode.insertBefore(youtubeContainer, mediaElement.originalNode);
31181                 mediaElement.originalNode.style.display = 'none';
31182
31183                 var isAudio = mediaElement.originalNode.tagName.toLowerCase() === 'audio',
31184                     height = isAudio ? '1' : mediaElement.originalNode.height,
31185                     width = isAudio ? '1' : mediaElement.originalNode.width,
31186                     videoId = YouTubeApi.getYouTubeId(mediaFiles[0].src),
31187                     youtubeSettings = {
31188                         id: youtube.id,
31189                         containerId: youtubeContainer.id,
31190                         videoId: videoId,
31191                         height: height,
31192                         width: width,
31193                         playerVars: Object.assign({
31194                             controls: 0,
31195                             rel: 0,
31196                             disablekb: 1,
31197                             showinfo: 0,
31198                             modestbranding: 0,
31199                             html5: 1,
31200                             iv_load_policy: 3
31201                         }, youtube.options.youtube),
31202                         origin: _window2.default.location.host,
31203                         events: {
31204                             onReady: function onReady(e) {
31205                                 mediaElement.youTubeApi = youTubeApi = e.target;
31206                                 mediaElement.youTubeState = {
31207                                     paused: true,
31208                                     ended: false
31209                                 };
31210
31211                                 if (apiStack.length) {
31212                                     for (var _i2 = 0, _total2 = apiStack.length; _i2 < _total2; _i2++) {
31213
31214                                         var stackItem = apiStack[_i2];
31215
31216                                         if (stackItem.type === 'set') {
31217                                             var propName = stackItem.propName,
31218                                                 capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
31219
31220                                             youtube['set' + capName](stackItem.value);
31221                                         } else if (stackItem.type === 'call') {
31222                                             youtube[stackItem.methodName]();
31223                                         }
31224                                     }
31225                                 }
31226
31227                                 youTubeIframe = youTubeApi.getIframe();
31228
31229                                 if (mediaElement.originalNode.muted) {
31230                                     youTubeApi.mute();
31231                                 }
31232
31233                                 var events = ['mouseover', 'mouseout'],
31234                                     assignEvents = function assignEvents(e) {
31235                                         var newEvent = (0, _general.createEvent)(e.type, youtube);
31236                                         mediaElement.dispatchEvent(newEvent);
31237                                     };
31238
31239                                 for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
31240                                     youTubeIframe.addEventListener(events[_i3], assignEvents, false);
31241                                 }
31242
31243                                 var initEvents = ['rendererready', 'loadedmetadata', 'loadeddata', 'canplay'];
31244
31245                                 for (var _i4 = 0, _total4 = initEvents.length; _i4 < _total4; _i4++) {
31246                                     var event = (0, _general.createEvent)(initEvents[_i4], youtube);
31247                                     mediaElement.dispatchEvent(event);
31248                                 }
31249                             },
31250                             onStateChange: function onStateChange(e) {
31251                                 var events = [];
31252
31253                                 switch (e.data) {
31254                                     case -1:
31255                                         events = ['loadedmetadata'];
31256                                         paused = true;
31257                                         ended = false;
31258                                         break;
31259                                     case 0:
31260                                         events = ['ended'];
31261                                         paused = false;
31262                                         ended = !youtube.options.youtube.loop;
31263                                         if (!youtube.options.youtube.loop) {
31264                                             youtube.stopInterval();
31265                                         }
31266                                         break;
31267                                     case 1:
31268                                         events = ['play', 'playing'];
31269                                         paused = false;
31270                                         ended = false;
31271                                         youtube.startInterval();
31272                                         break;
31273                                     case 2:
31274                                         events = ['pause'];
31275                                         paused = true;
31276                                         ended = false;
31277                                         youtube.stopInterval();
31278                                         break;
31279                                     case 3:
31280                                         events = ['progress'];
31281                                         ended = false;
31282                                         break;
31283                                     case 5:
31284                                         events = ['loadeddata', 'loadedmetadata', 'canplay'];
31285                                         paused = true;
31286                                         ended = false;
31287                                         break;
31288                                 }
31289
31290                                 for (var _i5 = 0, _total5 = events.length; _i5 < _total5; _i5++) {
31291                                     var event = (0, _general.createEvent)(events[_i5], youtube);
31292                                     mediaElement.dispatchEvent(event);
31293                                 }
31294                             },
31295                             onError: function onError(e) {
31296                                 return errorHandler(e);
31297                             }
31298                         }
31299                     };
31300
31301                 if (isAudio || mediaElement.originalNode.hasAttribute('playsinline')) {
31302                     youtubeSettings.playerVars.playsinline = 1;
31303                 }
31304
31305                 if (mediaElement.originalNode.controls) {
31306                     youtubeSettings.playerVars.controls = 1;
31307                 }
31308                 if (mediaElement.originalNode.autoplay) {
31309                     youtubeSettings.playerVars.autoplay = 1;
31310                 }
31311                 if (mediaElement.originalNode.loop) {
31312                     youtubeSettings.playerVars.loop = 1;
31313                 }
31314
31315                 if ((youtubeSettings.playerVars.loop && parseInt(youtubeSettings.playerVars.loop, 10) === 1 || mediaElement.originalNode.src.indexOf('loop=') > -1) && !youtubeSettings.playerVars.playlist && mediaElement.originalNode.src.indexOf('playlist=') === -1) {
31316                     youtubeSettings.playerVars.playlist = YouTubeApi.getYouTubeId(mediaElement.originalNode.src);
31317                 }
31318
31319                 YouTubeApi.enqueueIframe(youtubeSettings);
31320
31321                 youtube.onEvent = function (eventName, player, _youTubeState) {
31322                     if (_youTubeState !== null && _youTubeState !== undefined) {
31323                         mediaElement.youTubeState = _youTubeState;
31324                     }
31325                 };
31326
31327                 youtube.setSize = function (width, height) {
31328                     if (youTubeApi !== null) {
31329                         youTubeApi.setSize(width, height);
31330                     }
31331                 };
31332                 youtube.hide = function () {
31333                     youtube.stopInterval();
31334                     youtube.pause();
31335                     if (youTubeIframe) {
31336                         youTubeIframe.style.display = 'none';
31337                     }
31338                 };
31339                 youtube.show = function () {
31340                     if (youTubeIframe) {
31341                         youTubeIframe.style.display = '';
31342                     }
31343                 };
31344                 youtube.destroy = function () {
31345                     youTubeApi.destroy();
31346                 };
31347                 youtube.interval = null;
31348
31349                 youtube.startInterval = function () {
31350                     youtube.interval = setInterval(function () {
31351                         var event = (0, _general.createEvent)('timeupdate', youtube);
31352                         mediaElement.dispatchEvent(event);
31353                     }, 250);
31354                 };
31355                 youtube.stopInterval = function () {
31356                     if (youtube.interval) {
31357                         clearInterval(youtube.interval);
31358                     }
31359                 };
31360                 youtube.getPosterUrl = function () {
31361                     var quality = options.youtube.imageQuality,
31362                         resolutions = ['default', 'hqdefault', 'mqdefault', 'sddefault', 'maxresdefault'],
31363                         id = YouTubeApi.getYouTubeId(mediaElement.originalNode.src);
31364                     return quality && resolutions.indexOf(quality) > -1 && id ? 'https://img.youtube.com/vi/' + id + '/' + quality + '.jpg' : '';
31365                 };
31366
31367                 return youtube;
31368             }
31369         };
31370
31371         _window2.default.onYouTubePlayerAPIReady = function () {
31372             YouTubeApi.iFrameReady();
31373         };
31374
31375         _media.typeChecks.push(function (url) {
31376             return (/\/\/(www\.youtube|youtu\.?be)/i.test(url) ? 'video/x-youtube' : null
31377             );
31378         });
31379
31380         _renderer.renderer.add(YouTubeIframeRenderer);
31381
31382     }, { "2": 2, "26": 26, "27": 27, "28": 28, "3": 3, "7": 7, "8": 8 }], 25: [function (_dereq_, module, exports) {
31383         'use strict';
31384
31385         Object.defineProperty(exports, "__esModule", {
31386             value: true
31387         });
31388         exports.cancelFullScreen = exports.requestFullScreen = exports.isFullScreen = exports.FULLSCREEN_EVENT_NAME = exports.HAS_NATIVE_FULLSCREEN_ENABLED = exports.HAS_TRUE_NATIVE_FULLSCREEN = exports.HAS_IOS_FULLSCREEN = exports.HAS_MS_NATIVE_FULLSCREEN = exports.HAS_MOZ_NATIVE_FULLSCREEN = exports.HAS_WEBKIT_NATIVE_FULLSCREEN = exports.HAS_NATIVE_FULLSCREEN = exports.SUPPORTS_NATIVE_HLS = exports.SUPPORT_PASSIVE_EVENT = exports.SUPPORT_POINTER_EVENTS = exports.HAS_MSE = exports.IS_STOCK_ANDROID = exports.IS_SAFARI = exports.IS_FIREFOX = exports.IS_CHROME = exports.IS_EDGE = exports.IS_IE = exports.IS_ANDROID = exports.IS_IOS = exports.IS_IPOD = exports.IS_IPHONE = exports.IS_IPAD = exports.UA = exports.NAV = undefined;
31389
31390         var _window = _dereq_(3);
31391
31392         var _window2 = _interopRequireDefault(_window);
31393
31394         var _document = _dereq_(2);
31395
31396         var _document2 = _interopRequireDefault(_document);
31397
31398         var _mejs = _dereq_(7);
31399
31400         var _mejs2 = _interopRequireDefault(_mejs);
31401
31402         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31403
31404         var NAV = exports.NAV = _window2.default.navigator;
31405         var UA = exports.UA = NAV.userAgent.toLowerCase();
31406         var IS_IPAD = exports.IS_IPAD = /ipad/i.test(UA) && !_window2.default.MSStream;
31407         var IS_IPHONE = exports.IS_IPHONE = /iphone/i.test(UA) && !_window2.default.MSStream;
31408         var IS_IPOD = exports.IS_IPOD = /ipod/i.test(UA) && !_window2.default.MSStream;
31409         var IS_IOS = exports.IS_IOS = /ipad|iphone|ipod/i.test(UA) && !_window2.default.MSStream;
31410         var IS_ANDROID = exports.IS_ANDROID = /android/i.test(UA);
31411         var IS_IE = exports.IS_IE = /(trident|microsoft)/i.test(NAV.appName);
31412         var IS_EDGE = exports.IS_EDGE = 'msLaunchUri' in NAV && !('documentMode' in _document2.default);
31413         var IS_CHROME = exports.IS_CHROME = /chrome/i.test(UA);
31414         var IS_FIREFOX = exports.IS_FIREFOX = /firefox/i.test(UA);
31415         var IS_SAFARI = exports.IS_SAFARI = /safari/i.test(UA) && !IS_CHROME;
31416         var IS_STOCK_ANDROID = exports.IS_STOCK_ANDROID = /^mozilla\/\d+\.\d+\s\(linux;\su;/i.test(UA);
31417         var HAS_MSE = exports.HAS_MSE = 'MediaSource' in _window2.default;
31418         var SUPPORT_POINTER_EVENTS = exports.SUPPORT_POINTER_EVENTS = function () {
31419             var element = _document2.default.createElement('x'),
31420                 documentElement = _document2.default.documentElement,
31421                 getComputedStyle = _window2.default.getComputedStyle;
31422
31423             if (!('pointerEvents' in element.style)) {
31424                 return false;
31425             }
31426
31427             element.style.pointerEvents = 'auto';
31428             element.style.pointerEvents = 'x';
31429             documentElement.appendChild(element);
31430             var supports = getComputedStyle && (getComputedStyle(element, '') || {}).pointerEvents === 'auto';
31431             element.remove();
31432             return !!supports;
31433         }();
31434
31435         var SUPPORT_PASSIVE_EVENT = exports.SUPPORT_PASSIVE_EVENT = function () {
31436             var supportsPassive = false;
31437             try {
31438                 var opts = Object.defineProperty({}, 'passive', {
31439                     get: function get() {
31440                         supportsPassive = true;
31441                     }
31442                 });
31443                 _window2.default.addEventListener('test', null, opts);
31444             } catch (e) { }
31445
31446             return supportsPassive;
31447         }();
31448
31449         var html5Elements = ['source', 'track', 'audio', 'video'];
31450         var video = void 0;
31451
31452         for (var i = 0, total = html5Elements.length; i < total; i++) {
31453             video = _document2.default.createElement(html5Elements[i]);
31454         }
31455
31456         var SUPPORTS_NATIVE_HLS = exports.SUPPORTS_NATIVE_HLS = IS_SAFARI || IS_IE && /edge/i.test(UA);
31457
31458         var hasiOSFullScreen = video.webkitEnterFullscreen !== undefined;
31459
31460         var hasNativeFullscreen = video.requestFullscreen !== undefined;
31461
31462         if (hasiOSFullScreen && /mac os x 10_5/i.test(UA)) {
31463             hasNativeFullscreen = false;
31464             hasiOSFullScreen = false;
31465         }
31466
31467         var hasWebkitNativeFullScreen = video.webkitRequestFullScreen !== undefined;
31468         var hasMozNativeFullScreen = video.mozRequestFullScreen !== undefined;
31469         var hasMsNativeFullScreen = video.msRequestFullscreen !== undefined;
31470         var hasTrueNativeFullScreen = hasWebkitNativeFullScreen || hasMozNativeFullScreen || hasMsNativeFullScreen;
31471         var nativeFullScreenEnabled = hasTrueNativeFullScreen;
31472         var fullScreenEventName = '';
31473         var isFullScreen = void 0,
31474             requestFullScreen = void 0,
31475             cancelFullScreen = void 0;
31476
31477         if (hasMozNativeFullScreen) {
31478             nativeFullScreenEnabled = _document2.default.mozFullScreenEnabled;
31479         } else if (hasMsNativeFullScreen) {
31480             nativeFullScreenEnabled = _document2.default.msFullscreenEnabled;
31481         }
31482
31483         if (IS_CHROME) {
31484             hasiOSFullScreen = false;
31485         }
31486
31487         if (hasTrueNativeFullScreen) {
31488             if (hasWebkitNativeFullScreen) {
31489                 fullScreenEventName = 'webkitfullscreenchange';
31490             } else if (hasMozNativeFullScreen) {
31491                 fullScreenEventName = 'fullscreenchange';
31492             } else if (hasMsNativeFullScreen) {
31493                 fullScreenEventName = 'MSFullscreenChange';
31494             }
31495
31496             exports.isFullScreen = isFullScreen = function isFullScreen() {
31497                 if (hasMozNativeFullScreen) {
31498                     return _document2.default.mozFullScreen;
31499                 } else if (hasWebkitNativeFullScreen) {
31500                     return _document2.default.webkitIsFullScreen;
31501                 } else if (hasMsNativeFullScreen) {
31502                     return _document2.default.msFullscreenElement !== null;
31503                 }
31504             };
31505
31506             exports.requestFullScreen = requestFullScreen = function requestFullScreen(el) {
31507                 if (hasWebkitNativeFullScreen) {
31508                     el.webkitRequestFullScreen();
31509                 } else if (hasMozNativeFullScreen) {
31510                     el.mozRequestFullScreen();
31511                 } else if (hasMsNativeFullScreen) {
31512                     el.msRequestFullscreen();
31513                 }
31514             };
31515
31516             exports.cancelFullScreen = cancelFullScreen = function cancelFullScreen() {
31517                 if (hasWebkitNativeFullScreen) {
31518                     _document2.default.webkitCancelFullScreen();
31519                 } else if (hasMozNativeFullScreen) {
31520                     _document2.default.mozCancelFullScreen();
31521                 } else if (hasMsNativeFullScreen) {
31522                     _document2.default.msExitFullscreen();
31523                 }
31524             };
31525         }
31526
31527         var HAS_NATIVE_FULLSCREEN = exports.HAS_NATIVE_FULLSCREEN = hasNativeFullscreen;
31528         var HAS_WEBKIT_NATIVE_FULLSCREEN = exports.HAS_WEBKIT_NATIVE_FULLSCREEN = hasWebkitNativeFullScreen;
31529         var HAS_MOZ_NATIVE_FULLSCREEN = exports.HAS_MOZ_NATIVE_FULLSCREEN = hasMozNativeFullScreen;
31530         var HAS_MS_NATIVE_FULLSCREEN = exports.HAS_MS_NATIVE_FULLSCREEN = hasMsNativeFullScreen;
31531         var HAS_IOS_FULLSCREEN = exports.HAS_IOS_FULLSCREEN = hasiOSFullScreen;
31532         var HAS_TRUE_NATIVE_FULLSCREEN = exports.HAS_TRUE_NATIVE_FULLSCREEN = hasTrueNativeFullScreen;
31533         var HAS_NATIVE_FULLSCREEN_ENABLED = exports.HAS_NATIVE_FULLSCREEN_ENABLED = nativeFullScreenEnabled;
31534         var FULLSCREEN_EVENT_NAME = exports.FULLSCREEN_EVENT_NAME = fullScreenEventName;
31535         exports.isFullScreen = isFullScreen;
31536         exports.requestFullScreen = requestFullScreen;
31537         exports.cancelFullScreen = cancelFullScreen;
31538
31539
31540         _mejs2.default.Features = _mejs2.default.Features || {};
31541         _mejs2.default.Features.isiPad = IS_IPAD;
31542         _mejs2.default.Features.isiPod = IS_IPOD;
31543         _mejs2.default.Features.isiPhone = IS_IPHONE;
31544         _mejs2.default.Features.isiOS = _mejs2.default.Features.isiPhone || _mejs2.default.Features.isiPad;
31545         _mejs2.default.Features.isAndroid = IS_ANDROID;
31546         _mejs2.default.Features.isIE = IS_IE;
31547         _mejs2.default.Features.isEdge = IS_EDGE;
31548         _mejs2.default.Features.isChrome = IS_CHROME;
31549         _mejs2.default.Features.isFirefox = IS_FIREFOX;
31550         _mejs2.default.Features.isSafari = IS_SAFARI;
31551         _mejs2.default.Features.isStockAndroid = IS_STOCK_ANDROID;
31552         _mejs2.default.Features.hasMSE = HAS_MSE;
31553         _mejs2.default.Features.supportsNativeHLS = SUPPORTS_NATIVE_HLS;
31554         _mejs2.default.Features.supportsPointerEvents = SUPPORT_POINTER_EVENTS;
31555         _mejs2.default.Features.supportsPassiveEvent = SUPPORT_PASSIVE_EVENT;
31556         _mejs2.default.Features.hasiOSFullScreen = HAS_IOS_FULLSCREEN;
31557         _mejs2.default.Features.hasNativeFullscreen = HAS_NATIVE_FULLSCREEN;
31558         _mejs2.default.Features.hasWebkitNativeFullScreen = HAS_WEBKIT_NATIVE_FULLSCREEN;
31559         _mejs2.default.Features.hasMozNativeFullScreen = HAS_MOZ_NATIVE_FULLSCREEN;
31560         _mejs2.default.Features.hasMsNativeFullScreen = HAS_MS_NATIVE_FULLSCREEN;
31561         _mejs2.default.Features.hasTrueNativeFullScreen = HAS_TRUE_NATIVE_FULLSCREEN;
31562         _mejs2.default.Features.nativeFullScreenEnabled = HAS_NATIVE_FULLSCREEN_ENABLED;
31563         _mejs2.default.Features.fullScreenEventName = FULLSCREEN_EVENT_NAME;
31564         _mejs2.default.Features.isFullScreen = isFullScreen;
31565         _mejs2.default.Features.requestFullScreen = requestFullScreen;
31566         _mejs2.default.Features.cancelFullScreen = cancelFullScreen;
31567
31568     }, { "2": 2, "3": 3, "7": 7 }], 26: [function (_dereq_, module, exports) {
31569         'use strict';
31570
31571         Object.defineProperty(exports, "__esModule", {
31572             value: true
31573         });
31574         exports.removeClass = exports.addClass = exports.hasClass = undefined;
31575         exports.loadScript = loadScript;
31576         exports.offset = offset;
31577         exports.toggleClass = toggleClass;
31578         exports.fadeOut = fadeOut;
31579         exports.fadeIn = fadeIn;
31580         exports.siblings = siblings;
31581         exports.visible = visible;
31582         exports.ajax = ajax;
31583
31584         var _window = _dereq_(3);
31585
31586         var _window2 = _interopRequireDefault(_window);
31587
31588         var _document = _dereq_(2);
31589
31590         var _document2 = _interopRequireDefault(_document);
31591
31592         var _mejs = _dereq_(7);
31593
31594         var _mejs2 = _interopRequireDefault(_mejs);
31595
31596         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31597
31598         function loadScript(url) {
31599             return new Promise(function (resolve, reject) {
31600                 var script = _document2.default.createElement('script');
31601                 script.src = url;
31602                 script.async = true;
31603                 script.onload = function () {
31604                     script.remove();
31605                     resolve();
31606                 };
31607                 script.onerror = function () {
31608                     script.remove();
31609                     reject();
31610                 };
31611                 _document2.default.head.appendChild(script);
31612             });
31613         }
31614
31615         function offset(el) {
31616             var rect = el.getBoundingClientRect(),
31617                 scrollLeft = _window2.default.pageXOffset || _document2.default.documentElement.scrollLeft,
31618                 scrollTop = _window2.default.pageYOffset || _document2.default.documentElement.scrollTop;
31619             return { top: rect.top + scrollTop, left: rect.left + scrollLeft };
31620         }
31621
31622         var hasClassMethod = void 0,
31623             addClassMethod = void 0,
31624             removeClassMethod = void 0;
31625
31626         if ('classList' in _document2.default.documentElement) {
31627             hasClassMethod = function hasClassMethod(el, className) {
31628                 return el.classList !== undefined && el.classList.contains(className);
31629             };
31630             addClassMethod = function addClassMethod(el, className) {
31631                 return el.classList.add(className);
31632             };
31633             removeClassMethod = function removeClassMethod(el, className) {
31634                 return el.classList.remove(className);
31635             };
31636         } else {
31637             hasClassMethod = function hasClassMethod(el, className) {
31638                 return new RegExp('\\b' + className + '\\b').test(el.className);
31639             };
31640             addClassMethod = function addClassMethod(el, className) {
31641                 if (!hasClass(el, className)) {
31642                     el.className += ' ' + className;
31643                 }
31644             };
31645             removeClassMethod = function removeClassMethod(el, className) {
31646                 el.className = el.className.replace(new RegExp('\\b' + className + '\\b', 'g'), '');
31647             };
31648         }
31649
31650         var hasClass = exports.hasClass = hasClassMethod;
31651         var addClass = exports.addClass = addClassMethod;
31652         var removeClass = exports.removeClass = removeClassMethod;
31653
31654         function toggleClass(el, className) {
31655             hasClass(el, className) ? removeClass(el, className) : addClass(el, className);
31656         }
31657
31658         function fadeOut(el) {
31659             var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
31660             var callback = arguments[2];
31661
31662             if (!el.style.opacity) {
31663                 el.style.opacity = 1;
31664             }
31665
31666             var start = null;
31667             _window2.default.requestAnimationFrame(function animate(timestamp) {
31668                 start = start || timestamp;
31669                 var progress = timestamp - start;
31670                 var opacity = parseFloat(1 - progress / duration, 2);
31671                 el.style.opacity = opacity < 0 ? 0 : opacity;
31672                 if (progress > duration) {
31673                     if (callback && typeof callback === 'function') {
31674                         callback();
31675                     }
31676                 } else {
31677                     _window2.default.requestAnimationFrame(animate);
31678                 }
31679             });
31680         }
31681
31682         function fadeIn(el) {
31683             var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
31684             var callback = arguments[2];
31685
31686             if (!el.style.opacity) {
31687                 el.style.opacity = 0;
31688             }
31689
31690             var start = null;
31691             _window2.default.requestAnimationFrame(function animate(timestamp) {
31692                 start = start || timestamp;
31693                 var progress = timestamp - start;
31694                 var opacity = parseFloat(progress / duration, 2);
31695                 el.style.opacity = opacity > 1 ? 1 : opacity;
31696                 if (progress > duration) {
31697                     if (callback && typeof callback === 'function') {
31698                         callback();
31699                     }
31700                 } else {
31701                     _window2.default.requestAnimationFrame(animate);
31702                 }
31703             });
31704         }
31705
31706         function siblings(el, filter) {
31707             var siblings = [];
31708             el = el.parentNode.firstChild;
31709             do {
31710                 if (!filter || filter(el)) {
31711                     siblings.push(el);
31712                 }
31713             } while (el = el.nextSibling);
31714             return siblings;
31715         }
31716
31717         function visible(elem) {
31718             if (elem.getClientRects !== undefined && elem.getClientRects === 'function') {
31719                 return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
31720             }
31721             return !!(elem.offsetWidth || elem.offsetHeight);
31722         }
31723
31724         function ajax(url, dataType, success, error) {
31725             var xhr = _window2.default.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
31726
31727             var type = 'application/x-www-form-urlencoded; charset=UTF-8',
31728                 completed = false,
31729                 accept = '*/'.concat('*');
31730
31731             switch (dataType) {
31732                 case 'text':
31733                     type = 'text/plain';
31734                     break;
31735                 case 'json':
31736                     type = 'application/json, text/javascript';
31737                     break;
31738                 case 'html':
31739                     type = 'text/html';
31740                     break;
31741                 case 'xml':
31742                     type = 'application/xml, text/xml';
31743                     break;
31744             }
31745
31746             if (type !== 'application/x-www-form-urlencoded') {
31747                 accept = type + ', */*; q=0.01';
31748             }
31749
31750             if (xhr) {
31751                 xhr.open('GET', url, true);
31752                 xhr.setRequestHeader('Accept', accept);
31753                 xhr.onreadystatechange = function () {
31754                     if (completed) {
31755                         return;
31756                     }
31757
31758                     if (xhr.readyState === 4) {
31759                         if (xhr.status === 200) {
31760                             completed = true;
31761                             var data = void 0;
31762                             switch (dataType) {
31763                                 case 'json':
31764                                     data = JSON.parse(xhr.responseText);
31765                                     break;
31766                                 case 'xml':
31767                                     data = xhr.responseXML;
31768                                     break;
31769                                 default:
31770                                     data = xhr.responseText;
31771                                     break;
31772                             }
31773                             success(data);
31774                         } else if (typeof error === 'function') {
31775                             error(xhr.status);
31776                         }
31777                     }
31778                 };
31779
31780                 xhr.send();
31781             }
31782         }
31783
31784         _mejs2.default.Utils = _mejs2.default.Utils || {};
31785         _mejs2.default.Utils.offset = offset;
31786         _mejs2.default.Utils.hasClass = hasClass;
31787         _mejs2.default.Utils.addClass = addClass;
31788         _mejs2.default.Utils.removeClass = removeClass;
31789         _mejs2.default.Utils.toggleClass = toggleClass;
31790         _mejs2.default.Utils.fadeIn = fadeIn;
31791         _mejs2.default.Utils.fadeOut = fadeOut;
31792         _mejs2.default.Utils.siblings = siblings;
31793         _mejs2.default.Utils.visible = visible;
31794         _mejs2.default.Utils.ajax = ajax;
31795         _mejs2.default.Utils.loadScript = loadScript;
31796
31797     }, { "2": 2, "3": 3, "7": 7 }], 27: [function (_dereq_, module, exports) {
31798         'use strict';
31799
31800         Object.defineProperty(exports, "__esModule", {
31801             value: true
31802         });
31803         exports.escapeHTML = escapeHTML;
31804         exports.debounce = debounce;
31805         exports.isObjectEmpty = isObjectEmpty;
31806         exports.splitEvents = splitEvents;
31807         exports.createEvent = createEvent;
31808         exports.isNodeAfter = isNodeAfter;
31809         exports.isString = isString;
31810
31811         var _mejs = _dereq_(7);
31812
31813         var _mejs2 = _interopRequireDefault(_mejs);
31814
31815         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31816
31817         function escapeHTML(input) {
31818
31819             if (typeof input !== 'string') {
31820                 throw new Error('Argument passed must be a string');
31821             }
31822
31823             var map = {
31824                 '&': '&amp;',
31825                 '<': '&lt;',
31826                 '>': '&gt;',
31827                 '"': '&quot;'
31828             };
31829
31830             return input.replace(/[&<>"]/g, function (c) {
31831                 return map[c];
31832             });
31833         }
31834
31835         function debounce(func, wait) {
31836             var _this = this,
31837                 _arguments = arguments;
31838
31839             var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
31840
31841
31842             if (typeof func !== 'function') {
31843                 throw new Error('First argument must be a function');
31844             }
31845
31846             if (typeof wait !== 'number') {
31847                 throw new Error('Second argument must be a numeric value');
31848             }
31849
31850             var timeout = void 0;
31851             return function () {
31852                 var context = _this,
31853                     args = _arguments;
31854                 var later = function later() {
31855                     timeout = null;
31856                     if (!immediate) {
31857                         func.apply(context, args);
31858                     }
31859                 };
31860                 var callNow = immediate && !timeout;
31861                 clearTimeout(timeout);
31862                 timeout = setTimeout(later, wait);
31863
31864                 if (callNow) {
31865                     func.apply(context, args);
31866                 }
31867             };
31868         }
31869
31870         function isObjectEmpty(instance) {
31871             return Object.getOwnPropertyNames(instance).length <= 0;
31872         }
31873
31874         function splitEvents(events, id) {
31875             var rwindow = /^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;
31876
31877             var ret = { d: [], w: [] };
31878             (events || '').split(' ').forEach(function (v) {
31879                 var eventName = '' + v + (id ? '.' + id : '');
31880
31881                 if (eventName.startsWith('.')) {
31882                     ret.d.push(eventName);
31883                     ret.w.push(eventName);
31884                 } else {
31885                     ret[rwindow.test(v) ? 'w' : 'd'].push(eventName);
31886                 }
31887             });
31888
31889             ret.d = ret.d.join(' ');
31890             ret.w = ret.w.join(' ');
31891             return ret;
31892         }
31893
31894         function createEvent(eventName, target) {
31895
31896             if (typeof eventName !== 'string') {
31897                 throw new Error('Event name must be a string');
31898             }
31899
31900             var eventFrags = eventName.match(/([a-z]+\.([a-z]+))/i),
31901                 detail = {
31902                     target: target
31903                 };
31904
31905             if (eventFrags !== null) {
31906                 eventName = eventFrags[1];
31907                 detail.namespace = eventFrags[2];
31908             }
31909
31910             return new window.CustomEvent(eventName, {
31911                 detail: detail
31912             });
31913         }
31914
31915         function isNodeAfter(sourceNode, targetNode) {
31916
31917             return !!(sourceNode && targetNode && sourceNode.compareDocumentPosition(targetNode) & 2);
31918         }
31919
31920         function isString(value) {
31921             return typeof value === 'string';
31922         }
31923
31924         _mejs2.default.Utils = _mejs2.default.Utils || {};
31925         _mejs2.default.Utils.escapeHTML = escapeHTML;
31926         _mejs2.default.Utils.debounce = debounce;
31927         _mejs2.default.Utils.isObjectEmpty = isObjectEmpty;
31928         _mejs2.default.Utils.splitEvents = splitEvents;
31929         _mejs2.default.Utils.createEvent = createEvent;
31930         _mejs2.default.Utils.isNodeAfter = isNodeAfter;
31931         _mejs2.default.Utils.isString = isString;
31932
31933     }, { "7": 7 }], 28: [function (_dereq_, module, exports) {
31934         'use strict';
31935
31936         Object.defineProperty(exports, "__esModule", {
31937             value: true
31938         });
31939         exports.typeChecks = undefined;
31940         exports.absolutizeUrl = absolutizeUrl;
31941         exports.formatType = formatType;
31942         exports.getMimeFromType = getMimeFromType;
31943         exports.getTypeFromFile = getTypeFromFile;
31944         exports.getExtension = getExtension;
31945         exports.normalizeExtension = normalizeExtension;
31946
31947         var _mejs = _dereq_(7);
31948
31949         var _mejs2 = _interopRequireDefault(_mejs);
31950
31951         var _general = _dereq_(27);
31952
31953         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31954
31955         var typeChecks = exports.typeChecks = [];
31956
31957         function absolutizeUrl(url) {
31958
31959             if (typeof url !== 'string') {
31960                 throw new Error('`url` argument must be a string');
31961             }
31962
31963             var el = document.createElement('div');
31964             el.innerHTML = '<a href="' + (0, _general.escapeHTML)(url) + '">x</a>';
31965             return el.firstChild.href;
31966         }
31967
31968         function formatType(url) {
31969             var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
31970
31971             return url && !type ? getTypeFromFile(url) : type;
31972         }
31973
31974         function getMimeFromType(type) {
31975
31976             if (typeof type !== 'string') {
31977                 throw new Error('`type` argument must be a string');
31978             }
31979
31980             return type && type.indexOf(';') > -1 ? type.substr(0, type.indexOf(';')) : type;
31981         }
31982
31983         function getTypeFromFile(url) {
31984
31985             if (typeof url !== 'string') {
31986                 throw new Error('`url` argument must be a string');
31987             }
31988
31989             for (var i = 0, total = typeChecks.length; i < total; i++) {
31990                 var type = typeChecks[i](url);
31991
31992                 if (type) {
31993                     return type;
31994                 }
31995             }
31996
31997             var ext = getExtension(url),
31998                 normalizedExt = normalizeExtension(ext);
31999
32000             var mime = 'video/mp4';
32001
32002             if (normalizedExt) {
32003                 if (~['mp4', 'm4v', 'ogg', 'ogv', 'webm', 'flv', 'mpeg', 'mov'].indexOf(normalizedExt)) {
32004                     mime = 'video/' + normalizedExt;
32005                 } else if (~['mp3', 'oga', 'wav', 'mid', 'midi'].indexOf(normalizedExt)) {
32006                     mime = 'audio/' + normalizedExt;
32007                 }
32008             }
32009
32010             return mime;
32011         }
32012
32013         function getExtension(url) {
32014
32015             if (typeof url !== 'string') {
32016                 throw new Error('`url` argument must be a string');
32017             }
32018
32019             var baseUrl = url.split('?')[0],
32020                 baseName = baseUrl.split('\\').pop().split('/').pop();
32021             return ~baseName.indexOf('.') ? baseName.substring(baseName.lastIndexOf('.') + 1) : '';
32022         }
32023
32024         function normalizeExtension(extension) {
32025
32026             if (typeof extension !== 'string') {
32027                 throw new Error('`extension` argument must be a string');
32028             }
32029
32030             switch (extension) {
32031                 case 'mp4':
32032                 case 'm4v':
32033                     return 'mp4';
32034                 case 'webm':
32035                 case 'webma':
32036                 case 'webmv':
32037                     return 'webm';
32038                 case 'ogg':
32039                 case 'oga':
32040                 case 'ogv':
32041                     return 'ogg';
32042                 default:
32043                     return extension;
32044             }
32045         }
32046
32047         _mejs2.default.Utils = _mejs2.default.Utils || {};
32048         _mejs2.default.Utils.typeChecks = typeChecks;
32049         _mejs2.default.Utils.absolutizeUrl = absolutizeUrl;
32050         _mejs2.default.Utils.formatType = formatType;
32051         _mejs2.default.Utils.getMimeFromType = getMimeFromType;
32052         _mejs2.default.Utils.getTypeFromFile = getTypeFromFile;
32053         _mejs2.default.Utils.getExtension = getExtension;
32054         _mejs2.default.Utils.normalizeExtension = normalizeExtension;
32055
32056     }, { "27": 27, "7": 7 }], 29: [function (_dereq_, module, exports) {
32057         'use strict';
32058
32059         var _document = _dereq_(2);
32060
32061         var _document2 = _interopRequireDefault(_document);
32062
32063         var _promisePolyfill = _dereq_(4);
32064
32065         var _promisePolyfill2 = _interopRequireDefault(_promisePolyfill);
32066
32067         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32068
32069         (function (arr) {
32070             arr.forEach(function (item) {
32071                 if (item.hasOwnProperty('remove')) {
32072                     return;
32073                 }
32074                 Object.defineProperty(item, 'remove', {
32075                     configurable: true,
32076                     enumerable: true,
32077                     writable: true,
32078                     value: function remove() {
32079                         this.parentNode.removeChild(this);
32080                     }
32081                 });
32082             });
32083         })([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
32084
32085         (function () {
32086
32087             if (typeof window.CustomEvent === 'function') {
32088                 return false;
32089             }
32090
32091             function CustomEvent(event, params) {
32092                 params = params || { bubbles: false, cancelable: false, detail: undefined };
32093                 var evt = _document2.default.createEvent('CustomEvent');
32094                 evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
32095                 return evt;
32096             }
32097
32098             CustomEvent.prototype = window.Event.prototype;
32099             window.CustomEvent = CustomEvent;
32100         })();
32101
32102         if (typeof Object.assign !== 'function') {
32103             Object.assign = function (target) {
32104
32105                 if (target === null || target === undefined) {
32106                     throw new TypeError('Cannot convert undefined or null to object');
32107                 }
32108
32109                 var to = Object(target);
32110
32111                 for (var index = 1, total = arguments.length; index < total; index++) {
32112                     var nextSource = arguments[index];
32113
32114                     if (nextSource !== null) {
32115                         for (var nextKey in nextSource) {
32116                             if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
32117                                 to[nextKey] = nextSource[nextKey];
32118                             }
32119                         }
32120                     }
32121                 }
32122                 return to;
32123             };
32124         }
32125
32126         if (!String.prototype.startsWith) {
32127             String.prototype.startsWith = function (searchString, position) {
32128                 position = position || 0;
32129                 return this.substr(position, searchString.length) === searchString;
32130             };
32131         }
32132
32133         if (!Element.prototype.matches) {
32134             Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function (s) {
32135                 var matches = (this.document || this.ownerDocument).querySelectorAll(s),
32136                     i = matches.length - 1;
32137                 while (--i >= 0 && matches.item(i) !== this) { }
32138                 return i > -1;
32139             };
32140         }
32141
32142         if (window.Element && !Element.prototype.closest) {
32143             Element.prototype.closest = function (s) {
32144                 var matches = (this.document || this.ownerDocument).querySelectorAll(s),
32145                     i = void 0,
32146                     el = this;
32147                 do {
32148                     i = matches.length;
32149                     while (--i >= 0 && matches.item(i) !== el) { }
32150                 } while (i < 0 && (el = el.parentElement));
32151                 return el;
32152             };
32153         }
32154
32155         (function () {
32156             var lastTime = 0;
32157             var vendors = ['ms', 'moz', 'webkit', 'o'];
32158             for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
32159                 window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
32160                 window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
32161             }
32162
32163             if (!window.requestAnimationFrame) window.requestAnimationFrame = function (callback) {
32164                 var currTime = new Date().getTime();
32165                 var timeToCall = Math.max(0, 16 - (currTime - lastTime));
32166                 var id = window.setTimeout(function () {
32167                     callback(currTime + timeToCall);
32168                 }, timeToCall);
32169                 lastTime = currTime + timeToCall;
32170                 return id;
32171             };
32172
32173             if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function (id) {
32174                 clearTimeout(id);
32175             };
32176         })();
32177
32178         if (/firefox/i.test(navigator.userAgent)) {
32179             var getComputedStyle = window.getComputedStyle;
32180             window.getComputedStyle = function (el, pseudoEl) {
32181                 var t = getComputedStyle(el, pseudoEl);
32182                 return t === null ? { getPropertyValue: function getPropertyValue() { } } : t;
32183             };
32184         }
32185
32186         if (!window.Promise) {
32187             window.Promise = _promisePolyfill2.default;
32188         }
32189
32190         (function (constructor) {
32191             if (constructor && constructor.prototype && constructor.prototype.children === null) {
32192                 Object.defineProperty(constructor.prototype, 'children', {
32193                     get: function get() {
32194                         var i = 0,
32195                             node = void 0,
32196                             nodes = this.childNodes,
32197                             children = [];
32198                         while (node = nodes[i++]) {
32199                             if (node.nodeType === 1) {
32200                                 children.push(node);
32201                             }
32202                         }
32203                         return children;
32204                     }
32205                 });
32206             }
32207         })(window.Node || window.Element);
32208
32209     }, { "2": 2, "4": 4 }], 30: [function (_dereq_, module, exports) {
32210         'use strict';
32211
32212         Object.defineProperty(exports, "__esModule", {
32213             value: true
32214         });
32215         exports.isDropFrame = isDropFrame;
32216         exports.secondsToTimeCode = secondsToTimeCode;
32217         exports.timeCodeToSeconds = timeCodeToSeconds;
32218         exports.calculateTimeFormat = calculateTimeFormat;
32219         exports.convertSMPTEtoSeconds = convertSMPTEtoSeconds;
32220
32221         var _mejs = _dereq_(7);
32222
32223         var _mejs2 = _interopRequireDefault(_mejs);
32224
32225         function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32226
32227         function isDropFrame() {
32228             var fps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 25;
32229
32230             return !(fps % 1 === 0);
32231         }
32232         function secondsToTimeCode(time) {
32233             var forceHours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
32234             var showFrameCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
32235             var fps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 25;
32236             var secondsDecimalLength = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
32237             var timeFormat = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'hh:mm:ss';
32238
32239
32240             time = !time || typeof time !== 'number' || time < 0 ? 0 : time;
32241
32242             var dropFrames = Math.round(fps * 0.066666),
32243                 timeBase = Math.round(fps),
32244                 framesPer24Hours = Math.round(fps * 3600) * 24,
32245                 framesPer10Minutes = Math.round(fps * 600),
32246                 frameSep = isDropFrame(fps) ? ';' : ':',
32247                 hours = void 0,
32248                 minutes = void 0,
32249                 seconds = void 0,
32250                 frames = void 0,
32251                 f = Math.round(time * fps);
32252
32253             if (isDropFrame(fps)) {
32254
32255                 if (f < 0) {
32256                     f = framesPer24Hours + f;
32257                 }
32258
32259                 f = f % framesPer24Hours;
32260
32261                 var d = Math.floor(f / framesPer10Minutes);
32262                 var m = f % framesPer10Minutes;
32263                 f = f + dropFrames * 9 * d;
32264                 if (m > dropFrames) {
32265                     f = f + dropFrames * Math.floor((m - dropFrames) / Math.round(timeBase * 60 - dropFrames));
32266                 }
32267
32268                 var timeBaseDivision = Math.floor(f / timeBase);
32269
32270                 hours = Math.floor(Math.floor(timeBaseDivision / 60) / 60);
32271                 minutes = Math.floor(timeBaseDivision / 60) % 60;
32272
32273                 if (showFrameCount) {
32274                     seconds = timeBaseDivision % 60;
32275                 } else {
32276                     seconds = Math.floor(f / timeBase % 60).toFixed(secondsDecimalLength);
32277                 }
32278             } else {
32279                 hours = Math.floor(time / 3600) % 24;
32280                 minutes = Math.floor(time / 60) % 60;
32281                 if (showFrameCount) {
32282                     seconds = Math.floor(time % 60);
32283                 } else {
32284                     seconds = Math.floor(time % 60).toFixed(secondsDecimalLength);
32285                 }
32286             }
32287             hours = hours <= 0 ? 0 : hours;
32288             minutes = minutes <= 0 ? 0 : minutes;
32289             seconds = seconds <= 0 ? 0 : seconds;
32290
32291             seconds = seconds === 60 ? 0 : seconds;
32292             minutes = minutes === 60 ? 0 : minutes;
32293
32294             var timeFormatFrags = timeFormat.split(':');
32295             var timeFormatSettings = {};
32296             for (var i = 0, total = timeFormatFrags.length; i < total; ++i) {
32297                 var unique = '';
32298                 for (var j = 0, t = timeFormatFrags[i].length; j < t; j++) {
32299                     if (unique.indexOf(timeFormatFrags[i][j]) < 0) {
32300                         unique += timeFormatFrags[i][j];
32301                     }
32302                 }
32303                 if (~['f', 's', 'm', 'h'].indexOf(unique)) {
32304                     timeFormatSettings[unique] = timeFormatFrags[i].length;
32305                 }
32306             }
32307
32308             var result = forceHours || hours > 0 ? (hours < 10 && timeFormatSettings.h > 1 ? '0' + hours : hours) + ':' : '';
32309             result += (minutes < 10 && timeFormatSettings.m > 1 ? '0' + minutes : minutes) + ':';
32310             result += '' + (seconds < 10 && timeFormatSettings.s > 1 ? '0' + seconds : seconds);
32311
32312             if (showFrameCount) {
32313                 frames = (f % timeBase).toFixed(0);
32314                 frames = frames <= 0 ? 0 : frames;
32315                 result += frames < 10 && timeFormatSettings.f ? frameSep + '0' + frames : '' + frameSep + frames;
32316             }
32317
32318             return result;
32319         }
32320
32321         function timeCodeToSeconds(time) {
32322             var fps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25;
32323
32324
32325             if (typeof time !== 'string') {
32326                 throw new TypeError('Time must be a string');
32327             }
32328
32329             if (time.indexOf(';') > 0) {
32330                 time = time.replace(';', ':');
32331             }
32332
32333             if (!/\d{2}(\:\d{2}){0,3}/i.test(time)) {
32334                 throw new TypeError('Time code must have the format `00:00:00`');
32335             }
32336
32337             var parts = time.split(':');
32338
32339             var output = void 0,
32340                 hours = 0,
32341                 minutes = 0,
32342                 seconds = 0,
32343                 frames = 0,
32344                 totalMinutes = 0,
32345                 dropFrames = Math.round(fps * 0.066666),
32346                 timeBase = Math.round(fps),
32347                 hFrames = timeBase * 3600,
32348                 mFrames = timeBase * 60;
32349
32350             switch (parts.length) {
32351                 default:
32352                 case 1:
32353                     seconds = parseInt(parts[0], 10);
32354                     break;
32355                 case 2:
32356                     minutes = parseInt(parts[0], 10);
32357                     seconds = parseInt(parts[1], 10);
32358                     break;
32359                 case 3:
32360                     hours = parseInt(parts[0], 10);
32361                     minutes = parseInt(parts[1], 10);
32362                     seconds = parseInt(parts[2], 10);
32363                     break;
32364                 case 4:
32365                     hours = parseInt(parts[0], 10);
32366                     minutes = parseInt(parts[1], 10);
32367                     seconds = parseInt(parts[2], 10);
32368                     frames = parseInt(parts[3], 10);
32369                     break;
32370             }
32371
32372             if (isDropFrame(fps)) {
32373                 totalMinutes = 60 * hours + minutes;
32374                 output = hFrames * hours + mFrames * minutes + timeBase * seconds + frames - dropFrames * (totalMinutes - Math.floor(totalMinutes / 10));
32375             } else {
32376                 output = (hFrames * hours + mFrames * minutes + fps * seconds + frames) / fps;
32377             }
32378
32379             return parseFloat(output.toFixed(3));
32380         }
32381
32382         function calculateTimeFormat(time, options) {
32383             var fps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 25;
32384
32385
32386             time = !time || typeof time !== 'number' || time < 0 ? 0 : time;
32387
32388             var hours = Math.floor(time / 3600) % 24,
32389                 minutes = Math.floor(time / 60) % 60,
32390                 seconds = Math.floor(time % 60),
32391                 frames = Math.floor((time % 1 * fps).toFixed(3)),
32392                 lis = [[frames, 'f'], [seconds, 's'], [minutes, 'm'], [hours, 'h']];
32393
32394             var format = options.timeFormat,
32395                 firstTwoPlaces = format[1] === format[0],
32396                 separatorIndex = firstTwoPlaces ? 2 : 1,
32397                 separator = format.length < separatorIndex ? format[separatorIndex] : ':',
32398                 firstChar = format[0],
32399                 required = false;
32400
32401             for (var i = 0, len = lis.length; i < len; i++) {
32402                 if (~format.indexOf(lis[i][1])) {
32403                     required = true;
32404                 } else if (required) {
32405                     var hasNextValue = false;
32406                     for (var j = i; j < len; j++) {
32407                         if (lis[j][0] > 0) {
32408                             hasNextValue = true;
32409                             break;
32410                         }
32411                     }
32412
32413                     if (!hasNextValue) {
32414                         break;
32415                     }
32416
32417                     if (!firstTwoPlaces) {
32418                         format = firstChar + format;
32419                     }
32420                     format = lis[i][1] + separator + format;
32421                     if (firstTwoPlaces) {
32422                         format = lis[i][1] + format;
32423                     }
32424                     firstChar = lis[i][1];
32425                 }
32426             }
32427
32428             options.timeFormat = format;
32429         }
32430
32431         function convertSMPTEtoSeconds(SMPTE) {
32432
32433             if (typeof SMPTE !== 'string') {
32434                 throw new TypeError('Argument must be a string value');
32435             }
32436
32437             SMPTE = SMPTE.replace(',', '.');
32438
32439             var decimalLen = ~SMPTE.indexOf('.') ? SMPTE.split('.')[1].length : 0;
32440
32441             var secs = 0,
32442                 multiplier = 1;
32443
32444             SMPTE = SMPTE.split(':').reverse();
32445
32446             for (var i = 0, total = SMPTE.length; i < total; i++) {
32447                 multiplier = 1;
32448                 if (i > 0) {
32449                     multiplier = Math.pow(60, i);
32450                 }
32451                 secs += Number(SMPTE[i]) * multiplier;
32452             }
32453             return Number(secs.toFixed(decimalLen));
32454         }
32455
32456         _mejs2.default.Utils = _mejs2.default.Utils || {};
32457         _mejs2.default.Utils.secondsToTimeCode = secondsToTimeCode;
32458         _mejs2.default.Utils.timeCodeToSeconds = timeCodeToSeconds;
32459         _mejs2.default.Utils.calculateTimeFormat = calculateTimeFormat;
32460         _mejs2.default.Utils.convertSMPTEtoSeconds = convertSMPTEtoSeconds;
32461
32462     }, { "7": 7 }]
32463 }, {}, [29, 6, 5, 15, 23, 20, 19, 21, 22, 24, 16, 18, 17, 9, 10, 11, 12, 13, 14]);
32464
32465
32466/*  dailymotion  */
32467/*!
32468 * MediaElement.js
32469 * http://www.mediaelementjs.com/
32470 *
32471 * Wrapper that mimics native HTML5 MediaElement (audio and video)
32472 * using a variety of technologies (pure JavaScript, Flash, iframe)
32473 *
32474 * Copyright 2010-2017, John Dyer (http://j.hn/)
32475 * License: MIT
32476 *
32477 */(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
32478'use strict';
32479
32480var DailyMotionApi = {
32481	isSDKStarted: false,
32482
32483	isSDKLoaded: false,
32484
32485	iframeQueue: [],
32486
32487	enqueueIframe: function enqueueIframe(settings) {
32488
vendor: 5,075 bytes, lines 32489-32697
32489		if (DailyMotionApi.isLoaded) {
32490			DailyMotionApi.createIframe(settings);
32491		} else {
32492			DailyMotionApi.loadIframeApi();
32493			DailyMotionApi.iframeQueue.push(settings);
32494		}
32495	},
32496
32497	loadIframeApi: function loadIframeApi() {
32498		if (!DailyMotionApi.isSDKStarted) {
32499			mejs.Utils.loadScript('https://api.dmcdn.net/all.js');
32500			DailyMotionApi.isSDKStarted = true;
32501		}
32502	},
32503
32504	apiReady: function apiReady() {
32505
32506		DailyMotionApi.isLoaded = true;
32507		DailyMotionApi.isSDKLoaded = true;
32508
32509		while (DailyMotionApi.iframeQueue.length > 0) {
32510			var settings = DailyMotionApi.iframeQueue.pop();
32511
32512			DM.init({
32513				apiKey: settings.apiKey,
32514				status: settings.status,
32515				cookie: settings.cookie
32516			});
32517
32518			DailyMotionApi.createIframe(settings);
32519		}
32520	},
32521
32522	createIframe: function createIframe(settings) {
32523
32524		var player = DM.player(settings.container, {
32525			height: settings.height || '100%',
32526			width: settings.width || '100%',
32527			video: settings.videoId,
32528			params: Object.assign({ api: true }, settings.params),
32529			origin: location.host
32530		});
32531
32532		player.addEventListener('apiready', function () {
32533			window['__ready__' + settings.id](player, { paused: true, ended: false });
32534		});
32535	},
32536
32537	getDailyMotionId: function getDailyMotionId(url) {
32538		var parts = url.split('/'),
32539		    lastPart = parts[parts.length - 1],
32540		    dashParts = lastPart.split('_');
32541
32542		return dashParts[0];
32543	}
32544};
32545
32546var DailyMotionIframeRenderer = {
32547	name: 'dailymotion_iframe',
32548	options: {
32549		prefix: 'dailymotion_iframe',
32550		dailymotion: {
32551			width: '100%',
32552			height: '100%',
32553			params: {
32554				autoplay: false,
32555				chromeless: 1,
32556				info: 0,
32557				logo: 0,
32558				related: 0
32559			},
32560			apiKey: null,
32561			status: true,
32562			cookie: true
32563		}
32564	},
32565
32566	canPlayType: function canPlayType(type) {
32567		return ~['video/dailymotion', 'video/x-dailymotion'].indexOf(type.toLowerCase());
32568	},
32569
32570	create: function create(mediaElement, options, mediaFiles) {
32571
32572		var dm = {},
32573		    apiStack = [],
32574		    readyState = 4;
32575
32576		var events = void 0,
32577		    dmPlayer = null,
32578		    dmIframe = null;
32579
32580		dm.options = options;
32581		dm.id = mediaElement.id + '_' + options.prefix;
32582		dm.mediaElement = mediaElement;
32583
32584		var props = mejs.html5media.properties,
32585		    assignGettersSetters = function assignGettersSetters(propName) {
32586
32587			var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
32588
32589			dm['get' + capName] = function () {
32590				if (dmPlayer !== null) {
32591					var value = null;
32592
32593					switch (propName) {
32594						case 'currentTime':
32595							return dmPlayer.currentTime;
32596						case 'duration':
32597							return isNaN(dmPlayer.duration) ? 0 : dmPlayer.duration;
32598						case 'volume':
32599							return dmPlayer.volume;
32600						case 'paused':
32601							return dmPlayer.paused;
32602						case 'ended':
32603							return dmPlayer.ended;
32604						case 'muted':
32605							return dmPlayer.muted;
32606						case 'buffered':
32607							var percentLoaded = dmPlayer.bufferedTime,
32608							    duration = dmPlayer.duration;
32609							return {
32610								start: function start() {
32611									return 0;
32612								},
32613								end: function end() {
32614									return percentLoaded / duration;
32615								},
32616								length: 1
32617							};
32618						case 'src':
32619							return mediaElement.originalNode.getAttribute('src');
32620						case 'readyState':
32621							return readyState;
32622					}
32623
32624					return value;
32625				} else {
32626					return null;
32627				}
32628			};
32629
32630			dm['set' + capName] = function (value) {
32631				if (dmPlayer !== null) {
32632					switch (propName) {
32633						case 'src':
32634							var url = typeof value === 'string' ? value : value[0].src;
32635							dmPlayer.load(DailyMotionApi.getDailyMotionId(url));
32636							break;
32637						case 'currentTime':
32638							dmPlayer.seek(value);
32639							break;
32640						case 'muted':
32641							dmPlayer.setMuted(value);
32642							setTimeout(function () {
32643								var event = mejs.Utils.createEvent('volumechange', dm);
32644								mediaElement.dispatchEvent(event);
32645							}, 50);
32646							break;
32647						case 'volume':
32648							dmPlayer.setVolume(value);
32649							setTimeout(function () {
32650								var event = mejs.Utils.createEvent('volumechange', dm);
32651								mediaElement.dispatchEvent(event);
32652							}, 50);
32653							break;
32654						case 'readyState':
32655							var event = mejs.Utils.createEvent('canplay', dm);
32656							mediaElement.dispatchEvent(event);
32657							break;
32658						default:
32659							
32660							break;
32661					}
32662				} else {
32663					apiStack.push({ type: 'set', propName: propName, value: value });
32664				}
32665			};
32666		};
32667
32668		for (var i = 0, total = props.length; i < total; i++) {
32669			assignGettersSetters(props[i]);
32670		}
32671
32672		var methods = mejs.html5media.methods,
32673		    assignMethods = function assignMethods(methodName) {
32674			dm[methodName] = function () {
32675				if (dmPlayer !== null) {
32676					switch (methodName) {
32677						case 'play':
32678							return dmPlayer.play();
32679						case 'pause':
32680							return dmPlayer.pause();
32681						case 'load':
32682							return null;
32683					}
32684				} else {
32685					apiStack.push({ type: 'call', methodName: methodName });
32686				}
32687			};
32688		};
32689
32690		for (var _i = 0, _total = methods.length; _i < _total; _i++) {
32691			assignMethods(methods[_i]);
32692		}
32693
32694		window['__ready__' + dm.id] = function (_dmPlayer) {
32695
32696			mediaElement.dmPlayer = dmPlayer = _dmPlayer;
32697
32698			if (apiStack.length) {
32699				for (var _i2 = 0, _total2 = apiStack.length; _i2 < _total2; _i2++) {
32700
32701					var stackItem = apiStack[_i2];
32702
32703					if (stackItem.type === 'set') {
32704						var propName = stackItem.propName,
32705						    capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
32706
32707						dm['set' + capName](stackItem.value);
32708					} else if (stackItem.type === 'call') {
32709						dm[stackItem.methodName]();
32710					}
32711				}
32712			}
32713
32714			dmIframe = document.getElementById(dm.id);
32715
32716			events = ['mouseover', 'mouseout'];
32717			var assignEvents = function assignEvents(e) {
32718				var event = mejs.Utils.createEvent(e.type, dm);
32719				mediaElement.dispatchEvent(event);
32720			};
32721
32722			for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
32723				dmIframe.addEventListener(events[_i3], assignEvents, false);
32724			}
32725
32726			if (mediaElement.originalNode.muted) {
32727				dmPlayer.setMuted(true);
32728				dmPlayer.setVolume(0);
32729			}
32730
32731			events = mejs.html5media.events;
32732			events = events.concat(['click', 'mouseover', 'mouseout']);
32733			var assignNativeEvents = function assignNativeEvents(eventName) {
32734				if (eventName !== 'ended') {
32735					dmPlayer.addEventListener(eventName, function (e) {
32736						var event = mejs.Utils.createEvent(e.type, dmPlayer);
32737						mediaElement.dispatchEvent(event);
32738					});
32739				}
32740			};
32741
32742			for (var _i4 = 0, _total4 = events.length; _i4 < _total4; _i4++) {
32743				assignNativeEvents(events[_i4]);
32744			}
32745
32746			dmPlayer.addEventListener('ad_start', function () {
32747				var event = mejs.Utils.createEvent('play', dmPlayer);
32748				mediaElement.dispatchEvent(event);
32749
32750				event = mejs.Utils.createEvent('progress', dmPlayer);
32751				mediaElement.dispatchEvent(event);
32752
32753				event = mejs.Utils.createEvent('timeupdate', dmPlayer);
32754				mediaElement.dispatchEvent(event);
32755			});
32756			dmPlayer.addEventListener('ad_timeupdate', function () {
32757				var event = mejs.Utils.createEvent('timeupdate', dmPlayer);
32758				mediaElement.dispatchEvent(event);
32759			});
32760			dmPlayer.addEventListener('ad_pause', function () {
32761				var event = mejs.Utils.createEvent('pause', dmPlayer);
32762				mediaElement.dispatchEvent(event);
32763			});
32764			dmPlayer.addEventListener('ad_end', function () {
32765				var event = mejs.Utils.createEvent('ended', dmPlayer);
32766				mediaElement.dispatchEvent(event);
32767			});
32768			dmPlayer.addEventListener('start', function () {
32769				if (mediaElement.originalNode.muted) {
32770					dmPlayer.setMuted(true);
32771				}
32772			});
32773			dmPlayer.addEventListener('video_start', function () {
32774				var event = mejs.Utils.createEvent('play', dmPlayer);
32775				mediaElement.dispatchEvent(event);
32776			});
32777			dmPlayer.addEventListener('ad_timeupdate', function () {
32778				var event = mejs.Utils.createEvent('timeupdate', dmPlayer);
32779				mediaElement.dispatchEvent(event);
32780			});
32781			dmPlayer.addEventListener('video_end', function () {
32782				var event = mejs.Utils.createEvent('ended', dmPlayer);
32783				mediaElement.dispatchEvent(event);
32784
32785				if (mediaElement.originalNode.getAttribute('loop')) {
32786					dmPlayer.play();
32787				}
32788			});
32789
32790			var initEvents = ['rendererready', 'loadedmetadata', 'loadeddata', 'canplay'];
32791
32792			for (var _i5 = 0, _total5 = initEvents.length; _i5 < _total5; _i5++) {
32793				var event = mejs.Utils.createEvent(initEvents[_i5], dm);
32794				mediaElement.dispatchEvent(event);
32795			}
32796		};
32797
32798		var dmContainer = document.createElement('div');
32799		dmContainer.id = dm.id;
32800		mediaElement.appendChild(dmContainer);
32801		if (mediaElement.originalNode) {
32802			dmContainer.style.width = mediaElement.originalNode.style.width;
32803			dmContainer.style.height = mediaElement.originalNode.style.height;
32804		}
32805		mediaElement.originalNode.style.display = 'none';
32806
32807		var videoId = DailyMotionApi.getDailyMotionId(mediaFiles[0].src),
32808		    dmSettings = Object.assign({
32809			id: dm.id,
32810			container: dmContainer,
32811			videoId: videoId
32812		}, dm.options.dailymotion);
32813
32814		if (mediaElement.originalNode.autoplay) {
32815			dmSettings.params.autoplay = true;
32816		}
32817		if (mediaElement.originalNode.muted) {
32818			dmSettings.params.mute = true;
32819		}
32820
32821		DailyMotionApi.enqueueIframe(dmSettings);
32822
32823		dm.hide = function () {
32824			dm.pause();
32825			if (dmIframe) {
32826				dmIframe.style.display = 'none';
32827			}
32828		};
32829		dm.show = function () {
32830			if (dmIframe) {
32831				dmIframe.style.display = '';
32832			}
32833		};
32834		dm.setSize = function (width, height) {
32835			if (dmIframe) {
32836				dmIframe.width = width;
32837				dmIframe.height = height;
32838			}
32839		};
32840		dm.destroy = function () {
32841			dmPlayer.destroy();
32842		};
32843
32844		return dm;
32845	}
32846};
32847
32848mejs.Utils.typeChecks.push(function (url) {
32849	return (/\/\/((www\.)?dailymotion\.com|dai\.ly)/i.test(url) ? 'video/x-dailymotion' : null
32850	);
32851});
32852
32853window.dmAsyncInit = function () {
32854	DailyMotionApi.apiReady();
32855};
32856
32857mejs.Renderers.add(DailyMotionIframeRenderer);
32858
32859},{}]},{},[1]);
32860
32861
32862/*  facebook  */
32863/*!
32864 * MediaElement.js
32865 * http://www.mediaelementjs.com/
32866 *
32867 * Wrapper that mimics native HTML5 MediaElement (audio and video)
32868 * using a variety of technologies (pure JavaScript, Flash, iframe)
32869 *
32870 * Copyright 2010-2017, John Dyer (http://j.hn/)
32871 * License: MIT
32872 *
32873 */(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
32874'use strict';
32875
32876var FacebookRenderer = {
32877	name: 'facebook',
32878	options: {
32879		prefix: 'facebook',
32880		facebook: {
32881			appId: '{your-app-id}',
32882			xfbml: true,
32883			version: 'v2.6'
32884		}
32885	},
32886
32887	canPlayType: function canPlayType(type) {
32888		return ~['video/facebook', 'video/x-facebook'].indexOf(type.toLowerCase());
32889	},
32890
32891	create: function create(mediaElement, options, mediaFiles) {
32892
32893		var fbWrapper = {},
32894		    apiStack = [],
32895		    eventHandler = {},
32896		    readyState = 4,
32897		    autoplay = mediaElement.originalNode.autoplay;
32898
32899		var src = '',
32900		    paused = true,
32901		    ended = false,
32902		    hasStartedPlaying = false,
32903		    fbApi = null,
32904		    fbDiv = null;
32905
32906		options = Object.assign(options, mediaElement.options);
32907		fbWrapper.options = options;
32908		fbWrapper.id = mediaElement.id + '_' + options.prefix;
32909		fbWrapper.mediaElement = mediaElement;
32910
32911		var props = mejs.html5media.properties,
32912		    assignGettersSetters = function assignGettersSetters(propName) {
32913
32914			var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
32915
32916			fbWrapper['get' + capName] = function () {
32917
32918
32919				if (fbApi !== null) {
32920					var value = null;
32921
32922					switch (propName) {
32923						case 'currentTime':
32924							return fbApi.getCurrentPosition();
32925						case 'duration':
32926							return fbApi.getDuration();
32927						case 'volume':
32928							return fbApi.getVolume();
32929						case 'paused':
32930							return paused;
32931						case 'ended':
32932							return ended;
32933						case 'muted':
32934							return fbApi.isMuted();
32935						case 'buffered':
32936							return {
32937								start: function start() {
32938									return 0;
32939								},
32940								end: function end() {
32941									return 0;
32942								},
32943								length: 1
32944							};
32945						case 'src':
32946							return src;
32947						case 'readyState':
32948							return readyState;
32949					}
32950
32951					return value;
32952				} else {
32953					return null;
32954				}
32955			};
32956
32957			fbWrapper['set' + capName] = function (value) {
32958
32959				if (fbApi !== null) {
32960
32961					switch (propName) {
32962						case 'src':
32963							var url = typeof value === 'string' ? value : value[0].src;
32964
32965							fbDiv.remove();
32966							createFacebookEmbed(url, options.facebook);
32967
32968							FB.XFBML.parse();
32969
32970							if (autoplay) {
32971								fbApi.play();
32972							}
32973
32974							break;
32975						case 'currentTime':
32976							fbApi.seek(value);
32977							break;
32978						case 'muted':
32979							if (value) {
32980								fbApi.mute();
32981							} else {
32982								fbApi.unmute();
32983							}
32984							setTimeout(function () {
32985								var event = mejs.Utils.createEvent('volumechange', fbWrapper);
32986								mediaElement.dispatchEvent(event);
32987							}, 50);
32988							break;
32989						case 'volume':
32990							fbApi.setVolume(value);
32991							setTimeout(function () {
32992								var event = mejs.Utils.createEvent('volumechange', fbWrapper);
32993								mediaElement.dispatchEvent(event);
32994							}, 50);
32995							break;
32996						case 'readyState':
32997							var event = mejs.Utils.createEvent('canplay', fbWrapper);
32998							mediaElement.dispatchEvent(event);
32999							break;
33000						default:
33001							
33002							break;
33003					}
33004				} else {
33005					apiStack.push({ type: 'set', propName: propName, value: value });
33006				}
33007			};
33008		};
33009
33010		for (var i = 0, total = props.length; i < total; i++) {
33011			assignGettersSetters(props[i]);
33012		}
33013
33014		var methods = mejs.html5media.methods,
33015		    assignMethods = function assignMethods(methodName) {
33016			fbWrapper[methodName] = function () {
33017				if (fbApi !== null) {
33018					switch (methodName) {
33019						case 'play':
33020							return fbApi.play();
33021						case 'pause':
33022							return fbApi.pause();
33023						case 'load':
33024							return null;
33025					}
33026				} else {
33027					apiStack.push({ type: 'call', methodName: methodName });
33028				}
33029			};
33030		};
33031
33032		for (var _i = 0, _total = methods.length; _i < _total; _i++) {
33033			assignMethods(methods[_i]);
33034		}
33035
33036		function sendEvents(events) {
33037			for (var _i2 = 0, _total2 = events.length; _i2 < _total2; _i2++) {
33038				var event = mejs.Utils.createEvent(events[_i2], fbWrapper);
33039				mediaElement.dispatchEvent(event);
33040			}
33041		}
33042
33043		function createFacebookEmbed(url, config) {
33044			src = url;
33045
33046			fbDiv = document.createElement('div');
33047			fbDiv.id = fbWrapper.id;
33048			fbDiv.className = "fb-video";
33049			fbDiv.setAttribute("data-href", url);
33050			fbDiv.setAttribute("data-allowfullscreen", "true");
33051			fbDiv.setAttribute("data-controls", "false");
33052
33053			mediaElement.originalNode.parentNode.insertBefore(fbDiv, mediaElement.originalNode);
33054			mediaElement.originalNode.style.display = 'none';
33055
33056			window.fbAsyncInit = function () {
33057
33058				FB.init(config);
33059
33060				FB.Event.subscribe('xfbml.ready', function (msg) {
33061
33062					if (msg.type === 'video') {
33063
33064						fbApi = msg.instance;
33065
33066						var fbIframe = fbDiv.getElementsByTagName('iframe')[0],
33067						    width = fbIframe.offsetWidth,
33068						    height = fbIframe.offsetHeight,
33069						    events = ['mouseover', 'mouseout'],
33070						    assignEvents = function assignEvents(e) {
33071							var event = mejs.Utils.createEvent(e.type, fbWrapper);
33072							mediaElement.dispatchEvent(event);
33073						};
33074
33075						fbWrapper.setSize(width, height);
33076
33077						if (autoplay) {
33078							fbApi.play();
33079						}
33080
33081						for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
33082							fbIframe.addEventListener(events[_i3], assignEvents, false);
33083						}
33084
33085						var fbEvents = ['startedPlaying', 'paused', 'finishedPlaying', 'startedBuffering', 'finishedBuffering'];
33086						for (var _i4 = 0, _total4 = fbEvents.length; _i4 < _total4; _i4++) {
33087							var event = fbEvents[_i4],
33088							    handler = eventHandler[event];
33089							if (handler !== undefined && handler !== null && !mejs.Utils.isObjectEmpty(handler) && typeof handler.removeListener === 'function') {
33090								handler.removeListener(event);
33091							}
33092						}
33093
33094						if (apiStack.length) {
33095							for (var _i5 = 0, _total5 = apiStack.length; _i5 < _total5; _i5++) {
33096
33097								var stackItem = apiStack[_i5];
33098
33099								if (stackItem.type === 'set') {
33100									var propName = stackItem.propName,
33101									    capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
33102
33103									fbWrapper['set' + capName](stackItem.value);
33104								} else if (stackItem.type === 'call') {
33105									fbWrapper[stackItem.methodName]();
33106								}
33107							}
33108						}
33109
33110						sendEvents(['rendererready', 'loadeddata', 'canplay', 'progress', 'loadedmetadata', 'timeupdate']);
33111
33112						var timer = void 0;
33113
33114						eventHandler.startedPlaying = fbApi.subscribe('startedPlaying', function () {
33115							if (!hasStartedPlaying) {
33116								hasStartedPlaying = true;
33117							}
33118							paused = false;
33119							ended = false;
33120							sendEvents(['play', 'playing', 'timeupdate']);
33121
33122							timer = setInterval(function () {
33123								fbApi.getCurrentPosition();
33124								sendEvents(['timeupdate']);
33125							}, 250);
33126						});
33127						eventHandler.paused = fbApi.subscribe('paused', function () {
33128							paused = true;
33129							ended = false;
33130							sendEvents(['pause']);
33131						});
33132						eventHandler.finishedPlaying = fbApi.subscribe('finishedPlaying', function () {
33133							paused = true;
33134							ended = true;
33135
33136							sendEvents(['ended']);
33137							clearInterval(timer);
33138							timer = null;
33139						});
33140						eventHandler.startedBuffering = fbApi.subscribe('startedBuffering', function () {
33141							sendEvents(['progress', 'timeupdate']);
33142						});
33143						eventHandler.finishedBuffering = fbApi.subscribe('finishedBuffering', function () {
33144							sendEvents(['progress', 'timeupdate']);
33145						});
33146					}
33147				});
33148			};
33149
33150			mejs.Utils.loadScript('https://connect.facebook.net/en_US/sdk.js');
33151		}
33152
33153		if (mediaFiles.length > 0) {
33154			createFacebookEmbed(mediaFiles[0].src, fbWrapper.options.facebook);
33155		}
33156
33157		fbWrapper.hide = function () {
33158			fbWrapper.stopInterval();
33159			fbWrapper.pause();
33160			if (fbDiv) {
33161				fbDiv.style.display = 'none';
33162			}
33163		};
33164		fbWrapper.show = function () {
33165			if (fbDiv) {
33166				fbDiv.style.display = '';
33167			}
33168		};
33169		fbWrapper.setSize = function (width, height) {
33170			if (fbApi !== null && !isNaN(width) && !isNaN(height)) {
33171				fbDiv.style.width = width;
33172				fbDiv.style.height = height;
33173			}
33174		};
33175		fbWrapper.destroy = function () {};
33176		fbWrapper.interval = null;
33177
33178		fbWrapper.startInterval = function () {
33179			fbWrapper.interval = setInterval(function () {
33180				var event = mejs.Utils.createEvent('timeupdate', fbWrapper);
33181				mediaElement.dispatchEvent(event);
33182			}, 250);
33183		};
33184		fbWrapper.stopInterval = function () {
33185			if (fbWrapper.interval) {
33186				clearInterval(fbWrapper.interval);
33187			}
33188		};
33189
33190		return fbWrapper;
33191	}
33192};
33193
33194mejs.Utils.typeChecks.push(function (url) {
33195	return ~url.toLowerCase().indexOf('//www.facebook') ? 'video/x-facebook' : null;
33196});
33197
33198mejs.Renderers.add(FacebookRenderer);
33199
33200},{}]},{},[1]);
33201
33202
33203/*  soundcloud  */
33204/*!
33205 * MediaElement.js
33206 * http://www.mediaelementjs.com/
33207 *
33208 * Wrapper that mimics native HTML5 MediaElement (audio and video)
33209 * using a variety of technologies (pure JavaScript, Flash, iframe)
33210 *
33211 * Copyright 2010-2017, John Dyer (http://j.hn/)
33212 * License: MIT
33213 *
33214 */(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
33215'use strict';
33216
33217var SoundCloudApi = {
33218
33219	promise: null,
33220
33221	load: function load(settings) {
33222
33223		if (typeof SC !== 'undefined') {
33224			SoundCloudApi._createPlayer(settings);
33225		} else {
33226			SoundCloudApi.promise = SoundCloudApi.promise || mejs.Utils.loadScript('https://w.soundcloud.com/player/api.js');
33227			SoundCloudApi.promise.then(function () {
33228				SoundCloudApi._createPlayer(settings);
33229			});
33230		}
33231	},
33232
33233	_createPlayer: function _createPlayer(settings) {
33234		var player = SC.Widget(settings.iframe);
33235		window['__ready__' + settings.id](player);
33236	}
33237};
33238
33239var SoundCloudIframeRenderer = {
33240	name: 'soundcloud_iframe',
33241	options: {
33242		prefix: 'soundcloud_iframe'
33243	},
33244
33245	canPlayType: function canPlayType(type) {
33246		return ~['video/soundcloud', 'video/x-soundcloud'].indexOf(type.toLowerCase());
33247	},
33248
33249	create: function create(mediaElement, options, mediaFiles) {
33250		var sc = {},
33251		    apiStack = [],
33252		    readyState = 4,
33253		    autoplay = mediaElement.originalNode.autoplay;
33254
33255		var duration = 0,
33256		    currentTime = 0,
33257		    bufferedTime = 0,
33258		    volume = 1,
33259		    muted = false,
33260		    paused = true,
33261		    ended = false,
33262		    scPlayer = null,
33263		    scIframe = null;
33264
33265		sc.options = options;
33266		sc.id = mediaElement.id + '_' + options.prefix;
33267		sc.mediaElement = mediaElement;
33268
33269		var props = mejs.html5media.properties,
33270		    assignGettersSetters = function assignGettersSetters(propName) {
33271			var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
33272
33273			sc['get' + capName] = function () {
33274				if (scPlayer !== null) {
33275					var value = null;
33276
33277					switch (propName) {
33278						case 'currentTime':
33279							return currentTime;
33280						case 'duration':
33281							return duration;
33282						case 'volume':
33283							return volume;
33284						case 'paused':
33285							return paused;
33286						case 'ended':
33287							return ended;
33288						case 'muted':
33289							return muted;
33290						case 'buffered':
33291							return {
33292								start: function start() {
33293									return 0;
33294								},
33295								end: function end() {
33296									return bufferedTime * duration;
33297								},
33298								length: 1
33299							};
33300						case 'src':
33301							return scIframe ? scIframe.src : '';
33302						case 'readyState':
33303							return readyState;
33304					}
33305					return value;
33306				} else {
33307					return null;
33308				}
33309			};
33310
33311			sc['set' + capName] = function (value) {
33312				if (scPlayer !== null) {
33313					switch (propName) {
33314						case 'src':
33315							var url = typeof value === 'string' ? value : value[0].src;
33316							scPlayer.load(url);
33317							if (autoplay) {
33318								scPlayer.play();
33319							}
33320							break;
33321						case 'currentTime':
33322							scPlayer.seekTo(value * 1000);
33323							break;
33324						case 'muted':
33325							if (value) {
33326								scPlayer.setVolume(0);
33327							} else {
33328								scPlayer.setVolume(1);
33329							}
33330							setTimeout(function () {
33331								var event = mejs.Utils.createEvent('volumechange', sc);
33332								mediaElement.dispatchEvent(event);
33333							}, 50);
33334							break;
33335						case 'volume':
33336							scPlayer.setVolume(value);
33337							setTimeout(function () {
33338								var event = mejs.Utils.createEvent('volumechange', sc);
33339								mediaElement.dispatchEvent(event);
33340							}, 50);
33341							break;
33342						case 'readyState':
33343							var event = mejs.Utils.createEvent('canplay', sc);
33344							mediaElement.dispatchEvent(event);
33345							break;
33346
33347						default:
33348							
33349							break;
33350					}
33351				} else {
33352					apiStack.push({ type: 'set', propName: propName, value: value });
33353				}
33354			};
33355		};
33356
33357		for (var i = 0, total = props.length; i < total; i++) {
33358			assignGettersSetters(props[i]);
33359		}
33360
33361		var methods = mejs.html5media.methods,
33362		    assignMethods = function assignMethods(methodName) {
33363			sc[methodName] = function () {
33364				if (scPlayer !== null) {
33365					switch (methodName) {
33366						case 'play':
33367							return scPlayer.play();
33368						case 'pause':
33369							return scPlayer.pause();
33370						case 'load':
33371							return null;
33372					}
33373				} else {
33374					apiStack.push({ type: 'call', methodName: methodName });
33375				}
33376			};
33377		};
33378
33379		for (var _i = 0, _total = methods.length; _i < _total; _i++) {
33380			assignMethods(methods[_i]);
33381		}
33382
33383		window['__ready__' + sc.id] = function (_scPlayer) {
33384
33385			mediaElement.scPlayer = scPlayer = _scPlayer;
33386
33387			if (autoplay) {
33388				scPlayer.play();
33389			}
33390
33391			if (apiStack.length) {
33392				for (var _i2 = 0, _total2 = apiStack.length; _i2 < _total2; _i2++) {
33393
33394					var stackItem = apiStack[_i2];
33395
33396					if (stackItem.type === 'set') {
33397						var propName = stackItem.propName,
33398						    capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
33399
33400						sc['set' + capName](stackItem.value);
33401					} else if (stackItem.type === 'call') {
33402						sc[stackItem.methodName]();
33403					}
33404				}
33405			}
33406
33407			scPlayer.bind(SC.Widget.Events.PLAY_PROGRESS, function () {
33408				paused = false;
33409				ended = false;
33410				scPlayer.getPosition(function (_currentTime) {
33411					currentTime = _currentTime / 1000;
33412					var event = mejs.Utils.createEvent('timeupdate', sc);
33413					mediaElement.dispatchEvent(event);
33414				});
33415			});
33416			scPlayer.bind(SC.Widget.Events.PAUSE, function () {
33417				paused = true;
33418				var event = mejs.Utils.createEvent('pause', sc);
33419				mediaElement.dispatchEvent(event);
33420			});
33421			scPlayer.bind(SC.Widget.Events.PLAY, function () {
33422				paused = false;
33423				ended = false;
33424				var event = mejs.Utils.createEvent('play', sc);
33425				mediaElement.dispatchEvent(event);
33426			});
33427			scPlayer.bind(SC.Widget.Events.FINISHED, function () {
33428				paused = false;
33429				ended = true;
33430				var event = mejs.Utils.createEvent('ended', sc);
33431				mediaElement.dispatchEvent(event);
33432			});
33433			scPlayer.bind(SC.Widget.Events.READY, function () {
33434				scPlayer.getDuration(function (_duration) {
33435					duration = _duration / 1000;
33436					var event = mejs.Utils.createEvent('loadedmetadata', sc);
33437					mediaElement.dispatchEvent(event);
33438				});
33439			});
33440			scPlayer.bind(SC.Widget.Events.LOAD_PROGRESS, function () {
33441				scPlayer.getDuration(function (loadProgress) {
33442					if (duration > 0) {
33443						bufferedTime = duration * loadProgress;
33444						var event = mejs.Utils.createEvent('progress', sc);
33445						mediaElement.dispatchEvent(event);
33446					}
33447				});
33448				scPlayer.getDuration(function (_duration) {
33449					duration = _duration;
33450
33451					var event = mejs.Utils.createEvent('loadedmetadata', sc);
33452					mediaElement.dispatchEvent(event);
33453				});
33454			});
33455
33456			var initEvents = ['rendererready', 'loadeddata', 'loadedmetadata', 'canplay'];
33457			for (var _i3 = 0, _total3 = initEvents.length; _i3 < _total3; _i3++) {
33458				var event = mejs.Utils.createEvent(initEvents[_i3], sc);
33459				mediaElement.dispatchEvent(event);
33460			}
33461		};
33462
33463		scIframe = document.createElement('iframe');
33464		scIframe.id = sc.id;
33465		scIframe.width = 10;
33466		scIframe.height = 10;
33467		scIframe.frameBorder = 0;
33468		scIframe.style.visibility = 'hidden';
33469		scIframe.src = mediaFiles[0].src;
33470		scIframe.scrolling = 'no';
33471
33472		mediaElement.appendChild(scIframe);
33473		mediaElement.originalNode.style.display = 'none';
33474
33475		var scSettings = {
33476			iframe: scIframe,
33477			id: sc.id
33478		};
33479
33480		SoundCloudApi.load(scSettings);
33481
33482		sc.setSize = function () {};
33483		sc.hide = function () {
33484			sc.pause();
33485			if (scIframe) {
33486				scIframe.style.display = 'none';
33487			}
33488		};
33489		sc.show = function () {
33490			if (scIframe) {
33491				scIframe.style.display = '';
33492			}
33493		};
33494		sc.destroy = function () {
33495			scPlayer.destroy();
33496		};
33497
33498		return sc;
33499	}
33500};
33501
33502mejs.Utils.typeChecks.push(function (url) {
33503	return (/\/\/(w\.)?soundcloud.com/i.test(url) ? 'video/x-soundcloud' : null
33504	);
33505});
33506
33507mejs.Renderers.add(SoundCloudIframeRenderer);
33508
33509},{}]},{},[1]);
33510
33511
33512/*  twitch  */
33513/*!
33514 * MediaElement.js
33515 * http://www.mediaelementjs.com/
33516 *
33517 * Wrapper that mimics native HTML5 MediaElement (audio and video)
33518 * using a variety of technologies (pure JavaScript, Flash, iframe)
33519 *
33520 * Copyright 2010-2017, John Dyer (http://j.hn/)
33521 * License: MIT
33522 *
33523 */(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
33524'use strict';
33525
33526var TwitchApi = {
33527
33528	promise: null,
33529
33530	load: function load(settings) {
33531		if (typeof Twitch !== 'undefined') {
33532			TwitchApi._createPlayer(settings);
33533		} else if (!TwitchApi.promise) {
33534			TwitchApi.promise = TwitchApi.promise || mejs.Utils.loadScript('https://player.twitch.tv/js/embed/v1.js');
33535			TwitchApi.promise.then(function () {
33536				TwitchApi._createPlayer(settings);
33537			});
33538		}
33539
33540		return TwitchApi.promise;
33541	},
33542
33543	_createPlayer: function _createPlayer(settings) {
33544		var player = new Twitch.Player(settings.id, settings);
33545		window['__ready__' + settings.id](player);
33546	},
33547
33548	getTwitchId: function getTwitchId(url) {
33549		var twitchId = '';
33550
33551		if (url.indexOf('?') > 0) {
33552			twitchId = TwitchApi.getTwitchIdFromParam(url);
33553			if (twitchId === '') {
33554				twitchId = TwitchApi.getTwitchIdFromUrl(url);
33555			}
33556		} else {
33557			twitchId = TwitchApi.getTwitchIdFromUrl(url);
33558		}
33559
vendor: 7,664 bytes, lines 33560-33846
33560		return twitchId;
33561	},
33562
33563	getTwitchIdFromParam: function getTwitchIdFromParam(url) {
33564		if (url === undefined || url === null || !url.trim().length) {
33565			return null;
33566		}
33567
33568		var parts = url.split('?'),
33569		    parameters = parts[1].split('&');
33570
33571		var twitchId = '';
33572
33573		for (var i = 0, total = parameters.length; i < total; i++) {
33574			var paramParts = parameters[i].split('=');
33575			if (~paramParts[0].indexOf('channel=')) {
33576				twitchId = paramParts[1];
33577				break;
33578			} else if (~paramParts[0].indexOf('video=')) {
33579				twitchId = 'v' + paramParts[1];
33580				break;
33581			}
33582		}
33583
33584		return twitchId;
33585	},
33586
33587	getTwitchIdFromUrl: function getTwitchIdFromUrl(url) {
33588		if (url === undefined || url === null || !url.trim().length) {
33589			return null;
33590		}
33591
33592		var parts = url.split('?');
33593		url = parts[0];
33594		var id = url.substring(url.lastIndexOf('/') + 1);
33595		return (/^\d+$/i.test(id) !== null ? 'v' + id : id
33596		);
33597	},
33598
33599	getTwitchType: function getTwitchType(id) {
33600		return (/^v\d+/i.test(id) !== null ? 'video' : 'channel'
33601		);
33602	}
33603};
33604
33605var TwitchIframeRenderer = {
33606	name: 'twitch_iframe',
33607	options: {
33608		prefix: 'twitch_iframe'
33609	},
33610
33611	canPlayType: function canPlayType(type) {
33612		return ~['video/twitch', 'video/x-twitch'].indexOf(type.toLowerCase());
33613	},
33614
33615	create: function create(mediaElement, options, mediaFiles) {
33616		var twitch = {},
33617		    apiStack = [],
33618		    readyState = 4,
33619		    twitchId = TwitchApi.getTwitchId(mediaFiles[0].src);
33620
33621		var twitchPlayer = null,
33622		    paused = true,
33623		    ended = false,
33624		    hasStartedPlaying = false,
33625		    volume = 1,
33626		    duration = Infinity,
33627		    time = 0;
33628
33629		twitch.options = options;
33630		twitch.id = mediaElement.id + '_' + options.prefix;
33631		twitch.mediaElement = mediaElement;
33632
33633		var props = mejs.html5media.properties,
33634		    assignGettersSetters = function assignGettersSetters(propName) {
33635			var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
33636
33637			twitch['get' + capName] = function () {
33638				if (twitchPlayer !== null) {
33639					var value = null;
33640
33641					switch (propName) {
33642						case 'currentTime':
33643							time = twitchPlayer.getCurrentTime();
33644							return time;
33645						case 'duration':
33646							duration = twitchPlayer.getDuration();
33647							return duration;
33648						case 'volume':
33649							volume = twitchPlayer.getVolume();
33650							return volume;
33651						case 'paused':
33652							paused = twitchPlayer.isPaused();
33653							return paused;
33654						case 'ended':
33655							ended = twitchPlayer.getEnded();
33656							return ended;
33657						case 'muted':
33658							return twitchPlayer.getMuted();
33659						case 'buffered':
33660							return {
33661								start: function start() {
33662									return 0;
33663								},
33664								end: function end() {
33665									return 0;
33666								},
33667								length: 1
33668							};
33669						case 'src':
33670							return TwitchApi.getTwitchType(twitchId) === 'channel' ? twitchPlayer.getChannel() : twitchPlayer.getVideo();
33671						case 'readyState':
33672							return readyState;
33673					}
33674
33675					return value;
33676				} else {
33677					return null;
33678				}
33679			};
33680
33681			twitch['set' + capName] = function (value) {
33682				if (twitchPlayer !== null) {
33683					switch (propName) {
33684						case 'src':
33685							var url = typeof value === 'string' ? value : value[0].src,
33686							    videoId = TwitchApi.getTwitchId(url);
33687
33688							if (TwitchApi.getTwitchType(twitchId) === 'channel') {
33689								twitchPlayer.setChannel(videoId);
33690							} else {
33691								twitchPlayer.setVideo(videoId);
33692							}
33693							break;
33694						case 'currentTime':
33695							twitchPlayer.seek(value);
33696							setTimeout(function () {
33697								var event = mejs.Utils.createEvent('timeupdate', twitch);
33698								mediaElement.dispatchEvent(event);
33699							}, 50);
33700							break;
33701						case 'muted':
33702							twitchPlayer.setMuted(value);
33703							setTimeout(function () {
33704								var event = mejs.Utils.createEvent('volumechange', twitch);
33705								mediaElement.dispatchEvent(event);
33706							}, 50);
33707							break;
33708						case 'volume':
33709							volume = value;
33710							twitchPlayer.setVolume(value);
33711							setTimeout(function () {
33712								var event = mejs.Utils.createEvent('volumechange', twitch);
33713								mediaElement.dispatchEvent(event);
33714							}, 50);
33715							break;
33716						case 'readyState':
33717							var event = mejs.Utils.createEvent('canplay', twitch);
33718							mediaElement.dispatchEvent(event);
33719							break;
33720						default:
33721							
33722							break;
33723					}
33724				} else {
33725					apiStack.push({ type: 'set', propName: propName, value: value });
33726				}
33727			};
33728		};
33729
33730		for (var i = 0, total = props.length; i < total; i++) {
33731			assignGettersSetters(props[i]);
33732		}
33733
33734		var methods = mejs.html5media.methods,
33735		    assignMethods = function assignMethods(methodName) {
33736			twitch[methodName] = function () {
33737				if (twitchPlayer !== null) {
33738					switch (methodName) {
33739						case 'play':
33740							paused = false;
33741							return twitchPlayer.play();
33742						case 'pause':
33743							paused = true;
33744							return twitchPlayer.pause();
33745						case 'load':
33746							return null;
33747					}
33748				} else {
33749					apiStack.push({ type: 'call', methodName: methodName });
33750				}
33751			};
33752		};
33753
33754		for (var _i = 0, _total = methods.length; _i < _total; _i++) {
33755			assignMethods(methods[_i]);
33756		}
33757
33758		function sendEvents(events) {
33759			for (var _i2 = 0, _total2 = events.length; _i2 < _total2; _i2++) {
33760				var event = mejs.Utils.createEvent(events[_i2], twitch);
33761				mediaElement.dispatchEvent(event);
33762			}
33763		}
33764
33765		window['__ready__' + twitch.id] = function (_twitchPlayer) {
33766			mediaElement.twitchPlayer = twitchPlayer = _twitchPlayer;
33767
33768			if (apiStack.length) {
33769				for (var _i3 = 0, _total3 = apiStack.length; _i3 < _total3; _i3++) {
33770					var stackItem = apiStack[_i3];
33771
33772					if (stackItem.type === 'set') {
33773						var propName = stackItem.propName,
33774						    capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
33775
33776						twitch['set' + capName](stackItem.value);
33777					} else if (stackItem.type === 'call') {
33778						twitch[stackItem.methodName]();
33779					}
33780				}
33781			}
33782
33783			var twitchIframe = document.getElementById(twitch.id).firstChild;
33784			twitchIframe.style.width = '100%';
33785			twitchIframe.style.height = '100%';
33786
33787			var events = ['mouseover', 'mouseout'],
33788			    assignEvents = function assignEvents(e) {
33789				var event = createEvent(e.type, twitch);
33790				mediaElement.dispatchEvent(event);
33791			};
33792
33793			for (var _i4 = 0, _total4 = events.length; _i4 < _total4; _i4++) {
33794				twitchIframe.addEventListener(events[_i4], assignEvents, false);
33795			}
33796
33797			var timer = void 0;
33798
33799			twitchPlayer.addEventListener('ready', function () {
33800				paused = false;
33801				ended = false;
33802				sendEvents(['rendererready', 'loadedmetadata', 'loadeddata', 'canplay']);
33803			});
33804			twitchPlayer.addEventListener('play', function () {
33805				if (!hasStartedPlaying) {
33806					hasStartedPlaying = true;
33807				}
33808				paused = false;
33809				ended = false;
33810				sendEvents(['play', 'playing', 'progress']);
33811
33812				timer = setInterval(function () {
33813					twitchPlayer.getCurrentTime();
33814					sendEvents(['timeupdate']);
33815				}, 250);
33816			});
33817			twitchPlayer.addEventListener('pause', function () {
33818				paused = true;
33819				ended = false;
33820				if (!twitchPlayer.getEnded()) {
33821					sendEvents(['pause']);
33822				}
33823			});
33824			twitchPlayer.addEventListener('ended', function () {
33825				paused = true;
33826				ended = true;
33827				sendEvents(['ended']);
33828				clearInterval(timer);
33829				hasStartedPlaying = false;
33830				timer = null;
33831			});
33832		};
33833
33834		var height = mediaElement.originalNode.height,
33835		    width = mediaElement.originalNode.width,
33836		    twitchContainer = document.createElement('div'),
33837		    type = TwitchApi.getTwitchType(twitchId),
33838		    twitchSettings = {
33839			id: twitch.id,
33840			width: width,
33841			height: height,
33842			playsinline: false,
33843			autoplay: mediaElement.originalNode.autoplay,
33844			muted: mediaElement.originalNode.muted
33845		};
33846
33847		twitchSettings[type] = twitchId;
33848		twitchContainer.id = twitch.id;
33849		twitchContainer.style.width = '100%';
33850		twitchContainer.style.height = '100%';
33851
33852		mediaElement.originalNode.parentNode.insertBefore(twitchContainer, mediaElement.originalNode);
33853		mediaElement.originalNode.style.display = 'none';
33854		mediaElement.originalNode.autoplay = false;
33855
33856		twitch.setSize = function (width, height) {
33857			if (TwitchApi !== null && !isNaN(width) && !isNaN(height)) {
33858				twitchContainer.setAttribute('width', width);
33859				twitchContainer.setAttribute('height', height);
33860			}
33861		};
33862		twitch.hide = function () {
33863			twitch.pause();
33864			twitchContainer.style.display = 'none';
33865		};
33866		twitch.show = function () {
33867			twitchContainer.style.display = '';
33868		};
33869		twitch.destroy = function () {};
33870
33871		mediaElement.promises.push(TwitchApi.load(twitchSettings));
33872
33873		return twitch;
33874	}
33875};
33876
33877mejs.Utils.typeChecks.push(function (url) {
33878	return (/\/\/(www|player).twitch.tv/i.test(url) ? 'video/x-twitch' : null
33879	);
33880});
33881
33882mejs.Renderers.add(TwitchIframeRenderer);
33883
33884},{}]},{},[1]);
33885
33886
33887/*  vimeo  */
33888/*!
33889 * MediaElement.js
33890 * http://www.mediaelementjs.com/
33891 *
33892 * Wrapper that mimics native HTML5 MediaElement (audio and video)
33893 * using a variety of technologies (pure JavaScript, Flash, iframe)
33894 *
33895 * Copyright 2010-2017, John Dyer (http://j.hn/)
33896 * License: MIT
33897 *
33898 */(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
33899'use strict';
33900
33901var VimeoApi = {
33902
33903	promise: null,
33904
33905	load: function load(settings) {
33906
33907		if (typeof Vimeo !== 'undefined') {
33908			VimeoApi._createPlayer(settings);
33909		} else {
33910			VimeoApi.promise = VimeoApi.promise || mejs.Utils.loadScript('https://player.vimeo.com/api/player.js');
33911			VimeoApi.promise.then(function () {
33912				VimeoApi._createPlayer(settings);
33913			});
33914		}
33915	},
33916
33917	_createPlayer: function _createPlayer(settings) {
33918		var player = new Vimeo.Player(settings.iframe);
33919		window['__ready__' + settings.id](player);
33920	},
33921
33922	getVimeoId: function getVimeoId(url) {
33923		if (url === undefined || url === null) {
33924			return null;
33925		}
33926
33927		var parts = url.split('?');
33928		url = parts[0];
33929		return parseInt(url.substring(url.lastIndexOf('/') + 1));
33930	}
33931};
33932
33933var vimeoIframeRenderer = {
33934
33935	name: 'vimeo_iframe',
33936	options: {
33937		prefix: 'vimeo_iframe'
33938	},
33939
33940	canPlayType: function canPlayType(type) {
33941		return ~['video/vimeo', 'video/x-vimeo'].indexOf(type.toLowerCase());
33942	},
33943
33944	create: function create(mediaElement, options, mediaFiles) {
33945		var apiStack = [],
33946		    vimeo = {},
33947		    readyState = 4;
33948
33949		var paused = true,
33950		    volume = 1,
33951		    oldVolume = volume,
33952		    currentTime = 0,
33953		    bufferedTime = 0,
33954		    ended = false,
33955		    duration = 0,
33956		    vimeoPlayer = null,
33957		    url = '';
33958
33959		vimeo.options = options;
33960		vimeo.id = mediaElement.id + '_' + options.prefix;
33961		vimeo.mediaElement = mediaElement;
33962
33963		var errorHandler = function errorHandler(error, target) {
33964			var event = mejs.Utils.createEvent('error', target);
33965			event.message = error.name + ': ' + error.message;
33966			mediaElement.dispatchEvent(event);
33967		};
33968
33969		var props = mejs.html5media.properties,
33970		    assignGettersSetters = function assignGettersSetters(propName) {
33971
33972			var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
33973
33974			vimeo['get' + capName] = function () {
33975				if (vimeoPlayer !== null) {
33976					var value = null;
33977
33978					switch (propName) {
33979						case 'currentTime':
33980							return currentTime;
33981
33982						case 'duration':
33983							return duration;
33984
33985						case 'volume':
33986							return volume;
33987						case 'muted':
33988							return volume === 0;
33989						case 'paused':
33990							return paused;
33991						case 'ended':
33992							return ended;
33993
33994						case 'src':
33995							vimeoPlayer.getVideoUrl().then(function (_url) {
33996								url = _url;
33997							});
33998
33999							return url;
34000						case 'buffered':
34001							return {
34002								start: function start() {
34003									return 0;
34004								},
34005								end: function end() {
34006									return bufferedTime * duration;
34007								},
34008								length: 1
34009							};
34010						case 'readyState':
34011							return readyState;
34012					}
34013					return value;
34014				} else {
34015					return null;
34016				}
34017			};
34018
34019			vimeo['set' + capName] = function (value) {
34020				if (vimeoPlayer !== null) {
34021					switch (propName) {
34022						case 'src':
34023							var _url2 = typeof value === 'string' ? value : value[0].src,
34024							    videoId = VimeoApi.getVimeoId(_url2);
34025
vendor: 5,267 bytes, lines 34026-34205
34026							vimeoPlayer.loadVideo(videoId).then(function () {
34027								if (mediaElement.originalNode.autoplay) {
34028									vimeoPlayer.play();
34029								}
34030							}).catch(function (error) {
34031								errorHandler(error, vimeo);
34032							});
34033							break;
34034						case 'currentTime':
34035							vimeoPlayer.setCurrentTime(value).then(function () {
34036								currentTime = value;
34037								setTimeout(function () {
34038									var event = mejs.Utils.createEvent('timeupdate', vimeo);
34039									mediaElement.dispatchEvent(event);
34040								}, 50);
34041							}).catch(function (error) {
34042								errorHandler(error, vimeo);
34043							});
34044							break;
34045						case 'volume':
34046							vimeoPlayer.setVolume(value).then(function () {
34047								volume = value;
34048								oldVolume = volume;
34049								setTimeout(function () {
34050									var event = mejs.Utils.createEvent('volumechange', vimeo);
34051									mediaElement.dispatchEvent(event);
34052								}, 50);
34053							}).catch(function (error) {
34054								errorHandler(error, vimeo);
34055							});
34056							break;
34057						case 'loop':
34058							vimeoPlayer.setLoop(value).catch(function (error) {
34059								errorHandler(error, vimeo);
34060							});
34061							break;
34062						case 'muted':
34063							if (value) {
34064								vimeoPlayer.setVolume(0).then(function () {
34065									volume = 0;
34066									setTimeout(function () {
34067										var event = mejs.Utils.createEvent('volumechange', vimeo);
34068										mediaElement.dispatchEvent(event);
34069									}, 50);
34070								}).catch(function (error) {
34071									errorHandler(error, vimeo);
34072								});
34073							} else {
34074								vimeoPlayer.setVolume(oldVolume).then(function () {
34075									volume = oldVolume;
34076									setTimeout(function () {
34077										var event = mejs.Utils.createEvent('volumechange', vimeo);
34078										mediaElement.dispatchEvent(event);
34079									}, 50);
34080								}).catch(function (error) {
34081									errorHandler(error, vimeo);
34082								});
34083							}
34084							break;
34085						case 'readyState':
34086							var event = mejs.Utils.createEvent('canplay', vimeo);
34087							mediaElement.dispatchEvent(event);
34088							break;
34089						default:
34090							
34091							break;
34092					}
34093				} else {
34094					apiStack.push({ type: 'set', propName: propName, value: value });
34095				}
34096			};
34097		};
34098
34099		for (var i = 0, total = props.length; i < total; i++) {
34100			assignGettersSetters(props[i]);
34101		}
34102
34103		var methods = mejs.html5media.methods,
34104		    assignMethods = function assignMethods(methodName) {
34105			vimeo[methodName] = function () {
34106				if (vimeoPlayer !== null) {
34107					switch (methodName) {
34108						case 'play':
34109							paused = false;
34110							return vimeoPlayer.play();
34111						case 'pause':
34112							paused = true;
34113							return vimeoPlayer.pause();
34114						case 'load':
34115							return null;
34116					}
34117				} else {
34118					apiStack.push({ type: 'call', methodName: methodName });
34119				}
34120			};
34121		};
34122
34123		for (var _i = 0, _total = methods.length; _i < _total; _i++) {
34124			assignMethods(methods[_i]);
34125		}
34126
34127		window['__ready__' + vimeo.id] = function (_vimeoPlayer) {
34128
34129			mediaElement.vimeoPlayer = vimeoPlayer = _vimeoPlayer;
34130
34131			if (apiStack.length) {
34132				for (var _i2 = 0, _total2 = apiStack.length; _i2 < _total2; _i2++) {
34133					var stackItem = apiStack[_i2];
34134
34135					if (stackItem.type === 'set') {
34136						var propName = stackItem.propName,
34137						    capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
34138
34139						vimeo['set' + capName](stackItem.value);
34140					} else if (stackItem.type === 'call') {
34141						vimeo[stackItem.methodName]();
34142					}
34143				}
34144			}
34145
34146			var vimeoIframe = document.getElementById(vimeo.id);
34147			var events = void 0;
34148
34149			events = ['mouseover', 'mouseout'];
34150
34151			var assignEvents = function assignEvents(e) {
34152				var event = mejs.Utils.createEvent(e.type, vimeo);
34153				mediaElement.dispatchEvent(event);
34154			};
34155
34156			for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
34157				vimeoIframe.addEventListener(events[_i3], assignEvents, false);
34158			}
34159
34160			vimeoPlayer.on('loaded', function () {
34161				vimeoPlayer.getDuration().then(function (loadProgress) {
34162					duration = loadProgress;
34163					if (duration > 0) {
34164						bufferedTime = duration * loadProgress;
34165						if (mediaElement.originalNode.autoplay) {
34166							paused = false;
34167							ended = false;
34168							var event = mejs.Utils.createEvent('play', vimeo);
34169							mediaElement.dispatchEvent(event);
34170						}
34171					}
34172				}).catch(function (error) {
34173					errorHandler(error, vimeo);
34174				});
34175			});
34176			vimeoPlayer.on('progress', function () {
34177				vimeoPlayer.getDuration().then(function (loadProgress) {
34178					duration = loadProgress;
34179
34180					if (duration > 0) {
34181						bufferedTime = duration * loadProgress;
34182						if (mediaElement.originalNode.autoplay) {
34183							var initEvent = mejs.Utils.createEvent('play', vimeo);
34184							mediaElement.dispatchEvent(initEvent);
34185						}
34186					}
34187
34188					var event = mejs.Utils.createEvent('progress', vimeo);
34189					mediaElement.dispatchEvent(event);
34190				}).catch(function (error) {
34191					errorHandler(error, vimeo);
34192				});
34193			});
34194			vimeoPlayer.on('timeupdate', function () {
34195				vimeoPlayer.getCurrentTime().then(function (seconds) {
34196					currentTime = seconds;
34197
34198					var event = mejs.Utils.createEvent('timeupdate', vimeo);
34199					mediaElement.dispatchEvent(event);
34200				}).catch(function (error) {
34201					errorHandler(error, vimeo);
34202				});
34203			});
34204			vimeoPlayer.on('play', function () {
34205				paused = false;
34206				ended = false;
34207				var event = mejs.Utils.createEvent('play', vimeo);
34208				mediaElement.dispatchEvent(event);
34209			});
34210			vimeoPlayer.on('pause', function () {
34211				paused = true;
34212				ended = false;
34213
34214				var event = mejs.Utils.createEvent('pause', vimeo);
34215				mediaElement.dispatchEvent(event);
34216			});
34217			vimeoPlayer.on('ended', function () {
34218				paused = false;
34219				ended = true;
34220
34221				var event = mejs.Utils.createEvent('ended', vimeo);
34222				mediaElement.dispatchEvent(event);
34223			});
34224
34225			events = ['rendererready', 'loadedmetadata', 'loadeddata', 'canplay'];
34226
34227			for (var _i4 = 0, _total4 = events.length; _i4 < _total4; _i4++) {
34228				var event = mejs.Utils.createEvent(events[_i4], vimeo);
34229				mediaElement.dispatchEvent(event);
34230			}
34231		};
34232
34233		var height = mediaElement.originalNode.height,
34234		    width = mediaElement.originalNode.width,
34235		    vimeoContainer = document.createElement('iframe'),
34236		    standardUrl = '//player.vimeo.com/video/' + VimeoApi.getVimeoId(mediaFiles[0].src);
34237
34238		var queryArgs = ~mediaFiles[0].src.indexOf('?') ? '?' + mediaFiles[0].src.slice(mediaFiles[0].src.indexOf('?') + 1) : '';
34239		if (queryArgs && mediaElement.originalNode.autoplay && queryArgs.indexOf('autoplay') === -1) {
34240			queryArgs += '&autoplay=1';
34241		}
34242		if (queryArgs && mediaElement.originalNode.loop && queryArgs.indexOf('loop') === -1) {
34243			queryArgs += '&loop=1';
34244		}
34245
34246		vimeoContainer.setAttribute('id', vimeo.id);
34247		vimeoContainer.setAttribute('width', width);
34248		vimeoContainer.setAttribute('height', height);
34249		vimeoContainer.setAttribute('frameBorder', '0');
34250		vimeoContainer.setAttribute('src', '' + standardUrl + queryArgs);
34251		vimeoContainer.setAttribute('webkitallowfullscreen', '');
34252		vimeoContainer.setAttribute('mozallowfullscreen', '');
34253		vimeoContainer.setAttribute('allowfullscreen', '');
34254
34255		mediaElement.originalNode.parentNode.insertBefore(vimeoContainer, mediaElement.originalNode);
34256		mediaElement.originalNode.style.display = 'none';
34257
34258		VimeoApi.load({
34259			iframe: vimeoContainer,
34260			id: vimeo.id
34261		});
34262
34263		vimeo.hide = function () {
34264			vimeo.pause();
34265			if (vimeoPlayer) {
34266				vimeoContainer.style.display = 'none';
34267			}
34268		};
34269		vimeo.setSize = function (width, height) {
34270			vimeoContainer.setAttribute('width', width);
34271			vimeoContainer.setAttribute('height', height);
34272		};
34273		vimeo.show = function () {
34274			if (vimeoPlayer) {
34275				vimeoContainer.style.display = '';
34276			}
34277		};
34278
34279		return vimeo;
34280	}
34281};
34282
34283mejs.Utils.typeChecks.push(function (url) {
34284	return (/(\/\/player\.vimeo|vimeo\.com)/i.test(url) ? 'video/x-vimeo' : null
34285	);
34286});
34287
34288mejs.Renderers.add(vimeoIframeRenderer);
34289
34290},{}]},{},[1]);
34291
34292

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.