New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-functional-select

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-functional-select - npm Package Compare versions

Comparing version 3.3.2 to 3.3.3

dist/components/AriaLiveRegion/index.d.ts

10

dist/components/index.d.ts

@@ -1,5 +0,5 @@

export { Menu } from './menu';
export { Value } from './value';
export { AutosizeInput } from './input';
export { AriaLiveRegion } from './aria';
export { IndicatorIcons } from './indicators';
export { default as Menu } from './Menu';
export { default as Value } from './Value';
export { default as AutosizeInput } from './AutosizeInput';
export { default as AriaLiveRegion } from './AriaLiveRegion';
export { default as IndicatorIcons } from './IndicatorIcons';

@@ -1,5 +0,5 @@

export { Menu } from './menu';
export { Value } from './value';
export { AutosizeInput } from './input';
export { AriaLiveRegion } from './aria';
export { IndicatorIcons } from './indicators';
export { default as Menu } from './Menu';
export { default as Value } from './Value';
export { default as AutosizeInput } from './AutosizeInput';
export { default as AriaLiveRegion } from './AriaLiveRegion';
export { default as IndicatorIcons } from './IndicatorIcons';

@@ -1,12 +0,11 @@

import type { MutableRefObject } from 'react';
import type { CallbackFunction } from '../types';
/**
* useCallbackRef hook
*
* Stores the callback value to a ref object and exports that ref.
* This is useful for passed in callback props that are referenced frequently referenced in deps list.
* A custom hook that converts a callback to a ref to avoid triggering re-renders
* ..when passed as a prop or avoid re-executing effects when passed as a dependency
*
* @param callback The callback to write to a ref object
* @param defaultCallback The default value of the callback for when "callback" is undefined
*/
declare const useCallbackRef: <T>(callback?: T | undefined, defaultCallback?: T | undefined) => MutableRefObject<T | undefined>;
declare const useCallbackRef: <T extends CallbackFunction>(callback: T | undefined) => T;
export default useCallbackRef;

@@ -1,18 +0,19 @@

import { useEffect, useRef } from 'react';
import { useEffect, useRef, useCallback } from 'react';
/**
* useCallbackRef hook
*
* Stores the callback value to a ref object and exports that ref.
* This is useful for passed in callback props that are referenced frequently referenced in deps list.
* A custom hook that converts a callback to a ref to avoid triggering re-renders
* ..when passed as a prop or avoid re-executing effects when passed as a dependency
*
* @param callback The callback to write to a ref object
* @param defaultCallback The default value of the callback for when "callback" is undefined
*/
const useCallbackRef = (callback, defaultCallback) => {
const callbackRef = useRef(callback || defaultCallback);
const useCallbackRef = (callback) => {
const callbackRef = useRef(callback);
useEffect(() => {
callbackRef.current = callback || defaultCallback;
}, [callback, defaultCallback]);
return callbackRef;
callbackRef.current = callback;
});
return useCallback(((...args) => {
return callbackRef.current?.(...args);
}), []);
};
export default useCallbackRef;
import { FilterMatchEnum } from '../constants';
import type { MenuOption } from '../Select';
import type { MutableRefObject } from 'react';
import type { OptionData, SelectedOption, OptionValueCallback, OptionLabelCallback, OptionFilterCallback, OptionDisabledCallback } from '../types';

@@ -11,3 +10,3 @@ /**

*/
declare const useMenuOptions: (options: OptionData[], debouncedInputValue: string, filterMatchFrom: FilterMatchEnum, selectedOption: SelectedOption[], getOptionValue: OptionValueCallback, getOptionLabel: OptionLabelCallback, getIsOptionDisabledRef: MutableRefObject<OptionDisabledCallback>, getFilterOptionStringRef: MutableRefObject<OptionFilterCallback>, filterIgnoreCase?: boolean, filterIgnoreAccents?: boolean, isMulti?: boolean, async?: boolean, hideSelectedOptions?: boolean | undefined) => MenuOption[];
declare const useMenuOptions: (options: OptionData[], debouncedInputValue: string, filterMatchFrom: FilterMatchEnum, selectedOption: SelectedOption[], getOptionValue: OptionValueCallback, getOptionLabel: OptionLabelCallback, getIsOptionDisabledRef: OptionDisabledCallback, getFilterOptionStringRef: OptionFilterCallback, filterIgnoreCase?: boolean, filterIgnoreAccents?: boolean, isMulti?: boolean, async?: boolean, hideSelectedOptions?: boolean | undefined) => MenuOption[];
export default useMenuOptions;

@@ -16,10 +16,9 @@ import { useEffect, useState } from 'react';

useEffect(() => {
const { current: getIsOptionDisabled } = getIsOptionDisabledRef;
const { current: getFilterOptionStr } = getFilterOptionStringRef;
const isFilterMatchAny = filterMatchFrom === FilterMatchEnum.ANY;
const normalizedSearch = trimAndFormatFilterStr(searchValue, filterIgnoreCase, filterIgnoreAccents);
const selectedHash = selectedOption.length ? new Set(selectedOption.map((x) => x.value)) : undefined;
const isOptionFilterMatch = (option) => {
const optionStr = getFilterOptionStr(option);
const optionStr = getFilterOptionStringRef(option);
const normalizedOptionLabel = trimAndFormatFilterStr(optionStr, filterIgnoreCase, filterIgnoreAccents);
return filterMatchFrom === FilterMatchEnum.ANY
return isFilterMatchAny
? normalizedOptionLabel.indexOf(normalizedSearch) > -1

@@ -35,3 +34,3 @@ : normalizedOptionLabel.substr(0, normalizedSearch.length) === normalizedSearch;

label,
...(getIsOptionDisabled(data) && { isDisabled: true }),
...(getIsOptionDisabledRef(data) && { isDisabled: true }),
...(selectedHash?.has(value) && { isSelected: true })

@@ -38,0 +37,0 @@ };

import { MenuPositionEnum } from '../constants';
import type { RefObject } from 'react';
import type { CallbackFunction } from '../types';
import type { RefObject, MutableRefObject } from 'react';
/**

@@ -13,3 +13,3 @@ * useMenuPositioner hook

*/
declare const useMenuPositioner: (menuRef: RefObject<HTMLElement | null>, controlRef: RefObject<HTMLElement | null>, menuOpen: boolean, menuPosition: MenuPositionEnum, menuItemSize: number, menuHeightDefault: number, menuOptionsLength: number, isMenuPortaled: boolean, onMenuOpenRef: MutableRefObject<CallbackFunction | undefined>, onMenuCloseRef: MutableRefObject<CallbackFunction | undefined>, menuScrollDuration?: number | undefined, scrollMenuIntoView?: boolean | undefined) => [string | undefined, number];
declare const useMenuPositioner: (menuRef: RefObject<HTMLElement | null>, controlRef: RefObject<HTMLElement | null>, menuOpen: boolean, menuPosition: MenuPositionEnum, menuItemSize: number, menuHeightDefault: number, menuOptionsLength: number, isMenuPortaled: boolean, onMenuOpenRef: CallbackFunction, onMenuCloseRef: CallbackFunction, menuScrollDuration?: number | undefined, scrollMenuIntoView?: boolean | undefined) => [string | undefined, number];
export default useMenuPositioner;

@@ -30,3 +30,3 @@ import { useEffect, useState, useRef } from 'react';

const handleOnMenuOpen = (availableSpace) => {
onMenuOpenRef.current?.();
onMenuOpenRef();
if (availableSpace) {

@@ -42,3 +42,3 @@ resetMenuHeightRef.current = true;

else {
onMenuCloseRef.current?.();
onMenuCloseRef();
if (resetMenuHeightRef.current) {

@@ -45,0 +45,0 @@ resetMenuHeightRef.current = false;

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components"),n=require("react-window"),o=require("react-dom");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=i(e),r=i(t);const l={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container"},s={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},d="top",u="auto",c="bottom",p="any",m=0,f=1,h=0,g=1,b=2,v=3,w=t.keyframes(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),y=t.css([""," 0.25s ease-in-out"],t.keyframes(["from{opacity:0;}to{opacity:1;}"])),x={index:-1},C=e=>e.label,O=e=>e.value,S=e=>!!e.isDisabled,I=({label:e})=>"string"==typeof e?e:`${e}`,E=[],k=/[\u0300-\u036f]/g;function M(e){return"boolean"==typeof e}function z(e){return Array.isArray(e)&&!!e.length}function L(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}const N=e=>{e.preventDefault(),e.stopPropagation()};function D(e,t,n){let o=e.trim();return t&&(o=o.toLowerCase()),n?function(e){return e.normalize("NFD").replace(k,"")}(o):o}const R=(e,t,n)=>{const o=Array.isArray(e)?e:L(e)?[e]:E;return z(o)?o.map((e=>({data:e,value:t(e),label:n(e)}))):o},F=(e,t)=>{const n={...e};return Object.keys(t).forEach((o=>{const i=t[o];n[o]="animation"!==o&&L(i)?e[o]?F(e[o],i):i:i||""})),n},V=/(auto|scroll)/;function A(e){return T(e)?window.pageYOffset:e.scrollTop}function T(e){return e===document.body||e===document.documentElement||e===window}function B({overflow:e,overflowX:t,overflowY:n}){return V.test(`${e}${t}${n}`)}function $(e){let t=getComputedStyle(e);const n=document.documentElement,o="absolute"===t.position;if("fixed"===t.position)return n;for(let n=e;n=null===(i=n)||void 0===i?void 0:i.parentElement;){var i;if(t=getComputedStyle(n),(!o||"static"!==t.position)&&B(t))return n}return n}function q(e,t,n=300,o){let i=0;const a=A(e),r=t-a;requestAnimationFrame((function t(){i+=5;const l=r*((s=(s=i)/n-1)*s*s+1)+a;var s;!function(e,t){T(e)?window.scrollTo(0,t):e.scrollTop=t}(e,l),i<n?requestAnimationFrame(t):null==o||o()}))}const P={color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:t.css([""," 1.19s ease-in-out infinite"],w),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 0.9375rem",clear:{width:"14px",height:"16px",animation:y,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",boxShadow:"0 0 0 0.2rem",padding:"0.375rem 0.75rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:y,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},placeholder:{animation:y},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:y,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:"#808080",transition:"color 0.2s ease-out, transform 0.2s ease-out, z-index 0.2s ease-out"}}},W="undefined"!=typeof window&&"ontouchstart"in window||"undefined"!=typeof navigator&&!!navigator.maxTouchPoints,j="undefined"!=typeof navigator&&/(MSIE|Trident\/|Edge\/)/i.test(navigator.userAgent),K=(t,n)=>{const o=e.useRef(!0);e.useEffect((()=>{if(!o.current)return t();o.current=!1}),n)},H=(t,n,o,i,a,r,l,s,d=!1,u=!1,c=!1,m=!1,f)=>{const[h,g]=e.useState(E),b=m?"":n,v=M(f)?f:c;return e.useEffect((()=>{const{current:e}=l,{current:n}=s,c=D(b,d,u),m=i.length?new Set(i.map((e=>e.value))):void 0,f=t=>{const i=a(t),l={data:t,value:i,label:r(t),...e(t)&&{isDisabled:!0},...(null==m?void 0:m.has(i))&&{isSelected:!0}};if(!(c&&!(e=>{const t=D(n(e),d,u);return o===p?t.indexOf(c)>-1:t.substr(0,c.length)===c})(l)||v&&l.isSelected))return l},h=t.reduce(((e,t)=>{const n=f(t);return n&&e.push(n),e}),[]);g(h)}),[t,b,a,r,i,o,d,u,l,s,v]),h},U=(t,n)=>{const o=e.useRef(t||n);return e.useEffect((()=>{o.current=t||n}),[t,n]),o},Y=(t,n,o,i,a,r,l,s,c,p,m,f)=>{const h=e.useRef(!1),g=e.useRef(!s),[b,v]=e.useState(r),[w,y]=e.useState(!1);e.useEffect((()=>{g.current=!w&&!s}),[w,s]),e.useEffect((()=>{const e=i===d||i===u&&!(e=>{if(!e)return!0;const t=$(e),{top:n,height:o}=e.getBoundingClientRect(),{height:i}=t.getBoundingClientRect();return i-A(t)-n>=o})(t.current);y(e)}),[t,i]),K((()=>{if(o){const e=e=>{var t;null===(t=c.current)||void 0===t||t.call(c),e&&(h.current=!0,v(e))};g.current?((e,t,n,o)=>{if(!e)return void o();const{top:i,height:a,bottom:r}=e.getBoundingClientRect(),l=window.innerHeight;if(l-i>=a)return void o();const s=$(e),d=A(s),u=s.getBoundingClientRect().height-d-i,c=u<a;if(c||!n)return void o(c?u:void 0);const p=getComputedStyle(e).marginBottom;q(s,r-l+d+parseInt(p,10),t,o)})(t.current,m,f,e):e()}else{var e;null===(e=p.current)||void 0===e||e.call(p),h.current&&(h.current=!1,v(r))}}),[t,o,r,f,m,p,c]);const x=Math.min(b,l*a);return[w?((e,t,n)=>{const o=e>0||!t?e:t.getBoundingClientRect().height,i=n?n.getBoundingClientRect().height:0,a=t&&getComputedStyle(t),r=a?parseInt(a.marginBottom,10):0,l=a?parseInt(a.marginTop,10):0;return`calc(${-Math.abs(o+i)}px + ${r+l}px)`})(x,t.current,n.current):void 0,x]},_=e.memo((({index:e,style:t,data:{menuOptions:n,selectOption:o,renderOptionLabel:i,focusedOptionIndex:r}})=>{const{data:l,value:s,label:d,isDisabled:u,isSelected:c}=n[e],p=function(e,t,n){let o="rfs-option";return e&&(o+=" rfs-option-disabled"),t&&(o+=" rfs-option-selected"),n&&(o+=" rfs-option-focused"),o}(u,c,e===r);return a.default.createElement("div",{style:t,onClick:u?void 0:()=>o({data:l,value:s,label:d},c),className:p},i(l))}),n.areEqual);_.displayName="Option";const X=r.default.div.withConfig({displayName:"NoOptionsMsg",componentId:"v1y124-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(({theme:e})=>e.noOptions.color),(({theme:e})=>e.noOptions.margin),(({theme:e})=>e.noOptions.padding),(({theme:e})=>e.noOptions.fontSize),(({theme:e})=>e.noOptions.css)),G=({width:t,height:o,itemSize:i,direction:r,isLoading:l,loadingMsg:s,menuOptions:d,selectOption:u,noOptionsMsg:c,overscanCount:p,itemKeySelector:m,fixedSizeListRef:f,renderOptionLabel:h,focusedOptionIndex:g})=>{const b=e.useMemo((()=>({menuOptions:d,selectOption:u,renderOptionLabel:h,focusedOptionIndex:g})),[d,g,u,h]);if(l)return a.default.createElement(X,null,s);return a.default.createElement(e.Fragment,null,a.default.createElement(n.FixedSizeList,{width:t,height:o,itemKey:m?(e,t)=>t.menuOptions[e][m]:void 0,itemSize:i,itemData:b,direction:r,ref:f,overscanCount:p,itemCount:d.length},_),!z(d)&&c&&a.default.createElement(X,null,c))},J=r.default.div.withConfig({displayName:"MenuWrapper",componentId:"yf5myu-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;will-change:top,color,background-color;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(({menuTop:e,menuOpen:n,hideNoOptionsMsg:o,theme:{menu:i}})=>t.css(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],i.width,i.margin,i.padding,i.animation,i.borderRadius,i.backgroundColor,o?"none":i.boxShadow,n?"":"display: none;",e?`top: ${e};`:"")),(({theme:e})=>e.menu.css),"rfs-option",(({theme:e})=>e.menu.option.padding),(({theme:e})=>e.menu.option.textAlign),"rfs-option-focused","rfs-option-disabled","rfs-option-selected",(({theme:e})=>e.menu.option.focusedBgColor),"rfs-option-selected",(({theme:e})=>e.menu.option.selectedColor),(({theme:e})=>e.menu.option.selectedBgColor),"rfs-option-disabled"),Q=({menuRef:e,menuTop:t,menuOpen:n,onMenuMouseDown:i,menuPortalTarget:r,...l})=>{const{menuOptions:s,noOptionsMsg:d}=l,u=n&&!Boolean(d)&&!z(s),c=a.default.createElement(J,{ref:e,menuTop:t,menuOpen:n,onMouseDown:i,className:"rfs-menu-container",hideNoOptionsMsg:u},a.default.createElement(G,Object.assign({},l)));return r?o.createPortal(c,r):c},Z=t.css(["z-index:5000;transform:scale(1.26);color:",";"],(({theme:e})=>e.multiValue.clear.focusColor)),ee=r.default.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-211cx7-0"})(["min-width:0;display:flex;"," ",""],(({theme:{multiValue:e}})=>t.css(["margin:",";animation:",";border-radius:",";background-color:",";"],e.margin,e.animation,e.borderRadius,e.backgroundColor)),(({theme:e})=>e.multiValue.css)),te=r.default.div.withConfig({displayName:"Label",componentId:"sc-211cx7-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(({theme:e})=>e.multiValue.label.padding),(({theme:e})=>e.multiValue.label.fontSize),(({theme:e})=>e.multiValue.label.borderRadius)),ne=r.default.i.withConfig({displayName:"Clear",componentId:"sc-211cx7-2"})(["display:flex;font-style:inherit;"," ",""],(({theme:{multiValue:{clear:e}}})=>t.css(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";:hover{","}"],e.color,e.padding,e.fontSize,e.alignSelf,e.transition,e.fontWeight,Z)),(({isFocused:e})=>e&&Z)),oe=e.memo((({data:e,value:t,isFocused:n,renderOptionLabel:o,removeSelectedOption:i})=>{const r=()=>i(t);return a.default.createElement(ee,null,a.default.createElement(te,null,o(e)),a.default.createElement(ne,{isFocused:n,onClick:r,onTouchEnd:r,onMouseDown:N},"✖"))}));oe.displayName="MultiValue";const ie=t.css(["top:50%;overflow:hidden;position:absolute;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;transform:translateY(-50%);"]),ae=r.default.div.withConfig({displayName:"SingleValue",componentId:"sc-153h0ct-0"})([""," max-width:calc(100% - 0.5rem);"],ie),re=r.default.div.withConfig({displayName:"Placeholder",componentId:"sc-153h0ct-1"})([""," color:",";",""],ie,(({theme:e})=>e.color.placeholder),(({theme:e,isFirstRender:n})=>!n&&t.css(["animation:",";"],e.placeholder.animation))),le=e.memo((({isMulti:t,inputValue:n,placeholder:o,selectedOption:i,focusedMultiValue:r,renderOptionLabel:l,renderMultiOptions:s,removeSelectedOption:d})=>{const u=(()=>{const t=e.useRef(!0);return t.current?(t.current=!1,!0):t.current})(),c=!z(i);return n&&(!t||t&&(c||s))?null:c?a.default.createElement(re,{isFirstRender:u},o):t?a.default.createElement(e.Fragment,null,s?s({renderOptionLabel:l,selected:i}):i.map((({data:e,value:t})=>a.default.createElement(oe,{key:t,data:e,value:t,renderOptionLabel:l,isFocused:t===r,removeSelectedOption:d})))):a.default.createElement(ae,null,l(i[0].data))}));le.displayName="Value";const se=r.default.div.withConfig({displayName:"SizerDiv",componentId:"o2ype2-0"})(["top:0;left:0;height:0;overflow:scroll;white-space:pre;position:absolute;visibility:hidden;font-size:inherit;font-weight:inherit;font-family:inherit;",""],(({theme:e})=>e.input.css)),de=r.default.input.attrs(s).withConfig({displayName:"Input",componentId:"o2ype2-1"})(["border:0;outline:0;padding:0;cursor:text;background:0;color:inherit;font-size:inherit;font-weight:inherit;font-family:inherit;box-sizing:content-box;:read-only{opacity:0;cursor:default;}:required{","}"," ",""],(({theme:e,isInvalid:t})=>t&&e.input.cssRequired),(({theme:e})=>e.input.css),j&&"::-ms-clear{display:none;}"),ue=e.memo(e.forwardRef((({id:t,onBlur:n,onFocus:o,readOnly:i,required:r,onChange:l,ariaLabel:s,inputValue:d,ariaLabelledBy:u,hasSelectedOptions:c},p)=>{const m=e.useRef(null),[f,h]=e.useState(2),g=!!r&&!c;return K((()=>{m.current&&h(m.current.scrollWidth+2)}),[d]),a.default.createElement(e.Fragment,null,a.default.createElement(de,{id:t,ref:p,isInvalid:!0,onBlur:n,onFocus:o,value:d,readOnly:i,required:g,"aria-label":s,style:{width:f},"aria-labelledby":u,onChange:i?void 0:l}),a.default.createElement(se,{ref:m},d))})));ue.displayName="AutosizeInput";const ce=r.default.span.withConfig({displayName:"A11yText",componentId:"zxgkbx-0"})(["border:0;padding:0;width:1px;height:1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(1px,1px,1px,1px);"]),pe=({menuOpen:e,isFocused:t,inputValue:n,optionCount:o,isSearchable:i,focusedOption:r,selectedOption:l,ariaLive:s="polite",ariaLabel:d="Select"})=>{if(!t)return null;const u=` ${o} result(s) available${n?" for search input "+n:""}.`,c=e?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":`${d} is focused${i?", type to filter options":""}, press Down arrow key to open the menu.`,{index:p,value:m,label:f,isDisabled:h}=r,g=m?`Focused option: ${f}${h?" - disabled":""}, ${p+1} of ${o}.`:"",b="Selected option: "+(l.length?l.map((e=>e.label)).join(" "):"N/A"),v=`${g} ${u} ${c}`.trimStart();return a.default.createElement(ce,{"aria-atomic":"false","aria-live":s,"aria-relevant":"additions text"},a.default.createElement("span",{id:"aria-selection"},b),a.default.createElement("span",{id:"aria-context"},v))},me=r.default.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1j9e0pa-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;",":nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(({theme:e})=>e.loader.padding),(({theme:{loader:e}})=>t.css(["width:",";height:",";animation:",";background-color:",";"],e.size,e.size,e.animation,e.color))),fe=()=>a.default.createElement(me,{"aria-hidden":!0,className:"rfs-loading-dots"},a.default.createElement("div",null),a.default.createElement("div",null),a.default.createElement("div",null)),he=r.default.svg.withConfig({displayName:"ClearSvg",componentId:"sc-1v5ipi2-0"})(["fill:currentColor;",""],(({theme:e})=>t.css(["width:",";height:",";animation:",";transition:",";"],e.icon.clear.width,e.icon.clear.height,e.icon.clear.animation,e.icon.clear.transition))),ge=()=>a.default.createElement(he,{"aria-hidden":!0,viewBox:"0 0 14 16",className:"rfs-clear-icon"},a.default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})),be=r.default.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1561oeb-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),ve=r.default.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1561oeb-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(({theme:e})=>e.icon.color),(({theme:e})=>e.icon.padding),(({theme:e})=>e.icon.hoverColor),(({theme:e})=>e.icon.css)),we=r.default.div.withConfig({displayName:"Caret",componentId:"sc-1561oeb-2"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(({theme:e})=>e.icon.caret.transition),(({theme:e})=>e.icon.caret.size),(({theme:e})=>e.icon.caret.size),(({theme:e})=>e.icon.caret.size),(({theme:e,menuOpen:n,isInvalid:o})=>n&&t.css(["transform:rotate(180deg);color:",";"],o?e.color.danger:e.color.caretActive||e.color.primary))),ye=r.default.div.withConfig({displayName:"Separator",componentId:"sc-1561oeb-3"})(["width:1px;margin:0.5rem 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(({theme:e})=>e.color.iconSeparator||e.color.border)),xe=e.memo((({menuOpen:e,clearIcon:t,caretIcon:n,isInvalid:o,showClear:i,isLoading:r,isDisabled:l,loadingNode:s,onCaretMouseDown:d,onClearMouseDown:u})=>{const c=t=>"function"==typeof t?t({menuOpen:e,isLoading:r,isInvalid:o,isDisabled:l}):t;return a.default.createElement(be,null,i&&!r&&a.default.createElement(ve,{onTouchEnd:u,onMouseDown:u},c(t)||a.default.createElement(ge,null)),r&&(s||a.default.createElement(fe,null)),a.default.createElement(ye,null),a.default.createElement(ve,{onTouchEnd:d,onMouseDown:d},c(n)||a.default.createElement(we,{"aria-hidden":!0,menuOpen:e,isInvalid:o,className:"rfs-caret-icon"})))}));xe.displayName="IndicatorIcons";const Ce=r.default.div.attrs(l).withConfig({displayName:"SelectWrapper",componentId:"kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(({theme:e})=>e.select.css)),Oe=r.default.div.withConfig({displayName:"ValueWrapper",componentId:"kcrmu9-1"})(["flex:1 1 0%;display:flex;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;padding:",";"],(({theme:e})=>e.control.padding)),Se=r.default.div.withConfig({displayName:"ControlWrapper",componentId:"kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;will-change:box-shadow,border-color;"," "," ",""],(({isDisabled:e,isFocused:n,isInvalid:o,theme:{control:i,color:a}})=>t.css(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],i.transition,i.borderStyle,i.borderWidth,i.borderRadius,i.height||i.minHeight,o?a.danger:n?i.focusedBorderColor:a.border,i.height?`height: ${i.height};`:"",e?"pointer-events:none;user-select:none;":"",i.backgroundColor||e?`background-color: ${e?a.disabled:i.backgroundColor};`:"",n?`box-shadow: ${i.boxShadow} ${o?a.dangerLight:i.boxShadowColor};`:"")),(({theme:e})=>e.control.css),(({isFocused:e,theme:t})=>e&&t.control.focusedCss)),Ie=e.forwardRef((({async:n,isMulti:o,inputId:i,selectId:r,required:l,ariaLive:s,autoFocus:d,isLoading:u,onKeyDown:w,clearIcon:y,caretIcon:k,isInvalid:D,ariaLabel:V,menuWidth:A,isDisabled:T,inputDelay:B,onMenuOpen:$,onMenuClose:q,onInputBlur:j,isClearable:_,themeConfig:X,loadingNode:G,initialValue:J,onInputFocus:Z,onInputChange:ee,ariaLabelledBy:te,onOptionChange:ne,onSearchChange:oe,getOptionLabel:ie,getOptionValue:ae,itemKeySelector:re,openMenuOnFocus:se,menuPortalTarget:de,isAriaLiveEnabled:ce,menuOverscanCount:me,blurInputOnSelect:fe,menuItemDirection:he,renderOptionLabel:ge,renderMultiOptions:be,menuScrollDuration:ve,filterIgnoreAccents:we,hideSelectedOptions:ye,getIsOptionDisabled:Ie,getFilterOptionString:Ee,isSearchable:ke=!0,lazyLoadMenu:Me=!1,openMenuOnClick:ze=!0,filterIgnoreCase:Le=!0,tabSelectsOption:Ne=!0,closeMenuOnSelect:De=!0,scrollMenuIntoView:Re=!0,backspaceClearsValue:Fe=!0,filterMatchFrom:Ve=p,menuPosition:Ae=c,options:Te=E,loadingMsg:Be="Loading..",placeholder:$e="Select option..",noOptionsMsg:qe="No options",menuItemSize:Pe=35,menuMaxHeight:We=300},je)=>{const Ke=e.useRef(!1),He=e.useRef(),Ue=e.useRef(!1),Ye=e.useRef(null),_e=e.useRef(null),Xe=e.useRef(null),Ge=e.useRef(null),[Je,Qe]=e.useState(""),[Ze,et]=e.useState(!1),[tt,nt]=e.useState(!1),[ot,it]=e.useState(null),[at,rt]=e.useState(x),lt=e.useMemo((()=>(e=>e&&L(e)?F(P,e):P)(X)),[X]),st=U($),dt=U(q),ut=U(oe),ct=U(ne),pt=U(Ie,S),mt=U(Ee,I),ft=e.useMemo((()=>ie||C),[ie]),ht=e.useMemo((()=>ae||O),[ae]),gt=e.useMemo((()=>ge||ft),[ge,ft]),bt=((t,n=0)=>{const[o,i]=e.useState(t);return K((()=>{if(n<=0)return;const e=setTimeout((()=>{i(t)}),n);return()=>{clearTimeout(e)}}),[t,n]),n<=0?t:o})(Je,B),[vt,wt]=e.useState((()=>R(J,ht,ft))),yt=H(Te,bt,Ve,vt,ht,ft,pt,mt,Le,we,o,n,ye),[xt,Ct]=Y(_e,Ge,Ze,Ae,Pe,We,yt.length,!!de,st,dt,ve,Re),Ot=()=>{var e;return null===(e=Xe.current)||void 0===e?void 0:e.blur()},St=()=>{var e;return null===(e=Xe.current)||void 0===e?void 0:e.focus()},It=e=>{var t;return null===(t=Ye.current)||void 0===t?void 0:t.scrollToItem(e)},Et=z(vt),kt=M(fe)?fe:W,Mt=e.useCallback((e=>{if(!z(yt))return void(!Ke.current&&et(!0));const t=o?-1:yt.findIndex((e=>e.isSelected)),n=t>-1?t:e===v?0:yt.length-1;!Ke.current&&et(!0),rt({index:n,...yt[n]}),It(n)}),[o,yt]),zt=e.useCallback((e=>{wt((t=>t.filter((t=>t.value!==e))))}),[]),Lt=e.useCallback(((e,t)=>{t?o&&zt(e.value):wt((t=>o?[...t,e]:[e])),kt?Ot():De&&(et(!1),Qe(""))}),[o,De,zt,kt]);e.useImperativeHandle(je,(()=>({empty:!Et,menuOpen:Ke.current,blur:Ot,focus:St,clearValue:()=>{wt(E),rt(x)},setValue:e=>{const t=R(e,ht,ft);wt(t)},toggleMenu:e=>{!0===e||void 0===e&&!Ke.current?(St(),Mt(v)):Ot()}})),[Et,ht,ft,Mt]),e.useEffect((()=>{d&&St()}),[]),e.useEffect((()=>{Ke.current=Ze}),[Ze]),e.useEffect((()=>{tt&&se&&Mt(v)}),[tt,se,Mt]),e.useEffect((()=>{const{current:e}=ut;e&&Ue.current&&(Ue.current=!1,e(bt))}),[bt]),K((()=>{const{current:e}=ct;if(e){e(o?vt.map((e=>e.data)):z(vt)?vt[0].data:null)}}),[o,vt]),K((()=>{const{length:e}=yt,t=e>0&&(n||e!==Te.length||0===He.current);0===e?rt(x):(1===e||t)&&(rt({index:0,...yt[0]}),It(0)),He.current=e}),[n,Te,yt]);const Nt=()=>{const{data:e,value:t,label:n,isSelected:o,isDisabled:i}=at;e&&!i&&Lt({data:e,value:t,label:n},o)},Dt=e=>{const t="ArrowDown"===e,n=t?v:b;Ze?(e=>{if(!z(yt))return;const t=e===g?(at.index+1)%yt.length:at.index>0?at.index-1:yt.length-1;ot&&it(null),rt({index:t,...yt[t]}),It(t)})(t?g:h):Mt(n)},Rt=e=>{if(T)return;tt||St();const t="INPUT"!==e.target.nodeName;Ze?t&&(Ze&&et(!1),Je&&Qe("")):ze&&Mt(v),t&&e.preventDefault()},Ft=e.useCallback((e=>{null==j||j(e),nt(!1),et(!1),Qe("")}),[j]),Vt=e.useCallback((e=>{null==Z||Z(e),nt(!0)}),[Z]),At=e.useCallback((e=>{Ue.current=!0;const t=e.currentTarget.value||"";null==ee||ee(t),Qe(t),!Ke.current&&et(!0)}),[ee]),Tt=e.useCallback((e=>{St(),Ke.current?et(!1):Mt(v),N(e)}),[Mt]),Bt=e.useCallback((e=>{St(),wt(E),N(e)}),[]),$t=!Me||Me&&Ze,qt=!(!_||T||!Et),Pt=T||!ke||!!ot,Wt=T||ze?void 0:Tt;return a.default.createElement(t.ThemeProvider,{theme:lt},a.default.createElement(Ce,{id:r,"aria-controls":i,"aria-expanded":Ze,onKeyDown:e=>{if(!(T||w&&(w(e,Je,at),e.defaultPrevented))){switch(e.key){case"ArrowDown":case"ArrowUp":Dt(e.key);break;case"ArrowLeft":case"ArrowRight":if(!o||Je||be)return;(e=>{if(!Et)return;let t=-1;const n=vt.length-1,o=ot?vt.findIndex((e=>e.value===ot)):-1;t=e===m?o>-1&&o<n?o+1:-1:0!==o?-1===o?n:o-1:0;const i=t>=0?vt[t].value:null;at.data&&rt(x),i!==ot&&it(i)})("ArrowLeft"===e.key?f:m);break;case" ":if(Je)return;if(Ze){if(!at.data)return;Nt()}else Mt(v);break;case"Enter":Ze&&229!==e.keyCode&&Nt();break;case"Escape":Ze&&(et(!1),Qe(""));break;case"Tab":if(!Ze||!Ne||!at.data||e.shiftKey)return;Nt();break;case"Delete":case"Backspace":if(Je)return;if(ot){const e=vt.findIndex((e=>e.value===ot)),t=e>-1&&e<vt.length-1?vt[e+1].value:null;zt(ot),it(t)}else{if(!Fe)return;if(!Et)break;if(o&&!be){const{value:e}=vt[vt.length-1];zt(e)}else _&&wt(E)}break;default:return}e.preventDefault()}}},a.default.createElement(Se,{ref:Ge,isInvalid:D,isFocused:tt,isDisabled:T,className:"rfs-control-container",onTouchEnd:Rt,onMouseDown:Rt},a.default.createElement(Oe,null,a.default.createElement(le,{isMulti:o,inputValue:Je,placeholder:$e,selectedOption:vt,focusedMultiValue:ot,renderMultiOptions:be,renderOptionLabel:gt,removeSelectedOption:zt}),a.default.createElement(ue,{id:i,ref:Xe,required:l,ariaLabel:V,inputValue:Je,readOnly:Pt,onBlur:Ft,onFocus:Vt,onChange:At,ariaLabelledBy:te,hasSelectedOptions:Et})),a.default.createElement(xe,{menuOpen:Ze,clearIcon:y,caretIcon:k,isInvalid:D,isLoading:u,showClear:qt,isDisabled:T,loadingNode:G,onClearMouseDown:Bt,onCaretMouseDown:Wt})),$t&&a.default.createElement(Q,{menuRef:_e,menuOpen:Ze,isLoading:u,menuTop:xt,height:Ct,itemSize:Pe,loadingMsg:Be,menuOptions:yt,fixedSizeListRef:Ye,noOptionsMsg:qe,selectOption:Lt,direction:he,itemKeySelector:re,overscanCount:me,menuPortalTarget:de,width:A||lt.menu.width,onMenuMouseDown:e=>{N(e),St()},renderOptionLabel:gt,focusedOptionIndex:at.index}),ce&&a.default.createElement(pe,{ariaLive:s,menuOpen:Ze,isFocused:tt,ariaLabel:V,inputValue:Je,isSearchable:ke,focusedOption:at,selectedOption:vt,optionCount:yt.length})))}));Ie.displayName="Select",exports.Select=Ie;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components"),n=require("react-window"),o=require("react-dom");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=i(e),r=i(t);const l={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container"},s={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},d="top",u="auto",c="bottom",p="any",f=0,m=1,h=0,g=1,b=2,v=3,w=t.keyframes(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),y=t.css([""," 0.25s ease-in-out"],t.keyframes(["from{opacity:0;}to{opacity:1;}"])),x={index:-1},C=e=>e.label,O=e=>e.value,S=e=>!!e.isDisabled,I=({label:e})=>"string"==typeof e?e:`${e}`,E=[],k=/[\u0300-\u036f]/g;function M(e){return"boolean"==typeof e}function z(e){return"function"==typeof e}function L(e){return Array.isArray(e)&&!!e.length}function N(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}const D=e=>{e.preventDefault(),e.stopPropagation()};function R(e,t,n){let o=e.trim();return t&&(o=o.toLowerCase()),n?function(e){return e.normalize("NFD").replace(k,"")}(o):o}const V=(e,t,n)=>{const o=Array.isArray(e)?e:N(e)?[e]:E;return L(o)?o.map((e=>({data:e,value:t(e),label:n(e)}))):o},A=(e,t)=>{const n={...e};return Object.keys(t).forEach((o=>{const i=t[o];n[o]="animation"!==o&&N(i)?e[o]?A(e[o],i):i:i||""})),n},F=/(auto|scroll)/;function T(e){return B(e)?window.pageYOffset:e.scrollTop}function B(e){return e===document.body||e===document.documentElement||e===window}function $({overflow:e,overflowX:t,overflowY:n}){return F.test(`${e}${t}${n}`)}function q(e){let t=getComputedStyle(e);const n=document.documentElement,o="absolute"===t.position;if("fixed"===t.position)return n;for(let n=e;n=null===(i=n)||void 0===i?void 0:i.parentElement;){var i;if(t=getComputedStyle(n),(!o||"static"!==t.position)&&$(t))return n}return n}function P(e,t,n=300,o){let i=0;const a=T(e),r=t-a;requestAnimationFrame((function t(){i+=5;const l=r*((s=(s=i)/n-1)*s*s+1)+a;var s;!function(e,t){B(e)?window.scrollTo(0,t):e.scrollTop=t}(e,l),i<n?requestAnimationFrame(t):null==o||o()}))}const W={color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:t.css([""," 1.19s ease-in-out infinite"],w),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 0.9375rem",clear:{width:"14px",height:"16px",animation:y,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",boxShadow:"0 0 0 0.2rem",padding:"0.375rem 0.75rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:y,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},placeholder:{animation:y},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:y,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:"#808080",transition:"color 0.2s ease-out, transform 0.2s ease-out, z-index 0.2s ease-out"}}},j="undefined"!=typeof window&&"ontouchstart"in window||"undefined"!=typeof navigator&&!!navigator.maxTouchPoints,K="undefined"!=typeof navigator&&/(MSIE|Trident\/|Edge\/)/i.test(navigator.userAgent),H=(t,n)=>{const o=e.useRef(!0);e.useEffect((()=>{if(!o.current)return t();o.current=!1}),n)},U=(t,n,o,i,a,r,l,s,d=!1,u=!1,c=!1,f=!1,m)=>{const[h,g]=e.useState(E),b=f?"":n,v=M(m)?m:c;return e.useEffect((()=>{const e=o===p,n=R(b,d,u),c=i.length?new Set(i.map((e=>e.value))):void 0,f=t=>{const o=a(t),i={data:t,value:o,label:r(t),...l(t)&&{isDisabled:!0},...(null==c?void 0:c.has(o))&&{isSelected:!0}};if(!(n&&!(t=>{const o=R(s(t),d,u);return e?o.indexOf(n)>-1:o.substr(0,n.length)===n})(i)||v&&i.isSelected))return i},m=t.reduce(((e,t)=>{const n=f(t);return n&&e.push(n),e}),[]);g(m)}),[t,b,a,r,i,o,d,u,l,s,v]),h},Y=t=>{const n=e.useRef(t);return e.useEffect((()=>{n.current=t})),e.useCallback(((...e)=>{var t;return null===(t=n.current)||void 0===t?void 0:t.call(n,...e)}),[])},_=(t,n,o,i,a,r,l,s,c,p,f,m)=>{const h=e.useRef(!1),g=e.useRef(!s),[b,v]=e.useState(r),[w,y]=e.useState(!1);e.useEffect((()=>{g.current=!w&&!s}),[w,s]),e.useEffect((()=>{const e=i===d||i===u&&!(e=>{if(!e)return!0;const t=q(e),{top:n,height:o}=e.getBoundingClientRect(),{height:i}=t.getBoundingClientRect();return i-T(t)-n>=o})(t.current);y(e)}),[t,i]),H((()=>{if(o){const e=e=>{c(),e&&(h.current=!0,v(e))};g.current?((e,t,n,o)=>{if(!e)return void o();const{top:i,height:a,bottom:r}=e.getBoundingClientRect(),l=window.innerHeight;if(l-i>=a)return void o();const s=q(e),d=T(s),u=s.getBoundingClientRect().height-d-i,c=u<a;if(c||!n)return void o(c?u:void 0);const p=getComputedStyle(e).marginBottom;P(s,r-l+d+parseInt(p,10),t,o)})(t.current,f,m,e):e()}else p(),h.current&&(h.current=!1,v(r))}),[t,o,r,m,f,p,c]);const x=Math.min(b,l*a);return[w?((e,t,n)=>{const o=e>0||!t?e:t.getBoundingClientRect().height,i=n?n.getBoundingClientRect().height:0,a=t&&getComputedStyle(t),r=a?parseInt(a.marginBottom,10):0,l=a?parseInt(a.marginTop,10):0;return`calc(${-Math.abs(o+i)}px + ${r+l}px)`})(x,t.current,n.current):void 0,x]},X=e.memo((({index:e,style:t,data:{menuOptions:n,selectOption:o,renderOptionLabel:i,focusedOptionIndex:r}})=>{const{data:l,value:s,label:d,isDisabled:u,isSelected:c}=n[e],p=function(e,t,n){let o="rfs-option";return e&&(o+=" rfs-option-disabled"),t&&(o+=" rfs-option-selected"),n&&(o+=" rfs-option-focused"),o}(u,c,e===r);return a.default.createElement("div",{style:t,onClick:u?void 0:()=>o({data:l,value:s,label:d},c),className:p},i(l))}),n.areEqual);X.displayName="Option";const G=r.default.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(({theme:e})=>e.noOptions.color),(({theme:e})=>e.noOptions.margin),(({theme:e})=>e.noOptions.padding),(({theme:e})=>e.noOptions.fontSize),(({theme:e})=>e.noOptions.css)),J=({width:t,height:o,itemSize:i,direction:r,isLoading:l,loadingMsg:s,menuOptions:d,selectOption:u,noOptionsMsg:c,overscanCount:p,itemKeySelector:f,fixedSizeListRef:m,renderOptionLabel:h,focusedOptionIndex:g})=>{const b=e.useMemo((()=>({menuOptions:d,selectOption:u,renderOptionLabel:h,focusedOptionIndex:g})),[d,g,u,h]);if(l)return a.default.createElement(G,null,s);return a.default.createElement(e.Fragment,null,a.default.createElement(n.FixedSizeList,{width:t,height:o,itemKey:f?(e,t)=>t.menuOptions[e][f]:void 0,itemSize:i,itemData:b,direction:r,ref:m,overscanCount:p,itemCount:d.length},X),!L(d)&&c&&a.default.createElement(G,null,c))},Q=r.default.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;will-change:top,color,background-color;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(({menuTop:e,menuOpen:n,hideNoOptionsMsg:o,theme:{menu:i}})=>t.css(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],i.width,i.margin,i.padding,i.animation,i.borderRadius,i.backgroundColor,o?"none":i.boxShadow,n?"":"display: none;",e?`top: ${e};`:"")),(({theme:e})=>e.menu.css),"rfs-option",(({theme:e})=>e.menu.option.padding),(({theme:e})=>e.menu.option.textAlign),"rfs-option-focused","rfs-option-disabled","rfs-option-selected",(({theme:e})=>e.menu.option.focusedBgColor),"rfs-option-selected",(({theme:e})=>e.menu.option.selectedColor),(({theme:e})=>e.menu.option.selectedBgColor),"rfs-option-disabled"),Z=({menuRef:e,menuTop:t,menuOpen:n,onMenuMouseDown:i,menuPortalTarget:r,...l})=>{const{menuOptions:s,noOptionsMsg:d}=l,u=n&&!Boolean(d)&&!L(s),c=a.default.createElement(Q,{ref:e,menuTop:t,menuOpen:n,onMouseDown:i,className:"rfs-menu-container",hideNoOptionsMsg:u},a.default.createElement(J,Object.assign({},l)));return r?o.createPortal(c,r):c},ee=t.css(["z-index:5000;transform:scale(1.26);color:",";"],(({theme:e})=>e.multiValue.clear.focusColor)),te=r.default.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(({theme:{multiValue:e}})=>t.css(["margin:",";animation:",";border-radius:",";background-color:",";"],e.margin,e.animation,e.borderRadius,e.backgroundColor)),(({theme:e})=>e.multiValue.css)),ne=r.default.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(({theme:e})=>e.multiValue.label.padding),(({theme:e})=>e.multiValue.label.fontSize),(({theme:e})=>e.multiValue.label.borderRadius)),oe=r.default.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(({theme:{multiValue:{clear:e}}})=>t.css(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";:hover{","}"],e.color,e.padding,e.fontSize,e.alignSelf,e.transition,e.fontWeight,ee)),(({isFocused:e})=>e&&ee)),ie=e.memo((({data:e,value:t,isFocused:n,renderOptionLabel:o,removeSelectedOption:i})=>{const r=()=>i(t);return a.default.createElement(te,null,a.default.createElement(ne,null,o(e)),a.default.createElement(oe,{isFocused:n,onClick:r,onTouchEnd:r,onMouseDown:D},"✖"))}));ie.displayName="MultiValue";const ae=t.css(["top:50%;overflow:hidden;position:absolute;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;transform:translateY(-50%);"]),re=r.default.div.withConfig({displayName:"SingleValue",componentId:"us7kwl-0"})([""," max-width:calc(100% - 0.5rem);"],ae),le=r.default.div.withConfig({displayName:"Placeholder",componentId:"us7kwl-1"})([""," color:",";",""],ae,(({theme:e})=>e.color.placeholder),(({theme:e,isFirstRender:n})=>!n&&t.css(["animation:",";"],e.placeholder.animation))),se=e.memo((({isMulti:t,inputValue:n,placeholder:o,selectedOption:i,focusedMultiValue:r,renderOptionLabel:l,renderMultiOptions:s,removeSelectedOption:d})=>{const u=(()=>{const t=e.useRef(!0);return t.current?(t.current=!1,!0):t.current})(),c=!L(i);return n&&(!t||t&&(c||s))?null:c?a.default.createElement(le,{isFirstRender:u},o):t?a.default.createElement(e.Fragment,null,s?s({renderOptionLabel:l,selected:i}):i.map((({data:e,value:t})=>a.default.createElement(ie,{key:t,data:e,value:t,renderOptionLabel:l,isFocused:t===r,removeSelectedOption:d})))):a.default.createElement(re,null,l(i[0].data))}));se.displayName="Value";const de=r.default.div.withConfig({displayName:"SizerDiv",componentId:"sc-4er7q8-0"})(["top:0;left:0;height:0;overflow:scroll;white-space:pre;position:absolute;visibility:hidden;font-size:inherit;font-weight:inherit;font-family:inherit;",""],(({theme:e})=>e.input.css)),ue=r.default.input.attrs(s).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["border:0;outline:0;padding:0;cursor:text;background:0;color:inherit;font-size:inherit;font-weight:inherit;font-family:inherit;box-sizing:content-box;:read-only{opacity:0;cursor:default;}:required{","}"," ",""],(({theme:e,isInvalid:t})=>t&&e.input.cssRequired),(({theme:e})=>e.input.css),K&&"::-ms-clear{display:none;}"),ce=e.memo(e.forwardRef((({id:t,onBlur:n,onFocus:o,readOnly:i,required:r,onChange:l,ariaLabel:s,inputValue:d,ariaLabelledBy:u,hasSelectedOptions:c},p)=>{const f=e.useRef(null),[m,h]=e.useState(2),g=!!r&&!c;return H((()=>{f.current&&h(f.current.scrollWidth+2)}),[d]),a.default.createElement(e.Fragment,null,a.default.createElement(ue,{id:t,ref:p,isInvalid:!0,onBlur:n,onFocus:o,value:d,readOnly:i,required:g,"aria-label":s,style:{width:m},"aria-labelledby":u,onChange:i?void 0:l}),a.default.createElement(de,{ref:f},d))})));ce.displayName="AutosizeInput";const pe=r.default.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;margin:-1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(0,0,0,0);"]),fe=({menuOpen:e,isFocused:t,inputValue:n,optionCount:o,isSearchable:i,focusedOption:r,selectedOption:l,ariaLive:s="polite",ariaLabel:d="Select"})=>{if(!t)return null;const u=e?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":`${d} is focused${i?", type to filter options":""}, press Down arrow key to open the menu.`,{index:c,value:p,label:f,isDisabled:m}=r,h=p&&!m?`Option ${f} is focused, ${c+1} of ${o}.`:"",g=`${o} option(s) available${n?" for search "+n:""}.`,b="Selected option: "+(l.length?l.map((e=>e.label)).join(" "):"N/A"),v=`${h} ${g} ${u}`.trimStart();return a.default.createElement(pe,{"aria-atomic":"false","aria-live":s,"aria-relevant":"additions text"},a.default.createElement("span",{id:"aria-selection"},b),a.default.createElement("span",{id:"aria-context"},v))},me=r.default.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;",":nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(({theme:e})=>e.loader.padding),(({theme:{loader:e}})=>t.css(["width:",";height:",";animation:",";background-color:",";"],e.size,e.size,e.animation,e.color))),he=()=>a.default.createElement(me,{"aria-hidden":!0,className:"rfs-loading-dots"},a.default.createElement("div",null),a.default.createElement("div",null),a.default.createElement("div",null)),ge=r.default.svg.withConfig({displayName:"ClearSvg",componentId:"kkzaaw-0"})(["fill:currentColor;",""],(({theme:e})=>t.css(["width:",";height:",";animation:",";transition:",";"],e.icon.clear.width,e.icon.clear.height,e.icon.clear.animation,e.icon.clear.transition))),be=()=>a.default.createElement(ge,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},a.default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})),ve=r.default.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),we=r.default.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(({theme:e})=>e.icon.color),(({theme:e})=>e.icon.padding),(({theme:e})=>e.icon.hoverColor),(({theme:e})=>e.icon.css)),ye=r.default.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:0.5rem 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(({theme:e})=>e.color.iconSeparator||e.color.border)),xe=r.default.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(({theme:e})=>e.icon.caret.transition),(({theme:e})=>e.icon.caret.size),(({theme:e})=>e.icon.caret.size),(({theme:e})=>e.icon.caret.size),(({theme:e,menuOpen:n,isInvalid:o})=>n&&t.css(["transform:rotate(180deg);color:",";"],o?e.color.danger:e.color.caretActive||e.color.primary))),Ce=e.memo((({menuOpen:e,clearIcon:t,caretIcon:n,isInvalid:o,showClear:i,isLoading:r,isDisabled:l,loadingNode:s,onCaretMouseDown:d,onClearMouseDown:u})=>{const c=t=>z(t)?t({menuOpen:e,isLoading:r,isInvalid:o,isDisabled:l}):t;return a.default.createElement(ve,null,i&&!r&&a.default.createElement(we,{onTouchEnd:u,onMouseDown:u},c(t)||a.default.createElement(be,null)),r&&(s||a.default.createElement(he,null)),a.default.createElement(ye,{role:"none"}),a.default.createElement(we,{onTouchEnd:d,onMouseDown:d},c(n)||a.default.createElement(xe,{"aria-hidden":!0,menuOpen:e,isInvalid:o,className:"rfs-caret-icon"})))}));Ce.displayName="IndicatorIcons";const Oe=r.default.div.attrs(l).withConfig({displayName:"SelectWrapper",componentId:"kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(({theme:e})=>e.select.css)),Se=r.default.div.withConfig({displayName:"ValueWrapper",componentId:"kcrmu9-1"})(["flex:1 1 0%;display:flex;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;padding:",";"],(({theme:e})=>e.control.padding)),Ie=r.default.div.withConfig({displayName:"ControlWrapper",componentId:"kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;will-change:box-shadow,border-color;"," "," ",""],(({isDisabled:e,isFocused:n,isInvalid:o,theme:{control:i,color:a}})=>t.css(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],i.transition,i.borderStyle,i.borderWidth,i.borderRadius,i.height||i.minHeight,o?a.danger:n?i.focusedBorderColor:a.border,i.height?`height: ${i.height};`:"",e?"pointer-events:none;user-select:none;":"",i.backgroundColor||e?`background-color: ${e?a.disabled:i.backgroundColor};`:"",n?`box-shadow: ${i.boxShadow} ${o?a.dangerLight:i.boxShadowColor};`:"")),(({theme:e})=>e.control.css),(({isFocused:e,theme:t})=>e&&t.control.focusedCss)),Ee=e.forwardRef((({async:n,isMulti:o,inputId:i,selectId:r,required:l,ariaLive:s,autoFocus:d,isLoading:u,onKeyDown:w,clearIcon:y,caretIcon:k,isInvalid:R,ariaLabel:F,menuWidth:T,isDisabled:B,inputDelay:$,onMenuOpen:q,onMenuClose:P,onInputBlur:K,isClearable:X,themeConfig:G,loadingNode:J,initialValue:Q,onInputFocus:ee,onInputChange:te,ariaLabelledBy:ne,onOptionChange:oe,onSearchChange:ie,getOptionLabel:ae,getOptionValue:re,itemKeySelector:le,openMenuOnFocus:de,menuPortalTarget:ue,isAriaLiveEnabled:pe,menuOverscanCount:me,blurInputOnSelect:he,menuItemDirection:ge,renderOptionLabel:be,renderMultiOptions:ve,menuScrollDuration:we,filterIgnoreAccents:ye,hideSelectedOptions:xe,getIsOptionDisabled:Ee,getFilterOptionString:ke,isSearchable:Me=!0,lazyLoadMenu:ze=!1,openMenuOnClick:Le=!0,filterIgnoreCase:Ne=!0,tabSelectsOption:De=!0,closeMenuOnSelect:Re=!0,scrollMenuIntoView:Ve=!0,backspaceClearsValue:Ae=!0,filterMatchFrom:Fe=p,menuPosition:Te=c,options:Be=E,loadingMsg:$e="Loading..",placeholder:qe="Select option..",noOptionsMsg:Pe="No options",menuItemSize:We=35,menuMaxHeight:je=300},Ke)=>{const He=e.useRef(!1),Ue=e.useRef(),Ye=e.useRef(!1),_e=e.useRef(z(ie)),Xe=e.useRef(z(oe)),Ge=e.useRef(null),Je=e.useRef(null),Qe=e.useRef(null),Ze=e.useRef(null),[et,tt]=e.useState(""),[nt,ot]=e.useState(!1),[it,at]=e.useState(!1),[rt,lt]=e.useState(null),[st,dt]=e.useState(x),ut=e.useMemo((()=>(e=>e&&N(e)?A(W,e):W)(G)),[G]),ct=Y(q),pt=Y(P),ft=Y(ie),mt=Y(oe),ht=Y(Ee||S),gt=Y(ke||I),bt=e.useMemo((()=>ae||C),[ae]),vt=e.useMemo((()=>re||O),[re]),wt=e.useMemo((()=>be||bt),[be,bt]),yt=((t,n=0)=>{const[o,i]=e.useState(t);return H((()=>{if(n<=0)return;const e=setTimeout((()=>{i(t)}),n);return()=>{clearTimeout(e)}}),[t,n]),n<=0?t:o})(et,$),[xt,Ct]=e.useState((()=>V(Q,vt,bt))),Ot=U(Be,yt,Fe,xt,vt,bt,ht,gt,Ne,ye,o,n,xe),[St,It]=_(Je,Ze,nt,Te,We,je,Ot.length,!!ue,ct,pt,we,Ve),Et=()=>{var e;return null===(e=Qe.current)||void 0===e?void 0:e.blur()},kt=()=>{var e;return null===(e=Qe.current)||void 0===e?void 0:e.focus()},Mt=e=>{var t;return null===(t=Ge.current)||void 0===t?void 0:t.scrollToItem(e)},zt=L(xt),Lt=M(he)?he:j,Nt=e.useCallback((e=>{if(!L(Ot))return void(!He.current&&ot(!0));const t=o?-1:Ot.findIndex((e=>e.isSelected)),n=t>-1?t:e===v?0:Ot.length-1;!He.current&&ot(!0),dt({index:n,...Ot[n]}),Mt(n)}),[o,Ot]),Dt=e.useCallback((e=>{Ct((t=>t.filter((t=>t.value!==e))))}),[]),Rt=e.useCallback(((e,t)=>{t?o&&Dt(e.value):Ct((t=>o?[...t,e]:[e])),Lt?Et():Re&&(ot(!1),tt(""))}),[o,Re,Dt,Lt]);e.useImperativeHandle(Ke,(()=>({empty:!zt,menuOpen:He.current,blur:Et,focus:kt,clearValue:()=>{Ct(E),dt(x)},setValue:e=>{const t=V(e,vt,bt);Ct(t)},toggleMenu:e=>{!0===e||void 0===e&&!He.current?(kt(),Nt(v)):Et()}})),[zt,vt,bt,Nt]),e.useEffect((()=>{d&&kt()}),[]),e.useEffect((()=>{He.current=nt}),[nt]),e.useEffect((()=>{_e.current=z(ie),Xe.current=z(oe)})),e.useEffect((()=>{it&&de&&Nt(v)}),[it,de,Nt]),e.useEffect((()=>{const{current:e}=_e;e&&Ye.current&&(Ye.current=!1,ft(yt))}),[ft,yt]),H((()=>{const{current:e}=Xe;if(e){const e=o?xt.map((e=>e.data)):L(xt)?xt[0].data:null;mt(e)}}),[mt,o,xt]),H((()=>{const{length:e}=Ot,t=e>0&&(n||e!==Be.length||0===Ue.current);0===e?dt(x):(1===e||t)&&(dt({index:0,...Ot[0]}),Mt(0)),Ue.current=e}),[n,Be,Ot]);const Vt=()=>{const{data:e,value:t,label:n,isSelected:o,isDisabled:i}=st;e&&!i&&Rt({data:e,value:t,label:n},o)},At=e=>{const t="ArrowDown"===e,n=t?v:b;nt?(e=>{if(!L(Ot))return;const t=e===g?(st.index+1)%Ot.length:st.index>0?st.index-1:Ot.length-1;rt&&lt(null),dt({index:t,...Ot[t]}),Mt(t)})(t?g:h):Nt(n)},Ft=e=>{if(B)return;it||kt();const t="INPUT"!==e.target.nodeName;nt?t&&(nt&&ot(!1),et&&tt("")):Le&&Nt(v),t&&e.preventDefault()},Tt=e.useCallback((e=>{null==K||K(e),at(!1),ot(!1),tt("")}),[K]),Bt=e.useCallback((e=>{null==ee||ee(e),at(!0)}),[ee]),$t=e.useCallback((e=>{Ye.current=!0;const t=e.currentTarget.value||"";null==te||te(t),tt(t),!He.current&&ot(!0)}),[te]),qt=e.useCallback((e=>{kt(),He.current?ot(!1):Nt(v),D(e)}),[Nt]),Pt=e.useCallback((e=>{kt(),Ct(E),D(e)}),[]),Wt=!ze||ze&&nt,jt=!(!X||B||!zt),Kt=B||!Me||!!rt,Ht=B||Le?void 0:qt;return a.default.createElement(t.ThemeProvider,{theme:ut},a.default.createElement(Oe,{id:r,"aria-controls":i,"aria-expanded":nt,onKeyDown:e=>{if(!(B||w&&(w(e,et,st),e.defaultPrevented))){switch(e.key){case"ArrowDown":case"ArrowUp":At(e.key);break;case"ArrowLeft":case"ArrowRight":if(!o||et||ve)return;(e=>{if(!zt)return;let t=-1;const n=xt.length-1,o=rt?xt.findIndex((e=>e.value===rt)):-1;t=e===f?o>-1&&o<n?o+1:-1:0!==o?-1===o?n:o-1:0;const i=t>=0?xt[t].value:null;st.data&&dt(x),i!==rt&&lt(i)})("ArrowLeft"===e.key?m:f);break;case" ":if(et)return;if(nt){if(!st.data)return;Vt()}else Nt(v);break;case"Enter":nt&&229!==e.keyCode&&Vt();break;case"Escape":nt&&(ot(!1),tt(""));break;case"Tab":if(!nt||!De||!st.data||e.shiftKey)return;Vt();break;case"Delete":case"Backspace":if(et)return;if(rt){const e=xt.findIndex((e=>e.value===rt)),t=e>-1&&e<xt.length-1?xt[e+1].value:null;Dt(rt),lt(t)}else{if(!Ae)return;if(!zt)break;if(o&&!ve){const{value:e}=xt[xt.length-1];Dt(e)}else X&&Ct(E)}break;default:return}e.preventDefault()}}},a.default.createElement(Ie,{ref:Ze,isInvalid:R,isFocused:it,isDisabled:B,className:"rfs-control-container",onTouchEnd:Ft,onMouseDown:Ft},a.default.createElement(Se,null,a.default.createElement(se,{isMulti:o,inputValue:et,placeholder:qe,selectedOption:xt,focusedMultiValue:rt,renderMultiOptions:ve,renderOptionLabel:wt,removeSelectedOption:Dt}),a.default.createElement(ce,{id:i,ref:Qe,required:l,ariaLabel:F,inputValue:et,readOnly:Kt,onBlur:Tt,onFocus:Bt,onChange:$t,ariaLabelledBy:ne,hasSelectedOptions:zt})),a.default.createElement(Ce,{menuOpen:nt,clearIcon:y,caretIcon:k,isInvalid:R,isLoading:u,showClear:jt,isDisabled:B,loadingNode:J,onClearMouseDown:Pt,onCaretMouseDown:Ht})),Wt&&a.default.createElement(Z,{menuRef:Je,menuOpen:nt,isLoading:u,menuTop:St,height:It,itemSize:We,loadingMsg:$e,menuOptions:Ot,fixedSizeListRef:Ge,noOptionsMsg:Pe,selectOption:Rt,direction:ge,itemKeySelector:le,overscanCount:me,menuPortalTarget:ue,width:T||ut.menu.width,onMenuMouseDown:e=>{D(e),kt()},renderOptionLabel:wt,focusedOptionIndex:st.index}),pe&&a.default.createElement(fe,{ariaLive:s,menuOpen:nt,isFocused:it,ariaLabel:F,inputValue:et,isSearchable:Me,focusedOption:st,selectedOption:xt,optionCount:Ot.length})))}));Ee.displayName="Select",exports.Select=Ee;

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

import e from"@babel/runtime/helpers/esm/defineProperty";import t,{useRef as n,useEffect as o,useState as r,memo as i,useMemo as a,Fragment as l,forwardRef as s,useCallback as c,useImperativeHandle as d}from"react";import u,{css as p,keyframes as m,ThemeProvider as f}from"styled-components";import h from"@babel/runtime/helpers/esm/objectWithoutProperties";import{areEqual as g,FixedSizeList as b}from"react-window";import{createPortal as y}from"react-dom";const v={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container"},w={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},O="top",x="auto",C="bottom",S="any",I=0,E=1,D=0,M=1,k=2,z=3,N=m(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),L=p([""," 0.25s ease-in-out"],m(["from{opacity:0;}to{opacity:1;}"])),j={index:-1},P=e=>e.label,T=e=>e.value,V=e=>!!e.isDisabled,A=({label:e})=>"string"==typeof e?e:`${e}`,B=[];function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}const F=/[\u0300-\u036f]/g;function $(e){return"boolean"==typeof e}function W(e){return Array.isArray(e)&&!!e.length}function q(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}const K=e=>{e.preventDefault(),e.stopPropagation()};function H(e,t,n){let o=e.trim();return t&&(o=o.toLowerCase()),n?function(e){return e.normalize("NFD").replace(F,"")}(o):o}const U=(e,t,n)=>{const o=Array.isArray(e)?e:q(e)?[e]:B;return W(o)?o.map((e=>({data:e,value:t(e),label:n(e)}))):o},Y=(t,n)=>{const o=function(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?R(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):R(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({},t);return Object.keys(n).forEach((e=>{const r=n[e];o[e]="animation"!==e&&q(r)?t[e]?Y(t[e],r):r:r||""})),o},X=/(auto|scroll)/;function G(e){return J(e)?window.pageYOffset:e.scrollTop}function J(e){return e===document.body||e===document.documentElement||e===window}function Q({overflow:e,overflowX:t,overflowY:n}){return X.test(`${e}${t}${n}`)}function Z(e){let t=getComputedStyle(e);const n=document.documentElement,o="absolute"===t.position;if("fixed"===t.position)return n;for(let n=e;n=null===(r=n)||void 0===r?void 0:r.parentElement;){var r;if(t=getComputedStyle(n),(!o||"static"!==t.position)&&Q(t))return n}return n}function _(e,t,n=300,o){let r=0;const i=G(e),a=t-i;requestAnimationFrame((function t(){r+=5;const l=a*((s=(s=r)/n-1)*s*s+1)+i;var s;!function(e,t){J(e)?window.scrollTo(0,t):e.scrollTop=t}(e,l),r<n?requestAnimationFrame(t):null==o||o()}))}const ee={color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:p([""," 1.19s ease-in-out infinite"],N),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 0.9375rem",clear:{width:"14px",height:"16px",animation:L,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",boxShadow:"0 0 0 0.2rem",padding:"0.375rem 0.75rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:L,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},placeholder:{animation:L},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:L,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:"#808080",transition:"color 0.2s ease-out, transform 0.2s ease-out, z-index 0.2s ease-out"}}},te="undefined"!=typeof window&&"ontouchstart"in window||"undefined"!=typeof navigator&&!!navigator.maxTouchPoints,ne="undefined"!=typeof navigator&&/(MSIE|Trident\/|Edge\/)/i.test(navigator.userAgent),oe=(e,t)=>{const r=n(!0);o((()=>{if(!r.current)return e();r.current=!1}),t)};function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ie(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?re(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):re(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}const ae=(e,t,n,i,a,l,s,c,d=!1,u=!1,p=!1,m=!1,f)=>{const[h,g]=r(B),b=m?"":t,y=$(f)?f:p;return o((()=>{const{current:t}=s,{current:o}=c,r=H(b,d,u),p=i.length?new Set(i.map((e=>e.value))):void 0,m=e=>{const i=a(e),s=ie(ie({data:e,value:i,label:l(e)},t(e)&&{isDisabled:!0}),(null==p?void 0:p.has(i))&&{isSelected:!0});if(!(r&&!(e=>{const t=H(o(e),d,u);return n===S?t.indexOf(r)>-1:t.substr(0,r.length)===r})(s)||y&&s.isSelected))return s},f=e.reduce(((e,t)=>{const n=m(t);return n&&e.push(n),e}),[]);g(f)}),[e,b,a,l,i,n,d,u,s,c,y]),h},le=(e,t)=>{const r=n(e||t);return o((()=>{r.current=e||t}),[e,t]),r},se=(e,t,i,a,l,s,c,d,u,p,m,f)=>{const h=n(!1),g=n(!d),[b,y]=r(s),[v,w]=r(!1);o((()=>{g.current=!v&&!d}),[v,d]),o((()=>{const t=a===O||a===x&&!(e=>{if(!e)return!0;const t=Z(e),{top:n,height:o}=e.getBoundingClientRect(),{height:r}=t.getBoundingClientRect();return r-G(t)-n>=o})(e.current);w(t)}),[e,a]),oe((()=>{if(i){const t=e=>{var t;null===(t=u.current)||void 0===t||t.call(u),e&&(h.current=!0,y(e))};g.current?((e,t,n,o)=>{if(!e)return void o();const{top:r,height:i,bottom:a}=e.getBoundingClientRect(),l=window.innerHeight;if(l-r>=i)return void o();const s=Z(e),c=G(s),d=s.getBoundingClientRect().height-c-r,u=d<i;if(u||!n)return void o(u?d:void 0);const p=getComputedStyle(e).marginBottom;_(s,a-l+c+parseInt(p,10),t,o)})(e.current,m,f,t):t()}else{var t;null===(t=p.current)||void 0===t||t.call(p),h.current&&(h.current=!1,y(s))}}),[e,i,s,f,m,p,u]);const C=Math.min(b,c*l);return[v?((e,t,n)=>{const o=e>0||!t?e:t.getBoundingClientRect().height,r=n?n.getBoundingClientRect().height:0,i=t&&getComputedStyle(t),a=i?parseInt(i.marginBottom,10):0,l=i?parseInt(i.marginTop,10):0;return`calc(${-Math.abs(o+r)}px + ${a+l}px)`})(C,e.current,t.current):void 0,C]},ce=i((({index:e,style:n,data:{menuOptions:o,selectOption:r,renderOptionLabel:i,focusedOptionIndex:a}})=>{const{data:l,value:s,label:c,isDisabled:d,isSelected:u}=o[e],p=function(e,t,n){let o="rfs-option";return e&&(o+=" rfs-option-disabled"),t&&(o+=" rfs-option-selected"),n&&(o+=" rfs-option-focused"),o}(d,u,e===a);return t.createElement("div",{style:n,onClick:d?void 0:()=>r({data:l,value:s,label:c},u),className:p},i(l))}),g);ce.displayName="Option";const de=u.div.withConfig({displayName:"NoOptionsMsg",componentId:"v1y124-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(({theme:e})=>e.noOptions.color),(({theme:e})=>e.noOptions.margin),(({theme:e})=>e.noOptions.padding),(({theme:e})=>e.noOptions.fontSize),(({theme:e})=>e.noOptions.css)),ue=({width:e,height:n,itemSize:o,direction:r,isLoading:i,loadingMsg:s,menuOptions:c,selectOption:d,noOptionsMsg:u,overscanCount:p,itemKeySelector:m,fixedSizeListRef:f,renderOptionLabel:h,focusedOptionIndex:g})=>{const y=a((()=>({menuOptions:c,selectOption:d,renderOptionLabel:h,focusedOptionIndex:g})),[c,g,d,h]);if(i)return t.createElement(de,null,s);return t.createElement(l,null,t.createElement(b,{width:e,height:n,itemKey:m?(e,t)=>t.menuOptions[e][m]:void 0,itemSize:o,itemData:y,direction:r,ref:f,overscanCount:p,itemCount:c.length},ce),!W(c)&&u&&t.createElement(de,null,u))},pe=u.div.withConfig({displayName:"MenuWrapper",componentId:"yf5myu-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;will-change:top,color,background-color;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(({menuTop:e,menuOpen:t,hideNoOptionsMsg:n,theme:{menu:o}})=>p(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],o.width,o.margin,o.padding,o.animation,o.borderRadius,o.backgroundColor,n?"none":o.boxShadow,t?"":"display: none;",e?`top: ${e};`:"")),(({theme:e})=>e.menu.css),"rfs-option",(({theme:e})=>e.menu.option.padding),(({theme:e})=>e.menu.option.textAlign),"rfs-option-focused","rfs-option-disabled","rfs-option-selected",(({theme:e})=>e.menu.option.focusedBgColor),"rfs-option-selected",(({theme:e})=>e.menu.option.selectedColor),(({theme:e})=>e.menu.option.selectedBgColor),"rfs-option-disabled"),me=e=>{let{menuRef:n,menuTop:o,menuOpen:r,onMenuMouseDown:i,menuPortalTarget:a}=e,l=h(e,["menuRef","menuTop","menuOpen","onMenuMouseDown","menuPortalTarget"]);const{menuOptions:s,noOptionsMsg:c}=l,d=r&&!Boolean(c)&&!W(s),u=t.createElement(pe,{ref:n,menuTop:o,menuOpen:r,onMouseDown:i,className:"rfs-menu-container",hideNoOptionsMsg:d},t.createElement(ue,Object.assign({},l)));return a?y(u,a):u},fe=p(["z-index:5000;transform:scale(1.26);color:",";"],(({theme:e})=>e.multiValue.clear.focusColor)),he=u.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-211cx7-0"})(["min-width:0;display:flex;"," ",""],(({theme:{multiValue:e}})=>p(["margin:",";animation:",";border-radius:",";background-color:",";"],e.margin,e.animation,e.borderRadius,e.backgroundColor)),(({theme:e})=>e.multiValue.css)),ge=u.div.withConfig({displayName:"Label",componentId:"sc-211cx7-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(({theme:e})=>e.multiValue.label.padding),(({theme:e})=>e.multiValue.label.fontSize),(({theme:e})=>e.multiValue.label.borderRadius)),be=u.i.withConfig({displayName:"Clear",componentId:"sc-211cx7-2"})(["display:flex;font-style:inherit;"," ",""],(({theme:{multiValue:{clear:e}}})=>p(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";:hover{","}"],e.color,e.padding,e.fontSize,e.alignSelf,e.transition,e.fontWeight,fe)),(({isFocused:e})=>e&&fe)),ye=i((({data:e,value:n,isFocused:o,renderOptionLabel:r,removeSelectedOption:i})=>{const a=()=>i(n);return t.createElement(he,null,t.createElement(ge,null,r(e)),t.createElement(be,{isFocused:o,onClick:a,onTouchEnd:a,onMouseDown:K},"✖"))}));ye.displayName="MultiValue";const ve=p(["top:50%;overflow:hidden;position:absolute;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;transform:translateY(-50%);"]),we=u.div.withConfig({displayName:"SingleValue",componentId:"sc-153h0ct-0"})([""," max-width:calc(100% - 0.5rem);"],ve),Oe=u.div.withConfig({displayName:"Placeholder",componentId:"sc-153h0ct-1"})([""," color:",";",""],ve,(({theme:e})=>e.color.placeholder),(({theme:e,isFirstRender:t})=>!t&&p(["animation:",";"],e.placeholder.animation))),xe=i((({isMulti:e,inputValue:o,placeholder:r,selectedOption:i,focusedMultiValue:a,renderOptionLabel:s,renderMultiOptions:c,removeSelectedOption:d})=>{const u=(()=>{const e=n(!0);return e.current?(e.current=!1,!0):e.current})(),p=!W(i);return o&&(!e||e&&(p||c))?null:p?t.createElement(Oe,{isFirstRender:u},r):e?t.createElement(l,null,c?c({renderOptionLabel:s,selected:i}):i.map((({data:e,value:n})=>t.createElement(ye,{key:n,data:e,value:n,renderOptionLabel:s,isFocused:n===a,removeSelectedOption:d})))):t.createElement(we,null,s(i[0].data))}));xe.displayName="Value";const Ce=u.div.withConfig({displayName:"SizerDiv",componentId:"o2ype2-0"})(["top:0;left:0;height:0;overflow:scroll;white-space:pre;position:absolute;visibility:hidden;font-size:inherit;font-weight:inherit;font-family:inherit;",""],(({theme:e})=>e.input.css)),Se=u.input.attrs(w).withConfig({displayName:"Input",componentId:"o2ype2-1"})(["border:0;outline:0;padding:0;cursor:text;background:0;color:inherit;font-size:inherit;font-weight:inherit;font-family:inherit;box-sizing:content-box;:read-only{opacity:0;cursor:default;}:required{","}"," ",""],(({theme:e,isInvalid:t})=>t&&e.input.cssRequired),(({theme:e})=>e.input.css),ne&&"::-ms-clear{display:none;}"),Ie=i(s((({id:e,onBlur:o,onFocus:i,readOnly:a,required:s,onChange:c,ariaLabel:d,inputValue:u,ariaLabelledBy:p,hasSelectedOptions:m},f)=>{const h=n(null),[g,b]=r(2),y=!!s&&!m;return oe((()=>{h.current&&b(h.current.scrollWidth+2)}),[u]),t.createElement(l,null,t.createElement(Se,{id:e,ref:f,isInvalid:!0,onBlur:o,onFocus:i,value:u,readOnly:a,required:y,"aria-label":d,style:{width:g},"aria-labelledby":p,onChange:a?void 0:c}),t.createElement(Ce,{ref:h},u))})));Ie.displayName="AutosizeInput";const Ee=u.span.withConfig({displayName:"A11yText",componentId:"zxgkbx-0"})(["border:0;padding:0;width:1px;height:1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(1px,1px,1px,1px);"]),De=({menuOpen:e,isFocused:n,inputValue:o,optionCount:r,isSearchable:i,focusedOption:a,selectedOption:l,ariaLive:s="polite",ariaLabel:c="Select"})=>{if(!n)return null;const d=` ${r} result(s) available${o?" for search input "+o:""}.`,u=e?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":`${c} is focused${i?", type to filter options":""}, press Down arrow key to open the menu.`,{index:p,value:m,label:f,isDisabled:h}=a,g=m?`Focused option: ${f}${h?" - disabled":""}, ${p+1} of ${r}.`:"",b="Selected option: "+(l.length?l.map((e=>e.label)).join(" "):"N/A"),y=`${g} ${d} ${u}`.trimStart();return t.createElement(Ee,{"aria-atomic":"false","aria-live":s,"aria-relevant":"additions text"},t.createElement("span",{id:"aria-selection"},b),t.createElement("span",{id:"aria-context"},y))},Me=u.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1j9e0pa-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;",":nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(({theme:e})=>e.loader.padding),(({theme:{loader:e}})=>p(["width:",";height:",";animation:",";background-color:",";"],e.size,e.size,e.animation,e.color))),ke=()=>t.createElement(Me,{"aria-hidden":!0,className:"rfs-loading-dots"},t.createElement("div",null),t.createElement("div",null),t.createElement("div",null)),ze=u.svg.withConfig({displayName:"ClearSvg",componentId:"sc-1v5ipi2-0"})(["fill:currentColor;",""],(({theme:e})=>p(["width:",";height:",";animation:",";transition:",";"],e.icon.clear.width,e.icon.clear.height,e.icon.clear.animation,e.icon.clear.transition))),Ne=()=>t.createElement(ze,{"aria-hidden":!0,viewBox:"0 0 14 16",className:"rfs-clear-icon"},t.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})),Le=u.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1561oeb-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),je=u.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1561oeb-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(({theme:e})=>e.icon.color),(({theme:e})=>e.icon.padding),(({theme:e})=>e.icon.hoverColor),(({theme:e})=>e.icon.css)),Pe=u.div.withConfig({displayName:"Caret",componentId:"sc-1561oeb-2"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(({theme:e})=>e.icon.caret.transition),(({theme:e})=>e.icon.caret.size),(({theme:e})=>e.icon.caret.size),(({theme:e})=>e.icon.caret.size),(({theme:e,menuOpen:t,isInvalid:n})=>t&&p(["transform:rotate(180deg);color:",";"],n?e.color.danger:e.color.caretActive||e.color.primary))),Te=u.div.withConfig({displayName:"Separator",componentId:"sc-1561oeb-3"})(["width:1px;margin:0.5rem 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(({theme:e})=>e.color.iconSeparator||e.color.border)),Ve=i((({menuOpen:e,clearIcon:n,caretIcon:o,isInvalid:r,showClear:i,isLoading:a,isDisabled:l,loadingNode:s,onCaretMouseDown:c,onClearMouseDown:d})=>{const u=t=>"function"==typeof t?t({menuOpen:e,isLoading:a,isInvalid:r,isDisabled:l}):t;return t.createElement(Le,null,i&&!a&&t.createElement(je,{onTouchEnd:d,onMouseDown:d},u(n)||t.createElement(Ne,null)),a&&(s||t.createElement(ke,null)),t.createElement(Te,null),t.createElement(je,{onTouchEnd:c,onMouseDown:c},u(o)||t.createElement(Pe,{"aria-hidden":!0,menuOpen:e,isInvalid:r,className:"rfs-caret-icon"})))}));function Ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Be(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?Ae(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Ae(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}Ve.displayName="IndicatorIcons";const Re=u.div.attrs(v).withConfig({displayName:"SelectWrapper",componentId:"kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(({theme:e})=>e.select.css)),Fe=u.div.withConfig({displayName:"ValueWrapper",componentId:"kcrmu9-1"})(["flex:1 1 0%;display:flex;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;padding:",";"],(({theme:e})=>e.control.padding)),$e=u.div.withConfig({displayName:"ControlWrapper",componentId:"kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;will-change:box-shadow,border-color;"," "," ",""],(({isDisabled:e,isFocused:t,isInvalid:n,theme:{control:o,color:r}})=>p(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],o.transition,o.borderStyle,o.borderWidth,o.borderRadius,o.height||o.minHeight,n?r.danger:t?o.focusedBorderColor:r.border,o.height?`height: ${o.height};`:"",e?"pointer-events:none;user-select:none;":"",o.backgroundColor||e?`background-color: ${e?r.disabled:o.backgroundColor};`:"",t?`box-shadow: ${o.boxShadow} ${n?r.dangerLight:o.boxShadowColor};`:"")),(({theme:e})=>e.control.css),(({isFocused:e,theme:t})=>e&&t.control.focusedCss)),We=s((({async:e,isMulti:i,inputId:l,selectId:s,required:u,ariaLive:p,autoFocus:m,isLoading:h,onKeyDown:g,clearIcon:b,caretIcon:y,isInvalid:v,ariaLabel:w,menuWidth:O,isDisabled:x,inputDelay:N,onMenuOpen:L,onMenuClose:R,onInputBlur:F,isClearable:H,themeConfig:X,loadingNode:G,initialValue:J,onInputFocus:Q,onInputChange:Z,ariaLabelledBy:_,onOptionChange:ne,onSearchChange:re,getOptionLabel:ie,getOptionValue:ce,itemKeySelector:de,openMenuOnFocus:ue,menuPortalTarget:pe,isAriaLiveEnabled:fe,menuOverscanCount:he,blurInputOnSelect:ge,menuItemDirection:be,renderOptionLabel:ye,renderMultiOptions:ve,menuScrollDuration:we,filterIgnoreAccents:Oe,hideSelectedOptions:Ce,getIsOptionDisabled:Se,getFilterOptionString:Ee,isSearchable:Me=!0,lazyLoadMenu:ke=!1,openMenuOnClick:ze=!0,filterIgnoreCase:Ne=!0,tabSelectsOption:Le=!0,closeMenuOnSelect:je=!0,scrollMenuIntoView:Pe=!0,backspaceClearsValue:Te=!0,filterMatchFrom:Ae=S,menuPosition:We=C,options:qe=B,loadingMsg:Ke="Loading..",placeholder:He="Select option..",noOptionsMsg:Ue="No options",menuItemSize:Ye=35,menuMaxHeight:Xe=300},Ge)=>{const Je=n(!1),Qe=n(),Ze=n(!1),_e=n(null),et=n(null),tt=n(null),nt=n(null),[ot,rt]=r(""),[it,at]=r(!1),[lt,st]=r(!1),[ct,dt]=r(null),[ut,pt]=r(j),mt=a((()=>(e=>e&&q(e)?Y(ee,e):ee)(X)),[X]),ft=le(L),ht=le(R),gt=le(re),bt=le(ne),yt=le(Se,V),vt=le(Ee,A),wt=a((()=>ie||P),[ie]),Ot=a((()=>ce||T),[ce]),xt=a((()=>ye||wt),[ye,wt]),Ct=((e,t=0)=>{const[n,o]=r(e);return oe((()=>{if(t<=0)return;const n=setTimeout((()=>{o(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),t<=0?e:n})(ot,N),[St,It]=r((()=>U(J,Ot,wt))),Et=ae(qe,Ct,Ae,St,Ot,wt,yt,vt,Ne,Oe,i,e,Ce),[Dt,Mt]=se(et,nt,it,We,Ye,Xe,Et.length,!!pe,ft,ht,we,Pe),kt=()=>{var e;return null===(e=tt.current)||void 0===e?void 0:e.blur()},zt=()=>{var e;return null===(e=tt.current)||void 0===e?void 0:e.focus()},Nt=e=>{var t;return null===(t=_e.current)||void 0===t?void 0:t.scrollToItem(e)},Lt=W(St),jt=$(ge)?ge:te,Pt=c((e=>{if(!W(Et))return void(!Je.current&&at(!0));const t=i?-1:Et.findIndex((e=>e.isSelected)),n=t>-1?t:e===z?0:Et.length-1;!Je.current&&at(!0),pt(Be({index:n},Et[n])),Nt(n)}),[i,Et]),Tt=c((e=>{It((t=>t.filter((t=>t.value!==e))))}),[]),Vt=c(((e,t)=>{t?i&&Tt(e.value):It((t=>i?[...t,e]:[e])),jt?kt():je&&(at(!1),rt(""))}),[i,je,Tt,jt]);d(Ge,(()=>({empty:!Lt,menuOpen:Je.current,blur:kt,focus:zt,clearValue:()=>{It(B),pt(j)},setValue:e=>{const t=U(e,Ot,wt);It(t)},toggleMenu:e=>{!0===e||void 0===e&&!Je.current?(zt(),Pt(z)):kt()}})),[Lt,Ot,wt,Pt]),o((()=>{m&&zt()}),[]),o((()=>{Je.current=it}),[it]),o((()=>{lt&&ue&&Pt(z)}),[lt,ue,Pt]),o((()=>{const{current:e}=gt;e&&Ze.current&&(Ze.current=!1,e(Ct))}),[Ct]),oe((()=>{const{current:e}=bt;if(e){e(i?St.map((e=>e.data)):W(St)?St[0].data:null)}}),[i,St]),oe((()=>{const{length:t}=Et,n=t>0&&(e||t!==qe.length||0===Qe.current);0===t?pt(j):(1===t||n)&&(pt(Be({index:0},Et[0])),Nt(0)),Qe.current=t}),[e,qe,Et]);const At=()=>{const{data:e,value:t,label:n,isSelected:o,isDisabled:r}=ut;e&&!r&&Vt({data:e,value:t,label:n},o)},Bt=e=>{const t="ArrowDown"===e,n=t?z:k;it?(e=>{if(!W(Et))return;const t=e===M?(ut.index+1)%Et.length:ut.index>0?ut.index-1:Et.length-1;ct&&dt(null),pt(Be({index:t},Et[t])),Nt(t)})(t?M:D):Pt(n)},Rt=e=>{if(x)return;lt||zt();const t="INPUT"!==e.target.nodeName;it?t&&(it&&at(!1),ot&&rt("")):ze&&Pt(z),t&&e.preventDefault()},Ft=c((e=>{null==F||F(e),st(!1),at(!1),rt("")}),[F]),$t=c((e=>{null==Q||Q(e),st(!0)}),[Q]),Wt=c((e=>{Ze.current=!0;const t=e.currentTarget.value||"";null==Z||Z(t),rt(t),!Je.current&&at(!0)}),[Z]),qt=c((e=>{zt(),Je.current?at(!1):Pt(z),K(e)}),[Pt]),Kt=c((e=>{zt(),It(B),K(e)}),[]),Ht=!ke||ke&&it,Ut=!(!H||x||!Lt),Yt=x||!Me||!!ct,Xt=x||ze?void 0:qt;return t.createElement(f,{theme:mt},t.createElement(Re,{id:s,"aria-controls":l,"aria-expanded":it,onKeyDown:e=>{if(!(x||g&&(g(e,ot,ut),e.defaultPrevented))){switch(e.key){case"ArrowDown":case"ArrowUp":Bt(e.key);break;case"ArrowLeft":case"ArrowRight":if(!i||ot||ve)return;(e=>{if(!Lt)return;let t=-1;const n=St.length-1,o=ct?St.findIndex((e=>e.value===ct)):-1;t=e===I?o>-1&&o<n?o+1:-1:0!==o?-1===o?n:o-1:0;const r=t>=0?St[t].value:null;ut.data&&pt(j),r!==ct&&dt(r)})("ArrowLeft"===e.key?E:I);break;case" ":if(ot)return;if(it){if(!ut.data)return;At()}else Pt(z);break;case"Enter":it&&229!==e.keyCode&&At();break;case"Escape":it&&(at(!1),rt(""));break;case"Tab":if(!it||!Le||!ut.data||e.shiftKey)return;At();break;case"Delete":case"Backspace":if(ot)return;if(ct){const e=St.findIndex((e=>e.value===ct)),t=e>-1&&e<St.length-1?St[e+1].value:null;Tt(ct),dt(t)}else{if(!Te)return;if(!Lt)break;if(i&&!ve){const{value:e}=St[St.length-1];Tt(e)}else H&&It(B)}break;default:return}e.preventDefault()}}},t.createElement($e,{ref:nt,isInvalid:v,isFocused:lt,isDisabled:x,className:"rfs-control-container",onTouchEnd:Rt,onMouseDown:Rt},t.createElement(Fe,null,t.createElement(xe,{isMulti:i,inputValue:ot,placeholder:He,selectedOption:St,focusedMultiValue:ct,renderMultiOptions:ve,renderOptionLabel:xt,removeSelectedOption:Tt}),t.createElement(Ie,{id:l,ref:tt,required:u,ariaLabel:w,inputValue:ot,readOnly:Yt,onBlur:Ft,onFocus:$t,onChange:Wt,ariaLabelledBy:_,hasSelectedOptions:Lt})),t.createElement(Ve,{menuOpen:it,clearIcon:b,caretIcon:y,isInvalid:v,isLoading:h,showClear:Ut,isDisabled:x,loadingNode:G,onClearMouseDown:Kt,onCaretMouseDown:Xt})),Ht&&t.createElement(me,{menuRef:et,menuOpen:it,isLoading:h,menuTop:Dt,height:Mt,itemSize:Ye,loadingMsg:Ke,menuOptions:Et,fixedSizeListRef:_e,noOptionsMsg:Ue,selectOption:Vt,direction:be,itemKeySelector:de,overscanCount:he,menuPortalTarget:pe,width:O||mt.menu.width,onMenuMouseDown:e=>{K(e),zt()},renderOptionLabel:xt,focusedOptionIndex:ut.index}),fe&&t.createElement(De,{ariaLive:p,menuOpen:it,isFocused:lt,ariaLabel:w,inputValue:ot,isSearchable:Me,focusedOption:ut,selectedOption:St,optionCount:Et.length})))}));We.displayName="Select";export{We as Select};
import e from"@babel/runtime/helpers/esm/defineProperty";import t,{useRef as n,useEffect as o,useState as r,useCallback as i,memo as a,useMemo as l,Fragment as s,forwardRef as c,useImperativeHandle as d}from"react";import u,{css as p,keyframes as m,ThemeProvider as f}from"styled-components";import g from"@babel/runtime/helpers/esm/objectWithoutProperties";import{areEqual as h,FixedSizeList as b}from"react-window";import{createPortal as v}from"react-dom";const w={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container"},y={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},O="top",x="auto",C="bottom",S="any",I=0,E=1,D=0,z=1,k=2,M=3,N=m(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),j=p([""," 0.25s ease-in-out"],m(["from{opacity:0;}to{opacity:1;}"])),L={index:-1},P=e=>e.label,T=e=>e.value,V=e=>!!e.isDisabled,A=({label:e})=>"string"==typeof e?e:`${e}`,B=[];function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}const F=/[\u0300-\u036f]/g;function $(e){return"boolean"==typeof e}function q(e){return"function"==typeof e}function W(e){return Array.isArray(e)&&!!e.length}function K(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}const H=e=>{e.preventDefault(),e.stopPropagation()};function U(e,t,n){let o=e.trim();return t&&(o=o.toLowerCase()),n?function(e){return e.normalize("NFD").replace(F,"")}(o):o}const Y=(e,t,n)=>{const o=Array.isArray(e)?e:K(e)?[e]:B;return W(o)?o.map((e=>({data:e,value:t(e),label:n(e)}))):o},X=(t,n)=>{const o=function(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?R(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):R(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({},t);return Object.keys(n).forEach((e=>{const r=n[e];o[e]="animation"!==e&&K(r)?t[e]?X(t[e],r):r:r||""})),o},G=/(auto|scroll)/;function J(e){return Q(e)?window.pageYOffset:e.scrollTop}function Q(e){return e===document.body||e===document.documentElement||e===window}function Z({overflow:e,overflowX:t,overflowY:n}){return G.test(`${e}${t}${n}`)}function _(e){let t=getComputedStyle(e);const n=document.documentElement,o="absolute"===t.position;if("fixed"===t.position)return n;for(let n=e;n=null===(r=n)||void 0===r?void 0:r.parentElement;){var r;if(t=getComputedStyle(n),(!o||"static"!==t.position)&&Z(t))return n}return n}function ee(e,t,n=300,o){let r=0;const i=J(e),a=t-i;requestAnimationFrame((function t(){r+=5;const l=a*((s=(s=r)/n-1)*s*s+1)+i;var s;!function(e,t){Q(e)?window.scrollTo(0,t):e.scrollTop=t}(e,l),r<n?requestAnimationFrame(t):null==o||o()}))}const te={color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:p([""," 1.19s ease-in-out infinite"],N),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 0.9375rem",clear:{width:"14px",height:"16px",animation:j,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",boxShadow:"0 0 0 0.2rem",padding:"0.375rem 0.75rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:j,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},placeholder:{animation:j},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:j,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:"#808080",transition:"color 0.2s ease-out, transform 0.2s ease-out, z-index 0.2s ease-out"}}},ne="undefined"!=typeof window&&"ontouchstart"in window||"undefined"!=typeof navigator&&!!navigator.maxTouchPoints,oe="undefined"!=typeof navigator&&/(MSIE|Trident\/|Edge\/)/i.test(navigator.userAgent),re=(e,t)=>{const r=n(!0);o((()=>{if(!r.current)return e();r.current=!1}),t)};function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ae(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?ie(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ie(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}const le=(e,t,n,i,a,l,s,c,d=!1,u=!1,p=!1,m=!1,f)=>{const[g,h]=r(B),b=m?"":t,v=$(f)?f:p;return o((()=>{const t=n===S,o=U(b,d,u),r=i.length?new Set(i.map((e=>e.value))):void 0,p=e=>{const n=a(e),i=ae(ae({data:e,value:n,label:l(e)},s(e)&&{isDisabled:!0}),(null==r?void 0:r.has(n))&&{isSelected:!0});if(!(o&&!(e=>{const n=U(c(e),d,u);return t?n.indexOf(o)>-1:n.substr(0,o.length)===o})(i)||v&&i.isSelected))return i},m=e.reduce(((e,t)=>{const n=p(t);return n&&e.push(n),e}),[]);h(m)}),[e,b,a,l,i,n,d,u,s,c,v]),g},se=e=>{const t=n(e);return o((()=>{t.current=e})),i(((...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])},ce=(e,t,i,a,l,s,c,d,u,p,m,f)=>{const g=n(!1),h=n(!d),[b,v]=r(s),[w,y]=r(!1);o((()=>{h.current=!w&&!d}),[w,d]),o((()=>{const t=a===O||a===x&&!(e=>{if(!e)return!0;const t=_(e),{top:n,height:o}=e.getBoundingClientRect(),{height:r}=t.getBoundingClientRect();return r-J(t)-n>=o})(e.current);y(t)}),[e,a]),re((()=>{if(i){const t=e=>{u(),e&&(g.current=!0,v(e))};h.current?((e,t,n,o)=>{if(!e)return void o();const{top:r,height:i,bottom:a}=e.getBoundingClientRect(),l=window.innerHeight;if(l-r>=i)return void o();const s=_(e),c=J(s),d=s.getBoundingClientRect().height-c-r,u=d<i;if(u||!n)return void o(u?d:void 0);const p=getComputedStyle(e).marginBottom;ee(s,a-l+c+parseInt(p,10),t,o)})(e.current,m,f,t):t()}else p(),g.current&&(g.current=!1,v(s))}),[e,i,s,f,m,p,u]);const C=Math.min(b,c*l);return[w?((e,t,n)=>{const o=e>0||!t?e:t.getBoundingClientRect().height,r=n?n.getBoundingClientRect().height:0,i=t&&getComputedStyle(t),a=i?parseInt(i.marginBottom,10):0,l=i?parseInt(i.marginTop,10):0;return`calc(${-Math.abs(o+r)}px + ${a+l}px)`})(C,e.current,t.current):void 0,C]},de=a((({index:e,style:n,data:{menuOptions:o,selectOption:r,renderOptionLabel:i,focusedOptionIndex:a}})=>{const{data:l,value:s,label:c,isDisabled:d,isSelected:u}=o[e],p=function(e,t,n){let o="rfs-option";return e&&(o+=" rfs-option-disabled"),t&&(o+=" rfs-option-selected"),n&&(o+=" rfs-option-focused"),o}(d,u,e===a);return t.createElement("div",{style:n,onClick:d?void 0:()=>r({data:l,value:s,label:c},u),className:p},i(l))}),h);de.displayName="Option";const ue=u.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(({theme:e})=>e.noOptions.color),(({theme:e})=>e.noOptions.margin),(({theme:e})=>e.noOptions.padding),(({theme:e})=>e.noOptions.fontSize),(({theme:e})=>e.noOptions.css)),pe=({width:e,height:n,itemSize:o,direction:r,isLoading:i,loadingMsg:a,menuOptions:c,selectOption:d,noOptionsMsg:u,overscanCount:p,itemKeySelector:m,fixedSizeListRef:f,renderOptionLabel:g,focusedOptionIndex:h})=>{const v=l((()=>({menuOptions:c,selectOption:d,renderOptionLabel:g,focusedOptionIndex:h})),[c,h,d,g]);if(i)return t.createElement(ue,null,a);return t.createElement(s,null,t.createElement(b,{width:e,height:n,itemKey:m?(e,t)=>t.menuOptions[e][m]:void 0,itemSize:o,itemData:v,direction:r,ref:f,overscanCount:p,itemCount:c.length},de),!W(c)&&u&&t.createElement(ue,null,u))},me=u.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;will-change:top,color,background-color;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(({menuTop:e,menuOpen:t,hideNoOptionsMsg:n,theme:{menu:o}})=>p(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],o.width,o.margin,o.padding,o.animation,o.borderRadius,o.backgroundColor,n?"none":o.boxShadow,t?"":"display: none;",e?`top: ${e};`:"")),(({theme:e})=>e.menu.css),"rfs-option",(({theme:e})=>e.menu.option.padding),(({theme:e})=>e.menu.option.textAlign),"rfs-option-focused","rfs-option-disabled","rfs-option-selected",(({theme:e})=>e.menu.option.focusedBgColor),"rfs-option-selected",(({theme:e})=>e.menu.option.selectedColor),(({theme:e})=>e.menu.option.selectedBgColor),"rfs-option-disabled"),fe=e=>{let{menuRef:n,menuTop:o,menuOpen:r,onMenuMouseDown:i,menuPortalTarget:a}=e,l=g(e,["menuRef","menuTop","menuOpen","onMenuMouseDown","menuPortalTarget"]);const{menuOptions:s,noOptionsMsg:c}=l,d=r&&!Boolean(c)&&!W(s),u=t.createElement(me,{ref:n,menuTop:o,menuOpen:r,onMouseDown:i,className:"rfs-menu-container",hideNoOptionsMsg:d},t.createElement(pe,Object.assign({},l)));return a?v(u,a):u},ge=p(["z-index:5000;transform:scale(1.26);color:",";"],(({theme:e})=>e.multiValue.clear.focusColor)),he=u.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(({theme:{multiValue:e}})=>p(["margin:",";animation:",";border-radius:",";background-color:",";"],e.margin,e.animation,e.borderRadius,e.backgroundColor)),(({theme:e})=>e.multiValue.css)),be=u.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(({theme:e})=>e.multiValue.label.padding),(({theme:e})=>e.multiValue.label.fontSize),(({theme:e})=>e.multiValue.label.borderRadius)),ve=u.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(({theme:{multiValue:{clear:e}}})=>p(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";:hover{","}"],e.color,e.padding,e.fontSize,e.alignSelf,e.transition,e.fontWeight,ge)),(({isFocused:e})=>e&&ge)),we=a((({data:e,value:n,isFocused:o,renderOptionLabel:r,removeSelectedOption:i})=>{const a=()=>i(n);return t.createElement(he,null,t.createElement(be,null,r(e)),t.createElement(ve,{isFocused:o,onClick:a,onTouchEnd:a,onMouseDown:H},"✖"))}));we.displayName="MultiValue";const ye=p(["top:50%;overflow:hidden;position:absolute;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;transform:translateY(-50%);"]),Oe=u.div.withConfig({displayName:"SingleValue",componentId:"us7kwl-0"})([""," max-width:calc(100% - 0.5rem);"],ye),xe=u.div.withConfig({displayName:"Placeholder",componentId:"us7kwl-1"})([""," color:",";",""],ye,(({theme:e})=>e.color.placeholder),(({theme:e,isFirstRender:t})=>!t&&p(["animation:",";"],e.placeholder.animation))),Ce=a((({isMulti:e,inputValue:o,placeholder:r,selectedOption:i,focusedMultiValue:a,renderOptionLabel:l,renderMultiOptions:c,removeSelectedOption:d})=>{const u=(()=>{const e=n(!0);return e.current?(e.current=!1,!0):e.current})(),p=!W(i);return o&&(!e||e&&(p||c))?null:p?t.createElement(xe,{isFirstRender:u},r):e?t.createElement(s,null,c?c({renderOptionLabel:l,selected:i}):i.map((({data:e,value:n})=>t.createElement(we,{key:n,data:e,value:n,renderOptionLabel:l,isFocused:n===a,removeSelectedOption:d})))):t.createElement(Oe,null,l(i[0].data))}));Ce.displayName="Value";const Se=u.div.withConfig({displayName:"SizerDiv",componentId:"sc-4er7q8-0"})(["top:0;left:0;height:0;overflow:scroll;white-space:pre;position:absolute;visibility:hidden;font-size:inherit;font-weight:inherit;font-family:inherit;",""],(({theme:e})=>e.input.css)),Ie=u.input.attrs(y).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["border:0;outline:0;padding:0;cursor:text;background:0;color:inherit;font-size:inherit;font-weight:inherit;font-family:inherit;box-sizing:content-box;:read-only{opacity:0;cursor:default;}:required{","}"," ",""],(({theme:e,isInvalid:t})=>t&&e.input.cssRequired),(({theme:e})=>e.input.css),oe&&"::-ms-clear{display:none;}"),Ee=a(c((({id:e,onBlur:o,onFocus:i,readOnly:a,required:l,onChange:c,ariaLabel:d,inputValue:u,ariaLabelledBy:p,hasSelectedOptions:m},f)=>{const g=n(null),[h,b]=r(2),v=!!l&&!m;return re((()=>{g.current&&b(g.current.scrollWidth+2)}),[u]),t.createElement(s,null,t.createElement(Ie,{id:e,ref:f,isInvalid:!0,onBlur:o,onFocus:i,value:u,readOnly:a,required:v,"aria-label":d,style:{width:h},"aria-labelledby":p,onChange:a?void 0:c}),t.createElement(Se,{ref:g},u))})));Ee.displayName="AutosizeInput";const De=u.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;margin:-1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(0,0,0,0);"]),ze=({menuOpen:e,isFocused:n,inputValue:o,optionCount:r,isSearchable:i,focusedOption:a,selectedOption:l,ariaLive:s="polite",ariaLabel:c="Select"})=>{if(!n)return null;const d=e?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":`${c} is focused${i?", type to filter options":""}, press Down arrow key to open the menu.`,{index:u,value:p,label:m,isDisabled:f}=a,g=p&&!f?`Option ${m} is focused, ${u+1} of ${r}.`:"",h=`${r} option(s) available${o?" for search "+o:""}.`,b="Selected option: "+(l.length?l.map((e=>e.label)).join(" "):"N/A"),v=`${g} ${h} ${d}`.trimStart();return t.createElement(De,{"aria-atomic":"false","aria-live":s,"aria-relevant":"additions text"},t.createElement("span",{id:"aria-selection"},b),t.createElement("span",{id:"aria-context"},v))},ke=u.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;",":nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(({theme:e})=>e.loader.padding),(({theme:{loader:e}})=>p(["width:",";height:",";animation:",";background-color:",";"],e.size,e.size,e.animation,e.color))),Me=()=>t.createElement(ke,{"aria-hidden":!0,className:"rfs-loading-dots"},t.createElement("div",null),t.createElement("div",null),t.createElement("div",null)),Ne=u.svg.withConfig({displayName:"ClearSvg",componentId:"kkzaaw-0"})(["fill:currentColor;",""],(({theme:e})=>p(["width:",";height:",";animation:",";transition:",";"],e.icon.clear.width,e.icon.clear.height,e.icon.clear.animation,e.icon.clear.transition))),je=()=>t.createElement(Ne,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},t.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})),Le=u.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),Pe=u.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(({theme:e})=>e.icon.color),(({theme:e})=>e.icon.padding),(({theme:e})=>e.icon.hoverColor),(({theme:e})=>e.icon.css)),Te=u.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:0.5rem 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(({theme:e})=>e.color.iconSeparator||e.color.border)),Ve=u.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(({theme:e})=>e.icon.caret.transition),(({theme:e})=>e.icon.caret.size),(({theme:e})=>e.icon.caret.size),(({theme:e})=>e.icon.caret.size),(({theme:e,menuOpen:t,isInvalid:n})=>t&&p(["transform:rotate(180deg);color:",";"],n?e.color.danger:e.color.caretActive||e.color.primary))),Ae=a((({menuOpen:e,clearIcon:n,caretIcon:o,isInvalid:r,showClear:i,isLoading:a,isDisabled:l,loadingNode:s,onCaretMouseDown:c,onClearMouseDown:d})=>{const u=t=>q(t)?t({menuOpen:e,isLoading:a,isInvalid:r,isDisabled:l}):t;return t.createElement(Le,null,i&&!a&&t.createElement(Pe,{onTouchEnd:d,onMouseDown:d},u(n)||t.createElement(je,null)),a&&(s||t.createElement(Me,null)),t.createElement(Te,{role:"none"}),t.createElement(Pe,{onTouchEnd:c,onMouseDown:c},u(o)||t.createElement(Ve,{"aria-hidden":!0,menuOpen:e,isInvalid:r,className:"rfs-caret-icon"})))}));function Be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Re(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?Be(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Be(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}Ae.displayName="IndicatorIcons";const Fe=u.div.attrs(w).withConfig({displayName:"SelectWrapper",componentId:"kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(({theme:e})=>e.select.css)),$e=u.div.withConfig({displayName:"ValueWrapper",componentId:"kcrmu9-1"})(["flex:1 1 0%;display:flex;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;padding:",";"],(({theme:e})=>e.control.padding)),qe=u.div.withConfig({displayName:"ControlWrapper",componentId:"kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;will-change:box-shadow,border-color;"," "," ",""],(({isDisabled:e,isFocused:t,isInvalid:n,theme:{control:o,color:r}})=>p(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],o.transition,o.borderStyle,o.borderWidth,o.borderRadius,o.height||o.minHeight,n?r.danger:t?o.focusedBorderColor:r.border,o.height?`height: ${o.height};`:"",e?"pointer-events:none;user-select:none;":"",o.backgroundColor||e?`background-color: ${e?r.disabled:o.backgroundColor};`:"",t?`box-shadow: ${o.boxShadow} ${n?r.dangerLight:o.boxShadowColor};`:"")),(({theme:e})=>e.control.css),(({isFocused:e,theme:t})=>e&&t.control.focusedCss)),We=c((({async:e,isMulti:a,inputId:s,selectId:c,required:u,ariaLive:p,autoFocus:m,isLoading:g,onKeyDown:h,clearIcon:b,caretIcon:v,isInvalid:w,ariaLabel:y,menuWidth:O,isDisabled:x,inputDelay:N,onMenuOpen:j,onMenuClose:R,onInputBlur:F,isClearable:U,themeConfig:G,loadingNode:J,initialValue:Q,onInputFocus:Z,onInputChange:_,ariaLabelledBy:ee,onOptionChange:oe,onSearchChange:ie,getOptionLabel:ae,getOptionValue:de,itemKeySelector:ue,openMenuOnFocus:pe,menuPortalTarget:me,isAriaLiveEnabled:ge,menuOverscanCount:he,blurInputOnSelect:be,menuItemDirection:ve,renderOptionLabel:we,renderMultiOptions:ye,menuScrollDuration:Oe,filterIgnoreAccents:xe,hideSelectedOptions:Se,getIsOptionDisabled:Ie,getFilterOptionString:De,isSearchable:ke=!0,lazyLoadMenu:Me=!1,openMenuOnClick:Ne=!0,filterIgnoreCase:je=!0,tabSelectsOption:Le=!0,closeMenuOnSelect:Pe=!0,scrollMenuIntoView:Te=!0,backspaceClearsValue:Ve=!0,filterMatchFrom:Be=S,menuPosition:We=C,options:Ke=B,loadingMsg:He="Loading..",placeholder:Ue="Select option..",noOptionsMsg:Ye="No options",menuItemSize:Xe=35,menuMaxHeight:Ge=300},Je)=>{const Qe=n(!1),Ze=n(),_e=n(!1),et=n(q(ie)),tt=n(q(oe)),nt=n(null),ot=n(null),rt=n(null),it=n(null),[at,lt]=r(""),[st,ct]=r(!1),[dt,ut]=r(!1),[pt,mt]=r(null),[ft,gt]=r(L),ht=l((()=>(e=>e&&K(e)?X(te,e):te)(G)),[G]),bt=se(j),vt=se(R),wt=se(ie),yt=se(oe),Ot=se(Ie||V),xt=se(De||A),Ct=l((()=>ae||P),[ae]),St=l((()=>de||T),[de]),It=l((()=>we||Ct),[we,Ct]),Et=((e,t=0)=>{const[n,o]=r(e);return re((()=>{if(t<=0)return;const n=setTimeout((()=>{o(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),t<=0?e:n})(at,N),[Dt,zt]=r((()=>Y(Q,St,Ct))),kt=le(Ke,Et,Be,Dt,St,Ct,Ot,xt,je,xe,a,e,Se),[Mt,Nt]=ce(ot,it,st,We,Xe,Ge,kt.length,!!me,bt,vt,Oe,Te),jt=()=>{var e;return null===(e=rt.current)||void 0===e?void 0:e.blur()},Lt=()=>{var e;return null===(e=rt.current)||void 0===e?void 0:e.focus()},Pt=e=>{var t;return null===(t=nt.current)||void 0===t?void 0:t.scrollToItem(e)},Tt=W(Dt),Vt=$(be)?be:ne,At=i((e=>{if(!W(kt))return void(!Qe.current&&ct(!0));const t=a?-1:kt.findIndex((e=>e.isSelected)),n=t>-1?t:e===M?0:kt.length-1;!Qe.current&&ct(!0),gt(Re({index:n},kt[n])),Pt(n)}),[a,kt]),Bt=i((e=>{zt((t=>t.filter((t=>t.value!==e))))}),[]),Rt=i(((e,t)=>{t?a&&Bt(e.value):zt((t=>a?[...t,e]:[e])),Vt?jt():Pe&&(ct(!1),lt(""))}),[a,Pe,Bt,Vt]);d(Je,(()=>({empty:!Tt,menuOpen:Qe.current,blur:jt,focus:Lt,clearValue:()=>{zt(B),gt(L)},setValue:e=>{const t=Y(e,St,Ct);zt(t)},toggleMenu:e=>{!0===e||void 0===e&&!Qe.current?(Lt(),At(M)):jt()}})),[Tt,St,Ct,At]),o((()=>{m&&Lt()}),[]),o((()=>{Qe.current=st}),[st]),o((()=>{et.current=q(ie),tt.current=q(oe)})),o((()=>{dt&&pe&&At(M)}),[dt,pe,At]),o((()=>{const{current:e}=et;e&&_e.current&&(_e.current=!1,wt(Et))}),[wt,Et]),re((()=>{const{current:e}=tt;if(e){const e=a?Dt.map((e=>e.data)):W(Dt)?Dt[0].data:null;yt(e)}}),[yt,a,Dt]),re((()=>{const{length:t}=kt,n=t>0&&(e||t!==Ke.length||0===Ze.current);0===t?gt(L):(1===t||n)&&(gt(Re({index:0},kt[0])),Pt(0)),Ze.current=t}),[e,Ke,kt]);const Ft=()=>{const{data:e,value:t,label:n,isSelected:o,isDisabled:r}=ft;e&&!r&&Rt({data:e,value:t,label:n},o)},$t=e=>{const t="ArrowDown"===e,n=t?M:k;st?(e=>{if(!W(kt))return;const t=e===z?(ft.index+1)%kt.length:ft.index>0?ft.index-1:kt.length-1;pt&&mt(null),gt(Re({index:t},kt[t])),Pt(t)})(t?z:D):At(n)},qt=e=>{if(x)return;dt||Lt();const t="INPUT"!==e.target.nodeName;st?t&&(st&&ct(!1),at&&lt("")):Ne&&At(M),t&&e.preventDefault()},Wt=i((e=>{null==F||F(e),ut(!1),ct(!1),lt("")}),[F]),Kt=i((e=>{null==Z||Z(e),ut(!0)}),[Z]),Ht=i((e=>{_e.current=!0;const t=e.currentTarget.value||"";null==_||_(t),lt(t),!Qe.current&&ct(!0)}),[_]),Ut=i((e=>{Lt(),Qe.current?ct(!1):At(M),H(e)}),[At]),Yt=i((e=>{Lt(),zt(B),H(e)}),[]),Xt=!Me||Me&&st,Gt=!(!U||x||!Tt),Jt=x||!ke||!!pt,Qt=x||Ne?void 0:Ut;return t.createElement(f,{theme:ht},t.createElement(Fe,{id:c,"aria-controls":s,"aria-expanded":st,onKeyDown:e=>{if(!(x||h&&(h(e,at,ft),e.defaultPrevented))){switch(e.key){case"ArrowDown":case"ArrowUp":$t(e.key);break;case"ArrowLeft":case"ArrowRight":if(!a||at||ye)return;(e=>{if(!Tt)return;let t=-1;const n=Dt.length-1,o=pt?Dt.findIndex((e=>e.value===pt)):-1;t=e===I?o>-1&&o<n?o+1:-1:0!==o?-1===o?n:o-1:0;const r=t>=0?Dt[t].value:null;ft.data&&gt(L),r!==pt&&mt(r)})("ArrowLeft"===e.key?E:I);break;case" ":if(at)return;if(st){if(!ft.data)return;Ft()}else At(M);break;case"Enter":st&&229!==e.keyCode&&Ft();break;case"Escape":st&&(ct(!1),lt(""));break;case"Tab":if(!st||!Le||!ft.data||e.shiftKey)return;Ft();break;case"Delete":case"Backspace":if(at)return;if(pt){const e=Dt.findIndex((e=>e.value===pt)),t=e>-1&&e<Dt.length-1?Dt[e+1].value:null;Bt(pt),mt(t)}else{if(!Ve)return;if(!Tt)break;if(a&&!ye){const{value:e}=Dt[Dt.length-1];Bt(e)}else U&&zt(B)}break;default:return}e.preventDefault()}}},t.createElement(qe,{ref:it,isInvalid:w,isFocused:dt,isDisabled:x,className:"rfs-control-container",onTouchEnd:qt,onMouseDown:qt},t.createElement($e,null,t.createElement(Ce,{isMulti:a,inputValue:at,placeholder:Ue,selectedOption:Dt,focusedMultiValue:pt,renderMultiOptions:ye,renderOptionLabel:It,removeSelectedOption:Bt}),t.createElement(Ee,{id:s,ref:rt,required:u,ariaLabel:y,inputValue:at,readOnly:Jt,onBlur:Wt,onFocus:Kt,onChange:Ht,ariaLabelledBy:ee,hasSelectedOptions:Tt})),t.createElement(Ae,{menuOpen:st,clearIcon:b,caretIcon:v,isInvalid:w,isLoading:g,showClear:Gt,isDisabled:x,loadingNode:J,onClearMouseDown:Yt,onCaretMouseDown:Qt})),Xt&&t.createElement(fe,{menuRef:ot,menuOpen:st,isLoading:g,menuTop:Mt,height:Nt,itemSize:Xe,loadingMsg:He,menuOptions:kt,fixedSizeListRef:nt,noOptionsMsg:Ye,selectOption:Rt,direction:ve,itemKeySelector:ue,overscanCount:he,menuPortalTarget:me,width:O||ht.menu.width,onMenuMouseDown:e=>{H(e),Lt()},renderOptionLabel:It,focusedOptionIndex:ft.index}),ge&&t.createElement(ze,{ariaLive:p,menuOpen:st,isFocused:dt,ariaLabel:y,inputValue:at,isSearchable:ke,focusedOption:ft,selectedOption:Dt,optionCount:kt.length})))}));We.displayName="Select";export{We as Select};

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("styled-components"),require("react-window"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","styled-components","react-window","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactFunctionalSelect={},e.React,e.styled,e.ReactWindow,e.ReactDOM)}(this,(function(e,t,n,o,r){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=i(t),l=i(n);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c="rfs-option",d="rfs-option-focused",u="rfs-option-selected",p="rfs-option-disabled",f={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container","data-testid":undefined},m={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input","data-testid":undefined},g="top",h="auto",b="bottom",y="any",v=0,w=1,O=0,x=1,C=2,S=3,E=n.keyframes(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),I=n.css([""," 0.25s ease-in-out"],n.keyframes(["from{opacity:0;}to{opacity:1;}"])),k={index:-1},M=e=>e.label,D=e=>e.value,j=e=>!!e.isDisabled,z=({label:e})=>"string"==typeof e?e:`${e}`,L=[];function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}const R=/[\u0300-\u036f]/g;function P(e){return"boolean"==typeof e}function T(e){return Array.isArray(e)&&!!e.length}function F(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}const V=e=>{e.preventDefault(),e.stopPropagation()};function A(e,t,n){let o=e.trim();return t&&(o=o.toLowerCase()),n?function(e){return e.normalize("NFD").replace(R,"")}(o):o}const B=(e,t,n)=>{const o=Array.isArray(e)?e:F(e)?[e]:L;return T(o)?o.map((e=>({data:e,value:t(e),label:n(e)}))):o},$=(e,t)=>{const n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);return Object.keys(t).forEach((o=>{const r=t[o];n[o]="animation"!==o&&F(r)?e[o]?$(e[o],r):r:r||""})),n},q=/(auto|scroll)/;function W(e){return K(e)?window.pageYOffset:e.scrollTop}function K(e){return e===document.body||e===document.documentElement||e===window}function H({overflow:e,overflowX:t,overflowY:n}){return q.test(`${e}${t}${n}`)}function U(e){let t=getComputedStyle(e);const n=document.documentElement,o="absolute"===t.position;if("fixed"===t.position)return n;for(let n=e;n=null===(r=n)||void 0===r?void 0:r.parentElement;){var r;if(t=getComputedStyle(n),(!o||"static"!==t.position)&&H(t))return n}return n}function Y(e,t,n=300,o){let r=0;const i=W(e),a=t-i;requestAnimationFrame((function t(){r+=5;const l=a*((s=(s=r)/n-1)*s*s+1)+i;var s;!function(e,t){K(e)?window.scrollTo(0,t):e.scrollTop=t}(e,l),r<n?requestAnimationFrame(t):null==o||o()}))}const _={color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:n.css([""," 1.19s ease-in-out infinite"],E),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 0.9375rem",clear:{width:"14px",height:"16px",animation:I,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",boxShadow:"0 0 0 0.2rem",padding:"0.375rem 0.75rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:I,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},placeholder:{animation:I},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:I,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:"#808080",transition:"color 0.2s ease-out, transform 0.2s ease-out, z-index 0.2s ease-out"}}},X="undefined"!=typeof window&&"ontouchstart"in window||"undefined"!=typeof navigator&&!!navigator.maxTouchPoints,G="undefined"!=typeof navigator&&/(MSIE|Trident\/|Edge\/)/i.test(navigator.userAgent),J=(e,n)=>{const o=t.useRef(!0);t.useEffect((()=>{if(!o.current)return e();o.current=!1}),n)};function Q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ee=(e,n,o,r,i,a,l,s,c=!1,d=!1,u=!1,p=!1,f)=>{const[m,g]=t.useState(L),h=p?"":n,b=P(f)?f:u;return t.useEffect((()=>{const{current:t}=l,{current:n}=s,u=A(h,c,d),p=r.length?new Set(r.map((e=>e.value))):void 0,f=e=>{const r=i(e),l=Z(Z({data:e,value:r,label:a(e)},t(e)&&{isDisabled:!0}),(null==p?void 0:p.has(r))&&{isSelected:!0});if(!(u&&!(e=>{const t=A(n(e),c,d);return o===y?t.indexOf(u)>-1:t.substr(0,u.length)===u})(l)||b&&l.isSelected))return l},m=e.reduce(((e,t)=>{const n=f(t);return n&&e.push(n),e}),[]);g(m)}),[e,h,i,a,r,o,c,d,l,s,b]),m},te=(e,n)=>{const o=t.useRef(e||n);return t.useEffect((()=>{o.current=e||n}),[e,n]),o},ne=(e,n,o,r,i,a,l,s,c,d,u,p)=>{const f=t.useRef(!1),m=t.useRef(!s),[b,y]=t.useState(a),[v,w]=t.useState(!1);t.useEffect((()=>{m.current=!v&&!s}),[v,s]),t.useEffect((()=>{const t=r===g||r===h&&!(e=>{if(!e)return!0;const t=U(e),{top:n,height:o}=e.getBoundingClientRect(),{height:r}=t.getBoundingClientRect();return r-W(t)-n>=o})(e.current);w(t)}),[e,r]),J((()=>{if(o){const t=e=>{var t;null===(t=c.current)||void 0===t||t.call(c),e&&(f.current=!0,y(e))};m.current?((e,t,n,o)=>{if(!e)return void o();const{top:r,height:i,bottom:a}=e.getBoundingClientRect(),l=window.innerHeight;if(l-r>=i)return void o();const s=U(e),c=W(s),d=s.getBoundingClientRect().height-c-r,u=d<i;if(u||!n)return void o(u?d:void 0);const p=getComputedStyle(e).marginBottom;Y(s,a-l+c+parseInt(p,10),t,o)})(e.current,u,p,t):t()}else{var t;null===(t=d.current)||void 0===t||t.call(d),f.current&&(f.current=!1,y(a))}}),[e,o,a,p,u,d,c]);const O=Math.min(b,l*i);return[v?((e,t,n)=>{const o=e>0||!t?e:t.getBoundingClientRect().height,r=n?n.getBoundingClientRect().height:0,i=t&&getComputedStyle(t),a=i?parseInt(i.marginBottom,10):0,l=i?parseInt(i.marginTop,10):0;return`calc(${-Math.abs(o+r)}px + ${a+l}px)`})(O,e.current,n.current):void 0,O]};function oe(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)t.indexOf(n=i[o])>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)t.indexOf(n=i[o])>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}const re=t.memo((({index:e,style:t,data:{menuOptions:n,selectOption:o,renderOptionLabel:r,focusedOptionIndex:i}})=>{const{data:l,value:s,label:d,isDisabled:u,isSelected:p}=n[e],f=function(e,t,n){let o=c;return e&&(o+=" rfs-option-disabled"),t&&(o+=" rfs-option-selected"),n&&(o+=" rfs-option-focused"),o}(u,p,e===i);return a.default.createElement("div",{style:t,onClick:u?void 0:()=>o({data:l,value:s,label:d},p),className:f},r(l))}),o.areEqual);re.displayName="Option";const ie=l.default.div.withConfig({displayName:"NoOptionsMsg",componentId:"v1y124-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(({theme:e})=>e.noOptions.color),(({theme:e})=>e.noOptions.margin),(({theme:e})=>e.noOptions.padding),(({theme:e})=>e.noOptions.fontSize),(({theme:e})=>e.noOptions.css)),ae=({width:e,height:n,itemSize:r,direction:i,isLoading:l,loadingMsg:s,menuOptions:c,selectOption:d,noOptionsMsg:u,overscanCount:p,itemKeySelector:f,fixedSizeListRef:m,renderOptionLabel:g,focusedOptionIndex:h})=>{const b=t.useMemo((()=>({menuOptions:c,selectOption:d,renderOptionLabel:g,focusedOptionIndex:h})),[c,h,d,g]);if(l)return a.default.createElement(ie,null,s);return a.default.createElement(t.Fragment,null,a.default.createElement(o.FixedSizeList,{width:e,height:n,itemKey:f?(e,t)=>t.menuOptions[e][f]:void 0,itemSize:r,itemData:b,direction:i,ref:m,overscanCount:p,itemCount:c.length},re),!T(c)&&u&&a.default.createElement(ie,null,u))},le=l.default.div.withConfig({displayName:"MenuWrapper",componentId:"yf5myu-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;will-change:top,color,background-color;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(({menuTop:e,menuOpen:t,hideNoOptionsMsg:o,theme:{menu:r}})=>n.css(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],r.width,r.margin,r.padding,r.animation,r.borderRadius,r.backgroundColor,o?"none":r.boxShadow,t?"":"display: none;",e?`top: ${e};`:"")),(({theme:e})=>e.menu.css),c,(({theme:e})=>e.menu.option.padding),(({theme:e})=>e.menu.option.textAlign),d,p,u,(({theme:e})=>e.menu.option.focusedBgColor),u,(({theme:e})=>e.menu.option.selectedColor),(({theme:e})=>e.menu.option.selectedBgColor),p),se=e=>{let{menuRef:t,menuTop:n,menuOpen:o,onMenuMouseDown:i,menuPortalTarget:l}=e,s=oe(e,["menuRef","menuTop","menuOpen","onMenuMouseDown","menuPortalTarget"]);const{menuOptions:c,noOptionsMsg:d}=s,u=o&&!Boolean(d)&&!T(c),p=a.default.createElement(le,{ref:t,menuTop:n,menuOpen:o,onMouseDown:i,className:"rfs-menu-container","data-testid":undefined,hideNoOptionsMsg:u},a.default.createElement(ae,Object.assign({},s)));return l?r.createPortal(p,l):p},ce=n.css(["z-index:5000;transform:scale(1.26);color:",";"],(({theme:e})=>e.multiValue.clear.focusColor)),de=l.default.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-211cx7-0"})(["min-width:0;display:flex;"," ",""],(({theme:{multiValue:e}})=>n.css(["margin:",";animation:",";border-radius:",";background-color:",";"],e.margin,e.animation,e.borderRadius,e.backgroundColor)),(({theme:e})=>e.multiValue.css)),ue=l.default.div.withConfig({displayName:"Label",componentId:"sc-211cx7-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(({theme:e})=>e.multiValue.label.padding),(({theme:e})=>e.multiValue.label.fontSize),(({theme:e})=>e.multiValue.label.borderRadius)),pe=l.default.i.withConfig({displayName:"Clear",componentId:"sc-211cx7-2"})(["display:flex;font-style:inherit;"," ",""],(({theme:{multiValue:{clear:e}}})=>n.css(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";:hover{","}"],e.color,e.padding,e.fontSize,e.alignSelf,e.transition,e.fontWeight,ce)),(({isFocused:e})=>e&&ce)),fe=t.memo((({data:e,value:t,isFocused:n,renderOptionLabel:o,removeSelectedOption:r})=>{const i=()=>r(t);return a.default.createElement(de,null,a.default.createElement(ue,null,o(e)),a.default.createElement(pe,{isFocused:n,onClick:i,onTouchEnd:i,onMouseDown:V,"data-testid":undefined},"✖"))}));fe.displayName="MultiValue";const me=n.css(["top:50%;overflow:hidden;position:absolute;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;transform:translateY(-50%);"]),ge=l.default.div.withConfig({displayName:"SingleValue",componentId:"sc-153h0ct-0"})([""," max-width:calc(100% - 0.5rem);"],me),he=l.default.div.withConfig({displayName:"Placeholder",componentId:"sc-153h0ct-1"})([""," color:",";",""],me,(({theme:e})=>e.color.placeholder),(({theme:e,isFirstRender:t})=>!t&&n.css(["animation:",";"],e.placeholder.animation))),be=t.memo((({isMulti:e,inputValue:n,placeholder:o,selectedOption:r,focusedMultiValue:i,renderOptionLabel:l,renderMultiOptions:s,removeSelectedOption:c})=>{const d=(()=>{const e=t.useRef(!0);return e.current?(e.current=!1,!0):e.current})(),u=!T(r);return n&&(!e||e&&(u||s))?null:u?a.default.createElement(he,{isFirstRender:d},o):e?a.default.createElement(t.Fragment,null,s?s({renderOptionLabel:l,selected:r}):r.map((({data:e,value:t})=>a.default.createElement(fe,{key:t,data:e,value:t,renderOptionLabel:l,isFocused:t===i,removeSelectedOption:c})))):a.default.createElement(ge,null,l(r[0].data))}));be.displayName="Value";const ye=l.default.div.withConfig({displayName:"SizerDiv",componentId:"o2ype2-0"})(["top:0;left:0;height:0;overflow:scroll;white-space:pre;position:absolute;visibility:hidden;font-size:inherit;font-weight:inherit;font-family:inherit;",""],(({theme:e})=>e.input.css)),ve=l.default.input.attrs(m).withConfig({displayName:"Input",componentId:"o2ype2-1"})(["border:0;outline:0;padding:0;cursor:text;background:0;color:inherit;font-size:inherit;font-weight:inherit;font-family:inherit;box-sizing:content-box;:read-only{opacity:0;cursor:default;}:required{","}"," ",""],(({theme:e,isInvalid:t})=>t&&e.input.cssRequired),(({theme:e})=>e.input.css),G&&"::-ms-clear{display:none;}"),we=t.memo(t.forwardRef((({id:e,onBlur:n,onFocus:o,readOnly:r,required:i,onChange:l,ariaLabel:s,inputValue:c,ariaLabelledBy:d,hasSelectedOptions:u},p)=>{const f=t.useRef(null),[m,g]=t.useState(2),h=!!i&&!u;return J((()=>{f.current&&g(f.current.scrollWidth+2)}),[c]),a.default.createElement(t.Fragment,null,a.default.createElement(ve,{id:e,ref:p,isInvalid:!0,onBlur:n,onFocus:o,value:c,readOnly:r,required:h,"aria-label":s,style:{width:m},"aria-labelledby":d,onChange:r?void 0:l}),a.default.createElement(ye,{ref:f},c))})));we.displayName="AutosizeInput";const Oe=l.default.span.withConfig({displayName:"A11yText",componentId:"zxgkbx-0"})(["border:0;padding:0;width:1px;height:1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(1px,1px,1px,1px);"]),xe=({menuOpen:e,isFocused:t,inputValue:n,optionCount:o,isSearchable:r,focusedOption:i,selectedOption:l,ariaLive:s="polite",ariaLabel:c="Select"})=>{if(!t)return null;const d=` ${o} result(s) available${n?" for search input "+n:""}.`,u=e?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":`${c} is focused${r?", type to filter options":""}, press Down arrow key to open the menu.`,{index:p,value:f,label:m,isDisabled:g}=i,h=f?`Focused option: ${m}${g?" - disabled":""}, ${p+1} of ${o}.`:"",b="Selected option: "+(l.length?l.map((e=>e.label)).join(" "):"N/A"),y=`${h} ${d} ${u}`.trimStart();return a.default.createElement(Oe,{"aria-atomic":"false","aria-live":s,"aria-relevant":"additions text"},a.default.createElement("span",{id:"aria-selection"},b),a.default.createElement("span",{id:"aria-context"},y))},Ce=l.default.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1j9e0pa-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;",":nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(({theme:e})=>e.loader.padding),(({theme:{loader:e}})=>n.css(["width:",";height:",";animation:",";background-color:",";"],e.size,e.size,e.animation,e.color))),Se=()=>a.default.createElement(Ce,{"aria-hidden":!0,className:"rfs-loading-dots"},a.default.createElement("div",null),a.default.createElement("div",null),a.default.createElement("div",null)),Ee=l.default.svg.withConfig({displayName:"ClearSvg",componentId:"sc-1v5ipi2-0"})(["fill:currentColor;",""],(({theme:e})=>n.css(["width:",";height:",";animation:",";transition:",";"],e.icon.clear.width,e.icon.clear.height,e.icon.clear.animation,e.icon.clear.transition))),Ie=()=>a.default.createElement(Ee,{"aria-hidden":!0,viewBox:"0 0 14 16",className:"rfs-clear-icon"},a.default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})),ke=l.default.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1561oeb-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),Me=l.default.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1561oeb-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(({theme:e})=>e.icon.color),(({theme:e})=>e.icon.padding),(({theme:e})=>e.icon.hoverColor),(({theme:e})=>e.icon.css)),De=l.default.div.withConfig({displayName:"Caret",componentId:"sc-1561oeb-2"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(({theme:e})=>e.icon.caret.transition),(({theme:e})=>e.icon.caret.size),(({theme:e})=>e.icon.caret.size),(({theme:e})=>e.icon.caret.size),(({theme:e,menuOpen:t,isInvalid:o})=>t&&n.css(["transform:rotate(180deg);color:",";"],o?e.color.danger:e.color.caretActive||e.color.primary))),je=l.default.div.withConfig({displayName:"Separator",componentId:"sc-1561oeb-3"})(["width:1px;margin:0.5rem 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(({theme:e})=>e.color.iconSeparator||e.color.border)),ze=t.memo((({menuOpen:e,clearIcon:t,caretIcon:n,isInvalid:o,showClear:r,isLoading:i,isDisabled:l,loadingNode:s,onCaretMouseDown:c,onClearMouseDown:d})=>{const u=t=>"function"==typeof t?t({menuOpen:e,isLoading:i,isInvalid:o,isDisabled:l}):t;return a.default.createElement(ke,null,r&&!i&&a.default.createElement(Me,{onTouchEnd:d,onMouseDown:d,"data-testid":undefined},u(t)||a.default.createElement(Ie,null)),i&&(s||a.default.createElement(Se,null)),a.default.createElement(je,null),a.default.createElement(Me,{onTouchEnd:c,onMouseDown:c,"data-testid":undefined},u(n)||a.default.createElement(De,{"aria-hidden":!0,menuOpen:e,isInvalid:o,className:"rfs-caret-icon"})))}));function Le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Ne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}ze.displayName="IndicatorIcons";const Re=l.default.div.attrs(f).withConfig({displayName:"SelectWrapper",componentId:"kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(({theme:e})=>e.select.css)),Pe=l.default.div.withConfig({displayName:"ValueWrapper",componentId:"kcrmu9-1"})(["flex:1 1 0%;display:flex;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;padding:",";"],(({theme:e})=>e.control.padding)),Te=l.default.div.withConfig({displayName:"ControlWrapper",componentId:"kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;will-change:box-shadow,border-color;"," "," ",""],(({isDisabled:e,isFocused:t,isInvalid:o,theme:{control:r,color:i}})=>n.css(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],r.transition,r.borderStyle,r.borderWidth,r.borderRadius,r.height||r.minHeight,o?i.danger:t?r.focusedBorderColor:i.border,r.height?`height: ${r.height};`:"",e?"pointer-events:none;user-select:none;":"",r.backgroundColor||e?`background-color: ${e?i.disabled:r.backgroundColor};`:"",t?`box-shadow: ${r.boxShadow} ${o?i.dangerLight:r.boxShadowColor};`:"")),(({theme:e})=>e.control.css),(({isFocused:e,theme:t})=>e&&t.control.focusedCss)),Fe=t.forwardRef((({async:e,isMulti:o,inputId:r,selectId:i,required:l,ariaLive:s,autoFocus:c,isLoading:d,onKeyDown:u,clearIcon:p,caretIcon:f,isInvalid:m,ariaLabel:g,menuWidth:h,isDisabled:E,inputDelay:I,onMenuOpen:N,onMenuClose:R,onInputBlur:A,isClearable:q,themeConfig:W,loadingNode:K,initialValue:H,onInputFocus:U,onInputChange:Y,ariaLabelledBy:G,onOptionChange:Q,onSearchChange:Z,getOptionLabel:oe,getOptionValue:re,itemKeySelector:ie,openMenuOnFocus:ae,menuPortalTarget:le,isAriaLiveEnabled:ce,menuOverscanCount:de,blurInputOnSelect:ue,menuItemDirection:pe,renderOptionLabel:fe,renderMultiOptions:me,menuScrollDuration:ge,filterIgnoreAccents:he,hideSelectedOptions:ye,getIsOptionDisabled:ve,getFilterOptionString:Oe,isSearchable:Ce=!0,lazyLoadMenu:Se=!1,openMenuOnClick:Ee=!0,filterIgnoreCase:Ie=!0,tabSelectsOption:ke=!0,closeMenuOnSelect:Me=!0,scrollMenuIntoView:De=!0,backspaceClearsValue:je=!0,filterMatchFrom:Le=y,menuPosition:Fe=b,options:Ve=L,loadingMsg:Ae="Loading..",placeholder:Be="Select option..",noOptionsMsg:$e="No options",menuItemSize:qe=35,menuMaxHeight:We=300},Ke)=>{const He=t.useRef(!1),Ue=t.useRef(),Ye=t.useRef(!1),_e=t.useRef(null),Xe=t.useRef(null),Ge=t.useRef(null),Je=t.useRef(null),[Qe,Ze]=t.useState(""),[et,tt]=t.useState(!1),[nt,ot]=t.useState(!1),[rt,it]=t.useState(null),[at,lt]=t.useState(k),st=t.useMemo((()=>(e=>e&&F(e)?$(_,e):_)(W)),[W]),ct=te(N),dt=te(R),ut=te(Z),pt=te(Q),ft=te(ve,j),mt=te(Oe,z),gt=t.useMemo((()=>oe||M),[oe]),ht=t.useMemo((()=>re||D),[re]),bt=t.useMemo((()=>fe||gt),[fe,gt]),yt=((e,n=0)=>{const[o,r]=t.useState(e);return J((()=>{if(n<=0)return;const t=setTimeout((()=>{r(e)}),n);return()=>{clearTimeout(t)}}),[e,n]),n<=0?e:o})(Qe,I),[vt,wt]=t.useState((()=>B(H,ht,gt))),Ot=ee(Ve,yt,Le,vt,ht,gt,ft,mt,Ie,he,o,e,ye),[xt,Ct]=ne(Xe,Je,et,Fe,qe,We,Ot.length,!!le,ct,dt,ge,De),St=()=>{var e;return null===(e=Ge.current)||void 0===e?void 0:e.blur()},Et=()=>{var e;return null===(e=Ge.current)||void 0===e?void 0:e.focus()},It=e=>{var t;return null===(t=_e.current)||void 0===t?void 0:t.scrollToItem(e)},kt=T(vt),Mt=P(ue)?ue:X,Dt=t.useCallback((e=>{if(!T(Ot))return void(!He.current&&tt(!0));const t=o?-1:Ot.findIndex((e=>e.isSelected)),n=t>-1?t:e===S?0:Ot.length-1;!He.current&&tt(!0),lt(Ne({index:n},Ot[n])),It(n)}),[o,Ot]),jt=t.useCallback((e=>{wt((t=>t.filter((t=>t.value!==e))))}),[]),zt=t.useCallback(((e,t)=>{t?o&&jt(e.value):wt((t=>o?[...t,e]:[e])),Mt?St():Me&&(tt(!1),Ze(""))}),[o,Me,jt,Mt]);t.useImperativeHandle(Ke,(()=>({empty:!kt,menuOpen:He.current,blur:St,focus:Et,clearValue:()=>{wt(L),lt(k)},setValue:e=>{const t=B(e,ht,gt);wt(t)},toggleMenu:e=>{!0===e||void 0===e&&!He.current?(Et(),Dt(S)):St()}})),[kt,ht,gt,Dt]),t.useEffect((()=>{c&&Et()}),[]),t.useEffect((()=>{He.current=et}),[et]),t.useEffect((()=>{nt&&ae&&Dt(S)}),[nt,ae,Dt]),t.useEffect((()=>{const{current:e}=ut;e&&Ye.current&&(Ye.current=!1,e(yt))}),[yt]),J((()=>{const{current:e}=pt;if(e){e(o?vt.map((e=>e.data)):T(vt)?vt[0].data:null)}}),[o,vt]),J((()=>{const{length:t}=Ot,n=t>0&&(e||t!==Ve.length||0===Ue.current);0===t?lt(k):(1===t||n)&&(lt(Ne({index:0},Ot[0])),It(0)),Ue.current=t}),[e,Ve,Ot]);const Lt=()=>{const{data:e,value:t,label:n,isSelected:o,isDisabled:r}=at;e&&!r&&zt({data:e,value:t,label:n},o)},Nt=e=>{const t="ArrowDown"===e,n=t?S:C;et?(e=>{if(!T(Ot))return;const t=e===x?(at.index+1)%Ot.length:at.index>0?at.index-1:Ot.length-1;rt&&it(null),lt(Ne({index:t},Ot[t])),It(t)})(t?x:O):Dt(n)},Rt=e=>{if(E)return;nt||Et();const t="INPUT"!==e.target.nodeName;et?t&&(et&&tt(!1),Qe&&Ze("")):Ee&&Dt(S),t&&e.preventDefault()},Pt=t.useCallback((e=>{null==A||A(e),ot(!1),tt(!1),Ze("")}),[A]),Tt=t.useCallback((e=>{null==U||U(e),ot(!0)}),[U]),Ft=t.useCallback((e=>{Ye.current=!0;const t=e.currentTarget.value||"";null==Y||Y(t),Ze(t),!He.current&&tt(!0)}),[Y]),Vt=t.useCallback((e=>{Et(),He.current?tt(!1):Dt(S),V(e)}),[Dt]),At=t.useCallback((e=>{Et(),wt(L),V(e)}),[]),Bt=!Se||Se&&et,$t=!(!q||E||!kt),qt=E||!Ce||!!rt,Wt=E||Ee?void 0:Vt;return a.default.createElement(n.ThemeProvider,{theme:st},a.default.createElement(Re,{id:i,"aria-controls":r,"aria-expanded":et,onKeyDown:e=>{if(!(E||u&&(u(e,Qe,at),e.defaultPrevented))){switch(e.key){case"ArrowDown":case"ArrowUp":Nt(e.key);break;case"ArrowLeft":case"ArrowRight":if(!o||Qe||me)return;(e=>{if(!kt)return;let t=-1;const n=vt.length-1,o=rt?vt.findIndex((e=>e.value===rt)):-1;t=e===v?o>-1&&o<n?o+1:-1:0!==o?-1===o?n:o-1:0;const r=t>=0?vt[t].value:null;at.data&&lt(k),r!==rt&&it(r)})("ArrowLeft"===e.key?w:v);break;case" ":if(Qe)return;if(et){if(!at.data)return;Lt()}else Dt(S);break;case"Enter":et&&229!==e.keyCode&&Lt();break;case"Escape":et&&(tt(!1),Ze(""));break;case"Tab":if(!et||!ke||!at.data||e.shiftKey)return;Lt();break;case"Delete":case"Backspace":if(Qe)return;if(rt){const e=vt.findIndex((e=>e.value===rt)),t=e>-1&&e<vt.length-1?vt[e+1].value:null;jt(rt),it(t)}else{if(!je)return;if(!kt)break;if(o&&!me){const{value:e}=vt[vt.length-1];jt(e)}else q&&wt(L)}break;default:return}e.preventDefault()}}},a.default.createElement(Te,{ref:Je,isInvalid:m,isFocused:nt,isDisabled:E,className:"rfs-control-container",onTouchEnd:Rt,onMouseDown:Rt,"data-testid":undefined},a.default.createElement(Pe,null,a.default.createElement(be,{isMulti:o,inputValue:Qe,placeholder:Be,selectedOption:vt,focusedMultiValue:rt,renderMultiOptions:me,renderOptionLabel:bt,removeSelectedOption:jt}),a.default.createElement(we,{id:r,ref:Ge,required:l,ariaLabel:g,inputValue:Qe,readOnly:qt,onBlur:Pt,onFocus:Tt,onChange:Ft,ariaLabelledBy:G,hasSelectedOptions:kt})),a.default.createElement(ze,{menuOpen:et,clearIcon:p,caretIcon:f,isInvalid:m,isLoading:d,showClear:$t,isDisabled:E,loadingNode:K,onClearMouseDown:At,onCaretMouseDown:Wt})),Bt&&a.default.createElement(se,{menuRef:Xe,menuOpen:et,isLoading:d,menuTop:xt,height:Ct,itemSize:qe,loadingMsg:Ae,menuOptions:Ot,fixedSizeListRef:_e,noOptionsMsg:$e,selectOption:zt,direction:pe,itemKeySelector:ie,overscanCount:de,menuPortalTarget:le,width:h||st.menu.width,onMenuMouseDown:e=>{V(e),Et()},renderOptionLabel:bt,focusedOptionIndex:at.index}),ce&&a.default.createElement(xe,{ariaLive:s,menuOpen:et,isFocused:nt,ariaLabel:g,inputValue:Qe,isSearchable:Ce,focusedOption:at,selectedOption:vt,optionCount:Ot.length})))}));Fe.displayName="Select",e.Select=Fe,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("styled-components"),require("react-window"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","styled-components","react-window","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactFunctionalSelect={},e.React,e.styled,e.ReactWindow,e.ReactDOM)}(this,(function(e,t,n,o,r){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=i(t),l=i(n);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c="rfs-option",u="rfs-option-focused",d="rfs-option-selected",p="rfs-option-disabled",f={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container","data-testid":undefined},m={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input","data-testid":undefined},g="top",h="auto",b="bottom",y="any",v=0,w=1,O=0,x=1,C=2,S=3,E=n.keyframes(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),I=n.css([""," 0.25s ease-in-out"],n.keyframes(["from{opacity:0;}to{opacity:1;}"])),k={index:-1},M=e=>e.label,D=e=>e.value,z=e=>!!e.isDisabled,j=({label:e})=>"string"==typeof e?e:`${e}`,R=[];function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}const N=/[\u0300-\u036f]/g;function P(e){return"boolean"==typeof e}function T(e){return"function"==typeof e}function F(e){return Array.isArray(e)&&!!e.length}function V(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}const A=e=>{e.preventDefault(),e.stopPropagation()};function B(e,t,n){let o=e.trim();return t&&(o=o.toLowerCase()),n?function(e){return e.normalize("NFD").replace(N,"")}(o):o}const $=(e,t,n)=>{const o=Array.isArray(e)?e:V(e)?[e]:R;return F(o)?o.map((e=>({data:e,value:t(e),label:n(e)}))):o},q=(e,t)=>{const n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);return Object.keys(t).forEach((o=>{const r=t[o];n[o]="animation"!==o&&V(r)?e[o]?q(e[o],r):r:r||""})),n},W=/(auto|scroll)/;function K(e){return H(e)?window.pageYOffset:e.scrollTop}function H(e){return e===document.body||e===document.documentElement||e===window}function U({overflow:e,overflowX:t,overflowY:n}){return W.test(`${e}${t}${n}`)}function Y(e){let t=getComputedStyle(e);const n=document.documentElement,o="absolute"===t.position;if("fixed"===t.position)return n;for(let n=e;n=null===(r=n)||void 0===r?void 0:r.parentElement;){var r;if(t=getComputedStyle(n),(!o||"static"!==t.position)&&U(t))return n}return n}function _(e,t,n=300,o){let r=0;const i=K(e),a=t-i;requestAnimationFrame((function t(){r+=5;const l=a*((s=(s=r)/n-1)*s*s+1)+i;var s;!function(e,t){H(e)?window.scrollTo(0,t):e.scrollTop=t}(e,l),r<n?requestAnimationFrame(t):null==o||o()}))}const X={color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:n.css([""," 1.19s ease-in-out infinite"],E),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 0.9375rem",clear:{width:"14px",height:"16px",animation:I,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",boxShadow:"0 0 0 0.2rem",padding:"0.375rem 0.75rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:I,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},placeholder:{animation:I},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:I,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:"#808080",transition:"color 0.2s ease-out, transform 0.2s ease-out, z-index 0.2s ease-out"}}},G="undefined"!=typeof window&&"ontouchstart"in window||"undefined"!=typeof navigator&&!!navigator.maxTouchPoints,J="undefined"!=typeof navigator&&/(MSIE|Trident\/|Edge\/)/i.test(navigator.userAgent),Q=(e,n)=>{const o=t.useRef(!0);t.useEffect((()=>{if(!o.current)return e();o.current=!1}),n)};function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const te=(e,n,o,r,i,a,l,s,c=!1,u=!1,d=!1,p=!1,f)=>{const[m,g]=t.useState(R),h=p?"":n,b=P(f)?f:d;return t.useEffect((()=>{const t=o===y,n=B(h,c,u),d=r.length?new Set(r.map((e=>e.value))):void 0,p=e=>{const o=i(e),r=ee(ee({data:e,value:o,label:a(e)},l(e)&&{isDisabled:!0}),(null==d?void 0:d.has(o))&&{isSelected:!0});if(!(n&&!(e=>{const o=B(s(e),c,u);return t?o.indexOf(n)>-1:o.substr(0,n.length)===n})(r)||b&&r.isSelected))return r},f=e.reduce(((e,t)=>{const n=p(t);return n&&e.push(n),e}),[]);g(f)}),[e,h,i,a,r,o,c,u,l,s,b]),m},ne=e=>{const n=t.useRef(e);return t.useEffect((()=>{n.current=e})),t.useCallback(((...e)=>{var t;return null===(t=n.current)||void 0===t?void 0:t.call(n,...e)}),[])},oe=(e,n,o,r,i,a,l,s,c,u,d,p)=>{const f=t.useRef(!1),m=t.useRef(!s),[b,y]=t.useState(a),[v,w]=t.useState(!1);t.useEffect((()=>{m.current=!v&&!s}),[v,s]),t.useEffect((()=>{const t=r===g||r===h&&!(e=>{if(!e)return!0;const t=Y(e),{top:n,height:o}=e.getBoundingClientRect(),{height:r}=t.getBoundingClientRect();return r-K(t)-n>=o})(e.current);w(t)}),[e,r]),Q((()=>{if(o){const t=e=>{c(),e&&(f.current=!0,y(e))};m.current?((e,t,n,o)=>{if(!e)return void o();const{top:r,height:i,bottom:a}=e.getBoundingClientRect(),l=window.innerHeight;if(l-r>=i)return void o();const s=Y(e),c=K(s),u=s.getBoundingClientRect().height-c-r,d=u<i;if(d||!n)return void o(d?u:void 0);const p=getComputedStyle(e).marginBottom;_(s,a-l+c+parseInt(p,10),t,o)})(e.current,d,p,t):t()}else u(),f.current&&(f.current=!1,y(a))}),[e,o,a,p,d,u,c]);const O=Math.min(b,l*i);return[v?((e,t,n)=>{const o=e>0||!t?e:t.getBoundingClientRect().height,r=n?n.getBoundingClientRect().height:0,i=t&&getComputedStyle(t),a=i?parseInt(i.marginBottom,10):0,l=i?parseInt(i.marginTop,10):0;return`calc(${-Math.abs(o+r)}px + ${a+l}px)`})(O,e.current,n.current):void 0,O]};function re(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)t.indexOf(n=i[o])>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)t.indexOf(n=i[o])>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}const ie=t.memo((({index:e,style:t,data:{menuOptions:n,selectOption:o,renderOptionLabel:r,focusedOptionIndex:i}})=>{const{data:l,value:s,label:u,isDisabled:d,isSelected:p}=n[e],f=function(e,t,n){let o=c;return e&&(o+=" rfs-option-disabled"),t&&(o+=" rfs-option-selected"),n&&(o+=" rfs-option-focused"),o}(d,p,e===i);return a.default.createElement("div",{style:t,onClick:d?void 0:()=>o({data:l,value:s,label:u},p),className:f},r(l))}),o.areEqual);ie.displayName="Option";const ae=l.default.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(({theme:e})=>e.noOptions.color),(({theme:e})=>e.noOptions.margin),(({theme:e})=>e.noOptions.padding),(({theme:e})=>e.noOptions.fontSize),(({theme:e})=>e.noOptions.css)),le=({width:e,height:n,itemSize:r,direction:i,isLoading:l,loadingMsg:s,menuOptions:c,selectOption:u,noOptionsMsg:d,overscanCount:p,itemKeySelector:f,fixedSizeListRef:m,renderOptionLabel:g,focusedOptionIndex:h})=>{const b=t.useMemo((()=>({menuOptions:c,selectOption:u,renderOptionLabel:g,focusedOptionIndex:h})),[c,h,u,g]);if(l)return a.default.createElement(ae,null,s);return a.default.createElement(t.Fragment,null,a.default.createElement(o.FixedSizeList,{width:e,height:n,itemKey:f?(e,t)=>t.menuOptions[e][f]:void 0,itemSize:r,itemData:b,direction:i,ref:m,overscanCount:p,itemCount:c.length},ie),!F(c)&&d&&a.default.createElement(ae,null,d))},se=l.default.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;will-change:top,color,background-color;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(({menuTop:e,menuOpen:t,hideNoOptionsMsg:o,theme:{menu:r}})=>n.css(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],r.width,r.margin,r.padding,r.animation,r.borderRadius,r.backgroundColor,o?"none":r.boxShadow,t?"":"display: none;",e?`top: ${e};`:"")),(({theme:e})=>e.menu.css),c,(({theme:e})=>e.menu.option.padding),(({theme:e})=>e.menu.option.textAlign),u,p,d,(({theme:e})=>e.menu.option.focusedBgColor),d,(({theme:e})=>e.menu.option.selectedColor),(({theme:e})=>e.menu.option.selectedBgColor),p),ce=e=>{let{menuRef:t,menuTop:n,menuOpen:o,onMenuMouseDown:i,menuPortalTarget:l}=e,s=re(e,["menuRef","menuTop","menuOpen","onMenuMouseDown","menuPortalTarget"]);const{menuOptions:c,noOptionsMsg:u}=s,d=o&&!Boolean(u)&&!F(c),p=a.default.createElement(se,{ref:t,menuTop:n,menuOpen:o,onMouseDown:i,className:"rfs-menu-container","data-testid":undefined,hideNoOptionsMsg:d},a.default.createElement(le,Object.assign({},s)));return l?r.createPortal(p,l):p},ue=n.css(["z-index:5000;transform:scale(1.26);color:",";"],(({theme:e})=>e.multiValue.clear.focusColor)),de=l.default.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(({theme:{multiValue:e}})=>n.css(["margin:",";animation:",";border-radius:",";background-color:",";"],e.margin,e.animation,e.borderRadius,e.backgroundColor)),(({theme:e})=>e.multiValue.css)),pe=l.default.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(({theme:e})=>e.multiValue.label.padding),(({theme:e})=>e.multiValue.label.fontSize),(({theme:e})=>e.multiValue.label.borderRadius)),fe=l.default.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(({theme:{multiValue:{clear:e}}})=>n.css(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";:hover{","}"],e.color,e.padding,e.fontSize,e.alignSelf,e.transition,e.fontWeight,ue)),(({isFocused:e})=>e&&ue)),me=t.memo((({data:e,value:t,isFocused:n,renderOptionLabel:o,removeSelectedOption:r})=>{const i=()=>r(t);return a.default.createElement(de,null,a.default.createElement(pe,null,o(e)),a.default.createElement(fe,{isFocused:n,onClick:i,onTouchEnd:i,onMouseDown:A,"data-testid":undefined},"✖"))}));me.displayName="MultiValue";const ge=n.css(["top:50%;overflow:hidden;position:absolute;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;transform:translateY(-50%);"]),he=l.default.div.withConfig({displayName:"SingleValue",componentId:"us7kwl-0"})([""," max-width:calc(100% - 0.5rem);"],ge),be=l.default.div.withConfig({displayName:"Placeholder",componentId:"us7kwl-1"})([""," color:",";",""],ge,(({theme:e})=>e.color.placeholder),(({theme:e,isFirstRender:t})=>!t&&n.css(["animation:",";"],e.placeholder.animation))),ye=t.memo((({isMulti:e,inputValue:n,placeholder:o,selectedOption:r,focusedMultiValue:i,renderOptionLabel:l,renderMultiOptions:s,removeSelectedOption:c})=>{const u=(()=>{const e=t.useRef(!0);return e.current?(e.current=!1,!0):e.current})(),d=!F(r);return n&&(!e||e&&(d||s))?null:d?a.default.createElement(be,{isFirstRender:u},o):e?a.default.createElement(t.Fragment,null,s?s({renderOptionLabel:l,selected:r}):r.map((({data:e,value:t})=>a.default.createElement(me,{key:t,data:e,value:t,renderOptionLabel:l,isFocused:t===i,removeSelectedOption:c})))):a.default.createElement(he,null,l(r[0].data))}));ye.displayName="Value";const ve=l.default.div.withConfig({displayName:"SizerDiv",componentId:"sc-4er7q8-0"})(["top:0;left:0;height:0;overflow:scroll;white-space:pre;position:absolute;visibility:hidden;font-size:inherit;font-weight:inherit;font-family:inherit;",""],(({theme:e})=>e.input.css)),we=l.default.input.attrs(m).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["border:0;outline:0;padding:0;cursor:text;background:0;color:inherit;font-size:inherit;font-weight:inherit;font-family:inherit;box-sizing:content-box;:read-only{opacity:0;cursor:default;}:required{","}"," ",""],(({theme:e,isInvalid:t})=>t&&e.input.cssRequired),(({theme:e})=>e.input.css),J&&"::-ms-clear{display:none;}"),Oe=t.memo(t.forwardRef((({id:e,onBlur:n,onFocus:o,readOnly:r,required:i,onChange:l,ariaLabel:s,inputValue:c,ariaLabelledBy:u,hasSelectedOptions:d},p)=>{const f=t.useRef(null),[m,g]=t.useState(2),h=!!i&&!d;return Q((()=>{f.current&&g(f.current.scrollWidth+2)}),[c]),a.default.createElement(t.Fragment,null,a.default.createElement(we,{id:e,ref:p,isInvalid:!0,onBlur:n,onFocus:o,value:c,readOnly:r,required:h,"aria-label":s,style:{width:m},"aria-labelledby":u,onChange:r?void 0:l}),a.default.createElement(ve,{ref:f},c))})));Oe.displayName="AutosizeInput";const xe=l.default.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;margin:-1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(0,0,0,0);"]),Ce=({menuOpen:e,isFocused:t,inputValue:n,optionCount:o,isSearchable:r,focusedOption:i,selectedOption:l,ariaLive:s="polite",ariaLabel:c="Select"})=>{if(!t)return null;const u=e?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":`${c} is focused${r?", type to filter options":""}, press Down arrow key to open the menu.`,{index:d,value:p,label:f,isDisabled:m}=i,g=p&&!m?`Option ${f} is focused, ${d+1} of ${o}.`:"",h=`${o} option(s) available${n?" for search "+n:""}.`,b="Selected option: "+(l.length?l.map((e=>e.label)).join(" "):"N/A"),y=`${g} ${h} ${u}`.trimStart();return a.default.createElement(xe,{"aria-atomic":"false","aria-live":s,"aria-relevant":"additions text"},a.default.createElement("span",{id:"aria-selection"},b),a.default.createElement("span",{id:"aria-context"},y))},Se=l.default.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;",":nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(({theme:e})=>e.loader.padding),(({theme:{loader:e}})=>n.css(["width:",";height:",";animation:",";background-color:",";"],e.size,e.size,e.animation,e.color))),Ee=()=>a.default.createElement(Se,{"aria-hidden":!0,className:"rfs-loading-dots"},a.default.createElement("div",null),a.default.createElement("div",null),a.default.createElement("div",null)),Ie=l.default.svg.withConfig({displayName:"ClearSvg",componentId:"kkzaaw-0"})(["fill:currentColor;",""],(({theme:e})=>n.css(["width:",";height:",";animation:",";transition:",";"],e.icon.clear.width,e.icon.clear.height,e.icon.clear.animation,e.icon.clear.transition))),ke=()=>a.default.createElement(Ie,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},a.default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})),Me=l.default.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),De=l.default.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(({theme:e})=>e.icon.color),(({theme:e})=>e.icon.padding),(({theme:e})=>e.icon.hoverColor),(({theme:e})=>e.icon.css)),ze=l.default.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:0.5rem 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(({theme:e})=>e.color.iconSeparator||e.color.border)),je=l.default.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(({theme:e})=>e.icon.caret.transition),(({theme:e})=>e.icon.caret.size),(({theme:e})=>e.icon.caret.size),(({theme:e})=>e.icon.caret.size),(({theme:e,menuOpen:t,isInvalid:o})=>t&&n.css(["transform:rotate(180deg);color:",";"],o?e.color.danger:e.color.caretActive||e.color.primary))),Re=t.memo((({menuOpen:e,clearIcon:t,caretIcon:n,isInvalid:o,showClear:r,isLoading:i,isDisabled:l,loadingNode:s,onCaretMouseDown:c,onClearMouseDown:u})=>{const d=t=>T(t)?t({menuOpen:e,isLoading:i,isInvalid:o,isDisabled:l}):t;return a.default.createElement(Me,null,r&&!i&&a.default.createElement(De,{onTouchEnd:u,onMouseDown:u,"data-testid":undefined},d(t)||a.default.createElement(ke,null)),i&&(s||a.default.createElement(Ee,null)),a.default.createElement(ze,{role:"none"}),a.default.createElement(De,{onTouchEnd:c,onMouseDown:c,"data-testid":undefined},d(n)||a.default.createElement(je,{"aria-hidden":!0,menuOpen:e,isInvalid:o,className:"rfs-caret-icon"})))}));function Le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Ne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Re.displayName="IndicatorIcons";const Pe=l.default.div.attrs(f).withConfig({displayName:"SelectWrapper",componentId:"kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(({theme:e})=>e.select.css)),Te=l.default.div.withConfig({displayName:"ValueWrapper",componentId:"kcrmu9-1"})(["flex:1 1 0%;display:flex;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;padding:",";"],(({theme:e})=>e.control.padding)),Fe=l.default.div.withConfig({displayName:"ControlWrapper",componentId:"kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;will-change:box-shadow,border-color;"," "," ",""],(({isDisabled:e,isFocused:t,isInvalid:o,theme:{control:r,color:i}})=>n.css(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],r.transition,r.borderStyle,r.borderWidth,r.borderRadius,r.height||r.minHeight,o?i.danger:t?r.focusedBorderColor:i.border,r.height?`height: ${r.height};`:"",e?"pointer-events:none;user-select:none;":"",r.backgroundColor||e?`background-color: ${e?i.disabled:r.backgroundColor};`:"",t?`box-shadow: ${r.boxShadow} ${o?i.dangerLight:r.boxShadowColor};`:"")),(({theme:e})=>e.control.css),(({isFocused:e,theme:t})=>e&&t.control.focusedCss)),Ve=t.forwardRef((({async:e,isMulti:o,inputId:r,selectId:i,required:l,ariaLive:s,autoFocus:c,isLoading:u,onKeyDown:d,clearIcon:p,caretIcon:f,isInvalid:m,ariaLabel:g,menuWidth:h,isDisabled:E,inputDelay:I,onMenuOpen:L,onMenuClose:N,onInputBlur:B,isClearable:W,themeConfig:K,loadingNode:H,initialValue:U,onInputFocus:Y,onInputChange:_,ariaLabelledBy:J,onOptionChange:Z,onSearchChange:ee,getOptionLabel:re,getOptionValue:ie,itemKeySelector:ae,openMenuOnFocus:le,menuPortalTarget:se,isAriaLiveEnabled:ue,menuOverscanCount:de,blurInputOnSelect:pe,menuItemDirection:fe,renderOptionLabel:me,renderMultiOptions:ge,menuScrollDuration:he,filterIgnoreAccents:be,hideSelectedOptions:ve,getIsOptionDisabled:we,getFilterOptionString:xe,isSearchable:Se=!0,lazyLoadMenu:Ee=!1,openMenuOnClick:Ie=!0,filterIgnoreCase:ke=!0,tabSelectsOption:Me=!0,closeMenuOnSelect:De=!0,scrollMenuIntoView:ze=!0,backspaceClearsValue:je=!0,filterMatchFrom:Le=y,menuPosition:Ve=b,options:Ae=R,loadingMsg:Be="Loading..",placeholder:$e="Select option..",noOptionsMsg:qe="No options",menuItemSize:We=35,menuMaxHeight:Ke=300},He)=>{const Ue=t.useRef(!1),Ye=t.useRef(),_e=t.useRef(!1),Xe=t.useRef(T(ee)),Ge=t.useRef(T(Z)),Je=t.useRef(null),Qe=t.useRef(null),Ze=t.useRef(null),et=t.useRef(null),[tt,nt]=t.useState(""),[ot,rt]=t.useState(!1),[it,at]=t.useState(!1),[lt,st]=t.useState(null),[ct,ut]=t.useState(k),dt=t.useMemo((()=>(e=>e&&V(e)?q(X,e):X)(K)),[K]),pt=ne(L),ft=ne(N),mt=ne(ee),gt=ne(Z),ht=ne(we||z),bt=ne(xe||j),yt=t.useMemo((()=>re||M),[re]),vt=t.useMemo((()=>ie||D),[ie]),wt=t.useMemo((()=>me||yt),[me,yt]),Ot=((e,n=0)=>{const[o,r]=t.useState(e);return Q((()=>{if(n<=0)return;const t=setTimeout((()=>{r(e)}),n);return()=>{clearTimeout(t)}}),[e,n]),n<=0?e:o})(tt,I),[xt,Ct]=t.useState((()=>$(U,vt,yt))),St=te(Ae,Ot,Le,xt,vt,yt,ht,bt,ke,be,o,e,ve),[Et,It]=oe(Qe,et,ot,Ve,We,Ke,St.length,!!se,pt,ft,he,ze),kt=()=>{var e;return null===(e=Ze.current)||void 0===e?void 0:e.blur()},Mt=()=>{var e;return null===(e=Ze.current)||void 0===e?void 0:e.focus()},Dt=e=>{var t;return null===(t=Je.current)||void 0===t?void 0:t.scrollToItem(e)},zt=F(xt),jt=P(pe)?pe:G,Rt=t.useCallback((e=>{if(!F(St))return void(!Ue.current&&rt(!0));const t=o?-1:St.findIndex((e=>e.isSelected)),n=t>-1?t:e===S?0:St.length-1;!Ue.current&&rt(!0),ut(Ne({index:n},St[n])),Dt(n)}),[o,St]),Lt=t.useCallback((e=>{Ct((t=>t.filter((t=>t.value!==e))))}),[]),Nt=t.useCallback(((e,t)=>{t?o&&Lt(e.value):Ct((t=>o?[...t,e]:[e])),jt?kt():De&&(rt(!1),nt(""))}),[o,De,Lt,jt]);t.useImperativeHandle(He,(()=>({empty:!zt,menuOpen:Ue.current,blur:kt,focus:Mt,clearValue:()=>{Ct(R),ut(k)},setValue:e=>{const t=$(e,vt,yt);Ct(t)},toggleMenu:e=>{!0===e||void 0===e&&!Ue.current?(Mt(),Rt(S)):kt()}})),[zt,vt,yt,Rt]),t.useEffect((()=>{c&&Mt()}),[]),t.useEffect((()=>{Ue.current=ot}),[ot]),t.useEffect((()=>{Xe.current=T(ee),Ge.current=T(Z)})),t.useEffect((()=>{it&&le&&Rt(S)}),[it,le,Rt]),t.useEffect((()=>{const{current:e}=Xe;e&&_e.current&&(_e.current=!1,mt(Ot))}),[mt,Ot]),Q((()=>{const{current:e}=Ge;if(e){const e=o?xt.map((e=>e.data)):F(xt)?xt[0].data:null;gt(e)}}),[gt,o,xt]),Q((()=>{const{length:t}=St,n=t>0&&(e||t!==Ae.length||0===Ye.current);0===t?ut(k):(1===t||n)&&(ut(Ne({index:0},St[0])),Dt(0)),Ye.current=t}),[e,Ae,St]);const Pt=()=>{const{data:e,value:t,label:n,isSelected:o,isDisabled:r}=ct;e&&!r&&Nt({data:e,value:t,label:n},o)},Tt=e=>{const t="ArrowDown"===e,n=t?S:C;ot?(e=>{if(!F(St))return;const t=e===x?(ct.index+1)%St.length:ct.index>0?ct.index-1:St.length-1;lt&&st(null),ut(Ne({index:t},St[t])),Dt(t)})(t?x:O):Rt(n)},Ft=e=>{if(E)return;it||Mt();const t="INPUT"!==e.target.nodeName;ot?t&&(ot&&rt(!1),tt&&nt("")):Ie&&Rt(S),t&&e.preventDefault()},Vt=t.useCallback((e=>{null==B||B(e),at(!1),rt(!1),nt("")}),[B]),At=t.useCallback((e=>{null==Y||Y(e),at(!0)}),[Y]),Bt=t.useCallback((e=>{_e.current=!0;const t=e.currentTarget.value||"";null==_||_(t),nt(t),!Ue.current&&rt(!0)}),[_]),$t=t.useCallback((e=>{Mt(),Ue.current?rt(!1):Rt(S),A(e)}),[Rt]),qt=t.useCallback((e=>{Mt(),Ct(R),A(e)}),[]),Wt=!Ee||Ee&&ot,Kt=!(!W||E||!zt),Ht=E||!Se||!!lt,Ut=E||Ie?void 0:$t;return a.default.createElement(n.ThemeProvider,{theme:dt},a.default.createElement(Pe,{id:i,"aria-controls":r,"aria-expanded":ot,onKeyDown:e=>{if(!(E||d&&(d(e,tt,ct),e.defaultPrevented))){switch(e.key){case"ArrowDown":case"ArrowUp":Tt(e.key);break;case"ArrowLeft":case"ArrowRight":if(!o||tt||ge)return;(e=>{if(!zt)return;let t=-1;const n=xt.length-1,o=lt?xt.findIndex((e=>e.value===lt)):-1;t=e===v?o>-1&&o<n?o+1:-1:0!==o?-1===o?n:o-1:0;const r=t>=0?xt[t].value:null;ct.data&&ut(k),r!==lt&&st(r)})("ArrowLeft"===e.key?w:v);break;case" ":if(tt)return;if(ot){if(!ct.data)return;Pt()}else Rt(S);break;case"Enter":ot&&229!==e.keyCode&&Pt();break;case"Escape":ot&&(rt(!1),nt(""));break;case"Tab":if(!ot||!Me||!ct.data||e.shiftKey)return;Pt();break;case"Delete":case"Backspace":if(tt)return;if(lt){const e=xt.findIndex((e=>e.value===lt)),t=e>-1&&e<xt.length-1?xt[e+1].value:null;Lt(lt),st(t)}else{if(!je)return;if(!zt)break;if(o&&!ge){const{value:e}=xt[xt.length-1];Lt(e)}else W&&Ct(R)}break;default:return}e.preventDefault()}}},a.default.createElement(Fe,{ref:et,isInvalid:m,isFocused:it,isDisabled:E,className:"rfs-control-container",onTouchEnd:Ft,onMouseDown:Ft,"data-testid":undefined},a.default.createElement(Te,null,a.default.createElement(ye,{isMulti:o,inputValue:tt,placeholder:$e,selectedOption:xt,focusedMultiValue:lt,renderMultiOptions:ge,renderOptionLabel:wt,removeSelectedOption:Lt}),a.default.createElement(Oe,{id:r,ref:Ze,required:l,ariaLabel:g,inputValue:tt,readOnly:Ht,onBlur:Vt,onFocus:At,onChange:Bt,ariaLabelledBy:J,hasSelectedOptions:zt})),a.default.createElement(Re,{menuOpen:ot,clearIcon:p,caretIcon:f,isInvalid:m,isLoading:u,showClear:Kt,isDisabled:E,loadingNode:H,onClearMouseDown:qt,onCaretMouseDown:Ut})),Wt&&a.default.createElement(ce,{menuRef:Qe,menuOpen:ot,isLoading:u,menuTop:Et,height:It,itemSize:We,loadingMsg:Be,menuOptions:St,fixedSizeListRef:Je,noOptionsMsg:qe,selectOption:Nt,direction:fe,itemKeySelector:ae,overscanCount:de,menuPortalTarget:se,width:h||dt.menu.width,onMenuMouseDown:e=>{A(e),Mt()},renderOptionLabel:wt,focusedOptionIndex:ct.index}),ue&&a.default.createElement(Ce,{ariaLive:s,menuOpen:ot,isFocused:it,ariaLabel:g,inputValue:tt,isSearchable:Se,focusedOption:ct,selectedOption:xt,optionCount:St.length})))}));Ve.displayName="Select",e.Select=Ve,Object.defineProperty(e,"__esModule",{value:!0})}));
import React, { useRef, useMemo, useState, useEffect, forwardRef, useCallback, useImperativeHandle } from 'react';
import { isBoolean, mergeThemes, suppressEvent, normalizeValue, IS_TOUCH_DEVICE, isArrayWithLength } from './utils';
import { isBoolean, isFunction, mergeThemes, suppressEvent, normalizeValue, IS_TOUCH_DEVICE, isArrayWithLength } from './utils';
import { ValueIndexEnum, FilterMatchEnum, OptionIndexEnum, MenuPositionEnum, EMPTY_ARRAY, SELECT_WRAPPER_ATTRS, PLACEHOLDER_DEFAULT, LOADING_MSG_DEFAULT, CONTROL_CONTAINER_CLS, FOCUSED_OPTION_DEFAULT, NO_OPTIONS_MSG_DEFAULT, MENU_ITEM_SIZE_DEFAULT, MENU_MAX_HEIGHT_DEFAULT, CONTROL_CONTAINER_TESTID, GET_OPTION_LABEL_DEFAULT, GET_OPTION_VALUE_DEFAULT, GET_OPTION_FILTER_DEFAULT, GET_OPTION_DISABLED_DEFAULT } from './constants';

@@ -66,2 +66,4 @@ import { useDebounce, useCallbackRef, useMenuOptions, useMountEffect, useUpdateEffect, useMenuPositioner } from './hooks';

const onChangeEventValue = useRef(false);
const onSearchChangeIsFunc = useRef(isFunction(onSearchChange));
const onOptionChangeIsFunc = useRef(isFunction(onOptionChange));
// DOM element refs

@@ -86,4 +88,4 @@ const listRef = useRef(null);

const onOptionChangeRef = useCallbackRef(onOptionChange);
const getIsOptionDisabledRef = useCallbackRef(getIsOptionDisabled, GET_OPTION_DISABLED_DEFAULT);
const getFilterOptionStringRef = useCallbackRef(getFilterOptionString, GET_OPTION_FILTER_DEFAULT);
const getIsOptionDisabledRef = useCallbackRef(getIsOptionDisabled || GET_OPTION_DISABLED_DEFAULT);
const getFilterOptionStringRef = useCallbackRef(getFilterOptionString || GET_OPTION_FILTER_DEFAULT);
// Memoized callback functions referencing optional function properties on Select.tsx

@@ -104,2 +106,3 @@ const getOptionLabelFn = useMemo(() => getOptionLabel || GET_OPTION_LABEL_DEFAULT, [getOptionLabel]);

const scrollToItemIndex = (index) => listRef.current?.scrollToItem(index);
// Local boolean flags based on component props
const hasSelectedOptions = isArrayWithLength(selectedOption);

@@ -185,2 +188,10 @@ const blurInputOnSelectOrDefault = isBoolean(blurInputOnSelect) ? blurInputOnSelect : IS_TOUCH_DEVICE;

/**
* Execute every render - these ref boolean flags are used to determine if functions
* ..are defined inside of a callback wrapper returned from 'useCallbackRef' custom hook
*/
useEffect(() => {
onSearchChangeIsFunc.current = isFunction(onSearchChange);
onOptionChangeIsFunc.current = isFunction(onOptionChange);
});
/**
* If control recieves focus & openMenuOnFocus = true, open menu

@@ -198,8 +209,8 @@ */

useEffect(() => {
const { current: onSearchFn } = onSearchChangeRef;
if (onSearchFn && onChangeEventValue.current) {
const { current: isDefinedFunc } = onSearchChangeIsFunc;
if (isDefinedFunc && onChangeEventValue.current) {
onChangeEventValue.current = false;
onSearchFn(debouncedInputValue);
onSearchChangeRef(debouncedInputValue);
}
}, [debouncedInputValue]);
}, [onSearchChangeRef, debouncedInputValue]);
/**

@@ -210,4 +221,4 @@ * useUpdateEffect:

useUpdateEffect(() => {
const { current: onChangeFn } = onOptionChangeRef;
if (onChangeFn) {
const { current: isDefinedFunc } = onOptionChangeIsFunc;
if (isDefinedFunc) {
const normalizedOptionValue = isMulti

@@ -218,5 +229,5 @@ ? selectedOption.map((x) => x.data)

: null;
onChangeFn(normalizedOptionValue);
onOptionChangeRef(normalizedOptionValue);
}
}, [isMulti, selectedOption]);
}, [onOptionChangeRef, isMulti, selectedOption]);
/**

@@ -223,0 +234,0 @@ * useUpdateEffect:

{
"name": "react-functional-select",
"version": "3.3.2",
"version": "3.3.3",
"description": "Micro-sized and micro-optimized select component for React.js",

@@ -56,3 +56,3 @@ "main": "./dist/index.cjs.js",

"@storybook/react": "^6.2.8",
"@testing-library/jest-dom": "^5.11.10",
"@testing-library/jest-dom": "^5.12.0",
"@testing-library/react": "^11.2.6",

@@ -59,0 +59,0 @@ "@testing-library/user-event": "^13.1.5",

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