text: (function(e){function t(t){for(var o,n,s=t[0],u=t[1],c=t[2],l=0,p=[];l<s.length;l++)n=s[l],Object.prototype.hasOwnProperty.call(a,n)&&a[n]&&p.push(a[n][0]),a[n]=0;for(o in u)Object.prototype.hasOwnProperty.call(u,o)&&(e[o]=u[o]);d&&d(t);while(p.length)p.shift()();return i.push.apply(i,c||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],o=!0,n=1;n<r.length;n++){var s=r[n];0!==a[s]&&(o=!1)}o&&(i.splice(t--,1),e=u(u.s=r[0]))}return e}var o={},n={app:0},a={app:0},i=[];function s(e){return u.p+"js/"+({Deposit:"Deposit",GameList:"GameList",Lobby:"Lobby",Withdrawal:"Withdrawal"}[e]||e)+"."+{Deposit:"0e862a0b",GameList:"d7e6d650",Lobby:"fde863c8",Withdrawal:"b5fb17d7"}[e]+".js"}function u(t){if(o[t])return o[t].exports;var r=o[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.e=function(e){var t=[],r={GameList:1,Lobby:1};n[e]?t.push(n[e]):0!==n[e]&&r[e]&&t.push(n[e]=new Promise((function(t,r){for(var o="css/"+({Deposit:"Deposit",GameList:"GameList",Lobby:"Lobby",Withdrawal:"Withdrawal"}[e]||e)+"."+{Deposit:"31d6cfe0",GameList:"8901eae5",Lobby:"6cb73ca5",Withdrawal:"31d6cfe0"}[e]+".css",a=u.p+o,i=document.getElementsByTagName("link"),s=0;s<i.length;s++){var c=i[s],l=c.getAttribute("data-href")||c.getAttribute("href");if("stylesheet"===c.rel&&(l===o||l===a))return t()}var p=document.getElementsByTagName("style");for(s=0;s<p.length;s++){c=p[s],l=c.getAttribute("data-href");if(l===o||l===a)return t()}var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.onload=t,d.onerror=function(t){var o=t&&t.target&&t.target.src||a,i=new Error("Loading CSS chunk "+e+" failed.\n("+o+")");i.code="CSS_CHUNK_LOAD_FAILED",i.request=o,delete n[e],d.parentNode.removeChild(d),r(i)},d.href=a;var f=document.getElementsByTagName("head")[0];f.appendChild(d)})).then((function(){n[e]=0})));var o=a[e];if(0!==o)if(o)t.push(o[2]);else{var i=new Promise((function(t,r){o=a[e]=[t,r]}));t.push(o[2]=i);var c,l=document.createElement("script");l.charset="utf-8",l.timeout=120,u.nc&&l.setAttribute("nonce",u.nc),l.src=s(e);var p=new Error;c=function(t){l.onerror=l.onload=null,clearTimeout(d);var r=a[e];if(0!==r){if(r){var o=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;p.message="Loading chunk "+e+" failed.\n("+o+": "+n+")",p.name="ChunkLoadError",p.type=o,p.request=n,r[1](p)}a[e]=void 0}};var d=setTimeout((function(){c({type:"timeout",target:l})}),12e4);l.onerror=l.onload=c,document.head.appendChild(l)}return Promise.all(t)},u.m=e,u.c=o,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)u.d(r,o,function(t){return e[t]}.bind(null,o));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/user/",u.oe=function(e){throw console.error(e),e};var c=window["webpackJsonp"]=window["webpackJsonp"]||[],l=c.push.bind(c);c.push=t,c=c.slice();for(var p=0;p<c.length;p++)t(c[p]);var d=l;i.push([0,"chunk-vendors"]),r()})({0:function(e,t,r){e.exports=r("56d7")},3333:function(e,t,r){},4278:function(e,t,r){"use strict";var o=r("3333"),n=r.n(o);n.a},"56d7":function(e,t,r){"use strict";r.r(t);r("cadf"),r("551c"),r("f751"),r("097d");var o=r("2b0e"),n=r("26b9"),a=r.n(n),i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{attrs:{id:"app"}},[r("div",{staticClass:"errorBlock"},e._l(this.$store.state.errors,(function(t,o){return r("span",{key:o},[e._v("\n      "+e._s(t.content.error)+"\n    ")])})),0),r("div",{staticClass:"container"},[r("transition",{attrs:{name:"page",mode:"out-in"}},[r("router-view")],1)],1),r("vue-progress-bar")],1)},s=[],u=(r("5c0b"),r("2877")),c={},l=Object(u["a"])(c,i,s,!1,null,null,null),p=l.exports,d=r("8c4f"),f=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"login-form"},[r("div",{staticClass:"icon"}),r("h2",[e._v("IT30路邊賭場上線了！")]),r("form",{attrs:{autocomplete:"off"},on:{submit:function(t){return t.preventDefault(),e.login(t)}}},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.email,expression:"email"}],attrs:{type:"text",placeholder:"信箱",autocomplete:"off"},domProps:{value:e.email},on:{input:function(t){t.target.composing||(e.email=t.target.value)}}}),r("input",{directives:[{name:"model",rawName:"v-model",value:e.password,expression:"password"}],attrs:{type:"password",placeholder:"密碼",autocomplete:"off"},domProps:{value:e.password},on:{input:function(t){t.target.composing||(e.password=t.target.value)}}}),r("button",{attrs:{type:"submit"}},[e._v("登入")]),r("button",{attrs:{disabled:""}},[e._v("試玩")])]),r("span",{staticClass:"note"},[e._v("\n    沒有帳號嗎？\n    "),r("router-link",{attrs:{to:"register"}},[e._v("註冊")])],1)])},m=[],h={data:function(){return{email:"",password:""}},methods:{login:function(){var e=this;this.email&&this.password?(this.$Progress.start(),this.$store.dispatch("login",{email:this.email,password:this.password}).then((function(){e.$Progress.finish(),e.$router.push({name:"gamelist"})}),(function(t){e.$Progress.fail(),e.$store.dispatch("pushError",t.response.data)})).catch((function(t){e.$Progress.fail(),e.$store.dispatch("pushError",t.response.data)}))):this.$store.dispatch("pushError",{error:"欄位不能為空"})}}},v=h,g=(r("f655"),Object(u["a"])(v,f,m,!1,null,"d585d24a",null)),b=g.exports,y=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"login-form"},[r("div",{staticClass:"icon"}),e.done?[r("p",[e._v("信箱註冊的密碼已經送到你的信箱")]),r("p",[e._v("\n      請至註冊信箱取得密碼並\n      "),r("router-link",{attrs:{to:"login"}},[e._v("登入")])],1)]:[r("p",[e._v("註冊會將登入密碼寄送至信箱")]),r("form",{attrs:{action:"",autocomplete:"off"},on:{submit:function(t){return t.preventDefault(),e.register(t)}}},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.email,expression:"email"}],class:{emptyRed:e.isEmptyWarning(e.email)},attrs:{type:"email",placeholder:"信箱",autocomplete:"off"},domProps:{value:e.email},on:{input:function(t){t.target.composing||(e.email=t.target.value)}}}),r("button",{attrs:{type:"submit",disabled:e.isLock}},[e._v("註冊")])]),r("span",{staticClass:"note"},[e._v("\n      已經有帳號了?\n      "),r("router-link",{attrs:{to:"login"}},[e._v("登入")])],1)]],2)},_=[],E={data:function(){return{email:"",done:!1,emptyError:!1,isLock:!1}},methods:{isEmptyWarning:function(e){if(this.emptyError)return!e},register:function(){var e=this;if(!this.email)return this.$store.dispatch("pushError",{error:"欄位不能為空"}),this.emptyError=!0,null;this.$Progress.start(),this.isLock=!0,this.$store.dispatch("register",{email:this.email}).then((function(t){e.$Progress.finish(),e.isLock=!1,e.done=!0})).catch((function(t){e.$Progress.fail(),e.isLock=!1,e.$store.dispatch("pushError",t.response.data)}))}}},w=E,A=(r("4278"),Object(u["a"])(w,y,_,!1,null,"2b8a5262",null)),S=A.exports;o["a"].use(d["a"]);var L=new d["a"]({base:"/user/",routes:[{path:"/",name:"login",component:b},{path:"/login",name:"login",component:b},{path:"/register",name:"register",component:S},{path:"/lobby",name:"lobby",meta:{requiresAuth:!0},component:function(){return r.e("Lobby").then(r.bind(null,"417e"))},children:[{path:"/lobby",name:"gamelist",component:function(){return r.e("GameList").then(r.bind(null,"47b9"))}},{path:"/lobby/withdrawal",name:"withdrawal",component:function(){return r.e("Withdrawal").then(r.bind(null,"8a3b"))}},{path:"/lobby/deposit",name:"deposit",component:function(){return r.e("Deposit").then(r.bind(null,"60ac"))}}]}]});L.beforeEach((function(e,t,r){var o=localStorage.getItem("user");e.matched.some((function(e){return e.meta.requiresAuth}))?o?r():r("/"):r()}));var P=L,T=r("2f62"),k=r("bc3a"),O=r.n(k);o["a"].use(T["a"]);var $=new T["a"].Store({state:{user:null,errors:[]},mutations:{SET_USER_DATA:function(e,t){e.user=t,localStorage.setItem("user",JSON.stringify(t)),O.a.defaults.headers.common["Authorization"]="Bearer ".concat(t.token)},CLEAR_USER_DATA:function(e){localStorage.removeItem("user"),window.location.reload()},SET_ERROR_DATA:function(e,t){e.errors.push({id:e.errors.length,content:t}),setTimeout((function(){e.errors.reverse(),e.errors.pop(),e.errors.reverse()}),2e3)}},actions:{pushError:function(e,t){var r=e.commit;r("SET_ERROR_DATA",t)},register:function(e,t){e.commit;return O.a.post("//".concat("it30.herokuapp.com","/api/register"),t)},login:function(e,t){var r=e.commit;return console.log("it30.herokuapp.com"),console.log(Object({NODE_ENV:"production",VUE_APP_HOST:"it30.herokuapp.com",BASE_URL:"/user/"}).VUE_APP_PORT),O.a.post("//".concat("it30.herokuapp.com","/api/login"),t).then((function(e){var t=e.data;r("SET_USER_DATA",t)}))},updateUserInfo:function(e){var t=e.commit,r=e.state;return O.a.get("//".concat("it30.herokuapp.com","/api/userInfo"),r.user).then((function(e){var r=e.data;t("SET_USER_DATA",r)}))},logout:function(e){var t=e.commit;t("CLEAR_USER_DATA")}},getters:{loggedIn:function(e){return!!e.user},userInfo:function(e){return e.user}}});o["a"].config.productionTip=!1;var D={color:"#d3ad44",failedColor:"#d3ad44",thickness:"10px",transition:{speed:"0.2s",opacity:"0.6s",termination:300},autoRevert:!0,location:"top",inverse:!1};o["a"].use(a.a,D),new o["a"]({router:P,store:$,created:function(){var e=this,t=localStorage.getItem("user");if(t){var r=JSON.parse(t);this.$store.commit("SET_USER_DATA",r),O.a.interceptors.response.use((function(e){return e}),(function(t){return 401===t.response.status?e.$store.dispatch("logout"):e.$store.dispatch("pushError",t.response.data),Promise.reject(t)}))}},render:function(e){return e(p)}}).$mount("#app")},"5c0b":function(e,t,r){"use strict";var o=r("e332"),n=r.n(o);n.a},"883e":function(e,t,r){},e332:function(e,t,r){},f655:function(e,t,r){"use strict";var o=r("883e"),n=r.n(o);n.a}});
  //# sourceMappingURL=app.15a82ce0.js.map