Ihackedyourmom / github-slideshow

A robot powered training repository :robot:
https://lab.github.com/githubtraining/introduction-to-github
MIT License
0 stars 0 forks source link

Getting Started with GitHub #1

Closed github-learning-lab[bot] closed 3 years ago

github-learning-lab[bot] commented 3 years ago

:wave: Welcome to GitHub Learning Lab's "Introduction to GitHub"

To get started, I’ll guide you through some important first steps in coding and collaborating on GitHub.

:point_down: This arrow means you can expand the window! Click on them throughout the course to find more information.

What is GitHub?
## What is GitHub? I'm glad you asked! Many people come to GitHub because they want to contribute to open source [:book:](https://help.github.com/articles/github-glossary/#open-source) projects, or they're invited by teammates or classmates who use it for their projects. Why do people use GitHub for these projects? **At its heart, GitHub is a collaboration platform.** From software to legal documents, you can count on GitHub to help you do your best work with the collaboration and security tools your team needs. With GitHub, you can keep projects completely private, invite the world to collaborate, and streamline every step of your project. **GitHub is also a powerful version control tool.** GitHub uses Git [:book:](https://help.github.com/articles/github-glossary/#git), the most popular open source version control software, to track every contribution and contributor [:book:](https://help.github.com/articles/github-glossary/#contributor) to your project--so you know exactly where every line of code came from. **GitHub helps people do much more.** GitHub is used to build some of the most advanced technologies in the world. Whether you're visualizing data or building a new game, there's a whole community and set of tools on GitHub that can get you to the next step. This course starts with the basics, but we'll dig into the rest later! :tv: [Video: What is GitHub?](https://www.youtube.com/watch?v=w3jLJU7DT5E)

Exploring a GitHub repository
## Exploring a GitHub repository :tv: [Video: Exploring a repository](https://www.youtube.com/watch?v=R8OAwrcMlRw) ### More features The video covered some of the most commonly-used features. Here are a few other items you can find in GitHub repositories: - Project boards: Create Kanban-style task tracking board within GitHub - Wiki: Create and store relevant project documentation - Insights: View a drop-down menu that contains links to analytics tools for your repository including: - Pulse: Find information about the work that has been completed and the work that’s in-progress in this project dashboard - Graphs: Graphs provide a more granular view of the repository activity including who contributed to the repository, who forked it, and when they completed the work ### Special Files In the video you learned about a special file called the README.md. Here are a few other special files you can add to your repositories: - CONTRIBUTING.md: The `CONTRIBUTING.md` is used to describe the process for contributing to the repository. A link to the `CONTRIBUTING.md` file is shown anytime someone creates a new issue or pull request. - ISSUE_TEMPLATE.md: The `ISSUE_TEMPLATE.md` is another file you can use to pre-populate the body of an issue. For example, if you always need the same types of information for bug reports, include it in the issue template, and every new issue will be opened with your recommended starter text.
### Using issues This is an issue [:book:](https://help.github.com/articles/github-glossary/#issue): a place where you can have conversations about bugs in your code, code review, and just about anything else. Issue titles are like email subject lines. They tell your collaborators what the issue is about at a glance. For example, the title of this issue is Getting Started with GitHub.
Using GitHub Issues ## Using GitHub issues Issues are used to discuss ideas, enhancements, tasks, and bugs. They make collaboration easier by: - Providing everyone (even future team members) with the complete story in one place - Allowing you to cross-link to other issues and pull requests [:book:](https://help.github.com/articles/github-glossary/#pull-request) - Creating a single, comprehensive record of how and why you made certain decisions - Allowing you to easily pull the right people and teams into a conversation with @-mentions :tv: [Video: Using issues](https://www.youtube.com/watch?v=Zhj46r5D0nQ)
Managing notifications
## Managing notifications :tv: [Video: Watching, notifications, stars, and explore](https://www.youtube.com/watch?v=ocQldxF7fMY) Once you've commented on an issue or pull request, you'll start receiving email notifications when there's activity in the thread. ### How to silence or unmute specific conversations 1. Go to the issue or pull request 2. Under _"Notifications"_, click the **Unsubscribe** button on the right to silence notifications or **Subscribe** to unmute them You'll see a short description that explains your current notification status. ### How to customize notifications in Settings 1. Click your profile icon 2. Click **Settings** 3. Click **Notifications** from the menu on the left and [adjust your notification preferences](https://help.github.com/articles/managing-notification-delivery-methods/) ### Repository notification options * **Watch**: You'll receive a notification when a new issue, pull request or comment is posted, and when an issue is closed or a pull request is merged * **Not watching**: You'll no longer receive notifications unless you're @-mentioned * **Ignore**: You'll no longer receive any notifications from the repository ### How to review notifications for the repositories you're watching 1. Click your profile icon 2. Click **Settings** 3. Click **Notification** from the menu on the left 4. Click on the [things you’re watching](https://github.com/watching) link 5. Select the **Watching** tab 6. Click the **Unwatch** button to disable notifications, or **Watch** to enable them

Keep reading below to find your first task

github-learning-lab[bot] commented 3 years ago

Step 1: Assign yourself

Unassigned issues don't have owners to look after them. When you’re assigned to an issue or pull request, it tells repository visitors and contributors that you'll be facilitating the conversation or task :muscle:.

:keyboard: Activity

  1. On the right side of the screen, under the "Assignees" section, click the gear icon and select yourself

For a printable version of the steps in this course, check out the Quick Reference Guide.


I'll respond when I detect you've assigned yourself to this issue.

Sometimes I respond too fast for the page to update! If you perform an expected action and don't see a response from me, wait a few seconds and refresh the page for your next steps.

Ihackedyourmom commented 3 years ago

I hacked into this website i will take the website down if u do not take it down yourself I can hack your bank accout

Ihackedyourmom commented 3 years ago

i will give proof

Ihackedyourmom commented 3 years ago

!function(e){function t(t){for(var s,r,i=t[0],c=t[1],l=t[2],m=0,f=[];m<i.length;m++)r=i[m],Object.prototype.hasOwnProperty.call(o,r)&&o[r]&&f.push(o[r][0]),o[r]=0;for(s in c)Object.prototype.hasOwnProperty.call(c,s)&&(e[s]=c[s]);for(u&&u(t);f.length;)f.shift()();return n.push.apply(n,l||[]),a()}function a(){for(var e,t=0;t<n.length;t++){for(var a=n[t],s=!0,i=1;i<a.length;i++){var c=a[i];0!==o[c]&&(s=!1)}s&&(n.splice(t--,1),e=r(r.s=a[0]))}return e}var s={},o={11:0},n=[];function r(t){if(s[t])return s[t].exports;var a=s[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=s,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)r.d(a,s,function(t){return e[t]}.bind(null,s));return a},r.n=function(e){var t=e&&e.esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/";var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var u=c;n.push([15,21,18,17,23,26,37,32,38,33,28,20,40,29,31,25,24,30,22,42,34,27,41,19,35,39,36,0,1,4,9,15,13,10,8,5,7,6,3,12,14,16,2]),a()}({"+42v":function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".stylesstatContainer_3mPyZ-camelCase{display:flex;flex-direction:row;align-items:center;height:50px;margin-right:10px}.styles_toysText3J5Jz-camelCase{font-size:28px;font-weight:700;color:#3a3a3a;font-family:Nunito,sans-serif;text-align:right;margin-right:5px}.stylestoyImage26l-4-camelCase{height:55%;width:auto;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}",""]),t.locals={statContainer:"stylesstatContainer3mPyZ-camelCase",toysText:"stylestoysText3J5Jz-camelCase",toyImage:"stylestoyImage26l-4-camelCase"}},"+JpI":function(e,t,a){var s=a("pZkE");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},"+KYW":function(e,t,a){var s=a("v83B");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},"/qww":function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("/MKj"),r=a("mf+E"),i=a("wIs1"),c=a("b6Qr"),l=a("FLf1"),u=a.n(l),m=a("iQ+n"),f=a("GIcp"),p=a.n(f),=a("2g2H"),d=a("SdQT");function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=v(e);if(t){var o=v(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return g(this,a)}}function g(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto||Object.getPrototypeOf(e)})(e)}var C=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(i,e);var t,a,s,n=b(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=n.call(this,e)).state={},t.here=!0,t}return t=i,(a=[{key:"componentDidMount",value:function(){}},{key:"componentWillUnmount",value:function(){this.here=!1}},{key:"render",value:function(){var e=!1;if("undefined"!=typeof window&&localStorage.getItem("token")){var t=localStorage.getItem("token").split(" ");2===t.length?u.a.verify(t[1],"a809c7b3f",(function(t,a){e=!(!t&&a&&["Bot"].includes(a.name))})):e=!0}else e=!0;return e?o.a.createElement(r.a,{to:"/login"}):o.a.createElement("div",{className:c.isMobile?p.a.mBody:p.a.body},o.a.createElement(m.a,{title:"Test Blooket",desc:"Pls don't come here."}),o.a.createElement(.a,{name:"Ben",noRight:!0}))}}])&&y(t.prototype,a),s&&y(t,s),i}(o.a.Component);t.a=Object(i.a)(Object(n.b)()(Object(d.d)(C)))},"05xZ":function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".stylesquestionContainer3Oyfn-camelCase{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#292929}",""]),t.locals={questionContainer:"stylesquestionContainer3Oyfn-camelCase"}},"11cj":function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".stylesstageText1SjJ9-camelCase{font-size:28px;font-weight:700;margin-right:10px;color:#3a3a3a;line-height:50px;font-family:Nunito,sans-serif;text-align:right;overflow:hidden}",""]),t.locals={stageText:"stylesstageText1SjJ9-camelCase"}},"3DIO":function(e,t,a){var s=a("3Gwu");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},"3GV5":function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("wIs1"),u=a("mLw1"),m=a("FLf1"),f=a.n(m),p=a("b6Qr"),=a("vDqi"),d=a.n(),h=a("Tiit"),y=a("pMbe"),w=a("vBtp"),b=a.n(w),g=a("GIcp"),v=a.n(g),C=a("dJL0"),x=a("iQ+n"),k=a("ZENw"),T=a("bpVs");function S(e){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=B(e);if(t){var o=B(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return O(this,a)}}function O(e,t){return!t||"object"!==S(t)&&"function"!=typeof t?j(e):t}function j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto||Object.getPrototypeOf(e)})(e)}var z=function(e){return o.a.createElement("div",{className:b.a.stageText},33===e.stagesCleared?"You Won!":"".concat(e.stagesCleared," ").concat(1===e.stagesCleared?"Stage":"Stages"))},R=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&I(e,t)}(r,e);var t,a,s,n=N(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).state={ready:!1,numCorrect:0,numQuestions:0,standings:[],plus:!1,stagesCleared:0,message:"",name:""},t.here=!0,t.stats={},t.saveStats=t.saveStats.bind(j(t)),t}return t=r,(a=[{key:"componentDidMount",value:function(){var e=this;if(this.props.tower&&"final"===this.props.tower.stage){this.props.tower&&this.props.tower.resultId&&d.a.put("/api/results",{id:this.props.tower.resultId,data:{corrects:this.props.tower.corrects,incorrects:this.props.tower.incorrects,stage:this.props.tower.numNodes,alive:!1}}).catch((function(e){return console.error(e)}));var t=0,a=0;Object.values(this.props.tower.corrects).forEach((function(e){t+=e,a+=e})),Object.values(this.props.tower.incorrects).forEach((function(e){a+=e}));var s=Math.max(this.props.tower.numNodes-1,0),o=34-s,n="Chick",r=0;this.props.tower.cards.forEach((function(e){var t=e.strength+e.charisma+e.wisdom;t>r&&(r=t,n=e.blook)}));var i=this.props.client&&this.props.client.name?this.props.client.name:"You";if(this.stats={place:o,stagesCleared:s,correctAnswers:t,blookUsed:n,nameUsed:i},"undefined"!=typeof window&&localStorage.getItem("token")){var c=localStorage.getItem("token").split(" ");2===c.length&&f.a.verify(c[1],"a809c7b3f",(function(t,a){t||(e.saveStats(a.name,(function(){})),d.a.put("/api/users/plan",{name:a.name,stripeId:a.stripe}).then((function(t){e.here&&e.setState({ready:!0,name:a.name,plus:"Starter"!==t.data.plan||e.props.client&&e.props.client.plus})})).catch((function(e){console.error(e)})),e.props.tower.towerId&&(d.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,d.a.delete("/api/towers",{params:{name:a.name,id:e.props.tower.towerId}}).catch((function(e){console.error(e)}))))}))}this.setState({numCorrect:t,numQuestions:a,stagesCleared:s,message:Object(T.a)((o-1)/33),ready:!this.props.tower.towerId||this.state.ready,standings:[{name:i,blook:n,place:o,stagesCleared:s}]})}}},{key:"componentWillUnmount",value:function(){this.props.deleteTower(),this.props.deleteClient(),this.here=!1}},{key:"saveStats",value:function(e,t){d.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,d.a.put("/api/users/towerstats",{name:e,place:this.stats.place,stagesCleared:this.stats.stagesCleared,blookUsed:this.stats.blookUsed,nameUsed:this.stats.nameUsed,correctAnswers:this.stats.correctAnswers}).then((function(){t()})).catch((function(e){console.error(e)}))}},{key:"render",value:function(){var e=this;if(this.props.tower&&this.props.tower.resultId)this.redirect=!1;else if("undefined"!=typeof window&&localStorage.getItem("token")){var t=localStorage.getItem("token").split(" ");2===t.length?f.a.verify(t[1],"a809c7b3f",(function(t){e.redirect=!!t})):this.redirect=!0}else this.redirect=!0;if(this.redirect||!this.props.tower||"final"!==this.props.tower.stage)return o.a.createElement(u.a,{to:"/login"});var a=this.props.tower&&this.props.tower.resultId;return o.a.createElement("div",{className:p.isMobile?v.a.mBody:v.a.body,style:{backgroundColor:"#292929"}},o.a.createElement(x.a,{title:"Play Tower of Doom | Blooket",desc:"Ascend the feared Tower of Doom by answering questions and building a deck to defeat evil Blooks on your way to the top."}),o.a.createElement(C.a,{noRight:!a,rightText:"Play Again",rightLink:"/play"}),this.state.ready?o.a.createElement(k.a,{standings:this.state.standings,name:this.props.client&&this.props.client.name?this.props.client.name:"You",numCorrect:this.state.numCorrect,numQuestions:this.state.numQuestions,username:this.state.name,plus:this.state.plus,myStat:33===this.state.stagesCleared?"You Won!":"Cleared ".concat(this.state.stagesCleared," ").concat(1===this.state.stagesCleared?"Stage":"Stages"),saveStats:this.saveStats,renderStandingStat:z,renderStats:function(){},customMessage:this.state.message,tokenMultiplier:.35}):null)}}])&&E(t.prototype,a),s&&E(t,s),r}(o.a.Component);R.propTypes={tower:c.a.object,client:c.a.object,deleteTower:c.a.func.isRequired,deleteClient:c.a.func.isRequired};t.a=Object(l.a)(Object(r.b)((function(e){return{tower:e.towers.tower,client:e.clients.client}}),(function(e){return Object(n.b)({deleteTower:h.a,deleteClient:y.a},e)}))(R))},"3Gwu":function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".stylesfeedbackContainer3xVK8-camelCase{position:absolute;top:0;left:0;width:100%;height:100%}.stylesfeedbackContainer3xVK8-camelCase,.styleswinterBackgroundMZ3LX-camelCase{background-image:linear-gradient(#31aae0,#bdf)}.styleswinterBackgroundMZ3LX-camelCase{overflow:hidden}.stylesheader1v1iz-camelCase{color:#fff;text-shadow:2px 2px 8px grey;text-align:center;top:10%;left:50%;transform:translateX(-50%);width:640px;font-family:Titan One,sans-serif;font-size:52px}.styleschoice3rOIi-camelCase,.stylesheader1v1iz-camelCase{position:absolute}.styleschoice3rOIi-camelCase{width:250px;height:250px;background-color:#f23941;top:45%;border-radius:50%;box-shadow:0 0 8px 3px rgba(0,0,0,.2);display:flex;flex-direction:column;justify-content:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;transition:.2s}.styleschoice3rOIi-camelCase:focus,.styleschoice3rOIi-camelCase:hover{transform:scale(.96)}.styleschoiceInside1exMC-camelCase{width:220px;height:220px;background-color:#f23941;border-radius:50%;border:5px solid #fff;display:flex;flex-direction:column;justify-content:center;align-items:center}.styleschoiceLeft3rcEW-camelCase{right:calc(50% + 50px)}.styleschoiceRightyg21f-camelCase{left:calc(50% + 50px)}.styleschoiceBlookmkVgP-camelCase{height:85px;width:74px;margin-bottom:10px}.styleschoiceText1siIC-camelCase{font-family:Nunito,sans-serif;font-size:26px;line-height:28px;color:#fff;font-weight:700;text-align:center;width:75%}.styleschoiceDuck2wqRY-camelCase{height:24px}.stylesmountainsBackground3XPzH-camelCase{z-index:-1;bottom:0}.stylesmountainsBackground3XPzH-camelCase,.stylesplowSnow7FChz-camelCase{position:absolute;left:0;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stylesplowSnow7FChz-camelCase{top:0;height:100%;background-color:#fff;box-shadow:0 0 8px 3px rgba(0,0,0,.2);z-index:16;-webkit-animation:stylesplowSnow7FChz-camelCase 8s linear 0s forwards;animation:stylesplowSnow7FChz-camelCase 8s linear 0s forwards}@-webkit-keyframes stylesplowSnow7FChz-camelCase{0%{transform:translateY(100%)}25%{transform:translate(0)}to{transform:translate(140%)}}@keyframes stylesplowSnow7FChz-camelCase{0%{transform:translateY(100%)}25%{transform:translate(0)}to{transform:translate(140%)}}.stylesplow2Z6UE-camelCase{position:absolute;top:50%;right:0;font-size:30vw;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#ff751a;z-index:16;transform:translate(100vw,-50%);pointer-events:none;-webkit-animation:stylesplow2Z6UE-camelCase 6s linear 2s forwards;animation:stylesplow2Z6UE-camelCase 6s linear 2s forwards}@-webkit-keyframes stylesplow2Z6UE-camelCase{0%{transform:translate(-100vw,-50%)}to{transform:translate(40vw,-50%)}}@keyframes stylesplow2Z6UE-camelCase{0%{transform:translate(-100vw,-50%)}to{transform:translate(40vw,-50%)}}.stylesplowBlook3JBzy-camelCase{position:absolute;top:calc(50% - 6vw);right:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:15;width:10vw;transform:translate(100vw,-50%);pointer-events:none;-webkit-animation:stylesplowBlook3JBzy-camelCase 6s linear 2s forwards;animation:stylesplowBlook3JBzy-camelCase 6s linear 2s forwards}@-webkit-keyframes stylesplowBlook3JBzy-camelCase{0%{transform:translate(-116.5vw,-50%)}to{transform:translate(23.5vw,-50%)}}@keyframes stylesplowBlook3JBzy-camelCase{0%{transform:translate(-116.5vw,-50%)}to{transform:translate(23.5vw,-50%)}}.stylescanada12sxyq-camelCase{left:0;width:33.3%;background-color:#eb2d37}.stylescanada12sxyq-camelCase,.stylescanada22JKra-camelCase{position:absolute;top:0;height:100%;opacity:.4;z-index:25;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.stylescanada22JKra-camelCase{left:33.3%;width:33.4%;background-color:#fff}.stylescanada32rH5i-camelCase{top:0;right:0;width:33.3%;height:100%;background-color:#eb2d37;z-index:25}.stylescanada32rH5i-camelCase,.stylescanadaIcon3rLt9-camelCase{position:absolute;opacity:.4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.stylescanadaIcon3rLt9-camelCase{top:50%;left:50%;transform:translate(-50%,-50%);font-size:17vw;color:#eb2d37;z-index:26}.styleswindmd2wr-camelCase{position:absolute;top:0;left:0;height:100%;width:100%;-webkit-animation:stylesblow3vENr-camelCase 5s linear 2s forwards;animation:stylesblow3vENr-camelCase 5s linear 2s forwards}@-webkit-keyframes stylesblow3vENr-camelCase{0%{transform:translate(0)}49.5%{transform:translate(100%);opacity:1}49.75%{transform:translate(100%);opacity:0}49.85%{transform:translate(100%,100%);opacity:0}50.15%{transform:translate(-100%,100%);opacity:0}50.25%{transform:translate(-100%);opacity:0}50.5%{transform:translate(-100%);opacity:1}to{transform:translate(0)}}@keyframes stylesblow3vENr-camelCase{0%{transform:translate(0)}49.5%{transform:translate(100%);opacity:1}49.75%{transform:translate(100%);opacity:0}49.85%{transform:translate(100%,100%);opacity:0}50.15%{transform:translate(-100%,100%);opacity:0}50.25%{transform:translate(-100%);opacity:0}50.5%{transform:translate(-100%);opacity:1}to{transform:translate(0)}}.stylestreeContainer2KQ2a-camelCase{position:absolute;top:50vw;left:50vw;height:20vw;width:20vw;margin-left:-10vw;margin-top:-10vw;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;cursor:pointer;z-index:12;transition:.5s}.stylestreeContainer2KQ2a-camelCase:hover{transform:scale(1.03)}.stylesplayerWrapper2-VFL-camelCase,.stylestreeImg___1r_wI-camelCase{height:100%;width:100%}.stylesplayerWrapper_2-VFL-camelCase{display:flex;flex-flow:column;position:absolute;top:0;left:0;overflow-x:hidden;-webkit-animation:styles_fadeIn3xl7O-camelCase .2s;animation:stylesfadeIn3xl7O-camelCase .2s}.stylesplayerHeader2J6XY-camelCase{font-size:48px;margin:30px auto 0;text-shadow:2px 2px 8px grey;color:#fff;width:90%;text-align:center;font-family:Titan One,sans-serif;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stylesplayerHolder3xkBQ-camelCase{display:flex;flex-flow:row wrap;justify-content:center;width:80%;margin:30px auto;-webkit-animation:stylesfadeIn3xl7O-camelCase .2s;animation:stylesfadeIn3xl7O-camelCase .2s}@-webkit-keyframes stylesfadeIn3xl7O-camelCase{0%{opacity:0}to{opacity:1}}@keyframes stylesfadeIn3xl7O-camelCase{0%{opacity:0}to{opacity:1}}.stylesnoPlayers1Gsgj-camelCase{width:220px;height:80px;line-height:60px;background-color:#eb2d37;border-radius:5px;box-shadow:5px 5px 0 rgba(0,0,0,.2);box-sizing:border-box;padding:7px;font-family:Nunito,sans-serif;font-weight:700;cursor:pointer;text-align:center;text-decoration:none;display:flex;justify-content:center;align-items:center;outline:none;font-size:30px;color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;top:calc(50% - 30px);left:calc(50% - 100px);transition:.2s}.stylesnoPlayers1Gsgj-camelCase:hover{transform:scale(.95)}.stylesplayerInside1KfGH-camelCase{border:5px solid #fff;width:100%;flex-direction:row}.stylesplayerContainer3KJxS-camelCase,.stylesplayerInside1KfGH-camelCase{background-color:#eb2d37;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.stylesplayerContainer3KJxS-camelCase{color:#fff;border-radius:5px;box-shadow:5px 5px 0 rgba(0,0,0,.2);font-family:Nunito,sans-serif;padding:7px;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;margin:10px;min-width:295px;transition:.2s}.stylesplayerContainer3KJxS-camelCase:focus,.stylesplayerContainer3KJxS-camelCase:hover{transform:scale(.97)}.stylesplayerBlook1uY7--camelCase{width:52px;margin:auto 5px auto 10px}.stylesplayerColumn3zfK7-camelCase{display:flex;flex-direction:column;flex-grow:1;margin:2.5px 10px}.stylesplayerText3gYo--camelCase{font-family:Nunito,sans-serif;word-wrap:break-word;font-weight:700;font-size:28px;margin:2.5px 10px 2.5px 0;line-height:30px}.stylestoyRow3h1k9-camelCase{height:35px;display:flex;flex-direction:row;align-items:center;justify-content:flex-end}.stylesplayerToys1B13a-camelCase{font-family:Nunito,sans-serif;font-size:26px}.stylestoyIcon2lHbQ-camelCase{height:60%;width:auto;margin:auto 5px auto 10px}.stylessabotageContainerNENAN-camelCase{position:absolute;top:70px;left:15px;background-color:rgba(0,0,0,.4);border-radius:5px;padding:7px 10px;font-size:28px;font-weight:700;font-family:Nunito,sans-serif;color:#fff;display:flex;flex-direction:row;align-items:center;-webkit-animation:stylessabotageFade10Dnc-camelCase 6s linear;animation:stylessabotageFade10Dnc-camelCase 6s linear}@-webkit-keyframes stylessabotageFade10Dnc-camelCase{0%{opacity:0}5%{opacity:1}95%{opacity:1}to{opacity:0}}@keyframes stylessabotageFade10Dnc-camelCase{0%{opacity:0}5%{opacity:1}95%{opacity:1}to{opacity:0}}.stylessabotageBlook3Cle0-camelCase{height:40px;width:35px;margin-right:7px}@media only screen and (max-width:650px){.stylesheader1v1iz-camelCase{top:5%;width:300px}.stylesheader1v1iz-camelCase,.stylesplayerHeader2J6XY-camelCase{font-size:36px;line-height:38px}.styleschoice3rOIi-camelCase{width:160px;height:160px;top:45%}.styleschoice3rOIi-camelCase:focus,.styleschoice3rOIi-camelCase:hover{transform:scale(1)}.styleschoiceInside1exMC-camelCase{width:140px;height:140px;border:5px solid #fff}.styleschoiceLeft3rcEW-camelCase{right:calc(50% - 20px);bottom:calc(50% - 60px);top:auto}.styleschoiceRightyg21f-camelCase{left:calc(50% - 20px);top:calc(50% + 40px)}.styleschoiceBlookmkVgP-camelCase{height:56px;width:49px;margin-bottom:6px}.styleschoiceText1siIC-camelCase{font-size:18px;line-height:20px;font-weight:700;width:75%}.styleschoiceDuck2wqRY-camelCase{height:18px}.stylestreeContainer2KQ2a-camelCase{height:30vw;width:30vw;margin-left:-15vw;margin-top:-15vw}.stylesplayerContainer3KJxS-camelCase{width:100%}.stylesnoPlayers1Gsgj-camelCase:hover,.stylesplayerContainer3KJxS-camelCase:focus,.stylesplayerContainer3KJxS-camelCase:hover{transform:scale(1)}}",""]),t.locals={feedbackContainer:"stylesfeedbackContainer3xVK8-camelCase",winterBackground:"styleswinterBackgroundMZ3LX-camelCase",header:"stylesheader1v1iz-camelCase",choice:"styleschoice3rOIi-camelCase",choiceInside:"styleschoiceInside1exMC-camelCase",choiceLeft:"styleschoiceLeft3rcEW-camelCase",choiceRight:"styleschoiceRightyg21f-camelCase",choiceBlook:"styleschoiceBlookmkVgP-camelCase",choiceText:"styleschoiceText1siIC-camelCase",choiceDuck:"styleschoiceDuck2wqRY-camelCase",mountainsBackground:"stylesmountainsBackground3XPzH-camelCase",plowSnow:"stylesplowSnow7FChz-camelCase",plow:"stylesplow2Z6UE-camelCase",plowBlook:"stylesplowBlook3JBzy-camelCase",canada1:"stylescanada12sxyq-camelCase",canada2:"stylescanada22JKra-camelCase",canada3:"stylescanada32rH5i-camelCase",canadaIcon:"stylescanadaIcon3rLt9-camelCase",wind:"styleswindmd2wr-camelCase",blow:"stylesblow3vENr-camelCase",treeContainer:"stylestreeContainer2KQ2a-camelCase",playerWrapper:"stylesplayerWrapper2-VFL-camelCase",treeImg:"stylestreeImg___1r_wI-camelCase",fadeIn:"stylesfadeIn_3xl7O-camelCase",playerHeader:"styles_playerHeader2J6XY-camelCase",playerHolder:"stylesplayerHolder3xkBQ-camelCase",noPlayers:"stylesnoPlayers1Gsgj-camelCase",playerInside:"stylesplayerInside1KfGH-camelCase",playerContainer:"stylesplayerContainer3KJxS-camelCase",playerBlook:"stylesplayerBlook1uY7--camelCase",playerColumn:"stylesplayerColumn3zfK7-camelCase",playerText:"stylesplayerText3gYo--camelCase",toyRow:"stylestoyRow3h1k9-camelCase",playerToys:"stylesplayerToys1B13a-camelCase",toyIcon:"stylestoyIcon2lHbQ-camelCase",sabotageContainer:"stylessabotageContainerNENAN-camelCase",sabotageFade:"stylessabotageFade10Dnc-camelCase",sabotageBlook:"stylessabotageBlook__3Cle0-camelCase"}},"4CQy":function(e,t,a){"use strict";a.d(t,"a",(function(){return s})),a.d(t,"b",(function(){return o}));var s={"Oh Canada":"c",Blizzard:"b","Fog Spell":"f","Dark & Dusk":"d","Howling Wind":"w","Gift Time!":"g",TREES:"t","Snow Plow":"s","Use The Force":"fr"},o={c:"Oh Canada",b:"Blizzard",f:"Fog Spell",d:"Dark & Dusk",w:"Howling Wind",g:"Gift Time!",t:"TREES",s:"Snow Plow",fr:"Use The Force"}},"4MCU":function(e,t,a){"use strict";a.d(t,"a",(function(){return o})),a.d(t,"c",(function(){return n})),a.d(t,"g",(function(){return r})),a.d(t,"d",(function(){return i})),a.d(t,"f",(function(){return c})),a.d(t,"b",(function(){return l})),a.d(t,"e",(function(){return u}));var s=a("SLYh");function o(e,t,a){return{type:s.a,corrects:e,incorrects:t,freeQuestions:a}}function n(e){return{type:s.c,cards:e}}function r(e){return{type:s.g,stage:e}}function i(e){return{type:s.d,coins:e}}function c(e){return{type:s.f,life:e}}function l(e){return{type:s.b,artifacts:e}}function u(e){return{type:s.e,instruct:e}}},"4otw":function(e,t,a){"use strict";a.d(t,"b",(function(){return X}));var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("mf+E"),u=a("wIs1"),m=a("b6Qr"),f=a("TSYQ"),p=a.n(f),=a("4CQy"),d=a("AcTT"),h=a("pMbe"),y=a("iQ+n"),w=a("3DIO"),b=a.n(w),g=a("GIcp"),v=a.n(g),C=a("2g2H"),x=a("SdQT"),k=a("FPhr"),T=a("6hcl"),S=a("DoX5"),E=a("e/rn"),I=a("iIA2"),N=a("+kc2"),O=a.n(N),j=a("vimH"),B=a("H3Sp"),z=a("SCqF"),R=a("1OG6"),P=a("TN+F");function A(e){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function D(e){return function(e){if(Array.isArray(e))return H(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||q(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var a=[],s=!0,o=!1,n=void 0;try{for(var r,i=e[Symbol.iterator]();!(s=(r=i.next()).done)&&(a.push(r.value),!t||a.length!==t);s=!0);}catch(e){o=!0,n=e}finally{try{s||null==i.return||i.return()}finally{if(o)throw n}}return a}(e,t)||q(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(e,t){if(e){if("string"==typeof e)return H(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?H(e,t):void 0}}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,s=new Array(t);a<t;a++)s[a]=e[a];return s}function Q(e,t,a,s,o,n,r){try{var i=en,c=i.value}catch(e){return void a(e)}i.done?t(c):Promise.resolve(c).then(s,o)}function L(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function J(e,t){return(J=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=U(e);if(t){var o=U(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return W(this,a)}}function W(e,t){return!t||"object"!==A(t)&&"function"!=typeof t?G(e):t}function G(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function U(e){return(U=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto_||Object.getPrototypeOf(e)})(e)}var K=[{type:"toys",val:10,rate:.1,blook:"Baby Penguin",text:"+ 10 Toys"},{type:"toys",val:25,rate:.11,blook:"Seal",text:"+ 25 Toys"},{type:"toys",val:50,rate:.085,blook:"Polar Bear",text:"+ 50 Toys"},{type:"toys",val:75,rate:.06,blook:"Unicorn",text:"+ 75 Toys"},{type:"toys",val:100,rate:.035,blook:"King",text:"+ 100 Toys"},{type:"mult",val:2,rate:.03,blook:"Penguin",text:"Double Toys"},{type:"mult",val:3,rate:.015,blook:"Holiday Wreath",text:"Triple Toys"},{type:"tpq",val:1,rate:.08,blook:"Snowy Owl",text:"+ 1 Toys Per Question"},{type:"tpq",val:5,rate:.11,blook:"Arctic Hare",text:"+ 5 Toys Per Question"},{type:"tpq",val:10,rate:.095,blook:"Arctic Fox",text:"+ 10 Toys Per Question"},{type:"tpq",val:15,rate:.07,blook:"Walrus",text:"+ 15 Toys Per Question"},{type:"tpq",val:20,rate:.05,blook:"Dragon",text:"+ 20 Toys Per Question"},{type:"tpq",val:25,rate:.025,blook:"Wizard",text:"+ 25 Toys Per Question"},{type:"mult-tpq",val:2,rate:.03,blook:"Hot Chocolate",text:"Double Toys Per Question"},{type:"mult-tpq",val:3,rate:.015,blook:"Snowman",text:"Triple Toys Per Question"},{type:"take",val:.1,rate:.025,blook:"Gingerbread House",text:"Take 10%"},{type:"take",val:.25,rate:.0242,blook:"Gingerbread Man",text:"Take 25%"},{type:"swap",rate:.02,blook:"Santa Claus",text:"SWAP"},{type:"sab",rate:.002,blook:"Moose",text:"Oh Canada"},{type:"sab",rate:.0065,blook:"Snow Globe",text:"Blizzard"},{type:"sab",rate:.002,blook:"Fairy",text:"Fog Spell"},{type:"sab",rate:.002,blook:"Raccoon",text:"Dark & Dusk"},{type:"sab",rate:.002,blook:"Cockatoo",text:"Howling Wind"},{type:"sab",rate:.002,blook:"Holiday Gift",text:"Gift Time!"},{type:"sab",rate:.002,blook:"Elf",text:"TREES"},{type:"sab",rate:.002,blook:"Werewolf",text:"Snow Plow"},{type:"sab",rate:3e-4,blook:"Spooky Ghost",text:"Use The Force"}],Y=function(e){if(e.includes("Toys")){var t=e.split("Toys");return o.a.createElement(o.a.Fragment,null,t[0],o.a.createElement("img",{src:E.a,alt:"Duck Toy",className:b.a.choiceDuck,draggable:!1}),t[1])}return e},X=[{top:20,left:15},{top:20,left:40},{top:80,left:65},{top:25,left:80},{top:80,left:30},{top:60,left:50},{top:70,left:12.5},{top:30,left:60},{top:40,left:27.5},{top:70,left:85}],V=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&J(e,t)}(c,e);var t,a,s,n,r,i=F(c);function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=i.call(this,e)).state={question:{},correct:!1,toys:0,toysPerQ:1,stage:"",choices:[],gift:!1,giftText:"",fog:!1,dusk:!1,wind:!1,plow:!1,blizzard:!1,force:!1,canada:!1,trees:[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1],players:[],phaseTwo:!1,attackerMsg:"",attackerBlook:""},t.dbRefStage={},t.dbRefMe={},t.dbRefAction={},t.here=!0,t.waiting=!1,t.corrects={},t.incorrects={},t.nextReady=!1,t.picking=!1,t.gettingQuestion=!1,t.choosingPlayer=!1,t.questions=[],t.freeQuestions=[],t.onAnswer=t.onAnswer.bind(G(t)),t.answerNext=t.answerNext.bind(G(t)),t.randomQ=t.randomQ.bind(G(t)),t.choose=t.choose.bind(G(t)),t.clickTree=t.clickTree.bind(G(t)),t.sendGift=t.sendGift.bind(G(t)),t}return t=c,(a=[{key:"componentDidMount",value:(n=regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.props.client&&this.props.client.questions&&this.props.client.questions[0]){e.next=2;break}return e.abrupt("return");case 2:return Object(P.b)(),e.next=5,this.props.firebase.getDatabaseRef(this.props.client.hostId,"stg");case 5:return this.dbRefStage=e.sent,this.dbRefStage.on("value",(function(e){switch(e.val()){case"fin":t.props.firebase.getDatabaseVal(t.props.client.hostId,"st",(function(e){var a=e?e.map((function(e){return{name:e.n,blook:e.b,toys:e.t||0,place:e.p}})):[];t.props.setGoldFinal(t.corrects,t.incorrects,a),t.props.history.push("/play/toy/final")}));break;case null:t.props.firebase.getDatabaseVal(t.props.client.hostId,"stg",(function(e){e||(t.props.deleteClient(),t.props.history.push("/play"))}))}})),e.next=9,this.props.firebase.getDatabaseRef(this.props.client.hostId,"c/".concat(this.props.client.name));case 9:return this.dbRefMe=e.sent,this.dbRefMe.on("value",(function(e){if(e.val()&&e.val().at){var a=e.val().at.split(":"),s="swap"===a[2]?e.val().t||0:Math.max(0,t.state.toys-(a[2]&&Number.isInteger(parseInt(a[2],10))?parseInt(a[2],10):0));t.setState({attackerMsg:"".concat(a[0]," just ").concat("swap"===a[2]?"swapped toys with you!":"took ".concat(Object(P.l)(a[2])," ").concat("1"===a[2]?"toy":"toys"," from you!")),attackerBlook:a[1],toys:s}),t.props.firebase.setVal({id:t.props.client.hostId,path:"c/".concat(t.props.client.name),val:{b:t.props.client.blook,t:s,oat:e.val().at}})}})),e.next=13,this.props.firebase.getDatabaseRef(this.props.client.hostId,"act");case 13:this.dbRefAction=e.sent,this.dbRefAction.on("value",(function(e){if(e.val()&&e.val().s)if(t.safe)t.safe=!1;else{var a=.b[e.val().s];clearTimeout(t.nameTimeout),"Oh Canada"===a?(clearTimeout(t.canadaTimeout),t.setState({canada:!1},(function(){t.setState({canada:!0},(function(){t.canadaTimeout=setTimeout((function(){t.setState({canada:!1})}),1e4)}))}))):"Blizzard"===a?(clearTimeout(t.blizzardTimeout),t.setState({blizzard:!1},(function(){t.setState({blizzard:!0},(function(){t.blizzardTimeout=setTimeout((function(){t.setState({blizzard:!1})}),17e3)}))}))):"Fog Spell"===a?(clearTimeout(t.fogTimeout),t.setState({fog:!1},(function(){t.setState({fog:!0},(function(){t.fogTimeout=setTimeout((function(){t.setState({fog:!1})}),8e3)}))}))):"Dark & Dusk"===a?(clearTimeout(t.duskTimeout),t.setState({dusk:!1},(function(){t.setState({dusk:!0},(function(){t.duskTimeout=setTimeout((function(){t.setState({dusk:!1})}),1e4)}))}))):"Howling Wind"===a?(clearTimeout(t.windTimeout),t.setState({wind:!1},(function(){t.setState({wind:!0},(function(){t.windTimeout=setTimeout((function(){t.setState({wind:!1})}),7050)}))}))):"Gift Time!"===a?t.setState({gift:!0}):"TREES"===a?t.setState({trees:[!0,!0,!0,!0,!0,!0,!0,!0,!0,!0]}):"Snow Plow"===a?(clearTimeout(t.plowTimeout),t.setState({plow:!1},(function(){t.setState({plow:!0},(function(){t.plowTimeout=setTimeout((function(){t.setState({plow:!1})}),8050)}))}))):"Use The Force"===a&&(clearTimeout(t.forceTimeout),t.setState({force:!1},(function(){t.setState({force:!0},(function(){t.forceTimeout=setTimeout((function(){t.setState({force:!1})}),18100)}))}))),t.setState({sabotageName:e.val().n,sabotageBlook:e.val().b},(function(){t.nameTimeout=setTimeout((function(){t.setState({sabotageName:"",sabotageBlook:""})}),6e3)}))}})),this.questions=this.props.client.questions,this.freeQuestions=JSON.parse(JSON.stringify(this.props.client.questions)),this.randomQ();case 18:case"end":return e.stop()}}),e,this)})),r=function(){var e=this,t=arguments;return new Promise((function(a,s){var o=n.apply(e,t);function r(e){Q(o,a,s,r,i,"next",e)}function i(e){Q(o,a,s,r,i,"throw",e)}r(void 0)}))},function(){return r.apply(this,arguments)})},{key:"componentWillUnmount",value:function(){this.here=!1,Object(P.r)(),clearTimeout(this.waitTimeout),clearTimeout(this.claimTimeout),clearTimeout(this.canadaTimeout),clearTimeout(this.blizzardTimeout),clearTimeout(this.fogTimeout),clearTimeout(this.duskTimeout),clearTimeout(this.windTimeout),clearTimeout(this.plowTimeout),clearTimeout(this.forceTimeout),Object.keys(this.dbRefStage).length&&this.dbRefStage.off("value"),Object.keys(this.dbRefMe).length&&this.dbRefMe.off("value"),Object.keys(this.dbRefAction).length&&this.dbRefAction.off("value")}},{key:"onAnswer",value:function(e){if(!this.waiting&&this.here){this.waiting=!0;var t=this.state.question.correctAnswers.includes(e),a=this.state.question.number;t?this.corrects[a]?this.corrects[a]+=1:this.corrects[a]=1:this.incorrects[a]?this.incorrects[a]+=1:this.incorrects[a]=1,this.nextReady=!0,this.setState({correct:t,stage:"feedback",toys:t?this.state.toys+this.state.toysPerQ:this.state.toys})}}},{key:"answerNext",value:function(){var e=this;this.nextReady&&this.here&&(this.nextReady=!1,this.state.correct?this.setState({choices:Object(P.p)(K,2),stage:"prize",choiceObj:{}},(function(){clearTimeout(e.waitTimeout),e.waitTimeout=setTimeout((function(){e.picking=!0}),300),clearTimeout(e.claimTimeout),e.claimTimeout=setTimeout((function(){e.randomQ()}),12500)})):this.randomQ())}},{key:"randomQ",value:function(){var e=this;if(this.here){clearTimeout(this.claimTimeout),0===this.freeQuestions.length&&(this.freeQuestions=JSON.parse(JSON.stringify(this.questions)));var t=Object(P.m)(this.freeQuestions);this.freeQuestions.splice(this.freeQuestions.indexOf(t),1),t.random&&(t.answers=Object(P.u)(t.answers)),this.setState({question:t,phaseTwo:!1,stage:"question"},(function(){e.waiting=!0,clearTimeout(e.waitTimeout),e.waitTimeout=setTimeout((function(){e.waiting=!1,e.gettingQuestion=!1}),400)}))}}},{key:"choose",value:function(e){var t=this;if(this.picking){this.picking=!1;var a=this.state.toys,s=this.state.toysPerQ,o=this.state.choices[e],n=!0;"toys"===o.type?a+=o.val:"tpq"===o.type?s+=o.val:"mult"===o.type?a=Math.round(ao.val):"mult-tpq"===o.type?s=Math.round(so.val):["take","swap"].includes(o.type)?(n=!1,this.props.firebase.getDatabaseVal(this.props.client.hostId,"c",(function(e){var a=e?Object.entries(e).map((function(e){var t=M(e,2),a=t[0],s=t[1];return{name:a,blook:s.b,toys:s.t||0}})).filter((function(e){return e.name!==t.props.client.name})):[];a.sort((function(e,t){return t.toys-e.toys})),t.choosingPlayer=!1,t.setState({players:a,choiceObj:o,phaseTwo:!0},(function(){clearTimeout(t.waitTimeout),t.waitTimeout=setTimeout((function(){t.choosingPlayer=!0}),300)}))}))):(this.safe=!0,this.props.client.name&&this.props.client.blook&&this.props.client.hostId&&this.props.firebase.setVal({id:this.props.client.hostId,path:"act",val:{n:this.props.client.name,b:this.props.client.blook,s:_.a[o.text]}})),this.props.firebase.setVal({id:this.props.client.hostId,path:"c/".concat(this.props.client.name),val:{b:this.props.client.blook,t:a}}),this.setState({toys:a,toysPerQ:s}),n&&this.randomQ()}}},{key:"clickTree",value:function(e){var t=D(this.state.trees);t[e]=!1,this.setState({trees:t})}},{key:"sendGift",value:function(e){e.preventDefault(),this.state.giftText.length<3||this.setState({gift:!1,giftText:""})}},{key:"selectPlayer",value:function(e){if(this.choosingPlayer){if(this.choosingPlayer=!1,clearTimeout(this.claimTimeout),"swap"===this.state.choiceObj.type)this.props.firebase.setVal({id:this.props.client.hostId,path:"c/".concat(e.name),val:{b:e.blook,t:this.state.toys,at:"".concat(this.props.client.name,":").concat(this.props.client.blook,":swap")}}),this.props.firebase.setVal({id:this.props.client.hostId,path:"c/".concat(this.props.client.name),val:{b:this.props.client.blook,t:e.toys||0}}),this.setState({toys:e.toys||0});else{var t=Math.round((e.toys||0)*this.state.choiceObj.val);if(t>0){this.props.firebase.setVal({id:this.props.client.hostId,path:"c/".concat(e.name),val:{b:e.blook,t:(e.toys||0)-t,at:"".concat(this.props.client.name,":").concat(this.props.client.blook,":").concat(t)}});var a=this.state.toys+t;this.props.firebase.setVal({id:this.props.client.hostId,path:"c/".concat(this.props.client.name),val:{b:this.props.client.blook,t:a}}),this.setState({toys:a})}}this.randomQ()}}},{key:"render",value:function(){var e=this;return this.props.client&&this.props.client.questions&&this.props.client.questions[0]?o.a.createElement("div",{className:m.isMobile?v.a.mBody:v.a.body,style:{overflow:"hidden",backgroundColor:"#fff",filter:this.state.fog&&this.state.dusk?"grayscale(100%) blur(2px)":this.state.fog?"blur(2px)":this.state.dusk?"grayscale(100%)":null},id:"body"},o.a.createElement(y.a,{title:"Play Santa's Workshop | Blooket",desc:"Engage in an exciting, fast-paced review game where you build toys by answering questions."}),o.a.createElement(C.a,{name:this.props.client.name,toys:this.state.toys}),o.a.createElement("div",{className:this.state.wind?b.a.wind:null},"question"===this.state.stage?o.a.createElement(k.a,{onAnswer:this.onAnswer,text:this.state.question.text,answers:this.state.question.answers,image:this.state.question.image,theme:"merry"}):"feedback"===this.state.stage?o.a.createElement("div",{className:b.a.feedbackContainer},o.a.createElement(T.a,{incorrectTime:3,correctAnswers:this.state.question.correctAnswers,correct:this.state.correct,onNext:this.answerNext,reward:this.state.correct?"+".concat(Object(P.l)(this.state.toysPerQ)):null})):"prize"===this.state.stage?o.a.createElement("div",{className:p()(v.a.regularBody,b.a.winterBackground),id:"regularBody"},o.a.createElement("img",{src:O.a,alt:"Mountains",className:b.a.mountainsBackground,draggable:!1}),this.state.phaseTwo?this.state.players.length>0?o.a.createElement("div",{className:b.a.playerWrapper},o.a.createElement("div",{className:b.a.playerHeader},"swap"===this.state.choiceObj.type?"Choose a Player to Swap With":"Choose a Player to Take From"),o.a.createElement("div",{className:b.a.playerHolder},this.state.players.map((function(t){return o.a.createElement("div",{className:b.a.playerContainer,key:t.name,role:"button",tabIndex:0,onClick:function(){return e.selectPlayer(t)}},o.a.createElement("div",{className:b.a.playerInside},o.a.createElement(S.a,{name:t.blook,className:b.a.playerBlook}),o.a.createElement("div",{className:b.a.playerColumn},o.a.createElement("div",{className:b.a.playerText},t.name),o.a.createElement("div",{className:b.a.toyRow},o.a.createElement("div",{className:b.a.playerToys},Object(P.l)(t.toys)),o.a.createElement("img",{src:E.a,alt:"Toy",className:b.a.toyIcon,draggable:!1})))))})),o.a.createElement("div",{style:{height:20}}))):o.a.createElement("div",{className:b.a.playerWrapper},o.a.createElement("div",{className:b.a.playerHeader},"No Players to Interact With"),o.a.createElement("div",{className:b.a.noPlayers,role:"button",tabIndex:0,onClick:this.randomQ},o.a.createElement("div",{className:b.a.playerInside},"Next"))):o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:b.a.header},"Choose a Helper!"),o.a.createElement("div",{className:p()(b.a.choice,b.a.choiceLeft),role:"button",tabIndex:0,onClick:function(){return e.choose(0)}},o.a.createElement("div",{className:b.a.choiceInside},o.a.createElement(S.a,{name:this.state.choices[0].blook,className:b.a.choiceBlook}),o.a.createElement("div",{className:b.a.choiceText},Y(this.state.choices[0].text)))),o.a.createElement("div",{className:p()(b.a.choice,b.a.choiceRight),role:"button",tabIndex:0,onClick:function(){return e.choose(1)}},o.a.createElement("div",{className:b.a.choiceInside},o.a.createElement(S.a,{name:this.state.choices[1].blook,className:b.a.choiceBlook}),o.a.createElement("div",{className:b.a.choiceText},Y(this.state.choices[1].text)))))):null),this.state.gift?o.a.createElement(z.a,{text:"What gift do you want for the holidays? (3 letter minimum)",buttonOne:{text:"Submit",click:this.sendGift,color:"blue"},stringValue:this.state.giftText,stringChange:function(t){return e.setState({giftText:t.target.value})},stringPlaceholder:"Gift",onSubmit:this.sendGift}):null,this.state.trees.filter((function(e){return e})).length>0?this.state.trees.map((function(t,a){return t?o.a.createElement("div",{className:b.a.treeContainer,style:{top:"".concat(X[a].top,"vh"),left:"".concat(X[a].left,"vw")},key:a,role:"button",tabIndex:0,onClick:function(){return e.clickTree(a)}},o.a.createElement("img",{className:b.a.treeImg,src:I.a,alt:"tree",draggable:!1})):null})):null,this.state.plow?o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:b.a.plowSnow}),o.a.createElement(S.a,{name:"Werewolf",className:b.a.plowBlook}),o.a.createElement("i",{className:p()(b.a.plow,"fas fa-snowplow")})):null,this.state.force?o.a.createElement(B.a,null):null,this.state.blizzard?o.a.createElement(j.a,{zIndex:20,count:m.isMobile?85:170}):null,this.state.canada?o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:b.a.canada1}),o.a.createElement("div",{className:b.a.canada2}),o.a.createElement("div",{className:b.a.canada3}),o.a.createElement("i",{className:p()(b.a.canadaIcon,"fab fa-canadian-maple-leaf")})):null,this.state.sabotageName?o.a.createElement("div",{className:b.a.sabotageContainer},o.a.createElement(S.a,{name:this.state.sabotageBlook,className:b.a.sabotageBlook}),this.state.sabotageName):null,this.state.attackerBlook?o.a.createElement(R.a,{text:this.state.attackerMsg,blook:this.state.attackerBlook,onClick:function(){return e.setState({attackerMsg:"",attackerBlook:""})},isMerry:!0}):null):o.a.createElement(l.a,{to:"/play"})}}])&&L(t.prototype,a),s&&L(t,s),c}(o.a.Component);V.propTypes={client:c.a.object,history:c.a.object.isRequired,firebase:c.a.object,deleteClient:c.a.func.isRequired,setGoldFinal:c.a.func.isRequired};t.a=Object(u.a)(Object(r.b)((function(e){return{client:e.clients.client}}),(function(e){return Object(n.b)({deleteClient:h.a,setGoldFinal:d.a},e)}))(Object(x.d)(V)))},"51kA":function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".stylesdeckButton2bMdI-camelCase{display:flex;flex-direction:row;align-items:center;position:absolute;top:1vw;right:1vw;color:#fff;text-shadow:2px 2px 8px grey;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;cursor:pointer;transition:.2s}.stylesdeckButton2bMdI-camelCase:hover{transform:scale(1.05)}.stylesleaveButton2HHdn-camelCase{display:flex;flex-direction:row;align-items:center;position:absolute;bottom:1vw;right:1vw;color:#ff5050;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;cursor:pointer;transition:.2s}.stylesleaveButton2HHdn-camelCase:hover{transform:scale(1.05)}.stylesdeckIcon3L-Bf-camelCase{font-size:27px;margin-right:10px}.stylesdeckText3bq48-camelCase{font-family:Nunito,sans-serif;font-weight:700;font-size:30px}.stylesdeckContainer__2agY-camelCase{position:absolute;top:0;left:0;min-height:calc(100% - 10vh);width:calc(100% - 10vw);padding:5vh 5vw;background-color:rgba(0,0,0,.8);z-index:3;display:flex;flex-flow:row wrap;align-content:flex-start}.stylescardContainer_cUxpV-camelCase{width:25vw;height:32.5vw;transform:scale(.7);margin:-4vw -1.5vw}.styles_closeIcon2Jvbw-camelCase{font-size:30px;text-shadow:2px 2px 8px grey;cursor:pointer;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;top:1vw;right:1vw;color:#fff;transition:.2s}.stylescloseIcon2Jvbw-camelCase:focus,.stylescloseIcon2Jvbw-camelCase:hover{transform:scale(1.05)}.stylesshopContainer3JmL2-camelCase{flex-direction:row;width:75vw;height:95%;margin:auto auto auto 14vw}.stylescardsHolder395S0-camelCase,.stylesshopContainer3JmL2-camelCase{display:flex;align-items:center}.stylescardsHolder395S0-camelCase{flex-flow:row wrap;justify-content:center;width:82.5%;height:100%}.stylesshopCardContainer2XhzX-camelCase{display:flex;flex-direction:column;width:25vw;transform:scale(.55);margin:-9vw -3.25vw;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;transition:.2s}.stylesshopCardContainer2XhzX-camelCase:hover{transform:scale(.53)}.stylespriceText___9_45d-camelCase{font-family:Nunito,sans-serif;text-shadow:2px 2px 8px grey;color:#fff;font-weight:700;width:100%;text-align:center;margin-top:.5vw;font-size:3.5vw;display:flex;flex-direction:row;align-items:center;justify-content:center}.stylespriceIcon_2tZwx-camelCase{margin-left:1vw;font-size:3vw}.styles_removeButton2_sd6-camelCase{display:flex;flex-direction:column;align-items:center;justify-content:center;font-family:Nunito,sans-serif;text-shadow:2px 2px 8px grey;color:#fff;font-weight:700;font-size:2.5vw;line-height:2.65vw;box-shadow:0 0 8px 3px rgba(0,0,0,.2);height:50%;width:17.5%;margin:auto;border-radius:6px;background-color:#ff5050;text-align:center;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;transition:.2s}.stylesremoveButton___2_sd6-camelCase:hover{transform:scale(.95)}.stylesremoveButtonText_2OGlk-camelCase{margin:0 auto}.styles_removeIcon2G5bX-camelCase{font-size:6vw;margin:2vw auto}.stylesremoveCost3eUrm-camelCase{display:flex;flex-direction:row;align-items:center;font-size:2.5vw;margin:0 auto}.stylesremoveCostIcon5fkZp-camelCase{margin-left:1vw;font-size:2.2vw}.stylesremoveDeckContainer2sMHs-camelCase{position:absolute;top:calc(10% + 3vw);left:0;min-height:calc(100% - 10vh);width:calc(100% - 10vw);padding:5vh 5vw;z-index:3;display:flex;flex-flow:row wrap;-webkit-animation:stylesfadeIn4166I-camelCase .3s;animation:stylesfadeIn4166I-camelCase .3s}.stylesremoveCardContainer1UBdW-camelCase{width:25vw;height:32.5vw;transform:scale(.7);margin:-4vw -1.5vw;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;transition:.2s}.stylesremoveCardContainer1UBdW-camelCase:hover{transform:scale(.75)}.stylesremoveText3W9K1-camelCase{font-family:Creepster,sans-serif;text-shadow:2px 2px 8px grey;color:#b3ffb3;font-size:5vw;position:absolute;width:80%;top:5%;left:10%;text-align:center;-webkit-animation:stylesfadeIn4166I-camelCase .3s;animation:stylesfadeIn4166I-camelCase .3s}.stylesbackButton1F5uI-camelCase{display:flex;flex-direction:row;align-items:center;position:absolute;top:1vw;left:1vw;color:#fff;font-family:Nunito,sans-serif;font-weight:700;font-size:30px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;cursor:pointer;transition:.2s}.stylesbackButton1F5uI-camelCase:hover{transform:scale(1.05)}.styleslifeContainercxTP4-camelCase{position:absolute;top:0;left:0;transform:scale(.6);height:15vw;width:15vw}.stylescardRemoveeD6Qw-camelCase{width:25vw;height:32.5vw;position:absolute;top:calc(50% - 12vw);left:calc(50% - 12.5vw);-webkit-animation:stylesspinRemove3cq0m-camelCase 4s ease-in .5s forwards;animation:stylesspinRemove3cq0m-camelCase 4s ease-in .5s forwards}@-webkit-keyframes stylesspinRemove3cq0m-camelCase{0%{transform:rotate(0deg) scale(1)}to{transform:rotate(10turn) scale(0)}}@keyframes stylesspinRemove3cq0m-camelCase{0%{transform:rotate(0deg) scale(1)}to{transform:rotate(10turn) scale(0)}}@-webkit-keyframes stylesfadeIn4166I-camelCase{0%{opacity:0}to{opacity:1}}@keyframes stylesfadeIn4166I-camelCase{0%{opacity:0}to{opacity:1}}@media only screen and (max-width:800px){.stylesdeckButton2bMdI-camelCase{right:0}.stylesdeckButton2bMdI-camelCase,.stylesdeckButton2bMdI-camelCase:hover{transform:scale(.8)}.stylesdeckContainer2agY_-camelCase{transform:scale(1.1);margin:2.5vw 2vw}.stylescloseIcon2Jvbw-camelCase{top:5vw;right:8.5vw}.styleslifeContainercxTP4-camelCase{top:3vw;left:3vw;transform:scale(1.1)}.stylesshopContainer3JmL2-camelCase{flex-direction:column;margin:20% auto 5%;align-items:center;width:95%;height:75%}.stylesremoveButton2_sd6-camelCase{flex-direction:row;justify-content:space-evenly;font-size:5vw;line-height:5.15vw;height:15%;width:75%;margin:auto}.stylesremoveIcon2G5bX-camelCase{display:none}.stylesremoveCost3eUrm-camelCase{font-weight:700;font-size:5.5vw}.stylesremoveCostIcon5fkZp-camelCase{margin-left:3vw;font-size:5.2vw}.stylesshopCardContainer2XhzX-camelCase{width:25vw;height:32.5vw;margin:-4vw 3vw}.stylesshopCardContainer2XhzX-camelCase,.stylesshopCardContainer2XhzX-camelCase:hover{transform:scale(.95)}.stylespriceText___9_45d-camelCase{margin-top:2vw}.stylescardsHolder_395S0-camelCase{display:flex;flex-flow:row wrap;justify-content:center;align-items:center;width:100%}.styles_removeText3W9K1-camelCase{font-size:9vw;top:7.5%}.stylesremoveDeckContainer2sMHs-camelCase{top:17.5%;align-content:flex-start;min-height:75%;width:95%;padding:5% 2.5%}.stylesremoveCardContainer1UBdW-camelCase{width:25vw;height:32.5vw;transform:scale(.95);margin:2vw 3vw}.stylesremoveCardContainer1UBdW-camelCase:hover{transform:scale(.95)}.stylescardRemoveeD6Qw-camelCase{transform:scale(1.5);-webkit-animation:stylesspinRemove3cq0m-camelCase 4s ease-in .5s forwards;animation:stylesspinRemove3cq0m-camelCase 4s ease-in .5s forwards}@-webkit-keyframes stylesspinRemove3cq0m-camelCase{0%{transform:rotate(0deg) scale(1.5)}to{transform:rotate(10turn) scale(0)}}@keyframes stylesspinRemove3cq0m-camelCase{0%{transform:rotate(0deg) scale(1.5)}to{transform:rotate(10turn) scale(0)}}}",""]),t.locals={deckButton:"stylesdeckButton2bMdI-camelCase",leaveButton:"stylesleaveButton2HHdn-camelCase",deckIcon:"stylesdeckIcon3L-Bf-camelCase",deckText:"stylesdeckText3bq48-camelCase",deckContainer:"stylesdeckContainer__2agY-camelCase",cardContainer:"stylescardContainer_cUxpV-camelCase",closeIcon:"styles_closeIcon2Jvbw-camelCase",shopContainer:"stylesshopContainer3JmL2-camelCase",cardsHolder:"stylescardsHolder395S0-camelCase",shopCardContainer:"stylesshopCardContainer2XhzX-camelCase",priceText:"stylespriceText9_45d-camelCase",priceIcon:"stylespriceIcon2tZwx-camelCase",removeButton:"stylesremoveButton2_sd6-camelCase",removeButtonText:"stylesremoveButtonText2OGlk-camelCase",removeIcon:"stylesremoveIcon2G5bX-camelCase",removeCost:"stylesremoveCost3eUrm-camelCase",removeCostIcon:"stylesremoveCostIcon5fkZp-camelCase",removeDeckContainer:"stylesremoveDeckContainer2sMHs-camelCase",fadeIn:"stylesfadeIn4166I-camelCase",removeCardContainer:"stylesremoveCardContainer1UBdW-camelCase",removeText:"stylesremoveText3W9K1-camelCase",backButton:"stylesbackButton1F5uI-camelCase",lifeContainer:"styleslifeContainercxTP4-camelCase",cardRemove:"stylescardRemoveeD6Qw-camelCase",spinRemove:"stylesspinRemove3cq0m-camelCase"}},"5aLK":function(e,t,a){var s=a("jdaG");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},"7+rr":function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("wIs1"),u=a("mLw1"),m=a("FLf1"),f=a.n(m),p=a("vDqi"),=a.n(p),d=a("b6Qr"),h=a("TSYQ"),y=a.n(h),w=a("GIcp"),b=a.n(w),g=a("+KYW"),v=a.n(g),C=a("e47E"),x=a("DoX5"),k=a("iQ+n"),T=a("MQPm"),S=a("3B9I"),E=a("TN+F");function I(e){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function N(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=z(e);if(t){var o=z(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return B(this,a)}}function B(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto||Object.getPrototypeOf(e)})(e)}var R=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&O(e,t)}(r,e);var t,a,s,n=j(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).state={standings:[],user:{},showPrizes:!1},t.here=!0,t}return t=r,(a=[{key:"componentDidMount",value:function(){var e=this;if("undefined"!=typeof window&&localStorage.getItem("token")){var t=localStorage.getItem("token").split(" ");2===t.length&&f.a.verify(t[1],"a809c7b3f",(function(t,a){t?console.error(t):(e.name=a.name,.a.get("/api/tourneys",{params:{name:a.name}}).then((function(t){var a=t.data.user||{},s=t.data.standings,o=0,n=-1;s.forEach((function(e){e.candy!==n&&(o+=1,n=e.candy),e.place=o})),a.name&&!s.map((function(e){return e.name})).includes(a.name)&&s.push(a),e.setState({standings:s,user:a})})).catch((function(e){console.error(e)})))}))}}},{key:"componentWillUnmount",value:function(){this.here=!1}},{key:"render",value:function(){var e=this;if("undefined"!=typeof window&&localStorage.getItem("token")){var t=localStorage.getItem("token").split(" ");2===t.length?f.a.verify(t[1],"a809c7b3f",(function(t){e.redirect=!!t})):this.redirect=!0}else this.redirect=!0;return this.redirect?o.a.createElement(u.a,{to:"/login"}):o.a.createElement("div",{className:d.isMobile?b.a.mBody:b.a.body,style:{backgroundColor:"#292929"}},o.a.createElement(k.a,{title:"Contest | Blooket",desc:"Compete in Blooket's Contest of Candy to see if you can make the most candy in 7 minutes!"}),o.a.createElement(C.a,{history:this.props.history,page:"Stats"}),o.a.createElement("div",{className:b.a.regularBodyMax},o.a.createElement("div",{className:v.a.headerRow},o.a.createElement("div",{className:v.a.header},o.a.createElement(x.a,{name:"Pumpkin",className:v.a.headerBlook}),o.a.createElement("div",{className:v.a.headerText},"Contest of Candy"),o.a.createElement(x.a,{name:"Ghost",className:v.a.headerBlook}))),o.a.createElement("div",{className:v.a.desc},"Final Standings"),o.a.createElement("div",{className:v.a.prizesButton,role:"button",tabIndex:0,onClick:function(){return e.setState({showPrizes:!0})}},"Prizes"),this.state.standings.map((function(t,a){return o.a.createElement("div",{className:v.a.standingRow,key:t.name,style:{marginTop:25===a?50:null,maxHeight:25===a?100:null}},t.place?o.a.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch"}},o.a.createElement("div",{className:v.a.placeText},t.place),o.a.createElement("div",{className:v.a.superPlaceText},Object(E.f)(t.place))):null,o.a.createElement("div",{className:v.a.nameText,style:{color:e.state.user.name===t.name?"#e57e25":"#fff"}},t.name),o.a.createElement("div",{className:v.a.candyRow},o.a.createElement("div",{className:v.a.candyText},t.candy>1e6?"".concat(Object(E.l)(Math.round(t.candy/1e6)),"M"):Object(E.l)(t.candy)),o.a.createElement("img",{src:T.a,alt:"Candy",className:v.a.candyImg,draggable:!1})))})),o.a.createElement("div",{className:v.a.standingRow,style:{opacity:0}})),this.state.showPrizes?o.a.createElement("div",{className:b.a.modal},o.a.createElement("div",{className:v.a.prizesContainer},o.a.createElement("i",{className:y()(v.a.closeIcon,"fas fa-times"),role:"button",tabIndex:0,onClick:function(){return e.setState({showPrizes:!1})}}),o.a.createElement("div",{className:v.a.prizesHeader},"Prizes"),o.a.createElement("div",{className:v.a.prizesRow},o.a.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch"}},o.a.createElement("div",{className:v.a.placeText,style:{fontSize:34,marginRight:18}},"Champion")),o.a.createElement(x.a,{name:"Spooky Ghost",className:v.a.prizeBlook}),o.a.createElement(x.a,{name:"Spooky Mummy",className:v.a.prizeBlook}),o.a.createElement(x.a,{name:"Spooky Pumpkin",className:v.a.prizeBlook}),o.a.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},"+ 500",o.a.createElement("img",{src:S.a,alt:"Token",className:v.a.prizesToken,draggable:!1}))),o.a.createElement("div",{className:v.a.prizesRow},o.a.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch"}},o.a.createElement("div",{className:v.a.placeText},"2"),o.a.createElement("div",{className:v.a.superPlaceText},Object(E.f)(2)))," - ",o.a.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",marginRight:30}},o.a.createElement("div",{className:v.a.placeText},"5"),o.a.createElement("div",{className:v.a.superPlaceText},Object(E.f)(5))),o.a.createElement(x.a,{name:"Spooky Mummy",className:v.a.prizeBlook}),o.a.createElement(x.a,{name:"Spooky Pumpkin",className:v.a.prizeBlook}),o.a.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},"+ 300",o.a.createElement("img",{src:S.a,alt:"Token",className:v.a.prizesToken,draggable:!1}))),o.a.createElement("div",{className:v.a.prizesRow},o.a.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch"}},o.a.createElement("div",{className:v.a.placeText},"6"),o.a.createElement("div",{className:v.a.superPlaceText},Object(E.f)(6)))," - ",o.a.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",marginRight:30}},o.a.createElement("div",{className:v.a.placeText},"15"),o.a.createElement("div",{className:v.a.superPlaceText},Object(E.f)(15))),o.a.createElement(x.a,{name:"Spooky Pumpkin",className:v.a.prizeBlook}),o.a.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},"+ 200",o.a.createElement("img",{src:S.a,alt:"Token",className:v.a.prizesToken,draggable:!1}))),o.a.createElement("div",{className:v.a.prizesRow},o.a.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch"}},o.a.createElement("div",{className:v.a.placeText},"16"),o.a.createElement("div",{className:v.a.superPlaceText},Object(E.f)(16)))," - ",o.a.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",marginRight:30}},o.a.createElement("div",{className:v.a.placeText},"25"),o.a.createElement("div",{className:v.a.superPlaceText},Object(E.f)(25))),o.a.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},"100",o.a.createElement("img",{src:S.a,alt:"Token",className:v.a.prizesToken,draggable:!1}))),o.a.createElement("div",{style:{height:20}}))):null)}}])&&N(t.prototype,a),s&&N(t,s),r}(o.a.Component);R.propTypes={history:c.a.object.isRequired};t.a=Object(l.a)(Object(r.b)((function(){return{}}),(function(e){return Object(n.b)({},e)}))(R))},"8EZC":function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".stylesblook1dEZe-camelCase{width:30vw;position:absolute;top:55%;left:15vw;transform:rotate(-10deg) translateY(-50%)}.stylestextContainer11QtD-camelCase{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:45%;height:90%;left:50%;top:5%}.stylesriskText1e1DB-camelCase{text-shadow:2px 2px 8px grey;color:#fff;font-family:Nunito,sans-serif;font-weight:700;text-align:center;width:100%;font-size:3.5vw}.stylesbuttonContainer17AvY-camelCase{flex-direction:row;justify-content:space-evenly;width:100%;margin-top:3.5vw}.stylesbutton2mciG-camelCase,.stylesbuttonContainer17AvY-camelCase{display:flex;align-items:center}.stylesbutton2mciG-camelCase{justify-content:center;color:#fff;font-family:Nunito,sans-serif;font-weight:700;text-align:center;font-size:3vw;padding:.5vw 2vw;margin:0 auto;border:3px solid #fff;border-radius:6px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;transition:.2s}.stylesbutton2mciG-camelCase:hover{transform:scale(1.05)}.styleslifeContainer15r1E-camelCase{position:absolute;top:0;left:0;height:15vw;width:15vw;transform:scale(.6)}@media only screen and (max-width:600px){.styleslifeContainer15r1E-camelCase{top:3vw;left:3vw;transform:scale(1.1)}.stylesblook1dEZe-camelCase{width:50vw;top:7.5%;left:50%;transform:rotate(-10deg) translateX(-50%)}.stylestextContainer11QtD-camelCase{width:90%;height:50%;left:5%;top:55%}.stylesriskText1e1DB-camelCase{font-size:6.75vw;line-height:6.95vw}.stylesbuttonContainer17AvY-camelCase{margin-top:5vw}.stylesbutton2mciG-camelCase{font-size:6vw;padding:1.5vw 3.5vw}.stylesbutton2mciG-camelCase:hover{transform:scale(1)}}",""]),t.locals={blook:"stylesblook1dEZe-camelCase",textContainer:"stylestextContainer11QtD-camelCase",riskText:"stylesriskText1e1DB-camelCase",buttonContainer:"stylesbuttonContainer17AvY-camelCase",button:"stylesbutton2mciG-camelCase",lifeContainer:"styleslifeContainer15r1E-camelCase"}},"9vW0":function(e,t,a){"use strict";a.d(t,"b",(function(){return o})),a.d(t,"a",(function(){return n}));var s=a("PfDG");function o(e,t){return{type:s.b,enemy:e,enemyType:t}}function n(e){return{type:s.a,node:e}}},ABkm:function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".styleswelcomeText2TfG6-camelCase{font-family:Creepster,sans-serif;text-shadow:2px 2px 8px grey;color:#b3ffb3;font-size:7vw;position:absolute;width:80%;top:50%;left:10%;transform:translateY(-50%);text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-animation:stylesfadeIn3BlIQ-camelCase .3s;animation:stylesfadeIn3BlIQ-camelCase .3s}.stylesquestionContainer3oXiO-camelCase{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#292929}.styleslifeContainer2Dvjp-camelCase{position:absolute;top:0;left:0;height:15vw;width:15vw;transform:scale(.6)}.stylesdeckButton37wic-camelCase{display:flex;flex-direction:row;align-items:center;position:absolute;top:1vw;right:1vw;color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;cursor:pointer;transition:.2s}.stylesdeckButton37wic-camelCase:hover{transform:scale(1.05)}.stylesdeckIcon2bLFK-camelCase{font-size:27px;margin-right:10px}.stylesdeckIcon2bLFK-camelCase,.stylesdeckText3c0Cj-camelCase{text-shadow:2px 2px 8px grey}.stylesdeckText3c0Cj-camelCase{font-family:Nunito,sans-serif;font-weight:700;font-size:30px}.stylesdeckContainer3aj5d-camelCase{position:absolute;top:0;left:0;min-height:calc(100% - 10vh);width:calc(100% - 10vw);padding:5vh 5vw;background-color:rgba(0,0,0,.8);z-index:3;display:flex;flex-flow:row wrap}.stylescardContainerruDkK-camelCase{width:25vw;height:32.5vw;transform:scale(.7);margin:-4vw -1.5vw}.stylescloseIcon2b1yp-camelCase{font-size:30px;text-shadow:2px 2px 8px grey;cursor:pointer;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;top:1vw;right:1vw;color:#fff;transition:.3s}.stylescloseIcon2b1yp-camelCase:focus,.stylescloseIcon2b1yp-camelCase:hover{transform:scale(1.05)}.styleschooseTextj-WK6-camelCase{font-family:Creepster,sans-serif;text-shadow:2px 2px 8px grey;color:#b3ffb3;font-size:6vw;bottom:70%;text-align:center;-webkit-animation:stylesfadeIn3BlIQ-camelCase .3s;animation:stylesfadeIn3BlIQ-camelCase .3s}.styleschooseTextj-WK6-camelCase,.stylesrestButtonContainer___2mc_6-camelCase{position:absolute;width:80%;left:10%}.stylesrestButtonContainer_2mc_6-camelCase{flex-flow:row wrap;top:40%;opacity:0;-webkit-animation:stylesfadeIn_3BlIQ-camelCase .3s linear .2s forwards;animation:styles_fadeIn3BlIQ-camelCase .3s linear .2s forwards}.stylesrestButton3nRTj-camelCase,.stylesrestButtonContainer2mc_6-camelCase{display:flex;align-items:center;justify-content:center}.stylesrestButton3nRTj-camelCase{width:17.5vw;height:17.5vw;margin:2vw 4vw;border-radius:6px;box-shadow:0 0 8px 3px rgba(0,0,0,.2);cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;flex-direction:column;font-family:Nunito,sans-serif;text-shadow:2px 2px 8px grey;color:#fff;font-weight:700;font-size:3vw;transition:.2s}.stylesrestButton3nRTj-camelCase:hover{transform:scale(1.03)}.stylesbuttonIconDT-7g-camelCase{font-size:6vw;margin-bottom:.75vw}.stylesupgradeDeckContainer1BQm3-camelCase{position:absolute;top:calc(10% + 3vw);left:0;min-height:calc(100% - 10vh);width:calc(100% - 10vw);padding:5vh 5vw;z-index:3;display:flex;flex-flow:row wrap}.stylesupgradeCardContainer1oCXT-camelCase{width:25vw;height:32.5vw;transform:scale(.7);margin:-4vw -1.5vw;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;transition:.2s}.stylesupgradeCardContainer1oCXT-camelCase:hover{transform:scale(.75)}.stylesupgradeText2HDz3-camelCase{font-family:Creepster,sans-serif;text-shadow:2px 2px 8px grey;color:#b3ffb3;font-size:5vw;position:absolute;width:80%;top:5%;left:10%;text-align:center;-webkit-animation:stylesfadeIn3BlIQ-camelCase .3s;animation:stylesfadeIn3BlIQ-camelCase .3s}.styleslifeHealContainer1m_li-camelCase{position:absolute;top:0;left:0;height:15vw;width:15vw;transform:scale(1.5);top:calc(60% - 7.5vw);left:calc(50% - 7.5vw)}.stylescardReveal25IEa-camelCase{width:25vw;height:32.5vw;position:absolute;top:calc(50% - 12vw);left:calc(50% - 12.5vw);-webkit-animation:stylesspinReveal3fQ1J-camelCase 4s ease-in-out .5s;animation:stylesspinReveal3fQ1J-camelCase 4s ease-in-out .5s}@-webkit-keyframes stylesspinReveal3fQ1J-camelCase{0%{transform:rotateY(0deg)}to{transform:rotateY(10turn)}}@keyframes stylesspinReveal3fQ1J-camelCase{0%{transform:rotateY(0deg)}to{transform:rotateY(10turn)}}@-webkit-keyframes stylesfadeIn3BlIQ-camelCase{0%{opacity:0}to{opacity:1}}@keyframes stylesfadeIn3BlIQ-camelCase{0%{opacity:0}to{opacity:1}}@media only screen and (max-width:600px){.styleswelcomeText2TfG6-camelCase{font-size:12vw}.styleslifeContainer2Dvjp-camelCase{top:3vw;left:3vw;transform:scale(1.1)}.stylesdeckButton37wic-camelCase{right:0}.stylesdeckButton37wic-camelCase,.stylesdeckButton37wic-camelCase:hover{transform:scale(.8)}.stylescardContainerruDkK-camelCase{transform:scale(1.1);margin:2.5vw 2vw}.stylescloseIcon2b1yp-camelCase{top:2vw;right:2vw}.styleschooseTextj-WK6-camelCase{font-size:54px;bottom:60%}.stylesrestButton3nRTj-camelCase{margin:auto}.stylesrestButton3nRTj-camelCase,.stylesrestButton3nRTj-camelCase:hover{transform:scale(1.5)}.stylesrestButtonContainer___2mc_6-camelCase{top:55%;left:5%;width:90%}.stylesupgradeText_2HDz3-camelCase{font-size:9.25vw;top:6.5%}.styles_upgradeDeckContainer1BQm3-camelCase{top:17.5%;align-content:flex-start;min-height:75%;width:95%;padding:5% 2.5%}.stylesupgradeCardContainer1oCXT-camelCase{width:25vw;height:32.5vw;transform:scale(.95);margin:2vw 3vw}.stylesupgradeCardContainer1oCXT-camelCase:hover{transform:scale(.95)}.styleslifeHealContainer___1m_li-camelCase{transform:scale(2.5)}.stylescardReveal_25IEa-camelCase{transform:scale(1.5);-webkit-animation:styles_spinReveal3fQ1J-camelCase 4s ease-in-out .5s;animation:stylesspinReveal3fQ1J-camelCase 4s ease-in-out .5s}@-webkit-keyframes stylesspinReveal3fQ1J-camelCase{0%{transform:scale(1.5) rotateY(0deg)}to{transform:scale(1.5) rotateY(10turn)}}@keyframes stylesspinReveal3fQ1J-camelCase{0%{transform:scale(1.5) rotateY(0deg)}to{transform:scale(1.5) rotateY(10turn)}}}",""]),t.locals={welcomeText:"styleswelcomeText2TfG6-camelCase",fadeIn:"stylesfadeIn3BlIQ-camelCase",questionContainer:"stylesquestionContainer3oXiO-camelCase",lifeContainer:"styleslifeContainer2Dvjp-camelCase",deckButton:"stylesdeckButton37wic-camelCase",deckIcon:"stylesdeckIcon2bLFK-camelCase",deckText:"stylesdeckText3c0Cj-camelCase",deckContainer:"stylesdeckContainer3aj5d-camelCase",cardContainer:"stylescardContainerruDkK-camelCase",closeIcon:"stylescloseIcon2b1yp-camelCase",chooseText:"styleschooseTextj-WK6-camelCase",restButtonContainer:"stylesrestButtonContainer___2mc_6-camelCase",restButton:"stylesrestButton_3nRTj-camelCase",buttonIcon:"styles_buttonIconDT-7g-camelCase",upgradeDeckContainer:"stylesupgradeDeckContainer1BQm3-camelCase",upgradeCardContainer:"stylesupgradeCardContainer1oCXT-camelCase",upgradeText:"stylesupgradeText2HDz3-camelCase",lifeHealContainer:"styleslifeHealContainer1m_li-camelCase",cardReveal:"stylescardReveal25IEa-camelCase",spinReveal:"stylesspinReveal3fQ1J-camelCase"}},D2f2:function(e,t,a){var s=a("05xZ");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},EzYG:function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("mLw1"),u=a("wIs1"),m=a("4HzQ"),f=a("vDqi"),p=a.n(f),=a("1F66"),d=a.n(),h=a("ZRP+"),y=a("TSYQ"),w=a.n(y),b=a("wd/R"),g=a.n(b),v=(a("RiPy"),a("1b17")),C=a("6bnt"),x=a("5gLy"),k=a("9IXX"),T=a("lDJk"),S=a("iQ+n"),E=a("GIcp"),I=a.n(E),N=a("eDxB"),O=a.n(N),j=a("4otw"),B=a("4CQy"),z=a("e/rn"),R=a("iIA2"),P=a("+kc2"),A=a.n(P),D=a("DoX5"),M=a("H3Sp"),q=a("vimH"),H=a("TN+F"),Q=a("2UHf"),L=a.n(Q),J=a("SdQT");function F(e){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W(e){return function(e){if(Array.isArray(e))return K(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||U(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var a=[],s=!0,o=!1,n=void 0;try{for(var r,i=e[Symbol.iterator]();!(s=(r=i.next()).done)&&(a.push(r.value),!t||a.length!==t);s=!0);}catch(e){o=!0,n=e}finally{try{s||null==i.return||i.return()}finally{if(o)throw n}}return a}(e,t)||U(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(e,t){if(e){if("string"==typeof e)return K(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?K(e,t):void 0}}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,s=new Array(t);a<t;a++)s[a]=e[a];return s}function Y(e,t,a,s,o,n,r){try{var i=en,c=i.value}catch(e){return void a(e)}i.done?t(c):Promise.resolve(c).then(s,o)}function X(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function V(e,t){return(V=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function Z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=te(e);if(t){var o=te(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return $(this,a)}}function $(e,t){return!t||"object"!==F(t)&&"function"!=typeof t?ee(e):t}function ee(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function te(e){return(te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto||Object.getPrototypeOf(e)})(e)}var ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&V(e,t)}(c,e);var t,a,s,n,r,i=Z(c);function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=i.call(this,e)).state={timer:"00:00",players:[],alerts:[],totalToys:0,muted:!!e.host&&e.host.muted,fog:!1,dusk:!1,wind:!1,plow:!1,blizzard:!1,force:!1,canada:!1,trees:[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1]},t.ok=!1,t.dbRefAction={},t.alertContainer=o.a.createRef(),t.goNext=t.goNext.bind(ee(t)),t.addAlert=t.addAlert.bind(ee(t)),t.scrollToBottom=t.scrollToBottom.bind(ee(t)),t.changeMuted=t.changeMuted.bind(ee(t)),t.audio=new Audio(L.a),t.audio.muted=t.state.muted,t}return t=c,(a=[{key:"componentDidMount",value:(n=regeneratorRuntime.mark((function e(){var t,a,s=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.props.host&&this.props.host.settings){e.next=2;break}return e.abrupt("return");case 2:return this.audio.volume=.4,this.audio.play(),this.audio.addEventListener("ended",(function(){s.audio.currentTime=0,s.audio.play()}),!1),this.go=!0,p.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,this.props.firebase.setStage({id:this.props.host.id,stage:"toy"}),"Time"===this.props.host.settings.mode?(t=60this.props.host.settings.amount,a=4,this.setState({timer:g.a.duration(t,"seconds").format("mm:ss")}),this.timerInterval=setInterval((function(){t-=1,s.setState({timer:g.a.duration(t,"seconds").format("mm:ss")}),t<=0?(s.getClients(!0),clearInterval(s.timerInterval)):0===a?(s.getClients(!1),a=4):a-=1}),1e3)):this.clientsInterval=setInterval((function(){s.getClients(!1)}),4e3),e.next=11,this.props.firebase.getDatabaseRef(this.props.host.id,"act");case 11:this.dbRefAction=e.sent,this.dbRefAction.on("value",(function(e){if(e.val()&&e.val().s){var t=B.b[e.val().s];"Oh Canada"===t?(clearTimeout(s.canadaTimeout),s.setState({canada:!1},(function(){s.setState({canada:!0},(function(){s.canadaTimeout=setTimeout((function(){s.setState({canada:!1})}),1e4)}))}))):"Blizzard"===t?(clearTimeout(s.blizzardTimeout),s.setState({blizzard:!1},(function(){s.setState({blizzard:!0},(function(){s.blizzardTimeout=setTimeout((function(){s.setState({blizzard:!1})}),17e3)}))}))):"Fog Spell"===t?(clearTimeout(s.fogTimeout),s.setState({fog:!1},(function(){s.setState({fog:!0},(function(){s.fogTimeout=setTimeout((function(){s.setState({fog:!1})}),8e3)}))}))):"Dark & Dusk"===t?(clearTimeout(s.duskTimeout),s.setState({dusk:!1},(function(){s.setState({dusk:!0},(function(){s.duskTimeout=setTimeout((function(){s.setState({dusk:!1})}),1e4)}))}))):"Howling Wind"===t?(clearTimeout(s.windTimeout),s.setState({wind:!1},(function(){s.setState({wind:!0},(function(){s.windTimeout=setTimeout((function(){s.setState({wind:!1})}),7050)}))}))):"TREES"===t?(clearTimeout(s.treeTimeout),s.setState({trees:[!0,!0,!0,!0,!0,!0,!0,!0,!0,!0]},(function(){s.treeTimeout=setTimeout((function(){s.setState({trees:[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1]})}),8050)}))):"Snow Plow"===t?(clearTimeout(s.plowTimeout),s.setState({plow:!1},(function(){s.setState({plow:!0},(function(){s.plowTimeout=setTimeout((function(){s.setState({plow:!1})}),8050)}))}))):"Use The Force"===t&&(clearTimeout(s.forceTimeout),s.setState({force:!1},(function(){s.setState({force:!0},(function(){s.forceTimeout=setTimeout((function(){s.setState({force:!1})}),18100)}))}))),s.addAlert(e.val().n,e.val().b,'sabotaged with "'.concat(t,'"'))}})),this.alertContainer=document.querySelector("#alerts");case 14:case"end":return e.stop()}}),e,this)})),r=function(){var e=this,t=arguments;return new Promise((function(a,s){var o=n.apply(e,t);function r(e){Y(o,a,s,r,i,"next",e)}function i(e){Y(o,a,s,r,i,"throw",e)}r(void 0)}))},function(){return r.apply(this,arguments)})},{key:"componentWillUnmount",value:function(){var e=this;clearInterval(this.timerInterval),clearInterval(this.clientsInterval),clearTimeout(this.canadaTimeout),clearTimeout(this.blizzardTimeout),clearTimeout(this.fogTimeout),clearTimeout(this.duskTimeout),clearTimeout(this.windTimeout),clearTimeout(this.plowTimeout),clearTimeout(this.forceTimeout),clearTimeout(this.treeTimeout),!this.ok&&this.props.host&&this.props.host.id&&(p.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,p.a.delete("/api/firebase/host",{params:{id:this.props.host.id}}).catch((function(e){return console.error(e)})),this.props.deleteHost(),window.removeEventListener("beforeunload",H.s)),this.audio.currentTime=0,this.audio.pause(),this.audio.removeEventListener("ended",(function(){e.audio.currentTime=0,e.audio.play()}),!1)}},{key:"getClients",value:function(e){var t=this;this.props.firebase.getDatabaseVal(this.props.host.id,"c",(function(a){var s=a||{};if(s&&0!==Object.keys(s).length){var o="Amount"===t.props.host.settings.mode,n=!1,r=Object.entries(s).map((function(e){var t=G(e,2),a=t[0],s=t[1];return{name:a,blook:s.b,toys:s.t||0,attack:s.at||s.oat}}));r.sort((function(e,t){return t.toys-e.toys}));for(var i=0,c=0;c<r.length;c++)r[c].place=c+1,i+=r[c].toys,o&&r[c].toys>=t.props.host.settings.amount&&(n=!0);r.forEach((function(e){if(e.attack){var a=e.attack.split(":"),s=0;s="swap"===a[2]?"just swapped toys with ".concat(e.name):"just stole ".concat(Object(H.l)(a[2])," ").concat("1"===a[2]?"toy":"toys"," from ").concat(e.name),t.addAlert(a[0],a[1],s)}})),n||e?t.goNext(W(r)):t.setState({players:r,totalToys:i})}}))}},{key:"goNext",value:function(e){var t=this;this.go=!1,this.props.updateStandings(e);var a=e.map((function(e){return{n:e.name,b:e.blook,t:e.toys,p:e.place}}));this.props.firebase.setVal({id:this.props.host.id,path:"st",val:a},(function(){p.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,t.props.firebase.setStage({id:t.props.host.id,stage:"fin"},(function(){t.ok=!0,t.props.history.push("/host/toy/final")}))}))}},{key:"addAlert",value:function(e,t,a,s){var o=this,n=[].concat(W(this.state.alerts),[{name:e,blook:t,msg:a,info:s}]),r=Array.from(new Set(n.map((function(e){return e.msg})))).map((function(e){return n.find((function(t){return t.msg===e}))}));r.length>15&&r.splice(0,1),this.setState({alerts:r},(function(){return o.scrollToBottom()}))}},{key:"scrollToBottom",value:function(){this.alertContainer.scrollTop=this.alertContainer.scrollHeight}},{key:"changeMuted",value:function(){var e=this;this.setState({muted:!this.state.muted},(function(){e.audio.muted=e.state.muted,e.props.setMuted(e.state.muted)}))}},{key:"render",value:function(){var e,t,a,s=this;return this.props.host&&this.props.host.settings?o.a.createElement("div",{className:I.a.body,style:{overflow:"hidden",backgroundColor:"#fff",filter:this.state.fog&&this.state.dusk?"grayscale(100%) blur(2px)":this.state.fog?"blur(2px)":this.state.dusk?"grayscale(100%)":null}},o.a.createElement(S.a,{title:"Host Blooket",desc:"Host a game of Blooket with any question set. Then, have players join and answer questions to compete in an action-packed activity."}),o.a.createElement(k.a,{left:"Blooket",center:"Time"===this.props.host.settings.mode?this.state.timer:"Goal: ".concat(Object(H.l)(this.props.host.settings.amount)),right:this.props.host.settings.lateJoin?"ID: ".concat(this.props.host.id):"",muted:this.state.muted,changeMuted:this.changeMuted,onRightClick:function(){return s.getClients(!0)}}),o.a.createElement("div",{className:w()(I.a.hostRegularBody,O.a.winterBackground,(e={},t=O.a.wind,a=this.state.wind,t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e))},o.a.createElement("img",{src:A.a,alt:"Moutains",className:O.a.mountainsBackground,draggable:!1}),o.a.createElement(d.a,{data:this.state.players,keyAccessor:function(e){return e.name},start:function(e){return{opacity:1,x:-60,y:12.5(e.place-1)}},enter:function(e){return{opacity:[1],x:[0],y:[12.5(e.place-1)],timing:{duration:1e3,ease:h.a}}},update:function(e){return{opacity:[1],x:[0],y:[12.5(e.place-1)],timing:{duration:500,ease:h.a}}},leave:function(){return{opacity:[1e-6],x:[-60],timing:1e3}}},(function(e){return o.a.createElement("div",{className:w()(O.a.left,O.a.invisibleScrollbar)},e.map((function(e,t){var a=e.key,s=e.data,n=e.state,r=n.x,i=n.y,c=n.opacity;return o.a.createElement("div",{key:a,style:{opacity:c,transform:"translate(".concat(r,"vw, ").concat(i,"vh)"),position:"absolute",height:"calc(8vh + 25px)",width:"calc(35vw - 5px)",boxSizing:"border-box",padding:7,backgroundColor:t%2==0?"#0cb04a":"#f23941",borderRadius:8,boxShadow:"5px 5px 0 rgba(0, 0, 0, 0.2)",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",willChange:"transform"}},o.a.createElement("div",{className:O.a.standingInside,style:{backgroundColor:t%2==0?"#0cb04a":"#f23941"}},o.a.createElement(m.Textfit,{className:O.a.placeText,mode:"single",forceSingleModeWidth:!1,min:1,max:Object(H.z)("5vw")},s.place),o.a.createElement("div",{className:O.a.superPlaceText},Object(H.f)(s.place)),o.a.createElement(D.a,{name:s.blook,className:O.a.blookBox}),o.a.createElement(m.Textfit,{className:O.a.nameText,mode:"single",forceSingleModeWidth:!1,min:1,max:Object(H.z)("4vw")},s.name),o.a.createElement("div",{className:O.a.toyContainer},o.a.createElement(m.Textfit,{className:O.a.toyText,mode:"single",forceSingleModeWidth:!1,min:1,max:Object(H.z)("5vw")},s.toys<1e4?Object(H.l)(s.toys):Object(H.t)(s.toys)),o.a.createElement("img",{src:z.a,alt:"Toy",className:O.a.toyIcon,draggable:!1}))))})))})),o.a.createElement("div",{className:O.a.chatroom},o.a.createElement("div",{className:w()(O.a.chatroomInside,O.a.invisibleScrollbar),id:"alerts"},this.state.alerts[0]?this.state.alerts.map((function(e){return o.a.createElement(T.a,{key:s.state.alerts.indexOf(e),name:e.name,blook:e.blook,message:e.msg,glitchInfo:e.info,night:!0})})):o.a.createElement("div",{className:O.a.noAlerts},o.a.createElement("i",{className:w()(O.a.noAlertsIcon,"fas fa-snowman")}),o.a.createElement("div",{className:O.a.noAlertsText},"Waiting To Party...")))),o.a.createElement("div",{className:O.a.totalToyContainer},o.a.createElement("div",{className:O.a.totalToyInside},o.a.createElement("div",{className:O.a.totalToyText},Object(H.l)(this.state.totalToys)),o.a.createElement("img",{src:z.a,alt:"Toy",className:O.a.totalToyIcon,draggable:!1})))),this.state.trees.filter((function(e){return e})).length>0?this.state.trees.map((function(e,t){return e?o.a.createElement("div",{className:O.a.treeContainer,style:{top:"".concat(j.b[t].top,"vh"),left:"".concat(j.b[t].left,"vw")},key:t},o.a.createElement("img",{className:O.a.treeImg,src:R.a,alt:"tree",draggable:!1})):null})):null,this.state.plow?o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:O.a.plowSnow}),o.a.createElement(D.a,{name:"Werewolf",className:O.a.plowBlook}),o.a.createElement("i",{className:w()(O.a.plow,"fas fa-snowplow")})):null,this.state.force?o.a.createElement(M.a,null):null,this.state.blizzard?o.a.createElement(q.a,{zIndex:20,count:170}):null,this.state.canada?o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:O.a.canada1}),o.a.createElement("div",{className:O.a.canada2}),o.a.createElement("div",{className:O.a.canada3}),o.a.createElement("i",{className:w()(O.a.canadaIcon,"fab fa-canadian-maple-leaf")})):null):o.a.createElement(l.a,{to:"/dashboard"})}}])&&X(t.prototype,a),s&&X(t,s),c}(o.a.Component);ae.propTypes={host:c.a.object,firebase:c.a.object,history:c.a.object,updateStandings:c.a.func.isRequired,deleteHost:c.a.func.isRequired,setMuted:c.a.func.isRequired};t.a=Object(u.a)(Object(r.b)((function(e){return{host:e.hosts.host}}),(function(e){return Object(n.b)({updateStandings:C.b,deleteHost:x.c,setMuted:v.a},e)}))(Object(J.d)(ae)))},FEc8:function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("wIs1"),u=a("mLw1"),m=a("FLf1"),f=a.n(m),p=a("b6Qr"),=a("TSYQ"),d=a.n(),h=a("vDqi"),y=a.n(h),w=a("4MCU"),b=a("GIcp"),g=a.n(b),v=a("ySkM"),C=a.n(v),x=a("2g2H"),k=a("iQ+n"),T=a("1AT+"),S=a("6hcl"),E=a("tYQ+"),I=a("6Ny9"),N=a("TN+F");function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function B(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?j(Object(a),!0).forEach((function(t){z(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):j(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function z(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function R(e){return function(e){if(Array.isArray(e))return P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return P(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return P(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,s=new Array(t);a<t;a++)s[a]=e[a];return s}function A(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function D(e,t){return(D=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=Q(e);if(t){var o=Q(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return q(this,a)}}function q(e,t){return!t||"object"!==O(t)&&"function"!=typeof t?H(e):t}function H(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q(e){return(Q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto||Object.getPrototypeOf(e)})(e)}var L=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&D(e,t)}(r,e);var t,a,s,n=M(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).state={question:{},phase:"",correct:!1,showDeck:!1,card:{},life:100,healAmount:20,bonusStats:2},t.freeQuestions=[],t.waiting=!1,t.qRemaining=3,t.onAnswer=t.onAnswer.bind(H(t)),t.onHeal=t.onHeal.bind(H(t)),t.getQuestion=t.getQuestion.bind(H(t)),t.answerNext=t.answerNext.bind(H(t)),t.selectCard=t.selectCard.bind(H(t)),t}return t=r,(a=[{key:"componentDidMount",value:function(){var e=this;if(this.props.tower&&"rest"===this.props.tower.stage&&this.props.tower.questions&&this.props.tower.questions.length)if(this.props.tower.artifacts.includes("Anorak's Wizard Cap"))this.props.tower.towerId?(y.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,y.a.put("/api/towers/save",{id:this.props.tower.towerId,stage:"map"}).then((function(){e.props.setTowerStage("map"),e.props.history.push("/tower/map")})).catch((function(e){console.error(e)}))):(this.props.setTowerStage("map"),this.props.history.push("/tower/map"));else{var t=20,a=2;this.props.tower.artifacts.forEach((function(e){"Tasty Egg"===e?t+=7:"Training Weights"===e&&(a+=2)})),t=Math.min(t,100-this.props.tower.life),this.setState({healAmount:t,bonusStats:a,phase:"welcome"}),this.freeQuestions=JSON.parse(JSON.stringify(this.props.tower.freeQuestions)),this.welcomeTimeout=setTimeout((function(){e.getQuestion()}),3e3)}}},{key:"componentWillUnmount",value:function(){clearTimeout(this.welcomeTimeout),clearTimeout(this.waitTimeout),clearTimeout(this.cardTimeout),clearTimeout(this.healTimeout),clearInterval(this.healInterval)}},{key:"onAnswer",value:function(e){if(!this.waiting){this.waiting=!0;var t=this.state.question.correctAnswers.includes(e),a=JSON.parse(JSON.stringify(this.props.tower.corrects)),s=JSON.parse(JSON.stringify(this.props.tower.incorrects)),o=this.state.question.number;t?a[o]?a[o]+=1:a[o]=1:s[o]?s[o]+=1:s[o]=1,this.props.answerTower(a,s,JSON.parse(JSON.stringify(this.freeQuestions))),this.setState({correct:t,phase:"feedback"})}}},{key:"onHeal",value:function(){var e=this;this.setState({life:this.props.tower.life,phase:"healing"},(function(){e.healTimeout=setTimeout((function(){var t=e.state.healAmount;e.healInterval=setInterval((function(){t<=0?(clearInterval(e.healInterval),e.healTimeout=setTimeout((function(){var t=Math.min(e.props.tower.life+e.state.healAmount,100);e.props.tower.towerId?(y.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,y.a.put("/api/towers/save",{id:e.props.tower.towerId,stage:"map",life:t,corrects:e.props.tower.corrects,incorrects:e.props.tower.incorrects}).then((function(){e.props.setTowerLife(t),e.props.setTowerStage("map"),e.props.history.push("/tower/map")})).catch((function(e){console.error(e)}))):(e.props.setTowerLife(t),e.props.setTowerStage("map"),e.props.history.push("/tower/map"))}),1500)):(t-=1,e.setState({life:e.state.life+1}))}),100)}),1500)}))}},{key:"getQuestion",value:function(){var e=this;0===this.freeQuestions.length&&(this.freeQuestions=JSON.parse(JSON.stringify(this.props.tower.questions)));var t=Object(N.m)(this.freeQuestions);this.freeQuestions.splice(this.freeQuestions.indexOf(t),1),t.random&&(t.answers=Object(N.u)(t.answers)),this.setState({question:t,phase:"question"},(function(){e.waiting=!0,e.waitTimeout=setTimeout((function(){e.waiting=!1}),400)}))}},{key:"answerNext",value:function(){this.state.correct?this.qRemaining-=1:(this.props.setTowerStage("map"),this.props.history.push("/tower/map")),this.qRemaining>0?this.getQuestion():this.setState({phase:"rest"})}},{key:"selectCard",value:function(e){var t=this,a=R(this.props.tower.cards),s=B({},a[e]);a[e]=B(B({},s),{},{strength:Math.min(s.strength+this.state.bonusStats,20),charisma:Math.min(s.charisma+this.state.bonusStats,20),wisdom:Math.min(s.wisdom+this.state.bonusStats,20)}),this.setState({card:s,phase:"upgradeReveal"},(function(){t.cardTimeout=setTimeout((function(){t.setState({card:a[e]},(function(){t.cardTimeout=setTimeout((function(){t.props.tower.towerId?(y.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,y.a.put("/api/towers/save",{id:t.props.tower.towerId,stage:"map",cards:a,corrects:t.props.tower.corrects,incorrects:t.props.tower.incorrects}).then((function(){t.props.setTowerStage("map"),t.props.setTowerCards(a),t.props.history.push("/tower/map")})).catch((function(e){console.error(e)}))):(t.props.setTowerStage("map"),t.props.setTowerCards(a),t.props.history.push("/tower/map"))}),3500)}))}),2500)}))}},{key:"render",value:function(){var e=this;if(this.props.tower&&this.props.tower.hwId)this.redirect=!1;else if("undefined"!=typeof window&&localStorage.getItem("token")){var t=localStorage.getItem("token").split(" ");2===t.length?f.a.verify(t[1],"a809c7b3f",(function(t){e.redirect=!!t})):this.redirect=!0}else this.redirect=!0;return!this.redirect&&this.props.tower&&"rest"===this.props.tower.stage&&this.props.tower.questions&&this.props.tower.questions.length?o.a.createElement("div",{className:p.isMobile?g.a.mBody:g.a.body,style:{backgroundColor:"#292929"}},o.a.createElement(k.a,{title:"Play Tower of Doom | Blooket",desc:"Ascend the feared Tower of Doom by answering questions and building a deck to defeat evil Blooks on your way to the top."}),o.a.createElement(x.a,{coins:this.props.tower.coins}),"question"===this.state.phase?o.a.createElement("div",{className:C.a.questionContainer},o.a.createElement(T.a,{onAnswer:this.onAnswer,text:this.state.question.text,answers:this.state.question.answers,image:this.state.question.image})):"feedback"===this.state.phase?o.a.createElement(S.a,{incorrectTime:3,correctAnswers:this.state.question.correctAnswers,correct:this.state.correct,onNext:this.answerNext}):"welcome"===this.state.phase?o.a.createElement("div",{className:g.a.regularBody},o.a.createElement("div",{className:C.a.welcomeText},"Answer 3 Questions Correctly to Rest")):"rest"===this.state.phase?o.a.createElement("div",{className:g.a.regularBody},o.a.createElement("div",{className:C.a.lifeContainer},o.a.createElement(I.a,{currentLife:this.props.tower.life,maxLife:100})),o.a.createElement("div",{className:C.a.deckButton,role:"button",tabIndex:0,onClick:function(){return e.setState({showDeck:!0})}},o.a.createElement("i",{className:d()("fas fa-layer-group",C.a.deckIcon)}),o.a.createElement("div",{className:C.a.deckText},"View Deck")),this.state.showDeck?o.a.createElement("div",{className:C.a.deckContainer},[].concat(R(this.props.tower.artifacts),R(this.props.tower.cards)).map((function(e,t){return o.a.createElement("div",{className:C.a.cardContainer,key:t},o.a.createElement(E.a,{card:e,flipped:!1,isArtifact:!e.blook}))})),o.a.createElement("i",{className:d()("fas fa-times",C.a.closeIcon),role:"button",tabIndex:0,onClick:function(){return e.setState({showDeck:!1})}})):null,o.a.createElement("div",{className:C.a.chooseText},"Choose an Option"),o.a.createElement("div",{className:C.a.restButtonContainer},o.a.createElement("div",{className:C.a.restButton,role:"button",tabIndex:0,style:{backgroundColor:"#ff9933"},onClick:function(){return e.setState({phase:"upgradeSelect"})}},o.a.createElement("i",{className:d()("fas fa-wrench",C.a.buttonIcon)}),"Upgrade",o.a.createElement("span",{style:{fontSize:"2vw"}},"+".concat(this.state.bonusStats," Attributes"))),o.a.createElement("div",{className:C.a.restButton,role:"button",tabIndex:0,style:{backgroundColor:"#33cc33"},onClick:function(){return e.onHeal()}},o.a.createElement("i",{className:d()("fas fa-medkit",C.a.buttonIcon)}),"Recover",o.a.createElement("span",{style:{fontSize:"2vw"}},"+".concat(this.state.healAmount," Health"))))):"upgradeSelect"===this.state.phase?o.a.createElement("div",{className:g.a.regularBody},o.a.createElement("div",{className:C.a.upgradeText},"Choose a Card to Upgrade"),o.a.createElement("div",{className:C.a.upgradeDeckContainer},this.props.tower.cards.map((function(t,a){return o.a.createElement("div",{className:C.a.upgradeCardContainer,key:a,role:"button",tabIndex:0,onClick:function(){return e.selectCard(a)}},o.a.createElement(E.a,{card:t,flipped:!1}))})))):"upgradeReveal"===this.state.phase?o.a.createElement("div",{className:g.a.regularBody},o.a.createElement("div",{className:C.a.upgradeText},"Adding +".concat(this.state.bonusStats," to All Attributes")),o.a.createElement("div",{className:C.a.cardReveal},o.a.createElement(E.a,{card:this.state.card,flipped:!1}))):"healing"===this.state.phase?o.a.createElement("div",{className:g.a.regularBody},o.a.createElement("div",{className:C.a.upgradeText},"Adding +".concat(this.state.healAmount," Health")),o.a.createElement("div",{className:C.a.lifeHealContainer},o.a.createElement(I.a,{currentLife:this.state.life,maxLife:100}))):null):o.a.createElement(u.a,{to:"/login"})}}])&&A(t.prototype,a),s&&A(t,s),r}(o.a.Component);L.propTypes={history:c.a.object.isRequired,tower:c.a.object,answerTower:c.a.func.isRequired,setTowerCards:c.a.func.isRequired,setTowerStage:c.a.func.isRequired,setTowerLife:c.a.func.isRequired};t.a=Object(l.a)(Object(r.b)((function(e){return{tower:e.towers.tower}}),(function(e){return Object(n.b)({answerTower:w.a,setTowerCards:w.c,setTowerStage:w.g,setTowerLife:w.f},e)}))(L))},FeV8:function(e,t,a){"use strict";a.d(t,"a",(function(){return s})),a.d(t,"b",(function(){return o}));var s="CREATE_TOWER",o="LOADTOWER"},Iuzw:function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("wIs1"),u=a("mLw1"),m=a("FLf1"),f=a.n(m),p=a("TkZq"),=a("b6Qr"),d=a("TSYQ"),h=a.n(d),y=a("vDqi"),w=a.n(y),b=a("A0Lk"),g=a.n(b),v=a("9vW0"),C=a("4MCU"),x=a("e78h"),k=a("GIcp"),T=a.n(k),S=a("W0NV"),E=a.n(S),I=a("2g2H"),N=a("iQ+n"),O=a("vPiy"),j=a("hAB6"),B=a.n(j),z=[{text:"This is the map of the 1st level. Each time you play, the maps for each level will be different.",nextButtonText:"Next",className:B.a.centered},{text:"Your goal is to go down the map. Each time you're on this page, you have to pick a highlighted icon to enter that stage.",nextButtonText:"Next",className:B.a.centered},{elementId:"buttonContainer",backgroundColor:"#292929",text:"You can use the 'View Deck' button to view your current Deck, and the 'Map Key' is helpful to learn about what the map icons mean.",nextButtonText:"Next",className:B.a.topRight},{text:"Once you choose a stage, you can't go back. You'll only be able to enter stages lower on the map that are connected by the paths.",nextButtonText:"Next",className:B.a.centered},{text:"Go ahead and click a non-white icon now to enter that stage. Good Luck!",nextButtonText:"Done",className:B.a.centered}],R=a("tYQ+"),P=a("6Ny9"),A=a("TN+F");function D(e){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function M(e){return function(e){if(Array.isArray(e))return q(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return q(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,s=new Array(t);a<t;a++)s[a]=e[a];return s}function H(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function Q(e,t){return(Q=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=F(e);if(t){var o=F(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return J(this,a)}}function J(e,t){return!t||"object"!==D(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function F(e){return(F=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto||Object.getPrototypeOf(e)})(e)}var W={small:{code:"",color:"#6666ff",size:Object(A.z)("1.7vw")},big:{code:"",color:"#ff5050",size:Object(A.z)("2.5vw")},shop:{code:"",color:"#ffff66",size:Object(A.z)("2vw")},rest:{code:"",color:"#ffa31a",size:Object(A.z)("2vw")},risk:{code:"",color:"#cc33ff",size:Object(A.z)("2.2vw")},boss:{code:"",color:"#990000",size:Object(A.z)("7vw")}},G=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Q(e,t)}(r,e);var t,a,s,n=L(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).state={showDeck:!1,showKey:!1,showTour:e.tower&&0===e.tower.currentNode&&e.tower.instruct},t}return t=r,(a=[{key:"componentDidMount",value:function(){var e=this;if(this.props.tower&&"map"===this.props.tower.stage){this.props.tower&&this.props.tower.resultId&&w.a.put("/api/results",{id:this.props.tower.resultId,data:{corrects:this.props.tower.corrects,incorrects:this.props.tower.incorrects,stage:this.props.tower.numNodes,alive:!0}}).catch((function(e){return console.error(e)}));var t=this.props.tower.currentNode,a=this.props.tower.mapNodes,s=0===t?a.filter((function(e){return e.y<10})).map((function(e){return e.id})):a.filter((function(e){return e.id===t}))[0].connected,o=new p.a.DataSet(a.map((function(a){return{id:a.id,x:Object(A.z)("".concat(.isMobile?a.x+.5*(a.x-50):a.x,"vw")),y:Object(A.z)("".concat(a.y).concat(.isMobile?"vh":"vw")),color:"#fff",shape:"icon",icon:{face:'"Font Awesome 5 Free"',weight:"bold",code:t===a.id?"":W[a.type].code,color:t===a.id||e.props.tower.nodePath.includes(a.id)?"#fff":s.includes(a.id)?W[a.type].color:"rgba(255, 255, 255, 0.6)",size:t===a.id?Object(A.z)(.isMobile?"3.5vh":"3vw"):s.includes(a.id)?W[a.type].size+Object(A.z)("1.2vw"):W[a.type].size}}}))),n=[];a.forEach((function(a){a.connected.forEach((function(s){n.push({from:a.id,to:s,width:a.id===t||e.props.tower.nodePath.includes(a.id)&&[].concat(M(e.props.tower.nodePath),[a.id]).includes(s)?3:1})}))}));var r=new p.a.DataSet(n),i=document.getElementById("mynetwork"),c={nodes:o,edges:r},l={interaction:{dragNodes:!1,zoomView:!1,dragView:!0,selectConnectedEdges:!1},autoResize:!1,physics:!1,height:"".concat(Object(A.z)(.isMobile?"110vh":"110vw"),"px"),width:"100%",edges:{dashes:!0,smooth:!1}},u=new p.a.Network(i,c,l);u.on("selectNode",(function(t){if(s.includes(t.nodes[0])){var o=[].concat(M(e.props.tower.nodePath),[t.nodes[0]]),n=e.props.tower.numNodes+1;e.props.addTowerNode(t.nodes[0]);var r=a.filter((function(e){return e.id===t.nodes[0]}))[0];if(e.props.tower.towerId)switch(r.type){case"shop":case"rest":w.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,w.a.put("/api/towers/save",{id:e.props.tower.towerId,stage:r.type,nodePath:o,numNodes:n,currentNode:r.id}).then((function(){e.props.setTowerStage(r.type),e.props.history.push("/tower/".concat(r.type))})).catch((function(e){console.error(e)}));break;case"risk":w.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,w.a.put("/api/towers/save",{id:e.props.tower.towerId,stage:r.type,nodePath:o,numNodes:n,currentNode:r.id,enemy:e.props.tower.artifacts.includes("Dave's Doggo")?"-":e.props.tower.artifacts.includes("Lucky Feather")?Object(A.m)(["+","+","-"]):Object(A.m)(["-","-","+"])}).then((function(t){e.props.setTowerEnemy(t.data.enemy,"small"),e.props.setTowerStage(r.type),e.props.history.push("/tower/".concat(r.type))})).catch((function(e){console.error(e)}));break;case"small":case"big":case"boss":w.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,w.a.put("/api/towers/save",{id:e.props.tower.towerId,stage:r.type,nodePath:o,numNodes:n,currentNode:r.id,enemy:Object(x.b)(r.type,e.props.tower.level)}).then((function(t){e.props.setTowerEnemy(t.data.enemy,r.type),e.props.history.push("/tower/battle")})).catch((function(e){console.error(e)}))}else switch(r.type){case"shop":case"rest":e.props.setTowerStage(r.type),e.props.history.push("/tower/".concat(r.type));break;case"risk":e.props.setTowerEnemy(e.props.tower.artifacts.includes("Dave's Doggo")?"-":e.props.tower.artifacts.includes("Lucky Feather")?Object(A.m)(["+","+","-"]):Object(A.m)(["-","-","+"]),"small"),e.props.setTowerStage(r.type),e.props.history.push("/tower/".concat(r.type));break;case"small":case"big":case"boss":e.props.setTowerEnemy(Object(x.b)(r.type,e.props.tower.level),r.type),e.props.history.push("/tower/battle")}}})),new g.a("FontAwesome",{}).load("",12500).then((function(){e.redrawTimeout=setTimeout((function(){u.redraw()}),1e3)}))}}},{key:"componentWillUnmount",value:function(){clearTimeout(this.redrawTimeout)}},{key:"render",value:function(){var e=this;if(this.props.tower&&this.props.tower.hwId)this.redirect=!1;else if("undefined"!=typeof window&&localStorage.getItem("token")){var t=localStorage.getItem("token").split(" ");2===t.length?f.a.verify(t[1],"a809c7b3f",(function(t){e.redirect=!!t})):this.redirect=!0}else this.redirect=!0;return this.redirect||!this.props.tower||"map"!==this.props.tower.stage?o.a.createElement(u.a,{to:"/login"}):o.a.createElement("div",{className:.isMobile?T.a.mBody:T.a.body,id:"body",style:{backgroundColor:"#292929",overflow:.isMobile?"hidden":null,height:_.isMobile?"100%":null}},o.a.createElement(N.a,{title:"Play Tower of Doom | Blooket",desc:"Ascend the feared Tower of Doom by answering questions and building a deck to defeat evil Blooks on your way to the top."}),o.a.createElement(I.a,{coins:this.props.tower.coins}),o.a.createElement("div",{className:T.a.regularBody,id:"regularBody"},this.state.showTour?o.a.createElement(O.a,{steps:z,onExit:function(){return e.setState({showTour:!1})}}):null,o.a.createElement("div",{className:E.a.header},3===this.props.tower.level?"Final Map":"Level ".concat(this.props.tower.level," Map")),o.a.createElement("div",{className:E.a.subheader},"Choose a Highlighted Location"),o.a.createElement("div",{className:E.a.buttonContainer,id:"buttonContainer"},o.a.createElement("div",{className:E.a.deckButton,role:"button",tabIndex:0,onClick:this.state.showTour?function(){}:function(){return e.setState({showDeck:!0})}},o.a.createElement("i",{className:h()("fas fa-layer-group",E.a.deckIcon)}),o.a.createElement("div",{className:E.a.deckText},"View Deck")),o.a.createElement("div",{className:E.a.deckButton,role:"button",tabIndex:0,onClick:this.state.showTour?function(){}:function(){return e.setState({showKey:!0})}},o.a.createElement("i",{className:h()("fas fa-map",E.a.deckIcon)}),o.a.createElement("div",{className:E.a.deckText},"Map Key"))),o.a.createElement("div",{className:E.a.lifeContainer},o.a.createElement(P.a,{currentLife:this.props.tower.life,maxLife:100})),o.a.createElement("div",{id:"mynetwork",className:E.a.network}),this.state.showDeck?o.a.createElement("div",{className:E.a.deckContainer},[].concat(M(this.props.tower.artifacts),M(this.props.tower.cards)).map((function(e,t){return o.a.createElement("div",{className:E.a.cardContainer,key:t},o.a.createElement(R.a,{card:e,flipped:!1,isArtifact:!e.blook}))})),o.a.createElement("i",{className:h()("fas fa-times",E.a.closeIcon),role:"button",tabIndex:0,onClick:function(){return e.setState({showDeck:!1})}})):this.state.showKey?o.a.createElement("div",{className:T.a.modal,style:{top:55,height:"calc(100% - 55px)"}},o.a.createElement("div",{className:E.a.keyContainer},o.a.createElement("div",{className:E.a.keyHeader},"Map Key"),o.a.createElement("i",{className:h()("fas fa-times",E.a.closeIcon),role:"button",tabIndex:0,onClick:function(){return e.setState({showKey:!1})}}),o.a.createElement("div",{className:E.a.keyRow},o.a.createElement("i",{className:h()("fas fa-bed",E.a.keyIcon),style:{color:"#ffa31a"}}),"Rest to restore health or upgrade cards"),o.a.createElement("div",{className:E.a.keyRow},o.a.createElement("i",{className:h()("fas fa-question",E.a.keyIcon),style:{color:"#cc33ff"}}),"Take a risk with your health and cards"),o.a.createElement("div",{className:E.a.keyRow},o.a.createElement("i",{className:h()("fas fa-store",E.a.keyIcon),style:{color:"#ffff66"}}),"Use coins to remove cards or buy new ones"),o.a.createElement("div",{className:E.a.keyRow},o.a.createElement("i",{className:h()("fas fa-robot",E.a.keyIcon),style:{color:"#6666ff"}}),"Fight an easy enemy for a small reward"),o.a.createElement("div",{className:E.a.keyRow},o.a.createElement("i",{className:h()("fas fa-skull",E.a.keyIcon),style:{color:"#ff5050"}}),"Fight a larger enemy for a better reward"),o.a.createElement("div",{className:E.a.keyRow},o.a.createElement("i",{className:h()("fas fa-exclamation-triangle",E.a.keyIcon),style:{color:"#990000"}}),"Fight the boss to clear the level"),o.a.createElement("div",{style:{height:20}}))):null))}}])&&H(t.prototype,a),s&&H(t,s),r}(o.a.Component);G.propTypes={history:c.a.object.isRequired,tower:c.a.object,setTowerEnemy:c.a.func.isRequired,addTowerNode:c.a.func.isRequired,setTowerStage:c.a.func.isRequired};t.a=Object(l.a)(Object(r.b)((function(e){return{tower:e.towers.tower,client:e.clients.client}}),(function(e){return Object(n.b)({setTowerEnemy:v.b,addTowerNode:v.a,setTowerStage:C.g},e)}))(G))},J34z:function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".stylesheaderi1pep-camelCase{font-size:104px;width:80%;margin:0 auto 20px;padding-top:30px;text-align:center;font-family:Creepster,sans-serif;text-shadow:2px 2px 8px grey;color:#b3ffb3;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.styleswinText1ArvS-camelCase{font-size:38px;margin:0 auto;font-weight:700}.stylesmessageText3JpyB-camelCase,.styleswinText1ArvS-camelCase{width:90%;text-align:center;font-family:Nunito,sans-serif;text-shadow:2px 2px 8px grey;color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stylesmessageText3JpyB-camelCase{font-size:22px;margin:30px auto 5px}.stylesmessageContainer1TXsR-camelCase{display:flex;flex-direction:column;width:90%;border:3px solid #8c8c8c;border-radius:6px;margin:10px auto;font-family:Nunito,sans-serif;text-shadow:2px 2px 8px grey;font-size:18px;color:#fff}.stylesmessagejBJtO-camelCase{width:calc(100% - 20px);word-wrap:break-word;padding:10px}.stylesinputContainer22rDj-camelCase{display:flex;flex-direction:row;width:90%;margin:10px auto 30px}.stylesinput1CFro-camelCase{padding:7px;margin:10px;width:80%;font-size:18px;text-align:left;border:2px solid #8c8c8c;border-radius:6px;background-color:#404040;font-family:Nunito,sans-serif;flex-grow:1}.stylesinput1CFro-camelCase,.stylespostButton2L8pa-camelCase{color:#fff;outline:none}.stylespostButton2L8pa-camelCase{font-size:36px;margin:auto 30px;text-align:center;font-family:Creepster,sans-serif;text-shadow:2px 2px 8px grey;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;transition:.2s}.stylespostButton2L8pa-camelCase:focus,.stylespostButton2L8pa-camelCase:hover{transform:scale(1.03)}.stylesendButton3uthB-camelCase{font-size:52px;width:200px;margin:20px auto 0;text-align:center;font-family:Creepster,sans-serif;text-shadow:2px 2px 8px grey;color:#b3ffb3;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;transition:.2s}.stylesendButton3uthB-camelCase:focus,.stylesendButton3uthB-camelCase:hover{transform:scale(1.03)}",""]),t.locals={header:"stylesheaderi1pep-camelCase",winText:"styleswinText1ArvS-camelCase",messageText:"stylesmessageText3JpyB-camelCase",messageContainer:"stylesmessageContainer1TXsR-camelCase",message:"stylesmessagejBJtO-camelCase",inputContainer:"stylesinputContainer22rDj-camelCase",input:"stylesinput1CFro-camelCase",postButton:"stylespostButton2L8pa-camelCase",endButton:"stylesendButton3uthB-camelCase"}},MfGM:function(e,t,a){"use strict";var s=a("TN+F"),o=[["small",60],["big",13],["shop",9],["rest",8],["risk",10]],n=function(){for(var e=100Math.random(),t=0,a="",s=0;s<o.length;s++)if((t+=o[s][1])>=e){a=o[s][0];break}return a};t.a=function(){for(var e=[],t=[],a=5,o=function(o){e[o]=[0,0,0,0,0,0,0];for(var r=0===Object(s.o)(0,3)?3:4,i=Object(s.o)(r,6),c=[];c.length<i;){var l=Object(s.o)(0,e[o].length);c.includes(l)||c.push(l)}c.sort();var u=0;c.forEach((function(s){var r=t.length+1;e[o][s]=r;var i=Math.min(80,Math.max(8.5s+24+8Math.random()-4,u+5));t.push({id:r,y:a+4Math.random()-2,x:i,type:n(),connected:[]}),u=i})),a+=10},r=0;r<10;r++)o(r);for(var i=[],c=0,l=0;l<9;l++){var u=e[l].map((function(e,t){return 0!==e?t:null})).filter((function(e){return null!==e})),m=e[l+1].map((function(e,t){return 0!==e?t:null})).filter((function(e){return null!==e}));8===l&&(i=e[l+1].filter((function(e){return 0!==e})));for(var f=0,p=!1,=0;<e[l].length;++)if(u.includes()){var d=t[c],h=!1,y=f;if(p){var w=m.indexOf(f);y=w!==m.length-1&&-f>1?m[w+1]:f}for(;!h||y<=(u[u.length-1]===?e[l].length-1:_+1);)0!==e[l+1][y]&&(d.connected.push(e[l+1][y]),h=!0,f=y,p=!0),y+=1;c+=1}}t.push({id:t.length+1,x:50,y:110,color:"#fff",type:"boss",connected:[]});for(var b=t.length,g=0;g<i.length;g++)t[t.length-i.length-1+g].connected.push(b);return t}},NncC:function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".stylesleft2mUuk-camelCase{position:absolute;height:85%;top:6%;width:35vw;padding:1.5% 1.25vw;left:2.5vw;overflow-y:auto}.stylesstandingInside1tY6d-camelCase{background-color:#f23941;border:5px solid #fff;width:100%;height:100%;box-sizing:border-box;display:flex;flex-direction:row;justify-content:space-between}.stylesplaceText36eR4-camelCase{padding:.5vh 0 1vh .5vw;min-width:2.5vw;margin:auto 0;height:5.75vh;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;text-align:right}.stylesplaceText36eR4-camelCase,.stylessuperPlaceText7rJrU-camelCase{color:#fff;font-family:Titan One,sans-serif;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stylessuperPlaceText7rJrU-camelCase{text-align:left;width:1.4vw;font-size:1.2vw;margin-top:4px;margin-left:1px}.stylesblookBox__0J67-camelCase{margin-left:1vw;width:6.25vh;height:7.1875vh;margin-top:.40625vh;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stylesnameText1rqhM-camelCase{font-weight:700;color:#fff;line-height:6vh;padding:1vh 1vw;font-family:Nunito,sans-serif;text-align:left;flex-grow:1}.stylestoyContainer3ENwf-camelCase{height:6vh;margin:1vh 1vw;display:flex;flex-direction:row;align-items:center;justify-content:flex-end}.stylestoyText2FxPY-camelCase{width:6.5vw;height:6vh;color:#fff;font-family:Nunito,sans-serif;text-align:right}.stylestoyIconaD3po-camelCase{height:60%;margin-left:.75vw;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.styleschatroomu4r4U-camelCase{width:55vw;height:calc(65% - 30px);position:absolute;left:42.5vw;top:7.5%;background-color:#f23941;box-shadow:5px 5px 0 rgba(0,0,0,.2);border-radius:8px;padding:10px}.styleschatroomInsideA_cTk-camelCase{background-color:#f23941;border:5px solid #fff;width:100%;height:100%;box-sizing:border-box;overflow:hidden;overflow-y:scroll;padding:15px 0}.stylesinvisibleScrollbar1J8RK-camelCase::-webkit-scrollbar{display:none}.stylesnoAlerts34cux-camelCase{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-content:center;text-align:center;color:#fff}.stylesnoAlertsIcon2kIHC-camelCase{font-size:8vw;margin:0 auto 2vh}.stylesnoAlertsText35BUI-camelCase{font-family:Titan One,sans-serif;font-size:3vw}.stylestotalToyContainer1FOL--camelCase{box-shadow:5px 5px 0 rgba(0,0,0,.2);padding:10px;border-radius:6px;position:absolute;left:45vw;top:80%;width:50vw;height:15%}.stylestotalToyContainer1FOL--camelCase,.stylestotalToyInside36b9r-camelCase{background-color:#0cb04a;box-sizing:border-box;display:flex;flex-direction:row;align-items:center;justify-content:center}.stylestotalToyInside36b9r-camelCase{border:5px solid #fff;width:100%;height:100%}.stylestotalToyText__U8E2-camelCase{color:#fff;font-family:Titan One,sans-serif;font-size:3.5vw}.stylestotalToyIcon1GUcc-camelCase{height:60%;width:auto;margin-left:1.5vw;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.styleswinterBackground2QnBB-camelCase{background-image:linear-gradient(#31aae0,#bdf)}.stylesmountainsBackground3XFur-camelCase{z-index:-1;bottom:0}.stylesmountainsBackground3XFur-camelCase,.stylesplowSnow2rgaP-camelCase{position:absolute;left:0;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stylesplowSnow2rgaP-camelCase{top:0;height:100%;background-color:#fff;box-shadow:0 0 8px 3px rgba(0,0,0,.2);z-index:16;-webkit-animation:stylesplowSnow2rgaP-camelCase 8s linear 0s forwards;animation:stylesplowSnow2rgaP-camelCase 8s linear 0s forwards}@-webkit-keyframes stylesplowSnow2rgaP-camelCase{0%{transform:translateY(100%)}25%{transform:translate(0)}to{transform:translate(140%)}}@keyframes stylesplowSnow2rgaP-camelCase{0%{transform:translateY(100%)}25%{transform:translate(0)}to{transform:translate(140%)}}.stylesplow121wP-camelCase{position:absolute;top:50%;right:0;font-size:30vw;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#ff751a;z-index:16;transform:translate(100vw,-50%);pointer-events:none;-webkit-animation:stylesplow121wP-camelCase 6s linear 2s forwards;animation:stylesplow121wP-camelCase 6s linear 2s forwards}@-webkit-keyframes stylesplow121wP-camelCase{0%{transform:translate(-100vw,-50%)}to{transform:translate(40vw,-50%)}}@keyframes stylesplow121wP-camelCase{0%{transform:translate(-100vw,-50%)}to{transform:translate(40vw,-50%)}}.stylesplowBlookGbb9g-camelCase{position:absolute;top:calc(50% - 6vw);right:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:15;width:10vw;transform:translate(100vw,-50%);pointer-events:none;-webkit-animation:stylesplowBlookGbb9g-camelCase 6s linear 2s forwards;animation:stylesplowBlookGbb9g-camelCase 6s linear 2s forwards}@-webkit-keyframes stylesplowBlookGbb9g-camelCase{0%{transform:translate(-116.5vw,-50%)}to{transform:translate(23.5vw,-50%)}}@keyframes stylesplowBlookGbb9g-camelCase{0%{transform:translate(-116.5vw,-50%)}to{transform:translate(23.5vw,-50%)}}.stylescanada1LlEf5-camelCase{left:0;width:33.3%;background-color:#eb2d37}.stylescanada1LlEf5-camelCase,.stylescanada2___2vB_c-camelCase{position:absolute;top:0;height:100%;opacity:.4;z-index:25;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.stylescanada2_2vB_c-camelCase{left:33.3%;width:33.4%;background-color:#fff}.stylescanada3_I0KA9-camelCase{top:0;right:0;width:33.3%;height:100%;background-color:#eb2d37;z-index:25}.styles_canada3I0KA9-camelCase,.stylescanadaIcon1oyeJ-camelCase{position:absolute;opacity:.4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.stylescanadaIcon1oyeJ-camelCase{top:50%;left:50%;transform:translate(-50%,-50%);font-size:17vw;color:#eb2d37;z-index:26}.styleswind2-I9U-camelCase{position:absolute;top:0;left:0;height:100%;width:100%;-webkit-animation:stylesblow1dJ8F-camelCase 5s linear 2s forwards;animation:stylesblow1dJ8F-camelCase 5s linear 2s forwards}@-webkit-keyframes stylesblow1dJ8F-camelCase{0%{transform:translate(0)}49.5%{transform:translate(100%);opacity:1}49.75%{transform:translate(100%);opacity:0}49.85%{transform:translate(100%,100%);opacity:0}50.15%{transform:translate(-100%,100%);opacity:0}50.25%{transform:translate(-100%);opacity:0}50.5%{transform:translate(-100%);opacity:1}to{transform:translate(0)}}@keyframes stylesblow1dJ8F-camelCase{0%{transform:translate(0)}49.5%{transform:translate(100%);opacity:1}49.75%{transform:translate(100%);opacity:0}49.85%{transform:translate(100%,100%);opacity:0}50.15%{transform:translate(-100%,100%);opacity:0}50.25%{transform:translate(-100%);opacity:0}50.5%{transform:translate(-100%);opacity:1}to{transform:translate(0)}}.stylestreeContainer3dhSj-camelCase{position:absolute;top:50vw;left:50vw;height:20vw;width:20vw;margin-left:-10vw;margin-top:-10vw;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;z-index:12;transition:.5s}.stylestreeImg3Pn13-camelCase{height:100%;width:100%}",""]),t.locals={left:"stylesleft2mUuk-camelCase",standingInside:"stylesstandingInside1tY6d-camelCase",placeText:"stylesplaceText36eR4-camelCase",superPlaceText:"stylessuperPlaceText_7rJrU-camelCase",blookBox:"stylesblookBox__0J67-camelCase",nameText:"stylesnameText_1rqhM-camelCase",toyContainer:"stylestoyContainer3ENwf-camelCase",toyText:"stylestoyText2FxPY-camelCase",toyIcon:"stylestoyIconaD3po-camelCase",chatroom:"styleschatroomu4r4U-camelCase",chatroomInside:"styleschatroomInside___A_cTk-camelCase",invisibleScrollbar:"stylesinvisibleScrollbar_1J8RK-camelCase",noAlerts:"styles_noAlerts34cux-camelCase",noAlertsIcon:"stylesnoAlertsIcon2kIHC-camelCase",noAlertsText:"stylesnoAlertsText35BUI-camelCase",totalToyContainer:"stylestotalToyContainer1FOL--camelCase",totalToyInside:"stylestotalToyInside36b9r-camelCase",totalToyText:"stylestotalToyText__U8E2-camelCase",totalToyIcon:"stylestotalToyIcon1GUcc-camelCase",winterBackground:"styleswinterBackground2QnBB-camelCase",mountainsBackground:"stylesmountainsBackground3XFur-camelCase",plowSnow:"stylesplowSnow2rgaP-camelCase",plow:"stylesplow121wP-camelCase",plowBlook:"stylesplowBlookGbb9g-camelCase",canada1:"stylescanada1LlEf5-camelCase",canada2:"stylescanada22vB_c-camelCase",canada3:"stylescanada3I0KA9-camelCase",canadaIcon:"stylescanadaIcon1oyeJ-camelCase",wind:"styleswind2-I9U-camelCase",blow:"stylesblow1dJ8F-camelCase",treeContainer:"stylestreeContainer3dhSj-camelCase",treeImg:"stylestreeImg3Pn13-camelCase"}},"O+bi":function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("wIs1"),u=a("mLw1"),m=a("FLf1"),f=a.n(m),p=a("vDqi"),=a.n(p),d=a("b6Qr"),h=a("TSYQ"),y=a.n(h),w=a("FeV8");function b(e,t,a,s,o,n){return{type:w.a,towerId:e,resultId:t,questions:a,mapNodes:s,setId:o,hwId:n}}function g(e,t,a,s,o,n){return{type:w.b,saveData:e,towerId:t,resultId:a,questions:s,setId:o,hwId:n}}var v=a("4MCU"),C=a("Tiit"),x=a("epYD"),k=a("XuX+"),T=a("GIcp"),S=a.n(T),E=a("sM3C"),I=a.n(E),N=a("2g2H"),O=a("iQ+n"),j=a("SCqF"),B=a("ZENw"),z=a("bpVs"),R=a("tYQ+"),P=a("5Gl+"),A=a("MfGM");function D(e){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function M(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function q(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?M(Object(a),!0).forEach((function(t){H(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):M(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function H(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Q(e,t,a,s,o,n,r){try{var i=en,c=i.value}catch(e){return void a(e)}i.done?t(c):Promise.resolve(c).then(s,o)}function L(e){return function(){var t=this,a=arguments;return new Promise((function(s,o){var n=e.apply(t,a);function r(e){Q(n,s,o,r,i,"next",e)}function i(e){Q(n,s,o,r,i,"throw",e)}r(void 0)}))}}function J(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function F(e,t){return(F=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=K(e);if(t){var o=K(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return G(this,a)}}function G(e,t){return!t||"object"!==D(t)&&"function"!=typeof t?U(e):t}function U(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K(e){return(K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto||Object.getPrototypeOf(e)})(e)}var Y=function(e){switch(e){case"small":return"fas fa-robot";case"big":return"fas fa-skull";case"shop":return"fas fa-store";case"rest":return"fas fa-bed";case"risk":return"fas fa-question";case"boss":return"fas fa-exclamation-triangle";default:return"fas fa-map"}},X=function(e){return o.a.createElement("div",{className:I.a.stageText},33===e.stagesCleared?"You Won!":"".concat(e.stagesCleared," ").concat(1===e.stagesCleared?"Stage":"Stages"))},V=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&F(e,t)}(r,e);var t,a,s,n=W(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).state={questions:[],ready:!1,isSave:!1,warn:!1,loggedIn:!1,savesPhase:!1,savesArray:[],loading:!1,replaceIndex:0,name:"",nameUsed:"",numCorrect:0,numQuestions:0,stagesCleared:0,message:"",showFinal:!1,standings:[],noId:!1,noIdPopUp:!1,noQuestions:!1},t.redirect=!1,t.name="",t.stripe="",t.working=!0,t.here=!0,t.loadGame=t.loadGame.bind(U(t)),t.newGame=t.newGame.bind(U(t)),t.endGame=t.endGame.bind(U(t)),t}return t=r,(a=[{key:"componentDidMount",value:function(){var e=this;if(this.props.deleteTower(),"undefined"!=typeof window&&localStorage.getItem("token")){var t=localStorage.getItem("token").split(" ");2===t.length&&f.a.verify(t[1],"a809c7b3f",(function(t,a){t||(e.name=a.name,e.stripe=a.stripe,e.setState({loggedIn:!0}),.a.get("/api/towers/byuser",{params:{name:e.name}}).then((function(t){e.here&&e.setState({isSave:t.data.success&&!(e.props.client&&e.props.client.hwId&&e.props.client.questions),savesArray:t.data.success?t.data.savesArray:[null,null,null]},(function(){e.working=!1}))})).catch((function(e){console.error(e)})))}))}this.props.client&&this.props.client.hwId&&this.props.client.questions?(this.working=!1,this.setState({questions:this.props.client.questions,ready:!0})):this.props.id?.a.get("/api/games",{params:{gameId:this.props.id}}).then((function(t){e.here&&e.setState({questions:t.data.questions.map((function(e){return{text:e.question,answers:e.answers,correctAnswers:e.correctAnswers,number:e.number,random:e.random,image:e.image?e.image.url:null}})),ready:!0})})).catch((function(e){console.error(e)})):this.setState({noId:!0,ready:!0})}},{key:"componentWillUnmount",value:function(){this.here=!1}},{key:"loadGame",value:function(e){if(this.state.ready&&!this.working){this.working=!0;var t=this.state.savesArray[e],a=[],s=!1,o=this;!function(){n.apply(this,arguments)}()}function n(){return(n=L(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.setId){e.next=9;break}if(!o.state.noId){e.next=6;break}return e.next=4,new Promise((function(e){.a.get("/api/games",{params:{gameId:t.setId}}).then((function(t){t.data?a=t.data.questions.map((function(e){return{text:e.question,answers:e.answers,correctAnswers:e.correctAnswers,number:e.number,random:e.random,image:e.image?e.image.url:null}})):s=!0,e()})).catch((function(e){console.error(e)}))}));case 4:e.next=7;break;case 6:a=o.state.questions;case 7:e.next=11;break;case 9:return e.next=11,new Promise((function(e){_.a.get("/api/homeworks/byid",{params:{id:t.hwId}}).then((function(t){t.data?a=t.data.questions:o.state.noId?s=!0:a=o.state.questions,e()})).catch((function(e){console.error(e)}))}));case 11:if(!s){e.next=15;break}return o.setState({noIdPopUp:!0,noQuestions:!0}),o.working=!1,e.abrupt("return");case 15:t.hwName&&(o.props.addClientName(t.hwName),o.props.addHwClient(t.hwId,"Tower",0,t.hwPlus)),o.props.loadTower(t,t.id,t.resultId,a,t.setId,t.hwId),["small","big","boss"].includes(t.stage)?o.props.history.push("/tower/battle"):"victory"===t.stage?(o.props.setTowerStage("final"),o.props.history.push("/tower/final")):o.props.history.push("/tower/".concat(t.stage));case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}}},{key:"newGame",value:function(e){if(this.state.ready&&!this.working){this.working=!0;var t=Object(A.a)(),a=this;!function(){s.apply(this,arguments)}()}function s(){return(s=L(regeneratorRuntime.mark((function s(){var o,n;return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(o="",!a.props.client||!a.props.client.hwId){s.next=4;break}return s.next=4,new Promise((function(e,t){.a.post("/api/results",{hwId:a.props.client.hwId,name:a.props.client.name,data:{corrects:{},incorrects:{},stage:0,alive:!0}}).then((function(t){o=t.data.id,e()})).catch((function(e){console.error(e),t()}))}));case 4:if(n={},!a.name){s.next=9;break}return s.next=8,new Promise((function(s,n){.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,.a.post("/api/towers",{setId:a.props.id,name:a.name,mapNodes:t,hwId:a.props.client&&a.props.client.hwId?a.props.client.hwId:null,hwName:a.props.client&&a.props.client.name?a.props.client.name:null,hwPlus:!(!a.props.client||!a.props.client.plus)&&a.props.client.plus,saveIndex:e,resultId:o}).then((function(e){localStorage.setItem("token",e.data.token),s(e.data)})).catch((function(e){console.error(e),n()}))}));case 8:n=s.sent;case 9:a.props.createTower(n.newSaveId,o,a.state.questions,t,a.props.id,a.props.client&&a.props.client.hwId?a.props.client.hwId:null),n.oldSave&&n.oldSave.stage?a.endGame(n.oldSave):a.props.history.push("/tower/start");case 11:case"end":return s.stop()}}),s)})))).apply(this,arguments)}}},{key:"endGame",value:function(e){var t=this;.a.put("/api/users/plan",{name:this.name,stripeId:this.stripe}).then((function(e){t.here&&t.setState({showFinal:!0,plus:"Starter"!==e.data.plan})})).catch((function(e){console.error(e)}));var a=e.hwName||"You",s=0,o=0;Object.values(e.corrects).forEach((function(e){s+=e,o+=e})),Object.values(e.incorrects).forEach((function(e){o+=e}));var n=Math.max(e.numNodes,0),r=34-n,i="Chick",c=0;e.cards.forEach((function(e){var t=e.strength+e.charisma+e.wisdom;t>c&&(c=t,i=e.blook)})),.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,.a.put("/api/users/towerstats",{name:this.name,place:r,stagesCleared:n,blookUsed:i,nameUsed:a,correctAnswers:s}).catch((function(e){console.error(e)})),this.setState({warn:!1,name:this.name,nameUsed:a,numCorrect:s,numQuestions:o,stagesCleared:n,message:Object(z.a)((r-1)/33),showFinal:!this.name||this.state.showFinal,standings:[{name:a,blook:i,place:r,stagesCleared:n}]})}},{key:"render",value:function(){var e=this;if(this.props.client&&this.props.client.hwId)this.redirect=!1;else if("undefined"!=typeof window&&localStorage.getItem("token")){var t=localStorage.getItem("token").split(" ");2===t.length?f.a.verify(t[1],"a809c7b3f",(function(t){e.redirect=!!t})):this.redirect=!0}else this.redirect=!0;return this.redirect||this.state.ready&&(!this.state.questions||0===this.state.questions.length)&&!this.state.noId?o.a.createElement(u.a,{to:"/login"}):o.a.createElement("div",{className:d.isMobile?S.a.mBody:S.a.body,style:{backgroundColor:"#292929"}},o.a.createElement(O.a,{title:"Load Tower of Doom | Blooket",desc:"Start a new game or load a saved game of Blooket's Tower of Doom."}),o.a.createElement(N.a,{noRight:!0}),this.state.savesPhase?o.a.createElement("div",{className:S.a.regularBody},o.a.createElement("div",{className:I.a.backButton,role:"button",tabIndex:0,onClick:function(){return e.setState({savesPhase:!1,loading:!1})}},"Back"),o.a.createElement("div",{className:I.a.savesHeader},this.state.loading?"Choose a Save":"Choose a Save Slot"),o.a.createElement("div",{className:I.a.savesHolder},this.state.savesArray.map((function(t,a){return t?o.a.createElement("div",{className:I.a.saveContainer,key:t._id},o.a.createElement("div",{className:I.a.saveTitle},"Stage ".concat(t.nodePath.length)),o.a.createElement("div",{className:I.a.saveSubTitle},"Level ".concat(t.level)),o.a.createElement("div",{className:I.a.saveRow},t.coins,o.a.createElement("i",{className:y()(I.a.saveIcon,"fas fa-coins")})),o.a.createElement("div",{className:I.a.saveRow},t.stage.charAt(0).toUpperCase()+t.stage.slice(1),o.a.createElement("i",{className:y()(I.a.saveIcon,Y(t.stage))})),o.a.createElement("div",{className:I.a.saveRow},t.hwName||"Not Homework",o.a.createElement("i",{className:y()(I.a.saveIcon,"fas fa-file-alt")})),o.a.createElement("div",{className:I.a.saveRow},o.a.createElement("div",{className:I.a.saveHealthHolder},o.a.createElement("div",{className:I.a.saveHealthBar,style:{transform:"scaleX(".concat(t.life/100,")")}})),o.a.createElement("i",{className:y()(I.a.saveIcon,"fas fa-heart")})),o.a.createElement("div",{className:I.a.loadButton,role:"button",tabIndex:0,onClick:e.state.loading?function(){return e.loadGame(a)}:e.state.noId?function(){return e.setState({noIdPopUp:!0})}:function(){return e.setState({warn:!0,replaceIndex:a})}},e.state.loading?"Load Game":"Replace Game")):o.a.createElement("div",{className:I.a.saveContainer,key:a},o.a.createElement("div",{className:I.a.emptySave},"Empty"),e.state.loading?null:o.a.createElement("div",{className:I.a.loadButton,role:"button",tabIndex:0,onClick:e.state.noId?function(){return e.setState({noIdPopUp:!0})}:function(){return e.newGame(a)}},"New Game"))})))):o.a.createElement("div",{className:S.a.regularBody,style:{display:"flex",flexDirection:"column",justifyContent:"center",overflow:"hidden"}},o.a.createElement("div",{className:I.a.header},"Tower",o.a.createElement("br",null),"of Doom"),o.a.createElement("div",{className:I.a.buttonContainer},this.state.isSave?o.a.createElement("div",{className:I.a.button,role:"button",tabIndex:0,onClick:function(){return e.setState({savesPhase:!0,loading:!0})}},"Load Game"):null,o.a.createElement("div",{className:I.a.button,role:"button",tabIndex:0,onClick:this.state.loggedIn?function(){return e.setState({savesPhase:!0,loading:!1})}:this.newGame},"New Game")),o.a.createElement("div",{className:y()(I.a.cardContainer,I.a.card1)},o.a.createElement(R.a,{card:q({blook:"Chicken"},P.c.Chicken),flipped:!1})),o.a.createElement("div",{className:y()(I.a.cardContainer,I.a.card2)},o.a.createElement(R.a,{card:q({blook:"Goldfish"},P.c.Goldfish),flipped:!1})),o.a.createElement("div",{className:y()(I.a.cardContainer,I.a.card3)},o.a.createElement(R.a,{card:q({blook:"Wizard"},P.c.Wizard),flipped:!1})),o.a.createElement("div",{className:y()(I.a.cardContainer,I.a.card4)},o.a.createElement(R.a,{card:q({blook:"Tiger"},P.c.Tiger),flipped:!1})),o.a.createElement("div",{className:y()(I.a.cardContainer,I.a.card5)},o.a.createElement(R.a,{card:q({blook:"Arctic Fox"},P.c["Arctic Fox"]),flipped:!1})),this.state.loggedIn?o.a.createElement("div",{className:I.a.loginText},"Your progress will automatically be saved"):o.a.createElement("div",{className:I.a.loginText},o.a.createElement("a",{href:"https://www.blooket.com/login",target:"_blank",rel:"noopener noreferrer",style:{color:"#fff"}},"Login")," to save your progress")),this.state.warn?o.a.createElement(j.a,{text:"Starting a new game will delete this save! Don't worry though, we'll give you the tokens for your old save right now!",isDark:!0,buttonOne:{text:"Continue",click:function(){return e.newGame(e.state.replaceIndex)},color:"white"},buttonTwo:{text:"Go Back",click:function(){return e.setState({warn:!1})},color:"white"}}):this.state.noIdPopUp?o.a.createElement(j.a,{text:this.state.noQuestions?"This save doesn't have an associated question set. Go find a set, click 'Solo', and try again!":"You need a question set to create a new game!",isDark:!0,buttonOne:{text:"Find A Set",click:function(){return e.props.history.push("/discover")},color:"white"},buttonTwo:{text:"Go Back",click:function(){return e.setState({noIdPopUp:!1,noQuestions:!1})},color:"white"}}):null,this.state.showFinal?o.a.createElement("div",{className:S.a.modal},o.a.createElement(B.a,{standings:this.state.standings,name:this.state.nameUsed,numCorrect:this.state.numCorrect,numQuestions:this.state.numQuestions,username:this.state.name,plus:this.state.plus,myStat:33===this.state.stagesCleared?"You Won!":"Cleared ".concat(this.state.stagesCleared," ").concat(1===this.state.stagesCleared?"Stage":"Stages"),saveStats:this.saveStats,renderStandingStat:X,renderStats:function(){},customMessage:this.state.message,tokenMultiplier:.3,buttonFunc:function(){return e.props.history.push("/tower/start")},noWait:!0})):null)}}])&&J(t.prototype,a),s&&J(t,s),r}(o.a.Component);V.propTypes={client:c.a.object,history:c.a.object.isRequired,id:c.a.string,deleteTower:c.a.func.isRequired};t.a=Object(l.a)(Object(r.b)((function(e){return{id:e.hosts.id,client:e.clients.client}}),(function(e){return Object(n.b)({createTower:b,loadTower:g,deleteTower:C.a,setTowerStage:v.g,addClientName:k.a,addHwClient:x.b},e)}))(V))},PfDG:function(e,t,a){"use strict";a.d(t,"b",(function(){return s})),a.d(t,"a",(function(){return o}));var s="SET_TOWER_ENEMY",o="ADD_TOWER_NODE"},Qz0i:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var s="NEW_TOWER_LEVEL"},SLYh:function(e,t,a){"use strict";a.d(t,"a",(function(){return s})),a.d(t,"c",(function(){return o})),a.d(t,"g",(function(){return n})),a.d(t,"d",(function(){return r})),a.d(t,"f",(function(){return i})),a.d(t,"b",(function(){return c})),a.d(t,"e",(function(){return l}));var s="ANSWER_TOWER",o="SET_TOWER_CARDS",n="SET_TOWER_STAGE",r="SET_TOWER_COINS",i="SET_TOWER_LIFE",c="SET_TOWER_ARTIFACTS",l="SET_TOWER_INSTRUCT"},Tiit:function(e,t,a){"use strict";a.d(t,"a",(function(){return o}));var s=a("a9gz");function o(){return{type:s.a}}},W0NV:function(e,t,a){var s=a("W9fG");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},W9fG:function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".stylesheaderjX3nL-camelCase{font-size:72px;font-family:Creepster,sans-serif;color:#b3ffb3;margin:30px auto 10px}.stylesheaderjX3nL-camelCase,.stylessubheader3jhcz-camelCase{text-shadow:2px 2px 8px grey;text-align:center;width:80%}.stylessubheader3jhcz-camelCase{font-size:30px;font-family:Nunito,sans-serif;font-weight:700;color:#fff;margin:10px auto}.stylesnetworkdt-xI-camelCase{position:absolute;top:150px;left:-1px;width:100%;height:110vw;outline:none;border:none}.stylesbuttonContainer2B1Ty-camelCase{position:absolute;top:0;right:0;padding:1vw;display:flex;flex-direction:column;align-items:flex-end}.stylesdeckButton2VFUP-camelCase{display:flex;flex-direction:row;align-items:center;color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;cursor:pointer;margin:0;transition:.2s}.stylesdeckButton2VFUP-camelCase:hover{transform:scale(.95)}.stylesdeckIcon2PBRf-camelCase{font-size:27px;margin-right:10px}.stylesdeckIcon2PBRf-camelCase,.stylesdeckTexti5Nvz-camelCase{text-shadow:2px 2px 8px grey}.stylesdeckTexti5Nvz-camelCase{font-family:Nunito,sans-serif;font-weight:700;font-size:30px}.stylesdeckContainer2fv8P-camelCase{position:absolute;top:0;left:0;width:calc(100% - 10vw);min-height:calc(100% - 10vh);padding:5vh 5vw;background-color:rgba(0,0,0,.8);z-index:3;display:flex;flex-flow:row wrap;align-content:flex-start}.stylescardContainer1JWIk-camelCase{width:25vw;height:32.5vw;transform:scale(.7);margin:-4vw -1.5vw}.stylescloseIcon3jw48-camelCase{font-size:30px;text-shadow:2px 2px 8px grey;cursor:pointer;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;top:1vw;right:1vw;color:#fff;transition:.2s}.stylescloseIcon3jw48-camelCase:focus,.stylescloseIcon3jw48-camelCase:hover{transform:scale(1.05)}.styleslifeContainerVRgfN-camelCase{position:absolute;top:0;left:0;height:15vw;width:15vw;transform:scale(.6)}.styleskeyContainer1jSjm-camelCase{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);max-width:650px;min-width:600px;max-height:90%;background-color:#292929;color:#fff;font-family:Nunito,sans-serif;box-shadow:0 0 8px 3px rgba(0,0,0,.2);border-radius:7px;text-align:center;display:flex;flex-direction:column;overflow-x:hidden;overflow-y:scroll}.styleskeyContainer1jSjm-camelCase::-webkit-scrollbar{width:12px;margin-right:10px}.styleskeyContainer1jSjm-camelCase::-webkit-scrollbar-thumb{background:#888;border-radius:10px}.styleskeyContainer1jSjm-camelCase::-webkit-scrollbar-thumb:hover{background:#777;border-radius:10px}.styleskeyHeader1r7X5-camelCase{font-size:52px;font-family:Creepster,sans-serif;text-shadow:2px 2px 8px grey;color:#b3ffb3;margin:10px auto}.styleskeyRow3Icej-camelCase{display:flex;flex-direction:row;align-items:center;width:90%;margin:9px auto;font-size:18px}.styleskeyIconS4dha-camelCase{width:60px;font-size:36px;text-align:center;margin-right:10px}@media only screen and (max-width:800px){.stylesheaderjX3nL-camelCase{font-size:52px;margin-top:70px}.stylessubheader3jhcz-camelCase{font-size:24px}.stylesnetworkdt-xI-camelCase{top:200px}.stylesbuttonContaner27vMN-camelCase{right:0}.stylesdeckButton2VFUP-camelCase{margin:2px 5px}.stylesdeckIcon2PBRf-camelCase{font-size:22px}.stylesdeckTexti5Nvz-camelCase{font-size:20px}.stylesdeckContainer2fv8P-camelCase{height:100%;overflow-y:auto}.stylescardContainer1JWIk-camelCase{transform:scale(1.1);margin:2.5vw 2vw}.stylescloseIcon3jw48-camelCase{top:2vw;right:2vw}.styleslifeContainerVRgfN-camelCase{top:3vw;left:3vw;transform:scale(1.1)}.styleskeyContainer1jSjm-camelCase{min-width:100px;width:90%}}",""]),t.locals={header:"stylesheaderjX3nL-camelCase",subheader:"stylessubheader3jhcz-camelCase",network:"stylesnetworkdt-xI-camelCase",buttonContainer:"stylesbuttonContainer2B1Ty-camelCase",deckButton:"stylesdeckButton2VFUP-camelCase",deckIcon:"stylesdeckIcon2PBRf-camelCase",deckText:"stylesdeckTexti5Nvz-camelCase",deckContainer:"stylesdeckContainer2fv8P-camelCase",cardContainer:"stylescardContainer1JWIk-camelCase",closeIcon:"stylescloseIcon3jw48-camelCase",lifeContainer:"styleslifeContainerVRgfN-camelCase",keyContainer:"styleskeyContainer1jSjm-camelCase",keyHeader:"styleskeyHeader1r7X5-camelCase",keyRow:"styleskeyRow3Icej-camelCase",keyIcon:"styleskeyIconS4dha-camelCase",buttonContaner:"stylesbuttonContaner__27vMN-camelCase"}},X0QI:function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("mLw1"),u=a("wIs1"),m=a("vDqi"),f=a.n(m),p=a("1b17"),=a("5gLy"),d=a("9IXX"),h=a("iQ+n"),y=a("GIcp"),w=a.n(y),b=a("c4kv"),g=a("4uRJ"),v=a.n(g),C=a("SdQT"),x=a("TN+F");function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=O(e);if(t){var o=O(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return I(this,a)}}function I(e,t){return!t||"object"!==k(t)&&"function"!=typeof t?N(e):t}function N(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto||Object.getPrototypeOf(e)})(e)}var j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(r,e);var t,a,s,n=E(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).state={muted:!!e.host&&e.host.muted},t.ok=!1,t.skip=t.skip.bind(N(t)),t.changeMuted=t.changeMuted.bind(N(t)),t.audio=new Audio(v.a),t.audio.muted=t.state.muted,t}return t=r,(a=[{key:"componentDidMount",value:function(){var e=this;this.props.host&&this.props.host.settings&&(this.audio.volume=.45,this.audio.play(),this.audio.addEventListener("ended",(function(){e.audio.currentTime=0,e.audio.play()}),!1),this.timeout=setTimeout((function(){e.skip()}),14500))}},{key:"componentWillUnmount",value:function(){var e=this;clearTimeout(this.timeout),!this.ok&&this.props.host&&this.props.host.id&&(f.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,f.a.delete("/api/firebase/host",{params:{id:this.props.host.id}}).catch((function(e){return console.error(e)})),this.props.deleteHost(),window.removeEventListener("beforeunload",x.s)),this.audio.currentTime=0,this.audio.pause(),this.audio.removeEventListener("ended",(function(){e.audio.currentTime=0,e.audio.play()}),!1)}},{key:"skip",value:function(){this.ok=!0,this.props.history.push("/host/toy")}},{key:"changeMuted",value:function(){var e=this;this.setState({muted:!this.state.muted},(function(){e.audio.muted=e.state.muted,e.props.setMuted(e.state.muted)}))}},{key:"render",value:function(){var e=this;return this.props.host&&this.props.host.settings?o.a.createElement("div",{className:w.a.body},o.a.createElement(h.a,{title:"Host Blooket",desc:"Host a game of Blooket with any question set. Then, have players join and answer questions to compete in an action-packed activity."}),o.a.createElement(d.a,{left:this.props.host.settings.lateJoin?"ID: ".concat(this.props.host.id):"",center:"Instructions",muted:this.state.muted,changeMuted:this.changeMuted}),o.a.createElement("div",{className:w.a.regularBody},o.a.createElement(b.a,{mode:this.props.host.settings.mode,amount:this.props.host.settings.amount})),o.a.createElement("div",{className:w.a.skipButton,onClick:function(){return e.skip()},role:"button",tabIndex:"0"},"Skip")):o.a.createElement(l.a,{to:"/dashboard"})}}])&&T(t.prototype,a),s&&T(t,s),r}(o.a.Component);j.propTypes={host:c.a.object,id:c.a.string,history:c.a.object,deleteHost:c.a.func.isRequired,setMuted:c.a.func.isRequired};t.a=Object(u.a)(Object(r.b)((function(e){return{host:e.hosts.host,id:e.hosts.id}}),(function(e){return Object(n.b)({deleteHost:.c,setMuted:p.a},e)}))(Object(C.d)(j)))},ZtiM:function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("wIs1"),u=a("mLw1"),m=a("FLf1"),f=a.n(m),p=a("b6Qr"),=a("TSYQ"),d=a.n(_),h=a("vDqi"),y=a.n(h),w=a("GIcp"),b=a.n(w),g=a("a2pf"),v=a.n(g),C=a("2g2H"),x=a("iQ+n"),k=a("vPiy"),T=a("+JpI"),S=a.n(T),E=[{text:"You've encountered an evil Blook! In order to survive, you'll have to reduce its health to 0 while keeping yours above 0.",nextButtonText:"Next",className:S.a.centered},{text:"Battles are broken down into rounds. Each round you'll have to answer one question.",nextButtonText:"Next",className:S.a.centered},{elementId:"myCard",text:"Before that, you can take a look at the card you drew this round.",nextButtonText:"Next",className:S.a.myCard},{elementId:"oppCard",text:"Similarly, your opponent also drew a card this round. Your goal each round is for your card to be stronger than this one.",nextButtonText:"Next",className:S.a.oppCard},{elementId:"myCard",text:"To determine the stronger card, one attribute (Strength, Charisma, or Wisdom) will be chosen each round.",nextButtonText:"Next",className:S.a.myCard},{elementId:"oppCard",text:"Unfortunately, you can't see your opponent's card before battle. You're best bet is to choose your strongest attribute.",nextButtonText:"Next",className:S.a.oppCard},{text:"Whoever's card has the highest value of that attribute wins. Then, the winner deals damage equal to how much stronger they were.",nextButtonText:"Next",className:S.a.centered},{text:"Also, winning multiple rounds in a row will give you a streak. The damage you deal will be multiplied by that streak number.",nextButtonText:"Next",className:S.a.centered},{text:"If you answer the question correctly each round, you'll get to pick the attribute. Answering incorrectly means your opponent gets to choose.",nextButtonText:"Next",functionIndex:0,className:S.a.centered},{elementId:"myCard",text:"Let's assume you answer the first question correctly. Now, go ahead and click an attribute bar on your card.",className:S.a.myCard},{},{text:"Great work! If your health drops to 0 your game is over, but if you win the battle then you'll get to add another card to your deck.",nextButtonText:"Next",className:S.a.centered},{text:"That's all for the tutorial. Good luck ascending the Tower of Doom!",nextButtonText:"Done",className:S.a.centered}],I=a("Qz0i");function N(e){return{type:I.a,mapNodes:e}}var O=a("9vW0"),j=a("4MCU"),B=a("tYQ+"),z=a("DoX5"),R=a("6Ny9"),P=a("1AT+"),A=a("6hcl"),D=a("97E7"),M=a("e78h"),q=a("5Gl+"),H=a("MfGM"),Q=a("TN+F");function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function J(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var a=[],s=!0,o=!1,n=void 0;try{for(var r,i=e[Symbol.iterator]();!(s=(r=i.next()).done)&&(a.push(r.value),!t||a.length!==t);s=!0);}catch(e){o=!0,n=e}finally{try{s||null==i.return||i.return()}finally{if(o)throw n}}return a}(e,t)||K(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function W(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?F(Object(a),!0).forEach((function(t){G(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):F(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function G(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function U(e){return function(e){if(Array.isArray(e))return Y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||K(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(e,t){if(e){if("string"==typeof e)return Y(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Y(e,t):void 0}}function Y(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,s=new Array(t);a<t;a++)s[a]=e[a];return s}function X(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function V(e,t){return(V=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function Z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=te(e);if(t){var o=te(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return $(this,a)}}function $(e,t){return!t||"object"!==L(t)&&"function"!=typeof t?ee(e):t}function ee(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function te(e){return(te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto||Object.getPrototypeOf(e)})(e)}var ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&V(e,t)}(r,e);var t,a,s,n=Z(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).state={enemy:{},myCards:[],phase:"draw",enemyCard:{},myCard:{},myFlipped:!0,enemyFlipped:!0,myLife:100,result:"tie",damage:0,rawDamage:0,question:{},correct:!1,streak:0,myStreak:!0,coins:0,usedShield:!1,showTour:e.tower&&e.tower.instruct},t.waitingCard=!1,t.waitingQuestion=!1,t.allEnemyCards=[],t.freeQuestions=[],t.isFirstTurn=!0,t.hasShield=!1,t.tourRef=o.a.createRef(),t.onSelect=t.onSelect.bind(ee(t)),t.onAnswer=t.onAnswer.bind(ee(t)),t.onWin=t.onWin.bind(ee(t)),t.getQuestion=t.getQuestion.bind(ee(t)),t.answerNext=t.answerNext.bind(ee(t)),t.drawCards=t.drawCards.bind(ee(t)),t.selectCard=t.selectCard.bind(ee(t)),t}return t=r,(a=[{key:"componentDidMount",value:function(){var e=this;if(this.props.tower&&["small","big","boss"].includes(this.props.tower.stage)&&this.props.tower.questions&&this.props.tower.questions.length){this.props.setTowerInstruct(!1);var t={blooks:this.props.tower.enemy};t.blook=this.props.tower.enemy;var a=M.a[t.blook].maxLife+10(this.props.tower.level-1);t.life=a,t.maxLife=a;var s=M.a[t.blook].deckBlooks;t.cards=[],s.forEach((function(a){var s=q.c[a];t.cards.push({blook:a,class:s.class,strength:Math.min(s.strength+e.props.tower.level-1,20),charisma:Math.min(s.charisma+e.props.tower.level-1,20),wisdom:Math.min(s.wisdom+e.props.tower.level-1,20)})})),this.allEnemyCards=t.cards;var o=this.props.tower.life,n=!1;this.props.tower.artifacts.forEach((function(a){"Survival Guide"===a?o=Math.min(100,o+3):"Band-Aid"===a&&"boss"===e.props.tower.stage?o=Math.min(100,o+15):"Mighty Shield"===a?e.hasShield=!0:"Cursed Hourglass"===a&&(o=Math.max(0,o-3),t.life=Math.max(0,t.life-10),o<=0?(n=!0,e.props.setTowerLife(0),e.props.setTowerStage("final"),e.props.history.push("/tower/final")):t.life<=0&&(n=!0,e.setState({myLife:o},(function(){e.onWin()}))))})),n||(this.freeQuestions=JSON.parse(JSON.stringify(this.props.tower.freeQuestions)),this.setState({enemy:t,myCards:U(this.props.tower.cards),myLife:o},this.drawCards))}}},{key:"componentWillUnmount",value:function(){clearTimeout(this.revealTimeout),clearTimeout(this.waitQuestionTimeout),clearTimeout(this.flipTimeout),clearTimeout(this.damageTimeout),clearTimeout(this.nextTimeout),clearTimeout(this.questionTImeout)}},{key:"onSelect",value:function(e){var t=this;if(!this.waitingCard){this.state.showTour&&this.tourRef.current.setStep(10);var a=Math.abs(this.state.myCard[e]-this.state.enemyCard[e]),s=this.state.streak,o=this.state.myStreak,n="loss";this.state.myCard[e]>this.state.enemyCard[e]?(n="win",o?s+=1:(o=!0,s=1)):0===a?n="tie":o?(o=!1,s=1):s+=1;var r=a;a=Math.max(s,1);var i=this.state.enemy.life,c=!1;"tie"===n&&this.props.tower.artifacts.includes("Chess Pieces")&&(a=4),this.props.tower.artifacts.forEach((function(e){"Fury Relic"===e&&t.isFirstTurn&&(a=2),"Toxic Waste"===e&&(a=2),"win"===n&&"Lifeline Totem"===e&&t.state.myLife<20&&(a*=2)})),this.props.tower.artifacts.forEach((function(e){"loss"===n&&(t.hasShield&&(c=!0,t.hasShield=!1),t.hasShield||c||("Captain's Anchor"===e?a=Math.max(0,a-1):"Steel Socks"===e&&r-t.props.tower.artifacts.filter((function(e){return"Captain's Anchor"===e})).length>0&&(i=Math.max(0,i-2))))})),this.isFirstTurn&&(this.isFirstTurn=!1),this.setState({enemyFlipped:!1,phase:"flipping",attribute:e},(function(){t.flipTimeout=setTimeout((function(){t.setState({result:n,streak:s,myStreak:o,rawDamage:r,usedShield:c,damage:a,phase:"fight"},(function(){t.damageTimeout=setTimeout((function(){t.setState({enemy:W(W({},t.state.enemy),{},{life:"win"===t.state.result||"tie"===t.state.result?Math.max(t.state.enemy.life-t.state.damage,0):i}),myLife:"loss"===t.state.result?Math.max(c?t.state.myLife:t.state.myLife-t.state.damage,0):t.state.myLife},(function(){t.nextTimeout=setTimeout((function(){t.props.setTowerLife(t.state.myLife),0===t.state.enemy.life?t.onWin():0===t.state.myLife?(t.props.setTowerStage("final"),t.props.history.push("/tower/final")):(t.drawCards(),t.state.showTour&&t.tourRef.current.setStep(11))}),3500)}))}),500)}))}),900)}))}}},{key:"onWin",value:function(){if(3===this.props.tower.level&&"boss"===this.props.tower.stage)this.props.addTowerNode(100),this.props.setTowerStage("victory"),this.props.history.push("/tower/victory");else{var e="boss"===this.props.tower.stage?Object(Q.o)(70,100):"big"===this.props.tower.stage?Object(Q.o)(30,55):Object(Q.o)(15,35);this.props.tower.artifacts.forEach((function(t){"Piggy Bank"===t&&(e+=6)})),this.setState({phase:"prize",coins:e})}}},{key:"onAnswer",value:function(e){if(!this.waitingQuestion){this.waitingQuestion=!0;var t=this.state.question.correctAnswers.includes(e),a=JSON.parse(JSON.stringify(this.props.tower.corrects)),s=JSON.parse(JSON.stringify(this.props.tower.incorrects)),o=this.state.question.number;t?a[o]?a[o]+=1:a[o]=1:s[o]?s[o]+=1:s[o]=1,this.props.answerTower(a,s,JSON.parse(JSON.stringify(this.freeQuestions))),this.setState({correct:t,phase:"feedback"})}}},{key:"getQuestion",value:function(){var e=this;0===this.freeQuestions.length&&(this.freeQuestions=JSON.parse(JSON.stringify(this.props.tower.questions)));var t=Object(Q.m)(this.freeQuestions);this.freeQuestions.splice(this.freeQuestions.indexOf(t),1),t.random&&(t.answers=Object(Q.u)(t.answers)),this.waitingQuestion=!0,this.setState({question:t,phase:"question"},(function(){e.waitQuestionTimeout=setTimeout((function(){e.waitingQuestion=!1}),800)}))}},{key:"answerNext",value:function(){var e=this;this.waitingCard=!0,this.state.correct?this.setState({phase:"select"},(function(){e.waitCardTimeout=setTimeout((function(){e.waitingCard=!1}),400)})):this.setState({phase:"enemySelect"},(function(){e.enemyPickTimeout=setTimeout((function(){var t="";if(1===e.props.tower.level||2===e.props.tower.level&&0===Object(Q.o)(0,2)){var a=0;Object.entries(e.state.enemyCard).forEach((function(e){var s=J(e,2),o=s[0],n=s[1];"blook"!==o&&n>a&&(t=o,a=n)}))}else{var s=-21;Object.entries(e.state.enemyCard).forEach((function(a){var o=J(a,2),n=o[0],r=o[1];"blook"!==n&&r-e.state.myCard[n]>s&&(t=n,s=r-e.state.myCard[n])}))}e.waitingCard=!1,e.onSelect(t)}),2e3)}))}},{key:"drawCards",value:function(){var e=this;this.waitingCard=!0;var t=JSON.parse(JSON.stringify(this.state.enemy.cards));0===t.length&&(t=JSON.parse(JSON.stringify(this.allEnemyCards)));var a=JSON.parse(JSON.stringify(this.state.myCards));0===a.length&&(a=JSON.parse(JSON.stringify(this.props.tower.cards)));var s=t.splice(Object(Q.o)(0,t.length),1),o=a.splice(Object(Q.o)(0,a.length),1),n=s[0],r=o[0];this.props.tower.artifacts.includes("Pink Hippo")&&(r.strength=Math.min(r.strength+2,20)),this.props.tower.artifacts.includes("Dave's Doggo")&&(r.charisma=Math.min(r.charisma+2,20)),this.props.tower.artifacts.includes("Anorak's Wizard Cap")&&(r.wisdom=Math.min(r.wisdom+2,20)),this.props.tower.artifacts.includes("Anubis' Obelisk")&&(n.strength=Math.max(n.strength-1,0),n.charisma=Math.max(n.charisma-1,0),n.wisdom=Math.max(n.wisdom-1,0));var i=0;this.props.tower.artifacts.forEach((function(e){"Farm Tractor"===e?"🌽"===r.class?i+=1:"🌴"===r.class&&(i-=1):"Magic Seedling"===e?["🌲","🌴"].includes(r.class)?i+=1:["🌽","🐾"].includes(r.class)&&(i-=1):"Just A Bone"===e?"🐾"===r.class?i+=1:"🌲"===r.class&&(i-=1):"Cozy Igloo"===e?["❄️","☃️"].includes(r.class)?i+=1:["⚔️","🏰"].includes(r.class)&&(i-=1):"King's Crown"===e?"⚔️"===r.class?i+=1:"🏰"===r.class&&(i-=1):"Sacred Scroll"===e&&("🏰"===r.class?i+=1:"⚔️"===r.class&&(i-=1))})),0!==i&&(r.strength=Math.max(0,Math.min(r.strength+i,20)),r.charisma=Math.max(0,Math.min(r.charisma+i,20)),r.wisdom=Math.max(0,Math.min(r.wisdom+i,20))),this.setState({myFlipped:!0,enemyFlipped:!0,phase:"draw"},(function(){e.revealTimeout=setTimeout((function(){e.setState({myFlipped:!1,enemyCard:n,myCard:r,enemy:W(W({},e.state.enemy),{},{cards:t}),myCards:a,attribute:""},(function(){e.state.showTour||(e.questionTimeout=setTimeout((function(){e.getQuestion()}),800))}))}),900)}))}},{key:"selectCard",value:function(e){var t=this,a=U(this.props.tower.cards),s=U(this.props.tower.artifacts),o=this.props.tower.coins;e.blook?(a.push(e),this.props.setTowerCards(a)):(s.push(e),"Elder Coins"!==e||s.includes("Anubis' Obelisk")||(o+=100),this.props.setTowerArtifacts(s)),s.includes("Anubis' Obelisk")||(o+=this.state.coins),this.props.setTowerCoins(o);var n=this.props.tower.mapNodes,r=this.props.tower.level,i=this.props.tower.currentNode,c=this.props.tower.nodePath;"boss"===this.props.tower.stage&&(r+=1,i=0,c=[],n=Object(H.a)(),this.props.newTowerLevel(n));var l=this.state.myLife;s.forEach((function(e){"Medical Kit"===e&&(l=Math.min(100,l+3))})),this.props.setTowerLife(l),this.props.tower.towerId?(y.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,y.a.put("/api/towers/save",{id:this.props.tower.towerId,stage:"map",cards:a,artifacts:s,life:l,coins:o,corrects:this.props.tower.corrects,incorrects:this.props.tower.incorrects,mapNodes:n,level:r,currentNode:i,nodePath:c}).then((function(){t.props.setTowerStage("map"),t.props.history.push("/tower/map")})).catch((function(e){console.error(e)}))):(this.props.setTowerStage("map"),this.props.history.push("/tower/map"))}},{key:"render",value:function(){var e=this;if(this.props.tower&&this.props.tower.hwId)this.redirect=!1;else if("undefined"!=typeof window&&localStorage.getItem("token")){var t=localStorage.getItem("token").split(" ");2===t.length?f.a.verify(t[1],"a809c7b3f",(function(t){e.redirect=!!t})):this.redirect=!0}else this.redirect=!0;if(this.redirect||!this.props.tower||!["small","big","boss"].includes(this.props.tower.stage)||!this.props.tower.questions||!this.props.tower.questions.length)return o.a.createElement(u.a,{to:"/login"});var a=Math.min(this.state.rawDamage,this.props.tower.artifacts.filter((function(e){return"Captain's Anchor"===e})).length);return o.a.createElement("div",{className:p.isMobile?b.a.mBody:b.a.body,id:"body",style:{backgroundColor:"#292929",oveflow:"hidden"}},o.a.createElement(x.a,{title:"Play Tower of Doom | Blooket",desc:"Ascend the feared Tower of Doom by answering questions and building a deck to defeat evil Blooks on your way to the top."}),o.a.createElement(C.a,{coins:this.props.tower.coins}),this.state.myCard&&"prize"!==this.state.phase?o.a.createElement("div",{className:b.a.regularBody,id:"regularBody"},this.state.showTour?o.a.createElement(k.a,{steps:E,onExit:function(){return e.setState({showTour:!1},e.getQuestion)},functions:[function(){e.waitingCard=!1,e.setState({phase:"select"})}],ref:this.tourRef}):null,o.a.createElement("div",{className:v.a.myName},"You",o.a.createElement("br",null),o.a.createElement("span",{style:{fontSize:p.isMobile?"4vw":"1.5vw"}},this.state.myStreak&&this.state.streak>0?"Streak: ".concat(this.state.streak):null)),o.a.createElement("div",{className:v.a.myLife},o.a.createElement(R.a,{currentLife:this.state.myLife,maxLife:100,top:"0px",left:"0px"})),o.a.createElement("div",{className:v.a.myCircle}),o.a.createElement("div",{className:d()(v.a.cardContainer,v.a.myCard,G({},v.a.myCardAttack,"fight"===this.state.phase&&"win"===this.state.result),G({},v.a.myCardHit,"fight"===this.state.phase&&"loss"===this.state.result)),id:"myCard"},o.a.createElement(B.a,{card:this.state.myCard,flipped:this.state.myFlipped,attribute:this.state.attribute,onClick:"select"===this.state.phase?this.onSelect:void 0})),o.a.createElement("div",{className:v.a.oppCircle}),o.a.createElement("div",{className:d()(v.a.cardContainer,v.a.oppCard,G({},v.a.enemyCardAttack,"fight"===this.state.phase&&"loss"===this.state.result),G({},v.a.enemyCardHit,"fight"===this.state.phase&&"win"===this.state.result)),id:"oppCard"},o.a.createElement(B.a,{card:["flipping","fight","draw"].includes(this.state.phase)?this.state.enemyCard:{},flipped:this.state.enemyFlipped,attribute:this.state.attribute})),o.a.createElement("div",{className:v.a.oppBlookStage}),o.a.createElement(z.a,{name:this.state.enemy.blook,className:v.a.oppBlook}),o.a.createElement("div",{className:v.a.oppName},"Evil ".concat(this.state.enemy.blook),o.a.createElement("br",null),o.a.createElement("span",{style:{fontSize:p.isMobile?"3vw":"1.6vw"}},!this.state.myStreak&&this.state.streak>0?"Streak: ".concat(this.state.streak):null)),o.a.createElement("div",{className:v.a.oppLife},o.a.createElement(R.a,{currentLife:this.state.enemy.life,maxLife:this.state.enemy.maxLife})),"select"===this.state.phase?o.a.createElement("div",{className:v.a.text},"Choose an attribute on your card"):"enemySelect"===this.state.phase?o.a.createElement("div",{className:v.a.text},"Waiting for the enemy to choose an attribute"):"fight"===this.state.phase?o.a.createElement("div",{className:v.a.text},"win"===this.state.result?"You Win":"loss"===this.state.result?"You Lose":"Tie",o.a.createElement("br",null),"".concat(this.state.rawDamage," x ").concat(Math.round((("tie"===this.state.result?0:this.state.damage)+("loss"!==this.state.result||this.state.usedShield?0:a))/(this.state.rawDamage||1))).concat(a>0&&"loss"===this.state.result&&!this.state.usedShield?" - ".concat(a):""," = ").concat("tie"===this.state.result?0:this.state.damage),o.a.createElement("br",null),this.state.usedShield?"Blocked with Shield":"tie"===this.state.result&&0===this.state.damage?"No Damage Dealt":"".concat("loss"===this.state.result?"Take":"Deal"," ").concat(this.state.damage," Damage")):null):null,"question"===this.state.phase?o.a.createElement("div",{className:v.a.questionContainer},o.a.createElement(P.a,{onAnswer:this.onAnswer,text:this.state.question.text,answers:this.state.question.answers,image:this.state.question.image})):"feedback"===this.state.phase?o.a.createElement("div",{className:v.a.feedbackContainer},o.a.createElement(A.a,{incorrectTime:3,correctAnswers:this.state.question.correctAnswers,correct:this.state.correct,onNext:this.answerNext})):"prize"===this.state.phase?o.a.createElement("div",{className:b.a.regularBody,style:{backgroundColor:"#292929"}},o.a.createElement(D.a,{type:this.props.tower.stage,onClick:this.selectCard,coins:this.state.coins,cards:[].concat(U(this.props.tower.artifacts),U(this.props.tower.cards)),noThird:this.props.tower.artifacts.includes("Pink Hippo")})):null)}}])&&X(t.prototype,a),s&&X(t,s),r}(o.a.Component);ae.propTypes={history:c.a.object.isRequired,tower:c.a.object,answerTower:c.a.func.isRequired,setTowerCards:c.a.func.isRequired,setTowerStage:c.a.func.isRequired,setTowerCoins:c.a.func.isRequired,setTowerLife:c.a.func.isRequired,newTowerLevel:c.a.func.isRequired,addTowerNode:c.a.func.isRequired,setTowerArtifacts:c.a.func.isRequired,setTowerInstruct:c.a.func.isRequired};t.a=Object(l.a)(Object(r.b)((function(e){return{tower:e.towers.tower}}),(function(e){return Object(n.b)({answerTower:j.a,setTowerCards:j.c,setTowerStage:j.g,setTowerCoins:j.d,setTowerLife:j.f,newTowerLevel:N,addTowerNode:O.a,setTowerArtifacts:j.b,setTowerInstruct:j.e},e)}))(ae))},"a+qp":function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("wIs1"),u=a("mLw1"),m=a("FLf1"),f=a.n(m),p=a("b6Qr"),=a("TSYQ"),d=a.n(),h=a("vDqi"),y=a.n(h),w=a("4MCU"),b=a("tSTY"),g=a.n(b),v=a("GIcp"),C=a.n(v),x=a("2g2H"),k=a("iQ+n"),T=a("5Gl+"),S=a("TN+F"),E=a("Rpcy"),I={Common:[10,26],Uncommon:[30,56],Rare:[50,76],Epic:[75,101],Legendary:[100,126]},N=a("6Ny9"),O=a("tYQ+"),j=a("SCqF");function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function z(e){return function(e){if(Array.isArray(e))return R(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return R(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return R(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,s=new Array(t);a<t;a++)s[a]=e[a];return s}function P(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function A(e,t){return(A=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=H(e);if(t){var o=H(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return M(this,a)}}function M(e,t){return!t||"object"!==B(t)&&"function"!=typeof t?q(e):t}function q(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function H(e){return(H=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto||Object.getPrototypeOf(e)})(e)}var Q=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A(e,t)}(r,e);var t,a,s,n=D(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).state={cards:[],artifacts:[],shopItems:[],coins:0,noBuy:!1,showDeck:!1,phase:"",buyCard:{},buyPrice:0,shopMultiplier:1},t.ready=!1,t.removeReady=!1,t.onBuy=t.onBuy.bind(q(t)),t.leave=t.leave.bind(q(t)),t.selectCard=t.selectCard.bind(q(t)),t}return t=r,(a=[{key:"componentDidMount",value:function(){var e=this;if(this.props.tower&&"shop"===this.props.tower.stage){var t,a,s=1;this.props.tower.artifacts.forEach((function(e){"Coupon"===e&&(s-=.1)})),this.setState({shopItems:(t=Object(T.d)("boss",6),a=[],t.forEach((function(e){var t=e.blook?I[Object(E.a)(e.blook)]:I[T.a[e].rarity];a.push({card:e,price:Object(S.o)(t[0],t[1])})})),a),cards:JSON.parse(JSON.stringify(this.props.tower.cards)),artifacts:z(this.props.tower.artifacts),coins:this.props.tower.coins,shopMultiplier:s,phase:"shop"},(function(){e.waitTimeout=setTimeout((function(){e.ready=!0}),1e3)}))}}},{key:"componentWillUnmount",value:function(){clearTimeout(this.waitTimeout),clearTimeout(this.removeTimeout)}},{key:"onBuy",value:function(e,t,a){var s=this;if(this.ready){if(this.ready=!1,t>this.state.coins)return this.setState({noBuy:!0}),void(this.ready=!0);if("card"===e){var o=z(this.state.shopItems),n=o.map((function(e){return e.card})).indexOf(a);if(-1===n)return void(this.ready=!0);o.splice(n,1);var r=z(this.state.cards),i=z(this.state.artifacts);a.blook?(r.push(a),this.props.setTowerCards(r)):(i.push(a),this.props.setTowerArtifacts(i));var c=1;i.forEach((function(e){"Coupon"===e&&(c-=.1)}));var l=this.state.coins-t;"Elder Coins"!==a||this.state.artifacts.includes("Anubis' Obelisk")||(l+=100),this.props.setTowerCoins(l),this.setState({shopItems:o,cards:r,artifacts:i,coins:l,buyCard:{},buyPrice:0,shopMultiplier:c},(function(){s.ready=!0}))}else this.ready=!0,this.removeReady=!1,this.setState({phase:"removeSelect"},(function(){s.removeTimeout=setTimeout((function(){s.removeReady=!0}),1e3)}))}}},{key:"leave",value:function(){var e=this,t=this.props.tower.life;this.state.artifacts.forEach((function(e){"Cheese"===e&&(t=Math.min(100,t+5))})),t!==this.props.tower.life&&this.props.setTowerLife(t),this.props.tower.towerId?(y.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,y.a.put("/api/towers/save",{id:this.props.tower.towerId,stage:"map",cards:this.state.cards,artifacts:this.state.artifacts,coins:this.state.coins,life:t}).then((function(){e.props.setTowerStage("map"),e.props.history.push("/tower/map")})).catch((function(e){console.error(e)}))):(this.props.setTowerStage("map"),this.props.history.push("/tower/map"))}},{key:"selectCard",value:function(e){var t=this;if(this.removeReady){var a=z(this.state.cards),s=z(this.state.artifacts);a.includes(e)?(a.splice(a.indexOf(e),1),this.props.setTowerCards(a)):s.includes(e)&&(s.splice(s.indexOf(e),1),this.props.setTowerArtifacts(s));var o=Math.round(50this.state.shopMultiplier);this.props.setTowerCoins(this.props.tower.coins-o);var n=1;s.forEach((function(e){"Coupon"===e&&(n-=.1)})),this.setState({phase:"removeReveal",card:e},(function(){t.removeTimeout=setTimeout((function(){t.setState({phase:"shop",cards:a,artifacts:s,coins:t.state.coins-o,shopMultiplier:n},(function(){t.waitTimeout=setTimeout((function(){t.ready=!0}),1e3)}))}),5e3)}))}}},{key:"render",value:function(){var e=this;if(this.props.tower&&this.props.tower.hwId)this.redirect=!1;else if("undefined"!=typeof window&&localStorage.getItem("token")){var t=localStorage.getItem("token").split(" ");2===t.length?f.a.verify(t[1],"a809c7b3f",(function(t){e.redirect=!!t})):this.redirect=!0}else this.redirect=!0;return this.redirect||!this.props.tower||"shop"!==this.props.tower.stage?o.a.createElement(u.a,{to:"/login"}):o.a.createElement("div",{className:p.isMobile?C.a.mBody:C.a.body,style:{backgroundColor:"#292929"}},o.a.createElement(k.a,{title:"Play Tower of Doom | Blooket",desc:"Ascend the feared Tower of Doom by answering questions and building a deck to defeat evil Blooks on your way to the top."}),o.a.createElement(x.a,{coins:this.state.coins}),"shop"===this.state.phase?o.a.createElement("div",{className:C.a.regularBody,style:{display:"flex",flexDirection:"column"}},o.a.createElement("div",{className:g.a.lifeContainer},o.a.createElement(N.a,{currentLife:this.props.tower.life,maxLife:100})),o.a.createElement("div",{className:g.a.deckButton,role:"button",tabIndex:0,onClick:function(){return e.setState({showDeck:!0})}},o.a.createElement("i",{className:d()("fas fa-layer-group",g.a.deckIcon)}),o.a.createElement("div",{className:g.a.deckText},"View Deck")),o.a.createElement("div",{className:g.a.leaveButton,role:"button",tabIndex:0,onClick:this.leave},o.a.createElement("i",{className:d()("fas fa-door-open",g.a.deckIcon)}),o.a.createElement("div",{className:g.a.deckText},"Leave Shop")),o.a.createElement("div",{className:g.a.shopContainer},this.state.cards.length>1?o.a.createElement("div",{className:g.a.removeButton,role:"button",tabIndex:0,onClick:function(){return e.onBuy("remove",Math.round(50e.state.shopMultiplier))}},o.a.createElement("div",{className:g.a.removeButtonText},"Remove",o.a.createElement("br",null),"a Card"),o.a.createElement("i",{className:d()("fas fa-trash-alt",g.a.removeIcon)}),o.a.createElement("div",{className:g.a.removeCost},Math.round(50this.state.shopMultiplier),o.a.createElement("i",{className:d()("fas fa-coins",g.a.removeCostIcon)}))):null,o.a.createElement("div",{className:g.a.cardsHolder},this.state.shopItems.map((function(t,a){return o.a.createElement("div",{className:g.a.shopCardContainer,key:a,role:"button",tabIndex:0,onClick:function(){return Math.round(t.pricee.state.shopMultiplier)>e.state.coins?e.setState({noBuy:!0}):e.setState({buyCard:t.card,buyPrice:Math.round(t.pricee.state.shopMultiplier)})}},o.a.createElement(O.a,{card:t.card,flipped:!1,isArtifact:!t.card.blook}),o.a.createElement("div",{className:g.a.priceText},Math.round(t.pricee.state.shopMultiplier),o.a.createElement("i",{className:d()("fas fa-coins",g.a.priceIcon)})))})))),this.state.showDeck?o.a.createElement("div",{className:g.a.deckContainer},[].concat(z(this.state.artifacts),z(this.state.cards)).map((function(e,t){return o.a.createElement("div",{className:g.a.cardContainer,key:t},o.a.createElement(O.a,{card:e,flipped:!1,isArtifact:!e.blook}))})),o.a.createElement("i",{className:d()("fas fa-times",g.a.closeIcon),role:"button",tabIndex:0,onClick:function(){return e.setState({showDeck:!1})}})):null):"removeSelect"===this.state.phase?o.a.createElement("div",{className:C.a.regularBody},o.a.createElement("div",{className:g.a.removeText},"Choose a Card to Remove"),o.a.createElement("div",{className:g.a.backButton,role:"button",tabIndex:0,onClick:function(){return e.setState({phase:"shop"})}},"Back"),o.a.createElement("div",{className:g.a.removeDeckContainer},[].concat(z(this.state.artifacts),z(this.state.cards)).map((function(t,a){return o.a.createElement("div",{className:g.a.removeCardContainer,key:a,role:"button",tabIndex:0,onClick:function(){return e.selectCard(t)}},o.a.createElement(O.a,{card:t,flipped:!1,isArtifact:!t.blook}))})))):"removeReveal"===this.state.phase?o.a.createElement("div",{className:C.a.regularBody,style:{overflow:"hidden"}},o.a.createElement("div",{className:g.a.removeText},"Removing Card from Deck"),o.a.createElement("div",{className:g.a.cardRemove},o.a.createElement(O.a,{card:this.state.card,flipped:!1,isArtifact:!this.state.card.blook}))):null,this.state.noBuy?o.a.createElement(j.a,{text:"You don't have enough coins to buy this item!",isDark:!0,buttonOne:{text:"Ok",click:function(){return e.setState({noBuy:!1})},color:"white"}}):this.state.buyPrice?o.a.createElement(j.a,{text:"Buy the ".concat(this.state.buyCard.blook||this.state.buyCard," card for ").concat(this.state.buyPrice," coins?"),isDark:!0,buttonOne:{text:"Yes",click:function(){return e.onBuy("card",e.state.buyPrice,e.state.buyCard)},color:"white"},buttonTwo:{text:"No",click:function(){return e.setState({buyCard:{},buyPrice:0})},color:"white"}}):null)}}])&&P(t.prototype,a),s&&P(t,s),r}(o.a.Component);Q.propTypes={history:c.a.object.isRequired,tower:c.a.object,setTowerCards:c.a.func.isRequired,setTowerStage:c.a.func.isRequired,setTowerCoins:c.a.func.isRequired,setTowerArtifacts:c.a.func.isRequired,setTowerLife:c.a.func.isRequired};t.a=Object(l.a)(Object(r.b)((function(e){return{tower:e.towers.tower}}),(function(e){return Object(n.b)({setTowerCards:w.c,setTowerStage:w.g,setTowerCoins:w.d,setTowerArtifacts:w.b,setTowerLife:w.f},e)}))(Q))},a2pf:function(e,t,a){var s=a("jioo");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},a9gz:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var s="DELETE_TOWER"},b36M:function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".tourStepscentered_bHXWH-camelCase{top:50%;left:50%;transform:translate(-50%,-50%)}.tourSteps_topRightdDZHl-camelCase{right:2vw;top:calc(115px + 5vw)}@media only screen and (max-width:800px){.tourStepstopRightdDZHl-camelCase{top:calc(80px + 16vw)}}",""]),t.locals={centered:"tourStepscenteredbHXWH-camelCase",topRight:"tourStepstopRight_dDZHl-camelCase"}},bH6C:function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("wIs1"),u=a("mLw1"),m=a("FLf1"),f=a.n(m),p=a("b6Qr"),=a("vDqi"),d=a.n(),h=a("4MCU"),y=a("kuZG"),w=a.n(y),b=a("GIcp"),g=a.n(b),v=a("2g2H"),C=a("iQ+n"),x=a("TN+F");function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=O(e);if(t){var o=O(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return I(this,a)}}function I(e,t){return!t||"object"!==k(t)&&"function"!=typeof t?N(e):t}function N(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto__||Object.getPrototypeOf(e)})(e)}var j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(r,e);var t,a,s,n=E(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).state={wins:0,messages:[],posted:!1,myMessage:""},t.posted=!1,t.name="",t.setMessage=t.setMessage.bind(N(t)),t.postMessage=t.postMessage.bind(N(t)),t.endGame=t.endGame.bind(N(t)),t}return t=r,(a=[{key:"componentDidMount",value:function(){var e=this;if(this.props.tower&&"victory"===this.props.tower.stage){if("undefined"!=typeof window&&localStorage.getItem("token")){var t=localStorage.getItem("token").split(" ");2===t.length&&f.a.verify(t[1],"a809c7b3f",(function(t,a){t||(e.name=a.name)}))}d.a.put("/api/towers/victory").then((function(t){e.setState({wins:t.data.wins,messages:t.data.messages})})).catch((function(t){console.error(t),e.props.history.push("/login")}))}}},{key:"setMessage",value:function(e){this.setState({myMessage:e.target.value.substring(0,1e3)})}},{key:"postMessage",value:function(){var e=this;if(!this.posted&&this.state.myMessage){this.posted=!0;var t=this.name?this.name:this.props.client&&this.props.client.name?this.props.client.name:"Anonymous";d.a.put("/api/towers/message",{message:"".concat(t,": ").concat(this.state.myMessage)}).then((function(t){t.data.success&&e.setState({messages:t.data.msgs}),e.setState({posted:!0})})).catch((function(e){console.error(e)}))}}},{key:"endGame",value:function(){this.props.setTowerStage("final"),this.props.history.push("/tower/final")}},{key:"render",value:function(){var e=this;if(this.props.tower&&this.props.tower.hwId)this.redirect=!1;else if("undefined"!=typeof window&&localStorage.getItem("token")){var t=localStorage.getItem("token").split(" ");2===t.length?f.a.verify(t[1],"a809c7b3f",(function(t){e.redirect=!!t})):this.redirect=!0}else this.redirect=!0;return this.redirect||!this.props.tower||"victory"!==this.props.tower.stage?o.a.createElement(u.a,{to:"/login"}):o.a.createElement("div",{className:p.isMobile?g.a.mBody:g.a.body,style:{backgroundColor:"#292929"}},o.a.createElement(C.a,{title:"Play Tower of Doom | Blooket",desc:"Ascend the feared Tower of Doom by answering questions and building a deck to defeat evil Blooks on your way to the top."}),o.a.createElement(v.a,{coins:this.props.tower.coins}),this.state.wins>0?o.a.createElement("div",{className:g.a.regularBodyMax},o.a.createElement("div",{className:w.a.header},"You Win!"),o.a.createElement("div",{className:w.a.winText},"You are the ".concat(Object(x.l)(this.state.wins)).concat(Object(x.f)(this.state.wins)," adventurer to ascend the Tower of Doom!")),o.a.createElement("div",{className:w.a.messageText},"Below are messages from other Ascenders"),o.a.createElement("div",{className:w.a.messageContainer},this.state.messages.map((function(e,t){return o.a.createElement("div",{key:t,className:w.a.message,style:{backgroundColor:t%2==1?"#404040":"#666666"}},e)}))),this.state.posted?null:o.a.createElement("div",null,o.a.createElement("div",{className:w.a.messageText},"Leave your own message"),o.a.createElement("div",{className:w.a.inputContainer},o.a.createElement("input",{className:w.a.input,placeholder:"Enter your message...",onChange:this.setMessage,value:this.state.myMessage}),o.a.createElement("div",{className:w.a.postButton,role:"button",tabIndex:0,onClick:this.postMessage},"Post"))),o.a.createElement("div",{className:w.a.endButton,role:"button",tabIndex:0,onClick:this.endGame},"End Game"),o.a.createElement("div",{style:{height:30}})):null)}}])&&T(t.prototype,a),s&&T(t,s),r}(o.a.Component);j.propTypes={history:c.a.object.isRequired,tower:c.a.object,client:c.a.object,setTowerStage:c.a.func.isRequired};t.a=Object(l.a)(Object(r.b)((function(e){return{tower:e.towers.tower,client:e.clients.client}}),(function(e){return Object(n.b)({setTowerStage:h.g},e)}))(j))},e78h:function(e,t,a){"use strict";a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return r}));var s=a("TN+F"),o={Chicken:{maxLife:25,deckBlooks:["Chick","Chick","Chicken","Chicken","Duck","Duck","Cow","Pig","Jester","Cheshire Cat"]},Pig:{maxLife:40,deckBlooks:["Pig","Pig","Cow","Cow","Goat","Walrus","Sheep","Horse","Slime Monster","Dormouse"]},Dog:{maxLife:28,deckBlooks:["Dog","Dog","Puppy","Puppy","Bear","Goldfish","Turtle","Moose","Walrus","Gingerbread Man","Eat Me","Two of Spades"]},Cat:{maxLife:30,deckBlooks:["Cat","Cat","Kitten","Kitten","Rabbit","Hamster","Turtle","Tiger","Panther","Unicorn","Cheshire Cat"]},Bear:{maxLife:43,deckBlooks:["Bear","Bear","Polar Bear","Penguin","Orangutan","Moose","Fox","Tiger","Dragon","Queen of Hearts"]},Raccoon:{maxLife:27,deckBlooks:["Raccoon","Raccoon","Raccoon","Fox","Squirrel","Owl","Hedgehog","Anaconda","Goldfish","Jester","Cheshire Cat"]},Tiger:{maxLife:33,deckBlooks:["Tiger","Tiger","Orangutan","Panther","Jaguar","Toucan","Macaw","Horse","Walrus","Queen of Hearts"]},Parrot:{maxLife:32,deckBlooks:["Parrot","Parrot","Macaw","Toucan","Cockatoo","Cockatoo","Owl","Snowy Owl","Tiger","Wizard","Mad Hatter"]},"Arctic Fox":{maxLife:30,deckBlooks:["Arctic Fox","Arctic Fox","Fox","Penguin","Snowy Owl","Polar Bear","Baby Penguin","Arctic Hare","Seal","Walrus","Walrus","Fairy","Drink Me","Alice"]},Panther:{maxLife:35,deckBlooks:["Panther","Panther","Tiger","Orangutan","Owl","Raccoon","Cow","Baby Penguin","Penguin","Kitten","Puppy","Witch","Dormouse"]},Rabbit:{maxLife:41,deckBlooks:["Rabbit","Rabbit","Hamster","Arctic Hare","Baby Penguin","Raccoon","Fox","Puppy","White Rabbit","Squirrel","Cheshire Cat"]},Orangutan:{maxLife:48,deckBlooks:["Orangutan","Orangutan","Orangutan","Orangutan","Orangutan","Orangutan","Orangutan","Orangutan","King of Hearts"]},Witch:{maxLife:65,deckBlooks:["Witch","Witch","Wizard","Wizard","Fairy","Dragon","White Rabbit","Caterpillar","Turtle","Owl","Snowy Owl","Horse"]},"Slime Monster":{maxLife:73,deckBlooks:["Slime Monster","Slime Monster","Bear","Walrus","Tiger","Hedgehog","Wizard","Dragon","Dormouse","Queen of Hearts"]},Dragon:{maxLife:67,deckBlooks:["Dragon","Dragon","Jester","Wizard","Elf","Moose","Jaguar","Tiger","Dormouse","Queen of Hearts","Eat Me"]},"Gingerbread Man":{maxLife:63,deckBlooks:["Gingerbread Man","Gingerbread Man","Snow Globe","Holiday Gift","Hot Chocolate","Holiday Wreath","Gingerbread House","Gingerbread House","Snowy Owl","Penguin","Cheshire Cat","Walrus","Polar Bear"]},Elf:{maxLife:56,deckBlooks:["Elf","Elf","Fairy","Slime Monster","Dragon","Anaconda","Turtle","Capuchin","Witch","Two of Spades","Wizard","White Rabbit"]},Jester:{maxLife:58,deckBlooks:["Jester","Jester","Chick","Parrot","Macaw","Slime Monster","Mad Hatter","Cheshire Cat","Eat Me","Drink Me","Queen of Hearts"]},Alice:{maxLife:54,deckBlooks:["Alice","Alice","Cheshire Cat","Drink Me","Eat Me","Two of Spades","Dormouse","White Rabbit","Unicorn","Parrot","Macaw","Seal"]},Unicorn:{maxLife:70,deckBlooks:["Unicorn","Unicorn","Witch","Wizard","Dragon","Queen","White Rabbit","Cheshire Cat","Jester","Caterpillar","Snowman","Horse","Jaguar","Tiger","Orangutan"]},"Santa Claus":{maxLife:90,deckBlooks:["Santa Claus","Santa Claus","Snowman","Snowman","Gingerbread Man","Gingerbread Man","Gingerbread House","Holiday Wreath","Hot Chocolate","Holiday Gift","Snow Globe","Penguin","White Rabbit","Eat Me","Walrus"]},King:{maxLife:130,deckBlooks:["King","King","King of Hearts","King of Hearts","Caterpillar","Unicorn","Santa Claus","Jester","Dragon","Elf","Witch","Wizard","Slime Monster","White Rabbit","Cheshire Cat","Alice","Queen","Two of Spades","Fairy"]}},n={small:["Chicken","Pig","Dog","Cat","Bear","Raccoon","Tiger","Parrot","Arctic Fox","Panther","Rabbit","Orangutan"],big:["Witch","Slime Monster","Dragon","Gingerbread Man","Elf","Jester","Alice"],boss:["Unicorn","Santa Claus","King"]},r=function(e,t){return"boss"===e?n.boss[t-1]:Object(s.m)(n[e])}},eDxB:function(e,t,a){var s=a("NncC");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},fxUS:function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("wIs1"),u=a("mLw1"),m=a("FLf1"),f=a.n(m),p=a("b6Qr"),=a("vDqi"),d=a.n(),h=a("4MCU"),y=a("D2f2"),w=a.n(y),b=a("GIcp"),g=a.n(b),v=a("2g2H"),C=a("iQ+n"),x=a("SCqF"),k=a("vPiy"),T=a("5aLK"),S=a.n(T),E=[{text:"Welcome to the Tower of Doom! Your goal is to ascend the Tower's 3 Haunted Floors.",nextButtonText:"Next",className:S.a.centered},{text:"Unfortunately, these floors are covered with enemies. You're going to need a deck to defend yourself.",nextButtonText:"Next",className:S.a.centered},{text:"Before you start climbing the Tower, you'll answer 5 questions to get your deck started! Answer 1 question now.",nextButtonText:"OK",className:S.a.centered},{},{text:"Great work! Now you get to choose a card to add to your deck.",nextButtonText:"Next",className:S.a.centered},{elementId:"card1",text:"You'll use Blook cards to battle. Each card has 3 attributes: Strength, Charisma, and Wisdom.",nextButtonText:"Next",elementClick:!0,className:S.a.card1},{elementId:"card1",text:"The greater the attribute, the better. Therefore, even though the Chick appears weak, it's Charisma can be very powerful.",nextButtonText:"Next",elementClick:!0,className:S.a.card1},{elementId:"card2",text:"This card is an Artifact. They aren't used in battle, but they apply effects that can help you.",nextButtonText:"Next",elementClick:!0,className:S.a.card2},{elementId:"card2",text:"Coins are earned after battles and are used to purchase cards in Shops. The Piggy Bank would help you earn more of these coins.",nextButtonText:"Next",elementClick:!0,className:S.a.card2},{elementId:"card1",text:"For now, let's just stick with the Chick. Go ahead and click the card to add it to your Deck!",elementClick:!0,functionIndex:0,className:S.a.card1},{text:"Awesome, now answer 4 more questions and choose 4 more cards. Then you'll be ready to take on the Tower of Doom!",nextButtonText:"OK",className:S.a.centered}],I=a("1AT+"),N=a("6hcl"),O=a("97E7"),j=a("5Gl+"),B=a("TN+F");function z(e){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(e){return function(e){if(Array.isArray(e))return P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return P(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return P(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,s=new Array(t);a<t;a++)s[a]=e[a];return s}function A(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function D(e,t){return(D=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=Q(e);if(t){var o=Q(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return q(this,a)}}function q(e,t){return!t||"object"!==z(t)&&"function"!=typeof t?H(e):t}function H(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q(e){return(Q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto||Object.getPrototypeOf(e)})(e)}var L=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&D(e,t)}(r,e);var t,a,s,n=M(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).state={question:{},phase:"question",correct:!1,cards:[],artifacts:[],coins:0,askTour:!0,showTour:!1},t.freeQuestions=[],t.waiting=!1,t.done=!1,t.qRemaining=5,t.tourRef=o.a.createRef(),t.onAnswer=t.onAnswer.bind(H(t)),t.getQuestion=t.getQuestion.bind(H(t)),t.answerNext=t.answerNext.bind(H(t)),t.selectCard=t.selectCard.bind(H(t)),t.endTour=t.endTour.bind(H(t)),t}return t=r,(a=[{key:"componentDidMount",value:function(){this.props.tower&&"start"===this.props.tower.stage&&this.props.tower.questions&&this.props.tower.questions.length&&(this.setState({coins:this.props.tower.coins}),this.freeQuestions=JSON.parse(JSON.stringify(this.props.tower.freeQuestions)),this.getQuestion())}},{key:"componentWillUnmount",value:function(){clearTimeout(this.waitTimeout)}},{key:"onAnswer",value:function(e){if(!this.waiting){this.waiting=!0;var t=this.state.question.correctAnswers.includes(e),a=JSON.parse(JSON.stringify(this.props.tower.corrects)),s=JSON.parse(JSON.stringify(this.props.tower.incorrects)),o=this.state.question.number;t?a[o]?a[o]+=1:a[o]=1:s[o]?s[o]+=1:s[o]=1,this.props.answerTower(a,s,JSON.parse(JSON.stringify(this.freeQuestions))),this.setState({correct:t,phase:"feedback"})}}},{key:"getQuestion",value:function(){var e=this;0===this.freeQuestions.length&&(this.freeQuestions=JSON.parse(JSON.stringify(this.props.tower.questions)));var t=Object(B.m)(this.freeQuestions);this.freeQuestions.splice(this.freeQuestions.indexOf(t),1),t.random&&(t.answers=Object(B.u)(t.answers)),this.setState({question:t,phase:"question"},(function(){e.waiting=!0,e.waitTimeout=setTimeout((function(){e.waiting=!1}),400)}))}},{key:"answerNext",value:function(){var e=this;this.state.correct?(this.qRemaining-=1,this.setState({phase:"card"},(function(){e.state.showTour&&e.tourRef.current.setStep(4)}))):this.getQuestion()}},{key:"selectCard",value:function(e,t){var a=this;if(!(this.done||this.state.showTour&&!t)){var s=R(this.state.cards),o=R(this.state.artifacts),n=this.state.coins;e.blook?(s.push(JSON.parse(JSON.stringify(e))),this.setState({cards:s})):(o.push(e),"Elder Coins"!==e||o.includes("Anubis' Obelisk")||(n+=100),this.setState({artifacts:o,coins:n})),this.qRemaining<=0?(this.done=!0,this.props.setTowerCards(s),this.props.setTowerArtifacts(o),this.props.setTowerCoins(n),this.props.tower.towerId?(d.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,d.a.put("/api/towers/save",{id:this.props.tower.towerId,cards:s,artifacts:o,corrects:this.props.tower.corrects,incorrects:this.props.tower.incorrects,stage:"map"}).then((function(){a.props.setTowerStage("map"),a.props.history.push("/tower/map")})).catch((function(e){console.error(e)}))):(this.props.setTowerStage("map"),this.props.history.push("/tower/map"))):this.getQuestion()}}},{key:"endTour",value:function(){this.setState({showTour:!1}),this.props.setTowerInstruct(!0)}},{key:"render",value:function(){var e=this;if(this.props.tower&&this.props.tower.hwId)this.redirect=!1;else if("undefined"!=typeof window&&localStorage.getItem("token")){var t=localStorage.getItem("token").split(" ");2===t.length?f.a.verify(t[1],"a809c7b3f",(function(t){e.redirect=!!t})):this.redirect=!0}else this.redirect=!0;return!this.redirect&&this.props.tower&&"start"===this.props.tower.stage&&this.props.tower.questions&&this.props.tower.questions.length?o.a.createElement("div",{className:p.isMobile?g.a.mBody:g.a.body,id:"body",style:{backgroundColor:"#292929"}},o.a.createElement(C.a,{title:"Play Tower of Doom | Blooket",desc:"Ascend the feared Tower of Doom by answering questions and building a deck to defeat evil Blooks on your way to the top."}),o.a.createElement(v.a,{coins:this.state.coins||this.props.tower.coins}),this.state.showTour?o.a.createElement(k.a,{steps:E,onExit:this.endTour,functions:[function(){return e.selectCard(j.e,!0)}],ref:this.tourRef}):null,this.state.question.correctAnswers?"question"===this.state.phase?o.a.createElement("div",{className:w.a.questionContainer},o.a.createElement(I.a,{onAnswer:this.onAnswer,text:this.state.question.text,answers:this.state.question.answers,image:this.state.question.image})):"feedback"===this.state.phase?o.a.createElement(N.a,{incorrectTime:3,correctAnswers:this.state.question.correctAnswers,correct:this.state.correct,onNext:this.answerNext}):o.a.createElement("div",{className:g.a.regularBody},o.a.createElement(O.a,{type:"small",onClick:this.selectCard,cards:[].concat(R(this.state.artifacts),R(this.state.cards)),noArtifacts:0===this.state.cards.length,noThird:this.state.artifacts.includes("Pink Hippo"),isTutorial:this.state.showTour})):null,this.state.askTour?o.a.createElement(x.a,{text:"Would you like a quick tutorial?",buttonOne:{text:"Yes",click:function(){return e.setState({askTour:!1,showTour:!0})},color:"blue"},buttonTwo:{text:"No",click:function(){return e.setState({askTour:!1})},color:"blue"}}):null):o.a.createElement(u.a,{to:"/login"})}}])&&A(t.prototype,a),s&&A(t,s),r}(o.a.Component);L.propTypes={history:c.a.object.isRequired,tower:c.a.object,answerTower:c.a.func.isRequired,setTowerCards:c.a.func.isRequired,setTowerStage:c.a.func.isRequired,setTowerArtifacts:c.a.func.isRequired,setTowerCoins:c.a.func.isRequired,setTowerInstruct:c.a.func.isRequired};t.a=Object(l.a)(Object(r.b)((function(e){return{tower:e.towers.tower}}),(function(e){return Object(n.b)({answerTower:h.a,setTowerCards:h.c,setTowerStage:h.g,setTowerArtifacts:h.b,setTowerCoins:h.d,setTowerInstruct:h.e},e)}))(L))},hAB6:function(e,t,a){var s=a("b36M");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},jdaG:function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".tourSteps_centeredkhVJS-camelCase{top:50%;left:50%;transform:translate(-50%,-50%)}.tourStepscard12-Pae-camelCase{left:calc(50% - 15vw)}.tourStepscard12-Pae-camelCase,.tourStepscard221lvw-camelCase{top:60%;transform:translateY(-50%)}.tourStepscard221lvw-camelCase{left:calc(50% + 15vw)}@media only screen and (max-width:800px){.tourStepscard12-Pae-camelCase,.tourStepscard221lvw-camelCase{left:50%;top:calc(50% + 23vw);transform:translateX(-50%)}}",""]),t.locals={centered:"tourStepscenteredkhVJS-camelCase",card1:"tourStepscard12-Pae-camelCase",card2:"tourStepscard221lvw-camelCase"}},jioo:function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".stylesmyCircle1qqh--camelCase{width:30vw;height:10vw;border-radius:50%;background-color:#404040;position:absolute;top:calc(50% + 16.25vw);left:35vw;transform:translate(-50%,-50%)}.stylesmyName2PdqM-camelCase{font-family:Nunito,sans-serif;font-size:3.5vw;font-weight:700;top:calc(50% + 9vw);text-align:center;color:#fff}.stylesmyLife3Fctx-camelCase,.stylesmyName2PdqM-camelCase{position:absolute;left:2.5vw;width:15vw}.stylesmyLife3Fctx-camelCase{top:calc(50% - 7.5vw);height:15vw}.stylesoppCircle3NuFR-camelCase{width:21vw;height:7vw;border-radius:50%;background-color:#404040;position:absolute;top:26.25vw;left:68.75vw;transform:translate(-50%,-50%)}.stylesoppBlook17FtE-camelCase{height:13.8vw;width:12vw;position:absolute;top:3.5vw;left:82.75vw;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stylesoppBlookStage2hVdW-camelCase{height:5vw;border-radius:2vw;background-color:#404040;top:13.8vw}.stylesoppBlookStage2hVdW-camelCase,.stylesoppName3pyFl-camelCase{width:16vw;position:absolute;left:80.75vw}.stylesoppName3pyFl-camelCase{font-family:Nunito,sans-serif;font-size:2vw;line-height:2.2vw;font-weight:700;top:20vw;text-align:center;color:#fff}.stylesoppLife2tHat-camelCase{position:absolute;top:26vw;left:81.25vw;height:15vw;width:15vw;transform:scale(.7)}.stylescardContainer3sNpg-camelCase{position:absolute;width:25vw;height:32.5vw;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stylesmyCardtrgeY-camelCase{top:50%;left:35vw;transform:translate(-50%,-50%)}.stylesoppCardRyH7t-camelCase{top:10vw;left:65vw;transform:scale(.7) translate(-50%,-50%)}.stylesmyCardAttackry0b2-camelCase{-webkit-animation:stylesmyAttack3Yw18-camelCase .35s ease-out;animation:stylesmyAttack3Yw18-camelCase .35s ease-out}@-webkit-keyframes stylesmyAttack3Yw18-camelCase{0%{transform:translate(-50%,-50%)}50%{transform:translate(-40%,-60%)}to{transform:translate(-50%,-50%)}}@keyframes stylesmyAttack3Yw18-camelCase{0%{transform:translate(-50%,-50%)}50%{transform:translate(-40%,-60%)}to{transform:translate(-50%,-50%)}}.stylesmyCardHit2K5FQ-camelCase{-webkit-animation:stylesmyHitCj1lO-camelCase .35s ease-out 185ms;animation:stylesmyHitCj1lO-camelCase .35s ease-out 185ms}@-webkit-keyframes stylesmyHitCj1lO-camelCase{0%{transform:translate(-50%,-50%)}50%{transform:translate(-60%,-40%)}to{transform:translate(-50%,-50%)}}@keyframes stylesmyHitCj1lO-camelCase{0%{transform:translate(-50%,-50%)}50%{transform:translate(-60%,-40%)}to{transform:translate(-50%,-50%)}}.stylesenemyCardAttack1xoja-camelCase{-webkit-animation:stylesenemyAttack3z6d8-camelCase .35s ease-out;animation:stylesenemyAttack3z6d8-camelCase .35s ease-out}@-webkit-keyframes stylesenemyAttack3z6d8-camelCase{0%{transform:scale(.7) translate(-50%,-50%)}50%{transform:scale(.7) translate(-60%,-40%)}to{transform:scale(.7) translate(-50%,-50%)}}@keyframes stylesenemyAttack3z6d8-camelCase{0%{transform:scale(.7) translate(-50%,-50%)}50%{transform:scale(.7) translate(-60%,-40%)}to{transform:scale(.7) translate(-50%,-50%)}}.stylesenemyCardHit24TRj-camelCase{-webkit-animation:stylesenemyHit1xpy1-camelCase .35s ease-out 185ms;animation:stylesenemyHit1xpy1-camelCase .35s ease-out 185ms}@-webkit-keyframes stylesenemyHit1xpy1-camelCase{0%{transform:scale(.7) translate(-50%,-50%)}50%{transform:scale(.7) translate(-40%,-60%)}to{transform:scale(.7) translate(-50%,-50%)}}@keyframes stylesenemyHit1xpy1-camelCase{0%{transform:scale(.7) translate(-50%,-50%)}50%{transform:scale(.7) translate(-40%,-60%)}to{transform:scale(.7) translate(-50%,-50%)}}.stylestext24Wal-camelCase{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:27.5vw;height:10.5vw;left:53.5vw;top:32.5vw;font-size:2.3vw;font-family:Nunito,sans-serif;font-weight:700;text-align:center;color:#fff;text-shadow:2px 2px 8px grey}.stylesquestionContainer1C1ex-camelCase{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#292929;-webkit-animation:stylesgrowIn1Jig2-camelCase .5s;animation:stylesgrowIn1Jig2-camelCase .5s}@-webkit-keyframes stylesgrowIn1Jig2-camelCase{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes stylesgrowIn1Jig2-camelCase{0%{transform:scale(0)}to{transform:scale(1)}}.stylesfeedbackContainer___yPj_L-camelCase{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#292929}@media only screen and (max-width:600px){.stylesmyCard_trgeY-camelCase{transform:scale(1.8) translate(-50%,-50%);top:80%;left:40vw}.styles_myCircle1qqh--camelCase{width:55vw;height:18vw;top:calc(80% + 16.25vw);left:30vw}.stylesoppCardRyH7t-camelCase{transform:scale(1.5) translate(-50%,-50%);top:37.5vw;left:80vw}.stylesoppCircle3NuFR-camelCase{width:45vw;height:15vw;top:53.75vw;left:73.75vw}.stylestext24Wal-camelCase{width:40vw;height:50vw;left:5vw;top:7.5vw;font-size:6vw}.stylesoppBlook17FtE-camelCase{height:17.25vw;width:15vw;top:65vw;left:80vw}.stylesoppBlookStage2hVdW-camelCase{width:20vw;height:7vw;border-radius:2vw;top:77.25vw;left:77.5vw}.stylesoppName3pyFl-camelCase{font-size:4vw;line-height:4.2vw;left:77.5vw;top:88vw;width:20vw}.stylesoppLife2tHat-camelCase{top:69.5vw;left:57.5vw;transform:scale(1.2)}.stylesmyName2PdqM-camelCase{font-size:6vw;line-height:6vw;left:77vw;top:calc(81.5% - 3.75vw);width:23vw}.stylesmyLife3Fctx-camelCase{top:calc(81.5% - 7.5vw);left:60vw;transform:scale(1.5)}@-webkit-keyframes stylesmyAttack3Yw18-camelCase{0%{transform:scale(1.8) translate(-50%,-50%)}50%{transform:scale(1.8) translate(-40%,-60%)}to{transform:scale(1.8) translate(-50%,-50%)}}@keyframes stylesmyAttack3Yw18-camelCase{0%{transform:scale(1.8) translate(-50%,-50%)}50%{transform:scale(1.8) translate(-40%,-60%)}to{transform:scale(1.8) translate(-50%,-50%)}}@-webkit-keyframes stylesmyHitCj1lO-camelCase{0%{transform:scale(1.8) translate(-50%,-50%)}50%{transform:scale(1.8) translate(-60%,-40%)}to{transform:scale(1.8) translate(-50%,-50%)}}@keyframes stylesmyHitCj1lO-camelCase{0%{transform:scale(1.8) translate(-50%,-50%)}50%{transform:scale(1.8) translate(-60%,-40%)}to{transform:scale(1.8) translate(-50%,-50%)}}@-webkit-keyframes stylesenemyAttack3z6d8-camelCase{0%{transform:scale(1.5) translate(-50%,-50%)}50%{transform:scale(1.5) translate(-60%,-40%)}to{transform:scale(1.5) translate(-50%,-50%)}}@keyframes stylesenemyAttack3z6d8-camelCase{0%{transform:scale(1.5) translate(-50%,-50%)}50%{transform:scale(1.5) translate(-60%,-40%)}to{transform:scale(1.5) translate(-50%,-50%)}}@-webkit-keyframes stylesenemyHit1xpy1-camelCase{0%{transform:scale(1.5) translate(-50%,-50%)}50%{transform:scale(1.5) translate(-40%,-60%)}to{transform:scale(1.5) translate(-50%,-50%)}}@keyframes stylesenemyHit1xpy1-camelCase{0%{transform:scale(1.5) translate(-50%,-50%)}50%{transform:scale(1.5) translate(-40%,-60%)}to{transform:scale(1.5) translate(-50%,-50%)}}}",""]),t.locals={myCircle:"stylesmyCircle1qqh--camelCase",myName:"stylesmyName2PdqM-camelCase",myLife:"stylesmyLife3Fctx-camelCase",oppCircle:"stylesoppCircle3NuFR-camelCase",oppBlook:"stylesoppBlook17FtE-camelCase",oppBlookStage:"stylesoppBlookStage2hVdW-camelCase",oppName:"stylesoppName3pyFl-camelCase",oppLife:"stylesoppLife2tHat-camelCase",cardContainer:"stylescardContainer3sNpg-camelCase",myCard:"stylesmyCardtrgeY-camelCase",oppCard:"stylesoppCardRyH7t-camelCase",myCardAttack:"stylesmyCardAttackry0b2-camelCase",myAttack:"stylesmyAttack3Yw18-camelCase",myCardHit:"stylesmyCardHit2K5FQ-camelCase",myHit:"stylesmyHitCj1lO-camelCase",enemyCardAttack:"stylesenemyCardAttack1xoja-camelCase",enemyAttack:"stylesenemyAttack3z6d8-camelCase",enemyCardHit:"stylesenemyCardHit24TRj-camelCase",enemyHit:"stylesenemyHit1xpy1-camelCase",text:"stylestext24Wal-camelCase",questionContainer:"stylesquestionContainer1C1ex-camelCase",growIn:"stylesgrowIn1Jig2-camelCase",feedbackContainer:"stylesfeedbackContaineryPjL-camelCase"}},jsdw:function(e,t,a){var s=a("+42v");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},kuZG:function(e,t,a){var s=a("J34z");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},nb6V:function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("mLw1"),u=a("wIs1"),m=a("vDqi"),f=a.n(m),p=a("5gLy"),=a("GIcp"),d=a.n(_),h=a("pcIS"),y=a("iQ+n"),w=a("TN+F"),b=a("SdQT");function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var a=[],s=!0,o=!1,n=void 0;try{for(var r,i=e[Symbol.iterator]();!(s=(r=i.next()).done)&&(a.push(r.value),!t||a.length!==t);s=!0);}catch(e){o=!0,n=e}finally{try{s||null==i.return||i.return()}finally{if(o)throw n}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return C(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return C(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,s=new Array(t);a<t;a++)s[a]=e[a];return s}function x(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=E(e);if(t){var o=E(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return S(this,a)}}function S(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto||Object.getPrototypeOf(e)})(e)}var I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&k(e,t)}(r,e);var t,a,s,n=T(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).state={ready:!1,historyId:"",standings:[],muted:!!e.host&&e.host.muted},t}return t=r,(a=[{key:"componentDidMount",value:function(){var e=this;if(this.props.host&&this.props.host.standings&&this.props.host.standings[0]){var t=JSON.parse(JSON.stringify(this.props.host));this.setState({standings:t.standings},(function(){e.startTimeout=setTimeout((function(){var a={};e.props.firebase.getDatabaseVal(t.id,"c",(function(s){var o=s||{};Object.entries(o).forEach((function(e){var t=v(e,2),s=t[0],o=t[1],n={};if(o.i)if(Array.isArray(o.i))for(var r=0;r<o.i.length;r++){var i=o.i[r];i&&(n[r]=i)}else n=o.i;else n={};var c={};if(o.c)if(Array.isArray(o.c))for(var l=0;l<o.c.length;l++){var u=o.c[l];u&&(c[l]=u)}else c=o.c;else c={};a[s]={corrects:c,incorrects:n}})),e.props.host&&e.props.host.id&&(f.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,f.a.delete("/api/firebase/host",{params:{id:e.props.host.id}}).catch((function(e){return console.error(e)})),e.props.deleteHost()),window.removeEventListener("beforeunload",w.s),e.waitTimeout=setTimeout((function(){e.state.standings.length>0&&(f.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,f.a.post("/api/history",{standings:t.standings.map((function(e){return{blook:e.blook,name:e.name,place:e.place,toys:e.toys,corrects:a[e.name]?a[e.name].corrects:{},incorrects:a[e.name]?a[e.name].incorrects:{}}})),settings:t.settings,set:t.hostName,setId:t.setId,name:t.hoster}).then((function(t){e.setState({historyId:t.data._id,ready:!0})})).catch((function(e){console.error(e)})))}),2e3)}))}),3500)}))}}},{key:"componentWillUnmount",value:function(){clearTimeout(this.startTimeout),clearTimeout(this.waitTimeout),this.props.host&&this.props.host.id&&(f.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,f.a.delete("/api/firebase/host",{params:{id:this.props.host.id}}).catch((function(e){return console.error(e)})),this.props.deleteHost())}},{key:"render",value:function(){return this.props.host&&this.props.host.standings&&this.props.host.standings[0]||this.state.standings&&this.state.standings[0]?o.a.createElement("div",{className:d.a.body,style:{overflowY:this.state.ready?"auto":"hidden",backgroundImage:"linear-gradient(#31aae0, #bdf)"}},o.a.createElement(y.a,{title:"Host Blooket",desc:"Host a game of Blooket with any question set. Then, have players join and answer questions to compete in an action-packed activity."}),this.state.standings.length>0?o.a.createElement(h.a,{standings:this.state.standings,stats:this.state.standings.map((function(e){return"".concat(Object(w.l)(e.toys)," Toys")})),gameId:this.props.gameId,historyId:this.state.historyId,muted:this.state.muted,theme:"winter"}):null):o.a.createElement(l.a,{to:"/dashboard"})}}])&&x(t.prototype,a),s&&x(t,s),r}(o.a.Component);I.propTypes={gameId:c.a.string,host:c.a.object,firebase:c.a.object,deleteHost:c.a.func.isRequired};t.a=Object(u.a)(Object(r.b)((function(e){return{host:e.hosts.host,gameId:e.hosts.id}}),(function(e){return Object(n.b)({deleteHost:p.c},e)}))(Object(b.d)(I)))},pZkE:function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".tourStepscentered2N9xU-camelCase{top:50%;left:50%;transform:translate(-50%,-50%)}.tourStepsmyCard3kwQw-camelCase{top:50%;left:50vw}.tourStepsmyCard3kwQw-camelCase,.tourStepsoppCard3vUwC-camelCase{transform:translateY(-50%)}.tourStepsoppCard3vUwC-camelCase{top:calc(15.6875vw + 55px);right:45vw}@media only screen and (max-width:600px){.tourStepsmyCard3kwQw-camelCase{top:auto;left:5vw;bottom:calc(20% + 45vw);transform:none}.tourStepsoppCard3vUwC-camelCase{top:75vw;right:5vw;transform:none}}",""]),t.locals={centered:"tourStepscentered2N9xU-camelCase",myCard:"tourStepsmyCard3kwQw-camelCase",oppCard:"tourStepsoppCard3vUwC-camelCase"}},sM3C:function(e,t,a){var s=a("wsbM");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},tSTY:function(e,t,a){var s=a("51kA");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},v83B:function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".stylesheaderRow__2cBm-camelCase{width:90%;margin:0 auto}.stylesheader_2zzan-camelCase,.styles_headerRow2cBm_-camelCase{display:flex;flex-direction:row}.stylesheader2zzan-camelCase{margin:25px auto 10px;width:100%;background-color:#1a1a1a;box-shadow:0 0 8px 3px #e57e25;border-radius:5px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;justify-content:space-between;align-items:center;padding:5px 0}.stylesheaderBlook1ttS8-camelCase{height:86px;margin:0 10px 2px}.stylesheaderTexts95eQ-camelCase{font-family:Titan One,sans-serif;color:#fff;text-shadow:2px 2px 8px grey;font-size:68px}.stylesdesc15hiZ-camelCase{width:80%}.stylesdesc15hiZ-camelCase,.stylesprizesButton37BAn-camelCase{background-color:#1a1a1a;box-shadow:0 0 8px 3px #e57e25;color:#fff;font-family:Nunito,sans-serif;font-size:24px;border-radius:5px;padding:7px 10px;box-sizing:border-box;margin:20px auto 30px;display:flex;align-items:center;justify-content:center;text-align:center;font-weight:700}.stylesprizesButton37BAn-camelCase{width:60%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;transition:.2s}.stylesprizesButton37BAn-camelCase:hover{transform:scale(.97)}.stylesstandingRow3BSMm-camelCase{width:85%;height:50px;box-sizing:border-box;padding:5px 10px;background-color:#1a1a1a;box-shadow:0 0 8px 3px #e57e25;color:#fff;font-family:Nunito,sans-serif;border-radius:5px;margin:20px auto;display:flex;flex-direction:row;align-items:center}.stylesplaceTextbkTWi-camelCase{text-align:right;min-width:40px;font-size:40px}.stylesplaceTextbkTWi-camelCase,.stylessuperPlaceTextK5wnQ-camelCase{font-family:Titan One,sans-serif}.stylessuperPlaceTextK5wnQ-camelCase{margin:4px 2px auto;width:27px;text-align:left;font-size:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stylesnameTextZdyCD-camelCase{font-size:34px;font-weight:700;margin-left:9px;margin-top:5px;flex-grow:1}.stylescandyRow1mXqp-camelCase{display:flex;flex-direction:row;align-items:center}.stylescandyText1ZlcE-camelCase{margin-left:10px;font-size:28px;text-align:right}.stylescandyImg___2k_XJ-camelCase{height:30px;margin-left:7px}.stylesprizesContainer_80IXd-camelCase{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:620px;min-height:200px;max-height:90%;background-color:#1a1a1a;box-shadow:0 0 8px 3px #e57e25;border-radius:7px;display:flex;flex-direction:column;overflow-x:hidden;overflow-y:auto;font-family:Nunito,sans-serif;color:#fff}.styles_prizesContainer80IXd-camelCase::-webkit-scrollbar{width:12px}.stylesprizesContainer80IXd-camelCase::-webkit-scrollbar-thumb,.stylesprizesContainer80IXd-camelCase::-webkit-scrollbar-thumb:hover{background:#fff;border-radius:10px}.stylescloseIcon2sCz5-camelCase{position:absolute;top:15px;right:17px;font-size:26px;color:#fff;text-shadow:2px 2px 8px grey;cursor:pointer;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:.2s}.stylescloseIcon2sCz5-camelCase:focus,.stylescloseIcon2sCz5-camelCase:hover{transform:scale(.95)}.stylesprizesHeader1poig-camelCase{justify-content:center;text-align:center;padding:20px 20px 25px;font-family:Titan One,sans-serif;font-size:48px;text-shadow:2px 2px 8px grey;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stylesprizesHeader1poig-camelCase,.stylesprizesRow2-fLj-camelCase{display:flex;align-items:center}.stylesprizesRow2-fLj-camelCase{flex-flow:row wrap;font-family:Nunito,sans-serif;font-size:30px;padding:10px 20px}.stylesprizeBlook1N8qX-camelCase{width:55px;margin:0 15px}.stylesprizesToken2uiqn-camelCase{height:30px;width:30px;border-radius:6px;margin-left:7px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media only screen and (max-width:800px){.stylesheaderTexts95eQ-camelCase{font-size:60px}.stylesstandingRow3BSMm-camelCase{height:140px;flex-direction:column;justify-content:center}.stylesrow3a1Px-camelCase{height:40px;align-items:center}.stylesplaceTextbkTWi-camelCase{width:auto;line-height:40px}.stylessuperPlaceTextK5wnQ-camelCase{width:auto;margin:2px 2px 6px}.stylesnameTextZdyCD-camelCase{margin-left:0;font-size:27px;line-height:38px;flex-grow:0}.stylescandyText1ZlcE-camelCase{font-size:24px}.stylescandyImg___2k_XJ-camelCase{height:25px}.stylesprizesContainer_80IXd-camelCase{max-width:350px;min-width:300px;width:90%}}@media only screen and (max-width:600px){.styles_headerBlook1ttS8-camelCase{display:none}}",""]),t.locals={headerRow:"stylesheaderRow__2cBm-camelCase",header:"stylesheader_2zzan-camelCase",headerBlook:"styles_headerBlook1ttS8-camelCase",headerText:"stylesheaderTexts95eQ-camelCase",desc:"stylesdesc15hiZ-camelCase",prizesButton:"stylesprizesButton37BAn-camelCase",standingRow:"stylesstandingRow3BSMm-camelCase",placeText:"stylesplaceTextbkTWi-camelCase",superPlaceText:"stylessuperPlaceTextK5wnQ-camelCase",nameText:"stylesnameTextZdyCD-camelCase",candyRow:"stylescandyRow1mXqp-camelCase",candyText:"stylescandyText1ZlcE-camelCase",candyImg:"stylescandyImg2k_XJ-camelCase",prizesContainer:"stylesprizesContainer80IXd-camelCase",closeIcon:"stylescloseIcon2sCz5-camelCase",prizesHeader:"stylesprizesHeader1poig-camelCase",prizesRow:"stylesprizesRow2-fLj-camelCase",prizeBlook:"stylesprizeBlook1N8qX-camelCase",prizesToken:"stylesprizesToken2uiqn-camelCase",row:"stylesrow3a1Px-camelCase"}},vBtp:function(e,t,a){var s=a("11cj");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},vPpK:function(e,t,a){var s=a("8EZC");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},wsbM:function(e,t,a){(t=e.exports=a("JPst")(!1)).push([e.i,".stylesheader1LJst-camelCase{font-size:8vw;width:80%;margin:0 5%;text-align:left;font-family:Creepster,sans-serif;text-shadow:2px 2px 8px grey;color:#b3ffb3;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stylesbuttonContainer3uLFE-camelCase{width:80%;margin:40px 5% 0;display:flex;flex-flow:column;align-items:flex-start}.stylesbutton2lTzR-camelCase{font-size:3vw;font-family:Creepster,sans-serif;font-weight:700;text-shadow:2px 2px 8px grey;color:#fff;opacity:.8;margin:5px 0;text-align:left;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;transition:.2s}.stylesbutton2lTzR-camelCase:hover{transform:scale(1.05);opacity:1}.stylescardContainer2DZzR-camelCase{width:25vw;height:32.5vw;z-index:-1;position:absolute}.stylescard1QHYEN-camelCase{top:50%;left:80%;transform:scale(.65) rotate(-20deg) translate(-50%,-50%)}.stylescard2t_mPc-camelCase{top:20%;left:60%;transform:scale(.65) rotate(10deg) translate(-50%,-50%)}.stylescard3Fu2fn-camelCase{top:20%;left:40%;transform:scale(.65) rotate(5deg) translate(-50%,-50%)}.stylescard41_edK-camelCase{top:55%;left:50%;transform:scale(.65) rotate(-10deg) translate(-50%,-50%)}.stylescard51VCz7-camelCase{top:19%;left:80%;transform:scale(.65) rotate(15deg) translate(-50%,-50%)}.stylesloginText3KpJg-camelCase{position:absolute;bottom:1%;width:90%;left:5%;font-size:18px;font-family:Nunito,sans-serif}.stylesloginText3KpJg-camelCase,.stylessavesHeader31eG8-camelCase{text-align:center;text-shadow:2px 2px 8px grey;color:#fff}.stylessavesHeader31eG8-camelCase{font-size:68px;width:80%;margin:70px 10% 50px;font-family:Creepster,sans-serif;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stylessavesHolder3Glcv-camelCase{width:90%;margin:5px 5%;display:flex;flex-direction:row;justify-content:space-evenly}.stylessaveContainernJwby-camelCase{background-color:#404040;border:7px solid #333;border-radius:6px;display:flex;flex-direction:column;max-width:300px;margin:15px 20px;flex-grow:1;font-family:Nunito,sans-serif;color:#fff;text-shadow:2px 2px 8px grey}.stylessaveTitle3iV54-camelCase{font-size:42px;line-height:45px;margin:5px 5% 0}.stylessaveSubTitleCchlQ-camelCase,.stylessaveTitle3iV54-camelCase{font-weight:700;width:90%}.stylessaveSubTitleCchlQ-camelCase{font-size:32px;margin:0 5%;opacity:.75}.stylessaveRowkRJCK-camelCase{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;width:90%;margin:5px auto;font-size:22px;height:25px}.stylessaveIcon1mJ8u-camelCase{width:38px;text-align:center;margin-left:5px}.stylessaveHealthHolderUBAmL-camelCase{height:18px;width:calc(100% - 43px);margin-right:auto;background-color:#c43a35;border-radius:5px;overflow:hidden}.stylessaveHealthBar3Ng8i-camelCase{width:100%;height:100%;background-color:#4bc22e;transform-origin:left}.stylesloadButton1x0aA-camelCase{background-color:#404040;border:7px solid #333;box-shadow:0 0 8px 3px rgba(0,0,0,.2);border-radius:6px;display:flex;justify-content:center;align-items:center;margin:15px auto;font-family:Nunito,sans-serif;font-weight:700;font-size:26px;padding:5px 13px;color:#fff;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;transition:.2s}.stylesloadButton1x0aA-camelCase:hover{transform:scale(.95)}.stylesemptySave3VrZw-camelCase{font-size:54px;padding:20px 0;margin:auto;font-weight:700}.stylesbackButton2nwBW-camelCase{position:absolute;top:10px;left:10px;font-size:30px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;color:#fff;text-shadow:2px 2px 8px grey}.stylesbackButton2nwBW-camelCase,.stylesstageText3PfQM-camelCase{font-family:Nunito,sans-serif}.stylesstageText3PfQM-camelCase{font-size:28px;font-weight:700;margin-right:10px;color:#3a3a3a;line-height:50px;text-align:right;overflow:hidden}@media only screen and (max-width:800px){.stylesheader1LJst-camelCase{font-size:25vw}.stylesbutton2lTzR-camelCase{font-size:10vw}.stylescardContainer2DZzR-camelCase{display:none;opacity:0}.stylessavesHolder3Glcv-camelCase{width:90%;margin:5px 5%;flex-direction:column;justify-content:space-evenly;align-items:center}.stylessaveContainernJwby-camelCase{width:300px;margin:15px 20px}.stylessavesHeader31eG8-camelCase{font-size:68px;margin:40px 10% 10px}.stylesbackButton2nwBW-camelCase{font-size:26px}}",""]),t.locals={header:"stylesheader1LJst-camelCase",buttonContainer:"stylesbuttonContainer3uLFE-camelCase",button:"stylesbutton2lTzR-camelCase",cardContainer:"stylescardContainer2DZzR-camelCase",card1:"stylescard1QHYEN-camelCase",card2:"stylescard2___t_mPc-camelCase",card3:"stylescard3_Fu2fn-camelCase",card4:"styles_card41_edK-camelCase",card5:"stylescard51VCz7-camelCase",loginText:"stylesloginText3KpJg-camelCase",savesHeader:"stylessavesHeader31eG8-camelCase",savesHolder:"stylessavesHolder3Glcv-camelCase",saveContainer:"stylessaveContainernJwby-camelCase",saveTitle:"stylessaveTitle3iV54-camelCase",saveSubTitle:"stylessaveSubTitleCchlQ-camelCase",saveRow:"stylessaveRowkRJCK-camelCase",saveIcon:"stylessaveIcon1mJ8u-camelCase",saveHealthHolder:"stylessaveHealthHolderUBAmL-camelCase",saveHealthBar:"stylessaveHealthBar3Ng8i-camelCase",loadButton:"stylesloadButton1x0aA-camelCase",emptySave:"stylesemptySave3VrZw-camelCase",backButton:"stylesbackButton2nwBW-camelCase",stageText:"stylesstageText_3PfQM-camelCase"}},yGy1:function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("wIs1"),u=a("mLw1"),m=a("FLf1"),f=a.n(m),p=a("b6Qr"),=a("vDqi"),d=a.n(),h=a("4MCU"),y=a("vPpK"),w=a.n(y),b=a("GIcp"),g=a.n(b),v=a("2g2H"),C=a("iQ+n"),x=a("TN+F"),k=a("5Gl+"),T=a("6Ny9"),S=a("DoX5");function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e){return function(e){if(Array.isArray(e))return N(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return N(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return N(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,s=new Array(t);a<t;a++)s[a]=e[a];return s}function O(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function B(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=P(e);if(t){var o=P(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return z(this,a)}}function z(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?R(e):t}function R(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto_||Object.getPrototypeOf(e)})(e)}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&j(e,t)}(r,e);var t,a,s,n=B(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).state={card:{},health:0,riskText:""},t.ready=!1,t.onSelect=t.onSelect.bind(R(t)),t}return t=r,(a=[{key:"componentDidMount",value:function(){var e=this;if(this.props.tower&&"risk"===this.props.tower.stage){var t=function(e,t){var a={},s=0;if("+"===t){s=Math.round(.01Object(x.o)(25,41)(100-e))||10;var o=Object(x.m)(k.b[0===Object(x.o)(0,2)?"uncommon":"rare"]);a={blook:o,strength:Object(x.o)(16,19),charisma:Object(x.o)(16,19),wisdom:Object(x.o)(16,19),class:k.c[o].class}}else{s=-Math.round(.01Object(x.o)(30,46)e)||-10;var n=Object(x.m)(k.b.common);a={blook:n,strength:Object(x.o)(0,5),charisma:Object(x.o)(0,5),wisdom:Object(x.o)(0,5),class:k.c[n].class}}return{card:a,health:s}}(this.props.tower.life,this.props.tower.enemy),a="".concat(t.card.strength,"/").concat(t.card.charisma,"/").concat(t.card.wisdom," ").concat(t.card.blook," Card");this.setState({card:t.card,health:t.health,riskText:"Gain a ".concat(a," or ").concat(t.health>0?"Heal for":"Sacrifice"," ").concat(Math.abs(t.health)," Health?")},(function(){e.waitTimeout=setTimeout((function(){e.ready=!0}),1e3)}))}}},{key:"componentWillUnmount",value:function(){clearTimeout(this.waitTimeout)}},{key:"onSelect",value:function(e){var t=this;if(this.ready){var a=I(this.props.tower.cards),s=this.props.tower.life;e?(a=[].concat(I(this.props.tower.cards),[this.state.card]),this.props.setTowerCards(a)):(s+=this.state.health,this.props.setTowerLife(s)),this.props.tower.towerId?(d.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,d.a.put("/api/towers/save",{id:this.props.tower.towerId,stage:"map",cards:a,life:s}).then((function(){t.props.setTowerStage("map"),t.props.history.push("/tower/map")})).catch((function(e){console.error(e)}))):(this.props.setTowerStage("map"),this.props.history.push("/tower/map"))}}},{key:"render",value:function(){var e=this;if(this.props.tower&&this.props.tower.hwId)this.redirect=!1;else if("undefined"!=typeof window&&localStorage.getItem("token")){var t=localStorage.getItem("token").split(" ");2===t.length?f.a.verify(t[1],"a809c7b3f",(function(t){e.redirect=!!t})):this.redirect=!0}else this.redirect=!0;return this.redirect||!this.props.tower||"risk"!==this.props.tower.stage?o.a.createElement(u.a,{to:"/login"}):o.a.createElement("div",{className:p.isMobile?g.a.mBody:g.a.body,style:{backgroundColor:"#292929"}},o.a.createElement(C.a,{title:"Play Tower of Doom | Blooket",desc:"Ascend the feared Tower of Doom by answering questions and building a deck to defeat evil Blooks on your way to the top."}),o.a.createElement(v.a,{coins:this.props.tower.coins}),this.state.health?o.a.createElement("div",{className:g.a.regularBody,style:{overflow:"hidden"}},o.a.createElement("div",{className:w.a.lifeContainer},o.a.createElement(T.a,{currentLife:this.props.tower.life,maxLife:100})),o.a.createElement(S.a,{name:this.state.card.blook,className:w.a.blook}),o.a.createElement("div",{className:w.a.textContainer},o.a.createElement("div",{className:w.a.riskText},this.state.riskText),o.a.createElement("div",{className:w.a.buttonContainer},o.a.createElement("div",{className:w.a.button,role:"button",tabIndex:0,onClick:function(){return e.onSelect(!0)}},"Card"),o.a.createElement("div",{className:w.a.button,role:"button",tabIndex:0,onClick:function(){return e.onSelect(!1)}},"Health")))):null)}}])&&O(t.prototype,a),s&&O(t,s),r}(o.a.Component);A.propTypes={history:c.a.object.isRequired,tower:c.a.object,setTowerCards:c.a.func.isRequired,setTowerStage:c.a.func.isRequired,setTowerLife:c.a.func.isRequired};t.a=Object(l.a)(Object(r.b)((function(e){return{tower:e.towers.tower}}),(function(e){return Object(n.b)({setTowerCards:h.c,setTowerStage:h.g,setTowerLife:h.f},e)}))(A))},ySkM:function(e,t,a){var s=a("ABkm");"string"==typeof s&&(s=[[e.i,s,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,o);s.locals&&(e.exports=s.locals)},z2sy:function(e,t,a){"use strict";var s=a("q1tI"),o=a.n(s),n=a("ANjH"),r=a("/MKj"),i=a("17x9"),c=a.n(i),l=a("wIs1"),u=a("mLw1"),m=a("vDqi"),f=a.n(m),p=a("b6Qr"),=a("pMbe"),d=a("dJL0"),h=a("jsdw"),y=a.n(h),w=a("GIcp"),b=a.n(w),g=a("iQ+n"),v=a("ZENw"),C=a("e/rn"),x=a("TN+F"),k=a("SdQT");function T(e){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function E(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?S(Object(a),!0).forEach((function(t){I(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):S(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function I(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function N(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.proto=t,e})(e,t)}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,s=R(e);if(t){var o=R(this).constructor;a=Reflect.construct(s,arguments,o)}else a=s.apply(this,arguments);return B(this,a)}}function B(e,t){return!t||"object"!==T(t)&&"function"!=typeof t?z(e):t}function z(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.proto_||Object.getPrototypeOf(e)})(e)}var P=function(e){return o.a.createElement("div",{className:y.a.statContainer},o.a.createElement("div",{className:y.a.toysText},Object(x.t)(e.toys)),o.a.createElement("img",{src:C.a,alt:"Toy",className:y.a.toyImage,draggable:!1}))},A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&O(e,t)}(r,e);var t,a,s,n=j(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).state={numCorrect:"",numQuestions:"",ready:!1},t.saveStats=t.saveStats.bind(z(t)),t.final=!1,t}return t=r,(a=[{key:"componentDidMount",value:function(){var e=this;if(this.props.client&&this.props.client.standing&&this.props.client.standing[0]){this.props.firebase.setVal({id:this.props.client.hostId,path:"c/".concat(this.props.client.name),val:{c:E({},this.props.client.corrects),i:E({},this.props.client.incorrects)}});var t=this.props.client.standing.map((function(e){return e.name})).indexOf(this.props.client.name);if(-1!==t){var a=0,s=0;Object.values(this.props.client.corrects).forEach((function(e){a+=e,s+=e})),Object.values(this.props.client.incorrects).forEach((function(e){s+=e}));var o=this.props.client.standing[t].place;this.stats={place:o,toys:this.props.client.standing[t].toys,playersDefeated:this.props.client.standing.length-o,correctAnswers:a,blookUsed:this.props.client.blook,nameUsed:this.props.client.name,contest:this.props.client.contest},this.props.client.username&&this.saveStats(this.props.client.username,(function(){})),this.readyTimeout=setTimeout((function(){e.setState({ready:!0,numCorrect:a,numQuestions:s,me:e.props.client.standing[t]})}),4750)}}}},{key:"componentWillUnmount",value:function(){clearTimeout(this.readyTimeout),this.props.deleteClient()}},{key:"saveStats",value:function(e,t){f.a.defaults.headers.common.Authorization="undefined"!=typeof window?localStorage.getItem("token"):null,f.a.put("/api/users/toystats",{name:e,place:this.stats.place,toys:this.stats.toys,playersDefeated:this.stats.playersDefeated,correctAnswers:this.stats.correctAnswers,blookUsed:this.stats.blookUsed,nameUsed:this.stats.nameUsed,contest:this.stats.contest}).then((function(){t()})).catch((function(e){console.error(e)}))}},{key:"render",value:function(){return this.props.client&&this.props.client.standing&&this.props.client.standing[0]?o.a.createElement("div",{className:p.isMobile?b.a.mBody:b.a.body,style:{backgroundColor:"#0bc2cf"}},o.a.createElement(g.a,{title:"Play Blooket",desc:"Join a game of Blooket to answer questions and compete in a fierce clash to determine who is the best and what Blook will come out victorious."}),o.a.createElement(d.a,{leftText:this.props.client.name,rightText:"Play Again",rightLink:"/play"}),this.state.ready?o.a.createElement(v.a,{standings:this.props.client.standing,name:this.props.client.name,numCorrect:this.state.numCorrect,numQuestions:this.state.numQuestions,username:this.props.client.username,plus:this.props.client.plus,myStat:"".concat(Object(x.l)(this.state.me.toys)," Toys"),saveStats:this.saveStats,renderStandingStat:P,renderStats:function(){},tokenMultiplier:.25}):null):o.a.createElement(u.a,{to:"/play"})}}])&&N(t.prototype,a),s&&N(t,s),r}(o.a.Component);A.propTypes={client:c.a.shape({name:c.a.string,hostId:c.a.string,points:c.a.number,score:c.a.number,answer:c.a.string,raceResult:c.a.array,standing:c.a.array,blook:c.a.string,totalPoints:c.a.number,corrects:c.a.any,question:c.a.object,raceFinishes:c.a.array,tens:c.a.number,fifties:c.a.number,username:c.a.string,mode:c.a.string,type:c.a.string,incorrects:c.a.object,upgrades:c.a.number,plus:c.a.bool,contest:c.a.bool}),deleteClient:c.a.func.isRequired,firebase:c.a.object};t.a=Object(l.a)(Object(r.b)((function(e){return{client:e.clients.client}}),(function(e){return Object(n.b)({deleteClient:.a},e)}))(Object(k.d)(A)))}}); //# sourceMappingURL=main~ac5e5fc5.90da7dcc6a22aa0ad5cd.js.map

Ihackedyourmom commented 3 years ago

[****](url fgortniytrdex

`