PageSourceSearch

https://www.981powerfm.com.au/_static/??-eJytktFOxSAMhl9IIBqPx3Nhf…/BV6nl/vz8+XydDqfHscv1hpiOQ==

js 981powerfm.com.au collected 2026-09-29 07:21:17 UTC 938,650 bytes, 11,483 lines download raw bytes

1/*
2*	TypeWatch 3
3*
4*	Examples/Docs: github.com/dennyferra/TypeWatch
5*  
6*  Dual licensed under the MIT and GPL licenses:
7*  http://www.opensource.org/licenses/mit-license.php
8*  http://www.gnu.org/licenses/gpl.html
9*/
10
11!function(root, factory) {
12    if (typeof define === 'function' && define.amd) {
13        define(['jquery'], factory);
14    } else if (typeof exports === 'object') {
15        factory(require('jquery'));
16    } else {
17        factory(root.jQuery);
18    }
19}(this, function($) {
20    'use strict';
21	$.fn.typeWatch = function(o) {
22		// The default input types that are supported
23		var _supportedInputTypes =
24			['TEXT', 'TEXTAREA', 'PASSWORD', 'TEL', 'SEARCH', 'URL', 'EMAIL', 'DATETIME', 'DATE', 'MONTH', 'WEEK', 'TIME', 'DATETIME-LOCAL', 'NUMBER', 'RANGE', 'DIV'];
25
26		// Options
27		var options = $.extend({
28			wait: 750,
29			callback: function() { },
30			highlight: true,
31			captureLength: 2,
32			allowSubmit: false,
33			inputTypes: _supportedInputTypes
34		}, o);
35
36		function checkElement(timer, override) {
37			var value = timer.type === 'DIV' 
38				? jQuery(timer.el).html()
39				: jQuery(timer.el).val();
40
41			// If has capture length and has changed value
42			// Or override and has capture length or allowSubmit option is true
43			// Or capture length is zero and changed value
44			if ((value.length >= options.captureLength && value != timer.text)
45				|| (override && (value.length >= options.captureLength || options.allowSubmit))
46				|| (value.length == 0 && timer.text))
47			{
48				timer.text = value;
49				timer.cb.call(timer.el, value);
50			}
51		};
52
53		function watchElement(elem) {
54			var elementType = (elem.type || elem.nodeName).toUpperCase();
55			if (jQuery.inArray(elementType, options.inputTypes) >= 0) {
56				
57				// Allocate timer element
58				var timer = {
59					timer: null,
60					text: (elementType === 'DIV') ? jQuery(elem).html() : jQuery(elem).val(),
61					cb: options.callback,
62					el: elem,
63					type: elementType,
64					wait: options.wait
65				};
66
67				// Set focus action (highlight)
68				if (options.highlight && elementType !== 'DIV')
69					jQuery(elem).focus(function() { this.select(); });
70
71				// Key watcher / clear and reset the timer
72				var startWatch = function(evt) {
73					var timerWait = timer.wait;
74					var overrideBool = false;
75					var evtElementType = elementType;
76
77					// If enter key is pressed and not a TEXTAREA or DIV
78					if (typeof evt.keyCode != 'undefined' && evt.keyCode == 13
79						&& evtElementType !== 'TEXTAREA' && elementType !== 'DIV') {
80						timerWait = 1;
81						overrideBool = true;
82					}
83
84					var timerCallbackFx = function() {
85						checkElement(timer, overrideBool)
86					}
87
88					// Clear timer
89					clearTimeout(timer.timer);
90					timer.timer = setTimeout(timerCallbackFx, timerWait);
91				};
92
93				jQuery(elem).on('keydown paste cut input', startWatch);
94			}
95		};
96
97		// Watch each element
98		return this.each(function() {
99			watchElement(this);
100		});
101	};
102});
103;
104/**
105 * Featherlight - ultra slim jQuery lightbox
106 * Version 1.7.14-UMD - http://noelboss.github.io/featherlight/
107 *
108 * Copyright 2019, Noël Raoul Bossart (http://www.noelboss.com)
109 * MIT Licensed.
110**/
111(function (factory) {
112    if (typeof define === 'function' && define.amd) {
113        // AMD. Register as an anonymous module.
114        define(['jquery'], factory);
115    } else if (typeof module === 'object' && module.exports) {
116        // Node/CommonJS
117        module.exports = function (root, jQuery) {
118            if (jQuery === undefined) {
119                // require('jQuery') returns a factory that requires window to
120                // build a jQuery instance, we normalize how we use modules
121                // that require this pattern but the window provided is a noop
122                // if it's defined (how jquery works)
123                if (typeof window !== 'undefined') {
124                    jQuery = require('jquery');
125                } else {
126                    jQuery = require('jquery')(root);
127                }
128            }
129            factory(jQuery);
130            return jQuery;
131        };
132    } else {
133        // Browser globals
134        factory(jQuery);
135    }
136})(function ($) {
137    "use strict";
138
139    if ('undefined' === typeof $) {
140        if ('console' in window) { window.console.info('Too much lightness, Featherlight needs jQuery.'); }
141        return;
142    }
143    if ($.fn.jquery.match(/-ajax/)) {
144        if ('console' in window) { window.console.info('Featherlight needs regular jQuery, not the slim version.'); }
145        return;
146    }
147	/* Featherlight is exported as $.featherlight.
148	   It is a function used to open a featherlight lightbox.
149	   [tech]
150	   Featherlight uses prototype inheritance.
151	   Each opened lightbox will have a corresponding object.
152	   That object may have some attributes that override the
153	   prototype's.
154	   Extensions created with Featherlight.extend will have their
155	   own prototype that inherits from Featherlight's prototype,
156	   thus attributes can be overriden either at the object level,
157	   or at the extension level.
158	   To create callbacks that chain themselves instead of overriding,
159	   use chainCallbacks.
160	   For those familiar with CoffeeScript, this correspond to
161	   Featherlight being a class and the Gallery being a class
162	   extending Featherlight.
163	   The chainCallbacks is used since we don't have access to
164	   CoffeeScript's `super`.
165	*/
166
167    function Featherlight($content, config) {
168        if (this instanceof Featherlight) {  /* called with new */
169            this.id = Featherlight.id++;
170            this.setup($content, config);
171            this.chainCallbacks(Featherlight._callbackChain);
172        } else {
173            var fl = new Featherlight($content, config);
174            fl.open();
175            return fl;
176        }
177    }
178
179    var opened = [],
180        pruneOpened = function (remove) {
181            opened = $.grep(opened, function (fl) {
182                return fl !== remove && fl.$instance.closest('body').length > 0;
183            });
184            return opened;
185        };
186
187    // Removes keys of `set` from `obj` and returns the removed key/values.
188    function slice(obj, set) {
189        var r = {};
190        for (var key in obj) {
191            if (key in set) {
192                r[key] = obj[key];
193                delete obj[key];
194            }
195        }
196        return r;
197    }
198
199    // NOTE: List of available [iframe attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe).
200    var iFrameAttributeSet = {
201        allow: 1, allowfullscreen: 1, frameborder: 1, height: 1, longdesc: 1, marginheight: 1, marginwidth: 1,
202        mozallowfullscreen: 1, name: 1, referrerpolicy: 1, sandbox: 1, scrolling: 1, src: 1, srcdoc: 1, style: 1,
203        webkitallowfullscreen: 1, width: 1
204    };
205
206    // Converts camelCased attributes to dasherized versions for given prefix:
207    //   parseAttrs({hello: 1, hellFrozeOver: 2}, 'hell') => {froze-over: 2}
208    function parseAttrs(obj, prefix) {
209        var attrs = {},
210            regex = new RegExp('^' + prefix + '([A-Z])(.*)');
211        for (var key in obj) {
212            var match = key.match(regex);
213            if (match) {
214                var dasherized = (match[1] + match[2].replace(/([A-Z])/g, '-$1')).toLowerCase();
215                attrs[dasherized] = obj[key];
216            }
217        }
218        return attrs;
219    }
220
221    /* document wide key handler */
222    var eventMap = { keyup: 'onKeyUp', resize: 'onResize' };
223
224    var globalEventHandler = function (event) {
225        $.each(Featherlight.opened().reverse(), function () {
226            if (!event.isDefaultPrevented()) {
227                if (false === this[eventMap[event.type]](event)) {
228                    event.preventDefault(); event.stopPropagation(); return false;
229                }
230            }
231        });
232    };
233
234    var toggleGlobalEvents = function (set) {
235        if (set !== Featherlight._globalHandlerInstalled) {
236            Featherlight._globalHandlerInstalled = set;
237            var events = $.map(eventMap, function (_, name) { return name + '.' + Featherlight.prototype.namespace; }).join(' ');
238            $(window)[set ? 'on' : 'off'](events, globalEventHandler);
239        }
240    };
241
242    Featherlight.prototype = {
243        constructor: Featherlight,
244        /*** defaults ***/
245        /* extend featherlight with defaults and methods */
246        namespace: 'featherlight',        /* Name of the events and css class prefix */
247        targetAttr: 'data-featherlight',   /* Attribute of the triggered element that contains the selector to the lightbox content */
248        variant: null,                  /* Class that will be added to change look of the lightbox */
249        resetCss: false,                 /* Reset all css */
250        background: null,                  /* Custom DOM for the background, wrapper and the closebutton */
251        openTrigger: 'click',               /* Event that triggers the lightbox */
252        closeTrigger: 'click',               /* Event that triggers the closing of the lightbox */
253        filter: null,                  /* Selector to filter events. Think $(...).on('click', filter, eventHandler) */
254        root: 'body',                /* Where to append featherlights */
255        openSpeed: 250,                   /* Duration of opening animation */
256        closeSpeed: 250,                   /* Duration of closing animation */
257        closeOnClick: 'background',          /* Close lightbox on click ('background', 'anywhere' or false) */
258        closeOnEsc: true,                  /* Close lightbox when pressing esc */
259        closeIcon: '✕',            /* Close icon */
260        loading: '',                    /* Content to show while initial content is loading */
261        persist: false,                 /* If set, the content will persist and will be shown again when opened again. 'shared' is a special value when binding multiple elements for them to share the same content */
262        otherClose: null,                  /* Selector for alternate close buttons (e.g. "a.close") */
263        beforeOpen: $.noop,                /* Called before open. can return false to prevent opening of lightbox. Gets event as parameter, this contains all data */
264        beforeContent: $.noop,                /* Called when content is loaded. Gets event as parameter, this contains all data */
265        beforeClose: $.noop,                /* Called before close. can return false to prevent closing of lightbox. Gets event as parameter, this contains all data */
266        afterOpen: $.noop,                /* Called after open. Gets event as parameter, this contains all data */
267        afterContent: $.noop,                /* Called after content is ready and has been set. Gets event as parameter, this contains all data */
268        afterClose: $.noop,                /* Called after close. Gets event as parameter, this contains all data */
269        onKeyUp: $.noop,                /* Called on key up for the frontmost featherlight */
270        onResize: $.noop,                /* Called after new content and when a window is resized */
271        type: null,                  /* Specify type of lightbox. If unset, it will check for the targetAttrs value. */
272        contentFilters: ['jquery', 'image', 'html', 'ajax', 'iframe', 'text'], /* List of content filters to use to determine the content */
273
274        /*** methods ***/
275        /* setup iterates over a single instance of featherlight and prepares the background and binds the events */
276        setup: function (target, config) {
277            /* all arguments are optional */
278            if (typeof target === 'object' && target instanceof $ === false && !config) {
279                config = target;
280                target = undefined;
281            }
282
283            var self = $.extend(this, config, { target: target }),
284                css = !self.resetCss ? self.namespace : self.namespace + '-reset', /* by adding -reset to the classname, we reset all the default css */
285                $background = $(self.background || [
286                    '<div class="' + css + '-loading ' + css + '">',
287                    '<div class="' + css + '-content">',
288                    '<button class="' + css + '-close-icon ' + self.namespace + '-close" aria-label="Close">',
289                    self.closeIcon,
290                    '</button>',
291                    '<div class="' + self.namespace + '-inner">' + self.loading + '</div>',
292                    '</div>',
293                    '</div>'].join('')),
294                closeButtonSelector = '.' + self.namespace + '-close' + (self.otherClose ? ',' + self.otherClose : '');
295
296            self.$instance = $background.clone().addClass(self.variant); /* clone DOM for the background, wrapper and the close button */
297
298            /* close when click on background/anywhere/null or closebox */
299            self.$instance.on(self.closeTrigger + '.' + self.namespace, function (event) {
300                if (event.isDefaultPrevented()) {
301                    return;
302                }
303                var $target = $(event.target);
304                if (('background' === self.closeOnClick && $target.is('.' + self.namespace))
305                    || 'anywhere' === self.closeOnClick
306                    || $target.closest(closeButtonSelector).length) {
307                    self.close(event);
308                    event.preventDefault();
309                }
310            });
311
312            return this;
313        },
314
315        /* this method prepares the content and converts it into a 
315jQuery object or a promise */
316        getContent: function () {
317            if (this.persist !== false && this.$content) {
318                return this.$content;
319            }
320            var self = this,
321                filters = this.constructor.contentFilters,
322                readTargetAttr = function (name) { return self.$currentTarget && self.$currentTarget.attr(name); },
323                targetValue = readTargetAttr(self.targetAttr),
324                data = self.target || targetValue || '';
325
326            /* Find which filter applies */
327            var filter = filters[self.type]; /* check explicit type like {type: 'image'} */
328
329            /* check explicit type like data-featherlight="image" */
330            if (!filter && data in filters) {
331                filter = filters[data];
332                data = self.target && targetValue;
333            }
334            data = data || readTargetAttr('href') || '';
335
336            /* check explicity type & content like {image: 'photo.jpg'} */
337            if (!filter) {
338                for (var filterName in filters) {
339                    if (self[filterName]) {
340                        filter = filters[filterName];
341                        data = self[filterName];
342                    }
343                }
344            }
345
346            /* otherwise it's implicit, run checks */
347            if (!filter) {
348                var target = data;
349                data = null;
350                $.each(self.contentFilters, function () {
351                    filter = filters[this];
352                    if (filter.test) {
353                        data = filter.test(target);
354                    }
355                    if (!data && filter.regex && target.match && target.match(filter.regex)) {
356                        data = target;
357                    }
358                    return !data;
359                });
360                if (!data) {
361                    if ('console' in window) { window.console.error('Featherlight: no content filter found ' + (target ? ' for "' + target + '"' : ' (no target specified)')); }
362                    return false;
363                }
364            }
365            /* Process it */
366            return filter.process.call(self, data);
367        },
368
369        /* sets the content of $instance to $content */
370        setContent: function ($content) {
371            this.$instance.removeClass(this.namespace + '-loading');
372
373            /* we need a special class for the iframe */
374            this.$instance.toggleClass(this.namespace + '-iframe', $content.is('iframe'));
375
376            /* replace content by appending to existing one before it is removed
377               this insures that featherlight-inner remain at the same relative
378               position to any other items added to featherlight-content */
379            this.$instance.find('.' + this.namespace + '-inner')
380                .not($content)                /* excluded new content, important if persisted */
381                .slice(1).remove().end()      /* In the unexpected event where there are many inner elements, remove all but the first one */
382                .replaceWith($.contains(this.$instance[0], $content[0]) ? '' : $content);
383
384            this.$content = $content.addClass(this.namespace + '-inner');
385
386            return this;
387        },
388
389		/* opens the lightbox. "this" contains $instance with the lightbox, and with the config.
390			Returns a promise that is resolved after is successfully opened. */
391        open: function (event) {
392            var self = this;
393            self.$instance.hide().appendTo(self.root);
394            if ((!event || !event.isDefaultPrevented())
395                && self.beforeOpen(event) !== false) {
396
397                if (event) {
398                    event.preventDefault();
399                }
400                var $content = self.getContent();
401
402                if ($content) {
403                    opened.push(self);
404
405                    toggleGlobalEvents(true);
406
407                    self.$instance.fadeIn(self.openSpeed);
408                    self.beforeContent(event);
409
410                    /* Set content and show */
411                    return $.when($content)
412                        .always(function ($openendContent) {
413                            if ($openendContent) {
414                                self.setContent($openendContent);
415                                self.afterContent(event);
416                            }
417                        })
418                        .then(self.$instance.promise())
419                        /* Call afterOpen after fadeIn is done */
420                        .done(function () { self.afterOpen(event); });
421                }
422            }
423            self.$instance.detach();
424            return $.Deferred().reject().promise();
425        },
426
427		/* closes the lightbox. "this" contains $instance with the lightbox, and with the config
428			returns a promise, resolved after the lightbox is successfully closed. */
429        close: function (event) {
430            var self = this,
431                deferred = $.Deferred();
432
433            if (self.beforeClose(event) === false) {
434                deferred.reject();
435            } else {
436
437                if (0 === pruneOpened(self).length) {
438                    toggleGlobalEvents(false);
439                }
440
441                self.$instance.fadeOut(self.closeSpeed, function () {
442                    self.$instance.detach();
443                    self.afterClose(event);
444                    deferred.resolve();
445                });
446            }
447            return deferred.promise();
448        },
449
450		/* resizes the content so it fits in visible area and keeps the same aspect ratio.
451				Does nothing if either the width or the height is not specified.
452				Called automatically on window resize.
453				Override if you want different behavior. */
454        resize: function (w, h) {
455            if (w && h) {
456                /* Reset apparent image size first so container grows */
457                this.$content.css('width', '').css('height', '');
458                /* Calculate the worst ratio so that dimensions fit */
459                /* Note: -1 to avoid rounding errors */
460                var ratio = Math.max(
461                    w / (this.$content.parent().width() - 1),
462                    h / (this.$content.parent().height() - 1));
463                /* Resize content */
464                if (ratio > 1) {
465                    ratio = h / Math.floor(h / ratio); /* Round ratio down so height calc works */
466                    this.$content.css('width', '' + w / ratio + 'px').css('height', '' + h / ratio + 'px');
467                }
468            }
469        },
470
471		/* Utility function to chain callbacks
472		   [Warning: guru-level]
473		   Used be extensions that want to let users specify callbacks but
474		   also need themselves to use the callbacks.
475		   The argument 'chain' has callback names as keys and function(super, event)
476		   as values. That function is meant to call `super` at some point.
477		*/
478        chainCallbacks: function (chain) {
479            for (var name in chain) {
480                this[name] = $.proxy(chain[name], this, $.proxy(this[name], this));
481            }
482        }
483    };
484
485    $.extend(Featherlight, {
486        id: 0,                                    /* Used to id single featherlight instances */
487        autoBind: '[data-featherlight]',    /* Will automatically bind elements matching this selector. Clear or set before onReady */
488        defaults: Featherlight.prototype,   /* You can access and override all defaults using $.featherlight.defaults, which is just a synonym for $.featherlight.prototype */
489        /* Contains the logic to determine content */
490        contentFilters: {
491            jquery: {
492                regex: /^[#.]\w/,         /* Anything that starts with a class name or identifiers */
493                test: function (elem) { return elem instanceof $ && elem; },
494                process: function (elem) { return this.persist !== false ? $(elem) : $(elem).clone(true); }
495            },
496            image: {
497                regex: /\.(png|jpg|jpeg|gif|tiff?|bmp|svg)(\?\S*)?$/i,
498                process: function (url) {
499                    var self = this,
500                        deferred = $.Deferred(),
501                        img = new Image(),
502                        $img = $('<img src="' + url + '" alt="" class="' + self.namespace + '-image" />');
503                    img.onload = function () {
504                        /* Store naturalWidth & height for IE8 */
505                        $img.naturalWidth = img.width; $img.naturalHeight = img.height;
506                        deferred.resolve($img);
507                    };
508                    img.onerror = function () { deferred.reject($img); };
509                    img.src = url;
510                    return deferred.promise();
511                }
512            },
513            html: {
514                regex: /^\s*<[\w!][^<]*>/, /* Anything that starts with some kind of valid tag */
515                process: function (html) { return $(html); }
516            },
517            ajax: {
518                regex: /./,            /* At this point, any content is assumed to be an URL */
519                process: function (url) {
520                    var self = this,
521                        deferred = $.Deferred();
522                    /* we are using load so one can specify a target with: url.html #targetelement */
523                    var $container = $('<div></div>').load(url, function (response, status) {
524                        if (status !== "error") {
525                            deferred.resolve($container.contents());
526                        }
527                        deferred.reject();
528                    });
529                    return deferred.promise();
530                }
531            },
532            iframe: {
533                process: function (url) {
534                    var deferred = new $.Deferred();
535                    var $content = $('<iframe/>');
536                    var css = parseAttrs(this, 'iframe');
537                    var attrs = slice(css, iFrameAttributeSet);
538                    $content.hide()
539                        .attr('src', url)
540                        .attr(attrs)
541                        .css(css)
542                        .on('load', function () { deferred.resolve($content.show()); })
543                        // We can't move an <iframe> and avoid reloading it,
544                        // so let's put it in place ourselves right now:
545                        .appendTo(this.$instance.find('.' + this.namespace + '-content'));
546                    return deferred.promise();
547                }
548            },
549            text: {
550                process: function (text) { return $('<div>', { text: text }); }
551            }
552        },
553
554        functionAttributes: ['beforeOpen', 'afterOpen', 'beforeContent', 'afterContent', 'beforeClose', 'afterClose'],
555
556        /*** class methods ***/
557        /* read element's attributes starting with data-featherlight- */
558        readElementConfig: function (element, namespace) {
559            var Klass = this,
560                regexp = new RegExp('^data-' + namespace + '-(.*)'),
561                config = {};
562            if (element && element.attributes) {
563                $.each(element.attributes, function () {
564                    var match = this.name.match(regexp);
565                    if (match) {
566                        var val = this.value,
567                            name = $.camelCase(match[1]);
568                        if ($.inArray(name, Klass.functionAttributes) >= 0) {  /* jshint -W054 */
569                            val = new Function(val);                           /* jshint +W054 */
570                        } else {
571                            try { val = JSON.parse(val); }
572                            catch (e) { }
573                        }
574                        config[name] = val;
575                    }
576                });
577            }
578            return config;
579        },
580
581		/* Used to create a Featherlight extension
582		   [Warning: guru-level]
583		   Creates the extension's prototype that in turn
584		   inherits Featherlight's prototype.
585		   Could be used to extend an extension too...
586		   This is pretty high level wizardy, it comes pretty much straight
587		   from CoffeeScript and won't teach you anything about Featherlight
588		   as it's not really specific to this library.
589		   My suggestion: move along and keep your sanity.
590		*/
591        extend: function (child, defaults) {
592            /* Setup class hierarchy, adapted from CoffeeScript */
593            var Ctor = function () { this.constructor = child; };
594            Ctor.prototype = this.prototype;
595            child.prototype = new Ctor();
596            child.__super__ = this.prototype;
597            /* Copy class methods & attributes */
598            $.extend(child, this, defaults);
599            child.defaults = child.prototype;
600            return child;
601        },
602
603        attach: function ($source, $content, config) {
604            var Klass = this;
605            if (typeof $content === 'object' && $content instanceof $ === false && !config) {
606                config = $content;
607                $content = undefined;
608            }
609            /* make a copy */
610            config = $.extend({}, config);
611
612            /* Only for openTrigger, filter & namespace... */
613            var namespace = config.namespace || Klass.defaults.namespace,
614                tempConfig = $.extend({}, Klass.defaults, Klass.readElementConfig($source[0], namespace), c
614onfig),
615                sharedPersist;
616            var handler = function (event) {
617                var $target = $(event.currentTarget);
618                /* ... since we might as well compute the config on the actual target */
619                var elemConfig = $.extend(
620                    { $source: $source, $currentTarget: $target },
621                    Klass.readElementConfig($source[0], tempConfig.namespace),
622                    Klass.readElementConfig(event.currentTarget, tempConfig.namespace),
623                    config);
624                var fl = sharedPersist || $target.data('featherlight-persisted') || new Klass($content, elemConfig);
625                if (fl.persist === 'shared') {
626                    sharedPersist = fl;
627                } else if (fl.persist !== false) {
628                    $target.data('featherlight-persisted', fl);
629                }
630                if (elemConfig.$currentTarget.blur) {
631                    elemConfig.$currentTarget.blur(); // Otherwise 'enter' key might trigger the dialog again
632                }
633                fl.open(event);
634            };
635
636            $source.on(tempConfig.openTrigger + '.' + tempConfig.namespace, tempConfig.filter, handler);
637
638            return { filter: tempConfig.filter, handler: handler };
639        },
640
641        current: function () {
642            var all = this.opened();
643            return all[all.length - 1] || null;
644        },
645
646        opened: function () {
647            var klass = this;
648            pruneOpened();
649            return $.grep(opened, function (fl) { return fl instanceof klass; });
650        },
651
652        close: function (event) {
653            var cur = this.current();
654            if (cur) { return cur.close(event); }
655        },
656
657		/* Does the auto binding on startup.
658		   Meant only to be used by Featherlight and its extensions
659		*/
660        _onReady: function () {
661            var Klass = this;
662            if (Klass.autoBind) {
663                var $autobound = $(Klass.autoBind);
664                /* Bind existing elements */
665                $autobound.each(function () {
666                    Klass.attach($(this));
667                });
668                /* If a click propagates to the document level, then we have an item that was added later on */
669                $(document).on('click', Klass.autoBind, function (evt) {
670                    if (evt.isDefaultPrevented()) {
671                        return;
672                    }
673                    var $cur = $(evt.currentTarget);
674                    var len = $autobound.length;
675                    $autobound = $autobound.add($cur);
676                    if (len === $autobound.length) {
677                        return; /* already bound */
678                    }
679                    /* Bind featherlight */
680                    var data = Klass.attach($cur);
681                    /* Dispatch event directly */
682                    if (!data.filter || $(evt.target).parentsUntil($cur, data.filter).length > 0) {
683                        data.handler(evt);
684                    }
685                });
686            }
687        },
688
689		/* Featherlight uses the onKeyUp callback to intercept the escape key.
690		   Private to Featherlight.
691		*/
692        _callbackChain: {
693            onKeyUp: function (_super, event) {
694                if (27 === event.keyCode) {
695                    if (this.closeOnEsc) {
696                        $.featherlight.close(event);
697                    }
698                    return false;
699                } else {
700                    return _super(event);
701                }
702            },
703
704            beforeOpen: function (_super, event) {
705                // Used to disable scrolling
706                $(document.documentElement).addClass('with-featherlight');
707
708                // Remember focus:
709                this._previouslyActive = document.activeElement;
710
711                // Disable tabbing:
712                // See http://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus
713                this._$previouslyTabbable = $("a, input, select, textarea, iframe, button, iframe, [contentEditable=true]")
714                    .not('[tabindex]')
715                    .not(this.$instance.find('button'));
716
717                this._$previouslyWithTabIndex = $('[tabindex]').not('[tabindex="-1"]');
718                this._previousWithTabIndices = this._$previouslyWithTabIndex.map(function (_i, elem) {
719                    return $(elem).attr('tabindex');
720                });
721
722                this._$previouslyWithTabIndex.add(this._$previouslyTabbable).attr('tabindex', -1);
723
724                if (document.activeElement.blur) {
725                    document.activeElement.blur();
726                }
727                return _super(event);
728            },
729
730            afterClose: function (_super, event) {
731                var r = _super(event);
732                // Restore focus
733                var self = this;
734                this._$previouslyTabbable.removeAttr('tabindex');
735                this._$previouslyWithTabIndex.each(function (i, elem) {
736                    $(elem).attr('tabindex', self._previousWithTabIndices[i]);
737                });
738                this._previouslyActive.focus();
739                // Restore scroll
740                if (Featherlight.opened().length === 0) {
741                    $(document.documentElement).removeClass('with-featherlight');
742                }
743                return r;
744            },
745
746            onResize: function (_super, event) {
747                this.resize(this.$content.naturalWidth, this.$content.naturalHeight);
748                return _super(event);
749            },
750
751            afterContent: function (_super, event) {
752                var r = _super(event);
753                this.$instance.find('[autofocus]:not([disabled])').focus();
754                this.onResize(event);
755                return r;
756            }
757        }
758    });
759
760    $.featherlight = Featherlight;
761
762    /* bind jQuery elements to trigger featherlight */
763    $.fn.featherlight = function ($content, config) {
764        Featherlight.attach(this, $content, config);
765        return this;
766    };
767
768    /* bind featherlight on ready if config autoBind is set */
769    $(document).ready(function () { Featherlight._onReady(); });
770});;
771/*! Select2 4.1.0-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
772!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(t){(u=t&&t.fn&&t.fn.select2&&t.fn.select2.amd?t.fn.select2.amd:u)&&u.requirejs||(u?e=u:u={},g={},m={},y={},v={},n=Object.prototype.hasOwnProperty,s=[].slice,_=/\.js$/,h=function(e,t){var n,s,i=c(e),o=i[0],t=t[1];return e=i[1],o&&(n=x(o=l(o,t))),o?e=n&&n.normalize?n.normalize(e,(s=t,function(e){return l(e,s)}
vendor: 14,061 bytes, line 772
772)):l(e,t):(o=(i=c(e=l(e,t)))[0],e=i[1],o&&(n=x(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},f={require:function(e){return w(e)},exports:function(e){var t=g[e];return void 0!==t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:(t=e,function(){return y&&y.config&&y.config[t]||{}})};var t}},o=function(e,t,n,s){var i,o,r,a,l,c=[],u=typeof n,d=A(s=s||e);if("undefined"==u||"function"==u){for(t=!t.length&&n.length?["require","exports","module"]:t,a=0;a<t.length;a+=1)if("require"===(o=(r=h(t[a],d)).f))c[a]=f.require(e);else if("exports"===o)c[a]=f.exports(e),l=!0;else if("module"===o)i=c[a]=f.module(e);else if(b(g,o)||b(m,o)||b(v,o))c[a]=x(o);else{if(!r.p)throw new Error(e+" missing "+o);r.p.load(r.n,w(s,!0),function(t){return function(e){g[t]=e}}(o),{}),c[a]=g[o]}u=n?n.apply(g[e],c):void 0,e&&(i&&i.exports!==p&&i.exports!==g[e]?g[e]=i.exports:u===p&&l||(g[e]=u))}else e&&(g[e]=n)},i=e=r=function(e,t,n,s,i){if("string"==typeof e)return f[e]?f[e](t):x(h(e,A(t)).f);if(!e.splice){if((y=e).deps&&r(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=p}return t=t||function(){},"function"==typeof n&&(n=s,s=i),s?o(p,e,t,n):setTimeout(function(){o(p,e,t,n)},4),r},r.config=function(e){return r(e)},i._defined=g,(a=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),b(g,e)||b(m,e)||(m[e]=[e,t,n])}).amd={jQuery:!0},u.requirejs=i,u.require=e,u.define=a),u.define("almond",function(){}),u.define("jquery",[],function(){var e=t||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),u.define("select2/utils",["jquery"],function(o){var s={};function c(e){var t,n=e.prototype,s=[];for(t in n)"function"==typeof n[t]&&"constructor"!==t&&s.push(t);return s}s.Extend=function(e,t){var n,s={}.hasOwnProperty;function i(){this.constructor=e}for(n in t)s.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},s.Decorate=function(s,i){var e=c(i),t=c(s);function o(){var e=Array.prototype.unshift,t=i.prototype.constructor.length,n=s.prototype.constructor;0<t&&(e.call(arguments,s.prototype.constructor),n=i.prototype.constructor),n.apply(this,arguments)}i.displayName=s.displayName,o.prototype=new function(){this.constructor=o};for(var n=0;n<t.length;n++){var r=t[n];o.prototype[r]=s.prototype[r]}for(var a=0;a<e.length;a++){var l=e[a];o.prototype[l]=function(e){var t=function(){},n=(e in o.prototype&&(t=o.prototype[e]),i.prototype[e]);return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}}(l)}return o};function e(){this.listeners={}}e.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},e.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},0===(n=null==n?[]:n).length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},e.prototype.invoke=function(e,t){for(var n=0,s=e.length;n<s;n++)e[n].apply(this,t)},s.Observable=e,s.generateChars=function(e){for(var t="",n=0;n<e;n++)t+=Math.floor(36*Math.random()).toString(36);return t},s.bind=function(e,t){return function(){e.apply(t,arguments)}},s._convertData=function(e){for(var t in e){var n=t.split("-"),s=e;if(1!==n.length){for(var i=0;i<n.length;i++){var o=n[i];(o=o.substring(0,1).toLowerCase()+o.substring(1))in s||(s[o]={}),i==n.length-1&&(s[o]=e[t]),s=s[o]}delete e[t]}}return e},s.hasScroll=function(e,t){var n=o(t),s=t.style.overflowX,i=t.style.overflowY;return(s!==i||"hidden"!==i&&"visible"!==i)&&("scroll"===s||"scroll"===i||n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth)},s.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},s.__cache={};var n=0;return s.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(t=e.id?"select2-data-"+e.id:"select2-data-"+(++n).toString()+"-"+s.generateChars(4),e.setAttribute("data-select2-id",t)),t},s.StoreData=function(e,t,n){e=s.GetUniqueElementId(e);s.__cache[e]||(s.__cache[e]={}),s.__cache[e][t]=n},s.GetData=function(e,t){var n=s.GetUniqueElementId(e);return t?s.__cache[n]&&null!=s.__cache[n][t]?s.__cache[n][t]:o(e).data(t):s.__cache[n]},s.RemoveData=function(e){var t=s.GetUniqueElementId(e);null!=s.__cache[t]&&delete s.__cache[t],e.removeAttribute("data-select2-id")},s.copyNonInternalCssClasses=function(e,t){var n=(n=e.getAttribute("class").trim().split(/\s+/)).filter(function(e){return 0===e.indexOf("select2-")}),t=(t=t.getAttribute("class").trim().split(/\s+/)).filter(function(e){return 0!==e.indexOf("select2-")}),n=n.concat(t);e.setAttribute("class",n.join(" "))},s}),u.define("select2/results",["jquery","./utils"],function(u,d){function s(e,t,n){this.$element=e,this.data=n,this.options=t,s.__super__.constructor.call(this)}return d.Extend(s,d.Observable),s.prototype.render=function(){var e=u('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},s.prototype.clear=function(){this.$results.empty()},s.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup"),n=(this.clear(),this.hideLoading(),u('<li role="alert" aria-live="assertive" class="select2-results__option"></li>')),s=this.options.get("translations").get(e.message);n.append(t(s(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},s.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},s.prototype.append=function(e){this.hideLoading();var t=[];if(null==e.results||0===e.results.length)0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"});else{e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var s=e.results[n],s=this.option(s);t.push(s)}this.$results.append(t)}},s.prototype.position=function(e,t){t.find(".select2-results").append(e)},s.prototype.sort=function(e){return this.options.get("sorter")(e)},s.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option--selectable"),t=e.filter(".select2-results__option--selected");(0<t.length?t:e).first().trigger("mouseenter"),this.ensureHighlightVisible()},s.prototype.setClasses=function(){var t=this;this.data.current(function(e){var s=e.map(function(e){return e.id.toString()});t.$results.find(".select2-results__option--selectable").each(function(){var e=u(this),t=d.GetData(this,"data"),n=""+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<s.indexOf(n)?(this.classList.add("select2-results__option--selected"),e.attr("aria-selected","true")):(this.classList.remove("select2-results__option--selected"),e.attr("aria-selected","false"))})})},s.prototype.showLoading=function(e){this.hideLoading();e={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},e=this.option(e);e.className+=" loading-results",this.$results.prepend(e)},s.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},s.prototype.option=function(e){var t,n=document.createElement("li"),s=(n.classList.add("select2-results__option"),n.classList.add("select2-results__option--selectable"),{role:"option"}),i=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(t in(null!=e.element&&i.call(e.element,":disabled")||null==e.element&&e.disabled)&&(s["aria-disabled"]="true",n.classList.remove("select2-results__option--selectable"),n.classList.add("select2-results__option--disabled")),null==e.id&&n.classList.remove("select2-results__option--selectable"),null!=e._resultId&&(n.id=e._resultId),e.title&&(n.title=e.title),e.children&&(s.role="group",s["aria-label"]=e.text,n.classList.remove("select2-results__option--selectable"),n.classList.add("select2-results__option--group")),s)n.setAttribute(t,s[t]);if(e.children){for(var i=u(n),o=document.createElement("strong"),r=(o.className="select2-results__group",this.template(e,o),[]),a=0;a<e.children.length;a++){var l=e.children[a],l=this.option(l);r.push(l)}var c=u("<ul></ul>",{class:"select2-results__options select2-results__options--nested",role:"none"});c.append(r),i.append(o),i.append(c)}else this.template(e,n);return d.StoreData(n,"data",e),n},s.prototype.bind=function(t,e){var i=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){i.clear(),i.append(e.data),t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on("results:append",function(e){i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("query",function(e){i.hideMessages(),i.showLoading(e)}),t.on("select",function(){t.isOpen()&&(i.setClasses(),i.options.get("scrollAfterSelect"))&&i.highlightFirstItem()}),t.on("unselect",function(){t.isOpen()&&(i.setClasses(),i.options.get("scrollAfterSelect"))&&i.highlightFirstItem()}),t.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),t.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e,t=i.getHighlightedResults();0!==t.length&&(e=d.GetData(t[0],"data"),t.hasClass("select2-results__option--selected")?i.trigger("close",{}):i.trigger("select",{data:e}))}),t.on("results:previous",function(){var e,t=i.getHighlightedResults(),n=i.$results.find(".select2-results__option--selectable"),s=n.index(t);s<=0||(s=s-1,0===t.length&&(s=0),(t=n.eq(s)).trigger("mouseenter"),n=i.$results.offset().top,t=t.offset().top,e=i.$results.scrollTop()+(t-n),0===s?i.$results.scrollTop(0):t-n<0&&i.$results.scrollTop(e))}),t.on("results:next",function(){var e,t,n=i.getHighlightedResults(),s=i.$results.find(".select2-results__option--selectable"),n=s.index(n)+1;n>=s.length||((s=s.eq(n)).trigger("mouseenter"),e=i.$results.offset().top+i.$results.outerHeight(!1),s=s.offset().top+s.outerHeight(!1),t=i.$results.scrollTop()+s-e,0===n?i.$results.scrollTop(0):e<s&&i.$results.scrollTop(t))}),t.on("results:focus",function(e){e.element[0].classList.add("select2-results__option--highlighted"),e.element[0].setAttribute("aria-selected","true")}),t.on("results:message",function(e){i.displayMessage(e)}),u.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,t=0<e.deltaY&&t-e.deltaY<=0,n=e.deltaY<0&&n<=i.$results.height();t?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):n&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option--selectable",function(e){var t=u(this),n=d.GetData(this,"data");t.hasClass("select2-results__option--selected")?i.options.get("multiple")?i.trigger("unselect",{originalEvent:e,data:n}):i.trigger("close",{originalEvent:e,data:n}):i.trigger("select",{originalEvent:e,data:n})}),this.$results.on("mouseenter",".select2-results__option--selectable",function(e){var t=d.GetData(this,"data");i.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),i.trigger("results:focus",{data:t,element:u(this)})})},s.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},s.prototype.destroy=function(){this.$results.remove()},s.prototype.ensureHighlightVisible=function(){var e,t,n,s,i=this.getHighlightedResults();0!==i.length&&(e=this.$results.find(".select2-results__option--selectable").index(i),t=this.$results.offset().top,s=i.offset().top,n=this.$results.scrollTop()+(s-t),s=s-t,n-=2*i.outerHeight(!1),e<=2?this.$results.scrollTop(0):(s>this.$results.outerHeight()||s<0)&&this.$results.scrollTop(n))},s.prototype.template=function(e,t){var n=this.options.get("templateResult"),s=this.options.get("escapeMarkup"),n=n(e,t);null==n?t.style.display="none":"string"==typeof n?t.innerHTML=s(n):u(t).append(n)},s}),u.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),u.define("select2/selection/base",["jquery","../utils","../keys"],function(n,s,i){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return s.Extend(o,s.Observable),o.prototype.render=function(){var e=n('<span class="select2-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=s.GetData(this.$element[0],"old-tabindex")?this._tabindex=s.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,s=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",s),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","fal
772se"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&s.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),u.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,s){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e[0].classList.add("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},i.prototype.bind=function(t,e){var n=this,s=(i.__super__.bind.apply(this,arguments),t.id+"-container");this.$selection.find(".select2-selection__rendered").attr("id",s).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",s),this.$selection.attr("aria-controls",s),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("<span></span>")},i.prototype.update=function(e){var t,n;0===e.length?this.clear():(e=e[0],t=this.$selection.find(".select2-selection__rendered"),n=this.display(e,t),t.empty().append(n),(n=e.title||e.text)?t.attr("title",n):t.removeAttr("title"))},i}),u.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,c){function o(e,t){o.__super__.constructor.apply(this,arguments)}return c.Extend(o,e),o.prototype.render=function(){var e=o.__super__.render.call(this);return e[0].classList.add("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},o.prototype.bind=function(e,t){var n=this,s=(o.__super__.bind.apply(this,arguments),e.id+"-container");this.$selection.find(".select2-selection__rendered").attr("id",s),this.$selection.on("click",function(e){n.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){var t;n.isDisabled()||(t=i(this).parent(),t=c.GetData(t[0],"data"),n.trigger("unselect",{originalEvent:e,data:t}))}),this.$selection.on("keydown",".select2-selection__choice__remove",function(e){n.isDisabled()||e.stopPropagation()})},o.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},o.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},o.prototype.selectionContainer=function(){return i('<li class="select2-selection__choice"><button type="button" class="select2-selection__choice__remove" tabindex="-1"><span aria-hidden="true">&times;</span></button><span class="select2-selection__choice__display"></span></li>')},o.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=this.$selection.find(".select2-selection__rendered").attr("id")+"-choice-",s=0;s<e.length;s++){var i=e[s],o=this.selectionContainer(),r=this.display(i,o),a=n+c.generateChars(4)+"-",r=(i.id?a+=i.id:a+=c.generateChars(4),o.find(".select2-selection__choice__display").append(r).attr("id",a),i.title||i.text),r=(r&&o.attr("title",r),this.options.get("translations").get("removeItem")),l=o.find(".select2-selection__choice__remove");l.attr("title",r()),l.attr("aria-label",r()),l.attr("aria-describedby",a),c.StoreData(o[0],"data",i),t.push(o)}this.$selection.find(".select2-selection__rendered").append(t)}},o}),u.define("select2/selection/placeholder",[],function(){function e(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return e.prototype.normalizePlaceholder=function(e,t){return t="string"==typeof t?{id:"",text:t}:t},e.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer(),t=(n.html(this.display(t)),n[0].classList.add("select2-selection__placeholder"),n[0].classList.remove("select2-selection__choice"),t.title||t.text||n.text());return this.$selection.find(".select2-selection__rendered").attr("title",t),n},e.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();n=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(n)},e}
vendor: 9,981 bytes, line 772
772),u.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(i,s,a){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){s._handleClear(e)}),t.on("keypress",function(e){s._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.isDisabled()){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();var s=a.GetData(n[0],"data"),i=this.$element.val(),o=(this.$element.val(this.placeholder.id),{data:s});if(this.trigger("clear",o),o.prevented)this.$element.val(i);else{for(var r=0;r<s.length;r++)if(o={data:s[r]},this.trigger("unselect",o),o.prevented)return void this.$element.val(i);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=s.DELETE&&t.which!=s.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){var n,s;e.call(this,t),this.$selection.find(".select2-selection__clear").remove(),this.$selection[0].classList.remove("select2-selection--clearable"),0<this.$selection.find(".select2-selection__placeholder").length||0===t.length||(e=this.$selection.find(".select2-selection__rendered").attr("id"),n=this.options.get("translations").get("removeAllItems"),(s=i('<button type="button" class="select2-selection__clear" tabindex="-1"><span aria-hidden="true">&times;</span></button>')).attr("title",n()),s.attr("aria-label",n()),s.attr("aria-describedby",e),a.StoreData(s[0],"data",t),this.$selection.prepend(s),this.$selection[0].classList.add("select2-selection--clearable"))},e}),u.define("select2/selection/search",["jquery","../utils","../keys"],function(s,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=this.options.get("translations").get("search"),n=s('<span class="select2-search select2-search--inline"><textarea class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" ></textarea></span>'),n=(this.$searchContainer=n,this.$search=n.find("textarea"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",t()),e.call(this));return this._transferTabIndex(),n.append(this.$searchContainer),n},e.prototype.bind=function(e,t,n){var s=this,i=t.id+"-results",o=t.id+"-container",e=(e.call(this,t,n),s.$search.attr("aria-describedby",o),t.on("open",function(){s.$search.attr("aria-controls",i),s.$search.trigger("focus")}),t.on("close",function(){s.$search.val(""),s.resizeSearch(),s.$search.removeAttr("aria-controls"),s.$search.removeAttr("aria-activedescendant"),s.$search.trigger("focus")}),t.on("enable",function(){s.$search.prop("disabled",!1),s._transferTabIndex()}),t.on("disable",function(){s.$search.prop("disabled",!0)}),t.on("focus",function(e){s.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?s.$search.attr("aria-activedescendant",e.data._resultId):s.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){s.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){s._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){var t;e.stopPropagation(),s.trigger("keypress",e),s._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===s.$search.val()&&0<(t=s.$selection.find(".select2-selection__choice").last()).length&&(t=a.GetData(t[0],"data"),s.searchRemoveChoice(t),e.preventDefault())}),this.$selection.on("click",".select2-search--inline",function(e){s.$search.val()&&e.stopPropagation()}),document.documentMode),r=e&&e<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){r?s.$selection.off("input.search input.searchcheck"):s.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){var t;r&&"input"===e.type?s.$selection.off("input.search input.searchcheck"):(t=e.which)!=l.SHIFT&&t!=l.CTRL&&t!=l.ALT&&t!=l.TAB&&s.handleSearch(e)})},e.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},e.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.resizeSearch(),n&&this.$search.trigger("focus")},e.prototype.handleSearch=function(){var e;this.resizeSearch(),this._keyUpPrevented||(e=this.$search.val(),this.trigger("query",{term:e})),this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="100%";""===this.$search.attr("placeholder")&&(e=.75*(this.$search.val().length+1)+"em"),this.$search.css("width",e)},e}),u.define("select2/selection/selectionCss",["../utils"],function(n){function e(){}return e.prototype.render=function(e){var e=e.call(this),t=this.options.get("selectionCssClass")||"";return-1!==t.indexOf(":all:")&&(t=t.replace(":all:",""),n.copyNonInternalCssClasses(e[0],this.$element[0])),e.addClass(t),e},e}),u.define("select2/selection/eventRelay",["jquery"],function(r){function e(){}return e.prototype.bind=function(e,t,n){var s=this,i=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],o=["opening","closing","selecting","unselecting","clearing"];e.call(this,t,n),t.on("*",function(e,t){var n;-1!==i.indexOf(e)&&(n=r.Event("select2:"+e,{params:t=t||{}}),s.$element.trigger(n),-1!==o.indexOf(e))&&(t.prevented=n.isDefaultPrevented())})},e}),u.define("select2/translation",["jquery","require"],function(t,n){function s(e){this.dict=e||{}}return s.prototype.all=function(){return this.dict},s.prototype.get=function(e){return this.dict[e]},s.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},s._cache={},s.loadPath=function(e){var t;return e in s._cache||(t=n(e),s._cache[e]=t),new s(s._cache[e])},s}),u.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"
772V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}}),u.define("select2/data/base",["../utils"],function(n){function s(e,t){s.__super__.constructor.call(this)}return n.Extend(s,n.Observable),s.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},s.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},s.prototype.bind=function(e,t){},s.prototype.destroy=function(){},s.prototype.generateResultId=function(e,t){e=e.id+"-result-";return e+=n.generateChars(4),null!=t.id?e+="-"+t.id.toString():e+="-"+n.generateChars(4),e},s}),u.define("select2/data/select",["./base","../utils","jquery"],function(e,a,l){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return a.Extend(n,e),n.prototype.current=function(e){var t=this;e(Array.prototype.map.call(this.$element[0].querySelectorAll(":checked"),function(e){return t.item(l(e))}))},n.prototype.select=function(i){var e,o=this;i.selected=!0,null!=i.element&&"option"===i.element.tagName.toLowerCase()?(i.element.selected=!0,this.$element.trigger("input").trigger("change")):this.$element.prop("multiple")?this.current(function(e){var t=[];(i=[i]).push.apply(i,e);for(var n=0;n<i.length;n++){var s=i[n].id;-1===t.indexOf(s)&&t.push(s)}o.$element.val(t),o.$element.trigger("input").trigger("change")}):(e=i.id,this.$element.val(e),this.$element.trigger("input").trigger("change"))},n.prototype.unselect=function(i){var o=this;this.$element.prop("multiple")&&(i.selected=!1,null!=i.element&&"option"===i.element.tagName.toLowerCase()?(i.element.selected=!1,this.$element.trigger("input").trigger("change")):this.current(function(e){for(var t=[],n=0;n<e.length;n++){var s=e[n].id;s!==i.id&&-1===t.indexOf(s)&&t.push(s)}o.$element.val(t),o.$element.trigger("input").trigger("change")}))},n.prototype.bind=function(e,t){var n=this;(this.container=e).on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){a.RemoveData(this)})},n.prototype.query=function(t,e){var n=[],s=this;this.$element.children().each(function(){var e;"option"!==this.tagName.toLowerCase()&&"optgroup"!==this.tagName.toLowerCase()||(e=l(this),e=s.item(e),null!==(e=s.matches(t,e))&&n.push(e))}),e({results:n})},n.prototype.addOptions=function(e){this.$element.append(e)},n.prototype.option=function(e){e.children?(t=document.createElement("optgroup")).label=e.text:void 0!==(t=document.createElement("option")).textContent?t.textContent=e.text:t.innerText=e.text,void 0!==e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var t,e=this._normalizeItem(e);return e.element=t,a.StoreData(t,"data",e),l(t)},n.prototype.item=function(e){var t={};if(null==(t=a.GetData(e[0],"data"))){var n=e[0];if("option"===n.tagName.toLowerCase())t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if("optgroup"===n.tagName.toLowerCase()){for(var t={text:e.prop("label"),children:[],title:e.prop("title")},s=e.children("option"),i=[],o=0;o<s.length;o++){var r=l(s[o]),r=this.item(r);i.push(r)}t.children=i}(t=this._normalizeItem(t)).element=e[0],a.StoreData(e[0],"data",t)}return t},n.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=l.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),l.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),u.define("select2/data/array",["./select","../utils","jquery"],function(e,t,c){function s(e,t){this._dataToConvert=t.get("data")||[],s.__super__.constructor.call(this,e,t)}return t.Extend(s,e),s.prototype.bind=function(e,t){s.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},s.prototype.select=function(n){var e;0===this.$element.find("option").filter(function(e,t){return t.value==n.id.toString()}).length&&(e=this.option(n),this.addOptions(e)),s.__super__.select.call(this,n)},s.prototype.convertToOptions=function(e){var t=this,n=this.$element.find("option"),s=n.map(function(){return t.item(c(this)).id}).get(),i=[];for(var o=0;o<e.length;o++){var r,a,l=this._normalizeItem(e[o]);0<=s.indexOf(l.id)?(r=n.filter(function(e){return function(){return c(this).val()==e.id}}(l)),a=this.item(r),a=c.extend(!0,{},l,a),a=this.option(a),r.replaceWith(a)):(r=this.option(l),l.children&&(a=this.convertToOptions(l.children),r.append(a)),i.push(r))}return i},s}),u.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,o){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){return o.extend({},{data:function(e){return o.extend({},e,{q:e.term})},transport:function(e,t,n){e=o.ajax(e);return e.then(t),e.fail(n),e}},e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(t,n){var s=this,i=(null!=this._request&&("function"==typeof this._request.abort&&this._request.abort(),this._request=null),o.extend({type:"GET"},this.ajaxOptions));function e(){var e=i.transport(i,function(e){e=s.processResults(e,t);s.options.get("debug")&&window.console&&console.error&&(e&&e.results&&Array.isArray(e.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),n(e)},function(){e&&"status"in e&&(0===e.status||"0"===e.status)||s.trigger("results:message",{message:"errorLoading"})});s._request=e}"function"==typeof i.url&&(i.url=i.url.call(this.$element,t)),"function"==typeof i.data&&(i.data=i.data.call(this.$element,t)),this.ajaxOptions.delay&&null!=t.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),u.define("select2/data/tags",["jquery"],function(t){function e(e,t,n){var s=n.get("tags"),i=n.get("createTag"),i=(void 0!==i&&(this.createTag=i),n.get("insertTag"));if(void 0!==i&&(this.insertTag=i),e.call(this,t,n),Array.isArray(s))for(var o=0;o<s.length;o++){var r=s[o],r=this._normalizeItem(r),r=this.option(r);this.$element.append(r)}}return e.prototype.query=function(e,c,u){var d=this;this._removeOldTags(),null==c.term||null!=c.page?e.call(this,c,u):e.call(this,c,function e(t,n){for(var s=t.results,i=0;i<s.length;i++){var o=s[i],r=null!=o.children&&!e({results:o.children},!0);if((o.text||"").toUpperCase()===(c.term||"").toUpperCase()||r)return!n&&(t.data=s,void u(t))}if(n)return!0;var a,l=d.createTag(c);null!=l&&((a=d.option(l)).attr("data-select2-tag","true"),d.addOptions([a]),d.insertTag(s,l)),t.results=s,u(t)})},e.prototype.createTag=function(e,t){return null==t.term||""===(t=t.term.trim())?null:{
vendor: 8,518 bytes, line 772
772id:t,text:t}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this.$element.find("option[data-select2-tag]").each(function(){this.selected||t(this).remove()})},e}),u.define("select2/data/tokenizer",["jquery"],function(c){function e(e,t,n){var s=n.get("tokenizer");void 0!==s&&(this.tokenizer=s),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},e.prototype.query=function(e,t,n){var s=this;t.term=t.term||"";var i=this.tokenizer(t,this.options,function(e){var t=s._normalizeItem(e);s.$element.find("option").filter(function(){return c(this).val()===t.id}).length||((e=s.option(t)).attr("data-select2-tag",!0),s._removeOldTags(),s.addOptions([e])),s.trigger("select",{data:t})});i.term!==t.term&&(this.$search.length&&(this.$search.val(i.term),this.$search.trigger("focus")),t.term=i.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,s){for(var i=n.get("tokenSeparators")||[],o=t.term,r=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};r<o.length;){var l=o[r];-1===i.indexOf(l)?r++:(l=o.substr(0,r),null==(l=a(c.extend({},t,{term:l})))?r++:(s(l),o=o.substr(r+1)||"",r=0))}return{term:o}},e}),u.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),u.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),u.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("select",function(){s._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var s=this;this._checkIfMaximumSelected(function(){e.call(s,t,n)})},e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current(function(e){e=null!=e?e.length:0;0<n.maximumSelectionLength&&e>=n.maximumSelectionLength?n.trigger("results:message",{message:"maximumSelected",args:{maximum:n.maximumSelectionLength}}):t&&t()})},e}),u.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),u.define("select2/dropdown/search",["jquery"],function(o){function e(){}return e.prototype.render=function(e){var e=e.call(this),t=this.options.get("translations").get("search"),n=o('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=n,this.$search=n.find("input"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",t()),e.prepend(n),e},e.prototype.bind=function(e,t,n){var s=this,i=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){s.trigger("keypress",e),s._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){s.handleSearch(e)}),t.on("open",function(){s.$search.attr("tabindex",0),s.$search.attr("aria-controls",i),s.$search.trigger("focus"),window.setTimeout(function(){s.$search.trigger("focus")},0)}),t.on("close",function(){s.$search.attr("tabindex",-1),s.$search.removeAttr("aria-controls"),s.$search.removeAttr("aria-activedescendant"),s.$search.val(""),s.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||s.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(s.showSearch(e)?s.$searchContainer[0].classList.remove("select2-search--hide"):s.$searchContainer[0].classList.add("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?s.$search.attr("aria-activedescendant",e.data._resultId):s.$search.removeAttr("aria-activedescendant")})},e.prototype.handleSearch=function(e){var t;this._keyUpPrevented||(t=this.$search.val(),this.trigger("query",{term:t})),this._keyUpPrevented=!1},e.prototype.showSearch=function(e,t){return!0},e}),u.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,s){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,s)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return t="string"==typeof t?{id:"",text:t}:t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),s=t.length-1;0<=s;s--){var i=t[s];this.placeholder.id===i.id&&n.splice(s,1)}return n},e}),u.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,s){this.lastParams={},e.call(this,t,n,s),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("query",function(e){s.lastParams=e,s.loading=!0}),t.on("query:append",function(e){s.lastParams=e,s.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&e&&(e=this.$results.offset().top+this.$results.outerHeight(!1),this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=e+50)&&this.loadMore()},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),u.define("select2/dropdown/attachBody",["jquery","../utils"],function(u,r){function e(e,t,n){this.$dropdownParent=u(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("open",function(){s._showDropdown(),s._attachPositioningHandler(t),s._bindContainerResultHandlers(t)}),t.on("close",function(){s._hideDropdown(),s._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t[0].classList.remove("select2"),t[0].classList.add("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=u("<span></span>"),e=e.call(this);return t.append(e),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){var n;this._containerResultsHandlersBound||(n=this,t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0)},e.prototype._attachPositioningHandler=function(e,t){var n=this,s="scroll.
772select2."+t.id,i="resize.select2."+t.id,t="orientationchange.select2."+t.id,o=this.$container.parents().filter(r.hasScroll);o.each(function(){r.StoreData(this,"select2-scroll-position",{x:u(this).scrollLeft(),y:u(this).scrollTop()})}),o.on(s,function(e){var t=r.GetData(this,"select2-scroll-position");u(this).scrollTop(t.y)}),u(window).on(s+" "+i+" "+t,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,s="resize.select2."+t.id,t="orientationchange.select2."+t.id;this.$container.parents().filter(r.hasScroll).off(n),u(window).off(n+" "+s+" "+t)},e.prototype._positionDropdown=function(){var e=u(window),t=this.$dropdown[0].classList.contains("select2-dropdown--above"),n=this.$dropdown[0].classList.contains("select2-dropdown--below"),s=null,i=this.$container.offset(),o=(i.bottom=i.top+this.$container.outerHeight(!1),{height:this.$container.outerHeight(!1)});o.top=i.top,o.bottom=i.top+o.height;var r=this.$dropdown.outerHeight(!1),a=e.scrollTop(),e=e.scrollTop()+e.height(),a=a<i.top-r,e=e>i.bottom+r,i={left:i.left,top:o.bottom},l=this.$dropdownParent,c=("static"===l.css("position")&&(l=l.offsetParent()),{top:0,left:0});(u.contains(document.body,l[0])||l[0].isConnected)&&(c=l.offset()),i.top-=c.top,i.left-=c.left,t||n||(s="below"),e||!a||t?!a&&e&&t&&(s="below"):s="above",("above"==s||t&&"below"!==s)&&(i.top=o.top-c.top-r),null!=s&&(this.$dropdown[0].classList.remove("select2-dropdown--below"),this.$dropdown[0].classList.remove("select2-dropdown--above"),this.$dropdown[0].classList.add("select2-dropdown--"+s),this.$container[0].classList.remove("select2-container--below"),this.$container[0].classList.remove("select2-container--above"),this.$container[0].classList.add("select2-container--"+s)),this.$dropdownContainer.css(i)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),u.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,s){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,s)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,s=0;s<t.length;s++){var i=t[s];i.children?n+=e(i.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),u.define("select2/dropdown/selectOnClose",["../utils"],function(n){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("close",function(e){s._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){t=t.originalSelect2Event;if("select"===t._type||"unselect"===t._type)return}var t=this.getHighlightedResults();t.length<1||null!=(t=n.GetData(t[0],"data")).element&&t.element.selected||null==t.element&&t.selected||this.trigger("select",{data:t})},e}),u.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("select",function(e){s._selectTriggered(e)}),t.on("unselect",function(e){s._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),u.define("select2/dropdown/dropdownCss",["../utils"],function(n){function e(){}return e.prototype.render=function(e){var e=e.call(this),t=this.options.get("dropdownCssClass")||"";return-1!==t.indexOf(":all:")&&(t=t.replace(":all:",""),n.copyNonInternalCssClasses(e[0],this.$element[0])),e.addClass(t),e},e}),u.define("select2/dropdown/tagsSearchHighlight",["../utils"],function(s){function e(){}return e.prototype.highlightFirstItem=function(e){var t=this.$results.find(".select2-results__option--selectable:not(.select2-results__option--selected)");if(0<t.length){var t=t.first(),n=s.GetData(t[0],"data").element;if(n&&n.getAttribute&&"true"===n.getAttribute("data-select2-tag"))return void t.trigger("mouseenter")}e.call(this)},e}),u.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var e=e.input.length-e.maximum,t="Please delete "+e+" character";return 1!=e&&(t+="s"),t},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"},removeItem:function(){return"Remove item"},search:function(){return"Search"}}}),u.define("select2/defaults",["jquery","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/selectionCss","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./dropdown/dropdownCss","./dropdown/tagsSearchHighlight","./i18n/en"],function(l,o,r,a,c,u,d,p,h,f,g,t,m,y,v,_,b,w,$,x,A,D,S,O,L,E,C,T,q,I,e){function n(){this.reset()}return n.prototype.apply=function(e){null==(e=l.extend(!0,{},this.defaults,e)).dataAdapter&&(null!=e.ajax?e.dataAdapter=v:null!=e.data?e.dataAdapter=y:e.dataAdapter=m,0<e.minimumInputLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,w)),0<e.maximumInputLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,$)),0<e.maximumSelectionLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,x)),e.tags&&(e.dataAdapter=f.Decorate(e.dataAdapter,_)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=f.Decorate(e.dataAdapter,b))),null==e.resultsAdapter&&(e.resultsAdapter=o,null!=e.ajax&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,O)),null!=e.placeholder&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,S)),e.selectOnClose&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,C)),e.tags)&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,I)),null==e.dropdownAdapter&&(e.multiple?e.dropdownAdapter=A:(t=f.Decorate(A,D),e.dropdownAdapter=t),0!==e.minimumResultsForSearch&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,E)),e.closeOnSelect&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,T)),null!=e.dropdownCssClass&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,q)),e.dropdownAdapter=f.Decorate(e.dropdownAdapter,L)),null==e.selectionAdapter&&(e.multiple?e.selectionAdapter=a:e.selectionAdapter=r,
vendor: 15,516 bytes, line 772
772null!=e.placeholder&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,c)),e.allowClear&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,u)),e.multiple&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,d)),null!=e.selectionCssClass&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,p)),e.selectionAdapter=f.Decorate(e.selectionAdapter,h)),e.language=this._resolveLanguage(e.language),e.language.push("en");for(var t,n=[],s=0;s<e.language.length;s++){var i=e.language[s];-1===n.indexOf(i)&&n.push(i)}return e.language=n,e.translations=this._processTranslations(e.language,e.debug),e},n.prototype.reset=function(){function a(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return t[e]||e})}this.defaults={amdLanguageBase:"./i18n/",autocomplete:"off",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:f.escapeMarkup,language:{},matcher:function e(t,n){if(null==t.term||""===t.term.trim())return n;if(n.children&&0<n.children.length){for(var s=l.extend(!0,{},n),i=n.children.length-1;0<=i;i--)null==e(t,n.children[i])&&s.children.splice(i,1);return 0<s.children.length?s:e(t,s)}var o=a(n.text).toUpperCase(),r=a(t.term).toUpperCase();return-1<o.indexOf(r)?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},n.prototype.applyFromElement=function(e,t){var n=e.language,s=this.defaults.language,i=t.prop("lang"),t=t.closest("[lang]").prop("lang"),i=Array.prototype.concat.call(this._resolveLanguage(i),this._resolveLanguage(n),this._resolveLanguage(s),this._resolveLanguage(t));return e.language=i,e},n.prototype._resolveLanguage=function(e){if(!e)return[];if(l.isEmptyObject(e))return[];if(l.isPlainObject(e))return[e];for(var t,n=Array.isArray(e)?e:[e],s=[],i=0;i<n.length;i++)s.push(n[i]),"string"==typeof n[i]&&0<n[i].indexOf("-")&&(t=n[i].split("-")[0],s.push(t));return s},n.prototype._processTranslations=function(e,t){for(var n=new g,s=0;s<e.length;s++){var i=new g,o=e[s];if("string"==typeof o)try{i=g.loadPath(o)}catch(e){try{o=this.defaults.amdLanguageBase+o,i=g.loadPath(o)}catch(e){t&&window.console&&console.warn&&console.warn('Select2: The language file for "'+o+'" could not be automatically loaded. A fallback will be used instead.')}}else i=l.isPlainObject(o)?new g(o):o;n.extend(i)}return n},n.prototype.set=function(e,t){var n={},e=(n[l.camelCase(e)]=t,f._convertData(n));l.extend(!0,this.defaults,e)},new n}),u.define("select2/options",["jquery","./defaults","./utils"],function(c,n,u){function e(e,t){this.options=e,null!=t&&this.fromElement(t),null!=t&&(this.options=n.applyFromElement(this.options,t)),this.options=n.apply(this.options)}return e.prototype.fromElement=function(e){var t=["select2"],n=(null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.autocomplete&&e.prop("autocomplete")&&(this.options.autocomplete=e.prop("autocomplete")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),u.GetData(e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),u.StoreData(e[0],"data",u.GetData(e[0],"select2Tags")),u.StoreData(e[0],"tags",!0)),u.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",u.GetData(e[0],"ajaxUrl")),u.StoreData(e[0],"ajax-Url",u.GetData(e[0],"ajaxUrl"))),{});function s(e,t){return t.toUpperCase()}for(var i=0;i<e[0].attributes.length;i++){var o=e[0].attributes[i].name,r="data-";o.substr(0,r.length)==r&&(o=o.substring(r.length),r=u.GetData(e[0],o),n[o.replace(/-([a-z])/g,s)]=r)}c.fn.jquery&&"1."==c.fn.jquery.substr(0,2)&&e[0].dataset&&(n=c.extend(!0,{},e[0].dataset,n));var a,l=c.extend(!0,{},u.GetData(e[0]),n);for(a in l=u._convertData(l))-1<t.indexOf(a)||(c.isPlainObject(this.options[a])?c.extend(this.options[a],l[a]):this.options[a]=l[a]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),u.define("select2/core",["jquery","./options","./utils","./keys"],function(t,i,o,s){function r(e,t){null!=o.GetData(e[0],"select2")&&o.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),this.options=new i(t=t||{},e),r.__super__.constructor.call(this);var t=e.attr("tabindex")||0,t=(o.StoreData(e[0],"old-tabindex",t),e.attr("tabindex","-1"),this.options.get("dataAdapter")),t=(this.dataAdapter=new t(e,this.options),this.render()),n=(this._placeContainer(t),this.options.get("selectionAdapter")),n=(this.selection=new n(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,t),this.options.get("dropdownAdapter")),n=(this.dropdown=new n(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,t),this.options.get("resultsAdapter")),s=(this.results=new n(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown),this);this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){s.trigger("selection:update",{data:e})}),e[0].classList.add("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),o.StoreData(e[0],"select2",this),e.data("select2",this)}return o.Extend(r,o.Observable),r.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+o.generateChars(2):o.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},r.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},r.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t)return null!=(s=this._resolveWidth(e,"style"))?s:this._resolveWidth(e,"element");if("element"==t)return(s=e.outerWidth(!1))<=0?"auto":s+"px";if("style"!=t)return"computedstyle"==t?window.getComputedStyle(e[0]).width:t;var s=e.attr("style");if("string"==typeof s)for(var i=s.split(";"),o=0,r=i.length;o<r;o+=1){var a=i[o].replace(/\s/g,"").match(n);if(null!==a&&1<=a.length)return a[1]}return null},r.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},r.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=o.bind(this._syncAttributes,this),this._syncS=o.bind(this._syncSubtree,this),this._observer=new window.MutationObserver(function(e){t._syncA(),t._syncS(e)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})},r.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(e,t){n.trigger(e,t)})},r.prototype._registerSelectionEvents=function(){var n=this,s=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(e){n.focus(e)}),this.selection.on("*",function(e,t){-1===s.indexOf(e)&&n.trigger(e,t)})},r.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(e,t){n.trigger(e,t)})},r.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(e,t){n.trigger(e,t)})},r.prototype._registerEvents=function(){var n=this;this.on("open",function(){n.$container[0].classList.add("select2-container--open")}),this.on("close",function(){n.$container[0].classList.remove("select2-container--open")}),this.on("enable",function(){n.$container[0].classList.remove("select2-container--disabled")}),this.on("disable",function(){n.$container[0].classList.add("select2-container--disabled")}),this.on("blur",function(){n.$container[0].classList.remove("select2-container--focus")}),this.on("query",function(t){n.isOpen()||n.trigger("open",{}),this.dataAdapter.query(t,function(e){n.trigger("results:all",{data:e,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(e){n.trigger("results:append",{data:e,query:t})})}),this.on("keypress",function(e){var t=e.which;n.isOpen()?t===s.ESC||t===s.UP&&e.altKey?(n.close(e),e.preventDefault()):t===s.ENTER||t===s.TAB?(n.trigger("results:select",{}),e.preventDefault()):t===s.SPACE&&e.ctrlKey?(n.trigger("results:toggle",{}),e.preventDefault()):t===s.UP?(n.trigger("results:previous",{}),e.preventDefault()):t===s.DOWN&&(n.trigger("results:next",{}),e.preventDefault()):(t===s.ENTER||t===s.SPACE||t===s.DOWN&&e.altKey)&&(n.open(),e.preventDefault())})},r.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},r.prototype._isChangeMutation=function(e){var t=this;if(e.addedNodes&&0<e.addedNodes.length){for(var n=0;n<e.addedNodes.length;n++)if(e.addedNodes[n].selected)return!0}else{if(e.removedNodes&&0<e.removedNodes.length)return!0;if(Array.isArray(e))return e.some(function(e){return t._isChangeMutation(e)})}return!1},r.prototype._syncSubtree=function(e){var e=this._isChangeMutation(e),t=this;e&&this.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})},r.prototype.trigger=function(e,t){var n=r.__super__.trigger,s={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in s){var i={prevented:!1,name:e,args:t};if(n.call(this,s[e],i),i.prevented)return void(t.prevented=!0)}n.call(this,e,t)},r.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},r.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},r.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},r.prototype.isEnabled=function(){return!this.isDisabled()},r.prototype.isDisabled=function(){return this.options.get("disabled")},r.prototype.isOpen=function(){return this.$container[0].classList.contains("select2-container--open")},r.prototype.hasFocus=function(){return this.$container[0].classList.contains("select2-container--focus")},r.prototype.focus=function(e){this.hasFocus()||(this.$container[0].classList.add("select2-container--focus"),this.trigger("focus",{}))},r.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.');e=!(e=null!=e&&0!==e.length?e:[!0])[0];this.$element.prop("disabled",e)},r.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},r.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();e=e[0];Array.isArray(e)&&(e=e.map(function(e){return e.toString()})),this.$element.val(e).trigger("input").trigger("change")},r.prototype.destroy=function(){o.RemoveData(this.$container[0]),this.$container.remove(),this._observer.disconnect(),this._observer=null,this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",o.GetData(this.$element[0],"old-tabindex")),this.$element[0].classList.remove("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),o.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},r.prototype.render=function(){var e=t('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container[0].classList.add("select2-container--"+this.options.get("theme")),o.StoreData(e[0],"element",this.$element),e},r}),u.define("select2/dropdown/attachContainer",[],function(){function e(e,t,n){e.call(this,t,n)}return e.prototype.position=function(e,t,n){n.find(".dropdown-wrapper").append(t),t[0].classList.add("select2-dropdown--below"),n[0].classList.add("select2-container--below")},e}),u.define("select2/dropdown/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);this.$dropdown.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(e){e.stopPropagation()})},e}),u.define("select2/selection/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);this.$selection.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(e){e.stopPropagation()})},e}),i=function(c){var u,d,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],p=Array.prototype.slice;if(c.event.fixHooks)for(var n=e.length;n;)c.event.fixHooks[e[--n]]=c.event.mouseHooks;var h=c.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],s,!1);else this.onmousewheel=s;c.data(this,"mousewheel-line-height",h.getLineHeight(this)),c.data(this,"mousewheel-page-height",h.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],s,!1);else this.onmousewheel=null;c.removeData(this,"mousewheel-line-height"),c.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var e=c(e),t=e["offsetParent"in c.fn?"offsetParent":"parent"]();return t.length||(t=c("body")),parseInt(t.css("fontSize"),10)||parseInt(e.css("fontSize"),10)||16},getPageHeight:function(e){return c(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};
772function s(e){var t,n=e||window.event,s=p.call(arguments,1),i=0,o=0,r=0,a=0,l=0;if((e=c.event.fix(n)).type="mousewheel","detail"in n&&(r=-1*n.detail),"wheelDelta"in n&&(r=n.wheelDelta),"wheelDeltaY"in n&&(r=n.wheelDeltaY),"wheelDeltaX"in n&&(o=-1*n.wheelDeltaX),"axis"in n&&n.axis===n.HORIZONTAL_AXIS&&(o=-1*r,r=0),i=0===r?o:r,"deltaY"in n&&(i=r=-1*n.deltaY),"deltaX"in n&&(o=n.deltaX,0===r)&&(i=-1*o),0!==r||0!==o)return 1===n.deltaMode?(i*=t=c.data(this,"mousewheel-line-height"),r*=t,o*=t):2===n.deltaMode&&(i*=t=c.data(this,"mousewheel-page-height"),r*=t,o*=t),t=Math.max(Math.abs(r),Math.abs(o)),(!d||t<d)&&g(n,d=t)&&(d/=40),g(n,t)&&(i/=40,o/=40,r/=40),i=Math[1<=i?"floor":"ceil"](i/d),o=Math[1<=o?"floor":"ceil"](o/d),r=Math[1<=r?"floor":"ceil"](r/d),h.settings.normalizeOffset&&this.getBoundingClientRect&&(n=this.getBoundingClientRect(),a=e.clientX-n.left,l=e.clientY-n.top),e.deltaX=o,e.deltaY=r,e.deltaFactor=d,e.offsetX=a,e.offsetY=l,e.deltaMode=0,s.unshift(e,i,o,r),u&&clearTimeout(u),u=setTimeout(f,200),(c.event.dispatch||c.event.handle).apply(this,s)}function f(){d=null}function g(e,t){return h.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}c.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})},"function"==typeof u.define&&u.define.amd?u.define("jquery-mousewheel",["jquery"],i):"object"==typeof exports?module.exports=i:i(t),u.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(i,e,o,t,r){var a;return null==i.fn.select2&&(a=["open","close","destroy"],i.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new o(i(this),e)}),this;var n,s;if("string"==typeof t)return s=Array.prototype.slice.call(arguments,1),this.each(function(){var e=r.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,s)}),-1<a.indexOf(t)?this:n;throw new Error("Invalid arguments for Select2: "+t)}),null==i.fn.select2.defaults&&(i.fn.select2.defaults=t),o});var e,p,o,r,h,f,g,m,y,v,n,s,_,i,a={define:u.define,require:u.require};function b(e,t){return n.call(e,t)}function l(e,t){var n,s,i,o,r,a,l,c,u,d,p=t&&t.split("/"),h=y.map,f=h&&h["*"]||{};if(e){for(t=(e=e.split("/")).length-1,y.nodeIdCompat&&_.test(e[t])&&(e[t]=e[t].replace(_,"")),"."===e[0].charAt(0)&&p&&(e=p.slice(0,p.length-1).concat(e)),c=0;c<e.length;c++)"."===(d=e[c])?(e.splice(c,1),--c):".."!==d||0===c||1===c&&".."===e[2]||".."===e[c-1]||0<c&&(e.splice(c-1,2),c-=2);e=e.join("/")}if((p||f)&&h){for(c=(n=e.split("/")).length;0<c;--c){if(s=n.slice(0,c).join("/"),p)for(u=p.length;0<u;--u)if(i=(i=h[p.slice(0,u).join("/")])&&i[s]){o=i,r=c;break}if(o)break;!a&&f&&f[s]&&(a=f[s],l=c)}!o&&a&&(o=a,r=l),o&&(n.splice(0,r,o),e=n.join("/"))}return e}function w(t,n){return function(){var e=s.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),r.apply(p,e.concat([t,n]))}}function x(e){var t;if(b(m,e)&&(t=m[e],delete m[e],v[e]=!0,o.apply(p,t)),b(g,e)||b(v,e))return g[e];throw new Error("No "+e)}function c(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function A(e){return e?c(e):[]}var u=a.require("jquery.select2");return t.fn.select2.amd=a,u});;
773/*!
774FullCalendar Standard Bundle v6.1.9
775Docs & License: https://fullcalendar.io/docs/initialize-globals
776(c) 2023 Adam Shaw
777*/
778var FullCalendar=function(e){"use strict";var t,n,r,i,s,o,a,l,c,d={},u=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function f(e,t){for(var n in t)e[n]=t[n];return e}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,n,r){var i,s,o,a={};for(o in n)"key"==o?i=n[o]:"ref"==o?s=n[o]:a[o]=n[o];if(arguments.length>2&&(a.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return m(e,a,i,s,null)}function m(e,t,i,s,o){var a={type:e,props:t,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++r:o};return null==o&&null!=n.vnode&&n.vnode(a),a}function v(){return{current:null}}function y(e){return e.children}function b(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||h.test(t)?n:n+"px"}function E(e,t,n,r,i){var s;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||b(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||b(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])s=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r||e.addEventListener(t,s?A:S,s):e.removeEventListener(t,s?A:S,s);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function S(e){s=!0;try{return this.l[e.type+!1](n.event?n.event(e):e)}finally{s=!1}}function A(e){s=!0;try{return this.l[e.type+!0](n.event?n.event(e):e)}finally{s=!1}}function D(e,t){this.props=e,this.context=t}function w(e,t){if(null==t)return e.__?w(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?w(e):null}function C(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return C(e)}}function R(e){s?setTimeout(e):l(e)}function x(e){(!e.__d&&(e.__d=!0)&&o.push(e)&&!_.__r++||a!==n.debounceRendering)&&((a=n.debounceRendering)||R)(_)}function _(){var e,t,n,r,i,s,a,l;for(o.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=o.shift();)e.__d&&(t=o.length,r=void 0,i=void 0,a=(s=(n=e).__v).__e,(l=n.__P)&&(r=[],(i=f({},s)).__v=s.__v+1,N(l,s,i,n.__n,void 0!==l.ownerSVGElement,null!=s.__h?[a]:null,r,null==a?w(s):a,s.__h),P(r,s),s.__e!=a&&C(s)),o.length>t&&o.sort((function(e,t){return e.__v.__b-t.__v.__b})));_.__r=0}function T(e,t,n,r,i,s,o,a,l,c){var h,f,g,p,v,b,E,S=r&&r.__k||u,A=S.length;
vendor: 8,256 bytes, line 778
778for(n.__k=[],h=0;h<t.length;h++)if(null!=(p=n.__k[h]=null==(p=t[h])||"boolean"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?m(null,p,null,null,p):Array.isArray(p)?m(y,{children:p},null,null,null):p.__b>0?m(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)){if(p.__=n,p.__b=n.__b+1,null===(g=S[h])||g&&p.key==g.key&&p.type===g.type)S[h]=void 0;else for(f=0;f<A;f++){if((g=S[f])&&p.key==g.key&&p.type===g.type){S[f]=void 0;break}g=null}N(e,p,g=g||d,i,s,o,a,l,c),v=p.__e,(f=p.ref)&&g.ref!=f&&(E||(E=[]),g.ref&&E.push(g.ref,null,p),E.push(f,p.__c||v,p)),null!=v?(null==b&&(b=v),"function"==typeof p.type&&p.__k===g.__k?p.__d=l=k(p,l,e):l=I(e,p,g,S,v,l),"function"==typeof n.type&&(n.__d=l)):l&&g.__e==l&&l.parentNode!=e&&(l=w(g))}for(n.__e=b,h=A;h--;)null!=S[h]&&("function"==typeof n.type&&null!=S[h].__e&&S[h].__e==n.__d&&(n.__d=O(r).nextSibling),j(S[h],S[h]));if(E)for(h=0;h<E.length;h++)B(E[h],E[++h],E[++h])}function k(e,t,n){for(var r,i=e.__k,s=0;i&&s<i.length;s++)(r=i[s])&&(r.__=e,t="function"==typeof r.type?k(r,t,n):I(n,r,r,i,r.__e,t));return t}function M(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){M(e,t)})):t.push(e)),t}function I(e,t,n,r,i,s){var o,a,l;if(void 0!==t.__d)o=t.__d,t.__d=void 0;else if(null==n||i!=s||null==i.parentNode)e:if(null==s||s.parentNode!==e)e.appendChild(i),o=null;else{for(a=s,l=0;(a=a.nextSibling)&&l<r.length;l+=1)if(a==i)break e;e.insertBefore(i,s),o=s}return void 0!==o?o:i.nextSibling}function O(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=O(n)))return r;return null}function N(e,t,r,i,s,o,a,l,c){var d,u,h,g,p,m,v,b,E,S,A,w,C,R,x,_=t.type;if(void 0!==t.constructor)return null;null!=r.__h&&(c=r.__h,l=t.__e=r.__e,t.__h=null,o=[l]),(d=n.__b)&&d(t);try{e:if("function"==typeof _){if(b=t.props,E=(d=_.contextType)&&i[d.__c],S=d?E?E.props.value:d.__:i,r.__c?v=(u=t.__c=r.__c).__=u.__E:("prototype"in _&&_.prototype.render?t.__c=u=new _(b,S):(t.__c=u=new D(b,S),u.constructor=_,u.render=z),E&&E.sub(u),u.props=b,u.state||(u.state={}),u.context=S,u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=_.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=f({},u.__s)),f(u.__s,_.getDerivedStateFromProps(b,u.__s))),g=u.props,p=u.state,u.__v=t,h)null==_.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==_.getDerivedStateFromProps&&b!==g&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(b,S),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(b,u.__s,S)||t.__v===r.__v){for(t.__v!==r.__v&&(u.props=b,u.state=u.__s,u.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),A=0;A<u._sb.length;A++)u.__h.push(u._sb[A]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(b,u.__s,S),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(g,p,m)}))}if(u.context=S,u.props=b,u.__P=e,w=n.__r,C=0,"prototype"in _&&_.prototype.render){for(u.state=u.__s,u.__d=!1,w&&w(t),d=u.render(u.props,u.state,u.context),R=0;R<u._sb.length;R++)u.__h.push(u._sb[R]);u._sb=[]}else do{u.__d=!1,w&&w(t),d=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++C<25);u.state=u.__s,null!=u.getChildContext&&(i=f(f({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(m=u.getSnapshotBeforeUpdate(g,p)),x=null!=d&&d.type===y&&null==d.key?d.props.children:d,T(e,Array.isArray(x)?x:[x],t,r,i,s,o,a,l,c),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),v&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=H(r.__e,t,r,i,s,o,a,c);(d=n.diffed)&&d(t)}catch(e){t.__v=null,(c||null!=o)&&(t.__e=l,t.__h=!!c,o[o.indexOf(l)]=null),n.__e(e,t,r)}}function P(e,t){n.__c&&n.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){n.__e(e,t.__v)}}))}function H(e,n,r,i,s,o,a,l){var c,u,h,f=r.props,p=n.props,m=n.type,v=0;if("svg"===m&&(s=!0),null!=o)for(;v<o.length;v++)if((c=o[v])&&"setAttribute"in c==!!m&&(m?c.localName===m:3===c.nodeType)){e=c,o[v]=null;break}if(null==e){if(null===m)return document.createTextNode(p);e=s?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,p.is&&p),o=null,l=!1}if(null===m)f===p||l&&e.data===p||(e.data=p);else{if(o=o&&t.call(e.childNodes),u=(f=r.props||d).dangerouslySetInnerHTML,h=p.dangerouslySetInnerHTML,!l){if(null!=o)for(f={},v=0;v<e.attributes.length;v++)f[e.attributes[v].name]=e.attributes[v].value;(h||u)&&(h&&(u&&h.__html==u.__html||h.__html===e.innerHTML)||(e.innerHTML=h&&h.__html||""))}if(function(e,t,n,r,i){var s;for(s in n)"children"===s||"key"===s||s in t||E(e,s,null,n[s],r);for(s in t)i&&"function"!=typeof t[s]||"children"===s||"key"===s||"value"===s||"checked"===s||n[s]===t[s]||E(e,s,t[s],n[s],r)}(e,p,f,s,l),h)n.__k=[];else if(v=n.props.children,T(e,Array.isArray(v)?v:[v],n,r,i,s&&"foreignObject"!==m,o,a,o?o[0]:r.__k&&w(r,0),l),null!=o)for(v=o.length;v--;)null!=o[v]&&g(o[v]);l||("value"in p&&void 0!==(v=p.value)&&(v!==e.value||"progress"===m&&!v||"option"===m&&v!==f.value)&&E(e,"value",v,f.value,!1),"checked"in p&&void 0!==(v=p.checked)&&v!==e.checked&&E(e,"checked",v,f.checked,!1))}return e}function B(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){n.__e(e,r)}}function j(e,t,r){var i,s;if(n.unmount&&n.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||B(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){n.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(s=0;s<i.length;s++)i[s]&&j(i[s],t,r||"function"!=typeof e.type);r||null==e.__e||g(e.__e),e.__=e.__e=e.__d=void 0}function z(e,t,n){return this.constructor(e,n)}function U(e,r,i){var s,o,a;n.__&&n.__(e,r),o=(s="function"==typeof i)?null:i&&i.__k||r.__k,a=[],N(r,e=(!s&&i||r).__k=p(y,null,[e]),o||d,d,void 0!==r.ownerSVGElement,!s&&i?[i]:o?null:r.firstChild?t.call(r.childNodes):null,a,!s&&i?i:o?o.__e:r.firstChild,s),P(a,e)}t=u.slice,n={__e:function(e,t,n,r){for(var i,s,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&null!=s.getDerivedStateFromError&&(i.setState(s.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},r=0,i=function(e){return null!=e&&void 0===e.constructor},s=!1,D.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=f({},this.state),"function"==typeof e&&(e=e(f({},n),this.props)),e&&f(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),x(this))},D.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),x(this))},D.prototype.render=y,o=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_.__r=0,c=0;var W,L,F,V=[],G=[],Q=n.__b,q=n.__r,Y=n.diffed,Z=n.__c,X=n.unmount;function $(){for(var e;e=V.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ee),e.__H.__h.forEach(te),e.__H.__h=[]}catch(t){e.__H.__h=[],n.__e(t,e.__v)}}n.__b=function(e){W=null,Q&&Q(e)},n.__r=function(e){q&&q(e);var t=(W=e.__c).__H;t&&(L===W?(t.__h=[],W.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=G,e.__N=e.i=void 0}))):(t.__h.forEach(ee),t.__h.forEach(te),t.__h=[])),L=W},n.diffed=function(e){Y&&Y(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==V.push(t)&&F===n.requestAnimationFrame||((F=n.requestAnimationFrame)||K)($)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==G&&(e.__=e.__V),e.i=void 0,e.__V=G}))),L=W=null},n.__c=function(e,t){t.some((function(e){try{e.__h.forEach(ee),e.__h=e.__h.filter((function(e){return!e.__||te(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],n.__e(r,e.__v)}})),Z&&Z(e,t)},n.unmount=function(e){X&&X(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{ee(e)}catch(e){t=e}})),r.__H=void 0,t&&n.__e(t,r.__v))};var J="function"==typeof requestAnimationFrame;function K(e){var t,n=function(){clearTimeout(r),J&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);J&&(t=requestAnimationFrame(n))}function ee(e){var t=W,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),W=t}function te(e){var t=W;e.__c=e.__(),W
vendor: 13,832 bytes, line 778
778=t}function ne(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function re(e){this.props=e}(re.prototype=new D).isPureReactComponent=!0,re.prototype.shouldComponentUpdate=function(e,t){return ne(this.props,e)||ne(this.state,t)};var ie=n.__b;n.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ie&&ie(e)};var se=n.__e;n.__e=function(e,t,n,r){if(e.then)for(var i,s=t;s=s.__;)if((i=s.__c)&&i.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t);se(e,t,n,r)};var oe=n.unmount;function ae(){this.__u=0,this.t=null,this.__b=null}function le(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ce(){this.u=null,this.o=null}n.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),oe&&oe(e)},(ae.prototype=new D).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var i=le(r.__v),s=!1,o=function(){s||(s=!0,n.__R=null,i?i(a):a())};n.__R=o;var a=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},l=!0===t.__h;r.__u++||l||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},ae.prototype.componentWillUnmount=function(){this.t=[]},ae.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=function(e,t){for(var n in t)e[n]=t[n];return e}({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&p(y,null,e.fallback);return i&&(i.__h=null),[p(y,null,t.__a?null:e.children),i]};var de=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function ue(e){return this.getChildContext=function(){return e.context},e.children}function he(e){var t=this,n=e.i;t.componentWillUnmount=function(){U(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),U(p(ue,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function fe(e,t){var n=p(he,{__v:e,i:t});return n.containerInfo=t,n}(ce.prototype=new D).__a=function(e){var t=this,n=le(t.__v),r=t.o.get(e);return r[0]++,function(i){var s=function(){t.props.revealOrder?(r.push(i),de(t,e,r)):i()};n?n(s):s()}},ce.prototype.render=function(e){this.u=null,this.o=new Map;var t=M(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ce.prototype.componentDidUpdate=ce.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){de(e,n,t)}))};var ge="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,pe=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,me="undefined"!=typeof document,ve=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};D.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(D.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var ye=n.event;function be(){}function Ee(){return this.cancelBubble}function Se(){return this.defaultPrevented}n.event=function(e){return ye&&(e=ye(e)),e.persist=be,e.isPropagationStopped=Ee,e.isDefaultPrevented=Se,e.nativeEvent=e};var Ae={configurable:!0,get:function(){return this.class}},De=n.vnode;n.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var s in r={},n){var o=n[s];me&&"children"===s&&"noscript"===t||"value"===s&&"defaultValue"in n&&null==o||("defaultValue"===s&&"value"in n&&null==n.value?s="value":"download"===s&&!0===o?o="":/ondoubleclick/i.test(s)?s="ondblclick":/^onchange(textarea|input)/i.test(s+t)&&!ve(n.type)?s="oninput":/^onfocus$/i.test(s)?s="onfocusin":/^onblur$/i.test(s)?s="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(s)?s=s.toLowerCase():i&&pe.test(s)?s=s.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===o&&(o=void 0),/^oninput$/i.test(s)&&(s=s.toLowerCase(),r[s]&&(s="oninputCapture")),r[s]=o)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=M(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=M(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(Ae.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",Ae))}e.$$typeof=ge,De&&De(e)};var we=n.__r;n.__r=function(e){we&&we(e),e.__c};const Ce=[],Re=new Map;function xe(e){Ce.push(e),Re.forEach(t=>{Te(t,e)})}function _e(e){let t=Re.get(e);if(!t||!t.isConnected){if(t=e.querySelector("style[data-fullcalendar]"),!t){t=document.createElement("style"),t.setAttribute("data-fullcalendar","");const n=function(){void 0===ke&&(ke=function(){const e=document.querySelector('meta[name="csp-nonce"]');if(e&&e.hasAttribute("content"))return e.getAttribute("content");const t=document.querySelector("script[nonce]");if(t)return t.nonce||"";return""}());return ke}();n&&(t.nonce=n);const r=e===document?document.head:e,i=e===document?r.querySelector("script,link[rel=stylesheet],link[as=style],style"):r.firstChild;r.insertBefore(t,i)}Re.set(e,t),function(e){for(const t of Ce)Te(e,t)}(t)}}function Te(e,t){const{sheet:n}=e,r=n.cssRules.length;t.split("}").forEach((e,t)=>{(e=e.trim())&&n.insertRule(e+"}",r+t)})}let ke;"undefined"!=typeof document&&_e(document);xe(':root{--fc-small-font-size:.85em;--fc-page-bg-color:#fff;--fc-neutral-bg-color:hsla(0,0%,82%,.3);--fc-neutral-text-color:grey;--fc-border-color:#ddd;--fc-button-text-color:#fff;--fc-button-bg-color:#2c3e50;--fc-button-border-color:#2c3e50;--fc-button-hover-bg-color:#1e2b37;--fc-button-hover-border-color:#1a252f;--fc-button-active-bg-color:#1a252f;--fc-button-active-border-color:#151e27;--fc-event-bg-color:#3788d8;--fc-event-border-color:#3788d8;--fc-event-text-color:#fff;--fc-event-selected-overlay-color:rgba(0,0,0,.25);--fc-more-link-bg-color:#d0d0d0;--fc-more-link-text-color:inherit;--fc-event-resizer-thickness:8px;--fc-event-resizer-dot-total-width:8px;--fc-event-resizer-dot-border-width:1px;--fc-non-business-color:hsla(0,0%,84%,.3);--fc-bg-event-color:#8fdf82;--fc-bg-event-opacity:0.3;--fc-highlight-color:rgba(188,232,241,.3);--fc-today-bg-color:rgba(255,220,40,.15);--fc-now-indicator-color:red}.fc-not-allowed,.fc-not-allowed .fc-event{cursor:not-allowed}.fc{display:flex;flex-direction:column;font-size:1em}.fc,.fc *,.fc :after,.fc :before{box-sizing:border-box}.fc table{border-collapse:collapse;border-spacing:0;font-size:1em}.fc th{text-align:center}.fc td,.fc th{padding:0;vertical-align:top}.fc a[data-navlink]{cursor:pointer}.fc a[data-navlink]:hover{text-decoration:underline}.fc-direction-ltr{direction:ltr;text-align:left}.fc-direction-rtl{direction:rtl;text-align:right}.fc-theme-standard td,.fc-theme-standard th{border:1px solid var(--fc-border-color)}.fc-liquid-hack td,.fc-liquid-hack th{position:relative}@font-face{font-family:fcicons;font-style:normal;font-weight:400;src:url("data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBfAAAAC8AAAAYGNtYXAXVtKNAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZgYydxIAAAF4AAAFNGhlYWQUJ7cIAAAGrAAAADZoaGVhB20DzAAABuQAAAAkaG10eCIABhQAAAcIAAAALGxvY2ED4AU6AAAHNAAAABhtYXhwAA8AjAAAB0wAAAAgbmFtZXsr690AAAdsAAABhnBvc3QAAwAAAAAI9AAAACAAAwPAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpBgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6Qb//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAWIAjQKeAskAEwAAJSc3NjQnJiIHAQYUFwEWMjc2NCcCnuLiDQ0MJAz/AA0NAQAMJAwNDcni4gwjDQwM/wANIwz/AA0NDCMNAAAAAQFiAI0CngLJABMAACUBNjQnASYiBwYUHwEHBhQXFjI3AZ4BAA0N/wAMJAwNDeLiDQ0MJAyNAQAMIw0BAAwMDSMM4uINIwwNDQAAAAIA4gC3Ax4CngATACcAACUnNzY0JyYiDwEGFB8BFjI3NjQnISc3NjQnJiIPAQYUHwEWMjc2NCcB87e3DQ0MIw3VDQ3VDSMMDQ0BK7e3DQ0MJAzVDQ3VDCQMDQ3zuLcMJAwNDdUNIwzWDAwNIwy4twwkDA0N1Q0jDNYMDA0jDAAAAgDiALcDHgKeABMAJwAAJTc2NC8BJiIHBhQfAQcGFBcWMjchNzY0LwEmIgcGFB8BBwYUFxYyNwJJ1Q0N1Q0jDA0Nt7cNDQwjDf7V1Q0N1QwkDA0Nt7cNDQwkDLfWDCMN1Q0NDCQMt7gMIw0MDNYMIw3VDQ0MJAy3uAwjDQwMAAADAFUAAAOrA1UAMwBoAHcAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMhMjY1NCYjISIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAAVYRGRkR/qoRGRkRA1UFBAUOCQkVDAsZDf2rDRkLDBUJCA4FBQUFBQUOCQgVDAsZDQJVDRkLDBUJCQ4FBAVVAgECBQMCBwQECAX9qwQJAwQHAwMFAQICAgIBBQMDBwQDCQQCVQUIBAQHAgMFAgEC/oAZEhEZGRESGQAAAAADAFUAAAOrA1UAMwBoAIkAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMzFRQWMzI2PQEzMjY1NCYrATU0JiMiBh0BIyIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAgBkSEhmAERkZEYAZEhIZgBEZGREDVQUEBQ4JCRUMCxkN/asNGQsMFQkIDgUFBQUFBQ4JCBUMCxkNAlUNGQsMFQkJDgUEBVUCAQIFAwIHBAQIBf2rBAkDBAcDAwUBAgICAgEFAwMHBAMJBAJVBQgEBAcCAwUCAQL+gIASGRkSgBkSERmAEhkZEoAZERIZAAABAOIAjQMeAskAIAAAExcHBhQXFjI/ARcWMjc2NC8BNzY0JyYiDwEnJiIHBhQX4uLiDQ0MJAzi4gwkDA0N4uINDQwkDOLiDCQMDQ0CjeLiDSMMDQ3h4Q0NDCMN4uIMIw0MDOLiDAwNIwwAAAABAAAAAQAAa5n0y18PPPUACwQAAAAAANivOVsAAAAA2K85WwAAAAADqwNVAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAOrAAEAAAAAAAAAAAAAAAAAAAALBAAAAAAAAAAAAAAAAgAAAAQAAWIEAAFiBAAA4gQAAOIEAABVBAAAVQQAAOIAAAAAAAoAFAAeAEQAagCqAOoBngJkApoAAQAAAAsAigADAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGZjaWNvbnMAZgBjAGkAYwBvAG4Ac1ZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGZjaWNvbnMAZgBjAGkAYwBvAG4Ac2ZjaWNvbnMAZgBjAGkAYwBvAG4Ac1JlZ3VsYXIAUgBlAGcAdQBsAGEAcmZjaWNvbnMAZgBjAGkAYwBvAG4Ac0ZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") format("truetype")}.fc-icon{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;font-family:fcicons!important;font-style:normal;font-variant:normal;font-weight:400;height:1em;line-height:1;text-align:center;text-transform:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:1em}.fc-icon-chevron-left:before{content:"\\e900"}.fc-icon-chevron-right:before{content:"\\e901"}.fc-icon-chevrons-left:before{content:"\\e902"}.fc-icon-chevrons-right:before{content:"\\e903"}.fc-icon-minus-square:before{content:"\\e904"}.fc-icon-plus-square:before{content:"\\e905"}.fc-icon-x:before{content:"\\e906"}.fc .fc-button{border-radius:0;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible;text-transform:none}.fc .fc-button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}.fc .fc-button{-webkit-appearance:button}.fc .fc-button:not(:disabled){cursor:pointer}.fc .fc-button{background-color:transparent;border:1px solid transparent;border-radius:.25em;display:inline-block;font-size:1em;font-weight:400;line-height:1.5;padding:.4em .65em;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle}.fc .fc-button:hover{text-decoration:none}.fc .fc-button:focus{box-shadow:0 0 0 .2rem rgba(44,62,80,.25);outline:0}.fc .fc-button:disabled{opacity:.65}.fc .fc-button-primary{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:hover{background-color:var(--fc-button-hover-bg-color);border-color:var(--fc-button-hover-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:disabled{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button-primary:not(:disabled).fc-button-active,.fc .fc-button-primary:not(:disabled):active{background-color:var(--fc-button-active-bg-color);border-color:var(--fc-button-active-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:not(:disabled).fc-button-active:focus,.fc .fc-button-primary:not(:disabled):active:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button .fc-icon{font-size:1.5em;vertical-align:middle}
vendor: 7,157 bytes, line 778
778.fc .fc-button-group{display:inline-flex;position:relative;vertical-align:middle}.fc .fc-button-group>.fc-button{flex:1 1 auto;position:relative}.fc .fc-button-group>.fc-button.fc-button-active,.fc .fc-button-group>.fc-button:active,.fc .fc-button-group>.fc-button:focus,.fc .fc-button-group>.fc-button:hover{z-index:1}.fc-direction-ltr .fc-button-group>.fc-button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}.fc-direction-ltr .fc-button-group>.fc-button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.fc-direction-rtl .fc-button-group>.fc-button:not(:first-child){border-bottom-right-radius:0;border-top-right-radius:0;margin-right:-1px}.fc-direction-rtl .fc-button-group>.fc-button:not(:last-child){border-bottom-left-radius:0;border-top-left-radius:0}.fc .fc-toolbar{align-items:center;display:flex;justify-content:space-between}.fc .fc-toolbar.fc-header-toolbar{margin-bottom:1.5em}.fc .fc-toolbar.fc-footer-toolbar{margin-top:1.5em}.fc .fc-toolbar-title{font-size:1.75em;margin:0}.fc-direction-ltr .fc-toolbar>*>:not(:first-child){margin-left:.75em}.fc-direction-rtl .fc-toolbar>*>:not(:first-child){margin-right:.75em}.fc-direction-rtl .fc-toolbar-ltr{flex-direction:row-reverse}.fc .fc-scroller{-webkit-overflow-scrolling:touch;position:relative}.fc .fc-scroller-liquid{height:100%}.fc .fc-scroller-liquid-absolute{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-scroller-harness{direction:ltr;overflow:hidden;position:relative}.fc .fc-scroller-harness-liquid{height:100%}.fc-direction-rtl .fc-scroller-harness>.fc-scroller{direction:rtl}.fc-theme-standard .fc-scrollgrid{border:1px solid var(--fc-border-color)}.fc .fc-scrollgrid,.fc .fc-scrollgrid table{table-layout:fixed;width:100%}.fc .fc-scrollgrid table{border-left-style:hidden;border-right-style:hidden;border-top-style:hidden}.fc .fc-scrollgrid{border-bottom-width:0;border-collapse:separate;border-right-width:0}.fc .fc-scrollgrid-liquid{height:100%}.fc .fc-scrollgrid-section,.fc .fc-scrollgrid-section table,.fc .fc-scrollgrid-section>td{height:1px}.fc .fc-scrollgrid-section-liquid>td{height:100%}.fc .fc-scrollgrid-section>*{border-left-width:0;border-top-width:0}.fc .fc-scrollgrid-section-footer>*,.fc .fc-scrollgrid-section-header>*{border-bottom-width:0}.fc .fc-scrollgrid-section-body table,.fc .fc-scrollgrid-section-footer table{border-bottom-style:hidden}.fc .fc-scrollgrid-section-sticky>*{background:var(--fc-page-bg-color);position:sticky;z-index:3}.fc .fc-scrollgrid-section-header.fc-scrollgrid-section-sticky>*{top:0}.fc .fc-scrollgrid-section-footer.fc-scrollgrid-section-sticky>*{bottom:0}.fc .fc-scrollgrid-sticky-shim{height:1px;margin-bottom:-1px}.fc-sticky{position:sticky}.fc .fc-view-harness{flex-grow:1;position:relative}.fc .fc-view-harness-active>.fc-view{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-col-header-cell-cushion{display:inline-block;padding:2px 4px}.fc .fc-bg-event,.fc .fc-highlight,.fc .fc-non-business{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-non-business{background:var(--fc-non-business-color)}.fc .fc-bg-event{background:var(--fc-bg-event-color);opacity:var(--fc-bg-event-opacity)}.fc .fc-bg-event .fc-event-title{font-size:var(--fc-small-font-size);font-style:italic;margin:.5em}.fc .fc-highlight{background:var(--fc-highlight-color)}.fc .fc-cell-shaded,.fc .fc-day-disabled{background:var(--fc-neutral-bg-color)}a.fc-event,a.fc-event:hover{text-decoration:none}.fc-event.fc-event-draggable,.fc-event[href]{cursor:pointer}.fc-event .fc-event-main{position:relative;z-index:2}.fc-event-dragging:not(.fc-event-selected){opacity:.75}.fc-event-dragging.fc-event-selected{box-shadow:0 2px 7px rgba(0,0,0,.3)}.fc-event .fc-event-resizer{display:none;position:absolute;z-index:4}.fc-event-selected .fc-event-resizer,.fc-event:hover .fc-event-resizer{display:block}.fc-event-selected .fc-event-resizer{background:var(--fc-page-bg-color);border-color:inherit;border-radius:calc(var(--fc-event-resizer-dot-total-width)/2);border-style:solid;border-width:var(--fc-event-resizer-dot-border-width);height:var(--fc-event-resizer-dot-total-width);width:var(--fc-event-resizer-dot-total-width)}.fc-event-selected .fc-event-resizer:before{bottom:-20px;content:"";left:-20px;position:absolute;right:-20px;top:-20px}.fc-event-selected,.fc-event:focus{box-shadow:0 2px 5px rgba(0,0,0,.2)}.fc-event-selected:before,.fc-event:focus:before{bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:3}.fc-event-selected:after,.fc-event:focus:after{background:var(--fc-event-selected-overlay-color);bottom:-1px;content:"";left:-1px;position:absolute;right:-1px;top:-1px;z-index:1}.fc-h-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-h-event .fc-event-main{color:var(--fc-event-text-color)}.fc-h-event .fc-event-main-frame{display:flex}.fc-h-event .fc-event-time{max-width:100%;overflow:hidden}.fc-h-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-width:0}.fc-h-event .fc-event-title{display:inline-block;left:0;max-width:100%;overflow:hidden;right:0;vertical-align:top}.fc-h-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-start),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-end){border-bottom-left-radius:0;border-left-width:0;border-top-left-radius:0}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-end),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-start){border-bottom-right-radius:0;border-right-width:0;border-top-right-radius:0}.fc-h-event:not(.fc-event-selected) .fc-event-resizer{bottom:0;top:0;width:var(--fc-event-resizer-thickness)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end{cursor:w-resize;left:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start{cursor:e-resize;right:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-h-event.fc-event-selected .fc-event-resizer{margin-top:calc(var(--fc-event-resizer-dot-total-width)*-.5);top:50%}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-start,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-end{left:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-end,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-start{right:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc .fc-popover{box-shadow:0 2px 6px rgba(0,0,0,.15);position:absolute;z-index:9999}.fc .fc-popover-header{align-items:center;display:flex;flex-direction:row;justify-content:space-between;padding:3px 4px}.fc .fc-popover-title{margin:0 2px}.fc .fc-popover-close{cursor:pointer;font-size:1.1em;opacity:.65}.fc-theme-standard .fc-popover{background:var(--fc-page-bg-color);border:1px solid var(--fc-border-color)}.fc-theme-standard .fc-popover-header{background:var(--fc-neutral-bg-color)}'
vendor: 72,030 bytes, line 778
778);class Me{constructor(e){this.drainedOption=e,this.isRunning=!1,this.isDirty=!1,this.pauseDepths={},this.timeoutId=0}request(e){this.isDirty=!0,this.isPaused()||(this.clearTimeout(),null==e?this.tryDrain():this.timeoutId=setTimeout(this.tryDrain.bind(this),e))}pause(e=""){let{pauseDepths:t}=this;t[e]=(t[e]||0)+1,this.clearTimeout()}resume(e="",t){let{pauseDepths:n}=this;if(e in n){if(t)delete n[e];else{n[e]-=1,n[e]<=0&&delete n[e]}this.tryDrain()}}isPaused(){return Object.keys(this.pauseDepths).length}tryDrain(){if(!this.isRunning&&!this.isPaused()){for(this.isRunning=!0;this.isDirty;)this.isDirty=!1,this.drained();this.isRunning=!1}}clear(){this.clearTimeout(),this.isDirty=!1,this.pauseDepths={}}clearTimeout(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=0)}drained(){this.drainedOption&&this.drainedOption()}}function Ie(e){e.parentNode&&e.parentNode.removeChild(e)}function Oe(e,t){if(e.closest)return e.closest(t);if(!document.documentElement.contains(e))return null;do{if(Ne(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}function Ne(e,t){return(e.matches||e.matchesSelector||e.msMatchesSelector).call(e,t)}function Pe(e,t){let n=e instanceof HTMLElement?[e]:e,r=[];for(let e=0;e<n.length;e+=1){let i=n[e].querySelectorAll(t);for(let e=0;e<i.length;e+=1)r.push(i[e])}return r}const He=/(top|left|right|bottom|width|height)$/i;function Be(e,t){for(let n in t)je(e,n,t[n])}function je(e,t,n){null==n?e.style[t]="":"number"==typeof n&&He.test(t)?e.style[t]=n+"px":e.style[t]=n}function ze(e){var t,n;return null!==(n=null===(t=e.composedPath)||void 0===t?void 0:t.call(e)[0])&&void 0!==n?n:e.target}let Ue=0;function We(){return Ue+=1,"fc-dom-"+Ue}function Le(e){e.preventDefault()}function Fe(e,t,n,r){let i=function(e,t){return n=>{let r=Oe(n.target,e);r&&t.call(r,n,r)}}(n,r);return e.addEventListener(t,i),()=>{e.removeEventListener(t,i)}}const Ve=["webkitTransitionEnd","otransitionend","oTransitionEnd","msTransitionEnd","transitionend"];function Ge(e,t){let n=r=>{t(r),Ve.forEach(t=>{e.removeEventListener(t,n)})};Ve.forEach(t=>{e.addEventListener(t,n)})}function Qe(e){return Object.assign({onClick:e},qe(e))}function qe(e){return{tabIndex:0,onKeyDown(t){"Enter"!==t.key&&" "!==t.key||(e(t),t.preventDefault())}}}let Ye=0;function Ze(){return Ye+=1,String(Ye)}function Xe(){document.body.classList.add("fc-not-allowed")}function $e(){document.body.classList.remove("fc-not-allowed")}function Je(e){e.style.userSelect="none",e.style.webkitUserSelect="none",e.addEventListener("selectstart",Le)}function Ke(e){e.style.userSelect="",e.style.webkitUserSelect="",e.removeEventListener("selectstart",Le)}function et(e){e.addEventListener("contextmenu",Le)}function tt(e){e.removeEventListener("contextmenu",Le)}function nt(e){let t,n,r=[],i=[];for("string"==typeof e?i=e.split(/\s*,\s*/):"function"==typeof e?i=[e]:Array.isArray(e)&&(i=e),t=0;t<i.length;t+=1)n=i[t],"string"==typeof n?r.push("-"===n.charAt(0)?{field:n.substring(1),order:-1}:{field:n,order:1}):"function"==typeof n&&r.push({func:n});return r}function rt(e,t,n){let r,i;for(r=0;r<n.length;r+=1)if(i=it(e,t,n[r]),i)return i;return 0}function it(e,t,n){return n.func?n.func(e,t):st(e[n.field],t[n.field])*(n.order||1)}function st(e,t){return e||t?null==t?-1:null==e?1:"string"==typeof e||"string"==typeof t?String(e).localeCompare(String(t)):e-t:0}function ot(e,t){let n=String(e);return"000".substr(0,t-n.length)+n}function at(e,t,n){return"function"==typeof e?e(...t):"string"==typeof e?t.reduce((e,t,n)=>e.replace("$"+n,t||""),e):n}function lt(e,t){return e-t}function ct(e){return e%1==0}function dt(e){let t=e.querySelector(".fc-scrollgrid-shrink-frame"),n=e.querySelector(".fc-scrollgrid-shrink-cushion");if(!t)throw new Error("needs fc-scrollgrid-shrink-frame className");if(!n)throw new Error("needs fc-scrollgrid-shrink-cushion className");return e.getBoundingClientRect().width-t.getBoundingClientRect().width+n.getBoundingClientRect().width}const ut=["years","months","days","milliseconds"],ht=/^(-?)(?:(\d+)\.)?(\d+):(\d\d)(?::(\d\d)(?:\.(\d\d\d))?)?/;function ft(e,t){return"string"==typeof e?function(e){let t=ht.exec(e);if(t){let e=t[1]?-1:1;return{years:0,months:0,days:e*(t[2]?parseInt(t[2],10):0),milliseconds:e*(60*(t[3]?parseInt(t[3],10):0)*60*1e3+60*(t[4]?parseInt(t[4],10):0)*1e3+1e3*(t[5]?parseInt(t[5],10):0)+(t[6]?parseInt(t[6],10):0))}}return null}(e):"object"==typeof e&&e?gt(e):"number"==typeof e?gt({[t||"milliseconds"]:e}):null}function gt(e){let t={years:e.years||e.year||0,months:e.months||e.month||0,days:e.days||e.day||0,milliseconds:60*(e.hours||e.hour||0)*60*1e3+60*(e.minutes||e.minute||0)*1e3+1e3*(e.seconds||e.second||0)+(e.milliseconds||e.millisecond||e.ms||0)},n=e.weeks||e.week;return n&&(t.days+=7*n,t.specifiedWeeks=!0),t}function pt(e,t){return{years:e.years+t.years,months:e.months+t.months,days:e.days+t.days,milliseconds:e.milliseconds+t.milliseconds}}function mt(e,t){return{years:e.years*t,months:e.months*t,days:e.days*t,milliseconds:e.milliseconds*t}}function vt(e){return yt(e)/864e5}function yt(e){return 31536e6*e.years+2592e6*e.months+864e5*e.days+e.milliseconds}function bt(e,t){let n=null;for(let r=0;r<ut.length;r+=1){let i=ut[r];if(t[i]){let r=e[i]/t[i];if(!ct(r)||null!==n&&n!==r)return null;n=r}else if(e[i])return null}return n}function Et(e){let t=e.milliseconds;if(t){if(t%1e3!=0)return{unit:"millisecond",value:t};if(t%6e4!=0)return{unit:"second",value:t/1e3};if(t%36e5!=0)return{unit:"minute",value:t/6e4};if(t)return{unit:"hour",value:t/36e5}}return e.days?e.specifiedWeeks&&e.days%7==0?{unit:"week",value:e.days/7}:{unit:"day",value:e.days}:e.months?{unit:"month",value:e.months}:e.years?{unit:"year",value:e.years}:{unit:"millisecond",value:0}}function St(e,t,n){if(e===t)return!0;let r,i=e.length;if(i!==t.length)return!1;for(r=0;r<i;r+=1)if(!(n?n(e[r],t[r]):e[r]===t[r]))return!1;return!0}const At=["sun","mon","tue","wed","thu","fri","sat"];function Dt(e,t){let n=Ht(e);return n[2]+=7*t,Bt(n)}function wt(e,t){let n=Ht(e);return n[2]+=t,Bt(n)}function Ct(e,t){let n=Ht(e);return n[6]+=t,Bt(n)}function Rt(e,t){return xt(e,t)/7}function xt(e,t){return(t.valueOf()-e.valueOf())/864e5}function _t(e,t){let n=Mt(e),r=Mt(t);return{years:0,months:0,days:Math.round(xt(n,r)),milliseconds:t.valueOf()-r.valueOf()-(e.valueOf()-n.valueOf())}}function Tt(e,t){let n=kt(e,t);return null!==n&&n%7==0?n/7:null}function kt(e,t){return zt(e)===zt(t)?Math.round(xt(e,t)):null}function Mt(e){return Bt([e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()])}function It(e,t,n,r){let i=Bt([t,0,1+Ot(t,n,r)]),s=Mt(e),o=Math.round(xt(i,s));return Math.floor(o/7)+1}function Ot(e,t,n){let r=7+t-n;return-((7+Bt([e,0,r]).getUTCDay()-t)%7)+r-1}function Nt(e){return[e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()]}function Pt(e){return new Date(e[0],e[1]||0,null==e[2]?1:e[2],e[3]||0,e[4]||0,e[5]||0)}function Ht(e){return[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()]}function Bt(e){return 1===e.length&&(e=e.concat([0])),new Date(Date.UTC(...e))}function jt(e){return!isNaN(e.valueOf())}function zt(e){return 1e3*e.getUTCHours()*60*60+1e3*e.getUTCMinutes()*60+1e3*e.getUTCSeconds()+e.getUTCMilliseconds()}function Ut(e,t,n=!1){let r=e.toISOString();return r=r.replace(".000",""),n&&(r=r.replace("T00:00:00Z","")),r.length>10&&(null==t?r=r.replace("Z",""):0!==t&&(r=r.replace("Z",Vt(t,!0)))),r}function Wt(e){return e.toISOString().replace(/T.*$/,"")}function Lt(e){return e.toISOString().match(/^\d{4}-\d{2}/)[0]}function Ft(e){return ot(e.getUTCHours(),2)+":"+ot(e.getUTCMinutes(),2)+":"+ot(e.getUTCSeconds(),2)}function Vt(e,t=!1){let n=e<0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),s=Math.round(r%60);return t?`${n+ot(i,2)}:${ot(s,2)}`:`GMT${n}${i}${s?":"+ot(s,2):""}`}function Gt(e,t,n){let r,i;return function(...s){if(r){if(!St(r,s)){n&&n(i);let r=e.apply(this,s);t&&t(r,i)||(i=r)}}else i=e.apply(this,s);return r=s,i}}function Qt(e,t,n){let r,i;return s=>{if(r){if(!Cn(r,s)){n&&n(i);let r=e.call(this,s);t&&t(r,i)||(i=r)}}else i=e.call(this,s);return r=s,i}}const qt={week:3,separator:0,omitZeroMinute:0,meridiem:0,omitCommas:0},Yt={timeZoneName:7,era:6,year:5,month:4,day:2,weekday:2,hour:1,minute:1,second:1},Zt=/\s*([ap])\.?m\.?/i,Xt=/,/g,$t=/\s+/g,Jt=/\u200e/g,Kt=/UTC|GMT/;class en{constructor(e){let t={},n={},r=0;for(let i in e)i in qt?(n[i]=e[i],r=Math.max(qt[i],r)):(t[i]=e[i],i in Yt&&(r=Math.max(Yt[i],r)));this.standardDateProps=t,this.extendedSettings=n,this.severity=r,this.buildFormattingFunc=Gt(tn)}format(e,t){return this.buildFormattingFunc(this.standardDateProps,this.extendedSettings,t)(e)}formatRange(e,t,n,r){let{standardDateProps:i,extendedSettings:s}=this,o=function(e,t,n){if(n.getMarkerYear(e)!==n.getMarkerYear(t))return 5;if(n.getMarkerMonth(e)!==n.getMarkerMonth(t))return 4;if(n.getMarkerDay(e)!==n.getMarkerDay(t))return 2;if(zt(e)!==zt(t))return 1;return 0}(e.marker,t.marker,n.calendarSystem);if(!o)return this.format(e,n);let a=o;!(a>1)||"numeric"!==i.year&&"2-digit"!==i.year||"numeric"!==i.month&&"2-digit"!==i.month||"numeric"!==i.day&&"2-digit"!==i.day||(a=1);let l=this.format(e,n),c=this.format(t,n);if(l===c)return l;let d=tn(function(e,t){let n={};for(let r in e)(!(r in Yt)||Yt[r]<=t)&&(n[r]=e[r]);return n}(i,a),s,n),u=d(e),h=d(t),f=function(e,t,n,r){let i=0;for(;i<e.length;){let s=e.indexOf(t,i);if(-1===s)break;let o=e.substr(0,s);i=s+t.length;let a=e.substr(i),l=0;for(;l<n.length;){let e=n.indexOf(r,l);if(-1===e)break;let t=n.substr(0,e);l=e+r.length;let i=n.substr(l);if(o===t&&a===i)return{before:o,after:a}}}return null}(l,u,c,h),g=s.separator||r||n.defaultSeparator||"";return f?f.before+u+g+h+f.after:l+g+c}getLargestUnit(){switch(this.severity){case 7:case 6:case 5:return"year";case 4:return"month";case 3:return"week";case 2:return"day";default:return"time"}}}function tn(e,t,n){let r=Object.keys(e).length;return 1===r&&"short"===e.timeZoneName?e=>Vt(e.timeZoneOffset):0===r&&t.week?e=>function(e,t,n,r,i){let s=[];"long"===i?s.push(n):"short"!==i&&"narrow"!==i||s.push(t);"long"!==i&&"short"!==i||s.push(" ");s.push(r.simpleNumberFormat.format(e)),"rtl"===r.options.direction&&s.reverse();return s.join("")}(n.computeWeekNumber(e.marker),n.weekText,n.weekTextLong,n.locale,t.week):function(e,t,n){e=Object.assign({},e),t=Object.assign({},t),function(e,t){e.timeZoneName&&(e.hour||(e.hour="2-digit"),e.minute||(e.minute="2-digit"));"long"===e.timeZoneName&&(e.timeZoneName="short");t.omitZeroMinute&&(e.second||e.millisecond)&&delete t.omitZeroMinute}(e,t),e.timeZone="UTC";let r,i=new Intl.DateTimeFormat(n.locale.codes,e);if(t.omitZeroMinute){let t=Object.assign({},e);delete t.minute,r=new Intl.DateTimeFormat(n.locale.codes,t)}return s=>{let o,{marker:a}=s;return o=r&&!a.getUTCMinutes()?r:i,function(e,t,n,r,i){e=e.replace(Jt,""),"short"===n.timeZoneName&&(e=function(e,t){let n=!1;e=e.replace(Kt,()=>(n=!0,t)),n||(e+=" "+t);return e}(e,"UTC"===i.timeZone||null==t.timeZoneOffset?"UTC":Vt(t.timeZoneOffset)));r.omitCommas&&(e=e.replace(Xt,"").trim());r.omitZeroMinute&&(e=e.replace(":00",""));!1===r.meridiem?e=e.replace(Zt,"").trim():"narrow"===r.meridiem?e=e.replace(Zt,(e,t)=>t.toLocaleLowerCase()):"short"===r.meridiem?e=e.replace(Zt,(e,t)=>t.toLocaleLowerCase()+"m"):"lowercase"===r.meridiem&&(e=e.replace(Zt,e=>e.toLocaleLowerCase()));return e=(e=e.replace($t," ")).trim()}(o.format(a),s,e,t,n)}}(e,t,n)}function nn(e,t){let n=t.markerToArray(e.marker);return{marker:e.marker,timeZoneOffset:e.timeZoneOffset,array:n,year:n[0],month:n[1],day:n[2],hour:n[3],minute:n[4],second:n[5],millisecond:n[6]}}function rn(e,t,n,r){let i=nn(e,n.calendarSystem);return{date:i,start:i,end:t?nn(t,n.calendarSystem):null,timeZone:n.timeZone,localeCodes:n.locale.codes,defaultSeparator:r||n.defaultSeparator}}class sn{constructor(e){this.cmdStr=e}format(e,t,n){return t.cmdFormatter(this.cmdStr,rn(e,null,t,n))}formatRange(e,t,n,r){return n.cmdFormatter(this.cmdStr,rn(e,t,n,r))}}class on{constructor(e){this.func=e}format(e,t,n){return this.func(rn(e,null,t,n))}formatRange(e,t,n,r){return this.func(rn(e,t,n,r))}}function an(e){return"object"==typeof e&&e?new en(e):"string"==typeof e?new sn(e):"function"==typeof e?new on(e):null}const ln={navLinkDayClick:yn,navLinkWeekClick:yn,duration:ft,bootstrapFontAwesome:yn,buttonIcons:yn,customButtons:yn,defaultAllDayEventDuration:ft,defaultTimedEventDuration:ft,nextDayThreshold:ft,scrollTime:ft,scrollTimeReset:Boolean,slotMinTime:ft,slotMaxTime:ft,dayPopoverFormat:an,slotDuration:ft,snapDuration:ft,headerToolbar:yn,footerToolbar:yn,defaultRangeSeparator:String,titleRangeSeparator:String,forceEventDuration:Boolean,dayHeaders:Boolean,dayHeaderFormat:an,dayHeaderClassNames:yn,dayHeaderContent:yn,dayHeaderDidMount:yn,dayHeaderWillUnmount:yn,dayCellClassNames:yn,dayCellContent:yn,dayCellDidMount:yn,dayCellWillUnmount:yn,initialView:String,aspectRatio:Number,weekends:Boolean,weekNumberCalculation:yn,weekNumbers:Boolean,weekNumberClassNames:yn,weekNumberContent:yn,weekNumberDidMount:yn,weekNumberWillUnmount:yn,editable:Boolean,viewClassNames:yn,viewDidMount:yn,viewWillUnmount:yn,nowIndicator:Boolean,nowIndicatorClassNames:yn,nowIndicatorContent:yn,nowIndicatorDidMount:yn,nowIndicatorWillUnmount:yn,showNonCurrentDates:Boolean,lazyFetching:Boolean,startParam:String,endParam:String,timeZoneParam:String,timeZone:String,locales:yn,locale:yn,themeSystem:String,dragRevertDuration:Number,dragScroll:Boolean,allDayMaintainDuration:Boolean,unselectAuto:Boolean,dropAccept:yn,eventOrder:nt,eventOrderStrict:Boolean,handleWindowResize:Boolean,windowResizeDelay:Number,longPressDelay:Number,eventDragMinDistance:Number,expandRows:Boolean,height:yn,contentHeight:yn,direction:String,weekNumberFormat:an,eventResizableFromStart:Boolean,displayEventTime:Boolean,displayEventEnd:Boolean,weekText:String,weekTextLong:String,progressiveEventRendering:Boolean,businessHours:yn,initialDate:yn,now:yn,eventDataTransform:yn,stickyHeaderDates:yn,stickyFooterScrollbar:yn,viewHeight:yn,defaultAllDay:Boolean,eventSourceFailure:yn,eventSourceSuccess:yn,eventDisplay:String,eventStartEditable:Boolean,eventDurationEditable:Boolean,eventOverlap:yn,eventConstraint:yn,eventAllow:yn,eventBackgroundColor:String,eventBorderColor:String,eventTextColor:String,eventColor:String,eventClassNames:yn,eventContent:yn,eventDidMount:yn,eventWillUnmount:yn,selectConstraint:yn,selectOverlap:yn,selectAllow:yn,droppable:Boolean,unselectCancel:String,slotLabelFormat:yn,slotLaneClassNames:yn,slotLaneContent:yn,slotLaneDidMount:yn,slotLaneWillUnmount:yn,slotLabelClassNames:yn,slotLabelContent:yn,slotLabelDidMount:yn,slotLabelWillUnmount:yn,dayMaxEvents:yn,dayMaxEventRows:yn,dayMinWidth:Number,slotLabelInterval:ft,allDayText:String,allDayClassNames:yn,allDayContent:yn,allDayDidMount:yn,allDayWillUnmount:yn,slotMinWidth:Number,navLinks:Boolean,eventTimeFormat:an,rerenderDelay:Number,moreLinkText:yn,moreLinkHint:yn,selectMinDistance:Number,selectable:Boolean,selectLongPressDelay:Number,eventLongPressDelay:Number,selectMirror:Boolean,eventMaxStack:Number,eventMinHeight:Number,eventMinWidth:Number,eventShortHeight:Number,slotEventOverlap:Boolean,plugins:yn,firstDay:Number,dayCount:Number,dateAlignment:String,dateIncrement:ft,hiddenDays:yn,fixedWeekCount:Boolean,validRange:yn,visibleRange:yn,titleFormat:yn,eventInteractive:Boolean,noEventsText:String,viewHint:yn,navLinkHint:yn,closeHint:String,timeHint:String,eventHint:String,moreLinkClick:yn,moreLinkClassNames:yn,moreLinkContent:yn,moreLinkDidMount:yn,moreLinkWillUnmount:yn,monthStartFormat:an,handleCustomRendering:yn,customRenderingMetaMap:yn},cn={eventDisplay:"auto",defaultRangeSeparator:" - ",titleRangeSeparator:" – ",defaultTimedEventDuration:"01:00:00",defaultAllDayEventDuration:{day:1},forceEventDuration:!1,nextDayThreshold:"00:00:00",dayHeaders:!0,initialView:"",aspectRatio:1.35,headerToolbar:{start:"title",center:"",end:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberCalculation:"local",editable:!1,nowIndicator:!1,scrollTime:"06:00:00",scrollTimeReset:!0,slotMinTime:"00:00:00",slotMaxTime:"24:00:00",showNonCurrentDates:!0,lazyFetching:!0,startParam:"start",endParam:"end",timeZoneParam:"timeZone",timeZone:"local",locales:[],locale:"",themeSystem:"standard",dragRevertDuration:500,dragScroll:!0,allDayMaintainDuration:!1,unselectAuto:!0,dropAccept:"*",eventOrder:"start,-duration,allDay,title",dayPopoverFormat:{month:"long",day:"numeric",year:"numeric"},handleWindowResize:!0,windowResizeDelay:100,longPressDelay:1e3,eventDragMinDistance:5,expandRows:!1,navLinks:!1,selectable:!1,eventMinHeight:15,eventMinWidth:30,eventShortHeight:30,monthStartFormat:{month:"long",day:"numeric"}},dn={datesSet:yn,eventsSet:yn,eventAdd:yn,eventChange:yn,eventRemove:yn,windowResize:yn,eventClick:yn,eventMouseEnter:yn,eventMouseLeave:yn,select:yn,unselect:yn,loading:yn,_unmount:yn,_beforeprint:yn,_afterprint:yn,_noEventDrop:yn,_noEventResize:yn,_resize:yn,_scrollRequest:yn},un={buttonText:yn,buttonHints:yn,views:yn,plugins:yn,initialEvents:yn,events:yn,eventSources:yn},hn={headerToolbar:fn,footerToolbar:fn,buttonText:fn,buttonHints:fn,buttonIcons:fn,dateIncrement:fn,plugins:gn,events:gn,eventSources:gn,resources:gn};function fn(e,t){return"object"==typeof e&&"object"==typeof t&&e&&t?Cn(e,t):e===t}function gn(e,t){return Array.isArray(e)&&Array.isArray(t)?St(e,t):e===t}const pn={type:String,component:yn,buttonText:String,buttonTextKey:String,dateProfileGeneratorClass:yn,usesMinMaxTime:Boolean,classNames:yn,content:yn,didMount:yn,willUnmount:yn};function mn(e){return En(e,hn)}function vn(e,t){let n={},r={};for(let r in t)r in e&&(n[r]=t[r](e[r]));for(let n in e)n in t||(r[n]=e[n]);return{refined:n,extra:r}}function yn(e){return e}const{hasOwnProperty:bn}=Object.prototype;function En(e,t){let n={};if(t)for(let r in t)if(t[r]===fn){let t=[];for(let i=e.length-1;i>=0;i-=1){let s=e[i][r];if("object"==typeof s&&s)t.unshift(s);else if(void 0!==s){n[r]=s;break}}t.length&&(n[r]=En(t))}for(let t=e.length-1;t>=0;t-=1){let r=e[t];for(let e in r)e in n||(n[e]=r[e])}return n}function Sn(e,t){let n={};for(let r in e)t(e[r],r)&&(n[r]=e[r]);return n}function An(e,t){let n={};for(let r in e)n[r]=t(e[r],r);return n}function Dn(e){let t={};for(let n of e)t[n]=!0;return t}function wn(e){let t=[];for(let n in e)t.push(e[n]);return t}function Cn(e,t){if(e===t)return!0;for(let n in e)if(bn.call(e,n)&&!(n in t))return!1;for(let n in t)if(bn.call(t,n)&&e[n]!==t[n])return!1;return!0}const Rn=/^on[A-Z]/;function xn(e,t){let n=[];for(let r in e)bn.call(e,r)&&(r in t||n.push(r));for(let r in t)bn.call(t,r)&&e[r]!==t[r]&&n.push(r);return n}function _n(e,t,n={}){if(e===t)return!0;for(let r in t)if(!(r in e)||!Tn(e[r],t[r],n[r]))return!1;for(let n in e)if(!(n in t))return!1;return!0}function Tn(e,t,n){return e===t||!0===n||!!n&&n(e,t)}function kn(e,t=0,n,r=1){let i=[];null==n&&(n=Object.keys(e).length);for(let s=t;s<n;s+=r){let t=e[s];void 0!==t&&i.push(t)}return i}let Mn={};var In,On;In="gregory",On=class{getMarkerYear(e){return e.getUTCFullYear()}getMarkerMonth(e){return e.getUTCMonth()}getMarkerDay(e){return e.getUTCDate()}arrayToMarker(e){return Bt(e)}markerToArray(e){return Ht(e)}},Mn[In]=On;const Nn=/^\s*(\d{4})(-?(\d{2})(-?(\d{2})([T ](\d{2}):?(\d{2})(:?(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/;function Pn(e){let t=Nn.exec(e);if(t){let e=new Date(Date.UTC(Number(t[1]),t[3]?Number(t[3])-1:0,Number(t[5]||1),Number(t[7]||0),Number(t[8]||0),Number(t[10]||0),t[12]?1e3*Number("0."+t[12]):0));if(jt(e)){let n=null;return t[13]&&(n=("-"===t[15]?-1:1)*(60*Number(t[16]||0)+Number(t[18]||0))),{marker:e,isTimeUnspecified:!t[6],timeZoneOffset:n}}}return null}class Hn{constructor(e){let t=this.timeZone=e.timeZone,n="local"!==t&&"UTC"!==t;e.namedTimeZoneImpl&&n&&(this.namedTimeZoneImpl=new e.namedTimeZoneImpl(t)),this.canComputeOffset=Boolean(!n||this.namedTimeZoneImpl),this.calendarSystem=function(e){return new Mn[e]}(e.calendarSystem),this.locale=e.locale,this.weekDow=e.locale.week.dow,this.weekDoy=e.locale.week.doy,"ISO"===e.weekNumberCalculation&&(this.weekDow=1,this.weekDoy=4),"number"==typeof e.firstDay&&(this.weekDow=e.firstDay),"function"==typeof e.weekNumberCalculation&&(this.weekNumberFunc=e.weekNumberCalculation),this.weekText=null!=e.weekText?e.weekText:e.locale.options.weekText,this.weekTextLong=(null!=e.weekTextLong?e.weekTextLong:e.locale.options.weekTextLong)||this.weekText,this.cmdFormatter=e.cmdFormatter,this.defaultSeparator=e.defaultSeparator}createMarker(e){let t=this.createMarkerMeta(e);return null===t?null:t.marker}createNowMarker(){return this.canComputeOffset?this.timestampToMarker((new Date).valueOf()):Bt(Nt(new Date))}createMarkerMeta(e){if("string"==typeof e)return this.parse(e);let t=null;return"number"==typeof e?t=this.timestampToMarker(e):e instanceof Date?(e=e.valueOf(),isNaN(e)||(t=this.timestampToMarker(e))):Array.isArray(e)&&(t=Bt(e)),null!==t&&jt(t)?{marker:t,isTimeUnspecified:!1,forcedTzo:null}:null}parse(e){let t=Pn(e);if(null===t)return null;let{marker:n}=t,r=null;return null!==t.timeZoneOffset&&(this.canComputeOffset?n=this.timestampToMarker(n.valueOf()-60*t.timeZoneOffset*1e3):r=t.timeZoneOffset),{marker:n,isTimeUnspecified:t.isTimeUnspecified,forcedTzo:r}}getYear(e){return this.calendarSystem.getMarkerYear(e)}getMonth(e){return this.calendarSystem.getMarkerMonth(e)}getDay(e){return this.calendarSystem.getMarkerDay(e)}add(e,t){let n=this.calendarSystem.markerToArray(e);return n[0]+=t.years,n[1]+=t.months,n[2]+=t.days,n[6]+=t.milliseconds,this.calendarSystem.arrayToMarker(n)}subtract(e,t){let n=this.calendarSystem.markerToArray(e);return n[0]-=t.years,n[1]-=t.months,n[2]-=t.days,n[6]-=t.milliseconds,this.calendarSystem.arrayToMarker(n)}addYears(e,t){let n=this.calendarSystem.markerToArray(e);return n[0]+=t,this.calendarSystem.arrayToMarker(n)}addMonths(e,t){let n=this.calendarSystem.markerToArray(e);return n[1]+=t,this.calendarSystem.arrayToMarker(n)}diffWholeYears(e,t){let{calendarSystem:n}=this;return zt(e)===zt(t)&&n.getMarkerDay(e)===n.getMarkerDay(t)&&n.getMarkerMonth(e)===n.getMarkerMonth(t)?n.getMarkerYear(t)-n.getMarkerYear(e):null}diffWholeMonths(e,t){let{calendarSystem:n}=this;return zt(e)===zt(t)&&n.getMarkerDay(e)===n.getMarkerDay(t)?n.getMarkerMonth(t)-n.getMarkerMonth(e)+12*(n.getMarkerYear(t)-n.getMarkerYear(e)):null}greatestWholeUnit(e,t){let n=this.diffWholeYears(e,t);return null!==n?{unit:"year",value:n}:(n=this.diffWholeMonths(e,t),null!==n?{unit:"month",value:n}:(n=Tt(e,t),null!==n?{unit:"week",value:n}:(n=kt(e,t),null!==n?{unit:"day",value:n}:(n=function(e,t){return(t.valueOf()-e.valueOf())/36e5}(e,t),ct(n)?{unit:"hour",value:n}:(n=function(e,t){return(t.valueOf()-e.valueOf())/6e4}(e,t),ct(n)?{unit:"minute",value:n}:(n=function(e,t){return(t.valueOf()-e.valueOf())/1e3}(e,t),ct(n)?{unit:"second",value:n}:{unit:"millisecond",value:t.valueOf()-e.valueOf()}))))))}countDurationsBetween(e,t,n){let r;return n.years&&(r=this.diffWholeYears(e,t),null!==r)?r/(vt(n)/365):n.months&&(r=this.diffWholeMonths(e,t),null!==r)?r/function(e){return vt(e)/30}(n):n.days&&(r=kt(e,t),null!==r)?r/vt(n):(t.valueOf()-e.valueOf())/yt(n)}startOf(e,t){return"year"===t?this.startOfYear(e):"month"===t?this.startOfMonth(e):"week"===t?this.startOfWeek(e):"day"===t?Mt(e):"hour"===t?function(e){return Bt([e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours()])}(e):"minute"===t?function(e){return Bt([e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes()])}(e):"second"===t?function(e){return Bt([e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()])}(e):null}startOfYear(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e)])}startOfMonth(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e)])}startOfWeek(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e),e.getUTCDate()-(e.getUTCDay()-this.weekDow+7)%7])}computeWeekNumber(e){return this.weekNumberFunc?this.weekNumberFunc(this.toDate(e)):function(e,t,n){let r=e.getUTCFullYear(),i=It(e,r,t,n);if(i<1)return It(e,r-1,t,n);let s=It(e,r+1,t,n);return s>=1?Math.min(i,s):i}(e,this.weekDow,this.weekDoy)}format(e,t,n={}){return t.format({marker:e,timeZoneOffset:null!=n.forcedTzo?n.forcedTzo:this.offsetForMarker(e)},this)}formatRange(e,t,n,r={}){return r.isEndExclusive&&(t=Ct(t,-1)),n.formatRange({marker:e,timeZoneOffset:null!=r.forcedStartTzo?r.forcedStartTzo:this.offsetForMarker(e)},{marker:t,timeZoneOffset:null!=r.forcedEndTzo?r.forcedEndTzo:this.offsetForMarker(t)},this,r.defaultSeparator)}formatIso(e,t={}){let n=null;return t.omitTimeZoneOffset||(n=null!=t.forcedTzo?t.forcedTzo:this.offsetForMarker(e)),Ut(e,n,t.omitTime)}timestampToMarker(e){return"local"===this.timeZone?Bt(Nt(new Date(e))):"UTC"!==this.timeZone&&this.namedTimeZoneImpl?Bt(this.namedTimeZoneImpl.timestampToArray(e)):new Date(e)}offsetForMarker(e){return"local"===this.timeZone?-Pt(Ht(e)).getTimezoneOffset():"UTC"===this.timeZone?0:this.namedTimeZoneImpl?this.namedTimeZoneImpl.offsetForArray(Ht(e)):null}toDate(e,t){return"local"===this.timeZone?Pt(Ht(e)):"UTC"===this.timeZone?new Date(e.valueOf()):this.namedTimeZoneImpl?new Date(e.valueOf()-1e3*this.namedTimeZoneImpl.offsetForArray(Ht(e))*60):new Date(e.valueOf()-(t||0))}}class Bn{constructor(e){this.iconOverrideOption&&this.setIconOverride(e[this.iconOverrideOption])}setIconOverride(e){let t,n;if("object"==typeof e&&e){for(n in t=Object.assign({},this.iconClasses),e)t[n]=this.applyIconOverridePrefix(e[n]);this.iconClasses=t}else!1===e&&(this.iconClasses={})}applyIconOverridePrefix(e){let t=this.iconOverridePrefix;return t&&0!==e.indexOf(t)&&(e=t+e),e}getClass(e){return this.classes[e]||""}getIconClass(e,t){let n;return n=t&&this.rtlIconClasses&&this.rtlIconClasses[e]||this.iconClasses[e],n?`${this.baseIconClass} ${n}`:""}getCustomButtonIconClass(e){let t;return this.iconOverrideCustomButtonOption&&(t=e[this.iconOverrideCustomButtonOption],t)?`${this.baseIconClass} ${this.applyIconOverridePrefix(t)}`:""}}function jn(e){e();let t=n.debounceRendering,r=[];for(n.debounceRendering=function(e){r.push(e)},U(p(zn,{}),document.createElement("div"));r.length;)r.shift()();n.debounceRendering=t}Bn.prototype.classes={},Bn.prototype.iconClasses={},Bn.prototype.baseIconClass="",Bn.prototype.iconOverridePrefix="";class zn extends D{render(){return p("div",{})}componentDidMount(){this.setState({})}}function Un(e){let t=function(e,t){var n={__c:t="__cC"+c++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,x(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}(e),n=t.Provider;return t.Provider=function(){let e=!this.getChildContext,t=n.apply(this,arguments);if(e){let e=[];this.shouldComponentUpdate=t=>{this.props.value!==t.value&&e.forEach(e=>{e.context=t.value,e.forceUpdate()})},this.sub=t=>{e.push(t);let n=t.componentWillUnmount;t.componentWillUnmount=()=>{e.splice(e.indexOf(t),1),n&&n.call(t)}}}return t},t}class Wn{constructor(e,t,n,r){this.execFunc=e,this.emitter=t,this.scrollTime=n,this.scrollTimeReset=r,this.handleScrollRequest=e=>{this.queuedRequest=Object.assign({},this.queuedRequest||{},e),this.drain()},t.on("_scrollRequest",this.handleScrollRequest),this.fireInitialScroll()}detach(){this.emitter.off("_scrollRequest",this.handleScrollRequest)}update(e){e&&this.scrollTimeReset?this.fireInitialScroll():this.drain()}fireInitialScroll(){this.handleScrollRequest({time:this.scrollTime})}drain(){this.queuedRequest&&this.execFunc(this.queuedRequest)&&(this.queuedRequest=null)}}const Ln=Un({});function Fn(e,t,n,r,i,s,o,a,l,c,d,u,h){return{dateEnv:i,options:n,pluginHooks:o,emitter:c,dispatch:a,getCurrentData:l,calendarApi:d,viewSpec:e,viewApi:t,dateProfileGenerator:r,theme:s,isRtl:"rtl"===n.direction,addResizeHandler(e){c.on("_resize",e)},removeResizeHandler(e){c.off("_resize",e)},createScrollResponder:e=>new Wn(e,c,ft(n.scrollTime),n.scrollTimeReset),registerInteractiveComponent:u,unregisterInteractiveComponent:h}}class Vn extends D{shouldComponentUpdate(e,t){return this.debug&&console.log(xn(e,this.props),xn(t,this.state)),!_n(this.props,e,this.propEquality)||!_n(this.state,t,this.stateEquality)}safeSetState(e){_n(this.state,Object.assign(Object.assign({},this.state),e),this.stateEquality)||this.setState(e)}}Vn.addPropsEquality=function(e){let t=Object.create(this.prototype.propEquality);Object.assign(t,e),this.prototype.propEquality=t},Vn.addStateEquality=function(e){let t=Object.create(this.prototype.stateEquality);Object.assign(t,e),this.prototype.stateEquality=t},Vn.contextType=Ln,Vn.prototype.propEquality={},Vn.prototype.stateEquality={};class Gn extends Vn{}function Qn(e,t){"function"==typeof e?e(t):e&&(e.current=t)}Gn.contextType=Ln;class qn extends Gn{constructor(){super(...arguments),this.id=Ze(),this.queuedDomNodes=[],this.currentDomNodes=[],this.handleEl=e=>{Yn(this.props.generatorName,this.context.options)||this.updateElRef(e)},this.updateElRef=e=>{this.props.elRef&&Qn(this.props.elRef,e)}}render(){const{props:e,context:t}=this,{options:n}=t,{customGenerator:r,defaultGenerator:s,renderProps:o}=e,a=Zn(e,[],this.handleEl);let l,c,d=!1,u=[];if(null!=r){const e="function"==typeof r?r(o,p):r;if(!0===e)d=!0;else{const t=e&&"object"==typeof e;t&&"html"in e?a.dangerouslySetInnerHTML={__html:e.html}:t&&"domNodes"in e?u=Array.prototype.slice.call(e.domNodes):(t?i(e):"function"!=typeof e)?l=e:c=e}}else d=!Yn(e.generatorName,n);return d&&s&&(l=s(o)),this.queuedDomNodes=u,this.currentGeneratorMeta=c,p(e.elTag,a,l)}componentDidMount(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentDidUpdate(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentWillUnmount(){this.triggerCustomRendering(!1)}triggerCustomRendering(e){var t;const{props:n,context:r}=this,{handleCustomRendering:i,customRenderingMetaMap:s}=r.options;if(i){const r=null!==(t=this.currentGeneratorMeta)&&void 0!==t?t:null==s?void 0:s[n.generatorName];r&&i(Object.assign(Object.assign({id:this.id,isActive:e,containerEl:this.base,reportNewContainerEl:this.updateElRef,generatorMeta:r},n),{elClasses:(n.elClasses||[]).filter(Xn)}))}}applyQueueudDomNodes(){const{queuedDomNodes:e,currentDomNodes:t}=this,n=this.base;if(!St(e,t)){t.forEach(Ie);for(let t of e)n.appendChild(t);this.currentDomNodes=e}}}function Yn(e,t){var n;return Boolean(t.handleCustomRendering&&e&&(null===(n=t.customRenderingMetaMap)||void 0===n?void 0:n[e]))}function Zn(e,t,n){const r=Object.assign(Object.assign({},e.elAttrs),{ref:n});return(e.elClasses||t)&&(r.className=(e.elClasses||[]).concat(t||[]).concat(r.className||[]).filter(Boolean).join(" ")),e.elStyle&&(r.style=e.elStyle),r}function Xn(e){return Boolean(e)}qn.addPropsEquality({elClasses:St,elStyle:Cn,elAttrs:function(e,t){const n=xn(e,t);for(let e of n)if(!Rn.test(e))return!1;return!0},renderProps:Cn});const $n=Un(0);class Jn extends D{constructor(){super(...arguments),this.InnerContent=Kn.bind(void 0,this),this.handleEl=e=>{this.el=e,this.props.elRef&&Qn(this.props.elRef,e)}}render(){const{props:e}=this,t=function(e,t){const n="function"==typeof e?e(t):e||[];return"string"==typeof n?[n]:n}(e.classNameGenerator,e.renderProps);if(e.children){const n=Zn(e,t,this.handleEl),r=e.children(this.InnerContent,e.renderProps,n);return e.elTag?p(e.elTag,n,r):r}return p(qn,Object.assign(Object.assign({},e),{elRef:this.handleEl,elTag:e.elTag||"div",elClasses:(e.elClasses||[]).concat(t),renderId:this.context}))}componentDidMount(){var e,t;null===(t=(e=this.props).didMount)||void 0===t||t.call(e,Object.assign(Object.assign({},this.props.renderProps),{el:this.el}))}componentWillUnmount(){var e,t;null===(t=(e=this.props).willUnmount)||void 0===t||t.call(e,Object.assign(Object.assign({},this.props.renderProps),{el:this.el}))}}function Kn(e,t){const n=e.props;return p(qn,Object.assign({renderProps:n.renderProps,generatorName:n.generatorName,customGenerator:n.customGenerator,defaultGenerator:n.defaultGenerator,renderId:e.context},t))}Jn.contextType=$n;class er extends Gn{render(){let{props:e,context:t}=this,{options:n}=t,r={view:t.viewApi};return p(Jn,Object.assign({},e,{elTag:e.elTag||"div",elClasses:[...tr(e.viewSpec),...e.elClasses||[]],renderProps:r,classNameGenerator:n.viewClassNames,generatorName:void 0,didMount:n.viewDidMount,willUnmount:n.viewWillUnmount}),()=>e.children)}}function tr(e){return[`fc-${e.type}-view`,"fc-view"]}function nr(e,t){let n,r,i=[],{start:s}=t;for(e.sort(rr),n=0;n<e.length;n+=1)r=e[n],r.start>s&&i.push({start:s,end:r.start}),r.end>s&&(s=r.end);return s<t.end&&i.push({start:s,end:t.end}),i}function rr(e,t){return e.start.valueOf()-t.start.valueOf()}function ir(e,t){let{start:n,end:r}=e,i=null;return null!==t.start&&(n=null===n?t.start:new Date(Math.max(n.valueOf(),t.start.valueOf()))),null!=t.end&&(r=null===r?t.end:new Date(Math.min(r.valueOf(),t.end.valueOf()))),(null===n||null===r||n<r)&&(i={start:n,end:r}),i}function sr(e,t){return(null===e.start?null:e.start.valueOf())===(null===t.start?null:t.start.valueOf())&&(null===e.end?null:e.end.valueOf())===(null===t.end?null:t.end.valueOf())}function or(e,t){return(null===e.end||null===t.start||e.end>t.start)&&(null===e.start||null===t.end||e.start<t.end)}function ar(e,t){return(null===e.start||null!==t.start&&t.start>=e.start)&&(null===e.end||null!==t.end&&t.end<=e.end)}function lr(e,t){return(null===e.start||t>=e.start)&&(null===e.end||t<e.end)}function cr(e){let t=Math.floor(xt(e.start,e.end))||1,n=Mt(e.start);return{start:n,end:wt(n,t)}}function dr(e,t=ft(0)){let n=null,r=null;if(e.end){r=Mt(e.end);let n=e.end.valueOf()-r.valueOf();n&&n>=yt(t)&&(r=wt(r,1))}return e.start&&(n=Mt(e.start),r&&r<=n&&(r=wt(n,1))),{start:n,end:r}}function ur(e){let t=dr(e);return xt(t.start,t.end)>1}function hr(e,t,n,r){return"year"===r?ft(n.diffWholeYears(e,t),"year"):"month"===r?ft(n.diffWholeMonths(e,t),"month"):_t(e,t)}function fr(e,t){return"function"==typeof e&&(e=e()),null==e?t.createNowMarker():t.createMarker(e)}class gr{constructor(e){this.props=e,this.nowDate=fr(e.nowInput,e.dateEnv),this.initHiddenDays()}buildPrev(e,t,n){let{dateEnv:r}=this.props,i=r.subtract(r.startOf(t,e.currentRangeUnit),e.dateIncrement);return this.build(i,-1,n)}buildNext(e,t,n){let{dateEnv:r}=this.props,i=r.add(r.startOf(t,e.currentRangeUnit),e.dateIncrement);return this.build(i,1,n)}build(e,t,n=!0){let r,i,s,o,a,l,{props:c}=this;var d,u;return r=this.buildValidRange(),r=this.trimHiddenDays(r),n&&(d=e,e=null!=(u=r).start&&d<u.start?u.start:null!=u.end&&d>=u.end?new Date(u.end.valueOf()-1):d),i=this.buildCurrentRangeInfo(e,t),s=/^(year|month|week|day)$/.test(i.unit),o=this.buildRenderRange(this.trimHiddenDays(i.range),i.unit,s),o=this.trimHiddenDays(o),a=o,c.showNonCurrentDates||(a=ir(a,i.range)),a=this.adjustActiveRange(a),a=ir(a,r),l=or(i.range,r),lr(o,e)||(e=o.start),{currentDate:e,validRange:r,currentRange:i.range,currentRangeUnit:i.unit,isRangeAllDay:s,activeRange:a,renderRange:o,slotMinTime:c.slotMinTime,slotMaxTime:c.slotMaxTime,isValid:l,dateIncrement:this.buildDateIncrement(i.duration)}}buildValidRange(){let e=this.props.validRangeInput,t="function"==typeof e?e.call(this.props.calendarApi,this.nowDate):e;return this.refineRange(t)||{start:null,end:null}}buildCurrentRangeInfo(e,t){let n,{props:r}=this,i=null,s=null,o=null;return r.duration?(i=r.duration,s=r.durationUnit,o=this.buildRangeFromDuration(e,t,i,s)):(n=this.props.dayCount)?(s="day",o=this.buildRangeFromDayCount(e,t,n)):(o=this.buildCustomVisibleRange(e))?s=r.dateEnv.greatestWholeUnit(o.start,o.end).unit:(i=this.getFallbackDuration(),s=Et(i).unit,o=this.buildRangeFromDuration(e,t,i,s)),{duration:i,unit:s,range:o}}getFallbackDuration(){return ft({day:1})}adjustActiveRange(e){let{dateEnv:t,usesMinMaxTime:n,slotMinTime:r,slotMaxTime:i}=this.props,{start:s,end:o}=e;return n&&(vt(r)<0&&(s=Mt(s),s=t.add(s,r)),vt(i)>1&&(o=Mt(o),o=wt(o,-1),o=t.add(o,i))),{start:s,end:o}}buildRangeFromDuration(e,t,n,r){let i,s,o,{dateEnv:a,dateAlignment:l}=this.props;if(!l){let{dateIncrement:e}=this.props;l=e&&yt(e)<yt(n)?Et(e).unit:r}function c(){i=a.startOf(e,l),s=a.add(i,n),o={start:i,end:s}}return vt(n)<=1&&this.isHiddenDay(i)&&(i=this.skipHiddenDays(i,t),i=Mt(i)),c(),this.trimHiddenDays(o)||(e=this.skipHiddenDays(e,t),c()),o}buildRangeFromDayCount(e,t,n){let r,{dateEnv:i,dateAlignment:s}=this.props,o=0,a=e;s&&(a=i.startOf(a,s)),a=Mt(a),a=this.skipHiddenDays(a,t),r=a;do{r=wt(r,1),this.isHiddenDay(r)||(o+=1)}while(o<n);return{start:a,end:r}}buildCustomVisibleRange(e){let{props:t}=this,n=t.visibleRangeInput,r="function"==typeof n?n.call(t.calendarApi,t.dateEnv.toDate(e)):n,i=this.refineRange(r);return!i||null!=i.start&&null!=i.end?i:null}buildRenderRange(e,t,n){return e}buildDateIncrement(e){let t,{dateIncrement:n}=this.props;return n||((t=this.props.dateAlignment)?ft(1,t):e||ft({days:1}))}refineRange(e){if(e){let t=function(e,t){let n=null,r=null;return e.start&&(n=t.createMarker(e.start)),e.end&&(r=t.createMarker(e.end)),n||r?n&&r&&r<n?null:{start:n,end:r}:null}(e,this.props.dateEnv);return t&&(t=dr(t)),t}return null}initHiddenDays(){let e,t=this.props.hiddenDays||[],n=[],r=0;for(!1===this.props.weekends&&t.push(0,6),e=0;e<7;e+=1)(n[e]=-1!==t.indexOf(e))||(r+=1);if(!r)throw new Error("invalid hiddenDays");this.isHiddenDayHash=n}trimHiddenDays(e){let{start:t,end:n}=e;return t&&(t=this.skipHiddenDays(t)),n&&(n=this.skipHiddenDays(n,-1,!0)),null==t||null==n||t<n?{start:t,end:n}:null}isHiddenDay(e){return e instanceof Date&&(e=e.getUTCDay()),this.isHiddenDayHash[e]}skipHiddenDays(e,t=1,n=!1){for(;this.isHiddenDayHash[(e.getUTCDay()+(n?t:0)+7)%7];)e=wt(e,t);return e}}function pr(e,t,n,r){return{instanceId:Ze(),defId:e,range:t,forcedStartTzo:null==n?null:n,forcedEndTzo:null==r?null:r}}function mr(e,t,n){let{dateEnv:r,pluginHooks:i,options:s}=n,{defs:o,instances:a}=e;a=Sn(a,e=>!o[e.defId].recurringDef);for(let e in o){let n=o[e];if(n.recurringDef){let{duration:o}=n.recurringDef;o||(o=n.allDay?s.defaultAllDayEventDuration:s.defaultTimedEventDuration);let l=vr(n,o,t,r,i.recurringTypes);for(let t of l){let n=pr(e,{start:t,end:r.add(t,o)});a[n.instanceId]=n}}}return{defs:o,instances:a}}function vr(e,t,n,r,i){let s=i[e.recurringDef.typeId].expand(e.recurringDef.typeData,{start:r.subtract(n.start,t),end:n.end},r);return e.allDay&&(s=s.map(Mt)),s}const yr={id:String,groupId:String,title:String,url:String,interactive:Boolean},br={start:yn,end:yn,date:yn,allDay:Boolean},Er=Object.assign(Object.assign(Object.assign({},yr),br),{extendedProps:yn});function Sr(e,t,n,r,i=Dr(n),s,o){let{refined:a,extra:l}=Ar(e,n,i),c=function(e,t){let n=null;e&&(n=e.defaultAllDay);null==n&&(n=t.options.defaultAllDay);return n}(t,n),d=function(e,t,n,r){for(let i=0;i<r.length;i+=1){let s=r[i].parse(e,n);if(s){let{allDay:n}=e;return null==n&&(n=t,null==n&&(n=s.allDayGuess,null==n&&(n=!1))),{allDay:n,duration:s.duration,typeData:s.typeData,typeId:i}}}return null}(a,c,n.dateEnv,n.pluginHooks.recurringTypes);if(d){let e=wr(a,l,t?t.sourceId:"",d.allDay,Boolean(d.duration),n,s);return e.recurringDef={typeId:d.typeId,typeData:d.typeData,duration:d.duration},{def:e,instance:null}}let u=function(e,t,n,r){let i,s,{allDay:o}=e,a=null,l=!1,c=null,d=null!=e.start?e.start:e.date;if(i=n.dateEnv.createMarkerMeta(d),i)a=i.marker;else if(!r)return null;null!=e.end&&(s=n.dateEnv.createMarkerMeta(e.end));null==o&&(o=null!=t?t:(!i||i.isTimeUnspecified)&&(!s||s.isTimeUnspecified));o&&a&&(a=Mt(a));s&&(c=s.marker,o&&(c=Mt(c)),a&&c<=a&&(c=null));c?l=!0:r||(l=n.options.forceEventDuration||!1,c=n.dateEnv.add(a,o?n.options.defaultAllDayEventDuration:n.options.defaultTimedEventDuration));return{allDay:o,hasEnd:l,range:{start:a,end:c},forcedStartTzo:i?i.forcedTzo:null,forcedEndTzo:s?s.forcedTzo:null}}(a,c,n,r);if(u){let e=wr(a,l,t?t.sourceId:"",u.allDay,u.hasEnd,n,s),r=pr(e.defId,u.range,u.forcedStartTzo,u.forcedEndTzo);return o&&e.publicId&&o[e.publicId]&&(r.instanceId=o[e.publicId]),{def:e,instance:r}}return null}function Ar(e,t,n=Dr(t)){return vn(e,n)}function Dr(e){return Object.assign(Object.assign(Object.assign({},Ir),Er),e.pluginHooks.eventRefiners)}function wr(e,t,n,r,i,s,o){let a={title:e.title||"",groupId:e.groupId||"",publicId:e.id||"",url:e.url||"",recurringDef:null,defId:(o&&e.id?o[e.id]:"")||Ze(),sourceId:n,allDay:r,hasEnd:i,interactive:e.interactive,ui:Nr(e,s),extendedProps:Object.assign(Object.assign({},e.extendedProps||{}),t)};for(let t of s.pluginHooks.eventDefMemberAdders)Object.assign(a,t(e));return Object.freeze(a.ui.classNames),Object.freeze(a.extendedProps),a}function Cr(e,t,n,r,i,s){let o={defs:{},instances:{}},a=Dr(n);for(let l of e){let e=Sr(l,t,n,r,a,i,s);e&&Rr(e,o)}return o}function Rr(e,t={defs:{},instances:{}}){return t.defs[e.def.defId]=e.def,e.instance&&(t.instances[e.instance.instanceId]=e.instance),t}function xr(e,t){let n=e.instances[t];if(n){let t=e.defs[n.defId],r=kr(e,e=>{return n=t,r=e,Boolean(n.groupId&&n.groupId===r.groupId);var n,r});return r.defs[t.defId]=t,r.instances[n.instanceId]=n,r}return{defs:{},instances:{}}}function _r(){return{defs:{},instances:{}}}function Tr(e,t){return{defs:Object.assign(Object.assign({},e.defs),t.defs),instances:Object.assign(Object.assign({},e.instances),t.instances)}}function kr(e,t){let n=Sn(e.defs,t),r=Sn(e.instances,e=>n[e.defId]);return{defs:n,instances:r}}function Mr(e){return Array.isArray(e)?e:"string"==typeof e?e.split(/\s+/):[]}const Ir={display:String,editable:Boolean,startEditable:Boolean,durationEditable:Boolean,constraint:yn,overlap:yn,allow:yn,className:Mr,classNames:Mr,color:String,backgroundColor:String,borderColor:String,textColor:String},Or={display:null,startEditable:null,durationEditable:null,constraints:[],overlap:null,allows:[],backgroundColor:"",borderColor:"",textColor:"",classNames:[]};function Nr(e,t){let n=function(e,t){return Array.isArray(e)?Cr(e,null,t,!0):"object"==typeof e&&e?Cr([e],null,t,!0):null!=e?String(e):null}(e.constraint,t);return{display:e.display||null,startEditable:null!=e.startEditable?e.startEditable:e.editable,durationEditable:null!=e.durationEditable?e.durationEditable:e.editable,constraints:null!=n?[n]:[],overlap:null!=e.overlap?e.overlap:null,allows:null!=e.allow?[e.allow]:[],backgroundColor:e.backgroundColor||e.color||"",borderColor:e.borderColor||e.color||"",textColor:e.textColor||"",classNames:(e.className||[]).concat(e.classNames||[])}}function Pr(e){return e.reduce(Hr,Or)}function Hr(e,t){return{display:null!=t.display?t.display:e.display,startEditable:null!=t.startEditable?t.startEditable:e.startEditable,durationEditable:null!=t.durationEditable?t.durationEditable:e.durationEditable,constraints:e.constraints.concat(t.constraints),overlap:"boolean"==typeof t.overlap?t.overlap:e.overlap,allows:e.allows.concat(t.allows),backgroundColor:t.backgroundColor||e.backgroundColor,borderColor:t.borderColor||e.borderColor,textColor:t.textColor||e.textColor,classNames:e.classNames.concat(t.classNames)}}const Br={id:String,defaultAllDay:Boolean,url:String,format:String,events:yn,eventDataTransform:yn,success:yn,failure:yn};function jr(e,t,n=zr(t)){let r;if("string"==typeof e?r={url:e}:"function"==typeof e||Array.isArray(e)?r={events:e}:"object"==typeof e&&e&&(r=e),r){let{refined:i,extra:s}=vn(r,n),o=function(e,t){let n=t.pluginHooks.eventSourceDefs;for(let t=n.length-1;t>=0;t-=1){let r=n[t].parseMeta(e);if(r)return{sourceDefId:t,meta:r}}return null}(i,t);if(o)return{_raw:e,isFetching:!1,latestFetchId:"",fetchRange:null,defaultAllDay:i.defaultAllDay,eventDataTransform:i.eventDataTransform,success:i.success,failure:i.failure,publicId:i.id||"",sourceId:Ze(),sourceDefId:o.sourceDefId,meta:o.meta,ui:Nr(i,t),extendedProps:s}}return null}function zr(e){return Object.assign(Object.assign(Object.assign({},Ir),Br),e.pluginHooks.eventSourceRefiners)}function Ur(e,t,n,r,i){switch(t.type){case"RECEIVE_EVENTS":return function(e,t,n,r,i,s){if(t&&n===t.latestFetchId){let n=Cr(Wr(i,t,s),t,s);return r&&(n=mr(n,r,s)),Tr(Vr(e,t.sourceId),n)}return e}(e,n[t.sourceId],t.fetchId,t.fetchRange,t.rawEvents,i);case"RESET_RAW_EVENTS":return function(e,t,n,r,i){const{defIdMap:s,instanceIdMap:o}=function(e){const{defs:t,instances:n}=e,r={},i={};for(let e in t){const n=t[e],{publicId:i}=n;i&&(r[i]=e)}for(let e in n){const r=n[e],s=t[r.defId],{publicId:o}=s;o&&(i[o]=e)}return{defIdMap:r,instanceIdMap:i}}(e);return mr(Cr(Wr(n,t,i),t,i,!1,s,o),r,i)}(e,n[t.sourceId],t.rawEvents,r.activeRange,i);case"ADD_EVENTS":return function(e,t,n,r){n&&(t=mr(t,n,r));return Tr(e,t)}(e,t.eventStore,r?r.activeRange:null,i);case"RESET_EVENTS":return t.eventStore;case"MERGE_EVENTS":return Tr(e,t.eventStore);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return r?mr(e,r.activeRange,i):e;case"REMOVE_EVENTS":return function(e,t){let{defs:n,instances:r}=e,i={},s={};for(let e in n)t.defs[e]||(i[e]=n[e]);for(let e in r)!t.instances[e]&&i[r[e].defId]&&(s[e]=r[e]);return{defs:i,instances:s}}(e,t.eventStore);case"REMOVE_EVENT_SOURCE":return Vr(e,t.sourceId);case"REMOVE_ALL_EVENT_SOURCES":return kr(e,e=>!e.sourceId);case"REMOVE_ALL_EVENTS":return{defs:{},instances:{}};default:return e}}function Wr(e,t,n){let r=n.options.eventDataTransform,i=t?t.eventDataTransform:null;return i&&(e=Lr(e,i)),r&&(e=Lr(e,r)),e}function Lr(e,t){let n;if(t){n=[];for(let r of e){let e=t(r);e?n.push(e):null==e&&n.push(r)}}else n=e;return n}function Fr(e,t,n){let{defs:r}=e,i=An(e.instances,e=>r[e.defId].allDay?e:Object.assign(Object.assign({},e),{range:{start:n.createMarker(t.toDate(e.range.start,e.forcedStartTzo)),end:n.createMarker(t.toDate(e.range.end,e.forcedEndTzo))},forcedStartTzo:n.canComputeOffset?null:e.forcedStartTzo,forcedEndTzo:n.canComputeOffset?null:e.forcedEndTzo}));return{defs:r,instances:i}}function Vr(e,t){return kr(e,e=>e.sourceId!==t)}class Gr{constructor(){this.handlers={},this.thisContext=null}setThisContext(e){this.thisContext=e}setOptions(e){this.options=e}on(e,t){!function(e,t,n){(e[t]||(e[t]=[])).push(n)}(this.handlers,e,t)}off(e,t){!function(e,t,n){n?e[t]&&(e[t]=e[t].filter(e=>e!==n)):delete e[t]}(this.handlers,e,t)}trigger(e,...t){let n=this.handlers[e]||[],r=this.options&&this.options[e],i=[].concat(r||[],n);for(let e of i)e.apply(this.thisContext,t)}hasHandlers(e){return Boolean(this.handlers[e]&&this.handlers[e].length||this.options&&this.options[e])}}const Qr={startTime:"09:00",endTime:"17:00",daysOfWeek:[1,2,3,4,5],display:"inverse-background",classNames:"fc-non-business",groupId:"_businessHours"};function qr(e,t){return Cr(function(e){let t;t=!0===e?[{}]:Array.isArray(e)?e.filter(e=>e.daysOfWeek):"object"==typeof e&&e?[e]:[];return t=t.map(e=>Object.assign(Object.assign({},Qr),e)),t}(e),null,t)}function Yr(e,t,n){n.emitter.trigger("select",Object.assign(Object.assign({},Zr(e,n)),{jsEvent:t?t.origEvent:null,view:n.viewApi||n.calendarApi.view}))}function Zr(e,t){let n={};for(let r of t.pluginHooks.dateSpanTransforms)Object.assign(n,r(e,t));var r,i;return Object.assign(n,(r=e,i=t.dateEnv,Object.assign(Object.assign({},wi(r.range,i,r.allDay)),{allDay:r.allDay}))),n}function Xr(e,t,n){let{dateEnv:r,options:i}=n,s=t;return e?(s=Mt(s),s=r.add(s,i.defaultAllDayEventDuration)):s=r.add(s,i.defaultTimedEventDuration),s}function $r(e,t,n,r){let i=li(e.defs,t),s={defs:{},instances:{}};for(let t in e.defs){let o=e.defs[t];s.defs[t]=Jr(o,i[t],n,r)}for(let t in e.instances){let o=e.instances[t],a=s.defs[o.defId];s.instances[t]=Kr(o,a,i[o.defId],n,r)}return s}function Jr(e,t,n,r){let i=n.standardProps||{};null==i.hasEnd&&t.durationEditable&&(n.startDelta||n.endDelta)&&(i.hasEnd=!0);let s=Object.assign(Object.assign(Object.assign({},e),i),{ui:Object.assign(Object.assign({},e.ui),i.ui)});n.extendedProps&&(s.extendedProps=Object.assign(Object.assign({},s.extendedProps),n.extendedProps));for(let e of r.pluginHooks.eventDefMutationAppliers)e(s,n,r);return!s.hasEnd&&r.options.forceEventDuration&&(s.hasEnd=!0),s}function Kr(e,t,n,r,i){let{dateEnv:s}=i,o=r.standardProps&&!0===r.standardProps.allDay,a=r.standardProps&&!1===r.standardProps.hasEnd,l=Object.assign({},e);return o&&(l.range=cr(l.range)),r.datesDelta&&n.startEditable&&(l.range={start:s.add(l.range.start,r.datesDelta),end:s.add(l.range.end,r.datesDelta)}),r.startDelta&&n.durationEditable&&(l.range={start:s.add(l.range.start,r.startDelta),end:l.range.end}),r.endDelta&&n.durationEditable&&(l.range={start:l.range.start,end:s.add(l.range.end,r.endDelta)}),a&&(l.range={start:l.range.start,end:Xr(t.allDay,l.range.start,i)}),t.allDay&&(l.range={start:Mt(l.range.start),end:Mt(l.range.end)}),l.range.end<l.range.start&&(l.range.end=Xr(t.allDay,l.range.start,i)),l}class ei{constructor(e,t){this.context=e,this.internalEventSource=t}remove(){this.context.dispatch({type:"REMOVE_EVENT_SOURCE",sourceId:this.internalEventSource.sourceId})}refetch(){this.context.dispatch({type:"FETCH_EVENT_SOURCES",sourceIds:[this.internalEventSource.sourceId],isRefetch:!0})}get id(){return this.internalEventSource.publicId}get url(){return this.internalEventSource.meta.url}get format(){return this.internalEventSource.meta.format}}class ti{constructor(e,t,n){this._context=e,this._def=t,this._instance=n||null}setProp(e,t){if(e in br)console.warn("Could not set date-related prop 'name'. Use one of the date-related methods instead.");else if("id"===e)t=yr[e](t),this.mutate({standardProps:{publicId:t}});else if(e in yr)t=yr[e](t),this.mutate({standardProps:{[e]:t}});else if(e in Ir){let n=Ir[e](t);n="color"===e?{backgroundColor:t,borderColor:t}:"editable"===e?{startEditable:t,durationEditable:t}:{[e]:t},this.mutate({standardProps:{ui:n}})}else console.warn(`Could not set prop '${e}'. Use setExtendedProp instead.`)}setExtendedProp(e,t){this.mutate({extendedProps:{[e]:t}})}setStart(e,t={}){let{dateEnv:n}=this._context,r=n.createMarker(e);if(r&&this._instance){let e=hr(this._instance.range.start,r,n,t.granularity);t.maintainDuration?this.mutate({datesDelta:e}):this.mutate({startDelta:e})}}setEnd(e,t={}){let n,{dateEnv:r}=this._context;if((null==e||(n=r.createMarker(e),n))&&this._instance)if(n){let e=hr(this._instance.range.end,n,r,t.granularity);this.mutate({endDelta:e})}else this.mutate({standardProps:{hasEnd:!1}})}setDates(e,t,n={}){let r,{dateEnv:i}=this._context,s={allDay:n.allDay},o=i.createMarker(e);var a,l;if(o&&((null==t||(r=i.createMarker(t),r))&&this._instance)){let e=this._instance.range;!0===n.allDay&&(e=cr(e));let t=hr(e.start,o,i,n.granularity);if(r){let o=hr(e.end,r,i,n.granularity);l=o,(a=t).years===l.years&&a.months===l.months&&a.days===l.days&&a.milliseconds===l.milliseconds?this.mutate({datesDelta:t,standardProps:s}):this.mutate({startDelta:t,endDelta:o,standardProps:s})}else s.hasEnd=!1,this.mutate({datesDelta:t,standardProps:s})}}moveStart(e){let t=ft(e);t&&this.mutate({startDelta:t})}moveEnd(e){let t=ft(e);t&&this.mutate({endDelta:t})}moveDates(e){let t=ft(e);t&&this.mutate({datesDelta:t})}setAllDay(e,t={}){let n={allDay:e},{maintainDuration:r}=t;null==r&&(r=this._context.options.allDayMaintainDuration),this._def.allDay!==e&&(n.hasEnd=r),this.mutate({standardProps:n})}formatRange(e){let{dateEnv:t}=this._context,n=this._instance,r=an(e);return this._def.hasEnd?t.formatRange(n.range.start,n.range.end,r,{forcedStartTzo:n.forcedStartTzo,forcedEndTzo:n.forcedEndTzo}):t.format(n.range.start,r,{forcedTzo:n.forcedStartTzo})}mutate(e){let t=this._instance;if(t){let n=this._def,r=this._context,{eventStore:i}=r.getCurrentData(),s=xr(i,t.instanceId);s=$r(s,{"":{display:"",startEditable:!0,durationEditable:!0,constraints:[],overlap:null,allows:[],backgroundColor:"",borderColor:"",textColor:"",classNames:[]}},e,r);let o=new ti(r,n,t);this._def=s.defs[n.defId],this._instance=s.instances[t.instanceId],r.dispatch({type:"MERGE_EVENTS",eventStore:s}),r.emitter.trigger("eventChange",{oldEvent:o,event:this,relatedEvents:ri(s,r,t),revert(){r.dispatch({type:"RESET_EVENTS",eventStore:i})}})}}remove(){let e=this._context,t=ni(this);e.dispatch({type:"REMOVE_EVENTS",eventStore:t}),e.emitter.trigger("eventRemove",{event:this,relatedEvents:[],revert(){e.dispatch({type:"MERGE_EVENTS",eventStore:t})}})}get source(){let{sourceId:e}=this._def;return e?new ei(this._context,this._context.getCurrentData().eventSources[e]):null}get start(){return this._instance?this._context.dateEnv.toDate(this._instance.range.start):null}get end(){return this._instance&&this._def.hasEnd?this._context.dateEnv.toDate(this._instance.range.end):null}get startStr(){let e=this._instance;return e?this._context.dateEnv.formatIso(e.range.start,{omitTime:this._def.allDay,forcedTzo:e.forcedStartTzo}):""}get endStr(){let e=this._instance;return e&&this._def.hasEnd?this._context.dateEnv.formatIso(e.range.end,{omitTime:this._def.allDay,forcedTzo:e.forcedEndTzo}):""}get id(){return this._def.publicId}get groupId(){return this._def.groupId}get allDay(){return this._def.allDay}get title(){return this._def.title}get url(){return this._def.url}get display(){return this._def.ui.display||"auto"}get startEditable(){return this._def.ui.startEditable}get durationEditable(){return this._def.ui.durationEditable}get constraint(){return this._def.ui.constraints[0]||null}get overlap(){return this._def.ui.overlap}get allow(){return this._def.ui.allows[0]||null}get backgroundColor(){return this._def.ui.backgroundColor}get borderColor(){return this._def.ui.borderColor}get textColor(){return this._def.ui.textColor}get classNames(){return this._def.ui.classNames}get extendedProps(){return this._def.extendedProps}toPlainObject(e={}){let t=this._def,{ui:n}=t,{startStr:r,endStr:i}=this,s={allDay:t.allDay};return t.title&&(s.title=t.title),r&&(s.start=r),i&&(s.end=i),t.publicId&&(s.id=t.publicId),t.groupId&&(s.groupId=t.groupId),t.url&&(s.url=t.url),n.display&&"auto"!==n.display&&(s.display=n.display),e.collapseColor&&n.backgroundColor&&n.backgroundColor===n.borderColor?s.color=n.backgroundColor:(n.backgroundColor&&(s.backgroundColor=n.backgroundColor),n.borderColor&&(s.borderColor=n.borderColor)),n.textColor&&(s.textColor=n.textColor),n.classNames.length&&(s.classNames=n.classNames),Object.keys(t.extendedProps).length&&(e.collapseExtendedProps?Object.assign(s,t.extendedProps):s.extendedProps=t.extendedProps),s}toJSON(){return this.toPlainObject()}}function ni(e){let t=e._def,n=e._instance;return{defs:{[t.defId]:t},instances:n?{[n.instanceId]:n}:{}}}function ri(e,t,n){let{defs:r,instances:i}=e,s=[],o=n?n.instanceId:"";for(let e in i){let n=i[e],a=r[n.defId];n.instanceId!==o&&s.push(new ti(t,a,n))}return s}function ii(e,t,n,r){let i={},s={},o={},a=[],l=[],c=li(e.defs,t);for(let t in e.defs){let n=e.defs[t];"inverse-background"===c[n.defId].display&&(n.groupId?(i[n.groupId]=[],o[n.groupId]||(o[n.groupId]=n)):s[t]=[])}for(let t in e.instances){let o=e.instances[t],d=e.defs[o.defId],u=c[d.defId],h=o.range,f=!d.allDay&&r?dr(h,r):h,g=ir(f,n);g&&("inverse-background"===u.display?d.groupId?i[d.groupId].push(g):s[o.defId].push(g):"none"!==u.display&&("background"===u.display?a:l).push({def:d,ui:u,instance:o,range:g,isStart:f.start&&f.start.valueOf()===g.start.valueOf(),isEnd:f.end&&f.end.valueOf()===g.end.valueOf()}))}for(let e in i){let t=nr(i[e],n);for(let n of t){let t=o[e],r=c[t.defId];a.push({def:t,ui:r,instance:null,range:n,isStart:!1,isEnd:!1})}}for(let t in s){let r=nr(s[t],n);for(let n of r)a.push({def:e.defs[t],ui:c[t],instance:null,range:n,isStart:!1,isEnd:!1})}return{bg:a,fg:l}}function si(e){return"background"===e.ui.display||"inverse-background"===e.ui.display}function oi(e,t){e.fcSeg=t}function ai(e){return e.fcSeg||e.parentNode.fcSeg||null}function li(e,t){return An(e,e=>ci(e,t))}function ci(e,t){let n=[];return t[""]&&n.push(t[""]),t[e.defId]&&n.push(t[e.defId]),n.push(e.ui),Pr(n)}function di(e,t){let n=e.map(ui);return n.sort((e,n)=>rt(e,n,t)),n.map(e=>e._seg)}function ui(e){let{eventRange:t}=e,n=t.def,r=t.instance?t.instance.range:t.range,i=r.start?r.start.valueOf():0,s=r.end?r.end.valueOf():0;return Object.assign(Object.assign(Object.assign({},n.extendedProps),n),{id:n.publicId,start:i,end:s,duration:s-i,allDay:Number(n.allDay),_seg:e})}function hi(e,t){let{pluginHooks:n}=t,r=n.isDraggableTransformers,{def:i,ui:s}=e.eventRange,o=s.startEditable;for(let e of r)o=e(o,i,s,t);return o}function fi(e,t){return e.isStart&&e.eventRange.ui.durationEditable&&t.options.eventResizableFromStart}function gi(e,t){return e.isEnd&&e.eventRange.ui.durationEditable}function pi(e,t,n,r,i,s,o){let{dateEnv:a,options:l}=n,{displayEventTime:c,displayEventEnd:d}=l,u=e.eventRange.def,h=e.eventRange.instance;null==c&&(c=!1!==r),null==d&&(d=!1!==i);let f=h.range.start,g=h.range.end,p=s||e.start||e.eventRange.range.start,m=o||e.end||e.eventRange.range.end,v=Mt(f).valueOf()===Mt(p).valueOf(),y=Mt(Ct(g,-1)).valueOf()===Mt(Ct(m,-1)).valueOf();return c&&!u.allDay&&(v||y)?(p=v?f:p,m=y?g:m,d&&u.hasEnd?a.formatRange(p,m,t,{forcedStartTzo:s?null:h.forcedStartTzo,forcedEndTzo:o?null:h.forcedEndTzo}):a.format(p,t,{forcedTzo:s?null:h.forcedStartTzo})):""}function mi(e,t,n){let r=e.eventRange.range;return{isPast:r.end<(n||t.start),isFuture:r.start>=(n||t.end),isToday:t&&lr(t,r.start)}}function vi(e){let t=["fc-event"];return e.isMirror&&t.push("fc-event-mirror"),e.isDraggable&&t.push("fc-event-draggable"),(e.isStartResizable||e.isEndResizable)&&t.push("fc-event-resizable"),e.isDragging&&t.push("fc-event-dragging"),e.isResizing&&t.push("fc-event-resizing"),e.isSelected&&t.push("fc-event-selected"),e.isStart&&t.push("fc-event-start"),e.isEnd&&t.push("fc-event-end"),e.isPast&&t.push("fc-event-past"),e.isToday&&t.push("fc-event-today"),e.isFuture&&t.push("fc-event-future"),t}function yi(e){return e.instance?e.instance.instanceId:`${e.def.defId}:${e.range.start.toISOString()}`}function bi(e,t){let{def:n,instance:r}=e.eventRange,{url:i}=n;if(i)return{href:i};let{emitter:s,options:o}=t,{eventInteractive:a}=o;return null==a&&(a=n.interactive,null==a&&(a=Boolean(s.hasHandlers("eventClick")))),a?qe(e=>{s.trigger("eventClick",{el:e.target,event:new ti(t,n,r),jsEvent:e,view:t.viewApi})}):{}}const Ei={start:yn,end:yn,allDay:Boolean};function Si(e,t,n){let r=function(e,t){let{refined:n,extra:r}=vn(e,Ei),i=n.start?t.createMarkerMeta(n.start):null,s=n.end?t.createMarkerMeta(n.end):null,{allDay:o}=n;null==o&&(o=i&&i.isTimeUnspecified&&(!s||s.isTimeUnspecified));return Object.assign({range:{start:i?i.marker:null,end:s?s.marker:null},allDay:o},r)}(e,t),{range:i}=r;if(!i.start)return null;if(!i.end){if(null==n)return null;i.end=t.add(i.start,n)}return r}function Ai(e,t){return sr(e.range,t.range)&&e.allDay===t.allDay&&function(e,t){for(let n in t)if("range"!==n&&"allDay"!==n&&e[n]!==t[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}(e,t)}function Di(e,t,n){return Object.assign(Object.assign({},wi(e,t,n)),{timeZone:t.timeZone})}function wi(e,t,n){return{start:t.toDate(e.start),end:t.toDate(e.end),startStr:t.formatIso(e.start,{omitTime:n}),endStr:t.formatIso(e.end,{omitTime:n})}}function Ci(e,t,n){let r=!1,i=function(e){r||(r=!0,t(e))},s=function(e){r||(r=!0,n(e))},o=e(i,s);o&&"function"==typeof o.then&&o.then(i,s)}class Ri extends Error{constructor(e,t){super(e),this.response=t}}function xi(e,t,n){const r={method:e=e.toUpperCase()};return"GET"===e?t+=(-1===t.indexOf("?")?"?":"&")+new URLSearchParams(n):(r.body=new URLSearchParams(n),r.headers={"Content-Type":"application/x-www-form-urlencoded"}),fetch(t,r).then(e=>{if(e.ok)return e.json().then(t=>[t,e],()=>{throw new Ri("Failure parsing JSON",e)});throw new Ri("Request failed",e)})}let _i;function Ti(){return null==_i&&(_i=function(){if("undefined"==typeof document)return!0;let e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.innerHTML="<table><tr><td><div></div></td></tr></table>",e.querySelector("table").style.height="100px",e.querySelector("div").style.height="100%",document.body.appendChild(e);let t=e.querySelector("div").offsetHeight>0;return document.body.removeChild(e),t}()),_i}class ki extends Gn{constructor(){super(...arguments),this.state={forPrint:!1},this.handleBeforePrint=()=>{this.setState({forPrint:!0})},this.handleAfterPrint=()=>{this.setState({forPrint:!1})}}render(){let{props:e}=this,{options:t}=e,{forPrint:n}=this.state,r=n||"auto"===t.height||"auto"===t.contentHeight,i=r||null==t.height?"":t.height,s=["fc",n?"fc-media-print":"fc-media-screen","fc-direction-"+t.direction,e.theme.getClass("root")];return Ti()||s.push("fc-liquid-hack"),e.children(s,i,r,n)}componentDidMount(){let{emitter:e}=this.props;e.on("_beforeprint",this.handleBeforePrint),e.on("_afterprint",this.handleAfterPrint)}componentWillUnmount(){let{emitter:e}=this.props;e.off("_beforeprint",this.handleBeforePrint),e.off("_afterprint",this.handleAfterPrint)}}class Mi{constructor(e){this.component=e.component,this.isHitComboAllowed=e.isHitComboAllowed||null}destroy(){}}function Ii(e){return{[e.component.uid]:e}}const Oi={};class Ni{getCurrentData(){return this.currentDataManager.getCurrentData()}dispatch(e){this.currentDataManager.dispatch(e)}get view(){return this.getCurrentData().viewApi}batchRendering(e){e()}updateSize(){this.trigger("_resize",!0)}setOption(e,t){this.dispatch({type:"SET_OPTION",optionName:e,rawOptionValue:t})}getOption(e){return this.currentDataManager.currentCalendarOptionsInput[e]}getAvailableLocaleCodes(){return Object.keys(this.getCurrentData().availableRawLocales)}on(e,t){let{currentDataManager:n}=this;n.currentCalendarOptionsRefiners[e]?n.emitter.on(e,t):console.warn(`Unknown listener name '${e}'`)}off(e,t){this.currentDataManager.emitter.off(e,t)}trigger(e,...t){this.currentDataManager.emitter.trigger(e,...t)}changeView(e,t){this.batchRendering(()=>{if(this.unselect(),t)if(t.start&&t.end)this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e}),this.dispatch({type:"SET_OPTION",optionName:"visibleRange",rawOptionValue:t});else{let{dateEnv:n}=this.getCurrentData();this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e,dateMarker:n.createMarker(t)})}else this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e})})}zoomTo(e,t){let n;t=t||"day",n=this.getCurrentData().viewSpecs[t]||this.getUnitViewSpec(t),this.unselect(),n?this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:n.type,dateMarker:e}):this.dispatch({type:"CHANGE_DATE",dateMarker:e})}getUnitViewSpec(e){let t,n,{viewSpecs:r,toolbarConfig:i}=this.getCurrentData(),s=[].concat(i.header?i.header.viewsWithButtons:[],i.footer?i.footer.viewsWithButtons:[]);for(let e in r)s.push(e);for(t=0;t<s.length;t+=1)if(n=r[s[t]],n&&n.singleUnit===e)return n;return null}prev(){this.unselect(),this.dispatch({type:"PREV"})}next(){this.unselect(),this.dispatch({type:"NEXT"})}prevYear(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.dateEnv.addYears(e.currentDate,-1)})}nextYear(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.dateEnv.addYears(e.currentDate,1)})}today(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:fr(e.calendarOptions.now,e.dateEnv)})}gotoDate(e){let t=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:t.dateEnv.createMarker(e)})}incrementDate(e){let t=this.getCurrentData(),n=ft(e);n&&(this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:t.dateEnv.add(t.currentDate,n)}))}getDate(){let e=this.getCurrentData();return e.dateEnv.toDate(e.currentDate)}formatDate(e,t){let{dateEnv:n}=this.getCurrentData();return n.format(n.createMarker(e),an(t))}formatRange(e,t,n){let{dateEnv:r}=this.getCurrentData();return r.formatRange(r.createMarker(e),r.createMarker(t),an(n),n)}formatIso(e,t){let{dateEnv:n}=this.getCurrentData();return n.formatIso(n.createMarker(e),{omitTime:t})}select(e,t){let n;n=null==t?null!=e.start?e:{start:e,end:null}:{start:e,end:t};let r=this.getCurrentData(),i=Si(n,r.dateEnv,ft({days:1}));i&&(this.dispatch({type:"SELECT_DATES",selection:i}),Yr(i,null,r))}unselect(e){let t=this.getCurrentData();t.dateSelection&&(this.dispatch({type:"UNSELECT_DATES"}),function(e,t){t.emitter.trigger("unselect",{jsEvent:e?e.origEvent:null,view:t.viewApi||t.calendarApi.view})}(e,t))}addEvent(e,t){if(e instanceof ti){let t=e._def,n=e._instance;return this.getCurrentData().eventStore.defs[t.defId]||(this.dispatch({type:"ADD_EVENTS",eventStore:Rr({def:t,instance:n})}),this.triggerEventAdd(e)),e}let n,r=this.getCurrentData();if(t instanceof ei)n=t.internalEventSource;else if("boolean"==typeof t)t&&([n]=wn(r.eventSources));else if(null!=t){let e=this.getEventSourceById(t);if(!e)return console.warn(`Could not find an event source with ID "${t}"`),null;n=e.internalEventSource}let i=Sr(e,n,r,!1);if(i){let e=new ti(r,i.def,i.def.recurringDef?null:i.instance);return this.dispatch({type:"ADD_EVENTS",eventStore:Rr(i)}),this.triggerEventAdd(e),e}return null}triggerEventAdd(e){let{emitter:t}=this.getCurrentData();t.trigger("eventAdd",{event:e,relatedEvents:[],revert:()=>{this.dispatch({type:"REMOVE_EVENTS",eventStore:ni(e)})}})}getEventById(e){let t=this.getCurrentData(),{defs:n,instances:r}=t.eventStore;e=String(e);for(let i in n){let s=n[i];if(s.publicId===e){if(s.recurringDef)return new ti(t,s,null);for(let e in r){let n=r[e];if(n.defId===s.defId)return new ti(t,s,n)}}}return null}getEvents(){let e=this.getCurrentData();return ri(e.eventStore,e)}removeAllEvents(){this.dispatch({type:"REMOVE_ALL_EVENTS"})}getEventSources(){let e=this.getCurrentData(),t=e.eventSources,n=[];for(let r in t)n.push(new ei(e,t[r]));return n}getEventSourceById(e){let t=this.getCurrentData(),n=t.eventSources;e=String(e);for(let r in n)if(n[r].publicId===e)return new ei(t,n[r]);return null}addEventSource(e){let t=this.getCurrentData();if(e instanceof ei)return t.eventSources[e.internalEventSource.sourceId]||this.dispatch({type:"ADD_EVENT_SOURCES",sources:[e.internalEventSource]}),e;let n=jr(e,t);return n?(this.dispatch({type:"ADD_EVENT_SOURCES",sources:[n]}),new ei(t,n)):null}removeAllEventSources(){this.dispatch({type:"REMOVE_ALL_EVENT_SOURCES"})}refetchEvents(){this.dispatch({type:"FETCH_EVENT_SOURCES",isRefetch:!0})}scrollToTime(e){let t=ft(e);t&&this.trigger("_scrollRequest",{time:t})}}function Pi(e,t){return e.left>=t.left&&e.left<t.right&&e.top>=t.top&&e.top<t.bottom}function Hi(e,t){let n={left:Math.max(e.left,t.left),right:Math.min(e.right,t.right),top:Math.max(e.top,t.top),bottom:Math.min(e.bottom,t.bottom)};return n.left<n.right&&n.top<n.bottom&&n}function Bi(e,t){return{left:Math.min(Math.max(e.left,t.left),t.right),top:Math.min(Math.max(e.top,t.top),t.bottom)}}function ji(e){return{left:(e.left+e.right)/2,top:(e.top+e.bottom)/2}}function zi(e,t){return{left:e.left-t.left,top:e.top-t.top}}const Ui={defs:{},instances:{}};class Wi{constructor(){this.getKeysForEventDefs=Gt(this._getKeysForEventDefs),this.splitDateSelection=Gt(this._splitDateSpan),this.splitEventStore=Gt(this._splitEventStore),this.splitIndividualUi=Gt(this._splitIndividualUi),this.splitEventDrag=Gt(this._splitInteraction),this.splitEventResize=Gt(this._splitInteraction),this.eventUiBuilders={}}splitProps(e){let t=this.getKeyInfo(e),n=this.getKeysForEventDefs(e.eventStore),r=this.splitDateSelection(e.dateSelection),i=this.splitIndividualUi(e.eventUiBases,n),s=this.splitEventStore(e.eventStore,n),o=this.splitEventDrag(e.eventDrag),a=this.splitEventResize(e.eventResize),l={};this.eventUiBuilders=An(t,(e,t)=>this.eventUiBuilders[t]||Gt(Li));for(let n in t){let c=t[n],d=s[n]||Ui,u=this.eventUiBuilders[n];l[n]={businessHours:c.businessHours||e.businessHours,dateSelection:r[n]||null,eventStore:d,eventUiBases:u(e.eventUiBases[""],c.ui,i[n]),eventSelection:d.instances[e.eventSelection]?e.eventSelection:"",eventDrag:o[n]||null,eventResize:a[n]||null}}return l}_splitDateSpan(e){let t={};if(e){let n=this.getKeysForDateSpan(e);for(let r of n)t[r]=e}return t}_getKeysForEventDefs(e){return An(e.defs,e=>this.getKeysForEventDef(e))}_splitEventStore(e,t){let{defs:n,instances:r}=e,i={};for(let e in n)for(let r of t[e])i[r]||(i[r]={defs:{},instances:{}}),i[r].defs[e]=n[e];for(let e in r){let n=r[e];for(let r of t[n.defId])i[r]&&(i[r].instances[e]=n)}return i}_splitIndividualUi(e,t){let n={};for(let r in e)if(r)for(let i of t[r])n[i]||(n[i]={}),n[i][r]=e[r];return n}_splitInteraction(e){let t={};if(e){let n=this._splitEventStore(e.affectedEvents,this._getKeysForEventDefs(e.affectedEvents)),r=this._getKeysForEventDefs(e.mutatedEvents),i=this._splitEventStore(e.mutatedEvents,r),s=r=>{t[r]||(t[r]={affectedEvents:n[r]||Ui,mutatedEvents:i[r]||Ui,isEvent:e.isEvent})};for(let e in n)s(e);for(let e in i)s(e)}return t}}function Li(e,t,n){let r=[];e&&r.push(e),t&&r.push(t);let i={"":Pr(r)};return n&&Object.assign(i,n),i}function Fi(e,t,n,r){return{dow:e.getUTCDay(),isDisabled:Boolean(r&&!lr(r.activeRange,e)),isOther:Boolean(r&&!lr(r.currentRange,e)),isToday:Boolean(t&&lr(t,e)),isPast:Boolean(n?e<n:!!t&&e<t.start),isFuture:Boolean(n?e>n:!!t&&e>=t.end)}}function Vi(e,t){let n=["fc-day","fc-day-"+At[e.dow]];return e.isDisabled?n.push("fc-day-disabled"):(e.isToday&&(n.push("fc-day-today"),n.push(t.getClass("today"))),e.isPast&&n.push("fc-day-past"),e.isFuture&&n.push("fc-day-future"),e.isOther&&n.push("fc-day-other")),n}const Gi=an({year:"numeric",month:"long",day:"numeric"}),Qi=an({week:"long"});function qi(e,t,n="day",r=!0){const{dateEnv:i,options:s,calendarApi:o}=e;let a=i.format(t,"week"===n?Qi:Gi);if(s.navLinks){let e=i.toDate(t);const l=e=>{let r="day"===n?s.navLinkDayClick:"week"===n?s.navLinkWeekClick:null;"function"==typeof r?r.call(o,i.toDate(t),e):("string"==typeof r&&(n=r),o.zoomTo(t,n))};return Object.assign({title:at(s.navLinkHint,[a,e],a),"data-navlink":""},r?Qe(l):{onClick:l})}return{"aria-label":a}}let Yi,Zi=null;function Xi(){return null===Zi&&(Zi=function(){let e=document.createElement("div");Be(e,{position:"absolute",top:-1e3,left:0,border:0,padding:0,overflow:"scroll",direction:"rtl"}),e.innerHTML="<div></div>",document.body.appendChild(e);let t=e.firstChild.getBoundingClientRect().left>e.getBoundingClientRect().left;return Ie(e),t}()),Zi}function $i(){return Yi||(Yi=function(){let e=document.createElement("div");e.style.overflow="scroll",e.style.position="absolute",e.style.top="-9999px",e.style.left="-9999px",document.body.appendChild(e);let t=Ji(e);return document.body.removeChild(e),t}()),Yi}function Ji(e){return{x:e.offsetHeight-e.clientHeight,y:e.offsetWidth-e.clientWidth}}function Ki(e,t=!1){let n=window.getComputedStyle(e),r=parseInt(n.borderLeftWidth,10)||0,i=parseInt(n.borderRightWidth,10)||0,s=parseInt(n.borderTopWidth,10)||0,o=parseInt(n.borderBottomWidth,10)||0,a=Ji(e),l=a.y-r-i,c={borderLeft:r,borderRight:i,borderTop:s,borderBottom:o,scrollbarBottom:a.x-s-o,scrollbarLeft:0,scrollbarRight:0};return Xi()&&"rtl"===n.direction?c.scrollbarLeft=l:c.scrollbarRight=l,t&&(c.paddingLeft=parseInt(n.paddingLeft,10)||0,c.paddingRight=parseInt(n.paddingRight,10)||0,c.paddingTop=parseInt(n.paddingTop,10)||0,c.paddingBottom=parseInt(n.paddingBottom,10)||0),c}function es(e,t=!1,n){let r=n?e.getBoundingClientRect():ts(e),i=Ki(e,t),s={left:r.left+i.borderLeft+i.scrollbarLeft,right:r.right-i.borderRight-i.scrollbarRight,top:r.top+i.borderTop,bottom:r.bottom-i.borderBottom-i.scrollbarBottom};return t&&(s.left+=i.paddingLeft,s.right-=i.paddingRight,s.top+=i.paddingTop,s.bottom-=i.paddingBottom),s}function ts(e){let t=e.getBoundingClientRect();return{left:t.left+window.pageXOffset,top:t.top+window.pageYOffset,right:t.right+window.pageXOffset,bottom:t.bottom+window.pageYOffset}}function ns(e){let t=[];for(;e instanceof HTMLElement;){let n=window.getComputedStyle(e);
778if("fixed"===n.position)break;/(auto|scroll)/.test(n.overflow+n.overflowY+n.overflowX)&&t.push(e),e=e.parentNode}return t}class rs{constructor(e,t,n,r){this.els=t;let i=this.originClientRect=e.getBoundingClientRect();n&&this.buildElHorizontals(i.left),r&&this.buildElVerticals(i.top)}buildElHorizontals(e){let t=[],n=[];for(let r of this.els){let i=r.getBoundingClientRect();t.push(i.left-e),n.push(i.right-e)}this.lefts=t,this.rights=n}buildElVerticals(e){let t=[],n=[];for(let r of this.els){let i=r.getBoundingClientRect();t.push(i.top-e),n.push(i.bottom-e)}this.tops=t,this.bottoms=n}leftToIndex(e){let t,{lefts:n,rights:r}=this,i=n.length;for(t=0;t<i;t+=1)if(e>=n[t]&&e<r[t])return t}topToIndex(e){let t,{tops:n,bottoms:r}=this,i=n.length;for(t=0;t<i;t+=1)if(e>=n[t]&&e<r[t])return t}getWidth(e){return this.rights[e]-this.lefts[e]}getHeight(e){return this.bottoms[e]-this.tops[e]}similarTo(e){return is(this.tops||[],e.tops||[])&&is(this.bottoms||[],e.bottoms||[])&&is(this.lefts||[],e.lefts||[])&&is(this.rights||[],e.rights||[])}}function is(e,t){const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(Math.round(e[r])!==Math.round(t[r]))return!1;return!0}class ss{getMaxScrollTop(){return this.getScrollHeight()-this.getClientHeight()}getMaxScrollLeft(){return this.getScrollWidth()-this.getClientWidth()}canScrollVertically(){return this.getMaxScrollTop()>0}canScrollHorizontally(){return this.getMaxScrollLeft()>0}canScrollUp(){return this.getScrollTop()>0}canScrollDown(){return this.getScrollTop()<this.getMaxScrollTop()}canScrollLeft(){return this.getScrollLeft()>0}canScrollRight(){return this.getScrollLeft()<this.getMaxScrollLeft()}}class os extends ss{constructor(e){super(),this.el=e}getScrollTop(){return this.el.scrollTop}getScrollLeft(){return this.el.scrollLeft}setScrollTop(e){this.el.scrollTop=e}setScrollLeft(e){this.el.scrollLeft=e}getScrollWidth(){return this.el.scrollWidth}getScrollHeight(){return this.el.scrollHeight}getClientHeight(){return this.el.clientHeight}getClientWidth(){return this.el.clientWidth}}class as extends ss{getScrollTop(){return window.pageYOffset}getScrollLeft(){return window.pageXOffset}setScrollTop(e){window.scroll(window.pageXOffset,e)}setScrollLeft(e){window.scroll(e,window.pageYOffset)}getScrollWidth(){return document.documentElement.scrollWidth}getScrollHeight(){return document.documentElement.scrollHeight}getClientHeight(){return document.documentElement.clientHeight}getClientWidth(){return document.documentElement.clientWidth}}class ls extends Gn{constructor(){super(...arguments),this.uid=Ze()}prepareHits(){}queryHit(e,t,n,r){return null}isValidSegDownEl(e){return!this.props.eventDrag&&!this.props.eventResize&&!Oe(e,".fc-event-mirror")}isValidDateDownEl(e){return!(Oe(e,".fc-event:not(.fc-bg-event)")||Oe(e,".fc-more-link")||Oe(e,"a[data-navlink]")||Oe(e,".fc-popover"))}}class cs{constructor(e=(e=>e.thickness)){this.getEntryThickness=e,this.strictOrder=!1,this.allowReslicing=!1,this.maxCoord=-1,this.maxStackCnt=-1,this.levelCoords=[],this.entriesByLevel=[],this.stackCnts={}}addSegs(e){let t=[];for(let n of e)this.insertEntry(n,t);return t}insertEntry(e,t){let n=this.findInsertion(e);return this.isInsertionValid(n,e)?(this.insertEntryAt(e,n),1):this.handleInvalidInsertion(n,e,t)}isInsertionValid(e,t){return(-1===this.maxCoord||e.levelCoord+this.getEntryThickness(t)<=this.maxCoord)&&(-1===this.maxStackCnt||e.stackCnt<this.maxStackCnt)}handleInvalidInsertion(e,t,n){return this.allowReslicing&&e.touchingEntry?this.splitEntry(t,e.touchingEntry,n):(n.push(t),0)}splitEntry(e,t,n){let r=0,i=[],s=e.span,o=t.span;return s.start<o.start&&(r+=this.insertEntry({index:e.index,thickness:e.thickness,span:{start:s.start,end:o.start}},i)),s.end>o.end&&(r+=this.insertEntry({index:e.index,thickness:e.thickness,span:{start:o.end,end:s.end}},i)),r?(n.push({index:e.index,thickness:e.thickness,span:fs(o,s)},...i),r):(n.push(e),0)}insertEntryAt(e,t){let{entriesByLevel:n,levelCoords:r}=this;-1===t.lateral?(gs(r,t.level,t.levelCoord),gs(n,t.level,[e])):gs(n[t.level],t.lateral,e),this.stackCnts[us(e)]=t.stackCnt}findInsertion(e){let{levelCoords:t,entriesByLevel:n,strictOrder:r,stackCnts:i}=this,s=t.length,o=0,a=-1,l=-1,c=null,d=0;for(let u=0;u<s;u+=1){let s=t[u];
vendor: 17,102 bytes, line 778
778if(!r&&s>=o+this.getEntryThickness(e))break;let h,f=n[u],g=ps(f,e.span.start,ds),p=g[0]+g[1];for(;(h=f[p])&&h.span.start<e.span.end;){let e=s+this.getEntryThickness(h);e>o&&(o=e,c=h,a=u,l=p),e===o&&(d=Math.max(d,i[us(h)]+1)),p+=1}}let u=0;if(c)for(u=a+1;u<s&&t[u]<o;)u+=1;let h=-1;return u<s&&t[u]===o&&(h=ps(n[u],e.span.end,ds)[0]),{touchingLevel:a,touchingLateral:l,touchingEntry:c,stackCnt:d,levelCoord:o,level:u,lateral:h}}toRects(){let{entriesByLevel:e,levelCoords:t}=this,n=e.length,r=[];for(let i=0;i<n;i+=1){let n=e[i],s=t[i];for(let e of n)r.push(Object.assign(Object.assign({},e),{thickness:this.getEntryThickness(e),levelCoord:s}))}return r}}function ds(e){return e.span.end}function us(e){return e.index+":"+e.span.start}function hs(e){let t=[];for(let i of e){let e=[],s={span:i.span,entries:[i]};for(let i of t)fs(i.span,s.span)?s={entries:i.entries.concat(s.entries),span:(n=i.span,r=s.span,{start:Math.min(n.start,r.start),end:Math.max(n.end,r.end)})}:e.push(i);e.push(s),t=e}var n,r;return t}function fs(e,t){let n=Math.max(e.start,t.start),r=Math.min(e.end,t.end);return n<r?{start:n,end:r}:null}function gs(e,t,n){e.splice(t,0,n)}function ps(e,t,n){let r=0,i=e.length;if(!i||t<n(e[r]))return[0,0];if(t>n(e[i-1]))return[i,0];for(;r<i;){let s=Math.floor(r+(i-r)/2),o=n(e[s]);if(t<o)i=s;else{if(!(t>o))return[s,1];r=s+1}}return[r,0]}class ms{constructor(e,t){this.emitter=new Gr}destroy(){}setMirrorIsVisible(e){}setMirrorNeedsRevert(e){}setAutoScrollEnabled(e){}}const vs={},ys={startTime:ft,duration:ft,create:Boolean,sourceId:String};function bs(e){let{refined:t,extra:n}=vn(e,ys);return{startTime:t.startTime||null,duration:t.duration||null,create:null==t.create||t.create,sourceId:t.sourceId,leftoverProps:n}}function Es(e,t){return an(!e||t>10?{weekday:"short"}:t>1?{weekday:"short",month:"numeric",day:"numeric",omitCommas:!0}:{weekday:"long"})}const Ss="fc-col-header-cell";function As(e){return e.text}class Ds extends Gn{render(){let{dateEnv:e,options:t,theme:n,viewApi:r}=this.context,{props:i}=this,{date:s,dateProfile:o}=i,a=Fi(s,i.todayRange,null,o),l=[Ss].concat(Vi(a,n)),c=e.format(s,i.dayHeaderFormat),d=!a.isDisabled&&i.colCnt>1?qi(this.context,s):{},u=Object.assign(Object.assign(Object.assign({date:e.toDate(s),view:r},i.extraRenderProps),{text:c}),a);return p(Jn,{elTag:"th",elClasses:l,elAttrs:Object.assign({role:"columnheader",colSpan:i.colSpan,"data-date":a.isDisabled?void 0:Wt(s)},i.extraDataAttrs),renderProps:u,generatorName:"dayHeaderContent",customGenerator:t.dayHeaderContent,defaultGenerator:As,classNameGenerator:t.dayHeaderClassNames,didMount:t.dayHeaderDidMount,willUnmount:t.dayHeaderWillUnmount},e=>p("div",{className:"fc-scrollgrid-sync-inner"},!a.isDisabled&&p(e,{elTag:"a",elAttrs:d,elClasses:["fc-col-header-cell-cushion",i.isSticky&&"fc-sticky"]})))}}const ws=an({weekday:"long"});class Cs extends Gn{render(){let{props:e}=this,{dateEnv:t,theme:n,viewApi:r,options:i}=this.context,s=wt(new Date(2592e5),e.dow),o={dow:e.dow,isDisabled:!1,isFuture:!1,isPast:!1,isToday:!1,isOther:!1},a=t.format(s,e.dayHeaderFormat),l=Object.assign(Object.assign(Object.assign(Object.assign({date:s},o),{view:r}),e.extraRenderProps),{text:a});return p(Jn,{elTag:"th",elClasses:[Ss,...Vi(o,n),...e.extraClassNames||[]],elAttrs:Object.assign({role:"columnheader",colSpan:e.colSpan},e.extraDataAttrs),renderProps:l,generatorName:"dayHeaderContent",customGenerator:i.dayHeaderContent,defaultGenerator:As,classNameGenerator:i.dayHeaderClassNames,didMount:i.dayHeaderDidMount,willUnmount:i.dayHeaderWillUnmount},n=>p("div",{className:"fc-scrollgrid-sync-inner"},p(n,{elTag:"a",elClasses:["fc-col-header-cell-cushion",e.isSticky&&"fc-sticky"],elAttrs:{"aria-label":t.format(s,ws)}})))}}class Rs extends D{constructor(e,t){super(e,t),this.initialNowDate=fr(t.options.now,t.dateEnv),this.initialNowQueriedMs=(new Date).valueOf(),this.state=this.computeTiming().currentState}render(){let{props:e,state:t}=this;return e.children(t.nowDate,t.todayRange)}componentDidMount(){this.setTimeout()}componentDidUpdate(e){e.unit!==this.props.unit&&(this.clearTimeout(),this.setTimeout())}componentWillUnmount(){this.clearTimeout()}computeTiming(){let{props:e,context:t}=this,n=Ct(this.initialNowDate,(new Date).valueOf()-this.initialNowQueriedMs),r=t.dateEnv.startOf(n,e.unit),i=t.dateEnv.add(r,ft(1,e.unit)),s=i.valueOf()-n.valueOf();return s=Math.min(864e5,s),{currentState:{nowDate:r,todayRange:xs(r)},nextState:{nowDate:i,todayRange:xs(i)},waitMs:s}}setTimeout(){let{nextState:e,waitMs:t}=this.computeTiming();this.timeoutId=setTimeout(()=>{this.setState(e,()=>{this.setTimeout()})},t)}clearTimeout(){this.timeoutId&&clearTimeout(this.timeoutId)}}function xs(e){let t=Mt(e);return{start:t,end:wt(t,1)}}Rs.contextType=Ln;class _s extends Gn{constructor(){super(...arguments),this.createDayHeaderFormatter=Gt(Ts)}render(){let{context:e}=this,{dates:t,dateProfile:n,datesRepDistinctDays:r,renderIntro:i}=this.props,s=this.createDayHeaderFormatter(e.options.dayHeaderFormat,r,t.length);return p(Rs,{unit:"day"},(e,o)=>p("tr",{role:"row"},i&&i("day"),t.map(e=>r?p(Ds,{key:e.toISOString(),date:e,dateProfile:n,todayRange:o,colCnt:t.length,dayHeaderFormat:s}):p(Cs,{key:e.getUTCDay(),dow:e.getUTCDay(),dayHeaderFormat:s}))))}}function Ts(e,t,n){return e||Es(t,n)}class ks{constructor(e,t){let n=e.start,{end:r}=e,i=[],s=[],o=-1;for(;n<r;)t.isHiddenDay(n)?i.push(o+.5):(o+=1,i.push(o),s.push(n)),n=wt(n,1);this.dates=s,this.indices=i,this.cnt=s.length}sliceRange(e){let t=this.getDateDayIndex(e.start),n=this.getDateDayIndex(wt(e.end,-1)),r=Math.max(0,t),i=Math.min(this.cnt-1,n);return r=Math.ceil(r),i=Math.floor(i),r<=i?{firstIndex:r,lastIndex:i,isStart:t===r,isEnd:n===i}:null}getDateDayIndex(e){let{indices:t}=this,n=Math.floor(xt(this.dates[0],e));return n<0?t[0]-1:n>=t.length?t[t.length-1]+1:t[n]}}class Ms{constructor(e,t){let n,r,i,{dates:s}=e;if(t){for(r=s[0].getUTCDay(),n=1;n<s.length&&s[n].getUTCDay()!==r;n+=1);i=Math.ceil(s.length/n)}else i=1,n=s.length;this.rowCnt=i,this.colCnt=n,this.daySeries=e,this.cells=this.buildCells(),this.headerDates=this.buildHeaderDates()}buildCells(){let e=[];for(let t=0;t<this.rowCnt;t+=1){let n=[];for(let e=0;e<this.colCnt;e+=1)n.push(this.buildCell(t,e));e.push(n)}return e}buildCell(e,t){let n=this.daySeries.dates[e*this.colCnt+t];return{key:n.toISOString(),date:n}}buildHeaderDates(){let e=[];for(let t=0;t<this.colCnt;t+=1)e.push(this.cells[0][t].date);return e}sliceRange(e){let{colCnt:t}=this,n=this.daySeries.sliceRange(e),r=[];if(n){let{firstIndex:e,lastIndex:i}=n,s=e;for(;s<=i;){let o=Math.floor(s/t),a=Math.min((o+1)*t,i+1);r.push({row:o,firstCol:s%t,lastCol:(a-1)%t,isStart:n.isStart&&s===e,isEnd:n.isEnd&&a-1===i}),s=a}}return r}}class Is{constructor(){this.sliceBusinessHours=Gt(this._sliceBusinessHours),this.sliceDateSelection=Gt(this._sliceDateSpan),this.sliceEventStore=Gt(this._sliceEventStore),this.sliceEventDrag=Gt(this._sliceInteraction),this.sliceEventResize=Gt(this._sliceInteraction),this.forceDayIfListItem=!1}sliceProps(e,t,n,r,...i){let{eventUiBases:s}=e,o=this.sliceEventStore(e.eventStore,s,t,n,...i);return{dateSelectionSegs:this.sliceDateSelection(e.dateSelection,t,n,s,r,...i),businessHourSegs:this.sliceBusinessHours(e.businessHours,t,n,r,...i),fgEventSegs:o.fg,bgEventSegs:o.bg,eventDrag:this.sliceEventDrag(e.eventDrag,s,t,n,...i),eventResize:this.sliceEventResize(e.eventResize,s,t,n,...i),eventSelection:e.eventSelection}}sliceNowDate(e,t,n,r,...i){return this._sliceDateSpan({range:{start:e,end:Ct(e,1)},allDay:!1},t,n,{},r,...i)}_sliceBusinessHours(e,t,n,r,...i){return e?this._sliceEventStore(mr(e,Os(t,Boolean(n)),r),{},t,n,...i).bg:[]}_sliceEventStore(e,t,n,r,...i){if(e){let s=ii(e,t,Os(n,Boolean(r)),r);return{bg:this.sliceEventRanges(s.bg,i),fg:this.sliceEventRanges(s.fg,i)}}return{bg:[],fg:[]}}_sliceInteraction(e,t,n,r,...i){if(!e)return null;let s=ii(e.mutatedEvents,t,Os(n,Boolean(r)),r);return{segs:this.sliceEventRanges(s.fg,i),affectedInstances:e.affectedEvents.instances,isEvent:e.isEvent}}_sliceDateSpan(e,t,n,r,i,...s){if(!e)return[];let o=Os(t,Boolean(n)),a=ir(e.range,o);if(a){let t=function(e,t,n){let r=Ar({editable:!1},n),i=wr(r.refined,r.extra,"",e.allDay,!0,n);return{def:i,ui:ci(i,t),instance:pr(i.defId,e.range),range:e.range,isStart:!0,isEnd:!0}}(e=Object.assign(Object.assign({},e),{range:a}),r,i),n=this.sliceRange(e.range,...s);for(let e of n)e.eventRange=t;return n}return[]}sliceEventRanges(e,t){let n=[];for(let r of e)n.push(...this.sliceEventRange(r,t));return n}sliceEventRange(e,t){let n=e.range;this.forceDayIfListItem&&"list-item"===e.ui.display&&(n={start:n.start,end:wt(n.start,1)});let r=this.sliceRange(n,...t);for(let t of r)t.eventRange=e,t.isStart=e.isStart&&t.isStart,t.isEnd=e.isEnd&&t.isEnd;return r}}function Os(e,t){let n=e.activeRange;return t?n:{start:Ct(n.start,e.slotMinTime.milliseconds),end:Ct(n.end,e.slotMaxTime.milliseconds-864e5)}}function Ns(e,t,n){let{instances:r}=e.mutatedEvents;for(let e in r)if(!ar(t.validRange,r[e].range))return!1;return Hs({eventDrag:e},n)}function Ps(e,t,n){return!!ar(t.validRange,e.range)&&Hs({dateSelection:e},n)}function Hs(e,t){let n=t.getCurrentData(),r=Object.assign({businessHours:n.businessHours,dateSelection:"",eventStore:n.eventStore,eventUiBases:n.eventUiBases,eventSelection:"",eventDrag:null,eventResize:null},e);return(t.pluginHooks.isPropsValid||Bs)(r,t)}function Bs(e,t,n={},r){return!(e.eventDrag&&!function(e,t,n,r){let i=t.getCurrentData(),s=e.eventDrag,o=s.mutatedEvents,a=o.defs,l=o.instances,c=li(a,s.isEvent?e.eventUiBases:{"":i.selectionConfig});r&&(c=An(c,r));let d=(g=e.eventStore,p=s.affectedEvents.instances,{defs:g.defs,instances:Sn(g.instances,e=>!p[e.instanceId])}),u=d.defs,h=d.instances,f=li(u,e.eventUiBases);var g,p;for(let r in l){let o=l[r],g=o.range,p=c[o.defId],m=a[o.defId];if(!js(p.constraints,g,d,e.businessHours,t))return!1;let{eventOverlap:v}=t.options,y="function"==typeof v?v:null;for(let e in h){let n=h[e];if(or(g,n.range)){if(!1===f[n.defId].overlap&&s.isEvent)return!1;if(!1===p.overlap)return!1;if(y&&!y(new ti(t,u[n.defId],n),new ti(t,m,o)))return!1}}let b=i.eventStore;for(let e of p.allows){let i,s=Object.assign(Object.assign({},n),{range:o.range,allDay:m.allDay}),a=b.defs[m.defId],l=b.instances[r];if(i=a?new ti(t,a,l):new ti(t,m),!e(Zr(s,t),i))return!1}}return!0}(e,t,n,r))&&!(e.dateSelection&&!function(e,t,n,r){let i=e.eventStore,s=i.defs,o=i.instances,a=e.dateSelection,l=a.range,{selectionConfig:c}=t.getCurrentData();r&&(c=r(c));if(!js(c.constraints,l,i,e.businessHours,t))return!1;let{selectOverlap:d}=t.options,u="function"==typeof d?d:null;for(let e in o){let n=o[e];if(or(l,n.range)){if(!1===c.overlap)return!1;if(u&&!u(new ti(t,s[n.defId],n),null))return!1}}for(let e of c.allows){let r=Object.assign(Object.assign({},n),a);if(!e(Zr(r,t),null))return!1}return!0}(e,t,n,r))}function js(e,t,n,r,i){for(let s of e)if(!Ws(zs(s,t,n,r,i),t))return!1;return!0}function zs(e,t,n,r,i){return"businessHours"===e?Us(mr(r,t,i)):"string"==typeof e?Us(kr(n,t=>t.groupId===e)):"object"==typeof e&&e?Us(mr(e,t,i)):[]}function Us(e){let{instances:t}=e,n=[];for(let e in t)n.push(t[e].range);return n}function Ws(e,t){for(let n of e)if(ar(n,t))return!0;return!1}const Ls=/^(visible|hidden)$/;class Fs extends Gn{constructor(){super(...arguments),this.handleEl=e=>{this.el=e,Qn(this.props.elRef,e)}}render(){let{props:e}=this,{liquid:t,liquidIsAbsolute:n}=e,r=t&&n,i=["fc-scroller"];return t&&(n?i.push("fc-scroller-liquid-absolute"):i.push("fc-scroller-liquid")),p("div",{ref:this.handleEl,className:i.join(" "),style:{overflowX:e.overflowX,overflowY:e.overflowY,left:r&&-(e.overcomeLeft||0)||"",right:r&&-(e.overcomeRight||0)||"",bottom:r&&-(e.overcomeBottom||0)||"",marginLeft:!r&&-(e.overcomeLeft||0)||"",marginRight:!r&&-(e.overcomeRight||0)||"",marginBottom:!r&&-(e.overcomeBottom||0)||"",maxHeight:e.maxHeight||""}},e.children)}needsXScrolling(){if(Ls.test(this.props.overflowX))return!1;let{el:e}=this,t=this.el.getBoundingClientRect().width-this.getYScrollbarWidth(),{children:n}=e;for(let e=0;e<n.length;e+=1){if(n[e].getBoundingClientRect().width>t)return!0}return!1}needsYScrolling(){if(Ls.test(this.props.overflowY))return!1;let{el:e}=this,t=this.el.getBoundingClientRect().height-this.getXScrollbarWidth(),{children:n}=e;for(let e=0;e<n.length;e+=1){if(n[e].getBoundingClientRect().height>t)return!0}return!1}getXScrollbarWidth(){return Ls.test(this.props.overflowX)?0:this.el.offsetHeight-this.el.clientHeight}getYScrollbarWidth(){return Ls.test(this.props.overflowY)?0:this.el.offsetWidth-this.el.clientWidth}}class Vs{constructor(e){this.masterCallback=e,this.currentMap={},this.depths={},this.callbackMap={},this.handleValue=(e,t)=>{let{depths:n,currentMap:r}=this,i=!1,s=!1;null!==e?(i=t in r,r[t]=e,n[t]=(n[t]||0)+1,s=!0):(n[t]-=1,n[t]||(delete r[t],delete this.callbackMap[t],i=!0)),this.masterCallback&&(i&&this.masterCallback(null,String(t)),s&&this.masterCallback(e,String(t)))}}createRef(e){let t=this.callbackMap[e];return t||(t=this.callbackMap[e]=t=>{this.handleValue(t,String(e))}),t}collect(e,t,n){return kn(this.currentMap,e,t,n)}getAll(){return wn(this.currentMap)}}function Gs(e){let t=Pe(e,".fc-scrollgrid-shrink"),n=0;for(let e of t)n=Math.max(n,dt(e));return Math.ceil(n)}function Qs(e,t){return e.liquid&&t.liquid}function qs(e,t){return null!=t.maxHeight||Qs(e,t)}function Ys(e,t,n,r){let{expandRows:i}=n;return"function"==typeof t.content?t.content(n):p("table",{role:"presentation",className:[t.tableClassName,e.syncRowHeights?"fc-scrollgrid-sync-table":""].join(" "),style:{minWidth:n.tableMinWidth,width:n.clientWidth,height:i?n.clientHeight:""}},n.tableColGroupNode,p(r?"thead":"tbody",{role:"presentation"},"function"==typeof t.rowContent?t.rowContent(n):t.rowContent))}function Zs(e,t){return St(e,t,Cn)}function Xs(e,t){let n=[];for(let r of e){let e=r.span||1;for(let i=0;i<e;i+=1)n.push(p("col",{style:{width:"shrink"===r.width?$s(t):r.width||"",minWidth:r.minWidth||""}}))}return p("colgroup",{},...n)}function $s(e){return null==e?4:e}function Js(e){for(let t of e)if("shrink"===t.width)return!0;return!1}function Ks(e,t){let n=["fc-scrollgrid",t.theme.getClass("table")];return e&&n.push("fc-scrollgrid-liquid"),n}function eo(e,t){let n=["fc-scrollgrid-section","fc-scrollgrid-section-"+e.type,e.className];return t&&e.liquid&&null==e.maxHeight&&n.push("fc-scrollgrid-section-liquid"),e.isSticky&&n.push("fc-scrollgrid-section-sticky"),n}function to(e){return p("div",{className:"fc-scrollgrid-sticky-shim",style:{width:e.clientWidth,minWidth:e.tableMinWidth}})}function no(e){let{stickyHeaderDates:t}=e;return null!=t&&"auto"!==t||(t="auto"===e.height||"auto"===e.viewHeight),t}function ro(e){let{stickyFooterScrollbar:t}=e;return null!=t&&"auto"!==t||(t="auto"===e.height||"auto"===e.viewHeight),t}class io extends Gn{constructor(){super(...arguments),this.processCols=Gt(e=>e,Zs),this.renderMicroColGroup=Gt(Xs),this.scrollerRefs=new Vs,this.scrollerElRefs=new Vs(this._handleScrollerEl.bind(this)),this.state={shrinkWidth:null,forceYScrollbars:!1,scrollerClientWidths:{},scrollerClientHeights:{}},this.handleSizing=()=>{this.safeSetState(Object.assign({shrinkWidth:this.computeShrinkWidth()},this.computeScrollerDims()))}}render(){let{props:e,state:t,context:n}=this,r=e.sections||[],i=this.processCols(e.cols),s=this.renderMicroColGroup(i,t.shrinkWidth),o=Ks(e.liquid,n);e.collapsibleWidth&&o.push("fc-scrollgrid-collapsible");let a,l=r.length,c=0,d=[],u=[],h=[];for(;c<l&&"header"===(a=r[c]).type;)d.push(this.renderSection(a,s,!0)),c+=1;for(;c<l&&"body"===(a=r[c]).type;)u.push(this.renderSection(a,s,!1)),c+=1;for(;c<l&&"footer"===(a=r[c]).type;)h.push(this.renderSection(a,s,!0)),c+=1;let f=!Ti();const g={role:"rowgroup"};return p("table",{role:"grid",className:o.join(" "),style:{height:e.height}},Boolean(!f&&d.length)&&p("thead",g,...d),Boolean(!f&&u.length)&&p("tbody",g,...u),Boolean(!f&&h.length)&&p("tfoot",g,...h),f&&p("tbody",g,...d,...u,...h))}renderSection(e,t,n){return"outerContent"in e?p(y,{key:e.key},e.outerContent):p("tr",{key:e.key,role:"presentation",className:eo(e,this.props.liquid).join(" ")},this.renderChunkTd(e,t,e.chunk,n))}renderChunkTd(e,t,n,r){if("outerContent"in n)return n.outerContent;let{props:i}=this,{forceYScrollbars:s,scrollerClientWidths:o,scrollerClientHeights:a}=this.state,l=qs(i,e),c=Qs(i,e),d=i.liquid?s?"scroll":l?"auto":"hidden":"visible",u=e.key,h=Ys(e,n,{tableColGroupNode:t,tableMinWidth:"",clientWidth:i.collapsibleWidth||void 0===o[u]?null:o[u],clientHeight:void 0!==a[u]?a[u]:null,expandRows:e.expandRows,syncRowHeights:!1,rowSyncHeights:[],reportRowHeightChange:()=>{}},r);return p(r?"th":"td",{ref:n.elRef,role:"presentation"},p("div",{className:"fc-scroller-harness"+(c?" fc-scroller-harness-liquid":"")},p(Fs,{ref:this.scrollerRefs.createRef(u),elRef:this.scrollerElRefs.createRef(u),overflowY:d,overflowX:i.liquid?"hidden":"visible",maxHeight:e.maxHeight,liquid:c,liquidIsAbsolute:!0},h)))}_handleScrollerEl(e,t){let n=function(e,t){for(let n of e)if(n.key===t)return n;return null}(this.props.sections,t);n&&Qn(n.chunk.scrollerElRef,e)}
778componentDidMount(){this.handleSizing(),this.context.addResizeHandler(this.handleSizing)}componentDidUpdate(){this.handleSizing()}componentWillUnmount(){this.context.removeResizeHandler(this.handleSizing)}computeShrinkWidth(){return Js(this.props.cols)?Gs(this.scrollerElRefs.getAll()):0}computeScrollerDims(){let e=$i(),{scrollerRefs:t,scrollerElRefs:n}=this,r=!1,i={},s={};for(let e in t.currentMap){let n=t.currentMap[e];if(n&&n.needsYScrolling()){r=!0;break}}for(let t of this.props.sections){let o=t.key,a=n.currentMap[o];if(a){let t=a.parentNode;i[o]=Math.floor(t.getBoundingClientRect().width-(r?e.y:0)),s[o]=Math.floor(t.getBoundingClientRect().height)}}return{forceYScrollbars:r,scrollerClientWidths:i,scrollerClientHeights:s}}}io.addStateEquality({scrollerClientWidths:Cn,scrollerClientHeights:Cn});class so extends Gn{constructor(){super(...arguments),this.handleEl=e=>{this.el=e,e&&oi(e,this.props.seg)}}render(){const{props:e,context:t}=this,{options:n}=t,{seg:r}=e,{eventRange:i}=r,{ui:s}=i,o={event:new ti(t,i.def,i.instance),view:t.viewApi,timeText:e.timeText,textColor:s.textColor,backgroundColor:s.backgroundColor,borderColor:s.borderColor,isDraggable:!e.disableDragging&&hi(r,t),isStartResizable:!e.disableResizing&&fi(r,t),isEndResizable:!e.disableResizing&&gi(r),isMirror:Boolean(e.isDragging||e.isResizing||e.isDateSelecting),isStart:Boolean(r.isStart),isEnd:Boolean(r.isEnd),isPast:Boolean(e.isPast),isFuture:Boolean(e.isFuture),isToday:Boolean(e.isToday),isSelected:Boolean(e.isSelected),isDragging:Boolean(e.isDragging),isResizing:Boolean(e.isResizing)};return p(Jn,Object.assign({},e,{elRef:this.handleEl,elClasses:[...vi(o),...r.eventRange.ui.classNames,...e.elClasses||[]],renderProps:o,generatorName:"eventContent",customGenerator:n.eventContent,defaultGenerator:e.defaultGenerator,classNameGenerator:n.eventClassNames,didMount:n.eventDidMount,willUnmount:n.eventWillUnmount}))}componentDidUpdate(e){this.el&&this.props.seg!==e.seg&&oi(this.el,this.props.seg)}}class oo extends Gn{render(){let{props:e,context:t}=this,{options:n}=t,{seg:r}=e,{ui:i}=r.eventRange,s=pi(r,n.eventTimeFormat||e.defaultTimeFormat,t,e.defaultDisplayEventTime,e.defaultDisplayEventEnd);return p(so,Object.assign({},e,{elTag:"a",elStyle:{borderColor:i.borderColor,backgroundColor:i.backgroundColor},elAttrs:bi(r,t),defaultGenerator:ao,timeText:s}),(e,t)=>p(y,null,p(e,{elTag:"div",elClasses:["fc-event-main"],elStyle:{color:t.textColor}}),Boolean(t.isStartResizable)&&p("div",{className:"fc-event-resizer fc-event-resizer-start"}),Boolean(t.isEndResizable)&&p("div",{className:"fc-event-resizer fc-event-resizer-end"})))}}function ao(e){return p("div",{className:"fc-event-main-frame"},e.timeText&&p("div",{className:"fc-event-time"},e.timeText),p("div",{className:"fc-event-title-container"},p("div",{className:"fc-event-title fc-sticky"},e.event.title||p(y,null," "))))}const lo=e=>p(Ln.Consumer,null,t=>{let{options:n}=t,r={isAxis:e.isAxis,date:t.dateEnv.toDate(e.date),view:t.viewApi};return p(Jn,Object.assign({},e,{elTag:e.elTag||"div",renderProps:r,generatorName:"nowIndicatorContent",customGenerator:n.nowIndicatorContent,classNameGenerator:n.nowIndicatorClassNames,didMount:n.nowIndicatorDidMount,willUnmount:n.nowIndicatorWillUnmount}))}),co=an({day:"numeric"});class uo extends Gn{constructor(){super(...arguments),this.refineRenderProps=Qt(fo)}render(){let{props:e,context:t}=this,{options:n}=t,r=this.refineRenderProps({date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,isMonthStart:e.isMonthStart||!1,showDayNumber:e.showDayNumber,extraRenderProps:e.extraRenderProps,viewApi:t.viewApi,dateEnv:t.dateEnv,monthStartFormat:n.monthStartFormat});return p(Jn,Object.assign({},e,{elClasses:[...Vi(r,t.theme),...e.elClasses||[]],elAttrs:Object.assign(Object.assign({},e.elAttrs),r.isDisabled?{}:{"data-date":Wt(e.date)}),renderProps:r,generatorName:"dayCellContent",customGenerator:n.dayCellContent,defaultGenerator:e.defaultGenerator,classNameGenerator:r.isDisabled?void 0:n.dayCellClassNames,didMount:n.dayCellDidMount,willUnmount:n.dayCellWillUnmount}))}}function ho(e){return Boolean(e.dayCellContent||Yn("dayCellContent",e))}function fo(e){let{date:t,dateEnv:n,dateProfile:r,isMonthStart:i}=e,s=Fi(t,e.todayRange,null,r),o=e.showDayNumber?n.format(t,i?e.monthStartFormat:co):"";return Object.assign(Object.assign(Object.assign({date:n.toDate(t),view:e.viewApi},s),{isMonthStart:i,dayNumberText:o}),e.extraRenderProps)}class go extends Gn{render(){let{props:e}=this,{seg:t}=e;return p(so,{elTag:"div",elClasses:["fc-bg-event"],elStyle:{backgroundColor:t.eventRange.ui.backgroundColor},defaultGenerator:po,seg:t,timeText:"",isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,isPast:e.isPast,isFuture:e.isFuture,isToday:e.isToday,disableDragging:!0,disableResizing:!0})}}function po(e){let{title:t}=e.event;return t&&p("div",{className:"fc-event-title"},e.event.title)}function mo(e){return p("div",{className:"fc-"+e})}const vo=e=>p(Ln.Consumer,null,t=>{let{dateEnv:n,options:r}=t,{date:i}=e,s=r.weekNumberFormat||e.defaultFormat,o={num:n.computeWeekNumber(i),text:n.format(i,s),date:i};return p(Jn,Object.assign({},e,{renderProps:o,generatorName:"weekNumberContent",customGenerator:r.weekNumberContent,defaultGenerator:yo,classNameGenerator:r.weekNumberClassNames,didMount:r.weekNumberDidMount,willUnmount:r.weekNumberWillUnmount}))});function yo(e){return e.text}class bo extends Gn{constructor(){super(...arguments),this.state={t
vendor: 79,699 bytes, line 778
778itleId:We()},this.handleRootEl=e=>{this.rootEl=e,this.props.elRef&&Qn(this.props.elRef,e)},this.handleDocumentMouseDown=e=>{const t=ze(e);this.rootEl.contains(t)||this.handleCloseClick()},this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.handleCloseClick()},this.handleCloseClick=()=>{let{onClose:e}=this.props;e&&e()}}render(){let{theme:e,options:t}=this.context,{props:n,state:r}=this,i=["fc-popover",e.getClass("popover")].concat(n.extraClassNames||[]);return fe(p("div",Object.assign({},n.extraAttrs,{id:n.id,className:i.join(" "),"aria-labelledby":r.titleId,ref:this.handleRootEl}),p("div",{className:"fc-popover-header "+e.getClass("popoverHeader")},p("span",{className:"fc-popover-title",id:r.titleId},n.title),p("span",{className:"fc-popover-close "+e.getIconClass("close"),title:t.closeHint,onClick:this.handleCloseClick})),p("div",{className:"fc-popover-body "+e.getClass("popoverContent")},n.children)),n.parentEl)}componentDidMount(){document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleDocumentKeyDown),this.updateSize()}componentWillUnmount(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleDocumentKeyDown)}updateSize(){let{isRtl:e}=this.context,{alignmentEl:t,alignGridTop:n}=this.props,{rootEl:r}=this,i=function(e){let t=ns(e),n=e.getBoundingClientRect();for(let e of t){let t=Hi(n,e.getBoundingClientRect());if(!t)return null;n=t}return n}(t);if(i){let s=r.getBoundingClientRect(),o=n?Oe(t,".fc-scrollgrid").getBoundingClientRect().top:i.top,a=e?i.right-s.width:i.left;o=Math.max(o,10),a=Math.min(a,document.documentElement.clientWidth-10-s.width),a=Math.max(a,10);let l=r.offsetParent.getBoundingClientRect();Be(r,{top:o-l.top,left:a-l.left})}}}class Eo extends ls{constructor(){super(...arguments),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,useEventCenter:!1}):this.context.unregisterInteractiveComponent(this)}}render(){let{options:e,dateEnv:t}=this.context,{props:n}=this,{startDate:r,todayRange:i,dateProfile:s}=n,o=t.format(r,e.dayPopoverFormat);return p(uo,{elRef:this.handleRootEl,date:r,dateProfile:s,todayRange:i},(t,r,i)=>p(bo,{elRef:i.ref,id:n.id,title:o,extraClassNames:["fc-more-popover"].concat(i.className||[]),extraAttrs:i,parentEl:n.parentEl,alignmentEl:n.alignmentEl,alignGridTop:n.alignGridTop,onClose:n.onClose},ho(e)&&p(t,{elTag:"div",elClasses:["fc-more-popover-misc"]}),n.children))}queryHit(e,t,n,r){let{rootEl:i,props:s}=this;return e>=0&&e<n&&t>=0&&t<r?{dateProfile:s.dateProfile,dateSpan:Object.assign({allDay:!s.forceTimed,range:{start:s.startDate,end:s.endDate}},s.extraDateSpan),dayEl:i,rect:{left:0,top:0,right:n,bottom:r},layer:1}:null}}class So extends Gn{constructor(){super(...arguments),this.state={isPopoverOpen:!1,popoverId:We()},this.handleLinkEl=e=>{this.linkEl=e,this.props.elRef&&Qn(this.props.elRef,e)},this.handleClick=e=>{let{props:t,context:n}=this,{moreLinkClick:r}=n.options,i=Do(t).start;function s(e){let{def:t,instance:r,range:i}=e.eventRange;return{event:new ti(n,t,r),start:n.dateEnv.toDate(i.start),end:n.dateEnv.toDate(i.end),isStart:e.isStart,isEnd:e.isEnd}}"function"==typeof r&&(r=r({date:i,allDay:Boolean(t.allDayDate),allSegs:t.allSegs.map(s),hiddenSegs:t.hiddenSegs.map(s),jsEvent:e,view:n.viewApi})),r&&"popover"!==r?"string"==typeof r&&n.calendarApi.zoomTo(i,r):this.setState({isPopoverOpen:!0})},this.handlePopoverClose=()=>{this.setState({isPopoverOpen:!1})}}render(){let{props:e,state:t}=this;return p(Ln.Consumer,null,n=>{let{viewApi:r,options:i,calendarApi:s}=n,{moreLinkText:o}=i,{moreCnt:a}=e,l=Do(e),c="function"==typeof o?o.call(s,a):`+${a} ${o}`,d=at(i.moreLinkHint,[a],c),u={num:a,shortText:"+"+a,text:c,view:r};return p(y,null,Boolean(e.moreCnt)&&p(Jn,{elTag:e.elTag||"a",elRef:this.handleLinkEl,elClasses:[...e.elClasses||[],"fc-more-link"],elStyle:e.elStyle,elAttrs:Object.assign(Object.assign(Object.assign({},e.elAttrs),Qe(this.handleClick)),{title:d,"aria-expanded":t.isPopoverOpen,"aria-controls":t.isPopoverOpen?t.popoverId:""}),renderProps:u,generatorName:"moreLinkContent",customGenerator:i.moreLinkContent,defaultGenerator:e.defaultGenerator||Ao,classNameGenerator:i.moreLinkClassNames,didMount:i.moreLinkDidMount,willUnmount:i.moreLinkWillUnmount},e.children),t.isPopoverOpen&&p(Eo,{id:t.popoverId,startDate:l.start,endDate:l.end,dateProfile:e.dateProfile,todayRange:e.todayRange,extraDateSpan:e.extraDateSpan,parentEl:this.parentEl,alignmentEl:e.alignmentElRef?e.alignmentElRef.current:this.linkEl,alignGridTop:e.alignGridTop,forceTimed:e.forceTimed,onClose:this.handlePopoverClose},e.popoverContent()))})}componentDidMount(){this.updateParentEl()}componentDidUpdate(){this.updateParentEl()}updateParentEl(){this.linkEl&&(this.parentEl=Oe(this.linkEl,".fc-view-harness"))}}function Ao(e){return e.text}function Do(e){if(e.allDayDate)return{start:e.allDayDate,end:wt(e.allDayDate,1)};let{hiddenSegs:t}=e;return{start:wo(t),end:(n=t,n.reduce(Ro).eventRange.range.end)};var n}function wo(e){return e.reduce(Co).eventRange.range.start}function Co(e,t){return e.eventRange.range.start<t.eventRange.range.start?e:t}function Ro(e,t){return e.eventRange.range.end>t.eventRange.range.end?e:t}var xo={__proto__:null,BASE_OPTION_DEFAULTS:cn,BaseComponent:Gn,BgEvent:go,CalendarImpl:Ni,CalendarRoot:ki,ContentContainer:Jn,CustomRenderingStore:class extends class{constructor(){this.handlers=[]}set(e){this.currentValue=e;for(let t of this.handlers)t(e)}subscribe(e){this.handlers.push(e),void 0!==this.currentValue&&e(this.currentValue)}}{constructor(){super(...arguments),this.map=new Map}handle(e){const{map:t}=this;let n=!1;e.isActive?(t.set(e.id,e),n=!0):t.has(e.id)&&(t.delete(e.id),n=!0),n&&this.set(t)}},DateComponent:ls,DateEnv:Hn,DateProfileGenerator:gr,DayCellContainer:uo,DayHeader:_s,DaySeriesModel:ks,DayTableModel:Ms,DelayedRunner:Me,ElementDragging:ms,ElementScrollController:os,Emitter:Gr,EventContainer:so,EventImpl:ti,Interaction:Mi,MoreLinkContainer:So,NamedTimeZoneImpl:class{constructor(e){this.timeZoneName=e}},NowIndicatorContainer:lo,NowTimer:Rs,PositionCache:rs,RefMap:Vs,ScrollController:ss,ScrollResponder:Wn,Scroller:Fs,SegHierarchy:cs,SimpleScrollGrid:io,Slicer:Is,Splitter:Wi,StandardEvent:oo,TableDateCell:Ds,TableDowCell:Cs,Theme:Bn,ViewContainer:er,ViewContextType:Ln,WeekNumberContainer:vo,WindowScrollController:as,addDays:wt,addDurations:pt,addMs:Ct,addWeeks:Dt,allowContextMenu:tt,allowSelection:Ke,applyMutationToEventStore:$r,applyStyle:Be,asCleanDays:function(e){return e.years||e.months||e.milliseconds?0:e.days},asRoughMinutes:function(e){return yt(e)/6e4},asRoughMs:yt,asRoughSeconds:function(e){return yt(e)/1e3},binarySearch:ps,buildElAttrs:Zn,buildEntryKey:us,buildEventApis:ri,buildEventRangeKey:yi,buildIsoString:Ut,buildNavLinkAttrs:qi,buildSegTimeText:pi,collectFromHash:kn,combineEventUis:Pr,compareByFieldSpecs:rt,compareNumbers:lt,compareObjs:_n,computeEarliestSegStart:wo,computeEdges:Ki,computeFallbackHeaderFormat:Es,computeInnerRect:es,computeRect:ts,computeShrinkWidth:Gs,computeVisibleDayRange:dr,config:vs,constrainPoint:Bi,createDuration:ft,createEmptyEventStore:_r,createEventInstance:pr,createEventUi:Nr,createFormatter:an,diffDates:hr,diffDayAndTime:_t,diffDays:xt,diffPoints:zi,diffWeeks:Rt,diffWholeDays:kt,diffWholeWeeks:Tt,disableCursor:Xe,elementClosest:Oe,elementMatches:Ne,enableCursor:$e,eventTupleToStore:Rr,filterHash:Sn,findDirectChildren:function(e,t){let n=e instanceof HTMLElement?[e]:e,r=[];for(let e=0;e<n.length;e+=1){let i=n[e].children;for(let e=0;e<i.length;e+=1){let n=i[e];t&&!Ne(n,t)||r.push(n)}}return r},findElements:Pe,flexibleCompare:st,formatDayString:Wt,formatIsoMonthStr:Lt,formatIsoTimeString:Ft,getAllowYScrolling:qs,getCanVGrowWithinCell:Ti,getClippingParents:ns,getDateMeta:Fi,getDayClassNames:Vi,getDefaultEventEnd:Xr,getElSeg:ai,getEntrySpanEnd:ds,getEventTargetViaRoot:ze,getIsRtlScrollbarOnLeft:Xi,getRectCenter:ji,getRelevantEvents:xr,getScrollGridClassNames:Ks,getScrollbarWidths:$i,getSectionClassNames:eo,getSectionHasLiquidHeight:Qs,getSegAnchorAttrs:bi,getSegMeta:mi,getSlotClassNames:function(e,t){let n=["fc-slot","fc-slot-"+At[e.dow]];return e.isDisabled?n.push("fc-slot-disabled"):(e.isToday&&(n.push("fc-slot-today"),n.push(t.getClass("today"))),e.isPast&&n.push("fc-slot-past"),e.isFuture&&n.push("fc-slot-future")),n},getStickyFooterScrollbar:ro,getStickyHeaderDates:no,getUniqueDomId:We,greatestDurationDenominator:Et,groupIntersectingEntries:hs,guid:Ze,hasBgRendering:si,hasCustomDayCellContent:ho,hasShrinkWidth:Js,identity:yn,injectStyles:xe,interactionSettingsStore:Oi,interactionSettingsToStore:Ii,intersectRanges:ir,intersectRects:Hi,intersectSpans:fs,isArraysEqual:St,isColPropsEqual:Zs,isDateSelectionValid:Ps,isDateSpansEqual:Ai,isInt:ct,isInteractionValid:Ns,isMultiDayRange:ur,isPropsEqual:Cn,isPropsValid:Bs,isValidDate:jt,mapHash:An,memoize:Gt,memoizeArraylike:function(e,t,n){let r=[],i=[];return s=>{let o=r.length,a=s.length,l=0;for(;l<o;l+=1)if(s[l]){if(!St(r[l],s[l])){n&&n(i[l]);let r=e.apply(this,s[l]);t&&t(r,i[l])||(i[l]=r)}}else n&&n(i[l]);for(;l<a;l+=1)i[l]=e.apply(this,s[l]);return r=s,i.splice(a),i}},memoizeHashlike:function(e,t,n){let r={},i={};return s=>{let o={};for(let a in s)if(i[a])if(St(r[a],s[a]))o[a]=i[a];else{n&&n(i[a]);let r=e.apply(this,s[a]);o[a]=t&&t(r,i[a])?i[a]:r}else o[a]=e.apply(this,s[a]);return r=s,i=o,o}},memoizeObjArg:Qt,mergeEventStores:Tr,multiplyDuration:mt,padStart:ot,parseBusinessHours:qr,parseClassNames:Mr,parseDragMeta:bs,parseEventDef:wr,parseFieldSpecs:nt,parseMarker:Pn,pointInsideRect:Pi,preventContextMenu:et,preventDefault:Le,preventSelection:Je,rangeContainsMarker:lr,rangeContainsRange:ar,rangesEqual:sr,rangesIntersect:or,refineEventDef:Ar,refineProps:vn,removeElement:Ie,removeExact:function(e,t){let n=0,r=0;for(;r<e.length;)e[r]===t?(e.splice(r,1),n+=1):r+=1;return n},renderChunkContent:Ys,renderFill:mo,renderMicroColGroup:Xs,renderScrollShim:to,requestJson:xi,sanitizeShrinkWidth:$s,setRef:Qn,sliceEventStore:ii,sortEventSegs:di,startOfDay:Mt,translateRect:function(e,t,n){return{left:e.left+t,right:e.right+t,top:e.top+n,bottom:e.bottom+n}},triggerDateSelect:Yr,unpromisify:Ci,whenTransitionDone:Ge,wholeDivideDurations:bt},_o={__proto__:null,createPortal:fe,createContext:Un,flushSync:jn,Component:D,Fragment:y,cloneElement:function(e,n,r){var i,s,o,a=f({},e.props);for(o in n)"key"==o?i=n[o]:"ref"==o?s=n[o]:a[o]=n[o];return arguments.length>2&&(a.children=arguments.length>3?t.call(arguments,2):r),m(e.type,a,i||e.key,s||e.ref,null)},createElement:p,createRef:v,h:p,hydrate:function e(t,n){U(t,n,e)},get isValidElement(){return i},get options(){return n},render:U,toChildArray:M};const To=[],ko={code:"en",week:{dow:0,doy:4},direction:"ltr",buttonText:{prev:"prev",next:"next",prevYear:"prev year",nextYear:"next year",year:"year",today:"today",month:"month",week:"week",day:"day",list:"list"},weekText:"W",weekTextLong:"Week",closeHint:"Close",timeHint:"Time",eventHint:"Event",allDayText:"all-day",moreLinkText:"more",noEventsText:"No events to display"},Mo=Object.assign(Object.assign({},ko),{buttonHints:{prev:"Previous $0",next:"Next $0",today:(e,t)=>"day"===t?"Today":"This "+e},viewHint:"$0 view",navLinkHint:"Go to $0",moreLinkHint:e=>`Show ${e} more event${1===e?"":"s"}`});function Io(e){let t=e.length>0?e[0].code:"en",n=To.concat(e),r={en:Mo};for(let e of n)r[e.code]=e;return{map:r,defaultCode:t}}function Oo(e,t){return"object"!=typeof e||Array.isArray(e)?function(e,t){let n=[].concat(e||[]),r=function(e,t){for(let n=0;n<e.length;n+=1){let r=e[n].toLocaleLowerCase().split("-");for(let e=r.length;e>0;e-=1){let n=r.slice(0,e).join("-");if(t[n])return t[n]}}return null}(n,t)||Mo;return No(e,n,r)}(e,t):No(e.code,[e.code],e)}function No(e,t,n){let r=En([ko,n],["buttonText"]);delete r.code;let{week:i}=r;return delete r.week,{codeArg:e,codes:t,week:i,simpleNumberFormat:new Intl.NumberFormat(e),options:r}}function Po(e){return{id:Ze(),name:e.name,premiumReleaseDate:e.premiumReleaseDate?new Date(e.premiumReleaseDate):void 0,deps:e.deps||[],reducers:e.reducers||[],isLoadingFuncs:e.isLoadingFuncs||[],contextInit:[].concat(e.contextInit||[]),eventRefiners:e.eventRefiners||{},eventDefMemberAdders:e.eventDefMemberAdders||[],eventSourceRefiners:e.eventSourceRefiners||{},isDraggableTransformers:e.isDraggableTransformers||[],eventDragMutationMassagers:e.eventDragMutationMassagers||[],eventDefMutationAppliers:e.eventDefMutationAppliers||[],dateSelectionTransformers:e.dateSelectionTransformers||[],datePointTransforms:e.datePointTransforms||[],dateSpanTransforms:e.dateSpanTransforms||[],views:e.views||{},viewPropsTransformers:e.viewPropsTransformers||[],isPropsValid:e.isPropsValid||null,externalDefTransforms:e.externalDefTransforms||[],viewContainerAppends:e.viewContainerAppends||[],eventDropTransformers:e.eventDropTransformers||[],componentInteractions:e.componentInteractions||[],calendarInteractions:e.calendarInteractions||[],themeClasses:e.themeClasses||{},eventSourceDefs:e.eventSourceDefs||[],cmdFormatter:e.cmdFormatter,recurringTypes:e.recurringTypes||[],namedTimeZonedImpl:e.namedTimeZonedImpl,initialView:e.initialView||"",elementDraggingImpl:e.elementDraggingImpl,optionChangeHandlers:e.optionChangeHandlers||{},scrollGridImpl:e.scrollGridImpl||null,listenerRefiners:e.listenerRefiners||{},optionRefiners:e.optionRefiners||{},propSetHandlers:e.propSetHandlers||{}}}function Ho(){let e,t=[],n=[];return(r,i)=>(e&&St(r,t)&&St(i,n)||(e=function(e,t){let n={},r={premiumReleaseDate:void 0,reducers:[],isLoadingFuncs:[],contextInit:[],eventRefiners:{},eventDefMemberAdders:[],eventSourceRefiners:{},isDraggableTransformers:[],eventDragMutationMassagers:[],eventDefMutationAppliers:[],dateSelectionTransformers:[],datePointTransforms:[],dateSpanTransforms:[],views:{},viewPropsTransformers:[],isPropsValid:null,externalDefTransforms:[],viewContainerAppends:[],eventDropTransformers:[],componentInteractions:[],calendarInteractions:[],themeClasses:{},eventSourceDefs:[],cmdFormatter:null,recurringTypes:[],namedTimeZonedImpl:null,initialView:"",elementDraggingImpl:null,optionChangeHandlers:{},scrollGridImpl:null,listenerRefiners:{},optionRefiners:{},propSetHandlers:{}};function i(e){for(let o of e){const e=o.name,a=n[e];void 0===a?(n[e]=o.id,i(o.deps),s=o,r={premiumReleaseDate:Bo((t=r).premiumReleaseDate,s.premiumReleaseDate),reducers:t.reducers.concat(s.reducers),isLoadingFuncs:t.isLoadingFuncs.concat(s.isLoadingFuncs),contextInit:t.contextInit.concat(s.contextInit),eventRefiners:Object.assign(Object.assign({},t.eventRefiners),s.eventRefiners),eventDefMemberAdders:t.eventDefMemberAdders.concat(s.eventDefMemberAdders),eventSourceRefiners:Object.assign(Object.assign({},t.eventSourceRefiners),s.eventSourceRefiners),isDraggableTransformers:t.isDraggableTransformers.concat(s.isDraggableTransformers),eventDragMutationMassagers:t.eventDragMutationMassagers.concat(s.eventDragMutationMassagers),eventDefMutationAppliers:t.eventDefMutationAppliers.concat(s.eventDefMutationAppliers),dateSelectionTransformers:t.dateSelectionTransformers.concat(s.dateSelectionTransformers),datePointTransforms:t.datePointTransforms.concat(s.datePointTransforms),dateSpanTransforms:t.dateSpanTransforms.concat(s.dateSpanTransforms),views:Object.assign(Object.assign({},t.views),s.views),viewPropsTransformers:t.viewPropsTransformers.concat(s.viewPropsTransformers),isPropsValid:s.isPropsValid||t.isPropsValid,externalDefTransforms:t.externalDefTransforms.concat(s.externalDefTransforms),viewContainerAppends:t.viewContainerAppends.concat(s.viewContainerAppends),eventDropTransformers:t.eventDropTransformers.concat(s.eventDropTransformers),calendarInteractions:t.calendarInteractions.concat(s.calendarInteractions),componentInteractions:t.componentInteractions.concat(s.componentInteractions),themeClasses:Object.assign(Object.assign({},t.themeClasses),s.themeClasses),eventSourceDefs:t.eventSourceDefs.concat(s.eventSourceDefs),cmdFormatter:s.cmdFormatter||t.cmdFormatter,recurringTypes:t.recurringTypes.concat(s.recurringTypes),namedTimeZonedImpl:s.namedTimeZonedImpl||t.namedTimeZonedImpl,initialView:t.initialView||s.initialView,elementDraggingImpl:t.elementDraggingImpl||s.elementDraggingImpl,optionChangeHandlers:Object.assign(Object.assign({},t.optionChangeHandlers),s.optionChangeHandlers),scrollGridImpl:s.scrollGridImpl||t.scrollGridImpl,listenerRefiners:Object.assign(Object.assign({},t.listenerRefiners),s.listenerRefiners),optionRefiners:Object.assign(Object.assign({},t.optionRefiners),s.optionRefiners),propSetHandlers:Object.assign(Object.assign({},t.propSetHandlers),s.propSetHandlers)}):a!==o.id&&console.warn(`Duplicate plugin '${e}'`)}var t,s}return e&&i(e),i(t),r}(r,i)),t=r,n=i,e)}function Bo(e,t){return void 0===e?t:void 0===t?e:new Date(Math.max(e.valueOf(),t.valueOf()))}class jo extends Bn{}function zo(e,t,n,r){if(t[e])return t[e];let i=function(e,t,n,r){let i=n[e],s=r[e],o=e=>i&&null!==i[e]?i[e]:s&&null!==s[e]?s[e]:null,a=o("component"),l=o("superType"),c=null;if(l){if(l===e)throw new Error("Can't have a custom view type that references itself");c=zo(l,t,n,r)}!a&&c&&(a=c.component);if(!a)return null;return{type:e,component:a,defaults:Object.assign(Object.assign({},c?c.defaults:{}),i?i.rawOptions:{}),overrides:Object.assign(Object.assign({},c?c.overrides:{}),s?s.rawOptions:{})}}(e,t,n,r);return i&&(t[e]=i),i}function Uo(e){return An(e,Wo)}function Wo(e){let t="function"==typeof e?{component:e}:e,{component:n}=t;return t.content?n=Lo(t):!n||n.prototype instanceof Gn||(n=Lo(Object.assign(Object.assign({},t),{content:n}))),{superType:t.type,component:n,rawOptions:t}}function Lo(e){return t=>p(Ln.Consumer,null,n=>p(Jn,{elTag:"div",elClasses:tr(n.viewSpec),renderProps:Object.assign(Object.assign({},t),{nextDayThreshold:n.options.nextDayThreshold}),generatorName:void 0,customGenerator:e.content,classNameGenerator:e.classNames,didMount:e.didMount,willUnmount:e.willUnmount}))}function Fo(e,t,n,r){let i=Uo(e),s=Uo(t.views);return An(function(e,t){let n,r={};for(n in e)zo(n,r,e,t);for(n in t)zo(n,r,e,t);return r}(i,s),e=>function(e,t,n,r,i){let s=e.overrides.duration||e.defaults.duration||r.duration||n.duration,o=null,a="",l="",c={};if(s&&(o=function(e){let t=JSON.stringify(e),n=Vo[t];void 0===n&&(n=ft(e),Vo[t]=n);return n}(s),o)){let e=Et(o);a=e.unit,1===e.value&&(l=a,c=t[a]?t[a].rawOptions:{})}let d=t=>{let n=t.buttonText||{},r=e.defaults.buttonTextKey;return null!=r&&null!=n[r]?n[r]:null!=n[e.type]?n[e.type]:null!=n[l]?n[l]:null},u=t=>{let n=t.buttonHints||{},r=e.defaults.buttonTextKey;return null!=r&&null!=n[r]?n[r]:null!=n[e.type]?n[e.type]:null!=n[l]?n[l]:null};return{type:e.type,component:e.component,duration:o,durationUnit:a,singleUnit:l,optionDefaults:e.defaults,optionOverrides:Object.assign(Object.assign({},c),e.overrides),buttonTextOverride:d(r)||d(n)||e.overrides.buttonText,buttonTextDefault:d(i)||e.defaults.buttonText||d(cn)||e.type,buttonTitleOverride:u(r)||u(n)||e.overrides.buttonHint,buttonTitleDefault:u(i)||e.defaults.buttonHint||u(cn)}}(e,s,t,n,r))}jo.prototype.classes={root:"fc-theme-standard",tableCellShaded:"fc-cell-shaded",buttonGroup:"fc-button-group",button:"fc-button fc-button-primary",buttonActive:"fc-button-active"},jo.prototype.baseIconClass="fc-icon",jo.prototype.iconClasses={close:"fc-icon-x",prev:"fc-icon-chevron-left",next:"fc-icon-chevron-right",prevYear:"fc-icon-chevrons-left",nextYear:"fc-icon-chevrons-right"},jo.prototype.rtlIconClasses={prev:"fc-icon-chevron-right",next:"fc-icon-chevron-left",prevYear:"fc-icon-chevrons-right",nextYear:"fc-icon-chevrons-left"},jo.prototype.iconOverrideOption="buttonIcons",jo.prototype.iconOverrideCustomButtonOption="icon",jo.prototype.iconOverridePrefix="fc-icon-";let Vo={};function Go(e,t,n){let r=t?t.activeRange:null;return Yo({},function(e,t){let n=zr(t),r=[].concat(e.eventSources||[]),i=[];e.initialEvents&&r.unshift(e.initialEvents);e.events&&r.unshift(e.events);for(let e of r){let r=jr(e,t,n);r&&i.push(r)}return i}(e,n),r,n)}function Qo(e,t,n,r){let i=n?n.activeRange:null;switch(t.type){case"ADD_EVENT_SOURCES":return Yo(e,t.sources,i,r);case"REMOVE_EVENT_SOURCE":return s=e,o=t.sourceId,Sn(s,e=>e.sourceId!==o);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return n?Zo(e,i,r):e;case"FETCH_EVENT_SOURCES":return Xo(e,t.sourceIds?Dn(t.sourceIds):Jo(e,r),i,t.isRefetch||!1,r);case"RECEIVE_EVENTS":case"RECEIVE_EVENT_ERROR":return function(e,t,n,r){let i=e[t];if(i&&n===i.latestFetchId)return Object.assign(Object.assign({},e),{[t]:Object.assign(Object.assign({},i),{isFetching:!1,fetchRange:r})});return e}(e,t.sourceId,t.fetchId,t.fetchRange);case"REMOVE_ALL_EVENT_SOURCES":return{};default:return e}var s,o}function qo(e){for(let t in e)if(e[t].isFetching)return!0;return!1}function Yo(e,t,n,r){let i={};for(let e of t)i[e.sourceId]=e;return n&&(i=Zo(i,n,r)),Object.assign(Object.assign({},e),i)}function Zo(e,t,n){return Xo(e,Sn(e,e=>function(e,t,n){if(!Ko(e,n))return!e.latestFetchId;return!n.options.lazyFetching||!e.fetchRange||e.isFetching||t.start<e.fetchRange.start||t.end>e.fetchRange.end}(e,t,n)),t,!1,n)}function Xo(e,t,n,r,i){let s={};for(let o in e){let a=e[o];t[o]?s[o]=$o(a,n,r,i):s[o]=a}return s}function $o(e,t,n,r){let{options:i,calendarApi:s}=r,o=r.pluginHooks.eventSourceDefs[e.sourceDefId],a=Ze();return o.fetch({eventSource:e,range:t,isRefetch:n,context:r},n=>{let{rawEvents:o}=n;i.eventSourceSuccess&&(o=i.eventSourceSuccess.call(s,o,n.response)||o),e.success&&(o=e.success.call(s,o,n.response)||o),r.dispatch({type:"RECEIVE_EVENTS",sourceId:e.sourceId,fetchId:a,fetchRange:t,rawEvents:o})},n=>{let o=!1;i.eventSourceFailure&&(i.eventSourceFailure.call(s,n),o=!0),e.failure&&(e.failure(n),o=!0),o||console.warn(n.message,n),r.dispatch({type:"RECEIVE_EVENT_ERROR",sourceId:e.sourceId,fetchId:a,fetchRange:t,error:n})}),Object.assign(Object.assign({},e),{isFetching:!0,latestFetchId:a})}function Jo(e,t){return Sn(e,e=>Ko(e,t))}function Ko(e,t){return!t.pluginHooks.eventSourceDefs[e.sourceDefId].ignoreRange}function ea(e,t){switch(t.type){case"UNSELECT_DATES":return null;case"SELECT_DATES":return t.selection;default:return e}}function ta(e,t){switch(t.type){case"UNSELECT_EVENT":return"";case"SELECT_EVENT":return t.eventInstanceId;default:return e}}function na(e,t){let n;switch(t.type){case"UNSET_EVENT_DRAG":return null;case"SET_EVENT_DRAG":return n=t.state,{affectedEvents:n.affectedEvents,mutatedEvents:n.mutatedEvents,isEvent:n.isEvent};default:return e}}function ra(e,t){let n;switch(t.type){case"UNSET_EVENT_RESIZE":return null;case"SET_EVENT_RESIZE":return n=t.state,{affectedEvents:n.affectedEvents,mutatedEvents:n.mutatedEvents,isEvent:n.isEvent};default:return e}}function ia(e,t,n,r,i){return{header:e.headerToolbar?sa(e.headerToolbar,e,t,n,r,i):null,footer:e.footerToolbar?sa(e.footerToolbar,e,t,n,r,i):null}}function sa(e,t,n,r,i,s){let o={},a=[],l=!1;for(let c in e){let d=oa(e[c],t,n,r,i,s);o[c]=d.widgets,a.push(...d.viewsWithButtons),l=l||d.hasTitle}return{sectionWidgets:o,viewsWithButtons:a,hasTitle:l}}function oa(e,t,n,r,i,s){let o="rtl"===t.direction,a=t.customButtons||{},l=n.buttonText||{},c=t.buttonText||{},d=n.buttonHints||{},u=t.buttonHints||{},h=e?e.split(" "):[],f=[],g=!1;return{widgets:h.map(e=>e.split(",").map(e=>{if("title"===e)return g=!0,{buttonName:e};let n,h,p,m,v,y;if(n=a[e])p=e=>{n.click&&n.click.call(e.target,e,e.target)},(m=r.getCustomButtonIconClass(n))||(m=r.getIconClass(e,o))||(v=n.text),y=n.hint||n.text;else if(h=i[e]){f.push(e),p=()=>{s.changeView(e)},(v=h.buttonTextOverride)||(m=r.getIconClass(e,o))||(v=h.buttonTextDefault);let n=h.buttonTextOverride||h.buttonTextDefault;y=at(h.buttonTitleOverride||h.buttonTitleDefault||t.viewHint,[n,e],n)}else if(s[e])if(p=()=>{s[e]()},(v=l[e])||(m=r.getIconClass(e,o))||(v=c[e]),"prevYear"===e||"nextYear"===e){let t="prevYear"===e?"prev":"next";y=at(d[t]||u[t],[c.year||"year","year"],c[e])}else y=t=>at(d[e]||u[e],[c[t]||t,t],c[e]);return{buttonName:e,buttonClick:p,buttonIcon:m,buttonText:v,buttonHint:y}})),viewsWithButtons:f,hasTitle:g}}class aa{constructor(e,t,n){this.type=e,this.getCurrentData=t,this.dateEnv=n}get calendar(){return this.getCurrentData().calendarApi}get title(){return this.getCurrentData().viewTitle}get activeStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.start)}get activeEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.end)}get currentStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.start)}get currentEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.end)}getOption(e){return this.getCurrentData().options[e]}}function la(e,t){let n=wn(t.getCurrentData().eventSources);if(1===n.length&&1===e.length&&Array.isArray(n[0]._raw)&&Array.isArray(e[0]))return void t.dispatch({type:"RESET_RAW_EVENTS",sourceId:n[0].sourceId,rawEvents:e[0]});let r=[];for(let t of e){let e=!1;for(let r=0;r<n.length;r+=1)if(n[r]._raw===t){n.splice(r,1),e=!0;break}e||r.push(t)}for(let e of n)t.dispatch({type:"REMOVE_EVENT_SOURCE",sourceId:e.sourceId});for(let e of r)t.calendarApi.addEventSource(e)}const ca=[Po({name:"array-event-source",eventSourceDefs:[{ignoreRange:!0,parseMeta:e=>Array.isArray(e.events)?e.events:null,fetch(e,t){t({rawEvents:e.eventSource.meta})}}]}),Po({name:"func-event-source",eventSourceDefs:[{parseMeta:e=>"function"==typeof e.events?e.events:null,fetch(e,t,n){const{dateEnv:r}=e.context;Ci(e.eventSource.meta.bind(null,Di(e.range,r)),e=>t({rawEvents:e}),n)}}]}),Po({name:"json-event-source",eventSourceRefiners:{method:String,extraParams:yn,startParam:String,endParam:String,timeZoneParam:String},eventSourceDefs:[{parseMeta:e=>!e.url||"json"!==e.format&&e.format?null:{url:e.url,format:"json",method:(e.method||"GET").toUpperCase(),extraParams:e.extraParams,startParam:e.startParam,endParam:e.endParam,timeZoneParam:e.timeZoneParam},fetch(e,t,n){const{meta:r}=e.eventSource,i=function(e,t,n){let r,i,s,o,{dateEnv:a,options:l}=n,c={};r=e.startParam,null==r&&(r=l.startParam);i=e.endParam,null==i&&(i=l.endParam);s=e.timeZoneParam,null==s&&(s=l.timeZoneParam);o="function"==typeof e.extraParams?e.extraParams():e.extraParams||{};Object.assign(c,o),c[r]=a.formatIso(t.start),c[i]=a.formatIso(t.end),"local"!==a.timeZone&&(c[s]=a.timeZone);return c}(r,e.range,e.context);xi(r.method,r.url,i).then(([e,n])=>{t({rawEvents:e,response:n})},n)}}]}),Po({name:"simple-recurring-event",recurringTypes:[{parse(e,t){if(e.daysOfWeek||e.startTime||e.endTime||e.startRecur||e.endRecur){let i,s={daysOfWeek:e.daysOfWeek||null,startTime:e.startTime||null,endTime:e.endTime||null,startRecur:e.startRecur?t.createMarker(e.startRecur):null,endRecur:e.endRecur?t.createMarker(e.endRecur):null};return e.duration&&(i=e.duration),!i&&e.startTime&&e.endTime&&(n=e.endTime,r=e.startTime,i={years:n.years-r.years,months:n.months-r.months,days:n.days-r.days,milliseconds:n.milliseconds-r.milliseconds}),{allDayGuess:Boolean(!e.startTime&&!e.endTime),duration:i,typeData:s}}var n,r;return null},expand(e,t,n){let r=ir(t,{start:e.startRecur,end:e.endRecur});return r?function(e,t,n,r){let i=e?Dn(e):null,s=Mt(n.start),o=n.end,a=[];for(;s<o;){let e;i&&!i[s.getUTCDay()]||(e=t?r.add(s,t):s,a.push(e)),s=wt(s,1)}return a}(e.daysOfWeek,e.startTime,r,n):[]}}],eventRefiners:{daysOfWeek:yn,startTime:ft,endTime:ft,duration:ft,startRecur:yn,endRecur:yn}}),Po({name:"change-handler",optionChangeHandlers:{events(e,t){la([e],t)},eventSources:la}}),Po({name:"misc",isLoadingFuncs:[e=>qo(e.eventSources)],propSetHandlers:{dateProfile:function(e,t){t.emitter.trigger("datesSet",Object.assign(Object.assign({},Di(e.activeRange,t.dateEnv)),{view:t.viewApi}))},eventStore:function(e,t){let{emitter:n}=t;n.hasHandlers("eventsSet")&&n.trigger("eventsSet",ri(e,t))}}})];class da{constructor(e,t){this.runTaskOption=e,this.drainedOption=t,this.queue=[],this.delayedRunner=new Me(this.drain.bind(this))}request(e,t){this.queue.push(e),this.delayedRunner.request(t)}pause(e){this.delayedRunner.pause(e)}resume(e,t){this.delayedRunner.resume(e,t)}drain(){let{queue:e}=this;for(;e.length;){let t,n=[];for(;t=e.shift();)this.runTask(t),n.push(t);this.drained(n)}}runTask(e){this.runTaskOption&&this.runTaskOption(e)}drained(e){this.drainedOption&&this.drainedOption(e)}}function ua(e,t,n){let r;return r=/^(year|month)$/.test(e.currentRangeUnit)?e.currentRange:e.activeRange,n.formatRange(r.start,r.end,an(t.titleFormat||function(e){let{currentRangeUnit:t}=e;if("year"===t)return{year:"numeric"};if("month"===t)return{year:"numeric",month:"long"};let n=kt(e.currentRange.start,e.currentRange.end);if(null!==n&&n>1)return{year:"numeric",month:"short",day:"numeric"};return{year:"numeric",month:"long",day:"numeric"}}(e)),{isEndExclusive:e.isRangeAllDay,defaultSeparator:t.titleRangeSeparator})}class ha{constructor(e){this.computeCurrentViewData=Gt(this._computeCurrentViewData),this.organizeRawLocales=Gt(Io),this.buildLocale=Gt(Oo),this.buildPluginHooks=Ho(),this.buildDateEnv=Gt(fa),this.buildTheme=Gt(ga),this.parseToolbars=Gt(ia),this.buildViewSpecs=Gt(Fo),this.buildDateProfileGenerator=Qt(pa),this.buildViewApi=Gt(ma),this.buildViewUiProps=Qt(ba),this.buildEventUiBySource=Gt(va,Cn),this.buildEventUiBases=Gt(ya),this.parseContextBusinessHours=Qt(Sa),this.buildTitle=Gt(ua),this.emitter=new Gr,this.actionRunner=new da(this._handleAction.bind(this),this.updateData.bind(this)),this.currentCalendarOptionsInput={},this.currentCalendarOptionsRefined={},this.currentViewOptionsInput={},this.currentViewOptionsRefined={},this.currentCalendarOptionsRefiners={},this.optionsForRefining=[],this.optionsForHandling=[],this.getCurrentData=()=>this.data,this.dispatch=e=>{this.actionRunner.request(e)},this.props=e,this.actionRunner.pause();let t={},n=this.computeOptionsData(e.optionOverrides,t,e.calendarApi),r=n.calendarOptions.initialView||n.pluginHooks.initialView,i=this.computeCurrentViewData(r,n,e.optionOverrides,t);e.calendarApi.currentDataManager=this,this.emitter.setThisContext(e.calendarApi),this.emitter.setOptions(i.options);let s=function(e,t){let n=e.initialDate;return null!=n?t.createMarker(n):fr(e.now,t)}(n.calendarOptions,n.dateEnv),o=i.dateProfileGenerator.build(s);lr(o.activeRange,s)||(s=o.currentRange.start);let a={dateEnv:n.dateEnv,options:n.calendarOptions,pluginHooks:n.pluginHooks,calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData};for(let e of n.pluginHooks.contextInit)e(a);let l=Go(n.calendarOptions,o,a),c={dynamicOptionOverrides:t,currentViewType:r,currentDate:s,dateProfile:o,businessHours:this.parseContextBusinessHours(a),eventSources:l,eventUiBases:{},eventStore:{defs:{},instances:{}},renderableEventStore:{defs:{},instances:{}},dateSelection:null,eventSelection:"",eventDrag:null,eventResize:null,selectionConfig:this.buildViewUiProps(a).selectionConfig},d=Object.assign(Object.assign({},a),c);for(let e of n.pluginHooks.reducers)Object.assign(c,e(null,null,d));Ea(c,a)&&this.emitter.trigger("loading",!0),this.state=c,this.updateData(),this.actionRunner.resume()}resetOptions(e,t){let{props:n}=this;void 0===t?n.optionOverrides=e:(n.optionOverrides=Object.assign(Object.assign({},n.optionOverrides||{}),e),this.optionsForRefining.push(...t)),(void 0===t||t.length)&&this.actionRunner.request({type:"NOTHING"})}_handleAction(e){let{props:t,state:n,emitter:r}=this,i=function(e,t){switch(t.type){case"SET_OPTION":return Object.assign(Object.assign({},e),{[t.optionName]:t.rawOptionValue});default:return e}}(n.dynamicOptionOverrides,e),s=this.computeOptionsData(t.optionOverrides,i,t.calendarApi),o=function(e,t){switch(t.type){case"CHANGE_VIEW_TYPE":e=t.viewType}return e}(n.currentViewType,e),a=this.computeCurrentViewData(o,s,t.optionOverrides,i);t.calendarApi.currentDataManager=this,r.setThisContext(t.calendarApi),r.setOptions(a.options);let l={dateEnv:s.dateEnv,options:s.calendarOptions,pluginHooks:s.pluginHooks,calendarApi:t.calendarApi,dispatch:this.dispatch,emitter:r,getCurrentData:this.getCurrentData},{currentDate:c,dateProfile:d}=n;this.data&&this.data.dateProfileGenerator!==a.dateProfileGenerator&&(d=a.dateProfileGenerator.build(c)),c=function(e,t){switch(t.type){case"CHANGE_DATE":return t.dateMarker;default:return e}}(c,e),d=function(e,t,n,r){let i;switch(t.type){case"CHANGE_VIEW_TYPE":return r.build(t.dateMarker||n);case"CHANGE_DATE":return r.build(t.dateMarker);case"PREV":if(i=r.buildPrev(e,n),i.isValid)return i;break;case"NEXT":if(i=r.buildNext(e,n),i.isValid)return i}return e}(d,e,c,a.dateProfileGenerator),"PREV"!==e.type&&"NEXT"!==e.type&&lr(d.currentRange,c)||(c=d.currentRange.start);let u=Qo(n.eventSources,e,d,l),h=Ur(n.eventStore,e,u,d,l),f=qo(u)&&!a.options.progressiveEventRendering&&n.renderableEventStore||h,{eventUiSingleBase:g,selectionConfig:p}=this.buildViewUiProps(l),m=this.buildEventUiBySource(u),v={dynamicOptionOverrides:i,currentViewType:o,currentDate:c,dateProfile:d,eventSources:u,eventStore:h,renderableEventStore:f,selectionConfig:p,eventUiBases:this.buildEventUiBases(f.defs,g,m),businessHours:this.parseContextBusinessHours(l),dateSelection:ea(n.dateSelection,e),eventSelection:ta(n.eventSelection,e),eventDrag:na(n.eventDrag,e),eventResize:ra(n.eventResize,e)},y=Object.assign(Object.assign({},l),v);for(let t of s.pluginHooks.reducers)Object.assign(v,t(n,e,y));let b=Ea(n,l),E=Ea(v,l);!b&&E?r.trigger("loading",!0):b&&!E&&r.trigger("loading",!1),this.state=v,t.onAction&&t.onAction(e)}updateData(){let{props:e,state:t}=this,n=this.data,r=this.computeOptionsData(e.optionOverrides,t.dynamicOptionOverrides,e.calendarApi),i=this.computeCurrentViewData(t.currentViewType,r,e.optionOverrides,t.dynamicOptionOverrides),s=this.data=Object.assign(Object.assign(Object.assign({viewTitle:this.buildTitle(t.dateProfile,i.options,r.dateEnv),calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData},r),i),t),o=r.pluginHooks.optionChangeHandlers,a=n&&n.calendarOptions,l=r.calendarOptions;if(a&&a!==l){a.timeZone!==l.timeZone&&(t.eventSources=s.eventSources=function(e,t,n){let r=t?t.activeRange:null;return Xo(e,Jo(e,n),r,!0,n)}(s.eventSources,t.dateProfile,s),t.eventStore=s.eventStore=Fr(s.eventStore,n.dateEnv,s.dateEnv),t.renderableEventStore=s.renderableEventStore=Fr(s.renderableEventStore,n.dateEnv,s.dateEnv));for(let e in o)-1===this.optionsForHandling.indexOf(e)&&a[e]===l[e]||o[e](l[e],s)}this.optionsForHandling=[],e.onData&&e.onData(s)}computeOptionsData(e,t,n){if(!this.optionsForRefining.length&&e===this.stableOptionOverrides&&t===this.stableDynamicOptionOverrides)return this.stableCalendarOptionsData;let{refinedOptions:r,pluginHooks:i,localeDefaults:s,availableLocaleData:o,extra:a}=this.processRawCalendarOptions(e,t);Aa(a);let l=this.buildDateEnv(r.timeZone,r.locale,r.weekNumberCalculation,r.firstDay,r.weekText,i,o,r.defaultRangeSeparator),c=this.buildViewSpecs(i.views,this.stableOptionOverrides,this.stableDynamicOptionOverrides,s),d=this.buildTheme(r,i),u=this.parseToolbars(r,this.stableOptionOverrides,d,c,n);return this.stableCalendarOptionsData={calendarOptions:r,pluginHooks:i,dateEnv:l,viewSpecs:c,theme:d,toolbarConfig:u,localeDefaults:s,availableRawLocales:o.map}}processRawCalendarOptions(e,t){let{locales:n,locale:r}=mn([cn,e,t]),i=this.organizeRawLocales(n),s=i.map,o=this.buildLocale(r||i.defaultCode,s).options,a=this.buildPluginHooks(e.plugins||[],ca),l=this.currentCalendarOptionsRefiners=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ln),dn),un),a.listenerRefiners),a.optionRefiners),c={},d=mn([cn,o,e,t]),u={},h=this.currentCalendarOptionsInput,f=this.currentCalendarOptionsRefined,g=!1;for(let e in d)-1===this.optionsForRefining.indexOf(e)&&(d[e]===h[e]||hn[e]&&e in h&&hn[e](h[e],d[e]))?u[e]=f[e]:l[e]?(u[e]=l[e](d[e]),g=!0):c[e]=h[e];return g&&(this.currentCalendarOptionsInput=d,this.currentCalendarOptionsRefined=u,this.stableOptionOverrides=e,this.stableDynamicOptionOverrides=t),this.optionsForHandling.push(...this.optionsForRefining),this.optionsForRefining=[],{rawOptions:this.currentCalendarOptionsInput,refinedOptions:this.currentCalendarOptionsRefined,pluginHooks:a,availableLocaleData:i,localeDefaults:o,extra:c}}_computeCurrentViewData(e,t,n,r){let i=t.viewSpecs[e];if(!i)throw new Error(`viewType "${e}" is not available. Please make sure you've loaded all neccessary plugins`);let{refinedOptions:s,extra:o}=this.processRawViewOptions(i,t.pluginHooks,t.localeDefaults,n,r);return Aa(o),{viewSpec:i,options:s,dateProfileGenerator:this.buildDateProfileGenerator({dateProfileGeneratorClass:i.optionDefaults.dateProfileGeneratorClass,duration:i.duration,durationUnit:i.durationUnit,usesMinMaxTime:i.optionDefaults.usesMinMaxTime,dateEnv:t.dateEnv,calendarApi:this.props.calendarApi,slotMinTime:s.slotMinTime,slotMaxTime:s.slotMaxTime,showNonCurrentDates:s.showNonCurrentDates,dayCount:s.dayCount,dateAlignment:s.dateAlignment,dateIncrement:s.dateIncrement,hiddenDays:s.hiddenDays,weekends:s.weekends,nowInput:s.now,validRangeInput:s.validRange,visibleRangeInput:s.visibleRange,fixedWeekCount:s.fixedWeekCount}),viewApi:this.buildViewApi(e,this.getCurrentData,t.dateEnv)}}processRawViewOptions(e,t,n,r,i){let s=mn([cn,e.optionDefaults,n,r,e.optionOverrides,i]),o=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ln),dn),un),pn),t.listenerRefiners),t.optionRefiners),a={},l=this.currentViewOptionsInput,c=this.currentViewOptionsRefined,d=!1,u={};for(let e in s)s[e]===l[e]||hn[e]&&hn[e](s[e],l[e])?a[e]=c[e]:(s[e]===this.currentCalendarOptionsInput[e]||hn[e]&&hn[e](s[e],this.currentCalendarOptionsInput[e])?e in this.currentCalendarOptionsRefined&&(a[e]=this.currentCalendarOptionsRefined[e]):o[e]?a[e]=o[e](s[e]):u[e]=s[e],d=!0);return d&&(this.currentViewOptionsInput=s,this.currentViewOptionsRefined=a),{rawOptions:this.currentViewOptionsInput,refinedOptions:this.currentViewOptionsRefined,extra:u}}}function fa(e,t,n,r,i,s,o,a){let l=Oo(t||o.defaultCode,o.map);return new Hn({calendarSystem:"gregory",timeZone:e,namedTimeZoneImpl:s.namedTimeZonedImpl,locale:l,weekNumberCalculation:n,firstDay:r,weekText:i,cmdFormatter:s.cmdFormatter,defaultSeparator:a})}function ga(e,t){return new(t.themeClasses[e.themeSystem]||jo)(e)}function pa(e){return new(e.dateProfileGeneratorClass||gr)(e)}function ma(e,t,n){return new aa(e,t,n)}function va(e){return An(e,e=>e.ui)}function ya(e,t,n){let r={"":t};for(let t in e){let i=e[t];i.sourceId&&n[i.sourceId]&&(r[t]=n[i.sourceId])}return r}function ba(e){let{options:t}=e;return{eventUiSingleBase:Nr({display:t.eventDisplay,editable:t.editable,startEditable:t.eventStartEditable,durationEditable:t.eventDurationEditable,constraint:t.eventConstraint,overlap:"boolean"==typeof t.eventOverlap?t.eventOverlap:void 0,allow:t.eventAllow,backgroundColor:t.eventBackgroundColor,borderColor:t.eventBorderColor,textColor:t.eventTextColor,color:t.eventColor},e),selectionConfig:Nr({constraint:t.selectConstraint,overlap:"boolean"==typeof t.selectOverlap?t.selectOverlap:void 0,allow:t.selectAllow},e)}}function Ea(e,t){for(let n of t.pluginHooks.isLoadingFuncs)if(n(e))return!0;return!1}function Sa(e){return qr(e.options.businessHours,e)}function Aa(e,t){for(let n in e)console.warn(`Unknown option '${n}'`+(t?` for view '${t}'`:""))}class Da extends Gn{render(){return p("div",{className:"fc-toolbar-chunk"},...this.props.widgetGroups.map(e=>this.renderWidgetGroup(e)))}renderWidgetGroup(e){let{props:t}=this,{theme:n}=this.context,r=[],i=!0;for(let s of e){let{buttonName:e,buttonClick:o,buttonText:a,buttonIcon:l,buttonHint:c}=s;if("title"===e)i=!1,r.push(p("h2",{className:"fc-toolbar-title",id:t.titleId},t.title));else{let i=e===t.activeButton,s=!t.isTodayEnabled&&"today"===e||!t.isPrevEnabled&&"prev"===e||!t.isNextEnabled&&"next"===e,d=[`fc-${e}-button`,n.getClass("button")];i&&d.push(n.getClass("buttonActive")),r.push(p("button",{type:"button",title:"function"==typeof c?c(t.navUnit):c,disabled:s,"aria-pressed":i,className:d.join(" "),onClick:o},a||(l?p("span",{className:l}):"")))}}if(r.length>1){return p("div",{className:i&&n.getClass("buttonGroup")||""},...r)}return r[0]}}class wa extends Gn{render(){let e,t,{model:n,extraClassName:r}=this.props,i=!1,s=n.sectionWidgets,o=s.center;return s.left?(i=!0,e=s.left):e=s.start,s.right?(i=!0,t=s.right):t=s.end,p("div",{className:[r||"","fc-toolbar",i?"fc-toolbar-ltr":""].join(" ")},this.renderSection("start",e||[]),this.renderSection("center",o||[]),this.renderSection("end",t||[]))}renderSection(e,t){let{props:n}=this;return p(Da,{key:e,widgetGroups:t,title:n.title,navUnit:n.navUnit,activeButton:n.activeButton,isTodayEnabled:n.isTodayEnabled,isPrevEnabled:n.isPrevEnabled,isNextEnabled:n.isNextEnabled,titleId:n.titleId})}}class Ca extends Gn{constructor(){super(...arguments),this.state={availableWidth:null},this.handleEl=e=>{this.el=e,Qn(this.props.elRef,e),this.updateAvailableWidth()},this.handleResize=()=>{this.updateAvailableWidth()}}render(){let{props:e,state:t}=this,{aspectRatio:n}=e,r=["fc-view-harness",n||e.liquid||e.height?"fc-view-harness-active":"fc-view-harness-passive"],i="",s="";return n?null!==t.availableWidth?i=t.availableWidth/n:s=1/n*100+"%":i=e.height||"",p("div",{"aria-labelledby":e.labeledById,ref:this.handleEl,className:r.join(" "),style:{height:i,paddingBottom:s}},e.children)}componentDidMount(){this.context.addResizeHandler(this.handleResize)}componentWillUnmount(){this.context.removeResizeHandler(this.handleResize)}updateAvailableWidth(){this.el&&this.props.aspectRatio&&this.setState({availableWidth:this.el.offsetWidth})}}class Ra extends Mi{constructor(e){super(e),this.handleSegClick=(e,t)=>{let{component:n}=this,{context:r}=n,i=ai(t);if(i&&n.isValidSegDownEl(e.target)){let s=Oe(e.target,".fc-event-forced-url"),o=s?s.querySelector("a[href]").href:"";r.emitter.trigger("eventClick",{el:t,event:new ti(n.context,i.eventRange.def,i.eventRange.instance),jsEvent:e,view:r.viewApi}),o&&!e.defaultPrevented&&(window.location.href=o)}},this.destroy=Fe(e.el,"click",".fc-event",this.handleSegClick)}}class xa extends Mi{constructor(e){super(e),this.handleEventElRemove=e=>{e===this.currentSegEl&&this.handleSegLeave(null,this.currentSegEl)},this.handleSegEnter=(e,t)=>{ai(t)&&(this.currentSegEl=t,this.triggerEvent("eventMouseEnter",e,t))},this.handleSegLeave=(e,t)=>{this.currentSegEl&&(this.currentSegEl=null,this.triggerEvent("eventMouseLeave",e,t))},this.removeHoverListeners=function(e,t,n,r){let i;return Fe(e,"mouseover",t,(e,t)=>{if(t!==i){i=t,n(e,t);let s=e=>{i=null,r(e,t),t.removeEventListener("mouseleave",s)};t.addEventListener("mouseleave",s)}})}(e.el,".fc-event",this.handleSegEnter,this.handleSegLeave)}destroy(){this.removeHoverListeners()}triggerEvent(e,t,n){let{component:r}=this,{context:i}=r,s=ai(n);t&&!r.isValidSegDownEl(t.target)||i.emitter.trigger(e,{el:n,event:new ti(i,s.eventRange.def,s.eventRange.instance),jsEvent:t,view:i.viewApi})}}class _a extends Vn{constructor(){super(...arguments),this.buildViewContext=Gt(Fn),this.buildViewPropTransformers=Gt(ka),this.buildToolbarProps=Gt(Ta),this.headerRef={current:null},this.footerRef={current:null},this.interactionsStore={},this.state={viewLabelId:We()},this.registerInteractiveComponent=(e,t)=>{let n=function(e,t){return{component:e,el:t.el,useEventCenter:null==t.useEventCenter||t.useEventCenter,isHitComboAllowed:t.isHitComboAllowed||null}}(e,t),r=[Ra,xa].concat(this.props.pluginHooks.componentInteractions).map(e=>new e(n));this.interactionsStore[e.uid]=r,Oi[e.uid]=n},this.unregisterInteractiveComponent=e=>{let t=this.interactionsStore[e.uid];if(t){for(let e of t)e.destroy();delete this.interactionsStore[e.uid]}delete Oi[e.uid]},this.resizeRunner=new Me(()=>{this.props.emitter.trigger("_resize",!0),this.props.emitter.trigger("windowResize",{view:this.props.viewApi})}),this.handleWindowResize=e=>{let{options:t}=this.props;t.handleWindowResize&&e.target===window&&this.resizeRunner.request(t.windowResizeDelay)}}render(){let e,{props:t}=this,{toolbarConfig:n,options:r}=t,i=this.buildToolbarProps(t.viewSpec,t.dateProfile,t.dateProfileGenerator,t.currentDate,fr(t.options.now,t.dateEnv),t.viewTitle),s=!1,o="";t.isHeightAuto||t.forPrint?o="":null!=r.height?s=!0:null!=r.contentHeight?o=r.contentHeight:e=Math.max(r.aspectRatio,.5);let a=this.buildViewContext(t.viewSpec,t.viewApi,t.options,t.dateProfileGenerator,t.dateEnv,t.theme,t.pluginHooks,t.dispatch,t.getCurrentData,t.emitter,t.calendarApi,this.registerInteractiveComponent,this.unregisterInteractiveComponent),l=n.header&&n.header.hasTitle?this.state.viewLabelId:"";return p(Ln.Provider,{value:a},n.header&&p(wa,Object.assign({ref:this.headerRef,extraClassName:"fc-header-toolbar",model:n.header,titleId:l},i)),p(Ca,{liquid:s,height:o,aspectRatio:e,labeledById:l},this.renderView(t),this.buildAppendContent()),n.footer&&p(wa,Object.assign({ref:this.footerRef,extraClassName:"fc-footer-toolbar",model:n.footer,titleId:""},i)))}componentDidMount(){let{props:e}=this;this.calendarInteractions=e.pluginHooks.calendarInteractions.map(t=>new t(e)),window.addEventListener("resize",this.handleWindowResize);let{propSetHandlers:t}=e.pluginHooks;for(let n in t)t[n](e[n],e)}componentDidUpdate(e){let{props:t}=this,{propSetHandlers:n}=t.pluginHooks;for(let r in n)t[r]!==e[r]&&n[r](t[r],t)}componentWillUnmount(){window.removeEventListener("resize",this.handleWindowResize),this.resizeRunner.clear();for(let e of this.calendarInteractions)e.destroy();this.props.emitter.trigger("_unmount")}buildAppendContent(){let{props:e}=this;return p(y,{},...e.pluginHooks.viewContainerAppends.map(t=>t(e)))}renderView(e){let{pluginHooks:t}=e,{viewSpec:n}=e,r={dateProfile:e.dateProfile,businessHours:e.businessHours,eventStore:e.renderableEventStore,eventUiBases:e.eventUiBases,dateSelection:e.dateSelection,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,isHeightAuto:e.isHeightAuto,forPrint:e.forPrint},i=this.buildViewPropTransformers(t.viewPropsTransformers);for(let t of i)Object.assign(r,t.transform(r,e));return p(n.component,Object.assign({},r))}}function Ta(e,t,n,r,i,s){let o=n.build(i,void 0,!1),a=n.buildPrev(t,r,!1),l=n.buildNext(t,r,!1);return{title:s,activeButton:e.type,navUnit:e.singleUnit,isTodayEnabled:o.isValid&&!lr(t.currentRange,i),isPrevEnabled:a.isValid,isNextEnabled:l.isValid}}function ka(e){return e.map(e=>new e)}function Ma(e){let t=Oo(e.locale||"en",Io([]).map);return new Hn(Object.assign(Object.assign({timeZone:cn.timeZone,calendarSystem:"gregory"},e),{locale:t}))}vs.touchMouseIgnoreWait=500;let Ia=0,Oa=0,Na=!1;class Pa{constructor(e){this.subjectEl=null,this.selector="",this.handleSelector="",this.shouldIgnoreMove=!1,this.shouldWatchScroll=!0,this.isDragging=!1,this.isTouchDragging=!1,this.wasTouchScroll=!1,this.handleMouseDown=e=>{if(!this.shouldIgnoreMouse()&&function(e){return 0===e.button&&!e.ctrlKey}(e)&&this.tryStart(e)){let t=this.createEventFromMouse(e,!0);this.emitter.trigger("pointerdown",t),this.initScrollWatch(t),this.shouldIgnoreMove||document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}},this.handleMouseMove=e=>{let t=this.createEventFromMouse(e);this.recordCoords(t),this.emitter.trigger("pointermove",t)},this.handleMouseUp=e=>{document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.emitter.trigger("pointerup",this.createEventFromMouse(e)),this.cleanup()},this.handleTouchStart=e=>{if(this.tryStart(e)){this.isTouchDragging=!0;let t=this.createEventFromTouch(e,!0);this.emitter.trigger("pointerdown",t),this.initScrollWatch(t);let n=e.target;this.shouldIgnoreMove||n.addEventListener("touchmove",this.handleTouchMove),n.addEventListener("touchend",this.handleTouchEnd),n.addEventListener("touchcancel",this.handleTouchEnd),window.addEventListener("scroll",this.handleTouchScroll,!0)}},this.handleTouchMove=e=>{let t=this.createEventFromTouch(e);this.recordCoords(t),this.emitter.trigger("pointermove",t)},this.handleTouchEnd=e=>{if(this.isDragging){let t=e.target;t.removeEventListener("touchmove",this.handleTouchMove),t.removeEventListener("touchend",this.handleTouchEnd),t.removeEventListener("touchcancel",this.handleTouchEnd),window.removeEventListener("scroll",this.handleTouchScroll,!0),this.emitter.trigger("pointerup",this.createEventFromTouch(e)),this.cleanup(),this.isTouchDragging=!1,Ia+=1,setTimeout(()=>{Ia-=1},vs.touchMouseIgnoreWait)}},this.handleTouchScroll=()=>{this.wasTouchScroll=!0},this.handleScroll=e=>{if(!this.shouldIgnoreMove){let t=window.pageXOffset-this.prevScrollX+this.prevPageX,n=window.pageYOffset-this.prevScrollY+this.prevPageY;this.emitter.trigger("pointermove",{origEvent:e,isTouch:this.isTouchDragging,subjectEl:this.subjectEl,pageX:t,pageY:n,deltaX:t-this.origPageX,deltaY:n-this.origPageY})}},this.containerEl=e,this.emitter=new Gr,e.addEventListener("mousedown",this.handleMouseDown),e.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),Oa+=1,1===Oa&&window.addEventListener("touchmove",Ha,{passive:!1})}destroy(){this.containerEl.removeEventListener("mousedown",this.handleMouseDown),this.containerEl.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),Oa-=1,Oa||window.removeEventListener("touchmove",Ha,{passive:!1})}tryStart(e){let t=this.querySubjectEl(e),n=e.target;return!(!t||this.handleSelector&&!Oe(n,this.handleSelector))&&(this.subjectEl=t,this.isDragging=!0,this.wasTouchScroll=!1,!0)}cleanup(){Na=!1,this.isDragging=!1,this.subjectEl=null,this.destroyScrollWatch()}querySubjectEl(e){return this.selector?Oe(e.target,this.selector):this.containerEl}shouldIgnoreMouse(){return Ia||this.isTouchDragging}cancelTouchScroll(){this.isDragging&&(Na=!0)}initScrollWatch(e){this.shouldWatchScroll&&(this.recordCoords(e),window.addEventListener("scroll",this.handleScroll,!0))}recordCoords(e){this.shouldWatchScroll&&(this.prevPageX=e.pageX,this.prevPageY=e.pageY,this.prevScrollX=window.pageXOffset,this.prevScrollY=window.pageYOffset)}destroyScrollWatch(){this.shouldWatchScroll&&window.removeEventListener("scroll",this.handleScroll,!0)}createEventFromMouse(e,t){let n=0,r=0;return t?(this.origPageX=e.pageX,this.origPageY=e.pageY):(n=e.pageX-this.origPageX,r=e.pageY-this.origPageY),{origEvent:e,isTouch:!1,subjectEl:this.subjectEl,pageX:e.pageX,pageY:e.pageY,deltaX:n,deltaY:r}}createEventFromTouch(e,t){let n,r,i=e.touches,s=0,o=0;return i&&i.length?(n=i[0].pageX,r=i[0].pageY):(n=e.pageX,r=e.pageY),t?(this.origPageX=n,this.origPageY=r):(s=n-this.origPageX,o=r-this.origPageY),{origEvent:e,isTouch:!0,subjectEl:this.subjectEl,pageX:n,pageY:r,deltaX:s,deltaY:o}}}function Ha(e){Na&&e.preventDefault()}class Ba{constructor(){this.isVisible=!1,this.sourceEl=null,this.mirrorEl=null,this.sourceElRect=null,this.parentNode=document.body,this.zIndex=9999,this.revertDuration=0}start(e,t,n){this.sourceEl=e,this.sourceElRect=this.sourceEl.getBoundingClientRect(),this.origScreenX=t-window.pageXOffset,this.origScreenY=n-window.pageYOffset,this.deltaX=0,this.deltaY=0,this.updateElPosition()}handleMove(e,t){this.deltaX=e-window.pageXOffset-this.origScreenX,this.deltaY=t-window.pageYOffset-this.origScreenY,this.updateElPosition()}setIsVisible(e){e?this.isVisible||(this.mirrorEl&&(this.mirrorEl.style.display=""),this.isVisible=e,this.updateElPosition()):this.isVisible&&(this.mirrorEl&&(this.mirrorEl.style.display="none"),this.isVisible=e)}stop(e,t){let n=()=>{this.cleanup(),t()};e&&this.mirrorEl&&this.isVisible&&this.revertDuration&&(this.deltaX||this.deltaY)?this.doRevertAnimation(n,this.revertDuration):setTimeout(n,0)}doRevertAnimation(e,t){let n=this.mirrorEl,r=this.sourceEl.getBoundingClientRect();n.style.transition="top "+t+"ms,left "+t+"ms",Be(n,{left:r.left,top:r.top}),Ge(n,()=>{n.style.transition="",e()})}cleanup(){this.mirrorEl&&(Ie(this.mirrorEl),this.mirrorEl=null),this.sourceEl=null}updateElPosition(){this.sourceEl&&this.isVisible&&Be(this.getMirrorEl(),{left:this.sourceElRect.left+this.deltaX,top:this.sourceElRect.top+this.deltaY})}getMirrorEl(){let e=this.sourceElRect,t=this.mirrorEl;return t||(t=this.mirrorEl=this.sourceEl.cloneNode(!0),t.style.userSelect="none",t.style.webkitUserSelect="none",t.classList.add("fc-event-dragging"),Be(t,{position:"fixed",zIndex:this.zIndex,visibility:"",boxSizing:"border-box",width:e.right-e.left,height:e.bottom-e.top,right:"auto",bottom:"auto",margin:0}),this.parentNode.appendChild(t)),t}}class ja extends ss{constructor(e,t){super(),this.handleScroll=()=>{this.scrollTop=this.scrollController.getScrollTop(),this.scrollLeft=this.scrollController.getScrollLeft(),this.handleScrollChange()},this.scrollController=e,this.doesListening=t,this.scrollTop=this.origScrollTop=e.getScrollTop(),this.scrollLeft=this.origScrollLeft=e.getScrollLeft(),this.scrollWidth=e.getScrollWidth(),this.scrollHeight=e.getScrollHeight(),this.clientWidth=e.getClientWidth(),this.clientHeight=e.getClientHeight(),this.clientRect=this.computeClientRect(),this.doesListening&&this.getEventTarget().addEventListener("scroll",this.handleScroll)}destroy(){this.doesListening&&this.getEventTarget().removeEventListener("scroll",this.handleScroll)}getScrollTop(){return this.scrollTop}getScrollLeft(){return this.scrollLeft}setScrollTop(e){this.scrollController.setScrollTop(e),this.doesListening||(this.scrollTop=Math.max(Math.min(e,this.getMaxScrollTop()),0),this.handleScrollChange())}setScrollLeft(e){this.scrollController.setScrollLeft(e),this.doesListening||(this.scrollLeft=Math.max(Math.min(e,this.getMaxScrollLeft()),0),this.handleScrollChange())}getClientWidth(){return this.clientWidth}getClientHeight(){return this.clientHeight}getScrollWidth(){return this.scrollWidth}getScrollHeight(){return this.scrollHeight}handleScrollChange(){}}class za extends ja{constructor(e,t){super(new os(e),t)}getEventTarget(){return this.scrollController.el}computeClientRect(){return es(this.scrollController.el)}}class Ua extends ja{constructor(e){super(new as,e)}getEventTarget(){return window}computeClientRect(){return{left:this.scrollLeft,right:this.scrollLeft+this.clientWidth,top:this.scrollTop,bottom:this.scrollTop+this.clientHeight}}handleScrollChange(){this.clientRect=this.computeClientRect()}}const Wa="function"==typeof performance?performance.now:Date.now;class La{constructor(){this.isEnabled=!0,this.scrollQuery=[window,".fc-scroller"],this.edgeThreshold=50,this.maxVelocity=300,this.pointerScreenX=null,this.pointerScreenY=null,this.isAnimating=!1,this.scrollCaches=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.animate=()=>{if(this.isAnimating){let e=this.computeBestEdge(this.pointerScreenX+window.pageXOffset,this.pointerScreenY+window.pageYOffset);if(e){let t=Wa();this.handleSide(e,(t-this.msSinceRequest)/1e3),this.requestAnimation(t)}else this.isAnimating=!1}}}start(e,t,n){this.isEnabled&&(this.scrollCaches=this.buildCaches(n),this.pointerScreenX=null,this.pointerScreenY=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.handleMove(e,t))}handleMove(e,t){if(this.isEnabled){let n=e-window.pageXOffset,r=t-window.pageYOffset,i=null===this.pointerScreenY?0:r-this.pointerScreenY,s=null===this.pointerScreenX?0:n-this.pointerScreenX;i<0?this.everMovedUp=!0:i>0&&(this.everMovedDown=!0),s<0?this.everMovedLeft=!0:s>0&&(this.everMovedRight=!0),this.pointerScreenX=n,this.pointerScreenY=r,this.isAnimating||(this.isAnimating=!0,this.requestAnimation(Wa()))}}stop(){if(this.isEnabled){this.isAnimating=!1;for(let e of this.scrollCaches)e.destroy();this.scrollCaches=null}}requestAnimation(e){this.msSinceRequest=e,requestAnimationFrame(this.animate)}handleSide(e,t){let{scrollCache:n}=e,{edgeThreshold:r}=this,i=r-e.distance,s=i*i/(r*r)*this.maxVelocity*t,o=1;switch(e.name){case"left":o=-1;case"right":n.setScrollLeft(n.getScrollLeft()+s*o);break;case"top":o=-1;case"bottom":n.setScrollTop(n.getScrollTop()+s*o)}}computeBestEdge(e,t){let{edgeThreshold:n}=this,r=null,i=this.scrollCaches||[];for(let s of i){let i=s.clientRect,o=e-i.left,a=i.right-e,l=t-i.top,c=i.bottom-t;o>=0&&a>=0&&l>=0&&c>=0&&(l<=n&&this.everMovedUp&&s.canScrollUp()&&(!r||r.distance>l)&&(r={scrollCache:s,name:"top",distance:l}),c<=n&&this.everMovedDown&&s.canScrollDown()&&(!r||r.distance>c)&&(r={scrollCache:s,name:"bottom",distance:c}),o<=n&&this.everMovedLeft&&s.canScrollLeft()&&(!r||r.distance>o)&&(r={scrollCache:s,name:"left",distance:o}),a<=n&&this.everMovedRight&&s.canScrollRight()&&(!r||r.distance>a)&&(r={scrollCache:s,name:"right",distance:a}))}return r}buildCaches(e){return this.queryScrollEls(e).map(e=>e===window?new Ua(!1):new za(e,!1))}queryScrollEls(e){let t=[];for(let n of this.scrollQuery)"object"==typeof n?t.push(n):t.push(...Array.prototype.slice.call(e.getRootNode().querySelectorAll(n)));return t}}class Fa extends ms{constructor(e,t){super(e),this.containerEl=e,this.delay=null,this.minDistance=0,this.touchScrollAllowed=!0,this.mirrorNeedsRevert=!1,this.isInteracting=!1,this.isDragging=!1,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.delayTimeoutId=null,this.onPointerDown=e=>{this.isDragging||(this.isInteracting=!0,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,Je(document.body),et(document.body),e.isTouch||e.origEvent.preventDefault(),this.emitter.trigger("pointerdown",e),this.isInteracting&&!this.pointer.shouldIgnoreMove&&(this.mirror.setIsVisible(!1),this.mirror.start(e.subjectEl,e.pageX,e.pageY),this.startDelay(e),this.minDistance||this.handleDistanceSurpassed(e)))},this.onPointerMove=e=>{if(this.isInteracting){if(this.emitter.trigger("pointermove",e),!this.isDistanceSurpassed){let t,n=this.minDistance,{deltaX:r,deltaY:i}=e;t=r*r+i*i,t>=n*n&&this.handleDistanceSurpassed(e)}this.isDragging&&("scroll"!==e.origEvent.type&&(this.mirror.handleMove(e.pageX,e.pageY),this.autoScroller.handleMove(e.pageX,e.pageY)),this.emitter.trigger("dragmove",e))}},this.onPointerUp=e=>{this.isInteracting&&(this.isInteracting=!1,Ke(document.body),tt(document.body),this.emitter.trigger("pointerup",e),this.isDragging&&(this.autoScroller.stop(),this.tryStopDrag(e)),this.delayTimeoutId&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=null))};let n=this.pointer=new Pa(e);n.emitter.on("pointerdown",this.onPointerDown),n.emitter.on("pointermove",this.onPointerMove),n.emitter.on("pointerup",this.onPointerUp),t&&(n.selector=t),this.mirror=new Ba,this.autoScroller=new La}destroy(){this.pointer.destroy(),this.onPointerUp({})}startDelay(e){"number"==typeof this.delay?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=null,this.handleDelayEnd(e)},this.delay):this.handleDelayEnd(e)}handleDelayEnd(e){this.isDelayEnded=!0,this.tryStartDrag(e)}handleDistanceSurpassed(e){this.isDistanceSurpassed=!0,this.tryStartDrag(e)}tryStartDrag(e){this.isDelayEnded&&this.isDistanceSurpassed&&(this.pointer.wasTouchScroll&&!this.touchScrollAllowed||(this.isDragging=!0,this.mirrorNeedsRevert=!1,this.autoScroller.start(e.pageX,e.pageY,this.containerEl),this.emitter.trigger("dragstart",e),!1===this.touchScrollAllowed&&this.pointer.cancelTouchScroll()))}tryStopDrag(e){this.mirror.stop(this.mirrorNeedsRevert,this.stopDrag.bind(this,e))}stopDrag(e){this.isDragging=!1,this.emitter.trigger("dragend",e)}setIgnoreMove(e){this.pointer.shouldIgnoreMove=e}setMirrorIsVisible(e){this.mirror.setIsVisible(e)}setMirrorNeedsRevert(e){this.mirrorNeedsRevert=e}setAutoScrollEnabled(e){this.autoScroller.isEnabled=e}}class Va{constructor(e){this.origRect=ts(e),this.scrollCaches=ns(e).map(e=>new za(e,!0))}destroy(){for(let e of this.scrollCaches)e.destroy()}computeLeft(){let e=this.origRect.left;for(let t of this.scrollCaches)e+=t.origScrollLeft-t.getScrollLeft();return e}computeTop(){let e=this.origRect.top;for(let t of this.scrollCaches)e+=t.origScrollTop-t.getScrollTop();return e}isWithinClipping(e,t){let n={left:e,top:t};for(let e of this.scrollCaches)if(!Ga(e.getEventTarget())&&!Pi(n,e.clientRect))return!1;return!0}}function Ga(e){let t=e.tagName;return"HTML"===t||"BODY"===t}class Qa{constructor(e,t){this.useSubjectCenter=!1,this.requireInitial=!0,this.initialHit=null,this.movingHit=null,this.finalHit=null,this.handlePointerDown=e=>{let{dragging:t}=this;this.initialHit=null,this.movingHit=null,this.finalHit=null,this.prepareHits(),this.processFirstCoord(e),this.initialHit||!this.requireInitial?(t.setIgnoreMove(!1),this.emitter.trigger("pointerdown",e)):t.setIgnoreMove(!0)},this.handleDragStart=e=>{this.emitter.trigger("dragstart",e),this.handleMove(e,!0)},this.handleDragMove=e=>{this.emitter.trigger("dragmove",e),this.handleMove(e)},this.handlePointerUp=e=>{this.releaseHits(),this.emitter.trigger("pointerup",e)},this.handleDragEnd=e=>{this.movingHit&&this.emitter.trigger("hitupdate",null,!0,e),this.finalHit=this.movingHit,this.movingHit=null,this.emitter.trigger("dragend",e)},this.droppableStore=t,e.emitter.on("pointerdown",this.handlePointerDown),e.emitter.on("dragstart",this.handleDragStart),e.emitter.on("dragmove",this.handleDragMove),e.emitter.on("pointerup",this.handlePointerUp),e.emitter.on("dragend",this.handleDragEnd),this.dragging=e,this.emitter=new Gr}processFirstCoord(e){let t,n={left:e.pageX,top:e.pageY},r=n,i=e.subjectEl;i instanceof HTMLElement&&(t=ts(i),r=Bi(r,t));let s=this.initialHit=this.queryHitForOffset(r.left,r.top);if(s){if(this.useSubjectCenter&&t){let e=Hi(t,s.rect);e&&(r=ji(e))}this.coordAdjust=zi(r,n)}else this.coordAdjust={left:0,top:0}}handleMove(e,t){let n=this.queryHitForOffset(e.pageX+this.coordAdjust.left,e.pageY+this.coordAdjust.top);!t&&qa(this.movingHit,n)||(this.movingHit=n,this.emitter.trigger("hitupdate",n,!1,e))}prepareHits(){this.offsetTrackers=An(this.droppableStore,e=>(e.component.prepareHits(),new Va(e.el)))}releaseHits(){let{offsetTrackers:e}=this;for(let t in e)e[t].destroy();this.offsetTrackers={}}queryHitForOffset(e,t){let{droppableStore:n,offsetTrackers:r}=this,i=null;for(let s in n){let o=n[s].component,a=r[s];if(a&&a.isWithinClipping(e,t)){let n=a.computeLeft(),r=a.computeTop(),l=e-n,c=t-r,{origRect:d}=a,u=d.right-d.left,h=d.bottom-d.top;if(l>=0&&l<u&&c>=0&&c<h){let e=o.queryHit(l,c,u,h);e&&ar(e.dateProfile.activeRange,e.dateSpan.range)&&(!i||e.layer>i.layer)&&(e.componentId=s,e.context=o.context,e.rect.left+=n,e.rect.right+=n,e.rect.top+=r,e.rect.bottom+=r,i=e)}}}return i}}function qa(e,t){return!e&&!t||Boolean(e)===Boolean(t)&&Ai(e.dateSpan,t.dateSpan)}function Ya(e,t){let n={};for(let r of t.pluginHooks.datePointTransforms)Object.assign(n,r(e,t));var r,i;return Object.assign(n,(r=e,{date:(i=t.dateEnv).toDate(r.range.start),dateStr:i.formatIso(r.range.start,{omitTime:r.allDay}),allDay:r.allDay})),n}class Za extends Mi{constructor(e){super(e),this.subjectEl=null,this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=e=>{let t=e.origEvent.target,{component:n,dragging:r}=this,{mirror:i}=r,{options:s}=n.context,o=n.context;this.subjectEl=e.subjectEl;let a=this.subjectSeg=ai(e.subjectEl),l=(this.eventRange=a.eventRange).instance.instanceId;this.relevantEvents=xr(o.getCurrentData().eventStore,l),r.minDistance=e.isTouch?0:s.eventDragMinDistance,r.delay=e.isTouch&&l!==n.props.eventSelection?function(e){let{options:t}=e.context,n=t.eventLongPressDelay;null==n&&(n=t.longPressDelay);return n}(n):null,s.fixedMirrorParent?i.parentNode=s.fixedMirrorParent:i.parentNode=Oe(t,".fc"),i.revertDuration=s.dragRevertDuration;let c=n.isValidSegDownEl(t)&&!Oe(t,".fc-event-resizer");r.setIgnoreMove(!c),this.isDragging=c&&e.subjectEl.classList.contains("fc-event-draggable")},this.handleDragStart=e=>{let t=this.component.context,n=this.eventRange,r=n.instance.instanceId;e.isTouch?r!==this.component.props.eventSelection&&t.dispatch({type:"SELECT_EVENT",eventInstanceId:r}):t.dispatch({type:"UNSELECT_EVENT"}),this.isDragging&&(t.calendarApi.unselect(e),t.emitter.trigger("eventDragStart",{el:this.subjectEl,event:new ti(t,n.def,n.instance),jsEvent:e.origEvent,view:t.viewApi}))},this.handleHitUpdate=(e,t)=>{if(!this.isDragging)return;let n=this.relevantEvents,r=this.hitDragging.initialHit,i=this.component.context,s=null,o=null,a=null,l=!1,c={affectedEvents:n,mutatedEvents:{defs:{},instances:{}},isEvent:!0};if(e){s=e.context;let t=s.options;i===s||t.editable&&t.droppable?(o=function(e,t,n){let r=e.dateSpan,i=t.dateSpan,s=r.range.start,o=i.range.start,a={};r.allDay!==i.allDay&&(a.allDay=i.allDay,a.hasEnd=t.context.options.allDayMaintainDuration,i.allDay&&(s=Mt(s)));let l=hr(s,o,e.context.dateEnv,e.componentId===t.componentId?e.largeUnit:null);l.milliseconds&&(a.allDay=!1);let c={datesDelta:l,standardProps:a};for(let r of n)r(c,e,t);return c}(r,e,s.getCurrentData().pluginHooks.eventDragMutationMassagers),o&&(a=$r(n,s.getCurrentData().eventUiBases,o,s),c.mutatedEvents=a,Ns(c,e.dateProfile,s)||(l=!0,o=null,a=null,c.mutatedEvents={defs:{},instances:{}}))):s=null}this.displayDrag(s,c),l?Xe():$e(),t||(i===s&&qa(r,e)&&(o=null),this.dragging.setMirrorNeedsRevert(!o),this.dragging.setMirrorIsVisible(!e||!this.subjectEl.getRootNode().querySelector(".fc-event-mirror")),this.receivingContext=s,this.validMutation=o,this.mutatedRelevantEvents=a)},this.handlePointerUp=()=>{this.isDragging||this.cleanup()},this.handleDragEnd=e=>{if(this.isDragging){let t=this.component.context,n=t.viewApi,{receivingContext:r,validMutation:i}=this,s=this.eventRange.def,o=this.eventRange.instance,a=new ti(t,s,o),l=this.relevantEvents,c=this.mutatedRelevantEvents,{finalHit:d}=this.hitDragging;if(this.clearDrag(),t.emitter.trigger("eventDragStop",{el:this.subjectEl,event:a,jsEvent:e.origEvent,view:n}),i){if(r===t){let r=new ti(t,c.defs[s.defId],o?c.instances[o.instanceId]:null);t.dispatch({type:"MERGE_EVENTS",eventStore:c});let d={oldEvent:a,event:r,relatedEvents:ri(c,t,o),revert(){t.dispatch({type:"MERGE_EVENTS",eventStore:l})}},u={};for(let e of t.getCurrentData().pluginHooks.eventDropTransformers)Object.assign(u,e(i,t));t.emitter.trigger("eventDrop",Object.assign(Object.assign(Object.assign({},d),u),{el:e.subjectEl,delta:i.datesDelta,jsEvent:e.origEvent,view:n})),t.emitter.trigger("eventChange",d)}else if(r){let i={event:a,relatedEvents:ri(l,t,o),revert(){t.dispatch({type:"MERGE_EVENTS",eventStore:l})}};t.emitter.trigger("eventLeave",Object.assign(Object.assign({},i),{draggedEl:e.subjectEl,view:n})),t.dispatch({type:"REMOVE_EVENTS",eventStore:l}),t.emitter.trigger("eventRemove",i);let u=c.defs[s.defId],h=c.instances[o.instanceId],f=new ti(r,u,h);r.dispatch({type:"MERGE_EVENTS",eventStore:c});let g={event:f,relatedEvents:ri(c,r,h),revert(){r.dispatch({type:"REMOVE_EVENTS",eventStore:c})}};r.emitter.trigger("eventAdd",g),e.isTouch&&r.dispatch({type:"SELECT_EVENT",eventInstanceId:o.instanceId}),r.emitter.trigger("drop",Object.assign(Object.assign({},Ya(d.dateSpan,r)),{draggedEl:e.subjectEl,jsEvent:e.origEvent,view:d.context.viewApi})),r.emitter.trigger("eventReceive",Object.assign(Object.assign({},g),{draggedEl:e.subjectEl,view:d.context.viewApi}))}}else t.emitter.trigger("_noEventDrop")}this.cleanup()};let{component:t}=this,{options:n}=t.context,r=this.dragging=new Fa(e.el);r.pointer.selector=Za.SELECTOR,r.touchScrollAllowed=!1,r.autoScroller.isEnabled=n.dragScroll;let i=this.hitDragging=new Qa(this.dragging,Oi);i.useSubjectCenter=e.useEventCenter,i.emitter.on("pointerdown",this.handlePointerDown),i.emitter.on("dragstart",this.handleDragStart),i.emitter.on("hitupdate",this.handleHitUpdate),i.emitter.on("pointerup",this.handlePointerUp),i.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}displayDrag(e,t){let n=this.component.context,r=this.receivingContext;r&&r!==e&&(r===n?r.dispatch({type:"SET_EVENT_DRAG",state:{affectedEvents:t.affectedEvents,mutatedEvents:{defs:{},instances:{}},isEvent:!0}}):r.dispatch({type:"UNSET_EVENT_DRAG"})),e&&e.dispatch({type:"SET_EVENT_DRAG",state:t})}clearDrag(){let e=this.component.context,{receivingContext:t}=this;t&&t.dispatch({type:"UNSET_EVENT_DRAG"}),e!==t&&e.dispatch({type:"UNSET_EVENT_DRAG"})}cleanup(){this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null}}Za.SELECTOR=".fc-event-draggable, .fc-event-resizable";const Xa={fixedMirrorParent:yn},$a={dateClick:yn,eventDragStart:yn,eventDragStop:yn,eventDrop:yn,eventResizeStart:yn,eventResizeStop:yn,eventResize:yn,drop:yn,eventReceive:yn,eventLeave:yn};class Ja{constructor(e,t){this.receivingContext=null,this.droppableEvent=null,this.suppliedDragMeta=null,this.dragMeta=null,this.handleDragStart=e=>{this.dragMeta=this.buildDragMeta(e.subjectEl)},this.handleHitUpdate=(e,t,n)=>{let{dragging:r}=this.hitDragging,i=null,s=null,o=!1,a={affectedEvents:{defs:{},instances:{}},mutatedEvents:{defs:{},instances:{}},isEvent:this.dragMeta.create};e&&(i=e.context,this.canDropElOnCalendar(n.subjectEl,i)&&(s=function(e,t,n){let r=Object.assign({},t.leftoverProps);for(let i of n.pluginHooks.externalDefTransforms)Object.assign(r,i(e,t));let{refined:i,extra:s}=Ar(r,n),o=wr(i,s,t.sourceId,e.allDay,n.options.forceEventDuration||Boolean(t.duration),n),a=e.range.start;e.allDay&&t.startTime&&(a=n.dateEnv.add(a,t.startTime));let l=t.duration?n.dateEnv.add(a,t.duration):Xr(e.allDay,a,n),c=pr(o.defId,{start:a,end:l});return{def:o,instance:c}}(e.dateSpan,this.dragMeta,i),a.mutatedEvents=Rr(s),o=!Ns(a,e.dateProfile,i),o&&(a.mutatedEvents={defs:{},instances:{}},s=null))),this.displayDrag(i,a),r.setMirrorIsVisible(t||!s||!document.querySelector(".fc-event-mirror")),o?Xe():$e(),t||(r.setMirrorNeedsRevert(!s),this.receivingContext=i,this.droppableEvent=s)},this.handleDragEnd=e=>{let{receivingContext:t,droppableEvent:n}=this;if(this.clearDrag(),t&&n){let r=this.hitDragging.finalHit,i=r.context.viewApi,s=this.dragMeta;if(t.emitter.trigger("drop",Object.assign(Object.assign({},Ya(r.dateSpan,t)),{draggedEl:e.subjectEl,jsEvent:e.origEvent,view:i})),s.create){let r=Rr(n);t.dispatch({type:"MERGE_EVENTS",eventStore:r}),e.isTouch&&t.dispatch({type:"SELECT_EVENT",eventInstanceId:n.instance.instanceId}),t.emitter.trigger("eventReceive",{event:new ti(t,n.def,n.instance),relatedEvents:[],revert(){t.dispatch({type:"REMOVE_EVENTS",eventStore:r})},draggedEl:e.subjectEl,view:i})}}this.receivingContext=null,this.droppableEvent=null};let n=this.hitDragging=new Qa(e,Oi);n.requireInitial=!1,n.emitter.on("dragstart",this.handleDragStart),n.emitter.on("hitupdate",this.handleHitUpdate),n.emitter.on("dragend",this.handleDragEnd),this.suppliedDragMeta=t}buildDragMeta(e){return"object"==typeof this.suppliedDragMeta?bs(this.suppliedDragMeta):"function"==typeof this.suppliedDragMeta?bs(this.suppliedDragMeta(e)):function(e){let t=function(e,t){let n=vs.dataAttrPrefix,r=(n?n+"-":"")+t;return e.getAttribute("data-"+r)||""}(e,"event");return bs(t?JSON.parse(t):{create:!1})}(e)}displayDrag(e,t){let n=this.receivingContext;n&&n!==e&&n.dispatch({type:"UNSET_EVENT_DRAG"}),e&&e.dispatch({type:"SET_EVENT_DRAG",state:t})}clearDrag(){this.receivingContext&&this.receivingContext.dispatch({type:"UNSET_EVENT_DRAG"})}canDropElOnCalendar(e,t){let n=t.options.dropAccept;return"function"==typeof n?n.call(t.calendarApi,e):"string"!=typeof n||!n||Boolean(Ne(e,n))}}vs.dataAttrPrefix="";class Ka extends ms{constructor(e){super(e),this.shouldIgnoreMove=!1,this.mirrorSelector="",this.currentMirrorEl=null,this.handlePointerDown=e=>{this.emitter.trigger("pointerdown",e),this.shouldIgnoreMove||this.emitter.trigger("dragstart",e)},this.handlePointerMove=e=>{this.shouldIgnoreMove||this.emitter.trigger("dragmove",e)},this.handlePointerUp=e=>{this.emitter.trigger("pointerup",e),this.shouldIgnoreMove||this.emitter.trigger("dragend",e)};let t=this.pointer=new Pa(e);t.emitter.on("pointerdown",this.handlePointerDown),t.emitter.on("pointermove",this.handlePointerMove),t.emitter.on("pointerup",this.handlePointerUp)}destroy(){this.pointer.destroy()}setIgnoreMove(e){this.shouldIgnoreMove=e}setMirrorIsVisible(e){if(e)this.currentMirrorEl&&(this.currentMirrorEl.style.visibility="",this.currentMirrorEl=null);else{let e=this.mirrorSelector?document.querySelector(this.mirrorSelector):null;e&&(this.currentMirrorEl=e,e.style.visibility="hidden")}}}var el=Po({name:"@fullcalendar/interaction",componentInteractions:[class extends Mi{constructor(e){super(e),this.handlePointerDown=e=>{let{dragging:t}=this,n=e.origEvent.target;t.setIgnoreMove(!this.component.isValidDateDownEl(n))},this.handleDragEnd=e=>{let{component:t}=this,{pointer:n}=this.dragging;if(!n.wasTouchScroll){let{initialHit:n,finalHit:r}=this.hitDragging;if(n&&r&&qa(n,r)){let{context:r}=t,i=Object.assign(Object.assign({},Ya(n.dateSpan,r)),{dayEl:n.dayEl,jsEvent:e.origEvent,view:r.viewApi||r.calendarApi.view});r.emitter.trigger("dateClick",i)}}},this.dragging=new Fa(e.el),this.dragging.autoScroller.isEnabled=!1;let t=this.hitDragging=new Qa(this.dragging,Ii(e));t.emitter.on("pointerdown",this.handlePointerDown),t.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}},class extends Mi{constructor(e){super(e),this.dragSelection=null,this.handlePointerDown=e=>{let{component:t,dragging:n}=this,{options:r}=t.context,i=r.selectable&&t.isValidDateDownEl(e.origEvent.target);n.setIgnoreMove(!i),n.delay=e.isTouch?function(e){let{options:t}=e.context,n=t.selectLongPressDelay;null==n&&(n=t.longPressDelay);return n}(t):null},this.handleDragStart=e=>{this.component.context.calendarApi.unselect(e)},this.handleHitUpdate=(e,t)=>{let{context:n}=this.component,r=null,i=!1;if(e){let t=this.hitDragging.initialHit;e.componentId===t.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(t,e)||(r=function(e,t,n){let r=e.dateSpan,i=t.dateSpan,s=[r.range.start,r.range.end,i.range.start,i.range.end];s.sort(lt);let o={};for(let r of n){let n=r(e,t);if(!1===n)return null;n&&Object.assign(o,n)}return o.range={start:s[0],end:s[3]},o.allDay=r.allDay,o}(t,e,n.pluginHooks.dateSelectionTransformers)),r&&Ps(r,e.dateProfile,n)||(i=!0,r=null)}r?n.dispatch({type:"SELECT_DATES",selection:r}):t||n.dispatch({type:"UNSELECT_DATES"}),i?Xe():$e(),t||(this.dragSelection=r)},this.handlePointerUp=e=>{this.dragSelection&&(Yr(this.dragSelection,e,this.component.context),this.dragSelection=null)};let{component:t}=e,{options:n}=t.context,r=this.dragging=new Fa(e.el);r.touchScrollAllowed=!1,r.minDistance=n.selectMinDistance||0,r.autoScroller.isEnabled=n.dragScroll;let i=this.hitDragging=new Qa(this.dragging,Ii(e));i.emitter.on("pointerdown",this.handlePointerDown),i.emitter.on("dragstart",this.handleDragStart),i.emitter.on("hitupdate",this.handleHitUpdate),i.emitter.on("pointerup",this.handlePointerUp)}destroy(){this.dragging.destroy()}},Za,class extends Mi{constructor(e){super(e),this.draggingSegEl=null,this.draggingSeg=null,this.eventRange=null,this.relevantEvents=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=e=>{let{component:t}=this,n=ai(this.querySegEl(e)),r=this.eventRange=n.eventRange;this.dragging.minDistance=t.context.options.eventDragMinDistance,this.dragging.setIgnoreMove(!this.component.isValidSegDownEl(e.origEvent.target)||e.isTouch&&this.component.props.eventSelection!==r.instance.instanceId)},this.handleDragStart=e=>{let{context:t}=this.component,n=this.eventRange;this.relevantEvents=xr(t.getCurrentData().eventStore,this.eventRange.instance.instanceId);let r=this.querySegEl(e);this.draggingSegEl=r,this.draggingSeg=ai(r),t.calendarApi.unselect(),t.emitter.trigger("eventResizeStart",{el:r,event:new ti(t,n.def,n.instance),jsEvent:e.origEvent,view:t.viewApi})},this.handleHitUpdate=(e,t,n)=>{let{context:r}=this.component,i=this.relevantEvents,s=this.hitDragging.initialHit,o=this.eventRange.instance,a=null,l=null,c=!1,d={affectedEvents:i,mutatedEvents:{defs:{},instances:{}},isEvent:!0};if(e){e.componentId===s.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(s,e)||(a=function(e,t,n,r){let i=e.context.dateEnv,s=e.dateSpan.range.start,o=t.dateSpan.range.start,a=hr(s,o,i,e.largeUnit);if(n){if(i.add(r.start,a)<r.end)return{startDelta:a}}else if(i.add(r.end,a)>r.start)return{endDelta:a};return null}(s,e,n.subjectEl.classList.contains("fc-event-resizer-start"),o.range))}a&&(l=$r(i,r.getCurrentData().eventUiBases,a,r),d.mutatedEvents=l,Ns(d,e.dateProfile,r)||(c=!0,a=null,l=null,d.mutatedEvents=null)),l?r.dispatch({type:"SET_EVENT_RESIZE",state:d}):r.dispatch({type:"UNSET_EVENT_RESIZE"}),c?Xe():$e(),t||(a&&qa(s,e)&&(a=null),this.validMutation=a,this.mutatedRelevantEvents=l)},this.handleDragEnd=e=>{let{context:t}=this.component,n=this.eventRange.def,r=this.eventRange.instance,i=new ti(t,n,r),s=this.relevantEvents,o=this.mutatedRelevantEvents;if(t.emitter.trigger("eventResizeStop",{el:this.draggingSegEl,event:i,jsEvent:e.origEvent,view:t.viewApi}),this.validMutation){let a=new ti(t,o.defs[n.defId],r?o.instances[r.instanceId]:null);t.dispatch({type:"MERGE_EVENTS",eventStore:o});let l={oldEvent:i,event:a,relatedEvents:ri(o,t,r),revert(){t.dispatch({type:"MERGE_EVENTS",eventStore:s})}};t.emitter.trigger("eventResize",Object.assign(Object.assign({},l),{el:this.draggingSegEl,startDelta:this.validMutation.startDelta||ft(0),endDelta:this.validMutation.endDelta||ft(0),jsEvent:e.origEvent,view:t.viewApi})),t.emitter.trigger("eventChange",l)}else t.emitter.trigger("_noEventResize");this.draggingSeg=null,this.relevantEvents=null,this.validMutation=null};let{component:t}=e,n=this.dragging=new Fa(e.el);n.pointer.selector=".fc-event-resizer",n.touchScrollAllowed=!1,n.autoScroller.isEnabled=t.context.options.dragScroll;let r=this.hitDragging=new Qa(this.dragging,Ii(e));r.emitter.on("pointerdown",this.handlePointerDown),r.emitter.on("dragstart",this.handleDragStart),r.emitter.on("hitupdate",this.handleHitUpdate),r.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}querySegEl(e){return Oe(e.subjectEl,".fc-event")}}],calendarInteractions:[class{constructor(e){this.context=e,this.isRecentPointerDateSelect=!1,this.matchesCancel=!1,this.matchesEvent=!1,this.onSelect=e=>{e.jsEvent&&(this.isRecentPointerDateSelect=!0)},this.onDocumentPointerDown=e=>{let t=this.context.options.unselectCancel,n=ze(e.origEvent);this.matchesCancel=!!Oe(n,t),this.matchesEvent=!!Oe(n,Za.SELECTOR)},this.onDocumentPointerUp=e=>{let{context:t}=this,{documentPointer:n}=this,r=t.getCurrentData();if(!n.wasTouchScroll){if(r.dateSelection&&!this.isRecentPointerDateSelect){let n=t.options.unselectAuto;!n||n&&this.matchesCancel||t.calendarApi.unselect(e)}r.eventSelection&&!this.matchesEvent&&t.dispatch({type:"UNSELECT_EVENT"})}this.isRecentPointerDateSelect=!1};let t=this.documentPointer=new Pa(document);t.shouldIgnoreMove=!0,t.shouldWatchScroll=!1,t.emitter.on("pointerdown",this.onDocumentPointerDown),t.emitter.on("pointerup",this.onDocumentPointerUp),e.emitter.on("select",this.onSelect)}destroy(){this.context.emitter.off("select",this.onSelect),this.documentPointer.destroy()}}],elementDraggingImpl:Fa,optionRefiners:Xa,listenerRefiners:$a});function tl(e,t){let n=[];for(let e=0;e<t;e+=1)n[e]=[];for(let t of e)n[t.row].push(t);return n}function nl(e,t){let n=[];for(let e=0;e<t;e+=1)n[e]=[];for(let t of e)n[t.firstCol].push(t);return n}function rl(e,t){let n=[];if(e){for(let r=0;r<t;r+=1)n[r]={affectedInstances:e.affectedInstances,isEvent:e.isEvent,segs:[]};for(let t of e.segs)n[t.row].segs.push(t)}else for(let e=0;e<t;e+=1)n[e]=null;return n}xe(':root{--fc-daygrid-event-dot-width:8px}.fc-daygrid-day-events:after,.fc-daygrid-day-events:before,.fc-daygrid-day-frame:after,.fc-daygrid-day-frame:before,.fc-daygri
778d-event-harness:after,.fc-daygrid-event-harness:before{clear:both;content:"";display:table}.fc .fc-daygrid-body{position:relative;z-index:1}.fc .fc-daygrid-day.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-daygrid-day-frame{min-height:100%;position:relative}.fc .fc-daygrid-day-top{display:flex;flex-direction:row-reverse}.fc .fc-day-other .fc-daygrid-day-top{opacity:.3}.fc .fc-daygrid-day-number{padding:4px;position:relative;z-index:4}.fc .fc-daygrid-month-start{font-size:1.1em;font-weight:700}.fc .fc-daygrid-day-events{margin-top:1px}.fc .fc-daygrid-body-balanced .fc-daygrid-day-events{left:0;position:absolute;right:0}.fc .fc-daygrid-body-unbalanced .fc-daygrid-day-events{min-height:2em;position:relative}.fc .fc-daygrid-body-natural .fc-daygrid-day-events{margin-bottom:1em}.fc .fc-daygrid-event-harness{position:relative}.fc .fc-daygrid-event-harness-abs{left:0;position:absolute;right:0;top:0}.fc .fc-daygrid-bg-harness{bottom:0;position:absolute;top:0}.fc .fc-daygrid-day-bg .fc-non-business{z-index:1}.fc .fc-daygrid-day-bg .fc-bg-event{z-index:2}.fc .fc-daygrid-day-bg .fc-highlight{z-index:3}.fc .fc-daygrid-event{margin-top:1px;z-index:6}.fc .fc-daygrid-event.fc-event-mirror{z-index:7}.fc .fc-daygrid-day-bottom{font-size:.85em;margin:0 2px}.fc .fc-daygrid-day-bottom:after,.fc .fc-daygrid-day-bottom:before{clear:both;content:"";display:table}.fc .fc-daygrid-more-link{border-radius:3px;cursor:pointer;line-height:1;margin-top:1px;max-width:100%;overflow:hidden;padding:2px;position:relative;white-space:nowrap;z-index:4}.fc .fc-daygrid-more-link:hover{background-color:rgba(0,0,0,.1)}.fc .fc-daygrid-week-number{background-color:var(--fc-neutral-bg-color);color:var(--fc-neutral-text-color);min-width:1.5em;padding:2px;position:absolute;text-align:center;top:0;z-index:5}.fc .fc-more-popover .fc-popover-body{min-width:220px;padding:10px}.fc-direction-ltr .fc-daygrid-event.fc-event-start,.fc-direction-rtl .fc-daygrid-event.fc-event-end{margin-left:2px}.fc-direction-ltr .fc-daygrid-event.fc-event-end,.fc-direction-rtl .fc-daygrid-event.fc-event-start{margin-right:2px}.fc-direction-ltr .fc-daygrid-more-link{float:left}.fc-direction-ltr .fc-daygrid-week-number{border-radius:0 0 3px 0;left:0}.fc-direction-rtl .fc-daygrid-more-link{float:right}.fc-direction-rtl .fc-daygrid-week-number{border-radius:0 0 0 3px;right:0}
778.fc-liquid-hack .fc-daygrid-day-frame{position:static}.fc-daygrid-event{border-radius:3px;font-size:var(--fc-small-font-size);position:relative;white-space:nowrap}.fc-daygrid-block-event .fc-event-time{font-weight:700}.fc-daygrid-block-event .fc-event-time,.fc-daygrid-block-event .fc-event-title{padding:1px}.fc-daygrid-dot-event{align-items:center;display:flex;padding:2px 0}.fc-daygrid-dot-event .fc-event-title{flex-grow:1;flex-shrink:1;font-weight:700;min-width:0;overflow:hidden}.fc-daygrid-dot-event.fc-event-mirror,.fc-daygrid-dot-event:hover{background:rgba(0,0,0,.1)}.fc-daygrid-dot-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-daygrid-event-dot{border:calc(var(--fc-daygrid-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-daygrid-event-dot-width)/2);box-sizing:content-box;height:0;margin:0 4px;width:0}.fc-direction-ltr .fc-daygrid-event .fc-event-time{margin-right:3px}.fc-direction-rtl .fc-daygrid-event .fc-event-time{margin-left:3px}');const il=an({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"});function sl(e){let{display:t}=e.eventRange.ui;return"list-item"===t||"auto"===t&&!e.eventRange.def.allDay&&e.firstCol===e.lastCol&&e.isStart&&e.isEnd}class ol extends Gn{render(){let{props:e}=this;return p(oo,Object.assign({}
vendor: 2,539 bytes, line 778
778,e,{elClasses:["fc-daygrid-event","fc-daygrid-block-event","fc-h-event"],defaultTimeFormat:il,defaultDisplayEventEnd:e.defaultDisplayEventEnd,disableResizing:!e.seg.eventRange.def.allDay}))}}class al extends Gn{render(){let{props:e,context:t}=this,{options:n}=t,{seg:r}=e,i=pi(r,n.eventTimeFormat||il,t,!0,e.defaultDisplayEventEnd);return p(so,Object.assign({},e,{elTag:"a",elClasses:["fc-daygrid-event","fc-daygrid-dot-event"],elAttrs:bi(e.seg,t),defaultGenerator:ll,timeText:i,isResizing:!1,isDateSelecting:!1}))}}function ll(e){return p(y,null,p("div",{className:"fc-daygrid-event-dot",style:{borderColor:e.borderColor||e.backgroundColor}}),e.timeText&&p("div",{className:"fc-event-time"},e.timeText),p("div",{className:"fc-event-title"},e.event.title||p(y,null," ")))}class cl extends Gn{constructor(){super(...arguments),this.compileSegs=Gt(dl)}render(){let{props:e}=this,{allSegs:t,invisibleSegs:n}=this.compileSegs(e.singlePlacements);return p(So,{elClasses:["fc-daygrid-more-link"],dateProfile:e.dateProfile,todayRange:e.todayRange,allDayDate:e.allDayDate,moreCnt:e.moreCnt,allSegs:t,hiddenSegs:n,alignmentElRef:e.alignmentElRef,alignGridTop:e.alignGridTop,extraDateSpan:e.extraDateSpan,popoverContent:()=>{let n=(e.eventDrag?e.eventDrag.affectedInstances:null)||(e.eventResize?e.eventResize.affectedInstances:null)||{};return p(y,null,t.map(t=>{let r=t.eventRange.instance.instanceId;return p("div",{className:"fc-daygrid-event-harness",key:r,style:{visibility:n[r]?"hidden":""}},sl(t)?p(al,Object.assign({seg:t,isDragging:!1,isSelected:r===e.eventSelection,defaultDisplayEventEnd:!1},mi(t,e.todayRange))):p(ol,Object.assign({seg:t,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:r===e.eventSelection,defaultDisplayEventEnd:!1},mi(t,e.todayRange))))}))}})}}function dl(e){let t=[],n=[];for(let r of e)t.push(r.seg),r.isVisible||n.push(r.seg);return{allSegs:t,invisibleSegs:n}}const ul=an({week:"narrow"});class hl extends ls{constructor(){super(...arguments),this.rootElRef={current:null},this.state={dayNumberId:We()},this.handleRootEl=e=>{Qn(this.rootElRef,e),Qn(this.props.elRef,e)}}render(){let{context:e,props:t,state:n,rootElRef:r}=this,{options:i,dateEnv:s}=e,{date:o,dateProfile:a}=t;const l=t.showDayNumber&&function(e,t,n){const{start:r,end:i}=t,s=Ct(i,-1),o=n.getYear(r),a=n.getMonth(r),l=n.getYear(s),c=n.getMonth(s);return!(o===l&&a===c)&&Boolean(e.valueOf()===r.valueOf()||1===n.getDay(e)&&e.valueOf()<i.valueOf())}(o,a.currentRange,s);return p(uo,{elTag:"td",elRef:this.handleRootEl,elClasses:["fc-daygri
778d-day",...t.extraClassNames||[]],elAttrs:Object.assign(Object.assign(Object.assign({},t.extraDataAttrs),t.showDayNumber?{"aria-labelledby":n.dayNumberId}:{}),{role:"gridcell"}),defaultGenerator:fl,date:o,dateProfile:a,todayRange:t.todayRange,showDayNumber:t.showDayNumber,isMonthStart:l,extraRenderProps:t.extraRenderProps},(s,a)=>p("div",{ref:t.innerElRef,className:"fc-daygrid-day-frame fc-scrollgrid-sync-inner",style:{minHeight:t.minHeight}},t.showWeekNumber&&p(vo,{elTag:"a",elClasses:["fc-daygrid-week-number"],elAttrs:qi(e,o,"week"),date:o,defaultFormat:ul}),!a.isDisabled&&(t.showDayNumber||ho(i)||t.forceDayTop)?p("div",{className:"fc-daygrid-day-top"},p(s,{elTag:"a",elClasses:["fc-daygrid-day-number",l&&"fc-daygrid-month-start"],elAttrs:Object.assign(Object.assign({},qi(e,o)),{id:n.dayNumberId})})):t.showDayNumber?p("div",{className:"fc-daygrid-day-top",style:{visibility:"hidden"}},p("a",{className:"fc-daygrid-day-number"}," ")):void 0,p("div",{className:"fc-daygrid-day-events",ref:t.fgContentElRef},t.fgContent,p("div",{className:"fc-daygrid-day-bottom",style:{marginTop:t.moreMarginTop}},p(cl,{allDayDate:o,singlePlacements:t.singlePlacements,moreCnt:t.moreCnt,alignmentElRef:r,alignGridTop:!t.showDayNumber,extraDateSpan:t.extraDateSpan,dateProfile:t.dateProfile,eventSelection:t.eventSelection,eventDrag:t.eventDrag,eventResize:t.eventResize,todayRange:t.todayRange}))),p("div",{className:"fc-daygrid-day-bg"},t.bgContent)))}}function fl(e){return e.dayNumberText||p(y,null," ")}function gl(e){return e.eventRange.instance.instanceId+":"+e.firstCol}function pl(e){return gl(e)+":"+e.lastCol}function ml(e,t,n,r,i,s,o){let a=new yl(t=>{let n=e[t.index].eventRange.instance.instanceId+":"+t.span.start+":"+(t.span.end-1);return i[n]});a.allowReslicing=!0,a.strictOrder=r,!0===t||!0===n?(a.maxCoord=s,a.hiddenConsumes=!0):"number"==typeof t?a.maxStackCnt=t:"number"==typeof n&&(a.maxStackCnt=n,a.hiddenConsumes=!0);let l=[],c=[];for(let t=0;t<e.length;t+=1){let n=e[t],r=pl(n);null!=i[r]?l.push({index:t,span:{start:n.firstCol,end:n.lastCol+1}}):c.push(n)}let d=a.addSegs(l),u=a.toRects(),{singleColPlacements:h,multiColPlacements:f,leftoverMargins:g}=function(e,t,n){let r=function(e,t){let n=[];for(let e=0;e<t;e+=1)n.push([]);for(let t of e)for(let e=t.span.start;e<t.span.end;e+=1)n[e].push(t);return n}(e,n.length),i=[],s=[],o=[];for(let e=0;e<n.length;e+=1){let a=r[e],l=[],c=0,d=0;for(let r of a){let i=t[r.index];l.push({seg:vl(i,e,e+1,n),isVisible:!0,isAbsolute:!1,absoluteTop:r.levelCoord,marginTop:r.levelCoord-c}),c=r.levelCoord+r.thickness}let u=[];c=0,d=0;for(let r of a){let i=t[r.index],s=r.span.end-r.span.start>1,o=r.span.start===e;d+=r.levelCoord-c,c=r.levelCoord+r.thickness,s?(d+=r.thickness,o&&u.push({seg:vl(i,r.span.start,r.span.end,n),isVisible:!0,isAbsolute:!0,absoluteTop:r.levelCoord,marginTop:0})):o&&(u.push({seg:vl(i,r.span.start,r.span.end,n),isVisible:!0,isAbsolute:!1,absoluteTop:r.levelCoord,marginTop:d}),d=0)}i.push(l),s.push(u),o.push(d)}return{singleColPlacements:i,multiColPlacements:s,leftoverMargins:o}}(u,e,o),p=[],m=[];for(let e of c){f[e.firstCol].push({seg:e,isVisible:!1,isAbsolute:!0,absoluteTop:0,marginTop:0});for(let t=e.firstCol;t<=e.lastCol;t+=1)h[t].push({seg:vl(e,t,t+1,o),isVisible:!1,isAbsolute:!1,absoluteTop:0,marginTop:0})}for(let e=0;e<o.length;e+=1)p.push(0);for(let t of d){let n=e[t.index],r=t.span;f[r.start].push({seg:vl(n,r.start,r.end,o),isVisible:!1,isAbsolute:!0,absoluteTop:0,marginTop:0});for(let e=r.start;e<r.end;e+=1)p[e]+=1,h[e].push({seg:vl(n,e,e+1,o),isVisible:!1,isAbsolute:!1,absoluteTop:0,marginTop:0})}for(let e=0;e<o.length;e+=1)m.push(g[e]);return{singleColPlacements:h,multiColPlacements:f,moreCnts:p,moreMarginTops:m}}function vl(e,t,n,r){if(e.firstCol===t&&e.lastCol===n-1)return e;let i=e.eventRange,s=i.range,o=ir(s,{start:r[t].date,end:wt(r[n-1].date,1)});return Object.assign(Object.assign({},e),{firstCol:t,lastCol:n-1,eventRange:{def:i.def,ui:Object.assign(Object.assign({},i.ui),{durationEditable:!1}),instance:i.instance,range:o},isStart:e.isStart&&o.start.valueOf()===s.start.valueOf(),isEnd:e.isEnd&&o.end.valueOf()===s.end.valueOf()})}class yl extends cs{constructor(){super(...arguments),this.hiddenConsumes=!1,this.forceHidden={}}addSegs(e){const t=super.addSegs(e),{entriesByLevel:n}=this,r=e=>!this.forceHidden[us(e)];for(let e=0;e<n.length;e+=1)n[e]=n[e].filter(r);return t}handleInvalidInsertion(e,t,n){const{entriesByLevel:r,forceHidden:i}=this,{touchingEntry:s,touchingLevel:o,touchingLateral:a}=e;if(this.hiddenConsumes&&s){const e=us(s);if(!i[e])if(this.allowReslicing){const e=Object.assign(Object.assign({},s),{span:fs(s.span,t.span)});i[us(e)]=!0,r[o][a]=e,this.splitEntry(s,t,n)}else i[e]=!0,n.push(s)}return super.handleInvalidInsertion(e,t,n)}}class bl extends ls{constructor(){super(...arguments),this.cellElRefs=new Vs,this.frameElRefs=new Vs,this.fgElRefs=new Vs,this.segHarnessRefs=new Vs,this.rootElRef={current:null},this.state={framePositions:null,maxContentHeight:null,segHeights:{}},this.handleResize=e=>{e&&this.updateSizing(!0)}}render(){let{props:e,state:t,context:n}=this,{options:r}=n,i=e.cells.length,s=nl(e.businessHourSegs,i),o=nl(e.bgEventSegs,i),a=nl(this.getHighlightSegs(),i),l=nl(this.getMirrorSegs(),i),{singleColPlacements:c,multiColPlacements:d,moreCnts:u,moreMarginTops:h}=ml(di(e.fgEventSegs,r.eventOrder),e.dayMaxEvents,e.dayMaxEventRows,r.eventOrderStrict,t.segHeights,t.maxContentHeight,e.cells),f=e.eventDrag&&e.eventDrag.affectedInstances||e.eventResize&&e.eventResize.affectedInstances||{};return p("tr",{ref:this.rootElRef,role:"row"},e.renderIntro&&e.renderIntro(),e.cells.map((t,n)=>{let r=this.renderFgSegs(n,e.forPrint?c[n]:d[n],e.todayRange,f),i=this.renderFgSegs(n,function(e,t){if(!e.length)return[];let n=function(e){let t={};for(let n of e)for(let e of n)t[e.seg.eventRange.instance.instanceId]=e.absoluteTop;return t}(t);return e.map(e=>({seg:e,isVisible:!0,isAbsolute:!0,absoluteTop:n[e.eventRange.instance.instanceId],marginTop:0}))}(l[n],d),e.todayRange,{},Boolean(e.eventDrag),Boolean(e.eventResize),!1);return p(hl,{key:t.key,elRef:this.cellElRefs.createRef(t.key),innerElRef:this.frameElRefs.createRef(t.key),dateProfile:e.dateProfile,date:t.date,showDayNumber:e.showDayNumbers,showWeekNumber:e.showWeekNumbers&&0===n,forceDayTop:e.showWeekNumbers,todayRange:e.todayRange,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,extraRenderProps:t.extraRenderProps,extraDataAttrs:t.extraDataAttrs,extraClassNames:t.extraClassNames,extraDateSpan:t.extraDateSpan,moreCnt:u[n],moreMarginTop:h[n],singlePlacements:c[n],fgContentElRef:this.fgElRefs.createRef(t.key),fgContent:p(y,null,p(y,null,r),p(y,null,i)),bgContent:p(y,null,this.renderFillSegs(a[n],"highlight"),this.renderFillSegs(s[n],"non-business"),this.renderFillSegs(o[n],"bg-event")),minHeight:e.cellMinHeight})}))}componentDidMount(){this.updateSizing(!0),this.context.addResizeHandler(this.handleResize)}componentDidUpdate(e,t){let n=this.props;this.updateSizing(!Cn(e,n))}componentWillUnmount(){this.context.removeResizeHandler(this.handleResize)}getHighlightSegs(){let{props:e}=this;return e.eventDrag&&e.eventDrag.segs.length?e.eventDrag.segs:e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:e.dateSelectionSegs}getMirrorSegs(){let{props:e}=this;return e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:[]}renderFgSegs(e,t,n,r,i,s,o){let{context:a}=this,{eventSelection:l}=this.props,{framePositions:c}=this.state,d=1===this.props.cells.length,u=i||s||o,h=[];if(c)for(let e of t){let{seg:t}=e,{instanceId:f}=t.eventRange.instance,g=e.isVisible&&!r[f],m=e.isAbsolute,v="",y="";
vendor: 56,987 bytes, line 778
778m&&(a.isRtl?(y=0,v=c.lefts[t.lastCol]-c.lefts[t.firstCol]):(v=0,y=c.rights[t.firstCol]-c.rights[t.lastCol])),h.push(p("div",{className:"fc-daygrid-event-harness"+(m?" fc-daygrid-event-harness-abs":""),key:gl(t),ref:u?null:this.segHarnessRefs.createRef(pl(t)),style:{visibility:g?"":"hidden",marginTop:m?"":e.marginTop,top:m?e.absoluteTop:"",left:v,right:y}},sl(t)?p(al,Object.assign({seg:t,isDragging:i,isSelected:f===l,defaultDisplayEventEnd:d},mi(t,n))):p(ol,Object.assign({seg:t,isDragging:i,isResizing:s,isDateSelecting:o,isSelected:f===l,defaultDisplayEventEnd:d},mi(t,n)))))}return h}renderFillSegs(e,t){let{isRtl:n}=this.context,{todayRange:r}=this.props,{framePositions:i}=this.state,s=[];if(i)for(let o of e){let e=n?{right:0,left:i.lefts[o.lastCol]-i.lefts[o.firstCol]}:{left:0,right:i.rights[o.firstCol]-i.rights[o.lastCol]};s.push(p("div",{key:yi(o.eventRange),className:"fc-daygrid-bg-harness",style:e},"bg-event"===t?p(go,Object.assign({seg:o},mi(o,r))):mo(t)))}return p(y,{},...s)}updateSizing(e){let{props:t,state:n,frameElRefs:r}=this;if(!t.forPrint&&null!==t.clientWidth){if(e){let e=t.cells.map(e=>r.currentMap[e.key]);if(e.length){let t=this.rootElRef.current,r=new rs(t,e,!0,!1);n.framePositions&&n.framePositions.similarTo(r)||this.setState({framePositions:new rs(t,e,!0,!1)})}}const i=this.state.segHeights,s=this.querySegHeights(),o=!0===t.dayMaxEvents||!0===t.dayMaxEventRows;this.safeSetState({segHeights:Object.assign(Object.assign({},i),s),maxContentHeight:o?this.computeMaxContentHeight():null})}}querySegHeights(){let e=this.segHarnessRefs.currentMap,t={};for(let n in e){let r=Math.round(e[n].getBoundingClientRect().height);t[n]=Math.max(t[n]||0,r)}return t}computeMaxContentHeight(){let e=this.props.cells[0].key,t=this.cellElRefs.currentMap[e],n=this.fgElRefs.currentMap[e];return t.getBoundingClientRect().bottom-n.getBoundingClientRect().top}getCellEls(){let e=this.cellElRefs.currentMap;return this.props.cells.map(t=>e[t.key])}}bl.addStateEquality({segHeights:Cn});class El extends ls{constructor(){super(...arguments),this.splitBusinessHourSegs=Gt(tl),this.splitBgEventSegs=Gt(tl),this.splitFgEventSegs=Gt(tl),this.splitDateSelectionSegs=Gt(tl),this.splitEventDrag=Gt(rl),this.splitEventResize=Gt(rl),this.rowRefs=new Vs}render(){let{props:e,context:t}=this,n=e.cells.length,r=this.splitBusinessHourSegs(e.businessHourSegs,n),i=this.splitBgEventSegs(e.bgEventSegs,n),s=this.splitFgEventSegs(e.fgEventSegs,n),o=this.splitDateSelectionSegs(e.dateSelectionSegs,n),a=this.splitEventDrag(e.eventDrag,n),l=this.splitEventResize(e.eventResize,n),c=n>=7&&e.clientWidth?e.clientWidth/t.options.aspectRatio/6:null;return p(Rs,{unit:"day"},(t,d)=>p(y,null,e.cells.map((t,u)=>p(bl,{ref:this.rowRefs.createRef(u),key:t.length?t[0].date.toISOString():u,showDayNumbers:n>1,showWeekNumbers:e.showWeekNumbers,todayRange:d,dateProfile:e.dateProfile,cells:t,renderIntro:e.renderRowIntro,businessHourSegs:r[u],eventSelection:e.eventSelection,bgEventSegs:i[u].filter(Sl),fgEventSegs:s[u],dateSelectionSegs:o[u],eventDrag:a[u],eventResize:l[u],dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,clientWidth:e.clientWidth,clientHeight:e.clientHeight,cellMinHeight:c,forPrint:e.forPrint}))))}componentDidMount(){this.registerInteractiveComponent()}componentDidUpdate(){this.registerInteractiveComponent()}registerInteractiveComponent(){if(!this.rootEl){const e=this.rowRefs.currentMap[0].getCellEls()[0],t=e?e.closest(".fc-daygrid-body"):null;t&&(this.rootEl=t,this.context.registerInteractiveComponent(this,{el:t,isHitComboAllowed:this.props.isHitComboAllowed}))}}componentWillUnmount(){this.rootEl&&(this.context.unregisterInteractiveComponent(this),this.rootEl=null)}prepareHits(){this.rowPositions=new rs(this.rootEl,this.rowRefs.collect().map(e=>e.getCellEls()[0]),!1,!0),this.colPositions=new rs(this.rootEl,this.rowRefs.currentMap[0].getCellEls(),!0,!1)}queryHit(e,t){let{colPositions:n,rowPositions:r}=this,i=n.leftToIndex(e),s=r.topToIndex(t);if(null!=s&&null!=i){let e=this.props.cells[s][i];return{dateProfile:this.props.dateProfile,dateSpan:Object.assign({range:this.getCellRange(s,i),allDay:!0},e.extraDateSpan),dayEl:this.getCellEl(s,i),rect:{left:n.lefts[i],right:n.rights[i],top:r.tops[s],bottom:r.bottoms[s]},layer:0}}return null}getCellEl(e,t){return this.rowRefs.currentMap[e].getCellEls()[t]}getCellRange(e,t){let n=this.props.cells[e][t].date;return{start:n,end:wt(n,1)}}}function Sl(e){return e.eventRange.def.allDay}class Al extends ls{constructor(){super(...arguments),this.elRef={current:null},this.needsScrollReset=!1}render(){let{props:e}=this,{dayMaxEventRows:t,dayMaxEvents:n,expandRows:r}=e,i=!0===n||!0===t;i&&!r&&(i=!1,t=null,n=null);let s=["fc-daygrid-body",i?"fc-daygrid-body-balanced":"fc-daygrid-body-unbalanced",r?"":"fc-daygrid-body-natural"];return p("div",{ref:this.elRef,className:s.join(" "),style:{width:e.clientWidth,minWidth:e.tableMinWidth}},p("table",{role:"presentation",className:"fc-scrollgrid-sync-table",style:{width:e.clientWidth,minWidth:e.tableMinWidth,height:r?e.clientHeight:""}},e.colGroupNode,p("tbody",{role:"presentation"},p(El,{dateProfile:e.dateProfile,cells:e.cells,renderRowIntro:e.renderRowIntro,showWeekNumbers:e.showWeekNumbers,clientWidth:e.clientWidth,clientHeight:e.clientHeight,businessHourSegs:e.businessHourSegs,bgEventSegs:e.bgEventSegs,fgEventSegs:e.fgEventSegs,dateSelectionSegs:e.dateSelectionSegs,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,dayMaxEvents:n,dayMaxEventRows:t,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed}))))}componentDidMount(){this.requestScrollReset()}componentDidUpdate(e){e.dateProfile!==this.props.dateProfile?this.requestScrollReset():this.flushScrollReset()}requestScrollReset(){this.needsScrollReset=!0,this.flushScrollReset()}flushScrollReset(){if(this.needsScrollReset&&this.props.clientWidth){const e=function(e,t){let n;t.currentRangeUnit.match(/year|month/)&&(n=e.querySelector(`[data-date="${Lt(t.currentDate)}-01"]`));n||(n=e.querySelector(`[data-date="${Wt(t.currentDate)}"]`));return n}(this.elRef.current,this.props.dateProfile);if(e){const t=e.closest(".fc-daygrid-body"),n=t.closest(".fc-scroller"),r=e.getBoundingClientRect().top-t.getBoundingClientRect().top;n.scrollTop=r?r+1:0}this.needsScrollReset=!1}}}class Dl extends Is{constructor(){super(...arguments),this.forceDayIfListItem=!0}sliceRange(e,t){return t.sliceRange(e)}}class wl extends ls{constructor(){super(...arguments),this.slicer=new Dl,this.tableRef={current:null}}render(){let{props:e,context:t}=this;return p(Al,Object.assign({ref:this.tableRef},this.slicer.sliceProps(e,e.dateProfile,e.nextDayThreshold,t,e.dayTableModel),{dateProfile:e.dateProfile,cells:e.dayTableModel.cells,colGroupNode:e.colGroupNode,tableMinWidth:e.tableMinWidth,renderRowIntro:e.renderRowIntro,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,showWeekNumbers:e.showWeekNumbers,expandRows:e.expandRows,headerAlignElRef:e.headerAlignElRef,clientWidth:e.clientWidth,clientHeight:e.clientHeight,forPrint:e.forPrint}))}}class Cl extends gr{buildRenderRange(e,t,n){let r=super.buildRenderRange(e,t,n),{props:i}=this;return Rl({currentRange:r,snapToWeek:/^(year|month)$/.test(t),fixedWeekCount:i.fixedWeekCount,dateEnv:i.dateEnv})}}function Rl(e){let t,{dateEnv:n,currentRange:r}=e,{start:i,end:s}=r;if(e.snapToWeek&&(i=n.startOfWeek(i),t=n.startOfWeek(s),t.valueOf()!==s.valueOf()&&(s=Dt(t,1))),e.fixedWeekCount){let e=n.startOfWeek(n.startOfMonth(wt(r.end,-1)));s=Dt(s,6-Math.ceil(Rt(e,s)))}return{start:i,end:s}}class xl extends ls{constructor(){super(...arguments),this.headerElRef={current:null}}renderSimpleLayout(e,t){let{props:n,context:r}=this,i=[],s=no(r.options);return e&&i.push({type:"header",key:"header",isSticky:s,chunk:{elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}}),i.push({type:"body",key:"body",liquid:!0,chunk:{content:t}}),p(er,{elClasses:["fc-daygrid"],viewSpec:r.viewSpec},p(io,{liquid:!n.isHeightAuto&&!n.forPrint,collapsibleWidth:n.forPrint,cols:[],sections:i}))}renderHScrollLayout(e,t,n,r){let i=this.context.pluginHooks.scrollGridImpl;if(!i)throw new Error("No ScrollGrid implementation");let{props:s,context:o}=this,a=!s.forPrint&&no(o.options),l=!s.forPrint&&ro(o.options),c=[];return e&&c.push({type:"header",key:"header",isSticky:a,chunks:[{key:"main",elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}]}),c.push({type:"body",key:"body",liquid:!0,chunks:[{key:"main",content:t}]}),l&&c.push({type:"footer",key:"footer",isSticky:!0,chunks:[{key:"main",content:to}]}),p(er,{elClasses:["fc-daygrid"],viewSpec:o.viewSpec},p(i,{liquid:!s.isHeightAuto&&!s.forPrint,forPrint:s.forPrint,collapsibleWidth:s.forPrint,colGroups:[{cols:[{span:n,minWidth:r}]}],sections:c}))}}function _l(e,t){let n=new ks(e.renderRange,t);return new Ms(n,/year|month|week/.test(e.currentRangeUnit))}var Tl=Po({name:"@fullcalendar/daygrid",initialView:"dayGridMonth",views:{dayGrid:{component:class extends xl{constructor(){super(...arguments),this.buildDayTableModel=Gt(_l),this.headerRef={current:null},this.tableRef={current:null}}render(){let{options:e,dateProfileGenerator:t}=this.context,{props:n}=this,r=this.buildDayTableModel(n.dateProfile,t),i=e.dayHeaders&&p(_s,{ref:this.headerRef,dateProfile:n.dateProfile,dates:r.headerDates,datesRepDistinctDays:1===r.rowCnt}),s=t=>p(wl,{ref:this.tableRef,dateProfile:n.dateProfile,dayTableModel:r,businessHours:n.businessHours,dateSelection:n.dateSelection,eventStore:n.eventStore,eventUiBases:n.eventUiBases,eventSelection:n.eventSelection,eventDrag:n.eventDrag,eventResize:n.eventResize,nextDayThreshold:e.nextDayThreshold,colGroupNode:t.tableColGroupNode,tableMinWidth:t.tableMinWidth,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,showWeekNumbers:e.weekNumbers,expandRows:!n.isHeightAuto,headerAlignElRef:this.headerElRef,clientWidth:t.clientWidth,clientHeight:t.clientHeight,forPrint:n.forPrint});return e.dayMinWidth?this.renderHScrollLayout(i,s,r.colCnt,e.dayMinWidth):this.renderSimpleLayout(i,s)}},dateProfileGeneratorClass:Cl},dayGridDay:{type:"dayGrid",duration:{days:1}},dayGridWeek:{type:"dayGrid",duration:{weeks:1}},dayGridMonth:{type:"dayGrid",duration:{months:1},fixedWeekCount:!0},dayGridYear:{type:"dayGrid",duration:{years:1}}}});xe('.fc-v-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-v-event .fc-event-main{color:var(--fc-event-text-color);height:100%}.fc-v-event .fc-event-main-frame{display:flex;flex-direction:column;height:100%}.fc-v-event .fc-event-time{flex-grow:0;flex-shrink:0;max-height:100%;overflow:hidden}.fc-v-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-height:0}.fc-v-event .fc-event-title{bottom:0;max-height:100%;overflow:hidden;top:0}.fc-v-event:not(.fc-event-start){border-top-left-radius:0;border-top-right-radius:0;border-top-width:0}.fc-v-event:not(.fc-event-end){border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-width:0}.fc-v-event.fc-event-selected:before{left:-10px;right:-10px}.fc-v-event .fc-event-resizer-start{cursor:n-resize}.fc-v-event .fc-event-resizer-end{cursor:s-resize}.fc-v-event:not(.fc-event-selected) .fc-event-resizer{height:var(--fc-event-resizer-thickness);left:0;right:0}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-start{top:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer{left:50%;margin-left:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-start{top:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc .fc-timegrid .fc-daygrid-body{z-index:2}.fc .fc-timegrid-divider{padding:0 0 2px}.fc .fc-timegrid-body{min-height:100%;position:relative;z-index:1}.fc .fc-timegrid-axis-chunk{position:relative}.fc .fc-timegrid-axis-chunk>table,.fc .fc-timegrid-slots{position:relative;z-index:1}.fc .fc-timegrid-slot{border-bottom:0;height:1.5em}.fc .fc-timegrid-slot:empty:before{content:"\\00a0"}.fc .fc-timegrid-slot-minor{border-top-style:dotted}.fc .fc-timegrid-slot-label-cushion{display:inline-block;white-space:nowrap}.fc .fc-timegrid-slot-label{vertical-align:middle}.fc .fc-timegrid-axis-cushion,.fc .fc-timegrid-slot-label-cushion{padding:0 4px}.fc .fc-timegrid-axis-frame-liquid{height:100%}.fc .fc-timegrid-axis-frame{align-items:center;display:flex;justify-content:flex-end;overflow:hidden}.fc .fc-timegrid-axis-cushion{flex-shrink:0;max-width:60px}.fc-direction-ltr .fc-timegrid-slot-label-frame{text-align:right}.fc-direction-rtl .fc-timegrid-slot-label-frame{text-align:left}.fc-liquid-hack .fc-timegrid-axis-frame-liquid{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-timegrid-col-frame{min-height:100%;position:relative}.fc-media-screen.fc-liquid-hack .fc-timegrid-col-frame{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols{bottom:0;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols>table{height:100%}.fc-media-screen .fc-timegrid-col-bg,.fc-media-screen .fc-timegrid-col-events,.fc-media-screen .fc-timegrid-now-indicator-container{left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col-bg{z-index:2}.fc .fc-timegrid-col-bg .fc-non-business{z-index:1}.fc .fc-timegrid-col-bg .fc-bg-event{z-index:2}.fc .fc-timegrid-col-bg .fc-highlight{z-index:3}.fc .fc-timegrid-bg-harness{left:0;position:absolute;right:0}.fc .fc-timegrid-col-events{z-index:3}.fc .fc-timegrid-now-indicator-container{bottom:0;overflow:hidden}.fc-direction-ltr .fc-timegrid-col-events{margin:0 2.5% 0 2px}.fc-direction-rtl .fc-timegrid-col-events{margin:0 2px 0 2.5%}.fc-timegrid-event-harness{position:absolute}.fc-timegrid-event-harness>.fc-timegrid-event{bottom:0;left:0;position:absolute;right:0;top:0}.fc-timegrid-event-harness-inset .fc-timegrid-event,.fc-timegrid-event.fc-event-mirror,.fc-timegrid-more-link{box-shadow:0 0 0 1px var(--fc-page-bg-color)}.fc-timegrid-event,.fc-timegrid-more-link{border-radius:3px;font-size:var(--fc-small-font-size)}.fc-timegrid-event{margin-bottom:1px}.fc-timegrid-event .fc-event-main{padding:1px 1px 0}.fc-timegrid-event .fc-event-time{font-size:var(--fc-small-font-size);margin-bottom:1px;white-space:nowrap}.fc-timegrid-event-short .fc-event-main-frame{flex-direction:row;overflow:hidden}.fc-timegrid-event-short .fc-event-time:after{content:"\\00a0-\\00a0"}.fc-timegrid-event-short .fc-event-title{font-size:var(--fc-small-font-size)}.fc-timegrid-more-link{background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;margin-bottom:1px;position:absolute;z-index:9999}.fc-timegrid-more-link-inner{padding:3px 2px;top:0}.fc-direction-ltr .fc-timegrid-more-link{right:0}.fc-direction-rtl .fc-timegrid-more-link{left:0}.fc .fc-timegrid-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;border-width:1px 0 0;left:0;position:absolute;right:0;z-index:4}.fc .fc-timegrid-now-indicator-arrow{border-color:var(--fc-now-indicator-color);border-style:solid;margin-top:-5px;position:absolute;z-index:4}.fc-direction-ltr .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 0 5px 6px;left:0}.fc-direction-rtl .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 6px 5px 0;right:0}');class kl extends Wi{getKeyInfo(){return{allDay:{},timed:{}}}getKeysForDateSpan(e){return e.allDay?["allDay"]:["timed"]}getKeysForEventDef(e){return e.allDay?si(e)?["timed","allDay"]:["allDay"]:["timed"]}}const Ml=an({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"});function Il(e){let t=["fc-timegrid-slot","fc-timegrid-slot-label",e.isLabeled?"fc-scrollgrid-shrink":"fc-timegrid-slot-minor"];return p(Ln.Consumer,null,n=>{if(!e.isLabeled)return p("td",{className:t.join(" "),"data-time":e.isoTimeStr});let{dateEnv:r,options:i,viewApi:s}=n,o=null==i.slotLabelFormat?Ml:Array.isArray(i.slotLabelFormat)?an(i.slotLabelFormat[0]):an(i.slotLabelFormat),a={level:0,time:e.time,date:r.toDate(e.date),view:s,text:r.format(e.date,o)};return p(Jn,{elTag:"td",elClasses:t,elAttrs:{"data-time":e.isoTimeStr},renderProps:a,generatorName:"slotLabelContent",customGenerator:i.slotLabelContent,defaultGenerator:Ol,classNameGenerator:i.slotLabelClassNames,didMount:i.slotLabelDidMount,willUnmount:i.slotLabelWillUnmount},e=>p("div",{className:"fc-timegrid-slot-label-frame fc-scrollgrid-shrink-frame"},p(e,{elTag:"div",elClasses:["fc-timegrid-slot-label-cushion","fc-scrollgrid-shrink-cushion"]})))})}function Ol(e){return e.text}class Nl extends Gn{render(){return this.props.slatMetas.map(e=>p("tr",{key:e.key},p(Il,Object.assign({},e))))}}const Pl=an({week:"short"});class Hl extends ls{constructor(){super(...arguments),this.allDaySplitter=new kl,this.headerElRef={current:null},this.rootElRef={current:null},this.scrollerElRef={current:null},this.state={slatCoords:null},this.handleScrollTopRequest=e=>{let t=this.scrollerElRef.current;t&&(t.scrollTop=e)},this.renderHeadAxis=(e,t="")=>{let{options:n}=this.context,{dateProfile:r}=this.props,i=r.renderRange,s=1===xt(i.start,i.end)?qi(this.context,i.start,"week"):{};return n.weekNumbers&&"day"===e?p(vo,{elTag:"th",elClasses:["fc-timegrid-axis","fc-scrollgrid-shrink"],elAttrs:{"aria-hidden":!0},date:i.start,defaultFormat:Pl},e=>p("div",{className:["fc-timegrid-axis-frame","fc-scrollgrid-shrink-frame","fc-timegrid-axis-frame-liquid"].join(" "),style:{height:t}},p(e,{elTag:"a",elClasses:["fc-timegrid-axis-cushion","fc-scrollgrid-shrink-cushion","fc-scrollgrid-sync-inner"],elAttrs:s}))):p("th",{"aria-hidden":!0,className:"fc-timegrid-axis"},p("div",{className:"fc-timegrid-axis-frame",style:{height:t}}))},this.renderTableRowAxis=e=>{let{options:t,viewApi:n}=this.context,r={text:t.allDayText,view:n};return p(Jn,{elTag:"td",elClasses:["fc-timegrid-axis","fc-scrollgrid-shrink"],elAttrs:{"aria-hidden":!0},renderProps:r,generatorName:"allDayContent",customGenerator:t.allDayContent,defaultGenerator:Bl,classNameGenerator:t.allDayClassNames,didMount:t.allDayDidMount,willUnmount:t.allDayWillUnmount},t=>p("div",{className:["fc-timegrid-axis-frame","fc-scrollgrid-shrink-frame",null==e?" fc-timegrid-axis-frame-liquid":""].join(" "),style:{height:e}},p(t,{elTag:"span",elClasses:["fc-timegrid-axis-cushion","fc-scrollgrid-shrink-cushion","fc-scrollgrid-sync-inner"]})))},this.handleSlatCoords=e=>{this.setState({slatCoords:e})}}renderSimpleLayout(e,t,n){let{context:r,props:i}=this,s=[],o=no(r.options);return e&&s.push({type:"header",key:"header",isSticky:o,chunk:{elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}}),t&&(s.push({type:"body",key:"all-day",chunk:{content:t}}),s.push({type:"body",key:"all-day-divider",outerContent:p("tr",{role:"presentation",className:"fc-scrollgrid-section"},p("td",{className:"fc-timegrid-divider "+r.theme.getClass("tableCellShaded")}))})),s.push({type:"body",key:"body",liquid:!0,expandRows:Boolean(r.options.expandRows),chunk:{scrollerElRef:this.scrollerElRef,content:n}}),p(er,{elRef:this.rootElRef,elClasses:["fc-timegrid"],viewSpec:r.viewSpec},p(io,{liquid:!i.isHeightAuto&&!i.forPrint,collapsibleWidth:i.forPrint,cols:[{width:"shrink"}],sections:s}))}renderHScrollLayout(e,t,n,r,i,s,o){let a=this.context.pluginHooks.scrollGridImpl;if(!a)throw new Error("No ScrollGrid implementation");let{context:l,props:c}=this,d=!c.forPrint&&no(l.options),u=!c.forPrint&&ro(l.options),h=[];e&&h.push({type:"header",key:"header",isSticky:d,syncRowHeights:!0,chunks:[{key:"axis",rowContent:e=>p("tr",{role:"presentation"},this.renderHeadAxis("day",e.rowSyncHeights[0]))},{key:"cols",elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}]}),t&&(h.push({type:"body",key:"all-day",syncRowHeights:!0,chunks:[{key:"axis",rowContent:e=>p("tr",{role:"presentation"},this.renderTableRowAxis(e.rowSyncHeights[0]))},{key:"cols",content:t}]}),h.push({key:"all-day-divider",type:"body",outerContent:p("tr",{role:"presentation",className:"fc-scrollgrid-section"},p("td",{colSpan:2,className:"fc-timegrid-divider "+l.theme.getClass("tableCellShaded")}))}));let f=l.options.nowIndicator;return h.push({type:"body",key:"body",liquid:!0,expandRows:Boolean(l.options.expandRows),chunks:[{key:"axis",content:e=>p("div",{className:"fc-timegrid-axis-chunk"},p("table",{"aria-hidden":!0,style:{height:e.expandRows?e.clientHeight:""}},e.tableColGroupNode,p("tbody",null,p(Nl,{slatMetas:s}))),p("div",{className:"fc-timegrid-now-indicator-container"},p(Rs,{unit:f?"minute":"day"},e=>{let t=f&&o&&o.safeComputeTop(e);return"number"==typeof t?p(lo,{elClasses:["fc-timegrid-now-indicator-arrow"],elStyle:{top:t},isAxis:!0,date:e}):null})))},{key:"cols",scrollerElRef:this.scrollerElRef,content:n}]}),u&&h.push({key:"footer",type:"footer",isSticky:!0,chunks:[{key:"axis",content:to},{key:"cols",content:to}]}),p(er,{elRef:this.rootElRef,elClasses:["fc-timegrid"],viewSpec:l.viewSpec},p(a,{liquid:!c.isHeightAuto&&!c.forPrint,forPrint:c.forPrint,collapsibleWidth:!1,colGroups:[{width:"shrink",cols:[{width:"shrink"}]},{cols:[{span:r,minWidth:i}]}],sections:h}))}getAllDayMaxEventProps(){let{dayMaxEvents:e,dayMaxEventRows:t}=this.context.options;return!0!==e&&!0!==t||(e=void 0,t=5),{dayMaxEvents:e,dayMaxEventRows:t}}}function Bl(e){return e.text}class jl{constructor(e,t,n){this.positions=e,this.dateProfile=t,this.slotDuration=n}safeComputeTop(e){let{dateProfile:t}=this;if(lr(t.currentRange,e)){let n=Mt(e),r=e.valueOf()-n.valueOf();if(r>=yt(t.slotMinTime)&&r<yt(t.slotMaxTime))return this.computeTimeTop(ft(r))}return null}computeDateTop(e,t){return t||(t=Mt(e)),this.computeTimeTop(ft(e.valueOf()-t.valueOf()))}computeTimeTop(e){let t,n,{positions:r,dateProfile:i}=this,s=r.els.length,o=(e.milliseconds-yt(i.slotMinTime))/yt(this.slotDuration);return o=Math.max(0,o),o=Math.min(s,o),t=Math.floor(o),t=Math.min(t,s-1),n=o-t,r.tops[t]+r.getHeight(t)*n}}class zl extends Gn{render(){let{props:e,context:t}=this,{options:n}=t,{slatElRefs:r}=e;return p("tbody",null,e.slatMetas.map((i,s)=>{let o={time:i.time,date:t.dateEnv.toDate(i.date),view:t.viewApi};return p("tr",{key:i.key,ref:r.createRef(i.key)},e.axis&&p(Il,Object.assign({},i)),p(Jn,{elTag:"td",elClasses:["fc-timegrid-slot","fc-timegrid-slot-lane",!i.isLabeled&&"fc-timegrid-slot-minor"],elAttrs:{"data-time":i.isoTimeStr},renderProps:o,generatorName:"slotLaneContent",customGenerator:n.slotLaneContent,classNameGenerator:n.slotLaneClassNames,didMount:n.slotLaneDidMount,willUnmount:n.slotLaneWillUnmount}))}))}}class Ul extends Gn{constructor(){super(...arguments),this.rootElRef={current:null},this.slatElRefs=new Vs}render(){let{props:e,context:t}=this;return p("div",{ref:this.rootElRef,className:"fc-timegrid-slots"},p("table",{"aria-hidden":!0,className:t.theme.getClass("table"),style:{minWidth:e.tableMinWidth,width:e.clientWidth,height:e.minHeight}},e.tableColGroupNode,p(zl,{slatElRefs:this.slatElRefs,axis:e.axis,slatMetas:e.slatMetas})))}componentDidMount(){this.updateSizing()}componentDidUpdate(){this.updateSizing()}componentWillUnmount(){this.props.onCoords&&this.props.onCoords(null)}updateSizing(){let{context:e,props:t}=this;if(t.onCoords&&null!==t.clientWidth){this.rootElRef.current.offsetHeight&&t.onCoords(new jl(new rs(this.rootElRef.current,(n=this.slatElRefs.currentMap,t.slatMetas.map(e=>n[e.key])),!1,!0),this.props.dateProfile,e.options.slotDuration))}var n}}function Wl(e,t){let n,r=[];for(n=0;n<t;n+=1)r.push([]);if(e)for(n=0;n<e.length;n+=1)r[e[n].col].push(e[n]);return r}function Ll(e,t){let n=[];if(e){for(let r=0;r<t;r+=1)n[r]={affectedInstances:e.affectedInstances,isEvent:e.isEvent,segs:[]};for(let t of e.segs)n[t.col].segs.push(t)}else for(let e=0;e<t;e+=1)n[e]=null;return n}class Fl extends Gn{render(){let{props:e}=this;return p(So,{elClasses:["fc-timegrid-more-link"],elStyle:{top:e.top,bottom:e.bottom},allDayDate:null,moreCnt:e.hiddenSegs.length,allSegs:e.hiddenSegs,hiddenSegs:e.hiddenSegs,extraDateSpan:e.extraDateSpan,dateProfile:e.dateProfile,todayRange:e.todayRange,popoverContent:()=>ec(e.hiddenSegs,e),defaultGenerator:Vl,forceTimed:!0},e=>p(e,{elTag:"div",elClasses:["fc-timegrid-more-link-inner","fc-sticky"]}))}}function Vl(e){return e.shortText}function Gl(e,t,n){let r=new cs;null!=t&&(r.strictOrder=t),null!=n&&(r.maxStackCnt=n);let i=hs(r.addSegs(e)),s=function(e){const{entriesByLevel:t}=e,n=Zl((e,t)=>e+":"+t,(r,i)=>{let s=Ql(function(e,t,n){let{levelCoords:r,entriesByLevel:i}=e,s=i[t][n],o=r[t]+s.thickness,a=r.length,l=t;for(;l<a&&r[l]<o;l+=1);for(;l<a;l+=1){let e,t=i[l],n=ps(t,s.span.start,ds),r=n[0]+n[1],o=r;for(;(e=t[o])&&e.span.start<s.span.end;)o+=1;if(r<o)return{level:l,lateralStart:r,lateralEnd:o}}return null}(e,r,i),n),o=t[r][i];return[Object.assign(Object.assign({},o),{nextLevelNodes:s[0]}),o.thickness+s[1]]});return Ql(t.length?{level:0,lateralStart:0,lateralEnd:t[0].length}:null,n)[0]}(r);return s=function(e,t){const n=Zl((e,t,n)=>us(e),(e,r,i)=>{let s,{nextLevelNodes:o,thickness:a}=e,l=a+i,c=a/l,d=[];if(o.length)for(let e of o)if(void 0===s){let t=n(e,r,l);s=t[0],d.push(t[1])}else{let t=n(e,s,0);d.push(t[1])}else s=t;let u=(s-r)*c;return[s-u,Object.assign(Object.assign({},e),{thickness:u,nextLevelNodes:d})]});return e.map(e=>n(e,0,0)[1])}(s,1),{segRects:function(e){let t=[];const n=Zl((e,t,n)=>us(e),(e,n,i)=>{let s=Object.assign(Object.assign({},e),{levelCoord:n,stackDepth:i,stackForward:0});return t.push(s),s.stackForward=r(e.nextLevelNodes,n+e.thickness,i+1)+1});function r(e,t,r){let i=0;for(let s of e)i=Math.max(n(s,t,r),i);return i}return r(e,0,0),t}(s),hiddenGroups:i}}function Ql(e,t){if(!e)return[[],0];let{level:n,lateralStart:r,lateralEnd:i}=e,s=r,o=[];for(;s<i;)o.push(t(n,s)),s+=1;return o.sort(ql),[o.map(Yl),o[0][1]]}function ql(e,t){return t[1]-e[1]}function Yl(e){return e[0]}function Zl(e,t){const n={};return(...r)=>{let i=e(...r);return i in n?n[i]:n[i]=t(...r)}}function Xl(e,t,n=null,r=0){let i=[];if(n)for(let s=0;s<e.length;s+=1){let o=e[s],a=n.computeDateTop(o.start,t),l=Math.max(a+(r||0),n.computeDateTop(o.end,t));i.push({start:Math.round(a),end:Math.round(l)})}return i}const $l=an({hour:"numeric",minute:"2-digit",meridiem:!1});class Jl extends Gn{render(){return p(oo,Object.assign({},this.props,{elClasses:["fc-timegrid-event","fc-v-event",this.props.isShort&&"fc-timegrid-event-short"],defaultTimeFormat:$l}))}}class Kl extends Gn{constructor(){super(...arguments),this.sortEventSegs=Gt(di)}render(){let{props:e,context:t}=this,{options:n}=t,r=n.selectMirror,i=e.eventDrag&&e.eventDrag.segs||e.eventResize&&e.eventResize.segs||r&&e.dateSelectionSegs||[],s=e.eventDrag&&e.eventDrag.affectedInstances||e.eventResize&&e.eventResize.affectedInstances||{},o=this.sortEventSegs(e.fgEventSegs,n.eventOrder);return p(uo,{elTag:"td",elRef:e.elRef,elClasses:["fc-timegrid-col",...e.extraClassNames||[]],elAttrs:Object.assign({role:"gridcell"},e.extraDataAttrs),date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,extraRenderProps:e.extraRenderProps},t=>p("div",{className:"fc-timegrid-col-frame"},p("div",{className:"fc-timegrid-col-bg"},this.renderFillSegs(e.businessHourSegs,"non-business"),this.renderFillSegs(e.bgEventSegs,"bg-event"),this.renderFillSegs(e.dateSelectionSegs,"highlight")),p("div",{className:"fc-timegrid-col-events"},this.renderFgSegs(o,s,!1,!1,!1)),p("div",{className:"fc-timegrid-col-events"},this.renderFgSegs(i,{},Boolean(e.eventDrag),Boolean(e.eventResize),Boolean(r),"mirror")),p("div",{className:"fc-timegrid-now-indicator-container"},this.renderNowIndicator(e.nowIndicatorSegs)),ho(n)&&p(t,{elTag:"div",elClasses:["fc-timegrid-col-misc"]})))}renderFgSegs(e,t,n,r,i,s){let{props:o}=this;return o.forPrint?ec(e,o):this.renderPositionedFgSegs(e,t,n,r,i,s)}renderPositionedFgSegs(e,t,n,r,i,s){let{eventMaxStack:o,eventShortHeight:a,eventOrderStrict:l,eventMinHeight:c}=this.context.options,{date:d,slatCoords:u,eventSelection:h,todayRange:f,nowDate:g}=this.props,m=n||r||i,v=Xl(e,d,u,c),{segPlacements:b,hiddenGroups:E}=function(e,t,n,r){let i=[],s=[];for(let n=0;n<e.length;n+=1){let r=t[n];r?i.push({index:n,thickness:1,span:r}):s.push(e[n])}let{segRects:o,hiddenGroups:a}=Gl(i,n,r),l=[];for(let t of o)l.push({seg:e[t.index],rect:t});for(let e of s)l.push({seg:e,rect:null});return{segPlacements:l,hiddenGroups:a}}(e,v,l,o);return p(y,null,this.renderHiddenGroups(E,e),b.map(e=>{let{seg:o,rect:l}=e,c=o.eventRange.instance.instanceId,d=m||Boolean(!t[c]&&l),u=tc(l&&l.span),v=!m&&l?this.computeSegHStyle(l):{left:0,right:0},y=Boolean(l)&&l.stackForward>0,b=Boolean(l)&&l.span.end-l.span.start<a;return p("div",{className:"fc-timegrid-event-harness"+(y?" fc-timegrid-event-harness-inset":""),key:s||c,style:Object.assign(Object.assign({visibility:d?"":"hidden"},u),v)},p(Jl,Object.assign({seg:o,isDragging:n,isResizing:r,isDateSelecting:i,isSelected:c===h,isShort:b},mi(o,f,g))))}))}renderHiddenGroups(e,t){let{extraDateSpan:n,dateProfile:r,todayRange:i,nowDate:s,eventSelection:o,eventDrag:a,eventResize:l}=this.props;return p(y,null,e.map(e=>{let c=tc(e.span),d=(u=e.entries,h=t,u.map(e=>h[e.index]));var u,h;return p(Fl,{key:Ut(wo(d)),hiddenSegs:d,top:c.top,bottom:c.bottom,extraDateSpan:n,dateProfile:r,todayRange:i,nowDate:s,eventSelection:o,eventDrag:a,eventResize:l})}))}renderFillSegs(e,t){let{props:n,context:r}=this,i=Xl(e,n.date,n.slatCoords,r.options.eventMinHeight).map((r,i)=>{let s=e[i];return p("div",{key:yi(s.eventRange),className:"fc-timegrid-bg-harness",style:tc(r)},"bg-event"===t?p(go,Object.assign({seg:s},mi(s,n.todayRange,n.nowDate))):mo(t))});return p(y,null,i)}renderNowIndicator(e){let{slatCoords:t,date:n}=this.props;return t?e.map((e,r)=>p(lo,{key:r,elClasses:["fc-timegrid-now-indicator-line"],elStyle:{top:t.computeDateTop(e.start,n)},isAxis:!1,date:n})):null}computeSegHStyle(e){let t,n,{isRtl:r,options:i}=this.context,s=i.slotEventOverlap,o=e.levelCoord,a=e.levelCoord+e.thickness;s&&(a=Math.min(1,o+2*(a-o))),r?(t=1-a,n=o):(t=o,n=1-a);let l={zIndex:e.stackDepth+1,left:100*t+"%",right:100*n+"%"};return s&&!e.stackForward&&(l[r?"marginLeft":"marginRight"]=20),l}}function ec(e,{todayRange:t,nowDate:n,eventSelection:r,eventDrag:i,eventResize:s}){let o=(i?i.affectedInstances:null)||(s?s.affectedInstances:null)||{};return p(y,null,e.map(e=>{let i=e.eventRange.instance.instanceId;return p("div",{key:i,style:{visibility:o[i]?"hidden":""}},p(Jl,Object.assign({seg:e,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:i===r,isShort:!1},mi(e,t,n))))}))}function tc(e){return e?{top:e.start,bottom:-e.end}:{top:"",bottom:""}}class nc extends Gn{constructor(){super(...arguments),this.splitFgEventSegs=Gt(Wl),this.splitBgEventSegs=Gt(Wl),this.splitBusinessHourSegs=Gt(Wl),this.splitNowIndicatorSegs=Gt(Wl),this.splitDateSelectionSegs=Gt(Wl),this.splitEventDrag=Gt(Ll),this.splitEventResize=Gt(Ll),this.rootElRef={current:null},this.cellElRefs=new Vs}render(){let{props:e,context:t}=this,n=t.options.nowIndicator&&e.slatCoords&&e.slatCoords.safeComputeTop(e.nowDate),r=e.cells.length,i=this.splitFgEventSegs(e.fgEventSegs,r),s=this.splitBgEventSegs(e.bgEventSegs,r),o=this.splitBusinessHourSegs(e.businessHourSegs,r),a=this.splitNowIndicatorSegs(e.nowIndicatorSegs,r),l=this.splitDateSelectionSegs(e.dateSelectionSegs,r),c=this.splitEventDrag(e.eventDrag,r),d=this.splitEventResize(e.eventResize,r);return p("div",{className:"fc-timegrid-cols",ref:this.rootElRef},p("table",{role:"presentation",style:{minWidth:e.tableMinWidth,width:e.clientWidth}},e.tableColGroupNode,p("tbody",{role:"presentation"},p("tr",{role:"row"},e.axis&&p("td",{"aria-hidden":!0,className:"fc-timegrid-col fc-timegrid-axis"},p("div",{className:"fc-timegrid-col-frame"},p("div",{className:"fc-timegrid-now-indicator-container"},"number"==typeof n&&p(lo,{elClasses:["fc-timegrid-now-indicator-arrow"],elStyle:{top:n},isAxis:!0,date:e.nowDate})))),e.cells.map((t,n)=>p(Kl,{key:t.key,elRef:this.cellElRefs.createRef(t.key),dateProfile:e.dateProfile,date:t.date,nowDate:e.nowDate,todayRange:e.todayRange,extraRenderProps:t.extraRenderProps,extraDataAttrs:t.extraDataAttrs,extraClassNames:t.extraClassNames,extraDateSpan:t.extraDateSpan,fgEventSegs:i[n],bgEventSegs:s[n],businessHourSegs:o[n],nowIndicatorSegs:a[n],dateSelectionSegs:l[n],eventDrag:c[n],eventResize:d[n],slatCoords:e.slatCoords,eventSelection:e.eventSelection,forPrint:e.forPrint}))))))}componentDidMount(){this.updateCoords()}componentDidUpdate(){this.updateCoords()}updateCoords(){let{props:e}=this;var t;e.onColCoords&&null!==e.clientWidth&&e.onColCoords(new rs(this.rootElRef.current,(t=this.cellElRefs.currentMap,e.cells.map(e=>t[e.key])),!0,!1))}}class rc extends ls{constructor(){super(...arguments),this.processSlotOptions=Gt(ic),this.state={slatCoords:null},this.handleRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e,isHitComboAllowed:this.props.isHitComboAllowed}):this.context.unregisterInteractiveComponent(this)},this.handleScrollRequest=e=>{let{onScrollTopRequest:t}=this.props,{slatCoords:n}=this.state;if(t&&n){if(e.time){let r=n.computeTimeTop(e.time);r=Math.ceil(r),r&&(r+=1),t(r)}return!0}return!1},this.handleColCoords=e=>{this.colCoords=e},this.handleSlatCoords=e=>{this.setState({slatCoords:e}),this.props.onSlatCoords&&this.props.onSlatCoords(e)}}render(){let{props:e,state:t}=this;return p("div",{className:"fc-timegrid-body",ref:this.handleRootEl,style:{width:e.clientWidth,minWidth:e.tableMinWidth}},p(Ul,{axis:e.axis,dateProfile:e.dateProfile,slatMetas:e.slatMetas,clientWidth:e.clientWidth,minHeight:e.expandRows?e.clientHeight:"",tableMinWidth:e.tableMinWidth,tableColGroupNode:e.axis?e.tableColGroupNode:null,onCoords:this.handleSlatCoords}),p(nc,{cells:e.cells,axis:e.axis,dateProfile:e.dateProfile,businessHourSegs:e.businessHourSegs,bgEventSegs:e.bgEventSegs,fgEventSegs:e.fgEventSegs,dateSelectionSegs:e.dateSelectionSegs,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,todayRange:e.todayRange,nowDate:e.nowDate,nowIndicatorSegs:e.nowIndicatorSegs,clientWidth:e.clientWidth,tableMinWidth:e.tableMinWidth,tableColGroupNode:e.tableColGroupNode,slatCoords:t.slatCoords,onColCoords:this.handleColCoords,forPrint:e.forPrint}))}componentDidMount(){this.scrollResponder=this.context.createScrollResponder(this.handleScrollRequest)}componentDidUpdate(e){this.scrollResponder.update(e.dateProfile!==this.props.dateProfile)}componentWillUnmount(){this.scrollResponder.detach()}queryHit(e,t){let{dateEnv:n,options:r}=this.context,{colCoords:i}=this,{dateProfile:s}=this.props,{slatCoords:o}=this.state,{snapDuration:a,snapsPerSlot:l}=this.processSlotOptions(this.props.slotDuration,r.snapDuration),c=i.leftToIndex(e),d=o.positions.topToIndex(t);if(null!=c&&null!=d){let e=this.props.cells[c],r=o.positions.tops[d],u=o.positions.getHeight(d),h=(t-r)/u,f=d*l+Math.floor(h*l),g=this.props.cells[c].date,p=pt(s.slotMinTime,mt(a,f)),m=n.add(g,p),v=n.add(m,a);return{dateProfile:s,dateSpan:Object.assign({range:{start:m,end:v},allDay:!1},e.extraDateSpan),dayEl:i.els[c],rect:{left:i.lefts[c],right:i.rights[c],top:r,bottom:r+u},layer:0}}return null}}function ic(e,t){let n=t||e,r=bt(e,n);return null===r&&(n=e,r=1),{snapDuration:n,snapsPerSlot:r}}class sc extends Is{sliceRange(e,t){let n=[];for(let r=0;r<t.length;r+=1){let i=ir(e,t[r]);i&&n.push({start:i.start,end:i.end,isStart:i.start.valueOf()===e.start.valueOf(),isEnd:i.end.valueOf()===e.end.valueOf(),col:r})}return n}}class oc extends ls{constructor(){super(...arguments),this.buildDayRanges=Gt(ac),this.slicer=new sc,this.timeColsRef={current:null}}render(){let{props:e,context:t}=this,{dateProfile:n,dayTableModel:r}=e,{nowIndicator:i,nextDayThreshold:s}=t.options,o=this.buildDayRanges(r,n,t.dateEnv);return p(Rs,{unit:i?"minute":"day"},(a,l)=>p(rc,Object.assign({ref:this.timeColsRef},this.slicer.sliceProps(e,n,null,t,o),{forPrint:e.forPrint,axis:e.axis,dateProfile:n,slatMetas:e.slatMetas,slotDuration:e.slotDuration,cells:r.cells[0],tableColGroupNode:e.tableColGroupNode,tableMinWidth:e.tableMinWidth,clientWidth:e.clientWidth,clientHeight:e.clientHeight,expandRows:e.expandRows,nowDate:a,nowIndicatorSegs:i&&this.slicer.sliceNowDate(a,n,s,t,o),todayRange:l,onScrollTopRequest:e.onScrollTopRequest,onSlatCoords:e.onSlatCoords})))}}function ac(e,t,n){let r=[];for(let i of e.headerDates)r.push({start:n.add(i,t.slotMinTime),end:n.add(i,t.slotMaxTime)});return r}const lc=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}];function cc(e,t,n,r,i){let s=new Date(0),o=e,a=ft(0),l=n||function(e){let t,n,r;for(t=lc.length-1;t>=0;t-=1)if(n=ft(lc[t]),r=bt(n,e),null!==r&&r>1)return n;return e}(r),c=[];for(;yt(o)<yt(t);){let e=i.add(s,o),t=null!==bt(a,l);c.push({date:e,time:o,key:e.toISOString(),isoTimeStr:Ft(e),isLabeled:t}),o=pt(o,r),a=pt(a,r)}return c}function dc(e,t){let n=new ks(e.renderRange,t);return new Ms(n,!1)}var uc=Po({name:"@fullcalendar/timegrid",initialView:"timeGridWeek",optionRefiners:{allDaySlot:Boolean},views:{timeGrid:{component:class extends Hl{constructor(){super(...arguments),this.buildTimeColsModel=Gt(dc),this.buildSlatMetas=Gt(cc)}render(){let{options:e,dateEnv:t,dateProfileGenerator:n}=this.context,{props:r}=this,{dateProfile:i}=r,s=this.buildTimeColsModel(i,n),o=this.allDaySplitter.splitProps(r),a=this.buildSlatMetas(i.slotMinTime,i.slotMaxTime,e.slotLabelInterval,e.slotDuration,t),{dayMinWidth:l}=e,c=!l,d=l,u=e.dayHeaders&&p(_s,{dates:s.headerDates,dateProfile:i,datesRepDistinctDays:!0,renderIntro:c?this.renderHeadAxis:null}),h=!1!==e.allDaySlot&&(t=>p(wl,Object.assign({},o.allDay,{dateProfile:i,dayTableModel:s,nextDayThreshold:e.nextDayThreshold,tableMinWidth:t.tableMinWidth,colGroupNode:t.tableColGroupNode,renderRowIntro:c?this.renderTableRowAxis:null,showWeekNumbers:!1,expandRows:!1,headerAlignElRef:this.headerElRef,clientWidth:t.clientWidth,clientHeight:t.clientHeight,forPrint:r.forPrint},this.getAllDayMaxEventProps()))),f=t=>p(oc,Object.assign({},o.timed,{dayTableModel:s,dateProfile:i,axis:c,slotDuration:e.slotDuration,slatMetas:a,forPrint:r.forPrint,tableColGroupNode:t.tableColGroupNode,tableMinWidth:t.tableMinWidth,clientWidth:t.clientWidth,clientHeight:t.clientHeight,onSlatCoords:this.handleSlatCoords,expandRows:t.expandRows,onScrollTopRequest:this.handleScrollTopRequest}));return d?this.renderHScrollLayout(u,h,f,s.colCnt,l,a,this.state.slatCoords):this.renderSimpleLayout(u,h,f)}},usesMinMaxTime:!0,allDaySlot:!0,slotDuration:"00:30:00",slotEventOverlap:!0},timeGridDay:{type:"timeGrid",duration:{days:1}},timeGridWeek:{type:"timeGrid",duration:{weeks:1}}}});class hc extends Gn{constructor(){super(...arguments),this.state={textId:We()}}render(){let{theme:e,dateEnv:t,options:n,viewApi:r}=this.context,{cellId:i,dayDate:s,todayRange:o}=this.props,{textId:a}=this.state,l=Fi(s,o),c=n.listDayFormat?t.format(s,n.listDayFormat):"",d=n.listDaySideFormat?t.format(s,n.listDaySideFormat):"",u=Object.assign({date:t.toDate(s),view:r,textId:a,text:c,sideText:d,navLinkAttrs:qi(this.context,s),sideNavLinkAttrs:qi(this.context,s,"day",!1)},l);return p(Jn,{elTag:"tr",elClasses:["fc-list-day",...Vi(l,e)],elAttrs:{"data-date":Wt(s)},renderProps:u,generatorName:"dayHeaderContent",customGenerator:n.dayHeaderContent,defaultGenerator:fc,classNameGenerator:n.dayHeaderClassNames,didMount:n.dayHeaderDidMount,willUnmount:n.dayHeaderWillUnmount},t=>p("th",{scope:"colgroup",colSpan:3,id:i,"aria-labelledby":a},p(t,{elTag:"div",elClasses:["fc-list-day-cushion",e.getClass("tableCellShaded")]})))}}function fc(e){return p(y,null,e.text&&p("a",Object.assign({id:e.textId,className:"fc-list-day-text"},e.navLinkAttrs),e.text),e.sideText&&p("a",Object.assign({"aria-hidden":!0,className:"fc-list-day-side-text"},e.sideNavLinkAttrs),e.sideText))}const gc=an({hour:"numeric",minute:"2-digit",meridiem:"short"});class pc extends Gn{render(){let{props:e,context:t}=this,{options:n}=t,{seg:r,timeHeaderId:i,eventHeaderId:s,dateHeaderId:o}=e,a=n.eventTimeFormat||gc;return p(so,Object.assign({},e,{elTag:"tr",elClasses:["fc-list-event",r.eventRange.def.url&&"fc-event-forced-url"],defaultGenerator:()=>function(e,t){let n=bi(e,t);return p("a",Object.assign({},n),e.eventRange.def.title)}(r,t),seg:r,timeText:"",disableDragging:!0,disableResizing:!0}),(e,n)=>p(y,null,function(e,t,n,r,i){let{options:s}=n;if(!1!==s.displayEventTime){let o,a=e.eventRange.def,l=e.eventRange.instance,c=!1;if(a.allDay?c=!0:ur(e.eventRange.range)?e.isStart?o=pi(e,t,n,null,null,l.range.start,e.end):e.isEnd?o=pi(e,t,n,null,null,e.start,l.range.end):c=!0:o=pi(e,t,n),c){let e={text:n.options.allDayText,view:n.viewApi};return p(Jn,{elTag:"td",elClasses:["fc-list-event-time"],elAttrs:{headers:`${r} ${i}`},renderProps:e,generatorName:"allDayContent",customGenerator:s.allDayContent,defaultGenerator:mc,classNameGenerator:s.allDayClassNames,didMount:s.allDayDidMount,willUnmount:s.allDayWillUnmount})}return p("td",{className:"fc-list-event-time"},o)}return null}(r,a,t,i,o),p("td",{"aria-hidden":!0,className:"fc-list-event-graphic"},p("span",{className:"fc-list-event-dot",style:{borderColor:n.borderColor||n.backgroundColor}})),p(e,{elTag:"td",elClasses:["fc-list-event-title"],elAttrs:{headers:`${s} ${o}`}})))}}function mc(e){return e.text}function vc(e){return e.text}function yc(e){let t=Mt(e.renderRange.start),n=e.renderRange.end,r=[],i=[];for(;t<n;)r.push(t),i.push({start:t,end:wt(t,1)}),t=wt(t,1);return{dayDates:r,dayRanges:i}}xe(':root{--fc-list-event-dot-width:10px;--fc-list-event-hover-bg-color:#f5f5f5}.fc-theme-standard .fc-list{border:1px solid var(--fc-border-color)}.fc .fc-list-empty{align-items:center;background-color:var(--fc-neutral-bg-color);display:flex;height:100%;justify-content:center}.fc .fc-list-empty-cushion{margin:5em 0}.fc .fc-list-table{border-style:hidden;width:100%}.fc .fc-list-table tr>*{border-left:0;border-right:0}.fc .fc-list-sticky .fc-list-day>*{background:var(--fc-page-bg-color);position:sticky;top:0}.fc .fc-list-table thead{left:-10000px;position:absolute}.fc .fc-list-table tbody>tr:first-child th{border-top:0}.fc .fc-list-table th{padding:0}.fc .fc-list-day-cushion,.fc .fc-list-table td{padding:8px 14px}.fc .fc-list-day-cushion:after{clear:both;content:"";display:table}.fc-theme-standard .fc-list-day-cushion{background-color:var(--fc-neutral-bg-color)}.fc-direction-ltr .fc-list-day-text,.fc-direction-rtl .fc-list-day-side-text{float:left}.fc-direction-ltr .fc-list-day-side-text,.fc-direction-rtl .fc-list-day-text{float:right}.fc-direction-ltr .fc-list-table .fc-list-event-graphic{padding-right:0}.fc-direction-rtl .fc-list-table .fc-list-event-graphic{padding-left:0}.fc .fc-list-event.fc-event-forced-url{cursor:pointer}.fc .fc-list-event:hover td{background-color:var(--fc-list-event-hover-bg-color)}.fc .fc-list-event-graphic,.fc .fc-list-event-time{white-space:nowrap;width:1px}.fc .fc-list-event-dot{border:calc(var(--fc-list-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-list-event-dot-width)/2);box-sizing:content-box;display:inline-block;height:0;width:0}.fc .fc-list-event-title a{color:inherit;text-decoration:none}.fc .fc-list-event.fc-event-forced-url:hover a{text-decoration:underline}');function bc(e){return!1===e?null:an(e)}var Ec=Po({name:"@fullcalendar/list",optionRefiners:{listDayFormat:bc,listDaySideFormat:bc,noEventsClassNames:yn,noEventsContent:yn,noEventsDidMount:yn,noEventsWillUnmount:yn},views:{list:{component:class extends ls{constructor(){super(...arguments),this.computeDateVars=Gt(yc),this.eventStoreToSegs=Gt(this._eventStoreToSegs),this.state={timeHeaderId:We(),eventHeaderId:We(),dateHeaderIdRoot:We()},this.setRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e}):this.context.unregisterInteractiveComponent(this)}}render(){let{props:e,context:t}=this,{dayDates:n,dayRanges:r}=this.computeDateVars(e.dateProfile),i=this.eventStoreToSegs(e.eventStore,e.eventUiBases,r);return p(er,{elRef:this.setRootEl,elClasses:["fc-list",t.theme.getClass("table"),!1!==t.options.stickyHeaderDates?"fc-list-sticky":""],viewSpec:t.viewSpec},p(Fs,{liquid:!e.isHeightAuto,overflowX:e.isHeightAuto?"visible":"hidden",overflowY:e.isHeightAuto?"visible":"auto"},i.length>0?this.renderSegList(i,n):this.renderEmptyMessage()))}renderEmptyMessage(){let{options:e,viewApi:t}=this.context,n={text:e.noEventsText,view:t};return p(Jn,{elTag:"div",elClasses:["fc-list-empty"],renderProps:n,generatorName:"noEventsContent",customGenerator:e.noEventsContent,defaultGenerator:vc,classNameGenerator:e.noEventsClassNames,didMount:e.noEventsDidMount,willUnmount:e.noEventsWillUnmount},e=>p(e,{elTag:"div",elClasses:["fc-list-empty-cushion"]}))}renderSegList(e,t){let{theme:n,options:r}=this.context,{timeHeaderId:i,eventHeaderId:s,dateHeaderIdRoot:o}=this.state,a=function(e){let t,n,r=[];for(t=0;t<e.length;t+=1)n=e[t],(r[n.dayIndex]||(r[n.dayIndex]=[])).push(n);return r}(e);return p(Rs,{unit:"day"},(e,l)=>{let c=[];for(let n=0;n<a.length;n+=1){let d=a[n];if(d){let a=Wt(t[n]),u=o+"-"+a;c.push(p(hc,{key:a,cellId:u,dayDate:t[n],todayRange:l})),d=di(d,r.eventOrder);for(let t of d)c.push(p(pc,Object.assign({key:a+":"+t.eventRange.instance.instanceId,seg:t,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,timeHeaderId:i,eventHeaderId:s,dateHeaderId:u},mi(t,l,e))))}}return p("table",{className:"fc-list-table "+n.getClass("table")},p("thead",null,p("tr",null,p("th",{scope:"col",id:i},r.timeHint),p("th",{scope:"col","aria-hidden":!0}),p("th",{scope:"col",id:s},r.eventHint))),p("tbody",null,c))})}_eventStoreToSegs(e,t,n){return this.eventRangesToSegs(ii(e,t,this.props.dateProfile.activeRange,this.context.options.nextDayThreshold).fg,n)}eventRangesToSegs(e,t){let n=[];for(let r of e)n.push(...this.eventRangeToSegs(r,t));return n}eventRangeToSegs(e,t){let n,r,i,{dateEnv:s}=this.context,{nextDayThreshold:o}=this.context.options,a=e.range,l=e.def.allDay,c=[];for(n=0;n<t.length;n+=1)if(r=ir(a,t[n]),r&&(i={component:this,eventRange:e,start:r.start,end:r.end,isStart:e.isStart&&r.start.valueOf()===a.start.valueOf(),isEnd:e.isEnd&&r.end.valueOf()===a.end.valueOf(),dayIndex:n},c.push(i),!i.isEnd&&!l&&n+1<t.length&&a.end<s.add(t[n+1].start,o))){i.end=a.end,i.isEnd=!0;break}return c}},buttonTextKey:"list",listDayFormat:{month:"long",day:"numeric",year:"numeric"}},listDay:{type:"list",duration:{days:1},listDayFormat:{weekday:"long"}},listWeek:{type:"list",duration:{weeks:1},listDayFormat:{weekday:"long"},listDaySideFormat:{month:"long",day:"numeric",year:"numeric"}},listMonth:{type:"list",duration:{month:1},listDaySideFormat:{weekday:"long"}},listYear:{type:"list",duration:{year:1},listDaySideFormat:{weekday:"long"}}}});class Sc extends ls{constructor(){super(...arguments),this.buildDayTableModel=Gt(_l),this.slicer=new Dl,this.state={labelId:We()}}render(){const{props:e,state:t,context:n}=this,{dateProfile:r,forPrint:i}=e,{options:s}=n,o=this.buildDayTableModel(r,n.dateProfileGenerator),a=this.slicer.sliceProps(e,r,s.nextDayThreshold,n,o),l=null!=e.tableWidth?e.tableWidth/s.aspectRatio:null,c=o.cells.length,d=null!=l?l/c:null;return p("div",{ref:e.elRef,"data-date":e.isoDateStr,className:"fc-multimonth-month",style:{width:e.width},role:"grid","aria-labelledby":t.labelId},p("div",{className:"fc-multimonth-header",style:{marginBottom:d},role:"presentation"},p("div",{className:"fc-multimonth-title",id:t.labelId},n.dateEnv.format(e.dateProfile.currentRange.start,e.titleFormat)),p("table",{className:["fc-multimonth-header-table",n.theme.getClass("table")].join(" "),role:"presentation"},p("thead",{role:"rowgroup"},p(_s,{dateProfile:e.dateProfile,dates:o.headerDates,datesRepDistinctDays:!1})))),p("div",{className:["fc-multimonth-daygrid","fc-daygrid","fc-daygrid-body",!i&&"fc-daygrid-body-balanced",i&&"fc-daygrid-body-unbalanced",i&&"fc-daygrid-body-natural"].join(" "),style:{marginTop:-d}},p("table",{className:["fc-multimonth-daygrid-table",n.theme.getClass("table")].join(" "),style:{height:i?"":l},role:"presentation"},p("tbody",{role:"rowgroup"},p(El,Object.assign({},a,{dateProfile:r,cells:o.cells,eventSelection:e.eventSelection,dayMaxEvents:!i,dayMaxEventRows:!i,showWeekNumbers:s.weekNumbers,clientWidth:e.clientWidth,clientHeight:e.clientHeight,forPrint:i}))))))}}const Ac=ft(1,"month");function Dc(e,t,n,r,i){const{start:s,end:o}=t.currentRange;let a=s;const l=[];for(;a.valueOf()<o.valueOf();){const s=n.add(a,Ac),o={start:e.skipHiddenDays(a),end:e.skipHiddenDays(s,-1,!0)};let c=Rl({currentRange:o,snapToWeek:!0,fixedWeekCount:r,dateEnv:n});c={start:e.skipHiddenDays(c.start),end:e.skipHiddenDays(c.end,-1,!0)};const d=t.activeRange?ir(t.activeRange,i?c:o):null;l.push({currentDate:t.currentDate,isValid:t.isValid,validRange:t.validRange,renderRange:c,activeRange:d,currentRange:o,currentRangeUnit:"month",isRangeAllDay:!0,dateIncrement:t.dateIncrement,slotMinTime:t.slotMaxTime,slotMaxTime:t.slotMinTime}),a=s}return l}const wc=an({year:"numeric",month:"long"}),Cc=an({month:"long"});function Rc(e,t){return e||(t[0].currentRange.start.getUTCFullYear()!==t[t.length-1].currentRange.start.getUTCFullYear()?wc:Cc)}const xc={multiMonthTitleFormat:an,multiMonthMaxColumns:Number,multiMonthMinWidth:Number};xe(".fc .fc-multimonth{border:1px solid var(--fc-border-color);display:flex;flex-wrap:wrap;overflow-x:hidden;overflow-y:auto}.fc .fc-multimonth-title{font-size:1.2em;font-weight:700;padding:1em 0;text-align:center}.fc .fc-multimonth-daygrid{background:var(--fc-page-bg-color)}.fc .fc-multimonth-daygrid-table,.fc .fc-multimonth-header-table{table-layout:fixed;width:100%}.fc .fc-multimonth-daygrid-table{border-top-style:hidden!important}.fc .fc-multimonth-singlecol .fc-multimonth{position:relative}.fc .fc-multimonth-singlecol .fc-multimonth-header{background:var(--fc-page-bg-color);position:relative;top:0;z-index:2}.fc .fc-multimonth-singlecol .fc-multimonth-daygrid{position:relative;z-index:1}.fc .fc-multimonth-singlecol .fc-multimonth-daygrid-table,.fc .fc-multimonth-singlecol .fc-multimonth-header-table{border-left-style:hidden;border-right-style:hidden}.fc .fc-multimonth-singlecol .fc-multimonth-month:last-child .fc-multimonth-daygrid-table{border-bottom-style:hidden}.fc .fc-multimonth-multicol{line-height:1}.fc .fc-multimonth-multicol .fc-multimonth-month{padding:0 1.2em 1.2em}.fc .fc-multimonth-multicol .fc-daygrid-more-link{border:1px solid var(--fc-event-border-color);display:block;float:none;padding:1px}.fc .fc-multimonth-compact{line-height:1}.fc .fc-multimonth-compact .fc-multimonth-daygrid-table,.fc .fc-multimonth-compact .fc-multimonth-header-table{font-size:.9em}.fc-media-screen .fc-multimonth-singlecol .fc-multimonth-header{position:sticky}.fc-media-print .fc-multimonth{overflow:visible}");var _c=Po({name:"@fullcalendar/multimonth",initialView:"multiMonthYear",optionRefiners:xc,views:{multiMonth:{component:class extends ls{constructor(){super(...arguments),this.splitDateProfileByMonth=Gt(Dc),this.buildMonthFormat=Gt(Rc),this.scrollElRef={current:null},this.firstMonthElRef={current:null},this.needsScrollReset=!1,this.handleSizing=e=>{e&&this.updateSize()}}render(){const{context:e,props:t,state:n}=this,{options:r}=e,{clientWidth:i,clientHeight:s}=n,o=n.monthHPadding||0,a=Math.min(null!=i?Math.floor(i/(r.multiMonthMinWidth+o)):1,r.multiMonthMaxColumns)||1,l=100/a+"%",c=null==i?null:i/a-o,d=null!=i&&1===a,u=this.splitDateProfileByMonth(e.dateProfileGenerator,t.dateProfile,e.dateEnv,!d&&r.fixedWeekCount,r.showNonCurrentDates),h=this.buildMonthFormat(r.multiMonthTitleFormat,u),f=["fc-multimonth",d?"fc-multimonth-singlecol":"fc-multimonth-multicol",null!=c&&c<400?"fc-multimonth-compact":""];return p(er,{elRef:this.scrollElRef,elClasses:f,viewSpec:e.viewSpec},u.map((e,n)=>{const r=Lt(e.currentRange.start);return p(Sc,Object.assign({},t,{key:r,isoDateStr:r,elRef:0===n?this.firstMonthElRef:void 0,titleFormat:h,dateProfile:e,width:l,tableWidth:c,clientWidth:i,clientHeight:s}))}))}componentDidMount(){this.updateSize(),this.context.addResizeHandler(this.handleSizing),this.requestScrollReset()}componentDidUpdate(e){Cn(e,this.props)||this.handleSizing(!1),e.dateProfile!==this.props.dateProfile?this.requestScrollReset():this.flushScrollReset()}componentWillUnmount(){this.context.removeResizeHandler(this.handleSizing)}updateSize(){const e=this.scrollElRef.current,t=this.firstMonthElRef.current;e&&this.setState({clientWidth:e.clientWidth,clientHeight:e.clientHeight}),t&&e&&null==this.state.monthHPadding&&this.setState({monthHPadding:e.clientWidth-t.firstChild.offsetWidth})}requestScrollReset(){this.needsScrollReset=!0,this.flushScrollReset()}flushScrollReset(){if(this.needsScrollReset&&null!=this.state.monthHPadding){const{currentDate:e}=this.props.dateProfile,t=this.scrollElRef.current,n=t.querySelector(`[data-date="${Lt(e)}"]`);t.scrollTop=n.getBoundingClientRect().top-this.firstMonthElRef.current.getBoundingClientRect().top,this.needsScrollReset=!1}}shouldComponentUpdate(){return!0}},dateProfileGeneratorClass:Cl,multiMonthMinWidth:350,multiMonthMaxColumns:3},multiMonthYear:{type:"multiMonth",duration:{years:1},fixedWeekCount:!0,showNonCurrentDates:!1}}});return ca.push(el,Tl,uc,Ec,_c),e.Calendar=class extends Ni{constructor(e,t={}){super(),this.isRendering=!1,this.isRendered=!1,this.currentClassNames=[],this.customContentRenderId=0,this.handleAction=e=>{switch(e.type){case"SET_EVENT_DRAG":case"SET_EVENT_RESIZE":this.renderRunner.tryDrain()}},this.handleData=e=>{this.currentData=e,this.renderRunner.request(e.calendarOptions.rerenderDelay)},this.handleRenderRequest=()=>{if(this.isRendering){this.isRendered=!0;let{currentData:e}=this;jn(()=>{U(p(ki,{options:e.calendarOptions,theme:e.theme,emitter:e.emitter},(t,n,r,i)=>(this.setClassNames(t),this.setHeight(n),p($n.Provider,{value:this.customContentRenderId},p(_a,Object.assign({isHeightAuto:r,forPrint:i},e))))),this.el)})}else this.isRendered&&(this.isRendered=!1,U(null,this.el),this.setClassNames([]),this.setHeight(""))},function(e){e.isConnected&&_e(e.getRootNode())}(e),this.el=e,this.renderRunner=new Me(this.handleRenderRequest),new ha({optionOverrides:t,calendarApi:this,onAction:this.handleAction,onData:this.handleData})}render(){let e=this.isRendering;e?this.customContentRenderId+=1:this.isRendering=!0,this.renderRunner.request(),e&&this.updateSize()}destroy(){this.isRendering&&(this.isRendering=!1,this.renderRunner.request())}updateSize(){jn(()=>{super.updateSize()})}batchRendering(e){this.renderRunner.pause("batchRendering"),e(),this.renderRunner.resume("batchRendering")}pauseRendering(){this.renderRunner.pause("pauseRendering")}resumeRendering(){this.renderRunner.resume("pauseRendering",!0)}resetOptions(e,t){this.currentDataManager.resetOptions(e,t)}setClassNames(e){if(!St(e,this.currentClassNames)){let{classList:t}=this.el;for(let e of this.currentClassNames)t.remove(e);for(let n of e)t.add(n);this.currentClassNames=e}}setHeight(e){je(this.el,"height",e)}},e.Draggable=class{constructor(e,t={}){this.handlePointerDown=e=>{let{dragging:t}=this,{minDistance:n,longPressDelay:r}=this.settings;t.minDistance=null!=n?n:e.isTouch?0:cn.eventDragMinDistance,t.delay=e.isTouch?null!=r?r:cn.longPressDelay:0},this.handleDragStart=e=>{e.isTouch&&this.dragging.delay&&e.subjectEl.classList.contains("fc-event")&&this.dragging.mirror.getMirrorEl().classList.add("fc-event-selected")},this.settings=t;let n=this.dragging=new Fa(e);n.touchScrollAllowed=!1,null!=t.itemSelector&&(n.pointer.selector=t.itemSelector),null!=t.appendTo&&(n.mirror.parentNode=t.appendTo),n.emitter.on("pointerdown",this.handlePointerDown),n.emitter.on("dragstart",this.handleDragStart),new Ja(n,t.eventData)}destroy(){this.dragging.destroy()}},e.Internal=xo,e.JsonRequestError=Ri,e.Preact=_o,e.ThirdPartyDraggable=class{constructor(e,t){let n=document;e===document||e instanceof Element?(n=e,t=t||{}):t=e||{};let r=this.dragging=new Ka(n);"string"==typeof t.itemSelector?r.pointer.selector=t.itemSelector:n===document&&(r.pointer.selector="[data-event]"),"string"==typeof t.mirrorSelector&&(r.mirrorSelector=t.mirrorSelector),new Ja(r,t.eventData)}destroy(){this.dragging.destroy()}},e.createPlugin=Po,e.formatDate=function(e,t={}){let n=Ma(t),r=an(t),i=n.createMarkerMeta(e);return i?n.format(i.marker,r,{forcedTzo:i.forcedTzo}):""},e.formatRange=function(e,t,n){let r=Ma("object"==typeof n&&n?n:{}),i=an(n),s=r.createMarkerMeta(e),o=r.createMarkerMeta(t);return s&&o?r.formatRange(s.marker,o.marker,i,{forcedStartTzo:s.forcedTzo,forcedEndTzo:o.forcedTzo,isEndExclusive:n.isEndExclusive,defaultSeparator:cn.defaultRangeSeparator}):""},e.globalLocales=To,e.globalPlugins=ca,e.sliceEvents=function(e,t){return ii(e.eventStore,e.eventUiBases,e.dateProfile.activeRange,t?e.nextDayThreshold:null).fg},e.version="6.1.9",Object.defineProperty(e,"__esModule",{value:!0}),e}({});;
vendor: 30,559 bytes, line 779
779/*! tooltipster v4.2.8 */!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){function b(a){this.$container,this.constraints=null,this.__$tooltip,this.__init(a)}function c(b,c){var d=!0;return a.each(b,function(a,e){return void 0===c[a]||b[a]!==c[a]?(d=!1,!1):void 0}),d}function d(b){var c=b.attr("id"),d=c?h.window.document.getElementById(c):null;return d?d===b[0]:a.contains(h.window.document.body,b[0])}function e(){if(!g)return!1;var a=g.document.body||g.document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e<d.length;e++)if("string"==typeof b[d[e]+c])return!0;return!1}var f={animation:"fade",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:null,plugins:["sideTip"],repositionOnScroll:!1,restoration:"none",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:"hover",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:"rotate",zIndex:9999999},g="undefined"!=typeof window?window:null,h={hasTouchCapability:!(!g||!("ontouchstart"in g||g.DocumentTouch&&g.document instanceof g.DocumentTouch||g.navigator.maxTouchPoints)),hasTransitions:e(),IE:!1,semVer:"4.2.8",window:g},i=function(){this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__instancesLatestArr=[],this.__plugins={},this._env=h};i.prototype={__bridge:function(b,c,d){if(!c[d]){var e=function(){};e.prototype=b;var g=new e;g.__init&&g.__init(c),a.each(b,function(a,b){0!=a.indexOf("__")&&(c[a]?f.debug&&console.log("The "+a+" method of the "+d+" plugin conflicts with another plugin or native methods"):(c[a]=function(){return g[a].apply(g,Array.prototype.slice.apply(arguments))},c[a].bridged=g))}),c[d]=g}return this},__setWindow:function(a){return h.window=a,this},_getRuler:function(a){return new b(a)},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_plugin:function(b){var c=this;if("string"==typeof b){var d=b,e=null;return d.indexOf(".")>0?e=c.__plugins[d]:a.each(c.__plugins,function(a,b){return b.name.substring(b.name.length-d.length-1)=="."+d?(e=b,!1):void 0}),e}if(b.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return c.__plugins[b.name]=b,b.core&&c.__bridge(b.core,c,b.name),this},_trigger:function(){var a=Array.prototype.slice.apply(arguments);return"string"==typeof a[0]&&(a[0]={type:a[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,a),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,a),this},instances:function(b){var c=[],d=b||".tooltipstered";return a(d).each(function(){var b=a(this),d=b.data("tooltipster-ns");d&&a.each(d,function(a,d){c.push(b.data(d))})}),c},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(b){var c=b?b+" ":"";return a(c+".tooltipstered").toArray()},setDefaults:function(b){return a.extend(f,b),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.tooltipster=new i,a.Tooltipster=function(b,c){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(b,c)},a.Tooltipster.prototype={__init:function(b,c){var d=this;if(d._$origin=a(b),d.__options=a.extend(!0,{},f,c),d.__optionsFormat(),!h.IE||h.IE>=d.__options.IEmin){var e=null;if(void 0===d._$origin.data("tooltipster-initialTitle")&&(e=d._$origin.attr("title"),void 0===e&&(e=null),d._$origin.data("tooltipster-initialTitle",e)),null!==d.__options.content)d.__contentSet(d.__options.content);else{var g,i=d._$origin.attr("data-tooltip-content");i&&(g=a(i)),g&&g[0]?d.__contentSet(g.first()):d.__contentSet(e)}d._$origin.removeAttr("title").addClass("tooltipstered"),d.__prepareOrigin(),d.__prepareGC(),a.each(d.__options.plugins,function(a,b){d._plug(b)}),h.hasTouchCapability&&a(h.window.document.body).on("touchmove."+d.__namespace+"-triggerOpen",function(a){d._touchRecordEvent(a)}),d._on("created",function(){d.__prepareTooltip()})._on("repositioned",function(a){d.__lastPosition=a.position})}else d.__options.disabled=!0},__contentInsert:function(){var a=this,b=a._$tooltip.find(".tooltipster-content"),c=a.__Content,d=function(a){c=a};return a._trigger({type:"format",content:a.__Content,format:d}),a.__options.functionFormat&&(c=a.__options.functionFormat.call(a,a,{origin:a._$origin[0]},a.__Content)),"string"!=typeof c||a.__options.contentAsHTML?b.empty().append(c):b.text(c),a},__contentSet:function(b){return b instanceof a&&this.__options.contentCloning&&(b=b.clone(!0)),this.__Content=b,this._trigger({type:"updated",content:b}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var b=this,c=b._$origin,d=b._$origin.is("area");if(d){var e=b._$origin.parent().attr("name");c=a('img[usemap="#'+e+'"]')}var f=c[0].getBoundingClientRect(),g=a(h.window.document),i=a(h.window),j=c,k={available:{document:null,window:null},document:{size:{height:g.height(),width:g.width()}},window:{scroll:{left:h.window.scrollX||h.window.document.documentElement.scrollLeft,top:h.window.scrollY||h.window.document.documentElement.scrollTop},size:{height:i.height(),width:i.width()}},origin:{fixedLineage:!1,offset:{},size:{height:f.bottom-f.top,width:f.right-f.left},usemapImage:d?c[0]:null,windowOffset:{bottom:f.bottom,left:f.left,right:f.right,top:f.top}}};if(d){var l=b._$origin.attr("shape"),m=b._$origin.attr("coords");if(m&&(m=m.split(","),a.map(m,function(a,b){m[b]=parseInt(a)})),"default"!=l)switch(l){case"circle":var n=m[0],o=m[1],p=m[2],q=o-p,r=n-p;k.origin.size.height=2*p,k.origin.size.width=k.origin.size.height,k.origin.windowOffset.left+=r,k.origin.windowOffset.top+=q;break;case"rect":var s=m[0],t=m[1],u=m[2],v=m[3];k.origin.size.height=v-t,k.origin.size.width=u-s,k.origin.windowOffset.left+=s,k.origin.windowOffset.top+=t;break;case"poly":for(var w=0,x=0,y=0,z=0,A="even",B=0;B<m.length;B++){var C=m[B];"even"==A?(C>y&&(y=C,0===B&&(w=y)),w>C&&(w=C),A="odd"):(C>z&&(z=C,1==B&&(x=z)),x>C&&(x=C),A="even")}k.origin.size.height=z-x,k.origin.size.width=y-w,k.origin.windowOffset.left+=w,k.origin.windowOffset.top+=x}}var D=function(a){k.origin.size.height=a.height,k.origin.windowOffset.left=a.left,k.origin.windowOffset.top=a.top,k.origin.size.width=a.width};for(b._trigger({type:"geometry",edit:D,geometry:{height:k.origin.size.height,left:k.origin.windowOffset.left,top:k.origin.windowOffset.top,width:k.origin.size.width}}),k.origin.windowOffset.right=k.origin.windowOffset.left+k.origin.size.width,k.origin.windowOffset.bottom=k.origin.windowOffset.top+k.origin.size.height,k.origin.offset.left=k.origin.windowOffset.left+k.window.scroll.left,k.origin.offset.top=k.origin.windowOffset.top+k.window.scroll.top,k.origin.offset.bottom=k.origin.offset.top+k.origin.size.height,k.origin.offset.right=k.origin.offset.left+k.origin.size.width,k.available.document={bottom:{height:k.document.size.height-k.origin.offset.bottom,width:k.document.size.width},left:{height:k.document.size.height,width:k.origin.offset.left},right:{height:k.document.size.height,width:k.document.size.width-k.origin.offset.right},top:{height:k.origin.offset.top,width:k.document.size.width}},k.available.window={bottom:{height:Math.max(k.window.size.height-Math.max(k.origin.windowOffset.bottom,0),0),width:k.window.size.width},left:{height:k.window.size.height,width:Math.max(k.origin.windowOffset.left,0)},right:{height:k.window.size.height,width:Math.max(k.window.size.width-Math.max(k.origin.windowOffset.right,0),0)},top:{height:Math.max(k.origin.windowOffset.top,0),width:k.window.size.width}};"html"!=j[0].tagName.toLowerCase();){if("fixed"==j.css("position")){k.origin.fixedLineage=!0;break}j=j.parent()}return k},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=a(h.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=a(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var b=this;return b.__options.selfDestruction?b.__garbageCollector=setInterval(function(){var c=(new Date).getTime();b.__touchEvents=a.grep(b.__touchEvents,function(a,b){return c-a.time>6e4}),d(b._$origin)||b.close(function(){b.destroy()})},2e4):clearInterval(b.__garbageCollector),b},__prepareOrigin:function(){var a=this;if(a._$origin.off("."+a.__namespace+"-triggerOpen"),h.hasTouchCapability&&a._$origin.on("touchstart."+a.__namespace+"-triggerOpen touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen",function(b){a._touchRecordEvent(b)}),a.__options.triggerOpen.click||a.__options.triggerOpen.tap&&h.hasTouchCapability){var b="";a.__options.triggerOpen.click&&(b+="click."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.tap&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&a._open(b)})}if(a.__options.triggerOpen.mouseenter||a.__options.triggerOpen.touchstart&&h.hasTouchCapability){var b="";a.__options.triggerOpen.mouseenter&&(b+="mouseenter."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.touchstart&&h.hasTouchCapability&&(b+="touchstart."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){!a._touchIsTouchEvent(b)&&a._touchIsEmulatedEvent(b)||(a.__pointerIsOverOrigin=!0,a._openShortly(b))})}if(a.__options.triggerClose.mouseleave||a.__options.triggerClose.touchleave&&h.hasTouchCapability){var b="";a.__options.triggerClose.mouseleave&&(b+="mouseleave."+a.__namespace+"-triggerOpen "),a.__options.triggerClose.touchleave&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&(a.__pointerIsOverOrigin=!1)})}return a},__prepareTooltip:function(){var b=this,c=b.__options.interactive?"auto":"";return b._$tooltip.attr("id",b.__namespace).css({"pointer-events":c,zIndex:b.__options.zIndex}),a.each(b.__previousThemes,function(a,c){b._$tooltip.removeClass(c)}),a.each(b.__options.theme,function(a,c){b._$tooltip.addClass(c)}),b.__previousThemes=a.merge([],b.__options.theme),b},__scrollHandler:function(b){var c=this;if(c.__options.triggerClose.scroll)c._close(b);else if(d(c._$origin)&&d(c._$tooltip)){var e=null;if(b.target===h.window.document)c.__Geometry.origin.fixedLineage||c.__options.repositionOnScroll&&c.reposition(b);else{e=c.__geometry();var f=!1;if("fixed"!=c._$origin.css("position")&&c.__$originParents.each(function(b,c){var d=a(c),g=d.css("overflow-x"),h=d.css("overflow-y");if("visible"!=g||"visible"!=h){var i=c.getBoundingClientRect();if("visible"!=g&&(e.origin.windowOffset.left<i.left||e.origin.windowOffset.right>i.right))return f=!0,!1;if("visible"!=h&&(e.origin.windowOffset.top<i.top||e.origin.windowOffset.bottom>i.bottom))return f=!0,!1}return"fixed"==d.css("position")?!1:void 0}),f)c._$tooltip.css("visibility","hidden");else if(c._$tooltip.css("visibility","visible"),c.__options.repositionOnScroll)c.reposition(b);else{var g=e.origin.offset.left-c.__Geometry.origin.offset.left,i=e.origin.offset.top-c.__Geometry.origin.offset.top;c._$tooltip.css({left:c.__lastPosition.coord.left+g,top:c.__lastPosition.coord.top+i})}}c._trigger({type:"scroll",event:b,geo:e})}return c},__stateSet:function(a){return this.__state=a,this._trigger({type:"state",state:a}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,a.each(this.__timeouts.close,function(a,b){clearTimeout(b)}),this.__timeouts.close=[],this},__trackerStart:function(){var a=this,b=a._$tooltip.find(".tooltipster-content");return a.__options.trackTooltip&&(a.__contentBcr=b[0].getBoundingClientRect()),a.__tracker=setInterval(function(){if(d(a._$origin)&&d(a._$tooltip)){if(a.__options.trackOrigin){var e=a.__geometry(),f=!1;c(e.origin.size,a.__Geometry.origin.size)&&(a.__Geometry.origin.fixedLineage?c(e.origin.windowOffset,a.__Geometry.origin.windowOffset)&&(f=!0):c(e.origin.offset,a.__Geometry.origin.offset)&&(f=!0)),f||(a.__options.triggerClose.mouseleave?a._close():a.reposition())}if(a.__options.trackTooltip){var g=b[0].getBoundingClientRect();g.height===a.__contentBcr.height&&g.width===a.__contentBcr.width||(a.reposition(),a.__contentBcr=g)}}else a._close()},a.__options.trackerInterval),a},_close:function(b,c,d){var e=this,f=!0;if(e._trigger({type:"close",event:b,stop:function(){f=!1}}),f||d){c&&e.__callbacks.close.push(c),e.__callbacks.open=[],e.__timeoutsClear();var g=function(){a.each(e.__callbacks.close,function(a,c){c.call(e,e,{event:b,origin:e._$origin[0]})}),e.__callbacks.close=[]};if("closed"!=e.__state){var i=!0,j=new Date,k=j.getTime(),l=k+e.__options.animationDuration[1];if("disappearing"==e.__state&&l>e.__closingTime&&e.__options.animationDuration[1]>0&&(i=!1),i){e.__closingTime=l,"disappearing"!=e.__state&&e.__stateSet("disappearing");var m=function(){clearInterval(e.__tracker),e._trigger({type:"closing",event:b}),e._$tooltip.off("."+e.__namespace+"-triggerClose").removeClass("tooltipster-dying"),a(h.window).off("."+e.__namespace+"-triggerClose"),e.__$originParents.each(function(b,c){a(c).off("scroll."+e.__namespace+"-triggerClose")}),e.__$originParents=null,a(h.window.document.body).off("."+e.__namespace+"-triggerClose"),e._$origin.off("."+e.__namespace+"-triggerClose"),e._off("dismissable"),e.__stateSet("closed"),e._trigger({type:"after",event:b}),e.__options.functionAfter&&e.__options.functionAfter.call(e,e,{event:b,origin:e._$origin[0]}),g()};h.hasTransitions?(e._$tooltip.css({"-moz-animation-duration":e.__options.animationDuration[1]+"ms","-ms-animation-duration":e.__options.animationDuration[1]+"ms","-o-animation-duration":e.__options.animationDuration[1]+"ms","-webkit-animation-duration":e.__options.animationDuration[1]+"ms","animation-duration":e.__options.animationDuration[1]+"ms","transition-duration":e.__options.animationDuration[1]+"ms"}),e._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),e.__options.animationDuration[1]>0&&e._$tooltip.delay(e.__options.animationDuration[1]),e._$tooltip.queue(m)):e._$tooltip.stop().fadeOut(e.__options.animationDuration[1],m)}}else g()}return e},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(b,c){var e=this;if(!e.__destroying&&d(e._$origin)&&e.__enabled){var f=!0;if("closed"==e.__state&&(e._trigger({type:"before",event:b,stop:function(){f=!1}}),f&&e.__options.functionBefore&&(f=e.__options.functionBefore.call(e,e,{event:b,origin:e._$origin[0]}))),f!==!1&&null!==e.__Content){c&&e.__callbacks.open.push(c),e.__callbacks.close=[],e.__timeoutsClear();var g,i=function(){"stable"!=e.__state&&e.__stateSet("stable"),a.each(e.__callbacks.open,function(a,b){b.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}),e.__callbacks.open=[]};if("closed"!==e.__state)g=0,"disappearing"===e.__state?(e.__stateSet("appearing"),h.hasTransitions?(e._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i)):e._$tooltip.stop().fadeIn(i)):"stable"==e.__state&&i();else{if(e.__stateSet("appearing"),g=e.__options.animationDuration[0],e.__contentInsert(),e.reposition(b,!0),h.hasTransitions?(e._$tooltip.addClass("tooltipster-"+e.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":e.__options.animationDuration[0]+"ms","-ms-animation-duration":e.__options.animationDuration[0]+"ms","-o-animation-duration":e.__options.animationDuration[0]+"ms","-webkit-animation-duration":e.__options.animationDuration[0]+"ms","animation-duration":e.__options.animationDuration[0]+"ms","transition-duration":e.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=e.__state&&(e._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i))},0)):e._$tooltip.css("display","none").fadeIn(e.__options.animationDuration[0],i),e.__trackerStart(),a(h.window).on("resize."+e.__namespace+"-triggerClose",function(b){var c=a(document.activeElement);(c.is("input")||c.is("textarea"))&&a.contains(e._$tooltip[0],c[0])||e.reposition(b)}).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)}),e.__$originParents=e._$origin.parents(),e.__$originParents.each(function(b,c){a(c).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)})}),e.__options.triggerClose.mouseleave||e.__options.triggerClose.touchleave&&h.hasTouchCapability){e._on("dismissable",function(a){a.dismissable?a.delay?(m=setTimeout(function(){e._close(a.event)},a.delay),e.__timeouts.close.push(m)):e._close(a):clearTimeout(m)});var j=e._$origin,k="",l="",m=null;e.__options.interactive&&(j=j.add(e._$tooltip)),e.__options.triggerClose.mouseleave&&(k+="mouseenter."+e.__namespace+"-triggerClose ",l+="mouseleave."+e.__namespace+"-triggerClose "),e.__options.triggerClose.touchleave&&h.hasTouchCapability&&(k+="touchstart."+e.__namespace+"-triggerClose",l+="touchend."+e.__namespace+"-triggerClose touchcancel."+e.__namespace+"-triggerClose"),j.on(l,function(a){if(e._touchIsTouchEvent(a)||!e._touchIsEmulatedEvent(a)){var b="mouseleave"==a.type?e.__options.delay:e.__options.delayTouch;e._trigger({delay:b[1],dismissable:!0,event:a,type:"dismissable"})}}).on(k,function(a){!e._touchIsTouchEvent(a)&&e._touchIsEmulatedEvent(a)||e._trigger({dismissable:!1,event:a,type:"dismissable"})})}e.__options.triggerClose.originClick&&e._$origin.on("click."+e.__namespace+"-triggerClose",function(a){e._touchIsTouchEvent(a)||e._touchIsEmulatedEvent(a)||e._close(a)}),(e.__options.triggerClose.click||e.__options.triggerClose.tap&&h.hasTouchCapability)&&setTimeout(function(){if("closed"!=e.__state){var b="",c=a(h.window.document.body);e.__options.triggerClose.click&&(b+="click."+e.__namespace+"-triggerClose "),e.__options.triggerClose.tap&&h.hasTouchCapability&&(b+="touchend."+e.__namespace+"-triggerClose"),c.on(b,function(b){e._touchIsMeaningfulEvent(b)&&(e._touchRecordEvent(b),e.__options.interactive&&a.contains(e._$tooltip[0],b.target)||e._close(b))}),e.__options.triggerClose.tap&&h.hasTouchCapability&&c.on("touchstart."+e.__namespace+"-triggerClose",function(a){e._touchRecordEvent(a)})}},0),e._trigger("ready"),e.__options.functionReady&&e.__options.functionReady.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}if(e.__options.timer>0){var m=setTimeout(function(){e._close()},e.__options.timer+g);e.__timeouts.close.push(m)}}}return e},_openShortly:function(a){var b=this,c=!0;if("stable"!=b.__state&&"appearing"!=b.__state&&!b.__timeouts.open&&(b._trigger({type:"start",event:a,stop:function(){c=!1}}),c)){var d=0==a.type.indexOf("touch")?b.__options.delayTouch:b.__options.delay;d[0]?b.__timeouts.open=setTimeout(function(){b.__timeouts.open=null,b.__pointerIsOverOrigin&&b._touchIsMeaningfulEvent(a)?(b._trigger("startend"),b._open(a)):b._trigger("startcancel")},d[0]):(b._trigger("startend"),b._open(a))}return b},_optionsExtract:function(b,c){var d=this,e=a.extend(!0,{},c),f=d.__options[b];return f||(f={},a.each(c,function(a,b){var c=d.__options[a];void 0!==c&&(f[a]=c)})),a.each(e,function(b,c){void 0!==f[b]&&("object"!=typeof c||c instanceof Array||null==c||"object"!=typeof f[b]||f[b]instanceof Array||null==f[b]?e[b]=f[b]:a.extend(e[b],f[b]))}),e},_plug:function(b){var c=a.tooltipster._plugin(b);if(!c)throw new Error('The "'+b+'" plugin is not defined');return c.instance&&a.tooltipster.__bridge(c.instance,this,c.name),this},_touchIsEmulatedEvent:function(a){for(var b=!1,c=(new Date).getTime(),d=this.__touchEvents.length-1;d>=0;d--){var e=this.__touchEvents[d];if(!(c-e.time<500))break;e.target===a.target&&(b=!0)}return b},_touchIsMeaningfulEvent:function(a){return this._touchIsTouchEvent(a)&&!this._touchSwiped(a.target)||!this._touchIsTouchEvent(a)&&!this._touchIsEmulatedEvent(a)},_touchIsTouchEvent:function(a){return 0==a.type.indexOf("touch")},_touchRecordEvent:function(a){return this._touchIsTouchEvent(a)&&(a.time=(new Date).getTime(),this.__touchEvents.push(a)),this},_touchSwiped:function(a){for(var b=!1,c=this.__touchEvents.length-1;c>=0;c--){var d=this.__touchEvents[c];if("touchmove"==d.type){b=!0;break}if("touchstart"==d.type&&a===d.target)break}return b},_trigger:function(){var b=Array.prototype.slice.apply(arguments);return"string"==typeof b[0]&&(b[0]={type:b[0]}),b[0].instance=this,b[0].origin=this._$origin?this._$origin[0]:null,b[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,b),a.tooltipster._trigger.apply(a.tooltipster,b),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,b),this},_unplug:function(b){var c=this;if(c[b]){var d=a.tooltipster._plugin(b);d.instance&&a.each(d.instance,function(a,d){c[a]&&c[a].bridged===c[b]&&delete c[a]}),c[b].__destroy&&c[b].__destroy(),delete c[b]}return c},close:function(a){return this.__destroyed?this.__destroyError():this._close(null,a),this},content:function(a){var b=this;if(void 0===a)return b.__Content;if(b.__destroyed)b.__destroyError();else if(b.__contentSet(a),null!==b.__Content){if("closed"!==b.__state&&(b.__contentInsert(),b.reposition(),b.__options.updateAnimation))if(h.hasTransitions){var c=b.__options.updateAnimation;b._$tooltip.addClass("tooltipster-update-"+c),setTimeout(function(){"closed"!=b.__state&&b._$tooltip.removeClass("tooltipster-update-"+c)},1e3)}else b._$tooltip.fadeTo(200,.5,function(){"closed"!=b.__state&&b._$tooltip.fadeTo(200,1)})}else b._close();return b},destroy:function(){var b=this;if(b.__destroyed)b.__destroyError();else{"closed"!=b.__state?b.option("animationDuration",0)._close(null,null,!0):b.__timeoutsClear(),b._trigger("destroy"),b.__destroyed=!0,b._$origin.removeData(b.__namespace).off("."+b.__namespace+"-triggerOpen"),a(h.window.document.body).off("."+b.__namespace+"-triggerOpen");var c=b._$origin.data("tooltipster-ns");if(c)if(1===c.length){var d=null;"previous"==b.__options.restoration?d=b._$origin.data("tooltipster-initialTitle"):"current"==b.__options.restoration&&(d="string"==typeof b.__Content?b.__Content:a("<div></div>").append(b.__Content).html()),d&&b._$origin.attr("title",d),b._$origin.removeClass("tooltipstered"),b._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else c=a.grep(c,function(a,c){return a!==b.__namespace}),b._$origin.data("tooltipster-ns",c);b._trigger("destroyed"),b._off(),b.off(),b.__Content=null,b.__$emitterPrivate=null,b.__$emitterPublic=null,b.__options.parent=null,b._$origin=null,b._$tooltip=null,a.tooltipster.__instancesLatestArr=a.grep(a.tooltipster.__instancesLatestArr,function(a,c){return b!==a}),clearInterval(b.__garbageCollector)}return b},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){return this.__destroyed?void this.__destroyError():this._$origin[0]},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(a){return this.close(a)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(a){return this.__destroyed?this.__destroyError():this._open(null,a),this},option:function(b,c){return void 0===c?this.__options[b]:(this.__destroyed?this.__destroyError():(this.__options[b]=c,this.__optionsFormat(),a.inArray(b,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===b&&this.__prepareGC()),this)},reposition:function(a,b){var c=this;return c.__destroyed?c.__destroyError():"closed"!=c.__state&&d(c._$origin)&&(b||d(c._$tooltip))&&(b||c._$tooltip.detach(),c.__Geometry=c.__geometry(),c._trigger({type:"reposition",event:a,helper:{geo:c.__Geometry}})),c},show:function(a){return this.open(a)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.fn.tooltipster=function(){var b=Array.prototype.slice.apply(arguments),c="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof b[0]){var d="#*$~&";return this.each(function(){var e=a(this).data("tooltipster-ns"),f=e?a(this).data(e[0]):null;if(!f)throw new Error("You called Tooltipster's \""+b[0]+'" method on an uninitialized element');if("function"!=typeof f[b[0]])throw new Error('Unknown method "'+b[0]+'"');this.length>1&&"content"==b[0]&&(b[1]instanceof a||"object"==typeof b[1]&&null!=b[1]&&b[1].tagName)&&!f.__options.contentCloning&&f.__options.debug&&console.log(c);var g=f[b[0]](b[1],b[2]);return g!==f||"instance"===b[0]?(d=g,!1):void 0}),"#*$~&"!==d?d:this}a.tooltipster.__instancesLatestArr=[];var e=b[0]&&void 0!==b[0].multiple,g=e&&b[0].multiple||!e&&f.multiple,h=b[0]&&void 0!==b[0].content,i=h&&b[0].content||!h&&f.content,j=b[0]&&void 0!==b[0].contentCloning,k=j&&b[0].contentCloning||!j&&f.contentCloning,l=b[0]&&void 0!==b[0].debug,m=l&&b[0].debug||!l&&f.debug;return this.length>1&&(i instanceof a||"object"==typeof i&&null!=i&&i.tagName)&&!k&&m&&console.log(c),this.each(function(){var c=!1,d=a(this),e=d.data("tooltipster-ns"),f=null;e?g?c=!0:m&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):c=!0,c&&(f=new a.Tooltipster(this,b[0]),e||(e=[]),e.push(f.__namespace),d.data("tooltipster-ns",e),d.data(f.__namespace,f),f.__options.functionInit&&f.__options.functionInit.call(f,f,{origin:this}),f._trigger("init")),a.tooltipster.__instancesLatestArr.push(f)}),this},b.prototype={__init:function(b){this.__$tooltip=b,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=a('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo(h.window.document.body)},__forceRedraw:function(){var a=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(a)},constrain:function(a,b){return this.constraints={width:a,height:b},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:a}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var a=this.__$tooltip[0].getBoundingClientRect(),b={size:{height:a.height||a.bottom-a.top,width:a.width||a.right-a.left}};if(this.constraints){var c=this.__$tooltip.find(".tooltipster-content"),d=this.__$tooltip.outerHeight(),e=c[0].getBoundingClientRect(),f={height:d<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=c[0].scrollWidth-1};b.fits=f.height&&f.width}return h.IE&&h.IE<=11&&b.size.width!==h.window.document.documentElement.clientWidth&&(b.size.width=Math.ceil(b.size.width)+1),b}};var j=navigator.userAgent.toLowerCase();-1!=j.indexOf("msie")?h.IE=parseInt(j.split("msie")[1]):-1!==j.toLowerCase().indexOf("trident")&&-1!==j.indexOf(" rv:11")?h.IE=11:-1!=j.toLowerCase().indexOf("edge/")&&(h.IE=parseInt(j.toLowerCase().split("edge/")[1]))
vendor: 9,409 bytes, lines 779-783
779;var k="tooltipster.sideTip";return a.tooltipster._plugin({name:k,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(a){var b=this;b.__instance=a,b.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),b.__previousState="closed",b.__options,b.__optionsFormat(),b.__instance._on("state."+b.__namespace,function(a){"closed"==a.state?b.__close():"appearing"==a.state&&"closed"==b.__previousState&&b.__create(),b.__previousState=a.state}),b.__instance._on("options."+b.__namespace,function(){b.__optionsFormat()}),b.__instance._on("reposition."+b.__namespace,function(a){b.__reposition(a.event,a.helper)})},__close:function(){this.__instance.content()instanceof a&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var b=a('<div class="tooltipster-base tooltipster-sidetip"><div class="tooltipster-box"><div class="tooltipster-content"></div></div><div class="tooltipster-arrow"><div class="tooltipster-arrow-uncropped"><div class="tooltipster-arrow-border"></div><div class="tooltipster-arrow-background"></div></div></div></div>');this.__options.arrow||b.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&b.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&b.css("max-width",this.__options.maxWidth+"px"),
780this.__instance._$tooltip=b,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var b=this;if(b.__options=b.__instance._optionsExtract(k,b.__defaults()),b.__options.position&&(b.__options.side=b.__options.position),"object"!=typeof b.__options.distance&&(b.__options.distance=[b.__options.distance]),b.__options.distance.length<4&&(void 0===b.__options.distance[1]&&(b.__options.distance[1]=b.__options.distance[0]),void 0===b.__options.distance[2]&&(b.__options.distance[2]=b.__options.distance[0]),void 0===b.__options.distance[3]&&(b.__options.distance[3]=b.__options.distance[1])),b.__options.distance={top:b.__options.distance[0],right:b.__options.distance[1],bottom:b.__options.distance[2],left:b.__options.distance[3]},"string"==typeof b.__options.side){var c={top:"bottom",right:"left",bottom:"top",left:"right"};b.__options.side=[b.__options.side,c[b.__options.side]],"left"==b.__options.side[0]||"right"==b.__options.side[0]?b.__options.side.push("top","bottom"):b.__options.side.push("right","left")}6===a.tooltipster._env.IE&&b.__options.arrow!==!0&&(b.__options.arrow=!1)},__reposition:function(b,c){var d,e=this,f=e.__targetFind(c),g=[];e.__instance._$tooltip.detach();var h=e.__instance._$tooltip.clone(),i=a.tooltipster._getRuler(h),j=!1,k=e.__instance.option("animation");switch(k&&h.removeClass("tooltipster-"+k),a.each(["window","document"],function(d,k){var l=null;if(e.__instance._trigger({container:k,helper:c,satisfied:j,takeTest:function(a){l=a},results:g,type:"positionTest"}),1==l||0!=l&&0==j&&("window"!=k||e.__options.viewportAware))for(var d=0;d<e.__options.side.length;d++){var m={horizontal:0,vertical:0},n=e.__options.side[d];"top"==n||"bottom"==n?m.vertical=e.__options.distance[n]:m.horizontal=e.__options.distance[n],e.__sideChange(h,n),a.each(["natural","constrained"],function(a,d){if(l=null,e.__instance._trigger({container:k,event:b,helper:c,mode:d,results:g,satisfied:j,side:n,takeTest:function(a){l=a},type:"positionTest"}),1==l||0!=l&&0==j){var h={container:k,distance:m,fits:null,mode:d,outerSize:null,side:n,size:null,target:f[n],whole:null},o="natural"==d?i.free():i.constrain(c.geo.available[k][n].width-m.horizontal,c.geo.available[k][n].height-m.vertical),p=o.measure();if(h.size=p.size,h.outerSize={height:p.size.height+m.vertical,width:p.size.width+m.horizontal},"natural"==d?c.geo.available[k][n].width>=h.outerSize.width&&c.geo.available[k][n].height>=h.outerSize.height?h.fits=!0:h.fits=!1:h.fits=p.fits,"window"==k&&(h.fits?"top"==n||"bottom"==n?h.whole=c.geo.origin.windowOffset.right>=e.__options.minIntersection&&c.geo.window.size.width-c.geo.origin.windowOffset.left>=e.__options.minIntersection:h.whole=c.geo.origin.windowOffset.bottom>=e.__options.minIntersection&&c.geo.window.size.height-c.geo.origin.windowOffset.top>=e.__options.minIntersection:h.whole=!1),g.push(h),h.whole)j=!0;else if("natural"==h.mode&&(h.fits||h.size.width<=c.geo.available[k][n].width))return!1}})}}),e.__instance._trigger({edit:function(a){g=a},event:b,helper:c,results:g,type:"positionTested"}),g.sort(function(a,b){if(a.whole&&!b.whole)return-1;if(!a.whole&&b.whole)return 1;if(a.whole&&b.whole){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}if(a.fits&&!b.fits)return-1;if(!a.fits&&b.fits)return 1;if(a.fits&&b.fits){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}return"document"==a.container&&"bottom"==a.side&&"natural"==a.mode?-1:1}),d=g[0],d.coord={},d.side){case"left":case"right":d.coord.top=Math.floor(d.target-d.size.height/2);break;case"bottom":case"top":d.coord.left=Math.floor(d.target-d.size.width/2)}switch(d.side){case"left":d.coord.left=c.geo.origin.windowOffset.left-d.outerSize.width;break;case"right":d.coord.left=c.geo.origin.windowOffset.right+d.distance.horizontal;break;case"top":d.coord.top=c.geo.origin.windowOffset.top-d.outerSize.height;break;case"bottom":d.coord.top=c.geo.origin.windowOffset.bottom+d.distance.vertical}"window"==d.container?"top"==d.side||"bottom"==d.side?d.coord.left<0?c.geo.origin.windowOffset.right-this.__options.minIntersection>=0?d.coord.left=0:d.coord.left=c.geo.origin.windowOffset.right-this.__options.minIntersection-1:d.coord.left>c.geo.window.size.width-d.size.width&&(c.geo.origin.windowOffset.left+this.__options.minIntersection<=c.geo.window.size.width?d.coord.left=c.geo.window.size.width-d.size.width:d.coord.left=c.geo.origin.windowOffset.left+this.__options.minIntersection+1-d.size.width):d.coord.top<0?c.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?d.coord.top=0:d.coord.top=c.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:d.coord.top>c.geo.window.size.height-d.size.height&&(c.geo.origin.windowOffset.top+this.__options.minIntersection<=c.geo.window.size.height?d.coord.top=c.geo.window.size.height-d.size.height:d.coord.top=c.geo.origin.windowOffset.top+this.__options.minIntersection+1-d.size.height):(d.coord.left>c.geo.window.size.width-d.size.width&&(d.coord.left=c.geo.window.size.width-d.size.width),d.coord.left<0&&(d.coord.left=0)),e.__sideChange(h,d.side),c.tooltipClone=h[0],c.tooltipParent=e.__instance.option("parent").parent[0],c.mode=d.mode,c.whole=d.whole,c.origin=e.__instance._$origin[0],c.tooltip=e.__instance._$tooltip[0],delete d.container,delete d.fits,delete d.mode,delete d.outerSize,delete d.whole,d.distance=d.distance.horizontal||d.distance.vertical;var l=a.extend(!0,{},d);if(e.__instance._trigger({edit:function(a){d=a},event:b,helper:c,position:l,type:"position"}),e.__options.functionPosition){var m=e.__options.functionPosition.call(e,e.__instance,c,l);m&&(d=m)}i.destroy();var n,o;"top"==d.side||"bottom"==d.side?(n={prop:"left",val:d.target-d.coord.left},o=d.size.width-this.__options.minIntersection):(n={prop:"top",val:d.target-d.coord.top},o=d.size.height-this.__options.minIntersection),n.val<this.__options.minIntersection?n.val=this.__options.minIntersection:n.val>o&&(n.val=o);var p;p=c.geo.origin.fixedLineage?c.geo.origin.windowOffset:{left:c.geo.origin.windowOffset.left+c.geo.window.scroll.left,top:c.geo.origin.windowOffset.top+c.geo.window.scroll.top},d.coord={left:p.left+(d.coord.left-c.geo.origin.windowOffset.left),top:p.top+(d.coord.top-c.geo.origin.windowOffset.top)},e.__sideChange(e.__instance._$tooltip,d.side),c.geo.origin.fixedLineage?e.__instance._$tooltip.css("position","fixed"):e.__instance._$tooltip.css("position",""),e.__instance._$tooltip.css({left:d.coord.left,top:d.coord.top,height:d.size.height,width:d.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(n.prop,n.val),e.__instance._$tooltip.appendTo(e.__instance.option("parent")),e.__instance._trigger({type:"repositioned",event:b,position:d})},__sideChange:function(a,b){a.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+b)},__targetFind:function(a){var b={},c=this.__instance._$origin[0].getClientRects();if(c.length>1){var d=this.__instance._$origin.css("opacity");1==d&&(this.__instance._$origin.css("opacity",.99),c=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1))}if(c.length<2)b.top=Math.floor(a.geo.origin.windowOffset.left+a.geo.origin.size.width/2),b.bottom=b.top,b.left=Math.floor(a.geo.origin.windowOffset.top+a.geo.origin.size.height/2),b.right=b.left;else{var e=c[0];b.top=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil(c.length/2)-1]:c[0],b.right=Math.floor(e.top+(e.bottom-e.top)/2),e=c[c.length-1],b.bottom=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil((c.length+1)/2)-1]:c[c.length-1],b.left=Math.floor(e.top+(e.bottom-e.top)/2)}return b}}}),a});;
781// MEC Single Event Displayer
782var mecSingleEventDisplayer =
783{
784    getSinglePage: function (id, occurrence, time, ajaxurl, layout, image_popup) {
785        if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
786        jQuery('.mec-modal-result').addClass('mec-modal-preloader');
787
788        jQuery.ajax(
789            {
790                url: ajaxurl,
791                data: "action=mec_load_single_page&id=" + id + (occurrence != null ? "&occurrence=" + occurrence : "") + (time != null ? "&time=" + time : "") + "&layout=" + layout,
792                type: "get",
793                success: function (response) {
794                    jQuery('.mec-modal-result').removeClass("mec-modal-preloader");
795                    jQuery.featherlight(response);
796
797                    setTimeout(function () {
798                        if (typeof grecaptcha !== 'undefined' && jQuery('#g-recaptcha').length > 0) {
799                            grecaptcha.render("g-recaptcha", {
800                                sitekey: mecdata.recapcha_key
801                            });
802                        }
803
804                        // Event Gallery
805                        mec_init_event_gallery();
806
807                        // Number Spinner
808                        mec_init_number_spinner();
809                    }, 1000);
810
811                    if (image_popup != 0) {
812                        if (jQuery('.featherlight-content .mec-events-content a img').length > 0) {
813                            jQuery('.featherlight-content .mec-events-content a img').each(function () {
814                                if (jQuery(this).attr('src') === jQuery(this).closest('a').attr('href')) {
815                                    jQuery(this).closest('a').attr('data-featherlight', 'image');
816                                }
817                            });
818                        }
819                    }
820
821                    if (typeof mecdata.enableSingleFluent != 'undefined' && mecdata.enableSingleFluent) mecFluentSinglePage();
822                },
823                error: function () { }
824            });
825    }
826};
827
828var mec_search_callbacks = [];
829
830function mecApplySelect2Accessibility($select)
831{
832    if(!$select || !$select.length) return;
833
834    var ariaLabel = $select.attr('aria-label') || $select.attr('title') || '';
835    if(!ariaLabel || !$select.attr('id')) return;
836
837    var $selection = jQuery('#select2-' + $select.attr('id') + '-container').closest('.select2-selection');
838    if(!$selection.length) return;
839
840    $selection.attr('aria-label', ariaLabel);
841}
842
843function mecFormatA11yString(template, replacements)
844{
845    var output = String(template || '');
846
847    jQuery.each(replacements || [], function (index, value) {
848        output = output.replace('%' + (index + 1) + '$s', value);
849    });
850
851    return output;
852}
853
854// MEC SEARCH FORM PLUGIN
855(function ($) {
856    $.fn.mecSearchForm = function (options) {
857
858        // Default Options
859        var settings = $.extend({
860            // These are the defaults.
861            id: 0,
862            refine: 0,
863            ajax_url: '',
864            search_form_element: '',
865            atts: '',
866            start_date: '',
867            callback: function () { }
868        }, options);
869
870        if (typeof mec_search_callbacks[settings.id] === 'undefined') mec_search_callbacks[settings.id] = [];
871        mec_search_callbacks[settings.id].push(settings.callback);
872
873        $('#mec_search_form_' + settings.id).on('submit', (e) => {
874            e.preventDefault();
875        });
876
877        var $event_cost_min = $("#mec_sf_event_cost_min_" + settings.id);
878        var $event_cost_max = $("#mec_sf_event_cost_max_" + settings.id);
879        var $time_start = $("#mec_sf_timepicker_start_" + settings.id);
880        var $time_end = $("#mec_sf_timepicker_end_" + settings.id);
881        var $s = $("#mec_sf_s_" + settings.id);
882        var $address = $("#mec_sf_address_s_" + settings.id);
883        var $address_radius = $("#mec_sf_address_radius_" + settings.id);
884        var $date_start = $('#mec_sf_date_start_' + settings.id);
885        var $date_end = $('#mec_sf_date_end_' + settings.id);
886        var $event_type = $('#mec_sf_event_type_' + settings.id);
887        var $event_type_2 = $('#mec_sf_event_type_2_' + settings.id);
888        var $attribute = $('#mec_sf_attribute_' + settings.id);
889        const $wrapper = $("#mec_search_form_" + settings.id);
890        var $custom_fields = $wrapper.find('.mec-custom-event-field');
891        const $status = $("#mec_search_form_" + settings.id + "_status");
892        var $reset = $("#mec_search_form_" + settings.id + '_reset');
893        var $event_status = $(".mec_sf_event_status_" + settings.id);
894        var last_field;
895
896        // URL Sync option
897        var updateUrl = (typeof mecdata !== 'undefined' && parseInt(mecdata.sf_update_url) === 1);
898        var isApplyingFromURL = false;
899        var originalURL = window.location.href;
900
901        // Trigger
902        trigger();
903
904        $(document).off('mec_search_init.mecSearchA11y' + settings.id).on('mec_search_init.mecSearchA11y' + settings.id, function (event, view, viewSettings, response) {
905            if (!viewSettings || String(viewSettings.id) !== String(settings.id)) return;
906
907            announceSearchResults(response);
908        });
909
910        $custom_fields.off('change.mecSf' + settings.id).on('change.mecSf' + settings.id, function (e) {
911            last_field = $(this).data('field-id');
912            search();
913        });
914
915        $s.off('change').on('change', function (e) {
916            last_field = 's';
917            search();
918        });
919
920        $address.off('change').on('change', function (e) {
921            last_field = 'address';
922            search();
923        });
924        $address_radius.off('change').on('change', function (e) {
925            last_field = 'address_radius';
926            search();
927        });
928
929        $event_cost_min.off('change').on('change', function (e) {
930            last_field = 'cost-min';
931            $event_cost_max.attr('min', $(this).val());
932            search();
933        });
934
935        $event_cost_max.off('change').on('change', function (e) {
936            last_field = 'cost-max';
937            $event_cost_min.attr('max', $(this).val());
938            search();
939        });
940
941        // Timepicker
942        if ($time_start.length) {
943            var format = (($time_start.data('format') === 12) ? 'hh:mm p' : 'HH:mm');
944            $time_start.timepicker(
945                {
946                    timeFormat: format,
947                    minTime: new Date(0, 0, 0, 0, 0, 0),
948                    maxTime: new Date(0, 0, 0, 23, 55, 0),
949                    interval: 5,
950                    dropdown: false,
951                    change: function () {
952                        last_field = 'time-start';
953                        search();
954                    }
955                });
956
957            $time_end.timepicker(
958                {
959                    timeFormat: format,
960                    minTime: new Date(0, 0, 0, 0, 0, 0),
961                    maxTime: new Date(0, 0, 0, 23, 55, 0),
962                    interval: 5,
963                    dropdown: false,
964                    change: function () {
965                        last_field = 'time-end';
966                        search();
967                    }
968                });
969        }
970
971        var $month = $("#mec_sf_month_" + settings.id);
972        var $year = $("#mec_sf_year_" + settings.id);
973        var $month_or_year = $("#mec_sf_month_" + settings.id + ', ' + "#mec_sf_year_" + settings.id);
974
975        $month_or_year.on('change', function (e) {
976            last_field = 'date-dropdown';
977
978            var mec_month_val = $month.val();
979            var mec_year_val = $year.val();
980
981            if ((mec_month_val !== 'none' && mec_year_val !== 'none') || ((mec_month_val === 'none' && mec_year_val === 'none'))) search();
982        });
983
984        $date_start.off('change').on('change', function () {
985            last_field = 'date-start';
986            search();
987        });
988
989        $date_end.off('change').on('change', function () {
990            last_field = 'date-end';
991            search();
992        });
993
994        $event_type.off('change').on('change', function (e) {
995            last_field = 'event-type';
996            search();
997        });
998
999        $event_type_2.off('change').on('change', function (e) {
1000            last_field = 'event-type-2';
1001            search();
1002        });
1003
1004        $attribute.off('change').on('change', function (e) {
1005            last_field = 'attribute';
1006            search();
1007        });
1008
1009        if ($event_status.length > 0) {
1010            $event_status.off('change').on('change', function (e) {
1011                last_field = 'event_status';
1012                search();
1013            });
1014        }
1015
1016        if (settings.fields && settings.fields.length > 0) {
1017            for (var k in settings.fields) {
1018                $("#mec_sf_" + settings.fields[k] + '_' + settings.id).off('change').on('change', function (e) {
1019                    search();
1020                });
1021            }
1022        }
1023
1024        // Reset
1025        if ($reset.length) {
1026            $reset.off('click').on('click', function (e) {
1027                reset();
1028            });
1029        }
1030
1031        function get_fields() {
1032            return [
1033                'state',
1034                'city',
1035                'region',
1036                'region',
1037                'street',
1038                'postal_code',
1039            ];
1040        }
1041
1042        function getSearchResultCount(response) {
1043            if (response && typeof response.count !== 'undefined' && !isNaN(parseInt(response.count, 10))) {
1044                return Math.max(parseInt(response.count, 10), 0);
1045            }
1046
1047            var $noEvents = $("#mec_skin_no_events_" + settings.id);
1048            if ($noEvents.length && !$noEvents.hasClass("mec-util-hidden")) return 0;
1049
1050            return $("#mec_skin_events_" + settings.id).find(".mec-event-article").length;
1051        }
1052
1053        function getSearchContextSuffix() {
1054            var query = $s.length ? $.trim($s.val()) : '';
1055            if (query) {
1056                return mecFormatA11yString(mecdata.a11y_search_query || ' for "%s"', [query]).replace('%s', query);
1057            }
1058
1059            var addressQuery = $address.length ? $.trim($address.val()) : '';
1060            if (addressQuery) {
1061                return mecFormatA11yString(mecdata.a11y_search_address || ' near "%s"', [addressQuery]).replace('%s', addressQuery);
1062            }
1063
1064            return '';
1065        }
1066
1067        function announceSearchResults(response) {
1068            if (!$status.length) return;
1069
1070            var count = getSearchResultCount(response);
1071            var suffix = getSearchContextSuffix();
1072            var template = count === 1
1073                ? (mecdata.a11y_search_result || 'Search updated. %1$s event found%2$s.')
1074                : (mecdata.a11y_search_results || 'Search updated. %1$s events found%2$s.');
1075
1076            window.setTimeout(function () {
1077                $status.text(mecFormatA11yString(template, [count, suffix]));
1078            }, 0);
1079        }
1080
1081        function trigger() {
1082            if ($wrapper.hasClass('mec-dropdown-enhanced')) {
1083                $wrapper.find($('select')).each(function () {
1084                    $(this).select2();
1085                    mecApplySelect2Accessibility($(this));
1086                });
1087            }
1088
1089            $("#mec_sf_category_" + settings.id).on('change', function (e) {
1090                last_field = 'category';
1091                search();
1092            });
1093
1094            $("#mec_sf_location_" + settings.id).on('change', function (e) {
1095                last_field = 'location';
1096                search();
1097            });
1098
1099            $("#mec_sf_organizer_" + settings.id).on('change', function (e) {
1100                last_field = 'organizer';
1101                search();
1102            });
1103
1104            $("#mec_sf_speaker_" + settings.id).on('change', function (e) {
1105                last_field = 'speaker';
1106                search();
1107            });
1108
1109            $("#mec_sf_tag_" + settings.id).on('change', function (e) {
1110                last_field = 'tag';
1111                search();
1112            });
1113
1114            $("#mec_sf_label_" + settings.id).on('change', function (e) {
1115                last_field = 'label';
1116                search();
1117            });
1118
1119            var fields = get_fields();
1120            $.each(fields, function (i, field) {
1121                $("#mec_sf_" + field + "_" + settings.id).on('change', function (e) {
1122                    last_field = field;
1123                    search();
1124                });
1125            });
1126        }
1127
1128        function getRawNonSfQuery() {
1129            var search = window.location.search;
1130            if (search.indexOf('?') === 0) search = search.substring(1);
1131            if (!search) return '';
1132            var parts = search.split('&');
1133            var kept = [];
1134            for (var i = 0; i < parts.length; i++) {
1135                var p = parts[i];
1136                if (!p) continue;
1137                var key = p.split('=')[0] || '';
1138                if (key.indexOf('sf[') === 0 || key.indexOf('sf%5B') === 0) continue;
1139                kept.push(p);
1140            }
1141            return kept.join('&');
1142        }
1143
1144        function encodeSfQuery(sfQS) {
1145            if (!sfQS) return '';
1146            var out = [];
1147            var parts = sfQS.split('&');
1148            for (var i = 0; i < parts.length; i++) {
1149                var p = parts[i];
1150                if (!p) continue;
1151                var eq = p.indexOf('=');
1152                var key = eq > -1 ? p.substring(0, eq) : p;
1153                var val = eq > -1 ? p.substring(eq + 1) : '';
1154                if (val === '') continue;
1155                out.push(key + '=' + encodeURIComponent(val));
1156            }
1157            return out.join('&');
1158        }
1159
1160        function pushFiltersToUrl(sfQS) {
1161            if (!updateUrl) return;
1162            try {
1163                var base = window.location.origin + window.location.pathname;
1164                var preserved = getRawNonSfQuery();
1165                var sfRaw = encodeSfQuery(sfQS); // keep keys as sf[...]
1166                var qs = '';
1167                if (preserved) qs = preserved;
1168                if (sfRaw) qs = qs ? (qs + '&' + sfRaw) : sfRaw;
1169                var finalUrl = qs ? (base + '?' + qs + window.location.hash) : (base + window.location.hash);
1170                window.history.pushState({ mec_sf: true, id: settings.id }, '', finalUrl);
1171            } catch (e) { }
1172        }
1173
1174        function extractSfFromRawSearch() {
1175            var res = {};
1176            try {
1177                var raw = window.location.search;
1178                if (raw.indexOf('?') === 0) raw = raw.substring(1);
1179                var regex = /(?:^|&)sf(?:%5B|\[)([^\]=%]+)(?:%5D|\])=([^&]*)/g;
1180                var m;
1181                while ((m = regex.exec(raw)) !== null) {
1182                    var k = m[1];
1183                    var v = decodeURIComponent(m[2] || '');
1184                    res[k] = v;
1185                }
1186            } catch (e) { }
1187            return res;
1188        }
1189
1190        function applyURLToFormAndSearch() {
1191            if (!updateUrl) return;
1192            try {
1193                var sfObj = extractSfFromRawSearch();
1194
1195                if (Object.keys(sfObj).length === 0) return;
1196
1197                isApplyingFromURL = true;
1198
1199                // Simple fields
1200                if (typeof sfObj['s'] !== 'undefined' && $s.length) $s.val(sfObj['s']);
1201                if (typeof sfObj['address'] !== 'undefined' && $address.length) $address.val(sfObj['address']);
1202                if (typeof sfObj['address_radius'] !== 'undefined' && $address_radius.length) $address_radius.val(sfObj['address_radius']);
1203                if (typeof sfObj['cost-min'] !== 'undefined' && $event_cost_min.length) $event_cost_min.val(sfObj['cost-min']);
1204                if (typeof sfObj['cost-max'] !== 'undefined' && $event_cost_max.length) $event_cost_max.val(sfObj['cost-max']);
1205                if (typeof sfObj['time-start'] !== 'undefined' && $time_start.length) $time_start.val(sfObj['time-start']);
1206                if (typeof sfObj['time-end'] !== 'undefined' && $time_end.length) $time_end.val(sfObj['time-end']);
1207                if (typeof sfObj['month'] !== 'undefined' && $month.length) $month.val(sfObj['month']);
1208                if (typeof sfObj['year'] !== 'undefined' && $year.length) $year.val(sfObj['year']);
1209                if (typeof sfObj['start'] !== 'undefined' && $date_start.length) $date_start.val(sfObj['start']);
1210                if (typeof sfObj['end'] !== 'undefined' && $date_end.length) $date_end.val(sfObj['end']);
1211                if (typeof sfObj['date_start'] !== 'undefined' && $date_start.length) $date_start.val(sfObj['date_start']);
1212                if (typeof sfObj['date_end'] !== 'undefined' && $date_end.length) $date_end.val(sfObj['date_end']);
1213                if (typeof sfObj['event_type'] !== 'undefined' && $event_type.length) $event_type.val(sfObj['event_type']);
1214                if (typeof sfObj['event_type_2'] !== 'undefined' && $event_type_2.length) $event_type_2.val(sfObj['event_type_2']);
1215                if (typeof sfObj['attribute'] !== 'undefined' && $attribute.length) $attribute.val(sfObj['attribute']);
1216
1217                // Event status (radio)
1218                if (typeof sfObj['event_status'] !== 'undefined' && $event_status.length) {
1219                    $event_status.prop('checked', false);
1220                    $event_status.filter('[value="' + sfObj['event_status'] + '"]').prop('checked', true);
1221                }
1222
1223                // Taxonomies: select/ul checkboxes
1224                function applyTaxonomy($el, csv) {
1225                    if (!$el.length) return;
1226                    var vals = (csv || '').split(',').filter(function (x) { return x !== '' });
1227                    var tag = ($el.prop('tagName') || '').toLowerCase();
1228                    if (tag === 'select') {
1229                        $el.val(vals.length > 1 ? vals : (vals[0] || ''));
1230                        if ($wrapper.hasClass('mec-dropdown-enhanced') && jQuery().select2) {
1231                            $el.trigger('change.select2');
1232                        } else if (jQuery().niceSelect) {
1233                            $el.niceSelect('update');
1234                        }
1235                    } else if (tag === 'ul') {
1236                        var set = new Set(vals);
1237                        $el.find('input[type=checkbox]').each(function () {
1238                            var v = jQuery(this).val();
1239                            jQuery(this).prop('checked', set.has(v));
1240                        });
1241                    }
1242                }
1243
1244                applyTaxonomy($("#mec_sf_category_" + settings.id), sfObj['category']);
1245                applyTaxonomy($("#mec_sf_location_" + settings.id), sfObj['location']);
1246                applyTaxonomy($("#mec_sf_organizer_" + settings.id), sfObj['organizer']);
1247                applyTaxonomy($("#mec_sf_speaker_" + settings.id), sfObj['speaker']);
1248                applyTaxonomy($("#mec_sf_tag_" + settings.id), sfObj['tag']);
1249                applyTaxonomy($("#mec_sf_label_" + settings.id), sfObj['label']);
1250
1251                // Update UI for simple selects in enhanced mode
1252                function updateSelectUI($sel) {
1253                    if (!$sel || !$sel.length) return;
1254                    if ($wrapper.hasClass('mec-dropdown-enhanced') && jQuery().select2) {
1255                        $sel.trigger('change.select2');
1256                    } else if (jQuery().niceSelect) {
1257                        $sel.niceSelect('update');
1258                    }
1259                }
1260
1261                updateSelectUI($month);
1262                updateSelectUI($year);
1263                updateSelectUI($event_type);
1264                updateSelectUI($event_type_2);
1265                updateSelectUI($attribute);
1266
1267                // Trigger a search with these values (skip once if server already applied them)
1268                setTimeout(function () {
1269                    isApplyingFromURL = false;
1270                    var skipOnce = $wrapper.data('mec-skip-initial-search');
1271                    if (skipOnce) {
1272                        $wrapper.removeAttr('data-mec-skip-initial-search');
1273                    } else {
1274                        search();
1275                    }
1276                }, 50);
1277
1278            } catch (e) { }
1279        }
1280
1281        // Handle browser back/forward to re-apply filters
1282        if (updateUrl && !$wrapper.data('mec-popstate-bound')) {
1283            jQuery(window).on('popstate', function () {
1284                applyURLToFormAndSearch();
1285            });
1286            $wrapper.data('mec-popstate-bound', true);
1287        }
1288        // Apply URL filters immediately on init
1289        applyURLToFormAndSearch();
1290
1291        function search() {
1292            var $category = $("#mec_sf_category_" + settings.id);
1293            var $location = $("#mec_sf_location_" + settings.id);
1294            var $organizer = $("#mec_sf_organizer_" + settings.id);
1295            var $speaker = $("#mec_sf_speaker_" + settings.id);
1296            var $tag = $("#mec_sf_tag_" + settings.id);
1297            var $label = $("#mec_sf_label_" + settings.id);
1298
1299            var s = $s.length ? $s.val() : '';
1300            var address = $address.length ? $address.val() : '';
1301            var address_radius = $address_radius.length ? $address_radius.val() : '';
1302            var tag = $tag.length ? $tag.val() : '';
1303            var month = $month.length ? $month.val() : '';
1304            var year = $year.length ? $year.val() : '';
1305            var event_type = $event_type.length ? $event_type.val() : '';
1306            var event_type_2 = $event_type_2.length ? $event_type_2.val() : '';
1307            var attribute = $attribute.length ? $attribute.val() : '';
1308            var event_status = $event_status.filter(':checked').length ? $event_status.filter(':checked').val() : 'all';
1309
1310            if (month === null) month = '';
1311
1312            var start = $date_start.length ? $date_start.val() : '';
1313            var end = $date_end.length ? $date_end.val() : '';
1314
1315            var cost_min = $event_cost_min.length ? $event_cost_min.val() : '';
1316            var cost_max = $event_cost_max.length ? $event_cost_max.val() : '';
1317
1318            var time_start = $time_start.length ? $time_start.val() : '';
1319            var time_end = $time_end.length ? $time_end.val() : '';
1320
1321            var category;
1322            if ($category.prop('tagName') && $category.prop('tagName').toLowerCase() === 'div') {
1323                category = [];
1324                $category.find($('select')).each(function () {
1325                    category.push($(this).val());
1326                });
1327                category = category.join(',');
1328            }
1329            else if ($category.prop('tagName') && $category.prop('tagName').toLowerCase() === 'ul') {
1330                category = [];
1331                $category.find($('input[type=checkbox]:checked')).each(function () {
1332                    category.push($(this).val());
1333                });
1334                category = category.join(',');
1335            }
1336            else category = $category.length ? $category.val() : '';
1337
1338            var location;
1339            if ($location.prop('tagName') && $location.prop('tagName').toLowerCase() === 'ul') {
1340                location = [];
1341                $location.find($('input[type=checkbox]:checked')).each(function () {
1342                    location.push($(this).val());
1343                });
1344                location = location.join(',');
1345            }
1346            else location = $location.length ? $location.val() : '';
1347
1348            var organizer;
1349            if ($organizer.prop('tagName') && $organizer.prop('tagName').toLowerCase() === 'ul') {
1350                organizer = [];
1351                $organizer.find($('input[type=checkbox]:checked')).each(function () {
1352                    organizer.push($(this).val());
1353                });
1354                organizer = organizer.join(',');
1355            }
1356            else organizer = $organizer.length ? $organizer.val() : '';
1357
1358            var speaker;
1359            if ($speaker.prop('tagName') && $speaker.prop('tagName').toLowerCase() === 'ul') {
1360                speaker = [];
1361                $speaker.find($('input[type=checkbox]:checked')).each(function () {
1362                    speaker.push($(this).val());
1363                });
1364                speaker = speaker.join(',');
1365            }
1366            else speaker = $speaker.length ? $speaker.val() : '';
1367
1368            var label;
1369            if ($label.prop('tagName') && $label.prop('tagName').toLowerCase() === 'ul') {
1370                label = [];
1371                $label.find($('input[type=checkbox]:checked')).each(function () {
1372                    label.push($(this).val());
1373                });
1374                label = label.join(',');
1375            }
1376            else label = $label.length ? $label.val() : '';
1377
1378            if (year === 'none' && month === 'none') {
1379                year = '';
1380                month = '';
1381            }
1382
1383            if (!year) year = '';
1384
1385            var addation_attr = '';
1386            if (settings.fields && settings.fields.length > 0) {
1387                for (var k in settings.fields) {
1388                    var field = '#mec_sf_' + settings.fields[k] + '_' + settings.id;
1389                    var val = $(field).length ? $(field).val() : '';
1390
1391                    addation_attr += '&sf[' + settings.fields[k] + ']=' + val;
1392                }
1393            }
1394
1395            // Search Parameters
1396            var sf = 'sf[s]=' + s + '&sf[address]=' + address + '&sf[address_radius]=' + address_radius + '&sf[cost-min]=' + cost_min + '&sf[cost-max]=' + cost_max + '&sf[time-start]=' + time_start + '&sf[time-end]=' + time_end + '&sf[month]=' + month + '&sf[year]=' + year + '&sf[start]=' + start + '&sf[end]=' + end + '&sf[event_type]=' + event_type + '&sf[event_type_2]=' + event_type_2 + '&sf[event_status]=' + event_status + '&sf[attribute]=' + attribute + addation_attr;
1397
1398            if ($category.length) sf += '&sf[category]=' + category;
1399            if ($location.length) sf += '&sf[location]=' + location;
1400            if ($organizer.length) sf += '&sf[organizer]=' + organizer;
1401            if ($speaker.length) sf += '&sf[speaker]=' + speaker;
1402            if ($tag.length) sf += '&sf[tag]=' + tag;
1403            if ($label.length) sf += '&sf[label]=' + label;
1404
1405            // Event Fields
1406            $custom_fields.each(function () {
1407                var custom_field_id = $(this).data('field-id');
1408                var custom_request_key = $(this).data('request-key');
1409                var custom_field_value = $(this).val();
1410
1411                if (custom_request_key) sf += '&sf[fields][' + custom_field_id + '][' + custom_request_key + ']=' + custom_field_value;
1412                else sf += '&sf[fields][' + custom_field_id + ']=' + custom_field_value;
1413            });
1414
1415            var fields = get_fields();
1416            $.each(fields, function (i, field) {
1417                if ($("#mec_sf_" + field + "_" + settings.id).length) {
1418                    v = $("#mec_sf_" + field + "_" + settings.id).val();
1419                    sf += '&sf[' + field + ']=' + v;
1420                }
1421            });
1422
1423            // Refine Parameters
1424            if (settings.refine) refine(sf);
1425
1426            // Attributes
1427            var atts = settings.atts + '&' + sf;
1428
1429            // Search
1430            if (typeof mec_search_callbacks[settings.id] !== 'undefined') {
1431                for (const cb of mec_search_callbacks[settings.id]) cb(atts);
1432            }
1433
1434            // Update URL after search so it can be shared
1435            if (updateUrl && !isApplyingFromURL) {
1436                pushFiltersToUrl(sf);
1437            }
1438        }
1439
1440        function reset() {
1441            var $category = $("#mec_sf_category_" + settings.id);
1442            var $location = $("#mec_sf_location_" + settings.id);
1443            var $organizer = $("#mec_sf_organizer_" + settings.id);
1444            var $speaker = $("#mec_sf_speaker_" + settings.id);
1445            var $tag = $("#mec_sf_tag_" + settings.id);
1446            var $label = $("#mec_sf_label_" + settings.id);
1447            var isEnhanced = $wrapper.hasClass('mec-dropdown-enhanced');
1448
1449            if ($category.length && $category.prop('tagName') && $category.prop('tagName').toLowerCase() === 'div') {
1450                $category.find('select').each(function () {
1451                    $(this).val(null).trigger('change');
1452                });
1453                    if (isEnhanced && jQuery().select2) {
1454                        $category.find('select').select2();
1455                        $category.find('select').each(function () {
1456                            mecApplySelect2Accessibility($(this));
1457                        });
1458                    }
1459                else if (jQuery().niceSelect) $category.find('select').niceSelect('update');
1460            }
1461            else if ($category.length && $category.prop('tagName') && $category.prop('tagName').toLowerCase() === 'ul') {
1462                $category.find($('input[type=checkbox]:checked')).each(function () {
1463                    $(this).prop('checked', false);
1464                });
1465            }
1466            else if ($category.length) {
1467                $category.val(null);
1468                if ($category.prop('tagName') && $category.prop('tagName').toLowerCase() === 'select') {
1469                if (isEnhanced && jQuery().select2) {
1470                    $category.select2();
1471                    mecApplySelect2Accessibility($category);
1472                }
1473                    else if (jQuery().niceSelect) $category.niceSelect('update');
1474                }
1475            }
1476
1477            if ($location.length && $location.prop('tagName') && $location.prop('tagName').toLowerCase() === 'ul') {
1478                $location.find($('input[type=checkbox]:checked')).each(function () {
1479                    $(this).prop('checked', false);
1480                });
1481            }
1482            else if ($location.length) {
1483                $location.val(null);
1484                if ($location.prop('tagName') && $location.prop('tagName').toLowerCase() === 'select') {
1485                    if (isEnhanced && jQuery().select2) {
1486                        $location.select2();
1487                        mecApplySelect2Accessibility($location);
1488                    }
1489                    else if (jQuery().niceSelect) $location.niceSelect('update');
1490                }
1491            }
1492
1493            if ($organizer.length && $organizer.prop('tagName') && $organizer.prop('tagName').toLowerCase() === 'ul') {
1494                $organizer.find($('input[type=checkbox]:checked')).each(function () {
1495                    $(this).prop('checked', false);
1496                });
1497            }
1498            else if ($organizer.length) {
1499                $organizer.val(null);
1500                if ($organizer.prop('tagName') && $organizer.prop('tagName').toLowerCase() === 'select') {
1501                    if (isEnhanced && jQuery().select2) {
1502                        $organizer.select2();
1503                        mecApplySelect2Accessibility($organizer);
1504                    }
1505                    else if (jQuery().niceSelect) $organizer.niceSelect('update');
1506                }
1507            }
1508
1509            if ($speaker.length && $speaker.prop('tagName') && $speaker.prop('tagName').toLowerCase() === 'ul') {
1510                $speaker.find($('input[type=checkbox]:checked')).each(function () {
1511                    $(this).prop('checked', false);
1512                });
1513            }
1514            else if ($speaker.length) {
1515                $speaker.val(null);
1516                if ($speaker.prop('tagName') && $speaker.prop('tagName').toLowerCase() === 'select') {
1517                    if (isEnhanced && jQuery().select2) {
1518                        $speaker.select2();
1519                        mecApplySelect2Accessibility($speaker);
1520                    }
1521                    else if (jQuery().niceSelect) $speaker.niceSelect('update');
1522                }
1523            }
1524
1525            if ($label.length && $label.prop('tagName') && $label.prop('tagName').toLowerCase() === 'ul') {
1526                $label.find($('input[type=checkbox]:checked')).each(function () {
1527                    $(this).prop('checked', false);
1528                });
1529            }
1530            else if ($label.length) {
1531                $label.val(null);
1532                if ($label.prop('tagName') && $label.prop('tagName').toLowerCase() === 'select') {
1533                    if (isEnhanced && jQuery().select2) {
1534                        $label.select2();
1535                        mecApplySelect2Accessibility($label);
1536                    }
1537                    else if (jQuery().niceSelect) $label.niceSelect('update');
1538                }
1539            }
1540
1541            if ($tag.length) $tag.val(null);
1542            if ($s.length) $s.val(null);
1543            if ($address.length) $address.val(null);
1544            if ($address_radius.length) $address_radius.val(null);
1545            if ($month.length) $month.val(null);
1546            if ($year.length) $year.val(null);
1547            if ($event_cost_min.length) $event_cost_min.val(null);
1548            if ($event_cost_max.length) $event_cost_max.val(null);
1549            if ($date_start.length) $date_start.val(null);
1550            if ($date_end.length) $date_end.val(null);
1551            if ($time_start.length) $time_start.val(null);
1552            if ($time_end.length) $time_end.val(null);
1553            if ($event_status.length) {
1554                $event_status.prop('checked', false);
1555                $event_status.filter('[value="all"]').prop('checked', true);
1556            }
1557
1558            // Reset map fields specifically
1559            var mapFields = ['state', 'city', 'region', 'street', 'postal_code'];
1560            $.each(mapFields, function (i, field) {
1561                var $mapField = $("#mec_sf_" + field + "_" + settings.id);
1562                if ($mapField.length) {
1563                    $mapField.val(null);
1564                    if ($mapField.is('select')) {
1565                        if (isEnhanced && jQuery().select2) {
1566                            $mapField.select2();
1567                            mecApplySelect2Accessibility($mapField);
1568                        }
1569                        else if (jQuery().niceSelect) jQuery("#mec_sf_" + field + "_" + settings.id).niceSelect('update');
1570                    }
1571                }
1572            });
1573
1574            var fields = get_fields();
1575            $.each(fields, function (i, field) {
1576                const $f = $("#mec_sf_" + field + "_" + settings.id);
1577                if ($f.length) {
1578                    $f.val(null);
1579                    if ($f.is('select') && jQuery().niceSelect) {
1580                        jQuery("#mec_sf_" + field + "_" + settings.id).niceSelect('update');
1581                    }
1582                }
1583            });
1584
1585            if (jQuery().niceSelect) {
1586
1587                jQuery('.mec-fluent-wrap').find('.mec-filter-content').find('select:not([multiple])').niceSelect('update');
1588            }
1589
1590            // Clean URL query if enabled
1591            if (updateUrl) {
1592                try {
1593                    var url = new URL(window.location.href);
1594                    url = removeSfParamsFromUrl(url);
1595                    window.history.pushState({ mec_sf: true, id: settings.id }, '', url.toString());
1596                } catch (e) { }
1597            }
1598
1599            // Search Again
1600            setTimeout(function () {
1601                search();
1602            }, 200);
1603        }
1604
1605        function refine(sf) {
1606            var $category = $("#mec_sf_category_" + settings.id);
1607            var $location = $("#mec_sf_location_" + settings.id);
1608            var $organizer = $("#mec_sf_organizer_" + settings.id);
1609            var $speaker = $("#mec_sf_speaker_" + settings.id);
1610            var $tag = $("#mec_sf_tag_" + settings.id);
1611            var $label = $("#mec_sf_label_" + settings.id);
1612
1613            var category_type;
1614            if ($category.length && $category.prop('tagName') && $category.prop('tagName').toLowerCase() === 'div') category_type = 'checkboxes';
1615            else if ($category.length && $category.prop('tagName') && $category.prop('tagName').toLowerCase() === 'ul') category_type = 'simple-checkboxes';
1616            else if ($category.length) category_type = 'dropdown';
1617
1618            var location_type;
1619            if ($location.length && $location.prop('tagName') && $location.prop('tagName').toLowerCase() === 'ul') location_type = 'simple-checkboxes';
1620            else if ($location.length) location_type = 'dropdown';
1621
1622            var organizer_type;
1623            if ($organizer.length && $organizer.prop('tagName') && $organizer.prop('tagName').toLowerCase() === 'ul') organizer_type = 'simple-checkboxes';
1624            else if ($organizer.length) organizer_type = 'dropdown';
1625
1626            var speaker_type;
1627            if ($speaker.length && $speaker.prop('tagName') && $speaker.prop('tagName').toLowerCase() === 'ul') speaker_type = 'simple-checkboxes';
1628            else if ($organizer.length) speaker_type = 'dropdown';
1629
1630            var label_type;
1631            if ($label.length && $label.prop('tagName') && $label.prop('tagName').toLowerCase() === 'ul') label_type = 'simple-checkboxes';
1632            else if ($label.length) label_type = 'dropdown';
1633
1634            $.ajax(
1635                {
1636                    url: settings.ajax_url,
1637                    data: "action=mec_refine_search_items&mec_start_date=" + settings.start_date + "&" + sf + '&last_field=' + last_field + '&category_type=' + category_type + '&location_type=' + location_type + '&organizer_type=' + organizer_type + '&speaker_type=' + speaker_type + '&label_type=' + label_type + '&id=' + settings.id,
1638                    dataType: "json",
1639                    type: "post",
1640                    success: function (response) {
1641                        // Categories
1642                        if (typeof response.categories !== 'undefined' && response.categories !== '') {
1643                            // Multi Select
1644                            if ($category.length && category_type === 'checkboxes') {
1645                                $category.html(response.categories);
1646                            }
1647                            // Checkboxes
1648                            else if ($category.length && category_type === 'simple-checkboxes') {
1649                                $category.html(response.categories);
1650                            }
1651                            // Dropdown
1652                            else if ($category.length) {
1653                                $category.replaceWith(response.categories);
1654                            }
1655
1656                            // Categories Search bar
1657                            if (jQuery(".mec-searchbar-category-wrap select").length > 0 && jQuery().niceSelect) jQuery(".mec-searchbar-category-wrap select").niceSelect();
1658                        }
1659
1660                        // Locations
1661                        if (typeof response.locations !== 'undefined' && response.locations !== '') {
1662                            // Checkboxes
1663                            if ($location.length && location_type === 'simple-checkboxes') {
1664                                $location.html(response.locations);
1665                            }
1666                            // Dropdown
1667                            else if ($location.length) {
1668                                $location.replaceWith(response.locations);
1669                            }
1670                        }
1671
1672                        // Organizers
1673                        if (typeof response.organizers !== 'undefined' && response.organizers !== '') {
1674                            // Checkboxes
1675                            if ($organizer.length && organizer_type === 'simple-checkboxes') {
1676                                $organizer.html(response.organizers);
1677                            }
1678                            // Dropdown
1679                            else if ($organizer.length) {
1680                                $organizer.replaceWith(response.organizers);
1681                            }
1682                        }
1683
1684                        // Speakers
1685                        if (typeof response.speakers !== 'undefined' && response.speakers !== '') {
1686                            // Checkboxes
1687                            if ($speaker.length && speaker_type === 'simple-checkboxes') {
1688                                $speaker.html(response.speakers);
1689                            }
1690                            // Dropdown
1691                            else if ($speaker.length) {
1692                                $speaker.replaceWith(response.speakers);
1693                            }
1694                        }
1695
1696                        // Labels
1697                        if (typeof response.labels !== 'undefined' && response.labels !== '') {
1698                            // Checkboxes
1699                            if ($label.length && label_type === 'simple-checkboxes') {
1700                                $label.html(response.labels);
1701                            }
1702                            // Dropdown
1703                            else if ($label.length) {
1704                                $label.replaceWith(response.labels);
1705                            }
1706                        }
1707
1708                        // Tags
1709                        if (typeof response.tags !== 'undefined' && response.tags !== '') {
1710                            $tag.replaceWith(response.tags);
1711                        }
1712
1713                        // Trigger
1714                        trigger();
1715                    },
1716                    error: function () { }
1717                });
1718        }
1719    };
1720}(jQuery));
1721
1722jQuery(document).ready(function ($) {
1723    // Select2
1724    if (jQuery(".mec-fes-form-cntt #mec-location select").length > 0) {
1725        jQuery(".mec-fes-form-cntt #mec-location select").select2();
1726        jQuery(".mec-fes-form-cntt #mec-location select").each(function () { mecApplySelect2Accessibility(jQuery(this)); });
1727    }
1728    if (jQuery(".mec-fes-form-cntt #mec-organizer select").length > 0) {
1729        jQuery(".mec-fes-form-cntt #mec-organizer select").select2();
1730        jQuery(".mec-fes-form-cntt #mec-organizer select").each(function () { mecApplySelect2Accessibility(jQuery(this)); });
1731    }
1732    // Location select2
1733    if (jQuery("#mec_location_id").length > 0) {
1734        jQuery("#mec_location_id").select2();
1735        mecApplySelect2Accessibility(jQuery("#mec_location_id"));
1736    }
1737    // Organizer Select2
1738    if (jQuery("#mec_organizer_id").length > 0) {
1739        jQuery("#mec_organizer_id").select2();
1740        mecApplySelect2Accessibility(jQuery("#mec_organizer_id"));
1741    }
1742    // Categories Search bar
1743    if (jQuery(".mec-searchbar-category-wrap select").length > 0) {
1744        jQuery(".mec-searchbar-category-wrap select").select2();
1745        jQuery(".mec-searchbar-category-wrap select").each(function () { mecApplySelect2Accessibility(jQuery(this)); });
1746    }
1747
1748    jQuery(".mec-search-form.mec-totalcal-box").find(".mec-search-reset-button").parents().eq(2).addClass("mec-there-reset-button");
1749
1750    jQuery(".mec-search-form.mec-totalcal-box").find(".mec-minmax-event-cost").parent().find(".mec-text-address-search").addClass("with-mec-cost");
1751    jQuery(".mec-search-form.mec-totalcal-box").find(".mec-text-address-search").parent().find(".mec-minmax-event-cost").addClass("with-mec-address");
1752
1753    /** New Searchbar JS */
1754    jQuery(".mec-full-calendar-search-ends").find(".mec-text-input-search").parent().find(".mec-tab-loader").removeClass("col-md-12").addClass("col-md-6");
1755    jQuery(".mec-search-form.mec-totalcal-box").find(".mec-text-input-search").parent().find(".mec-date-search").parent().find(".mec-text-input-search").addClass("col-md-6");
1756    jQuery(".mec-search-form.mec-totalcal-box").find(".mec-text-input-search").parent().find(".mec-time-picker-search").parent().find(".mec-text-input-search").addClass("col-md-6");
1757    jQuery(".mec-full-calendar-search-ends").find(".mec-text-input-search").addClass("col-md-12").parent().find(".mec-time-picker-search").addClass("col-md-6");
1758    jQuery(".mec-search-form.mec-totalcal-box").find(".mec-date-search").parent().find(".mec-time-picker-search").addClass("with-mec-date-search");
1759    jQuery(".mec-search-form.mec-totalcal-box").find(".mec-time-picker-search").parent().find(".mec-date-search").addClass("with-mec-time-picker");
1760
1761    jQuery('#mec-gCalendar-wrap .openMonthFilter').on('click', function (e) {
1762        jQuery(this).toggleClass('open');
1763    });
1764
1765    jQuery('body').on('click', function (e) {
1766        jQuery('#mec-gCalendar-wrap .openMonthFilter').removeClass('open');
1767    });
1768
1769    mec_init_number_spinner();
1770});
1771
1772function mec_init_number_spinner() {
1773    /* buttons functions */
1774    jQuery('.mec-booking .mec-event-tickets-list .mec-ticket-style-row div a').off('click').on('click', function () {
1775        var $input = jQuery(this).parents('.mec-ticket-style-row div').find(jQuery('input.in-num'));
1776
1777        var count = parseFloat($input.val());
1778        if (jQuery(this).hasClass('minus')) {
1779            count = count - 1;
1780            count = count < 1 ? 0 : count;
1781            if (count < 1) {
1782                jQuery(this).addClass('dis');
1783            }
1784            else {
1785                jQuery(this).removeClass('dis');
1786            }
1787            $input.val(count);
1788        }
1789        else {
1790            count = count + 1;
1791            $input.val(count);
1792            if (count > 1) {
1793                jQuery(this).parents('.mec-ticket-style-row div').find(('.minus')).removeClass('dis');
1794            }
1795        }
1796
1797        $input.change();
1798        return false;
1799    });
1800}
1801
1802jQuery(window).on('load', function () {
1803    jQuery(".single-mec-events").find(".mejs-controls button").addClass("mejs")
1804});
1805
1806// MEC FULL CALENDAR PLUGIN
1807(function ($) {
1808    $.fn.mecFullCalendar = function (options) {
1809        // Default Options
1810        var settings = $.extend({
1811            // These are the defaults.
1812            id: 0,
1813            atts: '',
1814            ajax_url: '',
1815            sf: {},
1816            skin: '',
1817        }, options);
1818
1819        // Set onclick Listeners
1820        setListeners();
1821
1822        $(document).trigger('mec_full_calendar_before_init', $("#mec_full_calendar_container_" + settings.id));
1823
1824        mecFluentCurrentTimePosition();
1825        mecFluentCustomScrollbar();
1826
1827        var sf;
1828
1829        function setListeners() {
1830            // Search Widget
1831            if (settings.sf.container !== '' && false == $(settings.sf.container).hasClass('mec-skin-search-init')) {
1832                sf = $(settings.sf.container).mecSearchForm({
1833                    id: settings.id,
1834                    refine: settings.sf.refine,
1835                    ajax_url: settings.ajax_url,
1836                    start_date: settings.start_date,
1837                    atts: settings.atts,
1838                    callback: function (atts) {
1839                        settings.atts = atts;
1840                        if (false == $("#mec_skin_" + settings.id).hasClass('mec-fluent-wrap') && false == $("#mec_skin_" + settings.id).hasClass('mec-liquid-wrap')) {
1841
1842                            search();
1843                        }
1844                    }
1845                });
1846
1847                $(settings.sf.container).addClass('mec-skin-search-init');
1848            }
1849
1850            $('.mec-subscribe-to-calendar-btn').off('click').on('click', function () {
1851                $(this).parent().find('>.mec-subscribe-to-calendar-items').toggle();
1852            });
1853
1854            // Add the onclick event
1855            $("#mec_skin_" + settings.id + " .mec-totalcal-box .mec-totalcal-view span:not(.mec-fluent-more-views-icon):not(.mec-fluent-more-views-content)").on('click', function (e) {
1856                e.preventDefault();
1857                var skin = $(this).data('skin');
1858                var mec_month_select = $('#mec_sf_month_' + settings.id);
1859                var mec_year_select = $('#mec_sf_year_' + settings.id);
1860
1861                if (mec_year_select.val() == 'none') {
1862                    mec_year_select.find('option').each(function () {
1863                        var option_val = $(this).val();
1864                        if (option_val == mecdata.current_year) mec_year_select.val(option_val);
1865                    });
1866                }
1867
1868                if (mec_month_select.val() == 'none') {
1869                    mec_month_select.find('option').each(function () {
1870                        var option_val = $(this).val();
1871                        if (option_val == mecdata.current_month) mec_month_select.val(option_val);
1872                    });
1873                }
1874
1875                if (skin == 'list' || skin == 'grid' || skin == 'agenda') {
1876                    var mec_filter_none = '<option class="mec-none-item" value="none">' + $('#mec-filter-none').val() + '</option>';
1877                    if (mec_month_select.find('.mec-none-item').length == 0) mec_month_select.prepe
1877nd(mec_filter_none);
1878                    if (mec_year_select.find('.mec-none-item').length == 0) mec_year_select.prepend(mec_filter_none);
1879                }
1880                else {
1881                    if (mec_month_select.find('.mec-none-item').length != 0) mec_month_select.find('.mec-none-item').remove();
1882                    if (mec_year_select.find('.mec-none-item').length != 0) mec_year_select.find('.mec-none-item').remove();
1883                }
1884
1885                $("#mec_skin_" + settings.id + " .mec-totalcal-box .mec-totalcal-view span").removeClass('mec-totalcalview-selected')
1886                $(this).addClass('mec-totalcalview-selected');
1887                if ($(this).closest('.mec-fluent-more-views-content').length > 0) {
1888                    $('.mec-fluent-more-views-icon').addClass('active');
1889                    $('.mec-fluent-more-views-content').removeClass('active');
1890                } else {
1891                    $('.mec-fluent-more-views-icon').removeClass('active');
1892                }
1893
1894                loadSkin(skin);
1895            });
1896        }
1897
1898        function loadSkin(skin) {
1899            // Set new Skin
1900            settings.skin = skin;
1901
1902            // Add Loading Class
1903            if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
1904            jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
1905
1906            var $month_picker = $("#mec_sf_month_" + settings.id);
1907            var $year_picker = $("#mec_sf_year_" + settings.id);
1908
1909            // Add Month & Year
1910            if (settings.atts.indexOf('sf[month]') <= -1 && $month_picker.length && $year_picker.length) {
1911                settings.atts += '&sf[month]=' + $month_picker.val() + '&sf[year]=' + $year_picker.val();
1912            }
1913
1914            $.ajax({
1915                url: settings.ajax_url,
1916                data: "action=mec_full_calendar_switch_skin&skin=" + skin + "&" + settings.atts + "&apply_sf_date=1&sed=" + settings.sed_method,
1917                type: "post",
1918                success: function (response) {
1919
1920                    jQuery(document).trigger('mec_before_load_skin_success', [$("#mec_full_calendar_container_" + settings.id), settings.id]);
1921
1922                    $("#mec_full_calendar_container_" + settings.id).html(response);
1923
1924                    // Remove loader
1925                    $('.mec-modal-result').removeClass("mec-month-navigator-loading");
1926
1927                    // Focus First Active Day
1928                    mecFocusDay(settings);
1929
1930                    mecFluentCurrentTimePosition();
1931                    mecFluentCustomScrollbar();
1932
1933                    jQuery(document).trigger('mec_load_skin_success', $("#mec_full_calendar_container_" + settings.id));
1934                },
1935                error: function () { }
1936            });
1937        }
1938
1939        function search() {
1940            // Add Loading Class
1941            if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
1942            jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
1943
1944            $.ajax({
1945                url: settings.ajax_url,
1946                data: "action=mec_full_calendar_switch_skin&skin=" + settings.skin + "&" + settings.atts + "&apply_sf_date=1",
1947                type: "post",
1948                success: function (response) {
1949                    $("#mec_full_calendar_container_" + settings.id).html(response);
1950
1951                    // Remove loader
1952                    $('.mec-modal-result').removeClass("mec-month-navigator-loading");
1953
1954                    // Focus First Active Day
1955                    mecFocusDay(settings);
1956
1957                    // Focus First Active Week
1958                    mec_focus_week(settings.id);
1959
1960                    mecFluentCurrentTimePosition();
1961                    mecFluentCustomScrollbar();
1962
1963                    jQuery(document).trigger('mec_search_success', $("#mec_full_calendar_container_" + settings.id));
1964                },
1965                error: function () { }
1966            });
1967        }
1968    };
1969
1970}(jQuery));
1971
1972// MEC YEARLY VIEW PLUGIN
1973(function ($) {
1974    $.fn.mecYearlyView = function (options) {
1975        var active_year;
1976
1977        // Default Options
1978        var settings = $.extend({
1979            // These are the defaults.
1980            today: null,
1981            id: 0,
1982            events_label: 'Events',
1983            event_label: 'Event',
1984            year_navigator: 0,
1985            atts: '',
1986            next_year: {},
1987            sf: {},
1988            ajax_url: '',
1989        }, options);
1990
1991        mecFluentYearlyUI(settings.id, settings.year_id);
1992
1993        // Initialize Year Navigator
1994        if (settings.year_navigator) initYearNavigator();
1995
1996        // Set onclick Listeners
1997        setListeners();
1998
1999        // load more
2000        $(document).on("click", "#mec_skin_events_" + settings.id + " .mec-load-more-button", function () {
2001            var year = $(this).parent().parent().parent().data('year-id');
2002            loadMoreButton(year);
2003        });
2004
2005        // Search Widget
2006        if (settings.sf.container !== '') {
2007            sf = $(settings.sf.container).mecSearchForm({
2008                id: settings.id,
2009                refine: settings.sf.refine,
2010                ajax_url: settings.ajax_url,
2011                start_date: settings.start_date,
2012                atts: settings.atts,
2013                callback: function (atts) {
2014                    settings.atts = atts;
2015                    active_year = $('.mec-yearly-view-wrap .mec-year-navigator').filter(function () {
2016                        return $(this).css('display') == "block";
2017                    });
2018                    active_year = parseInt(active_year.find('h2').text());
2019                    search(active_year);
2020                }
2021            });
2022
2023            $(settings.sf.container).addClass('mec-skin-search-init');
2024        }
2025
2026        function initYearNavigator() {
2027            // Add onclick event
2028            $("#mec_skin_" + settings.id + " .mec-load-year").off("click").on("click", function () {
2029                var year = $(this).data("mec-year");
2030                setYear(year);
2031            });
2032        }
2033
2034        function search(year) {
2035            // Add Loading Class
2036            if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
2037            jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
2038
2039            $.ajax({
2040                url: settings.ajax_url,
2041                data: "action=mec_yearly_view_load_year&mec_year=" + year + "&" + settings.atts + "&apply_sf_date=1",
2042                dataType: "json",
2043                type: "post",
2044                success: function (response) {
2045                    active_year = response.current_year.year;
2046
2047                    // Append Year
2048                    $("#mec_skin_events_" + settings.id).html('<div class="mec-year-container" id="mec_yearly_view_year_' + settings.id + '_' + response.current_year.id + '" data-year-id="' + response.current_year.id + '">' + response.year + '</div>');
2049
2050                    // Append Year Navigator
2051                    $("#mec_skin_" + settings.id + " .mec-yearly-title-sec").append('<div class="mec-year-navigator" id="mec_year_navigator_' + settings.id + '_' + response.current_year.id + '">' + response.navigator + '</div>');
2052
2053                    // Re-initialize Year Navigator
2054                    initYearNavigator();
2055
2056                    // Set onclick Listeners
2057                    setListeners();
2058
2059                    // Toggle Year
2060                    toggleYear(response.current_year.id);
2061
2062                    // Remove loading Class
2063                    $('.mec-modal-result').removeClass("mec-month-navigator-loading");
2064
2065                    mecFluentYearlyUI(settings.id, active_year);
2066                    mecFluentCustomScrollbar();
2067
2068                    $(document).trigger('mec_search_init', ['yearly_view', settings, response]);
2069
2070                },
2071                error: function () { }
2072            });
2073        }
2074
2075        function setYear(year, do_in_background) {
2076            if (typeof do_in_background === "undefined") do_in_background = false;
2077
2078            var year_id = year;
2079            active_year = year;
2080
2081            // Year exists so we just show it
2082            if ($("#mec_yearly_view_year_" + settings.id + "_" + year_id).length) {
2083                // Toggle Year
2084                toggleYear(year_id);
2085                mecFluentCustomScrollbar();
2086            } else {
2087                if (!do_in_background) {
2088                    // Add Loading Class
2089                    if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
2090                    jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
2091                }
2092
2093                $.ajax({
2094                    url: settings.ajax_url,
2095                    data: "action=mec_yearly_view_load_year&mec_year=" + year + "&" + settings.atts + "&apply_sf_date=0",
2096                    dataType: "json",
2097                    type: "post",
2098                    success: function (response) {
2099                        // Append Year
2100                        $("#mec_skin_events_" + settings.id).append('<div class="mec-year-container" id="mec_yearly_view_year_' + settings.id + '_' + response.current_year.id + '" data-year-id="' + response.current_year.id + '">' + response.year + '</div>');
2101
2102                        // Append Year Navigator
2103                        $("#mec_skin_" + settings.id + " .mec-yearly-title-sec").append('<div class="mec-year-navigator" id="mec_year_navigator_' + settings.id + '_' + response.current_year.id + '">' + response.navigator + '</div>');
2104
2105                        // Re-initialize Year Navigator
2106                        initYearNavigator();
2107
2108                        // Set onclick Listeners
2109                        setListeners();
2110
2111                        if (!do_in_background) {
2112                            // Toggle Year
2113                            toggleYear(response.current_year.id);
2114
2115                            // Remove loading Class
2116                            $('.mec-modal-result').removeClass("mec-month-navigator-loading");
2117
2118                            // Set Year Filter values in search widget
2119                            $("#mec_sf_year_" + settings.id).val(year);
2120                        } else {
2121                            $("#mec_yearly_view_year_" + settings.id + "_" + response.current_year.id).hide();
2122                            $("#mec_year_navigator_" + settings.id + "_" + response.current_year.id).hide();
2123                        }
2124                        mecFluentYearlyUI(settings.id, year);
2125                        if (!do_in_background) {
2126                            mecFluentCustomScrollbar();
2127                        }
2128                    },
2129                    error: function () { }
2130                });
2131            }
2132        }
2133
2134        function toggleYear(year_id) {
2135            // Toggle Year Navigator
2136            $("#mec_skin_" + settings.id + " .mec-year-navigator").hide();
2137            $("#mec_year_navigator_" + settings.id + "_" + year_id).show();
2138
2139            // Toggle Year
2140            $("#mec_skin_" + settings.id + " .mec-year-container").hide();
2141            $("#mec_yearly_view_year_" + settings.id + "_" + year_id).show();
2142        }
2143
2144        var sf;
2145
2146        function setListeners() {
2147            // Single Event Method
2148            if (settings.sed_method != '0') {
2149                sed();
2150            }
2151
2152            $('.mec-subscribe-to-calendar-btn').off('click').on('click', function () {
2153                $(this).parent().find('>.mec-subscribe-to-calendar-items').toggle();
2154            });
2155
2156            // Yearly view
2157            $("#mec_skin_" + settings.id + " .mec-has-event a").on('click', function (e) {
2158                e.preventDefault();
2159
2160                var des = $(this).attr('href');
2161                var visible = $(des).is(':visible');
2162                if (!visible) {
2163                    var year = $(des).parents('.mec-year-container').data('year-id');
2164                    if (year) {
2165
2166                        while (!visible) {
2167                            loadMoreButton(year);
2168
2169                            visible = $(des).is(':visible');
2170                        }
2171                    }
2172                }
2173
2174                $('.mec-events-agenda').removeClass('mec-selected');
2175                $(des).closest('.mec-events-agenda').addClass('mec-selected');
2176
2177                var scrollTopVal = $(des).closest('.mec-events-agenda').offset().top - 35;
2178                if ($(this).closest('.mec-fluent-wrap').length > 0) {
2179                    var parent = jQuery(this).closest('.mec-fluent-wrap').find('.mec-yearly-agenda-sec');
2180                    scrollTopVal = parent.scrollTop() + ($(des).closest('.mec-events-agenda').offset().top - parent.offset().top);
2181                    jQuery(this).closest('.mec-fluent-wrap').find('.mec-yearly-agenda-sec').getNiceScroll(0).doScrollTop(scrollTopVal - 15, 120);
2182                }
2183                else {
2184                    $('html, body').animate({
2185                        scrollTop: scrollTopVal
2186                    }, 300);
2187                }
2188            });
2189        }
2190
2191        function sed() {
2192            // Single Event Display
2193            $("#mec_skin_" + settings.id + " .mec-agenda-event-title a").off('click').on('click', function (e) {
2194                var sed_method = $(this).attr('target');
2195                if ('_blank' === sed_method) {
2196
2197                    return;
2198                }
2199                e.preventDefault();
2200                var href = $(this).attr('href');
2201
2202                var id = $(this).data('event-id');
2203                var occurrence = get_parameter_by_name('occurrence', href);
2204                var time = get_parameter_by_name('time', href);
2205
2206                if ('undefined' == typeof id) {
2207                    return;
2208                }
2209
2210                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
2211            });
2212        }
2213
2214        function loadMoreButton(year) {
2215            var $max_count, $current_count = 0;
2216            $max_count = $("#mec_yearly_view_year_" + settings.id + "_" + year + " .mec-yearly-max").data('count');
2217            $current_count = $("#mec_yearly_view_year_" + settings.id + "_" + year + " .mec-util-hidden").length;
2218
2219            if ($current_count > 10) {
2220                for (var i = 0; i < 10; i++) {
2221                    $("#mec_yearly_view_year_" + settings.id + "_" + year + " .mec-util-hidden").slice(0, 2).each(function () {
2222                        $(this).removeClass('mec-util-hidden');
2223                    });
2224                }
2225            }
2226
2227            if ($current_count < 10 && $current_count != 0) {
2228                for (var j = 0; j < $current_count; j++) {
2229                    $("#mec_yearly_view_year_" + settings.id + "_" + year + " .mec-util-hidden").slice(0, 2).each(function () {
2230                        $(this).removeClass('mec-util-hidden');
2231                        $("#mec_yearly_view_year_" + settings.id + "_" + year + " .mec-load-more-wrap").css('display', 'none');
2232                    });
2233                }
2234            }
2235        }
2236    };
2237
2238}(jQuery));
2239
2240
2241// MEC GENERAL CALENDAR VIEW PLUGIN
2242(function ($) {
2243    $.fn.mecGeneralCalendarView = function (options) {
2244        // Default Options
2245        var settings = $.extend({
2246            // These are the defaults.
2247            id: 0,
2248            atts: '',
2249            ajax_url: '',
2250            sf: {},
2251        }, options);
2252
2253        // Set onclick Listeners
2254        setListeners();
2255
2256        function setListeners() {
2257            // Single Event Method
2258            if (settings.sed_method != '0') {
2259                sed();
2260            }
2261        }
2262        function sed() {
2263            // Single Event Display
2264            $("#mec_skin_" + settings.id + " .fc-daygrid-event").off('click').on('click', function (e) {
2265                e.preventDefault();
2266                var sed_method = $(this).attr('target');
2267                if ('_blank' === sed_method || '_self' === sed_method || 'no' === sed_method) {
2268
2269                    return;
2270                }
2271                e.preventDefault();
2272                var href = $(this).attr('href');
2273
2274                var id = $(this).data('event-id');
2275                var occurrence = get_parameter_by_name('occurrence', href);
2276                var time = get_parameter_by_name('time', href);
2277
2278                if ('undefined' == typeof id) {
2279                    return;
2280                }
2281
2282                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
2283            });
2284        }
2285    };
2286
2287}(jQuery));
2288
2289// MEC MONTHLY VIEW PLUGIN
2290(function ($) {
2291    $.fn.mecMonthlyView = function (options) {
2292        var active_month;
2293        var active_year;
2294
2295        // Default Options
2296        var settings = $.extend({
2297            // These are the defaults.
2298            today: null,
2299            id: 0,
2300            events_label: 'Events',
2301            event_label: 'Event',
2302            month_navigator: 0,
2303            atts: '',
2304            active_month: {},
2305            next_month: {},
2306            sf: {},
2307            ajax_url: '',
2308        }, options);
2309
2310        // Initialize Month Navigator
2311        if (settings.month_navigator) initMonthNavigator();
2312
2313        active_month = settings.active_month.month;
2314        active_year = settings.active_month.year;
2315
2316        // Set onclick Listeners
2317        setListeners();
2318
2319        // Search Widget
2320        if (settings.sf.container !== '') {
2321            sf = $(settings.sf.container).mecSearchForm({
2322                id: settings.id,
2323                refine: settings.sf.refine,
2324                ajax_url: settings.ajax_url,
2325                start_date: settings.start_date,
2326                atts: settings.atts,
2327                callback: function (atts) {
2328                    settings.atts = atts;
2329                    search(active_year, active_month);
2330                }
2331            });
2332
2333            $(settings.sf.container).addClass('mec-skin-search-init');
2334        }
2335
2336        function initMonthNavigator() {
2337            // Remove the onclick event
2338            $("#mec_skin_" + settings.id + " .mec-load-month").off("click");
2339
2340            // Add onclick event
2341            $("#mec_skin_" + settings.id + " .mec-load-month").on("click", function () {
2342                var year = $(this).data("mec-year");
2343                var month = $(this).data("mec-month");
2344
2345                setMonth(year, month, false, true);
2346            });
2347        }
2348
2349        function search(year, month) {
2350            // Modal
2351            var $modal = jQuery('.mec-modal-result');
2352
2353            // Add Loading Class
2354            if ($modal.length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
2355            $modal.addClass('mec-month-navigator-loading');
2356
2357            $.ajax(
2358                {
2359                    url: settings.ajax_url,
2360                    data: "action=mec_monthly_view_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=1",
2361                    dataType: "json",
2362                    type: "post",
2363                    success: function (response) {
2364                        // Append Month
2365                        $("#mec_skin_events_" + settings.id).html('<div class="mec-month-container" id="mec_monthly_view_month_' + settings.id + '_' + response.current_month.id + '" data-month-id="' + response.current_month.id + '">' + response.month + '</div>');
2366
2367                        // Append Month Navigator
2368                        $("#mec_skin_" + settings.id + " .mec-skin-monthly-view-month-navigator-container").html('<div class="mec-month-navigator" id="mec_month_navigator_' + settings.id + '_' + response.current_month.id + '">' + response.navigator + '</div>');
2369
2370                        // Append Events Side
2371                        $("#mec_skin_" + settings.id + " .mec-calendar-events-side").html('<div class="mec-month-side" id="mec_month_side_' + settings.id + '_' + response.current_month.id + '">' + response.events_side + '</div>');
2372
2373                        // Re-initialize Month Navigator
2374                        initMonthNavigator();
2375
2376                        // Set onclick Listeners
2377                        setListeners();
2378
2379                        // Toggle Month
2380                        toggleMonth(response.current_month.id);
2381
2382                        jQuery(document).trigger('load_calendar_data');
2383
2384                        // Remove loading Class
2385                        $('.mec-modal-result').removeClass("mec-month-navigator-loading");
2386
2387                        $(document).trigger('mec_search_init', ['monthly_view', settings, response]);
2388
2389                    },
2390                    error: function () { }
2391                });
2392        }
2393
2394        function setMonth(year, month, do_in_background, navigator_click) {
2395            if (typeof do_in_background === "undefined") do_in_background = false;
2396            navigator_click = navigator_click || false;
2397            var month_id = year + "" + month;
2398
2399            if (!do_in_background) {
2400                active_month = month;
2401                active_year = year;
2402            }
2403
2404            // Month exists so we just show it
2405            if ($("#mec_monthly_view_month_" + settings.id + "_" + month_id).length) {
2406                // Set Month Filter values in search widget
2407                $("#mec_sf_month_" + settings.id).val(month);
2408                $("#mec_sf_year_" + settings.id).val(year);
2409
2410                // Toggle Month
2411                toggleMonth(month_id);
2412            } else {
2413                if (!do_in_background) {
2414
2415                    // Add Loading Class
2416                    if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
2417                    jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
2418                }
2419
2420                $.ajax({
2421                    url: settings.ajax_url,
2422                    data: "action=mec_monthly_view_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=0" + "&navigator_click=" + navigator_click,
2423                    dataType: "json",
2424                    type: "post",
2425                    success: function (response) {
2426                        // Append Month
2427                        $("#mec_skin_events_" + settings.id).append('<div class="mec-month-container" id="mec_monthly_view_month_' + settings.id + '_' + response.current_month.id + '" data-month-id="' + response.current_month.id + '">' + response.month + '</div>');
2428
2429                        // Append Month Navigator
2430                        $("#mec_skin_" + settings.id + " .mec-skin-monthly-view-month-navigator-container").append('<div class="mec-month-navigator" id="mec_month_navigator_' + settings.id + '_' + response.current_month.id + '">' + response.navigator + '</div>');
2431
2432                        // Append Events Side
2433                        $("#mec_skin_" + settings.id + " .mec-calendar-events-side").append('<div class="mec-month-side" id="mec_month_side_' + settings.id + '_' + response.current_month.id + '">' + response.events_side + '</div>');
2434
2435                        // Re-initialize Month Navigator
2436                        initMonthNavigator();
2437
2438                        // Set onclick Listeners
2439                        setListeners();
2440
2441                        if (!do_in_background) {
2442                            // Toggle Month
2443                            toggleMonth(response.current_month.id);
2444
2445                            // Remove loading Class
2446                            $('.mec-modal-result').removeClass("mec-month-navigator-loading");
2447
2448                            // Set Month Filter values in search widget
2449                            $("#mec_sf_month_" + settings.id).val(month);
2450                            $("#mec_sf_year_" + settings.id).val(year);
2451                        } else {
2452                            $("#mec_monthly_view_month_" + settings.id + "_" + response.current_month.id).hide();
2453                            $("#mec_month_navigator_" + settings.id + "_" + response.current_month.id).hide();
2454                            $("#mec_month_side_" + settings.id + "_" + response.current_month.id).hide();
2455                        }
2456                        if (typeof custom_month !== undefined) var custom_month;
2457                        if (typeof custom_month != undefined) {
2458                            if (custom_month == 'true') {
2459                                $(".mec-month-container .mec-calendar-day").removeClass('mec-has-event');
2460                                $(".mec-month-container .mec-calendar-day").removeClass('mec-selected-day');
2461                                $('.mec-calendar-day').off('click');
2462                            }
2463                        }
2464
2465                        jQuery(document).trigger('load_calendar_data');
2466
2467                    },
2468                    error: function () { }
2469                });
2470            }
2471        }
2472
2473        function toggleMonth(month_id) {
2474            var active_month = $("#mec_skin_" + settings.id + " .mec-month-container-selected").data("month-id");
2475            var active_day = $("#mec_monthly_view_month_" + settings.id + "_" + active_month + " .mec-selected-day").data("day");
2476
2477            if (active_day <= 9) active_day = "0" + active_day;
2478
2479            // Toggle Month Navigator
2480            $("#mec_skin_" + settings.id + " .mec-month-navigator").hide();
2481            $("#mec_month_navigator_" + settings.id + "_" + month_id).show();
2482
2483            // Toggle Month
2484            $("#mec_skin_" + settings.id + " .mec-month-container").hide();
2485            $("#mec_monthly_view_month_" + settings.id + "_" + month_id).show();
2486
2487            // Add selected class
2488            $("#mec_skin_" + settings.id + " .mec-month-container").removeClass("mec-month-container-selected");
2489            $("#mec_monthly_view_month_" + settings.id + "_" + month_id).addClass("mec-month-container-selected");
2490
2491            // Toggle Events Side
2492            $("#mec_skin_" + settings.id + " .mec-month-side").hide();
2493            $("#mec_month_side_" + settings.id + "_" + month_id).show();
2494
2495            jQuery(document).trigger('mec_toggle_month', [settings, month_id]);
2496        }
2497
2498        var sf;
2499
2500        function setListeners() {
2501            // Remove the onclick event
2502            $("#mec_skin_" + settings.id + " .mec-has-event").off("click");
2503
2504            // Add the onclick event
2505            $("#mec_skin_" + settings.id + " .mec-has-event").on('click', function (e) {
2506                // define variables
2507                var $this = $(this),
2508                    data_mec_cell = $this.data('mec-cell'),
2509                    month_id = $this.data('month');
2510
2511                if (settings.display_all == 0) {
2512                    e.preventDefault();
2513
2514                    $("#mec_monthly_view_month_" + settings.id + "_" + month_id + " .mec-calendar-day").removeClass('mec-selected-day');
2515                    $this.addClass('mec-selected-day');
2516
2517                    $('#mec_month_side_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec:not([data-mec-cell=' + data_mec_cell + '])').slideUp();
2518                    $('#mec_month_side_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec[data-mec-cell=' + data_mec_cell + ']').slideDown();
2519
2520                    $('#mec_monthly_view_month_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec:not([data-mec-cell=' + data_mec_cell + '])').slideUp();
2521                    $('#mec_monthly_view_month_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec[data-mec-cell=' + data_mec_cell + ']').slideDown();
2522                }
2523                else {
2524                    $("#mec_monthly_view_month_" + settings.id + "_" + month_id + " .mec-calendar-day").removeClass('mec-selected-day');
2525                    $this.addClass('mec-selected-day');
2526                }
2527            });
2528
2529            $('.mec-subscribe-to-calendar-btn').off('click').on('click', function () {
2530                $(this).parent().find('>.mec-subscribe-to-calendar-items').toggle();
2531            });
2532
2533            mec_tooltip();
2534
2535            // Single Event Method
2536            if (settings.sed_method != '0') {
2537                sed();
2538            }
2539
2540            if (settings.style == 'novel') {
2541                if ($('.mec-single-event-novel').length > 0) {
2542                    $('.mec-single-event-novel').colourBrightness();
2543                    $('.mec-single-event-novel').each(function () {
2544                        $(this).colourBrightness()
2545                    });
2546                }
2547            }
2548        }
2549
2550        function sed() {
2551            // Single Event Display
2552            $("#mec_skin_" + settings.id + " .mec-event-title a,#mec_skin_" + settings.id + " .event-single-link-novel,#mec_skin_" + settings.id + " .mec-monthly-tooltip").off('click').on('click', function (e) {
2553                var sed_method = $(this).attr('target');
2554                if ('_blank' === sed_method) {
2555
2556                    return;
2557                }
2558                e.preventDefault();
2559                var href = $(this).attr('href');
2560
2561                var id = $(this).data('event-id');
2562                var occurrence = get_parameter_by_name('occurrence', href);
2563                var time = get_parameter_by_name('time', href);
2564
2565                if ('undefined' == typeof id) {
2566                    return;
2567                }
2568
2569                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
2570            });
2571
2572        }
2573
2574        function mec_tooltip() {
2575            if ($('.mec-monthly-tooltip').length >= 1) {
2576                if (Math.max(document.documentElement.clientWidth, window.innerWidth || 0) > 768) {
2577                    $('.mec-monthly-tooltip').tooltipster({
2578                        theme: 'tooltipster-shadow',
2579                        interactive: true,
2580                        delay: 100,
2581                        minWidth: 350,
2582                        maxWidth: 350
2583                    });
2584                    if (settings.sed_method != '0') {
2585                        sed();
2586                    }
2587                } else {
2588                    var touchtime = 0;
2589                    $(".mec-monthly-tooltip").on("click", function (event) {
2590                        event.preventDefault();
2591                        if (touchtime == 0) {
2592                            $('.mec-monthly-tooltip').tooltipster({
2593                                theme: 'tooltipster-shadow',
2594                                interactive: true,
2595                                delay: 100,
2596                                minWidth: 350,
2597                                maxWidth: 350,
2598                                trigger: "custom",
2599                                triggerOpen: {
2600                                    click: true,
2601                                    tap: true
2602                                },
2603                                triggerClose: {
2604                                    click: true,
2605                                    tap: true
2606                                }
2607                            });
2608                            touchtime = new Date().getTime();
2609                        } else {
2610                            if (((new Date().getTime()) - touchtime) < 200) {
2611                                var el = $(this);
2612                                var link = el.attr("href");
2613                                window.location = link;
2614                                touchtime = 0;
2615                            } else {
2616                                touchtime = new Date().getTime();
2617                            }
2618                        }
2619                    });
2620                }
2621            }
2622        }
2623    };
2624
2625}(jQuery));
2626
2627// MEC WEEKLY VIEW PLUGIN
2628(function ($) {
2629    $.fn.mecWeeklyView = function (options) {
2630        var active_year;
2631        var active_month;
2632        var active_week;
2633        var active_week_number;
2634
2635        // Default Options
2636        var settings = $.extend({
2637            // These are the defaults.
2638            today: null,
2639            week: 1,
2640            id: 0,
2641            current_year: null,
2642            current_month: null,
2643            changeWeekElement: '.mec-load-week',
2644            month_navigator: 0,
2645            atts: '',
2646            ajax_url: '',
2647            sf: {}
2648        }, options);
2649
2650        // Set Active Time
2651        active_year = settings.current_year;
2652        active_month = settings.current_month;
2653
2654        // Search Widget
2655        if (settings.sf.container !== '') {
2656            $(settings.sf.container).mecSearchForm({
2657                id: settings.id,
2658                refine: settings.sf.refine,
2659                ajax_url: settings.ajax_url,
2660                start_date: settings.start_date,
2661                atts: settings.atts,
2662                callback: function (atts) {
2663                    settings.atts = atts;
2664                    search(active_year, active_month, active_week);
2665                }
2666            });
2667
2668            $(settings.sf.container).addClass('mec-skin-search-init');
2669        }
2670
2671        // Set The Week
2672        setThisWeek(settings.month_id + settings.week);
2673
2674        // Set Listeners
2675        setListeners();
2676
2677        // Initialize Month Navigator
2678        if (settings.month_navigator) initMonthNavigator(settings.month_id);
2679
2680        function setListeners() {
2681            $(settings.changeWeekElement).off('click').on('click', function (e) {
2682                var week = $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active').data('week-id');
2683                var max_weeks = $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active').data('max-weeks');
2684                var new_week_number = active_week_number;
2685
2686                if ($(this).hasClass('mec-previous-month')) {
2687                    week = parseInt(week) - 1;
2688                    new_week_number--;
2689                } else {
2690                    week = parseInt(week) + 1;
2691                    new_week_number++;
2692                }
2693
2694                if (new_week_number <= 1 || new_week_number >= max_weeks) {
2695                    // Disable Next/Previous Button
2696                    $(this).css({
2697                        'opacity': .6,
2698                        'cursor': 'default'
2699                    });
2700                    $(this).find('i').css({
2701                        'opacity': .6,
2702                        'cursor': 'default'
2703                    });
2704                } else {
2705                    // Enable Next/Previous Buttons
2706                    $('#mec_skin_' + settings.id + ' .mec-load-week, #mec_skin_' + settings.id + ' .mec-load-week i').css({
2707                        'opacity': 1,
2708                        'cursor': 'pointer'
2709                    });
2710                }
2711
2712                // Week is not in valid range
2713                if (new_week_number === 0 || new_week_number > max_weeks) { } else {
2714                    setThisWeek(week);
2715                }
2716            });
2717
2718            $('.mec-subscribe-to-calendar-btn').off('click').on('click', function () {
2719                $(this).parent().find('>.mec-subscribe-to-calendar-items').toggle();
2720            });
2721
2722            // Single Event Method
2723            if (settings.sed_method != '0') {
2724                sed();
2725            }
2726        }
2727
2728        function setThisWeek(week, auto_focus) {
2729            if (typeof auto_focus === 'undefined') auto_focus = false;
2730
2731            // Week is not exists
2732            if (!$('#mec_weekly_view_week_' + settings.id + '_' + week).length) {
2733                return setThisWeek((parseInt(week) - 1));
2734            }
2735
2736            // Set week to active in week list
2737            $('#mec_skin_' + settings.id + ' .mec-weekly-view-week').removeClass('mec-weekly-view-week-active');
2738            $('#mec_weekly_view_week_' + settings.id + '_' + week).addClass('mec-weekly-view-week-active');
2739            $('#mec_weekly_view_top_week_' + settings.id + '_' + week).addClass('mec-weekly-view-week-active');
2740
2741            // Show related events
2742            $('#mec_skin_' + settings.id + ' .mec-weekly-view-date-events').addClass('mec-util-hidden');
2743            $('.mec-weekly-view-week-' + settings.id + '-' + week).removeClass('mec-util-hidden');
2744            $('#mec_skin_' + settings.id + ' .mec-calendar-row').addClass('mec-util-hidden');
2745            $('#mec_skin_' + settings.id + ' .mec-calendar-row[data-week=' + week % 10 + ']').removeClass('mec-util-hidden');
2746
2747            active_week = week;
2748            active_week_number = $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active').data('week-number');
2749
2750            $('#mec_skin_' + settings.id + ' .mec-calendar-d-top').find('.mec-current-week').find('span').remove();
2751            $('#mec_skin_' + settings.id + ' .mec-calendar-d-top').find('.mec-current-week').append('<span>' + active_week_number + '</span>');
2752
2753            if (active_week_number === 1) {
2754                // Disable Previous Button
2755                $('#mec_skin_' + settings.id + ' .mec-previous-month.mec-load-week').css({
2756                    'opacity': .6,
2757                    'cursor': 'default'
2758                });
2759                $('#mec_skin_' + settings.id + ' .mec-previous-month.mec-load-week').find('i').css({
2760                    'opacity': .6,
2761                    'cursor': 'default'
2762                });
2763            }
2764
2765            // Go To Event Week
2766            if (auto_focus) mec_focus_week(settings.id);
2767
2768            mecFluentCustomScrollbar();
2769        }
2770
2771        function initMonthNavigator(month_id) {
2772            $('#mec_month_navigator' + settings.id + '_' + month_id + ' .mec-load-month').off('click').on('click', function () {
2773                var year = $(this).data('mec-year');
2774                var month = $(this).data('mec-month');
2775
2776                setMonth(year, month, active_week, true);
2777            });
2778        }
2779
2780        function search(year, month, week, navigation_click) {
2781            var week_number = (String(week).slice(-1));
2782
2783            // Add Loading Class
2784            if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
2785            jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
2786
2787            $.ajax({
2788                url: settings.ajax_url,
2789                data: "action=mec_weekly_view_load_month&mec_year=" + year + "&mec_month=" + month + "&mec_week=" + week_number + "&" + settings.atts + "&apply_sf_date=1",
2790                dataType: "json",
2791                type: "post",
2792                success: function (response) {
2793                    // Remove Loading Class
2794                    $('.mec-modal-result').removeClass("mec-month-navigator-loading");
2795
2796                    // Append Month
2797                    $("#mec_skin_events_" + settings.id).html('<div class="mec-month-container" id="mec_weekly_view_month_' + settings.id + '_' + response.current_month.id + '">' + response.month + '</div>');
2798
2799                    // Append Month Navigator
2800                    $("#mec_skin_" + settings.id + " .mec-skin-weekly-view-month-navigator-container").html('<div class="mec-month-navigator" id="mec_month_navigator' + settings.id + '_' + response.current_month.id + '">' + response.navigator + '</div>');
2801
2802                    // Set Listeners
2803                    setListeners();
2804
2805                    // Toggle Month
2806                    toggleMonth(response.current_month.id);
2807
2808                    // Set active week
2809                    setThisWeek(response.week_id, true);
2810                    mecFluentCustomScrollbar();
2811
2812                    $(document).trigger('mec_search_init', ['weekly_view', settings, response]);
2813                },
2814                error: function () { }
2815            });
2816        }
2817
2818        function setMonth(year, month, week, navigation_click) {
2819            var month_id = '' + year + month;
2820            var week_number = (String(week).slice(-1));
2821
2822            active_month = month;
2823            active_year = year;
2824            navigation_click = navigation_click || false;
2825
2826            // Month exists so we just show it
2827            if ($("#mec_weekly_view_month_" + settings.id + "_" + month_id).length) {
2828                // Set Month Filter values in search widget
2829                $("#mec_sf_month_" + settings.id).val(month);
2830                $("#mec_sf_year_" + settings.id).val(year);
2831
2832                // Toggle Month
2833                toggleMonth(month_id);
2834
2835                // Set active week
2836                setThisWeek('' + month_id + week_number, true);
2837                mecFluentCustomScrollbar();
2838            } else {
2839                // Add Loading Class
2840                if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
2841                jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
2842
2843                $.ajax({
2844                    url: settings.ajax_url,
2845                    data: "action=mec_weekly_view_load_month&mec_year=" + year + "&mec_month=" + month + "&mec_week=" + week_number + "&" + settings.atts + "&apply_sf_date=0" + "&navigator_click=" + navigation_click,
2846                    dataType: "json",
2847                    type: "post",
2848                    success: function (response) {
2849                        // Remove Loading Class
2850                        $('.mec-modal-result').removeClass("mec-month-navigator-loading");
2851
2852                        $('#mec_skin_' + settings.id + ' .mec-calendar-d-top h3').after(response.topWeeks);
2853
2854                        // Append Month
2855                        $("#mec_skin_events_" + settings.id).append('<div class="mec-month-container" id="mec_weekly_view_month_' + settings.id + '_' + response.current_month.id + '">' + response.month + '</div>');
2856
2857                        // Append Month Navigator
2858                        $("#mec_skin_" + settings.id + " .mec-skin-weekly-view-month-navigator-container").append('<div class="mec-month-navigator" id="mec_month_navigator' + settings.id + '_' + response.current_month.id + '">' + response.navigator + '</div>');
2859
2860                        // Set Listeners
2861                        setListeners();
2862
2863                        // Toggle Month
2864                        toggleMonth(response.current_month.id);
2865
2866                        // Set active week
2867                        setThisWeek(response.week_id, true);
2868
2869                        // Set Month Filter values in search widget
2870                        $("#mec_sf_month_" + settings.id).val(month);
2871                        $("#mec_sf_year_" + settings.id).val(year);
2872                        mecFluentCustomScrollbar();
2873                    },
2874                    error: function () { }
2875                });
2876            }
2877        }
2878
2879        function toggleMonth(month_id) {
2880            // Show related events
2881            $('#mec_skin_' + settings.id + ' .mec-month-container').addClass('mec-util-hidden');
2882            $('#mec_weekly_view_month_' + settings.id + '_' + month_id).removeClass('mec-util-hidden');
2883
2884            $('#mec_skin_' + settings.id + ' .mec-month-navigator').addClass('mec-util-hidden');
2885            $('#mec_month_navigator' + settings.id + '_' + month_id).removeClass('mec-util-hidden');
2886
2887            // Initialize Month Navigator
2888            if (settings.month_navigator) initMonthNavigator(month_id);
2889
2890            jQuery(document).trigger('mec_toggle_month', [settings, month_id]);
2891        }
2892
2893        function sed() {
2894            // Single Event Display
2895            $("#mec_skin_" + settings.id + " .mec-event-title a").off('click').on('click', function (e) {
2896                var sed_method = $(this).attr('target');
2897                if ('_blank' === sed_method) {
2898                    return;
2899                }
2900
2901                e.preventDefault();
2902                var href = $(this).attr('href');
2903
2904                var id = $(this).data('event-id');
2905                var occurrence = get_parameter_by_name('occurrence', href);
2906                var time = get_parameter_by_name('time', href);
2907
2908                if ('undefined' == typeof id) {
2909                    return;
2910                }
2911
2912                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
2913            });
2914        }
2915    };
2916
2917}(jQuery));
2918
2919// MEC DAILY VIEW PLUGIN
2920(function ($) {
2921    $.fn.mecDailyView = function (options) {
2922        var active_month;
2923        var active_year;
2924        var active_day;
2925
2926        // Default Options
2927        var settings = $.extend({
2928            // These are the defaults.
2929            today: null,
2930            id: 0,
2931            changeDayElement: '.mec-daily-view-day',
2932            events_label: 'Events',
2933            event_label: 'Event',
2934            month_navigator: 0,
2935            atts: '',
2936            ajax_url: '',
2937            sf: {},
2938        }, options);
2939
2940        active_month = settings.month;
2941        active_year = settings.year;
2942        active_day = settings.day;
2943
2944        mecFluentCustomScrollbar();
2945
2946        // Set Today
2947        setToday(settings.today);
2948
2949        // Set Listeners
2950        setListeners();
2951
2952        // Initialize Month Navigator
2953        if (settings.month_navigator) initMonthNavigator(settings.month_i
2953d);
2954
2955        // Initialize Days Slider
2956        initDaysSlider(settings.month_id);
2957
2958        // Slider first event day focus when page load.
2959        mecFocusDay(settings);
2960
2961        // Search Widget
2962        if (settings.sf.container !== '') {
2963            $(settings.sf.container).mecSearchForm({
2964                id: settings.id,
2965                refine: settings.sf.refine,
2966                ajax_url: settings.ajax_url,
2967                start_date: settings.start_date,
2968                atts: settings.atts,
2969                callback: function (atts) {
2970                    settings.atts = atts;
2971                    search(active_year, active_month, active_day);
2972                }
2973            });
2974
2975            $(settings.sf.container).addClass('mec-skin-search-init');
2976        }
2977
2978        function setListeners() {
2979            $(settings.changeDayElement).on('click', function () {
2980                var today = $(this).data('day-id');
2981                setToday(today);
2982                mecFluentCustomScrollbar();
2983            });
2984
2985            $('.mec-subscribe-to-calendar-btn').off('click').on('click', function () {
2986                $(this).parent().find('>.mec-subscribe-to-calendar-items').toggle();
2987            });
2988
2989            // Single Event Method
2990            if (settings.sed_method != '0') {
2991                sed();
2992            }
2993        }
2994
2995        var current_monthday;
2996
2997        function setToday(today) {
2998            // For caring about 31st, 30th and 29th of some months
2999            if (!$('#mec_daily_view_day' + settings.id + '_' + today).length) {
3000                setToday(parseInt(today) - 1);
3001                return false;
3002            }
3003
3004            // Set day to active in day list
3005            $('.mec-daily-view-day').removeClass('mec-daily-view-day-active mec-color');
3006            $('#mec_daily_view_day' + settings.id + '_' + today).addClass('mec-daily-view-day-active mec-color');
3007
3008            // Show related events
3009            $('.mec-daily-view-date-events').addClass('mec-util-hidden');
3010            $('#mec_daily_view_date_events' + settings.id + '_' + today).removeClass('mec-util-hidden');
3011            $('.mec-daily-view-events').addClass('mec-util-hidden');
3012            $('#mec-daily-view-events' + settings.id + '_' + today).removeClass('mec-util-hidden');
3013
3014            // Set today label
3015            var weekday = $('#mec_daily_view_day' + settings.id + '_' + today).data('day-weekday');
3016            var monthday = $('#mec_daily_view_day' + settings.id + '_' + today).data('day-monthday');
3017            var count = $('#mec_daily_view_day' + settings.id + '_' + today).data('events-count');
3018            var month_id = $('#mec_daily_view_day' + settings.id + '_' + today).data('month-id');
3019
3020            $('#mec_today_container' + settings.id + '_' + month_id).html('<h2>' + monthday + '</h2><h3>' + weekday + '</h3><div class="mec-today-count">' + count + ' ' + (count > 1 ? settings.events_label : settings.event_label) + '</div>');
3021
3022            if (monthday <= 9) current_monthday = '0' + monthday;
3023            else current_monthday = monthday;
3024        }
3025
3026        function initMonthNavigator(month_id) {
3027            $('#mec_month_navigator' + settings.id + '_' + month_id + ' .mec-load-month').off('click');
3028            $('#mec_month_navigator' + settings.id + '_' + month_id + ' .mec-load-month').on('click', function () {
3029                var year = $(this).data('mec-year');
3030                var month = $(this).data('mec-month');
3031
3032                setMonth(year, month, current_monthday, true);
3033            });
3034        }
3035
3036        function initDaysSlider(month_id, day_id) {
3037            // Set Global Month ID
3038            mec_g_month_id = month_id;
3039
3040            // Check RTL website
3041            var owl_rtl = $('body').hasClass('rtl') ? true : false;
3042
3043            // Init Days slider
3044            var owl = $("#mec-owl-calendar-d-table-" + settings.id + "-" + month_id);
3045            if (owl.hasClass('owl-loaded')) {
3046                owl.trigger('destroy.owl.carousel');
3047                owl.removeClass('owl-loaded');
3048                owl.find('.owl-stage-outer').children().unwrap();
3049            }
3050
3051            // Check if carousel is in a narrow container (like sidebar)
3052            var parentWidth = owl.parent().width();
3053            var isNarrowContainer = parentWidth < 500;
3054
3055            var responsiveConfig = {
3056                0: {
3057                    items: owl.closest('.mec-fluent-wrap,.mec-liquid-wrap').length > 0 ? 3 : 2,
3058                },
3059                479: {
3060                    items: isNarrowContainer ? 3 : 4,
3061                },
3062                767: {
3063                    items: isNarrowContainer ? 4 : 7,
3064                },
3065                960: {
3066                    items: isNarrowContainer ? 5 : 14,
3067                },
3068                1000: {
3069                    items: isNarrowContainer ? 6 : 19,
3070                },
3071                1200: {
3072                    items: isNarrowContainer ? 7 : 22,
3073                }
3074            };
3075
3076            owl.owlCarousel({
3077                responsiveClass: true,
3078                responsive: responsiveConfig,
3079                dots: false,
3080                loop: false,
3081                rtl: owl_rtl,
3082                navElement: 'button type="button" role="button"',
3083            });
3084
3085            $(document).trigger('mec_daily_slider_init', [owl, owl_rtl]);
3086
3087            // Custom Navigation Events
3088            $("#mec_daily_view_month_" + settings.id + "_" + month_id + " .mec-table-d-next").click(function (e) {
3089                e.preventDefault();
3090                owl.trigger('next.owl.carousel');
3091            });
3092
3093            $("#mec_daily_view_month_" + settings.id + "_" + month_id + " .mec-table-d-prev").click(function (e) {
3094                e.preventDefault();
3095                owl.trigger('prev.owl.carousel');
3096            });
3097
3098            if (typeof day_id === 'undefined') day_id = $('.mec-daily-view-day-active').data('day-id');
3099
3100            var today_str = day_id.toString().substring(6, 8);
3101            var today_int = parseInt(today_str);
3102
3103            owl.trigger('owl.goTo', [today_int]);
3104
3105            owl.removeClass('owl-hidden');
3106        }
3107
3108        function search(year, month, day) {
3109            // Add Loading Class
3110            if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
3111            jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
3112
3113            $.ajax({
3114                url: settings.ajax_url,
3115                data: "action=mec_daily_view_load_month&mec_year=" + year + "&mec_month=" + month + "&mec_day=" + day + "&" + settings.atts + "&apply_sf_date=1",
3116                dataType: "json",
3117                type: "post",
3118                success: function (response) {
3119                    // Remove Loading Class
3120                    $('.mec-modal-result').removeClass("mec-month-navigator-loading");
3121
3122                    // Append Month
3123                    $("#mec_skin_events_" + settings.id).html('<div class="mec-month-container" id="mec_daily_view_month_' + settings.id + '_' + response.current_month.id + '">' + response.month + '</div>');
3124
3125                    // Append Month Navigator
3126                    $("#mec_skin_" + settings.id + " .mec-calendar-a-month.mec-clear").html('<div class="mec-month-navigator" id="mec_month_navigator' + settings.id + '_' + response.current_month.id + '">' + response.navigator + '</div>');
3127
3128                    // Set Listeners
3129                    setListeners();
3130
3131                    active_year = response.current_month.year;
3132                    active_month = response.current_month.month;
3133
3134                    // Toggle Month
3135                    toggleMonth(response.current_month.id, '' + active_year + active_month + active_day);
3136
3137                    // Set Today
3138                    setToday('' + active_year + active_month + active_day);
3139
3140                    // Focus First Active Day
3141                    mecFocusDay(settings);
3142                    mecFluentCustomScrollbar();
3143
3144                    $(document).trigger('mec_search_init', ['daily_view', settings, response]);
3145                },
3146                error: function () { }
3147            });
3148        }
3149
3150        function setMonth(year, month, day, navigation_click) {
3151            var month_id = '' + year + month;
3152
3153            active_month = month;
3154            active_year = year;
3155            active_day = day;
3156            navigation_click = navigation_click || false;
3157
3158            // Month exists so we just show it
3159            if ($("#mec_daily_view_month_" + settings.id + "_" + month_id).length) {
3160                // Set Month Filter values in search widget
3161                $("#mec_sf_month_" + settings.id).val(month);
3162                $("#mec_sf_year_" + settings.id).val(year);
3163
3164                // Toggle Month
3165                toggleMonth(month_id);
3166
3167                // Set Today
3168                setToday('' + month_id + day);
3169            } else {
3170                // Add Loading Class
3171                if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
3172                jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
3173
3174                $.ajax({
3175                    url: settings.ajax_url,
3176                    data: "action=mec_daily_view_load_month&mec_year=" + year + "&mec_month=" + month + "&mec_day=" + day + "&" + settings.atts + "&apply_sf_date=0" + "&navigator_click=" + navigation_click,
3177                    dataType: "json",
3178                    type: "post",
3179                    success: function (response) {
3180                        // Remove Loading Class
3181                        $('.mec-modal-result').removeClass("mec-month-navigator-loading");
3182
3183                        // Append Month
3184                        $("#mec_skin_events_" + settings.id).append('<div class="mec-month-container" id="mec_daily_view_month_' + settings.id + '_' + response.current_month.id + '">' + response.month + '</div>');
3185
3186                        // Append Month Navigator
3187                        $("#mec_skin_" + settings.id + " .mec-calendar-a-month.mec-clear").append('<div class="mec-month-navigator" id="mec_month_navigator' + settings.id + '_' + response.current_month.id + '">' + response.navigator + '</div>');
3188
3189                        // Set Listeners
3190                        setListeners();
3191
3192                        // Toggle Month
3193                        toggleMonth(response.current_month.id, '' + year + month + '01');
3194
3195                        // Set Today
3196                        setToday('' + year + month + '01');
3197
3198                        // Set Month Filter values in search widget
3199                        $("#mec_sf_month_" + settings.id).val(month);
3200                        $("#mec_sf_year_" + settings.id).val(year);
3201                        mecFluentCustomScrollbar();
3202                    },
3203                    error: function () { }
3204                });
3205            }
3206        }
3207
3208        function toggleMonth(month_id, day_id) {
3209            // Show related events
3210            $('#mec_skin_' + settings.id + ' .mec-month-container').addClass('mec-util-hidden');
3211            $('#mec_daily_view_month_' + settings.id + '_' + month_id).removeClass('mec-util-hidden');
3212
3213            $('#mec_skin_' + settings.id + ' .mec-month-navigator').addClass('mec-util-hidden');
3214            $('#mec_month_navigator' + settings.id + '_' + month_id).removeClass('mec-util-hidden');
3215
3216            // Initialize Month Navigator
3217            if (settings.month_navigator) initMonthNavigator(month_id);
3218
3219            // Initialize Days Slider
3220            initDaysSlider(month_id, day_id);
3221
3222            // Focus First Active Day
3223            mecFocusDay(settings);
3224
3225            jQuery(document).trigger('mec_toggle_month', [settings, month_id]);
3226        }
3227
3228        function sed() {
3229            // Single Event Display
3230            $("#mec_skin_" + settings.id + " .mec-event-title a").off('click').on('click', function (e) {
3231                var sed_method = $(this).attr('target');
3232                if ('_blank' === sed_method) {
3233
3234                    return;
3235                }
3236                e.preventDefault();
3237                var href = $(this).attr('href');
3238
3239                var id = $(this).data('event-id');
3240                var occurrence = get_parameter_by_name('occurrence', href);
3241                var time = get_parameter_by_name('time', href);
3242
3243                if ('undefined' == typeof id) {
3244                    return;
3245                }
3246
3247                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
3248            });
3249        }
3250    };
3251
3252}(jQuery));
3253
3254// MEC TIMETABLE PLUGIN
3255(function ($) {
3256    $.fn.mecTimeTable = function (options) {
3257        var active_year;
3258        var active_month;
3259        var active_week;
3260        var active_week_number;
3261        var active_day;
3262
3263        // Default Options
3264        var settings = $.extend({
3265            // These are the defaults.
3266            today: null,
3267            week: 1,
3268            active_day: 1,
3269            id: 0,
3270            changeWeekElement: '.mec-load-week',
3271            month_navigator: 0,
3272            atts: '',
3273            ajax_url: '',
3274            sf: {}
3275        }, options);
3276
3277        // Search Widget
3278        if (settings.sf.container !== '') {
3279            $(settings.sf.container).mecSearchForm({
3280                id: settings.id,
3281                refine: settings.sf.refine,
3282                ajax_url: settings.ajax_url,
3283                start_date: settings.start_date,
3284                atts: settings.atts,
3285                callback: function (atts) {
3286                    settings.atts = atts;
3287                    search(active_year, active_month, active_week, active_day);
3288                }
3289            });
3290
3291            $(settings.sf.container).addClass('mec-skin-search-init');
3292        }
3293
3294        // Set The Week
3295        setThisWeek(settings.month_id + settings.week, settings.active_day);
3296
3297        // Set Listeners
3298        setListeners();
3299
3300        // Initialize Month Navigator
3301        if (settings.month_navigator) initMonthNavigator(settings.month_id);
3302
3303        function setListeners() {
3304            // Change Week Listener
3305            $(settings.changeWeekElement).off('click').on('click', function () {
3306                var week = $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active').data('week-id');
3307                var max_weeks = $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active').data('max-weeks');
3308                var new_week_number = active_week_number;
3309
3310                if ($(this).hasClass('mec-previous-month')) {
3311                    week = parseInt(week) - 1;
3312                    new_week_number--;
3313                } else {
3314                    week = parseInt(week) + 1;
3315                    new_week_number++;
3316                }
3317
3318                if (new_week_number <= 1 || new_week_number >= max_weeks) {
3319                    // Disable Next/Previous Button
3320                    $(this).css({
3321                        'opacity': .6,
3322                        'cursor': 'default'
3323                    });
3324                    $(this).find('i').css({
3325                        'opacity': .6,
3326                        'cursor': 'default'
3327                    });
3328                } else {
3329                    // Enable Next/Previous Buttons
3330                    $('#mec_skin_' + settings.id + ' .mec-load-week, #mec_skin_' + settings.id + ' .mec-load-week i').css({
3331                        'opacity': 1,
3332                        'cursor': 'pointer'
3333                    });
3334                }
3335
3336                // Week is not in valid range
3337                if (new_week_number === 0 || new_week_number > max_weeks) { } else {
3338                    setThisWeek(week);
3339                }
3340            });
3341
3342            // Change Day Listener
3343            $('#mec_skin_' + settings.id + ' .mec-weekly-view-week dt').not('.mec-timetable-has-no-event').off('click').on('click', function () {
3344                var day = $(this).data('date-id');
3345                setDay(day);
3346            });
3347
3348            // Single Event Method
3349            if (settings.sed_method != '0') {
3350                sed();
3351            }
3352        }
3353
3354        function setThisWeek(week, day) {
3355            // Week is not exists
3356            if (!$('#mec_weekly_view_week_' + settings.id + '_' + week).length) {
3357                return setThisWeek((parseInt(week) - 1), day);
3358            }
3359
3360            // Set week to active in week list
3361            $('#mec_skin_' + settings.id + ' .mec-weekly-view-week').removeClass('mec-weekly-view-week-active');
3362            $('#mec_weekly_view_week_' + settings.id + '_' + week).addClass('mec-weekly-view-week-active');
3363
3364            setDay(day);
3365
3366            active_week = week;
3367            active_week_number = $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active').data('week-number');
3368
3369            $('#mec_skin_' + settings.id + ' .mec-calendar-d-top').find('.mec-current-week').find('span').remove();
3370            $('#mec_skin_' + settings.id + ' .mec-calendar-d-top').find('.mec-current-week').append('<span>' + active_week_number + '</span>');
3371
3372            if (active_week_number === 1) {
3373                // Disable Previous Button
3374                $('#mec_skin_' + settings.id + ' .mec-previous-month.mec-load-week').css({
3375                    'opacity': .6,
3376                    'cursor': 'default'
3377                });
3378                $('#mec_skin_' + settings.id + ' .mec-previous-month.mec-load-week').find('i').css({
3379                    'opacity': .6,
3380                    'cursor': 'default'
3381                });
3382            }
3383        }
3384
3385        function setDay(day) {
3386            // Find the date automatically
3387            if (typeof day === 'undefined') {
3388                day = $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active dt').not('.mec-timetable-has-no-event').first().data('date-id');
3389            }
3390
3391            // Activate the date element
3392            $('#mec_skin_' + settings.id + ' dt').removeClass('mec-timetable-day-active');
3393            $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active dt[data-date-id="' + day + '"]').addClass('mec-timetable-day-active');
3394
3395            // Show related events
3396            $('#mec_skin_' + settings.id + ' .mec-weekly-view-date-events').addClass('mec-util-hidden');
3397            $('.mec_weekly_view_date_events' + settings.id + '_' + day).removeClass('mec-util-hidden').show();
3398        }
3399
3400        function initMonthNavigator(month_id) {
3401            $('#mec_month_navigator' + settings.id + '_' + month_id + ' .mec-load-month').off('click').on('click', function () {
3402                var year = $(this).data('mec-year');
3403                var month = $(this).data('mec-month');
3404
3405                setMonth(year, month, active_week);
3406            });
3407        }
3408
3409        function search(year, month, week) {
3410            var week_number = (String(week).slice(-1));
3411
3412            // Add Loading Class
3413            if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
3414            jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
3415
3416            // Set MEC Year And Month If Undefined
3417            year = typeof year == 'undefined' ? '' : year;
3418            month = typeof month == 'undefined' ? '' : month;
3419
3420            // Append current week to data body for used after filter.
3421            $('body').data('currentweek', $("#mec_skin_events_" + settings.id).find('.mec-current-week > span').html());
3422
3423            $.ajax({
3424                url: settings.ajax_url,
3425                data: "action=mec_timetable_load_month&mec_year=" + year + "&mec_month=" + month + "&mec_week=" + week_number + "&" + settings.atts + "&apply_sf_date=1",
3426                dataType: "json",
3427                type: "post",
3428                success: function (response) {
3429                    // Remove Loading Class
3430                    $('.mec-modal-result').removeClass("mec-month-navigator-loading");
3431
3432                    // Append Month
3433                    $("#mec_skin_events_" + settings.id).html('<div class="mec-month-container" id="mec_timetable_month_' + settings.id + '_' + response.current_month.id + '">' + response.month + '</div>');
3434
3435                    // Append Month Navigator
3436                    $("#mec_skin_" + settings.id + " .mec-skin-weekly-view-month-navigator-container").html('<div class="mec-month-navigator" id="mec_month_navigator' + settings.id + '_' + response.current_month.id + '">' + response.navigator + '</div>');
3437
3438                    // Set Listeners
3439                    setListeners();
3440
3441                    // Toggle Month
3442                    toggleMonth(response.current_month.id);
3443
3444                    // Set active week
3445                    setThisWeek(response.week_id);
3446
3447                    // Focus First Active Week
3448                    mec_focus_week(settings.id, 'timetable');
3449
3450                    mecFluentCustomScrollbar();
3451
3452                    $(document).trigger('mec_search_init', ['timetable', settings, response]);
3453                },
3454                error: function () { }
3455            });
3456        }
3457
3458        function setMonth(year, month, week) {
3459            var month_id = '' + year + month;
3460            var week_number = (String(week).slice(-1));
3461
3462            active_month = month;
3463            active_year = year;
3464
3465            // Month exists so we just show it
3466            if ($("#mec_timetable_month_" + settings.id + "_" + month_id).length) {
3467                // Toggle Month
3468                toggleMonth(month_id);
3469
3470                // Set active week
3471                setThisWeek('' + month_id + week_number);
3472            } else {
3473                // Add Loading Class
3474                if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
3475                jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
3476
3477                $.ajax({
3478                    url: settings.ajax_url,
3479                    data: "action=mec_timetable_load_month&mec_year=" + year + "&mec_month=" + month + "&mec_week=" + week_number + "&" + settings.atts + "&apply_sf_date=0",
3480                    dataType: "json",
3481                    type: "post",
3482                    success: function (response) {
3483                        // Remove Loading Class
3484                        $('.mec-modal-result').removeClass("mec-month-navigator-loading");
3485
3486                        // Append Month
3487                        $("#mec_skin_events_" + settings.id).append('<div class="mec-month-container" id="mec_timetable_month_' + settings.id + '_' + response.current_month.id + '">' + response.month + '</div>');
3488
3489                        // Append Month Navigator
3490                        $("#mec_skin_" + settings.id + " .mec-skin-weekly-view-month-navigator-container").append('<div class="mec-month-navigator" id="mec_month_navigator' + settings.id + '_' + response.current_month.id + '">' + response.navigator + '</div>');
3491
3492                        // Set Listeners
3493                        setListeners();
3494
3495                        // Toggle Month
3496                        toggleMonth(response.current_month.id);
3497
3498                        // Set active week
3499                        setThisWeek(response.week_id);
3500
3501                        // Set Month Filter values in search widget
3502                        $("#mec_sf_month_" + settings.id).val(month);
3503                        $("#mec_sf_year_" + settings.id).val(year);
3504                    },
3505                    error: function () { }
3506                });
3507            }
3508        }
3509
3510        function toggleMonth(month_id) {
3511            // Show related events
3512            $('#mec_skin_' + settings.id + ' .mec-month-container').addClass('mec-util-hidden');
3513            $('#mec_timetable_month_' + settings.id + '_' + month_id).removeClass('mec-util-hidden');
3514
3515            $('#mec_skin_' + settings.id + ' .mec-month-navigator').addClass('mec-util-hidden');
3516            $('#mec_month_navigator' + settings.id + '_' + month_id).removeClass('mec-util-hidden');
3517
3518            // Initialize Month Navigator
3519            if (settings.month_navigator) initMonthNavigator(month_id);
3520
3521            jQuery(document).trigger('mec_toggle_month', [settings, month_id]);
3522        }
3523
3524        function sed() {
3525            // Single Event Display
3526            $("#mec_skin_" + settings.id + " .mec-timetable-event-title a").off('click').on('click', function (e) {
3527                e.preventDefault();
3528                var href = $(this).attr('href');
3529
3530                var id = $(this).data('event-id');
3531                var occurrence = get_parameter_by_name('occurrence', href);
3532                var time = get_parameter_by_name('time', href);
3533
3534                if ('undefined' == typeof id) {
3535                    return;
3536                }
3537
3538                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
3539            });
3540        }
3541    };
3542
3543}(jQuery));
3544
3545// MEC WEEKLY PROGRAM PLUGIN
3546(function ($) {
3547    $.fn.mecWeeklyProgram = function (options) {
3548        // Default Options
3549        var settings = $.extend({
3550            // These are the defaults.
3551            id: 0,
3552            atts: '',
3553            sf: {}
3554        }, options);
3555
3556        // Search Widget
3557        if (settings.sf.container !== '') {
3558            $(settings.sf.container).mecSearchForm({
3559                id: settings.id,
3560                refine: settings.sf.refine,
3561                ajax_url: settings.ajax_url,
3562                start_date: settings.start_date,
3563                atts: settings.atts,
3564                callback: function (atts) {
3565                    settings.atts = atts;
3566                    search();
3567                }
3568            });
3569
3570            $(settings.sf.container).addClass('mec-skin-search-init');
3571        }
3572
3573        // Set Listeners
3574        setListeners();
3575
3576        function setListeners() {
3577            // Single Event Method
3578            if (settings.sed_method != '0') {
3579                sed();
3580            }
3581        }
3582
3583        function search() {
3584            var $modal = $('.mec-modal-result');
3585
3586            // Add Loading Class
3587            if ($modal.length === 0) $('.mec-wrap').append('<div class="mec-modal-result"></div>');
3588            $modal.addClass('mec-month-navigator-loading');
3589
3590            $.ajax({
3591                url: settings.ajax_url,
3592                data: "action=mec_weeklyprogram_load&" + settings.atts + "&apply_sf_date=1",
3593                dataType: "json",
3594                type: "post",
3595                success: function (response) {
3596                    // Remove Loading Class
3597                    $modal.removeClass("mec-month-navigator-loading");
3598
3599                    // Append Month
3600                    $("#mec_skin_events_" + settings.id).html(response.date_events);
3601
3602                    // Set Listeners
3603                    setListeners();
3604
3605                    $(document).trigger('mec_search_init', ['weeklyprogram', settings, response]);
3606                },
3607                error: function () { }
3608            });
3609        }
3610
3611        function sed() {
3612            // Single Event Display
3613            $("#mec_skin_" + settings.id + " .mec-event-title a").off('click').on('click', function (e) {
3614                var sed_method = $(this).attr('target');
3615                if ('_blank' === sed_method) {
3616
3617                    return;
3618                }
3619                e.preventDefault();
3620                var href = $(this).attr('href');
3621
3622                var id = $(this).data('event-id');
3623                var occurrence = get_parameter_by_name('occurrence', href);
3624                var time = get_parameter_by_name('time', href);
3625
3626                if ('undefined' == typeof id) {
3627                    return;
3628                }
3629
3630                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
3631            });
3632        }
3633    };
3634
3635}(jQuery));
3636
3637// MEC MASONRY VIEW PLUGIN
3638(function ($) {
3639    $.fn.mecMasonryView = function (options) {
3640        // Default Options
3641        var settings = $.extend({
3642            // These are the defaults.
3643            id: 0,
3644            atts: '',
3645            ajax_url: '',
3646            sf: {},
3647            end_date: '',
3648            offset: 0,
3649            start_date: '',
3650            pagination: '0',
3651            infinite_locked: false,
3652        }, options);
3653
3654        let history = [];
3655        const $next = $('#mec-nextprev-wrap-' + settings.id + ' .mec-nextprev-next-button');
3656        const $prev = $('#mec-nextprev-wrap-' + settings.id + ' .mec-nextprev-prev-button');
3657
3658        // Set onclick Listeners
3659        setListeners();
3660
3661        // Init Masonry
3662        initMasonry();
3663        if (typeof custom_dev !== undefined) var custom_dev;
3664        if (custom_dev == 'yes') {
3665            $(".mec-wrap").css("height", "1550");
3666            if (Math.max(document.documentElement.clientWidth, window.innerWidth || 0) < 768) {
3667                $(".mec-wrap").css("height", "5500");
3668            }
3669            if (Math.max(document.documentElement.clientWidth, window.innerWidth || 0) < 480) {
3670                $(".mec-wrap").css("height", "5000");
3671            }
3672            $(".mec-event-masonry .mec-masonry-item-wrap:nth-child(n+20)").css("display", "none");
3673            $(".mec-load-more-button").on("click", function () {
3674                $(".mec-event-masonry .mec-masonry-item-wrap:nth-child(n+20)").css("display", "block");
3675                $(".mec-wrap").css("height", "auto");
3676                initMasonry();
3677                $(".mec-load-more-button").hide();
3678            })
3679            $(".mec-events-masonry-cats a:first-child").on("click", function () {
3680                $(".mec-wrap").css("height", "auto");
3681                $(".mec-event-masonry .mec-masonry-item-wrap:nth-child(n+20)").css("display", "block");
3682                $(".mec-load-more-button").hide();
3683                initMasonry();
3684            })
3685            $(".mec-events-masonry-cats a:not(:first-child)").on("click", function () {
3686                $(".mec-load-more-button").hide();
3687                $(".mec-wrap").css("height", "auto");
3688                $(".mec-wrap").css("min-height", "400");
3689                $(".mec-event-masonry .mec-masonry-item-wrap").css("display", "block");
3690                var element = document.querySelector("#mec_skin_" + settings.id + " .mec-event-masonry");
3691                var selector = $(this).attr('data-group');
3692                var CustomShuffle = new Shuffle(element, {
3693                    itemSelector: '.mec-masonry-item-wrap',
3694                });
3695                CustomShuffle.sort({
3696                    by: element.getAttribute('data-created'),
3697                });
3698                CustomShuffle.filter(selector != '*' ? selector : Shuffle.ALL_ITEMS);
3699                $(".mec-event-masonry .mec-masonry-item-wrap").css("visibility", "visible");
3700            })
3701        }
3702
3703        // Fix Elementor Masonry
3704        if (mecdata.elementor_edit_mode != 'no') elementorFrontend.hooks.addAction('frontend/element_ready/global', initMasonry());
3705
3706        function initMasonry() {
3707            var $container = $("#mec_skin_" + settings.id + " .mec-event-masonry");
3708            var data_sortAscending = $("#mec_skin_" + settings.id).data('sortascending');
3709            $container.imagesLoaded(function () {
3710                var $grid = $container.isotope({
3711                    filter: '*',
3712                    itemSelector: '.mec-masonry-item-wrap',
3713                    getSortData: {
3714                        date: '[data-sort-masonry]',
3715                    },
3716                    sortBy: 'date',
3717                    sortAscending: data_sortAscending,
3718                    animationOptions: {
3719                        duration: 750,
3720                        easing: 'linear',
3721                        queue: false
3722                    },
3723                });
3724                if (settings.fit_to_row == 1) $grid.isotope({
3725                    layoutMode: 'fitRows',
3726                    sortAscending: data_sortAscending,
3727                });
3728                // Fix Elementor tab
3729                $('.elementor-tabs').find('.elementor-tab-title').click(function () {
3730                    $grid.isotope({
3731                        sortBy: 'date',
3732                        sortAscending: data_sortAscending,
3733                    });
3734                });
3735            })
3736
3737            $("#mec_skin_" + settings.id + " .mec-events-masonry-cats a").click(function () {
3738                var selector = $(this).attr('data-filter');
3739                var $grid_cat = $container.isotope({
3740                    filter: selector,
3741                    itemSelector: '.mec-masonry-item-wrap',
3742                    getSortData: {
3743                        date: '[data-sort-masonry]',
3744                    },
3745                    sortBy: 'date',
3746                    sortAscending: data_sortAscending,
3747                    animationOptions: {
3748                        duration: 750,
3749                        easing: 'linear',
3750                        queue: false
3751                    },
3752                });
3753                if (settings.masonry_like_grid == 1) $grid_cat.isotope({
3754                    sortBy: 'date',
3755                    sortAscending: data_sortAscending,
3756                });
3757                return false;
3758            });
3759
3760            var $optionSets = $("#mec_skin_" + settings.id + " .mec-events-masonry-cats"),
3761                $optionLinks = $optionSets.find('a');
3762
3763            $optionLinks.click(function () {
3764                var $this = $(this);
3765
3766                // don't proceed if already selected
3767                if ($this.hasClass('selected')) return false;
3768
3769                var $optionSet = $this.parents('.mec-events-masonry-cats');
3770                $optionSet.find('.mec-masonry-cat-selected').removeClass('mec-masonry-cat-selected');
3771                $this.addClass('mec-masonry-cat-selected');
3772            });
3773        }
3774
3775        function setListeners() {
3776            $("#mec_skin_" + settings.id + " .mec-events-masonry-cats > a").click(function () {
3777                var mec_load_more_btn = $("#mec_skin_" + settings.id + " .mec-load-more-button");
3778                var mec_filter_value = $(this).data('filter').replace('.mec-t', '');
3779
3780                if (mec_load_more_btn.hasClass('mec-load-more-loading')) mec_load_more_btn.removeClass('mec-load-more-loading');
3781                if (mec_load_more_btn.hasClass("mec-hidden-" + mec_filter_value)) mec_load_more_btn.addClass("mec-util-hidden");
3782                else mec_load_more_btn.removeClass("mec-util-hidden");
3783            });
3784
3785            // Load More
3786            $("#mec_skin_" + settings.id + " .mec-load-more-button").on("click", function () {
3787                loadMore();
3788            });
3789
3790            // Scroll
3791            if (settings.pagination === 'scroll') {
3792                $(window).on("scroll", function (event) {
3793                    var $target = $("#mec_skin_" + settings.id + " .mec-load-more-wrap");
3794
3795                    var finished = $target.data('page-finished');
3796                    if (finished) return;
3797
3798                    var hT = $target.offset().top,
3799                        hH = $target.outerHeight(),
3800                        wH = $(window).height(),
3801                        wS = $(this).scrollTop();
3802
3803                    if (wS + 100 > hT + hH - wH && !settings.infinite_locked) {
3804                        settings.infinite_locked = true;
3805                        $target.addClass('mec-load-more-scroll-loading');
3806                        loadMore();
3807                    }
3808                });
3809            }
3810
3811            // Next Prev Pagination
3812            if (settings.pagination === 'nextprev') {
3813                // Events Wrapper
3814                const $EW = $("#mec_skin_" + settings.id + " .mec-event-masonry");
3815
3816                let next_disabled = false;
3817
3818                // Previous Button
3819                $prev.on('click', function () {
3820                    if (history.length) {
3821                        let page = history.pop();
3822
3823                        var oldItems = $EW.find('.mec-masonry-item-wrap');
3824                        $EW.isotope('remove', oldItems);
3825
3826                        // Display Events
3827                        var newItems = $('<div>' + page.html + '</div>').find('.mec-masonry-item-wrap');
3828                        newItems.each(function (index) {
3829                            $EW.isotope()
3830                                .append(newItems[index])
3831                                .isotope('appended', newItems[index]);
3832                        });
3833
3834                        // Update the variables
3835                        settings.end_date = page.end_date;
3836                        settings.offset = page.offset;
3837                        settings.current_month_divider = page.current_month_divider;
3838
3839                        // Display Next Button
3840                        $next.removeClass('mec-util-hidden');
3841                    }
3842
3843                    // Hide Previous Button
3844                    if (!history.length) $prev.addClass('mec-util-hidden');
3845                });
3846
3847                // Next Button
3848                $next.on('click', function (e) {
3849                    // Prevent Redirect
3850                    e.preventDefault();
3851
3852                    // Currently Disabled
3853                    if (next_disabled) return;
3854
3855                    // Disable Button
3856                    next_disabled = true;
3857
3858                    // Add Loading Style
3859                    $EW.addClass('mec-loading-events');
3860
3861                    // Push to History
3862                    history.push({
3863                        end_date: settings.end_date,
3864                        offset: settings.offset,
3865                        current_month_divider: settings.current_month_divider,
3866                        html: $EW.html()
3867                    });
3868
3869                    loadMore(function (response) {
3870                        // Display New Events
3871                        if (response.count) {
3872                            var oldItems = $EW.find('.mec-masonry-item-wrap');
3873                            $EW.isotope('remove', oldItems);
3874
3875                            var newItems = $(response.html).find('.mec-masonry-item-wrap');
3876                            newItems.each(function (index) {
3877                                $EW.isotope()
3878                                    .append(newItems[index])
3879                                    .isotope('appended', newItems[index]);
3880                            });
3881                        }
3882                        // Remove Last Page
3883                        else history.pop();
3884
3885                        // Enable Button
3886                        next_disabled = false;
3887
3888                        // Remove Loading Style
3889                        $EW.removeClass('mec-loading-events');
3890
3891                        // Display Previous Button
3892                        if (history.length) $prev.removeClass('mec-util-hidden');
3893                        // Hide Next Button
3894                        if (response.count === 0 || (typeof response.has_more_event !== 'undefined' && !response.has_more_event)) $next.addClass('mec-util-hidden');
3895                    });
3896                });
3897            }
3898
3899            if (settings.sed_method != '0') {
3900                sed();
3901            }
3902        }
3903
3904        function sed() {
3905            // Single Event Display
3906            $("#mec_skin_" + settings.id + " .mec-masonry-img a, #mec_skin_" + settings.id + " .mec-event-title a, #mec_skin_" + settings.id + " .mec-booking-button").off('click').on('click', function (e) {
3907                var sed_method = $(this).attr('target');
3908                if ('_blank' === sed_method) {
3909
3910                    return;
3911                }
3912                e.preventDefault();
3913                var href = $(this).attr('href');
3914
3915                var id = $(this).data('event-id');
3916                var occurrence = get_parameter_by_name('occurrence', href);
3917                var time = get_parameter_by_name('time', href);
3918
3919                if ('undefined' == typeof id) {
3920                    return;
3921                }
3922
3923                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
3924            });
3925        }
3926
3927        function loadMore(callback) {
3928            // Add loading Class
3929            $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-load-more-loading");
3930            var mec_cat_elem = $('#mec_skin_' + settings.id).find('.mec-masonry-cat-selected');
3931            var mec_filter_value = (mec_cat_elem && mec_cat_elem.data('filter') != undefined) ? mec_cat_elem.data('filter').replace('.mec-t', '') : '';
3932            var mec_filter_by = $('#mec_skin_' + settings.id).data('filterby');
3933
3934            $.ajax({
3935                url: settings.ajax_url,
3936                data: "action=mec_masonry_load_more&mec_filter_by=" + mec_filter_by + "&mec_filter_value=" + mec_filter_value + "&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "&apply_sf_date=0",
3937                dataType: "json",
3938                type: "post",
3939                success: function (response) {
3940                    if (response.count === 0) {
3941                        // Remove loading Class
3942                        $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading").addClass("mec-util-hidden mec-hidden-" + mec_filter_value);
3943
3944                        // Release Lock of Infinite Scroll
3945                        settings.infinite_locked = false;
3946                        $("#mec_skin_" + settings.id + " .mec-load-more-wrap").data('page-finished', true).removeClass('mec-load-more-scroll-loading');
3947
3948                        // Run Callback
3949                        if (typeof callback === 'function') callback(response);
3950                    } else {
3951                        // Show load more button
3952                        if (typeof response.has_more_event === 'undefined' || (typeof response.has_more_event !== 'undefined' && response.has_more_event)) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden");
3953                        else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden");
3954
3955                        // Run Callback
3956                        if (typeof callback === 'function') callback(response);
3957                        // Append Items
3958                        else {
3959                            var node = $("#mec_skin_" + settings.id + " .mec-event-masonry");
3960                            var newItems = $(response.html).find('.mec-masonry-item-wrap');
3961
3962                            newItems.each(function (index) {
3963                                node.isotope()
3964                                    .append(newItems[index])
3965                                    .isotope('appended', newItems[index]);
3966                            });
3967                        }
3968
3969                        // Remove loading Class
3970                        $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading");
3971
3972                        // Update the variables
3973                        settings.end_date = response.end_date;
3974                        settings.offset = response.offset;
3975
3976                        // Single Event Method
3977                        if (settings.sed_method != '0') {
3978                            sed();
3979                        }
3980
3981                        // Release Lock of Infinite Scroll
3982                        settings.infinite_locked = false;
3983                        $("#mec_skin_" + settings.id + " .mec-load-more-wrap").removeClass('mec-load-more-scroll-loading');
3984
3985                        $(document).trigger('mec_load_more_init', ['masonry', settings]);
3986                    }
3987                },
3988                error: function () { }
3989            });
3990        }
3991    };
3992}(jQuery));
3993
3994// MEC LIST VIEW PLUGIN
3995(function ($) {
3996    $.fn.mecListView = function (options) {
3997        // Default Options
3998        var settings = $.extend({
3999            // These are the defaults.
4000            id: 0,
4001            atts: '',
4002            ajax_url: '',
4003            sf: {},
4004            current_month_divider: '',
4005            end_date: '',
4006            offset: 0,
4007            limit: 0,
4008            pagination: '0',
4009            infinite_locked: false,
4010        }, options);
4011
4012        var sf;
4013
4014        let history = [];
4015        const $next = $('#mec-nextprev-wrap-' + settings.id + ' .mec-nextprev-next-button');
4016        const $prev = $('#mec-nextprev-wrap-' + settings.id + ' .mec-nextprev-prev-button');
4017
4018        // Set onclick Listeners
4019        setListeners();
4020
4021        function setListeners() {
4022            // Search Widget
4023            if (settings.sf.container !== '') {
4024                sf = $(settings.sf.container).mecSearchForm({
4025                    id: settings.id,
4026                    refine: settings.sf.refine,
4027                    ajax_url: settings.ajax_url,
4028                    start_date: settings.start_date,
4029                    atts: settings.atts,
4030                    callback: function (atts) {
4031                        settings.atts = atts;
4032                        search();
4033                    }
4034                });
4035
4036                $(settings.sf.container).addClass('mec-skin-search-init');
4037            }
4038
4039            // Load More
4040            $("#mec_skin_" + settings.id + " .mec-load-more-button").on("click", function () {
4041                loadMore();
4042            });
4043
4044            // Scroll
4045            if (settings.pagination === 'scroll') {
4046                $(window).on("scroll", function (event) {
4047                    var $target = $("#mec_skin_" + settings.id + " .mec-load-more-wrap");
4048
4049                    // Check if target element exists
4050                    if ($target.length === 0) return;
4051
4052                    var finished = $target.data('page-finished');
4053                    if (finished) return;
4054
4055                    var hT = $target.offset().top,
4056                        hH = $target.outerHeight(),
4057                        wH = $(window).height(),
4058                        wS = $(this).scrollTop();
4059
4060                    if (wS + 100 > hT + hH - wH && !settings.infinite_locked) {
4061                        settings.infinite_locked = true;
4062                        $target.addClass('mec-load-more-scroll-loading');
4063                        loadMore();
4064                    }
4065                });
4066            }
4067
4068            // Next Prev Pagination
4069            if (settings.pagination === 'nextprev') {
4070                // Events Wrapper
4071                const $EW = $("#mec_skin_events_" + settings.id);
4072
4073                let next_disabled = false;
4074
4075                // Previous Button
4076                $prev.on('click', function () {
4077                    if (history.length) {
4078                        let page = history.pop();
4079
4080                        // Display Events
4081                        $EW.html(page.html);
4082
4083                        // Update the variables
4084                        settings.end_date = page.end_date;
4085                        settings.offset = page.offset;
4086                        settings.current_month_divider = page.current_month_divider;
4087
4088                        // Display Next Button
4089                        $next.removeClass('mec-util-hidden');
4090                    }
4091
4092                    // Hide Previous Button
4093                    if (!history.length) $prev.addClass('mec-util-hidden');
4094                });
4095
4096                // Next Button
4097                $next.on('click', function (e) {
4098                    // Prevent Redirect
4099                    e.preventDefault();
4100
4101                    // Currently Disabled
4102                    if (next_disabled) return;
4103
4104                    // Disable Button
4105                    next_disabled = true;
4106
4107                    // Add Loading Style
4108                    $EW.addClass('mec-loading-events');
4109
4110                    // Push to History
4111                    history.push({
4112                        end_date: settings.end_date,
4113                        offset: settings.offset,
4114                        current_month_divider: settings.current_month_divider,
4115                        html: $EW.html()
4116                    });
4117
4118                    loadMore(function (response) {
4119                        // Display New Events
4120                        if (response.count) $EW.html(response.html);
4121                        // Remove Last Page
4122                        else history.pop();
4123
4124                        // Enable Button
4125                        next_disabled = false;
4126
4127                        // Remove Loading Style
4128                        $EW.removeClass('mec-loading-events');
4129
4130                        // Display Previous Button
4131                        if (history.length) $prev.removeClass('mec-util-hidden');
4132
4133                        // Hide Next Button
4134                        if (response.count === 0 || (typeof response.has_more_event !== 'undefined' && !response.has_more_event)) $next.addClass('mec-util-hidden');
4135                    });
4136                });
4137            }
4138
4139            // Accordion Toggle
4140            if (settings.style === 'accordion') {
4141                if (settings.toggle_month_divider) {
4142                    $('#mec_skin_' + settings.id + ' .mec-month-divider:first-of-type').addClass('active');
4143                    $('#mec_skin_' + settings.id + ' .mec-month-divider:first-of-type').find('i').removeClass('mec-sl-arrow-down').addClass('mec-sl-arrow-up');
4144
4145                    toggle();
4146                }
4147
4148                accordion();
4149            }
4150
4151            // Single Event Method
4152            if (settings.sed_method != '0') {
4153                sed();
4154            }
4155        }
4156
4157        function toggle() {
4158            $('#mec_skin_' + settings.id + ' .mec-month-divider').off("click").on("click", function (event) {
4159                event.preventDefault();
4160
4161                var status = $(this).hasClass('active');
4162
4163                // Remove Active Style of Month Divider
4164                $('#mec_skin_' + settings.id + ' .mec-month-divider').removeClass('active');
4165
4166                // Hide All Events
4167                $('#mec_skin_' + settings.id + ' .mec-divider-toggle').slideUp('fast');
4168
4169                if (status) {
4170                    $(this).removeClass('active');
4171                    $('.mec-month-divider').find('i').removeClass('mec-sl-arrow-up').addClass('mec-sl-arrow-down');
4172                } else {
4173                    $(this).addClass('active');
4174                    $('.mec-month-divider').find('i').removeClass('mec-sl-arrow-up').addClass('mec-sl-arrow-down')
4175                    $(this).find('i').removeClass('mec-sl-arrow-down').addClass('mec-sl-arrow-up');
4176
4177                    var month = $(this).data('toggle-divider');
4178                    $('#mec_skin_' + settings.id + ' .' + month).slideDown('fast');
4179                }
4180            });
4181        }
4182
4183        function toggleLoadmore() {
4184            $('#mec_skin_' + settings.id + ' .mec-month-divider:not(:last)').each(function () {
4185                if ($(this).hasClass('active')) $(this).removeClass('active');
4186                var month = $(this).data('toggle-divider');
4187                $('#mec_skin_' + settings.id + ' .' + month).slideUp('fast');
4188            });
4189
4190            // Set Active Class For Last Article
4191            $('#mec_skin_' + settings.id + ' .mec-month-divider:last').addClass('active');
4192
4193            // Register Listeners
4194            toggle();
4195        }
4196
4197        function accordion() {
4198            // Accordion Toggle
4199            $("#mec_skin_" + settings.id + " .mec-toggle-item-inner").off("click").on("click", function (event) {
4200                event.preventDefault();
4201
4202                var $this = $(this);
4203                $(this).parent().find(".mec-content-toggle").slideToggle("fast", function () {
4204                    $this.children("i").toggleClass("mec-sl-arrow-down mec-sl-arrow-up");
4205                });
4206
4207                // Trigger Google Map
4208                var unique_id = $(this).parent().find(".mec-modal-wrap").data('unique-id');
4209
4210                if (typeof window['mec_init_gmap' + unique_id] === 'function') window['mec_init_gmap' + unique_id]();
4211            });
4212
4213            $(document).trigger('mec_skin_accordion_init', settings);
4214        }
4215
4216        function sed() {
4217            // Single Event Display
4218            $("#mec_skin_" + settings.id + " .mec-event-title > a, #mec_skin_" + settings.id + " .mec-booking-button, #mec_skin_" + settings.id + " .mec-detail-button").off('click').on('click', function (e) {
4219                e.preventDefault();
4220                var href = $(this).attr('href');
4221
4222                var id = $(this).data('event-id');
4223                var occurrence = get_parameter_by_name('occurrence', href);
4224                var time = get_parameter_by_name('time', href);
4225
4226                if ('undefined' == typeof id) {
4227                    return;
4228                }
4229
4230                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
4231            });
4232
4233            $("#mec_skin_" + settings.id + " .mec-event-image a img").off('click').on('click', function (e) {
4234                e.preventDefault();
4235                var href = $(this).parent().attr('href');
4236
4237                var id = $(this).parent().data('event-id');
4238                var occurrence = get_parameter_by_name('occurrence', href);
4239                var time = get_parameter_by_name('time', href);
4240
4241                if ('undefined' == typeof id) {
4242                    return;
4243                }
4244
4245                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
4246            });
4247        }
4248
4249        function loadMore(callback) {
4250            // Add loading Class
4251            $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-load-more-loading");
4252
4253            $.ajax({
4254                url: settings.ajax_url,
4255                data: "action=mec_list_load_more&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "&current_month_divider=" + settings.current_month_divider + "&apply_sf_date=0",
4256                dataType: "json",
4257                type: "post",
4258                success: function (response) {
4259                    if (response.count === 0) {
4260                        // Remove loading Class
4261                        $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading");
4262
4263                        // Release Lock of Infinite Scroll
4264                        settings.infinite_locked = false;
4265                        $("#mec_skin_" + settings.id + " .mec-load-more-wrap").removeClass('mec-load-more-scroll-loading');
4266
4267                        // Hide Pagination
4268                        mec_toggle_shortcode_pagination(settings.id, 'hide');
4269
4270                        // Run Callback
4271                        if (typeof callback === 'function') callback(response);
4272                    } else {
4273                        // Show load more button
4274                        if (typeof response.has_more_event === 'undefined' || (typeof response.has_more_event !== 'undefined' && response.has_more_event)) mec_toggle_shortcode_pagination(settings.id, 'show');
4275                        else mec_toggle_shortcode_pagination(settings.id, 'hide');
4276
4277                        // Run Callback
4278                        if (typeof callback === 'function') callback(response);
4279                        // Append Items
4280                        else $("#mec_skin_events_" + settings.id).append(response.html);
4281
4282                        // Remove loading Class
4283                        $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading");
4284
4285                        // Update the variables
4286                        settings.end_date = response.end_date;
4287                        settings.offset = response.offset;
4288                        settings.current_month_divider = response.current_month_divider;
4289
4290                        // Single Event Method
4291                        if (settings.sed_method != '0') {
4292                            sed();
4293                        }
4294
4295                        // Accordion Toggle
4296                        if (settings.style === 'accordion') {
4297                            if (settings.toggle_month_divider) toggleLoadmore();
4298
4299                            accordion();
4300                        }
4301
4302                        // Release Lock of Infinite Scroll
4303                        settings.infinite_locked = false;
4304                        $("#mec_skin_" + settings.id + " .mec-load-more-wrap").removeClass('mec-load-more-scroll-loading');
4305                    }
4306
4307                    $(document).trigger('mec_load_more_init', ['list', settings]);
4308                },
4309                error: function () { }
4310            });
4311        }
4312
4313        function search() {
4314            // Hide no event message
4315            $("#mec_skin_no_events_" + settings.id).addClass("mec-util-hidden");
4316
4317            var $skinRoot = jQuery("#mec_skin_" + settings.id);
4318            var $loading_element = $skinRoot.find('.mec-modal-result');
4319
4320            // Add loading Class
4321            if ($loading_element.length === 0) {
4322                $skinRoot.append('<div class="mec-modal-result"></div>');
4323                $loading_element = $skinRoot.find('.mec-modal-result');
4324            }
4325
4326            $loading_element.addClass('mec-month-navigator-loading');
4327
4328            jQuery("#gmap-data-" + settings.id).val("");
4329            history = [];
4330            $prev.addClass('mec-util-hidden');
4331
4332            $.ajax({
4333                url: settings.ajax_url,
4334                data: "action=mec_list_load_more&mec_start_date=" + settings.start_date + "&" + settings.atts + "&current_month_divider=0&apply_sf_date=1",
4335                dataType: "json",
4336                type: "post",
4337                success: function (response) {
4338                    if (response.count === 0) {
4339                        // Append Items
4340                        $("#mec_skin_events_" + settings.id).html('');
4341
4342                        // Remove loading Class
4343                        $loading_element.removeClass("mec-month-navigator-loading");
4344
4345                        // Hide Map
4346                        $skinRoot.find('.mec-skin-map-container').addClass("mec-util-hidden");
4347
4348                        // Hide pagination
4349                        mec_toggle_shortcode_pagination(settings.id, 'hide');
4350
4351                        // Show no event message
4352                        $("#mec_skin_no_events_" + settings.id).removeClass("mec-util-hidden");
4353                    } else {
4354                        // Append Items
4355                        $("#mec_skin_events_" + settings.id).html(response.html);
4356
4357                        // Remove loading Class
4358                        $loading_element.removeClass("mec-month-navigator-loading");
4359
4360                        // Show Map
4361                        $skinRoot.find('.mec-skin-map-container').removeClass("mec-util-hidden");
4362
4363                        // Show load more button
4364                        if (response.count >= settings.limit) mec_toggle_shortcode_pagination(settings.id, 'show');
4365                        // Hide load more button
4366                        else mec_toggle_shortcode_pagination(settings.id, 'hide');
4367
4368                        // Update the variables
4369                        settings.end_date = response.end_date;
4370                        settings.offset = response.offset;
4371                        settings.current_month_divider = response.current_month_divider;
4372
4373                        // Single Event Method
4374                        if (settings.sed_method != '0') {
4375                            sed();
4376                        }
4377
4378                        // Accordion Toggle
4379                        if (settings.style === 'accordion') {
4380                            if (settings.toggle_month_divider) toggle();
4381
4382                            accordion();
4383                        }
4384                    }
4385
4386                    $(document).trigger('mec_search_init', ['list', settings, response]);
4387                },
4388                error: function () { }
4389            });
4390        }
4391    };
4392
4393}(jQuery));
4394
4395// MEC GRID VIEW PLUGIN
4396(function ($) {
4397    $.fn.mecGridView = function (options) {
4398        // Default Options
4399        var settings = $.extend({
4400            // These are the defaults.
4401            id: 0,
4402            atts: '',
4403            ajax_url: '',
4404            sf: {},
4405            end_date: '',
4406            offset: 0,
4407            start_date: '',
4408            pagination: '0',
4409            infinite_locked: false,
4410        }, options);
4411
4412        var sf;
4413
4414        let history = [];
4415        const $next = $('#mec-nextprev-wrap-' + settings.id + ' .mec-nextprev-next-button');
4416        const $prev = $('#mec-nextprev-wrap-' + settings.id + ' .mec-nextprev-prev-button');
4417
4418        // Set onclick Listeners
4419        setListeners();
4420
4421        function setListeners() {
4422            // Search Widget
4423            if (settings.sf.container !== '') {
4424                sf = $(settings.sf.container).mecSearchForm({
4425                    id: settings.id,
4426                    refine: settings.sf.refine,
4427                    ajax_url: settings.ajax_url,
4428                    start_date: settings.start_date,
4429                    atts: settings.atts,
4430                    callback: function (atts) {
4431                        settings.atts = atts;
4432                        search();
4433                    }
4434                });
4435
4436                $(settings.sf.container).addClass('mec-skin-search-init');
4437            }
4438
4439            // Load More
4440            $("#mec_skin_" + settings.id + " .mec-load-more-button").on("click", function () {
4441                loadMore();
4442            });
4443
4444            // Scroll
4445            if (settings.pagination === 'scroll') {
4446                $(window).on("scroll", function (event) {
4447                    var $target = $("#mec_skin_" + settings.id + " .mec-load-more-wrap");
4448
4449                    var finished = $target.data('page-finished');
4450                    if (finished) return;
4451
4452                    var hT = $target.offset().top,
4453                        hH = $target.outerHeight(),
4454                        wH = $(window).height(),
4455                        wS = $(this).scrollTop();
4456
4457                    if (wS + 100 > hT + hH - wH && !settings.infinite_locked) {
4458                        settings.infinite_locked = true;
4459                        $target.addClass('mec-load-more-scroll-loading');
4460                        loadMore();
4461                    }
4462                });
4463            }
4464
4465            // Next Prev Pagination
4466            if (settings.pagination === 'nextprev') {
4467                // Events Wrapper
4468                const $EW = $("#mec_skin_events_" + settings.id);
4469
4470                let next_disabled = false;
4471
4472                // Previous Button
4473                $prev.on('click', function () {
4474                    if (history.length) {
4475                        let page = history.pop();
4476
4477                        // Display Events
4478                        $EW.html(page.html);
4479
4480                        // Update the variables
4481                        settings.end_date = page.end_date;
4482                        settings.offset = page.offset;
4483                        settings.current_month_divider = page.current_month_divider;
4484
4485                        // Display Next Button
4486                        $next.removeClass('mec-util-hidden');
4487                    }
4488
4489                    // Hide Previous Button
4490                    if (!history.length) $prev.addClass('mec-util-hidden');
4491                });
4492
4493                // Next Button
4494                $next.on('click', function (e) {
4495                    // Prevent Redirect
4496                    e.preventDefault();
4497
4498                    // Currently Disabled
4499                    if (next_disabled) return;
4500
4501                    // Disable Button
4502                    next_disabled = true;
4503
4504                    // Add Loading Style
4505                    $EW.addClass('mec-loading-events');
4506
4507                    // Push to History
4508                    history.push({
4509                        end_date: settings.end_date,
4510                        offset: settings.offset,
4511                        current_month_divider: settings.current_month_divider,
4512                        html: $EW.html()
4513                    });
4514
4515                    loadMore(function (response) {
4516                        // Display New Events
4517                        if (response.count) $EW.html(response.html);
4518                        // Remove Last Page
4519                        else history.pop();
4520
4521                        // Enable Button
4522                        next_disabled = false;
4523
4524                        // Remove Loading Style
4525                        $EW.removeClass('mec-loading-events');
4526
4527                        // Display Previous Button
4528                        if (history.length) $prev.removeClass('mec-util-hidden');
4529                        // Hide Next Button
4530                        if (response.count === 0 || (typeof response.has_more_event !== 'undefined' && !response.has_more_event)) $next.addClass('mec-util-hidden');
4531                    });
4532                });
4533            }
4534
4535            // Single Event Method
4536            if (settings.sed_method != '0') {
4537                sed();
4538            }
4539        }
4540
4541        function sed() {
4542            // Single Event Display
4543            $("#mec_skin_" + settings.id + " .mec-event-title a, #mec_skin_" + settings.id + " .mec-booking-button").off('click').on('click', function (e) {
4544                e.preventDefault();
4545                var href = $(this).attr('href');
4546
4547                var id = $(this).data('event-id');
4548                var occurrence = get_parameter_by_name('occurrence', href);
4549                var time = get_parameter_by_name('time', href);
4550
4551                if ('undefined' == typeof id) {
4552                    return;
4553                }
4554
4555                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
4556            });
4557            $("#mec_skin_" + settings.id + " .mec-event-image a img").off('click').on('click', function (e) {
4558                e.preventDefault();
4559                var href = $(this).parent().attr('href');
4560
4561                var id = $(this).parent().data('event-id');
4562                var occurrence = get_parameter_by_name('occurrence', href);
4563                var time = get_parameter_by_name('time', href);
4564
4565                if ('undefined' == typeof id) {
4566                    return;
4567                }
4568
4569                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
4570            });
4571        }
4572
4573        function loadMore(callback) {
4574            // Add loading Class
4575            $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-load-more-loading");
4576
4577            $.ajax({
4578                url: settings.ajax_url,
4579                data: "action=mec_grid_load_more&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "&apply_sf_date=0",
4580                dataType: "json",
4581                type: "post",
4582                success: function (response) {
4583                    if (response.count === 0) {
4584                        // Remove loading Class
4585                        $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading").addClass("mec-util-hidden");
4586
4587                        // Release Lock of Infinite Scroll
4588                        settings.infinite_locked = false;
4589                        $("#mec_skin_" + settings.id + " .mec-load-more-wrap").data('page-finished', true).removeClass('mec-load-more-scroll-loading');
4590
4591                        // Run Callback
4592                        if (typeof callback === 'function') callback(response);
4593                    } else {
4594                        // Show load more button
4595                        if (typeof response.has_more_event === 'undefined' || (typeof response.has_more_event !== 'undefined' && response.has_more_event)) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden");
4596                        else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden");
4597
4598                        // Run Callback
4599                        if (typeof callback === 'function') callback(response);
4600                        // Append Items
4601                        else $("#mec_skin_events_" + settings.id).append(response.html);
4602
4603                        // Remove loading Class
4604                        $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading");
4605
4606                        // Update the variables
4607                        settings.end_date = response.end_date;
4608                        settings.offset = response.offset;
4609
4610                        // Single Event Method
4611                        if (settings.sed_method != '0') {
4612                            sed();
4613                        }
4614
4615                        // Release Lock of Infinite Scroll
4616                        settings.infinite_locked = false;
4617                        $("#mec_skin_" + settings.id + " .mec-load-more-wrap").removeClass('mec-load-more-scroll-loading');
4618                    }
4619
4620                    $(document).trigger('mec_load_more_init', ['grid', settings]);
4621                },
4622                error: function () { }
4623            });
4624        }
4625
4626        function search() {
4627            // Hide no event message
4628            $("#mec_skin_no_events_" + settings.id).addClass("mec-util-hidden");
4629
4630            var $skinRoot = jQuery("#mec_skin_" + settings.id);
4631            var $loading_element = $skinRoot.find('.mec-modal-result');
4632            if ($loading_element.length === 0) {
4633                $skinRoot.append('<div class="mec-modal-result"></div>');
4634                $loading_element = $skinRoot.find('.mec-modal-result');
4635            }
4636            $loading_element.addClass('mec-month-navigator-loading');
4637            jQuery("#gmap-data-" + settings.id).val("");
4638
4639            $.ajax({
4640                url: settings.ajax_url,
4641                data: "action=mec_grid_load_more&mec_start_date=" + settings.start_date + "&" + settings.atts + "&apply_sf_date=1",
4642                dataType: "json",
4643                type: "post",
4644                success: function (response) {
4645                    if (response.count === 0) {
4646                        // Append Items
4647                        $("#mec_skin_events_" + settings.id).html('');
4648
4649                        // Remove loading Class
4650                        $loading_element.removeClass("mec-month-navigator-loading");
4651
4652                        // Hide Map
4653                        $skinRoot.find('.mec-skin-map-container').addClass("mec-util-hidden");
4654
4655                        // Hide it
4656                        $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden");
4657
4658                        // Show no event message
4659                        $("#mec_skin_no_events_" + settings.id).removeClass("mec-util-hidden");
4660                    } else {
4661                        // Append Items
4662                        $("#mec_skin_events_" + settings.id).html(response.html);
4663
4664                        // Remove loading Class
4665                        $loading_element.removeClass("mec-month-navigator-loading");
4666
4667                        // Show Map
4668                        $skinRoot.find('.mec-skin-map-container').removeClass("mec-util-hidden");
4669
4670                        // Show load more button
4671                        if (response.count >= settings.limit) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden");
4672                        // Hide load more button
4673                        else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden");
4674
4675                        // Update the variables
4676                        settings.end_date = response.end_date;
4677                        settings.offset = response.offset;
4678
4679                        // Single Event Method
4680                        if (settings.sed_method != '0') {
4681                            sed();
4682                        }
4683                    }
4684
4685                    $(document).trigger('mec_search_init', ['grid', settings, response]);
4686                },
4687                error: function () { }
4688            });
4689        }
4690    };
4691
4692}(jQuery));
4693
4694// MEC CUSTOM VIEW PLUGIN
4695(function ($) {
4696    $.fn.mecCustomView = function (options) {
4697        // Default Options
4698        var settings = $.extend({
4699            // These are the defaults.
4700            id: 0,
4701            atts: '',
4702            ajax_url: '',
4703            sf: {},
4704            end_date: '',
4705            offset: 0,
4706            start_date: '',
4707            pagination: '0',
4708            infinite_locked: false,
4709        }, options);
4710
4711        // Set onclick Listeners
4712        setListeners();
4713
4714        var sf;
4715
4716        function setListeners() {
4717            // Search Widget
4718            if (settings.sf.container !== '') {
4719                sf = $(settings.sf.container).mecSearchForm({
4720                    id: settings.id,
4721                    refine: settings.sf.refine,
4722                    ajax_url: settings.ajax_url,
4723                    start_date: settings.start_date,
4724                    atts: settings.atts,
4725                    callback: function (atts) {
4726                        settings.atts = atts;
4727                        search();
4728                    }
4729                });
4730
4731                $(settings.sf.container).addClass('mec-skin-search-init');
4732            }
4733
4734            // Load More
4735            $("#mec_skin_" + settings.id + " .mec-load-more-button").on("click", function () {
4736                loadMore();
4737            });
4738
4739            // Scroll
4740            if (settings.pagination === 'scroll') {
4741                $(window).on("scroll", function (event) {
4742                    var $target = $("#mec_skin_" + settings.id + " .mec-load-more-wrap");
4743
4744                    var finished = $target.data('page-finished');
4745                    if (finished) return;
4746
4747                    var hT = $target.offset().top,
4748                        hH = $target.outerHeight(),
4749                        wH = $(window).height(),
4750                        wS = $(this).scrollTop();
4751
4752                    if (wS + 100 >
4752 hT + hH - wH && !settings.infinite_locked) {
4753                        settings.infinite_locked = true;
4754                        $target.addClass('mec-load-more-scroll-loading');
4755                        loadMore();
4756                    }
4757                });
4758            }
4759
4760            // Single Event Method
4761            if (settings.sed_method != '0') {
4762                sed();
4763            }
4764        }
4765
4766        function sed() {
4767            // Single Event Display
4768            $("#mec_skin_" + settings.id + " .mec-event-title a, #mec_skin_" + settings.id + " .mec-booking-button").off('click').on('click', function (e) {
4769                e.preventDefault();
4770                var href = $(this).attr('href');
4771
4772                var id = $(this).data('event-id');
4773                var occurrence = get_parameter_by_name('occurrence', href);
4774                var time = get_parameter_by_name('time', href);
4775
4776                if ('undefined' == typeof id) {
4777                    return;
4778                }
4779
4780                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
4781            });
4782            $("#mec_skin_" + settings.id + " .mec-event-image a img").off('click').on('click', function (e) {
4783                e.preventDefault();
4784                var href = $(this).parent().attr('href');
4785
4786                var id = $(this).parent().data('event-id');
4787                var occurrence = get_parameter_by_name('occurrence', href);
4788                var time = get_parameter_by_name('time', href);
4789
4790                if ('undefined' == typeof id) {
4791                    return;
4792                }
4793
4794                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
4795            });
4796        }
4797
4798        function loadMore() {
4799            // Add loading Class
4800            $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-load-more-loading");
4801
4802            $.ajax({
4803                url: settings.ajax_url,
4804                data: "action=mec_custom_load_more&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "&apply_sf_date=0",
4805                dataType: "json",
4806                type: "post",
4807                success: function (response) {
4808                    if (response.count === 0) {
4809                        // Remove loading Class
4810                        $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading").addClass("mec-util-hidden");
4811
4812                        // Release Lock of Infinite Scroll
4813                        settings.infinite_locked = false;
4814                        $("#mec_skin_" + settings.id + " .mec-load-more-wrap").data('page-finished', true).removeClass('mec-load-more-scroll-loading');
4815                    } else {
4816                        // Show load more button
4817                        if (typeof response.has_more_event === 'undefined' || (typeof response.has_more_event !== 'undefined' && response.has_more_event)) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden");
4818                        else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden");
4819
4820                        var html = $(response.html);
4821                        if ($('.mec-month-divider', html).length) {
4822                            var df = $('.mec-month-divider:first', html).data('toggle-divider');
4823                            var dl = $("#mec_skin_events_" + settings.id + " .mec-month-divider:last").data('toggle-divider');
4824
4825                            if (df == dl) {
4826                                $(html).find('.mec-month-divider:first').remove();
4827                                response.html = html;
4828                            }
4829
4830                        }
4831
4832                        // Append Items
4833                        $("#mec_skin_events_" + settings.id).append(response.html);
4834
4835                        // Remove loading Class
4836                        $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading");
4837
4838                        // Update the variables
4839                        settings.end_date = response.end_date;
4840                        settings.offset = response.offset;
4841
4842                        if ($('.mec-event-sd-countdown').length > 0) {
4843                            $('.mec-event-sd-countdown').each(function (event) {
4844                                var dc = $(this).attr('data-date-custom');
4845                                $(this).mecCountDown(
4846                                    {
4847                                        date: dc,
4848                                        format: "off"
4849                                    },
4850                                    function () {
4851                                    });
4852                            })
4853                        }
4854                        // Single Event Method
4855                        if (settings.sed_method != '0') {
4856                            sed();
4857                        }
4858
4859                        // Release Lock of Infinite Scroll
4860                        settings.infinite_locked = false;
4861                        $("#mec_skin_" + settings.id + " .mec-load-more-wrap").removeClass('mec-load-more-scroll-loading');
4862
4863                    }
4864
4865                    $(document).trigger('mec_load_more_init', ['custom', settings]);
4866                },
4867                error: function () { }
4868            });
4869        }
4870
4871        function search() {
4872            // Hide no event message
4873            $("#mec_skin_no_events_" + settings.id).addClass("mec-util-hidden");
4874
4875            var $skinRoot = jQuery("#mec_skin_" + settings.id);
4876            var $loading_element = $skinRoot.find('.mec-modal-result');
4877            if ($loading_element.length === 0) {
4878                $skinRoot.append('<div class="mec-modal-result"></div>');
4879                $loading_element = $skinRoot.find('.mec-modal-result');
4880            }
4881            $loading_element.addClass('mec-month-navigator-loading');
4882            jQuery("#gmap-data-" + settings.id).val("");
4883
4884            $.ajax({
4885                url: settings.ajax_url,
4886                data: "action=mec_custom_load_more&mec_start_date=" + settings.start_date + "&" + settings.atts + "&apply_sf_date=1",
4887                dataType: "json",
4888                type: "post",
4889                success: function (response) {
4890                    if (response.count === 0) {
4891                        // Append Items
4892                        $("#mec_skin_events_" + settings.id).html('');
4893
4894                        // Remove loading Class
4895                        $loading_element.removeClass("mec-month-navigator-loading");
4896
4897                        // Hide Map
4898                        $skinRoot.find('.mec-skin-map-container').addClass("mec-util-hidden");
4899
4900                        // Hide it
4901                        $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden");
4902
4903                        // Show no event message
4904                        $("#mec_skin_no_events_" + settings.id).removeClass("mec-util-hidden");
4905                    } else {
4906                        // Append Items
4907                        $("#mec_skin_events_" + settings.id).html(response.html);
4908
4909                        // Remove loading Class
4910                        $loading_element.removeClass("mec-month-navigator-loading");
4911
4912                        // Show Map
4913                        $skinRoot.find('.mec-skin-map-container').removeClass("mec-util-hidden");
4914
4915                        // Show load more button
4916                        if (response.count >= settings.limit) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden");
4917                        // Hide load more button
4918                        else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden");
4919
4920                        // Update the variables
4921                        settings.end_date = response.end_date;
4922                        settings.offset = response.offset;
4923
4924                        // Single Event Method
4925                        if (settings.sed_method != '0') {
4926                            sed();
4927                        }
4928                    }
4929
4930                    $(document).trigger('mec_search_init', ['custom', settings, response]);
4931                },
4932                error: function () { }
4933            });
4934        }
4935    };
4936
4937}(jQuery));
4938
4939// MEC TIMELINE VIEW PLUGIN
4940(function ($) {
4941    $.fn.mecTimelineView = function (options) {
4942        // Default Options
4943        var settings = $.extend({
4944            // These are the defaults.
4945            id: 0,
4946            atts: '',
4947            ajax_url: '',
4948            sf: {},
4949            end_date: '',
4950            offset: 0,
4951            start_date: '',
4952            pagination: '0',
4953            infinite_locked: false,
4954        }, options);
4955
4956        var sf;
4957
4958        let history = [];
4959        const $next = $('#mec-nextprev-wrap-' + settings.id + ' .mec-nextprev-next-button');
4960        const $prev = $('#mec-nextprev-wrap-' + settings.id + ' .mec-nextprev-prev-button');
4961
4962        // Set onclick Listeners
4963        setListeners();
4964
4965        function setListeners() {
4966            // Search Widget
4967            if (settings.sf.container !== '') {
4968                sf = $(settings.sf.container).mecSearchForm({
4969                    id: settings.id,
4970                    refine: settings.sf.refine,
4971                    ajax_url: settings.ajax_url,
4972                    start_date: settings.start_date,
4973                    atts: settings.atts,
4974                    callback: function (atts) {
4975                        settings.atts = atts;
4976                        search();
4977                    }
4978                });
4979
4980                $(settings.sf.container).addClass('mec-skin-search-init');
4981            }
4982
4983            // Load More
4984            $("#mec_skin_" + settings.id + " .mec-load-more-button").on("click", function () {
4985                loadMore();
4986            });
4987
4988            // Scroll
4989            if (settings.pagination === 'scroll') {
4990                $(window).on("scroll", function (event) {
4991                    var $target = $("#mec_skin_" + settings.id + " .mec-load-more-wrap");
4992
4993                    var finished = $target.data('page-finished');
4994                    if (finished) return;
4995
4996                    var hT = $target.offset().top,
4997                        hH = $target.outerHeight(),
4998                        wH = $(window).height(),
4999                        wS = $(this).scrollTop();
5000
5001                    if (wS + 100 >
5001 hT + hH - wH && !settings.infinite_locked) {
5002                        settings.infinite_locked = true;
5003                        $target.addClass('mec-load-more-scroll-loading');
5004                        loadMore();
5005                    }
5006                });
5007            }
5008
5009            // Next Prev Pagination
5010            if (settings.pagination === 'nextprev') {
5011                // Events Wrapper
5012                const $EW = $("#mec_skin_events_" + settings.id);
5013
5014                let next_disabled = false;
5015
5016                // Previous Button
5017                $prev.on('click', function () {
5018                    if (history.length) {
5019                        let page = history.pop();
5020
5021                        // Display Events
5022                        $EW.html(page.html);
5023
5024                        // Update the variables
5025                        settings.end_date = page.end_date;
5026                        settings.offset = page.offset;
5027                        settings.current_month_divider = page.current_month_divider;
5028
5029                        // Display Next Button
5030                        $next.removeClass('mec-util-hidden');
5031                    }
5032
5033                    // Hide Previous Button
5034                    if (!history.length) $prev.addClass('mec-util-hidden');
5035                });
5036
5037                // Next Button
5038                $next.on('click', function (e) {
5039                    // Prevent Redirect
5040                    e.preventDefault();
5041
5042                    // Currently Disabled
5043                    if (next_disabled) return;
5044
5045                    // Disable Button
5046                    next_disabled = true;
5047
5048                    // Add Loading Style
5049                    $EW.addClass('mec-loading-events');
5050
5051                    // Push to History
5052                    history.push({
5053                        end_date: settings.end_date,
5054                        offset: settings.offset,
5055                        current_month_divider: settings.current_month_divider,
5056                        html: $EW.html()
5057                    });
5058
5059                    loadMore(function (response) {
5060                        // Display New Events
5061                        if (response.count) $EW.html(response.html);
5062                        // Remove Last Page
5063                        else history.pop();
5064
5065                        // Enable Button
5066                        next_disabled = false;
5067
5068                        // Remove Loading Style
5069                        $EW.removeClass('mec-loading-events');
5070
5071                        // Display Previous Button
5072                        if (history.length) $prev.removeClass('mec-util-hidden');
5073                        // Hide Next Button
5074                        if (response.count === 0 || (typeof response.has_more_event !== 'undefined' && !response.has_more_event)) $next.addClass('mec-util-hidden');
5075                    });
5076                });
5077            }
5078
5079            // Single Event Method
5080            if (settings.sed_method != '0') {
5081                sed();
5082            }
5083        }
5084
5085        function sed() {
5086            // Single Event Display
5087            $("#mec_skin_" + settings.id + " .mec-timeline-event-image a, #mec_skin_" + settings.id + " .mec-event-title a, #mec_skin_" + settings.id + " .mec-booking-button").off('click').on('click', function (e) {
5088                e.preventDefault();
5089                var href = $(this).attr('href');
5090
5091                var id = $(this).data('event-id');
5092                var occurrence = get_parameter_by_name('occurrence', href);
5093                var time = get_parameter_by_name('time', href);
5094
5095                if ('undefined' == typeof id) {
5096                    return;
5097                }
5098
5099                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
5100            });
5101            $("#mec_skin_" + settings.id + " .mec-event-image a img").off('click').on('click', function (e) {
5102                e.preventDefault();
5103                var href = $(this).parent().attr('href');
5104
5105                var id = $(this).parent().data('event-id');
5106                var occurrence = get_parameter_by_name('occurrence', href);
5107                var time = get_parameter_by_name('time', href);
5108
5109                if ('undefined' == typeof id) {
5110                    return;
5111                }
5112
5113                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
5114            });
5115        }
5116
5117        function loadMore(callback) {
5118            // Add loading Class
5119            $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-load-more-loading");
5120
5121            $.ajax({
5122                url: settings.ajax_url,
5123                data: "action=mec_timeline_load_more&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "&apply_sf_date=0",
5124                dataType: "json",
5125                type: "post",
5126                success: function (response) {
5127                    if (response.count === 0) {
5128                        // Remove loading Class
5129                        $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading").addClass("mec-util-hidden");
5130
5131                        // Release Lock of Infinite Scroll
5132                        settings.infinite_locked = false;
5133                        $("#mec_skin_" + settings.id + " .mec-load-more-wrap").data('page-finished', true).removeClass('mec-load-more-scroll-loading');
5134
5135                        // Run Callback
5136                        if (typeof callback === 'function') callback(response);
5137                    } else {
5138                        // Show load more button
5139                        if (typeof response.has_more_event === 'undefined' || (typeof response.has_more_event !== 'undefined' && response.has_more_event)) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden");
5140                        else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden");
5141
5142                        // Run Callback
5143                        if (typeof callback === 'function') callback(response);
5144                        // Append Items
5145                        else $("#mec_skin_events_" + settings.id).append(response.html);
5146
5147                        // Remove loading Class
5148                        $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading");
5149
5150                        // Update the variables
5151                        settings.end_date = response.end_date;
5152                        settings.offset = response.offset;
5153
5154                        // Single Event Method
5155                        if (settings.sed_method != '0') {
5156                            sed();
5157                        }
5158
5159                        // Release Lock of Infinite Scroll
5160                        settings.infinite_locked = false;
5161                        $("#mec_skin_" + settings.id + " .mec-load-more-wrap").removeClass('mec-load-more-scroll-loading');
5162                    }
5163
5164                    $(document).trigger('mec_load_more_init', ['timeline', settings]);
5165                },
5166                error: function () { }
5167            });
5168        }
5169
5170        function search() {
5171            // Hide no event message
5172            $("#mec_skin_no_events_" + settings.id).addClass("mec-util-hidden");
5173
5174            var $skinRoot = jQuery("#mec_skin_" + settings.id);
5175            var $loading_element = $skinRoot.find('.mec-modal-result');
5176            if ($loading_element.length === 0) {
5177                $skinRoot.append('<div class="mec-modal-result"></div>');
5178                $loading_element = $skinRoot.find('.mec-modal-result');
5179            }
5180            $loading_element.addClass('mec-month-navigator-loading');
5181
5182            $.ajax({
5183                url: settings.ajax_url,
5184                data: "action=mec_timeline_load_more&mec_start_date=" + settings.start_date + "&" + settings.atts + "&apply_sf_date=1",
5185                dataType: "json",
5186                type: "post",
5187                success: function (response) {
5188                    if (response.count === 0) {
5189                        // Append Items
5190                        $("#mec_skin_events_" + settings.id).html('');
5191
5192                        // Remove loading Class
5193                        $loading_element.removeClass("mec-month-navigator-loading");
5194
5195                        // Hide Map
5196                        $skinRoot.find('.mec-skin-map-container').addClass("mec-util-hidden");
5197
5198                        // Hide it
5199                        $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden");
5200
5201                        // Show no event message
5202                        $("#mec_skin_no_events_" + settings.id).removeClass("mec-util-hidden");
5203                    } else {
5204                        // Append Items
5205                        $("#mec_skin_events_" + settings.id).html(response.html);
5206
5207                        // Remove loading Class
5208                        $loading_element.removeClass("mec-month-navigator-loading");
5209
5210                        // Show Map
5211                        $skinRoot.find('.mec-skin-map-container').removeClass("mec-util-hidden");
5212
5213                        // Show load more button
5214                        if (response.count >= settings.limit) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden");
5215                        // Hide load more button
5216                        else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden");
5217
5218                        // Update the variables
5219                        settings.end_date = response.end_date;
5220                        settings.offset = response.offset;
5221
5222                        // Single Event Method
5223                        if (settings.sed_method != '0') {
5224                            sed();
5225                        }
5226                    }
5227
5228                    $(document).trigger('mec_search_init', ['timeline', settings, response]);
5229                },
5230                error: function () { }
5231            });
5232        }
5233    };
5234
5235}(jQuery));
5236
5237// MEC AGENDA VIEW PLUGIN
5238(function ($) {
5239    $.fn.mecAgendaView = function (options) {
5240        // Default Options
5241        var settings = $.extend({
5242            // These are the defaults.
5243            id: 0,
5244            atts: '',
5245            ajax_url: '',
5246            sf: {},
5247            current_month_divider: '',
5248            end_date: '',
5249            offset: 0,
5250            pagination: '0',
5251            infinite_locked: false,
5252        }, options);
5253
5254        var sf;
5255
5256        let history = [];
5257        const $next = $('#mec-nextprev-wrap-' + settings.id + ' .mec-nextprev-next-button');
5258        const $prev = $('#mec-nextprev-wrap-' + settings.id + ' .mec-nextprev-prev-button');
5259
5260        // Set onclick Listeners
5261        setListeners();
5262
5263        function setListeners() {
5264            // Search Widget
5265            if (settings.sf.container !== '') {
5266                sf = $(settings.sf.container).mecSearchForm({
5267                    id: settings.id,
5268                    refine: settings.sf.refine,
5269                    ajax_url: settings.ajax_url,
5270                    start_date: settings.start_date,
5271                    atts: settings.atts,
5272                    callback: function (atts) {
5273                        settings.atts = atts;
5274                        search();
5275                    }
5276                });
5277
5278                $(settings.sf.container).addClass('mec-skin-search-init');
5279            }
5280
5281            // Load More
5282            $("#mec_skin_" + settings.id + " .mec-load-more-button").on("click", function () {
5283                loadMore();
5284            });
5285
5286            // Scroll
5287            if (settings.pagination === 'scroll') {
5288                $(window).on("scroll", function (event) {
5289                    var $target = $("#mec_skin_" + settings.id + " .mec-load-more-wrap");
5290
5291                    var finished = $target.data('page-finished');
5292                    if (finished) return;
5293
5294                    var hT = $target.offset().top,
5295                        hH = $target.outerHeight(),
5296                        wH = $(window).height(),
5297                        wS = $(this).scrollTop();
5298
5299                    if (wS + 100 >
5299 hT + hH - wH && !settings.infinite_locked) {
5300                        settings.infinite_locked = true;
5301                        $target.addClass('mec-load-more-scroll-loading');
5302                        loadMore();
5303                    }
5304                });
5305            }
5306
5307            // Next Prev Pagination
5308            if (settings.pagination === 'nextprev') {
5309                // Events Wrapper
5310                const $EW = $("#mec_skin_events_" + settings.id + " .mec-events-agenda-container");
5311
5312                let next_disabled = false;
5313
5314                // Previous Button
5315                $prev.on('click', function () {
5316                    if (history.length) {
5317                        let page = history.pop();
5318
5319                        // Display Events
5320                        $EW.html(page.html);
5321
5322                        // Update the variables
5323                        settings.end_date = page.end_date;
5324                        settings.offset = page.offset;
5325                        settings.current_month_divider = page.current_month_divider;
5326
5327                        // Display Next Button
5328                        $next.removeClass('mec-util-hidden');
5329                    }
5330
5331                    // Hide Previous Button
5332                    if (!history.length) $prev.addClass('mec-util-hidden');
5333                });
5334
5335                // Next Button
5336                $next.on('click', function (e) {
5337                    // Prevent Redirect
5338                    e.preventDefault();
5339
5340                    // Currently Disabled
5341                    if (next_disabled) return;
5342
5343                    // Disable Button
5344                    next_disabled = true;
5345
5346                    // Add Loading Style
5347                    $EW.addClass('mec-loading-events');
5348
5349                    // Push to History
5350                    history.push({
5351                        end_date: settings.end_date,
5352                        offset: settings.offset,
5353                        current_month_divider: settings.current_month_divider,
5354                        html: $EW.html()
5355                    });
5356
5357                    loadMore(function (response) {
5358                        // Display New Events
5359                        if (response.count) $EW.html(response.html);
5360                        // Remove Last Page
5361                        else history.pop();
5362
5363                        // Enable Button
5364                        next_disabled = false;
5365
5366                        // Remove Loading Style
5367                        $EW.removeClass('mec-loading-events');
5368
5369                        // Display Previous Button
5370                        if (history.length) $prev.removeClass('mec-util-hidden');
5371                        // Hide Next Button
5372                        if (response.count === 0 || (typeof response.has_more_event !== 'undefined' && !response.has_more_event)) $next.addClass('mec-util-hidden');
5373                    });
5374                });
5375            }
5376
5377            // Single Event Method
5378            if (settings.sed_method != '0') {
5379                sed();
5380            }
5381        }
5382
5383        function sed() {
5384            // Single Event Display
5385            $("#mec_skin_" + settings.id + " .mec-agenda-event-title a").off('click').on('click', function (e) {
5386                var sed_method = $(this).attr('target');
5387                if ('_blank' === sed_method) {
5388
5389                    return;
5390                }
5391                e.preventDefault();
5392                var href = $(this).attr('href');
5393
5394                var id = $(this).data('event-id');
5395                var occurrence = get_parameter_by_name('occurrence', href);
5396                var time = get_parameter_by_name('time', href);
5397
5398                if ('undefined' == typeof id) {
5399                    return;
5400                }
5401
5402                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
5403            });
5404        }
5405
5406        function loadMore(callback) {
5407            // Add loading Class
5408            $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-load-more-loading");
5409
5410            $.ajax({
5411                url: settings.ajax_url,
5412                data: "action=mec_agenda_load_more&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "&current_month_divider=" + settings.current_month_divider + "&apply_sf_date=0",
5413                dataType: "json",
5414                type: "post",
5415                success: function (response) {
5416                    if (response.count === 0) {
5417                        // Remove loading Class
5418                        $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading").addClass("mec-util-hidden");
5419
5420                        // Release Lock of Infinite Scroll
5421                        settings.infinite_locked = false;
5422                        $("#mec_skin_" + settings.id + " .mec-load-more-wrap").data('page-finished', true).removeClass('mec-load-more-scroll-loading');
5423
5424                        // Run Callback
5425                        if (typeof callback === 'function') callback(response);
5426                    } else {
5427                        // Show load more button
5428                        if (typeof response.has_more_event === 'undefined' || (typeof response.has_more_event !== 'undefined' && response.has_more_event)) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden");
5429                        else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden");
5430
5431                        // Run Callback
5432                        if (typeof callback === 'function') callback(response);
5433                        // Append Items
5434                        else $("#mec_skin_events_" + settings.id + " .mec-events-agenda-container").append(response.html);
5435
5436                        // Remove loading Class
5437                        $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading");
5438
5439                        // Update the variables
5440                        settings.end_date = response.end_date;
5441                        settings.offset = response.offset;
5442                        settings.current_month_divider = response.current_month_divider;
5443
5444                        // Single Event Method
5445                        if (settings.sed_method != '0') {
5446                            sed();
5447                        }
5448                        mecFluentCustomScrollbar();
5449
5450                        // Release Lock of Infinite Scroll
5451                        settings.infinite_locked = false;
5452                        $("#mec_skin_" + settings.id + " .mec-load-more-wrap").removeClass('mec-load-more-scroll-loading');
5453                    }
5454
5455                    $(document).trigger('mec_load_more_init', ['agenda', settings]);
5456                },
5457                error: function () { }
5458            });
5459        }
5460
5461        function search() {
5462            // Hide no event message
5463            $("#mec_skin_no_events_" + settings.id).addClass("mec-util-hidden");
5464
5465            // Add loading Class
5466            if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
5467            jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
5468            mecFluentCustomScrollbar();
5469
5470            $.ajax({
5471                url: settings.ajax_url,
5472                data: "action=mec_agenda_load_more&mec_start_date=" + settings.start_date + "&" + settings.atts + "&current_month_divider=0&apply_sf_date=1",
5473                dataType: "json",
5474                type: "post",
5475                success: function (response) {
5476                    if (response.count === 0) {
5477                        // Append Items
5478                        $("#mec_skin_events_" + settings.id + " .mec-events-agenda-container").html('');
5479
5480                        // Remove loading Class
5481                        $('.mec-modal-result').removeClass("mec-month-navigator-loading");
5482
5483                        // Hide it
5484                        $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden");
5485
5486                        // Show no event message
5487                        $("#mec_skin_no_events_" + settings.id).removeClass("mec-util-hidden");
5488                    } else {
5489                        // Append Items
5490                        $("#mec_skin_events_" + settings.id + " .mec-events-agenda-container").html(response.html);
5491
5492                        // Remove loading Class
5493                        $('.mec-modal-result').removeClass("mec-month-navigator-loading");
5494
5495                        // Show load more button
5496                        if (response.count >= settings.limit) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden");
5497                        // Hide load more button
5498                        else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden");
5499
5500                        // Update the variables
5501                        settings.end_date = response.end_date;
5502                        settings.offset = response.offset;
5503                        settings.current_month_divider = response.current_month_divider;
5504
5505                        // Single Event Method
5506                        if (settings.sed_method != '0') {
5507                            sed();
5508                        }
5509                    }
5510                    mecFluentCustomScrollbar();
5511
5512                    $(document).trigger('mec_search_init', ['agenda', settings, response]);
5513                },
5514                error: function () { }
5515            });
5516        }
5517    };
5518}(jQuery));
5519
5520// MEC CAROUSEL VIEW PLUGIN
5521(function ($) {
5522    $.fn.mecCarouselView = function (options) {
5523        // Default Options
5524        var settings = $.extend({
5525            // These are the defaults.
5526            id: 0,
5527            atts: '',
5528            ajax_url: '',
5529            sf: {},
5530            items: 3,
5531            items_mobile: 1,
5532            items_tablet: 2,
5533            loop: true,
5534            autoplay_status: true,
5535            autoplay: '',
5536            style: 'type1',
5537            start_date: ''
5538        }, options);
5539
5540        // Init Sliders
5541        initSlider(settings);
5542
5543        // Single Event Method
5544        if (settings.sed_method != '0') {
5545            sed(settings);
5546        }
5547
5548        function initSlider(settings) {
5549            // Check RTL website
5550            if ($('body').hasClass('rtl')) {
5551                var owl_rtl = true;
5552            } else {
5553                var owl_rtl = false;
5554            }
5555
5556            if (settings.style === 'type1') {
5557                // Start carousel skin
5558                var owl = $("#mec_skin_" + settings.id + " .mec-event-carousel-type1 .mec-owl-carousel");
5559
5560                owl.owlCarousel({
5561                    autoplay: settings.autoplay_status,
5562                    autoplayTimeout: settings.autoplay, // Set AutoPlay to 3 seconds
5563                    loop: settings.loop,
5564                    items: settings.items,
5565                    dots: true,
5566                    nav: false,
5567                    autoplayHoverPause: settings.autoplay_status,
5568                    rtl: owl_rtl,
5569                    navElement: 'button type="button" role="button"',
5570                    responsiveClass: true,
5571                    responsive: {
5572                        0: {
5573                            items: settings.items_mobile,
5574                        },
5575                        768: {
5576                            items: settings.items_tablet,
5577                        },
5578                        1199: {
5579                            items: settings.items,
5580                        }
5581                    },
5582                });
5583
5584                if (settings.autoplay_status) {
5585                    owl.on(
5586                        "mouseleave",
5587                        function (event) {
5588                            $("#mec_skin_" + settings.id + " .mec-owl-carousel").trigger('play.owl.autoplay');
5589                        }
5590                    );
5591                }
5592            } else if (settings.style === 'type4') {
5593                $("#mec_skin_" + settings.id + " .mec-owl-carousel").owlCarousel({
5594                    autoplay: settings.autoplay_status,
5595                    loop: settings.loop,
5596                    autoplayTimeout: settings.autoplay,
5597                    items: settings.items,
5598                    dots: false,
5599                    nav: true,
5600                    autoplayHoverPause: settings.autoplay_status,
5601                    navText: ["<i class='mec-sl-arrow-left' aria-label='Previous'></i>", " <i class='mec-sl-arrow-right' aria-label='Next'></i>"],
5602                    navElement: 'button type="button" role="button"',
5603                    rtl: owl_rtl,
5604                    responsiveClass: true,
5605                    responsive: {
5606                        0: {
5607                            items: settings.items_mobile,
5608                        },
5609                        768: {
5610                            items: settings.items_tablet,
5611                        },
5612                        1199: {
5613                            items: settings.items,
5614                        }
5615                    },
5616                });
5617
5618                if (settings.autoplay_status) {
5619                    $("#mec_skin_" + settings.id + " .mec-owl-carousel").on(
5620                        "mouseleave",
5621                        function (event) {
5622                            $("#mec_skin_" + settings.id + " .mec-owl-carousel").trigger('play.owl.autoplay');
5623                        }
5624                    );
5625                }
5626            } else {
5627                $("#mec_skin_" + settings.id + " .mec-owl-carousel").owlCarousel({
5628                    autoplay: settings.autoplay_status,
5629                    loop: settings.loop,
5630                    autoplayTimeout: settings.autoplay,
5631                    items: settings.items,
5632                    dots: typeof settings.dots_navigation != 'undefined' ? settings.dots_navigation : false,
5633                    nav: typeof settings.navigation != 'undefined' ? settings.navigation : true,
5634                    autoplayHoverPause: settings.autoplay_status,
5635                    navText: typeof settings.navText != 'undefined' ? settings.navText : ["<i class='mec-sl-arrow-left' aria-label='Previous'></i>", " <i class='mec-sl-arrow-right' aria-label='Next'></i>"],
5636                    navElement: 'button type="button" role="button"',
5637                    rtl: owl_rtl,
5638                    responsiveClass: true,
5639                    responsive: {
5640                        0: {
5641                            items: settings.items_mobile,
5642                        },
5643                        768: {
5644                            items: settings.items_tablet,
5645                        },
5646                        1199: {
5647                            items: settings.items,
5648                        }
5649                    },
5650                });
5651
5652                if (settings.autoplay_status) {
5653                    $("#mec_skin_" + settings.id + " .mec-owl-carousel").on(
5654                        "mouseleave",
5655                        function (event) {
5656                            $("#mec_skin_" + settings.id + " .mec-owl-carousel").trigger('play.owl.autoplay');
5657                        }
5658                    );
5659                }
5660            }
5661        }
5662    };
5663
5664    function sed(settings) {
5665        // Single Event Display
5666        $("#mec_skin_" + settings.id + " .mec-event-carousel-title a, #mec_skin_" + settings.id + " .mec-event-image a, #mec_skin_" + settings.id + " .mec-booking-button, #mec_skin_" + settings.id + " .mec-event-button").off('click').on('click', function (e) {
5667            var sed_method = $(this).attr('target');
5668            if ('_blank' === sed_method) {
5669
5670                return;
5671            }
5672            e.preventDefault();
5673            var href = $(this).attr('href');
5674
5675            var id = $(this).data('event-id');
5676            var occurrence = get_parameter_by_name('occurrence', href);
5677            var time = get_parameter_by_name('time', href);
5678
5679            if ('undefined' == typeof id) {
5680                return;
5681            }
5682
5683            mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
5684        });
5685    }
5686}(jQuery));
5687
5688// MEC SLIDER VIEW PLUGIN
5689(function ($) {
5690    $.fn.mecSliderView = function (options) {
5691        // Default Options
5692        var settings = $.extend({
5693            // These are the defaults.
5694            id: 0,
5695            atts: '',
5696            transition_time: 250,
5697            autoplay: false,
5698            ajax_url: '',
5699            sf: {},
5700            start_date: ''
5701        }, options);
5702
5703        var rtl = false;
5704
5705        // Init Sliders
5706        initSlider();
5707
5708        function initSlider() {
5709            // Check RTL website
5710            if ($('body').hasClass('rtl')) rtl = true;
5711
5712            $("#mec_skin_" + settings.id + " .mec-owl-carousel").owlCarousel(
5713                {
5714                    autoplay: true,
5715                    smartSpeed: settings.transition_time,
5716                    autoplayTimeout: settings.autoplay,
5717                    loop: true,
5718                    items: 1,
5719                    responsiveClass: true,
5720                    responsive: {
5721                        0: {
5722                            items: 1,
5723                        },
5724                        960: {
5725                            items: 1,
5726                        },
5727                        1200: {
5728                            items: 1,
5729                        }
5730                    },
5731                    dots: false,
5732                    nav: true,
5733                    autoplayHoverPause: true,
5734                    navText: typeof settings.navText != 'undefined' ? settings.navText : ["<i class='mec-sl-arrow-left' aria-label='Previous'></i>", " <i class='mec-sl-arrow-right' aria-label='Next'></i>"],
5735                    navElement: 'button type="button" role="button"',
5736                    rtl: rtl,
5737                });
5738        }
5739    };
5740}(jQuery));
5741
5742// MEC COUNTDOWN MODULE
5743(function ($) {
5744    $.fn.mecCountDown = function (options, callBack) {
5745        // Default Options
5746        var settings = $.extend({
5747            // These are the defaults.
5748            date: null,
5749            format: null
5750        }, options);
5751
5752        var callback = callBack;
5753        var selector = $(this);
5754
5755        startCountdown();
5756        var interval = setInterval(startCountdown, 1000);
5757
5758        function startCountdown() {
5759            var eventDate = Date.parse(settings.date) / 1000;
5760            var currentDate = Math.floor($.now() / 1000);
5761
5762            if (eventDate <= currentDate) {
5763                selector.find(".mec-days").text("00");
5764                selector.find(".mec-hours").text("00");
5765                selector.find(".mec-minutes").text("00");
5766                selector.find(".mec-seconds").text("00");
5767
5768                callback.call(this);
5769                clearInterval(interval);
5770                return;
5771            }
5772
5773            var seconds = eventDate - currentDate;
5774
5775            var days = Math.floor(seconds / (60 * 60 * 24));
5776            seconds -= days * 60 * 60 * 24;
5777
5778            var hours = Math.floor(seconds / (60 * 60));
5779            seconds -= hours * 60 * 60;
5780
5781            var minutes = Math.floor(seconds / 60);
5782            seconds -= minutes * 60;
5783
5784            if (days == 1) selector.find(".mec-timeRefDays").text(mecdata.day);
5785            else selector.find(".mec-timeRefDays").text(mecdata.days);
5786
5787            if (hours == 1) selector.find(".mec-timeRefHours").text(mecdata.hour);
5788            else selector.find(".mec-timeRefHours").text(mecdata.hours);
5789
5790            if (minutes == 1) selector.find(".mec-timeRefMinutes").text(mecdata.minute);
5791            else selector.find(".mec-timeRefMinutes").text(mecdata.minutes);
5792
5793            if (seconds == 1) selector.find(".mec-timeRefSeconds").text(mecdata.second);
5794            else selector.find(".mec-timeRefSeconds").text(mecdata.seconds);
5795
5796            if (settings.format === "on") {
5797                days = (String(days).length >= 2) ? days : "0" + days;
5798                hours = (String(hours).length >= 2) ? hours : "0" + hours;
5799                minutes = (String(minutes).length >= 2) ? minutes : "0" + minutes;
5800                seconds = (String(seconds).length >= 2) ? seconds : "0" + seconds;
5801            }
5802
5803            if (!isNaN(eventDate)) {
5804                selector.find(".mec-days").text(days);
5805                selector.find(".mec-hours").text(hours);
5806                selector.find(".mec-minutes").text(minutes);
5807                selector.find(".mec-seconds").text(seconds);
5808            } else {
5809                clearInterval(interval);
5810            }
5811        }
5812    };
5813
5814}(jQuery));
5815
5816// MEC TILE VIEW PLUGIN
5817(function ($) {
5818    $.fn.mecTileView = function (options) {
5819        var active_month;
5820        var active_year;
5821
5822        // Default Options
5823        var settings = $.extend({
5824            // These are the defaults.
5825            today: null,
5826            id: 0,
5827            events_label: 'Events',
5828            event_label: 'Event',
5829            month_navigator: 0,
5830            atts: '',
5831            active_month: {},
5832            next_month: {},
5833            sf: {},
5834            ajax_url: '',
5835            pagination: '0',
5836            infinite_locked: false,
5837        }, options);
5838
5839        // Initialize Month Navigator
5840        if (settings.month_navigator) initMonthNavigator();
5841
5842        // Load Next Month in background
5843        if (settings.load_method === 'month') setMonth(settings.next_month.year, settings.next_month.month, true);
5844
5845        active_month = settings.active_month.month;
5846        active_year = settings.active_month.year;
5847
5848        let history = [];
5849        const $next = $('#mec-nextprev-wrap-' + settings.id + ' .mec-nextprev-next-button');
5850        const $prev = $('#mec-nextprev-wrap-' + settings.id + ' .mec-nextprev-prev-button');
5851
5852        // Set onclick Listeners
5853        setListeners();
5854
5855        // Search Widget
5856        if (settings.sf.container !== '') {
5857            $(settings.sf.container).mecSearchForm(
5858                {
5859                    id: settings.id,
5860                    refine: settings.sf.refine,
5861                    ajax_url: settings.ajax_url,
5862                    atts: settings.atts,
5863                    callback: function (atts) {
5864                        settings.atts = atts;
5865                        search(active_year, active_month);
5866                    }
5867                });
5868
5869            $(settings.sf.container).addClass('mec-skin-search-init');
5870        }
5871
5872        function initMonthNavigator() {
5873            $("#mec_skin_" + settings.id + " .mec-load-month").off("click").on("click", function () {
5874                var year = $(this).data("mec-year");
5875                var month = $(this).data("mec-month");
5876
5877                setMonth(year, month, false, true);
5878            });
5879        }
5880
5881        function search(year, month) {
5882            // Add Loading Class
5883            if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
5884            jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
5885
5886            $.ajax(
5887                {
5888                    url: settings.ajax_url,
5889                    data: "action=mec_tile_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=1",
5890                    dataType: "json",
5891                    type: "post",
5892                    success: function (response) {
5893                        if (settings.load_method === 'month') {
5894                            active_month = response.current_month.month;
5895                            active_year = response.current_month.year;
5896
5897                            // Append Month
5898                            $("#mec_skin_events_" + settings.id).html('<div class="mec-month-container" id="mec_tile_month_' + settings.id + '_' + response.current_month.id + '" data-month-id="' + response.current_month.id + '">' + response.month + '</div>');
5899
5900                            // Append Month Navigator
5901                            $("#mec_skin_" + settings.id + " .mec-skin-tile-month-navigator-container").append('<div class="mec-month-navigator" id="mec_month_navigator_' + settings.id + '_' + response.current_month.id + '">' + response.navigator + '</div>');
5902
5903                            // Re-initialize Month Navigator
5904                            initMonthNavigator();
5905
5906                            // Set onclick Listeners
5907                            setListeners();
5908
5909                            // Toggle Month
5910                            toggleMonth(response.current_month.id);
5911                        }
5912                        else {
5913                            // Append Items
5914                            $("#mec_skin_events_" + settings.id).html(response.html);
5915
5916                            // Show load more button
5917                            if (response.count >= settings.limit) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden");
5918                            // Hide load more button
5919                            else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden");
5920
5921                            // Update the variables
5922                            settings.end_date = response.end_date;
5923                            settings.offset = response.offset;
5924
5925                            // Set onclick Listeners
5926                            setListeners();
5927                        }
5928
5929                        // Remove loading Class
5930                        $('.mec-modal-result').removeClass("mec-month-navigator-loading");
5931
5932                        $(document).trigger('mec_search_init', ['tile', settings, response]);
5933                    },
5934                    error: function () { }
5935                });
5936        }
5937
5938        function setMonth(year, month, do_in_background, navigator_click) {
5939            if (typeof do_in_background === "undefined") do_in_background = false;
5940            navigator_click = navigator_click || false;
5941
5942            var month_id = year + "" + month;
5943
5944            if (!do_in_background) {
5945                active_month = month;
5946                active_year = year;
5947            }
5948
5949            // Month exists so we just show it
5950            if ($("#mec_tile_month_" + settings.id + "_" + month_id).length) {
5951                // Toggle Month
5952                toggleMonth(month_id);
5953            }
5954            else {
5955                if (!do_in_background) {
5956                    // Add Loading Class
5957                    if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
5958                    jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
5959                }
5960
5961                $.ajax(
5962                    {
5963                        url: settings.ajax_url,
5964                        data: "action=mec_tile_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=0" + "&navigator_click=" + navigator_click,
5965                        dataType: "json",
5966                        type: "post",
5967                        success: function (response) {
5968                            // Append Month
5969                            $("#mec_skin_events_" + settings.id).append('<div class="mec-month-container" id="mec_tile_month_' + settings.id + '_' + response.current_month.id + '" data-month-id="' + response.current_month.id + '">' + response.month + '</div>');
5970
5971                            // Append Month Navigator
5972                            $("#mec_skin_" + settings.id + " .mec-skin-tile-month-navigator-container").append('<div class="mec-month-navigator" id="mec_month_navigator_' + settings.id + '_' + response.current_month.id + '">' + response.navigator + '</div>');
5973
5974                            // Re-initialize Month Navigator
5975                            initMonthNavigator();
5976
5977                            // Set onclick Listeners
5978                            setListeners();
5979
5980                            if (!do_in_background) {
5981                                // Toggle Month
5982                                toggleMonth(response.current_month.id);
5983
5984                                // Remove loading Class
5985                                $('.mec-modal-result').removeClass("mec-month-navigator-loading");
5986
5987                                // Set Month Filter values in search widget
5988                                $("#mec_sf_month_" + settings.id).val(month);
5989                                $("#mec_sf_year_" + settings.id).val(year);
5990                            }
5991                            else {
5992                                $("#mec_tile_month_" + settings.id + "_" + response.current_month.id).hide();
5993                                $("#mec_month_navigator_" + settings.id + "_" + response.current_month.id).hide();
5994                            }
5995                        },
5996                        error: function () { }
5997                    });
5998            }
5999        }
6000
6001        function toggleMonth(month_id) {
6002            var active_month = $("#mec_skin_" + settings.id + " .mec-month-container-selected").data("month-id");
6003            var active_day = $("#mec_tile_month_" + settings.id + "_" + active_month + " .mec-selected-day").data("day");
6004
6005            if (active_day <= 9) active_day = "0" + active_day;
6006
6007            // Toggle Month Navigator
6008            $("#mec_skin_" + settings.id + " .mec-month-navigator").hide();
6009            $("#mec_month_navigator_" + settings.id + "_" + month_id).show();
6010
6011            // Toggle Month
6012            $("#mec_skin_" + settings.id + " .mec-month-container").hide().removeClass("mec-month-container-selected");
6013            $("#mec_tile_month_" + settings.id + "_" + month_id).show().addClass("mec-month-container-selected");
6014
6015            jQuery(document).trigger('mec_toggle_month', [settings, month_id]);
6016        }
6017
6018        var sf;
6019
6020        function setListeners() {
6021            // Load More
6022            $("#mec_skin_" + settings.id + " .mec-load-more-button").off("click").on("click", function () {
6023                loadMore();
6024            });
6025
6026            // Scroll
6027            if (settings.pagination === 'scroll') {
6028                $(window).on("scroll", function (event) {
6029                    var $target = $("#mec_skin_" + settings.id + " .mec-load-more-wrap");
6030
6031                    var finished = $target.data('page-finished');
6032                    if (finished) return;
6033
6034                    var hT = $target.offset().top,
6035                        hH = $target.outerHeight(),
6036                        wH = $(window).height(),
6037                        wS = $(this).scrollTop();
6038
6039                    if (wS + 100 > hT + hH - wH && !settings.infinite_locked) {
6040                        settings.infinite_locked = true;
6041                        $target.addClass('mec-load-more-scroll-loading');
6042                        loadMore();
6043                    }
6044                });
6045            }
6046
6047            // Next Prev Pagination
6048            if (settings.pagination === 'nextprev') {
6049                // Events Wrapper
6050                const $EW = $("#mec_skin_events_" + settings.id);
6051
6052                let next_disabled = false;
6053
6054                // Previous Button
6055                $prev.on('click', function () {
6056                    if (history.length) {
6057                        let page = history.pop();
6058
6059                        // Display Events
6060                        $EW.html(page.html);
6061
6062                        // Update the variables
6063                        settings.end_date = page.end_date;
6064                        settings.offset = page.offset;
6065                        settings.current_month_divider = page.current_month_divider;
6066
6067                        // Display Next Button
6068                        $next.removeClass('mec-util-hidden');
6069                    }
6070
6071                    // Hide Previous Button
6072                    if (!history.length) $prev.addClass('mec-util-hidden');
6073                });
6074
6075                // Next Button
6076                $next.on('click', function (e) {
6077                    // Prevent Redirect
6078                    e.preventDefault();
6079
6080                    // Currently Disabled
6081                    if (next_disabled) return;
6082
6083                    // Disable Button
6084                    next_disabled = true;
6085
6086                    // Add Loading Style
6087                    $EW.addClass('mec-loading-events');
6088
6089                    // Push to History
6090                    history.push({
6091                        end_date: settings.end_date,
6092                        offset: settings.offset,
6093                        current_month_divider: settings.current_month_divider,
6094                        html: $EW.html()
6095                    });
6096
6097                    loadMore(function (response) {
6098                        // Display New Events
6099                        if (response.count) $EW.html(response.html);
6100                        // Remove Last Page
6101                        else history.pop();
6102
6103                        // Enable Button
6104                        next_disabled = false;
6105
6106                        // Remove Loading Style
6107                        $EW.removeClass('mec-loading-events');
6108
6109                        // Display Previous Button
6110                        if (history.length) $prev.removeClass('mec-util-hidden');
6111                        // Hide Next Button
6112                        if (response.count === 0 || (typeof response.has_more_event !== 'undefined' && !response.has_more_event)) $next.addClass('mec-util-hidden');
6113                    });
6114                });
6115            }
6116
6117            $("#mec_skin_" + settings.id + " article").off("click").on("click", function (e) {
6118                // Link Clicked
6119                if (e.target.nodeName.toLowerCase() === 'a') return;
6120
6121                var href = $(this).data('href');
6122                if (!href) return;
6123
6124                var target = $(this).data('target');
6125
6126                if (target === 'blank') window.open(href, '_blank');
6127                else if (target !== 'm1') document.location.href = href;
6128            });
6129
6130            // Add the onclick event
6131            $("#mec_skin_" + settings.id + " .mec-has-event").off("click").on('click', function (e) {
6132                e.preventDefault();
6133
6134                // define variables
6135                var $this = $(this),
6136                    data_mec_cell = $this.data('mec-cell'),
6137                    month_id = $this.data('month');
6138
6139                $("#mec_monthly_view_month_" + settings.id + "_" + month_id + " .mec-calendar-day").removeClass('mec-selected-day');
6140                $this.addClass('mec-selected-day');
6141
6142                $('#mec_month_side_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec:not([data-mec-cell=' + data_mec_cell + '])').slideUp();
6143                $('#mec_month_side_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec[data-mec-cell=' + data_mec_cell + ']').slideDown();
6144
6145                $('#mec_monthly_view_month_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec:not([data-mec-cell=' + data_mec_cell + '])').slideUp();
6146                $('#mec_monthly_view_month_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec[data-mec-cell=' + data_mec_cell + ']').slideDown();
6147            });
6148
6149            // Single Event Method
6150            if (settings.sed_method != '0') {
6151                sed();
6152            }
6153        }
6154
6155        function sed() {
6156            // Single Event Display
6157            $("#mec_skin_" + settings.id + " .mec-event-content .mec-tile-into-content-link,#mec_skin_" + settings.id + " .mec-event-content .mec-event-title a").off('click').on('click', function (e) {
6158
6159                var sed_method = $(this).closest('.mec-event-article.mec-tile-item').data('target');
6160                if ('_blank' === sed_method) {
6161                    return;
6162                }
6163                e.preventDefault();
6164                var href = $(this).closest('.mec-event-article.mec-tile-item').data('href');
6165
6166                var id = $(this).closest('.mec-event-article.mec-tile-item').find('.mec-event-title a').data('event-id');
6167                var occurrence = get_parameter_by_name('occurrence', href);
6168                var time = get_parameter_by_name('time', href);
6169
6170                if ('undefined' == typeof id) {
6171                    return;
6172                }
6173
6174                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
6175            });
6176        }
6177
6178        function loadMore(callback) {
6179            // Load More Button
6180            var $load_more_button = $("#mec_skin_" + settings.id + " .mec-load-more-button");
6181
6182            // Add loading Class
6183            $load_more_button.addClass("mec-load-more-loading");
6184
6185            $.ajax(
6186                {
6187                    url: settings.ajax_url,
6188                    data: "action=mec_tile_load_more&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "&current_month_divider=" + settings.current_month_divider + "&apply_sf_date=0",
6189                    dataType: "json",
6190                    type: "post",
6191                    success: function (response) {
6192                        if (response.count == '0') {
6193                            // Remove loading Class
6194                            $load_more_button.removeClass("mec-load-more-loading");
6195
6196                            // Hide load more button
6197                            $load_more_button.addClass("mec-util-hidden");
6198
6199                            // Release Lock of Infinite Scroll
6200                            settings.infinite_locked = false;
6201                            $("#mec_skin_" + settings.id + " .mec-load-more-wrap").data('page-finished', true).removeClass('mec-load-more-scroll-loading');
6202
6203                            // Run Callback
6204                            if (typeof callback === 'function') callback(response);
6205                        }
6206                        else {
6207                            // Show load more button
6208                            if (typeof response.has_more_event === 'undefined' || (typeof response.has_more_event !== 'undefined' && response.has_more_event)) $load_more_button.removeClass("mec-util-hidden");
6209                            else $load_more_button.addClass("mec-util-hidden");
6210
6211                            // Run Callback
6212                            if (typeof callback === 'function') callback(response);
6213                            // Append Items
6214                            else $("#mec_skin_events_" + settings.id).append(response.html);
6215
6216                            // Remove loading Class
6217                            $load_more_button.removeClass("mec-load-more-loading");
6218
6219                            // Update the variables
6220                            settings.end_date = response.end_date;
6221                            settings.offset = response.offset;
6222                            settings.current_month_divider = response.current_month_divider;
6223
6224                            // Single Event Method
6225                            if (settings.sed_method != '0') {
6226                                sed();
6227                            }
6228
6229                            // Release Lock of Infinite Scroll
6230                            settings.infinite_locked = false;
6231                            $("#mec_skin_" + settings.id + " .mec-load-more-wrap").removeClass('mec-load-more-scroll-loading');
6232                        }
6233
6234                        $(document).trigger('mec_load_more_init', ['tile', settings]);
6235                    },
6236                    error: function () { }
6237                });
6238        }
6239    };
6240}(jQuery));
6241
6242function mec_gateway_selected(gateway_id) {
6243    // Hide all gateway forms
6244    jQuery('.mec-book-form-gateway-checkout').addClass('mec-util-hidden');
6245
6246    // Show selected gateway form
6247    jQuery('#mec_book_form_gateway_checkout' + gateway_id).removeClass('mec-util-hidden');
6248}
6249
6250function mec_wrap_resize() {
6251    var $mec_wrap = jQuery('.mec-wrap'),
6252        mec_width = $mec_wrap.width();
6253    if (mec_width < 959) {
6254        $mec_wrap.addClass('mec-sm959');
6255    } else {
6256        $mec_wrap.removeClass('mec-sm959');
6257    }
6258}
6259
6260function get_parameter_by_name(name, url) {
6261    if (!url) {
6262        url = window.location.href;
6263    }
6264
6265    name = name.replace(/[\[\]]/g, "\\$&");
6266    var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
6267        results = regex.exec(url);
6268
6269    if (!results) return null;
6270    if (!results[2]) return '';
6271
6272    return decodeURIComponent(results[2].replace(/\+/g, " "));
6273}
6274
6275// Focus events day
6276var mec_g_month_id = null;
6277
6278function mecFocusDay(settings) {
6279    if (mec_g_month_id != null) {
6280        setTimeout(function () {
6281            var id = settings.id,
6282                date = new Date(),
6283                mec_owl_year = mec_g_month_id.substr(0, 4),
6284                mec_current_year = date.getFullYear(),
6285                mec_owl_month = mec_g_month_id.substr(4, 6),
6286                mec_current_month = date.getMonth() + 1,
6287                mec_current_day = date.getDate(),
6288                mec_owl_go = jQuery("#mec-owl-calendar-d-table-" + id + "-" + mec_g_month_id),
6289                mec_day_exist = false;
6290            mec_owl_go.find('.owl-stage > div').each(function (index) {
6291                if (parseInt(jQuery(this).children('div').data("events-count")) > 0) {
6292                    if ((((mec_owl_year != mec_current_year) && (mec_owl_month != mec_current_month)) || (mec_owl_year == mec_current_year) && (mec_owl_month != mec_current_month)) || parseInt(jQuery(this).children('div').text()) > mec_current_day) {
6293                        var index_plus = index + 1;
6294                        jQuery('#mec_daily_view_day' + id + '_' + mec_g_month_i
6294d + (index < 10 ? '0' + index_plus : index_plus)).trigger('click');
6295                        mec_owl_go.trigger('to.owl.carousel', index_plus);
6296                        mec_day_exist = true;
6297                        return false;
6298                    }
6299                    else {
6300                        jQuery('#mec_daily_view_day' + id + '_' + mec_g_month_id + mec_current_day).trigger('click');
6301                        mec_owl_go.trigger('to.owl.carousel', mec_current_day);
6302                        mec_day_exist = true;
6303                        return false;
6304                    }
6305                }
6306            });
6307
6308            if (!mec_day_exist && ((mec_owl_year == mec_current_year) && (mec_owl_month == mec_current_month))) {
6309                jQuery('#mec_daily_view_day' + id + '_' + mec_g_month_id + mec_current_day).trigger('click');
6310                mec_owl_go.trigger('to.owl.carousel', mec_current_day);
6311            }
6312        }, 1000);
6313    }
6314}
6315
6316// Focus events week
6317function mec_focus_week(id, skin) {
6318    skin = skin || 'weekly';
6319    var wrap_elem = jQuery('.mec-weeks-container .mec-weekly-view-week-active').parent();
6320    var days = wrap_elem.find('dt');
6321    var week = wrap_elem.find('dl').length;
6322    var focus_week = false;
6323    var i = j = 1;
6324
6325    for (i = 1; i < week; i++) {
6326        setTimeout(function () {
6327            var event = new Event('click');
6328            jQuery('#mec_skin_' + id + ' .mec-previous-month.mec-load-week')[0].dispatchEvent(event);
6329        }, 33);
6330    }
6331
6332    days.each(function (i) {
6333        if (jQuery(this).data('events-count') > 0) {
6334            if (focus_week === false) {
6335                focus_week = parseInt(jQuery(this).parent().data('week-number'));
6336            }
6337
6338            if (skin == 'timetable') {
6339                if (parseInt(jQuery(this).parent().data('week-number')) == parseInt(jQuery('body').data('currentweek'))) {
6340                    focus_week = parseInt(jQuery(this).parent().data('week-number'));
6341                    return false;
6342                }
6343            }
6344            else {
6345                return false;
6346            }
6347        }
6348    });
6349
6350    if (focus_week !== false) {
6351        for (j = 1; j < focus_week; j++) {
6352            setTimeout(function () {
6353                var event = new Event('click');
6354                jQuery('#mec_skin_' + id + ' .mec-next-month.mec-load-week')[0].dispatchEvent(event);
6355            }, 33);
6356        }
6357    }
6358}
6359
6360// TODO must be cleaned JS codes
6361(function ($) {
6362    $(document).ready(function () {
6363        // Check RTL website
6364        if ($('body').hasClass('rtl')) {
6365            var owl_rtl = true;
6366        } else {
6367            var owl_rtl = false;
6368        }
6369
6370        // MEC WIDGET CAROUSEL
6371        $(".mec-widget .mec-event-grid-classic").each(function () {
6372            var loop_status = $(this).data('widget-loop');
6373            if (typeof loop_status === 'undefined') loop_status = 1;
6374
6375            var autoplay_status = $(this).data('widget-autoplay');
6376            if (typeof autoplay_status === 'undefined') autoplay_status = 1;
6377
6378            var autoplay_time = $(this).data('widget-autoplay-time');
6379            if (typeof autoplay_time === 'undefined') autoplay_time = 3000;
6380
6381            $(this).addClass('mec-owl-carousel mec-owl-theme');
6382            $(this).owlCarousel(
6383                {
6384                    autoplay: (autoplay_status ? true : false),
6385                    autoplayTimeout: autoplay_time,
6386                    autoplayHoverPause: (autoplay_status ? true : false),
6387                    loop: (loop_status ? true : false),
6388                    dots: false,
6389                    nav: true,
6390                    navText: ["<i class='mec-sl-arrow-left' aria-label='Previous'></i>", " <i class='mec-sl-arrow-right' aria-label='Next'></i>"],
6391                    navElement: 'button type="button" role="button"',
6392                    items: 1,
6393                    autoHeight: true,
6394                    responsiveClass: true,
6395                    rtl: owl_rtl,
6396                });
6397        });
6398
6399        // add mec-sm959 class if mec-wrap div size < 959
6400        mec_wrap_resize();
6401
6402        jQuery(window).on('resize', function () {
6403            mec_wrap_resize();
6404        });
6405
6406        // Fixed: social hover in iphone
6407        $('.mec-event-sharing-wrap').hover(function () {
6408            $(this).find('.mec-event-sharing').show(0);
6409        },
6410            function () {
6411                $(this).find('.mec-event-sharing').hide(0);
6412            });
6413
6414        // Register Booking Smooth Scroll
6415        $('a.simple-booking[href^="#mec-events-meta-group-booking"]').click(function () {
6416            if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
6417                var target = $(this.hash);
6418                target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
6419
6420                if (target.length) {
6421                    var scrollTopVal = target.offset().top - 30;
6422
6423                    if ($('body[class^="mec-events-template"]').length > 0) {
6424                        $('html, body').animate({
6425                            scrollTop: scrollTopVal
6426                        }, 600);
6427
6428                        return false;
6429
6430                    } else {
6431
6432                        return true;
6433
6434                    }
6435                }
6436            }
6437        });
6438
6439        // Load Information widget under title in mobile/tablet
6440        if ($('.single-mec-events .mec-single-event:not(.mec-single-modern)').length > 0) {
6441            if ($('.single-mec-events .mec-event-info-desktop.mec-event-meta.mec-color-before.mec-frontbox').length > 0) {
6442                var html = $('.single-mec-events .mec-event-info-desktop.mec-event-meta.mec-color-before.mec-frontbox')[0].outerHTML;
6443                if (Math.max(document.documentElement.clientWidth, window.innerWidth || 0) < 960) {
6444                    $('.single-mec-events .col-md-4 .mec-event-info-desktop.mec-event-meta.mec-color-before.mec-frontbox').remove();
6445                    $('.single-mec-events .mec-event-info-mobile').html(html)
6446                }
6447            }
6448        }
6449
6450        // FAQ
6451        $(document).on('click', '.mec-faq-toggle-icon', function () {
6452            $(this).parent().toggleClass('close');
6453        });
6454    });
6455})(jQuery);
6456
6457// Weather
6458(function ($) {
6459    // Convart fahrenheit to centigrade
6460    function convertToC(value) {
6461        return Math.round(((parseFloat(value) - 32) * 5 / 9));
6462    }
6463
6464    // Convert centigrade to fahrenheit
6465    function convertToF(value) {
6466        return Math.round(((1.8 * parseFloat(value)) + 32));
6467    }
6468
6469    // Convert miles to kilometers
6470    function MPHToKPH(value) {
6471        return Math.round(1.609344 * parseFloat(value));
6472    }
6473
6474    // Convert kilometers to miles
6475    function KPHToMPH(value) {
6476        return Math.round((0.6214 * parseFloat(value)));
6477    }
6478
6479    $(document).ready(function ($) {
6480        var degree = $('.mec-weather-summary-temp');
6481        var weather_extra = $('.mec-weather-extras');
6482        var wind = weather_extra.children('.mec-weather-wind');
6483        var visibility = weather_extra.children('.mec-weather-visibility');
6484        var feelslike = weather_extra.children('.mec-weather-feels-like');
6485
6486        //  Events
6487        $('.degrees-mode').on('click', function () {
6488            var degree_mode = degree.children('var').text().trim();
6489            var wind_text = wind.text().substring(5);
6490            var visibility_text = visibility.text().substring(11);
6491            var feelslike_text = feelslike.text().substring(12);
6492
6493            if (degree_mode == degree.data('c').trim()) {
6494                degree.html(convertToF(parseInt(degree.text())) + ' <var>' + degree.data('f') + '</var>');
6495                feelslike.html('<span>Feels Like:</span> ' + convertToF(parseInt(feelslike_text)) + ' <var>' + feelslike.data('f') + '</var>');
6496                wind.html('<span>Wind:</span> ' + KPHToMPH(parseInt(wind_text)) + '<var>' + wind.data('mph') + '</var>');
6497                visibility.html('<span>Visibility:</span> ' + KPHToMPH(parseInt(visibility_text)) + '<var>' + visibility.data('mph') + '</var>');
6498                $(this).text($(this).data('metric'));
6499            }
6500            else if (degree_mode == degree.data('f').trim()) {
6501                degree.html(convertToC(parseInt(degree.text())) + ' <var>' + degree.data('c') + '</var>');
6502                feelslike.html('<span>Feels Like:</span> ' + convertToC(parseInt(feelslike_text)) + ' <var>' + feelslike.data('c') + '</var>');
6503                wind.html('<span>Wind:</span> ' + MPHToKPH(parseInt(wind_text)) + '<var>' + wind.data('kph') + '</var>');
6504                visibility.html('<span>Visibility:</span> ' + MPHToKPH(parseInt(visibility_text)) + '<var>' + visibility.data('kph') + '</var>');
6505                $(this).text($(this).data('imperial'));
6506            }
6507        });
6508
6509        $('a').on('click', function () { });
6510
6511        // FES Speakers Adding - Name Only
6512        $('#mec_add_speaker_button').on('click', function () {
6513            const $this = this;
6514            const content = $($this).parent().find('input');
6515            const list = $('#mec-fes-speakers-list');
6516            const key = list.find('.mec-error').length;
6517
6518            $($this).prop("disabled", true).css('cursor', 'wait');
6519            $.post(ajaxurl, {
6520                action: "mec_speaker_adding",
6521                content: content.val(),
6522                fes_nonce: mecdata.fes_nonce,
6523                key: key
6524            })
6525                .done(function (data) {
6526                    if ($(data).hasClass('mec-error')) {
6527                        list.prepend(data);
6528                        setTimeout(function () {
6529                            $('#mec-speaker-error-${key}').remove();
6530                        }, 1500);
6531                    } else {
6532                        list.html(data);
6533                        content.val('');
6534                    }
6535
6536                    $($this).prop("disabled", false).css('cursor', 'pointer');
6537                });
6538        });
6539
6540        // FES Speaker Adding - Full Details
6541        $('#mec_add_full_speaker_button').on('click', function () {
6542            const $this = this;
6543            const list = $('#mec-fes-speakers-list');
6544            const name = $('#mec_speaker_full_info_name');
6545            const type = $('#mec_speaker_full_info_type');
6546            const job_title = $('#mec_speaker_full_info_job_title');
6547            const tel = $('#mec_speaker_full_info_tel');
6548            const email = $('#mec_speaker_full_info_email');
6549            const website = $('#mec_speaker_full_info_website');
6550            const facebook = $('#mec_speaker_full_info_facebook');
6551            const instagram = $('#mec_speaker_full_info_instagram');
6552            const linkedin = $('#mec_speaker_full_info_linkedin');
6553            const twitter = $('#mec_speaker_full_info_twitter');
6554            const image = $('#mec_fes_speaker_thumbnail');
6555            const key = list.find('.mec-error').length;
6556
6557            $($this).prop("disabled", true).css('cursor', 'wait');
6558            $.post(ajaxurl, {
6559                action: "mec_speaker_adding",
6560                name: name.val(),
6561                type: type.val(),
6562                job_title: job_title.val(),
6563                tel: tel.val(),
6564                email: email.val(),
6565                website: website.val(),
6566                facebook: facebook.val(),
6567                instagram: instagram.val(),
6568                linkedin: linkedin.val(),
6569                twitter: twitter.val(),
6570                image: image.val(),
6571                fes_nonce: mecdata.fes_nonce,
6572                key: key
6573            })
6574                .done(function (data) {
6575                    if ($(data).hasClass('mec-error')) {
6576                        list.prepend(data);
6577                        setTimeout(function () {
6578                            $('#mec-speaker-error-${key}').remove();
6579                        }, 1500);
6580                    } else {
6581                        list.html(data);
6582                        name.val('');
6583                        type.val('');
6584                        job_title.val('');
6585                        tel.val('');
6586                        email.val('');
6587                        website.val('');
6588                        facebook.val('');
6589                        instagram.val('');
6590                        linkedin.val('');
6591                        twitter.val('');
6592
6593                        $('#mec_fes_speaker_remove_image_button').trigger('click');
6594                    }
6595
6596                    $($this).prop("disabled", false).css('cursor', 'pointer');
6597                });
6598        });
6599
6600        // FES Sponsor Adding - Name Only
6601        $('#mec_add_sponsor_button').on('click', function () {
6602            const $this = this;
6603            const content = $($this).parent().find('input');
6604            const list = $('#mec-fes-sponsors-list');
6605            const key = list.find('.mec-error').length;
6606
6607            $($this).prop("disabled", true).css('cursor', 'wait');
6608            $.post(ajaxurl, {
6609                action: "mec_sponsor_adding",
6610                content: content.val(),
6611                fes_nonce: mecdata.fes_nonce,
6612                key: key
6613            })
6614                .done(function (data) {
6615                    if ($(data).hasClass('mec-error')) {
6616                        list.prepend(data);
6617                        setTimeout(function () {
6618                            $('#mec-sponsor-error-${key}').remove();
6619                        }, 1500);
6620                    } else {
6621                        list.html(data);
6622                        content.val('');
6623                    }
6624
6625                    $($this).prop("disabled", false).css('cursor', 'pointer');
6626                });
6627        });
6628
6629        // FES Sponsor Adding - Full Details
6630        $('#mec_add_full_sponsor_button').on('click', function () {
6631            const $this = this;
6632            const list = $('#mec-fes-sponsors-list');
6633            const name = $('#mec_sponsor_full_info_name');
6634            const url = $('#mec_sponsor_full_info_url');
6635            const image = $('#mec_fes_sponsor_thumbnail');
6636            const key = list.find('.mec-error').length;
6637
6638            $($this).prop("disabled", true).css('cursor', 'wait');
6639            $.post(ajaxurl, {
6640                action: "mec_sponsor_adding",
6641                name: name.val(),
6642                url: url.val(),
6643                image: image.val(),
6644                fes_nonce: mecdata.fes_nonce,
6645                key: key
6646            })
6647                .done(function (data) {
6648                    if ($(data).hasClass('mec-error')) {
6649                        list.prepend(data);
6650                        setTimeout(function () {
6651                            $('#mec-sponsor-error-${key}').remove();
6652                        }, 1500);
6653                    } else {
6654                        list.html(data);
6655                        name.val('');
6656                        url.val('');
6657
6658                        $('#mec_fes_sponsor_remove_image_button').trigger('click');
6659                    }
6660
6661                    $($this).prop("disabled", false).css('cursor', 'pointer');
6662                });
6663        });
6664
6665        // Check RTL website
6666        var owl_rtl = $('body').hasClass('rtl') ? true : false;
6667
6668        // MEC FES Date Item Event
6669        $(document).on('click', '.mec-export-list-wrapper .mec-export-list-item', function () {
6670            $('.mec-export-list-item').removeClass('fes-export-date-active');
6671            $(this).addClass('fes-export-date-active');
6672        });
6673
6674        // MEC BuddyPress Integration Attendees Modules
6675        var mec_bd_attendees_modules = $('.mec-attendees-list-details > ul > li');
6676        mec_bd_attendees_modules.click(function () {
6677            $(this).find('.mec-attendees-toggle').toggle();
6678        });
6679
6680        // MEC FES export csv
6681        $(document).on('click', '.mec-event-export-csv, .mec-event-export-excel', function () {
6682            var mec_event_id = $(this).parent().parent().data('event-id');
6683
6684            var time = $(this).parent().parent().find($('.fes-export-date-active')).data('time');
6685            if (typeof time === 'undefined') time = 0;
6686
6687            var type = $(this).hasClass('mec-event-export-excel') ? 'ms-excel' : 'csv';
6688
6689            var url = mecdata.ajax_url + "?action=mec_fes_csv_export&fes_nonce=" + mecdata.fes_nonce + "&mec_event_id=" + mec_event_id + "&timestamp=" + time + "&type=" + type;
6690
6691            window.location = url;
6692        });
6693    });
6694})(jQuery);
6695
6696function mec_book_form_submit(event, unique_id) {
6697    event.preventDefault();
6698    window["mec_book_form_submit" + unique_id]();
6699}
6700
6701function mec_book_form_back_btn_cache(context, unique_id) {
6702    var id = jQuery(context).attr('id');
6703    var mec_form_data = jQuery('#mec_book_form' + unique_id).serializeArray();
6704
6705    if (id == "mec-book-form-btn-step-1") jQuery('body').data('mec-book-form-step-1', jQuery('#mec_booking' + unique_id).html()).data('unique-id', unique_id).data('mec-book-form-data-step-1', mec_form_data);
6706    else if (id == "mec-book-form-btn-step-2") jQuery('body').data('mec-book-form-step-2', jQuery('#mec_booking' + unique_id).html()).data('mec-book-form-data-step-2', mec_form_data);
6707}
6708
6709function mec_agreement_change(context) {
6710    var status = jQuery(context).is(":checked");
6711
6712    if (status) jQuery(context).prop("checked", "checked");
6713    else jQuery(context).removeProp("checked");
6714}
6715
6716function mec_book_form_back_btn_click(context, unique_id) {
6717    var id = jQuery(context).attr('id');
6718    unique_id = jQuery('body').data('unique-id');
6719
6720    jQuery('#mec_booking_message' + unique_id).hide();
6721    if (id == "mec-book-form-back-btn-step-2") {
6722        var mec_form_data_step_1 = jQuery('body').data('mec-book-form-data-step-1');
6723
6724        jQuery('#mec_booking' + unique_id).html(jQuery('body').data('mec-book-form-step-1'));
6725        jQuery.each(mec_form_data_step_1, function (index, object_item) {
6726            if (object_item.name === 'book[date][]') {
6727                jQuery('[value="' + object_item.value + '"]').prop('checked', true);
6728            }
6729            else jQuery('[name="' + object_item.name + '"]').val(object_item.value);
6730        });
6731
6732        // Booking Refresh Recaptcha When Back Button Click.
6733        var recaptcha_check = jQuery('#mec_booking' + unique_id).find('#g-recaptcha').length;
6734        if (recaptcha_check != 0) {
6735            jQuery('#g-recaptcha').html('');
6736            grecaptcha.render("g-recaptcha", {
6737                sitekey: mecdata.recapcha_key
6738            });
6739        }
6740
6741        mec_init_number_spinner();
6742
6743        var event_id = jQuery('input[name="event_id"]').val();
6744        var date = jQuery('#mec_book_form_date' + unique_id).val();
6745
6746        // Update Availability
6747        window['mec_get_tickets_availability' + unique_id](event_id, date);
6748    }
6749    else if (id == "mec-book-form-back-btn-step-3") {
6750        var mec_form_data_step_2 = jQuery('body').data('mec-book-form-data-step-2');
6751
6752        jQuery('#mec_booking' + unique_id).html(jQuery('body').data('mec-book-form-step-2'));
6753        jQuery.each(mec_form_data_step_2, function (index, object_item) {
6754            var mec_elem = jQuery('[name="' + object_item.name + '"]');
6755            var mec_type = mec_elem.attr('type');
6756
6757            if ((mec_type == 'checkbox' || mec_type == 'radio')) {
6758                var mec_elem_len = jQuery('[name="' + object_item.name + '"]').length;
6759
6760                if (mec_elem_len > 1) {
6761                    var id = '#' + mec_elem.attr('id').match(/mec_book_reg_field_reg.*_/g) + object_item.value.toLowerCase();
6762                    jQuery(id).prop('checked', true);
6763                }
6764                else {
6765                    mec_elem.prop('checked', true);
6766                }
6767            }
6768
6769            mec_elem.val(object_item.value);
6770        });
6771    }
6772}
6773
6774// Google map Skin
6775function gmapSkin(NewJson, id) {
6776    var gmap_temp = jQuery("#gmap-data-" + id);
6777    var beforeJson = gmap_temp.val();
6778    if (typeof beforeJson === 'undefined') beforeJson = '';
6779
6780    var newJson = NewJson;
6781    let jsonPush = (typeof beforeJson != 'undefined' && beforeJson.trim() == "") ? [] : JSON.parse(beforeJson);
6782    var pushState = jsonPush.length < 1 ? false : true;
6783
6784    for (var key in newJson) {
6785        if (pushState) {
6786            jsonPush.forEach(function (Item, Index) {
6787                var render_location = jsonPush[Index].latitude + "," + jsonPush[Index].longitude;
6788                if (key.trim() == render_location.trim()) {
6789                    // LightBox Count Update
6790                    newJson[key].count = newJson[key].count + jsonPush[Index].count;
6791
6792                    // LightBox Ids Update
6793                    newJson[key].event_ids = newJson[key].event_ids.concat(jsonPush[Index].event_ids);
6794
6795                    // LightBox Initialize
6796                    var dom = jQuery(newJson[key].lightbox).find("div:nth-child(2)");
6797                    var main_items = dom.html();
6798                    var new_items = jQuery(jsonPush[Index].lightbox).find("div:nth-child(2)").html();
6799
6800                    var render_items = dom.html(main_items + new_items).html();
6801                    var new_info_lightbox = '<div><div class="mec-event-detail mec-map-view-event-detail"><i class="mec-sl-map-marker"></i> ' + newJson[key].name + '</div><div>' + render_items + '</div></div>';
6802                    newJson[key].lightbox = new_info_lightbox;
6803
6804                    // LightBox info
6805                    var new_info_window = '<div class="mec-marker-infowindow-wp"><div class="mec-marker-infowindow-count">' + newJson[key].count + '</div><div class="mec-marker-infowindow-content"><span>Event at this location</span><span>' + newJson[key].name + '</span></div></div>';
6806                    newJson[key].infowindow = new_info_window;
6807
6808                    // Remove before values of this location
6809                    jsonPush.splice(Index, 1);
6810                }
6811            });
6812        }
6813
6814        jsonPush.push(newJson[key]);
6815    }
6816
6817    gmap_temp.val(JSON.stringify(jsonPush));
6818    return jsonPush;
6819}
6820
6821// Fluent Scripts
6822jQuery(document).ready(function () {
6823    if (jQuery('.mec-fluent-wrap').length < 0) {
6824        return;
6825    }
6826    // Events
6827    jQuery(window).on('resize', mecFluentToggoleDisplayValueFilterContent);
6828    jQuery(document).on('click', '.mec-fluent-wrap .mec-filter-icon', mecFluentToggleFilterContent);
6829    jQuery(document).on('click', '.mec-fluent-wrap .mec-more-events-icon', mecFluentToggleMoreEvents);
6830    jQuery(document).on('click', '.mec-fluent-wrap .mec-yearly-calendar', mecFluentYearlyCalendar);
6831    jQuery(document).on('click', mecFluentOutsideEvent);
6832    jQuery(document).on('click', '.mec-fluent-more-views-icon', mecFluentMoreViewsContent);
6833    jQuery(document).on('change', '.mec-fluent-wrap .mec-filter-content select, .mec-fluent-wrap .mec-filter-content input', mecFluentSmartFilterIcon);
6834    // Run
6835    mecFluentTimeTableUI();
6836    mecFluentUI();
6837    mecFluentNiceSelect();
6838    mecFluentWrapperFullScreenWidth();
6839    jQuery(window).on('load', mecFluentWrapperFullScreenWidth);
6840    jQuery(window).on('load', mecFluentCurrentTimePosition);
6841    jQuery(window).on('resize', mecFluentWrapperFullScreenWidth);
6842    jQuery(window).on('resize', mecFluentTimeTableUI);
6843    mecFluentSliderUI();
6844    mecFluentFullCalendar();
6845    jQuery(window).on('resize', mecFluentFullCalendar);
6846    mecFluentCustomScrollbar();
6847});
6848
6849function mecFluentSinglePage() {
6850    if (jQuery().niceScroll) {
6851        jQuery('.mec-single-fluent-body .featherlight .mec-single-fluent-wrap').niceScroll({
6852            horizrailenabled: false,
6853            cursorcolor: '#C1C5C9',
6854            cursorwidth: '4px',
6855            cursorborderradius: '4px',
6856            cursorborder: 'none',
6857            railoffset: {
6858                left: 10,
6859            }
6860        });
6861    }
6862}
6863
6864function mecFluentFullCalendar() {
6865    if (jQuery('.mec-fluent-wrap.mec-skin-full-calendar-container').length > 0) {
6866        var widowWidth = jQuery(window).innerWidth();
6867        if (widowWidth <= 767) {
6868            jQuery('.mec-fluent-wrap.mec-skin-full-calendar-container .mec-skin-monthly-view-month-navigator-container, .mec-fluent-wrap.mec-skin-full-calendar-container .mec-calendar-a-month, .mec-fluent-wrap.mec-skin-full-calendar-container .mec-yearly-title-sec').css({
6869                paddingTop: jQuery('.mec-fluent-wrap.mec-skin-full-calendar-container').children('.mec-totalcal-box').height() + 40,
6870            });
6871        } else {
6872            jQuery('.mec-fluent-wrap.mec-skin-full-calendar-container .mec-skin-monthly-view-month-navigator-container, .mec-fluent-wrap.mec-skin-full-calendar-container .mec-calendar-a-month, .mec-fluent-wrap.mec-skin-full-calendar-container .mec-yearly-title-sec').css({
6873                paddingTop: 32,
6874            });
6875        }
6876    }
6877}
6878
6879function mecFluentSmartFilterIcon() {
6880    var filterContent = jQuery(this).closest('.mec-filter-content');
6881    var hasValue = false;
6882    if (jQuery(this).closest('.mec-date-search').length > 0) {
6883        var yearValue = jQuery(this).closest('.mec-date-search').find('select[id*="mec_sf_year"]').val();
6884        var monthValue = jQuery(this).closest('.mec-date-search').find('select[id*="mec_sf_month"]').val();
6885        if ((yearValue == 'none' && monthValue == 'none') || (yearValue != 'none' && monthValue != 'none')) {
6886            filterContent.hide();
6887            if ((yearValue != 'none' && monthValue != 'none')) {
6888                hasValue = true;
6889            } else {
6890                hasValue = false;
6891            }
6892        } else {
6893            return false;
6894        }
6895    } else {
6896        filterContent.hide();
6897    }
6898    if (!hasValue) {
6899        filterContent.find(':not(.mec-date-search)').find('select, input:not([type="hidden"])').each(function () {
6900            if (jQuery(this).val()) {
6901                hasValue = true;
6902                return false;
6903            }
6904        });
6905    }
6906    if (hasValue) {
6907        jQuery(this).closest('.mec-search-form').find('.mec-filter-icon').addClass('active');
6908    } else {
6909        jQuery(this).closest('.mec-search-form').find('.mec-filter-icon').removeClass('active');
6910    }
6911}
6912
6913function mecFluentMoreViewsContent() {
6914    jQuery(this).find('.mec-fluent-more-views-content').toggleClass('active');
6915}
6916
6917function mecFluentWrapperFullScreenWidth() {
6918    if (jQuery('.mec-fluent-bg-wrap').length > 0) {
6919        jQuery('.mec-fluent-bg-wrap').css({
6920            maxWidth: jQuery('body').width() + 8,
6921        });
6922    }
6923}
6924
6925function mecFluentUI() {
6926    if (typeof mecdata != 'undefined' && typeof mecdata.enableSingleFluent != 'undefined' && mecdata.enableSingleFluent) {
6927        jQuery('body').addClass('mec-single-fluent-body');
6928    }
6929    // Set filter content position
6930    jQuery(window).on('load resize', function () {
6931        if (jQuery('.mec-filter-content').length > 0) {
6932            jQuery('.mec-filter-content').css({
6933                right: -(jQuery('.mec-calendar').width() - jQuery('.mec-search-form.mec-totalcal-box').position().left - jQuery('.mec-search-form.mec-totalcal-box').width() + 40),
6934                left: -jQuery('.mec-search-form.mec-totalcal-box').position().left + 40,
6935            });
6936        }
6937        if (jQuery('.mec-filter-icon').is(':visible')) {
6938            var filterIconLeftPosition = parseInt(jQuery('.mec-search-form.mec-totalcal-box').position().left) + parseInt(jQuery('.mec-filter-icon').position().left) - 25;
6939            jQuery('head').find('style[title="mecFluentFilterContentStyle"]').remove().end().append('<style title="mecFluentFilterContentStyle">.mec-fluent-wrap .mec-filter-content:before{left: ' + filterIconLeftPosition + 'px;}.mec-fluent-wrap .mec-filter-content:after{left: ' + (filterIconLeftPosition + 1) + 'px;}</style>');
6940        }
6941    });
6942    // Hide empty filter content
6943    if (jQuery('.mec-filter-content').is(':empty')) {
6944        jQuery('.mec-filter-icon').hide();
6945    }
6946    // Prevend Default For Event Share Icon
6947    jQuery(document).on('click keydown', '.mec-event-share-icon', function (e) {
6948        if (e.type === 'keydown' && e.key !== 'Enter' && e.key !== ' ') return;
6949        e.preventDefault();
6950
6951        var $wrap = jQuery(this).closest('.mec-event-sharing-wrap');
6952        var isOpen = $wrap.hasClass('active');
6953
6954        // Close all other share popups
6955        jQuery('.mec-event-sharing-wrap.active').not($wrap).removeClass('active').find('.mec-event-share-icon').attr('aria-expanded', 'false');
6956
6957        // Toggle current
6958        $wrap.toggleClass('active');
6959        jQuery(this).attr('aria-expanded', !isOpen);
6960    });
6961
6962    // Close share popup on Escape
6963    jQuery(document).on('keydown', '.mec-event-sharing-wrap.active .mec-event-share-icon', function (e) {
6964        if (e.key === 'Escape') {
6965            var $wrap = jQuery(this).closest('.mec-event-sharing-wrap');
6966            $wrap.removeClass('active');
6967            jQuery(this).attr('aria-expanded', 'false').focus();
6968        }
6969    });
6970
6971    // Close share popup when clicking outside
6972    jQuery(document).on('click', function (e) {
6973        if (!jQuery(e.target).closest('.mec-event-sharing-wrap').length) {
6974            jQuery('.mec-event-sharing-wrap.active').removeClass('active').find('.mec-event-share-icon').attr('aria-expanded', 'false');
6975        }
6976    });
6977}
6978
6979function mecFluentCurrentTimePosition() {
6980    if (jQuery('.mec-fluent-wrap').length > 0) {
6981        jQuery('.mec-fluent-current-time').each(function () {
6982            var currentTimeMinutes = jQuery(this).data('time');
6983            var height = jQuery(this).closest('.mec-fluent-current-time-cell').height();
6984            jQuery(this).css({
6985                top: (currentTimeMinutes / 60) * height,
6986            });
6987        });
6988    }
6989}
6990
6991function mecFluentNiceSelect() {
6992    if (jQuery('.mec-fluent-wrap').length < 0) {
6993        return;
6994    }
6995
6996    if (jQuery().niceSelect) {
6997        jQuery('.mec-fluent-wrap').find('.mec-filter-content').find('select').niceSelect();
6998    }
6999}
7000
7001function mecFluentCustomScrollbar(y) {
7002
7003    jQuery(document).trigger('mec_custom_scrollbar_init', [y]);
7004
7005    if (jQuery('.mec-fluent-wrap').length < 0) {
7006        return;
7007    }
7008
7009    if (jQuery().niceScroll) {
7010        jQuery('.mec-custom-scrollbar').niceScroll({
7011            cursorcolor: '#C7EBFB',
7012            cursorwidth: '4px',
7013            cursorborderradius: '4px',
7014            cursorborder: 'none',
7015            railoffset: {
7016                left: -2,
7017            }
7018        });
7019        jQuery('.mec-custom-scrollbar').getNiceScroll().resize();
7020        jQuery('.mec-custom-scrollbar').each(function () {
7021            if (jQuery(this).find('.mec-fluent-current-time-cell').length > 0) {
7022                var parentTopOffset = jQuery(this).offset().top;
7023                var currentTimeCellOffset = jQuery(this).find('.mec-fluent-current-time-cell').offset().top;
7024                jQuery(this).getNiceScroll(0).doScrollTop(currentTimeCellOffset - parentTopOffset - 16, 120);
7025                jQuery(this).on('scroll', function () {
7026                    if (jQuery(this).getNiceScroll(0).scroll.y != 0) {
7027                        jQuery(this).addClass('mec-scrolling');
7028                    } else {
7029                        jQuery(this).removeClass('mec-scrolling');
7030                    }
7031                });
7032            }
7033            if (typeof y != 'undefined') {
7034                if (jQuery(this).closest('.mec-skin-list-wrap').length > 0 || jQuery(this).closest('.mec-skin-grid-wrap').length > 0) {
7035                    jQuery(this).getNiceScroll(0).doScrollTop(0, 120);
7036                }
7037            }
7038        });
7039    }
7040}
7041
7042function mecFluentTimeTableUI() {
7043    jQuery('.mec-fluent-wrap.mec-timetable-wrap .mec-cell').css('min-height', 0);
7044    var maxHeight = Math.max.apply(null, jQuery('.mec-fluent-wrap.mec-timetable-wrap .mec-cell').map(function () {
7045        return jQuery(this).height();
7046    }).get());
7047    maxHeight = maxHeight > 87 ? maxHeight : 87;
7048    jQuery('.mec-fluent-wrap.mec-timetable-wrap .mec-cell').css('min-height', maxHeight + 2);
7049}
7050
7051function mecFluentSliderUI() {
7052    jQuery(window).on('load', function () {
7053        if (typeof mecdata === 'undefined') return;
7054
7055        jQuery('.mec-fluent-wrap.mec-skin-slider-container .owl-next').prepend('<span>' + mecdata.next + '</span>');
7056        jQuery('.mec-fluent-wrap.mec-skin-slider-container .owl-prev').append('<span>' + mecdata.prev + '</span>');
7057    });
7058}
7059
7060function mecFluentToggleFilterContent(e) {
7061    e.preventDefault();
7062    if (jQuery('.mec-filter-content').is(':visible')) {
7063        jQuery('.mec-filter-content').css({
7064            display: 'none',
7065        });
7066    } else {
7067        const displayValue = jQuery(window).width() <= 790 ? 'block' : 'flex';
7068        jQuery('.mec-filter-content').css({
7069            display: displayValue,
7070        });
7071    }
7072}
7073
7074function mecFluentToggoleDisplayValueFilterContent() {
7075    const displayValue = jQuery(window).width() <= 767 ? 'block' : 'flex';
7076    if (jQuery('.mec-filter-content').is(':visible')) {
7077        jQuery('.mec-filter-content').css({
7078            display: displayValue,
7079        });
7080    }
7081}
7082
7083function mecFluentToggleMoreEvents(e) {
7084    e.preventDefault();
7085    const moreEventsWrap = jQuery(this).siblings('.mec-more-events-wrap');
7086    const moreEvents = moreEventsWrap.children('.mec-more-events');
7087    jQuery('.mec-more-events-wrap').removeClass('active');
7088    moreEventsWrap.addClass('active');
7089    jQuery('.mec-more-events-wrap:not(.active)').hide();
7090    if (moreEventsWrap.is(':visible')) {
7091        moreEventsWrap.hide();
7092    } else {
7093        topElement = moreEventsWrap.closest('.mec-more-events-inner-controller').length > 0 ? moreEventsWrap.closest('.mec-more-events-inner-controller') : moreEventsWrap.closest('.mec-more-events-controller');
7094        moreEventsWrap.show().css({
7095            top: topElement.offset().top - window.scrollY,
7096            left: moreEventsWrap.closest('.mec-more-events-controller').offset().left,
7097            width: moreEventsWrap.closest('.mec-more-events-controller').width(),
7098        });
7099        if (moreEventsWrap.width() > 400) {
7100            moreEvents.css({
7101                left: (moreEventsWrap.width() / 2) - (moreEvents.width() / 2),
7102                width: 400,
7103            });
7104        } else {
7105            moreEvents.css({
7106                width: moreEventsWrap.width(),
7107                left: 0,
7108            });
7109        }
7110    }
7111}
7112
7113function mecFluentOutsideEvent(e) {
7114    if (!jQuery(e.target).is('.mec-more-events-icon') && !jQuery(e.target).closest('.mec-more-events-wrap').length) {
7115        jQuery('.mec-more-events-wrap').hide();
7116    }
7117    if (!jQuery(e.target).is('.mec-filter-icon') && !jQuery(e.target).closest('.mec-filter-content').length) {
7118        jQuery('.mec-filter-content').hide();
7119    }
7120    if (!jQuery(e.target).is('.mec-fluent-more-views-icon') && !jQuery(e.target).closest('.mec-fluent-more-views-content').length) {
7121        jQuery('.mec-fluent-more-views-content').removeClass('active');
7122    }
7123}
7124
7125function mecFluentYearlyCalendar() {
7126    const monthNum = jQuery(this).data('month');
7127    const monthName = jQuery(this).find('.mec-calendar-table-title').text();
7128    jQuery('.mec-fluent-wrap').find('.mec-yearly-calendar').removeClass('active');
7129    jQuery(this).addClass('active')
7130        .closest('.mec-year-container')
7131        .find('.mec-yearly-agenda-sec-title span').text(monthName).end()
7132        .find('.mec-events-agenda').addClass('mec-util-hidden').end()
7133        .find('.mec-events-agenda[data-month=' + monthNum + ']').removeClass('mec-util-hidden');
7134    mecFluentCustomScrollbar();
7135}
7136
7137function mecFluentYearlyUI(eventID, yearID) {
7138    var fluentWrap = jQuery('#mec_skin_' + eventID + '.mec-fluent-wrap');
7139    if (fluentWrap.length < 0) {
7140        return;
7141    }
7142    var monthNum = fluentWrap.find('.mec-year-container[data-year-id=' + yearID + ']').find('.mec-events-agenda:not(.mec-util-hidden)').data('month');
7143    var activeMonth = fluentWrap.find('.mec-year-container[data-year-id=' + yearID + ']').find('.mec-yearly-calendar[data-month=' + monthNum + ']');
7144    var activeMonthName = activeMonth.find('.mec-calendar-table-title').text();
7145    activeMonth.addClass('active');
7146}
7147
7148// MEC LIST VIEW Fluent PLUGIN
7149(function ($) {
7150    $.fn.mecListViewFluent = function (options) {
7151        var active_month;
7152        var active_year;
7153
7154        // Default Options
7155        var settings = $.extend({
7156            // These are the defaults.
7157            today: null,
7158            id: 0,
7159            events_label: 'Events',
7160            event_label: 'Event',
7161            month_navigator: 0,
7162            atts: '',
7163            active_month: {},
7164            next_month: {},
7165            sf: {},
7166            ajax_url: '',
7167        }, options);
7168
7169        mecFluentCustomScrollbar();
7170
7171        initLoadMore('#mec_list_view_month_' + settings.id + '_' + settings.month_i
7171d);
7172
7173        function initLoadMore(monthID) {
7174            $(monthID).off().on('click', '.mec-load-more-button', function () {
7175                loadMore(this);
7176            });
7177        }
7178
7179        function loadMore(This) {
7180            // Add loading Class
7181            var currentLoadMore = $(This);
7182            currentLoadMore.addClass("mec-load-more-loading");
7183            var endDate = currentLoadMore.data('end-date');
7184            var maximumDate = currentLoadMore.data('maximum-date');
7185            var nextOffset = currentLoadMore.data('next-offset');
7186            var year = currentLoadMore.data('year');
7187            var month = currentLoadMore.data('month');
7188
7189            $.ajax({
7190                url: settings.ajax_url,
7191                data: "action=mec_list_load_more&mec_year=" + year + "&mec_month=" + month + "&mec_maximum_date=" + maximumDate + "&mec_start_date=" + endDate + "&mec_offset=" + nextOffset + "&" + settings.atts + "&current_month_divider=0&apply_sf_date=0",
7192                dataType: "json",
7193                type: "post",
7194                success: function (response) {
7195                    currentLoadMore.parent().remove();
7196                    if (response.count != '0') {
7197                        // Append Items
7198                        $('#mec_list_view_month_' + settings.id + '_' + response.current_month.id).append(response.month);
7199
7200                        // Single Event Method
7201                        if (settings.sed_method != '0') {
7202                            sed();
7203                        }
7204
7205                        mecFluentCustomScrollbar();
7206                        initLoadMore('#mec_list_view_month_' + settings.id + '_' + response.current_month.id);
7207                    }
7208
7209                    $(document).trigger('mec_load_more_init', ['list', settings]);
7210                },
7211                error: function () { }
7212            });
7213        }
7214
7215        // Initialize Month Navigator
7216        if (settings.month_navigator) initMonthNavigator();
7217
7218        // Load Next Month in background
7219        setMonth(settings.next_month.year, settings.next_month.month, true);
7220
7221        var initMonth;
7222        var initYear;
7223        active_month = initMonth = settings.active_month.month;
7224        active_year = initYear = settings.active_month.year;
7225
7226        // Search Widget
7227        if (settings.sf.container !== '') {
7228            sf = $(settings.sf.container).mecSearchForm({
7229                id: settings.id,
7230                refine: settings.sf.refine,
7231                ajax_url: settings.ajax_url,
7232                start_date: settings.start_date,
7233                atts: settings.atts,
7234                callback: function (atts) {
7235                    settings.atts = atts;
7236                    search(active_year, active_month);
7237                }
7238            });
7239
7240            $(settings.sf.container).addClass('mec-skin-search-init');
7241        }
7242
7243        // Single Event Method
7244        if (settings.sed_method != '0') {
7245            sed();
7246        }
7247
7248        function initMonthNavigator() {
7249            $("#mec_skin_" + settings.id + " .mec-load-month").off().on("click", function () {
7250                var year = $(this).data("mec-year");
7251                var month = $(this).data("mec-month");
7252                setMonth(year, month, false, true);
7253            });
7254        }
7255
7256        function parseQuery(queryString) {
7257            var query = {};
7258            var pairs = (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&');
7259            for (var i = 0; i < pairs.length; i++) {
7260                var pair = pairs[i].split('=');
7261                query[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || '');
7262            }
7263            return query;
7264        }
7265
7266        function updateQueryStringParameter(uri, key, val) {
7267            return uri
7268                .replace(RegExp("([?&]" + key + "(?=[=&#]|$)[^#&]*|(?=#|$))"), "&" + key + "=" + encodeURIComponent(val));
7269        }
7270
7271        function search(year, month) {
7272            // Add Loading Class
7273            if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
7274            jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
7275
7276            var ObjAtts = parseQuery(settings.atts);
7277            if (!(ObjAtts['sf[month'] || ObjAtts['sf[year]'])) {
7278                settings.atts = updateQueryStringParameter(settings.atts.trim(), 'sf[year]', initYear);
7279                settings.atts = updateQueryStringParameter(settings.atts.trim(), 'sf[month]', initMonth);
7280            }
7281
7282            $.ajax({
7283                url: settings.ajax_url,
7284                data: "action=mec_list_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=1",
7285                dataType: "json",
7286                type: "post",
7287                success: function (response) {
7288                    active_month = response.current_month.month;
7289                    active_year = response.current_month.year;
7290
7291                    // Append Month
7292                    $("#mec_skin_events_" + settings.id).html('<div class="mec-month-container" id="mec_list_view_month_' + settings.id + '_' + response.current_month.id + '" data-month-id="' + response.current_month.id + '">' + response.month + '</div>');
7293
7294                    // Append Month Navigator
7295                    $("#mec_skin_" + settings.id + " .mec-skin-list-view-month-navigator-container").html('<div class="mec-month-navigator" id="mec_month_navigator_' + settings.id + '_' + response.current_month.id + '">' + response.navigator + '</div>');
7296
7297                    // Re-initialize Month Navigator
7298                    initMonthNavigator();
7299
7300                    // Toggle Month
7301                    toggleMonth(response.current_month.id);
7302
7303                    initLoadMore('#mec_list_view_month_' + settings.id + '_' + response.current_month.id);
7304
7305                    // Remove loading Class
7306                    $('.mec-modal-result').removeClass("mec-month-navigator-loading");
7307
7308                    mecFluentCustomScrollbar();
7309
7310                    $(document).trigger('mec_search_process_end', { r: response, settings_id: settings.id });
7311
7312                    $(document).trigger('mec_search_init', ['list', settings, response]);
7313                },
7314                error: function () { }
7315            });
7316        }
7317
7318        function setMonth(year, month, do_in_background, navigator_click) {
7319            if (typeof do_in_background === "undefined") do_in_background = false;
7320            navigator_click = navigator_click || false;
7321            var month_id = year + "" + month;
7322
7323            if (!do_in_background) {
7324                active_month = month;
7325                active_year = year;
7326            }
7327
7328            // Month exists so we just show it
7329            if ($("#mec_list_view_month_" + settings.id + "_" + month_id).length) {
7330                // Toggle Month
7331                toggleMonth(month_id);
7332                mecFluentCustomScrollbar(0);
7333            } else {
7334                if (!do_in_background) {
7335                    // Add Loading Class
7336                    if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
7337                    jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
7338                }
7339
7340                $.ajax({
7341                    url: settings.ajax_url,
7342                    data: "action=mec_list_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=0" + "&navigator_click=" + navigator_click,
7343                    dataType: "json",
7344                    type: "post",
7345                    success: function (response) {
7346                        // Append Month
7347                        $("#mec_skin_events_" + settings.id).append('<div class="mec-month-container" id="mec_list_view_month_' + settings.id + '_' + response.current_month.id + '" data-month-id="' + response.current_month.id + '">' + response.month + '</div>');
7348
7349                        // Append Month Navigator
7350                        $("#mec_skin_" + settings.id + " .mec-skin-list-view-month-navigator-container").append('<div class="mec-month-navigator" id="mec_month_navigator_' + settings.id + '_' + response.current_month.id + '">' + response.navigator + '</div>');
7351
7352                        // Re-initialize Month Navigator
7353                        initMonthNavigator();
7354                        initLoadMore('#mec_list_view_month_' + settings.id + '_' + response.current_month.id);
7355
7356                        if (!do_in_background) {
7357                            // Toggle Month
7358                            toggleMonth(response.current_month.id);
7359
7360                            // Remove loading Class
7361                            $('.mec-modal-result').removeClass("mec-month-navigator-loading");
7362
7363
7364                            // Set Month Filter values in search widget
7365                            $("#mec_sf_month_" + settings.id).val(month);
7366                            $("#mec_sf_year_" + settings.id).val(year);
7367                        } else {
7368                            $("#mec_list_view_month_" + settings.id + "_" + response.current_month.id).hide();
7369                            $("#mec_month_navigator_" + settings.id + "_" + response.current_month.id).hide();
7370                        }
7371                        if (typeof custom_month !== undefined) var custom_month;
7372                        if (typeof custom_month != undefined) {
7373                            if (custom_month == 'true') {
7374                                $(".mec-month-container .mec-calendar-day").removeClass('mec-has-event');
7375                                $(".mec-month-container .mec-calendar-day").removeClass('mec-selected-day');
7376                                $('.mec-calendar-day').off('click');
7377                            }
7378                        }
7379                        if (!do_in_background) {
7380                            mecFluentCustomScrollbar(0);
7381                        }
7382
7383                        if (jQuery().niceSelect) jQuery('.mec-fluent-wrap').find('.mec-filter-content').find('select').niceSelect();
7384
7385                        $(document).trigger('mec_set_month_process_end', { r: response, settings_id: settings.id });
7386                    },
7387                    error: function () { }
7388                });
7389            }
7390        }
7391
7392        function toggleMonth(month_id) {
7393            var active_month = $("#mec_skin_" + settings.id + " .mec-month-container-selected").data("month-id");
7394            var active_day = $("#mec_list_view_month_" + settings.id + "_" + active_month + " .mec-selected-day").data("day");
7395
7396            if (active_day <= 9) active_day = "0" + active_day;
7397
7398            // Toggle Month Navigator
7399            $("#mec_skin_" + settings.id + " .mec-month-navigator").hide();
7400            $("#mec_month_navigator_" + settings.id + "_" + month_id).show();
7401
7402            // Toggle Month
7403            $("#mec_skin_" + settings.id + " .mec-month-container").hide();
7404            $("#mec_list_view_month_" + settings.id + "_" + month_id).show();
7405
7406            // Add selected class
7407            $("#mec_skin_" + settings.id + " .mec-month-container").removeClass("mec-month-container-selected");
7408            $("#mec_list_view_month_" + settings.id + "_" + month_id).addClass("mec-month-container-selected");
7409
7410            jQuery(document).trigger('mec_toggle_month', [settings, month_i
7410d]);
7411        }
7412
7413        var sf;
7414
7415        function sed() {
7416            // Single Event Display
7417            $(".mec-skin-list-wrap#mec_skin_" + settings.id).off('click').on('click', '[data-event-id]', function (e) {
7418                e.preventDefault();
7419                var href = $(this).attr('href');
7420
7421                var id = $(this).data('event-id');
7422                var occurrence = get_parameter_by_name('occurrence', href);
7423                var time = get_parameter_by_name('time', href);
7424
7425                if ('undefined' == typeof id) {
7426                    return;
7427                }
7428
7429                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
7430            });
7431        }
7432    };
7433}(jQuery));
7434
7435// MEC Grid VIEW Fluent PLUGIN
7436(function ($) {
7437    $.fn.mecGridViewFluent = function (options) {
7438        var active_month;
7439        var active_year;
7440
7441        // Default Options
7442        var settings = $.extend({
7443            // These are the defaults.
7444            today: null,
7445            id: 0,
7446            events_label: 'Events',
7447            event_label: 'Event',
7448            month_navigator: 0,
7449            atts: '',
7450            active_month: {},
7451            next_month: {},
7452            sf: {},
7453            ajax_url: '',
7454        }, options);
7455
7456        initLoadMore('#mec_grid_view_month_' + settings.id + '_' + settings.month_id);
7457
7458        function initLoadMore(monthID) {
7459            $(monthID).off().on('click', '.mec-load-more-button', function () {
7460                loadMore(this);
7461            });
7462        }
7463
7464        function loadMore(This) {
7465            // Add loading Class
7466            var currentLoadMore = $(This);
7467            currentLoadMore.addClass("mec-load-more-loading");
7468            var endDate = currentLoadMore.data('end-date');
7469            var maximumDate = currentLoadMore.data('maximum-date');
7470            var nextOffset = currentLoadMore.data('next-offset');
7471            var year = currentLoadMore.data('year');
7472            var month = currentLoadMore.data('month');
7473
7474            $.ajax({
7475                url: settings.ajax_url,
7476                data: "action=mec_grid_load_more&mec_year=" + year + "&mec_month=" + month + "&mec_maximum_date=" + maximumDate + "&mec_start_date=" + endDate + "&mec_offset=" + nextOffset + "&" + settings.atts + "&current_month_divider=0&apply_sf_date=0",
7477                dataType: "json",
7478                type: "post",
7479                success: function (response) {
7480                    currentLoadMore.parent().remove();
7481                    if (response.count != '0') {
7482                        // Append Items
7483                        $('#mec_grid_view_month_' + settings.id + '_' + response.current_month.id).append(response.month);
7484
7485                        // Single Event Method
7486                        if (settings.sed_method != '0') {
7487                            sed();
7488                        }
7489
7490                        mecFluentCustomScrollbar();
7491                        initLoadMore('#mec_grid_view_month_' + settings.id + '_' + response.current_month.id);
7492                    }
7493
7494                    $(document).trigger('mec_load_more_init', ['grid', settings]);
7495                },
7496                error: function () { }
7497            });
7498        }
7499
7500        // Initialize Month Navigator
7501        if (settings.month_navigator) initMonthNavigator();
7502
7503        // Load Next Month in background
7504        setMonth(settings.next_month.year, settings.next_month.month, true);
7505
7506        var initMonth;
7507        var initYear;
7508        active_month = initMonth = settings.active_month.month;
7509        active_year = initYear = settings.active_month.year;
7510
7511        // Search Widget
7512        if (settings.sf.container !== '') {
7513            sf = $(settings.sf.container).mecSearchForm({
7514                id: settings.id,
7515                refine: settings.sf.refine,
7516                ajax_url: settings.ajax_url,
7517                start_date: settings.start_date,
7518                atts: settings.atts,
7519                callback: function (atts) {
7520                    settings.atts = atts;
7521                    search(active_year, active_month);
7522                }
7523            });
7524
7525            $(settings.sf.container).addClass('mec-skin-search-init');
7526        }
7527
7528        // Single Event Method
7529        if (settings.sed_method != '0') {
7530            sed();
7531        }
7532
7533        function initMonthNavigator() {
7534            $("#mec_skin_" + settings.id + " .mec-load-month").off().on("click", function () {
7535                var year = $(this).data("mec-year");
7536                var month = $(this).data("mec-month");
7537                setMonth(year, month, false, true);
7538            });
7539        }
7540
7541        function parseQuery(queryString) {
7542            var query = {};
7543            var pairs = (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&');
7544            for (var i = 0; i < pairs.length; i++) {
7545                var pair = pairs[i].split('=');
7546                query[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || '');
7547            }
7548            return query;
7549        }
7550
7551        function updateQueryStringParameter(uri, key, val) {
7552            return uri
7553                .replace(RegExp("([?&]" + key + "(?=[=&#]|$)[^#&]*|(?=#|$))"), "&" + key + "=" + encodeURIComponent(val));
7554        }
7555
7556        function search(year, month) {
7557            // Add Loading Class
7558            if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
7559            jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
7560
7561            var ObjAtts = parseQuery(settings.atts);
7562            if (!(ObjAtts['sf[month'] || ObjAtts['sf[year]'])) {
7563                settings.atts = updateQueryStringParameter(settings.atts.trim(), 'sf[year]', initYear);
7564                settings.atts = updateQueryStringParameter(settings.atts.trim(), 'sf[month]', initMonth);
7565            }
7566
7567            $.ajax({
7568                url: settings.ajax_url,
7569                data: "action=mec_grid_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=1",
7570                dataType: "json",
7571                type: "post",
7572                success: function (response) {
7573                    active_month = response.current_month.month;
7574                    active_year = response.current_month.year;
7575
7576                    // Append Month
7577                    $("#mec_skin_events_" + settings.id).html('<div class="mec-month-container" id="mec_grid_view_month_' + settings.id + '_' + response.current_month.id + '" data-month-id="' + response.current_month.id + '">' + response.month + '</div>');
7578
7579                    // Append Month Navigator
7580                    $("#mec_skin_" + settings.id + " .mec-skin-grid-view-month-navigator-container").html('<div class="mec-month-navigator" id="mec_month_navigator_' + settings.id + '_' + response.current_month.id + '">' + response.navigator + '</div>');
7581
7582                    // Re-initialize Month Navigator
7583                    initMonthNavigator();
7584
7585                    // Toggle Month
7586                    toggleMonth(response.current_month.id);
7587
7588                    initLoadMore('#mec_grid_view_month_' + settings.id + '_' + response.current_month.id);
7589
7590                    // Remove loading Class
7591                    $('.mec-modal-result').removeClass("mec-month-navigator-loading");
7592
7593                    mecFluentCustomScrollbar();
7594
7595                    $(document).trigger('mec_search_init', ['grid', settings, response]);
7596                },
7597                error: function () { }
7598            });
7599        }
7600
7601        function setMonth(year, month, do_in_background, navigator_click) {
7602            if (typeof do_in_background === "undefined") do_in_background = false;
7603            navigator_click = navigator_click || false;
7604            var month_id = year + "" + month;
7605
7606            if (!do_in_background) {
7607                active_month = month;
7608                active_year = year;
7609            }
7610
7611            // Month exists so we just show it
7612            if ($("#mec_grid_view_month_" + settings.id + "_" + month_id).length) {
7613                // Toggle Month
7614                toggleMonth(month_id);
7615                mecFluentCustomScrollbar();
7616            } else {
7617                if (!do_in_background) {
7618                    // Add Loading Class
7619                    if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('<div class="mec-modal-result"></div>');
7620                    jQuery('.mec-modal-result').addClass('mec-month-navigator-loading');
7621                }
7622
7623                $.ajax({
7624                    url: settings.ajax_url,
7625                    data: "action=mec_grid_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=0" + "&navigator_click=" + navigator_click,
7626                    dataType: "json",
7627                    type: "post",
7628                    success: function (response) {
7629                        // Append Month
7630                        $("#mec_skin_events_" + settings.id).append('<div class="mec-month-container" id="mec_grid_view_month_' + settings.id + '_' + response.current_month.id + '" data-month-id="' + response.current_month.id + '">' + response.month + '</div>');
7631
7632                        // Append Month Navigator
7633                        $("#mec_skin_" + settings.id + " .mec-skin-grid-view-month-navigator-container").append('<div class="mec-month-navigator" id="mec_month_navigator_' + settings.id + '_' + response.current_month.id + '">' + response.navigator + '</div>');
7634
7635                        // Re-initialize Month Navigator
7636                        initMonthNavigator();
7637                        initLoadMore('#mec_grid_view_month_' + settings.id + '_' + response.current_month.id);
7638
7639                        if (!do_in_background) {
7640                            // Toggle Month
7641                            toggleMonth(response.current_month.id);
7642
7643                            // Remove loading Class
7644                            $('.mec-modal-result').removeClass("mec-month-navigator-loading");
7645
7646
7647                            // Set Month Filter values in search widget
7648                            $("#mec_sf_month_" + settings.id).val(month);
7649                            $("#mec_sf_year_" + settings.id).val(year);
7650                        } else {
7651                            $("#mec_grid_view_month_" + settings.id + "_" + response.current_month.id).hide();
7652                            $("#mec_month_navigator_" + settings.id + "_" + response.current_month.id).hide();
7653                        }
7654                        if (typeof custom_month !== undefined) var custom_month;
7655                        if (typeof custom_month != undefined) {
7656                            if (custom_month == 'true') {
7657                                $(".mec-month-container .mec-calendar-day").removeClass('mec-has-event');
7658                                $(".mec-month-container .mec-calendar-day").removeClass('mec-selected-day');
7659                                $('.mec-calendar-day').off('click');
7660                            }
7661                        }
7662                        if (!do_in_background) {
7663                            mecFluentCustomScrollbar();
7664                        }
7665                    },
7666                    error: function () { }
7667                });
7668            }
7669        }
7670
7671        function toggleMonth(month_id) {
7672            var active_month = $("#mec_skin_" + settings.id + " .mec-month-container-selected").data("month-id");
7673            var active_day = $("#mec_grid_view_month_" + settings.id + "_" + active_month + " .mec-selected-day").data("day");
7674
7675            if (active_day <= 9) active_day = "0" + active_day;
7676
7677            // Toggle Month Navigator
7678            $("#mec_skin_" + settings.id + " .mec-month-navigator").hide();
7679            $("#mec_month_navigator_" + settings.id + "_" + month_id).show();
7680
7681            // Toggle Month
7682            $("#mec_skin_" + settings.id + " .mec-month-container").hide();
7683            $("#mec_grid_view_month_" + settings.id + "_" + month_id).show();
7684
7685            // Add selected class
7686            $("#mec_skin_" + settings.id + " .mec-month-container").removeClass("mec-month-container-selected");
7687            $("#mec_grid_view_month_" + settings.id + "_" + month_id).addClass("mec-month-container-selected");
7688
7689            jQuery(document).trigger('mec_toggle_month', [settings, month_id]);
7690        }
7691
7692        var sf;
7693
7694        function sed() {
7695            // Single Event Display
7696            $(".mec-skin-grid-wrap#mec_skin_" + settings.id).off('click').on('click', '[data-event-id]', function (e) {
7697                e.preventDefault();
7698                var href = $(this).attr('href');
7699
7700                var id = $(this).data('event-id');
7701                var occurrence = get_parameter_by_name('occurrence', href);
7702                var time = get_parameter_by_name('time', href);
7703
7704                if ('undefined' == typeof id) {
7705                    return;
7706                }
7707
7708                mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup);
7709            });
7710        }
7711    };
7712}(jQuery));
7713
7714// MEC Booking Calendar
7715(function ($) {
7716    $.fn.mecBookingCalendar = function (options) {
7717        var active_month;
7718        var active_year;
7719
7720        // Default Options
7721        var settings = $.extend({
7722            // These are the defaults.
7723            active_month: {},
7724            next_month: {},
7725            ajax_url: '',
7726            event_id: '',
7727            selected_datetime: '',
7728        }, options);
7729
7730        // Initialize Month Navigator
7731        initMonthNavigator();
7732
7733        active_month = settings.active_month.month;
7734        active_year = settings.active_month.year;
7735
7736        // Set onclick Listeners
7737        setListeners();
7738
7739        function initMonthNavigator() {
7740            // Add onclick event
7741            $("#mec_booking_calendar_" + settings.id + " .mec-load-month").off('click').on('click', function () {
7742                var year = $(this).data('mec-year');
7743                var month = $(this).data('mec-month');
7744
7745                setMonth(year, month);
7746            });
7747        }
7748
7749        function setMonth(year, month) {
7750            active_month = month;
7751            active_year = year;
7752
7753            var $modal = $('.mec-modal-result');
7754
7755            // Add Loading Class
7756            if ($modal.length === 0) $('.mec-wrap').append('<div class="mec-modal-result"></div>');
7757            $modal.addClass('mec-month-navigator-loading');
7758
7759            $.ajax(
7760                {
7761                    url: settings.ajax_url,
7762                    data: "action=mec_booking_calendar_load_month&event_id=" + settings.event_id + "&uniqueid=" + settings.id + "&year=" + year + "&month=" + month,
7763                    dataType: "json",
7764                    type: "post",
7765                    success: function (response) {
7766                        const $month_wrapper = $('#mec_booking_calendar_wrapper' + settings.id + ' .mec-select-date-calendar-container');
7767
7768                        // HTML
7769                        $month_wrapper.html(response.html);
7770
7771                        // Hide Message
7772                        $('#mec_book_form' + settings.id + ' .mec-ticket-unavailable-spots').addClass('mec-util-hidden');
7773
7774                        // Empty the Date
7775                        $('#mec_book_form_date' + settings.id).val('').trigger('change');
7776
7777                        // Remove loading Class
7778                        $modal.removeClass("mec-month-navigator-loading");
7779
7780                        setTimeout(function () {
7781                            $month_wrapper.find($('.mec-booking-calendar-date')).first().trigger('click');
7782                        }, 200);
7783                    },
7784                    error: function () {
7785                        // Remove loading Class
7786                        $modal.removeClass("mec-month-navigator-loading");
7787                    }
7788                });
7789        }
7790
7791        function setListeners() {
7792            // Add the onclick event (delegated so cloned sidebar items also work)
7793            $("#mec_booking_calendar_" + settings.id).off('click', '.mec-booking-calendar-date').on('click', '.mec-booking-calendar-date', function (e) {
7794                e.preventDefault();
7795
7796                // Activate
7797                $("#mec_booking_calendar_" + settings.id + " .mec-booking-calendar-date").removeClass('mec-active');
7798                $("#mec_booking_calendar_" + settings.id + " .mec-calendar-day").removeClass('mec-wrap-active');
7799                $(this).addClass('mec-active');
7800                $(this).parents('.mec-calendar-day').addClass('mec-wrap-active');
7801
7802                // Set Data
7803                var timestamp = $(this).data('timestamp');
7804                $('#mec_book_form_date' + settings.id).val(timestamp).trigger('change');
7805
7806                // Set Formatted Date
7807                var formatted_date = $(this).data('formatted-date');
7808                $("#mec_booking_calendar_wrapper" + settings.id + " .mec-select-date-calendar-formatted-date").html(formatted_date);
7809
7810                // Update chosen time message
7811                var $chosenMsg = $(this).closest(".mec-booking-calendar-container").find(".mec-choosen-time-message");
7812                $chosenMsg.removeClass("disable");
7813                $chosenMsg.find(".mec-choosen-time").empty().append($(this).data('formatted-date'));
7814            });
7815
7816            // Add the onclick event on calendar date
7817            $("#mec_booking_calendar_" + settings.id + " .mec-has-one-repeat-in-day").off('click').on('click', function (e) {
7818                e.preventDefault();
7819
7820                var mec_date_value = $(this).attr('data-timestamp');
7821
7822                // Activate
7823                $("#mec_booking_calendar_" + settings.id + " .mec-has-one-repeat-in-day").removeClass('mec-active');
7824                $("#mec_booking_calendar_" + settings.id + " [data-timestamp=\"" + mec_date_value + "\"]").addClass('mec-active');
7825
7826                // Set Data
7827                var timestamp = $(this).data('timestamp');
7828                $('#mec_book_form_date' + settings.id).val(timestamp).trigger('change');
7829
7830                // Set Formatted Date
7831                var formatted_date = $(this).data('formatted-date');
7832                $("#mec_booking_calendar_wrapper" + settings.id + " .mec-select-date-calendar-formatted-date").html(formatted_date);
7833
7834                // Update chosen time message
7835                var $chosenMsg = $(this).closest(".mec-booking-calendar-container").find(".mec-choosen-time-message");
7836                $chosenMsg.removeClass("disable");
7837                $chosenMsg.find(".mec-choosen-time").empty().append($(this).data('formatted-date'));
7838
7839                // Hide sidebar when a single-time day is selected
7840                $("#mec_booking_calendar_" + settings.id + " .mec-booking-tooltip-container").hide();
7841            });
7842
7843            var $has_time_repeat = $("#mec_booking_calendar_" + settings.id + " .mec-has-time-repeat");
7844
7845            $has_time_repeat.off('click').on('click', function () {
7846                $("#mec_booking_calendar_" + settings.id + " .mec-has-time-repeat").removeClass('mec-wrap-active').removeClass('mec-active');
7847                $(this).addClass("mec-active");
7848
7849                // Populate sidebar with time slots from this day
7850                var $container = $("#mec_booking_calendar_" + settings.id + " .mec-booking-tooltip-container");
7851                var $tooltip = $(this).find(".mec-booking-tooltip");
7852                var $content = $tooltip.children().clone();
7853                $content.css('display', '').removeAttr('style');
7854                $container.empty().append($content).show();
7855
7856                // Send message under the calendar
7857                var $activeDate = $(this).find(".mec-booking-calendar-date.mec-active");
7858                var sendTimeToMessage = $activeDate.length ? $activeDate.data('formatted-date') : '';
7859                var $chosenMsg = $(this).closest(".mec-booking-calendar-container").find(".mec-choosen-time-message");
7860                $chosenMsg.removeClass("disable");
7861                $chosenMsg.find(".mec-choosen-time").empty().append(sendTimeToMessage);
7862            });
7863
7864            // Selected DateTime
7865            if (settings.selected_datetime && $has_time_repeat.length) {
7866                var $selected_datetime = $(".mec-booking-calendar-date[data-timestamp='" + settings.selected_datetime + "']");
7867                if ($selected_datetime.length) {
7868                    $selected_datetime.closest(".mec-has-time-repeat").trigger('click');
7869                    var $sidebarDate = $(".mec-booking-tooltip-container .mec-booking-calendar-date[data-timestamp='" + settings.selected_datetime + "']");
7870                    if ($sidebarDate.length) $sidebarDate.trigger('click');
7871                }
7872            }
7873
7874            // Dropdown Toggle
7875            $("#mec_booking_calendar_wrapper" + settings.id + " .mec-select-date-calendar-dropdown").off('click').on('click', function () {
7876                var $up = $("#mec_booking_calendar_wrapper" + settings.id + " .mec-select-date-calendar-icons-up");
7877                var $down = $("#mec_booking_calendar_wrapper" + settings.id + " .mec-select-date-calendar-icons-down");
7878                var $calendar = $("#mec_booking_calendar_wrapper" + settings.id + " .mec-select-date-calendar-container");
7879
7880                var $current = $(this).find($('.mec-select-date-calendar-icons span:not(.mec-util-hidden)'));
7881                if ($current.hasClass('mec-select-date-calendar-icons-up')) {
7882                    $up.addClass('mec-util-hidden');
7883                    $down.removeClass('mec-util-hidden');
7884                    $calendar.removeClass('mec-util-hidden');
7885
7886                    setTimeout(function () {
7887                        $('body').off('click').on('click', mec_calendar_close_calendar_on_body_click);
7888                    }, 100);
7889                }
7890                else {
7891                    $up.removeClass('mec-util-hidden');
7892                    $down.addClass('mec-util-hidden');
7893                    $calendar.addClass('mec-util-hidden');
7894                }
7895            });
7896
7897            function mec_calendar_close_calendar_on_body_click(e) {
7898                var $up = $("#mec_booking_calendar_wrapper" + settings.id + " .mec-select-date-calendar-icons-up");
7899                var $down = $("#mec_booking_calendar_wrapper" + settings.id + " .mec-select-date-calendar-icons-down");
7900                var $calendar = $("#mec_booking_calendar_wrapper" + settings.id + " .mec-select-date-calendar-container");
7901
7902                // Click was inside calendar
7903                if ($(e.target).closest($calendar).length > 0) return false;
7904
7905                $up.removeClass('mec-util-hidden');
7906                $down.addClass('mec-util-hidden');
7907                $calendar.addClass('mec-util-hidden');
7908
7909                $('body').off('click', mec_calendar_close_calendar_on_body_click);
7910            }
7911        }
7912    };
7913}(jQuery));
7914
7915// MEC Cart
7916(function ($) {
7917    $.fn.mecCart = function (options) {
7918        // Default Options
7919        var settings = $.extend({
7920            // These are the defaults.
7921            ajax_url: '',
7922        }, options);
7923
7924        // Set DOM Listeners
7925        setListeners();
7926
7927        function setListeners() {
7928            // Add the onclick event
7929            $(".mec-cart-remove-transactions").off('click').on('click', function (e) {
7930                e.preventDefault();
7931
7932                var transaction_id = $(this).data('transaction-id');
7933                remove(transaction_id);
7934            });
7935
7936            $('#mec_cart_coupon_form').off('submit').on('submit', function (e) {
7937                e.preventDefault();
7938                coupon();
7939            });
7940        }
7941
7942        function remove(transaction_id) {
7943            var $wrapper = $('.mec-cart');
7944
7945            // Add loading Class
7946            $wrapper.addClass('mec-loading');
7947
7948            $.ajax(
7949                {
7950                    url: settings.ajax_url,
7951                    data: "action=mec_cart_remove_transaction&transaction_id=" + transaction_id,
7952                    dataType: "json",
7953                    type: "post",
7954                    success: function (response) {
7955                        // Remove Loading Class
7956                        $wrapper.removeClass('mec-loading');
7957
7958                        if (response.success) {
7959                            // Remove Transaction Row
7960                            $('#mec_cart_transactions_' + transaction_id).remove();
7961
7962                            if (!$('#mec_cart_transactions_table>tbody>tr').length) {
7963                                $('#mec_cart_transactions_table').remove();
7964                                $('.mec-cart-coupon-checkout-action').remove();
7965                                $('.mec-cart-empty-wrapper').removeClass('mec-util-hidden');
7966                            }
7967
7968                            // Update Total Payable Price
7969                            $('#mec_cart_total_payable').html(response.total);
7970                        }
7971                    },
7972                    error: function () { }
7973                });
7974        }
7975
7976        function coupon() {
7977            var $wrapper = $('.mec-cart');
7978            var $message = $('#mec_cart_message');
7979
7980            // Add loading Class
7981            $wrapper.addClass('mec-loading');
7982
7983            // Empty Message
7984            $message.html('');
7985
7986            var coupon = $('#mec_cart_coupon_input').val();
7987
7988            $.ajax(
7989                {
7990                    url: settings.ajax_url,
7991                    data: "action=mec_cart_coupon&coupon=" + coupon,
7992                    dataType: "json",
7993                    type: "post",
7994                    success: function (response) {
7995                        // Remove Loading Class
7996                        $wrapper.removeClass('mec-loading');
7997
7998                        if (response.success) {
7999                            $message.html('<p class="mec-success">' + response.message + '</p>');
8000
8001                            setTimeout(function () {
8002                                location.reload();
8003                            }, 2000);
8004                        }
8005                        else {
8006                            $message.html('<p class="mec-error">' + response.message + '</p>');
8007                        }
8008                    },
8009                    error: function () { }
8010                });
8011        }
8012    };
8013}(jQuery));
8014
8015// MEC Checkout
8016(function ($) {
8017    $.fn.mecCheckout = function (options) {
8018        // Default Options
8019        var settings = $.extend({
8020            // These are the defaults.
8021            ajax_url: '',
8022        }, options);
8023
8024        // Set DOM Listeners
8025        setListeners();
8026
8027        function setListeners() {
8028            // Add the onclick event
8029            $(".mec-checkout-gateways-radio").off('change').on('change', function (e) {
8030                e.preventDefault();
8031
8032                var gateway_id = $('.mec-checkout-gateways-radio:checked').val();
8033
8034                // Hide all gateway forms
8035                jQuery(".mec-checkout-form-gateway-checkout").addClass("mec-util-hidden");
8036                jQuery(".mec-checkout-price-details-wrapper").addClass("mec-util-hidden");
8037                jQuery(".mec-checkout-price-wrapper").addClass("mec-util-hidden");
8038
8039                // Show selected gateway form
8040                jQuery("#mec_checkout_form_gateway_checkout" + gateway_id).removeClass("mec-util-hidden");
8041                jQuery("#mec-checkout-price-details-wrapper-" + gateway_id).removeClass("mec-util-hidden");
8042                jQuery("#mec-checkout-price-wrapper-" + gateway_id).removeClass("mec-util-hidden");
8043            });
8044
8045            if ($(".mec-checkout-gateways-radio:first").length) {
8046
8047                $(".mec-checkout-gateways-radio:first").prop('checked', true).change();
8048            } else {
8049
8050                jQuery(".mec-checkout-price-details-wrapper:first").removeClass("mec-util-hidden");
8051            }
8052
8053            $('#mec_checkout_form_free_booking').off('submit').on('submit', function (e) {
8054                e.preventDefault();
8055                free();
8056            });
8057        }
8058
8059        function free() {
8060            var $wrapper = $('.mec-checkout');
8061            var $message = $('#mec_checkout_message');
8062
8063            // Add loading Class
8064            $wrapper.addClass('mec-loading');
8065
8066            // Empty Message
8067            $message.html('');
8068
8069            var data = $('#mec_checkout_form_free_booking').serialize();
8070
8071            $.ajax(
8072                {
8073                    url: settings.ajax_url,
8074                    data: data,
8075                    dataType: "json",
8076                    type: "post",
8077	                    success: function (response) {
8078	                        // Remove Loading Class
8079	                        $wrapper.removeClass('mec-loading');
8080	
8081	                        if (response.success) {
8082	                            $message.html('<div class="mec-success">' + response.message + '</div>');
8083	                            if (response.data && typeof response.data.redirect_to !== "undefined" && response.data.redirect_to !== "") {
8084	                                setTimeout(function () {
8085	                                    window.location.href = response.data.redirect_to;
8086	                                }, 2000);
8087	                            }
8088	                            $wrapper.slideUp().html('');
8089	                        }
8090	                        else {
8091	                            $message.html('<div class="mec-error">' + response.message + '</div>');
8092	                        }
8093                    },
8094                    error: function () { }
8095                });
8096        }
8097    };
8098}(jQuery));
8099
8100// Booking Shortcode Scripts
8101jQuery(document).ready(function () {
8102    // Event Gallery
8103    mec_init_event_gallery();
8104
8105    if (jQuery('.mec-booking-shortcode').length < 0) {
8106        return;
8107    }
8108    // Events
8109    if (jQuery().niceSelect) {
8110        jQuery('.mec-booking-shortcode').find('.mec-book-first').find('select').niceSelect();
8111    }
8112
8113    // General Calendar
8114    if (jQuery("#gCalendarMonthFilterButton").length > 0) {
8115        jQuery("#gCalendarMonthFilterButton").monthPicker({
8116            format: "yyyy-mm",
8117            viewMode: "months",
8118            minViewMode: "months"
8119        })
8120        jQuery("#gCalendarMonthFilterButton").monthPicker('hide')
8121    }
8122});
8123
8124function mec_init_event_gallery() {
8125    // Event Gallery
8126    jQuery('.mec-event-gallery-wrapper').each(function () {
8127        let $gallery = jQuery(this);
8128
8129        $gallery.find(jQuery('.mec-event-gallery-list li')).on('click', function () {
8130            let $image = jQuery(this).find(jQuery('img'));
8131            let src = $image.data('full-src');
8132            let alt = $image.attr('alt');
8133
8134            jQuery('.mec-event-gallery-image img')
8135                .fadeTo(200, 0.8)
8136                .attr('src', src)
8137                .attr('alt', alt)
8138                .fadeTo(200, 1);
8139        });
8140    });
8141}
8142
8143function mec_toggle_shortcode_pagination(shortcode_id, method) {
8144    if (method === 'show') {
8145        jQuery("#mec_skin_" + shortcode_id + " .mec-load-more-button").removeClass("mec-util-hidden");
8146        jQuery('#mec-nextprev-wrap-' + shortcode_id + ' .mec-nextprev-next-button').removeClass("mec-util-hidden");
8147    }
8148    else {
8149        jQuery("#mec_skin_" + shortcode_id + " .mec-load-more-button").addClass("mec-util-hidden");
8150        jQuery('#mec-nextprev-wrap-' + shortcode_id + ' .mec-nextprev-next-button').addClass("mec-util-hidden");
8151        jQuery('#mec-nextprev-wrap-' + shortcode_id + ' .mec-nextprev-hide-button').addClass("mec-util-hidden");
8152    }
8153}
8154
8155// MEC COUNTDOWN MODULE
8156(function ($) {
8157    $.fn.mecProgressBar = function () {
8158        let $bar = $(this).find($('progress'));
8159        let value = parseInt($bar.attr('value'));
8160        const max = parseInt($bar.attr('max'));
8161
8162        var passed = 0;
8163        var remained = 0;
8164        var passed_days;
8165        var passed_hours;
8166        var passed_minutes;
8167        var passed_seconds;
8168        var remained_days;
8169        var remained_hours;
8170        var remained_minutes;
8171        var remained_seconds;
8172
8173        var $time_passed = $(this).find($('.mec-progress-bar-time-passed'));
8174        var $time_remained = $(this).find($('.mec-progress-bar-time-remained'));
8175
8176        startProgress();
8177        var interval = setInterval(startProgress, 1000);
8178
8179        function startProgress() {
8180            if (value >= max) {
8181                clearInterval(interval);
8182                return;
8183            }
8184            value += 1;
8185            $bar.attr('value', value);
8186
8187            let passed_str = '';
8188            let remained_str = '';
8189
8190            passed = value;
8191            remained = max - passed;
8192
8193            passed_days = Math.floor(passed / 86400);
8194            passed -= passed_days * 86400;
8195
8196            passed_hours = Math.floor(passed / 3600);
8197            passed -= passed_hours * 3600;
8198
8199            passed_minutes = Math.floor(passed / 60);
8200            passed -= passed_minutes * 60;
8201
8202            passed_seconds = passed;
8203
8204            remained_days = Math.floor(remained / 86400);
8205            remained -= remained_days * 86400;
8206
8207            remained_hours = Math.floor(remained / 3600);
8208            remained -= remained_hours * 3600;
8209
8210            remained_minutes = Math.floor(remained / 60);
8211            remained -= remained_minutes * 60;
8212
8213            remained_seconds = remained;
8214
8215            if (passed_days > 0) passed_str += (passed_days < 10 ? '0' : '') + passed_days + ':';
8216            if (passed_days > 0 || passed_hours > 0) passed_str += (passed_hours < 10 ? '0' : '') + passed_hours + ':';
8217            passed_str += (passed_minutes < 10 ? '0' : '') + passed_minutes + ':';
8218            passed_str += (passed_seconds < 10 ? '0' : '') + passed_seconds;
8219
8220            if (remained_days >
8220 0) remained_str += (remained_days < 10 ? '0' : '') + remained_days + ':';
8221            if (remained_days > 0 || remained_hours > 0) remained_str += (remained_hours < 10 ? '0' : '') + remained_hours + ':';
8222            remained_str += (remained_minutes < 10 ? '0' : '') + remained_minutes + ':';
8223            remained_str += (remained_seconds < 10 ? '0' : '') + remained_seconds;
8224
8225            $time_passed.html(passed_str);
8226            $time_remained.html(remained_str);
8227        }
8228    };
8229}(jQuery));
8230;
8231/**
8232 * MEC product analytics — front-end relay (events 2 and 5).
8233 *
8234 * Exposes window.mecRelayBeacon(event, props, dedupKey):
8235 *   - sendBeacon to the admin-ajax relay endpoint (see Tracking\ClientRelay)
8236 *   - hard client-side dedup via sessionStorage when a dedupKey is given
8237 *
8238 * Also listens for MEC search/filter completions (the "mec_search_init"
8239 * document event every view triggers once results are shown) and relays
8240 * mec_calendar_discovery_used. The search phrase itself is NEVER collected —
8241 * only the action shape, the filter type, and a result-count bucket.
8242 */
8243(function () {
8244    'use strict';
8245
8246    if (window.mecRelayBeacon) return; // double-enqueue guard
8247
8248    var ajaxUrl = (typeof mecdata !== 'undefined' && mecdata.ajax_url) ? mecdata.ajax_url : null;
8249
8250    function bucket(n) {
8251        n = parseInt(n, 10) || 0;
8252        if (n <= 0) return '0';
8253        if (n <= 4) return '1_4';
8254        if (n <= 20) return '5_20';
8255        if (n <= 100) return '21_100';
8256        return '101_plus';
8257    }
8258
8259    window.mecRelayBeacon = function (event, props, dedupKey) {
8260        if (!ajaxUrl || !navigator.sendBeacon) return;
8261
8262        if (dedupKey) {
8263            try {
8264                if (sessionStorage.getItem(dedupKey)) return;
8265                sessionStorage.setItem(dedupKey, '1');
8266            } catch (e) { /* private mode: fall through and send */ }
8267        }
8268
8269        var body = new FormData();
8270        body.append('action', 'mec_track_event');
8271        body.append('event', event);
8272        body.append('props', JSON.stringify(props || {}));
8273
8274        navigator.sendBeacon(ajaxUrl, body);
8275    };
8276
8277    // ---- Event 5: mec_calendar_discovery_used -------------------------------
8278
8279    // Remember WHAT the visitor used, so that when the results arrive
8280    // (mec_search_init) we can attach discovery_action and filter_type.
8281    var pending = { action: null, filter_type: null };
8282
8283    // Search phrase field: mec_sf_s_{id}. Everything else in the search form
8284    // is a filter (month, category, label, location, organizer, …).
8285    var FILTER_BY_ID = [
8286        ['mec_sf_s', 'text'],
8287        ['mec_sf_address_s', 'text_address'],
8288        ['mec_sf_month', 'month'],
8289        ['mec_sf_year', 'year'],
8290        ['mec_sf_category', 'category'],
8291        ['mec_sf_label', 'label'],
8292        ['mec_sf_location', 'location'],
8293        ['mec_sf_organizer', 'organizer'],
8294        ['mec_sf_speaker', 'speaker'],
8295        ['mec_sf_sponsor', 'sponsor'],
8296        ['mec_sf_event_type', 'event_type'],
8297        ['mec_sf_event_cost', 'cost'],
8298        ['mec_sf_timepicker', 'time'],
8299        ['mec_sf_date', 'date']
8300    ];
8301
8302    function filterTypeFromId(id) {
8303        for (var i = 0; i < FILTER_BY_ID.length; i++) {
8304            if (id && id.indexOf(FILTER_BY_ID[i][0]) === 0) return FILTER_BY_ID[i][1];
8305        }
8306        return 'other';
8307    }
8308
8309    jQuery(function ($) {
8310        if (!$ || !$.fn) return;
8311
8312        // Any change inside a MEC search form records the initiating action.
8313        $(document).on('change', 'form[id^="mec_search_form_"] select, form[id^="mec_search_form_"] input', function () {
8314            var id = (this.id || '');
8315            pending.action = (id.indexOf('mec_sf_s') === 0) ? 'search' : 'filter';
8316            pending.filter_type = filterTypeFromId(id);
8317        });
8318
8319        // Explicit submit = search even if the phrase field id differed.
8320        $(document).on('submit', 'form[id^="mec_search_form_"]', function () {
8321            if (!pending.action) {
8322                pending.action = 'search';
8323                pending.filter_type = 'text';
8324            }
8325        });
8326
8327        // Results shown — every view triggers this with (event, view, settings).
8328        $(document).on('mec_search_init', function (event, view, viewSettings) {
8329            if (!pending.action) return; // initial page render, not a discovery
8330
8331            var resultCount = 0;
8332            if (viewSettings && viewSettings.id) {
8333                resultCount = $('#mec_skin_' + viewSettings.id + ' .mec-event, #mec_skin_' + viewSettings.id + ' article').length
8334                    || $('.mec-wrap .mec-event, .mec-wrap article.mec-event-article').length;
8335            } else {
8336                resultCount = $('.mec-wrap .mec-event, .mec-wrap article.mec-event-article').length;
8337            }
8338
8339            var props = {
8340                discovery_action: pending.action,
8341                filter_type: pending.filter_type,
8342                selected_count: 1,
8343                result_count_bucket: bucket(resultCount),
8344                view_type: view || null,
8345                calendar_url: location.origin + location.pathname
8346            };
8347
8348            // Consume: one beacon per completed discovery.
8349            pending.action = null;
8350            pending.filter_type = null;
8351
8352            window.mecRelayBeacon('mec_calendar_discovery_used', props);
8353        });
8354    });
8355})();
8356;
8357// Set datepicker default value.
8358var datepicker_format = 'yy-mm-dd';
8359
8360function mecEnhanceDatepickerAccessibility($inputs)
8361{
8362    if(!$inputs || !$inputs.length) return;
8363
8364    $inputs.attr('aria-haspopup', 'dialog');
8365    $inputs.off('focus.mecDatepickerA11y').on('focus.mecDatepickerA11y', function()
8366    {
8367        window.setTimeout(function()
8368        {
8369            var $datepicker = jQuery('#ui-datepicker-div');
8370            if(!$datepicker.length) return;
8371
8372            $datepicker.attr({
8373                role: 'dialog',
8374                'aria-live': 'polite',
8375                'aria-label': (typeof mecdata !== 'undefined' && mecdata.a11y_calendar_dialog) ? mecdata.a11y_calendar_dialog : 'Calendar date picker'
8376            });
8377        }, 0);
8378    });
8379}
8380
8381jQuery(document).ready(function($)
8382{
8383    // Image picker on terms menu
8384    // Image picker on terms menu
8385    // Several buttons share this handler with different data attributes, so the
8386    // select callback must close over the CURRENT click's IDs — dispose the old
8387    // frame and rebuild on each click (reusing one frame would keep stale IDs).
8388    var mecMediaFrame;
8389    $('.mec_upload_image_button').click(function(event)
8390    {
8391        event.preventDefault();
8392
8393        if(wp.ajax.settings.url.indexOf('mec_fes=1') === -1) wp.ajax.settings.url = wp.ajax.settings.url + '?mec_fes=1';
8394
8395        var post_id = $(this).data('post-id');
8396        if(post_id && post_id !== -1) wp.media.model.settings.post.id = post_id;
8397        if(post_id === -1) wp.media.model.settings.post.id = null;
8398
8399        var preview_id = 'mec_thumbnail_img';
8400        var input_id = 'mec_thumbnail';
8401
8402        if($(this).data('preview-id')) preview_id = $(this).data('preview-id');
8403        if($(this).data('input-id')) input_id = $(this).data('input-id');
8404
8405        if(mecMediaFrame) mecMediaFrame.dispose();
8406
8407        mecMediaFrame = wp.media();
8408        mecMediaFrame.on('select', function()
8409        {
8410            // Grab the selected attachment.
8411            var attachment = mecMediaFrame.state().get('selection').first();
8412
8413            $('#'+preview_id).html('<img src="'+attachment.attributes.url+'" alt="Featured image preview" />');
8414            $('#'+input_id).val(attachment.attributes.url);
8415
8416            // Toggle only this pair's remove button (several upload/remove pairs can coexist on one page)
8417            $('.mec_remove_image_button').filter(function()
8418            {
8419                return (($(this).data('preview-id') || 'mec_thumbnail_img') === preview_id);
8420            }).removeClass('mec-util-hidden');
8421
8422            // Banner row: hide the "Choose image" button while an image is set
8423            if(preview_id === 'mec_banner_thumbnail_img') mecSyncThumbnailButtons('banner');
8424
8425            mecMediaFrame.close();
8426        });
8427
8428        mecMediaFrame.open();
8429    });
8430
8431    // Image remover on terms menu
8432    $('.mec_remove_image_button').click(function(event)
8433    {
8434        event.preventDefault();
8435
8436        var preview_id = 'mec_thumbnail_img';
8437        var input_id = 'mec_thumbnail';
8438
8439        if($(this).data('preview-id')) preview_id = $(this).data('preview-id');
8440        if($(this).data('input-id')) input_id = $(this).data('input-id');
8441
8442        $('#'+preview_id).html('');
8443        $('#'+input_id).val('');
8444
8445        $('.mec_remove_image_button').filter(function()
8446        {
8447            return (($(this).data('preview-id') || 'mec_thumbnail_img') === preview_id);
8448        }).addClass('mec-util-hidden');
8449
8450        // Banner row: bring back the "Choose image" button
8451        if(preview_id === 'mec_banner_thumbnail_img') mecSyncThumbnailButtons('banner');
8452    });
8453
8454    // Keep thumbnail "Choose image" / "Remove image" buttons in sync with the current image state
8455    function mecSyncThumbnailButtons(which)
8456    {
8457        var hasImage = $.trim($('#mec_' + which + '_thumbnail').val()) !== '' || $('#mec_' + which + '_thumbnail_img').children('img').length > 0;
8458        // Dedicated remove button (.mec_{which}_remove_image_button) or the generic
8459        // pair (.mec_remove_image_button[data-preview-id]) — the popup has neither.
8460        var $remove = $('.mec_' + which + '_remove_image_button');
8461        if(!$remove.length) $remove = $('.mec_remove_image_button').filter(function()
8462        {
8463            return (($(this).data('preview-id') || 'mec_thumbnail_img') === 'mec_' + which + '_thumbnail_img');
8464        });
8465
8466        $remove.toggleClass('mec-util-hidden', !hasImage);
8467        $('#mec_' + which + '_thumbnail_button').toggleClass('mec-util-hidden', hasImage && $remove.length > 0);
8468    }
8469
8470    // Image picker on add event menu for location
8471    var mecLocationMediaFrame;
8472    $('.mec_location_upload_image_button').click(function(event)
8473    {
8474        event.preventDefault();
8475
8476        // Reuse the open frame across clicks (IDs are fixed for this pair)
8477        if(mecLocationMediaFrame)
8478        {
8479            mecLocationMediaFrame.open();
8480            return;
8481        }
8482
8483        mecLocationMediaFrame = wp.media();
8484        mecLocationMediaFrame.on('select', function()
8485        {
8486            // Grab the selected attachment.
8487            var attachment = mecLocationMediaFrame.state().get('selection').first();
8488
8489            $('#mec_location_thumbnail_img').html('<img src="'+attachment.attributes.url+'" />');
8490            $('#mec_location_thumbnail').val(attachment.attributes.url);
8491
8492            mecSyncThumbnailButtons('location');
8493
8494            mecLocationMediaFrame.close();
8495        });
8496
8497        mecLocationMediaFrame.open();
8498    });
8499
8500    // Image remover on add event menu for location
8501    $('.mec_location_remove_image_button').click(function(event)
8502    {
8503        event.preventDefault();
8504
8505        $('#mec_location_thumbnail_img').html('');
8506        $('#mec_location_thumbnail').val('');
8507
8508        mecSyncThumbnailButtons('location');
8509    });
8510
8511    // Image picker on add event menu for organizer
8512    var mecOrganizerMediaFrame;
8513    $('.mec_organizer_upload_image_button').click(function(event)
8514    {
8515        event.preventDefault();
8516
8517        // Reuse the open frame across clicks (IDs are fixed for this pair)
8518        if(mecOrganizerMediaFrame)
8519        {
8520            mecOrganizerMediaFrame.open();
8521            return;
8522        }
8523
8524        mecOrganizerMediaFrame = wp.media();
8525        mecOrganizerMediaFrame.on('select', function()
8526        {
8527            // Grab the selected attachment.
8528            var attachment = mecOrganizerMediaFrame.state().get('selection').first();
8529
8530            $('#mec_organizer_thumbnail_img').html('<img src="'+attachment.attributes.url+'" />');
8531            $('#mec_organizer_thumbnail').val(attachment.attributes.url);
8532
8533            mecSyncThumbnailButtons('organizer');
8534
8535            mecOrganizerMediaFrame.close();
8536        });
8537
8538        mecOrganizerMediaFrame.open();
8539    });
8540
8541    // Image remover on add event menu for organizer
8542    $('.mec_organizer_remove_image_button').click(function(event)
8543    {
8544        event.preventDefault();
8545
8546        $('#mec_organizer_thumbnail_img').html('');
8547        $('#mec_organizer_thumbnail').val('');
8548
8549        mecSyncThumbnailButtons('organizer');
8550    });
8551
8552    // Initial state sync (e.g. edit forms pre-populated by other scripts)
8553    mecSyncThumbnailButtons('location');
8554    mecSyncThumbnailButtons('organizer');
8555    mecSyncThumbnailButtons('banner');
8556
8557    // Image remover on frontend event submission menu
8558    $('#mec_fes_remove_image_button').click(function(event)
8559    {
8560        event.preventDefault();
8561
8562        $('#mec_fes_thumbnail_img').html('');
8563        $('#mec_fes_thumbnail').val('');
8564        $('#mec_featured_image_file').val('');
8565
8566        $('#mec_fes_remove_image_button').addClass('mec-util-hidden');
8567    });
8568
8569    // Location Image remover on frontend event submission menu
8570    $('#mec_fes_location_remove_image_button').click(function(event)
8571    {
8572        event.preventDefault();
8573
8574        $('#mec_fes_location_thumbnail_img').html('');
8575        $('#mec_fes_location_thumbnail').val('');
8576        $('#mec_fes_location_thumbnail_file').val('');
8577
8578        $('#mec_fes_location_remove_image_button').addClass('mec-util-hidden');
8579    });
8580
8581    // Organizer Image remover on frontend event submission menu
8582    $('#mec_fes_organizer_remove_image_button').click(function(event)
8583    {
8584        event.preventDefault();
8585
8586        $('#mec_fes_organizer_thumbnail_img').html('');
8587        $('#mec_fes_organizer_thumbnail').val('');
8588        $('#mec_fes_organizer_thumbnail_file').val('');
8589
8590        $('#mec_fes_organizer_remove_image_button').addClass('mec-util-hidden');
8591    });
8592
8593    // Sponsor Image remover on frontend event submission menu
8594    $('#mec_fes_sponsor_remove_image_button').click(function(event)
8595    {
8596        event.preventDefault();
8597
8598        $('#mec_fes_sponsor_thumbnail_img').html('');
8599        $('#mec_fes_sponsor_thumbnail').val('');
8600        $('#mec_fes_sponsor_thumbnail_file').val('');
8601
8602        $('#mec_fes_sponsor_remove_image_button').addClass('mec-util-hidden');
8603    });
8604
8605    // Speaker Image remover on frontend event submission menu
8606    $('#mec_fes_speaker_remove_image_button').click(function(event)
8607    {
8608        event.preventDefault();
8609
8610        $('#mec_fes_speaker_thumbnail_img').html('');
8611        $('#mec_fes_speaker_thumbnail').val('');
8612        $('#mec_fes_speaker_thumbnail_file').val('');
8613
8614        $('#mec_fes_speaker_remove_image_button').addClass('mec-util-hidden');
8615    });
8616
8617    var date_splite;
8618    if(typeof mec_admin_localize !== 'undefined')
8619    {
8620        date_splite = mec_admin_localize.datepicker_format.split('&');
8621        if(date_splite[0] !== undefined && date_splite.length == 2) datepicker_format = date_splite[0];
8622    }
8623    else if(typeof mecdata !== 'undefined')
8624    {
8625        date_splite = mecdata.datepicker_format.split( '&' );
8626        if(date_splite[0] !== undefined && date_splite.length == 2) datepicker_format = date_splite[0];
8627    }
8628
8629    $('[id^="mec-book-form-btn-step"]').on('click',function()
8630    {
8631        setTimeout(function()
8632        {
8633            if($.fn.datepicker)
8634            {
8635                if('date' !== $('.mec-date-picker').prop('type'))
8636                {
8637                    $('.mec-date-picker').datepicker(
8638                    {
8639                        changeYear: true,
8640                        changeMonth: true,
8641                        dateFormat: datepicker_format,
8642                        gotoCurrent: true,
8643                        yearRange: 'c-3:c+5',
8644                    });
8645                }
8646
8647            }
8648        }, 1000);
8649    });
8650
8651    if($.fn.datepicker)
8652    {
8653        mecEnhanceDatepickerAccessibility($('.mec-date-picker, .mec_date_picker_dynamic_format, .mec_date_picker, .mec_date_picker_dynamic_format_start, .mec_date_picker_dynamic_format_end, #mec_start_date, #mec_end_date, #mec_date_repeat_end_at_date'));
8654
8655        $('.mec-date-picker').datepicker(
8656        {
8657            changeYear: true,
8658            changeMonth: true,
8659            dateFormat: datepicker_format,
8660            gotoCurrent: true,
8661            yearRange: 'c-3:c+5',
8662        });
8663
8664        $('#mec_start_date').datepicker(
8665        {
8666            changeYear: true,
8667            changeMonth: true,
8668            dateFormat: datepicker_format,
8669            gotoCurrent: true,
8670            yearRange: 'c-3:c+5',
8671            onSelect: function(value, i)
8672            {
8673                const end = $("#mec_end_date");
8674                if(value !== i.lastVal)
8675                {
8676                    end.datepicker("option", "minDate", value);
8677                }
8678
8679                if(end.val() === '')
8680                {
8681                    end.val(value);
8682                }
8683
8684                // Datepicker doesn't natively fire `change` on the input, so
8685                // trigger it to clear inline validation errors (audit issue #1).
8686                $(this).trigger('change');
8687            }
8688        });
8689
8690        $('#mec_end_date').datepicker(
8691        {
8692            changeYear: true,
8693            changeMonth: true,
8694            dateFormat: datepicker_format,
8695            gotoCurrent: true,
8696            yearRange: 'c-3:c+5',
8697            onSelect: function(value, i)
8698            {
8699                const start = $("#mec_start_date");
8700                if(value !== i.lastVal)
8701                {
8702                    start.datepicker("option", "maxDate", value);
8703                }
8704
8705                if(start.val() === '')
8706                {
8707                    start.val(value);
8708                }
8709
8710                // Datepicker doesn't natively fire `change` on the input, so
8711                // trigger it to clear inline validation errors (audit issue #1).
8712                $(this).trigger('change');
8713            }
8714        });
8715
8716        // ===== Combobox time control (audit R3) =====
8717        // A typeable field; typing filters a dropdown of every 5-minute slot.
8718        // The hidden [hour][minutes][ampm] fields stay in sync (looked up LOCALLY
8719        // inside the wrapper, so cloned rows — tickets — keep working). Save is
8720        // unchanged.
8721
8722        function mecTimeLabel(h24, min, is12)
8723        {
8724            var pad = function(n){ return (n < 10 ? '0' : '') + n; };
8725            if(is12)
8726            {
8727                var h12 = h24 % 12; if(h12 === 0) h12 = 12;
8728                return pad(h12) + ':' + pad(min) + ' ' + (h24 < 12 ? 'AM' : 'PM');
8729            }
8730            return pad(h24) + ':' + pad(min);
8731        }
8732
8733        // Write total-minutes-from-midnight into the hidden fields + sync the field.
8734        // Used by the duration auto-advance (start/end event time, which have ids).
8735        function mecWriteTime(prefix, totalMinutes)
8736        {
8737            totalMinutes = Math.max(0, Math.min(1439, totalMinutes));
8738            var hour24 = Math.floor(totalMinutes / 60);
8739            var min = Math.floor((totalMinutes % 60) / 5) * 5;
8740            var $h = $('#' + prefix + 'hour');
8741            if(!$h.length) return;
8742            var $ampm = $('#' + prefix + 'ampm');
8743            if($ampm.length)
8744            {
8745                var h12 = hour24 % 12; if(h12 === 0) h12 = 12;
8746                $h.val(h12);
8747                $ampm.val(hour24 < 12 ? 'AM' : 'PM');
8748            }
8749            else $h.val(hour24);
8750            $('#' + prefix + 'minutes').val(min);
8751            var $w = $('#' + prefix + 'time');
8752            if($w.length) $w.val(mecTimeLabel(hour24, min, $ampm.length > 0));
8753        }
8754
8755        function mecTimeInitOne($in)
8756            {
8757                // Use jQuery .data() (not a class) so that elements cloned via
8758                // .html() + .append() (MEC's ticket-add flow) are re-initialized.
8759                if(!$in.length || $in.data('mec-time-init')) return;
8760                $in.data('mec-time-init', true);
8761
8762            var $wrap = $in.closest('.mec-time-combo-wrap');
8763            if(!$wrap.length) return;
8764            var is12 = parseInt($in.data('format'), 10) !== 24;
8765            var $dd = $('<div class="mec-time-dd"><ul></ul></div>').appendTo('body');
8766            var $list = $dd.find('ul');
8767            var $clear = $wrap.find('.mec-time-clear');
8768            var hi = -1;
8769
8770            // Hidden fields are siblings inside the wrapper (local lookup).
8771            var $h = $wrap.find('.mec-time-hour');
8772            var $m = $wrap.find('.mec-time-minutes');
8773            var $ampm = $wrap.find('.mec-time-ampm');
8774            if(!$h.length) return; // not a combobox instance
8775
8776            var options = [];
8777            for(var i = 0; i < 288; i++)
8778            {
8779                var total = i * 5;
8780                options.push({total: total, label: mecTimeLabel(Math.floor(total / 60), total % 60, is12)});
8781            }
8782
8783            function toggleClear(){ $clear.toggle(!!$in.val()); }
8784
8785            function matches(term, label)
8786            {
8787                term = (term || '').toLowerCase().trim();
8788                if(!term) return true;
8789                if(label.toLowerCase().indexOf(term) > -1) return true;
8790                var td = term.replace(/\D/g, '');
8791                return td.length > 0 && label.replace(/\D/g, '').indexOf(td) > -1;
8792            }
8793
8794            function render(term)
8795            {
8796                $list.empty();
8797                options.forEach(function(o){ if(matches(term, o.label)) $('<li/>').text(o.label).data('total', o.total).appendTo($list); });
8798                hi = $list.children().length ? 0 : -1;
8799                highlight();
8800            }
8801
8802            function highlight()
8803            {
8804                $list.children().removeClass('mec-time-dd-active');
8805                if(hi >= 0) $list.children().eq(hi).addClass('mec-time-dd-active');
8806            }
8807
8808            function move(delta)
8809            {
8810                var n = $list.children().length;
8811                if(!n) return;
8812                hi = (hi + delta + n) % n;
8813                highlight();
8814                var $el = $list.children().eq(hi);
8815                if($el.length) $dd.scrollTop($el.position().top + $dd.scrollTop() - 60);
8816            }
8817
8818            function open()
8819            {
8820                render('');
8821                var pos = $in.offset();
8822                $dd.css({ left: pos.left + 'px', top: (pos.top + $in.outerHeight() + 2) + 'px', width: $in.outerWidth() + 'px' }).show();
8823            }
8824            function close(){ $dd.hide(); hi = -1; }
8825
8826            function writeLocal(total)
8827            {
8828                var hour24 = Math.floor(total / 60);
8829                var min = Math.floor((total % 60) / 5) * 5;
8830                if($ampm.length)
8831                {
8832                    var h12 = hour24 % 12; if(h12 === 0) h12 = 12;
8833                    $h.val(h12);
8834                    $ampm.val(hour24 < 12 ? 'AM' : 'PM');
8835                }
8836                else $h.val(hour24);
8837                $m.val(min);
8838                $in.val(mecTimeLabel(hour24, min, is12));
8839            }
8840
8841            function readLocalH24()
8842            {
8843                var h24 = parseInt($h.val(), 10); if(isNaN(h24)) h24 = 0;
8844                if($ampm.length){ if($ampm.val() === 'PM' && h24 !== 12) h24 += 12; else if($ampm.val() === 'AM' && h24 === 12) h24 = 0; }
8845                return h24;
8846            }
8847
8848            function choose(total)
8849            {
8850                writeLocal(total);
8851                $in.trigger('change'); // duration auto-advance (#8)
8852                toggleClear();
8853                close();
8854            }
8855
8856            toggleClear();
8857
8858            // "Clear" (x) button: empty the text for retyping (hidden value preserved).
8859            $wrap.on('mousedown', '.mec-time-clear', function(e){ e.preventDefault(); $in.val(''); open(); $in.focus(); toggleClear(); });
8860
8861            $in.on('focus', function(){ open(); });
8862            $in.on('click', function(){ if(!$dd.is(':visible')) open(); });
8863            $in.on('input', function(){ if(!$dd.is(':visible')) $dd.show(); render($in.val()); toggleClear(); });
8864            $in.on('keydown', function(e)
8865            {
8866                if(e.key === 'ArrowDown'){ e.preventDefault(); if(!$dd.is(':visible')) open(); else move(1); }
8867                else if(e.key === 'ArrowUp'){ e.preventDefault(); move(-1); }
8868                else if(e.key === 'Enter'){ if(hi >= 0){ e.preventDefault(); var t = $list.children().eq(hi).data('total'); if(t !== undefined) choose(t); } }
8869                else if(e.key === 'Escape'){ close(); }
8870                else if(e.key === 'Tab'){ close(); }
8871            });
8872            $list.on('mousedown', 'li', function(e){ e.preventDefault(); choose($(this).data('total')); });
8873            $in.on('blur', function()
8874            {
8875                setTimeout(function()
8876                {
8877                    close();
8878                    var val = ($in.val() || '').trim();
8879                    var found = null;
8880                    for(var k = 0; k < options.length; k++){ if(options[k].label.toLowerCase() === val.toLowerCase()){ found = options[k]; break; } }
8881                    if(found) writeLocal(found.total);
8882                    else
8883                    {
8884                        var h24 = readLocalH24();
8885                        var mm = parseInt($m.val(), 10) || 0;
8886                        $in.val(mecTimeLabel(h24, mm, is12));
8887                    }
8888                    toggleClear();
8889                }, 150);
8890            });
8891        }
8892
8893        function mecInitTimeCombos(){ $('.mec-time-combo').each(function(){ mecTimeInitOne($(this)); }); }
8894
8895        mecInitTimeCombos();
8896
8897        // Re-init comboboxes added dynamically (in_days rows, tickets, appointments, popup modal).
8898        if(typeof MutationObserver !== 'undefined')
8899        {
8900            var mecTimeMO = new MutationObserver(function(mutations)
8901            {
8902                for(var i = 0; i < mutations.length; i++)
8903                {
8904                    var added = mutations[i].addedNodes;
8905                    for(var j = 0; j < added.length; j++)
8906                    {
8907                        var n = added[j];
8908                        if(n.nodeType === 1 && ((n.matches && (n.matches('.mec-time-combo') || n.matches('.mec-hourly-time'))) || (n.querySelector && (n.querySelector('.mec-time-combo') || n.querySelector('.mec-hourly-time')))))
8909                        {
8910                            setTimeout(function(){ mecInitTimeCombos(); mecInitHourlyTimes(); }, 30);
8911                            return;
8912                        }
8913                    }
8914                }
8915            });
8916            mecTimeMO.observe(document.body, {childList: true, subtree: true});
8917        }
8918
8919        // Close dropdowns when clicking outside (dropdown is in <body>, not the wrap).
8920        var $activeDDs = $(); // track dropdowns created by comboboxes
8921        $(document).on('mousedown', function(e)
8922        {
8923            $('.mec-time-dd').each(function()
8924            {
8925                if(this !== e.target && !this.contains(e.target))
8926                {
8927                    var $w = $(this);
8928                    var $combo = $w.prevAll('.mec-time-combo-wrap').first().find('.mec-time-combo');
8929                    // Simple check: if click is not in this dropdown and not in any combo wrap
8930                    var inCombo = false;
8931                    $('.mec-time-combo-wrap').each(function(){ if(this.contains(e.target)) inCombo = true; });
8932                    $('.mec-hourly-time-wrap').each(function(){ if(this.contains(e.target)) inCombo = true; });
8933                    if(!inCombo) $w.hide();
8934                }
8935            });
8936        });
8937
8938        // ===== Hourly schedule string time combobox (audit #5) =====
8939        // Same UX as the R3 combobox, but the value lives in a single text
8940        // field (the hourly schedule stores "from"/"to" as raw strings echoed
8941        // on the front-end), so we read/write the input directly — no hidden
8942        // fields, no storage change.
8943
8944        function mecParseTimeString(str, is12)
8945        {
8946            str = (str || '').trim().toUpperCase();
8947            if(!str) return null;
8948            var m = str.match(/^(\d{1,2})[:.\s](\d{1,2})\s*(AM|PM)?$/);
8949            if(!m) return null;
8950            var h = parseInt(m[1], 10);
8951            var min = parseInt(m[2], 10);
8952            if(isNaN(h) || isNaN(min) || h < 0 || h > 23 || min < 0 || min > 59) return null;
8953            var ap = m[3];
8954            if(ap === 'PM' && h !== 12) h += 12;
8955            else if(ap === 'AM' && h === 12) h = 0;
8956            return h * 60 + min;
8957        }
8958
8959        function mecHourlyTimeInitOne($in)
8960        {
8961            // Use jQuery .data() (not a class) so dynamically added rows are re-initialized.
8962            if(!$in.length || $in.data('mec-time-init')) return;
8963            $in.data('mec-time-init', true);
8964
8965            var $wrap = $in.closest('.mec-hourly-time-wrap');
8966            if(!$wrap.length) return;
8967            var is12 = parseInt($in.data('format'), 10) !== 24;
8968            var $dd = $('<div class="mec-time-dd"><ul></ul></div>').appendTo('body');
8969            var $list = $dd.find('ul');
8970            var $clear = $wrap.find('.mec-time-clear');
8971            var hi = -1;
8972
8973            var options = [];
8974            for(var i = 0; i < 288; i++)
8975            {
8976                var total = i * 5;
8977                options.push({total: total, label: mecTimeLabel(Math.floor(total / 60), total % 60, is12)});
8978            }
8979
8980            function toggleClear(){ $clear.toggle(!!$in.val()); }
8981
8982            function matches(term, label)
8983            {
8984                term = (term || '').toLowerCase().trim();
8985                if(!term) return true;
8986                if(label.toLowerCase().indexOf(term) > -1) return true;
8987                var td = term.replace(/\D/g, '');
8988                return td.length > 0 && label.replace(/\D/g, '').indexOf(td) > -1;
8989            }
8990
8991            function highlight()
8992            {
8993                $list.children().removeClass('mec-time-dd-active');
8994                if(hi >= 0) $list.children().eq(hi).addClass('mec-time-dd-active');
8995            }
8996
8997            function render(term)
8998            {
8999                $list.empty();
9000                options.forEach(function(o){ if(matches(term, o.label)) $('<li/>').text(o.label).data('total', o.total).appendTo($list); });
9001                hi = $list.children().length ? 0 : -1;
9002                highlight();
9003            }
9004
9005            function move(delta)
9006            {
9007                var n = $list.children().length;
9008                if(!n) return;
9009                hi = (hi + delta + n) % n;
9010                highlight();
9011                var $el = $list.children().eq(hi);
9012                if($el.length) $dd.scrollTop($el.position().top + $dd.scrollTop() - 60);
9013            }
9014
9015            function open()
9016            {
9017                render('');
9018                // Highlight the current value if parseable.
9019                var cur = mecParseTimeString($in.val(), is12);
9020                if(cur !== null)
9021                {
9022                    var snapped = Math.floor(cur / 5) * 5;
9023                    $list.children().each(function(){ if($(this).data('total') === snapped){ hi = $(this).index(); return false; } });
9024                    highlight();
9025                }
9026                var pos = $in.offset();
9027                $dd.css({ left: pos.left + 'px', top: (pos.top + $in.outerHeight() + 2) + 'px', width: $in.outerWidth() + 'px' }).show();
9028            }
9029            function close(){ $dd.hide(); hi = -1; }
9030
9031            function choose(total)
9032            {
9033                var hour24 = Math.floor(total / 60);
9034                var min = total % 60;
9035                $in.val(mecTimeLabel(hour24, min, is12)).trigger('change');
9036                toggleClear();
9037                close();
9038            }
9039
9040            toggleClear();
9041
9042            // "Clear" (x) button: empty the text for retyping.
9043            $wrap.on('mousedown', '.mec-time-clear', function(e){ e.preventDefault(); $in.val(''); open(); $in.focus(); toggleClear(); });
9044
9045            $in.on('focus', function(){ open(); });
9046            $in.on('click', function(){ if(!$dd.is(':visible')) open(); });
9047            $in.on('input', function(){ if(!$dd.is(':visible')) $dd.show(); render($in.val()); toggleClear(); });
9048            $in.on('keydown', function(e)
9049            {
9050                if(e.key === 'ArrowDown'){ e.preventDefault(); if(!$dd.is(':visible')) open(); else move(1); }
9051                else if(e.key === 'ArrowUp'){ e.preventDefault(); move(-1); }
9052                else if(e.key === 'Enter'){ if(hi >= 0){ e.preventDefault(); var t = $list.children().eq(hi).data('total'); if(t !== undefined) choose(t); } }
9053                else if(e.key === 'Escape'){ close(); }
9054                else if(e.key === 'Tab'){ close(); }
9055            });
9056            $list.on('mousedown', 'li', function(e){ e.preventDefault(); choose($(this).data('total')); });
9057            $in.on('blur', function()
9058            {
9059                setTimeout(function()
9060                {
9061                    close();
9062                    var val = ($in.val() || '').trim();
9063                    if(!val){ toggleClear(); return; }
9064                    // Snap typed text to the nearest 5-minute slot when parseable.
9065                    var total = mecParseTimeString(val, is12);
9066                    if(total !== null)
9067                    {
9068                        var snapped = Math.floor(total / 5) * 5;
9069                        $in.val(mecTimeLabel(Math.floor(snapped / 60), snapped % 60, is12));
9070                    }
9071                    toggleClear();
9072                }, 150);
9073            });
9074        }
9075
9076        function mecInitHourlyTimes(){ $('.mec-hourly-time').each(function(){ mecHourlyTimeInitOne($(this)); }); }
9077
9078        mecInitHourlyTimes();
9079
9080        // ===== Admin event editor: required-field + End >= Start validation =====
9081        // Audit issue #1: no required-field markers/validation in the admin editor.
9082        (function()
9083        {
9084            var $postForm = $('#post');
9085            var $startDate = $('#mec_start_date');
9086            var $endDate = $('#mec_end_date');
9087            // Only relevant on the admin event editor (#post form with MEC date fields).
9088            if(!$postForm.length || !$startDate.length) return;
9089
9090            var mecVL = (typeof mec_admin_localize !== 'undefined') ? mec_admin_localize : {};
9091            var warningsAcknowledged = false;
9092
9093            // MEC reusable notice system — modern card with accent bar, type-aware,
9094            // dismissible. Supports title, message/items, primary + dismiss buttons.
9095            function mecNotice(opts)
9096            {
9097                var o = $.extend({
9098                    type: 'info',          // error | warning | info | success
9099                    title: '',
9100                    message: '',
9101                    items: [],
9102                    primaryText: '',
9103                    primaryAction: null,
9104                    dismissText: '',
9105                    container: '#poststuff',
9106                    id: 'mec-notice-' + Date.now()
9107                }, opts);
9108
9109                $('.mec-notice-temp').remove();
9110
9111                var body = '';
9112                if(o.title) body += '<div class="mec-notice-title">' + o.title + '</div>';
9113                if(o.items && o.items.length) body += '<ul class="mec-notice-list">' + o.items.map(function(i){ return '<li>' + i + '</li>'; }).join('') + '</ul>';
9114                else if(o.message) body += '<p class="mec-notice-text">' + o.message + '</p>';
9115
9116                if(o.primaryText || o.dismissText)
9117                {
9118                    body += '<div class="mec-notice-actions">';
9119                    if(o.primaryText) body += '<button type="button" class="mec-notice-btn mec-notice-btn--primary mec-notice-primary">' + o.primaryText + '</button>';
9120                    if(o.dismissText) body += '<button type="button" class="mec-notice-btn mec-notice-btn--ghost mec-notice-dismiss">' + o.dismissText + '</button>';
9121                    body += '</div>';
9122                }
9123
9124                var $n = $('<div/>', {
9125                    id: o.id,
9126                    'class': 'mec-notice mec-notice--' + o.type + ' mec-notice-temp',
9127                    html: '<div class="mec-notice-accent"></div><div class="mec-notice-body">' + body + '</div><div class="mec-notice-close" aria-label="Close" role="button" tabindex="0">&times;</div>'
9128                });
9129
9130                $(o.container).prepend($n);
9131                $('html, body').animate({scrollTop: $n.offset().top - 40}, 200);
9132
9133                $n.find('.mec-notice-dismiss, .mec-notice-close').on('click', function(){ $n.remove(); });
9134                if(o.primaryText)
9135                {
9136                    $n.find('.mec-notice-primary').on('click', function()
9137                    {
9138                        if(typeof o.primaryAction === 'function') o.primaryAction();
9139                        $n.remove();
9140                    });
9141                }
9142                return $n;
9143            }
9144
9145            function mecVLTab(tabId)
9146            {
9147                $('#mec_metabox_details .mec-add-event-tabs-link[data-href="' + tabId + '"]').trigger('click');
9148            }
9149
9150            function mecVLTime24(prefix)
9151            {
9152                var $h = $('#' + prefix + 'hour');
9153                if(!$h.length) return {hour: 0, min: 0};
9154                var hour = parseInt($h.val(), 10) || 0;
9155                var min = ($('#' + prefix + 'minutes').length) ? (parseInt($('#' + prefix + 'minutes').val(), 10) || 0) : 0;
9156                var $ampm = $('#' + prefix + 'ampm');
9157                if($ampm.length)
9158                {
9159                    if($ampm.val() === 'PM' && hour !== 12) hour += 12;
9160                    else if($ampm.val() === 'AM' && hour === 12) hour = 0;
9161                }
9162                return {hour: hour, min: min};
9163            }
9164
9165            // Write a 24h time (in total minutes since midnight) back into the
9166            // hour/minutes/ampm selects, respecting the active time format.
9167            function mecVLSetTime24(prefix, totalMinutes)
9168            {
9169                if(typeof mecWriteTime === 'function') mecWriteTime(prefix, totalMinutes);
9170            }
9171
9172            function mecVLParseDate($field)
9173            {
9174                var raw = $.trim($field.val() || '');
9175                if(!raw) return null;
9176                try
9177                {
9178                    return $.datepicker.parseDate(datepicker_format, raw);
9179                }
9180                catch(e)
9181                {
9182                    var fb = new Date(raw);
9183                    return isNaN(fb.getTime()) ? null : fb;
9184                }
9185            }
9186
9187            function mecVLShowError($field, message)
9188            {
9189                $field.addClass('mec-field-invalid').attr('aria-invalid', 'true');
9190                var $err = $field.next('.mec-field-error');
9191                if(!$err.length)
9192                {
9193                    $err = $('<span class="mec-field-error" role="alert"></span>');
9194                    $field.after($err);
9195                }
9196                $err.text(message);
9197            }
9198
9199            function mecVLClearError($field)
9200            {
9201                $field.removeClass('mec-field-invalid').removeAttr('aria-invalid');
9202                $field.next('.mec-field-error').remove();
9203            }
9204
9205            // Clear the inline error as soon as the user edits the field.
9206            $startDate.add($endDate).on('input change', function() { mecVLClearError($(this)); });
9207
9208            // Smart end time: when the start time changes, shift the end time to
9209            // preserve the event duration (Google Calendar behavior). Audit issue #8.
9210            var $startWidget = $('#mec_start_time');
9211            if($startWidget.length)
9212            {
9213                // Combobox mode (R3): the visible field is a text input; capture on
9214                // focus, shift on the 'change' the combobox dispatches on 
9214selection.
9215                var startBefore = null;
9216                $startWidget.on('focus', function()
9217                {
9218                    if($('#mec_allday').is(':checked')) return;
9219                    var t = mecVLTime24('mec_start_');
9220                    startBefore = t.hour * 60 + t.min;
9221                }).on('change', function()
9222                {
9223                    if(startBefore === null) return;
9224                    var t = mecVLTime24('mec_start_');
9225                    var now = t.hour * 60 + t.min;
9226                    var delta = now - startBefore;
9227                    startBefore = now;
9228                    if(!delta) return;
9229                    var e = mecVLTime24('mec_end_');
9230                    mecWriteTime('mec_end_', (e.hour * 60 + e.min) + delta);
9231                });
9232            }
9233            else
9234            {
9235                // Legacy 3-select mode: focus/change on the selects.
9236                var $startSelects = $('#mec_start_hour, #mec_start_minutes, #mec_start_ampm');
9237                if($startSelects.length)
9238                {
9239                    var legacyBefore = null;
9240                    $startSelects.on('focus', function()
9241                    {
9242                        if($('#mec_allday').is(':checked')) return;
9243                        var t = mecVLTime24('mec_start_');
9244                        legacyBefore = t.hour * 60 + t.min;
9245                    }).on('change', function()
9246                    {
9247                        if($('#mec_allday').is(':checked')) { legacyBefore = null; return; }
9248                        if(legacyBefore === null) return;
9249                        var t = mecVLTime24('mec_start_');
9250                        var now = t.hour * 60 + t.min;
9251                        var delta = now - legacyBefore;
9252                        legacyBefore = now;
9253                        if(delta === 0) return;
9254                        var e = mecVLTime24('mec_end_');
9255                        mecVLSetTime24('mec_end_', (e.hour * 60 + e.min) + delta);
9256                    });
9257                }
9258            }
9259
9260            $postForm.on('submit', function(e)
9261            {
9262                // Clear previous errors before re-validating.
9263                mecVLClearError($startDate);
9264                mecVLClearError($endDate);
9265
9266                // Publish-intent detection: enforce on every submit EXCEPT
9267                // explicit draft saves and previews. This covers the publish
9268                // button, Enter-key submits and any programmatic path — the
9269                // old "publishClicked" flag missed keyboard submits.
9270                var submitter = (e.originalEvent && e.originalEvent.submitter) ? $(e.originalEvent.submitter) : null;
9271                if(submitter && submitter.attr('id') === 'save-post') return;
9272                if($('#wp-preview').val() === 'dopreview') return;
9273
9274                // Undo WordPress core's URL rewrite: post.js appends
9275                // "wp-post-new-reload=true" to the address bar on every publish
9276                // click of an auto-draft, even when the submit ends up blocked.
9277                // Strip it so the misleading state doesn't linger.
9278                if(window.history && window.history.replaceState && window.location.href.indexOf('wp-post-new-reload') > -1)
9279                {
9280                    window.history.replaceState(null, null, window.location.href.replace(/([?&])wp-post-new-reload=true&?/, '$1').replace(/[?&]$/, ''));
9281                }
9282
9283                var startRaw = $.trim($startDate.val() || '');
9284                var endRaw = $.trim($endDate.val() || '');
9285
9286                // 1. Start Date is required.
9287                if(!startRaw)
9288                {
9289                    e.preventDefault();
9290                    mecVLTab('mec_meta_box_date_form');
9291                    mecVLShowError($startDate, mecVL.start_date_required || 'Please enter a start date for the event.');
9292                    $startDate.trigger('focus');
9293                    mecNotice({ type:'error', title:'Start date required', message: mecVL.start_date_required || 'Please enter a start date for the event.', dismissText:'Got it' });
9294                    return;
9295                }
9296
9297                // 2. End must be on or after Start.
9298                if(endRaw)
9299                {
9300                    var sDate = mecVLParseDate($startDate);
9301                    var eDate = mecVLParseDate($endDate);
9302                    if(sDate && eDate)
9303                    {
9304                        var allday = $('#mec_allday').is(':checked');
9305                        var sT = allday ? {hour: 0, min: 0} : mecVLTime24('mec_start_');
9306                        var eT = allday ? {hour: 0, min: 0} : mecVLTime24('mec_end_');
9307                        var start = new Date(sDate.getFullYear(), sDate.getMonth(), sDate.getDate(), sT.hour, sT.min, 0, 0);
9308                        var finish = new Date(eDate.getFullYear(), eDate.getMonth(), eDate.getDate(), eT.hour, eT.min, 0, 0);
9309
9310                        if(finish.getTime() < start.getTime())
9311                        {
9312                            e.preventDefault();
9313                            mecVLTab('mec_meta_box_date_form');
9314                            mecVLShowError($endDate, mecVL.end_after_start || 'The end date and time must be on or after the start date and time.');
9315                            $endDate.trigger('focus');
9316                            mecNotice({ type:'error', title:'End is before start', message: mecVL.end_after_start || 'The end date and time must be on or after the start date and time.', dismissText:'Got it' });
9317                            return;
9318                        }
9319                    }
9320                }
9321
9322                // ===== R5: Extended pre-publish checks =====
9323                var warnings = [];
9324                var $bookingBox = $('#mec_metabox_booking');
9325                $('.mec-notice-temp').remove();
9326
9327                // Only treat as "bookable" if there are real tickets (with names).
9328                // A blank default ticket row is NOT a real ticket.
9329                var $realTickets = $('#mec-tickets input[name*="[name]"]').filter(function(){ return $.trim($(this).val()) !== ''; });
9330                var hasTickets = $realTickets.length > 0;
9331
9332                // --- BLOCKS (prevent publish) ---
9333                // B3: certain_weekdays + none checked
9334                if($('#mec_repeat').is(':checked') && $('#mec_repeat_type').val() === 'certain_weekdays' && $('input[name="mec[date][repeat][certain_weekdays][]"]:checked').length === 0)
9335                {
9336                    e.preventDefault(); mecVLTab('mec_meta_box_repeat_form');
9337                    mecNotice({ type:'error', title:'No weekdays selected', message:'Repeating is set to "Certain Weekdays" but no weekdays are checked.', dismissText:'Got it' });
9338                    return;
9339                }
9340                // B4: occurrences = 0
9341                var $endRadio = $('#mec_repeat_end_type').length ? $('#mec_repeat_end_type') : $('input[name="mec[date][repeat][end]"]:checked');
9342                if($endRadio.val() === 'occurrences')
9343                {
9344                    var occ = parseInt($('#mec_date_repeat_end_at_occurrences').val(), 10);
9345                    if(isNaN(occ) || occ <= 0)
9346                    {
9347                        e.preventDefault(); mecVLTab('mec_meta_box_repeat_form');
9348                        mecNotice({ type:'error', title:'Invalid occurrence count', message:'The number of occurrences must be at least 1.', dismissText:'Got it' });
9349                        return;
9350                    }
9351                }
9352
9353                // --- WARNINGS (allow publish with confirmation) ---
9354                // Booking-specific warnings only if there are real tickets
9355                if(hasTickets)
9356                {
9357                    // W2: ticket with name but no price
9358                    $realTickets.each(function(){
9359                        var $name = $(this);
9360                        var $row = $name.closest('.mec-ticket-start-time, .wn-ticket-time').parent();
9361                        var $price = $row.find('input[name*="price"]');
9362                        if(!$price.length) $price = $name.closest('[class*="ticket"]').find('input[name*="price"]');
9363                        if($price.length && $.trim($price.val()) === '') warnings.push('A ticket has a name but no price set.');
9364                    });
9365                    // W3: cost empty on bookable event with tickets
9366                    if($.trim($('#mec_cost').val()) === '' && !$('#mec_cost_is_free').is(':checked') && !$('#mec_cost_auto_calculate').is(':checked')) warnings.push('This event has tickets but no cost is displayed.');
9367                }
9368                // W4: no featured image
9369                if(!$('#set-post-thumbnail img').length && !$('#postimagediv img').length) warnings.push('No featured image set.');
9370                // W5: no content
9371                var c = (typeof tinymce !== 'undefined' && tinymce.get('content')) ? tinymce.get('content').getContent() : ($('#content').val() || '');
9372                if($.trim(c.replace(/<[^>]*>/g, '')) === '') warnings.push('No event description/content.');
9373                // W6: no location
9374                var lv = $('#mec_location_id').val(); if(!lv || lv === '0' || lv === '1') warnings.push('No location set.');
9375                // W7: no organizer
9376                var ov = $('#mec_organizer_id').val(); if(!ov || ov === '0' || ov === '1') warnings.push('No organizer set.');
9377                // W8: occurrences <= 1
9378                if($endRadio.val() === 'occurrences'){ var ow = parseInt($('#mec_date_repeat_end_at_occurrences').val(), 10); if(!isNaN(ow) && ow <= 1) warnings.push('Repeat ends after only ' + ow + ' occurrence(s).'); }
9379                // W10: zero duration
9380                if(!$('#mec_allday').is(':checked')){ var sT = mecVLTime24('mec_start_'), eT = mecVLTime24('mec_end_'); if(sT && eT && sT.hour === eT.hour && sT.min === eT.min) warnings.push('Start and end times are identical (zero duration).'); }
9381
9382                if(!warningsAcknowledged && warnings.length > 0)
9383                {
9384                    e.preventDefault();
9385                    mecNotice({
9386                        type:'warning',
9387                        title:'Publishing with warnings',
9388                        items: warnings,
9389                        primaryText:'Publish anyway',
9390                        primaryAction: function(){ warningsAcknowledged = true; $('#publish').trigger('click'); },
9391                        dismissText:'Go back and fix'
9392                    });
9393                    return;
9394                }
9395            });
9396        })();
9397
9398        // ===== Unsaved-changes protection for MEC meta boxes =====
9399        // Audit issue #10. Warn before navigating away with unsaved MEC edits.
9400        (function()
9401        {
9402            var mecDirty = false;
9403            var $scope = $('#mec_metabox_details, #mec_metabox_booking, #mec_metabox_visibility, #mec_metabox_gallery');
9404
9405            // Ignore spurious change/input events fired by 3rd-party init scripts
9406            // (nice-select, select2, color picker, etc.) before the user interacts.
9407            var mecUserInteracted = false;
9408            $('#post').one('mousedown keydown', function() { mecUserInteracted = true; });
9409
9410            $scope.on('change input', 'input, select, textarea', function() {
9411                if(mecUserInteracted) mecDirty = true;
9412            });
9413
9414            // Clear the dirty flag when the post actually submits. Must run AFTER
9415            // the validation handler so preventDefault (invalid form) keeps the flag.
9416            $('#post').on('submit', function(e)
9417            {
9418                if(!e.isDefaultPrevented()) mecDirty = false;
9419            });
9420
9421            $(window).on('beforeunload', function(e)
9422            {
9423                if(mecDirty)
9424                {
9425                    e.preventDefault();
9426                    e.returnValue = '';
9427                    return '';
9428                }
9429            });
9430        })();
9431
9432        $('#mec_date_repeat_end_at_date').datepicker(
9433        {
9434            changeYear: true,
9435            changeMonth: true,
9436            dateFormat: datepicker_format,
9437            gotoCurrent: true,
9438            yearRange: 'c-3:c+5',
9439        });
9440
9441        $('.mec_date_picker_dynamic_format').datepicker(
9442        {
9443            changeYear: true,
9444            changeMonth: true,
9445            dateFormat: datepicker_format,
9446            gotoCurrent: true,
9447            yearRange: 'c-3:c+5',
9448        });
9449
9450        // End Repeat: conditional fields driven by the type <select> (was radios).
9451        // Date field shows only for "date", occurrences field only for "occurrences".
9452        $('#mec_repeat_end_type').on('change', function()
9453        {
9454            var v = $(this).val();
9455            $('.mec-end-repeat-date-wrap').toggleClass('mec-is-hidden', v !== 'date');
9456            $('.mec-end-repeat-occurrences-wrap').toggleClass('mec-is-hidden', v !== 'occurrences');
9457        });
9458
9459        $('.mec_date_picker').datepicker(
9460        {
9461            changeYear: true,
9462            changeMonth: true,
9463            dateFormat: 'yy-mm-dd',
9464            gotoCurrent: true,
9465            yearRange: 'c-3:c+5',
9466        });
9467
9468        $('.mec_date_picker_dynamic_format_start').datepicker(
9469        {
9470            changeYear: true,
9471            changeMonth: true,
9472            dateFormat: datepicker_format,
9473            gotoCurrent: true,
9474            yearRange: 'c-1:c+5',
9475            onSelect: function(date)
9476            {
9477                var selectedDate;
9478
9479                try
9480                {
9481                    selectedDate = $.datepicker.parseDate(datepicker_format, date);
9482                }
9483                catch(e)
9484                {
9485                    selectedDate = new Date(date);
9486                }
9487
9488                if(!(selectedDate instanceof Date) || isNaN(selectedDate.getTime())) return;
9489
9490                var endDate = new Date(selectedDate.getTime());
9491
9492                var $end_picker = $(this).next();
9493                $end_picker.datepicker("option", "minDate", endDate);
9494                $end_picker.datepicker("option", "maxDate", '+5y');
9495
9496                $(this).trigger('change');
9497            }
9498        });
9499
9500        $('.mec_date_picker_dynamic_format_end').datepicker(
9501        {
9502            changeYear: true,
9503            changeMonth: true,
9504            dateFormat: datepicker_format,
9505            gotoCurrent: true,
9506            yearRange: 'c-1:c+5',
9507        });
9508
9509        trigger_period_picker();
9510    }
9511
9512    // Initialize WP Color Picker
9513    if($.fn.wpColorPicker) jQuery('.mec-color-picker').wpColorPicker();
9514
9515    $('#mec_location_id').on('change', function()
9516    {
9517        mec_location_toggle();
9518
9519        // Mirror of the Other Organizers behavior: "Other Locations" is only
9520        // available once a real main location is selected (not "Hide location" = 1).
9521        var mec_location_val = parseInt($(this).val());
9522        if(mec_location_val != 1) $('#mec-additional-location-wrap').show();
9523        else $('#mec-additional-location-wrap').hide();
9524    });
9525
9526    $('#mec_organizer_id').on('change', function()
9527    {
9528        mec_organizer_toggle();
9529        var mec_organizer_val = parseInt($(this).val());
9530
9531        // Direct ID lookup — the wrap is a sibling of the select's row, so
9532        // the old ".parent().parent().find(...)" traversal never reached it.
9533        if(mec_organizer_val != 1) $('#mec-additional-organizer-wrap').show();
9534        else $('#mec-additional-organizer-wrap').hide();
9535    });
9536
9537    mec_location_toggle();
9538    mec_organizer_toggle();
9539
9540    $('#mec_repeat').on('change', function()
9541    {
9542        mec_repeat_toggle();
9543    });
9544
9545    mec_repeat_toggle();
9546
9547    $('#mec_repeat_type').on('change', function()
9548    {
9549        mec_repeat_type_toggle();
9550    });
9551
9552    mec_repeat_type_toggle();
9553
9554    // "This event is free" toggle: sets the cost field to 0 (which the frontend
9555    // renders as "Free") and locks it, preserving the previous value to restore.
9556    // Audit issue #15.
9557    (function()
9558    {
9559        var $toggle = $('#mec_cost_is_free');
9560        var $cost = $('#mec_cost');
9561        if(!$toggle.length || !$cost.length) return;
9562
9563        function applyFree()
9564        {
9565            if($toggle.is(':checked'))
9566            {
9567                $cost.data('prev-cost', $cost.val());
9568                $cost.val('0').prop('readonly', true).addClass('mec-cost-locked');
9569            }
9570            else
9571            {
9572                $cost.prop('readonly', false).removeClass('mec-cost-locked');
9573                var prev = $cost.data('prev-cost');
9574                if(typeof prev !== 'undefined') $cost.val(prev);
9575            }
9576        }
9577
9578        $toggle.on('change', applyFree);
9579        applyFree();
9580    })();
9581
9582    // ===== Accessibility: ARIA tabs + keyboard nav + focusable tooltips =====
9583    // Audit issue #3. Enhances the existing tab markup in place (no PHP changes).
9584    function mecEnhanceTabs(cfg)
9585    {
9586        var $ctx = $(cfg.context);
9587        if(!$ctx.length) return;
9588        var $tablist = $ctx.find(cfg.tablist);
9589        var $tabs = $ctx.find(cfg.tab);
9590        var $panels = $ctx.find(cfg.panel);
9591        if(!$tabs.length) return;
9592
9593        $tablist.attr('role', 'tablist');
9594
9595        $tabs.each(function() {
9596            var $t = $(this);
9597            var panelId = $t.attr('data-href');
9598            var tabId = $t.attr('id') || (panelId + '-tab');
9599            var active = $t.hasClass('mec-tab-active');
9600            $t.attr({
9601                'id': tabId,
9602                'role': 'tab',
9603                'aria-controls': panelId,
9604                'aria-selected': active ? 'true' : 'false',
9605                'tabindex': active ? '0' : '-1'
9606            });
9607        });
9608
9609        $panels.each(function() {
9610            var $p = $(this);
9611            $p.attr({
9612                'role': 'tabpanel',
9613                'aria-labelledby': $p.attr('id') + '-tab',
9614                'aria-hidden': $p.hasClass('mec-tab-active') ? 'false' : 'true'
9615            });
9616        });
9617
9618        function syncTabs()
9619        {
9620            $tabs.each(function() {
9621                var $t = $(this);
9622                var active = $t.hasClass('mec-tab-active');
9623                $t.attr('aria-selected', active ? 'true' : 'false');
9624                $t.attr('tabindex', active ? '0' : '-1');
9625            });
9626            $panels.each(function() {
9627                $(this).attr('aria-hidden', $(this).hasClass('mec-tab-active') ? 'false' : 'true');
9628            });
9629        }
9630
9631        // Keep ARIA state in sync after the existing inline click handlers switch tabs.
9632        $tablist.on('click', cfg.tab, function() { syncTabs(); });
9633
9634        // Keyboard navigation (automatic activation): arrows + Home/End.
9635        $tablist.on('keydown', cfg.tab, function(e) {
9636            var idx = $tabs.index(this);
9637            var $target = null;
9638            switch(e.key) {
9639                case 'ArrowRight': case 'ArrowDown': $target = $tabs.eq(idx + 1); break;
9640                case 'ArrowLeft': case 'ArrowUp': $target = $tabs.eq(idx - 1); break;
9641                case 'Home': $target = $tabs.first(); break;
9642                case 'End': $target = $tabs.last(); break;
9643                case 'Enter': case ' ':
9644                    e.preventDefault();
9645                    $(this).trigger('click');
9646                    this.focus();
9647                    return;
9648                default: return;
9649            }
9650            if($target && $target.length) {
9651                e.preventDefault();
9652                $target.trigger('click'); // activate (existing handler runs, then syncTabs)
9653                $target[0].focus();
9654            }
9655        });
9656    }
9657
9658    mecEnhanceTabs({
9659        context: '#mec_metabox_details',
9660        tablist: '.mec-add-event-tabs-left',
9661        tab: '.mec-add-event-tabs-link',
9662        panel: '.mec-event-tab-content'
9663    });
9664    mecEnhanceTabs({
9665        context: '#mec_metabox_booking',
9666        tablist: '.mec-add-booking-tabs-left',
9667        tab: '.mec-add-booking-tabs-link',
9668        panel: '.mec-booking-tab-content'
9669    });
9670
9671    // Make hover-only help tooltips keyboard accessible (audit issue #3).
9672    $('.mec-tooltip').each(function(idx) {
9673        var $tip = $(this);
9674        var $box = $tip.find('.box').first();
9675        var $icon = $tip.find('i').first();
9676        if(!$box.length || !$icon.length) return;
9677        var boxId = $box.attr('id') || ('mec-tip-' + idx);
9678        $box.attr('id', boxId);
9679        $icon.attr({
9680            'tabindex': '0',
9681            'role': 'button',
9682            'aria-describedby': boxId
9683        });
9684        if(!$icon.attr('aria-label') && !$icon.attr('title')) {
9685            var title = $tip.find('.title').first().text();
9686            $icon.attr('aria-label', title || 'More information');
9687        }
9688    });
9689
9690    // ===== Recurrence summary + next-5 preview =====
9691    // Audit issue #6. Live, human-readable rule summary + next occurrences,
9692    // computed from the event start date (not "today").
9693    (function()
9694    {
9695        var $box = $('#mec-repeat-preview');
9696        var $body = $box.find('.mec-repeat-preview-body');
9697        var $form = $('#mec_meta_box_repeat_form');
9698        if(!$box.length || !$body.length || !$form.length) return;
9699
9700        var loc = (typeof mec_admin_localize !== 'undefined') ? mec_admin_localize : ((typeof mecdata !== 'undefined') ? mecdata : {});
9701        var units = loc.interval_units || {};
9702        var PREVIEW_MAX = 5;
9703
9704        function parseDate($field)
9705        {
9706            var raw = $.trim($field.val() || '');
9707            if(!raw) return null;
9708            try { return $.datepicker.parseDate(datepicker_format, raw); }
9709            catch(e) { var d = new Date(raw); return isNaN(d.getTime()) ? null : d; }
9710        }
9711
9712        function fmt(date)
9713        {
9714            try { return $.datepicker.formatDate(datepicker_format, date); }
9715            catch(e) { return date.toDateString(); }
9716        }
9717
9718        function addDays(d, n){ var x = new Date(d.getTime()); x.setDate(x.getDate() + n); return x; }
9719        function addMonths(d, n){ var x = new Date(d.getTime()); x.setMonth(x.getMonth() + n); return x; }
9720        function addYears(d, n){ var x = new Date(d.getTime()); x.setFullYear(x.getFullYear() + n); return x; }
9721
9722        // MEC weekday number (1=Mon..7=Sun) -> JS getDay() (0=Sun..6=Sat)
9723        function mecDayToJs(n){ n = parseInt(n, 10); return n === 7 ? 0 : n; }
9724
9725        function readEnd()
9726        {
9727            var end = ($('#mec_repeat_end_type').length ? $('#mec_repeat_end_type').val() : $('input[name="mec[date][repeat][end]"]:checked').val());
9728            var endDate = null, maxOcc = null;
9729            if(end === 'date') endDate = parseDate($('#mec_date_repeat_end_at_date'));
9730            else if(end === 'occurrences')
9731            {
9732                var n = parseInt($('#mec_date_repeat_end_at_occurrences').val(), 10);
9733                if(n > 0) maxOcc = n;
9734            }
9735            return {type: end || 'never', endDate: endDate, maxOcc: maxOcc};
9736        }
9737
9738        function generate(type, interval, start, weekdays, end)
9739        {
9740            var dates = [];
9741            var guard = 0;
9742            // Generate one extra beyond the display cap so the UI can detect
9743            // truncation and show a "+N more" chip. Only PREVIEW_MAX are shown.
9744            var max = end.maxOcc ? Math.min(end.maxOcc, PREVIEW_MAX + 1) : (PREVIEW_MAX + 1);
9745            var endDateMs = end.endDate ? end.endDate.getTime() : null;
9746
9747            function pushIfValid(d)
9748            {
9749                if(endDateMs !== null && d.getTime() > endDateMs) return false;
9750                dates.push(d);
9751                return dates.length < max;
9752            }
9753
9754            if(type === 'daily' || type === 'weekly')
9755            {
9756                var stepDays = (type === 'weekly' ? Math.max(1, interval) * 7 : Math.max(1, interval));
9757                var d = new Date(start.getTime());
9758                while(dates.length < max && guard++ < 10000){ if(!pushIfValid(d)) break; d = addDays(d, stepDays); }
9759            }
9760            else if(type === 'monthly')
9761            {
9762                var n = Math.max(1, interval);
9763                var d = new Date(start.getTime());
9764                while(dates.length < max && guard++ < 10000){ if(!pushIfValid(d)) break; d = addMonths(d, n); }
9765            }
9766            else if(type === 'yearly')
9767            {
9768                var n = Math.max(1, interval);
9769                var d = new Date(start.getTime());
9770                while(dates.length < max && guard++ < 10000){ if(!pushIfValid(d)) break; d = addYears(d, n); }
9771            }
9772            else if(type === 'weekday' || type === 'weekend' || type === 'certain_weekdays')
9773            {
9774                var target;
9775                if(type === 'weekday') target = [1, 2, 3, 4, 5];
9776                else if(type === 'weekend') target = [0, 6];
9777                else target = weekdays.map(mecDayToJs);
9778                var d = new Date(start.getTime());
9779                while(dates.length < max && guard++ < 40000)
9780                {
9781                    if(target.indexOf(d.getDay()) !== -1){ if(!pushIfValid(d)) break; }
9782                    if(endDateMs !== null && d.getTime() > endDateMs) break;
9783                    d = addDays(d, 1);
9784                }
9785            }
9786            return dates;
9787        }
9788
9789        function buildSummary(type, interval, start, weekdays, end)
9790        {
9791            var s = '';
9792            var u = {daily: units.daily || 'days', weekly: units.weekly || 'weeks', monthly: units.monthly || 'months', yearly: units.yearly || 'years'};
9793            if(type === 'daily' || type === 'weekly' || type === 'monthly' || type === 'yearly')
9794            {
9795                var n = Math.max(1, interval);
9796                var unit = u[type];
9797                s = (n === 1) ? ('Every ' + unit.replace(/s$/, '')) : ('Every ' + n + ' ' + unit);
9798            }
9799            else if(type === 'weekday') s = 'Every weekday (Mon-Fri)';
9800            else if(type === 'weekend') s = 'Every weekend (Sat-Sun)';
9801            else if(type === 'certain_weekdays') s = weekdays.length ? ('Weekly on ' + weekdays.length + ' day(s)') : 'No weekdays selected';
9802            else if(type === 'custom_days') s = 'On the custom dates listed above';
9803            else if(type === 'advanced') s = 'Advanced repeating pattern';
9804            else s = type;
9805
9806            if(start) s += ', starting ' + fmt(start);
9807            if(end.type === 'date' && end.endDate) s += ', until ' + fmt(end.endDate);
9808            else if(end.type === 'occurrences' && end.maxOcc) s += ', for ' + end.maxOcc + ' occurrence' + (end.maxOcc === 1 ? '' : 's');
9809            else s += ', no end';
9810            return s;
9811        }
9812
9813        function update()
9814        {
9815            if(!$('#mec_repeat').is(':checked'))
9816            {
9817                $box.hide();
9818                return;
9819            }
9820            $box.show();
9821
9822            var type = $('#mec_repeat_type').val();
9823            var interval = parseInt($('#mec_repeat_interval').val(), 10);
9824            if(isNaN(interval) || interval < 1) interval = 1;
9825            var start = parseDate($('#mec_start_date'));
9826            var weekdays = [];
9827            $('input[name="mec[date][repeat][certain_weekdays][]"]:checked').each(function(){ weekdays.push($(this).val()); });
9828            var end = readEnd();
9829
9830            var html = '<p class="mec-repeat-preview-summary">' + buildSummary(type, interval, start, weekdays, end) + '</p>';
9831
9832            var previewable = ['daily', 'weekly', 'monthly', 'yearly', 'weekday', 'weekend', 'certain_weekdays'];
9833            if(start && previewable.indexOf(type) !== -1)
9834            {
9835                if(type === 'certain_weekdays' && !weekdays.length)
9836                {
9837                    html += '<p class="mec-repeat-preview-empty">' + (loc.repeat_preview_no_weekdays || 'Select weekdays to preview dates.') + '</p>';
9838                }
9839                else
9840                {
9841                    var dates = generate(type, interval, start, weekdays, end);
9842                    var total = '';
9843                    if(end.type === 'occurrences' && end.maxOcc) total = end.maxOcc;
9844                    else if(end.type === 'date' && dates.length < PREVIEW_MAX) total = dates.length;
9845
9846                    if(dates.length)
9847                    {
9848                        var shown = Math.min(dates.length, PREVIEW_MAX);
9849                        var items = dates.slice(0, PREVIEW_MAX).map(function(d){ return '<li>' + fmt(d) + '</li>'; }).join('');
9850                        // Truncation indicator: when more occurrences exist than
9851                        // shown, append a muted chip so the user understands the 5
9852                        // dates are samples (resolves "5 shown vs. N total" confusion).
9853                        if(dates.length > PREVIEW_MAX)
9854                        {
9855                            var moreText = '…';
9856                            if(total !== '' && parseInt(total, 10) > shown)
9857                            {
9858                                moreText = (loc.repeat_preview_more || '+ %d more').replace('%d', parseInt(total, 10) - shown);
9859                            }
9860                            items += '<li class="mec-repeat-preview-more">' + moreText + '</li>';
9861                        }
9862                        html += '<div class="mec-repeat-preview-dates"><span class="mec-repeat-preview-label">' + (loc.repeat_preview_next || 'Next occurrences (from start date)') + ':</span><ul>' + items + '</ul></div>';
9863                    }
9864                    if(total !== '') html += '<span class="mec-repeat-preview-count">' + (loc.repeat_preview_total || 'This event will occur %d times in total.').replace('%d', total) + '</span>';
9865                }
9866            }
9867            else if(!start)
9868            {
9869                html += '<p class="mec-repeat-preview-empty">' + (loc.repeat_preview_need_start || 'Enter a start date to preview dates.') + '</p>';
9870            }
9871
9872            $body.html(html);
9873        }
9874
9875        $form.on('change input', 'input, select', update);
9876        $('#mec_start_date').on('change input', update);
9877        update();
9878    })();
9879
9880    // ===== Currency options live preview (audit #11) =====
9881    // Mirrors main::render_price() so the sample matches the real front-end.
9882    (function()
9883    {
9884        var $preview = $('#mec_currency_preview');
9885        if(!$preview.length) return;
9886
9887        var sample = parseFloat($preview.data('sample'));
9888        if(isNaN(sample)) sample = 1234.5;
9889        var defaultSign = $preview.data('default-sign') || '$';
9890
9891        // Equivalent of PHP number_format(amount, decs, decChar, thouChar).
9892        function format(amount, decs, decChar, thouChar)
9893        {
9894            decs = Math.max(0, parseInt(decs, 10) || 0);
9895            var s = amount.toFixed(decs);
9896            var parts = s.split('.');
9897            parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, thouChar);
9898            return parts.length > 1 ? parts[0] + decChar + parts[1] : parts[0];
9899        }
9900
9901        function val($el, fallback)
9902        {
9903            var v = $el.val();
9904            return (v === null || v === '') ? fallback : v;
9905        }
9906
9907        function update()
9908        {
9909            var sign = $.trim($('#mec_currency_currency_symptom').val()) || defaultSign;
9910            var pos = val($('#mec_currency_currency_sign'), 'before');
9911            var thou = val($('#mec_currency_thousand_separator'), ',');
9912            var decChar = val($('#mec_currency_decimal_separator'), '.');
9913            // "No decimal" checkbox is checked => decimal_separator_status = 0 => no decimals.
9914            var noDec = $('#mec_currency_decimal_separator_status').is(':checked');
9915            var decs = noDec ? 0 : Math.max(0, parseInt($('#mec_currency_decimals').val(), 10) || 0);
9916
9917            var num = format(sample, decs, (noDec ? '' : decChar), thou);
9918            var result;
9919            if(pos === 'after') result = num + sign;
9920            else if(pos === 'after_space') result = num + ' ' + sign;
9921            else if(pos === 'before_space') result = sign + ' ' + num;
9922            else result = sign + num;
9923
9924            $preview.text(result);
9925        }
9926
9927        $('#mec_currency_currency_symptom, #mec_currency_currency_sign, #mec_currency_thousand_separator, #mec_currency_decimal_separator, #mec_currency_decimals, #mec_currency_decimal_separator_status').on('input change', update);
9928        update();
9929    })();
9930
9931    // ===== Location duplicate-name guard =====
9932    // Audit issue #14. Warn when a newly typed location name matches an existing one.
9933    (function()
9934    {
9935        var $name = $('#mec_location_name');
9936        var $select = $('#mec_location_id');
9937        if(!$name.length || !$select.length) return;
9938
9939        var loc = (typeof mec_admin_localize !== 'undefined') ? mec_admin_localize : ((typeof mecdata !== 'undefined') ? mecdata : {});
9940
9941        // Build {lowercaseName: termId} from existing location options (exclude the special 0 / 1).
9942        var existing = {};
9943        $select.find('option').each(function()
9944        {
9945            var v = $(this).attr('value');
9946            if(v === '0' || v === '1') return;
9947            existing[$.trim($(this).text()).toLowerCase()] = v;
9948        });
9949
9950        var $warn = null;
9951        function clearWarn(){ if($warn){ $warn.remove(); $warn = null; } }
9952
9953        function showWarn(existingId)
9954        {
9955            $warn = $('<div class="mec-location-duplicate-warn" role="alert"></div>');
9956            $('<span class="mec-location-duplicate-text"></span>')
9957                .text(loc.location_duplicate_warn || 'A location with this name already exists.')
9958                .appendTo($warn);
9959            var $btn = $('<button type="button" class="button mec-location-use-existing"></button>')
9960                .text(loc.location_use_existing || 'Use existing');
9961            $btn.on('click', function()
9962            {
9963                // Switch the select to the existing location; mec_location_toggle() hides the new form.
9964                $select.val(existingId).trigger('change');
9965                clearWarn();
9966            });
9967            $warn.append(' ').append($btn);
9968            $name.closest('.mec-form-row').after($warn);
9969        }
9970
9971        $name.on('input change', function()
9972        {
9973            clearWarn();
9974            var val = $.trim($name.val() || '').toLowerCase();
9975            if(!val) return;
9976            if(existing.hasOwnProperty(val)) showWarn(existing[val]);
9977        });
9978    })();
9979
9980    $('#mec_bookings_limit_unlimited').on('change', function()
9981    {
9982        mec_bookings_unlimited_toggle();
9983    });
9984
9985    $('#mec_add_in_days').on('click', function()
9986    {
9987        var allday = $(this).data('allday');
9988
9989        var start = $('#mec_exceptions_in_days_start_date').val();
9990        if(start === '') return false;
9991
9992        var end = $('#mec_exceptions_in_days_end_date').val();
9993        if(end === '') return false;
9994
9995        var start_hour = $('#mec_exceptions_in_days_start_hour').val();
9996        if(start_hour.length === 1) start_hour = '0'+start_hour;
9997
9998        var start_minutes = $('#mec_exceptions_in_days_start_minutes').val();
9999        if(start_minutes.length === 1) start_minutes = '0'+start_minutes;
10000
10001        var start_ampm = $('#mec_exceptions_in_days_start_ampm').val();
10002        if(typeof start_ampm === 'undefined') start_ampm = '';
10003
10004        var end_hour = $('#mec_exceptions_in_days_end_hour').val();
10005        if(end_hour.length === 1) end_hour = '0'+end_hour;
10006
10007        var end_minutes = $('#mec_exceptions_in_days_end_minutes').val();
10008        if(end_minutes.length === 1) end_minutes = '0'+end_minutes;
10009
10010        var end_ampm = $('#mec_exceptions_in_days_end_ampm').val();
10011        if(typeof end_ampm === 'undefined') end_ampm = '';
10012
10013        var value = start + ':' + end + ':' + start_hour + '-' + start_minutes + '-' + start_ampm + ':' + end_hour + '-' + end_minutes + '-' + end_ampm;
10014        var label = start + ' <span class="mec-time-picker-label '+(allday ? 'mec-util-hidden' : '')+'">' + start_hour + ':' + start_minutes + ' ' + start_ampm + '</span> - ' + end + ' <span class="mec-time-picker-label '+(allday ? 'mec-util-hidden' : '')+'">' + end_hour + ':' + end_minutes + ' ' + end_ampm + '</span>';
10015
10016        // Don't add exactly same occurrences
10017        if($('#mec_in_days input[value="'+value+'"]').length > 0) return false;
10018
10019        var $key = $('#mec_new_in_days_key');
10020
10021        var key = $key.val();
10022        var html = $('#mec_new_in_days_raw').html().replace(/:i:/g, key).replace(/:val:
10022/g, value).replace(/:label:/g, label);
10023
10024        $('#mec_in_days').append(html);
10025        $key.val(parseInt(key)+1);
10026    });
10027
10028    $('#mec_edit_in_days').on('click', function()
10029    {
10030        // Form
10031        const $form = $('#mec-in-days-form');
10032
10033        const modify_id = $form.data('modify');
10034        const $row = $('#mec_in_days_row'+modify_id);
10035
10036        var allday = $(this).data('allday');
10037
10038        var start = $('#mec_exceptions_in_days_start_date').val();
10039        if(start === '') return false;
10040
10041        var end = $('#mec_exceptions_in_days_end_date').val();
10042        if(end === '') return false;
10043
10044        var start_hour = $('#mec_exceptions_in_days_start_hour').val();
10045        if(start_hour.length === 1) start_hour = '0'+start_hour;
10046
10047        var start_minutes = $('#mec_exceptions_in_days_start_minutes').val();
10048        if(start_minutes.length === 1) start_minutes = '0'+start_minutes;
10049
10050        var start_ampm = $('#mec_exceptions_in_days_start_ampm').val();
10051        if(typeof start_ampm === 'undefined') start_ampm = '';
10052
10053        var end_hour = $('#mec_exceptions_in_days_end_hour').val();
10054        if(end_hour.length === 1) end_hour = '0'+end_hour;
10055
10056        var end_minutes = $('#mec_exceptions_in_days_end_minutes').val();
10057        if(end_minutes.length === 1) end_minutes = '0'+end_minutes;
10058
10059        var end_ampm = $('#mec_exceptions_in_days_end_ampm').val();
10060        if(typeof end_ampm === 'undefined') end_ampm = '';
10061
10062        var value = start + ':' + end + ':' + start_hour + '-' + start_minutes + '-' + start_ampm + ':' + end_hour + '-' + end_minutes + '-' + end_ampm;
10063        var label = start + ' <span class="mec-time-picker-label '+(allday ? 'mec-util-hidden' : '')+'">' + start_hour + ':' + start_minutes + ' ' + start_ampm + '</span> - ' + end + ' <span class="mec-time-picker-label '+(allday ? 'mec-util-hidden' : '')+'">' + end_hour + ':' + end_minutes + ' ' + end_ampm + '</span>';
10064
10065        $row.find($('input[type=hidden]')).val(value);
10066        $row.find($('.mec-in-days-day')).html(label);
10067
10068        // Reset Dates
10069        $form.parent().find($('input[type=text]')).val('');
10070
10071        // Modification Mode
10072        $form.removeClass('mec-in-days-edit-mode').addClass('mec-in-days-add-mode').removeData('modify');
10073    });
10074
10075    $('#mec_cancel_in_days').on('click', function()
10076    {
10077        // Form
10078        let $form = $('#mec-in-days-form');
10079
10080        // Reset Dates
10081        $form.parent().find($('input[type=text]')).val('');
10082
10083        // Modification Mode
10084        $form.removeClass('mec-in-days-edit-mode').addClass('mec-in-days-add-mode').removeData('modify');
10085    });
10086
10087    // Keyboard support for Custom Days card action buttons (audit #6).
10088    $('#mec_in_days').on('keydown', '[role="button"]', function(e)
10089    {
10090        if(e.key === 'Enter' || e.key === ' '){ e.preventDefault(); this.click(); }
10091    });
10092
10093    $('#mec_add_not_in_days').on('click', function()
10094    {
10095        let date = $('#mec_exceptions_not_in_days_date').val();
10096        if(date === '') return false;
10097
10098        let d = date.replaceAll('-', '');
10099        d = d.replaceAll('/', '');
10100        d = d.replaceAll('.', '');
10101
10102
10103        let $wrapper = $('#mec_not_in_days');
10104        let $key = $('#mec_new_not_in_days_key');
10105
10106        let c = 'mec-date-'+d;
10107        if($wrapper.find($('.'+c)).length) return;
10108
10109        let key = $key.val();
10110        let html = $('#mec_new_not_in_days_raw').html().replace(/:i:/g, key).replace(/:d:/g, d).replace(/:val:/g, date);
10111
10112        $wrapper.append(html);
10113        $key.val(parseInt(key)+1);
10114    });
10115
10116    $('#mec_add_ticket_button').on('click', function()
10117    {
10118        let $key = $('#mec_new_ticket_key');
10119        let key = $key.val();
10120        let html = $('#mec_new_ticket_raw').html().replace(/:i:/g, key);
10121
10122        $('#mec_tickets').append(html);
10123        $key.val(parseInt(key)+1);
10124
10125        mec_init_sortable_sections();
10126
10127        $('.mec_add_price_date_button').off('click').on('click', function()
10128        {
10129            mec_handle_add_price_date_button(this);
10130        });
10131
10132        $.each($(".mec-select2"), function(i,v)
10133        {
10134            if($(v).attr('name').search(":i:") > 0)
10135            {
10136                return;
10137            }
10138
10139            if(typeof $(v).data('select2-id') == 'undefined')
10140            {
10141                $(v).select2();
10142            }
10143        });
10144
10145        trigger_period_picker();
10146    });
10147
10148    $('.mec_add_price_date_button').off('click').on('click', function()
10149    {
10150        mec_handle_add_price_date_button(this);
10151    });
10152
10153    mec_hourly_schedule_add_day_listener();
10154    mec_init_sortable_sections();
10155
10156    $('#mec_add_fee_button').on('click', function()
10157    {
10158        var key = $('#mec_new_fee_key').val();
10159        var html = $('#mec_new_fee_raw').html().replace(/:i:/g, key);
10160
10161        $('#mec_fees_list').append(html);
10162        $('#mec_new_fee_key').val(parseInt(key)+1);
10163
10164        mec_init_sortable_sections();
10165    });
10166
10167    $('#mec_add_ticket_variation_button').on('click', function()
10168    {
10169        var key = $('#mec_new_ticket_variation_key').val();
10170        var html = $('#mec_new_ticket_variation_raw').html().replace(/:i:/g, key);
10171
10172        $('#mec_ticket_variations_list').append(html);
10173        $('#mec_new_ticket_variation_key').val(parseInt(key)+1);
10174
10175        mec_init_sortable_sections();
10176    });
10177
10178    $('.mec-form-row.mec-available-color-row span').on('click', function()
10179    {
10180        $('.mec-form-row.mec-available-color-row span').removeClass('color-selected');
10181        $(this).addClass('color-selected');
10182    });
10183
10184    $('#mec_reg_form_field_types button').on('click', function()
10185    {
10186        var type = $(this).data('type');
10187
10188        if (type == 'mec_email') {
10189            if ($('#mec_reg_form_fields').find('input[value="mec_email"][type="hidden"]').length) {
10190                return false;
10191            }
10192        }
10193
10194        if (type == 'name') {
10195            if ($('#mec_reg_form_fields').find('input[value="name"][type="hidden"]').length) {
10196                return false;
10197            }
10198        }
10199
10200        var key  = $('#mec_new_reg_field_key').val();
10201        var html = $('#mec_reg_field_'+type).html().replace(/:i:/g, key);
10202
10203        $('#mec_reg_form_fields').append(html);
10204        $('#mec_new_reg_field_key').val(parseInt(key)+1);
10205
10206        // Set onclick listener for add option fields
10207        mec_reg_fields_option_listeners();
10208        mec_refresh_booking_condition_editors('reg');
10209    });
10210
10211    // Set onclick listener for add option fields
10212    mec_reg_fields_option_listeners();
10213    mec_refresh_booking_condition_editors('reg');
10214
10215    // Advanced Repeating
10216    $('#mec-advanced-wraper ul > ul > li').click(function()
10217    {
10218        if($(this).attr('class') == '') $(this).attr('class', 'mec-active');
10219        else $(this).attr('class', '');
10220
10221        $('#mec_date_repeat_advanced').val($('#mec-advanced-wraper div:first-child > ul').find('.mec-active').find('span').text().slice(0, -1));
10222    });
10223
10224    $('#mec_event_form_field_types button').on('click', function()
10225    {
10226        var type = $(this).data('type');
10227
10228        var key  = $('#mec_new_event_field_key').val();
10229        var html = $('#mec_event_field_'+type).html().replace(/:i:/g, key);
10230
10231        $('#mec_event_form_fields').append(html);
10232        $('#mec_new_event_field_key').val(parseInt(key)+1);
10233
10234        // Set onclick listener for add option fields
10235        mec_event_fields_option_listeners();
10236    });
10237
10238    // Set onclick listener for add option fields
10239    mec_event_fields_option_listeners();
10240
10241    $('#mec_bfixed_form_field_types button').on('click', function()
10242    {
10243        var type = $(this).data('type');
10244
10245        var key  = $('#mec_new_bfixed_field_key').val();
10246        var html = $('#mec_bfixed_field_'+type).html().replace(/:i:/g, key);
10247
10248        $('#mec_bfixed_form_fields').append(html);
10249        $('#mec_new_bfixed_field_key').val(parseInt(key)+1);
10250
10251        // Set onclick listener for add option fields
10252        mec_bfixed_fields_option_listeners();
10253        mec_refresh_booking_condition_editors('bfixed');
10254    });
10255
10256    // Set onclick listener for add option fields
10257    mec_bfixed_fields_option_listeners();
10258    mec_refresh_booking_condition_editors('bfixed');
10259
10260    jQuery(document).on('change', '.mec-booking-condition-enabled, .mec-booking-condition-source, .mec-booking-condition-option', function()
10261    {
10262        const $trigger = jQuery(this);
10263        const $conditionBox = jQuery(this).closest('.mec-booking-condition-box');
10264        const prefix = String($conditionBox.data('conditionPrefix') || '');
10265
10266        if($trigger.hasClass('mec-booking-condition-source'))
10267        {
10268            $conditionBox.data('currentSourceFieldId', String($trigger.val() || ''));
10269            $conditionBox.data('currentOptionKey', '');
10270            $conditionBox.find('.mec-booking-condition-option').val('');
10271        }
10272        else if($trigger.hasClass('mec-booking-condition-option'))
10273        {
10274            $conditionBox.data('currentOptionKey', String($trigger.val() || ''));
10275        }
10276
10277        mec_refresh_booking_condition_editor($conditionBox);
10278        if(prefix) mec_refresh_booking_condition_editors(prefix);
10279    });
10280
10281    jQuery(document).on('input change', '#mec_reg_form_fields input[name*="[label]"], #mec_bfixed_form_fields input[name*="[label]"]', function()
10282    {
10283        const $field = jQuery(this).closest('li[id^="mec_reg_fields_"], li[id^="mec_bfixed_fields_"]');
10284        if($field.attr('id') && $field.attr('id').indexOf('mec_reg_fields_') === 0) mec_refresh_booking_condition_editors('reg');
10285        if($field.attr('id') && $field.attr('id').indexOf('mec_bfixed_fields_') === 0) mec_refresh_booking_condition_editors('bfixed');
10286    });
10287
10288    // Additional Organizers
10289    mec_additional_organizers_listeners();
10290
10291    // Additional Locations
10292    mec_additional_locations_listeners();
10293
10294    // Show / Hide Password
10295    $('.mec-show-hide-password').on('click', function()
10296    {
10297        var $input = $(this).siblings("input");
10298        var current = $input.attr('type');
10299
10300        if(current === 'password') $input.attr('type', 'text');
10301        else $input.attr('type', 'password');
10302    });
10303
10304    // FAQ
10305    $('#mec_add_faq_button').on('click', function()
10306    {
10307        const $key = $('#mec_new_faq_key');
10308        const key = $key.val();
10309        const html = $('#mec_new_faq_raw').html().replace(/:i:/g, key);
10310
10311        $('#mec_faq_list').append(html);
10312        $key.val(parseInt(key)+1);
10313
10314        mec_init_sortable_sections();
10315    });
10316
10317    // Appointments
10318    // Move the selector to the metabox header
10319    var $header = $('#mec_metabox_details .hndle');
10320    // If .hndle is not found, try .postbox-header (newer WP versions)
10321    if ($header.length === 0) {
10322        $header = $('#mec_metabox_details .postbox-header');
10323    }
10324    $('.mec-event-appointment-type-wrap').appendTo($header).removeClass('mec-util-hidden').on('click', function(e) {
10325        e.stopPropagation();
10326    });
10327
10328    $('#mec_entity_type_select').on('change', function()
10329    {
10330        const entity_type = $(this).val();
10331        const $fes_form = $('#mec_fes_form');
10332        const $metabox_details = $('#mec_metabox_details');
10333        const $appointment_form_wrapper = $('.mec-appointment-form-wrap');
10334
10335        if (entity_type === 'appointment')
10336        {
10337            $fes_form.removeClass('mec-entity-type-event').addClass('mec-entity-type-appointment');
10338            $metabox_details.removeClass('mec-entity-type-event').addClass('mec-entity-type-appointment');
10339
10340            $appointment_form_wrapper.removeClass('mec-util-hidden');
10341        }
10342        else
10343        {
10344            $fes_form.removeClass('mec-entity-type-appointment').addClass('mec-entity-type-event');
10345            $metabox_details.removeClass('mec-entity-type-appointment').addClass('mec-entity-type-event');
10346
10347            $appointment_form_wrapper.addClass('mec-util-hidden');
10348        }
10349    });
10350
10351    $('#mec_entity_type_select').trigger('change');
10352
10353    const $repeatType = $('#mec_appointments_availability_repeat_type');
10354    if($.fn.datepicker)
10355    {
10356        $('#mec_appointments_start_date').datepicker({
10357            changeYear: true,
10358            changeMonth: true,
10359            dateFormat: datepicker_format,
10360            gotoCurrent: true,
10361            yearRange: 'c-3:c+5',
10362        });
10363    }
10364    function mec_toggle_repeat_type()
10365    {
10366        const val = $repeatType.val();
10367        if (val === 'no_repeat')
10368        {
10369            $('.lsd-apt-days-wrapper').addClass('mec-util-hidden');
10370            $('.lsd-apt-adjusted-title').addClass('mec-util-hidden');
10371            $('.lsd-apt-start-date-wrapper').addClass('mec-util-hidden');
10372        }
10373        else
10374        {
10375            $('.lsd-apt-days-wrapper').removeClass('mec-util-hidden');
10376            $('.lsd-apt-adjusted-title').removeClass('mec-util-hidden');
10377            $('.lsd-apt-start-date-wrapper').removeClass('mec-util-hidden');
10378        }
10379    }
10380    $repeatType.on('change', mec_toggle_repeat_type);
10381    mec_toggle_repeat_type();
10382
10383    $(document).on('click', '.lsd-apt-day-icon-remove', function()
10384    {
10385        const $button = $(this);
10386        const $timeslot = $button.parent();
10387        const $timeslots = $button.parents('.lsd-apt-day-timeslots');
10388
10389        $timeslot.remove();
10390        if ($timeslots.find('.lsd-apt-day-timeslot-wrapper').length === 0)
10391        {
10392            $timeslots.find('.lsd-apt-day-timeslots-unavailable').removeClass('mec-util-hidden');
10393        }
10394    });
10395
10396    $(document).on('click', '.lsd-apt-day-icon-plus', function()
10397    {
10398        const $button = $(this);
10399        let key = $button.data('key');
10400
10401        const $day = $button.parents('.lsd-apt-day-wrapper');
10402        const day = $day.data('key');
10403
10404        const $timeslots = $day.find('.lsd-apt-day-timeslots-wrapper');
10405        const $template = $('#lsd-apt-day-templates-'+day+'-timeslot');
10406
10407        key = key + 1;
10408        const html = $template.html().replace(/:t:/g, key);
10409        $timeslots.append(html);
10410
10411        $button.data('key', key);
10412        $day.find('.lsd-apt-day-timeslots-unavailable').addClass('mec-util-hidden');
10413    });
10414
10415    $(document).on('click', '.lsd-apt-day-icon-copy', function ()
10416    {
10417        const $button = $(this);
10418        const $sourceDay = $button.closest('.lsd-apt-day-wrapper');
10419        const sourceDayKey = $sourceDay.data('key');
10420
10421        const $weekWrapper = $sourceDay.parent();
10422        const $sourceTimeslots = $sourceDay.find('.lsd-apt-day-timeslots-wrapper .lsd-apt-day-timeslot-wrapper');
10423
10424        $weekWrapper.find('.lsd-apt-day-wrapper').each(function ()
10425        {
10426            const $targetDay = $(this);
10427
10428            const targetDayKey = $targetDay.data('key');
10429            if (targetDayKey === sourceDayKey) return;
10430
10431            const isActive = $targetDay.find('.lsd-apt-day-timeslots-wrapper .lsd-apt-day-timeslot-wrapper').length > 0;
10432            if (!isActive) return;
10433
10434            const $targetWrapper = $targetDay.find('.lsd-apt-day-timeslots-wrapper');
10435            $targetWrapper.empty();
10436
10437            $sourceTimeslots.each(function ()
10438            {
10439                const $sourceSlot = $(this);
10440                const $clone = $sourceSlot.clone(true);
10441
10442                $sourceSlot.find('select').each(function (i) {
10443                    const value = $(this).val();
10444                    $clone.find('select').eq(i).val(value);
10445                });
10446
10447                $sourceSlot.find('input').each(function (i) {
10448                    const value = $(this).val();
10449                    $clone.find('input').eq(i).val(value);
10450                });
10451
10452                $clone.find('[name], [id], [for]').each(function ()
10453                {
10454                    $.each(this.attributes, function () {
10455                        if (this.name === 'name' || this.name === 'id' || this.name === 'for') {
10456                            this.value = this.value
10457                            .replace(`[availability][${sourceDayKey}]`, `[availability][${targetDayKey}]`)
10458                            .replace(`availability_${sourceDayKey}_`, `availability_${targetDayKey}_`);
10459                        }
10460                    });
10461                });
10462
10463                $targetWrapper.append($clone);
10464            });
10465        });
10466    });
10467
10468    $(document).on('click', '.lsd-apt-adjusted-day-add', function()
10469    {
10470        const $wrapper = $('.lsd-apt-adjusted-days-wrapper');
10471        let key = $wrapper.data('key') || 0;
10472
10473        key = key + 1;
10474        let html = $('#lsd-apt-adjusted-template-day').html();
10475        html = html.replace(/:i:/g, key);
10476
10477        $wrapper.append(html);
10478        $wrapper.data('key', key);
10479
10480        if($.fn.datepicker)
10481        {
10482            $wrapper.find('.mec-apt-date-picker').last().datepicker({
10483                changeYear: true,
10484                changeMonth: true,
10485                dateFormat: datepicker_format,
10486                gotoCurrent: true,
10487                yearRange: 'c-3:c+5',
10488            });
10489        }
10490    });
10491
10492    $(document).on('click', '.lsd-apt-adjusted-day-remove', function()
10493    {
10494        $(this).closest('.lsd-apt-day-wrapper').remove();
10495    });
10496
10497    $(document).on('click', '.lsd-apt-adj-day-icon-plus', function()
10498    {
10499        const $button = $(this);
10500        let key = $button.data('key');
10501        const $day = $button.closest('.lsd-apt-day-wrapper');
10502        const day = $day.data('day');
10503        const $timeslots = $day.find('.lsd-apt-day-timeslots-wrapper');
10504
10505        key = key + 1;
10506        let html = $('#lsd-apt-adjusted-template-timeslot').html();
10507
10508        html = html.replace(/:i:/g, day).replace(/:t:/g, key);
10509        $timeslots.append(html);
10510
10511        $button.data('key', key);
10512        $day.find('.lsd-apt-day-timeslots-unavailable').addClass('mec-util-hidden');
10513    });
10514});
10515
10516function trigger_period_picker()
10517{
10518    jQuery('.mec-date-picker-start').datepicker(
10519    {
10520        changeYear: true,
10521        changeMonth: true,
10522        dateFormat: 'yy-mm-dd',
10523        gotoCurrent: true,
10524        yearRange: 'c-1:c+5',
10525        onSelect: function(date)
10526        {
10527            const selectedDate = new Date(date);
10528            const endDate = new Date(selectedDate.getTime());
10529
10530            const $end_picker = jQuery(this).next();
10531            $end_picker.datepicker("option", "minDate", endDate);
10532            $end_picker.datepicker("option", "maxDate", '+5y');
10533            jQuery(this).trigger('change');
10534        }
10535    });
10536
10537    jQuery('.mec-date-picker-end').datepicker(
10538    {
10539        changeYear: true,
10540        changeMonth: true,
10541        dateFormat: 'yy-mm-dd',
10542        gotoCurrent: true,
10543        yearRange: 'c-1:c+5',
10544    });
10545}
10546
10547function mec_location_toggle()
10548{
10549    if(jQuery('#mec_location_id').val() != '0') jQuery('#mec_location_new_container').hide();
10550    else jQuery('#mec_location_new_container').show();
10551}
10552
10553function mec_organizer_toggle()
10554{
10555    if(jQuery('#mec_organizer_id').val() != '0') jQuery('#mec_organizer_new_container').hide();
10556    else jQuery('#mec_organizer_new_container').show();
10557}
10558
10559function mec_repeat_toggle()
10560{
10561    if(jQuery('#mec_repeat').is(':checked')) jQuery('.mec-form-repeating-event-row').show();
10562    else jQuery('.mec-form-repeating-event-row').hide();
10563}
10564
10565// Update the "Repeat Interval" unit suffix (days/weeks/months/years) based on
10566// the selected repeat type. Audit issue #17.
10567function mec_update_interval_unit()
10568{
10569    var $unit = jQuery('#mec_repeat_interval').siblings('.mec-interval-unit');
10570    if(!$unit.length) return;
10571    var loc = (typeof mec_admin_localize !== 'undefined') ? mec_admin_localize : ((typeof mecdata !== 'undefined') ? mecdata : {});
10572    var units = loc.interval_units || {};
10573    var type = jQuery('#mec_repeat_type').val();
10574    $unit.text(units[type] || '');
10575}
10576
10577function mec_repeat_type_toggle()
10578{
10579    var repeat_type = jQuery('#mec_repeat_type').val();
10580
10581    if(repeat_type == 'certain_weekdays')
10582    {
10583        jQuery('#mec_repeat_interval_container').hide();
10584        jQuery('#mec_repeat_certain_weekdays_container').show();
10585        jQuery('#mec_exceptions_in_days_container').hide();
10586        jQuery('#mec_end_wrapper').show();
10587        jQuery('#mec-advanced-wraper').hide();
10588    }
10589    else if(repeat_type == 'custom_days')
10590    {
10591        jQuery('#mec_repeat_interval_container').hide();
10592        jQuery('#mec_repeat_certain_weekdays_container').hide();
10593        jQuery('#mec_exceptions_in_days_container').show();
10594        jQuery('#mec_end_wrapper').hide();
10595        jQuery('#mec-advanced-wraper').hide();
10596    }
10597    else if(repeat_type == 'advanced')
10598    {
10599        jQuery('#mec_repeat_interval_container').hide();
10600        jQuery('#mec_repeat_certain_weekdays_container').hide();
10601        jQuery('#mec_exceptions_in_days_container').hide();
10602        jQuery('#mec_end_wrapper').show();
10603        jQuery('#mec-advanced-wraper').show();
10604    }
10605    else if(repeat_type != 'daily' && repeat_type != 'weekly' && repeat_type != 'monthly')
10606    {
10607        jQuery('#mec_repeat_interval_container').hide();
10608        jQuery('#mec_repeat_certain_weekdays_container').hide();
10609        jQuery('#mec_exceptions_in_days_container').hide();
10610        jQuery('#mec_end_wrapper').show();
10611        jQuery('#mec-advanced-wraper').hide();
10612    }
10613    else
10614    {
10615        jQuery('#mec_repeat_interval_container').show();
10616        jQuery('#mec_repeat_certain_weekdays_container').hide();
10617        jQuery('#mec_exceptions_in_days_container').hide();
10618        jQuery('#mec_end_wrapper').show();
10619        jQuery('#mec-advanced-wraper').hide();
10620    }
10621
10622    mec_update_interval_unit();
10623}
10624
10625function mec_in_days_remove(i)
10626{
10627    var $row = jQuery('#mec_in_days_row'+i);
10628    // Fade-out animation before removal (audit #6).
10629    if($row.length)
10630    {
10631        $row.addClass('mec-in-days-removing');
10632        setTimeout(function(){ jQuery('#mec_in_days_row'+i).remove(); }, 180);
10633    }
10634}
10635
10636function mec_in_days_edit(i)
10637{
10638    // Date
10639    let $row = jQuery('#mec_in_days_row'+i);
10640    let value = $row.find(jQuery('input[type=hidden]')).val();
10641
10642    const values = value.split(':');
10643    const start_times = values[2].split('-')
10644    const end_times = values[3].split('-')
10645
10646    // Form
10647    let $form = jQuery('#mec-in-days-form');
10648
10649    // Set Dates
10650    jQuery('#mec_exceptions_in_days_start_date').val(values[0]);
10651    jQuery('#mec_exceptions_in_days_end_date').val(values[1]);
10652
10653    // Set Times
10654    jQuery('#mec_exceptions_in_days_start_hour').val(parseInt(start_times[0]));
10655    jQuery('#mec_exceptions_in_days_start_minutes').val(parseInt(start_times[1]));
10656    jQuery('#mec_exceptions_in_days_start_ampm').val(start_times[2]);
10657
10658    jQuery('#mec_exceptions_in_days_end_hour').val(parseInt(end_times[0]));
10659    jQuery('#mec_exceptions_in_days_end_minutes').val(parseInt(end_times[1]));
10660    jQuery('#mec_exceptions_in_days_end_ampm').val(end_times[2]);
10661
10662    // Modification Mode
10663    $form.removeClass('mec-in-days-add-mode').addClass('mec-in-days-edit-mode').data('modify', i);
10664}
10665
10666function mec_not_in_days_remove(i)
10667{
10668    jQuery('#mec_not_in_days_row'+i).remove();
10669}
10670
10671function mec_bookings_unlimited_toggle()
10672{
10673    jQuery('#mec_bookings_limit').toggleClass('mec-util-hidden');
10674}
10675
10676function mec_hourly_schedule_add_day_listener()
10677{
10678    jQuery('.mec-add-hourly-schedule-day-button').each(function()
10679    {
10680        jQuery(this).off('click').on('click', function()
10681        {
10682            var k = jQuery(this).data('key');
10683            var raw = jQuery(this).data('raw');
10684            var append = jQuery(this).data('append');
10685
10686            var key = jQuery(k).val();
10687            var html = jQuery(raw).html().replace(/:d:/g, key).replace(/:dd:/g, parseInt(key)+1);
10688
10689            jQuery(append).append(html);
10690            jQuery(k).val(parseInt(key)+1);
10691
10692            mec_hourly_schedule_listeners();
10693        });
10694
10695        mec_hourly_schedule_listeners();
10696    });
10697}
10698
10699function mec_bookings_after_occurrence_cancel_listener()
10700{
10701    jQuery('.mec-occurrences-bookings-after-occurrences-cancel').off('change').on('change', function()
10702    {
10703        const $dropdown = jQuery(this);
10704        const value = $dropdown.val();
10705        const $moveWrapper = $dropdown.next();
10706
10707        if(value === 'move' || value === 'move_notify')
10708        {
10709            $moveWrapper.removeClass('w-hidden');
10710        }
10711        else
10712        {
10713            $moveWrapper.addClass('w-hidden');
10714        }
10715    });
10716}
10717
10718function mec_hourly_schedule_listeners()
10719{
10720    jQuery('.mec-add-hourly-schedule-button').off('click').on('click', function()
10721    {
10722        var prefix = jQuery(this).data('prefix');
10723        var day = jQuery(this).data('day');
10724        var $key = jQuery('#'+prefix+'mec_new_hourly_schedule_key'+day);
10725
10726        var key = $key.val();
10727        var html = jQuery('#'+prefix+'mec_new_hourly_schedule_raw'+day).html().replace(/:i:/g, key).replace(/:d:/g, day).replace();
10728        var g_field_id = prefix+"-hourly_schedules-"+day+"-schedules-:i:-description";
10729        var field_id = prefix+"-hourly_schedules-"+day+"-schedules-"+key+"-description";
10730        html = html.replace(g_field_id,field_id);
10731        html = html.replace(':k:',key);
10732        jQuery('#'+prefix+'mec_hourly_schedules'+day).append(html);
10733        $key.val(parseInt(key)+1);
10734
10735        wp.editor.initialize("mec"+field_id,{
10736            tinymce: {
10737                wpautop: true,
10738                plugins : 'charmap colorpicker compat3x directionality fullscreen hr image lists media paste tabfocus textcolor wordpress wpautoresize wpdialogs wpeditimage wpemoji wpgallery wplink wptextpattern wpview',
10739                toolbar1: 'bold italic underline strikethrough | bullist numlist | blockquote hr wp_more | alignleft aligncenter alignright | link unlink | fullscreen | wp_adv',
10740                toolbar2: 'formatselect alignjustify forecolor | pastetext removeformat charmap | outdent indent | undo redo | wp_help'
10741            },
10742            quicktags: true,
10743            mediaButtons: false,
10744        });
10745    });
10746
10747    jQuery(".mec-hourly-schedule-schedules").sortable({
10748        handle: '.mec_field_sort'
10749    });
10750}
10751
10752function mec_hourly_schedule_remove(day, i, prefix)
10753{
10754    jQuery("#"+prefix+"mec_hourly_schedule_row"+day+'_'+i).remove();
10755}
10756
10757function mec_hourly_schedule_day_remove(day, prefix)
10758{
10759    jQuery("#"+prefix+"mec_meta_box_hourly_schedule_day_"+day).remove();
10760}
10761
10762function mec_ticket_remove(i)
10763{
10764    jQuery("#mec_ticket_row"+i).remove();
10765}
10766
10767function mec_set_event_color(color)
10768{
10769    try
10770    {
10771        jQuery("#mec_event_color").wpColorPicker('color', '#'+color);
10772    }
10773    catch(e)
10774    {
10775        jQuery("#mec_event_color").val(color);
10776    }
10777}
10778
10779function mec_remove_fee(key)
10780{
10781    jQuery("#mec_fee_row"+key).remove();
10782}
10783
10784function mec_remove_ticket_variation(key, id_prefix)
10785{
10786    jQuery("#mec_"+id_prefix+"_row"+key).remove();
10787}
10788
10789function add_variation_per_ticket(ticket_id)
10790{
10791    var $input = jQuery('#mec_new_variation_per_ticket_key');
10792
10793    var key = $input.val();
10794    var html = jQuery('#mec_new_variation_per_ticket_raw'+ticket_id).html().replace(/:v:/g, key);
10795
10796    jQuery('#mec_ticket_variations_list'+ticket_id).append(html);
10797    $input.val(parseInt(key)+1);
10798
10799    mec_init_sortable_sections();
10800}
10801
10802function mec_init_sortable_instance(selector, options)
10803{
10804    jQuery(selector).each(function()
10805    {
10806        var $element = jQuery(this);
10807
10808        if(!$element.length) return;
10809
10810        if(typeof $element.data('ui-sortable') === 'undefined')
10811        {
10812            $element.sortable(options);
10813        }
10814        else
10815        {
10816            $element.sortable('refresh');
10817        }
10818    });
10819}
10820
10821function mec_init_sortable_sections()
10822{
10823    if(typeof jQuery.fn.sortable === 'undefined') return;
10824
10825    mec_init_sortable_instance('#mec_tickets', { handle: '.mec_field_sort', items: '> .mec_ticket_row' });
10826    mec_init_sortable_instance('#mec_fees_list', { handle: '.mec_field_sort', items: '> .mec-box' });
10827    mec_init_sortable_instance('[id^="mec_ticket_variations_list"]', { handle: '.mec_field_sort', items: '> .mec_ticket_variation_row' });
10828    mec_init_sortable_instance('#mec_faq_list', { handle: '.mec_field_sort', items: '> .mec_faq_row' });
10829}
10830
10831function mec_get_booking_condition_form_fields(prefix)
10832{
10833    return jQuery('#mec_' + prefix + '_form_fields > li');
10834}
10835
10836function mec_get_booking_condition_field_id($field, prefix)
10837{
10838    return String(($field.attr('id') || '').replace('mec_' + prefix + '_fields_', ''));
10839}
10840
10841function mec_get_booking_condition_field_type($field, prefix)
10842{
10843    const fieldId = mec_get_booking_condition_field_id($field, prefix);
10844    return String($field.find('input[name="mec[' + prefix + '_fields][' + fieldId + '][type]"]').val() || '');
10845}
10846
10847function mec_get_booking_condition_field_label($field, prefix)
10848{
10849    const fieldId = mec_get_booking_condition_field_id($field, prefix);
10850    const $labelInput = $field.find('input[name="mec[' + prefix + '_fields][' + fieldId + '][label]"]').first();
10851    const fallback = jQuery.trim($field.find('.mec_' + prefix + '_field_type').first().text() || '');
10852
10853    return jQuery.trim(($labelInput.val() || fallback || ''));
10854}
10855
10856function mec_get_booking_condition_field_option_list($field, prefix)
10857{
10858    const fieldId = mec_get_booking_condition_field_id($field, prefix);
10859    const options = [];
10860
10861    $field.find('input[name^="mec[' + prefix + '_fields][' + fieldId + '][options]"][name$="[label]"]').each(function()
10862    {
10863        const name = jQuery(this).attr('name') || '';
10864        const match = name.match(/\[options\]\[(.*?)\]\[label\]$/);
10865        if(!match) return;
10866
10867        options.push({
10868            key: String(match[1]),
10869            label: jQuery.trim(jQuery(this).val() || '')
10870        });
10871    });
10872
10873    return options;
10874}
10875
10876function mec_booking_condition_field_has_duplicate_options($field, prefix)
10877{
10878    const seen = {};
10879    const options = mec_get_booking_condition_field_option_list($field, prefix);
10880
10881    for(let i = 0; i < options.length; i++)
10882    {
10883        const label = options[i].label;
10884        if(!label) continue;
10885        if(seen[label]) return true;
10886
10887        seen[label] = true;
10888    }
10889
10890    return false;
10891}
10892
10893function mec_refresh_booking_condition_editor($conditionBox)
10894{
10895    if(!$conditionBox || !$conditionBox.length) return;
10896
10897    const prefix = String($conditionBox.data('conditionPrefix') || '');
10898    const currentFieldId = String($conditionBox.data('conditionFieldId') || '');
10899    const $enabled = $conditionBox.find('.mec-booking-condition-enabled');
10900    const $controls = $conditionBox.find('.mec-booking-condition-controls');
10901    const $source = $conditionBox.find('.mec-booking-condition-source');
10902    const $option = $conditionBox.find('.mec-booking-condition-option');
10903    const $matchType = $conditionBox.find('.mec-booking-condition-match-type');
10904    const $message = $conditionBox.find('.mec-booking-condition-message');
10905    const enabled = $enabled.is(':checked');
10906    const strings = (typeof mec_admin_localize !== 'undefined' && mec_admin_localize.booking_conditions) ? mec_admin_localize.booking_conditions : {};
10907
10908    $controls.toggleClass('mec-util-hidden', !enabled);
10909    if(!enabled)
10910    {
10911        $message.text('');
10912        return;
10913    }
10914
10915    const currentSourceId = String($source.val() || $conditionBox.data('currentSourceFieldId') || '');
10916    const currentOptionKey = String($option.val() || $conditionBox.data('currentOptionKey') || '');
10917    const sourceFields = [];
10918    const sourceMap = {};
10919
10920    mec_get_booking_condition_form_fields(prefix).each(function()
10921    {
10922        const $field = jQuery(this);
10923        const fieldId = mec_get_booking_condition_field_id($field, prefix);
10924        const fieldType = mec_get_booking_condition_field_type($field, prefix);
10925
10926        if(!fieldId) return;
10927        if(fieldId === currentFieldId) return false;
10928        if(jQuery.inArray(fieldType, ['checkbox', 'radio', 'select', 'agreement']) === -1) return;
10929        if(jQuery.inArray(fieldType, ['checkbox', 'radio', 'select']) !== -1 && mec_booking_condition_field_has_duplicate_options($field, prefix)) return;
10930
10931        const sourceField = {
10932            id: fieldId,
10933            type: fieldType,
10934            label: mec_get_booking_condition_field_label($field, prefix)
10935        };
10936
10937        sourceFields.push(sourceField);
10938        sourceMap[fieldId] = sourceField;
10939    });
10940
10941    $source.empty().append('<option value="">' + (strings.select_field || 'Select a field') + '</option>');
10942    jQuery.each(sourceFields, function(index, sourceField)
10943    {
10944        $source.append('<option value="' + sourceField.id + '">' + sourceField.label + '</option>');
10945    });
10946
10947    if(currentSourceId && sourceMap[currentSourceId]) $source.val(currentSourceId);
10948
10949    const selectedSourceId = String($source.val() || '');
10950    const selectedSource = sourceMap[selectedSourceId] || null;
10951
10952    $option.empty();
10953
10954    if(!selectedSource)
10955    {
10956        $matchType.val('');
10957        $option.prop('disabled', true).append('<option value="">' + (strings.select_option || 'Select an option') + '</option>');
10958        $message.text(sourceFields.length ? (strings.select_controller || 'Choose a controller field.') : (strings.no_sources || 'No eligible controller fields are available.'));
10959        $conditionBox.data('currentSourceFieldId', '');
10960        $conditionBox.data('currentOptionKey', '');
10961        return;
10962    }
10963
10964    if(selectedSource.type === 'agreement')
10965    {
10966        $matchType.val('checked');
10967        $option.prop('disabled', true).append('<option value="">' + (strings.checked_state || 'Checked') + '</option>');
10968        $message.text((strings.checked_message || 'This field will show when "%s" is checked.').replace('%s', selectedSource.label));
10969        $conditionBox.data('currentSourceFieldId', selectedSourceId);
10970        $conditionBox.data('currentOptionKey', '');
10971        return;
10972    }
10973
10974    const $sourceField = jQuery('#mec_' + prefix + '_fields_' + selectedSource.id);
10975    const options = mec_get_booking_condition_field_option_list($sourceField, prefix);
10976    const matchType = selectedSource.type === 'checkbox' ? 'contains_option' : 'equals_option';
10977
10978    $matchType.val(matchType);
10979    $option.prop('disabled', false).append('<option value="">' + (strings.select_option || 'Select an option') + '</option>');
10980
10981    jQuery.each(options, function(index, option)
10982    {
10983        $option.append('<option value="' + option.key + '">' + option.label + '</option>');
10984    });
10985
10986    if(currentOptionKey) $option.val(currentOptionKey);
10987
10988    if(!$option.val())
10989    {
10990        $message.text((strings.select_value || 'Choose the value that should reveal this field.').replace('%s', selectedSource.label));
10991    }
10992    else
10993    {
10994        $message.text('');
10995    }
10996
10997    $conditionBox.data('currentSourceFieldId', selectedSourceId);
10998    $conditionBox.data('currentOptionKey', String($option.val() || ''));
10999}
11000
11001function mec_refresh_booking_condition_editors(prefix)
11002{
11003    jQuery('.mec-booking-condition-box[data-condition-prefix="' + prefix + '"]').each(function()
11004    {
11005        mec_refresh_booking_condition_editor(jQuery(this));
11006    });
11007}
11008
11009function mec_reg_fields_option_listeners()
11010{
11011    jQuery('button.mec-reg-field-add-option').off('click').on('click', function()
11012    {
11013        var field_id = jQuery(this).data('field-id');
11014        var key = jQuery('#mec_new_reg_field_option_key_'+field_id).val();
11015        var html = jQuery('#mec_reg_field_option').html().replace(/:i:/g, key).replace(/:fi:/g, field_id);
11016
11017        jQuery('#mec_reg_fields_'+field_id+'_options_container').append(html);
11018        jQuery('#mec_new_reg_field_option_key_'+field_id).val(parseInt(key)+1);
11019        mec_refresh_booking_condition_editors('reg');
11020    });
11021
11022    if(typeof jQuery.fn.sortable !== 'undefined')
11023    {
11024        jQuery("#mec_reg_form_fields").sortable(
11025        {
11026            handle: '.mec_reg_field_sort',
11027            stop: function()
11028            {
11029                mec_refresh_booking_condition_editors('reg');
11030            }
11031        });
11032
11033        jQuery(".mec_reg_fields_options_container").sortable(
11034        {
11035            handle: '.mec_reg_field_option_sort'
11036        });
11037
11038        jQuery(".mec-hourly-schedule-days").sortable(
11039        {
11040            handle: 'h4'
11041        });
11042
11043        jQuery(".mec-hourly-schedule-schedules").sortable({
11044            handle: '.mec_field_sort'
11045        });
11046    }
11047}
11048
11049function mec_reg_fields_option_remove(field_key, key)
11050{
11051    jQuery("#mec_reg_fields_option_"+field_key+"_"+key).remove();
11052    mec_refresh_booking_condition_editors('reg');
11053}
11054
11055function mec_reg_fields_remove(key)
11056{
11057    jQuery("#mec_reg_fields_"+key).remove();
11058    mec_refresh_booking_condition_editors('reg');
11059}
11060
11061function mec_handle_add_price_date_button(e)
11062{
11063    var key = jQuery(e).data('key');
11064    var p = jQuery('#mec_new_ticket_price_key_'+key).val();
11065    var html = jQuery('#mec_new_ticket_price_raw_'+key).html().replace(/:i:/g, key).replace(/:j:/g, p);
11066
11067    jQuery('#mec-ticket-price-dates-'+key).append(html);
11068    jQuery('#mec_new_ticket_price_key_'+key).val(parseInt(p)+1);
11069    jQuery('#mec-ticket-price-dates-'+key+' .new_added').datepicker(
11070    {
11071        changeYear: true,
11072        changeMonth: true,
11073        dateFormat: datepicker_format,
11074        gotoCurrent: true,
11075        yearRange: 'c-3:c+5',
11076    });
11077}
11078
11079function mec_ticket_price_remove(ticket_key, price_key)
11080{
11081    jQuery("#mec_ticket_price_raw_"+ticket_key+"_"+price_key).remove();
11082}
11083
11084function mec_event_fields_option_listeners()
11085{
11086    jQuery('button.mec-event-field-add-option').off('click').on('click', function()
11087    {
11088        var field_id = jQuery(this).data('field-id');
11089        var key = jQuery('#mec_new_event_field_option_key_'+field_id).val();
11090        var html = jQuery('#mec_event_field_option').html().replace(/:i:/g, key).replace(/:fi:/g, field_id);
11091
11092        jQuery('#mec_event_fields_'+field_id+'_options_container').append(html);
11093        jQuery('#mec_new_event_field_option_key_'+field_id).val(parseInt(key)+1);
11094    });
11095
11096    if(typeof jQuery.fn.sortable !== 'undefined')
11097    {
11098        jQuery("#mec_event_form_fields").sortable(
11099        {
11100            handle: '.mec_event_field_sort'
11101        });
11102
11103        jQuery(".mec_event_fields_options_container").sortable(
11104        {
11105            handle: '.mec_event_field_option_sort'
11106        });
11107    }
11108}
11109
11110function mec_event_fields_option_remove(field_key, key)
11111{
11112    jQuery("#mec_event_fields_option_"+field_key+"_"+key).remove();
11113}
11114
11115function mec_event_fields_remove(key)
11116{
11117    jQuery("#mec_event_fields_"+key).remove();
11118}
11119
11120function mec_bfixed_fields_option_listeners()
11121{
11122    jQuery('button.mec-bfixed-field-add-option').off('click').on('click', function()
11123    {
11124        var field_id = jQuery(this).data('field-id');
11125        var key = jQuery('#mec_new_bfixed_field_option_key_'+field_id).val();
11126        var html = jQuery('#mec_bfixed_field_option').html().replace(/:i:/g, key).replace(/:fi:/g, field_id);
11127
11128        jQuery('#mec_bfixed_fields_'+field_id+'_options_container').append(html);
11129        jQuery('#mec_new_bfixed_field_option_key_'+field_id).val(parseInt(key)+1);
11130        mec_refresh_booking_condition_editors('bfixed');
11131    });
11132
11133    if(typeof jQuery.fn.sortable !== 'undefined')
11134    {
11135        jQuery("#mec_bfixed_form_fields").sortable(
11136        {
11137            handle: '.mec_bfixed_field_sort',
11138            stop: function()
11139            {
11140                mec_refresh_booking_condition_editors('bfixed');
11141            }
11142        });
11143
11144        jQuery(".mec_bfixed_fields_options_container").sortable(
11145        {
11146            handle: '.mec_bfixed_field_option_sort'
11147        });
11148    }
11149}
11150
11151function mec_bfixed_fields_option_remove(field_key, key)
11152{
11153    jQuery("#mec_bfixed_fields_option_"+field_key+"_"+key).remove();
11154    mec_refresh_booking_condition_editors('bfixed');
11155}
11156
11157function mec_bfixed_fields_remove(key)
11158{
11159    jQuery("#mec_bfixed_fields_"+key).remove();
11160    mec_refresh_booking_condition_editors('bfixed');
11161}
11162
11163function mec_additional_organizers_listeners()
11164{
11165    jQuery('#mec_additional_organizers_add').off('click').on('click', function()
11166    {
11167        var value = jQuery('.mec-additional-organizers select').val();
11168        if (!value) return;
11169
11170        // Each organizer can be added only once.
11171        if (jQuery('.mec-additional-organizers-list input[name="mec[additional_organizer_ids][]"][value="' + value + '"]').length) return;
11172
11173        var text = jQuery('.mec-additional-organizers select option:selected').text();
11174
11175        var sortLabel = jQuery(this).data('sort-label');
11176        var removeLabel = jQuery(this).data('remove-label');
11177
11178        jQuery('.mec-additional-organizers-list').append('<li><span class="mec-additional-organizer-sort">'+sortLabel+'</span> <span onclick="mec_additional_organizers_remove(this);" class="mec-additional-organizer-remove">'+removeLabel+'</span><input type="hidden" name="mec[additional_organizer_ids][]" value="'+value+'"><span class="mec_orgz_item_name">'+text+'</span></li>');
11179
11180        mec_additional_organizers_listeners();
11181    });
11182
11183    if(typeof jQuery.fn.sortable !== 'undefined')
11184    {
11185        jQuery(".mec-additional-organizers-list").sortable(
11186        {
11187            handle: '.mec-additional-organizer-sort'
11188        });
11189    }
11190}
11191
11192function mec_additional_organizers_remove(element)
11193{
11194    jQuery(element).parent().remove();
11195}
11196
11197function mec_additional_locations_listeners()
11198{
11199    jQuery('#mec_additional_locations_add').off('click').on('click', function()
11200    {
11201        var value = jQuery('.mec-additional-locations select').val();
11202        if (!value) return;
11203
11204        // Each location can be added only once.
11205        if (jQuery('.mec-additional-locations-list input[name="mec[additional_location_ids][]"][value="' + value + '"]').length) return;
11206
11207        var text = jQuery('.mec-additional-locations select option:selected').text();
11208
11209        var sortLabel = jQuery(this).data('sort-label');
11210        var removeLabel = jQuery(this).data('remove-label');
11211
11212        jQuery('.mec-additional-locations-list').append('<li><span class="mec-additional-location-sort">'+sortLabel+'</span> <span onclick="mec_additional_locations_remove(this);" class="mec-additional-location-remove">'+removeLabel+'</span><input type="hidden" name="mec[additional_location_ids][]" value="'+value+'"><span class="mec_loc_item_name">'+text+'</span></li>');
11213
11214        mec_additional_locations_listeners();
11215    });
11216
11217    if(typeof jQuery.fn.sortable !== 'undefined')
11218    {
11219        jQuery(".mec-additional-locations-list").sortable(
11220        {
11221            handle: '.mec-additional-location-sort'
11222        });
11223    }
11224}
11225
11226function mec_additional_locations_remove(element)
11227{
11228    jQuery(element).parent().remove();
11229}
11230
11231function mec_faq_remove(key)
11232{
11233    jQuery("#mec_faq_row"+key).remove();
11234}
11235
11236jQuery(document).on('focus', '.mec_date_picker', function ()
11237{
11238    if (!jQuery(this).hasClass('hasDatepicker'))
11239    {
11240        jQuery(this).datepicker({
11241            changeYear: true,
11242            changeMonth: true,
11243            dateFormat: 'yy-mm-dd',
11244            gotoCurrent: true,
11245            yearRange: 'c-3:c+5',
11246        });
11247    }
11248});
11249
11250// Ticket availability start/end: live-init + open for rows that missed (or
11251// were added after) trigger_period_picker(). Two quirks to handle:
11252// 1) jQuery UI only opens a picker from its own focus handler — one bound
11253//    BEFORE the current focus event — so we must explicitly show() here.
11254// 2) The hidden "#mec_new_ticket_raw" template gets its pickers initialized
11255//    on page load; that serializes a stale "hasDatepicker" class into rows
11256//    cloned from it, and jQuery UI refuses to attach to such elements
11257//    (_connectDatepicker bails on the class). So test for the actual
11258//    instance and strip the stale class before initializing.
11259jQuery(document).on('focus', '.mec-date-picker-start, .mec-date-picker-end', function ()
11260{
11261    var $input = jQuery(this);
11262    if(!jQuery.fn.datepicker) return;
11263
11264    if(!$input.data('datepicker'))
11265    {
11266        $input.removeClass('hasDatepicker');
11267
11268        var isStart = $input.hasClass('mec-date-picker-start');
11269        $input.datepicker({
11270            changeYear: true,
11271            changeMonth: true,
11272            dateFormat: 'yy-mm-dd',
11273            gotoCurrent: true,
11274            yearRange: 'c-1:c+5',
11275            onSelect: isStart ? function(date)
11276            {
11277                var endDate = new Date(date);
11278                var $end_picker = $input.next();
11279                $end_picker.datepicker("option", "minDate", endDate);
11280                $end_picker.datepicker("option", "maxDate", '+5y');
11281                $input.trigger('change');
11282            } : null,
11283        });
11284
11285        // Initialize the sibling end picker eagerly so the start picker's
11286        // onSelect targets a live instance even before end is ever focused.
11287        if(isStart)
11288        {
11289            var $end = $input.next('.mec-date-picker-end');
11290            if($end.length && !$end.data('datepicker'))
11291            {
11292                $end.removeClass('hasDatepicker');
11293                $end.datepicker({
11294                    changeYear: true,
11295                    changeMonth: true,
11296                    dateFormat: 'yy-mm-dd',
11297                    gotoCurrent: true,
11298                    yearRange: 'c-1:c+5',
11299                });
11300            }
11301        }
11302    }
11303
11304    $input.datepicker('show');
11305});
11306
11307// Appointment date pickers (.mec-apt-date-picker): only the "Add a date"
11308// button initializes them, so server-rendered inputs (start date, existing
11309// adjusted days) never get a picker — and day-copy clones carry a stale
11310// "hasDatepicker" class without an instance. Live-init + open on focus,
11311// same pattern as the availability handlers above.
11312jQuery(document).on('focus', '.mec-apt-date-picker', function ()
11313{
11314    var $input = jQuery(this);
11315    if(!jQuery.fn.datepicker) return;
11316
11317    if(!$input.data('datepicker'))
11318    {
11319        $input.removeClass('hasDatepicker');
11320        $input.datepicker({
11321            changeYear: true,
11322            changeMonth: true,
11323            dateFormat: datepicker_format,
11324            gotoCurrent: true,
11325            yearRange: 'c-3:c+5',
11326        });
11327    }
11328
11329    $input.datepicker('show');
11330});
11331
11332// ===== Basic / Advanced toggle (mec-basvanced-toggle) =====
11333// Delegated so it works wherever events.js loads: the admin editor AND the
11334// FES front-end form (backend.js, which used to bind this directly, is not
11335// loaded on the front-end). Replaces the old direct binding in backend.js.
11336jQuery(document).on('click', '.mec-basvanced-toggle .mec-backend-tab-item', function (e)
11337{
11338    e.preventDefault();
11339
11340    var $item = jQuery(this);
11341    if($item.hasClass('mec-b-active-tab')) return;
11342
11343    var $toggle = $item.closest('.mec-basvanced-toggle');
11344    var wrapper = $toggle.data('for');
11345    var method = $toggle.data('method');
11346
11347    $item.parent().find('.mec-b-active-tab').removeClass('mec-b-active-tab');
11348    $item.addClass('mec-b-active-tab');
11349
11350    var $wrapper = jQuery(wrapper);
11351    if(method === 'addition') $wrapper.find('.mec-basvanced-advanced').toggleClass('w-hidden');
11352    else
11353    {
11354        $wrapper.find('.mec-basvanced-basic').toggleClass('w-hidden');
11355        $wrapper.find('.mec-basvanced-advanced').toggleClass('w-hidden');
11356    }
11357});
11358
11359// ===== Publish-validation fallback (crash-isolated) =====
11360// The main validation module lives INSIDE jQuery(document).ready and shares
11361// that callback with a dozen initializers — a runtime error anywhere above
11362// it would silently prevent its submit handler from ever being bound (no
11363// error surfaces at click time; the form simply submits). This top-level,
11364// document-delegated copy guarantees the critical guard — "cannot publish
11365// without a start date" + the wp-post-new-reload URL cleanup — survives any
11366// such failure. It is bound on document, so it runs AFTER the main
11367// form-level handler; if that one already handled the submit it stays
11368// silent (e.isDefaultPrevented()).
11369jQuery(document).on('submit', '#post', function (e)
11370{
11371    if(e.isDefaultPrevented()) return; // the main validation already handled it
11372
11373    // Draft saves and previews are exempt from publish validation.
11374    var submitter = (e.originalEvent && e.originalEvent.submitter) ? jQuery(e.originalEvent.submitter) : null;
11375    if(submitter && submitter.attr('id') === 'save-post') return;
11376    if(jQuery('#wp-preview').val() === 'dopreview') return;
11377
11378    var $startDate = jQuery('#mec_start_date');
11379    if(!$startDate.length) return;
11380
11381    // Undo WP core's address-bar rewrite: wp-admin/js/post.js appends
11382    // "wp-post-new-reload=true" on publish-click of an auto-draft even when
11383    // the submit ends up blocked, leaving a misleading URL behind.
11384    if(window.history && window.history.replaceState && window.location.href.indexOf('wp-post-new-reload') > -1)
11385    {
11386        window.history.replaceState(null, null, window.location.href.replace(/([?&])wp-post-new-reload=true&?/, '$1').replace(/[?&]$/, ''));
11387    }
11388
11389    if(jQuery.trim($startDate.val() || '') === '')
11390    {
11391        e.preventDefault();
11392
11393        // Jump to the Date & Time tab so the field is visible.
11394        jQuery('#mec_metabox_details .mec-add-event-tabs-link[data-href="mec_meta_box_date_form"]').trigger('click');
11395
11396        // Inline error on the field.
11397        $startDate.addClass('mec-field-invalid').attr('aria-invalid', 'true');
11398        var $err = $startDate.next('.mec-field-error');
11399        if(!$err.length) $err = jQuery('<span class="mec-field-error" role="alert"></span>').insertAfter($startDate);
11400        var msg = (typeof mec_admin_localize !== 'undefined' && mec_admin_localize.start_date_required) ? mec_admin_localize.start_date_required : 'Please enter a start date for the event.';
11401        $err.text(msg);
11402
11403        // Notice card — self-contained so it renders even if the main module died.
11404        jQuery('.mec-notice-temp').remove();
11405        var $n = jQuery('<div/>', {
11406            'class': 'mec-notice mec-notice--error mec-notice-temp',
11407            html: '<div class="mec-notice-accent"></div><div class="mec-notice-body"><div class="mec-notice-title">Start date required</div><p class="mec-notice-text">' + msg + '</p><div class="mec-notice-actions"><button type="button" class="mec-notice-btn mec-notice-btn--ghost mec-notice-dismiss">Got it</button></div></div><div class="mec-notice-close" aria-label="Close" role="button" tabindex="0">&times;</div>'
11408        });
11409        jQuery('#poststuff').prepend($n);
11410        jQuery('html, body').animate({scrollTop: $n.offset().top - 40}, 200);
11411        $n.find('.mec-notice-dismiss, .mec-notice-close').on('click', function(){ $n.remove(); });
11412
11413        $startDate.trigger('focus');
11414    }
11415});
11416
11417// ===== Native-required feedback (e.g. required Event Data fields) =====
11418// When a field carries the HTML5 "required" attribute (custom Event Data
11419// fields can), the browser blocks submission BEFORE the submit event fires:
11420// none of the submit handlers above run, so no MEC notice appears and WP
11421// core's publish-click URL rewrite ("wp-post-new-reload=true") lingers in
11422// the address bar. The only signal is the non-bubbling "invalid" event —
11423// captured here on the document so the user still gets MEC-style feedback.
11424document.addEventListener('invalid', function (ev)
11425{
11426    var field = ev.target;
11427    if(!field || !field.form || field.form.id !== 'post') return;
11428
11429    // Undo WP core's address-bar rewrite (same cleanup as the fallback).
11430    if(window.history && window.history.replaceState && window.location.href.indexOf('wp-post-new-reload') > -1)
11431    {
11432        window.history.replaceState(null, null, window.location.href.replace(/([?&])wp-post-new-reload=true&?/, '$1').replace(/[?&]$/, ''));
11433    }
11434
11435    // Friendly field name: its label, aria-label, placeholder or title.
11436    var name = '';
11437    if(field.id)
11438    {
11439        var $l = jQuery('label[for="' + field.id + '"]').first();
11440        if($l.length) name = jQuery.trim($l.text());
11441    }
11442    if(!name) name = field.getAttribute('aria-label') || field.placeholder || field.title || '';
11443
11444    jQuery('.mec-notice-temp').remove();
11445    var msg = name
11446        ? '"' + jQuery('<div/>').text(name).html() + '" ' + (field.validationMessage || 'is required.')
11447        : (field.validationMessage || 'Please fill in the required fields.');
11448
11449    var $n = jQuery('<div/>', {
11450        'class': 'mec-notice mec-notice--error mec-notice-temp',
11451        html: '<div class="mec-notice-accent"></div><div class="mec-notice-body"><div class="mec-notice-title">Required field missing</div><p class="mec-notice-text">' + msg + '</p><div class="mec-notice-actions"><button type="button" class="mec-notice-btn mec-notice-btn--ghost mec-notice-dismiss">Got it</button></div></div><div class="mec-notice-close" aria-label="Close" role="button" tabindex="0">&times;</div>'
11452    });
vendor: 5,566 bytes, lines 11453-11462
11453    jQuery('#poststuff').prepend($n);
11454    jQuery('html, body').animate({scrollTop: $n.offset().top - 40}, 200);
11455    $n.find('.mec-notice-dismiss, .mec-notice-close').on('click', function(){ $n.remove(); });
11456}, true);
11457;
11458/*! Lity - v2.4.1 - 2020-04-26
11459* http://sorgalla.com/lity/
11460* Copyright (c) 2015-2020 Jan Sorgalla; Licensed MIT */
11461
11462!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return b(a,c)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=b(a,require("jquery")):a.lity=b(a,a.jQuery||a.Zepto)}("undefined"!=typeof window?window:this,function(a,b){"use strict";function c(a){var b=B();return N&&a.length?(a.one(N,b.resolve),setTimeout(b.resolve,500)):b.resolve(),b.promise()}function d(a,c,d){if(1===arguments.length)return b.extend({},a);if("string"==typeof c){if(void 0===d)return void 0===a[c]?null:a[c];a[c]=d}else b.extend(a,c);return this}function e(a){for(var b,c=decodeURI(a.split("#")[0]).split("&"),d={},e=0,f=c.length;e<f;e++)c[e]&&(b=c[e].split("="),d[b[0]]=b[1]);return d}function f(a,c){return a+(a.indexOf("?")>-1?"&":"?")+b.param(c)}function g(a,b){var c=a.indexOf("#");return-1===c?b:(c>0&&(a=a.substr(c)),b+a)}function h(a){return b('<span class="lity-error"></span>').append(a)}function i(a,c){var d=c.opener()&&c.opener().data("lity-desc")||"Image with no description",e=b('<img src="'+a+'" alt="'+d+'"/>'),f=B(),g=function(){f.reject(h("Failed loading image"))};return e.on("load",function(){if(0===this.naturalWidth)return g();f.resolve(e)}).on("error",g),f.promise()}function j(a,c){var d,e,f;try{d=b(a)}catch(a){return!1}return!!d.length&&(e=b('<i style="display:none !important"></i>'),f=d.hasClass("lity-hide"),c.element().one("lity:remove",function(){e.before(d).remove(),f&&!d.closest(".lity-content").length&&d.addClass("lity-hide")}),d.removeClass("lity-hide").after(e))}function k(a){var c=J.exec(a);return!!c&&o(g(a,f("https://www.youtube"+(c[2]||"")+".com/embed/"+c[4],b.extend({autoplay:1},e(c[5]||"")))))}function l(a){var c=K.exec(a);return!!c&&o(g(a,f("https://player.vimeo.com/video/"+c[3],b.extend({autoplay:1},e(c[4]||"")))))}function m(a){var c=M.exec(a);return!!c&&(0!==a.indexOf("http")&&(a="https:"+a),o(g(a,f("https://www.facebook.com/plugins/video.php?href="+a,b.extend({autoplay:1},e(c[4]||""))))))}function n(a){var b=L.exec(a);return!!b&&o(g(a,f("https://www.google."+b[3]+"/maps?"+b[6],{output:b[6].indexOf("layer=c")>0?"svembed":"embed"})))}function o(a){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen allow="autoplay; fullscreen" src="'+a+'"/></div>'}function p(){return z.documentElement.clientHeight?z.documentElement.clientHeight:Math.round(A.height())}function q(a){var b=v();b&&(27===a.keyCode&&b.options("esc")&&b.close(),9===a.keyCode&&r(a,b))}function r(a,b){var c=b.element().find(G),d=c.index(z.activeElement);a.shiftKey&&d<=0?(c.get(c.length-1).focus(),a.preventDefault()):a.shiftKey||d!==c.length-1||(c.get(0).focus(),a.preventDefault())}function s(){b.each(D,function(a,b){b.resize()})}function t(a){1===D.unshift(a)&&(C.addClass("lity-active"),A.on({resize:s,keydown:q})),b("body > *").not(a.element()).addClass("lity-hidden").each(function(){var a=b(this);void 0===a.data(F)&&a.data(F,a.attr(E)||null)}).attr(E,"true")}function u(a){var c;a.element().attr(E,"true"),1===D.length&&(C.removeClass("lity-active"),A.off({resize:s,keydown:q})),D=b.grep(D,function(b){return a!==b}),c=D.length?D[0].element():b(".lity-hidden"),c.removeClass("lity-hidden").each(function(){var a=b(this),c=a.data(F);c?a.attr(E,c):a.removeAttr(E),a.removeData(F)})}function v(){return 0===D.length?null:D[0]}function w(a,c,d,e){var f,g="inline",h=b.extend({},d);return e&&h[e]?(f=h[e](a,c),g=e):(b.each(["inline","iframe"],function(a,b){delete h[b],h[b]=d[b]}),b.each(h,function(b,d){return!d||(!(!d.test||d.test(a,c))||(f=d(a,c),!1!==f?(g=b,!1):void 0))})),{handler:g,content:f||""}}function x(a,e,f,g){function h(a){k=b(a).css("max-height",p()+"px"),j.find(".lity-loader").each(function(){var a=b(this);c(a).always(function(){a.remove()})}),j.removeClass("lity-loading").find(".lity-content").empty().append(k),m=!0,k.trigger("lity:ready",[l])}var i,j,k,l=this,m=!1,n=!1;e=b.extend({},H,e),j=b(e.template),l.element=function(){return j},l.opener=function(){return f},l.options=b.proxy(d,l,e),l.handlers=b.proxy(d,l,e.handlers),l.resize=function(){m&&!n&&k.css("max-height",p()+"px").trigger("lity:resize",[l])},l.close=function(){if(m&&!n){n=!0,u(l);var a=B();if(g&&(z.activeElement===j[0]||b.contains(j[0],z.activeElement)))try{g.focus()}catch(a){}return k.trigger("lity:close",[l]),j.removeClass("lity-opened").addClass("lity-closed"),c(k.add(j)).always(function(){k.trigger("lity:remove",[l]),j.remove(),j=void 0,a.resolve()}),a.promise()}},i=w(a,l,e.handlers,e.handler),j.attr(E,"false").addClass("lity-loading lity-opened lity-"+i.handler).appendTo("body").focus().on("click","[data-lity-close]",function(a){b(a.target).is("[data-lity-close]")&&l.close()}).trigger("lity:open",[l]),t(l),b.when(i.content).always(h)}function y(a,c,d){a.preventDefault?(a.preventDefault(),d=b(this),a=d.data("lity-target")||d.attr("href")||d.attr("src")):d=b(d);var e=new x(a,b.extend({},d.data("lity-options")||d.data("lity"),c),d,z.activeElement);if(!a.preventDefault)return e}var z=a.document,A=b(a),B=b.Deferred,C=b("html"),D=[],E="aria-hidden",F="lity-"+E,G='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not
11462([tabindex^="-"])',H={esc:!0,handler:null,handlers:{image:i,inline:j,youtube:k,vimeo:l,googlemaps:n,facebookvideo:m,iframe:o},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'},I=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,J=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,K=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,L=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,M=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,N=function(){var a=z.createElement("div"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return b[c];return!1}();return i.test=function(a){return I.test(a)},y.version="2.4.1",y.options=b.proxy(d,y,H),y.handlers=b.proxy(d,y,H.handlers),y.current=v,b(z).on("click.lity","[data-lity]",y),y});;
11463/*
11464 *  colourBrightness.js
11465 *
11466 *  Copyright 2013-2016, Jamie Brittain - http://jamiebrittain.com
11467 *  Released under the WTFPL license
11468 *  http://sam.zoy.org/wtfpl/
11469 *
11470 *  Github:  http://github.com/jamiebrittain/colourBrightness.js
11471 *  Version: 1.2
11472 */
11473!function(r){r.fn.colourBrightness=function(){function r(r){for(var t="";"html"!=r[0].tagName.toLowerCase()&&(t=r.css("background-color"),"rgba(0, 0, 0, 0)"==t||"transparent"==t);)r=r.parent();return t}var t,a,s,e,n=r(this);return n.match(/^rgb/)?(n=n.match(/rgba?\(([^)]+)\)/)[1],n=n.split(/ *, */).map(Number),t=n[0],a=n[1],s=n[2]):"#"==n[0]&&7==n.length?(t=parseInt(n.slice(1,3),16),a=parseInt(n.slice(3,5),16),s=parseInt(n.slice(5,7),16)):"#"==n[0]&&4==n.length&&(t=parseInt(n[1]+n[1],16),a=parseInt(n[2]+n[2],16),s=parseInt(n[3]+n[3],16)),e=(299*t+587*a+114*s)/1e3,125>e?this.removeClass("light").addClass("dark"):this.removeClass("dark").addClass("light"),this}}(jQuery);
11474;
11475/**
11476 * Owl carousel
11477 * @version 2.3.4
11478 * @author Bartosz Wojciechowski
11479 * @author David Deutsch
11480 * @license The MIT License (MIT)
11481 */
11482!function(t,e,i,s){function n(e,i){this.settings=null,this.options=t.extend({},n.Defaults,i),this.$element=t(e),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},t.each(["onResize","onThrottledResize"],t.proxy((function(e,i){this._handlers[i]=t.proxy(this[i],this)}),this)),t.each(n.Plugins,t.proxy((function(t,e){this._plugins[t.charAt(0).toLowerCase()+t.slice(1)]=new e(this)}),this)),t.each(n.Workers,t.proxy((function(e,i){this._pipe.push({filter:i.filter,run:t.proxy(i.run,this)})}),this)),this.setup(),this.initialize()}n.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:e,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},n.Width={Default:"default",Inner:"inner",Outer:"outer"},n.Type={Event:"event",State:"state"},n.Plugins={},n.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(t){t.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(t){var e=this.settings.margin||"",i=!this.settings.autoWidth,s=this.settings.rtl,n={width:"auto","margin-left":s?e:"","margin-right":s?"":e};!i&&this.$stage.children().css(n),t.css=n}},{filter:["width","items","settings"],run:function(t){var e=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,i=null,s=this._items.length,n=!this.settings.autoWidth,o=[];for(t.items={merge:!1,width:e};s--;)i=this._mergers[s],i=this.settings.mergeFit&&Math.min(i,this.settings.items)||i,t.items.merge=i>1||t.items.merge,o[s]=n?e*i:this._items[s].width();this._widths=o}},{filter:["items","settings"],run:function(){var e=[],i=this._items,s=this.settings,n=Math.max(2*s.items,4),o=2*Math.ceil(i.length/2),r=s.loop&&i.length?s.rewind?n:Math.max(n,o):0,a="",h="";for(r/=2;r>0;)e.push(this.normalize(e.length/2,!0)),a+=i[e[e.length-1]][0].outerHTML,e.push(this.normalize(i.length-1-(e.length-1)/2,!0)),h=i[e[e.length-1]][0].outerHTML+h,r-=1;this._clones=e,t(a).addClass("cloned").appendTo(this.$stage),t(h).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var t=this.settings.rtl?1:-1,e=this._clones.length+this._items.length,i=-1,s=0,n=0,o=[];++i<e;)s=o[i-1]||0,n=this._widths[this.relative(i)]+this.settings.margin,o.push(s+n*t);this._coordinates=o}},{filter:["width","items","settings"],run:function(){var t=this.settings.stagePadding,e=this._coordinates,i={width:Math.ceil(Math.abs(e[e.length-1]))+2*t,"padding-left":t||"","padding-right":t||""};this.$stage.css(i)}},{filter:["width","items","settings"],run:function(t){var e=this._coordinates.length,i=!this.settings.autoWidth,s=this.$stage.children();if(i&&t.items.merge)for(;e--;)t.css.width=this._widths[this.relative(e)],s.eq(e).css(t.css);else i&&(t.css.width=t.items.width,s.css(t.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(t){t.current=t.current?this.$stage.children().index(t.current):0,t.current=Math.max(this.minimum(),Math.min(this.maximum(),t.current)),this.reset(t.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var t,e,i,s,n=this.settings.rtl?1:-1,o=2*this.settings.stagePadding,r=this.coordinates(this.current())+o,a=r+this.width()*n,h=[];for(i=0,s=this._coordinates.length;i<s;i++)t=this._coordinates[i-1]||0,e=Math.abs(this._coordinates[i])+o*n,(this.op(t,"<=",r)&&this.op(t,">",a)||this.op(e,"<",r)&&this.op(e,">",a))&&h.push(i);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+h.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],n.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=t("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(t("<div/>",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},n.prototype.initializeItems=function(){var e=this.$element.find(".owl-item");if(e.length)return this._items=e.get().map((function(e){return t(e)})),this._mergers=this._items.map((function(){return 1})),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},n.prototype.initialize=function(){var t,e,i;(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading"))&&(t=this.$element.find("img"),e=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:s,i=this.$element.children(e).width(),t.length&&i<=0&&this.preloadAutoWidthImages(t));this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},n.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},n.prototype.setup=function(){var e=this.viewport(),i=this.options.responsive,s=-1,n=null;i?(t.each(i,(function(t){t<=e&&t>s&&(s=Number(t))})),"function"==typeof(n=t.extend({},this.options,i[s])).stagePadding&&(n.stagePadding=n.stagePadding()),delete n.responsive,n.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+s))):n=t.extend({},this.options),this.trigger("change",{property:{name:"settings",value:n}}),this._breakpoint=s,this.settings=n,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},n.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},n.prototype.prepare=function(e){var i=this.trigger("prepare",{content:e});return i.data||(i.data=t("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(e)),this.trigger("prepared",{content:i.data}),i.data},n.prototype.update=function(){for(var e=0,i=this._pipe.length,s=t.proxy((function(t){return this[t]}),this._invalidated),n={};e<i;)(this._invalidated.all||t.grep(this._pipe[e].filter,s).length>0)&&this._pipe[e].run(n),e++;this._invalidated={},!this.is("valid")&&this.enter("valid")},n.prototype.width=function(t){switch(t=t||n.Width.Default){case n.Width.Inner:case n.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},n.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},n.prototype.onThrottledResize=function(){e.clearTimeout(this.resizeTimer),this.resizeTimer=e.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},n.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},n.prototype.registerEventHandlers=function(){t.support.transition&&this.$stage.on(t.support.transition.end+".owl.core",t.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(e,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",t.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",(function(){return!1}))),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",t.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",t.proxy(this.onDragEnd,this)))},n.prototype.onDragStart=function(e){var s=null;
vendor: 13,944 bytes, line 11482
114823!==e.which&&(t.support.transform?s={x:(s=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","))[16===s.length?12:4],y:s[16===s.length?13:5]}:(s=this.$stage.position(),s={x:this.settings.rtl?s.left+this.$stage.width()-this.width()+this.settings.margin:s.left,y:s.top}),this.is("animating")&&(t.support.transform?this.animate(s.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===e.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=t(e.target),this._drag.stage.start=s,this._drag.stage.current=s,this._drag.pointer=this.pointer(e),t(i).on("mouseup.owl.core touchend.owl.core",t.proxy(this.onDragEnd,this)),t(i).one("mousemove.owl.core touchmove.owl.core",t.proxy((function(e){var s=this.difference(this._drag.pointer,this.pointer(e));t(i).on("mousemove.owl.core touchmove.owl.core",t.proxy(this.onDragMove,this)),Math.abs(s.x)<Math.abs(s.y)&&this.is("valid")||(e.preventDefault(),this.enter("dragging"),this.trigger("drag"))}),this)))},n.prototype.onDragMove=function(t){var e=null,i=null,s=null,n=this.difference(this._drag.pointer,this.pointer(t)),o=this.difference(this._drag.stage.start,n);this.is("dragging")&&(t.preventDefault(),this.settings.loop?(e=this.coordinates(this.minimum()),i=this.coordinates(this.maximum()+1)-e,o.x=((o.x-e)%i+i)%i+e):(e=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),i=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),s=this.settings.pullDrag?-1*n.x/5:0,o.x=Math.max(Math.min(o.x,e+s),i+s)),this._drag.stage.current=o,this.animate(o.x))},n.prototype.onDragEnd=function(e){var s=this.difference(this._drag.pointer,this.pointer(e)),n=this._drag.stage.current,o=s.x>0^this.settings.rtl?"left":"right";t(i).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==s.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(n.x,0!==s.x?o:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=o,(Math.abs(s.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",(function(){return!1}))),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},n.prototype.closest=function(e,i){var n=-1,o=this.width(),r=this.coordinates();return this.settings.freeDrag||t.each(r,t.proxy((function(t,a){return"left"===i&&e>a-30&&e<a+30?n=t:"right"===i&&e>a-o-30&&e<a-o+30?n=t+1:this.op(e,"<",a)&&this.op(e,">",r[t+1]!==s?r[t+1]:a-o)&&(n="left"===i?t+1:t),-1===n}),this)),this.settings.loop||(this.op(e,">",r[this.minimum()])?n=e=this.minimum():this.op(e,"<",r[this.maximum()])&&(n=e=this.maximum())),n},n.prototype.animate=function(e){var i=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),i&&(this.enter("animating"),this.trigger("translate")),t.support.transform3d&&t.support.transition?this.$stage.css({transform:"translate3d("+e+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):i?this.$stage.animate({left:e+"px"},this.speed(),this.settings.fallbackEasing,t.proxy(this.onTransitionEnd,this)):this.$stage.css({left:e+"px"})},n.prototype.is=function(t){return this._states.current[t]&&this._states.current[t]>0},n.prototype.current=function(t){if(t===s)return this._current;if(0===this._items.length)return s;if(t=this.normalize(t),this._current!==t){var e=this.trigger("change",{property:{name:"position",value:t}});e.data!==s&&(t=this.normalize(e.data)),this._current=t,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},n.prototype.invalidate=function(e){return"string"===t.type(e)&&(this._invalidated[e]=!0,this.is("valid")&&this.leave("valid")),t.map(this._invalidated,(function(t,e){return e}))},n.prototype.reset=function(t){(t=this.normalize(t))!==s&&(this._speed=0,this._current=t,this.suppress(["translate","translated"]),this.animate(this.coordinates(t)),this.release(["translate","translated"]))},n.prototype.normalize=function(t,e){var i=this._items.length,n=e?0:this._clones.length;return!this.isNumeric(t)||i<1?t=s:(t<0||t>=i+n)&&(t=((t-n/2)%i+i)%i+n/2),t},n.prototype.relative=function(t){return t-=this._clones.length/2,this.normalize(t,!0)},n.prototype.maximum=function(t){var e,i,s,n=this.settings,o=this._coordinates.length;if(n.loop)o=this._clones.length/2+this._items.length-1;else if(n.autoWidth||n.merge){if(e=this._items.length)for(i=this._items[--e].width(),s=this.$element.width();e--&&!((i+=this._items[e].width()+this.settings.margin)>s););o=e+1}else o=n.center?this._items.length-1:this._items.length-n.items;return t&&(o-=this._clones.length/2),Math.max(o,0)},n.prototype.minimum=function(t){return t?0:this._clones.length/2},n.prototype.items=function(t){return t===s?this._items.slice():(t=this.normalize(t,!0),this._items[t])},n.prototype.mergers=function(t){return t===s?this._mergers.slice():(t=this.normalize(t,!0),this._mergers[t])},n.prototype.clones=function(e){var i=this._clones.length/2,n=i+this._items.length,o=function(t){return t%2==0?n+t/2:i-(t+1)/2};return e===s?t.map(this._clones,(function(t,e){return o(e)})):t.map(this._clones,(function(t,i){return t===e?o(i):null}))},n.prototype.speed=function(t){return t!==s&&(this._speed=t),this._speed},n.prototype.coordinates=function(e){var i,n=1,o=e-1;return e===s?t.map(this._coordinates,t.proxy((function(t,e){return this.coordinates(e)}),this)):(this.settings.center?(this.settings.rtl&&(n=-1,o=e+1),i=this._coordinates[e],i+=(this.width()-i+(this._coordinates[o]||0))/2*n):i=this._coordinates[o]||0,i=Math.ceil(i))},n.prototype.duration=function(t,e,i){return 0===i?0:Math.min(Math.max(Math.abs(e-t),1),6)*Math.abs(i||this.settings.smartSpeed)},n.prototype.to=function(t,e){var i=this.current(),s=null,n=t-this.relative(i),o=(n>0)-(n<0),r=this._items.length,a=this.minimum(),h=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(n)>r/2&&(n+=-1*o*r),(s=(((t=i+n)-a)%r+r)%r+a)!==t&&s-n<=h&&s-n>0&&(i=s-n,t=s,this.reset(i))):t=this.settings.rewind?(t%(h+=1)+h)%h:Math.max(a,Math.min(h,t)),this.speed(this.duration(i,t,e)),this.current(t),this.isVisible()&&this.update()},n.prototype.next=function(t){t=t||!1,this.to(this.relative(this.current())+1,t)},n.prototype.prev=function(t){t=t||!1,this.to(this.relative(this.current())-1,t)},n.prototype.onTransitionEnd=function(t){if(t!==s&&(t.stopPropagation(),(t.target||t.srcElement||t.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},n.prototype.viewport=function(){var s;return this.options.responsiveBaseElement!==e?s=t(this.options.responsiveBaseElement).width():e.innerWidth?s=e.innerWidth:i.documentElement&&i.documentElement.clientWidth?s=i.documentElement.clientWidth:console.warn("Can not detect viewport width."),s},n.prototype.replace=function(e){this.$stage.empty(),this._items=[],e&&(e=e instanceof jQuery?e:t(e)),this.settings.nestedItemSelector&&(e=e.find("."+this.settings.nestedItemSelector)),e.filter((function(){return 1===this.nodeType})).each(t.proxy((function(t,e){e=this.prepare(e),this.$stage.append(e),this._items.push(e),this._mergers.push(1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)}),this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},n.prototype.add=function(e,i){var n=this.relative(this._current);i=i===s?this._items.length:this.normalize(i,!0),e=e instanceof jQuery?e:t(e),this.trigger("add",{content:e,position:i}),e=this.prepare(e),0===this._items.length||i===this._items.length?(0===this._items.length&&this.$stage.append(e),0!==this._items.length&&this._items[i-1].after(e),this._items.push(e),this._mergers.push(1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[i].before(e),this._items.splice(i,0,e),this._mergers.splice(i,0,1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[n]&&this.reset(this._items[n].index()),this.invalidate("items"),this.trigger("added",{content:e,position:i})},n.prototype.remove=function(t){(t=this.normalize(t,!0))!==s&&(this.trigger("remove",{content:this._items[t],position:t}),this._items[t].remove(),this._items.splice(t,1),this._mergers.splice(t,1),this.invalidate("items"),this.trigger("removed",{content:null,position:t}))},n.prototype.preloadAutoWidthImages=function(e){e.each(t.proxy((function(e,i){this.enter("pre-loading"),i=t(i),t(new Image).one("load",t.proxy((function(t){i.attr("src",t.target.src),i.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()}),this)).attr("src",i.attr("src")||i.attr("data-src")||i.attr("data-src-retina"))}),this))},n.prototype.destroy=function(){for(var s in this.$element.off(".owl.core"),this.$stage.off(".owl.core"),t(i).off(".owl.core"),!1!==this.settings.responsive&&(e.clearTimeout(this.resizeTimer),this.off(e,"resize",this._handlers.onThrottledResize)),this._plugins)this._plugins[s].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},n.prototype.op=function(t,e,i){var s=this.settings.rtl;switch(e){case"<":return s?t>i:t<i;case">":return s?t<i:t>i;case">=":return s?t<=i:t>=i;case"<=":return s?t>=i:t<=i}},n.prototype.on=function(t,e,i,s){t.addEventListener?t.addEventListener(e,i,s):t.attachEvent&&t.attachEvent("on"+e,i)},n.prototype.off=function(t,e,i,s){t.removeEventListener?t.removeEventListener(e,i,s):t.detachEvent&&t.detachEvent("on"+e,i)},n.prototype.trigger=function(e,i,s,o,r){var a={item:{count:this._items.length,index:this.current()}},h=t.camelCase(t.grep(["on",e,s],(function(t){return t})).join("-").toLowerCase()),l=t.Event([e,"owl",s||"carousel"].join(".").toLowerCase(),t.extend({relatedTarget:this},a,i));return this._supress[e]||(t.each(this._plugins,(function(t,e){e.onTrigger&&e.onTrigger(l)})),this.register({type:n.Type.Event,name:e}),this.$element.trigger(l),this.settings&&"function"==typeof this.settings[h]&&this.settings[h].call(this,l)),l},n.prototype.enter=function(e){t.each([e].concat(this._states.tags[e]||[]),t.proxy((function(t,e){this._states.current[e]===s&&(this._states.current[e]=0),this._states.current[e]++}),this))},n.prototype.leave=function(e){t.each([e].concat(this._states.tags[e]||[]),t.proxy((function(t,e){this._states.current[e]--}),this))},n.prototype.register=function(e){if(e.type===n.Type.Event){if(t.event.special[e.name]||(t.event.special[e.name]={}),!t.event.special[e.name].owl){var i=t.event.special[e.name]._default;t.event.special[e.name]._default=function(t){return!i||!i.apply||t.namespace&&-1!==t.namespace.indexOf("owl")?t.namespace&&t.namespace.indexOf("owl")>-1:i.apply(this,arguments)},t.event.special[e.name].owl=!0}}else e.type===n.Type.State&&(this._states.tags[e.name]?this._states.tags[e.name]=this._states.tags[e.name].concat(e.tags):this._states.tags[e.name]=e.tags,this._states.tags[e.name]=t.grep(this._states.tags[e.name],t.proxy((function(i,s){return t.inArray(i,this._states.tags[e.name])===s}),this)))},n.prototype.suppress=function(e){t.each(e,t.proxy((function(t,e){this._supress[e]=!0}),this))},n.prototype.release=function(e){t.each(e,t.proxy((function(t,e){delete this._supress[e]}),this))},n.prototype.pointer=function(t){var i={x:null,y:null};return(t=(t=t.originalEvent||t||e.event).touches&&t.touches.length?t.touches[0]:t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t).pageX?(i.x=t.pageX,i.y=t.pageY):(i.x=t.clientX,i.y=t.clientY),i},n.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))},n.prototype.difference=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},t.fn.owlCarousel=function(e){var i=Array.prototype.slice.call(arguments,1);return this.each((function(){var s=t(this),o=s.data("owl.carousel");o||(o=new n(this,"object"==typeof e&&e),s.data("owl.carousel",o),t.each(["next","prev","to","destroy","refresh","replace","add","remove"],(function(e,i){o.register({type:n.Type.Event,name:i}),o.$element.on(i+".owl.carousel.core",t.proxy((function(t){t.namespace&&t.relatedTarget!==this&&(this.suppress([i]),o[i].apply(this,[].slice.call(arguments,1)),this.release([i]))}),o))}))),"string"==typeof e&&"_"!==e.charAt(0)&&o[e].apply(o,i)}))},t.fn.owlCarousel.Constructor=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":t.proxy((function(t){t.namespace&&this._core.settings.autoRefresh&&this.watch()}),this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers)};n.Defaults={autoRefresh:!0,autoRefreshInterval:500},n.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=e.setInterval(t.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},n.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},n.prototype.destroy=function(){var t,i;for(t in e.clearInterval(this._interval),this._handlers)this._core.$element.off(t,this._handlers[t]);for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},t.fn.owlCarousel.Constructor.Plugins.AutoRefresh=n}
11482(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":t.proxy((function(e){if(e.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(e.property&&"position"==e.property.name||"initialized"==e.type)){var i=this._core.settings,s=i.center&&Math.ceil(i.items/2)||i.items,n=i.center&&-1*s||0,o=(e.property&&undefined!==e.property.value?e.property.value:this._core.current())+n,r=this._core.clones().length,a=t.proxy((function(t,e){this.load(e)}),this);for(i.lazyLoadEager>0&&(s+=i.lazyLoadEager,i.loop&&(o-=i.lazyLoadEager,s++));n++<s;)this.load(r/2+this._core.relative(o)),r&&t.each(this._core.clones(this._core.relative(o)),a),o++}}),this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers)};n.Defaults={lazyLoad:!1,lazyLoadEager:0},n.prototype.load=function(i){var s=this._core.$stage.children().eq(i),n=s&&s.find(".owl-lazy");!n||t.inArray(s.get(0),this._loaded)>-1||(n.each(t.proxy((function(i,s){var n,o=t(s),r=e.devicePixelRatio>1&&o.attr("data-src-retina")||o.attr("data-src")||o.attr("data-srcset");this._core.trigger("load",{element:o,url:r},"lazy"),o.is("img")?o.one("load.owl.lazy",t.proxy((function(){o.css("opacity",1),this._core.trigger("loaded",{element:o,url:r},"lazy")}),this)).attr("src",r):o.is("source")?o.one("load.owl.lazy",t.proxy((function(){this._core.trigger("loaded",{element:o,url:r},"lazy")}),this)).attr("srcset",r):((n=new Image).onload=t.proxy((function(){o.css({"background-image":'url("'+r+'")',opacity:"1"}),this._core.trigger("loaded",{element:o,url:r},"lazy")}),this),n.src=r)}),this)),this._loaded.push(s.get(0)))},n.prototype.destroy=function(){var t,e;for(t in this.handlers)this._core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Lazy=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(i){this._core=i,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":t.proxy((function(t){t.namespace&&this._core.settings.autoHeight&&this.update()}),this),"changed.owl.carousel":t.proxy((function(t){t.namespace&&this._core.settings.autoHeight&&"position"===t.property.name&&this.update()}),this),"loaded.owl.lazy":t.proxy((function(t){t.namespace&&this._core.settings.autoHeight&&t.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()}),this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var s=this;t(e).on("load",(function(){s._core.settings.autoHeight&&s.update()})),t(e).resize((function(){s._core.settings.autoHeight&&(null!=s._intervalId&&clearTimeout(s._intervalId),s._intervalId=setTimeout((function(){s.update()}),250))}))};n.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},n.prototype.update=function(){var e=this._core._current,i=e+this._core.settings.items,s=this._core.settings.lazyLoad,n=this._core.$stage.children().toArray().slice(e,i),o=[],r=0;t.each(n,(function(e,i){o.push(t(i).height())})),(r=Math.max.apply(null,o))<=1&&s&&this._previousHeight&&(r=this._previousHeight),this._previousHeight=r,this._core.$stage.parent().height(r).addClass(this._core.settings.autoHeightClass)},n.prototype.destroy=function(){var t,e;for(t in this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.AutoHeight=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":t.proxy((function(t){t.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})}),this),"resize.owl.carousel":t.proxy((function(t){t.namespace&&this._core.settings.video&&this.isInFullScreen()&&t.preventDefault()}),this),"refreshed.owl.carousel":t.proxy((function(t){t.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()}),this),"changed.owl.carousel":t.proxy((function(t){t.namespace&&"position"===t.property.name&&this._playing&&this.stop()}),this),"prepared.owl.carousel":t.proxy((function(e){if(e.namespace){var i=t(e.content).find(".owl-video");i.length&&(i.css("display","none"),this.fetch(i,t(e.content)))}}),this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",t.proxy((function(t){this.play(t)}),this))};n.Defaults={video:!1,videoHeight:!1,videoWidth:!1},n.prototype.fetch=function(t,e){var i=t.attr("data-vimeo-id")?"vimeo":t.attr("data-vzaar-id")?"vzaar":"youtube",s=t.attr("data-vimeo-id")||t.attr("data-youtube-id")||t.attr("data-vzaar-id"),n=t.attr("data-width")||this._core.settings.videoWidth,o=t.attr("data-height")||this._core.settings.videoHeight,r=t.attr("href");if(!r)throw new Error("Missing video URL.");
vendor: 13,319 bytes, line 11482
11482if((s=r.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/))[3].indexOf("youtu")>-1)i="youtube";else if(s[3].indexOf("vimeo")>-1)i="vimeo";else{if(!(s[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");i="vzaar"}s=s[6],this._videos[r]={type:i,id:s,width:n,height:o},e.attr("data-video",r),this.thumbnail(t,this._videos[r])},n.prototype.thumbnail=function(e,i){var s,n,o=i.width&&i.height?"width:"+i.width+"px;height:"+i.height+"px;":"",r=e.find("img"),a="src",h="",l=this._core.settings,c=function(i){'<div class="owl-video-play-icon"></div>',s=l.lazyLoad?t("<div/>",{class:"owl-video-tn "+h,srcType:i}):t("<div/>",{class:"owl-video-tn",style:"opacity:1;background-image:url("+i+")"}),e.after(s),e.after('<div class="owl-video-play-icon"></div>')};if(e.wrap(t("<div/>",{class:"owl-video-wrapper",style:o})),this._core.settings.lazyLoad&&(a="data-src",h="owl-lazy"),r.length)return c(r.attr(a)),r.remove(),!1;"youtube"===i.type?(n="//img.youtube.com/vi/"+i.id+"/hqdefault.jpg",c(n)):"vimeo"===i.type?t.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+i.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t[0].thumbnail_large,c(n)}}):"vzaar"===i.type&&t.ajax({type:"GET",url:"//vzaar.com/api/videos/"+i.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t.framegrab_url,c(n)}})},n.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},n.prototype.play=function(e){var i,s=t(e.target).closest("."+this._core.settings.itemClass),n=this._videos[s.attr("data-video")],o=n.width||"100%",r=n.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),s=this._core.items(this._core.relative(s.index())),this._core.reset(s.index()),(i=t('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>')).attr("height",r),i.attr("width",o),"youtube"===n.type?i.attr("src","//www.youtube.com/embed/"+n.id+"?autoplay=1&rel=0&v="+n.id):"vimeo"===n.type?i.attr("src","//player.vimeo.com/video/"+n.id+"?autoplay=1"):"vzaar"===n.type&&i.attr("src","//view.vzaar.com/"+n.id+"/player?autoplay=true"),t(i).wrap('<div class="owl-video-frame" />').insertAfter(s.find(".owl-video")),this._playing=s.addClass("owl-video-playing"))},n.prototype.isInFullScreen=function(){var e=i.fullscreenElement||i.mozFullScreenElement||i.webkitFullscreenElement;return e&&t(e).parent().hasClass("owl-video-frame")},n.prototype.destroy=function(){var t,e;for(t in this._core.$element.off("click.owl.video"),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Video=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this.core=e,this.core.options=t.extend({},n.Defaults,this.core.options),this.swapping=!0,this.previous=s,this.next=s,this.handlers={"change.owl.carousel":t.proxy((function(t){t.namespace&&"position"==t.property.name&&(this.previous=this.core.current(),this.next=t.property.value)}),this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":t.proxy((function(t){t.namespace&&(this.swapping="translated"==t.type)}),this),"translate.owl.carousel":t.proxy((function(t){t.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()}),this)},this.core.$element.on(this.handlers)};n.Defaults={animateOut:!1,animateIn:!1},n.prototype.swap=function(){if(1===this.core.settings.items&&t.support.animation&&t.support.transition){this.core.speed(0);var e,i=t.proxy(this.clear,this),s=this.core.$stage.children().eq(this.previous),n=this.core.$stage.children().eq(this.next),o=this.core.settings.animateIn,r=this.core.settings.animateOut;this.core.current()!==this.previous&&(r&&(e=this.core.coordinates(this.previous)-this.core.coordinates(this.next),s.one(t.support.animation.end,i).css({left:e+"px"}).addClass("animated owl-animated-out").addClass(r)),o&&n.one(t.support.animation.end,i).addClass("animated owl-animated-in").addClass(o))}},n.prototype.clear=function(e){t(e.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},n.prototype.destroy=function(){var t,e;for(t in this.handlers)this.core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Animate=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":t.proxy((function(t){t.namespace&&"settings"===t.property.name?this._core.settings.autoplay?this.play():this.stop():t.namespace&&"position"===t.property.name&&this._paused&&(this._time=0)}),this),"initialized.owl.carousel":t.proxy((function(t){t.namespace&&this._core.settings.autoplay&&this.play()}),this),"play.owl.autoplay":t.proxy((function(t,e,i){t.namespace&&this.play(e,i)}),this),"stop.owl.autoplay":t.proxy((function(t){t.namespace&&this.stop()}),this),"mouseover.owl.autoplay":t.proxy((function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()}),this),"mouseleave.owl.autoplay":t.proxy((function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()}),this),"touchstart.owl.core":t.proxy((function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()}),this),"touchend.owl.core":t.proxy((function(){this._core.settings.autoplayHoverPause&&this.play()}),this)},this._core.$element.on(this._handlers),this._core.options=t.extend({},n.Defaults,this._core.options)};n.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},n.prototype._next=function(s){this._call=e.setTimeout(t.proxy(this._next,this,s),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||i.hidden||this._core.next(s||this._core.settings.autoplaySpeed)},n.prototype.read=function(){return(new Date).getTime()-this._time},n.prototype.play=function(i,s){var n;this._core.is("rotating")||this._core.enter("rotating"),i=i||this._core.settings.autoplayTimeout,n=Math.min(this._time%(this._timeout||i),i),this._paused?(this._time=this.read(),this._paused=!1):e.clearTimeout(this._call),this._time+=this.read()%i-n,this._timeout=i,this._call=e.setTimeout(t.proxy(this._next,this,s),i-n)},n.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,e.clearTimeout(this._call),this._core.leave("rotating"))},n.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,e.clearTimeout(this._call))},n.prototype.destroy=function(){var t,e;for(t in this.stop(),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.autoplay=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){"use strict";var n=function(e){this._core=e,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":t.proxy((function(e){e.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+t(e.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")}),this),"added.owl.carousel":t.proxy((function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,0,this._templates.pop())}),this),"remove.owl.carousel":t.proxy((function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,1)}),this),"changed.owl.carousel":t.proxy((function(t){t.namespace&&"position"==t.property.name&&this.draw()}),this),"initialized.owl.carousel":t.proxy((function(t){t.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))}),this),"refreshed.owl.carousel":t.proxy((function(t){t.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))}),this)},this._core.options=t.extend({},n.Defaults,this._core.options),this.$element.on(this._handlers)};n.Defaults={nav:!1,navText:['<span aria-label="Previous">&#x2039;</span>','<span aria-label="Next">&#x203a;</span>'],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},n.prototype.initialize=function(){var e,i=this._core.settings;for(e in this._controls.$relative=(i.navContainer?t(i.navContainer):t("<div>").addClass(i.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=t("<"+i.navElement+">").addClass(i.navClass[0]).html(i.navText[0]).prependTo(this._controls.$relative).on("click",t.proxy((function(t){this.prev(i.navSpeed)}),this)),this._controls.$next=t("<"+i.navElement+">").addClass(i.navClass[1]).html(i.navText[1]).appendTo(this._controls.$relative).on("click",t.proxy((function(t){this.next(i.navSpeed)}),this)),i.dotsData||(this._templates=[t('<button role="button">').addClass(i.dotClass).append(t("<span>")).prop("outerHTML")]),this._controls.$absolute=(i.dotsContainer?t(i.dotsContainer):t("<div>").addClass(i.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button",t.proxy((function(e){var s=t(e.target).parent().is(this._controls.$absolute)?t(e.target).index():t(e.target).parent().index();e.preventDefault(),this.to(s,i.dotsSpeed)}),this)),this._overrides)this._core[e]=t.proxy(this[e],this)},n.prototype.destroy=function(){var t,e,i,s,n;for(t in n=this._core.settings,this._handlers)this.$element.off(t,this._handlers[t]);for(e in this._controls)"$relative"===e&&n.navContainer?this._controls[e].html(""):this._controls[e].remove();for(s in this.overides)this._core[s]=this._overrides[s];for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},n.prototype.update=function(){var t,e,i=this._core.clones().length/2,s=i+this._core.items().length,n=this._core.maximum(!0),o=this._core.settings,r=o.center||o.autoWidth||o.dotsData?1:o.dotsEach||o.items;if("page"!==o.slideBy&&(o.slideBy=Math.min(o.slideBy,o.items)),o.dots||"page"==o.slideBy)for(this._pages=[],t=i,e=0,0;t<s;t++){if(e>=r||0===e){if(this._pages.push({start:Math.min(n,t-i),end:t-i+r-1}),Math.min(n,t-i)===n)break;e=0}e+=this._core.mergers(this._core.relative(t))}},n.prototype.draw=function(){var e,i=this._core.settings,s=this._core.items().length<=i.items,n=this._core.relative(this._core.current()),o=i.loop||i.rewind;this._controls.$relative.toggleClass("disabled",!i.nav||s),i.nav&&(this._controls.$previous.toggleClass("disabled",!o&&n<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!o&&n>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!i.dots||s),i.dots&&(e=this._pages.length-this._controls.$absolute.children().length,i.dotsData&&0!==e?this._controls.$absolute.html(this._templates.join("")):e>0?this._controls.$absolute.append(new Array(e+1).join(this._templates[0])):e<0&&this._controls.$absolute.children().slice(e).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(t.inArray(this.current(),this._pages)).addClass("active"))},n.prototype.onTrigger=function(e){var i=this._core.settings;e.page={index:t.inArray(this.current(),this._pages),count:this._pages.length,size:i&&(i.center||i.autoWidth||i.dotsData?1:i.dotsEach||i.items)}},n.prototype.current=function(){var e=this._core.relative(this._core.current());return t.grep(this._pages,t.proxy((function(t,i){return t.start<=e&&t.end>=e}),this)).pop()},n.prototype.getPosition=function(e){var i,s,n=this._core.settings;return"page"==n.slideBy?(i=t.inArray(this.current(),this._pages),s=this._pages.length,e?++i:--i,i=this._pages[(i%s+s)%s].start):(i=this._core.relative(this._core.current()),s=this._core.items().length,e?i+=n.slideBy:i-=n.slideBy),i},n.prototype.next=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!0),e)},n.prototype.prev=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!1),e)},n.prototype.to=function(e,i,s){var n;!s&&this._pages.length?(n=this._pages.length,t.proxy(this._overrides.to,this._core)(this._pages[(e%n+n)%n].start,i)):t.proxy(this._overrides.to,this._core)(e,i)},t.fn.owlCarousel.Constructor.Plugins.Navigation=n}
vendor: 2,597 bytes, lines 11482-11483
11482(window.Zepto||window.jQuery,window,document),function(t,e,i,s){"use strict";var n=function(i){this._core=i,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":t.proxy((function(i){i.namespace&&"URLHash"===this._core.settings.startPosition&&t(e).trigger("hashchange.owl.navigation")}),this),"prepared.owl.carousel":t.proxy((function(e){if(e.namespace){var i=t(e.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!i)return;this._hashes[i]=e.content}}),this),"changed.owl.carousel":t.proxy((function(i){if(i.namespace&&"position"===i.property.name){var s=this._core.items(this._core.relative(this._core.current())),n=t.map(this._hashes,(function(t,e){return t===s?e:null})).join();if(!n||e.location.hash.slice(1)===n)return;e.location.hash=n}}),this)},this._core.options=t.extend({},n.Defaults,this._core.options),this.$element.on(this._handlers),t(e).on("hashchange.owl.navigation",t.proxy((function(t){var i=e.location.hash.substring(1),s=this._core.$stage.children(),n=this._hashes[i]&&s.index(this._hashes[i]);undefined!==n&&n!==this._core.current()&&this._core.to(this._core.relative(n),!1,!0)}),this))};n.Defaults={URLhashListener:!1},n.prototype.destroy=function(){var i,s;for(i in t(e).off("hashchange.owl.navigation"),this._handlers)this._core.$element.off(i,this._handlers[i]);for(s in Object.getOwnPropertyNames(this))"function"!=typeof this[s]&&(this[s]=null)},t.fn.owlCarousel.Constructor.Plugins.Hash=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=t("<support>").get(0).style,o="Webkit Moz O ms".split(" "),r={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},a=function(){return!!c("transform")},h=function(){return!!c("perspective")},l=function(){return!!c("animation")};function c(e,i){var r=!1,a=e.charAt(0).toUpperCase()+e.slice(1);return t.each((e+" "+o.join(a+" ")+a).split(" "),(function(t,e){if(n[e]!==s)return r=!i||e,!1})),r}function p(t){return c(t,!0)}(function(){return!!c("transition")})()&&(t.support.transition=new String(p("transition")),t.support.transition.end=r.transition.end[t.support.transition]),l()&&(t.support.animation=new String(p("animation")),t.support.animation.end=r.animation.end[t.support.animation]),a()&&(t.support.transform=new String(p("transform")),t.support.transform3d=h())}(window.Zepto||window.jQuery,window,document);
11483;

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.