@tap-payments/os-micro-frontend-shared 0.3.182-test.5 → 0.3.182-test.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +1 -1
  2. package/build/_chunks/{chunk-YGS7E2D7.js → chunk-2UVSOPTR.js} +1 -1
  3. package/build/_chunks/{chunk-HHP2SQNP.js → chunk-5QIO37S2.js} +1 -1
  4. package/build/_chunks/chunk-FOLYGHQ2.js +1 -0
  5. package/build/_chunks/chunk-LT4Z7V4F.js +1 -0
  6. package/build/_chunks/{chunk-XN47DSB4.js → chunk-OKDNE3LX.js} +1 -1
  7. package/build/_chunks/{chunk-IQ7GZOOW.js → chunk-PJ2BCCZI.js} +1 -1
  8. package/build/_chunks/{chunk-GH43NHJ2.js → chunk-PQPKKVY4.js} +1 -1
  9. package/build/_chunks/{chunk-RBVU22EH.js → chunk-RYMSLURR.js} +1 -1
  10. package/build/_chunks/chunk-WJXVFIVW.js +2 -0
  11. package/build/components/AmountConversionFilter/index.js +1 -1
  12. package/build/components/AmountInput/index.js +1 -1
  13. package/build/components/AmountSlider/index.js +1 -1
  14. package/build/components/AppServices/index.js +1 -1
  15. package/build/components/AppServicesBar/index.js +1 -1
  16. package/build/components/AppWindowWrapper/index.js +1 -1
  17. package/build/components/BrandLogo/index.js +1 -1
  18. package/build/components/ColumnViews/hooks/useViewsMenu.d.ts +2 -2
  19. package/build/components/ColumnViews/index.js +1 -1
  20. package/build/components/CountryFilter/index.js +1 -1
  21. package/build/components/CurrencyFilter/index.js +1 -1
  22. package/build/components/Customer/index.js +1 -1
  23. package/build/components/DateFilter/index.js +1 -1
  24. package/build/components/DateFilter/style.d.ts +12 -6
  25. package/build/components/Dialog/Dialog.d.ts +14 -0
  26. package/build/components/Dialog/components/DialogToolbar.d.ts +9 -0
  27. package/build/components/Dialog/constant.d.ts +1 -0
  28. package/build/components/Dialog/index.d.ts +4 -0
  29. package/build/components/Dialog/index.js +1 -0
  30. package/build/components/Dialog/style.d.ts +272 -0
  31. package/build/components/Discount/index.js +1 -1
  32. package/build/components/ExpandableSideBar/index.js +1 -1
  33. package/build/components/FileInputPreview/index.js +1 -1
  34. package/build/components/FileUpload/index.js +1 -1
  35. package/build/components/FilterDropdown/index.js +1 -1
  36. package/build/components/JSONViewer/index.js +1 -1
  37. package/build/components/LanguageDropdown/index.js +1 -1
  38. package/build/components/ListColumnFilter/index.js +1 -1
  39. package/build/components/ListHeader/constants.d.ts +9 -0
  40. package/build/components/ListHeader/index.js +1 -1
  41. package/build/components/MerchantCurrencyDropdown/index.js +1 -1
  42. package/build/components/MerchantLogo/index.js +1 -1
  43. package/build/components/MerchantsDropdown/index.js +1 -1
  44. package/build/components/MultiSelectDropdownButton/index.js +1 -1
  45. package/build/components/PartnersFilter/index.js +1 -1
  46. package/build/components/PaymentSourceFilter/index.js +1 -1
  47. package/build/components/PhoneFilter/index.js +1 -1
  48. package/build/components/RangeCalender/index.js +1 -1
  49. package/build/components/ReceiptsViewer/index.js +1 -1
  50. package/build/components/ReferenceTypeFilter/index.js +1 -1
  51. package/build/components/StatusFilter/index.js +1 -1
  52. package/build/components/StatusIcons/index.js +1 -1
  53. package/build/components/TableCells/index.js +1 -1
  54. package/build/components/TableReports/index.js +1 -1
  55. package/build/components/TreeDropdown/index.js +1 -1
  56. package/build/components/VAT/index.js +1 -1
  57. package/build/components/VerificationIcon/index.js +1 -1
  58. package/build/components/ViewColumnRadioFilter/index.js +1 -1
  59. package/build/components/WindowSideBar/index.js +1 -1
  60. package/build/components/index.d.ts +2 -2
  61. package/build/components/index.js +1 -1
  62. package/build/index.js +1 -1
  63. package/package.json +2 -2
  64. package/build/_chunks/chunk-7MCN6MRG.js +0 -1
  65. package/build/_chunks/chunk-TMDIGTC5.js +0 -1
  66. package/build/_chunks/chunk-WUISDFXI.js +0 -2
  67. package/build/_chunks/chunk-ZEF2G4DA.js +0 -1
  68. package/build/components/Button/Button.d.ts +0 -16
  69. package/build/components/Button/PlusButton/PlusButton.d.ts +0 -10
  70. package/build/components/Button/PlusButton/index.d.ts +0 -2
  71. package/build/components/Button/StyledButton/StyledButton.d.ts +0 -11
  72. package/build/components/Button/StyledButton/index.d.ts +0 -2
  73. package/build/components/Button/StyledButton/style.d.ts +0 -5
  74. package/build/components/Button/index.d.ts +0 -4
  75. package/build/components/Button/index.js +0 -1
  76. package/build/components/Button/style.d.ts +0 -5
package/README.md CHANGED
@@ -31,7 +31,7 @@ function MyApp() {
31
31
  const toast = useToast()
32
32
 
33
33
  return (
34
- <Button variant="confirm" onClick={() => toast.success('Hello!')}>
34
+ <Button variant="primary" onClick={() => toast.success('Hello!')}>
35
35
  Click me
36
36
  </Button>
37
37
  )
@@ -1 +1 @@
1
- import {f as f$1}from'./chunk-RKQEODRF.js';import {a as a$1}from'./chunk-HHUVMRYO.js';import {a,f,e}from'./chunk-2QINQUHF.js';import {a as a$2}from'./chunk-RIJFII4O.js';import {z as z$1}from'./chunk-7PJX5ZKM.js';import {Ka,g,yc}from'./chunk-2SKLD6QR.js';import {Cb}from'./chunk-OK75VWGZ.js';import {memo,useRef,useMemo,useCallback,useId,useState}from'react';import {styled,Typography,Box,Popper}from'@mui/material';import {useTranslation}from'react-i18next';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var O=styled(Typography)(()=>({display:"block",textAlign:"center",fontSize:"10px",fontWeight:500,color:"#8D8D94",padding:"24px 0"})),A=styled(Box,{shouldForwardProp:t=>t!=="isDisabled"})(({isDisabled:t})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"4px",...t&&{"& img":{opacity:.3}}}));var tt=memo(t=>{let{variant:e$1="inActive",badgeCount:o,label:r,...n}=t,s=useRef(null),m=useMemo(()=>!o||Number.isNaN(Ka(o))?null:jsx(z$1,{color:"inactive",children:g(Number(o))}),[o]),a$1=useCallback(p=>{p.stopPropagation(),t?.onClick?.(p);},[t]),l=a[e$1];return jsx(l,{"data-testid":"MultiSelectStatusButton",...n,ref:s,onClick:a$1,statusVariant:e$1,children:jsx(f,{children:jsxs(e,{variant:e$1,children:[r,m]})})})}),W=tt;function V(t){let e=new Set;return t.filter(o=>e.has(o.value)?false:(e.add(o.value),true))}function h(t,e){let o=e.toLowerCase();return t.reduce((r,n)=>{if(n.options?.length){let s=h(n.options,e);s.length&&r.push({...n,options:s});}else (n.placeholder?.toLowerCase().includes(o)||n.value.toLowerCase().includes(o))&&r.push(n);return r},[])}function it({buttonLabel:t,onClear:e,onConfirm:o,dropdownItems:r,apiKey:n,data:s,styles:m,buttonDisabled:a,searchable:l,searchPlaceholder:p}){let{t:Q}=useTranslation(),Y=p??`${Q("search")}...`,$=yc(useId(),"multi-select-dropdown-button"),[C,b]=useState(null),[u,d]=useState(""),G=c=>{b(c.currentTarget);},g=()=>{b(null),d("");},x=!!C,L=s?.[n],J=Array.isArray(L)?L.length:0,S=useMemo(()=>{if(!r)return r;let c=V(r);return !l||!u?c:h(c,u)},[l,u,r]),v=l&&!!u&&S?.length===0,U=l?jsxs(Fragment,{children:[jsx(a$1,{name:"multi-select-search",value:u,placeholder:Y,onSearchChange:d,onSearchReset:()=>d(""),sx:{pt:0}}),v&&jsx(O,{children:"No results found"})]}):void 0;return jsxs("div",{id:$,"data-testid":"MultiSelectDropdownButton",children:[jsx(W,{onClick:G,label:jsxs(A,{isDisabled:a,children:[t,jsx("img",{src:Cb,alt:"arrow-down"})]}),disabled:a,badgeCount:J}),x&&jsx(a$2,{onClick:g}),jsx(Popper,{open:x,anchorEl:C,placement:"bottom-start",sx:{zIndex:9999},children:jsx(f$1,{onCloseDropdown:g,filter:{apiKey:n,data:s,onClear:e,onConfirm:o,options:S,type:"list"},styles:{...m,height:v?"auto":"300px",overflowY:"scroll",maxWidth:"200px"},header:U,searchable:l})})]})}var z=memo(it);var Ot=z;export{Ot as a};
1
+ import {f as f$1}from'./chunk-RKQEODRF.js';import {a as a$1}from'./chunk-HHUVMRYO.js';import {a as a$2}from'./chunk-RIJFII4O.js';import {a,f,e}from'./chunk-2QINQUHF.js';import {z as z$1}from'./chunk-7PJX5ZKM.js';import {Ka,g,yc}from'./chunk-2SKLD6QR.js';import {Cb}from'./chunk-OK75VWGZ.js';import {memo,useRef,useMemo,useCallback,useId,useState}from'react';import {styled,Typography,Box,Popper}from'@mui/material';import {useTranslation}from'react-i18next';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var O=styled(Typography)(()=>({display:"block",textAlign:"center",fontSize:"10px",fontWeight:500,color:"#8D8D94",padding:"24px 0"})),A=styled(Box,{shouldForwardProp:t=>t!=="isDisabled"})(({isDisabled:t})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"4px",...t&&{"& img":{opacity:.3}}}));var tt=memo(t=>{let{variant:e$1="inActive",badgeCount:o,label:r,...n}=t,s=useRef(null),m=useMemo(()=>!o||Number.isNaN(Ka(o))?null:jsx(z$1,{color:"inactive",children:g(Number(o))}),[o]),a$1=useCallback(p=>{p.stopPropagation(),t?.onClick?.(p);},[t]),l=a[e$1];return jsx(l,{"data-testid":"MultiSelectStatusButton",...n,ref:s,onClick:a$1,statusVariant:e$1,children:jsx(f,{children:jsxs(e,{variant:e$1,children:[r,m]})})})}),W=tt;function V(t){let e=new Set;return t.filter(o=>e.has(o.value)?false:(e.add(o.value),true))}function h(t,e){let o=e.toLowerCase();return t.reduce((r,n)=>{if(n.options?.length){let s=h(n.options,e);s.length&&r.push({...n,options:s});}else (n.placeholder?.toLowerCase().includes(o)||n.value.toLowerCase().includes(o))&&r.push(n);return r},[])}function it({buttonLabel:t,onClear:e,onConfirm:o,dropdownItems:r,apiKey:n,data:s,styles:m,buttonDisabled:a,searchable:l,searchPlaceholder:p}){let{t:Q}=useTranslation(),Y=p??`${Q("search")}...`,$=yc(useId(),"multi-select-dropdown-button"),[C,b]=useState(null),[u,d]=useState(""),G=c=>{b(c.currentTarget);},g=()=>{b(null),d("");},x=!!C,L=s?.[n],J=Array.isArray(L)?L.length:0,S=useMemo(()=>{if(!r)return r;let c=V(r);return !l||!u?c:h(c,u)},[l,u,r]),v=l&&!!u&&S?.length===0,U=l?jsxs(Fragment,{children:[jsx(a$1,{name:"multi-select-search",value:u,placeholder:Y,onSearchChange:d,onSearchReset:()=>d(""),sx:{pt:0}}),v&&jsx(O,{children:"No results found"})]}):void 0;return jsxs("div",{id:$,"data-testid":"MultiSelectDropdownButton",children:[jsx(W,{onClick:G,label:jsxs(A,{isDisabled:a,children:[t,jsx("img",{src:Cb,alt:"arrow-down"})]}),disabled:a,badgeCount:J}),x&&jsx(a$2,{onClick:g}),jsx(Popper,{open:x,anchorEl:C,placement:"bottom-start",sx:{zIndex:9999},children:jsx(f$1,{onCloseDropdown:g,filter:{apiKey:n,data:s,onClear:e,onConfirm:o,options:S,type:"list"},styles:{...m,height:v?"auto":"300px",overflowY:"scroll",maxWidth:"200px"},header:U,searchable:l})})]})}var z=memo(it);var Ot=z;export{Ot as a};
@@ -1 +1 @@
1
- import {c as c$2}from'./chunk-WIQME66S.js';import {r,a as a$2}from'./chunk-XN47DSB4.js';import {c,d}from'./chunk-HP62XFCT.js';import {a,c as c$1,d as d$1}from'./chunk-LOQ3FEOU.js';import {a as a$1,b}from'./chunk-EDZWCPS2.js';import'./chunk-FH3OCBAM.js';import {ta,dl,el,wi,Jk,A,Td,ve,ue as ue$1,sa,qa,ra}from'./chunk-OK75VWGZ.js';import Gt,{memo,createContext,useState,useRef,useId,useMemo,useCallback,useEffect,useContext}from'react';import {styled,Popover,Input,Typography,Box}from'@mui/material';import C from'@uiw/react-json-view';import {motion,AnimatePresence}from'framer-motion';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import Xt from'@mui/material/Box';import {useTranslation}from'react-i18next';import {styled as styled$1}from'@mui/material/styles';var R=37,de="32px",W=545;styled(Popover)(({theme:e})=>({backgroundColor:e.palette.background.default,boxShadow:e.shadows[21],"& .MuiPaper-root":{borderRadius:"12px"}}));var Kt=44,ce={"--w-rjv-color":"#9cdcfe","--w-rjv-key-string":"#357fb9","--w-rjv-background-color":"#ffffff","--w-rjv-line-color":"#ffffff","--w-rjv-arrow-color":"#116e6bed","--w-rjv-edit-color":"#9cdcfe","--w-rjv-info-color":"#9c9c9c7a","--w-rjv-update-color":"#FFE20B","--w-rjv-copied-color":"#9cdcfe","--w-rjv-copied-success-color":"#28a745","--w-rjv-curlybraces-color":"#000000","--w-rjv-colon-color":"#000000","--w-rjv-brackets-color":"#000000","--w-rjv-quotes-color":"#9cdcfe","--w-rjv-quotes-string-color":"#c27c46","--w-rjv-type-string-color":"#c27c46","--w-rjv-type-int-color":"#956ea5","--w-rjv-type-float-color":"#956ea5","--w-rjv-type-bigint-color":"#956ea5","--w-rjv-type-boolean-color":"#956ea5","--w-rjv-type-date-color":"#956ea5","--w-rjv-type-url-color":"#3b89cf","--w-rjv-type-null-color":"#956ea5","--w-rjv-type-nan-color":"#956ea5","--w-rjv-type-undefined-color":"#956ea5",padding:"1rem",height:`calc(100% - ${Kt+R}px`,overflow:"auto"},Ye={...ce,background:"transparent","--w-rjv-line-color":"transparent"},Xe=styled("button")(({theme:e})=>({padding:"0rem",borderRadius:"0.25rem",backgroundColor:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem",color:e.palette.text.primary,fontSize:"0.625rem",fontWeight:e.typography.fontWeightBold,outline:"none",cursor:"pointer",border:`1px solid ${e.palette.grey[100]}`,"&:hover":{boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark};`},position:"relative",overflow:"hidden",transition:"all 0.2s ease-in-out",width:"24px",height:"24px",flexShrink:0})),Qe=styled("button")(({theme:e})=>({outline:"none",cursor:"pointer",border:"1px solid transparent","&:hover":{boxShadow:e.shadows[8]},borderRadius:"0.25rem",position:"relative",backgroundColor:e.palette.background.transparent,display:"inline-flex",alignItems:"center",justifyContent:"center"}));styled(Input)(({theme:e})=>({border:`1px solid ${e.palette.grey[100]}`,borderRadius:"0.25rem",padding:"0.375rem",fontSize:"0.625rem",outline:"none",width:"100%",maxWidth:"150px",height:"1.5rem",backgroundColor:e.palette.background.paper,"&:focus":{border:`1px solid ${e.palette.info.dark}`}}));var ue=styled(Typography)(()=>({border:"1px solid rgba(242, 242, 242, 0.70);",display:"inline-flex",height:"24px",padding:"0px 8px",justifyContent:"center",alignItems:"center",borderRadius:"37.5px",backgroundColor:"#fff"})),fe=styled(Box,{shouldForwardProp:e=>!["isMaximized","isScrollingRequest","isRequestShown"].includes(e)})(({isScrollingRequest:e,isMaximized:t,isRequestShown:r,theme:o})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"4px",paddingBlock:"0px",paddingInlineStart:"12px",paddingInlineEnd:"12px",position:"sticky",left:0,right:0,top:0,background:"#fff",zIndex:5,...e&&{boxShadow:o.shadows[23]},...t&&{paddingTop:de,transition:"padding 0.3s ease-in-out",...r&&{width:"50%"}}})),me=styled(Box,{shouldForwardProp:e=>!["isMaximized","isRequestShown"].includes(e)})(({isMaximized:e,isRequestShown:t})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",height:R,position:"fixed",bottom:0,right:0,left:e?"50vw":0,...!t&&{left:0}})),ge=styled(Box)(()=>({display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",paddingBlock:"10px",paddingInlineStart:"8px",paddingInlineEnd:"0px"})),he=styled(Box)(()=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"4px",paddingBlock:"10px",paddingInlineStart:"0px",paddingInlineEnd:"12px"})),Ue=styled(motion.div,{shouldForwardProp:e=>!["isRequestShown","isMaximized"].includes(e)})(({isRequestShown:e,isMaximized:t})=>({width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",background:"#fff",zIndex:20,position:"relative",display:"flex",flexDirection:"column",borderBottomRightRadius:"12px",borderBottomLeftRadius:e?0:"12px",...t&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,height:"100vh"}}));styled(motion.div,{shouldForwardProp:e=>!["isMaximized","currentRequestWidth"].includes(e)})(({isMaximized:e,currentRequestWidth:t})=>({backgroundColor:"#E7E7E7B2",backdropFilter:"blur(12px)",height:e?"100vh":"100%",overflowY:"auto",overflowX:"hidden",position:"absolute",width:e?"100vw":t,zIndex:19,display:"flex",flexDirection:"column",borderBottomLeftRadius:"12px"}));styled(Box,{shouldForwardProp:e=>!["isMaximized","currentHeight"].includes(e)})(({isMaximized:e,currentHeight:t})=>({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",height:e?`calc(100vh - ${R}px)`:(t||W)-R+5,background:"transparent",position:"fixed",width:"100%"}));var Ze=styled(Box)(()=>({position:"fixed",width:"100%",background:"transparent",height:"100%"})),et=styled("span")(()=>({color:"#032F62"})),tt=styled("span")(()=>({color:"#357fb9"}));function $({"data-copied":e,style:t,onClick:r},{keyName:o}){return o?jsxs(Qe,{style:t,onClick:n=>{r?.(n);},children:[jsx(AnimatePresence,{children:e&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:ta,alt:"icon"},"copied-icon")}),jsx(AnimatePresence,{children:!e&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:ra,alt:"icon"},"copy-icon")})]}):jsx("span",{})}function Ut({onClick:e,icon:t,label:r,disableAnimation:o,...n}){let[s,l]=Gt.useState(false),{t:p}=useTranslation();return jsxs(Xe,{...n,onClick:d=>{e?.(d),!o&&(l(true),setTimeout(()=>{l(false);},2e3));},children:[jsxs(Xt,{sx:{width:"16px",display:"flex",overflow:"hidden",justifyContent:"center",alignItems:"center"},children:[jsx(AnimatePresence,{mode:"wait",children:s&&jsx(motion.img,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.4},src:ta,alt:"icon"},"id-icon")}),jsx(AnimatePresence,{mode:"wait",children:!s&&jsx(motion.img,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.4},src:t,alt:"icon"},"id-icon")})]}),r&&jsxs(Fragment,{children:[jsx(AnimatePresence,{children:s&&jsx(motion.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute"},transition:{duration:.4},children:p("copied")})}),jsx(AnimatePresence,{children:!s&&jsx(motion.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute",width:"53px"},transition:{duration:.4},children:r})})]})]})}var rt=memo(Ut);var B=rt;var it=styled$1("div")(()=>({display:"flex",alignItems:"center",position:"relative",flexShrink:0,width:"24px",height:"24px"})),st=styled$1("button")(({theme:e,isActive:t})=>({width:"24px",height:"24px",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",border:`1px solid ${t?e.palette.info.dark:e.palette.grey[100]}`,backgroundColor:e.palette.background.paper,cursor:"pointer",outline:"none",padding:0,position:"relative",zIndex:11,transition:"all 0.2s ease-in-out","&:hover":{boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark}`}})),at=styled$1(motion.div)(()=>({position:"absolute",right:0,top:0,height:"24px",display:"flex",alignItems:"center",zIndex:20,background:"transparent"})),lt=styled$1(motion.input)(({theme:e})=>({width:"177px",height:"24px",borderRadius:"4px",color:e.palette.text.primary,fontSize:"10px",outline:0,background:e.palette.background.paper,boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark}`,paddingLeft:"8px",boxSizing:"border-box","::placeholder":{color:"#D5D5D5"}})),ye={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,userSelect:"none"},pt={...ye,background:"none",border:"none",padding:0,margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",outline:"none","&:disabled":{opacity:.3,cursor:"default"}},dt=styled$1("button")(()=>({...pt,right:53})),ct=styled$1("button")(()=>({...pt,right:39})),ut=styled$1(motion.img)(()=>({...ye,right:24,width:10,height:10,cursor:"pointer"})),ft=styled$1(motion.img)(()=>({...ye,right:8,width:11,height:11,cursor:"default"})),we=styled$1("img")(()=>({width:10,height:10})),mt=styled$1("img")(()=>({width:12,height:12})),gt=styled$1("span")(({theme:e})=>({position:"absolute",right:67,top:"50%",transform:"translateY(-50%)",fontSize:"9px",lineHeight:1,color:e.palette.text.secondary,whiteSpace:"nowrap",userSelect:"none",zIndex:2,pointerEvents:"none"}));function ro({value:e,onChange:t,currentIndex:r,totalCount:o,onPrev:n,onNext:s,onOpen:l,placeholder:p="Search..."}){let[i,d]=useState(false),g=useRef(null),m=e.trim().length>0,w=o>0,x=m,b=()=>{l?.(),d(true),requestAnimationFrame(()=>g.current?.focus());},S=()=>{t(""),d(false);};return jsxs(it,{children:[jsx(AnimatePresence,{children:i&&jsxs(at,{initial:{clipPath:"inset(0 0 0 100%)",opacity:0},animate:{clipPath:"inset(0 0 0 0%)",opacity:1},exit:{clipPath:"inset(0 0 0 100%)",opacity:0},transition:{duration:.22,ease:[.4,0,.2,1]},children:[jsx(lt,{ref:g,initial:false,animate:{paddingRight:x?"98px":"24px"},transition:{duration:.15},placeholder:p,value:e,onChange:u=>t(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.shiftKey?n():s()),u.key==="Escape"&&S();},onBlur:()=>{m||d(false);}}),x&&jsx(dt,{onClick:n,disabled:!w,title:"Previous match (Shift+Enter)",children:jsx(we,{src:dl,alt:"prev"})}),x&&jsx(ct,{onClick:s,disabled:!w,title:"Next match (Enter)",children:jsx(we,{src:el,alt:"next"})}),x&&jsx(ut,{src:wi,alt:"clear",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:S}),jsx(ft,{src:Jk,alt:"search",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),x&&jsx(gt,{children:w?`${r+1}/${o}`:"0/0"})]},"input-area")}),jsx(AnimatePresence,{children:!i&&jsx(motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.15},children:jsx(st,{isActive:false,onClick:b,title:"Search",children:jsx(mt,{src:A,alt:"search"})})})})]})}var z=memo(ro);function yt(e,t){let r=[],o=t.length,n=0,s=e.indexOf(t,n);for(;s!==-1;){let l=s+o;r.push([s,l]),n=l,s=e.indexOf(t,n);}return r}var io={padding:0,outline:"none"};function bt({text:e,queryLength:t,ranges:r,idPrefix:o}){let n=[],s=0;return r.forEach(([l,p],i)=>{l>s&&n.push(e.slice(s,l)),n.push(jsx("mark",{style:io,children:e.slice(l,l+t)},`${o}-${i}`)),s=p;}),s<e.length&&n.push(e.slice(s)),jsx(Fragment,{children:n})}function E({text:e,query:t}){let r=useId(),o=useMemo(()=>t.trim().toLowerCase(),[t]),n=useMemo(()=>{if(!o)return e;let s=e.toLowerCase(),l=yt(s,o);return l.length===0?e:jsx(bt,{text:e,queryLength:t.length,ranges:l,idPrefix:r})},[e,t.length,o,r]);return jsx(Fragment,{children:n})}function Q(e,t){return e.toLowerCase().includes(t)}function U(e){return e.trim().toLowerCase()}function Z(e){let t=U(e);return (r,{keyName:o})=>{if(!t||!o)return;let n=String(o);if(Q(n,t))return jsx(tt,{children:jsx(E,{text:String(o),query:e})})}}function ee(e){let t=U(e);return (r,{value:o})=>{if(!t)return;let n=String(o??"");if(Q(n,t))return jsxs(et,{children:['"',jsx(E,{text:String(o??""),query:e}),'"']})}}function fo({title:e,onClose:t,onMaximize:r,maximized:o=false,id:n,onMouseHover:s,onMouseLeave:l,onRequestClick:p,isRequestExpanded:i=false,showRequestIcon:d$2=false,isHovered:g=false}){return jsx(c,{id:n,maximized:o||false,children:jsx(d,{isHovered:true,onMouseEnter:s,onMouseLeave:l,isMaximized:o,title:e,icon:Td,leftActions:jsxs(Fragment,{children:[jsx(a,{onClick:t}),jsx(c$1,{isMaximized:o,onClick:r}),d$2&&jsx(d$1,{onClick:p,isExpanded:i,isHovered:g,children:"Request"})]})})})}var It=memo(fo);var be=It;var M=createContext({jsonViewerList:[],handleJsonViewerDialogOpen:()=>{},handleWindowMinimize:()=>{},handleWindowOrder:()=>{},registerJsonViewerEvents:()=>{},containerRef:{current:null}});var Jt=({list:e,events:t,onClose:r,isWindowMinimized:o,windowOrder:n})=>e?.length?jsx(Fragment,{children:e.map((s,l)=>jsx(q,{index:l,...t,...s,onClose:()=>{r(l);},isWindowMinimized:o,windowOrder:n},s.json.id))}):null;var wo=({children:e,containerRef:t})=>{let[r,o]=useState([]),[n,s]=useState(false),[l,p]=useState(1),i=useRef({}),d=useCallback(c=>{if(r.length===7){alert("Maximum allowed active Json Viewer is 7 per table.");return}if(r.some(N=>N.json.id===c.json.id))return;let T=structuredClone(c.json),V=T.request_body,u={...c,json:T,requestJson:c.requestJson||V||void 0};delete u.json.request_body,o(N=>[...N,u]);},[r]),g=useCallback(c=>{o(T=>T.filter((V,u)=>c!==u));},[]),m=useCallback(c=>{s(c);},[]),w=useCallback(c=>{p(c);},[]),x=useCallback(c=>{i.current=c;},[]),b=useMemo(()=>({onJsonRequestOpen:()=>i.current.onJsonRequestOpen?.(),onJsonSearch:()=>i.current.onJsonSearch?.(),onJsonCopy:()=>i.current.onJsonCopy?.(),onJsonIdCopy:()=>i.current.onJsonIdCopy?.(),onJsonNodesMinimize:()=>i.current.onJsonNodesMinimize?.(),onJsonNodesMaximize:()=>i.current.onJsonNodesMaximize?.()}),[]),S=useMemo(()=>({jsonViewerList:r,handleJsonViewerDialogOpen:d,handleWindowMinimize:m,handleWindowOrder:w,registerJsonViewerEvents:x,containerRef:t}),[r,d,m,w,x,t]);return jsxs(M.Provider,{value:S,children:[e,jsx(Jt,{list:r,events:b,onClose:g,isWindowMinimized:n,windowOrder:l})]})};var Et="#FFE20B";function te(e,t){let[r,o]=useState(0),[n,s]=useState(0);useEffect(()=>{if(!t.trim()){s(0),o(0);return}let i=setTimeout(()=>{let d=e.current?.querySelectorAll("mark")??[];s(d.length),o(0);},50);return ()=>clearTimeout(i)},[t,e]),useEffect(()=>{if(!e.current||!t.trim())return;let i=Array.from(e.current.querySelectorAll("mark"));i.forEach((d,g)=>{let m=g===r;d.style.backgroundColor=m?Et:"transparent",d.style.outline=m?`1px solid ${Et}`:"none",d.style.borderRadius="2px";}),i[r]?.scrollIntoView({behavior:"smooth",block:"nearest"});},[r,n,t,e]);let l=useCallback(()=>{n!==0&&o(i=>(i+1)%n);},[n]),p=useCallback(()=>{n!==0&&o(i=>(i-1+n)%n);},[n]);return {currentIndex:r,totalCount:n,goNext:l,goPrev:p}}function Ot(e,t){return e==null?String(e).includes(t):typeof e=="string"?e.toLowerCase().includes(t):typeof e=="number"||typeof e=="boolean"?String(e).includes(t):false}function Vt(e,t){if(Array.isArray(e)){let r=e.map(o=>Vt(o,t)).filter(o=>o!=null);return r.length>0?r:null}return typeof e=="object"&&e!==null?Ht(e,t):Ot(e,t)?e:null}function Ht(e,t){let r={};for(let[o,n]of Object.entries(e))if(o.toLowerCase().includes(t))r[o]=n;else if(typeof n=="object"&&n!==null){let s=Vt(n,t);s!==null&&(r[o]=s);}else Ot(n,t)&&(r[o]=n);return Object.keys(r).length>0?r:null}function Ce(e,t){return t.trim()?Ht(e,t.toLowerCase()):e}var L=400,ne=.5;function q(e){let{containerRef:t}=useContext(M),{height:r$1,width:o}=a$1(),[n,s]=useState(false),l=t?.current,p=l?.clientWidth||o,i=l?.clientHeight||r$1;return jsx(r,{isOpen:true,onClose:e.onClose,containerRef:t,defaultWindowWidth:L,defaultWindowHeight:W,minHeight:300,windowZIndex:3,initialPosition:{x:p/2+L/4-e.index*20,y:i/2-W/2+e.index*30},windowProps:{mainAppOrder:e.windowOrder,mainAppIsMinimized:e.isWindowMinimized,overflow:"visible",titleBar:jsx(Co,{...e,isRequestShown:n,setIsRequestShown:s})},children:jsx(vo,{...e,isRequestShown:n})})}function Co({requestJson:e={},onClose:t,onJsonRequestOpen:r,isRequestShown:o,setIsRequestShown:n}){let{isMaximized:s,setIsMaximized:l,isToolbarAnimationDisabled:p,setIsToolbarAnimationDisabled:i,dimensions:d,updateSize:g}=useContext(a$2),{onMouseEnter:m,onMouseLeave:w,isHovered:x}=b(),b$1=d.width||L,S=Object.keys(e)?.length;return jsx(motion.div,{style:{...s&&{height:de,position:"fixed",zIndex:1e3}},animate:{width:o?b$1*2:b$1,...s&&{width:"100vw"},...!s&&{transform:`translateX(${o?-b$1:0}px)`}},transition:{duration:ne,...p&&{duration:0}},children:jsx(be,{title:o?"JSON Request & Response":"JSON Response",onClose:()=>t(),onMaximize:()=>{l(c=>!c),i(true),setTimeout(()=>{i(false);},ne*1e3);},isHovered:x,onMouseHover:m,onMouseLeave:w,maximized:s,id:"draggable-dialog-title",onRequestClick:()=>{n(c=>!c),i(false),o||(r?.(),g({width:L,height:W}));},isRequestExpanded:o,showRequestIcon:!!S})})}function vo({json:e,requestJson:t={},onJsonSearch:r,onJsonCopy:o,onJsonIdCopy:n,onJsonNodesMinimize:s,onJsonNodesMaximize:l,isRequestShown:p}){let{isMaximized:i,isToolbarAnimationDisabled:d,dimensions:g}=useContext(a$2),[m,w]=useState(false),[x,b]=useState(false),[S,c]=useState(true),[T,V]=useState(false),[u,N]=useState(""),[k,jt]=useState(""),Je=useRef(null),ke=useRef(null),F=te(Je,u),_=te(ke,k),qt=useMemo(()=>Object.keys(e)?.length,[e]),Pe=g.width||L,Be=v=>{setTimeout(()=>{navigator.clipboard.writeText(v||"").then(()=>{});},10);},Dt=useMemo(()=>Object.keys(t)?.length,[t]),Te=useMemo(()=>Ce(e,u),[e,u]),Ee=useMemo(()=>Ce(t,k),[t,k]);return jsx(Ze,{"data-testid":"JSONViewer",children:jsxs(Box,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",height:i?`calc(100vh - ${R}px)`:(g.height||W)-R+5,background:"transparent",position:"fixed",width:"100%"},children:[jsx(AnimatePresence,{children:p&&jsxs(motion.div,{initial:{left:i?"50vw":0,...i&&{position:"relative",left:"-50vw"}},animate:{left:i?"50vw":-Pe,...i&&{position:"relative",left:"0"},...!p&&{left:0}},exit:{left:i?"50vw":0,...i&&{position:"relative",left:"0"}},transition:{duration:ne,...d&&{duration:0}},ref:ke,style:{flex:1,backgroundColor:"#E7E7E7B2",backdropFilter:"blur(12px)",height:i?"100vh":"100%",overflowY:"auto",position:"absolute",width:i?"100vw":Pe,zIndex:19,display:"flex",flexDirection:"column",borderBottomLeftRadius:"12px"},onScroll:()=>{V(true),setTimeout(()=>{V(false);},2e3);},children:[jsxs(fe,{isMaximized:i,isScrollingRequest:T,sx:{background:"#E7E7E7B2"},isRequestShown:p,children:[jsx(he,{children:jsx(ue,{variant:"subtitle1",children:"API Request"})}),jsxs(ge,{children:[jsx(z,{value:k,onChange:jt,onOpen:()=>r?.(),currentIndex:_.currentIndex,totalCount:_.totalCount,onPrev:_.goPrev,onNext:_.goNext}),jsx(B,{disableAnimation:true,onClick:()=>{S?l?.():s?.(),c(v=>!v);},icon:S?ve:ue$1}),jsx(B,{onClick:()=>{o?.(),navigator.clipboard.writeText(JSON.stringify(t,null,2)).then(()=>{});},icon:sa}),jsx(B,{onClick:()=>{n?.(),navigator.clipboard.writeText(e?.id||"").then(()=>{});},icon:qa})]})]}),k.trim()&&Ee===null?jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(Typography,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsxs(C,{value:Ee??t,style:Ye,displayDataTypes:false,collapsed:k.trim()?void 0:S?1:void 0,onCopied:(v,I)=>{typeof I=="string"&&Be(I);},enableClipboard:false,children:[jsx(C.String,{render:ee(k)}),jsx(C.KeyName,{render:Z(k)}),jsx(C.CountInfo,{render:(v,{keyName:I})=>{if(!I)return jsx("span",{})}}),jsx(C.Copied,{render:$})]}),jsx(AnimatePresence,{children:p&&jsx(me,{sx:{flex:1,height:R,left:0},children:jsx(c$2,{sx:{paddingLeft:"12px",borderBottomRightRadius:"0",background:"#f8f9fb",flex:1},totalCount:Dt})})})]})}),jsxs(Ue,{ref:Je,isMaximized:i,isRequestShown:p,style:{left:0,maxHeight:"100vw"},initial:{...i&&{width:"100vw",left:0}},animate:{...i&&{position:"absolute",left:p?"50vw":"0"}},transition:{duration:ne,...d&&{duration:0}},onScroll:()=>{b(true),setTimeout(()=>{b(false);},2e3);},children:[jsxs(fe,{isMaximized:i,isScrollingRequest:x,isRequestShown:p,children:[jsx(he,{children:jsx(ue,{variant:"subtitle1",children:"API Response"})}),jsxs(ge,{children:[jsx(z,{value:u,onChange:N,onOpen:()=>r?.(),currentIndex:F.currentIndex,totalCount:F.totalCount,onPrev:F.goPrev,onNext:F.goNext}),jsx(B,{disableAnimation:true,onClick:()=>{m?l?.():s?.(),w(v=>!v);},icon:m?ve:ue$1}),jsx(B,{onClick:()=>{o?.(),navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{});},icon:sa}),jsx(B,{onClick:()=>{n?.(),navigator.clipboard.writeText(e?.id||"").then(()=>{});},icon:qa})]})]}),u.trim()&&Te===null?jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(Typography,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsxs(C,{value:Te??e,style:ce,displayDataTypes:false,collapsed:u.trim()?void 0:m?1:void 0,onCopied:(v,I)=>{typeof I=="string"&&Be(I);},children:[jsx(C.String,{render:ee(u)}),jsx(C.KeyName,{render:Z(u)}),jsx(C.CountInfo,{render:(v,{keyName:I})=>{if(!I)return jsx("span",{})}}),jsx(C.Copied,{render:$})]}),jsx(me,{sx:{flex:1,height:R},children:jsx(c$2,{sx:{borderBottomLeftRadius:p?0:"12px",background:"#f8f9fb",flex:1},totalCount:qt})})]})]})})}var Ro=({isWindowMinimized:e,windowOrder:t,...r})=>{let{handleJsonViewerDialogOpen:o,handleWindowMinimize:n,handleWindowOrder:s,registerJsonViewerEvents:l}=useContext(M),p=useCallback(()=>{n(e);},[n,e]),i=useCallback(()=>{s(t);},[s,t]);return useEffect(()=>{i();},[i]),useEffect(()=>{p();},[p]),useEffect(()=>{l(r);},[l,r]),{handleJsonViewerDialogOpen:o}};var Ar=q;export{B as a,z as b,E as c,be as d,M as e,Jt as f,wo as g,te as h,Ro as i,Ar as j};
1
+ import {c as c$2}from'./chunk-WIQME66S.js';import {r,a as a$2}from'./chunk-OKDNE3LX.js';import {a,c as c$1,d as d$1}from'./chunk-LOQ3FEOU.js';import {c,d}from'./chunk-HP62XFCT.js';import {a as a$1,b}from'./chunk-EDZWCPS2.js';import'./chunk-FH3OCBAM.js';import {ta,dl,el,wi,Jk,A,Td,ve,ue as ue$1,sa,qa,ra}from'./chunk-OK75VWGZ.js';import Gt,{memo,createContext,useState,useRef,useId,useMemo,useCallback,useEffect,useContext}from'react';import {styled,Popover,Input,Typography,Box}from'@mui/material';import C from'@uiw/react-json-view';import {motion,AnimatePresence}from'framer-motion';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import Xt from'@mui/material/Box';import {useTranslation}from'react-i18next';import {styled as styled$1}from'@mui/material/styles';var R=37,de="32px",W=545;styled(Popover)(({theme:e})=>({backgroundColor:e.palette.background.default,boxShadow:e.shadows[21],"& .MuiPaper-root":{borderRadius:"12px"}}));var Kt=44,ce={"--w-rjv-color":"#9cdcfe","--w-rjv-key-string":"#357fb9","--w-rjv-background-color":"#ffffff","--w-rjv-line-color":"#ffffff","--w-rjv-arrow-color":"#116e6bed","--w-rjv-edit-color":"#9cdcfe","--w-rjv-info-color":"#9c9c9c7a","--w-rjv-update-color":"#FFE20B","--w-rjv-copied-color":"#9cdcfe","--w-rjv-copied-success-color":"#28a745","--w-rjv-curlybraces-color":"#000000","--w-rjv-colon-color":"#000000","--w-rjv-brackets-color":"#000000","--w-rjv-quotes-color":"#9cdcfe","--w-rjv-quotes-string-color":"#c27c46","--w-rjv-type-string-color":"#c27c46","--w-rjv-type-int-color":"#956ea5","--w-rjv-type-float-color":"#956ea5","--w-rjv-type-bigint-color":"#956ea5","--w-rjv-type-boolean-color":"#956ea5","--w-rjv-type-date-color":"#956ea5","--w-rjv-type-url-color":"#3b89cf","--w-rjv-type-null-color":"#956ea5","--w-rjv-type-nan-color":"#956ea5","--w-rjv-type-undefined-color":"#956ea5",padding:"1rem",height:`calc(100% - ${Kt+R}px`,overflow:"auto"},Ye={...ce,background:"transparent","--w-rjv-line-color":"transparent"},Xe=styled("button")(({theme:e})=>({padding:"0rem",borderRadius:"0.25rem",backgroundColor:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem",color:e.palette.text.primary,fontSize:"0.625rem",fontWeight:e.typography.fontWeightBold,outline:"none",cursor:"pointer",border:`1px solid ${e.palette.grey[100]}`,"&:hover":{boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark};`},position:"relative",overflow:"hidden",transition:"all 0.2s ease-in-out",width:"24px",height:"24px",flexShrink:0})),Qe=styled("button")(({theme:e})=>({outline:"none",cursor:"pointer",border:"1px solid transparent","&:hover":{boxShadow:e.shadows[8]},borderRadius:"0.25rem",position:"relative",backgroundColor:e.palette.background.transparent,display:"inline-flex",alignItems:"center",justifyContent:"center"}));styled(Input)(({theme:e})=>({border:`1px solid ${e.palette.grey[100]}`,borderRadius:"0.25rem",padding:"0.375rem",fontSize:"0.625rem",outline:"none",width:"100%",maxWidth:"150px",height:"1.5rem",backgroundColor:e.palette.background.paper,"&:focus":{border:`1px solid ${e.palette.info.dark}`}}));var ue=styled(Typography)(()=>({border:"1px solid rgba(242, 242, 242, 0.70);",display:"inline-flex",height:"24px",padding:"0px 8px",justifyContent:"center",alignItems:"center",borderRadius:"37.5px",backgroundColor:"#fff"})),fe=styled(Box,{shouldForwardProp:e=>!["isMaximized","isScrollingRequest","isRequestShown"].includes(e)})(({isScrollingRequest:e,isMaximized:t,isRequestShown:r,theme:o})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"4px",paddingBlock:"0px",paddingInlineStart:"12px",paddingInlineEnd:"12px",position:"sticky",left:0,right:0,top:0,background:"#fff",zIndex:5,...e&&{boxShadow:o.shadows[23]},...t&&{paddingTop:de,transition:"padding 0.3s ease-in-out",...r&&{width:"50%"}}})),me=styled(Box,{shouldForwardProp:e=>!["isMaximized","isRequestShown"].includes(e)})(({isMaximized:e,isRequestShown:t})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",height:R,position:"fixed",bottom:0,right:0,left:e?"50vw":0,...!t&&{left:0}})),ge=styled(Box)(()=>({display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",paddingBlock:"10px",paddingInlineStart:"8px",paddingInlineEnd:"0px"})),he=styled(Box)(()=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"4px",paddingBlock:"10px",paddingInlineStart:"0px",paddingInlineEnd:"12px"})),Ue=styled(motion.div,{shouldForwardProp:e=>!["isRequestShown","isMaximized"].includes(e)})(({isRequestShown:e,isMaximized:t})=>({width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",background:"#fff",zIndex:20,position:"relative",display:"flex",flexDirection:"column",borderBottomRightRadius:"12px",borderBottomLeftRadius:e?0:"12px",...t&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,height:"100vh"}}));styled(motion.div,{shouldForwardProp:e=>!["isMaximized","currentRequestWidth"].includes(e)})(({isMaximized:e,currentRequestWidth:t})=>({backgroundColor:"#E7E7E7B2",backdropFilter:"blur(12px)",height:e?"100vh":"100%",overflowY:"auto",overflowX:"hidden",position:"absolute",width:e?"100vw":t,zIndex:19,display:"flex",flexDirection:"column",borderBottomLeftRadius:"12px"}));styled(Box,{shouldForwardProp:e=>!["isMaximized","currentHeight"].includes(e)})(({isMaximized:e,currentHeight:t})=>({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",height:e?`calc(100vh - ${R}px)`:(t||W)-R+5,background:"transparent",position:"fixed",width:"100%"}));var Ze=styled(Box)(()=>({position:"fixed",width:"100%",background:"transparent",height:"100%"})),et=styled("span")(()=>({color:"#032F62"})),tt=styled("span")(()=>({color:"#357fb9"}));function $({"data-copied":e,style:t,onClick:r},{keyName:o}){return o?jsxs(Qe,{style:t,onClick:n=>{r?.(n);},children:[jsx(AnimatePresence,{children:e&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:ta,alt:"icon"},"copied-icon")}),jsx(AnimatePresence,{children:!e&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:ra,alt:"icon"},"copy-icon")})]}):jsx("span",{})}function Ut({onClick:e,icon:t,label:r,disableAnimation:o,...n}){let[s,l]=Gt.useState(false),{t:p}=useTranslation();return jsxs(Xe,{...n,onClick:d=>{e?.(d),!o&&(l(true),setTimeout(()=>{l(false);},2e3));},children:[jsxs(Xt,{sx:{width:"16px",display:"flex",overflow:"hidden",justifyContent:"center",alignItems:"center"},children:[jsx(AnimatePresence,{mode:"wait",children:s&&jsx(motion.img,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.4},src:ta,alt:"icon"},"id-icon")}),jsx(AnimatePresence,{mode:"wait",children:!s&&jsx(motion.img,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.4},src:t,alt:"icon"},"id-icon")})]}),r&&jsxs(Fragment,{children:[jsx(AnimatePresence,{children:s&&jsx(motion.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute"},transition:{duration:.4},children:p("copied")})}),jsx(AnimatePresence,{children:!s&&jsx(motion.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute",width:"53px"},transition:{duration:.4},children:r})})]})]})}var rt=memo(Ut);var B=rt;var it=styled$1("div")(()=>({display:"flex",alignItems:"center",position:"relative",flexShrink:0,width:"24px",height:"24px"})),st=styled$1("button")(({theme:e,isActive:t})=>({width:"24px",height:"24px",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",border:`1px solid ${t?e.palette.info.dark:e.palette.grey[100]}`,backgroundColor:e.palette.background.paper,cursor:"pointer",outline:"none",padding:0,position:"relative",zIndex:11,transition:"all 0.2s ease-in-out","&:hover":{boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark}`}})),at=styled$1(motion.div)(()=>({position:"absolute",right:0,top:0,height:"24px",display:"flex",alignItems:"center",zIndex:20,background:"transparent"})),lt=styled$1(motion.input)(({theme:e})=>({width:"177px",height:"24px",borderRadius:"4px",color:e.palette.text.primary,fontSize:"10px",outline:0,background:e.palette.background.paper,boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark}`,paddingLeft:"8px",boxSizing:"border-box","::placeholder":{color:"#D5D5D5"}})),ye={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,userSelect:"none"},pt={...ye,background:"none",border:"none",padding:0,margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",outline:"none","&:disabled":{opacity:.3,cursor:"default"}},dt=styled$1("button")(()=>({...pt,right:53})),ct=styled$1("button")(()=>({...pt,right:39})),ut=styled$1(motion.img)(()=>({...ye,right:24,width:10,height:10,cursor:"pointer"})),ft=styled$1(motion.img)(()=>({...ye,right:8,width:11,height:11,cursor:"default"})),we=styled$1("img")(()=>({width:10,height:10})),mt=styled$1("img")(()=>({width:12,height:12})),gt=styled$1("span")(({theme:e})=>({position:"absolute",right:67,top:"50%",transform:"translateY(-50%)",fontSize:"9px",lineHeight:1,color:e.palette.text.secondary,whiteSpace:"nowrap",userSelect:"none",zIndex:2,pointerEvents:"none"}));function ro({value:e,onChange:t,currentIndex:r,totalCount:o,onPrev:n,onNext:s,onOpen:l,placeholder:p="Search..."}){let[i,d]=useState(false),g=useRef(null),m=e.trim().length>0,w=o>0,x=m,b=()=>{l?.(),d(true),requestAnimationFrame(()=>g.current?.focus());},S=()=>{t(""),d(false);};return jsxs(it,{children:[jsx(AnimatePresence,{children:i&&jsxs(at,{initial:{clipPath:"inset(0 0 0 100%)",opacity:0},animate:{clipPath:"inset(0 0 0 0%)",opacity:1},exit:{clipPath:"inset(0 0 0 100%)",opacity:0},transition:{duration:.22,ease:[.4,0,.2,1]},children:[jsx(lt,{ref:g,initial:false,animate:{paddingRight:x?"98px":"24px"},transition:{duration:.15},placeholder:p,value:e,onChange:u=>t(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.shiftKey?n():s()),u.key==="Escape"&&S();},onBlur:()=>{m||d(false);}}),x&&jsx(dt,{onClick:n,disabled:!w,title:"Previous match (Shift+Enter)",children:jsx(we,{src:dl,alt:"prev"})}),x&&jsx(ct,{onClick:s,disabled:!w,title:"Next match (Enter)",children:jsx(we,{src:el,alt:"next"})}),x&&jsx(ut,{src:wi,alt:"clear",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:S}),jsx(ft,{src:Jk,alt:"search",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),x&&jsx(gt,{children:w?`${r+1}/${o}`:"0/0"})]},"input-area")}),jsx(AnimatePresence,{children:!i&&jsx(motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.15},children:jsx(st,{isActive:false,onClick:b,title:"Search",children:jsx(mt,{src:A,alt:"search"})})})})]})}var z=memo(ro);function yt(e,t){let r=[],o=t.length,n=0,s=e.indexOf(t,n);for(;s!==-1;){let l=s+o;r.push([s,l]),n=l,s=e.indexOf(t,n);}return r}var io={padding:0,outline:"none"};function bt({text:e,queryLength:t,ranges:r,idPrefix:o}){let n=[],s=0;return r.forEach(([l,p],i)=>{l>s&&n.push(e.slice(s,l)),n.push(jsx("mark",{style:io,children:e.slice(l,l+t)},`${o}-${i}`)),s=p;}),s<e.length&&n.push(e.slice(s)),jsx(Fragment,{children:n})}function E({text:e,query:t}){let r=useId(),o=useMemo(()=>t.trim().toLowerCase(),[t]),n=useMemo(()=>{if(!o)return e;let s=e.toLowerCase(),l=yt(s,o);return l.length===0?e:jsx(bt,{text:e,queryLength:t.length,ranges:l,idPrefix:r})},[e,t.length,o,r]);return jsx(Fragment,{children:n})}function Q(e,t){return e.toLowerCase().includes(t)}function U(e){return e.trim().toLowerCase()}function Z(e){let t=U(e);return (r,{keyName:o})=>{if(!t||!o)return;let n=String(o);if(Q(n,t))return jsx(tt,{children:jsx(E,{text:String(o),query:e})})}}function ee(e){let t=U(e);return (r,{value:o})=>{if(!t)return;let n=String(o??"");if(Q(n,t))return jsxs(et,{children:['"',jsx(E,{text:String(o??""),query:e}),'"']})}}function fo({title:e,onClose:t,onMaximize:r,maximized:o=false,id:n,onMouseHover:s,onMouseLeave:l,onRequestClick:p,isRequestExpanded:i=false,showRequestIcon:d$2=false,isHovered:g=false}){return jsx(c,{id:n,maximized:o||false,children:jsx(d,{isHovered:true,onMouseEnter:s,onMouseLeave:l,isMaximized:o,title:e,icon:Td,leftActions:jsxs(Fragment,{children:[jsx(a,{onClick:t}),jsx(c$1,{isMaximized:o,onClick:r}),d$2&&jsx(d$1,{onClick:p,isExpanded:i,isHovered:g,children:"Request"})]})})})}var It=memo(fo);var be=It;var M=createContext({jsonViewerList:[],handleJsonViewerDialogOpen:()=>{},handleWindowMinimize:()=>{},handleWindowOrder:()=>{},registerJsonViewerEvents:()=>{},containerRef:{current:null}});var Jt=({list:e,events:t,onClose:r,isWindowMinimized:o,windowOrder:n})=>e?.length?jsx(Fragment,{children:e.map((s,l)=>jsx(q,{index:l,...t,...s,onClose:()=>{r(l);},isWindowMinimized:o,windowOrder:n},s.json.id))}):null;var wo=({children:e,containerRef:t})=>{let[r,o]=useState([]),[n,s]=useState(false),[l,p]=useState(1),i=useRef({}),d=useCallback(c=>{if(r.length===7){alert("Maximum allowed active Json Viewer is 7 per table.");return}if(r.some(N=>N.json.id===c.json.id))return;let T=structuredClone(c.json),V=T.request_body,u={...c,json:T,requestJson:c.requestJson||V||void 0};delete u.json.request_body,o(N=>[...N,u]);},[r]),g=useCallback(c=>{o(T=>T.filter((V,u)=>c!==u));},[]),m=useCallback(c=>{s(c);},[]),w=useCallback(c=>{p(c);},[]),x=useCallback(c=>{i.current=c;},[]),b=useMemo(()=>({onJsonRequestOpen:()=>i.current.onJsonRequestOpen?.(),onJsonSearch:()=>i.current.onJsonSearch?.(),onJsonCopy:()=>i.current.onJsonCopy?.(),onJsonIdCopy:()=>i.current.onJsonIdCopy?.(),onJsonNodesMinimize:()=>i.current.onJsonNodesMinimize?.(),onJsonNodesMaximize:()=>i.current.onJsonNodesMaximize?.()}),[]),S=useMemo(()=>({jsonViewerList:r,handleJsonViewerDialogOpen:d,handleWindowMinimize:m,handleWindowOrder:w,registerJsonViewerEvents:x,containerRef:t}),[r,d,m,w,x,t]);return jsxs(M.Provider,{value:S,children:[e,jsx(Jt,{list:r,events:b,onClose:g,isWindowMinimized:n,windowOrder:l})]})};var Et="#FFE20B";function te(e,t){let[r,o]=useState(0),[n,s]=useState(0);useEffect(()=>{if(!t.trim()){s(0),o(0);return}let i=setTimeout(()=>{let d=e.current?.querySelectorAll("mark")??[];s(d.length),o(0);},50);return ()=>clearTimeout(i)},[t,e]),useEffect(()=>{if(!e.current||!t.trim())return;let i=Array.from(e.current.querySelectorAll("mark"));i.forEach((d,g)=>{let m=g===r;d.style.backgroundColor=m?Et:"transparent",d.style.outline=m?`1px solid ${Et}`:"none",d.style.borderRadius="2px";}),i[r]?.scrollIntoView({behavior:"smooth",block:"nearest"});},[r,n,t,e]);let l=useCallback(()=>{n!==0&&o(i=>(i+1)%n);},[n]),p=useCallback(()=>{n!==0&&o(i=>(i-1+n)%n);},[n]);return {currentIndex:r,totalCount:n,goNext:l,goPrev:p}}function Ot(e,t){return e==null?String(e).includes(t):typeof e=="string"?e.toLowerCase().includes(t):typeof e=="number"||typeof e=="boolean"?String(e).includes(t):false}function Vt(e,t){if(Array.isArray(e)){let r=e.map(o=>Vt(o,t)).filter(o=>o!=null);return r.length>0?r:null}return typeof e=="object"&&e!==null?Ht(e,t):Ot(e,t)?e:null}function Ht(e,t){let r={};for(let[o,n]of Object.entries(e))if(o.toLowerCase().includes(t))r[o]=n;else if(typeof n=="object"&&n!==null){let s=Vt(n,t);s!==null&&(r[o]=s);}else Ot(n,t)&&(r[o]=n);return Object.keys(r).length>0?r:null}function Ce(e,t){return t.trim()?Ht(e,t.toLowerCase()):e}var L=400,ne=.5;function q(e){let{containerRef:t}=useContext(M),{height:r$1,width:o}=a$1(),[n,s]=useState(false),l=t?.current,p=l?.clientWidth||o,i=l?.clientHeight||r$1;return jsx(r,{isOpen:true,onClose:e.onClose,containerRef:t,defaultWindowWidth:L,defaultWindowHeight:W,minHeight:300,windowZIndex:3,initialPosition:{x:p/2+L/4-e.index*20,y:i/2-W/2+e.index*30},windowProps:{mainAppOrder:e.windowOrder,mainAppIsMinimized:e.isWindowMinimized,overflow:"visible",titleBar:jsx(Co,{...e,isRequestShown:n,setIsRequestShown:s})},children:jsx(vo,{...e,isRequestShown:n})})}function Co({requestJson:e={},onClose:t,onJsonRequestOpen:r,isRequestShown:o,setIsRequestShown:n}){let{isMaximized:s,setIsMaximized:l,isToolbarAnimationDisabled:p,setIsToolbarAnimationDisabled:i,dimensions:d,updateSize:g}=useContext(a$2),{onMouseEnter:m,onMouseLeave:w,isHovered:x}=b(),b$1=d.width||L,S=Object.keys(e)?.length;return jsx(motion.div,{style:{...s&&{height:de,position:"fixed",zIndex:1e3}},animate:{width:o?b$1*2:b$1,...s&&{width:"100vw"},...!s&&{transform:`translateX(${o?-b$1:0}px)`}},transition:{duration:ne,...p&&{duration:0}},children:jsx(be,{title:o?"JSON Request & Response":"JSON Response",onClose:()=>t(),onMaximize:()=>{l(c=>!c),i(true),setTimeout(()=>{i(false);},ne*1e3);},isHovered:x,onMouseHover:m,onMouseLeave:w,maximized:s,id:"draggable-dialog-title",onRequestClick:()=>{n(c=>!c),i(false),o||(r?.(),g({width:L,height:W}));},isRequestExpanded:o,showRequestIcon:!!S})})}function vo({json:e,requestJson:t={},onJsonSearch:r,onJsonCopy:o,onJsonIdCopy:n,onJsonNodesMinimize:s,onJsonNodesMaximize:l,isRequestShown:p}){let{isMaximized:i,isToolbarAnimationDisabled:d,dimensions:g}=useContext(a$2),[m,w]=useState(false),[x,b]=useState(false),[S,c]=useState(true),[T,V]=useState(false),[u,N]=useState(""),[k,jt]=useState(""),Je=useRef(null),ke=useRef(null),F=te(Je,u),_=te(ke,k),qt=useMemo(()=>Object.keys(e)?.length,[e]),Pe=g.width||L,Be=v=>{setTimeout(()=>{navigator.clipboard.writeText(v||"").then(()=>{});},10);},Dt=useMemo(()=>Object.keys(t)?.length,[t]),Te=useMemo(()=>Ce(e,u),[e,u]),Ee=useMemo(()=>Ce(t,k),[t,k]);return jsx(Ze,{"data-testid":"JSONViewer",children:jsxs(Box,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",height:i?`calc(100vh - ${R}px)`:(g.height||W)-R+5,background:"transparent",position:"fixed",width:"100%"},children:[jsx(AnimatePresence,{children:p&&jsxs(motion.div,{initial:{left:i?"50vw":0,...i&&{position:"relative",left:"-50vw"}},animate:{left:i?"50vw":-Pe,...i&&{position:"relative",left:"0"},...!p&&{left:0}},exit:{left:i?"50vw":0,...i&&{position:"relative",left:"0"}},transition:{duration:ne,...d&&{duration:0}},ref:ke,style:{flex:1,backgroundColor:"#E7E7E7B2",backdropFilter:"blur(12px)",height:i?"100vh":"100%",overflowY:"auto",position:"absolute",width:i?"100vw":Pe,zIndex:19,display:"flex",flexDirection:"column",borderBottomLeftRadius:"12px"},onScroll:()=>{V(true),setTimeout(()=>{V(false);},2e3);},children:[jsxs(fe,{isMaximized:i,isScrollingRequest:T,sx:{background:"#E7E7E7B2"},isRequestShown:p,children:[jsx(he,{children:jsx(ue,{variant:"subtitle1",children:"API Request"})}),jsxs(ge,{children:[jsx(z,{value:k,onChange:jt,onOpen:()=>r?.(),currentIndex:_.currentIndex,totalCount:_.totalCount,onPrev:_.goPrev,onNext:_.goNext}),jsx(B,{disableAnimation:true,onClick:()=>{S?l?.():s?.(),c(v=>!v);},icon:S?ve:ue$1}),jsx(B,{onClick:()=>{o?.(),navigator.clipboard.writeText(JSON.stringify(t,null,2)).then(()=>{});},icon:sa}),jsx(B,{onClick:()=>{n?.(),navigator.clipboard.writeText(e?.id||"").then(()=>{});},icon:qa})]})]}),k.trim()&&Ee===null?jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(Typography,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsxs(C,{value:Ee??t,style:Ye,displayDataTypes:false,collapsed:k.trim()?void 0:S?1:void 0,onCopied:(v,I)=>{typeof I=="string"&&Be(I);},enableClipboard:false,children:[jsx(C.String,{render:ee(k)}),jsx(C.KeyName,{render:Z(k)}),jsx(C.CountInfo,{render:(v,{keyName:I})=>{if(!I)return jsx("span",{})}}),jsx(C.Copied,{render:$})]}),jsx(AnimatePresence,{children:p&&jsx(me,{sx:{flex:1,height:R,left:0},children:jsx(c$2,{sx:{paddingLeft:"12px",borderBottomRightRadius:"0",background:"#f8f9fb",flex:1},totalCount:Dt})})})]})}),jsxs(Ue,{ref:Je,isMaximized:i,isRequestShown:p,style:{left:0,maxHeight:"100vw"},initial:{...i&&{width:"100vw",left:0}},animate:{...i&&{position:"absolute",left:p?"50vw":"0"}},transition:{duration:ne,...d&&{duration:0}},onScroll:()=>{b(true),setTimeout(()=>{b(false);},2e3);},children:[jsxs(fe,{isMaximized:i,isScrollingRequest:x,isRequestShown:p,children:[jsx(he,{children:jsx(ue,{variant:"subtitle1",children:"API Response"})}),jsxs(ge,{children:[jsx(z,{value:u,onChange:N,onOpen:()=>r?.(),currentIndex:F.currentIndex,totalCount:F.totalCount,onPrev:F.goPrev,onNext:F.goNext}),jsx(B,{disableAnimation:true,onClick:()=>{m?l?.():s?.(),w(v=>!v);},icon:m?ve:ue$1}),jsx(B,{onClick:()=>{o?.(),navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{});},icon:sa}),jsx(B,{onClick:()=>{n?.(),navigator.clipboard.writeText(e?.id||"").then(()=>{});},icon:qa})]})]}),u.trim()&&Te===null?jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(Typography,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsxs(C,{value:Te??e,style:ce,displayDataTypes:false,collapsed:u.trim()?void 0:m?1:void 0,onCopied:(v,I)=>{typeof I=="string"&&Be(I);},children:[jsx(C.String,{render:ee(u)}),jsx(C.KeyName,{render:Z(u)}),jsx(C.CountInfo,{render:(v,{keyName:I})=>{if(!I)return jsx("span",{})}}),jsx(C.Copied,{render:$})]}),jsx(me,{sx:{flex:1,height:R},children:jsx(c$2,{sx:{borderBottomLeftRadius:p?0:"12px",background:"#f8f9fb",flex:1},totalCount:qt})})]})]})})}var Ro=({isWindowMinimized:e,windowOrder:t,...r})=>{let{handleJsonViewerDialogOpen:o,handleWindowMinimize:n,handleWindowOrder:s,registerJsonViewerEvents:l}=useContext(M),p=useCallback(()=>{n(e);},[n,e]),i=useCallback(()=>{s(t);},[s,t]);return useEffect(()=>{i();},[i]),useEffect(()=>{p();},[p]),useEffect(()=>{l(r);},[l,r]),{handleJsonViewerDialogOpen:o}};var Ar=q;export{B as a,z as b,E as c,be as d,M as e,Jt as f,wo as g,te as h,Ro as i,Ar as j};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-SSBDL6XS.js';import {j,b,n}from'./chunk-7PJX5ZKM.js';import {Vb,yc}from'./chunk-2SKLD6QR.js';import {Dj,Ej,Kj,Oe}from'./chunk-OK75VWGZ.js';import {forwardRef,useState,useImperativeHandle,useEffect,useMemo,memo,useId}from'react';import {Button}from'@mui/material';import p from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';import {useTranslation}from'react-i18next';import {useDropzone}from'react-dropzone';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var G=styled(p)(()=>({textAlign:"center",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"32px"})),u=styled(p)(()=>({paddingInline:"40px"})),d=styled(j,{shouldForwardProp:e=>e!=="isError"})(({theme:e,isError:i})=>({color:i?"#FF2000":e.v2.palette.base.black,fontSize:"18px",fontWeight:600,lineHeight:"20px",marginBottom:"8px"})),J=styled(p)(({theme:e})=>({color:e.palette.text.primary,fontSize:"12px",fontWeight:500,lineHeight:"20px",padding:"4px 12px",borderRadius:"4px",border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,cursor:"pointer"})),g=styled(j)(({theme:e})=>({color:alpha(e.v2.palette.base.black,.7),fontSize:"12px",fontWeight:500,lineHeight:"20px"})),F=styled(p,{shouldForwardProp:e=>e!=="width"})(({theme:e,width:i})=>({width:i||431,minHeight:176,border:`1px dashed ${e.palette.secondary.light}`,borderRadius:"8px",padding:"24px 0",display:"flex",alignItems:"center",justifyContent:"center"})),h=styled(p)(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"24px",color:e.palette.text.primary,fontSize:"14px",lineHeight:"20px",cursor:"default"})),K=styled("span")(()=>({fontWeight:600,textDecorationLine:"underline",cursor:"pointer"})),w=styled(p)(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px",color:e.palette.text.primary})),z=styled(p)(({theme:e})=>({color:alpha(e.palette.text.primary,.7),fontSize:"12px",fontWeight:500,lineHeight:"20px"})),O=styled(Button)(({theme:e,disabled:i})=>({borderRadius:"4px",minWidth:"105px",background:i?alpha(e.palette.info.dark,.4):e.palette.info.dark,color:e.palette.common.white,padding:"4px 8px",fontSize:"9px",fontWeight:600,height:"32px",display:"flex",alignItems:"center",justifyContent:"center",textTransform:"none","&:hover":{background:e.palette.info.dark,opacity:.8},"&.Mui-disabled":{color:e.palette.common.white}})),Q=styled(p)(()=>({display:"flex",gap:"8px",justifyContent:"center",alignItems:"center",padding:"6px",boxShadow:"0px 4px 40px 0px rgba(0, 0, 0, 0.19)",borderRadius:"4px"}));var Y=forwardRef(({accept:e,footer:i,options:x,isCreateLoading:U,progress:oe,error:R,errorHint:te,subtitleComponent:S,isSuccess:P,onConfirm:re,isSendDisabled:ie,errorActionComponent:le,title:l,width:b$1,successFooter:pe,progressVariant:ae},ne)=>{let{t:a$1}=useTranslation(),[n$1,H]=useState([]),{getRootProps:de,getInputProps:se,open:f,acceptedFiles:v,isDragReject:j,fileRejections:s}=useDropzone(x);useImperativeHandle(ne,()=>({open:f}),[f]),useEffect(()=>{H(v);},[v]);let B=Vb(x?.maxSize||0,0).toUpperCase(),m=useMemo(()=>{let me=s.length&&s[0].errors.some(k=>k.code==="file-invalid-type"),ce=s.length&&s[0].errors.some(k=>k.code==="file-too-large");return j||me?a$1("invalidFileType"):ce?`File is larger than ${B}`:R},[j,R,s,B,a$1]),C=useMemo(()=>n$1.length?jsxs(w,{sx:{fontWeight:600},children:[jsx(p,{children:n$1[0].name}),jsx(z,{children:Vb(n$1[0].size)})]}):null,[n$1]);return P&&n$1.length&&!U?jsxs(Fragment,{children:[jsxs(u,{children:[typeof l=="string"?jsx(d,{children:l}):l??jsx(d,{children:"File uploaded"}),S]}),jsx(F,{width:b$1,children:jsxs(h,{children:[P&&jsx(p,{component:"img",src:Dj,width:56,height:56}),C]})}),pe??jsxs(Q,{children:[jsx(b,{variant:"secondary",size:"md",icon:jsx(a,{src:Ej,alt:"delete"}),onClick:()=>{H([]);},"aria-label":"delete"}),jsx(O,{disabled:ie,onClick:()=>{re?.(n$1);},children:"Bulk Send"})]})]}):U&&n$1.length?jsxs(Fragment,{children:[jsxs(u,{children:[l&&typeof l!="string"?l:jsxs(Fragment,{children:[jsx(d,{children:l??a$1("uploading")}),jsx(g,{children:a$1("wait")})]}),S]}),jsx(F,{width:b$1,children:jsxs(h,{children:[U&&jsx(n,{size:56,value:oe,variant:ae??"determinate"}),C]})}),i]}):jsxs(Fragment,{children:[jsxs(u,{children:[m?jsx(d,{isError:true,children:m}):typeof l=="string"?jsx(d,{children:l}):l??jsx(d,{children:a$1("uploadBulkFile")}),S||!!m&&jsx(g,{children:"Supported formats: xls, xlxs"})]}),jsxs(F,{width:b$1,...de(),children:[jsx("input",{...se()}),jsxs(h,{"data-slot":"content",children:[jsx(p,{component:"img",src:m?Kj:Oe,width:56,height:56}),te,C,m?jsx(Fragment,{children:le||jsx(J,{onClick:f,children:a$1("uploadAgain")})}):jsxs(w,{children:[jsxs(p,{children:[jsx(K,{onClick:f,children:"Click to upload"})," or drag and drop"]}),jsxs(z,{children:["Maximum file size ",B]}),e&&jsx(g,{children:a$1("supportedFormats",{accept:e})})]})]})]}),i]})});Y.displayName="FileUploadBase";var Z=memo(Y);var L=forwardRef((e,i)=>{let x=yc(useId(),"file-upload");return jsx(G,{id:x,"data-testid":"FileUpload","data-slot":"file-upload-wrapper",children:jsx(Z,{...e,ref:i})})});L.displayName="FileUpload";var ee=memo(L);var Qe=ee;export{Qe as a};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-LOQ3FEOU.js';import {d}from'./chunk-HP62XFCT.js';import {yc}from'./chunk-2SKLD6QR.js';import {memo,useState,useId}from'react';import l from'@mui/material/Box';import {styled}from'@mui/material/styles';import {motion}from'framer-motion';import {jsx}from'react/jsx-runtime';var c=styled(motion.div)(({theme:o})=>({borderRadius:"8px",position:"fixed",display:"flex",flexDirection:"column",maxHeight:"calc(100vh - 46px)",width:416,margin:"auto",background:o.palette.grey[400],boxShadow:o.shadows[3]})),C=styled(l)(({theme:o})=>({background:o.palette.common.white,flex:1,paddingTop:"31px",paddingBottom:"31px",display:"flex",justifyContent:"flex-start",alignItems:"center",flexDirection:"column",position:"relative",overflow:"auto"})),b=styled(l)(({theme:o})=>({minHeight:95,background:o.palette.grey[400],paddingInline:"24px",paddingTop:"23px",paddingBottom:"23px",gap:"15px",position:"relative",zIndex:2})),h=styled(l)(({theme:o})=>({display:"flex",flexDirection:"column",padding:"18px 24px",boxShadow:o.shadows[15],position:"relative",gap:8,minHeight:68,backgroundColor:o.palette.common.white,borderBottomLeftRadius:"12px",borderBottomRightRadius:"12px"}));function p({children:o,index:e,dialogRef:a,height:t,onClick:r,order:s,dragControls:d,style:m}){let n=yc(useId(),"dialog");return jsx(c,{id:n,"data-testid":"Dialog",drag:true,dragListener:false,dragMomentum:false,dragControls:d,initial:{top:"50%",left:`calc(50% + ${e*10}px - ${416/2}px)`},transition:{duration:.1},animate:{...t&&{top:`calc(50% + ${e*10}px - ${t/2}px)`},zIndex:2+s},onClick:r,ref:a,style:m,children:o})}function L({title:o,onCloseDialog:e,...a$1}){let[t,r]=useState(false);return jsx(d,{onMouseEnter:()=>{r(true);},onMouseLeave:()=>{r(false);},isHovered:t,title:o,leftActions:jsx(a,{onClick:n=>{n.stopPropagation(),e();}}),...a$1})}var M=memo(L);var K=p;export{C as a,b,h as c,M as d,K as e};
@@ -1 +1 @@
1
- import {c,d}from'./chunk-HP62XFCT.js';import {a,c as c$1,d as d$1}from'./chunk-LOQ3FEOU.js';import {b,a as a$1}from'./chunk-EDZWCPS2.js';import {yc,xa}from'./chunk-2SKLD6QR.js';import {Gf}from'./chunk-OK75VWGZ.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 nt from'@mui/material/Box';import {Resizable}from're-resizable';import st from'react-draggable';import {motion}from'framer-motion';var Y=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,resizableRef:{current:null},updateRefSize:()=>{},updateSize:()=>{},containerRef:{current:null}});var Oe=555,Ve=545;function Q({children:e,isOpen:t,onClose:i,defaultWindowHeight:r,defaultWindowWidth:n,initialPosition:l,minWidth:u,maxWidth:a,minHeight:s,maxHeight:d,containerRef:m,windowZIndex:f=1}){let{height:c,width:E}=a$1(),[o,k]=useState(false),L=o?null:m?.current,y=L?.clientWidth||E,h=L?.clientHeight||c,I=n||Oe,g=r||Ve,[v,_]=useState({x:l?.x??y/2+I/2,y:l?.y??h/2-g/2}),[W,z]=useState(false),[T,D]=useState(false),[C,w]=useState(true),H=useRef(),[F,P]=useState({width:n??0,height:r??0}),G=useCallback(b=>{H?.current?.updateSize(b);},[]),O=useCallback(b=>{H.current?.updateSize(b),P(p=>({width:b.width??p.width,height:b.height??p.height}));},[]),J=useMemo(()=>({position:v,setPosition:_,resizableRef:H,windowZIndex:f,isOpen:t,setIsMaximized:k,setIsSidebarExpanded:w,setIsToolbarAnimationDisabled:D,setIsResized:z,isMaximized:o,isToolbarAnimationDisabled:T,isSidebarExpanded:C,isResized:W,dimensions:F,setNewDimensions:P,viewerDefaultWidth:I,viewerDefaultHeight:g,onClose:i,fullWindowWidth:y,fullWindowHeight:h,updateRefSize:G,updateSize:O,minWidth:u,maxWidth:a,minHeight:s,maxHeight:d,containerRef:m}),[v,_,H,t,k,w,D,z,o,T,C,W,F,P,y,h,I,g,G,O,i,u,a,s,d,m,f]);return jsx(Y.Provider,{value:J,children:e})}var xe=(e,t)=>t.toLowerCase().includes(e);function he(e,t,i){let r=xe("top",t),n=xe("left",t);return !r&&!n?null:{x:n?e.x+i.width:e.x,y:r?e.y-i.height:e.y}}var S=.5,we=183,be=287,ge=840,We=545,ee=35;function Xe({title:e,onClose:t,onMaximize:i,maximized:r=false,id:n,onRequestClick:l,isSidebarExpanded:u=false,isHovered:a$1=false,onMouseHover:s,onMouseLeave:d$2,showSectionsButton:m,rightActions:f,icon:c$2}){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:c$2||Gf,leftActions:jsxs(Fragment,{children:[jsx(a,{onClick:t}),jsx(c$1,{isMaximized:r,onClick:i}),m&&jsx(d$1,{onClick:l,isExpanded:!u,isHovered:a$1,children:"Sidebar"})]}),rightActions:f})})}var ye=memo(Xe);var te=ye;function Ze({isMaximized:e,setIsToolbarAnimationDisabled:t,setIsMaximized:i,onClose:r,isSidebarExpanded:n,setIsSidebarExpanded:l,isToolbarAnimationDisabled:u,title:a,showSectionsButton:s,rightActions:d,icon:m}){let{isHovered:f,onMouseEnter:c,onMouseLeave:E}=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,...u&&{duration:0}},children:jsx(te,{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),l(!n);},isSidebarExpanded:n,isHovered:f,onMouseHover:c,onMouseLeave:E,rightActions:d,icon:m})})}var Ae=memo(Ze);var Re=Ae;function dt({children:e,titleBar:t,titleBarText:i,mainAppOrder:r,mainAppIsMinimized:n,showSectionsButton:l=true,rightActions:u,titleBarIcon:a,overflow:s="hidden"}){let d=useRef(null),m=yc(useId(),"app-window"),{dimensions:f,position:c,resizableRef:E,isMaximized:o,isOpen:k,onClose:L,viewerDefaultWidth:y,viewerDefaultHeight:h,windowZIndex:I,setPosition:g,setNewDimensions:v,isToolbarAnimationDisabled:_,fullWindowWidth:W,fullWindowHeight:z,setIsMaximized:T,setIsResized:D,isResized:C,setIsToolbarAnimationDisabled:w,setIsSidebarExpanded:H,isSidebarExpanded:F,minWidth:P,maxWidth:G,minHeight:O,maxHeight:J,containerRef:b}=useContext(Y),p=useMemo(()=>document.createElement("div"),[]),[Pe,Be]=useState(null);useLayoutEffect(()=>{Be(b?.current??document.body);},[b]);let x=o?document.body:Pe;useLayoutEffect(()=>{if(!x)return;let A=x===document.body;return p.style.position=A?"":"absolute",p.style.inset=A?"":"0",p.style.pointerEvents="none",p.style.overflow="visible",x.appendChild(p),()=>{p.parentNode===x&&x.removeChild(p);}},[x,p]);let ne=useRef({x:0,y:0}),ae=xa(),Me=useCallback((A,N,se,Le)=>{D(true),v({width:se.offsetWidth,height:se.offsetHeight});let de=he(ne.current,N,Le);de&&g(de);},[v,D,g]),V=f.width||y;if(!x)return null;let ke=jsx(st,{nodeRef:d,disabled:o,handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]',defaultClassName:"draggable-lead-dialog",defaultPosition:{x:W/2-V/2,y:z/2-h/2},position:{x:W-c.x,y:c.y},onStop:(A,N)=>{g({x:W-N.x,y:N.y});},...x===document.body&&{bounds:{top:10}},children:jsx(Dialog,{ref:d,sx:{backgroundColor:"transparent",pointerEvents:"none",zIndex:Number(r||0)+I+(o?1:0),...n&&{display:"none"},...x===document.body?!o&&{transform:"translate(180px, 14px)"}:!o&&{position:"absolute"},...!o&&{width:ae?V:"fit-content",height:ae?h:"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:C?"fit-content":V,height:C?"fit-content":"100%",...o&&{width:"100%",height:"100%"},position:"relative"}},onClose:()=>{T(false),w(true),setTimeout(()=>{w(false);},.5*1e3);},open:k,hideBackdrop:true,disableEnforceFocus:true,disableScrollLock:true,container:p,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:J??z-40,maxWidth:G??W,minWidth:o?"100vw":P??y,minHeight:o?"100vh":O??h,ref:A=>{E.current=A;},onResizeStart:()=>{ne.current=c,w(true);},onResizeStop:()=>{w(false);},onResize:Me,defaultSize:{width:V,height:h},style:{background:"transparent",height:f.height,overflow:s,...o&&{height:"100% !important",width:"100% !important",flex:1},...o&&{position:"relative"}},children:jsxs(nt,{sx:{height:"100%"},id:m,"data-testid":"AppWindow",children:[t??jsx(Re,{setIsToolbarAnimationDisabled:w,onClose:L,setIsMaximized:T,isToolbarAnimationDisabled:_,setIsSidebarExpanded:H,isSidebarExpanded:F,title:i,isMaximized:o,showSectionsButton:l,rightActions:u,icon:a}),e]})})})});return createPortal(ke,p)}var Ie=memo(dt);var ut=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"})),mt=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}})),ft=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})})),ct=styled(Box)(()=>({position:"fixed",height:35,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"})),xt=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 ie=Ie;function ht({children:e,windowProps:t,...i}){return i.isOpen?jsx(Q,{...i,children:jsx(ie,{...t,children:e})}):null}var Te=ht;function bt({title:e,maximized:t=false,id:i,isHovered:r=false,onMouseHover:n,onMouseLeave:l,leftActions:u,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:l,isMaximized:t,isHovered:r,title:e||"",icon:a,leftActions:u})})}var re=memo(bt);function yt({isMaximized:e,id:t,isToolbarAnimationDisabled:i,title:r,leftActions:n,onClose:l,onMaximize:u,sx:a$1}){let{isHovered:s,onMouseEnter:d,onMouseLeave:m}=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(re,{title:r,maximized:e,id:t||"draggable-dialog-title",isHovered:s,onMouseHover:d,onMouseLeave:m,leftActions:n||jsxs(Fragment,{children:[jsx(a,{onClick:l}),jsx(c$1,{isMaximized:e,onClick:()=>u?.(!e)})]}),sx:a$1})})}var Ce=memo(yt);var Rt=Ce;var Vo=Te;export{Y as a,Q as b,S as c,we as d,be as e,ge as f,We as g,ee as h,te as i,ut as j,mt as k,ft as l,ct as m,xt as n,ie as o,re as p,Rt as q,Vo as r};
1
+ import {a,c as c$1,d as d$1}from'./chunk-LOQ3FEOU.js';import {c,d}from'./chunk-HP62XFCT.js';import {b,a as a$1}from'./chunk-EDZWCPS2.js';import {yc,xa}from'./chunk-2SKLD6QR.js';import {Gf}from'./chunk-OK75VWGZ.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 nt from'@mui/material/Box';import {Resizable}from're-resizable';import st from'react-draggable';import {motion}from'framer-motion';var Y=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,resizableRef:{current:null},updateRefSize:()=>{},updateSize:()=>{},containerRef:{current:null}});var Oe=555,Ve=545;function Q({children:e,isOpen:t,onClose:i,defaultWindowHeight:r,defaultWindowWidth:n,initialPosition:l,minWidth:u,maxWidth:a,minHeight:s,maxHeight:d,containerRef:m,windowZIndex:f=1}){let{height:c,width:E}=a$1(),[o,k]=useState(false),L=o?null:m?.current,y=L?.clientWidth||E,h=L?.clientHeight||c,I=n||Oe,g=r||Ve,[v,_]=useState({x:l?.x??y/2+I/2,y:l?.y??h/2-g/2}),[W,z]=useState(false),[T,D]=useState(false),[C,w]=useState(true),H=useRef(),[F,P]=useState({width:n??0,height:r??0}),G=useCallback(b=>{H?.current?.updateSize(b);},[]),O=useCallback(b=>{H.current?.updateSize(b),P(p=>({width:b.width??p.width,height:b.height??p.height}));},[]),J=useMemo(()=>({position:v,setPosition:_,resizableRef:H,windowZIndex:f,isOpen:t,setIsMaximized:k,setIsSidebarExpanded:w,setIsToolbarAnimationDisabled:D,setIsResized:z,isMaximized:o,isToolbarAnimationDisabled:T,isSidebarExpanded:C,isResized:W,dimensions:F,setNewDimensions:P,viewerDefaultWidth:I,viewerDefaultHeight:g,onClose:i,fullWindowWidth:y,fullWindowHeight:h,updateRefSize:G,updateSize:O,minWidth:u,maxWidth:a,minHeight:s,maxHeight:d,containerRef:m}),[v,_,H,t,k,w,D,z,o,T,C,W,F,P,y,h,I,g,G,O,i,u,a,s,d,m,f]);return jsx(Y.Provider,{value:J,children:e})}var xe=(e,t)=>t.toLowerCase().includes(e);function he(e,t,i){let r=xe("top",t),n=xe("left",t);return !r&&!n?null:{x:n?e.x+i.width:e.x,y:r?e.y-i.height:e.y}}var S=.5,we=183,be=287,ge=840,We=545,ee=35;function Xe({title:e,onClose:t,onMaximize:i,maximized:r=false,id:n,onRequestClick:l,isSidebarExpanded:u=false,isHovered:a$1=false,onMouseHover:s,onMouseLeave:d$2,showSectionsButton:m,rightActions:f,icon:c$2}){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:c$2||Gf,leftActions:jsxs(Fragment,{children:[jsx(a,{onClick:t}),jsx(c$1,{isMaximized:r,onClick:i}),m&&jsx(d$1,{onClick:l,isExpanded:!u,isHovered:a$1,children:"Sidebar"})]}),rightActions:f})})}var ye=memo(Xe);var te=ye;function Ze({isMaximized:e,setIsToolbarAnimationDisabled:t,setIsMaximized:i,onClose:r,isSidebarExpanded:n,setIsSidebarExpanded:l,isToolbarAnimationDisabled:u,title:a,showSectionsButton:s,rightActions:d,icon:m}){let{isHovered:f,onMouseEnter:c,onMouseLeave:E}=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,...u&&{duration:0}},children:jsx(te,{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),l(!n);},isSidebarExpanded:n,isHovered:f,onMouseHover:c,onMouseLeave:E,rightActions:d,icon:m})})}var Ae=memo(Ze);var Re=Ae;function dt({children:e,titleBar:t,titleBarText:i,mainAppOrder:r,mainAppIsMinimized:n,showSectionsButton:l=true,rightActions:u,titleBarIcon:a,overflow:s="hidden"}){let d=useRef(null),m=yc(useId(),"app-window"),{dimensions:f,position:c,resizableRef:E,isMaximized:o,isOpen:k,onClose:L,viewerDefaultWidth:y,viewerDefaultHeight:h,windowZIndex:I,setPosition:g,setNewDimensions:v,isToolbarAnimationDisabled:_,fullWindowWidth:W,fullWindowHeight:z,setIsMaximized:T,setIsResized:D,isResized:C,setIsToolbarAnimationDisabled:w,setIsSidebarExpanded:H,isSidebarExpanded:F,minWidth:P,maxWidth:G,minHeight:O,maxHeight:J,containerRef:b}=useContext(Y),p=useMemo(()=>document.createElement("div"),[]),[Pe,Be]=useState(null);useLayoutEffect(()=>{Be(b?.current??document.body);},[b]);let x=o?document.body:Pe;useLayoutEffect(()=>{if(!x)return;let A=x===document.body;return p.style.position=A?"":"absolute",p.style.inset=A?"":"0",p.style.pointerEvents="none",p.style.overflow="visible",x.appendChild(p),()=>{p.parentNode===x&&x.removeChild(p);}},[x,p]);let ne=useRef({x:0,y:0}),ae=xa(),Me=useCallback((A,N,se,Le)=>{D(true),v({width:se.offsetWidth,height:se.offsetHeight});let de=he(ne.current,N,Le);de&&g(de);},[v,D,g]),V=f.width||y;if(!x)return null;let ke=jsx(st,{nodeRef:d,disabled:o,handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]',defaultClassName:"draggable-lead-dialog",defaultPosition:{x:W/2-V/2,y:z/2-h/2},position:{x:W-c.x,y:c.y},onStop:(A,N)=>{g({x:W-N.x,y:N.y});},...x===document.body&&{bounds:{top:10}},children:jsx(Dialog,{ref:d,sx:{backgroundColor:"transparent",pointerEvents:"none",zIndex:Number(r||0)+I+(o?1:0),...n&&{display:"none"},...x===document.body?!o&&{transform:"translate(180px, 14px)"}:!o&&{position:"absolute"},...!o&&{width:ae?V:"fit-content",height:ae?h:"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:C?"fit-content":V,height:C?"fit-content":"100%",...o&&{width:"100%",height:"100%"},position:"relative"}},onClose:()=>{T(false),w(true),setTimeout(()=>{w(false);},.5*1e3);},open:k,hideBackdrop:true,disableEnforceFocus:true,disableScrollLock:true,container:p,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:J??z-40,maxWidth:G??W,minWidth:o?"100vw":P??y,minHeight:o?"100vh":O??h,ref:A=>{E.current=A;},onResizeStart:()=>{ne.current=c,w(true);},onResizeStop:()=>{w(false);},onResize:Me,defaultSize:{width:V,height:h},style:{background:"transparent",height:f.height,overflow:s,...o&&{height:"100% !important",width:"100% !important",flex:1},...o&&{position:"relative"}},children:jsxs(nt,{sx:{height:"100%"},id:m,"data-testid":"AppWindow",children:[t??jsx(Re,{setIsToolbarAnimationDisabled:w,onClose:L,setIsMaximized:T,isToolbarAnimationDisabled:_,setIsSidebarExpanded:H,isSidebarExpanded:F,title:i,isMaximized:o,showSectionsButton:l,rightActions:u,icon:a}),e]})})})});return createPortal(ke,p)}var Ie=memo(dt);var ut=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"})),mt=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}})),ft=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})})),ct=styled(Box)(()=>({position:"fixed",height:35,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"})),xt=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 ie=Ie;function ht({children:e,windowProps:t,...i}){return i.isOpen?jsx(Q,{...i,children:jsx(ie,{...t,children:e})}):null}var Te=ht;function bt({title:e,maximized:t=false,id:i,isHovered:r=false,onMouseHover:n,onMouseLeave:l,leftActions:u,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:l,isMaximized:t,isHovered:r,title:e||"",icon:a,leftActions:u})})}var re=memo(bt);function yt({isMaximized:e,id:t,isToolbarAnimationDisabled:i,title:r,leftActions:n,onClose:l,onMaximize:u,sx:a$1}){let{isHovered:s,onMouseEnter:d,onMouseLeave:m}=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(re,{title:r,maximized:e,id:t||"draggable-dialog-title",isHovered:s,onMouseHover:d,onMouseLeave:m,leftActions:n||jsxs(Fragment,{children:[jsx(a,{onClick:l}),jsx(c$1,{isMaximized:e,onClick:()=>u?.(!e)})]}),sx:a$1})})}var Ce=memo(yt);var Rt=Ce;var Vo=Te;export{Y as a,Q as b,S as c,we as d,be as e,ge as f,We as g,ee as h,te as i,ut as j,mt as k,ft as l,ct as m,xt as n,ie as o,re as p,Rt as q,Vo as r};
@@ -1 +1 @@
1
- import {f,b as b$1,g,a as a$2,e,d,c as c$1}from'./chunk-SLPI5KKB.js';import {a as a$4}from'./chunk-4Z2TQN2P.js';import {a as a$1}from'./chunk-SSBDL6XS.js';import {c}from'./chunk-DPRSHIL7.js';import {o,j as j$1,k,l,p as p$1}from'./chunk-ZMJUHXHX.js';import {a}from'./chunk-ZONDSLTR.js';import {b}from'./chunk-4X43KBH2.js';import {a as a$3}from'./chunk-MQFXJL5S.js';import {p,z}from'./chunk-7PJX5ZKM.js';import {Va,yc,Ha,Ia,bc,f as f$1}from'./chunk-2SKLD6QR.js';import {s}from'./chunk-FH3OCBAM.js';import {T,yi,Ai,zi,xi,Ei,ch,Vg,bh,Rj,Sj,tb,gk,jk,Ak,hk,ub,va,ua,sk,h,Ug}from'./chunk-OK75VWGZ.js';import {useId,useMemo,useCallback}from'react';import {useTranslation}from'react-i18next';import {styled,Box,useTheme}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {motion}from'framer-motion';import {styled as styled$1,useTheme as useTheme$1}from'@mui/material/styles';import _ from'lodash/camelCase';import Qe from'@mui/material/Box';var lt={ORDER:{label:"order",icon:xi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:zi,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:Ai,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:yi,color:"#32ADE6"}},dt={SAVED_TOKEN:{label:"savedToken",icon:T,color:"#76BB40"},COUNT:{label:"countBadge",icon:"countBadge",color:"#76BB40"}};styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5)}));styled("img")(()=>({width:"35px",height:"16px",display:"block"}));styled("span")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"14.67px",height:"10px"}));styled("img")(()=>({maxWidth:"100%",width:"100%"}));var ct=styled("span")(({theme:t})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:t.palette.text.primary})),mt=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"}));function Ie({type:t,hasSavedCard:o,totalPaymentsCount:e,isTextShown:r}){let l=yc(useId(),"agreement-icon"),p$1=useTheme(),{t:a$2}=useTranslation(),n=useMemo(()=>[...o?[dt.SAVED_TOKEN]:[],...(e||0)>0?[dt.COUNT]:[],...t&&lt[t]?[lt[t]]:[]],[o,e,t]),d=c=>r?jsx(a,{"data-testid":"AgreementCell_countBadge",children:jsx(p,{title:a$2("totalPaymentCount",{amount:f$1(e)}),children:jsx(mt,{children:jsxs(ct,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:dt.COUNT.color},children:["x",e]})})})},c):jsx(a$4,{value:e,index:c},c),s=n.map((c,g)=>c.label==="countBadge"?d(g):jsx(p,{title:a$2(c.label),children:jsx(a,{children:r?jsx(mt,{children:jsx(ct,{"data-testid":"AgreementCell_agreementType",sx:{color:c.color},children:a$2(c.label)})}):jsx(a$1,{sx:{maxWidth:"16px",maxHeight:"16px",height:"auto",width:"auto"},src:c.icon,alt:"agreement"})},c.color)},c.color)),f=jsx(p,{title:"No agreement",children:jsx(a,{children:r?jsx(mt,{children:jsx(ct,{"data-testid":"AgreementCell_agreementType",sx:{color:p$1.palette.text.secondary},children:"No agreement"})}):jsx(a$1,{sx:{maxWidth:"24px",maxHeight:"24px",height:"auto",width:"auto"},src:Ei,alt:"agreement"})},"no-agreement")},"no-agreement");return jsx(Box,{id:l,"data-testid":"AgreementIcon",sx:{display:"flex",alignItems:"center",gap:"4px"},children:s?.length>0?s:f})}var To=Ie;var Ce=To;styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"}));styled(motion.span,{shouldForwardProp:t=>t!=="sourcesCount"})(({theme:t,sourcesCount:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${o*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:t.palette.background.paper,borderRadius:"16px"}));var Ao=styled("span")(({theme:t})=>({fontSize:"11px",padding:"2px 0",color:t.palette.text.primary})),Po=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px",textAlign:"center",width:"100%"}));styled("span")(({theme:t})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));styled(motion.div)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));var Wo=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px"}));var kt={"3DS":{tooltip:"3DS",icon:Sj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Rj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:bh,borderColor:"rgba(31, 136, 208, 0.10)"}},vo={FAILED:{tooltip:"Failed",icon:Vg,borderColor:"rgba(255, 61, 0, 0.10)"},REJECTED:{tooltip:"Rejected",icon:ch,borderColor:"rgba(255, 61, 0, 0.10)"}};function be({transactionStatus:t,eci:o,authType:e,isTextShown:r}){let l=yc(useId(),"auth-icons"),p$1=useMemo(()=>{let n=t?vo[t]:null,d=n?.tooltip,s=t==="AUTHENTICATED"?null:n?.icon;return [{tooltip:d,content:r?d:s,type:r?"text":"icon"},...e?[{tooltip:e,content:r?kt[e]?.tooltip:kt[e]?.icon,type:r?"text":"icon"}]:[],{tooltip:"",content:o?`ECI ${o}`:"",type:"text"}]},[t,r,e,o]),a=useMemo(()=>p$1.filter(n=>!!n.content).map((n,d)=>{let s=n.type==="text"?jsx(Po,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(Ao,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":n.content,children:n.content})}):jsx(a$1,{sx:{width:"16px",height:"16px"},src:n.content,alt:n.tooltip});return jsx(p,{title:n.tooltip,children:s},`${n.tooltip}-${d}`)}),[p$1]);return jsx(Wo,{id:l,"data-testid":"AuthIcons",children:a})}var ko=be;var Se=(t,o,e)=>({start:{x:t*6,transition:{duration:.3,type:"tween",ease:"easeIn"},...t>0&&{opacity:0}},animate:{x:e?t*e:t*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:o,...t>0&&{opacity:1}}});var Te=ko;var tt={VOID:{icon:hk},CAPTURED:{icon:gk}};var ut=styled$1(motion.div)(({theme:t,isCapture:o})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:t.spacing(.5),paddingInline:t.spacing(.3),paddingBlock:t.spacing(.3),height:"100%",minWidth:"100%",backgroundColor:o?"#eaf3fb":"#eeeeee",borderRadius:"56px",width:"fit-content",fontSize:"10px",color:t.palette.text.primary,position:"relative",zIndex:10})),ft=styled$1("div")(({theme:t,percentage:o,isCapture:e})=>({border:`0.6px ${[0,100].includes(o)?"solid":"dashed"} ${e?t.palette.info.dark:"#656565"}`,borderRadius:"80px",padding:t.spacing(.316),paddingLeft:t.spacing(.516),fontSize:"7px",fontWeight:t.typography.fontWeightBold,color:e?t.palette.info.dark:"#656565",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5)})),xt=styled$1("div")(({percentage:t,isCapture:o,theme:e})=>({background:`conic-gradient(${o?e.palette.info.dark:"#656565"} ${t}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${o?e.palette.info.dark:"#656565"}`})),gt=styled$1("img")({width:"14px",height:"14px"}),j=styled$1(o)({width:"16px",height:"16px"}),N=styled$1("img")({width:"16px",height:"16px"}),Bo=styled$1(Box)({display:"flex",alignItems:"center",justifyContent:"center"});function It(t){return t<5?5:t===100?95:t}function Be({voidPercentage:t,capturePercentage:o,captureCount:e,autoType:r,captureAmount:l,voidAmount:p$1,currency:a,isTextShown:n,remainingAmount:d,isSheetViewShown:s,selectionProps:f={}}){let c=Number(o)+Number(t)===100||d<=0,g=yc(useId(),"capture-auto-icon"),T=useTheme$1(),{t:A}=useTranslation(),P=Ha(d||0),L=useCallback(C=>`Auto ${C} - ${a} ${P.integerAmount}.${P.decimalAmount}`,[a,P.decimalAmount,P.integerAmount]),J=useCallback(C=>{let X=C==="Capture"?l:p$1,{integerAmount:D,decimalAmount:v}=Ia(X,a);return `Partial ${C} - ${a} ${D}.${v}`},[l,p$1,a]),x=o>0?jsx(p,{title:J("Capture"),children:jsxs(ut,{isCapture:true,isFullyUsed:c,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:T.shadows[4]}},children:[jsx(gt,{src:tb,alt:"captured"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(ft,{isCapture:true,percentage:o,children:[o,"% ",jsx(xt,{isCapture:true,percentage:It(o)})]}),e>1&&jsxs(z,{compact:true,color:"dark",children:[e,"x"]})]})]})}):r==="CAPTURED"&&!c?jsx(p,{title:L("Capture"),children:jsx(j,{children:jsx(N,{src:tt.CAPTURED?.icon,alt:"auto"})})}):jsx(p,{title:L("Capture"),children:jsx(j,{children:jsx(N,{src:tt.CAPTURED?.icon,alt:"auto"})})}),I=o===100?jsx(p,{title:A("captured"),children:jsx(Bo,{children:jsx(N,{src:jk,alt:"captured"})})}):x,W=useMemo(()=>s&&I?jsx(b,{chipIndex:4,copyText:A("captured"),selectionProps:f,children:A("captured")}):n&&I?jsx(k,{children:A("captured")}):I,[n,I,s,f]);return W&&jsx("div",{id:g,"data-testid":"CaptureAutoIcon",style:{zIndex:12},children:W})}var Do=Be;function Ve({voidPercentage:t,capturePercentage:o,voidCount:e,autoType:r,captureAmount:l$1,voidAmount:p$1,currency:a,isTextShown:n,isSheetViewShown:d,selectionProps:s={},remainingAmount:f}){let c=Number(o)+Number(t)===100||f<=0,g=yc(useId(),"void-auto-icon"),T=useTheme$1(),{t:A}=useTranslation(),P=Ha(f||0),L=useCallback(C=>`Auto ${C} - ${a} ${P.integerAmount}.${P.decimalAmount}`,[a,P.decimalAmount,P.integerAmount]),J=useCallback(C=>{let X=C==="Capture"?l$1:p$1,{integerAmount:D,decimalAmount:v}=Ia(X,a);return `Partial ${C} - ${a} ${D}.${v}`},[l$1,p$1,a]),x=t>0||p$1?jsx(p,{title:J("Void"),children:jsxs(ut,{isFullyUsed:c,whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:14,background:T.palette.common.white,border:`0.75px solid ${T.palette.grey[600]}1A`},variants:{animate:{boxShadow:T.shadows[4]}},children:[jsx(gt,{src:Ak,alt:"void"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(ft,{percentage:t,children:[t,"% ",jsx(xt,{percentage:It(t)})]}),e>0&&jsxs(z,{compact:true,color:"neutral",children:[e,"x"]})]})]})}):r==="VOID"&&!c?jsx(p,{title:L("Void"),children:jsx(j,{children:jsx(N,{src:tt.VOID?.icon,alt:"auto"})})}):null,I=t===100?jsx(p,{title:A("void"),children:jsx(j,{children:jsx(N,{src:Ak,alt:"void"})})}):x,W=useMemo(()=>d&&I?jsx(b,{chipIndex:5,copyText:A("void"),selectionProps:s,children:A("void")}):n&&I?jsx(l,{children:A("void")}):I,[n,I,d,s]);return W?jsx("div",{id:g,"data-testid":"VoidAutoIcon",style:{...!d&&{zIndex:11}},children:W}):null}var $o=Ve;var Me=Do;var Fe=({authorizedStatus:t,isTextShown:o,iconStyles:e,tableMode:r,chipIndex:l=0,selectionProps:p$1={}})=>{let{t:a}=useTranslation(),n=useTheme$1(),d=a(_(t));return Va(r)?jsx(b,{copyText:d,chipIndex:l,selectionProps:p$1,children:d}):jsx(p,{title:d,children:o?jsx(j$1,{"data-testid":"StatusCell_AuthorizedStatusLabel",sx:{color:n.palette.info.dark},children:d}):jsx(a$1,{src:f[t],alt:"authorized-icon","data-testid":"StatusCell_AuthorizedStatusIcon",sx:e})})};var _o=styled$1(motion.span)(({theme:t})=>({color:t.palette.common.white,display:"block",fontWeight:t.typography.fontWeightBold,fontSize:"9.78px",borderRadius:"4px",paddingInline:t.spacing(.45)})),Vo=styled$1(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"})),Bt=styled$1("img")(()=>({width:"10px",height:"10px"})),Lt=styled$1(motion.span)(({theme:t})=>({width:"18px",height:"18px",borderRadius:"50%",backgroundColor:t.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,position:"relative"})),Dt=styled$1(motion.div,{shouldForwardProp:t=>t!=="isVisible"})(({isVisible:t})=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",width:"0",overflow:"hidden",opacity:0,...!t&&{padding:"0 !important"}})),Mo=styled$1(motion.div)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"})),zo=styled$1(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),No={delay:.2,ease:"easeIn",fadeIn:{duration:.2}},Go={animate:{width:"auto",paddingRight:"4px",paddingLeft:"4px"},fadeIn:{opacity:1,transition:{delay:.7}}},Fo={animate:{width:"auto"},fadeIn:{opacity:1,transition:{delay:1}}},Uo={animate:{width:"auto",paddingRight:"8px",paddingLeft:"4px"}},Et={fadeIn:{duration:.3},animate:{duration:.1}},Oo={fadeIn:{opacity:1}},jo=styled$1(j$1)(()=>({width:"88px",height:"100%"})),$t=styled$1(Box)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.25),height:"100%"}));function qe({chargeStatus:t,gatewayTooltip:o$1,acquirerTooltip:e,chargeTooltip:r,errorCode:l,isTextShown:p$2,gatewayCode:a,acquirerCode:n,unCapturedStyles:d,iconStyles:s$1,iconWrapperStyles:f,gatewayIconWrapperStyles:c,gatewayContainerStyles:g$1,gateWayIconStyles:T,showBadge:A=true,isSheetViewShown:P=false,selectionProps:L={},chipIndex:J=0}){let x=t?b$1[t]:null,I=t?g[t]:null,W=useTheme$1(),{t:C}=useTranslation(),X=yc(useId(),"charge-status-icon"),D=r&&jsx(Fragment,{children:jsx("div",{children:r})}),v=e&&jsxs(Fragment,{children:[jsx("div",{children:"Acquirer"}),jsx("div",{children:e})]}),Y=o$1&&jsxs(Fragment,{children:[jsx("div",{children:"Gateway"}),jsx("div",{children:o$1})]}),Ft=t&&a$2[t]&&jsx("div",{"data-testid":"ChargeStatusIcon_ChargeIcon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:x?"50%":"",...f},children:jsx(p$1,{src:a$2[t],alt:"charge-icon","data-testid":"ChargeStatusIcon_StatusIcon",style:{borderRadius:x?"50%":"",width:"16px",height:"16px",...s$1}})});return P?jsxs($t,{children:[jsxs(b,{copyText:C(_(t)),chipIndex:J,selectionProps:L,children:[C(_(t))," ",l]}),x&&jsxs(Fragment,{children:[a&&jsxs(b,{copyText:"Gateway",chipIndex:1,selectionProps:L,children:["Gateway ",a]}),n&&jsxs(b,{copyText:"Acquirer",chipIndex:2,selectionProps:L,children:["Acquirer ",n]})]})]}):p$2?jsxs($t,{children:[jsx(p,{title:D,children:jsxs(jo,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark,borderColor:`${x?.color||I?.color||W.palette.info.dark}1A`},children:[C(_(t))," ",l]})}),x&&jsxs(Fragment,{children:[a&&jsx(p,{title:Y,children:jsxs(j$1,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark},children:["Gateway ",a]})}),n&&jsx(p,{title:v,children:jsxs(j$1,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark},children:["Acquirer ",n]})})]})]}):jsx(o,{id:X,"data-testid":"ChargeStatusIcon_StatusIconWrapper",style:{...f},children:s?.includes(t||"")&&(D||v||Y)?jsxs(zo,{"data-testid":"ChargeStatusIcon_UnCapturedContainer",whileHover:["animate","fadeIn"],style:{left:"0",...A&&{paddingInline:"12px",border:"1px solid #F2F2F2",borderRadius:"12px",backgroundColor:"#fff"},...d},children:[jsx(Mo,{"data-testid":"ChargeStatusIcon_UnCapturedBadge",sx:{borderRadius:"56px"},initial:{background:"transparent"},variants:{animate:{background:x?.background}},children:jsx(p,{title:D??C(_(t)),children:jsxs(Fragment,{children:[Ft,jsx(Vo,{"data-testid":"ChargeStatusIcon_ErrorCodeWrapper",transition:{animate:{duration:.05}},variants:Uo,style:{...l&&{padding:"0 !important"}},children:jsx(_o,{"data-testid":"ChargeStatusIcon_ErrorCodeLabel",sx:{background:x?.color},transition:No,variants:Oo,initial:{opacity:0},children:l})})]})})}),jsx(Dt,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:Et,variants:Go,style:g$1,isVisible:!!Y,children:Y&&jsx(p,{title:Y,children:jsx(Lt,{"data-testid":"ChargeStatusIcon_GatewayIconWrapper",style:{background:x?.background,...c},children:jsx(Bt,{src:x?.gatewayIcon,alt:"gateway-icon","data-testid":"ChargeStatusIcon_GatewayIcon",style:T})})})}),jsx(Dt,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:Et,variants:Fo,style:g$1,isVisible:!!v,children:v&&jsx(p,{title:v,children:jsx(Lt,{"data-testid":"ChargeStatusIcon_AcquirerIconWrapper",style:{background:x?.background,...c},children:jsx(Bt,{src:x?.acquirerIcon,alt:"acquirer-icon","data-testid":"ChargeStatusIcon_AcquirerIcon",style:T})})})})]}):jsx(p,{title:D??C(_(t)),children:jsx(o,{children:Ft})})})}var Xe=()=>{let{t}=useTranslation(),o=yc(useId(),"customer-initiated-icon");return jsx(p,{title:t("merchantInitiated"),children:jsx("img",{id:o,"data-testid":"merchantInitiatedIcon",src:ub,alt:"merchant",style:{width:"16px",height:"16px"}})})};var Ye={G:"Global",R:"Regional",L:"Local"},ot=({geographyVariant:t,countryCode:o,isTextShown:e})=>{let r=t?Ye[t]:void 0,l=r||o?`${r||""} ${r&&o?"-":""} ${o?`Country - ${o}`:""}`:void 0;return e||!o?null:jsx(p,{title:l,children:jsx(a$3,{countryCode:o})})};var tr=({geographyVariant:t,isTextShown:o,deviceCountry:e,deviceType:r,tableMode:l})=>{let p=yc(useId(),"device-icon-chip");return jsxs(Qe,{id:p,"data-testid":"DeviceIconChip",sx:{display:"flex",gap:"8px",alignItems:"center",...Va(l)&&{height:"18px"}},children:[jsx(ot,{geographyVariant:t,isTextShown:o,countryCode:e}),jsx(c,{type:r,isTextShown:o,tableMode:l})]})};var rr=({isDisputeOpen:t,iconStyles:o})=>{let e=yc(useId(),"dispute-icon");return jsx(p$1,{id:e,"data-testid":"StatusCell_DisputeStatusIcon",sx:{width:"13.5px",height:"13.5px"},src:t?va:ua,alt:"dispute-icon",style:o})};var Xo=styled$1(Qe,{shouldForwardProp:t=>t!=="tableMode"})(({theme:t,tableMode:o})=>({display:"flex",gap:t.spacing(.5),...Va(o)&&{height:"18px"},alignItems:"center"})),Yo=styled$1("span")(({theme:t})=>({fontSize:"10px",fontWeight:500,color:t.palette.text.primary}));function Vt({countryCode:t,isTextShown:o,cardNumber:e,bankName:r,tableMode:l}){let p$1=yc(useId(),"issuer-icon"),a=e?.slice(0,4),n=e?.slice(-4);return jsxs(Xo,{id:p$1,"data-testid":"IssuerIcon",tableMode:l,children:[t&&jsx(ot,{countryCode:t,isTextShown:o}),jsx(p,{title:`${r?`Issuer - ${r}`:""}`,children:jsx(Yo,{children:`${a||""} ${n||""}`})})]})}var sr=Vt;styled(motion.div)(({theme:t,background:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5),paddingInline:t.spacing(.75),paddingBlock:t.spacing(.5),backgroundColor:o,height:"24px",width:"fit-content",borderRadius:"24px",fontSize:"10px",color:t.palette.text.primary}));var Ra=styled("img")(()=>({height:"13.125px",width:"12px"})),bt=styled("div")(()=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",width:"65px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4.5px 8px",borderRadius:"24px"})),ka=styled("div")(({theme:t})=>({color:t.palette.common.white,background:t.palette.error.main,fontSize:"0.6rem",fontWeight:600,borderRadius:"16px",padding:"2px 8px",display:"flex",alignItems:"center",justifyContent:"center"})),Ba=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px"}));var ur=({payoutStatus:t="PENDING",isTextShown:o,payoutTooltip:e$1,iconStyles:r,isSheetViewShown:l,chipIndex:p$2=0,selectionProps:a={}})=>{let{t:n}=useTranslation(),d=yc(useId(),"payout-icon"),s=n(_(t)),f=e$1||s;return l?jsx(b,{chipIndex:p$2,copyText:s,selectionProps:a,children:s}):jsx(p,{title:f,children:o?jsx(bt,{id:d,"data-testid":"StatusCell_PayoutStatusLabel",children:s}):jsx(p$1,{id:d,src:e[t],alt:"settled-icon","data-testid":"StatusCell_PayoutStatusIcon",style:r})})};var Qo=styled$1(motion.img)(()=>({width:"14px",height:"14px"})),Zo=styled$1(motion.span)(({theme:t})=>({color:t.palette.common.white,borderRadius:t.spacing(.5),height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600,backgroundColor:t.palette.secondary.main})),Mt=styled$1(motion.div)(({theme:t})=>({height:"16px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${t.palette.secondary.main}1A`,paddingInline:t.spacing(.5),borderRadius:"56px"})),qa=(t,o,e)=>({start:{x:t*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:e?t*e:t*49,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:o}}),Ka=styled$1(motion.span)(({isTextShown:t,theme:o})=>({border:`1px solid ${o.palette.divider}`,borderRadius:"12px",backgroundColor:o.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:t?"auto":"36px",...t&&{border:"none"}})),Ja=styled$1(motion.div,{shouldForwardProp:t=>t!=="order"})(({order:t=0})=>({display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:0,left:0,zIndex:t+6,width:"fit-content",height:"24px",cursor:"pointer",borderRadius:"16px","&:hover":{zIndex:200}})),Xa=styled$1(motion.div,{shouldForwardProp:t=>t!=="statusesCount"})(({statusesCount:t=1})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"relative",minWidth:`${t*6+36}px`,height:"24px",cursor:"pointer",borderRadius:"16px",overflow:"visible"})),Ya=styled$1("div")(()=>({display:"flex",gap:"4px",justifyContent:"flex-start",alignItems:"center",position:"relative",width:"100%",overflow:"visible"}));var hr=({isTextShown:t,refundStatus:o="PENDING",refundTooltip:e="",refundCount:r,iconStyles:l,isSheetViewShown:p$2,chipIndex:a=0,selectionProps:n={}})=>{let{t:d$1}=useTranslation(),s=useTheme$1(),f=yc(useId(),"refund-icon"),c=(r||0)>1,g=d$1(_(o));if(p$2)return jsxs(b,{chipIndex:a,selectionProps:n,copyText:g,children:[g," ",c?`${r}x`:null]});let T=jsxs(Zo,{"data-testid":"StatusCell_RefundsCountBadge",initial:{width:0,opacity:0,padding:"0px"},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex",padding:"1.285px 2.569px"},fadeIn:{transition:{delay:.5},opacity:1}},children:[r,"x"]});return t?jsx(p,{title:jsx("div",{children:jsx("div",{children:e})}),children:jsx(bt,{id:f,"data-testid":"StatusCell_RefundStatusLabel",sx:{color:d[o].color,backgroundColor:d[o].backgroundColor,width:"90px"},children:jsxs(Mt,{whileInView:c?["animate","fadeIn"]:void 0,variants:{animate:{boxShadow:s.shadows[4],gap:s.spacing(.5)}},children:[g," ",c?T:null]})})}):jsx(p,{title:jsx("div",{children:jsx("div",{children:e})}),children:c?jsxs(Mt,{id:f,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:s.shadows[4],gap:s.spacing(.5)}},children:[jsx(Qo,{src:sk,alt:"multi-refunded-icon","data-testid":"StatusCell_MultiRefundIcon"}),T]}):jsx(p$1,{id:f,src:c$1[o],alt:"refunded-icon","data-testid":"StatusCell_RefundStatusIcon",style:l})})},te=hr;var Cr=te;var yr={american_express:"AMEX",debit:"card",credit:"card",unionpay:"UnionPay",jaywan:"JAYWAN"},B=t=>yr[t?.toLowerCase()||""]||t;styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));var oe=styled("img")(()=>({maxWidth:"24px",maxHeight:"16px"}));styled(motion.span,{shouldForwardProp:t=>t!=="sourcesCount"})(({theme:t,sourcesCount:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${o*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:t.palette.background.paper,borderRadius:"16px"}));var ee=styled("span")(({theme:t})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:t.palette.text.primary})),re=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%"}));styled("span")(({theme:t})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));var ne=styled("span")(({theme:t})=>({fontSize:"10px",fontWeight:500,color:t.palette.text.primary}));function At({source:t,isTextShown:o,title:e,width:r,height:l,imgSx:p$1}){let{t:a}=useTranslation(),n=h(t);return jsx(p,{title:e,children:o?jsx(re,{"data-testid":"SourceCell_BadgeTextWrapper",children:jsx(ee,{"data-testid":"SourceCell_TextLabel","data-source":t,children:a(_(t))})}):jsx(oe,{src:n,alt:t,width:r,height:l,onError:d=>{d.currentTarget.src=h("card");},sx:p$1})})}function vr({payment:t,card:o,isTextShown:e,firstIcon:r}){let l=yc(useId(),"source-icons"),{t:p}=useTranslation(),a=useCallback(()=>{let s=[],f=bc(t),c=t?.method,g=t?.scheme;return B(c)?.toLowerCase()===B(g)?.toLowerCase()?s.push(B(c),B(f)):s.push(B(c),B(f),B(g)),s},[t]),n=useMemo(()=>jsx(At,{source:r,isTextShown:e,title:p(_(r))},r),[r,e,p]),d=useMemo(()=>a()?.filter(s=>!!s&&s!==r)?.map((s,f,c)=>{let g=t?.wallet===p("sv_wallet")?p("storedValueWallet"):p("passThruWallet"),T=f===c.length-1&&o?.last_four?`${p(_(s))} - ${o?.last_four}`:p(_(s));return jsx(At,{source:s,isTextShown:e,title:f===0&&s==="Wallet"?g:T},`${s}-${f}`)}),[a,t,o,e,p,r]);return jsxs(Box,{id:l,"data-testid":"SourceIcons",display:"flex",alignItems:"center",gap:.5,children:[r&&n,d,o?.last_four&&jsxs(ne,{children:["\xB7\xB7\xB7 ",o?.last_four]})]})}var rt={PROCESSED:Ug,FAILED:""};var se=styled("span")(({theme:t})=>({fontSize:"11px",padding:"2px 0",color:t.palette.text.primary})),le=styled("img")(()=>({width:"16px",height:"16px"})),de=styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function ce({status:t,isTextShown:o,isSheetViewShown:e,chipIndex:r=0,selectionProps:l={}}){let p$1=useTheme(),{t:a}=useTranslation(),n=yc(useId(),"destination-icon"),d=a(_(t));return e&&rt[t]?jsx(b,{copyText:d,chipIndex:r,selectionProps:l,children:d}):o&&rt[t]?jsx(se,{id:n,"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:"#1F88D00D",color:t==="PROCESSED"?p$1.palette.info.dark:p$1.palette.common.black},children:d}):jsx(de,{id:n,"data-testid":"DestinationIcon",className:"destination-status",children:t&&rt[t]&&jsx(p,{title:a(_(t)),children:jsx(le,{src:rt[t],alt:"destination-icon"})})})}export{qa as a,Ka as b,Ja as c,Xa as d,Ya as e,Ce as f,Se as g,Te as h,$o as i,Me as j,Fe as k,qe as l,Xe as m,ot as n,tr as o,rr as p,sr as q,Ra as r,ka as s,Ba as t,ur as u,Cr as v,B as w,At as x,vr as y,ce as z};
1
+ import {f,b as b$1,g,a as a$2,e,d,c as c$1}from'./chunk-SLPI5KKB.js';import {a as a$4}from'./chunk-4Z2TQN2P.js';import {a as a$1}from'./chunk-SSBDL6XS.js';import {c}from'./chunk-DPRSHIL7.js';import {a}from'./chunk-ZONDSLTR.js';import {o,j as j$1,k,l,p as p$1}from'./chunk-ZMJUHXHX.js';import {a as a$3}from'./chunk-MQFXJL5S.js';import {b}from'./chunk-4X43KBH2.js';import {p,z}from'./chunk-7PJX5ZKM.js';import {Va,yc,Ha,Ia,bc,f as f$1}from'./chunk-2SKLD6QR.js';import {s}from'./chunk-FH3OCBAM.js';import {T,yi,Ai,zi,xi,Ei,ch,Vg,bh,Rj,Sj,tb,gk,jk,Ak,hk,ub,va,ua,sk,h,Ug}from'./chunk-OK75VWGZ.js';import {useId,useMemo,useCallback}from'react';import {useTranslation}from'react-i18next';import {styled,Box,useTheme}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {motion}from'framer-motion';import {styled as styled$1,useTheme as useTheme$1}from'@mui/material/styles';import _ from'lodash/camelCase';import Qe from'@mui/material/Box';var lt={ORDER:{label:"order",icon:xi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:zi,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:Ai,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:yi,color:"#32ADE6"}},dt={SAVED_TOKEN:{label:"savedToken",icon:T,color:"#76BB40"},COUNT:{label:"countBadge",icon:"countBadge",color:"#76BB40"}};styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5)}));styled("img")(()=>({width:"35px",height:"16px",display:"block"}));styled("span")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"14.67px",height:"10px"}));styled("img")(()=>({maxWidth:"100%",width:"100%"}));var ct=styled("span")(({theme:t})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:t.palette.text.primary})),mt=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"}));function Ie({type:t,hasSavedCard:o,totalPaymentsCount:e,isTextShown:r}){let l=yc(useId(),"agreement-icon"),p$1=useTheme(),{t:a$2}=useTranslation(),n=useMemo(()=>[...o?[dt.SAVED_TOKEN]:[],...(e||0)>0?[dt.COUNT]:[],...t&&lt[t]?[lt[t]]:[]],[o,e,t]),d=c=>r?jsx(a,{"data-testid":"AgreementCell_countBadge",children:jsx(p,{title:a$2("totalPaymentCount",{amount:f$1(e)}),children:jsx(mt,{children:jsxs(ct,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:dt.COUNT.color},children:["x",e]})})})},c):jsx(a$4,{value:e,index:c},c),s=n.map((c,g)=>c.label==="countBadge"?d(g):jsx(p,{title:a$2(c.label),children:jsx(a,{children:r?jsx(mt,{children:jsx(ct,{"data-testid":"AgreementCell_agreementType",sx:{color:c.color},children:a$2(c.label)})}):jsx(a$1,{sx:{maxWidth:"16px",maxHeight:"16px",height:"auto",width:"auto"},src:c.icon,alt:"agreement"})},c.color)},c.color)),f=jsx(p,{title:"No agreement",children:jsx(a,{children:r?jsx(mt,{children:jsx(ct,{"data-testid":"AgreementCell_agreementType",sx:{color:p$1.palette.text.secondary},children:"No agreement"})}):jsx(a$1,{sx:{maxWidth:"24px",maxHeight:"24px",height:"auto",width:"auto"},src:Ei,alt:"agreement"})},"no-agreement")},"no-agreement");return jsx(Box,{id:l,"data-testid":"AgreementIcon",sx:{display:"flex",alignItems:"center",gap:"4px"},children:s?.length>0?s:f})}var To=Ie;var Ce=To;styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"}));styled(motion.span,{shouldForwardProp:t=>t!=="sourcesCount"})(({theme:t,sourcesCount:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${o*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:t.palette.background.paper,borderRadius:"16px"}));var Ao=styled("span")(({theme:t})=>({fontSize:"11px",padding:"2px 0",color:t.palette.text.primary})),Po=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px",textAlign:"center",width:"100%"}));styled("span")(({theme:t})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));styled(motion.div)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));var Wo=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px"}));var kt={"3DS":{tooltip:"3DS",icon:Sj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Rj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:bh,borderColor:"rgba(31, 136, 208, 0.10)"}},vo={FAILED:{tooltip:"Failed",icon:Vg,borderColor:"rgba(255, 61, 0, 0.10)"},REJECTED:{tooltip:"Rejected",icon:ch,borderColor:"rgba(255, 61, 0, 0.10)"}};function be({transactionStatus:t,eci:o,authType:e,isTextShown:r}){let l=yc(useId(),"auth-icons"),p$1=useMemo(()=>{let n=t?vo[t]:null,d=n?.tooltip,s=t==="AUTHENTICATED"?null:n?.icon;return [{tooltip:d,content:r?d:s,type:r?"text":"icon"},...e?[{tooltip:e,content:r?kt[e]?.tooltip:kt[e]?.icon,type:r?"text":"icon"}]:[],{tooltip:"",content:o?`ECI ${o}`:"",type:"text"}]},[t,r,e,o]),a=useMemo(()=>p$1.filter(n=>!!n.content).map((n,d)=>{let s=n.type==="text"?jsx(Po,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(Ao,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":n.content,children:n.content})}):jsx(a$1,{sx:{width:"16px",height:"16px"},src:n.content,alt:n.tooltip});return jsx(p,{title:n.tooltip,children:s},`${n.tooltip}-${d}`)}),[p$1]);return jsx(Wo,{id:l,"data-testid":"AuthIcons",children:a})}var ko=be;var Se=(t,o,e)=>({start:{x:t*6,transition:{duration:.3,type:"tween",ease:"easeIn"},...t>0&&{opacity:0}},animate:{x:e?t*e:t*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:o,...t>0&&{opacity:1}}});var Te=ko;var tt={VOID:{icon:hk},CAPTURED:{icon:gk}};var ut=styled$1(motion.div)(({theme:t,isCapture:o})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:t.spacing(.5),paddingInline:t.spacing(.3),paddingBlock:t.spacing(.3),height:"100%",minWidth:"100%",backgroundColor:o?"#eaf3fb":"#eeeeee",borderRadius:"56px",width:"fit-content",fontSize:"10px",color:t.palette.text.primary,position:"relative",zIndex:10})),ft=styled$1("div")(({theme:t,percentage:o,isCapture:e})=>({border:`0.6px ${[0,100].includes(o)?"solid":"dashed"} ${e?t.palette.info.dark:"#656565"}`,borderRadius:"80px",padding:t.spacing(.316),paddingLeft:t.spacing(.516),fontSize:"7px",fontWeight:t.typography.fontWeightBold,color:e?t.palette.info.dark:"#656565",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5)})),xt=styled$1("div")(({percentage:t,isCapture:o,theme:e})=>({background:`conic-gradient(${o?e.palette.info.dark:"#656565"} ${t}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${o?e.palette.info.dark:"#656565"}`})),gt=styled$1("img")({width:"14px",height:"14px"}),j=styled$1(o)({width:"16px",height:"16px"}),N=styled$1("img")({width:"16px",height:"16px"}),Bo=styled$1(Box)({display:"flex",alignItems:"center",justifyContent:"center"});function It(t){return t<5?5:t===100?95:t}function Be({voidPercentage:t,capturePercentage:o,captureCount:e,autoType:r,captureAmount:l,voidAmount:p$1,currency:a,isTextShown:n,remainingAmount:d,isSheetViewShown:s,selectionProps:f={}}){let c=Number(o)+Number(t)===100||d<=0,g=yc(useId(),"capture-auto-icon"),T=useTheme$1(),{t:A}=useTranslation(),P=Ha(d||0),L=useCallback(C=>`Auto ${C} - ${a} ${P.integerAmount}.${P.decimalAmount}`,[a,P.decimalAmount,P.integerAmount]),J=useCallback(C=>{let X=C==="Capture"?l:p$1,{integerAmount:D,decimalAmount:v}=Ia(X,a);return `Partial ${C} - ${a} ${D}.${v}`},[l,p$1,a]),x=o>0?jsx(p,{title:J("Capture"),children:jsxs(ut,{isCapture:true,isFullyUsed:c,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:T.shadows[4]}},children:[jsx(gt,{src:tb,alt:"captured"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(ft,{isCapture:true,percentage:o,children:[o,"% ",jsx(xt,{isCapture:true,percentage:It(o)})]}),e>1&&jsxs(z,{compact:true,color:"dark",children:[e,"x"]})]})]})}):r==="CAPTURED"&&!c?jsx(p,{title:L("Capture"),children:jsx(j,{children:jsx(N,{src:tt.CAPTURED?.icon,alt:"auto"})})}):jsx(p,{title:L("Capture"),children:jsx(j,{children:jsx(N,{src:tt.CAPTURED?.icon,alt:"auto"})})}),I=o===100?jsx(p,{title:A("captured"),children:jsx(Bo,{children:jsx(N,{src:jk,alt:"captured"})})}):x,W=useMemo(()=>s&&I?jsx(b,{chipIndex:4,copyText:A("captured"),selectionProps:f,children:A("captured")}):n&&I?jsx(k,{children:A("captured")}):I,[n,I,s,f]);return W&&jsx("div",{id:g,"data-testid":"CaptureAutoIcon",style:{zIndex:12},children:W})}var Do=Be;function Ve({voidPercentage:t,capturePercentage:o,voidCount:e,autoType:r,captureAmount:l$1,voidAmount:p$1,currency:a,isTextShown:n,isSheetViewShown:d,selectionProps:s={},remainingAmount:f}){let c=Number(o)+Number(t)===100||f<=0,g=yc(useId(),"void-auto-icon"),T=useTheme$1(),{t:A}=useTranslation(),P=Ha(f||0),L=useCallback(C=>`Auto ${C} - ${a} ${P.integerAmount}.${P.decimalAmount}`,[a,P.decimalAmount,P.integerAmount]),J=useCallback(C=>{let X=C==="Capture"?l$1:p$1,{integerAmount:D,decimalAmount:v}=Ia(X,a);return `Partial ${C} - ${a} ${D}.${v}`},[l$1,p$1,a]),x=t>0||p$1?jsx(p,{title:J("Void"),children:jsxs(ut,{isFullyUsed:c,whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:14,background:T.palette.common.white,border:`0.75px solid ${T.palette.grey[600]}1A`},variants:{animate:{boxShadow:T.shadows[4]}},children:[jsx(gt,{src:Ak,alt:"void"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(ft,{percentage:t,children:[t,"% ",jsx(xt,{percentage:It(t)})]}),e>0&&jsxs(z,{compact:true,color:"neutral",children:[e,"x"]})]})]})}):r==="VOID"&&!c?jsx(p,{title:L("Void"),children:jsx(j,{children:jsx(N,{src:tt.VOID?.icon,alt:"auto"})})}):null,I=t===100?jsx(p,{title:A("void"),children:jsx(j,{children:jsx(N,{src:Ak,alt:"void"})})}):x,W=useMemo(()=>d&&I?jsx(b,{chipIndex:5,copyText:A("void"),selectionProps:s,children:A("void")}):n&&I?jsx(l,{children:A("void")}):I,[n,I,d,s]);return W?jsx("div",{id:g,"data-testid":"VoidAutoIcon",style:{...!d&&{zIndex:11}},children:W}):null}var $o=Ve;var Me=Do;var Fe=({authorizedStatus:t,isTextShown:o,iconStyles:e,tableMode:r,chipIndex:l=0,selectionProps:p$1={}})=>{let{t:a}=useTranslation(),n=useTheme$1(),d=a(_(t));return Va(r)?jsx(b,{copyText:d,chipIndex:l,selectionProps:p$1,children:d}):jsx(p,{title:d,children:o?jsx(j$1,{"data-testid":"StatusCell_AuthorizedStatusLabel",sx:{color:n.palette.info.dark},children:d}):jsx(a$1,{src:f[t],alt:"authorized-icon","data-testid":"StatusCell_AuthorizedStatusIcon",sx:e})})};var _o=styled$1(motion.span)(({theme:t})=>({color:t.palette.common.white,display:"block",fontWeight:t.typography.fontWeightBold,fontSize:"9.78px",borderRadius:"4px",paddingInline:t.spacing(.45)})),Vo=styled$1(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"})),Bt=styled$1("img")(()=>({width:"10px",height:"10px"})),Lt=styled$1(motion.span)(({theme:t})=>({width:"18px",height:"18px",borderRadius:"50%",backgroundColor:t.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,position:"relative"})),Dt=styled$1(motion.div,{shouldForwardProp:t=>t!=="isVisible"})(({isVisible:t})=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",width:"0",overflow:"hidden",opacity:0,...!t&&{padding:"0 !important"}})),Mo=styled$1(motion.div)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"})),zo=styled$1(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),No={delay:.2,ease:"easeIn",fadeIn:{duration:.2}},Go={animate:{width:"auto",paddingRight:"4px",paddingLeft:"4px"},fadeIn:{opacity:1,transition:{delay:.7}}},Fo={animate:{width:"auto"},fadeIn:{opacity:1,transition:{delay:1}}},Uo={animate:{width:"auto",paddingRight:"8px",paddingLeft:"4px"}},Et={fadeIn:{duration:.3},animate:{duration:.1}},Oo={fadeIn:{opacity:1}},jo=styled$1(j$1)(()=>({width:"88px",height:"100%"})),$t=styled$1(Box)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.25),height:"100%"}));function qe({chargeStatus:t,gatewayTooltip:o$1,acquirerTooltip:e,chargeTooltip:r,errorCode:l,isTextShown:p$2,gatewayCode:a,acquirerCode:n,unCapturedStyles:d,iconStyles:s$1,iconWrapperStyles:f,gatewayIconWrapperStyles:c,gatewayContainerStyles:g$1,gateWayIconStyles:T,showBadge:A=true,isSheetViewShown:P=false,selectionProps:L={},chipIndex:J=0}){let x=t?b$1[t]:null,I=t?g[t]:null,W=useTheme$1(),{t:C}=useTranslation(),X=yc(useId(),"charge-status-icon"),D=r&&jsx(Fragment,{children:jsx("div",{children:r})}),v=e&&jsxs(Fragment,{children:[jsx("div",{children:"Acquirer"}),jsx("div",{children:e})]}),Y=o$1&&jsxs(Fragment,{children:[jsx("div",{children:"Gateway"}),jsx("div",{children:o$1})]}),Ft=t&&a$2[t]&&jsx("div",{"data-testid":"ChargeStatusIcon_ChargeIcon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:x?"50%":"",...f},children:jsx(p$1,{src:a$2[t],alt:"charge-icon","data-testid":"ChargeStatusIcon_StatusIcon",style:{borderRadius:x?"50%":"",width:"16px",height:"16px",...s$1}})});return P?jsxs($t,{children:[jsxs(b,{copyText:C(_(t)),chipIndex:J,selectionProps:L,children:[C(_(t))," ",l]}),x&&jsxs(Fragment,{children:[a&&jsxs(b,{copyText:"Gateway",chipIndex:1,selectionProps:L,children:["Gateway ",a]}),n&&jsxs(b,{copyText:"Acquirer",chipIndex:2,selectionProps:L,children:["Acquirer ",n]})]})]}):p$2?jsxs($t,{children:[jsx(p,{title:D,children:jsxs(jo,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark,borderColor:`${x?.color||I?.color||W.palette.info.dark}1A`},children:[C(_(t))," ",l]})}),x&&jsxs(Fragment,{children:[a&&jsx(p,{title:Y,children:jsxs(j$1,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark},children:["Gateway ",a]})}),n&&jsx(p,{title:v,children:jsxs(j$1,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark},children:["Acquirer ",n]})})]})]}):jsx(o,{id:X,"data-testid":"ChargeStatusIcon_StatusIconWrapper",style:{...f},children:s?.includes(t||"")&&(D||v||Y)?jsxs(zo,{"data-testid":"ChargeStatusIcon_UnCapturedContainer",whileHover:["animate","fadeIn"],style:{left:"0",...A&&{paddingInline:"12px",border:"1px solid #F2F2F2",borderRadius:"12px",backgroundColor:"#fff"},...d},children:[jsx(Mo,{"data-testid":"ChargeStatusIcon_UnCapturedBadge",sx:{borderRadius:"56px"},initial:{background:"transparent"},variants:{animate:{background:x?.background}},children:jsx(p,{title:D??C(_(t)),children:jsxs(Fragment,{children:[Ft,jsx(Vo,{"data-testid":"ChargeStatusIcon_ErrorCodeWrapper",transition:{animate:{duration:.05}},variants:Uo,style:{...l&&{padding:"0 !important"}},children:jsx(_o,{"data-testid":"ChargeStatusIcon_ErrorCodeLabel",sx:{background:x?.color},transition:No,variants:Oo,initial:{opacity:0},children:l})})]})})}),jsx(Dt,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:Et,variants:Go,style:g$1,isVisible:!!Y,children:Y&&jsx(p,{title:Y,children:jsx(Lt,{"data-testid":"ChargeStatusIcon_GatewayIconWrapper",style:{background:x?.background,...c},children:jsx(Bt,{src:x?.gatewayIcon,alt:"gateway-icon","data-testid":"ChargeStatusIcon_GatewayIcon",style:T})})})}),jsx(Dt,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:Et,variants:Fo,style:g$1,isVisible:!!v,children:v&&jsx(p,{title:v,children:jsx(Lt,{"data-testid":"ChargeStatusIcon_AcquirerIconWrapper",style:{background:x?.background,...c},children:jsx(Bt,{src:x?.acquirerIcon,alt:"acquirer-icon","data-testid":"ChargeStatusIcon_AcquirerIcon",style:T})})})})]}):jsx(p,{title:D??C(_(t)),children:jsx(o,{children:Ft})})})}var Xe=()=>{let{t}=useTranslation(),o=yc(useId(),"customer-initiated-icon");return jsx(p,{title:t("merchantInitiated"),children:jsx("img",{id:o,"data-testid":"merchantInitiatedIcon",src:ub,alt:"merchant",style:{width:"16px",height:"16px"}})})};var Ye={G:"Global",R:"Regional",L:"Local"},ot=({geographyVariant:t,countryCode:o,isTextShown:e})=>{let r=t?Ye[t]:void 0,l=r||o?`${r||""} ${r&&o?"-":""} ${o?`Country - ${o}`:""}`:void 0;return e||!o?null:jsx(p,{title:l,children:jsx(a$3,{countryCode:o})})};var tr=({geographyVariant:t,isTextShown:o,deviceCountry:e,deviceType:r,tableMode:l})=>{let p=yc(useId(),"device-icon-chip");return jsxs(Qe,{id:p,"data-testid":"DeviceIconChip",sx:{display:"flex",gap:"8px",alignItems:"center",...Va(l)&&{height:"18px"}},children:[jsx(ot,{geographyVariant:t,isTextShown:o,countryCode:e}),jsx(c,{type:r,isTextShown:o,tableMode:l})]})};var rr=({isDisputeOpen:t,iconStyles:o})=>{let e=yc(useId(),"dispute-icon");return jsx(p$1,{id:e,"data-testid":"StatusCell_DisputeStatusIcon",sx:{width:"13.5px",height:"13.5px"},src:t?va:ua,alt:"dispute-icon",style:o})};var Xo=styled$1(Qe,{shouldForwardProp:t=>t!=="tableMode"})(({theme:t,tableMode:o})=>({display:"flex",gap:t.spacing(.5),...Va(o)&&{height:"18px"},alignItems:"center"})),Yo=styled$1("span")(({theme:t})=>({fontSize:"10px",fontWeight:500,color:t.palette.text.primary}));function Vt({countryCode:t,isTextShown:o,cardNumber:e,bankName:r,tableMode:l}){let p$1=yc(useId(),"issuer-icon"),a=e?.slice(0,4),n=e?.slice(-4);return jsxs(Xo,{id:p$1,"data-testid":"IssuerIcon",tableMode:l,children:[t&&jsx(ot,{countryCode:t,isTextShown:o}),jsx(p,{title:`${r?`Issuer - ${r}`:""}`,children:jsx(Yo,{children:`${a||""} ${n||""}`})})]})}var sr=Vt;styled(motion.div)(({theme:t,background:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5),paddingInline:t.spacing(.75),paddingBlock:t.spacing(.5),backgroundColor:o,height:"24px",width:"fit-content",borderRadius:"24px",fontSize:"10px",color:t.palette.text.primary}));var Ra=styled("img")(()=>({height:"13.125px",width:"12px"})),bt=styled("div")(()=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",width:"65px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4.5px 8px",borderRadius:"24px"})),ka=styled("div")(({theme:t})=>({color:t.palette.common.white,background:t.palette.error.main,fontSize:"0.6rem",fontWeight:600,borderRadius:"16px",padding:"2px 8px",display:"flex",alignItems:"center",justifyContent:"center"})),Ba=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px"}));var ur=({payoutStatus:t="PENDING",isTextShown:o,payoutTooltip:e$1,iconStyles:r,isSheetViewShown:l,chipIndex:p$2=0,selectionProps:a={}})=>{let{t:n}=useTranslation(),d=yc(useId(),"payout-icon"),s=n(_(t)),f=e$1||s;return l?jsx(b,{chipIndex:p$2,copyText:s,selectionProps:a,children:s}):jsx(p,{title:f,children:o?jsx(bt,{id:d,"data-testid":"StatusCell_PayoutStatusLabel",children:s}):jsx(p$1,{id:d,src:e[t],alt:"settled-icon","data-testid":"StatusCell_PayoutStatusIcon",style:r})})};var Qo=styled$1(motion.img)(()=>({width:"14px",height:"14px"})),Zo=styled$1(motion.span)(({theme:t})=>({color:t.palette.common.white,borderRadius:t.spacing(.5),height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600,backgroundColor:t.palette.secondary.main})),Mt=styled$1(motion.div)(({theme:t})=>({height:"16px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${t.palette.secondary.main}1A`,paddingInline:t.spacing(.5),borderRadius:"56px"})),qa=(t,o,e)=>({start:{x:t*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:e?t*e:t*49,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:o}}),Ka=styled$1(motion.span)(({isTextShown:t,theme:o})=>({border:`1px solid ${o.palette.divider}`,borderRadius:"12px",backgroundColor:o.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:t?"auto":"36px",...t&&{border:"none"}})),Ja=styled$1(motion.div,{shouldForwardProp:t=>t!=="order"})(({order:t=0})=>({display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:0,left:0,zIndex:t+6,width:"fit-content",height:"24px",cursor:"pointer",borderRadius:"16px","&:hover":{zIndex:200}})),Xa=styled$1(motion.div,{shouldForwardProp:t=>t!=="statusesCount"})(({statusesCount:t=1})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"relative",minWidth:`${t*6+36}px`,height:"24px",cursor:"pointer",borderRadius:"16px",overflow:"visible"})),Ya=styled$1("div")(()=>({display:"flex",gap:"4px",justifyContent:"flex-start",alignItems:"center",position:"relative",width:"100%",overflow:"visible"}));var hr=({isTextShown:t,refundStatus:o="PENDING",refundTooltip:e="",refundCount:r,iconStyles:l,isSheetViewShown:p$2,chipIndex:a=0,selectionProps:n={}})=>{let{t:d$1}=useTranslation(),s=useTheme$1(),f=yc(useId(),"refund-icon"),c=(r||0)>1,g=d$1(_(o));if(p$2)return jsxs(b,{chipIndex:a,selectionProps:n,copyText:g,children:[g," ",c?`${r}x`:null]});let T=jsxs(Zo,{"data-testid":"StatusCell_RefundsCountBadge",initial:{width:0,opacity:0,padding:"0px"},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex",padding:"1.285px 2.569px"},fadeIn:{transition:{delay:.5},opacity:1}},children:[r,"x"]});return t?jsx(p,{title:jsx("div",{children:jsx("div",{children:e})}),children:jsx(bt,{id:f,"data-testid":"StatusCell_RefundStatusLabel",sx:{color:d[o].color,backgroundColor:d[o].backgroundColor,width:"90px"},children:jsxs(Mt,{whileInView:c?["animate","fadeIn"]:void 0,variants:{animate:{boxShadow:s.shadows[4],gap:s.spacing(.5)}},children:[g," ",c?T:null]})})}):jsx(p,{title:jsx("div",{children:jsx("div",{children:e})}),children:c?jsxs(Mt,{id:f,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:s.shadows[4],gap:s.spacing(.5)}},children:[jsx(Qo,{src:sk,alt:"multi-refunded-icon","data-testid":"StatusCell_MultiRefundIcon"}),T]}):jsx(p$1,{id:f,src:c$1[o],alt:"refunded-icon","data-testid":"StatusCell_RefundStatusIcon",style:l})})},te=hr;var Cr=te;var yr={american_express:"AMEX",debit:"card",credit:"card",unionpay:"UnionPay",jaywan:"JAYWAN"},B=t=>yr[t?.toLowerCase()||""]||t;styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));var oe=styled("img")(()=>({maxWidth:"24px",maxHeight:"16px"}));styled(motion.span,{shouldForwardProp:t=>t!=="sourcesCount"})(({theme:t,sourcesCount:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${o*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:t.palette.background.paper,borderRadius:"16px"}));var ee=styled("span")(({theme:t})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:t.palette.text.primary})),re=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%"}));styled("span")(({theme:t})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));var ne=styled("span")(({theme:t})=>({fontSize:"10px",fontWeight:500,color:t.palette.text.primary}));function At({source:t,isTextShown:o,title:e,width:r,height:l,imgSx:p$1}){let{t:a}=useTranslation(),n=h(t);return jsx(p,{title:e,children:o?jsx(re,{"data-testid":"SourceCell_BadgeTextWrapper",children:jsx(ee,{"data-testid":"SourceCell_TextLabel","data-source":t,children:a(_(t))})}):jsx(oe,{src:n,alt:t,width:r,height:l,onError:d=>{d.currentTarget.src=h("card");},sx:p$1})})}function vr({payment:t,card:o,isTextShown:e,firstIcon:r}){let l=yc(useId(),"source-icons"),{t:p}=useTranslation(),a=useCallback(()=>{let s=[],f=bc(t),c=t?.method,g=t?.scheme;return B(c)?.toLowerCase()===B(g)?.toLowerCase()?s.push(B(c),B(f)):s.push(B(c),B(f),B(g)),s},[t]),n=useMemo(()=>jsx(At,{source:r,isTextShown:e,title:p(_(r))},r),[r,e,p]),d=useMemo(()=>a()?.filter(s=>!!s&&s!==r)?.map((s,f,c)=>{let g=t?.wallet===p("sv_wallet")?p("storedValueWallet"):p("passThruWallet"),T=f===c.length-1&&o?.last_four?`${p(_(s))} - ${o?.last_four}`:p(_(s));return jsx(At,{source:s,isTextShown:e,title:f===0&&s==="Wallet"?g:T},`${s}-${f}`)}),[a,t,o,e,p,r]);return jsxs(Box,{id:l,"data-testid":"SourceIcons",display:"flex",alignItems:"center",gap:.5,children:[r&&n,d,o?.last_four&&jsxs(ne,{children:["\xB7\xB7\xB7 ",o?.last_four]})]})}var rt={PROCESSED:Ug,FAILED:""};var se=styled("span")(({theme:t})=>({fontSize:"11px",padding:"2px 0",color:t.palette.text.primary})),le=styled("img")(()=>({width:"16px",height:"16px"})),de=styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function ce({status:t,isTextShown:o,isSheetViewShown:e,chipIndex:r=0,selectionProps:l={}}){let p$1=useTheme(),{t:a}=useTranslation(),n=yc(useId(),"destination-icon"),d=a(_(t));return e&&rt[t]?jsx(b,{copyText:d,chipIndex:r,selectionProps:l,children:d}):o&&rt[t]?jsx(se,{id:n,"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:"#1F88D00D",color:t==="PROCESSED"?p$1.palette.info.dark:p$1.palette.common.black},children:d}):jsx(de,{id:n,"data-testid":"DestinationIcon",className:"destination-status",children:t&&rt[t]&&jsx(p,{title:a(_(t)),children:jsx(le,{src:rt[t],alt:"destination-icon"})})})}export{qa as a,Ka as b,Ja as c,Xa as d,Ya as e,Ce as f,Se as g,Te as h,$o as i,Me as j,Fe as k,qe as l,Xe as m,ot as n,tr as o,rr as p,sr as q,Ra as r,ka as s,Ba as t,ur as u,Cr as v,B as w,At as x,vr as y,ce as z};
@@ -1 +1 @@
1
- import'./chunk-XN47DSB4.js';import {P,O as O$1}from'./chunk-7PJX5ZKM.js';import {yc}from'./chunk-2SKLD6QR.js';import {memo,useId,useState,useEffect}from'react';import p from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';import {jsx,Fragment}from'react/jsx-runtime';var f="32px";var g=styled(p,{shouldForwardProp:e=>e!=="isMaximized"})(({theme:e,isMaximized:i})=>({background:alpha(e.palette.common.white,.7),backdropFilter:"blur(8px)",width:183,position:"sticky",padding:"16px 8px",paddingTop:i?f:"16px",height:"100%",overflow:"auto"})),b=styled(p)(()=>({display:"flex",flexDirection:"column",gap:"8px"})),S=styled(p,{shouldForwardProp:e=>e!=="isActive"})(({theme:e,isActive:i})=>({background:i?"linear-gradient(270deg, #147DC5 0.67%, #3DA6E1 98.91%)":"transparent",borderRadius:"4px",padding:"4px 8px",color:i?e.palette.common.white:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px",cursor:"pointer",fontWeight:600})),h=styled(p,{shouldForwardProp:e=>e!=="isActive"})(({theme:e,isActive:i})=>({background:i?"#FFFFFF":"transparent",borderRadius:"4px",padding:"4px 8px",color:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px",cursor:"pointer",fontWeight:600})),B=styled(P)(({theme:e})=>({background:"transparent",border:"none !important",borderRadius:"4px !important",[`& .${O$1.summary}`]:{padding:0,paddingRight:e.spacing(1),minHeight:"40px",height:"40px","&.Mui-expanded":{minHeight:"40px",height:"40px"},marginBottom:4,borderRadius:"4px !important"},[`& .${O$1.content}`]:{borderTop:"none",padding:0}}));function w({sections:e,isMaximized:i,onClick:m,activeSection:A,activeSubSection:k}){let I=yc(useId(),"expandable-side-bar"),r=A||e?.[0]?.id,F=k||e?.[0]?.subSections?.[0]?.id,[C,c]=useState({});return useEffect(()=>{e?.length&&c(t=>{let o=false,d={...t};for(let x of e)x.id in d||(d[x.id]=r===x.id,o=true);return o?d:t});},[e,r]),useEffect(()=>{r&&c(t=>({...t,[r]:true}));},[r]),jsx(g,{isMaximized:i,id:I,"data-testid":"ExpandableSideBar",children:jsx(b,{children:e?.map(t=>jsx(B,{expanded:C[t.id]??false,onChange:o=>c(d=>({...d,[t.id]:o})),slotProps:{root:{component:"section"}},label:jsx(h,{onClick:()=>{m?.(t.id,t.subSections?.[0]?.id);},isActive:r===t.id,children:t.title}),content:jsx(Fragment,{children:t.subSections?.map(o=>jsx(S,{onClick:()=>{m?.(t.id,o.id);},isActive:F===o.id,children:o.title},`${t.id}-${o.id}`))})},`${t.id}`))})})}var E=memo(w);var O=E;export{O as a};
1
+ import'./chunk-OKDNE3LX.js';import {P,O as O$1}from'./chunk-7PJX5ZKM.js';import {yc}from'./chunk-2SKLD6QR.js';import {memo,useId,useState,useEffect}from'react';import p from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';import {jsx,Fragment}from'react/jsx-runtime';var f="32px";var g=styled(p,{shouldForwardProp:e=>e!=="isMaximized"})(({theme:e,isMaximized:i})=>({background:alpha(e.palette.common.white,.7),backdropFilter:"blur(8px)",width:183,position:"sticky",padding:"16px 8px",paddingTop:i?f:"16px",height:"100%",overflow:"auto"})),b=styled(p)(()=>({display:"flex",flexDirection:"column",gap:"8px"})),S=styled(p,{shouldForwardProp:e=>e!=="isActive"})(({theme:e,isActive:i})=>({background:i?"linear-gradient(270deg, #147DC5 0.67%, #3DA6E1 98.91%)":"transparent",borderRadius:"4px",padding:"4px 8px",color:i?e.palette.common.white:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px",cursor:"pointer",fontWeight:600})),h=styled(p,{shouldForwardProp:e=>e!=="isActive"})(({theme:e,isActive:i})=>({background:i?"#FFFFFF":"transparent",borderRadius:"4px",padding:"4px 8px",color:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px",cursor:"pointer",fontWeight:600})),B=styled(P)(({theme:e})=>({background:"transparent",border:"none !important",borderRadius:"4px !important",[`& .${O$1.summary}`]:{padding:0,paddingRight:e.spacing(1),minHeight:"40px",height:"40px","&.Mui-expanded":{minHeight:"40px",height:"40px"},marginBottom:4,borderRadius:"4px !important"},[`& .${O$1.content}`]:{borderTop:"none",padding:0}}));function w({sections:e,isMaximized:i,onClick:m,activeSection:A,activeSubSection:k}){let I=yc(useId(),"expandable-side-bar"),r=A||e?.[0]?.id,F=k||e?.[0]?.subSections?.[0]?.id,[C,c]=useState({});return useEffect(()=>{e?.length&&c(t=>{let o=false,d={...t};for(let x of e)x.id in d||(d[x.id]=r===x.id,o=true);return o?d:t});},[e,r]),useEffect(()=>{r&&c(t=>({...t,[r]:true}));},[r]),jsx(g,{isMaximized:i,id:I,"data-testid":"ExpandableSideBar",children:jsx(b,{children:e?.map(t=>jsx(B,{expanded:C[t.id]??false,onChange:o=>c(d=>({...d,[t.id]:o})),slotProps:{root:{component:"section"}},label:jsx(h,{onClick:()=>{m?.(t.id,t.subSections?.[0]?.id);},isActive:r===t.id,children:t.title}),content:jsx(Fragment,{children:t.subSections?.map(o=>jsx(S,{onClick:()=>{m?.(t.id,o.id);},isActive:F===o.id,children:o.title},`${t.id}-${o.id}`))})},`${t.id}`))})})}var E=memo(w);var O=E;export{O as a};
@@ -1 +1 @@
1
- import {a as a$3}from'./chunk-BQGQQ2MC.js';import {j,a as a$4}from'./chunk-VJTGGGCJ.js';import {a}from'./chunk-P2VRYOKF.js';import {a as a$2}from'./chunk-RIJFII4O.js';import {a as a$1}from'./chunk-MQFXJL5S.js';import {x,h}from'./chunk-7PJX5ZKM.js';import {lc,yc,o}from'./chunk-2SKLD6QR.js';import {U}from'./chunk-FH3OCBAM.js';import {Uc,Vc,Wj,Xj,Yj,dc,ec,Zj,cc}from'./chunk-OK75VWGZ.js';import {memo,forwardRef,useState,useMemo,useRef,useId,useEffect,useCallback}from'react';import S from'@mui/material/Box';import bt from'@mui/material/Popper';import Pt from'dayjs';import {useTranslation}from'react-i18next';import {Calendar,DateObject}from'react-multi-date-picker';import Ko from'@mui/material/ClickAwayListener';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';import he from'@mui/material/Button';import q from'react-date-object';import ot from'react-date-object/calendars/arabic';import tt from'react-date-object/calendars/gregorian';import rt from'react-date-object/locales/arabic_ar';import nt from'react-date-object/locales/arabic_en';import it from'react-date-object/locales/gregorian_ar';import at from'react-date-object/locales/gregorian_en';var Ne=styled(S)(({theme:e})=>({color:e.palette.grey[700],fontSize:"9px",fontWeight:500,marginBottom:"6px"})),Ke=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({borderRadius:"4px",border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,height:32,padding:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",...o&&{border:`1px solid ${e.palette.info.dark}`,background:e.palette.common.white,boxShadow:e.shadows[7]}})),_e=styled(S)(({theme:e})=>({borderRadius:"8px",background:e.palette.common.white,boxShadow:"0px 8px 36px 0px rgba(0, 0, 0, 0.15)",textAlign:"center",color:e.palette.grey[900],fontSize:"12px",fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",flexDirection:"column"})),qe=styled(S)(({theme:e})=>({width:71,padding:"4px 0",cursor:"pointer","&:hover, &.active":{borderRadius:"100px",background:e.palette.info.light}}));var Je={day:"Day",month:"Month",quarter:"Quarter",year:"Year"};function qo({sx:e,groupBy:o,isCalenderOpen:a$1,onUpdate:t}){let[n,p]=useState(null),l=!!n&&a$1,{t:m}=useTranslation(),c=()=>{p(null);},u=d=>{p(d.currentTarget);},s=d=>{t?.(d),c();};return jsx(Ko,{onClickAway:c,children:jsxs(S,{sx:e,children:[jsx(Ne,{children:m("groupedBy")}),jsxs(Ke,{onClick:u,open:l,children:[jsx("span",{children:Je[o]}),jsx(S,{component:"img",src:Vc,alt:"arrow",sx:{...l&&{transform:"rotate(180deg)"}}})]}),jsx(a,{open:l,anchorEl:n,children:jsx(_e,{sx:{width:n?.clientWidth},children:Object.entries(Je).map(([d,i])=>jsx(qe,{onClick:()=>{s(d);},className:o===d?"active":"",children:i},`${d}-groupedBy`))})})]})})}var Ve=memo(qo);var eo=Ve;var oo=styled(S)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"50px",paddingInline:"6px 12px",color:e.palette.text.primary,fontSize:"11px",display:"flex",gap:"8px",alignItems:"center",justifyContent:"space-between",height:32,marginTop:"8px",img:{width:16,height:16},"& > div":{display:"flex",alignItems:"center",gap:"2px"}}));function le({isHijri:e,onCalendarModeSwitch:o}){let{t:a}=useTranslation(),t=()=>{o?.(e?"gregorian":"hijri");};return jsx(S,{children:jsxs(oo,{children:[jsxs(S,{children:[jsx("img",{src:cc,alt:"hijri"}),jsx("span",{children:a("hijri")})]}),jsx(h,{checked:e,onChange:t})]})})}var no=le;var ao=styled(he)(({theme:e})=>({cursor:"pointer",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,color:e.palette.text.primary,fontSize:"11px",fontWeight:e.typography.fontWeightRegular,paddingInline:"12px",height:32,width:"max-content",textTransform:"unset","&:hover":{boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark}})),po=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"8px"}));var Z=({isHijri:e,isAr:o=false})=>e?o?rt:nt:o?it:at,J=e=>e?ot:tt,M=e=>e.setHour(0).setMinute(0).setSecond(0).setMillisecond(0),B=e=>e.setHour(23).setMinute(59).setSecond(59).setMillisecond(999),X=e=>{if(!(e?.[0]instanceof Date)||!(e?.[1]instanceof Date)){let[o$1,a]=o();return [new q(o$1),new q(a)]}return [new q(e?.[0]),new q(e?.[1])]};function ce({onChange:e,isHijri:o,isAr:a=false}){let t={locale:Z({isHijri:o,isAr:a}),calendar:J(o)},n=useMemo(()=>[{id:"today",value:[new DateObject(t),new DateObject(t)]},{id:"lastWeek",value:[new DateObject(t).subtract(6,"day"),new DateObject(t)]},{id:"lastMonth",value:[new DateObject(t).subtract(30,"day"),new DateObject(t)]},{id:new DateObject(t).subtract(1,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(1,"month").toFirstOfMonth(),new DateObject(t).subtract(1,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(2,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(2,"month").toFirstOfMonth(),new DateObject(t).subtract(2,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(3,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(3,"month").toFirstOfMonth(),new DateObject(t).subtract(3,"month").toLastOfMonth()]}],[o,a]),{t:p}=useTranslation();return jsx(S,{"data-testid":"RangeCalender_QuickFilters",children:jsx(po,{children:n.map(l=>jsx(ao,{onClick:m=>{m.preventDefault(),e(l.value);},children:p(l.id)},l.id))})})}var so=ce;var lo=styled(he)(()=>({minWidth:"auto",padding:0,"& > img":{cursor:"pointer"}}));var ft=["Su","Mo","Tu","We","Th","Fr","Sa"];function gt({isAr:e=false,isHijri:o,values:a,onChange:t,numberOfMonths:n=2,...p},l){let m=c=>c==="right"?e?dc:ec:e?ec:dc;return jsx(Calendar,{ref:l,numberOfMonths:n,value:a,onChange:t,calendar:J(o),locale:Z({isHijri:o,isAr:e}),range:true,format:"MMM DD",monthYearSeparator:" ",renderButton:(c,u)=>jsx(lo,{onClick:u,children:jsx("img",{src:m(c),alt:"arrow"})}),weekDays:e?void 0:ft,maxDate:new Date,...p})}var mo=forwardRef(gt);var co=mo;var uo=styled(S)(()=>({'[class$="-IndicatorsContainer2"]':{display:"none"},"#react-select-2-listbox":{width:300}})),V=styled(S)(({theme:e})=>({borderRadius:e.spacing(.5),border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,boxShadow:e.shadows[10],minWidth:200,width:"max-content",overflow:"auto"})),fo=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({width:156,fontSize:"11px",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,minHeight:32,borderRadius:"4px",padding:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",cursor:"pointer",display:"flex",alignItems:"center",gap:e.spacing(1),fontWeight:500,...o&&{borderRadius:"4px",boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark,background:e.palette.common.white},span:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}})),L=styled(S)(({theme:e})=>({padding:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",gap:e.spacing(1),height:33,cursor:"pointer","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"},"&+&":{borderTop:"1px solid",borderColor:e.palette.divider},"&.active span":{fontWeight:500},span:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}})),A=styled(S)(()=>({width:12,height:12})),W=styled(S)(({theme:e})=>({fontSize:"11px",color:e.palette.text.secondary,lineHeight:"15.03px","&.selected":{color:e.palette.info.dark}}));function ge({selectedTimezone:e,onChange:o,timezoneCountriesCodes:a,defaultCountryTimezone:t}){let[n,p]=useState(null),l=i=>{n||p(i.currentTarget);},m=()=>{n&&p(null);},c=(i,D)=>{i.stopPropagation(),o(D);},u=useMemo(()=>a?.map(i=>lc(i)),[a]),s=useMemo(()=>u?.some(i=>e?.timezone===i?.timezone),[u,e]),d=useMemo(()=>e&&s?e:t,[e,t,s]);return jsxs(L,{onMouseEnter:l,onMouseLeave:m,onClick:()=>{e&&o(d);},children:[s?jsx("img",{src:Zj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Xj,alt:"entity-timezone"}),jsx(a$1,{countryCode:d?.countryCode}),jsx(W,{className:s?"selected":"",children:s?e?.label:t?.label}),jsx(bt,{open:!!n,anchorEl:n,placement:"right-start",sx:{zIndex:3},disablePortal:true,children:jsx(V,{sx:{maxHeight:300},children:u?.map((i,D)=>{let j=i?.timezone===e?.timezone;return jsxs(L,{onClick:te=>{c(te,i);},sx:{gap:"4px"},children:[j?jsx("img",{src:Zj,alt:"icon"}):jsx(A,{}),jsx(a$1,{countryCode:i?.countryCode}),jsx(W,{className:j?"selected":"",children:i?.label})]},`timezone-item-${D}`)})})})]})}function xe({onChange:e,selectedTimezone:o,browserTimezone:a}){let t=useMemo(()=>U.find(({timezone:l})=>l===a),[a]),n=()=>{t&&e(t);},p=t?.timezone===o?.timezone;return jsxs(L,{onClick:n,children:[p?jsx("img",{src:Zj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Wj,alt:"user-timezone"}),jsx(a$1,{countryCode:t?.countryCode}),jsx(W,{className:p?"selected":"",children:t?.label})]})}function St({onChange:e,selectedTimezone:o,browserTimezone:a,defaultCountryTimezone:t,timezoneCountriesCodes:n}){let[p,l]=useState(null),m=!!p,c=()=>{l(null);},u=i=>{e(i),c();},s=i=>{l(i.currentTarget);},d=useMemo(()=>a===o?.timezone?Wj:o?.timezone===t.timezone?Xj:Yj,[a,t.timezone,o?.timezone]);return jsx(Ko,{onClickAway:c,children:jsxs(uo,{"data-testid":"CustomTimezone",children:[jsxs(fo,{open:m,onClick:s,children:[jsx("img",{src:d,alt:"timezone-icon"}),jsx(a$1,{countryCode:o?.countryCode}),jsx("span",{children:o?.label})]}),jsx(bt,{open:m,anchorEl:p,placement:"top-start",sx:{zIndex:1400},children:jsxs(V,{"data-testid":"CustomTimezone_dropdown",children:[jsx(ge,{onChange:u,selectedTimezone:o,defaultCountryTimezone:t,timezoneCountriesCodes:n}),jsx(xe,{onChange:u,selectedTimezone:o,browserTimezone:a})]})})]})})}var xo=memo(St);var bo=xo;var ho=styled(S)(({theme:e})=>({display:"flex",marginTop:"8px",background:e.palette.common.white,boxShadow:e.shadows[9],borderRadius:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",".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"},".rmdp-day.rmdp-disabled":{color:"#ccc",cursor:"not-allowed"}})),yo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",background:"transparent",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,fontWeight:500,borderRadius:"4px","&:hover":{background:"transparent",color:e.palette.text.primary}})),wo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",borderRadius:"4px",fontWeight:700,background:e.palette.info.dark,"&:hover":{background:e.palette.info.dark}})),Co=styled(S)(()=>({display:"flex",gap:8})),To=styled(he,{shouldForwardProp:e=>e!=="open"})(({open:e,theme:o})=>({color:o.palette.text.primary,fontSize:"11px",fontWeight:500,padding:o.spacing(1),borderRadius:"4px",border:"1px solid",borderColor:o.palette.divider,background:o.palette.common.white,textTransform:"none",height:32,...e&&{border:"1px solid",borderColor:o.palette.info.dark,boxShadow:o.shadows[7]}})),ko=styled(S)(({theme:e})=>({background:e.palette.common.white,display:"flex",justifyContent:"space-between",alignItems:"center",gap:10,padding:"16px",borderTop:"1px solid",borderColor:e.palette.divider,borderBottomRightRadius:"8px"})),zo=styled(S)(({theme:e})=>({padding:16,paddingInlineEnd:"23px",borderRight:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,width:"max-content",borderTopLeftRadius:"8px",borderBottomLeftRadius:"8px",display:"flex",flexDirection:"column",gap:10,justifyContent:"space-between"})),So=styled(S)(()=>({display:"flex",alignItems:"center",gap:"10px"})),vo=styled(S)(()=>({position:"relative"})),Do=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"24px"}));var Mo=styled(S,{shouldForwardProp:e=>e!=="isAllDay"})(({theme:e,isAllDay:o})=>({display:"flex",alignItems:"center",gap:e.spacing(1),position:"relative",paddingInline:"5px",".label":{width:"max-content"},...!o&&{paddingRight:e.spacing(1),"&:after":{content:'""',position:"absolute",width:"1px",background:e.palette.divider,right:0,height:17}}})),Bo=styled(S)(()=>({width:235})),Eo=styled(S)(({theme:e})=>({display:"flex",gap:"4px",".rmdp-input":{width:"64px",borderRadius:"19px",border:"1px solid",borderColor:e.palette.divider,color:e.palette.text.primary,fontSize:"11px",fontWeight:500,background:"transparent",cursor:"pointer"},".rmdp-input:focus":{boxShadow:e.shadows[7],border:`1px solid ${e.palette.info.dark}`,borderRadius:"19px"},".rmdp-time-picker":{boxShadow:e.shadows[5],borderRadius:e.spacing(1),padding:e.spacing(2),minWidth:"auto !important",div:{marginTop:0,display:"block"},"> div":{width:32,height:64},".rmdp-arrow":{borderColor:`${e.palette.background.transparent[1]} !important`},".rmdp-arrow-container":{justifyContent:"center","&:hover":{backgroundColor:"transparent",boxShadow:"unset"}},input:{borderRadius:"4px",border:`1px solid ${e.palette.divider}`,padding:0,width:32,height:32,fontSize:"11px",color:e.palette.text.primary,fontWeight:500,"&:focus, &:focus-visible":{border:`1px solid ${e.palette.info.dark}`,outline:"unset"}},".dvdr":{margin:"7px 4px 0"},".rmdp-am, .rmdp-pm":{margin:0,width:32,height:32,flex:"auto",justifyContent:"center",fontSize:"11px",color:e.palette.text.primary,fontWeight:500,display:"flex",cursor:"default"},"> div:last-child":{marginInlineStart:"4px",display:"block !important"},".rmdp-down, .rmdp-up":{position:"relative",i:{display:"none"},"&:before":{content:'""',position:"absolute",top:"5px",width:"10px",height:"10px",backgroundImage:`url(${Uc})`}},".rmdp-down:before":{transform:"rotate(180deg)"}},".rmdp-container":{position:"relative","> div":{top:"unset !important",bottom:"28px",transform:"unset !important"}}})),Oo=styled(S)(({theme:e})=>({display:"flex",gap:"8px",alignItems:"center",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,paddingInline:"5px",width:"fit-content",height:32}));function Mt({values:e,setValues:o}){let{t:a}=useTranslation(),t=new DateObject(e[0]),n=new DateObject(e[1]),[p,l]=useState(t.dayOfYear===n.dayOfYear&&t.hour===0&&t.minute===0&&n.hour===23&&n.minute===59),m=({period:s,hour:d})=>s==="PM"&&d!==12?d+12:s==="AM"&&d===12?0:d,c=({hour:s,minute:d,period:i})=>{o([t.setHour(m({hour:s,period:i})).setMinute(d).setSecond(0),n]);},u=({hour:s,minute:d,period:i})=>{o([t,n.setHour(m({hour:s,period:i})).setMinute(d).setSecond(59)]);};return jsx(Bo,{children:jsxs(Oo,{children:[jsxs(Mo,{isAllDay:p,children:[jsx("span",{className:"label",children:a("allDay")}),jsx(h,{checked:p,onChange:s=>{l(!p),s.target.checked?o([M(e[0]),B(e[1])]):o(e);}})]}),!p&&jsxs(Eo,{children:[jsx(j,{defaultTime:{hour:a$4(t.hour),minute:t.minute,period:t.hour>=12?"PM":"AM"},size:"small",onChange:c,enableRealTimeChange:true},`${e[0]?.toString()}-start`),jsx(j,{defaultTime:{hour:a$4(n.hour),minute:n.minute,period:n.hour>=12?"PM":"AM"},size:"small",onChange:u,enableRealTimeChange:true},`${e[1]?.toString()}-end`)]})]})})}var Io=Mt;var Po=Io;function At({defaultDate:e,onDateChange:o,mode:a="gregorian",onCalendarModeSwitch:t,numberOfMonths:n,noTimezone:p,noQuickFilter:l,maxDateRange:m,onCalendarGroupChange:c,groupBy:u,timezone:s,onChangeTimezone:d,browserTimezone:i,renderCalendarButton:D,mainSx:j,popperProps:te,rangeDatePickerProps:Wo,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te}){let[w,ke]=useState(X(e)),[x$1,C]=useState(w),[ze,Se]=useState(s??null),[ve,Fo]=useState(u||"day"),[De,Me]=useState(null),y=!!De,[Be,Ee]=useState(false),{t:re}=useTranslation(),I=useRef(null),Ho=yc(useId(),"range-calender"),ne=a==="hijri",Y=()=>{Me(null);},Oe=r=>{Me(r.currentTarget);};useEffect(()=>{if(!y){if(n===1)return;C(X(e));}},[y]),useEffect(()=>{if(e){let r=X(e);ke(r),C(r),I.current&&I.current.set("date",r[0]);}},[e]),useEffect(()=>{Se(s??null);},[s,y]);let Re=()=>{ke(x$1),Y();let r;x$1[0].dayOfYear===x$1[1].dayOfYear?r=[x$1[0],x$1[1]]:r=[M(x$1[0]),B(x$1[1])],o([r[0].toDate(),r[1].toDate()]),c?.(ve||"day"),d?.(ze);},jo=useCallback(()=>{let r=w[0].format("MMM D"),G=w[1]?w[1].format("MMM D"):w[0].format("MMM D");return r===G&&!p?r:`${r} - ${G}`},[w,p]),Yo=r=>{if(r.length<2||!m){C(r);return}let G=M(r[0]).toDate(),Qo=B(r[1]).toDate(),Ie=Pt(Qo).diff(G,"day");if(Ie<=m){C(r);return}Ee(true),C([r[0],r[1].subtract(Ie-m,"d")]),setTimeout(()=>{Ee(false);},3e3);},Go=r=>{C([M(r[0]),B(r[1])]),I.current&&I.current.set("date",r[0]);},$o=r=>{r.key==="Enter"&&x$1[1]&&!Be?(r.stopPropagation(),Re()):r.key==="Escape"&&(r.stopPropagation(),Y());};return jsxs(vo,{id:Ho,"data-testid":"RangeCalender",sx:j,children:[D?D(y,Oe):jsx(To,{onClick:Oe,open:y,children:(w[0]||w[1])&&jo()}),y&&jsx(a$2,{onClick:r=>{r.stopPropagation(),Y();}}),jsx(bt,{open:y,anchorEl:De,placement:"bottom-end",...te,children:jsxs(ho,{onKeyDown:$o,children:[!l&&jsxs(zo,{children:[jsx(so,{onChange:Go,isHijri:ne}),jsxs(Do,{children:[u&&jsx(eo,{groupBy:ve,isCalenderOpen:y,onUpdate:r=>{Fo(r);}}),jsx(no,{isHijri:ne,onCalendarModeSwitch:t})]})]}),jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(co,{values:x$1,onChange:Yo,isHijri:ne,ref:I,numberOfMonths:n,...Wo}),jsx(x,{in:Be&&!!m,children:jsx(a$3,{error:re("dateRangeError",{number:m}),sx:{marginInline:"16px",marginBottom:"16px"}})}),jsxs(ko,{sx:{borderBottomLeftRadius:"8px"},children:[!p&&Ce&&i&&Te?jsx(So,{children:jsx(bo,{onChange:Se,selectedTimezone:ze,browserTimezone:i,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te},String(y))}):jsx("div",{}),new DateObject(x$1[0]).dayOfYear===new DateObject(x$1[1]).dayOfYear&&jsx(Po,{values:x$1,setValues:C}),jsxs(Co,{children:[jsx(yo,{variant:"contained",onClick:Y,children:re("cancel")}),jsx(wo,{variant:"contained",onClick:Re,disabled:!x$1[1],children:re("okay")})]})]})]})]})})]})}var Ao=At;var xi=Ao;export{xi as a};
1
+ import {a as a$3}from'./chunk-BQGQQ2MC.js';import {j,a as a$4}from'./chunk-VJTGGGCJ.js';import {a}from'./chunk-P2VRYOKF.js';import {a as a$1}from'./chunk-MQFXJL5S.js';import {a as a$2}from'./chunk-RIJFII4O.js';import {x,h}from'./chunk-7PJX5ZKM.js';import {lc,yc,o}from'./chunk-2SKLD6QR.js';import {U}from'./chunk-FH3OCBAM.js';import {Uc,Vc,Wj,Xj,Yj,dc,ec,Zj,cc}from'./chunk-OK75VWGZ.js';import {memo,forwardRef,useState,useMemo,useRef,useId,useEffect,useCallback}from'react';import S from'@mui/material/Box';import bt from'@mui/material/Popper';import Pt from'dayjs';import {useTranslation}from'react-i18next';import {Calendar,DateObject}from'react-multi-date-picker';import Ko from'@mui/material/ClickAwayListener';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';import he from'@mui/material/Button';import q from'react-date-object';import ot from'react-date-object/calendars/arabic';import tt from'react-date-object/calendars/gregorian';import rt from'react-date-object/locales/arabic_ar';import nt from'react-date-object/locales/arabic_en';import it from'react-date-object/locales/gregorian_ar';import at from'react-date-object/locales/gregorian_en';var Ne=styled(S)(({theme:e})=>({color:e.palette.grey[700],fontSize:"9px",fontWeight:500,marginBottom:"6px"})),Ke=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({borderRadius:"4px",border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,height:32,padding:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",...o&&{border:`1px solid ${e.palette.info.dark}`,background:e.palette.common.white,boxShadow:e.shadows[7]}})),_e=styled(S)(({theme:e})=>({borderRadius:"8px",background:e.palette.common.white,boxShadow:"0px 8px 36px 0px rgba(0, 0, 0, 0.15)",textAlign:"center",color:e.palette.grey[900],fontSize:"12px",fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",flexDirection:"column"})),qe=styled(S)(({theme:e})=>({width:71,padding:"4px 0",cursor:"pointer","&:hover, &.active":{borderRadius:"100px",background:e.palette.info.light}}));var Je={day:"Day",month:"Month",quarter:"Quarter",year:"Year"};function qo({sx:e,groupBy:o,isCalenderOpen:a$1,onUpdate:t}){let[n,p]=useState(null),l=!!n&&a$1,{t:m}=useTranslation(),c=()=>{p(null);},u=d=>{p(d.currentTarget);},s=d=>{t?.(d),c();};return jsx(Ko,{onClickAway:c,children:jsxs(S,{sx:e,children:[jsx(Ne,{children:m("groupedBy")}),jsxs(Ke,{onClick:u,open:l,children:[jsx("span",{children:Je[o]}),jsx(S,{component:"img",src:Vc,alt:"arrow",sx:{...l&&{transform:"rotate(180deg)"}}})]}),jsx(a,{open:l,anchorEl:n,children:jsx(_e,{sx:{width:n?.clientWidth},children:Object.entries(Je).map(([d,i])=>jsx(qe,{onClick:()=>{s(d);},className:o===d?"active":"",children:i},`${d}-groupedBy`))})})]})})}var Ve=memo(qo);var eo=Ve;var oo=styled(S)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"50px",paddingInline:"6px 12px",color:e.palette.text.primary,fontSize:"11px",display:"flex",gap:"8px",alignItems:"center",justifyContent:"space-between",height:32,marginTop:"8px",img:{width:16,height:16},"& > div":{display:"flex",alignItems:"center",gap:"2px"}}));function le({isHijri:e,onCalendarModeSwitch:o}){let{t:a}=useTranslation(),t=()=>{o?.(e?"gregorian":"hijri");};return jsx(S,{children:jsxs(oo,{children:[jsxs(S,{children:[jsx("img",{src:cc,alt:"hijri"}),jsx("span",{children:a("hijri")})]}),jsx(h,{checked:e,onChange:t})]})})}var no=le;var ao=styled(he)(({theme:e})=>({cursor:"pointer",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,color:e.palette.text.primary,fontSize:"11px",fontWeight:e.typography.fontWeightRegular,paddingInline:"12px",height:32,width:"max-content",textTransform:"unset","&:hover":{boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark}})),po=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"8px"}));var Z=({isHijri:e,isAr:o=false})=>e?o?rt:nt:o?it:at,J=e=>e?ot:tt,M=e=>e.setHour(0).setMinute(0).setSecond(0).setMillisecond(0),B=e=>e.setHour(23).setMinute(59).setSecond(59).setMillisecond(999),X=e=>{if(!(e?.[0]instanceof Date)||!(e?.[1]instanceof Date)){let[o$1,a]=o();return [new q(o$1),new q(a)]}return [new q(e?.[0]),new q(e?.[1])]};function ce({onChange:e,isHijri:o,isAr:a=false}){let t={locale:Z({isHijri:o,isAr:a}),calendar:J(o)},n=useMemo(()=>[{id:"today",value:[new DateObject(t),new DateObject(t)]},{id:"lastWeek",value:[new DateObject(t).subtract(6,"day"),new DateObject(t)]},{id:"lastMonth",value:[new DateObject(t).subtract(30,"day"),new DateObject(t)]},{id:new DateObject(t).subtract(1,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(1,"month").toFirstOfMonth(),new DateObject(t).subtract(1,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(2,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(2,"month").toFirstOfMonth(),new DateObject(t).subtract(2,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(3,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(3,"month").toFirstOfMonth(),new DateObject(t).subtract(3,"month").toLastOfMonth()]}],[o,a]),{t:p}=useTranslation();return jsx(S,{"data-testid":"RangeCalender_QuickFilters",children:jsx(po,{children:n.map(l=>jsx(ao,{onClick:m=>{m.preventDefault(),e(l.value);},children:p(l.id)},l.id))})})}var so=ce;var lo=styled(he)(()=>({minWidth:"auto",padding:0,"& > img":{cursor:"pointer"}}));var ft=["Su","Mo","Tu","We","Th","Fr","Sa"];function gt({isAr:e=false,isHijri:o,values:a,onChange:t,numberOfMonths:n=2,...p},l){let m=c=>c==="right"?e?dc:ec:e?ec:dc;return jsx(Calendar,{ref:l,numberOfMonths:n,value:a,onChange:t,calendar:J(o),locale:Z({isHijri:o,isAr:e}),range:true,format:"MMM DD",monthYearSeparator:" ",renderButton:(c,u)=>jsx(lo,{onClick:u,children:jsx("img",{src:m(c),alt:"arrow"})}),weekDays:e?void 0:ft,maxDate:new Date,...p})}var mo=forwardRef(gt);var co=mo;var uo=styled(S)(()=>({'[class$="-IndicatorsContainer2"]':{display:"none"},"#react-select-2-listbox":{width:300}})),V=styled(S)(({theme:e})=>({borderRadius:e.spacing(.5),border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,boxShadow:e.shadows[10],minWidth:200,width:"max-content",overflow:"auto"})),fo=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({width:156,fontSize:"11px",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,minHeight:32,borderRadius:"4px",padding:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",cursor:"pointer",display:"flex",alignItems:"center",gap:e.spacing(1),fontWeight:500,...o&&{borderRadius:"4px",boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark,background:e.palette.common.white},span:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}})),L=styled(S)(({theme:e})=>({padding:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",gap:e.spacing(1),height:33,cursor:"pointer","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"},"&+&":{borderTop:"1px solid",borderColor:e.palette.divider},"&.active span":{fontWeight:500},span:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}})),A=styled(S)(()=>({width:12,height:12})),W=styled(S)(({theme:e})=>({fontSize:"11px",color:e.palette.text.secondary,lineHeight:"15.03px","&.selected":{color:e.palette.info.dark}}));function ge({selectedTimezone:e,onChange:o,timezoneCountriesCodes:a,defaultCountryTimezone:t}){let[n,p]=useState(null),l=i=>{n||p(i.currentTarget);},m=()=>{n&&p(null);},c=(i,D)=>{i.stopPropagation(),o(D);},u=useMemo(()=>a?.map(i=>lc(i)),[a]),s=useMemo(()=>u?.some(i=>e?.timezone===i?.timezone),[u,e]),d=useMemo(()=>e&&s?e:t,[e,t,s]);return jsxs(L,{onMouseEnter:l,onMouseLeave:m,onClick:()=>{e&&o(d);},children:[s?jsx("img",{src:Zj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Xj,alt:"entity-timezone"}),jsx(a$1,{countryCode:d?.countryCode}),jsx(W,{className:s?"selected":"",children:s?e?.label:t?.label}),jsx(bt,{open:!!n,anchorEl:n,placement:"right-start",sx:{zIndex:3},disablePortal:true,children:jsx(V,{sx:{maxHeight:300},children:u?.map((i,D)=>{let j=i?.timezone===e?.timezone;return jsxs(L,{onClick:te=>{c(te,i);},sx:{gap:"4px"},children:[j?jsx("img",{src:Zj,alt:"icon"}):jsx(A,{}),jsx(a$1,{countryCode:i?.countryCode}),jsx(W,{className:j?"selected":"",children:i?.label})]},`timezone-item-${D}`)})})})]})}function xe({onChange:e,selectedTimezone:o,browserTimezone:a}){let t=useMemo(()=>U.find(({timezone:l})=>l===a),[a]),n=()=>{t&&e(t);},p=t?.timezone===o?.timezone;return jsxs(L,{onClick:n,children:[p?jsx("img",{src:Zj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Wj,alt:"user-timezone"}),jsx(a$1,{countryCode:t?.countryCode}),jsx(W,{className:p?"selected":"",children:t?.label})]})}function St({onChange:e,selectedTimezone:o,browserTimezone:a,defaultCountryTimezone:t,timezoneCountriesCodes:n}){let[p,l]=useState(null),m=!!p,c=()=>{l(null);},u=i=>{e(i),c();},s=i=>{l(i.currentTarget);},d=useMemo(()=>a===o?.timezone?Wj:o?.timezone===t.timezone?Xj:Yj,[a,t.timezone,o?.timezone]);return jsx(Ko,{onClickAway:c,children:jsxs(uo,{"data-testid":"CustomTimezone",children:[jsxs(fo,{open:m,onClick:s,children:[jsx("img",{src:d,alt:"timezone-icon"}),jsx(a$1,{countryCode:o?.countryCode}),jsx("span",{children:o?.label})]}),jsx(bt,{open:m,anchorEl:p,placement:"top-start",sx:{zIndex:1400},children:jsxs(V,{"data-testid":"CustomTimezone_dropdown",children:[jsx(ge,{onChange:u,selectedTimezone:o,defaultCountryTimezone:t,timezoneCountriesCodes:n}),jsx(xe,{onChange:u,selectedTimezone:o,browserTimezone:a})]})})]})})}var xo=memo(St);var bo=xo;var ho=styled(S)(({theme:e})=>({display:"flex",marginTop:"8px",background:e.palette.common.white,boxShadow:e.shadows[9],borderRadius:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",".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"},".rmdp-day.rmdp-disabled":{color:"#ccc",cursor:"not-allowed"}})),yo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",background:"transparent",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,fontWeight:500,borderRadius:"4px","&:hover":{background:"transparent",color:e.palette.text.primary}})),wo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",borderRadius:"4px",fontWeight:700,background:e.palette.info.dark,"&:hover":{background:e.palette.info.dark}})),Co=styled(S)(()=>({display:"flex",gap:8})),To=styled(he,{shouldForwardProp:e=>e!=="open"})(({open:e,theme:o})=>({color:o.palette.text.primary,fontSize:"11px",fontWeight:500,padding:o.spacing(1),borderRadius:"4px",border:"1px solid",borderColor:o.palette.divider,background:o.palette.common.white,textTransform:"none",height:32,...e&&{border:"1px solid",borderColor:o.palette.info.dark,boxShadow:o.shadows[7]}})),ko=styled(S)(({theme:e})=>({background:e.palette.common.white,display:"flex",justifyContent:"space-between",alignItems:"center",gap:10,padding:"16px",borderTop:"1px solid",borderColor:e.palette.divider,borderBottomRightRadius:"8px"})),zo=styled(S)(({theme:e})=>({padding:16,paddingInlineEnd:"23px",borderRight:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,width:"max-content",borderTopLeftRadius:"8px",borderBottomLeftRadius:"8px",display:"flex",flexDirection:"column",gap:10,justifyContent:"space-between"})),So=styled(S)(()=>({display:"flex",alignItems:"center",gap:"10px"})),vo=styled(S)(()=>({position:"relative"})),Do=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"24px"}));var Mo=styled(S,{shouldForwardProp:e=>e!=="isAllDay"})(({theme:e,isAllDay:o})=>({display:"flex",alignItems:"center",gap:e.spacing(1),position:"relative",paddingInline:"5px",".label":{width:"max-content"},...!o&&{paddingRight:e.spacing(1),"&:after":{content:'""',position:"absolute",width:"1px",background:e.palette.divider,right:0,height:17}}})),Bo=styled(S)(()=>({width:235})),Eo=styled(S)(({theme:e})=>({display:"flex",gap:"4px",".rmdp-input":{width:"64px",borderRadius:"19px",border:"1px solid",borderColor:e.palette.divider,color:e.palette.text.primary,fontSize:"11px",fontWeight:500,background:"transparent",cursor:"pointer"},".rmdp-input:focus":{boxShadow:e.shadows[7],border:`1px solid ${e.palette.info.dark}`,borderRadius:"19px"},".rmdp-time-picker":{boxShadow:e.shadows[5],borderRadius:e.spacing(1),padding:e.spacing(2),minWidth:"auto !important",div:{marginTop:0,display:"block"},"> div":{width:32,height:64},".rmdp-arrow":{borderColor:`${e.palette.background.transparent[1]} !important`},".rmdp-arrow-container":{justifyContent:"center","&:hover":{backgroundColor:"transparent",boxShadow:"unset"}},input:{borderRadius:"4px",border:`1px solid ${e.palette.divider}`,padding:0,width:32,height:32,fontSize:"11px",color:e.palette.text.primary,fontWeight:500,"&:focus, &:focus-visible":{border:`1px solid ${e.palette.info.dark}`,outline:"unset"}},".dvdr":{margin:"7px 4px 0"},".rmdp-am, .rmdp-pm":{margin:0,width:32,height:32,flex:"auto",justifyContent:"center",fontSize:"11px",color:e.palette.text.primary,fontWeight:500,display:"flex",cursor:"default"},"> div:last-child":{marginInlineStart:"4px",display:"block !important"},".rmdp-down, .rmdp-up":{position:"relative",i:{display:"none"},"&:before":{content:'""',position:"absolute",top:"5px",width:"10px",height:"10px",backgroundImage:`url(${Uc})`}},".rmdp-down:before":{transform:"rotate(180deg)"}},".rmdp-container":{position:"relative","> div":{top:"unset !important",bottom:"28px",transform:"unset !important"}}})),Oo=styled(S)(({theme:e})=>({display:"flex",gap:"8px",alignItems:"center",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,paddingInline:"5px",width:"fit-content",height:32}));function Mt({values:e,setValues:o}){let{t:a}=useTranslation(),t=new DateObject(e[0]),n=new DateObject(e[1]),[p,l]=useState(t.dayOfYear===n.dayOfYear&&t.hour===0&&t.minute===0&&n.hour===23&&n.minute===59),m=({period:s,hour:d})=>s==="PM"&&d!==12?d+12:s==="AM"&&d===12?0:d,c=({hour:s,minute:d,period:i})=>{o([t.setHour(m({hour:s,period:i})).setMinute(d).setSecond(0),n]);},u=({hour:s,minute:d,period:i})=>{o([t,n.setHour(m({hour:s,period:i})).setMinute(d).setSecond(59)]);};return jsx(Bo,{children:jsxs(Oo,{children:[jsxs(Mo,{isAllDay:p,children:[jsx("span",{className:"label",children:a("allDay")}),jsx(h,{checked:p,onChange:s=>{l(!p),s.target.checked?o([M(e[0]),B(e[1])]):o(e);}})]}),!p&&jsxs(Eo,{children:[jsx(j,{defaultTime:{hour:a$4(t.hour),minute:t.minute,period:t.hour>=12?"PM":"AM"},size:"small",onChange:c,enableRealTimeChange:true},`${e[0]?.toString()}-start`),jsx(j,{defaultTime:{hour:a$4(n.hour),minute:n.minute,period:n.hour>=12?"PM":"AM"},size:"small",onChange:u,enableRealTimeChange:true},`${e[1]?.toString()}-end`)]})]})})}var Io=Mt;var Po=Io;function At({defaultDate:e,onDateChange:o,mode:a="gregorian",onCalendarModeSwitch:t,numberOfMonths:n,noTimezone:p,noQuickFilter:l,maxDateRange:m,onCalendarGroupChange:c,groupBy:u,timezone:s,onChangeTimezone:d,browserTimezone:i,renderCalendarButton:D,mainSx:j,popperProps:te,rangeDatePickerProps:Wo,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te}){let[w,ke]=useState(X(e)),[x$1,C]=useState(w),[ze,Se]=useState(s??null),[ve,Fo]=useState(u||"day"),[De,Me]=useState(null),y=!!De,[Be,Ee]=useState(false),{t:re}=useTranslation(),I=useRef(null),Ho=yc(useId(),"range-calender"),ne=a==="hijri",Y=()=>{Me(null);},Oe=r=>{Me(r.currentTarget);};useEffect(()=>{if(!y){if(n===1)return;C(X(e));}},[y]),useEffect(()=>{if(e){let r=X(e);ke(r),C(r),I.current&&I.current.set("date",r[0]);}},[e]),useEffect(()=>{Se(s??null);},[s,y]);let Re=()=>{ke(x$1),Y();let r;x$1[0].dayOfYear===x$1[1].dayOfYear?r=[x$1[0],x$1[1]]:r=[M(x$1[0]),B(x$1[1])],o([r[0].toDate(),r[1].toDate()]),c?.(ve||"day"),d?.(ze);},jo=useCallback(()=>{let r=w[0].format("MMM D"),G=w[1]?w[1].format("MMM D"):w[0].format("MMM D");return r===G&&!p?r:`${r} - ${G}`},[w,p]),Yo=r=>{if(r.length<2||!m){C(r);return}let G=M(r[0]).toDate(),Qo=B(r[1]).toDate(),Ie=Pt(Qo).diff(G,"day");if(Ie<=m){C(r);return}Ee(true),C([r[0],r[1].subtract(Ie-m,"d")]),setTimeout(()=>{Ee(false);},3e3);},Go=r=>{C([M(r[0]),B(r[1])]),I.current&&I.current.set("date",r[0]);},$o=r=>{r.key==="Enter"&&x$1[1]&&!Be?(r.stopPropagation(),Re()):r.key==="Escape"&&(r.stopPropagation(),Y());};return jsxs(vo,{id:Ho,"data-testid":"RangeCalender",sx:j,children:[D?D(y,Oe):jsx(To,{onClick:Oe,open:y,children:(w[0]||w[1])&&jo()}),y&&jsx(a$2,{onClick:r=>{r.stopPropagation(),Y();}}),jsx(bt,{open:y,anchorEl:De,placement:"bottom-end",...te,children:jsxs(ho,{onKeyDown:$o,children:[!l&&jsxs(zo,{children:[jsx(so,{onChange:Go,isHijri:ne}),jsxs(Do,{children:[u&&jsx(eo,{groupBy:ve,isCalenderOpen:y,onUpdate:r=>{Fo(r);}}),jsx(no,{isHijri:ne,onCalendarModeSwitch:t})]})]}),jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(co,{values:x$1,onChange:Yo,isHijri:ne,ref:I,numberOfMonths:n,...Wo}),jsx(x,{in:Be&&!!m,children:jsx(a$3,{error:re("dateRangeError",{number:m}),sx:{marginInline:"16px",marginBottom:"16px"}})}),jsxs(ko,{sx:{borderBottomLeftRadius:"8px"},children:[!p&&Ce&&i&&Te?jsx(So,{children:jsx(bo,{onChange:Se,selectedTimezone:ze,browserTimezone:i,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te},String(y))}):jsx("div",{}),new DateObject(x$1[0]).dayOfYear===new DateObject(x$1[1]).dayOfYear&&jsx(Po,{values:x$1,setValues:C}),jsxs(Co,{children:[jsx(yo,{variant:"contained",onClick:Y,children:re("cancel")}),jsx(wo,{variant:"contained",onClick:Re,disabled:!x$1[1],children:re("okay")})]})]})]})]})})]})}var Ao=At;var xi=Ao;export{xi as a};