@tap-payments/os-micro-frontend-shared 0.3.53 → 0.3.55

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 (74) hide show
  1. package/build/_chunks/chunk-37U43T53.js +1 -0
  2. package/build/_chunks/{chunk-P6UOSG2K.js → chunk-7BPMONYF.js} +1 -1
  3. package/build/_chunks/{chunk-V3SDFZV6.js → chunk-APT3BVWW.js} +1 -1
  4. package/build/_chunks/{chunk-REQYDZGI.js → chunk-H4Z6QSUV.js} +1 -1
  5. package/build/_chunks/{chunk-CIPY3DVN.js → chunk-L4INJNGI.js} +1 -1
  6. package/build/_chunks/{chunk-ASOXT57Y.js → chunk-LAIYGNRX.js} +1 -1
  7. package/build/_chunks/chunk-LFAQ2TL6.js +2 -0
  8. package/build/_chunks/{chunk-IX5GYP5K.js → chunk-LNAEN3WK.js} +1 -1
  9. package/build/_chunks/{chunk-FTEWF2GF.js → chunk-NTOSLQOB.js} +1 -1
  10. package/build/components/ActiveFilterChip/index.js +1 -1
  11. package/build/components/Amount/index.js +1 -1
  12. package/build/components/AmountConversionFilter/index.js +1 -1
  13. package/build/components/AmountInput/index.js +1 -1
  14. package/build/components/AmountSlider/index.js +1 -1
  15. package/build/components/AppServices/index.js +1 -1
  16. package/build/components/AppServicesBar/index.js +1 -1
  17. package/build/components/AppWindowWrapper/index.js +1 -1
  18. package/build/components/BrandLogo/index.js +1 -1
  19. package/build/components/ColumnViews/index.js +1 -1
  20. package/build/components/ConfirmDialog/index.js +1 -1
  21. package/build/components/ConfirmDialog/styles.d.ts +2 -0
  22. package/build/components/CopyImage/index.js +1 -1
  23. package/build/components/CountryFilter/index.js +1 -1
  24. package/build/components/CurrencyFilter/index.js +1 -1
  25. package/build/components/Customer/index.js +1 -1
  26. package/build/components/DateFilter/index.js +1 -1
  27. package/build/components/Dialog/index.js +1 -1
  28. package/build/components/Discount/index.js +1 -1
  29. package/build/components/ExpandableSideBar/index.js +1 -1
  30. package/build/components/FileInputPreview/index.js +1 -1
  31. package/build/components/FileUpload/index.js +1 -1
  32. package/build/components/FilterDropdown/index.js +1 -1
  33. package/build/components/Filters/index.js +1 -1
  34. package/build/components/JSONViewer/index.js +1 -1
  35. package/build/components/LanguageDropdown/index.js +1 -1
  36. package/build/components/ListColumnFilter/index.js +1 -1
  37. package/build/components/ListHeader/index.js +1 -1
  38. package/build/components/MerchantCurrencyDropdown/index.js +1 -1
  39. package/build/components/MerchantLogo/index.js +1 -1
  40. package/build/components/MerchantsDropdown/index.js +1 -1
  41. package/build/components/MultiSelectDropdownButton/index.js +1 -1
  42. package/build/components/PartnersFilter/index.js +1 -1
  43. package/build/components/PaymentSourceFilter/index.js +1 -1
  44. package/build/components/PhoneFilter/index.js +1 -1
  45. package/build/components/RFH/index.js +1 -1
  46. package/build/components/ReceiptsViewer/index.js +1 -1
  47. package/build/components/ReferenceTypeFilter/index.js +1 -1
  48. package/build/components/SearchButton/index.js +1 -1
  49. package/build/components/StatusBar/index.js +1 -1
  50. package/build/components/StatusButton/index.js +1 -1
  51. package/build/components/StatusFilter/index.js +1 -1
  52. package/build/components/TableCells/index.js +1 -1
  53. package/build/components/TableReports/index.js +1 -1
  54. package/build/components/TreeDropdown/index.js +1 -1
  55. package/build/components/VAT/index.js +1 -1
  56. package/build/components/VerificationIcon/index.js +1 -1
  57. package/build/components/ViewColumnRadioFilter/index.js +1 -1
  58. package/build/components/VirtualTables/index.js +1 -1
  59. package/build/components/WindowSideBar/index.js +1 -1
  60. package/build/components/index.d.ts +0 -2
  61. package/build/components/index.js +1 -1
  62. package/build/index.js +1 -1
  63. package/package.json +1 -1
  64. package/build/_chunks/chunk-46SZS6PR.js +0 -1
  65. package/build/_chunks/chunk-AUH56PZU.js +0 -1
  66. package/build/_chunks/chunk-FATLXSXU.js +0 -2
  67. package/build/components/FlagDetails/FlagDetails.d.ts +0 -13
  68. package/build/components/FlagDetails/index.d.ts +0 -2
  69. package/build/components/FlagDetails/index.js +0 -1
  70. package/build/components/SimpleDialog/SimpleDialog.d.ts +0 -3
  71. package/build/components/SimpleDialog/index.d.ts +0 -3
  72. package/build/components/SimpleDialog/index.js +0 -1
  73. package/build/components/SimpleDialog/style.d.ts +0 -2
  74. package/build/components/SimpleDialog/type.d.ts +0 -8
@@ -0,0 +1,2 @@
1
+ import {b as b$3,a as a$a,t}from'./chunk-7BPMONYF.js';import {a as a$z}from'./chunk-K4YL4CRG.js';import {i,c as c$6,b as b$b,a as a$y,m,w,v as v$1,k as k$1,y,q as q$1,s as s$1,r as r$1}from'./chunk-EONOOYFB.js';import {a as a$A,f as f$3,e as e$2,b as b$d}from'./chunk-B2MFZGJA.js';import {a as a$p}from'./chunk-5SQ2UIG2.js';import {a as a$u}from'./chunk-K4SN3LO7.js';import {a as a$e}from'./chunk-7RAHCDIY.js';import {a as a$s}from'./chunk-LGPS5RO2.js';import {a as a$E}from'./chunk-63ZL4D7K.js';import {a as a$c}from'./chunk-7WK7QTQ5.js';import {a as a$t}from'./chunk-2MNOWCPU.js';import {a as a$m}from'./chunk-4KTKCGGI.js';import {a as a$n}from'./chunk-ITRLCRZB.js';import {a as a$D}from'./chunk-UUKARGJJ.js';import {a as a$7}from'./chunk-TU2SCFOD.js';import {a as a$r,h as h$3}from'./chunk-PNKENJSL.js';import {b as b$7,d as d$3,c as c$3}from'./chunk-HMLLP3RC.js';import {b as b$8,g as g$1}from'./chunk-3UNJIPSF.js';import {h as h$2}from'./chunk-DEF5RXM3.js';import {a as a$g}from'./chunk-JBKXMTQS.js';import {a as a$o}from'./chunk-Z3NENPQS.js';import {a as a$5}from'./chunk-7FV66XXW.js';import {a as a$6}from'./chunk-MC7J2YJG.js';import {a as a$8}from'./chunk-SIYSZLWJ.js';import {b as b$9}from'./chunk-AVG7ZSZR.js';import {c as c$7}from'./chunk-ZYHMKUR3.js';import {a as a$l}from'./chunk-EJGS5GBR.js';import {a as a$1,j as j$1,d as d$1,c as c$1,h as h$1,b as b$4,i as i$1,f as f$2,q,o as o$1,n,p as p$1,m as m$1}from'./chunk-KN4OFWFR.js';import {c as c$2}from'./chunk-37U43T53.js';import {b as b$2}from'./chunk-GWP4CQZX.js';import {a as a$j}from'./chunk-TGRKEJOI.js';import {a as a$4}from'./chunk-7UDF3OLZ.js';import {a as a$9}from'./chunk-DPGG3R6Y.js';import {a as a$h}from'./chunk-LGYFMKNY.js';import {a as a$B}from'./chunk-WN5DXLHY.js';import {a as a$C}from'./chunk-CUZ52HD6.js';import {r as r$2}from'./chunk-LAIYGNRX.js';import {b as b$6,c as c$4,d as d$4}from'./chunk-4RVTPLD5.js';import {a as a$q}from'./chunk-QEAQZT5Q.js';import {b as b$a}from'./chunk-QOORPGOD.js';import {a as a$d}from'./chunk-WDVD7D3W.js';import {a as a$3}from'./chunk-GNY2VGGW.js';import {a as a$w}from'./chunk-ETDFQHEI.js';import {a as a$x}from'./chunk-O4ZKAIR2.js';import {a as a$i}from'./chunk-RA5SLVSL.js';import {a as a$v}from'./chunk-PVUQJYPJ.js';import {f as f$1,a as a$k,b as b$5,d as d$2,c as c$5,e as e$1}from'./chunk-RFLSJO6T.js';import {e,b as b$c,c as c$8,d as d$5}from'./chunk-3XNQ2WGR.js';import {a as a$2}from'./chunk-KHM5KW53.js';import {a as a$b}from'./chunk-X3M2NK2A.js';import {a as a$f}from'./chunk-Y7L4MXPN.js';import {o,p,s}from'./chunk-R6O5OQBU.js';import {j,h,f,g,k,b,d,c,cb as cb$1,gb,eb as eb$1,Fa as Fa$1,Ga as Ga$1,Jc,Ua as Ua$1,H,lc as lc$1,Nb,Mb,Lb,bb as bb$1,v,Ja as Ja$1,fc as fc$1,hc,r,mb as mb$1,Gb,Hb as Hb$1,t as t$1,zb as zb$1,gc as gc$2,Xb as Xb$1,Jb as Jb$1,Kb as Kb$1,Ib as Ib$1,jc,Ra,Ma,Qa,oc,y as y$1,q as q$2,D,rb as rb$1,Gc}from'./chunk-4SYKYIKL.js';import {yb,vb,xb as xb$1,na as na$1,Sd as Sd$1,mj,nc as nc$1,li,ji as ji$1,ki,lh as lh$1,wg,Ch,Pe,Sj,ha,ik,$j,F,E,vo,fc,gc as gc$1,dc as dc$1,ka as ka$1,ra as ra$1,sl,pa,Ab,Bb as Bb$1,Cb,C,Hj,kh as kh$1,ub as ub$1,Ql,uh,th as th$1,fb,Pd as Pd$1,Te,Ui,hk,no,tb as tb$1,Xi,bj,Ei,Ji as Ji$1,Ln,fj,ej,Nc,Se,Sl,ei,A,Uc,Tc as Tc$1,We as We$1,sj,Ue,Ve,Db,Pg,Ug,Vg,Sg,Rg,Mg,Ng,Og,Kg,Lg,Wg,qj,oj,rj,H as H$1,In,G,sb,z,ba,aa as aa$1,T,gi,ii,hi,fi,mi,la as la$1,bk,kk as kk$1,ck,Uj,Wj,fk as fk$1,ak,Zj,_j,kn as kn$1,_b as _b$1,$b,yh as yh$1,dk,Xg as Xg$1,gh as gh$1,fh as fh$1,eh as eh$1,dh,ch as ch$1,bh as bh$1,ah as ah$1,$g,_g,Zg as Zg$1,Yg,Fh as Fh$1,Dh as Dh$1,Eh as Eh$1,Ih as Ih$1,Hh as Hh$1,_d,Vd,Zd as Zd$1,cn as cn$1,an,ci,mb as mb$2,Wd,Xd,nb as nb$1,Dg,Aj,zj,nh as nh$1,mh as mh$1,ph as ph$1,rh as rh$1,qh as qh$1,sh,he as he$1,pf,of,nf,mf,lf,qf,kf,za as za$1,ya as ya$1,hf,gf,ff,Qh as Qh$1,Ph as Ph$1,Sh as Sh$1,Rh as Rh$1,Th as Th$1,Kj,Ij,Jj,pj,rc,ni,sc as sc$1,ri,Mh as Mh$1,wd as wd$1,vk as vk$1,tk,uk,Pb as Pb$1,sf,vf,uf,tf,rf,tm,qm as qm$1,lm as lm$1,mm as mm$1,sm as sm$1,em as em$1,um as um$1,fm as fm$1,vm as vm$1,gm as gm$1,nm,im as im$1,km,rm as rm$1,jm as jm$1,cm as cm$1,om as om$1,pm as pm$1,dm as dm$1,hm as hm$1,bm as bm$1,am as am$1,$l,_l,Ig,jk as jk$1,Ek as Ek$1,Lj,ao,co,Pj,Jn,h as h$4,bo}from'./chunk-QUDJFPUU.js';import {a,b as b$1}from'./chunk-YRT7GXGY.js';import Hm,{memo,createContext,forwardRef,useMemo,useState,useRef,useCallback,useEffect,useImperativeHandle,useId,useReducer,useContext}from'react';import aE from'@mui/material/Stack';import En from'@mui/material/Box';import {styled,alpha,useTheme}from'@mui/material/styles';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {styled as styled$1,Box,Paper,Button,TextField,alpha as alpha$1,Typography,Divider,Popper,CircularProgress,Stack,Link,useTheme as useTheme$1,TableCell,Popover,ClickAwayListener,Collapse,Tooltip}from'@mui/material';import {useTranslation}from'react-i18next';import {motion,AnimatePresence,Reorder,useDragControls}from'framer-motion';import Jd from'dayjs';import YM from'dayjs/plugin/timezone';import GM from'dayjs/plugin/utc';import sS from'@mui/material/Typography';import UD from'@mui/material/Popover';import N1 from'@mui/material/ClickAwayListener';import R1 from'@mui/material/Popper';import iE from'@mui/material/Divider';import wb from'@mui/material/Button';import sL from'@mui/material/Skeleton';import qL from'@mui/material/Menu';import _k from'@mui/material/Avatar';import {yupResolver}from'@hookform/resolvers/yup';import {useForm,Controller}from'react-hook-form';import*as he from'yup';import {useDropzone}from'react-dropzone';import KF from'@mui/material/CircularProgress';import tc from'@mui/material/LinearProgress';import bc from'memoize-one';var bw=a((Wue,yw)=>{function _N(e,t,o,n){for(var r=e.length,i=o+(n?1:-1);n?i--:++i<r;)if(t(e[i],i,e))return i;return -1}yw.exports=_N;});var Tw=a((Hue,Iw)=>{function zN(e){return e!==e}Iw.exports=zN;});var ww=a((Oue,Sw)=>{function UN(e,t,o){for(var n=o-1,r=e.length;++n<r;)if(e[n]===t)return n;return -1}Sw.exports=UN;});var Ew=a((_ue,vw)=>{var $N=bw(),YN=Tw(),GN=ww();function KN(e,t,o){return t===t?GN(e,t,o):$N(e,YN,o)}vw.exports=KN;});var Mw=a((zue,Pw)=>{var qN=Ew();function jN(e,t){var o=e==null?0:e.length;return !!o&&qN(e,t,0)>-1}Pw.exports=jN;});var Dw=a((Uue,Aw)=>{function XN(e,t,o){for(var n=-1,r=e==null?0:e.length;++n<r;)if(o(t,e[n]))return true;return false}Aw.exports=XN;});var Lw=a(($ue,Rw)=>{function ZN(){}Rw.exports=ZN;});var Bw=a((Yue,kw)=>{var pc=j(),JN=Lw(),QN=h(),eV=1/0,tV=pc&&1/QN(new pc([,-0]))[1]==eV?function(e){return new pc(e)}:JN;kw.exports=tV;});var Nw=a((Gue,Fw)=>{var oV=f(),nV=Mw(),rV=Dw(),iV=g(),aV=Bw(),lV=h(),sV=200;function pV(e,t,o){var n=-1,r=nV,i=e.length,a=true,l=[],s=l;if(o)a=false,r=rV;else if(i>=sV){var p=t?null:aV(e);if(p)return lV(p);a=false,r=iV,s=new oV;}else s=t?[]:l;e:for(;++n<i;){var d=e[n],m=t?t(d):d;if(d=o||d!==0?d:0,a&&m===m){for(var c=s.length;c--;)if(s[c]===m)continue e;t&&s.push(m),l.push(d);}else r(s,m,o)||(s!==l&&s.push(m),l.push(d));}return l}Fw.exports=pV;});var Ww=a((Kue,Vw)=>{var mV=k(),dV=Nw();function cV(e,t){return e&&e.length?dV(e,mV(t,2)):[]}Vw.exports=cV;});var zv=a((vxe,_v)=>{var iW=b(),aW=function(){return iW.Date.now()};_v.exports=aW;});var $v=a((Exe,Uv)=>{var lW=/\s/;function sW(e){for(var t=e.length;t--&&lW.test(e.charAt(t)););return t}Uv.exports=sW;});var Gv=a((Pxe,Yv)=>{var pW=$v(),mW=/^\s+/;function dW(e){return e&&e.slice(0,pW(e)+1).replace(mW,"")}Yv.exports=dW;});var Xv=a((Mxe,jv)=>{var cW=Gv(),Kv=d(),uW=c(),qv=NaN,fW=/^[-+]0x[0-9a-f]+$/i,gW=/^0b[01]+$/i,xW=/^0o[0-7]+$/i,CW=parseInt;function hW(e){if(typeof e=="number")return e;if(uW(e))return qv;if(Kv(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Kv(t)?t+"":t;}if(typeof e!="string")return e===0?e:+e;e=cW(e);var o=gW.test(e);return o||xW.test(e)?CW(e.slice(2),o?2:8):fW.test(e)?qv:+e}jv.exports=hW;});var Qv=a((Axe,Jv)=>{var yW=d(),yc=zv(),Zv=Xv(),bW="Expected a function",IW=Math.max,TW=Math.min;function SW(e,t,o){var n,r,i,a,l,s,p=0,d=false,m=false,c=true;if(typeof e!="function")throw new TypeError(bW);t=Zv(t)||0,yW(o)&&(d=!!o.leading,m="maxWait"in o,i=m?IW(Zv(o.maxWait)||0,t):i,c="trailing"in o?!!o.trailing:c);function u(b){var T=n,v=r;return n=r=void 0,p=b,a=e.apply(v,T),a}function f(b){return p=b,l=setTimeout(y,t),d?u(b):a}function g(b){var T=b-s,v=b-p,P=t-T;return m?TW(P,i-v):P}function x(b){var T=b-s,v=b-p;return s===void 0||T>=t||T<0||m&&v>=i}function y(){var b=yc();if(x(b))return C(b);l=setTimeout(y,g(b));}function C(b){return l=void 0,c&&n?u(b):(n=r=void 0,a)}function h(){l!==void 0&&clearTimeout(l),p=0,n=s=r=l=void 0;}function I(){return l===void 0?a:C(yc())}function S(){var b=yc(),T=x(b);if(n=arguments,r=this,s=b,T){if(l===void 0)return f(s);if(m)return clearTimeout(l),l=setTimeout(y,t),u(s)}return l===void 0&&(l=setTimeout(y,t)),a}return S.cancel=h,S.flush=I,S}Jv.exports=SW;});var ji="32px";var tp=styled(En,{shouldForwardProp:e=>e!=="isMaximized"})(({theme:e,isMaximized:t})=>({background:alpha(e.palette.common.white,.7),backdropFilter:"blur(8px)",width:183,position:"sticky",padding:"16px 8px",paddingTop:t?ji:"16px",height:"100%",overflow:"auto"})),op=styled(En)(()=>({display:"flex",flexDirection:"column",gap:"8px"})),Xg=styled(En,{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"}));function _E({sections:e,isMaximized:t,onClick:o,activeSection:n}){let r=Jc(useId(),"window-side-bar"),i=n||e?.[0]?.id;return jsx(tp,{id:r,"data-testid":"WindowSideBar",isMaximized:t,children:jsx(op,{children:e?.map(a=>jsx(Xg,{onClick:()=>{o?.(a);},isActive:i===a.id,children:a.title},a.id))})})}var Zg=memo(_E);var zE=Zg;var Jg=styled(En)({display:"flex",alignItems:"center",gap:"12px"});function KE({value:e,format:t,flagIcon:o,hasFlag:n,tableMode:r,...i}){let a=o&&jsx(a$2,{title:Ua$1(o||""),children:jsx(a$f,{countryCode:o})}),l=useMemo(()=>H(e,t),[e]);return jsx(a$1,{...i,children:jsxs(Jg,{children:[n&&jsx(b$4,{sx:{visibility:"visible"},className:"geography-box",children:a}),jsx(Box,{sx:{...cb$1(r)&&{fontSize:"11px"}},children:l})]})})}var Gn=KE;function Qg({value:e,currentTimezone:t=In.UTC,timezoneOffset:o=0,defaultTimezoneOffset:n=0,hideTimezoneIcon:r=false,...i}){let a=m=>D(e,{currentTimezone:t,targetTimezone:m}),l=a(o),s=a(n),p=H(s),d=!r&&n!==o;return jsxs(En,{sx:{display:"flex",gap:"8px"},children:[jsx(Gn,{value:l,...i}),d&&jsx(a$2,{title:p,children:jsx("img",{src:H$1,width:14,alt:"timezone"})})]})}function JE({value:e,label:t,items:o,...n}){let r=Number.isInteger(e)&&Number(e)>1&&t.charAt(t.length-1)!=="s"?`${t}s`:t,i=`${e} ${r}`,a=jsx(Fragment,{children:o?.map(l=>{let s=l.name||l.description,p=(s?.length||0)>20?`${s?.slice(0,20)}...`:s;return jsx("div",{children:p},l.id)})});return jsx(a$2,{title:(o||[]).length>1?a:void 0,children:jsx(a$1,{...n,children:jsx("span",{children:i})})})}var QE=JE;function tP({value:e,label:t,items:o,...n}){let r=Number.isInteger(e)&&Number(e)>1&&t.charAt(t.length-1)!=="s"?`${t}s`:t,i=`${e} ${r}`;return jsx(a$1,{sx:{fontSize:"11px"},...n,children:i})}var oP=tP;var ex=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Zi=styled("span",{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"25ch",flex:1,...cb$1(t)&&{fontSize:"11px",color:e.palette.text.primary}})),tx=styled("span")({width:"11.6px",height:"11.6px",flexShrink:0,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"flex-start"}),ox=styled("img")({width:"11.6px",height:"11.6px",borderRadius:"50%"});function iP({customerInitiated:e,children:t,isTimezoneIconShown:o,hasCustomerIcon:n,customerIcon:r,customerName:i,hideCustomerInitiatedIcon:a,hideTimezoneIcon:l,phone:s,email:p,id:d,...m}){let{t:c}=useTranslation(),u=e===false?c("merchantInitiated"):"",f=jc(i),g=i?.split(" ")?.map(I=>I?.[0]?.toUpperCase()).join(""),x=useMemo(()=>Ja$1(),[]),y=n&&jsx(a$2,{title:t,children:jsx(i$1,{"data-testid":"CustomerCell_customerShownIcon",sx:{background:x},src:r,alt:r,children:g})}),C=useMemo(()=>[{name:"ID",value:d},{name:"Name",value:i},{name:"Email",value:p},{name:"Phone",value:s}],[p,s,d,i]),h=useMemo(()=>C.some(({value:I})=>I)?jsx("div",{"data-testid":"CustomerCell_customerTooltip",children:C.map(({name:I,value:S})=>S&&jsx("div",{"data-testid":`CustomerCell_customerTooltip_${I}`,children:I==="Name"?S:`${I}: ${S}`},S))}):null,[C]);return jsx(a$1,{...m,"data-testid":"CustomerCell_TableCell",children:jsxs(ex,{"data-testid":"CustomerCell_StyledCustomerCell",children:[y,jsx(a$2,{title:h,children:jsx(Zi,{"data-testid":"CustomerCell_StyledCustomerName","data-is-arabic":f,children:t})}),!l&&jsx(tx,{"data-testid":"CustomerCell_StyledCustomerIconContainer",children:o&&jsx(ox,{src:G,"data-testid":"CustomerCell_StyledCustomerIcon"})}),!a&&jsx(a$2,{title:u,children:jsx(f$2,{"data-testid":"CustomerCell_StarBadgeWrapper",className:"geography-box",isShown:!!u,children:u&&jsx("img",{"data-testid":"CustomerCell_merchantInitiatedIcon",src:sb,alt:"merchant",style:{width:"16px",height:"16px"}})})})]})})}var aP=iP;function sP({children:e,customerName:t}){let o=jc(t);return jsx(Zi,{tableMode:"sheet","data-testid":"CustomerCell_StyledCustomerName","data-is-arabic":o,children:e})}var pP=sP;var Ji=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",gap:e.spacing(1)})),nx=styled("span")(({theme:e,tableMode:t})=>({backgroundColor:e.palette.grey[100],display:"block",borderRadius:"4px",padding:"1.5px 3px",fontSize:cb$1(t)?"11px":"10px",lineHeight:"13px",textTransform:"uppercase",fontWeight:e.typography.fontWeightBold})),rx=styled("span")(({theme:e,tableMode:t})=>({fontSize:cb$1(t)?"11px":e.typography.body2.fontSize,lineHeight:"17px",fontWeight:"700"})),ap=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"})),Qi=styled("div")(({theme:e,count:t})=>({justifyContent:"space-between",display:"flex",width:"100%",gap:(t||1)<=1?e.spacing(1.5):e.spacing(1)}));var xO=({type:e,selectAmount:t,selectCurrency:o,requestAmount:n,requestCurrency:r,merchantAmount:i,merchantCurrency:a})=>{let l=Ra(t,o),s=Ra(n,r),p=Ra(i,a);return jsxs(ap,{sx:{textAlign:"right",justifyContent:"flex-end"},children:[jsx("span",{style:{fontWeight:"bold"},children:e?Ma[e]:""}),jsxs(ap,{children:[e!=="fx"&&jsxs(Qi,{children:[jsx("span",{children:"Customer Selected"})," ",jsxs("span",{children:[jsx(a$x,{currency:o})," ",l.integerAmount,".",l.decimalAmount]})]}),jsxs(Qi,{children:[jsx("span",{children:"Charge"})," ",jsxs("span",{children:[jsx(a$x,{currency:r})," ",s.integerAmount,".",s.decimalAmount]})]}),jsxs(Qi,{children:[jsx("span",{children:"Settlement"})," ",jsxs("span",{children:[jsx(a$x,{currency:a})," ",p.integerAmount,".",p.decimalAmount]})]})]})]})};var Uo=({tableMode:e,conversionType:t})=>t?jsx(nx,{tableMode:e,className:"conversion-type",children:t}):jsx(Fragment,{});var $o=({tableMode:e,amount:t,currency:o})=>jsx(rx,{tableMode:e,children:t!==void 0?jsxs(Fragment,{children:[jsx("span",{children:jsx(a$x,{currency:o,fontSize:10})})," ",jsx(b$9,{amount:t,currency:o})]}):jsx("span",{children:"-"})});var ax="default";function gP({conversionType:e,amount:t,currency:o,tooltipLabel:n,amountTooltipLabel:r,...i}){return jsx(a$1,{...i,children:jsxs(Ji,{children:[jsx(a$2,{title:n||"",children:jsx(Box,{children:jsx(Uo,{tableMode:ax,conversionType:e})})}),o&&jsx(a$2,{title:jsx(a$x,{currency:o}),children:jsx(a$f,{currencyCode:o})}),jsx(a$2,{title:r,children:jsx($o,{tableMode:ax,amount:t,currency:o})})]})})}var xP=gP;var lx="text";function hP({conversionType:e,amount:t,currency:o,tooltipLabel:n,amountTooltipLabel:r,...i}){return jsx(a$1,{...i,children:jsxs(Ji,{children:[jsx(a$2,{title:n||"",children:jsx(Uo,{tableMode:lx,conversionType:e})}),jsx(a$2,{title:jsx(a$x,{currency:o}),children:jsx("span",{})}),jsx(a$2,{title:r,children:jsx($o,{tableMode:lx,amount:t,currency:o})})]})})}var yP=hP;var sx="sheet";function IP({conversionType:e,amount:t,currency:o,selectionProps:n={},chipIndex:r=0}){let{integerAmount:i,decimalAmount:a}=Ra(t,o);return jsxs(b$a,{chipIndex:r,copyText:t?`${i}.${a}`:"-",selectionProps:n,children:[jsx(Uo,{tableMode:sx,conversionType:e}),jsx($o,{tableMode:sx,amount:t,currency:o})]})}var TP=IP;var mx=e=>e?Object.keys(e).filter(t=>e[t]).reduce((t,o)=>(t[o]=e[o],t),{}):{};var Yo=({statuses:e,centerIconKey:t})=>{let o=useMemo(()=>mx(e),[e]),n=useMemo(()=>Object.values(o).filter(Boolean),[o]),r=useMemo(()=>{if(!t)return 0;let i=Object.entries(o).findIndex(([a])=>a===t);return i===-1?Math.floor((n.length-1)/2):i},[o,t,n.length]);return {statusesList:n,centerIconIndex:r}};function wP({statuses:e,centerIconKey:t,...o}){let{centerIconIndex:n,statusesList:r}=Yo({statuses:e,centerIconKey:t}),i=40;return jsx(a$1,{...o,"data-testid":"StatusCell",sx:{position:"relative",overflow:"visible"},children:jsx(c$6,{initial:"initial",whileHover:"hover",animate:"start",children:r.map((a,l)=>{if(!a)return;let s=(l-n)*i,p=l>n,d=l<n;return jsx(b$b,{variants:{initial:{x:d?-5:p?5:0,zIndex:d?100-l:p?l:100},hover:{x:s,zIndex:100-Math.abs(n-l)}},transition:{duration:.3,type:"tween",ease:"easeOut"},statusesCount:r.length||0,children:jsx(a$y,{children:a})},l)})})})}var vP=wP;function EP({statuses:e,...t}){let{statusesList:o}=Yo({statuses:e});return jsx(a$1,{...t,children:jsx(c$6,{sx:{paddingRight:"30px"},children:o.map(n=>n)})})}var PP=EP;function MP({statuses:e,centerIconKey:t,xGap:o,...n}){let{statusesList:r,centerIconIndex:i}=Yo({statuses:e,centerIconKey:t}),a=o||120;return jsx(a$1,{...n,"data-testid":"StatusCell",sx:{position:"relative",overflow:"visible"},children:jsx(c$6,{initial:"initial",whileHover:"hover",animate:"start",children:r.map((l,s)=>{if(!l)return;let p=(s-i)*a,d=s>i,m=s<i;return jsx(b$b,{variants:{initial:{x:m?-5:d?5:0,zIndex:m?100-s:d?s:100},hover:{x:p,zIndex:100-Math.abs(i-s)}},transition:{duration:.3,type:"tween",ease:"easeOut"},statusesCount:r.length||0,children:jsx(a$y,{isTextShown:true,children:l})},s)})})})}var AP=MP;var na=styled("section",{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",textAlign:"center",borderRadius:"50%",gap:cb$1(t)?"4px":e.spacing(1),overflow:"visible"})),ra=styled("span")(({selected:e})=>({overflow:"visible",borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative","&:hover":{boxShadow:"0px 0px 20px rgba(0, 0, 0, 0.18);"},...e&&{boxShadow:"0px 0px 20px rgba(0, 0, 0, 0.18);"},span:{flexGrow:1}})),cx=styled("img",{shouldForwardProp:e=>e!=="isActive"})(({isActive:e})=>({width:"18px",height:"18px",...!e&&{pointerEvents:"none",filter:"opacity(0.3)"}})),qe=styled(motion.img)(({icon:e})=>({width:"13.3px",height:"13.3px",...e==="cancel"&&{padding:"1.15px"}}));function ux({isAnyActionLoading:e,isAnyActionHasError:t,isAnyActionSuccessful:o,areThereAnyShownActions:n}){let{t:r}=useTranslation();return t?jsx(qe,{src:fc,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"fail-icon"):o?jsx(qe,{src:gc$1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"success-icon"):e?jsx(qe,{src:dc$1,className:"spinner-loader"},"spinner-icon"):jsx(a$2,{title:r("moreActions"),children:jsx(cx,{alt:"more",src:ka$1,isActive:n},"ellipsis-icon")})}ux.displayName="ActionIconsVariants";var Zn=memo(ux);var Go={GRAY:{icon:xb$1,color:"#CFCFCF"},ORANGE:{icon:vb,color:"#FFD503"},RED:{icon:yb,color:"#FF0000"}},ia={gray:"gray",red:"red",orange:"orange"},aa={flag:E,dispute:F,refund:$j,void:ik,capture:ha,cancel:Sj,clock:Pe,reverse:Ch,destination:wg,invoice:lh$1,users:ki,brand:ji$1,clipboard:li,viewApi:Sd$1,viewReceipt:nc$1,delete:mj};function la({actions:e,isDropdownShown:t,onCloseDropdown:o,renderDropdown:n}){let[r,i]=useState(null),a=!!r,l=(e||[]).filter(f=>f.isShown!==false),s=l.some(f=>f.isLoading),p=l.some(f=>f.isError),d=l.some(f=>f.isSuccess),m=l.length>0||!!n,c=f=>{s||!m||i(f.currentTarget);},u=()=>{i(null),o?.();};return useEffect(()=>{t||i(null);},[t]),{anchorEl:r,open:a,filteredActions:l,isAnyActionLoading:s,isAnyActionHasError:p,isAnyActionSuccessful:d,areThereAnyShownActions:m,handleClick:c,handleClose:u,setAnchorEl:i}}var xx=styled(motion.div,{shouldForwardProp:e=>e!=="isHover"})(({theme:e,isHover:t})=>({paddingInlineStart:"8px",border:"1px solid transparent",display:"flex",gap:"4px",alignItems:"center",justifyContent:"flex-end",backgroundColor:e.palette.common.white,float:"right",borderRadius:"56px",...t&&{borderColor:"rgba(92, 92, 92, 0.05)",boxShadow:"-7px 0px 8px 0px #F2F2F2",position:"absolute",right:0,top:0,zIndex:101}})),Cx=styled(motion.div)(({theme:e})=>({color:e.palette.text.primary,fontSize:"11px",lineHeight:"120%"}));function VP({icon:e=na$1,id:t,sx:o,disableOnHoverEffect:n=false,onCopyId:r,...i}){let[a,l]=useState(false),[s,p]=useState(false),{t:d}=useTranslation(),m=()=>{if(t){l(true),mb$1(t),r?.();let f=setTimeout(()=>{l(false);},2e3);return ()=>{clearTimeout(f);}}},c=()=>{s||p(true);},u=()=>{s&&p(false);};return jsx(a$2,{title:d("copy"),children:jsx(En,{className:"IDButton-root",sx:{position:"relative",width:"24px",height:"24px",cursor:"pointer",...o},...i,children:jsxs(xx,{onClick:m,onMouseEnter:n?void 0:c,onMouseLeave:n?void 0:u,isHover:s,initial:{width:"24px"},style:{...a&&{padding:"4px"}},className:"IDButton-button",animate:{width:s?"auto":"24px",position:s?"absolute":"static"},children:[s&&jsx(Cx,{className:"IDButton-rowId",initial:{opacity:0},animate:{opacity:s?1:0},exit:{opacity:0},transition:{delay:s?.3:0,duration:s?.3:.1},children:t}),jsx(En,{className:"IDButton-icon",component:"img",src:a?ra$1:e,alt:"id"})]})})})}var sp=memo(VP);var f_=memo(({flag:e$1,actions:t,flagTooltip:o,flagsCount:n,dropdownAction:r,onCloseDropdown:i,isDropdownShown:a=true,row:l,showJsonViewer:s=true,isTextShown:p,showIdButton:d=true,onCopyId:m,rowId:c,onJsonViewClick:u,renderDropdown:f,startSlot:g,...x})=>{let{t:y}=useTranslation(),{open:C,anchorEl:h,filteredActions:I,isAnyActionLoading:S,isAnyActionHasError:b,isAnyActionSuccessful:T,areThereAnyShownActions:v,handleClick:P,handleClose:A,setAnchorEl:M}=la({actions:t,isDropdownShown:a,onCloseDropdown:i,renderDropdown:f});return jsx(a$1,{...x,sx:{overflow:"visible",...x.sx},children:jsxs(na,{"data-testid":"ActionCell_ActionCellContainer",children:[g,e$1&&jsx(Fragment,{children:p?jsx(a$2,{title:o,children:jsx(j$1,{"data-testid":"ActionCell_FlagLabel",sx:{textAlign:"left",justifyContent:"flex-start"},children:o})}):jsx(a$2,{title:o,children:jsxs(d$1,{"data-testid":"ActionCell_FlagBadge",sx:{paddingInline:"12px",width:"auto",alignItems:"center",position:"relative",zIndex:21,gap:"0px"},whileHover:["animate","fadeIn"],variants:{animate:{gap:"4px"}},children:[jsx(qe,{"data-testid":"ActionCell_FlagIcon",sx:{width:"12px",height:"11px"},src:Go[e$1]?.icon,alt:"flag-icon"}),(n??0)>1&&jsx(motion.div,{"data-testid":"ActionCell_StyledBadge_Container",style:{alignItems:"center",justifyContent:"center",gap:"4px",display:"flex",zIndex:10},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto"},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs(e,{compact:true,variant:ia[Go[e$1]?.color]||"orange","data-testid":"ActionCell_StyledBadge",children:[n,"x"]})})]})})}),d&&jsx(sp,{id:c||l.id,icon:na$1,onCopyId:m}),jsxs("div",{"data-testid":"ActionCell_IconsContainer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:[s&&jsx(Fragment,{children:jsx(c$1,{onClick:u,type:"button","data-testid":"ActionCell_TransparentButton",children:jsx(a$2,{title:y("jsonViewer"),children:jsx(h$1,{"data-testid":"ActionCell_IdButtonContainer",children:jsx(motion.img,{src:Sd$1,alt:"icon"},"id-icon")})})})}),jsxs(ra,{id:"styled-popover",selected:!!r||C,"data-testid":"ActionCell_ActionsIconContainer","data-is-active":v,sx:{...!v&&{pointerEvents:"none"}},children:[jsx(c$1,{onClick:P,"data-testid":"ActionCell_ActionsIconContainer_TransparentButton","data-is-active":v,sx:{...!v&&{pointerEvents:"none"}},children:jsx(AnimatePresence,{mode:"wait",children:jsx(Zn,{isAnyActionLoading:S,isAnyActionHasError:b,isAnyActionSuccessful:T,areThereAnyShownActions:v})})}),r,f?f(h,M):jsx(Fragment,{children:v&&jsx(f$1,{style:{zIndex:2e3},open:C,onClose:A,anchorEl:h,menuItems:I.map(k=>({...k,onClick:W=>{k?.onClick?.(W),k.hasActionMenu||A();},onRightClick:W=>{k?.onRightClick?.(W),A();},icon:k.customIcon||jsx(qe,{icon:k.icon,src:k.iconSrc??(k.icon&&aa[k.icon]),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},`action.label-${k.label.trim()}`)}))})})]})]})]})})});function $P({flag:e$1,flagTooltip:t,flagsCount:o,row:n,showJsonViewer:r=true,isTextShown:i,showIdButton:a=true,rowId:l,onJsonViewClick:s,tableMode:p,...d}){return jsx(a$1,{...d,sx:{overflow:"visible"},children:jsxs(na,{"data-testid":"ActionsColumn_ActionCellContainer",tableMode:p,children:[e$1&&jsx(Fragment,{children:i?jsx(a$2,{title:t,children:jsx(j$1,{"data-testid":"ActionsColumn_FlagLabel",sx:{textAlign:"left",justifyContent:"flex-start"},children:t})}):jsx(a$2,{title:t,children:jsxs(d$1,{"data-testid":"ActionsColumn_FlagBadge",sx:{paddingInline:"12px",width:"auto",alignItems:"center",position:"relative",zIndex:21,gap:"0px"},whileHover:["animate","fadeIn"],variants:{animate:{gap:"4px"}},children:[jsx(qe,{"data-testid":"ActionsColumn_FlagIcon",sx:{width:"12px",height:"11px"},src:Go[e$1]?.icon,alt:"flag-icon"}),(o??0)>1&&jsx(motion.div,{"data-testid":"ActionsColumn_StyledBadge_Container",style:{alignItems:"center",justifyContent:"center",gap:"4px",display:"flex",zIndex:10},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto"},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs(e,{compact:true,variant:ia[Go[e$1]?.color]||"orange","data-testid":"ActionsColumn_StyledBadge",children:[o,"x"]})})]})})}),a&&jsx(a$d,{minWidth:"213px",children:l||n.id}),jsx("div",{"data-testid":"ActionsColumn_IconsContainer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:r&&jsx(a$d,{onClick:s,children:"View API"})})]})})}var YP=memo($P);function jP({actions:e,dropdownAction:t,onCloseDropdown:o,isDropdownShown:n=true,renderDropdown:r,...i}){let{open:a,anchorEl:l,filteredActions:s,isAnyActionLoading:p,isAnyActionHasError:d,isAnyActionSuccessful:m,areThereAnyShownActions:c,handleClick:u,handleClose:f,setAnchorEl:g}=la({actions:e,isDropdownShown:n,onCloseDropdown:o,renderDropdown:r});return jsx(a$1,{...i,sx:{overflow:"visible"},children:jsx("div",{"data-testid":"ActionIconColumn_Container",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:jsxs(ra,{id:"styled-popover",selected:!!t||a,"data-testid":"ActionIconColumn_ActionsIconContainer","data-is-active":c,sx:{...!c&&{pointerEvents:"none"}},children:[jsx(c$1,{onClick:u,"data-testid":"ActionIconColumn_ActionsIconContainer_TransparentButton","data-is-active":c,sx:{...!c&&{pointerEvents:"none"}},children:jsx(AnimatePresence,{mode:"wait",children:jsx(Zn,{isAnyActionLoading:p,isAnyActionHasError:d,isAnyActionSuccessful:m,areThereAnyShownActions:c})})}),r?r(l,g):jsxs(Fragment,{children:[t,c&&jsx(f$1,{style:{zIndex:2e3},open:a,onClose:f,anchorEl:l,menuItems:s.map(x=>({...x,onClick:y=>{x?.onClick?.(y),x.hasActionMenu||f();},onRightClick:y=>{x?.onRightClick?.(y),f();},icon:x.customIcon||jsx(qe,{icon:x.icon,src:x.iconSrc??(x.icon&&aa[x.icon]),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},`action.label-${x.label.trim()}`)}))})]})]})})})}var XP=memo(jP);function QP({deviceType:e,geographyVariant:t,isTextShown:o,deviceCountry:n,...r}){return jsx(a$1,{...r,children:jsxs(En,{sx:{display:"flex",gap:"8px",alignItems:"center"},children:[jsx(m,{geographyVariant:t,isTextShown:o,countryCode:n}),jsx(c$7,{type:e,isTextShown:o})]})})}var e0=QP;var Tx=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1),position:"relative",minWidth:"23px",height:"24px"})),Sx=styled$1("span")(({theme:e})=>({fontSize:e.typography.pxToRem(12),color:e.palette.info.dark,fontWeight:700,paddingInline:e.spacing(1),borderRadius:e.spacing(1),display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${e.palette.info.dark}1A`})),wx=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1),backgroundColor:e.palette.common.white,border:`1px solid ${e.palette.divider}`,paddingInline:e.spacing(1),borderRadius:"56px",height:"24px"}));styled$1("img")(({theme:e,order:t})=>({borderRadius:"50%",backgroundColor:e.palette.common.white,width:"16px",height:"16px",padding:"2px",zIndex:t+1,position:"absolute",left:`${t*9}px`}));var vx=styled$1("img")(({pointLeft:e})=>({width:"12.5px",height:"13px",transform:`scale(${e?"-1":"1"}, 1)`}));styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",backgroundColor:e.palette.common.white,borderRadius:"50%",width:"16px",height:"16px",fontSize:"8px",fontWeight:e.typography.fontWeightBold,lineHeight:"11px",position:"absolute",left:"18px",zIndex:4,textAlign:"center",span:{flexGrow:1}}));function r0({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,...a}){let l=useMemo(()=>{if(typeof e=="number")return e;let d=Number(e);return Number.isNaN(d)?void 0:d},[e]),s=l!==void 0?l>0:!!e,p=l!==void 0&&l>1;return !s||r?null:jsx(En,{sx:{width:"fit-content",overflow:"visible"},...a,children:jsx(a$2,{title:t,children:jsxs(wx,{children:[jsx(vx,{src:z,pointLeft:i==="left"}),p&&jsx(Tx,{children:jsx(Sx,{children:e})})]})})})}var i0=r0;function l0({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,selectionProps:a,...l}){let p=(o?.destination||[])?.map((d,m)=>{let c=Qa(d?.amount||0);return {key:`destination-${d?.id||m}`,content:jsxs(En,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:[jsxs("div",{children:[d?.id," |"]}),jsx(a$x,{currency:d?.currency}),jsxs("span",{children:[c.integerAmount,".",c.decimalAmount]})]}),chipIndex:m,selectionProps:a??{},copyText:`${c.integerAmount}.${c.decimalAmount}`}},[a]);return jsx(En,{...l,children:jsx(a$z,{chips:p})})}var s0=l0;function m0({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,...a}){let l=o?.destination||[],s=Qa(n||0),p=Qa(l?.[0]?.amount||0);return !e||r?null:jsx(En,{sx:{width:"fit-content",overflow:"visible"},...a,children:jsx(a$2,{title:t,children:jsx(j$1,{sx:{textAlign:"left",justifyContent:"flex-start",height:"auto"},children:e&&typeof e=="number"&&e>1?jsxs("div",{children:["Destination ",l?.[0]?.id," - ",jsx(a$x,{currency:l?.[0]?.currency})," ",p.integerAmount,".",p.decimalAmount," +",e-1]}):jsxs("div",{children:["Destination ",l?.[0]?.id," - ",jsx(a$x,{currency:l?.[0]?.currency})," ",s.integerAmount,".",s.decimalAmount]})})})})}var d0=m0;var S5=({destination:e,amount:t})=>{let o=e?.destination||[];return o?.length>1?jsxs("div",{children:[jsx("div",{children:"Destination"}),e?.destination?.map(r=>{let i=Qa(r.amount||0);return jsxs("div",{children:[r?.id," - ",jsx(a$x,{currency:r?.currency})," ",i.integerAmount,".",i.decimalAmount]},r?.id)})]}):jsxs("div",{children:["Destination ",o?.[0]?.id," - ",jsx(a$x,{currency:o?.[0]?.currency})," ",t.integerAmount,".",t.decimalAmount]})};var Mx=styled$1(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.5),paddingBlock:e.spacing(.5),backgroundColor:"#eeeeee",borderRadius:"56px",height:"24px",minWidth:"24px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,zIndex:10,position:"absolute"})),Ax=styled$1("div")(({theme:e,percentage:t})=>({border:`0.6px ${[0,100].includes(t)?"solid":"dashed"} #656565`,borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(1),fontSize:"7px",fontWeight:e.typography.fontWeightBold,color:"#656565",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)}));styled$1("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));function Dx(e){return e<5?5:e===100?95:e}function x0({percentage:e=0,days:t,remainingAmount:o=0,currency:n,...r}){let i=useTheme(),a=jsx(a$x,{currency:n}),{integerAmount:l,decimalAmount:s}=Ra(o,n),p=`${l}.${s}`,d=useMemo(()=>jsxs(Fragment,{children:["Remaining Authorized Balance - ",a," ",p]}),[o,n]);return e===0||o<0?null:jsx(a$1,{...r,children:jsx(a$2,{title:d,placement:"top",children:jsx("div",{style:{height:24},children:jsxs(Mx,{whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:22},variants:{animate:{...!!t&&{boxShadow:i.shadows[4]}}},children:[jsxs(Ax,{percentage:e,children:[e,"% ",jsx(q,{percentage:Dx(e)})]}),!!t&&jsx(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px",width:0},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("span",{children:[t," days left"]})})]})})})})}var C0=x0;function y0({remainingAmount:e,currency:t,selectionProps:o}){let n=jsx(a$x,{currency:t}),{integerAmount:r,decimalAmount:i}=Ra(e,t),a=`${r}.${i}`;return jsxs(b$a,{chipIndex:0,copyText:`${r}.${i}`,selectionProps:o,children:[n," ",a]})}var b0=y0;var Cp=["authenticationMode","paymentAuth","paymentAgreement"],hp=["paymentIssuer","paymentInitiated","paymentDevice"],Rx=["paymentMethod","paymentType","paymentScheme","paymentCardNumber",...hp,...Cp];var Bx=styled(En)(()=>({marginRight:"8px",display:"flex",alignItems:"center",gap:"4px"})),Fx=styled(En)(()=>({marginLeft:"8px",width:20}));function v0(e){let{centerIcon:t,centerIconId:o}=useMemo(()=>{for(let a of Rx)if(e?.[a])return {centerIcon:e?.[a],centerIconId:a};return {centerIcon:null,centerIconId:null}},[e]);if(!o)return null;let n=o!=="paymentScheme"&&e.paymentScheme,r=o!=="paymentCardNumber"&&e.paymentCardNumber,i=o!=="paymentType"&&e.paymentType;return jsx(a$e,{expandedZIndex:0,centerIcon:t,leftIcons:hp.filter(a=>a!==o&&e?.[a]).map(a=>e?.[a]),rightIcons:Cp.filter(a=>a!==o&&e?.[a]).map(a=>e?.[a]),expandableCenterRight:(n||r)&&jsxs(Bx,{children:[n&&e.paymentScheme,r&&e.paymentCardNumber]}),expandableCenterLeft:i&&jsx(Fx,{children:e.paymentType})})}var E0=memo(v0);var Wx=b$1(i(),1);var Vx=styled("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function h4({card:e,paymentMethod:t,paymentType:o,paymentScheme:n}){let{t:r}=useTranslation();if(!e.last_four)return null;let i=e?.name||`${r((0, Wx.default)(oc(t,n)?o:n))} - ${e?.last_four}`;return jsx(a$2,{title:i,children:jsxs(Vx,{children:["\xB7\xB7\xB7 ",e?.last_four]})})}var Hx=b$1(i(),1);function S4({method:e}){let{t}=useTranslation();return e?jsx(w,{source:v$1(e)??e,title:`Payment Method - ${t((0, Hx.default)(e))}`}):null}var Ox=b$1(i(),1);function M4({type:e}){let{t}=useTranslation();return e?jsx(w,{source:v$1(e)??e??"",title:`Payment Type - ${t((0, Ox.default)(e))}`}):null}var _x=b$1(i(),1);function k4({scheme:e}){let{t}=useTranslation();return e?jsx(w,{source:v$1(e)??e,title:`Payment Scheme - ${t((0, _x.default)(e))}`}):null}var Ux=({mode:e})=>e?jsx(a$2,{title:vo[e],children:jsx(En,{component:"img",src:e==="C"?ba:aa$1})}):null;var ma={ORDER:{label:"order",icon:fi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:hi,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:ii,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:gi,color:"#32ADE6"}},da={SAVED_TOKEN:{label:"savedToken",icon:T,color:"#76BB40"},COUNT:{label:"countBadge",icon:"countBadge",color:"#76BB40"}};styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)}));styled$1("img")(()=>({width:"35px",height:"16px",display:"block"}));styled$1("span")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"14.67px",height:"10px"}));styled$1("img")(()=>({maxWidth:"100%",width:"100%"}));var ca=styled$1("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),ua=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"})),$x=styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"})),Yx=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),yp=styled$1("img")(()=>({maxWidth:"36px",maxHeight:"24px"}));function $0({type:e,hasSavedCard:t,totalPaymentsCount:o,isTextShown:n,...r}){let i=useTheme(),{t:a}=useTranslation(),l=useMemo(()=>[...t?[da.SAVED_TOKEN]:[],...(o||0)>0?[da.COUNT]:[],...e&&ma[e]?[ma[e]]:[]],[t,o,e]),s=c=>n?jsx(b$c,{"data-testid":"AgreementCell_countBadge",order:c,variants:c$8(c,n?85:0),children:jsx(a$2,{title:a("totalPaymentCount",{amount:q$2(o)}),children:jsx(ua,{children:jsxs(ca,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:da.COUNT.color},children:["x",o]})})})},c):jsx(d$5,{totalPaymentsCount:o,index:c},c),p=l.map((c,u)=>c.label==="countBadge"?s(u):jsx(a$2,{title:a(c.label),children:jsx(b$c,{order:u,variants:c$8(u,u>1&&n?62:0),sx:{width:n?"auto":"36px"},children:n?jsx(ua,{children:jsx(ca,{"data-testid":"AgreementCell_agreementType",sx:{color:c.color},children:a(c.label)})}):jsx(yp,{src:c.icon,alt:"agreement"})},c.color)},c.color)),d=p.length,m=jsx(a$2,{title:"No agreement",children:jsx(b$c,{order:0,variants:c$8(0,0),sx:{width:n?"auto":"36px"},children:n?jsx(ua,{children:jsx(ca,{"data-testid":"AgreementCell_agreementType",sx:{color:i.palette.text.secondary},children:"No agreement"})}):jsx(yp,{src:mi,alt:"no-agreement"})},"no-agreement")},"no-agreement");return jsx(a$1,{...r,children:jsx(Yx,{"data-testid":"AgreementCell",children:jsx($x,{layout:true,className:"payment-sources-container","data-testid":"AgreementCell_PaymentSourcesContainer",whileHover:"animate",animate:"start",sourcesCount:d||0,variants:{animate:{width:(d||0)*38}},children:p?.length>0?p:m})})})}var Y0=$0;var Kx=styled("img")(()=>({width:"12.67px",height:"15px"}));styled("span")(({theme:e})=>({border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));function K0({hasAuth:e,tooltip:t,isTextShown:o,align:n,...r}){return jsx(a$1,{style:{textAlign:n||"center",overflow:"visible",display:"flex",width:"100%",justifyContent:n==="left"?"flex-start":"center"},...r,children:e?jsx(a$2,{title:t,children:jsx(d$1,{"data-testid":"AuthCell_BadgeWrapper",children:o?jsx(j$1,{"data-testid":"AuthCell_TextLabel",sx:{minWidth:"max-content"},children:t}):jsx(Kx,{src:la$1,alt:"icon","data-testid":"AuthCell_AuthIcon"})})}):null})}var q0=K0;var Ip=b$1(i(),1);var Xx=b$1(i(),1);var qx={REFUNDED:_j,PAID_OUT:Zj,SETTLED:ak,PENDING:$j,UNKNOWN:hk,TIMEDOUT:fk$1,CANCELLED:Sj,FAILED:Wj,DECLINED:Uj,RESTRICTED:ck,IN_PROGRESS:kk$1,ACCEPTED:bk},jx={REFUNDED:"refunded"};function Zx({status:e,refundTooltip:t}){let{t:o}=useTranslation();return jsx(a$2,{title:jsxs("div",{children:[jsx("div",{children:o((0, Xx.default)(e))}),t]}),children:jsx(o$1,{children:jsx("img",{src:qx[e],alt:"refund-requested"})})})}function Qx({status:e,gatewayTooltip:t,unCapturedTooltip:o,acquirerTooltip:n,errorCode:r,acquirerCode:i,gatewayCode:a,refundTooltip:l}){let{t:s}=useTranslation();return kn$1?.includes(e??"")?jsx(k$1,{chargeStatus:e,gatewayTooltip:t,chargeTooltip:o,acquirerTooltip:n,errorCode:r,acquirerCode:i,gatewayCode:a,iconWrapperStyles:{height:17}}):jsx(Zx,{status:e,refundTooltip:l})}var eC=styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.625),paddingBlock:e.spacing(.625),height:"24px",minWidth:"24px",backgroundColor:"#ede8fb",borderRadius:"56px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,position:"relative",zIndex:10})),tC=styled("div")(({theme:e})=>({borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"12px",fontWeight:e.typography.fontWeightRegular,color:e.palette.secondary.main,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),lineHeight:0})),oC=styled(Gn)(({theme:e})=>({fontSize:"12px",fontWeight:e.typography.fontWeightRegular,color:e.palette.secondary.main}));styled("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));styled("span")(({theme:e,isCapture:t})=>({backgroundColor:t?e.palette.info.dark:"#656565",color:e.palette.common.white,borderRadius:e.spacing(.5),padding:"1.285px 2.569px",height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600}));var nC=styled("img")({width:"14px",height:"14px"}),rC=styled(En)(({theme:e})=>({position:"relative",zIndex:25,border:`1px solid ${e.palette.divider}`,height:24,borderRadius:"12px",padding:"3px 4px","> div":{paddingTop:0,paddingBottom:0,height:16}}));function bp({status:e,refundIcon:t,refundTooltip:o,refundTooltipLabel:n,date:r,gatewayTooltip:i,unCapturedTooltip:a,acquirerTooltip:l,errorCode:s,acquirerCode:p,gatewayCode:d,timezone:m}){let c=useTheme(),{t:u}=useTranslation(),f=D(new Date(Number(r)),{currentTimezone:Jn,targetTimezone:m?.offset}),g=useMemo(()=>t||(e==="REFUNDED"?_j:ak),[e,t]);return ["REFUNDED","PAID_OUT"].includes(e??"")?jsx(a$2,{title:jsxs("div",{children:[jsx("div",{children:n??u(jx.REFUNDED)}),o]}),children:jsxs(eC,{whileHover:["animate","fadeIn"],animate:"start",variants:{...r&&{animate:{boxShadow:c.shadows[4]}}},sx:{...!r&&{backgroundColor:"transparent"}},children:[jsx(nC,{sx:{...!r&&{width:"16px",height:"16px"}},src:g,alt:"refunded"}),jsx(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:r&&jsx(tC,{children:jsx(oC,{value:f})})})]})}):jsx(Qx,{status:e,refundTooltip:o,gatewayTooltip:i,unCapturedTooltip:a,acquirerTooltip:l,errorCode:s,acquirerCode:p,gatewayCode:d})}var aC=()=>{let e=useTheme();return {REFUNDED:{color:e.palette.common.lightPurple,backgroundColor:`${e.palette.common.lightPurple}1A`},PENDING:{color:e.palette.custom[500],backgroundColor:`${e.palette.custom[500]}0d`},PAID_OUT:{color:e.palette.common.green,backgroundColor:`${e.palette.common.green}0d`},SETTLED:{color:e.palette.common.green,backgroundColor:`${e.palette.common.green}0d`},UNKNOWN:{color:e.palette.custom[500],background:`${e.palette.custom[500]}1A`},TIMEDOUT:{color:e.palette.custom[500],background:`${e.palette.custom[500]}1A`},FAILED:{color:e.palette.custom[500],background:`${e.palette.custom[500]}1A`},DECLINED:{color:e.palette.error.main,background:`${e.palette.error.main}1A`},RESTRICTED:{color:e.palette.error.main,background:`${e.palette.error.main}1A`},IN_PROGRESS:{color:e.palette.grey[700],background:`${e.palette.grey[700]}1A`},CANCELLED:{color:e.palette.error.main,background:`${e.palette.error.main}1A`},ACCEPTED:{color:e.palette.grey[700],background:`${e.palette.grey[700]}1A`}}};function sM({status:e,date:t,refundTooltip:o,isTextShown:n$1,gatewayTooltip:r,acquirerTooltip:i,errorCode:a,acquirerCode:l,gatewayCode:s,unCapturedTooltip:p,timezone:d,refundTooltipLabel:m,refundIcon:c,...u}){let{t:f}=useTranslation(),g=aC(),x=useCallback(C=>Jd(C).format("MMM D, YYYY"),[]),y=kn$1.includes(e);return jsx(a$1,{...u,style:{overflow:"visible"},children:jsx(n,{children:jsx(rC,{width:n$1?"auto":"36px",sx:{...y&&{border:"none"}},children:n$1?jsx(a$2,{title:t?x(t):f((0, Ip.default)(e)),children:jsx(j$1,{sx:{...g[e]?g[e]:g.PENDING},children:f((0, Ip.default)(e))})}):jsx(bp,{status:e,refundTooltip:o,date:t,gatewayTooltip:r,unCapturedTooltip:p,acquirerTooltip:i,errorCode:a,acquirerCode:l,gatewayCode:s,timezone:d,refundTooltipLabel:m,refundIcon:c})})})})}var pM=sM;var lC=styled$1("img")(()=>({width:"16px",height:"16px"})),sC=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),pC=styled$1("span")(({theme:e})=>({display:"flex",paddingInline:e.spacing(1),paddingBlock:e.spacing(.5),alignItems:"center",justifyContent:"center",gap:e.spacing(.5),borderRadius:"56px",background:`${e.palette.info.dark}1a`})),mC=styled$1("span")(({theme:e})=>({color:e.palette.info.dark,fontSize:"14px",lineHeight:"16.8px"}));function mM({walletId:e,country:t,showCountry:o=true,...n}){return jsx(a$1,{style:{textAlign:"center",overflow:"visible"},...n,children:jsxs(sC,{children:[o&&t&&jsx(a$2,{title:Ua$1(t),children:jsx(a$f,{countryCode:t})}),jsxs(pC,{children:[jsx(lC,{src:_b$1,alt:"wallet-icon"}),e&&jsxs(mC,{children:["\xB7\xB7\xB7\xB7 ",e?.substring((e?.length||0)-4)]})]})]})})}var dM=mM;var dC=styled$1("img")(()=>({width:"16px",height:"16px"})),cC=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),uC=styled$1("span")(({theme:e})=>({display:"flex",paddingInline:e.spacing(1),paddingBlock:e.spacing(.5),alignItems:"center",justifyContent:"center",gap:e.spacing(.5),borderRadius:"56px",background:`${e.palette.common.white}`,border:`1px solid ${e.palette.divider}`})),fC=styled$1("span")(({theme:e})=>({color:`${e.palette.text.primary}`,fontSize:"14px",lineHeight:"16.8px"}));styled$1("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function cM({walletId:e,country:t,name:o,...n}){return jsx(a$1,{style:{textAlign:"center",overflow:"visible"},...n,children:jsxs(cC,{children:[t&&jsx(a$2,{title:Ua$1(t),children:jsx(a$f,{countryCode:t})}),jsxs(uC,{children:[jsx(dC,{src:$b,alt:"bank-icon"}),e&&jsxs(fC,{children:[o," \xB7\xB7\xB7\xB7 ",e?.substring((e?.length||0)-4)]})]})]})})}var uM=cM;var gC=b$1(i(),1);var wp={PAID_OUT:Zj,SETTLED:dk,PENDING:yh$1,INITIATED:yh$1,FAILED:Wj};function xM({payoutStatus:e="PAID_OUT",...t}){let{t:o}=useTranslation(),n$1=useTheme();return jsx(a$1,{...t,children:jsx(n,{children:jsx(o$1,{className:"payout-status",style:{visibility:"visible",width:"36px",borderRadius:"23.1px",backgroundColor:n$1.palette.common.white,border:`1.029px solid ${n$1.palette.divider}`},children:e&&wp[e]&&jsx(a$2,{title:o((0, gC.default)(e)),children:jsx(p$1,{src:wp[e],alt:"settled-icon",style:{width:"16px",height:"16px",objectFit:"contain"}})})})})})}var CM=xM;styled(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"}));styled(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"}));styled(motion.span)(({theme:e})=>({color:e.palette.common.white,display:"block",fontWeight:e.typography.fontWeightBold,fontSize:"9.78px",borderRadius:"4px",paddingInline:e.spacing(.45)}));styled("img")(()=>({width:"13px",height:"13px"}));styled(motion.span)(({theme:e})=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,position:"relative"}));styled(motion.div)(()=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",width:"0",overflow:"hidden",opacity:0}));styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"}));var hM=styled("span")(({theme:e})=>({textDecorationLine:"underline",color:e.palette.info.dark}));var xC=b$1(i(),1);var vp=a$A;function bM({status:e,chargeStatus:t,isTextShown:o,...n$1}){let{t:r}=useTranslation();return jsx(a$1,{...n$1,children:jsxs(n,{children:[jsx(y,{status:e,isTextShown:o}),t&&vp[t]&&jsx(a$2,{title:r((0, xC.default)(t)),children:jsx(p$1,{src:vp[t],alt:"charge-icon"})})]})})}var IM=bM;var ya=b$1(i(),1);var SM={FAILED:Pg,PENDING:Wg,INITIATED:Lg,ATTEMPTED:Kg,EXEMPTED:Og,EXEMPTED_WITH_TRANSACTION:Og,EXEMPTED_WITHOUT_TRANSACTION:Ng,REJECTED:Mg,UNAVAILABLE:Rg,UNDETERMINED:Sg,SUCCESS:Vg,AUTHENTICATED:Ug,AUTHENTICATED_WITH_TRANSACTION:Ug,AUTHENTICATED_WITHOUT_TRANSACTION:Ug,AUTHENTICATED_AUTHORIZE_FAILED:Pg},Ep={FAILED:Xg$1,PENDING:Yg,INITIATED:Zg$1,ATTEMPTED:_g,EXEMPTED:$g,EXEMPTED_WITH_TRANSACTION:$g,EXEMPTED_WITHOUT_TRANSACTION:ah$1,REJECTED:bh$1,UNAVAILABLE:ch$1,UNDETERMINED:dh,SUCCESS:eh$1,AUTHENTICATED:fh$1,AUTHENTICATED_WITH_TRANSACTION:fh$1,AUTHENTICATED_WITHOUT_TRANSACTION:gh$1,AUTHENTICATED_AUTHORIZE_FAILED:Xg$1},po=a$A;function vM({status:e,authorizedStatus:t,chargeStatus:o,chargeTooltip:n,gatewayTooltip:r,acquirerTooltip:i,errorCode:a,...l}){let{t:s}=useTranslation(),p=[e&&Ep[e]?jsx(a$2,{title:s((0, ya.default)(e)),children:jsx("img",{src:Ep[e],alt:"authentication-icon",style:{width:"36px",height:"24px",objectFit:"scale-down"}})}):null,o&&po[o]?jsx(a$2,{title:s((0, ya.default)(o)),children:jsx(k$1,{showAuthorizedStatus:true,chargeStatus:o,gatewayTooltip:r,chargeTooltip:n,acquirerTooltip:i,errorCode:a})}):null,t&&f$3[t]?jsx(a$2,{title:s((0, ya.default)(t)),children:jsx("img",{src:f$3[t],alt:"authorized-icon",style:{width:"36px",height:"20px",objectFit:"scale-down"}})}):null].filter(Boolean),d=40,m=0;return jsx(a$1,{...l,sx:{position:"relative",overflow:"visible"},children:jsx(c$6,{initial:"initial",whileHover:"hover",animate:"start",children:p.map((c,u)=>{if(!c)return null;let f=(u-m)*d,g=u>m,x=u<m;return jsx(b$b,{variants:{initial:{x:x?-5:g?5:0,zIndex:x?100-u:g?u:100},hover:{x:f,zIndex:100-Math.abs(m-u)}},transition:{duration:.3,type:"tween",ease:"easeOut"},statusesCount:p.length||0,children:jsx(a$y,{children:c})},u)})})})}var EM=vM;var CC=b$1(i(),1);var Pp={issuer:Hh$1,scheme:Ih$1,device:Fh$1,app:Eh$1,wallet:Dh$1,biometric:Fh$1};function MM({type:e,...t}){let{t:o}=useTranslation();return jsx(a$1,{...t,children:jsx(n,{children:jsx(o$1,{className:"authentication-status",children:e&&Pp[e]&&jsx(a$2,{title:o((0, CC.default)(e)),children:jsx(p$1,{src:Pp[e],alt:"authentication-type"})})})})})}var AM=MM;var hC={SMS:Zd$1,EMAIL:Vd,WHATSAPP:_d};var yC=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),bC=styled$1("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),IC=styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"})),TC=styled$1("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),SC=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"}));function kM({channels:e,isTextShown:t,...o}){let{t:n}=useTranslation(),r=useTheme(),i={WHATSAPP:r.palette.custom[700],EMAIL:r.palette.custom[800],SMS:r.palette.custom[900]},l=e?.sort(p=>p==="EMAIL"?-1:p==="SMS"?1:p==="WHATSAPP"?2:0)?.filter(p=>!!p)?.map((p,d)=>{if(!p)return null;let m=n(p?.toLowerCase());return jsx(a$2,{title:m,children:jsx(a$B,{order:d,variants:c$8(d,t?74:0),sx:{width:t?"70px":"36px"},children:t?jsx(SC,{children:jsx(TC,{sx:{color:i[p]},children:m})}):jsx(bC,{src:hC[p],alt:p})})},`${p}-${d}`)}),s=l?.length||0;return jsx(a$1,{...o,children:jsx(yC,{children:l?.length>0?jsx(IC,{layout:true,className:"payment-sources-container",whileHover:"animate",animate:"start",sourcesCount:s||0,variants:{animate:{width:(s||0)*38}},style:{zIndex:29},children:l}):null})})}var BM=kM;function sr(e){return H(e,{sameDay:"[Today at] h:mm A",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM DD, YYYY",lastWeek:"MMM DD, YYYY",nextWeek:"MMM DD, YYYY"})}styled$1(motion.div)(({theme:e,background:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.5),paddingBlock:e.spacing(.5),backgroundColor:t,height:"24px",width:"fit-content",borderRadius:"80px",fontSize:"10px",color:e.palette.text.primary}));styled$1("img")(()=>({width:"16px",height:"16px"}));styled$1("div")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.error.main}));styled$1("div")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.error.main}));var wC=styled$1(a$3)(({theme:e})=>({fontSize:"11px",fontWeight:500,color:"#000",cursor:"default"}));function NM({dueDate:e,expiryDate:t,...o}){let n=useMemo(()=>({label:sr(Jd(e).valueOf()),tooltip:"Due Date"}),[e]),r=useMemo(()=>({label:sr(Jd(t).valueOf()),tooltip:"Expiry Date"}),[t]),i=s=>jsx(a$2,{title:s.tooltip,children:jsx(wC,{children:s.label})}),a=useMemo(()=>e?i(n):t?i(r):null,[n,r,e,t]),l=useMemo(()=>t&&e?[i(r)]:[],[n,r,e,t]);return !e&&!t?null:jsx(a$1,{...o,sx:{position:"relative",overflow:"visible"},children:jsx(a$e,{sx:{justifyContent:"flex-start"},centerIcon:a,rightIcons:l})})}var VM=NM;var EC=styled$1(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.75),height:"34px",minWidth:"24px",borderRadius:"8px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,position:"relative",zIndex:10,border:"1px solid transparent","&:hover":{backgroundColor:e.palette.common.white,border:`1px solid ${e.palette.divider}`}}));styled$1("div")(({theme:e})=>({borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"12px",fontWeight:e.typography.fontWeightRegular,color:e.palette.secondary.main,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),lineHeight:0}));styled$1("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));styled$1("span")(({theme:e,isCapture:t})=>({backgroundColor:t?e.palette.info.dark:"#656565",color:e.palette.common.white,borderRadius:e.spacing(.5),padding:"1.285px 2.569px",height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600}));var Mp=styled$1("img")({width:"24px",height:"24px"});function OM({products:e,...t}){let o=e?.map(r=>jsx(Mp,{sx:{...r?.toLowerCase()===an.tokens.code?.toLowerCase()&&{borderRadius:"8px",border:"1px solid rgba(0, 0, 0, 0.10)"}},className:"app-logo",src:cn$1.find(i=>i.code?.toLowerCase()===r?.toLowerCase())?.iconUrl,alt:"product-icon"},r)),n$1=jsxs(EC,{whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:"10px 0px 8px 0px #F2F2F2"}},children:[jsx(Mp,{src:ci,alt:"products-icon"}),jsx(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:o})]});return jsx(a$1,{...t,style:{overflow:"visible"},children:jsx(n,{children:jsx("div",{style:{width:"30px",position:"relative",zIndex:24},children:n$1})})})}var _M=OM;function Ta(e){return jsx(m$1,{...e,children:jsx(a$2,{title:e.tooltip||e.children,children:e.children})})}var DC=styled(En)(()=>({display:"flex",alignItems:"center",gap:"8px"})),RC=styled(En)(({theme:e})=>({fontSize:"14px",color:e.palette.text.primary,lineHeight:"16.8px"}));function yU({currency:e}){return jsxs(DC,{children:[jsx(a$f,{currencyCode:e}),jsx(RC,{children:e})]})}Jd.extend(GM);Jd.extend(YM);function BC({value:e,...t}){let o=useMemo(()=>H(e,{sameDay:"[Today]",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM D, YYYY",lastWeek:"MMM D, YYYY",nextWeek:"MMM D, YYYY"}),[e]);return jsx(a$1,{...t,children:o})}var FC=styled(En)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:36,height:24,border:`1px solid ${e.palette.divider}`,borderRadius:"24px","&:hover":{boxShadow:e.shadows[4]}}));function HU({reference:e}){return e?jsx(a$2,{title:`Bank - ${e}`,children:jsx(FC,{children:jsx(En,{component:"img",src:mb$2,alt:"bank",width:14})})}):jsx(Fragment,{})}var Dp=b$1(gb(),1);var Ap={acquirer:mb$2,generic:nb$1,payment:Xd,order:Wd};var NC=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),VC=styled$1("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),WC=styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({sourcesCount:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${e*6+36}px `,minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),HC=styled$1("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),OC=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"}));styled$1("div")(()=>({height:"18px"}));var _C=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:o?e*o:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t}});function tA({isTextShown:e,getTooltipTitle:t,...o}){let[n,r]=useState(false),i=useTheme(),a=useMemo(()=>Object.keys(Ap).filter(p=>!!o[p]),[o]),l=useMemo(()=>a.map((p,d)=>{let m=t?.(p)||`${(0, Dp.default)(p)} - ${o[p]}`;return jsx(a$2,{onOpen:()=>{r(true);},onClose:()=>{r(false);},title:m,wrapperProps:{sx:{width:e?"79px":"36px"}},children:jsx(a$B,{order:d,variants:_C(d,i.shadows[4],e?83:0),sx:{width:e?"79px":"36px"},children:e?jsx(OC,{children:jsx(HC,{children:(0, Dp.default)(p)})}):jsx(VC,{src:Ap[p],alt:p,sx:{...p==="order"&&{width:"11.82px"}}})})},`${p}-${d}`)}),[o,a,e,i]),s=l?.length||0;return jsx(a$1,{...o,children:jsx(NC,{children:s>0?jsx(WC,{layout:true,className:"reference-sources-container",whileHover:"animate",animate:n?"animate":"start",sourcesCount:s,variants:{animate:{width:s*38}},style:{zIndex:29},children:l}):null})})}var oA=tA;var Rp={Y:{tooltip:"Authenticated",icon:Ug,borderColor:"rgba(31, 136, 208, 0.10)"},N:{tooltip:"Failed Authentication",icon:Dg,borderColor:"rgba(240, 130, 0, 0.10)"},R:{tooltip:"Failed Authentication",icon:Dg,borderColor:"rgba(240, 130, 0, 0.10)"},A:{tooltip:"Attempted",icon:Kg,borderColor:"rgba(31, 136, 208, 0.10)"},U:{tooltip:"Failed Authentication",icon:Dg,borderColor:"rgba(240, 130, 0, 0.10)"},noAuth:{tooltip:"Not Authenticated",icon:Lg,borderColor:"#F2F2F2"}},Lp={"3DS":{tooltip:"3DS",icon:Aj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:zj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:Aj,borderColor:"rgba(31, 136, 208, 0.10)"}};styled$1("img")(()=>({width:"12.67px",height:"15px"}));var $C=styled$1(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),YC=styled$1("img")({width:"16px",height:"16px"});styled$1("div")(({theme:e})=>({borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"10px",fontWeight:e.typography.fontWeightRegular,color:e.palette.text.primary,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),lineHeight:0}));var GC=styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"})),KC=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"},...e>0&&{opacity:0}},animate:{x:o?e*o:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t,...e>0&&{opacity:1}}}),qC=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}));function rA({transactionStatus:e,isTextShown:t,eci:o,authType:n,...r}){let i=useTheme$1(),a=useMemo(()=>{let p=Rp[e??"noAuth"]??Rp.noAuth,d=p?.tooltip,m=p?.icon;return [{tooltip:d,content:t?d:m,type:t?"text":"icon"},...n?[{tooltip:n,content:t?Lp[n]?.tooltip:Lp[n]?.icon,type:t?"text":"icon"}]:[],{tooltip:"",content:o?`ECI ${o}`:"",type:"text"}]},[e,o,t]),l=useMemo(()=>a.filter(p=>!!p.content).map((p,d)=>{let m=p.type==="text"?jsx(qC,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(j$1,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":p.content,children:p.content})}):jsx(YC,{src:p.content,alt:p.tooltip});return jsx(a$2,{title:p.tooltip,children:jsx(a$B,{order:-1*d,variants:KC(d,i.shadows[4],t?124:39),sx:{...p.type==="text"&&{width:t?"120px":"58px"}},children:m})},`${p.tooltip}-${d}`)}),[r,a,t,i]),s=l.length;return jsx(a$1,{...r,children:jsx($C,{children:s>0?jsx(GC,{layout:true,className:"authentication-sources-container",whileHover:"animate",animate:"start",sourcesCount:s,variants:{animate:{width:38}},style:{zIndex:29},children:l}):null})})}var iA=rA;var XC=b$1(i(),1);var kp={checkout:mh$1,checkoutSuccess:nh$1};function lA({status:e,...t}){let{t:o}=useTranslation();return jsx(a$1,{...t,sx:{overflow:"visible"},children:jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px",overflow:"visible"},children:e&&kp[e]&&jsx(a$2,{title:o((0, XC.default)(e)),children:jsx(p$1,{src:kp[e],alt:"checkout-icon"})})})})}var sA=lA;var Fp=b$1(i(),1);var Bp={TRANSACTED:sh,INITIATED:qh$1,CANCELLED:rh$1,EXPIRED:ph$1};function ZC({status:e,chargeStatus:t,...o}){let{t:n}=useTranslation();return jsx(a$1,{...o,sx:{overflow:"visible"},children:jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px",overflow:"visible"},children:[e&&Bp[e]&&jsx(a$2,{title:n((0, Fp.default)(e)),children:jsx(p$1,{src:Bp[e],alt:"intents-icon"})}),t&&po[t]&&jsx(a$2,{title:n((0, Fp.default)(t)),children:jsx(k$1,{chargeStatus:t})})]})})}var Vp=b$1(i(),1);var QC=styled$1(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",paddingInline:e.spacing(.5),paddingBlock:e.spacing(.5),backgroundColor:"#eeeeee",borderRadius:"56px",height:"24px",fontSize:"10px",color:e.palette.text.primary,zIndex:24,overflow:"visible",position:"absolute",gap:"0px"})),eh=styled$1(motion.div)(({theme:e,percentage:t})=>({border:`0.6px ${[0,100].includes(t)?"solid":"dashed"} #656565`,borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(1),fontSize:"7px",fontWeight:e.typography.fontWeightBold,color:"#656565",display:"flex",alignItems:"center",justifyContent:"space-between",gap:e.spacing(.5),minWidth:"44px"}));styled$1("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));function th(e){return e<5?5:e===100?95:e}var va={PAID_OUT:{color:"#2ACE00",backgroundColor:"#2ACE000D"},PENDING:{color:"#FF7A00",backgroundColor:"#FF7A000D"},SETTLED:{color:"#2ACE00",backgroundColor:""}};function uA({percentage:e$1,date:t,payoutStatus:o,payoutTooltip:n,chargeTooltip:r,refundCount:i,isTextShown:a,...l}){let{t:s}=useTranslation(),p=useTheme();return e$1===0?null:jsx(a$1,{...l,style:{overflow:"visible",position:"relative"},children:jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px"},children:[jsx(a$2,{title:r,children:jsxs(QC,{whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{gap:"4px"}},sx:{...a&&{height:"auto",padding:"0",backgroundColor:"transparent"}},children:[jsx(eh,{percentage:e$1,sx:{backgroundColor:"#eeeeee",...a&&{backgroundColor:"transparent",border:"none"}},variants:{...!a&&{animate:{boxShadow:p.shadows[4]}}},children:a?jsxs(j$1,{children:[e$1,"%"]}):jsxs(Fragment,{children:[e$1," % ",jsx(q,{percentage:th(e$1)})]})}),i>1&&jsx(motion.div,{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px"},children:jsx(motion.div,{style:{alignItems:"center",justifyContent:"center",gap:"4px",position:"relative",zIndex:22,overflow:"visible"},initial:{width:0,opacity:0,paddingRight:"0px"},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",paddingRight:"4px",boxShadow:p.shadows[4]},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs(e,{compact:true,variant:"neutral",children:[i,"x"]})})})]})}),jsx(o$1,{className:"payout-status",style:{visibility:o==="PENDING"?"hidden":"visible",position:"relative",left:"57px",width:a?"auto":"24px"},children:o&&e$2[o]&&jsx(a$2,{title:n||s((0, Vp.default)(o)),children:a?jsx(j$1,{sx:{color:va[o].color,border:`1px solid ${va[o].color}1a`,backgroundColor:va[o].backgroundColor},children:s((0, Vp.default)(o))}):jsx(p$1,{src:e$2[o],alt:"settled-icon"})})})]})})}var fA=uA;var nh={DELETED:ff,DRAFT:gf,CREATED:hf,CANCELLED:ya$1,CANCELED:ya$1,EXPIRED:za$1,PAID:kf,REFUNDED:qf,DELIVERED:lf,VIEWED:mf,SAVED:nf,SCHEDULED:of,PENDING:pf,REMINDED:""};function rh(e){switch(e){case "CANCELLED":case "DELETED":return {color:"#FF3D00",background:"#FFF5F2"};case "VIEWED":return {color:"#1F88D0",background:"#e1edf8"};case "REFUNDED":return {color:"#4E1FD0",background:"#ede8fb"};case "PAID":return {color:"#2ACE00",background:"#EAFAE5"};case "EXPIRED":return {color:"#FF7A00",background:"#FFF2E5"};case void 0:return {color:"#FF7A00",background:"transparent"};default:return {color:"#818181",background:"#F2F2F2"}}}var ih=b$1(i(),1);function ah({chargeStatus:e,chargeTooltip:t,errorCode:o,iconStyles:n,iconWrapperStyles:r}){let{t:i}=useTranslation(),a=e?b$d[e]:null,l=e&&a$A[e]&&jsx(s$1,{style:r,children:jsx(p$1,{src:a$A[e],alt:"charge-icon",style:{width:"16px",height:"16px",...n}})}),s=t&&jsx(Fragment,{children:jsx("div",{children:t})});return e?jsx(a$2,{title:s??i((0, ih.default)(e)),children:jsxs(En,{sx:{display:"flex",gap:"6px",alignItems:"center"},children:[l,!!kn$1?.includes(e||"")&&jsx(r$1,{style:{background:a?.color},children:o})]})}):null}function lh({status:e$1,date:t,viewsCount:o,chargeStatus:n,errorCode:r,chargeTooltip:i,remindedCount:a=0,...l}){let{t:s}=useTranslation(),p=useTheme(),d=e$1?nh[e$1]:null,m=rh(e$1),c=`${s(e$1?.toLowerCase()||"")} ${sr(Jd(t).valueOf())}`,u=useMemo(()=>jsx(ah,{chargeStatus:n,errorCode:r,chargeTooltip:i}),[n,r,i]),f=useMemo(()=>jsx(a$2,{title:s("reminded"),children:jsxs(En,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},children:[jsx(q$1,{sx:{width:"14px",height:"14px"},src:he$1,alt:"icon"}),jsx(e,{variant:"default",style:{background:p.palette.error.main,fontWeight:600,color:p.palette.common.white},children:a})]})}),[a]),g=useMemo(()=>{if(d)return jsx(a$2,{title:s(c||""),children:jsx(q$1,{src:d,alt:"status icon"})});if(n&&po[n])return u;if(a)return f},[d,n,a]);return !e$1&&!n&&!a?null:jsx(a$1,{...l,sx:{position:"relative",overflow:"visible"},children:jsx(a$e,{sx:{justifyContent:"flex-start"},expandableCenterRight:o&&e$1==="VIEWED"&&d?[jsx(e,{variant:"default",style:{marginRight:"8px",color:"#fff",backgroundColor:m.color},children:o})]:void 0,centerIcon:g,leftIcons:a&&d?[f]:void 0,rightIcons:n&&po[n]&&d?[u]:void 0})})}function vA({tooltip:e$1,children:t,badge:o,...n}){return jsx(a$1,{style:{textAlign:"center",overflow:"visible"},...n,children:t?jsx(a$2,{title:e$1,children:jsx(d$1,{"data-testid":"BadgeCell_BadgeWrapper",children:jsxs(j$1,{"data-testid":"BadgeCell_TextLabel",sx:{minWidth:"max-content",gap:"0.5rem"},children:[t,(o||0)>1&&jsxs(e,{variant:"dark",style:{fontWeight:"bold"},children:["+",o]})]})})}):null})}var EA=vA;var ur=b$1(i(),1);var Op={ACTIVE:Sh$1,EXPIRED:Rh$1,PENDING:Sh$1,SAVED:Ph$1,TRANSACTED:Qh$1,CONSUMED:Qh$1};var PA=(c=>(c.ABANDONED="ABANDONED",c.IN_PROGRESS="IN_PROGRESS",c.VOID="VOID",c.CANCELLED="CANCELLED",c.CAPTURED="CAPTURED",c.INITIATED="INITIATED",c.FAILED="FAILED",c.DECLINED="DECLINED",c.RESTRICTED="RESTRICTED",c.TIMEDOUT="TIMEDOUT",c.UNKNOWN="UNKNOWN",c.AUTHORIZED="AUTHORIZED",c))(PA||{});function AA({status:e,chargeTooltip:t,gatewayTooltip:o,acquirerTooltip:n$1,errorCode:r,cardId:i,hasChargeIcon:a,hasAuthorizedIcon:l,...s}){let{t:p}=useTranslation();return jsx(a$1,{...s,sx:{position:"relative",overflow:"visible"},children:jsxs(n,{sx:{gap:"0.5rem"},children:[e&&Op[e]&&jsx(a$2,{title:p((0, ur.default)(e)),children:jsx(p$1,{src:Op[e],alt:"token-icon"})}),i&&jsx(a$2,{title:p((0, ur.default)(e)),children:jsx(p$1,{src:Th$1,alt:"card-icon"})}),a&&jsx(a$2,{title:p((0, ur.default)("CAPTURED")),children:jsx(k$1,{showAuthorizedStatus:true,chargeStatus:"CAPTURED",gatewayTooltip:o,chargeTooltip:t,acquirerTooltip:n$1,errorCode:r})}),l&&jsx(a$2,{title:p((0, ur.default)("AUTHORIZED")),children:jsx(p$1,{src:f$3.AUTHORIZED,alt:"authorized-icon"})})]})})}var DA=AA;var zp=styled$1("img")(()=>({maxWidth:"13px",maxHeight:"13px"})),ph=styled$1("div")(({theme:e})=>({width:"24px",height:"24px",border:`1px solid ${e.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%"})),mh=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));function LA({brandName:e,brandIcon:t,...o}){return jsx(a$1,{style:{textAlign:"center",overflow:"visible"},...o,children:jsxs(mh,{children:[jsx(ph,{children:t?jsx(a$2,{title:e,children:jsx(zp,{src:t,alt:"brand icon",onError:r=>{r.currentTarget.src=ji$1;}})}):jsx(zp,{src:ji$1,alt:"brand icon"})}),jsx("span",{children:e})]})})}var kA=LA;function ch({metadata:e}){let t=Object.keys(e)[0]??"",o=Object.keys(e)[1]??"",n=Object.keys(e)[2]??"",r=Object.keys(e)[3]??"",i=Object.keys(e)[4]??"",a=t||o||n||r||i?`${e[t]?`${e[t]}${e[o]||e[n]||e[r]||e[i]?",":""}`:""}${e[o]?`${e[o]}${e[n]||e[r]||e[i]?",":""}`:""}${e[n]?`${e[n]}${e[r]||e[i]?",":""}`:""}${e[r]?`${e[r]}${e[i]?",":""}`:""}${e[i]??""}`:"";return a?jsx(a$2,{title:a,children:jsx(Box,{component:"img",src:Kj,alt:"meta",sx:{cursor:"pointer"}})}):null}var fh=styled("span")(({theme:e})=>({border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,paddingInline:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:"36px",cursor:"pointer"})),gh=styled(motion.img)(()=>({width:"16px",height:"16px"}));var WA=({onClick:e,isSettlementsAvailable:t,isDownloadError:o,isDownloadLoading:n,isDownloadSuccess:r})=>{let i=useMemo(()=>n||r||o,[n,r,o]),a=useMemo(()=>r?gc$1:o?fc:Ij,[r,o]);return jsx(a$2,{title:t?"":"Pending",children:jsx(fh,{onClick:()=>t&&!i&&e(),children:jsx(AnimatePresence,{mode:"wait",initial:false,children:n?jsx(a$C,{},"spinner"):jsx(gh,{src:t?a:Jj,alt:"Download Report"})})})})};var OA=({receiptId:e})=>jsx(TableCell,{component:"div",children:jsx(a$2,{title:`Receipt - ${e}`,children:jsx(j$1,{sx:{padding:"3px 8px",maxWidth:"50px"},children:jsx("img",{src:nc$1,alt:"receipt"})})})});var _A=({receiptId:e})=>jsx(m$1,{children:jsx("span",{children:e})});var zA=({receiptId:e})=>jsx(Ta,{children:jsx("span",{children:e})});var yh=styled$1("div",{shouldForwardProp:e=>!["licenseNumber","hasClick"].includes(e)})(({theme:e,licenseNumber:t,hasClick:o})=>({display:"flex",alignItems:"center",gap:e.spacing(1),border:"1px solid #F2F2F2",borderRadius:"44px",padding:"3.5px 5px",height:"24px",cursor:o?"pointer":"default",...t&&{padding:"3.5px 8px"}})),bh=styled$1(En)(()=>({display:"flex",alignItems:"center",gap:"4px",overflow:"hidden",width:"100%"}));styled$1("img")(()=>({width:"16px",height:"11.73px"}));var Ih=styled$1("div",{shouldForwardProp:e=>!["licenseNumber"].includes(e)})(({theme:e,licenseNumber:t})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",margin:"0",width:"74px",...!t&&{color:"#B1B1B1",width:"84px"}})),Th=styled$1("img")(()=>({width:"10.5px",height:"10.5px"})),Sh=styled$1("div")({marginLeft:"auto",width:"auto"});var wh={incomplete:qj,complete:pj,reviewed:pj,verified:rj};function vh({entity:e,country:t,verificationStatus:o,licenseNumber:n,hideStatus:r,...i}){let a=wh[o??"incomplete"];return jsx(a$1,{...i,sx:{cursor:i?.onClick?"pointer":"default"},children:jsx(a$2,{title:e,children:jsx(yh,{hasClick:!!i?.onClick,licenseNumber:n,children:jsxs(bh,{children:[jsx(a$2,{title:t?Ua$1(t):"",children:jsx(a$f,{countryCode:t})}),jsx(Ih,{licenseNumber:n,children:n||"Not Available"}),!r&&jsx(Sh,{children:jsx(Th,{src:a})})]})})})})}var Eh=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Ph=styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"default",backgroundColor:e.palette.background.paper,borderRadius:"16px"}));styled$1("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"}));styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"}));var Mh=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:o?e*o:e*40,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t}});function Dh({acceptance:e,payout:t,hideAcceptance:o,hidePayout:n,closed:r,...i}){let a=e?.toLowerCase()==="enabled",l=t?.toLowerCase()==="enabled",s=r?.toLowerCase()==="closed",[p,d]=useState(false),m=useTheme(),c=useMemo(()=>[{icon:a?rc:ni,tooltip:"Acceptance",enabled:a,shown:!o,zIndex:a&&!l?3:1},{icon:l?sc$1:ri,tooltip:"Payout",enabled:l,shown:!n,zIndex:2},{icon:Mh$1,tooltip:"Closed",enabled:s,shown:s,zIndex:3}].filter(g=>g.shown),[a,l,o,n,s]),u=useMemo(()=>c.map((g,x)=>{let y=g.tooltip;return jsx(a$B,{order:x,variants:Mh(x,m.shadows[4],40),sx:{width:"36px",zIndex:g.zIndex+6},children:jsx(a$2,{onOpen:()=>{d(true);},onClose:()=>{d(false);},title:y,children:jsx(a$D,{mainIcon:g.icon,mainIconSize:16,containerSize:16,sx:{borderRadius:"40px"},onError:C=>{C.currentTarget.src=g.icon,C.currentTarget.style.borderRadius="0px";},borderColor:"transparent"})})},`${g.tooltip}-${x}`)}),[c,m]),f=c?.length||0;return jsx(a$1,{...i,children:jsx(Eh,{children:f>0?jsx(Ph,{layout:true,className:"reference-sources-container",whileHover:"animate",animate:p?"animate":"start",sourcesCount:f,variants:{animate:{width:f*38}},style:{zIndex:29},children:u}):null})})}var Vh=b$1(gb(),1);var gr={technology:uk,institution:tk,payment:Xd,developmentHouse:vk$1,platform:wd$1};var Rh=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Lh=styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"default",backgroundColor:e.palette.background.paper,borderRadius:"16px"})),kh=styled$1("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),Bh=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"})),Fh=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:o?e*o:e*40,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t}});var Nh=e=>{let t="";switch(e.type){case "technology":case "institution":t="Payment";break;default:t="";break}return `${t} ${rb$1(e.type)} - ${e.name}`};function JA({isTextShown:e,segments:t,...o}){let[n,r]=useState(false),i=useTheme(),a=useMemo(()=>t?.filter(s=>!!s.name).map((s,p)=>{let d=s.type?.toLowerCase?.().includes("platform"),m=s.tooltip||Nh(s),c=s.type,u=d?gr.platform:gr[c];return jsx(a$B,{order:p,variants:Fh(p,i.shadows[4],e?83:0),sx:{width:e?"79px":"36px"},children:jsx(a$2,{onOpen:()=>{r(true);},onClose:()=>{r(false);},title:m,children:e?jsx(Bh,{children:jsx(kh,{children:(0, Vh.default)(s.name)})}):jsx(a$D,{mainIcon:s.icon||u,mainIconSize:16,containerSize:16,sx:{...s.icon?{borderRadius:"40px"}:{borderRadius:"0px"}},onError:f=>{gr[c]&&(f.currentTarget.src=gr[c],f.currentTarget.style.borderRadius="0px");},borderColor:"transparent"})})},`${s.name}-${p}`)}),[t,e,i]),l=a?.length||0;return jsx(a$1,{...o,children:jsx(Rh,{children:l>0?jsx(Lh,{layout:true,className:"reference-sources-container",whileHover:"animate",animate:n?"animate":"start",sourcesCount:l,variants:{animate:{width:l*38}},style:{zIndex:29},children:a}):null})})}var QA=JA;function Hh({marketPlaceIcon:e,marketPlaceName:t,...o}){return jsx(a$1,{...o,children:jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:t&&jsxs(Fragment,{children:[jsx(Box,{sx:{width:"24px",height:"24px",border:"1px solid #F2F2F2",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e??jsx("img",{src:Pb$1,alt:"marketplace",style:{maxWidth:"18px",maxHeight:"18px",objectFit:"cover"}})}),jsx(Typography,{noWrap:true,sx:{fontSize:"14px",fontWeight:400},children:t})]})})})}var Oh={incomplete:qj,complete:pj,reviewed:pj,verified:rj};var _h=styled$1("div")(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),border:"1.029px solid #F2F2F2",borderRadius:"44px",padding:"4px 8px",lineHeight:"120%"})),zh=styled$1("div")(({theme:e})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"84px"})),Uh=styled$1("img")(()=>({width:"10.5px",height:"10.5px"})),$h=styled$1("span")(({theme:e})=>({fontSize:"9.5px",fontWeight:400,color:e.palette.common.white,backgroundColor:e.palette.grey[700],borderRadius:"4px",padding:"1px 2px"})),Yh=styled$1("div")({width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"}),Gh=styled$1("div")({display:"flex",alignItems:"center",gap:"8px"}),Kh=styled$1("div")({fontWeight:400,fontSize:14,lineHeight:"120%",letterSpacing:0,color:"#B1B1B1",textAlign:"center",width:"100%"});function qh({id:e,status:t,count:o,name:n,...r}){let i=Oh[t??"incomplete"];return jsx(a$1,{...r,sx:{cursor:"pointer"},children:jsx(a$2,{title:n,children:jsx(_h,{children:e?jsxs(Yh,{children:[jsx(zh,{children:e}),jsxs(Gh,{children:[jsx(Uh,{src:i}),o>1&&jsx("div",{children:jsxs($h,{children:["+",o-1]})})]})]}):jsx(Kh,{children:"Not Available"})})})})}var jh=styled$1("div",{shouldForwardProp:e=>!["hasClick"].includes(e)})(({theme:e,hasClick:t})=>({display:"flex",alignItems:"center",gap:e.spacing(1),border:"1px solid #F2F2F2",borderRadius:"44px",padding:"3.5px 5px",height:"24px",cursor:t?"pointer":"default"})),Xh=styled$1(En)(()=>({display:"flex",alignItems:"center",gap:"4px",overflow:"hidden",width:"100%"})),Zh=styled$1("p",{shouldForwardProp:e=>!["brandName"].includes(e)})(({theme:e,brandName:t})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"74px",margin:"0",...!t&&{color:"#B1B1B1",width:"84px"}})),Jh=styled$1("img")(()=>({width:"10.5px",height:"10.5px"})),Qh=styled$1("div")({marginLeft:"auto",width:"auto"});var ey={incomplete:qj,complete:pj,reviewed:pj,verified:rj};function ty({brand:e,verificationStatus:t,hideStatus:o,brandLogo:n,...r}){let i=ey[t??"incomplete"];return jsx(a$1,{...r,children:jsx(a$2,{title:e.name,children:jsx(jh,{hasClick:!!r.onClick,children:jsxs(Xh,{children:[n,jsx(Zh,{brandName:e.name,children:e.name||"Not Available"}),!o&&jsx(Qh,{children:jsx(Jh,{src:i})})]})})})})}var oy=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),ny=styled$1("img")(()=>({maxWidth:"36px",maxHeight:"16px"})),ry=styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"default",backgroundColor:e.palette.background.paper,borderRadius:"16px"}));styled$1("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"}));styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"}));var iy=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:t?e*t:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},...o&&{boxShadow:"7px 0px 8px 0px #F2F2F2"}}}),ay=styled$1(Box)(()=>({display:"flex",gap:"4px",maxWidth:"440px",justifyContent:"space-between",height:"18px"}));var lD=e=>!e.startsWith("http://")&&!e.startsWith("https://"),Aa=e=>/^https?:\/\//i.test(e),ly=(e,t)=>{switch(t){case "website":return e;case "physical_store":case "call_center":return null;case "linkedin":case "instagram":case "twitter":case "social_media":return sD(e,t);case "ios":case "android":case "mobile_app":return pD(e,t);default:return e}},sD=(e,t)=>{let o=e.toLowerCase();return t==="linkedin"?o.includes("linkedin.com")||o.includes("linked.com")?e:Aa(e)?null:`https://linkedin.com/company/${e}`:t==="instagram"?o.includes("instagram.com")?e:Aa(e)?null:`https://instagram.com/${e}`:t==="twitter"?o.includes("twitter.com")||o.includes("x.com")?e:Aa(e)?null:`https://x.com/${e}`:null},pD=(e,t)=>e.toLowerCase().includes("apps.apple.com")&&t==="ios"?e:t==="android"?Aa(e)?e:`https://play.google.com/store/apps/details?id=${e}`:null,sy=e=>{!e||typeof e!="string"||window.open(lD(e)?`https://${e}`:e,"_blank","noopener,noreferrer");};function mD({channels:e,...t}){let o=e?.filter(r=>!!r.address)?.map((r,i)=>{let a=r.address,l=r.code?.replace(/_/g,""),s=i===e?.length-1,p=ly(r.address??"",r.code??"");return jsx(a$2,{title:a,children:jsx(a$B,{order:i,variants:iy(i,0,s),sx:{width:"36px",cursor:p?"pointer":"default"},onClick:()=>{r?.address&&sy(p);},children:jsx(ny,{src:r.logo,alt:l})})},`${r}-${i}`)}),n=o?.length||0;return jsx(a$1,{...t,children:jsx(oy,{children:o?.length>0?jsx(ry,{layout:true,className:"sales-channels-container",whileHover:"animate",animate:"start",sourcesCount:n||0,variants:{animate:{width:(n||0)*38}},style:{zIndex:29},children:o}):null})})}var dD=mD;function xD({channels:e,selectionProps:t={}}){let o=useRef(null),[n,r]=useState(false),[i,a]=useState(null),l=!!i;useEffect(()=>{o.current&&r(o.current.scrollHeight>20);},[e]);let s=useMemo(()=>(e||[]).filter(p=>!!p.address),[e]);return jsxs(ay,{children:[jsx(Box,{sx:{display:"flex",flexWrap:"wrap",gap:n?"8px":"4px"},ref:o,children:s.map((p,d)=>jsxs(b$a,{copyText:p.address,chipIndex:d+1,selectionProps:t,maxWidth:"367px",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"367px","& div":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"367px"}},children:[p.name?.en,": ",p.address]},p.id))}),n&&jsx(Box,{onClick:p=>{a(p.currentTarget.parentElement);},sx:{height:"18px"},children:jsx(a$d,{minWidth:"25",sx:{borderRadius:"24px",overflow:"hidden"},copyText:"...",children:"..."})}),jsx(Popover,{open:l,anchorEl:i,sx:{minWidth:i?.clientWidth},onClose:()=>{a(null);},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{style:{maxWidth:"unset",minWidth:i?.clientWidth,marginTop:"22px"}}},children:jsx(Box,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px"},children:s.map((p,d)=>jsxs(b$a,{copyText:p.address,chipIndex:d+1,selectionProps:t,children:[p.name?.en,": ",p.address]},p.id))})})]})}var CD=xD;var dy=b$1(i(),1),cy=b$1(eb$1(),1);var Gp={active:rf,completed:sf,closed:tf,expired:uf,ready:vf,registered:sf};var my=styled$1("span")(({theme:e})=>({width:"36px",height:"24px",borderRadius:"24px",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:`1px solid ${e.palette.divider}`}));function uy({status:e,...t}){let{t:o}=useTranslation();return jsx(a$1,{...t,children:e&&Gp[e]&&jsx(a$2,{title:o((0, cy.default)((0, dy.default)(e))),children:jsx(my,{children:jsx(a$D,{mainIcon:Gp[e],mainIconSize:16,containerSize:16,borderColor:"transparent"})})})})}var fy={SAVED_CARD:"Card Agreement",ORDER:"Order",SUBSCRIPTION:"Subscription",INSTALLMENT:"Installment"};function ID({type:e,count:t,...o}){let n=t?.toString();return jsxs(Box,{sx:{display:"flex",flexDirection:"row",gap:"4px"},children:[jsx(b$a,{copyText:e,unknownText:"noPaymentAgreement",...o,chipIndex:0,children:e&&fy[e]}),n&&jsx(b$a,{copyText:n,...o,chipIndex:1,minWidth:"38px",children:n})]})}var TD=ID;var xy={CYBERSOURCE:_l,MPGS:$l,NETCETERA:am$1,TAP3DS:bm$1,FSS:hm$1,BENEFIT:dm$1,QPAY:pm$1,POSTPAY:om$1,BENEFITPAY:cm$1,MEEZA:jm$1,STC_PAY:rm$1,NGENIUS:km,KNET:im$1,PAYPAL:nm,FAWRY:gm$1,TPG:vm$1,DEEMA:fm$1,TPAY:um$1,"CAREEM PAY":em$1,TABBY:sm$1,OMANNET:mm$1,NPG:lm$1,SPG:qm$1,TAMARA:tm};var hy=styled$1(En)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"24px",gap:"8px",padding:"4px 8px",borderRadius:"24px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.background.paper})),yy=styled$1("img")(()=>({width:"100%",height:"100%",objectFit:"contain"}));function by({provider:e,...t}){let o=xy[e];return o?jsx(hy,{children:jsx(yy,{src:o,alt:e})}):jsx(a$1,{...t,children:jsx(j$1,{children:e})})}var Iy={CHARGE:Ek$1,AUTHORIZE:jk$1,SAVE_TOKEN:Ig},Ty={CHARGE:"Charge",AUTHORIZE:"Authorization",SAVE_TOKEN:"Save Token"},Sy={CHARGE:{backgroundColor:"#1F88D01A",color:"#1F88D0",border:"none"},AUTHORIZE:{backgroundColor:"#FFFFFF",color:"#1F88D0",border:"#1F88D01A"},SAVE_TOKEN:{backgroundColor:"#1F88D00D",color:"#1F88D0",border:"#1F88D01A"}};var wy=styled$1(En,{shouldForwardProp:e=>!["purposeType"].includes(e)})(({purposeType:e})=>{let t=Sy[e];return {display:"flex",alignItems:"center",justifyContent:"start",gap:"4px",minWidth:"86px",width:"100%",height:"24px",padding:"4px 8px",borderRadius:"24px",border:`1px solid ${t.border}`,backgroundColor:t.backgroundColor,color:t.color,fontSize:"12px",fontWeight:400}}),vy=styled$1("img")(()=>({width:"16px",height:"16px",objectFit:"contain",flexShrink:0})),Ey=styled$1("span")(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}));function My({purpose:e,...t}){let o=Iy[e],n=Ty[e];return jsxs(wy,{purposeType:e,...t,children:[jsx(vy,{src:o,alt:e}),jsx(Ey,{children:n})]})}var Ay=styled(En)(({theme:e})=>({width:43,height:24,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"24px",border:`1px solid ${e.palette.divider}`,cursor:"pointer"}));function DD({url:e}){let t=o(),o$1=()=>{try{mb$1(e),t.success("Copied!");}catch{t.error("Failed to copy");}};return e?jsx(Ay,{onClick:o$1,children:jsx(a$g,{src:sl,alt:"link"})}):null}var RD=memo(DD);var WD=e=>{let{name:t,icon:o,namePlaceholder:n="Unavailable",showIcon:r=true,showLabel:i=true,slotsProps:a,...l}=e,{i18n:s}=useTranslation(),p=useMemo(()=>t?lc$1(t,s.language):null,[t,s.language]),{tooltip:d={},chip:m={},chipsTooltip:c={},label:u={},labelTooltip:f={}}=a||{},g=r&&!!o,x=i;return !g&&!x?null:jsxs(aE,{direction:"row",alignItems:"center",spacing:1,color:"text.primary",...l,children:[g&&jsx(a$2,{title:p?`${p}`:null,...d,...c,children:jsx(a$h,{variant:"circular",sx:{"&.CustomVariant_circular":{minWidth:32,height:32}},...m,children:o})}),x&&jsx(a$2,{title:p,...d,...f,children:jsx(sS,{noWrap:true,fontSize:12,fontWeight:500,...u,children:p||jsx(En,{component:"span",sx:{opacity:.2},children:n})})})]})},HD=memo(WD);function jq({items:e,selectionProps:t={}}){let[o,n]=useState(null),r=!!o,i=useCallback(({quantity:s,currency:p,amount:d,name:m})=>`${s?`Qty ${s}`:""} ${m?`- ${m}`:""} ${p||d?"-":""} ${p||""} ${d||""}`,[]);if(!e||!e.length)return null;let[a,...l]=e;return jsxs(En,{sx:{display:"flex",gap:"4px",alignItems:"center"},children:[jsx(b$a,{chipIndex:0,selectionProps:t,children:jsx(a$3,{noWrap:true,sx:{maxWidth:e.length>1?190:220,fontSize:11},children:i(a)})}),e.length>1&&jsx(En,{onClick:s=>{n(s.currentTarget.parentElement);},sx:{height:"18px"},children:jsx(a$d,{minWidth:"25",sx:{borderRadius:"24px",overflow:"hidden"},copyText:"...",children:"..."})}),jsx(UD,{open:r,anchorEl:o,sx:{minWidth:o?.clientWidth},onClose:()=>{n(null);},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{style:{maxWidth:"unset",minWidth:o?.clientWidth,marginTop:"22px"}}},children:jsx(En,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px"},children:l?.map((s,p)=>jsx(b$a,{copyText:i(s),chipIndex:p+1,selectionProps:t,children:i(s)},s.id))})})]})}function Ly({isCopyActive:e,onClick:t}){let o=Jc(useId(),"copy-image"),{t:n}=useTranslation();return jsx(AnimatePresence,{children:jsx(a$2,{title:n("copy"),children:e?jsx(motion.img,{id:o,"data-testid":"CopyImage",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.4},src:ra$1,alt:"icon"},"id-icon"):jsx(motion.img,{id:o,"data-testid":"CopyImage",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.4},src:pa,style:{cursor:"pointer"},alt:"icon",onClick:t},"id-icon")})})}Ly.displayName="CopyImage";var ky=memo(Ly);var jD=ky;var By="ListHeader";var Fy=styled$1(Box)(({theme:e})=>({backgroundColor:e.palette.background.default,paddingInline:e.spacing(4),paddingBottom:e.spacing(2),paddingTop:e.spacing(2),overflowX:"clip"})),Ny=styled$1(Box)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(3),width:"100%",marginBottom:e.spacing(2.25),marginTop:e.spacing(2)})),Vy=styled$1(a$3)(({theme:e})=>({fontSize:"1.75rem",fontWeight:e.typography.fontWeightMedium,lineHeight:"120%"})),Wy=styled$1(Box)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(3),width:"100%"})),Hy=styled$1(Box)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1)})),Oy=styled$1(Box)(()=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"8px",flexShrink:0}));function ka({children:e,component:t="header",...o}){return jsx(Fy,{component:t,...o,children:e})}function Ba({title:e,toolbar:t}){return jsxs(Ny,{children:[jsx("span",{children:!!e&&jsx(Vy,{children:e})}),t]})}function Fa({status:e,activeFilter:t,beforeStatus:o}){let n=t?.visible??false;return jsxs(Hy,{as:"aside",children:[o,jsx(a$u,{status:e?.value,availableStatuses:e?.options,onStatusChange:e?.onChange,isActiveFilterVisible:n,buttonSx:e?.buttonSx}),jsx(a$v,{ids:t?.ids,visible:n,label:t?.label,dismissible:t?.dismissible,onDismiss:t?.onDismiss})]})}var sn=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:"4px",background:e.palette.common.white,padding:"8px",border:"1px solid",borderColor:e.palette.divider,gap:8,height:32,cursor:"pointer","&:hover":{border:"1px solid",borderColor:e.palette.info.dark,boxShadow:e.shadows[7]}})),Na=styled$1(Box)(({theme:e})=>({background:e.palette.common.white,display:"flex",gap:e.spacing(1),alignItems:"center",color:e.palette.text.primary,fontSize:"11px",fontWeight:e.typography.fontWeightRegular,textTransform:"capitalize",position:"relative",transition:"0.5s",paddingRight:0,marginRight:0,"&:after":{content:'""',position:"absolute",left:-8,right:0,width:"100%",height:"100%",boxShadow:e.shadows[11],borderRadius:e.spacing(.5),paddingInlineStart:e.spacing(1),paddingTop:"9px",paddingBottom:"9px",paddingInlineEnd:"9px",zIndex:-1},"& > *:last-child":{marginRight:0,paddingRight:"6px"}})),pn=styled$1(Box)(({theme:e})=>({background:e.palette.common.white,borderRadius:e.spacing(1),boxShadow:e.shadows[5],border:"1px solid",borderColor:e.palette.divider,zIndex:5,fontSize:"11px",width:192})),mn=styled$1(Box)(()=>({minWidth:160,position:"relative",marginRight:0,paddingRight:0})),dn=styled$1(Box,{shouldForwardProp:e=>e!=="addColumnViewEl"})(({theme:e})=>({padding:e.spacing(1),paddingInlineEnd:2,borderBottom:"1px solid",borderColor:e.palette.divider,display:"flex",alignItems:"center",height:32,cursor:"pointer",img:{height:12},".check-icon":{height:"auto",marginInlineEnd:e.spacing(1)},"&:hover":{color:e.palette.info.dark,fontWeight:e.typography.fontWeightBold},"&.add-column":{justifyContent:"space-between",paddingInlineEnd:e.spacing(1),position:"relative",border:"none",zIndex:5,borderBottom:"1px solid",borderColor:e.palette.divider,borderTopRightRadius:e.spacing(1),borderTopLeftRadius:e.spacing(1),"&:hover":{boxShadow:e.shadows[6]}}})),cn=styled$1(Box)(()=>({width:15})),Ir=styled$1(Box)(()=>({width:16})),$y=styled$1(Box)(({theme:e})=>({display:"flex",flexDirection:"column",height:"calc(100% - 32px)",backgroundColor:e.palette.background.paper,position:"relative"})),Yy=styled$1(Box)(()=>({flex:1,overflowY:"auto",paddingLeft:16,paddingRight:16,paddingBottom:64})),Gy=styled$1(Box)(()=>({padding:"24px 0",display:"flex",justifyContent:"space-between",alignItems:"center"})),Ky=styled$1(Box)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",flex:1,minHeight:0})),qy=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",padding:"12px",borderBottom:"1px solid",borderColor:e.palette.divider,backgroundColor:e.palette.grey[50],cursor:"pointer","&:hover":{backgroundColor:e.palette.grey[100]}})),jy=styled$1(Box,{shouldForwardProp:e=>e!=="isHovered"&&e!=="isDate"})(({theme:e,isHovered:t,isDate:o})=>({display:"flex",alignItems:"center",padding:"12px",borderBottom:"1px solid",borderColor:e.palette.divider,backgroundColor:t?e.palette.action.hover:e.palette.background.paper,cursor:o?"default":"grab","&:hover":{backgroundColor:o?e.palette.background.paper:e.palette.action.hover},"&:last-child":{borderBottom:"none"}})),jp=styled$1(Box)(()=>({width:20,height:20,marginRight:8,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0})),Xp=styled$1(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"center",padding:0,width:14,height:14,minWidth:14,minHeight:14,flexShrink:0})),Xy=styled$1(Box)(({theme:e})=>({position:"absolute",bottom:0,left:0,right:0,height:35,borderTop:"1px solid",borderColor:e.palette.divider,background:"#F6F8FACC",backdropFilter:"blur(24px)"})),Zy=styled$1(Box)(({theme:e})=>({position:"absolute",bottom:12,right:16,padding:6,backgroundColor:e.palette.background.paper,border:"1px solid #9F9F9F29",borderRadius:"4px"})),Va=styled$1(Paper)(()=>({paddingTop:4,paddingBottom:4,minWidth:180,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",borderRadius:"8px"}));styled$1(Box)(()=>({display:"flex",alignItems:"center",padding:"8px 12px",cursor:"pointer"}));var Jy=styled$1(Button)(({theme:e})=>({color:e.palette.error.main,textTransform:"none",fontSize:10,fontWeight:500,borderRadius:"4px",border:`1px solid ${e.palette.divider}`,paddingLeft:8,paddingRight:8,paddingTop:4,paddingBottom:4,"&:hover":{backgroundColor:"transparent"}})),Qy=styled$1(Button)(({theme:e})=>({fontSize:9,fontWeight:600,borderRadius:4,paddingLeft:20,paddingRight:20,paddingTop:8,paddingBottom:8,height:28,textTransform:"none",backgroundColor:e.palette.info.dark,"&:hover":{backgroundColor:e.palette.info.dark},"&.Mui-disabled":{backgroundColor:e.palette.grey[300],color:e.palette.grey[500]}}));styled$1(TextField)(({theme:e})=>({"& .MuiFilledInput-root":{borderRadius:"8px",backgroundColor:e.palette.background.paper,border:"1px solid",borderColor:e.palette.divider,"&:hover":{backgroundColor:e.palette.background.paper},"&.Mui-focused":{backgroundColor:e.palette.background.paper},"&::before, &::after":{display:"none"}}}));var Zp={display:"flex",alignItems:"center",justifyContent:"center",padding:0,width:14,height:14,minWidth:14,minHeight:14,flexShrink:0,color:"grey.A400","&.Mui-checked":{color:"info.dark"},"&.MuiCheckbox-indeterminate":{color:"info.dark"},"&.Mui-disabled.Mui-checked":{color:"grey.500","& .MuiSvgIcon-root":{backgroundColor:"grey.500",borderRadius:"3px",color:"#fff"}},"& .MuiSvgIcon-root":{width:16,height:16},"& img":{width:14,height:14}},eb=styled$1(motion.div)(({theme:e})=>({position:"fixed",display:"flex",flexDirection:"column",maxHeight:"calc(100vh - 46px)",backgroundColor:e.palette.background.paper,boxShadow:"0px 8px 32px rgba(0, 0, 0, 0.15)",borderRadius:12,overflow:"hidden",boxSizing:"border-box"})),tb=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),paddingTop:e.spacing(1),paddingBottom:e.spacing(1),cursor:"pointer","&:hover":{backgroundColor:e.palette.action.hover}})),ob={p:0,width:14,height:14,minWidth:14,minHeight:14,"&.Mui-checked":{color:"info.dark"},"&.MuiCheckbox-indeterminate":{color:"info.dark"},"& .MuiSvgIcon-root":{width:16,height:16}},nb=styled$1(Box)(()=>({minWidth:200,display:"flex",flexDirection:"column",maxHeight:"80vh",overflow:"hidden"})),rb=styled$1(Box)(()=>({flex:1,overflowY:"auto",paddingLeft:6,paddingRight:6,minHeight:0})),ib=styled$1(Box)(({theme:e})=>({display:"flex",justifyContent:"flex-end",gap:12,paddingTop:8,paddingBottom:8,paddingLeft:12,paddingRight:12,flexShrink:0,borderTop:"1px solid",borderColor:e.palette.divider})),ab={fontSize:11,fontWeight:400,textTransform:"none",color:"text.primary",minWidth:80,height:38,borderRadius:"8px",border:"1px solid",borderColor:"divider"},lb=e=>({fontSize:11,fontWeight:500,textTransform:"none",backgroundColor:"info.dark",minWidth:80,height:38,borderRadius:"8px",boxShadow:"none","&:hover":{backgroundColor:e.palette.info.dark}});function Qp(e,t){let[o,n]=useState(null),[r,i]=useState(null),a=useCallback(()=>{n(null),i(null);},[]),l=useCallback((p,d)=>{n(p.currentTarget),i(d);},[]),s=useCallback(()=>{r&&a();},[r,a]);return useEffect(()=>{e||(a(),t?.());},[e,t,a]),{subMenuAnchorEl:o,openSubMenuName:r,handleSubMenuClose:a,handleSubMenuOpen:l,handleMenuScroll:s}}function i1(e){let t=e;for(;t&&t!==document.body;){let n=window.getComputedStyle(t).overflowY;if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement;}return document.documentElement}function em(e){let t=useRef(false),o=useRef(null),n=useRef({x:0,y:0}),r=useRef(1),i=useRef(null),a=useRef(0),l=useRef(false),s=useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null);},[]),p=useCallback((f,g)=>{l.current=true,window.dispatchEvent(new PointerEvent("pointermove",{bubbles:true,cancelable:true,pointerId:r.current,clientX:f,clientY:g+a.current,pointerType:"mouse",isPrimary:true})),l.current=false;},[]),d=useCallback(()=>{if(o.current!==null)return;let f=()=>{let g=i.current;if(!t.current||!g)return;let x=g.getBoundingClientRect(),{x:y,y:C}=n.current,h=C-x.top,I=x.bottom-C;if(h>0&&h<60){let S=(60-h)/60*15;g.scrollTop-=S,a.current-=S,p(y,C);}else if(I>0&&I<60){let S=(60-I)/60*15;g.scrollTop+=S,a.current+=S,p(y,C);}o.current=requestAnimationFrame(f);};o.current=requestAnimationFrame(f);},[p]),m=useCallback(f=>{l.current||(n.current={x:f.clientX,y:f.clientY},r.current=f.pointerId,t.current&&a.current!==0&&(f.stopImmediatePropagation(),p(f.clientX,f.clientY)));},[p]),c=useCallback(()=>{i.current=i1(e.current),a.current=0,t.current=true,window.addEventListener("pointermove",m,{capture:true}),d();},[e,m,d]),u=useCallback(()=>{t.current=false,a.current=0,s(),window.removeEventListener("pointermove",m,{capture:true});},[m,s]);return useEffect(()=>()=>{t.current=false,s(),window.removeEventListener("pointermove",m,{capture:true});},[m,s]),{onDragStart:c,onDragEnd:u}}function om({columns:e,setTableViews:t}){let o=useCallback(i=>{let a=i.map(l=>e.find(s=>s.name===l)).filter(l=>!!l);t?.(a);},[e,t]),n=useCallback(i=>{let a=e.map(l=>{if(l.name!==i)return l;let s=l.menuItems&&l.menuItems.length>0,p=!l.selected;if(!s)return {...l,selected:p};let d=l.menuItems?.map(m=>({...m,selected:p}));return {...l,selected:p,menuItems:d}});t?.(a);},[e,t]),r=useCallback((i,a)=>{let l=e.map(s=>{if(s.name!==i)return s;let p=s.menuItems?.map(m=>m.name===a?{...m,selected:!m.selected}:m),d=p?.some(m=>m.selected)??false;return {...s,menuItems:p,selected:d}});t?.(l);},[e,t]);return {reorderColumns:o,toggleColumnSelection:n,toggleSubmenuItem:r}}function rm({column:e,index:t,openSubMenuName:o,toggleColumnSelection:n,handleSubMenuOpen:r,handleSubMenuClose:i}){let a=e.menuItems&&e.menuItems.length>0,l=o===e.name,s=t===0,p=useMemo(()=>!!(e.selected&&e.menuItems?.some(u=>u.selected)&&!e.menuItems?.every(u=>u.selected)),[e.selected,e.menuItems]),d=useCallback(()=>{n(e.name);},[n,e.name]),m=useCallback(u=>{a&&r(u,e.name);},[a,r,e.name]),c=useCallback(()=>{a||i();},[a,i]);return {isIndeterminate:p,hasSubmenuItems:a,isSubmenuOpen:l,isFirstItem:s,handleColumnClick:d,handleMouseEnter:m,handleMouseLeave:c}}var _=(e="")=>e.toLowerCase()==="date",je=(e="")=>e.toLowerCase()==="index",Wa=(e,t="en")=>{let o=[];return e.forEach(n=>{n.columns.forEach(r=>{let i=r.name.find(l=>l.lang===t)?.text||r.name[0]?.text||r.code,a=r.fields?.length?r.fields.map(l=>({name:l.code,label:l.name?.find(s=>s.lang===t||s.lang==="")?.text||l.code,selected:l.default??false})):void 0;o.push({name:r.code,label:i,selected:_(r.code)?true:r.default??false,menuItems:a?.length?a:void 0});});}),o},l1=(e,t)=>{if(!t?.length)return [];let o=e==="sheet"?"sheet":"advanced",n=t.find(r=>r.code.toLowerCase()===o);return n?Wa([n]):[]},im=(e,t,o="en")=>{let n=e.map((i,a)=>{let l=i.menuItems?.map(p=>({code:p.name,name:[{text:typeof p.label=="string"?p.label:p.name,lang:o||""}],default:p.selected??false})),s=typeof i.label=="string"?i.label:i.name;return {code:i.name,name:[{text:s,lang:o}],order:a+1,default:i.selected??false,...l?.length?{fields:l}:{}}});return {code:t==="sheet"?"Sheet":"Advanced",columns:n}},s1=e=>{let t=new Map;return e.forEach(o=>{o.layout.forEach(n=>{let r=t.get(n.code);if(r){let i=new Set(r.columns.map(a=>a.code));n.columns.forEach(a=>{i.has(a.code)||r.columns.push(a);});}else t.set(n.code,{...n,columns:[...n.columns]});});}),Array.from(t.values())};var p1=(e,t,o=false)=>({label:e,id:`custom_${Date.now()}`,columns:t.map(n=>n.name),submenu:t,isCustom:true,default:o}),m1=(e,t)=>e.map(o=>({...o,default:o.id===t})),Ha=e=>e.role??(e.default?"default":void 0),go=e=>!!e.role||!!e.default,Xe=e=>!go(e),pb=e=>Xe(e),Sr=e=>e.filter(pb).length,am=e=>e.filter(Xe).length,Oa=(e,t="sheet",o="en")=>{let n=[],r=[],i;e.forEach(l=>{let s=t==="sheet"?"sheet":"advanced",p=l.layout.find(b=>b.code.toLowerCase()===s),d=p?Wa([p],o):[],m=l.id,c=Gb,u=Hb$1,f=d.some(b=>_(b.name))?d:[u,...d],g=f.findIndex(b=>_(b.name)),y=(g>0?[f[g],...f.filter(b=>!_(b.name))]:f).filter(b=>!je(b.name)),C=[c,...y],h=Ha(l),I=go(l),S={id:m,label:l.name,role:h,isCustom:!I,selected:l.selected,default:!!l.default,columns:C.map(b=>b.name),submenu:C};I?(l.default&&!i&&(i=C),r.push(S)):n.push(S);});let a=r.find(l=>l.default)??r[0];return {customViews:n,defaultTemplates:r,defaultTemplateColumns:i,defaultTemplate:a}},lm=(e,t="sheet",o="en")=>{let{customViews:n,defaultTemplates:r,defaultTemplate:i}=Oa(e,t,o),a=[...r,...n];return {customViews:n,defaultTemplates:r,defaultTemplate:i,allTemplates:a}},_a=(e,t)=>{let o=[];Xe(e)?o=e.submenu??[]:o=e.submenu?.length?e.submenu:t;let n=Gb;if(!o.some(m=>_(m.name)))return [n,Hb$1,...o];let i=o.findIndex(m=>_(m.name)),a=i>=0?o[i]:Hb$1,l=o.filter(m=>!_(m.name)&&!je(m.name)),s=[a,...l],p=s.some(m=>je(m.name)),d=s.findIndex(m=>je(m.name));if(p&&d>0){let m=s[d],c=s.filter(u=>!je(u.name));return [m,...c]}return p&&d===0?s:[n,...s]},d1=(e,t)=>_a(e,t).length>0,fn=e=>e.filter(t=>!je(t.name));var De=e=>e.toLowerCase(),mb=e=>new Map(e.filter(t=>!_(t.name)).map(t=>[De(t.name),t])),db=(e,t)=>e.some(o=>De(o)===De(t)),sm=(e,t)=>({...e,selected:t.selected??false,menuItems:e.menuItems?.map(o=>{let n=t.menuItems?.find(r=>De(r.name)===De(o.name));return {...o,selected:n?.selected??false}})}),wr=e=>{if(!e.menuItems?.length)return {checked:e.selected??false,indeterminate:false};let t=e.menuItems.filter(o=>o.selected).length;return {checked:t>0,indeterminate:t>0&&t<e.menuItems.length}},mm=(e,t)=>e.map(o=>{if(o.name!==t)return o;let n=!o.selected,r=o.menuItems?.map(i=>({...i,selected:n}));return {...o,selected:n,menuItems:r}}),vr=(e,t,o)=>e.map(n=>{if(n.name!==t)return n;let r=n.menuItems?.map(a=>a.name===o?{...a,selected:!a.selected}:a),i=r?.some(a=>a.selected)??false;return {...n,menuItems:r,selected:i}}),dm=(e,t)=>e.map(o=>{if(_(o.name))return o;let n=o.menuItems?.map(r=>({...r,selected:t}));return {...o,selected:t,menuItems:n}}),cm=e=>{let t=e.filter(o=>!_(o.name));return t.length===0?false:t.every(o=>o.menuItems?.length?o.menuItems.every(n=>n.selected):o.selected)},um=(e,t)=>e.filter(r=>!_(r.name)).some(r=>r.menuItems?.length?r.menuItems.some(i=>i.selected):r.selected)&&!t,fm=(e,t)=>e.trim().length>0&&e.length<=t,pe=e=>e.map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),gm=(e,t)=>e.map(o=>{if(o.name!==t)return o;if(_(o.name))return {...o,selected:true};let n=!o.selected,r=o.menuItems?.map(i=>({...i,selected:n}));return {...o,selected:n,menuItems:r}}),xm=(e,t)=>e.map(o=>{if(_(o.name))return {...o,selected:true};let n=o.menuItems?.map(r=>({...r,selected:t}));return {...o,selected:t,menuItems:n}}),Cm=e=>e.length===0?false:e.every(t=>t.menuItems?.length?t.menuItems.every(o=>o.selected):t.selected),hm=(e,t)=>e.length===0?false:e.some(n=>n.menuItems?.length?n.menuItems.some(r=>r.selected):n.selected)&&!t,pm=e=>e.map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),Er=(e,t)=>{if(e.length!==t.length)return false;let o=pm(e),n=pm(t);for(let r=0;r<o.length;r++){let i=o[r],a=n[r];if(i.name!==a.name||i.selected!==a.selected)return false;if(i.menuItems&&a.menuItems){if(i.menuItems.length!==a.menuItems.length)return false;for(let l=0;l<i.menuItems.length;l++)if(i.menuItems[l].name!==a.menuItems[l].name||i.menuItems[l].selected!==a.menuItems[l].selected)return false}else if(i.menuItems||a.menuItems)return false}return true},c1=e=>e.filter(t=>!_(t.name)).map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),ym=(e,t)=>{let o=e.filter(i=>!_(i.name)).map(i=>i.name),n=mb(t),r=[];for(let i of o){let a=e.find(s=>De(s.name)===De(i)),l=n.get(De(i));l?r.push(a?sm(l,a):{...l,selected:false,menuItems:l.menuItems?.map(s=>({...s,selected:false}))}):a&&r.push(a);}for(let[,i]of n)if(!db(o,i.name)){let a=e.find(l=>De(l.name)===De(i.name));r.push(a?sm(i,a):{...i,selected:false,menuItems:i.menuItems?.map(l=>({...l,selected:false}))});}return r},bm=e=>e.filter(t=>!_(t.name)).map(t=>({...t,selected:false,menuItems:t.menuItems?.map(o=>({...o,selected:false}))})),Im=(e,t)=>{let o=mb(e),n=t.filter(i=>!_(i.name)).map(i=>i.name),r=[];for(let i of n){let a=t.find(s=>De(s.name)===De(i)),l=o.get(De(i));l&&a?r.push(sm(l,a)):l&&r.push({...l,selected:false,menuItems:l.menuItems?.map(s=>({...s,selected:false}))});}for(let[,i]of o)db(n,i.name)||r.push({...i,selected:false,menuItems:i.menuItems?.map(a=>({...a,selected:false}))});return r};function cb(e,t,o="en"){if(!e?.layout?.length)return [];let n=cb$1(t)?"sheet":"advanced",r=e.layout.find(l=>l.code?.toLowerCase()===n);if(!r?.columns?.length)return [];let i=r.columns.map(l=>{let s=l.name?.find(d=>d.lang===o)?.text||l.name?.[0]?.text||l.code,p=l.fields?.length?l.fields.map(d=>({name:d.code,label:d.name?.find(m=>m.lang===o||m.lang==="")?.text||d.code,selected:d.default??false})):void 0;return {name:l.code,label:s,selected:_(l.code)?true:l.default??false,...p&&p.length>0&&{menuItems:p}}});return i.some(l=>_(l.name))?i:[{name:Hb$1.name,label:Hb$1.label,selected:true},...i]}var za=e=>{let t=e?.order;if(t==null)return 999;let o=Number(t);return Number.isFinite(o)?o:999};function Ua(e){return {...e,layout:e.layout?.map(t=>({...t,columns:[...t.columns??[]]}))??[]}}function u1(e,t){let o=e.layout?.map(r=>({...r,columns:[...r.columns??[]].sort((i,a)=>za(i)-za(a))})),n=cb(e,t);return {id:e.id,label:e.name,layout:o,submenu:n,columns:n.map(r=>r.name),role:Ha(e),isCustom:Xe(e),default:e.default}}var $a=(e,t)=>{if(!e)return [];let o=e;if(e.layout&&Array.isArray(e.layout)&&e.layout.length>0){let n=bb$1(t)?"Advanced":"Sheet",r=e.layout.find(i=>{let a=i.code?.trim();return a===n||a?.toLowerCase()===n.toLowerCase()})||e.layout.find(i=>{let a=i.code?.trim()?.toLowerCase();return bb$1(t)?a==="default"||a==="advanced":a==="sheet"||a==="sheets"});if(r&&r.columns&&r.columns.length>0)return r.columns.map(a=>{let s=!!a.fields?.length&&a.fields.some(d=>d.default??false),p=(a.default??false)||s;return {code:a.code,name:a.name&&a.name.length>0?a.name:[{text:a.code,lang:"en"}],selected:p,sort_order:za(a),fields:a.fields?.map(d=>({code:d.code.toLowerCase(),type:"single",parameters:[{parameter:d.code.toLowerCase(),code:d.code.toLowerCase(),selected:d.default??false}]}))||[{code:a.code.toLowerCase(),type:"single",parameters:[{parameter:a.code.toLowerCase(),code:a.code.toLowerCase(),selected:a.default??false}]}]}}).sort((a,l)=>(a.sort_order??999)-(l.sort_order??999))}return o.submenu&&Array.isArray(o.submenu)&&o.submenu.length>0?o.submenu.map((r,i)=>{let a=r.name.toLowerCase(),l;r.menuItems&&r.menuItems.length>0?l=r.menuItems.filter(m=>m.selected):l=[{name:a,label:r.label||r.name,selected:true}];let s=l.length>0?l.map(m=>({parameter:m.name.toLowerCase(),code:m.name.toLowerCase()})):[{parameter:a,code:a}],p=l.length>1?"combined":"single";return {code:r.name,name:[{text:r.label||r.name,lang:"en"}],selected:r.selected,sort_order:i+1,fields:[{code:a,type:p,parameters:s}]}}):[]},f1=(e,t)=>{if(!e||!Array.isArray(e)||e.length===0)return [];let o=e?.find(n=>n.default)||e[0];return o?$a(o,t):[]};function Tm(e,t,o){let n=e.findIndex(t);if(n===-1)return e;let r=[...e];return r[n]=o,r}function Sm(e,t){let o=t?.name??e?.name??"",n=t?.layout,r=Array.isArray(n)?n[0]:n??null,a=[...e?.layout??[]];if(r){let l=r.code?.toLowerCase(),s=a.findIndex(p=>p.code?.toLowerCase()===l);s>=0?a[s]=r:a.push(r);}return {name:o,layout:a}}var wm=e=>{let t=e;return t?!!(t.closest('[role="checkbox"]')||t.closest('input[type="checkbox"]')||t.closest('[class*="CheckboxWrapper"]')):false};var ub=e=>[...Jb$1[e]??Jb$1.default],g1=e=>Kb$1[e]??Kb$1.default,x1=(e,t)=>({code:e,name:[{text:Ib$1[e],lang:"en"}],selected:true,sort_order:t}),C1=(e,t)=>e?.layout?.some(o=>ub(t).includes(o.code?.toLowerCase()??""))??false,vm=(e,t,o)=>{let n=Kb$1[t],r=o?.layout?.find(a=>a.code?.toLowerCase()===n.toLowerCase()),i=r?{...r,columns:r.columns?.map(a=>({...a,name:a.name?.map(l=>({...l})),fields:a.fields?.map(l=>({...l,name:l.name?.map(s=>({...s}))}))}))??[]}:{code:n,columns:[]};return [e,i]};var Ya=({tableMode:e,templates:t,lang:o="en",mainDefaultTemplate:n})=>useMemo(()=>{let{customViews:r,defaultTemplates:i,defaultTemplate:a,allTemplates:l}=lm(t,e,o),p=(n?Oa([n],e,o).defaultTemplate:void 0)??a,d=p?.submenu?structuredClone(p.submenu):[],m=Sr(t);return {customViews:r,defaultTemplates:i,defaultTemplate:a,allTemplates:l,defaultColumns:d,customTemplateCount:m}},[t,e,o,n]);var Ga=({mode:e,onViewChange:t,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,defaultColumns:i,defaultTemplate:a,allTemplates:l,customTemplateCount:s})=>{let[p,d]=useState(null),[m,c]=useState(false),[u,f]=useState(null),[g,x]=useState(false),[y,C]=useState(null),[h,I]=useState(null),[S,b]=useState(),[T,v]=useState(l.find(F=>F.selected)?.id??a?.id),P=useRef(l.find(F=>F.selected)?.id??a?.id),A=useCallback(F=>{let O=F.submenu?.filter(ee=>ee.selected)||[];return {...F,submenu:O,columns:O.map(ee=>ee.name)}},[]),M=useCallback(F=>{P.current=F?.id,t?.(F?A(F):void 0);},[t,A]),k=useMemo(()=>T?l.find(F=>F.id===T):a,[l,T,a]),W=useMemo(()=>pe(k?.submenu||i),[k,i]),V=useMemo(()=>({id:T||a?.id||"default",label:k?.label||a?.label||"Default"}),[k,T,a?.id,a?.label]);useEffect(()=>{let F=l.find(Pe=>Pe.selected)?.id,O=a?.id,ee=T?l.some(Pe=>Pe.id===T):false;if(!(T&&!ee&&F!==T)){if(F&&F!==T){v(F);return}if(!T){v(F??O);return}ee||v(F??O);}},[l,a?.id,T]),useEffect(()=>{!T||!k||k.id===T&&P.current!==T&&(P.current=T,t?.(A(k)));},[T,k,t,A]);let $=useCallback(F=>{d(O=>O?null:F.currentTarget);},[]),be=useCallback(()=>{d(null);},[]),Ue=useCallback((F,O)=>{v(O?.id),M(O),be();},[be,M]),Ee=useCallback((F=false,O,ee,Pe)=>{s!=null&&s>=3||(f(null),x(F),C(O??null),I(ee?.length?ee:null),b(Pe),c(true),d(null));},[s]),U=useCallback(F=>{let O=l.find(ee=>ee.id===F.id)??F;f(O),x(true),C(null),I(O.submenu?.length?pe(O.submenu):null),c(true);},[l]),dt=useCallback(()=>{c(false),f(null),x(false),C(null),I(null),b(void 0);},[]);useEffect(()=>{if(!m||!u?.id)return;let F=l.find(O=>O.id===u.id);F&&(f(F),I(F.submenu?.length?pe(F.submenu):null));},[m,u?.id,l]);let ls=useCallback(async F=>{if(u){let O=u.id;await n?.(O,F),v(O);let ee=l.find(Pe=>Pe.id===O)??u;M(ee),be();}else {let O=await o?.({...F,sourceTemplateId:S});if(O?.id){v(O.id);let ee=l.find(Pe=>Pe.id===O.id);M(ee??{id:O.id,label:O.name,isCustom:true,columns:F.selectedColumns.map(Pe=>Pe.name),submenu:F.selectedColumns});}}},[u,n,o,be,l,M,S]),ss=useCallback(async F=>{let O=l.find(ee=>ee.id===F);await r?.(O?.id??F),T===(O?.id??F)&&v(a?.id);},[l,r,T,a]);return {anchorEl:p,isCreateDialogOpen:m,editingView:u,selectedViewInfo:V,shouldUseCurrentState:g,selectedView:k,currentViewColumns:W,initialColumnsForCreate:y,availableColumnsForCreate:h,handleViewButtonClick:$,handleCloseViewDropdown:be,handleSelectedViewInfo:Ue,handleOpenCreateDialog:Ee,handleOpenEditDialog:U,handleCloseCreateDialog:dt,handleSaveView:ls,handleDeleteView:ss}};var gn=()=>{let[e,t]=useState(null),[o,n]=useState(null),r=useRef(null),i=useCallback((p,d)=>{r.current&&(clearTimeout(r.current),r.current=null),t(p),n(d);},[]),a=useCallback(()=>{r.current=setTimeout(()=>{t(null),n(null);},0);},[]),l=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null);},[]),s=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),t(null),n(null);},[]);return {hoveredColumn:e,anchorEl:o,openSubmenu:i,closeSubmenu:a,cancelClose:l,forceClose:s}};var xb=()=>{let[e,t]=useState(null),[o,n]=useState(null),r=useRef(null),i=useCallback((s,p)=>{t(s),n(p);},[]),a=useCallback(()=>{t(null),n(null);},[]),l=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null);},[]);return {hoveredNestedColumn:e,nestedSubmenuAnchorEl:o,openNestedSubmenu:i,closeNestedSubmenu:a,cancelNestedClose:l}};var Dm=({open:e,availableColumns:t,defaultColumns:o,editingView:n,tableViews:r=[]})=>{let[i,a]=useState(()=>n?.label||""),[l,s]=useState([]),p=useRef(false),d=useRef([]),m=useRef(n?.label?.trim()||""),{hoveredColumn:c,anchorEl:u,openSubmenu:f,closeSubmenu:g,cancelClose:x}=gn(),y=Gb,C=Hb$1;useEffect(()=>{if(!e){p.current=false;return}if(!p.current&&e)if(n){let V=n.submenu&&n.submenu.length>0?n.submenu:o,$=t.length>0?t:V,Ue=ym(V,$).filter(dt=>!je(dt.name)&&!_(dt.name)),Ee=[y,C,...Ue];s(Ee),d.current=pe(Ee);let U=n.label?.trim()||"";m.current=U,a(U);}else {let V=t.length>0?t:r,be=(r&&r.length>0?Im(V,r):bm(V)).filter(Ee=>!je(Ee.name)&&!_(Ee.name)),Ue=[y,C,...be];s(Ue),d.current=pe(Ue),m.current="",a("");}else if(e&&n){let V=n.label?.trim()||"";a(V);}p.current=e;},[e,n?.id,n?.label,n?.submenu,t,o,r,y,C]);let h=useMemo(()=>l.map(W=>W.name),[l]),I=useMemo(()=>cm(l),[l]),S=useMemo(()=>um(l,I),[l,I]),b=useMemo(()=>fm(i,20),[i]),T=useMemo(()=>{let W=i.trim()!==m.current,V=d.current.length>0&&!Er(l,d.current);return W||V},[i,l]);return {templateName:i,setTemplateName:a,selectedColumns:l,columnNames:h,allSelected:I,someSelected:S,isNameValid:b,hasChanges:T,hoveredColumn:c,anchorEl:u,openSubmenu:f,closeSubmenu:g,cancelClose:x,handleReorder:W=>{let V=W.filter($=>!_($)).flatMap($=>l.find(be=>be.name===$)??[]);s([y,C,...V]);},handleColumnToggle:W=>{s(V=>mm(V,W));},handleSubItemToggle:(W,V)=>{s($=>vr($,W,V));},handleSelectAll:()=>{s(W=>dm(W,!I));},handleResetToDefault:()=>{d.current.length>0&&s(pe(d.current));}}};function Lm({templates:e,setTemplates:t,createTemplate:o,updateTemplate:n,deleteTemplate:r,tableMode:i,isTemplatesLoading:a,lang:l="en",mainDefaultTemplate:s}){let p=useMemo(()=>s??e.find(C=>C.default),[e,s]),d=e.find(C=>C.selected)?.id??p?.id,m=useCallback(C=>{t(h=>h.find(S=>S.selected)?.id===C?h:h.map(S=>({...S,selected:C?S.id===C:false})));},[t]),c=useCallback(async({name:C,layout:h,sourceTemplateId:I})=>{if(Sr(e)>=3)return;let S=e.find(P=>P.id===I)??e.find(P=>P.id===d)??p,b=vm(h,i,S),T=await o({name:C,layout:b}),v=Ua(T);return t(P=>[...P.filter(M=>M.id!==v.id).map(M=>({...M,selected:false})),{...v,selected:true}]),{id:T.id,name:T.name??""}},[o,t,i,p,e,d]),u=useCallback(async C=>{await r(C),t(h=>h.filter(I=>I.id!==C)),m(d===C?p?.id:d);},[r,t,p,m]),f=useCallback(async(C,h)=>{let I=e.find(P=>P.id===C),{name:S,layout:b}=Sm(I,h),T=await n(C,{name:S,layout:b}),v=Ua(T);t(P=>Tm(P,A=>A.id===C,v)),m(v.id);},[e,n,t,m]),g=useMemo(()=>({templates:e,onCreateCustomView:c,onEditCustomView:f,onDeleteCustomView:u,isLoading:a,mainDefaultTemplate:s}),[e,c,f,u,a,s]),x=useCallback(C=>{if(!p){m(void 0);return}if(!C?.id){m(p.id);return}if(go(C)){m(C.id);return}let h=e.find(I=>I.id===C.id);if(h){m(h.id);return}Xe(C)&&m(C.id);},[e,p,m]),y=useMemo(()=>{let C=e.find(I=>d?I.id===d:false)??p;if(!C)return [];let h=$a(C,i);return h.length>0?h:[]},[i,e,d,p]);return {customViews:g,onViewChange:x,columnsView:y,selectedViewId:d}}var bb=b$1(gb(),1);function v1({column:e,index:t,openSubMenuName:o,subMenuAnchorEl:n,toggleColumnSelection:r,toggleSubmenuItem:i,handleSubMenuOpen:a,handleSubMenuClose:l}){let{t:s}=useTranslation(),p=useTheme(),{isIndeterminate:d,hasSubmenuItems:m,isSubmenuOpen:c,isFirstItem:u,handleColumnClick:f,handleMouseEnter:g,handleMouseLeave:x}=rm({column:e,index:t,openSubMenuName:o,toggleColumnSelection:r,handleSubMenuOpen:a,handleSubMenuClose:l}),y=C=>C?s(C)??(0, bb.default)(C):"";return jsxs(En,{sx:{borderTop:`1px solid ${p.palette.divider}`,...u&&{borderTop:"none",height:33}},children:[jsxs(a$5,{isIndeterminate:d,isSelected:e.selected,onMouseEnter:g,onMouseLeave:x,onClick:f,children:[jsx(En,{sx:{flex:1},children:y(e.label)}),m&&jsx("img",{src:tb$1,className:"arrow-icon",alt:"arrow"})]}),m&&jsx(a$9,{open:c,anchorEl:n,placement:"right-start",onMouseEnter:()=>{},onMouseLeave:l,children:e.menuItems?.map(C=>jsx(a$5,{isSelected:e.selected&&C.selected,onClick:()=>i(e.name,C.name),children:y(C.label)},C.name))})]},e.name)}var Ib=v1;function A1({open:e,onSelect:t,setTableViews:o,tableViews:n,anchorEl:r,onClose:i}){let{t:a}=useTranslation(),l=useMemo(()=>n||[],[n]),s=useMemo(()=>l.map(y=>y.name),[l]),{reorderColumns:p,toggleColumnSelection:d,toggleSubmenuItem:m}=om({columns:l,setTableViews:o}),{subMenuAnchorEl:c,openSubMenuName:u,handleSubMenuClose:f,handleSubMenuOpen:g,handleMenuScroll:x}=Qp(e,i);return jsxs(mn,{"data-testid":"TableView_CustomViews",children:[jsxs(sn,{"data-testid":"TableView_CustomViews_Button",onClick:t,children:[jsx("div",{children:a("columns")}),jsx("img",{src:Ab,alt:"arrow",style:{...!!e&&{transform:"rotate(180deg)"}}})]}),jsxs(a$9,{open:e,anchorEl:r,"data-testid":"TableView_CustomViews_Popper",sx:{padding:0,marginTop:"8px",borderRadius:1},children:[e&&jsx(a$i,{onClick:i}),jsx(pn,{component:"article","data-testid":"TableView_CustomViews_List",children:jsx(Reorder.Group,{as:"div",axis:"y",onReorder:p,values:s,onScroll:x,children:l.map((y,C)=>jsx(Ib,{column:y,index:C,openSubMenuName:u,subMenuAnchorEl:c,toggleColumnSelection:d,toggleSubmenuItem:m,handleSubMenuOpen:g,handleSubMenuClose:f},y.name))})})]})]})}var Bm=memo(A1);function k1({open:e,selectedViewInfo:t,setSelectedViewInfo:o,onSelect:n,onTableViewOptionClick:r,anchorEl:i}){let{t:a}=useTranslation();return jsxs(mn,{"data-testid":"TableView_DefaultViews",children:[jsxs(sn,{onClick:l=>{n(l);},children:[jsx("div",{children:t.label}),jsx("img",{src:Ab,alt:"arrow",style:{...!!e&&{transform:"rotate(180deg)"}}})]}),jsx(R1,{open:e,anchorEl:i,placement:"bottom-start",children:jsxs(pn,{children:[Nb.map(l=>jsxs(dn,{onClick:()=>{o(l),r?.(l);},children:[l.id===t.id?jsx("img",{className:"check-icon",src:Bb$1,alt:"arrow"}):jsx(cn,{}),jsx("span",{children:l.label}),jsx(Ir,{})]},l.id)),jsxs(dn,{sx:{border:"none"},onClick:l=>{l.stopPropagation(),o(Mb),r?.(Mb);},children:[t.id===Mb.id?jsx("img",{className:"check-icon",src:Bb$1,alt:"arrow"}):jsx(cn,{}),jsx("span",{children:a("createCustomView")}),jsx(Ir,{})]})]})})]})}var Fm=Hm.memo(k1);function V1({onViewChange:e,setIsViewVisible:t,setTableViews:o,tableViews:n,resetTableViews:r,onTableViewOptionClick:i}){let[a,l]=useState(null),[s,p]=useState(null),[d,m]=useState(null),[c,u]=useState(Lb),{t:f}=useTranslation(),g=h=>{e?.(),l(h.currentTarget),t(true);},x=()=>{p(null),m(null);},y=()=>{l(null),t(false),u(Lb);},C$1=h=>{u(h),r?.(h),x();};return a?jsx(N1,{onClickAway:x,children:jsxs(Na,{"data-testid":"TableView",children:[c.id===Mb.id&&jsx(Bm,{tableViews:n,setTableViews:o,anchorEl:d,open:!!d,onSelect:h=>{m(d?null:h.currentTarget),p(null);},onClose:()=>{m(null);}}),jsx(Fm,{open:!!s,anchorEl:s,setSelectedViewInfo:h=>{C$1(h);},selectedViewInfo:c,onSelect:h=>{p(s?null:h.currentTarget),m(null);},onTableViewOptionClick:i}),jsx(sn,{sx:{width:30,justifyContent:"center"},onClick:y,children:jsx("img",{src:Cb,alt:"close"})})]})}):jsx(a$j,{title:f("tableView"),"data-testid":"TableView_no_anchorViewEl",onClick:g,children:jsx(a$g,{src:C,alt:"view",sx:{width:14,height:14}})})}var Nm=memo(V1);var Sb=({columns:e,allCurrentSelected:t,someCurrentSelected:o,onSelectAll:n,onReset:r,onColumnToggle:i,onNestedItemToggle:a,isModified:l=false})=>{let{hoveredNestedColumn:s,nestedSubmenuAnchorEl:p,openNestedSubmenu:d,closeNestedSubmenu:m,cancelNestedClose:c}=xb();return jsxs(Fragment,{children:[jsxs(tb,{children:[jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsx(a$b,{checked:t,indeterminate:o,onChange:u=>{u.stopPropagation(),n();},onClick:u=>{u.stopPropagation();},sx:ob})}),jsx(Typography,{component:"button",disabled:!l,onClick:u=>{u.stopPropagation(),l&&r();},sx:{fontSize:11,fontWeight:500,color:"#1F88D0",background:"none",border:"none",cursor:l?"pointer":"default",padding:0,opacity:l?1:.5,pointerEvents:l?"auto":"none","&:hover":l?{textDecoration:"underline"}:void 0},children:"Reset"})]}),jsx(Divider,{}),jsx(rb,{onScroll:m,children:jsx(Box,{component:"ul",sx:{listStyle:"none",padding:0,margin:0},children:e.map((u,f)=>{let g=u.menuItems&&u.menuItems.length>0,{checked:x,indeterminate:y}=wr(u),C=_(u.name);return jsxs(Box,{component:"li",sx:{listStyle:"none",margin:0,padding:0,position:"relative",zIndex:1,backgroundColor:"#fff",width:"100%"},children:[jsxs(Box,{sx:{position:"relative"},onMouseEnter:h=>g&&d(u.name,h.currentTarget),onMouseLeave:()=>g&&m(),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[jsx(a$5,{isSelected:g?x:u.selected,isIndeterminate:g?y:false,isDisabled:C,onClick:()=>{C||i(u.name);},sx:{flex:1,display:"flex",alignItems:"center"},children:jsx("span",{children:u.label||u.name})}),g&&jsx(Box,{sx:{display:"flex",alignItems:"center",pr:1,pointerEvents:"none"},children:jsx("img",{src:ub$1,alt:"arrow",style:{height:12}})})]}),g&&jsx(Popper,{open:s===u.name,anchorEl:p,placement:"right-start",sx:{zIndex:1e4},children:jsxs(Box,{onMouseEnter:c,onMouseLeave:m,sx:{display:"flex",pl:.5},children:[jsx(Box,{sx:{width:8,height:"100%",position:"absolute",left:-8,top:0,bottom:0}}),jsx(Va,{children:u.menuItems?.map((h,I)=>jsxs(Hm.Fragment,{children:[jsx(a$5,{isSelected:h.selected,isDisabled:C,onClick:()=>{C||a(u.name,h.name);},children:h.label||h.name}),I<(u.menuItems?.length??0)-1&&jsx(Divider,{})]},h.name))})]})})]}),f<e.length-1&&jsx(Divider,{})]},u.name)})})})]})};function q1({open:e,selectedViewInfo:t,setSelectedViewInfo:o,anchorEl:n,onClose:r,onCreateCustomView:i,customViews:a=[],onEditCustomView:l,defaultColumns:s=[],defaultTemplate:p,defaultTemplates:d=[],customTemplateCount:m,isLoading:c}){let{t:u}=useTranslation(),{hoveredColumn:f,anchorEl:g,openSubmenu:x,closeSubmenu:y,cancelClose:C,forceClose:h}=gn(),[I,S]=Hm.useState(null),[b,T]=Hm.useState(null),v=useMemo(()=>[...d.length?d:p?[p]:[],...a],[d,p,a]),P=useCallback(N=>N.submenu?.length?N.submenu:s,[s]),A=useCallback(N=>N?_a(N,P(N)):s,[s,P]),M=useCallback(N=>A(N).length>0,[A]),k=useMemo(()=>f?v.find(N=>N.id===f):void 0,[f,v]),W=useMemo(()=>A(k),[k,A]),V=useMemo(()=>f?b?.length?b:W:[],[f,W,b]),$=useMemo(()=>Cm(V),[V]),be=useMemo(()=>hm(V,$),[V,$]),Ue=b!=null&&!Er(b,W),Ee=(m??am(a))>=3,U=c||Ee,dt=U||!Ue;function ls(N){h(),T(null);let ne;if(go(N)){let Le=N.submenu?.length?N.submenu:s.length?s:p?.submenu??[];ne={...N,submenu:pe(Le),columns:Le.map(ot=>ot.name)};}else Xe(N)&&(ne=N);o(N,ne);}function ss(N,ne){let Le=v.find(ot=>ot.id===N);T(pe(A(Le))),x(N,ne);}function F(){T(null),y(),h();}function O(N){if(N.stopPropagation(),dt)return;let ne=pe(W),Le=b?.length?pe(b):ne;i?.(true,Le,ne,k?.id),T(null),h();}function ee(N){b&&T(gm(b,N));}function Pe(N,ne){b&&T(vr(b,N,ne));}function PE(){b&&T(xm(b,!$));}function ME(){T(pe(W));}return jsxs(mn,{"data-testid":"ViewsDropdown",children:[jsx(R1,{open:e,anchorEl:n,placement:"bottom-start",children:jsxs(pn,{onScroll:h,children:[jsx(sS,{sx:{paddingX:1.25,py:1.1,fontWeight:500,fontSize:11,color:"#8D8D94"},children:"View"}),jsx(iE,{}),v.map(N=>{let ne=Xe(N),Le=!ne&&M(N);return jsxs(dn,{onMouseEnter:ot=>{ne?S(N.id):Le&&ss(N.id,ot.currentTarget);},onMouseLeave:()=>{ne?S(null):Le&&y();},onClick:()=>ls(N),sx:{position:"relative",cursor:"pointer",pr:1.5},children:[N.id===t.id?jsx("img",{style:{width:15,height:15},src:Hj,alt:"check"}):jsx(cn,{}),jsx("span",{style:{flex:1,fontSize:11},children:N.label}),ne&&I===N.id&&jsx("img",{src:kh$1,alt:"edit",style:{width:12,height:12,cursor:"pointer"},onClick:ot=>{ot.stopPropagation(),r?.(),l?.(N);}}),Le&&jsx("img",{src:ub$1,alt:"arrow",style:{height:12}})]},N.id)}),jsx(a$2,{title:"Limit reached. Delete a view to create a new one.",placement:"left",disableHoverListener:!Ee,children:jsxs(dn,{sx:{border:"none",opacity:U?.5:1,cursor:U?"not-allowed":"pointer"},onClick:N=>{if(N.stopPropagation(),U)return;let ne=pe(A(p)),Le=ne.map(ot=>({...ot,selected:false,menuItems:ot.menuItems?.map(AE=>({...AE,selected:false}))}));i?.(true,Le,ne,p?.id),h();},children:[jsx(cn,{}),jsxs(En,{sx:{display:"flex",alignItems:"center",gap:.5},children:[jsx("img",{src:Ql,alt:"",style:{opacity:U?.5:1,width:10,height:10}}),jsx("span",{style:{color:U?"#999":"#1F88D0",fontSize:11,fontWeight:500},children:u("New Custom View")})]}),jsx(Ir,{})]})})]})}),f&&g&&V.length>0&&jsx(a$9,{open:!!g,anchorEl:g,placement:"auto-end",onMouseEnter:C,onMouseLeave:F,children:jsxs(nb,{children:[jsx(Sb,{columns:fn(V),allCurrentSelected:$,someCurrentSelected:be,onSelectAll:PE,onReset:ME,onColumnToggle:ee,onNestedItemToggle:Pe,anchorEl:g,isModified:Ue}),jsxs(ib,{children:[jsx(wb,{variant:"text",onClick:F,sx:ab,children:"Cancel"}),jsx(a$2,{title:"Limit reached. Delete a view to create a new one.",placement:"top",disableHoverListener:!Ee,children:jsx(wb,{variant:"contained",onClick:O,disabled:dt,sx:lb,children:"Create view"})})]})]})})]})}var Om=Hm.memo(q1);var Pb=({selectedColumns:e,columnNames:t,allSelected:o,someSelected:n,hoveredColumn:r,anchorEl:i,onReorder:a,onColumnToggle:l,onSubItemToggle:s,onSelectAll:p,onResetToDefault:d,onSubmenuEnter:m,onSubmenuLeave:c,onCancelClose:u})=>{let f=useRef(null),{onDragStart:g,onDragEnd:x}=em(f),y=useCallback(C=>{if(wm(C.target)){C.preventDefault();return}g();},[g]);return jsxs(Ky,{children:[jsxs(qy,{children:[jsx(jp,{children:jsx("img",{src:C,alt:"drag",style:{width:16,height:16,opacity:.5}})}),jsx(Xp,{onClick:C=>{C.stopPropagation(),p();},children:jsx(a$b,{checked:o,indeterminate:n,size:"small",sx:Zp,onChange:C=>{C.stopPropagation(),p();},onClick:C=>{C.stopPropagation();}})}),jsx(Typography,{onClick:C=>{C.stopPropagation(),p();},sx:{flex:1,fontSize:13,fontWeight:500,color:"text.primary",ml:.75,cursor:"pointer"},children:"Select All"}),jsx(Link,{component:"button",type:"button",onClick:C=>{C.stopPropagation(),d();},underline:"none",sx:{fontSize:13,fontWeight:500,cursor:"pointer",color:"common.blue"},children:"Reset to default"})]}),jsx(Box,{sx:{flex:1,minHeight:0,overflowX:"hidden",overflowY:"auto",position:"relative"},children:jsx(Reorder.Group,{ref:f,axis:"y",onReorder:a,values:t,style:{listStyle:"none",padding:0,margin:0},children:e.map(C=>{let h=_(C.name),I=C.menuItems&&C.menuItems.length>0,{checked:S,indeterminate:b}=wr(C);return jsxs(Reorder.Item,{value:C.name,drag:h?false:"y",dragListener:!h,dragConstraints:f,dragElastic:{top:0,bottom:0,left:0,right:0},transition:{duration:0},whileDrag:{zIndex:9999,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",scale:1},style:{listStyle:"none",margin:0,padding:0,position:"relative",zIndex:1,backgroundColor:"#fff",width:"100%",willChange:"transform"},onDragStart:y,onDragEnd:x,children:[jsxs(jy,{isHovered:r===C.name,isDate:h,onMouseEnter:T=>I&&m(C.name,T.currentTarget),onMouseLeave:()=>I&&c(),onClick:T=>{(T.target.closest('[role="checkbox"]')||T.target.closest('input[type="checkbox"]'))&&T.stopPropagation();},sx:{width:"100%",position:"relative"},children:[jsx(jp,{children:jsx("img",{src:Db,alt:"drag",draggable:false,style:{width:16,height:16,cursor:h?"default":"grab",pointerEvents:"none"}})}),jsx(Xp,{onMouseDown:T=>{T.stopPropagation();},onPointerDown:T=>{T.stopPropagation();},children:jsx(a$b,{checked:S,indeterminate:b,onChange:T=>{T.stopPropagation(),l(C.name);},onClick:T=>{T.stopPropagation();},disabled:h,size:"small",sx:Zp})}),jsx(Typography,{sx:{flex:1,fontSize:13,fontWeight:400,color:"text.primary",ml:1},children:C.label||C.name}),I&&jsx(Box,{sx:{display:"flex",alignItems:"center",ml:1,flexShrink:0},children:jsx("img",{src:tb$1,alt:"arrow",style:{width:12,height:12}})})]}),I&&jsx(Popper,{open:r===C.name,anchorEl:i,placement:"right-start",sx:{zIndex:1e4},modifiers:[{name:"offset",options:{offset:[0,0]}}],children:jsxs(Box,{onMouseEnter:u,onMouseLeave:c,sx:{display:"flex",pl:.5},children:[jsx(Box,{sx:{width:8,height:"100%",position:"absolute",left:-8,top:0,bottom:0}}),jsx(Va,{children:C.menuItems?.map((T,v)=>jsxs(Hm.Fragment,{children:[jsx(a$5,{isSelected:T.selected,isDisabled:h,onClick:()=>{h||s(C.name,T.name);},sx:{fontSize:13},children:T.label||T.name}),v<(C.menuItems?.length??0)-1&&jsx(Divider,{})]},T.name))})]})})]},C.name)})})})]})};function nR({open:e,onClose:t,onCreate:o,availableColumns:n=[],defaultColumns:r=[],editingView:i,onDelete:a,tableViews:l=[],mode:s="sheet",stackOrder:p=1}){let{t:d}=useTranslation(),m=useDragControls(),[c,u]=useState(false),[f,g]=useState(false);useEffect(()=>{e||(u(false),g(false));},[e]),useEffect(()=>{if(!e)return;let U=dt=>{dt.key==="Escape"&&t();};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[e,t]);let{templateName:x,setTemplateName:y,selectedColumns:C,allSelected:h,someSelected:I,isNameValid:S,hasChanges:b,hoveredColumn:T,anchorEl:v,openSubmenu:P,closeSubmenu:A,cancelClose:M,handleReorder:k,handleColumnToggle:W,handleSubItemToggle:V,handleSelectAll:$,handleResetToDefault:be}=Dm({open:e,availableColumns:n,defaultColumns:r,editingView:i,tableViews:l}),Ue=async()=>{if(!(!S||!b||f||c)){g(true);try{let U=im(C,s);await o?.({name:x,selectedColumns:C,layout:U}),t();}catch{console.warn("Failed to create view");}finally{g(false);}}},Ee=async()=>{if(!i||c||f)return;let U=i.id;u(true);try{await a?.(U),t();}catch{console.warn("Failed to delete view");}finally{u(false);}};return e?jsxs(eb,{role:"dialog","aria-modal":"true","data-testid":"CreateViewDialog",drag:true,dragListener:false,dragControls:m,dragMomentum:false,initial:false,style:{width:450,minWidth:0,maxWidth:"min(100vw - 16px, 450px)",height:600,left:`max(8px, calc(50% - ${450/2}px))`,top:`max(8px, calc(50% - ${600/2}px))`},animate:{zIndex:2+p},transition:{duration:.1},children:[jsx(c$4,{id:"draggable-dialog-title",onPointerDown:U=>m.start(U),style:{cursor:"move",flexShrink:0},children:jsx(d$4,{isHovered:true,title:i?"Edit Custom View":d("createCustomView")||"Create Custom View",leftActions:jsx(a$q,{onClick:t,onPointerDown:U=>U.stopPropagation()})})}),jsxs($y,{children:[jsxs(Yy,{onScroll:()=>{A();},children:[jsxs(Gy,{children:[jsxs(Box,{children:[jsx(Typography,{sx:{fontSize:24,fontWeight:700,color:"#9F9F9F",lineHeight:"0.7"},children:"Custom"}),jsx(Typography,{sx:{fontSize:24,fontWeight:700,color:"#20232B",lineHeight:1.2},children:"View"})]}),i&&jsx(Jy,{onClick:Ee,disabled:c||f,children:c?jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(CircularProgress,{size:14,color:"inherit"}),jsx("span",{children:"Deleting..."})]}):"Delete View"})]}),jsx(Box,{sx:{mb:3},children:jsx(a$r,{name:"custom-template-name",label:"Template Name",value:x,onChange:U=>y(U),inputProps:{maxLength:20,autoComplete:"off",readOnly:true,"data-form-type":"other",onFocus:U=>U.currentTarget.removeAttribute("readonly")},required:true})}),jsx(Pb,{selectedColumns:fn(C),columnNames:fn(C).map(U=>U.name),allSelected:h,someSelected:I,hoveredColumn:T,anchorEl:v,onReorder:k,onColumnToggle:W,onSubItemToggle:V,onSelectAll:$,onResetToDefault:be,onSubmenuEnter:P,onSubmenuLeave:A,onCancelClose:M})]}),jsx(Xy,{}),jsx(Zy,{children:jsx(Qy,{variant:"contained",onClick:Ue,disabled:!S||!b||f||c,title:S?void 0:`Name is required. Current: "${x}"`,children:f?jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(CircularProgress,{size:14,color:"inherit"}),jsx("span",{children:i?"Saving...":"Creating..."})]}):i?"Update View":"Create View"})})]})]}):null}var _m=nR;function lR({onViewChange:e,templates:t,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,tableMode:i="default",lang:a="en",isLoading:l,mainDefaultTemplate:s}){let{t:p}=useTranslation(),{defaultColumns:d,defaultTemplate:m,defaultTemplates:c,customViews:u,allTemplates:f,customTemplateCount:g}=Ya({tableMode:i,templates:t,lang:a,mainDefaultTemplate:s}),{anchorEl:x,isCreateDialogOpen:y,editingView:C$1,selectedViewInfo:h,shouldUseCurrentState:I,currentViewColumns:S,initialColumnsForCreate:b,availableColumnsForCreate:T,handleViewButtonClick:v,handleCloseViewDropdown:P,handleSelectedViewInfo:A,handleOpenCreateDialog:M,handleOpenEditDialog:k,handleCloseCreateDialog:W,handleSaveView:V,handleDeleteView:$}=Ga({mode:i,onViewChange:e,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,defaultColumns:d,defaultTemplate:m,allTemplates:f,customTemplateCount:g});return jsxs(Fragment,{children:[jsx(N1,{onClickAway:P,children:jsxs(Na,{sx:{width:"32px"},"data-testid":"ViewsMenu",children:[jsx(a$j,{title:p("tableView"),"data-testid":"ViewsMenu_button",onClick:v,children:jsx(a$g,{src:C,alt:"view",sx:{width:14,height:14}})}),jsx(Om,{open:!!x,anchorEl:x,onClose:P,setSelectedViewInfo:A,selectedViewInfo:h,onCreateCustomView:M,customViews:u,onEditCustomView:k,defaultColumns:d,defaultTemplate:m,defaultTemplates:c,customTemplateCount:g,isLoading:l})]})}),jsx(_m,{open:y,onClose:W,availableColumns:T?.length?T:d,defaultColumns:d,onCreate:V,editingView:C$1,onDelete:$,tableViews:I?b??S:void 0,mode:i})]})}var zm=memo(lR);function Um(e=[]){let[t,o]=useState(false),n=useMemo(()=>e.map(({code:r})=>r),[e]);return {isColumnPickerVisible:t,setIsColumnPickerVisible:o,timezoneCountryCodes:n}}function cR({tableMode:e,onToggle:t}){let o=bb$1(e),n=cb$1(e);return jsx(a$j,{hasImageFilter:false,onClick:t,isActive:!o,children:jsx(a$g,{src:n?uh:th$1,alt:`${e}-mode`,sx:{width:14,height:14}})})}var Bb=memo(cR);function Rr({children:e,component:t="aside",...o}){return jsx(Oy,{component:t,"data-testid":"ListHeaderToolbar",...o,children:e})}function Ja({display:e,timezone:t,calendar:o,views:n,search:r,slots:i,reportsVisible:a,lang:l}){let{isColumnPickerVisible:s,setIsColumnPickerVisible:p,timezoneCountryCodes:d}=Um(t?.segmentCountries),m=e?.variant==="acceptance",c=n?.tableMode??"default",u=useMemo(()=>n?.onSheetToggle?jsx(Bb,{tableMode:c,onToggle:n.onSheetToggle}):null,[c,n?.onSheetToggle]);return jsxs(Rr,{children:[i?.leading&&!s&&i.leading,!s&&jsxs(Fragment,{children:[r?.onChange&&jsx(a$s,{onSearchChange:r.onChange,placeholder:r.placeholder}),i?.filter,u&&!m&&u,o&&t&&jsx(a$t,{defaultDate:o.date,onDateChange:f=>{let[g,x]=f;g&&x&&o.onDateChange([g,x]);},mode:o.mode,onCalendarModeSwitch:o.onModeChange,maxDateRange:o.maxRange??31,groupBy:o.groupBy,onCalendarGroupChange:o.onGroupByChange,browserTimezone:t.browserTimezone,defaultCountryTimezone:t.defaultCountryTimezone,timezone:t.timezone,onChangeTimezone:t.onChangeTimezone,timezoneCountriesCodes:d}),a&&i?.reports,u&&m&&u]}),n?.onViewChange&&(n.templates?jsx(zm,{onViewChange:n.onViewChange,tableMode:c,lang:l,...n.templates}):jsx(Nm,{onViewChange:n.onViewChange,setIsViewVisible:p,tableViews:n.columns,setTableViews:n.setColumns,resetTableViews:n.onPresetReset,onTableViewOptionClick:n.onPresetOptionClick})),i?.trailing&&!s&&i.trailing]})}function yR({title:e,display:t,lang:o,reportsVisible:n,timezone:r,calendar:i,status:a,activeFilter:l,views:s,search:p,slots:d,children:m}){let c=Jc(useId(),"list-header"),u=useMemo(()=>jsx(Ja,{display:t,timezone:r,calendar:i,views:s,search:p,slots:d,reportsVisible:n,lang:o}),[t,r,i,s,p,d,n,o]);return jsxs(ka,{id:c,"data-testid":By,children:[t?.maximized&&jsx(Ba,{title:e,toolbar:u}),jsxs(Wy,{as:"section",children:[jsx(Fa,{status:a,activeFilter:l,beforeStatus:d?.beforeStatus}),!t?.maximized&&u]}),m]})}var Vb=memo(yR);var Hb=styled(En,{shouldForwardProp:e=>e!=="maximized"})(({theme:e,maximized:t})=>({display:"flex",alignItems:"center",gap:e.spacing(1),overflow:"hidden",height:t?"4.75rem":"4.1875rem",paddingBottom:t?"0rem":"1.2rem",paddingInline:e.spacing(4),paddingTop:t?"1.35rem":e.spacing(.5)})),IR=Fa$1(),Ob=styled(a$3,{shouldForwardProp:e=>e!=="title"&&e!=="isDropdown"})(({title:e,isDropdown:t,theme:o})=>({position:"relative",fontWeight:o.typography.fontWeightMedium,padding:o.spacing(1),color:o.palette.text.primary,fontSize:"11px",lineHeight:"15px",borderRadius:o.shape.borderRadius,transition:o.transitions.create(["backgroundColor","boxShadow"],{easing:o.transitions.easing.sharp,duration:o.transitions.duration.complex}),whiteSpace:"nowrap",textTransform:"capitalize","&:hover, &.active":{...!t&&{backgroundColor:o.palette.common.white,boxShadow:o.shadows[2]},cursor:"pointer",position:"relative",color:"transparent","&:after":{...e&&{content:`"${e}"`},color:o.palette.text.primary,fontWeight:o.typography.fontWeightBold,overflow:"hidden",position:"absolute",top:0,bottom:0,right:0,left:0,display:"flex",alignItems:"center",justifyContent:t?"flex-start":"center",letterSpacing:IR==="safari"?"-1px":"",padding:8,borderRadius:o.shape.borderRadius}}}));function vR({isDropdown:e=false,name:t,code:o,activeCode:n,navigateToMenuItem:r,onClickServiceItem:i}){let[a,l]=useState(null),{t:s}=useTranslation(),p=!!a,d=()=>{l(null);};return jsxs(Fragment,{children:[jsx(Ob,{isDropdown:e,className:n.toLowerCase()===o.toLowerCase()?"active":"",onClick:m=>{m.preventDefault(),m.stopPropagation(),r(o);},title:t,onContextMenu:m=>{m.preventDefault(),m.stopPropagation(),d(),l(m.currentTarget);},children:t}),jsx(f$1,{open:p,anchorEl:a,onClose:d,menuItems:[{label:s("openNewWindow"),name:"new",icon:jsx("img",{src:fb,alt:"new-window-icon"}),onClick:m=>{m.stopPropagation(),i?.(o),d();}}]})]})}var _b=memo(vR);var FR=e=>jsx(e$1,{src:e.className.includes("MuiSelect-iconOpen")?Uc:Tc$1,alt:"dropdown"});function NR({isMaximized:e,serviceCode:t,dimensions:o,services:n,onChangeServiceCode:r,onClickServiceItem:i}){let a=Jc(useId(),"app-services"),[l,s]=useState(0),[p,d]=useState(false),[m,c]=useState(""),u=useRef(null),[f,g]=Hm.useState(false),{i18n:x}=useTranslation(),y=b=>{c(b.target.value);},C=()=>{g(b=>!b);},h=useMemo(()=>lc$1(n.filter(b=>b.code.toLowerCase()===decodeURIComponent(t).toLowerCase())?.[0]?.name,x.language),[n,x.language,t]);useEffect(()=>{c(h);},[h]),useEffect(()=>{s(u.current?.offsetWidth+51+8+3);},[]),useEffect(()=>{d(Number(o?.width)<l+10);},[o?.width,l]);let I=b=>{r?.(b),g(false);},S=b=>jsx(c$5,{children:b});return jsxs(Hb,{id:a,"data-testid":"AppServices",maximized:e,children:[!!n?.length&&!p&&jsx(Box,{ref:u,display:"flex",gap:"8px",flexDirection:"row",sx:{userSelect:"none"},children:n.map((b,T)=>jsx(_b,{activeCode:t,onClickServiceItem:i,navigateToMenuItem:I,name:lc$1(b.name,x.language)||"",code:b.code},`service-item-${b.code}-${T}`))}),!!n?.length&&p&&jsx(a$k,{open:f,onClick:C,displayEmpty:true,inputProps:{"aria-label":"Without label"},MenuProps:{anchorOrigin:{vertical:40,horizontal:83},PaperProps:{style:{borderRadius:"0.25rem",width:"10.43rem",padding:0}},MenuListProps:{disablePadding:true}},value:m,IconComponent:FR,onChange:y,renderValue:S,sx:{"& .MuiOutlinedInput-root.MuiList-root-MuiMenu-list":{paddingTop:"0px !important",paddingBottom:"0px !important"}},children:n.map((b,T)=>lc$1(b.name,x.language)?.toLowerCase()===m?.toLowerCase()?null:jsx(b$5,{value:lc$1(b.name,x.language),onClick:v=>{v.preventDefault(),v.stopPropagation(),I(b.code);},children:jsx(d$2,{children:lc$1(b.name,x.language)})},`option-${b.code}-${T}`))})]})}var zb=memo(NR);var qm=zb;var Ub=styled(En,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:t})=>({backgroundColor:e.palette.common.white,border:`1px solid ${e.palette.divider}`,fontSize:"11px",color:e.palette.text.primary,padding:"8px",borderRadius:"4px",display:"flex",alignItems:"center",height:32,gap:"4px",cursor:"pointer",...t&&{borderColor:e.palette.info.dark}}));var zR=["EN","AR"];function jm({defaultLanguage:e="EN",onChange:t}){let o=Jc(useId(),"language-dropdown"),[n,r]=useState(e),[i,a]=useState(null),l=!!i,s=m=>{a(m.currentTarget);},p=()=>{a(null);},d=m=>{r(m),t?.(m),p();};return jsx(N1,{onClickAway:p,children:jsxs(En,{id:o,"data-testid":"LanguageDropdown",children:[jsx(Ub,{onClick:s,open:l,children:jsx(En,{component:"span",children:n})}),jsx(a$9,{open:l,anchorEl:i,sx:{marginTop:"8px",marginBottom:"8px",width:31.8},children:zR.map(m=>m!==n&&jsx(a$5,{onClick:()=>d(m),hideCheckbox:true,children:m},m))})]})})}var $R=jm;var Kb=styled(En)(({theme:e})=>({color:e.palette.text.primary,border:`1px solid ${e.palette.divider}`,padding:e.spacing(1),borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"flex-end",width:93,height:32,textAlign:"right",input:{fontSize:"11px",border:"none",color:e.palette.text.primary,height:30,padding:0,textAlign:"right"},img:{cursor:"pointer"}})),qb=styled(a$4)(()=>({padding:0,border:"none",height:24,input:{textAlign:"right",width:"100%"}}));var jR=Ga$1();function XR({amount:e,setAmount:t,maxAmount:o,isError:n,selectedCurrency:r,...i}){let a=Jc(useId(),"amount-input"),[l,s]=useState(false),[p,d]=useState(e||""),m=useMemo(()=>v(r?.decimals),[r]),c=g=>{let x=Number(g.target.value)||0;if(o&&x>o)return false;d(x),t(x);},u=()=>{s(false),t(Number(p));},f=g=>{jR&&isNaN(Number(g.key))&&g.key!=="Backspace"&&g.key!=="."&&g.preventDefault();};return jsx(Kb,{id:a,"data-testid":"AmountInput",sx:i.sx,children:l?jsx(qb,{placeholder:m,value:p,onChange:c,onBlur:u,onKeyDown:f,isError:n,inputProps:{step:"0.01"},hideArrows:true,autoFocus:true}):jsx(a$l,{currencyCode:r?.code?.english,amount:e,onClick:()=>{s(true);}})})}var Xb=memo(XR);var Zm=Xb;function tL({appCode:e,services:t,isMaximized:o,dimensions:n,serviceCode:r,ui:{onStartDrag:i},onChangeServiceCode:a,onClickServiceItem:l,sx:s}){let p=Jc(useId(),"app-services-bar"),[d,m]=useState(false),c=useCallback(f=>{i?.(f),m(true);},[i,m]),u=()=>{m(false);};return !e||!t?.length?null:jsx(b$6,{id:p,"data-testid":"AppServicesBar",onPointerDown:c,onPointerUp:u,isDragging:d,sx:s,children:jsx(qm,{onClickServiceItem:l,dimensions:{width:n.width},serviceCode:r,services:t,isMaximized:o,onChangeServiceCode:a})})}var Jb=memo(tL);var oL=Jb;var Qb=({width:e,height:t})=>jsx(a$w,{variant:"circular",width:e,height:t});function lL({data:e,isError:t,isLoading:o,width:n=24,height:r=24,fallbackIconUrl:i=Pd$1,...a}){let l=Jc(useId(),"brand-logo"),s=useTheme(),p=useMemo(()=>e?.type?.includes("application/pdf"),[e]),d=useMemo(()=>e?(window.URL?URL:webkitURL).createObjectURL(e):"",[e]),m=useMemo(()=>t||!e?i:p?Te:d,[e,t,p,d,i]);return o?jsx(Qb,{width:n,height:r}):jsx(a$g,{id:l,"data-testid":"BrandLogo",alt:"brand",src:m,sx:{borderRadius:"50%",backgroundColor:s.palette.common.white,width:n,height:r,objectFit:p?"none":"contain",...a.sx}})}var Qm=memo(lL);var oI=styled(a$4)(()=>({fontSize:"36px !important",textAlign:"center",border:"none",height:49.5,input:{textAlign:"center"}})),nI=styled(En)(()=>({display:"flex",gap:"5px",alignItems:"center",height:49.5,maxWidth:"-webkit-fill-available",paddingInline:"24px"})),rI=styled(En)(({theme:e})=>({fontSize:"10px",color:e.palette.error.dark,display:"flex",gap:"4px"}));var iI=()=>jsx(sL,{sx:{height:32,width:80,borderRadius:"4px"},variant:"rectangular"});var gL=Ga$1();function xL({totalGrossAmount:e,items:t,selectedCurrency:o,isAmountIsMissing:n,isDisabled:r,isLoading:i,onResetAllItems:a,onAddFirstItem:l}){let s=Jc(useId(),"total-amount"),[p,d]=useState(false),[m,c]=useState(),{isConfirmed:u}=c$2(),{t:f}=useTranslation(),g=useMemo(()=>v(o?.decimals),[o?.decimals]);useEffect(()=>{e||c(void 0);},[e]);let x=()=>{u({message:f("removeTotalAmount"),confirmText:jsx(En,{sx:S=>({color:S.palette.error.light}),children:f("remove")}),cancelText:f("cancel")||"Cancel"}).then(S=>{S&&(a(),c(void 0));});},y=S=>{if(!S.target.value)return c(void 0),false;c(Number(t$1(Number(S.target.value),o?.decimals)));},C=S=>{d(false),l(Number(t$1(Number(S.target.value),o?.decimals)));},h=e===0||t.length===1&&e===t[0].total,I=o?.code?.english||"";return i?jsx(iI,{}):jsxs(En,{id:s,"data-testid":"TotalAmount",sx:{...r&&{pointerEvents:"none",opacity:.7}},children:[p?jsx(Fragment,{children:h?jsx(oI,{value:m,placeholder:g,hideArrows:true,inputProps:{step:"0.01"},onChange:y,onBlur:C,onKeyDown:S=>{gL&&isNaN(Number(S.key))&&S.key!=="Backspace"&&S.key!=="."&&S.preventDefault();},autoFocus:true}):jsx(a$l,{sx:{fontSize:"36px",textAlign:"center"},amount:e||0,currencyCode:I,onClick:()=>{d(true);}})}):jsxs(nI,{children:[jsx(a$l,{sx:{fontSize:"36px",textAlign:"center"},currencyCode:I,amount:e||0,onClick:()=>{h&&d(true);}}),e>0&&jsx(En,{component:"img",src:Ui,alt:"r",onClick:x})]}),n&&jsxs(rI,{children:[jsx(En,{component:"img",src:hk}),jsx(En,{children:f("enterAmount")})]})]})}var lI=memo(xL);var od=(e,t)=>{let o=0;return t.percentage>0&&(o=e*(t.percentage/100)),o},Cte=(e,t,o)=>({...e,value:od(Number(t),e)*o});var mI=styled$1(Box,{shouldForwardProp:e=>e!=="isDisabled"&&e!=="isOpen"})(({theme:e,isOpen:t,isDisabled:o})=>({display:"flex",gap:e.spacing(1),alignItems:"center",justifyContent:"space-between",fontSize:"11px",border:`1px solid ${e.palette.divider}`,height:32,padding:e.spacing(1),borderRadius:"4px",...t&&{borderColor:e.palette.info.dark,position:"relative"},...o?{color:e.palette.grey[700],cursor:"not-allowed"}:{cursor:"pointer"}})),dI=styled$1(Box,{shouldForwardProp:e=>e!=="isDisabled"})(({theme:e,isDisabled:t})=>({fontSize:"11px",fontWeight:600,color:e.palette.text.primary,...t&&{color:e.palette.grey[700]}}));var fI=styled$1(Box)(({theme:e})=>({width:112,boxShadow:e.shadows[16],borderRadius:4,backgroundColor:e.palette.common.white,".option + .option":{borderTop:`1px solid ${e.palette.divider}`},zIndex:3})),gI=styled$1(Box)(({theme:e})=>({fontSize:"11px",paddingInlineStart:e.spacing(2),paddingInlineEnd:e.spacing(1),paddingTop:e.spacing(1.5),paddingBottom:e.spacing(1.5),display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(1),cursor:"pointer",height:40,input:{height:24,width:47,textAlign:"right"},"&:hover":{boxShadow:e.shadows[3]}}));var hI=styled(En)(({theme:e})=>({width:112,".option + .option":{borderTop:`1px solid ${e.palette.divider}`},zIndex:3})),nd=styled(En)(({theme:e})=>({fontSize:"11px",paddingInlineStart:e.spacing(2),paddingInlineEnd:e.spacing(1),paddingTop:e.spacing(1.5),paddingBottom:e.spacing(1.5),display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(1),cursor:"pointer",height:40,input:{height:24,width:47,textAlign:"right"},"&:hover":{boxShadow:e.shadows[3]}}));function bL({vat:e,onChange:t,setIsDropdownOpen:o}){let{t:n}=useTranslation(),{percentage:r,isInclusive:i,value:a}=e,l=r===no.ZERO,s=r===no.FIVE,p=r===no.TEN,d=r===no.FIFTEEN,m=r!==no.FIVE&&r!==no.TEN&&r!==no.FIFTEEN&&r!==no.ZERO,c=[{label:n("noVat"),value:no.ZERO,selected:l},{label:"5%",value:no.FIVE,selected:s},{label:"10%",value:no.TEN,selected:p},{label:"15%",value:no.FIFTEEN,selected:d}],u=x=>{t({value:a,percentage:x,isInclusive:i});},f=x=>{Number(x.target.value)>100||u(Number(zb$1(x.target.value)));},g=x=>x?jsx("img",{src:Bb$1,alt:"check"}):jsx("span",{});return jsxs(hI,{children:[c.map((x,y)=>jsxs(nd,{className:"option",onClick:()=>{u(x.value),o(false);},children:[g(x.selected),jsx("span",{children:x.label})]},`${x.value}-${y}`)),jsxs(nd,{className:"option",children:[g(m),jsx(a$7,{placeholder:"%",value:m?String(r):"",onChange:f,sx:{justifyContent:"flex-end"}})]})]})}var el=memo(bL);function wL({setVat:e,vat:t,setIsOpen:o,...n}){let[r,i]=useState(null),a=!!r,{t:l}=useTranslation(),s=p=>{if(p.stopPropagation(),a){i(null);return}i(p.currentTarget);};return jsx(fI,{sx:n.sx,children:jsxs(gI,{sx:p=>({...a&&{boxShadow:p.shadows[3]}}),className:"option",onClick:s,children:[jsx("span",{children:l("rate")}),jsx("img",{src:tb$1,alt:"a"}),jsx(a$9,{anchorEl:r,open:a,placement:"right-start",children:jsx(el,{onChange:e,vat:t,setIsDropdownOpen:o})})]})})}var tl=memo(wL);function RL({totalGrossAmount:e,totalVat:t,selectedCurrency:o,onChangeTotalVat:n,isDisabled:r}){let[i,a]=useState(false),l=useRef(),{t:s}=useTranslation(),p=()=>{r||a(!i);},d=u=>{n({...u,value:od(e,u)});},m=o?.code?.english||"",c=()=>t.percentage===0?s("noVat"):t.isInclusive?jsxs(En,{sx:{display:"flex",gap:"4px"},children:[jsxs("span",{children:[s("inclusive")," "]}),jsx(a$l,{amount:t.value,currencyCode:m})]}):jsx(a$l,{currencyCode:m,amount:t.value});return jsxs(mI,{isDisabled:r,isOpen:i,onClick:p,ref:l,sx:{...r&&{pointerEvents:"none",opacity:.7}},children:[jsx("img",{src:Xi,alt:"p"}),jsx(dI,{isDisabled:r,children:c()}),jsx(En,{component:"img",src:i?bj:Ei,alt:"a"}),i&&jsx(a$i,{onClick:p}),jsx(R1,{open:!!i,anchorEl:l.current,placement:"bottom-start",children:jsx(tl,{setIsOpen:a,vat:t,setVat:d,sx:{position:"absolute",top:8,left:0,display:i?"block":"none"}})})]})}var bI=memo(RL);var ad=(e,t)=>{let o=0;return t.type==="flat"&&t.flat&&t.flat>0&&(o=t.flat),t.type==="percent"&&t.percentage&&t.percentage>0&&(o=e*(t.percentage/100)),o},coe=(e,t,o)=>({...e,value:ad(t,e)*o});var II=styled(En)(({theme:e})=>({width:106,boxShadow:e.shadows[16],borderRadius:4,backgroundColor:e.palette.common.white,".option + .option":{borderTop:`1px solid ${e.palette.divider}`},zIndex:3})),ol=styled(En)(({theme:e})=>({fontSize:"11px",padding:e.spacing(1),display:"flex",justifyContent:"flex-end",alignItems:"center",gap:e.spacing(1),cursor:"pointer",height:40,input:{height:24,width:47,textAlign:"right"}})),TI=styled(En,{shouldForwardProp:e=>e!=="isOpen"})(({isOpen:e,theme:t})=>({display:e?"block":"none",position:"absolute",left:"100%",top:0,background:t.palette.common.white,padding:"8px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px",overflow:"hidden",minWidth:112,height:39}));var vI=styled(En)(({theme:e})=>({width:112,boxShadow:e.shadows[16],borderRadius:4,backgroundColor:e.palette.common.white,".option + .option":{borderTop:`1px solid ${e.palette.divider}`},zIndex:3})),pd=styled(En)(({theme:e})=>({fontSize:"11px",paddingInlineStart:e.spacing(2),paddingInlineEnd:e.spacing(1),paddingTop:e.spacing(1.5),paddingBottom:e.spacing(1.5),display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(1),cursor:"pointer",height:40,input:{height:24,width:47,textAlign:"right"},"&:hover":{boxShadow:e.shadows[3]}}));function BL({discount:e,setDiscount:t,setIsDropdownOpen:o,setIsOpen:n,...r}){let i=Jc(useId(),"discount-rate-dropdown"),{percentage:a,value:l}=e,s=a===no.FIVE,p=a===no.TEN,d=a===no.FIFTEEN,m=a!==no.FIVE&&a!==no.TEN&&a!==no.FIFTEEN&&a!==no.ZERO&&l!==no.ZERO,c=[{label:"5%",value:no.FIVE,selected:s},{label:"10%",value:no.TEN,selected:p},{label:"15%",value:no.FIFTEEN,selected:d}],u=x=>{t({value:l,percentage:x,type:"percent"}),n(false);},f=x=>{if(Number(x.target.value||!Number(x.target.value))>100)return false;t({value:Number(x.target.value),percentage:Number(zb$1(x.target.value)),type:"percent"});},g=x=>x?jsx("img",{src:Bb$1,alt:"c"}):jsx("span",{});return jsxs(vI,{id:i,"data-testid":"DiscountRateDropdown",sx:r.sx,children:[c.map(x=>jsxs(pd,{className:"option",onClick:()=>{u(x.value),o&&o(false);},children:[g(x.selected),jsx("span",{children:x.label})]},x.value)),jsxs(pd,{className:"option",children:[g(m),jsx(a$7,{placeholder:"%",sx:{input:{width:"100% !important"}},value:m?a:"",onChange:f})]})]})}var rl=memo(BL);function WL({discount:e,maxDiscount:t,setDiscount:o,setIsOpen:n,selectedCurrency:r,...i}){let a=Jc(useId(),"discount-dropdown"),[l,s]=useState(false),[p,d]=useState(false),{t:m}=useTranslation(),c=e.type==="noDiscount",u=e.type==="percent",f=C=>{o(C);},g=C=>{C.stopPropagation(),n(false),f({type:"noDiscount",value:0,percentage:0,flat:0}),l&&s(false),p&&d(false);},x=C=>{C.stopPropagation(),s(true),p&&d(false);},y=C=>{C.stopPropagation(),d(true),l&&s(false);};return jsxs(II,{id:a,"data-testid":"DiscountDropdown",sx:{...i.sx,...p&&{borderBottomRightRadius:0}},children:[jsxs(ol,{className:"option",onClick:g,sx:{justifyContent:"flex-start"},children:[c?jsx("img",{src:Bb$1,alt:"c"}):jsx(En,{width:"12px"}),jsx("span",{children:m("none")})]}),jsxs(ol,{className:"option",onClick:x,sx:C=>({justifyContent:"space-between",position:"relative",...l&&{boxShadow:C.shadows[3]}}),children:[jsxs(En,{sx:{display:"flex",alignItems:"center",gap:"6px"},children:[u?jsx("img",{src:Bb$1,alt:"check"}):jsx(En,{width:"12px"}),jsx("span",{children:"%"})]}),jsx("img",{src:tb$1,alt:"r"}),jsx(rl,{sx:{position:"absolute",left:"100%",top:0,display:l?"block":"none",borderTopLeftRadius:0},setIsOpen:n,discount:e,setDiscount:o})]}),jsxs(ol,{className:"option",onClick:y,sx:C=>({justifyContent:"space-between",position:"relative",...p&&{boxShadow:C.shadows[3]}}),children:[jsxs(En,{sx:{display:"flex",alignItems:"center",gap:"6px"},children:[e.type==="flat"?jsx("img",{src:Bb$1,alt:"c"}):jsx(En,{width:"12px"}),jsx("span",{children:m("flat")})]}),jsx("img",{src:tb$1,alt:"r"}),jsx(TI,{isOpen:p,children:jsx(Zm,{selectedCurrency:r,sx:{height:24,width:"100%",input:{height:20,width:"100%",textAlign:"right",flexGrow:1}},amount:e.type==="flat"?Number(e.flat):"",setAmount:C=>{f({...e,type:"flat",flat:Number(C)});},maxAmount:t})})]})]})}var il=memo(WL);var AI=styled$1(Box,{shouldForwardProp:e=>e!=="isDisabled"&&e!=="isOpen"})(({theme:e,isOpen:t,isDisabled:o})=>({display:"flex",gap:e.spacing(1),alignItems:"center",justifyContent:"space-between",fontSize:"11px",border:`1px solid ${e.palette.divider}`,height:32,padding:e.spacing(1),borderRadius:"4px",...t&&{borderColor:e.palette.info.dark,position:"relative"},...o?{color:e.palette.grey[700],cursor:"not-allowed"}:{cursor:"pointer"}})),DI=styled$1(Box,{shouldForwardProp:e=>e!=="isDisabled"})(({theme:e,isDisabled:t})=>({fontSize:"11px",fontWeight:600,color:e.palette.text.primary,...t&&{color:e.palette.grey[700]}}));function YL({selectedCurrency:e,totalGrossAmount:t,totalDiscount:o,onChangeTotalDiscount:n,isDisabled:r}){let i=Jc(useId(),"total-discount"),[a,l]=useState(false),s=useRef(),{t:p}=useTranslation(),d=()=>{r||l(!a);},m=u=>{n({...u,value:ad(t,u)});},c=()=>o.value===0?p("noDiscount"):jsxs(En,{sx:{display:"flex",gap:"2px"},children:[jsx("span",{children:"-"}),jsx(a$l,{amount:o.value,currencyCode:e?.code?.english})]});return jsxs(AI,{id:i,"data-testid":"TotalDiscount",isOpen:a,isDisabled:r,onClick:d,ref:s,sx:{...r&&{pointerEvents:"none",opacity:.7}},children:[jsx("img",{src:Ji$1,alt:"p"}),jsx(DI,{isDisabled:r,children:c()}),jsx(En,{component:"img",src:a?bj:Ei,alt:"a"}),a&&jsx(a$i,{onClick:d}),jsx(R1,{open:!!a,anchorEl:s.current,placement:"bottom-start",children:jsx(il,{sx:{position:"absolute",top:8,left:0,display:a?"block":"none"},selectedCurrency:e,discount:o,setDiscount:m,setIsOpen:l,maxDiscount:Number(t)})})]})}var kI=memo(YL);var FI=styled(Qm)(({theme:e})=>({filter:"drop-shadow(0px 0px 28px rgba(0, 0, 0, 0.09))",borderRadius:"50%",backgroundColor:e.palette.common.white})),NI=styled(En)(()=>({display:"flex",alignItems:"center",justifyContent:"center"}));function WI({data:e,width:t=51,height:o=51,...n}){let r=Jc(useId(),"merchant-logo");return jsx(NI,{id:r,"data-testid":"MerchantLogo",width:t,height:o,children:jsx(FI,{data:e,width:t,height:o,...n})})}var OI=styled(En,{shouldForwardProp:e=>e!=="isActive"})(({theme:e,isActive:t})=>({borderRadius:"4px",border:`1px solid ${e.palette.divider}`,minHeight:32,minWidth:30,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:e.palette.common.white,":hover":{opacity:.7},...t&&{boxShadow:`0px 0px 4px 0px ${e.palette.info.dark}80`,border:`1px solid ${e.palette.info.dark}`,backgroundColor:`${e.palette.info.dark}0D`,gap:"6px",padding:"0 8px"}})),_I=styled(En)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",minWidth:14,height:14,borderRadius:"50%",background:e.palette.background.gradient.shadedBlue,color:e.palette.common.white,fontSize:"8px",fontWeight:700,lineHeight:"14px",flexShrink:0})),zI=styled(En)(()=>({display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:"2px","& img":{width:14,height:14}})),UI=styled(qL)(({theme:e})=>({marginTop:e.spacing(1),marginBottom:e.spacing(1),minWidth:193,"& .MuiPaper-root":{borderRadius:e.spacing(.5),"&>.MuiList-root":{padding:0}}})),$I=styled(a$3)(({theme:e})=>({fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.subtitle1.fontSize,color:e.palette.grey[700],paddingInlineStart:e.spacing(2),paddingTop:e.spacing(1),paddingBottom:e.spacing(1),paddingInlineEnd:e.spacing(1),borderBottom:`1px solid ${e.palette.divider}`,display:"block"})),dd=styled(En)(({theme:e})=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"flex-end",backgroundColor:e.palette.common.white,borderTop:`1px solid ${e.palette.divider}`})),cd=styled(wb)(({theme:e})=>({textTransform:"capitalize",minWidth:"auto",width:70,borderRadius:"4px",border:`1px solid ${e.palette.info.dark}`,backgroundColor:e.palette.info.dark,fontWeight:700,fontSize:"11px",color:e.palette.common.white,"&:hover":{backgroundColor:e.palette.info.dark},"&.Mui-disabled":{color:"#fff !important",opacity:.5}})),ud=styled(wb)(({theme:e})=>({textTransform:"capitalize",minWidth:"auto",width:70,borderRadius:"4px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.common.white,fontWeight:500,fontSize:"11px",color:e.palette.text.primary,"&:hover":{background:"transparent"}}));var fd=createContext(null);function ZL(){let e=useContext(fd);if(!e)throw new Error("useFilterDropdown must be used inside a FilterDropdown");return e}function GI({onConfirm:e,onCancel:t,isOkayButDisabled:o,children:n,isDisabled:r,icon:i,title:a,menuStyle:l,hideTitle:s=false,hideFooter:p=false,activeFiltersCount:d,onClearFilters:m,renderButton:c,onOpenChange:u,menuProps:f,...g}){let x=Jc(useId(),"filter-dropdown"),[y,C]=useState(null),h=!!y,{t:I}=useTranslation(),S=()=>{C(null),u?.(false);},b=M=>{if(!r){if(!h){C(M.currentTarget),u?.(true);return}S();}},T=()=>{h&&(t?.(),S());},v=()=>{e?.(),S();},P=typeof d=="number"&&d>0,A=M=>{M.stopPropagation(),m?.();};return jsx(fd.Provider,{value:{onConfirm:v,onCancel:T,onClose:S},children:jsx(N1,{onClickAway:T,children:jsxs(En,{id:x,"data-testid":"FilterDropdown",...g,children:[jsx(OI,{className:"filter-button",isActive:h||P,onClick:b,sx:{...r&&{pointerEvents:"none",opacity:.5,...g.sx}},children:c??jsxs(Fragment,{children:[jsx(En,{component:"img",src:i??Lj,alt:"filter"}),P&&jsxs(Fragment,{children:[jsx(_I,{children:d}),jsx(zI,{onClick:A,"aria-label":"clear filters",children:jsx(En,{component:"img",src:Cb,alt:"clear"})})]})]})}),jsxs(UI,{anchorEl:y,open:h,onClose:T,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{marginTop:"8px",marginBottom:"8px",width:193,...l},...f,children:[!s&&jsx($I,{component:"span",children:a??I("filterBy")}),n,!p&&jsxs(dd,{children:[jsx(ud,{onClick:T,children:I("cancel")}),jsx(cd,{disabled:o,onClick:v,children:I("okay")})]})]}),h&&jsx(a$i,{onClick:S})]})})})}var KI=styled(a$5)(()=>({padding:"12px 16px",border:"none !important","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"}})),qI=styled(En)(()=>({display:"flex",flexDirection:"column",gap:"2px"})),jI=styled(En)(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:"9px"})),XI=styled(En)(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"178px"}));function hd({brand:e,merchantsIds:t,onChangeMerchant:o,atLeastOneMerchantSelected:n=false,showSearchInput:r=false,anchorEl:i}){let[a,l]=useState(""),s=!!i,p=useCallback(y=>t.includes(y),[t]),d=(y,C)=>{if(y.stopPropagation(),p(C)){o?.(t.filter(I=>I!==C));return}let h=[...new Set([...t,C])];o?.(h);},m=y=>t.length===1&&t[0]===y&&n,c=y=>{l(y);},u=()=>{l("");},f=useMemo(()=>e.merchants??[],[e.merchants]),g=useMemo(()=>{if(!a?.trim())return f;let y=a.trim().toLowerCase();return f?.filter(C=>(C?.display_name??"").toLowerCase().includes(y)||(C?.legacy_id??"").toLowerCase().includes(y))},[a,f]),x=useMemo(()=>r?g:f,[g,f,r]);return jsxs(a$9,{open:s,anchorEl:i,placement:"right-start",children:[r&&f.length>1&&jsx(a$m,{placeholder:"Merchants",name:"merchants",value:a,onSearchChange:c,onSearchReset:u,sx:{px:"8px"}}),x?.map(y=>jsx(KI,{isDisabled:m(y.legacy_id),isSelected:p(y.legacy_id),onClick:C=>{m(y.legacy_id)||d(C,y.legacy_id);},sx:{maxHeight:36,minHeight:36},children:jsxs(qI,{children:[jsx(XI,{component:"span",children:y.display_name}),jsx(jI,{component:"span",children:y.legacy_id})]})},y?.legacy_id))]})}var pl=hd;var JI=styled(En)(()=>({display:"flex",gap:"4px",alignItems:"center",flex:1,marginInlineEnd:"8px"}));function Id({brand:e,merchantsIds:t,isDisabled:o,atLeastOneMerchantSelected:n=false,showSearchInput:r=false,renderBrandLogo:i,onChangeMerchant:a}){let[l,s]=useState(null),p=!!l,d=x=>{s(x.currentTarget);},m=()=>{s(null);},c=useMemo(()=>e.merchants?.filter(x=>t.includes(x.legacy_id)),[t,e.merchants]),u=useMemo(()=>c?.length===e.merchants?.length,[c?.length,e.merchants?.length]),f=useMemo(()=>!u&&c.length>0,[u,c]),g=x=>{if(x.stopPropagation(),u){a?.(t.filter(y=>!e.merchants.some(({legacy_id:C})=>y===C)));return}if(f){let y=[...new Set([...t,...c.map(({legacy_id:C})=>C)])];a?.(y);return}a?.([...t,...e.merchants.map(({legacy_id:y})=>y)]);};return jsxs(a$5,{isSelected:u,isIndeterminate:f,onMouseEnter:d,onMouseLeave:m,onClick:x=>{o||g(x);},isDisabled:o,sx:{maxHeight:35,minHeight:35,...p&&{boxShadow:"0px 0px 16px 0px #00000021"}},children:[jsxs(JI,{children:[i?.(e.logo),jsx(a$3,{sx:{fontSize:"11px"},children:lc$1(e.name)})]}),e.merchants?.length>0&&jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),jsx(pl,{anchorEl:l,brand:e,merchantsIds:t,onChangeMerchant:a,atLeastOneMerchantSelected:n,showSearchInput:r})]})}var eT=Id;function Td({brands:e,isLoading:t,onFilterChange:o,merchantsIds:n=[],atLeastOneMerchantSelected:r=false,showSearchInput:i=false,hideCheckbox:a=false,renderBrandLogo:l}){let[s,p]=useState(null),[d,m]=useState(""),c=!!s,{t:u}=useTranslation(),f=P=>{p(P.currentTarget);},g=()=>{p(null);},x=useMemo(()=>e.length?e.every(P=>P.merchants?.every(({legacy_id:A})=>n.includes(A))):false,[n,e,a]),y=useMemo(()=>!x&&n.length>0,[n,x]),C=useMemo(()=>e.filter(P=>P.merchants?.some(A=>n?.includes(A.legacy_id))).length,[e,n]),h=()=>{if(x&&!r){o?.([]);return}let P=e.flatMap(A=>A.merchants?.map(({legacy_id:M})=>M));o?.(P);},I=t||!e?.length,S=P=>{m(P);},b=()=>{m("");},T=useMemo(()=>{if(!d.trim())return e;let P=d.trim().toLowerCase();return e.filter(A=>lc$1(A.name)?.toLowerCase()?.includes(P)||A.merchants?.some(M=>M.legacy_id?.toLowerCase().includes(P)))},[d,e]),v=useMemo(()=>i?T:e,[e,T,i]);return jsxs(a$5,{isDisabled:I,isSelected:x,hideCheckbox:a,isIndeterminate:y,sx:{maxHeight:36,minHeight:36,padding:"12px 8px 12px 16px",...c&&{boxShadow:"0px 0px 16px 0px #00000021"},...I&&{pointerEvents:"none",opacity:.5,cursor:"default"}},onMouseEnter:f,onMouseLeave:g,onClick:h,children:[jsx(a$3,{sx:{fontSize:"11px",flex:1},children:u("merchant")}),e.length>0&&jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),e?.length===1?jsx(pl,{anchorEl:s,brand:e[0],merchantsIds:n,onChangeMerchant:o,atLeastOneMerchantSelected:r,showSearchInput:i}):jsxs(a$9,{open:c,anchorEl:s,placement:"right-start",children:[i&&e.length>1&&jsx(a$m,{placeholder:"Brands",name:"brands",value:d,onSearchChange:S,onSearchReset:b,sx:{px:"8px"}}),v?.map(P=>jsx(eT,{isDisabled:C===1&&r,brand:P,merchantsIds:n,onChangeMerchant:o,atLeastOneMerchantSelected:r,showSearchInput:i,renderBrandLogo:l},P.id))]})]})}var nT=styled(En)(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"164px"}));function fk({retailersIds:e=[],isLoading:t,retailers:o=[],onFilterChange:n,atLeastOneRetailerSelected:r=false,showSearchInput:i=false,hideCheckbox:a=false}){let[l,s]=useState(null),p=!!l,{t:d,i18n:m}=useTranslation(),[c,u]=useState(""),f=M=>{s(M.currentTarget);},g=()=>{s(null);},x=useCallback(M=>e?.includes(M),[e]),y=useMemo(()=>o.length?o.every(M=>x(M.id)):false,[o,x,a]),C=useMemo(()=>!y&&e.length>0,[e,y]),h=()=>{if(y&&!r){n?.([]);return}n?.(o.map(M=>M.id));},I=M=>e.length===1&&e[0]===M&&r,S=(M,k)=>{if(M.stopPropagation(),I(k))return;if(x(k)){n?.(e.filter(V=>V!==k));return}let W=[...new Set([...e,k])];n?.(W);},b=t||!o?.length,T=M=>{u(M);},v=()=>{u("");},P=useMemo(()=>c?.trim()?o?.filter(M=>(M?.brand?.name?.[m.language]??M?.brand?.name?.en??"").toLowerCase().includes(c.trim().toLowerCase())):o,[c,o,m.language]),A=useMemo(()=>i?P:o,[P,o,i]);return jsxs(a$5,{isDisabled:b,isSelected:y,hideCheckbox:a,isIndeterminate:C,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...p&&{boxShadow:"0px 0px 16px 0px #00000021"},...b&&{opacity:.5,pointerEvents:"none",cursor:"default"}},onMouseEnter:f,onMouseLeave:g,onClick:h,children:[jsx(a$3,{sx:{fontSize:"11px",flex:1},children:d("retailers")}),o?.length>0&&jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),jsxs(a$9,{open:p,anchorEl:l,placement:"right-start",sx:{height:300,width:200,overflow:"auto"},children:[i&&jsx(a$m,{placeholder:"Retailers",name:"retailers",value:c,onSearchChange:T,onSearchReset:v,sx:{px:"8px"}}),A?.map((M,k)=>jsx(a$5,{isSelected:x(M.id),isDisabled:t||I(M.id),onClick:W=>{S(W,M.id);},sx:{maxHeight:35,minHeight:35},children:jsx(nT,{children:M?.brand?.name?.[m.language]??M?.brand?.name?.en})},`key-${M?.id}-${k}`))]})]})}var aT=memo(fk);function yk({countriesIds:e=[],isLoading:t,countries:o=[],onFilterChange:n,atLeastOneCountrySelected:r=false,hideCheckbox:i=false}){let[a,l]=useState(null),s=!!a,{t:p}=useTranslation(),d=h=>{s||l(h.currentTarget);},m=()=>{s&&l(null);},c=useCallback(h=>e?.includes(h),[e]),u=useMemo(()=>o.length?o.every(h=>c(h)):false,[o,c]),f=useMemo(()=>!u&&e.length>0,[e,u]),g=()=>{if(!r){if(u){n?.([]);return}n?.(o);}},x=h=>e.length===1&&e[0]===h&&r,y=(h,I)=>{if(h.stopPropagation(),x(I))return;if(c(I)){n?.(e.filter(b=>b!==I));return}let S=[...new Set([...e,I])];n?.(S);},C=t||o?.length<=0||r;return jsxs(a$5,{isDisabled:C,isSelected:u,hideCheckbox:i,isIndeterminate:f,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...s&&{boxShadow:"0px 0px 16px 0px #00000021"},...!o?.length&&{opacity:.5,pointerEvents:"none"}},onMouseEnter:d,onMouseLeave:m,onClick:g,children:[jsx(a$3,{sx:{fontSize:"11px",flex:1},children:p("walletCountry")}),o?.length>0&&jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),jsx(a$9,{open:s,anchorEl:a,placement:"right-start",sx:{width:200,overflow:"auto"},children:o?.map((h,I)=>jsxs(a$5,{isSelected:c(h),isDisabled:t||x(h),onClick:S=>{y(S,h);},sx:{maxHeight:35,minHeight:35},children:[jsx(a$f,{countryCode:h}),jsx(a$3,{sx:{fontSize:"11px !important",fontWeight:"500 !important"},children:Ua$1(h)})]},`key-${h}-${I}`))})]})}var pT=memo(yk);function wk({currenciesIds:e=[],isLoading:t,currencies:o=[],onFilterChange:n,atLeastOneCurrencySelected:r=false,hideCheckbox:i=false}){let[a,l]=useState(null),s=!!a,{t:p}=useTranslation(),d=h=>{s||l(h.currentTarget);},m=()=>{s&&l(null);},c=useCallback(h=>e?.includes(h),[e]),u=useMemo(()=>o.length?o.every(h=>c(h)):false,[o,c]),f=useMemo(()=>!u&&e.length>0,[e,u]),g=()=>{if(!r){if(u){n?.([]);return}n?.(o);}},x=h=>e.length===1&&e[0]===h&&r,y=(h,I)=>{if(h.stopPropagation(),x(I))return;if(c(I)){n?.(e.filter(b=>b!==I));return}let S=[...new Set([...e,I])];n?.(S);},C=t||o?.length<=0||r;return jsxs(a$5,{isDisabled:C,isSelected:u,hideCheckbox:i,isIndeterminate:f,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...s&&{boxShadow:"0px 0px 16px 0px #00000021"},...!o?.length&&{opacity:.5,pointerEvents:"none"}},onMouseEnter:d,onMouseLeave:m,onClick:g,children:[jsx(a$3,{sx:{fontSize:"11px",flex:1},children:p("currency")}),o?.length>0&&jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),jsx(a$9,{open:s,anchorEl:a,placement:"right-start",sx:{width:200,overflow:"auto"},children:o?.map((h,I)=>Ln[h]?.country?jsxs(a$5,{isSelected:c(h),isDisabled:t||x(h),onClick:b=>{y(b,h);},sx:{maxHeight:35,minHeight:35},children:[jsx(a$f,{countryCode:Ln[h].country})," ",jsx(a$3,{sx:{fontSize:"11px !important",fontWeight:"500 !important"},children:h})]},`key-${h}-${I}`):null)})]})}var cT=memo(wk);var vk=(r=>(r.BRAND="BRAND",r.COUNTRY="COUNTRY",r.ENTITY="ENTITY",r.MERCHANT="MERCHANT",r))(vk||{});var Ek="/",Ur=5,uT=(...e)=>e.join(Ek),Sd=e=>[e.label,e.id],fT=(e,t)=>{if(e.levelKey==="MERCHANT")return e.id.toLowerCase().includes(t)?e:null;let o=(e.children??[]).map(i=>fT(i,t)).filter(i=>i!==null);if(!o.length)return null;let{searchProps:n,...r}=e;return {...r,children:o,...o.length>=Ur&&{searchProps:n}}},gT=(e,t,o)=>{let n=e.map(r=>{let i=r.entities??[],l=Array.from(new Set(i.map(s=>s.country).filter(Boolean))).map(s=>{let d=i.filter(m=>m.country===s).map(m=>{let u=(m.merchants??[]).map(f=>({id:f.legacy_id,label:f.display_name,levelKey:"MERCHANT",status:t.includes(f.legacy_id)?"CHECKED":"UNCHECKED",hintText:f.legacy_id}));return {id:uT(r.id,s,m.id),label:lc$1(m.legal_name,o)??m.id,levelKey:"ENTITY",children:u,header:"Merchants",...u.length>=Ur&&{searchProps:{getValues:Sd}}}});return {id:uT(r.id,s),label:Ua$1(s)??s,levelKey:"COUNTRY",children:d,header:"Entities",iconComponent:jsx(a$f,{countryCode:s,width:14}),...d.length>=Ur&&{searchProps:{getValues:Sd}}}});return {id:r.id,label:lc$1(r.name,o)??r.id,levelKey:"BRAND",children:l,header:"Countries",icon:{fileId:r.logo},...l.length>=Ur&&{searchProps:{getValues:Sd}}}});return {levelKey:"BRAND",children:n,header:"Brands",...n.length>=Ur&&{searchProps:{filterItem:(r,i)=>(typeof r.label=="string"?r.label.toLowerCase():"").includes(i)?r:fT(r,i)}}}};var Rk=e=>{let{brands:t,isLoading:o,initialValue:n,onFilterChange:r,BrandLogoComponent:i,hideCheckbox:a}=e,[l,s]=useState(null),[p,d]=useState("UNCHECKED"),m=useRef(null),c=!!l,{t:u,i18n:f}=useTranslation(),g=useMemo(()=>gT(t,n,f.language),[t,n,f.language]),x=g.children??[],y=o||!x.length,C=useCallback(b=>{let T=b.filter(P=>P.status==="CHECKED"),v=b.filter(P=>P.status==="INDETERMINATE");return T.length===x.length?"CHECKED":v.length>0||T.length>0?"INDETERMINATE":"UNCHECKED"},[x]),h=useCallback(({selectedTree:b})=>{d(C(b));},[C]),I=useCallback(b=>{d(C(b));let T=we.filterNodesByLevelKey(b,"MERCHANT").map(({id:v})=>v);r?.(T);},[r,C]),S=useCallback(()=>{m.current?.toggleAll(p!=="CHECKED");},[p]);return jsxs(a$5,{hideCheckbox:a,isSelected:p==="CHECKED",isIndeterminate:p==="INDETERMINATE",isDisabled:y,onMouseEnter:b=>s(b.currentTarget),onMouseLeave:()=>s(null),onClick:S,sx:{maxHeight:36,minHeight:36,padding:"12px 8px 12px 16px",...c&&{boxShadow:"0px 0px 16px 0px #00000021"},...y&&{pointerEvents:"none",opacity:.5,cursor:"default"}},children:[jsx(a$3,{sx:{fontSize:"11px",flex:1},children:u("merchant")}),t.length>0&&jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),!o&&jsx(Ed,{ref:m,placement:"right-start",anchorEl:l,exposeOnlySelectedTree:true,treeDefinition:g,onChange:I,onMounted:h,IconComponent:i})]})},CT=Rk;var kk=CT;function hT({onPhoneChange:e,onCountryChange:t,selectedPhone:o,selectedCountry:n,countriesOptions:r,isCountriesLoading:i}){let a=Jc(useId(),"phone-filter");return jsx(h$3,{id:a,"data-testid":"ColumnFilterInputs_PhoneInput",phoneValue:o,onPhoneChange:l=>{e(l);},countryValue:n,onCountryChange:l=>{t(l?.countryId);},countries:r||[],isCountriesLoading:i||false,hasError:false,disabled:i,placeholder:"User Mobile",sx:{"&.MuiInputBase-root":{paddingLeft:"0px !important"}}})}var yT=styled("span")(()=>({fontSize:"11px"})),bT=styled(a$6)(()=>({display:"flex",alignItems:"center",paddingInline:"16px",gap:"4px",borderBlock:"1px solid #F2F2F2",fontSize:"11px","&:hover":{backgroundColor:"#fff",boxShadow:"0px 0px 16px 0px #00000021"}})),IT=styled(a$6)(({theme:e})=>({color:e.palette.info.dark,backgroundColor:"#F4F4F4",fontWeight:600,paddingInline:"16px",fontSize:"11px",gap:"4px"})),TT=styled(a$6)(()=>({gap:"2px",paddingInline:"16px",fontSize:"11px","&:hover":{backgroundColor:"#fff",boxShadow:"0px 0px 16px 0px #00000021"}})),ST=styled("img")({marginLeft:"auto",width:16,height:12}),wT=styled("img")({borderRadius:"2px",width:16,height:12,flexShrink:0}),vT={marginTop:"8px",marginBottom:"8px",maxHeight:"190px",overflow:"auto"},ET={zIndex:99999};function Pd({onCountriesChange:e,sx:t,selectedCountries:o,countriesOptions:n}){let r=Jc(useId(),"country-filter"),[i,a]=useState(null),l=useRef(null),s=!!i,p=()=>{if(!s){a(l.current);return}d();},d=()=>{a(null);},m=g=>o?.includes(g)??false,c=g=>{e(g);},u=g=>{let x=o?.includes(g)?o?.filter(y=>y!==g):[...o??[],g];c(x),e(x);},f=useMemo(()=>o?.length===n.length,[o,n]);return jsx(ClickAwayListener,{onClickAway:d,children:jsxs(En,{ref:l,sx:t,id:r,"data-testid":"CountryFilter",children:[jsx(En,{children:jsxs(bT,{onMouseEnter:g=>{g.stopPropagation(),p();},hideCheckbox:true,children:[jsx(yT,{children:"Country"}),jsx(ST,{src:tb$1,alt:""})]})}),jsxs(a$9,{open:s,anchorEl:i,sx:vT,placement:"right-start",popperSx:ET,children:[jsx(IT,{onClick:g=>{g.stopPropagation(),f?(c([]),e([])):(c(n.map(({value:x})=>x)),e(n.map(({value:x})=>x)));},isSelected:f,children:f?"Unselect All":"Select All"}),n.map(({value:g,label:x,icon:y})=>jsxs(TT,{isSelected:m(g),onClick:()=>u(g),children:[jsx(wT,{src:y,alt:""}),x]},g))]})]})})}var dae=Pd;var AT=styled(En)(()=>({position:"relative",flexGrow:0})),DT=styled(En)(({theme:e})=>({fontSize:"11px",color:e.palette.text.primary,display:"flex",padding:e.spacing(1),gap:e.spacing(1),border:`1px solid ${e.palette.divider}`,borderRadius:"4px",backgroundColor:e.palette.common.white,alignItems:"center",height:32,textTransform:"capitalize",cursor:"pointer"})),RT=styled(_k)(({theme:e})=>({width:16,height:16,cursor:"pointer",fontSize:"5.667px",color:e.palette.common.white,fontWeight:500,border:`1px solid ${e.palette.common.white}`}));var LT=styled(En)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,display:"flex",position:"relative",paddingInline:"8px",alignItems:"center",borderRadius:"4px",height:"40px"}));styled(En)(()=>({display:"flex",alignItems:"center"}));var Yt=styled(En)(({theme:e})=>({padding:"8px",display:"flex",flexDirection:"column",gap:"8px",position:"relative",background:e.palette.common.white,borderRadius:"4px",width:"max-content",maxWidth:230,boxShadow:e.shadows[3]})),Tn=styled(wb)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",textTransform:"capitalize",padding:"8px 13px",minWidth:89,height:32,fontSize:"11px",borderRadius:"4px",fontWeight:700,background:e.palette.info.dark,color:e.palette.common.white,textAlign:"center","&.Mui-disabled":{backgroundColor:alpha(e.palette.grey[700],.5),color:e.palette.common.white,cursor:"not-allowed"},"&:hover":{background:e.palette.info.dark}})),Ce=styled(a$7,{shouldForwardProp:e=>e!=="error"})(({error:e})=>({img:{cursor:"pointer"},...e&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"}})),kT=styled(a$4,{shouldForwardProp:e=>e!=="error"})(({error:e})=>({img:{cursor:"pointer"},...e&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"}})),ae=styled(a$8)(()=>({borderTopLeftRadius:0,borderTopRightRadius:0,height:25}));var BT=he.object().shape({email:he.string().matches(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,"invalidEmail").required("requiredEmail"),firstName:he.string().required("requiredFirstName").min(3,"invalidFirstName"),lastName:he.string().required("requiredLastName").min(3,"invalidLastName")}),ul=e=>he.object().shape({email:he.string().transform((t,o)=>{if(o!=="")return t}).matches(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{1,}$/i,"invalidEmail").optional(),phoneNumber:he.string().transform((t,o)=>{if(o)return t}).length(e,"invalidMobile").optional(),firstName:he.string().min(3,"invalidFirstName").required("requiredFirstName"),lastName:he.string().min(3,"invalidLastName").required("requiredLastName")}).test("atLeastOne","atLeastOne",function(o,n){let{email:r,phoneNumber:i}=this.originalValue??{};return !r&&!i?n.createError({message:"atLeastOne"}):true}),FT=e=>he.object().shape({firstName:he.string().required("requiredFirstName").min(3,"invalidFirstName"),lastName:he.string().required("requiredLastName").min(3,"invalidLastName"),phoneNumber:he.string().length(e,"invalidMobile").required("requiredMobile")});function jk({customer:e,country:t,defaultCountry:o,countries:n,isCountriesLoading:r,onCustomerChange:i,onCountryChange:a,isCustomerNotValid:l}){let s=Jc(useId(),"customer-full-info"),p=useRef(),d=useRef(),m=useRef(),c=useRef(),{t:u}=useTranslation(),{control:f,watch:g,formState:{errors:x,isValid:y}}=useForm({mode:"onChange",resolver:yupResolver(ul(t.max_digits)),defaultValues:{firstName:e.firstName,email:e.email,lastName:e.lastName,phoneNumber:e.phoneNumber}});useEffect(()=>{g(({firstName:I="",lastName:S="",email:b="",phoneNumber:T=""})=>{i({firstName:I,lastName:S,email:b,phoneNumber:T});});},[g,x,e]);let C=useCallback(()=>x.firstName?.message??x.lastName?.message??x.email?.message??x.phoneNumber?.message,[x]);return useEffect(()=>{l?.(!y,C());},[y,C]),jsxs(Yt,{id:s,"data-testid":"CustomerFullInfo",onMouseLeave:I=>{I.stopPropagation();},children:[jsx(Controller,{control:f,name:"firstName",render:({field:{ref:I,...S},fieldState:{error:b}})=>jsxs(En,{ref:p,children:[jsx(Ce,{...S,placeholder:u("firstName"),inputProps:{autoComplete:"off"},error:!!b?.message}),b?.message&&jsx(ae,{error:u(b.message)})]})},"fullInfoFirstName"),jsx(Controller,{control:f,name:"lastName",render:({field:{ref:I,...S},fieldState:{error:b}})=>jsxs(En,{ref:d,children:[jsx(Ce,{...S,placeholder:u("lastName"),inputProps:{autoComplete:"off"},error:!!b?.message}),b?.message&&jsx(ae,{error:u(b.message)})]})},"fullInfoLastName"),jsx(Controller,{control:f,name:"email",render:({field:{ref:I,...S},fieldState:{error:b}})=>jsxs(En,{ref:m,children:[jsx(Ce,{...S,placeholder:u("email"),inputProps:{autoComplete:"off"},error:!!b?.message}),b?.message&&jsx(ae,{error:u(b.message)})]})},"fullInfoEmail"),jsx(Controller,{control:f,name:"phoneNumber",render:({field:{ref:I,...S},fieldState:{error:b}})=>jsxs(En,{ref:c,children:[jsxs(LT,{sx:{...b?.message&&{borderBottom:"none"}},children:[jsx(d$3,{defaultCountry:t?.iso2??o?.code??"SA",value:t,onChangeCountry:a,countries:n,isLoading:r}),jsx(kT,{...S,placeholder:u("mobile"),inputProps:{autoComplete:"off"},error:!!b?.message,sx:{border:"none",paddingInlineEnd:0},hideArrows:true})]}),b?.message&&jsx(ae,{error:u(b.message,{numberLen:t.max_digits})})]})},"fullInfoPhoneNumber")]})}var VT=jk;function oB({...e}){let t=Jc(useId(),"customer-dropdown"),[o,n]=useState(null),{firstName:r,lastName:i}=e.customer,{t:a}=useTranslation(),l=!!o,s=m=>{l||n(m.currentTarget);},p=()=>{l&&n(null);},d=useMemo(()=>Ja$1(),[]);return jsxs(AT,{id:t,"data-testid":"CustomerDropdown",sx:{...e.isDisabled&&{pointerEvents:"none",opacity:.7}},children:[jsxs(DT,{onClick:s,children:[(!r||!i)&&jsxs(Fragment,{children:[jsx("img",{src:fj,alt:"c"}),jsx("span",{children:a("customer")})]}),r&&i&&jsxs(Fragment,{children:[jsx(RT,{src:"#",alt:"a",sx:{background:d},children:`${r[0]?.toUpperCase()}${i[0]?.toUpperCase()||""}`}),`${r} ${i}`]})]}),l&&jsx(a$i,{onClick:p}),jsx(R1,{open:l,anchorEl:o,placement:"bottom-start",children:jsx(VT,{...e})})]})}var HT=memo(oB);function sB({submitButtonText:e,onSubmit:t,customer:o,isItemsNotValid:n,items:r,onCustomerChange:i}){let a=Jc(useId(),"customer-email-form"),l=useRef(),s=useRef(),p=useRef(),{t:d}=useTranslation(),{control:m,formState:{isValid:c,errors:u},watch:f,trigger:g}=useForm({mode:"onChange",resolver:yupResolver(BT),defaultValues:{firstName:o.firstName,email:o.email,lastName:o.lastName}});return useEffect(()=>{o.firstName&&o.email&&o.lastName&&g();},[]),useEffect(()=>{f(({firstName:y="",lastName:C="",email:h=""})=>{i({...o,email:h,firstName:y,lastName:C});});},[f,u,o]),jsxs(Yt,{id:a,"data-testid":"CustomerEmailForm",onMouseLeave:y=>{y.stopPropagation();},children:[jsx(Controller,{control:m,name:"email",render:({field:{ref:y,...C},fieldState:{error:h}})=>jsxs(En,{ref:p,children:[jsx(Ce,{...C,"data-testid":"EmailForm_email",placeholder:d("email"),inputProps:{autoComplete:"off",form:{autoComplete:"off"}},error:!!h?.message}),h?.message&&jsx(ae,{error:d(h.message)})]})}),jsx(Controller,{control:m,name:"firstName",render:({field:{ref:y,...C},fieldState:{error:h}})=>jsxs(En,{ref:l,children:[jsx(Ce,{...C,"data-testid":"EmailForm_firstName",placeholder:d("firstName"),inputProps:{autoComplete:"off",form:{autoComplete:"off"}},error:!!h?.message}),h?.message&&jsx(ae,{error:d(h.message)})]})}),jsx(Controller,{control:m,name:"lastName",render:({field:{ref:y,...C},fieldState:{error:h}})=>jsxs(En,{ref:s,children:[jsx(Ce,{...C,"data-testid":"EmailForm_lastName",placeholder:d("lastName"),inputProps:{autoComplete:"off",form:{autoComplete:"off"}},error:!!h?.message}),h?.message&&jsx(ae,{error:d(h.message)})]})}),jsx(Tn,{type:"button","data-testid":"EmailForm_submit",onClick:t,disabled:!c||n||!r.length,children:e})]})}var _T=memo(sB);function uB({submitButtonText:e,onSubmit:t,customer:o,country:n,items:r,isItemsNotValid:i,defaultCountry:a,countries:l,isCountriesLoading:s,onCustomerChange:p,onCountryChange:d}){let m=useRef(),c=useRef(),u=useRef(),f=useRef(),{t:g}=useTranslation(),{control:x,watch:y,trigger:C,formState:{isValid:h,errors:I}}=useForm({mode:"onChange",resolver:yupResolver(ul(n.max_digits)),defaultValues:{firstName:o.firstName,email:o.email,lastName:o.lastName,phoneNumber:o.phoneNumber}});return useEffect(()=>{y(({firstName:S="",lastName:b="",email:T="",phoneNumber:v=""})=>{p({email:T,firstName:S,lastName:b,phoneNumber:v});});},[y,I,o]),useEffect(()=>{o.firstName&&o.lastName&&(o.email||o.phoneNumber)&&C();},[]),jsxs(Yt,{onMouseLeave:S=>{S.stopPropagation();},children:[jsx(Controller,{control:x,name:"firstName",render:({field:{ref:S,...b},fieldState:{error:T}})=>jsxs(En,{ref:m,children:[jsx(Ce,{...b,placeholder:g("firstName"),inputProps:{autoComplete:"off"},error:!!T?.message}),T?.message&&jsx(ae,{error:g(T.message)})]})},"fullInfoFormFirstName"),jsx(Controller,{control:x,name:"lastName",render:({field:{ref:S,...b},fieldState:{error:T}})=>jsxs(En,{ref:c,children:[jsx(Ce,{...b,placeholder:g("lastName"),inputProps:{autoComplete:"off"},error:!!T?.message}),T?.message&&jsx(ae,{error:g(T.message)})]})},"fullInfoFormLastName"),jsx(Controller,{control:x,name:"email",render:({field:{ref:S,...b},fieldState:{error:T}})=>jsxs(En,{ref:u,children:[jsx(Ce,{...b,placeholder:g("email"),inputProps:{autoComplete:"off"},error:!!T?.message}),T?.message&&jsx(ae,{error:g(T.message)})]})},"fullInfoFormEmail"),jsx(Controller,{control:x,name:"phoneNumber",render:({field:{ref:S,...b},fieldState:{error:T}})=>jsxs(En,{ref:f,children:[jsxs(b$7,{sx:{...T?.message&&{borderBottom:"none"}},children:[jsx(d$3,{defaultCountry:n?.iso2??a?.code??"SA",value:n,onChangeCountry:d,countries:l,isLoading:s}),jsx(c$3,{...b,placeholder:g("mobile"),inputProps:{autoComplete:"off"},error:!!T?.message,sx:{border:"none",paddingInlineEnd:0},hideArrows:true})]}),T?.message&&jsx(ae,{error:g(T.message,{numberLen:n.max_digits})})]})}),jsx(Tn,{onClick:t,disabled:!h||i||!r.length,children:e})]})}var UT=memo(uB);function yB({submitButtonText:e,onSubmit:t,customer:o,country:n,isItemsNotValid:r,items:i,defaultCountry:a,countries:l,isCountriesLoading:s,onCustomerChange:p,onCountryChange:d}){let m=Jc(useId(),"customer-phone-number-form"),c=useRef(),u=useRef(),f=useRef(),{t:g}=useTranslation(),{control:x,formState:{isValid:y,errors:C},watch:h,trigger:I}=useForm({mode:"onChange",resolver:yupResolver(FT(n.max_digits)),defaultValues:{firstName:o.firstName,phoneNumber:o.phoneNumber,lastName:o.lastName}});return useEffect(()=>{o.firstName&&o.phoneNumber&&o.lastName&&I();},[]),useEffect(()=>{h(({firstName:b="",lastName:T="",phoneNumber:v=""})=>{p({...o,firstName:b,lastName:T,phoneNumber:v});});},[h,C,o]),jsxs(Yt,{id:m,"data-testid":"CustomerPhoneNumberForm",onMouseLeave:b=>{b.stopPropagation();},children:[jsx(Controller,{control:x,name:"phoneNumber",render:({field:{ref:b,...T},fieldState:{error:v}})=>jsxs(En,{ref:f,children:[jsxs(b$7,{sx:{...v?.message&&{borderBottom:"none"}},children:[jsx(d$3,{defaultCountry:n?.iso2??a?.code??"SA",value:n,onChangeCountry:d,countries:l,isLoading:s}),jsx(c$3,{...T,placeholder:g("mobile"),error:!!v?.message,sx:{border:"none",paddingInlineEnd:0},inputProps:{autoComplete:"off",form:{autoComplete:"off"}},hideArrows:true})]}),v?.message&&jsx(ae,{error:g(v.message,{numberLen:n.max_digits})})]})},"phoneNumberFormPhone"),jsx(Controller,{control:x,name:"firstName",render:({field:{ref:b,...T},fieldState:{error:v}})=>jsxs(En,{ref:c,children:[jsx(Ce,{...T,placeholder:g("firstName"),inputProps:{autoComplete:"off"},error:!!v?.message}),v?.message&&jsx(ae,{error:g(v.message)})]})},"phoneNumberFormFirstName"),jsx(Controller,{control:x,name:"lastName",render:({field:{ref:b,...T},fieldState:{error:v}})=>jsxs(En,{ref:u,children:[jsx(Ce,{...T,placeholder:g("lastName"),inputProps:{autoComplete:"off"},error:!!v?.message}),v?.message&&jsx(ae,{error:g(v.message)})]})},"phoneNumberFormLastName"),jsx(Tn,{onClick:t,disabled:!y||r||!i.length,children:e})]})}var YT=memo(yB);var Yr=styled(En)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",cursor:"pointer",padding:"8px",border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,borderRadius:"4px",fontSize:"14px",fontWeight:500,".logo":{width:17},color:e.palette.text.primary,height:32})),GT=styled(En)(({theme:e})=>({width:109,boxShadow:e.shadows[9],backgroundColor:e.palette.common.white,borderRadius:"4px",fontSize:"14px",fontWeight:500,color:e.palette.text.primary,maxHeight:210,overflow:"auto",marginTop:"8px",".currecy+.currency":{marginTop:"4px"}})),KT=styled(En)(({theme:e})=>({display:"flex",alignItems:"center",paddingInlineStart:e.spacing(1),paddingInlineEnd:e.spacing(2),paddingTop:e.spacing(1),paddingBottom:e.spacing(1),gap:"4px",cursor:"pointer",height:42,".logo":{width:20,borderRadius:"2px",border:`1px solid ${e.palette.divider}`},"&:hover":{boxShadow:e.shadows[4]}})),qT=styled(En)(({theme:e})=>({fontSize:"14px",fontWeight:500,color:e.palette.text.primary,textTransform:"uppercase",display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",padding:"8px",img:{width:17,borderRadius:"4px"}}));function Gr({selectedCurrencyCode:e}){let t=Jc(useId(),"selected-currency");return jsxs(qT,{id:t,"data-testid":"SelectedCurrency",sx:{padding:0},children:[jsx(a$f,{currencyCode:e}),jsxs("span",{children:[" ",e]})]})}function EB({merchantCurrencies:e,isLoading:t,onChangeCurrency:o,isDisabled:n,selectedCurrency:r}){let i=Jc(useId(),"merchant-currency-dropdown"),[a,l]=useState(null),s=!!a,p=c=>{s||l(c.currentTarget);},d=()=>{s&&l(null);},m=c=>{o?.(c),d();};return t||!e?jsxs(Yr,{sx:{pointerEvents:"none"},children:[jsx(a$3,{sx:{fontSize:"11px"},children:"Select"}),t?jsx(a$n,{}):jsx(En,{component:"img",src:ej,alt:"c",sx:{marginTop:"2px"}})]}):e.length===0?jsxs(Yr,{sx:{pointerEvents:"none",opacity:.5},children:[jsx(a$3,{sx:{fontSize:"11px"},children:"Select"}),jsx(En,{sx:{width:25,textAlign:"center"},children:jsx(En,{component:"img",src:ej,alt:"c",sx:{marginTop:"2px"}})})]}):e.length===1?jsx(Yr,{sx:{border:"none",pointerEvents:"none"},children:jsx(Gr,{selectedCurrencyCode:e?.[0]?.code?.english??""})}):jsxs(Yr,{id:i,"data-testid":"MerchantCurrencyDropdown",onClick:p,sx:{...n&&{pointerEvents:"none",opacity:.7}},children:[jsx(Gr,{selectedCurrencyCode:r?.code?.english??""}),jsx(En,{component:"img",src:ej,alt:"c",sx:{marginTop:"2px",...s&&{transform:"rotate(180deg)"}}}),s&&jsx(a$i,{onClick:d}),jsx(R1,{open:s,anchorEl:a,placement:"bottom-start",children:jsx(GT,{children:e.map((c,u)=>jsx(KT,{className:"currency",onClick:()=>{m(c);},children:jsx(Gr,{selectedCurrencyCode:c.code.english})},`${c.symbol}-${u}`))})})]})}var PB=memo(EB);var ZT=styled(En)(({theme:e})=>({display:"flex",flexDirection:"column",justifyContent:"center",gap:"8px",padding:"8px",borderRadius:"4px",border:`1px solid ${e.palette.divider}`,background:e.palette.common.white})),JT=styled(a$3)(({theme:e})=>({color:e.palette.grey[700],fontSize:"10px",fontWeight:500,marginBottom:"8px",margin:0}));var AB=(e,t)=>e.name===t.name&&e.size===t.size,QT=(e,t)=>t?.length?t.some(o=>gc$2(o)?AB(o.file,e):o.name===e.name):false;function NB({options:e,error:t,files:o,label:n,disabled:r,hideUpload:i=false,preventDuplicates:a,onChangeFiles:l,onRemoveFile:s,renderBrandLogo:p,renderOpenFileInNewTab:d}){let m=Jc(useId(),"file-input-preview"),{t:c}=useTranslation(),[u,f]=useState(null),{getRootProps:g,getInputProps:x,open:y,isDragReject:C,fileRejections:h}=useDropzone(e),I=fc$1(e?.maxSize||0,0).toUpperCase(),S=useMemo(()=>{let v=h.length&&h[0].errors.some(A=>A.code==="file-invalid-type"),P=h.length&&h[0].errors.some(A=>A.code==="file-too-large");return C||v?c("invalidFileType"):P?`File is larger than ${I}`:u||t},[C,t,h,u,c,I]);return jsxs(ZT,{id:m,"data-testid":"FileInputPreview",children:[jsx(JT,{children:n}),jsx(h$2,{files:o,onRemoveFile:s,disabled:r,getFilePreview:v=>v.type.includes("image")?URL.createObjectURL(v):v.name.includes(".pdf")?Te:v.name,renderBrandLogo:p,renderOpenFileInNewTab:d}),!r&&!i&&jsx(a$o,{getRootProps:g,getInputProps:x,open:y,onChangeFiles:l,processFiles:v=>{if(f(null),!a)return v.map(M=>({file:M,id:M.name}));let{duplicates:P,uniqueFiles:A}=v.reduce((M,k)=>(QT(k,o)?M.duplicates.push(k.name):M.uniqueFiles.push({file:k,id:k.name}),M),{duplicates:[],uniqueFiles:[]});if(P.length>0){let M=P.length===1?"file":"files";f(`Duplicate ${M} detected: ${P.join(", ")}`);}return A},disabled:r,errorMessage:S,maxFileSize:I,preventDuplicates:a})]})}var VB=memo(NB);var eS=styled$1(Box)(({theme:e})=>({background:e.palette.common.white,width:"100%",height:"100%",overflow:"auto"}));function Hd({isOpen:e,receipt:t,order:o,appWindow:n,onClose:r}){let i=Jc(useId(),"receipt-viewer");return jsx(r$2,{isOpen:e,onClose:()=>r(t.id),initialPosition:{x:1e3-20*o},windowProps:{titleBarText:"Receipt",mainAppIsMinimized:n?.isMinimized,mainAppOrder:n?.order,showSectionsButton:false},defaultWindowWidth:502,defaultWindowHeight:745,children:jsx(eS,{id:i,"data-testid":"ReceiptViewer",children:jsx(En,{sx:{height:715,overflow:"auto"},dangerouslySetInnerHTML:{__html:Gc(t.content)}})})})}function oS({receipts:e,onCloseReceipt:t,appWindow:o}){return e.length?jsx(Fragment,{children:e.map((n,r)=>jsx(Hd,{order:r,isOpen:true,onClose:i=>t(i),receipt:n,appWindow:o},n.id))}):null}var vl=styled(En)(({theme:e})=>({borderRadius:"50%",background:e.palette.divider,width:13,height:14,fontSize:"8px",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"10px"})),Kr=styled(En)(()=>({display:"flex",alignItems:"center",gap:"4px",".arrow-icon":{height:12}})),El=styled(En)(()=>({display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,width:"100%",alignItems:"center"})),nS=styled(En)(()=>({display:"flex",flexDirection:"column"})),rS=styled(En,{shouldForwardProp:e=>e!=="isOpen"})(({isOpen:e,theme:t})=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"5px",cursor:"pointer",padding:"8px",border:`1px solid ${t.palette.divider}`,color:t.palette.text.primary,background:t.palette.common.white,borderRadius:"4px",height:32,width:"fit-content",minWidth:"89px",img:{marginTop:"1px"},...e&&{borderColor:t.palette.info.dark},"&:hover":{background:t.palette.divider}})),iS=styled(sS)(({theme:e})=>({fontSize:"11px",fontWeight:500,color:e.palette.text.primary})),aS=styled("img",{shouldForwardProp:e=>e!=="expanded"})(({theme:e,expanded:t})=>({transform:t?"rotate(180deg)":"rotate(0deg)",marginLeft:"auto",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest})})),lS=styled(En)(()=>({display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"4px",borderTop:"1px solid #F2F2F2"})),Pn=styled(a$9)({"& .MuiPopper-dropdown":{maxHeight:700,overflow:"visible"}});var Od=styled(a$5)({"--menuitem-border-rad":"4px",backgroundColor:"#fff",minHeight:36,"&:first-of-type":{borderTopLeftRadius:"var(--menuitem-border-rad)",borderTopRightRadius:"var(--menuitem-border-rad)"},"&:last-of-type":{borderBottomLeftRadius:"var(--menuitem-border-rad)",borderBottomRightRadius:"var(--menuitem-border-rad)"},"&.Mui-Submenu-open":{borderTopRightRadius:0,borderBottomRightRadius:0,"&.Mui-Submenu-flipped":{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderTopRightRadius:"var(--menuitem-border-rad)",borderBottomRightRadius:"var(--menuitem-border-rad)"}},"&.Mui-selected":{boxShadow:"0px 0px 16px rgba(0, 0, 0, 0.13)",zIndex:1}}),qr=styled(Od)({"&:first-of-type":{borderTopLeftRadius:0,borderTopRightRadius:"var(--menuitem-border-rad)","&.Mui-flipped":{borderTopLeftRadius:"var(--menuitem-border-rad)",borderTopRightRadius:0}},"&:last-of-type":{borderBottomLeftRadius:"var(--menuitem-border-rad)",borderBottomRightRadius:"var(--menuitem-border-rad)"},"&.Mui-Submenu-open":{borderTopRightRadius:0,borderBottomRightRadius:0,"&.Mui-Submenu-flipped":{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderTopRightRadius:"var(--menuitem-border-rad)",borderBottomRightRadius:"var(--menuitem-border-rad)"}},"&.Mui-only-one":{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderTopRightRadius:"var(--menuitem-border-rad)",borderBottomRightRadius:"var(--menuitem-border-rad)","&.Mui-flipped":{borderTopLeftRadius:"var(--menuitem-border-rad)",borderBottomLeftRadius:"var(--menuitem-border-rad)",borderTopRightRadius:0,borderBottomRightRadius:0},"&.Mui-Submenu-open":{borderTopRightRadius:0,borderBottomRightRadius:0,"&.Mui-Submenu-flipped":{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderTopRightRadius:"var(--menuitem-border-rad)",borderBottomRightRadius:"var(--menuitem-border-rad)"}}}});styled(qr)({backgroundColor:"#FAFAFA",color:"#8D8D94",padding:"10px 16px",borderBottom:"1px solid #F2F2F2"});var qB=e=>{let{merchant:t,selectedValue:o,onClick:n,onlyOne:r,menuFlipped:i}=e,a=t.id===o?.merchantId,l=useMemo(()=>{let s=[];return a&&s.push("Mui-selected"),r&&s.push("Mui-only-one"),i&&s.push("Mui-flipped"),s.join(" ")},[a,r,i]);return jsxs(qr,{"data-testid":"MerchantItem",className:l,sx:{py:"4.5px",pl:1,pr:2},onClick:n,hideCheckbox:true,children:[a?jsx("img",{src:Nc,alt:"Selected"}):jsx(En,{width:15}),jsxs(nS,{children:[jsx(sS,{component:"span",fontSize:11,children:t.display_name}),jsx(sS,{color:s=>alpha(s.palette.text.primary,.5),fontSize:8,children:t.legacy_id})]})]},t.id)},dS=qB;var XB=e=>{let{items:t,value:o,onItemClick:n,menuFlipped:r}=e,i=t.length===1,a=useMemo(()=>{let l=[];return i&&l.push("Mui-only-one"),r&&l.push("Mui-flipped"),l.join(" ")},[i,r]);return jsx(Fragment,{children:t.map(l=>jsx(dS,{className:a,onlyOne:t.length===1,selectedValue:o,merchant:l,onClick:s=>n?.(s,l),menuFlipped:r},l.id))})},Ml=XB;function oF(e){let{entity:t,brandId:o,selectedValue:n,onValueChange:r,onlyOne:i,menuFlipped:a}=e,[l,s]=useState(null),{i18n:p}=useTranslation(),[d,m]=useState(false),c=!!l,u=(t.merchants?.length??0)>0,f=o===n?.brandId&&t.id===n?.entityId,g=useCallback(h=>{u&&s(h.currentTarget);},[u]),x=useCallback(()=>{l&&s(null);},[l]),y=useCallback((h,I)=>{r({merchantId:I.id,brandId:o,entityId:h,legacyId:I.legacy_id});},[o,r]),C=useMemo(()=>{let h=[];return f&&h.push("Mui-selected"),i&&h.push("Mui-only-one"),a&&h.push("Mui-flipped"),c&&h.push("Mui-Submenu-open"),d&&h.push("Mui-Submenu-flipped"),h.join(" ")},[f,c,d,i,a]);return jsxs(qr,{"data-testid":"EntityItem",className:C,onMouseEnter:g,onMouseLeave:x,hideCheckbox:true,children:[jsxs(El,{children:[jsxs(Kr,{children:[f?jsx("img",{src:Nc,alt:"Selected"}):jsx(En,{width:15}),jsx(a$f,{countryCode:t.country}),jsx("span",{children:lc$1(t.legal_name,p.language)})]}),u&&jsxs(Kr,{children:[jsx(vl,{children:t.merchants?.length}),jsx("img",{src:tb$1,className:"arrow-icon",alt:"Expand"})]})]}),jsx(Pn,{open:c,anchorEl:l,placement:"right-start",modifiers:[{name:"placementTracker",enabled:true,phase:"write",fn({state:h}){m(h.placement==="left-start");}}],sx:{"& .MuiPopper-dropdown":{minWidth:"141px"}},children:jsx(Ml,{items:t.merchants||[],onItemClick:(h,I)=>{h.stopPropagation(),y(t.id,I);},menuFlipped:d,value:n})})]})}var fS=memo(oF);var nF=e=>{let{items:t,brand:o,value:n,onChange:r,menuFlipped:i}=e;return jsx(Fragment,{children:t.map(a=>jsx(fS,{entity:a,brandId:o.id,selectedValue:n,onValueChange:r,onlyOne:t.length===1,menuFlipped:i},a.id))})},xS=nF;function mF({brand:e,onClose:t,selectedValue:o,onValueChange:n,renderBrandLogo:r}){let[i,a]=useState(null),{i18n:l}=useTranslation(),[s,p]=useState(false),d=!!i,m=(e.entities?.length??0)>0,c=e.id===o?.brandId,u=useCallback(h=>{m&&a(h.currentTarget);},[m]),f=useCallback(()=>{i&&a(null);},[i]),g=useMemo(()=>{let h=[];return c&&h.push("Mui-selected"),d&&h.push("Mui-Submenu-open"),s&&h.push("Mui-Submenu-flipped"),h.join(" ")},[c,d,s]),x=e.entities?.length===1,y=e.entities?.[0],C=useCallback((h,I)=>{n({merchantId:I.id,brandId:e.id,entityId:h,legacyId:I.legacy_id}),t();},[e.id,n,t]);return jsxs(Od,{"data-testid":"BrandItem",className:g,onMouseEnter:u,onMouseLeave:f,hideCheckbox:true,children:[jsxs(El,{sx:{gap:"2.5px"},"data-testid":"Content",children:[c?jsx("img",{src:Nc,alt:"Selected"}):jsx(En,{width:15}),r?.(e.logo),jsx(sS,{flex:1,noWrap:true,fontSize:"inherit",component:"span",children:lc$1(e.name,l.language)}),m&&jsxs(Kr,{children:[jsx(vl,{children:e.entities.length}),jsx("img",{src:ub$1,height:10,className:"arrow-icon",alt:"Expand"})]})]}),jsx(Pn,{open:d,anchorEl:i,placement:"right-start",modifiers:[{name:"placementTracker",enabled:true,phase:"write",fn({state:h}){p(h.placement==="left-start");}}],sx:{"& .MuiPopper-dropdown":{minWidth:"157px"}},children:x?jsx(Ml,{items:y?.merchants||[],onItemClick:(h,I)=>{h.stopPropagation(),C(y?.id,I);},menuFlipped:s,value:o}):jsx(xS,{items:e.entities,value:o,onChange:h=>{t(),n(h);},brand:e,menuFlipped:s})})]})}var hS=memo(mF);var bS=()=>{let[e,t]=useState(null),o=!!e,n=useCallback(i=>{t(i.currentTarget);},[]),r=useCallback(()=>{t(null);},[]);return {anchorElement:e,isOpen:o,openMenu:n,closeMenu:r}},IS=(e,t,o)=>{useEffect(()=>{if(t?.merchantId)return;let n=e.find(a=>a.entities?.length>0&&a.entities.some(l=>(l.merchants?.length??0)>0));if(!n)return;let r=n.entities.find(a=>(a.merchants?.length??0)>0);if(!r?.merchants?.[0])return;let i=r.merchants[0];o({merchantId:i.id,brandId:n.id,entityId:r.id,legacyId:i.legacy_id});},[e,t?.merchantId,o]);},TS=e=>e.length===1&&e[0].entities?.length===1&&e[0].entities[0].merchants?.length===1;var hF=({isLoading:e,isSingleMerchant:t,isOpen:o})=>e?jsx(a$n,{}):t?null:jsx(aS,{src:Ab,alt:"Toggle dropdown",expanded:o});function yF({brands:e,isLoading:t$1=true,label:o,sx:n,selectedValue:r,isDisabled:i,isFetchingNextPage:a,renderBrandLogo:l,onValueChange:s,showSearchInput:p}){let{anchorElement:d,isOpen:m,openMenu:c,closeMenu:u}=bS(),f=Jc(useId(),"merchants-dropdown"),g=useRef(null),[x,y]=useState("");IS(e,r,s);let C=useMemo(()=>TS(e),[e]),h=C||i||t$1,I=useCallback(A=>{h||c(A);},[h,c]),S=useCallback(()=>{m&&u();},[m,u]),b=A=>{y(A);},T=()=>{y("");},v=useMemo(()=>x.trim()?e.filter(A=>lc$1(A.name)?.trim().toLowerCase()?.includes(x.trim().toLowerCase())||A?.id?.toLowerCase().includes(x.trim().toLowerCase())):e,[x,e]),P=useMemo(()=>p?v:e,[e,v,p]);return jsx(N1,{onClickAway:S,children:jsxs(rS,{id:f,"data-testid":"MerchantsDropdown",isOpen:m,onClick:I,sx:{...h&&{pointerEvents:"none",opacity:.7},...n},ref:g,children:[jsx(iS,{noWrap:true,sx:{...o?.length>16&&{width:100}},children:o}),jsx(hF,{isLoading:t$1,isSingleMerchant:C,isOpen:m}),jsxs(Pn,{open:m,anchorEl:d,sx:{"& .MuiPopper-dropdown":{mt:"5px",overflowY:"auto",maxHeight:432,...g.current&&{width:g.current.offsetWidth??"auto"},minWidth:180}},children:[p&&e.length>1&&jsx(a$m,{placeholder:"Brands",name:"brands",value:x,onSearchChange:b,onSearchReset:T,sx:{px:"8px"}}),P?.map(A=>jsx(hS,{brand:A,selectedValue:r,onClose:u,onValueChange:s,renderBrandLogo:l},A.id)),a&&jsx(lS,{children:jsx(t,{isLoadingRow:true})})]})]})})}var bF=memo(yF);var ES=styled(a$9)(()=>({marginTop:"-1px","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"}})),PS=styled(a$5)(({theme:e})=>({height:40,flex:"unset",paddingTop:0,paddingBottom:0,borderBottom:`1px solid ${e.palette.divider}`,paddingLeft:"16px",maxHeight:"35px",".label":{flexGrow:1}}));function Mn({menuLabel:e,options:t,selectedValue:o,onValueChange:n}){let r=Jc(useId(),"view-column-radio-filter"),[i,a]=useState(null),[l,s]=useState(o),p=useRef(null);return useEffect(()=>{s(o);},[o]),jsxs(PS,{id:r,ref:p,onMouseEnter:f=>{a(f.currentTarget);},onMouseLeave:()=>{a(null);},onClick:f=>{f.stopPropagation(),a(f.currentTarget);},hideCheckbox:true,children:[jsx("span",{className:"label",children:e}),jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),jsx(ES,{open:!!i,anchorEl:i,placement:"right-start",children:jsx(a$E,{options:t,value:l||"",onOptionChange:f=>{s(f),n(f);},defaultValue:t[0].value})})]})}var We=styled$1(a$3)(({theme:e})=>({fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.subtitle1.fontSize,color:e.palette.grey[700],paddingInlineStart:e.spacing(2),paddingTop:e.spacing(1),paddingBottom:e.spacing(1),paddingInlineEnd:e.spacing(1),borderBottom:`1px solid ${e.palette.divider}`})),He=styled$1(Box)(({theme:e})=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"center",position:"sticky",bottom:0,backgroundColor:"white",zIndex:99999,borderTop:`1px solid ${e.palette.divider}`})),Oe=styled$1(Button)(({theme:e})=>({textTransform:"capitalize",minWidth:"auto",width:74,borderRadius:"4px",border:`1px solid ${e.palette.info.dark}`,backgroundColor:e.palette.info.dark,fontWeight:700,fontSize:"11px",color:e.palette.common.white,"&:hover":{backgroundColor:e.palette.info.dark}})),_e=styled$1(Button)(({theme:e})=>({textTransform:"capitalize",minWidth:"auto",width:74,borderRadius:"4px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.common.white,fontWeight:500,fontSize:"11px",color:e.palette.text.primary,"&:hover":{background:"transparent"}}));var DS=(e,t)=>{let o=e||{},n={};return t?.forEach(({value:r})=>{let i=o?.[r];n[r]=i===void 0?"all":i;}),n};function LS({anchorEl:e,options:t,apiKey:o="statuses",initialStatuses:n,onCloseDropdown:r,onClear:i,onConfirm:a}){let l=!!e,s$1=Jc(useId(),"status-filter"),{t:p}=useTranslation(),[d,m]=useState(()=>DS(n,t)),c=useRef(null),[u,f]=useState(null),[g,x]=useState(null),y=(v,P)=>{f(v.currentTarget),x(P);},C=useCallback(()=>{f(null),x(null);},[]),h=useCallback(v=>{r(v),C();},[C,r]),I=()=>{let v=Object.keys(d).reduce((A,M)=>{let k=d[M];return k!=="all"&&(A[M]=k),A},{});Object.values(d).every(A=>A==="all")?i([o]):a({[o]:v});},S=s(I,r),b=v=>{I(),r(v);},T=v=>{g&&m(P=>({...P,[g]:v}));};return jsx(ClickAwayListener,{onClickAway:v=>{v.stopPropagation(),r(v);},children:jsxs(En,{id:s$1,"data-testid":"StatusFilter",ref:c,tabIndex:-1,onKeyDown:S,children:[jsxs(a$9,{open:l,anchorEl:e,children:[jsx(We,{component:"span",children:p("filterBy")}),t.map(({value:v,label:P})=>jsxs(a$5,{onClick:A=>{f(A.currentTarget);},onMouseOver:A=>{y(A,v);},sx:{minHeight:"35px",padding:"8px 16px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer","&:hover":{backgroundColor:"#fff",boxShadow:"0px 0px 16px 0px #00000021"}},hideCheckbox:true,children:[jsx(En,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:P}),jsx(En,{component:"img",src:tb$1,width:16,height:12,sx:{marginLeft:"auto"}})]},v)),jsxs(He,{children:[jsx(_e,{onClick:h,children:p("cancel")}),jsx(Oe,{onClick:b,children:p("okay")})]})]}),jsx(Popper,{open:!!u,anchorEl:u,placement:"right-start",onMouseLeave:C,children:jsx(En,{sx:{backgroundColor:"#fff",borderEndEndRadius:"8px",border:"1px solid #F2F2F2"},children:jsx(a$E,{options:[{value:"all",label:"All"},{value:"enabled",label:"Enabled"},{value:"disabled",label:"Disabled"}],value:d[g||""],onOptionChange:T})})})]})})}var kS=styled$1(motion.div,{shouldForwardProp:e=>!["notificationState","open","loading","ready","failed"].includes(e)})(({theme:e,notificationState:t,open:o,loading:n,ready:r,failed:i})=>({position:"relative",border:`1px solid ${e.palette.divider}`,padding:"0 8px",height:32,borderRadius:"4px",display:"flex",alignItems:"center",overflow:"hidden",fontSize:"11px",fontWeight:500,color:e.palette.text.primary,transition:"width 2s ease-in-out",cursor:"pointer",...(t?.success||t?.failed)&&!n&&!r&&!i&&{"&:after":{content:'""',width:7,height:7,backgroundColor:t?.failed?e.palette.common.red:e.palette.success.dark,borderRadius:"50%",position:"absolute",top:5,border:`1px solid ${e.palette.common.white}`,right:6}},...o&&{border:`1px solid ${e.palette.info.dark}`,boxShadow:e.shadows[7]}})),BS=styled$1(Box)(()=>({position:"relative"})),FS=styled$1(Box)(({theme:e})=>({background:e.palette.common.white,boxShadow:e.shadows[9],borderRadius:"4px",marginTop:"8px"})),NS=styled$1(Box)(({theme:e})=>({background:e.palette.background.transparent[2],backdropFilter:"blur(2px)",color:e.palette.text.primary,fontSize:"11px",fontWeight:500,height:31,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",overflow:"hidden",borderBottomLeftRadius:"4px",borderBottomRightRadius:"4px"})),VS=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",gap:"8px",padding:"5.5px 8px",minHeight:48,height:"auto",borderBottom:`1px solid ${e.palette.divider}`,cursor:"pointer","&:hover":{boxShadow:e.shadows[3]}})),WS=styled$1("img")(()=>({width:16,height:16,objectFit:"contain",flexShrink:0,display:"block"})),HS=styled$1(Box)(()=>({display:"flex",flexDirection:"column",gap:"2px"})),OS=styled$1(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"space-between",flex:1})),_S=styled$1(Box)(({theme:e})=>({fontSize:"11px",color:e.palette.text.primary,fontWeight:500,wordBreak:"break-all",paddingInlineEnd:"8px"})),zS=styled$1(Box)(({theme:e})=>({fontSize:"9px",color:e.palette.text.textSecondary,fontWeight:600})),US=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",gap:"8px",height:32,padding:"4px 8px",borderBottom:`1px solid ${e.palette.divider}`,cursor:"pointer","&:hover":{boxShadow:e.shadows[3]}})),$S=styled$1(Box)(({theme:e})=>({fontSize:"11px",color:e.palette.text.primary,fontWeight:400,textTransform:"uppercase"})),Gd=styled$1(Box)(({theme:e})=>({borderTop:`2px solid ${e.palette.divider}`})),Bl=styled$1(Box)(({theme:e})=>({position:"absolute",bottom:0,right:0,left:0,".MuiLinearProgress-root":{backgroundColor:e.palette.divider,height:2},".MuiLinearProgress-bar":{background:e.palette.background.gradient.shadedBlue},"&.done .MuiLinearProgress-bar":{background:e.palette.success.dark},"&.failed .MuiLinearProgress-bar":{background:e.palette.common.red}})),qt=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",gap:"8px",".MuiCircularProgress-root":{width:"14px !important",height:"14px !important",display:"flex"},".MuiCircularProgress-circle":{strokeWidth:"1.017px",stroke:alpha$1(e.palette.common.black,.62)}})),Fl=styled$1(Box)(()=>({position:"relative"})),Nl=styled$1(Box)(({theme:e})=>({position:"absolute",color:e.palette.common.black,fontSize:"7.875px",fontWeight:700,width:14,height:14,display:"flex",alignItems:"center",justifyContent:"center"})),Vl=styled$1("img")(()=>({width:14,height:14})),YS=styled$1(Box)(()=>({display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",padding:"8px"}));var KS=e=>{let t=new Date,o=Jd(e).isSame(t,"year"),n={sameDay:"DD MMM, YYYY",nextDay:"DD MMM, YYYY",lastDay:"DD MMM, YYYY",sameElse:"DD MMM, YYYY",lastWeek:"DD MMM, YYYY",nextWeek:"DD MMM, YYYY"};return o&&(n={sameDay:"DD MMM",nextDay:"DD MMM",lastDay:"DD MMM",sameElse:"DD MMM",lastWeek:"DD MMM",nextWeek:"DD MMM"}),Jd(e).calendar(null,n)},qS=(e,t)=>{let o=new Date().toISOString().split("T")[0],n=t??`file_${o}`,i=/\.(xlx|xlsx|csv|txt|doc|docx|pdf|jpg|png|gif|zip|rar)$/i.exec(e),a=i?i[0]:".csv";return `${n}${a}`};var Kd={loading:false,success:false,error:null},FF=(e=Kd,t)=>{switch(t.type){case "RESET":return Kd;case "LOADING":return {...e,loading:true};case "SUCCESS":return {...e,success:true};case "ERROR":return {...e,error:t.error};default:return e}},Wl=({onDownload:e})=>{let t=o(),[{loading:o$1,error:n,success:r},i]=useReducer(FF,Kd),a=useCallback(()=>i({type:"LOADING"}),[]),l=useCallback(()=>i({type:"SUCCESS"}),[]),s=useCallback(m=>i({type:"ERROR",error:m}),[]),p=useCallback(()=>i({type:"RESET"}),[]);useEffect(()=>{(r||n)&&setTimeout(()=>{p();},3e3);},[r,n,p]);let d=useCallback(()=>{e&&(a(),e().then(m=>{l(),Xb$1(m.url,qS(m.result_file,m.id));}).catch(m=>{s(m),t.error(m?.response?.data?.error?.message||m?.message||"Failed to download report");}));},[e,a,l,s]);return {loading:o$1,error:n,success:r,handleDownloadReport:d}};function VF({onDownload:e}){let{loading:t,error:o,success:n,handleDownloadReport:r}=Wl({onDownload:e});return t?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(qt,{children:jsxs(Fl,{children:[jsx(Nl,{children:"1"}),jsx(CircularProgress,{})]})})}):n?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(qt,{children:jsx(Vl,{src:We$1,alt:"done"})})}):o?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(qt,{children:jsx(Vl,{src:sj,alt:"failed"})})}):jsx(Vl,{onClick:r,src:Ue,alt:"reports"})}var jd=VF;function Zd(){return jsxs(YS,{children:[jsx(a$w,{width:"16px",height:"16px",variant:"rectangular"}),jsx(a$w,{width:"100%",variant:"text"}),jsx(a$w,{width:"12px",height:"12px",variant:"circular"})]})}function zF({reports:e,isLoading:t=false,onDownloadReport:o}){let n=useCallback(i=>o?o(i):Promise.reject(new Error("No download report function provided")),[o]),r=e.map(i=>{let a=Jd(i.created_at).isBefore(Jd().subtract(1,"day")),l=hc(i.result_file);return jsxs(VS,{children:[jsx(WS,{src:l,alt:"download"}),jsxs(OS,{children:[jsxs(HS,{children:[jsx(_S,{children:i.result_file}),jsx(zS,{children:a?KS(new Date(i.created_at)):Jd(new Date(i.created_at)).fromNow()})]}),jsx(jd,{onDownload:()=>n(i.id)})]})]},i.id)});return t?jsxs(Gd,{children:[jsx(Zd,{}),jsx(Zd,{})]}):jsx(Gd,{children:r})}var jS=memo(zF);function jF(e){let{progress:t,reportsQueryResult:o,isStatusReady:n,isStatusFailed:r,isLoading:i,notificationState:a,onOpenDropdown:l,onRequestReportFile:s,onOpenReportsApp:p,hideOpenReportsApp:d=false,onDownloadReport:m,customContent:c}=e,[u,f]=useState(null),{t:g}=useTranslation(),x=!!u,{data:y,isLoading:C}=o,h=useCallback(v=>{i||n||(l?.(),f(v.currentTarget));},[i,n,l]),I=useCallback(()=>{f(null);},[]),S=useCallback(()=>{i||(I(),s?.());},[i,I,s]),b=v=>{v.stopPropagation(),p?.(),I();},T=()=>i?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxs(qt,{children:[jsxs(Fl,{children:[jsx(Nl,{children:"1"}),jsx(KF,{})]}),jsx("span",{children:g("preparing")}),jsx(Bl,{children:jsx(tc,{variant:"determinate",value:t})})]})}):n?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxs(qt,{children:[jsx("img",{src:We$1,alt:"done"}),jsx("span",{children:g("ready")}),jsx(Bl,{className:"done",children:jsx(tc,{variant:"determinate",value:100})})]})}):r?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxs(qt,{children:[jsx("img",{src:sj,alt:"failed"}),jsx("span",{children:g("failed")}),jsx(Bl,{className:"failed",children:jsx(tc,{variant:"determinate",value:100})})]})}):jsx("img",{src:Ve,alt:"reports"});return jsxs(BS,{"data-testid":"TableReports_ReportsWrapper",children:[jsx(AnimatePresence,{children:jsx(a$2,{title:g("reports"),children:jsx(kS,{"data-testid":"TableReports_ExportButton",onClick:h,notificationState:a,open:x,loading:i,ready:n,failed:r,sx:{...(i||n||r)&&{borderBottom:"none"}},initial:{width:"auto"},transition:{duration:.25},children:T()})})}),x&&jsx(a$i,{onClick:I}),jsx(R1,{open:x,anchorEl:u,placement:"bottom-end",children:jsxs(FS,{sx:{width:208},children:[c?.({closeDropdown:I})??jsxs(US,{onClick:S,children:[jsx("img",{src:Se,alt:"download"}),jsx($S,{children:"csv"})]}),jsx(jS,{reports:y?.reports??[],isLoading:C,onDownloadReport:m}),!d&&jsx(NS,{onClick:b,children:g("openReportsApp")})]})})]})}var XS=memo(jF);var ZS=styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",width:54,height:18,backgroundColor:"#1F88D0",borderRadius:"2px",fontSize:"8px",fontWeight:600,color:e.palette.common.white}));function nN({onDownload:e}){let t=Jc(useId(),"download-button"),{loading:o,error:n,success:r,handleDownloadReport:i}=Wl({onDownload:e}),{t:a}=useTranslation(),l=!o&&!n&&!r;return jsx(ZS,{id:t,"data-testid":"DownloadButton",onClick:i,children:jsxs(AnimatePresence,{mode:"wait",initial:false,children:[o&&jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{display:"flex",alignItems:"center"},children:jsx(KF,{size:"10px",sx:{color:"rgba(255, 255, 255, 0.62)"}})},"loading"),!!n&&jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(a$g,{src:Sl,sx:{width:"auto",height:"auto"},alt:"error"})},"error"),l&&jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:a("download")},"text")]})})}var JS=memo(nN);var iN=JS;var aN=XS;var ue=styled(a$5)(({theme:e})=>({height:40,flex:"unset",paddingTop:0,paddingBottom:0,borderBottom:`1px solid ${e.palette.divider}`,".label":{flexGrow:1}})),ew=styled(En)(({theme:e})=>({width:36,height:24,border:`1px solid ${e.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"12px"}));function Ol({type:e}){return jsx(ew,{children:jsx(En,{component:"img",src:h$4(e),sx:{width:18,height:12,objectFit:"contain"},onError:t=>{t.currentTarget.src=h$4("card");}})})}function nc({icon:e,name:t,options:o=[],filters:n,setFilters:r}){let[i,a]=useState(null),l=n?.payment_methods??[],s=g=>{a(g.currentTarget);},p=()=>{a(null);},d=useCallback(g=>l.includes(g)??false,[l.length]),m=useMemo(()=>o?.every(g=>d(g.type)),[l.length]),c=useMemo(()=>!m&&o?.some(g=>d(g.type)),[l.length]),u=g=>{if(g.stopPropagation(),m){let x=o?.reduce((h,I)=>h.filter(S=>S!==I.type),l)??[],{payment_methods:y,...C}=n;r(x?.length>0?{...n,payment_methods:x}:C);}else r({...n,payment_methods:[...l,...o?.map(x=>x.type)??[]]});},f=(g,x)=>{g.stopPropagation(),d(x)?r({...n,payment_methods:l?.filter(y=>y!==x)??[]}):r({...n,payment_methods:[...l??[],x]});};return jsxs(ue,{isSelected:m,isIndeterminate:c,onMouseEnter:s,onMouseLeave:p,onClick:u,children:[jsx("img",{src:e,alt:t}),jsx("span",{className:"label",children:t}),jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),jsx(a$9,{open:!!i,anchorEl:i,placement:"right-end",children:o?.map(g=>jsx(ue,{isSelected:d(g.type),onClick:x=>f(x,g.type),children:jsx(Ol,{type:g.type})},g.type))})]})}function zl({paymentMethodsSource:e,filters:t,setFilters:o}){let[n,r]=useState(null),i=t?.payment_methods??[],a=!e?.options?.length,l=u=>{r(u.currentTarget);},s=()=>{r(null);},p=useMemo(()=>(e?.options??[])?.reduce((u,f)=>(u.push(...(f.options??[])?.map(g=>g.type)??[]),u),[])??[],[]),d=useMemo(()=>p?.length===i.length&&i.length>0,[i.length,p?.length]),m=useMemo(()=>!d&&i.length>0,[i.length,d]);return jsxs(ue,{isSelected:d,isIndeterminate:m,onMouseEnter:l,onMouseLeave:s,onClick:()=>{if(!a){if(d){let{payment_methods:u,...f}=t;o(f);return}o({...t,payment_methods:p});}},sx:{...a&&{opacity:.5,pointerEvents:"none"}},children:[jsx("span",{className:"label",children:e?.name}),jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),jsx(a$9,{open:!!n,anchorEl:n,placement:"right-start",children:e?.options?.map(u=>jsx(nc,{...u,filters:t,setFilters:o},u.type))})]})}function Ul({paymentSchemesSource:e,filters:t,setFilters:o}){let[n,r]=useState(null),i=t?.payment_scheme??[],a=!e?.options?.length,l=f=>{r(f.currentTarget);},s=()=>{r(null);},p=useMemo(()=>i?.length===e?.options?.length&&i.length>0,[i?.length,e?.options?.length]),d=useMemo(()=>!p&&i.length>0,[i.length,p]),m=useCallback(f=>i.includes(f)??false,[i]),c=()=>{if(!a){if(p){let{payment_scheme:f,...g}=t;o(g);return}o({...t,payment_scheme:e?.options?.map(f=>f.type)??[]});}},u=(f,g)=>{f.stopPropagation(),m(g)?o({...t,payment_scheme:i.filter(x=>x!==g)??[]}):o({...t,payment_scheme:[...t?.payment_scheme??[],g]});};return jsxs(ue,{isSelected:p,isIndeterminate:d,onMouseEnter:l,onMouseLeave:s,onClick:c,sx:{...a&&{opacity:.5,pointerEvents:"none"}},children:[jsx("span",{className:"label",children:e?.name}),jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),jsx(a$9,{open:!!n,anchorEl:n,placement:"right-start",children:e?.options?.map(f=>jsx(ue,{isSelected:m(f.type),onClick:g=>u(g,f.type),children:jsx(Ol,{type:f.type})},f.type))})]})}function Yl({filters:e,setFilters:t}){let[o,n]=useState(null),{t:r}=useTranslation(),i=useMemo(()=>e?.payment_initiated??[],[e?.payment_initiated]),a=c=>{n(c.currentTarget);},l=()=>{n(null);},s=useCallback(c=>i.includes(c),[i]),p=i?.length===ao.length,d=()=>{t?.({...e,payment_initiated:p?[]:ao.map(({key:c})=>c)});},m=c=>{t?.({...e,payment_initiated:s(c)?i?.filter(u=>u!==c):[...i,c]});};return jsxs(ue,{onMouseEnter:a,onMouseLeave:l,isSelected:p,isIndeterminate:i.length===1,onClick:d,children:[jsx("span",{className:"label",children:r("paymentInitiated")}),jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),jsx(a$9,{open:!!o,anchorEl:o,placement:"right-start",children:ao.map(({label:c,key:u})=>jsx(a$5,{isSelected:s(u),onClick:f=>{f.stopPropagation(),m(u);},children:c},u))})]})}function ic({filters:e,setFilters:t}){let[o,n]=useState(null),r=useMemo(()=>e?.payment_locations??[],[e?.payment_locations]),i=m=>{n(m.currentTarget);},a=()=>{n(null);},l=useCallback(m=>r.includes(m),[r]),s=r?.length===bo.length,p=()=>{t?.({...e,payment_locations:s?[]:bo.map(({key:m})=>m)});},d=m=>{t?.({...e,payment_locations:l(m)?r?.filter(c=>c!==m):[...r,m]});};return jsxs(ue,{onMouseEnter:i,onMouseLeave:a,isSelected:s,isIndeterminate:r.length>0&&r.length<bo.length,onClick:p,children:[jsx("span",{className:"label",children:"Payment Locations"}),jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),jsx(a$9,{open:!!o,anchorEl:o,placement:"right-start",children:bo.map(({label:m,key:c})=>jsxs(a$5,{isSelected:l(c),onClick:u=>{u.stopPropagation(),d(c);},children:[jsx(En,{sx:u=>({border:`1px solid ${u.palette.divider}`,borderRadius:"20px",width:36,height:24,display:"flex",alignItems:"center",justifyContent:"center"}),children:jsx(b$4,{sx:{visibility:"visible",width:15,height:9.176},variant:m})}),m]},c))})]})}function Kl({filters:e,setFilters:t}){let[o,n]=useState(null),{t:r}=useTranslation(),i=useMemo(()=>e?.authentication_type??[],[e?.authentication_type]),a=c=>{n(c.currentTarget);},l=()=>{n(null);},s=useCallback(c=>i.includes(c),[i]),p=i?.length===co.length,d=()=>{t?.({...e,authentication_type:p?[]:co.map(({key:c})=>c)});},m=c=>{t?.({...e,authentication_type:s(c)?i?.filter(u=>u!==c):[...i,c]});};return jsxs(ue,{onMouseEnter:a,onMouseLeave:l,isSelected:p,isIndeterminate:i.length>0&&i.length<co.length,onClick:d,children:[jsx("span",{className:"label",children:r("authenticationType")}),jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),jsx(a$9,{open:!!o,anchorEl:o,placement:"right-start",children:co.map(({label:c,key:u})=>jsx(a$5,{isSelected:s(u),onClick:f=>{f.stopPropagation(),m(u);},children:c},u))})]})}function aw({filters:e,setFilters:t,anchorEl:o,showPaymentSchemes:n=true,showPaymentMethods:r=true,showPaymentInitiated:i=true,showPaymentLocations:a=false,showAuthenticationType:l=false,paymentMethodsSource:s$1,paymentSchemesSource:p,onCloseDropdown:d,onConfirm:m}){let{t:c}=useTranslation(),u=Jc(useId(),"payment-source-filter"),f=!!o,g=()=>m?.(),x=s(g,d),y=C=>{g(),d(C);};return jsxs(a$9,{id:u,"data-testid":"PaymentSourceFilter",open:f,anchorEl:o,sx:{marginTop:"8px",marginBottom:"8px"},onKeyDown:x,dropdownProps:{tabIndex:-1,autoFocus:true},children:[jsx(We,{component:"span",children:c("filterBy")}),r&&jsx(zl,{filters:e,setFilters:t,paymentMethodsSource:s$1}),n&&jsx(Ul,{filters:e,setFilters:t,paymentSchemesSource:p}),i&&jsx(Yl,{filters:e,setFilters:t}),l&&jsx(Kl,{filters:e,setFilters:t}),a&&jsx(ic,{filters:e,setFilters:t}),jsxs(He,{children:[jsx(_e,{onClick:d,children:c("cancel")}),jsx(Oe,{onClick:y,children:c("okay")})]})]})}var lc=[{label:vo.C,value:"C"},{label:vo.F,value:"F"}],FN=({filters:e,setFilters:t})=>{let[o,n]=useState(null),r=!!o,i=e?.auth_mode??[],a=f=>{r||n(f.currentTarget);},l=()=>{r&&n(null);},s=useMemo(()=>lc.map(f=>f.value),[]),p=useMemo(()=>lc.length===i.length&&i.length>0,[i.length,s?.length]),d=useMemo(()=>!p&&i.length>0,[i.length,p]),m=()=>{if(p){let{auth_mode:f,...g}=e;t(g);return}t({...e,auth_mode:s});},c=useCallback(f=>i.includes(f)??false,[i.length]),u=(f,g)=>{f.stopPropagation(),c(g)?t({...e,auth_mode:i?.filter(x=>x!==g)??[]}):t({...e,auth_mode:[...i??[],g]});};return jsxs(ue,{isSelected:p,isIndeterminate:d,onMouseEnter:a,onMouseLeave:l,onClick:m,children:[jsx("span",{className:"label",children:"Authentication Mode"}),jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),jsx(a$9,{open:r,anchorEl:o,placement:"right-start",children:lc.map(f=>jsxs(a$5,{isSelected:c(f.value),onClick:g=>u(g,f.value),children:[jsx(Ux,{mode:f.value}),f.label]},f.value))})]})};var NN=styled(a$3)(()=>({fontSize:"11px"})),sw=styled(En)(()=>({display:"flex",alignItems:"center",gap:"4px",width:"100%",paddingInline:"16px"})),pw=styled(En)(({theme:e})=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"flex-end",position:"sticky",bottom:0,backgroundColor:"white",zIndex:99999,borderTop:`1px solid ${e.palette.divider}`})),mw=styled(b$2)(({theme:e})=>({textTransform:"capitalize",minWidth:"auto",width:70,borderRadius:"4px",border:`1px solid ${e.palette.info.dark}`,backgroundColor:e.palette.info.dark,fontWeight:700,fontSize:"11px",color:e.palette.common.white,"&:hover":{backgroundColor:e.palette.info.dark},"&.Mui-disabled":{color:"#fff !important",opacity:.5}})),dw=styled(b$2)(({theme:e})=>({textTransform:"capitalize",minWidth:"auto",width:70,borderRadius:"4px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.common.white,fontWeight:500,fontSize:"11px",color:e.palette.text.primary,"&:hover":{background:"transparent"}})),cw=styled(En)(()=>({display:"flex",flexDirection:"column",gap:"8px",marginBottom:"8px"})),sc=styled(NN)(()=>({fontSize:"11px",fontWeight:500,color:"#8D8D94",padding:"8px 16px"})),uw=styled(En)(({theme:e})=>({borderBlock:`1px solid ${e.palette.divider}`,display:"flex",justifyContent:"space-between",alignItems:"center",gap:"2px",width:"100%"})),fw=styled(En)(({theme:e})=>({...b$3(e),width:"auto",marginTop:"8px","&:focus":{outline:"none"}})),gw=styled(sc)(()=>({color:"#1F88D0",padding:"4px 24px",cursor:"pointer"})),xw=styled(b$2,{shouldForwardProp:e=>e!=="open"})(({open:e,theme:t})=>({color:t.palette.text.primary,fontSize:"11px",fontWeight:500,padding:t.spacing(1),borderRadius:"4px",border:"1px solid",borderColor:t.palette.divider,background:t.palette.common.white,textTransform:"none",width:"100%",height:32,justifyContent:"space-between",gap:"4px",...e&&{border:"1px solid",borderColor:t.palette.info.dark,boxShadow:t.shadows[7]}}));function hw({dateRange:e,onDateRangeChange:t,calendarMode:o,onCalendarModeChange:n,timezone:r,browserTimezone:i,defaultCountryTimezone:a,onTimezoneChange:l,timezoneCountriesCodes:s$1=[],onConfirm:p,onCloseDropdown:d}){let m=Jc(useId(),"date-filter"),{t:c}=useTranslation(),u=useRef(null),f=()=>p(e),g=s(f,d),x=I=>{t(I),requestAnimationFrame(()=>u.current?.focus());},y=I=>{f(),d(I);},C=useCallback(I=>n(I),[n]),h=I=>{if(!I)return "";let[S,b]=I,T=Jd(S).format("MMM D"),v=Jd(b).format("MMM D");return T===v?T:`${T} - ${v}`};return jsxs(fw,{ref:u,tabIndex:-1,onKeyDown:g,id:m,"data-testid":"DateFilter",children:[jsxs(cw,{children:[jsx(uw,{children:jsx(sc,{component:"span",children:c("filterBy")})}),jsx(sw,{children:jsx(a$t,{defaultDate:e||y$1(0),onDateChange:x,maxDateRange:365,mode:o,onCalendarModeSwitch:C,browserTimezone:i,defaultCountryTimezone:a,timezone:r,onChangeTimezone:l,timezoneCountriesCodes:s$1,mainSx:{width:"100%"},popperProps:{placement:"right-start"},renderCalendarButton:(I,S)=>jsxs(xw,{open:I,onClick:S,children:[jsx("span",{children:h(e)||"Date"}),jsx(a$g,{src:Pj,alt:"selected",sx:{width:16,height:16}})]})},h(e))}),e&&jsx(gw,{component:"span",onClick:()=>t(void 0),children:"Clear"})]}),jsxs(pw,{children:[jsx(dw,{onClick:d,children:c("cancel")}),jsx(mw,{onClick:y,children:c("okay")})]})]})}var Hw=b$1(Ww(),1);function Ow({selectedCurrencies:e,onCurrenciesChange:t,merchantCurrencies:o,anchorEl:n,onCloseDropdown:r,onConfirm:i}){let a=Jc(useId(),"currency-filter"),l=!!n,{t:s$1}=useTranslation(),p=useMemo(()=>(0, Hw.default)(o,"currencyCode"),[o]),d=()=>i(e),m=s(d,r),c=g=>{d(),r(g);},u=g=>e?.includes(g)??false,f=g=>{if(e?.indexOf(g)!==-1){let x=e?.filter(y=>y!==g)??[];t(x.length>0?x:[]);return}t([...e,g]);};return jsxs(a$9,{id:a,"data-testid":"CurrencyFilter",open:l,anchorEl:n,sx:{marginTop:"8px",marginBottom:"8px"},onKeyDown:m,dropdownProps:{tabIndex:-1,autoFocus:true},children:[jsx(We,{component:"span",children:s$1("filterBy")}),p.map(({currencyCode:g})=>jsxs(a$5,{isSelected:u(g),onClick:()=>{f(g);},children:[jsx(a$f,{currencyCode:g}),g]},g)),jsxs(He,{children:[jsx(_e,{onClick:r,children:s$1("cancel")}),jsx(Oe,{onClick:c,children:s$1("okay")})]})]})}var xV=styled(a$5)(({theme:e})=>({height:40,flex:"unset",paddingTop:0,paddingBottom:0,borderBottom:`1px solid ${e.palette.divider}`,".label":{flexGrow:1}})),_w=styled(a$9)(()=>({marginBottom:"8px"}));styled(a$9)(()=>({marginTop:"-1px","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"}}));var zw=styled(a$9)(()=>({"& .MuiMenuItem-root:hover":{boxShadow:"0px 0px 16px 0px #00000021"}})),Uw=styled(a$5)(({theme:e})=>({height:40,flex:"unset",paddingTop:0,paddingBottom:0,borderBottom:`1px solid ${e.palette.divider}`,paddingLeft:"16px",maxHeight:"35px",".label":{flexGrow:1}})),$w=styled(xV)(()=>({gap:"8px",paddingInline:"16px",paddingY:"8px",maxHeight:"35px","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"}}));function dc({selectedCurrencies:e=[],onCurrenciesChange:t,merchantCurrencies:o}){let{t:n}=useTranslation(),[r,i]=useState(null),a=useRef(null),l=useMemo(()=>[...new Set(o.map(f=>f.currencyCode))],[o]),s=u=>{i(u.currentTarget);},p=()=>{i(null);},d=()=>{a.current&&i(a.current);},m=u=>{let f=e.includes(u)?e.filter(x=>x!==u):[...e,u],g=f.length>0?f:[];t(g);},c=u=>e.includes(u);return jsxs(Uw,{ref:a,onMouseEnter:s,onMouseLeave:p,hideCheckbox:true,children:[jsx("span",{className:"label",children:n("Currency")}),jsx("img",{src:tb$1,alt:"arrow",style:{height:12}}),jsx(zw,{open:!!r,anchorEl:r,placement:"right-start",onMouseEnter:d,onMouseLeave:p,children:l.map(u=>jsxs($w,{isSelected:c(u),onClick:f=>{f.stopPropagation(),m(u);},children:[jsx(a$f,{currencyCode:u}),u]},u))})]})}function Kw({anchorEl:e,onCloseDropdown:t,options:o,label:n,onConfirm:r,onClear:i,selectedCurrencies:a,onCurrenciesChange:l,selectedRadioValue:s$1,onRadioButtonChange:p,showCurrencyMenu:d,merchantCurrencies:m}){let c=Jc(useId(),"amount-conversion-filter"),u=!!e,{t:f}=useTranslation(),g=()=>r(),x=s(g,t),y=h=>{g(),t(h);},C=h=>{i(),t(h);};return jsxs(_w,{id:c,"data-testid":"AmountConversionFilter",open:u,anchorEl:e,onKeyDown:x,children:[jsx(We,{component:"span",children:f("filterBy")}),jsx(Mn,{menuLabel:n,options:o,selectedValue:s$1,onValueChange:p}),d&&jsx(dc,{selectedCurrencies:a,onCurrenciesChange:l,merchantCurrencies:m}),jsxs(He,{children:[jsx(_e,{onClick:C,children:f("cancel")}),jsx(Oe,{onClick:y,children:f("okay")})]})]})}function Xw({options:e,selectedFilters:t,onChange:o}){let[n,r]=useState(null),[i,a]=useState(null),l=useCallback(()=>{r(null),a(null);},[]),s=m=>m==="all"?void 0:m==="enabled",p=m=>{i&&o({[i]:s(m)});},d=useMemo(()=>{let m=t?.[i||""];return m===void 0?"all":m?"enabled":"disabled"},[t,i]);return jsxs(Fragment,{children:[e.map(({label:m,value:c},u)=>jsxs(a$5,{onMouseOver:f=>{r(f.currentTarget),a(c);},sx:{minHeight:"35px",padding:"8px 16px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer","&:hover":{backgroundColor:"#fff",boxShadow:"0px 0px 16px 0px #00000021"},...u===e.length-1&&{borderBottom:"1px solid #F2F2F2"}},hideCheckbox:true,children:[jsx(En,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:m}),jsx(En,{component:"img",src:tb$1,width:16,height:12,sx:{marginLeft:"auto"}})]},c)),jsx(Popper,{open:!!n,anchorEl:n,placement:"right-start",onMouseLeave:l,children:jsx(En,{sx:{backgroundColor:"#fff",borderEndEndRadius:"8px",border:"1px solid #F2F2F2"},children:jsx(a$E,{options:[{value:"all",label:"All"},{value:"enabled",label:"Available"},{value:"disabled",label:"Not Available"}],value:d,onOptionChange:p})})})]})}var rv=b$1(a$a(),1);var Jw=styled(a$9)(()=>({marginBottom:"8px"})),Qw=styled(a$7)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,".icon":{width:14}})),ev=styled(En)(()=>({padding:"8px 16px","> div + div":{marginTop:"8px"}})),tv=styled(wb)(({theme:e})=>({color:e.palette.info.dark,fontSize:"11px",textTransform:"capitalize",padding:"4px 9px",minWidth:"auto","&:hover":{background:"transparent"}})),ov=styled(En)(({theme:e})=>({padding:"0 16px 8px",textAlign:"left",borderBottom:`1px solid ${e.palette.divider}`}));function iv({selectedRadioValue:e,onRadioButtonChange:t,radioOptions:o,label:n,onConfirm:r,onClear:i,inputValues:a,onInputValuesChange:l,anchorEl:s$1,onCloseDropdown:p,inputFilters:d=[]}){let m=Jc(useId(),"reference-type-filter"),{t:c}=useTranslation(),u=()=>r(),f=s(u,p),g=S=>{u(),p(S);},x=S=>{i(),p(S);},y=S=>a?.[S]!==void 0&&a?.[S].length>0,C=S=>{y(S)&&l({...a,[S]:""});},h=useMemo(()=>(0, rv.default)(a).some(S=>!!S),[a]),I=()=>{l(d.reduce((S,{apiKey:b})=>({...S,[b]:""}),{}));};return jsxs(Jw,{id:m,"data-testid":"ReferenceTypeFilter",open:!!s$1,anchorEl:s$1,onKeyDown:f,children:[jsx(We,{component:"span",children:c("filterBy")}),jsx(Mn,{menuLabel:n,options:o,selectedValue:e,onValueChange:t}),d.length>0&&jsx(ev,{"data-testid":"ColumnFilterInputs_inputs",component:"main",children:d.map(({apiKey:S,placeholder:b})=>jsx(Qw,{className:"input","data-testid":"ColumnFilterInputs_InputStyled",name:S,placeholder:b,onChange:T=>{l({...a,[S]:T.target.value});},defaultValue:a?.[S]??"",value:a?.[S],inputProps:{autoComplete:"off","data-testid":"ColumnFilterInputs_input"},endAdornment:jsx(Box,{component:"img","data-testid":"ColumnFilterInputs_icon","data-icon":y(S)?"close":"search",src:y(S)?ei:A,alt:"search",className:"icon",sx:{cursor:y(S)?"pointer":"default"},onClick:()=>{C(S);}})},S))}),jsx(Collapse,{in:h,component:"section","data-testid":"ColumnFilterInputs_Collapse",children:jsx(ov,{"data-testid":"ColumnFilterInputs_ClearWrapper",children:jsx(tv,{type:"button",onClick:I,"data-testid":"ColumnFilterInputs_ClearButton",children:c("clear")})})}),jsxs(He,{children:[jsx(_e,{onClick:x,children:c("cancel")}),jsx(Oe,{onClick:g,children:c("okay")})]})]})}var av=styled(En)(()=>({maxHeight:"210px",maxWidth:"177px",overflowY:"auto",padding:0})),lv=styled(a$5)(()=>({padding:"12px 16px",border:"none !important","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"},maxHeight:35,minHeight:35})),sv=styled(En)(()=>({display:"flex",flexDirection:"column",gap:"2px"})),pv=styled(En)(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:"9px"})),mv=styled(En)(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"120px"})),dv=styled(a$9)(()=>({marginBottom:"8px"}));function uv({anchorEl:e,onCloseDropdown:t,list:o,apiKey:n,placeholder:r,onConfirm:i,onClear:a,onClickItem:l,inputValue:s$1,onInputValueChange:p,selectedListItems:d}){let m=Jc(useId(),"list-column-filter"),{t:c}=useTranslation(),u=()=>i(),f=s(u,t),g=T=>{u(),t(T);},x=T=>{a?.(),t(T);},y=!!s$1.trim().length,C=()=>{y&&p("");},h=T=>{p(T);},I=useMemo(()=>y?o?.filter(T=>T.name.toLowerCase().includes(s$1.trim().toLowerCase())):o,[s$1,y,o]),S=y&&!I.length||!o.length,b=useMemo(()=>new Set(d),[d]);return jsxs(dv,{id:m,"data-testid":"ListColumnFilter",open:!!e,anchorEl:e,onKeyDown:f,children:[jsx(We,{component:"span",children:c("filterBy")}),!!o?.length&&jsx(a$m,{value:s$1,name:n,placeholder:r,onSearchChange:h,onSearchReset:C}),jsx(av,{children:S?jsx(Box,{sx:{p:1,textAlign:"center",fontSize:"11px"},children:"No data available"}):I?.map((T,v)=>jsx(lv,{isSelected:b.has(T?.id),onClick:()=>{l(T?.id);},children:jsxs(sv,{children:[jsx(mv,{children:T.name}),jsx(pv,{component:"span",children:T.id})]})},`${T.id}-${v}`))}),jsxs(He,{children:[jsx(_e,{onClick:x,children:c("cancel")}),jsx(Oe,{onClick:g,children:c("okay")})]})]})}var xv=b$1(gb(),1);var kn={verified:rj,reviewed:oj,completed:oj,incomplete:qj,complete:oj,rejected:sj,default:qj},fv={incomplete:"#D9D9D929",completed:"#11D0FA29",complete:"#11D0FA29",reviewed:"#11D0FA29",verified:"#2ACE0029",rejected:"#FF3D0029"};var VV=({status:e})=>jsx(a$2,{title:(0, xv.default)(e),children:jsx("img",{loading:"lazy",src:kn[e?.toLowerCase()||""]||kn.default,alt:e,width:10.5,height:10.5})});var Cv=b$1(gb(),1);var OV=({status:e})=>jsx(Tooltip,{title:(0, Cv.default)(e),children:jsx(Box,{component:"li",sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",borderRadius:"50%",backgroundColor:fv[e]},children:jsx("img",{loading:"lazy",src:kn[e?.toLowerCase()||""]||kn.default,alt:e,width:10.5,height:10.5})})});var wd=(n=>(n.CHECKED="CHECKED",n.UNCHECKED="UNCHECKED",n.INDETERMINATE="INDETERMINATE",n))(wd||{});styled("img",{shouldForwardProp:e=>e!=="expanded"})(({theme:e,expanded:t})=>({transform:t?"rotate(180deg)":"rotate(0deg)",marginLeft:"auto",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest})}));styled(En)(()=>({display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"4px",borderTop:"1px solid #F2F2F2"}));var gc=styled(a$5)({minWidth:120,minHeight:36,maxHeight:36,paddingTop:0,paddingBottom:0,backgroundColor:"#fff","--menuitem-border-rad":"4px","&:hover":{boxShadow:"0px 0px 16px rgba(0, 0, 0, 0.13)",zIndex:1}}),xc=styled(e=>jsx(gc,{hideCheckbox:true,...e}))(({theme:e})=>({fontSize:11,fontWeight:500,color:e.palette.grey[700],minHeight:36,maxHeight:"auto",cursor:"auto",":hover":{boxShadow:"none",zIndex:1}}));var Cc=createContext({treeMapper:{},handleSelect:()=>{},multiple:false}),YV=({children:e,treeMapper:t,handleSelect:o,multiple:n,IconComponent:r})=>{let i=useMemo(()=>({treeMapper:t,handleSelect:o,multiple:n,IconComponent:r}),[t,o,n,r]);return jsx(Cc.Provider,{value:i,children:e})},hv=YV;var qV=()=>{let e=useContext(Cc);if(!e)throw new Error("'useTreeDropdown' must be used within an 'TreeDropdownProvider'");return e},es=qV;var Tv=styled(a$b)(({theme:e})=>({padding:0,paddingRight:"4px",width:"14px !important",svg:{width:"12px !important",height:"12px !important"},"&.Mui-disabled":{'[data-testid="IndeterminateCheckBoxIcon"]':{fill:alpha(e.palette.common.black,.26)}}})),Sv=styled(a$c)({padding:0}),wv=styled(En)(()=>({display:"flex",gap:"8px",justifyContent:"space-between",flexGrow:1,width:"100%",alignItems:"center",minWidth:0})),vv=styled(e=>jsx(sS,{noWrap:true,component:"span",...e}))(({theme:e})=>({flex:1,fontSize:"inherit",width:"100%",display:"inline-block",color:e.palette.text.primary})),Ev=styled(e=>jsx(sS,{noWrap:true,...e}))(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:8})),Pv=styled(En,{shouldForwardProp:e=>e!=="isOneDigit"})(({theme:e,isOneDigit:t=true})=>({borderRadius:t?"50%":"4px",background:e.palette.divider,width:t?13:"auto",height:14,fontSize:"8px",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"10px",...!t&&{padding:"0 3px"}})),Mv=styled("img")(()=>({height:12}));var XV=e=>{let{checked:t,indeterminate:o,onSelect:n}=e,{multiple:r}=es(),i=useCallback(a=>{a.stopPropagation(),n(a);},[n]);return r?jsx(Tv,{size:"small",checked:t,indeterminate:o,onChange:i}):jsx(Sv,{size:"small",checked:t,onChange:i})},Rv=XV;var eW=e=>{let{renderItem:t,header:o,footer:n,...r}=e,{treeMapper:i,handleSelect:a,multiple:l,IconComponent:s}=es(),{label:p,icon:d,iconComponent:m,levelIndex:c=0,children:u,nestedMenuSx:f,hintText:g,disableHovering:x,itemProps:y,searchProps:C,subLevelKey:h}=r,[I,S]=useState(null),b=!!u,T=u?.length,v=useCallback($=>{x||S($.currentTarget);},[x]),P=useCallback(()=>{x||S(null);},[x]);useEffect(()=>{x&&S(null);},[x]);let A=useMemo(()=>m||(d&&s?jsx(s,{fileId:d.fileId,width:d.width??20,height:d.height??20}):null),[m,d,s]),M=i[r.id]?.status==="CHECKED",k=l?i[r.id]?.status==="INDETERMINATE":false,W=l||!b,V=useCallback($=>{$.stopPropagation(),a($.target.checked,r);},[a,r]);return jsxs(gc,{hideCheckbox:true,onMouseEnter:v,onMouseLeave:P,"data-testid":r.id,onClick:()=>{a(!M,r);},...y,children:[t?t({nodeProps:r,checked:M,indeterminate:k,onSelect:V}):jsxs(wv,{width:"100%","data-testid":"Content",children:[W&&jsx(Rv,{checked:M,indeterminate:k,onSelect:V}),A,jsxs(Stack,{flex:1,width:"100%",minWidth:0,children:[jsx(vv,{title:typeof p=="string"?p:void 0,children:p}),g&&jsx(Ev,{title:typeof g=="string"?g:void 0,children:g})]}),jsxs(Stack,{direction:"row",alignItems:"center",spacing:.5,children:[T&&jsx(Pv,{isOneDigit:Math.floor(T/10)===0,children:T}),b&&jsx(Mv,{src:ub$1,alt:"Expand"})]})]}),!!u&&jsx(os,{anchorEl:I,menuItems:u,levelIndex:c+1,sx:f,header:o,levelKey:h,footer:n,searchProps:C})]})},kv=eW;var Bv=kv;var Fv=styled(a$9)({maxHeight:"100%"}),Nv=styled("div")({position:"relative","&:before, &:after":{display:"none"},"&.scrollable":{position:"relative","&::before, &::after":{display:"block",content:'""',position:"absolute",left:0,width:"100%",height:"20px",opacity:1,pointerEvents:"none",zIndex:2,transition:"opacity 0.3s ease-out"},"&::before":{top:0,background:"linear-gradient(to top, transparent, rgba(255, 255, 255, 1))"},"&::after":{bottom:0,background:"linear-gradient(to bottom, transparent, rgba(255, 255, 255, 1))"}},"&.scrolled-to-top":{"&::before":{opacity:0}},"&.scrolled-to-bottom":{"&::after":{opacity:0}}}),Vv=styled("ul")({listStyle:"none",padding:0,margin:0,maxHeight:300,overflow:"auto"}),Wv=styled(a$7)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,"& .MuiInputBase-input":{color:"#000000"},".icon":{width:14}}));var rW=({children:e,onScroll:t})=>{let o=useRef(null),{scrolledToBottom:n,scrolledToTop:r,scrollable:i,handleScroll:a}=p({containerRef:o}),l=useMemo(()=>[n&&"scrolled-to-bottom",r&&"scrolled-to-top",i&&"scrollable"].filter(Boolean).join(" "),[n,r,i]),s=useCallback(p=>{t(p),a(p);},[t,a]);return jsx(Nv,{sx:{position:"relative"},className:l,children:jsx(Vv,{ref:o,onScroll:s,children:e})})},Ov=rW;var nE=b$1(Qv(),1);var vW=e=>{let{initialValue:t="",getValues:o,filterItem:n,onChange:r,items:i,enabled:a=false,debounceMs:l=300}=e,[s,p]=useState(t),[d,m]=useState(t),c=useMemo(()=>(0, nE.default)(x=>{m(x);},l),[l]);useEffect(()=>(c(s),()=>c.cancel()),[c,s]);let u=useCallback(x=>{let y=x.target.value;p(y),c(y),r?.(x);},[r,c]),f=useCallback(()=>{p(""),m(""),c.cancel(),r?.({target:{value:""}});},[r,c]),g=useMemo(()=>{if(!a||!d.trim())return i;let x=d.toLowerCase();return n?i.reduce((y,C)=>{let h=n(C,x);return h&&y.push(h),y},[]):o?i.filter(y=>o(y).some(C=>C.toLowerCase().includes(x))):(console.error("`searchProps.getValues` is required for searching, provide it on the tree node level or the global search props"),i)},[i,d,o,n,a]);return {searchText:s,filteredItems:g,handleSearch:u,handleReset:f}},rE=vW;var LW=e=>{let{anchorEl:t,sx:o,levelIndex:n=0,placement:r,menuItems:i,header:a,footer:l,levelKey:s,searchProps:p}=e,[d,m]=useState(false),c=!!t,u=!!p,{searchText:f,filteredItems:g,handleSearch:x,handleReset:y}=rE({...p,enabled:u,items:i}),C=useRef(),h=useCallback(()=>{m(true),clearTimeout(C.current),C.current=setTimeout(()=>{m(false);},100);},[]);return useEffect(()=>()=>clearTimeout(C.current),[]),jsx(Fv,{open:c,anchorEl:t,placement:n>0?"right-start":r,"data-level":n,"data-level-key":s,onClick:I=>I.stopPropagation(),sx:{...o,"&.MuiPopper-dropdown":{"&:after":{display:"none"}}},children:jsxs(aE,{divider:jsx(iE,{flexItem:true}),children:[a&&jsx(xc,{children:a}),u&&jsxs(aE,{divider:jsx(iE,{flexItem:true,sx:{my:1}}),children:[jsx(En,{sx:{p:1},children:jsx(Wv,{...p?.inputProps,placeholder:p?.inputProps?.placeholder??"Search...",onChange:x,value:f,inputProps:{autoComplete:"off"},endAdornment:jsx(En,{component:"img","data-icon":f?"close":"search",src:f?ei:A,alt:"search",className:"icon",...f&&{sx:{cursor:"pointer"}},onClick:y})})}),g.length===0&&p?.noResultsText&&jsx(sS,{component:"div",fontSize:10,color:I=>alpha(I.palette.text.primary,.4),textAlign:"center",minHeight:36,fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",children:jsx("span",{children:"No results found"})})]}),jsx(Ov,{onScroll:h,children:g.map((I,S)=>jsx(Bv,{disableHovering:d,...I,levelIndex:n,subLevelKey:I.levelKey,nestedMenuSx:o},`${n}-${I.id}-${S}`))}),l&&jsx(xc,{children:l})]})})},os=LW;function kW(e){function t(o){let n=o.children?o.children.map(t):void 0;if(n?.length===1&&n[0].children?.length&&!n[0].disablePromotion){let r=n[0];n=r.children,o={...o,header:r.header??o.header,footer:r.footer??o.footer,searchProps:r.searchProps??o.searchProps};}return {...o,children:n}}return e.map(t)}function mE(e,t,o=[]){for(let n of e)n.status==="CHECKED"&&o.push(n.id),n.children&&mE(n.children,t,o);return o}function dE(e,t=[],o={},n=false){for(let r of e){let i=n?"CHECKED":r.status??"UNCHECKED";o[r.id]={status:i,...t.length?{_parents:t}:{}},r.children&&dE(r.children,[...t,r.id],o,i==="CHECKED");}return o}function cE(e,t){let o=dE(e),n=mE(e,t),r=o;for(let i of n)r=Ic(r,i,true);return r}function uE(e,t){return e.map(o=>({...o,status:t[o.id]?.status??"UNCHECKED",children:o.children?uE(o.children,t):void 0}))}function BW(e){let t={};for(let o of Object.keys(e)){let n=e[o]._parents;if(!n?.length)continue;let r=n[n.length-1];t[r]??(t[r]=[]),t[r].push(o);}return t}function Ic(e,t,o){let n=structuredClone(e),r=BW(e),i=o?"CHECKED":"UNCHECKED";function a(s){n[s].status=i;for(let p of r[s]??[])a(p);}function l(s){let p=n[s]._parents;if(!p?.length)return;let d=p[p.length-1],c=(r[d]??[]).map(u=>n[u].status);c.every(u=>u==="CHECKED")?n[d].status="CHECKED":c.every(u=>u==="UNCHECKED")?n[d].status="UNCHECKED":n[d].status="INDETERMINATE",l(d);}return a(t),l(t),n}function FW(e){function t(o){let n=o.children?.map(t).filter(Boolean);return o.status==="CHECKED"||o.status==="INDETERMINATE"||n&&n.length>0?{...o,children:n}:null}return e.map(t).filter(Boolean)}function pE(e){let t={};for(let o in e)t[o]={status:"UNCHECKED",...e[o]._parents?{_parents:e[o]._parents}:{}};return t}function fE(e,t,o,n){if(n)return Ic(e,t,o);if(!o)return pE(e);let r=pE(e);return Ic(r,t,true)}function NW(e,t){let o=[];function n(r){r.levelKey===t&&o.push(r),r.children?.forEach(i=>n(i));}return e.forEach(n),o}var we={denormalizeTree:bc((e,t)=>uE(e,t)),extractSelectedBranches:bc(e=>FW(e)),filterNodesByLevelKey:bc((e,t)=>NW(e,t))};function Tc(e){let t=kW(e.children??[]);if(t.length===1&&t[0].children?.length&&!t[0].disablePromotion){let[o]=t;return Tc({levelKey:o.levelKey,children:o.children,header:o.header??e.header,footer:o.footer??e.footer,searchProps:o.searchProps??e.searchProps})}return {...e,children:t}}var UW=forwardRef((e,t)=>{let{anchorEl:o,placement:n="bottom-start",treeDefinition:r,sx:i,onChange:a,multiple:l=true,exposeOnlySelectedTree:s=false,IconComponent:p,onMounted:d}=e,{children:m=[]}=r,c=useMemo(()=>Tc(r),[r]),{header:u,footer:f,children:g=[],searchProps:x,levelKey:y}=c,[C,h]=useState({}),I=useRef(d);I.current=d;let S=useCallback(()=>we.denormalizeTree(m,C),[m,C]),b=useCallback(()=>we.extractSelectedBranches(S()),[S]),T=useCallback((P,A)=>{let M=fE(C,A.id,P,l);h(M),a&&a(s?we.extractSelectedBranches(we.denormalizeTree(m,M)):we.denormalizeTree(m,M));},[a,m,C,l,s]),v=useCallback(P=>{let M=((k,W)=>{let V={...k};return Object.keys(V).forEach($=>{V[$]={...V[$],status:W?"CHECKED":"UNCHECKED"};}),V})(C,P);h(M),a&&a(s?we.extractSelectedBranches(we.denormalizeTree(m,M)):we.denormalizeTree(m,M));},[C,a,m,s]);return useEffect(()=>{let P=cE(m||[],l);h(P);let A=we.denormalizeTree(m,P),M=we.extractSelectedBranches(A);I.current?.({state:P,tree:A,selectedTree:M});},[m,l]),useImperativeHandle(t,()=>({treeMapper:C,getFullTree:S,getSelectedTree:b,toggleAll:v}),[C,S,b,v]),jsx(hv,{treeMapper:C,IconComponent:p,handleSelect:T,multiple:l,children:jsx(os,{anchorEl:o,sx:i,header:u,footer:f,menuItems:g,levelKey:y,searchProps:x,placement:n})})}),xE=UW;var Ed=xE;var hE=styled(Box)({width:"100%",display:"flex",flexDirection:"column"}),yE=styled(Typography)(({theme:e})=>({fontSize:10,fontWeight:500,color:e.palette.grey[700]})),bE=styled(Box)(({theme:e})=>({display:"flex",flexDirection:"column",gap:8,border:`1px solid ${e.palette.divider}`,borderRadius:4,padding:"6px 8px",backgroundColor:e.palette.common.white})),IE=styled(Box)({display:"flex",alignItems:"center",justifyContent:"space-between"}),TE=styled(Typography)({textAlign:"right",fontSize:12,fontWeight:500}),Sc=styled(Typography)(({theme:e})=>({fontSize:11,fontWeight:500,color:alpha(e.palette.text.primary,.5)})),SE=styled(Typography)({fontSize:12,fontWeight:600}),wE=styled(Box)({marginTop:16});function EE({value:e,min:t,max:o,step:n,disabled:r$1,currency:i="KWD",onChange:a,label:l,minLabel:s,maxLabel:p,feedback:d,formatValue:m=r,hideCurrency:c=false}){let u=Jc(useId(),"amount-slider"),f=b$8(d);return jsxs(hE,{id:u,"data-testid":"AmountSlider",children:[jsxs(bE,{children:[jsx(yE,{children:l??"Amount"}),jsxs(IE,{children:[!c&&jsxs(aE,{direction:"row",spacing:.5,alignItems:"center",children:[jsx(a$f,{currencyCode:i}),jsx(SE,{children:i})]}),jsx(TE,{children:m(e)})]})]}),f?jsx(g$1,{...f}):null,jsx(wE,{children:jsx(a$p,{value:e,min:t,max:o,step:n,disabled:r$1,onChange:a})}),jsxs(aE,{direction:"row",justifyContent:"space-between",marginTop:1.5,children:[jsxs(Sc,{children:[s??"Min"," ",m(t)]}),jsxs(Sc,{children:[p??"Max"," ",m(o)]})]})]})}EE.displayName="AmountSlider";var CE=memo(EE);
2
+ export{SM as $,am as $a,Qm as $b,FN as $c,sp as A,QA as Aa,u1 as Ab,kk as Ac,f_ as B,Hh as Ba,$a as Bb,hT as Bc,YP as C,qh as Ca,f1 as Cb,Pd as Cc,XP as D,ty as Da,Tm as Db,dae as Dc,e0 as E,dD as Ea,Sm as Eb,HT as Ec,i0 as F,CD as Fa,wm as Fb,_T as Fc,s0 as G,uy as Ga,ub as Gb,UT as Gc,d0 as H,TD as Ha,g1 as Hb,YT as Hc,S5 as I,by as Ia,x1 as Ib,PB as Ic,C0 as J,My as Ja,C1 as Jb,VB as Jc,b0 as K,RD as Ka,vm as Kb,oS as Kc,E0 as L,HD as La,Ya as Lb,bF as Lc,h4 as M,jq as Ma,Ga as Mb,Mn as Mc,S4 as N,jD as Na,gn as Nb,We as Nc,M4 as O,_ as Oa,Lm as Ob,He as Oc,k4 as P,je as Pa,Bm as Pb,Oe as Pc,Ux as Q,Wa as Qa,Fm as Qb,_e as Qc,Y0 as R,l1 as Ra,Nm as Rb,LS as Rc,q0 as S,im as Sa,Om as Sb,Wl as Sc,Zx as T,s1 as Ta,_m as Tb,jd as Tc,Qx as U,p1 as Ua,zm as Ub,iN as Uc,pM as V,m1 as Va,Rr as Vb,aN as Vc,dM as W,Ha as Wa,Vb as Wb,zl as Wc,uM as X,go as Xa,qm as Xb,Ul as Xc,CM as Y,Xe as Ya,$R as Yb,Yl as Yc,hM as Z,pb as Za,Zm as Zb,Kl as Zc,IM as _,Sr as _a,oL as _b,aw as _c,CE as a,EM as aa,Oa as ab,lI as ac,hw as ad,ji as b,AM as ba,lm as bb,od as bc,Ow as bd,tp as c,BM as ca,_a as cb,Cte as cc,Kw as cd,op as d,VM as da,d1 as db,el as dc,Xw as dd,zE as e,_M as ea,fn as eb,tl as ec,iv as ed,Gn as f,Ta as fa,wr as fb,bI as fc,uv as fd,Qg as g,yU as ga,mm as gb,ad as gc,kn as gd,QE as h,BC as ha,vr as hb,coe as hc,fv as hd,oP as i,HU as ia,dm as ib,rl as ic,VV as id,aP as j,oA as ja,cm as jb,il as jc,OV as jd,pP as k,iA as ka,um as kb,kI as kc,wd as kd,Ji as l,sA as la,fm as lb,WI as lc,we as ld,nx as m,ZC as ma,pe as mb,dd as mc,Ed as md,rx as n,fA as na,gm as nb,cd as nc,ap as o,lh as oa,xm as ob,ud as oc,Qi as p,EA as pa,Cm as pb,ZL as pc,xO as q,PA as qa,hm as qb,GI as qc,Uo as r,DA as ra,pm as rb,Td as rc,$o as s,kA as sa,Er as sb,aT as sc,xP as t,ch as ta,c1 as tb,pT as tc,yP as u,WA as ua,ym as ub,cT as uc,TP as v,OA as va,bm as vb,vk as vc,vP as w,_A as wa,Im as wb,Ek as wc,PP as x,zA as xa,cb as xb,Ur as xc,AP as y,vh as ya,za as yb,uT as yc,Zn as z,Dh as za,Ua as zb,gT as zc};