1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9502],{91717:function(e,t,n){"use strict";var l,a=n(67294);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(this,arguments)}t.Z=function(e){return a.createElement("svg",s({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),l||(l=a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3a1 1 0 0 1 1 1v7h7a1 1 0 1 1 0 2h-7v7a1 1 0 1 1-2 0v-7H4a1 1 0 1 1 0-2h7V4a1 1 0 0 1 1-1Z",fill:"current"})))}},55576:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/arena-rank",function(){return n(29300)}])},74919:function(e,t,n){"use strict";n.d(t,{W:function(){return r},x:function(){return x}});var l=n(85893),a=n(94184),s=n.n(a);n(67294);let r=e=>{let{className:t}=e;return(0,l.jsx)("div",{className:s()(t,"min-w-[40px] min-h-[40px] bg-secondary-20 rounded-lg skeleton-loading")})};var i=n(89579),c=n(97511);let x=e=>{let{label:t,ncg:n,note:a,cashable:r=!1,shopOnly:x=!1,className:d}=e;return(0,l.jsxs)("div",{className:s()("flex w-full flex-col gap-2 rounded-lg bg-secondary-50 px-6 py-6 lg:px-8 lg:py-8",d),children:[(0,l.jsx)("span",{className:"body3 text-secondary-90",children:t}),(0,l.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,l.jsx)("span",{className:s()("title1 tabular-nums",{"text-warning-400":r,"text-shop-300":!r&&x,"text-secondary-95":!r&&!x}),children:(0,c.jm)(n)}),(0,l.jsx)("span",{className:"body2 text-secondary-90",children:r?i.qM:x?i.jV:i.x$})]}),a&&(0,l.jsx)("span",{className:"body4 text-secondary-90",children:a})]})}},64194:function(e,t,n){"use strict";n.d(t,{P:function(){return u}});var l=n(85893),a=n(94184),s=n.n(a),r=n(67294),i=n(77398),c=n(35921),x=n(27668),d=n.n(x),o=n(33813),p=n(28743);let g=e=>{let{size:t}=e.selectProps,[n,a]=(0,r.useState)(16);return(0,r.useEffect)(()=>{"sm"===t?a(14):"lg"===t?a(18):a(16)},[t]),(0,l.jsx)(i.c.DropdownIndicator,{...e,className:"px-0 py-0",children:(0,l.jsx)(o.Z,{className:"fill-secondary-95",width:n,height:n})})};function u(e){let{value:t,options:n,className:a,isLoading:r,onChange:i,size:x}=e;return(0,l.jsxs)("div",{className:s()(a,r&&"cursor-wait","min-w-[200px] relative"),children:[(0,l.jsx)(c.ZP,{value:t,onChange:i,options:n,isSearchable:!1,classNames:{control:e=>{let t;return t="sm"===x?"px-[12px] gap-[4px]":"lg"===x?"px-[16px] gap-[6px]":"px-[14px] gap-[4px]",e.isFocused?t+=" !border-secondary-70 !bg-[rgba(112,114,131,.20)]":t+=" border-[#252937] bg-[#252937]","py-[7px] !border-[1px] rounded-[4px] !shadow-none text-secondary-95 flex "+t},valueContainer:()=>"py-0 px-0",singleValue:()=>"text-white font-medium text-center "+("sm"===x?"text-[12px] leading-[16px]":"lg"===x?"text-[16px] leading-[24px]":"text-[14px] leading-[20px]"),menu:()=>s()(d().selectChainOptions,"mt-[8px] bg-transparent"),menuList:()=>"py-0 bg-secondary-50 rounded-[4px] border-[1px] border-secondary-60",option:e=>"".concat(e.isFocused?"bg-secondary-40 font-bold":"bg-secondary-50"," ").concat(e.isSelected&&"font-bold","\n py-[8px] text-center ")+("sm"===x?"px-[12px] text-[12px] leading-[16px]":"lg"===x?"px-[16px] text-[14px] leading-[20px]":"px-[14px] text-[14px] leading-[20px]")},components:{DropdownIndicator:g,IndicatorSeparator:null},size:x}),r&&(0,l.jsx)("div",{className:"absolute left-0 top-0 w-full h-full flex justify-center items-center",children:(0,l.jsx)(p.Z,{className:"animate-spin opacity-50",width:30,height:30})})]})}},95438:function(e,t,n){"use strict";n.d(t,{iA:function(){return c},p3:function(){return o},hr:function(){return p}});var l=n(85893),a=n(94184),s=n.n(a);n(67294);var r=n(37720),i=n.n(r);function c(e){let{children:t,className:n,tableClassName:a}=e;return(0,l.jsx)("div",{className:s()("overflow-x-auto overflow-y-auto min-w-4xl w-full rounded-lg",i().hiddenScrollBar,n),children:(0,l.jsx)("table",{className:s()("w-full",a),children:t})})}var x=n(28743);function d(){return(0,l.jsx)("tbody",{className:"bg-table-bg-1",children:(0,l.jsx)("tr",{children:(0,l.jsx)("td",{className:"py-4 lg:py-10",colSpan:100,children:(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsx)(x.Z,{className:"animate-spin w-8 h-8 lg:w-12 lg:h-12"})})})})})}function o(e){let{children:t,className:n,isLoading:a,isTdWhiteSpaceNormal:r,emptyMessage:c}=e;return a?(0,l.jsx)(d,{}):c?(0,l.jsx)("tbody",{className:"bg-table-bg-1",children:(0,l.jsx)("tr",{children:(0,l.jsx)("td",{className:"py-6",colSpan:100,children:(0,l.jsx)("div",{className:"flex justify-center caption lg:body3 text-center text-secondary-90 whitespace-pre-wrap",children:c})})})}):(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("tbody",{className:s()(i().tbody,{[i()["td-whitespace-normal"]]:r},n),children:t})})}function p(e){let{children:t,className:n}=e;return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("thead",{className:s()(i().thead,n),children:t})})}},35092:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var l=n(85893);n(67294);var a=n(36005),s=n(64194),r=n(92764);function i(e){let{className:t,size:n,value:i,planets:c,onChange:x}=e,d=e=>{x(c.find(t=>
1t.id===e.value)||c[0])};return(0,l.jsx)(s.P,{className:t,size:n,isLoading:!(0,a.kJ)(c),value:{label:(0,r.fm)(null==i?void 0:i.name),value:null==i?void 0:i.id},options:c.map(e=>({label:(0,r.fm)(e.name),value:e.id})),onChange:d})}},29300:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return T}});var l=n(85893),a=n(48583),s=n(11163),r=n(67294),i=n(18486),c=n(74919),x=n(59187),d=n(68320),o=n(16542),p=n(49770),g=n(37996),u=n(6428),m=n(68434);let h="9cArenaRanking";var f=n(94184),j=n.n(f);function v(e){let{label:t,value:n}=e;return(0,l.jsxs)("div",{className:j()("flex flex-col items-center gap-[12px]"),children:[(0,l.jsx)("span",{className:j()("text-secondary-95 font-bold","text-[12px] leading-[16px]","lg:text-[16px] lg:leading-[24px]"),children:t}),(0,l.jsxs)("strong",{className:j()("text-primary-500 font-bold","text-[16px] leading-[24px]","lg:text-[24px] lg:leading-[28px]"),children:[n," NCG"]})]})}function b(e){let{label:t,value:n}=e;return(0,l.jsxs)("div",{className:j()("flex justify-end gap-[4px]"),children:[(0,l.jsx)("span",{className:j()("font-medium","text-[12px] leading-[16px] text-secondary-90","lg:text-[16px] lg:leading-[24px] lg:text-secondary-95"),children:t}),(0,l.jsx)("strong",{className:j()("text-secondary-95 font-bold","text-[12px] leading-[16px]","lg:text-[20px] lg:leading-[24px]"),children:n})]})}var y=n(92764);function N(e){let{myRankInfo:t,notice:n}=e;return(0,l.jsxs)("div",{children:[(0,l.jsxs)("strong",{className:j()("hidden","lg:block lg:text-secondary-95 lg:font-bold lg:text-[28px] lg:leading-[36px]"),children:[t.Name," #",(0,y.Q5)(t.AvatarAddress)]}),(0,l.jsxs)("div",{className:j()("flex flex-col","py-[27px] px-[16px] gap-[32px]","lg:h-[312px] lg:mt-[28px] lg:pt-[16px] lg:pb-[40px] lg:pl-[32px] lg:pr-[180px] lg:gap-[24px]"),children:[(0,l.jsxs)("div",{className:j()("flex","flex-col gap-[12px] items-center","lg:flex-row lg:gap-[20px]"),children:[(0,l.jsxs)("span",{className:j()("rounded-[100px] bg-secondary-95 text-secondary-30 font-bold","px-[14px] py-[4px] text-[14px] leading-[20px]","lg:px-[20px] lg:py-[8px] lg:text-[20px] lg:leading-[24px]"),children:[t.Rank,"th"]}),(0,l.jsxs)("strong",{className:j()("text-secondary-95 font-bold","text-[20px] leading-[24px]","lg:hidden"),children:[t.Name," ",(0,l.jsxs)("span",{className:j()("text-[18px]"),children:["#",(0,y.Q5)(t.AvatarAddress)]})]}),(0,l.jsxs)("div",{className:j()("flex","gap-[12px]","lg:gap-[20px]"),children:[(0,l.jsx)(b,{label:"Lv",value:t.AvatarLevel}),(0,l.jsx)(b,{label:"win",value:t.WinCount}),(0,l.jsx)(b,{label:"lose",value:t.LossCount}),(0,l.jsx)(b,{label:"score",value:t.Score})]})]}),(0,l.jsxs)("div",{className:j()("flex rounded-[8px] bg-secondary-50","px-[16px] py-[24px] justify-between","lg:px-[56px] lg:py-[32px] lg:justify-start lg:gap-[80px]"),children:[(0,l.jsx)(v,{label:"Arena Reward",value:t.BasicRewardAmount}),(0,l.jsx)(v,{label:"Additional Bonus",value:t.StakingBonus}),(0,l.jsx)(v,{label:"Total",value:t.TotalRewardAmount})]}),(0,l.jsx)("p",{className:j()("text-secondary-90 font-medium text-[14px] leading-[20px]","text-center","lg:text-left"),children:n})]})]})}function w(e){let{notice:t}=e;return(0,l.jsxs)("div",{className:j()("flex flex-1 flex-col items-center px-[16px]","justify-center gap-[32px]","lg:justify-end lg:gap-[68px] lg:mb-[30px]"),children:[(0,l.jsx)("strong",{className:j()("font-bold text-secondary-95","text-[18px] leading-[21px]","lg:text-[28px] lg:leading-[36px]"),children:"You havenât been ranked this season"}),(0,l.jsx)("p",{className:j()("font-medium text-secondary-90 break-words text-center text-[14px] leading-[20px]"),children:t})]})}var k=n(83900),_=n(5319);function A(){let{setOpen:e}=(0,r.useContext)(_.v);return(0,l.jsxs)("div",{className:j()("flex flex-1 flex-col items-center justify-center px-[16px]","gap-[32px]","lg:gap-[40px]"),children:[(0,l.jsx)("strong",{className:j()("font-bold text-secondary-95","text-[18px] leading-[21px]","lg:text-[28px] lg:leading-[36px]"),children:"Sign in and check your arena ranking"}),(0,l.jsx)(k.z,{size:"md",variant:"primary",onClick:()=>e(!0),children:"Sign in"})]})}let S=(0,l.jsxs)(l.Fragment,{children:["If you participate in the arena with multiple characters, only the one with the highest score will be counted",(0,l.jsx)("br",{className:j()("hidden","lg:block")})," As a result, the ranking displayed below may differ from the in-game ranking."]});function R(e){let{account:t,myRank:n}=e;return(0,l.jsx)("div",{className:j()("flex flex-col bg-no-repeat","min-h-[212px] mt-[24px] mx-[-16px] bg-[url(/images/arena/bg-myrank-mobile.png)] bg-center bg-[length:750px_394px]","lg:relative lg:min-h-[312px] lg:mx-0 lg:px-0 lg:bg-[url(/images/arena/bg-myrank.png)] lg:bg-[length:100%_auto] lg:bg-bottom",n&&'lg:after:content[""] lg:after:absolute lg:after:right-[32px] lg:after:bottom-0 lg:after:w-[292px] lg:after:h-[386px] lg:after:bg-[url(/images/arena/image-cat.png)] lg:after:bg-no-repeat lg:after:bg-ce
1nter lg:after:bg-[length:100%_100%]]'),children:(0,m.Q)(t)?(0,l.jsx)(A,{}):(0,l.jsx)(l.Fragment,{children:n?(0,l.jsx)(N,{myRankInfo:n,notice:S}):(0,l.jsx)(w,{notice:S})})})}var C=n(64194),L=n(35092);function O(e){let{planets:t,selectedPlanet:n,onChangePlanet:a,season:s,selectedSeason:r,onChangeSeason:i,startBlockIndex:c,endBlockIndex:x,isSeasonLoading:d}=e;return(0,l.jsxs)("div",{className:j()("max-w-[343px] mx-auto flex flex-col items-center","lg:flex-row lg:max-w-[100%] lg:gap-[20px]"),children:[(0,l.jsx)(L.Z,{className:j()("w-full","lg:w-[300px]"),planets:t,value:n||t[0],onChange:a,size:"md"}),(0,l.jsx)(C.P,{size:"md",className:j()("w-full mt-[8px]","lg:order-last lg:min-w-[212px] lg:w-auto lg:mt-0"),isLoading:d,value:{label:r,value:r},options:s.map(e=>({label:e,value:e})),onChange:e=>i(e.value)}),(0,l.jsxs)("div",{className:j()("flex items-center","w-full justify-between mt-[16px]","lg:w-auto lg:flex-1 lg:justify-end lg:gap-[12px] lg:mt-0"),children:[(0,l.jsx)("span",{className:j()("text-secondary-90 font-medium","text-[13px] leading-[18px]","lg:text-[16px] lg:leading-[24px]"),children:"Block Start/End"}),(0,l.jsxs)("span",{className:j()("text-secondary-95 font-medium","text-[13px] leading-[18px]","lg:text-[16px] lg:leading-[24px]"),children:[c," - ",x]})]})]})}var B=n(95438),I=n(37720),E=n.n(I),P=n(91717);function Z(e){let{ranks:t,myRank:n,isLoading:a,myAvatarAddress:s}=e,[i,c]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{c(!1)},[t]),(0,l.jsxs)("div",{className:j()("mt-[32px]","lg:mt-[72px]"),children:[(0,l.jsxs)(B.iA,{children:[(0,l.jsx)(B.hr,{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{className:"w-[6%]"}),(0,l.jsx)("th",{className:"w-[auto]",children:"Avatar Name"}),(0,l.jsx)("th",{className:"w-[8%]",children:"Level"}),(0,l.jsx)("th",{className:"w-[8%]",children:"Win"}),(0,l.jsx)("th",{className:"w-[8%]",children:"Lose"}),(0,l.jsx)("th",{className:"w-[10%]",children:"Score"}),(0,l.jsx)("th",{className:"w-[12%]",children:"Reward"}),(0,l.jsx)("th",{className:"w-[12%]",children:"Additional Bonus"}),(0,l.jsx)("th",{className:"w-[12%]",children:"Total"})]})}),(0,l.jsx)(B.p3,{isLoading:a,children:null==t?void 0:t.map((e,t)=>!i&&20<=t?(0,l.jsx)(l.Fragment,{}):(0,l.jsxs)("tr",{className:j()(n===e.Rank&&s===e.AvatarAddress&&E().select),children:[(0,l.jsx)("td",{children:e.Rank}),(0,l.jsxs)("td",{className:j()("text-left",n===e.Rank&&E().highlight),children:[e.Name," ",e.AvatarAddress?"#".concat((0,y.Q5)(e.AvatarAddress)):""]}),(0,l.jsx)("td",{children:e.AvatarLevel}),(0,l.jsx)("td",{children:e.WinCount}),(0,l.jsx)("td",{children:e.LossCount}),(0,l.jsx)("td",{children:e.Score}),(0,l.jsx)("td",{children:e.BasicRewardAmount}),(0,l.jsx)("td",{children:e.StakingBonus}),(0,l.jsx)("td",{className:"!text-primary-500",children:e.TotalRewardAmount})]},"".concat(e.AvatarAddress,"_").concat(e.Rank,"_").concat(e.Name)))})]}),!i&&(null==t?void 0:t.length)>20&&(0,l.jsx)("div",{className:"mt-10 flex justify-center",children:(0,l.jsx)(k.z,{variant:"secondary",rightIcon:(0,l.jsx)(P.Z,{className:"fill-inherit",src:"/icons/basic/plus.svg",width:20,height:20,alt:"icon"}),onClick:()=>c(!0),children:"More"})})]})}var F=n(97420);let z=r.createContext({}),Q=e=>{let{children:t}=e,[n,a]=(0,r.useState)(!1),[s,i]=(0,r.useState)({});return(0,l.jsx)(z.Provider,{value:{isMessageDialogOpen:n,setMessageDialogOpen:a,messageDialogContent:s,setMessageDialogContent:i},children:t})};function T(){var e,t,n,f;let j=(0,s.useRouter)(),{account:v,isLoading:b}=(0,o.mA)(),{isMessageDialogOpen:y,setMessageDialogOpen:N,messageDialogContent:w,setMessageDialogContent:k}=(0,r.useContext)(z),_=(0,a.Dv)(i.o),[A,S]=(0,r.useState)(),[C,L]=(0,r.useState)(),[B,I]=(0,r.useState)(!0),{data:E,error:P,isLoading:F}=function(e){let{data:t,error:n,mutate:l}=(0,p.Z)(e?"".concat(u.jd,"?planetId=").concat(e):null,g.C);return{data:t||[],isLoading:!n&&!t,error:n,mutate:l}}(null==A?void 0:A.id),{arenaData:Q,error:T,isLoading:W}=function(e,t,n,l){let a,s=!1,r={};if(e&&t&&n&&!(0,m.Q)(l)){let e=localStorage.getItem(h);if(e){var i;s=Boolean(a=null===(i=(r=JSON.parse(e))[t])||void 0===i?void 0:i[n])}else s=!1}let c=Boolean(t)&&Boolean(n)&&e,{data:x,error:d,mutate:o}=(0,p.Z)(c?"".concat(u.Uu,"?planetId=").concat(t,"&season=").concat(n,"&userSet=").concat(s?1:0):null,g.C),f=x;if(e&&t&&n&&f&&!(0,m.Q)(l)){if(s)f={...f,userRank:a};else if(f.userRank){let e={...r,[t]:{...r[t],[n]:f.userRank}};localStorage.setItem(h,JSON.stringify(e))}}return{arenaData:f||{},isLoading:c&&!d&&!f,error:d,mutate:o}}(B,null==A?void 0:A.id,C,v);(0,r.useEffect)(()=>
1{if(_&&!A&&!b){let e=_.find(e=>e.id===(null==v?void 0:v.preferPlanetId));S(e||_[0])}},[v,_,A,b]),(0,r.useEffect)(()=>{(null==E?void 0:E.length)>0&&(I(!0),L(E[0]))},[E]);let D=async e=>{A!==e&&(I(!1),S(e))};return(T||P)&&(k((null===(n=T.response)||void 0===n?void 0:n.data)||(null===(f=P.response)||void 0===f?void 0:f.data)||d.j.GENERAL),N(!0)),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"w-full flex justify-center px-[16px]",children:(0,l.jsx)("div",{className:"w-full pb-16 lg:pb-[104px] mt-[32px] lg:mt-[56px] max-w-[1120px]",children:b?(0,l.jsx)(c.W,{className:"w-full mt-10 min-h-[180px] gap-6 lg:py-14 lg:px-0 lg:gap-10 lg:mt-[76px]"}):(0,l.jsxs)(l.Fragment,{children:[_&&A&&C&&(0,l.jsx)(O,{planets:_,selectedPlanet:A,onChangePlanet:e=>D(e),season:E,selectedSeason:C,onChangeSeason:e=>L(e),startBlockIndex:null==Q?void 0:Q.startBlockIndex,endBlockIndex:null==Q?void 0:Q.endBlockIndex,isSeasonLoading:F}),(0,l.jsx)(R,{account:v,myRank:null==Q?void 0:Q.userRank}),(0,l.jsx)(Z,{ranks:Q.ranks,isLoading:W,myRank:null==Q?void 0:null===(e=Q.userRank)||void 0===e?void 0:e.Rank,myAvatarAddress:null==Q?void 0:null===(t=Q.userRank)||void 0===t?void 0:t.AvatarAddress})]})})}),(0,l.jsx)(x.u,{isOpen:y,onClose:()=>N(!1),children:(0,l.jsx)(x.u.Content,{className:"w-full lg:w-[736px]",title:null==w?void 0:w.title,message:null==w?void 0:w.message,positiveLabel:"Dismiss",positiveHandler:()=>j.push("/")})})]})}T.layout=e=>{let{children:t}=e;return(0,l.jsx)(Q,{children:(0,l.jsx)(F.N,{children:t})})}},37720:function(e){e.exports={thead:"table_thead__qrjXd",tbody:"table_tbody__naIwb",select:"table_select__rdRcK",highlight:"table_highlight__kWOk5","td-whitespace-normal":"table_td-whitespace-normal__Oj75b"}},27668:function(e){e.exports={selectChainOptions:"Common_selectChainOptions__1_7b6"}},49770:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var l,a,s=n(8100),r=function(){return(r=Object.assign||function(e){for(var t,n=1,l=arguments.length;n<l;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},i=(l=s.ZP,a=function(e){return function(t,n,l){return l.revalidateOnFocus=!1,l.revalidateIfStale=!1,l.revalidateOnReconnect=!1,e(t,n,l)}},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="function"==typeof e[1]?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],s=n[0],i=n[1],c=n[2],x=(c.use||[]).concat(a);return l(s,i,r(r({},c),{use:x}))})}},function(e){e.O(0,[5921,6005,9774,2888,179],function(){return e(e.s=55576)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.