@tap-payments/os-micro-frontend-shared 0.3.275 → 0.3.277

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/build/_chunks/{chunk-VNUT3HGU.js → chunk-4UMT2J46.js} +1 -1
  2. package/build/_chunks/chunk-BPHG6RDC.js +1 -0
  3. package/build/_chunks/{chunk-F4TXGFRW.js → chunk-JGCMUAHD.js} +1 -1
  4. package/build/_chunks/chunk-QWWCMSYY.js +2 -0
  5. package/build/_chunks/chunk-WAQJPDMU.js +2 -0
  6. package/build/components/ColumnViews/index.js +1 -1
  7. package/build/components/DateFilter/index.js +1 -1
  8. package/build/components/FilterDropdown/index.js +1 -1
  9. package/build/components/ListColumnFilter/index.js +1 -1
  10. package/build/components/ListHeader/index.js +1 -1
  11. package/build/components/PhoneFilter/index.js +1 -1
  12. package/build/components/StatusBar/index.js +1 -1
  13. package/build/components/StatusButton/index.js +1 -1
  14. package/build/components/StatusButton/style.d.ts +8 -1
  15. package/build/components/StatusButton/type.d.ts +7 -4
  16. package/build/components/StatusFilter/index.js +1 -1
  17. package/build/components/StatusIcons/index.js +1 -1
  18. package/build/components/TableCells/CustomCells/ActionCell/components/ActionMenu.d.ts +17 -0
  19. package/build/components/TableCells/index.js +1 -1
  20. package/build/components/VerificationIcon/index.js +1 -1
  21. package/build/components/index.d.ts +0 -1
  22. package/build/components/index.js +1 -1
  23. package/build/components/modules/JSONViewWindow/index.js +1 -1
  24. package/build/components/modules/JSONViewWindow/style.d.ts +16 -13
  25. package/build/components/modules/WindowShell/index.js +1 -1
  26. package/build/components/modules/index.js +1 -1
  27. package/build/datetime/components/index.js +1 -1
  28. package/build/index.js +1 -1
  29. package/package.json +1 -1
  30. package/build/_chunks/chunk-LIYQWK6K.js +0 -2
  31. package/build/_chunks/chunk-PCGC6E7J.js +0 -2
  32. package/build/_chunks/chunk-S27723NU.js +0 -1
  33. package/build/_chunks/chunk-VLS6WUBL.js +0 -1
  34. package/build/components/DropdownMenu/DropdownMenu.d.ts +0 -4
  35. package/build/components/DropdownMenu/index.d.ts +0 -4
  36. package/build/components/DropdownMenu/index.js +0 -1
  37. package/build/components/DropdownMenu/styles.d.ts +0 -21
  38. package/build/components/DropdownMenu/type.d.ts +0 -26
@@ -1 +1 @@
1
- import {f,g,h as h$2,i as i$1,b}from'./chunk-37SWWF3G.js';import {d,c as c$1}from'./chunk-RXDZGI4N.js';import {h as h$1,i,b as b$1,c as c$2,f as f$2,e,d as d$1,j as j$1}from'./chunk-7L6NBFKR.js';import {h,c,f as f$1}from'./chunk-ISC5KT5E.js';import {mc,nc}from'./chunk-Z2DUFVI5.js';import'./chunk-3M2GZVQW.js';import {memo,forwardRef,useState,useEffect,useRef}from'react';import {createPortal}from'react-dom';import oo from'@mui/material/Backdrop';import {styled,alpha}from'@mui/material/styles';import v from'@mui/material/Box';import {motion,animate}from'framer-motion';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var H="os-shared-WindowShell",x={root:`${H}-root`,sidebar:`${H}-sidebar`,body:`${H}-body`,panel:`${H}-panel`};var we=styled(v)(()=>({display:"flex",flexDirection:"row",flex:1,minHeight:0,height:"100%",backgroundColor:"transparent"})),xe=styled(v)(()=>({flexShrink:0,overflow:"hidden auto",backgroundColor:"transparent",transition:"none"})),be=styled(v)(({theme:e})=>({flexShrink:0,overflow:"hidden auto",borderLeft:`1px solid ${e.palette.divider}`,backgroundColor:"transparent",transition:"none"})),ye=styled(v)(()=>({display:"flex",flexDirection:"column",flex:1,minWidth:0,minHeight:0})),ze=styled(v,{shouldForwardProp:e=>e!=="$width"})(({$width:e})=>({flexShrink:0,overflow:"hidden",display:"flex",alignItems:"stretch",position:"relative",width:e})),Ne=styled(motion.div)(()=>({flexShrink:0,overflow:"hidden",display:"flex",alignItems:"stretch",position:"relative"})),Ce=styled(motion.div,{shouldForwardProp:e=>e!=="$slotWidth"})(({$slotWidth:e})=>({width:e,minWidth:e,minHeight:"100%",height:"100%",overflow:"hidden"})),Ie=styled(v,{shouldForwardProp:e=>e!=="$visible"&&e!=="$duration"})(({$visible:e=true,$duration:o=h})=>({display:"flex",alignItems:"center",overflow:"hidden",whiteSpace:"nowrap",flexShrink:0,maxWidth:e?160:0,opacity:e?1:0,pointerEvents:e?"auto":"none",transition:o>0?`max-width ${.3*o}s ease-in-out, opacity ${.24*o}s ease-in-out`:"none"})),Te=styled(h$1,{shouldForwardProp:e=>e!=="$width"})(({$width:e})=>({...e!=null?{flex:`0 0 ${e}px`,maxWidth:e}:null})),Pe=styled(i,{shouldForwardProp:e=>e!=="$width"&&e!=="$justifyContent"})(({$width:e,$justifyContent:o="flex-start"})=>({...e!=null?{flex:`0 0 ${e}px`,maxWidth:e,justifyContent:o}:null}));var Ue=220;function ge(e,o,a){return Math.min(Math.max(e,o??0),a??1/0)}function Ae(e,o,a,n){if(Math.abs(e-o)<=1)return;let r=animate(0,1,{duration:a,onUpdate:t=>{n(s=>({...s,width:e+(o-e)*t}));}});return ()=>r.stop()}function G(e,o){if(e===false)return {duration:0,resize:o};let a=typeof e=="object"?e:void 0,n=a?.duration;return {duration:typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):h,resize:a?.resize??o}}function j(e){return e?.children==null||e.expand?.isExpanded===false?false:e.expand?.isExpanded===true}function F(e,o=Ue){let a=Array.isArray(e)?e.flat():[e];for(let n=a.length-1;n>=0;n--){let r=a[n];if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&typeof r.width=="number")return r.width}return o}function Ee(e){let o=e["data-id"]??e.id;return o!=null?{"data-id":o}:{}}function Me({kind:e,slot:o,isOpen:a,fullWidth:n,wrapperWidth:r,animateWrapperWidth:t,animation:s}){let p=e==="sidebar"?xe:be,d=e==="sidebar"?x.sidebar:x.panel,m=o["data-testid"]?`${o["data-testid"]}Wrapper`:e==="sidebar"?"WindowShellSidebarWrapper":"WindowShellPanelWrapper",i=o["data-testid"]??o.id??(e==="sidebar"?"WindowShellSidebar":"WindowShellPanel"),l=Ee(o),u=jsx(p,{id:o.id,className:nc(d,o.className),"data-testid":i,...l,sx:mc({width:n,minWidth:0},o.sx),children:jsx(Ce,{$slotWidth:n,animate:{x:a?0:-n},transition:{duration:s.duration},children:o.children})});return t?jsx(Ne,{"data-testid":m,...l,animate:{width:r},transition:{duration:s.duration},children:u}):jsx(ze,{"data-testid":m,...l,$width:r,children:u})}Me.displayName="WindowShellSlotColumn";var J=memo(Me);function De({baseWindowWidth:e,sidebar:o,panel:a,content:n,bodyContent:r,sidebarOpen:t,showPanel:s,sidebarFullWidth:p,panelFullWidth:d,sidebarAnimation:m,panelAnimation:i}){let{size:l}=b(),u=i.resize==="window",W=typeof e=="number"?Math.max(0,e-(u?d:0)-(m.resize==="window"&&!t?p:0)):l.width,b$1=u?s?Math.min(d,Math.max(0,l.width-W)):0:s?d:0,y=t?p:0;return jsxs(we,{className:nc(x.root),children:[o?.children?jsx(J,{kind:"sidebar",slot:o,isOpen:t,fullWidth:p,wrapperWidth:y,animateWrapperWidth:true,animation:m}):null,jsx(ye,{id:n?.id?`${n.id}Body`:void 0,className:nc(x.body,n?.className),"data-testid":n?.["data-testid"]?`${n["data-testid"]}Body`:n?.id?`${n.id}Body`:"WindowShellBody",...(n?.["data-id"]??n?.id)!=null?{"data-id":n?.["data-id"]?`${n["data-id"]}Body`:`${n?.id}Body`}:null,sx:n?.sx,children:r}),a?.children?jsx(J,{kind:"panel",slot:a,isOpen:s,fullWidth:d,wrapperWidth:b$1,animateWrapperWidth:!u,animation:i}):null]})}De.displayName="WindowShellSlotsLayout";var Re=memo(De);function $e({sidebarOpen:e,showPanel:o,sidebarResize:a,panelResize:n,sidebarDuration:r,panelDuration:t}){let{size:s,setSize:p,defaultSize:d,minSize:m,maxSize:i}=b(),l=useRef(s);l.current=s;let u=useRef(d.width),W=useRef(e),b$1=useRef(o),y=useRef(d.width);return useEffect(()=>{let C=b$1.current!==o,w=W.current!==e,E=y.current!==d.width;b$1.current=o,W.current=e,y.current=d.width;let S;if(w&&a==="window"?S=r:(C&&n==="window"||E&&!C&&!w)&&(S=t),S==null)return;let h=ge(d.width,m?.width,i?.width);return u.current=h,Ae(l.current.width,h,S,p)},[d.width,o,e,a,n,r,t,m?.width,i?.width,p]),null}$e.displayName="WindowShellAnimator";var Oe=memo($e);function ve({toolbar:e$1,sidebar:o,panel:a,animationDuration:n=h}){let{title:r,titleIcon:t,onClose:s,onMinimize:p,onMaximize:d,startAdornment:m,endAdornment:i,id:l,className:u,"data-testid":W,"data-id":b$2,sx:y}=e$1??{},{isMaximized:C}=b(),w=typeof s=="function"?s:void 0,E=typeof p=="function"?p:void 0,S=typeof d=="function"?d:void 0,h=o?.expand,c=a?.expand,z=j(a),L=h?.isExpanded??true,M=h!=null&&o?.children!=null,D=c!=null&&a?.children!=null&&z,k=M&&D,V=F(a?.sx),_=o!=null?F(o.sx):0,I=Math.max(_,V),T=k&&L?I:void 0,Z=D?I:void 0,X=D;return jsxs(b$1,{id:l??f$1,className:u,"data-testid":W??l??"WindowToolbar","data-id":b$2??l,sx:y,children:[jsxs(Te,{$width:T,children:[w?jsx(c$2,{onClick:w}):null,E?jsx(f$2,{onClick:E}):null,S?jsx(e,{isMaximized:C,onClick:S}):null,M&&h?jsx(d$1,{direction:h.isExpanded??true?"left":"right",active:h.isExpanded??true,onClick:h.onExpand,children:h.label}):null,m]}),jsx(j$1,{title:r,icon:t}),jsxs(Pe,{$width:Z,$justifyContent:i?"space-between":"flex-start",children:[D?jsx(Ie,{$visible:X,$duration:n,children:jsx(d$1,{sx:{flexShrink:0},direction:c?.isExpanded??true?"left":"right",active:z,onClick:c?.onExpand,children:c?.label})}):null,i]})]})}ve.displayName="WindowShellToolbar";var Fe=memo(ve);var Be=forwardRef(function({isOpen:o,className:a,sx:n,toolbar:r,services:t,sidebar:s,panel:p,footer:d$1,content:m,window:i,backdrop:l},u){let W=t?.list??[],b=(t?.isLoading??false)||W.length>0,y=d$1!=null&&(d$1.isVisible??true),C=s?.children,w=F(s?.sx),E=p?.children,S=p!=null?F(p.sx):0,h=m?.children,c$2=s?.expand?.isExpanded??C!=null,z=j(p),L=!!(C||E),[M,D]=useState(w),[k,V]=useState(S);useEffect(()=>{c$2&&D(w),z&&V(S);},[c$2,w,z,S]);let _=r?.onClose??r?.onMinimize??(()=>{}),I=G(s?.animation,"in-place"),T=G(p?.animation,"in-place"),Z=(()=>{let P=i?.defaultSize;if(typeof P?.width!="number")return P;let oe=(I.resize==="window"&&!c$2?M:0)+(T.resize==="window"&&!z?k:0);return oe>0?{...P,width:Math.max(0,P.width-oe)}:P})(),X={height:i?.minSize?.height??i?.defaultSize?.height??c,...i?.minSize?.width!=null?{width:i.minSize.width}:null},Le=l!=null&&(l.isVisible??true)&&o&&!i?.isMinimized,_e=(i?.order??0)+10-1,ee=jsx(oo,{open:true,onClick:_,id:l?.id,className:l?.className,"data-testid":l?.["data-testid"]??l?.id??"WindowShellBackdrop",...(l?.["data-id"]??l?.id)!=null?{"data-id":l?.["data-id"]??l?.id}:null,sx:mc({zIndex:_e,backgroundColor:P=>alpha(P.palette.common.black,.3)},l?.sx)});return jsxs(Fragment,{children:[Le&&(i?.disablePortal?ee:createPortal(ee,document.body)),jsxs(f,{ref:u,isOpen:o,onClose:_,defaultSize:Z,minSize:X,maxSize:i?.maxSize,defaultPosition:i?.defaultPosition,containerRef:i?.containerRef,order:i?.order,isMinimized:i?.isMinimized,isMaximized:i?.isMaximized,id:i?.id,className:nc(x.root,i?.className,a),sx:n,onResize:i?.onResize,onDragStart:i?.onDragStart,onMouseDown:i?.onMouseDown,onClick:i?.onClick,disablePortal:i?.disablePortal,"data-testid":i?.["data-testid"]??i?.id,"data-id":i?.["data-id"]??i?.id,children:[jsx(Oe,{sidebarOpen:c$2,showPanel:z,sidebarWidth:M,panelWidth:k,sidebarResize:I.resize,panelResize:T.resize,sidebarDuration:I.duration,panelDuration:T.duration}),jsx(Fe,{toolbar:r,sidebar:s,panel:p,animationDuration:T.duration}),b?t?.isLoading?jsx(d,{appCode:t?.appCode,id:t?.id,className:t?.className,"data-testid":t?.["data-testid"]??t?.id,"data-id":t?.["data-id"]??t?.id,sx:mc({height:"auto",flexShrink:0},t?.sx)}):jsx(c$1,{services:W,serviceCode:t?.activeCode??"",onOpenService:t?.onOpen,onOpenServiceInNewWindow:t?.onOpenInNewWindow,language:t?.language??"en",openInNewWindowLabel:t?.openInNewWindowLabel??"Open in new window",id:t?.id,className:t?.className,"data-testid":t?.["data-testid"]??t?.id,"data-id":t?.["data-id"]??t?.id,sx:t?.sx}):null,jsx(g,{id:m?.id,className:m?.className,"data-testid":m?.["data-testid"]??m?.id,"data-id":m?.["data-id"]??m?.id,sx:L?void 0:m?.sx,children:L?jsx(Re,{baseWindowWidth:typeof i?.defaultSize?.width=="number"?i.defaultSize.width:void 0,sidebar:s,panel:p,content:m,bodyContent:h,sidebarOpen:c$2,showPanel:z,sidebarFullWidth:M,panelFullWidth:k,sidebarAnimation:I,panelAnimation:T}):h}),y?jsxs(h$2,{id:d$1?.id,className:d$1?.className,"data-testid":d$1?.["data-testid"]??d$1?.id,"data-id":d$1?.["data-id"]??d$1?.id,sx:d$1?.isVisible===true?mc(d$1?.sx??{},{"&:empty, &:has(> :only-child:empty)":{display:"flex"}}):d$1?.sx,children:[d$1?.children,d$1?.actions?jsx(i$1,{children:d$1.actions}):null]}):null]})]})});Be.displayName="WindowShell";var to=memo(Be);export{x as a,to as b};
1
+ import {d,c as c$1}from'./chunk-RXDZGI4N.js';import {f,g,h as h$2,i as i$1,b}from'./chunk-37SWWF3G.js';import {h as h$1,i,b as b$1,c as c$2,f as f$2,e,d as d$1,j as j$1}from'./chunk-7L6NBFKR.js';import {h,c,f as f$1}from'./chunk-ISC5KT5E.js';import {mc,nc}from'./chunk-Z2DUFVI5.js';import'./chunk-3M2GZVQW.js';import {memo,forwardRef,useState,useEffect,useRef}from'react';import {createPortal}from'react-dom';import oo from'@mui/material/Backdrop';import {styled,alpha}from'@mui/material/styles';import v from'@mui/material/Box';import {motion,animate}from'framer-motion';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var H="os-shared-WindowShell",x={root:`${H}-root`,sidebar:`${H}-sidebar`,body:`${H}-body`,panel:`${H}-panel`};var we=styled(v)(()=>({display:"flex",flexDirection:"row",flex:1,minHeight:0,height:"100%",backgroundColor:"transparent"})),xe=styled(v)(()=>({flexShrink:0,overflow:"hidden auto",backgroundColor:"transparent",transition:"none"})),be=styled(v)(({theme:e})=>({flexShrink:0,overflow:"hidden auto",borderLeft:`1px solid ${e.palette.divider}`,backgroundColor:"transparent",transition:"none"})),ye=styled(v)(()=>({display:"flex",flexDirection:"column",flex:1,minWidth:0,minHeight:0})),ze=styled(v,{shouldForwardProp:e=>e!=="$width"})(({$width:e})=>({flexShrink:0,overflow:"hidden",display:"flex",alignItems:"stretch",position:"relative",width:e})),Ne=styled(motion.div)(()=>({flexShrink:0,overflow:"hidden",display:"flex",alignItems:"stretch",position:"relative"})),Ce=styled(motion.div,{shouldForwardProp:e=>e!=="$slotWidth"})(({$slotWidth:e})=>({width:e,minWidth:e,minHeight:"100%",height:"100%",overflow:"hidden"})),Ie=styled(v,{shouldForwardProp:e=>e!=="$visible"&&e!=="$duration"})(({$visible:e=true,$duration:o=h})=>({display:"flex",alignItems:"center",overflow:"hidden",whiteSpace:"nowrap",flexShrink:0,maxWidth:e?160:0,opacity:e?1:0,pointerEvents:e?"auto":"none",transition:o>0?`max-width ${.3*o}s ease-in-out, opacity ${.24*o}s ease-in-out`:"none"})),Te=styled(h$1,{shouldForwardProp:e=>e!=="$width"})(({$width:e})=>({...e!=null?{flex:`0 0 ${e}px`,maxWidth:e}:null})),Pe=styled(i,{shouldForwardProp:e=>e!=="$width"&&e!=="$justifyContent"})(({$width:e,$justifyContent:o="flex-start"})=>({...e!=null?{flex:`0 0 ${e}px`,maxWidth:e,justifyContent:o}:null}));var Ue=220;function ge(e,o,a){return Math.min(Math.max(e,o??0),a??1/0)}function Ae(e,o,a,n){if(Math.abs(e-o)<=1)return;let r=animate(0,1,{duration:a,onUpdate:t=>{n(s=>({...s,width:e+(o-e)*t}));}});return ()=>r.stop()}function G(e,o){if(e===false)return {duration:0,resize:o};let a=typeof e=="object"?e:void 0,n=a?.duration;return {duration:typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):h,resize:a?.resize??o}}function j(e){return e?.children==null||e.expand?.isExpanded===false?false:e.expand?.isExpanded===true}function F(e,o=Ue){let a=Array.isArray(e)?e.flat():[e];for(let n=a.length-1;n>=0;n--){let r=a[n];if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&typeof r.width=="number")return r.width}return o}function Ee(e){let o=e["data-id"]??e.id;return o!=null?{"data-id":o}:{}}function Me({kind:e,slot:o,isOpen:a,fullWidth:n,wrapperWidth:r,animateWrapperWidth:t,animation:s}){let p=e==="sidebar"?xe:be,d=e==="sidebar"?x.sidebar:x.panel,m=o["data-testid"]?`${o["data-testid"]}Wrapper`:e==="sidebar"?"WindowShellSidebarWrapper":"WindowShellPanelWrapper",i=o["data-testid"]??o.id??(e==="sidebar"?"WindowShellSidebar":"WindowShellPanel"),l=Ee(o),u=jsx(p,{id:o.id,className:nc(d,o.className),"data-testid":i,...l,sx:mc({width:n,minWidth:0},o.sx),children:jsx(Ce,{$slotWidth:n,animate:{x:a?0:-n},transition:{duration:s.duration},children:o.children})});return t?jsx(Ne,{"data-testid":m,...l,animate:{width:r},transition:{duration:s.duration},children:u}):jsx(ze,{"data-testid":m,...l,$width:r,children:u})}Me.displayName="WindowShellSlotColumn";var J=memo(Me);function De({baseWindowWidth:e,sidebar:o,panel:a,content:n,bodyContent:r,sidebarOpen:t,showPanel:s,sidebarFullWidth:p,panelFullWidth:d,sidebarAnimation:m,panelAnimation:i}){let{size:l}=b(),u=i.resize==="window",W=typeof e=="number"?Math.max(0,e-(u?d:0)-(m.resize==="window"&&!t?p:0)):l.width,b$1=u?s?Math.min(d,Math.max(0,l.width-W)):0:s?d:0,y=t?p:0;return jsxs(we,{className:nc(x.root),children:[o?.children?jsx(J,{kind:"sidebar",slot:o,isOpen:t,fullWidth:p,wrapperWidth:y,animateWrapperWidth:true,animation:m}):null,jsx(ye,{id:n?.id?`${n.id}Body`:void 0,className:nc(x.body,n?.className),"data-testid":n?.["data-testid"]?`${n["data-testid"]}Body`:n?.id?`${n.id}Body`:"WindowShellBody",...(n?.["data-id"]??n?.id)!=null?{"data-id":n?.["data-id"]?`${n["data-id"]}Body`:`${n?.id}Body`}:null,sx:n?.sx,children:r}),a?.children?jsx(J,{kind:"panel",slot:a,isOpen:s,fullWidth:d,wrapperWidth:b$1,animateWrapperWidth:!u,animation:i}):null]})}De.displayName="WindowShellSlotsLayout";var Re=memo(De);function $e({sidebarOpen:e,showPanel:o,sidebarResize:a,panelResize:n,sidebarDuration:r,panelDuration:t}){let{size:s,setSize:p,defaultSize:d,minSize:m,maxSize:i}=b(),l=useRef(s);l.current=s;let u=useRef(d.width),W=useRef(e),b$1=useRef(o),y=useRef(d.width);return useEffect(()=>{let C=b$1.current!==o,w=W.current!==e,E=y.current!==d.width;b$1.current=o,W.current=e,y.current=d.width;let S;if(w&&a==="window"?S=r:(C&&n==="window"||E&&!C&&!w)&&(S=t),S==null)return;let h=ge(d.width,m?.width,i?.width);return u.current=h,Ae(l.current.width,h,S,p)},[d.width,o,e,a,n,r,t,m?.width,i?.width,p]),null}$e.displayName="WindowShellAnimator";var Oe=memo($e);function ve({toolbar:e$1,sidebar:o,panel:a,animationDuration:n=h}){let{title:r,titleIcon:t,onClose:s,onMinimize:p,onMaximize:d,startAdornment:m,endAdornment:i,id:l,className:u,"data-testid":W,"data-id":b$2,sx:y}=e$1??{},{isMaximized:C}=b(),w=typeof s=="function"?s:void 0,E=typeof p=="function"?p:void 0,S=typeof d=="function"?d:void 0,h=o?.expand,c=a?.expand,z=j(a),L=h?.isExpanded??true,M=h!=null&&o?.children!=null,D=c!=null&&a?.children!=null&&z,k=M&&D,V=F(a?.sx),_=o!=null?F(o.sx):0,I=Math.max(_,V),T=k&&L?I:void 0,Z=D?I:void 0,X=D;return jsxs(b$1,{id:l??f$1,className:u,"data-testid":W??l??"WindowToolbar","data-id":b$2??l,sx:y,children:[jsxs(Te,{$width:T,children:[w?jsx(c$2,{onClick:w}):null,E?jsx(f$2,{onClick:E}):null,S?jsx(e,{isMaximized:C,onClick:S}):null,M&&h?jsx(d$1,{direction:h.isExpanded??true?"left":"right",active:h.isExpanded??true,onClick:h.onExpand,children:h.label}):null,m]}),jsx(j$1,{title:r,icon:t}),jsxs(Pe,{$width:Z,$justifyContent:i?"space-between":"flex-start",children:[D?jsx(Ie,{$visible:X,$duration:n,children:jsx(d$1,{sx:{flexShrink:0},direction:c?.isExpanded??true?"left":"right",active:z,onClick:c?.onExpand,children:c?.label})}):null,i]})]})}ve.displayName="WindowShellToolbar";var Fe=memo(ve);var Be=forwardRef(function({isOpen:o,className:a,sx:n,toolbar:r,services:t,sidebar:s,panel:p,footer:d$1,content:m,window:i,backdrop:l},u){let W=t?.list??[],b=(t?.isLoading??false)||W.length>0,y=d$1!=null&&(d$1.isVisible??true),C=s?.children,w=F(s?.sx),E=p?.children,S=p!=null?F(p.sx):0,h=m?.children,c$2=s?.expand?.isExpanded??C!=null,z=j(p),L=!!(C||E),[M,D]=useState(w),[k,V]=useState(S);useEffect(()=>{c$2&&D(w),z&&V(S);},[c$2,w,z,S]);let _=r?.onClose??r?.onMinimize??(()=>{}),I=G(s?.animation,"in-place"),T=G(p?.animation,"in-place"),Z=(()=>{let P=i?.defaultSize;if(typeof P?.width!="number")return P;let oe=(I.resize==="window"&&!c$2?M:0)+(T.resize==="window"&&!z?k:0);return oe>0?{...P,width:Math.max(0,P.width-oe)}:P})(),X={height:i?.minSize?.height??i?.defaultSize?.height??c,...i?.minSize?.width!=null?{width:i.minSize.width}:null},Le=l!=null&&(l.isVisible??true)&&o&&!i?.isMinimized,_e=(i?.order??0)+10-1,ee=jsx(oo,{open:true,onClick:_,id:l?.id,className:l?.className,"data-testid":l?.["data-testid"]??l?.id??"WindowShellBackdrop",...(l?.["data-id"]??l?.id)!=null?{"data-id":l?.["data-id"]??l?.id}:null,sx:mc({zIndex:_e,backgroundColor:P=>alpha(P.palette.common.black,.3)},l?.sx)});return jsxs(Fragment,{children:[Le&&(i?.disablePortal?ee:createPortal(ee,document.body)),jsxs(f,{ref:u,isOpen:o,onClose:_,defaultSize:Z,minSize:X,maxSize:i?.maxSize,defaultPosition:i?.defaultPosition,containerRef:i?.containerRef,order:i?.order,isMinimized:i?.isMinimized,isMaximized:i?.isMaximized,id:i?.id,className:nc(x.root,i?.className,a),sx:n,onResize:i?.onResize,onDragStart:i?.onDragStart,onMouseDown:i?.onMouseDown,onClick:i?.onClick,disablePortal:i?.disablePortal,"data-testid":i?.["data-testid"]??i?.id,"data-id":i?.["data-id"]??i?.id,children:[jsx(Oe,{sidebarOpen:c$2,showPanel:z,sidebarWidth:M,panelWidth:k,sidebarResize:I.resize,panelResize:T.resize,sidebarDuration:I.duration,panelDuration:T.duration}),jsx(Fe,{toolbar:r,sidebar:s,panel:p,animationDuration:T.duration}),b?t?.isLoading?jsx(d,{appCode:t?.appCode,id:t?.id,className:t?.className,"data-testid":t?.["data-testid"]??t?.id,"data-id":t?.["data-id"]??t?.id,sx:mc({height:"auto",flexShrink:0},t?.sx)}):jsx(c$1,{services:W,serviceCode:t?.activeCode??"",onOpenService:t?.onOpen,onOpenServiceInNewWindow:t?.onOpenInNewWindow,language:t?.language??"en",openInNewWindowLabel:t?.openInNewWindowLabel??"Open in new window",id:t?.id,className:t?.className,"data-testid":t?.["data-testid"]??t?.id,"data-id":t?.["data-id"]??t?.id,sx:t?.sx}):null,jsx(g,{id:m?.id,className:m?.className,"data-testid":m?.["data-testid"]??m?.id,"data-id":m?.["data-id"]??m?.id,sx:L?void 0:m?.sx,children:L?jsx(Re,{baseWindowWidth:typeof i?.defaultSize?.width=="number"?i.defaultSize.width:void 0,sidebar:s,panel:p,content:m,bodyContent:h,sidebarOpen:c$2,showPanel:z,sidebarFullWidth:M,panelFullWidth:k,sidebarAnimation:I,panelAnimation:T}):h}),y?jsxs(h$2,{id:d$1?.id,className:d$1?.className,"data-testid":d$1?.["data-testid"]??d$1?.id,"data-id":d$1?.["data-id"]??d$1?.id,sx:d$1?.isVisible===true?mc(d$1?.sx??{},{"&:empty, &:has(> :only-child:empty)":{display:"flex"}}):d$1?.sx,children:[d$1?.children,d$1?.actions?jsx(i$1,{children:d$1.actions}):null]}):null]})]})});Be.displayName="WindowShell";var to=memo(Be);export{x as a,to as b};
@@ -0,0 +1 @@
1
+ import {h,b as b$1,f as f$1}from'./chunk-37SWWF3G.js';import {b,h as h$1,c,e,d,j as j$1,i}from'./chunk-7L6NBFKR.js';import {g as g$1,f,h as h$2}from'./chunk-ISC5KT5E.js';import {H as H$1,j}from'./chunk-CAVYK7HF.js';import {a}from'./chunk-HZCNE5Q2.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 it 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,co=20,mo=30,Ne="Items",We="JSON Response",be="JSON Request & Response",fo="rgb(231, 231, 231)";var uo=styled("span")({display:"inline-flex",alignItems:"center",gap:"6px"}),xo=styled("span")({margin:"0px",fontStyle:"normal",fontStretch:"normal",color:"rgb(32, 35, 43)",letterSpacing:"0px",fontSize:"9px",fontWeight:400,lineHeight:"10.8px"}),go=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(g$1,m.footer,t),sx:mc({justifyContent:"flex-start",cursor:"move"},r),children:o!=null?jsx(H$1,{variant:"text",className:m.count,sx:{cursor:"text",borderWidth:.75},children:jsxs(uo,{children:[jsx(xo,{children:Ne}),jsx(go,{children:g(o??0)})]})}):null})});ho.displayName="Footer";var H=memo(ho);var yo=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(yo,{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 No=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 Wo({onClick:e,icon:o,label:n,disableAnimation:t,...r}){let[i,s]=useState(false),{t:c}=useTranslation();return jsxs(No,{...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})})]})]})}Wo.displayName="IconButton";var T=memo(Wo);var bo=styled("div")(()=>({display:"flex",alignItems:"center",position:"relative",flexShrink:0,width:"24px",height:"24px"})),Co=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}`}})),Io=styled(motion.div)(()=>({position:"absolute",right:0,top:0,height:"24px",display:"flex",alignItems:"center",zIndex:20,background:"transparent"})),Oo=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"},To={...Te,background:"none",border:"none",padding:0,margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",outline:"none","&:disabled":{opacity:.3,cursor:"default"}},Po=styled("button")(()=>({...To,right:53})),_o=styled("button")(()=>({...To,right:39})),vo=styled(motion.img)(()=>({...Te,right:24,width:10,height:10,cursor:"pointer"})),Jo=styled(motion.img)(()=>({...Te,right:8,width:11,height:11,cursor:"default"})),Pe=styled("img")(()=>({width:10,height:10})),Eo=styled("img")(()=>({width:12,height:12})),Vo=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 Ht({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,b=()=>{s?.(),p(true),requestAnimationFrame(()=>u.current?.focus());},C=()=>{o(""),p(false);};return jsxs(bo,{children:[jsx(AnimatePresence,{children:a&&jsxs(Io,{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(Oo,{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(Po,{onClick:r,disabled:!y,title:"Previous match (Shift+Enter)",children:jsx(Pe,{src:dl,alt:"prev"})}),S&&jsx(_o,{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(Jo,{src:Ik,alt:"search",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),S&&jsx(Vo,{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(Co,{isActive:false,onClick:b,title:"Search",children:jsx(Eo,{src:A,alt:"search"})})})})]})}var M=memo(Ht);function Do(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 Mt={padding:0,outline:"none"};function Ao({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:Mt,children:e.slice(s,s+o)},`${t}-${a}`)),i=c;}),i<e.length&&r.push(e.slice(i)),jsx(Fragment,{children:r})}function R({text:e,query:o}){let n=useId(),t=useMemo(()=>o.trim().toLowerCase(),[o]),r=useMemo(()=>{if(!t)return e;let i=e.toLowerCase(),s=Do(i,t);return s.length===0?e:jsx(Ao,{text:e,queryLength:o.length,ranges:s,idPrefix:n})},[e,o.length,t,n]);return jsx(Fragment,{children:r})}var Lo={overflow:"visible",boxShadow:"none",filter:"drop-shadow(0 0 20px rgba(0, 0, 0, 0.15))"},_e={"--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":"#357fb9","--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"},zo={..._e,background:"transparent","--w-rjv-line-color":"transparent"},ve=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"})),Fo=styled(ie)(()=>({display:"flex",flexDirection:"row",flex:1,minHeight:0,height:"100%",width:"100%",background:"transparent",position:"relative",overflow:"visible"})),Ve=styled(ie)(()=>({display:"flex",flexDirection:"column",flex:1,minHeight:0,overflowY:"auto",overflowX:"hidden"})),qo=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}})),$o=styled(motion.div,{shouldForwardProp:e=>!["isMaximized","currentRequestWidth"].includes(e)})(({isMaximized:e,currentRequestWidth:o})=>({backgroundColor:fo,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})),Ko=styled("span")(()=>({color:"#032F62"})),Uo=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(Uo,{children:jsx(R,{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(Ko,{children:['"',jsx(R,{text:String(t??""),query:e}),'"']})}}function Qo(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 Yo(e,o){if(Array.isArray(e)){let n=e.map(t=>Yo(t,o)).filter(t=>t!=null);return n.length>0?n:null}return typeof e=="object"&&e!==null?Xo(e,o):Qo(e,o)?e:null}function Xo(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=Yo(r,o);i!==null&&(n[t]=i);}else Qo(r,o)&&(n[t]=r);return Object.keys(n).length>0?n:null}function Re(e,o){return o.trim()?Xo(e,o.toLowerCase()):e}function Zo(e,o,n){return {x:e/2-N/4+n*co,y:o/2-B/2+n*mo}}var nt="#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?nt:"transparent",p.style.outline=f?`1px solid ${nt}`:"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 st({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),[b,C]=useState(true),[x,g]=useState(""),[h,I]=useState(""),D=useRef(null),A=useRef(null),U=z(D,x),G=z(A,h),Wt=useMemo(()=>Object.keys(e??{})?.length??0,[e]),Ae=u.width||N,He=_=>{setTimeout(()=>{navigator.clipboard.writeText(_||"").then(()=>{});},10);},bt=useMemo(()=>Object.keys(o??{})?.length??0,[o]),Me=useMemo(()=>Re(e,x),[e,x]),je=useMemo(()=>Re(o,h),[o,h]);return jsxs(Fo,{"data-testid":"Pane",className:nc(m.root,m.body),children:[jsx(AnimatePresence,{children:c&&jsx($o,{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(ve,{variant:"subtitle1",className:nc(m.title),children:"API Request"}),jsxs(Ee,{className:nc(m.actions),children:[jsx(M,{value:h,onChange:I,onOpen:()=>n?.(),currentIndex:G.currentIndex,totalCount:G.totalCount,onPrev:G.goPrev,onNext:G.goNext}),jsx(T,{disableAnimation:true,onClick:()=>{b?s?.():i?.(),C(_=>!_);},icon:b?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})]})]}),h.trim()&&je===null?jsx(ie,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},children:jsx(it,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsx(Ve,{className:nc(m.scroll),children:jsxs(P,{value:je??o,style:zo,displayDataTypes:false,collapsed:h.trim()?void 0:b?1:void 0,onCopied:(_,v)=>{typeof v=="string"&&He(v);},enableClipboard:false,children:[jsx(P.String,{render:pe(h)}),jsx(P.KeyName,{render:le(h)}),jsx(P.CountInfo,{render:(_,{keyName:v})=>{if(!v)return jsx("span",{})}}),jsx(P.Copied,{render:oe})]})}),jsx(H,{totalCount:bt,sx:{borderBottomRightRadius:0,background:"#f8f9fb"}})]})},"request-pane")}),jsxs(qo,{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(ve,{variant:"subtitle1",className:nc(m.title),children:"API Response"}),jsxs(Ee,{className:nc(m.actions),children:[jsx(M,{value:x,onChange:g,onOpen:()=>n?.(),currentIndex:U.currentIndex,totalCount:U.totalCount,onPrev:U.goPrev,onNext:U.goNext}),jsx(T,{disableAnimation:true,onClick:()=>{y?s?.():i?.(),S(_=>!_);},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(it,{variant:"body2",sx:{fontSize:"0.75rem",color:"text.secondary"},children:"No Data Found"})}):jsx(Ve,{className:nc(m.scroll),children:jsxs(P,{value:Me??e,style:_e,displayDataTypes:false,collapsed:x.trim()?void 0:y?1:void 0,onCopied:(_,v)=>{typeof v=="string"&&He(v);},children:[jsx(P.String,{render:pe(x)}),jsx(P.KeyName,{render:le(x)}),jsx(P.CountInfo,{render:(_,{keyName:v})=>{if(!v)return jsx("span",{})}}),jsx(P.Copied,{render:oe})]})}),jsx(H,{totalCount:Wt,sx:{borderBottomLeftRadius:c?0:"12px",background:"#f8f9fb"}})]})]})}st.displayName="Pane";var me=memo(st);var Ut="os-shared-JSONViewWindowToolbar",F={root:`${Ut}-root`};var lt=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(F.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,{})]})});lt.displayName="Toolbar";var $=memo(lt);var Yt="os-shared-JSONViewWindowContent",pt={root:`${Yt}-root`};var dt=styled(motion.div)({flexShrink:0}),mt=styled("div")({display:"contents"});function en({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(),b=Object.keys(e??{})?.length,C=y.width||N;return jsxs(Fragment,{children:[jsx(dt,{animate:{width:p?"100%":t?C*2:C,x:!p&&t?-C:0},transition:{duration:S||i?0:h$2},children:jsx($,{title:t?be:We,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:!!b})}),jsx(mt,{className:nc(pt.root,c),children:jsx(me,{...a,requestJson:e,onClose:o,onJsonRequestOpen:n,isRequestShown:t,isToolbarAnimationDisabled:i})})]})}var K=memo(en);var k=createContext({windows:[],open:()=>{},close:()=>{},closeAll:()=>{},handleWindowMinimize:()=>{},handleWindowOrder:()=>{},registerJSONViewWindowEvents:()=>{},containerRef:{current:null}});function ut({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}ut.displayName="List";var ue=memo(ut);var gt=({children:e,containerRef:o})=>{let[n,t]=useState([]),[r,i]=useState(false),[s,c]=useState(1),a=useRef({}),p=useCallback(g=>{if(n.length===7){alert("Maximum allowed active JSON View Window is 7 per table.");return}if(n.some(A=>A.json.id===g.json.id))return;let h=structuredClone(g.json),I=h.request_body,D={...g,json:h,requestJson:g.requestJson||I||void 0};delete D.json.request_body,t(A=>[...A,D]);},[n]),u=useCallback(g=>{t(h=>h.filter((I,D)=>g!==D));},[]),f=useCallback(()=>{t([]);},[]),y=useCallback(g=>{i(g);},[]),S=useCallback(g=>{c(g);},[]),b=useCallback(g=>{a.current=g;},[]),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:b,containerRef:o}),[n,p,u,f,y,S,b,o]);return jsxs(k.Provider,{value:x,children:[e,jsx(ue,{list:n,events:C,onClose:u,isWindowMinimized:r,windowOrder:s})]})};function yt(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:Zo(t,n,e.index),order:e.windowOrder,isMinimized:e.isWindowMinimized,id:"json-view-window",className:nc(m.root,e.className),sx:Lo,children:jsx(K,{...e,isRequestShown:r,setIsRequestShown:i,isToolbarAnimationDisabled:s,setIsToolbarAnimationDisabled:c})})}yt.displayName="JSONViewWindow";var xe=memo(yt);var Nt=({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 Ts=xe;export{m as a,N as b,B as c,Z as d,Ne as e,We as f,be as g,H as h,T as i,M as j,R as k,z as l,me as m,F as n,$ as o,K as p,k as q,ue as r,gt as s,Nt as t,Ts as u};
@@ -1 +1 @@
1
- import {b}from'./chunk-PCGC6E7J.js';import {memo,useCallback,Fragment as Fragment$1,createElement}from'react';import {useTranslation}from'react-i18next';import {jsx,Fragment}from'react/jsx-runtime';function B({isActiveFilterVisible:f,availableStatuses:v,status:e,onStatusChange:l,buttonSx:S}){let{t:I}=useTranslation(),d=f??false,b$1=useCallback(s=>s===e&&!d?"active":"inActive",[e,d]),u=useCallback(s=>{l?.(s);},[l]);return jsx(Fragment,{children:v?.map(({render:s,...a},o)=>{if(s)return jsx(Fragment$1,{children:s({status:e,onChange:u},{...a,index:o})},`custom-status-slot-${o}`);if(!Array.isArray(a.status))return createElement(b,{...a,key:`status-button-array-${a.status}`,variant:b$1(a.status),onClick:()=>{Array.isArray(a.status)||u(a.status);},buttonSx:S});if(!a.status)return null;let n=a.status.filter(Boolean).map(t=>typeof t=="string"?{value:t}:t)||[],c=!!e&&n.some(t=>t?.value===e);return jsx("div",{children:jsx(b,{...a,selectedStatus:c?e:void 0,variant:c?"active":"inActive",onButtonBodyClick:t=>u(t),dropdownOptions:n.map(t=>({label:t?.label||I(t?.value||""),status:t?.value,icon:t.icon,onClick:()=>u(t.value)})),buttonSx:S})},n[0]?.value??`status-group-${o}`)})})}var p=memo(B);var M=p;export{M as a};
1
+ import {b}from'./chunk-WAQJPDMU.js';import {memo,useCallback,Fragment as Fragment$1,createElement}from'react';import {useTranslation}from'react-i18next';import {jsx,Fragment}from'react/jsx-runtime';function B({isActiveFilterVisible:f,availableStatuses:v,status:e,onStatusChange:l,buttonSx:S}){let{t:I}=useTranslation(),d=f??false,b$1=useCallback(s=>s===e&&!d?"active":"inActive",[e,d]),u=useCallback(s=>{l?.(s);},[l]);return jsx(Fragment,{children:v?.map(({render:s,...a},o)=>{if(s)return jsx(Fragment$1,{children:s({status:e,onChange:u},{...a,index:o})},`custom-status-slot-${o}`);if(!Array.isArray(a.status))return createElement(b,{...a,key:`status-button-array-${a.status}`,variant:b$1(a.status),onClick:()=>{Array.isArray(a.status)||u(a.status);},buttonSx:S});if(!a.status)return null;let n=a.status.filter(Boolean).map(t=>typeof t=="string"?{value:t}:t)||[],c=!!e&&n.some(t=>t?.value===e);return jsx("div",{children:jsx(b,{...a,selectedStatus:c?e:void 0,variant:c?"active":"inActive",onButtonBodyClick:t=>u(t),dropdownOptions:n.map(t=>({label:t?.label||I(t?.value||""),status:t?.value,icon:t.icon,onClick:()=>u(t.value)})),buttonSx:S})},n[0]?.value??`status-group-${o}`)})})}var p=memo(B);var M=p;export{M as a};