1import{r,j as e,i as j}from"./vendor-react-BGN68_Lp.js";import{x as w,ba as k,c as M,q as v,g as y}from"./index-uear5Vpj.js";import{g as n}from"./vendor-styled-pkIKgjgv.js";import{u as S}from"./vendor-redux-D8sX5Eqv.js";import{m as $}from"./customMissionApi-D7mXpfGm.js";import{u as m}from"./vendor-i18n-BWleq_Sd.js";import"./vendor-socket-DSYo_sTV.js";import"./vendor-router-CYD8mbvC.js";const L=n.div` 2 padding: 40px; 3 width: 540px; 4 max-width: 90%; 5 border-radius: 15px; 6 background: #171c2a; 7 8 @media (max-width: 750px) { 9 padding: 24px; 10 } 11`,T=n.h1` 12 margin-bottom: 8px; 13 color: #ecf1f8; 14 font-size: 32px; 15 font-weight: 700; 16 text-transform: none; 17 18 @media (max-width: 750px) { 19 font-size: 20px; 20 } 21`,z=n.p` 22 color: #adbcd0; 23 font-size: 15px; 24 font-weight: 500; 25 line-height: 22px; 26`,A=n.ul` 27 display: flex; 28 flex-direction: column; 29 margin-top: 24px; 30 border-radius: 8px; 31 overflow: hidden; 32 gap: 2px; 33`,D=n.li` 34 background: ${t=>t.$done?"rgba(39, 79, 76, 0.25)":"#1d2435"}; 35 display: flex; 36 align-items: center; 37 justify-content: space-between; 38 gap: 16px; 39 padding: 16px; 40`,_=n.div` 41 display: flex; 42 align-items: center; 43 gap: 12px; 44 min-width: 0; 45 46 & > img { 47 width: 24px; 48 height: 24px; 49 flex-shrink: 0; 50 } 51 52 h6 { 53 color: #dee2ed; 54 font-size: 14px; 55 font-weight: 500; 56 margin-bottom: 6px; 57 } 58`,B=n.p` 59 color: rgba(222, 226, 237, 0.7); 60 font-size: 12px; 61 font-weight: 400; 62 line-height: 16px; 63`,E=n.a` 64 margin-left: 6px; 65 color: #6080ff; 66 font-weight: 600; 67`,b=n.button` 68 padding: 10px 12px; 69 border-radius: 8px; 70 background: ${t=>t.$done?"rgba(91, 234, 174, 0.12)":"rgba(96, 128, 255, 0.12)"}; 71 color: ${t=>t.$done?"#6BCEA5":"#6080ff"}; 72 font-size: 14px; 73 white-space: nowrap; 74 display: flex; 75 align-items: center; 76 77 svg { 78 width: 16px; 79 margin-left: 4px; 80 display: ${t=>t.$done?"block":"none"}; 81 } 82`,I=n(b).attrs({as:"a",target:"_blank",rel:"noreferrer"})` 83 text-decoration: none; 84`,N=n.button` 85 margin-top: 24px; 86 letter-spacing: 0; 87 font-weight: 700; 88`,O=()=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M6.97386 12C6.7162 12 6.46906 11.8978 6.28654 11.7158L3.26104 8.68761C3.08924 8.50314 2.99571 8.25916 3.00015 8.00707C3.0046 7.75497 3.10667 7.51444 3.28487 7.33616C3.46307 7.15787 3.70349 7.05575 3.95546 7.0513C4.20744 7.04685 4.4513 7.14043 4.63568 7.31231L6.96997 9.64772L12.3388 4.28407C12.4294 4.19377 12.5369 4.12221 12.6552 4.07347C12.7734 4.02472 12.9001 3.99976 13.028 4C13.1559 4.00024 13.2825 4.02568 13.4005 4.07487C13.5186 4.12406 13.6258 4.19603 13.7161 4.28667C13.8063 4.37731 13.8779 4.48486 13.9266 4.60316C13.9753 4.72146 14.0002 4.8482 14 4.97615C13.9998 5.1041 13.9743 5.23075 13.9252 5.34886C13.876 5.46698 13.8041 5.57425 13.7135 5.66456L7.66247 11.7197C7.479 11.9006 7.2314 12.0013 6.97386 12Z",fill:"#64D3AB"})}),a=(t,s="")=>t==null||typeof t=="object"?s:v(t)||s,J=()=>{const{t}=m(),{challenge:s}=S(({modals:i})=>i.data.CUSTOM_MISSION_MODAL),[o,c]=r.useState(null),[l,x]=r.useState({}),[d,p]=r.useState(!1),h=s?.id_challenges??s?.id_challenge??s?.id,g=r.useMemo(()=>Object.values(o||{}),[o]),C=g.length>0&&g.every(i=>i.status),u=r.useCallback((i=!1)=>{if(!h){c({});return}p(!0),$.checkCustomMission(h,i).then(f=>{c(f?.data?.checkbox||{}),x(f?.data?.general||{})}).finally(()=>p(!1))},[h]);return r.useEffect(()=>{u(!1)},[u]),e.jsxs(L,{children:[e.jsx(w,{}),e.jsx(T,{children:a(l.title,t("Mission"))}),e.jsx(z,{children:a(l.desc,t("partnerMissionText"))}),e.jsx(A,{children:d&&!o?e.jsx(k,{count:5,baseColor:"#1d2435",highlightColor:"#202738",height:68}):g.map(i=>e.jsx(G,{item:i},i.id))}),e.jsx(N,{className:M("modal-button",d&&"loading"),onClick:()=>u(!0),children:e.jsx("p",{children:t(C?"GET":"Check")})})]})},G=({item:t})=>{const{t:s}=m(),o=t.desc||{},c=t.button||{},l=a(o.title),x=Number(o.type)===1&&o.url,d=t.status?s("Completed"):a(c.title,s("MoveTo")),p=t.status?e.jsxs(b,{$done:!0,type:"button",children:[d,e.jsx(O,{})]}):e.jsx(I,{$done:!1,href:c.url||"#",children:d});return e.jsx(j,{placement:"top",content:a(t.tippy),disabled:!t.t
88ippy,children:e.jsxs(D,{$done:t.status,children:[e.jsxs(_,{children:[e.jsx("img",{loading:"lazy",src:y(`/pages/missions/icons/${t.status?"":"un"}success.svg`),alt:""}),e.jsxs("div",{children:[e.jsx("h6",{children:a(t.title)}),l&&e.jsxs(B,{children:[l,x&&e.jsx(E,{href:o.url,target:"_blank",rel:"noreferrer",children:s("MoveTo")})]})]})]}),p]})})};export{J as default};
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.