(window.webpackJsonp=window.webpackJsonp||[]).push([[66],{"0ezt":function(t,e,a){var i=a("x7z+");"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(i,r);i.locals&&(t.exports=i.locals)},"1q1M":function(t,e,a){"use strict";a("mXqa")},"26E0":function(t,e,a){"use strict";a.r(e);var i=a("o0o1"),r=a.n(i),o=a("A5+z"),n=a("bDRN"),s=a("4TWA"),d=a("eZ9V"),l=a("Nv84"),p=a("KnjL"),c=a("j8qy"),u=a("ASoH"),f=a("CjXH"),b=a("TJPC"),m=a("aSdZ"),v=a("vDqi"),h=a.n(v);function x(t,e,a,i,r,o,n){try{var s=t[o](n),d=s.value}catch(t){return void a(t)}s.done?e(d):Promise.resolve(d).then(i,r)}var g={name:"subscriptionPlans",components:{AuthContentWrapper:n.a,ValidationProvider:o.ValidationProvider,ValidationObserver:o.ValidationObserver,SettingsIcon:f.jb,SelectInput:s.a,AuthContent:c.a,ButtonBase:l.a,AuthButton:u.a,FormLabel:d.a,required:b.a,InfoBox:p.a,XIcon:f.Bb,Headline:m.a},computed:{submitButtonText:function(){return this.isLoading?"Creating Subscription Stripe Plans":"Save and Go Next"}},data:function(){return{isLoading:!1,isError:!1,errorMessage:"",subscriptionPlans:[{id:1,type:"plan",attributes:{name:"",description:"",price:"",capacity:""}}]}},methods:{subscriptionPlansSubmit:function(){var t,e=this;return(t=r.a.mark((function t(){return r.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$refs.subscriptionPlans.validate();case 2:if(t.sent){t.next=5;break}return t.abrupt("return");case 5:e.isLoading=!0,e.isError=!1,h.a.post("/api/setup/stripe-plans",{plans:e.subscriptionPlans}).then((function(){e.$router.push({name:"EnvironmentSetup"})})).catch((function(t){(t.response.status=500)&&(e.isError=!0,e.errorMessage=t.response.data.message)})).finally((function(){e.isLoading=!1}));case 8:case"end":return t.stop()}}),t)})),function(){var e=this,a=arguments;return new Promise((function(i,r){var o=t.apply(e,a);function n(t){x(o,i,r,n,s,"next",t)}function s(t){x(o,i,r,n,s,"throw",t)}n(void 0)}))})()},addRow:function(){this.subscriptionPlans.push({id:Math.floor(1e7*Math.random()),type:"plans",attributes:{name:"",description:"",price:"",capacity:""}})},removeRow:function(t){this.subscriptionPlans=this.subscriptionPlans.filter((function(e){return e.id!==t.id}))}},created:function(){this.$scrollTop()}},k=(a("iLxR"),a("KHd+")),y=Object(k.a)(g,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("AuthContentWrapper",{ref:"auth"},[a("AuthContent",{attrs:{name:"database-credentials",visible:!0}},[a("Headline",{staticClass:"container mx-auto max-w-screen-sm",attrs:{title:"Setup Wizard",description:"Set up plans for your customers."}},[a("settings-icon",{staticClass:"title-icon text-theme mx-auto",attrs:{size:"40"}})],1),t._v(" "),a("ValidationObserver",{ref:"subscriptionPlans",staticClass:"form block-form",attrs:{tag:"form"},on:{submit:function(e){return e.preventDefault(),t.subscriptionPlansSubmit.apply(null,arguments)}},scopedSlots:t._u([{key:"default",fn:function(e){e.invalid;return[a("FormLabel",[t._v("Create your plans")]),t._v(" "),a("InfoBox",[a("p",[t._v("Your plans will be "),a("b",[t._v("sorted automatically")]),t._v(" in ascent order by plan price. All plans is automatically created as monthly plans.")])]),t._v(" "),a("div",{staticClass:"duplicator"},[t._l(t.subscriptionPlans,(function(e,i){return a("div",{key:i++,staticClass:"plan-item duplicator-item"},[1!==i?a("x-icon",{staticClass:"delete-item",attrs:{size:"22"},on:{click:function(a){return t.removeRow(e)}}}):t._e(),t._v(" "),a("b",{staticClass:"duplicator-title"},[t._v(t._s(i)+". Plan")]),t._v(" "),a("div",{staticClass:"block-wrapper"},[a("label",[t._v("Name:")]),t._v(" "),a("ValidationProvider",{staticClass:"input-wrapper",attrs:{tag:"div",mode:"passive",name:"Name",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(i){var r=i.errors;return[a("input",{directives:[{name:"model",rawName:"v-model",value:e.attributes.name,expression:"plan.attributes.name"}],class:{"border-red":r[0]},attrs:{placeholder:"Type your plan name",type:"text"},domProps:{value:e.attributes.name},on:{input:function(a){a.target.composing||t.$set(e.attributes,"name",a.target.value)}}}),t._v(" "),r[0]?a("span",{staticClass:"error-message"},[t._v(t._s(r[0]))]):t._e()]}}],null,!0)})],1),t._v(" "),a("div",{staticClass:"block-wrapper"},[a("label",[t._v("Description (optional):")]),t._v(" "),a("ValidationProvider",{staticClass:"input-wrapper",attrs:{tag:"div",mode:"passive",name:"Description"},scopedSlots:t._u([{key:"default",fn:function(i){var r=i.errors;return[a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.attributes.description,expression:"plan.attributes.description"}],class:{"border-red":r[0]},attrs:{placeholder:"Type your plan description"},domProps:{value:e.attributes.description},on:{input:function(a){a.target.composing||t.$set(e.attributes,"description",a.target.value)}}}),t._v(" "),r[0]?a("span",{staticClass:"error-message"},[t._v(t._s(r[0]))]):t._e()]}}],null,!0)})],1),t._v(" "),a("div",{staticClass:"block-wrapper"},[a("label",[t._v("Price:")]),t._v(" "),a("ValidationProvider",{staticClass:"input-wrapper",attrs:{tag:"div",mode:"passive",name:"Price",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(i){var r=i.errors;return[a("input",{directives:[{name:"model",rawName:"v-model",value:e.attributes.price,expression:"plan.attributes.price"}],class:{"border-red":r[0]},attrs:{placeholder:"Type your plan price",type:"number",step:"0.01",min:"1",max:"999999999999"},domProps:{value:e.attributes.price},on:{input:function(a){a.target.composing||t.$set(e.attributes,"price",a.target.value)}}}),t._v(" "),r[0]?a("span",{staticClass:"error-message"},[t._v(t._s(r[0]))]):t._e()]}}],null,!0)})],1),t._v(" "),a("div",{staticClass:"block-wrapper"},[a("label",[t._v("Storage Capacity:")]),t._v(" "),a("ValidationProvider",{staticClass:"input-wrapper",attrs:{tag:"div",mode:"passive",name:"Storage Capacity",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(i){var r=i.errors;return[a("input",{directives:[{name:"model",rawName:"v-model",value:e.attributes.capacity,expression:"plan.attributes.capacity"}],class:{"border-red":r[0]},attrs:{min:"1",max:"999999999",placeholder:"Type storage capacity in GB",type:"number"},domProps:{value:e.attributes.capacity},on:{input:function(a){a.target.composing||t.$set(e.attributes,"capacity",a.target.value)}}}),t._v(" "),r[0]?a("span",{staticClass:"error-message"},[t._v(t._s(r[0]))]):t._e()]}}],null,!0)})],1)],1)})),t._v(" "),a("ButtonBase",{staticClass:"duplicator-add-button",attrs:{"button-style":"theme-solid"},nativeOn:{click:function(e){return t.addRow.apply(null,arguments)}}},[t._v("Add New Plan\n ")])],2),t._v(" "),t.isError?a("InfoBox",{staticStyle:{"margin-top":"40px"},attrs:{type:"error"}},[a("p",[t._v(t._s(t.errorMessage))])]):t._e(),t._v(" "),a("div",{staticClass:"submit-wrapper"},[a("AuthButton",{attrs:{icon:"chevron-right",text:t.submitButtonText,loading:t.isLoading,disabled:t.isLoading}})],1)]}}])})],1)],1)}),[],!1,null,"df77b290",null);e.default=y.exports},"4TWA":function(t,e,a){"use strict";var i=a("CjXH"),r=a("LvDl"),o={name:"SelectInput",props:["placeholder","options","isError","default"],components:{Edit2Icon:i.y,UserIcon:i.wb,ChevronDownIcon:i.i},watch:{query:Object(r.debounce)((function(t){this.searchedResults=Object(r.omitBy)(this.options,(function(e){return!e.label.toLowerCase().includes(t.toLowerCase())}))}),200)},computed:{isSearching:function(){return this.searchedResults&&""!==this.query},optionList:function(){return this.isSearching?this.searchedResults:this.options}},data:function(){return{searchedResults:void 0,selected:void 0,isOpen:!1,query:""}},methods:{selectOption:function(t){this.$emit("input",t.value),this.$emit("change",t.value),this.selected=t,this.isOpen=!1},openMenu:function(){var t=this;this.isOpen=!this.isOpen,this.isOpen&&this.$nextTick((function(){return t.$refs.search.focus()}))}},created:function(){var t=this;this.default&&(this.selected=this.options.find((function(e){return e.value===t.default})))}},n=(a("VBJ4"),a("KHd+")),s=Object(n.a)(o,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"select"},[a("div",{staticClass:"input-area bg-light-background rounded-lg",class:{"is-active":t.isOpen,"is-error":t.isError},on:{click:t.openMenu}},[t.selected?a("div",{staticClass:"selected"},[t.selected.icon?a("div",{staticClass:"option-icon"},["user"===t.selected.icon?a("user-icon",{staticClass:"text-theme dark-text-theme",attrs:{size:"14"}}):t._e(),t._v(" "),"user-edit"===t.selected.icon?a("edit2-icon",{staticClass:"text-theme dark-text-theme",attrs:{size:"14"}}):t._e()],1):t._e(),t._v(" "),a("span",{staticClass:"option-value"},[t._v(t._s(t.selected.label))])]):t._e(),t._v(" "),t.selected?t._e():a("div",{staticClass:"not-selected"},[a("span",{staticClass:"option-value placehoder"},[t._v(t._s(t.placeholder))])]),t._v(" "),a("chevron-down-icon",{staticClass:"chevron",attrs:{size:"19"}})],1),t._v(" "),a("transition",{attrs:{name:"slide-in"}},[t.isOpen?a("div",{staticClass:"input-options rounded-lg"},[t.options.length>5?a("div",{staticClass:"select-search"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.query,expression:"query"}],ref:"search",staticClass:"search-input focus-border-theme rounded-lg",attrs:{type:"text",placeholder:t.$t("select_search_placeholder")},domProps:{value:t.query},on:{input:function(e){e.target.composing||(t.query=e.target.value)}}})]):t._e(),t._v(" "),a("ul",{staticClass:"option-list"},t._l(t.optionList,(function(e,i){return a("li",{key:i,staticClass:"option-item",on:{click:function(a){return t.selectOption(e)}}},[e.icon?a("div",{staticClass:"option-icon"},["user"===e.icon?a("user-icon",{attrs:{size:"14"}}):t._e(),t._v(" "),"user-edit"===e.icon?a("edit2-icon",{attrs:{size:"14"}}):t._e()],1):t._e(),t._v(" "),a("span",{staticClass:"option-value"},[t._v(t._s(e.label))])])})),0)]):t._e()])],1)}),[],!1,null,"779355e6",null);e.a=s.exports},"9aPE":function(t,e,a){var i=a("E+jl");"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(i,r);i.locals&&(t.exports=i.locals)},ASoH:function(t,e,a){"use strict";var i=a("CjXH"),r={name:"AuthContent",props:["loading","icon","text"],components:{ChevronRightIcon:i.k,RefreshCwIcon:i.gb},data:function(){return{isVisible:!1}},created:function(){this.isVisible=this.visible}},o=(a("1q1M"),a("KHd+")),n=Object(o.a)(r,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("button",{staticClass:"group flex items-center border-2 border-black rounded-lg inline-block mx-auto px-7 py-2.5 whitespace-nowrap"},[a("span",{staticClass:"font-extrabold text-lg pr-1"},[t._v("\n\t\t\t"+t._s(t.text)+"\n\t\t")]),t._v(" "),t.loading?a("refresh-cw-icon",{staticClass:"vue-feather text-theme -mr-1 sync-alt",attrs:{size:"20"}}):t._e(),t._v(" "),!t.loading&&t.icon?a("chevron-right-icon",{staticClass:"vue-feather text-theme -mr-1",attrs:{size:"20"}}):t._e()],1)}),[],!1,null,"0be2c737",null);e.a=n.exports},"E+jl":function(t,e,a){(t.exports=a("I1BE")(!1)).push([t.i,".logo{width:120px;margin-bottom:20px}h1{font-size:2.125em;font-weight:800;line-height:1.2;margin-bottom:2px}h1,h2{color:#1b2539}h2{font-size:1.4375em;font-weight:500;margin-bottom:50px}@media only screen and (max-width:690px){h1{font-size:1.875em}h2{font-size:1.3125em}}@media only screen and (max-width:490px){h1{font-size:1.375em}h2{font-size:1.125em}}",""])},KnjL:function(t,e,a){"use strict";var i={name:"InfoBox",props:["type"]},r=(a("LQoL"),a("KHd+")),o=Object(r.a)(i,(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"info-box",class:this.type},[this._t("default")],2)}),[],!1,null,"27ea1904",null);e.a=o.exports},LQoL:function(t,e,a){"use strict";a("0ezt")},SjQP:function(t,e,a){"use strict";a("9aPE")},TJPC:function(t,e,a){"use strict";a.d(e,"a",(function(){return o}));function i(t){return null==t}function r(t){return Array.isArray(t)&&0===t.length}var o={validate:function(t,e){var a=(void 0===e?{allowFalse:!0}:e).allowFalse,o={valid:!1,required:!0};return i(t)||r(t)?o:!1!==t||a?(o.valid=!!String(t).trim().length,o):o},params:[{name:"allowFalse",default:!0}],computesRequired:!0}},VBJ4:function(t,e,a){"use strict";a("xmEC")},aSdZ:function(t,e,a){"use strict";var i=a("L2JU");function r(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function o(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var n={name:"Headline",props:["description","title"],computed:function(t){for(var e=1;e