%PDF- %PDF-
Direktori : /home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/client/ |
Current File : //home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/client/0634855.js |
(window.webpackJsonp=window.webpackJsonp||[]).push([[33,11,21],{377:function(t,e,n){"use strict";n.r(e);var r={props:{title:{type:String,required:!0},description:{type:String,required:!1},width:{type:String,required:!1}}},o=n(10),component=Object(o.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("section",{staticClass:"bg-gray py-8 md:py-20 px-4 md:px-8 mb-8"},[n("div",{staticClass:"max-w-xl mx-auto w-full"},[n("header",{staticClass:"text-center mb-10"},[n("h2",{staticClass:"text-2xl sm:text-3xl font-bold",class:t.description?"mb-8":""},[t._v(t._s(t.title))]),t._v(" "),t.description?n("p",{staticClass:"text-sm sm:text-base"},[t._v(t._s(t.description))]):t._e()])]),t._v(" "),n("div",{staticClass:"mx-auto w-full",class:t.width?t.width:"max-w-xl"},[t._t("default")],2)])}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{Header:n(101).default})},396:function(t,e,n){var content=n(405);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(34).default)("5984fed3",content,!0,{sourceMap:!1})},404:function(t,e,n){"use strict";n(396)},405:function(t,e,n){var r=n(33)((function(i){return i[1]}));r.push([t.i,".modal[data-v-7219ff7f]{padding-top:20vh}",""]),t.exports=r},407:function(t,e,n){"use strict";n.r(e);var r=n(0),o=(n(60),n(3),{props:{value:{required:!0}},data:function(){return{isActive:!1,working:!1,card:{},card_name:null}},computed:{setup_intent:function(){return this.$store.state.account.billing.setupIntent}},mounted:function(){var t=this.$stripe.elements();this.$store.dispatch("account/billing/setupIntent"),this.card=t.create("card",{style:{base:{fontSize:"15px",fontFamily:"Poppins, sans-serif"}}}),this.card.mount("#new-card-element")},methods:{closeModal:function(){this.$emit("input",!this.value)},submitForm:function(){var t=this;this.$refs.paymentForm.validate().then((function(e){e&&t.saveCard()}))},saveCard:function(){var t=this;return Object(r.a)(regeneratorRuntime.mark((function e(){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===t.setup_intent){e.next=8;break}return t.working=!0,e.next=4,t.$stripe.confirmCardSetup(t.setup_intent,{payment_method:{card:t.card,billing_details:{name:t.card_name}}});case 4:n=e.sent,r=n.setupIntent,(o=n.error)?(t.$toast.error(o.message).goAway(3e3),t.$store.dispatch("account/billing/setupIntent"),t.working=!1):t.$store.dispatch("account/billing/savePaymentMethod",r.payment_method).then((function(){t.$store.dispatch("account/progress/get",{slug:"financial"}),t.$emit("input",!1),t.working=!1}));case 8:case"end":return e.stop()}}),e)})))()}},watch:{value:function(){var t=this;1==this.value?setTimeout((function(){t.isActive=!0}),100):setTimeout((function(){t.isActive=!1}),100)}}}),l=(n(404),n(10)),component=Object(l.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"show",rawName:"v-show",value:1==t.value,expression:"value == true"}],staticClass:"modal fixed z-50 bottom-0 left-0 w-full h-screen"},[n("div",{staticClass:"absolute z-10 top-0 left-0 w-full h-full bg-black bg-opacity-25 cursor-pointer transition duration-100",class:1==t.isActive?"opacity-100":"opacity-0",on:{click:t.closeModal}}),t._v(" "),n("div",{staticClass:"relative z-20 h-full bg-white shadow-lg p-10 pt-16 transition transform duration-100",class:1==t.isActive?"translate-y-0 opacity-100":"translate-y-full opacity-0"},[n("button",{staticClass:"absolute top-6 right-10 uppercase hover:text-blue-light focus:outline-none transition",attrs:{type:"button"},on:{click:t.closeModal}},[t._v("Close")]),t._v(" "),n("div",{staticClass:"relative h-full bg-gray p-8 overflow-y-auto"},[n("div",{staticClass:"max-w-lg w-full mx-auto"},[n("h2",{staticClass:"mb-8 text-center text-4xl font-bold"},[t._v("Add new card")]),t._v(" "),n("ValidationObserver",{ref:"paymentForm"},[n("form",{attrs:{role:"form",method:"POST"},on:{submit:function(e){return e.preventDefault(),t.submitForm(e)}}},[n("ValidationProvider",{attrs:{rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.errors;return[n("t-input-group",{attrs:{label:"Name on Card"}},[n("t-input",{attrs:{type:"text",placeholder:"Name on Card"},model:{value:t.card_name,callback:function(e){t.card_name=e},expression:"card_name"}}),t._v(" "),r[0]?n("span",{staticClass:"field-invalid"},[t._v(t._s(r[0]))]):t._e()],1)]}}])}),t._v(" "),n("t-input-group",{attrs:{label:"Card Information"}},[n("div",{staticClass:"px-4 py-4 bg-white border border-black border-opacity-20 rounded-xl",attrs:{id:"new-card-element"}})]),t._v(" "),n("div",{staticClass:"flex items-center justify-center px-10"},[n("button",{staticClass:"w-full btn btn-primary btn-small rounded-full",attrs:{disabled:1==t.working,type:"submit"}},[0==t.working?n("span",[t._v("Submit")]):n("span",{staticClass:"flex items-center justify-center"},[n("svg",{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[n("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),n("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),t._v(" "),n("span",[t._v("Processing")])])])]),t._v(" "),n("p",{staticClass:"text-sm text-center mt-6 text-black text-opacity-75"},[t._v("By subscribing to Take a Seat you are agreeing to all site "),n("NuxtLink",{staticClass:"text-blue-light hover:underline",attrs:{to:"/terms-conditions",target:"_blank"}},[t._v("Terms and Conditions")]),t._v(". Please read carefully before continuing.")],1)],1)])],1)])])])}),[],!1,null,"7219ff7f",null);e.default=component.exports},429:function(t,e,n){"use strict";n.r(e);var r=n(0),o=(n(3),{data:function(){return{modalOpen:!1,error:null,loading:!1,working:!1,isMakingPrimary:!1,isDeleting:!1,card:{},cardHolderName:null}},computed:{payment_methods:function(){return this.$store.state.account.billing.paymentMethods},default_payment_method:function(){return this.$store.state.account.billing.defaultPaymentMethod}},mounted:function(){var t=this;return Object(r.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.loading=!0,e.next=3,t.$store.dispatch("account/billing/getPaymentMethods").then((function(){t.loading=!1}));case 3:case"end":return e.stop()}}),e)})))()},methods:{removePaymentMethod:function(t){var e=this;return Object(r.a)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.$store.dispatch("account/billing/deletePaymentMethod",{payment_method:t});case 2:case"end":return n.stop()}}),n)})))()},makeMethodPrimary:function(t){var e=this;return Object(r.a)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.$store.dispatch("account/billing/makePrimary",{payment_method:t});case 2:case"end":return n.stop()}}),n)})))()}}}),l=n(10),component=Object(l.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Block",{attrs:{title:"Saved Cards",description:"Manage your saved cards, these cards will be used any payments you make through the take a seat website"}},[1==t.loading?n("div",[n("span",{staticClass:"flex items-center justify-center mb-8"},[n("svg",{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[n("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),n("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),t._v(" "),n("span",[t._v("Fetching Payment Methods")])])]):0==t.loading&&t.payment_methods.length?n("div",{staticClass:"grid grid-cols-1 gap-y-3 mb-10"},t._l(t.payment_methods,(function(e,r){return n("div",{key:r},[n("div",{staticClass:"relative grid grid-cols-3 bg-white border border-black border-opacity-10 pl-6 pr-8 py-4 rounded-lg"},[n("span",[t._v(t._s(e.billing_details.name))]),t._v(" "),n("span",{staticClass:"flex items-center justify-center"},[n("span",{staticClass:"font-medium mr-1"},[t._v("Last 4:")]),t._v(t._s(e.card.last4))]),t._v(" "),n("span",{staticClass:"flex items-center justify-end"},[n("span",{staticClass:"font-medium mr-1"},[t._v("Expiry:")]),t._v(t._s(e.card.exp_month)+"/"+t._s(e.card.exp_year))])]),t._v(" "),n("div",{staticClass:"pt-2 px-3 flex items-center justify-end"},[e.id!==t.default_payment_method.id?n("button",{staticClass:"ml-3 uppercase text-xs text-blue-light",attrs:{type:"button"},on:{click:function(n){return t.makeMethodPrimary(e.id)}}},[0==t.isMakingPrimary?n("span",[t._v("Make Primary")]):n("span",[t._v("Processing...")])]):t._e(),t._v(" "),e.id!==t.default_payment_method.id?n("button",{staticClass:"ml-3 uppercase text-xs text-red text-opacity-80",attrs:{type:"button"},on:{click:function(n){return t.removePaymentMethod(e.id)}}},[0==t.isDeleting?n("span",[t._v("Remove")]):n("span",[t._v("Processing...")])]):t._e()])])})),0):n("div",{staticClass:"text-center mb-10"},[n("p",{staticClass:"text-md font-bold"},[t._v("You have no cards yet")])]),t._v(" "),n("div",{staticClass:"flex items-center justify-center"},[n("button",{staticClass:"btn btn-primary btn-small rounded-full",on:{click:function(e){t.modalOpen=!t.modalOpen}}},[t._v("Add a new card")])]),t._v(" "),n("NewCardModal",{model:{value:t.modalOpen,callback:function(e){t.modalOpen=e},expression:"modalOpen"}})],1)}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{NewCardModal:n(407).default,Block:n(377).default})}}]);