\\n \\n '))},containerInner:function(e){return(0,o.strToEl)('\\n \\n '))},itemList:function(e,t){var i,n=(0,r.default)(e.list,(s(i={},e.listSingle,t),s(i,e.listItems,!t),i));return(0,o.strToEl)('\\n \\n '))},placeholder:function(e,t){return(0,o.strToEl)('\\n \\n ').concat(t,\"\\n
\\n \"))},item:function(e,t,i){var n,a,c=t.active?'aria-selected=\"true\"':\"\",l=t.disabled?'aria-disabled=\"true\"':\"\",u=(0,r.default)(e.item,(s(n={},e.highlightedState,t.highlighted),s(n,e.itemSelectable,!t.highlighted),s(n,e.placeholder,t.placeholder),n));return i?(u=(0,r.default)(e.item,(s(a={},e.highlightedState,t.highlighted),s(a,e.itemSelectable,!t.disabled),s(a,e.placeholder,t.placeholder),a)),(0,o.strToEl)('\\n \\n \").concat(t.label,'\\x3c!--\\n --\\x3e\\n
\\n \"))):(0,o.strToEl)('\\n \\n \").concat(t.label,\"\\n
\\n \"))},choiceList:function(e,t){var i=t?\"\":'aria-multiselectable=\"true\"';return(0,o.strToEl)('\\n \\n
\\n \"))},choiceGroup:function(e,t){var i=t.disabled?'aria-disabled=\"true\"':\"\",n=(0,r.default)(e.group,s({},e.itemDisabled,t.disabled));return(0,o.strToEl)('\\n \\n
').concat(t.value,\"
\\n
\\n \"))},choice:function(e,t,i){var n,a=t.groupId>0?'role=\"treeitem\"':'role=\"option\"',c=(0,r.default)(e.item,e.itemChoice,(s(n={},e.itemDisabled,t.disabled),s(n,e.itemSelectable,!t.disabled),s(n,e.placeholder,t.placeholder),n));return(0,o.strToEl)('\\n \\n \").concat(t.label,\"\\n
\\n \"))},input:function(e){var t=(0,r.default)(e.input,e.inputCloned);return(0,o.strToEl)('\\n \\n '))},dropdown:function(e){var t=(0,r.default)(e.list,e.listDropdown);return(0,o.strToEl)('\\n \\n
\\n '))},notice:function(e,t){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"\",a=(0,r.default)(e.item,e.itemChoice,(s(i={},e.noResults,\"no-results\"===n),s(i,e.noChoices,\"no-choices\"===n),i));return(0,o.strToEl)('\\n \\n ').concat(t,\"\\n
\\n \"))},option:function(e){return(0,o.strToEl)('\\n \\n \"))}};t.TEMPLATES=a;var c=a;t.default=c},function(e,t,i){\"use strict\";i.r(t);var n=i(8),r=\"object\"==typeof self&&self&&self.Object===Object&&self,o=(n.a||r||Function(\"return this\")()).Symbol,s=Object.prototype,a=s.hasOwnProperty,c=s.toString,l=o?o.toStringTag:void 0;var u=function(e){var t=a.call(e,l),i=e[l];try{e[l]=void 0;var n=!0}catch(e){}var r=c.call(e);return n&&(t?e[l]=i:delete e[l]),r},h=Object.prototype.toString;var d=function(e){return h.call(e)},f=\"[object Null]\",p=\"[object Undefined]\",v=o?o.toStringTag:void 0;var m=function(e){return null==e?void 0===e?p:f:v&&v in Object(e)?u(e):d(e)};var g=function(e,t){return function(i){return e(t(i))}}(Object.getPrototypeOf,Object);var _=function(e){return null!=e&&\"object\"==typeof e},y=\"[object Object]\",b=Function.prototype,E=Object.prototype,S=b.toString,I=E.hasOwnProperty,O=S.call(Object);var C=function(e){if(!_(e)||m(e)!=y)return!1;var t=g(e);if(null===t)return!0;var i=I.call(t,\"constructor\")&&t.constructor;return\"function\"==typeof i&&i instanceof i&&S.call(i)==O},T=i(2),w={INIT:\"@@redux/INIT\"};function k(e,t,i){var n;if(\"function\"==typeof t&&void 0===i&&(i=t,t=void 0),void 0!==i){if(\"function\"!=typeof i)throw new Error(\"Expected the enhancer to be a function.\");return i(k)(e,t)}if(\"function\"!=typeof e)throw new Error(\"Expected the reducer to be a function.\");var r=e,o=t,s=[],a=s,c=!1;function l(){a===s&&(a=s.slice())}function u(){return o}function h(e){if(\"function\"!=typeof e)throw new Error(\"Expected listener to be a function.\");var t=!0;return l(),a.push(e),function(){if(t){t=!1,l();var i=a.indexOf(e);a.splice(i,1)}}}function d(e){if(!C(e))throw new Error(\"Actions must be plain objects. Use custom middleware for async actions.\");if(void 0===e.type)throw new Error('Actions may not have an undefined \"type\" property. Have you misspelled a constant?');if(c)throw new Error(\"Reducers may not dispatch actions.\");try{c=!0,o=r(o,e)}finally{c=!1}for(var t=s=a,i=0;i0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(s)throw s;for(var n=!1,r={},a=0;a0&&void 0!==arguments[0]?arguments[0]:\"[data-choice]\",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),(0,p.isType)(\"String\",t)){var n=Array.from(document.querySelectorAll(t));if(n.length>1)return this._generateInstances(n,i)}this.config=r.default.all([a.DEFAULT_CONFIG,e.userDefaults,i],{arrayMerge:function(e,t){return[].concat(t)}});var c=(0,p.diff)(this.config,a.DEFAULT_CONFIG);c.length&&console.warn(\"Unknown config option(s) passed\",c.join(\", \")),[\"auto\",\"always\"].includes(this.config.renderSelectedChoices)||(this.config.renderSelectedChoices=\"auto\");var l=(0,p.isType)(\"String\",t)?document.querySelector(t):t;return l?(this._isTextElement=\"text\"===l.type,this._isSelectOneElement=\"select-one\"===l.type,this._isSelectMultipleElement=\"select-multiple\"===l.type,this._isSelectElement=this._isSelectOneElement||this._isSelectMultipleElement,this._isTextElement?this.passedElement=new s.WrappedInput({element:l,classNames:this.config.classNames,delimiter:this.config.delimiter}):this._isSelectElement&&(this.passedElement=new s.WrappedSelect({element:l,classNames:this.config.classNames})),this.passedElement?(!0===this.config.shouldSortItems&&this._isSelectOneElement&&!this.config.silent&&console.warn(\"shouldSortElements: Type of passed element is 'select-one', falling back to false.\"),this.initialised=!1,this._store=new o.default(this.render),this._initialState={},this._currentState={},this._prevState={},this._currentValue=\"\",this._canSearch=this.config.searchEnabled,this._isScrollingOnIe=!1,this._highlightPosition=0,this._wasTap=!0,this._placeholderValue=this._generatePlaceholderValue(),this._baseId=(0,p.generateId)(this.passedElement.element,\"choices-\"),this._direction=this.passedElement.element.getAttribute(\"dir\")||\"ltr\",this._idNames={itemChoice:\"item-choice\"},this._presetChoices=this.config.choices,this._presetItems=this.config.items,this.passedElement.value&&(this._presetItems=this._presetItems.concat(this.passedElement.value.split(this.config.delimiter))),this._render=this._render.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onClick=this._onClick.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onMouseDown=this._onMouseDown.bind(this),this._onMouseOver=this._onMouseOver.bind(this),this._onFormReset=this._onFormReset.bind(this),this._onAKey=this._onAKey.bind(this),this._onEnterKey=this._onEnterKey.bind(this),this._onEscapeKey=this._onEscapeKey.bind(this),this._onDirectionKey=this._onDirectionKey.bind(this),this._onDeleteKey=this._onDeleteKey.bind(this),\"active\"===this.passedElement.element.getAttribute(\"data-choice\")&&console.warn(\"Trying to initialise Choices on element already initialised\"),void this.init()):console.error(\"Passed element was of an invalid type\")):console.error(\"Could not find passed element or passed element was of an invalid type\")}var t,i,v;return t=e,(i=[{key:\"init\",value:function(){if(!this.initialised){this._createTemplates(),this._createElements(),this._createStructure(),this._initialState=(0,p.cloneObject)(this._store.state),this._store.subscribe(this._render),this._render(),this._addEventListeners(),(!this.config.addItems||this.passedElement.element.hasAttribute(\"disabled\"))&&this.disable(),this.initialised=!0;var e=this.config.callbackOnInit;e&&(0,p.isType)(\"Function\",e)&&e.call(this)}}},{key:\"destroy\",value:function(){this.initialised&&(this._removeEventListeners(),this.passedElement.reveal(),this.containerOuter.unwrap(this.passedElement.element),this._isSelectElement&&(this.passedElement.options=this._presetChoices),this.clearStore(),this.config.templates=null,this.initialised=!1)}},{key:\"enable\",value:function(){return this.passedElement.isDisabled&&this.passedElement.enable(),this.containerOuter.isDisabled&&(this._addEventListeners(),this.input.enable(),this.containerOuter.enable()),this}},{key:\"disable\",value:function(){return this.passedElement.isDisabled||this.passedElement.disable(),this.containerOuter.isDisabled||(this._removeEventListeners(),this.input.disable(),this.containerOuter.disable()),this}},{key:\"highlightItem\",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return this;var i=e.id,n=e.groupId,r=void 0===n?-1:n,o=e.value,s=void 0===o?\"\":o,c=e.label,l=void 0===c?\"\":c,h=r>=0?this._store.getGroupById(r):null;return this._store.dispatch((0,u.highlightItem)(i,!0)),t&&this.passedElement.triggerEvent(a.EVENTS.highlightItem,{id:i,value:s,label:l,groupValue:h&&h.value?h.value:null}),this}},{key:\"unhighlightItem\",value:function(e){if(!e)return this;var t=e.id,i=e.groupId,n=void 0===i?-1:i,r=e.value,o=void 0===r?\"\":r,s=e.label,c=void 0===s?\"\":s,l=n>=0?this._store.getGroupById(n):null;return this._store.dispatch((0,u.highlightItem)(t,!1)),this.passedElement.triggerEvent(a.EVENTS.highlightItem,{id:t,value:o,label:c,groupValue:l&&l.value?l.value:null}),this}},{key:\"highlightAll\",value:function(){var e=this;return this._store.items.forEach(function(t){return e.highlightItem(t)}),this}},{key:\"unhighlightAll\",value:function(){var e=this;return this._store.items.forEach(function(t){return e.unhighlightItem(t)}),this}},{key:\"removeActiveItemsByValue\",value:function(e){var t=this;return this._store.activeItems.filter(function(t){return t.value===e}).forEach(function(e){return t._removeItem(e)}),this}},{key:\"removeActiveItems\",value:function(e){var t=this;return this._store.activeItems.filter(function(t){return t.id!==e}).forEach(function(e){return t._removeItem(e)}),this}},{key:\"removeHighlightedItems\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._store.highlightedActiveItems.forEach(function(i){e._removeItem(i),t&&e._triggerChange(i.value)}),this}},{key:\"showDropdown\",value:function(e){var t=this;return this.dropdown.isActive?this:(requestAnimationFrame(function(){t.dropdown.show(),t.containerOuter.open(t.dropdown.distanceFromTopWindow()),!e&&t._canSearch&&t.input.focus(),t.passedElement.triggerEvent(a.EVENTS.showDropdown,{})}),this)}},{key:\"hideDropdown\",value:function(e){var t=this;return this.dropdown.isActive?(requestAnimationFrame(function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent(a.EVENTS.hideDropdown,{})}),this):this}},{key:\"getValue\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._store.activeItems.reduce(function(t,i){var n=e?i.value:i;return t.push(n),t},[]);return this._isSelectOneElement?t[0]:t}},{key:\"setValue\",value:function(e){var t=this;return this.initialised?([].concat(e).forEach(function(e){return t._setChoiceOrItem(e)}),this):this}},{key:\"setChoiceByValue\",value:function(e){var t=this;return!this.initialised||this._isTextElement?this:(((0,p.isType)(\"Array\",e)?e:[e]).forEach(function(e){return t._findAndSelectChoiceByValue(e)}),this)}},{key:\"setChoices\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"\",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!this._isSelectElement||!t.length||!i)return this;r&&this._clearChoices(),this.containerOuter.removeLoadingState();return this._setLoading(!0),t.forEach(function(t){t.choices?e._addGroup({group:t,id:t.id||null,valueKey:i,labelKey:n}):e._addChoice({value:t[i],label:t[n],isSelected:t.selected,isDisabled:t.disabled,customProperties:t.customProperties,placeholder:t.placeholder})}),this._setLoading(!1),this}},{key:\"clearStore\",value:function(){return this._store.dispatch((0,d.clearAll)()),this}},{key:\"clearInput\",value:function(){var e=!this._isSelectOneElement;return this.input.clear(e),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch((0,l.activateChoices)(!0))),this}},{key:\"ajax\",value:function(e){var t=this;return this.initialised&&this._isSelectElement&&e?(requestAnimationFrame(function(){return t._handleLoadingState(!0)}),e(this._ajaxCallback()),this):this}},{key:\"_render\",value:function(){if(!this._store.isLoading()){this._currentState=this._store.state;var e=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,t=this._isSelectElement,i=this._currentState.items!==this._prevState.items;e&&(t&&this._renderChoices(),i&&this._renderItems(),this._prevState=this._currentState)}}},{key:\"_renderChoices\",value:function(){var e=this,t=this._store,i=t.activeGroups,n=t.activeChoices,r=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame(function(){return e.choiceList.scrollToTop()}),i.length>=1&&!this._isSearching){var o=n.filter(function(e){return!0===e.placeholder&&-1===e.groupId});o.length>=1&&(r=this._createChoicesFragment(o,r)),r=this._createGroupsFragment(i,n,r)}else n.length>=1&&(r=this._createChoicesFragment(n,r));if(r.childNodes&&r.childNodes.length>0){var s=this._store.activeItems,a=this._canAddItem(s,this.input.value);a.response?(this.choiceList.append(r),this._highlightChoice()):this.choiceList.append(this._getTemplate(\"notice\",a.notice))}else{var c,l;this._isSearching?(l=(0,p.isType)(\"Function\",this.config.noResultsText)?this.config.noResultsText():this.config.noResultsText,c=this._getTemplate(\"notice\",l,\"no-results\")):(l=(0,p.isType)(\"Function\",this.config.noChoicesText)?this.config.noChoicesText():this.config.noChoicesText,c=this._getTemplate(\"notice\",l,\"no-choices\")),this.choiceList.append(c)}}},{key:\"_renderItems\",value:function(){var e=this._store.activeItems||[];this.itemList.clear();var t=this._createItemsFragment(e);t.childNodes&&this.itemList.append(t)}},{key:\"_createGroupsFragment\",value:function(e,t,i){var n=this,r=i||document.createDocumentFragment();return this.config.shouldSort&&e.sort(this.config.sortFn),e.forEach(function(e){var i=function(e){return t.filter(function(t){return n._isSelectOneElement?t.groupId===e.id:t.groupId===e.id&&(\"always\"===n.config.renderSelectedChoices||!t.selected)})}(e);if(i.length>=1){var o=n._getTemplate(\"choiceGroup\",e);r.appendChild(o),n._createChoicesFragment(i,r,!0)}}),r}},{key:\"_createChoicesFragment\",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t||document.createDocumentFragment(),o=this.config,s=o.renderSelectedChoices,a=o.searchResultLimit,c=o.renderChoiceLimit,l=this._isSearching?p.sortByScore:this.config.sortFn,u=function(e){if(\"auto\"!==s||(i._isSelectOneElement||!e.selected)){var t=i._getTemplate(\"choice\",e,i.config.itemSelectText);r.appendChild(t)}},h=e;\"auto\"!==s||this._isSelectOneElement||(h=e.filter(function(e){return!e.selected}));var d=h.reduce(function(e,t){return t.placeholder?e.placeholderChoices.push(t):e.normalChoices.push(t),e},{placeholderChoices:[],normalChoices:[]}),f=d.placeholderChoices,v=d.normalChoices;(this.config.shouldSort||this._isSearching)&&v.sort(l);var m=h.length,g=[].concat(f,v);this._isSearching?m=a:c>0&&!n&&(m=c);for(var _=0;_1&&void 0!==arguments[1]?arguments[1]:null,n=this.config,r=n.shouldSortItems,o=n.sortFn,s=n.removeItemButton,a=i||document.createDocumentFragment();r&&!this._isSelectOneElement&&e.sort(o),this._isTextElement?this.passedElement.value=e:this.passedElement.options=e;return e.forEach(function(e){return function(e){var i=t._getTemplate(\"item\",e,s);a.appendChild(i)}(e)}),a}},{key:\"_triggerChange\",value:function(e){null!=e&&this.passedElement.triggerEvent(a.EVENTS.change,{value:e})}},{key:\"_selectPlaceholderChoice\",value:function(){var e=this._store.placeholderChoice;e&&(this._addItem({value:e.value,label:e.label,choiceId:e.id,groupId:e.groupId,placeholder:e.placeholder}),this._triggerChange(e.value))}},{key:\"_handleButtonAction\",value:function(e,t){if(e&&t&&this.config.removeItems&&this.config.removeItemButton){var i=t.parentNode.getAttribute(\"data-id\"),n=e.find(function(e){return e.id===parseInt(i,10)});this._removeItem(n),this._triggerChange(n.value),this._isSelectOneElement&&this._selectPlaceholderChoice()}}},{key:\"_handleItemAction\",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e&&t&&this.config.removeItems&&!this._isSelectOneElement){var r=t.getAttribute(\"data-id\");e.forEach(function(e){e.id!==parseInt(r,10)||e.highlighted?!n&&e.highlighted&&i.unhighlightItem(e):i.highlightItem(e)}),this.input.focus()}}},{key:\"_handleChoiceAction\",value:function(e,t){if(e&&t){var i=t.getAttribute(\"data-id\"),n=this._store.getChoiceById(i),r=e[0]&&e[0].keyCode?e[0].keyCode:null,o=this.dropdown.isActive;if(n.keyCode=r,this.passedElement.triggerEvent(a.EVENTS.choice,{choice:n}),n&&!n.selected&&!n.disabled)this._canAddItem(e,n.value).response&&(this._addItem({value:n.value,label:n.label,choiceId:n.id,groupId:n.groupId,customProperties:n.customProperties,placeholder:n.placeholder,keyCode:n.keyCode}),this._triggerChange(n.value));this.clearInput(),o&&this._isSelectOneElement&&(this.hideDropdown(!0),this.containerOuter.focus())}}},{key:\"_handleBackspace\",value:function(e){if(this.config.removeItems&&e){var t=e[e.length-1],i=e.some(function(e){return e.highlighted});this.config.editItems&&!i&&t?(this.input.value=t.value,this.input.setWidth(),this._removeItem(t),this._triggerChange(t.value)):(i||this.highlightItem(t,!1),this.removeHighlightedItems(!0))}}},{key:\"_setLoading\",value:function(e){this._store.dispatch((0,f.setIsLoading)(e))}},{key:\"_handleLoadingState\",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.itemList.getChild(\".\".concat(this.config.classNames.placeholder));e?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?t?t.innerHTML=this.config.loadingText:(t=this._getTemplate(\"placeholder\",this.config.loadingText),this.itemList.append(t)):this.input.placeholder=this.config.loadingText):(this.enable(),this.containerOuter.removeLoadingState(),this._isSelectOneElement?t.innerHTML=this._placeholderValue||\"\":this.input.placeholder=this._placeholderValue||\"\")}},{key:\"_handleSearch\",value:function(e){if(e&&this.input.isFocussed){var t=this._store.choices,i=this.config,n=i.searchFloor,r=i.searchChoices,o=t.some(function(e){return!e.active});if(e&&e.length>=n){var s=r?this._searchChoices(e):0;this.passedElement.triggerEvent(a.EVENTS.search,{value:e,resultCount:s})}else o&&(this._isSearching=!1,this._store.dispatch((0,l.activateChoices)(!0)))}}},{key:\"_canAddItem\",value:function(e,t){var i=!0,n=(0,p.isType)(\"Function\",this.config.addItemText)?this.config.addItemText(t):this.config.addItemText;if(!this._isSelectOneElement){var r=(0,p.existsInArray)(e,t);this.config.maxItemCount>0&&this.config.maxItemCount<=e.length&&(i=!1,n=(0,p.isType)(\"Function\",this.config.maxItemText)?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&r&&i&&(i=!1,n=(0,p.isType)(\"Function\",this.config.uniqueItemText)?this.config.uniqueItemText(t):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&i&&(0,p.isType)(\"Function\",this.config.addItemFilterFn)&&!this.config.addItemFilterFn(t)&&(i=!1,n=(0,p.isType)(\"Function\",this.config.customAddItemText)?this.config.customAddItemText(t):this.config.customAddItemText)}return{response:i,notice:n}}},{key:\"_ajaxCallback\",value:function(){var e=this;return function(t,i,n){if(t&&i){var r=(0,p.isType)(\"Object\",t)?[t]:t;r&&(0,p.isType)(\"Array\",r)&&r.length?(e._handleLoadingState(!1),e._setLoading(!0),r.forEach(function(t){t.choices?e._addGroup({group:t,id:t.id||null,valueKey:i,labelKey:n}):e._addChoice({value:(0,p.fetchFromObject)(t,i),label:(0,p.fetchFromObject)(t,n),isSelected:t.selected,isDisabled:t.disabled,customProperties:t.customProperties,placeholder:t.placeholder})}),e._setLoading(!1),e._isSelectOneElement&&e._selectPlaceholderChoice()):e._handleLoadingState(!1)}}}},{key:\"_searchChoices\",value:function(e){var t=(0,p.isType)(\"String\",e)?e.trim():e,i=(0,p.isType)(\"String\",this._currentValue)?this._currentValue.trim():this._currentValue;if(t.length<1&&t===\"\".concat(i,\" \"))return 0;var r=this._store.searchableChoices,o=t,s=[].concat(this.config.searchFields),a=Object.assign(this.config.fuseOptions,{keys:s}),c=new n.default(r,a).search(o);return this._currentValue=t,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch((0,l.filterChoices)(c)),c.length}},{key:\"_addEventListeners\",value:function(){document.addEventListener(\"keyup\",this._onKeyUp),document.addEventListener(\"keydown\",this._onKeyDown),document.addEventListener(\"click\",this._onClick),document.addEventListener(\"touchmove\",this._onTouchMove),document.addEventListener(\"touchend\",this._onTouchEnd),document.addEventListener(\"mousedown\",this._onMouseDown),document.addEventListener(\"mouseover\",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.addEventListener(\"focus\",this._onFocus),this.containerOuter.element.addEventListener(\"blur\",this._onBlur)),this.input.element.addEventListener(\"focus\",this._onFocus),this.input.element.addEventListener(\"blur\",this._onBlur),this.input.element.form&&this.input.element.form.addEventListener(\"reset\",this._onFormReset),this.input.addEventListeners()}},{key:\"_removeEventListeners\",value:function(){document.removeEventListener(\"keyup\",this._onKeyUp),document.removeEventListener(\"keydown\",this._onKeyDown),document.removeEventListener(\"click\",this._onClick),document.removeEventListener(\"touchmove\",this._onTouchMove),document.removeEventListener(\"touchend\",this._onTouchEnd),document.removeEventListener(\"mousedown\",this._onMouseDown),document.removeEventListener(\"mouseover\",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener(\"focus\",this._onFocus),this.containerOuter.element.removeEventListener(\"blur\",this._onBlur)),this.input.element.removeEventListener(\"focus\",this._onFocus),this.input.element.removeEventListener(\"blur\",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener(\"reset\",this._onFormReset),this.input.removeEventListeners()}},{key:\"_onKeyDown\",value:function(e){var t,i=e.target,n=e.keyCode,r=e.ctrlKey,o=e.metaKey;if(i===this.input.element||this.containerOuter.element.contains(i)){var s=this._store.activeItems,c=this.input.isFocussed,l=this.dropdown.isActive,u=this.itemList.hasChildren,h=String.fromCharCode(n),d=a.KEY_CODES.BACK_KEY,f=a.KEY_CODES.DELETE_KEY,p=a.KEY_CODES.ENTER_KEY,v=a.KEY_CODES.A_KEY,g=a.KEY_CODES.ESC_KEY,_=a.KEY_CODES.UP_KEY,y=a.KEY_CODES.DOWN_KEY,b=a.KEY_CODES.PAGE_UP_KEY,E=a.KEY_CODES.PAGE_DOWN_KEY,S=r||o;!this._isTextElement&&/[a-zA-Z0-9-_ ]/.test(h)&&this.showDropdown();var I=(m(t={},v,this._onAKey),m(t,p,this._onEnterKey),m(t,g,this._onEscapeKey),m(t,_,this._onDirectionKey),m(t,b,this._onDirectionKey),m(t,y,this._onDirectionKey),m(t,E,this._onDirectionKey),m(t,f,this._onDeleteKey),m(t,d,this._onDeleteKey),t);I[n]&&I[n]({event:e,target:i,keyCode:n,metaKey:o,activeItems:s,hasFocusedInput:c,hasActiveDropdown:l,hasItems:u,hasCtrlDownKeyPressed:S})}}},{key:\"_onKeyUp\",value:function(e){var t=e.target,i=e.keyCode;if(t===this.input.element){var n=this.input.value,r=this._store.activeItems,o=this._canAddItem(r,n),s=a.KEY_CODES.BACK_KEY,c=a.KEY_CODES.DELETE_KEY;if(this._isTextElement){if(o.notice&&n){var u=this._getTemplate(\"notice\",o.notice);this.dropdown.element.innerHTML=u.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0)}else{var h=(i===s||i===c)&&!t.value,d=!this._isTextElement&&this._isSearching,f=this._canSearch&&o.response;h&&d?(this._isSearching=!1,this._store.dispatch((0,l.activateChoices)(!0))):f&&this._handleSearch(this.input.value)}this._canSearch=this.config.searchEnabled}}},{key:\"_onAKey\",value:function(e){var t=e.hasItems;e.hasCtrlDownKeyPressed&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())}},{key:\"_onEnterKey\",value:function(e){var t=e.event,i=e.target,n=e.activeItems,r=e.hasActiveDropdown,o=a.KEY_CODES.ENTER_KEY,s=i.hasAttribute(\"data-button\");if(this._isTextElement&&i.value){var c=this.input.value;this._canAddItem(n,c).response&&(this.hideDropdown(!0),this._addItem({value:c}),this._triggerChange(c),this.clearInput())}if(s&&(this._handleButtonAction(n,i),t.preventDefault()),r){var l=this.dropdown.getChild(\".\".concat(this.config.classNames.highlightedState));l&&(n[0]&&(n[0].keyCode=o),this._handleChoiceAction(n,l)),t.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),t.preventDefault())}},{key:\"_onEscapeKey\",value:function(e){e.hasActiveDropdown&&(this.hideDropdown(!0),this.containerOuter.focus())}},{key:\"_onDirectionKey\",value:function(e){var t=e.event,i=e.hasActiveDropdown,n=e.keyCode,r=e.metaKey,o=a.KEY_CODES.DOWN_KEY,s=a.KEY_CODES.PAGE_UP_KEY,c=a.KEY_CODES.PAGE_DOWN_KEY;if(i||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var l,u=n===o||n===c?1:-1;if(r||n===c||n===s)l=u>0?Array.from(this.dropdown.element.querySelectorAll(\"[data-choice-selectable]\")).pop():this.dropdown.element.querySelector(\"[data-choice-selectable]\");else{var h=this.dropdown.element.querySelector(\".\".concat(this.config.classNames.highlightedState));l=h?(0,p.getAdjacentEl)(h,\"[data-choice-selectable]\",u):this.dropdown.element.querySelector(\"[data-choice-selectable]\")}l&&((0,p.isScrolledIntoView)(l,this.choiceList.element,u)||this.choiceList.scrollToChoice(l,u),this._highlightChoice(l)),t.preventDefault()}}},{key:\"_onDeleteKey\",value:function(e){var t=e.event,i=e.target,n=e.hasFocusedInput,r=e.activeItems;!n||i.value||this._isSelectOneElement||(this._handleBackspace(r),t.preventDefault())}},{key:\"_onTouchMove\",value:function(){this._wasTap&&(this._wasTap=!1)}},{key:\"_onTouchEnd\",value:function(e){var t=(e||e.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(t)&&((t===this.containerOuter.element||t===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation());this._wasTap=!0}},{key:\"_onMouseDown\",value:function(e){var t=e.target,i=e.shiftKey;if(t===this.choiceList&&(0,p.isIE11)()&&(this._isScrollingOnIe=!0),this.containerOuter.element.contains(t)&&t!==this.input.element){var n=this._store.activeItems,r=i,o=(0,p.findAncestorByAttrName)(t,\"data-button\"),s=(0,p.findAncestorByAttrName)(t,\"data-item\"),a=(0,p.findAncestorByAttrName)(t,\"data-choice\");o?this._handleButtonAction(n,o):s?this._handleItemAction(n,s,r):a&&this._handleChoiceAction(n,a),e.preventDefault()}}},{key:\"_onMouseOver\",value:function(e){var t=e.target;(t===this.dropdown||this.dropdown.element.contains(t))&&t.hasAttribute(\"data-choice\")&&this._highlightChoice(t)}},{key:\"_onClick\",value:function(e){var t=e.target;this.containerOuter.element.contains(t)?this.dropdown.isActive||this.containerOuter.isDisabled?this._isSelectOneElement&&t!==this.input.element&&!this.dropdown.element.contains(t)&&this.hideDropdown():this._isTextElement?document.activeElement!==this.input.element&&this.input.focus():(this.showDropdown(),this.containerOuter.focus()):(this._store.highlightedActiveItems&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))}},{key:\"_onFocus\",value:function(e){var t=this,i=e.target;this.containerOuter.element.contains(i)&&{text:function(){i===t.input.element&&t.containerOuter.addFocusState()},\"select-one\":function(){t.containerOuter.addFocusState(),i===t.input.element&&t.showDropdown(!0)},\"select-multiple\":function(){i===t.input.element&&(t.showDropdown(!0),t.containerOuter.addFocusState())}}[this.passedElement.element.type]()}},{key:\"_onBlur\",value:function(e){var t=this,i=e.target;if(this.containerOuter.element.contains(i)&&!this._isScrollingOnIe){var n=this._store.activeItems.some(function(e){return e.highlighted});({text:function(){i===t.input.element&&(t.containerOuter.removeFocusState(),n&&t.unhighlightAll(),t.hideDropdown(!0))},\"select-one\":function(){t.containerOuter.removeFocusState(),(i===t.input.element||i===t.containerOuter.element&&!t._canSearch)&&t.hideDropdown(!0)},\"select-multiple\":function(){i===t.input.element&&(t.containerOuter.removeFocusState(),t.hideDropdown(!0),n&&t.unhighlightAll())}})[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()}},{key:\"_onFormReset\",value:function(){this._store.dispatch((0,d.resetTo)(this._initialState))}},{key:\"_highlightChoice\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=Array.from(this.dropdown.element.querySelectorAll(\"[data-choice-selectable]\"));if(i.length){var n=t;Array.from(this.dropdown.element.querySelectorAll(\".\".concat(this.config.classNames.highlightedState))).forEach(function(t){t.classList.remove(e.config.classNames.highlightedState),t.setAttribute(\"aria-selected\",\"false\")}),n?this._highlightPosition=i.indexOf(n):(n=i.length>this._highlightPosition?i[this._highlightPosition]:i[i.length-1])||(n=i[0]),n.classList.add(this.config.classNames.highlightedState),n.setAttribute(\"aria-selected\",\"true\"),this.passedElement.triggerEvent(a.EVENTS.highlightChoice,{el:n}),this.dropdown.isActive&&(this.input.setActiveDescendant(n.id),this.containerOuter.setActiveDescendant(n.id))}}},{key:\"_addItem\",value:function(e){var t=e.value,i=e.label,n=void 0===i?null:i,r=e.choiceId,o=void 0===r?-1:r,s=e.groupId,c=void 0===s?-1:s,l=e.customProperties,h=void 0===l?null:l,d=e.placeholder,f=void 0!==d&&d,v=e.keyCode,m=void 0===v?null:v,g=(0,p.isType)(\"String\",t)?t.trim():t,_=m,y=h,b=this._store.items,E=n||g,S=parseInt(o,10)||-1,I=c>=0?this._store.getGroupById(c):null,O=b?b.length+1:1;return this.config.prependValue&&(g=this.config.prependValue+g.toString()),this.config.appendValue&&(g+=this.config.appendValue.toString()),this._store.dispatch((0,u.addItem)({value:g,label:E,id:O,choiceId:S,groupId:c,customProperties:h,placeholder:f,keyCode:_})),this._isSelectOneElement&&this.removeActiveItems(O),this.passedElement.triggerEvent(a.EVENTS.addItem,{id:O,value:g,label:E,customProperties:y,groupValue:I&&I.value?I.value:void 0,keyCode:_}),this}},{key:\"_removeItem\",value:function(e){if(!e||!(0,p.isType)(\"Object\",e))return this;var t=e.id,i=e.value,n=e.label,r=e.choiceId,o=e.groupId,s=o>=0?this._store.getGroupById(o):null;return this._store.dispatch((0,u.removeItem)(t,r)),s&&s.value?this.passedElement.triggerEvent(a.EVENTS.removeItem,{id:t,value:i,label:n,groupValue:s.value}):this.passedElement.triggerEvent(a.EVENTS.removeItem,{id:t,value:i,label:n}),this}},{key:\"_addChoice\",value:function(e){var t=e.value,i=e.label,n=void 0===i?null:i,r=e.isSelected,o=void 0!==r&&r,s=e.isDisabled,a=void 0!==s&&s,c=e.groupId,u=void 0===c?-1:c,h=e.customProperties,d=void 0===h?null:h,f=e.placeholder,p=void 0!==f&&f,v=e.keyCode,m=void 0===v?null:v;if(null!=t){var g=this._store.choices,_=n||t,y=g?g.length+1:1,b=\"\".concat(this._baseId,\"-\").concat(this._idNames.itemChoice,\"-\").concat(y);this._store.dispatch((0,l.addChoice)({value:t,label:_,id:y,groupId:u,disabled:a,elementId:b,customProperties:d,placeholder:p,keyCode:m})),o&&this._addItem({value:t,label:_,choiceId:y,customProperties:d,placeholder:p,keyCode:m})}}},{key:\"_clearChoices\",value:function(){this._store.dispatch((0,l.clearChoices)())}},{key:\"_addGroup\",value:function(e){var t=this,i=e.group,n=e.id,r=e.valueKey,o=void 0===r?\"value\":r,s=e.labelKey,a=void 0===s?\"label\":s,c=(0,p.isType)(\"Object\",i)?i.choices:Array.from(i.getElementsByTagName(\"OPTION\")),l=n||Math.floor((new Date).valueOf()*Math.random()),u=!!i.disabled&&i.disabled;if(c){this._store.dispatch((0,h.addGroup)(i.label,l,!0,u));c.forEach(function(e){var i=e.disabled||e.parentNode&&e.parentNode.disabled;t._addChoice({value:e[o],label:(0,p.isType)(\"Object\",e)?e[a]:e.innerHTML,isSelected:e.selected,isDisabled:i,groupId:l,customProperties:e.customProperties,placeholder:e.placeholder})})}else this._store.dispatch((0,h.addGroup)(i.label,i.id,!1,i.disabled))}},{key:\"_getTemplate\",value:function(e){var t;if(!e)return null;for(var i=this.config,n=i.templates,r=i.classNames,o=arguments.length,s=new Array(o>1?o-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=[],n=-1,r=-1,o=0,s=e.length;o=t&&i.push([n,r]),n=-1)}return e[o-1]&&o-n>=t&&i.push([n,o-1]),i}},\"./src/bitap/bitap_pattern_alphabet.js\":\n/*!*********************************************!*\\\n !*** ./src/bitap/bitap_pattern_alphabet.js ***!\n \\*********************************************/\n/*! no static exports found */function(e,t){e.exports=function(e){for(var t={},i=e.length,n=0;n2&&void 0!==arguments[2]?arguments[2]:/ +/g,r=new RegExp(t.replace(i,\"\\\\$&\").replace(n,\"|\")),o=e.match(r),s=!!o,a=[];if(s)for(var c=0,l=o.length;c=x;M-=1){var N=M-1,F=i[e.charAt(N)];if(F&&(E[N]=1),j[M]=(j[M+1]<<1|1)&F,0!==A&&(j[M]|=(C[M+1]|C[M])<<1|1|C[M+1]),j[M]&k&&(T=n(t,{errors:A,currentLocation:N,expectedLocation:m,distance:l}))<=_){if(_=T,(y=N)<=m)break;x=Math.max(1,2*m-y)}}if(n(t,{errors:A+1,currentLocation:m,expectedLocation:m,distance:l})>_)break;C=j}return{isMatch:y>=0,score:0===T?.001:T,matchedIndices:r(E,v)}}},\"./src/bitap/index.js\":\n/*!****************************!*\\\n !*** ./src/bitap/index.js ***!\n \\****************************/\n/*! no static exports found */function(e,t,i){function n(e,t){for(var i=0;ii)return r(e,this.pattern,n);var s=this.options,a=s.location,c=s.distance,l=s.threshold,u=s.findAllMatches,h=s.minMatchCharLength;return o(e,this.pattern,this.patternAlphabet,{location:a,distance:c,threshold:l,findAllMatches:u,minMatchCharLength:h})}}])&&n(t.prototype,i),a&&n(t,a),e}();e.exports=a},\"./src/helpers/deep_value.js\":\n/*!***********************************!*\\\n !*** ./src/helpers/deep_value.js ***!\n \\***********************************/\n/*! no static exports found */function(e,t,i){var n=i(/*! ./is_array */\"./src/helpers/is_array.js\");e.exports=function(e,t){return function e(t,i,r){if(i){var o=i.indexOf(\".\"),s=i,a=null;-1!==o&&(s=i.slice(0,o),a=i.slice(o+1));var c=t[s];if(null!=c)if(a||\"string\"!=typeof c&&\"number\"!=typeof c)if(n(c))for(var l=0,u=c.length;l1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log('---------\\nSearch pattern: \"'.concat(e,'\"'));var i=this._prepareSearchers(e),n=i.tokenSearchers,r=i.fullSearcher,o=this._search(n,r),s=o.weights,a=o.results;return this._computeScore(s,a),this.options.shouldSort&&this._sort(a),t.limit&&\"number\"==typeof t.limit&&(a=a.slice(0,t.limit)),this._format(a)}},{key:\"_prepareSearchers\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\",t=[];if(this.options.tokenize)for(var i=e.split(this.options.tokenSeparator),n=0,r=i.length;n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,i=this.list,n={},r=[];if(\"string\"==typeof i[0]){for(var o=0,s=i.length;o1)throw new Error(\"Key weight has to be > 0 and <= 1\");f=f.name}else a[f]={weight:1};this._analyze({key:f,value:this.options.getFn(u,f),record:u,index:c},{resultMap:n,results:r,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:r}}},{key:\"_analyze\",value:function(e,t){var i=e.key,n=e.arrayIndex,r=void 0===n?-1:n,o=e.value,s=e.record,c=e.index,l=t.tokenSearchers,u=void 0===l?[]:l,h=t.fullSearcher,d=void 0===h?[]:h,f=t.resultMap,p=void 0===f?{}:f,v=t.results,m=void 0===v?[]:v;if(null!=o){var g=!1,_=-1,y=0;if(\"string\"==typeof o){this._log(\"\\nKey: \".concat(\"\"===i?\"-\":i));var b=d.search(o);if(this._log('Full text: \"'.concat(o,'\", score: ').concat(b.score)),this.options.tokenize){for(var E=o.split(this.options.tokenSeparator),S=[],I=0;I-1&&(x=(x+_)/2),this._log(\"Score average:\",x);var D=!this.options.tokenize||!this.options.matchAllTokens||y>=u.length;if(this._log(\"\\nCheck Matches: \".concat(D)),(g||b.isMatch)&&D){var j=p[c];j?j.output.push({key:i,arrayIndex:r,value:o,score:x,matchedIndices:b.matchedIndices}):(p[c]={item:s,output:[{key:i,arrayIndex:r,value:o,score:x,matchedIndices:b.matchedIndices}]},m.push(p[c]))}}else if(a(o))for(var M=0,N=o.length;M-1&&(s.arrayIndex=o.arrayIndex),t.matches.push(s)}}}),this.options.includeScore&&r.push(function(e,t){t.score=e.score});for(var o=0,s=e.length;o0&&void 0!==arguments[0]?arguments[0]:n,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case\"ADD_ITEM\":var i=[].concat(e,[{id:t.id,choiceId:t.choiceId,groupId:t.groupId,value:t.value,label:t.label,active:!0,highlighted:!1,customProperties:t.customProperties,placeholder:t.placeholder||!1,keyCode:null}]);return i.map(function(e){var t=e;return t.highlighted=!1,t});case\"REMOVE_ITEM\":return e.map(function(e){var i=e;return i.id===t.id&&(i.active=!1),i});case\"HIGHLIGHT_ITEM\":return e.map(function(e){var i=e;return i.id===t.id&&(i.highlighted=t.highlighted),i});default:return e}},t.defaultState=void 0;var n=[];t.defaultState=n},function(e,t,i){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case\"ADD_GROUP\":return[].concat(e,[{id:t.id,value:t.value,active:t.active,disabled:t.disabled}]);case\"CLEAR_CHOICES\":return[];default:return e}},t.defaultState=void 0;var n=[];t.defaultState=n},function(e,t,i){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case\"ADD_CHOICE\":return[].concat(e,[{id:t.id,elementId:t.elementId,groupId:t.groupId,value:t.value,label:t.label||t.value,disabled:t.disabled||!1,selected:!1,active:!0,score:9999,customProperties:t.customProperties,placeholder:t.placeholder||!1,keyCode:null}]);case\"ADD_ITEM\":return t.activateOptions?e.map(function(e){var i=e;return i.active=t.active,i}):t.choiceId>-1?e.map(function(e){var i=e;return i.id===parseInt(t.choiceId,10)&&(i.selected=!0),i}):e;case\"REMOVE_ITEM\":return t.choiceId>-1?e.map(function(e){var i=e;return i.id===parseInt(t.choiceId,10)&&(i.selected=!1),i}):e;case\"FILTER_CHOICES\":return e.map(function(e){var i=e;return i.active=t.results.some(function(e){var t=e.item,n=e.score;return t.id===i.id&&(i.score=n,!0)}),i});case\"ACTIVATE_CHOICES\":return e.map(function(e){var i=e;return i.active=t.active,i});case\"CLEAR_CHOICES\":return n;default:return e}},t.defaultState=void 0;var n=[];t.defaultState=n},function(e,t,i){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=t.defaultState=void 0;var n={loading:!1};t.defaultState=n;var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case\"SET_IS_LOADING\":return{loading:t.isLoading};default:return e}};t.default=r},function(e,t,i){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),Object.defineProperty(t,\"Dropdown\",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,\"Container\",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,\"Input\",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,\"List\",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,\"WrappedInput\",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,\"WrappedSelect\",{enumerable:!0,get:function(){return c.default}});var n=l(i(23)),r=l(i(24)),o=l(i(25)),s=l(i(26)),a=l(i(27)),c=l(i(28));function l(e){return e&&e.__esModule?e:{default:e}}},function(e,t,i){\"use strict\";function n(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:(0,n.getWindowHeight)();if(void 0===e)return!1;var i=!1;return\"auto\"===this.position?i=e>=t:\"top\"===this.position&&(i=!0),i}},{key:\"setActiveDescendant\",value:function(e){this.element.setAttribute(\"aria-activedescendant\",e)}},{key:\"removeActiveDescendant\",value:function(){this.element.removeAttribute(\"aria-activedescendant\")}},{key:\"open\",value:function(e){this.element.classList.add(this.classNames.openState),this.element.setAttribute(\"aria-expanded\",\"true\"),this.isOpen=!0,this.shouldFlip(e)&&(this.element.classList.add(this.classNames.flippedState),this.isFlipped=!0)}},{key:\"close\",value:function(){this.element.classList.remove(this.classNames.openState),this.element.setAttribute(\"aria-expanded\",\"false\"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(this.element.classList.remove(this.classNames.flippedState),this.isFlipped=!1)}},{key:\"focus\",value:function(){this.isFocussed||this.element.focus()}},{key:\"addFocusState\",value:function(){this.element.classList.add(this.classNames.focusState)}},{key:\"removeFocusState\",value:function(){this.element.classList.remove(this.classNames.focusState)}},{key:\"enable\",value:function(){this.element.classList.remove(this.classNames.disabledState),this.element.removeAttribute(\"aria-disabled\"),\"select-one\"===this.type&&this.element.setAttribute(\"tabindex\",\"0\"),this.isDisabled=!1}},{key:\"disable\",value:function(){this.element.classList.add(this.classNames.disabledState),this.element.setAttribute(\"aria-disabled\",\"true\"),\"select-one\"===this.type&&this.element.setAttribute(\"tabindex\",\"-1\"),this.isDisabled=!0}},{key:\"wrap\",value:function(e){(0,n.wrap)(e,this.element)}},{key:\"unwrap\",value:function(e){this.element.parentNode.insertBefore(e,this.element),this.element.parentNode.removeChild(this.element)}},{key:\"addLoadingState\",value:function(){this.element.classList.add(this.classNames.loadingState),this.element.setAttribute(\"aria-busy\",\"true\"),this.isLoading=!0}},{key:\"removeLoadingState\",value:function(){this.element.classList.remove(this.classNames.loadingState),this.element.removeAttribute(\"aria-busy\"),this.isLoading=!1}},{key:\"_onFocus\",value:function(){this.isFocussed=!0}},{key:\"_onBlur\",value:function(){this.isFocussed=!1}}])&&r(t.prototype,i),o&&r(t,o),e}();t.default=o},function(e,t,i){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=void 0;var n=i(0);function r(e,t){for(var i=0;i0&&void 0!==arguments[0])||arguments[0];return this.element.value&&(this.element.value=\"\"),e&&this.setWidth(),this}},{key:\"setWidth\",value:function(e){var t=this,i=function(e){t.element.style.width=e};if(this._placeholderValue){var n=this.element.value.length>=this._placeholderValue.length/1.25;(this.element.value&&n||e)&&this.calcWidth(i)}else this.calcWidth(i)}},{key:\"calcWidth\",value:function(e){return(0,n.calcWidthOfInput)(this.element,e)}},{key:\"setActiveDescendant\",value:function(e){this.element.setAttribute(\"aria-activedescendant\",e)}},{key:\"removeActiveDescendant\",value:function(){this.element.removeAttribute(\"aria-activedescendant\")}},{key:\"_onInput\",value:function(){\"select-one\"!==this.type&&this.setWidth()}},{key:\"_onPaste\",value:function(e){e.target===this.element&&this.preventPaste&&e.preventDefault()}},{key:\"_onFocus\",value:function(){this.isFocussed=!0}},{key:\"_onBlur\",value:function(){this.isFocussed=!1}},{key:\"placeholder\",set:function(e){this.element.placeholder=e}},{key:\"value\",set:function(e){this.element.value=e},get:function(){return(0,n.sanitise)(this.element.value)}}])&&r(t.prototype,i),o&&r(t,o),e}();t.default=o},function(e,t,i){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=void 0;var n=i(1);function r(e,t){for(var i=0;i0?this.element.scrollTop+o-s:e.offsetTop;requestAnimationFrame(function(e){i._animateScroll(e,a,t)})}}},{key:\"_scrollDown\",value:function(e,t,i){var n=(i-e)/t,r=n>1?n:1;this.element.scrollTop=e+r}},{key:\"_scrollUp\",value:function(e,t,i){var n=(e-i)/t,r=n>1?n:1;this.element.scrollTop=e-r}},{key:\"_animateScroll\",value:function(e,t,i){var r=this,o=n.SCROLLING_SPEED,s=this.element.scrollTop,a=!1;i>0?(this._scrollDown(s,o,t),st&&(a=!0)),a&&requestAnimationFrame(function(){r._animateScroll(e,t,i)})}}])&&r(t.prototype,i),o&&r(t,o),e}();t.default=o},function(e,t,i){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=void 0;var n,r=(n=i(4))&&n.__esModule?n:{default:n};function o(e){return(o=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}function s(e,t){for(var i=0;i0&&void 0!==arguments[0])||arguments[0];return{type:n.ACTION_TYPES.ACTIVATE_CHOICES,active:e}};t.clearChoices=function(){return{type:n.ACTION_TYPES.CLEAR_CHOICES}}},function(e,t,i){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.highlightItem=t.removeItem=t.addItem=void 0;var n=i(1);t.addItem=function(e){var t=e.value,i=e.label,r=e.id,o=e.choiceId,s=e.groupId,a=e.customProperties,c=e.placeholder,l=e.keyCode;return{type:n.ACTION_TYPES.ADD_ITEM,value:t,label:i,id:r,choiceId:o,groupId:s,customProperties:a,placeholder:c,keyCode:l}};t.removeItem=function(e,t){return{type:n.ACTION_TYPES.REMOVE_ITEM,id:e,choiceId:t}};t.highlightItem=function(e,t){return{type:n.ACTION_TYPES.HIGHLIGHT_ITEM,id:e,highlighted:t}}},function(e,t,i){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.addGroup=void 0;var n=i(1);t.addGroup=function(e,t,i,r){return{type:n.ACTION_TYPES.ADD_GROUP,value:e,id:t,active:i,disabled:r}}},function(e,t,i){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.resetTo=t.clearAll=void 0;t.clearAll=function(){return{type:\"CLEAR_ALL\"}};t.resetTo=function(e){return{type:\"RESET_TO\",state:e}}},function(e,t,i){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.setIsLoading=void 0;t.setIsLoading=function(e){return{type:\"SET_IS_LOADING\",isLoading:e}}}])});","'use strict';\nvar apply = require('../internals/function-apply');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar fails = require('../internals/fails');\nvar anObject = require('../internals/an-object');\nvar isCallable = require('../internals/is-callable');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar getMethod = require('../internals/get-method');\nvar getSubstitution = require('../internals/get-substitution');\nvar regExpExec = require('../internals/regexp-exec-abstract');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar REPLACE = wellKnownSymbol('replace');\nvar max = Math.max;\nvar min = Math.min;\nvar concat = uncurryThis([].concat);\nvar push = uncurryThis([].push);\nvar stringIndexOf = uncurryThis(''.indexOf);\nvar stringSlice = uncurryThis(''.slice);\n\nvar maybeToString = function (it) {\n return it === undefined ? it : String(it);\n};\n\n// IE <= 11 replaces $0 with the whole match, as if it was $&\n// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0\nvar REPLACE_KEEPS_$0 = (function () {\n // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing\n return 'a'.replace(/./, '$0') === '$0';\n})();\n\n// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string\nvar REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {\n if (/./[REPLACE]) {\n return /./[REPLACE]('a', '$0') === '';\n }\n return false;\n})();\n\nvar REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {\n var re = /./;\n re.exec = function () {\n var result = [];\n result.groups = { a: '7' };\n return result;\n };\n // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive\n return ''.replace(re, '$') !== '7';\n});\n\n// @@replace logic\nfixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {\n var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';\n\n return [\n // `String.prototype.replace` method\n // https://tc39.es/ecma262/#sec-string.prototype.replace\n function replace(searchValue, replaceValue) {\n var O = requireObjectCoercible(this);\n var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE);\n return replacer\n ? call(replacer, searchValue, O, replaceValue)\n : call(nativeReplace, toString(O), searchValue, replaceValue);\n },\n // `RegExp.prototype[@@replace]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace\n function (string, replaceValue) {\n var rx = anObject(this);\n var S = toString(string);\n\n if (\n typeof replaceValue == 'string' &&\n stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&\n stringIndexOf(replaceValue, '$<') === -1\n ) {\n var res = maybeCallNative(nativeReplace, rx, S, replaceValue);\n if (res.done) return res.value;\n }\n\n var functionalReplace = isCallable(replaceValue);\n if (!functionalReplace) replaceValue = toString(replaceValue);\n\n var global = rx.global;\n var fullUnicode;\n if (global) {\n fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n }\n\n var results = [];\n var result;\n while (true) {\n result = regExpExec(rx, S);\n if (result === null) break;\n\n push(results, result);\n if (!global) break;\n\n var matchStr = toString(result[0]);\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n }\n\n var accumulatedResult = '';\n var nextSourcePosition = 0;\n for (var i = 0; i < results.length; i++) {\n result = results[i];\n\n var matched = toString(result[0]);\n var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);\n var captures = [];\n var replacement;\n // NOTE: This is equivalent to\n // captures = result.slice(1).map(maybeToString)\n // but for some reason `nativeSlice.call(result, 1, result.length)` (called in\n // the slice polyfill when slicing native arrays) \"doesn't work\" in safari 9 and\n // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.\n for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));\n var namedCaptures = result.groups;\n if (functionalReplace) {\n var replacerArgs = concat([matched], captures, position, S);\n if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);\n replacement = toString(apply(replaceValue, undefined, replacerArgs));\n } else {\n replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);\n }\n if (position >= nextSourcePosition) {\n accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;\n nextSourcePosition = position + matched.length;\n }\n }\n\n return accumulatedResult + stringSlice(S, nextSourcePosition);\n }\n ];\n}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);\n","'use strict';\nvar $ = require('../internals/export');\nvar log1p = require('../internals/math-log1p');\n\n// eslint-disable-next-line es/no-math-acosh -- required for testing\nvar $acosh = Math.acosh;\nvar log = Math.log;\nvar sqrt = Math.sqrt;\nvar LN2 = Math.LN2;\n\nvar FORCED = !$acosh\n // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509\n || Math.floor($acosh(Number.MAX_VALUE)) !== 710\n // Tor Browser bug: Math.acosh(Infinity) -> NaN\n || $acosh(Infinity) !== Infinity;\n\n// `Math.acosh` method\n// https://tc39.es/ecma262/#sec-math.acosh\n$({ target: 'Math', stat: true, forced: FORCED }, {\n acosh: function acosh(x) {\n var n = +x;\n return n < 1 ? NaN : n > 94906265.62425156\n ? log(n) + LN2\n : log1p(n - 1 + sqrt(n - 1) * sqrt(n + 1));\n }\n});\n","'use strict';\nvar classof = require('../internals/classof');\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar getBuiltIn = require('../internals/get-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar defineBuiltIn = require('../internals/define-built-in');\n\nmodule.exports = function () {\n var Symbol = getBuiltIn('Symbol');\n var SymbolPrototype = Symbol && Symbol.prototype;\n var valueOf = SymbolPrototype && SymbolPrototype.valueOf;\n var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {\n // `Symbol.prototype[@@toPrimitive]` method\n // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive\n // eslint-disable-next-line no-unused-vars -- required for .length\n defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {\n return call(valueOf, this);\n }, { arity: 1 });\n }\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar thisNumberValue = require('../internals/this-number-value');\n\nvar nativeToPrecision = uncurryThis(1.0.toPrecision);\n\nvar FORCED = fails(function () {\n // IE7-\n return nativeToPrecision(1, undefined) !== '1';\n}) || !fails(function () {\n // V8 ~ Android 4.3-\n nativeToPrecision({});\n});\n\n// `Number.prototype.toPrecision` method\n// https://tc39.es/ecma262/#sec-number.prototype.toprecision\n$({ target: 'Number', proto: true, forced: FORCED }, {\n toPrecision: function toPrecision(precision) {\n return precision === undefined\n ? nativeToPrecision(thisNumberValue(this))\n : nativeToPrecision(thisNumberValue(this), precision);\n }\n});\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\n\nvar URLSearchParamsPrototype = URLSearchParams.prototype;\nvar forEach = uncurryThis(URLSearchParamsPrototype.forEach);\n\n// `URLSearchParams.prototype.size` getter\n// https://github.com/whatwg/url/pull/734\nif (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) {\n defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {\n get: function size() {\n var count = 0;\n forEach(this, function () { count++; });\n return count;\n },\n configurable: true,\n enumerable: true\n });\n}\n","'use strict';\nvar store = require('../internals/shared-store');\n\nmodule.exports = function (key, value) {\n return store[key] || (store[key] = value || {});\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\nvar concat = uncurryThis([].concat);\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar FORCED = require('../internals/object-prototype-accessors-forced');\nvar toObject = require('../internals/to-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\n\n// `Object.prototype.__lookupSetter__` method\n// https://tc39.es/ecma262/#sec-object.prototype.__lookupSetter__\nif (DESCRIPTORS) {\n $({ target: 'Object', proto: true, forced: FORCED }, {\n __lookupSetter__: function __lookupSetter__(P) {\n var O = toObject(this);\n var key = toPropertyKey(P);\n var desc;\n do {\n if (desc = getOwnPropertyDescriptor(O, key)) return desc.set;\n } while (O = getPrototypeOf(O));\n }\n });\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar isCallable = require('../internals/is-callable');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar isRegExp = require('../internals/is-regexp');\nvar toString = require('../internals/to-string');\nvar getMethod = require('../internals/get-method');\nvar getRegExpFlags = require('../internals/regexp-get-flags');\nvar getSubstitution = require('../internals/get-substitution');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar REPLACE = wellKnownSymbol('replace');\nvar $TypeError = TypeError;\nvar indexOf = uncurryThis(''.indexOf);\nvar replace = uncurryThis(''.replace);\nvar stringSlice = uncurryThis(''.slice);\nvar max = Math.max;\n\n// `String.prototype.replaceAll` method\n// https://tc39.es/ecma262/#sec-string.prototype.replaceall\n$({ target: 'String', proto: true }, {\n replaceAll: function replaceAll(searchValue, replaceValue) {\n var O = requireObjectCoercible(this);\n var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement;\n var position = 0;\n var endOfLastMatch = 0;\n var result = '';\n if (!isNullOrUndefined(searchValue)) {\n IS_REG_EXP = isRegExp(searchValue);\n if (IS_REG_EXP) {\n flags = toString(requireObjectCoercible(getRegExpFlags(searchValue)));\n if (!~indexOf(flags, 'g')) throw new $TypeError('`.replaceAll` does not allow non-global regexes');\n }\n replacer = getMethod(searchValue, REPLACE);\n if (replacer) {\n return call(replacer, searchValue, O, replaceValue);\n } else if (IS_PURE && IS_REG_EXP) {\n return replace(toString(O), searchValue, replaceValue);\n }\n }\n string = toString(O);\n searchString = toString(searchValue);\n functionalReplace = isCallable(replaceValue);\n if (!functionalReplace) replaceValue = toString(replaceValue);\n searchLength = searchString.length;\n advanceBy = max(1, searchLength);\n position = indexOf(string, searchString);\n while (position !== -1) {\n replacement = functionalReplace\n ? toString(replaceValue(searchString, position, string))\n : getSubstitution(searchString, string, position, [], undefined, replaceValue);\n result += stringSlice(string, endOfLastMatch, position) + replacement;\n endOfLastMatch = position + searchLength;\n position = position + advanceBy > string.length ? -1 : indexOf(string, searchString, position + advanceBy);\n }\n if (endOfLastMatch < string.length) {\n result += stringSlice(string, endOfLastMatch);\n }\n return result;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar isIntegralNumber = require('../internals/is-integral-number');\n\nvar abs = Math.abs;\n\n// `Number.isSafeInteger` method\n// https://tc39.es/ecma262/#sec-number.issafeinteger\n$({ target: 'Number', stat: true }, {\n isSafeInteger: function isSafeInteger(number) {\n return isIntegralNumber(number) && abs(number) <= 0x1FFFFFFFFFFFFF;\n }\n});\n","'use strict';\n// a string of all valid unicode whitespaces\nmodule.exports = '\\u0009\\u000A\\u000B\\u000C\\u000D\\u0020\\u00A0\\u1680\\u2000\\u2001\\u2002' +\n '\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar toString = require('../internals/to-string');\nvar whitespaces = require('../internals/whitespaces');\n\nvar replace = uncurryThis(''.replace);\nvar ltrim = RegExp('^[' + whitespaces + ']+');\nvar rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$');\n\n// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation\nvar createMethod = function (TYPE) {\n return function ($this) {\n var string = toString(requireObjectCoercible($this));\n if (TYPE & 1) string = replace(string, ltrim, '');\n if (TYPE & 2) string = replace(string, rtrim, '$1');\n return string;\n };\n};\n\nmodule.exports = {\n // `String.prototype.{ trimLeft, trimStart }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimstart\n start: createMethod(1),\n // `String.prototype.{ trimRight, trimEnd }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimend\n end: createMethod(2),\n // `String.prototype.trim` method\n // https://tc39.es/ecma262/#sec-string.prototype.trim\n trim: createMethod(3)\n};\n","'use strict';\nvar trunc = require('../internals/math-trunc');\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- NaN check\n return number !== number || number === 0 ? 0 : trunc(number);\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw new $TypeError(tryToString(argument) + ' is not a function');\n};\n","'use strict';\nvar isRegExp = require('../internals/is-regexp');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (it) {\n if (isRegExp(it)) {\n throw new $TypeError(\"The method doesn't accept regular expressions\");\n } return it;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar fails = require('../internals/fails');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar toObject = require('../internals/to-object');\n\n// V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives\n// https://bugs.chromium.org/p/v8/issues/detail?id=3443\nvar FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });\n\n// `Object.getOwnPropertySymbols` method\n// https://tc39.es/ecma262/#sec-object.getownpropertysymbols\n$({ target: 'Object', stat: true, forced: FORCED }, {\n getOwnPropertySymbols: function getOwnPropertySymbols(it) {\n var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];\n }\n});\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE.\n *\n * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\n *\n */\n(function() {\n'use strict';\n\n// Exit early if we're not running in a browser.\nif (typeof window !== 'object') {\n return;\n}\n\n// Exit early if all IntersectionObserver and IntersectionObserverEntry\n// features are natively supported.\nif ('IntersectionObserver' in window &&\n 'IntersectionObserverEntry' in window &&\n 'intersectionRatio' in window.IntersectionObserverEntry.prototype) {\n\n // Minimal polyfill for Edge 15's lack of `isIntersecting`\n // See: https://github.com/w3c/IntersectionObserver/issues/211\n if (!('isIntersecting' in window.IntersectionObserverEntry.prototype)) {\n Object.defineProperty(window.IntersectionObserverEntry.prototype,\n 'isIntersecting', {\n get: function () {\n return this.intersectionRatio > 0;\n }\n });\n }\n return;\n}\n\n/**\n * Returns the embedding frame element, if any.\n * @param {!Document} doc\n * @return {!Element}\n */\nfunction getFrameElement(doc) {\n try {\n return doc.defaultView && doc.defaultView.frameElement || null;\n } catch (e) {\n // Ignore the error.\n return null;\n }\n}\n\n/**\n * A local reference to the root document.\n */\nvar document = (function(startDoc) {\n var doc = startDoc;\n var frame = getFrameElement(doc);\n while (frame) {\n doc = frame.ownerDocument;\n frame = getFrameElement(doc);\n }\n return doc;\n})(window.document);\n\n/**\n * An IntersectionObserver registry. This registry exists to hold a strong\n * reference to IntersectionObserver instances currently observing a target\n * element. Without this registry, instances without another reference may be\n * garbage collected.\n */\nvar registry = [];\n\n/**\n * The signal updater for cross-origin intersection. When not null, it means\n * that the polyfill is configured to work in a cross-origin mode.\n * @type {function(DOMRect|ClientRect, DOMRect|ClientRect)}\n */\nvar crossOriginUpdater = null;\n\n/**\n * The current cross-origin intersection. Only used in the cross-origin mode.\n * @type {DOMRect|ClientRect}\n */\nvar crossOriginRect = null;\n\n\n/**\n * Creates the global IntersectionObserverEntry constructor.\n * https://w3c.github.io/IntersectionObserver/#intersection-observer-entry\n * @param {Object} entry A dictionary of instance properties.\n * @constructor\n */\nfunction IntersectionObserverEntry(entry) {\n this.time = entry.time;\n this.target = entry.target;\n this.rootBounds = ensureDOMRect(entry.rootBounds);\n this.boundingClientRect = ensureDOMRect(entry.boundingClientRect);\n this.intersectionRect = ensureDOMRect(entry.intersectionRect || getEmptyRect());\n this.isIntersecting = !!entry.intersectionRect;\n\n // Calculates the intersection ratio.\n var targetRect = this.boundingClientRect;\n var targetArea = targetRect.width * targetRect.height;\n var intersectionRect = this.intersectionRect;\n var intersectionArea = intersectionRect.width * intersectionRect.height;\n\n // Sets intersection ratio.\n if (targetArea) {\n // Round the intersection ratio to avoid floating point math issues:\n // https://github.com/w3c/IntersectionObserver/issues/324\n this.intersectionRatio = Number((intersectionArea / targetArea).toFixed(4));\n } else {\n // If area is zero and is intersecting, sets to 1, otherwise to 0\n this.intersectionRatio = this.isIntersecting ? 1 : 0;\n }\n}\n\n\n/**\n * Creates the global IntersectionObserver constructor.\n * https://w3c.github.io/IntersectionObserver/#intersection-observer-interface\n * @param {Function} callback The function to be invoked after intersection\n * changes have queued. The function is not invoked if the queue has\n * been emptied by calling the `takeRecords` method.\n * @param {Object=} opt_options Optional configuration options.\n * @constructor\n */\nfunction IntersectionObserver(callback, opt_options) {\n\n var options = opt_options || {};\n\n if (typeof callback != 'function') {\n throw new Error('callback must be a function');\n }\n\n if (\n options.root &&\n options.root.nodeType != 1 &&\n options.root.nodeType != 9\n ) {\n throw new Error('root must be a Document or Element');\n }\n\n // Binds and throttles `this._checkForIntersections`.\n this._checkForIntersections = throttle(\n this._checkForIntersections.bind(this), this.THROTTLE_TIMEOUT);\n\n // Private properties.\n this._callback = callback;\n this._observationTargets = [];\n this._queuedEntries = [];\n this._rootMarginValues = this._parseRootMargin(options.rootMargin);\n\n // Public properties.\n this.thresholds = this._initThresholds(options.threshold);\n this.root = options.root || null;\n this.rootMargin = this._rootMarginValues.map(function(margin) {\n return margin.value + margin.unit;\n }).join(' ');\n\n /** @private @const {!Array} */\n this._monitoringDocuments = [];\n /** @private @const {!Array} */\n this._monitoringUnsubscribes = [];\n}\n\n\n/**\n * The minimum interval within which the document will be checked for\n * intersection changes.\n */\nIntersectionObserver.prototype.THROTTLE_TIMEOUT = 100;\n\n\n/**\n * The frequency in which the polyfill polls for intersection changes.\n * this can be updated on a per instance basis and must be set prior to\n * calling `observe` on the first target.\n */\nIntersectionObserver.prototype.POLL_INTERVAL = null;\n\n/**\n * Use a mutation observer on the root element\n * to detect intersection changes.\n */\nIntersectionObserver.prototype.USE_MUTATION_OBSERVER = true;\n\n\n/**\n * Sets up the polyfill in the cross-origin mode. The result is the\n * updater function that accepts two arguments: `boundingClientRect` and\n * `intersectionRect` - just as these fields would be available to the\n * parent via `IntersectionObserverEntry`. This function should be called\n * each time the iframe receives intersection information from the parent\n * window, e.g. via messaging.\n * @return {function(DOMRect|ClientRect, DOMRect|ClientRect)}\n */\nIntersectionObserver._setupCrossOriginUpdater = function() {\n if (!crossOriginUpdater) {\n /**\n * @param {DOMRect|ClientRect} boundingClientRect\n * @param {DOMRect|ClientRect} intersectionRect\n */\n crossOriginUpdater = function(boundingClientRect, intersectionRect) {\n if (!boundingClientRect || !intersectionRect) {\n crossOriginRect = getEmptyRect();\n } else {\n crossOriginRect = convertFromParentRect(boundingClientRect, intersectionRect);\n }\n registry.forEach(function(observer) {\n observer._checkForIntersections();\n });\n };\n }\n return crossOriginUpdater;\n};\n\n\n/**\n * Resets the cross-origin mode.\n */\nIntersectionObserver._resetCrossOriginUpdater = function() {\n crossOriginUpdater = null;\n crossOriginRect = null;\n};\n\n\n/**\n * Starts observing a target element for intersection changes based on\n * the thresholds values.\n * @param {Element} target The DOM element to observe.\n */\nIntersectionObserver.prototype.observe = function(target) {\n var isTargetAlreadyObserved = this._observationTargets.some(function(item) {\n return item.element == target;\n });\n\n if (isTargetAlreadyObserved) {\n return;\n }\n\n if (!(target && target.nodeType == 1)) {\n throw new Error('target must be an Element');\n }\n\n this._registerInstance();\n this._observationTargets.push({element: target, entry: null});\n this._monitorIntersections(target.ownerDocument);\n this._checkForIntersections();\n};\n\n\n/**\n * Stops observing a target element for intersection changes.\n * @param {Element} target The DOM element to observe.\n */\nIntersectionObserver.prototype.unobserve = function(target) {\n this._observationTargets =\n this._observationTargets.filter(function(item) {\n return item.element != target;\n });\n this._unmonitorIntersections(target.ownerDocument);\n if (this._observationTargets.length == 0) {\n this._unregisterInstance();\n }\n};\n\n\n/**\n * Stops observing all target elements for intersection changes.\n */\nIntersectionObserver.prototype.disconnect = function() {\n this._observationTargets = [];\n this._unmonitorAllIntersections();\n this._unregisterInstance();\n};\n\n\n/**\n * Returns any queue entries that have not yet been reported to the\n * callback and clears the queue. This can be used in conjunction with the\n * callback to obtain the absolute most up-to-date intersection information.\n * @return {Array} The currently queued entries.\n */\nIntersectionObserver.prototype.takeRecords = function() {\n var records = this._queuedEntries.slice();\n this._queuedEntries = [];\n return records;\n};\n\n\n/**\n * Accepts the threshold value from the user configuration object and\n * returns a sorted array of unique threshold values. If a value is not\n * between 0 and 1 and error is thrown.\n * @private\n * @param {Array|number=} opt_threshold An optional threshold value or\n * a list of threshold values, defaulting to [0].\n * @return {Array} A sorted list of unique and valid threshold values.\n */\nIntersectionObserver.prototype._initThresholds = function(opt_threshold) {\n var threshold = opt_threshold || [0];\n if (!Array.isArray(threshold)) threshold = [threshold];\n\n return threshold.sort().filter(function(t, i, a) {\n if (typeof t != 'number' || isNaN(t) || t < 0 || t > 1) {\n throw new Error('threshold must be a number between 0 and 1 inclusively');\n }\n return t !== a[i - 1];\n });\n};\n\n\n/**\n * Accepts the rootMargin value from the user configuration object\n * and returns an array of the four margin values as an object containing\n * the value and unit properties. If any of the values are not properly\n * formatted or use a unit other than px or %, and error is thrown.\n * @private\n * @param {string=} opt_rootMargin An optional rootMargin value,\n * defaulting to '0px'.\n * @return {Array