PageSourceSearch

https://www.resida.app/_next/static/chunks/9186.ae2fc497d07646e2.js

js resida.app collected 2026-10-02 01:16:07 UTC 16,066 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9186],{58007:(e,t,s)=>{s.d(t,{Hi:()=>c,OO:()=>n,d7:()=>l,o7:()=>i});var a=s(24924);let l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a.Ay$.get("/api/v1/growth/campaigns/available",{params:e})},n=e=>a.Ay$.get("/api/v1/growth/campaigns/".concat(e,"/public")),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a.Ay$.get("/api/v1/growth/my-campaigns",{params:e})},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a.Ay$.get("/api/v1/growth/my-rewards",{params:e})}},59186:(e,t,s)=>{s.r(t),s.d(t,{default:()=>A});var a=s(95155),l=s(12115),n=s(60709),i=s(61362),c=s(91169),r=s(26983),d=s(52987),x=s(99051),m=s(93499),o=s(35299),u=s(6132),h=s(35626),p=s(6613),j=s(65229),f=s(24546),g=s(58007),N=s(5218);let v=e=>"₦"+Number(null!=e?e:0).toLocaleString("en-NG"),F=e=>e?new Date(e).toLocaleDateString("en-NG",{day:"numeric",month:"short",year:"numeric"}):null,b={not_started:{label:"Not started",color:"bg-[#DDE3EA] text-[#444746]"},in_progress:{label:"In progress",color:"bg-[#CCE0FF] text-[#0052FF]"},completed:{label:"Completed",color:"bg-[#C4EED0] text-[#146C2E]"},rewarded:{label:"Rewarded",color:"bg-[#C4EED0] text-[#0F5223]"},expired:{label:"Expired",color:"bg-[#DDE3EA] text-[#747775]"}},w={pending:{label:"Pending",color:"bg-amber-50 text-amber-700"},approved:{label:"Approved",color:"bg-[#CCE0FF] text-[#0052FF]"},processing:{label:"Processing",color:"bg-[#E8DEF8] text-violet-700"},completed:{label:"Paid",color:"bg-[#C4EED0] text-[#146C2E]"},failed:{label:"Failed",color:"bg-[#F9DEDC] text-[#B3261E]"}};function y(e){let{status:t,map:s}=e,l=s[t]||{label:t,color:"bg-[#DDE3EA] text-[#444746]"};return(0,a.jsx)("span",{className:"inline-flex px-2.5 py-0.5 rounded-full text-[10px] font-medium uppercase tracking-wide ".concat(l.color),children:l.label})}function C(e){let{campaign:t,myProgress:s,onClick:l}=e,x=t.condition_count||0,m=(null==s?void 0:s.met_count)||0,o=x>0?Math.round(m/x*100):0;return(0,a.jsx)("button",{onClick:l,className:"w-full text-left bg-white rounded-[28px] p-5 hover:bg-[#F8FAFD] transition-colors group",children:(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full bg-[#CCE0FF] flex items-center justify-center shrink-0",children:(0,a.jsx)(n.A,{className:"w-5 h-5 text-[#0052FF]"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-[#1F1F1F]",children:t.name}),(0,a.jsx)("span",{className:"text-sm font-medium text-[#0052FF]",children:v(t.reward_amount)})]}),t.description&&(0,a.jsx)("p",{className:"text-xs text-[#444746] mt-1 line-clamp-2",children:t.description}),s&&(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-[#747775] mb-1.5",children:[(0,a.jsxs)("span",{children:[m," / ",x," steps"]}),(0,a.jsx)(y,{status:s.status,map:b})]}),(0,a.jsx)("div",{className:"h-1.5 bg-[#F0F4F9] rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-[#0052FF] rounded-full transition-all",style:{width:"".concat(o,"%")}})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mt-3 text-[10px] text-[#747775]",children:[x>0&&(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(i.A,{className:"w-3 h-3"}),x," steps"]}),t.participant_count>0&&(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(c.A,{className:"w-3 h-3"}),t.participant_count.toLocaleString("en-NG")," joined"]}),t.end_date&&(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(r.A,{className:"w-3 h-3"}),"Ends ",F(t.end_date)]})]})]}),(0,a.jsx)(d.A,{className:"w-4 h-4 text-[#C4C7C5] group-hover:text-[#0052FF] transition-colors shrink-0 mt-1"})]})})}function E(e){let{condition:t,met:s,locked:l}=e;return(0,a.jsxs)("div",{className:"flex items-start gap-3 p-4 rounded-[16px] border transition-all ".concat(s?"bg-[#C4EED0] border-[#C4EED0]":l?"bg-[#F0F4F9] border-[#
1E9EEF6] opacity-60":"bg-white border-[#E9EEF6]"),children:[(0,a.jsx)("div",{className:"mt-0.5 shrink-0",children:s?(0,a.jsx)(i.A,{className:"w-5 h-5 text-[#146C2E]"}):(0,a.jsx)(x.A,{className:"w-5 h-5 ".concat(l?"text-[#C4C7C5]":"text-[#0052FF]")})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-medium ".concat(s?"text-[#146C2E] line-through decoration-[#6DD58C]":"text-[#1F1F1F]"),children:t.display_label||t.event_type}),!s&&t.deep_link&&(0,a.jsxs)("a",{href:t.deep_link,className:"inline-flex items-center gap-1 mt-1.5 text-xs text-[#0052FF] hover:text-[#0039B5] font-medium",children:["Take action ",(0,a.jsx)(m.A,{className:"w-3 h-3"})]})]})]})}function _(e){let{id:t,isAuthenticated:s,onBack:d}=e,[x,m]=(0,l.useState)(null),[j,f]=(0,l.useState)(null),[N,w]=(0,l.useState)(!0),[C,_]=(0,l.useState)("");if((0,l.useEffect)(()=>{let e=async()=>{var e,a,l,n,i;w(!0);try{let n=await (0,g.OO)(t);if(m((null==(e=n.data)?void 0:e.data)||null),s){let e=((null==(l=(await (0,g.o7)()).data)||null==(a=l.data)?void 0:a.data)||[]).find(e=>e.campaign_id===t);f(e||null)}}catch(e){_((null==(i=e.response)||null==(n=i.data)?void 0:n.message)||"Campaign not found.")}finally{w(!1)}};t&&e()},[t,s]),N)return(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,a.jsx)(o.A,{className:"w-7 h-7 text-[#0052FF] animate-spin"})});if(C||!x)return(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,a.jsxs)("div",{className:"bg-white rounded-[28px] p-10 text-center max-w-sm w-full",children:[(0,a.jsx)("div",{className:"w-12 h-12 bg-[#F9DEDC] rounded-full flex items-center justify-center mx-auto mb-3",children:(0,a.jsx)(u.A,{className:"w-6 h-6 text-[#B3261E]"})}),(0,a.jsx)("p",{className:"text-sm text-[#444746]",children:C||"Campaign not found."}),(0,a.jsx)("button",{onClick:d,className:"mt-4 text-sm text-[#0052FF] hover:text-[#0039B5] font-medium",children:"View all campaigns"})]})});let A=x.conditions||[],k=new Set((null==j?void 0:j.met_conditions)||[]),D=(null==j?void 0:j.met_count)||0,S=A.length,B=S>0?Math.round(D/S*100):0,M=(null==j?void 0:j.status)==="completed"||(null==j?void 0:j.status)==="rewarded";return(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto p-5 space-y-4",children:[(0,a.jsxs)("button",{onClick:d,className:"flex items-center gap-2 text-sm text-[#0052FF] hover:text-[#0039B5] font-medium transition-colors",children:[(0,a.jsx)(h.A,{className:"w-4 h-4"})," Back to campaigns"]}),(0,a.jsxs)("div",{className:"bg-white rounded-[28px] p-6",children:[(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"w-12 h-12 bg-[#CCE0FF] rounded-full flex items-center justify-center shrink-0",children:(0,a.jsx)(n.A,{className:"w-6 h-6 text-[#0052FF]"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("h3",{className:"text-lg font-normal text-[#1F1F1F]",children:x.name}),j&&(0,a.jsx)(y,{status:j.status,map:b})]}),x.description&&(0,a.jsx)("p",{className:"text-sm text-[#444746] mt-1",children:x.description}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mt-3 text-xs text-[#747775]",children:[x.participant_count>0&&(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(c.A,{className:"w-3.5 h-3.5"}),x.participant_count.toLocaleString("en-NG")," joined"]}),x.end_date&&(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(r.A,{className:"w-3.5 h-3.5"}),"Ends ",F(x.end_date)]})]})]})]}),(0,a.jsxs)("div",{className:"mt-5 p-5 bg-[#0052FF] rounded-[16px] text-white flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs font-medium opacity-80",children:"Complete all steps to earn"}),(0,a.jsx)("div",{className:"text-2xl font-normal mt-1",children:v(x.reward_amount)})]}),(0,a.jsx)(p.A,{className:"w-9 h-9 opacity-25"})]})]}),j&&(0,a.jsxs)("div",{className:"bg-white rounded-[28px] p-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs text-[#444746] mb-2.5",children:[(0,a.jsxs)("span",{children:[D," of ",S," steps completed"]}),(0,a.jsxs)("span",{className:"font-medium text-[#0052FF]",children:[B,"%"]})]}),(0,a.jsx)("div",{className:"h-2 bg-[#F0F4F9] rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full rounded-full transition-all ".concat(M?"bg-[#146C2E]":"bg-[#0052FF]"),style:{width:"".concat(B,"%")}
1})}),M&&(0,a.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm font-medium text-[#146C2E]",children:[(0,a.jsx)(i.A,{className:"w-4 h-4"}),"rewarded"===j.status?"Reward has been issued to your wallet!":"All steps complete — reward is being processed."]})]}),A.length>0&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-[#747775] px-1",children:"Steps to complete"}),A.sort((e,t)=>(e.sequence_order||0)-(t.sequence_order||0)).map((e,t)=>{var s,l;let n=k.has(e.id)||k.has(e.event_type),i=0===t||k.has(null==(s=A[t-1])?void 0:s.id)||k.has(null==(l=A[t-1])?void 0:l.event_type),c=!j&&t>0;return(0,a.jsx)(E,{condition:e,met:n,locked:c&&!i},e.id||t)})]}),!s&&(0,a.jsxs)("div",{className:"bg-[#CCE0FF] rounded-[28px] p-6 text-center",children:[(0,a.jsx)("div",{className:"w-10 h-10 bg-[#0052FF] rounded-full flex items-center justify-center mx-auto mb-3",children:(0,a.jsx)(p.A,{className:"w-5 h-5 text-white"})}),(0,a.jsx)("p",{className:"text-sm font-medium text-[#0039B5] mb-1",children:"Sign in to start earning"}),(0,a.jsx)("p",{className:"text-xs text-[#0052FF] mb-4",children:"Track your steps and claim your reward"})]})]})}function A(e){let{open:t,onClose:s}=e;(0,N.K)(t);let{isAuthenticated:i}=(0,f.useAuthStore)(),[c,r]=(0,l.useState)("available"),[d,x]=(0,l.useState)([]),[m,u]=(0,l.useState)([]),[h,E]=(0,l.useState)([]),[A,k]=(0,l.useState)(!0),[D,S]=(0,l.useState)(null);(0,l.useEffect)(()=>{t&&(S(null),(async()=>{k(!0);try{var e,t,s,a,l,n,c;let[r]=await Promise.all([(0,g.d7)()]);if(x((null==(t=r.data)||null==(e=t.data)?void 0:e.data)||(null==(s=r.data)?void 0:s.data)||[]),i){let[e,t]=await Promise.all([(0,g.o7)(),(0,g.Hi)()]);u((null==(l=e.data)||null==(a=l.data)?void 0:a.data)||[]),E((null==(c=t.data)||null==(n=c.data)?void 0:n.data)||[])}}catch(e){}finally{k(!1)}})())},[t,i]);let B={};for(let e of m)B[e.campaign_id]=e;let M=i?[["available","All Campaigns"],["mine","My Progress"],["rewards","My Rewards"]]:[["available","All Campaigns"]];return t?(0,a.jsxs)("div",{className:"fixed inset-0 z-[90] flex",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/30",onClick:s}),(0,a.jsxs)("div",{className:"relative ml-auto w-full max-w-lg bg-[#F0F4F9] h-full flex flex-col gw-panel-right",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-5 border-b border-gray-100 shrink-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-xl bg-[#CCE0FF] flex items-center justify-center shrink-0",children:(0,a.jsx)(p.A,{className:"w-4 h-4 text-[#0052FF]"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"font-bold text-gray-900 leading-none",children:"Earn Rewards"}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Complete tasks to earn wallet credits and airtime"})]})]}),(0,a.jsx)("button",{onClick:s,className:"p-2 hover:bg-gray-100 rounded-full transition-colors shrink-0",children:(0,a.jsx)(j.A,{className:"w-4 h-4 text-gray-500"})})]}),D?(0,a.jsx)(_,{id:D,isAuthenticated:i,onBack:()=>S(null)}):(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto p-5 space-y-4",children:[M.length>1&&(0,a.jsx)("div",{className:"flex gap-1 bg-[#E9EEF6] rounded-[100px] p-1 w-fit",children:M.map(e=>{let[t,s]=e;return(0,a.jsx)("button",{onClick:()=>r(t),className:"px-4 py-2 rounded-[100px] text-xs font-medium transition-all ".concat(c===t?"bg-[#CCE0FF] text-[#0052FF]":"text-[#444746] hover:text-[#1F1F1F]"),children:s},t)})}),A?(0,a.jsx)("div",{className:"flex justify-center py-16",children:(0,a.jsx)(o.A,{className:"w-6 h-6 text-[#0052FF] animate-spin"})}):(0,a.jsxs)(a.Fragment,{children:["available"===c&&(0,a.jsxs)("div",{className:"space-y-3",children:[0===d.length&&(0,a.jsxs)("div",{className:"bg-white rounded-[28px] py-16 text-center",children:[(0,a.jsx)("div",{className:"w-12 h-12 bg-[#CCE0FF] rounded-full flex items-center justify-center mx-auto mb-3",children:(0,a.jsx)(n.A,{className:"w-6 h-6 text-[#0052FF]"})}),(0,a.jsx)("p",{className:"text-sm text-[#444746]",children:"No active campaigns right now."}),(0,a.jsx)("p",{className:"text-xs text-[#747775] mt-1",children:"Check back soon."})]}),d.map(e=>(0,a.jsx)(C,{campaign:e,myProgress:B[e.id],onClick:()=>S(e.id)},e.id))]}),"mine"===c&&(0,a.jsxs)("div",{className:"space-y-3",children:[0===m.length&&(0,a.jsx)("div",{className:"bg-white rounded-[28px] py-16 text-center",children:(0,a.jsx)("p",{className:"text-sm text-[#444746]",children:"You haven't joined any campaigns yet."})}),m.map(e=>(0,a.jsxs)("button",{onClick:()=>S(e.campaign_id),className:"w-full text-left bg-white rounded-[28px] p-5 hover:bg-[#F8FAFD] transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-[#1F1F1F]",children:e.campaign_name}),(0,a.jsx)(y,{status:e.status,map:b})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs text-[#747775] mb-2.5",children:[(0,a.jsxs)("span",{children:[e.met_count," / ",e.condition_count," steps complete"]}),(0,a.jsx)("span",{className:"font-medium text-[#0052FF]",children:v(e.reward_amount)})]}),(0,a.jsx)("div",{className:"h-1.5 bg-[#F0F4F9] rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-[#0052FF] rounded-full transition-all",style:{width:e.condition_count>0?"".concat(Math.round(e.met_count/e.condition_count*100),"%"):"0%"}})})]},e.id))]}),"rewards"===c&&(0,a.jsxs)("div",{className:"space-y-3",children:[0===h.length&&(0,a.jsxs)("div",{className:"bg-white rounded-[28px] py-16 text-center",children:[(0,a.jsx)("p",{className:"text-sm text-[#444746]",children:"No rewards yet."}),(0,a.jsx)("p",{className:"text-xs text-[#747775] mt-1",children:"Complete a campaign to earn your first reward."})]}),h.map(e=>(0,a.jsxs)("div",{className:"bg-white rounded-[28px] p-5",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-base font-medium text-[#1F1F1F]",children:v(e.reward_amount)}),(0,a.jsx)("div",{className:"text-xs text-[#444746] mt-0.5",children:e.campaign_name})]}),(0,a.jsx)(y,{status:e.status,map:w})]}),e.created_at&&(0,a.jsx)("div",{className:"text-[10px] text-[#747775] mt-2",children:F(e.created_at)}),e.failed_reason&&"failed"===e.status&&(0,a.jsx)("div",{className:"mt-2 text-xs text-[#B3261E]",children:e.failed_reason})]},e.reward_id||e.id))]})]}),!i&&(0,a.jsxs)("div",{className:"bg-[#CCE0FF] rounded-[28px] p-6 text-center",children:[(0,a.jsx)("div",{className:"w-10 h-10 bg-[#0052FF] rounded-full flex items-center justify-center mx-auto mb-3",children:(0,a.jsx)(p.A,{className:"w-5 h-5 text-white"})}),(0,a.jsx)("p",{className:"text-sm font-medium text-[#0039B5] mb-1",children:"Sign in to track y
1our progress"}),(0,a.jsx)("p",{className:"text-xs text-[#0052FF] mb-4",children:"Join campaigns and claim your rewards"})]})]})]})]}):null}},93499:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(71847).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},99051:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(71847).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])}}]);

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.