-
Notifications
You must be signed in to change notification settings - Fork 0
/
8773.async.js
1 lines (1 loc) · 34.5 KB
/
8773.async.js
1
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8773],{38773:function(e,t,r){r.d(t,{Wo:function(){return p},ox:function(){return P},kh:function(){return O},Wr:function(){return z},tw:function(){return B},SX:function(){return $},DL:function(){return ce}});var n=r(62435),a=r(5574),o=r.n(a),c=[["Y",31536e6],["M",2592e6],["D",864e5],["H",36e5],["m",6e4],["s",1e3],["S",1]];function s(e,t){var r=t.format,n=void 0===r?"":r,a=new Date(e).getTime(),s=Date.now();return function(e,t){var r=e,n=/\[[^\]]*]/g,a=(t.match(n)||[]).map((function(e){return e.slice(1,-1)})),s=t.replace(n,"[]"),i=c.reduce((function(e,t){var n=o()(t,2),a=n[0],c=n[1];if(e.includes(a)){var s=Math.floor(r/c);return r-=s*c,e.replace(new RegExp("".concat(a,"+"),"g"),(function(e){var t=e.length;return s.toString().padStart(t,"0")}))}return e}),s),u=0;return i.replace(n,(function(){var e=a[u];return u+=1,e}))}(Math.max(a-s,0),n)}var i=r(75633),u=r(51409),l=r(86074);var d=function(e){var t=e.value,r=e.format,a=void 0===r?"HH:mm:ss":r,o=e.onChange,c=e.onFinish,d=e.className,p=(0,i.N)(),f=n.useRef(null),x=function(){var e=function(e){return new Date(e).getTime()}(t);e>=Date.now()&&(f.current=(0,u.Zi)((function(){p(),null==o||o(e-Date.now()),e<Date.now()&&(null==c||c(),f.current&&((0,u.cv)(f.current),f.current=null))}),33.333333333333336))};return n.useEffect((function(){return x(),function(){f.current&&((0,u.cv)(f.current),f.current=null)}}),[t]),(0,l.jsx)("div",{className:d,children:s(t,{format:a})})},p=n.memo(d),f=r(15009),x=r.n(f),m=r(99289),h=r.n(m),k=r(64119),v=r(25035),b=r(37476),y=r(31199),j=r(63434),S=r(5966),g=r(90672),w=r(59530),N=r(45360),I=r(83062),R=r(27484),C=r.n(R),F=n.forwardRef((function(e,t){var r=N.ZP.useMessage(),a=o()(r,2),c=a[0],s=a[1],i=(0,w.useSelector)((function(e){return e.global.session})),u=(0,w.useSelector)((function(e){return e.global.account})),d=(0,w.useSelector)((function(e){return e.ppp.projectNft})),p=(0,w.useSelector)((function(e){return e.ppp.projectLastRound})),f=(0,n.useState)([]),m=o()(f,2),R=m[0],F=m[1],P=(0,w.useIntl)(),D=P.formatMessage({id:"coffee.inputException"}),T=P.formatMessage({id:"common.intlPleaseConnectWallet"}),M=P.formatMessage({id:"common.intlPleaseConnectNetwork"}),Z=P.formatMessage({id:"common.intlTransferSuccess"}),O=P.formatMessage({id:"common.intlTransferFail"}),E=(0,n.useRef)(),_=(0,n.useState)(!1),z=o()(_,2),V=z[0],A=z[1],q=(0,n.useCallback)(function(){var e=h()(x()().mark((function e(t){var r,n,a,o,s,u,f,m,h,v,b,y;return x()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o=0,s=5,u=[],f=[],m=[],h={},v=p.value,d.forEach((function(e){var t=C().utc(e.last_trade).local().valueOf(),r=e.owner;t<v||(h.hasOwnProperty(r)||(h[r]=0),h[r]+=1,o+=1)})),!t){e.next=13;break}s=t,e.next=18;break;case 13:return o<300?s=5:o>=300&&o<600?s=10:o>=600&&o<1200?s=20:o>=1200&&o<2400?s=40:o>=2400&&(s=80),e.next=16,i.client.v1.chain.get_currency_balance("dfsppptokens","dogsbouns123","DOGS");case 16:y=e.sent,null===(b=E.current)||void 0===b||b.setFieldValue("balance",y[0].toString());case 18:Object.keys(h).forEach((function(e){h[e]>=s&&u.push({account:e,count:h[e]})})),u.sort((function(e,t){return t.count-e.count})),u.forEach((function(e){m.push(e.account),f.push({label:(0,l.jsxs)("div",{className:"flex justify-between w-[300px]",children:[(0,l.jsx)("div",{children:e.account}),(0,l.jsx)("div",{children:e.count})]}),value:e.account})})),F(f),null===(r=E.current)||void 0===r||r.setFieldValue("accounts",m),null===(n=E.current)||void 0===n||n.setFieldValue("count",o),null===(a=E.current)||void 0===a||a.setFieldValue("condition",s),e.next=30;break;case 27:e.prev=27,e.t0=e.catch(0),(0,k.Tv)(e.t0,c);case 30:case"end":return e.stop()}}),e,null,[[0,27]])})));return function(t){return e.apply(this,arguments)}}(),[i,d,p]),H=(0,n.useCallback)((function(){A(!0),q()}),[q]);(0,n.useImperativeHandle)(t,(function(){return{handleOpen:H}}));var U=(0,n.useCallback)(function(){var e=h()(x()().mark((function e(t){var r,n,a,s,l,d,p,f;return x()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i&&i.broadcast){e.next=5;break}return c.error("".concat(T)),e.abrupt("return");case 5:if(u){e.next=8;break}return c.error("".concat(M)),e.abrupt("return");case 8:return r=t.accounts,n=t.memo,a=n?n.trim():"",s=[],r.forEach((function(e){s.push({account:"dfsppptokens",name:"transfer",authorization:[i.permissionLevel],data:{from:i.actor,to:e,quantity:"1.00000000 DOGS",memo:a}})})),e.next=14,(0,k.zI)(i.transact({actions:s}));case 14:if(l=e.sent,d=o()(l,2),p=d[0],f=d[1],!p){e.next=23;break}return c.error(p),e.abrupt("return");case 23:if(!f||!f.response){e.next=27;break}c.success("".concat(Z)),e.next=29;break;case 27:return c.error("".concat(O)),e.abrupt("return");case 29:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[u,i]),B=(0,n.useCallback)((function(e){if(e.hasOwnProperty("condition")){var t,r=null===(t=E.current)||void 0===t?void 0:t.getFieldValue("condition");q(r)}}),[q]);return(0,l.jsxs)(b.Y,{formRef:E,title:"DOGS抢图奖励",open:V,onFinish:U,onOpenChange:function(e){A(e)},onValuesChange:B,initialValues:{count:0},layout:"vertical",width:"400px",modalProps:{destroyOnClose:!0,style:{top:25}},submitter:{searchConfig:{submitText:"发送"}},children:[(0,l.jsx)(y.Z,{name:"count",label:"当前NFT总量",placeholder:"自动生成,无需输入",fieldProps:{size:"large",autoFocus:!1,defaultValue:0,readOnly:!0}}),(0,l.jsx)(y.Z,{name:"condition",label:(0,l.jsxs)("div",{children:["奖励条件 (大于等于)",(0,l.jsx)(I.Z,{placement:"topLeft",title:"图片如果到了拆分点没有拆分,当前轮会计算在内,但下一轮则不会计算。图片如果在当前轮没有卖出,下一轮也不会计算在内",children:(0,l.jsx)(v.Z,{className:"ml-[8px] hover:cursor-pointer",style:{color:"#1677ff"}})})]}),placeholder:"持有图片数量",min:5,rules:[{required:!0,message:"".concat(D),whitespace:!0,pattern:/^\d+$/}],fieldProps:{autoFocus:!0,size:"large"}}),(0,l.jsx)(j.Z.Group,{name:"accounts",label:(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{children:"获奖账号 "}),R.length?"(".concat(R.length,")"):""]}),options:R,rules:[{required:!0,whitespace:!0,message:"".concat(D),pattern:/.*/}]}),(0,l.jsx)(S.Z,{name:"balance",label:"奖励账号余额 (dogsbouns123)",placeholder:"自动生成,无需输入",fieldProps:{size:"large",autoFocus:!1,defaultValue:"",readOnly:!0}}),(0,l.jsx)(g.Z,{name:"memo",label:"Memo",placeholder:"留言信息",fieldProps:{size:"large",autoFocus:!1,allowClear:!0,defaultValue:"",autoSize:{minRows:1}}}),s]})})),P=(0,n.memo)(F),D=r(98097),T=r(70178),M=r.n(T);C().extend(M());var Z=(0,n.forwardRef)((function(){var e=(0,w.useSelector)((function(e){return e.ppp.project})),t=(0,w.useSelector)((function(e){return e.ppp.projectNftLoading})),r=(0,n.useMemo)((function(){return[{title:"项目ID",dataIndex:"id",key:"id",render:function(e,t){return(0,l.jsx)("span",{children:t.id})}},{title:"项目名称",dataIndex:"projectName",key:"projectName",render:function(e,t){return(0,l.jsx)("span",{children:t.projectName})}},{title:"项目描述",dataIndex:"desc",key:"desc",render:function(e,t){return(0,l.jsx)("span",{children:t.desc})}},{title:"NFT名称",dataIndex:"nftName",key:"nftName",render:function(e,t){return(0,l.jsx)("span",{children:t.nftName})}},{title:"代币名称",dataIndex:"tokenNameRelease",key:"tokenNameRelease",render:function(e,t){return(0,l.jsx)("span",{children:t.tokenNameRelease})}},{title:"矿池ID",dataIndex:"mid",key:"mid",render:function(e,t){return(0,l.jsx)("span",{children:t.mid})}},{title:"创建者",dataIndex:"creator",key:"creator",render:function(e,t){return(0,l.jsx)("span",{children:t.creator})}},{title:"创建时间",dataIndex:"createTime",key:"createTime",render:function(e,t){return(0,l.jsx)("div",{children:t.createTime})}},{title:"NFT初始发行量",dataIndex:"initNftNumber",key:"initNftNumber",render:function(e,t){return(0,l.jsx)("div",{children:t.initNftNumber})}},{title:"NFT流通量",dataIndex:"nftSupply",key:"nftSupply",render:function(e,t){return(0,l.jsx)("div",{children:t.nftSupply})}},{title:"NFT最大发行量",dataIndex:"nftMaxSupply",key:"nftMaxSupply",render:function(e,t){return(0,l.jsx)("div",{children:t.nftMaxSupply})}},{title:"NFT初始价格",dataIndex:"initNftPrice",key:"initNftPrice",render:function(e,t){return(0,l.jsx)("div",{children:t.initNftPrice})}},{title:"分裂价格",dataIndex:"splitNftPrice",key:"splitNftPrice",render:function(e,t){return(0,l.jsx)("div",{children:t.splitNftPrice})}},{title:"每轮时间",dataIndex:"secPerRound",key:"secPerRound",render:function(e,t){return(0,l.jsx)("div",{children:t.secPerRound})}},{title:"NFT每轮涨幅",dataIndex:"increasePerRound",key:"increasePerRound",render:function(e,t){return(0,l.jsx)("div",{children:t.increasePerRound})}},{title:"NFT销毁时间",dataIndex:"secToBurnNft",key:"secToBurnNft",render:function(e,t){return(0,l.jsx)("div",{children:t.secToBurnNft})}},{title:"销毁兑换",dataIndex:"tokenPerNft",key:"tokenPerNft",render:function(e,t){return(0,l.jsx)("div",{children:t.tokenPerNft})}},{title:"NFT交易手续费(含奖励池)",dataIndex:"tradeFeeRatio",key:"tradeFeeRatio",render:function(e,t){return(0,l.jsx)("div",{children:t.tradeFeeRatio})}},{title:"NFT交易手续费(不含奖励池)",dataIndex:"tradeFeeRatioWithoutRewardPool",key:"tradeFeeRatioWithoutRewardPool",render:function(e,t){return(0,l.jsx)("div",{children:t.tradeFeeRatioWithoutRewardPool})}},{title:"奖励池手续费",dataIndex:"rewordPoolFeeRatio",key:"rewordPoolFeeRatio",render:function(e,t){return(0,l.jsx)("div",{children:t.rewordPoolFeeRatio})}},{title:"利润率",dataIndex:"profitRate",key:"profitRate",render:function(e,t){return(0,l.jsx)("div",{children:t.profitRate})}},{title:"拆分利润率",dataIndex:"profitRateSplit",key:"profitRateSplit",render:function(e,t){return(0,l.jsx)("div",{children:t.profitRateSplit})}},{title:"年化利率",dataIndex:"profitRateApr",key:"profitRateApr",render:function(e,t){return(0,l.jsx)("div",{children:t.profitRateApr})}},{title:"Website",dataIndex:"website",key:"website",render:function(e,t){return(0,l.jsx)("div",{children:t.website})}},{title:"Twitter",dataIndex:"twitter",key:"twitter",render:function(e,t){return(0,l.jsx)("div",{children:t.twitter})}},{title:"Telegram",dataIndex:"telegram",key:"telegram",render:function(e,t){return(0,l.jsx)("div",{children:t.telegram})}}]}),[e]);return(0,l.jsx)("div",{className:"ml-3",children:(0,l.jsx)(D.vY,{loading:t,columns:r,dataSource:e})})})),O=(0,n.memo)(Z),E=r(92340);C().extend(M());var _=(0,n.forwardRef)((function(){var e=(0,w.useSelector)((function(e){return e.ppp.projectNftGrow})),t=(0,w.useSelector)((function(e){return e.ppp.projectSecPerRound})),r=(0,w.useSelector)((function(e){return e.ppp.projectNftLoading})),a=(0,w.useSelector)((function(e){return e.ppp.project})),o=(0,n.useMemo)((function(){return 66===a.id?"".concat((a.tradeFeeRatioValue/2*100).toFixed(2),"%"):"".concat((2*a.tradeFeeRatioValue/3*100).toFixed(2),"%")}),[a]),c=(0,n.useMemo)((function(){return 66===a.id?"".concat((a.tradeFeeRatioValue/2*100).toFixed(2),"%"):"".concat((a.tradeFeeRatioValue/3*100).toFixed(2),"%")}),[a]),s=(0,n.useMemo)((function(){return[{title:"#",dataIndex:"key",key:"key",render:function(e,t,r){return(0,l.jsx)("span",{children:r+1})}},{title:"轮次时间(".concat(t/3600,"小时)"),dataIndex:"time",key:"time",render:function(e,t){return(0,l.jsx)("div",{children:t.time})}},{title:"NFT数量",dataIndex:"count",key:"count",render:function(e,t){return(0,l.jsx)("div",{children:t.count})}},{title:"NFT市值",dataIndex:"asset",key:"asset",render:function(e,t){return(0,l.jsx)("div",{children:t.asset})}},{title:"手续费(".concat(o,")"),dataIndex:"asset",key:"asset",render:function(e,t){return(0,l.jsx)("div",{children:t.tradeFee})}},{title:"奖励池(".concat(c,")"),dataIndex:"asset",key:"asset",render:function(e,t){return(0,l.jsx)("div",{children:t.rewordPool})}},{title:"协议费(0.5%)",dataIndex:"asset",key:"asset",render:function(e,t){return(0,l.jsx)("div",{children:t.protocolFee})}}]}),[t,a,o,c]);return(0,l.jsx)("div",{className:"ppp-tab-grow",children:(0,l.jsx)(E.Z,{loading:{spinning:r,size:"large"},scroll:{x:!0},size:"small",columns:s,dataSource:e,defaultData:[],options:!1,search:!1,tableAlertRender:!1,tableAlertOptionRender:!1,pagination:!1})})})),z=(0,n.memo)(_),V=r(40956),A=r(49591),q=r(15867),H=r(51165);C().extend(M());var U=function(e){var t=(0,w.useDispatch)(),r=(0,w.useNavigate)(),a=N.ZP.useMessage(),c=o()(a,2),s=c[0],i=c[1],u=(0,w.useSelector)((function(e){return e.ppp.projectNft})),d=(0,w.useSelector)((function(e){return e.ppp.project})),f=(0,w.useSelector)((function(e){return e.ppp.projectNftReset})),m=(0,w.useSelector)((function(e){return e.ppp.projectId})),v=(0,w.useSelector)((function(e){return e.ppp.projectSecToBurnNft})),b=(0,w.useSelector)((function(e){return e.ppp.projectAccountFilter})),y=(0,w.useSelector)((function(e){return e.ppp.projectNftLoading})),j=(0,w.useSelector)((function(e){return e.ppp.projectProfitRate})),S=(0,w.useSelector)((function(e){return e.ppp.projectProfitRateSplit})),g=(0,w.useSelector)((function(e){return e.ppp.projectTotalHolder})),I=(0,w.useSelector)((function(e){return e.global.session})),R=(0,w.useSelector)((function(e){return e.global.account})),F=(0,w.useSelector)((function(e){return e.ppp.projectTotalInvest})),P=(0,w.useSelector)((function(e){return e.ppp.projectTotalValue})),D=(0,w.useSelector)((function(e){return e.ppp.projectEndTime})),T=(0,n.useState)([]),M=o()(T,2),Z=M[0],O=M[1],_=(0,w.useIntl)(),z=_.formatMessage({id:"tokens.intlUpdate"}),U=_.formatMessage({id:"common.intlPleaseConnectWallet"}),B=_.formatMessage({id:"common.intlPleaseConnectNetwork"}),L=_.formatMessage({id:"common.intlTransferSuccess"}),G=_.formatMessage({id:"common.intlTransferFail"}),W=(0,n.useCallback)((function(){var e=D/1e3;return 0===e?"":e<60?"(".concat(e.toFixed(0),"秒)"):e>=60&&e<3600?"(".concat((e/60).toFixed(1),"分)"):"(".concat((e/3600).toFixed(1),"时)")}),[D]),Y=(0,n.useCallback)((function(e){var r=e.owner,n=u.filter((function(e){return e.owner===r}));t(V.N.setProjectNft(n))}),[u]),$=(0,n.useCallback)((function(){t(V.N.setProjectNft(f))}),[f]),K=(0,n.useCallback)(h()(x()().mark((function t(){var r,n,a,c,i,l,p,f;return x()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(I&&I.broadcast){t.next=5;break}return s.error("".concat(U)),t.abrupt("return");case 5:if(R){t.next=8;break}return s.error("".concat(B)),t.abrupt("return");case 8:if(Z.length){t.next=11;break}return s.error("复选项不能为空"),t.abrupt("return");case 11:if(r=d.tokenName,n="","DFS"!==r){t.next=17;break}n="eosio.token",t.next=28;break;case 17:if("USDT"!==r){t.next=21;break}n="usdtusdtusdt",t.next=28;break;case 21:if("ORDI"!==r){t.next=25;break}n="ordiordiordi",t.next=28;break;case 25:return s.error("不支持当前项目"),console.log("不支持当前项目"),t.abrupt("return");case 28:return a=u.filter((function(e){return Z.includes(e.id)})),c=[],a.forEach((function(e){c.push({account:n,name:"transfer",authorization:[I.permissionLevel],data:{from:I.actor,to:"dfs3protocol",quantity:e.current_price,memo:"buy:".concat(e.id)}})})),t.next=33,(0,k.zI)(I.transact({actions:c}));case 33:if(i=t.sent,l=o()(i,2),p=l[0],f=l[1],!p){t.next=42;break}return s.error(p),t.abrupt("return");case 42:if(!f||!f.response){t.next=46;break}s.success("".concat(L)),t.next=48;break;case 46:return s.error("".concat(G)),t.abrupt("return");case 48:e.handleGetProjectNft(m);case 49:case"end":return t.stop()}}),t)}))),[I,Z,u,d,e,m]),X=(0,n.useCallback)(h()(x()().mark((function t(){var r,n,a,c,i,l;return x()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(I&&I.broadcast){t.next=5;break}return s.error("".concat(U)),t.abrupt("return");case 5:if(R){t.next=8;break}return s.error("".concat(B)),t.abrupt("return");case 8:if(Z.length){t.next=11;break}return s.error("复选项不能为空"),t.abrupt("return");case 11:return r=u.filter((function(e){return Z.includes(e.id)})),n=[],r.forEach((function(e){n.push({account:"dfs3protocol",name:"split",authorization:[I.permissionLevel],data:{assetid:e.id}})})),t.next=16,(0,k.zI)(I.transact({actions:n}));case 16:if(a=t.sent,c=o()(a,2),i=c[0],l=c[1],!i){t.next=25;break}return s.error(i),t.abrupt("return");case 25:if(!l||!l.response){t.next=29;break}s.success("".concat(L)),t.next=31;break;case 29:return s.error("".concat(G)),t.abrupt("return");case 31:e.handleGetProjectNft(m);case 32:case"end":return t.stop()}}),t)}))),[I,Z,u,d,e,m]),J=(0,n.useCallback)(h()(x()().mark((function t(){var r,n,a,c,i,l;return x()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(I&&I.broadcast){t.next=5;break}return s.error("".concat(U)),t.abrupt("return");case 5:if(R){t.next=8;break}return s.error("".concat(B)),t.abrupt("return");case 8:if(Z.length){t.next=11;break}return s.error("复选项不能为空"),t.abrupt("return");case 11:return r=u.filter((function(e){return Z.includes(e.id)})),n=[],r.forEach((function(e){n.push({account:"dfs3protocol",name:"burn",authorization:[I.permissionLevel],data:{assetid:e.id}})})),t.next=16,(0,k.zI)(I.transact({actions:n}));case 16:if(a=t.sent,c=o()(a,2),i=c[0],l=c[1],!i){t.next=25;break}return s.error(i),t.abrupt("return");case 25:if(!l||!l.response){t.next=29;break}s.success("".concat(L)),t.next=31;break;case 29:return s.error("".concat(G)),t.abrupt("return");case 31:e.handleGetProjectNft(m);case 32:case"end":return t.stop()}}),t)}))),[I,Z,u,d,e,m]),Q=(0,n.useMemo)((function(){return[{title:"#",dataIndex:"key",key:"key",search:!1,render:function(e,t,r){return(0,l.jsx)("span",{children:r+1})}},{title:"ID",dataIndex:"id",key:"id",search:!1,render:function(e,t){return(0,l.jsx)("div",{children:t.id})}},{title:"CID",dataIndex:"cid",key:"cid",search:!1,render:function(e,t){return(0,l.jsxs)("div",{children:["#",t.cid]})}},{title:"状态",dataIndex:"status",key:"status",filters:[{text:"可买",value:"buy"},{text:"已售",value:"sell"},{text:"可拆分",value:"split"},{text:"可销毁",value:"burn"}],onFilter:function(e,t){return"buy"===e?t.status.includes("可买"):"sell"===e?"已售"===t.status:"split"===e?"可拆分"===t.status:"burn"!==e||t.status.includes("可销毁")},sorter:function(e,t){return e.status.localeCompare(t.status)},search:!1,render:function(e,t){return(0,l.jsx)("div",{children:t.status})}},{title:"持有者(".concat(g,")"),dataIndex:"owner",key:"owner",filters:b,onFilter:function(e,t){return e===t.owner},sorter:function(e,t){return e.owner.localeCompare(t.owner)},render:function(e,t){return(0,l.jsx)("a",{onClick:function(){return r("/query/account?search=".concat(t.owner,"&tab=info"))},children:t.owner})}},{title:"投入成本(".concat(F.toFixed(0),")"),dataIndex:"invest",key:"invest",sorter:function(e,t){return e.invest.localeCompare(t.invest)},search:!1,render:function(e,t){return(0,l.jsx)("div",{children:t.invest})}},{title:"当前价格(".concat(P.toFixed(0),")"),dataIndex:"current_price",key:"current_price",sorter:function(e,t){return e.current_price.localeCompare(t.current_price)},search:!1,render:function(e,t){return(0,l.jsx)("div",{children:t.current_price})}},{title:"卖出利润(".concat(j.toFixed(2),"%/").concat(S.toFixed(2),"%)"),dataIndex:"profit",key:"profit",sorter:function(e,t){return e.profit.localeCompare(t.profit)},search:!1,render:function(e,t){return(0,l.jsx)("div",{children:t.profit})}},{title:"购买时间".concat(W()),dataIndex:"last_trade",key:"last_trade",sorter:function(e,t){return C()(t.last_trade).valueOf()-C()(e.last_trade).valueOf()},search:!1,render:function(e,t){var r=C().utc(t.last_trade).local().format("YYYY-MM-DDTHH:mm:ss");return(0,l.jsx)("div",{children:r})}},{title:"销毁时间",dataIndex:"last_trade",key:"last_trade",sorter:function(e,t){return C()(e.last_trade).valueOf()-C()(t.last_trade).valueOf()},search:!1,render:function(e,t){var r=C().utc(t.last_trade).add(v,"seconds").local().format("YYYY-MM-DDTHH:mm:ss");return(0,l.jsx)("div",{children:r})}},{title:"销毁倒计时",dataIndex:"last_trade",key:"last_trade",search:!1,render:function(e,t){var r=C().utc(t.last_trade).add(v,"seconds").local().valueOf();return(0,l.jsx)(p,{value:r})}}]}),[v,b,j,g,P,W]);return(0,l.jsxs)("div",{className:"ppp-tab-nft",children:[(0,l.jsx)(E.Z,{loading:{spinning:y,size:"large"},scroll:{x:!0},size:"small",columns:Q,dataSource:u,defaultData:[],search:{defaultCollapsed:!1,layout:"horizontal",labelWidth:"auto",collapseRender:!1,className:"p-[0px]",optionRender:function(t,r,n){return[n[1],(0,l.jsx)(q.ZP,{type:"primary",onClick:function(){e.handleGetProjectNft(m)},children:z},"update"),n[0]]}},rowSelection:{type:"checkbox",selectedRowKeys:Z,onChange:function(e){O(e)}},onSubmit:Y,onReset:$,options:!1,tableAlertRender:!1,tableAlertOptionRender:!1,pagination:!1}),!!Z.length&&(0,l.jsxs)(H.Z.Group,{trigger:"click",type:"primary",style:{insetInlineEnd:50},icon:(0,l.jsx)(A.Z,{}),children:[(0,l.jsx)(H.Z,{type:"primary",description:"购买",onClick:K},"1"),(0,l.jsx)(H.Z,{type:"primary",description:"拆分",onClick:X},"2"),(0,l.jsx)(H.Z,{type:"primary",description:"销毁",onClick:J},"3")]}),i]})},B=(0,n.memo)(U),L=r(7134),G=r(62120),W=r(12399);C().extend(M());var Y=function(e){var t=(0,w.useDispatch)(),r=(0,w.useNavigate)(),a=(0,w.useSelector)((function(e){return e.ppp.projectNftRank})),o=(0,w.useSelector)((function(e){return e.ppp.projectNftRankReset})),c=(0,w.useSelector)((function(e){return e.ppp.projectId})),s=(0,w.useSelector)((function(e){return e.ppp.projectAccountFilter})),i=(0,w.useSelector)((function(e){return e.ppp.projectNftLoading})),u=(0,w.useSelector)((function(e){return e.ppp.projectTotalHolder})),d=(0,w.useSelector)((function(e){return e.ppp.projectTotalInvest})),p=(0,w.useSelector)((function(e){return e.ppp.projectTotalProfit})),f=(0,w.useSelector)((function(e){return e.ppp.projectRewardPool})),x=(0,w.useSelector)((function(e){return e.ppp.projectNftSupply})),m=(0,n.useRef)(),h=(0,w.useIntl)().formatMessage({id:"tokens.intlUpdate"}),v=(0,n.useCallback)((function(e){var r=e.owner,n=a.filter((function(e){return e.owner===r}));t(V.N.setProjectNftRank(n))}),[a]),b=(0,n.useCallback)((function(){t(V.N.setProjectNftRank(o))}),[o]),y=(0,n.useCallback)((function(t,r,n){return[n[1],(0,l.jsx)(q.ZP,{type:"primary",onClick:function(){e.handleGetProjectNft(c)},children:h},"update"),n[0]]}),[e,c]),j=(0,n.useMemo)((function(){return[{title:"#",dataIndex:"key",key:"key",search:!1,render:function(e,t,r){return(0,l.jsx)("span",{children:r+1})}},{title:"持有者(".concat(u,")"),dataIndex:"owner",key:"owner",filters:s,onFilter:function(e,t){return e===t.owner},sorter:function(e,t){return e.owner.localeCompare(t.owner)},render:function(e,t){return(0,l.jsx)("a",{onClick:function(){return r("/query/account?search=".concat(t.owner,"&tab=info"))},children:t.owner})}},{title:"持有数量(".concat(x,")"),dataIndex:"number",key:"number",sorter:function(e,t){return e.number-t.number},search:!1,render:function(e,t){return(0,l.jsx)("div",{children:t.number})}},{title:"持有占比",dataIndex:"percent",key:"percent",search:!1,render:function(e,t){return(0,l.jsxs)("div",{children:[t.percent.toFixed(2),"%"]})}},{title:"账号余额",dataIndex:"balance",key:"balance",search:!1,render:function(e,t){return(0,l.jsx)("div",{children:t.balance})}},{title:"投入成本(".concat(d.toFixed(0),")"),dataIndex:"invest",key:"invest",sorter:function(e,t){return e.invest-t.invest},search:!1,render:function(e,t){return(0,l.jsx)("div",{children:t.investAsset})}},{title:"卖出利润(".concat(p.toFixed(0),")"),dataIndex:"profit",key:"profit",sorter:function(e,t){return e.profit-t.profit},search:!1,render:function(e,t){return(0,l.jsx)("div",{children:t.profitAsset})}},{title:"销毁奖励(DFS本位)",dataIndex:"burnRewardDfs",key:"burnRewardDfs",search:!1,render:function(e,t){return(0,l.jsxs)("div",{children:[(0,k.CE)(t.burnRewardDfs)," DFS"]})}},{title:"销毁奖励(USDT本位)",dataIndex:"burnRewardUsdt",key:"burnRewardUsdt",search:!1,render:function(e,t){return(0,l.jsxs)("div",{children:[(0,k.CE)(t.burnRewardUsdt)," USDT"]})}}]}),[s,p,d,u,x]),S=(0,n.useMemo)((function(){return[{title:"#",dataIndex:"key",key:"key",render:function(e,t,r){return(0,l.jsx)("span",{children:r+1})}},{title:"名称",dataIndex:"sym",key:"sym",render:function(e,t){var r=t.logo;return(0,l.jsxs)("div",{children:[(0,l.jsx)(L.C,{className:"mr-2",size:"default",src:r}),(0,l.jsx)("span",{children:t.sym})]})}},{title:"数量",dataIndex:"balance",key:"balance",render:function(e,t){return(0,l.jsx)("div",{children:t.balance})}},{title:"价值(DFS本位)",dataIndex:"dfsValue",key:"dfsValue",render:function(e,t){return(0,l.jsxs)("div",{children:[(0,k.CE)(t.dfsValue)," DFS"]})}},{title:"价值(USDT本位)",dataIndex:"usdtValue",key:"usdtValue",render:function(e,t){return(0,l.jsxs)("div",{children:[(0,k.CE)(t.usdtValue)," USDT"]})}}]}),[]);return(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"ppp-tab-pool mt-2",children:[(0,l.jsx)("div",{className:" font-semibold text-base hardline ml-2 mb-1",children:"奖励池"}),(0,l.jsx)(E.Z,{loading:{spinning:i,size:"large"},scroll:{x:!0},size:"small",columns:S,dataSource:f,defaultData:[],search:!1,options:!1,tableAlertRender:!1,tableAlertOptionRender:!1,pagination:!1,summary:function(e){var t=0,r=0;return e.forEach((function(e){t+=e.usdtValue,r+=e.dfsValue})),(0,l.jsxs)(G.Z.Summary.Row,{children:[(0,l.jsx)(G.Z.Summary.Cell,{index:0}),(0,l.jsx)(G.Z.Summary.Cell,{index:1,children:(0,l.jsx)("span",{className:"font-semibold",children:"汇 总"})}),(0,l.jsx)(G.Z.Summary.Cell,{index:2}),(0,l.jsx)(G.Z.Summary.Cell,{index:3,children:(0,l.jsxs)("span",{className:"font-semibold",children:[(0,k.CE)(r)," DFS"]})}),(0,l.jsx)(G.Z.Summary.Cell,{index:4,children:(0,l.jsxs)("span",{className:"font-semibold",children:[(0,k.CE)(t)," USDT"]})})]})}})]}),(0,l.jsxs)("div",{className:"ppp-tab-rank mt-3",children:[(0,l.jsx)("div",{className:"font-semibold text-base hardline ml-2",children:"持有者排名"}),(0,l.jsx)(E.Z,{loading:{spinning:i,size:"large"},scroll:{x:!0},size:"small",columns:j,dataSource:a,defaultData:[],search:{defaultCollapsed:!1,layout:"horizontal",labelWidth:"auto",collapseRender:!1,className:"p-[0px]",optionRender:y},onSubmit:v,onReset:b,options:!1,tableAlertRender:!1,tableAlertOptionRender:!1,pagination:!1})]}),109===c&&(0,l.jsx)(H.Z,{icon:(0,l.jsx)(W.Z,{}),type:"primary",style:{insetInlineEnd:50},onClick:function(){return m.current.handleOpen()}}),(0,l.jsx)(P,{ref:m})]})},$=(0,n.memo)(Y),K=r(5621),X=r(38345),J=r(6466),Q=r(57953),ee=r(71230),te=r(15746),re=r(96074),ne=r(9669),ae=r.n(ne);C().extend(M());var oe=function(e){var t=(0,w.useDispatch)(),r=N.ZP.useMessage(),a=o()(r,2),c=a[0],s=a[1],i=(0,w.useNavigate)(),u=(0,w.useSelector)((function(e){return e.global.host})),d=(0,w.useSelector)((function(e){return e.global.contractKit})),p=(0,n.useState)(!1),f=o()(p,2),m=f[0],v=f[1],b=(0,w.useSelector)((function(e){return e.statistics.holderDataSource})),y=(0,w.useSelector)((function(e){return e.statistics.holderDataSourceReset})),j=(0,w.useSelector)((function(e){return e.ppp.projectToken})),S=(0,n.useState)(0),g=o()(S,2),I=g[0],R=g[1],C=(0,n.useState)(0),F=o()(C,2),P=F[0],D=F[1],T=(0,n.useState)(0),M=o()(T,2),Z=M[0],O=M[1],_=(0,n.useState)(0),z=o()(_,2),V=z[0],A=z[1],H=(0,w.useIntl)(),U=H.formatMessage({id:"tokens.intlHolder"}),B=H.formatMessage({id:"tokens.intlHold"}),L=H.formatMessage({id:"tokens.intlLiq"}),G=H.formatMessage({id:"tokens.intlTotalValue"}),W=H.formatMessage({id:"tokens.intlRatio"}),Y=H.formatMessage({id:"tokens.intlSupply"}),$=H.formatMessage({id:"tokens.intlMarketCap"}),ne=H.formatMessage({id:"tokens.intlPrice"}),oe=H.formatMessage({id:"tokens.intlRank"}),ce=H.formatMessage({id:"tokens.intlUpdate"}),se=H.formatMessage({id:"tokens.intlTotalBal"}),ie=(0,n.useCallback)(function(){var e=h()(x()().mark((function e(t){var r,n,a,s,i,l,d,p,f,m;return x()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=[],n=1e3,a="",s="";case 4:return e.next=7,(0,k.zI)(ae().post("".concat(u,"/v2/chain/get_scope_rows"),{code:j.contract,table:"accounts",lower_bound:a,primary_lower_bound:s,limit:n,index_position:"primary",key_type:"name"}));case 7:if(i=e.sent,l=o()(i,2),d=l[0],p=l[1],d||200!==p.status){e.next=22;break}for(f=p.data.rows,m=0;m<f.length;++m)f[m].data.balance.split(" ")[1]===t&&r.push({account:f[m].scope,balance:f[m].data.balance});if(!p.data.more){e.next=19;break}a=p.data.next_key,s=p.data.next_primary_key,e.next=20;break;case 19:return e.abrupt("break",26);case 20:e.next=24;break;case 22:return c.error(d),e.abrupt("break",26);case 24:e.next=4;break;case 26:return e.abrupt("return",r);case 27:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[c,j]),ue=(0,n.useCallback)(h()(x()().mark((function e(){var t,r,n,a,o,c,s;return x()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.load("swapswapswap");case 2:return t=e.sent,r=t.table("markets"),e.next=6,r.all();case 6:return n=e.sent,a=n.find((function(e){return e.mid.toNumber()===Number(j.mid)})),"usdtusdtusdt-USDT",c="eosio.token-DFS",s=[],(o={})["usdtusdtusdt-USDT"]=1,o[c]=(0,k.ri)(n[0].reserve0)/(0,k.ri)(n[0].reserve1),n.forEach((function(e){var t=e.contract0.toString()+"-"+e.sym0.toString().split(",")[1],r=e.contract1.toString()+"-"+e.sym1.toString().split(",")[1],n=(0,k.ri)(e.reserve0),a=(0,k.ri)(e.reserve1);"eosio.token"===e.contract0.toString()?o.hasOwnProperty(r)||(o[r]=n/a*o[c]):"eosio.token"===e.contract1.toString()?o.hasOwnProperty(t)||(o[t]=a/n*o[c]):"usdtusdtusdt"===e.contract0.toString()?o.hasOwnProperty(r)||(o[r]=n/a):"usdtusdtusdt"===e.contract1.toString()?o.hasOwnProperty(t)||(o[t]=a/n):s.push({key0:t,key1:r,value0:n,value1:a})})),s.forEach((function(e){o.hasOwnProperty(e.key0)&&!o.hasOwnProperty(e.key1)?o[e.key1]=e.value0/e.value1*o[e.key0]:!o.hasOwnProperty(e.key0)&&o.hasOwnProperty(e.key1)?o[e.key0]=e.value1/e.value0*o[e.key1]:o.hasOwnProperty(e.key0)||o.hasOwnProperty(e.key1)||(o[e.key0]=0,o[e.key1]=0)})),e.abrupt("return",{tokenPriceMap:o,marketData:a});case 17:case"end":return e.stop()}}),e)}))),[d,j]),le=(0,n.useCallback)(h()(x()().mark((function e(){var t,r,n;return x()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.load("swapswapswap");case 2:return t=e.sent,r=t.table("liquidity"),e.next=6,r.all({scope:j.mid});case 6:return n=e.sent,e.abrupt("return",n);case 8:case"end":return e.stop()}}),e)}))),[d,j]),de=(0,n.useCallback)(h()(x()().mark((function e(){var t,r,n;return x()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.load(j.contract);case 2:return t=e.sent,r=t.table("stat"),e.next=6,r.all({scope:j.symbol});case 6:return n=e.sent,e.abrupt("return",[parseFloat(n[0].supply.toString()),parseFloat(n[0].max_supply.toString())]);case 8:case"end":return e.stop()}}),e)}))),[d,j]),pe=(0,n.useCallback)(h()(x()().mark((function e(){var r,n,a,s,i,u,l,d,p,f,m,h,b,y;return x()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,v(!0),r={},n={},a=[],e.next=7,ue();case 7:return s=e.sent,i=s.tokenPriceMap,u=s.marketData,e.next=12,ie(j.symbol);case 12:return l=e.sent,e.next=15,le();case 15:return d=e.sent,e.next=18,de();case 18:for(p=e.sent,f=o()(p,1),m=f[0],l.forEach((function(e){r[e.account]=Number(e.balance.split(" ")[0])})),d.forEach((function(e){var t=parseFloat(u.liquidity_token.toString()),r=parseFloat(u.reserve0.value.toString()),a=parseFloat(u.reserve1.value.toString()),o=parseFloat(e.token.toString())/t,c=0;c=u.sym0.toString()===j.symbol?r*o:a*o;var s=e.owner.toString();n[s]=c})),h=j.contract+"-"+j.symbol,Object.keys(r).forEach((function(e,t){var o=r[e],c=n[e]?n[e]:0;o+c>0&&a.push({key:t,rank:t,account:e,hold:o,liq:c,totalBal:o+c,value:(o+c)*i[h],ratio:(o+c)/m})})),b=a.sort((function(e,t){return t.value-e.value})),y=0;y<b.length;y++)b[y].rank=y;t(K.N.setHolderDataSource(b)),t(K.N.setHolderDataSourceReset(b)),R(b.length),D(m*i[h]),O(m),A(i[h]),v(!1),e.next=40;break;case 36:e.prev=36,e.t0=e.catch(0),v(!1),(0,k.Tv)(e.t0,c);case 40:case"end":return e.stop()}}),e,null,[[0,36]])}))),[ie,ue,de,le,j]),fe=(0,n.useCallback)((function(e){var r=e.account,n=b.filter((function(e){return e.account===r}));t(K.N.setHolderDataSource(n))}),[b]),xe=(0,n.useCallback)((function(){t(K.N.setHolderDataSource(y))}),[y]),me=(0,n.useMemo)((function(){return[{title:"".concat(oe),dataIndex:"key",key:"key",search:!1,render:function(e,t){return(0,l.jsx)("span",{children:t.rank+1})}},{title:"".concat(U),dataIndex:"account",key:"account",render:function(e,t){return(0,l.jsx)("a",{onClick:function(){return i("/query/account?search=".concat(t.account,"&tab=info"))},children:t.account})}},{title:"".concat(B),dataIndex:"hold",key:"hold",search:!1,sorter:function(e,t){return t.hold-e.hold},render:function(e,t){return(0,l.jsx)("span",{children:(0,k.CE)(t.hold)})}},{title:"".concat(L," (").concat(j.pair,")"),dataIndex:"liq",key:"liq",search:!1,sorter:function(e,t){return t.liq-e.liq},render:function(e,t){return(0,l.jsx)("span",{children:(0,k.CE)(t.liq)})}},{title:"".concat(se),dataIndex:"totalBal",key:"totalBal",search:!1,sorter:function(e,t){return t.totalBal-e.totalBal},render:function(e,t){return(0,l.jsx)("span",{children:(0,k.CE)(t.totalBal)})}},{title:"".concat(G),dataIndex:"value",key:"value",search:!1,sorter:function(e,t){return t.value-e.value},render:function(e,t){return(0,l.jsx)("span",{children:(0,k.CE)(t.value,"$")})}},{title:"".concat(W),dataIndex:"ratio",key:"ratio",search:!1,sorter:function(e,t){return t.ratio-e.ratio},render:function(e,t){return(0,l.jsxs)("span",{children:[(0,k.CE)(100*t.ratio),"%"]})}}]}),[j]);return(0,n.useEffect)((function(){d&&pe()}),[d,pe]),(0,l.jsxs)("div",{className:"ppp-tab-token",children:[(0,l.jsx)(Q.Z,{size:"large",spinning:m,children:(0,l.jsx)(X.Z,{headerBordered:!0,headStyle:{justifyContent:"center"},className:"",children:(0,l.jsxs)(ee.Z,{gutter:10,children:[(0,l.jsx)(te.Z,{lg:{span:"6"},md:{span:"12"},sm:{span:"12"},xs:{span:"12"},children:(0,l.jsx)(J.Z,{layout:"center",statistic:{title:(0,l.jsx)("div",{className:"text-center",children:Y}),value:(0,k.CE)(Z)}})}),(0,l.jsx)(te.Z,{lg:{span:"6"},md:{span:"12"},sm:{span:"12"},xs:{span:"12"},children:(0,l.jsx)(J.Z,{layout:"center",statistic:{title:(0,l.jsx)("div",{className:"text-center",children:ne}),value:(0,k.CE)(V,"$")}})}),(0,l.jsx)(te.Z,{lg:{span:"6"},md:{span:"12"},sm:{span:"12"},xs:{span:"12"},children:(0,l.jsx)(J.Z,{layout:"center",statistic:{title:(0,l.jsx)("div",{className:"text-center",children:$}),value:(0,k.CE)(P,"$")}})}),(0,l.jsx)(te.Z,{lg:{span:"6"},md:{span:"12"},sm:{span:"12"},xs:{span:"12"},children:(0,l.jsx)(J.Z,{layout:"center",statistic:{title:(0,l.jsx)("div",{className:"text-center",children:U}),value:I}})})]})})}),(0,l.jsx)(re.Z,{className:"my-2"}),(0,l.jsx)(E.Z,{className:"mb-3",scroll:{x:!0},size:"small",columns:me,dataSource:b,defaultData:[],search:{defaultCollapsed:!1,layout:"horizontal",labelWidth:"auto",collapseRender:!1,className:"p-[0px]",optionRender:function(e,t,r){return[r[1],(0,l.jsx)(q.ZP,{onClick:function(){v(!0),pe()},children:ce},"update"),r[0]]}},onSubmit:fe,onReset:xe,options:!1,pagination:{pageSize:100},tableAlertRender:!1,tableAlertOptionRender:!1,loading:{spinning:m,size:"large"}}),s]})},ce=(0,n.memo)(oe)}}]);