{"version":3,"file":"../fc-utils-315.min.js","sources":["fc-utils-315.js"],"sourcesContent":["/**\n * Utility resources shared across the scripts of Fluid Checkout.\n */\n(function (root, factory) {\n\tif ( typeof define === 'function' && define.amd ) {\n\t\tdefine([], factory(root));\n\t} else if ( typeof exports === 'object' ) {\n\t\tmodule.exports = factory(root);\n\t} else {\n\t\troot.FCUtils = factory(root);\n\t}\n})(typeof global !== 'undefined' ? global : this.window || this.global, function (root) {\n\n\t'use strict';\n\n\tvar _publicMethods = { }\n\tvar _settings = {\n\t\tfocusableElementsSelector: 'a[role=\"button\"], a[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), textarea:not([disabled]), select:not([disabled]), details, summary, iframe, object, embed, [contenteditable] [tabindex]:not([tabindex=\"-1\"])',\n\n\t\tscrollOffsetSelector: '.fc-checkout-header',\n\t\tscrollBehavior: 'smooth',\n\t\tscrollOffset: 0,\n\t\tscrollDelay: 50,\n\n\t\tbreakpoints: {\n\t\t\tmobile: { minWidth: 0, maxWidth: 549 },\n\t\t\tphablet: { minWidth: 550, maxWidth: 749 },\n\t\t\ttablet: { minWidth: 750, maxWidth: 999 },\n\t\t\tdesktop: { minWidth: 1000, maxWidth: 1279 },\n\t\t\tdesktopMedium: { minWidth: 1280, maxWidth: 1499 },\n\t\t\tdesktopLarge: { minWidth: 1500, maxWidth: 1999 },\n\t\t\tdesktopExtraLarge: { minWidth: 2000, maxWidth: 1000000 },\n\t\t},\n\n\t\tselect2FormRowSelector: '.form-row.fc-select2-field',\n\t\tselect2FocusElementSelector: '.select2-selection, input[type=\"text\"]',\n\t\tselect2OptionsSelector: '.select2-results__options',\n\t\tselect2SelectionSelector: '.select2-selection__rendered',\n\t\t\n\t\ttomSelectFormRowSelector: '.form-row.fc-select2-field',\n\t\ttomSelectKeepingClosedClass: 'keeping-closed',\n\t}\n\n\n\n\t/**\n\t * PROPERTIES\n\t */\n\n\n\n\t/**\n\t * Mapping of keyboard keys based on and comparable with `event.key` values.\n\t */\n\t_publicMethods.keyboardKeys = {\n\t\tESC: 'Escape',\n\t\tENTER: 'Enter',\n\t\tSPACE: ' ',\n\t\tTAB: 'Tab',\n\t\tCAPS: 'CapsLock',\n\t\tSHIFT: 'Shift',\n\t\tFUNCTION: 'Fn',\n\t\tCONTROL: 'Control',\n\t\tCOMMAND_OR_WINDOWS: 'Meta', // This is the `Windows` logo key, or the `Command` or `⌘` key on Mac keyboards.\n\t\tALT: 'Alt',\n\t\tARROW_LEFT: 'ArrowLeft',\n\t\tARROW_RIGHT: 'ArrowRight',\n\t\tARROW_UP: 'ArrowUp',\n\t\tARROW_DOWN: 'ArrowDown',\n\t}\n\n\n\n\t/**\n\t * Determine which `animationend` event is supported.\n\t */\n\t_publicMethods.animationEndEvent = window.whichAnimationEnd ? window.whichAnimationEnd() : 'animationend';\n\n\n\n\n\t/**\n\t * METHODS\n\t */\n\n\n\n\t/**\n\t * Set the variables that track the current focused element and its value.\n\t */\n\tvar getCurrentFocusedElementGlobalVariables = function( setToRelativeSelect2 ) {\n\t\t// Set defaults\n\t\tif ( setToRelativeSelect2 !== true ) {\n\t\t\tsetToRelativeSelect2 = false;\n\t\t}\n\n\t\t// Set current focused element and value\n\t\tvar currentfocusedElement = document.activeElement;\n\n\t\t// Maybe set to relative `select2` field element,\n\t\t// if the focus is current on a `select2` field option.\n\t\tvar select2Options = currentfocusedElement.closest( _settings.select2OptionsSelector );\n\t\tif ( setToRelativeSelect2 && select2Options ) {\n\t\t\tvar select2ElementId = select2Options.getAttribute( 'id' ).replace( '-results', '-container' );\n\t\t\tcurrentfocusedElement = document.getElementById( select2ElementId );\n\t\t}\n\n\t\t// Maybe set to form row for `select2` fields\n\t\tvar currentFocusedFormRow = currentfocusedElement.closest( _settings.select2FormRowSelector );\n\t\tif ( currentFocusedFormRow && currentFocusedFormRow.querySelector( _settings.select2SelectionSelector ) ) {\n\t\t\t// Remove focus from current element as it will be replaced\n\t\t\t// This fixes an issue where `select2` fields would not work properly\n\t\t\t// after checkout is updated while focus is on a `select2` field\n\t\t\tif ( currentfocusedElement ) { currentfocusedElement.blur(); }\n\n\t\t\tcurrentfocusedElement = currentFocusedFormRow;\n\t\t}\n\n\t\treturn currentfocusedElement;\n\t}\n\n\n\n\t/*!\n\t* Merge two or more objects together.\n\t* (c) 2017 Chris Ferdinandi, MIT License, https://gomakethings.com\n\t* @param {Boolean} deep If true, do a deep (or recursive) merge [optional]\n\t* @param {Object} objects The objects to merge together\n\t* @returns {Object} Merged values of defaults and options\n\t*/\n\t_publicMethods.extendObject = function () {\n\t\t// Variables\n\t\tvar extended = {};\n\t\tvar deep = false;\n\t\tvar i = 0;\n\n\t\t// Check if a deep merge\n\t\tif ( Object.prototype.toString.call( arguments[0] ) === '[object Boolean]' ) {\n\t\t\tdeep = arguments[0];\n\t\t\ti++;\n\t\t}\n\n\t\t// Merge the object into the extended object\n\t\tvar merge = function (obj) {\n\t\t\tfor (var prop in obj) {\n\t\t\t\tif (obj.hasOwnProperty(prop)) {\n\t\t\t\t\t// If property is an object, merge properties\n\t\t\t\t\tif (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\n\t\t\t\t\t\textended[prop] = _publicMethods.extendObject(extended[prop], obj[prop]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\textended[prop] = obj[prop];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Loop through each object and conduct a merge\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar obj = arguments[i];\n\t\t\tmerge(obj);\n\t\t}\n\n\t\treturn extended;\n\t};\n\n\n\n\t/**\n\t * Returns a function, that, as long as it continues to be invoked, will not\n\t * be triggered. The function will be called after it stops being called for\n\t * N milliseconds. If `immediate` is passed, trigger the function on the\n\t * leading edge, instead of the trailing.\n\t *\n\t * @param {[type]} func Function to be executed.\n\t * @param {[type]} wait Wait time in milliseconds.\n\t * @param {[type]} immediate Trigger the function on the leading edge.\n\t *\n\t * @return function Function to be executed, incapsulated in a timed function.\n\t */\n\t_publicMethods.debounce = function ( func, wait, immediate ) {\n\t\tvar timeout;\n\n\t\treturn function() {\n\t\t\tvar context = this, args = arguments;\n\t\t\tvar later = function() {\n\t\t\t\ttimeout = null;\n\t\t\t\tif (!immediate) func.apply( context, args );\n\t\t\t};\n\n\t\t\tvar callNow = immediate && !timeout;\n\t\t\tclearTimeout( timeout );\n\t\t\ttimeout = setTimeout( later, wait );\n\n\t\t\tif ( callNow ) func.apply( context, args );\n\t\t};\n\t};\n\n\t/**\n\t * Return a function, that, when invoked, will only be triggered at most once\n\t * during a given window of time. Normally, the throttled function will run\n\t * as much as it can, without ever going more than once per `wait` duration;\n\t * \n\t * @param function fn Function to be executed.\n\t * @param int threshhold Wait time in milliseconds.\n\t * @param object scope Scope of the function to be executed.\n\t * \n\t * @return function Function to be executed, incapsulated in a timed function.\n\t */\n\t_publicMethods.throttle = function( fn, threshhold, scope ) {\n\t\tthreshhold || (threshhold = 250);\n\t\tvar last,\n\t\tdeferTimer;\n\t\treturn function () {\n\t\t\tvar context = scope || this;\n\t\t\n\t\t\tvar now = +new Date,\n\t\t\t\targs = arguments;\n\t\t\tif ( last && now < last + threshhold ) {\n\t\t\t\t// hold on to it\n\t\t\t\tclearTimeout( deferTimer );\n\t\t\t\tdeferTimer = setTimeout( function () {\n\t\t\t\t\tlast = now;\n\t\t\t\t\tfn.apply( context, args );\n\t\t\t\t}, threshhold );\n\t\t\t} else {\n\t\t\t\tlast = now;\n\t\t\t\tfn.apply( context, args );\n\t\t\t}\n\t\t};\n\t}\n\n\n\n\t/**\n\t * Check if the element is considered visible. Does not consider the CSS property `visibility: hidden;`.\n\t */\n\t_publicMethods.isElementVisible = function( element ) {\n\t\treturn !!( element.offsetWidth || element.offsetHeight || element.getClientRects().length );\n\t}\n\n\n\n\t/**\n\t * Get the current breakpoints matched based on the window width.\n\t */\n\t_publicMethods.getCurrentBreakpoints = function() {\n\t\t// Define variables\n\t\tvar windowWidth = window.innerWidth;\n\t\tvar breakpointSelectors = Object.entries( _settings.breakpoints );\n\t\tvar currentBreakpoints = [];\n\n\t\t// Iterate through all breakpoints\n\t\tfor ( var i = 0; i < breakpointSelectors.length; i++ ) {\n\t\t\t// Get variables\n\t\t\tvar breakpoint = breakpointSelectors[ i ][ 0 ];\n\t\t\tvar values = breakpointSelectors[ i ][ 1 ];\n\n\t\t\t// Check whether window width is within the breakpoint max width bounds,\n\t\t\t// that is, exclude breakpoints which are min width is larger than the\n\t\t\t// actual window width.\n\t\t\tif ( values.minWidth <= windowWidth ) {\n\t\t\t\t// Add breakpoint to the current breakpoints\n\t\t\t\tcurrentBreakpoints.push( breakpoint );\n\t\t\t}\n\t\t}\n\n\t\t// Return list with the current breakpoint and smaller breakpoints\n\t\treturn currentBreakpoints;\n\t}\n\n\t/**\n\t * Check if the current breakpoint matches the specified breakpoint or is smaller than the target breakpoint.\n\t * \n\t * @param string targetBreakpoint The breakpoint to check against. Accepted values are: `mobile`, `phablet`, `tablet`, `desktop`, `desktopMedium`, `desktopLarge` and `desktopExtraLarge`.\n\t */\n\t_publicMethods.isCurrentBreakpointOrSmaller = function( targetBreakpoint ) {\n\t\t// Get variables\n\t\tvar currentBreakpoints = _publicMethods.getCurrentBreakpoints();\n\t\tvar targetBreakpointIndex = currentBreakpoints.indexOf( targetBreakpoint );\n\t\tvar higherstBreakpointIndex = currentBreakpoints.length - 1;\n\n\t\t// Return `true` if highest breakpoint matches the target breakpoint\n\t\tif ( targetBreakpointIndex == higherstBreakpointIndex ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Iterate through current breakpoints\n\t\tfor ( var i = 0; i < currentBreakpoints.length; i++ ) {\n\t\t\t// Check whether higherst breakpoint is higher than target\n\t\t\t// If so, return `false`.\n\t\t\tif ( -1 !== targetBreakpointIndex && i > targetBreakpointIndex ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Otherwise it is smaller, then return `true`.\n\t\treturn true;\n\t}\n\n\n\n\t/**\n\t * Gets keyboard-focusable elements within a specified element\n\t *\n\t * @param HTMLElement element The element to search within. Defaults to the `document` root element.\n\t *\n\t * @return NodeList All focusable elements withing the element passed in.\n\t */\n\t_publicMethods.getFocusableElements = function( element ) {\n\t\t// Set element to `document` root if not passed in\n\t\tif ( ! element ) { element = document; }\n\n\t\t// Get elements that are keyboard-focusable, but might be `disabled`\n\t\treturn element.querySelectorAll( _settings.focusableElementsSelector );\n\t}\n\n\t/**\n\t * Set the variables that track the current focused element and its value.\n\t */\n\t_publicMethods.setCurrentFocusedElementGlobalVariables = function() {\n\t\t// Set current focused element and value\n\t\twindow.fcCurrentFocusedElement = getCurrentFocusedElementGlobalVariables();\n\t\twindow.fcCurrentFocusedElementValue = window.fcCurrentFocusedElement.value;\n\t\twindow.fcCurrentFocusedElementReopenDropdown = false;\n\n\t\t// Maybe set to reopen dropdown after refocusing\n\t\t// Maybe close TomSelect dropdown when refocusing\n\t\tif ( fcCurrentFocusedElement.id.includes( '-ts-control' ) ) {\n\t\t\t// Get related select field\n\t\t\tvar formRow = fcCurrentFocusedElement.closest( _settings.tomSelectFormRowSelector );\n\t\t\tvar selectField = formRow && formRow.querySelector( 'select' );\n\n\t\t\t// Maybe set to reopen dropdown after refocusing\n\t\t\tif ( selectField && selectField.tomselect && selectField.tomselect.isOpen ) {\n\t\t\t\twindow.fcCurrentFocusedElementReopenDropdown = true;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Set the variables that track the current focused element and its value.\n\t */\n\t_publicMethods.maybeSetCurrentFocusedElementGlobalVariablesRelativeSelect2 = function() {\n\t\t// Set current focused element and value,\n\t\t// and retrieve relative `select2` field element if focus is on a `select2` field option.\n\t\tvar currentFocusedSelect2Element = getCurrentFocusedElementGlobalVariables( true );\n\n\t\t// Maybe set current focused element to relative `select2` field element\n\t\tif ( currentFocusedSelect2Element ) {\n\t\t\twindow.fcCurrentFocusedElement = currentFocusedSelect2Element;\n\t\t\twindow.fcCurrentFocusedElementValue = window.fcCurrentFocusedElement.value;\n\t\t}\n\t}\n\n\t/**\n\t * Unset the variables that track the current focused element and its value.\n\t */\n\t_publicMethods.unsetCurrentFocusedElementGlobalVariables = function() {\n\t\twindow.fcCurrentFocusedElement = null;\n\t\twindow.fcCurrentFocusedElementValue = null;\n\t}\n\n\t/**\n\t * Maybe set focus back to the element that was focused before an update.\n\t * \n\t * @param {HTMLElement} currentFocusedElement The element that was currently focused before an update.\n\t * @param {mixed} currentValue The value of the element in focus before an update.\n\t */\n\t_publicMethods.maybeRefocusElement = function( currentFocusedElement, currentValue ) {\n\t\t// Bail if no element to focus\n\t\tif ( null == currentFocusedElement ) { return; }\n\n\t\t// Bail if focus is set to the document body\n\t\tif ( document.body === currentFocusedElement ) { return; }\n\n\t\trequestAnimationFrame( function() {\n\t\t\tvar elementToFocus;\n\n\t\t\t// Try findind the `select2` focusable element\n\t\t\tif ( currentFocusedElement.closest( _settings.select2FormRowSelector ) ) {\n\t\t\t\tvar formRow = currentFocusedElement.closest( _settings.select2FormRowSelector );\n\t\t\t\telementToFocus = formRow.querySelector( _settings.select2FocusElementSelector );\n\t\t\t}\n\t\t\t// Try findind the updated element by id\n\t\t\telse if ( currentFocusedElement.id ) {\n\t\t\t\telementToFocus = document.getElementById( currentFocusedElement.id );\n\t\t\t}\n\t\t\t// Try findind the updated element by name attribute\n\t\t\telse if ( currentFocusedElement.getAttribute( 'name' ) ) {\n\t\t\t\tvar nameAttr = currentFocusedElement.getAttribute( 'name' );\n\t\t\t\telementToFocus = document.querySelector( '[name=\"'+nameAttr+'\"]' );\n\t\t\t}\n\n\t\t\t// Try setting focus if element is found\n\t\t\tif ( elementToFocus ) {\n\t\t\t\t// Get related select field\n\t\t\t\tvar formRow = elementToFocus.closest( _settings.tomSelectFormRowSelector );\n\t\t\t\tvar selectField = formRow && formRow.querySelector( 'select' );\n\n\t\t\t\t// Maybe set class for keeping dropdown closed\n\t\t\t\tif ( ! window.fcCurrentFocusedElementReopenDropdown && formRow ) {\n\t\t\t\t\tformRow.classList.add( _settings.tomSelectKeepingClosedClass );\n\t\t\t\t}\n\n\t\t\t\t// Set focus to element\n\t\t\t\telementToFocus.focus();\n\n\t\t\t\t// Try to set current value to the focused element\n\t\t\t\tif ( undefined !== currentValue && null !== currentValue && currentValue !== elementToFocus.value ) {\n\t\t\t\t\telementToFocus.value = currentValue;\n\t\t\t\t}\n\n\t\t\t\t// Set keyboard track position back to that previously to update\n\t\t\t\tsetTimeout( function(){\n\t\t\t\t\t// Try to set the same track position\n\t\t\t\t\tif ( null !== elementToFocus.selectionStart && null !== elementToFocus.selectionEnd ) {\n\t\t\t\t\t\tif ( currentFocusedElement.selectionStart && currentFocusedElement.selectionEnd ) {\n\t\t\t\t\t\t\telementToFocus.selectionStart = currentFocusedElement.selectionStart;\n\t\t\t\t\t\t\telementToFocus.selectionEnd = currentFocusedElement.selectionEnd;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise try set the track position to the end of the field\n\t\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n\t\t\t\t\t\t// @see https://html.spec.whatwg.org/multipage/input.html#concept-input-apply\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\telementToFocus.selectionStart = elementToFocus.selectionEnd = 999999;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Maybe close TomSelect dropdown when refocusing\n\t\t\t\t\tif ( ! window.fcCurrentFocusedElementReopenDropdown && elementToFocus.id.includes( '-ts-control' ) ) {\n\t\t\t\t\t\t// Maybe close TomSelect dropdown\n\t\t\t\t\t\tif ( selectField && selectField.tomselect ) {\n\t\t\t\t\t\t\tselectField.tomselect.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove TomSelect class for keeping dropdown closed\n\t\t\t\t\tif ( formRow ) {\n\t\t\t\t\t\tformRow.classList.remove( _settings.tomSelectKeepingClosedClass );\n\t\t\t\t\t}\n\t\t\t\t}, 0 );\n\t\t\t}\n\t\t} );\n\t};\n\n\n\n\t/**\n\t * Get the offset position of the element recursively adding the offset position of parent elements until the `stopElement` (or the `body` element).\n\t *\n\t * @param HTMLElement element Element to get the offset position for.\n\t * @param HTMLElement stopElement Parent element where to stop adding the offset position to the total offset top position of the element.\n\t *\n\t * @return int Offset position of the element until the `stopElement` or the `body` element.\n\t */\n\t_publicMethods.getOffsetTop = function( element, stopElement ) {\n\t\tvar offsetTop = 0;\n\n\t\twhile( element ) {\n\t\t\t// Reached the stopElement\n\t\t\tif ( stopElement && stopElement == element ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\toffsetTop += element.offsetTop;\n\t\t\telement = element.offsetParent;\n\t\t}\n\t\t\n\t\treturn offsetTop;\n\t}\n\n\t/**\n\t * Get the scroll offset position for the sticky elements.\n\t * \n\t * @param string includeOffsetSelector (optional) Selector for the elements to include in the offset position. Pass `0` or `false` to skip this parameter.\n\t * @param int addedOffsetAmount (optional) Added offset amount to the scroll position.\n\t */\n\t_publicMethods.getStickyElementsOffset = function( includeOffsetSelector, addedOffsetAmount ) {\n\t\tvar stickyElementsOffset = 0;\n\n\t\t// Maybe add height of the progress bar to scroll position\n\t\ttry {\n\t\t\tvar offsetItemsList = null !== includeOffsetSelector && undefined !== includeOffsetSelector ? document.querySelectorAll( includeOffsetSelector ) : [];\n\t\t\tif ( offsetItemsList.length > 0 ) {\n\t\t\t\tvar offsetItem = offsetItemsList[ 0 ];\n\t\t\t\tvar height = offsetItem.getBoundingClientRect().height;\n\t\t\t\tstickyElementsOffset += height;\n\t\t\t}\n\t\t}\n\t\tcatch ( error ) {\n\t\t\t// Do nothing\n\t\t}\n\n\t\t// Maybe add sticky elements height to scroll position\n\t\tif ( window.StickyStates ) {\n\t\t\tvar maybeStickyElements = document.querySelectorAll( _settings.scrollOffsetSelector );\n\t\t\tif ( maybeStickyElements && maybeStickyElements.length > 0 ) {\n\t\t\t\tfor ( var i = 0; i < maybeStickyElements.length; i++ ) {\n\t\t\t\t\tvar stickyElement = maybeStickyElements[i];\n\t\t\t\t\tif ( StickyStates.isStickyPosition( stickyElement ) ) {\n\t\t\t\t\t\tvar height = stickyElement.getBoundingClientRect().height;\n\t\t\t\t\t\tstickyElementsOffset += height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Maybe add arbitrary offset amount\n\t\tif ( ! isNaN( addedOffsetAmount ) ) {\n\t\t\tstickyElementsOffset += addedOffsetAmount;\n\t\t}\n\n\t\treturn stickyElementsOffset;\n\t}\n\n\t/**\n\t * Change scroll position to top of the element after the sticky elements.\n\t *\n\t * @param HTMLElement element The element of to scroll to.\n\t * @param string includeOffsetSelector (optional) Selector for the elements to include in the offset position. Pass `0` or `false` to skip this parameter.\n\t * @param int addedOffsetAmount (optional) Added offset amount to the scroll position.\n\t */\n\t_publicMethods.scrollToElement = function( element, includeOffsetSelector, addedOffsetAmount ) {\n\t\t// Bail if step element not provided\n\t\tif ( ! element ) { return; }\n\n\t\t// Get the offset position of the element\n\t\tvar stickyElementsOffset = _publicMethods.getStickyElementsOffset( includeOffsetSelector, addedOffsetAmount );\n\t\tvar elementOffset = _publicMethods.getOffsetTop( element ) + ( _settings.scrollOffset * -1 ) + ( stickyElementsOffset * -1 );\n\n\t\t// Scroll to the element, considering its offset position.\n\t\twindow.setTimeout( function() {\n\t\t\twindow.scrollTo( {\n\t\t\t\ttop: elementOffset,\n\t\t\t\tbehavior: _settings.scrollBehavior,\n\t\t\t} );\n\t\t}, _settings.scrollDelay );\n\t}\n\n\n\n\t/**\n\t * Expose public APIs.\n\t */\n\treturn _publicMethods;\n\n});\n"],"names":["root","factory","define","amd","exports","module","FCUtils","global","this","window","getCurrentFocusedElementGlobalVariables","setToRelativeSelect2","currentfocusedElement","document","activeElement","select2Options","closest","_settings","select2ElementId","getAttribute","replace","getElementById","currentFocusedFormRow","querySelector","blur","_publicMethods","mobile","minWidth","maxWidth","phablet","tablet","desktop","desktopMedium","desktopLarge","desktopExtraLarge","keyboardKeys","ESC","ENTER","SPACE","TAB","CAPS","SHIFT","FUNCTION","CONTROL","COMMAND_OR_WINDOWS","ALT","ARROW_LEFT","ARROW_RIGHT","ARROW_UP","ARROW_DOWN","animationEndEvent","whichAnimationEnd","extendObject","extended","deep","i","Object","prototype","toString","call","arguments","length","prop","obj","hasOwnProperty","debounce","func","wait","immediate","timeout","context","args","callNow","clearTimeout","setTimeout","apply","throttle","fn","threshhold","scope","last","deferTimer","now","Date","isElementVisible","element","offsetWidth","offsetHeight","getClientRects","getCurrentBreakpoints","windowWidth","innerWidth","breakpointSelectors","entries","currentBreakpoints","breakpoint","push","isCurrentBreakpointOrSmaller","targetBreakpoint","targetBreakpointIndex","indexOf","higherstBreakpointIndex","getFocusableElements","querySelectorAll","setCurrentFocusedElementGlobalVariables","selectField","fcCurrentFocusedElement","fcCurrentFocusedElementValue","value","fcCurrentFocusedElementReopenDropdown","id","includes","formRow","tomselect","isOpen","maybeSetCurrentFocusedElementGlobalVariablesRelativeSelect2","currentFocusedSelect2Element","unsetCurrentFocusedElementGlobalVariables","maybeRefocusElement","currentFocusedElement","currentValue","body","requestAnimationFrame","elementToFocus","nameAttr","classList","add","focus","undefined","selectionStart","selectionEnd","close","remove","getOffsetTop","stopElement","offsetTop","offsetParent","getStickyElementsOffset","includeOffsetSelector","addedOffsetAmount","stickyElementsOffset","offsetItemsList","getBoundingClientRect","height","error","StickyStates","maybeStickyElements","stickyElement","isStickyPosition","isNaN","scrollToElement","elementOffset","scrollTo","top","behavior"],"mappings":"AAGA,CAAA,SAAWA,EAAMC,GACO,YAAlB,OAAOC,QAAyBA,OAAOC,IAC3CD,OAAO,GAAID,EAAY,CAAC,EACM,UAAnB,OAAOG,QAClBC,OAAOD,QAAUH,EAAY,EAE7BD,EAAKM,QAAUL,EAAY,CAE5B,EAAoB,aAAlB,OAAOM,OAAyBA,OAASC,KAAKC,QAAUD,KAAKD,OAAQ,SAAUP,GAEjF,aA6E8C,SAA1CU,EAAoDC,GAEzB,CAAA,I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