@tap-payments/os-micro-frontend-shared 0.3.217-test.4 → 0.3.218

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/build/_chunks/chunk-6Z6BI3UQ.js +15 -0
  2. package/build/_chunks/chunk-MSVCIIW5.js +2 -0
  3. package/build/_chunks/chunk-UQVXIIIV.js +1 -0
  4. package/build/_chunks/chunk-ZIL2SD2V.js +1 -0
  5. package/build/components/AmountInput/index.js +1 -1
  6. package/build/components/AppServices/index.js +1 -1
  7. package/build/components/AppServicesBar/index.js +1 -1
  8. package/build/components/BrandLogo/index.js +1 -1
  9. package/build/components/ColumnViews/index.js +1 -1
  10. package/build/components/Customer/index.js +1 -1
  11. package/build/components/DateFilter/index.js +1 -1
  12. package/build/components/Discount/index.js +1 -1
  13. package/build/components/FileInputPreview/index.js +1 -1
  14. package/build/components/FilterDropdown/index.js +1 -1
  15. package/build/components/InputBase/index.js +1 -1
  16. package/build/components/ListColumnFilter/index.js +1 -1
  17. package/build/components/ListHeader/index.js +1 -1
  18. package/build/components/MerchantCurrencyDropdown/index.js +1 -1
  19. package/build/components/MerchantLogo/index.js +1 -1
  20. package/build/components/MerchantsDropdown/index.js +1 -1
  21. package/build/components/PaymentSourceFilter/index.js +1 -1
  22. package/build/components/PhoneFilter/index.js +1 -1
  23. package/build/components/RFH/Forms/DefaultForm.d.ts +10 -0
  24. package/build/components/RFH/Forms/index.d.ts +2 -0
  25. package/build/components/{FormSelect → RFH/Inputs/FormSelect}/style.d.ts +1 -1
  26. package/build/components/{FormSelect → RFH/Inputs/FormSelect}/type.d.ts +1 -1
  27. package/build/components/{MultiSelect → RFH/Inputs/MultiSelect}/style.d.ts +2 -2
  28. package/build/components/RFH/Inputs/SelectWithAccordion/SelectWithAccordion.d.ts +4 -0
  29. package/build/components/RFH/Inputs/SelectWithAccordion/index.d.ts +4 -0
  30. package/build/components/RFH/Inputs/SelectWithAccordion/style.d.ts +31 -0
  31. package/build/components/RFH/Inputs/SelectWithAccordion/type.d.ts +7 -0
  32. package/build/components/RFH/Inputs/index.d.ts +3 -0
  33. package/build/components/RFH/hooks/index.d.ts +1 -0
  34. package/build/components/RFH/hooks/useRFHForm.d.ts +2 -0
  35. package/build/components/RFH/index.d.ts +3 -0
  36. package/build/components/RFH/index.js +1 -0
  37. package/build/components/ReferenceTypeFilter/index.js +1 -1
  38. package/build/components/SelectDropdown/SelectDropdown.d.ts +25 -0
  39. package/build/components/SelectDropdown/TrailingArrowIcon.d.ts +13 -0
  40. package/build/components/SelectDropdown/TrailingCloseIcon.d.ts +15 -0
  41. package/build/components/SelectDropdown/index.d.ts +2 -0
  42. package/build/components/SelectDropdown/index.js +1 -0
  43. package/build/components/SelectDropdown/style.d.ts +15 -0
  44. package/build/components/StatusFilter/index.js +1 -1
  45. package/build/components/StatusIcons/index.js +1 -1
  46. package/build/components/TableCells/index.js +1 -1
  47. package/build/components/TableReports/index.js +1 -1
  48. package/build/components/VAT/index.js +1 -1
  49. package/build/components/VerificationIcon/index.js +1 -1
  50. package/build/components/ViewColumnRadioFilter/index.js +1 -1
  51. package/build/components/WindowSideBar/index.js +1 -1
  52. package/build/components/index.d.ts +1 -5
  53. package/build/components/index.js +1 -1
  54. package/build/index.js +1 -1
  55. package/package.json +2 -2
  56. package/build/_chunks/chunk-5MQUBLQD.js +0 -8
  57. package/build/_chunks/chunk-7KBPUQ5M.js +0 -1
  58. package/build/_chunks/chunk-OO2CZKZ5.js +0 -1
  59. package/build/_chunks/chunk-OPAG23P7.js +0 -8
  60. package/build/_chunks/chunk-PFDS7JG4.js +0 -1
  61. package/build/_chunks/chunk-UOAHX7UW.js +0 -1
  62. package/build/_chunks/chunk-XX74KK4T.js +0 -2
  63. package/build/_chunks/chunk-YIGKRF5X.js +0 -1
  64. package/build/components/FormSelect/index.js +0 -1
  65. package/build/components/GroupedSelect/GroupedSelect.d.ts +0 -4
  66. package/build/components/GroupedSelect/constants.d.ts +0 -14
  67. package/build/components/GroupedSelect/icons.d.ts +0 -5
  68. package/build/components/GroupedSelect/index.d.ts +0 -4
  69. package/build/components/GroupedSelect/index.js +0 -1
  70. package/build/components/GroupedSelect/style.d.ts +0 -44
  71. package/build/components/GroupedSelect/type.d.ts +0 -62
  72. package/build/components/MultiSelect/index.js +0 -1
  73. package/build/components/MultiSelectDropdownButton/MultiSelectDropdownButton.d.ts +0 -5
  74. package/build/components/MultiSelectDropdownButton/components/StatusButton.d.ts +0 -10
  75. package/build/components/MultiSelectDropdownButton/index.d.ts +0 -3
  76. package/build/components/MultiSelectDropdownButton/index.js +0 -1
  77. package/build/components/MultiSelectDropdownButton/style.d.ts +0 -9
  78. package/build/components/MultiSelectDropdownButton/type.d.ts +0 -14
  79. package/build/components/MultiSelectDropdownButton/utils.d.ts +0 -3
  80. package/build/components/RHFGroupedSelect/RHFGroupedSelect.d.ts +0 -5
  81. package/build/components/RHFGroupedSelect/index.d.ts +0 -2
  82. package/build/components/RHFGroupedSelect/index.js +0 -1
  83. package/build/components/RHFGroupedSelect/type.d.ts +0 -5
  84. /package/build/components/{FormSelect → RFH/Inputs/FormSelect}/FormSelect.d.ts +0 -0
  85. /package/build/components/{FormSelect → RFH/Inputs/FormSelect}/FormSelectMenuSearchInput.d.ts +0 -0
  86. /package/build/components/{FormSelect → RFH/Inputs/FormSelect}/FormSelectSearchableField.d.ts +0 -0
  87. /package/build/components/{FormSelect → RFH/Inputs/FormSelect}/FormSelectSelectMenu.d.ts +0 -0
  88. /package/build/components/{FormSelect → RFH/Inputs/FormSelect}/index.d.ts +0 -0
  89. /package/build/components/{FormSelect → RFH/Inputs/FormSelect}/utils.d.ts +0 -0
  90. /package/build/components/{MultiSelect → RFH/Inputs/MultiSelect}/MultiSelect.d.ts +0 -0
  91. /package/build/components/{MultiSelect → RFH/Inputs/MultiSelect}/index.d.ts +0 -0
@@ -0,0 +1,15 @@
1
+ import {a as a$3}from'./chunk-UQVXIIIV.js';import {a,e,c,b,d as d$1}from'./chunk-ZIL2SD2V.js';import {f,aa,j,P,O,ba,d}from'./chunk-U5S2TDEO.js';import {a as a$1}from'./chunk-3XNXNKGA.js';import {a as a$2,b as b$1}from'./chunk-MUR4ILTY.js';import {zc,Bc,Cc}from'./chunk-ZHEAWCTY.js';import {Pc,A}from'./chunk-M5HS3EYQ.js';import qt,{useId,useState,useEffect,useMemo,useRef,useCallback}from'react';import {FormProvider,useFormContext,Controller,useForm}from'react-hook-form';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import oe from'@mui/material/Box';import jt from'@mui/material/Button';import Yt from'@mui/material/Input';import je from'@mui/material/ListSubheader';import Ye from'@mui/material/MenuItem';import {keyframes,styled,alpha}from'@mui/material/styles';import Zt from'@mui/material/Popper';import eo from'@mui/material/TextField';function Kt({onSubmit:e,methods:t,children:n}){let r=zc(useId(),"default-form");return jsx(FormProvider,{...t,children:jsx("form",{id:r,"data-testid":"DefaultForm",onSubmit:e,noValidate:true,children:n})})}var Gt=qt.memo(Kt);var Qt=keyframes`
2
+ 0% {
3
+ transform: rotate(-90deg);
4
+ }
5
+ 100% {
6
+ transform: rotate(270deg);
7
+ }
8
+ `,Je=styled(oe)({width:12,height:12,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:"100%",height:"100%",display:"block"},animation:`${Qt} 2s linear infinite`}),$=styled(je)(({theme:e})=>({backgroundColor:e.palette.common.white,paddingLeft:8,paddingRight:8,paddingBottom:6,lineHeight:1})),Qe=styled("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontWeight:500,fontSize:11,lineHeight:"100%",letterSpacing:0,color:"#8D8D94",leadingTrim:"none",transition:e.transitions.create(["color","opacity"],{duration:90,easing:"ease-in"})})),Xe=styled(oe)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:e.spacing(1)})),Ze=styled(je)(({theme:e})=>({backgroundColor:e.palette.common.white,paddingLeft:8,paddingRight:8,paddingTop:e.spacing(.75),paddingBottom:e.spacing(.75),lineHeight:1.2,"&.MuiListSubheader-root":{lineHeight:1.2}})),et=styled(jt)(({theme:e})=>({minWidth:0,padding:"2px 4px",fontFamily:e.typography.fontFamily,fontWeight:500,fontStyle:"normal",fontSize:11,lineHeight:"120%",letterSpacing:0,textTransform:"none",verticalAlign:"middle",color:"#1F88D0",transition:e.transitions.create(["color","background-color","opacity"],{duration:90,easing:"ease-in"})})),Xt=styled(f)(()=>({padding:0,".MuiSvgIcon-root":{width:12,height:12}})),tt=styled("img")({width:14,height:14,flexShrink:0,display:"block"}),ot=styled(oe)({display:"flex",alignItems:"center",width:"100%",gap:8}),nt=styled(Ye,{shouldForwardProp:e=>e!=="$selected"})(({theme:e,$selected:t})=>({fontSize:"12px",backgroundColor:t?"#F8F8F8 !important":e.palette.common.white,"&.Mui-disabled":{opacity:1}})),rt=styled(Xt,{shouldForwardProp:e=>e!=="$mutedRect"})(({$mutedRect:e})=>e?{"& svg rect":{fill:"#BDC1CC"}}:{}),fe=styled(Yt)(({theme:e})=>({width:"100%",height:36,padding:"8px 8px 8px 12px",borderRadius:4,backgroundColor:e.palette.common.white,border:"1px solid #F2F2F2",boxSizing:"border-box","&:hover":{borderColor:"#F2F2F2"},"&.Mui-focused":{borderColor:"#F2F2F2",backgroundColor:e.palette.common.white},"&:before, &:after":{display:"none"},"& input":{padding:0,fontSize:10},"& .MuiInputBase-input":{paddingRight:4}}));styled(Ye)(({theme:e})=>({opacity:1,paddingTop:0,paddingBottom:0,marginBottom:8,minHeight:"auto",pointerEvents:"none",backgroundColor:e.palette.common.white,"&:hover":{backgroundColor:e.palette.common.white},"&.Mui-focusVisible":{backgroundColor:e.palette.common.white},"&.Mui-disabled":{backgroundColor:e.palette.common.white,opacity:1}}));var oo=keyframes`
9
+ 0% {
10
+ transform: rotate(-90deg);
11
+ }
12
+ 100% {
13
+ transform: rotate(270deg);
14
+ }
15
+ `,ct=styled(oe)({width:12,height:12,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:"100%",height:"100%",display:"block"},animation:`${oo} 2s linear infinite`}),ge=styled(oe)(({theme:e})=>({position:"relative",width:11,height:11,transform:"rotate(0deg)",color:e.palette.common.black,"& svg":{width:"100%",height:"100%",display:"block"}})),pt=styled($)({paddingTop:"8px"}),Ie=styled("ul")({listStyle:"none",margin:0,padding:0}),st=styled(Ye)(({theme:e})=>({display:"flex",alignItems:"center",gap:"8px",padding:"8px",justifyContent:"space-between",fontSize:"10px",fontWeight:500,cursor:"default",pointerEvents:"none",backgroundColor:e.palette.common.white,"&.Mui-disabled":{opacity:1,color:"#8D8D94"}})),ut=styled(Ye,{shouldForwardProp:e=>e!=="$selected"})(({theme:e,$selected:t})=>({fontSize:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(1),backgroundColor:t?e.palette.action.hover:e.palette.common.white})),be=styled("span")({flex:1,minWidth:0}),xe=styled("img")({width:10,height:7.5,flexShrink:0}),dt=styled("li",{shouldForwardProp:e=>!["$selected","$optionDisabled"].includes(String(e))})(({theme:e,$selected:t,$optionDisabled:n})=>({fontSize:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(1),minHeight:48,paddingLeft:e.spacing(2),paddingRight:e.spacing(2),backgroundColor:t?e.palette.action.hover:e.palette.common.white,"&.Mui-focused":{backgroundColor:e.palette.action.hover},...n&&{opacity:.38,pointerEvents:"none"}})),Pe=styled("span")({fontSize:"10px",fontWeight:500,color:"#8D8D94"}),mt=styled(eo,{shouldForwardProp:e=>!["feedbackType","hasFeedback","hasLabel"].includes(e)})(({theme:e,error:t,feedbackType:n,hasFeedback:r,hasLabel:a})=>{let{borderColor:c}=n?aa(e,n):{borderColor:void 0},s=r?"4px 4px 0 0":"4px";return {width:"100%","& .MuiInputLabel-root":{fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%",transform:"translate(8px, 15px) scale(1)",color:`${e.palette.grey[700]} !important`},"& .MuiInputLabel-root.MuiInputLabel-shrink":{transform:"translate(8px, 8px) scale(0.75)"},"& .MuiInputLabel-root.Mui-focused":{transform:"translate(8px, 8px) scale(0.75)"},"& .MuiFilledInput-root":{height:"40px",maxHeight:"40px",overflow:"hidden",borderRadius:s,backgroundColor:e.palette.grey[400],paddingTop:a?"11px":"0px",paddingBottom:a?"4px":"0px",paddingLeft:"8px",boxSizing:"border-box",display:"inline-flex",alignItems:a?"stretch":"center","&:before, &:after":{display:"none"},"&:hover":{backgroundColor:e.palette.grey[400]},"&.Mui-focused":{backgroundColor:e.palette.grey[400]},"&.Mui-disabled":{backgroundColor:e.palette.grey[400]}},"& .MuiFilledInput-input":{padding:"0 !important",minHeight:0,height:"auto",boxSizing:"border-box",display:"flex",alignItems:a?"flex-end":"center",alignSelf:a?"flex-end":"center",fontSize:"11px",lineHeight:"11px",color:e.palette.common.black,paddingBottom:a?"1px !important":"0 !important"},"& .MuiFilledInput-root.MuiInputBase-adornedEnd .MuiAutocomplete-input":{flex:"1 1 0%",minWidth:30,width:0,maxWidth:"100%"},"& .MuiAutocomplete-endAdornment":{display:"flex",alignItems:"center",gap:"8px",top:"50%",transform:"translateY(-50%)",right:9},"& .MuiAutocomplete-popupIndicator":{transform:"none",padding:"1px",marginRight:0,marginLeft:0},"& .MuiAutocomplete-popupIndicator.MuiAutocomplete-popupIndicatorOpen":{transform:"none"},"& .MuiAutocomplete-clearIndicator":{visibility:"visible",padding:"1px",marginRight:0,marginLeft:0},...n&&c&&{"& .MuiFilledInput-root":{border:`1px solid ${c}`}},...r&&{"& .MuiFilledInput-root":{borderBottom:"none",borderBottomLeftRadius:0,borderBottomRightRadius:0}},...t&&{"& .MuiFilledInput-root":{border:`1px solid ${e.palette.error.main}`}}}}),at=e=>({display:"flex",alignItems:"center",gap:"8px",padding:"8px",justifyContent:"space-between",fontSize:"10px",fontWeight:500,cursor:"default",pointerEvents:"none",backgroundColor:e.palette.common.white,color:"#8D8D94"}),St=styled(Zt,{shouldForwardProp:e=>!["$menuHasLoadingText","$suppressAutocompleteNoOptions","$suppressEmptyMenuSurface"].includes(e)})(({theme:e,$menuHasLoadingText:t,$suppressAutocompleteNoOptions:n,$suppressEmptyMenuSurface:r})=>({"& .MuiPaper-root":r?{boxShadow:"none",border:"none",backgroundColor:"transparent",margin:0,marginTop:0,padding:0,maxHeight:0,minHeight:0,overflow:"hidden",borderRadius:0,pointerEvents:"none"}:{marginTop:4,borderRadius:4,boxShadow:e.shadows[8],border:"1px solid #F2F2F2",backgroundColor:e.palette.common.white},"& .MuiAutocomplete-listbox":{padding:0,...r?{maxHeight:0,minHeight:0,overflow:"hidden"}:{maxHeight:320}},"& .MuiAutocomplete-noOptions":n?{display:"none !important"}:at(e),"& .MuiAutocomplete-loading":{...at(e),...!t&&{display:"none"}}}));function ye({placeholder:e,value:t,onValueChange:n,isLoading:r}){let a=zc(useId(),"form-select-menu-search-input"),c=useCallback(s=>{s.stopPropagation();},[]);return jsx(fe,{id:a,"data-testid":"FormSelectMenuSearchInput",placeholder:e,value:t,onChange:s=>n(s.target.value),onKeyDown:c,onKeyUp:c,onMouseDown:c,onClick:c,disableUnderline:true,fullWidth:true,inputProps:{"aria-label":e},endAdornment:r?jsx(ct,{"aria-hidden":true,children:jsx(b$1,{})}):jsx(ge,{"aria-hidden":true,children:jsx(a$2,{})})})}var Fe=jsx(Pe,{children:"No results found"}),ht=jsx(Pe,{children:"Loading\u2026"});function Ce(e,t,n){return t?t(e):n?n(e):e?.label}function ke(e,t,n){let r=t.toLowerCase().trim(),a=(n?n(e):e?.label)??"";return String(a).toLowerCase().includes(r)}function ft(e){return e}function gt(e){let t=qt.forwardRef(function(r,a){let{children:c,className:s,...h}=r,m=e.current;return m?jsxs(Fragment,{children:[jsx(pt,{disableSticky:true,children:jsx(ye,{placeholder:m.menuSearchPlaceholder,value:m.searchValue,onValueChange:m.setSearchValue,isLoading:m.isLoading})}),jsx(Ie,{ref:a,className:s,...h,children:c})]}):jsx(Ie,{ref:a,className:s,...h,children:c})});return t.displayName="FormSelectMenuSearchListbox",t}function xt({menuSearchPlaceholder:e,searchValue:t,onSearchChange:n,isLoading:r,menuHasNoOptionsText:a,menuNoOptionsText:c,optionsWithoutEmptyValue:s,getOptionValue:h,getOptionLabel:m,renderOption:x,isOptionEqualToValue:S,menuHasSelectedCheckMark:R,valueOnly:y,getOptionId:I,field:u,onChange:F}){let C=Cc("form-select-item");return jsxs(Fragment,{children:[jsx($,{disableSticky:true,onMouseDown:o=>o.stopPropagation(),onClick:o=>o.stopPropagation(),children:jsx(ye,{placeholder:e,value:t,onValueChange:n,isLoading:r})}),a&&t.trim()&&s.length===0?jsx(st,{disabled:true,value:"__form_select_no_results__",children:c??Fe}):s.map((o,p)=>{let g=S?S(o,u.value):o?.id===u.value?.id,M=Ce(o,x,m);return jsxs(ut,{disabled:!!o.disabled,$selected:g,value:(h?h(o):o?.id)??"",onClick:()=>{u.onChange(y?I(o):o),F?.(o);},children:[jsx(be,{children:M}),R&&g?jsx(xe,{src:Pc,alt:""}):null]},C(h?h(o):o?.id,p))})]})}var Me={menuHasLoadingText:false,suppressAutocompleteNoOptions:false,suppressEmptyMenuSurface:false};function so(e,t){e!=null&&(typeof e=="function"?e(t):e.current=t);}function uo(...e){return t=>{for(let n of e)so(n,t);}}function mo(e){let t=n=>{let r=e.current;return jsx(St,{...n,$menuHasLoadingText:r.menuHasLoadingText,$suppressAutocompleteNoOptions:r.suppressAutocompleteNoOptions,$suppressEmptyMenuSurface:r.suppressEmptyMenuSurface})};return t.displayName="FormSelectSearchableAutocompletePopper",t}function Ct(e){let t=zc(useId(),"form-select-searchable-field"),n=useRef(null),r=useRef(Me);n.current=e.menuSearchable?{searchValue:e.inMenuSearchContextValue.searchValue,setSearchValue:e.inMenuSearchContextValue.setSearchValue,menuSearchPlaceholder:e.inMenuSearchContextValue.menuSearchPlaceholder,isLoading:e.inMenuSearchContextValue.isLoading}:null,r.current=e.searchableAutocompletePopperFlags;let a$3=useMemo(()=>gt(n),[]),c$1=useMemo(()=>mo(r),[]),s=e.feedback,{isProvided:h,isVisible:m,type:x}=Bc(s),S=!!e.fieldState.error&&!m,R=e.helperText??e.fieldState.error?.message,y=e.internalValue!=null&&e.internalValue!==""&&typeof e.internalValue=="object"?e.internalValue:null,I=e.getOptionLabel??(o=>String(o?.label??"")),u=e.isOptionEqualToValue??((o,p)=>o&&p?o.id===p.id:o===p),F=e.ClearIconComponent??a,C=e.label!=null&&e.label!=="";return jsxs(c,{id:t,"data-testid":"FormSelectSearchableField",children:[jsx(a$1,{...e.autocompleteRest,disableClearable:!e.showClearIcon,clearIcon:jsx(F,{sx:{fontSize:8,width:8,height:8}}),ListboxComponent:e.menuSearchable?a$3:void 0,PopperComponent:c$1,options:e.optionsWithClearFilterOnly,value:y,onChange:(o,p,g)=>{if(p==null&&e.onClear&&g==="clear"){e.onClear();return}if(e.valueOnly){let M=p==null?null:e.getOptionId(p);e.field.onChange(M);}else e.field.onChange(p);e.onChange?.(p);},onInputChange:(o,p,g)=>{e.setSearchableInputValue(p),(g==="input"||g==="clear")&&e.scheduleSearchNotification(p);},slotProps:e.slotProps??{},filterOptions:e.menuSearchable?e.autocompleteFilterOptions:ft,loading:!!e.isLoading,disabled:!!e.disabled,getOptionLabel:I,getOptionDisabled:o=>!!o.disabled,isOptionEqualToValue:u,renderOption:e.renderAutocompleteOption,noOptionsText:e.menuNoOptionsText??Fe,loadingText:e.menuHasLoadingText?e.menuLoadingText??ht:null,popupIcon:jsx(ge,{children:jsx(a$2,{})}),renderInput:o=>{let{inputProps:p,...g}=o,{ref:M,..._}=p;return jsx(mt,{...g,variant:"filled",label:e.label,placeholder:e.placeholder,required:e.required,error:S,helperText:null,feedbackType:x,hasFeedback:m,hasLabel:C,inputRef:uo(M,e.field.ref,e.inputRef),InputProps:{...o.InputProps,disableUnderline:true},inputProps:{..._,name:e.field.name,onBlur:e.field.onBlur}})}}),h?jsx(ba,{...s}):jsx(b,{children:R})]})}function It(e$1){let{name:t,helperText:n,feedback:r,menuSearchable:a$1=false,showClearIcon:c=false,ClearIconComponent:s=a,onClear:h,menuSearchPlaceholder:m="Search",getOptionValue:x,getOptionLabel:S,renderOption:R,isOptionEqualToValue:y,options:I,MenuProps:u,valueOnly:F=false,menuHasSelectedCheckMark:C=false,searchable:o=false,onSearchInputChange:p,searchDebounceMs:g=300,minSearchLength:M,menuLoadingText:_,menuHasLoadingText:d=false,menuHasNoOptionsText:k=true,menuNoOptionsText:A,label:ne,placeholder:U,required:re,disabled:l,isLoading:v,inputRef:K,onChange:D,...ae}=e$1,{control:le}=useFormContext(),[b,G]=useState(""),[j,Y]=useState("");useEffect(()=>{o||Y("");},[o]);let ie=useMemo(()=>({searchValue:b,setSearchValue:G,menuSearchPlaceholder:m,isLoading:!!v}),[b,m,v]),J=useRef(void 0),ce=useRef(p);ce.current=p,useEffect(()=>()=>{J.current&&clearTimeout(J.current);},[]);let Ht=useCallback(i=>{if(!ce.current)return;let f=i.trim();J.current&&clearTimeout(J.current),J.current=setTimeout(()=>{if(f===""){ce.current?.("");return}M!=null&&f.length<M||ce.current?.(f);},g);},[g,M]),W=useMemo(()=>{let i=I??[];return !c||!x?i:i.filter(f=>{let w=x(f);return w!=null&&w!==""})},[c,x,I]),Ae=useMemo(()=>!a$1||!b.trim()?W:W.filter(i=>ke(i,b,S)),[a$1,b,W,S]),Q=useMemo(()=>a$1?Ae:W,[a$1,Ae,W]),Nt=useCallback(i=>!a$1||!b.trim()?i:i.filter(f=>ke(f,b,S)),[a$1,b,S]),Bt=useMemo(()=>{if(!o)return Me;let i=j.trim(),f=i.length===0||M!=null&&i.length>0&&i.length<M,w=a$1&&!!b.trim()&&Q.length===0,E=f&&!w||!k,se=Q.length>0;return {menuHasLoadingText:d,suppressAutocompleteNoOptions:E,suppressEmptyMenuSurface:!se&&!(!E&&!se)&&!!!(v&&d)}},[o,j,M,a$1,b,Q,k,v,d]),Dt={...u,autoFocus:false,disableEnforceFocus:true},pe=i=>(x?x(i):i?.id)??"",Wt=i=>!F||!i?i:I?.find(f=>pe(f)===i)??i,Vt=useCallback((i,f,w)=>{let E=Ce(f,R,S),se=!!f.disabled;return jsxs(dt,{...i,$selected:w.selected,$optionDisabled:se,children:[jsx(be,{children:E}),C&&w.selected?jsx(xe,{src:Pc,alt:""}):null]})},[S,R,C]),ve={...ae};for(let i of ["IconComponent","startComponent"])delete ve[i];let{slotProps:$t={},...zt}=ve;return jsx(Controller,{name:t,control:le,render:({field:i,fieldState:f})=>{let w=Wt(i.value);return o?jsx(Ct,{menuSearchable:a$1,inMenuSearchContextValue:ie,searchableAutocompletePopperFlags:Bt,optionsWithClearFilterOnly:W,autocompleteFilterOptions:Nt,slotProps:$t,autocompleteRest:zt,inputRef:K,showClearIcon:c,ClearIconComponent:s,menuHasLoadingText:d,menuLoadingText:_,menuNoOptionsText:A,isLoading:v,disabled:l,label:ne,placeholder:U,required:re,valueOnly:F,getOptionId:pe,scheduleSearchNotification:Ht,setSearchableInputValue:Y,renderAutocompleteOption:Vt,onClear:h,onChange:D,feedback:r,helperText:n,field:i,fieldState:f,internalValue:w,getOptionLabel:S,isOptionEqualToValue:y}):jsx(e,{...ae,...i,label:ne,placeholder:U,required:re,disabled:l,isLoading:v,value:w,menuHasSelectedCheckMark:C,showClearIcon:c,ClearIconComponent:s,onClear:h,options:Q,getOptionValue:x,getOptionLabel:S,renderOption:R,isOptionEqualToValue:y,hasError:!!f.error,helperText:n??f.error?.message,feedback:r,onChange:E=>{i.onChange(F?pe(E):E),D?.(E);},MenuProps:Dt,children:a$1?jsx(xt,{menuSearchPlaceholder:m,searchValue:b,onSearchChange:G,isLoading:v,menuHasNoOptionsText:k,menuNoOptionsText:A,optionsWithoutEmptyValue:Q,getOptionValue:x,getOptionLabel:S,renderOption:R,isOptionEqualToValue:y,menuHasSelectedCheckMark:C,valueOnly:F,getOptionId:pe,field:i,onChange:D}):void 0})}})}It.displayName="RFHSelect";var Pt=qt.memo(It);var Oe=Pt;var kt=styled(j)(({theme:e})=>({fontSize:"10px",color:e.v2.palette.grey[500],fontWeight:600,lineHeight:"10px"}));styled(j)(({theme:e})=>({fontSize:"11px",color:e.v2.palette.base.black,fontWeight:600,lineHeight:"14.3px",width:200}));var wt=styled(oe)(()=>({display:"flex",flexDirection:"column",maxHeight:180,overflow:"auto",scrollbarWidth:"thin",scrollbarColor:"#E5E5E5 #E5E5E5"})),Ot=styled(P)(({theme:e})=>{let t=`1px solid ${alpha(e.palette.common.black,.1)}`;return {flexShrink:0,border:0,borderRadius:0,"&.Mui-expanded:not(:last-of-type)":{borderBottom:t},[`&:last-of-type .${O.summary}`]:{borderBottom:"none"},[`&.Mui-expanded:last-of-type .${O.summary}`]:{borderBottom:t},[`& .${O.summary}`]:{backgroundColor:e.palette.common.white,borderBottom:t,minHeight:28,height:"auto","& .MuiAccordionSummary-content":{margin:"auto"},"&.Mui-expanded":{backgroundColor:"#F8F8F8",minHeight:28,height:"auto"}},[`& .${O.content}`]:{borderTop:"none"}}});styled(Yt)(({theme:e})=>({width:"inherit",height:32,padding:"11px 12px",fontSize:"10px",borderRadius:"5px",backgroundColor:"#F9F9F9",border:"1px solid transparent","&.Mui-focused":{borderColor:e.palette.info.dark}}));var Tt=styled(oe)(()=>({display:"flex",flexDirection:"column",gap:"8px"}));styled(oe)(()=>({display:"flex",gap:"8px",padding:"4px",flexWrap:"wrap",paddingInlineEnd:"20px"}));styled(oe)(({theme:e,maxWidth:t})=>({display:"flex",padding:"4px 8px 4px 6px",alignItems:"center",gap:"4px",borderRadius:"13px",backgroundColor:`${e.palette.info.dark}1a`,fontSize:"10px",fontWeight:500,cursor:"pointer",...t&&{maxWidth:`${t}%`}}));var At=styled(j)(()=>({display:"flex",gap:"8px",alignItems:"center",justifyContent:"space-between",fontSize:"10px",fontWeight:500,color:"#000",cursor:"pointer",padding:"8px 20px"}));styled(oe)(({theme:e})=>({width:"100%",flexDirection:"column",border:`1px solid ${e.palette.grey[100]}`,borderRadius:"4px",backgroundColor:e.palette.grey[400]}));function Mo({name:e,options:t,...n}){let r=zc(useId(),"select-with-accordion"),[a,c]=useState(null),[s,h]=useState(0),m=!!a,x=u=>{c(m?null:u.currentTarget);},S=()=>{c(null);},{watch:R,setValue:y}=useFormContext(),I=R(e);return jsx(a$3,{id:r,"data-testid":"SelectWithAccordion",open:m,anchorEl:a,onOpen:x,onClose:S,trigger:jsx(Oe,{name:e,options:[],...n,open:false}),hideArrow:true,listWrapperSx:{padding:0,margin:0},children:jsx(Tt,{onClick:u=>u.stopPropagation(),onMouseDown:u=>u.stopPropagation(),children:jsx(wt,{"data-testid":"AccordionWrapper",children:t.map?.((u,F)=>jsx(Ot,{expanded:s===F,onChange:o=>h(o?F:null),label:jsx(kt,{variant:"caption",children:u.group}),content:(u?.options||[]).map((o,p)=>{let g=n?.isOptionEqualToValue?.(o,I);return jsxs(At,{onClick:()=>{y(e,o,{shouldDirty:true,shouldTouch:true,shouldValidate:true}),S();},children:[n.renderOption?.(o)||o.label,g&&jsx(d,{src:Pc,alt:"blue-check",sx:{width:14,height:10}})]},`${o.value}-${o.label}-${p}`)})},`${u.group}-group-${F}`))})})})}var Et=Mo;var Lo=Et;function Te({name:e,helperText:t,getOptionValue:n,getOptionLabel:r,renderOption:a,isOptionEqualToValue:c,getOptionDisabled:s,menuSearchable:h=false,menuSearchPlaceholder:m="Search",showCheckbox:x=true,menuHasSelectionSummary:S=false,valueOnly:R=false,options:y,isLoading:I,...u}){let{control:F}=useFormContext(),[C,o]=useState(""),p=d=>(n?n(d):d?.id)??"",g=d=>!R||!d?.length?d??[]:d.map(k=>y?.find(A=>p(A)===k)).filter(Boolean),M=d=>d?.map(p)??[],_=useMemo(()=>{if(!h||!C.trim())return y??[];let d=C.toLowerCase().trim();return (y??[]).filter(k=>{let A=(r?r(k):k?.label)??"";return String(A).toLowerCase().includes(d)})},[y,h,C,r]);return jsx(Controller,{name:e,control:F,defaultValue:[],render:({field:d,fieldState:k})=>{let A$1=Array.isArray(d.value)?d.value.filter(l=>l!=null).length:0,ne=S&&A$1>0,U=g(d.value),re=Cc("multi-select-item");return jsxs(d$1,{...u,isLoading:I,...d,options:y??[],value:U,getOptionLabel:r,hasError:!!k.error,helperText:t??k.error?.message,onChange:l=>d.onChange(R?M(l):l),MenuProps:{...u.MenuProps,autoFocus:false,disableEnforceFocus:true},children:[h&&jsx($,{disableSticky:true,children:jsx(fe,{placeholder:m,value:C,onChange:l=>o(l.target.value),onKeyDown:l=>l.stopPropagation(),onKeyUp:l=>l.stopPropagation(),disableUnderline:true,fullWidth:true,inputProps:{"aria-label":m},endAdornment:I?jsx(Je,{"aria-hidden":true,children:jsx(b$1,{})}):jsx(tt,{src:A,alt:"search"})})}),ne&&jsx(Ze,{disableSticky:true,children:jsxs(Xe,{children:[jsxs(Qe,{children:[A$1," selected"]}),jsx(et,{type:"button",variant:"text",disableRipple:true,"aria-label":"Clear all selected options",onMouseDown:l=>{l.preventDefault(),l.stopPropagation();},onClick:l=>{l.preventDefault(),l.stopPropagation(),u.onClear?u.onClear():d.onChange([]);},children:"Clear"})]})}),_?.map((l,v)=>{let K=U?.some(b=>{if(b==null)return false;if(c)return c(l,b);if(n){let Y=n(l),ie=n(b);return Y===ie||String(Y)===String(ie)}let G=l?.id,j=b?.id;return G===j||String(G)===String(j)}),D=s?s(l):false,ae=r?r(l):l.label,le=a?a(l):ae;return jsx(nt,{value:(n?n(l):l?.id)??"",disabled:D,$selected:K,children:x?jsxs(ot,{children:[jsx(rt,{checked:K,$mutedRect:K&&D}),le]}):le},re(n?n(l):l?.id,v))})]})}})}var To=useForm;export{Gt as a,Oe as b,Lo as c,Te as d,To as e};