(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{625:function(e,n,r){"use strict";r.r(n),r.d(n,"meGql",(function(){return O})),r.d(n,"loginUserGql",(function(){return S})),r.d(n,"registerUserGql",(function(){return G})),r.d(n,"loginUserGoogleGql",(function(){return I})),r.d(n,"grantGoogleScopeGql",(function(){return V})),r.d(n,"createSubscriptionGql",(function(){return j})),r.d(n,"cancelSubscriptionGql",(function(){return C})),r.d(n,"editUserGql",(function(){return B}));var t,o,l,c,d,m,v,f,h,w,_=r(620),$=r(130),k=r.n($),y=k()(t||(t=Object(_.a)(["\n fragment userFragment on User {\n id\n email\n subscriptionType\n ccLast4\n }\n"]))),x=k()(o||(o=Object(_.a)(["\n fragment userFull on User {\n id\n email\n subscriptionType\n ccLast4\n firstName\n lastName\n phone\n paymentInstructions\n themeId\n }\n"]))),O=k()(l||(l=Object(_.a)(["\n query me {\n me {\n ...userFull\n }\n }\n\n ","\n"])),x),S=k()(c||(c=Object(_.a)(["\n mutation loginUser($email: String!, $password: String!) {\n loginUser(email: $email, password: $password) {\n user {\n ...userFragment\n }\n token\n }\n }\n\n ","\n"])),y),G=k()(d||(d=Object(_.a)(["\n mutation registerUser($email: String!, $password: String!) {\n registerUser(email: $email, password: $password) {\n user {\n ...userFragment\n }\n token\n }\n }\n\n ","\n"])),y),I=k()(m||(m=Object(_.a)(["\n mutation loginUserGoogle($userJson: String!) {\n loginUserGoogle(userJson: $userJson) {\n user {\n ...userFragment\n }\n token\n }\n }\n\n ","\n"])),y),V=k()(v||(v=Object(_.a)(["\n mutation grantGoogleScope($authCode: String!) {\n grantGoogleScope(authCode: $authCode) {\n user {\n ...userFragment\n }\n token\n }\n }\n\n ","\n"])),y),j=k()(f||(f=Object(_.a)(["\n mutation createSubscription($source: String!, $ccLast4: String!) {\n createSubscription(source: $source, ccLast4: $ccLast4) {\n ...userFragment\n }\n }\n\n ","\n"])),y),C=k()(h||(h=Object(_.a)(["\n mutation cancelSubscription {\n cancelSubscription {\n ...userFragment\n }\n }\n\n ","\n"])),y),B=k()(w||(w=Object(_.a)(["\n mutation editUser(\n $email: String!,\n $phone: String!,\n $firstName: String!,\n $lastName: String!,\n $paymentInstructions: String!,\n $logoBase64: String!,\n ) {\n editUser(\n email: $email,\n phone: $phone,\n firstName: $firstName,\n lastName: $lastName,\n paymentInstructions: $paymentInstructions,\n logoBase64: $logoBase64,\n ) {\n ...userFull\n }\n }\n\n ","\n"])),x)},905:function(e,n,r){"use strict";r.r(n);var t=r(21),o=(r(70),r(45),r(171),r(170)),l=r(625),c=r(355);Object(o.d)("eager");var d={components:{ValidationObserver:o.a,ValidationProvider:o.b},data:function(){return{showPassword:!1,valid:!1,email:"test@test.com",password:"password",error:"",loading:!1}},apollo:{},methods:{test:function(){var e=this;return Object(t.a)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e.error="",n.prev=1,n.next=4,e.$apollo.query({query:l.meGql,fetchPolicy:"no-cache"}).then((function(e){console.log(e.data.me)}));case 4:n.sent,n.next=11;break;case 7:n.prev=7,n.t0=n.catch(1),console.log(n.t0),e.error=n.t0.message.slice(15);case 11:case"end":return n.stop()}}),n,null,[[1,7]])})))()},register:function(){var e=this;return Object(t.a)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e.error="",n.next=3,e.$refs.form.validate().then(function(){var n=Object(t.a)(regeneratorRuntime.mark((function n(r){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!r){n.next=15;break}return e.loading=!0,n.prev=2,n.next=5,e.$apollo.mutate({mutation:l.registerUserGql,variables:{email:e.email,password:e.password}});case 5:n.sent,Object(c.default)({app:e,store:e.$store}),e.$router.push("/user/payment"),n.next=14;break;case 10:n.prev=10,n.t0=n.catch(2),console.log(n.t0),e.error=n.t0.message.slice(15);case 14:e.loading=!1;case 15:case"end":return n.stop()}}),n,null,[[2,10]])})));return function(e){return n.apply(this,arguments)}}());case 3:case"end":return n.stop()}}),n)})))()},login:function(){var e=this;return Object(t.a)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e.error="",n.next=3,e.$refs.form.validate().then(function(){var n=Object(t.a)(regeneratorRuntime.mark((function n(r){var t;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!r){n.next=15;break}return e.loading=!0,n.prev=2,n.next=5,e.$apollo.mutate({mutation:l.loginUserGql,variables:{email:e.email,password:e.password}});case 5:t=n.sent,Object(c.default)({app:e,store:e.$store}),"Basic - Monthly"!==t.data.loginUser.user.subscriptionType?e.$router.push("/user/payment"):e.$router.push("/user/me"),n.next=14;break;case 10:n.prev=10,n.t0=n.catch(2),console.log(n.t0),e.error=n.t0.message.slice(15);case 14:e.loading=!1;case 15:case"end":return n.stop()}}),n,null,[[2,10]])})));return function(e){return n.apply(this,arguments)}}());case 3:case"end":return n.stop()}}),n)})))()}}},m=r(39),v=r(59),f=r.n(v),h=r(237),w=r(621),_=r(619),$=r(602),k=r(811),y=r(612),x=r(773),O=r(51),S=r(129),component=Object(m.a)(d,(function(){var e=this,n=e.$createElement,r=e._self._c||n;return r("v-card",{staticClass:"mx-auto",attrs:{elevation:"10","max-width":"500",loading:e.$apollo.loading||e.loading,disabled:e.$apollo.loading||e.loading}},[r("v-toolbar",{attrs:{flat:"",color:"primary",dark:""}},[r("v-toolbar-title",[r("h1",{staticClass:"headline"},[e._v("Login / Register")])])],1),e._v(" "),r("v-card-text",[r("ValidationObserver",{ref:"form"},[r("v-form",{model:{value:e.valid,callback:function(n){e.valid=n},expression:"valid"}},[r("ValidationProvider",{attrs:{name:"Email",rules:"required|email"},scopedSlots:e._u([{key:"default",fn:function(n){var t=n.errors;return[r("v-text-field",{attrs:{label:"Email","error-messages":t,"prepend-icon":"mdi-email",required:""},on:{keyup:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.login.apply(null,arguments)}},model:{value:e.email,callback:function(n){e.email=n},expression:"email"}})]}}])}),e._v(" "),r("ValidationProvider",{attrs:{name:"Password",rules:"required|min:8"},scopedSlots:e._u([{key:"default",fn:function(n){var t=n.errors;return[r("v-text-field",{attrs:{label:"Password",type:e.showPassword?"text":"password","prepend-icon":"mdi-lock-question","append-icon":e.showPassword?"mdi-eye":"mdi-eye-off","error-messages":t,required:""},on:{"click:append":function(n){e.showPassword=!e.showPassword},keyup:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.login.apply(null,arguments)}},model:{value:e.password,callback:function(n){e.password=n},expression:"password"}})]}}])})],1)],1)],1),e._v(" "),r("v-divider"),e._v(" "),r("v-card-actions",[e.error?r("span",{staticClass:"error--text"},[e._v(e._s(e.error))]):e._e(),e._v(" "),r("v-spacer"),e._v(" "),r("v-btn",{attrs:{color:"info"},on:{click:e.register}},[e._v("Register")]),e._v(" "),r("v-btn",{attrs:{color:"success"},on:{click:e.login}},[e._v("Login")])],1)],1)}),[],!1,null,null,null),G=component.exports;f()(component,{VBtn:h.a,VCard:w.a,VCardActions:_.a,VCardText:_.c,VDivider:$.a,VForm:k.a,VSpacer:y.a,VTextField:x.a,VToolbar:O.a,VToolbarTitle:S.b});var I={components:{},data:function(){return{isInit:!1,error:"",loading:!1,curGoogleButtonImage:"/btn_google_signin_dark_normal_web.png",googleButtonImageNormal:"/btn_google_signin_dark_normal_web.png",googleButtonImageFocus:"/btn_google_signin_dark_focus_web.png",googleButtonImagePressed:"/btn_google_signin_dark_pressed_web.png"}},apollo:{},mounted:function(){var e=this,n=setInterval((function(){e.isInit=e.$gAuth.isInit,e.isInit&&clearInterval(n)}),100)},methods:{login:function(){var e=this;return Object(t.a)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:e.error="",e.loading=!0,e,e.curGoogleButtonImage=e.googleButtonImagePressed,e.$gAuth.signIn().then(function(){var n=Object(t.a)(regeneratorRuntime.mark((function n(r){var t,o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t={googleId:r.getId(),firstName:r.getBasicProfile().pW,lastName:r.getBasicProfile().qU,email:r.getBasicProfile().yu,auth_token:r.getAuthResponse()},n.prev=1,n.next=4,e.$apollo.mutate({mutation:l.loginUserGoogleGql,variables:{userJson:JSON.stringify(t)}});case 4:o=n.sent,Object(c.default)({app:e,store:e.$store}),"Basic - Monthly"!==o.data.loginUserGoogle.user.subscriptionType?e.$router.push("/user/payment"):e.$router.push("/user/me"),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(1),console.log(n.t0),e.error=n.t0.message.slice(15);case 13:e.loading=!1,e.curGoogleButtonImage=e.googleButtonImageNormal;case 15:case"end":return n.stop()}}),n,null,[[1,9]])})));return function(e){return n.apply(this,arguments)}}()).catch((function(n){console.log(n),e.error=n.message,e.loading=!1,e.curGoogleButtonImage=e.googleButtonImageNormal}));case 5:case"end":return n.stop()}}),n)})))()}}},V=Object(m.a)(I,(function(){var e=this,n=e.$createElement,r=e._self._c||n;return r("v-card",{staticClass:"mx-auto",attrs:{elevation:"10","max-width":"500",loading:e.$apollo.loading||e.loading,disabled:e.$apollo.loading||e.loading}},[r("v-toolbar",{attrs:{flat:"",color:"primary",dark:""}},[r("v-toolbar-title",[r("h1",{staticClass:"headline"},[e._v("Login / Register")])])],1),e._v(" "),r("v-card-text",[r("p",[e._v("\n PetCareTools integrates directly with your Google calendar! It will\n automatically create Google calendar events for your appointments.\n ")]),e._v(" "),r("p",[e._v("\n For PetCareTools to work, you will need to grant access edit calendar\n events.\n ")])]),e._v(" "),r("v-divider"),e._v(" "),r("v-card-actions",[e.error?r("span",{staticClass:"error--text"},[e._v(e._s(e.error))]):e._e(),e._v(" "),r("v-spacer"),e._v(" "),r("img",{staticStyle:{cursor:"pointer"},attrs:{src:e.curGoogleButtonImage},on:{click:e.login}})],1)],1)}),[],!1,null,null,null),j=V.exports;f()(V,{VCard:w.a,VCardActions:_.a,VCardText:_.c,VDivider:$.a,VSpacer:y.a,VToolbar:O.a,VToolbarTitle:S.b});r(130);var C={name:"Login",components:{LoginCard:G,LoginCardGoogle:j}},B=r(613),U=r(616),R=r(614),P=Object(m.a)(C,(function(){var e=this.$createElement,n=this._self._c||e;return n("v-container",[n("v-row",[n("v-col",[n("login-card-google")],1)],1)],1)}),[],!1,null,null,null);n.default=P.exports;f()(P,{VCol:B.a,VContainer:U.a,VRow:R.a})}}]);