@tap-payments/os-micro-frontend-shared 0.3.242 → 0.3.243
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-26JDD265.js +1 -0
- package/build/_chunks/{chunk-TDFNWFK7.js → chunk-2LEYPKDY.js} +1 -1
- package/build/_chunks/{chunk-7R6GKSYQ.js → chunk-2ZJH27XO.js} +1 -1
- package/build/_chunks/{chunk-AVTZV3J7.js → chunk-3DFGUAHQ.js} +1 -1
- package/build/_chunks/{chunk-GRKRA3TP.js → chunk-3MBZ55DP.js} +1 -1
- package/build/_chunks/{chunk-B5TZKBR5.js → chunk-3VJ65CKN.js} +1 -1
- package/build/_chunks/chunk-4FJ26UVI.js +2 -0
- package/build/_chunks/{chunk-7PLZT2KW.js → chunk-4N3FBJNL.js} +1 -1
- package/build/_chunks/{chunk-EGFHFXWK.js → chunk-4S23GCB4.js} +1 -1
- package/build/_chunks/{chunk-KVC3QSDQ.js → chunk-55OTIRJ3.js} +1 -1
- package/build/_chunks/{chunk-S4ZHXBPB.js → chunk-5HM27XEJ.js} +1 -1
- package/build/_chunks/{chunk-QWWU4QAA.js → chunk-6BJANCV7.js} +1 -1
- package/build/_chunks/{chunk-5H7MD7LO.js → chunk-6ELMQ3AM.js} +1 -1
- package/build/_chunks/chunk-7HYRJMV7.js +2 -0
- package/build/_chunks/{chunk-SYEHTDS6.js → chunk-7OM4OZ7R.js} +1 -1
- package/build/_chunks/{chunk-GUXJEFPL.js → chunk-AJJSWLJL.js} +1 -1
- package/build/_chunks/{chunk-LXD5Y42H.js → chunk-BHSKFHRE.js} +1 -1
- package/build/_chunks/chunk-BYJ7JVY3.js +1 -0
- package/build/_chunks/{chunk-LFBTKZ3V.js → chunk-C76GGOHP.js} +1 -1
- package/build/_chunks/{chunk-EJ2GRPAY.js → chunk-CC7EFANR.js} +1 -1
- package/build/_chunks/{chunk-QDW7GZN6.js → chunk-CWB7XNU7.js} +1 -1
- package/build/_chunks/{chunk-BQWD3KO4.js → chunk-CXHNLMKI.js} +1 -1
- package/build/_chunks/{chunk-NPCTL2R7.js → chunk-DFFLKF4P.js} +1 -1
- package/build/_chunks/{chunk-BUPWQI3W.js → chunk-DV25U65X.js} +2 -2
- package/build/_chunks/{chunk-JI5U3KGK.js → chunk-DZFU4QPT.js} +1 -1
- package/build/_chunks/{chunk-FWPVRT34.js → chunk-EJ6HUZR5.js} +1 -1
- package/build/_chunks/{chunk-6ASQZ2RI.js → chunk-FLQCQEHB.js} +1 -1
- package/build/_chunks/{chunk-LOFKIY7J.js → chunk-G2HCO4KW.js} +1 -1
- package/build/_chunks/{chunk-V4YG7AP4.js → chunk-GDTR32HP.js} +1 -1
- package/build/_chunks/{chunk-BA5OFEBT.js → chunk-GXUVKR7C.js} +1 -1
- package/build/_chunks/chunk-H6KCP5WM.js +1 -0
- package/build/_chunks/{chunk-YNOCNDOA.js → chunk-HKC2AO7Q.js} +1 -1
- package/build/_chunks/{chunk-5WL77ZBM.js → chunk-HROFC3Z7.js} +2 -2
- package/build/_chunks/{chunk-VV5IC3DP.js → chunk-IDE2FEIW.js} +1 -1
- package/build/_chunks/{chunk-G3QKYZM2.js → chunk-IRSOFOW4.js} +1 -1
- package/build/_chunks/{chunk-6USHHZAA.js → chunk-IZDDMEFF.js} +1 -1
- package/build/_chunks/{chunk-6E2SGPTJ.js → chunk-J76ZW2JS.js} +1 -1
- package/build/_chunks/{chunk-KTFIN54Q.js → chunk-JJX36QPC.js} +1 -1
- package/build/_chunks/{chunk-52SSIU72.js → chunk-JO5WFWAJ.js} +1 -1
- package/build/_chunks/{chunk-D23EYDCG.js → chunk-JR2SE6NE.js} +1 -1
- package/build/_chunks/{chunk-HWDODLOQ.js → chunk-JVG5UN4Z.js} +2 -2
- package/build/_chunks/{chunk-OMISGJLX.js → chunk-K5ICBD7X.js} +1 -1
- package/build/_chunks/{chunk-R6Y42OPH.js → chunk-KHWWD7J3.js} +1 -1
- package/build/_chunks/{chunk-3Z6ULCGA.js → chunk-KT5N4ENC.js} +1 -1
- package/build/_chunks/{chunk-QLF4C46U.js → chunk-KZGSM2JY.js} +1 -1
- package/build/_chunks/{chunk-QLXQSDL7.js → chunk-L65TSVYE.js} +1 -1
- package/build/_chunks/{chunk-6RTZSBSD.js → chunk-LYLC5A5R.js} +1 -1
- package/build/_chunks/{chunk-OBK62FOF.js → chunk-MKMNDEWM.js} +1 -1
- package/build/_chunks/{chunk-CWNHOUN5.js → chunk-MQN2MT2R.js} +1 -1
- package/build/_chunks/{chunk-WZQR2LCT.js → chunk-MSWKK36W.js} +1 -1
- package/build/_chunks/{chunk-ZEQDF7FG.js → chunk-N4JQPHMV.js} +1 -1
- package/build/_chunks/{chunk-QHK62NO3.js → chunk-OIWYMPWX.js} +1 -1
- package/build/_chunks/{chunk-JG5OM35T.js → chunk-OSHM7QKM.js} +1 -1
- package/build/_chunks/{chunk-7FWE55BT.js → chunk-OUR46KNI.js} +1 -1
- package/build/_chunks/{chunk-BMSJV3FH.js → chunk-PHYUVPED.js} +1 -1
- package/build/_chunks/chunk-PW65L7RT.js +1 -0
- package/build/_chunks/{chunk-I7KBFAH7.js → chunk-Q4LS63CQ.js} +1 -1
- package/build/_chunks/{chunk-VNHVDZKL.js → chunk-RTBDYNH2.js} +1 -1
- package/build/_chunks/{chunk-MXQFATMM.js → chunk-SHM2FONS.js} +1 -1
- package/build/_chunks/{chunk-7THWDMHL.js → chunk-U5UZTT2I.js} +1 -1
- package/build/_chunks/{chunk-GLTYG62E.js → chunk-UA5TIEDO.js} +1 -1
- package/build/_chunks/{chunk-6JLKJPL3.js → chunk-UD4BRMOT.js} +1 -1
- package/build/_chunks/{chunk-X5HJKL6O.js → chunk-UKTF67RR.js} +1 -1
- package/build/_chunks/{chunk-GEJI7SEX.js → chunk-V6DYLCV6.js} +1 -1
- package/build/_chunks/{chunk-3T7G4PAY.js → chunk-VAQANAVH.js} +1 -1
- package/build/_chunks/{chunk-J7R6JFXM.js → chunk-VQBMOP6H.js} +1 -1
- package/build/_chunks/{chunk-I6RRJ7ME.js → chunk-W7J5RYUV.js} +1 -1
- package/build/_chunks/{chunk-SR3UFTU3.js → chunk-XA6PS7NH.js} +1 -1
- package/build/_chunks/{chunk-JCFOE4DQ.js → chunk-YPDHRUOH.js} +1 -1
- package/build/_chunks/{chunk-GP7PBSOF.js → chunk-YWA3HTWT.js} +1 -1
- package/build/_chunks/{chunk-CTGKNHG3.js → chunk-Z6KCOMOK.js} +1 -1
- package/build/_chunks/{chunk-KDRRRYZL.js → chunk-ZNG2PLND.js} +1 -1
- package/build/_chunks/{chunk-U2PXB4YH.js → chunk-ZOOP22CX.js} +1 -1
- package/build/components/ActionsDropdownMenu/index.js +1 -1
- package/build/components/ActiveFilterChip/index.js +1 -1
- package/build/components/Alert/index.js +1 -1
- package/build/components/AnimatedSpinnerIcon/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/AreaChart/index.js +1 -1
- package/build/components/Autocomplete/index.js +1 -1
- package/build/components/AvatarStack/index.js +1 -1
- package/build/components/Calender/index.js +1 -1
- package/build/components/ColorPicker/index.js +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/ConfirmDialog/index.js +1 -1
- package/build/components/CountryFilter/index.js +1 -1
- package/build/components/CountryFlag/index.js +1 -1
- package/build/components/CurrenciesMenu/index.js +1 -1
- package/build/components/CurrencyAmount/index.js +1 -1
- package/build/components/CurrencyAmountInput/index.js +1 -1
- package/build/components/CurrencySymbol/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/DeviceIcon/index.js +1 -1
- package/build/components/DropdownMenu/index.js +1 -1
- package/build/components/EmptyState/index.js +1 -1
- package/build/components/ErrorToast/index.js +1 -1
- package/build/components/FileDropbox/index.js +1 -1
- package/build/components/FilePreview/index.js +1 -1
- package/build/components/FileUploader/index.js +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/Filters/index.js +1 -1
- package/build/components/FlippingCard/index.js +1 -1
- package/build/components/FormSelect/index.js +1 -1
- package/build/components/GroupedSelect/index.js +1 -1
- package/build/components/HeatMap/index.js +1 -1
- package/build/components/IconWithBadge/index.js +1 -1
- 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/LeftPeekRightExpandingChip/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/ListLayout/index.js +1 -1
- package/build/components/Loader/index.js +1 -1
- package/build/components/Logo/index.js +1 -1
- package/build/components/MFWidgetLoader/index.js +1 -1
- package/build/components/MaskedText/index.js +1 -1
- package/build/components/MultiSelect/index.js +1 -1
- package/build/components/NestedDropdown/index.js +1 -1
- package/build/components/NestedMultiSelect/index.js +1 -1
- package/build/components/PaymentSourceFilter/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/PhoneInput/index.js +1 -1
- package/build/components/ProgressRing/index.js +1 -1
- package/build/components/RadioGroup/index.js +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/RatingCount/index.js +1 -1
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/RightLeftExpandingCenterChip/index.js +1 -1
- package/build/components/SearchButton/index.js +1 -1
- package/build/components/SearchInput/index.js +1 -1
- package/build/components/SheetViewChip/index.js +1 -1
- package/build/components/Sidebar/index.js +1 -1
- package/build/components/StatusBar/index.js +1 -1
- package/build/components/StatusButton/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/StatusLabel/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableReports/index.js +1 -1
- package/build/components/TextInput/index.js +1 -1
- package/build/components/Timepicker/index.js +1 -1
- package/build/components/ToggleView/index.js +1 -1
- package/build/components/Toolbar/index.js +1 -1
- package/build/components/ToolbarIcon/index.js +1 -1
- package/build/components/TreeDropdown/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/ViewColumnRadioFilter/index.js +1 -1
- package/build/components/VirtualTables/index.js +1 -1
- package/build/components/Widget/index.js +1 -1
- package/build/components/index.js +1 -1
- package/build/components/primitives/index.js +1 -1
- package/build/constants/assets.d.ts +1 -0
- package/build/constants/index.js +1 -1
- package/build/hooks/index.js +1 -1
- package/build/index.js +1 -1
- package/build/utils/index.js +1 -1
- package/package.json +1 -1
- package/build/_chunks/chunk-7DMSRKG7.js +0 -1
- package/build/_chunks/chunk-ECBP7JZ6.js +0 -1
- package/build/_chunks/chunk-GCJPCGH3.js +0 -2
- package/build/_chunks/chunk-L7L22FDR.js +0 -1
- package/build/_chunks/chunk-LKQ24TL4.js +0 -2
- package/build/_chunks/chunk-MFZ3F3JQ.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {j}from'./chunk-
|
|
1
|
+
import {j}from'./chunk-AJJSWLJL.js';import {nc}from'./chunk-BYJ7JVY3.js';import {forwardRef,memo}from'react';import {jsxs,jsx}from'react/jsx-runtime';import S from'@mui/material/Box';import {styled}from'@mui/material/styles';var l="os-shared-Alert",r={root:`${l}-root`,icon:`${l}-icon`,message:`${l}-message`},p={error:e=>({color:e.v2.palette.error[500],background:e.v2.palette.status.danger.subtle}),warning:e=>({color:e.v2.palette.warning[500],background:e.v2.palette.status.warning.subtle}),success:e=>({color:e.v2.palette.success[700],background:e.v2.palette.status.success.subtle}),info:e=>({color:e.v2.palette.brand[500],background:e.v2.palette.interactive.primary.subtle})};var C=()=>jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",children:jsx("path",{d:"M6 12C9.30838 12 12 9.30838 12 6C12 2.69162 9.30838 -2.35309e-07 6 -5.24537e-07C2.69162 -8.13764e-07 8.13764e-07 2.69162 5.24537e-07 6C2.35309e-07 9.30838 2.69162 12 6 12ZM6 11.1C3.17801 11.1 0.9 8.82198 0.9 6C0.9 3.17802 3.17802 0.899999 6 0.899999C8.82199 0.899999 11.1 3.17802 11.1 6C11.1 8.82198 8.82198 11.1 6 11.1ZM6 9C6.15913 9 6.31174 8.93679 6.42426 8.82426C6.53679 8.71174 6.6 8.55913 6.6 8.4C6.6 8.24087 6.53679 8.08826 6.42426 7.97574C6.31174 7.86321 6.15913 7.8 6 7.8C5.84087 7.8 5.68826 7.86321 5.57574 7.97574C5.46321 8.08826 5.4 8.24087 5.4 8.4C5.4 8.55913 5.46321 8.71174 5.57574 8.82426C5.68826 8.93679 5.84087 9 6 9ZM6.00703 6.90644C6.12628 6.90458 6.23991 6.85546 6.32296 6.76988C6.40602 6.6843 6.45171 6.56925 6.45 6.45L6.45 3.15C6.45084 3.09037 6.43983 3.03116 6.41759 2.97583C6.39535 2.92049 6.36234 2.87013 6.32047 2.82766C6.2786 2.7852 6.22871 2.75148 6.17369 2.72846C6.11868 2.70544 6.05964 2.69359 6 2.69359C5.94036 2.69359 5.88132 2.70544 5.82631 2.72846C5.77129 2.75148 5.7214 2.7852 5.67953 2.82766C5.63766 2.87013 5.60465 2.92049 5.58241 2.97583C5.56017 3.03116 5.54916 3.09037 5.55 3.15L5.55 6.45C5.54914 6.51023 5.56037 6.57002 5.58304 6.62583C5.60571 6.68163 5.63935 6.73232 5.68197 6.77489C5.72459 6.81745 5.77533 6.85103 5.83116 6.87363C5.887 6.89623 5.9468 6.90739 6.00703 6.90644Z",fill:"currentColor"})}),d=()=>jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",children:jsx("path",{d:"M9.63285 0.429835C9.54018 0.432536 9.45219 0.471196 9.38752 0.537631L3.21672 6.70844L0.614302 4.10602C0.581421 4.07177 0.542037 4.04443 0.498457 4.0256C0.454877 4.00676 0.407977 3.99681 0.360503 3.99633C0.313029 3.99585 0.265937 4.00484 0.221983 4.02279C0.178029 4.04073 0.138097 4.06727 0.104526 4.10084C0.0709555 4.13441 0.0444206 4.17434 0.0264755 4.21829C0.00853037 4.26225 -0.000464234 4.30934 1.8446e-05 4.35681C0.000501126 4.40429 0.0104514 4.45119 0.0292865 4.49477C0.0481216 4.53835 0.0754629 4.57773 0.109709 4.61061L2.96442 7.46533C3.03134 7.53222 3.12209 7.5698 3.21672 7.5698C3.31134 7.5698 3.40209 7.53222 3.46901 7.46533L9.89212 1.04222C9.9436 0.992086 9.97874 0.927576 9.99295 0.857134C10.0072 0.786693 9.99978 0.713603 9.97176 0.647428C9.94374 0.581254 9.8964 0.525079 9.83593 0.486255C9.77546 0.447431 9.70468 0.427767 9.63285 0.429835Z",fill:"currentColor"})}),m=()=>jsx("svg",{width:"12",height:"11",viewBox:"0 0 12 11",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",children:jsx("path",{d:"M6 7.5V5.5M6 3.5H6.005M11 5.5C11 8.26142 8.76142 10.5 6 10.5C3.23858 10.5 1 8.26142 1 5.5C1 2.73858 3.23858 0.5 6 0.5C8.76142 0.5 11 2.73858 11 5.5Z",stroke:"currentColor",strokeWidth:"0.8",strokeLinecap:"round",strokeLinejoin:"round"})});var g=styled(S,{shouldForwardProp:e=>e!=="$severity"})(({theme:e,$severity:s})=>({...p[s](e),display:"flex",alignItems:"center",gap:e.v2.spacing(4),minHeight:e.v2.spacing(32),padding:e.v2.spacing(8),borderRadius:e.v2.radius(4)})),f=styled("span")({width:12,height:12,flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& svg":{width:12,height:12,display:"block"}}),u=styled(j)({color:"inherit",wordBreak:"break-word"});function k(e){switch(e){case "success":return jsx(d,{});case "info":return jsx(m,{});case "error":case "warning":return jsx(C,{})}}var y=forwardRef(({severity:e="error",message:s,icon:v,className:h,sx:w,id:i,...A},x)=>jsxs(g,{ref:x,...A,$severity:e,className:nc(r.root,h),sx:w,id:i,"data-testid":i??"Alert",children:[jsx(f,{className:r.icon,children:v??k(e)}),jsx(u,{component:"p",textVariant:"body.xsmall.regular",className:r.message,children:s})]}));y.displayName="Alert";var M=memo(y);
|
|
2
2
|
export{r as a,M as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j}from'./chunk-
|
|
1
|
+
import {j}from'./chunk-AJJSWLJL.js';import {Ud,Qi,Ri,Si,Ti,Ui}from'./chunk-4FJ26UVI.js';import {memo}from'react';import i from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var x=styled(i)(({theme:o})=>({display:"flex",gap:o.spacing(1),insetInlineStart:o.spacing(1.25),zIndex:1}));styled(i)(({theme:o})=>({width:12,height:12,borderRadius:"50%",cursor:"pointer",backgroundColor:`${o.palette.grey[200]}14`,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease-in-out",img:{opacity:"0",transition:"all 0.2s ease-in-out"},"&:active":{backgroundColor:`${o.palette.grey[200]} !important`}}));var b=styled(i)(({theme:o})=>({display:"flex",height:"2rem",justifyContent:"space-between",alignItems:"center",width:"100%",paddingLeft:o.spacing(1.25),paddingRight:o.spacing(1.25),"& > *":{flex:"1 1 0px;"}})),y=styled("div",{shouldForwardProp:o=>o!=="sandboxMode"&&o!=="maximized"&&o!=="isDragging"})(({maximized:o,isDragging:t})=>({...!o&&{borderTopRightRadius:12,borderTopLeftRadius:12},...t&&{cursor:"move"},margin:0})),$=styled(i,{shouldForwardProp:o=>o!=="maximized"&&o!=="isDragging"})(({isDragging:o})=>({...o&&{cursor:"move"},position:"relative",zIndex:1,margin:0})),f=styled(i,{shouldForwardProp:o=>o!=="maximized"&&o!=="isHovered"})(({theme:o,maximized:t})=>({height:32,position:"relative",display:"flex",width:"100%",justifyContent:"center",transition:"all 0.5s ease-in-out",borderTopLeftRadius:"12px",borderTopRightRadius:"12px",...t&&{display:"block !important",position:"fixed",right:0,left:0,zIndex:999,background:"transparent",".toolbar-wrapper":{display:"flex",justifyContent:"space-between",gap:10,alignItems:"center",position:"absolute",right:0,left:0,height:"2rem",".action-box":{visibility:"hidden"}},"&:hover":{".toolbar-wrapper":{top:0},".action-box":{visibility:"visible"}}},":hover":{".header-icon":{backgroundColor:`${o.palette.grey[200]}40`},".header-icon img":{opacity:1}}})),W=styled(y)(()=>({position:"sticky",top:0,left:0,right:0,zIndex:1e3,background:"#eaeaea",backdropFilter:"blur(32px)"})),u=styled(j)(({theme:o})=>({fontSize:"10px",color:"rgba(32, 35, 43, 0.5)",opacity:.7,textAlign:"left",fontWeight:o.v2.typography.fontWeightBold,lineHeight:"14px",userSelect:"none",paddingLeft:"0.175rem",textTransform:"capitalize"})),h=styled("div")(()=>({display:"flex",justifyContent:"center",alignItems:"center",position:"relative",textAlign:"center"})),I=styled("img")(()=>({width:14,height:14,verticalAlign:"center"}));var w=new Map([["json",Ud],["brand",Qi],["entity",Ri],["bank",Si],["individual",Ti],["password",Ui]]);function C({title:o,icon:t}){let a=w.get(t||"")??(w.get(o?.toLowerCase())||t);return jsxs(h,{className:"action-box","data-testid":"ToolbarAppIcon",children:[a&&jsx(I,{src:a,alt:"icon"}),jsx(u,{className:"title",children:o})]})}var S=C;function L({onMouseEnter:o,onMouseLeave:t,isMaximized:a,isHovered:z,rightActions:k,leftActions:n,title:A,icon:B,...H}){return jsx(f,{onMouseEnter:o,onMouseLeave:t,maximized:a,id:"toolbar","data-testid":"Toolbar",isHovered:z,...H,children:jsxs(b,{className:"toolbar-wrapper",children:[n?jsx(x,{className:"action-box",children:n}):jsx("div",{}),jsx(S,{title:A,icon:B}),k||jsx("div",{})]})})}var T=memo(L);var Z=T;export{y as a,$ as b,W as c,Z as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {j,p,d as d$1}from'./chunk-AJJSWLJL.js';import {Bc}from'./chunk-BYJ7JVY3.js';import {Ak,yk,wk,tk,jk,lk,Bk,ik,hk,zk,Mh,tb,mk,rb,nk,pk,qk,vk,uk,ok}from'./chunk-4FJ26UVI.js';import {useId}from'react';import W from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var R={ABANDONED:Mh,IN_PROGRESS:Bk,VOID:zk,CANCELLED:hk,CAPTURED:ik,INITIATED:Bk,FAILED:lk,DECLINED:jk,RESTRICTED:tk,TIMEDOUT:wk,UNKNOWN:yk,AUTHORIZED:Ak},O={UNKNOWN:{gatewayIcon:mk,acquirerIcon:tb,color:"#FF7A00",background:"#FF7A001A"},TIMEDOUT:{gatewayIcon:mk,acquirerIcon:tb,color:"#FF7A00",background:"#FFF3E5"},FAILED:{gatewayIcon:mk,acquirerIcon:tb,color:"#FF7A00",background:"#FFF3E5"},DECLINED:{gatewayIcon:nk,acquirerIcon:rb,color:"#FF3D00",background:"#FFEAE5"},RESTRICTED:{gatewayIcon:nk,acquirerIcon:rb,color:"#FF3D00",background:"#FFEAE5"},ABANDONED:{gatewayIcon:mk,acquirerIcon:tb,color:"#FFD600",background:"#FFFBE5"},CANCELLED:{gatewayIcon:mk,acquirerIcon:tb,color:"#FFD600",background:"#FFFBE5"},INITIATED:{color:"#8D8D94",background:"transparent",gatewayIcon:mk,acquirerIcon:tb}},K={PENDING:qk,REFUNDED:pk},M={PENDING:{color:"#FF7A00",backgroundColor:"#FF7A000D"},REFUNDED:{color:"#4E1FD0",backgroundColor:"#4E1FD00D"}},Z={PAID_OUT:ok,SETTLED:uk,PENDING:vk},_={AUTHORIZED:Ak},L={CAPTURED:{color:"#1F88D0",background:"#1F88D00D"}};var q=styled(W)(()=>({display:"flex",gap:"4px",alignItems:"center",justifyContent:"center",borderRadius:"56px",padding:"2px 4px",cursor:"default"})),U=styled(j)(({theme:r})=>({color:r.v2.palette.base.white,fontWeight:600,fontSize:"8px",padding:"3px 2.57px",borderRadius:"4px",lineHeight:"100%"}));function d({tooltip:r,status:e,statusCode:P}){let h=Bc(useId(),"status-label"),I=O[e]??L[e]??null;return jsx(p,{title:r,children:jsxs(q,{id:h,"data-testid":"StatusLabel",sx:{backgroundColor:I?.background||"transparent"},children:[jsx(d$1,{src:R[e]}),jsx(U,{sx:B=>({backgroundColor:I?.color||B.palette.info.dark}),children:P})]})})}var co=d;export{R as a,O as b,K as c,M as d,Z as e,_ as f,L as g,co as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {p}from'./chunk-
|
|
1
|
+
import {p}from'./chunk-AJJSWLJL.js';import {Wa,Bc,cb}from'./chunk-BYJ7JVY3.js';import {Sk,ya,xa,wa,Pj}from'./chunk-4FJ26UVI.js';import {memo,useId}from'react';import C from'@mui/material/Box';import O from'lodash/capitalize';import {useTranslation}from'react-i18next';import {styled}from'@mui/material/styles';import {jsx}from'react/jsx-runtime';var D=styled(C,{shouldForwardProp:o=>o!=="tableMode"})(({theme:o,tableMode:t})=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4px 8px",borderRadius:"24px",border:`1px solid ${o.palette.divider}`,color:o.palette.text.primary,height:Wa(t)?"18px":"24px"}));var e={DESKTOP:wa,PHONE:xa,TABLET:ya,TERMINAL:Sk};var i=o=>!!e[o];function S({type:o,isTextShown:t,tableMode:T,...E}){let p$1=Bc(useId(),"device-icon"),{t:v}=useTranslation(),m=i(o)?e[o]:null;return jsx(p,{title:m?`Device - ${cb((o??"").toLowerCase())}`:v("unKnown"),children:t?jsx(D,{id:p$1,"data-testid":"DeviceIcon",tableMode:T,children:o?O(o):"Unknown"}):jsx(C,{...E,id:p$1,"data-testid":"DeviceIcon",component:"img",src:o?m||Pj:Pj,alt:o})})}var b=memo(S);var X=b;export{e as a,i as b,X as c};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {b}from'./chunk-MUR4ILTY.js';import {Bc}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-MUR4ILTY.js';import {Bc}from'./chunk-BYJ7JVY3.js';import {xb}from'./chunk-4FJ26UVI.js';import {useId,useCallback}from'react';import v,{autocompleteClasses}from'@mui/material/Autocomplete';import y from'@mui/material/Box';import M from'@mui/material/TextField';import R from'@mui/material/Popper';import {keyframes,styled}from'@mui/material/styles';import {jsx}from'react/jsx-runtime';var T=keyframes`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(-90deg);
|
|
4
4
|
}
|
|
5
5
|
100% {
|
|
6
6
|
transform: rotate(270deg);
|
|
7
7
|
}
|
|
8
|
-
`,u=styled(y)({width:12,height:12,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:"100%",height:"100%",display:"block"},animation:`${T} 2s linear infinite`}),m=styled(M)({"& .MuiInputBase-root":{paddingTop:13,paddingBottom:13,borderRadius:4,"& .MuiOutlinedInput-notchedOutline":{borderWidth:1,borderStyle:"solid",borderColor:"#F2F2F2"},"&:hover":{"& .MuiOutlinedInput-notchedOutline":{borderColor:"#F2F2F2"}},"&.Mui-focused":{"& .MuiOutlinedInput-notchedOutline":{borderColor:"#1F88D0",boxShadow:"0px 0px 4px 0px #1F88D080"},"&:hover":{"& .MuiOutlinedInput-notchedOutline":{borderColor:"#1F88D0"}}},[`& .${autocompleteClasses.input}`]:{fontSize:11,paddingTop:0,paddingBottom:0,paddingLeft:0},[`& .${autocompleteClasses.endAdornment}`]:{marginRight:8}}}),c=styled(R)({fontSize:11,borderRadius:"8px",border:"1px solid #F2F2F2",boxShadow:"0px 2px 56px 0px #20232B24"});var D=f=>{let{options:x,value:b$1,onChange:g,label:n,renderInput:P,slotProps:p,textFieldProps:o,loading:l,popupIcon:F,...I}=f,h=Bc(useId(),"auto-complete"),C=useCallback(r=>{let A=typeof o=="function"?o(r):o;return jsx(m,{...r,...A,label:n})},[o,n]);return jsx(v,{id:h,"data-testid":"AutoComplete",options:x,value:b$1,onChange:g,loading:l,popupIcon:l?jsx(u,{"aria-hidden":true,children:jsx(b,{})}):F??jsx(y,{component:"img",src:
|
|
8
|
+
`,u=styled(y)({width:12,height:12,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:"100%",height:"100%",display:"block"},animation:`${T} 2s linear infinite`}),m=styled(M)({"& .MuiInputBase-root":{paddingTop:13,paddingBottom:13,borderRadius:4,"& .MuiOutlinedInput-notchedOutline":{borderWidth:1,borderStyle:"solid",borderColor:"#F2F2F2"},"&:hover":{"& .MuiOutlinedInput-notchedOutline":{borderColor:"#F2F2F2"}},"&.Mui-focused":{"& .MuiOutlinedInput-notchedOutline":{borderColor:"#1F88D0",boxShadow:"0px 0px 4px 0px #1F88D080"},"&:hover":{"& .MuiOutlinedInput-notchedOutline":{borderColor:"#1F88D0"}}},[`& .${autocompleteClasses.input}`]:{fontSize:11,paddingTop:0,paddingBottom:0,paddingLeft:0},[`& .${autocompleteClasses.endAdornment}`]:{marginRight:8}}}),c=styled(R)({fontSize:11,borderRadius:"8px",border:"1px solid #F2F2F2",boxShadow:"0px 2px 56px 0px #20232B24"});var D=f=>{let{options:x,value:b$1,onChange:g,label:n,renderInput:P,slotProps:p,textFieldProps:o,loading:l,popupIcon:F,...I}=f,h=Bc(useId(),"auto-complete"),C=useCallback(r=>{let A=typeof o=="function"?o(r):o;return jsx(m,{...r,...A,label:n})},[o,n]);return jsx(v,{id:h,"data-testid":"AutoComplete",options:x,value:b$1,onChange:g,loading:l,popupIcon:l?jsx(u,{"aria-hidden":true,children:jsx(b,{})}):F??jsx(y,{component:"img",src:xb,sx:{transform:"rotate(90deg)"},width:8,alt:"close"}),renderInput:P||C,PopperComponent:c,...I,slotProps:{...p,popper:{modifiers:[{name:"offset",options:{offset:[0,4]}}],...p?.popper}}})},Y=D;export{Y as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {s as s$1}from'./chunk-
|
|
1
|
+
import {s as s$1}from'./chunk-6BJANCV7.js';import {j}from'./chunk-AJJSWLJL.js';import {Bc}from'./chunk-BYJ7JVY3.js';import {Nj}from'./chunk-4FJ26UVI.js';import {memo,useId}from'react';import r from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var s=styled(r)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,background:"#FBFBFB",borderRadius:"8px",fontSize:"11px",display:"flex",flexDirection:"column",height:"233px",transform:"scale(1)"})),l=styled(r)(({theme:e})=>({padding:"8px 12px",borderBottom:`1px solid ${e.palette.divider}`,display:"flex",justifyContent:"space-between",alignItems:"center",height:39,flexShrink:0,overflow:"visible"})),c=styled(r)(({theme:e})=>({color:e.palette.text.primary,fontSize:"11px",fontWeight:600,textTransform:"capitalize"})),x=styled(r)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingInlineStart:"12px",paddingInlineEnd:"8px",borderBottom:`1px solid ${e.palette.divider}`,height:40})),f=styled(j)(({theme:e})=>({color:e.v2.palette.base.black,fontSize:"11px",fontWeight:500,lineHeight:"13.2px"})),g=styled(r)(()=>({display:"flex",alignItems:"center",gap:"8px"})),I=styled(r)(()=>({display:"flex",alignItems:"center",gap:"4px"})),y=styled(r)(()=>({borderRadius:"8px",overflow:"auto",flexGrow:1,height:"100%",listStyle:"none",margin:0,padding:0,".list-item:last-of-type":{borderBottom:"none"}}));styled(r)(()=>({margin:"12px "}));function b({children:e,...t}){let i=Bc(useId(),"widget");return jsx(s,{id:i,component:"article","data-testid":"Widget",...t,children:e})}var S=memo(b);function P({children:e,action:t,...i}){let d=Bc(useId(),"widget-header");return jsxs(l,{id:d,"data-testid":"Widget_WidgetHeader",component:"header",...i,children:[jsx(c,{children:e}),t&&t]})}var T=memo(P);function k({allowShadow:e=true,children:t,...i}){let d=Bc(useId(),"widget-list"),{onScrollHandler:u,showShadow:L}=s$1();return jsxs(y,{id:d,component:"ul","data-testid":"Widget_List",onScroll:u,...i,children:[t,L&&e&&jsx(r,{component:"img",src:Nj,sx:{width:"100%",position:"fixed",bottom:0,pointerEvents:"none",right:0,left:0}})]})}var A=memo(k);function G({children:e,icon:t,actions:i,...d}){return jsxs(x,{component:"li","data-testid":"Widget_ListItem",className:`list-item ${d.className}`,...d,children:[jsxs(g,{component:"aside",children:[t&&t,jsx(f,{noWrap:true,className:"content",children:e})]}),i&&jsx(I,{component:"aside",children:i})]})}var J=memo(G);var ue=S;export{T as a,A as b,J as c,ue as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a,d,b,c,j as j$1,e}from'./chunk-
|
|
1
|
+
import {a,d,b,c,j as j$1,e}from'./chunk-W7J5RYUV.js';import {Bc}from'./chunk-BYJ7JVY3.js';import {ec,fc}from'./chunk-4FJ26UVI.js';import {memo,useId,useState}from'react';import ee from'@mui/material/ClickAwayListener';import te from'@mui/material/Popper';import {useTranslation}from'react-i18next';import {DateObject,Calendar}from'react-multi-date-picker';import i from'@mui/material/Box';import l from'@mui/material/Button';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var O=styled(l)(()=>({minWidth:"auto",padding:0,"& > img":{cursor:"pointer"}})),z=styled(i)(()=>({position:"relative"})),H=styled(i,{shouldForwardProp:t=>t!=="open"})(({open:t,theme:e})=>({display:t?"flex":"none",flexDirection:"column",background:e.palette.common.white,boxShadow:e.shadows[9],borderRadius:e.spacing(1),top:37,color:e.palette.text.primary,fontSize:"11px",margin:"8px 0",".rmdp-calendar":{padding:"8px 16px 16px"},".rmdp-rtl *":{fontFamily:"Tajawal"},".rmdp-rtl .sd":{paddingTop:"4px"},".rmdp-wrapper":{position:"relative",borderRadius:"8px",boxShadow:"none"},".rmdp-day span":{fontSize:"11px",fontWeight:500},".rmdp-day, .rmdp-week-day":{width:40,height:40,marginBottom:"2px",padding:"4px",fontSize:"11px",color:e.palette.grey[900]},".rmdp-day-picker":{padding:0},".rmdp-day.rmdp-today span":{backgroundColor:"transparent !important",color:e.palette.info.dark},".rmdp-day.rmdp-today.end span, .rmdp-day.rmdp-today.end span":{color:e.palette.common.white},".rmdp-range, .rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover":{background:e.palette.info.light,boxShadow:"none",color:e.palette.grey[900]},".rmdp-range-hover.start, .rmdp-range.start, .rmdp-range-hover.end, .rmdp-range.end, .rmdp-rtl .rmdp-range-hover.start, .rmdp-rtl .rmdp-range.start, .rmdp-rtl .rmdp-range-hover.end, .rmdp-rtl .rmdp-range.end":{borderRadius:"50%",background:e.palette.background.gradient.darkShadedBlue,color:e.palette.common.white},".rmdp-range.start:after":{content:'""',position:"absolute",background:e.palette.info.light,height:"100%",width:"50%",right:0,top:0,zIndex:-1},".rmdp-rtl .rmdp-range.start:after":{right:"unset",left:0},".rmdp-range.end:after":{content:'""',position:"absolute",background:e.palette.info.light,height:"100%",width:"50%",left:0,top:0,zIndex:-1},".rmdp-rtl .rmdp-range.end:after":{left:"unset",right:0},".rmdp-week-day":{color:e.palette.grey[700],marginBottom:"4px",fontSize:"11px",padding:"4px"},".rmdp-header-values":{color:e.palette.grey[900],fontSize:"12px",fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px"},".rmdp-header-values span:nth-of-type(2)":{display:"none"},".rmdp-header":{padding:"4px 0",margin:0,fontSize:"12px"},".rmdp-top-class":{display:"block !important"},".rmdp-day.rmdp-selected span:not(.highlight)":{background:e.palette.info.dark},".rmdp-day.start.end":{overflow:"hidden"}})),j=styled(l,{shouldForwardProp:t=>t!=="open"})(({open:t,theme:e})=>({color:e.palette.text.primary,fontSize:"11px",fontWeight:500,padding:e.spacing(1),borderRadius:"4px",border:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,textTransform:"none",height:32,...t&&{border:"1px solid",borderColor:e.palette.info.dark,boxShadow:e.shadows[7]}})),A=styled(i)(({theme:t})=>({display:"flex",justifyContent:"flex-end",alignItems:"center",gap:8,padding:"16px",borderTop:`1px solid ${t.palette.divider}`})),E=styled(l)(({theme:t})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",background:"transparent",color:t.palette.text.primary,border:"1px solid",borderColor:t.palette.divider,fontWeight:500,borderRadius:"4px","&:hover":{background:"transparent",color:t.palette.text.primary}})),Y=styled(l)(({theme:t})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",borderRadius:"4px",fontWeight:700,background:t.palette.info.dark,"&:hover":{background:t.palette.info.dark}})),F=styled(i)(()=>({display:"flex",gap:"8px"}));var ne=["Su","Mo","Tu","We","Th","Fr","Sa"];function ae({isAr:t=false,value:e$1,setValue:y,enableTimePicker:p,placement:L,sx:R,...N}){let V=Bc(useId(),"calender"),[w,k]=useState(null),[C,$]=useState(e$1?new DateObject(new Date(e$1.toLocaleString())):new DateObject(new Date)),[D,g]=useState(e$1?new DateObject(new Date(e$1.toLocaleString())):new DateObject(new Date)),q=e$1?.hour?a(e$1.hour):d(),G=e$1?.hour?b(e$1.hour):b(new Date().getHours()),[a$1,J]=useState({hour:q,minute:e$1?.minute??c(),period:G}),{t:B}=useTranslation(),u=!!w,K=r=>r==="right"?t?ec:fc:t?fc:ec,Q=r=>{k(r.currentTarget);},f=()=>{k(null);},U=()=>{let r=a$1.hour;p&&(r=e(a$1.hour,a$1.period||"AM"));let d=p?D.setHour(r).setMinute(a$1.minute):D;$(d),y&&y(d),f();},X=r=>{J(r);};return jsx(ee,{onClickAway:f,children:jsxs(z,{sx:{...R},id:V,"data-testid":"Calender",children:[jsx(j,{onClick:Q,open:u,className:"date-button",children:C.format("MMM D, YYYY")}),jsx(te,{open:u,anchorEl:w,placement:L,children:jsxs(H,{className:"calender-content",open:u,children:[jsx(Calendar,{numberOfMonths:1,format:"MMM DD YYYY",monthYearSeparator:" ",renderButton:(r,d)=>jsx(O,{onClick:d,children:jsx("img",{src:K(r),alt:"arrow"})}),onMonthChange:r=>{g(r);},onYearChange:r=>{g(r);},onChange:r=>{g(r);},weekDays:t?void 0:ne,minDate:new Date,value:C,...N}),jsxs(A,{sx:{...p&&{justifyContent:"space-between"}},children:[p&&jsx(j$1,{enableRealTimeChange:true,onChange:X,defaultTime:a$1}),jsxs(F,{children:[jsx(E,{variant:"contained",onClick:f,children:B("cancel")}),jsx(Y,{variant:"contained",onClick:U,children:B("okay")})]})]})]})})]})})}var I=memo(ae);var Te=I;export{Te as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-LYLC5A5R.js';import {z}from'./chunk-AJJSWLJL.js';import {Bc}from'./chunk-BYJ7JVY3.js';import {Qh}from'./chunk-4FJ26UVI.js';import {memo,useId}from'react';import {styled,Box}from'@mui/material';import {jsxs,jsx}from'react/jsx-runtime';var a=styled(Box,{shouldForwardProp:t=>t!=="isLongLabel"})(({theme:t,isLongLabel:e})=>({display:"flex",justifyContent:"center",alignItems:"center",padding:"6px 16px",height:"32px",background:t.palette.background.gradient.shadedBlue,color:t.palette.common.white,borderRadius:"50px",fontSize:"11px",gap:t.spacing(1),minWidth:e?"12rem":"8.4rem",marginRight:"auto",position:"relative"}));function u({ids:t,visible:e,label:o,onDismiss:c,dismissible:m=true}){let d=Bc(useId(),"active-filter-chip");return e?jsxs(a,{id:d,"data-testid":"ActiveFilterChip",isLongLabel:(o?.length??0)>11,children:[o?jsx(b,{children:o}):jsx("span",{children:t?.join(",")}),m&&jsx(z,{pointer:true,round:true,onClick:c,color:"active",sx:{position:"absolute",right:"8px"},children:jsx("img",{src:Qh,alt:"close",style:{width:"8px",height:"7px"}})})]}):null}var s=memo(u);var S=s;export{S as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {h,g,a,f,e,d,c}from'./chunk-
|
|
1
|
+
import {h,g,a,f,e,d,c}from'./chunk-LYLC5A5R.js';import {z}from'./chunk-AJJSWLJL.js';import {Bc,Ka,g as g$1}from'./chunk-BYJ7JVY3.js';import {zl,ja,Ua,Og,jl,Za,Ta,Xg,Wg,Yg,Vg,_g,Ab,zb,Ak,ik,hb,vk,B,w,A,D,Th,hk,u,Bk}from'./chunk-4FJ26UVI.js';import {memo,useId,useState,useRef,useEffect,useMemo,useCallback}from'react';import {useTranslation}from'react-i18next';import {useTheme}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function L({isActive:p,disableHover:n}){let[c,C]=useState(false),s=useTheme(),e=()=>{n||C(true);},i=()=>{C(false);},h=p?s.palette.common.white:s.palette.grey[700],u=c?s.palette.common.black:"transparent";return jsx("svg",{width:"27",height:"30",viewBox:"0 0 27 32",xmlns:"http://www.w3.org/2000/svg",children:jsxs("g",{id:"Group 140343",children:[jsx("path",{id:"Active",d:"M0 0H11C19.8366 0 27 7.16344 27 16C27 24.8366 19.8366 32 11 32H0V0Z",fill:u,fillOpacity:"0.1",onMouseEnter:e,onMouseLeave:i}),jsx("path",{id:"Union",fillRule:"evenodd",clipRule:"evenodd",d:"M15.6941 15.0078C15.6494 15.0193 15.6083 15.043 15.5758 15.0769L12.5026 18.1501L12.5025 18.1501L15.5756 15.0769C15.6082 15.043 15.6493 15.0193 15.6941 15.0078ZM12.5619 18.7465C12.5426 18.7512 12.5227 18.7536 12.5026 18.7536C12.4363 18.7536 12.3727 18.7273 12.3258 18.6804L9.07581 15.4304C9.04012 15.3957 9.01559 15.3512 9.00535 15.3025C8.99511 15.2538 8.99963 15.2032 9.01833 15.1571C9.03703 15.111 9.06907 15.0715 9.11033 15.0437C9.13446 15.0275 9.16112 15.0156 9.18904 15.0086C9.16105 15.0156 9.13433 15.0275 9.11013 15.0438C9.06887 15.0716 9.03684 15.111 9.01814 15.1571C8.99944 15.2032 8.99492 15.2539 9.00516 15.3026C9.0154 15.3513 9.03993 15.3958 9.07562 15.4305L12.3256 18.6805C12.3725 18.7273 12.4361 18.7537 12.5024 18.7537C12.5226 18.7537 12.5426 18.7512 12.5619 18.7465ZM16.1965 15.342C16.1781 15.4301 16.1338 15.5105 16.0693 15.5731L12.8205 18.8219C12.7361 18.9063 12.6217 18.9537 12.5024 18.9537C12.3831 18.9537 12.2686 18.9062 12.1842 18.8219L8.93507 15.5728C8.87148 15.5105 8.82775 15.4308 8.80944 15.3437C8.79101 15.2561 8.79914 15.165 8.8328 15.082C8.86646 14.999 8.92412 14.9279 8.99839 14.8779C9.07266 14.8279 9.16022 14.8011 9.24978 14.8011C9.30998 14.8011 9.36958 14.8132 9.42503 14.8366C9.47997 14.8599 9.52973 14.8938 9.57144 14.9364L12.5024 17.8673L15.433 14.9368C15.5151 14.852 15.6273 14.803 15.7454 14.8002C15.836 14.798 15.9252 14.8233 16.0013 14.8728C16.0773 14.9222 16.1367 14.9935 16.1715 15.0772C16.2063 15.1609 16.2151 15.2533 16.1965 15.342Z",fill:h})]})})}var vt={inProgress:Bk,initiated:Bk,abandoned:u,cancelled:hk,reversed:Th,reports:D,search:A,chevronDown:w,unAuthorized:B,unSettled:vk,unCaptured:hb,captured:ik,authorized:Ak,openFlag:zb,closedFlag:Ab,unauthenticated:_g,authenticated:Vg,paidOut:Yg,scheduled:Wg,checked:Xg,dashedChecked:Ta,deactivated:Za,destination:jl,destinationReversed:Og,outstanding:Ua,active:ja,inactive:zl};var Nt=memo(p=>{let{variant:n="inActive",badgeCount:c$1,icon:C,label:s,dropdownOptions:e$1,selectedStatus:i,onButtonBodyClick:h$1,iconMapper:u=vt,buttonSx:Bt,...bt}=p,St=Bc(useId(),"status-button"),[Lt,M]=useState(0),{t:y}=useTranslation(),E=useRef(null),[x,f$1]=useState(null),[o,H]=useState(i??e$1?.[0]?.status);useEffect(()=>{i!==void 0&&H(i);},[i]);let d$1=useMemo(()=>!!e$1?.length,[e$1]),I=!!x&&Lt>1,l=n==="active",P=useMemo(()=>l?"active":"inactive",[l]),m=useMemo(()=>o?e$1?.find(t=>t.status===o):null,[o,e$1]),kt=useMemo(()=>{if(m?.icon)return jsx(h,{variant:n,children:m.icon});let t=o&&u[o]?o:C;if(t&&u[t])return jsx(g,{icon:t,variant:n,src:u[t],alt:`${t}-icon`})},[m,o,u,C,n]),wt=useMemo(()=>!c$1||Number.isNaN(Ka(c$1))?null:jsx(z,{color:P,children:g$1(Number(c$1))}),[c$1,P]),T=useMemo(()=>d$1?jsx(L,{isActive:l}):null,[d$1,l]);useEffect(()=>{l||(M(0),f$1(null));},[l]);let g$2=useCallback(()=>{f$1(null);},[]),A=useCallback(()=>{d$1&&f$1(I?null:E.current);},[d$1,I]),Mt=useCallback(t=>{t.stopPropagation(),p?.onClick?.(t),h$1?.(o||e$1?.[0]?.status||"all"),A(),M(B=>B+1);},[p,h$1,o,e$1,A]),D=useCallback(t=>B=>{t?.onClick?.(B),H(t.status),g$2();},[g$2]),yt=useMemo(()=>e$1?.map(t=>({...t,onClick:D(t)}))||[],[e$1,D]),Et=a[n],xt=useMemo(()=>m?.label||(o?y(o):s),[m,o,y,s]);return jsxs(Fragment,{children:[jsx(Et,{id:St,"data-testid":"StatusButton",...bt,ref:E,onClick:Mt,statusVariant:n,sx:{...d$1&&{paddingInlineEnd:"27px"},...Bt},children:jsxs(f,{children:[jsxs(e,{variant:n,children:[kt,xt,wt]}),T&&jsx(d,{children:T})]})}),I&&d$1&&jsx(c,{open:I,onClose:g$2,anchorEl:x,menuItems:yt})]})}),gt=Nt;var oo=gt;
|
|
2
2
|
export{L as a,oo as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a}from'./chunk-HDCNWBW5.js';import {d,R as R$1,L as L$1,V,Q as Q$1}from'./chunk-GUXJEFPL.js';import {nc}from'./chunk-L7L22FDR.js';import {Eb,A as A$1,Pc}from'./chunk-GCJPCGH3.js';import {forwardRef,useState,useEffect,useMemo,memo,useRef,useLayoutEffect,useId}from'react';import gt from'@mui/material/ClickAwayListener';import {CircularProgress}from'@mui/material';import L from'@mui/material/Box';import fe from'@mui/material/Typography';import {styled,alpha}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var y="os-shared-NestedMultiSelect",s={root:`${y}-root`,open:`${y}-open`,label:`${y}-label`,placeholder:`${y}-placeholder`,arrow:`${y}-arrow`,menu:`${y}-menu`,search:`${y}-search`,selectedBadge:`${y}-selectedBadge`,fieldRow:`${y}-fieldRow`},re=40,A="data-nested-submenu",$="data-nested-submenu-anchor",se={strategy:"fixed"},ce=.7,ae=100,pe={width:10,height:7.5,flexShrink:0},ue={width:9,height:9,flexShrink:0};var et={overflow:"hidden",flex:"0 0 auto",width:"max-content",maxWidth:"100%",minWidth:0},tt=e=>({display:"flex",padding:"4px 8px 4px 6px",alignItems:"center",gap:"4px",borderRadius:"13px",backgroundColor:e,fontSize:"10px",fontWeight:500,cursor:"pointer"}),me=styled(L,{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:t=false})=>{let{base:o}=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(o.black,.6),[`& .${s.label}`]:{opacity:.7,cursor:"not-allowed"},[`& .${s.placeholder}`]:{color:alpha(o.black,.6)},[`& .${s.arrow}`]:{opacity:.6},[`& .${s.fieldRow}`]:{opacity:.7},[`& .${s.fieldRow} *`]:{cursor:"not-allowed"}},[`&.${s.open} .${s.arrow}`]:{transform:"rotate(180deg)"},[`&.${s.open} .${s.arrow} svg path, &:focus-within .${s.arrow} svg path`]:{fill:"#1F88D0",stroke:"#1F88D0"},[`&.${s.open}, &:focus-within`]:{border:"1px solid #1F88D0",boxShadow:"0px 0px 4px 0px #1F88D080"}}}),he=styled(fe)(({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"})),Se=styled(fe)(()=>({margin:0,fontWeight:500,fontSize:"11px",lineHeight:"18px",padding:"22px 30px 8px 8px"})),Me=styled(L)(({theme:e})=>({position:"absolute",top:15,right:10,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})})),ge=styled(L)(()=>({display:"flex",flexDirection:"column",padding:"8px"})),ot={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},nt={display:"flex",flexWrap:"wrap",alignItems:"center",alignContent:"flex-start",gap:"4px",width:"100%",minWidth:0},be=styled(L,{shouldForwardProp:e=>e!=="$field"})(({$field:e})=>({...nt,...e?{padding:"22px 30px 8px 8px"}:{marginBottom:"8px","&:empty":{display:"none"}}})),G=styled(L,{shouldForwardProp:e=>e!=="$field"})(({theme:e,$field:t})=>({...tt(`${e.palette.info.dark}1a`),...et,...t&&{cursor:"inherit"}})),xe=styled("span")(()=>ot),Ne=styled(L)(()=>({position:"relative",width:"100%",minWidth:0})),ye=styled(L)(()=>({flex:1,maxWidth:"220px",minWidth:"89px",fontWeight:500})),Ce=styled(L)(()=>({display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,alignItems:"center",maxWidth:"340px",minWidth:"89px",fontWeight:500}));var R=e=>!e.options&&typeof e.value=="string";function ve(e,t,o){if(e===void 0)return R(o);if(typeof e=="boolean")return e;if(typeof e=="function")return e(t,o);let n=e[t];return typeof n=="boolean"?n:R(o)}var F=e=>e.value??e.label,T=(e,t)=>t?.some(o=>o.value===e.value)??false,Le=(e,t,o)=>{if(T(e,t)){o(t?.filter(n=>n.value!==e.value)||[]);return}o([...t||[],e]);},X=e=>R(e)?[e]:(e.options??[]).flatMap(X),q=(e,t)=>{let o=e.filter(n=>T(n,t)).length;return {allSelected:e.length>0&&o===e.length,someSelected:o>0&&o<e.length}},Oe=(e,t,o)=>{let n=new Set(e.map(i=>i.value));if(q(e,t).allSelected){o((t??[]).filter(i=>!n.has(i.value)));return}let l=new Set((t??[]).map(i=>i.value)),r=e.filter(i=>!l.has(i.value));o([...t??[],...r]);},lt=(e,t)=>{let o=e[t];return typeof o=="string"?o:typeof o=="number"&&Number.isFinite(o)?String(o):""},it=(e,t,o)=>o.some(n=>lt(e,n).toLowerCase().includes(t)),Re=(e,t,o)=>{let n=t.toLowerCase().trim();if(!n)return e.map(i=>({node:i,depth:0}));let l=[],r=(i,d)=>{for(let c of i){if(R(c)){it(c,n,o)&&l.push({node:c,depth:d});continue}r(c.options??[],d+1);}};return r(e,0),l},rt=(e,t="right")=>{let o=e?.closest(`.${Q$1.panel}`);if(!e||!o)return 0;let n=e.getBoundingClientRect(),l=o.getBoundingClientRect(),r=t.startsWith("left")?n.left-l.left:l.right-n.right;return Math.max(0,r)},Ee=e=>[{name:"flip",enabled:true,options:{rootBoundary:"viewport",padding:8,fallbackPlacements:["left-start","right-end","left-end"]}},{name:"preventOverflow",enabled:true,options:{rootBoundary:"viewport",altAxis:true,padding:8}},{name:"offset",options:{offset:({placement:t})=>[0,rt(e.current,t)]}}],We=(e,t)=>e.length===t.length&&e.every((o,n)=>o===t[n]);function Be(e,t,o){let n=[],l=0;for(let r of e){if(t<=0){n.push(void 0);continue}if(l===0&&r>=t){n.push(Math.floor(t));continue}let i=l===0?0:o;if(l+i+r<=t+.5){n.push(void 0),l+=i+r;continue}let d=Math.floor(t-l-i);if(d>=ae&&d>=r*ce){n.push(d),l=0;continue}n.push(void 0),l=r;}return n}var we=(e,t)=>t instanceof Node&&!!e?.contains(t),Ie=(e,t,o)=>{if(we(t,e)||we(o,e))return true;if(!(e instanceof Element)||!o)return false;let n=e.closest(`[${A}]`)?.getAttribute($),l=n?document.getElementById(n):null;return !!(l&&o.contains(l))};function at({options:e,variant:t,hiddenCount:o=0,onRemove:n}){let l=useRef(null),r=useRef([]),[i,d$1]=useState([]),c=e.length+(o>0?1:0),C=e.map(a=>a.label).join("\0");useLayoutEffect(()=>{let a=l.current;if(!a||c===0)return;let m=()=>{let x=r.current.slice(0,c).filter(p=>p!=null);if(x.length!==c)return;let M=x.map(p=>p.style.maxWidth);x.forEach(p=>{p.style.maxWidth="none";});let h=x.map(p=>p.getBoundingClientRect().width);x.forEach((p,j)=>{p.style.maxWidth=M[j];});let g=getComputedStyle(a),W=a.clientWidth-parseFloat(g.paddingLeft)-parseFloat(g.paddingRight),z=parseFloat(g.columnGap||g.gap||"0")||0,B=Be(h,W,z);d$1(p=>We(p,B)?p:B);};m();let v=new ResizeObserver(m);return v.observe(a),()=>v.disconnect()},[c,C,t]);let f=t==="field",b=a=>m=>{m.stopPropagation(),m.preventDefault(),n?.(a);},w=a=>m=>{r.current[a]=m;};return jsxs(be,{ref:l,$field:f,className:f?s.fieldRow:void 0,children:[e.map((a,m)=>jsxs(G,{ref:w(m),$field:f,className:f?void 0:s.selectedBadge,style:i[m]!=null?{maxWidth:i[m]}:void 0,onClick:f?void 0:b(a),children:[f?null:jsx(d,{src:Pc,alt:"",sx:pe}),jsx(xe,{children:a.label}),f?null:jsx(d,{src:Eb,alt:"",sx:ue})]},`${m}-${a.value}`)),o>0?jsx(G,{ref:w(e.length),$field:f,style:i[e.length]!=null?{maxWidth:i[e.length]}:void 0,children:jsxs("span",{children:["+",o]})}):null]})}var H=at;function pt({options:e,maxVisibleValues:t}){let n=typeof t=="number"&&Number.isFinite(t)?Math.max(0,Math.floor(t)):e.length,l=e.slice(0,n),r=e.length-l.length;return jsx(Ne,{children:jsx(H,{options:l,variant:"field",hiddenCount:r})})}var Ae=pt;var Fe=()=>jsx("svg",{width:"5",height:"8",viewBox:"0 0 5 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,style:{display:"block",flexShrink:0},children:jsx("path",{d:"M0.117188 0.504028C0.115307 0.426166 0.138248 0.350264 0.182617 0.286255C0.227088 0.222214 0.290458 0.173028 0.363281 0.144653C0.436073 0.116302 0.516047 0.109152 0.592773 0.124146C0.668745 0.138995 0.738375 0.176073 0.793945 0.229614L4.43164 3.63391C4.50662 3.70421 4.55078 3.80153 4.55078 3.90442C4.55064 4.00712 4.5065 4.10376 4.43164 4.17395L0.794922 7.57922L0.793945 7.57825C0.738766 7.63096 0.669812 7.66692 0.594727 7.68176C0.519097 7.69665 0.440194 7.69049 0.368164 7.66321C0.296002 7.63581 0.232474 7.58801 0.1875 7.52551C0.14262 7.463 0.11821 7.3886 0.118164 7.31165C0.118166 7.25986 0.12907 7.20846 0.150391 7.16125C0.171346 7.11493 0.201824 7.07367 0.239258 7.03918L3.58691 3.90442L0.239258 0.769653C0.164191 0.701295 0.119752 0.605686 0.117188 0.504028Z",fill:"#20232B",stroke:"#20232B",strokeWidth:"0.233333"})});function Ve({label:e,itemCount:t,isSelected:o,isIndeterminate:n,onToggle:l,children:r,isSelectable:i=false}){let d=useId(),c=useRef(null),C=useRef(null),f=useRef(null),b=useRef(null),[w,a]=useState(false),m=useMemo(()=>Ee(c),[]),v=()=>{b.current!=null&&(window.clearTimeout(b.current),b.current=null);},x=()=>{t!==0&&(v(),a(true));},M=h=>{Ie(h.relatedTarget,c.current,C.current)||(v(),b.current=window.setTimeout(()=>{b.current=null,a(false);},re));};return useEffect(()=>()=>{b.current!=null&&window.clearTimeout(b.current);},[]),useEffect(()=>{if(!w)return;let h=()=>f.current?.update();return document.addEventListener("scroll",h,true),window.addEventListener("resize",h),()=>{document.removeEventListener("scroll",h,true),window.removeEventListener("resize",h);}},[w]),jsxs(V,{id:d,ref:c,isSelected:o,isIndeterminate:n,startAdornment:i?void 0:null,onClick:h=>{if(h.stopPropagation(),h.preventDefault(),!i){x();return}l();},onMouseEnter:x,onMouseLeave:M,children:[jsxs(Ce,{children:[e,jsx(Fe,{})]}),jsx(R$1,{ref:C,popperRef:f,[A]:"",[$]:d,sx:{maxHeight:"min(450px, calc(100dvh - 16px))",overflow:"auto"},open:w,anchorEl:c.current,placement:"right-start",modifiers:m,popperOptions:se,onMouseEnter:x,onMouseLeave:M,children:r})]})}function je({option:e,value:t,onChange:o,isSelectable:n=true}){let l=T(e,t);return jsx(V,{isSelected:l,onClick:i=>{i.stopPropagation(),i.preventDefault(),n&&Le(e,t,o);},startAdornment:n?void 0:null,children:jsx(ye,{children:e.label})})}function Q({node:e,depth:t,value:o,onChange:n,isSelectable:l}){let r=ve(l,t,e);if(R(e))return jsx(je,{option:e,value:o,onChange:n,isSelectable:r});if(!e.options)return null;let i=e.options,d=X(e),{allSelected:c,someSelected:C}=q(d,o);return jsx(Ve,{label:e.label,itemCount:i.length,isSelected:c,isIndeterminate:C,isSelectable:r,onToggle:()=>Oe(d,o,n),children:i.map(f=>jsx(Q,{node:f,depth:t+1,value:o,onChange:n,isSelectable:l},F(f)))})}var bt=["label"],Xe=forwardRef(({options:e,onChange:t,value:o,maxVisibleValues:n,placeholder:l,label:r,isLoading:i,isSelectable:d$1,disabled:c,className:C,sx:f,isSearchable:b=true,searchPlaceholder:w,searchBy:a$1=bt,onOpen:m,onClose:v},x)=>{let[M,h]=useState(null),[g,W]=useState(""),[z,B]=useState(void 0),p=!!M,j=r??l,qe=r?l??"Please Select":"Please Select";useEffect(()=>{if(!M)return;let u=()=>{let K=M.clientWidth;K>0&&B(_=>_===K?_:K);};if(u(),typeof ResizeObserver>"u")return;let O=new ResizeObserver(u);return O.observe(M),()=>O.disconnect()},[M]);let Ze=M?.clientWidth||z,Je=u=>{if(p){h(null),v?.();return}h(u.currentTarget),m?.();},Qe=()=>{h(null),v?.();},Ue=()=>{g&&W("");},Ye=useMemo(()=>Re(e,g,a$1),[e,g,a$1]),Y=o?.length??0,_e=i?jsx(CircularProgress,{size:16}):jsx(d,{src:g?Eb:A$1,alt:g?"close":"search",onClick:Ue,sx:{width:12,height:12,cursor:g?"pointer":"default"}});return jsx(gt,{onClickAway:()=>{p&&Qe();},children:jsxs(me,{ref:x,id:"FieldWrapper","data-testid":"NestedMultiSelect",$disabled:c,"aria-disabled":c||void 0,className:nc(s.root,p&&s.open,C),sx:f,onClick:u=>!c&&Je(u),children:[jsx(he,{className:s.label,component:"label",children:j}),Y===0&&jsx(Se,{className:s.placeholder,component:"p",children:qe}),jsx(Me,{className:s.arrow,"aria-hidden":true,children:i?jsx(CircularProgress,{size:16}):jsx(a,{})}),Y>0&&o?jsx(Ae,{options:o,maxVisibleValues:n}):null,jsx(R$1,{open:p,anchorEl:M,sx:{margin:"8px 0",maxHeight:330,overflow:"auto",width:Ze},panelProps:{className:s.menu},children:jsxs(ge,{children:[b?jsx(L$1,{className:s.search,fullWidth:true,size:"md",placeholder:w??l??"Select",endAdornment:_e,value:g,onClick:u=>{u.stopPropagation();},onMouseDown:u=>{u.stopPropagation();},onChange:u=>{W(u.target.value);},sx:{mb:"8px"}}):null,jsx(H,{options:o??[],variant:"menu",onRemove:u=>{t(o?.filter(O=>O.value!==u.value)||[]);}}),Ye.map(({node:u,depth:O})=>jsx(Q,{node:u,depth:O,value:o,onChange:t,isSelectable:d$1},F(u)))]})})]})})});Xe.displayName="NestedMultiSelect";var xt=memo(Xe);
|
|
1
|
+
import {a}from'./chunk-HDCNWBW5.js';import {d,R as R$1,L as L$1,V,Q as Q$1}from'./chunk-AJJSWLJL.js';import {nc}from'./chunk-BYJ7JVY3.js';import {Fb,A as A$1,Qc}from'./chunk-4FJ26UVI.js';import {forwardRef,useState,useEffect,useMemo,memo,useRef,useLayoutEffect,useId}from'react';import gt from'@mui/material/ClickAwayListener';import {CircularProgress}from'@mui/material';import L from'@mui/material/Box';import fe from'@mui/material/Typography';import {styled,alpha}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var y="os-shared-NestedMultiSelect",s={root:`${y}-root`,open:`${y}-open`,label:`${y}-label`,placeholder:`${y}-placeholder`,arrow:`${y}-arrow`,menu:`${y}-menu`,search:`${y}-search`,selectedBadge:`${y}-selectedBadge`,fieldRow:`${y}-fieldRow`},re=40,A="data-nested-submenu",$="data-nested-submenu-anchor",se={strategy:"fixed"},ce=.7,ae=100,pe={width:10,height:7.5,flexShrink:0},ue={width:9,height:9,flexShrink:0};var et={overflow:"hidden",flex:"0 0 auto",width:"max-content",maxWidth:"100%",minWidth:0},tt=e=>({display:"flex",padding:"4px 8px 4px 6px",alignItems:"center",gap:"4px",borderRadius:"13px",backgroundColor:e,fontSize:"10px",fontWeight:500,cursor:"pointer"}),me=styled(L,{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:t=false})=>{let{base:o}=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(o.black,.6),[`& .${s.label}`]:{opacity:.7,cursor:"not-allowed"},[`& .${s.placeholder}`]:{color:alpha(o.black,.6)},[`& .${s.arrow}`]:{opacity:.6},[`& .${s.fieldRow}`]:{opacity:.7},[`& .${s.fieldRow} *`]:{cursor:"not-allowed"}},[`&.${s.open} .${s.arrow}`]:{transform:"rotate(180deg)"},[`&.${s.open} .${s.arrow} svg path, &:focus-within .${s.arrow} svg path`]:{fill:"#1F88D0",stroke:"#1F88D0"},[`&.${s.open}, &:focus-within`]:{border:"1px solid #1F88D0",boxShadow:"0px 0px 4px 0px #1F88D080"}}}),he=styled(fe)(({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"})),Se=styled(fe)(()=>({margin:0,fontWeight:500,fontSize:"11px",lineHeight:"18px",padding:"22px 30px 8px 8px"})),Me=styled(L)(({theme:e})=>({position:"absolute",top:15,right:10,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})})),ge=styled(L)(()=>({display:"flex",flexDirection:"column",padding:"8px"})),ot={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},nt={display:"flex",flexWrap:"wrap",alignItems:"center",alignContent:"flex-start",gap:"4px",width:"100%",minWidth:0},be=styled(L,{shouldForwardProp:e=>e!=="$field"})(({$field:e})=>({...nt,...e?{padding:"22px 30px 8px 8px"}:{marginBottom:"8px","&:empty":{display:"none"}}})),G=styled(L,{shouldForwardProp:e=>e!=="$field"})(({theme:e,$field:t})=>({...tt(`${e.palette.info.dark}1a`),...et,...t&&{cursor:"inherit"}})),xe=styled("span")(()=>ot),Ne=styled(L)(()=>({position:"relative",width:"100%",minWidth:0})),ye=styled(L)(()=>({flex:1,maxWidth:"220px",minWidth:"89px",fontWeight:500})),Ce=styled(L)(()=>({display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,alignItems:"center",maxWidth:"340px",minWidth:"89px",fontWeight:500}));var R=e=>!e.options&&typeof e.value=="string";function ve(e,t,o){if(e===void 0)return R(o);if(typeof e=="boolean")return e;if(typeof e=="function")return e(t,o);let n=e[t];return typeof n=="boolean"?n:R(o)}var F=e=>e.value??e.label,T=(e,t)=>t?.some(o=>o.value===e.value)??false,Le=(e,t,o)=>{if(T(e,t)){o(t?.filter(n=>n.value!==e.value)||[]);return}o([...t||[],e]);},X=e=>R(e)?[e]:(e.options??[]).flatMap(X),q=(e,t)=>{let o=e.filter(n=>T(n,t)).length;return {allSelected:e.length>0&&o===e.length,someSelected:o>0&&o<e.length}},Oe=(e,t,o)=>{let n=new Set(e.map(i=>i.value));if(q(e,t).allSelected){o((t??[]).filter(i=>!n.has(i.value)));return}let l=new Set((t??[]).map(i=>i.value)),r=e.filter(i=>!l.has(i.value));o([...t??[],...r]);},lt=(e,t)=>{let o=e[t];return typeof o=="string"?o:typeof o=="number"&&Number.isFinite(o)?String(o):""},it=(e,t,o)=>o.some(n=>lt(e,n).toLowerCase().includes(t)),Re=(e,t,o)=>{let n=t.toLowerCase().trim();if(!n)return e.map(i=>({node:i,depth:0}));let l=[],r=(i,d)=>{for(let c of i){if(R(c)){it(c,n,o)&&l.push({node:c,depth:d});continue}r(c.options??[],d+1);}};return r(e,0),l},rt=(e,t="right")=>{let o=e?.closest(`.${Q$1.panel}`);if(!e||!o)return 0;let n=e.getBoundingClientRect(),l=o.getBoundingClientRect(),r=t.startsWith("left")?n.left-l.left:l.right-n.right;return Math.max(0,r)},Ee=e=>[{name:"flip",enabled:true,options:{rootBoundary:"viewport",padding:8,fallbackPlacements:["left-start","right-end","left-end"]}},{name:"preventOverflow",enabled:true,options:{rootBoundary:"viewport",altAxis:true,padding:8}},{name:"offset",options:{offset:({placement:t})=>[0,rt(e.current,t)]}}],We=(e,t)=>e.length===t.length&&e.every((o,n)=>o===t[n]);function Be(e,t,o){let n=[],l=0;for(let r of e){if(t<=0){n.push(void 0);continue}if(l===0&&r>=t){n.push(Math.floor(t));continue}let i=l===0?0:o;if(l+i+r<=t+.5){n.push(void 0),l+=i+r;continue}let d=Math.floor(t-l-i);if(d>=ae&&d>=r*ce){n.push(d),l=0;continue}n.push(void 0),l=r;}return n}var we=(e,t)=>t instanceof Node&&!!e?.contains(t),Ie=(e,t,o)=>{if(we(t,e)||we(o,e))return true;if(!(e instanceof Element)||!o)return false;let n=e.closest(`[${A}]`)?.getAttribute($),l=n?document.getElementById(n):null;return !!(l&&o.contains(l))};function at({options:e,variant:t,hiddenCount:o=0,onRemove:n}){let l=useRef(null),r=useRef([]),[i,d$1]=useState([]),c=e.length+(o>0?1:0),C=e.map(a=>a.label).join("\0");useLayoutEffect(()=>{let a=l.current;if(!a||c===0)return;let m=()=>{let x=r.current.slice(0,c).filter(p=>p!=null);if(x.length!==c)return;let M=x.map(p=>p.style.maxWidth);x.forEach(p=>{p.style.maxWidth="none";});let h=x.map(p=>p.getBoundingClientRect().width);x.forEach((p,j)=>{p.style.maxWidth=M[j];});let g=getComputedStyle(a),W=a.clientWidth-parseFloat(g.paddingLeft)-parseFloat(g.paddingRight),z=parseFloat(g.columnGap||g.gap||"0")||0,B=Be(h,W,z);d$1(p=>We(p,B)?p:B);};m();let v=new ResizeObserver(m);return v.observe(a),()=>v.disconnect()},[c,C,t]);let f=t==="field",b=a=>m=>{m.stopPropagation(),m.preventDefault(),n?.(a);},w=a=>m=>{r.current[a]=m;};return jsxs(be,{ref:l,$field:f,className:f?s.fieldRow:void 0,children:[e.map((a,m)=>jsxs(G,{ref:w(m),$field:f,className:f?void 0:s.selectedBadge,style:i[m]!=null?{maxWidth:i[m]}:void 0,onClick:f?void 0:b(a),children:[f?null:jsx(d,{src:Qc,alt:"",sx:pe}),jsx(xe,{children:a.label}),f?null:jsx(d,{src:Fb,alt:"",sx:ue})]},`${m}-${a.value}`)),o>0?jsx(G,{ref:w(e.length),$field:f,style:i[e.length]!=null?{maxWidth:i[e.length]}:void 0,children:jsxs("span",{children:["+",o]})}):null]})}var H=at;function pt({options:e,maxVisibleValues:t}){let n=typeof t=="number"&&Number.isFinite(t)?Math.max(0,Math.floor(t)):e.length,l=e.slice(0,n),r=e.length-l.length;return jsx(Ne,{children:jsx(H,{options:l,variant:"field",hiddenCount:r})})}var Ae=pt;var Fe=()=>jsx("svg",{width:"5",height:"8",viewBox:"0 0 5 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,style:{display:"block",flexShrink:0},children:jsx("path",{d:"M0.117188 0.504028C0.115307 0.426166 0.138248 0.350264 0.182617 0.286255C0.227088 0.222214 0.290458 0.173028 0.363281 0.144653C0.436073 0.116302 0.516047 0.109152 0.592773 0.124146C0.668745 0.138995 0.738375 0.176073 0.793945 0.229614L4.43164 3.63391C4.50662 3.70421 4.55078 3.80153 4.55078 3.90442C4.55064 4.00712 4.5065 4.10376 4.43164 4.17395L0.794922 7.57922L0.793945 7.57825C0.738766 7.63096 0.669812 7.66692 0.594727 7.68176C0.519097 7.69665 0.440194 7.69049 0.368164 7.66321C0.296002 7.63581 0.232474 7.58801 0.1875 7.52551C0.14262 7.463 0.11821 7.3886 0.118164 7.31165C0.118166 7.25986 0.12907 7.20846 0.150391 7.16125C0.171346 7.11493 0.201824 7.07367 0.239258 7.03918L3.58691 3.90442L0.239258 0.769653C0.164191 0.701295 0.119752 0.605686 0.117188 0.504028Z",fill:"#20232B",stroke:"#20232B",strokeWidth:"0.233333"})});function Ve({label:e,itemCount:t,isSelected:o,isIndeterminate:n,onToggle:l,children:r,isSelectable:i=false}){let d=useId(),c=useRef(null),C=useRef(null),f=useRef(null),b=useRef(null),[w,a]=useState(false),m=useMemo(()=>Ee(c),[]),v=()=>{b.current!=null&&(window.clearTimeout(b.current),b.current=null);},x=()=>{t!==0&&(v(),a(true));},M=h=>{Ie(h.relatedTarget,c.current,C.current)||(v(),b.current=window.setTimeout(()=>{b.current=null,a(false);},re));};return useEffect(()=>()=>{b.current!=null&&window.clearTimeout(b.current);},[]),useEffect(()=>{if(!w)return;let h=()=>f.current?.update();return document.addEventListener("scroll",h,true),window.addEventListener("resize",h),()=>{document.removeEventListener("scroll",h,true),window.removeEventListener("resize",h);}},[w]),jsxs(V,{id:d,ref:c,isSelected:o,isIndeterminate:n,startAdornment:i?void 0:null,onClick:h=>{if(h.stopPropagation(),h.preventDefault(),!i){x();return}l();},onMouseEnter:x,onMouseLeave:M,children:[jsxs(Ce,{children:[e,jsx(Fe,{})]}),jsx(R$1,{ref:C,popperRef:f,[A]:"",[$]:d,sx:{maxHeight:"min(450px, calc(100dvh - 16px))",overflow:"auto"},open:w,anchorEl:c.current,placement:"right-start",modifiers:m,popperOptions:se,onMouseEnter:x,onMouseLeave:M,children:r})]})}function je({option:e,value:t,onChange:o,isSelectable:n=true}){let l=T(e,t);return jsx(V,{isSelected:l,onClick:i=>{i.stopPropagation(),i.preventDefault(),n&&Le(e,t,o);},startAdornment:n?void 0:null,children:jsx(ye,{children:e.label})})}function Q({node:e,depth:t,value:o,onChange:n,isSelectable:l}){let r=ve(l,t,e);if(R(e))return jsx(je,{option:e,value:o,onChange:n,isSelectable:r});if(!e.options)return null;let i=e.options,d=X(e),{allSelected:c,someSelected:C}=q(d,o);return jsx(Ve,{label:e.label,itemCount:i.length,isSelected:c,isIndeterminate:C,isSelectable:r,onToggle:()=>Oe(d,o,n),children:i.map(f=>jsx(Q,{node:f,depth:t+1,value:o,onChange:n,isSelectable:l},F(f)))})}var bt=["label"],Xe=forwardRef(({options:e,onChange:t,value:o,maxVisibleValues:n,placeholder:l,label:r,isLoading:i,isSelectable:d$1,disabled:c,className:C,sx:f,isSearchable:b=true,searchPlaceholder:w,searchBy:a$1=bt,onOpen:m,onClose:v},x)=>{let[M,h]=useState(null),[g,W]=useState(""),[z,B]=useState(void 0),p=!!M,j=r??l,qe=r?l??"Please Select":"Please Select";useEffect(()=>{if(!M)return;let u=()=>{let K=M.clientWidth;K>0&&B(_=>_===K?_:K);};if(u(),typeof ResizeObserver>"u")return;let O=new ResizeObserver(u);return O.observe(M),()=>O.disconnect()},[M]);let Ze=M?.clientWidth||z,Je=u=>{if(p){h(null),v?.();return}h(u.currentTarget),m?.();},Qe=()=>{h(null),v?.();},Ue=()=>{g&&W("");},Ye=useMemo(()=>Re(e,g,a$1),[e,g,a$1]),Y=o?.length??0,_e=i?jsx(CircularProgress,{size:16}):jsx(d,{src:g?Fb:A$1,alt:g?"close":"search",onClick:Ue,sx:{width:12,height:12,cursor:g?"pointer":"default"}});return jsx(gt,{onClickAway:()=>{p&&Qe();},children:jsxs(me,{ref:x,id:"FieldWrapper","data-testid":"NestedMultiSelect",$disabled:c,"aria-disabled":c||void 0,className:nc(s.root,p&&s.open,C),sx:f,onClick:u=>!c&&Je(u),children:[jsx(he,{className:s.label,component:"label",children:j}),Y===0&&jsx(Se,{className:s.placeholder,component:"p",children:qe}),jsx(Me,{className:s.arrow,"aria-hidden":true,children:i?jsx(CircularProgress,{size:16}):jsx(a,{})}),Y>0&&o?jsx(Ae,{options:o,maxVisibleValues:n}):null,jsx(R$1,{open:p,anchorEl:M,sx:{margin:"8px 0",maxHeight:330,overflow:"auto",width:Ze},panelProps:{className:s.menu},children:jsxs(ge,{children:[b?jsx(L$1,{className:s.search,fullWidth:true,size:"md",placeholder:w??l??"Select",endAdornment:_e,value:g,onClick:u=>{u.stopPropagation();},onMouseDown:u=>{u.stopPropagation();},onChange:u=>{W(u.target.value);},sx:{mb:"8px"}}):null,jsx(H,{options:o??[],variant:"menu",onRemove:u=>{t(o?.filter(O=>O.value!==u.value)||[]);}}),Ye.map(({node:u,depth:O})=>jsx(Q,{node:u,depth:O,value:o,onChange:t,isSelectable:d$1},F(u)))]})})]})})});Xe.displayName="NestedMultiSelect";var xt=memo(Xe);
|
|
2
2
|
export{s as a,xt as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {Bc}from'./chunk-
|
|
1
|
+
import {Bc}from'./chunk-BYJ7JVY3.js';import {t,s}from'./chunk-4FJ26UVI.js';import {useId}from'react';import S from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,Fragment}from'react/jsx-runtime';var c=styled(S)(()=>({height:10}));styled("span")(({theme:o})=>({fontSize:o.typography.body2.fontSize,lineHeight:"17px",fontWeight:"700"}));styled("span")(()=>({fontWeight:"400"}));var l=styled("span")(({symbol:o,fontSize:e,color:t})=>({display:"inline-block",height:e,width:e,backgroundColor:t,maskImage:`url("${o}")`,maskSize:"contain",maskRepeat:"no-repeat",maskPosition:"center",WebkitMaskImage:`url("${o}")`,WebkitMaskSize:"contain",WebkitMaskRepeat:"no-repeat",WebkitMaskPosition:"center"}));var u={SAR:s,AED:t};function g({currency:o,fontSize:e,color:t,sx:m={}}){let a=Bc(useId(),"currency-symbol"),n=u[o];return n?t?jsx(l,{id:a,"data-testid":"CurrencySymbol",symbol:n,fontSize:e,color:t,"aria-label":o,role:"img",sx:m}):jsx(c,{id:a,"data-testid":"CurrencySymbol",component:"img",src:n,alt:o,sx:{height:e,...m}}):jsx(Fragment,{children:o})}var b=g;var B=b;export{B as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {Bc,bb,nc,mc,ac}from'./chunk-
|
|
1
|
+
import {Bc,bb,nc,mc,ac}from'./chunk-BYJ7JVY3.js';import {Yo,ta,ra}from'./chunk-4FJ26UVI.js';import {forwardRef,useId,useRef,useState,useEffect,useCallback,memo}from'react';import {useTranslation}from'react-i18next';import {useForkRef}from'@mui/material/utils';import R from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var f="os-shared-SheetViewChip",r={root:`${f}-root`,chip:`${f}-chip`,text:`${f}-text`,copyButton:`${f}-copyButton`},J=2e3,K=.3;var Q=styled("div")({position:"relative",width:"fit-content",maxWidth:"100%",'[data-column-align="right"] &':{marginLeft:"auto"}}),x=styled(R,{shouldForwardProp:e=>!["chipTextColor","chipBgColor","chipBorderColor","disabled","isSelected","disableAnimation"].includes(e)})(({theme:e,isSelected:w,chipTextColor:n=e.palette.text.primary,chipBgColor:i="#EFF1F2",chipBorderColor:o="#EFF1F2",disabled:h=false,disableAnimation:y})=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",height:"18px",padding:"0px 8px",borderRadius:"30px",border:`1px solid ${o}`,backgroundColor:i,color:n,cursor:h?"not-allowed":"pointer",opacity:h?.5:1,whiteSpace:"nowrap",fontSize:"11px",minWidth:"67px",maxWidth:"none",width:"fit-content",overflow:"hidden",textOverflow:"unset",boxSizing:"border-box",...w&&{boxShadow:"white 7px 0px 8px 2px"},...y&&{transition:"none !important",animation:"none !important",transform:"none !important","& *":{transform:"none !important"}}})),L=styled(R)(()=>({gap:"4px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,flex:1})),U=styled(R)(()=>({position:"absolute",top:0,height:"100%",width:"12px",display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center"})),Y=styled("img",{shouldForwardProp:e=>e!=="isVisible"})(({isVisible:e})=>({height:12,width:12,objectFit:"contain",opacity:e?1:0,transform:`translateX(${e?0:-5}px)`,pointerEvents:e?"auto":"none",transition:"opacity 100ms ease, transform 100ms ease"}));var oe=forwardRef(({id:e,className:w,children:n,copyText:i,copyTrigger:o="hover",animationDirection:h="right",animationDuration:y=200,disableAnimation:S=false,disabled:v=false,unknownText:ie,fullWidth:a=false,containerStyles:se,sx:b,onClick:g,onMouseEnter:V,onMouseLeave:E,...N},F)=>{let $=Bc(useId(),"sheet-view-chip"),{t:ne}=useTranslation(),k=useRef(null),re=useForkRef(k,F),M=useRef(),[P,c]=useState(false),[W,A]=useState(false),p=o==="always"||P,I=p&&!!i,l=h==="left",H=Math.max(0,y),T=K*1e3,ae=p?0:T;useEffect(()=>{if(o!=="press"||!P)return;let t=me=>{k.current?.contains(me.target)||c(false);};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[o,P]),useEffect(()=>()=>clearTimeout(M.current),[]);let pe=useCallback(t=>{o==="press"&&c(true),g?.(t);},[o,g]),le=useCallback(t=>{o==="hover"&&i&&c(true),V?.(t);},[o,i,V]),de=useCallback(t=>{o==="hover"&&c(false),E?.(t);},[o,E]),he=useCallback(t=>{t.stopPropagation(),i&&(A(true),bb(i),clearTimeout(M.current),M.current=setTimeout(()=>A(false),J));},[i]),B=nc(r.chip,w);if(!n)return jsx(x,{...N,chipBgColor:Yo.bgColor,chipBorderColor:Yo.borderColor,chipTextColor:Yo.textColor,ref:F,id:e??$,"data-testid":"SheetViewChip",className:nc(r.root,B),disabled:v,disableAnimation:S,onClick:g,onMouseEnter:V,onMouseLeave:E,sx:mc(b??{},t=>({borderColor:t.palette.divider,width:a?"100%":"auto"})),children:ne(ie??"unknown")});let ce=S?"none":`z-index 0ms linear ${p?0:T+H}ms`,z={zIndex:p?3:0,transition:ce};return jsxs(Q,{ref:re,id:e??$,"data-testid":"SheetViewChip",className:r.root,style:{...z,...se,...a&&{width:"100%",minWidth:0,marginLeft:0}},children:[jsx(x,{...N,"aria-hidden":true,className:B,disabled:v,sx:mc(b??{},{visibility:"hidden",pointerEvents:"none",width:a?"100%":"fit-content"}),children:jsx(L,{children:n})}),jsx("div",{style:{position:"absolute",top:0,...z,width:a?"100%":"max-content",left:l?"auto":0,right:l?0:"auto"},children:jsxs(x,{...N,className:B,isSelected:p,disabled:v,disableAnimation:S,onClick:pe,onMouseEnter:le,onMouseLeave:de,sx:mc({width:a?"100%":"auto"},b),children:[jsx("div",{style:{display:"flex",gap:"4px",...a&&{maxWidth:"100%",width:"100%"},paddingRight:I&&!l?12:0,paddingLeft:I&&l?12:0,transition:`padding ${H}ms ease ${ae}ms`},children:jsx(L,{className:r.text,"data-is-arabic":typeof n=="string"&&ac(n),children:n})}),i&&jsx(U,{className:r.copyButton,sx:l?{left:"8px"}:{right:"8px"},children:jsx(Y,{isVisible:I,src:W?ta:ra,alt:W?"copied":"copy",onClick:he})})]})})]})});oe.displayName="SheetViewChip";var ye=memo(oe);export{r as a,ye as b};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {b,k}from'./chunk-
|
|
1
|
+
import {b,k}from'./chunk-3VJ65CKN.js';import {a as a$1}from'./chunk-CC7EFANR.js';import {a,g,e}from'./chunk-4N3FBJNL.js';import {a as a$2}from'./chunk-HROFC3Z7.js';import {a as a$3,b as b$1}from'./chunk-MUR4ILTY.js';import {aa,ba}from'./chunk-AJJSWLJL.js';import {Bc,Dc}from'./chunk-BYJ7JVY3.js';import {Qc}from'./chunk-4FJ26UVI.js';import mo,{useState,useEffect,useMemo,useRef,useCallback,useId}from'react';import {useFormContext,Controller}from'react-hook-form';import Pe from'@mui/material/Box';import Ie from'@mui/material/MenuItem';import lo from'@mui/material/Popper';import io from'@mui/material/TextField';import {keyframes,styled}from'@mui/material/styles';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var so=keyframes`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(-90deg);
|
|
4
4
|
}
|
|
5
5
|
100% {
|
|
6
6
|
transform: rotate(270deg);
|
|
7
7
|
}
|
|
8
|
-
`,Te=styled(Pe)({width:12,height:12,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:"100%",height:"100%",display:"block"},animation:`${so} 2s linear infinite`}),j=styled(Pe)(({theme:e})=>({position:"relative",width:11,height:11,transform:"rotate(0deg)",color:e.palette.common.black,"& svg":{width:"100%",height:"100%",display:"block"}})),ke=styled(b)({paddingTop:"8px"}),te=styled("ul")({listStyle:"none",margin:0,padding:0}),Ae=styled(Ie)(({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"}})),we=styled(Ie,{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})),G=styled("span")({flex:1,minWidth:0}),K=styled("img")({width:10,height:7.5,flexShrink:0}),ve=styled("li",{shouldForwardProp:e=>!["$selected","$optionDisabled"].includes(String(e))})(({theme:e,$selected:o,$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:o?e.palette.action.hover:e.palette.common.white,"&.Mui-focused":{backgroundColor:e.palette.action.hover},...n&&{opacity:.38,pointerEvents:"none"}})),ne=styled("span")({fontSize:"10px",fontWeight:500,color:"#8D8D94"}),Ne=styled(io,{shouldForwardProp:e=>!["feedbackType","hasFeedback","hasLabel"].includes(e)})(({theme:e,error:o,feedbackType:n,hasFeedback:a,hasLabel:r})=>{let{borderColor:s}=n?aa(e,n):{borderColor:void 0},u=a?"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:u,backgroundColor:e.palette.grey[400],paddingTop:r?"11px":"0px",paddingBottom:r?"4px":"0px",paddingLeft:"8px",boxSizing:"border-box",display:"inline-flex",alignItems:r?"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:r?"flex-end":"center",alignSelf:r?"flex-end":"center",fontSize:"11px",lineHeight:"11px",color:e.palette.common.black,paddingBottom:r?"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&&s&&{"& .MuiFilledInput-root":{border:`1px solid ${s}`}},...a&&{"& .MuiFilledInput-root":{borderBottom:"none",borderBottomLeftRadius:0,borderBottomRightRadius:0}},...o&&{"& .MuiFilledInput-root":{border:`1px solid ${e.palette.error.main}`}}}}),Oe=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"}),Ee=styled(lo,{shouldForwardProp:e=>!["$menuHasLoadingText","$suppressAutocompleteNoOptions","$suppressEmptyMenuSurface"].includes(e)})(({theme:e,$menuHasLoadingText:o,$suppressAutocompleteNoOptions:n,$suppressEmptyMenuSurface:a})=>({"& .MuiPaper-root":a?{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,...a?{maxHeight:0,minHeight:0,overflow:"hidden"}:{maxHeight:320}},"& .MuiAutocomplete-noOptions":n?{display:"none !important"}:Oe(e),"& .MuiAutocomplete-loading":{...Oe(e),...!o&&{display:"none"}}}));function Y({placeholder:e,value:o,onValueChange:n,isLoading:a}){let r=Bc(useId(),"form-select-menu-search-input"),s=useCallback(u=>{u.stopPropagation();},[]);return jsx(k,{id:r,"data-testid":"FormSelectMenuSearchInput",placeholder:e,value:o,onChange:u=>n(u.target.value),onKeyDown:s,onKeyUp:s,onMouseDown:s,onClick:s,disableUnderline:true,fullWidth:true,inputProps:{"aria-label":e},endAdornment:a?jsx(Te,{"aria-hidden":true,children:jsx(b$1,{})}):jsx(j,{"aria-hidden":true,children:jsx(a$3,{})})})}var J=jsx(ne,{children:"No results found"}),He=jsx(ne,{children:"Loading\u2026"});function Q(e,o,n){return o?o(e):n?n(e):e?.label}function re(e,o,n){let a=o.toLowerCase().trim(),r=(n?n(e):e?.label)??"";return String(r).toLowerCase().includes(a)}function Ve(e){return e}function Be(e){let o=mo.forwardRef(function(a,r){let{children:s,className:u,...h}=a,m=e.current;return m?jsxs(Fragment,{children:[jsx(ke,{disableSticky:true,children:jsx(Y,{placeholder:m.menuSearchPlaceholder,value:m.searchValue,onValueChange:m.setSearchValue,isLoading:m.isLoading})}),jsx(te,{ref:r,className:u,...h,children:s})]}):jsx(te,{ref:r,className:u,...h,children:s})});return o.displayName="FormSelectMenuSearchListbox",o}function De({menuSearchPlaceholder:e,searchValue:o,onSearchChange:n,isLoading:a,menuHasNoOptionsText:r,menuNoOptionsText:s,optionsWithoutEmptyValue:u,getOptionValue:h,getOptionLabel:m,renderOption:g,isOptionEqualToValue:d,menuHasSelectedCheckMark:y,valueOnly:M,getOptionId:O,field:P,onChange:L}){return jsxs(Fragment,{children:[jsx(b,{disableSticky:true,onMouseDown:l=>l.stopPropagation(),onClick:l=>l.stopPropagation(),children:jsx(Y,{placeholder:e,value:o,onValueChange:n,isLoading:a})}),r&&o.trim()&&u.length===0?jsx(Ae,{disabled:true,value:"__form_select_no_results__",children:s??J}):u.map((l,i)=>{let c=d?d(l,P.value):l?.id===P.value?.id,f=Q(l,g,m);return jsxs(we,{disabled:!!l.disabled,$selected:c,value:(h?h(l):l?.id)??"",onClick:()=>{P.onChange(M?O(l):l),L?.(l);},children:[jsx(G,{children:f}),y&&c?jsx(K,{src:Pc,alt:""}):null]},`form-select-item-${i}-${(h?h(l):l?.id)??""}`)})]})}var X={menuHasLoadingText:false,suppressAutocompleteNoOptions:false,suppressEmptyMenuSurface:false};function bo(e,o){e!=null&&(typeof e=="function"?e(o):e.current=o);}function Fo(...e){return o=>{for(let n of e)bo(n,o);}}function xo(e){let o=n=>{let a=e.current;return jsx(Ee,{...n,$menuHasLoadingText:a.menuHasLoadingText,$suppressAutocompleteNoOptions:a.suppressAutocompleteNoOptions,$suppressEmptyMenuSurface:a.suppressEmptyMenuSurface})};return o.displayName="FormSelectSearchableAutocompletePopper",o}function qe(e$1){let o=Bc(useId(),"form-select-searchable-field"),n=useRef(null),a$1=useRef(X);n.current=e$1.menuSearchable?{searchValue:e$1.inMenuSearchContextValue.searchValue,setSearchValue:e$1.inMenuSearchContextValue.setSearchValue,menuSearchPlaceholder:e$1.inMenuSearchContextValue.menuSearchPlaceholder,isLoading:e$1.inMenuSearchContextValue.isLoading}:null,a$1.current=e$1.searchableAutocompletePopperFlags;let r=useMemo(()=>Be(n),[]),s=useMemo(()=>xo(a$1),[]),u=e$1.feedback,{isProvided:h,isVisible:m,type:g$1}=Dc(u),d=!!e$1.fieldState.error&&!m,y=e$1.helperText??e$1.fieldState.error?.message,M=e$1.internalValue!=null&&e$1.internalValue!==""&&typeof e$1.internalValue=="object"?e$1.internalValue:null,O=e$1.getOptionLabel??(i=>String(i?.label??"")),P=e$1.isOptionEqualToValue??((i,c)=>i&&c?i.id===c.id:i===c),L=e$1.ClearIconComponent??a,l=e$1.label!=null&&e$1.label!=="";return jsxs(g,{id:o,"data-testid":"FormSelectSearchableField",children:[jsx(a$2,{...e$1.autocompleteRest,disableClearable:!e$1.showClearIcon,clearIcon:jsx(L,{sx:{fontSize:8,width:8,height:8}}),ListboxComponent:e$1.menuSearchable?r:void 0,PopperComponent:s,options:e$1.optionsWithClearFilterOnly,value:M,onChange:(i,c,f)=>{if(c==null&&e$1.onClear&&f==="clear"){e$1.onClear();return}if(e$1.valueOnly){let F=c==null?null:e$1.getOptionId(c);e$1.field.onChange(F);}else e$1.field.onChange(c);e$1.onChange?.(c);},onInputChange:(i,c,f)=>{e$1.setSearchableInputValue(c),(f==="input"||f==="clear")&&e$1.scheduleSearchNotification(c);},slotProps:e$1.slotProps??{},filterOptions:e$1.menuSearchable?e$1.autocompleteFilterOptions:Ve,loading:!!e$1.isLoading,disabled:!!e$1.disabled,getOptionLabel:O,getOptionDisabled:i=>!!i.disabled,isOptionEqualToValue:P,renderOption:e$1.renderAutocompleteOption,noOptionsText:e$1.menuNoOptionsText??J,loadingText:e$1.menuHasLoadingText?e$1.menuLoadingText??He:null,popupIcon:jsx(j,{children:jsx(a$3,{})}),renderInput:i=>{let{inputProps:c,...f}=i,{ref:F,...Z}=c;return jsx(Ne,{...f,variant:"filled",label:e$1.label,placeholder:e$1.placeholder,required:e$1.required,error:d,helperText:null,feedbackType:g$1,hasFeedback:m,hasLabel:l,inputRef:Fo(F,e$1.field.ref,e$1.inputRef),InputProps:{...i.InputProps,disableUnderline:true},inputProps:{...Z,name:e$1.field.name,onBlur:e$1.field.onBlur}})}}),h?jsx(ba,{...u}):jsx(e,{children:y})]})}function Ge(e){let{name:o,helperText:n,feedback:a$2,menuSearchable:r=false,showClearIcon:s=false,ClearIconComponent:u=a,onClear:h,menuSearchPlaceholder:m="Search",getOptionValue:g,getOptionLabel:d,renderOption:y,isOptionEqualToValue:M,options:O,MenuProps:P,valueOnly:L=false,menuHasSelectedCheckMark:l=false,searchable:i=false,onSearchInputChange:c,searchDebounceMs:f=300,minSearchLength:F,menuLoadingText:Z,menuHasLoadingText:V=false,menuHasNoOptionsText:ee=true,menuNoOptionsText:le,label:ie,placeholder:ce,required:se,disabled:pe,isLoading:I,inputRef:Ye,onChange:oe,...ue}=e,{control:Je}=useFormContext(),[b,me]=useState(""),[de,he]=useState("");useEffect(()=>{i||he("");},[i]);let Qe=useMemo(()=>({searchValue:b,setSearchValue:me,menuSearchPlaceholder:m,isLoading:!!I}),[b,m,I]),w=useRef(void 0),B=useRef(c);B.current=c,useEffect(()=>()=>{w.current&&clearTimeout(w.current);},[]);let Xe=useCallback(t=>{if(!B.current)return;let p=t.trim();w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{if(p===""){B.current?.("");return}F!=null&&p.length<F||B.current?.(p);},f);},[f,F]),T=useMemo(()=>{let t=O??[];return !s||!g?t:t.filter(p=>{let x=g(p);return x!=null&&x!==""})},[s,g,O]),Se=useMemo(()=>!r||!b.trim()?T:T.filter(t=>re(t,b,d)),[r,b,T,d]),v=useMemo(()=>r?Se:T,[r,Se,T]),Ze=useCallback(t=>!r||!b.trim()?t:t.filter(p=>re(p,b,d)),[r,b,d]),eo=useMemo(()=>{if(!i)return X;let t=de.trim(),p=t.length===0||F!=null&&t.length>0&&t.length<F,x=r&&!!b.trim()&&v.length===0,C=p&&!x||!ee,D=v.length>0;return {menuHasLoadingText:V,suppressAutocompleteNoOptions:C,suppressEmptyMenuSurface:!D&&!(!C&&!D)&&!!!(I&&V)}},[i,de,F,r,b,v,ee,I,V]),oo={...P,autoFocus:false,disableEnforceFocus:true},$=t=>(g?g(t):t?.id)??"",to=t=>!L||!t?t:O?.find(p=>$(p)===t)??t,no=useCallback((t,p,x)=>{let C=Q(p,y,d),D=!!p.disabled;return jsxs(ve,{...t,$selected:x.selected,$optionDisabled:D,children:[jsx(G,{children:C}),l&&x.selected?jsx(K,{src:Pc,alt:""}):null]})},[d,y,l]),ge={...ue};for(let t of ["IconComponent","startComponent"])delete ge[t];let{slotProps:ro={},...ao}=ge;return jsx(Controller,{name:o,control:Je,render:({field:t,fieldState:p})=>{let x=to(t.value);return i?jsx(qe,{menuSearchable:r,inMenuSearchContextValue:Qe,searchableAutocompletePopperFlags:eo,optionsWithClearFilterOnly:T,autocompleteFilterOptions:Ze,slotProps:ro,autocompleteRest:ao,inputRef:Ye,showClearIcon:s,ClearIconComponent:u,menuHasLoadingText:V,menuLoadingText:Z,menuNoOptionsText:le,isLoading:I,disabled:pe,label:ie,placeholder:ce,required:se,valueOnly:L,getOptionId:$,scheduleSearchNotification:Xe,setSearchableInputValue:he,renderAutocompleteOption:no,onClear:h,onChange:oe,feedback:a$2,helperText:n,field:t,fieldState:p,internalValue:x,getOptionLabel:d,isOptionEqualToValue:M}):jsx(a$1,{...ue,...t,label:ie,placeholder:ce,required:se,disabled:pe,isLoading:I,value:x,menuHasSelectedCheckMark:l,showClearIcon:s,ClearIconComponent:u,onClear:h,options:v,getOptionValue:g,getOptionLabel:d,renderOption:y,isOptionEqualToValue:M,hasError:!!p.error,helperText:n??p.error?.message,feedback:a$2,onChange:C=>{t.onChange(L?$(C):C),oe?.(C);},MenuProps:oo,children:r?jsx(De,{menuSearchPlaceholder:m,searchValue:b,onSearchChange:me,isLoading:I,menuHasNoOptionsText:ee,menuNoOptionsText:le,optionsWithoutEmptyValue:v,getOptionValue:g,getOptionLabel:d,renderOption:y,isOptionEqualToValue:M,menuHasSelectedCheckMark:l,valueOnly:L,getOptionId:$,field:t,onChange:oe}):void 0})}})}Ge.displayName="RHFSelect";var Ke=mo.memo(Ge);var Tt=Ke;export{Tt as a};
|
|
8
|
+
`,Te=styled(Pe)({width:12,height:12,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:"100%",height:"100%",display:"block"},animation:`${so} 2s linear infinite`}),j=styled(Pe)(({theme:e})=>({position:"relative",width:11,height:11,transform:"rotate(0deg)",color:e.palette.common.black,"& svg":{width:"100%",height:"100%",display:"block"}})),ke=styled(b)({paddingTop:"8px"}),te=styled("ul")({listStyle:"none",margin:0,padding:0}),Ae=styled(Ie)(({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"}})),we=styled(Ie,{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})),G=styled("span")({flex:1,minWidth:0}),K=styled("img")({width:10,height:7.5,flexShrink:0}),ve=styled("li",{shouldForwardProp:e=>!["$selected","$optionDisabled"].includes(String(e))})(({theme:e,$selected:o,$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:o?e.palette.action.hover:e.palette.common.white,"&.Mui-focused":{backgroundColor:e.palette.action.hover},...n&&{opacity:.38,pointerEvents:"none"}})),ne=styled("span")({fontSize:"10px",fontWeight:500,color:"#8D8D94"}),Ne=styled(io,{shouldForwardProp:e=>!["feedbackType","hasFeedback","hasLabel"].includes(e)})(({theme:e,error:o,feedbackType:n,hasFeedback:a,hasLabel:r})=>{let{borderColor:s}=n?aa(e,n):{borderColor:void 0},u=a?"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:u,backgroundColor:e.palette.grey[400],paddingTop:r?"11px":"0px",paddingBottom:r?"4px":"0px",paddingLeft:"8px",boxSizing:"border-box",display:"inline-flex",alignItems:r?"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:r?"flex-end":"center",alignSelf:r?"flex-end":"center",fontSize:"11px",lineHeight:"11px",color:e.palette.common.black,paddingBottom:r?"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&&s&&{"& .MuiFilledInput-root":{border:`1px solid ${s}`}},...a&&{"& .MuiFilledInput-root":{borderBottom:"none",borderBottomLeftRadius:0,borderBottomRightRadius:0}},...o&&{"& .MuiFilledInput-root":{border:`1px solid ${e.palette.error.main}`}}}}),Oe=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"}),Ee=styled(lo,{shouldForwardProp:e=>!["$menuHasLoadingText","$suppressAutocompleteNoOptions","$suppressEmptyMenuSurface"].includes(e)})(({theme:e,$menuHasLoadingText:o,$suppressAutocompleteNoOptions:n,$suppressEmptyMenuSurface:a})=>({"& .MuiPaper-root":a?{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,...a?{maxHeight:0,minHeight:0,overflow:"hidden"}:{maxHeight:320}},"& .MuiAutocomplete-noOptions":n?{display:"none !important"}:Oe(e),"& .MuiAutocomplete-loading":{...Oe(e),...!o&&{display:"none"}}}));function Y({placeholder:e,value:o,onValueChange:n,isLoading:a}){let r=Bc(useId(),"form-select-menu-search-input"),s=useCallback(u=>{u.stopPropagation();},[]);return jsx(k,{id:r,"data-testid":"FormSelectMenuSearchInput",placeholder:e,value:o,onChange:u=>n(u.target.value),onKeyDown:s,onKeyUp:s,onMouseDown:s,onClick:s,disableUnderline:true,fullWidth:true,inputProps:{"aria-label":e},endAdornment:a?jsx(Te,{"aria-hidden":true,children:jsx(b$1,{})}):jsx(j,{"aria-hidden":true,children:jsx(a$3,{})})})}var J=jsx(ne,{children:"No results found"}),He=jsx(ne,{children:"Loading\u2026"});function Q(e,o,n){return o?o(e):n?n(e):e?.label}function re(e,o,n){let a=o.toLowerCase().trim(),r=(n?n(e):e?.label)??"";return String(r).toLowerCase().includes(a)}function Ve(e){return e}function Be(e){let o=mo.forwardRef(function(a,r){let{children:s,className:u,...h}=a,m=e.current;return m?jsxs(Fragment,{children:[jsx(ke,{disableSticky:true,children:jsx(Y,{placeholder:m.menuSearchPlaceholder,value:m.searchValue,onValueChange:m.setSearchValue,isLoading:m.isLoading})}),jsx(te,{ref:r,className:u,...h,children:s})]}):jsx(te,{ref:r,className:u,...h,children:s})});return o.displayName="FormSelectMenuSearchListbox",o}function De({menuSearchPlaceholder:e,searchValue:o,onSearchChange:n,isLoading:a,menuHasNoOptionsText:r,menuNoOptionsText:s,optionsWithoutEmptyValue:u,getOptionValue:h,getOptionLabel:m,renderOption:g,isOptionEqualToValue:d,menuHasSelectedCheckMark:y,valueOnly:M,getOptionId:O,field:P,onChange:L}){return jsxs(Fragment,{children:[jsx(b,{disableSticky:true,onMouseDown:l=>l.stopPropagation(),onClick:l=>l.stopPropagation(),children:jsx(Y,{placeholder:e,value:o,onValueChange:n,isLoading:a})}),r&&o.trim()&&u.length===0?jsx(Ae,{disabled:true,value:"__form_select_no_results__",children:s??J}):u.map((l,i)=>{let c=d?d(l,P.value):l?.id===P.value?.id,f=Q(l,g,m);return jsxs(we,{disabled:!!l.disabled,$selected:c,value:(h?h(l):l?.id)??"",onClick:()=>{P.onChange(M?O(l):l),L?.(l);},children:[jsx(G,{children:f}),y&&c?jsx(K,{src:Qc,alt:""}):null]},`form-select-item-${i}-${(h?h(l):l?.id)??""}`)})]})}var X={menuHasLoadingText:false,suppressAutocompleteNoOptions:false,suppressEmptyMenuSurface:false};function bo(e,o){e!=null&&(typeof e=="function"?e(o):e.current=o);}function Fo(...e){return o=>{for(let n of e)bo(n,o);}}function xo(e){let o=n=>{let a=e.current;return jsx(Ee,{...n,$menuHasLoadingText:a.menuHasLoadingText,$suppressAutocompleteNoOptions:a.suppressAutocompleteNoOptions,$suppressEmptyMenuSurface:a.suppressEmptyMenuSurface})};return o.displayName="FormSelectSearchableAutocompletePopper",o}function qe(e$1){let o=Bc(useId(),"form-select-searchable-field"),n=useRef(null),a$1=useRef(X);n.current=e$1.menuSearchable?{searchValue:e$1.inMenuSearchContextValue.searchValue,setSearchValue:e$1.inMenuSearchContextValue.setSearchValue,menuSearchPlaceholder:e$1.inMenuSearchContextValue.menuSearchPlaceholder,isLoading:e$1.inMenuSearchContextValue.isLoading}:null,a$1.current=e$1.searchableAutocompletePopperFlags;let r=useMemo(()=>Be(n),[]),s=useMemo(()=>xo(a$1),[]),u=e$1.feedback,{isProvided:h,isVisible:m,type:g$1}=Dc(u),d=!!e$1.fieldState.error&&!m,y=e$1.helperText??e$1.fieldState.error?.message,M=e$1.internalValue!=null&&e$1.internalValue!==""&&typeof e$1.internalValue=="object"?e$1.internalValue:null,O=e$1.getOptionLabel??(i=>String(i?.label??"")),P=e$1.isOptionEqualToValue??((i,c)=>i&&c?i.id===c.id:i===c),L=e$1.ClearIconComponent??a,l=e$1.label!=null&&e$1.label!=="";return jsxs(g,{id:o,"data-testid":"FormSelectSearchableField",children:[jsx(a$2,{...e$1.autocompleteRest,disableClearable:!e$1.showClearIcon,clearIcon:jsx(L,{sx:{fontSize:8,width:8,height:8}}),ListboxComponent:e$1.menuSearchable?r:void 0,PopperComponent:s,options:e$1.optionsWithClearFilterOnly,value:M,onChange:(i,c,f)=>{if(c==null&&e$1.onClear&&f==="clear"){e$1.onClear();return}if(e$1.valueOnly){let F=c==null?null:e$1.getOptionId(c);e$1.field.onChange(F);}else e$1.field.onChange(c);e$1.onChange?.(c);},onInputChange:(i,c,f)=>{e$1.setSearchableInputValue(c),(f==="input"||f==="clear")&&e$1.scheduleSearchNotification(c);},slotProps:e$1.slotProps??{},filterOptions:e$1.menuSearchable?e$1.autocompleteFilterOptions:Ve,loading:!!e$1.isLoading,disabled:!!e$1.disabled,getOptionLabel:O,getOptionDisabled:i=>!!i.disabled,isOptionEqualToValue:P,renderOption:e$1.renderAutocompleteOption,noOptionsText:e$1.menuNoOptionsText??J,loadingText:e$1.menuHasLoadingText?e$1.menuLoadingText??He:null,popupIcon:jsx(j,{children:jsx(a$3,{})}),renderInput:i=>{let{inputProps:c,...f}=i,{ref:F,...Z}=c;return jsx(Ne,{...f,variant:"filled",label:e$1.label,placeholder:e$1.placeholder,required:e$1.required,error:d,helperText:null,feedbackType:g$1,hasFeedback:m,hasLabel:l,inputRef:Fo(F,e$1.field.ref,e$1.inputRef),InputProps:{...i.InputProps,disableUnderline:true},inputProps:{...Z,name:e$1.field.name,onBlur:e$1.field.onBlur}})}}),h?jsx(ba,{...u}):jsx(e,{children:y})]})}function Ge(e){let{name:o,helperText:n,feedback:a$2,menuSearchable:r=false,showClearIcon:s=false,ClearIconComponent:u=a,onClear:h,menuSearchPlaceholder:m="Search",getOptionValue:g,getOptionLabel:d,renderOption:y,isOptionEqualToValue:M,options:O,MenuProps:P,valueOnly:L=false,menuHasSelectedCheckMark:l=false,searchable:i=false,onSearchInputChange:c,searchDebounceMs:f=300,minSearchLength:F,menuLoadingText:Z,menuHasLoadingText:V=false,menuHasNoOptionsText:ee=true,menuNoOptionsText:le,label:ie,placeholder:ce,required:se,disabled:pe,isLoading:I,inputRef:Ye,onChange:oe,...ue}=e,{control:Je}=useFormContext(),[b,me]=useState(""),[de,he]=useState("");useEffect(()=>{i||he("");},[i]);let Qe=useMemo(()=>({searchValue:b,setSearchValue:me,menuSearchPlaceholder:m,isLoading:!!I}),[b,m,I]),w=useRef(void 0),B=useRef(c);B.current=c,useEffect(()=>()=>{w.current&&clearTimeout(w.current);},[]);let Xe=useCallback(t=>{if(!B.current)return;let p=t.trim();w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{if(p===""){B.current?.("");return}F!=null&&p.length<F||B.current?.(p);},f);},[f,F]),T=useMemo(()=>{let t=O??[];return !s||!g?t:t.filter(p=>{let x=g(p);return x!=null&&x!==""})},[s,g,O]),Se=useMemo(()=>!r||!b.trim()?T:T.filter(t=>re(t,b,d)),[r,b,T,d]),v=useMemo(()=>r?Se:T,[r,Se,T]),Ze=useCallback(t=>!r||!b.trim()?t:t.filter(p=>re(p,b,d)),[r,b,d]),eo=useMemo(()=>{if(!i)return X;let t=de.trim(),p=t.length===0||F!=null&&t.length>0&&t.length<F,x=r&&!!b.trim()&&v.length===0,C=p&&!x||!ee,D=v.length>0;return {menuHasLoadingText:V,suppressAutocompleteNoOptions:C,suppressEmptyMenuSurface:!D&&!(!C&&!D)&&!!!(I&&V)}},[i,de,F,r,b,v,ee,I,V]),oo={...P,autoFocus:false,disableEnforceFocus:true},$=t=>(g?g(t):t?.id)??"",to=t=>!L||!t?t:O?.find(p=>$(p)===t)??t,no=useCallback((t,p,x)=>{let C=Q(p,y,d),D=!!p.disabled;return jsxs(ve,{...t,$selected:x.selected,$optionDisabled:D,children:[jsx(G,{children:C}),l&&x.selected?jsx(K,{src:Qc,alt:""}):null]})},[d,y,l]),ge={...ue};for(let t of ["IconComponent","startComponent"])delete ge[t];let{slotProps:ro={},...ao}=ge;return jsx(Controller,{name:o,control:Je,render:({field:t,fieldState:p})=>{let x=to(t.value);return i?jsx(qe,{menuSearchable:r,inMenuSearchContextValue:Qe,searchableAutocompletePopperFlags:eo,optionsWithClearFilterOnly:T,autocompleteFilterOptions:Ze,slotProps:ro,autocompleteRest:ao,inputRef:Ye,showClearIcon:s,ClearIconComponent:u,menuHasLoadingText:V,menuLoadingText:Z,menuNoOptionsText:le,isLoading:I,disabled:pe,label:ie,placeholder:ce,required:se,valueOnly:L,getOptionId:$,scheduleSearchNotification:Xe,setSearchableInputValue:he,renderAutocompleteOption:no,onClear:h,onChange:oe,feedback:a$2,helperText:n,field:t,fieldState:p,internalValue:x,getOptionLabel:d,isOptionEqualToValue:M}):jsx(a$1,{...ue,...t,label:ie,placeholder:ce,required:se,disabled:pe,isLoading:I,value:x,menuHasSelectedCheckMark:l,showClearIcon:s,ClearIconComponent:u,onClear:h,options:v,getOptionValue:g,getOptionLabel:d,renderOption:y,isOptionEqualToValue:M,hasError:!!p.error,helperText:n??p.error?.message,feedback:a$2,onChange:C=>{t.onChange(L?$(C):C),oe?.(C);},MenuProps:oo,children:r?jsx(De,{menuSearchPlaceholder:m,searchValue:b,onSearchChange:me,isLoading:I,menuHasNoOptionsText:ee,menuNoOptionsText:le,optionsWithoutEmptyValue:v,getOptionValue:g,getOptionLabel:d,renderOption:y,isOptionEqualToValue:M,menuHasSelectedCheckMark:l,valueOnly:L,getOptionId:$,field:t,onChange:oe}):void 0})}})}Ge.displayName="RHFSelect";var Ke=mo.memo(Ge);var Tt=Ke;export{Tt as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {nc}from'./chunk-
|
|
1
|
+
import {nc}from'./chunk-BYJ7JVY3.js';import {forwardRef,memo}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {styled}from'@mui/material/styles';var o="os-shared-MaskedText",t={root:`${o}-root`,start:`${o}-start`,mask:`${o}-mask`,end:`${o}-end`};var p=()=>jsxs("svg",{width:"16",height:"8",viewBox:"0 0 16 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,children:[jsx("circle",{cx:"3",cy:"4",r:"1.5",fill:"currentColor"}),jsx("circle",{cx:"8",cy:"4",r:"1.5",fill:"currentColor"}),jsx("circle",{cx:"13",cy:"4",r:"1.5",fill:"currentColor"})]});var k=styled("span")(({theme:e})=>({display:"inline-flex",alignItems:"center",gap:e.v2.spacing(2),minWidth:0,color:"inherit",font:"inherit",lineHeight:1,whiteSpace:"nowrap"})),m=styled("span")({minWidth:0}),c=styled("span")({display:"inline-flex",alignItems:"center",flexShrink:0,lineHeight:0,"& svg":{display:"block",width:16,height:8}});function M(e,d,n){let s=Math.max(0,d),a=Math.max(0,n);return !e||s+a>=e.length?{start:e,end:"",isMasked:false}:{start:e.slice(0,s),end:e.slice(e.length-a),isMasked:true}}var T=forwardRef(({className:e,sx:d,text:n,startLength:s=8,endLength:a=4,separator:y,id:h,...g},S)=>{let{start:C,end:N,isMasked:u}=M(n,s,a);return jsxs(k,{ref:S,id:h??"MaskedText",className:nc(t.root,e),sx:d,"data-testid":"MaskedText",...g,children:[jsx(m,{className:t.start,children:C}),u&&jsxs(Fragment,{children:[jsx(c,{className:t.mask,children:y??jsx(p,{})}),jsx(m,{className:t.end,children:N})]})]})});T.displayName="MaskedText";var P=memo(T);
|
|
2
2
|
export{t as a,P as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j,d,n}from'./chunk-
|
|
1
|
+
import {j,d,n}from'./chunk-AJJSWLJL.js';import {Wb,nc}from'./chunk-BYJ7JVY3.js';import {Cj,Jj,Pe}from'./chunk-4FJ26UVI.js';import {forwardRef,useState,useCallback,useImperativeHandle,useEffect,useMemo,memo}from'react';import {useDropzone}from'react-dropzone';import {styled,alpha}from'@mui/material/styles';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var i="os-shared-FileDropbox",e={root:`${i}-root`,header:`${i}-header`,title:`${i}-title`,format:`${i}-format`,zone:`${i}-zone`,content:`${i}-content`,textWrapper:`${i}-textWrapper`,maximum:`${i}-maximum`,upload:`${i}-upload`,uploadAgain:`${i}-uploadAgain`};var y=styled("div")(({theme:o})=>({textAlign:"center",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:o.v2.spacing(32)})),f=styled("div")(()=>({paddingInline:"40px"})),s=styled(j,{shouldForwardProp:o=>o!=="$isError"})(({theme:o,$isError:l})=>{let{base:n,error:b}=o.v2.palette;return {color:l?b[500]:n.black,fontSize:"18px",fontWeight:600,lineHeight:"20px",marginBottom:o.v2.spacing(8)}});styled(j)(({theme:o})=>{let{base:l}=o.v2.palette;return {color:alpha(l.black,.7),fontSize:"12px",fontWeight:500,lineHeight:"20px"}});var u=styled("div",{shouldForwardProp:o=>o!=="$width"})(({theme:o,$width:l})=>{let{grey:n}=o.v2.palette;return {width:l||431,minHeight:176,border:"1px dashed #DDDDDD",borderRadius:o.v2.radius(8),padding:"24px 0",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n[50]}}),g=styled("div")(({theme:o})=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:o.v2.spacing(24),color:"inherit",fontSize:"14px",lineHeight:"20px",cursor:"default"})),I=styled("div")(({theme:o})=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:o.v2.spacing(8),color:"inherit"})),w=styled("div")(({theme:o})=>{let{base:l}=o.v2.palette;return {color:alpha(l.black,.7),fontSize:"12px",fontWeight:500,lineHeight:"20px"}}),O=styled("span")(()=>({fontWeight:600,textDecorationLine:"underline",cursor:"pointer"})),Q=styled("button")(({theme:o})=>{let{base:l,grey:n}=o.v2.palette;return {color:l.black,fontSize:"12px",fontWeight:500,lineHeight:"20px",padding:"4px 12px",borderRadius:o.v2.radius(4),border:`1px solid ${n[100]}`,backgroundColor:l.white,cursor:"pointer"}});var _=forwardRef(function({accept:l,footer:n$1,options:b,isLoading:S,progress:ee,error:P,errorHint:oe,subtitle:h,isSuccess:T,action:te,title:a,width:N,progressVariant:re,className:C,sx:$,id:d$1,invalidFileTypeText:R="Invalid file type",fileTooLargePrefix:j="File is larger than",uploadingText:le="Uploading...",waitText:ae="Please wait",uploadBulkFileText:ie="Upload bulk file",uploadAgainText:pe="Upload again",clickToUploadText:ne="Click to upload",orDragAndDropText:se="or drag and drop",maximumFileSizePrefix:de="Maximum file size",supportedFormatsPrefix:A="Supported formats"},xe){let[x,M]=useState([]),{getRootProps:ce,getInputProps:me,open:D,acceptedFiles:Z,isDragReject:E,fileRejections:m}=useDropzone(b),B=useCallback(()=>{M([]);},[]);useImperativeHandle(xe,()=>({open:D,clear:B}),[D,B]),useEffect(()=>{M(Z);},[Z]);let v=Wb(b?.maxSize||0,0).toUpperCase(),c=useMemo(()=>{let be=m.length>0&&m[0].errors.some(W=>W.code==="file-invalid-type"),De=m.length>0&&m[0].errors.some(W=>W.code==="file-too-large");return E||be?R:De?`${j} ${v}`:P},[E,P,m,v,R,j]),z=useMemo(()=>x.length?jsxs(I,{className:e.textWrapper,children:[jsx("span",{children:x[0].name}),jsx(w,{className:e.maximum,children:Wb(x[0].size)})]}):null,[x]);return T&&x.length&&!S?jsxs(y,{id:d$1,"data-testid":d$1??"FileDropbox",className:nc(e.root,C),sx:$,children:[jsxs(f,{className:e.header,children:[typeof a=="string"?jsx(s,{className:e.title,children:a}):a??jsx(s,{className:e.title,children:"File uploaded"}),h]}),jsx(u,{className:e.zone,$width:N,children:jsxs(g,{"data-slot":"content",className:e.content,children:[T&&jsx(d,{src:Cj,alt:"Upload complete",sx:{width:56,height:56}}),z]})}),n$1]}):S&&x.length?jsxs(y,{id:d$1,"data-testid":d$1??"FileDropbox",className:nc(e.root,C),sx:$,children:[jsxs(f,{className:e.header,children:[a&&typeof a!="string"?a:jsxs(Fragment,{children:[jsx(s,{className:e.title,children:typeof a=="string"?a:le}),jsx("span",{className:e.format,children:ae})]}),h]}),jsx(u,{className:e.zone,$width:N,children:jsxs(g,{"data-slot":"content",className:e.content,children:[S&&jsx(n,{size:56,value:ee,variant:re??"determinate"}),z]})}),n$1]}):jsxs(y,{id:d$1,"data-testid":d$1??"FileDropbox",className:nc(e.root,C),sx:$,children:[jsxs(f,{className:e.header,children:[c?jsx(s,{$isError:true,className:e.title,children:c}):typeof a=="string"?jsx(s,{className:e.title,children:a}):a??jsx(s,{className:e.title,children:ie}),h||!!c&&jsx("span",{className:e.format,children:`${A}: xls, xlsx`})]}),jsxs(u,{className:e.zone,$width:N,...ce(),children:[jsx("input",{...me()}),jsxs(g,{"data-slot":"content",className:e.content,children:[jsx(d,{src:c?Jj:Pe,alt:c?"Upload error":"Upload file",sx:{width:56,height:56}}),oe,z,te??jsx(Fragment,{children:c?jsx(Q,{type:"button",className:e.uploadAgain,onClick:D,children:pe}):jsxs(I,{className:e.textWrapper,children:[jsxs("span",{children:[jsx(O,{className:e.upload,onClick:D,children:ne})," ",se]}),jsxs(w,{className:e.maximum,children:[de," ",v]}),l&&jsxs("span",{className:e.format,children:[A," ",l]})]})})]})]}),n$1]})});_.displayName="FileDropbox";var L=memo(_);export{e as a,L as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c,d}from'./chunk-BA5OFEBT.js';import {a,c as c$1,d as d$1}from'./chunk-CTGKNHG3.js';import {b,a as a$1}from'./chunk-QWWU4QAA.js';import {Bc,xa}from'./chunk-L7L22FDR.js';import {Gf}from'./chunk-GCJPCGH3.js';import {createContext,memo,useRef,useId,useContext,useMemo,useState,useLayoutEffect,useCallback}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {createPortal}from'react-dom';import {styled,Box,Button,alpha,Dialog}from'@mui/material';import dt from'@mui/material/Box';import {Resizable}from're-resizable';import lt from'react-draggable';import {motion}from'framer-motion';var Z=createContext({viewerDefaultWidth:555,viewerDefaultHeight:545,position:{x:0,y:0},setPosition:()=>{},dimensions:{width:0,height:0},windowZIndex:1e4,isOpen:true,setIsMaximized:()=>{},setIsSidebarExpanded:()=>{},setIsToolbarAnimationDisabled:()=>{},setIsResized:()=>{},setNewDimensions:()=>{},isMaximized:false,isToolbarAnimationDisabled:true,isSidebarExpanded:false,isResized:false,onClose:()=>{},fullWindowWidth:0,fullWindowHeight:0,viewportWidth:0,viewportHeight:0,resizableRef:{current:null},updateRefSize:()=>{},updateSize:()=>{},containerRef:{current:null}});var he=(e,t)=>t.toLowerCase().includes(e);function we(e,t,i){let r=he("top",t),n=he("left",t);return !r&&!n?null:{x:n?e.x+i.width:e.x,y:r?e.y-i.height:e.y}}var be=e=>{let{viewportWidth:t,viewportHeight:i,viewerDefaultWidth:r,viewerDefaultHeight:n,initialPosition:p,isMaximized:l,containerRef:a}=e,s=!l&&a?.current&&a.current!==document.body?a.current:null,d=s?.getBoundingClientRect(),u=d?.left??0,f=d?.top??0,m=s?.clientWidth||t,c=p?.x??t/2-r/2,o=p?.y??i/2-n/2;return {x:m-(c-u),y:o-f}};var Ve=555,je=545;function oe({children:e,isOpen:t,onClose:i,defaultWindowHeight:r,defaultWindowWidth:n,initialPosition:p,minWidth:l,maxWidth:a,minHeight:s,maxHeight:d,containerRef:u,windowZIndex:f=1}){let {height:m,width:c}=a$1(),[o,M]=useState(false),_=o?null:u?.current,y=_?.clientWidth||c,b=_?.clientHeight||m,v=n||Ve,g=r||je;useRef(false);let [k,A]=useState(()=>be({viewportWidth:c,viewportHeight:m,viewerDefaultWidth:v,viewerDefaultHeight:g,initialPosition:p,isMaximized:o,containerRef:u})),[B,N]=useState(false),[O,T]=useState(false),[S,E]=useState(true),x=useRef(),[L,D]=useState({width:n??0,height:r??0}),F=useCallback(W=>{x?.current?.updateSize(W);},[]),G=useCallback(W=>{x.current?.updateSize(W),D(P=>({width:W.width??P.width,height:W.height??P.height}));},[]),te=useMemo(()=>({position:k,setPosition:A,resizableRef:x,windowZIndex:f,isOpen:t,setIsMaximized:M,setIsSidebarExpanded:E,setIsToolbarAnimationDisabled:T,setIsResized:N,isMaximized:o,isToolbarAnimationDisabled:O,isSidebarExpanded:S,isResized:B,dimensions:L,setNewDimensions:D,viewerDefaultWidth:v,viewerDefaultHeight:g,onClose:i,fullWindowWidth:y,fullWindowHeight:b,viewportWidth:c,viewportHeight:m,updateRefSize:F,updateSize:G,minWidth:l,maxWidth:a,minHeight:s,maxHeight:d,containerRef:u}),[k,A,x,t,M,E,T,N,o,O,S,B,L,D,y,b,c,m,v,g,F,G,i,l,a,s,d,u,f]);return jsx(Z.Provider,{value:te,children:e})}var $=35;function Ke({title:e,onClose:t,onMaximize:i,maximized:r=false,id:n,onRequestClick:p,isSidebarExpanded:l=false,isHovered:a$1=false,onMouseHover:s,onMouseLeave:d$2,showSectionsButton:u,rightActions:f,icon:m}){return jsx(c,{id:n,"data-testid":"UserTitleBar",maximized:r||false,children:jsx(d,{onMouseEnter:s,onMouseLeave:d$2,isMaximized:r,isHovered:a$1,title:e,icon:m||Gf,leftActions:jsxs(Fragment,{children:[jsx(a,{onClick:t},"window-close"),jsx(c$1,{isMaximized:r,onClick:i},"window-maximize"),u&&jsx(d$1,{onClick:p,isExpanded:!l,isHovered:a$1,children:"Sidebar"},"window-sections")]}),rightActions:f})})}var ye=memo(Ke);var ie=ye;function Qe({isMaximized:e,setIsToolbarAnimationDisabled:t,setIsMaximized:i,onClose:r,isSidebarExpanded:n,setIsSidebarExpanded:p,isToolbarAnimationDisabled:l,title:a,showSectionsButton:s,rightActions:d,icon:u}){let{isHovered:f,onMouseEnter:m,onMouseLeave:c}=b();return jsx(motion.div,{style:{...e&&{height:0,zIndex:1e3,position:"relative"}},animate:{...e&&{width:"100vw"},...!e&&{transform:"translateX(0px)",width:"100%"}},transition:{duration:.5,...l&&{duration:0}},children:jsx(ie,{title:a||"Users",showSectionsButton:s,onClose:r,onMaximize:()=>{i?.(o=>!o),t?.(true),setTimeout(()=>{t?.(false);},.5*1e3);},maximized:e,id:"draggable-dialog-title",onRequestClick:()=>{t?.(false),p(!n);},isSidebarExpanded:n,isHovered:f,onMouseHover:m,onMouseLeave:c,rightActions:d,icon:u})})}var Te=memo(Qe);var Se=Te;function ut({children:e,titleBar:t,titleBarText:i,mainAppOrder:r,mainAppIsMinimized:n,showSectionsButton:p=true,rightActions:l,titleBarIcon:a,overflow:s="hidden"}){let d=useRef(null),u=Bc(useId(),"app-window"),{dimensions:f,position:m,resizableRef:c,isMaximized:o,isOpen:M,onClose:_,viewerDefaultWidth:y,viewerDefaultHeight:b,windowZIndex:v,setPosition:g,setNewDimensions:ee,isToolbarAnimationDisabled:k,fullWindowWidth:A,fullWindowHeight:B,viewportWidth:N,viewportHeight:O,setIsMaximized:T,setIsResized:S,isResized:E,setIsToolbarAnimationDisabled:x,setIsSidebarExpanded:L,isSidebarExpanded:D,minWidth:F,maxWidth:G,minHeight:te,maxHeight:W,containerRef:P}=useContext(Z),h=useMemo(()=>document.createElement("div"),[]),[Be,Ne]=useState(null);useLayoutEffect(()=>{Ne(P?.current??document.body);},[P]);let w=o?document.body:Be;useLayoutEffect(()=>{if(!w)return;let H=w===document.body;return h.style.position=H?"":"absolute",h.style.inset=H?"":"0",h.style.pointerEvents="none",h.style.overflow="visible",w.appendChild(h),()=>{h.parentNode===w&&w.removeChild(h);}},[w,h]);let se=useRef({x:0,y:0}),de=xa(),Oe=useCallback((H,V,pe,Fe)=>{S(true),ee({width:pe.offsetWidth,height:pe.offsetHeight});let le=we(se.current,V,Fe);le&&g(le);},[ee,S,g]),U=f.width||y;if(!w)return null;let Le=jsx(lt,{nodeRef:d,disabled:o,handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]',defaultClassName:"draggable-lead-dialog",defaultPosition:{x:A/2-U/2,y:B/2-b/2},position:{x:A-m.x,y:m.y},onStop:(H,V)=>{g({x:A-V.x,y:V.y});},...w===document.body&&{bounds:{top:10}},children:jsx(Dialog,{ref:d,sx:{backgroundColor:"transparent",pointerEvents:"none",zIndex:Number(r||0)+v+(o?1:0),...n&&{display:"none"},...w===document.body?!o&&{transform:"translate(180px, 14px)"}:!o&&{position:"absolute"},...!o&&{width:de?U:"fit-content",height:de?b:"fit-content"},...o&&{transform:"none !important"},boxShadow:"0px 0px 20px 0px rgba(0, 0, 0, 0.15)",overflow:"visible","& .MuiDialog-container":{overflow:"visible"}},PaperProps:{style:{margin:0,maxHeight:"100%",maxWidth:"none",background:"transparent",pointerEvents:"auto",overflow:s,width:E?"fit-content":U,height:E?"fit-content":"100%",...o&&{width:"100%",height:"100%"},position:"relative"}},onClose:()=>{T(false),x(true),setTimeout(()=>{x(false);},.5*1e3);},open:M,hideBackdrop:true,disableEnforceFocus:true,disableScrollLock:true,container:h,fullScreen:o,"aria-labelledby":"draggable-dialog-title",disablePortal:true,children:jsx(Resizable,{"data-testid":"Resizable",enable:{topLeft:true,topRight:true,bottomLeft:true,bottomRight:true,left:true,right:true,bottom:true,top:true},handleStyles:{bottom:{zIndex:2},bottomLeft:{zIndex:2},bottomRight:{zIndex:2}},size:{width:f.width,height:f.height},maxHeight:W??O-40,maxWidth:G??N,minWidth:o?"100vw":F??y,minHeight:o?"100vh":te??b,ref:H=>{c.current=H;},onResizeStart:()=>{se.current=m,x(true);},onResizeStop:()=>{x(false);},onResize:Oe,defaultSize:{width:U,height:b},style:{background:"transparent",height:f.height,overflow:s,...o&&{height:"100% !important",width:"100% !important",flex:1},...o&&{position:"relative"}},children:jsxs(dt,{sx:{height:"100%"},id:u,"data-testid":"AppWindow",children:[t??jsx(Se,{setIsToolbarAnimationDisabled:x,onClose:_,setIsMaximized:T,isToolbarAnimationDisabled:k,setIsSidebarExpanded:L,isSidebarExpanded:D,title:i,isMaximized:o,showSectionsButton:p,rightActions:l,icon:a}),e]})})})});return createPortal(Le,h)}var Pe=memo(ut);var ct=styled(Box,{shouldForwardProp:e=>e!=="isActive"})(({theme:e,isActive:t})=>({background:t?"linear-gradient(270deg, #147DC5 0.67%, #3DA6E1 98.91%)":"transparent",borderRadius:"4px",padding:"4px 8px",color:t?e.palette.common.white:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px",cursor:"pointer"})),xt=styled(Button)(({theme:e,disabled:t})=>({background:t?alpha(e.palette.info.dark,.4):e.palette.info.dark,color:e.palette.common.white,padding:"0px 8px",fontSize:"9px",fontWeight:600,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",textTransform:"none","&:hover":{background:e.palette.info.dark,opacity:.8},"&.Mui-disabled":{color:e.palette.common.white}})),ht=styled(Box)(({theme:e})=>({display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px",backgroundColor:e.palette.background.paper,padding:"6px",transform:"translateY(calc(-50% - 6px))",boxShadow:"0px 4px 40px 0px rgba(0, 0, 0, 0.19)",borderRadius:"4px",height:"36px",transition:e.transitions.create(["width"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.complex})})),wt=styled(Box)(()=>({position:"fixed",height:$,bottom:0,left:0,right:0,padding:"6px 16px",zIndex:1,backgroundColor:"#eaeaea",backdropFilter:"blur(12px)",display:"flex",justifyContent:"flex-end",borderBottomLeftRadius:"12px",borderBottomRightRadius:"12px"})),bt=styled(Button)(()=>({padding:"4px 8px",boxShadow:"0px 0px 4px 0px rgba(0, 0, 0, 0.08)",display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"4px",color:"rgba(32, 35, 43, 0.80)",fontWeight:600,fontSize:"9px",textTransform:"none"}));var ne=Pe;function gt({children:e,windowProps:t,...i}){return i.isOpen?jsx(oe,{...i,children:jsx(ne,{...t,children:e})}):null}var Me=gt;function It({title:e,maximized:t=false,id:i,isHovered:r=false,onMouseHover:n,onMouseLeave:p,leftActions:l,titleIconSrc:a,sx:s,...d$1}){return jsx(c,{className:"header-wrapper",id:i,maximized:t||false,sx:s,...d$1,children:jsx(d,{onMouseEnter:n,onMouseLeave:p,isMaximized:t,isHovered:r,title:e||"",icon:a,leftActions:l})})}var ae=memo(It);function Rt({isMaximized:e,id:t,isToolbarAnimationDisabled:i,title:r,leftActions:n,onClose:p,onMaximize:l,sx:a$1}){let{isHovered:s,onMouseEnter:d,onMouseLeave:u}=b();return jsx(motion.div,{style:{...e&&{height:0,zIndex:1e3,position:"relative"}},animate:{...e&&{width:"100vw"},...!e&&{transform:"translateX(0px)",width:"100%"}},transition:{duration:.5,...i&&{duration:0}},children:jsx(ae,{title:r,maximized:e,id:t||"draggable-dialog-title",isHovered:s,onMouseHover:d,onMouseLeave:u,leftActions:n||jsxs(Fragment,{children:[jsx(a,{onClick:p}),jsx(c$1,{isMaximized:e,onClick:()=>l?.(!e)})]}),sx:a$1})})}var ke=memo(Rt);var Tt=ke;var Yo=Me;export{Z as a,oe as b,$ as c,ie as d,ct as e,xt as f,ht as g,wt as h,bt as i,ne as j,ae as k,Tt as l,Yo as m};
|
|
1
|
+
import {c,d}from'./chunk-GXUVKR7C.js';import {a,c as c$1,d as d$1}from'./chunk-Z6KCOMOK.js';import {b,a as a$1}from'./chunk-6BJANCV7.js';import {Bc,xa}from'./chunk-BYJ7JVY3.js';import {Hf}from'./chunk-4FJ26UVI.js';import {createContext,memo,useRef,useId,useContext,useMemo,useState,useLayoutEffect,useCallback}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {createPortal}from'react-dom';import {styled,Box,Button,alpha,Dialog}from'@mui/material';import dt from'@mui/material/Box';import {Resizable}from're-resizable';import lt from'react-draggable';import {motion}from'framer-motion';var Z=createContext({viewerDefaultWidth:555,viewerDefaultHeight:545,position:{x:0,y:0},setPosition:()=>{},dimensions:{width:0,height:0},windowZIndex:1e4,isOpen:true,setIsMaximized:()=>{},setIsSidebarExpanded:()=>{},setIsToolbarAnimationDisabled:()=>{},setIsResized:()=>{},setNewDimensions:()=>{},isMaximized:false,isToolbarAnimationDisabled:true,isSidebarExpanded:false,isResized:false,onClose:()=>{},fullWindowWidth:0,fullWindowHeight:0,viewportWidth:0,viewportHeight:0,resizableRef:{current:null},updateRefSize:()=>{},updateSize:()=>{},containerRef:{current:null}});var he=(e,t)=>t.toLowerCase().includes(e);function we(e,t,i){let r=he("top",t),n=he("left",t);return !r&&!n?null:{x:n?e.x+i.width:e.x,y:r?e.y-i.height:e.y}}var be=e=>{let{viewportWidth:t,viewportHeight:i,viewerDefaultWidth:r,viewerDefaultHeight:n,initialPosition:p,isMaximized:l,containerRef:a}=e,s=!l&&a?.current&&a.current!==document.body?a.current:null,d=s?.getBoundingClientRect(),u=d?.left??0,f=d?.top??0,m=s?.clientWidth||t,c=p?.x??t/2-r/2,o=p?.y??i/2-n/2;return {x:m-(c-u),y:o-f}};var Ve=555,je=545;function oe({children:e,isOpen:t,onClose:i,defaultWindowHeight:r,defaultWindowWidth:n,initialPosition:p,minWidth:l,maxWidth:a,minHeight:s,maxHeight:d,containerRef:u,windowZIndex:f=1}){let {height:m,width:c}=a$1(),[o,M]=useState(false),_=o?null:u?.current,y=_?.clientWidth||c,b=_?.clientHeight||m,v=n||Ve,g=r||je;useRef(false);let [k,A]=useState(()=>be({viewportWidth:c,viewportHeight:m,viewerDefaultWidth:v,viewerDefaultHeight:g,initialPosition:p,isMaximized:o,containerRef:u})),[B,N]=useState(false),[O,T]=useState(false),[S,E]=useState(true),x=useRef(),[L,D]=useState({width:n??0,height:r??0}),F=useCallback(W=>{x?.current?.updateSize(W);},[]),G=useCallback(W=>{x.current?.updateSize(W),D(P=>({width:W.width??P.width,height:W.height??P.height}));},[]),te=useMemo(()=>({position:k,setPosition:A,resizableRef:x,windowZIndex:f,isOpen:t,setIsMaximized:M,setIsSidebarExpanded:E,setIsToolbarAnimationDisabled:T,setIsResized:N,isMaximized:o,isToolbarAnimationDisabled:O,isSidebarExpanded:S,isResized:B,dimensions:L,setNewDimensions:D,viewerDefaultWidth:v,viewerDefaultHeight:g,onClose:i,fullWindowWidth:y,fullWindowHeight:b,viewportWidth:c,viewportHeight:m,updateRefSize:F,updateSize:G,minWidth:l,maxWidth:a,minHeight:s,maxHeight:d,containerRef:u}),[k,A,x,t,M,E,T,N,o,O,S,B,L,D,y,b,c,m,v,g,F,G,i,l,a,s,d,u,f]);return jsx(Z.Provider,{value:te,children:e})}var $=35;function Ke({title:e,onClose:t,onMaximize:i,maximized:r=false,id:n,onRequestClick:p,isSidebarExpanded:l=false,isHovered:a$1=false,onMouseHover:s,onMouseLeave:d$2,showSectionsButton:u,rightActions:f,icon:m}){return jsx(c,{id:n,"data-testid":"UserTitleBar",maximized:r||false,children:jsx(d,{onMouseEnter:s,onMouseLeave:d$2,isMaximized:r,isHovered:a$1,title:e,icon:m||Hf,leftActions:jsxs(Fragment,{children:[jsx(a,{onClick:t},"window-close"),jsx(c$1,{isMaximized:r,onClick:i},"window-maximize"),u&&jsx(d$1,{onClick:p,isExpanded:!l,isHovered:a$1,children:"Sidebar"},"window-sections")]}),rightActions:f})})}var ye=memo(Ke);var ie=ye;function Qe({isMaximized:e,setIsToolbarAnimationDisabled:t,setIsMaximized:i,onClose:r,isSidebarExpanded:n,setIsSidebarExpanded:p,isToolbarAnimationDisabled:l,title:a,showSectionsButton:s,rightActions:d,icon:u}){let{isHovered:f,onMouseEnter:m,onMouseLeave:c}=b();return jsx(motion.div,{style:{...e&&{height:0,zIndex:1e3,position:"relative"}},animate:{...e&&{width:"100vw"},...!e&&{transform:"translateX(0px)",width:"100%"}},transition:{duration:.5,...l&&{duration:0}},children:jsx(ie,{title:a||"Users",showSectionsButton:s,onClose:r,onMaximize:()=>{i?.(o=>!o),t?.(true),setTimeout(()=>{t?.(false);},.5*1e3);},maximized:e,id:"draggable-dialog-title",onRequestClick:()=>{t?.(false),p(!n);},isSidebarExpanded:n,isHovered:f,onMouseHover:m,onMouseLeave:c,rightActions:d,icon:u})})}var Te=memo(Qe);var Se=Te;function ut({children:e,titleBar:t,titleBarText:i,mainAppOrder:r,mainAppIsMinimized:n,showSectionsButton:p=true,rightActions:l,titleBarIcon:a,overflow:s="hidden"}){let d=useRef(null),u=Bc(useId(),"app-window"),{dimensions:f,position:m,resizableRef:c,isMaximized:o,isOpen:M,onClose:_,viewerDefaultWidth:y,viewerDefaultHeight:b,windowZIndex:v,setPosition:g,setNewDimensions:ee,isToolbarAnimationDisabled:k,fullWindowWidth:A,fullWindowHeight:B,viewportWidth:N,viewportHeight:O,setIsMaximized:T,setIsResized:S,isResized:E,setIsToolbarAnimationDisabled:x,setIsSidebarExpanded:L,isSidebarExpanded:D,minWidth:F,maxWidth:G,minHeight:te,maxHeight:W,containerRef:P}=useContext(Z),h=useMemo(()=>document.createElement("div"),[]),[Be,Ne]=useState(null);useLayoutEffect(()=>{Ne(P?.current??document.body);},[P]);let w=o?document.body:Be;useLayoutEffect(()=>{if(!w)return;let H=w===document.body;return h.style.position=H?"":"absolute",h.style.inset=H?"":"0",h.style.pointerEvents="none",h.style.overflow="visible",w.appendChild(h),()=>{h.parentNode===w&&w.removeChild(h);}},[w,h]);let se=useRef({x:0,y:0}),de=xa(),Oe=useCallback((H,V,pe,Fe)=>{S(true),ee({width:pe.offsetWidth,height:pe.offsetHeight});let le=we(se.current,V,Fe);le&&g(le);},[ee,S,g]),U=f.width||y;if(!w)return null;let Le=jsx(lt,{nodeRef:d,disabled:o,handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]',defaultClassName:"draggable-lead-dialog",defaultPosition:{x:A/2-U/2,y:B/2-b/2},position:{x:A-m.x,y:m.y},onStop:(H,V)=>{g({x:A-V.x,y:V.y});},...w===document.body&&{bounds:{top:10}},children:jsx(Dialog,{ref:d,sx:{backgroundColor:"transparent",pointerEvents:"none",zIndex:Number(r||0)+v+(o?1:0),...n&&{display:"none"},...w===document.body?!o&&{transform:"translate(180px, 14px)"}:!o&&{position:"absolute"},...!o&&{width:de?U:"fit-content",height:de?b:"fit-content"},...o&&{transform:"none !important"},boxShadow:"0px 0px 20px 0px rgba(0, 0, 0, 0.15)",overflow:"visible","& .MuiDialog-container":{overflow:"visible"}},PaperProps:{style:{margin:0,maxHeight:"100%",maxWidth:"none",background:"transparent",pointerEvents:"auto",overflow:s,width:E?"fit-content":U,height:E?"fit-content":"100%",...o&&{width:"100%",height:"100%"},position:"relative"}},onClose:()=>{T(false),x(true),setTimeout(()=>{x(false);},.5*1e3);},open:M,hideBackdrop:true,disableEnforceFocus:true,disableScrollLock:true,container:h,fullScreen:o,"aria-labelledby":"draggable-dialog-title",disablePortal:true,children:jsx(Resizable,{"data-testid":"Resizable",enable:{topLeft:true,topRight:true,bottomLeft:true,bottomRight:true,left:true,right:true,bottom:true,top:true},handleStyles:{bottom:{zIndex:2},bottomLeft:{zIndex:2},bottomRight:{zIndex:2}},size:{width:f.width,height:f.height},maxHeight:W??O-40,maxWidth:G??N,minWidth:o?"100vw":F??y,minHeight:o?"100vh":te??b,ref:H=>{c.current=H;},onResizeStart:()=>{se.current=m,x(true);},onResizeStop:()=>{x(false);},onResize:Oe,defaultSize:{width:U,height:b},style:{background:"transparent",height:f.height,overflow:s,...o&&{height:"100% !important",width:"100% !important",flex:1},...o&&{position:"relative"}},children:jsxs(dt,{sx:{height:"100%"},id:u,"data-testid":"AppWindow",children:[t??jsx(Se,{setIsToolbarAnimationDisabled:x,onClose:_,setIsMaximized:T,isToolbarAnimationDisabled:k,setIsSidebarExpanded:L,isSidebarExpanded:D,title:i,isMaximized:o,showSectionsButton:p,rightActions:l,icon:a}),e]})})})});return createPortal(Le,h)}var Pe=memo(ut);var ct=styled(Box,{shouldForwardProp:e=>e!=="isActive"})(({theme:e,isActive:t})=>({background:t?"linear-gradient(270deg, #147DC5 0.67%, #3DA6E1 98.91%)":"transparent",borderRadius:"4px",padding:"4px 8px",color:t?e.palette.common.white:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px",cursor:"pointer"})),xt=styled(Button)(({theme:e,disabled:t})=>({background:t?alpha(e.palette.info.dark,.4):e.palette.info.dark,color:e.palette.common.white,padding:"0px 8px",fontSize:"9px",fontWeight:600,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",textTransform:"none","&:hover":{background:e.palette.info.dark,opacity:.8},"&.Mui-disabled":{color:e.palette.common.white}})),ht=styled(Box)(({theme:e})=>({display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px",backgroundColor:e.palette.background.paper,padding:"6px",transform:"translateY(calc(-50% - 6px))",boxShadow:"0px 4px 40px 0px rgba(0, 0, 0, 0.19)",borderRadius:"4px",height:"36px",transition:e.transitions.create(["width"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.complex})})),wt=styled(Box)(()=>({position:"fixed",height:$,bottom:0,left:0,right:0,padding:"6px 16px",zIndex:1,backgroundColor:"#eaeaea",backdropFilter:"blur(12px)",display:"flex",justifyContent:"flex-end",borderBottomLeftRadius:"12px",borderBottomRightRadius:"12px"})),bt=styled(Button)(()=>({padding:"4px 8px",boxShadow:"0px 0px 4px 0px rgba(0, 0, 0, 0.08)",display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"4px",color:"rgba(32, 35, 43, 0.80)",fontWeight:600,fontSize:"9px",textTransform:"none"}));var ne=Pe;function gt({children:e,windowProps:t,...i}){return i.isOpen?jsx(oe,{...i,children:jsx(ne,{...t,children:e})}):null}var Me=gt;function It({title:e,maximized:t=false,id:i,isHovered:r=false,onMouseHover:n,onMouseLeave:p,leftActions:l,titleIconSrc:a,sx:s,...d$1}){return jsx(c,{className:"header-wrapper",id:i,maximized:t||false,sx:s,...d$1,children:jsx(d,{onMouseEnter:n,onMouseLeave:p,isMaximized:t,isHovered:r,title:e||"",icon:a,leftActions:l})})}var ae=memo(It);function Rt({isMaximized:e,id:t,isToolbarAnimationDisabled:i,title:r,leftActions:n,onClose:p,onMaximize:l,sx:a$1}){let{isHovered:s,onMouseEnter:d,onMouseLeave:u}=b();return jsx(motion.div,{style:{...e&&{height:0,zIndex:1e3,position:"relative"}},animate:{...e&&{width:"100vw"},...!e&&{transform:"translateX(0px)",width:"100%"}},transition:{duration:.5,...i&&{duration:0}},children:jsx(ae,{title:r,maximized:e,id:t||"draggable-dialog-title",isHovered:s,onMouseHover:d,onMouseLeave:u,leftActions:n||jsxs(Fragment,{children:[jsx(a,{onClick:p}),jsx(c$1,{isMaximized:e,onClick:()=>l?.(!e)})]}),sx:a$1})})}var ke=memo(Rt);var Tt=ke;var Yo=Me;export{Z as a,oe as b,$ as c,ie as d,ct as e,xt as f,ht as g,wt as h,bt as i,ne as j,ae as k,Tt as l,Yo as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-ZONDSLTR.js';import {p}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-ZONDSLTR.js';import {p}from'./chunk-AJJSWLJL.js';import {Bc,f as f$1}from'./chunk-BYJ7JVY3.js';import {nb}from'./chunk-4FJ26UVI.js';import {useId}from'react';import {useTranslation}from'react-i18next';import {jsx,jsxs}from'react/jsx-runtime';var m=t=>({start:{x:t*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:t*39,transition:{duration:.3,type:"tween",ease:"easeOut"}}});var d=({children:t})=>jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"2px"},children:t});function f({value:t,index:e}){let s=Bc(useId(),"rating-count"),{t:u}=useTranslation();return jsx(p,{title:u("totalPaymentCount",{amount:f$1(t)}),wrapperProps:{display:"inline-flex"},children:jsx(a,{id:s,order:e,variants:m(e),"data-testid":"RatingCount",children:jsxs(d,{children:[jsx("img",{src:nb,alt:"star",style:{width:"10px",height:"10px"}})," ",(t||0)>1&&jsx("span",{style:{fontSize:"9.782px"},children:t})]})})})}export{f as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j,P as P$1,O,V as V$1,R as R$1,d}from'./chunk-
|
|
1
|
+
import {j,P as P$1,O,V as V$1,R as R$1,d}from'./chunk-AJJSWLJL.js';import {nc,mc}from'./chunk-BYJ7JVY3.js';import {Qc}from'./chunk-4FJ26UVI.js';import {forwardRef,useRef,useState,memo}from'react';import Te from'@mui/material/ClickAwayListener';import Le from'@mui/material/CircularProgress';import Ce from'@mui/material/SvgIcon';import {jsx,jsxs}from'react/jsx-runtime';import m from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';var i="os-shared-GroupedSelect",r={root:`${i}-root`,trigger:`${i}-trigger`,hasLabel:`${i}-hasLabel`,triggerIcon:`${i}-triggerIcon`,menu:`${i}-menu`,groups:`${i}-groups`,group:`${i}-group`,groupLabel:`${i}-groupLabel`,option:`${i}-option`,optionCheck:`${i}-optionCheck`};function P({open:e}){return jsx(Ce,{viewBox:"0 0 8 5",sx:{width:8,height:5,transform:e?"rotate(180deg)":"none",transition:"transform 0.2s ease"},children:jsx("path",{d:"M7.30273 0.117188C7.3806 0.115307 7.4565 0.138248 7.52051 0.182617C7.58455 0.227088 7.63373 0.290458 7.66211 0.363281C7.69046 0.436073 7.69761 0.516047 7.68262 0.592773C7.66777 0.668745 7.63069 0.738375 7.57715 0.793945L4.17285 4.43164C4.10255 4.50662 4.00523 4.55078 3.90234 4.55078C3.79964 4.55064 3.703 4.5065 3.63281 4.43164L0.227539 0.794922L0.228516 0.793945C0.175799 0.738766 0.139848 0.669812 0.125 0.594727C0.11011 0.519097 0.116275 0.440194 0.143555 0.368164C0.170957 0.296002 0.218752 0.232474 0.28125 0.1875C0.343758 0.14262 0.418162 0.11821 0.495117 0.118164C0.546901 0.118166 0.598306 0.12907 0.645508 0.150391C0.691832 0.171346 0.733094 0.201824 0.767578 0.239258L3.90234 3.58691L7.03711 0.239258C7.10547 0.164191 7.20108 0.119752 7.30273 0.117188Z",fill:"#20232B",stroke:"#20232B",strokeWidth:.233333})})}var W=styled(m,{shouldForwardProp:e=>e!=="open"&&e!=="disabled"})(({disabled:e})=>({display:"flex",alignItems:"center",cursor:e?"not-allowed":"pointer",position:"relative",maxWidth:"100%"})),A=styled(m,{shouldForwardProp:e=>e!=="disabled"})(({theme:e,disabled:t})=>({flex:1,minWidth:0,height:32,maxHeight:32,borderRadius:"4px",overflow:"hidden",backgroundColor:e.palette.grey[400],cursor:t?"default":"pointer",position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",padding:"0 28px 0 8px",[`&:where(.${r.hasLabel})`]:{height:40,maxHeight:40,justifyContent:"flex-end"}})),R=styled(j,{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:t})=>({fontSize:"10px",fontWeight:500,lineHeight:"10px",color:t?e.palette.text.disabled:e.palette.grey[700],whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",paddingTop:8})),B=styled(m,{shouldForwardProp:e=>e!=="$placeholder"&&e!=="$disabled"})(({theme:e,$placeholder:t,$disabled:S})=>({fontSize:"11px",lineHeight:"11px",color:S?e.palette.text.disabled:t?e.palette.text.secondary:"#000",height:22,display:"flex",alignItems:"center",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"})),D=styled(m,{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:t})=>({position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",opacity:t?e.palette.action.disabledOpacity:1})),F=styled(m)(()=>({display:"flex",flexDirection:"column",maxHeight:180,overflow:"auto",scrollbarWidth:"thin",scrollbarColor:"#E5E5E5 #E5E5E5"})),z=styled(P$1)(({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"}}}),K=styled(j)(({theme:e})=>({fontSize:"10px",color:e.v2.palette.grey[500],fontWeight:600,lineHeight:"10px"})),V=styled(V$1)(()=>({fontSize:"10px",fontWeight:500,textTransform:"none",justifyContent:"space-between",padding:"8px 20px"}));function Ee(e,t){return e?.id===t?.id}var Y=forwardRef(({id:e,label:t,placeholder:S,renderValue:Z,IconComponent:J,isLoading:Q=false,options:U,value:f,onChange:X,isOptionEqualToValue:_=Ee,renderOption:ee,renderGroupLabel:oe,open:te,onOpenChange:re,expandedGroupIndex:b,defaultExpandedGroupIndex:le=0,onExpandedGroupChange:ne,disabled:p=false,sx:ae,menuSx:ie,className:de},se)=>{let C=useRef(null),[G,pe]=useState(null),[ce,ue]=useState(le),s=te??G!==null,c=G??C.current,me=b??ce,w=useRef(void 0);s&&c&&c.clientWidth>0&&(w.current=c.clientWidth);let ge=w.current,h=(o,l)=>{pe(l),re?.(o);},Se=o=>{if(p)return;let l=!s;h(l,l?o.currentTarget:null);},$=()=>{s&&h(false,null);},fe=o=>{o.key==="Escape"&&$();},he=(o,l)=>{let a=l?o:null;b===void 0&&ue(a),ne?.(a);},ye=o=>{o.disabled||(X?.(o),h(false,null));},T=Z?.(f)??f?.label??null,L=J,E=!!t;return jsx(Te,{onClickAway:$,children:jsxs(W,{ref:se,id:e,"data-testid":"GroupedSelect",className:nc(r.root,de),sx:ae,open:s,disabled:p,onClick:Se,onKeyDown:fe,children:[jsxs(A,{ref:C,className:nc(r.trigger,E&&r.hasLabel),disabled:p,children:[E&&jsx(R,{$disabled:p,children:t}),jsx(B,{$placeholder:T==null,$disabled:p,children:T??S??""}),jsx(D,{className:r.triggerIcon,$disabled:p,children:Q?jsx(Le,{size:14,sx:{color:"text.secondary"}}):L?jsx(L,{className:nc(s&&"MuiSelect-iconOpen")}):jsx(P,{open:s})})]}),jsx(R$1,{open:s,anchorEl:c,placement:"bottom-start",className:r.menu,sx:mc({width:ge??c?.clientWidth,marginTop:"4px"},ie),children:jsx(F,{className:r.groups,onClick:o=>o.stopPropagation(),onMouseDown:o=>o.stopPropagation(),children:(U??[]).map((o,l)=>jsx(z,{className:r.group,expanded:me===l,onChange:a=>he(l,a),slotProps:{root:{square:true}},label:oe?.(o.group,l)??jsx(K,{variant:"caption",className:r.groupLabel,children:o.group}),content:(o?.options||[]).map((a,xe)=>{let be=_(a,f);return jsxs(V,{className:r.option,startAdornment:null,isDisabled:a.disabled,onClick:()=>ye(a),children:[ee?.(a)??a.label,be&&jsx(d,{src:Qc,alt:"selected",sx:{width:14,height:10},className:r.optionCheck})]},`${l}-${xe}`)})},`${l}`))})})]})})});Y.displayName="GroupedSelect";var ke=memo(Y);export{r as a,ke as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f as f$1}from'./chunk-
|
|
1
|
+
import {f as f$1}from'./chunk-U5UZTT2I.js';import {styled,Button,Box,alpha}from'@mui/material';var l=t=>({...t.typography.subtitle1,borderRadius:"50px",borderWidth:"1px",borderStyle:"solid",minWidth:"135.11px",height:"32px",display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",textTransform:"none",transition:"none",paddingInline:t.spacing(2)}),n=styled(Button,{shouldForwardProp:t=>t!=="statusVariant"})(({theme:t,statusVariant:e})=>({...l(t),...e==="active"?{background:t.palette.background.gradient.shadedBlue,color:t.palette.common.white,"&:hover":{background:t.palette.background.gradient.shadedBlue,opacity:.8}}:{backgroundColor:t.palette.common.white,borderColor:t.palette.grey[100],color:t.palette.text.primary,"&:hover":{backgroundColor:t.palette.common.white,opacity:.7}}})),u={active:n,inActive:n};styled(Box)(({theme:t,variant:e})=>({borderRadius:"50px",backgroundColor:e==="active"?alpha(t.palette.text.primary,.1):t.palette.grey[100],display:"flex",justifyContent:"center",alignItems:"center",paddingInline:t.spacing(.5),paddingBlock:t.spacing(.25),color:e==="active"?t.palette.common.white:t.palette.text.primary,fontSize:"8px",fontWeight:700,lineHeight:"10px"}));styled("img")(({theme:t,variant:e,icon:a})=>({fill:e==="active"?t.palette.common.white:t.palette.text.primary,color:e==="active"?t.palette.common.white:t.palette.text.primary,...!(["openFlag","closedFlag"].includes(a??"")&&e==="inActive")&&a!=="captured"&&{filter:e==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"},maxWidth:"14px",maxHeight:"14px"}));var m=styled("p")(({theme:t})=>({fontSize:"0.6875rem",color:t.palette.background.default,fontStyle:"normal",margin:"auto",textTransform:"capitalize"})),h=styled(f$1)(({theme:t})=>({backgroundColor:"white",boxShadow:t.shadows[21],borderRadius:"0.25rem","& .MuiPaper-root":{borderRadius:"0.25rem",width:"12.5rem"}})),y=styled("span")(()=>({width:"27px",height:"100%",maxHeight:"100%",position:"absolute",top:"0",right:"0",bottom:"0",overflow:"hidden"})),b=styled(Box)(({variant:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"0.5rem",fontWeight:t==="active"?700:400})),f=styled(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"100%"})),S=styled("img")(({theme:t,variant:e,icon:a})=>({fill:e==="active"?t.palette.common.white:t.palette.text.primary,color:e==="active"?t.palette.common.white:t.palette.text.primary,...!(["openFlag","closedFlag"].includes(a??"")&&e==="inActive")&&a!=="captured"&&{filter:e==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"},maxWidth:"14px",maxHeight:"14px"})),v=styled(Box)(({variant:t})=>({width:"14px",height:"14px",display:"flex",alignItems:"center","& img":{width:"14px",height:"14px",filter:t==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"}}));export{u as a,m as b,h as c,y as d,b as e,f,S as g,v as h};
|