@tap-payments/os-micro-frontend-shared 0.3.219-test.25 → 0.3.219-test.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/_chunks/chunk-6ZXNZQCB.js +2 -0
- package/build/_chunks/{chunk-7BYF3Z4D.js → chunk-OYFBMD3V.js} +1 -1
- package/build/components/AmountInput/index.js +1 -1
- package/build/components/AppServices/index.js +1 -1
- package/build/components/AppServicesBar/index.js +1 -1
- package/build/components/BrandLogo/index.js +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/Customer/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/Discount/index.js +1 -1
- package/build/components/FileInputPreview/index.js +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/MerchantCurrencyDropdown/index.js +1 -1
- package/build/components/MerchantLogo/index.js +1 -1
- package/build/components/MerchantsDropdown/index.js +1 -1
- package/build/components/PaymentSourceFilter/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/TableCells/CustomCells/DateCell/DateCell.d.ts +4 -1
- package/build/components/TableCells/CustomCells/DateCell/DateViewer.d.ts +1 -1
- package/build/components/TableCells/CustomCells/DueDateCell/DueDateCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/DueDateCell/type.d.ts +3 -0
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/InvoiceStatusCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/type.d.ts +3 -0
- package/build/components/TableCells/CustomCells/PayoutDateCell/PayoutDateCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/RefundStatusCell/RefundStatusCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/RefundStatusCell/components/RefundStatus.d.ts +1 -1
- package/build/components/TableCells/CustomCells/RefundStatusCell/type.d.ts +6 -2
- package/build/components/TableCells/CustomCells/type.d.ts +3 -1
- package/build/components/TableCells/CustomCells/utils.d.ts +6 -0
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableReports/index.js +1 -1
- package/build/components/VAT/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/ViewColumnRadioFilter/index.js +1 -1
- package/build/components/WindowSideBar/index.js +1 -1
- package/build/components/index.js +1 -1
- package/build/index.js +1 -1
- package/package.json +2 -2
- package/build/_chunks/chunk-RLTFJOMW.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b as b$d,c as c$7}from'./chunk-RLPTTN4A.js';import {a as a$2,t as t$1}from'./chunk-SH6HUOLY.js';import {b as b$5}from'./chunk-SDVASEF5.js';import {b as b$1}from'./chunk-2CJVCAXX.js';import {a as a$d}from'./chunk-EJJIHLPX.js';import {f as f$4,b as b$b,g,a as a$h,e as e$1,d as d$4,c as c$6}from'./chunk-YHEFOHGA.js';import {a as a$k}from'./chunk-A3VOJ3G2.js';import {a as a$n}from'./chunk-QM55E5LM.js';import {b as b$9,a as a$m}from'./chunk-OYFBMD3V.js';import {a as a$3}from'./chunk-SRCVKMIR.js';import {a as a$c}from'./chunk-ZFIS5GCE.js';import {b as b$e}from'./chunk-5FZNDN55.js';import {b as b$8}from'./chunk-GJQV65J5.js';import {a as a$8,c as c$1,b as b$6}from'./chunk-5AW5C7Y3.js';import {a as a$9}from'./chunk-TEAJLXYP.js';import {h as h$1}from'./chunk-PVEQLSLG.js';import {a as a$a}from'./chunk-HKFQ5R7G.js';import {a as a$l,b as b$f,d as d$5,c as c$8}from'./chunk-IBXMT55Y.js';import {a as a$j}from'./chunk-MJXBFHYN.js';import {a as a$g,b as b$c}from'./chunk-ZONDSLTR.js';import {a as a$1}from'./chunk-QJ2GL3UO.js';import {a as a$f}from'./chunk-KK2O6IKJ.js';import {b as b$a}from'./chunk-XIWYWUHC.js';import {c as c$5}from'./chunk-5IZHUI5O.js';import {a as a$7}from'./chunk-57GPEKOQ.js';import {a,j,d,c,h,o,b as b$2,i,f as f$3,k,l as l$1,p as p$1,q,n as n$1,m as m$1}from'./chunk-5QMN72FQ.js';import {a as a$4}from'./chunk-EVERBYTO.js';import {a as a$5}from'./chunk-WBIMGETF.js';import {a as a$e}from'./chunk-5G6VELYF.js';import {f,a as a$6,b as b$3,d as d$2,c as c$3,e}from'./chunk-LT7P7S46.js';import {a as a$i}from'./chunk-TTBOB4JP.js';import'./chunk-FYEOUWRV.js';import {b as b$4,c as c$2,d as d$3}from'./chunk-AXHX5JVO.js';import {a as a$b}from'./chunk-V4IMVJZP.js';import {p,z,j as j$1,L,K,V,t,R,b,D,d as d$1,v,f as f$2,r,x as x$1}from'./chunk-KWNPF24A.js';import {n,r as r$1}from'./chunk-RVCKXM5W.js';import {Wa as Wa$1,wa as wa$1,xa,lc as lc$1,La,Cb as Cb$2,Bb,Ab as Ab$2,Va,zc,ac as ac$1,l,Aa as Aa$1,Wb,Yb,bb,vb as vb$1,wb as wb$2,ob as ob$1,Xb,Mb,yb,zb as zb$1,xb as xb$1,x,_b,Cc,Ia as Ia$1,Da as Da$1,Ha,cc,dc as dc$1,f as f$5,t as t$2,gb}from'./chunk-VFRJFEIJ.js';import {Ab as Ab$1,xb,zb,Ud,Cj,pc,Bi,zi,Ai,Bh,Mg,Sh as Sh$1,Se as Se$1,gk,ja,yk,pk,F,E,_o,Kj,Jj,Ij,Gj,Ej,Fj,Hj,hc as hc$1,ic as ic$1,fc,ma,Jl,Cb as Cb$1,Db as Db$1,Eb as Eb$1,C,Xj,Ah as Ah$1,wb as wb$1,fm,Kh as Kh$1,Jh as Jh$1,hb,Rd as Rd$1,We,So,vb,lj,rj,Ui,Zi,oo as oo$1,vj,uj,Pc as Pc$1,Ve,hm,Wc,Vc,Ze,Xe as Xe$1,Ye,Fb,dh as dh$1,ih as ih$1,jh,gh as gh$1,fh as fh$1,ah as ah$1,bh as bh$1,ch as ch$1,_g,$g,kh,H,io as io$1,G,ub as ub$1,T,wi,yi,xi,vi,Ci,Tg,Pj,Qj,tb as tb$1,ek,hk,fk,Kn,va as va$1,ua as ua$1,qk as qk$1,h as h$2,Sg,z as z$1,da as da$1,ca as ca$1,na,rk,Ak as Ak$1,sk,ik,kk as kk$1,vk,xk,nk as nk$1,ok,ac as ac$2,bc as bc$1,Oh,tk,lh as lh$1,wh as wh$1,vh as vh$1,uh as uh$1,th as th$1,sh as sh$1,rh as rh$1,qh as qh$1,ph as ph$1,oh as oh$1,nh as nh$1,mh as mh$1,Vh as Vh$1,Th,Uh as Uh$1,Yh as Yh$1,Xh as Xh$1,ae,Xd,$d as $d$1,Cn,An as An$1,si as si$1,ob as ob$2,Yd,rn,Zd,pb,Dh as Dh$1,Ch as Ch$1,Fh as Fh$1,Hh as Hh$1,Gh as Gh$1,Ih,je,sf,rf,qf,pf,of,tf,nf,Ba,Aa as Aa$2,kf,jf,if as _if,ei,di,gi,fi,hi,_j,Yj,Zj,tc as tc$1,Di,uc,Hi,ai as ai$1,yd as yd$1,Lk,Jk as Jk$1,Kk,Rb as Rb$1,vf,yf,xf,wf,uf,Lm as Lm$1,Im as Im$1,Dm as Dm$1,Em,Km as Km$1,wm as wm$1,Mm as Mm$1,xm as xm$1,Nm as Nm$1,ym as ym$1,Fm as Fm$1,Am as Am$1,Cm,Jm,Bm as Bm$1,um,Gm as Gm$1,Hm as Hm$1,vm,zm as zm$1,tm as tm$1,sm,rm as rm$1,qm,pm,Yg,zk,Vk,$j,Fo,Ho,dk as dk$1,ui,A,Go}from'./chunk-M5HS3EYQ.js';import {o as o$1,b as b$7,f as f$1,c as c$4,j as j$2,m,p as p$2}from'./chunk-OY44HMKS.js';import ld,{memo,createContext,forwardRef,useState,useEffect,useMemo,useCallback,useId,useRef,useReducer,Fragment as Fragment$1,useContext}from'react';import zn from'@mui/material/Box';import {styled,alpha,useTheme}from'@mui/material/styles';import {styled as styled$1,Box,Paper,Button,TextField,alpha as alpha$1,Typography,Popper,CircularProgress,Link,useTheme as useTheme$1,TableCell,ClickAwayListener}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useTranslation}from'react-i18next';import {motion,AnimatePresence,Reorder,useDragControls}from'framer-motion';import uv from'@mui/material/SvgIcon';import zt from'lodash/camelCase';import dc from'dayjs';import Bh$1 from'lodash/startCase';import DA from'@mui/material/Popover';import FA from'lodash/capitalize';import zD from'@mui/material/ClickAwayListener';import VD from'@mui/material/Popper';import DT from'@mui/material/Typography';import fb from'@mui/material/Button';import kL from'@mui/material/Menu';import {yupResolver}from'@hookform/resolvers/yup';import {useForm,Controller}from'react-hook-form';import*as Se from'yup';import {useDropzone}from'react-dropzone';import wN from'@mui/material/CircularProgress';import fc$1 from'@mui/material/LinearProgress';import SF from'lodash/values';import wF from'@mui/material/InputAdornment';var ix=styled(zn)({display:"flex",alignItems:"center",gap:"12px"});var pa=e=>e&&c$4(e)?e:void 0,Pe=(e,t)=>pa(e)??pa(t?.timezone)??f$1()??b$7;function I0({value:e,rendered:t,format:o,zone:n,timezone:r,flagIcon:i,hasFlag:a$1,tableMode:s,...l}){let p$1=Pe(n,r),d=i&&jsx(p,{title:La(i||""),children:jsx(a$4,{countryCode:i})}),m=useMemo(()=>t!==void 0?t:o$1(e instanceof Date?e:new Date(e),p$1,o),[e,t,o,p$1]);return jsx(a,{...l,children:jsxs(ix,{children:[a$1&&jsx(b$2,{sx:{visibility:"visible"},className:"geography-box",children:d}),jsx(Box,{sx:{...Wa$1(s)&&{fontSize:"11px"}},children:m})]})})}var po=I0;function ax({value:e,currentTimezone:t=io$1.UTC,timezoneOffset:o=0,defaultTimezoneOffset:n=0,hideTimezoneIcon:r=false,zone:i,timezone:a,...s}){let l=Pe(i,a),p$1=pa(i??a?.timezone),d=c=>t$2(e,{currentTimezone:t,targetTimezone:c}),m=p$1?e:d(o),u=!r&&!p$1&&n!==o;return jsxs(zn,{sx:{display:"flex",gap:"8px"},children:[jsx(po,{value:m,zone:l,...s}),u&&jsx(p,{title:x(d(n)),children:jsx("img",{src:H,width:14,alt:"timezone"})})]})}function sx({value:e,source:t,zone:o,tooltipZone:n,format:r,...i}){let a=j$2(e,t),s=o$1(a,o,r),l=n&&n!==o?o$1(a,n,r):void 0;return jsxs(zn,{sx:{display:"flex",gap:"8px"},children:[jsx(po,{value:a??"",rendered:s,format:r,...i}),l&&jsx(p,{title:l,children:jsx("img",{src:H,width:14,alt:"timezone"})})]})}function E0({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$1=jsx(Fragment,{children:o?.map(s=>{let l=s.name||s.description,p=(l?.length||0)>20?`${l?.slice(0,20)}...`:l;return jsx("div",{children:p},s.id)})});return jsx(p,{title:(o||[]).length>1?a$1:void 0,children:jsx(a,{...n,children:jsx("span",{children:i})})})}var M0=E0;function D0({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,{sx:{fontSize:"11px"},...n,children:i})}var R0=D0;var lx=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),da=styled("span",{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"25ch",flex:1,...Wa$1(t)&&{fontSize:"11px",color:e.palette.text.primary}})),px=styled("span")({width:"11.6px",height:"11.6px",flexShrink:0,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"flex-start"}),mx=styled("img")({width:"11.6px",height:"11.6px",borderRadius:"50%"});function k0({customerInitiated:e,children:t,isTimezoneIconShown:o,hasCustomerIcon:n,customerIcon:r,customerName:i$1,hideCustomerInitiatedIcon:a$1,hideTimezoneIcon:s,phone:l,email:p$1,id:d,...m}){let{t:u}=useTranslation(),c=e===false?u("merchantInitiated"):"",f=_b(i$1),x=i$1?.split(" ")?.map(w=>w?.[0]?.toUpperCase()).join(""),C=useMemo(()=>Aa$1(),[]),S=n&&jsx(p,{title:t,children:jsx(i,{"data-testid":"CustomerCell_customerShownIcon",sx:{background:C},src:r,alt:r,children:x})}),g=useMemo(()=>[{name:"ID",value:d},{name:"Name",value:i$1},{name:"Email",value:p$1},{name:"Phone",value:l}],[p$1,l,d,i$1]),h=useMemo(()=>{if(!g.some(({value:T})=>T))return null;let w=Cc("customer-tooltip");return jsx("div",{"data-testid":"CustomerCell_customerTooltip",children:g.map(({name:T,value:y},b)=>y&&jsx("div",{"data-testid":`CustomerCell_customerTooltip_${T}`,children:T==="Name"?y:`${T}: ${y}`},w(y,b)))})},[g]);return jsx(a,{...m,"data-testid":"CustomerCell_TableCell",children:jsxs(lx,{"data-testid":"CustomerCell_StyledCustomerCell",children:[S,jsx(p,{title:h,children:jsx(da,{"data-testid":"CustomerCell_StyledCustomerName","data-is-arabic":f,children:t})}),!s&&jsx(px,{"data-testid":"CustomerCell_StyledCustomerIconContainer",children:o&&jsx(mx,{src:G,"data-testid":"CustomerCell_StyledCustomerIcon"})}),!a$1&&jsx(p,{title:c,children:jsx(f$3,{"data-testid":"CustomerCell_StarBadgeWrapper",className:"geography-box",isShown:!!c,children:c&&jsx("img",{"data-testid":"CustomerCell_merchantInitiatedIcon",src:ub$1,alt:"merchant",style:{width:"16px",height:"16px"}})})})]})})}var N0=k0;function V0({children:e,customerName:t}){let o=_b(t);return jsx(da,{tableMode:"sheet","data-testid":"CustomerCell_StyledCustomerName","data-is-arabic":o,children:e})}var W0=V0;var ca=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",gap:e.spacing(1)})),dx=styled("span")(({theme:e,tableMode:t})=>({backgroundColor:e.palette.grey[100],display:"block",borderRadius:"4px",padding:"1.5px 3px",fontSize:Wa$1(t)?"11px":"10px",lineHeight:"13px",textTransform:"uppercase",fontWeight:e.typography.fontWeightBold})),cx=styled("span")(({theme:e,tableMode:t})=>({fontSize:Wa$1(t)?"11px":e.typography.body2.fontSize,lineHeight:"17px",fontWeight:"700"})),bp=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"})),ua=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 lW=({type:e,selectAmount:t,selectCurrency:o,requestAmount:n,requestCurrency:r,merchantAmount:i,merchantCurrency:a})=>{let s=Ia$1(t,o),l=Ia$1(n,r),p=Ia$1(i,a);return jsxs(bp,{sx:{textAlign:"right",justifyContent:"flex-end"},children:[jsx("span",{style:{fontWeight:"bold"},children:e?Da$1[e]:""}),jsxs(bp,{children:[e!=="fx"&&jsxs(ua,{children:[jsx("span",{children:"Customer Selected"})," ",jsxs("span",{children:[jsx(a$f,{currency:o})," ",s.integerAmount,".",s.decimalAmount]})]}),jsxs(ua,{children:[jsx("span",{children:"Charge"})," ",jsxs("span",{children:[jsx(a$f,{currency:r})," ",l.integerAmount,".",l.decimalAmount]})]}),jsxs(ua,{children:[jsx("span",{children:"Settlement"})," ",jsxs("span",{children:[jsx(a$f,{currency:a})," ",p.integerAmount,".",p.decimalAmount]})]})]})]})};var jo=({tableMode:e,conversionType:t})=>t?jsx(dx,{tableMode:e,className:"conversion-type",children:t}):jsx(Fragment,{});var Ko=({tableMode:e,amount:t,currency:o})=>jsx(cx,{tableMode:e,children:t!==void 0?jsxs(Fragment,{children:[jsx("span",{children:jsx(a$f,{currency:o,fontSize:10})})," ",jsx(b$a,{amount:t,currency:o})]}):jsx("span",{children:"-"})});var fx="default";function U0({conversionType:e,amount:t,currency:o,tooltipLabel:n,amountTooltipLabel:r,...i}){return jsx(a,{...i,children:jsxs(ca,{children:[jsx(p,{title:n||"",children:jsx(Box,{children:jsx(jo,{tableMode:fx,conversionType:e})})}),o&&jsx(p,{title:jsx(a$f,{currency:o}),children:jsx(a$4,{currencyCode:o})}),jsx(p,{title:r,children:jsx(Ko,{tableMode:fx,amount:t,currency:o})})]})})}var G0=U0;var gx="text";function Z0({conversionType:e,amount:t,currency:o,tooltipLabel:n,amountTooltipLabel:r,...i}){return jsx(a,{...i,children:jsxs(ca,{children:[jsx(p,{title:n||"",children:jsx(jo,{tableMode:gx,conversionType:e})}),jsx(p,{title:jsx(a$f,{currency:o}),children:jsx("span",{})}),jsx(p,{title:r,children:jsx(Ko,{tableMode:gx,amount:t,currency:o})})]})})}var j0=Z0;var xx="sheet";function q0({conversionType:e,amount:t,currency:o}){let{integerAmount:n,decimalAmount:r}=Ia$1(t,o);return jsxs(b$1,{copyTrigger:"press",copyText:t?`${n}.${r}`:"-",children:[jsx(jo,{tableMode:xx,conversionType:e}),jsx(Ko,{tableMode:xx,amount:t,currency:o})]})}var X0=q0;var hx=styled(motion.img)(()=>({width:"14px",height:"14px"})),yx=styled(motion.span)(({theme:e})=>({color:e.palette.common.white,borderRadius:e.spacing(.5),height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600,backgroundColor:e.palette.secondary.main})),Sp=styled(motion.div)(({theme:e})=>({height:"16px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${e.palette.secondary.main}1A`,paddingInline:e.spacing(.5),borderRadius:"56px"})),Xo=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:o?e*o:e*49,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t}}),Jo=styled(motion.span)(({isTextShown:e,theme:t})=>({border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:e?"auto":"36px",...e&&{border:"none"}})),Qo=styled(motion.div,{shouldForwardProp:e=>e!=="order"})(({order:e=0})=>({display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:0,left:0,zIndex:e+6,width:"fit-content",height:"24px",cursor:"pointer",borderRadius:"16px","&:hover":{zIndex:200}})),en=styled(motion.div,{shouldForwardProp:e=>e!=="statusesCount"})(({statusesCount:e=1})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"relative",minWidth:`${e*6+36}px`,height:"24px",cursor:"pointer",borderRadius:"16px",overflow:"visible"})),Ix=styled("div")(()=>({display:"flex",gap:"4px",justifyContent:"flex-start",alignItems:"center",position:"relative",width:"100%",overflow:"visible"}));var bx=e=>e?Object.keys(e).filter(t=>e[t]).reduce((t,o)=>(t[o]=e[o],t),{}):{};var tn=({statuses:e,centerIconKey:t})=>{let o=useMemo(()=>bx(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 ev({statuses:e,centerIconKey:t,...o}){let{statusesList:n}=tn({statuses:e,centerIconKey:t}),r=useTheme(),i=n.length||0;return jsx(a,{...o,"data-testid":"StatusCell",sx:{position:"relative",overflow:"visible"},children:jsx(en,{whileHover:"animate",animate:"start",statusesCount:i,children:n.map((a,s)=>a?jsx(Qo,{order:s,variants:Xo(s,r.shadows[4],40),children:jsx(Jo,{children:a})},s):null)})})}var tv=ev;function nv({statuses:e,...t}){let{statusesList:o}=tn({statuses:e});return jsx(a,{...t,children:jsx(Ix,{sx:{paddingRight:"30px"},children:o.map((n,r)=>jsx(Fragment$1,{children:n},r))})})}var rv=nv;function av({statuses:e,centerIconKey:t,xGap:o,...n}){let{statusesList:r}=tn({statuses:e,centerIconKey:t}),i=useTheme(),a$1=r.length||0,s=o||120;return jsx(a,{...n,"data-testid":"StatusCell",sx:{position:"relative",overflow:"visible"},children:jsx(en,{whileHover:"animate",animate:"start",statusesCount:a$1,children:r.map((l,p)=>l?jsx(Qo,{order:p,variants:Xo(p,i.shadows[4],s),children:jsx(Jo,{isTextShown:true,children:l})},p):null)})})}var sv=av;var Ca=styled("section",{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",textAlign:"center",borderRadius:"50%",gap:Wa$1(t)?"4px":e.spacing(1),overflow:"visible"})),ha=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}})),Sx=styled("img",{shouldForwardProp:e=>e!=="isActive"})(({isActive:e})=>({width:"18px",height:"18px",...!e&&{pointerEvents:"none",filter:"opacity(0.3)"}})),Ke=styled(motion.img)(({icon:e})=>({width:"13.3px",height:"13.3px",...e==="cancel"&&{padding:"1.15px"}}));function Tx({isAnyActionLoading:e,isAnyActionHasError:t,isAnyActionSuccessful:o,areThereAnyShownActions:n}){let{t:r}=useTranslation();return t?jsx(Ke,{src:hc$1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"fail-icon"):o?jsx(Ke,{src:ic$1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"success-icon"):e?jsx(Ke,{src:fc,className:"spinner-loader"},"spinner-icon"):jsx(p,{title:r("moreActions"),children:jsx(Sx,{alt:"more",src:ma,isActive:n},"ellipsis-icon")})}Tx.displayName="ActionIconsVariants";var dr=memo(Tx);var on={GRAY:{icon:zb,color:"#CFCFCF"},ORANGE:{icon:xb,color:"#FFD503"},RED:{icon:Ab$1,color:"#FF0000"}},ya={"#CFCFCF":"gray","#FFD503":"orange","#FF0000":"red",gray:"gray",red:"red",orange:"orange"},Ia={flag:E,dispute:F,refund:pk,void:yk,capture:ja,cancel:gk,clock:Se$1,reverse:Sh$1,destination:Mg,invoice:Bh,users:Ai,brand:zi,clipboard:Bi,viewApi:Ud,viewReceipt:pc,delete:Cj};function ba({actions:e,isDropdownShown:t,onCloseDropdown:o,renderDropdown:n}){let[r,i]=useState(null),a=!!r,s=(e||[]).filter(f=>f.isShown!==false),l=s.some(f=>f.isLoading),p=s.some(f=>f.isError),d=s.some(f=>f.isSuccess),m=s.length>0||!!n,u=f=>{l||!m||i(f.currentTarget);},c=()=>{i(null),o?.();};return useEffect(()=>{t||i(null);},[t]),{anchorEl:r,open:a,filteredActions:s,isAnyActionLoading:l,isAnyActionHasError:p,isAnyActionSuccessful:d,areThereAnyShownActions:m,handleClick:u,handleClose:c,setAnchorEl:i}}var wx=e=>jsx(uv,{sx:{height:12.6,width:13},...e,children:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"13",viewBox:"2.67 1.07 10.66 12.66",fill:"none",children:jsxs("g",{transform:"translate(-4 -4)",children:[jsx("path",{d:"M7.5918 15.166C7.5918 16.4041 8.5959 17.4072 9.83398 17.4072H15.5273L15.334 17.6973C15.101 18.0473 14.7079 18.2577 14.2871 18.2578H9.83398C8.12641 18.2578 6.74219 16.8736 6.74219 15.166V8.71289C6.74219 8.2923 6.9526 7.89944 7.30273 7.66602L7.5918 7.47266V15.166ZM10.167 5.74121H15.5C16.4651 5.74121 17.2586 6.534 17.2588 7.49902V14.833C17.2586 15.798 16.4651 16.5908 15.5 16.5908H10.167C9.20193 16.5908 8.40838 15.798 8.4082 14.833V7.49902C8.40838 6.534 9.20193 5.74121 10.167 5.74121ZM10.167 6.59082C9.6596 6.59082 9.25896 6.99168 9.25879 7.49902V14.833C9.25896 15.3404 9.6596 15.7412 10.167 15.7412H15.5C16.0074 15.7412 16.408 15.3404 16.4082 14.833V7.49902C16.408 6.99168 16.0074 6.59082 15.5 6.59082H10.167Z",fill:"#20232B",stroke:"white",strokeWidth:"0.15"}),jsx("path",{d:"M10.7598 12.84V9H11.4851V12.84H10.7598Z",fill:"black"}),jsx("path",{d:"M12.2846 12.84V9H13.5272C13.5574 9 13.6197 9.00089 13.7139 9.00267C13.8081 9.00444 13.8988 9.01067 13.9859 9.02133C14.2952 9.05867 14.5574 9.16622 14.7726 9.344C14.9877 9.52178 15.1512 9.74756 15.2632 10.0213C15.3752 10.2951 15.4312 10.5947 15.4312 10.92C15.4312 11.2453 15.3752 11.5449 15.2632 11.8187C15.1512 12.0924 14.9877 12.3182 14.7726 12.496C14.5574 12.6738 14.2952 12.7813 13.9859 12.8187C13.8988 12.8293 13.8081 12.8356 13.7139 12.8373C13.6197 12.8391 13.5574 12.84 13.5272 12.84H12.2846ZM13.0206 12.1573H13.5272C13.5752 12.1573 13.6401 12.1564 13.7219 12.1547C13.8037 12.1511 13.8774 12.1431 13.9432 12.1307C14.1103 12.0969 14.2463 12.0187 14.3512 11.896C14.4579 11.7733 14.5361 11.6258 14.5859 11.4533C14.6374 11.2809 14.6632 11.1031 14.6632 10.92C14.6632 10.728 14.6366 10.5458 14.5832 10.3733C14.5317 10.2009 14.4526 10.0551 14.3459 9.936C14.2392 9.81689 14.105 9.74133 13.9432 9.70933C13.8774 9.69511 13.8037 9.68711 13.7219 9.68533C13.6401 9.68356 13.5752 9.68267 13.5272 9.68267H13.0206V12.1573Z",fill:"black"})]})})});var Px=".IDButton-root:not(.IDButton-hoverDisabled):hover &",Ex=styled("div")(({theme:e})=>({paddingInlineStart:"8px",border:"1px solid transparent",display:"flex",gap:"4px",alignItems:"center",justifyContent:"flex-end",backgroundColor:e.palette.common.white,float:"right",borderRadius:"56px",height:"100%",paddingLeft:"4px",paddingRight:"4px",width:"24px",overflow:"hidden",[Px]:{width:"max-content",overflow:"visible",borderColor:"rgba(92, 92, 92, 0.05)",boxShadow:"-7px 0px 8px 0px #F2F2F2",position:"absolute",right:0,top:0,zIndex:101}})),Mx=styled("div")(({theme:e})=>({color:e.palette.text.primary,fontSize:"11px",lineHeight:"120%",display:"grid",gridTemplateColumns:"0fr",opacity:0,transition:"grid-template-columns 0.1s ease, opacity 0.1s ease","& > span":{overflow:"hidden",minWidth:0,whiteSpace:"nowrap"},[Px]:{gridTemplateColumns:"1fr",opacity:1,transition:"grid-template-columns 0.3s ease, opacity 0.3s ease 0.3s"}}));function hv({icon:e=jsx(wx,{}),id:t,sx:o,disableOnHoverEffect:n=false,onCopyId:r,className:i,...a}){let{t:s}=useTranslation();return jsx(p,{title:s("copy"),children:jsx(zn,{className:lc$1("IDButton-root",n&&"IDButton-hoverDisabled",i),sx:{position:"relative",width:"24px",height:"24px",cursor:"pointer",...o},...a,children:jsxs(Ex,{className:"IDButton-button",children:[t?jsx(Mx,{className:"IDButton-rowId",children:jsx("span",{children:t})}):null,t?jsx(D,{className:"IDButton-icon",icon:e,text:t,onClick:()=>r?.()}):null]})})})}var vp=memo(hv);var fH=memo(({flag:e,actions:t,flagTooltip:o,flagsCount:n,dropdownAction:r,onCloseDropdown:i,isDropdownShown:a$1=true,row:s,showJsonViewer:l=true,isTextShown:p$1,showIdButton:d$1=true,onCopyId:m,rowId:u,onJsonViewClick:c$1,renderDropdown:f$1,startSlot:x,...C})=>{let{t:S}=useTranslation(),{open:g,anchorEl:h$1,filteredActions:w,isAnyActionLoading:T,isAnyActionHasError:y,isAnyActionSuccessful:b,areThereAnyShownActions:v,handleClick:E,handleClose:A,setAnchorEl:D}=ba({actions:t,isDropdownShown:a$1,onCloseDropdown:i,renderDropdown:f$1});return jsx(a,{...C,sx:{overflow:"visible",...C.sx},children:jsxs(Ca,{"data-testid":"ActionCell_ActionCellContainer",children:[x,e&&jsx(Fragment,{children:p$1?jsx(p,{title:o,children:jsx(j,{"data-testid":"ActionCell_FlagLabel",sx:{textAlign:"left",justifyContent:"flex-start"},children:o})}):jsx(p,{title:o,children:jsxs(d,{"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(Ke,{"data-testid":"ActionCell_FlagIcon",sx:{width:"12px",height:"11px"},src:on[e]?.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(z,{compact:true,color:ya[on[e]?.color]||"orange","data-testid":"ActionCell_StyledBadge",children:[n,"x"]})})]})})}),d$1&&jsx(vp,{id:u||s.id,onCopyId:m}),jsxs("div",{"data-testid":"ActionCell_IconsContainer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:[l&&jsx(Fragment,{children:jsx(c,{onClick:c$1,type:"button","data-testid":"ActionCell_TransparentButton",children:jsx(p,{title:S("jsonViewer"),children:jsx(h,{"data-testid":"ActionCell_IdButtonContainer",children:jsx(motion.img,{src:Ud,alt:"icon"},"id-icon")})})})}),jsxs(ha,{id:"styled-popover",selected:!!r||g,"data-testid":"ActionCell_ActionsIconContainer","data-is-active":v,sx:{...!v&&{pointerEvents:"none"}},children:[jsx(c,{onClick:E,"data-testid":"ActionCell_ActionsIconContainer_TransparentButton","data-is-active":v,sx:{...!v&&{pointerEvents:"none"}},children:jsx(AnimatePresence,{mode:"wait",children:jsx(dr,{isAnyActionLoading:T,isAnyActionHasError:y,isAnyActionSuccessful:b,areThereAnyShownActions:v})})}),r,f$1?f$1(h$1,D):jsx(Fragment,{children:v&&jsx(f,{style:{zIndex:2e3},open:g,onClose:A,anchorEl:h$1,menuItems:w.map(R=>({...R,onClick:W=>{R?.onClick?.(W),R.hasActionMenu||A();},onRightClick:W=>{R?.onRightClick?.(W),A();},icon:R.customIcon||jsx(Ke,{icon:R.icon,src:R.iconSrc??(R.icon&&Ia[R.icon]),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},`action.label-${R.label.trim()}`)}))})})]})]})]})})});function vv({flag:e,flagTooltip:t,flagsCount:o,row:n,showJsonViewer:r=true,isTextShown:i,showIdButton:a$1=true,rowId:s,onJsonViewClick:l,tableMode:p$1,...d$1}){return jsx(a,{...d$1,sx:{overflow:"visible"},children:jsxs(Ca,{"data-testid":"ActionsColumn_ActionCellContainer",tableMode:p$1,children:[e&&jsx(Fragment,{children:i?jsx(p,{title:t,children:jsx(j,{"data-testid":"ActionsColumn_FlagLabel",sx:{textAlign:"left",justifyContent:"flex-start"},children:t})}):jsx(p,{title:t,children:jsxs(d,{"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(Ke,{"data-testid":"ActionsColumn_FlagIcon",sx:{width:"12px",height:"11px"},src:on[e]?.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(z,{compact:true,color:ya[on[e]?.color]||"orange","data-testid":"ActionsColumn_StyledBadge",children:[o,"x"]})})]})})}),a$1&&jsx(b$1,{sx:{minWidth:"213px"},children:s||n.id}),jsx("div",{"data-testid":"ActionsColumn_IconsContainer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:r&&jsx(b$1,{onClick:l,children:"View API"})})]})})}var Pv=memo(vv);function Dv({actions:e,dropdownAction:t,onCloseDropdown:o,isDropdownShown:n=true,renderDropdown:r,...i}){let{open:a$1,anchorEl:s,filteredActions:l,isAnyActionLoading:p,isAnyActionHasError:d,isAnyActionSuccessful:m,areThereAnyShownActions:u,handleClick:c$1,handleClose:f$1,setAnchorEl:x}=ba({actions:e,isDropdownShown:n,onCloseDropdown:o,renderDropdown:r});return jsx(a,{...i,sx:{overflow:"visible"},children:jsx("div",{"data-testid":"ActionIconColumn_Container",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:jsxs(ha,{id:"styled-popover",selected:!!t||a$1,"data-testid":"ActionIconColumn_ActionsIconContainer","data-is-active":u,sx:{...!u&&{pointerEvents:"none"}},children:[jsx(c,{onClick:c$1,"data-testid":"ActionIconColumn_ActionsIconContainer_TransparentButton","data-is-active":u,sx:{...!u&&{pointerEvents:"none"}},children:jsx(AnimatePresence,{mode:"wait",children:jsx(dr,{isAnyActionLoading:p,isAnyActionHasError:d,isAnyActionSuccessful:m,areThereAnyShownActions:u})})}),r?r(s,x):jsxs(Fragment,{children:[t,u&&jsx(f,{style:{zIndex:2e3},open:a$1,onClose:f$1,anchorEl:s,menuItems:l.map(C=>({...C,onClick:S=>{C?.onClick?.(S),C.hasActionMenu||f$1();},onRightClick:S=>{C?.onRightClick?.(S),f$1();},icon:C.customIcon||jsx(Ke,{icon:C.icon,src:C.iconSrc??(C.icon&&Ia[C.icon]),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},`action.label-${C.label.trim()}`)}))})]})]})})})}var Rv=memo(Dv);var Sa={ORDER:{label:"order",icon:vi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:xi,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:yi,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:wi,color:"#32ADE6"}},Ta={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 wa=styled$1("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),va=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"}));function Wv({type:e,hasSavedCard:t,totalPaymentsCount:o,isTextShown:n}){let r=zc(useId(),"agreement-icon"),i=useTheme$1(),{t:a}=useTranslation(),s=useMemo(()=>[...t?[Ta.SAVED_TOKEN]:[],...(o||0)>0?[Ta.COUNT]:[],...e&&Sa[e]?[Sa[e]]:[]],[t,o,e]),l=m=>n?jsx(a$g,{"data-testid":"AgreementCell_countBadge",children:jsx(p,{title:a("totalPaymentCount",{amount:f$5(o)}),children:jsx(va,{children:jsxs(wa,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:Ta.COUNT.color},children:["x",o]})})})},m):jsx(a$n,{value:o,index:m},m),p$1=s.map((m,u)=>m.label==="countBadge"?l(u):jsx(p,{title:a(m.label),children:jsx(a$g,{children:n?jsx(va,{children:jsx(wa,{"data-testid":"AgreementCell_agreementType",sx:{color:m.color},children:a(m.label)})}):jsx(d$1,{sx:{maxWidth:"16px",maxHeight:"16px",height:"auto",width:"auto"},src:m.icon,alt:"agreement"})},m.color)},m.color)),d=jsx(p,{title:"No agreement",children:jsx(a$g,{children:n?jsx(va,{children:jsx(wa,{"data-testid":"AgreementCell_agreementType",sx:{color:i.palette.text.secondary},children:"No agreement"})}):jsx(d$1,{sx:{maxWidth:"24px",maxHeight:"24px",height:"auto",width:"auto"},src:Ci,alt:"agreement"})},"no-agreement")},"no-agreement");return jsx(Box,{id:r,"data-testid":"AgreementIcon",sx:{display:"flex",alignItems:"center",gap:"4px"},children:p$1?.length>0?p$1:d})}var Rx=Wv;var Ov=Rx;styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));styled$1("img")(()=>({maxWidth:"36px",maxHeight:"24px"}));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"}));var Bx=styled$1("span")(({theme:e})=>({fontSize:"11px",padding:"2px 0",color:e.palette.text.primary})),kx=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px",textAlign:"center",width:"100%"}));styled$1("span")(({theme:e})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));styled$1(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));var Nx=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px"}));var Mp={"3DS":{tooltip:"3DS",icon:Qj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Pj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:$g,borderColor:"rgba(31, 136, 208, 0.10)"}},Fx={FAILED:{tooltip:"Failed",icon:Tg,borderColor:"rgba(255, 61, 0, 0.10)"},REJECTED:{tooltip:"Rejected",icon:ah$1,borderColor:"rgba(255, 61, 0, 0.10)"}};function zv({transactionStatus:e,eci:t,authType:o,isTextShown:n}){let r=zc(useId(),"auth-icons"),i=useMemo(()=>{let s=e?Fx[e]:null,l=s?.tooltip,p=e==="AUTHENTICATED"?null:s?.icon;return [{tooltip:l,content:n?l:p,type:n?"text":"icon"},...o?[{tooltip:o,content:n?Mp[o]?.tooltip:Mp[o]?.icon,type:n?"text":"icon"}]:[],{tooltip:"",content:t?`ECI ${t}`:"",type:"text"}]},[e,n,o,t]),a=useMemo(()=>i.filter(s=>!!s.content).map((s,l)=>{let p$1=s.type==="text"?jsx(kx,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(Bx,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":s.content,children:s.content})}):jsx(d$1,{sx:{width:"16px",height:"16px"},src:s.content,alt:s.tooltip});return jsx(p,{title:s.tooltip,children:p$1},`${s.tooltip}-${l}`)}),[i]);return jsx(Nx,{id:r,"data-testid":"AuthIcons",children:a})}var Wx=zv;var $v=(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}}});var Uv=Wx;var gr={VOID:{icon:fk},CAPTURED:{icon:ek}};var Pa=styled(motion.div)(({theme:e,isCapture:t})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:e.spacing(.5),paddingInline:e.spacing(.3),paddingBlock:e.spacing(.3),height:"100%",minWidth:"100%",backgroundColor:t?"#eaf3fb":"#eeeeee",borderRadius:"56px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,position:"relative",zIndex:10})),Ea=styled("div")(({theme:e,percentage:t,isCapture:o})=>({border:`0.6px ${[0,100].includes(t)?"solid":"dashed"} ${o?e.palette.info.dark:"#656565"}`,borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"7px",fontWeight:e.typography.fontWeightBold,color:o?e.palette.info.dark:"#656565",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),Ma=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"}`})),Aa=styled("img")({width:"14px",height:"14px"}),an=styled(o)({width:"16px",height:"16px"}),go=styled("img")({width:"16px",height:"16px"}),Hx=styled(Box)({display:"flex",alignItems:"center",justifyContent:"center"});function Da(e){return e<5?5:e===100?95:e}function Jv({voidPercentage:e,capturePercentage:t,captureCount:o,autoType:n,captureAmount:r,voidAmount:i,currency:a,isTextShown:s,remainingAmount:l,isSheetViewShown:p$1,selectionProps:d={}}){let m=Number(t)+Number(e)===100||l<=0,u=zc(useId(),"capture-auto-icon"),c=useTheme(),{t:f}=useTranslation(),x=Ha(l||0),C=useCallback(T=>`Auto ${T} - ${a} ${x.integerAmount}.${x.decimalAmount}`,[a,x.decimalAmount,x.integerAmount]),S=useCallback(T=>{let y=T==="Capture"?r:i,{integerAmount:b,decimalAmount:v}=Ia$1(y,a);return `Partial ${T} - ${a} ${b}.${v}`},[r,i,a]),g=t>0?jsx(p,{title:S("Capture"),children:jsxs(Pa,{isCapture:true,isFullyUsed:m,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:c.shadows[4]}},children:[jsx(Aa,{src:tb$1,alt:"captured"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(Ea,{isCapture:true,percentage:t,children:[t,"% ",jsx(Ma,{isCapture:true,percentage:Da(t)})]}),o>1&&jsxs(z,{compact:true,color:"dark",children:[o,"x"]})]})]})}):n==="CAPTURED"&&!m?jsx(p,{title:C("Capture"),children:jsx(an,{children:jsx(go,{src:gr.CAPTURED?.icon,alt:"auto"})})}):jsx(p,{title:C("Capture"),children:jsx(an,{children:jsx(go,{src:gr.CAPTURED?.icon,alt:"auto"})})}),h=t===100?jsx(p,{title:f("captured"),children:jsx(Hx,{children:jsx(go,{src:hk,alt:"captured"})})}):g,w=useMemo(()=>p$1&&h?jsx(b$1,{copyTrigger:"press",copyText:f("captured"),children:f("captured")}):s&&h?jsx(k,{children:f("captured")}):h,[s,h,p$1,f]);return w&&jsx("div",{id:u,"data-testid":"CaptureAutoIcon",style:{zIndex:12},children:w})}var _x=Jv;function rP({voidPercentage:e,capturePercentage:t,voidCount:o,autoType:n,captureAmount:r,voidAmount:i,currency:a,isTextShown:s,isSheetViewShown:l,selectionProps:p$1={},remainingAmount:d}){let m=Number(t)+Number(e)===100||d<=0,u=zc(useId(),"void-auto-icon"),c=useTheme(),{t:f}=useTranslation(),x=Ha(d||0),C=useCallback(T=>`Auto ${T} - ${a} ${x.integerAmount}.${x.decimalAmount}`,[a,x.decimalAmount,x.integerAmount]),S=useCallback(T=>{let y=T==="Capture"?r:i,{integerAmount:b,decimalAmount:v}=Ia$1(y,a);return `Partial ${T} - ${a} ${b}.${v}`},[r,i,a]),g=e>0||i?jsx(p,{title:S("Void"),children:jsxs(Pa,{isFullyUsed:m,whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:14,background:c.palette.common.white,border:`0.75px solid ${c.palette.grey[600]}1A`},variants:{animate:{boxShadow:c.shadows[4]}},children:[jsx(Aa,{src:yk,alt:"void"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(Ea,{percentage:e,children:[e,"% ",jsx(Ma,{percentage:Da(e)})]}),o>0&&jsxs(z,{compact:true,color:"neutral",children:[o,"x"]})]})]})}):n==="VOID"&&!m?jsx(p,{title:C("Void"),children:jsx(an,{children:jsx(go,{src:gr.VOID?.icon,alt:"auto"})})}):null,h=e===100?jsx(p,{title:f("void"),children:jsx(an,{children:jsx(go,{src:yk,alt:"void"})})}):g,w=useMemo(()=>l&&h?jsx(b$1,{copyTrigger:"press",copyText:f("void"),children:f("void")}):s&&h?jsx(l$1,{children:f("void")}):h,[s,h,l,f]);return w?jsx("div",{id:u,"data-testid":"VoidAutoIcon",style:{...!l&&{zIndex:11}},children:w}):null}var $x=rP;var iP=_x;var pP=({authorizedStatus:e,isTextShown:t,iconStyles:o,tableMode:n,chipIndex:r=0,selectionProps:i={}})=>{let{t:a}=useTranslation(),s=useTheme(),l=a(zt(e));return Wa$1(n)?jsx(b$1,{copyTrigger:"press",copyText:l,children:l}):jsx(p,{title:l,children:t?jsx(j,{"data-testid":"StatusCell_AuthorizedStatusLabel",sx:{color:s.palette.info.dark},children:l}):jsx(d$1,{src:f$4[e],alt:"authorized-icon","data-testid":"StatusCell_AuthorizedStatusIcon",sx:o})})};var Ux=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)})),Gx=styled(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"})),Ap=styled("img")(()=>({width:"10px",height:"10px"})),Dp=styled(motion.span)(({theme:e})=>({width:"18px",height:"18px",borderRadius:"50%",backgroundColor:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,position:"relative"})),Rp=styled(motion.div,{shouldForwardProp:e=>e!=="isVisible"})(({isVisible:e})=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",width:"0",overflow:"hidden",opacity:0,...!e&&{padding:"0 !important"}})),Yx=styled(motion.div)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"})),Zx=styled(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),jx={delay:.2,ease:"easeIn",fadeIn:{duration:.2}},Kx={animate:{width:"auto",paddingRight:"4px",paddingLeft:"4px"},fadeIn:{opacity:1,transition:{delay:.7}}},qx={animate:{width:"auto"},fadeIn:{opacity:1,transition:{delay:1}}},Xx={animate:{width:"auto",paddingRight:"8px",paddingLeft:"4px"}},Lp={fadeIn:{duration:.3},animate:{duration:.1}},Jx={fadeIn:{opacity:1}},Qx=styled(j)(()=>({width:"88px",height:"100%"})),Bp=styled(Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.25),height:"100%"}));function It({chargeStatus:e,gatewayTooltip:t,acquirerTooltip:o$1,chargeTooltip:n,errorCode:r,isTextShown:i,gatewayCode:a,acquirerCode:s,unCapturedStyles:l,iconStyles:p$2,iconWrapperStyles:d,gatewayIconWrapperStyles:m,gatewayContainerStyles:u,gateWayIconStyles:c,showBadge:f=true,isSheetViewShown:x=false,selectionProps:C={},chipIndex:S=0}){let g$1=e?b$b[e]:null,h=e?g[e]:null,w=useTheme(),{t:T}=useTranslation(),y=zc(useId(),"charge-status-icon"),b=n&&jsx(Fragment,{children:jsx("div",{children:n})}),v=o$1&&jsxs(Fragment,{children:[jsx("div",{children:"Acquirer"}),jsx("div",{children:o$1})]}),E=t&&jsxs(Fragment,{children:[jsx("div",{children:"Gateway"}),jsx("div",{children:t})]}),A=e&&a$h[e]&&jsx("div",{"data-testid":"ChargeStatusIcon_ChargeIcon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:g$1?"50%":"",...d},children:jsx(p$1,{src:a$h[e],alt:"charge-icon","data-testid":"ChargeStatusIcon_StatusIcon",style:{borderRadius:g$1?"50%":"",width:"16px",height:"16px",...p$2}})});return x?jsxs(Bp,{children:[jsxs(b$1,{copyTrigger:"press",copyText:T(zt(e)),children:[T(zt(e))," ",r]}),g$1&&jsxs(Fragment,{children:[a&&jsxs(b$1,{copyTrigger:"press",copyText:"Gateway",children:["Gateway ",a]}),s&&jsxs(b$1,{copyTrigger:"press",copyText:"Acquirer",children:["Acquirer ",s]})]})]}):i?jsxs(Bp,{children:[jsx(p,{title:b,children:jsxs(Qx,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":zt(e),sx:{background:g$1?.background||h?.background||"transparent",color:g$1?.color||h?.color||w.palette.info.dark,borderColor:`${g$1?.color||h?.color||w.palette.info.dark}1A`},children:[T(zt(e))," ",r]})}),g$1&&jsxs(Fragment,{children:[a&&jsx(p,{title:E,children:jsxs(j,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":zt(e),sx:{background:g$1?.background||h?.background||"transparent",color:g$1?.color||h?.color||w.palette.info.dark},children:["Gateway ",a]})}),s&&jsx(p,{title:v,children:jsxs(j,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":zt(e),sx:{background:g$1?.background||h?.background||"transparent",color:g$1?.color||h?.color||w.palette.info.dark},children:["Acquirer ",s]})})]})]}):jsx(o,{id:y,"data-testid":"ChargeStatusIcon_StatusIconWrapper",style:{...d},children:Kn?.includes(e||"")&&(b||v||E)?jsxs(Zx,{"data-testid":"ChargeStatusIcon_UnCapturedContainer",whileHover:["animate","fadeIn"],style:{left:"0",...f&&{paddingInline:"12px",border:"1px solid #F2F2F2",borderRadius:"12px",backgroundColor:"#fff"},...l},children:[jsx(Yx,{"data-testid":"ChargeStatusIcon_UnCapturedBadge",sx:{borderRadius:"56px"},initial:{background:"transparent"},variants:{animate:{background:g$1?.background}},children:jsx(p,{title:b??T(zt(e)),children:jsxs(Fragment,{children:[A,jsx(Gx,{"data-testid":"ChargeStatusIcon_ErrorCodeWrapper",transition:{animate:{duration:.05}},variants:Xx,style:{...r&&{padding:"0 !important"}},children:jsx(Ux,{"data-testid":"ChargeStatusIcon_ErrorCodeLabel",sx:{background:g$1?.color},transition:jx,variants:Jx,initial:{opacity:0},children:r})})]})})}),jsx(Rp,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:Lp,variants:Kx,style:u,isVisible:!!E,children:E&&jsx(p,{title:E,children:jsx(Dp,{"data-testid":"ChargeStatusIcon_GatewayIconWrapper",style:{background:g$1?.background,...m},children:jsx(Ap,{src:g$1?.gatewayIcon,alt:"gateway-icon","data-testid":"ChargeStatusIcon_GatewayIcon",style:c})})})}),jsx(Rp,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:Lp,variants:qx,style:u,isVisible:!!v,children:v&&jsx(p,{title:v,children:jsx(Dp,{"data-testid":"ChargeStatusIcon_AcquirerIconWrapper",style:{background:g$1?.background,...m},children:jsx(Ap,{src:g$1?.acquirerIcon,alt:"acquirer-icon","data-testid":"ChargeStatusIcon_AcquirerIcon",style:c})})})})]}):jsx(p,{title:b??T(zt(e)),children:jsx(o,{children:A})})})}var xP=()=>{let{t:e}=useTranslation(),t=zc(useId(),"customer-initiated-icon");return jsx(p,{title:e("merchantInitiated"),children:jsx("img",{id:t,"data-testid":"merchantInitiatedIcon",src:ub$1,alt:"merchant",style:{width:"16px",height:"16px"}})})};var CP={G:"Global",R:"Regional",L:"Local"},xo=({geographyVariant:e,countryCode:t,isTextShown:o})=>{let n=e?CP[e]:void 0,r=n||t?`${n||""} ${n&&t?"-":""} ${t?`Country - ${t}`:""}`:void 0;return o||!t?null:jsx(p,{title:r,children:jsx(a$4,{countryCode:t})})};var IP=({geographyVariant:e,isTextShown:t,deviceCountry:o,deviceType:n,tableMode:r})=>{let i=zc(useId(),"device-icon-chip");return jsxs(zn,{id:i,"data-testid":"DeviceIconChip",sx:{display:"flex",gap:"8px",alignItems:"center",...Wa$1(r)&&{height:"18px"}},children:[jsx(xo,{geographyVariant:e,isTextShown:t,countryCode:o}),jsx(c$5,{type:n,isTextShown:t,tableMode:r})]})};var TP=({isDisputeOpen:e,iconStyles:t})=>{let o=zc(useId(),"dispute-icon");return jsx(p$1,{id:o,"data-testid":"StatusCell_DisputeStatusIcon",sx:{width:"13.5px",height:"13.5px"},src:e?va$1:ua$1,alt:"dispute-icon",style:t})};var rC=styled(zn,{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({display:"flex",gap:e.spacing(.5),...Wa$1(t)&&{height:"18px"},alignItems:"center"})),iC=styled("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function Np({countryCode:e,isTextShown:t,cardNumber:o,bankName:n,tableMode:r}){let i=zc(useId(),"issuer-icon"),a=o?.slice(0,4),s=o?.slice(-4);return jsxs(rC,{id:i,"data-testid":"IssuerIcon",tableMode:r,children:[e&&jsx(xo,{countryCode:e,isTextShown:t}),jsx(p,{title:`${n?`Issuer - ${n}`:""}`,children:jsx(iC,{children:`${a||""} ${s||""}`})})]})}var MP=Np;styled$1(motion.div)(({theme:e,background:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.75),paddingBlock:e.spacing(.5),backgroundColor:t,height:"24px",width:"fit-content",borderRadius:"24px",fontSize:"10px",color:e.palette.text.primary}));var Fp=styled$1("img")(()=>({height:"13.125px",width:"12px"})),ka=styled$1("div")(()=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",width:"65px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4.5px 8px",borderRadius:"24px"})),aC=styled$1("div")(({theme:e})=>({color:e.palette.common.white,background:e.palette.error.main,fontSize:"0.6rem",fontWeight:600,borderRadius:"16px",padding:"2px 8px",display:"flex",alignItems:"center",justifyContent:"center"})),sC=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px"}));var BP=({payoutStatus:e="PENDING",isTextShown:t,payoutTooltip:o,iconStyles:n,isSheetViewShown:r,chipIndex:i=0,selectionProps:a={}})=>{let{t:s}=useTranslation(),l=zc(useId(),"payout-icon"),p$2=s(zt(e)),d=o||p$2;return r?jsx(b$1,{copyTrigger:"press",copyText:p$2,children:p$2}):jsx(p,{title:d,children:t?jsx(ka,{id:l,"data-testid":"StatusCell_PayoutStatusLabel",children:p$2}):jsx(p$1,{id:l,src:e$1[e],alt:"settled-icon","data-testid":"StatusCell_PayoutStatusIcon",style:n})})};var WP=({isTextShown:e,refundStatus:t="PENDING",refundTooltip:o="",refundCount:n,iconStyles:r,isSheetViewShown:i,chipIndex:a=0,selectionProps:s={}})=>{let{t:l}=useTranslation(),p$2=useTheme(),d=zc(useId(),"refund-icon"),m=(n||0)>1,u=l(zt(t));if(i)return jsxs(b$1,{copyTrigger:"press",copyText:u,children:[u," ",m?`${n}x`:null]});let c=jsxs(yx,{"data-testid":"StatusCell_RefundsCountBadge",initial:{width:0,opacity:0,padding:"0px"},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex",padding:"1.285px 2.569px"},fadeIn:{transition:{delay:.5},opacity:1}},children:[n,"x"]});return e?jsx(p,{title:jsx("div",{children:jsx("div",{children:o})}),children:jsx(ka,{id:d,"data-testid":"StatusCell_RefundStatusLabel",sx:{color:d$4[t].color,backgroundColor:d$4[t].backgroundColor,width:"90px"},children:jsxs(Sp,{whileInView:m?["animate","fadeIn"]:void 0,variants:{animate:{boxShadow:p$2.shadows[4],gap:p$2.spacing(.5)}},children:[u," ",m?c:null]})})}):jsx(p,{title:jsx("div",{children:jsx("div",{children:o})}),children:m?jsxs(Sp,{id:d,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:p$2.shadows[4],gap:p$2.spacing(.5)}},children:[jsx(hx,{src:qk$1,alt:"multi-refunded-icon","data-testid":"StatusCell_MultiRefundIcon"}),c]}):jsx(p$1,{id:d,src:c$6[t],alt:"refunded-icon","data-testid":"StatusCell_RefundStatusIcon",style:r})})},lC=WP;var HP=lC;var OP={american_express:"AMEX",debit:"card",credit:"card",unionpay:"UnionPay",jaywan:"JAYWAN"},Ie=e=>OP[e?.toLowerCase()||""]||e;styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));var pC=styled$1("img")(()=>({maxWidth:"24px",maxHeight:"16px"}));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"}));var mC=styled$1("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),dC=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%"}));styled$1("span")(({theme:e})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));var cC=styled$1("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function mt({source:e,isTextShown:t,title:o,width:n,height:r,imgSx:i}){let{t:a}=useTranslation(),s=h$2(e);return jsx(p,{title:o,children:t?jsx(dC,{"data-testid":"SourceCell_BadgeTextWrapper",children:jsx(mC,{"data-testid":"SourceCell_TextLabel","data-source":e,children:a(zt(e))})}):jsx(pC,{src:s,alt:e,width:n,height:r,onError:l=>{l.currentTarget.src=h$2("card");},sx:i})})}function jP({payment:e,card:t,isTextShown:o,firstIcon:n}){let r=zc(useId(),"source-icons"),{t:i}=useTranslation(),a=useCallback(()=>{let p=[],d=cc(e),m=e?.method,u=e?.scheme;return Ie(m)?.toLowerCase()===Ie(u)?.toLowerCase()?p.push(Ie(m),Ie(d)):p.push(Ie(m),Ie(d),Ie(u)),p},[e]),s=useMemo(()=>jsx(mt,{source:n,isTextShown:o,title:i(zt(n))},n),[n,o,i]),l=useMemo(()=>a()?.filter(p=>!!p&&p!==n)?.map((p,d,m)=>{let u=e?.wallet===i("sv_wallet")?i("storedValueWallet"):i("passThruWallet"),c=d===m.length-1&&t?.last_four?`${i(zt(p))} - ${t?.last_four}`:i(zt(p));return jsx(mt,{source:p,isTextShown:o,title:d===0&&p==="Wallet"?u:c},`${p}-${d}`)}),[a,e,t,o,i,n]);return jsxs(Box,{id:r,"data-testid":"SourceIcons",display:"flex",alignItems:"center",gap:.5,children:[n&&s,l,t?.last_four&&jsxs(cC,{children:["\xB7\xB7\xB7 ",t?.last_four]})]})}var Cr={PROCESSED:Sg,FAILED:""};var xC=styled$1("span")(({theme:e})=>({fontSize:"11px",padding:"2px 0",color:e.palette.text.primary})),CC=styled$1("img")(()=>({width:"16px",height:"16px"})),hC=styled$1("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function Wa({status:e,isTextShown:t,isSheetViewShown:o}){let n=useTheme$1(),{t:r}=useTranslation(),i=zc(useId(),"destination-icon"),a=r(zt(e));return o&&Cr[e]?jsx(b$1,{copyTrigger:"press",copyText:a,children:a}):t&&Cr[e]?jsx(xC,{id:i,"data-testid":"ChargeStatusIcon_isTextShown","data-status":zt(e),sx:{background:"#1F88D00D",color:e==="PROCESSED"?n.palette.info.dark:n.palette.common.black},children:a}):jsx(hC,{id:i,"data-testid":"DestinationIcon",className:"destination-status",children:e&&Cr[e]&&jsx(p,{title:r(zt(e)),children:jsx(CC,{src:Cr[e],alt:"destination-icon"})})})}function QP({deviceType:e,geographyVariant:t,isTextShown:o,deviceCountry:n,...r}){return jsx(a,{...r,children:jsxs(zn,{sx:{display:"flex",gap:"8px",alignItems:"center"},children:[jsx(xo,{geographyVariant:t,isTextShown:o,countryCode:n}),jsx(c$5,{type:e,isTextShown:o})]})})}var e1=QP;var yC=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1),position:"relative",minWidth:"23px",height:"24px"})),IC=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`})),bC=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 SC=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 r1({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,...a}){let s=useMemo(()=>{if(typeof e=="number")return e;let d=Number(e);return Number.isNaN(d)?void 0:d},[e]),l=s!==void 0?s>0:!!e,p$1=s!==void 0&&s>1;return !l||r?null:jsx(zn,{sx:{width:"fit-content",overflow:"visible"},...a,children:jsx(p,{title:t,children:jsxs(bC,{children:[jsx(SC,{src:z$1,pointLeft:i==="left"}),p$1&&jsx(yC,{children:jsx(IC,{children:e})})]})})})}var i1=r1;function l1(e){let{destination:t,...o}=e,n={...o};delete n.destinationsCount,delete n.destinationsTooltip,delete n.destinationsAmount,delete n.hidden,delete n.iconDirection,delete n.selectionProps,delete n.flagIcon;let r=t?.destination||[];return jsx(zn,{sx:{display:"flex",gap:"4px",alignItems:"center"},...n,children:r.map((i,a)=>{let s=Ha(i?.amount||0),l=`${s.integerAmount}.${s.decimalAmount}`;return jsxs(b$1,{copyTrigger:"press",copyText:l,children:[i?.id," | ",jsx(a$f,{currency:i?.currency})," ",l]},i?.id||a)})})}var p1=l1;function c1({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,...a}){let s=o?.destination||[],l=Ha(n||0),p$1=Ha(s?.[0]?.amount||0);return !e||r?null:jsx(zn,{sx:{width:"fit-content",overflow:"visible"},...a,children:jsx(p,{title:t,children:jsx(j,{sx:{textAlign:"left",justifyContent:"flex-start",height:"auto"},children:e&&typeof e=="number"&&e>1?jsxs("div",{children:["Destination ",s?.[0]?.id," - ",jsx(a$f,{currency:s?.[0]?.currency})," ",p$1.integerAmount,".",p$1.decimalAmount," +",e-1]}):jsxs("div",{children:["Destination ",s?.[0]?.id," - ",jsx(a$f,{currency:s?.[0]?.currency})," ",l.integerAmount,".",l.decimalAmount]})})})})}var u1=c1;var U_=({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=Ha(r.amount||0);return jsxs("div",{children:[r?.id," - ",jsx(a$f,{currency:r?.currency})," ",i.integerAmount,".",i.decimalAmount]},r?.id)})]}):jsxs("div",{children:["Destination ",o?.[0]?.id," - ",jsx(a$f,{currency:o?.[0]?.currency})," ",t.integerAmount,".",t.decimalAmount]})};var vC=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"})),PC=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 EC(e){return e<5?5:e===100?95:e}function h1({percentage:e=0,days:t,remainingAmount:o=0,currency:n,...r}){let i=useTheme(),a$1=jsx(a$f,{currency:n}),{integerAmount:s,decimalAmount:l}=Ia$1(o,n),p$1=`${s}.${l}`,d=useMemo(()=>jsxs(Fragment,{children:["Remaining Authorized Balance - ",a$1," ",p$1]}),[o,n]);return e===0||o<0?null:jsx(a,{...r,children:jsx(p,{title:d,placement:"top",children:jsx("div",{style:{height:24},children:jsxs(vC,{whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:22},variants:{animate:{...!!t&&{boxShadow:i.shadows[4]}}},children:[jsxs(PC,{percentage:e,children:[e,"% ",jsx(q,{percentage:EC(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 y1=h1;function b1({remainingAmount:e,currency:t}){let o=jsx(a$f,{currency:t}),{integerAmount:n,decimalAmount:r}=Ia$1(e,t),i=`${n}.${r}`;return jsxs(b$1,{copyTrigger:"press",copyText:`${n}.${r}`,children:[o," ",i]})}var S1=b1;var Up=["authenticationMode","paymentAuth","paymentAgreement"],Gp=["paymentIssuer","paymentInitiated","paymentDevice"],MC=["paymentMethod","paymentType","paymentScheme","paymentCardNumber",...Gp,...Up];var RC=styled(zn)(()=>({marginRight:"8px",display:"flex",alignItems:"center",gap:"4px"})),LC=styled(zn)(()=>({marginLeft:"8px",width:20}));function E1(e){let{centerIcon:t,centerIconId:o}=useMemo(()=>{for(let a of MC)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$3,{expandedZIndex:0,centerIcon:t,leftIcons:Gp.filter(a=>a!==o&&e?.[a]).map(a=>e?.[a]),rightIcons:Up.filter(a=>a!==o&&e?.[a]).map(a=>e?.[a]),expandableCenterRight:(n||r)&&jsxs(RC,{children:[n&&e.paymentScheme,r&&e.paymentCardNumber]}),expandableCenterLeft:i&&jsx(LC,{children:e.paymentType})})}var M1=memo(E1);var kC=styled("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function O3({card:e,paymentMethod:t,paymentType:o,paymentScheme:n}){let{t:r}=useTranslation();if(!e.last_four)return null;let i=e?.name||`${r(zt(dc$1(t,n)?o:n))} - ${e?.last_four}`;return jsx(p,{title:i,children:jsxs(kC,{children:["\xB7\xB7\xB7 ",e?.last_four]})})}function Y3({method:e}){let{t}=useTranslation();return e?jsx(mt,{source:Ie(e)??e,title:`Payment Method - ${t(zt(e))}`}):null}function J3({type:e}){let{t}=useTranslation();return e?jsx(mt,{source:Ie(e)??e??"",title:`Payment Type - ${t(zt(e))}`}):null}function r8({scheme:e}){let{t}=useTranslation();return e?jsx(mt,{source:Ie(e)??e,title:`Payment Scheme - ${t(zt(e))}`}):null}var FC=({mode:e})=>e?jsx(p,{title:_o[e],children:jsx(zn,{component:"img",src:e==="C"?da$1:ca$1})}):null;var Oa={ORDER:{label:"order",icon:vi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:xi,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:yi,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:wi,color:"#32ADE6"}},_a={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 za=styled$1("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),$a=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"})),VC=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"})),WC=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Yp=styled$1("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),Ua=(e,t)=>({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"}}});function q1({type:e,hasSavedCard:t,totalPaymentsCount:o,isTextShown:n,...r}){let i=useTheme(),{t:a$1}=useTranslation(),s=useMemo(()=>[...t?[_a.SAVED_TOKEN]:[],...(o||0)>0?[_a.COUNT]:[],...e&&Oa[e]?[Oa[e]]:[]],[t,o,e]),l=u=>n?jsx(a$g,{"data-testid":"AgreementCell_countBadge",order:u,variants:Ua(u,n?85:0),children:jsx(p,{title:a$1("totalPaymentCount",{amount:f$5(o)}),children:jsx($a,{children:jsxs(za,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:_a.COUNT.color},children:["x",o]})})})},u):jsx(a$n,{value:o,index:u},u),p$1=s.map((u,c)=>u.label==="countBadge"?l(c):jsx(p,{title:a$1(u.label),children:jsx(a$g,{order:c,variants:Ua(c,c>1&&n?62:0),sx:{width:n?"auto":"36px"},children:n?jsx($a,{children:jsx(za,{"data-testid":"AgreementCell_agreementType",sx:{color:u.color},children:a$1(u.label)})}):jsx(Yp,{src:u.icon,alt:"agreement"})},u.color)},u.color)),d=p$1.length,m=jsx(p,{title:"No agreement",children:jsx(a$g,{order:0,variants:Ua(0,0),sx:{width:n?"auto":"36px"},children:n?jsx($a,{children:jsx(za,{"data-testid":"AgreementCell_agreementType",sx:{color:i.palette.text.secondary},children:"No agreement"})}):jsx(Yp,{src:Ci,alt:"no-agreement"})},"no-agreement")},"no-agreement");return jsx(a,{...r,children:jsx(WC,{"data-testid":"AgreementCell",children:jsx(VC,{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$1?.length>0?p$1:m})})})}var X1=q1;var OC=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 Q1({hasAuth:e,tooltip:t,isTextShown:o,align:n,...r}){return jsx(a,{style:{textAlign:n||"center",overflow:"visible",display:"flex",width:"100%",justifyContent:n==="left"?"flex-start":"center"},...r,children:e?jsx(p,{title:t,children:jsx(d,{"data-testid":"AuthCell_BadgeWrapper",children:o?jsx(j,{"data-testid":"AuthCell_TextLabel",sx:{minWidth:"max-content"},children:t}):jsx(OC,{src:na,alt:"icon","data-testid":"AuthCell_AuthIcon"})})}):null})}var eE=Q1;var _C={REFUNDED:ok,PAID_OUT:nk$1,SETTLED:qk$1,PENDING:pk,UNKNOWN:xk,TIMEDOUT:vk,CANCELLED:gk,FAILED:kk$1,DECLINED:ik,RESTRICTED:sk,IN_PROGRESS:Ak$1,ACCEPTED:rk},zC={REFUNDED:"refunded"};function $C({status:e,refundTooltip:t}){let{t:o$1}=useTranslation();return jsx(p,{title:jsxs("div",{children:[jsx("div",{children:o$1(zt(e))}),t]}),children:jsx(o,{children:jsx("img",{src:_C[e],alt:"refund-requested"})})})}function GC({status:e,gatewayTooltip:t,unCapturedTooltip:o,acquirerTooltip:n,errorCode:r,acquirerCode:i,gatewayCode:a,refundTooltip:s}){let{t:l}=useTranslation();return Kn?.includes(e??"")?jsx(It,{chargeStatus:e,gatewayTooltip:t,chargeTooltip:o,acquirerTooltip:n,errorCode:r,acquirerCode:i,gatewayCode:a,iconWrapperStyles:{height:17}}):jsx($C,{status:e,refundTooltip:s})}var YC=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})),ZC=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})),jC=styled(po)(({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 KC=styled("img")({width:"14px",height:"14px"}),qC=styled(zn)(({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 Zp({status:e,refundIcon:t,refundTooltip:o,refundTooltipLabel:n,date:r,gatewayTooltip:i,unCapturedTooltip:a,acquirerTooltip:s,errorCode:l,acquirerCode:p$1,gatewayCode:d,zone:m,timezone:u}){let c=useTheme(),{t:f}=useTranslation(),x=Pe(m,u),C=r==null?void 0:o$1(r,x),S=useMemo(()=>t||(e==="REFUNDED"?ok:qk$1),[e,t]);return ["REFUNDED","PAID_OUT"].includes(e??"")?jsx(p,{title:jsxs("div",{children:[jsx("div",{children:n??f(zC.REFUNDED)}),o]}),children:jsxs(YC,{whileHover:["animate","fadeIn"],animate:"start",variants:{...r&&{animate:{boxShadow:c.shadows[4]}}},sx:{...!r&&{backgroundColor:"transparent"}},children:[jsx(KC,{sx:{...!r&&{width:"16px",height:"16px"}},src:S,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(ZC,{children:jsx(jC,{value:new Date(r),rendered:C})})})]})}):jsx(GC,{status:e,refundTooltip:o,gatewayTooltip:i,unCapturedTooltip:a,acquirerTooltip:s,errorCode:l,acquirerCode:p$1,gatewayCode:d})}var JC=()=>{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 gE({status:e,date:t,refundTooltip:o,isTextShown:n,gatewayTooltip:r,acquirerTooltip:i,errorCode:a$1,acquirerCode:s,gatewayCode:l,unCapturedTooltip:p$1,zone:d,timezone:m$1,refundTooltipLabel:u,refundIcon:c,...f}){let{t:x}=useTranslation(),C=JC(),S=Pe(d,m$1),g=useCallback(w=>{let T=m(w,S);return T?dc(T).format("MMM D, YYYY"):""},[S]),h=Kn.includes(e);return jsx(a,{...f,style:{overflow:"visible"},children:jsx(n$1,{children:jsx(qC,{width:n?"auto":"36px",sx:{...h&&{border:"none"}},children:n?jsx(p,{title:t?g(t):x(zt(e)),children:jsx(j,{sx:{...C[e]?C[e]:C.PENDING},children:x(zt(e))})}):jsx(Zp,{status:e,refundTooltip:o,date:t,gatewayTooltip:r,unCapturedTooltip:p$1,acquirerTooltip:i,errorCode:a$1,acquirerCode:s,gatewayCode:l,zone:S,refundTooltipLabel:u,refundIcon:c})})})})}var xE=gE;var eh=styled$1("img")(()=>({width:"16px",height:"16px"})),th=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),oh=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`})),nh=styled$1("span")(({theme:e})=>({color:e.palette.info.dark,fontSize:"14px",lineHeight:"16.8px"}));function CE({walletId:e,country:t,showCountry:o=true,...n}){return jsx(a,{style:{textAlign:"center",overflow:"visible"},...n,children:jsxs(th,{children:[o&&t&&jsx(p,{title:La(t),children:jsx(a$4,{countryCode:t})}),jsxs(oh,{children:[jsx(eh,{src:ac$2,alt:"wallet-icon"}),e&&jsxs(nh,{children:["\xB7\xB7\xB7\xB7 ",e?.substring((e?.length||0)-4)]})]})]})})}var hE=CE;var rh=styled$1("img")(()=>({width:"16px",height:"16px"})),ih=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),ah=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}`})),sh=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 yE({walletId:e,country:t,name:o,...n}){return jsx(a,{style:{textAlign:"center",overflow:"visible"},...n,children:jsxs(ih,{children:[t&&jsx(p,{title:La(t),children:jsx(a$4,{countryCode:t})}),jsxs(ah,{children:[jsx(rh,{src:bc$1,alt:"bank-icon"}),e&&jsxs(sh,{children:[o," \xB7\xB7\xB7\xB7 ",e?.substring((e?.length||0)-4)]})]})]})})}var IE=yE;var qp={PAID_OUT:nk$1,SETTLED:tk,PENDING:Oh,INITIATED:Oh,FAILED:kk$1};function wE({payoutStatus:e="PAID_OUT",...t}){let{t:o$1}=useTranslation(),n=useTheme();return jsx(a,{...t,children:jsx(n$1,{children:jsx(o,{className:"payout-status",style:{visibility:"visible",width:"36px",borderRadius:"23.1px",backgroundColor:n.palette.common.white,border:`1.029px solid ${n.palette.divider}`},children:e&&qp[e]&&jsx(p,{title:o$1(zt(e)),children:jsx(p$1,{src:qp[e],alt:"settled-icon",style:{width:"16px",height:"16px",objectFit:"contain"}})})})})})}var vE=wE;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 PE=styled("span")(({theme:e})=>({textDecorationLine:"underline",color:e.palette.info.dark}));var Xp=a$h;function AE({status:e,chargeStatus:t,isTextShown:o,...n}){let{t:r}=useTranslation();return jsx(a,{...n,children:jsxs(n$1,{children:[jsx(Wa,{status:e,isTextShown:o}),t&&Xp[t]&&jsx(p,{title:r(zt(t)),children:jsx(p$1,{src:Xp[t],alt:"charge-icon"})})]})})}var DE=AE;var LE={FAILED:dh$1,PENDING:kh,INITIATED:$g,ATTEMPTED:_g,EXEMPTED:ch$1,EXEMPTED_WITH_TRANSACTION:ch$1,EXEMPTED_WITHOUT_TRANSACTION:bh$1,REJECTED:ah$1,UNAVAILABLE:fh$1,UNDETERMINED:gh$1,SUCCESS:jh,AUTHENTICATED:ih$1,AUTHENTICATED_WITH_TRANSACTION:ih$1,AUTHENTICATED_WITHOUT_TRANSACTION:ih$1,AUTHENTICATED_AUTHORIZE_FAILED:dh$1},Jp={FAILED:lh$1,PENDING:mh$1,INITIATED:nh$1,ATTEMPTED:oh$1,EXEMPTED:ph$1,EXEMPTED_WITH_TRANSACTION:ph$1,EXEMPTED_WITHOUT_TRANSACTION:qh$1,REJECTED:rh$1,UNAVAILABLE:sh$1,UNDETERMINED:th$1,SUCCESS:uh$1,AUTHENTICATED:vh$1,AUTHENTICATED_WITH_TRANSACTION:vh$1,AUTHENTICATED_WITHOUT_TRANSACTION:wh$1,AUTHENTICATED_AUTHORIZE_FAILED:lh$1},Io=a$h;function NE({status:e,authorizedStatus:t,chargeStatus:o,chargeTooltip:n,gatewayTooltip:r,acquirerTooltip:i,errorCode:a$1,...s}){let{t:l}=useTranslation(),p$1=useTheme(),d=[e&&Jp[e]?jsx(p,{title:l(zt(e)),children:jsx("img",{src:Jp[e],alt:"authentication-icon",style:{width:"36px",height:"24px",objectFit:"scale-down"}})}):null,o&&Io[o]?jsx(p,{title:l(zt(o)),children:jsx(It,{showAuthorizedStatus:true,chargeStatus:o,gatewayTooltip:r,chargeTooltip:n,acquirerTooltip:i,errorCode:a$1})}):null,t&&f$4[t]?jsx(p,{title:l(zt(t)),children:jsx("img",{src:f$4[t],alt:"authorized-icon",style:{width:"36px",height:"20px",objectFit:"scale-down"}})}):null].filter(Boolean),m=d.length||0;return jsx(a,{...s,sx:{position:"relative",overflow:"visible"},children:jsx(en,{whileHover:"animate",animate:"start",statusesCount:m,children:d.map((u,c)=>u?jsx(Qo,{order:c,variants:Xo(c,p$1.shadows[4],40),children:jsx(Jo,{children:u})},c):null)})})}var FE=NE;var em={issuer:Xh$1,scheme:Yh$1,device:Vh$1,app:Uh$1,wallet:Th,biometric:Vh$1};function HE({type:e,...t}){let{t:o$1}=useTranslation();return jsx(a,{...t,children:jsx(n$1,{children:jsx(o,{className:"authentication-status",children:e&&em[e]&&jsx(p,{title:o$1(zt(e)),children:jsx(p$1,{src:em[e],alt:"authentication-type"})})})})})}var OE=HE;var lh={SMS:$d$1,EMAIL:Xd,WHATSAPP:ae};var ph=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),mh=styled$1("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),dh=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"})),ch=styled$1("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),uh=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"})),fh=(e,t)=>({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"}}});function UE({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]},s=e?.sort(p=>p==="EMAIL"?-1:p==="SMS"?1:p==="WHATSAPP"?2:0)?.filter(p=>!!p)?.map((p$1,d)=>{if(!p$1)return null;let m=n(p$1?.toLowerCase());return jsx(b$c,{order:d,variants:fh(d,t?74:0),sx:{width:t?"70px":"36px"},children:jsx(p,{title:m,placement:"top",wrapperProps:{sx:{width:"100%",height:"100%",justifyContent:"center"}},children:t?jsx(uh,{children:jsx(ch,{sx:{color:i[p$1]},children:m})}):jsx(mh,{src:lh[p$1],alt:p$1})})},`${p$1}-${d}`)}),l=s?.length||0;return jsx(a,{...o,children:jsx(ph,{children:s?.length>0?jsx(dh,{layout:true,className:"payment-sources-container",whileHover:"animate",animate:"start",sourcesCount:l||0,variants:{animate:{width:(l||0)*38}},style:{zIndex:29},children:s}):null})})}var GE=UE;function Er(e,t){return o$1(e,t??f$1()??b$7,{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 gh=styled$1(j$1)(({theme:e})=>({fontSize:"11px",fontWeight:500,color:"#000",cursor:"default"}));function ZE({dueDate:e,expiryDate:t,zone:o,timezone:n,...r}){let i=Pe(o,n),a$1=useMemo(()=>({label:Er(dc(e).valueOf(),i),tooltip:"Due Date"}),[e,i]),s=useMemo(()=>({label:Er(dc(t).valueOf(),i),tooltip:"Expiry Date"}),[t,i]),l=m=>jsx(p,{title:m.tooltip,children:jsx(gh,{children:m.label})}),p$1=useMemo(()=>e?l(a$1):t?l(s):null,[a$1,s,e,t]),d=useMemo(()=>t&&e?[l(s)]:[],[a$1,s,e,t]);return !e&&!t?null:jsx(a,{...r,sx:{position:"relative",overflow:"visible"},children:jsx(a$3,{sx:{justifyContent:"flex-start"},centerIcon:p$1,rightIcons:d})})}var jE=ZE;var Ch=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 tm=styled$1("img")({width:"24px",height:"24px"});function XE({products:e,...t}){let o=Cc("product"),n=e?.map((i,a)=>jsx(tm,{sx:{...i?.toLowerCase()===An$1.tokens.code?.toLowerCase()&&{borderRadius:"8px",border:"1px solid rgba(0, 0, 0, 0.10)"}},className:"app-logo",src:Cn.find(s=>s.code?.toLowerCase()===i?.toLowerCase())?.iconUrl,alt:"product-icon"},o(i,a))),r=jsxs(Ch,{whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:"10px 0px 8px 0px #F2F2F2"}},children:[jsx(tm,{src:si$1,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:n})]});return jsx(a,{...t,style:{overflow:"visible"},children:jsx(n$1,{children:jsx("div",{style:{width:"30px",position:"relative",zIndex:24},children:r})})})}var JE=XE;function Ja(e){return jsx(m$1,{...e,children:jsx(p,{title:e.tooltip||e.children,children:e.children})})}var bh=styled(zn)(()=>({display:"flex",alignItems:"center",gap:"8px"})),Sh=styled(zn)(({theme:e})=>({fontSize:"14px",color:e.palette.text.primary,lineHeight:"16.8px"}));function e7({currency:e}){return jsxs(bh,{children:[jsx(a$4,{currencyCode:e}),jsx(Sh,{children:e})]})}function wh({value:e,zone:t,timezone:o,...n}){let r=Pe(t,o),i=useMemo(()=>{let a={sameDay:"[Today]",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM D, YYYY",lastWeek:"MMM D, YYYY",nextWeek:"MMM D, YYYY"};return o$1(e instanceof Date?e:new Date(e),r,a)},[e,r]);return jsx(a,{...n,children:i})}var vh=styled(zn)(({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 h7({reference:e}){return e?jsx(p,{title:`Bank - ${e}`,children:jsx(vh,{children:jsx(zn,{component:"img",src:ob$2,alt:"bank",width:14})})}):jsx(Fragment,{})}var om={acquirer:ob$2,generic:pb,payment:Zd,gateway:rn,order:Yd};var Ph=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Eh=styled$1("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),Mh=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"})),Ah=styled$1("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),Dh=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"}));styled$1("div")(()=>({height:"18px"}));var Rh=(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}});var dM=120,cM=50;function uM({isTextShown:e,getTooltipTitle:t,...o}){let[n,r]=useState(false),[i,a$1]=useState(null),s=useRef(null),l=useRef(false),p$1=useRef(false),d=useRef(null),m=useTheme(),u=useMemo(()=>Object.keys(om).filter(T=>!!o[T]),[o]),c=()=>{d.current&&(clearTimeout(d.current),d.current=null);},f=()=>{a$1(s.current);},x=()=>{l.current=true,p$1.current=false,r(true),a$1(null),c(),d.current=setTimeout(()=>{p$1.current=true,f();},dM);};useEffect(()=>()=>c(),[]);let C=()=>{l.current||x();},S=()=>{c(),s.current=null,l.current=false,p$1.current=false,a$1(null),r(false);},g=T=>{if(s.current=T,p$1.current){c(),a$1(T);return}l.current||x();},h=()=>{s.current=null,p$1.current&&(c(),d.current=setTimeout(f,cM));},w=u.length;return jsx(a,{...o,children:jsx(Ph,{children:w>0?jsx(Mh,{layout:true,className:"reference-sources-container",whileHover:"animate",onHoverStart:C,onHoverEnd:S,animate:n?"animate":"start",sourcesCount:w,variants:{animate:{width:w*38}},style:{zIndex:29},children:u.map((T,y)=>{let b=t?.(T)||`${Bh$1(T)} - ${o[T]}`,v=i===T;return jsx(b$c,{order:y,variants:Rh(y,m.shadows[4],e?83:0),sx:{width:e?"79px":"36px"},onMouseEnter:()=>g(T),onMouseLeave:h,children:jsx(p,{open:v,disableHoverListener:true,disableInteractive:true,title:v?b:"",children:e?jsx(Dh,{children:jsx(Ah,{children:Bh$1(T)})}):jsx(Eh,{src:om[T],alt:T,sx:{...T==="order"&&{width:"11.82px"}}})})},`${T}-${y}`)})}):null})})}var fM=uM;var nm={Y:{tooltip:"Authenticated",icon:ih$1,borderColor:"rgba(31, 136, 208, 0.10)"},N:{tooltip:"Failed Authentication",icon:Tg,borderColor:"rgba(240, 130, 0, 0.10)"},R:{tooltip:"Failed Authentication",icon:Tg,borderColor:"rgba(240, 130, 0, 0.10)"},A:{tooltip:"Attempted",icon:_g,borderColor:"rgba(31, 136, 208, 0.10)"},U:{tooltip:"Failed Authentication",icon:Tg,borderColor:"rgba(240, 130, 0, 0.10)"},noAuth:{tooltip:"Not Authenticated",icon:$g,borderColor:"#F2F2F2"}},rm={"3DS":{tooltip:"3DS",icon:Qj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Pj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:Qj,borderColor:"rgba(31, 136, 208, 0.10)"}};styled$1("img")(()=>({width:"12.67px",height:"15px"}));var Nh=styled$1(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Fh=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 Vh=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"})),Wh=(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}}}),Hh=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}));function xM({transactionStatus:e,isTextShown:t,eci:o,authType:n,...r}){let i=useTheme$1(),a$1=useMemo(()=>{let p=nm[e??"noAuth"]??nm.noAuth,d=p?.tooltip,m=p?.icon;return [{tooltip:d,content:t?d:m,type:t?"text":"icon"},...n?[{tooltip:n,content:t?rm[n]?.tooltip:rm[n]?.icon,type:t?"text":"icon"}]:[],{tooltip:"",content:o?`ECI ${o}`:"",type:"text"}]},[e,o,t]),s=useMemo(()=>a$1.filter(p=>!!p.content).map((p$1,d)=>{let m=p$1.type==="text"?jsx(Hh,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(j,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":p$1.content,children:p$1.content})}):jsx(Fh,{src:p$1.content,alt:p$1.tooltip});return jsx(p,{title:p$1.tooltip,children:jsx(b$c,{order:-1*d,variants:Wh(d,i.shadows[4],t?124:39),sx:{...p$1.type==="text"&&{width:t?"120px":"58px"}},children:m})},`${p$1.tooltip}-${d}`)}),[r,a$1,t,i]),l=s.length;return jsx(a,{...r,children:jsx(Nh,{children:l>0?jsx(Vh,{layout:true,className:"authentication-sources-container",whileHover:"animate",animate:"start",sourcesCount:l,variants:{animate:{width:38}},style:{zIndex:29},children:s}):null})})}var CM=xM;var im={checkout:Ch$1,checkoutSuccess:Dh$1};function IM({status:e,...t}){let{t:o}=useTranslation();return jsx(a,{...t,sx:{overflow:"visible"},children:jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px",overflow:"visible"},children:e&&im[e]&&jsx(p,{title:o(zt(e)),children:jsx(p$1,{src:im[e],alt:"checkout-icon"})})})})}var bM=IM;var am={TRANSACTED:Ih,INITIATED:Gh$1,CANCELLED:Hh$1,EXPIRED:Fh$1};function zh({status:e,chargeStatus:t,...o}){let{t:n}=useTranslation();return jsx(a,{...o,sx:{overflow:"visible"},children:jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px",overflow:"visible"},children:[e&&am[e]&&jsx(p,{title:n(zt(e)),children:jsx(p$1,{src:am[e],alt:"intents-icon"})}),t&&Io[t]&&jsx(p,{title:n(zt(t)),children:jsx(It,{chargeStatus:t})})]})})}var Uh=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"})),Gh=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 Yh(e){return e<5?5:e===100?95:e}var os={PAID_OUT:{color:"#2ACE00",backgroundColor:"#2ACE000D"},PENDING:{color:"#FF7A00",backgroundColor:"#FF7A000D"},SETTLED:{color:"#2ACE00",backgroundColor:""}};function PM({percentage:e,date:t,payoutStatus:o$1,payoutTooltip:n,chargeTooltip:r,refundCount:i,isTextShown:a$1,...s}){let{t:l}=useTranslation(),p$2=useTheme();return e===0?null:jsx(a,{...s,style:{overflow:"visible",position:"relative"},children:jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px"},children:[jsx(p,{title:r,children:jsxs(Uh,{whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{gap:"4px"}},sx:{...a$1&&{height:"auto",padding:"0",backgroundColor:"transparent"}},children:[jsx(Gh,{percentage:e,sx:{backgroundColor:"#eeeeee",...a$1&&{backgroundColor:"transparent",border:"none"}},variants:{...!a$1&&{animate:{boxShadow:p$2.shadows[4]}}},children:a$1?jsxs(j,{children:[e,"%"]}):jsxs(Fragment,{children:[e," % ",jsx(q,{percentage:Yh(e)})]})}),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$2.shadows[4]},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs(z,{compact:true,color:"neutral",children:[i,"x"]})})})]})}),jsx(o,{className:"payout-status",style:{visibility:o$1==="PENDING"?"hidden":"visible",position:"relative",left:"57px",width:a$1?"auto":"24px"},children:o$1&&e$1[o$1]&&jsx(p,{title:n||l(zt(o$1)),children:a$1?jsx(j,{sx:{color:os[o$1].color,border:`1px solid ${os[o$1].color}1a`,backgroundColor:os[o$1].backgroundColor},children:l(zt(o$1))}):jsx(p$1,{src:e$1[o$1],alt:"settled-icon"})})})]})})}var EM=PM;var Kh={DELETED:_if,DRAFT:jf,CREATED:kf,CANCELLED:Aa$2,CANCELED:Aa$2,EXPIRED:Ba,PAID:nf,REFUNDED:tf,DELIVERED:of,VIEWED:pf,SAVED:qf,SCHEDULED:rf,PENDING:sf,REMINDED:""};function qh(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"}}}function Xh({chargeStatus:e,chargeTooltip:t,errorCode:o,iconStyles:n,iconWrapperStyles:r}){let{t:i}=useTranslation(),a=e?b$b[e]:null,s=e&&a$h[e]&&jsx(sC,{style:r,children:jsx(p$1,{src:a$h[e],alt:"charge-icon",style:{width:"16px",height:"16px",...n}})}),l=t&&jsx(Fragment,{children:jsx("div",{children:t})});return e?jsx(p,{title:l??i(zt(e)),children:jsxs(zn,{sx:{display:"flex",gap:"6px",alignItems:"center"},children:[s,!!Kn?.includes(e||"")&&jsx(aC,{style:{background:a?.color},children:o})]})}):null}function Jh({status:e,date:t,viewsCount:o,chargeStatus:n,errorCode:r,chargeTooltip:i,remindedCount:a$1=0,zone:s,timezone:l,...p$1}){let{t:d}=useTranslation(),m=useTheme(),u=Pe(s,l),c=e?Kh[e]:null,f=qh(e),x=`${d(e?.toLowerCase()||"")} ${Er(dc(t).valueOf(),u)}`,C=useMemo(()=>jsx(Xh,{chargeStatus:n,errorCode:r,chargeTooltip:i}),[n,r,i]),S=useMemo(()=>jsx(p,{title:d("reminded"),children:jsxs(zn,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},children:[jsx(Fp,{sx:{width:"14px",height:"14px"},src:je,alt:"icon"}),jsx(z,{style:{background:m.palette.error.main,fontWeight:600,color:m.palette.common.white},children:a$1})]})}),[a$1]),g=useMemo(()=>{if(c)return jsx(p,{title:d(x||""),children:jsx(Fp,{src:c,alt:"status icon"})});if(n&&Io[n])return C;if(a$1)return S},[c,n,a$1]);return !e&&!n&&!a$1?null:jsx(a,{...p$1,sx:{position:"relative",overflow:"visible"},children:jsx(a$3,{sx:{justifyContent:"flex-start"},expandableCenterRight:o&&e==="VIEWED"&&c?[jsx(z,{style:{marginRight:"8px",color:"#fff",backgroundColor:f.color},children:o})]:void 0,centerIcon:g,leftIcons:a$1&&c?[S]:void 0,rightIcons:n&&Io[n]&&c?[C]:void 0})})}function HM({tooltip:e,children:t,badge:o,...n}){return jsx(a,{style:{textAlign:"center",overflow:"visible"},...n,children:t?jsx(p,{title:e,children:jsx(d,{"data-testid":"BadgeCell_BadgeWrapper",children:jsxs(j,{"data-testid":"BadgeCell_TextLabel",sx:{minWidth:"max-content",gap:"0.5rem"},children:[t,(o||0)>1&&jsxs(z,{color:"dark",style:{fontWeight:"bold"},children:["+",o]})]})})}):null})}var OM=HM;var mm={ACTIVE:gi,EXPIRED:fi,PENDING:gi,SAVED:di,TRANSACTED:ei,CONSUMED:ei};var _M=(u=>(u.ABANDONED="ABANDONED",u.IN_PROGRESS="IN_PROGRESS",u.VOID="VOID",u.CANCELLED="CANCELLED",u.CAPTURED="CAPTURED",u.INITIATED="INITIATED",u.FAILED="FAILED",u.DECLINED="DECLINED",u.RESTRICTED="RESTRICTED",u.TIMEDOUT="TIMEDOUT",u.UNKNOWN="UNKNOWN",u.AUTHORIZED="AUTHORIZED",u))(_M||{});function $M({status:e,chargeTooltip:t,gatewayTooltip:o,acquirerTooltip:n,errorCode:r,cardId:i,hasChargeIcon:a$1,hasAuthorizedIcon:s,...l}){let{t:p$2}=useTranslation();return jsx(a,{...l,sx:{position:"relative",overflow:"visible"},children:jsxs(n$1,{sx:{gap:"0.5rem"},children:[e&&mm[e]&&jsx(p,{title:p$2(zt(e)),children:jsx(p$1,{src:mm[e],alt:"token-icon"})}),i&&jsx(p,{title:p$2(zt(e)),children:jsx(p$1,{src:hi,alt:"card-icon"})}),a$1&&jsx(p,{title:p$2(zt("CAPTURED")),children:jsx(It,{showAuthorizedStatus:true,chargeStatus:"CAPTURED",gatewayTooltip:o,chargeTooltip:t,acquirerTooltip:n,errorCode:r})}),s&&jsx(p,{title:p$2(zt("AUTHORIZED")),children:jsx(p$1,{src:f$4.AUTHORIZED,alt:"authorized-icon"})})]})})}var UM=$M;var cm=styled$1("img")(()=>({maxWidth:"13px",maxHeight:"13px"})),ey=styled$1("div")(({theme:e})=>({width:"24px",height:"24px",border:`1px solid ${e.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%"})),ty=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));function YM({brandName:e,brandIcon:t,...o}){return jsx(a,{style:{textAlign:"center",overflow:"visible"},...o,children:jsxs(ty,{children:[jsx(ey,{children:t?jsx(p,{title:e,children:jsx(cm,{src:t,alt:"brand icon",onError:r=>{r.currentTarget.src=zi;}})}):jsx(cm,{src:zi,alt:"brand icon"})}),jsx("span",{children:e})]})})}var ZM=YM;function ny({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(p,{title:a,children:jsx(Box,{component:"img",src:_j,alt:"meta",sx:{cursor:"pointer"}})}):null}var iy=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"})),ay=styled(motion.img)(()=>({width:"16px",height:"16px"}));var JM=({onClick:e,isSettlementsAvailable:t,isDownloadError:o,isDownloadLoading:n,isDownloadSuccess:r})=>{let i=useMemo(()=>n||r||o,[n,r,o]),a=useMemo(()=>r?ic$1:o?hc$1:Yj,[r,o]);return jsx(p,{title:t?"":"Pending",children:jsx(iy,{onClick:()=>t&&!i&&e(),children:jsx(AnimatePresence,{mode:"wait",initial:false,children:n?jsx(a$i,{},"spinner"):jsx(ay,{src:t?a:Zj,alt:"Download Report"})})})})};var eA=({receiptId:e})=>jsx(TableCell,{component:"div",children:jsx(p,{title:`Receipt - ${e}`,children:jsx(j,{sx:{padding:"3px 8px",maxWidth:"50px"},children:jsx("img",{src:pc,alt:"receipt"})})})});var tA=({receiptId:e})=>jsx(m$1,{children:jsx("span",{children:e})});var oA=({receiptId:e})=>jsx(Ja,{children:jsx("span",{children:e})});var my=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"}})),dy=styled$1(zn)(()=>({display:"flex",alignItems:"center",gap:"4px",overflow:"hidden",width:"100%"}));styled$1("img")(()=>({width:"16px",height:"11.73px"}));var cy=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"}})),uy=styled$1("img")(()=>({width:"10.5px",height:"10.5px"})),fy=styled$1("div")({marginLeft:"auto",width:"auto"});var gy={incomplete:Gj,complete:Fj,reviewed:Fj,verified:Hj};function xy({entity:e,country:t,verificationStatus:o,licenseNumber:n,hideStatus:r,...i}){let a$1=gy[o??"incomplete"];return jsx(a,{...i,sx:{cursor:i?.onClick?"pointer":"default"},children:jsx(p,{title:e,children:jsx(my,{hasClick:!!i?.onClick,licenseNumber:n,children:jsxs(dy,{children:[jsx(p,{title:t?La(t):"",children:jsx(a$4,{countryCode:t})}),jsx(cy,{licenseNumber:n,children:n||"Not Available"}),!r&&jsx(fy,{children:jsx(uy,{src:a$1})})]})})})})}var Cy=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),hy=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 yy=(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 by({acceptance:e,payout:t,hideAcceptance:o,hidePayout:n,closed:r,...i}){let a$1=e?.toLowerCase()==="enabled",s=t?.toLowerCase()==="enabled",l=r?.toLowerCase()==="closed",[p$1,d]=useState(false),m=useTheme(),u=useMemo(()=>[{icon:a$1?tc$1:Di,tooltip:"Acceptance",enabled:a$1,shown:!o,zIndex:a$1&&!s?3:1},{icon:s?uc:Hi,tooltip:"Payout",enabled:s,shown:!n,zIndex:2},{icon:ai$1,tooltip:"Closed",enabled:l,shown:l,zIndex:3}].filter(x=>x.shown),[a$1,s,o,n,l]),c=useMemo(()=>u.map((x,C)=>{let S=x.tooltip;return jsx(b$c,{order:C,variants:yy(C,m.shadows[4],40),sx:{width:"36px",zIndex:x.zIndex+6},children:jsx(p,{onOpen:()=>{d(true);},onClose:()=>{d(false);},title:S,children:jsx(a$j,{mainIcon:x.icon,mainIconSize:16,containerSize:16,sx:{borderRadius:"40px"},onError:g=>{g.currentTarget.src=x.icon,g.currentTarget.style.borderRadius="0px";},borderColor:"transparent"})})},`${x.tooltip}-${C}`)}),[u,m]),f=u?.length||0;return jsx(a,{...i,children:jsx(Cy,{children:f>0?jsx(hy,{layout:true,className:"reference-sources-container",whileHover:"animate",animate:p$1?"animate":"start",sourcesCount:f,variants:{animate:{width:f*38}},style:{zIndex:29},children:c}):null})})}var Br={technology:Kk,institution:Jk$1,payment:Zd,developmentHouse:Lk,platform:yd$1};var Sy=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Ty=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"})),wy=styled$1("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),vy=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"})),Py=(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 Ey=e=>{let t="";switch(e.type){case "technology":case "institution":t="Payment";break;default:t="";break}return `${t} ${gb(e.type)} - ${e.name}`};function uA({isTextShown:e,segments:t,...o}){let[n,r]=useState(false),i=useTheme(),a$1=useMemo(()=>t?.filter(l=>!!l.name).map((l,p$1)=>{let d=l.type?.toLowerCase?.().includes("platform"),m=l.tooltip||Ey(l),u=l.type,c=d?Br.platform:Br[u];return jsx(b$c,{order:p$1,variants:Py(p$1,i.shadows[4],e?83:0),sx:{width:e?"79px":"36px"},children:jsx(p,{onOpen:()=>{r(true);},onClose:()=>{r(false);},title:m,children:e?jsx(vy,{children:jsx(wy,{children:Bh$1(l.name)})}):jsx(a$j,{mainIcon:l.icon||c,mainIconSize:16,containerSize:16,sx:{...l.icon?{borderRadius:"40px"}:{borderRadius:"0px"}},onError:f=>{Br[u]&&(f.currentTarget.src=Br[u],f.currentTarget.style.borderRadius="0px");},borderColor:"transparent"})})},`${l.name}-${p$1}`)}),[t,e,i]),s=a$1?.length||0;return jsx(a,{...o,children:jsx(Sy,{children:s>0?jsx(Ty,{layout:true,className:"reference-sources-container",whileHover:"animate",animate:n?"animate":"start",sourcesCount:s,variants:{animate:{width:s*38}},style:{zIndex:29},children:a$1}):null})})}var fA=uA;function Ay({marketPlaceIcon:e,marketPlaceName:t,...o}){return jsx(a,{...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:Rb$1,alt:"marketplace",style:{maxWidth:"18px",maxHeight:"18px",objectFit:"cover"}})}),jsx(Typography,{noWrap:true,sx:{fontSize:"14px",fontWeight:400},children:t})]})})})}var Dy={incomplete:Gj,complete:Fj,reviewed:Fj,verified:Hj};var Ry=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%"})),Ly=styled$1("div")(({theme:e})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"84px"})),By=styled$1("img")(()=>({width:"10.5px",height:"10.5px"})),ky=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"})),Ny=styled$1("div")({width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"}),Fy=styled$1("div")({display:"flex",alignItems:"center",gap:"8px"}),Vy=styled$1("div")({fontWeight:400,fontSize:14,lineHeight:"120%",letterSpacing:0,color:"#B1B1B1",textAlign:"center",width:"100%"});function Wy({id:e,status:t,count:o,name:n,...r}){let i=Dy[t??"incomplete"];return jsx(a,{...r,sx:{cursor:"pointer"},children:jsx(p,{title:n,children:jsx(Ry,{children:e?jsxs(Ny,{children:[jsx(Ly,{children:e}),jsxs(Fy,{children:[jsx(By,{src:i}),o>1&&jsx("div",{children:jsxs(ky,{children:["+",o-1]})})]})]}):jsx(Vy,{children:"Not Available"})})})})}var Hy=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"})),Oy=styled$1(zn)(()=>({display:"flex",alignItems:"center",gap:"4px",overflow:"hidden",width:"100%"})),_y=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"}})),zy=styled$1("img")(()=>({width:"10.5px",height:"10.5px"})),$y=styled$1("div")({marginLeft:"auto",width:"auto"});var Uy={incomplete:Gj,complete:Fj,reviewed:Fj,verified:Hj};function Gy({brand:e,verificationStatus:t,hideStatus:o,brandLogo:n,...r}){let i=Uy[t??"incomplete"];return jsx(a,{...r,children:jsx(p,{title:e.name,children:jsx(Hy,{hasClick:!!r.onClick,children:jsxs(Oy,{children:[n,jsx(_y,{brandName:e.name,children:e.name||"Not Available"}),!o&&jsx($y,{children:jsx(zy,{src:i})})]})})})})}var Yy=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Zy=styled$1("img")(()=>({maxWidth:"36px",maxHeight:"16px"})),jy=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 Ky=(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"}}}),qy=styled$1(Box)(()=>({display:"flex",gap:"4px",maxWidth:"440px",justifyContent:"space-between",height:"18px"}));var SA=e=>!e.startsWith("http://")&&!e.startsWith("https://"),ss=e=>/^https?:\/\//i.test(e),Xy=(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 TA(e,t);case "ios":case "android":case "mobile_app":return wA(e,t);default:return e}},TA=(e,t)=>{let o=e.toLowerCase();return t==="linkedin"?o.includes("linkedin.com")||o.includes("linked.com")?e:ss(e)?null:`https://linkedin.com/company/${e}`:t==="instagram"?o.includes("instagram.com")?e:ss(e)?null:`https://instagram.com/${e}`:t==="twitter"?o.includes("twitter.com")||o.includes("x.com")?e:ss(e)?null:`https://x.com/${e}`:null},wA=(e,t)=>e.toLowerCase().includes("apps.apple.com")&&t==="ios"?e:t==="android"?ss(e)?e:`https://play.google.com/store/apps/details?id=${e}`:null,Jy=e=>{!e||typeof e!="string"||window.open(SA(e)?`https://${e}`:e,"_blank","noopener,noreferrer");};function vA({channels:e,...t}){let o=e?.filter(r=>!!r.address)?.map((r,i)=>{let a=r.address,s=r.code?.replace(/_/g,""),l=i===e?.length-1,p$1=Xy(r.address??"",r.code??"");return jsx(p,{title:a,children:jsx(b$c,{order:i,variants:Ky(i,0,l),sx:{width:"36px",cursor:p$1?"pointer":"default"},onClick:()=>{r?.address&&Jy(p$1);},children:jsx(Zy,{src:r.logo,alt:s})})},`${r}-${i}`)}),n=o?.length||0;return jsx(a,{...t,children:jsx(Yy,{children:o?.length>0?jsx(jy,{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 PA=vA;function RA({channels:e}){let t=useRef(null),[o,n]=useState(false),[r,i]=useState(null),a=!!r;useEffect(()=>{t.current&&n(t.current.scrollHeight>20);},[e]);let s=useMemo(()=>(e||[]).filter(l=>!!l.address),[e]);return jsxs(qy,{children:[jsx(zn,{sx:{display:"flex",flexWrap:"wrap",gap:o?"8px":"4px"},ref:t,children:s.map(l=>jsxs(b$1,{copyTrigger:"press",copyText:l.address,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"367px","& div":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"367px"}},children:[l.name?.en,": ",l.address]},l.id))}),o&&jsx(zn,{onClick:l=>{i(l.currentTarget.parentElement);},sx:{height:"18px"},children:jsx(b$1,{sx:{minWidth:25,borderRadius:"24px",overflow:"hidden"},children:"..."})}),jsx(DA,{open:a,anchorEl:r,sx:{minWidth:r?.clientWidth},onClose:()=>{i(null);},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{style:{maxWidth:"unset",minWidth:r?.clientWidth,marginTop:"22px"}}},children:jsx(zn,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px"},children:s.map(l=>jsxs(b$1,{copyTrigger:"press",copyText:l.address,children:[l.name?.en,": ",l.address]},l.id))})})]})}var LA=RA;var xm={active:uf,completed:vf,closed:wf,expired:xf,ready:yf,registered:vf};var eI=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 tI({status:e,...t}){let{t:o}=useTranslation();return jsx(a,{...t,children:e&&xm[e]&&jsx(p,{title:o(FA(zt(e))),children:jsx(eI,{children:jsx(a$j,{mainIcon:xm[e],mainIconSize:16,containerSize:16,borderColor:"transparent"})})})})}var oI={SAVED_CARD:"Card Agreement",ORDER:"Order",SUBSCRIPTION:"Subscription",INSTALLMENT:"Installment"};function HA({type:e,count:t,sx:o,...n}){let{t:r}=useTranslation(),i=t?.toString();return jsxs(zn,{sx:{display:"flex",flexDirection:"row",gap:"4px"},children:[jsx(b$1,{copyTrigger:"press",copyText:e,unknownText:r("noPaymentAgreement"),sx:o,...n,children:e&&oI[e]}),i&&jsx(b$1,{copyTrigger:"press",copyText:i,sx:{minWidth:"38px"},...n,children:i})]})}var OA=HA;var rI={CYBERSOURCE:pm,MPGS:qm,NETCETERA:rm$1,APPLEPAY:sm,TAP3DS:tm$1,FSS:zm$1,BENEFIT:vm,QPAY:Hm$1,POSTPAY:Gm$1,BENEFITPAY:um,MEEZA:Bm$1,STC_PAY:Jm,NGENIUS:Cm,KNET:Am$1,PAYPAL:Fm$1,FAWRY:ym$1,TPG:Nm$1,DEEMA:xm$1,TPAY:Mm$1,"CAREEM PAY":wm$1,TABBY:Km$1,OMANNET:Em,NPG:Dm$1,SPG:Im$1,TAMARA:Lm$1};var aI=styled$1(zn)(({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})),sI=styled$1("img")(()=>({width:"100%",height:"100%",objectFit:"contain"}));function lI({provider:e,...t}){let o=rI[e];return o?jsx(aI,{children:jsx(sI,{src:o,alt:e})}):jsx(a,{...t,children:jsx(j,{children:e})})}var pI={CHARGE:Vk,AUTHORIZE:zk,SAVE_TOKEN:Yg},mI={CHARGE:"Charge",AUTHORIZE:"Authorization",SAVE_TOKEN:"Save Token"},dI={CHARGE:{backgroundColor:"#1F88D01A",color:"#1F88D0",border:"none"},AUTHORIZE:{backgroundColor:"#FFFFFF",color:"#1F88D0",border:"#1F88D01A"},SAVE_TOKEN:{backgroundColor:"#1F88D00D",color:"#1F88D0",border:"#1F88D01A"}};var cI=styled$1(zn,{shouldForwardProp:e=>!["purposeType"].includes(e)})(({purposeType:e})=>{let t=dI[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}}),uI=styled$1("img")(()=>({width:"16px",height:"16px",objectFit:"contain",flexShrink:0})),fI=styled$1("span")(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}));function xI({purpose:e,...t}){let o=pI[e],n=mI[e];return jsxs(cI,{purposeType:e,...t,children:[jsx(uI,{src:o,alt:e}),jsx(fI,{children:n})]})}var hI=8,GA=16,Kt=hI*2+GA,yI=100,II=6,YA=Kt+II+yI,bI=styled(a)(()=>({position:"relative",overflow:"visible",width:Kt,minWidth:Kt,maxWidth:Kt,display:"inline-flex",padding:0})),SI=styled(zn)(()=>({position:"relative",width:Kt,height:24,flexShrink:0,overflow:"visible"})),TI=styled(zn,{shouldForwardProp:e=>e!=="hasLabel"})(({theme:e,hasLabel:t})=>({position:"absolute",top:0,left:0,width:Kt,minWidth:Kt,maxWidth:Kt,height:24,display:"inline-flex",alignItems:"center",gap:II,paddingInline:hI,borderRadius:"24px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.background.paper,boxSizing:"border-box",cursor:"pointer",overflow:"hidden",transition:e.transitions.create(["max-width","box-shadow"]),"& img":{flexShrink:0},...t&&{"&:hover":{width:"max-content",maxWidth:YA,zIndex:100,boxShadow:"0px 0px 16px 0px #00000021","& .link-cell-label":{maxWidth:yI,opacity:1}}}})),wI=styled("span")(({theme:e})=>({display:"inline-block",maxWidth:0,opacity:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontSize:12,lineHeight:"16px",color:e.palette.text.primary,transition:e.transitions.create(["max-width","opacity"],{duration:e.transitions.duration.shorter})}));function jA({url:e,label:t}){let o=n(),n$1=()=>{try{bb(e),o.success("Copied!");}catch{o.error("Failed to copy");}};return e?jsx(bI,{children:jsx(SI,{children:jsxs(TI,{hasLabel:!!t,onClick:n$1,children:[jsx(d$1,{src:Jl,alt:"link"}),t&&jsx(wI,{className:"link-cell-label",children:t})]})})}):null}var KA=memo(jA);function PX({items:e}){let[t,o]=useState(null),n=!!t,r=useCallback(({quantity:s,currency:l,amount:p,name:d})=>`${s?`Qty ${s}`:""} ${d?`- ${d}`:""} ${l||p?"-":""} ${l||""} ${p||""}`,[]);if(!e||!e.length)return null;let[i,...a]=e;return jsxs(zn,{sx:{display:"flex",gap:"4px",alignItems:"center"},children:[jsx(b$1,{children:jsx(j$1,{noWrap:true,sx:{maxWidth:e.length>1?190:220,fontSize:11},children:r(i)})}),e.length>1&&jsx(zn,{onClick:s=>{o(s.currentTarget.parentElement);},sx:{height:"18px"},children:jsx(b$1,{sx:{minWidth:25,borderRadius:"24px",overflow:"hidden"},children:"..."})}),jsx(DA,{open:n,anchorEl:t,sx:{minWidth:t?.clientWidth},onClose:()=>{o(null);},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{style:{maxWidth:"unset",minWidth:t?.clientWidth,marginTop:"22px"}}},children:jsx(zn,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px"},children:a?.map(s=>jsx(b$1,{copyTrigger:"press",copyText:r(s),children:r(s)},s.id))})})]})}var vI="ListHeader";var PI=styled$1(Box)(({theme:e})=>({backgroundColor:e.palette.background.default,paddingInline:e.spacing(4),paddingBottom:e.spacing(2),paddingTop:e.spacing(2),overflowX:"clip"})),EI=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)})),MI=styled$1(j$1)(({theme:e})=>({fontSize:"1.75rem",fontWeight:e.v2.typography.fontWeightMedium,lineHeight:"120%"})),AI=styled$1(Box)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(3),width:"100%"})),DI=styled$1(Box)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1)})),RI=styled$1(Box)(()=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"8px",flexShrink:0}));function cs({children:e,component:t="header",...o}){return jsx(PI,{component:t,...o,children:e})}function us({title:e,toolbar:t}){return jsxs(EI,{children:[jsx("span",{children:!!e&&jsx(MI,{children:e})}),t]})}function fs({status:e,activeFilter:t,beforeStatus:o}){let n=t?.visible??false;return jsxs(DI,{as:"aside",children:[o,jsx(a$d,{status:e?.value,availableStatuses:e?.options,onStatusChange:e?.onChange,isActiveFilterVisible:n,buttonSx:e?.buttonSx}),jsx(a$e,{ids:t?.ids,visible:n,label:t?.label,dismissible:t?.dismissible,onDismiss:t?.onDismiss})]})}var Tn=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]}})),gs=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"}})),wn=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})),vn=styled$1(Box)(()=>({minWidth:160,position:"relative",marginRight:0,paddingRight:0})),Pn=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]}}})),En=styled$1(Box)(()=>({width:15})),Wr=styled$1(Box)(()=>({width:16})),NI=styled$1(Box)(({theme:e})=>({display:"flex",flexDirection:"column",height:"calc(100% - 32px)",backgroundColor:e.palette.background.paper,position:"relative"})),FI=styled$1(Box)(()=>({flex:1,overflowY:"auto",paddingLeft:16,paddingRight:16,paddingBottom:64})),VI=styled$1(Box)(()=>({padding:"24px 0",display:"flex",justifyContent:"space-between",alignItems:"center"})),WI=styled$1(Box)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",flex:1,minHeight:0})),HI=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]}})),OI=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"}})),ym=styled$1(Box)(()=>({width:20,height:20,marginRight:8,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0})),Im=styled$1(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"center",padding:0,width:14,height:14,minWidth:14,minHeight:14,flexShrink:0})),_I=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)"})),zI=styled$1(Box)(({theme:e})=>({position:"absolute",bottom:12,right:16,padding:6,backgroundColor:e.palette.background.paper,border:"1px solid #9F9F9F29",borderRadius:"4px"})),xs=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 $I=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"}})),UI=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 bm={display:"flex",alignItems:"center",justifyContent:"center",padding:0,width:14,height:14,minWidth:14,minHeight:14,flexShrink:0,"& .MuiSvgIcon-root":{width:16,height:16},"& img":{width:14,height:14}},GI=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"})),YI=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}})),ZI={p:0,width:14,height:14,minWidth:14,minHeight:14,"& .MuiSvgIcon-root":{width:16,height:16}},jI=styled$1(Box)(()=>({minWidth:200,display:"flex",flexDirection:"column",maxHeight:"80vh",overflow:"hidden"})),KI=styled$1(Box)(()=>({flex:1,overflowY:"auto",paddingLeft:6,paddingRight:6,minHeight:0})),qI=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})),XI={fontSize:11,fontWeight:400,textTransform:"none",color:"text.primary",minWidth:80,height:38,borderRadius:"8px",border:"1px solid",borderColor:"divider"},JI=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 Tm(e,t){let[o,n]=useState(null),[r,i]=useState(null),a=useCallback(()=>{n(null),i(null);},[]),s=useCallback((p,d)=>{n(p.currentTarget),i(d);},[]),l=useCallback(()=>{r&&a();},[r,a]);return useEffect(()=>{e||(a(),t?.());},[e,t,a]),{subMenuAnchorEl:o,openSubMenuName:r,handleSubMenuClose:a,handleSubMenuOpen:s,handleMenuScroll:l}}function mD(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 wm(e){let t=useRef(false),o=useRef(null),n=useRef({x:0,y:0}),r=useRef(1),i=useRef(null),a=useRef(0),s=useRef(false),l=useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null);},[]),p=useCallback((f,x)=>{s.current=true,window.dispatchEvent(new PointerEvent("pointermove",{bubbles:true,cancelable:true,pointerId:r.current,clientX:f,clientY:x+a.current,pointerType:"mouse",isPrimary:true})),s.current=false;},[]),d=useCallback(()=>{if(o.current!==null)return;let f=()=>{let x=i.current;if(!t.current||!x)return;let C=x.getBoundingClientRect(),{x:S,y:g}=n.current,h=g-C.top,w=C.bottom-g;if(h>0&&h<60){let T=(60-h)/60*15;x.scrollTop-=T,a.current-=T,p(S,g);}else if(w>0&&w<60){let T=(60-w)/60*15;x.scrollTop+=T,a.current+=T,p(S,g);}o.current=requestAnimationFrame(f);};o.current=requestAnimationFrame(f);},[p]),m=useCallback(f=>{s.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]),u=useCallback(()=>{i.current=mD(e.current),a.current=0,t.current=true,window.addEventListener("pointermove",m,{capture:true}),d();},[e,m,d]),c=useCallback(()=>{t.current=false,a.current=0,l(),window.removeEventListener("pointermove",m,{capture:true});},[m,l]);return useEffect(()=>()=>{t.current=false,l(),window.removeEventListener("pointermove",m,{capture:true});},[m,l]),{onDragStart:u,onDragEnd:c}}function Pm({columns:e,setTableViews:t}){let o=useCallback(i=>{let a=i.map(s=>e.find(l=>l.name===s)).filter(s=>!!s);t?.(a);},[e,t]),n=useCallback(i=>{let a=e.map(s=>{if(s.name!==i)return s;let l=s.menuItems&&s.menuItems.length>0,p=!s.selected;if(!l)return {...s,selected:p};let d=s.menuItems?.map(m=>({...m,selected:p}));return {...s,selected:p,menuItems:d}});t?.(a);},[e,t]),r=useCallback((i,a)=>{let s=e.map(l=>{if(l.name!==i)return l;let p=l.menuItems?.map(m=>m.name===a?{...m,selected:!m.selected}:m),d=p?.some(m=>m.selected)??false;return {...l,menuItems:p,selected:d}});t?.(s);},[e,t]);return {reorderColumns:o,toggleColumnSelection:n,toggleSubmenuItem:r}}function Mm({column:e,index:t,openSubMenuName:o,toggleColumnSelection:n,handleSubMenuOpen:r,handleSubMenuClose:i}){let a=e.menuItems&&e.menuItems.length>0,s=o===e.name,l=t===0,p=useMemo(()=>!!(e.selected&&e.menuItems?.some(c=>c.selected)&&!e.menuItems?.every(c=>c.selected)),[e.selected,e.menuItems]),d=useCallback(()=>{n(e.name);},[n,e.name]),m=useCallback(c=>{a&&r(c,e.name);},[a,r,e.name]),u=useCallback(()=>{a||i();},[a,i]);return {isIndeterminate:p,hasSubmenuItems:a,isSubmenuOpen:s,isFirstItem:l,handleColumnClick:d,handleMouseEnter:m,handleMouseLeave:u}}var _=(e="")=>e.toLowerCase()==="date",qe=(e="")=>e.toLowerCase()==="index",Cs=(e,t="en")=>{let o=[];return e.forEach(n=>{n.columns.forEach(r=>{let i=r.name.find(s=>s.lang===t)?.text||r.name[0]?.text||r.code,a=r.fields?.length?r.fields.map(s=>({name:s.code,label:s.name?.find(l=>l.lang===t||l.lang==="")?.text||s.code,selected:s.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},cD=(e,t)=>{if(!t?.length)return [];let o=e==="sheet"?"sheet":"advanced",n=t.find(r=>r.code.toLowerCase()===o);return n?Cs([n]):[]},Am=(e,t,o="en")=>{let n=e.map((i,a)=>{let s=i.menuItems?.map(p=>({code:p.name,name:[{text:typeof p.label=="string"?p.label:p.name,lang:o||""}],default:p.selected??false})),l=typeof i.label=="string"?i.label:i.name;return {code:i.name,name:[{text:l,lang:o}],order:a+1,default:i.selected??false,...s?.length?{fields:s}:{}}});return {code:t==="sheet"?"Sheet":"Advanced",columns:n}},uD=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 fD=(e,t,o=false)=>({label:e,id:`custom_${Date.now()}`,columns:t.map(n=>n.name),submenu:t,isCustom:true,default:o}),gD=(e,t)=>e.map(o=>({...o,default:o.id===t})),hs=e=>e.role??(e.default?"default":void 0),vo=e=>!!e.role||!!e.default,Xe=e=>!vo(e),eb=e=>Xe(e),Or=e=>e.filter(eb).length,Dm=e=>e.filter(Xe).length,ys=(e,t="sheet",o="en")=>{let n=[],r=[],i;e.forEach(s=>{let l=t==="sheet"?"sheet":"advanced",p=s.layout.find(y=>y.code.toLowerCase()===l),d=p?Cs([p],o):[],m=s.id,u=vb$1,c=wb$2,f=d.some(y=>_(y.name))?d:[c,...d],x=f.findIndex(y=>_(y.name)),S=(x>0?[f[x],...f.filter(y=>!_(y.name))]:f).filter(y=>!qe(y.name)),g=[u,...S],h=hs(s),w=vo(s),T={id:m,label:s.name,role:h,isCustom:!w,selected:s.selected,default:!!s.default,columns:g.map(y=>y.name),submenu:g};w?(s.default&&!i&&(i=g),r.push(T)):n.push(T);});let a=r.find(s=>s.default)??r[0];return {customViews:n,defaultTemplates:r,defaultTemplateColumns:i,defaultTemplate:a}},Rm=(e,t="sheet",o="en")=>{let{customViews:n,defaultTemplates:r,defaultTemplate:i}=ys(e,t,o),a=[...r,...n];return {customViews:n,defaultTemplates:r,defaultTemplate:i,allTemplates:a}},Is=(e,t)=>{let o=[];Xe(e)?o=e.submenu??[]:o=e.submenu?.length?e.submenu:t;let n=vb$1;if(!o.some(m=>_(m.name)))return [n,wb$2,...o];let i=o.findIndex(m=>_(m.name)),a=i>=0?o[i]:wb$2,s=o.filter(m=>!_(m.name)&&!qe(m.name)),l=[a,...s],p=l.some(m=>qe(m.name)),d=l.findIndex(m=>qe(m.name));if(p&&d>0){let m=l[d],u=l.filter(c=>!qe(c.name));return [m,...u]}return p&&d===0?l:[n,...l]},xD=(e,t)=>Is(e,t).length>0,An=e=>e.filter(t=>!qe(t.name));var ke=e=>e.toLowerCase(),tb=e=>new Map(e.filter(t=>!_(t.name)).map(t=>[ke(t.name),t])),ob=(e,t)=>e.some(o=>ke(o)===ke(t)),Lm=(e,t)=>({...e,selected:t.selected??false,menuItems:e.menuItems?.map(o=>{let n=t.menuItems?.find(r=>ke(r.name)===ke(o.name));return {...o,selected:n?.selected??false}})}),_r=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}},km=(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}}),zr=(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}}),Nm=(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}}),Fm=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)},Vm=(e,t)=>e.filter(r=>!_(r.name)).some(r=>r.menuItems?.length?r.menuItems.some(i=>i.selected):r.selected)&&!t,Wm=(e,t)=>e.trim().length>0&&e.length<=t,de=e=>e.map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),Hm=(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}}),Om=(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}}),_m=e=>e.length===0?false:e.every(t=>t.menuItems?.length?t.menuItems.every(o=>o.selected):t.selected),zm=(e,t)=>e.length===0?false:e.some(n=>n.menuItems?.length?n.menuItems.some(r=>r.selected):n.selected)&&!t,Bm=e=>e.map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),$r=(e,t)=>{if(e.length!==t.length)return false;let o=Bm(e),n=Bm(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 s=0;s<i.menuItems.length;s++)if(i.menuItems[s].name!==a.menuItems[s].name||i.menuItems[s].selected!==a.menuItems[s].selected)return false}else if(i.menuItems||a.menuItems)return false}return true},CD=e=>e.filter(t=>!_(t.name)).map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),$m=(e,t)=>{let o=e.filter(i=>!_(i.name)).map(i=>i.name),n=tb(t),r=[];for(let i of o){let a=e.find(l=>ke(l.name)===ke(i)),s=n.get(ke(i));s?r.push(a?Lm(s,a):{...s,selected:false,menuItems:s.menuItems?.map(l=>({...l,selected:false}))}):a&&r.push(a);}for(let[,i]of n)if(!ob(o,i.name)){let a=e.find(s=>ke(s.name)===ke(i.name));r.push(a?Lm(i,a):{...i,selected:false,menuItems:i.menuItems?.map(s=>({...s,selected:false}))});}return r},Um=e=>e.filter(t=>!_(t.name)).map(t=>({...t,selected:false,menuItems:t.menuItems?.map(o=>({...o,selected:false}))})),Gm=(e,t)=>{let o=tb(e),n=t.filter(i=>!_(i.name)).map(i=>i.name),r=[];for(let i of n){let a=t.find(l=>ke(l.name)===ke(i)),s=o.get(ke(i));s&&a?r.push(Lm(s,a)):s&&r.push({...s,selected:false,menuItems:s.menuItems?.map(l=>({...l,selected:false}))});}for(let[,i]of o)ob(n,i.name)||r.push({...i,selected:false,menuItems:i.menuItems?.map(a=>({...a,selected:false}))});return r};function nb(e,t,o="en"){if(!e?.layout?.length)return [];let n=Wa$1(t)?"sheet":"advanced",r=e.layout.find(s=>s.code?.toLowerCase()===n);if(!r?.columns?.length)return [];let i=r.columns.map(s=>{let l=s.name?.find(d=>d.lang===o)?.text||s.name?.[0]?.text||s.code,p=s.fields?.length?s.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:s.code,label:l,selected:_(s.code)?true:s.default??false,...p&&p.length>0&&{menuItems:p}}});return i.some(s=>_(s.name))?i:[{name:wb$2.name,label:wb$2.label,selected:true},...i]}var bs=e=>{let t=e?.order;if(t==null)return 999;let o=Number(t);return Number.isFinite(o)?o:999};function Ss(e){return {...e,layout:e.layout?.map(t=>({...t,columns:[...t.columns??[]]}))??[]}}function hD(e,t){let o=e.layout?.map(r=>({...r,columns:[...r.columns??[]].sort((i,a)=>bs(i)-bs(a))})),n=nb(e,t);return {id:e.id,label:e.name,layout:o,submenu:n,columns:n.map(r=>r.name),role:hs(e),isCustom:Xe(e),default:e.default}}var Ts=(e,t)=>{if(!e)return [];let o=e;if(e.layout&&Array.isArray(e.layout)&&e.layout.length>0){let n=Va(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 Va(t)?a==="default"||a==="advanced":a==="sheet"||a==="sheets"});if(r&&r.columns&&r.columns.length>0)return r.columns.map(a=>{let l=!!a.fields?.length&&a.fields.some(d=>d.default??false),p=(a.default??false)||l;return {code:a.code,name:a.name&&a.name.length>0?a.name:[{text:a.code,lang:"en"}],selected:p,sort_order:bs(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,s)=>(a.sort_order??999)-(s.sort_order??999))}return o.submenu&&Array.isArray(o.submenu)&&o.submenu.length>0?o.submenu.map((r,i)=>{let a=r.name.toLowerCase(),s;r.menuItems&&r.menuItems.length>0?s=r.menuItems.filter(m=>m.selected):s=[{name:a,label:r.label||r.name,selected:true}];let l=s.length>0?s.map(m=>({parameter:m.name.toLowerCase(),code:m.name.toLowerCase()})):[{parameter:a,code:a}],p=s.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:l}]}}):[]},yD=(e,t)=>{if(!e||!Array.isArray(e)||e.length===0)return [];let o=e?.find(n=>n.default)||e[0];return o?Ts(o,t):[]};function Ym(e,t,o){let n=e.findIndex(t);if(n===-1)return e;let r=[...e];return r[n]=o,r}function Zm(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 s=r.code?.toLowerCase(),l=a.findIndex(p=>p.code?.toLowerCase()===s);l>=0?a[l]=r:a.push(r);}return {name:o,layout:a}}var jm=e=>{let t=e;return t?!!(t.closest('[role="checkbox"]')||t.closest('input[type="checkbox"]')||t.closest('[class*="CheckboxWrapper"]')):false};var rb=e=>[...yb[e]??yb.default],ID=e=>zb$1[e]??zb$1.default,bD=(e,t)=>({code:e,name:[{text:xb$1[e],lang:"en"}],selected:true,sort_order:t}),SD=(e,t)=>e?.layout?.some(o=>rb(t).includes(o.code?.toLowerCase()??""))??false,Km=(e,t,o)=>{let n=zb$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(s=>({...s})),fields:a.fields?.map(s=>({...s,name:s.name?.map(l=>({...l}))}))}))??[]}:{code:n,columns:[]};return [e,i]};var ws=({tableMode:e,templates:t,lang:o="en",mainDefaultTemplate:n})=>useMemo(()=>{let{customViews:r,defaultTemplates:i,defaultTemplate:a,allTemplates:s}=Rm(t,e,o),p=(n?ys([n],e,o).defaultTemplate:void 0)??a,d=p?.submenu?structuredClone(p.submenu):[],m=Or(t);return {customViews:r,defaultTemplates:i,defaultTemplate:a,allTemplates:s,defaultColumns:d,customTemplateCount:m}},[t,e,o,n]);var vs=({mode:e,onViewChange:t,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,defaultColumns:i,defaultTemplate:a,allTemplates:s,customTemplateCount:l})=>{let[p,d]=useState(null),[m,u]=useState(false),[c,f]=useState(null),[x,C]=useState(false),[S,g]=useState(null),[h,w]=useState(null),[T,y]=useState(),[b,v]=useState(s.find(L=>L.selected)?.id??a?.id),E=useRef(s.find(L=>L.selected)?.id??a?.id),A=useCallback(L=>{let H=L.submenu?.filter(oe=>oe.selected)||[];return {...L,submenu:H,columns:H.map(oe=>oe.name)}},[]),D=useCallback(L=>{E.current=L?.id,t?.(L?A(L):void 0);},[t,A]),R=useMemo(()=>b?s.find(L=>L.id===b):a,[s,b,a]),W=useMemo(()=>de(R?.submenu||i),[R,i]),z=useMemo(()=>({id:b||a?.id||"default",label:R?.label||a?.label||"Default"}),[R,b,a?.id,a?.label]);useEffect(()=>{let L=s.find(Re=>Re.selected)?.id,H=a?.id,oe=b?s.some(Re=>Re.id===b):false;if(!(b&&!oe&&L!==b)){if(L&&L!==b){v(L);return}if(!b){v(L??H);return}oe||v(L??H);}},[s,a?.id,b]),useEffect(()=>{!b||!R||R.id===b&&E.current!==b&&(E.current=b,t?.(A(R)));},[b,R,t,A]);let te=useCallback(L=>{d(H=>H?null:L.currentTarget);},[]),we=useCallback(()=>{d(null);},[]),ze=useCallback((L,H)=>{v(H?.id),D(H),we();},[we,D]),De=useCallback((L=false,H,oe,Re)=>{l!=null&&l>=3||(f(null),C(L),g(H??null),w(oe?.length?oe:null),y(Re),u(true),d(null));},[l]),$=useCallback(L=>{let H=s.find(oe=>oe.id===L.id)??L;f(H),C(true),g(null),w(H.submenu?.length?de(H.submenu):null),u(true);},[s]),Ct=useCallback(()=>{u(false),f(null),C(false),g(null),w(null),y(void 0);},[]);useEffect(()=>{if(!m||!c?.id)return;let L=s.find(H=>H.id===c.id);L&&(f(L),w(L.submenu?.length?de(L.submenu):null));},[m,c?.id,s]);let kl=useCallback(async L=>{if(c){let H=c.id;await n?.(H,L),v(H);let oe=s.find(Re=>Re.id===H)??c;D(oe),we();}else {let H=await o?.({...L,sourceTemplateId:T});if(H?.id){v(H.id);let oe=s.find(Re=>Re.id===H.id);D(oe??{id:H.id,label:H.name,isCustom:true,columns:L.selectedColumns.map(Re=>Re.name),submenu:L.selectedColumns});}}},[c,n,o,we,s,D,T]),Nl=useCallback(async L=>{let H=s.find(oe=>oe.id===L);await r?.(H?.id??L),b===(H?.id??L)&&v(a?.id);},[s,r,b,a]);return {anchorEl:p,isCreateDialogOpen:m,editingView:c,selectedViewInfo:z,shouldUseCurrentState:x,selectedView:R,currentViewColumns:W,initialColumnsForCreate:S,availableColumnsForCreate:h,handleViewButtonClick:te,handleCloseViewDropdown:we,handleSelectedViewInfo:ze,handleOpenCreateDialog:De,handleOpenEditDialog:$,handleCloseCreateDialog:Ct,handleSaveView:kl,handleDeleteView:Nl}};var Dn=()=>{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);},[]),s=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null);},[]),l=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),t(null),n(null);},[]);return {hoveredColumn:e,anchorEl:o,openSubmenu:i,closeSubmenu:a,cancelClose:s,forceClose:l}};var sb=()=>{let[e,t]=useState(null),[o,n]=useState(null),r=useRef(null),i=useCallback((l,p)=>{t(l),n(p);},[]),a=useCallback(()=>{t(null),n(null);},[]),s=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null);},[]);return {hoveredNestedColumn:e,nestedSubmenuAnchorEl:o,openNestedSubmenu:i,closeNestedSubmenu:a,cancelNestedClose:s}};var ed=({open:e,availableColumns:t,defaultColumns:o,editingView:n,tableViews:r=[]})=>{let[i,a]=useState(()=>n?.label||""),[s,l]=useState([]),p=useRef(false),d=useRef([]),m=useRef(n?.label?.trim()||""),{hoveredColumn:u,anchorEl:c,openSubmenu:f,closeSubmenu:x,cancelClose:C}=Dn(),S=vb$1,g=wb$2;useEffect(()=>{if(!e){p.current=false;return}if(!p.current&&e)if(n){let z=n.submenu&&n.submenu.length>0?n.submenu:o,te=t.length>0?t:z,ze=$m(z,te).filter(Ct=>!qe(Ct.name)&&!_(Ct.name)),De=[S,g,...ze];l(De),d.current=de(De);let $=n.label?.trim()||"";m.current=$,a($);}else {let z=t.length>0?t:r,we=(r&&r.length>0?Gm(z,r):Um(z)).filter(De=>!qe(De.name)&&!_(De.name)),ze=[S,g,...we];l(ze),d.current=de(ze),m.current="",a("");}else if(e&&n){let z=n.label?.trim()||"";a(z);}p.current=e;},[e,n?.id,n?.label,n?.submenu,t,o,r,S,g]);let h=useMemo(()=>s.map(W=>W.name),[s]),w=useMemo(()=>Fm(s),[s]),T=useMemo(()=>Vm(s,w),[s,w]),y=useMemo(()=>Wm(i,20),[i]),b=useMemo(()=>{let W=i.trim()!==m.current,z=d.current.length>0&&!$r(s,d.current);return W||z},[i,s]);return {templateName:i,setTemplateName:a,selectedColumns:s,columnNames:h,allSelected:w,someSelected:T,isNameValid:y,hasChanges:b,hoveredColumn:u,anchorEl:c,openSubmenu:f,closeSubmenu:x,cancelClose:C,handleReorder:W=>{let z=W.filter(te=>!_(te)).flatMap(te=>s.find(we=>we.name===te)??[]);l([S,g,...z]);},handleColumnToggle:W=>{l(z=>km(z,W));},handleSubItemToggle:(W,z)=>{l(te=>zr(te,W,z));},handleSelectAll:()=>{l(W=>Nm(W,!w));},handleResetToDefault:()=>{d.current.length>0&&l(de(d.current));}}};function od({templates:e,setTemplates:t,createTemplate:o,updateTemplate:n,deleteTemplate:r,tableMode:i,isTemplatesLoading:a,lang:s="en",mainDefaultTemplate:l}){let p=useMemo(()=>l??e.find(g=>g.default),[e,l]),d=e.find(g=>g.selected)?.id??p?.id,m=useCallback(g=>{t(h=>h.find(T=>T.selected)?.id===g?h:h.map(T=>({...T,selected:g?T.id===g:false})));},[t]),u=useCallback(async({name:g,layout:h,sourceTemplateId:w})=>{if(Or(e)>=3)return;let T=e.find(E=>E.id===w)??e.find(E=>E.id===d)??p,y=Km(h,i,T),b=await o({name:g,layout:y}),v=Ss(b);return t(E=>[...E.filter(D=>D.id!==v.id).map(D=>({...D,selected:false})),{...v,selected:true}]),{id:b.id,name:b.name??""}},[o,t,i,p,e,d]),c=useCallback(async g=>{await r(g),t(h=>h.filter(w=>w.id!==g)),m(d===g?p?.id:d);},[r,t,p,m]),f=useCallback(async(g,h)=>{let w=e.find(E=>E.id===g),{name:T,layout:y}=Zm(w,h),b=await n(g,{name:T,layout:y}),v=Ss(b);t(E=>Ym(E,A=>A.id===g,v)),m(v.id);},[e,n,t,m]),x=useMemo(()=>({templates:e,onCreateCustomView:u,onEditCustomView:f,onDeleteCustomView:c,isLoading:a,mainDefaultTemplate:l}),[e,u,f,c,a,l]),C=useCallback(g=>{if(!p){m(void 0);return}if(!g?.id){m(p.id);return}if(vo(g)){m(g.id);return}let h=e.find(w=>w.id===g.id);if(h){m(h.id);return}Xe(g)&&m(g.id);},[e,p,m]),S=useMemo(()=>{let g=e.find(w=>d?w.id===d:false)??p;if(!g)return [];let h=Ts(g,i);return h.length>0?h:[]},[i,e,d,p]);return {customViews:x,onViewChange:C,columnsView:S,selectedViewId:d}}function RD({column:e,index:t,openSubMenuName:o,subMenuAnchorEl:n,toggleColumnSelection:r,toggleSubmenuItem:i,handleSubMenuOpen:a,handleSubMenuClose:s}){let{t:l}=useTranslation(),p=useTheme(),{isIndeterminate:d,hasSubmenuItems:m,isSubmenuOpen:u,isFirstItem:c,handleColumnClick:f,handleMouseEnter:x,handleMouseLeave:C}=Mm({column:e,index:t,openSubMenuName:o,toggleColumnSelection:r,handleSubMenuOpen:a,handleSubMenuClose:s}),S=g=>g?l(g)??Bh$1(g):"";return jsxs(zn,{sx:{borderTop:`1px solid ${p.palette.divider}`,...c&&{borderTop:"none",height:33}},children:[jsxs(V,{isIndeterminate:d,isSelected:e.selected,onMouseEnter:x,onMouseLeave:C,onClick:f,children:[jsx(zn,{sx:{flex:1},children:S(e.label)}),m&&jsx("img",{src:vb,className:"arrow-icon",alt:"arrow"})]}),m&&jsx(R,{open:u,anchorEl:n,placement:"right-start",onMouseEnter:()=>{},onMouseLeave:s,children:e.menuItems?.map(g=>jsx(V,{isSelected:e.selected&&g.selected,onClick:()=>i(e.name,g.name),children:S(g.label)},g.name))})]},e.name)}var db=RD;function ND({open:e,onSelect:t,setTableViews:o,tableViews:n,anchorEl:r,onClose:i}){let{t:a}=useTranslation(),s=useMemo(()=>n||[],[n]),l=useMemo(()=>s.map(S=>S.name),[s]),{reorderColumns:p,toggleColumnSelection:d,toggleSubmenuItem:m}=Pm({columns:s,setTableViews:o}),{subMenuAnchorEl:u,openSubMenuName:c,handleSubMenuClose:f,handleSubMenuOpen:x,handleMenuScroll:C}=Tm(e,i);return jsxs(vn,{"data-testid":"TableView_CustomViews",children:[jsxs(Tn,{"data-testid":"TableView_CustomViews_Button",onClick:t,children:[jsx("div",{children:a("columns")}),jsx("img",{src:Cb$1,alt:"arrow",style:{...!!e&&{transform:"rotate(180deg)"}}})]}),jsxs(R,{open:e,anchorEl:r,"data-testid":"TableView_CustomViews_Popper",sx:{padding:0,marginTop:"8px",borderRadius:1},children:[e&&jsx(a$5,{onClick:i}),jsx(wn,{component:"article","data-testid":"TableView_CustomViews_List",children:jsx(Reorder.Group,{as:"div",axis:"y",onReorder:p,values:l,onScroll:C,children:s.map((S,g)=>jsx(db,{column:S,index:g,openSubMenuName:c,subMenuAnchorEl:u,toggleColumnSelection:d,toggleSubmenuItem:m,handleSubMenuOpen:x,handleSubMenuClose:f},S.name))})})]})]})}var rd=memo(ND);function HD({open:e,selectedViewInfo:t,setSelectedViewInfo:o,onSelect:n,onTableViewOptionClick:r,anchorEl:i}){let{t:a}=useTranslation();return jsxs(vn,{"data-testid":"TableView_DefaultViews",children:[jsxs(Tn,{onClick:s=>{n(s);},children:[jsx("div",{children:t.label}),jsx("img",{src:Cb$1,alt:"arrow",style:{...!!e&&{transform:"rotate(180deg)"}}})]}),jsx(VD,{open:e,anchorEl:i,placement:"bottom-start",children:jsxs(wn,{children:[Cb$2.map(s=>jsxs(Pn,{onClick:()=>{o(s),r?.(s);},children:[s.id===t.id?jsx("img",{className:"check-icon",src:Db$1,alt:"arrow"}):jsx(En,{}),jsx("span",{children:s.label}),jsx(Wr,{})]},s.id)),jsxs(Pn,{sx:{border:"none"},onClick:s=>{s.stopPropagation(),o(Bb),r?.(Bb);},children:[t.id===Bb.id?jsx("img",{className:"check-icon",src:Db$1,alt:"arrow"}):jsx(En,{}),jsx("span",{children:a("createCustomView")}),jsx(Wr,{})]})]})})]})}var id=ld.memo(HD);function $D({onViewChange:e,setIsViewVisible:t,setTableViews:o,tableViews:n,resetTableViews:r,onTableViewOptionClick:i}){let[a,s]=useState(null),[l,p$1]=useState(null),[d,m]=useState(null),[u,c]=useState(Ab$2),{t:f}=useTranslation(),x=h=>{e?.(),s(h.currentTarget),t(true);},C$1=()=>{p$1(null),m(null);},S=()=>{s(null),t(false),c(Ab$2);},g=h=>{c(h),h.id!==Bb.id&&r?.(h),C$1();};return a?jsx(zD,{onClickAway:C$1,children:jsxs(gs,{"data-testid":"TableView",children:[u.id===Bb.id&&jsx(rd,{tableViews:n,setTableViews:o,anchorEl:d,open:!!d,onSelect:h=>{m(d?null:h.currentTarget),p$1(null);},onClose:()=>{m(null);}}),jsx(id,{open:!!l,anchorEl:l,setSelectedViewInfo:h=>{g(h);},selectedViewInfo:u,onSelect:h=>{p$1(l?null:h.currentTarget),m(null);},onTableViewOptionClick:i}),jsx(Tn,{sx:{width:32,justifyContent:"center"},onClick:S,children:jsx("img",{src:Eb$1,alt:"close"})})]})}):jsx(p,{title:f("tableView"),children:jsx(b,{variant:"secondary",size:"md",icon:jsx(d$1,{src:C,alt:"view",sx:{width:14,height:14}}),"data-testid":"TableView_no_anchorViewEl",onClick:x,"aria-label":f("tableView")})})}var ad=memo($D);var ub=({columns:e,allCurrentSelected:t,someCurrentSelected:o,onSelectAll:n,onReset:r,onColumnToggle:i,onNestedItemToggle:a,isModified:s=false})=>{let{hoveredNestedColumn:l,nestedSubmenuAnchorEl:p,openNestedSubmenu:d,closeNestedSubmenu:m,cancelNestedClose:u}=sb();return jsxs(Fragment,{children:[jsxs(YI,{children:[jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsx(f$2,{checked:t,indeterminate:o,onChange:c=>{c.stopPropagation(),n();},onClick:c=>{c.stopPropagation();},sx:ZI})}),jsx(Typography,{component:"button",disabled:!s,onClick:c=>{c.stopPropagation(),s&&r();},sx:{fontSize:11,fontWeight:500,color:"#1F88D0",background:"none",border:"none",cursor:s?"pointer":"default",padding:0,opacity:s?1:.5,pointerEvents:s?"auto":"none","&:hover":s?{textDecoration:"underline"}:void 0},children:"Reset"})]}),jsx(v,{}),jsx(KI,{onScroll:m,children:jsx(Box,{component:"ul",sx:{listStyle:"none",padding:0,margin:0},children:e.map((c,f)=>{let x=c.menuItems&&c.menuItems.length>0,{checked:C,indeterminate:S}=_r(c),g=_(c.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=>x&&d(c.name,h.currentTarget),onMouseLeave:()=>x&&m(),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[jsx(V,{isSelected:x?C:c.selected,isIndeterminate:x?S:false,isDisabled:g,onClick:()=>{g||i(c.name);},sx:{flex:1,display:"flex",alignItems:"center"},children:jsx("span",{children:c.label||c.name})}),x&&jsx(Box,{sx:{display:"flex",alignItems:"center",pr:1,pointerEvents:"none"},children:jsx("img",{src:wb$1,alt:"arrow",style:{height:12}})})]}),x&&jsx(Popper,{open:l===c.name,anchorEl:p,placement:"right-start",sx:{zIndex:1e4},children:jsxs(Box,{onMouseEnter:u,onMouseLeave:m,sx:{display:"flex",pl:.5},children:[jsx(Box,{sx:{width:8,height:"100%",position:"absolute",left:-8,top:0,bottom:0}}),jsx(xs,{children:c.menuItems?.map((h,w)=>jsxs(ld.Fragment,{children:[jsx(V,{isSelected:h.selected,isDisabled:g,onClick:()=>{g||a(c.name,h.name);},children:h.label||h.name}),w<(c.menuItems?.length??0)-1&&jsx(v,{})]},h.name))})]})})]}),f<e.length-1&&jsx(v,{})]},c.name)})})})]})};function QD({open:e,selectedViewInfo:t,setSelectedViewInfo:o,anchorEl:n,onClose:r,onCreateCustomView:i,customViews:a=[],onEditCustomView:s,defaultColumns:l=[],defaultTemplate:p$1,defaultTemplates:d=[],customTemplateCount:m,isLoading:u}){let{t:c}=useTranslation(),{hoveredColumn:f,anchorEl:x,openSubmenu:C,closeSubmenu:S,cancelClose:g,forceClose:h}=Dn(),[w,T]=ld.useState(null),[y,b]=ld.useState(null),v$1=useMemo(()=>[...d.length?d:p$1?[p$1]:[],...a],[d,p$1,a]),E=useCallback(N=>N.submenu?.length?N.submenu:l,[l]),A=useCallback(N=>N?Is(N,E(N)):l,[l,E]),D=useCallback(N=>A(N).length>0,[A]),R$1=useMemo(()=>f?v$1.find(N=>N.id===f):void 0,[f,v$1]),W=useMemo(()=>A(R$1),[R$1,A]),z=useMemo(()=>f?y?.length?y:W:[],[f,W,y]),te=useMemo(()=>_m(z),[z]),we=useMemo(()=>zm(z,te),[z,te]),ze=y!=null&&!$r(y,W),De=(m??Dm(a))>=3,$=u||De,Ct=$||!ze;function kl(N){h(),b(null);let se;if(vo(N)){let Fe=N.submenu?.length?N.submenu:l.length?l:p$1?.submenu??[];se={...N,submenu:de(Fe),columns:Fe.map(rt=>rt.name)};}else Xe(N)&&(se=N);o(N,se);}function Nl(N,se){let Fe=v$1.find(rt=>rt.id===N);b(de(A(Fe))),C(N,se);}function L(){b(null),S(),h();}function H(N){if(N.stopPropagation(),Ct)return;let se=de(W),Fe=y?.length?de(y):se;i?.(true,Fe,se,R$1?.id),b(null),h();}function oe(N){y&&b(Hm(y,N));}function Re(N,se){y&&b(zr(y,N,se));}function u0(){y&&b(Om(y,!te));}function f0(){b(de(W));}return jsxs(vn,{"data-testid":"ViewsDropdown",children:[jsx(VD,{open:e,anchorEl:n,placement:"bottom-start",children:jsxs(wn,{onScroll:h,children:[jsx(DT,{sx:{paddingX:1.25,py:1.1,fontWeight:500,fontSize:11,color:"#8D8D94"},children:"View"}),jsx(v,{}),v$1.map(N=>{let se=Xe(N),Fe=!se&&D(N);return jsxs(Pn,{onMouseEnter:rt=>{se?T(N.id):Fe&&Nl(N.id,rt.currentTarget);},onMouseLeave:()=>{se?T(null):Fe&&S();},onClick:()=>kl(N),sx:{position:"relative",cursor:"pointer",pr:1.5},children:[N.id===t.id?jsx("img",{style:{width:15,height:15},src:Xj,alt:"check"}):jsx(En,{}),jsx("span",{style:{flex:1,fontSize:11},children:N.label}),se&&w===N.id&&jsx("img",{src:Ah$1,alt:"edit",style:{width:12,height:12,cursor:"pointer"},onClick:rt=>{rt.stopPropagation(),r?.(),s?.(N);}}),Fe&&jsx("img",{src:wb$1,alt:"arrow",style:{height:12}})]},N.id)}),jsx(p,{title:"Limit reached. Delete a view to create a new one.",placement:"left",disableHoverListener:!De,children:jsxs(Pn,{sx:{border:"none",opacity:$?.5:1,cursor:$?"not-allowed":"pointer"},onClick:N=>{if(N.stopPropagation(),$)return;let se=de(A(p$1)),Fe=se.map(rt=>({...rt,selected:false,menuItems:rt.menuItems?.map(g0=>({...g0,selected:false}))}));i?.(true,Fe,se,p$1?.id),h();},children:[jsx(En,{}),jsxs(zn,{sx:{display:"flex",alignItems:"center",gap:.5},children:[jsx("img",{src:fm,alt:"",style:{opacity:$?.5:1,width:10,height:10}}),jsx("span",{style:{color:$?"#999":"#1F88D0",fontSize:11,fontWeight:500},children:c("New Custom View")})]}),jsx(Wr,{})]})})]})}),f&&x&&z.length>0&&jsx(R,{open:!!x,anchorEl:x,placement:"auto-end",onMouseEnter:g,onMouseLeave:L,children:jsxs(jI,{children:[jsx(ub,{columns:An(z),allCurrentSelected:te,someCurrentSelected:we,onSelectAll:u0,onReset:f0,onColumnToggle:oe,onNestedItemToggle:Re,anchorEl:x,isModified:ze}),jsxs(qI,{children:[jsx(fb,{variant:"text",onClick:L,sx:XI,children:"Cancel"}),jsx(p,{title:"Limit reached. Delete a view to create a new one.",placement:"top",disableHoverListener:!De,children:jsx(fb,{variant:"contained",onClick:H,disabled:Ct,sx:JI,children:"Create view"})})]})]})})]})}var pd=ld.memo(QD);var Cb=({selectedColumns:e,columnNames:t,allSelected:o,someSelected:n,hoveredColumn:r,anchorEl:i,onReorder:a,onColumnToggle:s,onSubItemToggle:l,onSelectAll:p,onResetToDefault:d,onSubmenuEnter:m,onSubmenuLeave:u,onCancelClose:c})=>{let f=useRef(null),{onDragStart:x,onDragEnd:C$1}=wm(f),S=useCallback(g=>{if(jm(g.target)){g.preventDefault();return}x();},[x]);return jsxs(WI,{children:[jsxs(HI,{children:[jsx(ym,{children:jsx("img",{src:C,alt:"drag",style:{width:16,height:16,opacity:.5}})}),jsx(Im,{onClick:g=>{g.stopPropagation(),p();},children:jsx(f$2,{checked:o,indeterminate:n,size:"small",sx:bm,onChange:g=>{g.stopPropagation(),p();},onClick:g=>{g.stopPropagation();}})}),jsx(Typography,{onClick:g=>{g.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:g=>{g.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(g=>{let h=_(g.name),w=g.menuItems&&g.menuItems.length>0,{checked:T,indeterminate:y}=_r(g);return jsxs(Reorder.Item,{value:g.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:S,onDragEnd:C$1,children:[jsxs(OI,{isHovered:r===g.name,isDate:h,onMouseEnter:b=>w&&m(g.name,b.currentTarget),onMouseLeave:()=>w&&u(),onClick:b=>{(b.target.closest('[role="checkbox"]')||b.target.closest('input[type="checkbox"]'))&&b.stopPropagation();},sx:{width:"100%",position:"relative"},children:[jsx(ym,{children:jsx("img",{src:Fb,alt:"drag",draggable:false,style:{width:16,height:16,cursor:h?"default":"grab",pointerEvents:"none"}})}),jsx(Im,{onMouseDown:b=>{b.stopPropagation();},onPointerDown:b=>{b.stopPropagation();},children:jsx(f$2,{checked:T,indeterminate:y,onChange:b=>{b.stopPropagation(),s(g.name);},onClick:b=>{b.stopPropagation();},disabled:h,size:"small",sx:bm})}),jsx(Typography,{sx:{flex:1,fontSize:13,fontWeight:400,color:"text.primary",ml:1},children:g.label||g.name}),w&&jsx(Box,{sx:{display:"flex",alignItems:"center",ml:1,flexShrink:0},children:jsx("img",{src:vb,alt:"arrow",style:{width:12,height:12}})})]}),w&&jsx(Popper,{open:r===g.name,anchorEl:i,placement:"right-start",sx:{zIndex:1e4},modifiers:[{name:"offset",options:{offset:[0,0]}}],children:jsxs(Box,{onMouseEnter:c,onMouseLeave:u,sx:{display:"flex",pl:.5},children:[jsx(Box,{sx:{width:8,height:"100%",position:"absolute",left:-8,top:0,bottom:0}}),jsx(xs,{children:g.menuItems?.map((b,v$1)=>jsxs(ld.Fragment,{children:[jsx(V,{isSelected:b.selected,isDisabled:h,onClick:()=>{h||l(g.name,b.name);},sx:{fontSize:13},children:b.label||b.name}),v$1<(g.menuItems?.length??0)-1&&jsx(v,{})]},b.name))})]})})]},g.name)})})})]})};function sR({open:e,onClose:t,onCreate:o,availableColumns:n=[],defaultColumns:r=[],editingView:i,onDelete:a,tableViews:s=[],mode:l="sheet",stackOrder:p=1}){let{t:d}=useTranslation(),m=useDragControls(),[u,c]=useState(false),[f,x]=useState(false);useEffect(()=>{e||(c(false),x(false));},[e]),useEffect(()=>{if(!e)return;let $=Ct=>{Ct.key==="Escape"&&t();};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[e,t]);let{templateName:C,setTemplateName:S,selectedColumns:g,allSelected:h,someSelected:w,isNameValid:T,hasChanges:y,hoveredColumn:b,anchorEl:v,openSubmenu:E,closeSubmenu:A,cancelClose:D,handleReorder:R,handleColumnToggle:W,handleSubItemToggle:z,handleSelectAll:te,handleResetToDefault:we}=ed({open:e,availableColumns:n,defaultColumns:r,editingView:i,tableViews:s}),ze=async()=>{if(!(!T||!y||f||u)){x(true);try{let $=Am(g,l);await o?.({name:C,selectedColumns:g,layout:$}),t();}catch{console.warn("Failed to create view");}finally{x(false);}}},De=async()=>{if(!i||u||f)return;let $=i.id;c(true);try{await a?.($),t();}catch{console.warn("Failed to delete view");}finally{c(false);}};return e?jsxs(GI,{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$2,{id:"draggable-dialog-title",onPointerDown:$=>m.start($),style:{cursor:"move",flexShrink:0},children:jsx(d$3,{isHovered:true,title:i?"Edit Custom View":d("createCustomView")||"Create Custom View",leftActions:jsx(a$b,{onClick:t,onPointerDown:$=>$.stopPropagation()})})}),jsxs(NI,{children:[jsxs(FI,{onScroll:()=>{A();},children:[jsxs(VI,{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($I,{onClick:De,disabled:u||f,children:u?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(b$8,{name:"custom-template-name",label:"Template Name",value:C,onChange:$=>S($),inputProps:{maxLength:20,autoComplete:"off",readOnly:true,"data-form-type":"other",onFocus:$=>$.currentTarget.removeAttribute("readonly")},required:true})}),jsx(Cb,{selectedColumns:An(g),columnNames:An(g).map($=>$.name),allSelected:h,someSelected:w,hoveredColumn:b,anchorEl:v,onReorder:R,onColumnToggle:W,onSubItemToggle:z,onSelectAll:te,onResetToDefault:we,onSubmenuEnter:E,onSubmenuLeave:A,onCancelClose:D})]}),jsx(_I,{}),jsx(zI,{children:jsx(UI,{variant:"contained",onClick:ze,disabled:!T||!y||f||u,title:T?void 0:`Name is required. Current: "${C}"`,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 md=sR;function dR({onViewChange:e,templates:t,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,tableMode:i="default",lang:a="en",isLoading:s,mainDefaultTemplate:l}){let{t:p$1}=useTranslation(),{defaultColumns:d,defaultTemplate:m,defaultTemplates:u,customViews:c,allTemplates:f,customTemplateCount:x}=ws({tableMode:i,templates:t,lang:a,mainDefaultTemplate:l}),{anchorEl:C$1,isCreateDialogOpen:S,editingView:g,selectedViewInfo:h,shouldUseCurrentState:w,currentViewColumns:T,initialColumnsForCreate:y,availableColumnsForCreate:b$1,handleViewButtonClick:v,handleCloseViewDropdown:E,handleSelectedViewInfo:A,handleOpenCreateDialog:D,handleOpenEditDialog:R,handleCloseCreateDialog:W,handleSaveView:z,handleDeleteView:te}=vs({mode:i,onViewChange:e,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,defaultColumns:d,defaultTemplate:m,allTemplates:f,customTemplateCount:x});return jsxs(Fragment,{children:[jsx(zD,{onClickAway:E,children:jsxs(gs,{sx:{width:"32px"},"data-testid":"ViewsMenu",children:[jsx(p,{title:p$1("tableView"),children:jsx(b,{variant:"secondary",size:"md",icon:jsx(d$1,{src:C,alt:"view",sx:{width:14,height:14}}),"data-testid":"ViewsMenu_button",onClick:v,"aria-label":p$1("tableView")})}),jsx(pd,{open:!!C$1,anchorEl:C$1,onClose:E,setSelectedViewInfo:A,selectedViewInfo:h,onCreateCustomView:D,customViews:c,onEditCustomView:R,defaultColumns:d,defaultTemplate:m,defaultTemplates:u,customTemplateCount:x,isLoading:s})]})}),jsx(md,{open:S,onClose:W,availableColumns:b$1?.length?b$1:d,defaultColumns:d,onCreate:z,editingView:g,onDelete:te,tableViews:w?y??T:void 0,mode:i})]})}var dd=memo(dR);function cd(e=[]){let[t,o]=useState(false),n=useMemo(()=>e.map(({code:r})=>r),[e]);return {isColumnPickerVisible:t,setIsColumnPickerVisible:o,timezoneCountryCodes:n}}function xR({tableMode:e,onToggle:t}){let o=Va(e),n=Wa$1(e);return jsx(b,{variant:"secondary",size:"md",icon:jsx(d$1,{src:n?Kh$1:Jh$1,alt:`${e}-mode`,sx:{width:14,height:14}}),onClick:t,"aria-label":`${e}-mode`,sx:r=>o?{}:{borderColor:r.v2.palette.brand[500],boxShadow:"0px 0px 4px 0px rgba(31, 136, 208, 0.50)"}})}var wb=memo(xR);function Zr({children:e,component:t="aside",...o}){return jsx(RI,{component:t,"data-testid":"ListHeaderToolbar",...o,children:e})}function Rs({display:e,timezone:t,calendar:o,views:n,search:r,slots:i,reportsVisible:a,lang:s}){let{isColumnPickerVisible:l,setIsColumnPickerVisible:p,timezoneCountryCodes:d}=cd(t?.segmentCountries),m=e?.variant==="acceptance",u=n?.tableMode??"default",c=useMemo(()=>n?.onSheetToggle?jsx(wb,{tableMode:u,onToggle:n.onSheetToggle}):null,[u,n?.onSheetToggle]);return jsxs(Zr,{children:[i?.leading&&!l&&i.leading,!l&&jsxs(Fragment,{children:[r?.onChange&&jsx(a$c,{onSearchChange:r.onChange,placeholder:r.placeholder}),i?.filter,c&&!m&&c,o&&t&&jsx(b$9,{defaultDate:o.date,onDateChange:(f,x)=>{let[C,S]=f;C&&S&&o.onDateChange([C,S],x);},mode:o.mode,onCalendarModeSwitch:o.onModeChange,maxDateRange:o.maxRange??31,groupBy:o.groupBy,onCalendarGroupChange:o.onGroupByChange,browserTimezone:t.browserTimezone,zone:t.zone,countryZone:t.countryZone,onChangeZone:t.onChangeZone,defaultCountryTimezone:t.defaultCountryTimezone,timezone:t.timezone,onChangeTimezone:t.onChangeTimezone,timezoneCountriesCodes:d}),a&&i?.reports,c&&m&&c]}),n?.onViewChange&&(n.templates?jsx(dd,{onViewChange:n.onViewChange,tableMode:u,lang:s,...n.templates}):jsx(ad,{onViewChange:n.onViewChange,setIsViewVisible:p,tableViews:n.columns,setTableViews:n.setColumns,resetTableViews:n.onPresetReset,onTableViewOptionClick:n.onPresetOptionClick})),i?.trailing&&!l&&i.trailing]})}function TR({title:e,display:t,lang:o,reportsVisible:n,timezone:r,calendar:i,status:a,activeFilter:s,views:l,search:p,slots:d,children:m}){let u=zc(useId(),"list-header"),c=useMemo(()=>jsx(Rs,{display:t,timezone:r,calendar:i,views:l,search:p,slots:d,reportsVisible:n,lang:o}),[t,r,i,l,p,d,n,o]);return jsxs(cs,{id:u,"data-testid":vI,children:[t?.maximized&&jsx(us,{title:e,toolbar:c}),jsxs(AI,{as:"section",children:[jsx(fs,{status:a,activeFilter:s,beforeStatus:d?.beforeStatus}),!t?.maximized&&c]}),m]})}var Eb=memo(TR);var Ab=styled(zn,{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)})),vR=wa$1(),Db=styled(j$1,{shouldForwardProp:e=>e!=="title"&&e!=="isDropdown"})(({title:e,isDropdown:t,theme:o})=>{let{base:n}=o.v2.palette;return {position:"relative",fontWeight:o.typography.fontWeightMedium,padding:o.spacing(1),color:n.black,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:n.white,boxShadow:o.shadows[2]},cursor:"pointer",position:"relative",color:"transparent","&:after":{...e&&{content:`"${e}"`},color:n.black,fontWeight:o.v2.typography.fontWeightBold,overflow:"hidden",position:"absolute",top:0,bottom:0,right:0,left:0,display:"flex",alignItems:"center",justifyContent:t?"flex-start":"center",letterSpacing:vR==="safari"?"-1px":"",padding:8,borderRadius:o.shape.borderRadius}}}});function AR({isDropdown:e=false,name:t,code:o,activeCode:n,navigateToMenuItem:r,onClickServiceItem:i}){let[a,s]=useState(null),{t:l}=useTranslation(),p=!!a,d=()=>{s(null);};return jsxs(Fragment,{children:[jsx(Db,{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(),s(m.currentTarget);},children:t}),jsx(f,{open:p,anchorEl:a,onClose:d,menuItems:[{label:l("openNewWindow"),name:"new",icon:jsx("img",{src:hb,alt:"new-window-icon"}),onClick:m=>{m.stopPropagation(),i?.(o),d();}}]})]})}var Rb=memo(AR);var HR=e$1=>jsx(e,{src:e$1.className.includes("MuiSelect-iconOpen")?Wc:Vc,alt:"dropdown"});function OR({isMaximized:e,serviceCode:t,dimensions:o,services:n,onChangeServiceCode:r,onClickServiceItem:i}){let a=zc(useId(),"app-services"),[s,l]=useState(0),[p,d]=useState(false),[m,u]=useState(""),c=useRef(null),[f,x]=ld.useState(false),{i18n:C}=useTranslation(),S=y=>{u(y.target.value);},g=()=>{x(y=>!y);},h=useMemo(()=>ac$1(n.filter(y=>y.code.toLowerCase()===decodeURIComponent(t).toLowerCase())?.[0]?.name,C.language),[n,C.language,t]);useEffect(()=>{u(h);},[h]),useEffect(()=>{l(c.current?.offsetWidth+51+8+3);},[]),useEffect(()=>{d(Number(o?.width)<s+10);},[o?.width,s]);let w=y=>{r?.(y),x(false);},T=y=>jsx(c$3,{children:y});return jsxs(Ab,{id:a,"data-testid":"AppServices",maximized:e,children:[!!n?.length&&!p&&jsx(Box,{ref:c,display:"flex",gap:"8px",flexDirection:"row",sx:{userSelect:"none"},children:n.map((y,b)=>jsx(Rb,{activeCode:t,onClickServiceItem:i,navigateToMenuItem:w,name:ac$1(y.name,C.language)||"",code:y.code},`service-item-${y.code}-${b}`))}),!!n?.length&&p&&jsx(a$6,{open:f,onClick:g,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:HR,onChange:S,renderValue:T,sx:{"& .MuiOutlinedInput-root.MuiList-root-MuiMenu-list":{paddingTop:"0px !important",paddingBottom:"0px !important"}},children:n.map((y,b)=>ac$1(y.name,C.language)?.toLowerCase()===m?.toLowerCase()?null:jsx(b$3,{value:ac$1(y.name,C.language),onClick:v=>{v.preventDefault(),v.stopPropagation(),w(y.code);},children:jsx(d$2,{children:ac$1(y.name,C.language)})},`option-${y.code}-${b}`))})]})}var Lb=memo(OR);var Cd=Lb;var kb=styled(zn)(({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"}})),Nb=styled(L)(()=>({flexGrow:1,maxWidth:"100%",padding:0,border:"none",backgroundColor:"transparent",borderRadius:"none",height:24,[`& .${K.input}`]:{padding:0},input:{textAlign:"right",width:"100%",fontWeight:400}}));var GR=xa();function YR({amount:e,setAmount:t,maxAmount:o,isError:n,selectedCurrency:r,id:i="AmountInput",...a}){let[s,l$1]=useState(false),[p,d]=useState(e||""),m=useMemo(()=>l(r?.decimals),[r]),u=x=>{let C=Number(x.target.value)||0;if(o&&C>o)return false;d(C),t(C);},c=()=>{l$1(false),t(Number(p));},f=x=>{GR&&isNaN(Number(x.key))&&x.key!=="Backspace"&&x.key!=="."&&x.preventDefault();};return jsx(kb,{"data-testid":"AmountInput",sx:a.sx,children:s?jsx(Nb,{id:i,type:"number",placeholder:m,value:p,onChange:u,onBlur:c,onKeyDown:f,error:!!n,inputProps:{step:"0.01"},hideArrows:true,autoFocus:true,disableFocusRing:true}):jsx(a$7,{currencyCode:r?.code?.english,amount:e,onClick:()=>{l$1(true);}})})}var Vb=memo(YR);var yd=Vb;function XR({appCode:e,services:t,isMaximized:o,dimensions:n,serviceCode:r,ui:{onStartDrag:i},onChangeServiceCode:a,onClickServiceItem:s,sx:l}){let p=zc(useId(),"app-services-bar"),[d,m]=useState(false),u=useCallback(f=>{i?.(f),m(true);},[i,m]),c=()=>{m(false);};return !e||!t?.length?null:jsx(b$4,{id:p,"data-testid":"AppServicesBar",onPointerDown:u,onPointerUp:c,isDragging:d,sx:l,children:jsx(Cd,{onClickServiceItem:s,dimensions:{width:n.width},serviceCode:r,services:t,isMaximized:o,onChangeServiceCode:a})})}var Hb=memo(XR);var JR=Hb;var Ob=({width:e,height:t})=>jsx(r,{variant:"circular",width:e,height:t});function nL({data:e,isError:t,isLoading:o,width:n=24,height:r=24,fallbackIconUrl:i=Rd$1,...a}){let s=zc(useId(),"brand-logo"),l=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?We:d,[e,t,p,d,i]);return o?jsx(Ob,{width:n,height:r}):jsx(d$1,{id:s,"data-testid":"BrandLogo",alt:"brand",src:m,sx:{borderRadius:"50%",backgroundColor:l.palette.common.white,width:n,height:r,objectFit:p?"none":"contain",...a.sx}})}var bd=memo(nL);var Sd=(e,t)=>{let o=0;return t.percentage>0&&(o=e*(t.percentage/100)),o},pne=(e,t,o)=>({...e,value:Sd(Number(t),e)*o});var Ub=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"}})),Gb=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 jb=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})),Kb=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 Jb=styled(zn)(({theme:e})=>({width:112,".option + .option":{borderTop:`1px solid ${e.palette.divider}`},zIndex:3})),Td=styled(zn)(({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 aL({vat:e,onChange:t,setIsDropdownOpen:o}){let{t:n}=useTranslation(),{percentage:r,isInclusive:i,value:a}=e,s=r===So.ZERO,l=r===So.FIVE,p=r===So.TEN,d=r===So.FIFTEEN,m=r!==So.FIVE&&r!==So.TEN&&r!==So.FIFTEEN&&r!==So.ZERO,u=[{label:n("noVat"),value:So.ZERO,selected:s},{label:"5%",value:So.FIVE,selected:l},{label:"10%",value:So.TEN,selected:p},{label:"15%",value:So.FIFTEEN,selected:d}],c=C=>{t({value:a,percentage:C,isInclusive:i});},f=C=>{Number(C.target.value)>100||c(Number(ob$1(C.target.value)));},x=C=>C?jsx("img",{src:Db$1,alt:"check"}):jsx("span",{});return jsxs(Jb,{children:[u.map((C,S)=>jsxs(Td,{className:"option",onClick:()=>{c(C.value),o(false);},children:[x(C.selected),jsx("span",{children:C.label})]},`${C.value}-${S}`)),jsxs(Td,{className:"option",children:[x(m),jsx(L,{placeholder:"%",value:m?String(r):"",onChange:f,sx:{justifyContent:"flex-end"}})]})]})}var Bs=memo(aL);function mL({setVat:e,vat:t,setIsOpen:o,...n}){let[r,i]=useState(null),a=!!r,{t:s}=useTranslation(),l=p=>{if(p.stopPropagation(),a){i(null);return}i(p.currentTarget);};return jsx(jb,{sx:n.sx,children:jsxs(Kb,{sx:p=>({...a&&{boxShadow:p.shadows[3]}}),className:"option",onClick:l,children:[jsx("span",{children:s("rate")}),jsx("img",{src:vb,alt:"a"}),jsx(R,{anchorEl:r,open:a,placement:"right-start",children:jsx(Bs,{onChange:e,vat:t,setIsDropdownOpen:o})})]})})}var ks=memo(mL);function CL({totalGrossAmount:e,totalVat:t,selectedCurrency:o,onChangeTotalVat:n,isDisabled:r}){let[i,a]=useState(false),s=useRef(),{t:l}=useTranslation(),p=()=>{r||a(!i);},d=c=>{n({...c,value:Sd(e,c)});},m=o?.code?.english||"",u=()=>t.percentage===0?l("noVat"):t.isInclusive?jsxs(zn,{sx:{display:"flex",gap:"4px"},children:[jsxs("span",{children:[l("inclusive")," "]}),jsx(a$7,{amount:t.value,currencyCode:m})]}):jsx(a$7,{currencyCode:m,amount:t.value});return jsxs(Ub,{isDisabled:r,isOpen:i,onClick:p,ref:s,sx:{...r&&{pointerEvents:"none",opacity:.7}},children:[jsx("img",{src:lj,alt:"p"}),jsx(Gb,{isDisabled:r,children:u()}),jsx(zn,{component:"img",src:i?rj:Ui,alt:"a"}),i&&jsx(a$5,{onClick:p}),jsx(VD,{open:!!i,anchorEl:s.current,placement:"bottom-start",children:jsx(ks,{setIsOpen:a,vat:t,setVat:d,sx:{position:"absolute",top:8,left:0,display:i?"block":"none"}})})]})}var eS=memo(CL);var Pd=(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},rre=(e,t,o)=>({...e,value:Pd(t,e)*o});var tS=styled(zn)(({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})),Ns=styled(zn)(({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"}})),oS=styled(zn,{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 iS=styled(zn)(({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})),Ad=styled(zn)(({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 IL({discount:e,setDiscount:t,setIsDropdownOpen:o,setIsOpen:n,...r}){let i=zc(useId(),"discount-rate-dropdown"),{percentage:a,value:s}=e,l=a===So.FIVE,p=a===So.TEN,d=a===So.FIFTEEN,m=a!==So.FIVE&&a!==So.TEN&&a!==So.FIFTEEN&&a!==So.ZERO&&s!==So.ZERO,u=[{label:"5%",value:So.FIVE,selected:l},{label:"10%",value:So.TEN,selected:p},{label:"15%",value:So.FIFTEEN,selected:d}],c=C=>{t({value:s,percentage:C,type:"percent"}),n(false);},f=C=>{if(Number(C.target.value||!Number(C.target.value))>100)return false;t({value:Number(C.target.value),percentage:Number(ob$1(C.target.value)),type:"percent"});},x=C=>C?jsx("img",{src:Db$1,alt:"c"}):jsx("span",{});return jsxs(iS,{id:i,"data-testid":"DiscountRateDropdown",sx:r.sx,children:[u.map(C=>jsxs(Ad,{className:"option",onClick:()=>{c(C.value),o&&o(false);},children:[x(C.selected),jsx("span",{children:C.label})]},C.value)),jsxs(Ad,{className:"option",children:[x(m),jsx(L,{placeholder:"%",sx:{input:{width:"100% !important"}},value:m?a:"",onChange:f})]})]})}var Vs=memo(IL);function wL({discount:e,maxDiscount:t,setDiscount:o,setIsOpen:n,selectedCurrency:r,...i}){let a=zc(useId(),"discount-dropdown"),[s,l]=useState(false),[p,d]=useState(false),{t:m}=useTranslation(),u=e.type==="noDiscount",c=e.type==="percent",f=g=>{o(g);},x=g=>{g.stopPropagation(),n(false),f({type:"noDiscount",value:0,percentage:0,flat:0}),s&&l(false),p&&d(false);},C=g=>{g.stopPropagation(),l(true),p&&d(false);},S=g=>{g.stopPropagation(),d(true),s&&l(false);};return jsxs(tS,{id:a,"data-testid":"DiscountDropdown",sx:{...i.sx,...p&&{borderBottomRightRadius:0}},children:[jsxs(Ns,{className:"option",onClick:x,sx:{justifyContent:"flex-start"},children:[u?jsx("img",{src:Db$1,alt:"c"}):jsx(zn,{width:"12px"}),jsx("span",{children:m("none")})]}),jsxs(Ns,{className:"option",onClick:C,sx:g=>({justifyContent:"space-between",position:"relative",...s&&{boxShadow:g.shadows[3]}}),children:[jsxs(zn,{sx:{display:"flex",alignItems:"center",gap:"6px"},children:[c?jsx("img",{src:Db$1,alt:"check"}):jsx(zn,{width:"12px"}),jsx("span",{children:"%"})]}),jsx("img",{src:vb,alt:"r"}),jsx(Vs,{sx:{position:"absolute",left:"100%",top:0,display:s?"block":"none",borderTopLeftRadius:0},setIsOpen:n,discount:e,setDiscount:o})]}),jsxs(Ns,{className:"option",onClick:S,sx:g=>({justifyContent:"space-between",position:"relative",...p&&{boxShadow:g.shadows[3]}}),children:[jsxs(zn,{sx:{display:"flex",alignItems:"center",gap:"6px"},children:[e.type==="flat"?jsx("img",{src:Db$1,alt:"c"}):jsx(zn,{width:"12px"}),jsx("span",{children:m("flat")})]}),jsx("img",{src:vb,alt:"r"}),jsx(oS,{isOpen:p,children:jsx(yd,{selectedCurrency:r,sx:{height:24,width:"100%",input:{height:20,width:"100%",textAlign:"right",flexGrow:1}},amount:e.type==="flat"?Number(e.flat):"",setAmount:g=>{f({...e,type:"flat",flat:Number(g)});},maxAmount:t})})]})]})}var Ws=memo(wL);var pS=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"}})),mS=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 RL({selectedCurrency:e,totalGrossAmount:t,totalDiscount:o,onChangeTotalDiscount:n,isDisabled:r}){let i=zc(useId(),"total-discount"),[a,s]=useState(false),l=useRef(),{t:p}=useTranslation(),d=()=>{r||s(!a);},m=c=>{n({...c,value:Pd(t,c)});},u=()=>o.value===0?p("noDiscount"):jsxs(zn,{sx:{display:"flex",gap:"2px"},children:[jsx("span",{children:"-"}),jsx(a$7,{amount:o.value,currencyCode:e?.code?.english})]});return jsxs(pS,{id:i,"data-testid":"TotalDiscount",isOpen:a,isDisabled:r,onClick:d,ref:l,sx:{...r&&{pointerEvents:"none",opacity:.7}},children:[jsx("img",{src:Zi,alt:"p"}),jsx(mS,{isDisabled:r,children:u()}),jsx(zn,{component:"img",src:a?rj:Ui,alt:"a"}),a&&jsx(a$5,{onClick:d}),jsx(VD,{open:!!a,anchorEl:l.current,placement:"bottom-start",children:jsx(Ws,{sx:{position:"absolute",top:8,left:0,display:a?"block":"none"},selectedCurrency:e,discount:o,setDiscount:m,setIsOpen:s,maxDiscount:Number(t)})})]})}var uS=memo(RL);var gS=styled(bd)(({theme:e})=>({filter:"drop-shadow(0px 0px 28px rgba(0, 0, 0, 0.09))",borderRadius:"50%",backgroundColor:e.palette.common.white})),xS=styled(zn)(()=>({display:"flex",alignItems:"center",justifyContent:"center"}));function hS({data:e,width:t=51,height:o=51,...n}){let r=zc(useId(),"merchant-logo");return jsx(xS,{id:r,"data-testid":"MerchantLogo",width:t,height:o,children:jsx(gS,{data:e,width:t,height:o,...n})})}var IS=styled(zn,{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"}})),bS=styled(zn)(({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})),SS=styled(zn)(()=>({display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:"2px","& img":{width:14,height:14}})),TS=styled(kL)(({theme:e})=>({marginTop:e.spacing(1),marginBottom:e.spacing(1),minWidth:193,"& .MuiPaper-root":{borderRadius:e.spacing(.5),"&>.MuiList-root":{padding:0}}})),wS=styled(j$1)(({theme:e})=>{let{grey:t}=e.v2.palette;return {fontWeight:e.v2.typography.fontWeightMedium,fontSize:"0.6875rem",color:t[500],paddingInlineStart:e.v2.spacing(16),paddingTop:e.v2.spacing(8),paddingBottom:e.v2.spacing(8),paddingInlineEnd:e.v2.spacing(8),borderBottom:`1px solid ${t[100]}`,display:"block"}}),Rd=styled(zn)(({theme:e})=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"flex-end",backgroundColor:e.palette.common.white,borderTop:`1px solid ${e.palette.divider}`})),Ld=styled(fb)(({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}})),Bd=styled(fb)(({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 kd=createContext(null);function VL(){let e=useContext(kd);if(!e)throw new Error("useFilterDropdown must be used inside a FilterDropdown");return e}function PS({onConfirm:e,onCancel:t,isOkayButDisabled:o,children:n,isDisabled:r,icon:i,title:a,menuStyle:s,hideTitle:l=false,hideFooter:p=false,activeFiltersCount:d,onClearFilters:m,renderButton:u,onOpenChange:c,menuProps:f,...x}){let C=zc(useId(),"filter-dropdown"),[S,g]=useState(null),h=!!S,{t:w}=useTranslation(),T=()=>{g(null),c?.(false);},y=D=>{if(!r){if(!h){g(D.currentTarget),c?.(true);return}T();}},b=()=>{h&&(t?.(),T());},v=()=>{e?.(),T();},E=typeof d=="number"&&d>0,A=D=>{D.stopPropagation(),m?.();};return jsx(kd.Provider,{value:{onConfirm:v,onCancel:b,onClose:T},children:jsx(zD,{onClickAway:b,children:jsxs(zn,{id:C,"data-testid":"FilterDropdown",...x,children:[jsx(IS,{className:"filter-button",isActive:h||E,onClick:y,sx:{...r&&{pointerEvents:"none",opacity:.5,...x.sx}},children:u??jsxs(Fragment,{children:[jsx(zn,{component:"img",src:i??$j,alt:"filter"}),E&&jsxs(Fragment,{children:[jsx(bS,{children:d}),jsx(SS,{onClick:A,"aria-label":"clear filters",children:jsx(zn,{component:"img",src:Eb$1,alt:"clear"})})]})]})}),jsxs(TS,{anchorEl:S,open:h,onClose:b,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{marginTop:"8px",marginBottom:"8px",width:193,...s},...f,children:[!l&&jsx(wS,{component:"span",children:a??w("filterBy")}),n,!p&&jsxs(Rd,{children:[jsx(Bd,{onClick:b,children:w("cancel")}),jsx(Ld,{disabled:o,onClick:v,children:w("okay")})]})]}),h&&jsx(a$5,{onClick:T})]})})})}var ES=styled(V)(()=>({padding:"12px 16px",border:"none !important","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"}})),MS=styled(zn)(()=>({display:"flex",flexDirection:"column",gap:"2px"})),AS=styled(zn)(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:"9px"})),DS=styled(zn)(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"178px"}));function Wd({brand:e,merchantsIds:t,onChangeMerchant:o,atLeastOneMerchantSelected:n=false,showSearchInput:r=false,anchorEl:i}){let[a,s]=useState(""),l=!!i,p=useCallback(S=>t.includes(S),[t]),d=(S,g)=>{if(S.stopPropagation(),p(g)){o?.(t.filter(w=>w!==g));return}let h=[...new Set([...t,g])];o?.(h);},m=S=>t.length===1&&t[0]===S&&n,u=S=>{s(S);},c=()=>{s("");},f=useMemo(()=>e.merchants??[],[e.merchants]),x=useMemo(()=>{if(!a?.trim())return f;let S=a.trim().toLowerCase();return f?.filter(g=>(g?.display_name??"").toLowerCase().includes(S)||(g?.legacy_id??"").toLowerCase().includes(S))},[a,f]),C=useMemo(()=>r?x:f,[x,f,r]);return jsxs(R,{open:l,anchorEl:i,placement:"right-start",children:[r&&f.length>1&&jsx(zn,{sx:{p:"8px"},children:jsx(b$5,{fullWidth:true,placeholder:"Merchants",name:"merchants",value:a,onChange:S=>u(S.target.value),onClear:c})}),C?.map(S=>jsx(ES,{isDisabled:m(S.legacy_id),isSelected:p(S.legacy_id),onClick:g=>{m(S.legacy_id)||d(g,S.legacy_id);},sx:{maxHeight:36,minHeight:36},children:jsxs(MS,{children:[jsx(DS,{component:"span",children:S.display_name}),jsx(AS,{component:"span",children:S.legacy_id})]})},S?.legacy_id))]})}var _s=Wd;var LS=styled(zn)(()=>({display:"flex",gap:"4px",alignItems:"center",flex:1,marginInlineEnd:"8px"}));function _d({brand:e,merchantsIds:t,isDisabled:o,atLeastOneMerchantSelected:n=false,showSearchInput:r=false,renderBrandLogo:i,onChangeMerchant:a}){let[s,l]=useState(null),p=!!s,d=C=>{l(C.currentTarget);},m=()=>{l(null);},u=useMemo(()=>e.merchants?.filter(C=>t.includes(C.legacy_id)),[t,e.merchants]),c=useMemo(()=>u?.length===e.merchants?.length,[u?.length,e.merchants?.length]),f=useMemo(()=>!c&&u.length>0,[c,u]),x=C=>{if(C.stopPropagation(),c){a?.(t.filter(S=>!e.merchants.some(({legacy_id:g})=>S===g)));return}if(f){let S=[...new Set([...t,...u.map(({legacy_id:g})=>g)])];a?.(S);return}a?.([...t,...e.merchants.map(({legacy_id:S})=>S)]);};return jsxs(V,{isSelected:c,isIndeterminate:f,onMouseEnter:d,onMouseLeave:m,onClick:C=>{o||x(C);},isDisabled:o,sx:{maxHeight:35,minHeight:35,...p&&{boxShadow:"0px 0px 16px 0px #00000021"}},children:[jsxs(LS,{children:[i?.(e.logo),jsx(j$1,{sx:{fontSize:"11px"},children:ac$1(e.name)})]}),e.merchants?.length>0&&jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(_s,{anchorEl:s,brand:e,merchantsIds:t,onChangeMerchant:a,atLeastOneMerchantSelected:n,showSearchInput:r})]})}var kS=_d;function zd({brands:e,isLoading:t,onFilterChange:o,merchantsIds:n=[],atLeastOneMerchantSelected:r=false,showSearchInput:i=false,hideCheckbox:a=false,renderBrandLogo:s}){let[l,p]=useState(null),[d,m]=useState(""),u=!!l,{t:c}=useTranslation(),f=E=>{p(E.currentTarget);},x=()=>{p(null);},C=useMemo(()=>e.length?e.every(E=>E.merchants?.every(({legacy_id:A})=>n.includes(A))):false,[n,e,a]),S=useMemo(()=>!C&&n.length>0,[n,C]),g=useMemo(()=>e.filter(E=>E.merchants?.some(A=>n?.includes(A.legacy_id))).length,[e,n]),h=()=>{if(C&&!r){o?.([]);return}let E=e.flatMap(A=>A.merchants?.map(({legacy_id:D})=>D));o?.(E);},w=t||!e?.length,T=E=>{m(E);},y=()=>{m("");},b=useMemo(()=>{if(!d.trim())return e;let E=d.trim().toLowerCase();return e.filter(A=>ac$1(A.name)?.toLowerCase()?.includes(E)||A.merchants?.some(D=>D.legacy_id?.toLowerCase().includes(E)))},[d,e]),v=useMemo(()=>i?b:e,[e,b,i]);return jsxs(V,{isDisabled:w,isSelected:C,startAdornment:a?null:void 0,isIndeterminate:S,sx:{maxHeight:36,minHeight:36,padding:"12px 8px 12px 16px",...u&&{boxShadow:"0px 0px 16px 0px #00000021"},...w&&{pointerEvents:"none",opacity:.5,cursor:"default"}},onMouseEnter:f,onMouseLeave:x,onClick:h,children:[jsx(j$1,{sx:{fontSize:"11px",flex:1},children:c("merchant")}),e.length>0&&jsx("img",{src:vb,alt:"arrow",style:{height:12}}),e?.length===1?jsx(_s,{anchorEl:l,brand:e[0],merchantsIds:n,onChangeMerchant:o,atLeastOneMerchantSelected:r,showSearchInput:i}):jsxs(R,{open:u,anchorEl:l,placement:"right-start",children:[i&&e.length>1&&jsx(zn,{sx:{p:"8px"},children:jsx(b$5,{id:"merchants-search-input",fullWidth:true,placeholder:"Brands",name:"brands",value:d,onChange:E=>T(E.target.value),onClear:y})}),v?.map(E=>jsx(kS,{isDisabled:g===1&&r,brand:E,merchantsIds:n,onChangeMerchant:o,atLeastOneMerchantSelected:r,showSearchInput:i,renderBrandLogo:s},E.id))]})]})}var VS=styled(zn)(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"164px"}));function nB({retailersIds:e=[],isLoading:t,retailers:o=[],onFilterChange:n,atLeastOneRetailerSelected:r=false,showSearchInput:i=false,hideCheckbox:a=false}){let[s,l]=useState(null),p=!!s,{t:d,i18n:m}=useTranslation(),[u,c]=useState(""),f=D=>{l(D.currentTarget);},x=()=>{l(null);},C=useCallback(D=>e?.includes(D),[e]),S=useMemo(()=>o.length?o.every(D=>C(D.id)):false,[o,C,a]),g=useMemo(()=>!S&&e.length>0,[e,S]),h=()=>{if(S&&!r){n?.([]);return}n?.(o.map(D=>D.id));},w=D=>e.length===1&&e[0]===D&&r,T=(D,R)=>{if(D.stopPropagation(),w(R))return;if(C(R)){n?.(e.filter(z=>z!==R));return}let W=[...new Set([...e,R])];n?.(W);},y=t||!o?.length,b=D=>{c(D);},v=()=>{c("");},E=useMemo(()=>u?.trim()?o?.filter(D=>(D?.brand?.name?.[m.language]??D?.brand?.name?.en??"").toLowerCase().includes(u.trim().toLowerCase())):o,[u,o,m.language]),A=useMemo(()=>i?E:o,[E,o,i]);return jsxs(V,{isDisabled:y,isSelected:S,startAdornment:a?null:void 0,isIndeterminate:g,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...p&&{boxShadow:"0px 0px 16px 0px #00000021"},...y&&{opacity:.5,pointerEvents:"none",cursor:"default"}},onMouseEnter:f,onMouseLeave:x,onClick:h,children:[jsx(j$1,{sx:{fontSize:"11px",flex:1},children:d("retailers")}),o?.length>0&&jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsxs(R,{open:p,anchorEl:s,placement:"right-start",sx:{height:300,width:200,overflow:"auto"},children:[i&&jsx(zn,{sx:{p:"8px"},children:jsx(b$5,{id:"retailers-search-field",fullWidth:true,placeholder:"Retailers",name:"retailers",value:u,onChange:D=>b(D.target.value),onClear:v})}),A?.map((D,R)=>jsx(V,{isSelected:C(D.id),isDisabled:t||w(D.id),onClick:W=>{T(W,D.id);},sx:{maxHeight:35,minHeight:35},children:jsx(VS,{children:D?.brand?.name?.[m.language]??D?.brand?.name?.en})},`key-${D?.id}-${R}`))]})]})}var OS=memo(nB);function lB({countriesIds:e=[],isLoading:t,countries:o=[],onFilterChange:n,atLeastOneCountrySelected:r=false,hideCheckbox:i=false}){let[a,s]=useState(null),l=!!a,{t:p}=useTranslation(),d=h=>{l||s(h.currentTarget);},m=()=>{l&&s(null);},u=useCallback(h=>e?.includes(h),[e]),c=useMemo(()=>o.length?o.every(h=>u(h)):false,[o,u]),f=useMemo(()=>!c&&e.length>0,[e,c]),x=()=>{if(!r){if(c){n?.([]);return}n?.(o);}},C=h=>e.length===1&&e[0]===h&&r,S=(h,w)=>{if(h.stopPropagation(),C(w))return;if(u(w)){n?.(e.filter(y=>y!==w));return}let T=[...new Set([...e,w])];n?.(T);},g=t||o?.length<=0||r;return jsxs(V,{isDisabled:g,isSelected:c,startAdornment:i?null:void 0,isIndeterminate:f,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...l&&{boxShadow:"0px 0px 16px 0px #00000021"},...!o?.length&&{opacity:.5,pointerEvents:"none"}},onMouseEnter:d,onMouseLeave:m,onClick:x,children:[jsx(j$1,{sx:{fontSize:"11px",flex:1},children:p("walletCountry")}),o?.length>0&&jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:l,anchorEl:a,placement:"right-start",sx:{width:200,overflow:"auto"},children:o?.map((h,w)=>jsxs(V,{isSelected:u(h),isDisabled:t||C(h),onClick:T=>{S(T,h);},sx:{maxHeight:35,minHeight:35},children:[jsx(a$4,{countryCode:h}),jsx(j$1,{sx:{fontSize:"11px !important",fontWeight:"500 !important"},children:La(h)})]},`key-${h}-${w}`))})]})}var $S=memo(lB);function uB({currenciesIds:e=[],isLoading:t,currencies:o=[],onFilterChange:n,atLeastOneCurrencySelected:r=false,hideCheckbox:i=false}){let[a,s]=useState(null),l=!!a,{t:p}=useTranslation(),d=h=>{l||s(h.currentTarget);},m=()=>{l&&s(null);},u=useCallback(h=>e?.includes(h),[e]),c=useMemo(()=>o.length?o.every(h=>u(h)):false,[o,u]),f=useMemo(()=>!c&&e.length>0,[e,c]),x=()=>{if(!r){if(c){n?.([]);return}n?.(o);}},C=h=>e.length===1&&e[0]===h&&r,S=(h,w)=>{if(h.stopPropagation(),C(w))return;if(u(w)){n?.(e.filter(y=>y!==w));return}let T=[...new Set([...e,w])];n?.(T);},g=t||o?.length<=0||r;return jsxs(V,{isDisabled:g,isSelected:c,startAdornment:i?null:void 0,isIndeterminate:f,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...l&&{boxShadow:"0px 0px 16px 0px #00000021"},...!o?.length&&{opacity:.5,pointerEvents:"none"}},onMouseEnter:d,onMouseLeave:m,onClick:x,children:[jsx(j$1,{sx:{fontSize:"11px",flex:1},children:p("currency")}),o?.length>0&&jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:l,anchorEl:a,placement:"right-start",sx:{width:200,overflow:"auto"},children:o?.map((h,w)=>oo$1[h]?.country?jsxs(V,{isSelected:u(h),isDisabled:t||C(h),onClick:y=>{S(y,h);},sx:{maxHeight:35,minHeight:35},children:[jsx(a$4,{countryCode:oo$1[h].country})," ",jsx(j$1,{sx:{fontSize:"11px !important",fontWeight:"500 !important"},children:h})]},`key-${h}-${w}`):null)})]})}var YS=memo(uB);var fB=(r=>(r.BRAND="BRAND",r.COUNTRY="COUNTRY",r.ENTITY="ENTITY",r.MERCHANT="MERCHANT",r))(fB||{});var gB="/",oi=5,ZS=(...e)=>e.join(gB),$d=e=>[e.label,e.id],jS=(e,t)=>{if(e.levelKey==="MERCHANT")return e.id.toLowerCase().includes(t)?e:null;let o=(e.children??[]).map(i=>jS(i,t)).filter(i=>i!==null);if(!o.length)return null;let{searchProps:n,...r}=e;return {...r,children:o,...o.length>=oi&&{searchProps:n}}},KS=(e,t,o)=>{let n=e.map(r=>{let i=r.entities??[],s=Array.from(new Set(i.map(l=>l.country).filter(Boolean))).map(l=>{let d=i.filter(m=>m.country===l).map(m=>{let c=(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:ZS(r.id,l,m.id),label:ac$1(m.legal_name,o)??m.id,levelKey:"ENTITY",children:c,header:"Merchants",...c.length>=oi&&{searchProps:{getValues:$d}}}});return {id:ZS(r.id,l),label:La(l)??l,levelKey:"COUNTRY",children:d,header:"Entities",iconComponent:jsx(a$4,{countryCode:l,width:14}),...d.length>=oi&&{searchProps:{getValues:$d}}}});return {id:r.id,label:ac$1(r.name,o)??r.id,levelKey:"BRAND",children:s,header:"Countries",icon:{fileId:r.logo},...s.length>=oi&&{searchProps:{getValues:$d}}}});return {levelKey:"BRAND",children:n,header:"Brands",...n.length>=oi&&{searchProps:{filterItem:(r,i)=>(typeof r.label=="string"?r.label.toLowerCase():"").includes(i)?r:jS(r,i)}}}};var bB=e=>{let{brands:t,isLoading:o,initialValue:n,onFilterChange:r,BrandLogoComponent:i,hideCheckbox:a}=e,[s,l]=useState(null),[p,d]=useState("UNCHECKED"),m=useRef(null),u=!!s,{t:c,i18n:f}=useTranslation(),x=useMemo(()=>KS(t,n,f.language),[t,n,f.language]),C=x.children??[],S=o||!C.length,g=useCallback(y=>{let b=y.filter(E=>E.status==="CHECKED"),v=y.filter(E=>E.status==="INDETERMINATE");return b.length===C.length?"CHECKED":v.length>0||b.length>0?"INDETERMINATE":"UNCHECKED"},[C]),h=useCallback(({selectedTree:y})=>{d(g(y));},[g]),w=useCallback(y=>{d(g(y));let b=b$d.filterNodesByLevelKey(y,"MERCHANT").map(({id:v})=>v);r?.(b);},[r,g]),T=useCallback(()=>{m.current?.toggleAll(p!=="CHECKED");},[p]);return jsxs(V,{startAdornment:a?null:void 0,isSelected:p==="CHECKED",isIndeterminate:p==="INDETERMINATE",isDisabled:S,onMouseEnter:y=>l(y.currentTarget),onMouseLeave:()=>l(null),onClick:T,sx:{maxHeight:36,minHeight:36,padding:"12px 8px 12px 16px",...u&&{boxShadow:"0px 0px 16px 0px #00000021"},...S&&{pointerEvents:"none",opacity:.5,cursor:"default"}},children:[jsx(j$1,{sx:{fontSize:"11px",flex:1},children:c("merchant")}),t.length>0&&jsx("img",{src:vb,alt:"arrow",style:{height:12}}),!o&&jsx(c$7,{ref:m,placement:"right-start",anchorEl:s,exposeOnlySelectedTree:true,treeDefinition:x,onChange:w,onMounted:h,IconComponent:i})]})},XS=bB;var TB=XS;function JS({onPhoneChange:e,onCountryChange:t,selectedPhone:o,selectedCountry:n,countriesOptions:r,isCountriesLoading:i}){let a=zc(useId(),"phone-filter");return jsx(b$e,{id:a,"data-testid":"ColumnFilterInputs_PhoneInput",phoneValue:o,onPhoneChange:s=>{e(s);},countryValue:n,onCountryChange:s=>{t(s?.countryId);},countries:r||[],isCountriesLoading:i||false,error:false,disabled:i,placeholder:"User Mobile",sx:{"&.MuiInputBase-root":{paddingLeft:"0px !important"}}})}var eT=styled(zn)(()=>({position:"relative",flexGrow:0})),tT=styled(zn)(({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"})),oT=styled(t)(({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 nT=styled(zn)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,display:"flex",position:"relative",paddingInline:"8px",alignItems:"center",borderRadius:"4px",height:"40px"}));styled(zn)(()=>({display:"flex",alignItems:"center"}));var oo=styled(zn)(({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]})),Wn=styled(fb)(({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}})),be=styled(L,{shouldForwardProp:e=>e!=="error"})(({error:e})=>({img:{cursor:"pointer"},...e&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"}})),rT=styled(L,{shouldForwardProp:e=>e!=="error"})(({error:e})=>({flexGrow:1,maxWidth:"100%",img:{cursor:"pointer"},...e&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"}})),pe=styled(a$1)(()=>({borderTopLeftRadius:0,borderTopRightRadius:0,height:25}));var iT=Se.object().shape({email:Se.string().matches(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,"invalidEmail").required("requiredEmail"),firstName:Se.string().required("requiredFirstName").min(3,"invalidFirstName"),lastName:Se.string().required("requiredLastName").min(3,"invalidLastName")}),Us=e=>Se.object().shape({email:Se.string().transform((t,o)=>{if(o!=="")return t}).matches(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{1,}$/i,"invalidEmail").optional(),phoneNumber:Se.string().transform((t,o)=>{if(o)return t}).length(e,"invalidMobile").optional(),firstName:Se.string().min(3,"invalidFirstName").required("requiredFirstName"),lastName:Se.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}),aT=e=>Se.object().shape({firstName:Se.string().required("requiredFirstName").min(3,"invalidFirstName"),lastName:Se.string().required("requiredLastName").min(3,"invalidLastName"),phoneNumber:Se.string().length(e,"invalidMobile").required("requiredMobile")});function BB({customer:e,country:t,defaultCountry:o,countries:n,isCountriesLoading:r,onCustomerChange:i,onCountryChange:a,isCustomerNotValid:s}){let l=zc(useId(),"customer-full-info"),p=useRef(),d=useRef(),m=useRef(),u=useRef(),{t:c}=useTranslation(),{control:f,watch:x,formState:{errors:C,isValid:S}}=useForm({mode:"onChange",resolver:yupResolver(Us(t.max_digits)),defaultValues:{firstName:e.firstName,email:e.email,lastName:e.lastName,phoneNumber:e.phoneNumber}});useEffect(()=>{x(({firstName:w="",lastName:T="",email:y="",phoneNumber:b=""})=>{i({firstName:w,lastName:T,email:y,phoneNumber:b});});},[x,C,e]);let g=useCallback(()=>C.firstName?.message??C.lastName?.message??C.email?.message??C.phoneNumber?.message,[C]);return useEffect(()=>{s?.(!S,g());},[S,g]),jsxs(oo,{id:l,"data-testid":"CustomerFullInfo",onMouseLeave:w=>{w.stopPropagation();},children:[jsx(Controller,{control:f,name:"firstName",render:({field:{ref:w,...T},fieldState:{error:y}})=>jsxs(zn,{ref:p,children:[jsx(be,{...T,placeholder:c("firstName"),inputProps:{autoComplete:"off"},error:!!y?.message}),y?.message&&jsx(pe,{error:c(y.message)})]})},"fullInfoFirstName"),jsx(Controller,{control:f,name:"lastName",render:({field:{ref:w,...T},fieldState:{error:y}})=>jsxs(zn,{ref:d,children:[jsx(be,{...T,placeholder:c("lastName"),inputProps:{autoComplete:"off"},error:!!y?.message}),y?.message&&jsx(pe,{error:c(y.message)})]})},"fullInfoLastName"),jsx(Controller,{control:f,name:"email",render:({field:{ref:w,...T},fieldState:{error:y}})=>jsxs(zn,{ref:m,children:[jsx(be,{...T,placeholder:c("email"),inputProps:{autoComplete:"off"},error:!!y?.message}),y?.message&&jsx(pe,{error:c(y.message)})]})},"fullInfoEmail"),jsx(Controller,{control:f,name:"phoneNumber",render:({field:{ref:w,...T},fieldState:{error:y}})=>jsxs(zn,{ref:u,children:[jsxs(nT,{sx:{...y?.message&&{borderBottom:"none"}},children:[jsx(c$1,{defaultCountry:t?.iso2??o?.code??"SA",value:t,onChangeCountry:a,countries:n,isLoading:r}),jsx(rT,{...T,type:"number",placeholder:c("mobile"),inputProps:{autoComplete:"off"},error:!!y?.message,sx:{border:"none",paddingInlineEnd:0},hideArrows:true,disableFocusRing:true})]}),y?.message&&jsx(pe,{error:c(y.message,{numberLen:t.max_digits})})]})},"fullInfoPhoneNumber")]})}var lT=BB;function OB({...e}){let t=zc(useId(),"customer-dropdown"),[o,n]=useState(null),{firstName:r,lastName:i}=e.customer,{t:a}=useTranslation(),s=!!o,l=m=>{s||n(m.currentTarget);},p=()=>{s&&n(null);},d=useMemo(()=>Aa$1(),[]);return jsxs(eT,{id:t,"data-testid":"CustomerDropdown",sx:{...e.isDisabled&&{pointerEvents:"none",opacity:.7}},children:[jsxs(tT,{onClick:l,children:[(!r||!i)&&jsxs(Fragment,{children:[jsx("img",{src:vj,alt:"c"}),jsx("span",{children:a("customer")})]}),r&&i&&jsxs(Fragment,{children:[jsx(oT,{src:"#",alt:"a",sx:{background:d},children:`${r[0]?.toUpperCase()}${i[0]?.toUpperCase()||""}`}),`${r} ${i}`]})]}),s&&jsx(a$5,{onClick:p}),jsx(VD,{open:s,anchorEl:o,placement:"bottom-start",children:jsx(lT,{...e})})]})}var mT=memo(OB);function YB({submitButtonText:e,onSubmit:t,customer:o,isItemsNotValid:n,items:r,onCustomerChange:i}){let a=zc(useId(),"customer-email-form"),s=useRef(),l=useRef(),p=useRef(),{t:d}=useTranslation(),{control:m,formState:{isValid:u,errors:c},watch:f,trigger:x}=useForm({mode:"onChange",resolver:yupResolver(iT),defaultValues:{firstName:o.firstName,email:o.email,lastName:o.lastName}});return useEffect(()=>{o.firstName&&o.email&&o.lastName&&x();},[]),useEffect(()=>{f(({firstName:S="",lastName:g="",email:h=""})=>{i({...o,email:h,firstName:S,lastName:g});});},[f,c,o]),jsxs(oo,{id:a,"data-testid":"CustomerEmailForm",onMouseLeave:S=>{S.stopPropagation();},children:[jsx(Controller,{control:m,name:"email",render:({field:{ref:S,...g},fieldState:{error:h}})=>jsxs(zn,{ref:p,children:[jsx(be,{...g,"data-testid":"EmailForm_email",placeholder:d("email"),inputProps:{autoComplete:"off",form:{autoComplete:"off"}},error:!!h?.message}),h?.message&&jsx(pe,{error:d(h.message)})]})}),jsx(Controller,{control:m,name:"firstName",render:({field:{ref:S,...g},fieldState:{error:h}})=>jsxs(zn,{ref:s,children:[jsx(be,{...g,"data-testid":"EmailForm_firstName",placeholder:d("firstName"),inputProps:{autoComplete:"off",form:{autoComplete:"off"}},error:!!h?.message}),h?.message&&jsx(pe,{error:d(h.message)})]})}),jsx(Controller,{control:m,name:"lastName",render:({field:{ref:S,...g},fieldState:{error:h}})=>jsxs(zn,{ref:l,children:[jsx(be,{...g,"data-testid":"EmailForm_lastName",placeholder:d("lastName"),inputProps:{autoComplete:"off",form:{autoComplete:"off"}},error:!!h?.message}),h?.message&&jsx(pe,{error:d(h.message)})]})}),jsx(Wn,{type:"button","data-testid":"EmailForm_submit",onClick:t,disabled:!u||n||!r.length,children:e})]})}var cT=memo(YB);function XB({submitButtonText:e,onSubmit:t,customer:o,country:n,items:r,isItemsNotValid:i,defaultCountry:a,countries:s,isCountriesLoading:l,onCustomerChange:p,onCountryChange:d}){let m=useRef(),u=useRef(),c=useRef(),f=useRef(),{t:x}=useTranslation(),{control:C,watch:S,trigger:g,formState:{isValid:h,errors:w}}=useForm({mode:"onChange",resolver:yupResolver(Us(n.max_digits)),defaultValues:{firstName:o.firstName,email:o.email,lastName:o.lastName,phoneNumber:o.phoneNumber}});return useEffect(()=>{S(({firstName:T="",lastName:y="",email:b="",phoneNumber:v=""})=>{p({email:b,firstName:T,lastName:y,phoneNumber:v});});},[S,w,o]),useEffect(()=>{o.firstName&&o.lastName&&(o.email||o.phoneNumber)&&g();},[]),jsxs(oo,{onMouseLeave:T=>{T.stopPropagation();},children:[jsx(Controller,{control:C,name:"firstName",render:({field:{ref:T,...y},fieldState:{error:b}})=>jsxs(zn,{ref:m,children:[jsx(be,{...y,placeholder:x("firstName"),inputProps:{autoComplete:"off"},error:!!b?.message}),b?.message&&jsx(pe,{error:x(b.message)})]})},"fullInfoFormFirstName"),jsx(Controller,{control:C,name:"lastName",render:({field:{ref:T,...y},fieldState:{error:b}})=>jsxs(zn,{ref:u,children:[jsx(be,{...y,placeholder:x("lastName"),inputProps:{autoComplete:"off"},error:!!b?.message}),b?.message&&jsx(pe,{error:x(b.message)})]})},"fullInfoFormLastName"),jsx(Controller,{control:C,name:"email",render:({field:{ref:T,...y},fieldState:{error:b}})=>jsxs(zn,{ref:c,children:[jsx(be,{...y,placeholder:x("email"),inputProps:{autoComplete:"off"},error:!!b?.message}),b?.message&&jsx(pe,{error:x(b.message)})]})},"fullInfoFormEmail"),jsx(Controller,{control:C,name:"phoneNumber",render:({field:{ref:T,...y},fieldState:{error:b}})=>jsxs(zn,{ref:f,children:[jsxs(a$8,{sx:{...b?.message&&{borderBottom:"none"}},children:[jsx(c$1,{defaultCountry:n?.iso2??a?.code??"SA",value:n,onChangeCountry:d,countries:s,isLoading:l}),jsx(b$6,{...y,type:"number",placeholder:x("mobile"),inputProps:{autoComplete:"off"},error:!!b?.message,sx:{border:"none",paddingInlineEnd:0},hideArrows:true,disableFocusRing:true})]}),b?.message&&jsx(pe,{error:x(b.message,{numberLen:n.max_digits})})]})}),jsx(Wn,{onClick:t,disabled:!h||i||!r.length,children:e})]})}var fT=memo(XB);function nk({submitButtonText:e,onSubmit:t,customer:o,country:n,isItemsNotValid:r,items:i,defaultCountry:a,countries:s,isCountriesLoading:l,onCustomerChange:p,onCountryChange:d}){let m=zc(useId(),"customer-phone-number-form"),u=useRef(),c=useRef(),f=useRef(),{t:x}=useTranslation(),{control:C,formState:{isValid:S,errors:g},watch:h,trigger:w}=useForm({mode:"onChange",resolver:yupResolver(aT(n.max_digits)),defaultValues:{firstName:o.firstName,phoneNumber:o.phoneNumber,lastName:o.lastName}});return useEffect(()=>{o.firstName&&o.phoneNumber&&o.lastName&&w();},[]),useEffect(()=>{h(({firstName:y="",lastName:b="",phoneNumber:v=""})=>{p({...o,firstName:y,lastName:b,phoneNumber:v});});},[h,g,o]),jsxs(oo,{id:m,"data-testid":"CustomerPhoneNumberForm",onMouseLeave:y=>{y.stopPropagation();},children:[jsx(Controller,{control:C,name:"phoneNumber",render:({field:{ref:y,...b},fieldState:{error:v}})=>jsxs(zn,{ref:f,children:[jsxs(a$8,{sx:{...v?.message&&{borderBottom:"none"}},children:[jsx(c$1,{defaultCountry:n?.iso2??a?.code??"SA",value:n,onChangeCountry:d,countries:s,isLoading:l}),jsx(b$6,{...b,type:"number",placeholder:x("mobile"),error:!!v?.message,sx:{border:"none",paddingInlineEnd:0},inputProps:{autoComplete:"off",form:{autoComplete:"off"}},hideArrows:true,disableFocusRing:true})]}),v?.message&&jsx(pe,{error:x(v.message,{numberLen:n.max_digits})})]})},"phoneNumberFormPhone"),jsx(Controller,{control:C,name:"firstName",render:({field:{ref:y,...b},fieldState:{error:v}})=>jsxs(zn,{ref:u,children:[jsx(be,{...b,placeholder:x("firstName"),inputProps:{autoComplete:"off"},error:!!v?.message}),v?.message&&jsx(pe,{error:x(v.message)})]})},"phoneNumberFormFirstName"),jsx(Controller,{control:C,name:"lastName",render:({field:{ref:y,...b},fieldState:{error:v}})=>jsxs(zn,{ref:c,children:[jsx(be,{...b,placeholder:x("lastName"),inputProps:{autoComplete:"off"},error:!!v?.message}),v?.message&&jsx(pe,{error:x(v.message)})]})},"phoneNumberFormLastName"),jsx(Wn,{onClick:t,disabled:!S||r||!i.length,children:e})]})}var xT=memo(nk);var ri=styled(zn)(({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})),CT=styled(zn)(({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"}})),hT=styled(zn)(({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]}})),yT=styled(zn)(({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 ii({selectedCurrencyCode:e}){let t=zc(useId(),"selected-currency");return jsxs(yT,{id:t,"data-testid":"SelectedCurrency",sx:{padding:0},children:[jsx(a$4,{currencyCode:e}),jsxs("span",{children:[" ",e]})]})}function mk({merchantCurrencies:e,isLoading:t,onChangeCurrency:o,isDisabled:n,selectedCurrency:r}){let i=zc(useId(),"merchant-currency-dropdown"),[a,s]=useState(null),l=!!a,p=u=>{l||s(u.currentTarget);},d=()=>{l&&s(null);},m=u=>{o?.(u),d();};return t||!e?jsxs(ri,{sx:{pointerEvents:"none"},children:[jsx(j$1,{sx:{fontSize:"11px"},children:"Select"}),t?jsx(a$9,{}):jsx(zn,{component:"img",src:uj,alt:"c",sx:{marginTop:"2px"}})]}):e.length===0?jsxs(ri,{sx:{pointerEvents:"none",opacity:.5},children:[jsx(j$1,{sx:{fontSize:"11px"},children:"Select"}),jsx(zn,{sx:{width:25,textAlign:"center"},children:jsx(zn,{component:"img",src:uj,alt:"c",sx:{marginTop:"2px"}})})]}):e.length===1?jsx(ri,{sx:{border:"none",pointerEvents:"none"},children:jsx(ii,{selectedCurrencyCode:e?.[0]?.code?.english??""})}):jsxs(ri,{id:i,"data-testid":"MerchantCurrencyDropdown",onClick:p,sx:{...n&&{pointerEvents:"none",opacity:.7}},children:[jsx(ii,{selectedCurrencyCode:r?.code?.english??""}),jsx(zn,{component:"img",src:uj,alt:"c",sx:{marginTop:"2px",...l&&{transform:"rotate(180deg)"}}}),l&&jsx(a$5,{onClick:d}),jsx(VD,{open:l,anchorEl:a,placement:"bottom-start",children:jsx(CT,{children:e.map((u,c)=>jsx(hT,{className:"currency",onClick:()=>{m(u);},children:jsx(ii,{selectedCurrencyCode:u.code.english})},`${u.symbol}-${c}`))})})]})}var dk=memo(mk);var ST=styled(zn,{shouldForwardProp:e=>e!=="disabled"})(({theme:e,disabled:t})=>({display:"flex",flexDirection:"column",justifyContent:"center",gap:"8px",padding:"8px",borderRadius:"4px",border:`1px solid ${e.palette.divider}`,background:t?e.palette.grey[400]:e.palette.common.white,...t&&{cursor:"default",pointerEvents:"none"}})),TT=styled(j$1)(({theme:e})=>({color:e.v2.palette.grey[500],fontSize:"10px",fontWeight:500,marginBottom:"8px",margin:0}));var uk=(e,t)=>e.name===t.name&&e.size===t.size,wT=(e,t)=>t?.length?t.some(o=>Xb(o)?uk(o.file,e):o.name===e.name):false;function Ik({options:e,error:t,files:o,label:n,disabled:r,hideUpload:i=false,preventDuplicates:a,onChangeFiles:s,onRemoveFile:l,renderBrandLogo:p,renderOpenFileInNewTab:d}){let m=zc(useId(),"file-input-preview"),{t:u}=useTranslation(),[c,f]=useState(null),{getRootProps:x,getInputProps:C,open:S,isDragReject:g,fileRejections:h}=useDropzone({...e,disabled:r||e?.disabled}),w=Wb(e?.maxSize||0,0).toUpperCase(),T=useMemo(()=>{let v=h.length&&h[0].errors.some(A=>A.code==="file-invalid-type"),E=h.length&&h[0].errors.some(A=>A.code==="file-too-large");return g||v?u("invalidFileType"):E?`File is larger than ${w}`:c||t},[g,t,h,c,u,w]);return jsxs(ST,{id:m,"data-testid":"FileInputPreview",disabled:r,children:[jsx(TT,{children:n}),jsx(h$1,{files:o,onRemoveFile:l,disabled:r,getFilePreview:v=>v.type.includes("image")?URL.createObjectURL(v):v.name.includes(".pdf")?We:v.name,renderBrandLogo:p,renderOpenFileInNewTab:d}),!i&&jsx(a$a,{getRootProps:x,getInputProps:C,open:S,onChangeFiles:s,processFiles:v=>{if(f(null),!a)return v.map(D=>({file:D,id:D.name}));let{duplicates:E,uniqueFiles:A}=v.reduce((D,R)=>(wT(R,o)?D.duplicates.push(R.name):D.uniqueFiles.push({file:R,id:R.name}),D),{duplicates:[],uniqueFiles:[]});if(E.length>0){let D=E.length===1?"file":"files";f(`Duplicate ${D} detected: ${E.join(", ")}`);}return A},disabled:r,errorMessage:T,maxFileSize:w,preventDuplicates:a})]})}var bk=memo(Ik);var ol=styled(zn)(({theme:e})=>({borderRadius:"50%",background:e.palette.divider,width:13,height:14,fontSize:"8px",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"10px"})),ai=styled(zn)(()=>({display:"flex",alignItems:"center",gap:"4px",".arrow-icon":{height:12}})),nl=styled(zn)(()=>({display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,width:"100%",alignItems:"center"})),vT=styled(zn)(()=>({display:"flex",flexDirection:"column"})),PT=styled(zn,{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}})),ET=styled(DT)(({theme:e})=>({fontSize:"11px",fontWeight:500,color:e.palette.text.primary})),MT=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})})),AT=styled(zn)(()=>({display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"4px",borderTop:"1px solid #F2F2F2"})),$n=styled(R)({"& .MuiPopper-dropdown":{maxHeight:700,overflow:"visible"}});var tc=styled(V)({"--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}}),si=styled(tc)({"&: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(si)({backgroundColor:"#FAFAFA",color:"#8D8D94",padding:"10px 16px",borderBottom:"1px solid #F2F2F2"});var Ek=e=>{let{merchant:t,selectedValue:o,onClick:n,onlyOne:r,menuFlipped:i}=e,a=t.id===o?.merchantId,s=useMemo(()=>{let l=[];return a&&l.push("Mui-selected"),r&&l.push("Mui-only-one"),i&&l.push("Mui-flipped"),l.join(" ")},[a,r,i]);return jsxs(si,{"data-testid":"MerchantItem",className:s,sx:{py:"4.5px",pl:1,pr:2},onClick:n,startAdornment:null,children:[a?jsx("img",{src:Pc$1,alt:"Selected"}):jsx(zn,{width:15}),jsxs(vT,{children:[jsx(DT,{component:"span",fontSize:11,children:t.display_name}),jsx(DT,{color:l=>alpha(l.palette.text.primary,.5),fontSize:8,children:t.legacy_id})]})]},t.id)},BT=Ek;var Ak=e=>{let{items:t,value:o,onItemClick:n,menuFlipped:r}=e,i=t.length===1,a=useMemo(()=>{let s=[];return i&&s.push("Mui-only-one"),r&&s.push("Mui-flipped"),s.join(" ")},[i,r]);return jsx(Fragment,{children:t.map(s=>jsx(BT,{className:a,onlyOne:t.length===1,selectedValue:o,merchant:s,onClick:l=>n?.(l,s),menuFlipped:r},s.id))})},il=Ak;var NT=e=>e?.length===1?e[0]:void 0,FT=e=>{let t=(e.entities??[]).flatMap(o=>(o.merchants??[]).map(n=>({entityId:o.id,merchant:n})));return t.length===1?t[0]:void 0},VT=e=>e.reduce((o,n)=>o+(n.entities??[]).reduce((r,i)=>r+(i.merchants?.length??0),0),0)===1;function kk(e){let{entity:t,brandId:o,selectedValue:n,onValueChange:r,onlyOne:i,menuFlipped:a}=e,[s,l]=useState(null),{i18n:p}=useTranslation(),[d,m]=useState(false),u=!!s,c=(t.merchants?.length??0)>0,f=useMemo(()=>NT(t.merchants),[t.merchants]),x=!!f,C=o===n?.brandId&&t.id===n?.entityId,S=useCallback(y=>{c&&!x&&l(y.currentTarget);},[c,x]),g=useCallback(()=>{s&&l(null);},[s]),h=useCallback((y,b)=>{r({merchantId:b.id,brandId:o,entityId:y,legacyId:b.legacy_id});},[o,r]),w=useCallback(y=>{f&&(y.stopPropagation(),h(t.id,f));},[t.id,h,f]),T=useMemo(()=>{let y=[];return C&&y.push("Mui-selected"),i&&y.push("Mui-only-one"),a&&y.push("Mui-flipped"),u&&y.push("Mui-Submenu-open"),d&&y.push("Mui-Submenu-flipped"),y.join(" ")},[C,u,d,i,a]);return jsxs(si,{"data-testid":"EntityItem",className:T,onClick:w,onMouseEnter:S,onMouseLeave:g,startAdornment:null,children:[jsxs(nl,{children:[jsxs(ai,{children:[C?jsx("img",{src:Pc$1,alt:"Selected"}):jsx(zn,{width:15}),jsx(a$4,{countryCode:t.country}),jsx("span",{children:ac$1(t.legal_name,p.language)})]}),c&&!x&&jsxs(ai,{children:[jsx(ol,{children:t.merchants?.length}),jsx("img",{src:vb,className:"arrow-icon",alt:"Expand"})]})]}),jsx($n,{open:u&&!x,anchorEl:s,placement:"right-start",modifiers:[{name:"placementTracker",enabled:true,phase:"write",fn({state:y}){m(y.placement==="left-start");}}],sx:{"& .MuiPopper-dropdown":{minWidth:"141px"}},children:jsx(il,{items:t.merchants||[],onItemClick:(y,b)=>{y.stopPropagation(),h(t.id,b);},menuFlipped:d,value:n})})]})}var OT=memo(kk);var Nk=e=>{let{items:t,brand:o,value:n,onChange:r,menuFlipped:i}=e;return jsx(Fragment,{children:t.map(a=>jsx(OT,{entity:a,brandId:o.id,selectedValue:n,onValueChange:r,onlyOne:t.length===1,menuFlipped:i},a.id))})},zT=Nk;function _k({brand:e,onClose:t,selectedValue:o,onValueChange:n,renderBrandLogo:r}){let[i,a]=useState(null),{i18n:s}=useTranslation(),[l,p]=useState(false),d=!!i,m=(e.entities?.length??0)>0,u=e.id===o?.brandId,c=useMemo(()=>FT(e),[e]),f=!!c,x=useCallback(y=>{m&&!f&&a(y.currentTarget);},[m,f]),C=useCallback(()=>{i&&a(null);},[i]),S=useMemo(()=>{let y=[];return u&&y.push("Mui-selected"),d&&y.push("Mui-Submenu-open"),l&&y.push("Mui-Submenu-flipped"),y.join(" ")},[u,d,l]),g=e.entities?.length===1,h=e.entities?.[0],w=useCallback((y,b)=>{n({merchantId:b.id,brandId:e.id,entityId:y,legacyId:b.legacy_id}),t();},[e.id,n,t]),T=useCallback(y=>{!f||!c||(y.stopPropagation(),w(c.entityId,c.merchant));},[w,f,c]);return jsxs(tc,{"data-testid":"BrandItem",className:S,onClick:T,onMouseEnter:x,onMouseLeave:C,startAdornment:null,children:[jsxs(nl,{sx:{gap:"2.5px"},"data-testid":"Content",children:[u?jsx("img",{src:Pc$1,alt:"Selected"}):jsx(zn,{width:15}),r?.(e.logo),jsx(DT,{flex:1,noWrap:true,fontSize:"inherit",component:"span",children:ac$1(e.name,s.language)}),m&&!f&&jsxs(ai,{children:[jsx(ol,{children:g?h?.merchants?.length:e.entities.length}),jsx("img",{src:wb$1,height:10,className:"arrow-icon",alt:"Expand"})]})]}),jsx($n,{open:d&&!f,anchorEl:i,placement:"right-start",modifiers:[{name:"placementTracker",enabled:true,phase:"write",fn({state:y}){p(y.placement==="left-start");}}],sx:{"& .MuiPopper-dropdown":{minWidth:"157px"}},children:g?jsx(il,{items:h?.merchants||[],onItemClick:(y,b)=>{y.stopPropagation(),w(h?.id,b);},menuFlipped:l,value:o}):jsx(zT,{items:e.entities,value:o,onChange:y=>{t(),n(y);},brand:e,menuFlipped:l})})]})}var GT=memo(_k);var ZT=()=>{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}},jT=(e,t,o)=>{useEffect(()=>{if(t?.merchantId)return;let n=e.find(a=>a.entities?.length>0&&a.entities.some(s=>(s.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]);};var qk=({isLoading:e,isSingleMerchant:t,isOpen:o})=>e?jsx(a$9,{}):t?null:jsx(MT,{src:Cb$1,alt:"Toggle dropdown",expanded:o});function Xk({brands:e,isLoading:t=true,label:o,sx:n,selectedValue:r,isDisabled:i,isFetchingNextPage:a,renderBrandLogo:s,onValueChange:l,showSearchInput:p}){let{anchorElement:d,isOpen:m,openMenu:u,closeMenu:c}=ZT(),f=zc(useId(),"merchants-dropdown"),x=useRef(null),[C,S]=useState("");jT(e,r,l);let g=useMemo(()=>VT(e),[e]),h=g||i||t,w=useCallback(A=>{h||u(A);},[h,u]),T=useCallback(()=>{m&&c();},[m,c]),y=A=>{S(A);},b=()=>{S("");},v=useMemo(()=>C.trim()?e.filter(A=>ac$1(A.name)?.trim().toLowerCase()?.includes(C.trim().toLowerCase())||A?.id?.toLowerCase().includes(C.trim().toLowerCase())):e,[C,e]),E=useMemo(()=>p?v:e,[e,v,p]);return jsx(zD,{onClickAway:T,children:jsxs(PT,{id:f,"data-testid":"MerchantsDropdown",isOpen:m,onClick:w,sx:{...h&&{pointerEvents:"none",opacity:.7},...n},ref:x,children:[typeof o=="string"?jsx(ET,{noWrap:true,sx:{...o.length>16&&{width:100}},children:o}):o,jsx(qk,{isLoading:t,isSingleMerchant:g,isOpen:m}),jsxs($n,{open:m,anchorEl:d,sx:{"& .MuiPopper-dropdown":{mt:"5px",overflowY:"auto",maxHeight:432,...x.current&&{width:x.current.offsetWidth??"auto"},minWidth:180}},children:[p&&e.length>1&&jsx(zn,{sx:{p:"8px"},children:jsx(b$5,{id:"merchants-dropdown-search-field",fullWidth:true,placeholder:"Brands",name:"brands",value:C,onChange:A=>y(A.target.value),onClear:b})}),E?.map(A=>jsx(GT,{brand:A,selectedValue:r,onClose:c,onValueChange:l,renderBrandLogo:s},A.id)),a&&jsx(AT,{children:jsx(t$1,{isLoadingRow:true})})]})]})})}var Jk=memo(Xk);var JT=styled(R)(()=>({marginTop:"-1px","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"}})),QT=styled(V)(({theme:e})=>({height:40,flex:"unset",paddingTop:0,paddingBottom:0,borderBottom:`1px solid ${e.palette.divider}`,paddingLeft:"16px",maxHeight:"35px",".label":{flexGrow:1}}));function ml({menuLabel:e,options:t,selectedValue:o,onValueChange:n}){let r=zc(useId(),"view-column-radio-filter"),[i,a]=useState(null),[s,l]=useState(o),p=useRef(null);return useEffect(()=>{l(o);},[o]),jsxs(QT,{id:r,ref:p,onMouseEnter:f=>{a(f.currentTarget);},onMouseLeave:()=>{a(null);},onClick:f=>{f.stopPropagation(),a(f.currentTarget);},startAdornment:null,children:[jsx("span",{className:"label",children:e}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(JT,{open:!!i,anchorEl:i,placement:"right-start",children:jsx(a$k,{options:t,value:s||"",onOptionChange:f=>{l(f),n(f);},defaultValue:t[0].value})})]})}var tw=(e,t)=>{let o=e||{},n={};return t?.forEach(({value:r})=>{let i=o?.[r];n[r]=i===void 0?"all":i;}),n};function nw({anchorEl:e,options:t,apiKey:o="statuses",initialStatuses:n,onCloseDropdown:r,onClear:i,onConfirm:a}){let s=!!e,l=zc(useId(),"status-filter"),{t:p}=useTranslation(),[d,m]=useState(()=>tw(n,t)),u=useRef(null),[c,f]=useState(null),[x,C]=useState(null),S=(v,E)=>{f(v.currentTarget),C(E);},g=useCallback(()=>{f(null),C(null);},[]),h=useCallback(v=>{r(v),g();},[g,r]),w=()=>{let v=Object.keys(d).reduce((A,D)=>{let R=d[D];return R!=="all"&&(A[D]=R),A},{});Object.values(d).every(A=>A==="all")?i([o]):a({[o]:v});},T=r$1(w,r),y=v=>{w(),r(v);},b=v=>{x&&m(E=>({...E,[x]:v}));};return jsx(ClickAwayListener,{onClickAway:v=>{v.stopPropagation(),r(v);},children:jsxs(zn,{id:l,"data-testid":"StatusFilter",ref:u,tabIndex:-1,onKeyDown:T,children:[jsxs(R,{open:s,anchorEl:e,children:[jsx(a$l,{component:"span",children:p("filterBy")}),t.map(({value:v,label:E})=>jsxs(V,{onClick:A=>{f(A.currentTarget);},onMouseOver:A=>{S(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"}},startAdornment:null,children:[jsx(zn,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:E}),jsx(zn,{component:"img",src:vb,width:16,height:12,sx:{marginLeft:"auto"}})]},v)),jsxs(b$f,{children:[jsx(d$5,{onClick:h,children:p("cancel")}),jsx(c$8,{onClick:y,children:p("okay")})]})]}),jsx(Popper,{open:!!c,anchorEl:c,placement:"right-start",onMouseLeave:g,children:jsx(zn,{sx:{backgroundColor:"#fff",borderEndEndRadius:"8px",border:"1px solid #F2F2F2"},children:jsx(a$k,{options:[{value:"all",label:"All"},{value:"enabled",label:"Enabled"},{value:"disabled",label:"Disabled"}],value:d[x||""],onOptionChange:b})})})]})})}var rw=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]}})),iw=styled$1(Box)(()=>({position:"relative"})),aw=styled$1(Box)(({theme:e})=>({background:e.palette.common.white,boxShadow:e.shadows[9],borderRadius:"4px",marginTop:"8px"})),sw=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"})),lw=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]}})),pw=styled$1("img")(()=>({width:16,height:16,objectFit:"contain",flexShrink:0,display:"block"})),mw=styled$1(Box)(()=>({display:"flex",flexDirection:"column",gap:"2px"})),dw=styled$1(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"space-between",flex:1})),cw=styled$1(Box)(({theme:e})=>({fontSize:"11px",color:e.palette.text.primary,fontWeight:500,wordBreak:"break-all",paddingInlineEnd:"8px"})),uw=styled$1(Box)(({theme:e})=>({fontSize:"9px",color:e.palette.text.textSecondary,fontWeight:600})),fw=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]}})),gw=styled$1(Box)(({theme:e})=>({fontSize:"11px",color:e.palette.text.primary,fontWeight:400,textTransform:"uppercase"})),ic=styled$1(Box)(({theme:e})=>({borderTop:`2px solid ${e.palette.divider}`})),ul=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}})),io=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"})),gl=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"})),xl=styled$1("img")(()=>({width:14,height:14})),xw=styled$1(Box)(()=>({display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",padding:"8px"}));var hw=e=>{let t=new Date,o=dc(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"}),dc(e).calendar(null,n)},yw=(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 ac={loading:false,success:false,error:null},cN=(e=ac,t)=>{switch(t.type){case "RESET":return ac;case "LOADING":return {...e,loading:true};case "SUCCESS":return {...e,success:true};case "ERROR":return {...e,error:t.error};default:return e}},Cl=({onDownload:e})=>{let t=n(),[{loading:o,error:n$1,success:r},i]=useReducer(cN,ac),a=useCallback(()=>i({type:"LOADING"}),[]),s=useCallback(()=>i({type:"SUCCESS"}),[]),l=useCallback(m=>i({type:"ERROR",error:m}),[]),p=useCallback(()=>i({type:"RESET"}),[]);useEffect(()=>{(r||n$1)&&setTimeout(()=>{p();},3e3);},[r,n$1,p]);let d=useCallback(()=>{e&&(a(),e().then(m=>{s(),Mb(m.url,yw(m.result_file,m.id));}).catch(m=>{l(m),t.error(m?.response?.data?.error?.message||m?.message||"Failed to download report");}));},[e,a,s,l]);return {loading:o,error:n$1,success:r,handleDownloadReport:d}};function fN({onDownload:e}){let{loading:t,error:o,success:n,handleDownloadReport:r}=Cl({onDownload:e});return t?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(io,{children:jsxs(fl,{children:[jsx(gl,{children:"1"}),jsx(CircularProgress,{})]})})}):n?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(io,{children:jsx(xl,{src:Ze,alt:"done"})})}):o?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(io,{children:jsx(xl,{src:Ij,alt:"failed"})})}):jsx(xl,{onClick:r,src:Xe$1,alt:"reports"})}var lc=fN;function mc(){return jsxs(xw,{children:[jsx(r,{width:"16px",height:"16px",variant:"rectangular"}),jsx(r,{width:"100%",variant:"text"}),jsx(r,{width:"12px",height:"12px",variant:"circular"})]})}function yN({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=dc(i.created_at).isBefore(dc().subtract(1,"day")),s=Yb(i.result_file);return jsxs(lw,{children:[jsx(pw,{src:s,alt:"download"}),jsxs(dw,{children:[jsxs(mw,{children:[jsx(cw,{children:i.result_file}),jsx(uw,{children:a?hw(new Date(i.created_at)):dc(new Date(i.created_at)).fromNow()})]}),jsx(lc,{onDownload:()=>n(i.id)})]})]},i.id)});return t?jsxs(ic,{children:[jsx(mc,{}),jsx(mc,{})]}):jsx(ic,{children:r})}var Iw=memo(yN);function PN(e){let{progress:t,reportsQueryResult:o,isStatusReady:n,isStatusFailed:r,isLoading:i,notificationState:a,onOpenDropdown:s,onRequestReportFile:l,onOpenReportsApp:p$1,hideOpenReportsApp:d=false,onDownloadReport:m,customContent:u}=e,[c,f]=useState(null),{t:x}=useTranslation(),C=!!c,{data:S,isLoading:g}=o,h=useCallback(v=>{i||n||(s?.(),f(v.currentTarget));},[i,n,s]),w=useCallback(()=>{f(null);},[]),T=useCallback(()=>{i||(w(),l?.());},[i,w,l]),y=v=>{v.stopPropagation(),p$1?.(),w();},b=()=>i?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxs(io,{children:[jsxs(fl,{children:[jsx(gl,{children:"1"}),jsx(wN,{})]}),jsx("span",{children:x("preparing")}),jsx(ul,{children:jsx(fc$1,{variant:"determinate",value:t})})]})}):n?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxs(io,{children:[jsx("img",{src:Ze,alt:"done"}),jsx("span",{children:x("ready")}),jsx(ul,{className:"done",children:jsx(fc$1,{variant:"determinate",value:100})})]})}):r?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxs(io,{children:[jsx("img",{src:Ij,alt:"failed"}),jsx("span",{children:x("failed")}),jsx(ul,{className:"failed",children:jsx(fc$1,{variant:"determinate",value:100})})]})}):jsx("img",{src:Ye,alt:"reports"});return jsxs(iw,{"data-testid":"TableReports_ReportsWrapper",children:[jsx(AnimatePresence,{children:jsx(p,{title:x("reports"),children:jsx(rw,{"data-testid":"TableReports_ExportButton",onClick:h,notificationState:a,open:C,loading:i,ready:n,failed:r,sx:{...(i||n||r)&&{borderBottom:"none"}},initial:{width:"auto"},transition:{duration:.25},children:b()})})}),C&&jsx(a$5,{onClick:w}),jsx(VD,{open:C,anchorEl:c,placement:"bottom-end",children:jsxs(aw,{sx:{width:208},children:[u?.({closeDropdown:w})??jsxs(fw,{onClick:T,children:[jsx("img",{src:Ve,alt:"download"}),jsx(gw,{children:"csv"})]}),jsx(Iw,{reports:S?.reports??[],isLoading:g,onDownloadReport:m}),!d&&jsx(sw,{onClick:y,children:x("openReportsApp")})]})})]})}var bw=memo(PN);var Sw=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 kN({onDownload:e}){let t=zc(useId(),"download-button"),{loading:o,error:n,success:r,handleDownloadReport:i}=Cl({onDownload:e}),{t:a}=useTranslation(),s=!o&&!n&&!r;return jsx(Sw,{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(wN,{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(d$1,{src:hm,sx:{width:"auto",height:"auto"},alt:"error"})},"error"),s&&jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:a("download")},"text")]})})}var Tw=memo(kN);var FN=Tw;var VN=bw;var ge=styled(V)(({theme:e})=>({height:40,flex:"unset",paddingTop:0,paddingBottom:0,borderBottom:`1px solid ${e.palette.divider}`,".label":{flexGrow:1}})),vw=styled(zn)(({theme:e})=>({width:36,height:24,border:`1px solid ${e.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"12px"}));function yl({type:e}){return jsx(vw,{children:jsx(zn,{component:"img",src:h$2(e),sx:{width:18,height:12,objectFit:"contain"},onError:t=>{t.currentTarget.src=h$2("card");}})})}function xc({icon:e,name:t,options:o=[],filters:n,setFilters:r}){let[i,a]=useState(null),s=n?.payment_methods??[],l=x=>{a(x.currentTarget);},p=()=>{a(null);},d=useCallback(x=>s.includes(x)??false,[s.length]),m=useMemo(()=>o?.every(x=>d(x.type)),[s.length]),u=useMemo(()=>!m&&o?.some(x=>d(x.type)),[s.length]),c=x=>{if(x.stopPropagation(),m){let C=o?.reduce((h,w)=>h.filter(T=>T!==w.type),s)??[],{payment_methods:S,...g}=n;r(C?.length>0?{...n,payment_methods:C}:g);}else r({...n,payment_methods:[...s,...o?.map(C=>C.type)??[]]});},f=(x,C)=>{x.stopPropagation(),d(C)?r({...n,payment_methods:s?.filter(S=>S!==C)??[]}):r({...n,payment_methods:[...s??[],C]});};return jsxs(ge,{isSelected:m,isIndeterminate:u,onMouseEnter:l,onMouseLeave:p,onClick:c,children:[jsx("img",{src:e,alt:t}),jsx("span",{className:"label",children:t}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:!!i,anchorEl:i,placement:"right-end",children:o?.map(x=>jsx(ge,{isSelected:d(x.type),onClick:C=>f(C,x.type),children:jsx(yl,{type:x.type})},x.type))})]})}function bl({paymentMethodsSource:e,filters:t,setFilters:o}){let[n,r]=useState(null),i=t?.payment_methods??[],a=!e?.options?.length,s=c=>{r(c.currentTarget);},l=()=>{r(null);},p=useMemo(()=>(e?.options??[])?.reduce((c,f)=>(c.push(...(f.options??[])?.map(x=>x.type)??[]),c),[])??[],[]),d=useMemo(()=>p?.length===i.length&&i.length>0,[i.length,p?.length]),m=useMemo(()=>!d&&i.length>0,[i.length,d]);return jsxs(ge,{isSelected:d,isIndeterminate:m,onMouseEnter:s,onMouseLeave:l,onClick:()=>{if(!a){if(d){let{payment_methods:c,...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:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:!!n,anchorEl:n,placement:"right-start",children:e?.options?.map(c=>jsx(xc,{...c,filters:t,setFilters:o},c.type))})]})}function Sl({paymentSchemesSource:e,filters:t,setFilters:o}){let[n,r]=useState(null),i=t?.payment_scheme??[],a=!e?.options?.length,s=f=>{r(f.currentTarget);},l=()=>{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]),u=()=>{if(!a){if(p){let{payment_scheme:f,...x}=t;o(x);return}o({...t,payment_scheme:e?.options?.map(f=>f.type)??[]});}},c=(f,x)=>{f.stopPropagation(),m(x)?o({...t,payment_scheme:i.filter(C=>C!==x)??[]}):o({...t,payment_scheme:[...t?.payment_scheme??[],x]});};return jsxs(ge,{isSelected:p,isIndeterminate:d,onMouseEnter:s,onMouseLeave:l,onClick:u,sx:{...a&&{opacity:.5,pointerEvents:"none"}},children:[jsx("span",{className:"label",children:e?.name}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:!!n,anchorEl:n,placement:"right-start",children:e?.options?.map(f=>jsx(ge,{isSelected:m(f.type),onClick:x=>c(x,f.type),children:jsx(yl,{type:f.type})},f.type))})]})}function wl({filters:e,setFilters:t}){let[o,n]=useState(null),{t:r}=useTranslation(),i=useMemo(()=>e?.payment_initiated??[],[e?.payment_initiated]),a=u=>{n(u.currentTarget);},s=()=>{n(null);},l=useCallback(u=>i.includes(u),[i]),p=i?.length===Fo.length,d=()=>{t?.({...e,payment_initiated:p?[]:Fo.map(({key:u})=>u)});},m=u=>{t?.({...e,payment_initiated:l(u)?i?.filter(c=>c!==u):[...i,u]});};return jsxs(ge,{onMouseEnter:a,onMouseLeave:s,isSelected:p,isIndeterminate:i.length===1,onClick:d,children:[jsx("span",{className:"label",children:r("paymentInitiated")}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:!!o,anchorEl:o,placement:"right-start",children:Fo.map(({label:u,key:c})=>jsx(V,{isSelected:l(c),onClick:f=>{f.stopPropagation(),m(c);},children:u},c))})]})}function hc({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);},s=useCallback(m=>r.includes(m),[r]),l=r?.length===Go.length,p=()=>{t?.({...e,payment_locations:l?[]:Go.map(({key:m})=>m)});},d=m=>{t?.({...e,payment_locations:s(m)?r?.filter(u=>u!==m):[...r,m]});};return jsxs(ge,{onMouseEnter:i,onMouseLeave:a,isSelected:l,isIndeterminate:r.length>0&&r.length<Go.length,onClick:p,children:[jsx("span",{className:"label",children:"Payment Locations"}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:!!o,anchorEl:o,placement:"right-start",children:Go.map(({label:m,key:u})=>jsxs(V,{isSelected:s(u),onClick:c=>{c.stopPropagation(),d(u);},children:[jsx(zn,{sx:c=>({border:`1px solid ${c.palette.divider}`,borderRadius:"20px",width:36,height:24,display:"flex",alignItems:"center",justifyContent:"center"}),children:jsx(b$2,{sx:{visibility:"visible",width:15,height:9.176},variant:m})}),m]},u))})]})}function Pl({filters:e,setFilters:t}){let[o,n]=useState(null),{t:r}=useTranslation(),i=useMemo(()=>e?.authentication_type??[],[e?.authentication_type]),a=u=>{n(u.currentTarget);},s=()=>{n(null);},l=useCallback(u=>i.includes(u),[i]),p=i?.length===Ho.length,d=()=>{t?.({...e,authentication_type:p?[]:Ho.map(({key:u})=>u)});},m=u=>{t?.({...e,authentication_type:l(u)?i?.filter(c=>c!==u):[...i,u]});};return jsxs(ge,{onMouseEnter:a,onMouseLeave:s,isSelected:p,isIndeterminate:i.length>0&&i.length<Ho.length,onClick:d,children:[jsx("span",{className:"label",children:r("authenticationType")}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:!!o,anchorEl:o,placement:"right-start",children:Ho.map(({label:u,key:c})=>jsx(V,{isSelected:l(c),onClick:f=>{f.stopPropagation(),m(c);},children:u},c))})]})}function Rw({filters:e,setFilters:t,anchorEl:o,showPaymentSchemes:n=true,showPaymentMethods:r=true,showPaymentInitiated:i=true,showPaymentLocations:a=false,showAuthenticationType:s=false,paymentMethodsSource:l,paymentSchemesSource:p,onCloseDropdown:d,onConfirm:m}){let{t:u}=useTranslation(),c=zc(useId(),"payment-source-filter"),f=!!o,x=()=>m?.(),C=r$1(x,d),S=g=>{x(),d(g);};return jsxs(R,{id:c,"data-testid":"PaymentSourceFilter",open:f,anchorEl:o,sx:{marginTop:"8px",marginBottom:"8px"},onKeyDown:C,panelProps:{tabIndex:-1,autoFocus:true},children:[jsx(a$l,{component:"span",children:u("filterBy")}),r&&jsx(bl,{filters:e,setFilters:t,paymentMethodsSource:l}),n&&jsx(Sl,{filters:e,setFilters:t,paymentSchemesSource:p}),i&&jsx(wl,{filters:e,setFilters:t}),s&&jsx(Pl,{filters:e,setFilters:t}),a&&jsx(hc,{filters:e,setFilters:t}),jsxs(b$f,{children:[jsx(d$5,{onClick:d,children:u("cancel")}),jsx(c$8,{onClick:S,children:u("okay")})]})]})}var Ic=[{label:_o.C,value:"C"},{label:_o.F,value:"F"}],cF=({filters:e,setFilters:t})=>{let[o,n]=useState(null),r=!!o,i=e?.auth_mode??[],a=f=>{r||n(f.currentTarget);},s=()=>{r&&n(null);},l=useMemo(()=>Ic.map(f=>f.value),[]),p=useMemo(()=>Ic.length===i.length&&i.length>0,[i.length,l?.length]),d=useMemo(()=>!p&&i.length>0,[i.length,p]),m=()=>{if(p){let{auth_mode:f,...x}=e;t(x);return}t({...e,auth_mode:l});},u=useCallback(f=>i.includes(f)??false,[i.length]),c=(f,x)=>{f.stopPropagation(),u(x)?t({...e,auth_mode:i?.filter(C=>C!==x)??[]}):t({...e,auth_mode:[...i??[],x]});};return jsxs(ge,{isSelected:p,isIndeterminate:d,onMouseEnter:a,onMouseLeave:s,onClick:m,children:[jsx("span",{className:"label",children:"Authentication Mode"}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:r,anchorEl:o,placement:"right-start",children:Ic.map(f=>jsxs(V,{isSelected:u(f.value),onClick:x=>c(x,f.value),children:[jsx(FC,{mode:f.value}),f.label]},f.value))})]})};var uF=styled(j$1)(()=>({fontSize:"11px"})),Bw=styled(zn)(()=>({display:"flex",alignItems:"center",gap:"4px",width:"100%",paddingInline:"16px"})),kw=styled(zn)(({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}`})),Nw=styled(b)(()=>({minWidth:"auto",width:70})),Fw=styled(b)(()=>({minWidth:"auto",width:70})),Vw=styled(zn)(()=>({display:"flex",flexDirection:"column",gap:"8px",marginBottom:"8px"})),bc=styled(uF)(()=>({fontSize:"11px",fontWeight:500,color:"#8D8D94",padding:"8px 16px"})),Ww=styled(zn)(({theme:e})=>({borderBlock:`1px solid ${e.palette.divider}`,display:"flex",justifyContent:"space-between",alignItems:"center",gap:"2px",width:"100%"})),Hw=styled(zn)(({theme:e})=>({...a$2(e),width:"auto",marginTop:"8px","&:focus":{outline:"none"}})),Ow=styled(bc)(()=>({color:"#1F88D0",padding:"4px 24px",cursor:"pointer"})),_w=styled(b,{shouldForwardProp:e=>e!=="open"})(({open:e,theme:t})=>{let{brand:o}=t.v2.palette;return {fontSize:"11px",fontWeight:t.v2.typography.fontWeightMedium,padding:t.v2.spacing(8),width:"100%",height:32,justifyContent:"space-between",gap:t.v2.spacing(4),...e&&{borderColor:o[500],boxShadow:"0px 0px 4px 0px rgba(31, 136, 208, 0.50)"}}});function $w({dateRange:e,onDateRangeChange:t,calendarMode:o,onCalendarModeChange:n,zone:r,onZoneChange:i,countryZone:a,browserTimezone:s,timezoneCountriesCodes:l=[],timezone:p,onTimezoneChange:d,defaultCountryTimezone:m,onConfirm:u,onCloseDropdown:c}){let f=zc(useId(),"date-filter"),{t:x}=useTranslation(),C=useRef(null),S=a$m(r??p?.timezone,a??m.timezone),g=p$2(1,S)??[new Date,new Date],h=()=>u(e),w=r$1(h,c),T=(E,A)=>{t(E,A),requestAnimationFrame(()=>C.current?.focus());},y=E=>{h(),c(E);},b=useCallback(E=>n(E),[n]),v=E=>{if(!E)return "";let[A,D]=E,R=dc(A).format("MMM D"),W=dc(D).format("MMM D");return R===W?R:`${R} - ${W}`};return jsxs(Hw,{ref:C,tabIndex:-1,onKeyDown:w,id:f,"data-testid":"DateFilter",children:[jsxs(Vw,{children:[jsx(Ww,{children:jsx(bc,{component:"span",children:x("filterBy")})}),jsx(Bw,{children:jsx(b$9,{defaultDate:e??g,onDateChange:T,maxDateRange:365,mode:o,onCalendarModeSwitch:b,zone:S,onChangeZone:i,countryZone:a??m.timezone,browserTimezone:s,timezoneCountriesCodes:l,onChangeTimezone:d,mainSx:{width:"100%"},popperProps:{placement:"right-start"},renderCalendarButton:(E,A)=>jsxs(_w,{variant:"secondary",size:"md",fullWidth:true,open:E,onClick:A,children:[jsx("span",{children:v(e)||"Date"}),jsx(d$1,{src:dk$1,alt:"selected",sx:{width:16,height:16}})]})},v(e))}),e&&jsx(Ow,{component:"span",onClick:()=>t(void 0),children:"Clear"})]}),jsxs(kw,{children:[jsx(Fw,{variant:"secondary",size:"md",onClick:c,children:x("cancel")}),jsx(Nw,{variant:"primary",size:"md",onClick:y,children:x("okay")})]})]})}var Gw=styled(R)(()=>({marginBottom:"8px"})),Yw=styled(L)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,".icon":{width:14}})),Zw=styled(zn)(()=>({padding:"8px 16px","> div + div":{marginTop:"8px"}})),jw=styled(fb)(({theme:e})=>({color:e.palette.info.dark,fontSize:"11px",textTransform:"capitalize",padding:"4px 9px",minWidth:"auto","&:hover":{background:"transparent"}})),Kw=styled(zn)(({theme:e})=>({padding:"0 16px 8px",textAlign:"left",borderBottom:`1px solid ${e.palette.divider}`}));function Xw({selectedRadioValue:e,onRadioButtonChange:t,radioOptions:o,label:n,onConfirm:r,onClear:i,inputValues:a,onInputValuesChange:s,anchorEl:l,onCloseDropdown:p,inputFilters:d=[]}){let m=zc(useId(),"reference-type-filter"),{t:u}=useTranslation(),c=()=>r(),f=r$1(c,p),x=T=>{c(),p(T);},C=T=>{i(),p(T);},S=T=>a?.[T]!==void 0&&a?.[T].length>0,g=T=>{S(T)&&s({...a,[T]:""});},h=useMemo(()=>SF(a).some(T=>!!T),[a]),w=()=>{s(d.reduce((T,{apiKey:y})=>({...T,[y]:""}),{}));};return jsxs(Gw,{id:m,"data-testid":"ReferenceTypeFilter",open:!!l,anchorEl:l,onKeyDown:f,children:[jsx(a$l,{component:"span",children:u("filterBy")}),jsx(ml,{menuLabel:n,options:o,selectedValue:e,onValueChange:t}),d.length>0&&jsx(Zw,{"data-testid":"ColumnFilterInputs_inputs",component:"main",children:d.map(({apiKey:T,placeholder:y})=>jsx(Yw,{className:"input","data-testid":"ColumnFilterInputs_InputStyled",name:T,placeholder:y,onChange:b=>{s({...a,[T]:b.target.value});},defaultValue:a?.[T]??"",value:a?.[T],inputProps:{autoComplete:"off","data-testid":"ColumnFilterInputs_input"},endAdornment:jsx(wF,{position:"end",children:jsx(Box,{component:"img","data-testid":"ColumnFilterInputs_icon","data-icon":S(T)?"close":"search",src:S(T)?ui:A,alt:"search",className:"icon",sx:{cursor:S(T)?"pointer":"default"},onClick:()=>{g(T);}})})},T))}),jsx(x$1,{in:h,component:"section","data-testid":"ColumnFilterInputs_Collapse",children:jsx(Kw,{"data-testid":"ColumnFilterInputs_ClearWrapper",children:jsx(jw,{type:"button",onClick:w,"data-testid":"ColumnFilterInputs_ClearButton",children:u("clear")})})}),jsxs(b$f,{children:[jsx(d$5,{onClick:C,children:u("cancel")}),jsx(c$8,{onClick:x,children:u("okay")})]})]})}var Jw=styled(zn)(()=>({maxHeight:"210px",maxWidth:"177px",overflowY:"auto",padding:0})),Qw=styled(V)(()=>({padding:"12px 16px",border:"none !important","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"},maxHeight:35,minHeight:35})),e0=styled(zn)(()=>({display:"flex",flexDirection:"column",gap:"2px"})),t0=styled(zn)(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:"9px"})),o0=styled(zn)(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"120px"})),n0=styled(R)(()=>({marginBottom:"8px"}));function a0({anchorEl:e,onCloseDropdown:t,list:o,apiKey:n,placeholder:r,onConfirm:i,onClear:a,onClickItem:s,inputValue:l,onInputValueChange:p,selectedListItems:d}){let m=zc(useId(),"list-column-filter"),{t:u}=useTranslation(),c=()=>i(),f=r$1(c,t),x=b=>{c(),t(b);},C=b=>{a?.(),t(b);},S=!!l.trim().length,g=()=>{S&&p("");},h=b=>{p(b);},w=useMemo(()=>S?o?.filter(b=>b.name.toLowerCase().includes(l.trim().toLowerCase())):o,[l,S,o]),T=S&&!w.length||!o.length,y=useMemo(()=>new Set(d),[d]);return jsxs(n0,{id:m,"data-testid":"ListColumnFilter",open:!!e,anchorEl:e,onKeyDown:f,children:[jsx(a$l,{component:"span",children:u("filterBy")}),!!o?.length&&jsx(Box,{sx:{padding:"8px 16px"},children:jsx(b$5,{fullWidth:true,value:l,name:n,placeholder:r,onChange:b=>h(b.target.value),onClear:g})}),jsx(Jw,{children:T?jsx(Box,{sx:{p:1,textAlign:"center",fontSize:"11px"},children:"No data available"}):w?.map((b,v)=>jsx(Qw,{isSelected:y.has(b?.id),onClick:()=>{s(b?.id);},children:jsxs(e0,{children:[jsx(o0,{children:b.name}),jsx(t0,{component:"span",children:b.id})]})},`${b.id}-${v}`))}),jsxs(b$f,{children:[jsx(d$5,{onClick:C,children:u("cancel")}),jsx(c$8,{onClick:x,children:u("okay")})]})]})}var s0="os-shared-VerificationIcon",Dl={root:`${s0}-root`,img:`${s0}-img`},l0=(s=>(s.Verified="verified",s.Reviewed="reviewed",s.Completed="completed",s.Incomplete="incomplete",s.Rejected="rejected",s.Closed="closed",s.Archived="archived",s))(l0||{});var Rl={verified:Hj,reviewed:Fj,completed:Ej,incomplete:Gj,rejected:Ij,closed:Jj,archived:Kj},Ll={verified:"#2ACE0029",reviewed:"#11D0FA29",completed:"#11D0FA29",incomplete:"#D9D9D929",rejected:"#FF3D0029",closed:"#D9D9D929",archived:"#D9D9D929"};var AF=2.3,p0=styled("span",{shouldForwardProp:e=>!["$variant","$bgColor","$size"].includes(e)})(({$variant:e="default",$bgColor:t,$size:o=10.5})=>{let n=Math.round(o*AF);return {display:"inline-flex",alignItems:"center",justifyContent:"center",...e==="circle"&&{width:`${n}px`,height:`${n}px`,borderRadius:"50%",backgroundColor:t||"#D9D9D929"}}});var m0=forwardRef(({className:e,sx:t,icon:o,label:n,variant:r="default",size:i=10.5,width:a,height:s,...l},p$1)=>{let d=Rl[o]||Rl.incomplete,m=Ll[o]||Ll.incomplete,u=n===null?"":n||Bh$1(o),c=a??i,f=s??i,x=jsx(p0,{ref:p$1,className:lc$1(Dl.root,e),sx:t,"data-testid":"VerificationIcon",$variant:r,$bgColor:m,$size:i,...l,children:jsx("img",{className:Dl.img,loading:"lazy",src:d,alt:u||o,width:c,height:f})});return n===null?x:jsx(p,{title:u,wrapperProps:{display:"inline-flex"},children:x})});m0.displayName="VerificationIcon";var BF=memo(m0);var Bl="32px";var Pc=styled(zn,{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?Bl:"16px",height:"100%",overflow:"auto"})),Ec=styled(zn)(()=>({display:"flex",flexDirection:"column",gap:"8px"})),d0=styled(zn,{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 WF({sections:e,isMaximized:t,onClick:o,activeSection:n}){let r=zc(useId(),"window-side-bar"),i=n||e?.[0]?.id;return jsx(Pc,{id:r,"data-testid":"WindowSideBar",isMaximized:t,children:jsx(Ec,{children:e?.map(a=>jsx(d0,{onClick:()=>{o?.(a);},isActive:i===a.id,children:a.title},a.id))})})}var c0=memo(WF);var kF=c0;
|
|
2
|
+
export{y1 as $,xI as $a,ws as $b,FN as $c,vp as A,h7 as Aa,Vm as Ab,Rd as Ac,fH as B,fM as Ba,Wm as Bb,Ld as Bc,Pv as C,CM as Ca,de as Cb,Bd as Cc,Rv as D,bM as Da,Hm as Db,VL as Dc,Ov as E,zh as Ea,Om as Eb,PS as Ec,$v as F,EM as Fa,_m as Fb,zd as Fc,Uv as G,Jh as Ga,zm as Gb,OS as Gc,$x as H,OM as Ha,Bm as Hb,$S as Hc,iP as I,_M as Ia,$r as Ib,YS as Ic,pP as J,UM as Ja,CD as Jb,fB as Jc,It as K,ZM as Ka,$m as Kb,gB as Kc,xP as L,ny as La,Um as Lb,oi as Lc,xo as M,JM as Ma,Gm as Mb,ZS as Mc,IP as N,eA as Na,nb as Nb,KS as Nc,TP as O,tA as Oa,bs as Ob,TB as Oc,MP as P,oA as Pa,Ss as Pb,JS as Pc,BP as Q,xy as Qa,hD as Qb,mT as Qc,HP as R,by as Ra,Ts as Rb,cT as Rc,Ie as S,fA as Sa,yD as Sb,fT as Sc,mt as T,Ay as Ta,Ym as Tb,xT as Tc,jP as U,Wy as Ua,Zm as Ub,dk as Uc,Wa as V,Gy as Va,jm as Vb,bk as Vc,e1 as W,PA as Wa,rb as Wb,Jk as Wc,i1 as X,LA as Xa,ID as Xb,ml as Xc,p1 as Y,tI as Ya,bD as Yb,nw as Yc,u1 as Z,OA as Za,SD as Zb,Cl as Zc,U_ as _,lI as _a,Km as _b,lc as _c,Bl as a,S1 as aa,KA as ab,vs as ac,VN as ad,Pc as b,M1 as ba,PX as bb,Dn as bc,bl as bd,Ec as c,O3 as ca,_ as cb,od as cc,Sl as cd,kF as d,Y3 as da,qe as db,rd as dc,wl as dd,po as e,J3 as ea,Cs as eb,id as ec,Pl as ed,ax as f,r8 as fa,cD as fb,ad as fc,Rw as fd,sx as g,FC as ga,Am as gb,pd as gc,cF as gd,M0 as h,X1 as ha,uD as hb,md as hc,$w as hd,R0 as i,eE as ia,fD as ib,dd as ic,Xw as id,N0 as j,$C as ja,gD as jb,Zr as jc,a0 as jd,W0 as k,GC as ka,hs as kb,Eb as kc,Dl as kd,ca as l,xE as la,vo as lb,Cd as lc,l0 as ld,dx as m,hE as ma,Xe as mb,yd as mc,Rl as md,cx as n,IE as na,eb as nb,JR as nc,Ll as nd,bp as o,vE as oa,Or as ob,bd as oc,BF as od,ua as p,PE as pa,Dm as pb,Sd as pc,lW as q,DE as qa,ys as qb,pne as qc,jo as r,LE as ra,Rm as rb,Bs as rc,Ko as s,FE as sa,Is as sb,ks as sc,G0 as t,OE as ta,xD as tb,eS as tc,j0 as u,GE as ua,An as ub,Pd as uc,X0 as v,jE as va,_r as vb,rre as vc,tv as w,JE as wa,km as wb,Vs as wc,rv as x,Ja as xa,zr as xb,Ws as xc,sv as y,e7 as ya,Nm as yb,uS as yc,dr as z,wh as za,Fm as zb,hS as zc};
|