@tap-payments/os-micro-frontend-shared 0.3.265-test.1793707397 → 0.3.265-test.1793719783
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-DROAYBDL.js +1 -0
- package/build/_chunks/chunk-KU75ZOYM.js +2 -0
- package/build/_chunks/chunk-LS6RAZNP.js +1 -0
- package/build/_chunks/chunk-NJURK3JB.js +1 -0
- package/build/_chunks/{chunk-NLRRXPA3.js → chunk-OYKBXBJF.js} +1 -1
- package/build/_chunks/{chunk-WEETQTTS.js → chunk-P4CBGD6F.js} +1 -1
- package/build/_chunks/chunk-UPPOWZJU.js +1 -0
- package/build/_chunks/{chunk-4ZCG5ZAD.js → chunk-X6V3EYRA.js} +1 -1
- package/build/_chunks/{chunk-MWN6TZQG.js → chunk-YIWSLDUO.js} +1 -1
- package/build/_chunks/chunk-Z4KKF3ZW.js +1 -0
- package/build/_chunks/chunk-ZHBPM7RI.js +1 -0
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/MultiLevelSelect/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/Select/type.d.ts +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/TreeDropdown/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/VirtualTables/index.js +1 -1
- package/build/components/Window/index.js +1 -1
- package/build/components/WindowServices/index.js +1 -1
- package/build/components/WindowToolbar/index.js +1 -1
- package/build/components/index.js +1 -1
- package/build/components/modules/JSONViewWindow/index.js +1 -1
- package/build/components/modules/VirtualTables/index.js +1 -1
- package/build/components/modules/WindowShell/index.js +1 -1
- package/build/components/modules/WindowShell/type.d.ts +1 -1
- package/build/components/modules/index.js +1 -1
- package/build/datetime/components/index.js +1 -1
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.js +1 -1
- package/build/index.js +1 -1
- package/package.json +4 -6
- package/build/_chunks/chunk-26HBCCEH.js +0 -1
- package/build/_chunks/chunk-5GDTBQ3D.js +0 -1
- package/build/_chunks/chunk-AQNXY7NX.js +0 -1
- package/build/_chunks/chunk-D743NDB7.js +0 -1
- package/build/_chunks/chunk-DJMDRRJI.js +0 -1
- package/build/_chunks/chunk-IFYLS2HJ.js +0 -1
- package/build/_chunks/chunk-ZYLV22XM.js +0 -2
- package/build/hooks/useCheckUserLoggedIn.d.ts +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {Hb,C,wc,xc}from'./chunk-Z2DUFVI5.js';import {useState,useEffect,useCallback,useRef,useMemo,useLayoutEffect}from'react';import {useTheme}from'@mui/material/styles';function O(){let{innerWidth:e,innerHeight:n}=window;return {width:e,height:n}}function de(){let[e,n]=useState(O);return useEffect(()=>{let t;function o(){cancelAnimationFrame(t),t=requestAnimationFrame(()=>{n(O());});}return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o),cancelAnimationFrame(t);}},[]),e}function ve({value:e,delay:n}){let[t,o]=useState(e);return useEffect(()=>{let r;return e?o(e):r=setTimeout(()=>{o(e);},n),()=>{clearTimeout(r);}},[e]),t}function Ee(e,n){let[t,o]=useState({});return useEffect(()=>{e&&o(s=>({...s,[e]:n||0}));},[n,e]),{getBadgeCount:useCallback(s=>s?t[s]:"",[t])}}function Ce(e){return {isParameterSelected:(o,r)=>r?.map(s=>Hb(e,o,s)),getColumnOrder:o=>{let r=e.findIndex(s=>s.name?.toLowerCase()===o?.toLowerCase());return r===-1?100:r}}}var ke=e=>{let[n,t]=useState(false);return useEffect(()=>{let o=e?.current;if(!o)return;let r=new IntersectionObserver(([s])=>{t(!s.isIntersecting);});return r.observe(o),()=>r.disconnect()},[e]),{showShadow:n}};var Oe=()=>{let e=useTheme(),n=e.palette.mode==="dark",t=e.palette.mode==="light";return {isDark:n,isLight:t}};function ze(){let[e,n]=useState(0),t=useRef(null),o=C(e),r=()=>{t.current&&(clearInterval(t.current),t.current=null);},s=()=>{r(),n(0);},i=c=>{c<=0||(t.current&&r(),n(c),t.current=setInterval(()=>{n(a=>{let u=a-1;return u<=0&&r(),u});},1e3));};return useEffect(()=>()=>{r();},[]),{timer:e,formattedTime:o,startTimer:i,stopTimer:r,resetTimer:s}}var De=e=>{let n=useMemo(()=>new Map(e.map(i=>[i.code.toLowerCase(),i])),[e]),t=useCallback(i=>n.get(i.toLowerCase()),[n]),o=useCallback(({appCode:i,serviceCode:c})=>t(i)?.app_services.find(({code:a})=>a.toLowerCase()===c.toLowerCase()),[t]),r=useCallback(({appCode:i,serviceCode:c})=>o({appCode:i,serviceCode:c})?.functions??[],[o]),s=useCallback(({appCode:i,serviceCode:c,functionCode:a})=>r({appCode:i,serviceCode:c}).find(({code:u})=>u?.toLowerCase()===a.toLowerCase()),[r]);return {getAppInfo:t,getServiceInfo:o,getServiceFunctions:r,getFunctionInfo:s}};function A(e){return useCallback((...n)=>{let t=new CustomEvent(e,{detail:n});window.dispatchEvent(t);},[e])}function _e(e,n){let t=useRef(n);t.current=n,useEffect(()=>{let o=r=>{let s=r;t.current(...s.detail||[]);};return window.addEventListener(e,o),()=>{window.removeEventListener(e,o);}},[e]);}var Ne=(e,n)=>{let{selectedEntity:t,selectedMerchant:o,displayName:r}=useMemo(()=>{let s=n?.entities.find(a=>a.id===e?.entityId),i=s?.merchants?.find(a=>a.id===e?.merchantId),c=i?.display_name??i?.legacy_id??"Select";return {selectedEntity:s,selectedMerchant:i,displayName:c}},[n,e?.entityId,e?.merchantId]);return {selectedBrand:n,selectedEntity:t,selectedMerchant:o,displayName:r}};var te=()=>crypto.randomUUID();function $e(){let e=A("on-toast"),n=useCallback(t=>(o,r)=>{let s=r?.id??te();return e({action:"show",variant:t,message:o,options:{...r,id:s}}),s},[e]);return useMemo(()=>{let t=n("default");return t.success=n("success"),t.error=n("error"),t.loading=n("loading"),t.custom=n("custom"),t.dismiss=o=>{e({action:"dismiss",variant:"dismiss",toastId:o});},t.remove=o=>{e({action:"remove",variant:"remove",toastId:o});},t},[n,e])}var oe=10;function Ye({threshold:e=oe,containerRef:n}={}){let[t,o]=useState(true),[r,s]=useState(false),[i,c]=useState(false),a=useCallback(l=>{let{scrollTop:m,scrollHeight:p,clientHeight:f}=l;c(p>f+e),o(m<=e),s(p-(m+f)<=e);},[e]),u=useCallback(l=>{if(l){if("currentTarget"in l){a(l.currentTarget);return}a(l);}},[a]);return useEffect(()=>{if(!n?.current)return;let l=n.current;u(l);let m=new ResizeObserver(()=>{u(l);});return m.observe(l),()=>{m.disconnect();}},[n,u]),{handleScroll:u,scrolledToTop:t,scrolledToBottom:r,scrollable:i}}var tt=(e={})=>{let{checkUrl:n="/status",checkIntervalMs:t=3e4,debounceMs:o=800,timeoutMs:r=5e3}=e,s=typeof window<"u"&&typeof navigator<"u",[i,c]=useState(s?navigator.onLine:true),[a,u]=useState(false),[l,m]=useState(null),p=useRef(null),f=useRef(null),g=useCallback(d=>{p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>{c(d),p.current=null;},o);},[o]);return useEffect(()=>{if(!s)return;let d=null,w=()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null);},v=async()=>{u(true),m(null),d?.abort(),d=new AbortController;try{let C=window.setTimeout(()=>{d?.abort();},r),M=await fetch(n,{method:"GET",cache:"no-store",signal:d.signal});window.clearTimeout(C);let y=M.ok;g(y),y?w():m(`Health check failed with status ${M.status}`);}catch{g(false),m("Unable to reach network");}finally{u(false);}},b=()=>{w(),g(true);},S=()=>{g(false),w(),v(),f.current=window.setInterval(v,t);};return window.addEventListener("online",b),window.addEventListener("offline",S),navigator.onLine||(v(),f.current=window.setInterval(v,t)),()=>{window.removeEventListener("online",b),window.removeEventListener("offline",S),p.current!==null&&window.clearTimeout(p.current),w(),d?.abort();}},[s,n,t,o,r,g]),s?{isOnline:i,isChecking:a,error:l}:{isOnline:false,isChecking:false,error:"Online status is only available in a browser environment."}};var st=(e={},n,t)=>{let o=wc(e,t.requiredFilterKeys);return {columns:useMemo(()=>xc(n,o,t),[n,o])}};function lt(e,n){return useCallback(t=>{t.key==="Enter"?(t.preventDefault(),e(),n(t)):t.key==="Escape"&&n(t);},[e,n])}function dt(){let[e,n]=useState(true);return {onScrollHandler:useCallback(o=>{let{scrollTop:r,scrollHeight:s,clientHeight:i}=o.currentTarget,c=r===0||i<s-r-1;n(a=>a===c?a:c);},[]),showShadow:e}}var pe={width:0,height:0};function vt(){let[e,n]=useState(null),[t,o]=useState(pe),r=useCallback(s=>{n(s);},[]);return useLayoutEffect(()=>{if(!e)return;let s=new ResizeObserver(i=>{for(let c of i){let a=c.target.getBoundingClientRect();o({width:c.borderBoxSize?.[0]?.inlineSize??a.width,height:c.borderBoxSize?.[0]?.blockSize??a.height});}});return s.observe(e),()=>s.disconnect()},[e]),[r,t]}export{de as a,ve as b,Ee as c,Ce as d,ke as e,Oe as f,ze as g,De as h,A as i,_e as j,Ne as k,$e as l,Ye as m,tt as n,st as o,lt as p,dt as q,vt as r};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {z,o,C,w,n,t,r,q,p,s,u,v,M as M$1,A as A$1,ba,aa}from'./chunk-J2BHHD2B.js';import {d,R,L,V as V$1,Q as Q$1}from'./chunk-CAVYK7HF.js';import {nc}from'./chunk-Z2DUFVI5.js';import {Gb,A as A$2,Rc}from'./chunk-3M2GZVQW.js';import {forwardRef,useState,useEffect,useMemo,memo,useRef,useLayoutEffect,useId}from'react';import y from'@mui/material/Box';import Tt from'@mui/material/ClickAwayListener';import ht from'@mui/material/Typography';import {styled,alpha}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var M="os-shared-MultiLevelSelect",a={root:`${M}-root`,open:`${M}-open`,label:`${M}-label`,fieldBody:`${M}-fieldBody`,placeholder:`${M}-placeholder`,arrow:`${M}-arrow`,menu:`${M}-menu`,search:`${M}-search`,selectedBadge:`${M}-selectedBadge`,fieldRow:`${M}-fieldRow`},ye=40,k="data-nested-submenu",$="data-nested-submenu-anchor",Ce={strategy:"fixed"},we=.7,Ne=100,Ie={width:10,height:7.5,flexShrink:0},Be={width:9,height:9,flexShrink:0};var gt={overflow:"hidden",flex:"0 0 auto",width:"max-content",maxWidth:"100%",minWidth:0},St=e=>({display:"flex",padding:"4px 8px 4px 6px",alignItems:"center",gap:"4px",borderRadius:"13px",backgroundColor:e,fontSize:"10px",fontWeight:500,cursor:"pointer"}),Oe=styled(y,{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:t$1=false})=>{let{base:n$1}=e.v2.palette;return {width:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",justifyContent:"flex-end",gap:t,minHeight:n,padding:`0 ${C}px 0 ${w}px`,textAlign:"left",border:`${o}px solid ${t$1?"#FAFBFB":"transparent"}`,borderRadius:"4px",backgroundColor:t$1?"#FAFBFB":e.palette.grey[400],minWidth:"89px",position:"relative",cursor:t$1?"not-allowed":"pointer",...t$1&&{color:alpha(n$1.black,.6),[`& .${a.label}`]:{opacity:.7,cursor:"not-allowed"},[`& .${a.placeholder}`]:{color:alpha(n$1.black,.6)},"& .Select-menuTriggerIcon":{cursor:"default",color:"rgba(0, 0, 0, 0.38)","& svg path":{fill:"rgba(0, 0, 0, 0.38)",stroke:"rgba(0, 0, 0, 0.38)"}},[`& .${a.fieldRow}`]:{opacity:.7},[`& .${a.fieldRow} *`]:{cursor:"not-allowed"}},"& .Select-menuTriggerIcon":{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"inherit",lineHeight:0,"& svg, & .MuiSvgIcon-root":{transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter})}},"& .Select-menuTriggerIcon-open svg, & .Select-menuTriggerIcon-open .MuiSvgIcon-root":{transform:"rotate(180deg)"},"& .Select-menuTriggerIcon--loading":{width:z,minWidth:z,height:z,cursor:"default"},[`&.${a.open}, &:focus-within`]:{border:`1px solid ${e.v2.palette.brand[500]}`,boxShadow:`0px 0px 4px 0px ${alpha(e.v2.palette.brand[500],.5)}`}}}),Pe=styled(ht)(({theme:e})=>({alignSelf:"stretch",width:"100%",boxSizing:"border-box",height:s,margin:0,paddingTop:p,cursor:"pointer",fontSize:q,fontWeight:500,lineHeight:`${r}px`,color:e.palette.grey[700],whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",pointerEvents:"none",flexShrink:0})),Re=styled(y)({display:"flex",alignItems:"flex-start",width:"100%",minWidth:0,minHeight:v+u,paddingBottom:u,boxSizing:"border-box",flex:"0 0 auto"}),Ee=styled(M$1)({margin:0,padding:0,width:"100%",alignSelf:"center"}),Fe=styled(y)({position:"absolute",right:A$1,top:"50%",transform:"translateY(-50%)",width:z,height:z,display:"inline-flex",alignItems:"center",justifyContent:"center",color:"inherit",lineHeight:0,pointerEvents:"none"}),Te=styled(y)(()=>({display:"flex",flexDirection:"column",padding:"8px"})),bt={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},vt={display:"flex",flexWrap:"wrap",alignItems:"center",alignContent:"flex-start",gap:"4px",width:"100%",minWidth:0},We=styled(y,{shouldForwardProp:e=>e!=="$field"})(({$field:e})=>({...vt,...e?{padding:0,minHeight:v,boxSizing:"border-box",alignItems:"flex-start",alignContent:"flex-start"}:{marginBottom:"8px","&:empty":{display:"none"}}})),J=styled(y,{shouldForwardProp:e=>e!=="$field"})(({theme:e,$field:t})=>({...St(`${e.palette.info.dark}1a`),...gt,...t&&{cursor:"inherit"}})),ke=styled("span")(()=>bt),$e=styled(y)(()=>({position:"relative",width:"100%",minWidth:0})),Ae=styled(y)(()=>({flex:1,maxWidth:"220px",minWidth:"89px",fontWeight:500})),He=styled(y)(()=>({display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,alignItems:"center",width:"100%",minWidth:"89px",fontWeight:500}));var O=e=>!e.options&&typeof e.value=="string";function Ve(e,t,n){if(e===void 0)return O(n);if(typeof e=="boolean")return e;if(typeof e=="function")return e(t,n);let o=e[t];return typeof o=="boolean"?o:O(n)}var A=e=>e.value??e.label,H=(e,t)=>t?.some(n=>n.value===e.value)??false,ze=(e,t,n)=>{if(H(e,t)){n(t?.filter(o=>o.value!==e.value)||[]);return}n([...t||[],e]);},Q=e=>O(e)?[e]:(e.options??[]).flatMap(Q),U=(e,t)=>{let n=e.filter(o=>H(o,t)).length;return {allSelected:e.length>0&&n===e.length,someSelected:n>0&&n<e.length}},je=(e,t,n)=>{let o=new Set(e.map(i=>i.value));if(U(e,t).allSelected){n((t??[]).filter(i=>!o.has(i.value)));return}let l=new Set((t??[]).map(i=>i.value)),r=e.filter(i=>!l.has(i.value));n([...t??[],...r]);},xt=(e,t)=>{let n=e[t];return typeof n=="string"?n:typeof n=="number"&&Number.isFinite(n)?String(n):""},Lt=(e,t,n)=>n.some(o=>xt(e,o).toLowerCase().includes(t)),Ge=(e,t,n)=>{let o=t.toLowerCase().trim();if(!o)return e.map(i=>({node:i,depth:0}));let l=[],r=(i,d)=>{for(let s of i){if(O(s)){Lt(s,o,n)&&l.push({node:s,depth:d});continue}r(s.options??[],d+1);}};return r(e,0),l},Mt=(e,t="right")=>{let n=e?.closest(`.${Q$1.panel}`);if(!e||!n)return 0;let o=e.getBoundingClientRect(),l=n.getBoundingClientRect(),r=t.startsWith("left")?o.left-l.left:l.right-o.right;return Math.max(0,r)},Ke=e=>[{name:"flip",enabled:true,options:{rootBoundary:"viewport",padding:8,fallbackPlacements:["left-start","right-end","left-end"]}},{name:"preventOverflow",enabled:true,options:{rootBoundary:"viewport",altAxis:true,padding:8}},{name:"offset",options:{offset:({placement:t})=>[0,Mt(e.current,t)]}}],Xe=(e,t)=>e.length===t.length&&e.every((n,o)=>n===t[o]);function qe(e,t,n){let o=[],l=0;for(let r of e){if(t<=0){o.push(void 0);continue}if(l===0&&r>=t){o.push(Math.floor(t));continue}let i=l===0?0:n;if(l+i+r<=t+.5){o.push(void 0),l+=i+r;continue}let d=Math.floor(t-l-i);if(d>=Ne&&d>=r*we){o.push(d),l=0;continue}o.push(void 0),l=r;}return o}var De=(e,t)=>t instanceof Node&&!!e?.contains(t),Ye=(e,t,n)=>{if(De(t,e)||De(n,e))return true;if(!(e instanceof Element)||!n)return false;let o=e.closest(`[${k}]`)?.getAttribute($),l=o?document.getElementById(o):null;return !!(l&&n.contains(l))};function wt({options:e,variant:t,hiddenCount:n=0,onRemove:o}){let l=useRef(null),r=useRef([]),[i,d$1]=useState([]),s=e.length+(n>0?1:0),C=e.map(c=>c.label).join("\0");useLayoutEffect(()=>{let c=l.current;if(!c||s===0)return;let f=()=>{let L=r.current.slice(0,s).filter(u=>u!=null);if(L.length!==s)return;let S=L.map(u=>u.style.maxWidth);L.forEach(u=>{u.style.maxWidth="none";});let h=L.map(u=>u.getBoundingClientRect().width);L.forEach((u,G)=>{u.style.maxWidth=S[G];});let b=getComputedStyle(c),R=c.clientWidth-parseFloat(b.paddingLeft)-parseFloat(b.paddingRight),j=parseFloat(b.columnGap||b.gap||"0")||0,E=qe(h,R,j);d$1(u=>Xe(u,E)?u:E);};f();let N=new ResizeObserver(f);return N.observe(c),()=>N.disconnect()},[s,C,t]);let m=t==="field",x=c=>f=>{f.stopPropagation(),f.preventDefault(),o?.(c);},w=c=>f=>{r.current[c]=f;};return jsxs(We,{ref:l,$field:m,className:m?a.fieldRow:void 0,children:[e.map((c,f)=>jsxs(J,{ref:w(f),$field:m,className:m?void 0:a.selectedBadge,style:i[f]!=null?{maxWidth:i[f]}:void 0,onClick:m?void 0:x(c),children:[m?null:jsx(d,{src:Rc,alt:"",sx:Ie}),jsx(ke,{children:c.label}),m?null:jsx(d,{src:Gb,alt:"",sx:Be})]},`${f}-${c.value}`)),n>0?jsx(J,{ref:w(e.length),$field:m,style:i[e.length]!=null?{maxWidth:i[e.length]}:void 0,children:jsxs("span",{children:["+",n]})}):null]})}var V=wt;function Nt({options:e,maxVisibleValues:t}){let o=typeof t=="number"&&Number.isFinite(t)?Math.max(0,Math.floor(t)):e.length,l=e.slice(0,o),r=e.length-l.length;return jsx($e,{children:jsx(V,{options:l,variant:"field",hiddenCount:r})})}var Qe=Nt;var _e=()=>jsx("svg",{width:"5",height:"8",viewBox:"0 0 5 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,style:{display:"block",flexShrink:0},children:jsx("path",{d:"M0.117188 0.504028C0.115307 0.426166 0.138248 0.350264 0.182617 0.286255C0.227088 0.222214 0.290458 0.173028 0.363281 0.144653C0.436073 0.116302 0.516047 0.109152 0.592773 0.124146C0.668745 0.138995 0.738375 0.176073 0.793945 0.229614L4.43164 3.63391C4.50662 3.70421 4.55078 3.80153 4.55078 3.90442C4.55064 4.00712 4.5065 4.10376 4.43164 4.17395L0.794922 7.57922L0.793945 7.57825C0.738766 7.63096 0.669812 7.66692 0.594727 7.68176C0.519097 7.69665 0.440194 7.69049 0.368164 7.66321C0.296002 7.63581 0.232474 7.58801 0.1875 7.52551C0.14262 7.463 0.11821 7.3886 0.118164 7.31165C0.118166 7.25986 0.12907 7.20846 0.150391 7.16125C0.171346 7.11493 0.201824 7.07367 0.239258 7.03918L3.58691 3.90442L0.239258 0.769653C0.164191 0.701295 0.119752 0.605686 0.117188 0.504028Z",fill:"#20232B",stroke:"#20232B",strokeWidth:"0.233333"})});function ot({label:e,itemCount:t,isSelected:n,isIndeterminate:o,onToggle:l,children:r,isSelectable:i=false}){let d=useId(),s=useRef(null),C=useRef(null),m=useRef(null),x=useRef(null),[w,c]=useState(false),f=useMemo(()=>Ke(s),[]),N=()=>{x.current!=null&&(window.clearTimeout(x.current),x.current=null);},L=()=>{t!==0&&(N(),c(true));},S=h=>{Ye(h.relatedTarget,s.current,C.current)||(N(),x.current=window.setTimeout(()=>{x.current=null,c(false);},ye));};return useEffect(()=>()=>{x.current!=null&&window.clearTimeout(x.current);},[]),useEffect(()=>{if(!w)return;let h=()=>m.current?.update();return document.addEventListener("scroll",h,true),window.addEventListener("resize",h),()=>{document.removeEventListener("scroll",h,true),window.removeEventListener("resize",h);}},[w]),jsxs(V$1,{id:d,ref:s,isSelected:n,isIndeterminate:o,startAdornment:i?void 0:null,onClick:h=>{if(h.stopPropagation(),h.preventDefault(),!i){L();return}l();},onMouseEnter:L,onMouseLeave:S,children:[jsxs(He,{children:[e,jsx(_e,{})]}),jsx(R,{ref:C,popperRef:m,[k]:"",[$]:d,sx:{maxHeight:"min(450px, calc(100dvh - 16px))",overflow:"auto"},open:w,anchorEl:s.current,placement:"right-start",modifiers:f,popperOptions:Ce,onMouseEnter:L,onMouseLeave:S,children:r})]})}function it({option:e,value:t,onChange:n,isSelectable:o=true}){let l=H(e,t);return jsx(V$1,{isSelected:l,onClick:i=>{i.stopPropagation(),i.preventDefault(),o&&ze(e,t,n);},startAdornment:o?void 0:null,children:jsx(Ae,{children:e.label})})}function te({node:e,depth:t,value:n,onChange:o,isSelectable:l}){let r=Ve(l,t,e);if(O(e))return jsx(it,{option:e,value:n,onChange:o,isSelectable:r});if(!e.options)return null;let i=e.options,d=Q(e),{allSelected:s,someSelected:C}=U(d,n);return jsx(ot,{label:e.label,itemCount:i.length,isSelected:s,isIndeterminate:C,isSelectable:r,onToggle:()=>je(d,n,o),children:i.map(m=>jsx(te,{node:m,depth:t+1,value:n,onChange:o,isSelectable:l},A(m)))})}var Wt=["label"],st=forwardRef(({options:e,onChange:t,value:n,maxVisibleValues:o,placeholder:l,label:r,isLoading:i,isSelectable:d$1,disabled:s,className:C,sx:m,isSearchable:x=true,searchPlaceholder:w,searchBy:c=Wt,onOpen:f,onClose:N},L$1)=>{let[S,h]=useState(null),[b,R$1]=useState(""),[j,E]=useState(void 0),u=!!S,G=r??l,ct=r?l??"Please Select":"Please Select";useEffect(()=>{if(!S)return;let p=()=>{let K=S.clientWidth;K>0&&E(ie=>ie===K?ie:K);};if(p(),typeof ResizeObserver>"u")return;let I=new ResizeObserver(p);return I.observe(S),()=>I.disconnect()},[S]);let at=S?.clientWidth||j,ut=p=>{if(u){h(null),N?.();return}h(p.currentTarget),f?.();},pt=()=>{h(null),N?.();},dt=()=>{b&&R$1("");},mt=useMemo(()=>Ge(e,b,c),[e,b,c]),le=n?.length??0,ft=i?jsx(ba,{}):jsx(d,{src:b?Gb:A$2,alt:b?"close":"search",onClick:dt,sx:{width:12,height:12,cursor:b?"pointer":"default"}});return jsx(Tt,{onClickAway:()=>{u&&pt();},children:jsxs(Oe,{ref:L$1,id:"FieldWrapper","data-testid":"MultiLevelSelect",$disabled:s,"aria-disabled":s||void 0,className:nc(a.root,u&&a.open,C),sx:m,onClick:p=>!s&&ut(p),children:[jsx(Pe,{className:a.label,component:"label",children:G}),jsxs(Re,{className:a.fieldBody,children:[le===0?jsx(Ee,{className:a.placeholder,component:"p",children:ct}):null,le>0&&n?jsx(Qe,{options:n,maxVisibleValues:o}):null]}),jsx(Fe,{className:a.arrow,"aria-hidden":true,children:i?jsx(y,{component:"span",className:"Select-menuTriggerIcon Select-menuTriggerIcon--loading","aria-hidden":true,children:jsx(ba,{})}):jsx(y,{component:"span",className:`Select-menuTriggerIcon${u?" Select-menuTriggerIcon-open":""}`,children:jsx(aa,{})})}),jsx(R,{open:u,anchorEl:S,sx:{margin:"8px 0",maxHeight:330,overflow:"auto",width:at},panelProps:{className:a.menu},children:jsxs(Te,{children:[x?jsx(L,{className:a.search,fullWidth:true,size:"md",placeholder:w??l??"Select",endAdornment:ft,value:b,onClick:p=>{p.stopPropagation();},onMouseDown:p=>{p.stopPropagation();},onChange:p=>{R$1(p.target.value);},sx:{mb:"8px"}}):null,jsx(V,{options:n??[],variant:"menu",onRemove:p=>{t(n?.filter(I=>I.value!==p.value)||[]);}}),mt.map(({node:p,depth:I})=>jsx(te,{node:p,depth:I,value:n,onChange:t,isSelectable:d$1},A(p)))]})})]})})});st.displayName="MultiLevelSelect";var kt=memo(st);
|
|
2
|
+
export{a,kt as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {g as g$1}from'./chunk-ISC5KT5E.js';import {c}from'./chunk-6W2A6AMS.js';import {p,b}from'./chunk-DROAYBDL.js';import {j,L,e,f,B,R,V,x}from'./chunk-CAVYK7HF.js';import {g,nc,Va,Ub,pb,jc,kc,lc,Rb,Tb,Sb,uc,Wa,_a as _a$1,pa as pa$1,e as e$1,oa as oa$1}from'./chunk-Z2DUFVI5.js';import {ni as ni$1,ti,bk,vi as vi$1,Ta,Da,Ea,Fa as Fa$1,Sh,Pn as Pn$1,ai as ai$1,$h,wi as wi$1,A as A$1,F}from'./chunk-3M2GZVQW.js';import Ae,{memo,createContext,useContext,useRef,useCallback,useEffect,useState,useMemo,createElement,Fragment as Fragment$1}from'react';import {styled,alpha,useTheme}from'@mui/material/styles';import ts from'memoize-one';import os from'react-virtualized-auto-sizer';import rs from'react-window-infinite-loader';import {useTranslation}from'react-i18next';import Ce from'@mui/material/Box';import {jsxs,Fragment,jsx}from'react/jsx-runtime';import ba from'@mui/material/Popper';import ta from'@mui/material/InputAdornment';import oa from'lodash/values';import ln from'@mui/material/Button';import {TableCell,Button,styled as styled$1,Box}from'@mui/material';import _a from'@mui/material/TableRow';import {motion}from'framer-motion';import {VariableSizeList,areEqual}from'react-window';import Ka from'@mui/material/TableHead';import cl from'lodash/uniqueId';import nl from'@mui/material/Skeleton';import al from'@mui/material/TableCell';import {createPortal}from'react-dom';var ro="37px",Jr=styled(Ce,{shouldForwardProp:e=>e!=="showBackDrop"&&e!=="areTotalRowsNotFillingHeight"&&e!=="sandboxMode"&&e!=="maximized"})(({theme:e,showBackDrop:t,areTotalRowsNotFillingHeight:o,sandboxMode:r,maximized:n})=>({minHeight:ro,...!n&&{borderBottomLeftRadius:e.spacing(1.5),borderBottomRightRadius:e.spacing(1.5)},display:"flex",alignItems:"center",border:"none",justifyContent:"space-between",padding:"6px 32px",background:r?e.palette.common.lightOrange:e.palette.grey[300],backdropFilter:"blur(32px)",boxShadow:t?e.shadows[24]:"none",borderTop:o?`1px outset ${e.palette.grey[800]}`:"none",width:"100%",marginTop:"auto",flexShrink:0,cursor:"move"})),Zr=styled("div")(({theme:e})=>({position:"absolute",top:0,left:0,right:0,height:"1.5px",backgroundColor:e.palette.grey[300],boxShadow:`inset 0 1px 0 0 ${e.palette.grey[300]}`})),no=styled(Ce)(({theme:e})=>({borderRadius:"37.5px",border:"0.75px solid rgba(242, 242, 242, 0.70)",backgroundColor:e.palette.common.white,opacity:1,paddingInline:e.spacing(1),display:"flex",alignItems:"center",height:24,gap:"7px",maxWidth:"max-content"})),io=styled(j)(()=>({fontSize:"9px",fontWeight:400,lineHeight:"10.8px"})),ao=styled(j)(()=>({fontSize:"10.5px",fontWeight:700,lineHeight:"12.6px"}));styled(Ce)(()=>({display:"flex",gap:"3px",alignItems:"center"}));styled(Ce)(()=>({display:"flex",gap:"6px"}));styled("span")(()=>({fontWeight:400}));function Gi({totalCount:e,showBackDrop:t=false,showSeparator:o,sandboxMode:r,maximized:n,selectedCount:a,className:l,...s}){let{t:i}=useTranslation();return jsxs(Jr,{component:"footer","data-testid":"TableFooter",maximized:n??false,sandboxMode:r,showBackDrop:t,areTotalRowsNotFillingHeight:!!o,...s,className:nc(g$1,l),children:[o&&jsx(Zr,{}),a?jsxs(no,{sx:{gap:"6px",cursor:"text"},children:[jsx(io,{children:i("selected")}),jsx(ao,{children:g(a)})]}):null,e||e===0?jsxs(no,{sx:{gap:"6px",cursor:"text"},children:[jsx(io,{children:i("count")}),jsx(ao,{children:g(e||0)})]}):null]})}var Me=Ae.memo(Gi);var xt="188px";var Qr=e=>({backgroundColor:e.palette.common.white,borderRadius:"4px",filter:"drop-shadow(0px 8px 30px rgba(0, 0, 0, 0.16))",width:xt,marginTop:"10px",boxShadow:e.shadows[3]}),en=styled(Ce)(({theme:e})=>({color:e.palette.grey[700],fontSize:"11px",fontWeight:500,padding:"8px 16px",textAlign:"left",borderBottom:`1px solid ${e.palette.divider}`})),tn=styled(L)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,".icon":{width:14}})),on=styled(Ce)(()=>({padding:"8px 16px","> div + div":{marginTop:"8px"}})),rn=styled(ln)(({theme:e})=>({color:e.palette.info.dark,fontSize:"11px",textTransform:"capitalize",padding:"4px 9px",minWidth:"auto","&:hover":{background:"transparent"}})),nn=styled(Ce)(({theme:e})=>({padding:"0 16px 8px",textAlign:"left",borderBottom:`1px solid ${e.palette.divider}`}));var sn=styled(Ce)(({theme:e})=>({background:e.palette.grey[700],width:27,height:14,display:"inline-flex",alignItems:"center",marginInlineStart:"4px",borderRadius:"10px",padding:"2px 6px",img:{cursor:"pointer"}})),St=styled(Ce)(()=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"center"})),yt=styled(ln)(({theme:e})=>({textTransform:"capitalize",minWidth:"auto",width:"100%",borderRadius:"4px",border:`1px solid ${e.palette.info.dark}`,backgroundColor:e.palette.info.dark,fontWeight:700,fontSize:"11px",color:e.palette.common.white,"&:hover":{backgroundColor:e.palette.info.dark}})),Tt=styled(ln)(({theme:e})=>({textTransform:"capitalize",minWidth:"auto",width:"100%",borderRadius:"4px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.common.white,fontWeight:500,fontSize:"11px",color:e.palette.text.primary,"&:hover":{background:"transparent"}}));function na({onCloseDropdown:e,filter:{options:t=[],onConfirm:o,data:r,isOnlyOneFilter:n,onClearFilterFields:a,wrapperSx:l,sx:s}}){let[i,p$1]=useState({});useEffect(()=>{p$1((t||[]).reduce((C,{apiKey:h})=>({...C,[h]:r?.[h]??""}),{}));},[]);let{t:d}=useTranslation(),u=()=>{o?.(i);},c=p(u,e),R=C=>{u(),e(C);},m=C=>{e(C);},g=()=>{a?.(),p$1(t.reduce((C,{apiKey:h})=>({...C,[h]:""}),{}));},f=C=>i[C]!==void 0&&i[C].length>0,T=C=>i[C]!==void 0&&i[C].length?i[C]:"",b=C=>{f(C)&&p$1({...i,[C]:""});},x$1=useMemo(()=>oa(i).some(C=>!!C),[i]),S=useCallback(C=>t.find(h=>h.apiKey===C),[t]),w=useCallback((C,h)=>{let E=i?.[C]!==void 0&&i?.[C]!==""&&i?.[C]!==null,V=Object.entries(i).some(([y,k])=>!!k&&(S(y)?.filterGroup!==h||!h));return n&&!E&&V},[t,i,n]);return jsxs(Ce,{component:"article","data-testid":"ColumnFilterInputs",sx:C=>({...Qr(C),...Object.assign({},...[s].flat().filter(h=>h&&typeof h=="object"))}),onKeyDown:c,children:[jsx(en,{component:"header","data-testid":"ColumnFilterInputs_title",children:d("filterBy")}),jsx(on,{"data-testid":"ColumnFilterInputs_inputs",component:"main",sx:l,children:t.map(({placeholder:C,apiKey:h,isDisabled:E,filterGroup:V,render:y})=>jsx(Fragment$1,{children:y?y():jsx(tn,{className:"input","data-testid":"ColumnFilterInputs_InputStyled",name:h,placeholder:C,onChange:k=>{p$1({...i,[h]:k.target.value});},disabled:E||w(h,V),value:T(h),inputProps:{autoComplete:"off","data-testid":"ColumnFilterInputs_input"},endAdornment:jsx(ta,{position:"end",children:jsx(Ce,{component:"img","data-testid":"ColumnFilterInputs_icon","data-icon":f(h)?"close":"search",src:f(h)?wi$1:A$1,alt:"search",className:"icon",sx:{cursor:f(h)?"pointer":"default"},onClick:()=>{b(h);}})})})},h))}),jsx(x,{in:x$1,component:"section","data-testid":"ColumnFilterInputs_Collapse",sx:{borderTop:"0"},children:jsx(nn,{"data-testid":"ColumnFilterInputs_ClearWrapper",children:jsx(rn,{type:"button",onClick:g,"data-testid":"ColumnFilterInputs_ClearButton",children:d("clear")})})}),jsxs(St,{component:"footer","data-testid":"ColumnFilterInputs_footer",children:[jsx(Tt,{type:"button",onClick:m,"data-testid":"ColumnFilterInputs_CancelButton",children:d("cancel")}),jsx(yt,{type:"button",onClick:R,"data-testid":"ColumnFilterInputs_OkayButton",children:d("okay")})]})]})}var un=na;var wt=un;function pa({onCloseDropdown:e,filter:t,styles:o,header:r,searchable:n}){let[a,l]=useState([]),{t:s}=useTranslation(),i=useRef([]),p$1=t?.options?.map(b=>b.value).join(",")??"";useEffect(()=>{let b=S=>{let w=t?.data?.[t.apiKey]??[];if(Array.isArray(w)&&w.length)return new Set(w).has(S)},x=S=>S.map(({placeholder:w,value:I,isSelected:C,icon:h,options:E})=>{let V;if(n){let y=i.current.find(k=>k.apiKey===I);V=y!==void 0?y.isSelected??false:(C||b(I)||E?.every(({value:k})=>b(k)))??false;}else V=(C||b(I)||E?.every(({value:y})=>b(y)))??false;return {...w&&{label:w},name:I,selected:V,...h&&{icon:h},...E?.length&&{menuItems:x(E)}}});t.options&&l(x(t.options));},[t?.data,p$1,n]);let d=()=>{i.current=[];},u=b=>{d(),e(b);},c$1=()=>{if(n){let b=new Set(t?.data?.[t.apiKey]??[]);i.current.forEach(({apiKey:x,options:S,isSelected:w})=>{S?S.forEach(({apiKey:I,isSelected:C})=>{C?b.add(I):b.delete(I);}):w?b.add(x):b.delete(x);}),t?.onConfirm?.({[t.apiKey]:[...b]});}else {let b=i.current.reduce((x,{options:S,apiKey:w,isSelected:I})=>{if(S){let C=S.filter(({isSelected:h})=>h);C.length&&x.push(...C.map(({apiKey:h})=>h));}else I&&x.push(w);return x},[]);i.current.length&&t?.onConfirm?.({[t.apiKey]:[...new Set(b)]});}d();},R=p(c$1,e),m=b=>{c$1(),e(b);},g=b=>{let x=w=>w.map(({name:I,selected:C,menuItems:h,label:E})=>({...E&&{placeholder:E},apiKey:I,isSelected:C,...h?.length&&{options:x(h)}})),S=x(b);if(n){let w=new Set(S.map(I=>I.apiKey));i.current=[...i.current.filter(I=>!w.has(I.apiKey)),...S];}else i.current=S;},f=o?.maxWidth??xt,T={maxWidth:f,width:`min(${f}, max-content)`};return jsx(c,{"data-testid":"ColumnFilter_List",title:s("filterBy")||"Filter by",menuItems:a,style:o,menuSx:T,sx:[b=>({...T,marginTop:"10px",textAlign:"left",boxShadow:b.shadows[3],overflow:"hidden",".nested-menu-item":{height:41,zIndex:9999}}),...(Array.isArray(t.sx)?t.sx:[t.sx]).filter(Boolean)],updatedList:g,header:r,onKeyDown:R,footer:jsxs(St,{sx:{position:"sticky",bottom:0,zIndex:99999},children:[jsx(Tt,{onClick:u,children:s("cancel")},"nested-dropdown-cancel"),jsx(yt,{onClick:m,children:s("okay")},"nested-dropdown-ok")]})})}var cn=memo(pa);var Rt=cn;function ha(e){let{anchorEl:t,setAnchorEl:o,onClose:r,isFilterApplied:n,disabled:a}=e,l=u=>{u.stopPropagation(),o(null),r?.(u);},s=useRef(null),i=!!t;useEffect(()=>{i&&requestAnimationFrame(()=>s.current?.focus());},[i]);let p=useMemo(()=>e.type==="list"?[e.apiKey]:(e?.options||[])?.map(({apiKey:u})=>u),[e]),d=useMemo(()=>{if(e.type==="list")return jsx(Rt,{onCloseDropdown:l,filter:e});if(e.type==="inputs")return jsx(wt,{onCloseDropdown:l,filter:e});if(e.type==="custom"){let u={anchorEl:t,setAnchorEl:o,onCloseDropdown:l};return e.render(u)}return null},[i,e,l]);return jsxs(Fragment,{children:[n?jsxs(sn,{children:[jsx(Ce,{component:"img","data-testid":"ColumnFilter_whiteFilterIcon",src:vi$1,alt:"filter-icon",sx:{marginInlineEnd:"2px",height:6}}),jsx(Ce,{component:"img","data-testid":"ColumnFilter_closeIcon",src:Ta,alt:"close-icon",onClick:u=>{u.stopPropagation(),o(null),e.onClear(p);}})]}):jsx(Ce,{component:"img","data-testid":"ColumnFilter_columnIcon",src:Da,alt:"column-icon",sx:{marginTop:"2px",userSelect:"none",opacity:a?.5:1}}),i&&jsx(B,{onClick:l}),jsx(ba,{open:i,anchorEl:t,placement:"bottom-start",children:jsx("div",{ref:s,tabIndex:-1,style:{outline:"none"},children:d})})]})}var hn=memo(ha);var Ye=hn;var uo=styled("img")(()=>({width:"13.3px",height:"13.3px"})),xn=styled("img")(()=>({width:"8px",height:"6.4px",cursor:"pointer"}));function Sa({onColumnSort:e,columnsSorting:t,columnId:o,onClick:r}){let[n,a]=useState(null),l=!!n,s=d=>{d.stopPropagation(),a(d.currentTarget),r?.(d);},i=d=>{d.stopPropagation(),a(null),r?.(d);},p=(d,u,c)=>{d&&(e?.({[d]:u}),i(c));};return jsxs(Fragment,{children:[jsx(xn,{onClick:s,src:Da,alt:"column-icon","data-id":o,sx:{userSelect:"none",marginTop:"2px"}}),l&&jsx(B,{onClick:i}),jsxs(R,{anchorEl:n,open:l,children:[jsxs(V,{isSelected:t?.[n?.dataset.id||""]==="asc",onClick:d=>{p(n?.dataset.id,"asc",d);},sx:d=>({...t?.[n?.dataset.id||""]==="asc"&&{boxShadow:d.shadows[10]}}),children:[jsx(uo,{src:Ea,alt:"sort-icon"}),jsx(j,{sx:{fontSize:"0.6875rem"},children:"Sort A-Z"})]}),jsxs(V,{isSelected:t?.[n?.dataset.id||""]==="desc",onClick:d=>{p(n?.dataset.id,"desc",d);},sx:d=>({...t?.[n?.dataset.id||""]==="desc"&&{boxShadow:d.shadows[10]}}),children:[jsx(uo,{src:Fa$1,alt:"sort-icon"}),jsx(j,{sx:{fontSize:"0.6875rem"},children:"Sort Z-A"})]})]})]})}var Cn=memo(Sa);var Et=Cn;var yn=Ae.forwardRef(({children:e,...t},o)=>jsxs(Fragment,{children:[jsx(Ce,{"data-testid":"VirtualScrollInner",className:"VirtualScrollInner",style:{position:"sticky",top:0},children:e}),jsx("div",{ref:o,...t})]}));yn.displayName="VirtualScrollInner";var co=yn;var Pt=createContext(null);var fo=({children:e,value:t})=>jsx(Pt.Provider,{value:t,children:e});var Tn=Ae.forwardRef(({onScroll:e,children:t,...o},r)=>{let n=useContext(Pt);return jsx("div",{className:"VirtualScrollOuter",onScroll:n,ref:r,...o,children:t})});Tn.displayName="VirtualScrollOuter";var bo=Tn;function Fa({setBackdropVisibility:e,clearBackdropVisibilityTimeout:t}){let o=useRef(void 0);return useEffect(()=>()=>{clearTimeout(o.current);},[]),{handleBackDropVisibility:()=>{e(true);},clearBackdropVisibility:()=>{o.current=setTimeout(()=>{e(false);},t||2e3);},clearTimer:()=>{clearTimeout(o.current);}}}var wn=Fa;var Ba=Ae.forwardRef(({itemData:e,children:t,setBackdropVisibility:o,scrollToIndex:r,listRef:n,onScroll:a,clearBackdropVisibilityTimeout:l,...s},i)=>{let{handleBackDropVisibility:p,clearBackdropVisibility:d,clearTimer:u}=wn({setBackdropVisibility:o,clearBackdropVisibilityTimeout:l}),c=useRef(0),R=useRef(void 0),m=useRef(false),g=useRef(null),f=i||n||g,T=useCallback(()=>(u(),R.current!==void 0&&f.current?(m.current=false,c.current=R.current,R.current=void 0,p(),f.current?.scrollTo?.(c.current),true):(d(),false)),[d,u,p,f]),b=Ae.useCallback(w=>{R.current=w.currentTarget.scrollTop,m.current||(m.current=true,T());},[T]);useEffect(()=>{(r||0)>=0&&!Number.isNaN(r)&&r!==void 0&&f.current?.scrollTo&&f.current?.scrollToItem(r,"center");},[r,f]);let x=Ae.useMemo(()=>({...e,renderedScrollTopRef:c}),[e]),S=Ae.useCallback(w=>{a?.(w),m.current=T();},[T,a]);return jsx(fo,{value:b,children:jsx(VariableSizeList,{ref:f,"data-testid":"VirtualScrollList",itemData:x,outerElementType:bo,innerElementType:co,...s,onScroll:S,children:t})})}),ho=Ba;var A=styled(Ce,{shouldForwardProp:e=>!["showNoDataView","compact","fixedHeight"].includes(e)})(({showNoDataView:e,compact:t,fixedHeight:o})=>({display:"flex",flexDirection:"column",height:o?`${o}px`:t?"auto":"100%",width:"100%",minWidth:e?"unset":"fit-content",overflow:"hidden",overflowX:e?"hidden":"auto",margin:"0px",...t&&{flex:"0 0 auto"}})),ue=styled(Ce,{shouldForwardProp:e=>e!=="hidePadding"})(({theme:e,hidePadding:t})=>({flex:"1 1 auto",backgroundColor:e.palette.grey[300],paddingBottom:t?0:ro})),He=styled(Ce)(({theme:e})=>({backgroundColor:e.palette.background.default})),Se=styled(TableCell,{shouldForwardProp:e=>!["isLast","isFirst","isSheetView","isSelected","$hasFilter","$isFilterDisabled"].includes(e)})(({theme:e,isLast:t,isFirst:o,isSheetView:r,$hasFilter:n,$isFilterDisabled:a})=>({paddingBlock:"0",paddingInline:"0.3875rem !important",paddingLeft:o?"0 !important":"0.3875rem !important",paddingRight:t?"0 !important":"0.3875rem !important",color:r?e.palette.text.primary:e.palette.grey[700],fontSize:r?e.typography.subtitle1.fontSize:e.typography.caption.fontSize,height:"100%",fontWeight:r?400:e.typography.fontWeightRegular,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",...n&&{cursor:"pointer"},...a&&{cursor:"not-allowed"},...r&&{borderRight:t?"1px solid transparent":`1px solid ${e.palette.divider}`,paddingInline:"8px !important",paddingLeft:"8px !important",paddingRight:"8px !important",position:"relative",borderTop:"1px solid transparent",borderLeft:"1px solid transparent",overflow:"hidden !important","&:before":{content:'""',borderRight:t?"none":"1px solid transparent",position:"absolute",top:0,right:0,left:0,bottom:0,pointerEvents:"none"}}})),kt=styled("button",{shouldForwardProp:e=>!["$hasFilter"].includes(e)})(({theme:e,$hasFilter:t,disabled:o})=>({zIndex:1,display:"flex",gap:e.spacing(.5),alignItems:"center",overflow:"hidden",maxWidth:"100%",textOverflow:"ellipsis",whiteSpace:"nowrap",backgroundColor:"transparent",border:"none",...t&&{cursor:"pointer"},...o&&{cursor:"not-allowed"},padding:0,margin:0,color:"inherit",fontSize:"inherit",fontWeight:"inherit",boxSizing:"border-box",":disabled":{cursor:"not-allowed"}})),Be=styled(ho,{shouldForwardProp:e=>!["areTotalRowsNotFillingHeight","isSheetView"].includes(e)})(({theme:e,areTotalRowsNotFillingHeight:t,isSheetView:o})=>({backgroundColor:t?"transparent":"#F6F8FACC",...o&&{backgroundColor:e.palette.common.white}})),vt=styled(_a,{shouldForwardProp:e=>!["showShadowHighlight","showLoadedStyle","isSheetView","isSelected","isChecked","adjacentBelow","adjacentAbove"].includes(e)})(({theme:e$1,showShadowHighlight:t,showLoadedStyle:o,isSheetView:r,isChecked:n,adjacentBelow:a,adjacentAbove:l})=>({display:"flex",borderBottom:`1px solid ${e$1?.palette.divider}`,position:"relative",height:"100%",width:"100%",...!r&&{paddingInline:"32px",...a&&{borderBottom:"none",clipPath:"inset(-20px -20px 0px -20px)","&::before":{content:'""',position:"absolute",bottom:0,left:"32px",right:"32px",height:"1px",backgroundColor:e$1.palette.divider,zIndex:1}},...l&&{clipPath:"inset(0px -20px -20px -20px)"},...a&&l&&{clipPath:"inset(0px -20px 0px -20px)"},"&:hover":{boxShadow:e$1.shadows[12],zIndex:1,[`.${e.root}`]:{visibility:"visible"},".payment-sources-container":{backgroundColor:e$1?.palette.common.white},".geography-box":{visibility:"visible"},".payout-status":{visibility:"visible !important"},"&:hover:after":{opacity:1}},"&::after":{content:"''",opacity:0,minHeight:"100%",background:e$1.palette.info.dark,width:"3px",position:"absolute",left:0},...n&&{boxShadow:e$1.shadows[12],zIndex:1,"&:after":{opacity:1},[`.${e.root}`]:{visibility:"visible"}},...o&&{backgroundColor:`${e$1.palette.info.dark}08 !important`},...t&&{boxShadow:e$1.shadows[12],zIndex:1,"&::after":{content:"''",opacity:1,minHeight:"100%",background:e$1.palette.info.dark,width:"3px",position:"absolute",left:0}}}})),ee=styled(Ce,{shouldForwardProp:e=>e!=="showNoDataView"&&e!=="scrollable"})(({theme:e,showNoDataView:t,scrollable:o})=>({position:"relative",backgroundColor:e.palette.background.default,height:"100%",overflowX:t?"hidden":"auto",display:"flex",flexDirection:"column","&:hover":{scrollbarWidth:o?"auto":"none"},"&::-webkit-scrollbar":{display:"block",height:"13px"},"&::-webkit-scrollbar-track":{background:"white",border:"1px solid #F2F2F2"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#DADCDF",borderRadius:"32px",border:"3px solid transparent",backgroundClip:"content-box",minHeight:"20px"}})),go=styled(motion.img)(()=>({width:"24px",height:"24px",position:"relative",zIndex:2})),Wt=styled(Ce)(()=>({position:"relative",display:"flex",flexDirection:"column",height:"100%"})),In=styled(Ce)(()=>({position:"relative",display:"flex",flexDirection:"column",height:"100%",paddingInline:"28px",borderRadius:"8px",marginBottom:"16px !important",overflowY:"hidden"})),En=styled(Ce,{shouldForwardProp:e=>e!=="showNoDataView"})(({showNoDataView:e})=>({position:"relative",height:"100%",overflowX:e?"hidden":"auto",paddingBottom:0,display:"flex",flexDirection:"column"})),Ft=styled(f,{shouldForwardProp:e=>!["isRow"].includes(e)})(({isRow:e})=>({position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",padding:0,...e&&{visibility:"hidden"}}));var Oa=e=>{let{filter:t,totalCount:o,isFilterEnabled:r}=e,n=useMemo(()=>t?.options?.reduce((i,{apiKey:p})=>({...i,[p]:t?.data?.[p]}),{})||{},[t]),a=useMemo(()=>{let i=t,p=i?.data?.[i.apiKey];return Array.isArray(p)?p:[]},[t]),l=useMemo(()=>Object.values(n||{}).some(i=>typeof i=="string"||Array.isArray(i)?i.length>0:i!=null)||a.length>0,[n,a]);return {isFilterApplied:l,filterDisabled:!l&&o===0&&!r}},Je=Oa;function Pn({column:{header:e,id:t,align:o,headerStyle:r,sortable:n,filter:a,width:l,order:s},isFirst:i,isLast:p,isSheetView:d,onColumnSort:u,columnsSorting:c,totalCount:R,isFilterEnabled:m}){let[g,f]=useState(null),T=useRef(null),b=!!a,{isFilterApplied:x,filterDisabled:S}=Je({filter:a,totalCount:R,isFilterEnabled:m});return jsx(Se,{"data-id":t,component:"div","data-testid":"VirtualTable_TableHeader_StyledCell","data-column-id":t,"data-column-width":l,"data-column-width-used":l,"data-column-align":o,"data-column-order":s,"data-column-header":typeof e=="string"?e:"component","data-column-sortable":!!n,"data-column-filterable":b,isFirst:i,isLast:p,ref:T,$hasFilter:b,$isFilterDisabled:S&&b,sx:I=>({paddingInline:"0.6875rem",paddingLeft:i?"0":"0.6875rem",paddingRight:p?"0":"0.6875rem",display:"flex",gap:I.spacing(.5),alignItems:"center",justifyContent:lc[o??"left"],width:l,textAlign:o,overflow:"unset",fontWeight:600,...r}),isSheetView:d,children:jsxs(kt,{disabled:S,$hasFilter:b,onClick:()=>{f(T.current);},children:[typeof e=="function"?e():jsx(Ce,{"data-testid":"TableHeader_columns_header",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e&&jsx("span",{style:{textOverflow:"ellipsis",width:"80%",overflow:"hidden"},"data-testid":"VirtualTable_TableHeader_StyledCell_header_text",children:e})}),a&&jsx(Ye,{...a,anchorEl:g,setAnchorEl:f,isFilterApplied:x,disabled:S}),n&&jsx(Et,{onColumnSort:u,columnsSorting:c,columnId:t})]})})}var Co=Pn;var Ln=styled(Ka,{shouldForwardProp:e=>e!=="showBackDrop"})(({showBackDrop:e,theme:t})=>({flex:"0 0 auto",boxShadow:e?t.shadows[23]:"none",backgroundColor:t.palette.background.default,zIndex:1,width:"100%",minWidth:"auto",overflowX:"auto",cursor:"auto"})),kn=styled(_a,{shouldForwardProp:e=>e!=="isSheetView"})(({theme:e,isSheetView:t})=>({display:"flex",justifyContent:"flex-start",width:"100%",minWidth:"fit-content",position:"relative",paddingInline:"32px",paddingBlock:"16px",...t&&{height:"28px",borderBottom:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.primary.light,paddingInline:0,paddingBlock:0}}));function Ya({columns:e,headerProps:t,showBackDrop:o,onColumnSort:r,columnsSorting:n,isSheetView:a,totalCount:l,isFilterEnabled:s,selection:i,selectableCount:p=0,getSelectableKeys:d}){let u=i&&i.ids.length>0,c=i&&p>0&&i.ids.length===p,R=useCallback(()=>{i&&i.setIds(c?[]:d?.()??[]);},[i,c,d]);return jsx(Ln,{component:"nav","data-testid":"VirtualTable_TableHeader_StyledHeader",showBackDrop:o,...t,children:jsxs(kn,{component:"section","data-testid":"VirtualTable_TableHeader_StyledMUITableRow",isSheetView:a,children:[u&&jsx(Ft,{size:"small",checked:c,indeterminate:u&&!c,onChange:R,onClick:m=>m.stopPropagation()}),e.map((m,g)=>jsx(Co,{column:m,isFirst:m.id===e[0].id,isLast:m.id===e[e.length-1].id,onColumnSort:r,columnsSorting:n,isSheetView:a,totalCount:l,isFilterEnabled:s},`${m.id}-${g}`))]})})}var vn=memo(Ya);var yo=vn;var tl=styled(Ce,{shouldForwardProp:e=>e!=="sandboxMode"&&e!=="height"})(({theme:e,sandboxMode:t})=>({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flex:1,position:"sticky",left:0,background:t?e.palette.common.lightOrange:e.palette.grey[300],backdropFilter:"blur(32px)",margin:0,minHeight:"55px"})),To=styled("p")(({theme:e})=>({fontSize:"0.75rem",fontWeight:600,color:alpha(e.palette.common.black,.2)}));function ol({height:e,sandboxMode:t,...o}){let{t:r}=useTranslation();return jsx(tl,{component:"section","data-testid":"TableLastItem",...o,height:e,sandboxMode:t,children:jsx(To,{children:r("allRecordsHaveBeenSuccessfullyLoaded")})})}var wo=ol;var dl=styled(nl)(({theme:e})=>({backgroundColor:e.palette.grey[100],borderRadius:"64px",minWidth:"20px"}));function pl({columns:e,style:t,index:o,animationType:r}){return jsx(_a,{sx:{...t,display:"flex",borderBottom:"1px solid #e3e8ee","&:hover":{backgroundColor:"transparent !important"}},component:"div",hover:true,children:e.map((n,a)=>jsx(al,{sx:{width:n.width||`${100/e.length}%`||"20%",paddingInline:"0.6875rem"},component:"div",children:jsx(dl,{variant:"rectangular",animation:r})},`${n.id}-${a}`))},o)}var Io=memo(pl,areEqual);var fl=styled("section")(({isLoaded:e=false})=>({overflow:"hidden",paddingInline:"32px",backgroundColor:e?"rgba(255, 255, 255, 0.60)":"none",filter:e?"blur(8px)":"none",marginTop:e?"1rem":"0.2rem"}));function bl({columns:e,isLoaded:t=false,animationType:o,isLoading:r=false,rowsCount:n}){let a=n||Va(t,r);return a=a>0?a:5,jsx(fl,{isLoaded:t,"data-testid":"TableLoading",children:[...Array(a)].map(()=>jsx(Io,{columns:e,animationType:o},`i-${cl("TableLoadingRow_")}`))})}var Eo=memo(bl);var Bn=styled(Ce,{shouldForwardProp:e=>e!=="sandboxMode"})(({theme:e,sandboxMode:t})=>({display:"flex",flexDirection:"column",height:"100%",width:"100%",justifyContent:"center",alignItems:"center",textAlign:"center",background:t?e.palette.common.lightOrange:e.palette.grey[300],backdropFilter:"blur(32px)",gap:"0.5rem"})),zn=styled(Ce,{shouldForwardProp:e=>e!=="shouldMinimizeWidth"})(({shouldMinimizeWidth:e})=>({width:e?"9rem":"15rem",display:"flex",flexDirection:"column",alignItems:"center"})),_n=styled("h1")(({theme:e})=>({fontWeight:600,fontSize:"1.125rem",color:e.palette.text?.primary,padding:0,margin:0})),An=styled("p")(({theme:e})=>({fontWeight:400,fontSize:"0.75rem",color:e.palette.text?.primary,opacity:.5,padding:0,marginTop:3,textAlign:"center"})),On=styled("img")(()=>({width:"2rem",height:"2rem"})),Nn=styled(Button)(({theme:e})=>({padding:" 0.625rem 1rem",display:"flex",justifyContent:"center",alignItems:"center",gap:"0.5rem",backgroundColor:alpha(e.palette.info.dark,.1),borderRadius:"0.25rem",color:e.palette.info.dark,"&:hover":{backgroundColor:alpha(e.palette.info.dark,.1),color:e.palette.info.dark},width:"6rem",height:"1.8rem",marginTop:"1.5rem"})),$n=styled("p")(({theme:e})=>({color:e.palette.info.dark,fontSize:"0.8rem",fontWeight:600,textTransform:"none"}));function xl({triggerDataRefetch:e,heading:t,message:o,shouldMinimizeWidth:r,sandboxMode:n,hideIcon:a,hideTryAgain:l,...s}){let{t:i}=useTranslation();return jsx(Bn,{sandboxMode:n,...s,children:jsxs(zn,{shouldMinimizeWidth:r,children:[!a&&jsx(On,{src:F,alt:"info icon"}),jsx(_n,{children:i(t)}),jsx(An,{children:i(o)}),!l&&jsx(Nn,{variant:"contained",onClick:()=>{e();},children:jsx($n,{children:i("tryAgain")})})]})})}var te=xl;var Mt=te;var Un=styled$1("h1")(({theme:e})=>({fontWeight:600,fontSize:"1rem",color:e.palette.text?.primary,padding:0,margin:0})),Xn=styled$1("p")(({theme:e})=>({fontWeight:400,fontSize:"0.75rem",color:e.palette.text?.primary,padding:0,marginTop:3,opacity:.5})),Kn=styled$1(Ce,{shouldForwardProp:e=>e!=="sandboxMode"})(({theme:e,sandboxMode:t})=>({display:"flex",flexDirection:"column",height:"100%",width:"100%",justifyContent:"center",alignItems:"center",textAlign:"center",background:t?e.palette.common.lightOrange:e.palette.grey[300],backdropFilter:"blur(32px)",gap:"0.5rem"})),Po=styled$1("img")(()=>({width:"2rem",height:"2rem"}));function jn({sandboxMode:e,heading:t,message:o,...r}){let{t:n}=useTranslation();return jsxs(Kn,{component:"section","data-testid":"EmptyList",sandboxMode:e,...r,children:[jsx(Po,{src:Sh,alt:"empty container"}),jsx(Un,{children:n(t)}),jsx(Xn,{children:n(o)})]})}jn.displayName="EmptyList";var Ht=memo(jn);var qn=Ht;var Il=e=>{let{isTimeoutError:t,tableError:o,triggerDataRefetch:r,sandboxMode:n,tableEmpty:a,error:l}=e;if(t)return jsx(Mt,{"data-testid":"VirtualTable_ErrorList_timeoutError",shouldMinimizeWidth:true,heading:"timeOut",message:"yourRequestOutPleaseTryAgain",triggerDataRefetch:r,sandboxMode:n});let s=l;if(o){let{formatted:i,message:p,code:d}=Ub({error:s,fallbackMessage:"connectionErrorMsg"}),u=pb()&&d===Pn$1;return jsx(Mt,{"data-testid":"VirtualTable_ErrorList_tableError",heading:"somethingWentWrong",message:u?p:i,triggerDataRefetch:r,sandboxMode:n,hideIcon:u,hideTryAgain:u})}if(a){let{formatted:i}=Ub({error:s,fallbackMessage:"tryAdjustingTheDateOrFilters"});return jsx(qn,{sandboxMode:n,heading:"nothingFound",message:i})}return jsx(Mt,{"data-testid":"VirtualTable_ErrorList_tableError",heading:"somethingWentWrong",message:"connectionErrorMsg",triggerDataRefetch:r,sandboxMode:n})},Lo=memo(Il);function Gn({error:e,tableEmpty:t,isTimeoutError:o,tableError:r,tableLoading:n,orderedColumns:a,triggerDataRefetch:l,footerProps:s}){return n?jsx(He,{"data-testid":"VirtualTable_SolidBackground",children:jsx(Eo,{"data-testid":"VirtualTable_TableLoading",columns:a,isLoading:true})}):jsx(Lo,{isTimeoutError:o,tableEmpty:t,tableError:r,sandboxMode:s?.sandboxMode,error:e,triggerDataRefetch:l})}Gn.displayName="TableNoData";var Qe=memo(Gn);function Wo(){return jsx(motion.div,{initial:{width:0},animate:{width:"fit-content",transition:{duration:.5}},exit:{width:0},style:{paddingInline:"11px",paddingBlock:"5px",boxShadow:"0px 0px 1px 0px rgba(0, 0, 0, 0.10), 0px 1px 1px 0px rgba(0, 0, 0, 0.09), 0px 2px 1px 0px rgba(0, 0, 0, 0.05), 0px 4px 2px 0px rgba(0, 0, 0, 0.01), 0px 7px 2px 0px rgba(0, 0, 0, 0.00)",borderRadius:"24px",overflow:"hidden",display:"inline-block",whiteSpace:"nowrap"},children:jsxs(motion.span,{style:{color:"#8F9195",fontSize:"12px",fontWeight:600,display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},children:[jsx(motion.span,{children:"!"}),jsx(motion.span,{children:"Error while loading"})]})})}function Wl({row:e,columns:t,index:o,rowProps:r,isSheetView:n,selectedCell:a=null,selectedColumn:l=null,selectedRow:s=null,selectedChip:i=null,onCellClick:p,isLastRow:d=false,onChipClick:u,selection:c,hasAdjacentCheckedAbove:R,hasAdjacentCheckedBelow:m}){let g=c?e[c.selector]:void 0,f=c&&c.ids.includes(g),T=c?.isDisabled?.(e),b=Ae.useCallback(()=>{!c||T||c.setIds(f?c.ids.filter(h=>h!==g):[...c.ids,g]);},[c?.setIds,c?.ids,f,T,g]),x=Ae.useCallback((h,E)=>(V,y)=>{u?.(o,h,V,y,E);},[u,o]),S=Ae.useCallback((h,E,V)=>{let{render:y,format:k,selector:P}=h;if(!h?.id||!e)return null;let L=P?P({row:e,index:o,value:e[h?.id]}):e[h?.id],v=k?k({value:L,row:e,index:o}):L;return y?y({row:e,column:h,index:o,value:e[h?.id],selectionProps:{onClick:x(V,h.pinned),rowIndex:E,colIndex:V,selectedId:i}}):jsx(Fragment,{children:v})},[e,o,i,x]),w=a!==null||l!==null||s!==null,I=Ae.useCallback((h,E)=>V=>{p?.(o,h,V,E);},[p,o]),C=useMemo(()=>{let h=t[0]?.id,E=t[t.length-1]?.id,V=s===o;return jsx(Fragment,{children:t.map((y,k)=>{if(!y?.id)return null;let P=`${y.pinned??"default"}-${o}-${k}`,L=`${y.pinned??"default"}-${k}`,v=w&&a===P,F=w&&l===L,z=jc({isSelected:w&&(v||F||V),isCellSelected:v,isColumnSelected:F,isRowSelected:V,isLastRow:d}),_=y.id===h,K=y.id===E,W=y.pinned?_:_&&y.pinned!=="start",H=y.pinned?K:K&&y.pinned!=="end",N=V&&w?kc({effectiveFirst:W,isPinnedStart:y.pinned==="start",isPinnedEnd:y.pinned==="end"}):{},$=y.pinned==="start"&&W;return jsx(Se,{component:"div","data-testid":"TableRow_TableCell","data-column-id":y.id,"data-column-width":y.width,"data-column-width-used":y.width,"data-column-align":y.align,"data-column-order":y.order,"data-column-header":typeof y.header=="string"?y.header:"component","data-column-sortable":!!y.sortable,"data-column-filterable":!!y.filter,isFirst:W,isLast:H,onClick:I(k,y.pinned),sx:{width:y.width,minWidth:y.width,textAlign:y.align,justifyContent:lc[$?"center":y.align??"left"],cursor:p?"pointer":"default",...z,...N,...y.cellStyle},isSheetView:n,isSelected:v,children:n?jsx(Box,{sx:{position:"relative",zIndex:1,width:"100%"},children:S(y,o,k)}):jsx(Fragment,{children:S(y,o,k)})},`${y.id}-${k}`)})})},[t,e,o,a,l,s,w,p,d,i,n,S,I]);return createElement(vt,{"data-testid":"TableRow",onClick:r?.onRowClick,showShadowHighlight:r?.showShadowHighlight,showLoadedStyle:r?.showLoadedStyle,component:"article",...r,key:o,isSheetView:n,isChecked:f,adjacentAbove:R,adjacentBelow:m},c&&jsx(Ft,{isRow:true,size:"small",checked:f,onChange:b,disabled:T}),C)}var Mo=memo(Wl,areEqual);var Ol=styled(nl)(()=>({backgroundColor:"#F4F4F4",borderRadius:"64px",width:"100%",minWidth:"20px"}));function Nl({columns:e,style:t,index:o,animationType:r,rowIndex:n=0,useTableBackground:a=false}){let l=useTheme();return jsx(_a,{sx:{...t,display:"flex",borderBottom:"1px solid #F2F2F2",minHeight:"28px",height:"28px",alignItems:"center",backgroundColor:a?l.palette.background.default:"transparent","&:hover":{backgroundColor:"transparent !important"}},component:"div",hover:true,children:e.map((s,i)=>{let p=i===e.length-1,d=i===0,u=s.pinned==="start",c=d&&u;return jsx(al,{sx:{width:s.width||`${100/e.length}%`||"20%",paddingBlock:"0",paddingInline:"8px !important",paddingLeft:"8px !important",paddingRight:"8px !important",borderRight:p?"none":"1px solid #F2F2F2",borderLeft:d?"1px solid #F2F2F2":"none",height:"100%",display:"flex",alignItems:"center",boxSizing:"border-box",whiteSpace:"nowrap",overflow:"hidden"},component:"div",children:c&&s.render?s.render({index:n,row:{},column:s,value:n+1}):jsx(Ol,{variant:"rectangular",animation:r,height:16})},`${s.id}-${i}`)})},o)}var et=memo(Nl,areEqual);var Xl=Ae.memo(({isLoadingRow:e,isSheetView:t,columns:o,currentRowCount:r})=>{let{t:n}=useTranslation();return e?t&&o?.length?jsx(Fragment,{children:Array.from({length:3},(a,l)=>jsx(et,{columns:o,animationType:"wave",rowIndex:(r||0)+l,useTableBackground:true},`loading-row-${l}`))}):jsxs(Box,{"data-testid":"ListItemWrapper_lastRowContent_isLoadingRow",sx:{height:t?"100%":"24px",width:"24px",borderRadius:"50%",background:"transparent",position:"relative",display:"flex",justifyContent:"center",alignItems:"center"},children:[jsx(go,{sx:{position:"absolute"},src:ni$1}),jsx(go,{sx:{position:"absolute",padding:"3px"},src:ti,alt:"tableLoadingSpinnerIcon",className:"spinner-loader",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}})]}):jsx(To,{"data-testid":"ListItemWrapper_lastRowContent",children:n("allRecordsHaveBeenSuccessfullyLoaded")})}),Kl=(e,t)=>o=>{o?.stopPropagation?.(),t?.(e);},jl=styled("div",{shouldForwardProp:e=>e!=="showShadowHighlight"&&e!=="isSheetView"})(({theme:e,isSheetView:t})=>({height:t?28:"100%",backgroundColor:e.palette.background.default}));function ql({index:e,style:t,data:{renderedScrollTopRef:o,rows:r,rowProps:n,columns:a,isLoading:l,scrollToIndex:s,newLoadedRowsEndIndex:i,isError:p,areAllRowsLoaded:d,isSheetView:u,isPinned:c=false,isLoadMoreLoading:R=false,...m}}){let g=r.length-1,{hasAdjacentCheckedAbove:f,hasAdjacentCheckedBelow:T}=Ae.useMemo(()=>{let E=m.selection;if(!E)return {hasAdjacentCheckedAbove:false,hasAdjacentCheckedBelow:false};let V=r[e]?.[E.selector];if(!E.ids.includes(V))return {hasAdjacentCheckedAbove:false,hasAdjacentCheckedBelow:false};let k=e>0?r[e-1]?.[E.selector]:void 0,P=e<g?r[e+1]?.[E.selector]:void 0;return {hasAdjacentCheckedAbove:k!==void 0&&E.ids.includes(k),hasAdjacentCheckedBelow:P!==void 0&&E.ids.includes(P)}},[m.selection?.ids,m.selection?.selector,r,e,g]),b=r[e],x=l&&e===g+1,S=e<=i,w=Ae.useCallback(()=>Kl(b,n?.onRowClick),[b,n?.onRowClick]),I=Ae.useMemo(()=>({showShadowHighlight:s===e,showLoadedStyle:S,...n,onClick:w}),[s,e,S,n,w]),C=Ae.useCallback(E=>jsx(Box,{sx:{minHeight:28,height:"100%",width:"100%"},children:p?jsx(Wo,{}):E}),[p]),h=Ae.useMemo(()=>{let E=jsx(Xl,{isSheetView:u,isLoadingRow:x,columns:a,currentRowCount:r.length}),V=x||d&&e===g+1;return c&&V?u&&x&&a&&a.length>0?C(E):jsx(Box,{sx:{...u?{minHeight:28,height:"100%"}:{height:57},backgroundColor:"#F6F8FACC"}}):V?u&&x&&a&&a.length>0?C(E):jsx(Box,{sx:{...u?{minHeight:28,height:"100%"}:{height:57},display:"flex",justifyContent:"center",alignItems:"center"},children:jsx(Box,{sx:{backgroundColor:"#F6F8FACC",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:p?jsx(Wo,{}):E})}):jsx(Mo,{index:e,row:b,columns:a,rowProps:I,isSheetView:u,isLastRow:e===r.length-1,isFirstRow:e===0,isLoading:l,isLoadMoreLoading:R,hasAdjacentCheckedAbove:f,hasAdjacentCheckedBelow:T,...m},`row-${e}`)},[m,e,b,a,I,u,x,p,d,g,c,r.length,C,R]);return jsx("div",{"data-testid":"ListItemWrapper",style:{...t,top:Number(t.top)-(o?.current??0),willChange:"top"},children:jsx(jl,{"data-testid":"ListItemWrapper_StyledItemWrapper",isSheetView:u,children:h})})}var At=ql;var ns=ts((e,t,o,r,n,a,l,s,i,p,d)=>({columns:e,isLoading:t,rows:o,rowProps:r,scrollToIndex:n,totalCount:l,lastItemIndex:a,isError:s,areAllRowsLoaded:i,isSheetView:p,selection:d}));function is({columns:e,rows:t,threshold:o=200,showHeader:r,headerProps:n,rowProps:a,footerProps:l,isLoading:s,error:i,columnsSorting:p,onColumnSort:d,loadMoreItems:u,isFetchingNextPage:c,triggerDataRefetch:R,scrollToIndex:m,areAllRowsLoaded:g=false,tableBodyStyles:f,tableMode:T,tableTitle:b$1,isSheetView:x=false,isMinimized:S,footerComponent:w,customNoDataComponent:I,defaultSkeleton:C=false,selection:h,isFilterEnabled:E}){let V=useTheme(),y=b({value:c,delay:1e3}),[k,P]=useState(false),[L,v]=useState("INITIAL_KEY");useEffect(()=>{let B=`${l?.maximized}-${S}`,U=requestAnimationFrame(()=>v(B));return ()=>cancelAnimationFrame(U)},[l?.maximized,S]);let F=Rb(i),M=s??true,z=!s&&t.length===0&&F&&!Tb(i),_=!s&&t.length===0,K=Sb(i),W=t.length-1,H=useMemo(()=>uc(e,s??false,C),[e,s,C]),N=useMemo(()=>H.filter(B=>!B.hidden),[H]),$=useMemo(()=>N.sort((B,U)=>(B?.order??1e6)-(U?.order??1e6)),[N]),D=useMemo(()=>h?h.isDisabled?t.filter(B=>!h.isDisabled(B)).length:t.length:0,[t,h?.isDisabled]),Gt=useCallback(()=>h?(h.isDisabled?t.filter(U=>!h.isDisabled(U)):t).map(U=>U[h.selector]):[],[t,h?.isDisabled,h?.selector]),J=Wa(t.length)&&!M,re=y||g&&!J?t.length+1:t.length,Ue=ns($,y,t,a,m,W,l?.totalCount??0,F,g&&!J,x,h),ne=x?28:57,be=useRef(null);useEffect(()=>{be.current&&typeof be.current.resetAfterIndex=="function"&&be.current.resetAfterIndex(0,true);},[x,ne]);let at=useMemo(()=>{let B=ge=>{P(ge);};return jsx(rs,{"data-testid":"VirtualTable_InfiniteLoader",isItemLoaded:ge=>ge!==W,itemCount:re,loadMoreItems:async()=>{g||await u?.();},threshold:o,children:({onItemsRendered:ge,ref:Yt})=>jsx(os,{ref:Yt,"data-testid":"VirtualTable_AutoSizer",children:({height:Jt,width:lt})=>jsx(Be,{"data-testid":"VirtualTable_VirtualList",useIsScrolling:true,className:"list",itemData:Ue,height:J?re*ne:Jt||0,width:lt||0,itemCount:re,itemSize:()=>ne,onItemsRendered:ge,setBackdropVisibility:B,areTotalRowsNotFillingHeight:J,scrollToIndex:m,overscanCount:5,isSheetView:x,listRef:be,style:{paddingBottom:"13px"},children:At})},L)})},[W,u,o,g,J,re,ne,x,Ue,m,L]),he=M||z||_||K;return jsxs(Fragment,{children:[jsx(Wt,{children:jsxs(ee,{as:"main",id:"table-box-container","aria-labelledby":"table-box-container","data-testid":"VirtualTable_StyledTableBox","data-title":b$1,"data-direction":V.direction,"data-are-all-rows-loaded":!!g,"data-is-fetching-next-page":!!c,"data-scroll-to-index":m,"data-is-loading":!!s,"data-is-error":!!F,"data-is-error-timeout":!!K,"data-table-mode":T,height:"100%",dir:V.direction,showNoDataView:he,scrollable:true,children:[jsxs(A,{"data-testid":"VirtualTable_TableWrapper",showNoDataView:he,compact:!he&&J,sx:{...f},children:[r&&jsx(yo,{"data-testid":"VirtualTable_TableHeader",columnsSorting:p,onColumnSort:d,columns:$,headerProps:n,showBackDrop:k,isSheetView:x,totalCount:l?.totalCount??0,selection:h,selectableCount:D,getSelectableKeys:Gt,isFilterEnabled:E}),he?I||jsx(Qe,{error:i,tableEmpty:_,isTimeoutError:K,tableError:z,tableLoading:M,orderedColumns:$,triggerDataRefetch:R,footerProps:l}):jsx(A,{"data-testid":"VirtualTable_TableWrapper",fixedHeight:J?re*ne:void 0,sx:{width:"100%",minWidth:"fit-content"},children:jsx(ue,{"data-testid":"VirtualTable_StyledBox",hidePadding:true,className:"list-wrapper",children:at})})]}),!he&&J&&!c&&jsx(wo,{height:(re+1)*ne,sandboxMode:l?.sandboxMode,"data-testid":"VirtualTable_TableLastItem"})]})}),l&&jsx(Me,{"data-testid":"VirtualTable_TableFooter",showSeparator:true,showBackDrop:k,selectedCount:h?.ids.length,...l}),w]})}var as=memo(is);var Bo=Me;function us({style:e,index:t,cardLoadingComponent:o}){return jsx(_a,{sx:{...e,display:"flex",padding:0,"&:hover":{backgroundColor:"transparent !important"}},component:"div",children:jsx(al,{sx:{padding:0,flex:1},component:"div",children:o})},t)}var zo=memo(us,areEqual);var hs=styled("section")(({isLoaded:e=false})=>({overflow:"hidden",paddingInline:"32px",backgroundColor:e?"rgba(255, 255, 255, 0.60)":"none",filter:e?"blur(8px)":"none",marginTop:e?"1rem":"0.2rem"}));function gs({isLoaded:e=false,isLoading:t=false,rowsCount:o,cardLoadingComponent:r}){let n=o||Va(e,t);return n=n>0?n:5,jsx(hs,{isLoaded:e,"data-testid":"TableLoadingWithCard",children:[...Array(n)].map(()=>jsx(zo,{cardLoadingComponent:r},`i-${cl("TableLoadingRow_")}`))})}var _o=memo(gs);function ei({error:e,tableEmpty:t,isTimeoutError:o,tableError:r,tableLoading:n,triggerDataRefetch:a,footerProps:l,cardLoadingComponent:s,noDataComponent:i}){let p;if(n)p=jsx(He,{"data-testid":"VirtualTable_SolidBackground",children:jsx(_o,{"data-testid":"VirtualTable_TableLoading",isLoading:true,cardLoadingComponent:s})});else if(o)p=jsx(te,{"data-testid":"VirtualTable_ErrorList_timeoutError",shouldMinimizeWidth:true,heading:"timeOut",message:"yourRequestOutPleaseTryAgain",triggerDataRefetch:a,sandboxMode:l?.sandboxMode});else if(r){let d=e,{formatted:u}=Ub({error:d,fallbackMessage:"connectionErrorMsg"});p=jsx(te,{"data-testid":"VirtualTable_ErrorList_tableError",heading:"somethingWentWrong",message:u,triggerDataRefetch:a,sandboxMode:l?.sandboxMode});}else t?p=i:p=jsx(te,{"data-testid":"VirtualTable_ErrorList_tableError",heading:"somethingWentWrong",message:"connectionErrorMsg",triggerDataRefetch:a,sandboxMode:l?.sandboxMode});return p}ei.displayName="TableNoDataWithCard";var Ao=memo(ei);function ys({row:e,index:t,rowProps:o,renderCardComponent:r}){return createElement(vt,{"data-testid":"TableRow",onClick:o?.onRowClick,showShadowHighlight:o?.showShadowHighlight,showLoadedStyle:o?.showLoadedStyle,component:"article",...o,key:t},r&&jsx(r,{...e}))}var Oo=memo(ys,areEqual);var Is=(e,t)=>o=>{o?.stopPropagation?.(),t?.(e);},Es=styled("div",{shouldForwardProp:e=>e!=="showShadowHighlight"})(({theme:e})=>({backgroundColor:e.palette.background.default,height:"100%"}));function Ps({index:e,style:t,data:{renderedScrollTopRef:o,rows:r,rowProps:n,isLoading:a,scrollToIndex:l,newLoadedRowsEndIndex:s,areAllRowsLoaded:i,renderCardComponent:p}}){let d=r.length-1,u=r[e],c=a&&e===d+1,R=e<=s,m=Ae.useCallback(Is(u,n?.onRowClick),[u,n?.onRowClick]),g=Ae.useMemo(()=>({showShadowHighlight:l===e,showLoadedStyle:R,...n,onClick:m}),[l,e,R,n,m,c,i,d]),f=Ae.useMemo(()=>jsx(Oo,{index:e,row:u,renderCardComponent:p,rowProps:g},`row-${e}`),[e,u,g]);return jsx("div",{"data-testid":"ListCardWrapper",style:{...t,top:Number(t.top)-o.current,willChange:"top"},children:jsx(Es,{"data-testid":"ListCardWrapper_StyledItemWrapper",children:f})})}var Uo=Ps;var Hs=ts((e,t,o,r,n,a,l,s,i)=>({isLoading:e,rows:t,rowProps:o,scrollToIndex:r,totalCount:a,lastItemIndex:n,isError:l,areAllRowsLoaded:s,renderCardComponent:i}));function Bs({rows:e,threshold:t=200,rowProps:o,footerProps:r,rowHeight:n=57,isLoading:a,error:l,tableHeader:s,loadMoreItems:i,isFetchingNextPage:p,triggerDataRefetch:d,scrollToIndex:u,areAllRowsLoaded:c=false,tableBodyStyles:R,tableMode:m,tableTitle:g,renderCardComponent:f,cardLoadingComponent:T,tableHeight:b$1,tableHeaderHeight:x,noDataComponent:S}){let w=useTheme(),I=b({value:p,delay:1e3}),[C,h]=useState(false),E=Rb(l),V=a??true,y=!a&&e.length===0&&E&&!Tb(l),k=!a&&e.length===0,P=Sb(l),L=e.length-1,v=Wa(e.length)&&!V,F=I||c&&!v?e.length+1:e.length,M=Hs(I,e,o,u,L,r?.totalCount??0,E,c&&!v,f),z=useMemo(()=>{let K=H=>{h(H);};return jsx(rs,{"data-testid":"VirtualTable_InfiniteLoader",isItemLoaded:H=>H!==L,itemCount:F,loadMoreItems:async()=>{c||await i?.();},threshold:t,children:({onItemsRendered:H,ref:N})=>jsx(Ce,{sx:{height:`${b$1-(x??0)}px`},id:"auto-sizer-wrapper",children:jsx(os,{ref:N,"data-testid":"VirtualTable_AutoSizer",children:({height:$,width:D})=>jsx(Be,{"data-testid":"VirtualTable_VirtualList",useIsScrolling:true,className:"list",itemData:M,height:$||0,width:D||0,itemCount:F,itemSize:()=>n,onItemsRendered:H,setBackdropVisibility:K,areTotalRowsNotFillingHeight:v,scrollToIndex:u,overscanCount:5,children:Uo})})})})},[l,a,L,i,n,e,o,y,V,t,I,c,v,F]),_=V||y||k||P;return jsxs(Fragment,{children:[jsx(Wt,{children:jsx(En,{as:"main",id:"table-box-container","aria-labelledby":"table-box-container","data-testid":"VirtualTable_StyledTableBox","data-title":g,"data-direction":w.direction,"data-are-all-rows-loaded":!!c,"data-is-fetching-next-page":!!p,"data-scroll-to-index":u,"data-is-loading":!!a,"data-is-error":!!E,"data-is-error-timeout":!!P,"data-table-mode":m,dir:w.direction,showNoDataView:_,sx:{height:`${b$1}px !important`},children:jsxs(A,{"data-testid":"VirtualTable_TableWrapper",showNoDataView:_,sx:{...R},children:[s,_?jsx(Ao,{error:l,tableEmpty:k,isTimeoutError:P,tableError:y,tableLoading:V,triggerDataRefetch:d,footerProps:r,cardLoadingComponent:T,noDataComponent:S}):z]})})}),jsx(Bo,{"data-testid":"VirtualTable_TableFooter",showSeparator:true,showBackDrop:C,sx:{marginTop:"-37px"},...r})]})}var zs=memo(Bs);var Eh=styled("img")(()=>({width:"13.3px",height:"13.3px"})),Ph=styled("img")(()=>({width:"8px",height:"6.4px",cursor:"pointer",marginTop:"2px"})),oi=styled("span")(({theme:e})=>({color:e.palette.text.primary,textOverflow:"ellipsis",width:"80%",overflow:"hidden",fontSize:"12px",fontWeight:600})),ri=styled("div")(()=>({width:"16px",height:"auto",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"2px",padding:"2px",transition:"all 0.2s ease"})),ni=styled(Ka,{shouldForwardProp:e=>e!=="showBackDrop"})(({showBackDrop:e,theme:t})=>({flex:"0 0 auto",boxShadow:e?t.shadows[23]:"none",backgroundColor:t.palette.background.default,zIndex:1,width:"100%",minWidth:"auto",overflowX:"auto"})),ii=styled(_a)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",width:"100%",minWidth:"fit-content",height:"28px",backgroundColor:e.palette.primary.light})),Xo=styled("div")({display:"flex",width:"100%",height:"100%",overflow:"hidden",borderRadius:"12px"}),ai=styled("div")(({theme:e})=>({width:"auto",zIndex:10,flex:"0 0 auto",minWidth:0,display:"flex",flexDirection:"column",position:"relative",backgroundColor:e.palette.primary.light,borderTop:"1px solid #F2F2F2",borderBottom:"1px solid #F2F2F2",overflow:"hidden"})),li=styled(ai)({boxShadow:"4px 0px 24px 0px #00000014",borderLeft:"1px solid #F2F2F2",borderRight:"none",borderTopLeftRadius:"12px",borderBottomLeftRadius:"12px"}),si=styled(ai)({boxShadow:"-4px 0px 24px 0px #00000014",borderRight:"1px solid #F2F2F2",borderLeft:"none",borderTopRightRadius:"12px",borderBottomRightRadius:"12px"}),Ot=styled("div",{shouldForwardProp:e=>e!=="hasPinnedStart"&&e!=="hasPinnedEnd"})(({hasPinnedStart:e,hasPinnedEnd:t})=>({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",borderTop:"1px solid #F2F2F2",borderBottom:"1px solid #F2F2F2",borderLeft:e?"none":"1px solid #F2F2F2",borderRight:t?"none":"1px solid #F2F2F2",position:"relative",scrollbarWidth:"auto",overflow:"hidden",borderTopLeftRadius:e?"0":"12px",borderBottomLeftRadius:e?"0":"12px",borderTopRightRadius:t?"0":"12px",borderBottomRightRadius:t?"0":"12px"})),Oe=styled("div")({flexShrink:0,height:"auto",overflow:"auto"});var Ko=(e,t,o)=>{let[r,n]=useState(()=>{let m=t?e.filter(f=>f.pinned==="start").map(f=>f.id):[],g=e.filter(f=>f.isDefaultPinned&&f.pinned!=="end").map(f=>f.id);return Array.from(new Set([...g,...m]))}),[a,l]=useState(()=>{let m=e.filter(b=>b.isDefaultPinned&&b.pinned==="end").map(b=>b.id);if(!t)return m;let g=e.filter(b=>b.pinned==="end").map(b=>b.id),f=e.filter(b=>!b.hidden),T=f[f.length-1];return g.length===0&&T&&!T.pinned&&!T.isDefaultPinned?[T.id]:g}),s=useCallback((m,g="start")=>{if(!t)return;let f=[...r],T=[...a];g==="unpin"?(f=f.filter(x=>x!==m),T=T.filter(x=>x!==m)):g==="start"?(f=[...f.filter(x=>x!==m),m],T=T.filter(x=>x!==m)):g==="end"&&(T=[...T.filter(x=>x!==m),m],f=f.filter(x=>x!==m)),n(f),l(T);let b=f.includes(m)||T.includes(m);o?.(m,b);},[r,a,o,t]),i=useMemo(()=>e.filter(m=>!m.hidden),[e]),{pinnedStartColumnsData:p,pinnedEndColumnsData:d,unpinnedColumnsData:u}=useMemo(()=>{let m=i.filter(S=>r.includes(S.id)),g=i.filter(S=>a.includes(S.id)),f=i.filter(S=>!r.includes(S.id)&&!a.includes(S.id)),T=m.sort((S,w)=>(S?.order??1e6)-(w?.order??1e6)),b=g.sort((S,w)=>(S?.order??1e6)-(w?.order??1e6)),x=f.sort((S,w)=>(S?.order??1e6)-(w?.order??1e6));return {pinnedStartColumnsData:T,pinnedEndColumnsData:b,unpinnedColumnsData:x}},[i,r,a]),c=useMemo(()=>[...p,...u,...d],[p,u,d]),R=useMemo(()=>{let m=c[c.length-1];return m?m.id:null},[c]);return {pinnedStartColumns:r,pinnedEndColumns:a,handleColumnPin:s,pinnedStartColumnsData:p,pinnedEndColumnsData:d,unpinnedColumnsData:u,orderedColumns:c,lastColumnId:R}};var jo=()=>{let e=useRef(null),t=useRef(null),o=useRef(null),r=useRef(false),n=useCallback(({scrollOffset:a},l)=>{r.current||(r.current=true,l!=="start"&&e.current&&e.current.scrollTo(a),l!=="end"&&o.current&&o.current.scrollTo(a),l!=="scrollable"&&t.current&&t.current.scrollTo(a),requestAnimationFrame(()=>{r.current=false;}));},[]);return {pinnedStartVirtualListRef:e,scrollableVirtualListRef:t,pinnedEndVirtualListRef:o,handleScroll:n}};var qo=()=>{let[e,t]=useState(null),[o,r]=useState(null),[n,a]=useState(null),[l,s]=useState(null),[i,p]=useState(false),d=useCallback((m,g,f,T,b)=>{f.stopPropagation();let x=`${b??"default"}-${m}-${g}-${T}`,S=`${b??"default"}-${m}-${g}`;if(n===x){a(null),t(null);return}a(x),t(S),s(null);},[n,a,t,s]),u=useCallback((m,g,f,T)=>{if(f.stopPropagation(),T==="start"&&g===0){s(x=>x===m?null:m),t(null),r(null),a(null);return}let b=`${T??"default"}-${m}-${g}`;t(x=>x===b?null:b),r(null),a(null),s(null);},[l]),c=useCallback((m,g,f)=>{g.stopPropagation();let T=`${f??"default"}-${m}`;r(b=>b===T?null:T),t(null),a(null),s(null);},[]),R=useCallback(()=>{t(null),r(null),a(null),s(null);},[]);return {selectedCell:e,selectedColumn:o,selectedRow:l,showBackDrop:i,selectedChip:n,setShowBackdrop:p,handleChipClick:d,handleCellClick:u,handleColumnClick:c,resetSelection:R}};var Us=e=>e!==null&&"isAxiosError"in e&&e.isAxiosError===true,Go=({rows:e,isLoading:t,error:o,isFetchingNextPage:r,areAllRowsLoaded:n})=>{let a=b({value:r,delay:1e3}),l=useMemo(()=>{let i=Rb(o||null),p=t??true,d=o&&Us(o)?o:null,u=!t&&e.length===0&&i&&!Tb(d),c=!t&&e.length===0,R=Sb(d);return {isError:i,tableLoading:p,tableError:u,tableEmpty:c,hasTimeoutError:R,showNoDataView:p||u||c||R}},[e.length,t,o]),s=useMemo(()=>{let i=e.length-1,p=Wa(e.length)&&!l.tableLoading,d=(a??false)||n?e.length+1:e.length;return {lastItemIndex:i,areTotalRowsNotFillingHeight:p,itemsCount:d}},[e.length,l.tableLoading,a,n]);return {...l,...s,isDelayedFetchingNextPage:a??false}};var Ks=ts((e,t,o,r,n,a,l,s,i,p,d,u,c,R,m,g,f,T)=>({columns:e,isLoading:t,rows:o,rowProps:r,scrollToIndex:n,totalCount:l,lastItemIndex:a,isError:s,areAllRowsLoaded:i,limit:l,newLoadedRowsEndIndex:a,isSheetView:true,isPinned:p,selectedCell:d,selectedColumn:u,selectedRow:c,selectedChip:R,onCellClick:m,onChipClick:g,containerHeight:f,rowHeight:T})),Yo=({rowHeight:e,areAllRowsLoaded:t,rows:o,isDelayedFetchingNextPage:r,rowProps:n,scrollToIndex:a,footerProps:l,isError:s,selectedCell:i,selectedColumn:p,selectedRow:d,selectedChip:u,handleCellClick:c,handleChipClick:R})=>{let m=useCallback((b,x)=>{if(t&&b===o.length){let w=o.length*e,I=x-w,C=e*2;return Math.max(I,C)}return e},[t,o.length,e]),g=useMemo(()=>[r,o,n,a,o.length-1,l?.totalCount??0,s,t],[r,o,n,a,l?.totalCount,s,t]),f=useMemo(()=>[i,p,d,u,c,R],[i,p,d,u,c,R]),T=useCallback((b,x,S)=>Ks(b,...g,x,...f,S,e),[g,f,e]);return {getItemSize:m,getItemDataForContainer:T}};var js=(e,t)=>{let o=useMemo(()=>e.reduce((n,a)=>{let l=typeof a.width=="string"?parseInt(a.width):a.width||100;return n+l},.2),[e]),r=useMemo(()=>t.reduce((n,a)=>{let l=typeof a.width=="string"?parseInt(a.width):a.width||100;return n+l},.2),[t]);return {pinnedStartColumnsWidth:o,pinnedEndColumnsWidth:r}};var Jo=({tableContainerRef:e,showHeader:t,isResizing:o})=>{let[r,n]=useState({top:0,height:0});return useEffect(()=>{let a=()=>{if(e.current){let l=e.current.getBoundingClientRect(),s=t?28:0;n({top:l.top+s,height:l.height-s});}};if(a(),o){let l=()=>a();return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}},[o,t,e]),r};var fi=styled("div",{shouldForwardProp:e=>e!=="isResizing"&&e!=="isLast"})(({isLast:e})=>({position:"absolute",top:0,right:e?-10:-11,width:20,height:"100%",backgroundColor:"transparent",zIndex:100001,display:"flex",alignItems:"center",justifyContent:"center"})),bi=styled("div",{shouldForwardProp:e=>e!=="isVisible"&&e!=="x"&&e!=="height"&&e!=="top"})(({isVisible:e,x:t,height:o,top:r})=>({position:"fixed",left:t,top:r,width:1,height:`calc(${o}px - 14px)`,backgroundColor:"#1F88D0",zIndex:9999,pointerEvents:"none",opacity:e?1:0,transition:"opacity 0.1s ease","&::before":{content:'""',position:"absolute",left:-1,top:0,width:1,height:"100%"}})),Xt=styled("div",{shouldForwardProp:e=>e!=="isVisible"&&e!=="x"&&e!=="y"&&e!=="offsetX"})(({isVisible:e,x:t,y:o,offsetX:r=0})=>({position:"fixed",left:t+r-8,top:o,width:20,height:16,backgroundImage:`url(${bk})`,backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center",zIndex:1e5,pointerEvents:"none",display:e?"block":"none",transform:"translate(-50%, -50%)"}));function Qs({columnId:e,onStartResize:t,isResizing:o,isLast:r=false}){let[n,a]=useState(false),[l,s]=useState({x:0,y:0}),i=useRef(null),p=useCallback(()=>{let m=i.current?.getBoundingClientRect();m&&s({x:m.right,y:m.top+m.height/2});},[]),d=useCallback(()=>{o||(a(true),p());},[o,p]),u=useCallback(()=>{!o&&n&&p();},[o,n,p]),c=useCallback(()=>{a(false);},[]);return jsxs(Fragment,{children:[jsx(fi,{ref:i,isResizing:o,isLast:r,onMouseDown:m=>{m.stopPropagation(),m.preventDefault(),a(false),t(m,e);},onMouseEnter:d,onMouseMove:u,onMouseLeave:c,"data-testid":`column-resize-handle-${e}`}),createPortal(jsx(Xt,{isVisible:n&&!o,x:l.x,y:l.y,offsetX:-2}),document.body)]})}var Qo=memo(Qs);function nd({isVisible:e,indicatorX:t,indicatorHeight:o,indicatorTop:r,iconX:n,iconY:a}){return e?createPortal(jsxs(Fragment,{children:[jsx(bi,{isVisible:e,x:t,height:o,top:r,"data-testid":"column-resize-indicator"}),jsx(Xt,{isVisible:e,x:n,y:a,offsetX:8,"data-testid":"floating-resize-icon"})]}),document.body):null}var er=memo(nd);var ld=e=>{if(!e||typeof e!="object")return false;let t=e;return "width"in t&&e$1(t.width)},sd=e=>!e||typeof e!="object"?false:Object.values(e).every(ld),dd=e=>!e||typeof e!="object"?false:Object.values(e).every(sd),Ci=e=>!e||typeof e!="object"?false:Object.values(e).every(dd),Si=()=>{try{let e=pa$1();if(!e)return {};let t=e;return Ci(t)?t:(console.warn("Invalid column settings in localStorage"),{})}catch(e){return console.warn("Failed to get sheetview columns:",e),{}}},pd=e=>{if(!Ci(e))return console.warn("Invalid data structure for sheetview columns"),false;try{return oa$1(e),!0}catch(t){return console.warn("Failed to save sheetview columns:",t),false}},yi=(e,t,o,r)=>{if(!_a$1(e)||!_a$1(t)||!_a$1(o))return r;try{return Si()[e]?.[t]?.[o]?.width??r}catch(n){return console.warn("Failed to get column width:",n),r}},Ti=(e,t,o,r)=>{if(!_a$1(e)||!_a$1(t)||!_a$1(o)||!e$1(r))return console.warn("Invalid parameters for setColumnWidth"),false;try{let n=Si();return n[e]||(n[e]={}),n[e][t]||(n[e][t]={}),n[e][t][o]?n[e][t][o].width=r:n[e][t][o]={width:r},pd(n)}catch(n){return console.warn("Failed to set column width:",n),false}};var Te={MIN_WIDTH:25,MAX_WIDTH:1500,DEFAULT_WIDTH:100};var wi=e=>{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?Te.DEFAULT_WIDTH:t}return e||Te.DEFAULT_WIDTH},tr=e=>Math.max(Te.MIN_WIDTH,Math.min(Te.MAX_WIDTH,e)),q=e=>{let t=String(e.id);return e.tableViewId?`${t}_${e.tableViewId}`:t},or=(e,t)=>e.map(o=>{let r=q(o);return {...o,width:t[r]||o.width}}),Ri=(e,t)=>{e.current&&(document.removeEventListener("mousemove",e.current),e.current=void 0),t.current&&(document.removeEventListener("mouseup",t.current),t.current=void 0),document.body.style.cursor="",document.body.style.userSelect="";},md=(e,t,o,r,n,a,l,s,i)=>p=>{try{let d=i.current-o,u=tr(t+d);l(c=>({...c,columnWidths:{...c.columnWidths,[e]:u},isResizing:!1,resizingColumn:null,resizeIndicatorX:0})),r&&n&&(Ti(r,n,String(e),u)||console.warn(`Failed to persist column width for ${e}`)),a?.(e,u),p.stopPropagation(),p.preventDefault(),s();}catch(d){console.error("Error in mouse up handler:",d),s();}},Ii=(e,t,o,r,n,a,l,s,i)=>p=>{try{let d=p.clientX;if(r?.current){let c=r.current.getBoundingClientRect(),R=c.left,m=c.right;a==="start"&&n===1&&(m=m-38),d=Math.max(R,Math.min(m,p.clientX));}l&&(l.current=d);let u=d;if(s&&i){let c=s.current-i.current+Te.MIN_WIDTH;d<c&&(u=c);}e(c=>({...c,resizeIndicatorX:u})),t({x:u,y:o.current});}catch(d){console.error("Error in mouse move handler:",d);}},Ei=(e,t)=>e[t]||Te.DEFAULT_WIDTH,Pi=(e,t,o,r,n,a,l)=>(s,i,p)=>d=>{md(s,i,p,e,t,o,r,n,l)(d),setTimeout(()=>{a.current=false;},0);};var rr=({columns:e,onColumnResize:t,handleColumnClick:o,windowId:r,serviceCode:n,tableContainerRef:a})=>{let l=useMemo(()=>e.reduce((P,L)=>{let v=q(L),F=wi(L.width),M=F;if(r&&n)try{M=yi(r,n,v,F)??F;}catch(z){console.warn(`Failed to load stored width for column ${v}:`,z),M=F;}return P[v]=tr(M),P},{}),[r,n]),[{columnWidths:s,isResizing:i,resizingColumn:p,resizeIndicatorX:d},u]=useState(()=>({columnWidths:l,isResizing:false,resizingColumn:null,startX:0,startWidth:0,resizeIndicatorX:0})),[c,R]=useState({x:0,y:0}),m=useRef(false),g=useRef(0),f=useRef(0),T=useRef(0),b=useRef(0),x=useRef(),S=useRef();useEffect(()=>{u(P=>{let L=new Set(Object.keys(P.columnWidths)),v=new Set(Object.keys(l));return L.size!==v.size?{...P,columnWidths:l}:Array.from(v).some(M=>!L.has(M)||P.columnWidths[M]!==l[M])?{...P,columnWidths:l}:P});},[]);let w=useCallback(P=>Ei(s,P),[s]),I=useCallback(()=>{Ri(x,S);},[]),C=useCallback((P,L,v)=>Pi(r,n,t,u,I,m,f)(P,L,v),[r,n,t,I]),h=useCallback((P,L)=>Ii(u,R,g,a,P,L,f,T,b),[a]),E=useCallback((P,L)=>{P.preventDefault(),P.stopPropagation();try{let v=w(L),F=P.clientX,M=e.find(D=>q(D)===L),z=M?e.filter(D=>D.pinned===M.pinned).findIndex(D=>q(D)===L):void 0,_=M?.pinned,W=P.currentTarget.closest('[data-testid="SheetViewVirtualTable_TableHeader_StyledCell"]'),H=P.clientY;if(W){let D=W.getBoundingClientRect();H=D.top+D.height/2;}u(D=>({...D,isResizing:!0,resizingColumn:L,startX:F,startWidth:v,resizeIndicatorX:F,resizingColumnIndex:z,resizingColumnPinned:_})),g.current=H,f.current=F,T.current=F,b.current=v,R({x:F,y:H}),m.current=!0;let N=h(z,_),$=C(L,v,F);x.current=N,S.current=$,document.addEventListener("mousemove",N),document.addEventListener("mouseup",$),document.body.style.cursor="none",document.body.style.userSelect="none";}catch(v){console.error("Error starting resize:",v),I();}},[w,h,C,I,e]),V=useCallback(()=>{try{u(P=>({...P,isResizing:!1,resizingColumn:null,resizeIndicatorX:0})),m.current=!1,I();}catch(P){console.error("Error stopping resize:",P),I();}},[I]),y=useCallback(()=>m.current,[]),k=useCallback((P,L,v)=>{y()||o(P,L,v);},[o,y]);return useEffect(()=>I,[I]),{columnWidths:s,isResizing:i,resizingColumn:p,resizeIndicatorX:d,cursorPosition:c,getColumnWidth:w,startResize:E,stopResize:V,isCurrentlyResizing:y,handleColumnClick:k}};var nr=({pinnedStartColumnsData:e,pinnedEndColumnsData:t,columnWidths:o})=>{let r=useMemo(()=>e.reduce((s,i)=>{let p=q(i),d=o[p]||parseInt(String(i.width))||150;return s+d},.2),[e,o]),n=useMemo(()=>t.reduce((s,i)=>{let p=q(i),d=o[p]||parseInt(String(i.width))||150;return s+d},.2),[t,o]),a=useMemo(()=>e.map(s=>{let i=q(s);return {...s,width:o[i]||s.width}}),[e,o]),l=useMemo(()=>t.map(s=>{let i=q(s);return {...s,width:o[i]||s.width}}),[t,o]);return {pinnedStartColumnsWidth:r,pinnedEndColumnsWidth:n,pinnedStartColumnsDataWithWidths:a,pinnedEndColumnsDataWithWidths:l}};var xd=styled("section")(({isLoaded:e=false,isPinned:t=false})=>({overflow:"hidden",paddingInline:e&&!t?"32px":"0px",backgroundColor:e&&!t?"rgba(255, 255, 255, 0.60)":"none",filter:e&&!t?"blur(8px)":"none",marginTop:e&&!t?"1rem":"0",height:"100%",maxHeight:"100%"}));function Cd({columns:e,isLoaded:t=false,animationType:o,isLoading:r=false,rowsCount:n=13,isPinned:a=false}){let[l,s]=useState(()=>n||Math.min(Va(t,r),15));return useEffect(()=>{if(n){s(n);return}let i=()=>{let u=document.querySelector('[data-testid="SheetViewTableLoading"]');if(!u)return Math.min(Va(t,r),25);let c=u.parentElement?.clientHeight||0,R=28,g=c-40;if(g<=0)return Math.min(Va(t,r),25);let f=Math.floor(g/R);return Math.max(3,Math.min(f+2,25))},p=i();s(p);let d=()=>{let u=i();s(u);};return window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[t,r,n]),jsx(xd,{isLoaded:t,isPinned:a,"data-testid":"SheetViewTableLoading",children:[...Array(l)].map((i,p)=>jsx(et,{columns:e,animationType:o,rowIndex:p,useTableBackground:!a},`i-${cl("SheetViewTableLoadingRow_")}`))})}var ie=memo(Cd);function vi({error:e,tableEmpty:t,isTimeoutError:o,tableError:r,tableLoading:n,orderedColumns:a,triggerDataRefetch:l,footerProps:s}){let i;if(n)i=jsx(He,{"data-testid":"SheetViewVirtualTable_SolidBackground",children:jsx(ie,{"data-testid":"SheetViewVirtualTable_TableLoading",columns:a,isLoading:true,isPinned:false})});else if(o)i=jsx(te,{"data-testid":"SheetViewVirtualTable_ErrorList_timeoutError",shouldMinimizeWidth:true,heading:"timeOut",message:"yourRequestOutPleaseTryAgain",triggerDataRefetch:l,sandboxMode:s?.sandboxMode});else if(r){let p=e,{formatted:d}=Ub({error:p,fallbackMessage:"connectionErrorMsg"});i=jsx(te,{"data-testid":"SheetViewVirtualTable_ErrorList_tableError",heading:"somethingWentWrong",message:d,triggerDataRefetch:l,sandboxMode:s?.sandboxMode});}else if(t){let p=e,{formatted:d}=Ub({error:p,fallbackMessage:"tryAdjustingTheDateOrFilters"});i=jsx(Ht,{sandboxMode:s?.sandboxMode,heading:"nothingFound",message:d});}else i=jsx(te,{"data-testid":"SheetViewVirtualTable_ErrorList_tableError",heading:"somethingWentWrong",message:"connectionErrorMsg",triggerDataRefetch:l,sandboxMode:s?.sandboxMode});return i}vi.displayName="SheetViewTableNoData";var yd=memo(vi);function Vd({column:{header:e,id:t,tableViewId:o,align:r,headerStyle:n,sortable:a,filter:l,pinnable:s,width:i,order:p,pinned:d},colIndex:u,isFirst:c,isLast:R,isSelected:m,isDefaultPinned:g,onColumnSort:f,columnsSorting:T,onColumnPin:b,isPinnable:x,lastColumnId:S,onColumnClick:w,pinnedColumns:I,onStartResize:C,isResizing:h=false,resizingColumn:E=null}){let V=q({id:t,tableViewId:o}),[y,k]=useState(null),P=useRef(null),{isFilterApplied:L}=Je({filter:l}),v=useCallback(W=>I?.includes(W),[I]),F=useMemo(()=>v(t),[t,v]),M=W=>{v(W)?b?.(W,"unpin"):W===S?b?.(W,"end"):b?.(W,"start");},z=()=>{k(P.current);};return jsxs(Se,{"data-id":t,component:"div","data-testid":"SheetViewVirtualTable_TableHeader_StyledCell","data-column-id":t,"data-column-width":i,"data-column-width-used":i,"data-column-align":r,"data-column-order":p,"data-column-header":typeof e=="string"?e:"component","data-column-sortable":!!a,"data-column-filterable":!!l,"data-column-pinned":F,isFirst:c,isLast:R,isSheetView:true,ref:P,onClick:W=>{W.target===W.currentTarget&&w?.(u,W,d);},sx:W=>({display:"flex",gap:W.spacing(.5),alignItems:"center",justifyContent:r==="right"?"flex-end":"flex-start",width:i,textAlign:r,overflow:"visible !important",cursor:"pointer",boxSizing:"border-box",border:"0.5px solid transparent",borderColor:m?"#1F88D0":"#F2F2F2",borderBottom:m?"0.5px solid transparent":"0.5px solid #F2F2F2",backgroundColor:m?"#F2F2F2":"#FCFCFC",minHeight:"28px",position:"relative","&:before":{content:'""',borderBottom:"none",position:"absolute",top:0,right:0,left:0,bottom:0},...n}),children:[jsxs(kt,{onClick:W=>{W.stopPropagation(),z();},children:[typeof e=="function"?e():jsx(Ce,{"data-testid":"SheetViewTableHeader_columns_header",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e&&jsx(oi,{"data-testid":"SheetViewVirtualTable_TableHeader_StyledCell_header_text",children:e})}),l&&jsx(Ye,{...l,anchorEl:y,setAnchorEl:k,isFilterApplied:L}),a&&jsx(Et,{columnId:t,onColumnSort:f,columnsSorting:T,onClick:W=>{w?.(u,W,d);}}),x&&s&&!g&&!R&&jsx(ri,{onClick:W=>{W.stopPropagation(),M(t);},title:F?"Unpin column":"Pin column",children:jsx("img",{src:F?ai$1:$h,alt:"pin-icon"})})]}),C&&d!=="end"&&jsx(Qo,{columnId:V,onStartResize:C,isResizing:h,isLast:R})]})}var Fi=memo(Vd);function kd({columns:e,headerProps:t,showBackDrop:o,onColumnSort:r,columnsSorting:n,pinnedColumns:a=[],onColumnPin:l,isPinnable:s=false,lastColumnId:i,selectedColumn:p=null,onColumnClick:d,onStartResize:u,isResizing:c=false,resizingColumn:R=null}){return jsx(ni,{component:"nav","data-testid":"SheetViewVirtualTable_TableHeader_StyledHeader",showBackDrop:o,...t,children:jsx(ii,{component:"section","data-testid":"SheetViewVirtualTable_TableHeader_StyledMUITableRow",children:e.map((m,g)=>{let f=`${m.pinned??"default"}-${g}`;return jsx(Fi,{column:m,colIndex:g,isFirst:m.id===e[0].id,isLast:m.id===e[e.length-1].id,isDefaultPinned:!!m.isDefaultPinned,isSelected:p===f,onColumnSort:r,columnsSorting:n,pinnedColumns:a,onColumnPin:l,isPinnable:s,lastColumnId:i,onColumnClick:d,onStartResize:u,isResizing:c,resizingColumn:R},`${m.id}-${g}`)})})})}var ae=memo(kd);function Md({columnsData:e,itemCount:t,lastItemIndex:o,areAllRowsLoaded:r,loadMoreItems:n,threshold:a,getItemSize:l,getItemData:s,isPinned:i,fixedWidth:p,scrollToIndex:d,areTotalRowsNotFillingHeight:u,clearBackdropVisibilityTimeout:c,onScroll:R,setBackdropVisibility:m,listRef:g,overscanCount:f=40}){return jsx(rs,{isItemLoaded:b=>b!==o,itemCount:t,loadMoreItems:async()=>{r||await n?.();},threshold:a,children:({onItemsRendered:b,ref:x})=>jsx(os,{ref:x,children:({height:S,width:w})=>{let I=h=>l(h,S),C=s(e,i,S);return jsx(Be,{listRef:g,height:S,width:p||w,itemCount:t,itemSize:I,itemData:C,onItemsRendered:b,overscanCount:f,setBackdropVisibility:m,scrollToIndex:d,areTotalRowsNotFillingHeight:u,useIsScrolling:true,onScroll:R,clearBackdropVisibilityTimeout:c,style:{overflowX:i?"hidden":"auto",paddingBottom:i?"25px":"13px",backgroundColor:i?"transparent":"#F6F8FACC"},children:At})}})})}var lr=memo(Md);function Bd({position:e,columnsData:t,columnsWidth:o,pinnedColumnsList:r,showHeader:n,columnsSorting:a,onColumnSort:l,headerProps:s,showBackDrop:i,onColumnPin:p,isPinnable:d,lastColumnId:u,selectedColumn:c,onColumnClick:R,hasPinnedStart:m,hasPinnedEnd:g,tableTitle:f,areAllRowsLoaded:T,isFetchingNextPage:b,scrollToIndex:x,isLoading:S,isError:w,hasTimeoutError:I,tableMode:C,showNoDataView:h,tableLoading:E,createVirtualTableContainer:V,onStartResize:y,isResizing:k,resizingColumn:P}){let L=useTheme();if(t.length===0)return null;let v=e==="start"?li:si,F=e==="start"?"pinnedStart":"pinnedEnd";return jsx(v,{children:jsxs(ee,{as:"main",id:"sheet-table-box-container","aria-labelledby":"sheet-table-box-container","data-testid":"SheetViewVirtualTable_StyledTableBox","data-title":f,"data-direction":L.direction,"data-are-all-rows-loaded":!!T,"data-is-fetching-next-page":!!b,"data-scroll-to-index":x,"data-is-loading":!!S,"data-is-error":!!w,"data-is-error-timeout":!!I,"data-table-mode":C,height:"100%",dir:L.direction,showNoDataView:h,children:[n&&jsx(ae,{"data-testid":"SheetViewVirtualTable_PinnedTableHeader",columnsSorting:a,onColumnSort:l,columns:t,headerProps:s,showBackDrop:i,pinnedColumns:r,onColumnPin:p,isPinnable:d,lastColumnId:u,selectedColumn:c,onColumnClick:R,tablePosition:e==="start"?"pinnedStart":"pinnedEnd",hasPinnedStart:m,hasPinnedEnd:g,onStartResize:y,isResizing:k,resizingColumn:P}),jsx(A,{"data-testid":"VirtualTable_TableWrapper",sx:{width:"100%",minWidth:"fit-content",overflowX:"hidden"},children:jsx(ue,{"data-testid":"SheetViewVirtualTable_PinnedStyledBox",hidePadding:true,className:"list-wrapper",sx:{height:"100%",maxHeight:"100%",overflow:"hidden"},children:E?jsx(ie,{"data-testid":`SheetViewVirtualTable_PinnedTableLoading_${e}`,columns:t,isLoading:true,isPinned:true}):V(t,F,true,o)})})]})})}var $e=memo(Bd);function Od({hasPinnedStart:e,hasPinnedEnd:t,unpinnedColumnsData:o,showHeader:r,columnsSorting:n,onColumnSort:a,headerProps:l,showBackDrop:s,pinnedStartColumns:i,pinnedEndColumns:p,onColumnPin:d,isPinnable:u,lastColumnId:c,selectedColumn:R,onColumnClick:m,tableTitle:g,areAllRowsLoaded:f,isFetchingNextPage:T,scrollToIndex:b,isLoading:x,isError:S,hasTimeoutError:w,tableMode:I,showNoDataView:C,tableBodyStyles:h,tableLoading:E,createVirtualTableContainer:V,onStartResize:y,isResizing:k,resizingColumn:P}){let L=useTheme();return jsx(Ot,{hasPinnedStart:e,hasPinnedEnd:t,children:jsx(ee,{as:"main",id:"sheet-table-box-container","aria-labelledby":"sheet-table-box-container","data-testid":"SheetViewVirtualTable_StyledTableBox","data-title":g,"data-direction":L.direction,"data-are-all-rows-loaded":!!f,"data-is-fetching-next-page":!!T,"data-scroll-to-index":b,"data-is-loading":!!x,"data-is-error":!!S,"data-is-error-timeout":!!w,"data-table-mode":I,height:"100%",dir:L.direction,showNoDataView:C,scrollable:true,children:jsxs(A,{"data-testid":"SheetViewVirtualTable_TableWrapper",showNoDataView:C,sx:{...h,display:"flex",flexDirection:"column",height:"100%"},children:[r&&jsx(Oe,{children:jsx(ae,{"data-testid":"SheetViewVirtualTable_UnpinnedTableHeader",columnsSorting:n,onColumnSort:a,columns:o,headerProps:l,showBackDrop:s,pinnedColumns:[...i,...p],onColumnPin:d,isPinnable:u,lastColumnId:c,selectedColumn:R,onColumnClick:m,tablePosition:"scrollable",hasPinnedStart:e,hasPinnedEnd:t,onStartResize:y,isResizing:k,resizingColumn:P})}),jsx(A,{"data-testid":"VirtualTable_TableWrapper",sx:{width:"100%",minWidth:"fit-content"},children:jsx(ue,{"data-testid":"SheetViewVirtualTable_ScrollableStyledBox",hidePadding:true,className:"list-wrapper",sx:{height:"100%",maxHeight:"100%",overflow:"hidden"},children:E?jsx(ie,{"data-testid":"SheetViewVirtualTable_TableLoading",columns:o,isLoading:true,isPinned:false}):V(o,"scrollable",false)})})]})})})}var sr=memo(Od);function Xd({hasPinnedStart:e,hasPinnedEnd:t,unpinnedColumnsData:o,showHeader:r,columnsSorting:n,onColumnSort:a,headerProps:l,showBackDrop:s,pinnedStartColumns:i,pinnedEndColumns:p,onColumnPin:d,isPinnable:u,lastColumnId:c,selectedColumn:R,onColumnClick:m,tableTitle:g,areAllRowsLoaded:f,isFetchingNextPage:T,scrollToIndex:b,isLoading:x,isError:S,hasTimeoutError:w,tableMode:I,showNoDataView:C,tableBodyStyles:h}){let E=useTheme();return jsx(Ot,{hasPinnedStart:e,hasPinnedEnd:t,children:jsx(ee,{as:"main",id:"sheet-table-box-container","aria-labelledby":"sheet-table-box-container","data-testid":"SheetViewVirtualTable_StyledTableBox_Loading","data-title":g,"data-direction":E.direction,"data-are-all-rows-loaded":!!f,"data-is-fetching-next-page":!!T,"data-scroll-to-index":b,"data-is-loading":!!x,"data-is-error":!!S,"data-is-error-timeout":!!w,"data-table-mode":I,height:"100%",dir:E.direction,showNoDataView:C,scrollable:true,children:jsxs(A,{"data-testid":"SheetViewVirtualTable_LoadingTableWrapper",showNoDataView:C,sx:{...h,display:"flex",flexDirection:"column",height:"100%"},children:[r&&jsx(Oe,{children:jsx(ae,{"data-testid":"SheetViewVirtualTable_LoadingTableHeader",columnsSorting:n,onColumnSort:a,columns:o,headerProps:l,showBackDrop:s,pinnedColumns:[...i,...p],onColumnPin:d,isPinnable:u,lastColumnId:c,selectedColumn:R,onColumnClick:m,tablePosition:"scrollable",hasPinnedStart:e,hasPinnedEnd:t})}),jsx(A,{"data-testid":"VirtualTable_LoadingTableWrapper",sx:{width:"100%",minWidth:"fit-content"},children:jsx(ue,{"data-testid":"SheetViewVirtualTable_LoadingStyledBox",hidePadding:true,className:"list-wrapper",sx:{height:"100%",maxHeight:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:jsx(ie,{"data-testid":"SheetViewVirtualTable_TableLoading",columns:o,isLoading:true,isPinned:false})})})]})})})}var dr=memo(Xd);function Gd({tableLoading:e,tableError:t,tableEmpty:o,hasTimeoutError:r,orderedColumns:n,showHeader:a,columnsSorting:l,onColumnSort:s,headerProps:i,showBackDrop:p,onColumnPin:d,lastColumnId:u,selectedColumn:c,onColumnClick:R,tableTitle:m,areAllRowsLoaded:g,isFetchingNextPage:f,scrollToIndex:T,isLoading:b,isError:x,tableMode:S,tableBodyStyles:w,error:I,triggerDataRefetch:C,footerProps:h,customNoDataComponent:E}){let V=useTheme(),y=e||t||o||r;return jsx(ee,{as:"main",id:"sheet-table-box-container","aria-labelledby":"sheet-table-box-container","data-testid":"SheetViewVirtualTable_StyledTableBox","data-title":m,"data-direction":V.direction,"data-are-all-rows-loaded":!!g,"data-is-fetching-next-page":!!f,"data-scroll-to-index":T,"data-is-loading":!!b,"data-is-error":!!x,"data-is-error-timeout":!!r,"data-table-mode":S,height:"100%",dir:V.direction,showNoDataView:y,children:jsxs(A,{"data-testid":"SheetViewVirtualTable_TableWrapper",showNoDataView:y,sx:w,children:[a&&jsx(Oe,{children:jsx(ae,{"data-testid":"SheetViewVirtualTable_LoadingTableHeader",columnsSorting:l,onColumnSort:s,columns:n,headerProps:i,showBackDrop:p,pinnedColumns:[],onColumnPin:d,isPinnable:false,lastColumnId:u,selectedColumn:c,onColumnClick:R})}),E||jsx(Qe,{error:I||null,tableEmpty:o,isTimeoutError:r,tableError:t,tableLoading:e,orderedColumns:n,triggerDataRefetch:C||(()=>Promise.resolve()),footerProps:h})]})})}var pr=memo(Gd);function ep({columns:e,rows:t,threshold:o=20,showHeader:r,headerProps:n,rowProps:a,footerProps:l,rowHeight:s=28,isLoading:i,error:p,columnsSorting:d,onColumnSort:u,loadMoreItems:c,isFetchingNextPage:R,triggerDataRefetch:m,scrollToIndex:g,areAllRowsLoaded:f=false,tableBodyStyles:T,tableTitle:b,onColumnPin:x,clearBackdropVisibilityTimeout:S=100,isPinnable:w=false,tableMode:I,overscanCount:C,windowId:h,serviceCode:E,customNoDataComponent:V,defaultSkeleton:y=true}){let k=useMemo(()=>uc(e,i??false,y),[e,i,y]),{selectedCell:P,selectedColumn:L,selectedRow:v,showBackDrop:F,setShowBackdrop:M,handleCellClick:z,handleColumnClick:_,handleChipClick:K,selectedChip:W}=qo(),H=useRef(null),N=useRef(null),{isError:$,tableLoading:D,tableError:Gt,tableEmpty:J,hasTimeoutError:re,showNoDataView:Ue,lastItemIndex:ne,areTotalRowsNotFillingHeight:be,itemsCount:at,isDelayedFetchingNextPage:he}=Go({rows:t,isLoading:i,error:p,isFetchingNextPage:R,areAllRowsLoaded:f}),{pinnedStartColumns:B,pinnedEndColumns:U,handleColumnPin:ge,pinnedStartColumnsData:Yt,pinnedEndColumnsData:Jt,unpinnedColumnsData:lt,orderedColumns:cr,lastColumnId:Di}=Ko(k,w,x),{pinnedStartVirtualListRef:st,scrollableVirtualListRef:dt,pinnedEndVirtualListRef:pt,handleScroll:fr}=jo();useEffect(()=>{st.current?.resetAfterIndex(0),dt.current?.resetAfterIndex(0),pt.current?.resetAfterIndex(0);},[t.length,st,dt,pt]);let{columnWidths:Xe,isResizing:Zt,resizingColumn:Hi,resizeIndicatorX:Bi,cursorPosition:br,startResize:zi,handleColumnClick:_i}=rr({columns:k,handleColumnClick:_,windowId:h,serviceCode:E,tableContainerRef:N}),hr=Jo({tableContainerRef:H,showHeader:r??false,isResizing:Zt}),{pinnedStartColumnsWidth:gr,pinnedEndColumnsWidth:xr,pinnedStartColumnsDataWithWidths:Z,pinnedEndColumnsDataWithWidths:Q}=nr({pinnedStartColumnsData:Yt,pinnedEndColumnsData:Jt,columnWidths:Xe}),Cr=useMemo(()=>or(lt,Xe),[lt,Xe]),Ai=useMemo(()=>or(cr,Xe),[cr,Xe]),{getItemSize:Sr,getItemDataForContainer:yr}=Yo({rowHeight:s,areAllRowsLoaded:f,rows:t,isDelayedFetchingNextPage:he,rowProps:a,scrollToIndex:g,footerProps:l,isError:$,selectedCell:P,selectedColumn:L,selectedRow:v,selectedChip:W,handleCellClick:z,handleChipClick:K}),Ke=useCallback((Oi,mt,Ni=false,$i)=>jsx(lr,{columnsData:Oi,itemCount:at,lastItemIndex:ne,areAllRowsLoaded:f,loadMoreItems:c,threshold:o,getItemSize:Sr,getItemData:yr,isPinned:Ni,fixedWidth:$i,scrollToIndex:g,areTotalRowsNotFillingHeight:be,clearBackdropVisibilityTimeout:S,onScroll:Ui=>{fr(Ui,mt==="pinnedStart"?"start":mt==="pinnedEnd"?"end":"scrollable");},setBackdropVisibility:M,listRef:mt==="pinnedStart"?st:mt==="pinnedEnd"?pt:dt,overscanCount:C}),[at,ne,f,c,o,Sr,yr,g,be,S,fr,M,st,pt,dt,C]),Tr={showHeader:r,columnsSorting:d,onColumnSort:u,headerProps:n,showBackDrop:F,onColumnPin:ge,isPinnable:w,lastColumnId:Di,selectedColumn:L,onColumnClick:_i,tableTitle:b,areAllRowsLoaded:f,isFetchingNextPage:R,scrollToIndex:g,isLoading:i,isError:$,tableMode:I,showNoDataView:Ue,tableBodyStyles:T,onStartResize:zi,isResizing:Zt,resizingColumn:Hi},Pe={...Tr,hasTimeoutError:re,tableLoading:D};return jsxs(Fragment,{children:[jsx(In,{ref:H,children:Ue?D?jsxs(Xo,{ref:N,children:[Z.length>0&&jsx($e,{position:"start",columnsData:Z,columnsWidth:gr,pinnedColumnsList:B,hasPinnedStart:Z.length>0,hasPinnedEnd:Q.length>0,createVirtualTableContainer:Ke,...Pe}),jsx(dr,{hasPinnedStart:Z.length>0,hasPinnedEnd:Q.length>0,unpinnedColumnsData:Cr,pinnedStartColumns:B,pinnedEndColumns:U,...Pe}),Q.length>0&&jsx($e,{position:"end",columnsData:Q,columnsWidth:xr,pinnedColumnsList:[...B,...U],hasPinnedStart:Z.length>0,hasPinnedEnd:Q.length>0,createVirtualTableContainer:Ke,...Pe})]}):jsx(pr,{tableLoading:D,tableError:Gt,tableEmpty:J,hasTimeoutError:re,orderedColumns:Ai,error:p,triggerDataRefetch:m,footerProps:l,customNoDataComponent:V,...Tr}):jsxs(Xo,{ref:N,children:[Z.length>0&&jsx($e,{position:"start",columnsData:Z,columnsWidth:gr,pinnedColumnsList:B,hasPinnedStart:Z.length>0,hasPinnedEnd:Q.length>0,createVirtualTableContainer:Ke,...Pe}),jsx(sr,{hasPinnedStart:Z.length>0,hasPinnedEnd:Q.length>0,unpinnedColumnsData:Cr,pinnedStartColumns:B,pinnedEndColumns:U,createVirtualTableContainer:Ke,...Pe}),Q.length>0&&jsx($e,{position:"end",columnsData:Q,columnsWidth:xr,pinnedColumnsList:[...B,...U],hasPinnedStart:Z.length>0,hasPinnedEnd:Q.length>0,createVirtualTableContainer:Ke,...Pe})]})}),jsx(Me,{"data-testid":"SheetViewVirtualTable_TableFooter",showSeparator:true,showBackDrop:F,...l}),jsx(er,{isVisible:Zt,indicatorX:Bi,indicatorHeight:hr.height,indicatorTop:hr.top,iconX:br.x,iconY:br.y})]})}var tp=memo(ep);export{pr as $,Oo as A,Uo as B,zs as C,Eh as D,Ph as E,oi as F,ri as G,ni as H,ii as I,Xo as J,li as K,si as L,Ot as M,Oe as N,Ko as O,jo as P,qo as Q,Go as R,Yo as S,js as T,Jo as U,ie as V,yd as W,ae as X,$e as Y,sr as Z,dr as _,Qr as a,tp as aa,wt as b,Rt as c,Ye as d,co as e,bo as f,ho as g,Se as h,Je as i,yo as j,wo as k,Io as l,Eo as m,Po as n,Lo as o,Qe as p,Wo as q,Mo as r,et as s,Xl as t,jl as u,as as v,Bo as w,zo as x,_o as y,Ao as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-BVAZARPH.js';import {m}from'./chunk-DROAYBDL.js';import {V as V$1,f,l,R,v}from'./chunk-CAVYK7HF.js';import {yb}from'./chunk-3M2GZVQW.js';import {createContext,forwardRef,useMemo,useState,useRef,useCallback,useEffect,useImperativeHandle,useContext}from'react';import Re from'@mui/material/Stack';import ne from'@mui/material/Typography';import ie from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';import {Stack}from'@mui/material';import it from'lodash/debounce';import j from'memoize-one';var Ue=(r=>(r.CHECKED="CHECKED",r.UNCHECKED="UNCHECKED",r.INDETERMINATE="INDETERMINATE",r))(Ue||{});styled("img",{shouldForwardProp:e=>e!=="expanded"})(({theme:e,expanded:t})=>({transform:t?"rotate(180deg)":"rotate(0deg)",marginLeft:"auto",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest})}));styled(ie)(()=>({display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"4px",borderTop:"1px solid #F2F2F2"}));var F=styled(V$1)({minWidth:120,minHeight:36,maxHeight:36,paddingTop:0,paddingBottom:0,backgroundColor:"#fff","--menuitem-border-rad":"4px","&:hover":{boxShadow:"0px 0px 16px rgba(0, 0, 0, 0.13)",zIndex:1}}),V=styled(e=>jsx(F,{startAdornment:null,...e}))(({theme:e})=>({fontSize:11,fontWeight:500,color:e.palette.grey[700],minHeight:36,maxHeight:"auto",cursor:"auto",":hover":{boxShadow:"none",zIndex:1}}));var _=createContext({treeMapper:{},handleSelect:()=>{},multiple:false}),Ve=({children:e,treeMapper:t,handleSelect:o,multiple:r,IconComponent:n})=>{let i=useMemo(()=>({treeMapper:t,handleSelect:o,multiple:r,IconComponent:n}),[t,o,r,n]);return jsx(_.Provider,{value:i,children:e})},re=Ve;var Ge=()=>{let e=useContext(_);if(!e)throw new Error("'useTreeDropdown' must be used within an 'TreeDropdownProvider'");return e},B=Ge;var ae=styled(f)({padding:0,paddingRight:"4px",width:"14px !important",".MuiSvgIcon-root":{width:"12px !important",height:"12px !important"}}),se=styled(l)({padding:0}),le=styled(ie)(()=>({display:"flex",gap:"8px",justifyContent:"space-between",flexGrow:1,width:"100%",alignItems:"center",minWidth:0})),pe=styled(e=>jsx(ne,{noWrap:true,component:"span",...e}))(({theme:e})=>({flex:1,fontSize:"inherit",width:"100%",display:"inline-block",color:e.palette.text.primary})),de=styled(e=>jsx(ne,{noWrap:true,...e}))(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:8})),ce=styled(ie,{shouldForwardProp:e=>e!=="isOneDigit"})(({theme:e,isOneDigit:t=true})=>({borderRadius:t?"50%":"4px",background:e.palette.divider,width:t?13:"auto",height:14,fontSize:"8px",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"10px",...!t&&{padding:"0 3px"}})),ue=styled("img")(()=>({height:12}));var Je=e=>{let{checked:t,indeterminate:o,onSelect:r}=e,{multiple:n}=B(),i=useCallback(a=>{a.stopPropagation(),r(a);},[r]);return n?jsx(ae,{size:"small",checked:t,indeterminate:o,onChange:i}):jsx(se,{checked:t,onChange:i})},he=Je;var Ze=e=>{let{renderItem:t,header:o,footer:r,...n}=e,{treeMapper:i,handleSelect:a,multiple:c,IconComponent:p}=B(),{label:s,icon:d,iconComponent:l,levelIndex:h=0,children:f,nestedMenuSx:I,hintText:y,disableHovering:m,itemProps:T,searchProps:u,subLevelKey:E}=n,[x,N]=useState(null),w=!!f,H=f?.length,L=useCallback(R=>{m||N(R.currentTarget);},[m]),S=useCallback(()=>{m||N(null);},[m]);useEffect(()=>{m&&N(null);},[m]);let M=useMemo(()=>l||(d&&p?jsx(p,{fileId:d.fileId,width:d.width??20,height:d.height??20}):null),[l,d,p]),g=i[n.id]?.status==="CHECKED",k=c?i[n.id]?.status==="INDETERMINATE":false,O=c||!w,v=useCallback(R=>{R.stopPropagation(),a(R.target.checked,n);},[a,n]);return jsxs(F,{startAdornment:null,onMouseEnter:L,onMouseLeave:S,"data-testid":n.id,onClick:()=>{a(!g,n);},...T,children:[t?t({nodeProps:n,checked:g,indeterminate:k,onSelect:v}):jsxs(le,{width:"100%","data-testid":"Content",children:[O&&jsx(he,{checked:g,indeterminate:k,onSelect:v}),M,jsxs(Stack,{flex:1,width:"100%",minWidth:0,children:[jsx(pe,{title:typeof s=="string"?s:void 0,children:s}),y&&jsx(de,{title:typeof y=="string"?y:void 0,children:y})]}),jsxs(Stack,{direction:"row",alignItems:"center",spacing:.5,children:[H&&jsx(ce,{isOneDigit:Math.floor(H/10)===0,children:H}),w&&jsx(ue,{src:yb,alt:"Expand"})]})]}),!!f&&jsx(U,{anchorEl:x,menuItems:f,levelIndex:h+1,sx:I,header:o,levelKey:E,footer:r,searchProps:u})]})},ge=Ze;var xe=ge;var Ce=styled(R)({maxHeight:"100%"}),ye=styled("div")({position:"relative","&:before, &:after":{display:"none"},"&.scrollable":{position:"relative","&::before, &::after":{display:"block",content:'""',position:"absolute",left:0,width:"100%",height:"20px",opacity:1,pointerEvents:"none",zIndex:2,transition:"opacity 0.3s ease-out"},"&::before":{top:0,background:"linear-gradient(to top, transparent, rgba(255, 255, 255, 1))"},"&::after":{bottom:0,background:"linear-gradient(to bottom, transparent, rgba(255, 255, 255, 1))"}},"&.scrolled-to-top":{"&::before":{opacity:0}},"&.scrolled-to-bottom":{"&::after":{opacity:0}}}),be=styled("ul")({listStyle:"none",padding:0,margin:0,maxHeight:300,overflow:"auto"});var rt=({children:e,onScroll:t})=>{let o=useRef(null),{scrolledToBottom:r,scrolledToTop:n,scrollable:i,handleScroll:a}=m({containerRef:o}),c=useMemo(()=>[r&&"scrolled-to-bottom",n&&"scrolled-to-top",i&&"scrollable"].filter(Boolean).join(" "),[r,n,i]),p=useCallback(s=>{t(s),a(s);},[t,a]);return jsx(ye,{sx:{position:"relative"},className:c,children:jsx(be,{ref:o,onScroll:p,children:e})})},Ne=rt;var at=e=>{let{initialValue:t="",getValues:o,filterItem:r,onChange:n,items:i,enabled:a=false,debounceMs:c=300}=e,[p,s]=useState(t),[d,l]=useState(t),h=useMemo(()=>it(m=>{l(m);},c),[c]);useEffect(()=>(h(p),()=>h.cancel()),[h,p]);let f=useCallback(m=>{let T=m.target.value;s(T),h(T),n?.(m);},[n,h]),I=useCallback(()=>{s(""),l(""),h.cancel(),n?.({target:{value:""}});},[n,h]),y=useMemo(()=>{if(!a||!d.trim())return i;let m=d.toLowerCase();return r?i.reduce((T,u)=>{let E=r(u,m);return E&&T.push(E),T},[]):o?i.filter(T=>o(T).some(u=>u.toLowerCase().includes(m))):(console.error("`searchProps.getValues` is required for searching, provide it on the tree node level or the global search props"),i)},[i,d,o,r,a]);return {searchText:p,filteredItems:y,handleSearch:f,handleReset:I}},ve=at;var ft=e=>{let{anchorEl:t,sx:o,levelIndex:r=0,placement:n,menuItems:i,header:a,footer:c,levelKey:p,searchProps:s}=e,[d,l]=useState(false),h=!!t,f=!!s,{searchText:I,filteredItems:y,handleSearch:m,handleReset:T}=ve({...s,enabled:f,items:i}),u=useRef(),E=useCallback(()=>{l(true),clearTimeout(u.current),u.current=setTimeout(()=>{l(false);},100);},[]);return useEffect(()=>()=>clearTimeout(u.current),[]),jsx(Ce,{open:h,anchorEl:t,placement:r>0?"right-start":n,"data-level":r,"data-level-key":p,onClick:x=>x.stopPropagation(),sx:{...o,"&.MuiPopper-dropdown":{"&:after":{display:"none"}}},children:jsxs(Re,{divider:jsx(v,{flexItem:true}),children:[a&&jsx(V,{children:a}),f&&jsxs(Re,{divider:jsx(v,{flexItem:true,sx:{my:1}}),children:[jsx(ie,{sx:{p:1},children:jsx(b,{id:`tree-search-input-${r}`,...s?.inputProps,placeholder:s?.inputProps?.placeholder??"Search...",onChange:m,value:I,inputProps:{autoComplete:"off"},onClear:T})}),y.length===0&&s?.noResultsText&&jsx(ne,{component:"div",fontSize:10,color:x=>alpha(x.palette.text.primary,.4),textAlign:"center",minHeight:36,fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",children:jsx("span",{children:"No results found"})})]}),jsx(Ne,{onScroll:E,children:y.map((x,N)=>jsx(xe,{disableHovering:d,...x,levelIndex:r,subLevelKey:x.levelKey,nestedMenuSx:o},`${r}-${x.id}-${N}`))}),c&&jsx(V,{children:c})]})})},U=ft;function ht(e){function t(o){let r=o.children?o.children.map(t):void 0;if(r?.length===1&&r[0].children?.length&&!r[0].disablePromotion){let n=r[0];r=n.children,o={...o,header:n.header??o.header,footer:n.footer??o.footer,searchProps:n.searchProps??o.searchProps};}return {...o,children:r}}return e.map(t)}function we(e,t,o=[]){for(let r of e)r.status==="CHECKED"&&o.push(r.id),r.children&&we(r.children,t,o);return o}function He(e,t=[],o={},r=false){for(let n of e){let i=r?"CHECKED":n.status??"UNCHECKED";o[n.id]={status:i,...t.length?{_parents:t}:{}},n.children&&He(n.children,[...t,n.id],o,i==="CHECKED");}return o}function Le(e,t){let o=He(e),r=we(e,t),n=o;for(let i of r)n=q(n,i,true);return n}function ke(e,t){return e.map(o=>({...o,status:t[o.id]?.status??"UNCHECKED",children:o.children?ke(o.children,t):void 0}))}function Tt(e){let t={};for(let o of Object.keys(e)){let r=e[o]._parents;if(!r?.length)continue;let n=r[r.length-1];t[n]??(t[n]=[]),t[n].push(o);}return t}function q(e,t,o){let r=structuredClone(e),n=Tt(e),i=o?"CHECKED":"UNCHECKED";function a(p){r[p].status=i;for(let s of n[p]??[])a(s);}function c(p){let s=r[p]._parents;if(!s?.length)return;let d=s[s.length-1],h=(n[d]??[]).map(f=>r[f].status);h.every(f=>f==="CHECKED")?r[d].status="CHECKED":h.every(f=>f==="UNCHECKED")?r[d].status="UNCHECKED":r[d].status="INDETERMINATE",c(d);}return a(t),c(t),r}function gt(e){function t(o){let r=o.children?.map(t).filter(Boolean);return o.status==="CHECKED"||o.status==="INDETERMINATE"||r&&r.length>0?{...o,children:r}:null}return e.map(t).filter(Boolean)}function De(e){let t={};for(let o in e)t[o]={status:"UNCHECKED",...e[o]._parents?{_parents:e[o]._parents}:{}};return t}function Ke(e,t,o,r){if(r)return q(e,t,o);if(!o)return De(e);let n=De(e);return q(n,t,true)}function xt(e,t){let o=[];function r(n){n.levelKey===t&&o.push(n),n.children?.forEach(i=>r(i));}return e.forEach(r),o}var C={denormalizeTree:j((e,t)=>ke(e,t)),extractSelectedBranches:j(e=>gt(e)),filterNodesByLevelKey:j((e,t)=>xt(e,t))};function J(e){let t=ht(e.children??[]);if(t.length===1&&t[0].children?.length&&!t[0].disablePromotion){let[o]=t;return J({levelKey:o.levelKey,children:o.children,header:o.header??e.header,footer:o.footer??e.footer,searchProps:o.searchProps??e.searchProps})}return {...e,children:t}}var It=forwardRef((e,t)=>{let{anchorEl:o,placement:r="bottom-start",treeDefinition:n,sx:i,onChange:a,multiple:c=true,exposeOnlySelectedTree:p=false,IconComponent:s,onMounted:d}=e,{children:l=[]}=n,h=useMemo(()=>J(n),[n]),{header:f,footer:I,children:y=[],searchProps:m,levelKey:T}=h,[u,E]=useState({}),x=useRef(d);x.current=d;let N=useCallback(()=>C.denormalizeTree(l,u),[l,u]),w=useCallback(()=>C.extractSelectedBranches(N()),[N]),H=useCallback((S,M)=>{let g=Ke(u,M.id,S,c);E(g),a&&a(p?C.extractSelectedBranches(C.denormalizeTree(l,g)):C.denormalizeTree(l,g));},[a,l,u,c,p]),L=useCallback(S=>{let g=((k,O)=>{let v={...k};return Object.keys(v).forEach(R=>{v[R]={...v[R],status:O?"CHECKED":"UNCHECKED"};}),v})(u,S);E(g),a&&a(p?C.extractSelectedBranches(C.denormalizeTree(l,g)):C.denormalizeTree(l,g));},[u,a,l,p]);return useEffect(()=>{let S=Le(l||[],c);E(S);let M=C.denormalizeTree(l,S),g=C.extractSelectedBranches(M);x.current?.({state:S,tree:M,selectedTree:g});},[l,c]),useImperativeHandle(t,()=>({treeMapper:u,getFullTree:N,getSelectedTree:w,toggleAll:L}),[u,N,w,L]),jsx(re,{treeMapper:u,IconComponent:s,handleSelect:H,multiple:c,children:jsx(U,{anchorEl:o,sx:i,header:f,footer:I,menuItems:y,levelKey:T,searchProps:m,placement:r})})}),ze=It;var Xo=ze;export{Ue as a,C as b,Xo as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {h,b as b$1,f as f$1}from'./chunk-5GDTBQ3D.js';import {b,h as h$1,c,e,d,j as j$1,i}from'./chunk-26HBCCEH.js';import {f,h as h$2}from'./chunk-ISC5KT5E.js';import {H as H$1,j}from'./chunk-CAVYK7HF.js';import {a}from'./chunk-IFYLS2HJ.js';import {g,mc,nc}from'./chunk-Z2DUFVI5.js';import {Vd,ta,dl,el,wi,Ik,A,xe as xe$1,we,sa,qa,ra}from'./chunk-3M2GZVQW.js';import {forwardRef,memo,createContext,useState,useRef,useMemo,useContext,useEffect,useCallback,useId}from'react';import ie from'@mui/material/Box';import nt from'@mui/material/Typography';import P from'@uiw/react-json-view';import {motion,AnimatePresence}from'framer-motion';import {styled}from'@mui/material/styles';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useTranslation}from'react-i18next';var O="os-shared-JSONViewWindow",m={root:`${O}-root`,body:`${O}-body`,requestPane:`${O}-requestPane`,responsePane:`${O}-responsePane`,section:`${O}-section`,title:`${O}-title`,actions:`${O}-actions`,scroll:`${O}-scroll`,footer:`${O}-footer`,count:`${O}-count`},N=400,B=545,Z=.5,po=20,co=30,Ne="Items",be="JSON Response",We="JSON Request & Response",mo="rgb(231, 231, 231)";var fo=styled("span")({display:"inline-flex",alignItems:"center",gap:"6px"}),uo=styled("span")({margin:"0px",fontStyle:"normal",fontStretch:"normal",color:"rgb(32, 35, 43)",letterSpacing:"0px",fontSize:"9px",fontWeight:400,lineHeight:"10.8px"}),xo=styled("span")({margin:"0px",fontStyle:"normal",fontStretch:"normal",color:"rgb(32, 35, 43)",letterSpacing:"0px",fontSize:"10.5px",fontWeight:700,lineHeight:"12.6px",textAlign:"right"});var ho=forwardRef(function({totalCount:o,id:n,className:t,sx:r},i){return jsx(h,{ref:i,id:n,"data-testid":n??"Footer",className:nc(m.footer,t),sx:mc({justifyContent:"flex-start"},r),children:o!=null?jsx(H$1,{variant:"text",className:m.count,sx:{cursor:"text",borderWidth:.75},children:jsxs(fo,{children:[jsx(uo,{children:Ne}),jsx(xo,{children:g(o??0)})]})}):null})});ho.displayName="Footer";var H=memo(ho);var wo=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"})),Ie=styled(motion.img)({height:"14px",width:"14px"});function oe({"data-copied":e,style:o,onClick:n},{keyName:t}){return t?jsxs(wo,{style:o,onClick:r=>{n?.(r);},children:[jsx(AnimatePresence,{children:e&&jsx(Ie,{initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:ta,alt:"icon"},"copied-icon")}),jsx(AnimatePresence,{children:!e&&jsx(Ie,{initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:ra,alt:"icon"},"copy-icon")})]}):jsx("span",{})}var So=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}));function No({onClick:e,icon:o,label:n,disableAnimation:t,...r}){let[i,s]=useState(false),{t:c}=useTranslation();return jsxs(So,{...r,onClick:p=>{e?.(p),!t&&(s(true),setTimeout(()=>{s(false);},2e3));},children:[jsxs(ie,{sx:{width:"16px",display:"flex",overflow:"hidden",justifyContent:"center",alignItems:"center"},children:[jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.img,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.4},src:ta,alt:"icon"},"id-icon")}),jsx(AnimatePresence,{mode:"wait",children:!i&&jsx(motion.img,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.4},src:o,alt:"icon"},"id-icon")})]}),n&&jsxs(Fragment,{children:[jsx(AnimatePresence,{children:i&&jsx(motion.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute"},transition:{duration:.4},children:c("copied")})}),jsx(AnimatePresence,{children:!i&&jsx(motion.span,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,position:"absolute",width:"53px"},transition:{duration:.4},children:n})})]})]})}No.displayName="IconButton";var T=memo(No);var bo=styled("div")(()=>({display:"flex",alignItems:"center",position:"relative",flexShrink:0,width:"24px",height:"24px"})),Wo=styled("button")(({theme:e,isActive:o})=>({width:"24px",height:"24px",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",border:`1px solid ${o?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}`}})),Co=styled(motion.div)(()=>({position:"absolute",right:0,top:0,height:"24px",display:"flex",alignItems:"center",zIndex:20,background:"transparent"})),Io=styled(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"}})),Te={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,userSelect:"none"},Oo={...Te,background:"none",border:"none",padding:0,margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",outline:"none","&:disabled":{opacity:.3,cursor:"default"}},To=styled("button")(()=>({...Oo,right:53})),Po=styled("button")(()=>({...Oo,right:39})),vo=styled(motion.img)(()=>({...Te,right:24,width:10,height:10,cursor:"pointer"})),_o=styled(motion.img)(()=>({...Te,right:8,width:11,height:11,cursor:"default"})),Pe=styled("img")(()=>({width:10,height:10})),Jo=styled("img")(()=>({width:12,height:12})),Eo=styled("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 Bt({value:e,onChange:o,currentIndex:n,totalCount:t,onPrev:r,onNext:i,onOpen:s,placeholder:c="Search..."}){let[a,p]=useState(false),u=useRef(null),f=e.trim().length>0,y=t>0,S=f,W=()=>{s?.(),p(true),requestAnimationFrame(()=>u.current?.focus());},C=()=>{o(""),p(false);};return jsxs(bo,{children:[jsx(AnimatePresence,{children:a&&jsxs(Co,{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(Io,{ref:u,initial:false,animate:{paddingRight:S?"98px":"24px"},transition:{duration:.15},placeholder:c,value:e,onChange:I=>o(I.target.value),onKeyDown:I=>{I.key==="Enter"&&(I.shiftKey?r():i()),I.key==="Escape"&&C();},onBlur:()=>{f||p(false);}}),S&&jsx(To,{onClick:r,disabled:!y,title:"Previous match (Shift+Enter)",children:jsx(Pe,{src:dl,alt:"prev"})}),S&&jsx(Po,{onClick:i,disabled:!y,title:"Next match (Enter)",children:jsx(Pe,{src:el,alt:"next"})}),S&&jsx(vo,{src:wi,alt:"clear",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:C}),jsx(_o,{src:Ik,alt:"search",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),S&&jsx(Eo,{children:y?`${n+1}/${t}`:"0/0"})]},"input-area")}),jsx(AnimatePresence,{children:!a&&jsx(motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.15},children:jsx(Wo,{isActive:false,onClick:W,title:"Search",children:jsx(Jo,{src:A,alt:"search"})})})})]})}var M=memo(Bt);function ko(e,o){let n=[],t=o.length,r=0,i=e.indexOf(o,r);for(;i!==-1;){let s=i+t;n.push([i,s]),r=s,i=e.indexOf(o,r);}return n}var At={padding:0,outline:"none"};function Bo({text:e,queryLength:o,ranges:n,idPrefix:t}){let r=[],i=0;return n.forEach(([s,c],a)=>{s>i&&r.push(e.slice(i,s)),r.push(jsx("mark",{style:At,children:e.slice(s,s+o)},`${t}-${a}`)),i=c;}),i<e.length&&r.push(e.slice(i)),jsx(Fragment,{children:r})}function V({text:e,query:o}){let n=useId(),t=useMemo(()=>o.trim().toLowerCase(),[o]),r=useMemo(()=>{if(!t)return e;let i=e.toLowerCase(),s=ko(i,t);return s.length===0?e:jsx(Bo,{text:e,queryLength:o.length,ranges:s,idPrefix:n})},[e,o.length,t,n]);return jsx(Fragment,{children:r})}var ve={"--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:"100%",overflow:"auto"},jo={...ve,background:"transparent","--w-rjv-line-color":"transparent"},_e=styled(j)(()=>({border:"1px solid rgba(242, 242, 242, 0.70);",display:"inline-flex",height:"24px",minWidth:"73px",padding:"0px 8px",justifyContent:"center",alignItems:"center",gap:"6px",borderRadius:"37.5px",backgroundColor:"#fff",fontSize:"9px",lineHeight:"15px",fontWeight:400})),Je=styled(ie)(()=>({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"4px",paddingBlock:"8px",paddingInlineStart:"12px",paddingInlineEnd:"12px",position:"sticky",left:0,right:0,top:0,background:"#fff",zIndex:5,flexShrink:0,minHeight:44})),Ee=styled(ie)(()=>({display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",flexShrink:0,marginLeft:"auto"})),Lo=styled(ie)(()=>({display:"flex",flexDirection:"row",flex:1,minHeight:0,height:"100%",width:"100%",background:"transparent",position:"relative",overflow:"visible"})),Re=styled(ie)(()=>({display:"flex",flexDirection:"column",flex:1,minHeight:0,overflowY:"auto",overflowX:"hidden"})),zo=styled(motion.div,{shouldForwardProp:e=>!["isRequestShown","isMaximized"].includes(e)})(({isRequestShown:e,isMaximized:o})=>({width:"100%",height:"100%",minHeight:0,overflow:"hidden",background:"#fff",zIndex:20,position:"relative",left:0,display:"flex",flexDirection:"column",flex:1,minWidth:0,borderBottomRightRadius:"12px",borderBottomLeftRadius:e?0:"12px",...o&&{borderBottomLeftRadius:0,borderBottomRightRadius:0}})),qo=styled(motion.div,{shouldForwardProp:e=>!["isMaximized","currentRequestWidth"].includes(e)})(({isMaximized:e,currentRequestWidth:o})=>({backgroundColor:mo,backdropFilter:"blur(24px)",height:"100%",overflowY:"auto",overflowX:"hidden",position:"absolute",width:e?"100%":o,zIndex:19,display:"flex",flexDirection:"column",borderBottomLeftRadius:"12px",top:0,bottom:0})),Fo=styled("span")(()=>({color:"#032F62"})),$o=styled("span")(()=>({color:"#357fb9"}));function se(e,o){return e.toLowerCase().includes(o)}function ae(e){return e.trim().toLowerCase()}function le(e){let o=ae(e);return (n,{keyName:t})=>{if(!o||!t)return;let r=String(t);if(se(r,o))return jsx($o,{children:jsx(V,{text:String(t),query:e})})}}function pe(e){let o=ae(e);return (n,{value:t})=>{if(!o)return;let r=String(t??"");if(se(r,o))return jsxs(Fo,{children:['"',jsx(V,{text:String(t??""),query:e}),'"']})}}function Uo(e,o){return e==null?String(e).includes(o):typeof e=="string"?e.toLowerCase().includes(o):typeof e=="number"||typeof e=="boolean"?String(e).includes(o):false}function Go(e,o){if(Array.isArray(e)){let n=e.map(t=>Go(t,o)).filter(t=>t!=null);return n.length>0?n:null}return typeof e=="object"&&e!==null?Qo(e,o):Uo(e,o)?e:null}function Qo(e,o){let n={};for(let[t,r]of Object.entries(e))if(t.toLowerCase().includes(o))n[t]=r;else if(typeof r=="object"&&r!==null){let i=Go(r,o);i!==null&&(n[t]=i);}else Uo(r,o)&&(n[t]=r);return Object.keys(n).length>0?n:null}function Ve(e,o){return o.trim()?Qo(e,o.toLowerCase()):e}function Yo(e,o,n){return {x:e/2-N/4+n*po,y:o/2-B/2+n*co}}var ot="#FFE20B";function z(e,o){let[n,t]=useState(0),[r,i]=useState(0);useEffect(()=>{if(!o.trim()){i(0),t(0);return}let a=setTimeout(()=>{let p=e.current?.querySelectorAll("mark")??[];i(p.length),t(0);},50);return ()=>clearTimeout(a)},[o,e]),useEffect(()=>{if(!e.current||!o.trim())return;let a=Array.from(e.current.querySelectorAll("mark"));a.forEach((p,u)=>{let f=u===n;p.style.backgroundColor=f?ot:"transparent",p.style.outline=f?`1px solid ${ot}`:"none",p.style.borderRadius="2px";}),a[n]?.scrollIntoView({behavior:"smooth",block:"nearest"});},[n,r,o,e]);let s=useCallback(()=>{r!==0&&t(a=>(a+1)%r);},[r]),c=useCallback(()=>{r!==0&&t(a=>(a-1+r)%r);},[r]);return {currentIndex:n,totalCount:r,goNext:s,goPrev:c}}function rt({json:e,requestJson:o={},onJsonSearch:n,onJsonCopy:t,onJsonIdCopy:r,onJsonNodesMinimize:i,onJsonNodesMaximize:s,isRequestShown:c,isToolbarAnimationDisabled:a}){let{isMaximized:p,size:u,isResizing:f}=b$1(),[y,S]=useState(false),[W,C]=useState(true),[x,h]=useState(""),[g,I]=useState(""),D=useRef(null),A=useRef(null),U=z(D,x),G=z(A,g),St=useMemo(()=>Object.keys(e??{})?.length??0,[e]),Ae=u.width||N,He=v=>{setTimeout(()=>{navigator.clipboard.writeText(v||"").then(()=>{});},10);},Nt=useMemo(()=>Object.keys(o??{})?.length??0,[o]),Me=useMemo(()=>Ve(e,x),[e,x]),je=useMemo(()=>Ve(o,g),[o,g]);return jsxs(Lo,{"data-testid":"Pane",className:nc(m.root,m.body),children:[jsx(AnimatePresence,{children:c&&jsx(qo,{className:nc(m.requestPane),initial:{left:0},animate:{left:p?0:-Ae},exit:{left:0},transition:{duration:Z,...a&&{duration:0},...f&&{duration:0}},isMaximized:p,currentRequestWidth:Ae,children:jsxs(ie,{ref:A,sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[jsxs(Je,{className:nc(m.section),sx:{background:"transparent"},children:[jsx(_e,{variant:"subtitle1",className:nc(m.title),children:"API Request"}),jsxs(Ee,{className:nc(m.actions),children:[jsx(M,{value:g,onChange:I,onOpen:()=>n?.(),currentIndex:G.currentIndex,totalCount:G.totalCount,onPrev:G.goPrev,onNext:G.goNext}),jsx(T,{disableAnimation:true,onClick:()=>{W?s?.():i?.(),C(v=>!v);},icon:W?xe$1:we}),jsx(T,{onClick:()=>{t?.(),navigator.clipboard.writeText(JSON.stringify(o,null,2)).then(()=>{});},icon:sa}),jsx(T,{onClick:()=>{r?.(),navigator.clipboard.writeText(e?.id||"").then(()=>{});},icon:qa})]})]}),g.trim()&&je===null?jsx(ie,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(nt,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsx(Re,{className:nc(m.scroll),children:jsxs(P,{value:je??o,style:jo,displayDataTypes:false,collapsed:g.trim()?void 0:W?1:void 0,onCopied:(v,_)=>{typeof _=="string"&&He(_);},enableClipboard:false,children:[jsx(P.String,{render:pe(g)}),jsx(P.KeyName,{render:le(g)}),jsx(P.CountInfo,{render:(v,{keyName:_})=>{if(!_)return jsx("span",{})}}),jsx(P.Copied,{render:oe})]})}),jsx(H,{totalCount:Nt,sx:{borderBottomRightRadius:0,background:"#f8f9fb"}})]})},"request-pane")}),jsxs(zo,{ref:D,className:nc(m.responsePane),isMaximized:p,isRequestShown:c,initial:{...p&&{width:"100vw",left:0}},animate:{...p&&{position:"absolute",left:c?"50vw":"0"}},transition:{duration:Z,...a&&{duration:0},...f&&{duration:0}},children:[jsxs(Je,{className:nc(m.section),children:[jsx(_e,{variant:"subtitle1",className:nc(m.title),children:"API Response"}),jsxs(Ee,{className:nc(m.actions),children:[jsx(M,{value:x,onChange:h,onOpen:()=>n?.(),currentIndex:U.currentIndex,totalCount:U.totalCount,onPrev:U.goPrev,onNext:U.goNext}),jsx(T,{disableAnimation:true,onClick:()=>{y?s?.():i?.(),S(v=>!v);},icon:y?xe$1:we}),jsx(T,{onClick:()=>{t?.(),navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{});},icon:sa}),jsx(T,{onClick:()=>{r?.(),navigator.clipboard.writeText(e?.id||"").then(()=>{});},icon:qa})]})]}),x.trim()&&Me===null?jsx(ie,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(nt,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsx(Re,{className:nc(m.scroll),children:jsxs(P,{value:Me??e,style:ve,displayDataTypes:false,collapsed:x.trim()?void 0:y?1:void 0,onCopied:(v,_)=>{typeof _=="string"&&He(_);},children:[jsx(P.String,{render:pe(x)}),jsx(P.KeyName,{render:le(x)}),jsx(P.CountInfo,{render:(v,{keyName:_})=>{if(!_)return jsx("span",{})}}),jsx(P.Copied,{render:oe})]})}),jsx(H,{totalCount:St,sx:{borderBottomLeftRadius:c?0:"12px",background:"#f8f9fb"}})]})]})}rt.displayName="Pane";var me=memo(rt);var $t="os-shared-JSONViewWindowToolbar",q={root:`${$t}-root`};var st=forwardRef(function({title:o,onClose:n,onMaximize:t,maximized:r=false,onRequestClick:i$1,requestDirection:s="left",showRequestIcon:c$1=false,id:a,className:p,sx:u},f$1){return jsxs(b,{ref:f$1,id:a??f,"data-testid":a??"Toolbar",sx:mc({backgroundColor:"#f9f9f9",backdropFilter:"none"},u),className:nc(q.root,p),children:[jsxs(h$1,{children:[jsx(c,{onClick:n}),jsx(e,{isMaximized:r,onClick:t}),c$1&&jsx(d,{onClick:i$1,direction:s,children:"Request"})]}),jsx(j$1,{title:o,icon:Vd}),jsx(i,{})]})});st.displayName="Toolbar";var $=memo(st);var Gt="os-shared-JSONViewWindowContent",at={root:`${Gt}-root`};var pt=styled(motion.div)({flexShrink:0}),ct=styled("div")({display:"contents"});function Xt({requestJson:e={},onClose:o,onJsonRequestOpen:n,isRequestShown:t,setIsRequestShown:r,isToolbarAnimationDisabled:i,setIsToolbarAnimationDisabled:s,className:c,...a}){let{isMaximized:p,setIsMaximized:u,setSize:f,size:y,isResizing:S}=b$1(),W=Object.keys(e??{})?.length,C=y.width||N;return jsxs(Fragment,{children:[jsx(pt,{animate:{width:p?"100%":t?C*2:C,x:!p&&t?-C:0},transition:{duration:S||i?0:h$2},children:jsx($,{title:t?We:be,onClose:()=>o(),onMaximize:()=>{u(x=>!x),s(true),setTimeout(()=>{s(false);},h$2*1e3);},maximized:p,onRequestClick:()=>{r(x=>!x),s(false),t||(n?.(),f({width:N,height:B}));},requestDirection:t?"right":"left",showRequestIcon:!!W})}),jsx(ct,{className:nc(at.root,c),children:jsx(me,{...a,requestJson:e,onClose:o,onJsonRequestOpen:n,isRequestShown:t,isToolbarAnimationDisabled:i})})]})}var K=memo(Xt);var k=createContext({windows:[],open:()=>{},close:()=>{},closeAll:()=>{},handleWindowMinimize:()=>{},handleWindowOrder:()=>{},registerJSONViewWindowEvents:()=>{},containerRef:{current:null}});function mt({list:e,events:o,onClose:n,isWindowMinimized:t,windowOrder:r}){return e?.length?jsx(Fragment,{children:e.map((i,s)=>jsx(xe,{index:s,...o,...i,onClose:()=>{n(s);},isWindowMinimized:t,windowOrder:r},i.json.id))}):null}mt.displayName="List";var ue=memo(mt);var ut=({children:e,containerRef:o})=>{let[n,t]=useState([]),[r,i]=useState(false),[s,c]=useState(1),a=useRef({}),p=useCallback(h=>{if(n.length===7){alert("Maximum allowed active JSON View Window is 7 per table.");return}if(n.some(A=>A.json.id===h.json.id))return;let g=structuredClone(h.json),I=g.request_body,D={...h,json:g,requestJson:h.requestJson||I||void 0};delete D.json.request_body,t(A=>[...A,D]);},[n]),u=useCallback(h=>{t(g=>g.filter((I,D)=>h!==D));},[]),f=useCallback(()=>{t([]);},[]),y=useCallback(h=>{i(h);},[]),S=useCallback(h=>{c(h);},[]),W=useCallback(h=>{a.current=h;},[]),C=useMemo(()=>({onJsonRequestOpen:()=>a.current.onJsonRequestOpen?.(),onJsonSearch:()=>a.current.onJsonSearch?.(),onJsonCopy:()=>a.current.onJsonCopy?.(),onJsonIdCopy:()=>a.current.onJsonIdCopy?.(),onJsonNodesMinimize:()=>a.current.onJsonNodesMinimize?.(),onJsonNodesMaximize:()=>a.current.onJsonNodesMaximize?.()}),[]),x=useMemo(()=>({windows:n,open:p,close:u,closeAll:f,handleWindowMinimize:y,handleWindowOrder:S,registerJSONViewWindowEvents:W,containerRef:o}),[n,p,u,f,y,S,W,o]);return jsxs(k.Provider,{value:x,children:[e,jsx(ue,{list:n,events:C,onClose:u,isWindowMinimized:r,windowOrder:s})]})};function gt(e){let{containerRef:o}=useContext(k),{height:n,width:t}=a(),[r,i]=useState(false),[s,c]=useState(false);return jsx(f$1,{isOpen:true,onClose:e.onClose,containerRef:o,defaultSize:{width:N,height:B},minSize:{width:N,height:300},defaultPosition:Yo(t,n,e.index),order:e.windowOrder,isMinimized:e.isWindowMinimized,sx:{boxShadow:"none",overflow:"visible"},id:"json-view-window",className:nc(m.root,e.className),children:jsx(K,{...e,isRequestShown:r,setIsRequestShown:i,isToolbarAnimationDisabled:s,setIsToolbarAnimationDisabled:c})})}gt.displayName="JSONViewWindow";var xe=memo(gt);var yt=({isWindowMinimized:e,windowOrder:o,...n}={})=>{let{windows:t,open:r,close:i,closeAll:s,handleWindowMinimize:c,handleWindowOrder:a,registerJSONViewWindowEvents:p}=useContext(k),u=useCallback(()=>{c(e??false);},[c,e]),f=useCallback(()=>{a(o??1);},[a,o]);return useEffect(()=>{f();},[f]),useEffect(()=>{u();},[u]),useEffect(()=>{p(n);},[p,n]),{open:r,close:i,closeAll:s,windows:t,count:t.length}};var Cs=xe;export{m as a,N as b,B as c,Z as d,Ne as e,be as f,We as g,H as h,T as i,M as j,V as k,z as l,me as m,q as n,$ as o,K as p,k as q,ue as r,ut as s,yt as t,Cs as u};
|
|
1
|
+
import {h,b as b$1,f as f$1}from'./chunk-Z4KKF3ZW.js';import {b,h as h$1,c,e,d,j as j$1,i}from'./chunk-ZHBPM7RI.js';import {f,h as h$2}from'./chunk-ISC5KT5E.js';import {a}from'./chunk-DROAYBDL.js';import {H as H$1,j}from'./chunk-CAVYK7HF.js';import {g,mc,nc}from'./chunk-Z2DUFVI5.js';import {Vd,ta,dl,el,wi,Ik,A,xe as xe$1,we,sa,qa,ra}from'./chunk-3M2GZVQW.js';import {forwardRef,memo,createContext,useState,useRef,useMemo,useContext,useEffect,useCallback,useId}from'react';import ie from'@mui/material/Box';import nt from'@mui/material/Typography';import P from'@uiw/react-json-view';import {motion,AnimatePresence}from'framer-motion';import {styled}from'@mui/material/styles';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useTranslation}from'react-i18next';var O="os-shared-JSONViewWindow",m={root:`${O}-root`,body:`${O}-body`,requestPane:`${O}-requestPane`,responsePane:`${O}-responsePane`,section:`${O}-section`,title:`${O}-title`,actions:`${O}-actions`,scroll:`${O}-scroll`,footer:`${O}-footer`,count:`${O}-count`},N=400,B=545,Z=.5,po=20,co=30,Ne="Items",be="JSON Response",We="JSON Request & Response",mo="rgb(231, 231, 231)";var fo=styled("span")({display:"inline-flex",alignItems:"center",gap:"6px"}),uo=styled("span")({margin:"0px",fontStyle:"normal",fontStretch:"normal",color:"rgb(32, 35, 43)",letterSpacing:"0px",fontSize:"9px",fontWeight:400,lineHeight:"10.8px"}),xo=styled("span")({margin:"0px",fontStyle:"normal",fontStretch:"normal",color:"rgb(32, 35, 43)",letterSpacing:"0px",fontSize:"10.5px",fontWeight:700,lineHeight:"12.6px",textAlign:"right"});var ho=forwardRef(function({totalCount:o,id:n,className:t,sx:r},i){return jsx(h,{ref:i,id:n,"data-testid":n??"Footer",className:nc(m.footer,t),sx:mc({justifyContent:"flex-start"},r),children:o!=null?jsx(H$1,{variant:"text",className:m.count,sx:{cursor:"text",borderWidth:.75},children:jsxs(fo,{children:[jsx(uo,{children:Ne}),jsx(xo,{children:g(o??0)})]})}):null})});ho.displayName="Footer";var H=memo(ho);var wo=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"})),Ie=styled(motion.img)({height:"14px",width:"14px"});function oe({"data-copied":e,style:o,onClick:n},{keyName:t}){return t?jsxs(wo,{style:o,onClick:r=>{n?.(r);},children:[jsx(AnimatePresence,{children:e&&jsx(Ie,{initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:ta,alt:"icon"},"copied-icon")}),jsx(AnimatePresence,{children:!e&&jsx(Ie,{initial:{opacity:0},animate:{opacity:1,position:"absolute"},exit:{opacity:0},transition:{duration:.4},src:ra,alt:"icon"},"copy-icon")})]}):jsx("span",{})}var So=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}));function No({onClick:e,icon:o,label:n,disableAnimation:t,...r}){let[i,s]=useState(false),{t:c}=useTranslation();return jsxs(So,{...r,onClick:p=>{e?.(p),!t&&(s(true),setTimeout(()=>{s(false);},2e3));},children:[jsxs(ie,{sx:{width:"16px",display:"flex",overflow:"hidden",justifyContent:"center",alignItems:"center"},children:[jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.img,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.4},src:ta,alt:"icon"},"id-icon")}),jsx(AnimatePresence,{mode:"wait",children:!i&&jsx(motion.img,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.4},src:o,alt:"icon"},"id-icon")})]}),n&&jsxs(Fragment,{children:[jsx(AnimatePresence,{children:i&&jsx(motion.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute"},transition:{duration:.4},children:c("copied")})}),jsx(AnimatePresence,{children:!i&&jsx(motion.span,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,position:"absolute",width:"53px"},transition:{duration:.4},children:n})})]})]})}No.displayName="IconButton";var T=memo(No);var bo=styled("div")(()=>({display:"flex",alignItems:"center",position:"relative",flexShrink:0,width:"24px",height:"24px"})),Wo=styled("button")(({theme:e,isActive:o})=>({width:"24px",height:"24px",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",border:`1px solid ${o?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}`}})),Co=styled(motion.div)(()=>({position:"absolute",right:0,top:0,height:"24px",display:"flex",alignItems:"center",zIndex:20,background:"transparent"})),Io=styled(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"}})),Te={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,userSelect:"none"},Oo={...Te,background:"none",border:"none",padding:0,margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",outline:"none","&:disabled":{opacity:.3,cursor:"default"}},To=styled("button")(()=>({...Oo,right:53})),Po=styled("button")(()=>({...Oo,right:39})),vo=styled(motion.img)(()=>({...Te,right:24,width:10,height:10,cursor:"pointer"})),_o=styled(motion.img)(()=>({...Te,right:8,width:11,height:11,cursor:"default"})),Pe=styled("img")(()=>({width:10,height:10})),Jo=styled("img")(()=>({width:12,height:12})),Eo=styled("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 Bt({value:e,onChange:o,currentIndex:n,totalCount:t,onPrev:r,onNext:i,onOpen:s,placeholder:c="Search..."}){let[a,p]=useState(false),u=useRef(null),f=e.trim().length>0,y=t>0,S=f,W=()=>{s?.(),p(true),requestAnimationFrame(()=>u.current?.focus());},C=()=>{o(""),p(false);};return jsxs(bo,{children:[jsx(AnimatePresence,{children:a&&jsxs(Co,{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(Io,{ref:u,initial:false,animate:{paddingRight:S?"98px":"24px"},transition:{duration:.15},placeholder:c,value:e,onChange:I=>o(I.target.value),onKeyDown:I=>{I.key==="Enter"&&(I.shiftKey?r():i()),I.key==="Escape"&&C();},onBlur:()=>{f||p(false);}}),S&&jsx(To,{onClick:r,disabled:!y,title:"Previous match (Shift+Enter)",children:jsx(Pe,{src:dl,alt:"prev"})}),S&&jsx(Po,{onClick:i,disabled:!y,title:"Next match (Enter)",children:jsx(Pe,{src:el,alt:"next"})}),S&&jsx(vo,{src:wi,alt:"clear",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:C}),jsx(_o,{src:Ik,alt:"search",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),S&&jsx(Eo,{children:y?`${n+1}/${t}`:"0/0"})]},"input-area")}),jsx(AnimatePresence,{children:!a&&jsx(motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.15},children:jsx(Wo,{isActive:false,onClick:W,title:"Search",children:jsx(Jo,{src:A,alt:"search"})})})})]})}var M=memo(Bt);function ko(e,o){let n=[],t=o.length,r=0,i=e.indexOf(o,r);for(;i!==-1;){let s=i+t;n.push([i,s]),r=s,i=e.indexOf(o,r);}return n}var At={padding:0,outline:"none"};function Bo({text:e,queryLength:o,ranges:n,idPrefix:t}){let r=[],i=0;return n.forEach(([s,c],a)=>{s>i&&r.push(e.slice(i,s)),r.push(jsx("mark",{style:At,children:e.slice(s,s+o)},`${t}-${a}`)),i=c;}),i<e.length&&r.push(e.slice(i)),jsx(Fragment,{children:r})}function V({text:e,query:o}){let n=useId(),t=useMemo(()=>o.trim().toLowerCase(),[o]),r=useMemo(()=>{if(!t)return e;let i=e.toLowerCase(),s=ko(i,t);return s.length===0?e:jsx(Bo,{text:e,queryLength:o.length,ranges:s,idPrefix:n})},[e,o.length,t,n]);return jsx(Fragment,{children:r})}var ve={"--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:"100%",overflow:"auto"},jo={...ve,background:"transparent","--w-rjv-line-color":"transparent"},_e=styled(j)(()=>({border:"1px solid rgba(242, 242, 242, 0.70);",display:"inline-flex",height:"24px",minWidth:"73px",padding:"0px 8px",justifyContent:"center",alignItems:"center",gap:"6px",borderRadius:"37.5px",backgroundColor:"#fff",fontSize:"9px",lineHeight:"15px",fontWeight:400})),Je=styled(ie)(()=>({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"4px",paddingBlock:"8px",paddingInlineStart:"12px",paddingInlineEnd:"12px",position:"sticky",left:0,right:0,top:0,background:"#fff",zIndex:5,flexShrink:0,minHeight:44})),Ee=styled(ie)(()=>({display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",flexShrink:0,marginLeft:"auto"})),Lo=styled(ie)(()=>({display:"flex",flexDirection:"row",flex:1,minHeight:0,height:"100%",width:"100%",background:"transparent",position:"relative",overflow:"visible"})),Re=styled(ie)(()=>({display:"flex",flexDirection:"column",flex:1,minHeight:0,overflowY:"auto",overflowX:"hidden"})),zo=styled(motion.div,{shouldForwardProp:e=>!["isRequestShown","isMaximized"].includes(e)})(({isRequestShown:e,isMaximized:o})=>({width:"100%",height:"100%",minHeight:0,overflow:"hidden",background:"#fff",zIndex:20,position:"relative",left:0,display:"flex",flexDirection:"column",flex:1,minWidth:0,borderBottomRightRadius:"12px",borderBottomLeftRadius:e?0:"12px",...o&&{borderBottomLeftRadius:0,borderBottomRightRadius:0}})),qo=styled(motion.div,{shouldForwardProp:e=>!["isMaximized","currentRequestWidth"].includes(e)})(({isMaximized:e,currentRequestWidth:o})=>({backgroundColor:mo,backdropFilter:"blur(24px)",height:"100%",overflowY:"auto",overflowX:"hidden",position:"absolute",width:e?"100%":o,zIndex:19,display:"flex",flexDirection:"column",borderBottomLeftRadius:"12px",top:0,bottom:0})),Fo=styled("span")(()=>({color:"#032F62"})),$o=styled("span")(()=>({color:"#357fb9"}));function se(e,o){return e.toLowerCase().includes(o)}function ae(e){return e.trim().toLowerCase()}function le(e){let o=ae(e);return (n,{keyName:t})=>{if(!o||!t)return;let r=String(t);if(se(r,o))return jsx($o,{children:jsx(V,{text:String(t),query:e})})}}function pe(e){let o=ae(e);return (n,{value:t})=>{if(!o)return;let r=String(t??"");if(se(r,o))return jsxs(Fo,{children:['"',jsx(V,{text:String(t??""),query:e}),'"']})}}function Uo(e,o){return e==null?String(e).includes(o):typeof e=="string"?e.toLowerCase().includes(o):typeof e=="number"||typeof e=="boolean"?String(e).includes(o):false}function Go(e,o){if(Array.isArray(e)){let n=e.map(t=>Go(t,o)).filter(t=>t!=null);return n.length>0?n:null}return typeof e=="object"&&e!==null?Qo(e,o):Uo(e,o)?e:null}function Qo(e,o){let n={};for(let[t,r]of Object.entries(e))if(t.toLowerCase().includes(o))n[t]=r;else if(typeof r=="object"&&r!==null){let i=Go(r,o);i!==null&&(n[t]=i);}else Uo(r,o)&&(n[t]=r);return Object.keys(n).length>0?n:null}function Ve(e,o){return o.trim()?Qo(e,o.toLowerCase()):e}function Yo(e,o,n){return {x:e/2-N/4+n*po,y:o/2-B/2+n*co}}var ot="#FFE20B";function z(e,o){let[n,t]=useState(0),[r,i]=useState(0);useEffect(()=>{if(!o.trim()){i(0),t(0);return}let a=setTimeout(()=>{let p=e.current?.querySelectorAll("mark")??[];i(p.length),t(0);},50);return ()=>clearTimeout(a)},[o,e]),useEffect(()=>{if(!e.current||!o.trim())return;let a=Array.from(e.current.querySelectorAll("mark"));a.forEach((p,u)=>{let f=u===n;p.style.backgroundColor=f?ot:"transparent",p.style.outline=f?`1px solid ${ot}`:"none",p.style.borderRadius="2px";}),a[n]?.scrollIntoView({behavior:"smooth",block:"nearest"});},[n,r,o,e]);let s=useCallback(()=>{r!==0&&t(a=>(a+1)%r);},[r]),c=useCallback(()=>{r!==0&&t(a=>(a-1+r)%r);},[r]);return {currentIndex:n,totalCount:r,goNext:s,goPrev:c}}function rt({json:e,requestJson:o={},onJsonSearch:n,onJsonCopy:t,onJsonIdCopy:r,onJsonNodesMinimize:i,onJsonNodesMaximize:s,isRequestShown:c,isToolbarAnimationDisabled:a}){let{isMaximized:p,size:u,isResizing:f}=b$1(),[y,S]=useState(false),[W,C]=useState(true),[x,h]=useState(""),[g,I]=useState(""),D=useRef(null),A=useRef(null),U=z(D,x),G=z(A,g),St=useMemo(()=>Object.keys(e??{})?.length??0,[e]),Ae=u.width||N,He=v=>{setTimeout(()=>{navigator.clipboard.writeText(v||"").then(()=>{});},10);},Nt=useMemo(()=>Object.keys(o??{})?.length??0,[o]),Me=useMemo(()=>Ve(e,x),[e,x]),je=useMemo(()=>Ve(o,g),[o,g]);return jsxs(Lo,{"data-testid":"Pane",className:nc(m.root,m.body),children:[jsx(AnimatePresence,{children:c&&jsx(qo,{className:nc(m.requestPane),initial:{left:0},animate:{left:p?0:-Ae},exit:{left:0},transition:{duration:Z,...a&&{duration:0},...f&&{duration:0}},isMaximized:p,currentRequestWidth:Ae,children:jsxs(ie,{ref:A,sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[jsxs(Je,{className:nc(m.section),sx:{background:"transparent"},children:[jsx(_e,{variant:"subtitle1",className:nc(m.title),children:"API Request"}),jsxs(Ee,{className:nc(m.actions),children:[jsx(M,{value:g,onChange:I,onOpen:()=>n?.(),currentIndex:G.currentIndex,totalCount:G.totalCount,onPrev:G.goPrev,onNext:G.goNext}),jsx(T,{disableAnimation:true,onClick:()=>{W?s?.():i?.(),C(v=>!v);},icon:W?xe$1:we}),jsx(T,{onClick:()=>{t?.(),navigator.clipboard.writeText(JSON.stringify(o,null,2)).then(()=>{});},icon:sa}),jsx(T,{onClick:()=>{r?.(),navigator.clipboard.writeText(e?.id||"").then(()=>{});},icon:qa})]})]}),g.trim()&&je===null?jsx(ie,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(nt,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsx(Re,{className:nc(m.scroll),children:jsxs(P,{value:je??o,style:jo,displayDataTypes:false,collapsed:g.trim()?void 0:W?1:void 0,onCopied:(v,_)=>{typeof _=="string"&&He(_);},enableClipboard:false,children:[jsx(P.String,{render:pe(g)}),jsx(P.KeyName,{render:le(g)}),jsx(P.CountInfo,{render:(v,{keyName:_})=>{if(!_)return jsx("span",{})}}),jsx(P.Copied,{render:oe})]})}),jsx(H,{totalCount:Nt,sx:{borderBottomRightRadius:0,background:"#f8f9fb"}})]})},"request-pane")}),jsxs(zo,{ref:D,className:nc(m.responsePane),isMaximized:p,isRequestShown:c,initial:{...p&&{width:"100vw",left:0}},animate:{...p&&{position:"absolute",left:c?"50vw":"0"}},transition:{duration:Z,...a&&{duration:0},...f&&{duration:0}},children:[jsxs(Je,{className:nc(m.section),children:[jsx(_e,{variant:"subtitle1",className:nc(m.title),children:"API Response"}),jsxs(Ee,{className:nc(m.actions),children:[jsx(M,{value:x,onChange:h,onOpen:()=>n?.(),currentIndex:U.currentIndex,totalCount:U.totalCount,onPrev:U.goPrev,onNext:U.goNext}),jsx(T,{disableAnimation:true,onClick:()=>{y?s?.():i?.(),S(v=>!v);},icon:y?xe$1:we}),jsx(T,{onClick:()=>{t?.(),navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{});},icon:sa}),jsx(T,{onClick:()=>{r?.(),navigator.clipboard.writeText(e?.id||"").then(()=>{});},icon:qa})]})]}),x.trim()&&Me===null?jsx(ie,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(nt,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsx(Re,{className:nc(m.scroll),children:jsxs(P,{value:Me??e,style:ve,displayDataTypes:false,collapsed:x.trim()?void 0:y?1:void 0,onCopied:(v,_)=>{typeof _=="string"&&He(_);},children:[jsx(P.String,{render:pe(x)}),jsx(P.KeyName,{render:le(x)}),jsx(P.CountInfo,{render:(v,{keyName:_})=>{if(!_)return jsx("span",{})}}),jsx(P.Copied,{render:oe})]})}),jsx(H,{totalCount:St,sx:{borderBottomLeftRadius:c?0:"12px",background:"#f8f9fb"}})]})]})}rt.displayName="Pane";var me=memo(rt);var $t="os-shared-JSONViewWindowToolbar",q={root:`${$t}-root`};var st=forwardRef(function({title:o,onClose:n,onMaximize:t,maximized:r=false,onRequestClick:i$1,requestDirection:s="left",showRequestIcon:c$1=false,id:a,className:p,sx:u},f$1){return jsxs(b,{ref:f$1,id:a??f,"data-testid":a??"Toolbar",sx:mc({backgroundColor:"#f9f9f9",backdropFilter:"none"},u),className:nc(q.root,p),children:[jsxs(h$1,{children:[jsx(c,{onClick:n}),jsx(e,{isMaximized:r,onClick:t}),c$1&&jsx(d,{onClick:i$1,direction:s,children:"Request"})]}),jsx(j$1,{title:o,icon:Vd}),jsx(i,{})]})});st.displayName="Toolbar";var $=memo(st);var Gt="os-shared-JSONViewWindowContent",at={root:`${Gt}-root`};var pt=styled(motion.div)({flexShrink:0}),ct=styled("div")({display:"contents"});function Xt({requestJson:e={},onClose:o,onJsonRequestOpen:n,isRequestShown:t,setIsRequestShown:r,isToolbarAnimationDisabled:i,setIsToolbarAnimationDisabled:s,className:c,...a}){let{isMaximized:p,setIsMaximized:u,setSize:f,size:y,isResizing:S}=b$1(),W=Object.keys(e??{})?.length,C=y.width||N;return jsxs(Fragment,{children:[jsx(pt,{animate:{width:p?"100%":t?C*2:C,x:!p&&t?-C:0},transition:{duration:S||i?0:h$2},children:jsx($,{title:t?We:be,onClose:()=>o(),onMaximize:()=>{u(x=>!x),s(true),setTimeout(()=>{s(false);},h$2*1e3);},maximized:p,onRequestClick:()=>{r(x=>!x),s(false),t||(n?.(),f({width:N,height:B}));},requestDirection:t?"right":"left",showRequestIcon:!!W})}),jsx(ct,{className:nc(at.root,c),children:jsx(me,{...a,requestJson:e,onClose:o,onJsonRequestOpen:n,isRequestShown:t,isToolbarAnimationDisabled:i})})]})}var K=memo(Xt);var k=createContext({windows:[],open:()=>{},close:()=>{},closeAll:()=>{},handleWindowMinimize:()=>{},handleWindowOrder:()=>{},registerJSONViewWindowEvents:()=>{},containerRef:{current:null}});function mt({list:e,events:o,onClose:n,isWindowMinimized:t,windowOrder:r}){return e?.length?jsx(Fragment,{children:e.map((i,s)=>jsx(xe,{index:s,...o,...i,onClose:()=>{n(s);},isWindowMinimized:t,windowOrder:r},i.json.id))}):null}mt.displayName="List";var ue=memo(mt);var ut=({children:e,containerRef:o})=>{let[n,t]=useState([]),[r,i]=useState(false),[s,c]=useState(1),a=useRef({}),p=useCallback(h=>{if(n.length===7){alert("Maximum allowed active JSON View Window is 7 per table.");return}if(n.some(A=>A.json.id===h.json.id))return;let g=structuredClone(h.json),I=g.request_body,D={...h,json:g,requestJson:h.requestJson||I||void 0};delete D.json.request_body,t(A=>[...A,D]);},[n]),u=useCallback(h=>{t(g=>g.filter((I,D)=>h!==D));},[]),f=useCallback(()=>{t([]);},[]),y=useCallback(h=>{i(h);},[]),S=useCallback(h=>{c(h);},[]),W=useCallback(h=>{a.current=h;},[]),C=useMemo(()=>({onJsonRequestOpen:()=>a.current.onJsonRequestOpen?.(),onJsonSearch:()=>a.current.onJsonSearch?.(),onJsonCopy:()=>a.current.onJsonCopy?.(),onJsonIdCopy:()=>a.current.onJsonIdCopy?.(),onJsonNodesMinimize:()=>a.current.onJsonNodesMinimize?.(),onJsonNodesMaximize:()=>a.current.onJsonNodesMaximize?.()}),[]),x=useMemo(()=>({windows:n,open:p,close:u,closeAll:f,handleWindowMinimize:y,handleWindowOrder:S,registerJSONViewWindowEvents:W,containerRef:o}),[n,p,u,f,y,S,W,o]);return jsxs(k.Provider,{value:x,children:[e,jsx(ue,{list:n,events:C,onClose:u,isWindowMinimized:r,windowOrder:s})]})};function gt(e){let{containerRef:o}=useContext(k),{height:n,width:t}=a(),[r,i]=useState(false),[s,c]=useState(false);return jsx(f$1,{isOpen:true,onClose:e.onClose,containerRef:o,defaultSize:{width:N,height:B},minSize:{width:N,height:300},defaultPosition:Yo(t,n,e.index),order:e.windowOrder,isMinimized:e.isWindowMinimized,sx:{boxShadow:"none",overflow:"visible"},id:"json-view-window",className:nc(m.root,e.className),children:jsx(K,{...e,isRequestShown:r,setIsRequestShown:i,isToolbarAnimationDisabled:s,setIsToolbarAnimationDisabled:c})})}gt.displayName="JSONViewWindow";var xe=memo(gt);var yt=({isWindowMinimized:e,windowOrder:o,...n}={})=>{let{windows:t,open:r,close:i,closeAll:s,handleWindowMinimize:c,handleWindowOrder:a,registerJSONViewWindowEvents:p}=useContext(k),u=useCallback(()=>{c(e??false);},[c,e]),f=useCallback(()=>{a(o??1);},[a,o]);return useEffect(()=>{f();},[f]),useEffect(()=>{u();},[u]),useEffect(()=>{p(n);},[p,n]),{open:r,close:i,closeAll:s,windows:t,count:t.length}};var Cs=xe;export{m as a,N as b,B as c,Z as d,Ne as e,be as f,We as g,H as h,T as i,M as j,V as k,z as l,me as m,q as n,$ as o,K as p,k as q,ue as r,ut as s,yt as t,Cs as u};
|