1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8214],{38214:function(e,s,t){t.r(s),t.d(s,{default:function(){return _}});var n=t(17340),r=t(54499),a=t(49735),l=t(65353),i=t(85893),c=t(94184),o=t.n(c),d=t(19252),u=t(5152),m=t.n(u),x=t(67294),h=t(25617),f=t(1852),p=t(40782),j=t(81343),w=t(38521),g=t(37074),y=t(28824),C=t(9193),N=t(75785),k=t(16228),v=t(27579),b=t(21811),S=t(14546),R=t(79419),Z="d-flex flex-row align-items-center mx-0 mx-md-4";function q(e){var s=e.className,t=e.quest,r=e.handleClaimQuest,a=e.loadingClaimAll,c=e.isPrimary,o=(0,f.useMediaQuery)({query:"(min-width: ".concat(N.SCREEN_MD,")")}),d=(0,v.Z)().loggedIn,u=(0,k.ZP)().openSignInModal,m=(0,x.useState)(!1),h=m[0],p=m[1],j=(0,x.useMemo)((function(){return(0,i.jsx)(b.G,{value:(0,w.JV)(t.Rewards.PointsReward,0,!1,!0)})}),[t]),g=(0,x.useMemo)((function(){return t.QuestStatus===C.Yr3?(0,i.jsx)(N.Row,{className:"d-flex flex-row align-items-center",style:{width:N.SIZE_9},testId:"quest-card-progress",children:(0,i.jsx)(N.Text,{bold:!0,small:!0,children:"".concat(t.Requirements.CompletedCount," / ").concat(t.Requirements.RequiredCount)})}):(0,i.jsx)(N.Row,{className:"d-flex flex-row align-items-center",style:{width:N.SIZE_9},testId:"quest-card-progress",children:(0,i.jsx)(S.Z,{})})}),[t]),y=(0,x.useMemo)((function(){var e=t.Type===C.of7||t.Type===C.vnq||t.Type===C._ir||t.Type===C.zkh||t.Type===C.zsH;return(0,i.jsx)("div",{className:"pe-1",children:(0,i.jsxs)(N.Space,{align:"center",children:[(0,i.jsx)(N.Tooltip,{content:t.ProgressText,children:(0,i.jsxs)(N.Space,{align:"center",children:[g,(0,i.jsx)(N.Text,{bold:!0,children:t.Description}),e&&o?(0,i.jsx)("span",{className:"d-flex flex-row align-items-center",children:(0,i.jsx)(R.Z,{})}):null]})}),t.Streak>1?(0,i.jsx)(N.Tooltip,{className:"d-flex flex-row align-items-center",content:"".concat(t.Streak," week streak. Complete weekly to keep your streak."),children:(0,i.jsxs)(N.Tag,{rounded:!0,color:"teal",size:"xs",testId:"quest-card-streak",children:["\xd7 ",t.Streak]})}):null]})})}),[t,g,o]),q=(0,x.useCallback)((0,n.Z)((function(){return(0,l.__generator)(this,(function(e){switch(e.label){case 0:return p(!0),r?[4,r(t)]:[3,2];case 1:e.sent(),e.label=2;case 2:return p(!1),[2]}}))})),[t,p,r]),T=(0,x.useMemo)((function(){return t.ClaimStatus===C.T8Z?(0,i.jsxs)(N.Row,{className:Z,children:[(0,i.jsx)(N.Col,{xs:6,sm:7,md:8,children:y}),(0,i.jsx)(N.Col,{xs:3,sm:3,md:2,children:j}),(0,i.jsx)(N.Col,{xs:3,sm:2,md:2,className:"d-flex flex-row justify-content-end",children:(0,i.jsx)("div",{style:{width:N.SIZE_23},className:"d-flex flex-row justify-content-center",children:(0,i.jsx)(N.Text,{bold:!0,testId:"quest-card-completed-text",children:"Completed"})})})]}):t.QuestStatus===C.Yr3?(0,i.jsxs)(N.Row,{className:Z,children:[(0,i.jsx)(N.Col,{xs:6,sm:7,md:8,children:y}),(0,i.jsx)(N.Col,{xs:3,sm:3,md:2,children:j}),(0,i.jsx)(N.Col,{xs:3,sm:2,md:2,className:"d-flex flex-row justify-content-end",children:(0,i.jsx)("div",{style:{width:N.SIZE_23},className:"d-flex flex-row justify-content-center",children:(0,i.jsx)(N.Button,{spacing:"sm",appearance:"dark",darkAppearance:"light",testId:"quest-card-complete-button",href:d?t.ActionLink:void 0,onClick:d?void 0:u,children:"Complete"})})})]}):t.QuestStatus===C.vzs?(0,i.jsxs)(N.Row,{className:Z,children:[(0,i.jsx)(N.Col,{xs:6,sm:7,md:8,children:y}),(0,i.jsx)(N.Col,{xs:3,sm:3,md:2,children:j}),(0,i.jsx)(N.Col,{xs:3,sm:2,md:2,className:"d-flex flex-row justify-content-end",children:(0,i.jsx)("div",{style:{width:N.SIZE_23},className:"d-flex flex-row justify-content-center",children:(0,i.jsx)(N.Button,{spacing:"sm",appearance:c?"primary":"outline-dark",darkAppearance:c?"primary":"outline-light",onClick:q,loading:h,testId:"quest-card-claim-button",disabled:a,children:"Claim"})})})]}):void 0}),[t,y,h,j,c,a,q,d]);return(0,i.jsxs)("div",{className:s,children:[T,(0,i.jsx)("div",{className:"mt-3",children:(0,i.jsx)(N.Divider,{appearance:"dark",direction:"horizontal",className:"my-0"})})]})}var T=m()((function(){return Promise.all([t.e(9155),t.e(2305)]).then(t.bind(t,72305))}),{loadableGenerated:{webpack:function(){return[72305]}}}),I=new d.Z("en-US");function _(e){var s=e.refreshDate,t=e.quests,c=e.loadingQuests,d=e.setQuests,u=e.claimQuest,m=e.claimAllQuests,k=e.className,v=e.renderBanner,b=e.renderTitle,S=function(e){return e.ClaimStatus===C.xv2&&e.QuestStatus===C.vzs},R=(0,h.I0)(),Z=(0,x.useState)(!1),_=Z[0],M=Z[1],A=(0,x.useState)(!1),Q=A[0],B=A[1],E=(0,x.useMemo)((function(){return s?I.format((0,w.eZ)(s)):null}),[s]),P=(0,f.useMediaQuery)({query:"(min-width: ".concat(N.SCREEN_MD,")")});function z(e){return L.apply(this,arguments)}function L(){return L=(0,n.Z)((function(e){var s,n,i,c;return(0,l.__generator)(this,(function(l){switch(l.label){case 0:B(!1),l.label=1;case 1:return l.trys.push([1,3,,4]),e.QuestStatus!==C.vzs?(p.Am.error("You need to complete this quest first."),[2]):[4,u(e.Id)];case 2:return 200===(s=l.sent()).status?(n=e.Rewards.PointsReward,i=t.map((function(s){return s.Id===e.Id?(0,a.Z)((0,r.Z)({},s),{ClaimStatus:C.T8Z}):s})),d(i),p.Am.success("You earned ".concat((0,w.JZ)(n)," BULB Points!")),R((0,g.Bd)(n)),B(!0)):p.Am.error(null!==(c=(0,j.e$)(s))&&void 0!==c?c:"Cannot claim quest reward."),[3,4];case 3:return l.sent(),p.Am.error("Cannot claim quest reward."),[3,4];case 4:return[2]}}
1))})),L.apply(this,arguments)}function Y(){return Y=(0,n.Z)((function(){var e,s,n,i;return(0,l.__generator)(this,(function(l){switch(l.label){case 0:B(!1),M(!0),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,m()];case 2:return 200===(e=l.sent()).status?(s=t.reduce((function(e,s){return S(s)?e+s.Rewards.PointsReward:e}),0),n=t.map((function(e){return S(e)?(0,a.Z)((0,r.Z)({},e),{ClaimStatus:C.T8Z}):e})),d(n),p.Am.success("You earned ".concat((0,w.JZ)(s)," BULB Points!")),R((0,g.Bd)(s)),B(!0)):p.Am.error(null!==(i=(0,j.e$)(e))&&void 0!==i?i:"Cannot claim all quest rewards."),[3,4];case 3:return l.sent(),p.Am.error("Cannot claim all quest rewards."),[3,4];case 4:return M(!1),[2]}}))})),Y.apply(this,arguments)}var D,U=(0,x.useMemo)((function(){return t.filter((function(e){return!S(e)}))}),[t]),J=(0,x.useMemo)((function(){return t.filter((function(e){return S(e)}))}),[t]),G=1===J.length;return(0,i.jsxs)(N.Row,{className:k,children:[v?v():(0,i.jsx)(N.Row,{className:"mb-5",children:(0,i.jsx)(N.BannerCard,{appearance:"purple",icon:(D=y.gO,(0,i.jsx)("div",{className:"d-flex flex-row align-items-center h-100",children:(0,i.jsx)("img",{className:"bulb-banner-graphic",src:D})})),text:(0,i.jsx)(N.Text,{style:{maxWidth:280},heading:P?400:200,type:"dark",children:"Complete weekly challenges to earn extra BULB Points."})})}),J.length?(0,i.jsx)(N.Row,{className:"mb-5",children:(0,i.jsxs)(N.Row,{className:"p-4 quests-claim-rewards-section",children:[(0,i.jsxs)(N.Row,{className:"mb-3",children:[(0,i.jsxs)(N.Space,{className:"mb-3",size:"md",children:[(0,i.jsx)(N.Text,{heading:P?600:400,className:"w-fit",children:"Claim your rewards"}),G?null:(0,i.jsx)(N.Button,{appearance:G?"outline-dark":"primary",darkAppearance:G?"outline-light":"primary",className:"w-fit",spacing:"sm",onClick:function(){return Y.apply(this,arguments)},loading:_,children:"Claim all"})]}),(0,i.jsxs)(N.Text,{children:["Congratulations! You've completed some quests today and have some outstanding rewards to claim. Claim now before they expire ",E,"."]})]}),(0,i.jsx)(N.Row,{children:(0,i.jsx)(N.InfiniteList,{dataLength:J.length,hasMore:!1,loadMore:w.ZT,loading:c,skeleton:null,children:J.map((function(e,s){return(0,i.jsx)(q,{quest:e,className:o()({"mt-3":0!==s}),handleClaimQuest:z,loadingClaimAll:_,isPrimary:G},s)}))})})]})}):null,(0,i.jsxs)(N.Row,{className:"mb-5",children:[b?b():(0,i.jsxs)(N.Row,{className:"mb-3",children:[(0,i.jsx)(N.Text,{heading:P?600:400,children:"My Challenges"}),E?(0,i.jsxs)(N.Text,{className:"mt-3",children:["Refresh ",E,"."]}):null]}),(0,i.jsx)(N.Row,{children:(0,i.jsx)(N.InfiniteList,{dataLength:U.length,emptyState:(0,i.jsx)(N.Row,{children:(0,i.jsx)(N.Text,{bold:!0,className:"text-center",children:"You've completed all your weekly quests!"})}),hasMore:!1,loadMore:w.ZT,loading:c,skeleton:null,children:U.map((function(e,s){return(0,i.jsx)(q,{quest:e,className:o()({"mt-3":0!==s}),handleClaimQuest:z},s)}))})})]}),(0,i.jsx)(T,{fire:Q})]})}}}]);
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.