@canton-network/example-portfolio 0.20.0 → 0.22.0
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/dist/assets/{Avatar-C-49N7Fz.js → Avatar-Cvc50mRz.js} +1 -1
- package/dist/assets/{TableRow-CsIbZW4V.js → TableRow-c-kQ4Wq1.js} +1 -1
- package/dist/assets/{copyable-identifier-BFf0ARYa.js → copyable-identifier-Ca2EKaNz.js} +1 -1
- package/dist/assets/index-BXJTw44D.js +1 -0
- package/dist/assets/index-DaIPIehr.js +1846 -0
- package/dist/assets/index-rFWAfy-Q.css +1 -0
- package/dist/assets/old-BSQsRLaR.css +1 -0
- package/dist/assets/old-CopCO6dl.js +1 -0
- package/dist/assets/{query-options-CM__kwHn.js → query-options-DAhRNWw7.js} +1 -1
- package/dist/assets/{settings-BgV75_ir.js → settings-CjDNJL8O.js} +1 -1
- package/dist/assets/{useTransactionHistory-DGWGZTMt.js → useTransactionHistory-CMGwF8RV.js} +1 -1
- package/dist/assets/{useWithdrawAllocation-8IytAm-f.js → useWithdrawAllocation-DaVlMNjj.js} +1 -1
- package/dist/assets/wallet._walletId-DS9B7ADe.js +1 -0
- package/dist/index.html +2 -2
- package/package.json +39 -37
- package/dist/assets/index-C7M4apWO.js +0 -1622
- package/dist/assets/index-Cs7nV1m0.css +0 -1
- package/dist/assets/index-hBaAacig.js +0 -1
- package/dist/assets/old-BAO2bJkb.js +0 -1
- package/dist/assets/wallet._walletId-BY6qZuiZ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as R,a as A,r as v,u as P,j as g,c as M,b as F,s as y,K as j,ai as I,aj as $,d as q,H as k}from"./index-
|
|
1
|
+
import{g as R,a as A,r as v,u as P,j as g,c as M,b as F,s as y,K as j,ai as I,aj as $,d as q,H as k}from"./index-DaIPIehr.js";function H(t){return String(t).match(/[\d.\-+]*\s*(.*)/)[1]||""}function L(t){return parseFloat(t)}function W(t){return R("MuiSkeleton",t)}A("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const O=t=>{const{classes:e,variant:a,animation:o,hasChildren:r,width:n,height:i}=t;return F({root:["root",a,o,r&&"withChildren",r&&!n&&"fitContent",r&&!i&&"heightAuto"]},W,e)},w=$`
|
|
2
2
|
0% {
|
|
3
3
|
opacity: 1;
|
|
4
4
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as c,g as y,a as v,u as f,j as p,c as C,b as T,s as x,K as k,J as g}from"./index-
|
|
1
|
+
import{r as c,g as y,a as v,u as f,j as p,c as C,b as T,s as x,K as k,J as g}from"./index-DaIPIehr.js";const D=c.createContext();function E(o){return y("MuiTable",o)}v("MuiTable",["root","stickyHeader"]);const J=o=>{const{classes:e,stickyHeader:t}=o;return T({root:["root",t&&"stickyHeader"]},E,e)},W=x("table",{name:"MuiTable",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.root,t.stickyHeader&&e.stickyHeader]}})(k(({theme:o})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...o.typography.body2,padding:o.spacing(2),color:(o.vars||o).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:e})=>e.stickyHeader,style:{borderCollapse:"separate"}}]}))),j="table",no=c.forwardRef(function(e,t){const s=f({props:e,name:"MuiTable"}),{className:n,component:a=j,padding:l="normal",size:r="medium",stickyHeader:i=!1,...u}=s,d={...s,component:a,padding:l,size:r,stickyHeader:i},w=J(d),H=c.useMemo(()=>({padding:l,size:r,stickyHeader:i}),[l,r,i]);return p.jsx(D.Provider,{value:H,children:p.jsx(W,{as:a,role:a===j?null:"table",ref:t,className:C(w.root,n),ownerState:d,...u})})}),M=c.createContext();function I(o){return y("MuiTableBody",o)}v("MuiTableBody",["root"]);const K=o=>{const{classes:e}=o;return T({root:["root"]},I,e)},L=x("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),X={variant:"body"},N="tbody",io=c.forwardRef(function(e,t){const s=f({props:e,name:"MuiTableBody"}),{className:n,component:a=N,...l}=s,r={...s,component:a},i=K(r);return p.jsx(M.Provider,{value:X,children:p.jsx(L,{className:C(i.root,n),as:a,ref:t,role:a===N?null:"rowgroup",ownerState:r,...l})})});function q(o){return y("MuiTableCell",o)}const F=v("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),G=o=>{const{classes:e,variant:t,align:s,padding:n,size:a,stickyHeader:l}=o,r={root:["root",t,l&&"stickyHeader",s!=="inherit"&&`align${g(s)}`,n!=="normal"&&`padding${g(n)}`,`size${g(a)}`]};return T(r,q,e)},Q=x("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.root,e[t.variant],e[`size${g(t.size)}`],t.padding!=="normal"&&e[`padding${g(t.padding)}`],t.align!=="inherit"&&e[`align${g(t.align)}`],t.stickyHeader&&e.stickyHeader]}})(k(({theme:o})=>({...o.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:o.vars?`1px solid ${o.vars.palette.TableCell.border}`:`1px solid
|
|
2
2
|
${o.palette.mode==="light"?o.lighten(o.alpha(o.palette.divider,1),.88):o.darken(o.alpha(o.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(o.vars||o).palette.text.primary,lineHeight:o.typography.pxToRem(24),fontWeight:o.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(o.vars||o).palette.text.primary}},{props:{variant:"footer"},style:{color:(o.vars||o).palette.text.secondary,lineHeight:o.typography.pxToRem(21),fontSize:o.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${F.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:e})=>e.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(o.vars||o).palette.background.default}}]}))),co=c.forwardRef(function(e,t){const s=f({props:e,name:"MuiTableCell"}),{align:n="inherit",className:a,component:l,padding:r,scope:i,size:u,sortDirection:d,variant:w,...H}=s,b=c.useContext(D),m=c.useContext(M),$=m&&m.variant==="head";let R;l?R=l:R=$?"th":"td";let h=i;R==="td"?h=void 0:!h&&$&&(h="col");const z=w||m&&m.variant,S={...s,align:n,component:R,padding:r||(b&&b.padding?b.padding:"normal"),size:u||(b&&b.size?b.size:"medium"),sortDirection:d,stickyHeader:z==="head"&&b&&b.stickyHeader,variant:z},O=G(S);let U=null;return d&&(U=d==="asc"?"ascending":"descending"),p.jsx(Q,{as:R,ref:t,className:C(O.root,a),"aria-sort":U,scope:h,ownerState:S,...H})});function V(o){return y("MuiTableContainer",o)}v("MuiTableContainer",["root"]);const Y=o=>{const{classes:e}=o;return T({root:["root"]},V,e)},Z=x("div",{name:"MuiTableContainer",slot:"Root"})({width:"100%",overflowX:"auto"}),po=c.forwardRef(function(e,t){const s=f({props:e,name:"MuiTableContainer"}),{className:n,component:a="div",...l}=s,r={...s,component:a},i=Y(r);return p.jsx(Z,{ref:t,as:a,className:C(i.root,n),ownerState:r,...l})});function _(o){return y("MuiTableHead",o)}v("MuiTableHead",["root"]);const oo=o=>{const{classes:e}=o;return T({root:["root"]},_,e)},eo=x("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),to={variant:"head"},B="thead",uo=c.forwardRef(function(e,t){const s=f({props:e,name:"MuiTableHead"}),{className:n,component:a=B,...l}=s,r={...s,component:a},i=oo(r);return p.jsx(M.Provider,{value:to,children:p.jsx(eo,{as:a,className:C(i.root,n),ref:t,role:a===B?null:"rowgroup",ownerState:r,...l})})});function ao(o){return y("MuiTableRow",o)}const P=v("MuiTableRow",["root","selected","hover","head","footer"]),so=o=>{const{classes:e,selected:t,hover:s,head:n,footer:a}=o;return T({root:["root",t&&"selected",s&&"hover",n&&"head",a&&"footer"]},ao,e)},ro=x("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.root,t.head&&e.head,t.footer&&e.footer]}})(k(({theme:o})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${P.hover}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${P.selected}`]:{backgroundColor:o.alpha((o.vars||o).palette.primary.main,(o.vars||o).palette.action.selectedOpacity),"&:hover":{backgroundColor:o.alpha((o.vars||o).palette.primary.main,`${(o.vars||o).palette.action.selectedOpacity} + ${(o.vars||o).palette.action.hoverOpacity}`)}}}))),A="tr",bo=c.forwardRef(function(e,t){const s=f({props:e,name:"MuiTableRow"}),{className:n,component:a=A,hover:l=!1,selected:r=!1,...i}=s,u=c.useContext(M),d={...s,component:a,hover:l,selected:r,head:u&&u.variant==="head",footer:u&&u.variant==="footer"},w=so(d);return p.jsx(ro,{as:a,ref:t,className:C(w.root,n),role:a===A?null:"row",ownerState:d,...i})});export{po as T,no as a,uo as b,bo as c,co as d,io as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as Xo,a as Yo,r as s,u as Qo,a3 as Zo,ak as _o,a4 as F,a7 as oe,al as ee,am as yo,an as te,a5 as re,ao as pe,c as To,H as z,ap as se,j as n,aq as xo,J as vo,b as ne,s as Y,K as Q,ar as bo,d as Po,B as ae,T as ie,I as le}from"./index-C7M4apWO.js";function ce(e){return Xo("MuiTooltip",e)}const r=Yo("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function de(e){return Math.round(e*1e5)/1e5}const ue=e=>{const{classes:o,disableInteractive:p,arrow:a,touch:y,placement:d}=e,$={popper:["popper",!p&&"popperInteractive",a&&"popperArrow"],tooltip:["tooltip",a&&"tooltipArrow",y&&"touch",`tooltipPlacement${vo(d.split("-")[0])}`],arrow:["arrow"]};return ne($,ce,o)},me=Y(xo,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,o)=>{const{ownerState:p}=e;return[o.popper,!p.disableInteractive&&o.popperInteractive,p.arrow&&o.popperArrow,!p.open&&o.popperClose]}})(Q(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:o})=>!o.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:o})=>!o,style:{pointerEvents:"none"}},{props:({ownerState:o})=>o.arrow,style:{[`&[data-popper-placement*="bottom"] .${r.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${r.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${r.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${r.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:o})=>o.arrow&&!o.isRtl,style:{[`&[data-popper-placement*="right"] .${r.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:o})=>o.arrow&&!!o.isRtl,style:{[`&[data-popper-placement*="right"] .${r.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:o})=>o.arrow&&!o.isRtl,style:{[`&[data-popper-placement*="left"] .${r.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:o})=>o.arrow&&!!o.isRtl,style:{[`&[data-popper-placement*="left"] .${r.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),fe=Y("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,o)=>{const{ownerState:p}=e;return[o.tooltip,p.touch&&o.touch,p.arrow&&o.tooltipArrow,o[`tooltipPlacement${vo(p.placement.split("-")[0])}`]]}})(Q(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${r.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${r.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${r.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${r.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:o})=>o.arrow,style:{position:"relative",margin:0}},{props:({ownerState:o})=>o.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${de(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:o})=>!o.isRtl,style:{[`.${r.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${r.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:o})=>!o.isRtl&&o.touch,style:{[`.${r.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${r.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:o})=>!!o.isRtl,style:{[`.${r.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${r.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:o})=>!!o.isRtl&&o.touch,style:{[`.${r.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${r.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:o})=>o.touch,style:{[`.${r.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:o})=>o.touch,style:{[`.${r.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),he=Y("span",{name:"MuiTooltip",slot:"Arrow"})(Q(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let A=!1;const wo=new te;let M={x:0,y:0};function N(e,o){return(p,...a)=>{o&&o(p,...a),e(p,...a)}}const ge=s.forwardRef(function(o,p){const a=Qo({props:o,name:"MuiTooltip"}),{arrow:y=!1,children:d,classes:$,components:x={},componentsProps:T={},describeChild:l=!1,disableFocusListener:h=!1,disableHoverListener:O=!1,disableInteractive:W=!1,disableTouchListener:Ro=!1,enterDelay:Z=100,enterNextDelay:_=0,enterTouchDelay:Co=700,followCursor:D=!1,id:So,leaveDelay:oo=0,leaveTouchDelay:Mo=1500,onClose:eo,onOpen:to,open:$o,placement:ro="bottom",PopperComponent:po,PopperProps:b={},slotProps:u={},slots:Oo={},title:w,TransitionComponent:Io,TransitionProps:Eo,...so}=a,m=s.isValidElement(d)?d:n.jsx("span",{children:d}),no=Zo(),Lo=_o(),[v,ao]=s.useState(),[U,jo]=s.useState(null),I=s.useRef(!1),V=W||D,io=F(),H=F(),E=F(),lo=F(),[ko,co]=oe({controlled:$o,default:!1,name:"Tooltip",state:"open"});let c=ko;const K=ee(So),P=s.useRef(),L=yo(()=>{P.current!==void 0&&(document.body.style.WebkitUserSelect=P.current,P.current=void 0),lo.clear()});s.useEffect(()=>L,[L]);const uo=t=>{wo.clear(),A=!0,co(!0),to&&!c&&to(t)},j=yo(t=>{wo.start(800+oo,()=>{A=!1}),co(!1),eo&&c&&eo(t),io.start(no.transitions.duration.shortest,()=>{I.current=!1})}),k=t=>{I.current&&t.type!=="touchstart"||(v&&v.removeAttribute("title"),H.clear(),E.clear(),Z||A&&_?H.start(A?_:Z,()=>{uo(t)}):uo(t))},q=t=>{H.clear(),E.start(oo,()=>{j(t)})},[,mo]=s.useState(!1),fo=t=>{bo(t.target)||(mo(!1),q(t))},ho=t=>{v||ao(t.currentTarget),bo(t.target)&&(mo(!0),k(t))},go=t=>{I.current=!0;const f=m.props;f.onTouchStart&&f.onTouchStart(t)},Bo=t=>{go(t),E.clear(),io.clear(),L(),P.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",lo.start(Co,()=>{document.body.style.WebkitUserSelect=P.current,k(t)})},Fo=t=>{m.props.onTouchEnd&&m.props.onTouchEnd(t),L(),E.start(Mo,()=>{j(t)})};s.useEffect(()=>{if(!c)return;function t(f){f.key==="Escape"&&j(f)}return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}},[j,c]);const zo=re(pe(m),ao,p);!w&&w!==0&&(c=!1);const G=s.useRef(),Ao=t=>{const f=m.props;f.onMouseMove&&f.onMouseMove(t),M={x:t.clientX,y:t.clientY},G.current&&G.current.update()},R={},J=typeof w=="string";l?(R.title=!c&&J&&!O?w:null,R["aria-describedby"]=c?K:null):(R["aria-label"]=J?w:null,R["aria-labelledby"]=c&&!J?K:null);const i={...R,...so,...m.props,className:To(so.className,m.props.className),onTouchStart:go,ref:zo,...D?{onMouseMove:Ao}:{}},C={};Ro||(i.onTouchStart=Bo,i.onTouchEnd=Fo),O||(i.onMouseOver=N(k,i.onMouseOver),i.onMouseLeave=N(q,i.onMouseLeave),V||(C.onMouseOver=k,C.onMouseLeave=q)),h||(i.onFocus=N(ho,i.onFocus),i.onBlur=N(fo,i.onBlur),V||(C.onFocus=ho,C.onBlur=fo));const g={...a,isRtl:Lo,arrow:y,disableInteractive:V,placement:ro,PopperComponentProp:po,touch:I.current},S=typeof u.popper=="function"?u.popper(g):u.popper,No=s.useMemo(()=>{let t=[{name:"arrow",enabled:!!U,options:{element:U,padding:4}}];return b.popperOptions?.modifiers&&(t=t.concat(b.popperOptions.modifiers)),S?.popperOptions?.modifiers&&(t=t.concat(S.popperOptions.modifiers)),{...b.popperOptions,...S?.popperOptions,modifiers:t}},[U,b.popperOptions,S?.popperOptions]),X=ue(g),Wo=typeof u.transition=="function"?u.transition(g):u.transition,B={slots:{popper:x.Popper,transition:x.Transition??Io,tooltip:x.Tooltip,arrow:x.Arrow,...Oo},slotProps:{arrow:u.arrow??T.arrow,popper:{...b,...S??T.popper},tooltip:u.tooltip??T.tooltip,transition:{...Eo,...Wo??T.transition}}},[Do,Uo]=z("popper",{elementType:me,externalForwardedProps:B,ownerState:g,className:To(X.popper,b?.className)}),[Vo,Ho]=z("transition",{elementType:se,externalForwardedProps:B,ownerState:g}),[Ko,qo]=z("tooltip",{elementType:fe,className:X.tooltip,externalForwardedProps:B,ownerState:g}),[Go,Jo]=z("arrow",{elementType:he,className:X.arrow,externalForwardedProps:B,ownerState:g,ref:jo});return n.jsxs(s.Fragment,{children:[s.cloneElement(m,i),n.jsx(Do,{as:po??xo,placement:ro,anchorEl:D?{getBoundingClientRect:()=>({top:M.y,left:M.x,right:M.x,bottom:M.y,width:0,height:0})}:v,popperRef:G,open:v?c:!1,id:K,transition:!0,...C,...Uo,popperOptions:No,children:({TransitionProps:t})=>n.jsx(Vo,{timeout:no.transitions.duration.shorter,...t,...Ho,children:n.jsxs(Ko,{...qo,children:[w,y?n.jsx(Go,{...Jo}):null]})})})]})}),ye=Po(n.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"})),Te=Po(n.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})),we=({value:e,maxLength:o=8})=>{const[p,a]=s.useState(!1),y=async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)}catch(l){console.error("Failed to copy:",l)}},d=(l,h)=>l.length<=h?l:`${l.slice(0,h)}...`,$=l=>{const h=l.split("::"),O=h[0]||"",W=h[1]||"";return`${O}::${d(W,o)}`},T=e.includes("::")?$(e):d(e,o);return n.jsxs(ae,{sx:{display:"flex",alignItems:"center",gap:1},children:[n.jsx(ie,{variant:"body2",component:"span",children:T}),n.jsx(ge,{title:p?"Copied!":"Copy to clipboard",children:n.jsx(le,{size:"small",onClick:y,sx:{p:.5},children:p?n.jsx(Te,{fontSize:"small"}):n.jsx(ye,{fontSize:"small"})})})]})};export{we as C};
|
|
1
|
+
import{g as Xo,a as Yo,r as s,u as Qo,a3 as Zo,ak as _o,a4 as F,a7 as oe,al as ee,am as yo,an as te,a5 as re,ao as pe,c as To,H as z,ap as se,j as n,aq as xo,J as vo,b as ne,s as Y,K as Q,ar as bo,d as Po,B as ae,T as ie,I as le}from"./index-DaIPIehr.js";function ce(e){return Xo("MuiTooltip",e)}const r=Yo("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function de(e){return Math.round(e*1e5)/1e5}const ue=e=>{const{classes:o,disableInteractive:p,arrow:a,touch:y,placement:d}=e,$={popper:["popper",!p&&"popperInteractive",a&&"popperArrow"],tooltip:["tooltip",a&&"tooltipArrow",y&&"touch",`tooltipPlacement${vo(d.split("-")[0])}`],arrow:["arrow"]};return ne($,ce,o)},me=Y(xo,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,o)=>{const{ownerState:p}=e;return[o.popper,!p.disableInteractive&&o.popperInteractive,p.arrow&&o.popperArrow,!p.open&&o.popperClose]}})(Q(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:o})=>!o.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:o})=>!o,style:{pointerEvents:"none"}},{props:({ownerState:o})=>o.arrow,style:{[`&[data-popper-placement*="bottom"] .${r.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${r.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${r.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${r.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:o})=>o.arrow&&!o.isRtl,style:{[`&[data-popper-placement*="right"] .${r.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:o})=>o.arrow&&!!o.isRtl,style:{[`&[data-popper-placement*="right"] .${r.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:o})=>o.arrow&&!o.isRtl,style:{[`&[data-popper-placement*="left"] .${r.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:o})=>o.arrow&&!!o.isRtl,style:{[`&[data-popper-placement*="left"] .${r.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),fe=Y("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,o)=>{const{ownerState:p}=e;return[o.tooltip,p.touch&&o.touch,p.arrow&&o.tooltipArrow,o[`tooltipPlacement${vo(p.placement.split("-")[0])}`]]}})(Q(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${r.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${r.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${r.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${r.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:o})=>o.arrow,style:{position:"relative",margin:0}},{props:({ownerState:o})=>o.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${de(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:o})=>!o.isRtl,style:{[`.${r.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${r.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:o})=>!o.isRtl&&o.touch,style:{[`.${r.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${r.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:o})=>!!o.isRtl,style:{[`.${r.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${r.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:o})=>!!o.isRtl&&o.touch,style:{[`.${r.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${r.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:o})=>o.touch,style:{[`.${r.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:o})=>o.touch,style:{[`.${r.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),he=Y("span",{name:"MuiTooltip",slot:"Arrow"})(Q(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let A=!1;const wo=new te;let M={x:0,y:0};function N(e,o){return(p,...a)=>{o&&o(p,...a),e(p,...a)}}const ge=s.forwardRef(function(o,p){const a=Qo({props:o,name:"MuiTooltip"}),{arrow:y=!1,children:d,classes:$,components:x={},componentsProps:T={},describeChild:l=!1,disableFocusListener:h=!1,disableHoverListener:O=!1,disableInteractive:W=!1,disableTouchListener:Ro=!1,enterDelay:Z=100,enterNextDelay:_=0,enterTouchDelay:Co=700,followCursor:D=!1,id:So,leaveDelay:oo=0,leaveTouchDelay:Mo=1500,onClose:eo,onOpen:to,open:$o,placement:ro="bottom",PopperComponent:po,PopperProps:b={},slotProps:u={},slots:Oo={},title:w,TransitionComponent:Io,TransitionProps:Eo,...so}=a,m=s.isValidElement(d)?d:n.jsx("span",{children:d}),no=Zo(),Lo=_o(),[v,ao]=s.useState(),[U,jo]=s.useState(null),I=s.useRef(!1),V=W||D,io=F(),H=F(),E=F(),lo=F(),[ko,co]=oe({controlled:$o,default:!1,name:"Tooltip",state:"open"});let c=ko;const K=ee(So),P=s.useRef(),L=yo(()=>{P.current!==void 0&&(document.body.style.WebkitUserSelect=P.current,P.current=void 0),lo.clear()});s.useEffect(()=>L,[L]);const uo=t=>{wo.clear(),A=!0,co(!0),to&&!c&&to(t)},j=yo(t=>{wo.start(800+oo,()=>{A=!1}),co(!1),eo&&c&&eo(t),io.start(no.transitions.duration.shortest,()=>{I.current=!1})}),k=t=>{I.current&&t.type!=="touchstart"||(v&&v.removeAttribute("title"),H.clear(),E.clear(),Z||A&&_?H.start(A?_:Z,()=>{uo(t)}):uo(t))},q=t=>{H.clear(),E.start(oo,()=>{j(t)})},[,mo]=s.useState(!1),fo=t=>{bo(t.target)||(mo(!1),q(t))},ho=t=>{v||ao(t.currentTarget),bo(t.target)&&(mo(!0),k(t))},go=t=>{I.current=!0;const f=m.props;f.onTouchStart&&f.onTouchStart(t)},Bo=t=>{go(t),E.clear(),io.clear(),L(),P.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",lo.start(Co,()=>{document.body.style.WebkitUserSelect=P.current,k(t)})},Fo=t=>{m.props.onTouchEnd&&m.props.onTouchEnd(t),L(),E.start(Mo,()=>{j(t)})};s.useEffect(()=>{if(!c)return;function t(f){f.key==="Escape"&&j(f)}return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}},[j,c]);const zo=re(pe(m),ao,p);!w&&w!==0&&(c=!1);const G=s.useRef(),Ao=t=>{const f=m.props;f.onMouseMove&&f.onMouseMove(t),M={x:t.clientX,y:t.clientY},G.current&&G.current.update()},R={},J=typeof w=="string";l?(R.title=!c&&J&&!O?w:null,R["aria-describedby"]=c?K:null):(R["aria-label"]=J?w:null,R["aria-labelledby"]=c&&!J?K:null);const i={...R,...so,...m.props,className:To(so.className,m.props.className),onTouchStart:go,ref:zo,...D?{onMouseMove:Ao}:{}},C={};Ro||(i.onTouchStart=Bo,i.onTouchEnd=Fo),O||(i.onMouseOver=N(k,i.onMouseOver),i.onMouseLeave=N(q,i.onMouseLeave),V||(C.onMouseOver=k,C.onMouseLeave=q)),h||(i.onFocus=N(ho,i.onFocus),i.onBlur=N(fo,i.onBlur),V||(C.onFocus=ho,C.onBlur=fo));const g={...a,isRtl:Lo,arrow:y,disableInteractive:V,placement:ro,PopperComponentProp:po,touch:I.current},S=typeof u.popper=="function"?u.popper(g):u.popper,No=s.useMemo(()=>{let t=[{name:"arrow",enabled:!!U,options:{element:U,padding:4}}];return b.popperOptions?.modifiers&&(t=t.concat(b.popperOptions.modifiers)),S?.popperOptions?.modifiers&&(t=t.concat(S.popperOptions.modifiers)),{...b.popperOptions,...S?.popperOptions,modifiers:t}},[U,b.popperOptions,S?.popperOptions]),X=ue(g),Wo=typeof u.transition=="function"?u.transition(g):u.transition,B={slots:{popper:x.Popper,transition:x.Transition??Io,tooltip:x.Tooltip,arrow:x.Arrow,...Oo},slotProps:{arrow:u.arrow??T.arrow,popper:{...b,...S??T.popper},tooltip:u.tooltip??T.tooltip,transition:{...Eo,...Wo??T.transition}}},[Do,Uo]=z("popper",{elementType:me,externalForwardedProps:B,ownerState:g,className:To(X.popper,b?.className)}),[Vo,Ho]=z("transition",{elementType:se,externalForwardedProps:B,ownerState:g}),[Ko,qo]=z("tooltip",{elementType:fe,className:X.tooltip,externalForwardedProps:B,ownerState:g}),[Go,Jo]=z("arrow",{elementType:he,className:X.arrow,externalForwardedProps:B,ownerState:g,ref:jo});return n.jsxs(s.Fragment,{children:[s.cloneElement(m,i),n.jsx(Do,{as:po??xo,placement:ro,anchorEl:D?{getBoundingClientRect:()=>({top:M.y,left:M.x,right:M.x,bottom:M.y,width:0,height:0})}:v,popperRef:G,open:v?c:!1,id:K,transition:!0,...C,...Uo,popperOptions:No,children:({TransitionProps:t})=>n.jsx(Vo,{timeout:no.transitions.duration.shorter,...t,...Ho,children:n.jsxs(Ko,{...qo,children:[w,y?n.jsx(Go,{...Jo}):null]})})})]})}),ye=Po(n.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"})),Te=Po(n.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})),we=({value:e,maxLength:o=8})=>{const[p,a]=s.useState(!1),y=async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)}catch(l){console.error("Failed to copy:",l)}},d=(l,h)=>l.length<=h?l:`${l.slice(0,h)}...`,$=l=>{const h=l.split("::"),O=h[0]||"",W=h[1]||"";return`${O}::${d(W,o)}`},T=e.includes("::")?$(e):d(e,o);return n.jsxs(ae,{sx:{display:"flex",alignItems:"center",gap:1},children:[n.jsx(ie,{variant:"body2",component:"span",children:T}),n.jsx(ge,{title:p?"Copied!":"Copy to clipboard",children:n.jsx(le,{size:"small",onClick:y,sx:{p:.5},children:p?n.jsx(Te,{fontSize:"small"}):n.jsx(ye,{fontSize:"small"})})})]})};export{we as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as ue,Q as he,G as ge,r as b,g as fe,a as me,u as be,H as _,c as ye,j as e,J as j,b as ve,s as G,K as je,L as Ce,q as Ie,f as Se,N as Ae,O as We,R as we,U as ee,V as re,T as o,W as te,B as s,X as ne,k as S,Y as A,P as F,Z as L,t as R,_ as Re,$ as Le,a0 as Te,p as ke,y as X,A as Pe}from"./index-DaIPIehr.js";import{u as Oe,a as Be}from"./useWithdrawAllocation-DaVlMNjj.js";import{C as W}from"./copyable-identifier-Ca2EKaNz.js";import{a as De,b as $e,c as ze}from"./query-options-DAhRNWw7.js";import{A as se,S as Z}from"./Avatar-Cvc50mRz.js";function Ee(r,t){return ue({...r,enabled:!0,suspense:!0,throwOnError:ge,placeholderData:void 0},he)}function oe(r){const t=b.useRef({});return b.useEffect(()=>{t.current=r}),t.current}function Me(r){const{badgeContent:t,invisible:n=!1,max:a=99,showZero:l=!1}=r,u=oe({badgeContent:t,max:a});let p=n;n===!1&&t===0&&!l&&(p=!0);const{badgeContent:c,max:d=a}=p?u:r,x=c&&Number(c)>d?`${d}+`:c;return{badgeContent:c,invisible:p,max:d,displayValue:x}}function qe(r){return fe("MuiBadge",r)}const Ve=me("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),q=10,V=4,Fe=r=>{const{color:t,anchorOrigin:n,invisible:a,overlap:l,variant:u,classes:p={}}=r,c={root:["root"],badge:["badge",u,a&&"invisible",`anchorOrigin${j(n.vertical)}${j(n.horizontal)}`,`anchorOrigin${j(n.vertical)}${j(n.horizontal)}${j(l)}`,`overlap${j(l)}`,t!=="default"&&`color${j(t)}`]};return ve(c,qe,p)},Ue=G("span",{name:"MuiBadge",slot:"Root"})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),Ne=G("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(r,t)=>{const{ownerState:n}=r;return[t.badge,t[n.variant],t[`anchorOrigin${j(n.anchorOrigin.vertical)}${j(n.anchorOrigin.horizontal)}${j(n.overlap)}`],n.color!=="default"&&t[`color${j(n.color)}`],n.invisible&&t.invisible]}})(je(({theme:r})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:r.typography.fontFamily,fontWeight:r.typography.fontWeightMedium,fontSize:r.typography.pxToRem(12),minWidth:q*2,lineHeight:1,padding:"0 6px",height:q*2,borderRadius:q,zIndex:1,transition:r.transitions.create("transform",{easing:r.transitions.easing.easeInOut,duration:r.transitions.duration.enteringScreen}),variants:[...Object.entries(r.palette).filter(Ce(["contrastText"])).map(([t])=>({props:{color:t},style:{backgroundColor:(r.vars||r).palette[t].main,color:(r.vars||r).palette[t].contrastText}})),{props:{variant:"dot"},style:{borderRadius:V,height:V*2,minWidth:V*2,padding:0}},{props:{invisible:!0},style:{transition:r.transitions.create("transform",{easing:r.transitions.easing.easeInOut,duration:r.transitions.duration.leavingScreen})}},{style:({ownerState:t})=>{const{vertical:n,horizontal:a}=t.anchorOrigin,l=t.overlap==="circular"?"14%":0;return{"--Badge-translateX":a==="right"?"50%":"-50%","--Badge-translateY":n==="top"?"-50%":"50%",top:n==="top"?l:"initial",bottom:n==="bottom"?l:"initial",right:a==="right"?l:"initial",left:a==="left"?l:"initial",transform:"scale(1) translate(var(--Badge-translateX), var(--Badge-translateY))",transformOrigin:`${a==="right"?"100%":"0%"} ${n==="top"?"0%":"100%"}`,[`&.${Ve.invisible}`]:{transform:"scale(0) translate(var(--Badge-translateX), var(--Badge-translateY))"}}}}]})));function J(r){return{vertical:r?.vertical??"top",horizontal:r?.horizontal??"right"}}const Qe=b.forwardRef(function(t,n){const a=be({props:t,name:"MuiBadge"}),{anchorOrigin:l,className:u,classes:p,component:c,components:d={},componentsProps:x={},children:h,overlap:f="rectangular",color:m="default",invisible:y=!1,max:v=99,badgeContent:w,slots:k,slotProps:P,showZero:T=!1,variant:C="standard",...$}=a,{badgeContent:O,invisible:z,max:E,displayValue:i}=Me({max:v,invisible:y,badgeContent:w,showZero:T}),g=oe({anchorOrigin:J(l),color:m,overlap:f,variant:C,badgeContent:w}),I=z||O==null&&C!=="dot",{color:B=m,overlap:ae=f,anchorOrigin:ie,variant:Q=C}=I?g:a,le=J(ie),K=Q!=="dot"?i:void 0,M={...a,badgeContent:O,invisible:I,max:E,displayValue:K,showZero:T,anchorOrigin:le,color:B,overlap:ae,variant:Q},H=Fe(M),Y={slots:{root:k?.root??d.Root,badge:k?.badge??d.Badge},slotProps:{root:P?.root??x.root,badge:P?.badge??x.badge}},[ce,de]=_("root",{elementType:Ue,externalForwardedProps:{...Y,...$},ownerState:M,className:ye(H.root,u),ref:n,additionalProps:{as:c}}),[xe,pe]=_("badge",{elementType:Ne,externalForwardedProps:Y,ownerState:M,className:H.badge});return e.jsxs(ce,{...de,children:[h,e.jsx(xe,{...pe,children:K})]})}),Ke=()=>{const{exerciseTransfer:r}=Ie(),t=Se(),n=Ae();return We({mutationFn:async a=>r({registryUrls:t,...a}),onSuccess:async(a,l)=>{await n.invalidateQueries({queryKey:we.listPendingTransfers.forParty(l.party)})}})},U=r=>r.currentPartyId===r.receiver,D=r=>U(r)?{label:"Sender",value:r.sender}:{label:"Receiver",value:r.receiver},N=(r,t)=>r===t.transferLeg.sender,He=(r,t)=>r===t.transferLeg.receiver,Ye=r=>r.transferLegs.filter(t=>N(r.currentPartyId,t)&&t.allocations.length===0),_e=r=>r.transferLegs.filter(t=>N(r.currentPartyId,t)&&t.allocations.length>0),Xe=r=>{const{item:t,open:n,isLoading:a,onClose:l,onAccept:u,onReject:p,onWithdraw:c}=r,d=()=>{a||l()};return e.jsxs(ee,{open:n,onClose:d,maxWidth:"md",fullWidth:!0,disableEscapeKeyDown:a,children:[e.jsx(re,{sx:{pb:1},children:e.jsx(o,{variant:"h6",component:"div",fontWeight:"bold",children:"Transfer Details"})}),e.jsx(te,{sx:{py:2},children:t&&e.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(s,{sx:{display:"flex",gap:3,p:2,borderRadius:2,border:"1px solid",borderColor:"divider"},children:[e.jsxs(s,{sx:{flex:1},children:[e.jsx(o,{variant:"caption",color:"text.secondary",sx:{fontWeight:500,textTransform:"uppercase",letterSpacing:.5},children:"Amount"}),e.jsxs(o,{variant:"h6",fontWeight:"bold",children:[t.amount," ",t.instrumentId.id]})]}),e.jsxs(s,{sx:{flex:1},children:[e.jsx(o,{variant:"caption",color:"text.secondary",sx:{fontWeight:500,textTransform:"uppercase",letterSpacing:.5},children:"Type"}),e.jsx(s,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx(o,{variant:"body2",fontWeight:"medium",children:"Transfer Offer"})})]})]}),e.jsxs(s,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:3},children:[e.jsxs(s,{sx:{p:2,borderRadius:1,border:"1px solid",borderColor:"divider"},children:[e.jsx(o,{variant:"caption",color:"text.secondary",sx:{fontWeight:500,textTransform:"uppercase",letterSpacing:.5,mb:1,display:"block"},children:"Created"}),e.jsx(o,{variant:"body1",fontWeight:"medium",children:t.date})]}),e.jsxs(s,{sx:{p:2,borderRadius:1,border:"1px solid",borderColor:"divider"},children:[e.jsx(o,{variant:"caption",color:"text.secondary",sx:{fontWeight:500,textTransform:"uppercase",letterSpacing:.5,mb:1,display:"block"},children:"Expires"}),e.jsx(o,{variant:"body1",fontWeight:"medium",children:t.expiry})]})]}),e.jsxs(s,{sx:{p:2,borderRadius:1,border:"1px solid",borderColor:"divider"},children:[e.jsx(o,{variant:"caption",color:"text.secondary",sx:{fontWeight:500,textTransform:"uppercase",letterSpacing:.5,mb:1,display:"block"},children:D(t).label}),e.jsx(s,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx(W,{value:D(t).value,maxLength:60})})]}),e.jsxs(s,{sx:{p:2,borderRadius:1,border:"1px solid",borderColor:"divider"},children:[e.jsx(o,{variant:"caption",color:"text.secondary",sx:{fontWeight:500,textTransform:"uppercase",letterSpacing:.5,mb:1,display:"block"},children:"Message"}),e.jsx(o,{variant:"body1",sx:{wordBreak:"break-word",lineHeight:1.6,color:"text.primary"},children:t.message})]}),e.jsxs(s,{sx:{p:2,borderRadius:1,border:"1px solid",borderColor:"divider"},children:[e.jsx(o,{variant:"caption",color:"text.secondary",sx:{fontWeight:500,textTransform:"uppercase",letterSpacing:.5,mb:1,display:"block"},children:"Contract ID"}),e.jsx(s,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx(W,{value:t.id,maxLength:60})})]})]})}),e.jsxs(ne,{sx:{px:3,pb:3,gap:2},children:[e.jsx(S,{onClick:d,variant:"outlined",color:"inherit",sx:{minWidth:100},disabled:a,children:"Cancel"}),e.jsx(s,{sx:{flex:1}}),t&&U(t)?e.jsxs(e.Fragment,{children:[e.jsx(S,{variant:"outlined",color:"error",sx:{minWidth:100},disabled:a,onClick:()=>p(t),children:a?e.jsx(A,{size:20,color:"inherit"}):"Reject"}),e.jsx(S,{variant:"contained",sx:{minWidth:100},disabled:a,onClick:()=>u(t),children:a?e.jsx(A,{size:20,color:"inherit"}):"Accept"})]}):e.jsx(S,{variant:"outlined",color:"warning",sx:{minWidth:100},disabled:a,onClick:()=>t&&c(t),children:a?e.jsx(A,{size:20,color:"inherit"}):"Withdraw"})]})]})},Ze=r=>{const{item:t,isLoading:n,onClick:a,onAccept:l,onReject:u,onWithdraw:p}=r;return e.jsxs(F,{elevation:1,variant:"elevation",sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center",borderRadius:0,gap:2,cursor:n?"default":"pointer",opacity:n?.7:1,"&:hover":{backgroundColor:n?"inherit":"action.hover"}},onClick:()=>!n&&a(),children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:3},children:[e.jsxs(s,{sx:{minWidth:120,flexShrink:0},children:[e.jsx(o,{variant:"body2",color:"textSecondary",children:"Type"}),e.jsx(o,{variant:"body1",fontWeight:"medium",children:t.type})]}),e.jsxs(s,{sx:{minWidth:80,flexShrink:0},children:[e.jsx(o,{variant:"body2",color:"textSecondary",children:"Amount"}),e.jsxs(o,{variant:"body1",children:[t.amount," ",t.instrumentId.id]})]}),e.jsxs(s,{sx:{minWidth:100,flexShrink:0},children:[e.jsx(o,{variant:"body2",color:"textSecondary",children:"Expires"}),e.jsx(o,{variant:"body1",children:t.expiry})]}),e.jsxs(s,{sx:{minWidth:100,flexShrink:0},children:[e.jsx(o,{variant:"body2",color:"textSecondary",children:D(t).label}),e.jsx(W,{value:D(t).value})]}),e.jsxs(s,{sx:{flex:1,minWidth:150},children:[e.jsx(o,{variant:"body2",color:"textSecondary",children:"Message"}),e.jsx(o,{variant:"body1",sx:{wordBreak:"break-word"},children:t.message.slice(0,30)+"..."})]})]}),e.jsx(s,{sx:{display:"flex",gap:2},children:U(t)?e.jsxs(e.Fragment,{children:[e.jsx(S,{variant:"contained",size:"small",sx:{minWidth:80},disabled:n,onClick:c=>{c.stopPropagation(),l()},children:n?e.jsx(A,{size:16,color:"inherit"}):"Accept"}),e.jsx(S,{variant:"outlined",size:"small",sx:{minWidth:80},disabled:n,onClick:c=>{c.stopPropagation(),u()},children:n?e.jsx(A,{size:16,color:"inherit"}):"Reject"})]}):e.jsx(S,{variant:"outlined",color:"warning",size:"small",sx:{minWidth:80},disabled:n,onClick:c=>{c.stopPropagation(),p()},children:n?e.jsx(A,{size:16,color:"inherit"}):"Withdraw"})})]})},Je=r=>{const{item:t,isLoading:n,onClick:a}=r,l=Ye(t),u=_e(t),p=l.length>0,c=u.length>0,d=()=>p&&c?`${l.length} pending, ${u.length} allocated`:p?`${l.length} transfer leg${l.length>1?"s":""} requires allocation`:`${u.length} allocated`;return e.jsx(F,{elevation:1,variant:"elevation",sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center",borderRadius:0,gap:2,cursor:n?"default":"pointer",opacity:n?.7:1,"&:hover":{backgroundColor:n?"inherit":"action.hover"}},onClick:()=>!n&&a(),children:e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:3},children:[e.jsxs(s,{sx:{minWidth:120,flexShrink:0},children:[e.jsx(o,{variant:"body2",color:"textSecondary",children:"Type"}),e.jsx(o,{variant:"body1",fontWeight:"medium",children:"Allocation"})]}),e.jsxs(s,{sx:{minWidth:100,flexShrink:0},children:[e.jsx(o,{variant:"body2",color:"textSecondary",children:"Allocate Before"}),e.jsx(o,{variant:"body1",children:t.expiry})]}),e.jsxs(s,{sx:{minWidth:100,flexShrink:0},children:[e.jsx(o,{variant:"body2",color:"textSecondary",children:"Transfer Legs"}),e.jsx(o,{variant:"body1",children:t.transferLegs.length})]}),e.jsxs(s,{sx:{flex:1,minWidth:150},children:[e.jsx(o,{variant:"body2",color:"textSecondary",children:"Status"}),e.jsx(o,{variant:"body1",sx:{color:p?"warning.main":"success.main"},children:d()})]})]})})},Ge=r=>{const{item:t,open:n,isLoading:a,loadingLegId:l,onClose:u,onCreateAllocation:p,onWithdrawAllocation:c}=r,d=()=>{a||u()};return e.jsxs(ee,{open:n,onClose:d,maxWidth:"md",fullWidth:!0,disableEscapeKeyDown:a,children:[e.jsx(re,{sx:{pb:1},children:e.jsx(o,{variant:"h6",component:"div",fontWeight:"bold",children:"Allocation Details"})}),e.jsx(te,{sx:{py:2},children:t&&e.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(s,{sx:{p:2,borderRadius:2,border:"1px solid",borderColor:"divider"},children:[e.jsx(o,{variant:"caption",color:"text.secondary",sx:{fontWeight:500,textTransform:"uppercase",letterSpacing:.5},children:"Type"}),e.jsx(o,{variant:"body2",fontWeight:"medium",children:"Allocation Request"})]}),e.jsxs(s,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:3},children:[e.jsxs(s,{sx:{p:2,borderRadius:1,border:"1px solid",borderColor:"divider"},children:[e.jsx(o,{variant:"caption",color:"text.secondary",sx:{fontWeight:500,textTransform:"uppercase",letterSpacing:.5,mb:1,display:"block"},children:"Settlement Reference"}),e.jsx(W,{value:t.settlement.settlementRef.id,maxLength:40})]}),e.jsxs(s,{sx:{p:2,borderRadius:1,border:"1px solid",borderColor:"divider"},children:[e.jsx(o,{variant:"caption",color:"text.secondary",sx:{fontWeight:500,textTransform:"uppercase",letterSpacing:.5,mb:1,display:"block"},children:"Allocate Before"}),e.jsx(o,{variant:"body1",fontWeight:"medium",children:t.expiry})]})]}),e.jsxs(s,{sx:{p:2,borderRadius:1,border:"1px solid",borderColor:"divider"},children:[e.jsx(o,{variant:"caption",color:"text.secondary",sx:{fontWeight:500,textTransform:"uppercase",letterSpacing:.5,mb:1,display:"block"},children:"Executor"}),e.jsx(W,{value:t.settlement.executor,maxLength:60})]}),e.jsxs(s,{children:[e.jsxs(o,{variant:"subtitle1",fontWeight:"bold",sx:{mb:2},children:["Transfer Legs (",t.transferLegs.length,")"]}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:2},children:t.transferLegs.map(x=>e.jsx(er,{leg:x,currentPartyId:t.currentPartyId,isLoading:a,isLegLoading:l===x.transferLegId,onCreateAllocation:()=>p(x),onWithdrawAllocation:h=>c(x,h)},x.transferLegId))})]})]})}),e.jsx(ne,{sx:{px:3,pb:3,gap:2},children:e.jsx(S,{onClick:d,variant:"outlined",color:"inherit",sx:{minWidth:100},disabled:a,children:"Close"})})]})},er=({leg:r,currentPartyId:t,isLoading:n,isLegLoading:a,onCreateAllocation:l,onWithdrawAllocation:u})=>{const p=N(t,r),c=He(t,r),d=r.allocations.length>0,x=()=>p&&c?e.jsx(L,{label:"Self-transfer",size:"small",color:"info"}):p?e.jsx(L,{label:"Sender",size:"small",color:"primary"}):c?e.jsx(L,{label:"Receiver",size:"small",color:"secondary"}):e.jsx(L,{label:"Observer",size:"small"});return e.jsxs(s,{sx:{p:2,borderRadius:1,border:"1px solid",borderColor:d?"success.light":"divider",backgroundColor:d?"success.50":"transparent"},children:[e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:2},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsxs(o,{variant:"body2",fontWeight:"medium",children:["Leg: ",r.transferLegId]}),x(),d&&e.jsx(L,{label:"Allocated",size:"small",color:"success"})]}),p&&e.jsx(s,{sx:{display:"flex",gap:1},children:d?r.allocations.map(h=>e.jsx(S,{variant:"outlined",color:"warning",size:"small",disabled:n,onClick:()=>u(h.contractId),children:a?e.jsx(A,{size:16,color:"inherit"}):"Withdraw"},h.contractId)):e.jsx(S,{variant:"contained",size:"small",disabled:n,onClick:l,children:a?e.jsx(A,{size:16,color:"inherit"}):"Create Allocation"})})]}),e.jsxs(s,{sx:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:2},children:[e.jsxs(s,{children:[e.jsx(o,{variant:"caption",color:"text.secondary",children:"Amount"}),e.jsxs(o,{variant:"body2",children:[r.transferLeg.amount," ",r.transferLeg.instrumentId.id]})]}),e.jsxs(s,{children:[e.jsx(o,{variant:"caption",color:"text.secondary",children:"Sender"}),e.jsx(W,{value:r.transferLeg.sender,maxLength:20})]}),e.jsxs(s,{children:[e.jsx(o,{variant:"caption",color:"text.secondary",children:"Receiver"}),e.jsx(W,{value:r.transferLeg.receiver,maxLength:20})]})]})]})},rr=({items:r})=>{const[t,n]=b.useState(null),[a,l]=b.useState(!1),[u,p]=b.useState(null),[c,d]=b.useState(!1),[x,h]=b.useState(null),f=b.useMemo(()=>{if(!u)return null;const i=r.find(g=>g.kind==="allocation"&&g.id===u);return i||null},[r,u]),[m,y]=b.useState(null),v=Ke(),w=Oe(),k=Be(),P=i=>{n(i),l(!0)},T=()=>{l(!1),n(null)},C=(i,g)=>{y(i.id),v.mutate({party:i.currentPartyId,contractId:i.id,instrumentId:i.instrumentId,instructionChoice:g},{onSuccess:()=>{R.success(`${g} transfer successful`),T()},onError:I=>R.error(`Failed to ${g.toLowerCase()} transfer: ${I instanceof Error?I.message:"Unknown error"}`),onSettled:()=>y(null)})},$=i=>{p(i.id),d(!0)},O=()=>{d(!1),p(null)},z=(i,g)=>{y(i.id),h(g.transferLegId),w.mutate({party:i.currentPartyId,allocationSpecification:{settlement:i.settlement,transferLegId:g.transferLegId,transferLeg:g.transferLeg}},{onSuccess:()=>{R.success("Allocation created successfully")},onError:I=>R.error(`Failed to create allocation: ${I instanceof Error?I.message:"Unknown error"}`),onSettled:()=>{y(null),h(null)}})},E=(i,g,I)=>{y(i.id),h(g.transferLegId),k.mutate({party:i.currentPartyId,contractId:I,instrumentId:g.transferLeg.instrumentId},{onSuccess:()=>{R.success("Allocation withdrawn successfully")},onError:B=>R.error(`Failed to withdraw allocation: ${B instanceof Error?B.message:"Unknown error"}`),onSettled:()=>{y(null),h(null)}})};return r.length===0?null:e.jsxs(s,{sx:{mb:6},children:[e.jsxs(s,{sx:{display:"flex",mb:2},children:[e.jsx(o,{variant:"h6",sx:{textTransform:"uppercase"},fontWeight:"bold",children:"Action Required"}),e.jsx(Qe,{badgeContent:r.length,color:"error",sx:{ml:2}})]}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:2},children:r.map(i=>{const g=m===i.id;switch(i.kind){case"allocation":return e.jsx(Je,{item:i,isLoading:g,onClick:()=>$(i)},i.id);case"transfer":return e.jsx(Ze,{item:i,isLoading:g,onClick:()=>P(i),onAccept:()=>C(i,"Accept"),onReject:()=>C(i,"Reject"),onWithdraw:()=>C(i,"Withdraw")},i.id)}})}),e.jsx(Xe,{item:t,open:a,isLoading:m!==null,onClose:T,onAccept:i=>C(i,"Accept"),onReject:i=>C(i,"Reject"),onWithdraw:i=>C(i,"Withdraw")}),e.jsx(Ge,{item:f,open:c,isLoading:m!==null,loadingLegId:x,onClose:O,onCreateAllocation:i=>f&&z(f,i),onWithdrawAllocation:(i,g)=>f&&E(f,i,g)})]})},tr=({partyId:r,walletName:t,isPrimary:n})=>{const{instruments:a,isLoading:l}=Re(r),u=a.length>0,p=e.jsxs(s,{sx:{p:1,display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center"},children:[e.jsx(se,{sx:{visibility:"hidden",m:1,height:25,width:25}}),e.jsx(o,{sx:{position:"absolute"},children:"There are currently no assets in this wallet"})]}),c=e.jsxs(s,{sx:{p:1},children:[e.jsx(Z,{variant:"rectangular",height:40}),e.jsx(Z,{variant:"rectangular",height:40,sx:{mt:1}})]}),d=a.map(x=>e.jsx(nr,{item:x},`${x.instrumentId.admin}::${x.instrumentId.id}`));return e.jsx(Le,{to:"/wallet/$walletId",params:{walletId:r},style:{textDecoration:"none",color:"inherit"},children:e.jsxs(s,{"data-testid":`wallet-preview-${r}`,sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(s,{sx:{mb:1,display:"flex",flexDirection:"row",alignItems:"center",gap:1},children:[e.jsx(o,{sx:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",maxWidth:"200px"},fontWeight:"bold",color:"secondary",children:t}),n&&e.jsx(L,{label:"Primary",size:"small",color:"primary"})]}),e.jsx(s,{component:F,variant:"outlined",sx:{background:x=>x.palette.mode==="dark"?void 0:x.palette.grey[100],display:"flex",flexDirection:"column",cursor:"pointer",transition:"all 0.2s ease-in-out","&:hover":{borderColor:"primary.main",boxShadow:1}},children:l?c:u?d:p})]})})},nr=({item:r})=>{const t=r.instrument?.symbol??r.instrumentId.id,n=r.instrument?.name??r.instrumentId.id,a=r.lockedAmount!=="0";return e.jsxs(s,{"data-testid":`instrument-row-${t}`,borderRadius:0,sx:{"&:not(:first-of-type)":{borderTop:l=>`1px solid ${l.palette.divider}`},p:1,display:"flex",alignItems:"center"},children:[e.jsx(se,{sx:{m:1,height:25,width:25},children:t[0]}),e.jsxs(s,{children:[e.jsx(o,{sx:{maxWidth:"100px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},color:"textSecondary",variant:"body2",children:n}),e.jsxs(o,{"data-testid":"instrument-total-amount",variant:"body2",fontWeight:"700",children:[r.totalAmount," ",t,a&&e.jsxs(o,{"data-testid":"instrument-available-amount",component:"span",variant:"body2",color:"textSecondary",sx:{ml:.5},children:["(",r.availableAmount," available)"]})]})]})]})},sr=()=>{const r=Te().slice().sort((t,n)=>Number(t.primary)-Number(n.primary));return e.jsxs(s,{sx:{mt:1},children:[e.jsx(o,{variant:"h6",sx:{textTransform:"uppercase",mb:2},fontWeight:"bold",children:"Wallets"}),e.jsx(s,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6},children:r.map(t=>e.jsx(tr,{partyId:t.partyId,walletName:t.hint,isPrimary:t.primary},t.partyId))})]})};function or(){const r=ke()?.partyId,t=Ee(De(r)),{data:n}=X($e(r)),{data:a}=X(ze(r)),l=b.useCallback((c,d)=>JSON.stringify([c.settlementRef.id,c.settlementRef.cid,d]),[]),u=b.useMemo(()=>{const c=new Map;for(const d of n??[]){const{settlement:x,transferLegs:h}=d.interfaceViewValue;for(const f in h){const m=l(x,f);c.set(m,[])}}for(const d of a??[]){const{settlement:x,transferLegId:h}=d.interfaceViewValue.allocation,f=l(x,h);c.has(f)&&c.get(f).push(d)}return c},[n,a,l]),p=b.useMemo(()=>{if(!r)return[];const c=[];if(t.data)for(const d of t.data){const x=d.interfaceViewValue,h=x.transfer,f=x.status,m="tag"in f?f.tag:f.current?.tag,y=h?.meta?.values?.[Pe.MEMO_KEY]??"",v={kind:"transfer",id:d.contractId,currentPartyId:r,tag:m,type:m?.startsWith("Transfer")?"Transfer":m,date:h.requestedAt,expiry:h.executeBefore,message:y,sender:h.sender,receiver:h.receiver,instrumentId:h.instrumentId,amount:h?.amount};c.push(v)}if(n)for(const d of n){const{settlement:x,transferLegs:h}=d.interfaceViewValue,m=Object.entries(h).map(([v,w])=>({transferLegId:v,transferLeg:w,allocations:u.get(l(x,v))??[]})).filter(v=>v.transferLeg.sender===r||v.transferLeg.receiver===r);if(m.length===0)continue;const y={kind:"allocation",id:d.contractId,currentPartyId:r,expiry:x.allocateBefore,settlement:x,transferLegs:m};c.push(y)}return c},[t.data,n,u,r,l]);return e.jsxs(s,{sx:{my:8},children:[e.jsx(o,{variant:"h3",component:"h1",sx:{mb:6},children:"Dashboard"}),e.jsx(rr,{items:p}),e.jsx(sr,{})]})}const xr=or;export{xr as component};
|