@tap-payments/os-micro-frontend-shared 0.3.202-test.1 → 0.3.202-test.2
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.
- package/build/_chunks/{chunk-UFXKN6EC.js → chunk-36PFADPE.js} +1 -1
- package/build/_chunks/{chunk-EZ7WUS35.js → chunk-3MDX5OYC.js} +1 -1
- package/build/_chunks/{chunk-XB7FBOZY.js → chunk-52PIMKF7.js} +1 -1
- package/build/_chunks/chunk-5DPLX7NJ.js +15 -0
- package/build/_chunks/chunk-CJQSOND7.js +2 -0
- package/build/_chunks/{chunk-ZM4O7QGS.js → chunk-EILZ7V32.js} +1 -1
- package/build/_chunks/{chunk-M4VH4PEZ.js → chunk-KSUB7D4I.js} +1 -1
- package/build/_chunks/chunk-L4MAU66Y.js +1 -0
- package/build/_chunks/chunk-RGAQ3SMH.js +1 -0
- package/build/_chunks/{chunk-WXGLLZB3.js → chunk-UKFKZVCU.js} +1 -1
- package/build/_chunks/{chunk-LE6FVEAN.js → chunk-UWN3X5YM.js} +1 -1
- package/build/_chunks/chunk-Y3D6D36R.js +1 -0
- package/build/_chunks/chunk-ZQ6GJ4H5.js +1 -0
- package/build/components/ActionMenu/index.js +1 -1
- package/build/components/AmountConversionFilter/index.js +1 -1
- package/build/components/AmountInput/index.js +1 -1
- package/build/components/AmountSlider/index.js +1 -1
- package/build/components/AppServices/index.js +1 -1
- package/build/components/AppServicesBar/index.js +1 -1
- package/build/components/AppWindowWrapper/index.js +1 -1
- package/build/components/BrandLogo/index.js +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/CurrencyFilter/index.js +1 -1
- package/build/components/Customer/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/Discount/index.js +1 -1
- package/build/components/Dropdown2/index.js +1 -1
- package/build/components/ExpandableSideBar/index.js +1 -1
- package/build/components/FileInputPreview/index.js +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/HeatMap/index.js +1 -1
- package/build/components/InputBase/SelectBase/SelectBase.d.ts +0 -4
- package/build/components/InputBase/index.js +1 -1
- package/build/components/Inputs/index.js +1 -1
- package/build/components/JSONViewer/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/MerchantCurrencyDropdown/index.js +1 -1
- package/build/components/MerchantLogo/index.js +1 -1
- package/build/components/MerchantsDropdown/index.js +1 -1
- package/build/components/NestedMultiSelect/index.js +1 -1
- package/build/components/PartnersFilter/index.js +1 -1
- package/build/components/PaymentSourceFilter/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/RFH/Inputs/FormSelect/type.d.ts +0 -6
- package/build/components/RFH/index.js +1 -1
- package/build/components/ReceiptsViewer/index.js +1 -1
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/StatusBar/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableReports/index.js +1 -1
- package/build/components/Timeline/index.js +1 -1
- package/build/components/TreeDropdown/index.js +1 -1
- package/build/components/VAT/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/ViewColumnRadioFilter/index.js +1 -1
- package/build/components/WindowSideBar/index.js +1 -1
- package/build/components/index.js +1 -1
- package/build/index.js +1 -1
- package/package.json +2 -2
- package/build/_chunks/chunk-C3U5UTGF.js +0 -15
- package/build/_chunks/chunk-IA2QWOE7.js +0 -1
- package/build/_chunks/chunk-KQ6ESXAZ.js +0 -1
- package/build/_chunks/chunk-Q3JV5T3L.js +0 -1
- package/build/_chunks/chunk-TCQKIJGP.js +0 -2
- package/build/_chunks/chunk-ZBVCF5WE.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-XFKIRVNC.js';import {aa,ba}from'./chunk-XGZGBCXK.js';import {zc,Bc}from'./chunk-2OTSLKKQ.js';import {Cb,A,Qf}from'./chunk-M5HS3EYQ.js';import {memo,useId,useState,useEffect,useRef}from'react';import {styled,Box,TextField,Button,Typography,FormControl,InputLabel,Select,MenuItem}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import R from'@mui/material/Box';import Me from'@mui/material/ClickAwayListener';import ve from'@mui/material/Popper';import T from'@mui/material/Skeleton';import {styled as styled$1}from'@mui/material/styles';import {useFormContext,Controller}from'react-hook-form';var _=styled(Box)(()=>({display:"flex",flexDirection:"column",gap:"4px",width:"100%",height:40,"& *":{flex:1,margin:"0px !important"}})),I=styled(TextField,{shouldForwardProp:e=>!["hasError","feedbackType","hasFeedback","hideArrows"].includes(e)})(({theme:e,hasError:n,feedbackType:o,hasFeedback:a,hideArrows:t})=>{let{borderColor:i}=aa(e,o),l=a?"4px 4px 0 0":"4px",s="#F2F2F2";return o&&(s=i),n&&!o&&(s=e.palette.error.main),{"& .MuiFormLabel-asterisk":{color:"red"},"& .MuiInputBase-root":{maxHeight:"40px !important",alignItems:"flex-end !important"},"& fieldset":{border:"1px solid red"},"&:hover fieldset":{border:"1px solid green"},"&.Mui-focused fieldset":{border:"1px solid blue"},border:`1px solid ${s}`,borderBottom:a?"none":void 0,borderRadius:l,"& .MuiInputBase-input":{margin:"0px !important",padding:"0px !important",color:"#20232B !important",fontSize:"11px !important",fontStyle:"normal !important",fontWeight:"500 !important",lineHeight:"130% !important"},"& .MuiFormLabel-root":{fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%",transform:"translate(0, 8px) scale(1)"},".MuiFormLabel-root.MuiFormLabel-filled, .MuiFormLabel-root.MuiInputLabel-shrink":{transform:"translate(0, -1.5px) scale(0.75) "},".MuiFormLabel-root.Mui-focused":{transform:"translate(0, -1.5px) scale(0.75)",fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%"},...t&&{"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0},"& input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}}}}),K=styled("small")(({theme:e})=>({color:e.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}));var U=styled("div")(()=>({position:"relative",display:"flex",justifyContent:"flex-end",alignItems:"center"})),O=styled(I)(({theme:e})=>({fontSize:"11px",lineHeight:"11px",color:e.palette.common.black,borderRadius:"5px",boxShadow:"0px 0px 6px 0px rgba(0, 0, 0, 0.11);",padding:"4px 8px",height:"32px",border:"none",outline:"none",width:"100%","&:focus":{border:"1px solid #1F88D0"}})),G=styled(Button)(({theme:e})=>({display:"flex",height:"24px",padding:"8px",justifyContent:"center",alignItems:"center",gap:"8px",backgroundColor:e.palette.divider,color:e.palette.grey[700],fontSize:"9px",fontWeight:500,textTransform:"none",position:"absolute",right:4,opacity:"1 !important",top:4,borderRadius:"4px"}));function L(e){let n=zc(useId(),"file-input"),o=useRef(null);return jsxs(Fragment,{children:[jsxs(U,{id:n,"data-testid":"InputContainer",children:[jsx(O,{value:o.current?.files?.[0]?.name||"",...e}),jsx(G,{onClick:()=>{o.current?.click();},children:"Browse"})]}),jsx("input",{type:"file",ref:o,style:{display:"none"}})]})}var Fe=L;var Q=styled$1("button")(({theme:e})=>({display:"flex",gap:"4px",alignItems:"center",".logo":{width:"15.568px",height:"10.889px",borderRadius:"3px"},".arrow":{width:14},span:{color:e.palette.text.primary,fontWeight:500,fontSize:"11px"},height:24,cursor:"pointer"})),X=styled$1(R)(({theme:e})=>({backgroundColor:e.palette.common.white,padding:"4px 8px",borderRadius:"4px",border:`1px solid ${e.palette.divider}`,width:100})),Y=styled$1("ul")(()=>({listStyle:"none",padding:0,margin:0,maxHeight:100,overflow:"auto"})),Z=styled$1("li")(({theme:e})=>({display:"flex",gap:"4px",alignItems:"center",".logo":{width:"15.568px",height:"10.889px",borderRadius:"3px"},".arrow":{width:14},span:{color:e.palette.text.primary,fontWeight:500,fontSize:"11px"},height:24,cursor:"pointer"})),j=styled$1(a)(()=>({height:24,padding:"4px",marginBottom:"4px"})),ee=styled$1(R)(()=>({color:"red !important"}));styled$1("small")(({theme:e})=>({color:e.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}));var te=styled$1(R)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,display:"flex",position:"relative",paddingInline:"8px",alignItems:"center",borderRadius:"4px",height:"40px"})),oe=styled$1(a,{shouldForwardProp:e=>e!=="error"})(({error:e})=>({img:{cursor:"pointer"},...e&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"}}));function Pe({defaultCountry:e,value:n,onChangeCountry:o,required:a,countries:t=[],isLoading:i=false}){let l=zc(useId(),"countries-dropdown"),[s,g]=useState(null),[F,u]=useState([]),[b,h]=useState(),ue=()=>{if(t&&e){let r=t.find(x=>x.iso2===e);r&&o?.(r);}};useEffect(()=>{u(t||[]),ue();},[t]);let A$1=!!s,xe=r=>{r.stopPropagation(),g(r.currentTarget);},N=()=>{g(null),h(void 0);},ce=r=>{o?.(r),N(),u(t);},fe=r=>{let x=Number(r.target.value);if(h(x),!x){u(t);return}u(t.filter(ge=>ge.idd_prefix.toString().startsWith(x.toString())));};return i?jsx(T,{variant:"rectangular",width:56.5,height:20,sx:{borderRadius:"4px"}}):jsx(Me,{onClickAway:N,children:jsxs(R,{id:l,"data-testid":"CountriesCode",sx:{position:"relative"},children:[jsxs(Q,{type:"button",onClick:xe,sx:{backgroundColor:"transparent",border:"none",height:34},children:[n?.logo?jsx("img",{src:n.logo,alt:"c",className:"logo"}):jsx(T,{variant:"rectangular",className:"logo"}),jsx("span",{children:`+${n?.idd_prefix}`}),a&&jsx(ee,{component:"span",children:"*"}),jsx(R,{component:"img",src:Cb,alt:"d",className:"arrow",sx:{...A$1&&{transform:"rotate(180deg)"}}})]}),jsx(ve,{open:A$1,anchorEl:s,children:jsxs(X,{component:"article","data-testid":"CountriesWrapper",children:[jsx(j,{endAdornment:jsx("img",{src:A,alt:"arrow"}),onChange:fe,value:b,hideArrows:true}),jsx(Y,{children:F.map(r=>jsxs(Z,{onClick:()=>{ce(r);},children:[r.logo?jsx("img",{src:r.logo,alt:"c",className:"logo"}):jsx(T,{variant:"rectangular",className:"logo"}),jsx("span",{children:`+${r.idd_prefix}`})]},`country-code-${r.countryId}`))})]})})]})})}var ne=memo(Pe);var Le=ne;function E(e){let n=zc(useId(),"inputs-input"),{control:o}=useFormContext();return jsx(Controller,{name:e.name,control:o,render:({field:a,fieldState:{error:t}})=>{let i=e.feedback,{isProvided:l,isVisible:s,type:g}=Bc(i),F=e.label??e.placeholder,u=e.label&&typeof e.placeholder=="string"?e.placeholder:void 0,b=t?.message??e.helperText,h=!l&&b?jsx(K,{children:b}):null;return jsxs(Box,{sx:{display:"flex",alignItems:"stretch",height:"100%",flexDirection:"column",flex:1},children:[jsx(_,{id:n,"data-testid":"InputWrapper",children:jsx(I,{rows:1,hasError:(!!t?.message||!!e.error)&&!l,hasFeedback:s,feedbackType:g,...a,variant:"standard",label:F,placeholder:u,size:"small",required:e.required,fullWidth:true,InputProps:{disabled:e.disabled,disableUnderline:true,...e.InputProps,sx:{fontSize:"11px",height:"40px",padding:"8px",borderRadius:s?"4px 4px 0 0":"4px",...e.InputProps?.sx},endAdornment:e?.InputProps?.endAdornment},InputLabelProps:{...e.InputLabelProps,sx:{color:"#8D8D94 !important",fontSize:"11px",padding:"8px",...e.InputLabelProps?.sx}},sx:e?.sx,disabled:e?.disabled,focused:e?.focused,type:e?.type,hideArrows:e?.hideArrows,onKeyDown:e?.onKeyDown})}),h,l?jsx(ba,{...i}):null]})}})}var H=E;var pe=styled("img")(()=>({width:"12px",height:"12px",marginRight:"4px"})),le=styled("div")(({theme:e})=>({display:"flex",alignItems:"center",color:`${e.palette.custom[500]}`,fontSize:"10px",padding:"8px 12px",background:"#FF000026",borderRadius:"0 0 4px 4px",borderTop:"none",height:"32px"}));function z({showSearchIcon:e=true,error:n,errorMessage:o,feedback:a,...t}){let i=zc(useId(),"search-input"),l=!!(n&&o&&!a);return jsxs(Box,{id:i,"data-testid":"SearchInput",children:[jsx(H,{InputProps:{endAdornment:!t.disabled&&e&&jsx(Box,{component:"img",maxWidth:"16px",maxHeight:"16px",src:A,alt:"search"}),sx:{...l&&{border:"1px solid #FF000026",borderBottom:"none",borderRadius:"4px 4px 0 0"}},...t.InputProps},sx:{...l&&{border:"1px solid #FF000026",borderBottom:"none",borderRadius:"4px 4px 0 0"}},feedback:a,error:n,...t}),l&&jsxs(le,{children:[jsx(pe,{src:Qf}),jsx(Typography,{color:"red",fontSize:"10px",children:o})]})]})}var Ae=z;function D(e){let n=zc(useId(),"inputs-select"),{control:o}=useFormContext();return jsx(Controller,{name:e.name,control:o,render:({field:a,fieldState:{error:t}})=>jsxs(Box,{id:n,"data-testid":"InputsSelect",sx:{display:"flex",alignItems:"stretch",height:"100%",flexDirection:"column",flex:1},children:[jsxs(FormControl,{variant:"filled",sx:{minWidth:52,height:"40px !important",maxHeight:"40px !important",width:"100%","& .MuiFormLabel-asterisk":{color:"red"},"& .MuiFormLabel-root":{fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%",transform:"translate(8px, 15px) scale(1)"},".MuiFormLabel-root.MuiFormLabel-filled":{transform:"translate(8px, 8px) scale(0.75) "},".MuiFormLabel-root.Mui-focused":{transform:"translate(8px, 8px) scale(0.75)",fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%"}},required:e.required,children:[jsx(InputLabel,{id:"demo-simple-select-filled-label",sx:{fontSize:"11px",color:"#8D8D94 !important"},children:e.label}),jsx(Select,{inputProps:{sx:{backgroundColor:"#F9F9F9 !important",borderRadius:"4px",fontSize:"11px"}},...a,value:a.value??"",error:!!t,disableUnderline:true,required:true,labelId:"demo-simple-select-filled-label",id:"demo-simple-select-filled",sx:{width:"100%",height:"40px !important",maxHeight:"40px !important",borderRadius:"4px",overflow:"hidden",".MuiSelect-select":{padding:"0px 8px !important",height:"40px !important",maxHeight:"40px !important",display:"flex",alignItems:"flex-end !important"},".MuiSelect-filled":{padding:"0px 8px !important"},...t&&{border:"1px solid #FF3D00"}},children:(e.options||[]).map((i,l)=>jsx(MenuItem,{value:i.value??"",sx:{fontSize:"12px"},children:i.label},`${l}-${i.value??""}`))})]}),t?.message&&jsx(Box,{component:"small",sx:i=>({color:i.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}),children:t.message})]})})}var Oe=D;export{Fe as a,te as b,oe as c,Le as d,H as e,Ae as f,Oe as g};
|
|
1
|
+
import {a}from'./chunk-XFKIRVNC.js';import {aa,ba}from'./chunk-XGZGBCXK.js';import {zc,Bc}from'./chunk-2OTSLKKQ.js';import {Cb,A,Qf}from'./chunk-M5HS3EYQ.js';import {memo,useId,useState,useEffect,useRef}from'react';import {styled,Box,TextField,Button,Typography,FormControl,InputLabel,Select,MenuItem}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import R from'@mui/material/Box';import Me from'@mui/material/ClickAwayListener';import ve from'@mui/material/Popper';import T from'@mui/material/Skeleton';import {styled as styled$1}from'@mui/material/styles';import {useFormContext,Controller}from'react-hook-form';var _=styled(Box)(()=>({display:"flex",flexDirection:"column",gap:"4px",width:"100%",height:40,"& *":{flex:1,margin:"0px !important"}})),I=styled(TextField,{shouldForwardProp:e=>!["hasError","feedbackType","hasFeedback","hideArrows"].includes(e)})(({theme:e,hasError:n,feedbackType:o,hasFeedback:l,hideArrows:t})=>{let{borderColor:i}=aa(e,o),a=l?"4px 4px 0 0":"4px",s="#F2F2F2";return o&&(s=i),n&&!o&&(s=e.palette.error.main),{"& .MuiFormLabel-asterisk":{color:"red"},"& .MuiInputBase-root":{maxHeight:"40px !important",alignItems:"flex-end !important"},"& fieldset":{border:"1px solid red"},"&:hover fieldset":{border:"1px solid green"},"&.Mui-focused fieldset":{border:"1px solid blue"},border:`1px solid ${s}`,borderBottom:l?"none":void 0,borderRadius:a,"& .MuiInputBase-input":{margin:"0px !important",padding:"0px !important",color:"#20232B !important",fontSize:"11px !important",fontStyle:"normal !important",fontWeight:"500 !important",lineHeight:"130% !important"},"& .MuiFormLabel-root":{fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%",transform:"translate(0, 8px) scale(1)"},".MuiFormLabel-root.MuiFormLabel-filled, .MuiFormLabel-root.MuiInputLabel-shrink":{transform:"translate(0, -1.5px) scale(0.75) "},".MuiFormLabel-root.Mui-focused":{transform:"translate(0, -1.5px) scale(0.75)",fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%"},...t&&{"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0},"& input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}}}}),K=styled("small")(({theme:e})=>({color:e.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}));var U=styled("div")(()=>({position:"relative",display:"flex",justifyContent:"flex-end",alignItems:"center"})),O=styled(I)(({theme:e})=>({fontSize:"11px",lineHeight:"11px",color:e.palette.common.black,borderRadius:"5px",boxShadow:"0px 0px 6px 0px rgba(0, 0, 0, 0.11);",padding:"4px 8px",height:"32px",border:"none",outline:"none",width:"100%","&:focus":{border:"1px solid #1F88D0"}})),G=styled(Button)(({theme:e})=>({display:"flex",height:"24px",padding:"8px",justifyContent:"center",alignItems:"center",gap:"8px",backgroundColor:e.palette.divider,color:e.palette.grey[700],fontSize:"9px",fontWeight:500,textTransform:"none",position:"absolute",right:4,opacity:"1 !important",top:4,borderRadius:"4px"}));function L(e){let n=zc(useId(),"file-input"),o=useRef(null);return jsxs(Fragment,{children:[jsxs(U,{id:n,"data-testid":"InputContainer",children:[jsx(O,{value:o.current?.files?.[0]?.name||"",...e}),jsx(G,{onClick:()=>{o.current?.click();},children:"Browse"})]}),jsx("input",{type:"file",ref:o,style:{display:"none"}})]})}var Fe=L;var Q=styled$1("button")(({theme:e})=>({display:"flex",gap:"4px",alignItems:"center",".logo":{width:"15.568px",height:"10.889px",borderRadius:"3px"},".arrow":{width:14},span:{color:e.palette.text.primary,fontWeight:500,fontSize:"11px"},height:24,cursor:"pointer"})),X=styled$1(R)(({theme:e})=>({backgroundColor:e.palette.common.white,padding:"4px 8px",borderRadius:"4px",border:`1px solid ${e.palette.divider}`,width:100})),Y=styled$1("ul")(()=>({listStyle:"none",padding:0,margin:0,maxHeight:100,overflow:"auto"})),Z=styled$1("li")(({theme:e})=>({display:"flex",gap:"4px",alignItems:"center",".logo":{width:"15.568px",height:"10.889px",borderRadius:"3px"},".arrow":{width:14},span:{color:e.palette.text.primary,fontWeight:500,fontSize:"11px"},height:24,cursor:"pointer"})),j=styled$1(a)(()=>({height:24,padding:"4px",marginBottom:"4px"})),ee=styled$1(R)(()=>({color:"red !important"}));styled$1("small")(({theme:e})=>({color:e.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}));var te=styled$1(R)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,display:"flex",position:"relative",paddingInline:"8px",alignItems:"center",borderRadius:"4px",height:"40px"})),oe=styled$1(a,{shouldForwardProp:e=>e!=="error"})(({error:e})=>({img:{cursor:"pointer"},...e&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"}}));function Pe({defaultCountry:e,value:n,onChangeCountry:o,required:l,countries:t=[],isLoading:i=false}){let a=zc(useId(),"countries-dropdown"),[s,g]=useState(null),[F,u]=useState([]),[b,h]=useState(),ue=()=>{if(t&&e){let r=t.find(x=>x.iso2===e);r&&o?.(r);}};useEffect(()=>{u(t||[]),ue();},[t]);let A$1=!!s,xe=r=>{r.stopPropagation(),g(r.currentTarget);},N=()=>{g(null),h(void 0);},ce=r=>{o?.(r),N(),u(t);},fe=r=>{let x=Number(r.target.value);if(h(x),!x){u(t);return}u(t.filter(ge=>ge.idd_prefix.toString().startsWith(x.toString())));};return i?jsx(T,{variant:"rectangular",width:56.5,height:20,sx:{borderRadius:"4px"}}):jsx(Me,{onClickAway:N,children:jsxs(R,{id:a,"data-testid":"CountriesCode",sx:{position:"relative"},children:[jsxs(Q,{type:"button",onClick:xe,sx:{backgroundColor:"transparent",border:"none",height:34},children:[n?.logo?jsx("img",{src:n.logo,alt:"c",className:"logo"}):jsx(T,{variant:"rectangular",className:"logo"}),jsx("span",{children:`+${n?.idd_prefix}`}),l&&jsx(ee,{component:"span",children:"*"}),jsx(R,{component:"img",src:Cb,alt:"d",className:"arrow",sx:{...A$1&&{transform:"rotate(180deg)"}}})]}),jsx(ve,{open:A$1,anchorEl:s,children:jsxs(X,{component:"article","data-testid":"CountriesWrapper",children:[jsx(j,{endAdornment:jsx("img",{src:A,alt:"arrow"}),onChange:fe,value:b,hideArrows:true}),jsx(Y,{children:F.map(r=>jsxs(Z,{onClick:()=>{ce(r);},children:[r.logo?jsx("img",{src:r.logo,alt:"c",className:"logo"}):jsx(T,{variant:"rectangular",className:"logo"}),jsx("span",{children:`+${r.idd_prefix}`})]},`country-code-${r.countryId}`))})]})})]})})}var ne=memo(Pe);var Le=ne;function E(e){let n=zc(useId(),"inputs-input"),{control:o}=useFormContext();return jsx(Controller,{name:e.name,control:o,render:({field:l,fieldState:{error:t}})=>{let i=e.feedback,{isProvided:a,isVisible:s,type:g}=Bc(i),F=e.label??e.placeholder,u=e.label&&typeof e.placeholder=="string"?e.placeholder:void 0,b=t?.message??e.helperText,h=!a&&b?jsx(K,{children:b}):null;return jsxs(Box,{sx:{display:"flex",alignItems:"stretch",height:"100%",flexDirection:"column",flex:1},children:[jsx(_,{id:n,"data-testid":"InputWrapper",children:jsx(I,{rows:1,hasError:(!!t?.message||!!e.error)&&!a,hasFeedback:s,feedbackType:g,...l,variant:"standard",label:F,placeholder:u,size:"small",required:e.required,fullWidth:true,InputProps:{disabled:e.disabled,disableUnderline:true,...e.InputProps,sx:{fontSize:"11px",height:"40px",padding:"8px",borderRadius:s?"4px 4px 0 0":"4px",...e.InputProps?.sx},endAdornment:e?.InputProps?.endAdornment},InputLabelProps:{...e.InputLabelProps,sx:{color:"#8D8D94 !important",fontSize:"11px",padding:"8px",...e.InputLabelProps?.sx}},sx:e?.sx,disabled:e?.disabled,focused:e?.focused,type:e?.type,hideArrows:e?.hideArrows,onKeyDown:e?.onKeyDown})}),h,a?jsx(ba,{...i}):null]})}})}var H=E;var pe=styled("img")(()=>({width:"12px",height:"12px",marginRight:"4px"})),le=styled("div")(({theme:e})=>({display:"flex",alignItems:"center",color:`${e.palette.custom[500]}`,fontSize:"10px",padding:"8px 12px",background:"#FF000026",borderRadius:"0 0 4px 4px",borderTop:"none",height:"32px"}));function z({showSearchIcon:e=true,error:n,errorMessage:o,feedback:l,...t}){let i=zc(useId(),"search-input"),a=!!(n&&o&&!l);return jsxs(Box,{id:i,"data-testid":"SearchInput",children:[jsx(H,{InputProps:{endAdornment:!t.disabled&&e&&jsx(Box,{component:"img",maxWidth:"16px",maxHeight:"16px",src:A,alt:"search"}),sx:{...a&&{border:"1px solid #FF000026",borderBottom:"none",borderRadius:"4px 4px 0 0"}},...t.InputProps},sx:{...a&&{border:"1px solid #FF000026",borderBottom:"none",borderRadius:"4px 4px 0 0"}},feedback:l,error:n,...t}),a&&jsxs(le,{children:[jsx(pe,{src:Qf}),jsx(Typography,{color:"red",fontSize:"10px",children:o})]})]})}var Ae=z;function D(e){let n=zc(useId(),"inputs-select"),{control:o}=useFormContext();return jsx(Controller,{name:e.name,control:o,render:({field:l,fieldState:{error:t}})=>jsxs(Box,{id:n,"data-testid":"InputsSelect",sx:{display:"flex",alignItems:"stretch",height:"100%",flexDirection:"column",flex:1},children:[jsxs(FormControl,{variant:"filled",sx:{minWidth:52,height:"40px !important",maxHeight:"40px !important",width:"100%","& .MuiFormLabel-asterisk":{color:"red"},"& .MuiFormLabel-root":{fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%",transform:"translate(8px, 15px) scale(1)"},".MuiFormLabel-root.MuiFormLabel-filled":{transform:"translate(8px, 8px) scale(0.75) "},".MuiFormLabel-root.Mui-focused":{transform:"translate(8px, 8px) scale(0.75)",fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%"}},required:e.required,children:[jsx(InputLabel,{id:"demo-simple-select-filled-label",sx:{fontSize:"11px",color:"#8D8D94 !important"},children:e.label}),jsx(Select,{inputProps:{sx:{backgroundColor:"#F9F9F9 !important",borderRadius:"4px",fontSize:"11px"}},...l,value:l.value??"",error:!!t,disableUnderline:true,required:true,labelId:"demo-simple-select-filled-label",id:"demo-simple-select-filled",sx:{width:"100%",height:"40px !important",maxHeight:"40px !important",borderRadius:"4px",overflow:"hidden",".MuiSelect-select":{padding:"0px 8px !important",height:"40px !important",maxHeight:"40px !important",display:"flex",alignItems:"flex-end !important"},".MuiSelect-filled":{padding:"0px 8px !important"},...t&&{border:"1px solid #FF3D00"}},children:(e.options||[]).map(i=>jsx(MenuItem,{value:i.value??"",sx:{fontSize:"12px"},children:i.label},i.value??""))})]}),t?.message&&jsx(Box,{component:"small",sx:i=>({color:i.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}),children:t.message})]})})}var Oe=D;export{Fe as a,te as b,oe as c,Le as d,H as e,Ae as f,Oe as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-HDCNWBW5.js';import {d,R,L,V as V$1}from'./chunk-XGZGBCXK.js';import {lc}from'./chunk-2OTSLKKQ.js';import {Eb,A as A$1,Pc,vb}from'./chunk-M5HS3EYQ.js';import {forwardRef,useState,useMemo,memo,useRef,useLayoutEffect}from'react';import
|
|
1
|
+
import {a}from'./chunk-HDCNWBW5.js';import {d,R,L,V as V$1}from'./chunk-XGZGBCXK.js';import {lc}from'./chunk-2OTSLKKQ.js';import {Eb,A as A$1,Pc,vb}from'./chunk-M5HS3EYQ.js';import {forwardRef,useState,useMemo,memo,useRef,useLayoutEffect}from'react';import Xe from'@mui/material/ClickAwayListener';import {CircularProgress}from'@mui/material';import M from'@mui/material/Box';import j from'@mui/material/Typography';import {styled,alpha}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var N="os-shared-NestedMultiSelect",c={root:`${N}-root`,open:`${N}-open`,label:`${N}-label`,placeholder:`${N}-placeholder`,arrow:`${N}-arrow`,menu:`${N}-menu`,search:`${N}-search`,selectedBadge:`${N}-selectedBadge`,fieldRow:`${N}-fieldRow`};var ee=e=>({display:"flex",padding:"4px 8px 4px 6px",alignItems:"center",gap:"4px",borderRadius:"13px",backgroundColor:e,fontSize:"10px",fontWeight:500,cursor:"pointer"}),te=styled(M,{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:t=false})=>{let{base:l}=e.v2.palette;return {width:"100%",boxSizing:"border-box",minHeight:47,textAlign:"left",flexDirection:"column",border:`1px solid ${t?"#FAFBFB":"transparent"}`,borderRadius:"4px",backgroundColor:t?"#FAFBFB":e.palette.grey[400],minWidth:"89px",position:"relative",cursor:t?"not-allowed":"pointer",...t&&{color:alpha(l.black,.6),[`& .${c.label}`]:{opacity:.7,cursor:"not-allowed"},[`& .${c.placeholder}`]:{color:alpha(l.black,.6)},[`& .${c.arrow}`]:{opacity:.6},[`& .${c.fieldRow}`]:{opacity:.7},[`& .${c.fieldRow} *`]:{cursor:"not-allowed"}},[`&.${c.open} .${c.arrow}`]:{transform:"rotate(180deg)"}}}),le=styled(j)(({theme:e})=>({position:"absolute",top:9,left:8,margin:0,cursor:"pointer",fontSize:"10px",fontWeight:500,lineHeight:"100%",color:e.palette.grey[700],display:"block",pointerEvents:"none"})),oe=styled(j)(()=>({margin:0,fontWeight:500,fontSize:"11px",lineHeight:"18px",padding:"22px 24px 8px 8px"})),ne=styled(M)(({theme:e})=>({position:"absolute",top:15,right:4,width:16,height:16,display:"inline-flex",alignItems:"center",justifyContent:"center",color:"inherit",lineHeight:0,transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter})})),ie=styled(M)(()=>({display:"flex",flexDirection:"column",padding:"8px"})),re=styled(M)(()=>({display:"flex",columnGap:"8px",rowGap:"8px",flexWrap:"wrap",paddingInlineEnd:"20px"})),se=styled(M)(({theme:e})=>({...ee(`${e.palette.info.dark}1a`),maxWidth:"150px"})),ae=styled("span")(()=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),ce=styled(M)(()=>({position:"relative",width:"100%",minWidth:0})),de=styled(M)(()=>({display:"flex",flexWrap:"nowrap",alignItems:"center",gap:"4px",width:"100%",minWidth:0,overflow:"hidden",padding:"22px 24px 8px 8px"})),k=styled(M,{shouldForwardProp:e=>e!=="$truncate"})(({theme:e,$truncate:t})=>({...ee(`${e.palette.info.dark}1a`),overflow:"hidden",cursor:"inherit",flex:t?"1 1 auto":"0 0 auto",width:"max-content",maxWidth:t?"100%":"none",minWidth:t?0:"auto"})),ue=styled("span")(()=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0})),pe=styled("span")(()=>({position:"fixed",left:0,top:0,visibility:"hidden",pointerEvents:"none",whiteSpace:"nowrap",width:"max-content",display:"inline-flex",padding:"4px 8px 4px 6px",fontSize:"10px",fontWeight:500})),Se=styled(M)(()=>({flex:1,maxWidth:"220px",minWidth:"89px"})),me=styled(M,{shouldForwardProp:e=>e!=="$maxWidth"})(({$maxWidth:e})=>({display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,alignItems:"center",maxWidth:e,minWidth:"89px"}));function fe(e,t,l){let i=4*Math.max(e.length-1,0);if(e.reduce((s,a)=>s+a,0)+i<=t)return {count:e.length,truncateLast:false};let r=0,n=0;for(let s=0;s<e.length;s+=1){let a=n>0?4:0,d=s===e.length-1?0:4+l;if(r+a+e[s]+d<=t){r+=a+e[s],n+=1;continue}let x=t-r-a-d;if(n===0||x>=48)return {count:n+1,truncateLast:true};break}return {count:Math.max(n,1),truncateLast:false}}function Me(e,t,l,i){let o=e.length;if(o===0)return {count:0,truncateLast:false};let r=4*Math.max(o-1,0),s=e.reduce((a,h)=>a+h,0)+r+(i?4+l:0);return {count:o,truncateLast:s>t}}var W=e=>!e.options&&typeof e.value=="string",E=e=>e.value??e.label,I=(e,t)=>t?.some(l=>l.value===e.value)??false,Ne=(e,t,l)=>{if(I(e,t)){l(t?.filter(i=>i.value!==e.value)||[]);return}l([...t||[],e]);},A=e=>W(e)?[e]:(e.options??[]).flatMap(A),$=(e,t)=>{let l=e.filter(i=>I(i,t)).length;return {allSelected:e.length>0&&l===e.length,someSelected:l>0&&l<e.length}},he=(e,t,l)=>{let i=new Set(e.map(n=>n.value));if($(e,t).allSelected){l((t??[]).filter(n=>!i.has(n.value)));return}let o=new Set((t??[]).map(n=>n.value)),r=e.filter(n=>!o.has(n.value));l([...t??[],...r]);},ke=(e,t)=>{let l=e[t];return typeof l=="string"?l:""},Ae=(e,t,l)=>l.some(i=>ke(e,i).toLowerCase().includes(t)),D=(e,t,l)=>{if(!t)return e;let i=t.toLowerCase();return e.reduce((o,r)=>{if(W(r))return Ae(r,i,l)&&o.push(r),o;let n=D(r.options??[],t,l);return n.length>0&&o.push({...r,options:n}),o},[])};function He({options:e,maxVisibleSelected:t}){let l=useRef(null),i=useRef(null),o=typeof t=="number"&&Number.isFinite(t),r=o?Math.max(0,Math.floor(t)):e.length,[n,s]=useState({count:Math.min(r,e.length),truncateLast:false});useLayoutEffect(()=>{let d=l.current,f=i.current;if(!d||!f)return;let x=()=>{let g=e.slice(0,r).map(y=>(f.textContent=y.label,f.offsetWidth));f.textContent=`+${e.length}`;let C=f.offsetWidth,L=getComputedStyle(d),b=d.clientWidth-parseFloat(L.paddingLeft)-parseFloat(L.paddingRight),m=o?Me(g,b,C,e.length>g.length):fe(g,b,C);s(y=>y.count===m.count&&y.truncateLast===m.truncateLast?y:m);};x();let w=new ResizeObserver(x);return w.observe(d),()=>w.disconnect()},[r,o,e]);let a=e.slice(0,n.count),h=e.length-n.count;return jsxs(ce,{children:[jsx(pe,{ref:i,"aria-hidden":true}),jsxs(de,{ref:l,className:c.fieldRow,children:[a.map((d,f)=>{let x=n.truncateLast&&f===a.length-1;return jsx(k,{$truncate:x,children:jsx(ue,{children:d.label})},d.value)}),h>0?jsx(k,{children:jsxs("span",{children:["+",h]})}):null]})]})}var ye=He;function we({label:e,maxWidth:t,itemCount:l,isSelected:i,isIndeterminate:o,onToggle:r,children:n}){let[s,a]=useState(null);return jsxs(V$1,{isSelected:i,isIndeterminate:o,onClick:d=>{d.stopPropagation(),d.preventDefault(),r();},onMouseEnter:d=>{l>0&&a(d.currentTarget);},onMouseLeave:()=>{s&&a(null);},children:[jsxs(me,{$maxWidth:t,children:[e,jsx("img",{src:vb,className:"arrow-icon",alt:"arrow"})]}),jsx(R,{sx:{maxHeight:"450px",overflow:"auto"},open:!!s,anchorEl:s,placement:"right-start",children:n})]})}function Ce({option:e,value:t,onChange:l}){let i=o=>{o.stopPropagation(),o.preventDefault(),Ne(e,t,l);};return jsx(V$1,{isSelected:I(e,t),onClick:i,children:jsx(Se,{children:e.label})})}var Ve=340,ze=220;function V({node:e,depth:t,value:l,onChange:i}){if(W(e))return jsx(Ce,{option:e,value:l,onChange:i});if(!e.options)return null;let o=e.options,r=A(e),{allSelected:n,someSelected:s}=$(r,l);return jsx(we,{label:e.label,maxWidth:t===0?Ve:ze,itemCount:o.length,isSelected:n,isIndeterminate:s,onToggle:()=>he(r,l,i),children:o.map(a=>jsx(V,{node:a,depth:t+1,value:l,onChange:i},E(a)))})}var Ye=["label"],Pe=forwardRef(({options:e,onChange:t,value:l,maxVisibleSelected:i,placeholder:o,label:r,isLoading:n,searchBy:s=Ye,disabled:a$1,className:h,sx:d$1,searchable:f=true,searchPlaceholder:x,onOpen:w,onClose:g},C)=>{let[L$1,b]=useState(null),[m,y]=useState(""),v=!!L$1,Be=r??o,Fe=r?o??"Please Select":"Please Select",Oe=u=>{if(v){b(null),g?.();return}b(u.currentTarget),w?.();},We=()=>{b(null),g?.();},Ee=()=>{m&&y("");},Ie=useMemo(()=>D(e,m,s),[e,m,s]),G=l?.length??0,Re=n?jsx(CircularProgress,{size:16}):jsx(d,{src:m?Eb:A$1,alt:m?"close":"search",onClick:Ee,sx:{width:12,height:12,cursor:m?"pointer":"default"}});return jsx(Xe,{onClickAway:()=>{v&&We();},children:jsxs(te,{ref:C,id:"FieldWrapper","data-testid":"NestedMultiSelect",$disabled:a$1,"aria-disabled":a$1||void 0,className:lc(c.root,v&&c.open,h),sx:d$1,onClick:u=>!a$1&&Oe(u),children:[jsx(le,{className:c.label,component:"label",children:Be}),G===0&&jsx(oe,{className:c.placeholder,component:"p",children:Fe}),jsx(ne,{className:c.arrow,"aria-hidden":true,children:jsx(a,{})}),G>0&&l?jsx(ye,{options:l,maxVisibleSelected:i}):null,jsx(R,{open:v,anchorEl:L$1,sx:{margin:"8px 0",maxHeight:330,overflow:"auto",maxWidth:"340px"},panelProps:{className:c.menu},children:jsxs(ie,{children:[f?jsx(L,{className:c.search,fullWidth:true,size:"md",placeholder:x??o??"Select",endAdornment:Re,value:m,onClick:u=>{u.stopPropagation();},onMouseDown:u=>{u.stopPropagation();},onChange:u=>{y(u.target.value);},sx:{mb:"4px"}}):null,jsx(re,{children:l?.map(u=>jsxs(se,{className:c.selectedBadge,onClick:K=>{K.stopPropagation(),K.preventDefault(),t(l?.filter(Te=>Te.value!==u.value)||[]);},children:[jsx(d,{src:Pc,alt:"blue-check",sx:{width:10,height:7.5}}),jsx(ae,{children:u.label}),jsx(d,{src:Eb,alt:"close",sx:{width:9,height:9}})]},u.value))}),Ie.map(u=>jsx(V,{node:u,depth:0,value:l,onChange:t},E(u)))]})})]})})});Pe.displayName="NestedMultiSelect";var Je=memo(Pe);export{c as a,Je as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {styled,Box,Typography,alpha}from'@mui/material';import {jsx,jsxs}from'react/jsx-runtime';var c=styled(Box)({display:"flex",flexDirection:"column"}),s=styled(Box)({display:"flex",position:"relative",paddingBottom:4,"&:last-child":{paddingBottom:0}}),f=styled(Box)({display:"flex",flexDirection:"column",alignItems:"center",marginInlineEnd:12,position:"relative"}),x=styled(Box,{shouldForwardProp:e=>e!=="colorVariant"})(({theme:e,colorVariant:i="default"})=>({width:12,height:12,borderRadius:"50%",backgroundColor:i==="error"?"#CC0000":i==="pending"?e.palette.grey[100]:e.palette.info.dark,flexShrink:0,marginTop:4})),g=styled(Box,{shouldForwardProp:e=>e!=="isNextPending"})(({theme:e,isNextPending:i})=>({width:3,height:34,backgroundColor:i?e.palette.grey[100]:e.palette.info.dark,marginBlock:4,borderRadius:2})),u=styled(Box)({display:"flex",flexDirection:"column",gap:2,flex:1}),y=styled(Typography,{shouldForwardProp:e=>e!=="colorVariant"})(({theme:e,colorVariant:i="default"})=>({fontSize:12,fontWeight:700,lineHeight:"19px",...i==="error"&&{color:"#CC0000"},...i==="pending"&&{color:alpha(e.palette.text.primary,.3)}})),I=styled(Typography)(({theme:e})=>({fontSize:11,fontWeight:500,color:alpha(e.palette.text.primary,.5)})),h=styled(Box)({display:"flex",alignItems:"center",justifyContent:"center",marginInlineStart:"auto",alignSelf:"center"});function S({steps:e,className:i}){return jsx(c,{className:i,children:e.map((t,
|
|
1
|
+
import {styled,Box,Typography,alpha}from'@mui/material';import {jsx,jsxs}from'react/jsx-runtime';var c=styled(Box)({display:"flex",flexDirection:"column"}),s=styled(Box)({display:"flex",position:"relative",paddingBottom:4,"&:last-child":{paddingBottom:0}}),f=styled(Box)({display:"flex",flexDirection:"column",alignItems:"center",marginInlineEnd:12,position:"relative"}),x=styled(Box,{shouldForwardProp:e=>e!=="colorVariant"})(({theme:e,colorVariant:i="default"})=>({width:12,height:12,borderRadius:"50%",backgroundColor:i==="error"?"#CC0000":i==="pending"?e.palette.grey[100]:e.palette.info.dark,flexShrink:0,marginTop:4})),g=styled(Box,{shouldForwardProp:e=>e!=="isNextPending"})(({theme:e,isNextPending:i})=>({width:3,height:34,backgroundColor:i?e.palette.grey[100]:e.palette.info.dark,marginBlock:4,borderRadius:2})),u=styled(Box)({display:"flex",flexDirection:"column",gap:2,flex:1}),y=styled(Typography,{shouldForwardProp:e=>e!=="colorVariant"})(({theme:e,colorVariant:i="default"})=>({fontSize:12,fontWeight:700,lineHeight:"19px",...i==="error"&&{color:"#CC0000"},...i==="pending"&&{color:alpha(e.palette.text.primary,.3)}})),I=styled(Typography)(({theme:e})=>({fontSize:11,fontWeight:500,color:alpha(e.palette.text.primary,.5)})),h=styled(Box)({display:"flex",alignItems:"center",justifyContent:"center",marginInlineStart:"auto",alignSelf:"center"});function S({steps:e,className:i}){return jsx(c,{className:i,children:e.map((t,a)=>{let m=a===e.length-1,p=t.variant??"default",C=m?"default":e[a+1].variant??"default",b=t.id??`${t.title}-${t.subtitle??""}`;return jsxs(s,{children:[jsxs(f,{children:[jsx(x,{colorVariant:p}),!m&&jsx(g,{isNextPending:C==="pending"})]}),jsxs(u,{children:[jsx(y,{colorVariant:p,children:t.title}),t.subtitle&&jsx(I,{children:t.subtitle})]}),t.endAdornment&&jsx(h,{children:t.endAdornment})]},b)})})}var P=S;export{P as a};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {a as a$3}from'./chunk-4WRWJH73.js';import {a,b,f as f$1,d,c,h as h$1,i,e}from'./chunk-RGAQ3SMH.js';import {a as a$1}from'./chunk-FUHQHDFU.js';import {a as a$2,b as b$1}from'./chunk-MUR4ILTY.js';import {f,aa,j,P,O,h,ba,d as d$1}from'./chunk-XGZGBCXK.js';import {zc,Bc}from'./chunk-2OTSLKKQ.js';import {Pc,A}from'./chunk-M5HS3EYQ.js';import*as de from'react';import de__default,{useId,useState,useEffect,useMemo,useRef,useCallback}from'react';import {useFormContext,Controller,FormProvider,useForm}from'react-hook-form';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import te from'@mui/material/Box';import Ct from'@mui/material/Button';import It from'@mui/material/Input';import io from'@mui/material/ListSubheader';import co from'@mui/material/MenuItem';import {keyframes,styled,alpha}from'@mui/material/styles';import Lt from'@mui/material/Popper';import wt from'@mui/material/TextField';function ut({onSubmit:e,methods:o,children:t}){let r=zc(useId(),"default-form");return jsx(FormProvider,{...o,children:jsx("form",{id:r,"data-testid":"DefaultForm",onSubmit:e,noValidate:true,children:t})})}var dt=de__default.memo(ut);var je=de.forwardRef(({name:e,helperText:o,hideArrows:t,feedback:r,...n},a$1)=>{let{control:p}=useFormContext();return jsx(Controller,{name:e,control:p,defaultValue:n.defaultValue,render:({field:d,fieldState:s})=>jsx(a,{...n,...d,ref:a$1,hasError:!!s.error,helperText:o??s.error?.message,feedback:r,hideArrows:t,onChange:h=>{d.onChange(h),n.onChange?.(h);},onWheel:h=>{h.target instanceof HTMLElement&&h.target.blur();}})})});je.displayName="RFHFormInput";var eo=de.memo(je);var ft=eo;function to({phoneName:e,countries:o,countryName:t,helperText:r,isCountriesLoading:n,disabled:a,feedback:p,...d}){let{control:s,watch:h,setValue:S}=useFormContext(),C=h(t),g=y=>{S(t,y);};return jsx(Controller,{name:e,control:s,render:({field:{onChange:y,value:m},fieldState:x})=>jsx(h$1,{...d,phoneValue:m,countries:o,hasError:!!x.error,helperText:r??x.error?.message,feedback:p,onPhoneChange:u=>{y(u);},disabled:a,countryValue:C,onCountryChange:g,isCountriesLoading:n})})}to.displayName="RFHPhoneInput";var no=to;var bt=no;var Ie=(e,o)=>e.toFixed(o);function ao({amountName:e,currencies:o,currencyName:t,helperText:r,isCurrenciesLoading:n,...a}){let{control:p,watch:d,setValue:s}=useFormContext(),h=d(t),S=d(e),C=g=>{s(t,g),s(e,Ie(Number(S),g?.decimals||2));};return jsx(Controller,{name:e,control:p,render:({field:{onChange:g,value:y},fieldState:m})=>jsx(i,{...a,amountValue:y??"",currencies:o,hasError:!!m.error,helperText:r??m.error?.message,onAmountChange:x=>{g(x);},onAmountBlur:x=>{g(Ie(Number(x),h?.decimals||2));},currencyValue:h,onCurrencyChange:C,isCurrenciesLoading:n})})}ao.displayName="RFHAmountInput";var lo=ao;var Ft=lo;var Pt=keyframes`
|
|
2
|
+
0% {
|
|
3
|
+
transform: rotate(-90deg);
|
|
4
|
+
}
|
|
5
|
+
100% {
|
|
6
|
+
transform: rotate(270deg);
|
|
7
|
+
}
|
|
8
|
+
`,po=styled(te)({width:12,height:12,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:"100%",height:"100%",display:"block"},animation:`${Pt} 2s linear infinite`}),q=styled(io)(({theme:e})=>({backgroundColor:e.palette.common.white,paddingLeft:8,paddingRight:8,paddingBottom:6,lineHeight:1})),so=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"})})),uo=styled(te)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:e.spacing(1)})),mo=styled(io)(({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}})),ho=styled(Ct)(({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"})})),Rt=styled(f)(()=>({padding:0,".MuiSvgIcon-root":{width:12,height:12}})),fo=styled("img")({width:14,height:14,flexShrink:0,display:"block"}),So=styled(te)({display:"flex",alignItems:"center",width:"100%",gap:8}),go=styled(co,{shouldForwardProp:e=>e!=="$selected"})(({theme:e,$selected:o})=>({fontSize:"12px",backgroundColor:o?"#F8F8F8 !important":e.palette.common.white,"&.Mui-disabled":{opacity:1}})),bo=styled(Rt,{shouldForwardProp:e=>e!=="$mutedRect"})(({$mutedRect:e})=>e?{"& svg rect":{fill:"#BDC1CC"}}:{}),me=styled(It)(({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(co)(({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 At=keyframes`
|
|
9
|
+
0% {
|
|
10
|
+
transform: rotate(-90deg);
|
|
11
|
+
}
|
|
12
|
+
100% {
|
|
13
|
+
transform: rotate(270deg);
|
|
14
|
+
}
|
|
15
|
+
`,Co=styled(te)({width:12,height:12,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:"100%",height:"100%",display:"block"},animation:`${At} 2s linear infinite`}),he=styled(te)(({theme:e})=>({position:"relative",width:11,height:11,transform:"rotate(0deg)",color:e.palette.common.black,"& svg":{width:"100%",height:"100%",display:"block"}})),Io=styled(q)({paddingTop:"8px"}),Pe=styled("ul")({listStyle:"none",margin:0,padding:0}),Mo=styled(co)(({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"}})),Po=styled(co,{shouldForwardProp:e=>e!=="$selected"})(({theme:e,$selected:o})=>({fontSize:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(1),backgroundColor:o?e.palette.action.hover:e.palette.common.white})),fe=styled("span")({flex:1,minWidth:0}),Se=styled("img")({width:10,height:7.5,flexShrink:0}),Ro=styled("li",{shouldForwardProp:e=>!["$selected","$optionDisabled"].includes(String(e))})(({theme:e,$selected:o,$optionDisabled:t})=>({fontSize:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(1),minHeight:48,paddingLeft:e.spacing(2),paddingRight:e.spacing(2),backgroundColor:o?e.palette.action.hover:e.palette.common.white,"&.Mui-focused":{backgroundColor:e.palette.action.hover},...t&&{opacity:.38,pointerEvents:"none"}})),Re=styled("span")({fontSize:"10px",fontWeight:500,color:"#8D8D94"}),Lo=styled(wt,{shouldForwardProp:e=>!["feedbackType","hasFeedback","hasLabel"].includes(e)})(({theme:e,error:o,feedbackType:t,hasFeedback:r,hasLabel:n})=>{let{borderColor:a}=t?aa(e,t):{borderColor:void 0},p=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:p,backgroundColor:e.palette.grey[400],paddingTop:n?"11px":"0px",paddingBottom:n?"4px":"0px",paddingLeft:"8px",boxSizing:"border-box",display:"inline-flex",alignItems:n?"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:n?"flex-end":"center",alignSelf:n?"flex-end":"center",fontSize:"11px",lineHeight:"11px",color:e.palette.common.black,paddingBottom:n?"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},...t&&a&&{"& .MuiFilledInput-root":{border:`1px solid ${a}`}},...r&&{"& .MuiFilledInput-root":{borderBottom:"none",borderBottomLeftRadius:0,borderBottomRightRadius:0}},...o&&{"& .MuiFilledInput-root":{border:`1px solid ${e.palette.error.main}`}}}}),xo=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"}),wo=styled(Lt,{shouldForwardProp:e=>!["$menuHasLoadingText","$suppressAutocompleteNoOptions","$suppressEmptyMenuSurface"].includes(e)})(({theme:e,$menuHasLoadingText:o,$suppressAutocompleteNoOptions:t,$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":t?{display:"none !important"}:xo(e),"& .MuiAutocomplete-loading":{...xo(e),...!o&&{display:"none"}}}));function ge({placeholder:e,value:o,onValueChange:t,isLoading:r}){let n=zc(useId(),"form-select-menu-search-input"),a=useCallback(p=>{p.stopPropagation();},[]);return jsx(me,{id:n,"data-testid":"FormSelectMenuSearchInput",placeholder:e,value:o,onChange:p=>t(p.target.value),onKeyDown:a,onKeyUp:a,onMouseDown:a,onClick:a,disableUnderline:true,fullWidth:true,inputProps:{"aria-label":e},endAdornment:r?jsx(Co,{"aria-hidden":true,children:jsx(b$1,{})}):jsx(he,{"aria-hidden":true,children:jsx(a$2,{})})})}var be=jsx(Re,{children:"No results found"}),ko=jsx(Re,{children:"Loading\u2026"});function xe(e,o,t){return o?o(e):t?t(e):e?.label}function Le(e,o,t){let r=o.toLowerCase().trim(),n=(t?t(e):e?.label)??"";return String(n).toLowerCase().includes(r)}function Ao(e){return e}function To(e){let o=de__default.forwardRef(function(r,n){let{children:a,className:p,...d}=r,s=e.current;return s?jsxs(Fragment,{children:[jsx(Io,{disableSticky:true,children:jsx(ge,{placeholder:s.menuSearchPlaceholder,value:s.searchValue,onValueChange:s.setSearchValue,isLoading:s.isLoading})}),jsx(Pe,{ref:n,className:p,...d,children:a})]}):jsx(Pe,{ref:n,className:p,...d,children:a})});return o.displayName="FormSelectMenuSearchListbox",o}function vo({menuSearchPlaceholder:e,searchValue:o,onSearchChange:t,isLoading:r,menuHasNoOptionsText:n,menuNoOptionsText:a,optionsWithoutEmptyValue:p,getOptionValue:d,getOptionLabel:s,renderOption:h,isOptionEqualToValue:S,menuHasSelectedCheckMark:C,valueOnly:g,getOptionId:y,field:m,onChange:x}){return jsxs(Fragment,{children:[jsx(q,{disableSticky:true,onMouseDown:u=>u.stopPropagation(),onClick:u=>u.stopPropagation(),children:jsx(ge,{placeholder:e,value:o,onValueChange:t,isLoading:r})}),n&&o.trim()&&p.length===0?jsx(Mo,{disabled:true,value:"__form_select_no_results__",children:a??be}):p.map((u,l)=>{let f=S?S(u,m.value):u?.id===m.value?.id,I=xe(u,h,s);return jsxs(Po,{disabled:!!u.disabled,$selected:f,value:(d?d(u):u?.id)??"",onClick:()=>{m.onChange(g?y(u):u),x?.(u);},children:[jsx(fe,{children:I}),C&&f?jsx(Se,{src:Pc,alt:""}):null]},`form-select-item-${(d?d(u):u?.id)??l}`)})]})}var ye={menuHasLoadingText:false,suppressAutocompleteNoOptions:false,suppressEmptyMenuSurface:false};function Nt(e,o){e!=null&&(typeof e=="function"?e(o):e.current=o);}function Dt(...e){return o=>{for(let t of e)Nt(t,o);}}function Wt(e){let o=t=>{let r=e.current;return jsx(wo,{...t,$menuHasLoadingText:r.menuHasLoadingText,$suppressAutocompleteNoOptions:r.suppressAutocompleteNoOptions,$suppressEmptyMenuSurface:r.suppressEmptyMenuSurface})};return o.displayName="FormSelectSearchableAutocompletePopper",o}function Bo(e){let o=zc(useId(),"form-select-searchable-field"),t=useRef(null),r=useRef(ye);t.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 n=useMemo(()=>To(t),[]),a=useMemo(()=>Wt(r),[]),p=e.feedback,{isProvided:d$1,isVisible:s,type:h}=Bc(p),S=!!e.fieldState.error&&!s,C=e.helperText??e.fieldState.error?.message,g=e.internalValue!=null&&e.internalValue!==""&&typeof e.internalValue=="object"?e.internalValue:null,y=e.getOptionLabel??(l=>String(l?.label??"")),m=e.isOptionEqualToValue??((l,f)=>l&&f?l.id===f.id:l===f),x=e.ClearIconComponent??b,u=e.label!=null&&e.label!=="";return jsxs(d,{id:o,"data-testid":"FormSelectSearchableField",children:[jsx(a$1,{...e.autocompleteRest,disableClearable:!e.showClearIcon,clearIcon:jsx(x,{sx:{fontSize:8,width:8,height:8}}),ListboxComponent:e.menuSearchable?n:void 0,PopperComponent:a,options:e.optionsWithClearFilterOnly,value:g,onChange:(l,f,I)=>{if(f==null&&e.onClear&&I==="clear"){e.onClear();return}if(e.valueOnly){let R=f==null?null:e.getOptionId(f);e.field.onChange(R);}else e.field.onChange(f);e.onChange?.(f);},onInputChange:(l,f,I)=>{e.setSearchableInputValue(f),(I==="input"||I==="clear")&&e.scheduleSearchNotification(f);},slotProps:e.slotProps??{},filterOptions:e.menuSearchable?e.autocompleteFilterOptions:Ao,loading:!!e.isLoading,disabled:!!e.disabled,getOptionLabel:y,getOptionDisabled:l=>!!l.disabled,isOptionEqualToValue:m,renderOption:e.renderAutocompleteOption,noOptionsText:e.menuNoOptionsText??be,loadingText:e.menuHasLoadingText?e.menuLoadingText??ko:null,popupIcon:jsx(he,{children:jsx(a$2,{})}),renderInput:l=>{let{inputProps:f,...I}=l,{ref:R,...K}=f;return jsx(Lo,{...I,variant:"filled",label:e.label,placeholder:e.placeholder,required:e.required,error:S,helperText:null,feedbackType:h,hasFeedback:s,hasLabel:u,inputRef:Dt(R,e.field.ref,e.inputRef),InputProps:{...l.InputProps,disableUnderline:true},inputProps:{...K,name:e.field.name,onBlur:e.field.onBlur}})}}),d$1?jsx(ba,{...p}):jsx(c,{children:C})]})}function Wo(e){let{name:o,helperText:t,feedback:r,menuSearchable:n=false,showClearIcon:a=false,ClearIconComponent:p=b,onClear:d,menuSearchPlaceholder:s="Search",getOptionValue:h,getOptionLabel:S,renderOption:C,isOptionEqualToValue:g,options:y,MenuProps:m,valueOnly:x=false,menuHasSelectedCheckMark:u=false,searchable:l=false,onSearchInputChange:f,searchDebounceMs:I=300,minSearchLength:R,menuLoadingText:K,menuHasLoadingText:b$1=false,menuHasNoOptionsText:w=true,menuNoOptionsText:v,label:ne,placeholder:G,required:i,disabled:D,isLoading:k,inputRef:Ce,onChange:W,...V}=e,{control:re}=useFormContext(),[M,Y]=useState(""),[J,Te]=useState("");useEffect(()=>{l||Te("");},[l]);let jo=useMemo(()=>({searchValue:M,setSearchValue:Y,menuSearchPlaceholder:s,isLoading:!!k}),[M,s,k]),Q=useRef(void 0),ae=useRef(f);ae.current=f,useEffect(()=>()=>{Q.current&&clearTimeout(Q.current);},[]);let et=useCallback(c=>{if(!ae.current)return;let F=c.trim();Q.current&&clearTimeout(Q.current),Q.current=setTimeout(()=>{if(F===""){ae.current?.("");return}R!=null&&F.length<R||ae.current?.(F);},I);},[I,R]),$=useMemo(()=>{let c=y??[];return !a||!h?c:c.filter(F=>{let A=h(F);return A!=null&&A!==""})},[a,h,y]),Oe=useMemo(()=>!n||!M.trim()?$:$.filter(c=>Le(c,M,S)),[n,M,$,S]),X=useMemo(()=>n?Oe:$,[n,Oe,$]),ot=useCallback(c=>!n||!M.trim()?c:c.filter(F=>Le(F,M,S)),[n,M,S]),tt=useMemo(()=>{if(!l)return ye;let c=J.trim(),F=c.length===0||R!=null&&c.length>0&&c.length<R,A=n&&!!M.trim()&&X.length===0,E=F&&!A||!w,ie=X.length>0;return {menuHasLoadingText:b$1,suppressAutocompleteNoOptions:E,suppressEmptyMenuSurface:!ie&&!(!E&&!ie)&&!!!(k&&b$1)}},[l,J,R,n,M,X,w,k,b$1]),nt={...m,autoFocus:false,disableEnforceFocus:true},le=c=>(h?h(c):c?.id)??"",rt=c=>!x||!c?c:y?.find(F=>le(F)===c)??c,at=useCallback((c,F,A)=>{let E=xe(F,C,S),ie=!!F.disabled;return jsxs(Ro,{...c,$selected:A.selected,$optionDisabled:ie,children:[jsx(fe,{children:E}),u&&A.selected?jsx(Se,{src:Pc,alt:""}):null]})},[S,C,u]),ve={...V};for(let c of ["IconComponent","startComponent"])delete ve[c];let{slotProps:lt={},...it}=ve;return jsx(Controller,{name:o,control:re,render:({field:c,fieldState:F})=>{let A=rt(c.value);return l?jsx(Bo,{menuSearchable:n,inMenuSearchContextValue:jo,searchableAutocompletePopperFlags:tt,optionsWithClearFilterOnly:$,autocompleteFilterOptions:ot,slotProps:lt,autocompleteRest:it,inputRef:Ce,showClearIcon:a,ClearIconComponent:p,menuHasLoadingText:b$1,menuLoadingText:K,menuNoOptionsText:v,isLoading:k,disabled:D,label:ne,placeholder:G,required:i,valueOnly:x,getOptionId:le,scheduleSearchNotification:et,setSearchableInputValue:Te,renderAutocompleteOption:at,onClear:d,onChange:W,feedback:r,helperText:t,field:c,fieldState:F,internalValue:A,getOptionLabel:S,isOptionEqualToValue:g}):jsx(f$1,{...V,...c,label:ne,placeholder:G,required:i,disabled:D,isLoading:k,value:A,menuHasSelectedCheckMark:u,showClearIcon:a,ClearIconComponent:p,onClear:d,options:X,getOptionValue:h,getOptionLabel:S,renderOption:C,isOptionEqualToValue:g,hasError:!!F.error,helperText:t??F.error?.message,feedback:r,onChange:E=>{c.onChange(x?le(E):E),W?.(E);},MenuProps:nt,children:n?jsx(vo,{menuSearchPlaceholder:s,searchValue:M,onSearchChange:Y,isLoading:k,menuHasNoOptionsText:w,menuNoOptionsText:v,optionsWithoutEmptyValue:X,getOptionValue:h,getOptionLabel:S,renderOption:C,isOptionEqualToValue:g,menuHasSelectedCheckMark:u,valueOnly:x,getOptionId:le,field:c,onChange:W}):void 0})}})}Wo.displayName="RFHSelect";var $o=de__default.memo(Wo);var ke=$o;function _o({name:e,disabled:o,...t}){let{control:r}=useFormContext();return jsx(Controller,{name:e,control:r,render:({field:{name:n,onBlur:a,onChange:p,value:d,disabled:s}})=>jsx(h,{...t,onChange:p,onBlur:a,name:n,disabled:s||o,checked:d??false})})}_o.displayName="RFHSwitch";var Uo=de.memo(_o);var Yt=Uo;var Ko=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 Go=styled(te)(()=>({display:"flex",flexDirection:"column",maxHeight:180,overflow:"auto",scrollbarWidth:"thin",scrollbarColor:"#E5E5E5 #E5E5E5"})),Yo=styled(P)(({theme:e})=>{let o=`1px solid ${alpha(e.palette.common.black,.1)}`;return {flexShrink:0,border:0,borderRadius:0,"&.Mui-expanded:not(:last-of-type)":{borderBottom:o},[`&:last-of-type .${O.summary}`]:{borderBottom:"none"},[`&.Mui-expanded:last-of-type .${O.summary}`]:{borderBottom:o},[`& .${O.summary}`]:{backgroundColor:e.palette.common.white,borderBottom:o,minHeight:28,height:"auto","& .MuiAccordionSummary-content":{margin:"auto"},"&.Mui-expanded":{backgroundColor:"#F8F8F8",minHeight:28,height:"auto"}},[`& .${O.content}`]:{borderTop:"none"}}});styled(It)(({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 Jo=styled(te)(()=>({display:"flex",flexDirection:"column",gap:"8px"}));styled(te)(()=>({display:"flex",gap:"8px",padding:"4px",flexWrap:"wrap",paddingInlineEnd:"20px"}));styled(te)(({theme:e,maxWidth:o})=>({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",...o&&{maxWidth:`${o}%`}}));var Qo=styled(j)(()=>({display:"flex",gap:"8px",alignItems:"center",justifyContent:"space-between",fontSize:"10px",fontWeight:500,color:"#000",cursor:"pointer",padding:"8px 20px"}));styled(te)(({theme:e})=>({width:"100%",flexDirection:"column",border:`1px solid ${e.palette.grey[100]}`,borderRadius:"4px",backgroundColor:e.palette.grey[400]}));function jt({name:e,options:o,...t}){let r=zc(useId(),"select-with-accordion"),[n,a]=useState(null),[p,d]=useState(0),s=!!n,h=m=>{a(s?null:m.currentTarget);},S=()=>{a(null);},{watch:C,setValue:g}=useFormContext(),y=C(e);return jsx(a$3,{id:r,"data-testid":"SelectWithAccordion",open:s,anchorEl:n,onOpen:h,onClose:S,trigger:jsx(ke,{name:e,options:[],...t,open:false}),hideArrow:true,listWrapperSx:{padding:0,margin:0},children:jsx(Jo,{onClick:m=>m.stopPropagation(),onMouseDown:m=>m.stopPropagation(),children:jsx(Go,{"data-testid":"AccordionWrapper",children:o.map?.((m,x)=>jsx(Yo,{expanded:p===x,onChange:l=>d(l?x:null),label:jsx(Ko,{variant:"caption",children:m.group}),content:(m?.options||[]).map((l,f)=>{let I=t?.isOptionEqualToValue?.(l,y);return jsxs(Qo,{onClick:()=>{g(e,l,{shouldDirty:true,shouldTouch:true,shouldValidate:true}),S();},children:[t.renderOption?.(l)||l.label,I&&jsx(d$1,{src:Pc,alt:"blue-check",sx:{width:14,height:10}})]},`${l.value}-${l.label}-${f}`)})},`${m.group}-group-${x}`))})})})}var Zo=jt;var on=Zo;function Ae({name:e$1,helperText:o,getOptionValue:t,getOptionLabel:r,renderOption:n,isOptionEqualToValue:a,getOptionDisabled:p,menuSearchable:d=false,menuSearchPlaceholder:s="Search",showCheckbox:h=true,menuHasSelectionSummary:S=false,valueOnly:C=false,options:g,isLoading:y,...m}){let{control:x}=useFormContext(),[u,l]=useState(""),f=b=>(t?t(b):b?.id)??"",I=b=>!C||!b?.length?b??[]:b.map(w=>g?.find(v=>f(v)===w)).filter(Boolean),R=b=>b?.map(f)??[],K=useMemo(()=>{if(!d||!u.trim())return g??[];let b=u.toLowerCase().trim();return (g??[]).filter(w=>{let v=(r?r(w):w?.label)??"";return String(v).toLowerCase().includes(b)})},[g,d,u,r]);return jsx(Controller,{name:e$1,control:x,defaultValue:[],render:({field:b,fieldState:w})=>{let v=Array.isArray(b.value)?b.value.filter(i=>i!=null).length:0,ne=S&&v>0,G=I(b.value);return jsxs(e,{...m,isLoading:y,...b,options:g??[],value:G,getOptionLabel:r,hasError:!!w.error,helperText:o??w.error?.message,onChange:i=>b.onChange(C?R(i):i),MenuProps:{...m.MenuProps,autoFocus:false,disableEnforceFocus:true},children:[d&&jsx(q,{disableSticky:true,children:jsx(me,{placeholder:s,value:u,onChange:i=>l(i.target.value),onKeyDown:i=>i.stopPropagation(),onKeyUp:i=>i.stopPropagation(),disableUnderline:true,fullWidth:true,inputProps:{"aria-label":s},endAdornment:y?jsx(po,{"aria-hidden":true,children:jsx(b$1,{})}):jsx(fo,{src:A,alt:"search"})})}),ne&&jsx(mo,{disableSticky:true,children:jsxs(uo,{children:[jsxs(so,{children:[v," selected"]}),jsx(ho,{type:"button",variant:"text",disableRipple:true,"aria-label":"Clear all selected options",onMouseDown:i=>{i.preventDefault(),i.stopPropagation();},onClick:i=>{i.preventDefault(),i.stopPropagation(),m.onClear?m.onClear():b.onChange([]);},children:"Clear"})]})}),K?.map(i=>{let D=G?.some(V=>{if(V==null)return false;if(a)return a(i,V);if(t){let Y=t(i),J=t(V);return Y===J||String(Y)===String(J)}let re=i?.id,M=V?.id;return re===M||String(re)===String(M)}),k=p?p(i):false,Ce=r?r(i):i.label,W=n?n(i):Ce;return jsx(go,{value:(t?t(i):i?.id)??"",disabled:k,$selected:D,children:h?jsxs(So,{children:[jsx(bo,{checked:D,$mutedRect:D&&k}),W]}):W},(t?t(i):i?.id)??"")})]})}})}var cn=useForm;export{dt as a,ft as b,bt as c,Ft as d,ke as e,Yt as f,on as g,Ae as h,cn as i};
|