/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ "./node_modules/accessible-menu/index.js": /*!***********************************************!*\ !*** ./node_modules/accessible-menu/index.js ***! \***********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "DisclosureMenu": () => (/* binding */ disclosureMenu), /* harmony export */ "Menubar": () => (/* binding */ menubar), /* harmony export */ "Treeview": () => (/* binding */ treeview), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _src_disclosureMenu_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/disclosureMenu.js */ "./node_modules/accessible-menu/src/disclosureMenu.js"); /* harmony import */ var _src_menubar_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./src/menubar.js */ "./node_modules/accessible-menu/src/menubar.js"); /* harmony import */ var _src_treeview_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./src/treeview.js */ "./node_modules/accessible-menu/src/treeview.js"); const disclosureMenu = _src_disclosureMenu_js__WEBPACK_IMPORTED_MODULE_0__["default"]; const menubar = _src_menubar_js__WEBPACK_IMPORTED_MODULE_1__["default"]; const treeview = _src_treeview_js__WEBPACK_IMPORTED_MODULE_2__["default"]; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ DisclosureMenu: _src_disclosureMenu_js__WEBPACK_IMPORTED_MODULE_0__["default"], Menubar: _src_menubar_js__WEBPACK_IMPORTED_MODULE_1__["default"], Treeview: _src_treeview_js__WEBPACK_IMPORTED_MODULE_2__["default"], }); /***/ }), /***/ "./node_modules/accessible-menu/src/_baseMenu.js": /*!*******************************************************!*\ !*** ./node_modules/accessible-menu/src/_baseMenu.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _baseMenuToggle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMenuToggle.js */ "./node_modules/accessible-menu/src/_baseMenuToggle.js"); /* harmony import */ var _baseMenuItem_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMenuItem.js */ "./node_modules/accessible-menu/src/_baseMenuItem.js"); /* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./validate.js */ "./node_modules/accessible-menu/src/validate.js"); /* harmony import */ var _eventHandlers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./eventHandlers.js */ "./node_modules/accessible-menu/src/eventHandlers.js"); /** * An accessible navigation element in the DOM. * * This is intended to be used as a "base" to other menus and not to be used on * it's own in the DOM. * * Use a {@link DisclosureMenu}, {@link Menubar}, or {@link Treeview} instead. */ class BaseMenu { /** * The class to use when generating submenus. * * @protected * * @type {typeof BaseMenu} */ _MenuType = BaseMenu; /** * The class to use when generating menu items. * * @protected * * @type {typeof BaseMenuItem} */ _MenuItemType = _baseMenuItem_js__WEBPACK_IMPORTED_MODULE_1__["default"]; /** * The class to use when generating submenu toggles. * * @protected * * @type {typeof BaseMenuToggle} */ _MenuToggleType = _baseMenuToggle_js__WEBPACK_IMPORTED_MODULE_0__["default"]; /** * The DOM elements within the menu. * * @protected * * @type {Object} * * @property {HTMLElement} menu - The menu element. * @property {HTMLElement[]} menuItems - An array of menu items. * @property {HTMLElement[]} submenuItems - An array of menu items that also contain submenu elements. * @property {HTMLElement[]} submenuToggles - An array of menu links that function as submenu toggles. * @property {HTMLElement[]} submenus - An array of submenu elements. * @property {HTMLElement} controller - The toggle for this menu. * @property {HTMLElement} container - The container for this menu. */ _dom = { menu: null, menuItems: [], submenuItems: [], submenuToggles: [], submenus: [], controller: null, container: null, }; /** * The CSS selectors used by the menu to populate the {@link BaseMenu#dom|dom}. * * @protected * * @type {Object} * * @property {string} menuItems - The CSS selector for menu items. * @property {string} menuLinks - The CSS selector for menu links. * @property {string} submenuItems - The CSS selector for menu items containing submenus. * @property {string} submenuToggles - The CSS selector for menu links that function as submenu toggles. * @property {string} submenus - The CSS selector for for submenus. */ _selectors = { menuItems: "", menuLinks: "", submenuItems: "", submenuToggles: "", submenus: "", }; /** * The declared accessible-menu elements within the menu. * * @protected * * @type {Object} * * @property {BaseMenuItem[]} menuItems - An array of menu items. * @property {BaseMenuToggle[]} submenuToggles - An array of menu toggles. * @property {?BaseMenuToggle} controller - A menu toggle that controls this menu. * @property {?BaseMenu} parentMenu - The parent menu. * @property {?BaseMenu} rootMenu - The root menu of the menu tree. */ _elements = { menuItems: [], submenuToggles: [], controller: null, parentMenu: null, rootMenu: null, }; /** * The class(es) to apply when the menu is open. * * @protected * * @type {string|string[]} */ _openClass = "show"; /** * The class(es) to apply when the menu is closed. * * @protected * * @type {string|string[]} */ _closeClass = "hide"; /** * A flag marking the root menu. * * @protected * * @type {boolean} */ _root = true; /** * The index of the currently selected {@link BaseMenuItem|menu item} in the menu. * * @protected * * @type {number} */ _currentChild = 0; /** * The current state of the menu's focus. * * @protected * * @type {string} */ _focusState = "none"; /** * This last event triggered on the menu. * * @protected * * @type {string} */ _currentEvent = "none"; /** * The type of hoverability for the menu. * * @protected * * @type {string} */ _hoverType = "off"; /** * The delay time (in miliseconds) used for mouseout events to take place. * * @protected * * @type {number} */ _hoverDelay = 250; /** * Constructs the menu. * * @param {object} options - The options for generating the menu. * @param {HTMLElement} options.menuElement - The menu element in the DOM. * @param {string} [options.menuItemSelector = li] - The CSS selector string for menu items. * @param {string} [options.menuLinkSelector = a] - The CSS selector string for menu links. * @param {string} [options.submenuItemSelector] - The CSS selector string for menu items containing submenus. * @param {string} [options.submenuToggleSelector = a] - The CSS selector string for submenu toggle buttons/links. * @param {string} [options.submenuSelector = ul] - The CSS selector string for submenus. * @param {?HTMLElement} [options.controllerElement = null] - The element controlling the menu in the DOM. * @param {?HTMLElement} [options.containerElement = null] - The element containing the menu in the DOM. * @param {?(string|string[])} [options.openClass = show] - The class to apply when a menu is "open". * @param {?(string|string[])} [options.closeClass = hide] - The class to apply when a menu is "closed". * @param {boolean} [options.isTopLevel = false] - A flag to mark the root menu. * @param {?BaseMenu} [options.parentMenu = null] - The parent menu to this menu. * @param {string} [options.hoverType = off] - The type of hoverability a menu has. * @param {number} [options.hoverDelay = 250] - The delay for closing menus if the menu is hoverable (in miliseconds). */ constructor({ menuElement, menuItemSelector = "li", menuLinkSelector = "a", submenuItemSelector = "", submenuToggleSelector = "a", submenuSelector = "ul", controllerElement = null, containerElement = null, openClass = "show", closeClass = "hide", isTopLevel = true, parentMenu = null, hoverType = "off", hoverDelay = 250, }) { // Set DOM elements. this._dom.menu = menuElement; this._dom.controller = controllerElement; this._dom.container = containerElement; // Set DOM selectors. this._selectors.menuItems = menuItemSelector; this._selectors.menuLinks = menuLinkSelector; this._selectors.submenuItems = submenuItemSelector; this._selectors.submenuToggles = submenuToggleSelector; this._selectors.submenus = submenuSelector; // Set menu elements. this._elements.menuItems = []; this._elements.submenuToggles = []; this._elements.controller = null; this._elements.parentMenu = parentMenu; this._elements.rootMenu = isTopLevel ? this : null; // Set open/close classes. this._openClass = openClass || ""; this._closeClass = closeClass || ""; // Set root. this._root = isTopLevel; // Set hover settings. this._hoverType = hoverType; this._hoverDelay = hoverDelay; } /** * Initializes the menu. * * The following steps will be taken to initialize the menu: * - {@link BaseMenu#validate|Validate} that the menu can initialize, * - find the root menu of the menu tree if it isn't already set, * - populate all DOM elements within the {@link BaseMenu#dom|dom}, * - if the current menu is the root menu _and_ has a controller, initialize * the controller, and * - populate the menu elements within the {@link BaseMenu#elements|elements} * * @throws {Error} Will throw an Error if validate returns `false`. */ initialize() { if (!this._validate()) { throw new Error( "AccesibleMenu: cannot initialize menu. See other error messages for more information." ); } // Get the root menu if it doesn't exist. if (this.elements.rootMenu === null) this._findRootMenu(this); // Set all of the DOM elements. this._setDOMElements(); if (this.isTopLevel) { if (this.dom.controller && this.dom.container) { // Create a new BaseMenuToggle to control the menu. const toggle = new this._MenuToggleType({ menuToggleElement: this.dom.controller, parentElement: this.dom.container, controlledMenu: this, }); this._elements.controller = toggle; } } this._createChildElements(); } /** * The DOM elements within the menu. * * @readonly * * @type {Object} * * @see _dom */ get dom() { return this._dom; } /** * The CSS selectors used by the menu to populate the {@link BaseMenu#dom|dom}. * * @readonly * * @type {Object} * * @see _selectors */ get selectors() { return this._selectors; } /** * The declared accessible-menu elements within the menu. * * @readonly * * @type {Object} * * @see _elements */ get elements() { return this._elements; } /** * The flag marking the root menu. * * @readonly * * @type {boolean} * * @see _root */ get isTopLevel() { return this._root; } /** * The class(es) to apply when the menu is open. * * This functions differently for root vs. submenus. * Submenus will always inherit their root menu's open class(es). * * @type {string|string[]} * * @see _openClass */ get openClass() { return this.isTopLevel ? this._openClass : this.elements.rootMenu.openClass; } /** * The class(es) to apply when the menu is closed. * * This functions differently for root vs. submenus. * Submenus will always inherit their root menu's close class(es). * * @type {string|string[]} * * @see _closeClass */ get closeClass() { return this.isTopLevel ? this._closeClass : this.elements.rootMenu.closeClass; } /** * The index of the currently selected {@link BaseMenuItem|menu item} in the menu. * * - Attempting to set a value less than -1 will set the current child to -1. * - Attempting to set a value greater than or equal to the number of menu items * will set the current child to the index of the last menu item in the menu. * * If the current menu has a parent menu _and_ the menu's * {@link BaseMenu#currentEvent|current event} is "mouse", The parent menu * will have it's current child updated as well to help with transitioning * between mouse and keyboard naviation. * * @type {number} * * @see _currentChild */ get currentChild() { return this._currentChild; } /** * The current state of the menu's focus. * * - If the menu has submenus, setting the focus state to "none" or "self" will * update all child menus to have the focus state of "none". * - If the menu has a parent menu, setting the focus state to "self" or "child" * will update all parent menus to have the focus state of "child". * * @type {string} * * @see _focusState */ get focusState() { return this._focusState; } /** * The last event triggered on the menu. * * @type {string} * * @see _currentEvent */ get currentEvent() { return this._currentEvent; } /** * The currently selected menu item. * * @type {BaseMenuItem} */ get currentMenuItem() { return this.elements.menuItems[this.currentChild]; } /** * The type of hoverability for the menu. * * This functions differently for root vs. submenus. * Submenus will always inherit their root menu's hoverability. * * @type {string} * * @see _hoverType */ get hoverType() { return this._root ? this._hoverType : this.elements.rootMenu.hoverType; } /** * The delay time (in miliseconds) used for mouseout events to take place. * * This functions differently for root vs. submenus. * Submenus will always inherit their root menu's hover delay. * * @type {number} * * @see _hoverDelay */ get hoverDelay() { return this._root ? this._hoverDelay : this.elements.rootMenu.hoverDelay; } /** * A flag to check if the menu's focus methods should _actually_ move the focus in the DOM. * * This will be `false` unless any of the following criteria are met: * - The menu's {@link BaseMenu#currentEvent|current event} is "keyboard". * - The menu's current event is "character". * - The menu's current event is "mouse" _and_ the menu's * {@link BaseMenu_hoverTypeType|hover type} is "dynamic". * * @type {boolean} */ get shouldFocus() { let check = false; if (this.currentEvent === "keyboard" || this.currentEvent === "character") { check = true; } if (this.currentEvent === "mouse" && this.hoverType === "dynamic") { check = true; } return check; } set openClass(value) { (0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidClassList)({ openClass: value }); if (this._openClass !== value) { this._openClass = value; } } set closeClass(value) { (0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidClassList)({ closeClass: value }); if (this._closeClass !== value) { this._closeClass = value; } } set currentChild(value) { (0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidType)("number", { value }); /** * Update the parent menu's current child to make sure clicks * and other jumps don't interfere with keyboard navigation. * * @param {BaseMenu} menu - The initial menu. */ function setParentChild(menu) { const updateEvents = ["mouse", "character"]; if ( updateEvents.includes(menu.currentEvent) && menu.elements.parentMenu ) { let index = 0; let found = false; while ( !found && index < menu.elements.parentMenu.elements.menuItems.length ) { const menuItem = menu.elements.parentMenu.elements.menuItems[index]; if ( menuItem.isSubmenuItem && menuItem.elements.toggle.elements.controlledMenu === menu ) { found = true; menu.elements.parentMenu.currentEvent = menu.currentEvent; menu.elements.parentMenu.currentChild = index; } index++; } } } if (value < -1) { this._currentChild = -1; setParentChild(this); } else if (value >= this.elements.menuItems.length) { this._currentChild = this.elements.menuItems.length - 1; setParentChild(this); } else if (this.focusChild !== value) { this._currentChild = value; setParentChild(this); } } set focusState(value) { (0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidState)({ value }); if (this._focusState !== value) { this._focusState = value; } if ( this.elements.submenuToggles.length > 0 && (value === "self" || value === "none") ) { this.elements.submenuToggles.forEach((toggle) => { toggle.elements.controlledMenu.focusState = "none"; }); } if (this.elements.parentMenu && (value === "self" || value === "child")) { this.elements.parentMenu.focusState = "child"; } } set currentEvent(value) { (0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidEvent)({ value }); if (this._currentEvent !== value) { this._currentEvent = value; if (this.elements.submenuToggles.length > 0) { this.elements.submenuToggles.forEach((submenuToggle) => { submenuToggle.elements.controlledMenu.currentEvent = value; }); } } } set hoverType(value) { (0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidHoverType)({ value }); if (this._hoverType !== value) { this._hoverType = value; } } set hoverDelay(value) { (0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidType)("number", { value }); if (this._hoverDelay !== value) { this._hoverDelay = value; } } /** * Validates all aspects of the menu to ensure proper functionality. * * @protected * * @return {boolean} - The result of the validation. */ _validate() { let check = true; if (this._dom.container !== null || this._dom.controller !== null) { if ( !(0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidInstance)(HTMLElement, { menuElement: this._dom.menu, controllerElement: this._dom.controller, containerElement: this._dom.container, }) ) { check = false; } } else if ( !(0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidInstance)(HTMLElement, { menuElement: this._dom.menu, }) ) { check = false; } if (this._selectors.submenuItems !== "") { if ( !(0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isCSSSelector)({ menuItemSelector: this._selectors.menuItems, menuLinkSelector: this._selectors.menuLinks, submenuItemSelector: this._selectors.submenuItems, submenuToggleSelector: this._selectors.submenuToggles, submenuSelector: this._selectors.submenus, }) ) { check = false; } } else if ( !(0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isCSSSelector)({ menuItemSelector: this._selectors.menuItems, menuLinkSelector: this._selectors.menuLinks, }) ) { check = false; } if ( this._openClass !== "" && !(0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidClassList)({ openClass: this._openClass }) ) { check = false; } if ( this._closeClass !== "" && !(0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidClassList)({ closeClass: this._closeClass }) ) { check = false; } if (!(0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidType)("boolean", { isTopLevel: this._root })) { check = false; } if ( this._elements.parentMenu !== null && !(0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidInstance)(BaseMenu, { parentMenu: this._elements.parentMenu }) ) { check = false; } if (!(0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidHoverType)({ hoverType: this._hoverType })) { check = false; } if (!(0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidType)("number", { hoverDelay: this._hoverDelay })) { check = false; } return check; } /** * Sets DOM elements within the menu. * * Elements that are not stored inside an array cannot be set through this method. * * @protected * * @param {string} elementType - The type of element to populate. * @param {HTMLElement} [base = this.dom.menu] - The element used as the base for the querySelect. * @param {boolean} [overwrite = true] - A flag to set if the existing elements will be overwritten. */ _setDOMElementType(elementType, base = this.dom.menu, overwrite = true) { if (typeof this.selectors[elementType] === "string") { if (!Array.isArray(this.dom[elementType])) { throw new Error( `AccessibleMenu: The "${elementType}" element cannot be set through _setDOMElementType.` ); } if (base !== this.dom.menu) (0,_validate_js__WEBPACK_IMPORTED_MODULE_2__.isValidInstance)(HTMLElement, { base }); // Get the all elements matching the selector in the base. const domElements = Array.from( base.querySelectorAll(this.selectors[elementType]) ); // Filter the elements so only direct children of the base are kept. const filteredElements = domElements.filter( (item) => item.parentElement === base ); if (overwrite) { this._dom[elementType] = filteredElements; } else { this._dom[elementType] = [ ...this._dom[elementType], ...filteredElements, ]; } } else { throw new Error( `AccessibleMenu: "${elementType}" is not a valid element type within the menu.` ); } } /** * Resets DOM elements within the menu. * * Elements that are not stored inside an array cannot be reset through this method. * * @protected * * @param {string} elementType - The type of element to clear. */ _resetDOMElementType(elementType) { if (typeof this.dom[elementType] !== "undefined") { if (!Array.isArray(this.dom[elementType])) { throw new Error( `AccessibleMenu: The "${elementType}" element cannot be reset through _resetDOMElementType.` ); } this._dom[elementType] = []; } else { throw new Error( `AccessibleMenu: "${elementType}" is not a valid element type within the menu.` ); } } /** * Sets all DOM elements within the menu. * * Utiliizes {@link BaseMenu#_setDOMElementType|_setDOMElementType} and * {@link BaseMenu#_resetDOMElementType|_resetDOMElementType}. * * @protected */ _setDOMElements() { this._setDOMElementType("menuItems"); if (this.selectors.submenuItems !== "") { this._setDOMElementType("submenuItems"); this._resetDOMElementType("submenuToggles"); this._resetDOMElementType("submenus"); this.dom.submenuItems.forEach((item) => { this._setDOMElementType("submenuToggles", item, false); this._setDOMElementType("submenus", item, false); }); } } /** * Finds the root menu element. * * @protected * * @param {BaseMenu} menu - The menu to check. */ _findRootMenu(menu) { if (menu.isTopLevel) { this._elements.rootMenu = menu; } else if (menu.elements.parentMenu !== null) { this._findRootMenu(menu.elements.parentMenu); } else { throw new Error("Cannot find root menu."); } } /** * Creates and initializes all menu items and submenus. * * @protected */ _createChildElements() { this.dom.menuItems.forEach((element) => { let menuItem; if (this.dom.submenuItems.includes(element)) { // The menu's toggle controller DOM element. const toggler = element.querySelector(this.selectors.submenuToggles); // The actual menu DOM element. const submenu = element.querySelector(this.selectors.submenus); // Create the new menu and initialize it. const menu = new this._MenuType({ menuElement: submenu, menuItemSelector: this.selectors.menuItems, menuLinkSelector: this.selectors.menuLinks, submenuItemSelector: this.selectors.submenuItems, submenuToggleSelector: this.selectors.submenuToggles, submenuSelector: this.selectors.submenus, openClass: this.openClass, closeClass: this.closeClass, isTopLevel: false, parentMenu: this, hoverType: this.hoverType, hoverDelay: this.hoverDelay, }); // Create the new menu toggle. const toggle = new this._MenuToggleType({ menuToggleElement: toggler, parentElement: element, controlledMenu: menu, parentMenu: this, }); // Add the toggle to the list of toggles. this._elements.submenuToggles.push(toggle); // Create a new menu item. menuItem = new this._MenuItemType({ menuItemElement: element, menuLinkElement: toggler, parentMenu: this, isSubmenuItem: true, childMenu: menu, toggle, }); } else { const link = element.querySelector(this.selectors.menuLinks); // Create a new menu item. menuItem = new this._MenuItemType({ menuItemElement: element, menuLinkElement: link, parentMenu: this, }); } this._elements.menuItems.push(menuItem); }); } /** * Handles focus events throughout the menu for proper menu use. * * - Adds a `focus` listener to every menu item so when it gains focus, * it will set the item's containing menu's {@link BaseMenu#focusState|focus state} * to "self". * * @protected */ _handleFocus() { this.elements.menuItems.forEach((menuItem, index) => { menuItem.dom.link.addEventListener("focus", () => { this.focusState = "self"; this.currentChild = index; }); }); } /** * Handles click events throughout the menu for proper use. * * - Adds a `pointerdown` listener to every menu item that will blur * all menu items in the entire menu structure (starting at the root menu) and * then properly focus the clicked item. * - Adds a `pointerup` listener to every submenu item that will properly * toggle the submenu open/closed. * - Adds a `pointerup` listener to the menu's controller * (if the menu is the root menu) so when it is clicked it will properly * toggle open/closed. * * @protected */ _handleClick() { /** * Toggles a toggle element. * * @param {BaseMenu} menu - This menu. * @param {BaseMenuToggle} toggle - The menu toggle * @param {Event} event - A Javascript event. */ function toggleToggle(menu, toggle, event) { (0,_eventHandlers_js__WEBPACK_IMPORTED_MODULE_3__.preventEvent)(event); toggle.toggle(); if (toggle.isOpen) { menu.focusState = "self"; toggle.elements.controlledMenu.focusState = "none"; } } this.elements.menuItems.forEach((item, index) => { // Properly focus the current menu item. item.dom.link.addEventListener( "pointerdown", () => { this.currentEvent = "mouse"; this.elements.rootMenu.blurChildren(); this.focusChild(index); }, { passive: true } ); // Properly toggle submenus open and closed. if (item.isSubmenuItem) { item.elements.toggle.dom.toggle.addEventListener( "pointerup", (event) => { this.currentEvent = "mouse"; toggleToggle(this, item.elements.toggle, event); } ); } }); // Open the this menu if it's controller is clicked. if (this.isTopLevel && this.elements.controller) { this.elements.controller.dom.toggle.addEventListener( "pointerup", (event) => { this.currentEvent = "mouse"; toggleToggle(this, this.elements.controller, event); } ); } } /** * Handles hover events throughout the menu for proper use. * * Adds `pointerenter` listeners to all menu items and `pointerleave` listeners * to all submenu items which function differently depending on * the menu's {@link BaseMenu_hoverTypeType|hover type}. * * Before executing anything, the event is checked to make sure the event wasn't * triggered by a pen or touch. * * Hover Type "on" * - When a `pointerenter` event triggers on any menu item the menu's * {@link BaseMenu#currentChild| current child} value will change to that * menu item. * - When a `pointerenter` event triggers on a submenu item the * {@link BaseMenuToggle#preview|preview method} for the submenu item's * toggle will be called. * - When a `pointerleave` event triggers on an open submenu item the * {@link BaseMenuToggle#close|close method} for the submenu item's toggle * will be called after a delay set by the menu's {@link BaseMenu_hoverTypeDelay|hover delay}. * * Hover Type "dynamic" * - When a `pointerenter` event triggers on any menu item the menu's * current child value will change to that menu item. * - When a `pointerenter` event triggers on any menu item, and the menu's * {@link BaseMenu#focusState|focus state} is not "none", the menu item * will be focused. * - When a `pointerenter` event triggers on a submenu item, and a submenu is * already open, the preview method for the submenu item's toggle will be called. * - When a `pointerenter` event triggers on a submenu item, and no submenu is * open, no submenu-specific methods will be called. * - When a `pointerleave` event triggers on an open submenu item that is not a * root-level submenu item the close method for the submenu item's toggle * will be called and the submenu item will be focused after a delay set by * the menu's hover delay. * - When a `pointerleave` event triggers on an open submenu item that is a * root-level submenu item no submenu-specific methods will be called. * * Hover Type "off" * All `pointerenter` and `pointerleave` events are ignored. * * @protected */ _handleHover() { this.elements.menuItems.forEach((menuItem, index) => { menuItem.dom.link.addEventListener("pointerenter", (event) => { // Exit out of the event if it was not made by a mouse. if (event.pointerType === "pen" || event.pointerType === "touch") { return; } if (this.hoverType === "on") { this.currentEvent = "mouse"; this.currentChild = index; if (menuItem.isSubmenuItem) { menuItem.elements.toggle.preview(); } } else if (this.hoverType === "dynamic") { const isOpen = this.elements.submenuToggles.some( (toggle) => toggle.isOpen ); this.currentChild = index; if (!this.isTopLevel || this.focusState !== "none") { this.currentEvent = "mouse"; this.focusCurrentChild(); } if (menuItem.isSubmenuItem && (!this.isTopLevel || isOpen)) { this.currentEvent = "mouse"; menuItem.elements.toggle.preview(); } } }); if (menuItem.isSubmenuItem) { menuItem.dom.item.addEventListener("pointerleave", (event) => { // Exit out of the event if it was not made by a mouse. if (event.pointerType === "pen" || event.pointerType === "touch") { return; } if (this.hoverType === "on") { if (this.hoverDelay > 0) { setTimeout(() => { this.currentEvent = "mouse"; menuItem.elements.toggle.close(); }, this.hoverDelay); } else { this.currentEvent = "mouse"; menuItem.elements.toggle.close(); } } else if (this.hoverType === "dynamic") { if (!this.isTopLevel) { if (this.hoverDelay > 0) { setTimeout(() => { this.currentEvent = "mouse"; menuItem.elements.toggle.close(); this.focusCurrentChild(); }, this.hoverDelay); } else { this.currentEvent = "mouse"; menuItem.elements.toggle.close(); this.focusCurrentChild(); } } } }); } }); } /** * Handles keydown events throughout the menu for proper menu use. * * This method exists to assit the {@link BaseMenu#_handleKeyup|_handleKeyup method}. * * - Adds a `keydown` listener to the menu's controller (if the menu is the root menu). * - Blocks propagation on "Space", "Enter", and "Escape" keys. * * @protected */ _handleKeydown() { if (this.isTopLevel && this.elements.controller) { this.elements.controller.dom.toggle.addEventListener( "keydown", (event) => { this.currentEvent = "keyboard"; const key = (0,_eventHandlers_js__WEBPACK_IMPORTED_MODULE_3__.keyPress)(event); if (key === "Space" || key === "Enter") { (0,_eventHandlers_js__WEBPACK_IMPORTED_MODULE_3__.preventEvent)(event); } } ); } } /** * Handles keyup events throughout the menu for proper menu use. * * - Adds a `keyup` listener to the menu's controller (if the menu is the root menu). * - Opens the menu when the user hits "Space" or "Enter". * * @protected */ _handleKeyup() { if (this.isTopLevel && this.elements.controller) { this.elements.controller.dom.toggle.addEventListener("keyup", (event) => { this.currentEvent = "keyboard"; const key = (0,_eventHandlers_js__WEBPACK_IMPORTED_MODULE_3__.keyPress)(event); if (key === "Space" || key === "Enter") { (0,_eventHandlers_js__WEBPACK_IMPORTED_MODULE_3__.preventEvent)(event); this.elements.controller.open(); this.focusFirstChild(); } }); } } /** * Focus the menu. * * Sets the menu's {@link BaseMenu#focusState|focus state} to "self" and * focusses the menu if the menu's {@link BaseMenu#shouldFocus|shouldFocus} * value is `true`. */ focus() { this.focusState = "self"; if (this.shouldFocus) { this.dom.menu.focus(); } } /** * Unfocus the menu. * * Sets the menu's {@link BaseMenu#focusState|focus state} to "none" * and blurs the menu if the menu's {@link BaseMenu#shouldFocus|shouldFocus} * vallue is `true`. */ blur() { this.focusState = "none"; if (this.shouldFocus) { this.dom.menu.blur(); } } /** * Focus the menu's current child. */ focusCurrentChild() { this.focusState = "self"; if (this.currentChild !== -1) { this.currentMenuItem.focus(); } } /** * Focuses the menu's child at a given index. * * @param {number} index - The index of the child to focus. */ focusChild(index) { this.blurCurrentChild(); this.currentChild = index; this.focusCurrentChild(); } /** * Focues the menu's first child. */ focusFirstChild() { this.focusChild(0); } /** * Focus the menu's last child. */ focusLastChild() { this.focusChild(this.elements.menuItems.length - 1); } /** * Focus the menu's next child. */ focusNextChild() { if (this.currentChild < this.elements.menuItems.length - 1) { this.focusChild(this.currentChild + 1); } else { this.focusCurrentChild(); } } /** * Focus the menu's previous child. */ focusPreviousChild() { if (this.currentChild > 0) { this.focusChild(this.currentChild - 1); } else { this.focusCurrentChild(); } } /** * Blurs the menu's current child. */ blurCurrentChild() { this.focusState = "none"; if (this.currentChild !== -1) { this.currentMenuItem.blur(); } } /** * Focus the menu's controller. */ focusController() { if (this.dom.controller) { if (this.shouldFocus) { this.dom.controller.focus(); } this.focusState = "none"; } } /** * Focus the menu's container. */ focusContainer() { if (this.dom.container) { if (this.shouldFocus) { this.dom.container.focus(); } this.focusState = "none"; } } /** * Close all submenu children. */ closeChildren() { this.elements.submenuToggles.forEach((toggle) => toggle.close()); } /** * Blurs all children and submenu's children. */ blurChildren() { this.elements.menuItems.forEach((menuItem) => { menuItem.blur(); if (menuItem.isSubmenuItem) { menuItem.elements.childMenu.blurChildren(); } }); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseMenu); /***/ }), /***/ "./node_modules/accessible-menu/src/_baseMenuItem.js": /*!***********************************************************!*\ !*** ./node_modules/accessible-menu/src/_baseMenuItem.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* eslint-disable jsdoc/no-undefined-types */ /** * A basic navigation link contained inside of a {@link BaseMenu}. */ class BaseMenuItem { /** * The DOM elements within the menu item. * * @type {Object} * * @protected * * @property {HTMLElement} item - The menu item. * @property {HTMLElement} link - The menu item's link. */ _dom = { item: null, link: null, }; /** * The declared accessible-menu elements within the menu item. * * @type {Object} * * @protected * * @property {BaseMenu} parentMenu - The menu containing this menu item. * @property {?BaseMenu} childMenu - The menu contained within this menu item. * @property {?BaseMenuToggle} toggle - The menu toggle within this menu item that controls the `childMenu`. */ _elements = { parentMenu: null, childMenu: null, toggle: null, }; /** * A flag marking a submenu item. * * @type {boolean} */ _submenu = false; /** * Constructs the menu item. * * @param {object} options - The options for generating the menu item. * @param {HTMLElement} options.menuItemElement - The menu item in the DOM. * @param {HTMLElement} options.menuLinkElement - The menu item's link in the DOM. * @param {BaseMenu} options.parentMenu - The parent menu. * @param {boolean} [options.isSubmenuItem = false] - A flag to mark if the menu item is controlling a submenu. * @param {?BaseMenu} [options.childMenu = null] - The child menu. * @param {?BaseMenuToggle} [options.toggle = null] - The controller for the child menu. */ constructor({ menuItemElement, menuLinkElement, parentMenu, isSubmenuItem = false, childMenu = null, toggle = null, }) { // Set DOM elements. this._dom.item = menuItemElement; this._dom.link = menuLinkElement; // Set menu elements. this._elements.parentMenu = parentMenu; this._elements.childMenu = childMenu; this._elements.toggle = toggle; this._submenu = isSubmenuItem; } /** * Initialize the menu item. */ initialize() {} /** * The DOM elements within the menu item. * * @type {Object} * * @readonly * * @see _dom */ get dom() { return this._dom; } /** * The declared accessible-menu elements within the menu item. * * @type {Object} * * @readonly * * @see _elements */ get elements() { return this._elements; } /** * A flag marking a submenu item. * * @type {boolean} * * @readonly * * @see _submenu */ get isSubmenuItem() { return this._submenu; } /** * Focuses the menu item's link if the parent menu's * {@link BaseMenu#shouldFocus|shouldFocus} value is `true`. */ focus() { if (this.elements.parentMenu.shouldFocus) { this.dom.link.focus(); } } /** * Blurs the menu item's link if the parent menu's * {@link BaseMenu#shouldFocus|shouldFocus} value is `true`. */ blur() { if (this.elements.parentMenu.shouldFocus) { this.dom.link.blur(); } } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseMenuItem); /***/ }), /***/ "./node_modules/accessible-menu/src/_baseMenuToggle.js": /*!*************************************************************!*\ !*** ./node_modules/accessible-menu/src/_baseMenuToggle.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validate.js */ "./node_modules/accessible-menu/src/validate.js"); /* eslint-disable jsdoc/no-undefined-types */ /** * A link or button that controls the visibility of a {@link BaseMenu}. */ class BaseMenuToggle { /** * The DOM elements within the menu toggle. * * @protected * * @type {Object} * * @property {HTMLElement} toggle - The menu toggle. * @property {HTMLElement} parent - The menu containing this toggle. */ _dom = { toggle: null, parent: null, }; /** * The declared accessible-menu elements within the menu toggle. * * @protected * * @type {Object} * * @property {BaseMenu} controlledMenu - The menu controlled by this toggle. * @property {BaseMenu} parentMenu - The menu containing this toggle. */ _elements = { controlledMenu: null, parentMenu: null, }; /** * The open state of the menu toggle. * * @protected * * @type {boolean} */ _open = false; /** * Expand event. * * @protected * * @event accessibleMenuExpand * * @type {CustomEvent} * * @property {Object} details - The details object containing the BaseMenuToggle itself. */ _expandEvent = new CustomEvent("accessibleMenuExpand", { bubbles: true, detail: { toggle: this }, }); /** * Collapse event. * * @protected * * @event accessibleMenuCollapse * * @type {CustomEvent} * * @property {Object} details - The details object containing the BaseMenuToggle itself. */ _collapseEvent = new CustomEvent("accessibleMenuCollapse", { bubbles: true, detail: { toggle: this }, }); /** * Constructs the menu toggle. * * @param {object} options - The options for generating the menu toggle. * @param {HTMLElement} options.menuToggleElement - The toggle element in the DOM. * @param {HTMLElement} options.parentElement - The element containing the controlled menu. * @param {BaseMenu} options.controlledMenu - The menu controlled by this toggle. * @param {BaseMenu|null} [options.parentMenu = null] - The menu containing this toggle. */ constructor({ menuToggleElement, parentElement, controlledMenu, parentMenu = null, }) { // Set DOM elements. this._dom.toggle = menuToggleElement; this._dom.parent = parentElement; // Set menu elements. this._elements.controlledMenu = controlledMenu; this._elements.parentMenu = parentMenu; } /** * Initializes the menu toggle. * * Initialize does a lot of setup on the menu toggle. * * The most basic setup steps are to ensure that the toggle has `aria-haspopup` * set to "true", `aria-expanded` initially set to "false" and, if the toggle * element is not a `",a=gform.applyFilters("gform_file_upload_markup",a,t,e,_,p,r),m("#"+t.id).html(a),m("#"+t.id+" span.gfield_fileupload_progressbar_progress").css("width",t.percent+"%"),100==t.percent&&(r.status&&"ok"==r.status?(n=i,o=r.data,(a=c(n)).unshift(o),i=n,r=a,o=s(),n=m("#gform_uploaded_files_"+d),o[i=u(i)]=r,n.val(m.toJSON(o))):f(e.settings.gf_vars.message_id,_.unknown_error+": "+t.name))))}),t.bind("FilesRemoved",function(e,t){l(e.settings)}),m("#"+e.drop_element).on({dragenter:n,dragover:n})}function h(e){return m("
").text(e).html()}})(window.gfMultiFileUploader=window.gfMultiFileUploader||{},jQuery);let gformIsSpinnerInitialized=!1;function gformInitSpinner(e,t,r=0){gformIsSpinnerInitialized||(gformIsSpinnerInitialized=!0,window.gform.utils.addFilter("gform/submission/pre_submission",e=>(gformShowSpinner(e.form.dataset.formid,t),e),3),document.addEventListener("gform/submission/submission_aborted",function(e){gformRemoveSpinner(),jQuery("#gform_ajax_spinner_"+e.detail.form.dataset.formid).remove()}))}function gformShowSpinner(e,t){t=gform.applyFilters("gform_spinner_url",t,e);t!==gform.applyFilters("gform_spinner_url",gf_global.spinnerUrl,e)?gformAddSpinner(e,t):gformInitializeSpinner(e,gform.applyFilters("gform_spinner_target_elem",jQuery("#gform_submit_button_"+e+", #gform_wrapper_"+e+" .gform_next_button, #gform_send_resume_link_button_"+e),e))}function gformInitializeSpinner(e,t,r="gform-ajax-spinner"){0==jQuery("#gform_ajax_spinner_"+e).length&&(r='',(t instanceof jQuery?t:jQuery(t)).after(r))}function gformRemoveSpinner(e="gform-ajax-spinner"){e=document.querySelectorAll('[data-js-spinner-id="'+e+'"]');e&&e.forEach(function(e){e.remove()})}function gformAddSpinner(e,t){void 0!==t&&t||(t=gform.applyFilters("gform_spinner_url",gf_global.spinnerUrl,e)),0==jQuery("#gform_ajax_spinner_"+e).length&&gform.applyFilters("gform_spinner_target_elem",jQuery("#gform_submit_button_"+e+", #gform_wrapper_"+e+" .gform_next_button, #gform_send_resume_link_button_"+e),e).after('')}function gformReInitTinymceInstance(e,t){var r,i,n;e&&t?(r=window.tinymce)?(i=r.get("input_"+e+"_"+t))?(n=jQuery.extend({},i.settings),i.remove(),r.init(n),gform.console.log("gformReInitTinymceInstance reinitialized TinyMCE on input_"+e+"_"+t+".")):gform.console.error("gformReInitTinymceInstance did not find an instance for input_"+e+"_"+t+"."):gform.console.error("gformReInitTinymceInstance requires tinymce to be available."):gform.console.error("gformReInitTinymceInstance requires a form and field id.")}function gf_raw_input_change(e,t){clearTimeout(__gf_keyup_timeout);var r=jQuery(t),i=r.attr("id"),n=gf_get_input_id_by_html_id(i),o=gf_get_form_id_by_html_id(i),i=gform.applyFilters("gform_field_meta_raw_input_change",{fieldId:n,formId:o},r,e),n=i.fieldId,o=i.formId;n&&(r=!(i=r.is(":checkbox")||r.is(":radio")||r.is("select"))||r.is("textarea"),"keyup"==e.type&&!r||"change"==e.type&&!i&&!r||("keyup"==e.type?__gf_keyup_timeout=setTimeout(function(){gf_input_change(t,o,n)},300):gf_input_change(t,o,n)))}function gf_get_input_id_by_html_id(e){var e=gf_get_ids_by_html_id(e),t=e[e.length-1];return 3==e.length&&(e.shift(),t=e.join(".")),t}function gf_get_form_id_by_html_id(e){return gf_get_ids_by_html_id(e)[0]}function gf_get_ids_by_html_id(e){for(var t=e?e.split("_"):[],r=t.length-1;0<=r;r--)gform.utils.isNumber(t[r])||t.splice(r,1);return t}function gf_input_change(e,t,r){gform.doAction("gform_input_change",e,t,r)}function gformExtractFieldId(e){var t=parseInt(e.toString().split(".")[0],10);return t||e}function gformExtractInputIndex(e){e=parseInt(e.toString().split(".")[1],10);return e||!1}jQuery(document).on("change keyup",".gfield input, .gfield select, .gfield textarea",function(e){gf_raw_input_change(e,this)});{function rgars(e,t){for(var r=t.split("/"),i=e,n=0;n li",function(){jQuery(this).find(".gform-form-toolbar__submenu").toggleClass("open"),jQuery(this).find(".has_submenu").toggleClass("submenu-open")}),jQuery("#gform-form-toolbar__menu").on("mouseleave blur","> li",function(){jQuery(".gform-form-toolbar__submenu.open").removeClass("open"),jQuery(".has_submenu.submenu-open").removeClass("submenu-open")}),jQuery("#gform-form-toolbar__menu .has_submenu").on("click",function(e){e.preventDefault()})}),jQuery(document).ready(function(){jQuery(".gform-settings-field").each(function(){1 .gform-settings-input__container").length&&jQuery(this).addClass("gform-settings-field--multiple-inputs")})}),jQuery(function(){gform.tools.trigger("gform_main_scripts_loaded")});; !function(){var t={192:function(t,e,n){var r=n(541)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},541:function(t,e,n){var r=n(998).default;function o(){"use strict";t.exports=o=function(){return n},t.exports.__esModule=!0,t.exports.default=t.exports;var e,n={},i=Object.prototype,a=i.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(e){d=function(t,e,n){return t[e]=n}}function p(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),a=new C(r||[]);return c(i,"_invoke",{value:T(t,n,a)}),i}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var v="suspendedStart",g="suspendedYield",m="executing",y="completed",w={};function b(){}function x(){}function O(){}var S={};d(S,l,(function(){return this}));var A=Object.getPrototypeOf,j=A&&A(A(P([])));j&&j!==i&&a.call(j,l)&&(S=j);var E=O.prototype=b.prototype=Object.create(S);function k(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function n(o,i,c,u){var l=h(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==r(f)&&a.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):e.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return n("throw",t,c,u)}))}u(l.arg)}var o;c(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}})}function T(t,n,r){var o=v;return function(i,a){if(o===m)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=z(c,r);if(u){if(u===w)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===v)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var l=h(t,n,r);if("normal"===l.type){if(o=r.done?y:g,l.arg===w)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function z(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,z(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),w;var i=h(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,w):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function P(t){if(t||""===t){var n=t[l];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),l=a.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),w}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),w}},n}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},998:function(t){function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){"use strict";var t={};n.r(t),n.d(t,{run:function(){return Ht},runGroup:function(){return qt}});var e={};n.r(e),n.d(e,{getScroller:function(){return re},lock:function(){return oe},unlock:function(){return ie}});var r={};n.r(r),n.d(r,{reInitChildren:function(){return Te}});var o={};n.r(o),n.d(o,{down:function(){return Me},up:function(){return Re}});var i={};n.r(i),n.d(i,{elVisibleHeight:function(){return Ue},elements:function(){return Ze},height:function(){return qe},width:function(){return He}});var a={};n.r(a),n.d(a,{clear:function(){return hn},get:function(){return dn},put:function(){return fn},remove:function(){return pn}});var c={};n.r(c),n.d(c,{clear:function(){return yn},get:function(){return gn},put:function(){return vn},remove:function(){return mn}});var u={};n.r(u),n.d(u,{get:function(){return wn},remove:function(){return xn},set:function(){return bn}});var l={};function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0&&void 0!==arguments[0]?arguments[0]:[],e=[],n=t.length;n--;e.unshift(t[n]));return e}function p(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function h(){return d((arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter((function(t){return p(t)}))}function v(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){};if(n&&e){if(27===t.keyCode)return e.focus(),void r();if(9===t.keyCode){var o=h(n),i=o[0],a=o[o.length-1];t.shiftKey?document.activeElement===i&&(a.focus(),t.preventDefault()):document.activeElement===a&&(i.focus(),t.preventDefault())}}}function g(t,e){Object.keys(e).forEach((function(n){return t.setAttribute(n,e[n])}))}n.r(l),n.d(l,{addAsyncFilter:function(){return en},addFilter:function(){return nn},animate:function(){return t},applyBrowserClasses:function(){return ee},arrayEquals:function(){return T},arrayToInt:function(){return z},aspectRatioToPadding:function(){return L},bodyLock:function(){return e},browsers:function(){return te},checkNotificationPromise:function(){return sn},clipboard:function(){return ae},cloneDeep:function(){return R},consoleError:function(){return j},consoleInfo:function(){return E},consoleLog:function(){return k},consoleWarn:function(){return _},convertElements:function(){return d},cookieStorage:function(){return u},debounce:function(){return Ve},deepMerge:function(){return B},delay:function(){return X},delegate:function(){return Ge},dragHorizontal:function(){return ue},escapeHtml:function(){return K},escapeScripts:function(){return Q},filter:function(){return tn},filterObject:function(){return G},findNestedObject:function(){return Y},fnvHash:function(){return nt},focusLoop:function(){return v},getAttachmentImageUrl:function(){return tt},getChildren:function(){return le},getClosest:function(){return se},getConfig:function(){return et},getCoords:function(){return fe},getFocusable:function(){return h},getHiddenHeight:function(){return de},getNode:function(){return he},getNodes:function(){return pe},hasClassFromArray:function(){return ve},hasScrollbar:function(){return ge},insertAfter:function(){return me},insertBefore:function(){return ye},isEmptyObject:function(){return rt},isEqual:function(){return it},isExternalLink:function(){return we},isFileLink:function(){return be},isFormDirty:function(){return xe},isFunction:function(){return D},isImageLink:function(){return Oe},isJestTest:function(){return A},isJson:function(){return at},isNumber:function(){return ct},isObject:function(){return ut},isRtl:function(){return Se},localStorage:function(){return a},matchesOrContainedInSelectors:function(){return Ae},mimicFn:function(){return Ot},normalizeUrl:function(){return St},objectAssign:function(){return At},objectToAttributes:function(){return Pt},objectToFormData:function(){return jt},openNewTab:function(){return je},parseSocial:function(){return zt},parseUrl:function(){return Lt},popup:function(){return Ee},queryToJson:function(){return $t},ready:function(){return on},removeClassThatContains:function(){return ke},removeFilter:function(){return rn},resize:function(){return an},runOnce:function(){return ln},saferHtml:function(){return It},sessionStorage:function(){return c},setAttributes:function(){return g},shouldLoadChunk:function(){return _e},simpleBar:function(){return r},slide:function(){return o},slugify:function(){return Ct},spacerClasses:function(){return De},speak:function(){return S},sprintf:function(){return Rt},trigger:function(){return ce},uniqueId:function(){return Dt},updateQueryVar:function(){return Zt},viewport:function(){return i},visible:function(){return p},vsprintf:function(){return Ft}});var m={containers:[]},y={previousMessage:""},w=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polite",e=document.createElement("div");g(e,{"aria-live":t,"aria-relevant":"additions text","aria-atomic":"true",style:"position: absolute; margin: -1px; padding: 0; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); -webkit-clip-path: inset(50%); clip-path: inset(50%); border: 0; word-wrap: normal !important;"}),document.body.appendChild(e),m.containers.push(e)},b=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/<[^<>]+>/g," ");return y.previousMessage===t&&(t+=" "),y.previousMessage=t,t},x=function(){return m.containers.forEach((function(t){return t.textContent=""}))},O=function(){m.containers.length||(w("assertive"),w("polite"))};function S(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"polite";O(),x();var n=m.containers.filter((function(t){return t.getAttribute("aria-live")===e}))[0];n&&(n.textContent=b(t))}function A(){return!!window.__TEST__}function j(){window.console&&A()}function E(){}function k(){}function _(){window.console&&A()}function T(t,e){return Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((function(t,n){return t===e[n]}))}var z=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(t){return parseInt(t,10)}))};function L(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(":");return parseFloat((t[1]/t[0]*100).toFixed(5))}function I(t){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(t)}function C(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return P(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if(null===t||"object"!==I(t))return t;if(e.has(t))return e.get(t);if(t instanceof Date)return new Date(t);if(Array.isArray(t)){var n=[];e.set(t,n);for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};n.arrayMerge=function(t){var e=H;return"combine"===t.arrayMerge?e=q:D(t.arrayMerge)&&(e=t.arrayMerge),e}(n),n.isMergeableObject=n.isMergeableObject||$,n.cloneUnlessOtherwiseSpecified=Z;var r=Array.isArray(e);return r===Array.isArray(t)?r?n.arrayMerge(t,e,n):W(t,e,n):Z(e,n)}J.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,n){return J(t,n,e)}),{})};var B=J,G=function(t,e){var n=Object.entries(t).filter(e);return Object.fromEntries(n)};function Y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=function(t){if("object"===I(t))for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){if(o===e&&t[o]===n)return t;var i=r(t[o]);if(i)return i}return null};return r(t)}function X(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,o=[];function i(t,n){e=window.setTimeout((function(){if(e=null,t(),o.length){var n=o.shift();i(n.fn,n.t)}}),n)}return t={delay:function(n,r){return o.length||e?o.push({fn:n,t:r}):i(n,r),t},cancel:function(){return window.clearTimeout(e),o=[],t}},t.delay(n,r)}function K(){return String(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Q(){return String(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/)<[^<]*)*<\/script>/gi,"")}var tt=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"full";if(!t||"object"!==I(t))return"";var r=e||n;return t.sizes&&t.sizes[r]&&t.sizes[r].url?t.sizes[r].url:r!==n&&t.sizes&&t.sizes[n]&&t.sizes[n].url?t.sizes[n].url:t.url||""};function et(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e&&t[e]?t[e]:t}var nt=function(t){for(var e=String(t),n=14695981039346656037n,r=0;r=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n2&&void 0!==arguments[2]?arguments[2]:{}).ignoreNonConfigurable,o=void 0!==r&&r,i=t.name,a=ft(Reflect.ownKeys(e));try{for(a.s();!(n=a.n()).done;){var c=n.value;vt(t,e,c,o)}}catch(t){a.e(t)}finally{a.f()}return mt(t,e),xt(t,e,i),t}function St(t){if(!t)return"";var e=t.trim();return""===e?"":/^https?:\/\//i.test(e)?e:e.startsWith("//")?"https:".concat(e):"https://".concat(e)}function At(){for(var t={},e=0;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={url:"",identifier:"",platform:"",valid:!1};if(!t||"string"!=typeof t)return n;var r=t.trim();if(!r)return n;var o,i=e?e.toLowerCase():"",a=Et(Tt);try{for(a.s();!(o=a.n()).done;){var c,u=o.value,l=_t[u],s=Et(l.urlRegexes);try{for(s.s();!(c=s.n()).done;){var f=c.value,d=r.match(f);if(d&&d[1]){var p=d[1];return n.identifier=l.normalizeIdentifier(p),l.finalizeIdentifier&&(n.identifier=l.finalizeIdentifier(n.identifier,!1)),n.url=l.urlTemplate(n.identifier,r),n.platform=u,n.valid=!0,n}}}catch(t){s.e(t)}finally{s.f()}}}catch(t){a.e(t)}finally{a.f()}if(i&&Tt.includes(i)){var h=_t[i],v=h.normalizeIdentifier(r);if(h.handleValidationRegex&&h.handleValidationRegex.test(v))return n.identifier=v,h.finalizeIdentifier&&(n.identifier=h.finalizeIdentifier(n.identifier,!0)),n.url=h.urlTemplate(n.identifier,null),n.platform=i,n.valid=!0,n}return n}function Lt(t,e){for(var n,r=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],o={},i=o["phpjs.parse_url.mode"]&&o["phpjs.parse_url.mode"].local_value||"php",a={php:/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/\/?)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/},c=a[i].exec(t),u={},l=14;l--;)c[l]&&(u[r[l]]=c[l]);return e?u[e.replace("PHP_URL_","").toLowerCase()]:("php"!==i&&(n=o["phpjs.parse_url.queryKey"]&&o["phpjs.parse_url.queryKey"].local_value||"queryKey",a=/(?:^|&)([^&=]*)=?([^&]*)/g,u[n]={},(u[r[12]]||"").replace(a,(function(t,e,r){e&&(u[n][e]=r)}))),u.source=null,u)}function It(t){for(var e=t[0],n=1;n/g,">"),e+=t[n]}return e}function Ct(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().normalize("NFKD").toLowerCase().trim().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/-$/g,"")}function Pt(t){var e=[];return Object.entries(t).forEach((function(t){var n=f(t,2),r=n[0],o=n[1];if(o.length||"alt"===r)if(Array.isArray(o)){var i=o.filter((function(t){return t}));e.push("".concat(r,'="').concat(i.join(" "),'"'))}else e.push("".concat(r,'="').concat(o,'"'))})),e.join(" ")}var Mt={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function Rt(t){return function(t,e){var n,r,o,i,a,c,u,l,s,f=1,d=t.length,p="";for(r=0;r=0),i.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,i.width?parseInt(i.width):0);break;case"e":n=i.precision?parseFloat(n).toExponential(i.precision):parseFloat(n).toExponential();break;case"f":n=i.precision?parseFloat(n).toFixed(i.precision):parseFloat(n);break;case"g":n=i.precision?String(Number(n.toPrecision(i.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=i.precision?n.substring(0,i.precision):n;break;case"t":n=String(!!n),n=i.precision?n.substring(0,i.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=i.precision?n.substring(0,i.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=i.precision?n.substring(0,i.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}Mt.json.test(i.type)?p+=n:(!Mt.number.test(i.type)||l&&!i.sign?s="":(s=l?"+":"-",n=n.toString().replace(Mt.sign,"")),c=i.pad_char?"0"===i.pad_char?"0":i.pad_char.charAt(1):" ",u=i.width-(s+n).length,a=i.width&&u>0?c.repeat(u):"",p+=i.align?s+n+a:"0"===c?s+a+n:a+s+n)}return p}(function(t){if(Nt[t])return Nt[t];var e,n=t,r=[],o=0;for(;n;){if(null!==(e=Mt.text.exec(n)))r.push(e[0]);else if(null!==(e=Mt.modulo.exec(n)))r.push("%");else{if(null===(e=Mt.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var i=[],a=e[2],c=[];if(null===(c=Mt.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(i.push(c[1]);""!==(a=a.substring(c[0].length));)if(null!==(c=Mt.key_access.exec(a)))i.push(c[1]);else{if(null===(c=Mt.index_access.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");i.push(c[1])}e[2]=i}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}n=n.substring(e[0].length)}return Nt[t]=r}(t),arguments)}function Ft(t,e){return Rt.apply(null,[t].concat(e||[]))}var Nt=Object.create(null);var $t=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=t.length?t:window.location.search.slice(1),n=e.length?e.split("&"):[],r={},o=[];return n.forEach((function(t){o=t.split("="),r[o[0]]=decodeURIComponent(o[1]||"")})),JSON.parse(JSON.stringify(r))};function Dt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return"".concat(t.length?"".concat(t,"-"):"").concat(Math.random().toString(36).substr(2,9))}function Zt(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.location.href).split("#"),r=n[1]?"#".concat(n[1]):"",o=n[0].split("?"),i=o[0],a=o[1],c=void 0!==a?a.split("&"):[],u=!1;return c.forEach((function(n,r){n.startsWith("".concat(t,"="))&&(u=!0,e?c[r]="".concat(t,"=").concat(e):c.splice(r,1))})),!u&&e&&(c[c.length]="".concat(t,"=").concat(e)),"".concat(i).concat("?").concat(c.join("&")).concat(r)}var Ht=function(){var t,e,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r){var i=o.onAnimateInit,a=void 0===i?function(){}:i,c=o.onAnimateStart,u=void 0===c?function(){}:c,l=o.onAnimateEnd,s=void 0===l?function(){}:l,f=o.delay,d=void 0===f?(null===(t=r.dataset)||void 0===t?void 0:t.animationDelay)||0:f,p=o.duration,h=void 0===p?(null===(e=r.dataset)||void 0===e?void 0:e.animationDuration)||400:p,v=o.easing,g=void 0===v?(null===(n=r.dataset)||void 0===n?void 0:n.animationEasing)||"linear":v,m=function(t,e){var n,r,o,i,a,c={},u={},l=e.distanceFrom,s=void 0===l?(null===(n=t.dataset)||void 0===n?void 0:n.translateDistanceFrom)||"20px":l,f=e.distanceTo,d=void 0===f?(null===(r=t.dataset)||void 0===r?void 0:r.translateDistanceTo)||"0px":f,p=e.opacityFrom,h=void 0===p?null===(o=t.dataset)||void 0===o?void 0:o.translateOpacityFrom:p,v=e.opacityTo,g=void 0===v?null===(i=t.dataset)||void 0===i?void 0:i.translateOpacityTo:v,m=e.types;return(void 0===m?(null===(a=t.dataset)||void 0===a?void 0:a.animationTypes)||"":m).split(" ").forEach((function(t){"fadeIn"===t&&(c.opacity=h||0,u.opacity=g||1),"fadeOut"===t&&(c.opacity=h||1,u.opacity=g||0),"translateY"===t&&(c.transform="translateY(".concat(s,")"),u.transform="translateY(".concat(d,")"))})),[c,u]}(r,o);a(),setTimeout((function(){u(),requestAnimationFrame((function(){r.animate(m,{duration:Number(h),easing:g}).onfinish=function(){!function(t,e){var n,r,o,i=e.distanceTo,a=void 0===i?(null===(n=t.dataset)||void 0===n?void 0:n.translateDistanceTo)||"0px":i,c=e.opacityTo,u=void 0===c?null===(r=t.dataset)||void 0===r?void 0:r.translateOpacityTo:c,l=e.types;(void 0===l?(null===(o=t.dataset)||void 0===o?void 0:o.animationTypes)||"":l).split(" ").forEach((function(e){"fadeIn"===e&&(t.style.opacity=u||"1",t.setAttribute("aria-hidden","false")),"fadeOut"===e&&(t.style.opacity=u||"0",t.setAttribute("aria-hidden","true")),"translateY"===e&&(t.style.transform="translateY(".concat(a,")"))}))}(r,o),s()}}))}),d)}},qt=function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(t){var e=t.target,n=t.options;Ht(e,n)}))},Ut=/(android)/i.test(window.navigator.userAgent),Vt=!!window.chrome,Wt="undefined"!=typeof InstallTrigger,Jt=document.documentMode||!1,Bt=!Jt&&!!window.StyleMedia,Gt=!!window.navigator.userAgent.match(/(iPod|iPhone|iPad)/i),Yt=!!window.navigator.userAgent.match(/(iPod|iPhone)/i),Xt=!!window.opera||window.navigator.userAgent.indexOf(" OPR/")>=0,Kt=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0||!Vt&&!Xt&&"undefined"!==window.webkitAudioContext,Qt=window.navigator.platform;function te(){return{android:Ut,chrome:Vt,edge:Bt,firefox:Wt,ie:Jt,ios:Gt,iosMobile:Yt,opera:Xt,safari:Kt,os:Qt}}function ee(){var t=te(),e=document.body.classList;t.android?e.add("device-android"):t.ios&&e.add("device-ios"),t.edge?e.add("browser-edge"):t.chrome?e.add("browser-chrome"):t.firefox?e.add("browser-firefox"):t.ie?e.add("browser-ie"):t.opera?e.add("browser-opera"):t.safari&&e.add("browser-safari")}var ne=0,re=function(){var t=te();return t.ie||t.firefox||t.chrome&&!t.edge?document.documentElement:document.body},oe=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=re(),n=document.body.style;ne=e.scrollTop,n.overflowY="scroll",n.position="fixed",n.width="100%",t&&(n.marginTop="-".concat(ne,"px"))},ie=function(){var t=re(),e=document.body.style;e.overflowY="",e.position="static",e.marginTop="0px",e.width="",t.scrollTop=ne};function ae(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(window.clipboardData&&window.clipboardData.setData)return window.clipboardData.setData("Text",t);if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var e=document.createElement("textarea");e.textContent=t,e.style.position="fixed",document.body.appendChild(e),e.select();try{return document.execCommand("copy")}catch(t){return _("Copy to clipboard failed.",t),!1}finally{document.body.removeChild(e)}}}function ce(){var t,e=At({data:{},el:document,event:"",native:!0},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});if(e.native)(t=document.createEvent("HTMLEvents")).initEvent(e.event,!0,!1);else try{t=new window.CustomEvent(e.event,{detail:e.data})}catch(n){(t=document.createEvent("CustomEvent")).initCustomEvent(e.event,!0,!0,e.data)}e.el.dispatchEvent(t)}function ue(t){var e={isDown:!1,moveEventTriggered:!1,startX:0,scrollLeft:0};t.addEventListener("mousedown",(function(n){e.isDown=!0,t.classList.add("drag-horizontal--active"),e.startX=n.pageX-t.offsetLeft,e.scrollLeft=t.scrollLeft})),t.addEventListener("mouseleave",(function(){e.isDown=!1,t.classList.remove("drag-horizontal--active")})),t.addEventListener("mouseup",(function(){e.isDown=!1,t.classList.remove("drag-horizontal--active"),ce({event:"gform-utils/horizontal-drag-ended",native:!1}),e.moveEventTriggered=!1})),t.addEventListener("mousemove",(function(n){if(e.isDown){n.preventDefault();var r=3*(n.pageX-t.offsetLeft-e.startX);t.scrollLeft=e.scrollLeft-r,e.moveEventTriggered||(ce({event:"gform-utils/horizontal-drag-started",native:!1}),e.moveEventTriggered=!0)}}))}function le(t){for(var e=[],n=t.children.length;n--;)8!==t.children[n].nodeType&&e.unshift(t.children[n]);return e}function se(t,e){var n,r;for(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"].some((function(t){return"function"==typeof document.body[t]&&(n=t,!0)}));t;){if((r=t.parentElement)&&r[n](e))return r;t=r}return null}function fe(t){var e=t.getBoundingClientRect(),n=document.body,r=document.documentElement,o=window.pageYOffset||r.scrollTop||n.scrollTop,i=window.pageXOffset||r.scrollLeft||n.scrollLeft,a=r.clientTop||n.clientTop||0,c=r.clientLeft||n.clientLeft||0,u=e.top+o-a,l=e.left+i-c;return{top:Math.round(u),left:Math.round(l),bottom:Math.round(e.bottom)}}function de(t){var e=t.clientWidth,n=t;n.style.visibility="hidden",n.style.height="auto",n.style.maxHeight="none",n.style.position="fixed",n.style.width="".concat(e,"px");var r=n.offsetHeight;return n.style.visibility="",n.style.height="",n.style.maxHeight="",n.style.width="",n.style.position="",n.style.zIndex="",r}function pe(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3]?t:'[data-js="'.concat(t,'"]'),o=n.querySelectorAll(r);return e&&(o=d(o)),o}function he(){var t=pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",!1,arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,arguments.length>2&&void 0!==arguments[2]&&arguments[2]);return t.length>0?t[0]:null}function ve(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).some((function(r){return t.classList.contains("".concat(e).concat(r).concat(n))}))}function ge(t){return{vertical:t.scrollHeight>t.clientHeight,horizontal:t.scrollWidth>t.clientWidth}}function me(t,e){e.parentNode.insertBefore(t,e.nextElementSibling)}function ye(t,e){e.parentNode.insertBefore(t,e)}function we(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").match(/^([^:/?#]+:)?(?:\/\/([^/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof t[1]&&t[1].length>0&&t[1].toLowerCase()!==window.location.protocol||"string"==typeof t[2]&&t[2].length>0&&t[2].replace(new RegExp(":(".concat({"http:":80,"https:":443}[window.location.protocol],")?$")),"")!==window.location.host}function be(){return-1!==(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("/").pop().indexOf(".")}function xe(){var t;if(!window.gforms_original_json||!window.UpdateFormObject)return!1;window.UpdateFormObject();var e="1"===(null===(t=window)||void 0===t||null===(t=t.gf_legacy)||void 0===t?void 0:t.is_legacy),n=JSON.parse(JSON.stringify(JSON.parse(window.gforms_original_json))),r=JSON.parse(JSON.stringify(window.form));return e&&(n.fields.forEach((function(t,e){delete n.fields[e].layoutGroupId})),r.fields.forEach((function(t,e){delete r.fields[e].layoutGroupId}))),JSON.stringify(n)!==JSON.stringify(r)}function Oe(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(".").pop().toLowerCase().match(/(jpg|jpeg|png|gif|svg)/g);return t&&t.length>0||!1}function Se(){var t=document.createElement("div");document.body.appendChild(t);var e="rtl"===window.getComputedStyle(t,null).getPropertyValue("direction");return document.body.removeChild(t),e}function Ae(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"",e=document.createElement("a");e.href=t,e.target="_blank",document.body.appendChild(e),e.click(),e.remove()}function Ee(){var t=At({event:null,url:"",center:!0,name:"_blank",specs:{menubar:0,scrollbars:0,status:1,titlebar:1,toolbar:0,top:100,left:100,width:500,height:300}},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});if(t.event&&(t.event.preventDefault(),t.url.length||(t.url=t.event.currentTarget.href)),t.url.length){t.center&&(t.specs.top=window.screen.height/2-t.specs.height/2,t.specs.left=window.screen.width/2-t.specs.width/2);var e=[];Object.entries(t.specs).forEach((function(t){var n=f(t,2),r=n[0],o=n[1],i="".concat(r,"=").concat(o);e.push(i)})),window.open(t.url,t.name,e.join())}}function ke(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=0;n0&&void 0!==arguments[0]?arguments[0]:"";return document.querySelectorAll("[data-load-chunk-".concat(t,"]")).length>0}var Te=function(t){var e,n=(null===(e=window)||void 0===e?void 0:e.SimpleBar)||{};n.instances&&t&&pe("[data-simplebar]",!0,t,!0).forEach((function(t){var e;return null!==(e=n.instances.get(t))&&void 0!==e?e:new n(t)}))},ze=25,Le=[],Ie=function(t){return t<.2074?-3.8716*t*t*t+6.137*t*t+.4*t:1.1317*(t-1)*(t-1)*(t-1)-.1975*(t-1)*(t-1)+1},Ce=function(t){Le[t]||(Le[t]={up:null,down:null})},Pe=function(t){Le[t].up&&(window.cancelAnimationFrame(Le[t].up),Le[t].up=null),Le[t].down&&(window.cancelAnimationFrame(Le[t].down),Le[t].down=null)},Me=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:400,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=t.offsetHeight,i=de(t),a=null;t.style.maxHeight="0",Ce(e),Pe(e);var c=function(u){a||(a=u);var l=u-a,s=Ie(l/n)*(i-o)+o;t.style.maxHeight="".concat(s,"px"),l2&&void 0!==arguments[2]?arguments[2]:400,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=t.offsetHeight,i=null;t.style.maxHeight="".concat(o,"px"),Ce(e),Pe(e);var a=function(c){i||(i=c);var u=c-i,l=Ie(u/n)*(0-o)+o;t.style.maxHeight="".concat(l,"px"),u1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"gform-spacing",r={};return!t||"string"!=typeof t&&"number"!=typeof t&&!Array.isArray(t)||Array.isArray(t)&&!t.length?r:"string"==typeof t||"number"==typeof t?(r["".concat(n,"--").concat(e,"bottom-").concat(t)]=!0,r):1===t.length?(["top","right","bottom","left"].forEach((function(o){r["".concat(n,"--").concat(e).concat(o,"-").concat(t[0])]=!0})),r):2===t.length?(["top","bottom"].forEach((function(o){r["".concat(n,"--").concat(e).concat(o,"-").concat(t[0])]=!0})),["right","left"].forEach((function(o){r["".concat(n,"--").concat(e).concat(o,"-").concat(t[1])]=!0})),r):3===t.length?(r["".concat(n,"--").concat(e,"top-").concat(t[0])]=!0,["right","left"].forEach((function(o){r["".concat(n,"--").concat(e).concat(o,"-").concat(t[1])]=!0})),r["gform-spacing--".concat(e,"bottom-").concat(t[2])]=!0,r):4===t.length?(r["".concat(n,"--").concat(e,"top-").concat(t[0])]=!0,r["".concat(n,"--").concat(e,"right-").concat(t[1])]=!0,r["".concat(n,"--").concat(e,"bottom-").concat(t[2])]=!0,r["".concat(n,"--").concat(e,"left-").concat(t[3])]=!0,r):r};function De(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"gform-spacing",n={};return!t||"string"!=typeof t&&"number"!=typeof t&&!Array.isArray(t)&&("object"!==I(t)||Array.isArray(t))||Array.isArray(t)&&!t.length?n:(n[e]=!0,"string"==typeof t||"number"==typeof t||Array.isArray(t)?Ne(Ne({},n),$e(t,"",e)):["","md","lg"].reduce((function(n,r){return Object.prototype.hasOwnProperty.call(t,r)?Ne(Ne({},n),$e(t[r],r?"".concat(r,"-"):"",e)):n}),n))}var Ze=function(){var t="undefined"!=typeof window&&window,e="undefined"!=typeof document&&document;return{docElem:e&&e.documentElement,win:t}},He=function(){var t=Ze(),e=t.docElem,n=t.win,r=e.clientWidth,o=n.innerWidth;return r0?Math.min(e,n-i):Math.min(o,n))};function Ve(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof t)throw new TypeError("Expected the first argument to be a function, got `".concat(I(t),"`"));var n,r,o,i=e.wait,a=void 0===i?0:i,c=e.maxWait,u=void 0===c?Number.Infinity:c,l=e.before,s=void 0!==l&&l,f=e.after,d=void 0===f||f;if(!s&&!d)throw new Error("Both `before` and `after` are false, function wouldn't be called.");var p=function(){for(var e=arguments.length,i=new Array(e),c=0;c0&&u!==Number.Infinity&&!r&&(r=setTimeout((function(){r=void 0,n&&(clearTimeout(n),n=void 0),d&&(o=t.apply(l,i))}),u)),f&&(o=t.apply(l,i)),o};return Ot(p,t),p.cancel=function(){n&&(clearTimeout(n),n=void 0),r&&(clearTimeout(r),r=void 0)},p}if("undefined"!=typeof Element&&!Element.prototype.matches){var We=Element.prototype;We.matches=We.matchesSelector||We.mozMatchesSelector||We.msMatchesSelector||We.oMatchesSelector||We.webkitMatchesSelector}function Je(t,e,n,r,o){var i=Be.apply(this,arguments);return t.addEventListener(n,i,o),{destroy:function(){t.removeEventListener(n,i,o)}}}function Be(t,e,n,r){return function(n){n.delegateTarget=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}(n.target,e),n.delegateTarget&&r.call(t,n)}}var Ge=function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return"function"==typeof t.addEventListener?Je.apply(null,arguments):"function"==typeof n?Je.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,(function(t){return Je(t,e,n,r,o)})))};function Ye(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}var Xe=n(192),Ke=n.n(Xe);window.gform=window.gform||{},window.gform.instances=window.gform.instances||{},window.gform.instances.filters=window.gform.instances.filters||[];var Qe=window.gform.instances.filters,tn=function(){var t,e=(t=Ke().mark((function t(){var e,n,r,o,i=arguments;return Ke().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=At({data:{},event:""},i.length>0&&void 0!==i[0]?i[0]:{}),void 0===Qe[e.event]){t.next=18;break}(n=Qe[e.event]).sort((function(t,e){return t.priority-e.priority})),r=0;case 6:if(!(r2&&void 0!==arguments[2]?arguments[2]:10,!0)},nn=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];void 0===Qe[t]&&(Qe[t]=[]);var o=t+"_"+Qe[t].length;Qe[t].push({tag:o,callable:e,priority:n,isAsync:r})},rn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0!==Qe[t])for(var r=Qe[t],o=r.length-1;o>=0;o--)null!==n&&n!==r[o].tag||null!==e&&parseInt(r[o].priority)!==parseInt(e)||r.splice(o,1)};function on(t){"loading"!==document.readyState?t():document.addEventListener?document.addEventListener("DOMContentLoaded",t):document.attachEvent("onreadystatechange",(function(){"loading"!==document.readyState&&t()}))}function an(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;!(arguments.length>2&&void 0!==arguments[2])||arguments[2]?window.addEventListener("resize",Ve(t,{wait:e})):window.removeEventListener("resize",Ve(t,{wait:e}))}var cn={},un=function(t){for(var e=String(t),n=0,r=0,o=e.length;r0&&void 0!==arguments[0]?arguments[0]:"",e=document.cookie.split(";"),n=0;n0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o="",i=e;if(n&&!isNaN(Number(n))){var a=new Date;a.setTime(a.getTime()+24*Number(n)*60*60*1e3),o=" expires="+a.toUTCString()}if(r){var c=wn(t);i=""!==c&&null!==c?c+","+e:e}document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(i)+";"+o},xn=function(t){bn(t,"",-1)};!function(){var t=window.gformComponentNamespace||"gform";window[t]=window[t]||{},window[t].utils=window[t].utils||{};var e=window[t].utils;Object.entries(l).forEach((function(t){var n=f(t,2),r=n[0],o=n[1];e[r]=o}))}()}()}();; "use strict"; ; /* global wppopups_settings,*/ (function ($) { /** * Copyright 2012, Digital Fusion * Licensed under the MIT license. * http://teamdf.com/jquery-plugins/license/ * * @author Sam Sehnert * @desc A small plugin that checks whether elements are within * the user visible viewport of a web browser. * can accounts for vertical position, horizontal, or both */ var $w = $(window); $.fn.visible = function (partial, hidden, direction, container) { if (this.length < 1) return; // Set direction default to 'both'. direction = direction || 'both'; var $t = this.length > 1 ? this.eq(0) : this, isContained = typeof container !== 'undefined' && container !== null, $c = isContained ? $(container) : $w, wPosition = isContained ? $c.position() : 0, t = $t.get(0), vpWidth = $c.outerWidth(), vpHeight = $c.outerHeight(), clientSize = hidden === true ? t.offsetWidth * t.offsetHeight : true; if (typeof t.getBoundingClientRect === 'function') { // Use this native browser method, if available. var rec = t.getBoundingClientRect(), tViz = isContained ? rec.top - wPosition.top >= 0 && rec.top < vpHeight + wPosition.top : rec.top >= 0 && rec.top < vpHeight, bViz = isContained ? rec.bottom - wPosition.top > 0 && rec.bottom <= vpHeight + wPosition.top : rec.bottom > 0 && rec.bottom <= vpHeight, lViz = isContained ? rec.left - wPosition.left >= 0 && rec.left < vpWidth + wPosition.left : rec.left >= 0 && rec.left < vpWidth, rViz = isContained ? rec.right - wPosition.left > 0 && rec.right < vpWidth + wPosition.left : rec.right > 0 && rec.right <= vpWidth, vVisible = partial ? tViz || bViz : tViz && bViz, hVisible = partial ? lViz || rViz : lViz && rViz, vVisible = rec.top < 0 && rec.bottom > vpHeight ? true : vVisible, hVisible = rec.left < 0 && rec.right > vpWidth ? true : hVisible; if (direction === 'both') return clientSize && vVisible && hVisible;else if (direction === 'vertical') return clientSize && vVisible;else if (direction === 'horizontal') return clientSize && hVisible; } else { var viewTop = isContained ? 0 : wPosition, viewBottom = viewTop + vpHeight, viewLeft = $c.scrollLeft(), viewRight = viewLeft + vpWidth, position = $t.position(), _top = position.top, _bottom = _top + $t.height(), _left = position.left, _right = _left + $t.width(), compareTop = partial === true ? _bottom : _top, compareBottom = partial === true ? _top : _bottom, compareLeft = partial === true ? _right : _left, compareRight = partial === true ? _left : _right; if (direction === 'both') return !!clientSize && compareBottom <= viewBottom && compareTop >= viewTop && compareRight <= viewRight && compareLeft >= viewLeft;else if (direction === 'vertical') return !!clientSize && compareBottom <= viewBottom && compareTop >= viewTop;else if (direction === 'horizontal') return !!clientSize && compareRight <= viewRight && compareLeft >= viewLeft; } }; })(jQuery); (function ($) { 'use strict'; var WPPopupsPro = { popups: {}, last_position: null, delta: 0, timer: null, /** * Start the engine. * * @since 2.0.0 */ init: function init() { // Document ready $(document).ready(WPPopupsPro.ready); // Page load $(window).on('load', WPPopupsPro.load); // Document ready $(document).on('wppopupsReady', WPPopupsPro.start); // Before rules in src $(document).on('wppopupsBeforeReady', WPPopupsPro.beforeReady); // register events and hooks WPPopupsPro.bindEvents(); }, /** * Document ready. * * @since 2.0.0 */ ready: function ready() {}, /** * Page load. * * @since 2.0.0 */ load: function load() {}, start: function start() { WPPopupsPro.loopPopups(); // Set user identifier // WPPopupsPro.setUserIndentifier(); not needed for now $(document).trigger('wppopupsProStarted'); }, /** * Configure each popup */ loopPopups: function loopPopups() { $(".spu-box").each(function () { var $popup = $(this), $id = $popup.data('id'); // check if popups goes after content WPPopupsPro.afterContentPopups($popup); // check advanced method WPPopupsPro.advancedClosePopups($popup); WPPopupsPro.pushContentPopups($popup); }); }, // --------------------------------------------------------------------// // Binds // --------------------------------------------------------------------// /** * Events bindings. * * @since 2.0.0 */ bindEvents: function bindEvents() { // Stats if (wppopups_pro_vars.enable_stats && '1' == wppopups_pro_vars.enable_stats) { $(document).on('wppopups.popup_converted', WPPopupsPro.trackConversion); $(document).on('wppopups.popup_opened', WPPopupsPro.trackOpening); } //disable scroll window.wp.hooks.addAction('wppopups_before_show_popup', 'wppopups', WPPopupsPro.disablePageScroll); window.wp.hooks.addAction('wppopups_hide_popup', 'wppopups', WPPopupsPro.enablePageScroll); // animations window.wp.hooks.addAction('wppopups_show_popup', 'wppopups', WPPopupsPro.triggerShowAnimations); window.wp.hooks.addAction('wppopups_show_popup', 'wppopups', WPPopupsPro.triggerAutoClose); // sticky window.wp.hooks.addAction('wppopups_show_popup', 'wppopups', WPPopupsPro.stickyPopup); window.wp.hooks.addFilter('wppopups_cancel_hide', 'wppopups', function (default_value, popup) { var settings = window.wppopups.settings(popup, 'position'); if (settings.position == 'sticky-left' || settings.position == 'sticky-right') { return true; } return default_value; }); $(document).on('click', '.spu-box .spu-sticky-title, .spu-position-sticky-right .spu-close-popup, .spu-position-sticky-left .spu-close-popup', function (e) { $(this).closest('.spu-box').toggleClass('spu-sticky-open'); }); // Triggers window.wp.hooks.addAction('wppopups_trigger_popup', 'wppopups', WPPopupsPro.bindTriggers); }, /** * Bind popup open trigger * @param func_name * @param trigger_value * @param $popup */ bindTriggers: function bindTriggers(func_name, trigger_value, $popup) { if (typeof WPPopupsPro[func_name] == 'function') { WPPopupsPro[func_name](trigger_value, $popup); } }, /** * Trigger exit intent * @param value * @param $popup */ triggerByExit: function triggerByExit(value, $popup) { if (window.wppopups.isMobile()) { $(document).on('scroll', { value: value, popup: $popup }, WPPopupsPro.exitIntentMobile); } else { $(document.body).on('mouseleave', { value: value, popup: $popup }, WPPopupsPro.exitIntent); } }, /** * TRigger popup when element of class become visible * @param value * @param $popup */ triggerByVisible: function triggerByVisible(value, $popup) { // if not class provided abort if (value === '') { return; } $(window).bind('scroll', { value: value, popup: $popup }, WPPopupsPro.triggerVisible); }, /** * @param value * @param $popup */ triggerVisible: function triggerVisible(e) { var triggerClass = WPPopupsPro.cleanClass(e.data.value); // show box when criteria for this box is matched if ($(triggerClass).visible(true) && window.wppopups.checkConvertion(e.data.popup)) { // remove listen event if box shouldn't be hidden again $(window).unbind('scroll', WPPopupsPro.triggerVisible); window.wppopups.showPopup(e.data.popup); } }, /** * Function that check a classname and add . in front * @param classname */ cleanClass: function cleanClass(classname) { if (classname.indexOf('.') !== 0) { return '.' + classname; } return classname; }, /** * Callback for exit intent popup * @param e * @param $popup */ exitIntent: function exitIntent(e) { // Only trigger if leaving near the top of the page if (e.clientY > 20 || !window.wppopups.checkConvertion(e.data.popup)) { return; } window.wppopups.showPopup(e.data.popup); // we want to show it only once $(document.body).unbind('mouseleave', WPPopupsPro.exitIntent); }, /** * Callback for exit intent popup for Mobile * @param e * @param $popup */ exitIntentMobile: function exitIntentMobile(e) { if (!window.wppopups.checkConvertion(e.data.popup)) return; WPPopupsPro.scrollSpeed(); if (WPPopupsPro.delta < -200) window.wppopups.showPopup(e.data.popup); }, /** * Callback for calculate the speed scroll */ scrollSpeed: function scrollSpeed() { var new_position = window.scrollY; if (WPPopupsPro.last_position != null) WPPopupsPro.delta = new_position - WPPopupsPro.last_position; WPPopupsPro.last_position = new_position; clearTimeout(WPPopupsPro.timer); WPPopupsPro.timer = setTimeout(function () { WPPopupsPro.last_position = null; WPPopupsPro.delta = 0; }, 50); }, /** * Set cookie container user UUID. * */ setUserIndentifier: function setUserIndentifier() { if (wppopups_settings.uuid_cookie && !WPPopupsPro.getCookie('_wpfuuid')) { // Generate UUID - http://stackoverflow.com/a/873856/1489528 var s = new Array(36), hexDigits = '0123456789abcdef', uuid; for (var i = 0; i < 36; i++) { s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); } s[14] = "4"; s[19] = hexDigits.substr(s[19] & 0x3 | 0x8, 1); s[8] = s[13] = s[18] = s[23] = '-'; uuid = s.join(""); WPPopupsPro.createCookie('_wpfuuid', uuid, 3999); } }, /** * Track popup opening * @param event * @param id */ trackOpening: function trackOpening(event, id) { var $popup = window.wppopups.getPopup(id), settings = window.wppopups.settings($popup, 'settings'), sampling_active = wppopups_vars.dsampling || false, sampling_rate = wppopups_vars.dsamplingrate; var do_request = true; // don't track admins or test mode if (wppopups_vars.is_admin && settings.test_mode == '1') { return; } // only save when sampling is not active or lottery wins if (sampling_active && sampling_rate > 0) { var num = Math.floor(Math.random() * sampling_rate) + 1; do_request = 1 === num; } if (do_request) { // Make the ajax request to track the data. If using Google Analytics, send to GA, otherwise track locally. WPPopupsPro.trackGoogleAnalytics(id, false); var data = { action: 'track_wppopups', popup_id: id, conversion: false, post_id: wppopups_pro_vars.post_id }; var ajax = { url: wppopups_vars.ajax_url, data: data, cache: false, type: 'POST', dataType: 'json', timeout: 30000 }; $.ajax(ajax); } }, /** * Track in GA * @param popup_id * @param conversion */ trackGoogleAnalytics: function trackGoogleAnalytics(popup_id, conversion) { var $popup = window.wppopups.getPopup(popup_id), settings = window.wppopups.settings($popup, 'settings'), eventCategory = settings.ga_event_category || 'Popup Event', m_id = wppopups_pro_vars.m_id, eventLabel = settings.ga_event_label || 'wppopups-' + popup_id, eventIAction = settings.ga_event_action_impression || 'impression', eventCAction = settings.ga_event_action_conversion || 'conversion', eventAction = conversion ? eventCAction : eventIAction; if (!m_id) { return; } /* // Create a custom event tracker and dimensions if it has not been initialized. if ( ! WPPopupsPro.ga_init ) { if (typeof ga == 'function') { // create tracker ga('create', ga_id, 'auto', { 'name' : 'WPPopupsTracker' }); } //yoast analytics if (typeof __gaTracker == 'function') { //create tracker __gaTracker('create', ga_id, 'auto', { 'name' : 'WPPopupsTracker' }); } WPPopupsPro.ga_init = true; } // monster insights if (typeof __gaTracker == 'function') { // Send the event tracking data to Google Analytics. if( ga_id ) { __gaTracker('WPPopupsTracker.send', 'event', eventCategory, eventAction, eventLabel); } } else { if (typeof ga == 'function') { // Send the event tracking data to Google Analytics. ga('WPPopupsTracker.send', 'event', eventCategory, eventAction, eventLabel ); } }*/ // monster insights if (typeof __gtagTracker == 'function') { // new method as well if (m_id) { __gtagTracker('event', eventAction, { 'send_to': m_id, 'event_category': eventCategory, 'event_label': eventLabel }); } } else { if (typeof gtag == 'function' && m_id) { // Send the event tracking data to Google Universal Analytics. gtag('event', eventAction, { 'send_to': m_id, 'event_category': eventCategory, 'event_label': eventLabel }); } } }, /** * Track popup conversion * @param event * @param id */ trackConversion: function trackConversion(event, id) { var $popup = window.wppopups.getPopup(id), settings = window.wppopups.settings($popup, 'settings'); var do_request = true; // don't track admins or test mode if (wppopups_vars.is_admin && settings.test_mode == '1') { return; } // Make the ajax request to track the data. If using Google Analytics, send to GA, otherwise track locally. WPPopupsPro.trackGoogleAnalytics(id, true); var data = { action: 'track_wppopups', popup_id: id, conversion: true, post_id: wppopups_pro_vars.post_id }; var ajax = { url: wppopups_vars.ajax_url, data: data, cache: false, type: 'POST', dataType: 'json', timeout: 30000 }; $.ajax(ajax); }, /** * Run before the popup rules are checked */ beforeReady: function beforeReady() { var counter = WPPopupsPro.sessionCounter(); window.wp.hooks.addFilter('wppopups_pre_ready_data', 'wppopups', function (data) { data.visited_n_pages = counter; return data; }); // check if any popups has trigger by conversion $(".spu-box").each(function () { var $popup = $(this), $rules = window.wppopups.settings($popup, 'rules'); if (Object.keys($rules).length) { for (var group in $rules) { for (var rule in $rules[group]) { if ($rules[group][rule].rule == 'converted') { // add need-convert class $popup.addClass($rules[group][rule].operator == '==' ? 'yes-convert' : 'no-convert'); $popup.data('convert-id', $rules[group][rule].value); } // check if there is no need for ajax and we have a rule for n visited pages if ($rules[group][rule].rule == 'visited_n_pages' && !$popup.data('need_ajax')) { var operator = $rules[group][rule].operator; var show_popup = false; if (operator == "==") { show_popup = counter == $rules[group][rule].value; } else if (operator == "!=") { show_popup = !(counter == $rules[group][rule].value); } if (counter < $rules[group][rule].value && operator == "<") { show_popup = true; } if (counter > $rules[group][rule].value && operator == ">") { show_popup = true; } if (!show_popup) { $popup.remove(); } } } } } }); }, /** * Auto close trigger method * @param $popup */ triggerAutoClose: function triggerAutoClose($popup) { var settings = window.wppopups.settings($popup, 'settings'); // Seconds left to close ( autoclose timer ) if (settings.autoclose > 0 && typeof $popup.counter === 'undefined') { $popup.autoclose = settings.autoclose; $popup.counter = setInterval(function () { WPPopupsPro.autoClose($popup); }, 1000); } }, /** * Auto close function * @param $popup */ autoClose: function autoClose($popup) { var settings = window.wppopups.settings($popup, 'settings'); $popup.autoclose = $popup.autoclose - 1; if ($popup.autoclose <= 0) { clearInterval($popup.counter); $popup.counter = 'undefined'; $popup.autoclose = settings.autoclose; window.wppopups.hidePopup($popup, false); return; } $("#spu-" + $popup.data('id')).find('.spu-timer').html(wppopups_pro_vars.l18n.wait + " " + $popup.autoclose + " " + wppopups_pro_vars.l18n.seconds); }, /** * Move popup after post content * @param $popup */ afterContentPopups: function afterContentPopups($popup) { var settings = window.wppopups.settings($popup, 'position'); if (settings.position == 'after-post') { $('#spu-bg-' + $popup.data('id')).remove(); if ($('.spu-placeholder').length) { $('.spu-placeholder').append($popup); } else { $popup.remove(); } $('.spu-placeholder').show(); // remove advanced close for this popup WPPopupsPro.advancedClosePopups($popup, true); } }, /** * Disable advanced close method * @param $popup * @param force boolean */ advancedClosePopups: function advancedClosePopups($popup, force) { var settings = window.wppopups.settings($popup, 'settings'); // if popup has disabled advanced close or we are forcing ir (after content if (settings.advanced_close == '1' || force) { window.wp.hooks.addFilter('wppopups_allow_togglePopups', 'wppopups', function (default_value, popup) { // if event fired popup id is equal to our popup, cancel it if (popup.data('id') == $popup.data('id')) { return false; } return default_value; }); } }, /** * Disabel page scroll if needed * @param $popup */ disablePageScroll: function disablePageScroll($popup) { var settings = window.wppopups.settings($popup, 'settings'); if (settings.disable_scroll && settings.disable_scroll == '1') { $('body,html').css('overflow', 'hidden'); } }, /** * Disabel page scroll if needed * @param $popup */ enablePageScroll: function enablePageScroll($popup) { var settings = window.wppopups.settings($popup, 'settings'); if (settings.disable_scroll && settings.disable_scroll == '1') { $('body,html').css('overflow', ''); } }, /** * Trigger premium animations on the popup * @param $popup */ triggerShowAnimations: function triggerShowAnimations($popup) { var animation = window.wppopups.settings($popup, 'animation'); var $class_name = ''; switch (animation.animation) { case 'fade': break; case 'slide': break; case 'disable': break; default: $class_name = 'spu-animation-' + animation.animation; break; } if ($class_name !== '') { $popup.addClass($class_name).addClass('spu-animation-animated'); } }, /** * Show a sticky popup * @param $popup */ stickyPopup: function stickyPopup($popup) { var settings = window.wppopups.settings($popup, 'position'); if (settings.position != 'sticky-left' && settings.position != 'sticky-right') return; var sticky_title = $popup.find('.spu-sticky-title'); $('#spu-bg-' + $popup.data('id')).remove(); sticky_title.show(); var popupHeight = $popup.outerHeight(), titleHeight = $popup.find('.spu-sticky-title').outerHeight(); $popup.css({ "bottom": "-" + (popupHeight - titleHeight) + "px" }); }, /** * Check if user visited the page before and remove popup if not */ sessionCounter: function sessionCounter() { var counter = sessionStorage.getItem('wppopups_visited_page') || 0; var new_value = parseInt(counter) + 1; // if we have a counter and matches the number of the rule update popup sessionStorage.setItem('wppopups_visited_page', new_value); return new_value; }, /** * Move popup to top/bottom if needed * @param $popup */ pushContentPopups: function pushContentPopups($popup) { var settings = window.wppopups.settings($popup, 'position'); if (settings.position == 'top-bar' && settings.push_content == '1') { $popup.prependTo('body'); } } }; // Initialize. WPPopupsPro.init(); // Add to global scope. window.wppopups_pro = WPPopupsPro; })(jQuery);;