Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

downshift

Package Overview
Dependencies
Maintainers
2
Versions
354
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

downshift - npm Package Compare versions

Comparing version 9.0.2 to 9.0.3

2

dist/downshift.umd.min.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Downshift={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(t);function o(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},r.apply(this,arguments)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l,a,c,d,p={exports:{}};p.exports=function(){if(d)return c;d=1;var e=a?l:(a=1,l="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,c=function(){function i(t,n,i,o,r,u){if(u!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return i}i.isRequired=i;var r={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return r.PropTypes=r,r}}()();var f,h=s(p.exports),g={};!function(){if(f)return g;f=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function I(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case i:case r:case o:case c:case d:return e;default:switch(e=e&&e.$$typeof){case l:case s:case a:case h:case p:case u:return e;default:return f}}case n:return f}}}e=Symbol.for("react.module.reference"),g.ContextConsumer=s,g.ContextProvider=u,g.Element=t,g.ForwardRef=a,g.Fragment=i,g.Lazy=h,g.Memo=p,g.Portal=n,g.Profiler=r,g.StrictMode=o,g.Suspense=c,g.SuspenseList=d,g.isAsyncMode=function(){return!1},g.isConcurrentMode=function(){return!1},g.isContextConsumer=function(e){return I(e)===s},g.isContextProvider=function(e){return I(e)===u},g.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},g.isForwardRef=function(e){return I(e)===a},g.isFragment=function(e){return I(e)===i},g.isLazy=function(e){return I(e)===h},g.isMemo=function(e){return I(e)===p},g.isPortal=function(e){return I(e)===n},g.isProfiler=function(e){return I(e)===r},g.isStrictMode=function(e){return I(e)===o},g.isSuspense=function(e){return I(e)===c},g.isSuspenseList=function(e){return I(e)===d},g.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===r||t===o||t===c||t===d||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===h||t.$$typeof===p||t.$$typeof===u||t.$$typeof===s||t.$$typeof===a||t.$$typeof===e||void 0!==t.getModuleId)},g.typeOf=I}();const m=e=>"object"==typeof e&&null!=e&&1===e.nodeType,I=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,v=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return I(n.overflowY,t)||I(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},y=(e,t,n,i,o,r,u,s)=>r<e&&u>t||r>e&&u<t?0:r<=e&&s<=n||u>=t&&s>=n?r-e-i:u>t&&s<n||r<e&&s>n?u-t+o:0,b=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var x=0;function w(e){return"function"==typeof e?e:S}function S(){}function C(e,t){if(e){var n=((e,t)=>{var n,i,o,r;if("undefined"==typeof document)return[];const{scrollMode:u,block:s,inline:l,boundary:a,skipOverflowHiddenElements:c}=t,d="function"==typeof a?a:e=>e!==a;if(!m(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,f=[];let h=e;for(;m(h)&&d(h);){if(h=b(h),h===p){f.push(h);break}null!=h&&h===document.body&&v(h)&&!v(document.documentElement)||null!=h&&v(h,c)&&f.push(h)}const g=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,I=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,{scrollX:x,scrollY:w}=window,{height:S,width:C,top:k,right:D,bottom:O,left:M}=e.getBoundingClientRect(),{top:E,right:K,bottom:P,left:T}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let R="start"===s||"nearest"===s?k-E:"end"===s?O+P:k+S/2-E+P,H="center"===l?M+C/2-T+K:"end"===l?D+K:M-T;const V=[];for(let e=0;e<f.length;e++){const t=f[e],{height:n,width:i,top:o,right:r,bottom:a,left:c}=t.getBoundingClientRect();if("if-needed"===u&&k>=0&&M>=0&&O<=I&&D<=g&&k>=o&&O<=a&&M>=c&&D<=r)return V;const d=getComputedStyle(t),h=parseInt(d.borderLeftWidth,10),m=parseInt(d.borderTopWidth,10),v=parseInt(d.borderRightWidth,10),b=parseInt(d.borderBottomWidth,10);let E=0,K=0;const P="offsetWidth"in t?t.offsetWidth-t.clientWidth-h-v:0,T="offsetHeight"in t?t.offsetHeight-t.clientHeight-m-b:0,B="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,A="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(p===t)E="start"===s?R:"end"===s?R-I:"nearest"===s?y(w,w+I,I,m,b,w+R,w+R+S,S):R-I/2,K="start"===l?H:"center"===l?H-g/2:"end"===l?H-g:y(x,x+g,g,h,v,x+H,x+H+C,C),E=Math.max(0,E+w),K=Math.max(0,K+x);else{E="start"===s?R-o-m:"end"===s?R-a+b+T:"nearest"===s?y(o,a,n,m,b+T,R,R+S,S):R-(o+n/2)+T/2,K="start"===l?H-c-h:"center"===l?H-(c+i/2)+P/2:"end"===l?H-r+v+P:y(c,r,i,h,v+P,H,H+C,C);const{scrollLeft:e,scrollTop:u}=t;E=0===A?0:Math.max(0,Math.min(u+E/A,t.scrollHeight-n/A+T)),K=0===B?0:Math.max(0,Math.min(e+K/B,t.scrollWidth-i/B+P)),R+=u-E,H+=e-K}V.push({el:t,top:E,left:K})}return V})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,i=e.left;t.scrollTop=n,t.scrollLeft=i}))}}function k(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function D(e,t){var n;function i(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,r=new Array(o),u=0;u<o;u++)r[u]=arguments[u];i(),n=setTimeout((function(){n=null,e.apply(void 0,r)}),t)}return o.cancel=i,o}function O(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(i)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function M(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function E(){return String(x++)}function K(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function P(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var T=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function R(e){void 0===e&&(e={});var t={};return T.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function H(e,t){return e&&t?Object.keys(e).reduce((function(n,i){return n[i]=V(t,i)?t[i]:e[i],n}),{}):e}function V(e,t){return void 0!==e[t]}function B(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function A(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(0===r)return-1;var u=r-1;("number"!=typeof e||e<0||e>u)&&(e=t>0?-1:u+1);var s=e+t;s<0?s=o?u:0:s>u&&(s=o?0:u);var l=L(s,t<0,n,i,o);return-1===l?e>=r?-1:e:l}function L(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(t){for(var u=e;u>=0;u--)if(!i(n[u],u))return u}else for(var s=e;s<r;s++)if(!i(n[s],s))return s;return o?L(t?r-1:0,t,n,i):-1}function F(e,t,n,i){return void 0===i&&(i=!0),n&&t.some((function(t){return t&&(k(t,e,n)||i&&k(t,n.document.activeElement,n))}))}var _=D((function(e){N(e).textContent=""}),500);function N(e){var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function j(e,t){e&&t&&(N(t).textContent=e,_(t))}var U=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),W=["refKey","ref"],$=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],q=["onKeyDown","onBlur","onChange","onInput","onChangeText"],z=["refKey","ref"],Y=["onMouseMove","onMouseDown","onClick","onPress","index","item"],X=function(){var e=function(e){function n(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+E(),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var i=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==i})),e()}),t);n.timeoutIds.push(i)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.isItemDisabled=function(e,t){var i=n.getItemNodeFromIndex(t);return i&&i.hasAttribute("disabled")},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=R(t),n.internalSetState(r({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,i){t=R(t),n.internalSetState(r({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),i)},n.selectItemAtIndex=function(e,t,i){var o=n.items[e];null!=o&&n.selectItem(o,t,i)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var i,o,u={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,r({},n.getStateAndHelpers(),e)),n.setState((function(t){var l;t=n.getState(t);var a=s?e(t):e;a=n.props.stateReducer(t,a),i=a.hasOwnProperty("selectedItem");var c={};return i&&a.selectedItem!==t.selectedItem&&(o=a.selectedItem),(l=a).type||(l.type=0),Object.keys(a).forEach((function(e){t[e]!==a[e]&&(u[e]=a[e]),"type"!==e&&(a[e],V(n.props,e)||(c[e]=a[e]))})),s&&a.hasOwnProperty("inputValue")&&n.props.onInputValueChange(a.inputValue,r({},n.getStateAndHelpers(),a)),c}),(function(){w(t)(),Object.keys(u).length>1&&n.props.onStateChange(u,n.getStateAndHelpers()),i&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(u,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var i,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=o(u,W),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=p;var f=n.getState().isOpen;return r(((i={})[l]=M(a,n.rootRef),i.role="combobox",i["aria-expanded"]=f,i["aria-haspopup"]="listbox",i["aria-owns"]=f?n.menuId:void 0,i["aria-labelledby"]=n.labelId,i),c)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=A(t.getState().highlightedIndex,1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=A(t.getState().highlightedIndex,-1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,i=t.highlightedIndex;if(n&&null!=i){e.preventDefault();var o=this.items[i],r=this.getItemNodeFromIndex(i);if(null==o||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(r({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=r({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=r({},n.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=L(0,!1,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:7})}}},End:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=L(n-1,!0,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick;t.onPress;var u=t.onKeyDown,s=t.onKeyUp,l=t.onBlur,a=o(t,$),c=n.getState().isOpen,d={onClick:O(i,n.buttonHandleClick),onKeyDown:O(u,n.buttonHandleKeyDown),onKeyUp:O(s,n.buttonHandleKeyUp),onBlur:O(l,n.buttonHandleBlur)};return r({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:d,a)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=B(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(n,e)},n.buttonHandleClick=function(e){if(e.preventDefault(),n.props.environment){var t=n.props.environment.document,i=t.body,o=t.activeElement;i&&i===o&&e.target.focus()}n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){if(!n.isMouseDown&&n.props.environment){var e=n.props.environment.document.activeElement;null!=e&&e.id===n.inputId||e===t||n.reset({type:14})}}))},n.getLabelProps=function(e){return r({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,u=t.onBlur,s=t.onChange,l=t.onInput;t.onChangeText;var a=o(t,q),c={};var d,p=n.getState(),f=p.inputValue,h=p.isOpen,g=p.highlightedIndex;a.disabled||((d={}).onChange=O(s,l,n.inputHandleChange),d.onKeyDown=O(i,n.inputHandleKeyDown),d.onBlur=O(u,n.inputHandleBlur),c=d);return r({"aria-autocomplete":"list","aria-activedescendant":h&&"number"==typeof g&&g>=0?n.getItemId(g):void 0,"aria-controls":h?n.menuId:void 0,"aria-labelledby":a&&a["aria-label"]?void 0:n.labelId,autoComplete:"off",value:f,id:n.inputId},c,a)},n.inputHandleKeyDown=function(e){var t=B(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(n,e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e;if(!n.isMouseDown&&n.props.environment){var t=n.props.environment.document.activeElement;(null==t||null==(e=t.dataset)?void 0:e.toggle)&&n._rootNode&&n._rootNode.contains(t)||n.reset({type:10})}}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var i,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=o(u,z),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=p,r(((i={})[l]=M(a,n.menuRef),i.role="listbox",i["aria-labelledby"]=c&&c["aria-label"]?void 0:n.labelId,i.id=n.menuId,i),c)},n.getItemProps=function(e){var t,i=void 0===e?{}:e,u=i.onMouseMove,s=i.onMouseDown,l=i.onClick;i.onPress;var a=i.index,c=i.item,d=void 0===c?void 0:c,p=o(i,Y);void 0===a?(n.items.push(d),a=n.items.indexOf(d)):n.items[a]=d;var f=l,h=((t={onMouseMove:O(u,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:O(s,(function(e){e.preventDefault()}))}).onClick=O(f,(function(){n.selectItemAtIndex(a,{type:9})})),t),g=p.disabled?{onMouseDown:h.onMouseDown}:h;return r({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},g,p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=R(e),n.internalSetState((function(t){var i=t.selectedItem;return r({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(i)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=R(e),n.internalSetState((function(t){var i=t.isOpen;return r({isOpen:!i},i&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var i=n.getState(),o=i.isOpen,r=i.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof r&&n.setHighlightedIndex(r,e),w(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=D((function(){var e;if(null!=(e=n.props)&&null!=(e=e.environment)&&e.document){var t=n.getState(),i=n.items[t.highlightedIndex],o=n.getItemCount(),u=n.props.getA11yStatusMessage(r({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:o,highlightedItem:i},t));n.previousResultCount=o,j(u,n.props.environment.document)}}),200);var i=n.props,u=i.defaultHighlightedIndex,s=i.initialHighlightedIndex,l=void 0===s?u:s,a=i.defaultIsOpen,c=i.initialIsOpen,d=void 0===c?a:c,p=i.initialInputValue,f=void 0===p?"":p,h=i.initialSelectedItem,g=void 0===h?null:h,m=n.getState({highlightedIndex:l,isOpen:d,inputValue:f,selectedItem:g});return null!=m.selectedItem&&void 0===n.props.initialInputValue&&(m.inputValue=n.props.itemToString(m.selectedItem)),n.state=m,n}var i,s;s=e,(i=n).prototype=Object.create(s.prototype),i.prototype.constructor=i,u(i,s);var l=n.prototype;return l.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},l.getState=function(e){return void 0===e&&(e=this.state),H(e,this.props)},l.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},l.getItemNodeFromIndex=function(e){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(e)):null},l.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},l.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),i=this.getState().highlightedIndex;if(n>0){var o=A(i,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(o,t)}},l.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,i=e.selectedItem,o=e.isOpen,r=this.props.itemToString,u=this.id,s=this.getRootProps,l=this.getToggleButtonProps,a=this.getLabelProps,c=this.getMenuProps,d=this.getInputProps,p=this.getItemProps,f=this.openMenu,h=this.closeMenu,g=this.toggleMenu,m=this.selectItem,I=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,b=this.clearSelection,x=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:a,getMenuProps:c,getInputProps:d,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:h,toggleMenu:g,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:i}},l.componentDidMount=function(){var e=this;if(this.props.environment){var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!F(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},i=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},r=function(t){var n=F(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",t),u.addEventListener("mouseup",n),u.addEventListener("touchstart",i),u.addEventListener("touchmove",o),u.addEventListener("touchend",r),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",i),u.removeEventListener("touchmove",o),u.removeEventListener("touchend",r)}}else this.cleanup=function(){e.internalClearTimeouts()}},l.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,i=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==i},l.componentDidUpdate=function(e,t){V(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},l.componentWillUnmount=function(){this.cleanup()},l.render=function(){var e=P(this.props.children,S);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var n=P(e(this.getStateAndHelpers()));return n?this.getRootProps.called||this.props.suppressRefError?n:function(e){return"string"==typeof e.type}(n)?t.cloneElement(n,this.getRootProps(function(e){return e.props}(n))):void 0:null},n}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:K,itemToString:function(e){return null==e?"":String(e)},onStateChange:S,onInputValueChange:S,onUserAction:S,onChange:S,onSelect:S,onOuterClick:S,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:C},e.stateChangeTypes=U,e}(),G={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function J(e,t,n){var i=e.props,o=e.type,u={};Object.keys(t).forEach((function(i){!function(e,t,n,i){var o=t.props,u=t.type,s="on"+ne(e)+"Change";o[s]&&void 0!==i[e]&&i[e]!==n[e]&&o[s](r({type:u},i))}(i,e,t,n),n[i]!==t[i]&&(u[i]=n[i])})),i.onStateChange&&Object.keys(u).length&&i.onStateChange(r({type:o},u))}var Q=D((function(e,t){j(e,t)}),200),Z="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,ee="useId"in i.default?function(e){var n=e.id,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId,a="downshift-"+i.default.useId();return n||(n=a),t.useRef({labelId:o||n+"-label",menuId:r||n+"-menu",getItemId:u||function(e){return n+"-item-"+e},toggleButtonId:s||n+"-toggle-button",inputId:l||n+"-input"}).current}:function(e){var n=e.id,i=void 0===n?"downshift-"+E():n,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId;return t.useRef({labelId:o||i+"-label",menuId:r||i+"-menu",getItemId:u||function(e){return i+"-item-"+e},toggleButtonId:s||i+"-toggle-button",inputId:l||i+"-input"}).current};function te(e,t,n,i){var o,r;if(void 0===e){if(void 0===t)throw new Error(i);o=n[t],r=t}else r=void 0===t?n.indexOf(e):t,o=e;return[o,r]}function ne(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function ie(e){var n=t.useRef(e);return n.current=e,n}function oe(e,n,i,o){var u=t.useRef(),s=t.useRef(),l=t.useCallback((function(t,n){s.current=n,t=H(t,n.props);var i=e(t,n);return n.props.stateReducer(t,r({},n,{changes:i}))}),[e]),a=t.useReducer(l,n,i),c=a[0],d=a[1],p=ie(n),f=t.useCallback((function(e){return d(r({props:p.current},e))}),[p]),h=s.current;return t.useEffect((function(){var e=H(u.current,null==h?void 0:h.props);h&&u.current&&!o(e,c)&&J(h,e,c),u.current=c}),[c,h,o]),[c,f]}function re(e,t,n,i){var o=oe(e,t,n,i),r=o[0],u=o[1];return[H(r,t),u]}var ue={itemToString:function(e){return e?String(e):""},itemToKey:function(e){return e},stateReducer:function(e,t){return t.changes},scrollIntoView:C,environment:"undefined"==typeof window?void 0:window};function se(e,t,n){void 0===n&&(n=G);var i=e["default"+ne(t)];return void 0!==i?i:n[t]}function le(e,t,n){void 0===n&&(n=G);var i=e[t];if(void 0!==i)return i;var o=e["initial"+ne(t)];return void 0!==o?o:se(e,t,n)}function ae(e){var t=le(e,"selectedItem"),n=le(e,"isOpen"),i=le(e,"highlightedIndex"),o=le(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.findIndex((function(n){return e.itemToKey(n)===e.itemToKey(t)})):i,isOpen:n,selectedItem:t,inputValue:o}}function ce(e,t,n){var i=e.items,o=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=e.isItemDisabled,s=e.itemToKey,l=t.selectedItem,a=t.highlightedIndex;return 0===i.length?-1:void 0===o||a!==o||u(i[o])?void 0===r||u(i[r])?l?i.findIndex((function(e){return s(l)===s(e)})):0===n?-1:n<0?i.length-1:0:r:o}function de(e,n,i){var o=t.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return t.useEffect((function(){if(!e)return S;var t=n.map((function(e){return e.current}));function r(){o.current.isTouchEnd=!1,o.current.isMouseDown=!0}function u(n){o.current.isMouseDown=!1,F(n.target,t,e)||i()}function s(){o.current.isTouchEnd=!1,o.current.isTouchMove=!1}function l(){o.current.isTouchMove=!0}function a(n){o.current.isTouchEnd=!0,o.current.isTouchMove||F(n.target,t,e,!1)||i()}return e.addEventListener("mousedown",r),e.addEventListener("mouseup",u),e.addEventListener("touchstart",s),e.addEventListener("touchmove",l),e.addEventListener("touchend",a),function(){e.removeEventListener("mousedown",r),e.removeEventListener("mouseup",u),e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",a)}}),[e,i]),o.current}var pe=function(){return S};function fe(e,n,i,o){void 0===o&&(o={});var r=o.document,u=ve();t.useEffect((function(){if(e&&!u&&r){var t=e(n);Q(t,r)}}),i),t.useEffect((function(){return function(){var e,t;Q.cancel(),(t=null==(e=r)?void 0:e.getElementById("a11y-status-message"))&&t.remove()}}),[r])}function he(e){var n=e.highlightedIndex,i=e.isOpen,o=e.itemRefs,r=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,l=t.useRef(!0);return Z((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var ge=S;function me(e,t,n){var i;return void 0===n&&(n=!0),r({isOpen:!1,highlightedIndex:-1},(null==(i=e.items)?void 0:i.length)&&t>=0&&r({selectedItem:e.items[t],isOpen:se(e,"isOpen"),highlightedIndex:se(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function Ie(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function ve(){var e=i.default.useRef(!0);return i.default.useEffect((function(){return e.current=!1,function(){e.current=!0}}),[]),e.current}var ye={environment:h.shape({addEventListener:h.func.isRequired,removeEventListener:h.func.isRequired,document:h.shape({createElement:h.func.isRequired,getElementById:h.func.isRequired,activeElement:h.any.isRequired,body:h.any.isRequired}).isRequired,Node:h.func.isRequired}),itemToString:h.func,itemToKey:h.func,stateReducer:h.func},be=r({},ye,{getA11yStatusMessage:h.func,highlightedIndex:h.number,defaultHighlightedIndex:h.number,initialHighlightedIndex:h.number,isOpen:h.bool,defaultIsOpen:h.bool,initialIsOpen:h.bool,selectedItem:h.any,initialSelectedItem:h.any,defaultSelectedItem:h.any,id:h.string,labelId:h.string,menuId:h.string,getItemId:h.func,toggleButtonId:h.string,onSelectedItemChange:h.func,onHighlightedIndexChange:h.func,onStateChange:h.func,onIsOpenChange:h.func,scrollIntoView:h.func});function xe(e,t,n){var i,o=t.type,u=t.props;switch(o){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:ce(u,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:ce(u,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:se(u,"highlightedIndex"),isOpen:se(u,"isOpen"),selectedItem:se(u,"selectedItem"),inputValue:se(u,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,i)}var we=function(){return we=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},we.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,we(we({},be),{items:h.array.isRequired,isItemDisabled:h.func});var Se=we(we({},ue),{isItemDisabled:function(){return!1}}),Ce=S,ke=1,De=2,Oe=3,Me=4,Ee=5,Ke=6,Pe=7,Te=8,Re=9,He=10,Ve=11,Be=14,Ae=19,Le=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:ke,ToggleButtonKeyDownArrowUp:De,ToggleButtonKeyDownCharacter:Oe,ToggleButtonKeyDownEscape:Me,ToggleButtonKeyDownHome:Ee,ToggleButtonKeyDownEnd:Ke,ToggleButtonKeyDownEnter:Pe,ToggleButtonKeyDownSpaceButton:Te,ToggleButtonKeyDownPageUp:Re,ToggleButtonKeyDownPageDown:He,ToggleButtonBlur:Ve,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:Be,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Ae,FunctionSetInputValue:20,FunctionReset:21});function Fe(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case Be:i={isOpen:se(u,"isOpen"),highlightedIndex:se(u,"highlightedIndex"),selectedItem:u.items[t.index]};break;case Oe:var l=t.key,a=""+e.inputValue+l;i={inputValue:a,highlightedIndex:function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.isItemDisabled,u=t.toLowerCase(),s=0;s<i.length;s++){var l=(s+n+(t.length<2?1:0))%i.length,a=i[l];if(void 0!==a&&o(a).toLowerCase().startsWith(u)&&!r(a,l))return l}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?u.items.findIndex((function(t){return u.itemToKey(t)===u.itemToKey(e.selectedItem)})):e.highlightedIndex,items:u.items,itemToString:u.itemToString,isItemDisabled:u.isItemDisabled}),isOpen:!0};break;case ke:i={highlightedIndex:e.isOpen?A(e.highlightedIndex,1,u.items,u.isItemDisabled):s&&null==e.selectedItem?-1:ce(u,e,1),isOpen:!0};break;case De:if(e.isOpen&&s)i=me(u,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?A(e.highlightedIndex,-1,u.items,u.isItemDisabled):ce(u,e,-1),isOpen:!0};break;case Pe:case Te:i=me(u,e.highlightedIndex,!1);break;case Ee:i={highlightedIndex:L(0,!1,u.items,u.isItemDisabled),isOpen:!0};break;case Ke:i={highlightedIndex:L(u.items.length-1,!0,u.items,u.isItemDisabled),isOpen:!0};break;case Re:i={highlightedIndex:A(e.highlightedIndex,-10,u.items,u.isItemDisabled)};break;case He:i={highlightedIndex:A(e.highlightedIndex,10,u.items,u.isItemDisabled)};break;case Me:i={isOpen:!1,highlightedIndex:-1};break;case Ve:i=r({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&{selectedItem:u.items[e.highlightedIndex]});break;case Ae:i={selectedItem:t.selectedItem};break;default:return xe(e,t,Le)}return r({},e,i)}var _e=["onClick"],Ne=["onMouseLeave","refKey","ref"],je=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],Ue=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function We(e){void 0===e&&(e={}),Ce();var n=r({},Se,e),i=n.scrollIntoView,u=n.environment,s=n.getA11yStatusMessage,l=re(Fe,n,ae,Ie),a=l[0],c=l[1],d=a.isOpen,p=a.highlightedIndex,f=a.selectedItem,h=a.inputValue,g=t.useRef(null),m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),y=ee(n),b=ie({state:a,props:n}),x=t.useCallback((function(e){return I.current[y.getItemId(e)]}),[y]);fe(s,a,[d,p,f,h],u);var w=he({menuElement:m.current,highlightedIndex:p,isOpen:d,itemRefs:I,scrollIntoView:i,getItemNodeFromIndex:x});t.useEffect((function(){return v.current=D((function(e){e({type:20,inputValue:""})}),500),function(){v.current.cancel()}}),[]),t.useEffect((function(){h&&v.current(c)}),[c,h]),ge(),t.useEffect((function(){le(n,"isOpen")&&g.current&&g.current.focus()}),[]);var S=de(u,[g,m],t.useCallback((function(){b.current.state.isOpen&&c({type:Ve})}),[c,b])),C=pe();t.useEffect((function(){d||(I.current={})}),[d]);var k=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),c({type:ke,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:De,altKey:e.altKey})},Home:function(e){e.preventDefault(),c({type:Ee})},End:function(e){e.preventDefault(),c({type:Ke})},Escape:function(){b.current.state.isOpen&&c({type:Me})},Enter:function(e){e.preventDefault(),c({type:b.current.state.isOpen?Pe:0})},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Re}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:He}))}," ":function(e){e.preventDefault();var t=b.current.state;t.isOpen?t.inputValue?c({type:Oe,key:" "}):c({type:Te}):c({type:0})}}}),[c,b]),E=t.useCallback((function(){c({type:15})}),[c]),K=t.useCallback((function(){c({type:17})}),[c]),P=t.useCallback((function(){c({type:16})}),[c]),T=t.useCallback((function(e){c({type:18,highlightedIndex:e})}),[c]),R=t.useCallback((function(e){c({type:Ae,selectedItem:e})}),[c]),H=t.useCallback((function(){c({type:21})}),[c]),V=t.useCallback((function(e){c({type:20,inputValue:e})}),[c]),A=t.useCallback((function(e){var t=void 0===e?{}:e,n=t.onClick,i=o(t,_e);return r({id:y.labelId,htmlFor:y.toggleButtonId,onClick:O(n,(function(){var e;null==(e=g.current)||e.focus()}))},i)}),[y]),L=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s,a=i.ref,d=o(i,Ne),p=(void 0===t?{}:t).suppressRefError;return C("getMenuProps",void 0!==p&&p,l,m),r(((n={})[l]=M(a,(function(e){m.current=e})),n.id=y.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+y.labelId,n.onMouseLeave=O(u,(function(){c({type:12})})),n),d)}),[c,C,y]),F=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onBlur,s=i.onClick;i.onPress;var l=i.onKeyDown,a=i.refKey,d=void 0===a?"ref":a,p=i.ref,f=o(i,je),h=(void 0===t?{}:t).suppressRefError,m=void 0!==h&&h,I=b.current.state,v=r(((n={})[d]=M(p,(function(e){g.current=e})),n["aria-activedescendant"]=I.isOpen&&I.highlightedIndex>-1?y.getItemId(I.highlightedIndex):"",n["aria-controls"]=y.menuId,n["aria-expanded"]=b.current.state.isOpen,n["aria-haspopup"]="listbox",n["aria-labelledby"]=f&&f["aria-label"]?void 0:""+y.labelId,n.id=y.toggleButtonId,n.role="combobox",n.tabIndex=0,n.onBlur=O(u,(function(){I.isOpen&&!S.isMouseDown&&c({type:Ve})})),n),f);return f.disabled||(v.onClick=O(s,(function(){c({type:0})})),v.onKeyDown=O(l,(function(e){var t=B(e);t&&k[t]?k[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&c({type:Oe,key:t})}))),C("getToggleButtonProps",m,d,g),v}),[c,y,b,S,C,k]),_=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,u=n.index,s=n.onMouseMove,l=n.onClick,a=n.onMouseDown;n.onPress;var d=n.refKey,p=void 0===d?"ref":d,f=n.disabled,h=n.ref,g=o(n,Ue);void 0!==f&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var m=b.current,v=m.state,x=m.props,C=te(i,u,x.items,"Pass either item or index to getItemProps!"),k=C[0],D=C[1],E=x.isItemDisabled(k,D),K=r(((t={})[p]=M(h,(function(e){e&&(I.current[y.getItemId(D)]=e)})),t["aria-disabled"]=E,t["aria-selected"]=""+(k===v.selectedItem),t.id=y.getItemId(D),t.role="option",t),g);return E||(K.onClick=O(l,(function(){c({type:Be,index:D})}))),K.onMouseMove=O(s,(function(){S.isTouchEnd||D===v.highlightedIndex||(w.current=!1,c({type:13,index:D,disabled:E}))})),K.onMouseDown=O(a,(function(e){return e.preventDefault()})),K}),[b,y,S,w,c]);return{getToggleButtonProps:F,getLabelProps:A,getMenuProps:L,getItemProps:_,toggleMenu:E,openMenu:P,closeMenu:K,setHighlightedIndex:T,selectItem:R,reset:H,setInputValue:V,highlightedIndex:p,isOpen:d,selectedItem:f,inputValue:h}}We.stateChangeTypes=Le;var $e=0,qe=1,ze=2,Ye=3,Xe=4,Ge=5,Je=6,Qe=7,Ze=8,et=9,tt=10,nt=13,it=19,ot=22,rt=Object.freeze({__proto__:null,InputKeyDownArrowDown:$e,InputKeyDownArrowUp:qe,InputKeyDownEscape:ze,InputKeyDownHome:Ye,InputKeyDownEnd:Xe,InputKeyDownPageUp:Ge,InputKeyDownPageDown:Je,InputKeyDownEnter:Qe,InputChange:Ze,InputBlur:et,InputClick:tt,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:nt,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:it,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:ot});function ut(e){var t=ae(e),n=t.selectedItem,i=t.inputValue;return""===i&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(i=e.itemToString(n)),r({},t,{inputValue:i})}r({},be,{items:h.array.isRequired,isItemDisabled:h.func,inputValue:h.string,defaultInputValue:h.string,initialInputValue:h.string,inputId:h.string,onInputValueChange:h.func});var st=S,lt=r({},ue,{isItemDisabled:function(){return!1}});function at(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case nt:i={isOpen:se(u,"isOpen"),highlightedIndex:se(u,"highlightedIndex"),selectedItem:u.items[t.index],inputValue:u.itemToString(u.items[t.index])};break;case $e:i=e.isOpen?{highlightedIndex:A(e.highlightedIndex,1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:s&&null==e.selectedItem?-1:ce(u,e,1),isOpen:u.items.length>=0};break;case qe:i=e.isOpen?s?me(u,e.highlightedIndex):{highlightedIndex:A(e.highlightedIndex,-1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:ce(u,e,-1),isOpen:u.items.length>=0};break;case Qe:i=me(u,e.highlightedIndex);break;case ze:i=r({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Ge:i={highlightedIndex:A(e.highlightedIndex,-10,u.items,u.isItemDisabled,!0)};break;case Je:i={highlightedIndex:A(e.highlightedIndex,10,u.items,u.isItemDisabled,!0)};break;case Ye:i={highlightedIndex:L(0,!1,u.items,u.isItemDisabled)};break;case Xe:i={highlightedIndex:L(u.items.length-1,!0,u.items,u.isItemDisabled)};break;case et:i=r({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&t.selectItem&&{selectedItem:u.items[e.highlightedIndex],inputValue:u.itemToString(u.items[e.highlightedIndex])});break;case Ze:i={isOpen:!0,highlightedIndex:se(u,"highlightedIndex"),inputValue:t.inputValue};break;case tt:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:ce(u,e,0)};break;case it:i={selectedItem:t.selectedItem,inputValue:u.itemToString(t.selectedItem)};break;case ot:i={inputValue:t.inputValue};break;default:return xe(e,t,rt)}return r({},e,i)}var ct=["onMouseLeave","refKey","ref"],dt=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],pt=["onClick","onPress","refKey","ref"],ft=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function ht(e){void 0===e&&(e={}),st();var n=r({},lt,e),i=n.items,u=n.scrollIntoView,s=n.environment,l=n.getA11yStatusMessage,a=function(e,n,i,o){var r=t.useRef(),u=oe(e,n,i,o),s=u[0],l=u[1],a=ve();return t.useEffect((function(){V(n,"selectedItem")&&(a||n.itemToKey(n.selectedItem)!==n.itemToKey(r.current)&&l({type:ot,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[H(s,n),l]}(at,n,ut,Ie),c=a[0],d=a[1],p=c.isOpen,f=c.highlightedIndex,h=c.selectedItem,g=c.inputValue,m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),y=t.useRef(null),b=ve(),x=ee(n),w=t.useRef(),S=ie({state:c,props:n}),C=t.useCallback((function(e){return I.current[x.getItemId(e)]}),[x]);fe(l,c,[p,f,h,g],s);var k=he({menuElement:m.current,highlightedIndex:f,isOpen:p,itemRefs:I,scrollIntoView:u,getItemNodeFromIndex:C});ge(),t.useEffect((function(){le(n,"isOpen")&&v.current&&v.current.focus()}),[]),t.useEffect((function(){b||(w.current=i.length)}));var D=de(s,[y,m,v],t.useCallback((function(){S.current.state.isOpen&&d({type:et,selectItem:!1})}),[d,S])),E=pe();t.useEffect((function(){p||(I.current={})}),[p]),t.useEffect((function(){var e;p&&null!=s&&s.document&&null!=v&&null!=(e=v.current)&&e.focus&&s.document.activeElement!==v.current&&v.current.focus()}),[p,s]);var K=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),d({type:$e,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),d({type:qe,altKey:e.altKey})},Home:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Ye}))},End:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Xe}))},Escape:function(e){var t=S.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),d({type:ze}))},Enter:function(e){S.current.state.isOpen&&229!==e.which&&(e.preventDefault(),d({type:Qe}))},PageUp:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Ge}))},PageDown:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Je}))}}}),[d,S]),P=t.useCallback((function(e){return r({id:x.labelId,htmlFor:x.inputId},e)}),[x]),T=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s,a=i.ref,c=o(i,ct),p=(void 0===t?{}:t).suppressRefError;return E("getMenuProps",void 0!==p&&p,l,m),r(((n={})[l]=M(a,(function(e){m.current=e})),n.id=x.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+x.labelId,n.onMouseLeave=O(u,(function(){d({type:11})})),n),c)}),[d,E,x]),R=t.useCallback((function(e){var t,n,i=void 0===e?{}:e,u=i.item,s=i.index,l=i.refKey,a=void 0===l?"ref":l,c=i.ref,p=i.onMouseMove,f=i.onMouseDown,h=i.onClick;i.onPress;var g=i.disabled,m=o(i,dt);void 0!==g&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var v=S.current,y=v.props,b=v.state,w=te(u,s,y.items,"Pass either item or index to getItemProps!"),C=w[0],E=w[1],K=y.isItemDisabled(C,E),P=h;return r(((t={})[a]=M(c,(function(e){e&&(I.current[x.getItemId(E)]=e)})),t["aria-disabled"]=K,t["aria-selected"]=""+(E===b.highlightedIndex),t.id=x.getItemId(E),t.role="option",t),!K&&((n={}).onClick=O(P,(function(){d({type:nt,index:E})})),n),{onMouseMove:O(p,(function(){D.isTouchEnd||E===b.highlightedIndex||(k.current=!1,d({type:12,index:E,disabled:K}))})),onMouseDown:O(f,(function(e){return e.preventDefault()}))},m)}),[d,x,S,D,k]),A=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.onClick;n.onPress;var u=n.refKey,s=void 0===u?"ref":u,l=n.ref,a=o(n,pt),c=S.current.state;return r(((t={})[s]=M(l,(function(e){y.current=e})),t["aria-controls"]=x.menuId,t["aria-expanded"]=c.isOpen,t.id=x.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&r({},{onClick:O(i,(function(){d({type:14})}))}),a)}),[d,S,x]),L=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onKeyDown,l=i.onChange,a=i.onInput,c=i.onBlur;i.onChangeText;var p=i.onClick,f=i.refKey,h=void 0===f?"ref":f,g=i.ref,m=o(i,ft),I=(void 0===t?{}:t).suppressRefError;E("getInputProps",void 0!==I&&I,h,v);var y,b=S.current.state,w={};m.disabled||((y={}).onChange=O(l,a,(function(e){d({type:Ze,inputValue:e.target.value})})),y.onKeyDown=O(u,(function(e){var t=B(e);t&&K[t]&&K[t](e)})),y.onBlur=O(c,(function(e){if(null!=s&&s.document&&b.isOpen&&!D.isMouseDown){var t=null===e.relatedTarget&&s.document.activeElement!==s.document.body;d({type:et,selectItem:!t})}})),y.onClick=O(p,(function(){d({type:tt})})),w=y);return r(((n={})[h]=M(g,(function(e){v.current=e})),n["aria-activedescendant"]=b.isOpen&&b.highlightedIndex>-1?x.getItemId(b.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=x.menuId,n["aria-expanded"]=b.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:x.labelId,n.autoComplete="off",n.id=x.inputId,n.role="combobox",n.value=b.inputValue,n),w,m)}),[d,x,s,K,S,D,E]),F=t.useCallback((function(){d({type:15})}),[d]),_=t.useCallback((function(){d({type:17})}),[d]),N=t.useCallback((function(){d({type:16})}),[d]),j=t.useCallback((function(e){d({type:18,highlightedIndex:e})}),[d]),U=t.useCallback((function(e){d({type:it,selectedItem:e})}),[d]);return{getItemProps:R,getLabelProps:P,getMenuProps:T,getInputProps:L,getToggleButtonProps:A,toggleMenu:F,openMenu:N,closeMenu:_,setHighlightedIndex:j,setInputValue:t.useCallback((function(e){d({type:20,inputValue:e})}),[d]),selectItem:U,reset:t.useCallback((function(){d({type:21})}),[d]),highlightedIndex:f,isOpen:p,selectedItem:h,inputValue:g}}ht.stateChangeTypes=rt;var gt={activeIndex:-1,selectedItems:[]};function mt(e,t){return le(e,t,gt)}function It(e,t){return se(e,t,gt)}function vt(e){return{activeIndex:mt(e,"activeIndex"),selectedItems:mt(e,"selectedItems")}}function yt(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&""!==t.value)||0===t.selectionStart&&0===t.selectionEnd}function bt(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}h.array,h.array,h.array,h.func,h.number,h.number,h.number,h.func,h.func,h.string,h.string;var xt={itemToKey:ue.itemToKey,stateReducer:ue.stateReducer,environment:ue.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},wt=S,St=0,Ct=1,kt=2,Dt=3,Ot=4,Mt=5,Et=6,Kt=7,Pt=8,Tt=9,Rt=10,Ht=11,Vt=12,Bt=Object.freeze({__proto__:null,SelectedItemClick:St,SelectedItemKeyDownDelete:Ct,SelectedItemKeyDownBackspace:kt,SelectedItemKeyDownNavigationNext:Dt,SelectedItemKeyDownNavigationPrevious:Ot,DropdownKeyDownNavigationPrevious:Mt,DropdownKeyDownBackspace:Et,DropdownClick:Kt,FunctionAddSelectedItem:Pt,FunctionRemoveSelectedItem:Tt,FunctionSetSelectedItems:Rt,FunctionSetActiveIndex:Ht,FunctionReset:Vt});function At(e,t){var n,i=t.type,o=t.index,u=t.props,s=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case St:n={activeIndex:o};break;case Ot:n={activeIndex:l-1<0?0:l-1};break;case Dt:n={activeIndex:l+1>=a.length?-1:l+1};break;case kt:case Ct:if(l<0)break;var c=l;1===a.length?c=-1:l===a.length-1&&(c=a.length-2),n=r({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:c});break;case Mt:n={activeIndex:a.length-1};break;case Et:n={selectedItems:a.slice(0,a.length-1)};break;case Pt:n={selectedItems:[].concat(a,[s])};break;case Kt:n={activeIndex:-1};break;case Tt:var d=l,p=a.findIndex((function(e){return u.itemToKey(e)===u.itemToKey(s)}));if(p<0)break;1===a.length?d=-1:p===a.length-1&&(d=a.length-2),n={selectedItems:[].concat(a.slice(0,p),a.slice(p+1)),activeIndex:d};break;case Rt:n={selectedItems:t.selectedItems};break;case Ht:n={activeIndex:t.activeIndex};break;case Vt:n={activeIndex:It(u,"activeIndex"),selectedItems:It(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,n)}var Lt=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Ft=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function _t(e){void 0===e&&(e={}),wt();var n=r({},xt,e),i=n.getA11yStatusMessage,u=n.environment,s=n.keyNavigationNext,l=n.keyNavigationPrevious,a=re(At,n,vt,bt),c=a[0],d=a[1],p=c.activeIndex,f=c.selectedItems,h=ve(),g=t.useRef(null),m=t.useRef();m.current=[];var I=ie({state:c,props:n});fe(i,c,[p,f],u),t.useEffect((function(){h||(-1===p&&g.current?g.current.focus():m.current[p]&&m.current[p].focus())}),[p]),ge();var v=pe(),y=t.useMemo((function(){var e;return(e={})[l]=function(){d({type:Ot})},e[s]=function(){d({type:Dt})},e.Delete=function(){d({type:Ct})},e.Backspace=function(){d({type:kt})},e}),[d,s,l]),b=t.useMemo((function(){var e;return(e={})[l]=function(e){yt(e)&&d({type:Mt})},e.Backspace=function(e){yt(e)&&d({type:Et})},e}),[d,l]);return{getSelectedItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.refKey,u=void 0===i?"ref":i,s=n.ref,l=n.onClick,a=n.onKeyDown,c=n.selectedItem,p=n.index,f=o(n,Lt),h=I.current.state,g=te(c,p,h.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],v=g>-1&&g===h.activeIndex;return r(((t={})[u]=M(s,(function(e){e&&m.current.push(e)})),t.tabIndex=v?0:-1,t.onClick=O(l,(function(){d({type:St,index:g})})),t.onKeyDown=O(a,(function(e){var t=B(e);t&&y[t]&&y[t](e)})),t),f)}),[d,I,y]),getDropdownProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.refKey,s=void 0===u?"ref":u,l=i.ref,a=i.onKeyDown,c=i.onClick,p=i.preventKeyAction,f=void 0!==p&&p,h=o(i,Ft),m=(void 0===t?{}:t).suppressRefError;return v("getDropdownProps",void 0!==m&&m,s,g),r(((n={})[s]=M(l,(function(e){e&&(g.current=e)})),n),!f&&{onKeyDown:O(a,(function(e){var t=B(e);t&&b[t]&&b[t](e)})),onClick:O(c,(function(){d({type:Kt})}))},h)}),[d,b,v]),addSelectedItem:t.useCallback((function(e){d({type:Pt,selectedItem:e})}),[d]),removeSelectedItem:t.useCallback((function(e){d({type:Tt,selectedItem:e})}),[d]),setSelectedItems:t.useCallback((function(e){d({type:Rt,selectedItems:e})}),[d]),setActiveIndex:t.useCallback((function(e){d({type:Ht,activeIndex:e})}),[d]),reset:t.useCallback((function(){d({type:Vt})}),[d]),selectedItems:f,activeIndex:p}}_t.stateChangeTypes=Bt,e.default=X,e.resetIdCounter=function(){"useId"in i.default?console.warn("It is not necessary to call resetIdCounter when using React 18+"):x=0},e.useCombobox=ht,e.useMultipleSelection=_t,e.useSelect=We,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Downshift={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(t);function o(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},r.apply(this,arguments)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l,a,c,d,p={exports:{}};p.exports=function(){if(d)return c;d=1;var e=a?l:(a=1,l="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,c=function(){function i(t,n,i,o,r,u){if(u!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return i}i.isRequired=i;var r={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return r.PropTypes=r,r}}()();var f,h=s(p.exports),g={};!function(){if(f)return g;f=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function I(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case i:case r:case o:case c:case d:return e;default:switch(e=e&&e.$$typeof){case l:case s:case a:case h:case p:case u:return e;default:return f}}case n:return f}}}e=Symbol.for("react.module.reference"),g.ContextConsumer=s,g.ContextProvider=u,g.Element=t,g.ForwardRef=a,g.Fragment=i,g.Lazy=h,g.Memo=p,g.Portal=n,g.Profiler=r,g.StrictMode=o,g.Suspense=c,g.SuspenseList=d,g.isAsyncMode=function(){return!1},g.isConcurrentMode=function(){return!1},g.isContextConsumer=function(e){return I(e)===s},g.isContextProvider=function(e){return I(e)===u},g.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},g.isForwardRef=function(e){return I(e)===a},g.isFragment=function(e){return I(e)===i},g.isLazy=function(e){return I(e)===h},g.isMemo=function(e){return I(e)===p},g.isPortal=function(e){return I(e)===n},g.isProfiler=function(e){return I(e)===r},g.isStrictMode=function(e){return I(e)===o},g.isSuspense=function(e){return I(e)===c},g.isSuspenseList=function(e){return I(e)===d},g.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===r||t===o||t===c||t===d||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===h||t.$$typeof===p||t.$$typeof===u||t.$$typeof===s||t.$$typeof===a||t.$$typeof===e||void 0!==t.getModuleId)},g.typeOf=I}();const m=e=>"object"==typeof e&&null!=e&&1===e.nodeType,I=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,v=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return I(n.overflowY,t)||I(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},y=(e,t,n,i,o,r,u,s)=>r<e&&u>t||r>e&&u<t?0:r<=e&&s<=n||u>=t&&s>=n?r-e-i:u>t&&s<n||r<e&&s>n?u-t+o:0,b=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var x=0;function w(e){return"function"==typeof e?e:S}function S(){}function C(e,t){if(e){var n=((e,t)=>{var n,i,o,r;if("undefined"==typeof document)return[];const{scrollMode:u,block:s,inline:l,boundary:a,skipOverflowHiddenElements:c}=t,d="function"==typeof a?a:e=>e!==a;if(!m(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,f=[];let h=e;for(;m(h)&&d(h);){if(h=b(h),h===p){f.push(h);break}null!=h&&h===document.body&&v(h)&&!v(document.documentElement)||null!=h&&v(h,c)&&f.push(h)}const g=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,I=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,{scrollX:x,scrollY:w}=window,{height:S,width:C,top:k,right:D,bottom:O,left:M}=e.getBoundingClientRect(),{top:E,right:K,bottom:P,left:T}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let R="start"===s||"nearest"===s?k-E:"end"===s?O+P:k+S/2-E+P,H="center"===l?M+C/2-T+K:"end"===l?D+K:M-T;const V=[];for(let e=0;e<f.length;e++){const t=f[e],{height:n,width:i,top:o,right:r,bottom:a,left:c}=t.getBoundingClientRect();if("if-needed"===u&&k>=0&&M>=0&&O<=I&&D<=g&&k>=o&&O<=a&&M>=c&&D<=r)return V;const d=getComputedStyle(t),h=parseInt(d.borderLeftWidth,10),m=parseInt(d.borderTopWidth,10),v=parseInt(d.borderRightWidth,10),b=parseInt(d.borderBottomWidth,10);let E=0,K=0;const P="offsetWidth"in t?t.offsetWidth-t.clientWidth-h-v:0,T="offsetHeight"in t?t.offsetHeight-t.clientHeight-m-b:0,B="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,A="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(p===t)E="start"===s?R:"end"===s?R-I:"nearest"===s?y(w,w+I,I,m,b,w+R,w+R+S,S):R-I/2,K="start"===l?H:"center"===l?H-g/2:"end"===l?H-g:y(x,x+g,g,h,v,x+H,x+H+C,C),E=Math.max(0,E+w),K=Math.max(0,K+x);else{E="start"===s?R-o-m:"end"===s?R-a+b+T:"nearest"===s?y(o,a,n,m,b+T,R,R+S,S):R-(o+n/2)+T/2,K="start"===l?H-c-h:"center"===l?H-(c+i/2)+P/2:"end"===l?H-r+v+P:y(c,r,i,h,v+P,H,H+C,C);const{scrollLeft:e,scrollTop:u}=t;E=0===A?0:Math.max(0,Math.min(u+E/A,t.scrollHeight-n/A+T)),K=0===B?0:Math.max(0,Math.min(e+K/B,t.scrollWidth-i/B+P)),R+=u-E,H+=e-K}V.push({el:t,top:E,left:K})}return V})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,i=e.left;t.scrollTop=n,t.scrollLeft=i}))}}function k(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function D(e,t){var n;function i(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,r=new Array(o),u=0;u<o;u++)r[u]=arguments[u];i(),n=setTimeout((function(){n=null,e.apply(void 0,r)}),t)}return o.cancel=i,o}function O(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(i)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function M(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function E(){return String(x++)}function K(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function P(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var T=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function R(e){void 0===e&&(e={});var t={};return T.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function H(e,t){return e&&t?Object.keys(e).reduce((function(n,i){return n[i]=V(t,i)?t[i]:e[i],n}),{}):e}function V(e,t){return void 0!==e[t]}function B(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function A(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(0===r)return-1;var u=r-1;("number"!=typeof e||e<0||e>u)&&(e=t>0?-1:u+1);var s=e+t;s<0?s=o?u:0:s>u&&(s=o?0:u);var l=L(s,t<0,n,i,o);return-1===l?e>=r?-1:e:l}function L(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(t){for(var u=e;u>=0;u--)if(!i(n[u],u))return u}else for(var s=e;s<r;s++)if(!i(n[s],s))return s;return o?L(t?r-1:0,t,n,i):-1}function F(e,t,n,i){return void 0===i&&(i=!0),n&&t.some((function(t){return t&&(k(t,e,n)||i&&k(t,n.document.activeElement,n))}))}var _=D((function(e){N(e).textContent=""}),500);function N(e){var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function j(e,t){e&&t&&(N(t).textContent=e,_(t))}var U=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),W=["refKey","ref"],$=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],q=["onKeyDown","onBlur","onChange","onInput","onChangeText"],z=["refKey","ref"],Y=["onMouseMove","onMouseDown","onClick","onPress","index","item"],X=function(){var e=function(e){function n(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+E(),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var i=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==i})),e()}),t);n.timeoutIds.push(i)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.isItemDisabled=function(e,t){var i=n.getItemNodeFromIndex(t);return i&&i.hasAttribute("disabled")},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=R(t),n.internalSetState(r({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,i){t=R(t),n.internalSetState(r({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),i)},n.selectItemAtIndex=function(e,t,i){var o=n.items[e];null!=o&&n.selectItem(o,t,i)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var i,o,u={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,r({},n.getStateAndHelpers(),e)),n.setState((function(t){var l;t=n.getState(t);var a=s?e(t):e;a=n.props.stateReducer(t,a),i=a.hasOwnProperty("selectedItem");var c={};return i&&a.selectedItem!==t.selectedItem&&(o=a.selectedItem),(l=a).type||(l.type=0),Object.keys(a).forEach((function(e){t[e]!==a[e]&&(u[e]=a[e]),"type"!==e&&(a[e],V(n.props,e)||(c[e]=a[e]))})),s&&a.hasOwnProperty("inputValue")&&n.props.onInputValueChange(a.inputValue,r({},n.getStateAndHelpers(),a)),c}),(function(){w(t)(),Object.keys(u).length>1&&n.props.onStateChange(u,n.getStateAndHelpers()),i&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(u,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var i,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=o(u,W),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=p;var f=n.getState().isOpen;return r(((i={})[l]=M(a,n.rootRef),i.role="combobox",i["aria-expanded"]=f,i["aria-haspopup"]="listbox",i["aria-owns"]=f?n.menuId:void 0,i["aria-labelledby"]=n.labelId,i),c)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=A(t.getState().highlightedIndex,1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=A(t.getState().highlightedIndex,-1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,i=t.highlightedIndex;if(n&&null!=i){e.preventDefault();var o=this.items[i],r=this.getItemNodeFromIndex(i);if(null==o||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(r({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=r({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=r({},n.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=L(0,!1,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:7})}}},End:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=L(n-1,!0,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick;t.onPress;var u=t.onKeyDown,s=t.onKeyUp,l=t.onBlur,a=o(t,$),c=n.getState().isOpen,d={onClick:O(i,n.buttonHandleClick),onKeyDown:O(u,n.buttonHandleKeyDown),onKeyUp:O(s,n.buttonHandleKeyUp),onBlur:O(l,n.buttonHandleBlur)};return r({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:d,a)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=B(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(n,e)},n.buttonHandleClick=function(e){if(e.preventDefault(),n.props.environment){var t=n.props.environment.document,i=t.body,o=t.activeElement;i&&i===o&&e.target.focus()}n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){if(!n.isMouseDown&&n.props.environment){var e=n.props.environment.document.activeElement;null!=e&&e.id===n.inputId||e===t||n.reset({type:14})}}))},n.getLabelProps=function(e){return r({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,u=t.onBlur,s=t.onChange,l=t.onInput;t.onChangeText;var a=o(t,q),c={};var d,p=n.getState(),f=p.inputValue,h=p.isOpen,g=p.highlightedIndex;a.disabled||((d={}).onChange=O(s,l,n.inputHandleChange),d.onKeyDown=O(i,n.inputHandleKeyDown),d.onBlur=O(u,n.inputHandleBlur),c=d);return r({"aria-autocomplete":"list","aria-activedescendant":h&&"number"==typeof g&&g>=0?n.getItemId(g):void 0,"aria-controls":h?n.menuId:void 0,"aria-labelledby":a&&a["aria-label"]?void 0:n.labelId,autoComplete:"off",value:f,id:n.inputId},c,a)},n.inputHandleKeyDown=function(e){var t=B(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(n,e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e;if(!n.isMouseDown&&n.props.environment){var t=n.props.environment.document.activeElement;(null==t||null==(e=t.dataset)?void 0:e.toggle)&&n._rootNode&&n._rootNode.contains(t)||n.reset({type:10})}}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var i,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=o(u,z),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=p,r(((i={})[l]=M(a,n.menuRef),i.role="listbox",i["aria-labelledby"]=c&&c["aria-label"]?void 0:n.labelId,i.id=n.menuId,i),c)},n.getItemProps=function(e){var t,i=void 0===e?{}:e,u=i.onMouseMove,s=i.onMouseDown,l=i.onClick;i.onPress;var a=i.index,c=i.item,d=void 0===c?void 0:c,p=o(i,Y);void 0===a?(n.items.push(d),a=n.items.indexOf(d)):n.items[a]=d;var f=l,h=((t={onMouseMove:O(u,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:O(s,(function(e){e.preventDefault()}))}).onClick=O(f,(function(){n.selectItemAtIndex(a,{type:9})})),t),g=p.disabled?{onMouseDown:h.onMouseDown}:h;return r({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},g,p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=R(e),n.internalSetState((function(t){var i=t.selectedItem;return r({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(i)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=R(e),n.internalSetState((function(t){var i=t.isOpen;return r({isOpen:!i},i&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var i=n.getState(),o=i.isOpen,r=i.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof r&&n.setHighlightedIndex(r,e),w(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=D((function(){var e;if(null!=(e=n.props)&&null!=(e=e.environment)&&e.document){var t=n.getState(),i=n.items[t.highlightedIndex],o=n.getItemCount(),u=n.props.getA11yStatusMessage(r({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:o,highlightedItem:i},t));n.previousResultCount=o,j(u,n.props.environment.document)}}),200);var i=n.props,u=i.defaultHighlightedIndex,s=i.initialHighlightedIndex,l=void 0===s?u:s,a=i.defaultIsOpen,c=i.initialIsOpen,d=void 0===c?a:c,p=i.initialInputValue,f=void 0===p?"":p,h=i.initialSelectedItem,g=void 0===h?null:h,m=n.getState({highlightedIndex:l,isOpen:d,inputValue:f,selectedItem:g});return null!=m.selectedItem&&void 0===n.props.initialInputValue&&(m.inputValue=n.props.itemToString(m.selectedItem)),n.state=m,n}var i,s;s=e,(i=n).prototype=Object.create(s.prototype),i.prototype.constructor=i,u(i,s);var l=n.prototype;return l.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},l.getState=function(e){return void 0===e&&(e=this.state),H(e,this.props)},l.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},l.getItemNodeFromIndex=function(e){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(e)):null},l.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},l.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),i=this.getState().highlightedIndex;if(n>0){var o=A(i,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(o,t)}},l.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,i=e.selectedItem,o=e.isOpen,r=this.props.itemToString,u=this.id,s=this.getRootProps,l=this.getToggleButtonProps,a=this.getLabelProps,c=this.getMenuProps,d=this.getInputProps,p=this.getItemProps,f=this.openMenu,h=this.closeMenu,g=this.toggleMenu,m=this.selectItem,I=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,b=this.clearSelection,x=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:a,getMenuProps:c,getInputProps:d,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:h,toggleMenu:g,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:i}},l.componentDidMount=function(){var e=this;if(this.props.environment){var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!F(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},i=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},r=function(t){var n=F(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",t),u.addEventListener("mouseup",n),u.addEventListener("touchstart",i),u.addEventListener("touchmove",o),u.addEventListener("touchend",r),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",i),u.removeEventListener("touchmove",o),u.removeEventListener("touchend",r)}}else this.cleanup=function(){e.internalClearTimeouts()}},l.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,i=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==i},l.componentDidUpdate=function(e,t){V(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},l.componentWillUnmount=function(){this.cleanup()},l.render=function(){var e=P(this.props.children,S);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var n=P(e(this.getStateAndHelpers()));return n?this.getRootProps.called||this.props.suppressRefError?n:function(e){return"string"==typeof e.type}(n)?t.cloneElement(n,this.getRootProps(function(e){return e.props}(n))):void 0:null},n}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:K,itemToString:function(e){return null==e?"":String(e)},onStateChange:S,onInputValueChange:S,onUserAction:S,onChange:S,onSelect:S,onOuterClick:S,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:C},e.stateChangeTypes=U,e}(),G={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function J(e,t,n){var i=e.props,o=e.type,u={};Object.keys(t).forEach((function(i){!function(e,t,n,i){var o=t.props,u=t.type,s="on"+ne(e)+"Change";o[s]&&void 0!==i[e]&&i[e]!==n[e]&&o[s](r({type:u},i))}(i,e,t,n),n[i]!==t[i]&&(u[i]=n[i])})),i.onStateChange&&Object.keys(u).length&&i.onStateChange(r({type:o},u))}var Q=D((function(e,t){j(e,t)}),200),Z="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,ee="useId"in i.default?function(e){var n=e.id,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId,a="downshift-"+i.default.useId();return n||(n=a),t.useRef({labelId:o||n+"-label",menuId:r||n+"-menu",getItemId:u||function(e){return n+"-item-"+e},toggleButtonId:s||n+"-toggle-button",inputId:l||n+"-input"}).current}:function(e){var n=e.id,i=void 0===n?"downshift-"+E():n,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId;return t.useRef({labelId:o||i+"-label",menuId:r||i+"-menu",getItemId:u||function(e){return i+"-item-"+e},toggleButtonId:s||i+"-toggle-button",inputId:l||i+"-input"}).current};function te(e,t,n,i){var o,r;if(void 0===e){if(void 0===t)throw new Error(i);o=n[t],r=t}else r=void 0===t?n.indexOf(e):t,o=e;return[o,r]}function ne(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function ie(e){var n=t.useRef(e);return n.current=e,n}function oe(e,n,i,o){var u=t.useRef(),s=t.useRef(),l=t.useCallback((function(t,n){s.current=n,t=H(t,n.props);var i=e(t,n);return n.props.stateReducer(t,r({},n,{changes:i}))}),[e]),a=t.useReducer(l,n,i),c=a[0],d=a[1],p=ie(n),f=t.useCallback((function(e){return d(r({props:p.current},e))}),[p]),h=s.current;return t.useEffect((function(){var e=H(u.current,null==h?void 0:h.props);h&&u.current&&!o(e,c)&&J(h,e,c),u.current=c}),[c,h,o]),[c,f]}function re(e,t,n,i){var o=oe(e,t,n,i),r=o[0],u=o[1];return[H(r,t),u]}var ue={itemToString:function(e){return e?String(e):""},itemToKey:function(e){return e},stateReducer:function(e,t){return t.changes},scrollIntoView:C,environment:"undefined"==typeof window?void 0:window};function se(e,t,n){void 0===n&&(n=G);var i=e["default"+ne(t)];return void 0!==i?i:n[t]}function le(e,t,n){void 0===n&&(n=G);var i=e[t];if(void 0!==i)return i;var o=e["initial"+ne(t)];return void 0!==o?o:se(e,t,n)}function ae(e){var t=le(e,"selectedItem"),n=le(e,"isOpen"),i=le(e,"highlightedIndex"),o=le(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.findIndex((function(n){return e.itemToKey(n)===e.itemToKey(t)})):i,isOpen:n,selectedItem:t,inputValue:o}}function ce(e,t,n){var i=e.items,o=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=e.isItemDisabled,s=e.itemToKey,l=t.selectedItem,a=t.highlightedIndex;return 0===i.length?-1:void 0===o||a!==o||u(i[o])?void 0===r||u(i[r])?l?i.findIndex((function(e){return s(l)===s(e)})):n<0&&!u(i[i.length-1])?i.length-1:n>0&&!u(i[0])?0:-1:r:o}function de(e,n,i){var o=t.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return t.useEffect((function(){if(!e)return S;var t=n.map((function(e){return e.current}));function r(){o.current.isTouchEnd=!1,o.current.isMouseDown=!0}function u(n){o.current.isMouseDown=!1,F(n.target,t,e)||i()}function s(){o.current.isTouchEnd=!1,o.current.isTouchMove=!1}function l(){o.current.isTouchMove=!0}function a(n){o.current.isTouchEnd=!0,o.current.isTouchMove||F(n.target,t,e,!1)||i()}return e.addEventListener("mousedown",r),e.addEventListener("mouseup",u),e.addEventListener("touchstart",s),e.addEventListener("touchmove",l),e.addEventListener("touchend",a),function(){e.removeEventListener("mousedown",r),e.removeEventListener("mouseup",u),e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",a)}}),[e,i]),o.current}var pe=function(){return S};function fe(e,n,i,o){void 0===o&&(o={});var r=o.document,u=ve();t.useEffect((function(){if(e&&!u&&r){var t=e(n);Q(t,r)}}),i),t.useEffect((function(){return function(){var e,t;Q.cancel(),(t=null==(e=r)?void 0:e.getElementById("a11y-status-message"))&&t.remove()}}),[r])}function he(e){var n=e.highlightedIndex,i=e.isOpen,o=e.itemRefs,r=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,l=t.useRef(!0);return Z((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var ge=S;function me(e,t,n){var i;return void 0===n&&(n=!0),r({isOpen:!1,highlightedIndex:-1},(null==(i=e.items)?void 0:i.length)&&t>=0&&r({selectedItem:e.items[t],isOpen:se(e,"isOpen"),highlightedIndex:se(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function Ie(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function ve(){var e=i.default.useRef(!0);return i.default.useEffect((function(){return e.current=!1,function(){e.current=!0}}),[]),e.current}var ye={environment:h.shape({addEventListener:h.func.isRequired,removeEventListener:h.func.isRequired,document:h.shape({createElement:h.func.isRequired,getElementById:h.func.isRequired,activeElement:h.any.isRequired,body:h.any.isRequired}).isRequired,Node:h.func.isRequired}),itemToString:h.func,itemToKey:h.func,stateReducer:h.func},be=r({},ye,{getA11yStatusMessage:h.func,highlightedIndex:h.number,defaultHighlightedIndex:h.number,initialHighlightedIndex:h.number,isOpen:h.bool,defaultIsOpen:h.bool,initialIsOpen:h.bool,selectedItem:h.any,initialSelectedItem:h.any,defaultSelectedItem:h.any,id:h.string,labelId:h.string,menuId:h.string,getItemId:h.func,toggleButtonId:h.string,onSelectedItemChange:h.func,onHighlightedIndexChange:h.func,onStateChange:h.func,onIsOpenChange:h.func,scrollIntoView:h.func});function xe(e,t,n){var i,o=t.type,u=t.props;switch(o){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:ce(u,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:ce(u,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:se(u,"highlightedIndex"),isOpen:se(u,"isOpen"),selectedItem:se(u,"selectedItem"),inputValue:se(u,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,i)}var we=function(){return we=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},we.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,we(we({},be),{items:h.array.isRequired,isItemDisabled:h.func});var Se=we(we({},ue),{isItemDisabled:function(){return!1}}),Ce=S,ke=1,De=2,Oe=3,Me=4,Ee=5,Ke=6,Pe=7,Te=8,Re=9,He=10,Ve=11,Be=14,Ae=19,Le=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:ke,ToggleButtonKeyDownArrowUp:De,ToggleButtonKeyDownCharacter:Oe,ToggleButtonKeyDownEscape:Me,ToggleButtonKeyDownHome:Ee,ToggleButtonKeyDownEnd:Ke,ToggleButtonKeyDownEnter:Pe,ToggleButtonKeyDownSpaceButton:Te,ToggleButtonKeyDownPageUp:Re,ToggleButtonKeyDownPageDown:He,ToggleButtonBlur:Ve,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:Be,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Ae,FunctionSetInputValue:20,FunctionReset:21});function Fe(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case Be:i={isOpen:se(u,"isOpen"),highlightedIndex:se(u,"highlightedIndex"),selectedItem:u.items[t.index]};break;case Oe:var l=t.key,a=""+e.inputValue+l;i={inputValue:a,highlightedIndex:function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.isItemDisabled,u=t.toLowerCase(),s=0;s<i.length;s++){var l=(s+n+(t.length<2?1:0))%i.length,a=i[l];if(void 0!==a&&o(a).toLowerCase().startsWith(u)&&!r(a,l))return l}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?u.items.findIndex((function(t){return u.itemToKey(t)===u.itemToKey(e.selectedItem)})):e.highlightedIndex,items:u.items,itemToString:u.itemToString,isItemDisabled:u.isItemDisabled}),isOpen:!0};break;case ke:i={highlightedIndex:e.isOpen?A(e.highlightedIndex,1,u.items,u.isItemDisabled):s&&null==e.selectedItem?-1:ce(u,e,1),isOpen:!0};break;case De:if(e.isOpen&&s)i=me(u,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?A(e.highlightedIndex,-1,u.items,u.isItemDisabled):ce(u,e,-1),isOpen:!0};break;case Pe:case Te:i=me(u,e.highlightedIndex,!1);break;case Ee:i={highlightedIndex:L(0,!1,u.items,u.isItemDisabled),isOpen:!0};break;case Ke:i={highlightedIndex:L(u.items.length-1,!0,u.items,u.isItemDisabled),isOpen:!0};break;case Re:i={highlightedIndex:A(e.highlightedIndex,-10,u.items,u.isItemDisabled)};break;case He:i={highlightedIndex:A(e.highlightedIndex,10,u.items,u.isItemDisabled)};break;case Me:i={isOpen:!1,highlightedIndex:-1};break;case Ve:i=r({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&{selectedItem:u.items[e.highlightedIndex]});break;case Ae:i={selectedItem:t.selectedItem};break;default:return xe(e,t,Le)}return r({},e,i)}var _e=["onClick"],Ne=["onMouseLeave","refKey","ref"],je=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],Ue=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function We(e){void 0===e&&(e={}),Ce();var n=r({},Se,e),i=n.scrollIntoView,u=n.environment,s=n.getA11yStatusMessage,l=re(Fe,n,ae,Ie),a=l[0],c=l[1],d=a.isOpen,p=a.highlightedIndex,f=a.selectedItem,h=a.inputValue,g=t.useRef(null),m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),y=ee(n),b=ie({state:a,props:n}),x=t.useCallback((function(e){return I.current[y.getItemId(e)]}),[y]);fe(s,a,[d,p,f,h],u);var w=he({menuElement:m.current,highlightedIndex:p,isOpen:d,itemRefs:I,scrollIntoView:i,getItemNodeFromIndex:x});t.useEffect((function(){return v.current=D((function(e){e({type:20,inputValue:""})}),500),function(){v.current.cancel()}}),[]),t.useEffect((function(){h&&v.current(c)}),[c,h]),ge(),t.useEffect((function(){le(n,"isOpen")&&g.current&&g.current.focus()}),[]);var S=de(u,[g,m],t.useCallback((function(){b.current.state.isOpen&&c({type:Ve})}),[c,b])),C=pe();t.useEffect((function(){d||(I.current={})}),[d]);var k=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),c({type:ke,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:De,altKey:e.altKey})},Home:function(e){e.preventDefault(),c({type:Ee})},End:function(e){e.preventDefault(),c({type:Ke})},Escape:function(){b.current.state.isOpen&&c({type:Me})},Enter:function(e){e.preventDefault(),c({type:b.current.state.isOpen?Pe:0})},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Re}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:He}))}," ":function(e){e.preventDefault();var t=b.current.state;t.isOpen?t.inputValue?c({type:Oe,key:" "}):c({type:Te}):c({type:0})}}}),[c,b]),E=t.useCallback((function(){c({type:15})}),[c]),K=t.useCallback((function(){c({type:17})}),[c]),P=t.useCallback((function(){c({type:16})}),[c]),T=t.useCallback((function(e){c({type:18,highlightedIndex:e})}),[c]),R=t.useCallback((function(e){c({type:Ae,selectedItem:e})}),[c]),H=t.useCallback((function(){c({type:21})}),[c]),V=t.useCallback((function(e){c({type:20,inputValue:e})}),[c]),A=t.useCallback((function(e){var t=void 0===e?{}:e,n=t.onClick,i=o(t,_e);return r({id:y.labelId,htmlFor:y.toggleButtonId,onClick:O(n,(function(){var e;null==(e=g.current)||e.focus()}))},i)}),[y]),L=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s,a=i.ref,d=o(i,Ne),p=(void 0===t?{}:t).suppressRefError;return C("getMenuProps",void 0!==p&&p,l,m),r(((n={})[l]=M(a,(function(e){m.current=e})),n.id=y.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+y.labelId,n.onMouseLeave=O(u,(function(){c({type:12})})),n),d)}),[c,C,y]),F=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onBlur,s=i.onClick;i.onPress;var l=i.onKeyDown,a=i.refKey,d=void 0===a?"ref":a,p=i.ref,f=o(i,je),h=(void 0===t?{}:t).suppressRefError,m=void 0!==h&&h,I=b.current.state,v=r(((n={})[d]=M(p,(function(e){g.current=e})),n["aria-activedescendant"]=I.isOpen&&I.highlightedIndex>-1?y.getItemId(I.highlightedIndex):"",n["aria-controls"]=y.menuId,n["aria-expanded"]=b.current.state.isOpen,n["aria-haspopup"]="listbox",n["aria-labelledby"]=f&&f["aria-label"]?void 0:""+y.labelId,n.id=y.toggleButtonId,n.role="combobox",n.tabIndex=0,n.onBlur=O(u,(function(){I.isOpen&&!S.isMouseDown&&c({type:Ve})})),n),f);return f.disabled||(v.onClick=O(s,(function(){c({type:0})})),v.onKeyDown=O(l,(function(e){var t=B(e);t&&k[t]?k[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&c({type:Oe,key:t})}))),C("getToggleButtonProps",m,d,g),v}),[c,y,b,S,C,k]),_=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,u=n.index,s=n.onMouseMove,l=n.onClick,a=n.onMouseDown;n.onPress;var d=n.refKey,p=void 0===d?"ref":d,f=n.disabled,h=n.ref,g=o(n,Ue);void 0!==f&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var m=b.current,v=m.state,x=m.props,C=te(i,u,x.items,"Pass either item or index to getItemProps!"),k=C[0],D=C[1],E=x.isItemDisabled(k,D),K=r(((t={})[p]=M(h,(function(e){e&&(I.current[y.getItemId(D)]=e)})),t["aria-disabled"]=E,t["aria-selected"]=""+(k===v.selectedItem),t.id=y.getItemId(D),t.role="option",t),g);return E||(K.onClick=O(l,(function(){c({type:Be,index:D})}))),K.onMouseMove=O(s,(function(){S.isTouchEnd||D===v.highlightedIndex||(w.current=!1,c({type:13,index:D,disabled:E}))})),K.onMouseDown=O(a,(function(e){return e.preventDefault()})),K}),[b,y,S,w,c]);return{getToggleButtonProps:F,getLabelProps:A,getMenuProps:L,getItemProps:_,toggleMenu:E,openMenu:P,closeMenu:K,setHighlightedIndex:T,selectItem:R,reset:H,setInputValue:V,highlightedIndex:p,isOpen:d,selectedItem:f,inputValue:h}}We.stateChangeTypes=Le;var $e=0,qe=1,ze=2,Ye=3,Xe=4,Ge=5,Je=6,Qe=7,Ze=8,et=9,tt=10,nt=13,it=19,ot=22,rt=Object.freeze({__proto__:null,InputKeyDownArrowDown:$e,InputKeyDownArrowUp:qe,InputKeyDownEscape:ze,InputKeyDownHome:Ye,InputKeyDownEnd:Xe,InputKeyDownPageUp:Ge,InputKeyDownPageDown:Je,InputKeyDownEnter:Qe,InputChange:Ze,InputBlur:et,InputClick:tt,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:nt,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:it,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:ot});function ut(e){var t=ae(e),n=t.selectedItem,i=t.inputValue;return""===i&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(i=e.itemToString(n)),r({},t,{inputValue:i})}r({},be,{items:h.array.isRequired,isItemDisabled:h.func,inputValue:h.string,defaultInputValue:h.string,initialInputValue:h.string,inputId:h.string,onInputValueChange:h.func});var st=S,lt=r({},ue,{isItemDisabled:function(){return!1}});function at(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case nt:i={isOpen:se(u,"isOpen"),highlightedIndex:se(u,"highlightedIndex"),selectedItem:u.items[t.index],inputValue:u.itemToString(u.items[t.index])};break;case $e:i=e.isOpen?{highlightedIndex:A(e.highlightedIndex,1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:s&&null==e.selectedItem?-1:ce(u,e,1),isOpen:u.items.length>=0};break;case qe:i=e.isOpen?s?me(u,e.highlightedIndex):{highlightedIndex:A(e.highlightedIndex,-1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:ce(u,e,-1),isOpen:u.items.length>=0};break;case Qe:i=me(u,e.highlightedIndex);break;case ze:i=r({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Ge:i={highlightedIndex:A(e.highlightedIndex,-10,u.items,u.isItemDisabled,!0)};break;case Je:i={highlightedIndex:A(e.highlightedIndex,10,u.items,u.isItemDisabled,!0)};break;case Ye:i={highlightedIndex:L(0,!1,u.items,u.isItemDisabled)};break;case Xe:i={highlightedIndex:L(u.items.length-1,!0,u.items,u.isItemDisabled)};break;case et:i=r({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&t.selectItem&&{selectedItem:u.items[e.highlightedIndex],inputValue:u.itemToString(u.items[e.highlightedIndex])});break;case Ze:i={isOpen:!0,highlightedIndex:se(u,"highlightedIndex"),inputValue:t.inputValue};break;case tt:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:ce(u,e,0)};break;case it:i={selectedItem:t.selectedItem,inputValue:u.itemToString(t.selectedItem)};break;case ot:i={inputValue:t.inputValue};break;default:return xe(e,t,rt)}return r({},e,i)}var ct=["onMouseLeave","refKey","ref"],dt=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],pt=["onClick","onPress","refKey","ref"],ft=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function ht(e){void 0===e&&(e={}),st();var n=r({},lt,e),i=n.items,u=n.scrollIntoView,s=n.environment,l=n.getA11yStatusMessage,a=function(e,n,i,o){var r=t.useRef(),u=oe(e,n,i,o),s=u[0],l=u[1],a=ve();return t.useEffect((function(){V(n,"selectedItem")&&(a||n.itemToKey(n.selectedItem)!==n.itemToKey(r.current)&&l({type:ot,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[H(s,n),l]}(at,n,ut,Ie),c=a[0],d=a[1],p=c.isOpen,f=c.highlightedIndex,h=c.selectedItem,g=c.inputValue,m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),y=t.useRef(null),b=ve(),x=ee(n),w=t.useRef(),S=ie({state:c,props:n}),C=t.useCallback((function(e){return I.current[x.getItemId(e)]}),[x]);fe(l,c,[p,f,h,g],s);var k=he({menuElement:m.current,highlightedIndex:f,isOpen:p,itemRefs:I,scrollIntoView:u,getItemNodeFromIndex:C});ge(),t.useEffect((function(){le(n,"isOpen")&&v.current&&v.current.focus()}),[]),t.useEffect((function(){b||(w.current=i.length)}));var D=de(s,[y,m,v],t.useCallback((function(){S.current.state.isOpen&&d({type:et,selectItem:!1})}),[d,S])),E=pe();t.useEffect((function(){p||(I.current={})}),[p]),t.useEffect((function(){var e;p&&null!=s&&s.document&&null!=v&&null!=(e=v.current)&&e.focus&&s.document.activeElement!==v.current&&v.current.focus()}),[p,s]);var K=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),d({type:$e,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),d({type:qe,altKey:e.altKey})},Home:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Ye}))},End:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Xe}))},Escape:function(e){var t=S.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),d({type:ze}))},Enter:function(e){S.current.state.isOpen&&229!==e.which&&(e.preventDefault(),d({type:Qe}))},PageUp:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Ge}))},PageDown:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Je}))}}}),[d,S]),P=t.useCallback((function(e){return r({id:x.labelId,htmlFor:x.inputId},e)}),[x]),T=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s,a=i.ref,c=o(i,ct),p=(void 0===t?{}:t).suppressRefError;return E("getMenuProps",void 0!==p&&p,l,m),r(((n={})[l]=M(a,(function(e){m.current=e})),n.id=x.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+x.labelId,n.onMouseLeave=O(u,(function(){d({type:11})})),n),c)}),[d,E,x]),R=t.useCallback((function(e){var t,n,i=void 0===e?{}:e,u=i.item,s=i.index,l=i.refKey,a=void 0===l?"ref":l,c=i.ref,p=i.onMouseMove,f=i.onMouseDown,h=i.onClick;i.onPress;var g=i.disabled,m=o(i,dt);void 0!==g&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var v=S.current,y=v.props,b=v.state,w=te(u,s,y.items,"Pass either item or index to getItemProps!"),C=w[0],E=w[1],K=y.isItemDisabled(C,E),P=h;return r(((t={})[a]=M(c,(function(e){e&&(I.current[x.getItemId(E)]=e)})),t["aria-disabled"]=K,t["aria-selected"]=""+(E===b.highlightedIndex),t.id=x.getItemId(E),t.role="option",t),!K&&((n={}).onClick=O(P,(function(){d({type:nt,index:E})})),n),{onMouseMove:O(p,(function(){D.isTouchEnd||E===b.highlightedIndex||(k.current=!1,d({type:12,index:E,disabled:K}))})),onMouseDown:O(f,(function(e){return e.preventDefault()}))},m)}),[d,x,S,D,k]),A=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.onClick;n.onPress;var u=n.refKey,s=void 0===u?"ref":u,l=n.ref,a=o(n,pt),c=S.current.state;return r(((t={})[s]=M(l,(function(e){y.current=e})),t["aria-controls"]=x.menuId,t["aria-expanded"]=c.isOpen,t.id=x.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&r({},{onClick:O(i,(function(){d({type:14})}))}),a)}),[d,S,x]),L=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onKeyDown,l=i.onChange,a=i.onInput,c=i.onBlur;i.onChangeText;var p=i.onClick,f=i.refKey,h=void 0===f?"ref":f,g=i.ref,m=o(i,ft),I=(void 0===t?{}:t).suppressRefError;E("getInputProps",void 0!==I&&I,h,v);var y,b=S.current.state,w={};m.disabled||((y={}).onChange=O(l,a,(function(e){d({type:Ze,inputValue:e.target.value})})),y.onKeyDown=O(u,(function(e){var t=B(e);t&&K[t]&&K[t](e)})),y.onBlur=O(c,(function(e){if(null!=s&&s.document&&b.isOpen&&!D.isMouseDown){var t=null===e.relatedTarget&&s.document.activeElement!==s.document.body;d({type:et,selectItem:!t})}})),y.onClick=O(p,(function(){d({type:tt})})),w=y);return r(((n={})[h]=M(g,(function(e){v.current=e})),n["aria-activedescendant"]=b.isOpen&&b.highlightedIndex>-1?x.getItemId(b.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=x.menuId,n["aria-expanded"]=b.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:x.labelId,n.autoComplete="off",n.id=x.inputId,n.role="combobox",n.value=b.inputValue,n),w,m)}),[d,x,s,K,S,D,E]),F=t.useCallback((function(){d({type:15})}),[d]),_=t.useCallback((function(){d({type:17})}),[d]),N=t.useCallback((function(){d({type:16})}),[d]),j=t.useCallback((function(e){d({type:18,highlightedIndex:e})}),[d]),U=t.useCallback((function(e){d({type:it,selectedItem:e})}),[d]);return{getItemProps:R,getLabelProps:P,getMenuProps:T,getInputProps:L,getToggleButtonProps:A,toggleMenu:F,openMenu:N,closeMenu:_,setHighlightedIndex:j,setInputValue:t.useCallback((function(e){d({type:20,inputValue:e})}),[d]),selectItem:U,reset:t.useCallback((function(){d({type:21})}),[d]),highlightedIndex:f,isOpen:p,selectedItem:h,inputValue:g}}ht.stateChangeTypes=rt;var gt={activeIndex:-1,selectedItems:[]};function mt(e,t){return le(e,t,gt)}function It(e,t){return se(e,t,gt)}function vt(e){return{activeIndex:mt(e,"activeIndex"),selectedItems:mt(e,"selectedItems")}}function yt(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&""!==t.value)||0===t.selectionStart&&0===t.selectionEnd}function bt(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}h.array,h.array,h.array,h.func,h.number,h.number,h.number,h.func,h.func,h.string,h.string;var xt={itemToKey:ue.itemToKey,stateReducer:ue.stateReducer,environment:ue.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},wt=S,St=0,Ct=1,kt=2,Dt=3,Ot=4,Mt=5,Et=6,Kt=7,Pt=8,Tt=9,Rt=10,Ht=11,Vt=12,Bt=Object.freeze({__proto__:null,SelectedItemClick:St,SelectedItemKeyDownDelete:Ct,SelectedItemKeyDownBackspace:kt,SelectedItemKeyDownNavigationNext:Dt,SelectedItemKeyDownNavigationPrevious:Ot,DropdownKeyDownNavigationPrevious:Mt,DropdownKeyDownBackspace:Et,DropdownClick:Kt,FunctionAddSelectedItem:Pt,FunctionRemoveSelectedItem:Tt,FunctionSetSelectedItems:Rt,FunctionSetActiveIndex:Ht,FunctionReset:Vt});function At(e,t){var n,i=t.type,o=t.index,u=t.props,s=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case St:n={activeIndex:o};break;case Ot:n={activeIndex:l-1<0?0:l-1};break;case Dt:n={activeIndex:l+1>=a.length?-1:l+1};break;case kt:case Ct:if(l<0)break;var c=l;1===a.length?c=-1:l===a.length-1&&(c=a.length-2),n=r({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:c});break;case Mt:n={activeIndex:a.length-1};break;case Et:n={selectedItems:a.slice(0,a.length-1)};break;case Pt:n={selectedItems:[].concat(a,[s])};break;case Kt:n={activeIndex:-1};break;case Tt:var d=l,p=a.findIndex((function(e){return u.itemToKey(e)===u.itemToKey(s)}));if(p<0)break;1===a.length?d=-1:p===a.length-1&&(d=a.length-2),n={selectedItems:[].concat(a.slice(0,p),a.slice(p+1)),activeIndex:d};break;case Rt:n={selectedItems:t.selectedItems};break;case Ht:n={activeIndex:t.activeIndex};break;case Vt:n={activeIndex:It(u,"activeIndex"),selectedItems:It(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,n)}var Lt=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Ft=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function _t(e){void 0===e&&(e={}),wt();var n=r({},xt,e),i=n.getA11yStatusMessage,u=n.environment,s=n.keyNavigationNext,l=n.keyNavigationPrevious,a=re(At,n,vt,bt),c=a[0],d=a[1],p=c.activeIndex,f=c.selectedItems,h=ve(),g=t.useRef(null),m=t.useRef();m.current=[];var I=ie({state:c,props:n});fe(i,c,[p,f],u),t.useEffect((function(){h||(-1===p&&g.current?g.current.focus():m.current[p]&&m.current[p].focus())}),[p]),ge();var v=pe(),y=t.useMemo((function(){var e;return(e={})[l]=function(){d({type:Ot})},e[s]=function(){d({type:Dt})},e.Delete=function(){d({type:Ct})},e.Backspace=function(){d({type:kt})},e}),[d,s,l]),b=t.useMemo((function(){var e;return(e={})[l]=function(e){yt(e)&&d({type:Mt})},e.Backspace=function(e){yt(e)&&d({type:Et})},e}),[d,l]);return{getSelectedItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.refKey,u=void 0===i?"ref":i,s=n.ref,l=n.onClick,a=n.onKeyDown,c=n.selectedItem,p=n.index,f=o(n,Lt),h=I.current.state,g=te(c,p,h.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],v=g>-1&&g===h.activeIndex;return r(((t={})[u]=M(s,(function(e){e&&m.current.push(e)})),t.tabIndex=v?0:-1,t.onClick=O(l,(function(){d({type:St,index:g})})),t.onKeyDown=O(a,(function(e){var t=B(e);t&&y[t]&&y[t](e)})),t),f)}),[d,I,y]),getDropdownProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.refKey,s=void 0===u?"ref":u,l=i.ref,a=i.onKeyDown,c=i.onClick,p=i.preventKeyAction,f=void 0!==p&&p,h=o(i,Ft),m=(void 0===t?{}:t).suppressRefError;return v("getDropdownProps",void 0!==m&&m,s,g),r(((n={})[s]=M(l,(function(e){e&&(g.current=e)})),n),!f&&{onKeyDown:O(a,(function(e){var t=B(e);t&&b[t]&&b[t](e)})),onClick:O(c,(function(){d({type:Kt})}))},h)}),[d,b,v]),addSelectedItem:t.useCallback((function(e){d({type:Pt,selectedItem:e})}),[d]),removeSelectedItem:t.useCallback((function(e){d({type:Tt,selectedItem:e})}),[d]),setSelectedItems:t.useCallback((function(e){d({type:Rt,selectedItems:e})}),[d]),setActiveIndex:t.useCallback((function(e){d({type:Ht,activeIndex:e})}),[d]),reset:t.useCallback((function(){d({type:Vt})}),[d]),selectedItems:f,activeIndex:p}}_t.stateChangeTypes=Bt,e.default=X,e.resetIdCounter=function(){"useId"in i.default?console.warn("It is not necessary to call resetIdCounter when using React 18+"):x=0},e.useCombobox=ht,e.useMultipleSelection=_t,e.useSelect=We,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=downshift.umd.min.js.map
{
"name": "downshift",
"version": "9.0.2",
"version": "9.0.3",
"description": "🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.",

@@ -5,0 +5,0 @@ "main": "dist/downshift.cjs.js",

@@ -10,3 +10,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("preact/compat"),require("prop-types")):"function"==typeof define&&define.amd?define(["exports","preact/compat","prop-types"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Downshift={},e.React,e.PropTypes)}(this,(function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(t),r=i(n);function u(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s.apply(this,arguments)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var a,d={};

* LICENSE file in the root directory of this source tree.
*/!function(){if(a)return d;a=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function I(e){if("object"==typeof e&&null!==e){var a=e.$$typeof;switch(a){case t:switch(e=e.type){case i:case r:case o:case p:case f:return e;default:switch(e=e&&e.$$typeof){case l:case s:case c:case g:case h:case u:return e;default:return a}}case n:return a}}}e=Symbol.for("react.module.reference"),d.ContextConsumer=s,d.ContextProvider=u,d.Element=t,d.ForwardRef=c,d.Fragment=i,d.Lazy=g,d.Memo=h,d.Portal=n,d.Profiler=r,d.StrictMode=o,d.Suspense=p,d.SuspenseList=f,d.isAsyncMode=function(){return!1},d.isConcurrentMode=function(){return!1},d.isContextConsumer=function(e){return I(e)===s},d.isContextProvider=function(e){return I(e)===u},d.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},d.isForwardRef=function(e){return I(e)===c},d.isFragment=function(e){return I(e)===i},d.isLazy=function(e){return I(e)===g},d.isMemo=function(e){return I(e)===h},d.isPortal=function(e){return I(e)===n},d.isProfiler=function(e){return I(e)===r},d.isStrictMode=function(e){return I(e)===o},d.isSuspense=function(e){return I(e)===p},d.isSuspenseList=function(e){return I(e)===f},d.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===r||t===o||t===p||t===f||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===g||t.$$typeof===h||t.$$typeof===u||t.$$typeof===s||t.$$typeof===c||t.$$typeof===e||void 0!==t.getModuleId)},d.typeOf=I}();const c=e=>"object"==typeof e&&null!=e&&1===e.nodeType,p=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,f=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return p(n.overflowY,t)||p(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},h=(e,t,n,i,o,r,u,s)=>r<e&&u>t||r>e&&u<t?0:r<=e&&s<=n||u>=t&&s>=n?r-e-i:u>t&&s<n||r<e&&s>n?u-t+o:0,g=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var m=0;function I(e){return"function"==typeof e?e:v}function v(){}function y(e,t){if(e){var n=((e,t)=>{var n,i,o,r;if("undefined"==typeof document)return[];const{scrollMode:u,block:s,inline:l,boundary:a,skipOverflowHiddenElements:d}=t,p="function"==typeof a?a:e=>e!==a;if(!c(e))throw new TypeError("Invalid target");const m=document.scrollingElement||document.documentElement,I=[];let v=e;for(;c(v)&&p(v);){if(v=g(v),v===m){I.push(v);break}null!=v&&v===document.body&&f(v)&&!f(document.documentElement)||null!=v&&f(v,d)&&I.push(v)}const y=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,b=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,{scrollX:x,scrollY:w}=window,{height:S,width:C,top:k,right:D,bottom:O,left:M}=e.getBoundingClientRect(),{top:E,right:K,bottom:P,left:T}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let H="start"===s||"nearest"===s?k-E:"end"===s?O+P:k+S/2-E+P,R="center"===l?M+C/2-T+K:"end"===l?D+K:M-T;const V=[];for(let e=0;e<I.length;e++){const t=I[e],{height:n,width:i,top:o,right:r,bottom:a,left:d}=t.getBoundingClientRect();if("if-needed"===u&&k>=0&&M>=0&&O<=b&&D<=y&&k>=o&&O<=a&&M>=d&&D<=r)return V;const c=getComputedStyle(t),p=parseInt(c.borderLeftWidth,10),f=parseInt(c.borderTopWidth,10),g=parseInt(c.borderRightWidth,10),v=parseInt(c.borderBottomWidth,10);let E=0,K=0;const P="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-g:0,T="offsetHeight"in t?t.offsetHeight-t.clientHeight-f-v:0,B="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,A="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(m===t)E="start"===s?H:"end"===s?H-b:"nearest"===s?h(w,w+b,b,f,v,w+H,w+H+S,S):H-b/2,K="start"===l?R:"center"===l?R-y/2:"end"===l?R-y:h(x,x+y,y,p,g,x+R,x+R+C,C),E=Math.max(0,E+w),K=Math.max(0,K+x);else{E="start"===s?H-o-f:"end"===s?H-a+v+T:"nearest"===s?h(o,a,n,f,v+T,H,H+S,S):H-(o+n/2)+T/2,K="start"===l?R-d-p:"center"===l?R-(d+i/2)+P/2:"end"===l?R-r+g+P:h(d,r,i,p,g+P,R,R+C,C);const{scrollLeft:e,scrollTop:u}=t;E=0===A?0:Math.max(0,Math.min(u+E/A,t.scrollHeight-n/A+T)),K=0===B?0:Math.max(0,Math.min(e+K/B,t.scrollWidth-i/B+P)),H+=u-E,R+=e-K}V.push({el:t,top:E,left:K})}return V})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,i=e.left;t.scrollTop=n,t.scrollLeft=i}))}}function b(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function x(e,t){var n;function i(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,r=new Array(o),u=0;u<o;u++)r[u]=arguments[u];i(),n=setTimeout((function(){n=null,e.apply(void 0,r)}),t)}return o.cancel=i,o}function w(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(i)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function S(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function C(){return String(m++)}function k(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function D(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var O=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function M(e){void 0===e&&(e={});var t={};return O.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function E(e,t){return e&&t?Object.keys(e).reduce((function(n,i){return n[i]=K(t,i)?t[i]:e[i],n}),{}):e}function K(e,t){return void 0!==e[t]}function P(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function T(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(0===r)return-1;var u=r-1;("number"!=typeof e||e<0||e>u)&&(e=t>0?-1:u+1);var s=e+t;s<0?s=o?u:0:s>u&&(s=o?0:u);var l=H(s,t<0,n,i,o);return-1===l?e>=r?-1:e:l}function H(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(t){for(var u=e;u>=0;u--)if(!i(n[u],u))return u}else for(var s=e;s<r;s++)if(!i(n[s],s))return s;return o?H(t?r-1:0,t,n,i):-1}function R(e,t,n,i){return void 0===i&&(i=!0),n&&t.some((function(t){return t&&(b(t,e,n)||i&&b(t,n.document.activeElement,n))}))}var V=x((function(e){B(e).textContent=""}),500);function B(e){var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function A(e,t){e&&t&&(B(t).textContent=e,V(t))}var L=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),F=["refKey","ref"],_=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],N=["onKeyDown","onBlur","onChange","onInput","onChangeText"],j=["refKey","ref"],U=["onMouseMove","onMouseDown","onClick","onPress","index","item"],$=function(){var e=function(e){function n(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+C(),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var i=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==i})),e()}),t);n.timeoutIds.push(i)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.isItemDisabled=function(e,t){var i=n.getItemNodeFromIndex(t);return i&&i.hasAttribute("disabled")},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=M(t),n.internalSetState(s({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,i){t=M(t),n.internalSetState(s({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),i)},n.selectItemAtIndex=function(e,t,i){var o=n.items[e];null!=o&&n.selectItem(o,t,i)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var i,o,r={},u="function"==typeof e;return!u&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,s({},n.getStateAndHelpers(),e)),n.setState((function(t){var l;t=n.getState(t);var a=u?e(t):e;a=n.props.stateReducer(t,a),i=a.hasOwnProperty("selectedItem");var d={};return i&&a.selectedItem!==t.selectedItem&&(o=a.selectedItem),(l=a).type||(l.type=0),Object.keys(a).forEach((function(e){t[e]!==a[e]&&(r[e]=a[e]),"type"!==e&&(a[e],K(n.props,e)||(d[e]=a[e]))})),u&&a.hasOwnProperty("inputValue")&&n.props.onInputValueChange(a.inputValue,s({},n.getStateAndHelpers(),a)),d}),(function(){I(t)(),Object.keys(r).length>1&&n.props.onStateChange(r,n.getStateAndHelpers()),i&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(r,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var i,o=void 0===e?{}:e,r=o.refKey,l=void 0===r?"ref":r,a=o.ref,d=u(o,F),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=p;var f=n.getState().isOpen;return s(((i={})[l]=S(a,n.rootRef),i.role="combobox",i["aria-expanded"]=f,i["aria-haspopup"]="listbox",i["aria-owns"]=f?n.menuId:void 0,i["aria-labelledby"]=n.labelId,i),d)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=T(t.getState().highlightedIndex,1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=T(t.getState().highlightedIndex,-1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,i=t.highlightedIndex;if(n&&null!=i){e.preventDefault();var o=this.items[i],r=this.getItemNodeFromIndex(i);if(null==o||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(s({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=s({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=s({},n.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=H(0,!1,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:7})}}},End:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=H(n-1,!0,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick;t.onPress;var o=t.onKeyDown,r=t.onKeyUp,l=t.onBlur,a=u(t,_),d=n.getState().isOpen,c={onClick:w(i,n.buttonHandleClick),onKeyDown:w(o,n.buttonHandleKeyDown),onKeyUp:w(r,n.buttonHandleKeyUp),onBlur:w(l,n.buttonHandleBlur)};return s({type:"button",role:"button","aria-label":d?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:c,a)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=P(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(n,e)},n.buttonHandleClick=function(e){if(e.preventDefault(),n.props.environment){var t=n.props.environment.document,i=t.body,o=t.activeElement;i&&i===o&&e.target.focus()}n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){if(!n.isMouseDown&&n.props.environment){var e=n.props.environment.document.activeElement;null!=e&&e.id===n.inputId||e===t||n.reset({type:14})}}))},n.getLabelProps=function(e){return s({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,o=t.onBlur,r=t.onChange,l=t.onInput;t.onChangeText;var a=u(t,N),d={};var c,p=n.getState(),f=p.inputValue,h=p.isOpen,g=p.highlightedIndex;a.disabled||((c={}).onInput=w(r,l,n.inputHandleChange),c.onKeyDown=w(i,n.inputHandleKeyDown),c.onBlur=w(o,n.inputHandleBlur),d=c);return s({"aria-autocomplete":"list","aria-activedescendant":h&&"number"==typeof g&&g>=0?n.getItemId(g):void 0,"aria-controls":h?n.menuId:void 0,"aria-labelledby":a&&a["aria-label"]?void 0:n.labelId,autoComplete:"off",value:f,id:n.inputId},d,a)},n.inputHandleKeyDown=function(e){var t=P(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(n,e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e;if(!n.isMouseDown&&n.props.environment){var t=n.props.environment.document.activeElement;(null==t||null==(e=t.dataset)?void 0:e.toggle)&&n._rootNode&&n._rootNode.contains(t)||n.reset({type:10})}}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var i,o=void 0===e?{}:e,r=o.refKey,l=void 0===r?"ref":r,a=o.ref,d=u(o,j),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=p,s(((i={})[l]=S(a,n.menuRef),i.role="listbox",i["aria-labelledby"]=d&&d["aria-label"]?void 0:n.labelId,i.id=n.menuId,i),d)},n.getItemProps=function(e){var t,i=void 0===e?{}:e,o=i.onMouseMove,r=i.onMouseDown,l=i.onClick;i.onPress;var a=i.index,d=i.item,c=void 0===d?void 0:d,p=u(i,U);void 0===a?(n.items.push(c),a=n.items.indexOf(c)):n.items[a]=c;var f=l,h=((t={onMouseMove:w(o,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:w(r,(function(e){e.preventDefault()}))}).onClick=w(f,(function(){n.selectItemAtIndex(a,{type:9})})),t),g=p.disabled?{onMouseDown:h.onMouseDown}:h;return s({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},g,p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=M(e),n.internalSetState((function(t){var i=t.selectedItem;return s({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(i)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=M(e),n.internalSetState((function(t){var i=t.isOpen;return s({isOpen:!i},i&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var i=n.getState(),o=i.isOpen,r=i.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof r&&n.setHighlightedIndex(r,e),I(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=x((function(){var e;if(null!=(e=n.props)&&null!=(e=e.environment)&&e.document){var t=n.getState(),i=n.items[t.highlightedIndex],o=n.getItemCount(),r=n.props.getA11yStatusMessage(s({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:o,highlightedItem:i},t));n.previousResultCount=o,A(r,n.props.environment.document)}}),200);var i=n.props,o=i.defaultHighlightedIndex,r=i.initialHighlightedIndex,l=void 0===r?o:r,a=i.defaultIsOpen,d=i.initialIsOpen,c=void 0===d?a:d,p=i.initialInputValue,f=void 0===p?"":p,h=i.initialSelectedItem,g=void 0===h?null:h,m=n.getState({highlightedIndex:l,isOpen:c,inputValue:f,selectedItem:g});return null!=m.selectedItem&&void 0===n.props.initialInputValue&&(m.inputValue=n.props.itemToString(m.selectedItem)),n.state=m,n}var i,o;o=e,(i=n).prototype=Object.create(o.prototype),i.prototype.constructor=i,l(i,o);var r=n.prototype;return r.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},r.getState=function(e){return void 0===e&&(e=this.state),E(e,this.props)},r.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},r.getItemNodeFromIndex=function(e){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(e)):null},r.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},r.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),i=this.getState().highlightedIndex;if(n>0){var o=T(i,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(o,t)}},r.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,i=e.selectedItem,o=e.isOpen,r=this.props.itemToString,u=this.id,s=this.getRootProps,l=this.getToggleButtonProps,a=this.getLabelProps,d=this.getMenuProps,c=this.getInputProps,p=this.getItemProps,f=this.openMenu,h=this.closeMenu,g=this.toggleMenu,m=this.selectItem,I=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,b=this.clearSelection,x=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:a,getMenuProps:d,getInputProps:c,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:h,toggleMenu:g,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:i}},r.componentDidMount=function(){var e=this;if(this.props.environment){var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!R(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},i=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},r=function(t){var n=R(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",t),u.addEventListener("mouseup",n),u.addEventListener("touchstart",i),u.addEventListener("touchmove",o),u.addEventListener("touchend",r),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",i),u.removeEventListener("touchmove",o),u.removeEventListener("touchend",r)}}else this.cleanup=function(){e.internalClearTimeouts()}},r.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,i=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==i},r.componentDidUpdate=function(e,t){K(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},r.componentWillUnmount=function(){this.cleanup()},r.render=function(){var e=D(this.props.children,v);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var n=D(e(this.getStateAndHelpers()));return n?this.getRootProps.called||this.props.suppressRefError?n:function(e){return"string"==typeof e.type||"string"==typeof e.nodeName}(n)?t.cloneElement(n,this.getRootProps(function(e){return e.props||e.attributes}(n))):void 0:null},n}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:k,itemToString:function(e){return null==e?"":String(e)},onStateChange:v,onInputValueChange:v,onUserAction:v,onChange:v,onSelect:v,onOuterClick:v,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:y},e.stateChangeTypes=L,e}(),W={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function q(e,t,n){var i=e.props,o=e.type,r={};Object.keys(t).forEach((function(i){!function(e,t,n,i){var o=t.props,r=t.type,u="on"+J(e)+"Change";o[u]&&void 0!==i[e]&&i[e]!==n[e]&&o[u](s({type:r},i))}(i,e,t,n),n[i]!==t[i]&&(r[i]=n[i])})),i.onStateChange&&Object.keys(r).length&&i.onStateChange(s({type:o},r))}var z=x((function(e,t){A(e,t)}),200),X="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,Y="useId"in o.default?function(e){var n=e.id,i=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId,a="downshift-"+o.default.useId();return n||(n=a),t.useRef({labelId:i||n+"-label",menuId:r||n+"-menu",getItemId:u||function(e){return n+"-item-"+e},toggleButtonId:s||n+"-toggle-button",inputId:l||n+"-input"}).current}:function(e){var n=e.id,i=void 0===n?"downshift-"+C():n,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId;return t.useRef({labelId:o||i+"-label",menuId:r||i+"-menu",getItemId:u||function(e){return i+"-item-"+e},toggleButtonId:s||i+"-toggle-button",inputId:l||i+"-input"}).current};function G(e,t,n,i){var o,r;if(void 0===e){if(void 0===t)throw new Error(i);o=n[t],r=t}else r=void 0===t?n.indexOf(e):t,o=e;return[o,r]}function J(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Q(e){var n=t.useRef(e);return n.current=e,n}function Z(e,n,i,o){var r=t.useRef(),u=t.useRef(),l=t.useCallback((function(t,n){u.current=n,t=E(t,n.props);var i=e(t,n);return n.props.stateReducer(t,s({},n,{changes:i}))}),[e]),a=t.useReducer(l,n,i),d=a[0],c=a[1],p=Q(n),f=t.useCallback((function(e){return c(s({props:p.current},e))}),[p]),h=u.current;return t.useEffect((function(){var e=E(r.current,null==h?void 0:h.props);h&&r.current&&!o(e,d)&&q(h,e,d),r.current=d}),[d,h,o]),[d,f]}function ee(e,t,n,i){var o=Z(e,t,n,i),r=o[0],u=o[1];return[E(r,t),u]}var te={itemToString:function(e){return e?String(e):""},itemToKey:function(e){return e},stateReducer:function(e,t){return t.changes},scrollIntoView:y,environment:"undefined"==typeof window?void 0:window};function ne(e,t,n){void 0===n&&(n=W);var i=e["default"+J(t)];return void 0!==i?i:n[t]}function ie(e,t,n){void 0===n&&(n=W);var i=e[t];if(void 0!==i)return i;var o=e["initial"+J(t)];return void 0!==o?o:ne(e,t,n)}function oe(e){var t=ie(e,"selectedItem"),n=ie(e,"isOpen"),i=ie(e,"highlightedIndex"),o=ie(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.findIndex((function(n){return e.itemToKey(n)===e.itemToKey(t)})):i,isOpen:n,selectedItem:t,inputValue:o}}function re(e,t,n){var i=e.items,o=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=e.isItemDisabled,s=e.itemToKey,l=t.selectedItem,a=t.highlightedIndex;return 0===i.length?-1:void 0===o||a!==o||u(i[o])?void 0===r||u(i[r])?l?i.findIndex((function(e){return s(l)===s(e)})):0===n?-1:n<0?i.length-1:0:r:o}function ue(e,n,i){var o=t.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return t.useEffect((function(){if(!e)return v;var t=n.map((function(e){return e.current}));function r(){o.current.isTouchEnd=!1,o.current.isMouseDown=!0}function u(n){o.current.isMouseDown=!1,R(n.target,t,e)||i()}function s(){o.current.isTouchEnd=!1,o.current.isTouchMove=!1}function l(){o.current.isTouchMove=!0}function a(n){o.current.isTouchEnd=!0,o.current.isTouchMove||R(n.target,t,e,!1)||i()}return e.addEventListener("mousedown",r),e.addEventListener("mouseup",u),e.addEventListener("touchstart",s),e.addEventListener("touchmove",l),e.addEventListener("touchend",a),function(){e.removeEventListener("mousedown",r),e.removeEventListener("mouseup",u),e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",a)}}),[e,i]),o.current}var se=function(){return v};function le(e,n,i,o){void 0===o&&(o={});var r=o.document,u=fe();t.useEffect((function(){if(e&&!u&&r){var t=e(n);z(t,r)}}),i),t.useEffect((function(){return function(){var e,t;z.cancel(),(t=null==(e=r)?void 0:e.getElementById("a11y-status-message"))&&t.remove()}}),[r])}function ae(e){var n=e.highlightedIndex,i=e.isOpen,o=e.itemRefs,r=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,l=t.useRef(!0);return X((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var de=v;function ce(e,t,n){var i;return void 0===n&&(n=!0),s({isOpen:!1,highlightedIndex:-1},(null==(i=e.items)?void 0:i.length)&&t>=0&&s({selectedItem:e.items[t],isOpen:ne(e,"isOpen"),highlightedIndex:ne(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function pe(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function fe(){var e=o.default.useRef(!0);return o.default.useEffect((function(){return e.current=!1,function(){e.current=!0}}),[]),e.current}var he={environment:r.default.shape({addEventListener:r.default.func.isRequired,removeEventListener:r.default.func.isRequired,document:r.default.shape({createElement:r.default.func.isRequired,getElementById:r.default.func.isRequired,activeElement:r.default.any.isRequired,body:r.default.any.isRequired}).isRequired,Node:r.default.func.isRequired}),itemToString:r.default.func,itemToKey:r.default.func,stateReducer:r.default.func},ge=s({},he,{getA11yStatusMessage:r.default.func,highlightedIndex:r.default.number,defaultHighlightedIndex:r.default.number,initialHighlightedIndex:r.default.number,isOpen:r.default.bool,defaultIsOpen:r.default.bool,initialIsOpen:r.default.bool,selectedItem:r.default.any,initialSelectedItem:r.default.any,defaultSelectedItem:r.default.any,id:r.default.string,labelId:r.default.string,menuId:r.default.string,getItemId:r.default.func,toggleButtonId:r.default.string,onSelectedItemChange:r.default.func,onHighlightedIndexChange:r.default.func,onStateChange:r.default.func,onIsOpenChange:r.default.func,scrollIntoView:r.default.func});function me(e,t,n){var i,o=t.type,r=t.props;switch(o){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:re(r,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:re(r,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:ne(r,"highlightedIndex"),isOpen:ne(r,"isOpen"),selectedItem:ne(r,"selectedItem"),inputValue:ne(r,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return s({},e,i)}var Ie=function(){return Ie=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ie.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,Ie(Ie({},ge),{items:r.default.array.isRequired,isItemDisabled:r.default.func});var ve=Ie(Ie({},te),{isItemDisabled:function(){return!1}}),ye=v,be=1,xe=2,we=3,Se=4,Ce=5,ke=6,De=7,Oe=8,Me=9,Ee=10,Ke=11,Pe=14,Te=19,He=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:be,ToggleButtonKeyDownArrowUp:xe,ToggleButtonKeyDownCharacter:we,ToggleButtonKeyDownEscape:Se,ToggleButtonKeyDownHome:Ce,ToggleButtonKeyDownEnd:ke,ToggleButtonKeyDownEnter:De,ToggleButtonKeyDownSpaceButton:Oe,ToggleButtonKeyDownPageUp:Me,ToggleButtonKeyDownPageDown:Ee,ToggleButtonBlur:Ke,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:Pe,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Te,FunctionSetInputValue:20,FunctionReset:21});function Re(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case Pe:i={isOpen:ne(r,"isOpen"),highlightedIndex:ne(r,"highlightedIndex"),selectedItem:r.items[t.index]};break;case we:var l=t.key,a=""+e.inputValue+l;i={inputValue:a,highlightedIndex:function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.isItemDisabled,u=t.toLowerCase(),s=0;s<i.length;s++){var l=(s+n+(t.length<2?1:0))%i.length,a=i[l];if(void 0!==a&&o(a).toLowerCase().startsWith(u)&&!r(a,l))return l}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.findIndex((function(t){return r.itemToKey(t)===r.itemToKey(e.selectedItem)})):e.highlightedIndex,items:r.items,itemToString:r.itemToString,isItemDisabled:r.isItemDisabled}),isOpen:!0};break;case be:i={highlightedIndex:e.isOpen?T(e.highlightedIndex,1,r.items,r.isItemDisabled):u&&null==e.selectedItem?-1:re(r,e,1),isOpen:!0};break;case xe:if(e.isOpen&&u)i=ce(r,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?T(e.highlightedIndex,-1,r.items,r.isItemDisabled):re(r,e,-1),isOpen:!0};break;case De:case Oe:i=ce(r,e.highlightedIndex,!1);break;case Ce:i={highlightedIndex:H(0,!1,r.items,r.isItemDisabled),isOpen:!0};break;case ke:i={highlightedIndex:H(r.items.length-1,!0,r.items,r.isItemDisabled),isOpen:!0};break;case Me:i={highlightedIndex:T(e.highlightedIndex,-10,r.items,r.isItemDisabled)};break;case Ee:i={highlightedIndex:T(e.highlightedIndex,10,r.items,r.isItemDisabled)};break;case Se:i={isOpen:!1,highlightedIndex:-1};break;case Ke:i=s({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&{selectedItem:r.items[e.highlightedIndex]});break;case Te:i={selectedItem:t.selectedItem};break;default:return me(e,t,He)}return s({},e,i)}var Ve=["onClick"],Be=["onMouseLeave","refKey","ref"],Ae=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],Le=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function Fe(e){void 0===e&&(e={}),ye();var n=s({},ve,e),i=n.scrollIntoView,o=n.environment,r=n.getA11yStatusMessage,l=ee(Re,n,oe,pe),a=l[0],d=l[1],c=a.isOpen,p=a.highlightedIndex,f=a.selectedItem,h=a.inputValue,g=t.useRef(null),m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),y=Y(n),b=Q({state:a,props:n}),C=t.useCallback((function(e){return I.current[y.getItemId(e)]}),[y]);le(r,a,[c,p,f,h],o);var k=ae({menuElement:m.current,highlightedIndex:p,isOpen:c,itemRefs:I,scrollIntoView:i,getItemNodeFromIndex:C});t.useEffect((function(){return v.current=x((function(e){e({type:20,inputValue:""})}),500),function(){v.current.cancel()}}),[]),t.useEffect((function(){h&&v.current(d)}),[d,h]),de(),t.useEffect((function(){ie(n,"isOpen")&&g.current&&g.current.focus()}),[]);var D=ue(o,[g,m],t.useCallback((function(){b.current.state.isOpen&&d({type:Ke})}),[d,b])),O=se();t.useEffect((function(){c||(I.current={})}),[c]);var M=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),d({type:be,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),d({type:xe,altKey:e.altKey})},Home:function(e){e.preventDefault(),d({type:Ce})},End:function(e){e.preventDefault(),d({type:ke})},Escape:function(){b.current.state.isOpen&&d({type:Se})},Enter:function(e){e.preventDefault(),d({type:b.current.state.isOpen?De:0})},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),d({type:Me}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),d({type:Ee}))}," ":function(e){e.preventDefault();var t=b.current.state;t.isOpen?t.inputValue?d({type:we,key:" "}):d({type:Oe}):d({type:0})}}}),[d,b]),E=t.useCallback((function(){d({type:15})}),[d]),K=t.useCallback((function(){d({type:17})}),[d]),T=t.useCallback((function(){d({type:16})}),[d]),H=t.useCallback((function(e){d({type:18,highlightedIndex:e})}),[d]),R=t.useCallback((function(e){d({type:Te,selectedItem:e})}),[d]),V=t.useCallback((function(){d({type:21})}),[d]),B=t.useCallback((function(e){d({type:20,inputValue:e})}),[d]),A=t.useCallback((function(e){var t=void 0===e?{}:e,n=t.onClick,i=u(t,Ve);return s({id:y.labelId,htmlFor:y.toggleButtonId,onClick:w(n,(function(){var e;null==(e=g.current)||e.focus()}))},i)}),[y]),L=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,r=i.refKey,l=void 0===r?"ref":r,a=i.ref,c=u(i,Be),p=(void 0===t?{}:t).suppressRefError;return O("getMenuProps",void 0!==p&&p,l,m),s(((n={})[l]=S(a,(function(e){m.current=e})),n.id=y.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+y.labelId,n.onMouseLeave=w(o,(function(){d({type:12})})),n),c)}),[d,O,y]),F=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onBlur,r=i.onClick;i.onPress;var l=i.onKeyDown,a=i.refKey,c=void 0===a?"ref":a,p=i.ref,f=u(i,Ae),h=(void 0===t?{}:t).suppressRefError,m=void 0!==h&&h,I=b.current.state,v=s(((n={})[c]=S(p,(function(e){g.current=e})),n["aria-activedescendant"]=I.isOpen&&I.highlightedIndex>-1?y.getItemId(I.highlightedIndex):"",n["aria-controls"]=y.menuId,n["aria-expanded"]=b.current.state.isOpen,n["aria-haspopup"]="listbox",n["aria-labelledby"]=f&&f["aria-label"]?void 0:""+y.labelId,n.id=y.toggleButtonId,n.role="combobox",n.tabIndex=0,n.onBlur=w(o,(function(){I.isOpen&&!D.isMouseDown&&d({type:Ke})})),n),f);return f.disabled||(v.onClick=w(r,(function(){d({type:0})})),v.onKeyDown=w(l,(function(e){var t=P(e);t&&M[t]?M[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&d({type:we,key:t})}))),O("getToggleButtonProps",m,c,g),v}),[d,y,b,D,O,M]),_=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,o=n.index,r=n.onMouseMove,l=n.onClick,a=n.onMouseDown;n.onPress;var c=n.refKey,p=void 0===c?"ref":c,f=n.disabled,h=n.ref,g=u(n,Le);void 0!==f&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var m=b.current,v=m.state,x=m.props,C=G(i,o,x.items,"Pass either item or index to getItemProps!"),O=C[0],M=C[1],E=x.isItemDisabled(O,M),K=s(((t={})[p]=S(h,(function(e){e&&(I.current[y.getItemId(M)]=e)})),t["aria-disabled"]=E,t["aria-selected"]=""+(O===v.selectedItem),t.id=y.getItemId(M),t.role="option",t),g);return E||(K.onClick=w(l,(function(){d({type:Pe,index:M})}))),K.onMouseMove=w(r,(function(){D.isTouchEnd||M===v.highlightedIndex||(k.current=!1,d({type:13,index:M,disabled:E}))})),K.onMouseDown=w(a,(function(e){return e.preventDefault()})),K}),[b,y,D,k,d]);return{getToggleButtonProps:F,getLabelProps:A,getMenuProps:L,getItemProps:_,toggleMenu:E,openMenu:T,closeMenu:K,setHighlightedIndex:H,selectItem:R,reset:V,setInputValue:B,highlightedIndex:p,isOpen:c,selectedItem:f,inputValue:h}}Fe.stateChangeTypes=He;var _e=0,Ne=1,je=2,Ue=3,$e=4,We=5,qe=6,ze=7,Xe=8,Ye=9,Ge=10,Je=13,Qe=19,Ze=22,et=Object.freeze({__proto__:null,InputKeyDownArrowDown:_e,InputKeyDownArrowUp:Ne,InputKeyDownEscape:je,InputKeyDownHome:Ue,InputKeyDownEnd:$e,InputKeyDownPageUp:We,InputKeyDownPageDown:qe,InputKeyDownEnter:ze,InputChange:Xe,InputBlur:Ye,InputClick:Ge,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:Je,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Qe,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:Ze});function tt(e){var t=oe(e),n=t.selectedItem,i=t.inputValue;return""===i&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(i=e.itemToString(n)),s({},t,{inputValue:i})}s({},ge,{items:r.default.array.isRequired,isItemDisabled:r.default.func,inputValue:r.default.string,defaultInputValue:r.default.string,initialInputValue:r.default.string,inputId:r.default.string,onInputValueChange:r.default.func});var nt=v,it=s({},te,{isItemDisabled:function(){return!1}});function ot(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case Je:i={isOpen:ne(r,"isOpen"),highlightedIndex:ne(r,"highlightedIndex"),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case _e:i=e.isOpen?{highlightedIndex:T(e.highlightedIndex,1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:u&&null==e.selectedItem?-1:re(r,e,1),isOpen:r.items.length>=0};break;case Ne:i=e.isOpen?u?ce(r,e.highlightedIndex):{highlightedIndex:T(e.highlightedIndex,-1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:re(r,e,-1),isOpen:r.items.length>=0};break;case ze:i=ce(r,e.highlightedIndex);break;case je:i=s({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case We:i={highlightedIndex:T(e.highlightedIndex,-10,r.items,r.isItemDisabled,!0)};break;case qe:i={highlightedIndex:T(e.highlightedIndex,10,r.items,r.isItemDisabled,!0)};break;case Ue:i={highlightedIndex:H(0,!1,r.items,r.isItemDisabled)};break;case $e:i={highlightedIndex:H(r.items.length-1,!0,r.items,r.isItemDisabled)};break;case Ye:i=s({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case Xe:i={isOpen:!0,highlightedIndex:ne(r,"highlightedIndex"),inputValue:t.inputValue};break;case Ge:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:re(r,e,0)};break;case Qe:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case Ze:i={inputValue:t.inputValue};break;default:return me(e,t,et)}return s({},e,i)}var rt=["onMouseLeave","refKey","ref"],ut=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],st=["onClick","onPress","refKey","ref"],lt=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function at(e){void 0===e&&(e={}),nt();var n=s({},it,e),i=n.items,o=n.scrollIntoView,r=n.environment,l=n.getA11yStatusMessage,a=function(e,n,i,o){var r=t.useRef(),u=Z(e,n,i,o),s=u[0],l=u[1],a=fe();return t.useEffect((function(){K(n,"selectedItem")&&(a||n.itemToKey(n.selectedItem)!==n.itemToKey(r.current)&&l({type:Ze,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[E(s,n),l]}(ot,n,tt,pe),d=a[0],c=a[1],p=d.isOpen,f=d.highlightedIndex,h=d.selectedItem,g=d.inputValue,m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),y=t.useRef(null),b=fe(),x=Y(n),C=t.useRef(),k=Q({state:d,props:n}),D=t.useCallback((function(e){return I.current[x.getItemId(e)]}),[x]);le(l,d,[p,f,h,g],r);var O=ae({menuElement:m.current,highlightedIndex:f,isOpen:p,itemRefs:I,scrollIntoView:o,getItemNodeFromIndex:D});de(),t.useEffect((function(){ie(n,"isOpen")&&v.current&&v.current.focus()}),[]),t.useEffect((function(){b||(C.current=i.length)}));var M=ue(r,[y,m,v],t.useCallback((function(){k.current.state.isOpen&&c({type:Ye,selectItem:!1})}),[c,k])),T=se();t.useEffect((function(){p||(I.current={})}),[p]),t.useEffect((function(){var e;p&&null!=r&&r.document&&null!=v&&null!=(e=v.current)&&e.focus&&r.document.activeElement!==v.current&&v.current.focus()}),[p,r]);var H=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),c({type:_e,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:Ne,altKey:e.altKey})},Home:function(e){k.current.state.isOpen&&(e.preventDefault(),c({type:Ue}))},End:function(e){k.current.state.isOpen&&(e.preventDefault(),c({type:$e}))},Escape:function(e){var t=k.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),c({type:je}))},Enter:function(e){k.current.state.isOpen&&229!==e.which&&(e.preventDefault(),c({type:ze}))},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),c({type:We}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),c({type:qe}))}}}),[c,k]),R=t.useCallback((function(e){return s({id:x.labelId,htmlFor:x.inputId},e)}),[x]),V=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,r=i.refKey,l=void 0===r?"ref":r,a=i.ref,d=u(i,rt),p=(void 0===t?{}:t).suppressRefError;return T("getMenuProps",void 0!==p&&p,l,m),s(((n={})[l]=S(a,(function(e){m.current=e})),n.id=x.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+x.labelId,n.onMouseLeave=w(o,(function(){c({type:11})})),n),d)}),[c,T,x]),B=t.useCallback((function(e){var t,n,i=void 0===e?{}:e,o=i.item,r=i.index,l=i.refKey,a=void 0===l?"ref":l,d=i.ref,p=i.onMouseMove,f=i.onMouseDown,h=i.onClick;i.onPress;var g=i.disabled,m=u(i,ut);void 0!==g&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var v=k.current,y=v.props,b=v.state,C=G(o,r,y.items,"Pass either item or index to getItemProps!"),D=C[0],E=C[1],K=y.isItemDisabled(D,E),P=h;return s(((t={})[a]=S(d,(function(e){e&&(I.current[x.getItemId(E)]=e)})),t["aria-disabled"]=K,t["aria-selected"]=""+(E===b.highlightedIndex),t.id=x.getItemId(E),t.role="option",t),!K&&((n={}).onClick=w(P,(function(){c({type:Je,index:E})})),n),{onMouseMove:w(p,(function(){M.isTouchEnd||E===b.highlightedIndex||(O.current=!1,c({type:12,index:E,disabled:K}))})),onMouseDown:w(f,(function(e){return e.preventDefault()}))},m)}),[c,x,k,M,O]),A=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.onClick;n.onPress;var o=n.refKey,r=void 0===o?"ref":o,l=n.ref,a=u(n,st),d=k.current.state;return s(((t={})[r]=S(l,(function(e){y.current=e})),t["aria-controls"]=x.menuId,t["aria-expanded"]=d.isOpen,t.id=x.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&s({},{onClick:w(i,(function(){c({type:14})}))}),a)}),[c,k,x]),L=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onKeyDown,l=i.onChange,a=i.onInput,d=i.onBlur;i.onChangeText;var p=i.onClick,f=i.refKey,h=void 0===f?"ref":f,g=i.ref,m=u(i,lt),I=(void 0===t?{}:t).suppressRefError;T("getInputProps",void 0!==I&&I,h,v);var y,b=k.current.state,C={};m.disabled||((y={}).onInput=w(l,a,(function(e){c({type:Xe,inputValue:e.target.value})})),y.onKeyDown=w(o,(function(e){var t=P(e);t&&H[t]&&H[t](e)})),y.onBlur=w(d,(function(e){if(null!=r&&r.document&&b.isOpen&&!M.isMouseDown){var t=null===e.relatedTarget&&r.document.activeElement!==r.document.body;c({type:Ye,selectItem:!t})}})),y.onClick=w(p,(function(){c({type:Ge})})),C=y);return s(((n={})[h]=S(g,(function(e){v.current=e})),n["aria-activedescendant"]=b.isOpen&&b.highlightedIndex>-1?x.getItemId(b.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=x.menuId,n["aria-expanded"]=b.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:x.labelId,n.autoComplete="off",n.id=x.inputId,n.role="combobox",n.value=b.inputValue,n),C,m)}),[c,x,r,H,k,M,T]),F=t.useCallback((function(){c({type:15})}),[c]),_=t.useCallback((function(){c({type:17})}),[c]),N=t.useCallback((function(){c({type:16})}),[c]),j=t.useCallback((function(e){c({type:18,highlightedIndex:e})}),[c]),U=t.useCallback((function(e){c({type:Qe,selectedItem:e})}),[c]);return{getItemProps:B,getLabelProps:R,getMenuProps:V,getInputProps:L,getToggleButtonProps:A,toggleMenu:F,openMenu:N,closeMenu:_,setHighlightedIndex:j,setInputValue:t.useCallback((function(e){c({type:20,inputValue:e})}),[c]),selectItem:U,reset:t.useCallback((function(){c({type:21})}),[c]),highlightedIndex:f,isOpen:p,selectedItem:h,inputValue:g}}at.stateChangeTypes=et;var dt={activeIndex:-1,selectedItems:[]};function ct(e,t){return ie(e,t,dt)}function pt(e,t){return ne(e,t,dt)}function ft(e){return{activeIndex:ct(e,"activeIndex"),selectedItems:ct(e,"selectedItems")}}function ht(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&""!==t.value)||0===t.selectionStart&&0===t.selectionEnd}function gt(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}r.default.array,r.default.array,r.default.array,r.default.func,r.default.number,r.default.number,r.default.number,r.default.func,r.default.func,r.default.string,r.default.string;var mt={itemToKey:te.itemToKey,stateReducer:te.stateReducer,environment:te.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},It=v,vt=0,yt=1,bt=2,xt=3,wt=4,St=5,Ct=6,kt=7,Dt=8,Ot=9,Mt=10,Et=11,Kt=12,Pt=Object.freeze({__proto__:null,SelectedItemClick:vt,SelectedItemKeyDownDelete:yt,SelectedItemKeyDownBackspace:bt,SelectedItemKeyDownNavigationNext:xt,SelectedItemKeyDownNavigationPrevious:wt,DropdownKeyDownNavigationPrevious:St,DropdownKeyDownBackspace:Ct,DropdownClick:kt,FunctionAddSelectedItem:Dt,FunctionRemoveSelectedItem:Ot,FunctionSetSelectedItems:Mt,FunctionSetActiveIndex:Et,FunctionReset:Kt});function Tt(e,t){var n,i=t.type,o=t.index,r=t.props,u=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case vt:n={activeIndex:o};break;case wt:n={activeIndex:l-1<0?0:l-1};break;case xt:n={activeIndex:l+1>=a.length?-1:l+1};break;case bt:case yt:if(l<0)break;var d=l;1===a.length?d=-1:l===a.length-1&&(d=a.length-2),n=s({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:d});break;case St:n={activeIndex:a.length-1};break;case Ct:n={selectedItems:a.slice(0,a.length-1)};break;case Dt:n={selectedItems:[].concat(a,[u])};break;case kt:n={activeIndex:-1};break;case Ot:var c=l,p=a.findIndex((function(e){return r.itemToKey(e)===r.itemToKey(u)}));if(p<0)break;1===a.length?c=-1:p===a.length-1&&(c=a.length-2),n={selectedItems:[].concat(a.slice(0,p),a.slice(p+1)),activeIndex:c};break;case Mt:n={selectedItems:t.selectedItems};break;case Et:n={activeIndex:t.activeIndex};break;case Kt:n={activeIndex:pt(r,"activeIndex"),selectedItems:pt(r,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return s({},e,n)}var Ht=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Rt=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Vt(e){void 0===e&&(e={}),It();var n=s({},mt,e),i=n.getA11yStatusMessage,o=n.environment,r=n.keyNavigationNext,l=n.keyNavigationPrevious,a=ee(Tt,n,ft,gt),d=a[0],c=a[1],p=d.activeIndex,f=d.selectedItems,h=fe(),g=t.useRef(null),m=t.useRef();m.current=[];var I=Q({state:d,props:n});le(i,d,[p,f],o),t.useEffect((function(){h||(-1===p&&g.current?g.current.focus():m.current[p]&&m.current[p].focus())}),[p]),de();var v=se(),y=t.useMemo((function(){var e;return(e={})[l]=function(){c({type:wt})},e[r]=function(){c({type:xt})},e.Delete=function(){c({type:yt})},e.Backspace=function(){c({type:bt})},e}),[c,r,l]),b=t.useMemo((function(){var e;return(e={})[l]=function(e){ht(e)&&c({type:St})},e.Backspace=function(e){ht(e)&&c({type:Ct})},e}),[c,l]);return{getSelectedItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.refKey,o=void 0===i?"ref":i,r=n.ref,l=n.onClick,a=n.onKeyDown,d=n.selectedItem,p=n.index,f=u(n,Ht),h=I.current.state,g=G(d,p,h.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],v=g>-1&&g===h.activeIndex;return s(((t={})[o]=S(r,(function(e){e&&m.current.push(e)})),t.tabIndex=v?0:-1,t.onClick=w(l,(function(){c({type:vt,index:g})})),t.onKeyDown=w(a,(function(e){var t=P(e);t&&y[t]&&y[t](e)})),t),f)}),[c,I,y]),getDropdownProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.refKey,r=void 0===o?"ref":o,l=i.ref,a=i.onKeyDown,d=i.onClick,p=i.preventKeyAction,f=void 0!==p&&p,h=u(i,Rt),m=(void 0===t?{}:t).suppressRefError;return v("getDropdownProps",void 0!==m&&m,r,g),s(((n={})[r]=S(l,(function(e){e&&(g.current=e)})),n),!f&&{onKeyDown:w(a,(function(e){var t=P(e);t&&b[t]&&b[t](e)})),onClick:w(d,(function(){c({type:kt})}))},h)}),[c,b,v]),addSelectedItem:t.useCallback((function(e){c({type:Dt,selectedItem:e})}),[c]),removeSelectedItem:t.useCallback((function(e){c({type:Ot,selectedItem:e})}),[c]),setSelectedItems:t.useCallback((function(e){c({type:Mt,selectedItems:e})}),[c]),setActiveIndex:t.useCallback((function(e){c({type:Et,activeIndex:e})}),[c]),reset:t.useCallback((function(){c({type:Kt})}),[c]),selectedItems:f,activeIndex:p}}Vt.stateChangeTypes=Pt,e.default=$,e.resetIdCounter=function(){"useId"in o.default?console.warn("It is not necessary to call resetIdCounter when using React 18+"):m=0},e.useCombobox=at,e.useMultipleSelection=Vt,e.useSelect=Fe,Object.defineProperty(e,"__esModule",{value:!0})}));
*/!function(){if(a)return d;a=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function I(e){if("object"==typeof e&&null!==e){var a=e.$$typeof;switch(a){case t:switch(e=e.type){case i:case r:case o:case p:case f:return e;default:switch(e=e&&e.$$typeof){case l:case s:case c:case g:case h:case u:return e;default:return a}}case n:return a}}}e=Symbol.for("react.module.reference"),d.ContextConsumer=s,d.ContextProvider=u,d.Element=t,d.ForwardRef=c,d.Fragment=i,d.Lazy=g,d.Memo=h,d.Portal=n,d.Profiler=r,d.StrictMode=o,d.Suspense=p,d.SuspenseList=f,d.isAsyncMode=function(){return!1},d.isConcurrentMode=function(){return!1},d.isContextConsumer=function(e){return I(e)===s},d.isContextProvider=function(e){return I(e)===u},d.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},d.isForwardRef=function(e){return I(e)===c},d.isFragment=function(e){return I(e)===i},d.isLazy=function(e){return I(e)===g},d.isMemo=function(e){return I(e)===h},d.isPortal=function(e){return I(e)===n},d.isProfiler=function(e){return I(e)===r},d.isStrictMode=function(e){return I(e)===o},d.isSuspense=function(e){return I(e)===p},d.isSuspenseList=function(e){return I(e)===f},d.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===r||t===o||t===p||t===f||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===g||t.$$typeof===h||t.$$typeof===u||t.$$typeof===s||t.$$typeof===c||t.$$typeof===e||void 0!==t.getModuleId)},d.typeOf=I}();const c=e=>"object"==typeof e&&null!=e&&1===e.nodeType,p=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,f=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return p(n.overflowY,t)||p(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},h=(e,t,n,i,o,r,u,s)=>r<e&&u>t||r>e&&u<t?0:r<=e&&s<=n||u>=t&&s>=n?r-e-i:u>t&&s<n||r<e&&s>n?u-t+o:0,g=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var m=0;function I(e){return"function"==typeof e?e:v}function v(){}function y(e,t){if(e){var n=((e,t)=>{var n,i,o,r;if("undefined"==typeof document)return[];const{scrollMode:u,block:s,inline:l,boundary:a,skipOverflowHiddenElements:d}=t,p="function"==typeof a?a:e=>e!==a;if(!c(e))throw new TypeError("Invalid target");const m=document.scrollingElement||document.documentElement,I=[];let v=e;for(;c(v)&&p(v);){if(v=g(v),v===m){I.push(v);break}null!=v&&v===document.body&&f(v)&&!f(document.documentElement)||null!=v&&f(v,d)&&I.push(v)}const y=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,b=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,{scrollX:x,scrollY:w}=window,{height:S,width:C,top:k,right:D,bottom:O,left:M}=e.getBoundingClientRect(),{top:E,right:K,bottom:P,left:T}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let H="start"===s||"nearest"===s?k-E:"end"===s?O+P:k+S/2-E+P,R="center"===l?M+C/2-T+K:"end"===l?D+K:M-T;const V=[];for(let e=0;e<I.length;e++){const t=I[e],{height:n,width:i,top:o,right:r,bottom:a,left:d}=t.getBoundingClientRect();if("if-needed"===u&&k>=0&&M>=0&&O<=b&&D<=y&&k>=o&&O<=a&&M>=d&&D<=r)return V;const c=getComputedStyle(t),p=parseInt(c.borderLeftWidth,10),f=parseInt(c.borderTopWidth,10),g=parseInt(c.borderRightWidth,10),v=parseInt(c.borderBottomWidth,10);let E=0,K=0;const P="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-g:0,T="offsetHeight"in t?t.offsetHeight-t.clientHeight-f-v:0,B="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,A="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(m===t)E="start"===s?H:"end"===s?H-b:"nearest"===s?h(w,w+b,b,f,v,w+H,w+H+S,S):H-b/2,K="start"===l?R:"center"===l?R-y/2:"end"===l?R-y:h(x,x+y,y,p,g,x+R,x+R+C,C),E=Math.max(0,E+w),K=Math.max(0,K+x);else{E="start"===s?H-o-f:"end"===s?H-a+v+T:"nearest"===s?h(o,a,n,f,v+T,H,H+S,S):H-(o+n/2)+T/2,K="start"===l?R-d-p:"center"===l?R-(d+i/2)+P/2:"end"===l?R-r+g+P:h(d,r,i,p,g+P,R,R+C,C);const{scrollLeft:e,scrollTop:u}=t;E=0===A?0:Math.max(0,Math.min(u+E/A,t.scrollHeight-n/A+T)),K=0===B?0:Math.max(0,Math.min(e+K/B,t.scrollWidth-i/B+P)),H+=u-E,R+=e-K}V.push({el:t,top:E,left:K})}return V})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,i=e.left;t.scrollTop=n,t.scrollLeft=i}))}}function b(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function x(e,t){var n;function i(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,r=new Array(o),u=0;u<o;u++)r[u]=arguments[u];i(),n=setTimeout((function(){n=null,e.apply(void 0,r)}),t)}return o.cancel=i,o}function w(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(i)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function S(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function C(){return String(m++)}function k(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function D(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var O=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function M(e){void 0===e&&(e={});var t={};return O.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function E(e,t){return e&&t?Object.keys(e).reduce((function(n,i){return n[i]=K(t,i)?t[i]:e[i],n}),{}):e}function K(e,t){return void 0!==e[t]}function P(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function T(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(0===r)return-1;var u=r-1;("number"!=typeof e||e<0||e>u)&&(e=t>0?-1:u+1);var s=e+t;s<0?s=o?u:0:s>u&&(s=o?0:u);var l=H(s,t<0,n,i,o);return-1===l?e>=r?-1:e:l}function H(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(t){for(var u=e;u>=0;u--)if(!i(n[u],u))return u}else for(var s=e;s<r;s++)if(!i(n[s],s))return s;return o?H(t?r-1:0,t,n,i):-1}function R(e,t,n,i){return void 0===i&&(i=!0),n&&t.some((function(t){return t&&(b(t,e,n)||i&&b(t,n.document.activeElement,n))}))}var V=x((function(e){B(e).textContent=""}),500);function B(e){var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function A(e,t){e&&t&&(B(t).textContent=e,V(t))}var L=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),F=["refKey","ref"],_=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],N=["onKeyDown","onBlur","onChange","onInput","onChangeText"],j=["refKey","ref"],U=["onMouseMove","onMouseDown","onClick","onPress","index","item"],$=function(){var e=function(e){function n(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+C(),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var i=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==i})),e()}),t);n.timeoutIds.push(i)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.isItemDisabled=function(e,t){var i=n.getItemNodeFromIndex(t);return i&&i.hasAttribute("disabled")},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=M(t),n.internalSetState(s({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,i){t=M(t),n.internalSetState(s({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),i)},n.selectItemAtIndex=function(e,t,i){var o=n.items[e];null!=o&&n.selectItem(o,t,i)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var i,o,r={},u="function"==typeof e;return!u&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,s({},n.getStateAndHelpers(),e)),n.setState((function(t){var l;t=n.getState(t);var a=u?e(t):e;a=n.props.stateReducer(t,a),i=a.hasOwnProperty("selectedItem");var d={};return i&&a.selectedItem!==t.selectedItem&&(o=a.selectedItem),(l=a).type||(l.type=0),Object.keys(a).forEach((function(e){t[e]!==a[e]&&(r[e]=a[e]),"type"!==e&&(a[e],K(n.props,e)||(d[e]=a[e]))})),u&&a.hasOwnProperty("inputValue")&&n.props.onInputValueChange(a.inputValue,s({},n.getStateAndHelpers(),a)),d}),(function(){I(t)(),Object.keys(r).length>1&&n.props.onStateChange(r,n.getStateAndHelpers()),i&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(r,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var i,o=void 0===e?{}:e,r=o.refKey,l=void 0===r?"ref":r,a=o.ref,d=u(o,F),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=p;var f=n.getState().isOpen;return s(((i={})[l]=S(a,n.rootRef),i.role="combobox",i["aria-expanded"]=f,i["aria-haspopup"]="listbox",i["aria-owns"]=f?n.menuId:void 0,i["aria-labelledby"]=n.labelId,i),d)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=T(t.getState().highlightedIndex,1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=T(t.getState().highlightedIndex,-1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,i=t.highlightedIndex;if(n&&null!=i){e.preventDefault();var o=this.items[i],r=this.getItemNodeFromIndex(i);if(null==o||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(s({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=s({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=s({},n.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=H(0,!1,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:7})}}},End:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=H(n-1,!0,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick;t.onPress;var o=t.onKeyDown,r=t.onKeyUp,l=t.onBlur,a=u(t,_),d=n.getState().isOpen,c={onClick:w(i,n.buttonHandleClick),onKeyDown:w(o,n.buttonHandleKeyDown),onKeyUp:w(r,n.buttonHandleKeyUp),onBlur:w(l,n.buttonHandleBlur)};return s({type:"button",role:"button","aria-label":d?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:c,a)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=P(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(n,e)},n.buttonHandleClick=function(e){if(e.preventDefault(),n.props.environment){var t=n.props.environment.document,i=t.body,o=t.activeElement;i&&i===o&&e.target.focus()}n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){if(!n.isMouseDown&&n.props.environment){var e=n.props.environment.document.activeElement;null!=e&&e.id===n.inputId||e===t||n.reset({type:14})}}))},n.getLabelProps=function(e){return s({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,o=t.onBlur,r=t.onChange,l=t.onInput;t.onChangeText;var a=u(t,N),d={};var c,p=n.getState(),f=p.inputValue,h=p.isOpen,g=p.highlightedIndex;a.disabled||((c={}).onInput=w(r,l,n.inputHandleChange),c.onKeyDown=w(i,n.inputHandleKeyDown),c.onBlur=w(o,n.inputHandleBlur),d=c);return s({"aria-autocomplete":"list","aria-activedescendant":h&&"number"==typeof g&&g>=0?n.getItemId(g):void 0,"aria-controls":h?n.menuId:void 0,"aria-labelledby":a&&a["aria-label"]?void 0:n.labelId,autoComplete:"off",value:f,id:n.inputId},d,a)},n.inputHandleKeyDown=function(e){var t=P(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(n,e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e;if(!n.isMouseDown&&n.props.environment){var t=n.props.environment.document.activeElement;(null==t||null==(e=t.dataset)?void 0:e.toggle)&&n._rootNode&&n._rootNode.contains(t)||n.reset({type:10})}}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var i,o=void 0===e?{}:e,r=o.refKey,l=void 0===r?"ref":r,a=o.ref,d=u(o,j),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=p,s(((i={})[l]=S(a,n.menuRef),i.role="listbox",i["aria-labelledby"]=d&&d["aria-label"]?void 0:n.labelId,i.id=n.menuId,i),d)},n.getItemProps=function(e){var t,i=void 0===e?{}:e,o=i.onMouseMove,r=i.onMouseDown,l=i.onClick;i.onPress;var a=i.index,d=i.item,c=void 0===d?void 0:d,p=u(i,U);void 0===a?(n.items.push(c),a=n.items.indexOf(c)):n.items[a]=c;var f=l,h=((t={onMouseMove:w(o,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:w(r,(function(e){e.preventDefault()}))}).onClick=w(f,(function(){n.selectItemAtIndex(a,{type:9})})),t),g=p.disabled?{onMouseDown:h.onMouseDown}:h;return s({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},g,p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=M(e),n.internalSetState((function(t){var i=t.selectedItem;return s({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(i)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=M(e),n.internalSetState((function(t){var i=t.isOpen;return s({isOpen:!i},i&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var i=n.getState(),o=i.isOpen,r=i.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof r&&n.setHighlightedIndex(r,e),I(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=x((function(){var e;if(null!=(e=n.props)&&null!=(e=e.environment)&&e.document){var t=n.getState(),i=n.items[t.highlightedIndex],o=n.getItemCount(),r=n.props.getA11yStatusMessage(s({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:o,highlightedItem:i},t));n.previousResultCount=o,A(r,n.props.environment.document)}}),200);var i=n.props,o=i.defaultHighlightedIndex,r=i.initialHighlightedIndex,l=void 0===r?o:r,a=i.defaultIsOpen,d=i.initialIsOpen,c=void 0===d?a:d,p=i.initialInputValue,f=void 0===p?"":p,h=i.initialSelectedItem,g=void 0===h?null:h,m=n.getState({highlightedIndex:l,isOpen:c,inputValue:f,selectedItem:g});return null!=m.selectedItem&&void 0===n.props.initialInputValue&&(m.inputValue=n.props.itemToString(m.selectedItem)),n.state=m,n}var i,o;o=e,(i=n).prototype=Object.create(o.prototype),i.prototype.constructor=i,l(i,o);var r=n.prototype;return r.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},r.getState=function(e){return void 0===e&&(e=this.state),E(e,this.props)},r.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},r.getItemNodeFromIndex=function(e){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(e)):null},r.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},r.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),i=this.getState().highlightedIndex;if(n>0){var o=T(i,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(o,t)}},r.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,i=e.selectedItem,o=e.isOpen,r=this.props.itemToString,u=this.id,s=this.getRootProps,l=this.getToggleButtonProps,a=this.getLabelProps,d=this.getMenuProps,c=this.getInputProps,p=this.getItemProps,f=this.openMenu,h=this.closeMenu,g=this.toggleMenu,m=this.selectItem,I=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,b=this.clearSelection,x=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:a,getMenuProps:d,getInputProps:c,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:h,toggleMenu:g,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:i}},r.componentDidMount=function(){var e=this;if(this.props.environment){var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!R(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},i=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},r=function(t){var n=R(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",t),u.addEventListener("mouseup",n),u.addEventListener("touchstart",i),u.addEventListener("touchmove",o),u.addEventListener("touchend",r),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",i),u.removeEventListener("touchmove",o),u.removeEventListener("touchend",r)}}else this.cleanup=function(){e.internalClearTimeouts()}},r.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,i=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==i},r.componentDidUpdate=function(e,t){K(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},r.componentWillUnmount=function(){this.cleanup()},r.render=function(){var e=D(this.props.children,v);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var n=D(e(this.getStateAndHelpers()));return n?this.getRootProps.called||this.props.suppressRefError?n:function(e){return"string"==typeof e.type||"string"==typeof e.nodeName}(n)?t.cloneElement(n,this.getRootProps(function(e){return e.props||e.attributes}(n))):void 0:null},n}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:k,itemToString:function(e){return null==e?"":String(e)},onStateChange:v,onInputValueChange:v,onUserAction:v,onChange:v,onSelect:v,onOuterClick:v,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:y},e.stateChangeTypes=L,e}(),W={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function q(e,t,n){var i=e.props,o=e.type,r={};Object.keys(t).forEach((function(i){!function(e,t,n,i){var o=t.props,r=t.type,u="on"+J(e)+"Change";o[u]&&void 0!==i[e]&&i[e]!==n[e]&&o[u](s({type:r},i))}(i,e,t,n),n[i]!==t[i]&&(r[i]=n[i])})),i.onStateChange&&Object.keys(r).length&&i.onStateChange(s({type:o},r))}var z=x((function(e,t){A(e,t)}),200),X="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,Y="useId"in o.default?function(e){var n=e.id,i=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId,a="downshift-"+o.default.useId();return n||(n=a),t.useRef({labelId:i||n+"-label",menuId:r||n+"-menu",getItemId:u||function(e){return n+"-item-"+e},toggleButtonId:s||n+"-toggle-button",inputId:l||n+"-input"}).current}:function(e){var n=e.id,i=void 0===n?"downshift-"+C():n,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId;return t.useRef({labelId:o||i+"-label",menuId:r||i+"-menu",getItemId:u||function(e){return i+"-item-"+e},toggleButtonId:s||i+"-toggle-button",inputId:l||i+"-input"}).current};function G(e,t,n,i){var o,r;if(void 0===e){if(void 0===t)throw new Error(i);o=n[t],r=t}else r=void 0===t?n.indexOf(e):t,o=e;return[o,r]}function J(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Q(e){var n=t.useRef(e);return n.current=e,n}function Z(e,n,i,o){var r=t.useRef(),u=t.useRef(),l=t.useCallback((function(t,n){u.current=n,t=E(t,n.props);var i=e(t,n);return n.props.stateReducer(t,s({},n,{changes:i}))}),[e]),a=t.useReducer(l,n,i),d=a[0],c=a[1],p=Q(n),f=t.useCallback((function(e){return c(s({props:p.current},e))}),[p]),h=u.current;return t.useEffect((function(){var e=E(r.current,null==h?void 0:h.props);h&&r.current&&!o(e,d)&&q(h,e,d),r.current=d}),[d,h,o]),[d,f]}function ee(e,t,n,i){var o=Z(e,t,n,i),r=o[0],u=o[1];return[E(r,t),u]}var te={itemToString:function(e){return e?String(e):""},itemToKey:function(e){return e},stateReducer:function(e,t){return t.changes},scrollIntoView:y,environment:"undefined"==typeof window?void 0:window};function ne(e,t,n){void 0===n&&(n=W);var i=e["default"+J(t)];return void 0!==i?i:n[t]}function ie(e,t,n){void 0===n&&(n=W);var i=e[t];if(void 0!==i)return i;var o=e["initial"+J(t)];return void 0!==o?o:ne(e,t,n)}function oe(e){var t=ie(e,"selectedItem"),n=ie(e,"isOpen"),i=ie(e,"highlightedIndex"),o=ie(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.findIndex((function(n){return e.itemToKey(n)===e.itemToKey(t)})):i,isOpen:n,selectedItem:t,inputValue:o}}function re(e,t,n){var i=e.items,o=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=e.isItemDisabled,s=e.itemToKey,l=t.selectedItem,a=t.highlightedIndex;return 0===i.length?-1:void 0===o||a!==o||u(i[o])?void 0===r||u(i[r])?l?i.findIndex((function(e){return s(l)===s(e)})):n<0&&!u(i[i.length-1])?i.length-1:n>0&&!u(i[0])?0:-1:r:o}function ue(e,n,i){var o=t.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return t.useEffect((function(){if(!e)return v;var t=n.map((function(e){return e.current}));function r(){o.current.isTouchEnd=!1,o.current.isMouseDown=!0}function u(n){o.current.isMouseDown=!1,R(n.target,t,e)||i()}function s(){o.current.isTouchEnd=!1,o.current.isTouchMove=!1}function l(){o.current.isTouchMove=!0}function a(n){o.current.isTouchEnd=!0,o.current.isTouchMove||R(n.target,t,e,!1)||i()}return e.addEventListener("mousedown",r),e.addEventListener("mouseup",u),e.addEventListener("touchstart",s),e.addEventListener("touchmove",l),e.addEventListener("touchend",a),function(){e.removeEventListener("mousedown",r),e.removeEventListener("mouseup",u),e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",a)}}),[e,i]),o.current}var se=function(){return v};function le(e,n,i,o){void 0===o&&(o={});var r=o.document,u=fe();t.useEffect((function(){if(e&&!u&&r){var t=e(n);z(t,r)}}),i),t.useEffect((function(){return function(){var e,t;z.cancel(),(t=null==(e=r)?void 0:e.getElementById("a11y-status-message"))&&t.remove()}}),[r])}function ae(e){var n=e.highlightedIndex,i=e.isOpen,o=e.itemRefs,r=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,l=t.useRef(!0);return X((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var de=v;function ce(e,t,n){var i;return void 0===n&&(n=!0),s({isOpen:!1,highlightedIndex:-1},(null==(i=e.items)?void 0:i.length)&&t>=0&&s({selectedItem:e.items[t],isOpen:ne(e,"isOpen"),highlightedIndex:ne(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function pe(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function fe(){var e=o.default.useRef(!0);return o.default.useEffect((function(){return e.current=!1,function(){e.current=!0}}),[]),e.current}var he={environment:r.default.shape({addEventListener:r.default.func.isRequired,removeEventListener:r.default.func.isRequired,document:r.default.shape({createElement:r.default.func.isRequired,getElementById:r.default.func.isRequired,activeElement:r.default.any.isRequired,body:r.default.any.isRequired}).isRequired,Node:r.default.func.isRequired}),itemToString:r.default.func,itemToKey:r.default.func,stateReducer:r.default.func},ge=s({},he,{getA11yStatusMessage:r.default.func,highlightedIndex:r.default.number,defaultHighlightedIndex:r.default.number,initialHighlightedIndex:r.default.number,isOpen:r.default.bool,defaultIsOpen:r.default.bool,initialIsOpen:r.default.bool,selectedItem:r.default.any,initialSelectedItem:r.default.any,defaultSelectedItem:r.default.any,id:r.default.string,labelId:r.default.string,menuId:r.default.string,getItemId:r.default.func,toggleButtonId:r.default.string,onSelectedItemChange:r.default.func,onHighlightedIndexChange:r.default.func,onStateChange:r.default.func,onIsOpenChange:r.default.func,scrollIntoView:r.default.func});function me(e,t,n){var i,o=t.type,r=t.props;switch(o){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:re(r,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:re(r,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:ne(r,"highlightedIndex"),isOpen:ne(r,"isOpen"),selectedItem:ne(r,"selectedItem"),inputValue:ne(r,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return s({},e,i)}var Ie=function(){return Ie=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ie.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,Ie(Ie({},ge),{items:r.default.array.isRequired,isItemDisabled:r.default.func});var ve=Ie(Ie({},te),{isItemDisabled:function(){return!1}}),ye=v,be=1,xe=2,we=3,Se=4,Ce=5,ke=6,De=7,Oe=8,Me=9,Ee=10,Ke=11,Pe=14,Te=19,He=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:be,ToggleButtonKeyDownArrowUp:xe,ToggleButtonKeyDownCharacter:we,ToggleButtonKeyDownEscape:Se,ToggleButtonKeyDownHome:Ce,ToggleButtonKeyDownEnd:ke,ToggleButtonKeyDownEnter:De,ToggleButtonKeyDownSpaceButton:Oe,ToggleButtonKeyDownPageUp:Me,ToggleButtonKeyDownPageDown:Ee,ToggleButtonBlur:Ke,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:Pe,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Te,FunctionSetInputValue:20,FunctionReset:21});function Re(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case Pe:i={isOpen:ne(r,"isOpen"),highlightedIndex:ne(r,"highlightedIndex"),selectedItem:r.items[t.index]};break;case we:var l=t.key,a=""+e.inputValue+l;i={inputValue:a,highlightedIndex:function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.isItemDisabled,u=t.toLowerCase(),s=0;s<i.length;s++){var l=(s+n+(t.length<2?1:0))%i.length,a=i[l];if(void 0!==a&&o(a).toLowerCase().startsWith(u)&&!r(a,l))return l}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.findIndex((function(t){return r.itemToKey(t)===r.itemToKey(e.selectedItem)})):e.highlightedIndex,items:r.items,itemToString:r.itemToString,isItemDisabled:r.isItemDisabled}),isOpen:!0};break;case be:i={highlightedIndex:e.isOpen?T(e.highlightedIndex,1,r.items,r.isItemDisabled):u&&null==e.selectedItem?-1:re(r,e,1),isOpen:!0};break;case xe:if(e.isOpen&&u)i=ce(r,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?T(e.highlightedIndex,-1,r.items,r.isItemDisabled):re(r,e,-1),isOpen:!0};break;case De:case Oe:i=ce(r,e.highlightedIndex,!1);break;case Ce:i={highlightedIndex:H(0,!1,r.items,r.isItemDisabled),isOpen:!0};break;case ke:i={highlightedIndex:H(r.items.length-1,!0,r.items,r.isItemDisabled),isOpen:!0};break;case Me:i={highlightedIndex:T(e.highlightedIndex,-10,r.items,r.isItemDisabled)};break;case Ee:i={highlightedIndex:T(e.highlightedIndex,10,r.items,r.isItemDisabled)};break;case Se:i={isOpen:!1,highlightedIndex:-1};break;case Ke:i=s({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&{selectedItem:r.items[e.highlightedIndex]});break;case Te:i={selectedItem:t.selectedItem};break;default:return me(e,t,He)}return s({},e,i)}var Ve=["onClick"],Be=["onMouseLeave","refKey","ref"],Ae=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],Le=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function Fe(e){void 0===e&&(e={}),ye();var n=s({},ve,e),i=n.scrollIntoView,o=n.environment,r=n.getA11yStatusMessage,l=ee(Re,n,oe,pe),a=l[0],d=l[1],c=a.isOpen,p=a.highlightedIndex,f=a.selectedItem,h=a.inputValue,g=t.useRef(null),m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),y=Y(n),b=Q({state:a,props:n}),C=t.useCallback((function(e){return I.current[y.getItemId(e)]}),[y]);le(r,a,[c,p,f,h],o);var k=ae({menuElement:m.current,highlightedIndex:p,isOpen:c,itemRefs:I,scrollIntoView:i,getItemNodeFromIndex:C});t.useEffect((function(){return v.current=x((function(e){e({type:20,inputValue:""})}),500),function(){v.current.cancel()}}),[]),t.useEffect((function(){h&&v.current(d)}),[d,h]),de(),t.useEffect((function(){ie(n,"isOpen")&&g.current&&g.current.focus()}),[]);var D=ue(o,[g,m],t.useCallback((function(){b.current.state.isOpen&&d({type:Ke})}),[d,b])),O=se();t.useEffect((function(){c||(I.current={})}),[c]);var M=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),d({type:be,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),d({type:xe,altKey:e.altKey})},Home:function(e){e.preventDefault(),d({type:Ce})},End:function(e){e.preventDefault(),d({type:ke})},Escape:function(){b.current.state.isOpen&&d({type:Se})},Enter:function(e){e.preventDefault(),d({type:b.current.state.isOpen?De:0})},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),d({type:Me}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),d({type:Ee}))}," ":function(e){e.preventDefault();var t=b.current.state;t.isOpen?t.inputValue?d({type:we,key:" "}):d({type:Oe}):d({type:0})}}}),[d,b]),E=t.useCallback((function(){d({type:15})}),[d]),K=t.useCallback((function(){d({type:17})}),[d]),T=t.useCallback((function(){d({type:16})}),[d]),H=t.useCallback((function(e){d({type:18,highlightedIndex:e})}),[d]),R=t.useCallback((function(e){d({type:Te,selectedItem:e})}),[d]),V=t.useCallback((function(){d({type:21})}),[d]),B=t.useCallback((function(e){d({type:20,inputValue:e})}),[d]),A=t.useCallback((function(e){var t=void 0===e?{}:e,n=t.onClick,i=u(t,Ve);return s({id:y.labelId,htmlFor:y.toggleButtonId,onClick:w(n,(function(){var e;null==(e=g.current)||e.focus()}))},i)}),[y]),L=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,r=i.refKey,l=void 0===r?"ref":r,a=i.ref,c=u(i,Be),p=(void 0===t?{}:t).suppressRefError;return O("getMenuProps",void 0!==p&&p,l,m),s(((n={})[l]=S(a,(function(e){m.current=e})),n.id=y.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+y.labelId,n.onMouseLeave=w(o,(function(){d({type:12})})),n),c)}),[d,O,y]),F=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onBlur,r=i.onClick;i.onPress;var l=i.onKeyDown,a=i.refKey,c=void 0===a?"ref":a,p=i.ref,f=u(i,Ae),h=(void 0===t?{}:t).suppressRefError,m=void 0!==h&&h,I=b.current.state,v=s(((n={})[c]=S(p,(function(e){g.current=e})),n["aria-activedescendant"]=I.isOpen&&I.highlightedIndex>-1?y.getItemId(I.highlightedIndex):"",n["aria-controls"]=y.menuId,n["aria-expanded"]=b.current.state.isOpen,n["aria-haspopup"]="listbox",n["aria-labelledby"]=f&&f["aria-label"]?void 0:""+y.labelId,n.id=y.toggleButtonId,n.role="combobox",n.tabIndex=0,n.onBlur=w(o,(function(){I.isOpen&&!D.isMouseDown&&d({type:Ke})})),n),f);return f.disabled||(v.onClick=w(r,(function(){d({type:0})})),v.onKeyDown=w(l,(function(e){var t=P(e);t&&M[t]?M[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&d({type:we,key:t})}))),O("getToggleButtonProps",m,c,g),v}),[d,y,b,D,O,M]),_=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,o=n.index,r=n.onMouseMove,l=n.onClick,a=n.onMouseDown;n.onPress;var c=n.refKey,p=void 0===c?"ref":c,f=n.disabled,h=n.ref,g=u(n,Le);void 0!==f&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var m=b.current,v=m.state,x=m.props,C=G(i,o,x.items,"Pass either item or index to getItemProps!"),O=C[0],M=C[1],E=x.isItemDisabled(O,M),K=s(((t={})[p]=S(h,(function(e){e&&(I.current[y.getItemId(M)]=e)})),t["aria-disabled"]=E,t["aria-selected"]=""+(O===v.selectedItem),t.id=y.getItemId(M),t.role="option",t),g);return E||(K.onClick=w(l,(function(){d({type:Pe,index:M})}))),K.onMouseMove=w(r,(function(){D.isTouchEnd||M===v.highlightedIndex||(k.current=!1,d({type:13,index:M,disabled:E}))})),K.onMouseDown=w(a,(function(e){return e.preventDefault()})),K}),[b,y,D,k,d]);return{getToggleButtonProps:F,getLabelProps:A,getMenuProps:L,getItemProps:_,toggleMenu:E,openMenu:T,closeMenu:K,setHighlightedIndex:H,selectItem:R,reset:V,setInputValue:B,highlightedIndex:p,isOpen:c,selectedItem:f,inputValue:h}}Fe.stateChangeTypes=He;var _e=0,Ne=1,je=2,Ue=3,$e=4,We=5,qe=6,ze=7,Xe=8,Ye=9,Ge=10,Je=13,Qe=19,Ze=22,et=Object.freeze({__proto__:null,InputKeyDownArrowDown:_e,InputKeyDownArrowUp:Ne,InputKeyDownEscape:je,InputKeyDownHome:Ue,InputKeyDownEnd:$e,InputKeyDownPageUp:We,InputKeyDownPageDown:qe,InputKeyDownEnter:ze,InputChange:Xe,InputBlur:Ye,InputClick:Ge,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:Je,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Qe,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:Ze});function tt(e){var t=oe(e),n=t.selectedItem,i=t.inputValue;return""===i&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(i=e.itemToString(n)),s({},t,{inputValue:i})}s({},ge,{items:r.default.array.isRequired,isItemDisabled:r.default.func,inputValue:r.default.string,defaultInputValue:r.default.string,initialInputValue:r.default.string,inputId:r.default.string,onInputValueChange:r.default.func});var nt=v,it=s({},te,{isItemDisabled:function(){return!1}});function ot(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case Je:i={isOpen:ne(r,"isOpen"),highlightedIndex:ne(r,"highlightedIndex"),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case _e:i=e.isOpen?{highlightedIndex:T(e.highlightedIndex,1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:u&&null==e.selectedItem?-1:re(r,e,1),isOpen:r.items.length>=0};break;case Ne:i=e.isOpen?u?ce(r,e.highlightedIndex):{highlightedIndex:T(e.highlightedIndex,-1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:re(r,e,-1),isOpen:r.items.length>=0};break;case ze:i=ce(r,e.highlightedIndex);break;case je:i=s({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case We:i={highlightedIndex:T(e.highlightedIndex,-10,r.items,r.isItemDisabled,!0)};break;case qe:i={highlightedIndex:T(e.highlightedIndex,10,r.items,r.isItemDisabled,!0)};break;case Ue:i={highlightedIndex:H(0,!1,r.items,r.isItemDisabled)};break;case $e:i={highlightedIndex:H(r.items.length-1,!0,r.items,r.isItemDisabled)};break;case Ye:i=s({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case Xe:i={isOpen:!0,highlightedIndex:ne(r,"highlightedIndex"),inputValue:t.inputValue};break;case Ge:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:re(r,e,0)};break;case Qe:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case Ze:i={inputValue:t.inputValue};break;default:return me(e,t,et)}return s({},e,i)}var rt=["onMouseLeave","refKey","ref"],ut=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],st=["onClick","onPress","refKey","ref"],lt=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function at(e){void 0===e&&(e={}),nt();var n=s({},it,e),i=n.items,o=n.scrollIntoView,r=n.environment,l=n.getA11yStatusMessage,a=function(e,n,i,o){var r=t.useRef(),u=Z(e,n,i,o),s=u[0],l=u[1],a=fe();return t.useEffect((function(){K(n,"selectedItem")&&(a||n.itemToKey(n.selectedItem)!==n.itemToKey(r.current)&&l({type:Ze,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[E(s,n),l]}(ot,n,tt,pe),d=a[0],c=a[1],p=d.isOpen,f=d.highlightedIndex,h=d.selectedItem,g=d.inputValue,m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),y=t.useRef(null),b=fe(),x=Y(n),C=t.useRef(),k=Q({state:d,props:n}),D=t.useCallback((function(e){return I.current[x.getItemId(e)]}),[x]);le(l,d,[p,f,h,g],r);var O=ae({menuElement:m.current,highlightedIndex:f,isOpen:p,itemRefs:I,scrollIntoView:o,getItemNodeFromIndex:D});de(),t.useEffect((function(){ie(n,"isOpen")&&v.current&&v.current.focus()}),[]),t.useEffect((function(){b||(C.current=i.length)}));var M=ue(r,[y,m,v],t.useCallback((function(){k.current.state.isOpen&&c({type:Ye,selectItem:!1})}),[c,k])),T=se();t.useEffect((function(){p||(I.current={})}),[p]),t.useEffect((function(){var e;p&&null!=r&&r.document&&null!=v&&null!=(e=v.current)&&e.focus&&r.document.activeElement!==v.current&&v.current.focus()}),[p,r]);var H=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),c({type:_e,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:Ne,altKey:e.altKey})},Home:function(e){k.current.state.isOpen&&(e.preventDefault(),c({type:Ue}))},End:function(e){k.current.state.isOpen&&(e.preventDefault(),c({type:$e}))},Escape:function(e){var t=k.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),c({type:je}))},Enter:function(e){k.current.state.isOpen&&229!==e.which&&(e.preventDefault(),c({type:ze}))},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),c({type:We}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),c({type:qe}))}}}),[c,k]),R=t.useCallback((function(e){return s({id:x.labelId,htmlFor:x.inputId},e)}),[x]),V=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,r=i.refKey,l=void 0===r?"ref":r,a=i.ref,d=u(i,rt),p=(void 0===t?{}:t).suppressRefError;return T("getMenuProps",void 0!==p&&p,l,m),s(((n={})[l]=S(a,(function(e){m.current=e})),n.id=x.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+x.labelId,n.onMouseLeave=w(o,(function(){c({type:11})})),n),d)}),[c,T,x]),B=t.useCallback((function(e){var t,n,i=void 0===e?{}:e,o=i.item,r=i.index,l=i.refKey,a=void 0===l?"ref":l,d=i.ref,p=i.onMouseMove,f=i.onMouseDown,h=i.onClick;i.onPress;var g=i.disabled,m=u(i,ut);void 0!==g&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var v=k.current,y=v.props,b=v.state,C=G(o,r,y.items,"Pass either item or index to getItemProps!"),D=C[0],E=C[1],K=y.isItemDisabled(D,E),P=h;return s(((t={})[a]=S(d,(function(e){e&&(I.current[x.getItemId(E)]=e)})),t["aria-disabled"]=K,t["aria-selected"]=""+(E===b.highlightedIndex),t.id=x.getItemId(E),t.role="option",t),!K&&((n={}).onClick=w(P,(function(){c({type:Je,index:E})})),n),{onMouseMove:w(p,(function(){M.isTouchEnd||E===b.highlightedIndex||(O.current=!1,c({type:12,index:E,disabled:K}))})),onMouseDown:w(f,(function(e){return e.preventDefault()}))},m)}),[c,x,k,M,O]),A=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.onClick;n.onPress;var o=n.refKey,r=void 0===o?"ref":o,l=n.ref,a=u(n,st),d=k.current.state;return s(((t={})[r]=S(l,(function(e){y.current=e})),t["aria-controls"]=x.menuId,t["aria-expanded"]=d.isOpen,t.id=x.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&s({},{onClick:w(i,(function(){c({type:14})}))}),a)}),[c,k,x]),L=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onKeyDown,l=i.onChange,a=i.onInput,d=i.onBlur;i.onChangeText;var p=i.onClick,f=i.refKey,h=void 0===f?"ref":f,g=i.ref,m=u(i,lt),I=(void 0===t?{}:t).suppressRefError;T("getInputProps",void 0!==I&&I,h,v);var y,b=k.current.state,C={};m.disabled||((y={}).onInput=w(l,a,(function(e){c({type:Xe,inputValue:e.target.value})})),y.onKeyDown=w(o,(function(e){var t=P(e);t&&H[t]&&H[t](e)})),y.onBlur=w(d,(function(e){if(null!=r&&r.document&&b.isOpen&&!M.isMouseDown){var t=null===e.relatedTarget&&r.document.activeElement!==r.document.body;c({type:Ye,selectItem:!t})}})),y.onClick=w(p,(function(){c({type:Ge})})),C=y);return s(((n={})[h]=S(g,(function(e){v.current=e})),n["aria-activedescendant"]=b.isOpen&&b.highlightedIndex>-1?x.getItemId(b.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=x.menuId,n["aria-expanded"]=b.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:x.labelId,n.autoComplete="off",n.id=x.inputId,n.role="combobox",n.value=b.inputValue,n),C,m)}),[c,x,r,H,k,M,T]),F=t.useCallback((function(){c({type:15})}),[c]),_=t.useCallback((function(){c({type:17})}),[c]),N=t.useCallback((function(){c({type:16})}),[c]),j=t.useCallback((function(e){c({type:18,highlightedIndex:e})}),[c]),U=t.useCallback((function(e){c({type:Qe,selectedItem:e})}),[c]);return{getItemProps:B,getLabelProps:R,getMenuProps:V,getInputProps:L,getToggleButtonProps:A,toggleMenu:F,openMenu:N,closeMenu:_,setHighlightedIndex:j,setInputValue:t.useCallback((function(e){c({type:20,inputValue:e})}),[c]),selectItem:U,reset:t.useCallback((function(){c({type:21})}),[c]),highlightedIndex:f,isOpen:p,selectedItem:h,inputValue:g}}at.stateChangeTypes=et;var dt={activeIndex:-1,selectedItems:[]};function ct(e,t){return ie(e,t,dt)}function pt(e,t){return ne(e,t,dt)}function ft(e){return{activeIndex:ct(e,"activeIndex"),selectedItems:ct(e,"selectedItems")}}function ht(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&""!==t.value)||0===t.selectionStart&&0===t.selectionEnd}function gt(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}r.default.array,r.default.array,r.default.array,r.default.func,r.default.number,r.default.number,r.default.number,r.default.func,r.default.func,r.default.string,r.default.string;var mt={itemToKey:te.itemToKey,stateReducer:te.stateReducer,environment:te.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},It=v,vt=0,yt=1,bt=2,xt=3,wt=4,St=5,Ct=6,kt=7,Dt=8,Ot=9,Mt=10,Et=11,Kt=12,Pt=Object.freeze({__proto__:null,SelectedItemClick:vt,SelectedItemKeyDownDelete:yt,SelectedItemKeyDownBackspace:bt,SelectedItemKeyDownNavigationNext:xt,SelectedItemKeyDownNavigationPrevious:wt,DropdownKeyDownNavigationPrevious:St,DropdownKeyDownBackspace:Ct,DropdownClick:kt,FunctionAddSelectedItem:Dt,FunctionRemoveSelectedItem:Ot,FunctionSetSelectedItems:Mt,FunctionSetActiveIndex:Et,FunctionReset:Kt});function Tt(e,t){var n,i=t.type,o=t.index,r=t.props,u=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case vt:n={activeIndex:o};break;case wt:n={activeIndex:l-1<0?0:l-1};break;case xt:n={activeIndex:l+1>=a.length?-1:l+1};break;case bt:case yt:if(l<0)break;var d=l;1===a.length?d=-1:l===a.length-1&&(d=a.length-2),n=s({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:d});break;case St:n={activeIndex:a.length-1};break;case Ct:n={selectedItems:a.slice(0,a.length-1)};break;case Dt:n={selectedItems:[].concat(a,[u])};break;case kt:n={activeIndex:-1};break;case Ot:var c=l,p=a.findIndex((function(e){return r.itemToKey(e)===r.itemToKey(u)}));if(p<0)break;1===a.length?c=-1:p===a.length-1&&(c=a.length-2),n={selectedItems:[].concat(a.slice(0,p),a.slice(p+1)),activeIndex:c};break;case Mt:n={selectedItems:t.selectedItems};break;case Et:n={activeIndex:t.activeIndex};break;case Kt:n={activeIndex:pt(r,"activeIndex"),selectedItems:pt(r,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return s({},e,n)}var Ht=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Rt=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Vt(e){void 0===e&&(e={}),It();var n=s({},mt,e),i=n.getA11yStatusMessage,o=n.environment,r=n.keyNavigationNext,l=n.keyNavigationPrevious,a=ee(Tt,n,ft,gt),d=a[0],c=a[1],p=d.activeIndex,f=d.selectedItems,h=fe(),g=t.useRef(null),m=t.useRef();m.current=[];var I=Q({state:d,props:n});le(i,d,[p,f],o),t.useEffect((function(){h||(-1===p&&g.current?g.current.focus():m.current[p]&&m.current[p].focus())}),[p]),de();var v=se(),y=t.useMemo((function(){var e;return(e={})[l]=function(){c({type:wt})},e[r]=function(){c({type:xt})},e.Delete=function(){c({type:yt})},e.Backspace=function(){c({type:bt})},e}),[c,r,l]),b=t.useMemo((function(){var e;return(e={})[l]=function(e){ht(e)&&c({type:St})},e.Backspace=function(e){ht(e)&&c({type:Ct})},e}),[c,l]);return{getSelectedItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.refKey,o=void 0===i?"ref":i,r=n.ref,l=n.onClick,a=n.onKeyDown,d=n.selectedItem,p=n.index,f=u(n,Ht),h=I.current.state,g=G(d,p,h.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],v=g>-1&&g===h.activeIndex;return s(((t={})[o]=S(r,(function(e){e&&m.current.push(e)})),t.tabIndex=v?0:-1,t.onClick=w(l,(function(){c({type:vt,index:g})})),t.onKeyDown=w(a,(function(e){var t=P(e);t&&y[t]&&y[t](e)})),t),f)}),[c,I,y]),getDropdownProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.refKey,r=void 0===o?"ref":o,l=i.ref,a=i.onKeyDown,d=i.onClick,p=i.preventKeyAction,f=void 0!==p&&p,h=u(i,Rt),m=(void 0===t?{}:t).suppressRefError;return v("getDropdownProps",void 0!==m&&m,r,g),s(((n={})[r]=S(l,(function(e){e&&(g.current=e)})),n),!f&&{onKeyDown:w(a,(function(e){var t=P(e);t&&b[t]&&b[t](e)})),onClick:w(d,(function(){c({type:kt})}))},h)}),[c,b,v]),addSelectedItem:t.useCallback((function(e){c({type:Dt,selectedItem:e})}),[c]),removeSelectedItem:t.useCallback((function(e){c({type:Ot,selectedItem:e})}),[c]),setSelectedItems:t.useCallback((function(e){c({type:Mt,selectedItems:e})}),[c]),setActiveIndex:t.useCallback((function(e){c({type:Et,activeIndex:e})}),[c]),reset:t.useCallback((function(){c({type:Kt})}),[c]),selectedItems:f,activeIndex:p}}Vt.stateChangeTypes=Pt,e.default=$,e.resetIdCounter=function(){"useId"in o.default?console.warn("It is not necessary to call resetIdCounter when using React 18+"):m=0},e.useCombobox=at,e.useMultipleSelection=Vt,e.useSelect=Fe,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=downshift.umd.min.js.map

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc