(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{"/nGJ":function(t,e,a){"use strict";a("T0k5")},"0ezt":function(t,e,a){var r=a("x7z+");"string"==typeof r&&(r=[[t.i,r,""]]);var n={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(r,n);r.locals&&(t.exports=r.locals)},"1xrH":function(t,e,a){var r=a("T25u");"string"==typeof r&&(r=[[t.i,r,""]]);var n={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(r,n);r.locals&&(t.exports=r.locals)},"4X4q":function(t,e,a){(t.exports=a("I1BE")(!1)).push([t.i,"",""])},"6TPS":function(t,e,a){"use strict";var r=a("CjXH"),n={props:["data"],computed:{normalizedColumns:function(){return this.data.id&&delete this.data.id,Object.values(this.data)}}},s=(a("/nGJ"),a("KHd+")),i=Object(s.a)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("tr",{staticClass:"table-row"},t._l(t.normalizedColumns,(function(e,r){return a("td",{key:r,staticClass:"table-cell"},[a("span",[t._v(t._s(e))])])})),0)}),[],!1,null,"d6678dd0",null).exports,o=a("vDqi"),l=a.n(o),c={name:"DatatableWrapper",props:["columns","scope","paginator","api","tableData"],components:{ChevronRightIcon:r.k,ChevronLeftIcon:r.j,DatatableCell:i,ChevronUpIcon:r.l},computed:{hasData:function(){return this.data&&this.data.data&&this.data.data.length>0},floatPages:function(){return[this.pageIndex-1,this.pageIndex,this.pageIndex+1]}},data:function(){return{data:void 0,isLoading:!0,pageIndex:1,filter:{sort:"DESC",field:void 0}}},methods:{goToPage:function(t){t>this.data.meta.last_page||0===t||(this.pageIndex=t,this.getPage(t))},sort:function(t,e){e&&(this.filter.field=t,"DESC"===this.filter.sort?this.filter.sort="ASC":"ASC"===this.filter.sort&&(this.filter.sort="DESC"),this.getPage(this.pageIndex))},getPage:function(t){var e=this;this.URI=this.api,this.paginator&&(this.URI=this.URI+"?page="+t),this.filter.field&&(this.URI=this.URI+(this.paginator?"&":"?")+"sort="+this.filter.field+"&direction="+this.filter.sort),this.isLoading=!0,l.a.get(this.URI).then((function(t){e.data=t.data,e.$emit("data",t.data)})).catch((function(){return e.$isSomethingWrong()})).finally((function(){e.$emit("init",!0),e.isLoading=!1}))}},created:function(){this.api&&this.getPage(this.pageIndex),this.tableData&&(this.data=this.tableData,this.isLoading=!1)}},d=(a("jWOf"),Object(s.a)(c,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"w-full"},[t.hasData?a("table",{staticClass:"w-full"},[a("thead",{},[a("tr",t._l(t.columns,(function(e,r){return e.hidden?t._e():a("th",{key:r,staticClass:"text-left",class:{"sortable cursor-pointer":e.sortable,"text-right":Object.values(t.columns).length-1===r},on:{click:function(a){return t.sort(e.field,e.sortable)}}},[a("span",{staticClass:"dark:text-gray-500 text-gray-400 text-xs"},[t._v("\n\t\t\t\t\t\t\t"+t._s(e.label)+"\n\t\t\t\t\t\t")]),t._v(" "),e.sortable?a("chevron-up-icon",{staticClass:"inline-block vue-feather dark:text-gray-500 text-gray-300",class:{"arrow-down":"ASC"===t.filter.sort},attrs:{size:"12"}}):t._e()],1)})),0)]),t._v(" "),a("tbody",{staticClass:"table-body"},[t._l(t.data.data,(function(e){return t._t("default",(function(){return[a("DatatableCell",{key:e.id,attrs:{data:e}})]}),{row:e})}))],2)]):t._e(),t._v(" "),t.isLoading||t.hasData?t._e():t._t("empty-page"),t._v(" "),t.paginator&&t.hasData?a("div",{staticClass:"paginator-wrapper"},[t.data.meta.total>15&&t.data.meta.last_page<=6?a("ul",{staticClass:"pagination flex align-items"},[a("li",{staticClass:"page-item previous"},[a("a",{staticClass:"page-link",class:{disabled:0==t.pageIndex},on:{click:function(e){return t.goToPage(t.pageIndex-1)}}},[a("chevron-left-icon",{staticClass:"icon",attrs:{size:"14"}})],1)]),t._v(" "),t._l(t.data.meta.last_page,(function(e,r){return a("li",{key:r,staticClass:"page-item",on:{click:function(a){return t.goToPage(e)}}},[a("a",{staticClass:"page-link",class:{active:t.pageIndex===e}},[t._v("\n "+t._s(e)+"\n ")])])})),t._v(" "),a("li",{staticClass:"page-item next"},[a("a",{staticClass:"page-link",class:{disabled:t.pageIndex+1==t.data.meta.last_page},on:{click:function(e){return t.goToPage(t.pageIndex+1)}}},[a("chevron-right-icon",{staticClass:"icon",attrs:{size:"14"}})],1)])],2):t._e(),t._v(" "),t.data.meta.total>15&&t.data.meta.last_page>6?a("ul",{staticClass:"pagination"},[a("li",{staticClass:"page-item previous"},[a("a",{staticClass:"page-link",class:{disabled:0==t.pageIndex},on:{click:function(e){return t.goToPage(t.pageIndex-1)}}},[a("chevron-left-icon",{staticClass:"icon",attrs:{size:"14"}})],1)]),t._v(" "),t.pageIndex>=5?a("li",{staticClass:"page-item",on:{click:function(e){return t.goToPage(1)}}},[a("a",{staticClass:"page-link"},[t._v("\n 1\n ")])]):t._e(),t._v(" "),t._l(5,(function(e,r){return t.pageIndex<5?a("li",{key:r,staticClass:"page-item",on:{click:function(a){return t.goToPage(e)}}},[a("a",{staticClass:"page-link",class:{active:t.pageIndex===e}},[t._v("\n "+t._s(e)+"\n ")])]):t._e()})),t._v(" "),t.pageIndex>=5?a("li",{staticClass:"page-item"},[a("a",{staticClass:"page-link"},[t._v("...")])]):t._e(),t._v(" "),t._l(t.floatPages,(function(e,r){return t.pageIndex>=5&&t.pageIndext.data.meta.last_page-4?a("li",{key:r,staticClass:"page-item",on:{click:function(e){t.goToPage(t.data.meta.last_page-(4-r))}}},[a("a",{staticClass:"page-link",class:{active:t.pageIndex===t.data.meta.last_page-(4-r)}},[t._v("\n "+t._s(t.data.meta.last_page-(4-r))+"\n ")])]):t._e()})),t._v(" "),t.pageIndex1?e.progress:0)+"%"}},[1===t.data.length?a("span",{staticClass:"chart-progress w-full h-2.5 block",class:[{"border-r-2 dark:border-gray-800 border-white rounded-tl-lg rounded-bl-lg":e.progress<100,"border-none rounded-lg":e.progress>=100},e.color]}):t._e(),t._v(" "),t.data.length>1&&e.progress>0?a("span",{staticClass:"chart-progress w-full h-2.5 block",class:[{"rounded-tl-lg rounded-bl-lg border-r-2 dark:border-gray-800 border-white":0===r,"border-r-2 dark:border-gray-800 border-white":rt.length)&&(e=t.length);for(var a=0,r=new Array(e);a element.");return r.appendChild(a),a}(t)),r.addEventListener("load",(function(){window.Stripe?e(window.Stripe):a(new Error("Stripe.js not available"))})),r.addEventListener("error",(function(){a(new Error("Failed to load Stripe.js"))}))}catch(t){return void a(t)}else e(null)}))},z=function(t,e,a){if(null===t)return null;var r=t.apply(void 0,e);return function(t,e){t&&t._registerWrapper&&t._registerWrapper({name:"stripe-js",version:"1.22.0",startTime:e})}(r,a),r},M=Promise.resolve().then((function(){return L(null)})),H=!1;M.catch((function(t){H||console.warn(t)}));var q=function(){for(var t=arguments.length,e=new Array(t),a=0;a0}}),data:function(){return{isLoading:!1,isCreditCardForm:!1,stripe:{isInitialization:!0,storingStripePaymentMethod:!1}}},methods:{storeStripePaymentMethod:function(){var t=this;return Y(S.a.mark((function e(){var a,r;return S.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.stripe.storingStripePaymentMethod=!0,e.next=3,R.confirmSetup({elements:J,redirect:"if_required",confirmParams:{return_url:window.location.href}});case 3:a=e.sent,(r=a.error)?document.querySelector("#error-message").textContent=r.message:l.a.$emit("toaster",{type:"success",message:t.$t("Your credit card was stored successfully")}),t.stripe.storingStripePaymentMethod=!1;case 7:case"end":return e.stop()}}),e)})))()},stripeInit:function(){var t=this;return Y(S.a.mark((function e(){return S.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q(t.config.stripe_public_key);case 2:return R=e.sent,e.next=5,o.a.get("/api/stripe/setup-intent").then((function(e){(J=R.elements({clientSecret:e.data.client_secret,appearance:{theme:"stripe",variables:{colorPrimary:t.config.app_color,fontFamily:"Nunito",borderRadius:"8px",colorText:t.isDarkMode?"#bec6cf":"#1B2539",colorBackground:t.isDarkMode?"#191b1e":"#fff",fontWeightNormal:"700",fontSizeSm:"0.875rem",colorSuccessText:"#0ABB87",colorSuccess:"#0ABB87",colorWarning:"#fd397a",colorWarningText:"#fd397a",colorDangerText:"#fd397a",colorTextSecondary:"#6b7280",spacingGridRow:"20px"}}})).create("payment").mount("#payment-element")})).catch((function(){l.a.$emit("toaster",{type:"danger",message:t.$t("popup_error.title")})}));case 5:t.stripe.isInitialization=!1;case 6:case"end":return e.stop()}}),e)})))()},showStoreCreditCardForm:function(){this.isCreditCardForm=!this.isCreditCardForm,this.stripeInit()}}},X=Object(d.a)(G,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.canShowForMeteredBilling||t.canShowForFixedBilling?a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"credit-card"}},[t._v("\n\t\t"+t._s(t.$t("Payment Method"))+"\n\t")]),t._v(" "),t.hasPaymentMethod?a("div",["metered"===t.config.subscriptionType&&t.user.data.relationships.balance.data.attributes.balance>0?a("b",{staticClass:"mb-3 block text-sm mb-5"},[t._v("\n\t\t\t"+t._s(t.$t("credit_to_auto_withdraw",{credit:t.user.data.relationships.balance.data.attributes.formatted}))+"\n\t\t")]):t._e(),t._v(" "),t._l(t.user.data.relationships.creditCards.data,(function(t){return a("PaymentCard",{key:t.data.id,attrs:{card:t}})})),t._v(" "),a("small",{staticClass:"text-xs text-gray-500 pt-3 leading-none sm:block hidden"},[t._v("\n\t\t\t"+t._s(t.$t("We are settling your payment automatically via your saved credit card."))+"\n\t\t")])],2):t._e(),t._v(" "),t.hasPaymentMethod?t._e():a("div",[t.isCreditCardForm?t._e():a("ButtonBase",{staticClass:"w-full mt-4",attrs:{loading:t.stripe.storingStripePaymentMethod,type:"submit","button-style":"theme"},nativeOn:{click:function(e){return t.showStoreCreditCardForm.apply(null,arguments)}}},[t._v("\n\t\t\t"+t._s(t.$t("Add Payment Method"))+"\n\t\t")]),t._v(" "),t.isCreditCardForm?a("form",{staticClass:"mt-6",attrs:{id:"payment-form"},on:{submit:function(e){return e.preventDefault(),t.storeStripePaymentMethod.apply(null,arguments)}}},[t.stripe.isInitialization?a("div",{staticClass:"h-10 relative mb-6"},[a("Spinner")],1):t._e(),t._v(" "),a("div",{attrs:{id:"payment-element"}}),t._v(" "),a("ButtonBase",{staticClass:"w-full mt-4",attrs:{loading:t.stripe.storingStripePaymentMethod,type:"submit","button-style":"theme"}},[t._v("\n\t\t\t\t"+t._s(t.$t("Store My Credit Card"))+"\n\t\t\t")]),t._v(" "),a("div",{attrs:{id:"error-message"}})],1):t._e()],1)],1):t._e()}),[],!1,null,null,null).exports,Z={name:"UserEmptySubscription",components:{ButtonBase:n.a,FormLabel:s.a,InfoBox:f.a},computed:{hasSubscription:function(){return this.$store.getters.user.data.relationships.subscription}}},Q=Object(d.a)(Z,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.hasSubscription?t._e():a("div",{staticClass:"card shadow-card"},[a("FormLabel",[t._v("\n\t\t"+t._s(t.$t("Subscription"))+"\n\t")]),t._v(" "),a("b",{staticClass:"text-3xl font-extrabold -mt-3 block mb-0.5"},[t._v("\n\t\t"+t._s(t.$t("Free Plan"))+"\n\t")]),t._v(" "),a("b",{staticClass:"mb-3 block text-sm text-gray-400 mb-8"},[t._v("\n\t\t"+t._s(t.$t("1GB Free storage space with 5 Team members"))+"\n\t")]),t._v(" "),a("ButtonBase",{staticClass:"w-full mt-4",attrs:{type:"submit","button-style":"theme"},nativeOn:{click:function(e){return t.$openUpgradeOptions.apply(null,arguments)}}},[t._v("\n\t\t"+t._s(t.$t("Upgrade Your Account"))+"\n\t")])],1)}),[],!1,null,null,null).exports,tt={name:"UserEditSubscription",components:{AppInputSwitch:r.a,ButtonBase:n.a,FormLabel:s.a},computed:{subscription:function(){return this.$store.getters.user.data.relationships.subscription.data},hasSubscription:function(){return this.$store.getters.user.data.relationships.subscription}},data:function(){return{isCancelling:!1}},methods:{cancelSubscriptionConfirmation:function(){l.a.$emit("confirm:open",{title:this.$t("Are you sure you want to cancel subscription?"),message:this.$t("You'll continue to have access to the features you've paid for until the end of your billing cycle."),action:{operation:"cancel-subscription"}})}},created:function(){var t=this;l.a.$on("action:confirmed",(function(e){"cancel-subscription"===e.operation&&(t.isCancelling=!0,o.a.post("/api/subscriptions/cancel").then((function(){t.$store.dispatch("getAppData").then((function(){t.fetchSubscriptionDetail()})),l.a.$emit("toaster",{type:"success",message:t.$t("popup_subscription_cancel.title")})})).catch((function(){l.a.$emit("toaster",{type:"danger",message:t.$t("popup_error.title")})})).finally((function(){t.isCancelling=!1})))}))},destroyed:function(){l.a.$off("action:confirmed")}},et=Object(d.a)(tt,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.hasSubscription?a("div",{staticClass:"card shadow-card"},[a("FormLabel",[t._v("\n\t\t"+t._s(t.$t("Edit your Subscription"))+"\n\t")]),t._v(" "),"cancelled"!==t.subscription.attributes.status?a("AppInputSwitch",{attrs:{title:t.$t("Cancel Subscription"),description:t.$t("You can cancel your subscription now. You'll continue to have access to the features you've paid for until the end of your billing cycle.")}},[a("ButtonBase",{staticClass:"sm:w-auto w-full",attrs:{loading:t.isCancelling,"button-style":"secondary"},nativeOn:{click:function(e){return t.cancelSubscriptionConfirmation.apply(null,arguments)}}},[t._v("\n\t\t\t"+t._s(t.$t("Cancel Now"))+"\n\t\t")])],1):t._e(),t._v(" "),a("AppInputSwitch",{attrs:{title:t.$t("Upgrade or Downgrade Plan"),description:t.$t("You can upgrade your plan at any time you want."),"is-last":!0}},[a("ButtonBase",{staticClass:"sm:w-auto w-full",attrs:{"button-style":"secondary"},nativeOn:{click:function(e){return t.$openUpgradeOptions.apply(null,arguments)}}},[t._v("\n\t\t\t"+t._s(t.$t("Change Plan"))+"\n\t\t")])],1)],1):t._e()}),[],!1,null,null,null).exports;function at(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function rt(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var nt={name:"UserFailedPayments",components:{FormLabel:s.a,InfoBox:f.a},computed:function(t){for(var e=1;e0?a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"frown"}},[t._v("\n\t\t"+t._s(t.$t("Failed Payments"))+"\n\t")]),t._v(" "),a("b",{staticClass:"text-3xl font-extrabold -mt-3 block mb-0.5"},[t._v("\n\t\t-"+t._s(t.user.data.meta.totalDebt)+"\n\t")]),t._v(" "),a("b",{staticClass:"mb-3 block text-sm text-gray-400 mb-5"},[t._v("\n\t\t"+t._s(t.$t("We are unable to charge your usage. Please register new credit card or fund your account with sufficient amount and we'll give it another try!"))+"\n\t")]),t._v(" "),t._l(t.user.data.relationships.failedPayments.data,(function(e){return a("div",{key:e.data.id,staticClass:"flex items-center justify-between py-2 border-b dark:border-opacity-5 border-light border-dashed"},[a("div",{staticClass:"w-2/4 leading-none"},[a("b",{staticClass:"text-sm font-bold leading-none"},[t._v("\n\t\t\t\t"+t._s(e.data.attributes.note)+"\n\t\t\t")])]),t._v(" "),a("div",{staticClass:"text-left w-1/4"},[a("span",{staticClass:"text-sm font-bold text-gray-560 capitalize"},[t._v("\n\t\t\t\t"+t._s(t.$t(e.data.attributes.source))+"\n\t\t\t")])]),t._v(" "),a("div",{staticClass:"text-right w-1/4"},[a("span",{staticClass:"text-sm font-bold"},[t._v("\n\t\t\t\t"+t._s(e.data.attributes.created_at)+"\n\t\t\t")])]),t._v(" "),a("div",{staticClass:"text-right w-1/4"},[a("span",{staticClass:"text-sm font-bold text-red"},[t._v("\n\t\t\t\t"+t._s(e.data.attributes.amount)+"\n\t\t\t")])])])}))],2):t._e()}),[],!1,null,null,null).exports;function it(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function ot(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var lt={name:"UserUsageEstimates",components:{FormLabel:s.a},computed:function(t){for(var e=1;e0}}),data:function(){return{chargeAmount:void 0}},methods:{makePayment:function(){var t,e=this;return(t=S.a.mark((function t(){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$refs.fundAccount.validate();case 2:if(t.sent){t.next=5;break}return t.abrupt("return");case 5:e.$store.dispatch("callSingleChargeProcess",e.chargeAmount);case 6:case"end":return t.stop()}}),t)})),function(){var e=this,a=arguments;return new Promise((function(r,n){var s=t.apply(e,a);function i(t){_t(s,r,n,i,o,"next",t)}function o(t){_t(s,r,n,i,o,"throw",t)}i(void 0)}))})()}}};function kt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function Ot(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var Pt={name:"Billing",components:{UserUpdatePaymentMethodsExternally:u,UserTransactionsForMeteredBilling:g,UserTransactionsForFixedBilling:h,UserFixedSubscriptionDetail:$,UserStoredPaymentMethods:X,UserEmptySubscription:Q,UserEditSubscription:et,UserFailedPayments:st,UserUsageEstimates:ct,UserBillingAlerts:vt,UserBalance:Object(d.a)(Ct,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.hasPaymentMethod?t._e():a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"dollar"}},[t._v("\n\t\t"+t._s(t.$t("Balance"))+"\n\t")]),t._v(" "),a("b",{staticClass:"text-3xl font-extrabold -mt-3 block mb-0.5"},[t._v("\n\t\t"+t._s(t.user.data.relationships.balance.data.attributes.formatted)+"\n\t")]),t._v(" "),a("ValidationObserver",{ref:"fundAccount",staticClass:"mt-6",attrs:{tag:"form"},on:{submit:function(e){return e.preventDefault(),t.makePayment.apply(null,arguments)}},scopedSlots:t._u([{key:"default",fn:function(e){e.invalid;return[a("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Capacity",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.errors;return[a("AppInputText",{attrs:{description:t.$t("The amount will be increased as soon as we register your charge from payment gateway."),error:r[0],"is-last":!0}},[a("div",{staticClass:"sm:flex sm:space-x-4 sm:space-y-0 space-y-4"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.chargeAmount,expression:"chargeAmount"}],staticClass:"focus-border-theme input-dark",class:{"border-red":r[0]},attrs:{placeholder:t.$t("Fund Your Account Balance..."),type:"number",min:"1",max:"999999999"},domProps:{value:t.chargeAmount},on:{input:function(e){e.target.composing||(t.chargeAmount=e.target.value)}}}),t._v(" "),a("ButtonBase",{staticClass:"sm:w-auto w-full",attrs:{type:"submit","button-style":"theme"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.$t("Make a Payment"))+"\n\t\t\t\t\t")])],1)])]}}],null,!0)})]}}],null,!1,2421684637)})],1)}),[],!1,null,null,null).exports,PageTab:ht.a},computed:function(t){for(var e=1;e