{"version":3,"sources":["common/dailyCredits/dailyCredit.jsx"],"names":["lottieRef","createRef","withRouter","connect","state","getUser","dispatch","loadProfileData","callback","loadProfile","redeemCreditApi","redeemCredit","_ref","router","error","setError","useState","loading","setLoading","proccessed","setProccessed","showModal","setShowModal","showConfetti","setShowConfetti","credits","setCredits","themeMode","getCookie","profile","useEffect","dailyCreditAvailable","res","status","_jsxs","_Fragment","children","_jsx","Modal","className","concat","id","dialogClassName","centered","show","onHide","contentClassName","src","process","alt","style","zIndex","Lottie","background","speed","loop","play","ref","animationData","ConfettiJSON","href","onClick","e","preventDefault","data","rewardToken","setTimeout","message","ErrorPopup","title"],"mappings":"6n1HAAA,4FAYA,MAAMA,EAAYC,oBAAU,MAgLbC,sBAAWC,aAHDC,IAAK,CAC5BC,QAASA,YAAQD,OALSE,IAAQ,CAClCC,gBAAkBC,GAAaF,EAASG,YAAYD,IACpDE,gBAAkBF,GAAaF,EAASK,YAAaH,OAK7BL,EAzKNS,IAA4D,IAA3D,QAAEP,EAAO,gBAAEK,EAAe,gBAAEH,EAAe,OAAEM,GAAQD,EACxE,MAAOE,EAAOC,GAAYC,oBAAS,IAC5BC,EAASC,GAAcF,oBAAS,IAChCG,EAAYC,GAAiBJ,oBAAS,IACtCK,EAAWC,GAAgBN,oBAAS,IACpCO,EAAcC,GAAmBR,oBAAS,IAC1CS,EAASC,GAAcV,mBAAS,GACjCW,EAAYC,YAAU,cAEtB,QAAEC,GAAYxB,EAkCpB,OAZAyB,qBAAU,KACJD,EAAQE,uBAAyBZ,GACnCZ,GAAiByB,IACXA,EAAIC,MAGN,GAGN,GACC,CAACJ,EAAQE,uBAGVG,eAAAC,WAAA,CAAAC,SAAA,CACEC,cAACC,IAAK,CACJC,UAAS,2BAAAC,OAA2C,SAAdb,GAAwB,cAC9Dc,GAAG,sBACHC,gBAAgB,WAChBC,UAAQ,EACRC,KAAMvB,EACNwB,OAAQ,KACRC,iBAAiB,wBAAuBV,SAExCC,cAAAF,WAAA,CAAAC,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KE,UAAU,iDAAgDH,SAC7DC,cAAA,QAAME,UAAU,8BAElBF,cAAA,OAAKE,UAAU,gBAAeH,SAAE,kBAGlCC,cAAA,OAAKE,UAAU,qCAAqCW,MAAO,CAAEC,OAAQ,QAASf,SAC1EjB,EAYAkB,cAAA,KACEuB,KAAK,KACLC,QAAUC,IACRA,EAAEC,iBACFzC,GAAa,EAAM,EAErBiB,UAAU,uDAAsDH,SACjE,YAlBDC,cAAA,KACEuB,KAAK,KACLC,QAAUC,IACRA,EAAEC,iBAvHxB7C,GAAW,GACXR,GAAiBsB,IACfd,GAAW,GACQ,MAAfc,EAAIC,QACNP,EAAWM,EAAIgC,KAAKjC,qBAAqBkC,aACzC7C,GAAc,GACd8C,YAAW,KACT1C,GAAgB,EAAK,GACpB,KACH0C,YAAW,KACT1C,GAAgB,EAAM,GACrB,MACHjB,KAEAQ,EAASiB,EAAIgC,KAAKG,QACpB,GAyGyC,EAEvB5B,UAAU,uDAAsDH,SACjE,kCAsBjBC,cAAC+B,UAAU,CAACtD,MAAOA,EAAOC,SAAUA,EAAUsD,MAAK,0DAClD,I","file":"static/js/32.bdaaeb38.chunk.js","sourcesContent":["// Buy Credits Modal\nimport React, { useEffect, useState } from \"react\";\nimport { Modal } from \"react-bootstrap\";\nimport { getCookie } from \"../../utils/cookiesUtilities\";\nimport { getUser, loadProfile, redeemCredit } from \"../../store/user\";\nimport { withRouter } from \"../../utils/withRouter\";\nimport { connect } from \"react-redux\";\nimport ErrorPopup from \"../errorPopup\";\nimport ConfettiJSON from \"../../include/confetti.json\";\nimport Lottie from \"react-lottie-player\";\nimport { createRef } from \"react\";\n\nconst lottieRef = createRef(null);\n\n//Images\nconst image01 = process.env.REACT_APP_WEBSITE_ASSETS_URL + \"images/credit-icon.svg\";\nconst image02 = process.env.REACT_APP_WEBSITE_ASSETS_URL + \"images/crediticon.png\";\nconst image03 = process.env.REACT_APP_WEBSITE_ASSETS_URL + \"images/contest-1.png\";\n\nconst DailyCredit = ({ getUser, redeemCreditApi, loadProfileData, router }) => {\n const [error, setError] = useState(false);\n const [loading, setLoading] = useState(false);\n const [proccessed, setProccessed] = useState(false);\n const [showModal, setShowModal] = useState(false);\n const [showConfetti, setShowConfetti] = useState(false);\n const [credits, setCredits] = useState(0);\n const themeMode = getCookie(\"themeMode\");\n\n const { profile } = getUser;\n\n const redeemCreditHandler = () => {\n setLoading(true);\n redeemCreditApi((res) => {\n setLoading(false);\n if (res.status === 200) {\n setCredits(res.data.dailyCreditAvailable.rewardToken);\n setProccessed(true);\n setTimeout(() => {\n setShowConfetti(true);\n }, 500);\n setTimeout(() => {\n setShowConfetti(false);\n }, 3500);\n loadProfileData();\n } else {\n setError(res.data.message);\n }\n });\n };\n\n useEffect(() => {\n if (profile.dailyCreditAvailable && !proccessed) {\n loadProfileData((res) => {\n if (res.status === 200) {\n // if (res.data.dailyCreditAvailable) {\n // setShowModal(true);\n // }\n }\n });\n }\n }, [profile.dailyCreditAvailable]);\n\n return (\n <>\n \n <>\n
\n {!proccessed ? (\n
\n
DAILY CREDITS RENEWAL
\n
COLLECT FREE CREDITS EVERY 24 HOURS
\n
\n ) : (\n
\n
YOU’RE READY TO WIN
\n
YOUR CREDITS HAVE BEEN DELIVERED
\n
\n )}\n\n
\n
\n \n
\n
\n
\n FREE CREDITS\n
\n
\n
\n \"\"\n
\n
\n
\n
\n
\n \"\" {profile.dailyCreditAvailable || credits} CREDITS\n
\n
\n
\n
\n
\n

\n {!proccessed\n ? \"Collect your credits and play to win! You’re on your way to getting awesome stuff!\"\n : \"Time to start playing - your credits don’t expire but they do renew everyday. Don’t forget to stockup every 24 Hours!\"}\n

\n
\n {showConfetti && (\n \n \n
\n )}\n {loading ? (\n
\n
\n \n
\n
{\"Loading...\"}
\n
\n ) : (\n
\n {!proccessed ? (\n {\n e.preventDefault();\n redeemCreditHandler();\n }}\n className=\"rounded-pill gradient-button-btn common-btn-gradient\"\n >\n COLLECT CREDITS\n \n ) : (\n {\n e.preventDefault();\n setShowModal(false);\n }}\n className=\"rounded-pill gradient-button-btn common-btn-gradient\"\n >\n DISMISS\n \n )}\n
\n )}\n
\n \n \n \n \n Something went wrong`} />\n \n );\n};\n\nconst mapDispatchToProps = (dispatch) => ({\n loadProfileData: (callback) => dispatch(loadProfile(callback)),\n redeemCreditApi: (callback) => dispatch(redeemCredit(callback)),\n});\nconst mapStateToProps = (state) => ({\n getUser: getUser(state),\n});\nexport default withRouter(connect(mapStateToProps, mapDispatchToProps)(DailyCredit));\n"],"sourceRoot":""}