import{jsx as o}from"react/jsx-runtime";import{forwardRef as e}from"react";import s from"classnames";import t from"../TextField/TextField.js";import a from"../../hooks/useMergeRefs.js";import{SearchType as i,SearchTypeClass as n,SearchDefaultIconNames as r}from"./SearchConstants.js";import{getTestId as c}from"../../tests/testIds.js";import d from"../Icon/Icons/components/CloseSmall.js";import l from"../Icon/Icons/components/Search.js";import{NOOP as m}from"../../utils/function-utils.js";import{TextFieldTextType as p}from"../TextField/TextFieldConstants.js";import{ComponentDefaultTestId as u}from"../../tests/constants.js";import"./Search.scss.js";import{BASE_SIZES as v}from"../../constants/sizes.js";function f(o){return n[o]||""}var C=e((function(e,n){var v=e.secondaryIconName,C=void 0===v?d:v,I=e.iconName,h=void 0===I?l:I,j=e.onChange,N=void 0===j?m:j,R=e.autoFocus,S=void 0!==R&&R,T=e.value,g=void 0===T?"":T,A=e.placeholder,F=void 0===A?"":A,b=e.disabled,x=void 0!==b&&b,y=e.debounceRate,E=void 0===y?200:y,O=e.onBlur,_=void 0===O?m:O,z=e.onFocus,H=void 0===z?m:z,k=e.wrapperClassName,w=void 0===k?"":k,B=e.setRef,D=e.autoComplete,L=void 0===D?"off":D,U=e.size,M=void 0===U?"large":U,Q=e.type,q=void 0===Q?i.SQUARE:Q,G=e.className,J=e.id,K=void 0===J?"search":J,P=e.validation,V=void 0===P?null:P,W=e.inputAriaLabel,X=e.searchResultsContainerId,Y=void 0===X?"":X,Z=e.activeDescendant,$=void 0===Z?"":Z,oo=e.iconNames,eo=void 0===oo?r:oo,so=e.loading,to=void 0!==so&&so,ao=e.defaultIsOpen,io=void 0!==ao&&ao,no=a({refs:[n,void 0===B?m:B]});return o(t,{id:K,dataTestId:c(u.SEARCH,K),iconName:h,value:g,onChange:N,autoFocus:S,placeholder:F,disabled:x,debounceRate:E,className:s(G,"search_component",f(q)),secondaryIconName:C,secondaryDataTestId:c(u.CLEAN_SEARCH_BUTTON,K),wrapperClassName:s(w,"search_component_wrapper"),onBlur:_,onFocus:H,ref:no,autoComplete:L,size:M,clearOnIconClick:!0,validation:V,inputAriaLabel:W,searchResultsContainerId:Y,activeDescendant:$,iconsNames:eo,type:p.SEARCH,role:"search",loading:to,onIconClick:function(){return console.log("test")},defaultIsOpen:io})}));Object.assign(C,{sizes:v,types:i,defaultTestId:u.SEARCH});var I=C;export{I as default};
