@tap-payments/os-micro-frontend-shared 0.3.151 → 0.3.152
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-BNWEQO2B.js → chunk-2HOISDAH.js} +1 -1
- package/build/_chunks/{chunk-JVVVLEUF.js → chunk-2NZGAW6S.js} +1 -1
- package/build/_chunks/{chunk-X2IIYK74.js → chunk-2VUZLBHU.js} +1 -1
- package/build/_chunks/{chunk-KW2A7ATU.js → chunk-6PJ62FDJ.js} +1 -1
- package/build/_chunks/{chunk-4IRFUOW5.js → chunk-7CK3VXHJ.js} +1 -1
- package/build/_chunks/{chunk-VB7FCFAH.js → chunk-7MI55RIT.js} +1 -1
- package/build/_chunks/{chunk-ABYPGA6A.js → chunk-AMSY5XTV.js} +1 -1
- package/build/_chunks/{chunk-CAV4XNQI.js → chunk-BDSQ6RE4.js} +1 -1
- package/build/_chunks/{chunk-77BF7TSG.js → chunk-BM6KX6IL.js} +1 -1
- package/build/_chunks/{chunk-KKIVDOOU.js → chunk-BWTZKVL5.js} +1 -1
- package/build/_chunks/{chunk-S2VISI6Z.js → chunk-BXKWTLZF.js} +1 -1
- package/build/_chunks/{chunk-ULE5G4WB.js → chunk-G3EN2K4T.js} +1 -1
- package/build/_chunks/{chunk-TNV4RSI6.js → chunk-H37QSJDD.js} +1 -1
- package/build/_chunks/{chunk-CO3EEXJQ.js → chunk-IJAAE7RQ.js} +1 -1
- package/build/_chunks/{chunk-MDJ47T6T.js → chunk-QZR2EPAG.js} +1 -1
- package/build/_chunks/chunk-RBF2Y4OM.js +1 -0
- package/build/_chunks/{chunk-NY3LCGE5.js → chunk-RBUKY72C.js} +1 -1
- package/build/_chunks/{chunk-OVUUOEZN.js → chunk-SBWGLI2Z.js} +1 -1
- package/build/_chunks/{chunk-OK6HCBL2.js → chunk-SE2Y4QWD.js} +1 -1
- package/build/_chunks/{chunk-6NNBWGIW.js → chunk-T4QOBOJ6.js} +1 -1
- package/build/_chunks/{chunk-KCXHCJAA.js → chunk-UJJZLXUT.js} +1 -1
- package/build/_chunks/{chunk-6OIXV5L2.js → chunk-UXZDRDII.js} +1 -1
- package/build/_chunks/{chunk-DBKRFR7R.js → chunk-WFIDLFYJ.js} +1 -1
- package/build/_chunks/{chunk-7OEJSZPG.js → chunk-WPZRME3K.js} +1 -1
- package/build/_chunks/{chunk-2WHC5EPT.js → chunk-XNKXDDNN.js} +1 -1
- package/build/_chunks/{chunk-5ALWC7FS.js → chunk-ZMUDRI5J.js} +1 -1
- package/build/_chunks/chunk-ZPGWJ5RD.js +2 -0
- package/build/components/ActiveFilterChip/index.js +1 -1
- package/build/components/Amount/index.js +1 -1
- package/build/components/AmountConversionFilter/index.js +1 -1
- package/build/components/AmountInput/index.js +1 -1
- package/build/components/AmountSlider/index.js +1 -1
- package/build/components/AppServices/index.js +1 -1
- package/build/components/AppServicesBar/index.js +1 -1
- package/build/components/AppWindowWrapper/index.js +1 -1
- package/build/components/BrandLogo/index.js +1 -1
- package/build/components/Calender/index.js +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/CopyImage/index.js +1 -1
- package/build/components/CountryFilter/index.js +1 -1
- package/build/components/CurrencyFilter/index.js +1 -1
- package/build/components/Customer/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/Dialog/index.js +1 -1
- package/build/components/Discount/index.js +1 -1
- package/build/components/Dropdown2/index.js +1 -1
- package/build/components/DropdownButton/index.js +1 -1
- package/build/components/DropdownMenu/index.js +1 -1
- package/build/components/ExpandableSideBar/index.js +1 -1
- package/build/components/FileInputPreview/index.js +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/Filters/index.js +1 -1
- package/build/components/JSONViewer/index.js +1 -1
- package/build/components/LanguageDropdown/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/MenuItem/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/MultiSelectDropdownButton/index.js +1 -1
- package/build/components/MultiSelectWithSearch/index.js +1 -1
- package/build/components/NestedDropdown/index.js +1 -1
- package/build/components/PartnersFilter/index.js +1 -1
- package/build/components/PaymentSourceFilter/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/RFH/index.js +1 -1
- package/build/components/RadioGroup/index.js +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/ReceiptsViewer/index.js +1 -1
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/SalesChannelFilter/index.js +1 -1
- package/build/components/SearchButton/index.js +1 -1
- package/build/components/SelectWithSearch/index.js +1 -1
- package/build/components/StatusBar/index.js +1 -1
- package/build/components/StatusButton/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableReports/index.js +1 -1
- package/build/components/Timepicker/index.js +1 -1
- package/build/components/TreeDropdown/index.js +1 -1
- package/build/components/VAT/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/ViewColumnRadioFilter/index.js +1 -1
- package/build/components/VirtualTables/index.js +1 -1
- package/build/components/Widget/index.js +1 -1
- package/build/components/WindowSideBar/index.js +1 -1
- package/build/components/index.d.ts +1 -1
- package/build/components/index.js +1 -1
- package/build/components/primitives/Backdrop/style.d.ts +2 -2
- package/build/components/primitives/Backdrop/type.d.ts +2 -4
- package/build/components/primitives/index.js +1 -1
- package/build/index.js +1 -1
- package/package.json +1 -1
- package/build/_chunks/chunk-C6FBKUMX.js +0 -1
- package/build/_chunks/chunk-DV5XS66I.js +0 -2
- package/build/_chunks/chunk-L2RZBHC7.js +0 -1
- package/build/components/WindowBackdrop/WindowBackdrop.d.ts +0 -6
- package/build/components/WindowBackdrop/index.d.ts +0 -1
- package/build/components/WindowBackdrop/index.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$3}from'./chunk-H6HHXYRL.js';import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$3}from'./chunk-H6HHXYRL.js';import {a as a$1}from'./chunk-RBF2Y4OM.js';import {a as a$2}from'./chunk-O2SPQA5J.js';import {a}from'./chunk-GNY2VGGW.js';import {f}from'./chunk-ZPGWJ5RD.js';import {wb,Fb,B,Db,Qc}from'./chunk-KCEYICHJ.js';import me,{useState,useRef,useMemo}from'react';import {Box,CircularProgress,Typography}from'@mui/material';import xe from'@mui/material/ClickAwayListener';import h from'@mui/material/Box';import le from'@mui/material/Input';import {styled}from'@mui/material/styles';import {jsxs,jsx}from'react/jsx-runtime';styled(a)(({theme:e})=>({fontSize:"10px",color:e.palette.grey[700],fontWeight:600,lineHeight:"10px"}));styled(a)(({theme:e})=>({fontSize:"11px",color:e.palette.text.primary,fontWeight:600,lineHeight:"14.3px",width:200}));styled(h)(()=>({display:"flex",flexDirection:"column",maxHeight:400,overflow:"auto",gap:"8px"}));var H=styled(le)(({theme:e})=>({width:"inherit",height:32,padding:"11px 12px",fontSize:"10px",borderRadius:"5px",backgroundColor:"#F9F9F9",border:"1px solid transparent","&.Mui-focused":{borderColor:e.palette.info.dark}}));styled(f)({padding:0,width:12,height:12,".MuiSvgIcon-root, img":{width:12,height:12}});var D=styled(h)(()=>({display:"flex",flexDirection:"column",gap:"8px",padding:"4px"})),I=styled(h)(()=>({display:"flex",gap:"8px",padding:"4px",flexWrap:"wrap",paddingInlineEnd:"20px"})),M=styled(h)(({theme:e,maxWidth:o})=>({display:"flex",padding:"4px 8px 4px 6px",alignItems:"center",gap:"4px",borderRadius:"13px",backgroundColor:`${e.palette.info.dark}1a`,fontSize:"10px",fontWeight:500,cursor:"pointer",...o&&{maxWidth:`${o}%`}}));styled(a)(({theme:e})=>({display:"flex",gap:"8px",alignItems:"center",fontSize:"10px",fontWeight:500,color:e.palette.common.black,cursor:"pointer",padding:8}));var N=styled(h)(({theme:e})=>({width:"100%",flexDirection:"column",border:`1px solid ${e.palette.grey[100]}`,borderRadius:"4px",backgroundColor:e.palette.grey[400],minWidth:"89px",position:"relative"})),z=styled(h)(()=>({position:"absolute",right:8,bottom:13.5,width:15,height:15}));var R=e=>e.length===0?true:"value"in e[0],$=(e,o,p)=>o?e.filter(r=>p.some(a=>r?.[a]?.toLowerCase().includes(o.toLowerCase()))):e,G=(e,o,p)=>e.map(r=>{let a=r?.options.map(l=>{let S=l?.options?.filter(n=>p.some(d=>n?.[d]?.toLowerCase().includes(o.toLowerCase())));return {...l,options:S}}).filter(l=>l?.options?.length>0);return {...r,options:a}}).filter(r=>r?.options?.length>0);function X({childOption:e,selectedOptions:o,onChangeOptions:p}){let[r,a]=useState(null),l=n=>{p([...o||[],n]);},S=n=>{p(o?.filter(d=>d.value!==n.value)||[]);};return jsxs(a$1,{onMouseEnter:n=>{e.options?.length>0&&a(n.currentTarget);},onMouseLeave:()=>{r&&a(null);},children:[jsxs(Box,{sx:{display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,alignItems:"center",maxWidth:"220px",minWidth:"89px"},children:[e.label,jsx("img",{src:wb,className:"arrow-icon",alt:"arrow"})]}),jsx(a$2,{sx:{maxHeight:"450px",overflow:"auto"},open:!!r,anchorEl:r,placement:"right-start",children:e.options?.map(n=>{let w=!!o?.find(s=>s.value===n.value);return jsx(a$1,{isSelected:w,onClick:s=>{s.stopPropagation(),s.preventDefault(),w?S(n):l(n);},children:jsx(Box,{sx:{flex:1,maxWidth:"220px",minWidth:"89px"},children:n.label})},n.value)})})]})}function J({parentOption:e,selectedOptions:o,onChangeOptions:p}){let[r,a]=useState(null);return jsxs(a$1,{onMouseEnter:l=>{e.options?.length>0&&a(l.currentTarget);},onMouseLeave:()=>{r&&a(null);},children:[jsxs(Box,{sx:{display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,alignItems:"center",maxWidth:"340px",minWidth:"89px"},children:[e.label,jsx("img",{src:wb,className:"arrow-icon",alt:"arrow"})]}),jsx(a$2,{sx:{maxHeight:"450px",overflow:"auto"},open:!!r,anchorEl:r,placement:"right-start",children:e.options?.map(l=>jsx(X,{childOption:l,selectedOptions:o,onChangeOptions:p},l.label))})]})}function Q({option:e,selectedOptions:o,onChangeOptions:p}){let r=o?.some(a=>a.value===e.value)??false;return jsx(a$1,{isSelected:r,onClick:a=>{if(a.stopPropagation(),a.preventDefault(),r){p(o?.filter(l=>l.value!==e.value)||[]);return}p([...o||[],e]);},children:jsx(Box,{sx:{flex:1,maxWidth:"220px",minWidth:"89px"},children:e.label})})}function ge({options:e,onChangeOptions:o,selectedOptions:p,placeholder:r,isLoading:a,searchBy:l=["label"],disabled:S}){let n=R(e),[d,w]=useState(null),[s,E]=useState(""),ee=useRef(null),b=!!d,te=t=>{w(b?null:t.currentTarget);},oe=()=>{w(null);},re=()=>{s&&E("");},T=useMemo(()=>{if(n)return $(e,s,l)},[n,e,s,l]),F=useMemo(()=>{if(!n)return s?G(e,s,l):e},[n,e,s,l]),ne=!!(n?T:F)?.length,ie=a?jsx(CircularProgress,{size:16}):jsx(a$3,{src:s?Fb:B,alt:s?"close":"search",onClick:re,sx:{width:12,height:12}}),f=Number(p?.length??0);return jsx(xe,{onClickAway:()=>{b&&oe();},children:jsxs(N,{id:"TriggerWrapper","data-testid":"MultiSelectWithSearch",onClick:t=>!S&&te(t),ref:ee,children:[jsx(Typography,{color:"grey",sx:{cursor:"pointer",fontSize:"10px",padding:"4px"},component:"label",children:r}),f===0&&jsx(Typography,{sx:{fontWeight:500,fontSize:"11px",padding:"0px 4px 4px"},component:"p",children:"Please Select"}),jsx(z,{component:"img",src:Db,alt:"down arrow",sx:{...b&&{transform:"rotate(180deg)"}}}),!!f&&jsx(I,{id:"SelectedBadgesWrapper",children:f>0&&f<=2?p?.map(t=>jsxs(M,{maxWidth:90,children:[jsx(a$3,{src:Qc,alt:"blue-check",sx:{width:10,height:7.5}}),jsx("span",{children:t.label})]},t.value)):f>2&&p?.slice(0,2)?.map((t,y)=>jsxs(me.Fragment,{children:[jsxs(M,{maxWidth:90,children:[jsx(a$3,{src:Qc,alt:"blue-check",sx:{width:10,height:7.5}}),jsx("span",{children:t.label})]}),y===1&&jsx(M,{maxWidth:90,children:jsxs("span",{children:["+",f-2]})})]},t.value))}),jsx(a$2,{open:b,anchorEl:d,sx:{margin:"8px 0",maxHeight:330,overflow:"auto",maxWidth:"340px"},children:jsxs(D,{children:[jsx(H,{placeholder:r||"Select",endAdornment:ie,onClick:t=>{t.stopPropagation();},value:s,onChange:t=>{E(t.target.value);},disableUnderline:true,sx:{cursor:"default",width:"100%",backgroundColor:"white",border:"1px solid #F2F2F2",...ne&&{marginBottom:"4px"},...s&&{cursor:"pointer"}}}),jsx(I,{children:p?.map(t=>jsxs(M,{sx:{maxWidth:"150px"},onClick:y=>{y.stopPropagation(),y.preventDefault(),o(p?.filter(pe=>pe.value!==t.value)||[]);},children:[jsx(a$3,{src:Qc,alt:"blue-check",sx:{width:10,height:7.5}}),jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.label}),jsx(a$3,{src:Fb,alt:"close",sx:{width:9,height:9}})]},t.value))}),n?T?.map(t=>jsx(Q,{option:t,selectedOptions:p,onChangeOptions:o},t.value)):F?.map(t=>jsx(J,{parentOption:t,selectedOptions:p,onChangeOptions:o},t.label))]})})]})})}var j=ge;var st=j;export{X as a,J as b,Q as c,st as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-AMSY5XTV.js';var m=a;export{m as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-RBF2Y4OM.js';import {a}from'./chunk-O2SPQA5J.js';import {a as a$2}from'./chunk-NJFK5TAC.js';import {yc}from'./chunk-2CIV4TII.js';import {Db}from'./chunk-KCEYICHJ.js';import {Box}from'@mui/material';import r from'@mui/material/Box';import {styled}from'@mui/material/styles';import {useId,useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';var h=styled(r,{shouldForwardProp:o=>o!=="open"})(({theme:o,open:a})=>({minWidth:105,height:32,cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"1px",border:`1px solid ${o.palette.divider}`,borderRadius:"4px",padding:"7px 8px",paddingRight:"4px",...a&&{boxShadow:o.shadows[7],borderColor:o.palette.info.dark}})),w=styled(r)(()=>({display:"flex",flexDirection:"column",gap:"1px"})),b=styled(r)(()=>({fontWeight:600,fontSize:"8px",color:"#8D8D94"})),v=styled(r)(({theme:o})=>({fontWeight:500,fontSize:"11px",lineHeight:1.1,color:o.palette.text.primary}));function i({defaultValue:o,label:a$3,onChange:D,options:l}){let M=yc(useId(),"dropdown2"),[d,s]=useState(null),[y,E]=useState(o),t=!!d,W=e=>{t||s(e.currentTarget);},m=()=>{t&&s(null);},k=e=>{E(e),D?.(e),m();};return jsxs(h,{onClick:W,open:t,id:M,"data-testid":"Dropdown2",children:[jsxs(w,{children:[jsx(b,{children:a$3}),jsx(v,{children:y})]}),jsx(Box,{component:"img",src:Db,alt:"down arrow",sx:{width:15,...t&&{transform:"rotate(180deg)"}}}),jsx(a,{open:t,anchorEl:d,sx:{minWidth:105,marginTop:"8px",marginBottom:"8px"},placement:"top",children:l.map((e,B)=>jsx(a$1,{onClick:()=>{k(e.value);},sx:T=>({...B!==l.length-1&&{borderBottom:`1px solid ${T.palette.divider}`}}),children:e.label},e.value))}),t&&jsx(a$2,{onClick:m})]})}var Q=i;export{Q as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f,b as b$1,g,a as a$3,e,d,c as c$1}from'./chunk-LDLGBNMM.js';import {a as a$5}from'./chunk-UJ4IYIJH.js';import {a as a$2}from'./chunk-H6HHXYRL.js';import {c}from'./chunk-4XDOS6NM.js';import {a as a$1}from'./chunk-ZONDSLTR.js';import {o,j as j$1,k,l,p}from'./chunk-RHUTFOWS.js';import {a}from'./chunk-KHM5KW53.js';import {b}from'./chunk-2U6YCW6N.js';import {z}from'./chunk-DV5XS66I.js';import {a as a$4}from'./chunk-4DSO4G5S.js';import {Va,yc,Ha,Ia,bc,f as f$1}from'./chunk-2CIV4TII.js';import {s}from'./chunk-BXMBE224.js';import {U,ui,wi,vi,ti,Ai,_g,Rg,Zg,Nj,Oj,ub,ck,fk,wk,dk,vb,wa,va,ok,h,Qg}from'./chunk-KCEYICHJ.js';import {useId,useMemo,useCallback}from'react';import {useTranslation}from'react-i18next';import {styled,Box,useTheme}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {motion}from'framer-motion';import {styled as styled$1,useTheme as useTheme$1}from'@mui/material/styles';import _ from'lodash/camelCase';import Qe from'@mui/material/Box';var lt={ORDER:{label:"order",icon:ti,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:vi,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:wi,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:ui,color:"#32ADE6"}},dt={SAVED_TOKEN:{label:"savedToken",icon:U,color:"#76BB40"},COUNT:{label:"countBadge",icon:"countBadge",color:"#76BB40"}};styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5)}));styled("img")(()=>({width:"35px",height:"16px",display:"block"}));styled("span")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"14.67px",height:"10px"}));styled("img")(()=>({maxWidth:"100%",width:"100%"}));var ct=styled("span")(({theme:t})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:t.palette.text.primary})),mt=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"}));function Ie({type:t,hasSavedCard:o,totalPaymentsCount:e,isTextShown:r}){let l=yc(useId(),"agreement-icon"),p=useTheme(),{t:a$3}=useTranslation(),n=useMemo(()=>[...o?[dt.SAVED_TOKEN]:[],...(e||0)>0?[dt.COUNT]:[],...t&<[t]?[lt[t]]:[]],[o,e,t]),d=c=>r?jsx(a$1,{"data-testid":"AgreementCell_countBadge",children:jsx(a,{title:a$3("totalPaymentCount",{amount:f$1(e)}),children:jsx(mt,{children:jsxs(ct,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:dt.COUNT.color},children:["x",e]})})})},c):jsx(a$5,{value:e,index:c},c),s=n.map((c,g)=>c.label==="countBadge"?d(g):jsx(a,{title:a$3(c.label),children:jsx(a$1,{children:r?jsx(mt,{children:jsx(ct,{"data-testid":"AgreementCell_agreementType",sx:{color:c.color},children:a$3(c.label)})}):jsx(a$2,{sx:{maxWidth:"16px",maxHeight:"16px",height:"auto",width:"auto"},src:c.icon,alt:"agreement"})},c.color)},c.color)),f=jsx(a,{title:"No agreement",children:jsx(a$1,{children:r?jsx(mt,{children:jsx(ct,{"data-testid":"AgreementCell_agreementType",sx:{color:p.palette.text.secondary},children:"No agreement"})}):jsx(a$2,{sx:{maxWidth:"24px",maxHeight:"24px",height:"auto",width:"auto"},src:Ai,alt:"agreement"})},"no-agreement")},"no-agreement");return jsx(Box,{id:l,"data-testid":"AgreementIcon",sx:{display:"flex",alignItems:"center",gap:"4px"},children:s?.length>0?s:f})}var To=Ie;var Ce=To;styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"}));styled(motion.span,{shouldForwardProp:t=>t!=="sourcesCount"})(({theme:t,sourcesCount:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${o*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:t.palette.background.paper,borderRadius:"16px"}));var Ao=styled("span")(({theme:t})=>({fontSize:"11px",padding:"2px 0",color:t.palette.text.primary})),Po=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px",textAlign:"center",width:"100%"}));styled("span")(({theme:t})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));styled(motion.div)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));var Wo=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px"}));var kt={"3DS":{tooltip:"3DS",icon:Oj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Nj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:Zg,borderColor:"rgba(31, 136, 208, 0.10)"}},vo={FAILED:{tooltip:"Failed",icon:Rg,borderColor:"rgba(255, 61, 0, 0.10)"},REJECTED:{tooltip:"Rejected",icon:_g,borderColor:"rgba(255, 61, 0, 0.10)"}};function be({transactionStatus:t,eci:o,authType:e,isTextShown:r}){let l=yc(useId(),"auth-icons"),p=useMemo(()=>{let n=t?vo[t]:null,d=n?.tooltip,s=t==="AUTHENTICATED"?null:n?.icon;return [{tooltip:d,content:r?d:s,type:r?"text":"icon"},...e?[{tooltip:e,content:r?kt[e]?.tooltip:kt[e]?.icon,type:r?"text":"icon"}]:[],{tooltip:"",content:o?`ECI ${o}`:"",type:"text"}]},[t,r,e,o]),a$1=useMemo(()=>p.filter(n=>!!n.content).map((n,d)=>{let s=n.type==="text"?jsx(Po,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(Ao,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":n.content,children:n.content})}):jsx(a$2,{sx:{width:"16px",height:"16px"},src:n.content,alt:n.tooltip});return jsx(a,{title:n.tooltip,children:s},`${n.tooltip}-${d}`)}),[p]);return jsx(Wo,{id:l,"data-testid":"AuthIcons",children:a$1})}var ko=be;var Se=(t,o,e)=>({start:{x:t*6,transition:{duration:.3,type:"tween",ease:"easeIn"},...t>0&&{opacity:0}},animate:{x:e?t*e:t*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:o,...t>0&&{opacity:1}}});var Te=ko;var tt={VOID:{icon:dk},CAPTURED:{icon:ck}};var ut=styled$1(motion.div)(({theme:t,isCapture:o})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:t.spacing(.5),paddingInline:t.spacing(.3),paddingBlock:t.spacing(.3),height:"100%",minWidth:"100%",backgroundColor:o?"#eaf3fb":"#eeeeee",borderRadius:"56px",width:"fit-content",fontSize:"10px",color:t.palette.text.primary,position:"relative",zIndex:10})),ft=styled$1("div")(({theme:t,percentage:o,isCapture:e})=>({border:`0.6px ${[0,100].includes(o)?"solid":"dashed"} ${e?t.palette.info.dark:"#656565"}`,borderRadius:"80px",padding:t.spacing(.316),paddingLeft:t.spacing(.516),fontSize:"7px",fontWeight:t.typography.fontWeightBold,color:e?t.palette.info.dark:"#656565",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5)})),xt=styled$1("div")(({percentage:t,isCapture:o,theme:e})=>({background:`conic-gradient(${o?e.palette.info.dark:"#656565"} ${t}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${o?e.palette.info.dark:"#656565"}`})),gt=styled$1("img")({width:"14px",height:"14px"}),j=styled$1(o)({width:"16px",height:"16px"}),N=styled$1("img")({width:"16px",height:"16px"}),Bo=styled$1(Box)({display:"flex",alignItems:"center",justifyContent:"center"});function It(t){return t<5?5:t===100?95:t}function Be({voidPercentage:t,capturePercentage:o,captureCount:e,autoType:r,captureAmount:l,voidAmount:p,currency:a$1,isTextShown:n,remainingAmount:d,isSheetViewShown:s,selectionProps:f={}}){let c=Number(o)+Number(t)===100||d<=0,g=yc(useId(),"capture-auto-icon"),T=useTheme$1(),{t:A}=useTranslation(),P=Ha(d||0),L=useCallback(C=>`Auto ${C} - ${a$1} ${P.integerAmount}.${P.decimalAmount}`,[a$1,P.decimalAmount,P.integerAmount]),J=useCallback(C=>{let X=C==="Capture"?l:p,{integerAmount:D,decimalAmount:v}=Ia(X,a$1);return `Partial ${C} - ${a$1} ${D}.${v}`},[l,p,a$1]),x=o>0?jsx(a,{title:J("Capture"),children:jsxs(ut,{isCapture:true,isFullyUsed:c,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:T.shadows[4]}},children:[jsx(gt,{src:ub,alt:"captured"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(ft,{isCapture:true,percentage:o,children:[o,"% ",jsx(xt,{isCapture:true,percentage:It(o)})]}),e>1&&jsxs(z,{compact:true,color:"dark",children:[e,"x"]})]})]})}):r==="CAPTURED"&&!c?jsx(a,{title:L("Capture"),children:jsx(j,{children:jsx(N,{src:tt.CAPTURED?.icon,alt:"auto"})})}):jsx(a,{title:L("Capture"),children:jsx(j,{children:jsx(N,{src:tt.CAPTURED?.icon,alt:"auto"})})}),I=o===100?jsx(a,{title:A("captured"),children:jsx(Bo,{children:jsx(N,{src:fk,alt:"captured"})})}):x,W=useMemo(()=>s&&I?jsx(b,{chipIndex:4,copyText:A("captured"),selectionProps:f,children:A("captured")}):n&&I?jsx(k,{children:A("captured")}):I,[n,I,s,f]);return W&&jsx("div",{id:g,"data-testid":"CaptureAutoIcon",style:{zIndex:12},children:W})}var Do=Be;function Ve({voidPercentage:t,capturePercentage:o,voidCount:e,autoType:r,captureAmount:l$1,voidAmount:p,currency:a$1,isTextShown:n,isSheetViewShown:d,selectionProps:s={},remainingAmount:f}){let c=Number(o)+Number(t)===100||f<=0,g=yc(useId(),"void-auto-icon"),T=useTheme$1(),{t:A}=useTranslation(),P=Ha(f||0),L=useCallback(C=>`Auto ${C} - ${a$1} ${P.integerAmount}.${P.decimalAmount}`,[a$1,P.decimalAmount,P.integerAmount]),J=useCallback(C=>{let X=C==="Capture"?l$1:p,{integerAmount:D,decimalAmount:v}=Ia(X,a$1);return `Partial ${C} - ${a$1} ${D}.${v}`},[l$1,p,a$1]),x=t>0||p?jsx(a,{title:J("Void"),children:jsxs(ut,{isFullyUsed:c,whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:14,background:T.palette.common.white,border:`0.75px solid ${T.palette.grey[600]}1A`},variants:{animate:{boxShadow:T.shadows[4]}},children:[jsx(gt,{src:wk,alt:"void"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(ft,{percentage:t,children:[t,"% ",jsx(xt,{percentage:It(t)})]}),e>0&&jsxs(z,{compact:true,color:"neutral",children:[e,"x"]})]})]})}):r==="VOID"&&!c?jsx(a,{title:L("Void"),children:jsx(j,{children:jsx(N,{src:tt.VOID?.icon,alt:"auto"})})}):null,I=t===100?jsx(a,{title:A("void"),children:jsx(j,{children:jsx(N,{src:wk,alt:"void"})})}):x,W=useMemo(()=>d&&I?jsx(b,{chipIndex:5,copyText:A("void"),selectionProps:s,children:A("void")}):n&&I?jsx(l,{children:A("void")}):I,[n,I,d,s]);return W?jsx("div",{id:g,"data-testid":"VoidAutoIcon",style:{...!d&&{zIndex:11}},children:W}):null}var $o=Ve;var Me=Do;var Fe=({authorizedStatus:t,isTextShown:o,iconStyles:e,tableMode:r,chipIndex:l=0,selectionProps:p={}})=>{let{t:a$1}=useTranslation(),n=useTheme$1(),d=a$1(_(t));return Va(r)?jsx(b,{copyText:d,chipIndex:l,selectionProps:p,children:d}):jsx(a,{title:d,children:o?jsx(j$1,{"data-testid":"StatusCell_AuthorizedStatusLabel",sx:{color:n.palette.info.dark},children:d}):jsx(a$2,{src:f[t],alt:"authorized-icon","data-testid":"StatusCell_AuthorizedStatusIcon",sx:e})})};var _o=styled$1(motion.span)(({theme:t})=>({color:t.palette.common.white,display:"block",fontWeight:t.typography.fontWeightBold,fontSize:"9.78px",borderRadius:"4px",paddingInline:t.spacing(.45)})),Vo=styled$1(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"})),Bt=styled$1("img")(()=>({width:"10px",height:"10px"})),Lt=styled$1(motion.span)(({theme:t})=>({width:"18px",height:"18px",borderRadius:"50%",backgroundColor:t.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,position:"relative"})),Dt=styled$1(motion.div,{shouldForwardProp:t=>t!=="isVisible"})(({isVisible:t})=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",width:"0",overflow:"hidden",opacity:0,...!t&&{padding:"0 !important"}})),Mo=styled$1(motion.div)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"})),zo=styled$1(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),No={delay:.2,ease:"easeIn",fadeIn:{duration:.2}},Go={animate:{width:"auto",paddingRight:"4px",paddingLeft:"4px"},fadeIn:{opacity:1,transition:{delay:.7}}},Fo={animate:{width:"auto"},fadeIn:{opacity:1,transition:{delay:1}}},Uo={animate:{width:"auto",paddingRight:"8px",paddingLeft:"4px"}},Et={fadeIn:{duration:.3},animate:{duration:.1}},Oo={fadeIn:{opacity:1}},jo=styled$1(j$1)(()=>({width:"88px",height:"100%"})),$t=styled$1(Box)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.25),height:"100%"}));function qe({chargeStatus:t,gatewayTooltip:o$1,acquirerTooltip:e,chargeTooltip:r,errorCode:l,isTextShown:p$1,gatewayCode:a$1,acquirerCode:n,unCapturedStyles:d,iconStyles:s$1,iconWrapperStyles:f,gatewayIconWrapperStyles:c,gatewayContainerStyles:g$1,gateWayIconStyles:T,showBadge:A=true,isSheetViewShown:P=false,selectionProps:L={},chipIndex:J=0}){let x=t?b$1[t]:null,I=t?g[t]:null,W=useTheme$1(),{t:C}=useTranslation(),X=yc(useId(),"charge-status-icon"),D=r&&jsx(Fragment,{children:jsx("div",{children:r})}),v=e&&jsxs(Fragment,{children:[jsx("div",{children:"Acquirer"}),jsx("div",{children:e})]}),Y=o$1&&jsxs(Fragment,{children:[jsx("div",{children:"Gateway"}),jsx("div",{children:o$1})]}),Ft=t&&a$3[t]&&jsx("div",{"data-testid":"ChargeStatusIcon_ChargeIcon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:x?"50%":"",...f},children:jsx(p,{src:a$3[t],alt:"charge-icon","data-testid":"ChargeStatusIcon_StatusIcon",style:{borderRadius:x?"50%":"",width:"16px",height:"16px",...s$1}})});return P?jsxs($t,{children:[jsxs(b,{copyText:C(_(t)),chipIndex:J,selectionProps:L,children:[C(_(t))," ",l]}),x&&jsxs(Fragment,{children:[a$1&&jsxs(b,{copyText:"Gateway",chipIndex:1,selectionProps:L,children:["Gateway ",a$1]}),n&&jsxs(b,{copyText:"Acquirer",chipIndex:2,selectionProps:L,children:["Acquirer ",n]})]})]}):p$1?jsxs($t,{children:[jsx(a,{title:D,children:jsxs(jo,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark,borderColor:`${x?.color||I?.color||W.palette.info.dark}1A`},children:[C(_(t))," ",l]})}),x&&jsxs(Fragment,{children:[a$1&&jsx(a,{title:Y,children:jsxs(j$1,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark},children:["Gateway ",a$1]})}),n&&jsx(a,{title:v,children:jsxs(j$1,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark},children:["Acquirer ",n]})})]})]}):jsx(o,{id:X,"data-testid":"ChargeStatusIcon_StatusIconWrapper",style:{...f},children:s?.includes(t||"")&&(D||v||Y)?jsxs(zo,{"data-testid":"ChargeStatusIcon_UnCapturedContainer",whileHover:["animate","fadeIn"],style:{left:"0",...A&&{paddingInline:"12px",border:"1px solid #F2F2F2",borderRadius:"12px",backgroundColor:"#fff"},...d},children:[jsx(Mo,{"data-testid":"ChargeStatusIcon_UnCapturedBadge",sx:{borderRadius:"56px"},initial:{background:"transparent"},variants:{animate:{background:x?.background}},children:jsx(a,{title:D??C(_(t)),children:jsxs(Fragment,{children:[Ft,jsx(Vo,{"data-testid":"ChargeStatusIcon_ErrorCodeWrapper",transition:{animate:{duration:.05}},variants:Uo,style:{...l&&{padding:"0 !important"}},children:jsx(_o,{"data-testid":"ChargeStatusIcon_ErrorCodeLabel",sx:{background:x?.color},transition:No,variants:Oo,initial:{opacity:0},children:l})})]})})}),jsx(Dt,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:Et,variants:Go,style:g$1,isVisible:!!Y,children:Y&&jsx(a,{title:Y,children:jsx(Lt,{"data-testid":"ChargeStatusIcon_GatewayIconWrapper",style:{background:x?.background,...c},children:jsx(Bt,{src:x?.gatewayIcon,alt:"gateway-icon","data-testid":"ChargeStatusIcon_GatewayIcon",style:T})})})}),jsx(Dt,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:Et,variants:Fo,style:g$1,isVisible:!!v,children:v&&jsx(a,{title:v,children:jsx(Lt,{"data-testid":"ChargeStatusIcon_AcquirerIconWrapper",style:{background:x?.background,...c},children:jsx(Bt,{src:x?.acquirerIcon,alt:"acquirer-icon","data-testid":"ChargeStatusIcon_AcquirerIcon",style:T})})})})]}):jsx(a,{title:D??C(_(t)),children:jsx(o,{children:Ft})})})}var Xe=()=>{let{t}=useTranslation(),o=yc(useId(),"customer-initiated-icon");return jsx(a,{title:t("merchantInitiated"),children:jsx("img",{id:o,"data-testid":"merchantInitiatedIcon",src:vb,alt:"merchant",style:{width:"16px",height:"16px"}})})};var Ye={G:"Global",R:"Regional",L:"Local"},ot=({geographyVariant:t,countryCode:o,isTextShown:e})=>{let r=t?Ye[t]:void 0,l=r||o?`${r||""} ${r&&o?"-":""} ${o?`Country - ${o}`:""}`:void 0;return e||!o?null:jsx(a,{title:l,children:jsx(a$4,{countryCode:o})})};var tr=({geographyVariant:t,isTextShown:o,deviceCountry:e,deviceType:r,tableMode:l})=>{let p=yc(useId(),"device-icon-chip");return jsxs(Qe,{id:p,"data-testid":"DeviceIconChip",sx:{display:"flex",gap:"8px",alignItems:"center",...Va(l)&&{height:"18px"}},children:[jsx(ot,{geographyVariant:t,isTextShown:o,countryCode:e}),jsx(c,{type:r,isTextShown:o,tableMode:l})]})};var rr=({isDisputeOpen:t,iconStyles:o})=>{let e=yc(useId(),"dispute-icon");return jsx(p,{id:e,"data-testid":"StatusCell_DisputeStatusIcon",sx:{width:"13.5px",height:"13.5px"},src:t?wa:va,alt:"dispute-icon",style:o})};var Xo=styled$1(Qe,{shouldForwardProp:t=>t!=="tableMode"})(({theme:t,tableMode:o})=>({display:"flex",gap:t.spacing(.5),...Va(o)&&{height:"18px"},alignItems:"center"})),Yo=styled$1("span")(({theme:t})=>({fontSize:"10px",fontWeight:500,color:t.palette.text.primary}));function Vt({countryCode:t,isTextShown:o,cardNumber:e,bankName:r,tableMode:l}){let p=yc(useId(),"issuer-icon"),a$1=e?.slice(0,4),n=e?.slice(-4);return jsxs(Xo,{id:p,"data-testid":"IssuerIcon",tableMode:l,children:[t&&jsx(ot,{countryCode:t,isTextShown:o}),jsx(a,{title:`${r?`Issuer - ${r}`:""}`,children:jsx(Yo,{children:`${a$1||""} ${n||""}`})})]})}var sr=Vt;styled(motion.div)(({theme:t,background:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5),paddingInline:t.spacing(.75),paddingBlock:t.spacing(.5),backgroundColor:o,height:"24px",width:"fit-content",borderRadius:"24px",fontSize:"10px",color:t.palette.text.primary}));var Ra=styled("img")(()=>({height:"13.125px",width:"12px"})),bt=styled("div")(()=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",width:"65px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4.5px 8px",borderRadius:"24px"})),ka=styled("div")(({theme:t})=>({color:t.palette.common.white,background:t.palette.error.main,fontSize:"0.6rem",fontWeight:600,borderRadius:"16px",padding:"2px 8px",display:"flex",alignItems:"center",justifyContent:"center"})),Ba=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px"}));var ur=({payoutStatus:t="PENDING",isTextShown:o,payoutTooltip:e$1,iconStyles:r,isSheetViewShown:l,chipIndex:p$1=0,selectionProps:a$1={}})=>{let{t:n}=useTranslation(),d=yc(useId(),"payout-icon"),s=n(_(t)),f=e$1||s;return l?jsx(b,{chipIndex:p$1,copyText:s,selectionProps:a$1,children:s}):jsx(a,{title:f,children:o?jsx(bt,{id:d,"data-testid":"StatusCell_PayoutStatusLabel",children:s}):jsx(p,{id:d,src:e[t],alt:"settled-icon","data-testid":"StatusCell_PayoutStatusIcon",style:r})})};var Qo=styled$1(motion.img)(()=>({width:"14px",height:"14px"})),Zo=styled$1(motion.span)(({theme:t})=>({color:t.palette.common.white,borderRadius:t.spacing(.5),height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600,backgroundColor:t.palette.secondary.main})),Mt=styled$1(motion.div)(({theme:t})=>({height:"16px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${t.palette.secondary.main}1A`,paddingInline:t.spacing(.5),borderRadius:"56px"})),qa=(t,o,e)=>({start:{x:t*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:e?t*e:t*49,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:o}}),Ka=styled$1(motion.span)(({isTextShown:t,theme:o})=>({border:`1px solid ${o.palette.divider}`,borderRadius:"12px",backgroundColor:o.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:t?"auto":"36px",...t&&{border:"none"}})),Ja=styled$1(motion.div,{shouldForwardProp:t=>t!=="order"})(({order:t=0})=>({display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:0,left:0,zIndex:t+6,width:"fit-content",height:"24px",cursor:"pointer",borderRadius:"16px","&:hover":{zIndex:200}})),Xa=styled$1(motion.div,{shouldForwardProp:t=>t!=="statusesCount"})(({statusesCount:t=1})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"relative",minWidth:`${t*6+36}px`,height:"24px",cursor:"pointer",borderRadius:"16px",overflow:"visible"})),Ya=styled$1("div")(()=>({display:"flex",gap:"4px",justifyContent:"flex-start",alignItems:"center",position:"relative",width:"100%",overflow:"visible"}));var hr=({isTextShown:t,refundStatus:o="PENDING",refundTooltip:e="",refundCount:r,iconStyles:l,isSheetViewShown:p$1,chipIndex:a$1=0,selectionProps:n={}})=>{let{t:d$1}=useTranslation(),s=useTheme$1(),f=yc(useId(),"refund-icon"),c=(r||0)>1,g=d$1(_(o));if(p$1)return jsxs(b,{chipIndex:a$1,selectionProps:n,copyText:g,children:[g," ",c?`${r}x`:null]});let T=jsxs(Zo,{"data-testid":"StatusCell_RefundsCountBadge",initial:{width:0,opacity:0,padding:"0px"},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex",padding:"1.285px 2.569px"},fadeIn:{transition:{delay:.5},opacity:1}},children:[r,"x"]});return t?jsx(a,{title:jsx("div",{children:jsx("div",{children:e})}),children:jsx(bt,{id:f,"data-testid":"StatusCell_RefundStatusLabel",sx:{color:d[o].color,backgroundColor:d[o].backgroundColor,width:"90px"},children:jsxs(Mt,{whileInView:c?["animate","fadeIn"]:void 0,variants:{animate:{boxShadow:s.shadows[4],gap:s.spacing(.5)}},children:[g," ",c?T:null]})})}):jsx(a,{title:jsx("div",{children:jsx("div",{children:e})}),children:c?jsxs(Mt,{id:f,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:s.shadows[4],gap:s.spacing(.5)}},children:[jsx(Qo,{src:ok,alt:"multi-refunded-icon","data-testid":"StatusCell_MultiRefundIcon"}),T]}):jsx(p,{id:f,src:c$1[o],alt:"refunded-icon","data-testid":"StatusCell_RefundStatusIcon",style:l})})},te=hr;var Cr=te;var yr={american_express:"AMEX",debit:"card",credit:"card",unionpay:"UnionPay",jaywan:"JAYWAN"},B=t=>yr[t?.toLowerCase()||""]||t;styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));var oe=styled("img")(()=>({maxWidth:"24px",maxHeight:"16px"}));styled(motion.span,{shouldForwardProp:t=>t!=="sourcesCount"})(({theme:t,sourcesCount:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${o*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:t.palette.background.paper,borderRadius:"16px"}));var ee=styled("span")(({theme:t})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:t.palette.text.primary})),re=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%"}));styled("span")(({theme:t})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));var ne=styled("span")(({theme:t})=>({fontSize:"10px",fontWeight:500,color:t.palette.text.primary}));function At({source:t,isTextShown:o,title:e,width:r,height:l,imgSx:p}){let{t:a$1}=useTranslation(),n=h(t);return jsx(a,{title:e,children:o?jsx(re,{"data-testid":"SourceCell_BadgeTextWrapper",children:jsx(ee,{"data-testid":"SourceCell_TextLabel","data-source":t,children:a$1(_(t))})}):jsx(oe,{src:n,alt:t,width:r,height:l,onError:d=>{d.currentTarget.src=h("card");},sx:p})})}function vr({payment:t,card:o,isTextShown:e,firstIcon:r}){let l=yc(useId(),"source-icons"),{t:p}=useTranslation(),a=useCallback(()=>{let s=[],f=bc(t),c=t?.method,g=t?.scheme;return B(c)?.toLowerCase()===B(g)?.toLowerCase()?s.push(B(c),B(f)):s.push(B(c),B(f),B(g)),s},[t]),n=useMemo(()=>jsx(At,{source:r,isTextShown:e,title:p(_(r))},r),[r,e,p]),d=useMemo(()=>a()?.filter(s=>!!s&&s!==r)?.map((s,f,c)=>{let g=t?.wallet===p("sv_wallet")?p("storedValueWallet"):p("passThruWallet"),T=f===c.length-1&&o?.last_four?`${p(_(s))} - ${o?.last_four}`:p(_(s));return jsx(At,{source:s,isTextShown:e,title:f===0&&s==="Wallet"?g:T},`${s}-${f}`)}),[a,t,o,e,p,r]);return jsxs(Box,{id:l,"data-testid":"SourceIcons",display:"flex",alignItems:"center",gap:.5,children:[r&&n,d,o?.last_four&&jsxs(ne,{children:["\xB7\xB7\xB7 ",o?.last_four]})]})}var rt={PROCESSED:Qg,FAILED:""};var se=styled("span")(({theme:t})=>({fontSize:"11px",padding:"2px 0",color:t.palette.text.primary})),le=styled("img")(()=>({width:"16px",height:"16px"})),de=styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function ce({status:t,isTextShown:o,isSheetViewShown:e,chipIndex:r=0,selectionProps:l={}}){let p=useTheme(),{t:a$1}=useTranslation(),n=yc(useId(),"destination-icon"),d=a$1(_(t));return e&&rt[t]?jsx(b,{copyText:d,chipIndex:r,selectionProps:l,children:d}):o&&rt[t]?jsx(se,{id:n,"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:"#1F88D00D",color:t==="PROCESSED"?p.palette.info.dark:p.palette.common.black},children:d}):jsx(de,{id:n,"data-testid":"DestinationIcon",className:"destination-status",children:t&&rt[t]&&jsx(a,{title:a$1(_(t)),children:jsx(le,{src:rt[t],alt:"destination-icon"})})})}export{qa as a,Ka as b,Ja as c,Xa as d,Ya as e,Ce as f,Se as g,Te as h,$o as i,Me as j,Fe as k,qe as l,Xe as m,ot as n,tr as o,rr as p,sr as q,Ra as r,ka as s,Ba as t,ur as u,Cr as v,B as w,At as x,vr as y,ce as z};
|
|
1
|
+
import {f,b as b$1,g,a as a$3,e,d,c as c$1}from'./chunk-LDLGBNMM.js';import {a as a$5}from'./chunk-UJ4IYIJH.js';import {a as a$2}from'./chunk-H6HHXYRL.js';import {c}from'./chunk-4XDOS6NM.js';import {a as a$1}from'./chunk-ZONDSLTR.js';import {o,j as j$1,k,l,p}from'./chunk-RHUTFOWS.js';import {a}from'./chunk-KHM5KW53.js';import {b}from'./chunk-2U6YCW6N.js';import {z}from'./chunk-ZPGWJ5RD.js';import {a as a$4}from'./chunk-4DSO4G5S.js';import {Va,yc,Ha,Ia,bc,f as f$1}from'./chunk-2CIV4TII.js';import {s}from'./chunk-BXMBE224.js';import {U,ui,wi,vi,ti,Ai,_g,Rg,Zg,Nj,Oj,ub,ck,fk,wk,dk,vb,wa,va,ok,h,Qg}from'./chunk-KCEYICHJ.js';import {useId,useMemo,useCallback}from'react';import {useTranslation}from'react-i18next';import {styled,Box,useTheme}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {motion}from'framer-motion';import {styled as styled$1,useTheme as useTheme$1}from'@mui/material/styles';import _ from'lodash/camelCase';import Qe from'@mui/material/Box';var lt={ORDER:{label:"order",icon:ti,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:vi,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:wi,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:ui,color:"#32ADE6"}},dt={SAVED_TOKEN:{label:"savedToken",icon:U,color:"#76BB40"},COUNT:{label:"countBadge",icon:"countBadge",color:"#76BB40"}};styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5)}));styled("img")(()=>({width:"35px",height:"16px",display:"block"}));styled("span")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"14.67px",height:"10px"}));styled("img")(()=>({maxWidth:"100%",width:"100%"}));var ct=styled("span")(({theme:t})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:t.palette.text.primary})),mt=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"}));function Ie({type:t,hasSavedCard:o,totalPaymentsCount:e,isTextShown:r}){let l=yc(useId(),"agreement-icon"),p=useTheme(),{t:a$3}=useTranslation(),n=useMemo(()=>[...o?[dt.SAVED_TOKEN]:[],...(e||0)>0?[dt.COUNT]:[],...t&<[t]?[lt[t]]:[]],[o,e,t]),d=c=>r?jsx(a$1,{"data-testid":"AgreementCell_countBadge",children:jsx(a,{title:a$3("totalPaymentCount",{amount:f$1(e)}),children:jsx(mt,{children:jsxs(ct,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:dt.COUNT.color},children:["x",e]})})})},c):jsx(a$5,{value:e,index:c},c),s=n.map((c,g)=>c.label==="countBadge"?d(g):jsx(a,{title:a$3(c.label),children:jsx(a$1,{children:r?jsx(mt,{children:jsx(ct,{"data-testid":"AgreementCell_agreementType",sx:{color:c.color},children:a$3(c.label)})}):jsx(a$2,{sx:{maxWidth:"16px",maxHeight:"16px",height:"auto",width:"auto"},src:c.icon,alt:"agreement"})},c.color)},c.color)),f=jsx(a,{title:"No agreement",children:jsx(a$1,{children:r?jsx(mt,{children:jsx(ct,{"data-testid":"AgreementCell_agreementType",sx:{color:p.palette.text.secondary},children:"No agreement"})}):jsx(a$2,{sx:{maxWidth:"24px",maxHeight:"24px",height:"auto",width:"auto"},src:Ai,alt:"agreement"})},"no-agreement")},"no-agreement");return jsx(Box,{id:l,"data-testid":"AgreementIcon",sx:{display:"flex",alignItems:"center",gap:"4px"},children:s?.length>0?s:f})}var To=Ie;var Ce=To;styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"}));styled(motion.span,{shouldForwardProp:t=>t!=="sourcesCount"})(({theme:t,sourcesCount:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${o*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:t.palette.background.paper,borderRadius:"16px"}));var Ao=styled("span")(({theme:t})=>({fontSize:"11px",padding:"2px 0",color:t.palette.text.primary})),Po=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px",textAlign:"center",width:"100%"}));styled("span")(({theme:t})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));styled(motion.div)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));var Wo=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px"}));var kt={"3DS":{tooltip:"3DS",icon:Oj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Nj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:Zg,borderColor:"rgba(31, 136, 208, 0.10)"}},vo={FAILED:{tooltip:"Failed",icon:Rg,borderColor:"rgba(255, 61, 0, 0.10)"},REJECTED:{tooltip:"Rejected",icon:_g,borderColor:"rgba(255, 61, 0, 0.10)"}};function be({transactionStatus:t,eci:o,authType:e,isTextShown:r}){let l=yc(useId(),"auth-icons"),p=useMemo(()=>{let n=t?vo[t]:null,d=n?.tooltip,s=t==="AUTHENTICATED"?null:n?.icon;return [{tooltip:d,content:r?d:s,type:r?"text":"icon"},...e?[{tooltip:e,content:r?kt[e]?.tooltip:kt[e]?.icon,type:r?"text":"icon"}]:[],{tooltip:"",content:o?`ECI ${o}`:"",type:"text"}]},[t,r,e,o]),a$1=useMemo(()=>p.filter(n=>!!n.content).map((n,d)=>{let s=n.type==="text"?jsx(Po,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(Ao,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":n.content,children:n.content})}):jsx(a$2,{sx:{width:"16px",height:"16px"},src:n.content,alt:n.tooltip});return jsx(a,{title:n.tooltip,children:s},`${n.tooltip}-${d}`)}),[p]);return jsx(Wo,{id:l,"data-testid":"AuthIcons",children:a$1})}var ko=be;var Se=(t,o,e)=>({start:{x:t*6,transition:{duration:.3,type:"tween",ease:"easeIn"},...t>0&&{opacity:0}},animate:{x:e?t*e:t*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:o,...t>0&&{opacity:1}}});var Te=ko;var tt={VOID:{icon:dk},CAPTURED:{icon:ck}};var ut=styled$1(motion.div)(({theme:t,isCapture:o})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:t.spacing(.5),paddingInline:t.spacing(.3),paddingBlock:t.spacing(.3),height:"100%",minWidth:"100%",backgroundColor:o?"#eaf3fb":"#eeeeee",borderRadius:"56px",width:"fit-content",fontSize:"10px",color:t.palette.text.primary,position:"relative",zIndex:10})),ft=styled$1("div")(({theme:t,percentage:o,isCapture:e})=>({border:`0.6px ${[0,100].includes(o)?"solid":"dashed"} ${e?t.palette.info.dark:"#656565"}`,borderRadius:"80px",padding:t.spacing(.316),paddingLeft:t.spacing(.516),fontSize:"7px",fontWeight:t.typography.fontWeightBold,color:e?t.palette.info.dark:"#656565",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5)})),xt=styled$1("div")(({percentage:t,isCapture:o,theme:e})=>({background:`conic-gradient(${o?e.palette.info.dark:"#656565"} ${t}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${o?e.palette.info.dark:"#656565"}`})),gt=styled$1("img")({width:"14px",height:"14px"}),j=styled$1(o)({width:"16px",height:"16px"}),N=styled$1("img")({width:"16px",height:"16px"}),Bo=styled$1(Box)({display:"flex",alignItems:"center",justifyContent:"center"});function It(t){return t<5?5:t===100?95:t}function Be({voidPercentage:t,capturePercentage:o,captureCount:e,autoType:r,captureAmount:l,voidAmount:p,currency:a$1,isTextShown:n,remainingAmount:d,isSheetViewShown:s,selectionProps:f={}}){let c=Number(o)+Number(t)===100||d<=0,g=yc(useId(),"capture-auto-icon"),T=useTheme$1(),{t:A}=useTranslation(),P=Ha(d||0),L=useCallback(C=>`Auto ${C} - ${a$1} ${P.integerAmount}.${P.decimalAmount}`,[a$1,P.decimalAmount,P.integerAmount]),J=useCallback(C=>{let X=C==="Capture"?l:p,{integerAmount:D,decimalAmount:v}=Ia(X,a$1);return `Partial ${C} - ${a$1} ${D}.${v}`},[l,p,a$1]),x=o>0?jsx(a,{title:J("Capture"),children:jsxs(ut,{isCapture:true,isFullyUsed:c,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:T.shadows[4]}},children:[jsx(gt,{src:ub,alt:"captured"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(ft,{isCapture:true,percentage:o,children:[o,"% ",jsx(xt,{isCapture:true,percentage:It(o)})]}),e>1&&jsxs(z,{compact:true,color:"dark",children:[e,"x"]})]})]})}):r==="CAPTURED"&&!c?jsx(a,{title:L("Capture"),children:jsx(j,{children:jsx(N,{src:tt.CAPTURED?.icon,alt:"auto"})})}):jsx(a,{title:L("Capture"),children:jsx(j,{children:jsx(N,{src:tt.CAPTURED?.icon,alt:"auto"})})}),I=o===100?jsx(a,{title:A("captured"),children:jsx(Bo,{children:jsx(N,{src:fk,alt:"captured"})})}):x,W=useMemo(()=>s&&I?jsx(b,{chipIndex:4,copyText:A("captured"),selectionProps:f,children:A("captured")}):n&&I?jsx(k,{children:A("captured")}):I,[n,I,s,f]);return W&&jsx("div",{id:g,"data-testid":"CaptureAutoIcon",style:{zIndex:12},children:W})}var Do=Be;function Ve({voidPercentage:t,capturePercentage:o,voidCount:e,autoType:r,captureAmount:l$1,voidAmount:p,currency:a$1,isTextShown:n,isSheetViewShown:d,selectionProps:s={},remainingAmount:f}){let c=Number(o)+Number(t)===100||f<=0,g=yc(useId(),"void-auto-icon"),T=useTheme$1(),{t:A}=useTranslation(),P=Ha(f||0),L=useCallback(C=>`Auto ${C} - ${a$1} ${P.integerAmount}.${P.decimalAmount}`,[a$1,P.decimalAmount,P.integerAmount]),J=useCallback(C=>{let X=C==="Capture"?l$1:p,{integerAmount:D,decimalAmount:v}=Ia(X,a$1);return `Partial ${C} - ${a$1} ${D}.${v}`},[l$1,p,a$1]),x=t>0||p?jsx(a,{title:J("Void"),children:jsxs(ut,{isFullyUsed:c,whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:14,background:T.palette.common.white,border:`0.75px solid ${T.palette.grey[600]}1A`},variants:{animate:{boxShadow:T.shadows[4]}},children:[jsx(gt,{src:wk,alt:"void"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(ft,{percentage:t,children:[t,"% ",jsx(xt,{percentage:It(t)})]}),e>0&&jsxs(z,{compact:true,color:"neutral",children:[e,"x"]})]})]})}):r==="VOID"&&!c?jsx(a,{title:L("Void"),children:jsx(j,{children:jsx(N,{src:tt.VOID?.icon,alt:"auto"})})}):null,I=t===100?jsx(a,{title:A("void"),children:jsx(j,{children:jsx(N,{src:wk,alt:"void"})})}):x,W=useMemo(()=>d&&I?jsx(b,{chipIndex:5,copyText:A("void"),selectionProps:s,children:A("void")}):n&&I?jsx(l,{children:A("void")}):I,[n,I,d,s]);return W?jsx("div",{id:g,"data-testid":"VoidAutoIcon",style:{...!d&&{zIndex:11}},children:W}):null}var $o=Ve;var Me=Do;var Fe=({authorizedStatus:t,isTextShown:o,iconStyles:e,tableMode:r,chipIndex:l=0,selectionProps:p={}})=>{let{t:a$1}=useTranslation(),n=useTheme$1(),d=a$1(_(t));return Va(r)?jsx(b,{copyText:d,chipIndex:l,selectionProps:p,children:d}):jsx(a,{title:d,children:o?jsx(j$1,{"data-testid":"StatusCell_AuthorizedStatusLabel",sx:{color:n.palette.info.dark},children:d}):jsx(a$2,{src:f[t],alt:"authorized-icon","data-testid":"StatusCell_AuthorizedStatusIcon",sx:e})})};var _o=styled$1(motion.span)(({theme:t})=>({color:t.palette.common.white,display:"block",fontWeight:t.typography.fontWeightBold,fontSize:"9.78px",borderRadius:"4px",paddingInline:t.spacing(.45)})),Vo=styled$1(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"})),Bt=styled$1("img")(()=>({width:"10px",height:"10px"})),Lt=styled$1(motion.span)(({theme:t})=>({width:"18px",height:"18px",borderRadius:"50%",backgroundColor:t.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,position:"relative"})),Dt=styled$1(motion.div,{shouldForwardProp:t=>t!=="isVisible"})(({isVisible:t})=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",width:"0",overflow:"hidden",opacity:0,...!t&&{padding:"0 !important"}})),Mo=styled$1(motion.div)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"})),zo=styled$1(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),No={delay:.2,ease:"easeIn",fadeIn:{duration:.2}},Go={animate:{width:"auto",paddingRight:"4px",paddingLeft:"4px"},fadeIn:{opacity:1,transition:{delay:.7}}},Fo={animate:{width:"auto"},fadeIn:{opacity:1,transition:{delay:1}}},Uo={animate:{width:"auto",paddingRight:"8px",paddingLeft:"4px"}},Et={fadeIn:{duration:.3},animate:{duration:.1}},Oo={fadeIn:{opacity:1}},jo=styled$1(j$1)(()=>({width:"88px",height:"100%"})),$t=styled$1(Box)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.25),height:"100%"}));function qe({chargeStatus:t,gatewayTooltip:o$1,acquirerTooltip:e,chargeTooltip:r,errorCode:l,isTextShown:p$1,gatewayCode:a$1,acquirerCode:n,unCapturedStyles:d,iconStyles:s$1,iconWrapperStyles:f,gatewayIconWrapperStyles:c,gatewayContainerStyles:g$1,gateWayIconStyles:T,showBadge:A=true,isSheetViewShown:P=false,selectionProps:L={},chipIndex:J=0}){let x=t?b$1[t]:null,I=t?g[t]:null,W=useTheme$1(),{t:C}=useTranslation(),X=yc(useId(),"charge-status-icon"),D=r&&jsx(Fragment,{children:jsx("div",{children:r})}),v=e&&jsxs(Fragment,{children:[jsx("div",{children:"Acquirer"}),jsx("div",{children:e})]}),Y=o$1&&jsxs(Fragment,{children:[jsx("div",{children:"Gateway"}),jsx("div",{children:o$1})]}),Ft=t&&a$3[t]&&jsx("div",{"data-testid":"ChargeStatusIcon_ChargeIcon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:x?"50%":"",...f},children:jsx(p,{src:a$3[t],alt:"charge-icon","data-testid":"ChargeStatusIcon_StatusIcon",style:{borderRadius:x?"50%":"",width:"16px",height:"16px",...s$1}})});return P?jsxs($t,{children:[jsxs(b,{copyText:C(_(t)),chipIndex:J,selectionProps:L,children:[C(_(t))," ",l]}),x&&jsxs(Fragment,{children:[a$1&&jsxs(b,{copyText:"Gateway",chipIndex:1,selectionProps:L,children:["Gateway ",a$1]}),n&&jsxs(b,{copyText:"Acquirer",chipIndex:2,selectionProps:L,children:["Acquirer ",n]})]})]}):p$1?jsxs($t,{children:[jsx(a,{title:D,children:jsxs(jo,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark,borderColor:`${x?.color||I?.color||W.palette.info.dark}1A`},children:[C(_(t))," ",l]})}),x&&jsxs(Fragment,{children:[a$1&&jsx(a,{title:Y,children:jsxs(j$1,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark},children:["Gateway ",a$1]})}),n&&jsx(a,{title:v,children:jsxs(j$1,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark},children:["Acquirer ",n]})})]})]}):jsx(o,{id:X,"data-testid":"ChargeStatusIcon_StatusIconWrapper",style:{...f},children:s?.includes(t||"")&&(D||v||Y)?jsxs(zo,{"data-testid":"ChargeStatusIcon_UnCapturedContainer",whileHover:["animate","fadeIn"],style:{left:"0",...A&&{paddingInline:"12px",border:"1px solid #F2F2F2",borderRadius:"12px",backgroundColor:"#fff"},...d},children:[jsx(Mo,{"data-testid":"ChargeStatusIcon_UnCapturedBadge",sx:{borderRadius:"56px"},initial:{background:"transparent"},variants:{animate:{background:x?.background}},children:jsx(a,{title:D??C(_(t)),children:jsxs(Fragment,{children:[Ft,jsx(Vo,{"data-testid":"ChargeStatusIcon_ErrorCodeWrapper",transition:{animate:{duration:.05}},variants:Uo,style:{...l&&{padding:"0 !important"}},children:jsx(_o,{"data-testid":"ChargeStatusIcon_ErrorCodeLabel",sx:{background:x?.color},transition:No,variants:Oo,initial:{opacity:0},children:l})})]})})}),jsx(Dt,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:Et,variants:Go,style:g$1,isVisible:!!Y,children:Y&&jsx(a,{title:Y,children:jsx(Lt,{"data-testid":"ChargeStatusIcon_GatewayIconWrapper",style:{background:x?.background,...c},children:jsx(Bt,{src:x?.gatewayIcon,alt:"gateway-icon","data-testid":"ChargeStatusIcon_GatewayIcon",style:T})})})}),jsx(Dt,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:Et,variants:Fo,style:g$1,isVisible:!!v,children:v&&jsx(a,{title:v,children:jsx(Lt,{"data-testid":"ChargeStatusIcon_AcquirerIconWrapper",style:{background:x?.background,...c},children:jsx(Bt,{src:x?.acquirerIcon,alt:"acquirer-icon","data-testid":"ChargeStatusIcon_AcquirerIcon",style:T})})})})]}):jsx(a,{title:D??C(_(t)),children:jsx(o,{children:Ft})})})}var Xe=()=>{let{t}=useTranslation(),o=yc(useId(),"customer-initiated-icon");return jsx(a,{title:t("merchantInitiated"),children:jsx("img",{id:o,"data-testid":"merchantInitiatedIcon",src:vb,alt:"merchant",style:{width:"16px",height:"16px"}})})};var Ye={G:"Global",R:"Regional",L:"Local"},ot=({geographyVariant:t,countryCode:o,isTextShown:e})=>{let r=t?Ye[t]:void 0,l=r||o?`${r||""} ${r&&o?"-":""} ${o?`Country - ${o}`:""}`:void 0;return e||!o?null:jsx(a,{title:l,children:jsx(a$4,{countryCode:o})})};var tr=({geographyVariant:t,isTextShown:o,deviceCountry:e,deviceType:r,tableMode:l})=>{let p=yc(useId(),"device-icon-chip");return jsxs(Qe,{id:p,"data-testid":"DeviceIconChip",sx:{display:"flex",gap:"8px",alignItems:"center",...Va(l)&&{height:"18px"}},children:[jsx(ot,{geographyVariant:t,isTextShown:o,countryCode:e}),jsx(c,{type:r,isTextShown:o,tableMode:l})]})};var rr=({isDisputeOpen:t,iconStyles:o})=>{let e=yc(useId(),"dispute-icon");return jsx(p,{id:e,"data-testid":"StatusCell_DisputeStatusIcon",sx:{width:"13.5px",height:"13.5px"},src:t?wa:va,alt:"dispute-icon",style:o})};var Xo=styled$1(Qe,{shouldForwardProp:t=>t!=="tableMode"})(({theme:t,tableMode:o})=>({display:"flex",gap:t.spacing(.5),...Va(o)&&{height:"18px"},alignItems:"center"})),Yo=styled$1("span")(({theme:t})=>({fontSize:"10px",fontWeight:500,color:t.palette.text.primary}));function Vt({countryCode:t,isTextShown:o,cardNumber:e,bankName:r,tableMode:l}){let p=yc(useId(),"issuer-icon"),a$1=e?.slice(0,4),n=e?.slice(-4);return jsxs(Xo,{id:p,"data-testid":"IssuerIcon",tableMode:l,children:[t&&jsx(ot,{countryCode:t,isTextShown:o}),jsx(a,{title:`${r?`Issuer - ${r}`:""}`,children:jsx(Yo,{children:`${a$1||""} ${n||""}`})})]})}var sr=Vt;styled(motion.div)(({theme:t,background:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5),paddingInline:t.spacing(.75),paddingBlock:t.spacing(.5),backgroundColor:o,height:"24px",width:"fit-content",borderRadius:"24px",fontSize:"10px",color:t.palette.text.primary}));var Ra=styled("img")(()=>({height:"13.125px",width:"12px"})),bt=styled("div")(()=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",width:"65px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4.5px 8px",borderRadius:"24px"})),ka=styled("div")(({theme:t})=>({color:t.palette.common.white,background:t.palette.error.main,fontSize:"0.6rem",fontWeight:600,borderRadius:"16px",padding:"2px 8px",display:"flex",alignItems:"center",justifyContent:"center"})),Ba=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px"}));var ur=({payoutStatus:t="PENDING",isTextShown:o,payoutTooltip:e$1,iconStyles:r,isSheetViewShown:l,chipIndex:p$1=0,selectionProps:a$1={}})=>{let{t:n}=useTranslation(),d=yc(useId(),"payout-icon"),s=n(_(t)),f=e$1||s;return l?jsx(b,{chipIndex:p$1,copyText:s,selectionProps:a$1,children:s}):jsx(a,{title:f,children:o?jsx(bt,{id:d,"data-testid":"StatusCell_PayoutStatusLabel",children:s}):jsx(p,{id:d,src:e[t],alt:"settled-icon","data-testid":"StatusCell_PayoutStatusIcon",style:r})})};var Qo=styled$1(motion.img)(()=>({width:"14px",height:"14px"})),Zo=styled$1(motion.span)(({theme:t})=>({color:t.palette.common.white,borderRadius:t.spacing(.5),height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600,backgroundColor:t.palette.secondary.main})),Mt=styled$1(motion.div)(({theme:t})=>({height:"16px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${t.palette.secondary.main}1A`,paddingInline:t.spacing(.5),borderRadius:"56px"})),qa=(t,o,e)=>({start:{x:t*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:e?t*e:t*49,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:o}}),Ka=styled$1(motion.span)(({isTextShown:t,theme:o})=>({border:`1px solid ${o.palette.divider}`,borderRadius:"12px",backgroundColor:o.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:t?"auto":"36px",...t&&{border:"none"}})),Ja=styled$1(motion.div,{shouldForwardProp:t=>t!=="order"})(({order:t=0})=>({display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:0,left:0,zIndex:t+6,width:"fit-content",height:"24px",cursor:"pointer",borderRadius:"16px","&:hover":{zIndex:200}})),Xa=styled$1(motion.div,{shouldForwardProp:t=>t!=="statusesCount"})(({statusesCount:t=1})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"relative",minWidth:`${t*6+36}px`,height:"24px",cursor:"pointer",borderRadius:"16px",overflow:"visible"})),Ya=styled$1("div")(()=>({display:"flex",gap:"4px",justifyContent:"flex-start",alignItems:"center",position:"relative",width:"100%",overflow:"visible"}));var hr=({isTextShown:t,refundStatus:o="PENDING",refundTooltip:e="",refundCount:r,iconStyles:l,isSheetViewShown:p$1,chipIndex:a$1=0,selectionProps:n={}})=>{let{t:d$1}=useTranslation(),s=useTheme$1(),f=yc(useId(),"refund-icon"),c=(r||0)>1,g=d$1(_(o));if(p$1)return jsxs(b,{chipIndex:a$1,selectionProps:n,copyText:g,children:[g," ",c?`${r}x`:null]});let T=jsxs(Zo,{"data-testid":"StatusCell_RefundsCountBadge",initial:{width:0,opacity:0,padding:"0px"},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex",padding:"1.285px 2.569px"},fadeIn:{transition:{delay:.5},opacity:1}},children:[r,"x"]});return t?jsx(a,{title:jsx("div",{children:jsx("div",{children:e})}),children:jsx(bt,{id:f,"data-testid":"StatusCell_RefundStatusLabel",sx:{color:d[o].color,backgroundColor:d[o].backgroundColor,width:"90px"},children:jsxs(Mt,{whileInView:c?["animate","fadeIn"]:void 0,variants:{animate:{boxShadow:s.shadows[4],gap:s.spacing(.5)}},children:[g," ",c?T:null]})})}):jsx(a,{title:jsx("div",{children:jsx("div",{children:e})}),children:c?jsxs(Mt,{id:f,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:s.shadows[4],gap:s.spacing(.5)}},children:[jsx(Qo,{src:ok,alt:"multi-refunded-icon","data-testid":"StatusCell_MultiRefundIcon"}),T]}):jsx(p,{id:f,src:c$1[o],alt:"refunded-icon","data-testid":"StatusCell_RefundStatusIcon",style:l})})},te=hr;var Cr=te;var yr={american_express:"AMEX",debit:"card",credit:"card",unionpay:"UnionPay",jaywan:"JAYWAN"},B=t=>yr[t?.toLowerCase()||""]||t;styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));var oe=styled("img")(()=>({maxWidth:"24px",maxHeight:"16px"}));styled(motion.span,{shouldForwardProp:t=>t!=="sourcesCount"})(({theme:t,sourcesCount:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${o*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:t.palette.background.paper,borderRadius:"16px"}));var ee=styled("span")(({theme:t})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:t.palette.text.primary})),re=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%"}));styled("span")(({theme:t})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));var ne=styled("span")(({theme:t})=>({fontSize:"10px",fontWeight:500,color:t.palette.text.primary}));function At({source:t,isTextShown:o,title:e,width:r,height:l,imgSx:p}){let{t:a$1}=useTranslation(),n=h(t);return jsx(a,{title:e,children:o?jsx(re,{"data-testid":"SourceCell_BadgeTextWrapper",children:jsx(ee,{"data-testid":"SourceCell_TextLabel","data-source":t,children:a$1(_(t))})}):jsx(oe,{src:n,alt:t,width:r,height:l,onError:d=>{d.currentTarget.src=h("card");},sx:p})})}function vr({payment:t,card:o,isTextShown:e,firstIcon:r}){let l=yc(useId(),"source-icons"),{t:p}=useTranslation(),a=useCallback(()=>{let s=[],f=bc(t),c=t?.method,g=t?.scheme;return B(c)?.toLowerCase()===B(g)?.toLowerCase()?s.push(B(c),B(f)):s.push(B(c),B(f),B(g)),s},[t]),n=useMemo(()=>jsx(At,{source:r,isTextShown:e,title:p(_(r))},r),[r,e,p]),d=useMemo(()=>a()?.filter(s=>!!s&&s!==r)?.map((s,f,c)=>{let g=t?.wallet===p("sv_wallet")?p("storedValueWallet"):p("passThruWallet"),T=f===c.length-1&&o?.last_four?`${p(_(s))} - ${o?.last_four}`:p(_(s));return jsx(At,{source:s,isTextShown:e,title:f===0&&s==="Wallet"?g:T},`${s}-${f}`)}),[a,t,o,e,p,r]);return jsxs(Box,{id:l,"data-testid":"SourceIcons",display:"flex",alignItems:"center",gap:.5,children:[r&&n,d,o?.last_four&&jsxs(ne,{children:["\xB7\xB7\xB7 ",o?.last_four]})]})}var rt={PROCESSED:Qg,FAILED:""};var se=styled("span")(({theme:t})=>({fontSize:"11px",padding:"2px 0",color:t.palette.text.primary})),le=styled("img")(()=>({width:"16px",height:"16px"})),de=styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function ce({status:t,isTextShown:o,isSheetViewShown:e,chipIndex:r=0,selectionProps:l={}}){let p=useTheme(),{t:a$1}=useTranslation(),n=yc(useId(),"destination-icon"),d=a$1(_(t));return e&&rt[t]?jsx(b,{copyText:d,chipIndex:r,selectionProps:l,children:d}):o&&rt[t]?jsx(se,{id:n,"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:"#1F88D00D",color:t==="PROCESSED"?p.palette.info.dark:p.palette.common.black},children:d}):jsx(de,{id:n,"data-testid":"DestinationIcon",className:"destination-status",children:t&&rt[t]&&jsx(a,{title:a$1(_(t)),children:jsx(le,{src:rt[t],alt:"destination-icon"})})})}export{qa as a,Ka as b,Ja as c,Xa as d,Ya as e,Ce as f,Se as g,Te as h,$o as i,Me as j,Fe as k,qe as l,Xe as m,ot as n,tr as o,rr as p,sr as q,Ra as r,ka as s,Ba as t,ur as u,Cr as v,B as w,At as x,vr as y,ce as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c as c$2}from'./chunk-NBGDT62B.js';import {c,d}from'./chunk-PPC5EHKW.js';import {a,c as c$1,d as d$1}from'./chunk-RMTT4FOG.js';import {b,a as a$1}from'./chunk-O5KFJKRT.js';import {yc,xa}from'./chunk-2CIV4TII.js';import'./chunk-BXMBE224.js';import {ua,$k,al,si,Fk,B,Ud,we,ve,ta,ra,sa}from'./chunk-KCEYICHJ.js';import ho,{memo,createContext,useState,useRef,useId,useMemo,useEffect,useCallback,useContext}from'react';import {styled,Popover,Input,Typography,Box,Dialog}from'@mui/material';import R from'@uiw/react-json-view';import {motion,AnimatePresence}from'framer-motion';import {Resizable}from're-resizable';import jo from'react-draggable';import yo from'@mui/material/Box';import {useTranslation}from'react-i18next';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {styled as styled$1}from'@mui/material/styles';var I=37,Re="32px",J=545;styled(Popover)(({theme:e})=>({backgroundColor:e.palette.background.default,boxShadow:e.shadows[21],"& .MuiPaper-root":{borderRadius:"12px"}}));var go=44,Ie={"--w-rjv-color":"#9cdcfe","--w-rjv-key-string":"#357fb9","--w-rjv-background-color":"#ffffff","--w-rjv-line-color":"#ffffff","--w-rjv-arrow-color":"#116e6bed","--w-rjv-edit-color":"#9cdcfe","--w-rjv-info-color":"#9c9c9c7a","--w-rjv-update-color":"#FFE20B","--w-rjv-copied-color":"#9cdcfe","--w-rjv-copied-success-color":"#28a745","--w-rjv-curlybraces-color":"#000000","--w-rjv-colon-color":"#000000","--w-rjv-brackets-color":"#000000","--w-rjv-quotes-color":"#9cdcfe","--w-rjv-quotes-string-color":"#c27c46","--w-rjv-type-string-color":"#c27c46","--w-rjv-type-int-color":"#956ea5","--w-rjv-type-float-color":"#956ea5","--w-rjv-type-bigint-color":"#956ea5","--w-rjv-type-boolean-color":"#956ea5","--w-rjv-type-date-color":"#956ea5","--w-rjv-type-url-color":"#3b89cf","--w-rjv-type-null-color":"#956ea5","--w-rjv-type-nan-color":"#956ea5","--w-rjv-type-undefined-color":"#956ea5",padding:"1rem",height:`calc(100% - ${go+I}px`,overflow:"auto"},gt={...Ie,background:"transparent","--w-rjv-line-color":"transparent"},ht=styled("button")(({theme:e})=>({padding:"0rem",borderRadius:"0.25rem",backgroundColor:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem",color:e.palette.text.primary,fontSize:"0.625rem",fontWeight:e.typography.fontWeightBold,outline:"none",cursor:"pointer",border:`1px solid ${e.palette.grey[100]}`,"&:hover":{boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark};`},position:"relative",overflow:"hidden",transition:"all 0.2s ease-in-out",width:"24px",height:"24px",flexShrink:0})),Je=styled("button")(({theme:e})=>({outline:"none",cursor:"pointer",border:"1px solid transparent","&:hover":{boxShadow:e.shadows[8]},borderRadius:"0.25rem",position:"relative",backgroundColor:e.palette.background.transparent,display:"inline-flex",alignItems:"center",justifyContent:"center"}));styled(Input)(({theme:e})=>({border:`1px solid ${e.palette.grey[100]}`,borderRadius:"0.25rem",padding:"0.375rem",fontSize:"0.625rem",outline:"none",width:"100%",maxWidth:"150px",height:"1.5rem",backgroundColor:e.palette.background.paper,"&:focus":{border:`1px solid ${e.palette.info.dark}`}}));var ke=styled(Typography)(()=>({border:"1px solid rgba(242, 242, 242, 0.70);",display:"inline-flex",height:"24px",padding:"0px 8px",justifyContent:"center",alignItems:"center",borderRadius:"37.5px",backgroundColor:"#fff"})),Be=styled(Box,{shouldForwardProp:e=>!["isMaximized","isScrollingRequest","isRequestShown"].includes(e)})(({isScrollingRequest:e,isMaximized:t,isRequestShown:i,theme:o})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"4px",paddingBlock:"0px",paddingInlineStart:"12px",paddingInlineEnd:"12px",position:"sticky",left:0,right:0,top:0,background:"#fff",zIndex:5,...e&&{boxShadow:o.shadows[23]},...t&&{paddingTop:Re,transition:"padding 0.3s ease-in-out",...i&&{width:"50%"}}})),Te=styled(Box,{shouldForwardProp:e=>!["isMaximized","isRequestShown"].includes(e)})(({isMaximized:e,isRequestShown:t})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",height:I,position:"fixed",bottom:0,right:0,left:e?"50vw":0,...!t&&{left:0}})),Pe=styled(Box)(()=>({display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",paddingBlock:"10px",paddingInlineStart:"8px",paddingInlineEnd:"0px"})),Ee=styled(Box)(()=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"4px",paddingBlock:"10px",paddingInlineStart:"0px",paddingInlineEnd:"12px"})),xt=styled(motion.div,{shouldForwardProp:e=>!["isRequestShown","isMaximized"].includes(e)})(({isRequestShown:e,isMaximized:t})=>({width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",background:"#fff",zIndex:20,position:"relative",display:"flex",flexDirection:"column",borderBottomRightRadius:"12px",borderBottomLeftRadius:e?0:"12px",...t&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,height:"100vh"}}));styled(motion.div,{shouldForwardProp:e=>!["isMaximized","currentRequestWidth"].includes(e)})(({isMaximized:e,currentRequestWidth:t})=>({backgroundColor:"#E7E7E7B2",backdropFilter:"blur(12px)",height:e?"100vh":"100%",overflowY:"auto",overflowX:"hidden",position:"absolute",width:e?"100vw":t,zIndex:19,display:"flex",flexDirection:"column",borderBottomLeftRadius:"12px"}));styled(Box,{shouldForwardProp:e=>!["isMaximized","currentHeight"].includes(e)})(({isMaximized:e,currentHeight:t})=>({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",height:e?`calc(100vh - ${I}px)`:(t||J)-I+5,background:"transparent",position:"fixed",width:"100%"}));var yt=styled(Box)(()=>({position:"fixed",width:"100%",background:"transparent",height:"100%"})),wt=styled("span")(()=>({color:"#032F62"})),bt=styled("span")(()=>({color:"#357fb9"}));function bo({onClick:e,icon:t,label:i,disableAnimation:o,...n}){let[s,l]=ho.useState(false),{t:d}=useTranslation();return jsxs(ht,{...n,onClick:u=>{e?.(u),!o&&(l(true),setTimeout(()=>{l(false);},2e3));},children:[jsxs(yo,{sx:{width:"16px",display:"flex",overflow:"hidden",justifyContent:"center",alignItems:"center"},children:[jsx(AnimatePresence,{mode:"wait",children:s&&jsx(motion.img,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.4},src:ua,alt:"icon"},"id-icon")}),jsx(AnimatePresence,{mode:"wait",children:!s&&jsx(motion.img,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.4},src:t,alt:"icon"},"id-icon")})]}),i&&jsxs(Fragment,{children:[jsx(AnimatePresence,{children:s&&jsx(motion.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute"},transition:{duration:.4},children:d("copied")})}),jsx(AnimatePresence,{children:!s&&jsx(motion.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute",width:"53px"},transition:{duration:.4},children:i})})]})]})}var St=memo(bo);var H=St;var vt=styled$1("div")(()=>({display:"flex",alignItems:"center",position:"relative",flexShrink:0,width:"24px",height:"24px"})),Ct=styled$1("button")(({theme:e,isActive:t})=>({width:"24px",height:"24px",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",border:`1px solid ${t?e.palette.info.dark:e.palette.grey[100]}`,backgroundColor:e.palette.background.paper,cursor:"pointer",outline:"none",padding:0,position:"relative",zIndex:11,transition:"all 0.2s ease-in-out","&:hover":{boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark}`}})),Rt=styled$1(motion.div)(()=>({position:"absolute",right:0,top:0,height:"24px",display:"flex",alignItems:"center",zIndex:20,background:"transparent"})),It=styled$1(motion.input)(({theme:e})=>({width:"177px",height:"24px",borderRadius:"4px",color:e.palette.text.primary,fontSize:"10px",outline:0,background:e.palette.background.paper,boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark}`,paddingLeft:"8px",boxSizing:"border-box","::placeholder":{color:"#D5D5D5"}})),Oe={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,userSelect:"none"},Jt={...Oe,background:"none",border:"none",padding:0,margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",outline:"none","&:disabled":{opacity:.3,cursor:"default"}},kt=styled$1("button")(()=>({...Jt,right:53})),Bt=styled$1("button")(()=>({...Jt,right:39})),Tt=styled$1(motion.img)(()=>({...Oe,right:24,width:10,height:10,cursor:"pointer"})),Pt=styled$1(motion.img)(()=>({...Oe,right:8,width:11,height:11,cursor:"default"})),Ve=styled$1("img")(()=>({width:10,height:10})),Et=styled$1("img")(()=>({width:12,height:12})),Ht=styled$1("span")(({theme:e})=>({position:"absolute",right:67,top:"50%",transform:"translateY(-50%)",fontSize:"9px",lineHeight:1,color:e.palette.text.secondary,whiteSpace:"nowrap",userSelect:"none",zIndex:2,pointerEvents:"none"}));function Jo({value:e,onChange:t,currentIndex:i,totalCount:o,onPrev:n,onNext:s,onOpen:l,placeholder:d="Search..."}){let[p,u]=useState(false),w=useRef(null),S=e.trim().length>0,k=o>0,a=S,N=()=>{l?.(),u(true),requestAnimationFrame(()=>w.current?.focus());},f=()=>{t(""),u(false);};return jsxs(vt,{children:[jsx(AnimatePresence,{children:p&&jsxs(Rt,{initial:{clipPath:"inset(0 0 0 100%)",opacity:0},animate:{clipPath:"inset(0 0 0 0%)",opacity:1},exit:{clipPath:"inset(0 0 0 100%)",opacity:0},transition:{duration:.22,ease:[.4,0,.2,1]},children:[jsx(It,{ref:w,initial:false,animate:{paddingRight:a?"98px":"24px"},transition:{duration:.15},placeholder:d,value:e,onChange:v=>t(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.shiftKey?n():s()),v.key==="Escape"&&f();},onBlur:()=>{S||u(false);}}),a&&jsx(kt,{onClick:n,disabled:!k,title:"Previous match (Shift+Enter)",children:jsx(Ve,{src:$k,alt:"prev"})}),a&&jsx(Bt,{onClick:s,disabled:!k,title:"Next match (Enter)",children:jsx(Ve,{src:al,alt:"next"})}),a&&jsx(Tt,{src:si,alt:"clear",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:f}),jsx(Pt,{src:Fk,alt:"search",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),a&&jsx(Ht,{children:k?`${i+1}/${o}`:"0/0"})]},"input-area")}),jsx(AnimatePresence,{children:!p&&jsx(motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.15},children:jsx(Ct,{isActive:false,onClick:N,title:"Search",children:jsx(Et,{src:B,alt:"search"})})})})]})}var K=memo(Jo);function Mt(e,t){let i=[],o=t.length,n=0,s=e.indexOf(t,n);for(;s!==-1;){let l=s+o;i.push([s,l]),n=l,s=e.indexOf(t,n);}return i}var ko={padding:0,outline:"none"};function Wt({text:e,queryLength:t,ranges:i,idPrefix:o}){let n=[],s=0;return i.forEach(([l,d],p)=>{l>s&&n.push(e.slice(s,l)),n.push(jsx("mark",{style:ko,children:e.slice(l,l+t)},`${o}-${p}`)),s=d;}),s<e.length&&n.push(e.slice(s)),jsx(Fragment,{children:n})}function W({text:e,query:t}){let i=useId(),o=useMemo(()=>t.trim().toLowerCase(),[t]),n=useMemo(()=>{if(!o)return e;let s=e.toLowerCase(),l=Mt(s,o);return l.length===0?e:jsx(Wt,{text:e,queryLength:t.length,ranges:l,idPrefix:i})},[e,t.length,o,i]);return jsx(Fragment,{children:n})}function re(e,t){return e.toLowerCase().includes(t)}function ie(e){return e.trim().toLowerCase()}function se(e){let t=ie(e);return (i,{keyName:o})=>{if(!t||!o)return;let n=String(o);if(re(n,t))return jsx(bt,{children:jsx(W,{text:String(o),query:e})})}}function ae(e){let t=ie(e);return (i,{value:o})=>{if(!t)return;let n=String(o??"");if(re(n,t))return jsxs(wt,{children:['"',jsx(W,{text:String(o??""),query:e}),'"']})}}function Vo({title:e,onClose:t,onMaximize:i,maximized:o=false,id:n,onMouseHover:s,onMouseLeave:l,onRequestClick:d$2,isRequestExpanded:p=false,showRequestIcon:u=false,isHovered:w=false}){return jsx(c,{id:n,maximized:o||false,children:jsx(d,{isHovered:true,onMouseEnter:s,onMouseLeave:l,isMaximized:o,title:e,icon:Ud,leftActions:jsxs(Fragment,{children:[jsx(a,{onClick:t}),jsx(c$1,{isMaximized:o,onClick:i}),u&&jsx(d$1,{onClick:d$2,isExpanded:p,isHovered:w,children:"Request"})]})})})}var jt=memo(Vo);var Me=jt;var Ft="#FFE20B";function le(e,t){let[i,o]=useState(0),[n,s]=useState(0);useEffect(()=>{if(!t.trim()){s(0),o(0);return}let p=setTimeout(()=>{let u=e.current?.querySelectorAll("mark")??[];s(u.length),o(0);},50);return ()=>clearTimeout(p)},[t,e]),useEffect(()=>{if(!e.current||!t.trim())return;let p=Array.from(e.current.querySelectorAll("mark"));p.forEach((u,w)=>{let S=w===i;u.style.backgroundColor=S?Ft:"transparent",u.style.outline=S?`1px solid ${Ft}`:"none",u.style.borderRadius="2px";}),p[i]?.scrollIntoView({behavior:"smooth",block:"nearest"});},[i,n,t,e]);let l=useCallback(()=>{n!==0&&o(p=>(p+1)%n);},[n]),d=useCallback(()=>{n!==0&&o(p=>(p-1+n)%n);},[n]);return {currentIndex:i,totalCount:n,goNext:l,goPrev:d}}function Kt(e,t){return e==null?String(e).includes(t):typeof e=="string"?e.toLowerCase().includes(t):typeof e=="number"||typeof e=="boolean"?String(e).includes(t):false}function $t(e,t){if(Array.isArray(e)){let i=e.map(o=>$t(o,t)).filter(o=>o!=null);return i.length>0?i:null}return typeof e=="object"&&e!==null?Gt(e,t):Kt(e,t)?e:null}function Gt(e,t){let i={};for(let[o,n]of Object.entries(e))if(o.toLowerCase().includes(t))i[o]=n;else if(typeof n=="object"&&n!==null){let s=$t(n,t);s!==null&&(i[o]=s);}else Kt(n,t)&&(i[o]=n);return Object.keys(i).length>0?i:null}function ze(e,t){return t.trim()?Gt(e,t.toLowerCase()):e}var G=400,L=.5;function Y({index:e,json:t,requestJson:i={},isWindowMinimized:o,windowOrder:n,onClose:s,onJsonRequestOpen:l,onJsonSearch:d,onJsonCopy:p,onJsonIdCopy:u,onJsonNodesMinimize:w,onJsonNodesMaximize:S}){let k=yc(useId(),"json-viewer"),[a,N]=useState(false),[f,O]=useState(false),[V,M]=useState(false),[v,qe]=useState(false),[je,eo]=useState({width:0,height:0}),[ue,z]=useState(true),[g,to]=useState(false),[fe,oo]=useState(true),[no,De]=useState(false),[Q,Le]=useState(G),[B,ro]=useState(""),[T,io]=useState(""),_e=useRef(null),Fe=useRef(null),U=le(_e,B),Z=le(Fe,T),me=useRef(),{onMouseEnter:so,onMouseLeave:ao,isHovered:lo}=b(),{height:ge,width:_}=a$1(),[Ke,po]=useState({x:_/2+G/4-e*20,y:ge/2-J/2+e*30}),ee=useRef(),co=useMemo(()=>Object.keys(t)?.length,[t]),$e=xa(),P=Number(ee.current?.state?.width)||G,Ge=c=>{setTimeout(()=>{navigator.clipboard.writeText(c||"").then(()=>{});},10);},Ye=useMemo(()=>Object.keys(i)?.length,[i]),Xe=useMemo(()=>ze(t,B),[t,B]),Qe=useMemo(()=>ze(i,T),[i,T]);return useEffect(()=>{if(me.current&&clearTimeout(me.current),!g){me.current=setTimeout(()=>{Le(P);},L*1e3);return}Le(P);},[g,P]),jsx(jo,{disabled:a,handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]',defaultPosition:{x:_/2-G/4,y:ge/2-J/2},position:{x:_-Ke.x,y:Ke.y},onStop:(c,m)=>{po({x:_-m.x,y:m.y});},bounds:{top:10},children:jsx(Dialog,{id:k,"data-testid":"JSONViewer",disableEnforceFocus:true,sx:{backgroundColor:"transparent",zIndex:(n||0)+3+(a?1:0),...o&&{display:"none"},transform:"translate(180px, 14px)",...!a&&{width:$e?je?.width||Q:"fit-content",height:$e?je?.height||J:"fit-content"},...a&&{transform:"none !important"}},PaperProps:{style:{margin:0,maxHeight:"100%",maxWidth:"none",background:"transparent",width:f?"fit-content":Q,height:f?"fit-content":J,...a&&{width:"100%",height:"100%"},position:"relative"}},onClose:()=>{N(false),z(true),setTimeout(()=>{z(false);},L*1e3);},open:true,hideBackdrop:true,fullScreen:a,"aria-labelledby":"draggable-dialog-title",children:jsx(Resizable,{enable:{left:false,right:true,bottomRight:true,bottom:true},maxHeight:ge-40,maxWidth:_,minWidth:a?"100vw":Q,minHeight:a?"100vh":"300px",ref:c=>{ee.current=c;},onResizeStart:()=>{z(true);},onResizeStop:()=>{z(false);},onResize:(c,m,A)=>{O(true),eo({width:A.offsetWidth,height:A.offsetHeight});},defaultSize:{width:Q,height:J},style:{background:"transparent",...a&&{height:"100% !important",width:"100% !important",flex:1},...a&&{position:"relative"}},children:jsxs(yt,{children:[jsx(motion.div,{style:{...a&&{height:Re,position:"fixed",zIndex:1e3}},animate:{width:g?P*2:P,...a&&{width:"100vw"},...!a&&{transform:`translateX(${g?-P:0}px)`}},transition:{duration:L,...ue&&{duration:0}},children:jsx(Me,{title:g?"JSON Request & Response":"JSON Response",onClose:()=>s(),onMaximize:()=>{N(c=>!c),z(true),setTimeout(()=>{z(false);},L*1e3);},isHovered:lo,onMouseHover:so,onMouseLeave:ao,maximized:a,id:"draggable-dialog-title",onRequestClick:()=>{to(c=>!c),z(false),g||(l?.(),ee.current?.updateSize({width:G,height:J}));},isRequestExpanded:g,showRequestIcon:!!Ye})}),jsxs(Box,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",height:a?`calc(100vh - ${I}px)`:(Number(ee.current?.state?.height)||J)-I+5,background:"transparent",position:"fixed",width:"100%"},children:[jsx(AnimatePresence,{children:g&&jsxs(motion.div,{initial:{left:a?"50vw":0,...a&&{position:"relative",left:"-50vw"}},animate:{left:a?"50vw":-P,...a&&{position:"relative",left:"0"},...!g&&{left:0}},exit:{left:a?"50vw":0,...a&&{position:"relative",left:"0"}},transition:{duration:L,...ue&&{duration:0}},ref:Fe,style:{flex:1,backgroundColor:"#E7E7E7B2",backdropFilter:"blur(12px)",height:a?"100vh":"100%",overflowY:"auto",position:"absolute",width:a?"100vw":P,zIndex:19,display:"flex",flexDirection:"column",borderBottomLeftRadius:"12px"},onScroll:()=>{De(true),setTimeout(()=>{De(false);},2e3);},children:[jsxs(Be,{isMaximized:a,isScrollingRequest:no,sx:{background:"#E7E7E7B2"},isRequestShown:g,children:[jsx(Ee,{children:jsx(ke,{variant:"subtitle1",children:"API Request"})}),jsxs(Pe,{children:[jsx(K,{value:T,onChange:io,onOpen:()=>d?.(),currentIndex:Z.currentIndex,totalCount:Z.totalCount,onPrev:Z.goPrev,onNext:Z.goNext}),jsx(H,{disableAnimation:true,onClick:()=>{fe?S?.():w?.(),oo(c=>!c);},icon:fe?we:ve}),jsx(H,{onClick:()=>{p?.(),navigator.clipboard.writeText(JSON.stringify(t)).then(()=>{});},icon:ta}),jsx(H,{onClick:()=>{u?.(),navigator.clipboard.writeText(t?.id||"").then(()=>{});},icon:ra})]})]}),T.trim()&&Qe===null?jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(Typography,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsxs(R,{value:Qe??i,style:gt,displayDataTypes:false,collapsed:T.trim()?void 0:fe?1:void 0,onCopied:(c,m)=>{typeof m=="string"&&Ge(m);},enableClipboard:false,children:[jsx(R.String,{render:ae(T)}),jsx(R.KeyName,{render:se(T)}),jsx(R.CountInfo,{render:(c,{keyName:m})=>{if(!m)return jsx("span",{})}}),jsx(R.Copied,{render:({"data-copied":c,style:m,onClick:A},{keyName:he})=>he?jsxs(Je,{style:m,onClick:xe=>{A?.(xe);},children:[jsx(AnimatePresence,{children:c&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:ua,alt:"icon"},"id-icon")}),jsx(AnimatePresence,{children:!c&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:sa,alt:"icon"},"id-icon")})]}):jsx("span",{})})]}),jsx(AnimatePresence,{children:g&&jsx(Te,{sx:{flex:1,height:I,left:0},children:jsx(c$2,{sx:{paddingLeft:"12px",borderBottomRightRadius:"0",background:"#f8f9fb",flex:1},totalCount:Ye})})})]})}),jsxs(xt,{ref:_e,isMaximized:a,isRequestShown:g,style:{left:0,maxHeight:"100vw"},initial:{...a&&{width:"100vw",left:0}},animate:{...a&&{position:"absolute",left:g?"50vw":"0"}},transition:{duration:L,...ue&&{duration:0}},onScroll:()=>{qe(true),setTimeout(()=>{qe(false);},2e3);},children:[jsxs(Be,{isMaximized:a,isScrollingRequest:v,isRequestShown:g,children:[jsx(Ee,{children:jsx(ke,{variant:"subtitle1",children:"API Response"})}),jsxs(Pe,{children:[jsx(K,{value:B,onChange:ro,onOpen:()=>d?.(),currentIndex:U.currentIndex,totalCount:U.totalCount,onPrev:U.goPrev,onNext:U.goNext}),jsx(H,{disableAnimation:true,onClick:()=>{V?S?.():w?.(),M(c=>!c);},icon:V?we:ve}),jsx(H,{onClick:()=>{p?.(),navigator.clipboard.writeText(JSON.stringify(t,null,2)).then(()=>{});},icon:ta}),jsx(H,{onClick:()=>{u?.(),navigator.clipboard.writeText(t?.id||"").then(()=>{});},icon:ra})]})]}),B.trim()&&Xe===null?jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(Typography,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsxs(R,{value:Xe??t,style:Ie,displayDataTypes:false,collapsed:B.trim()?void 0:V?1:void 0,onCopied:(c,m)=>{typeof m=="string"&&Ge(m);},children:[jsx(R.String,{render:ae(B)}),jsx(R.KeyName,{render:se(B)}),jsx(R.CountInfo,{render:(c,{keyName:m})=>{if(!m)return jsx("span",{})}}),jsx(R.Copied,{render:({"data-copied":c,style:m,onClick:A},{keyName:he})=>he?jsxs(Je,{style:m,onClick:xe=>{A?.(xe);},children:[jsx(AnimatePresence,{children:c&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:ua,alt:"icon"},"id-icon")}),jsx(AnimatePresence,{children:!c&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:sa,alt:"icon"},"id-icon")})]}):jsx("span",{})})]}),jsx(Te,{sx:{flex:1,height:I},children:jsx(c$2,{sx:{borderBottomLeftRadius:g?0:"12px",background:"#f8f9fb",flex:1},totalCount:co})})]})]})]})})})})}var ce=createContext({jsonViewerList:[],handleJsonViewerDialogOpen:()=>{},handleWindowMinimize:()=>{},handleWindowOrder:()=>{},registerJsonViewerEvents:()=>{}});var Qt=({list:e,events:t,onClose:i,isWindowMinimized:o,windowOrder:n})=>e?.length?jsx(Fragment,{children:e.map((s,l)=>jsx(Y,{index:l,...t,...s,onClose:()=>{i(l);},isWindowMinimized:o,windowOrder:n},s.json.id))}):null;var Fo=({children:e})=>{let[t,i]=useState([]),[o,n]=useState(false),[s,l]=useState(1),d=useRef({}),p=useCallback(f=>{if(t.length===7){alert("Maximum allowed active Json Viewer is 7 per table.");return}if(t.some(v=>v.json.id===f.json.id))return;let O=structuredClone(f.json),V=O.request_body,M={...f,json:O,requestJson:f.requestJson||V||void 0};delete M.json.request_body,i(v=>[...v,M]);},[t]),u=useCallback(f=>{i(O=>O.filter((V,M)=>f!==M));},[]),w=useCallback(f=>{n(f);},[]),S=useCallback(f=>{l(f);},[]),k=useCallback(f=>{d.current=f;},[]),a=useMemo(()=>({onJsonRequestOpen:()=>d.current.onJsonRequestOpen?.(),onJsonSearch:()=>d.current.onJsonSearch?.(),onJsonCopy:()=>d.current.onJsonCopy?.(),onJsonIdCopy:()=>d.current.onJsonIdCopy?.(),onJsonNodesMinimize:()=>d.current.onJsonNodesMinimize?.(),onJsonNodesMaximize:()=>d.current.onJsonNodesMaximize?.()}),[]),N=useMemo(()=>({jsonViewerList:t,handleJsonViewerDialogOpen:p,handleWindowMinimize:w,handleWindowOrder:S,registerJsonViewerEvents:k}),[t,p,w,S,k]);return jsxs(ce.Provider,{value:N,children:[e,jsx(Qt,{list:t,events:a,onClose:u,isWindowMinimized:o,windowOrder:s})]})};var Yo=({isWindowMinimized:e,windowOrder:t,...i})=>{let{handleJsonViewerDialogOpen:o,handleWindowMinimize:n,handleWindowOrder:s,registerJsonViewerEvents:l}=useContext(ce),d=useCallback(()=>{n(e);},[n,e]),p=useCallback(()=>{s(t);},[s,t]);return useEffect(()=>{p();},[p]),useEffect(()=>{d();},[d]),useEffect(()=>{l(i);},[l,i]),{handleJsonViewerDialogOpen:o}};var ti=Y;export{H as a,K as b,W as c,Me as d,le as e,ce as f,Qt as g,Fo as h,Yo as i,ti as j};
|
|
1
|
+
import {c as c$2}from'./chunk-NBGDT62B.js';import {a,c as c$1,d as d$1}from'./chunk-RMTT4FOG.js';import {c,d}from'./chunk-PPC5EHKW.js';import {b,a as a$1}from'./chunk-O5KFJKRT.js';import {yc,xa}from'./chunk-2CIV4TII.js';import'./chunk-BXMBE224.js';import {ua,$k,al,si,Fk,B,Ud,we,ve,ta,ra,sa}from'./chunk-KCEYICHJ.js';import ho,{memo,createContext,useState,useRef,useId,useMemo,useEffect,useCallback,useContext}from'react';import {styled,Popover,Input,Typography,Box,Dialog}from'@mui/material';import R from'@uiw/react-json-view';import {motion,AnimatePresence}from'framer-motion';import {Resizable}from're-resizable';import jo from'react-draggable';import yo from'@mui/material/Box';import {useTranslation}from'react-i18next';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {styled as styled$1}from'@mui/material/styles';var I=37,Re="32px",J=545;styled(Popover)(({theme:e})=>({backgroundColor:e.palette.background.default,boxShadow:e.shadows[21],"& .MuiPaper-root":{borderRadius:"12px"}}));var go=44,Ie={"--w-rjv-color":"#9cdcfe","--w-rjv-key-string":"#357fb9","--w-rjv-background-color":"#ffffff","--w-rjv-line-color":"#ffffff","--w-rjv-arrow-color":"#116e6bed","--w-rjv-edit-color":"#9cdcfe","--w-rjv-info-color":"#9c9c9c7a","--w-rjv-update-color":"#FFE20B","--w-rjv-copied-color":"#9cdcfe","--w-rjv-copied-success-color":"#28a745","--w-rjv-curlybraces-color":"#000000","--w-rjv-colon-color":"#000000","--w-rjv-brackets-color":"#000000","--w-rjv-quotes-color":"#9cdcfe","--w-rjv-quotes-string-color":"#c27c46","--w-rjv-type-string-color":"#c27c46","--w-rjv-type-int-color":"#956ea5","--w-rjv-type-float-color":"#956ea5","--w-rjv-type-bigint-color":"#956ea5","--w-rjv-type-boolean-color":"#956ea5","--w-rjv-type-date-color":"#956ea5","--w-rjv-type-url-color":"#3b89cf","--w-rjv-type-null-color":"#956ea5","--w-rjv-type-nan-color":"#956ea5","--w-rjv-type-undefined-color":"#956ea5",padding:"1rem",height:`calc(100% - ${go+I}px`,overflow:"auto"},gt={...Ie,background:"transparent","--w-rjv-line-color":"transparent"},ht=styled("button")(({theme:e})=>({padding:"0rem",borderRadius:"0.25rem",backgroundColor:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem",color:e.palette.text.primary,fontSize:"0.625rem",fontWeight:e.typography.fontWeightBold,outline:"none",cursor:"pointer",border:`1px solid ${e.palette.grey[100]}`,"&:hover":{boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark};`},position:"relative",overflow:"hidden",transition:"all 0.2s ease-in-out",width:"24px",height:"24px",flexShrink:0})),Je=styled("button")(({theme:e})=>({outline:"none",cursor:"pointer",border:"1px solid transparent","&:hover":{boxShadow:e.shadows[8]},borderRadius:"0.25rem",position:"relative",backgroundColor:e.palette.background.transparent,display:"inline-flex",alignItems:"center",justifyContent:"center"}));styled(Input)(({theme:e})=>({border:`1px solid ${e.palette.grey[100]}`,borderRadius:"0.25rem",padding:"0.375rem",fontSize:"0.625rem",outline:"none",width:"100%",maxWidth:"150px",height:"1.5rem",backgroundColor:e.palette.background.paper,"&:focus":{border:`1px solid ${e.palette.info.dark}`}}));var ke=styled(Typography)(()=>({border:"1px solid rgba(242, 242, 242, 0.70);",display:"inline-flex",height:"24px",padding:"0px 8px",justifyContent:"center",alignItems:"center",borderRadius:"37.5px",backgroundColor:"#fff"})),Be=styled(Box,{shouldForwardProp:e=>!["isMaximized","isScrollingRequest","isRequestShown"].includes(e)})(({isScrollingRequest:e,isMaximized:t,isRequestShown:i,theme:o})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"4px",paddingBlock:"0px",paddingInlineStart:"12px",paddingInlineEnd:"12px",position:"sticky",left:0,right:0,top:0,background:"#fff",zIndex:5,...e&&{boxShadow:o.shadows[23]},...t&&{paddingTop:Re,transition:"padding 0.3s ease-in-out",...i&&{width:"50%"}}})),Te=styled(Box,{shouldForwardProp:e=>!["isMaximized","isRequestShown"].includes(e)})(({isMaximized:e,isRequestShown:t})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",height:I,position:"fixed",bottom:0,right:0,left:e?"50vw":0,...!t&&{left:0}})),Pe=styled(Box)(()=>({display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",paddingBlock:"10px",paddingInlineStart:"8px",paddingInlineEnd:"0px"})),Ee=styled(Box)(()=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"4px",paddingBlock:"10px",paddingInlineStart:"0px",paddingInlineEnd:"12px"})),xt=styled(motion.div,{shouldForwardProp:e=>!["isRequestShown","isMaximized"].includes(e)})(({isRequestShown:e,isMaximized:t})=>({width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",background:"#fff",zIndex:20,position:"relative",display:"flex",flexDirection:"column",borderBottomRightRadius:"12px",borderBottomLeftRadius:e?0:"12px",...t&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,height:"100vh"}}));styled(motion.div,{shouldForwardProp:e=>!["isMaximized","currentRequestWidth"].includes(e)})(({isMaximized:e,currentRequestWidth:t})=>({backgroundColor:"#E7E7E7B2",backdropFilter:"blur(12px)",height:e?"100vh":"100%",overflowY:"auto",overflowX:"hidden",position:"absolute",width:e?"100vw":t,zIndex:19,display:"flex",flexDirection:"column",borderBottomLeftRadius:"12px"}));styled(Box,{shouldForwardProp:e=>!["isMaximized","currentHeight"].includes(e)})(({isMaximized:e,currentHeight:t})=>({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",height:e?`calc(100vh - ${I}px)`:(t||J)-I+5,background:"transparent",position:"fixed",width:"100%"}));var yt=styled(Box)(()=>({position:"fixed",width:"100%",background:"transparent",height:"100%"})),wt=styled("span")(()=>({color:"#032F62"})),bt=styled("span")(()=>({color:"#357fb9"}));function bo({onClick:e,icon:t,label:i,disableAnimation:o,...n}){let[s,l]=ho.useState(false),{t:d}=useTranslation();return jsxs(ht,{...n,onClick:u=>{e?.(u),!o&&(l(true),setTimeout(()=>{l(false);},2e3));},children:[jsxs(yo,{sx:{width:"16px",display:"flex",overflow:"hidden",justifyContent:"center",alignItems:"center"},children:[jsx(AnimatePresence,{mode:"wait",children:s&&jsx(motion.img,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.4},src:ua,alt:"icon"},"id-icon")}),jsx(AnimatePresence,{mode:"wait",children:!s&&jsx(motion.img,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.4},src:t,alt:"icon"},"id-icon")})]}),i&&jsxs(Fragment,{children:[jsx(AnimatePresence,{children:s&&jsx(motion.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute"},transition:{duration:.4},children:d("copied")})}),jsx(AnimatePresence,{children:!s&&jsx(motion.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute",width:"53px"},transition:{duration:.4},children:i})})]})]})}var St=memo(bo);var H=St;var vt=styled$1("div")(()=>({display:"flex",alignItems:"center",position:"relative",flexShrink:0,width:"24px",height:"24px"})),Ct=styled$1("button")(({theme:e,isActive:t})=>({width:"24px",height:"24px",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",border:`1px solid ${t?e.palette.info.dark:e.palette.grey[100]}`,backgroundColor:e.palette.background.paper,cursor:"pointer",outline:"none",padding:0,position:"relative",zIndex:11,transition:"all 0.2s ease-in-out","&:hover":{boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark}`}})),Rt=styled$1(motion.div)(()=>({position:"absolute",right:0,top:0,height:"24px",display:"flex",alignItems:"center",zIndex:20,background:"transparent"})),It=styled$1(motion.input)(({theme:e})=>({width:"177px",height:"24px",borderRadius:"4px",color:e.palette.text.primary,fontSize:"10px",outline:0,background:e.palette.background.paper,boxShadow:"0px 0px 8px 0px rgba(31, 136, 208, 0.30)",border:`1px solid ${e.palette.info.dark}`,paddingLeft:"8px",boxSizing:"border-box","::placeholder":{color:"#D5D5D5"}})),Oe={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,userSelect:"none"},Jt={...Oe,background:"none",border:"none",padding:0,margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",outline:"none","&:disabled":{opacity:.3,cursor:"default"}},kt=styled$1("button")(()=>({...Jt,right:53})),Bt=styled$1("button")(()=>({...Jt,right:39})),Tt=styled$1(motion.img)(()=>({...Oe,right:24,width:10,height:10,cursor:"pointer"})),Pt=styled$1(motion.img)(()=>({...Oe,right:8,width:11,height:11,cursor:"default"})),Ve=styled$1("img")(()=>({width:10,height:10})),Et=styled$1("img")(()=>({width:12,height:12})),Ht=styled$1("span")(({theme:e})=>({position:"absolute",right:67,top:"50%",transform:"translateY(-50%)",fontSize:"9px",lineHeight:1,color:e.palette.text.secondary,whiteSpace:"nowrap",userSelect:"none",zIndex:2,pointerEvents:"none"}));function Jo({value:e,onChange:t,currentIndex:i,totalCount:o,onPrev:n,onNext:s,onOpen:l,placeholder:d="Search..."}){let[p,u]=useState(false),w=useRef(null),S=e.trim().length>0,k=o>0,a=S,N=()=>{l?.(),u(true),requestAnimationFrame(()=>w.current?.focus());},f=()=>{t(""),u(false);};return jsxs(vt,{children:[jsx(AnimatePresence,{children:p&&jsxs(Rt,{initial:{clipPath:"inset(0 0 0 100%)",opacity:0},animate:{clipPath:"inset(0 0 0 0%)",opacity:1},exit:{clipPath:"inset(0 0 0 100%)",opacity:0},transition:{duration:.22,ease:[.4,0,.2,1]},children:[jsx(It,{ref:w,initial:false,animate:{paddingRight:a?"98px":"24px"},transition:{duration:.15},placeholder:d,value:e,onChange:v=>t(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.shiftKey?n():s()),v.key==="Escape"&&f();},onBlur:()=>{S||u(false);}}),a&&jsx(kt,{onClick:n,disabled:!k,title:"Previous match (Shift+Enter)",children:jsx(Ve,{src:$k,alt:"prev"})}),a&&jsx(Bt,{onClick:s,disabled:!k,title:"Next match (Enter)",children:jsx(Ve,{src:al,alt:"next"})}),a&&jsx(Tt,{src:si,alt:"clear",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:f}),jsx(Pt,{src:Fk,alt:"search",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),a&&jsx(Ht,{children:k?`${i+1}/${o}`:"0/0"})]},"input-area")}),jsx(AnimatePresence,{children:!p&&jsx(motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.15},children:jsx(Ct,{isActive:false,onClick:N,title:"Search",children:jsx(Et,{src:B,alt:"search"})})})})]})}var K=memo(Jo);function Mt(e,t){let i=[],o=t.length,n=0,s=e.indexOf(t,n);for(;s!==-1;){let l=s+o;i.push([s,l]),n=l,s=e.indexOf(t,n);}return i}var ko={padding:0,outline:"none"};function Wt({text:e,queryLength:t,ranges:i,idPrefix:o}){let n=[],s=0;return i.forEach(([l,d],p)=>{l>s&&n.push(e.slice(s,l)),n.push(jsx("mark",{style:ko,children:e.slice(l,l+t)},`${o}-${p}`)),s=d;}),s<e.length&&n.push(e.slice(s)),jsx(Fragment,{children:n})}function W({text:e,query:t}){let i=useId(),o=useMemo(()=>t.trim().toLowerCase(),[t]),n=useMemo(()=>{if(!o)return e;let s=e.toLowerCase(),l=Mt(s,o);return l.length===0?e:jsx(Wt,{text:e,queryLength:t.length,ranges:l,idPrefix:i})},[e,t.length,o,i]);return jsx(Fragment,{children:n})}function re(e,t){return e.toLowerCase().includes(t)}function ie(e){return e.trim().toLowerCase()}function se(e){let t=ie(e);return (i,{keyName:o})=>{if(!t||!o)return;let n=String(o);if(re(n,t))return jsx(bt,{children:jsx(W,{text:String(o),query:e})})}}function ae(e){let t=ie(e);return (i,{value:o})=>{if(!t)return;let n=String(o??"");if(re(n,t))return jsxs(wt,{children:['"',jsx(W,{text:String(o??""),query:e}),'"']})}}function Vo({title:e,onClose:t,onMaximize:i,maximized:o=false,id:n,onMouseHover:s,onMouseLeave:l,onRequestClick:d$2,isRequestExpanded:p=false,showRequestIcon:u=false,isHovered:w=false}){return jsx(c,{id:n,maximized:o||false,children:jsx(d,{isHovered:true,onMouseEnter:s,onMouseLeave:l,isMaximized:o,title:e,icon:Ud,leftActions:jsxs(Fragment,{children:[jsx(a,{onClick:t}),jsx(c$1,{isMaximized:o,onClick:i}),u&&jsx(d$1,{onClick:d$2,isExpanded:p,isHovered:w,children:"Request"})]})})})}var jt=memo(Vo);var Me=jt;var Ft="#FFE20B";function le(e,t){let[i,o]=useState(0),[n,s]=useState(0);useEffect(()=>{if(!t.trim()){s(0),o(0);return}let p=setTimeout(()=>{let u=e.current?.querySelectorAll("mark")??[];s(u.length),o(0);},50);return ()=>clearTimeout(p)},[t,e]),useEffect(()=>{if(!e.current||!t.trim())return;let p=Array.from(e.current.querySelectorAll("mark"));p.forEach((u,w)=>{let S=w===i;u.style.backgroundColor=S?Ft:"transparent",u.style.outline=S?`1px solid ${Ft}`:"none",u.style.borderRadius="2px";}),p[i]?.scrollIntoView({behavior:"smooth",block:"nearest"});},[i,n,t,e]);let l=useCallback(()=>{n!==0&&o(p=>(p+1)%n);},[n]),d=useCallback(()=>{n!==0&&o(p=>(p-1+n)%n);},[n]);return {currentIndex:i,totalCount:n,goNext:l,goPrev:d}}function Kt(e,t){return e==null?String(e).includes(t):typeof e=="string"?e.toLowerCase().includes(t):typeof e=="number"||typeof e=="boolean"?String(e).includes(t):false}function $t(e,t){if(Array.isArray(e)){let i=e.map(o=>$t(o,t)).filter(o=>o!=null);return i.length>0?i:null}return typeof e=="object"&&e!==null?Gt(e,t):Kt(e,t)?e:null}function Gt(e,t){let i={};for(let[o,n]of Object.entries(e))if(o.toLowerCase().includes(t))i[o]=n;else if(typeof n=="object"&&n!==null){let s=$t(n,t);s!==null&&(i[o]=s);}else Kt(n,t)&&(i[o]=n);return Object.keys(i).length>0?i:null}function ze(e,t){return t.trim()?Gt(e,t.toLowerCase()):e}var G=400,L=.5;function Y({index:e,json:t,requestJson:i={},isWindowMinimized:o,windowOrder:n,onClose:s,onJsonRequestOpen:l,onJsonSearch:d,onJsonCopy:p,onJsonIdCopy:u,onJsonNodesMinimize:w,onJsonNodesMaximize:S}){let k=yc(useId(),"json-viewer"),[a,N]=useState(false),[f,O]=useState(false),[V,M]=useState(false),[v,qe]=useState(false),[je,eo]=useState({width:0,height:0}),[ue,z]=useState(true),[g,to]=useState(false),[fe,oo]=useState(true),[no,De]=useState(false),[Q,Le]=useState(G),[B,ro]=useState(""),[T,io]=useState(""),_e=useRef(null),Fe=useRef(null),U=le(_e,B),Z=le(Fe,T),me=useRef(),{onMouseEnter:so,onMouseLeave:ao,isHovered:lo}=b(),{height:ge,width:_}=a$1(),[Ke,po]=useState({x:_/2+G/4-e*20,y:ge/2-J/2+e*30}),ee=useRef(),co=useMemo(()=>Object.keys(t)?.length,[t]),$e=xa(),P=Number(ee.current?.state?.width)||G,Ge=c=>{setTimeout(()=>{navigator.clipboard.writeText(c||"").then(()=>{});},10);},Ye=useMemo(()=>Object.keys(i)?.length,[i]),Xe=useMemo(()=>ze(t,B),[t,B]),Qe=useMemo(()=>ze(i,T),[i,T]);return useEffect(()=>{if(me.current&&clearTimeout(me.current),!g){me.current=setTimeout(()=>{Le(P);},L*1e3);return}Le(P);},[g,P]),jsx(jo,{disabled:a,handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]',defaultPosition:{x:_/2-G/4,y:ge/2-J/2},position:{x:_-Ke.x,y:Ke.y},onStop:(c,m)=>{po({x:_-m.x,y:m.y});},bounds:{top:10},children:jsx(Dialog,{id:k,"data-testid":"JSONViewer",disableEnforceFocus:true,sx:{backgroundColor:"transparent",zIndex:(n||0)+3+(a?1:0),...o&&{display:"none"},transform:"translate(180px, 14px)",...!a&&{width:$e?je?.width||Q:"fit-content",height:$e?je?.height||J:"fit-content"},...a&&{transform:"none !important"}},PaperProps:{style:{margin:0,maxHeight:"100%",maxWidth:"none",background:"transparent",width:f?"fit-content":Q,height:f?"fit-content":J,...a&&{width:"100%",height:"100%"},position:"relative"}},onClose:()=>{N(false),z(true),setTimeout(()=>{z(false);},L*1e3);},open:true,hideBackdrop:true,fullScreen:a,"aria-labelledby":"draggable-dialog-title",children:jsx(Resizable,{enable:{left:false,right:true,bottomRight:true,bottom:true},maxHeight:ge-40,maxWidth:_,minWidth:a?"100vw":Q,minHeight:a?"100vh":"300px",ref:c=>{ee.current=c;},onResizeStart:()=>{z(true);},onResizeStop:()=>{z(false);},onResize:(c,m,A)=>{O(true),eo({width:A.offsetWidth,height:A.offsetHeight});},defaultSize:{width:Q,height:J},style:{background:"transparent",...a&&{height:"100% !important",width:"100% !important",flex:1},...a&&{position:"relative"}},children:jsxs(yt,{children:[jsx(motion.div,{style:{...a&&{height:Re,position:"fixed",zIndex:1e3}},animate:{width:g?P*2:P,...a&&{width:"100vw"},...!a&&{transform:`translateX(${g?-P:0}px)`}},transition:{duration:L,...ue&&{duration:0}},children:jsx(Me,{title:g?"JSON Request & Response":"JSON Response",onClose:()=>s(),onMaximize:()=>{N(c=>!c),z(true),setTimeout(()=>{z(false);},L*1e3);},isHovered:lo,onMouseHover:so,onMouseLeave:ao,maximized:a,id:"draggable-dialog-title",onRequestClick:()=>{to(c=>!c),z(false),g||(l?.(),ee.current?.updateSize({width:G,height:J}));},isRequestExpanded:g,showRequestIcon:!!Ye})}),jsxs(Box,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",height:a?`calc(100vh - ${I}px)`:(Number(ee.current?.state?.height)||J)-I+5,background:"transparent",position:"fixed",width:"100%"},children:[jsx(AnimatePresence,{children:g&&jsxs(motion.div,{initial:{left:a?"50vw":0,...a&&{position:"relative",left:"-50vw"}},animate:{left:a?"50vw":-P,...a&&{position:"relative",left:"0"},...!g&&{left:0}},exit:{left:a?"50vw":0,...a&&{position:"relative",left:"0"}},transition:{duration:L,...ue&&{duration:0}},ref:Fe,style:{flex:1,backgroundColor:"#E7E7E7B2",backdropFilter:"blur(12px)",height:a?"100vh":"100%",overflowY:"auto",position:"absolute",width:a?"100vw":P,zIndex:19,display:"flex",flexDirection:"column",borderBottomLeftRadius:"12px"},onScroll:()=>{De(true),setTimeout(()=>{De(false);},2e3);},children:[jsxs(Be,{isMaximized:a,isScrollingRequest:no,sx:{background:"#E7E7E7B2"},isRequestShown:g,children:[jsx(Ee,{children:jsx(ke,{variant:"subtitle1",children:"API Request"})}),jsxs(Pe,{children:[jsx(K,{value:T,onChange:io,onOpen:()=>d?.(),currentIndex:Z.currentIndex,totalCount:Z.totalCount,onPrev:Z.goPrev,onNext:Z.goNext}),jsx(H,{disableAnimation:true,onClick:()=>{fe?S?.():w?.(),oo(c=>!c);},icon:fe?we:ve}),jsx(H,{onClick:()=>{p?.(),navigator.clipboard.writeText(JSON.stringify(t)).then(()=>{});},icon:ta}),jsx(H,{onClick:()=>{u?.(),navigator.clipboard.writeText(t?.id||"").then(()=>{});},icon:ra})]})]}),T.trim()&&Qe===null?jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(Typography,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsxs(R,{value:Qe??i,style:gt,displayDataTypes:false,collapsed:T.trim()?void 0:fe?1:void 0,onCopied:(c,m)=>{typeof m=="string"&&Ge(m);},enableClipboard:false,children:[jsx(R.String,{render:ae(T)}),jsx(R.KeyName,{render:se(T)}),jsx(R.CountInfo,{render:(c,{keyName:m})=>{if(!m)return jsx("span",{})}}),jsx(R.Copied,{render:({"data-copied":c,style:m,onClick:A},{keyName:he})=>he?jsxs(Je,{style:m,onClick:xe=>{A?.(xe);},children:[jsx(AnimatePresence,{children:c&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:ua,alt:"icon"},"id-icon")}),jsx(AnimatePresence,{children:!c&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:sa,alt:"icon"},"id-icon")})]}):jsx("span",{})})]}),jsx(AnimatePresence,{children:g&&jsx(Te,{sx:{flex:1,height:I,left:0},children:jsx(c$2,{sx:{paddingLeft:"12px",borderBottomRightRadius:"0",background:"#f8f9fb",flex:1},totalCount:Ye})})})]})}),jsxs(xt,{ref:_e,isMaximized:a,isRequestShown:g,style:{left:0,maxHeight:"100vw"},initial:{...a&&{width:"100vw",left:0}},animate:{...a&&{position:"absolute",left:g?"50vw":"0"}},transition:{duration:L,...ue&&{duration:0}},onScroll:()=>{qe(true),setTimeout(()=>{qe(false);},2e3);},children:[jsxs(Be,{isMaximized:a,isScrollingRequest:v,isRequestShown:g,children:[jsx(Ee,{children:jsx(ke,{variant:"subtitle1",children:"API Response"})}),jsxs(Pe,{children:[jsx(K,{value:B,onChange:ro,onOpen:()=>d?.(),currentIndex:U.currentIndex,totalCount:U.totalCount,onPrev:U.goPrev,onNext:U.goNext}),jsx(H,{disableAnimation:true,onClick:()=>{V?S?.():w?.(),M(c=>!c);},icon:V?we:ve}),jsx(H,{onClick:()=>{p?.(),navigator.clipboard.writeText(JSON.stringify(t,null,2)).then(()=>{});},icon:ta}),jsx(H,{onClick:()=>{u?.(),navigator.clipboard.writeText(t?.id||"").then(()=>{});},icon:ra})]})]}),B.trim()&&Xe===null?jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(Typography,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsxs(R,{value:Xe??t,style:Ie,displayDataTypes:false,collapsed:B.trim()?void 0:V?1:void 0,onCopied:(c,m)=>{typeof m=="string"&&Ge(m);},children:[jsx(R.String,{render:ae(B)}),jsx(R.KeyName,{render:se(B)}),jsx(R.CountInfo,{render:(c,{keyName:m})=>{if(!m)return jsx("span",{})}}),jsx(R.Copied,{render:({"data-copied":c,style:m,onClick:A},{keyName:he})=>he?jsxs(Je,{style:m,onClick:xe=>{A?.(xe);},children:[jsx(AnimatePresence,{children:c&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:ua,alt:"icon"},"id-icon")}),jsx(AnimatePresence,{children:!c&&jsx(motion.img,{style:{height:"14px",width:"14px"},initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:sa,alt:"icon"},"id-icon")})]}):jsx("span",{})})]}),jsx(Te,{sx:{flex:1,height:I},children:jsx(c$2,{sx:{borderBottomLeftRadius:g?0:"12px",background:"#f8f9fb",flex:1},totalCount:co})})]})]})]})})})})}var ce=createContext({jsonViewerList:[],handleJsonViewerDialogOpen:()=>{},handleWindowMinimize:()=>{},handleWindowOrder:()=>{},registerJsonViewerEvents:()=>{}});var Qt=({list:e,events:t,onClose:i,isWindowMinimized:o,windowOrder:n})=>e?.length?jsx(Fragment,{children:e.map((s,l)=>jsx(Y,{index:l,...t,...s,onClose:()=>{i(l);},isWindowMinimized:o,windowOrder:n},s.json.id))}):null;var Fo=({children:e})=>{let[t,i]=useState([]),[o,n]=useState(false),[s,l]=useState(1),d=useRef({}),p=useCallback(f=>{if(t.length===7){alert("Maximum allowed active Json Viewer is 7 per table.");return}if(t.some(v=>v.json.id===f.json.id))return;let O=structuredClone(f.json),V=O.request_body,M={...f,json:O,requestJson:f.requestJson||V||void 0};delete M.json.request_body,i(v=>[...v,M]);},[t]),u=useCallback(f=>{i(O=>O.filter((V,M)=>f!==M));},[]),w=useCallback(f=>{n(f);},[]),S=useCallback(f=>{l(f);},[]),k=useCallback(f=>{d.current=f;},[]),a=useMemo(()=>({onJsonRequestOpen:()=>d.current.onJsonRequestOpen?.(),onJsonSearch:()=>d.current.onJsonSearch?.(),onJsonCopy:()=>d.current.onJsonCopy?.(),onJsonIdCopy:()=>d.current.onJsonIdCopy?.(),onJsonNodesMinimize:()=>d.current.onJsonNodesMinimize?.(),onJsonNodesMaximize:()=>d.current.onJsonNodesMaximize?.()}),[]),N=useMemo(()=>({jsonViewerList:t,handleJsonViewerDialogOpen:p,handleWindowMinimize:w,handleWindowOrder:S,registerJsonViewerEvents:k}),[t,p,w,S,k]);return jsxs(ce.Provider,{value:N,children:[e,jsx(Qt,{list:t,events:a,onClose:u,isWindowMinimized:o,windowOrder:s})]})};var Yo=({isWindowMinimized:e,windowOrder:t,...i})=>{let{handleJsonViewerDialogOpen:o,handleWindowMinimize:n,handleWindowOrder:s,registerJsonViewerEvents:l}=useContext(ce),d=useCallback(()=>{n(e);},[n,e]),p=useCallback(()=>{s(t);},[s,t]);return useEffect(()=>{p();},[p]),useEffect(()=>{d();},[d]),useEffect(()=>{l(i);},[l,i]),{handleJsonViewerDialogOpen:o}};var ti=Y;export{H as a,K as b,W as c,Me as d,le as e,ce as f,Qt as g,Fo as h,Yo as i,ti as j};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-KHM5KW53.js';import {
|
|
1
|
+
import {a as a$1}from'./chunk-KHM5KW53.js';import {a}from'./chunk-GNY2VGGW.js';import {f}from'./chunk-ZPGWJ5RD.js';import {yc}from'./chunk-2CIV4TII.js';import {wb}from'./chunk-KCEYICHJ.js';import {memo,useRef,useState,useEffect,useMemo,useId}from'react';import ie from'@mui/material/Popper';import {styled,Box}from'@mui/material';import {jsx,jsxs}from'react/jsx-runtime';var k=styled(a)(({theme:e})=>({fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.subtitle1.fontSize,color:e.palette.grey[700],paddingInlineStart:e.spacing(2),paddingTop:e.spacing(1),paddingBottom:e.spacing(1),paddingInlineEnd:e.spacing(1)})),R=styled(Box,{shouldForwardProp:e=>e!=="disabled"})(({theme:e,disabled:n})=>({fontWeight:e.typography.fontWeightMedium,padding:e.spacing(1),position:"relative",display:"flex",alignItems:"center",textTransform:"capitalize",cursor:n?"not-allowed":"pointer",flex:1,zIndex:99999,".MuiButtonBase-root":{width:"16px",marginInlineEnd:"4px"}})),z=styled(Box)(({theme:e})=>({borderRadius:e.spacing(.5),background:e.palette.background.default,width:"max-content",cursor:"pointer",zIndex:99999,boxShadow:e.shadows[11],display:"flex",flexDirection:"column",".nested-menu-item + .nested-menu-item":{borderTop:`1px solid ${e.palette.divider}`,zIndex:99999},".nested-menu-item:hover":{transition:e.transitions.create(["boxShadow","border"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.complex}),boxShadow:e.shadows[6],border:"none",position:"relative"}})),B=styled(Box)(({theme:e})=>({...e.typography.subtitle1,color:e.palette.text.primary})),H=styled(f)(()=>({padding:0,paddingRight:"4px",".MuiSvgIcon-root":{width:12,height:12}})),$=styled(Box)(()=>({display:"flex",gap:"4px",alignItems:"center",flexGrow:1,minWidth:0,overflow:"hidden"})),A=styled(Box)(()=>({display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,alignItems:"center",minWidth:0,overflow:"hidden"})),O=styled(Box)(({theme:e})=>({borderRadius:"50%",background:e.palette.divider,width:13,height:14,fontSize:"8px",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"10px"})),G=styled(Box)(()=>({display:"flex",alignItems:"center",gap:"8px",flexShrink:0,position:"relative",left:4})),F=styled(Box)(()=>({flex:"1 0 auto"})),_=styled(Box)(()=>({position:"relative",zIndex:999999}));function q(e){return e.scrollWidth-e.clientWidth>1}function oe({children:e}){let n=useRef(null),[r,t]=useState(false);return jsx(a$1,{arrow:true,placement:"top",title:e,open:r,onOpen:()=>{let f=n.current;f&&q(f)&&t(true);},onClose:()=>t(false),componentsProps:{tooltip:{sx:{maxWidth:280,whiteSpace:"normal",wordBreak:"break-word"}}},wrapperProps:{sx:{flex:1,minWidth:0,display:"block",overflow:"hidden"}},children:jsx(B,{ref:n,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})})}var K=memo(oe);function se({label:e,icon:n,name:r,menuItems:t,setSelected:f,onSelect:C,selected:i,displayChildrenCount:I,disabled:s,placement:h="right",sx:g,menuSx:P}){let[u,S]=useState(null),l=useRef(null),[a,p]=useState(false),w=o=>{!s&&i!==void 0&&(f({name:o,selected:!i}),i||p(false));};return useEffect(()=>{p(!!(t?.some(o=>o.selected)&&!t?.every(o=>o.selected)));},[]),jsxs(R,{"data-testid":"NestedDropdown_MenuItem",ref:l,className:`nested-menu-item ${u?"active":""} ${s?"disabled":""}`,onMouseEnter:o=>{!u&&t?.length&&S(o.currentTarget);},onMouseLeave:()=>{u&&S(null);},onClick:o=>{s||(o.stopPropagation(),w(r));},sx:{...t?.length&&{cursor:s?"not-allowed":"pointer"},zIndex:99999,...g},disabled:s,children:[i!==void 0&&jsx(H,{size:"small",indeterminate:a,checked:i,disabled:s}),jsxs($,{children:[n&&n,jsxs(A,{children:[e&&jsx(K,{children:e}),!!t?.length&&jsxs(G,{children:[I&&jsx(O,{children:t.length}),jsx("img",{src:wb,className:"arrow-icon",alt:"arrow",style:{height:12}})]})]})]}),t?.length&&jsx(ie,{open:!!(u&&t?.length),anchorEl:u,placement:h==="left"?"left-start":"right-start",sx:{zIndex:99999,...P},children:jsx(T,{className:"child-dropdown",menuItems:t,placement:h,sx:P,onChildrenChange:o=>{let y=o.every(d=>d.selected);i!==void 0&&!s&&(y&&f({name:r,selected:true}),o.every(d=>!d.selected)&&f({name:r,selected:false}),p(o?.some(d=>d.selected)&&!o.every(d=>!d.selected)&&!y));},onSelect:o=>{C(o,r);}})})]})}var M=memo(se);function ae({title:e,menuItems:n,onChildrenChange:r,onSelect:t,className:f,updatedList:C,footer:i,header:I,placement:s="right",...h}){let[g,P]=useState({name:"",selected:false}),[u,S]=useState();return useEffect(()=>{S(n);},[n]),useEffect(()=>{if(g.name){let{name:l,selected:a}=g,p=[],w=d=>d?.map(m=>(p.push({name:m.name,selected:a}),{...m,selected:a,...m.menuItems?.length&&{menuItems:w(m.menuItems)}})),y=(d=>d.map(m=>m.name===l?(p.push({name:m.name,selected:a}),{...m,selected:a,...m.menuItems?.length&&{menuItems:w(m.menuItems)}}):m))(u);S(y),C&&C(y),r&&r(y),t&&t(p);}},[g]),jsxs(z,{component:"article",className:`tap-dropdown ${f||""}`,...h,children:[jsx(_,{children:e&&jsx(k,{component:"p",children:e})}),I,jsx(F,{children:u?.map((l,a)=>jsx(M,{setSelected:({name:p,selected:w})=>{P({name:p,selected:w});},onSelect:p=>{t&&t(p);},placement:s,...l},`${l.name}-${a}`))}),i&&i]})}var T=memo(ae);var Y=(e,{menuItemSx:n,menuSx:r})=>(e.forEach(t=>{t.sx={...n,...t.sx},t.menuSx={...r,...t.menuSx},t.menuItems?.length&&Y(t.menuItems,{menuItemSx:n,menuSx:r});}),e);function he({title:e,menuItems:n,onSelect:r,updatedList:t,header:f,placement:C="right",menuItemSx:i={},menuSx:I={},...s}){let h=useMemo(()=>Y(n,{menuItemSx:i,menuSx:I}),[n,i,I]),[g,P]=useState(h),u=yc(useId(),"nested-dropdown");useEffect(()=>{P(h);},[h]);let S=l=>{let a=w=>w.map(o=>({...o,selected:l.find(y=>o.name===y.name)?.selected??o.selected,...o.menuItems?.length&&{menuItems:a(o.menuItems)}})),p=a(g);P(p),t&&t(p);};return jsx(T,{id:u,"data-testid":"NestedDropdown",placement:C,menuItems:g,title:e,header:f,onSelect:l=>{r&&r(l),S(l);},...s})}var Z=memo(he);var Ue=Z;export{M as a,T as b,Ue as c};
|