Files
vuefilemanager/public/chunks/settings-subscription.js
2021-12-06 06:50:31 +01:00

1 line
16 KiB
JavaScript
Vendored

(window.webpackJsonp=window.webpackJsonp||[]).push([[55],{"0go1":function(t,a,e){"use strict";e("8j5K")},"4X4q":function(t,a,e){(t.exports=e("I1BE")(!1)).push([t.i,"",""])},"8j5K":function(t,a,e){var n=e("qCtf");"string"==typeof n&&(n=[[t.i,n,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};e("aET+")(n,r);n.locals&&(t.exports=n.locals)},FPTY:function(t,a,e){(t.exports=e("I1BE")(!1)).push([t.i,".chart-progress.success[data-v-6007c2ad]{background:#0abb87;box-shadow:0 3px 10px rgba(10,187,135,.5)}.chart-progress.danger[data-v-6007c2ad]{background:#fd397a;box-shadow:0 3px 10px rgba(253,57,122,.5)}.chart-progress.warning[data-v-6007c2ad]{background:#ffb822;box-shadow:0 3px 10px rgba(255,184,34,.5)}.chart-progress.info[data-v-6007c2ad]{background:#5578eb;box-shadow:0 3px 10px rgba(85,120,235,.5)}.chart-progress.purple[data-v-6007c2ad]{background:#9d66fe;box-shadow:0 3px 10px rgba(157,102,254,.5)}.chart-progress.secondary[data-v-6007c2ad]{background:#e1e1ef;box-shadow:0 3px 10px rgba(225,225,239,.5)}.dark .chart-progress.secondary[data-v-6007c2ad]{background:#282a2f!important;box-shadow:0 3px 10px rgba(40,42,47,.5)!important}",""])},GN0Y:function(t,a,e){"use strict";e.r(a);var n=e("Nv84"),r=e("qefO"),o=e("KnjL"),i=e("jH4x"),s=e("eZ9V"),c=e("h6vl"),l=e("xCqy"),d=e("L2JU"),b=e("vDqi"),u=e.n(b);function p(t,a){return function(t){if(Array.isArray(t))return t}(t)||function(t,a){var e=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==e)return;var n,r,o=[],i=!0,s=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),!a||o.length!==a);i=!0);}catch(t){s=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(s)throw r}}return o}(t,a)||function(t,a){if(!t)return;if("string"==typeof t)return f(t,a);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return f(t,a)}(t,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,a){(null==a||a>t.length)&&(a=t.length);for(var e=0,n=new Array(a);e<a;e++)n[e]=t[e];return n}function v(t,a){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable}))),e.push.apply(e,n)}return e}function g(t){for(var a=1;a<arguments.length;a++){var e=null!=arguments[a]?arguments[a]:{};a%2?v(Object(e),!0).forEach((function(a){m(t,a,e[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):v(Object(e)).forEach((function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(e,a))}))}return t}function m(t,a,e){return a in t?Object.defineProperty(t,a,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[a]=e,t}var h={name:"UserSubscription",components:{AppInputSwitch:i.a,ProgressLine:c.a,ButtonBase:n.a,FormLabel:s.a,InfoBox:o.a,PageTab:r.a},computed:g(g({},Object(d.b)(["user"])),{},{status:function(){return{active:"Active until ".concat(this.subscription.attributes.renews_at),cancelled:"Active until ".concat(this.subscription.attributes.ends_at)}[this.subscription.attributes.status]},price:function(){return{month:"".concat(this.subscription.relationships.plan.data.attributes.price," Per Month"),year:"".concat(this.subscription.relationships.plan.data.attributes.price," Per Year")}[this.subscription.relationships.plan.data.attributes.interval]}}),data:function(){return{isGeneratedUpdateLink:!1,subscription:void 0,isCancelling:!1,limitations:[],isLoading:!0}},methods:{updatePaymentMethod:function(){var t=this;this.isGeneratedUpdateLink=!0,u.a.post("/api/subscriptions/edit/".concat(this.subscription.id)).then((function(t){window.location=t.data.url})).catch((function(){l.a.$emit("toaster",{type:"danger",message:t.$t("popup_error.title")}),t.isGeneratedUpdateLink=!1}))},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"}})},cancelSubscription:function(){var t=this;this.isCancelling=!0,u.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}))},fetchSubscriptionDetail:function(){var t=this;u.a.get("/api/subscriptions/detail").then((function(a){t.subscription=a.data.data,Object.entries(t.user.data.meta.limitations).map((function(a){var e=p(a,2),n=e[0],r=e[1],o={color:{max_storage_amount:"warning",max_team_members:"purple"},message:{max_storage_amount:"Total ".concat(r.use," of ").concat(r.total," Used"),max_team_members:"Total ".concat(r.use," of ").concat(r.total," Members")},title:{max_storage_amount:"Storage",max_team_members:"Team Members"}};t.limitations.push({message:o.message[n],distribution:[{progress:r.percentage,color:o.color[n],title:o.title[n]}]})})),t.isLoading=!1})).finally((function(){t.isLoading=!1}))}},created:function(){var t=this;this.fetchSubscriptionDetail(),l.a.$on("action:confirmed",(function(a){"cancel-subscription"===a.operation&&t.cancelSubscription()}))}},x=e("KHd+"),_=Object(x.a)(h,(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("PageTab",{attrs:{"is-loading":t.isLoading}},[t.subscription?e("div",{staticClass:"card shadow-card"},[e("FormLabel",[t._v("\n\t\t\t\t"+t._s(t.$t("Details"))+"\n\t\t\t")]),t._v(" "),e("div",{staticClass:"md:flex md:space-x-10 mb-8"},[e("div",{staticClass:"md:mb-0 mb-6"},[e("b",{staticClass:"block leading-5 text-lg"},[t._v("\n\t\t\t\t\t\t"+t._s(t.status)+"\n\t\t\t\t\t")]),t._v(" "),e("small",{staticClass:"text-gray-500"},[t._v("\n\t\t\t\t\t\t"+t._s(t.$t("We will send you a notification upon Subscription expiration"))+"\n\t\t\t\t\t")])]),t._v(" "),e("div",[e("b",{staticClass:"block leading-5 text-lg"},[t._v("\n\t\t\t\t\t\t"+t._s(t.price)+"\n\t\t\t\t\t")]),t._v(" "),e("small",{staticClass:"text-gray-500"},[t._v("\n\t\t\t\t\t\t"+t._s(t.subscription.relationships.plan.data.attributes.name)+"\n\t\t\t\t\t")])])]),t._v(" "),t._l(t.limitations,(function(a,n){return e("div",{key:n,class:{"mb-6":Object.keys(t.limitations).length-1!==n}},[e("b",{staticClass:"mb-3 block text-sm text-gray-400"},[t._v("\n\t\t\t\t\t"+t._s(a.message)+"\n\t\t\t\t")]),t._v(" "),e("ProgressLine",{attrs:{data:a.distribution}})],1)}))],2):t._e(),t._v(" "),t.subscription?e("div",{staticClass:"card shadow-card"},[e("FormLabel",[t._v("\n\t\t\t\t"+t._s(t.$t("Update Payments"))+"\n\t\t\t")]),t._v(" "),e("AppInputSwitch",{attrs:{title:t.$t("Update your Payment Method"),description:t.$t("You will be redirected to your payment provider to edit your payment method."),"is-last":!0}},[e("ButtonBase",{staticClass:"popup-button",attrs:{loading:t.isGeneratedUpdateLink,"button-style":"theme"},nativeOn:{click:function(a){return t.updatePaymentMethod(a)}}},[t._v("\n\t\t\t\t\t"+t._s(t.$t("Update Payments"))+"\n\t\t\t\t")])],1)],1):t._e(),t._v(" "),t.subscription?e("div",{staticClass:"card shadow-card"},[e("FormLabel",[t._v("\n\t\t\t\t"+t._s(t.$t("Edit your Subscription"))+"\n\t\t\t")]),t._v(" "),e("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.")}},[e("ButtonBase",{staticClass:"popup-button",attrs:{loading:t.isCancelling,"button-style":"secondary"},nativeOn:{click:function(a){return t.cancelSubscriptionConfirmation(a)}}},[t._v("\n\t\t\t\t\t"+t._s(t.$t("Cancel Now"))+"\n\t\t\t\t")])],1),t._v(" "),e("AppInputSwitch",{attrs:{title:t.$t("Upgrade Plan"),description:t.$t("You can upgrade your plan at any time you want."),"is-last":!0}},[e("ButtonBase",{staticClass:"popup-button",attrs:{"button-style":"secondary"},nativeOn:{click:function(a){return t.$openUpgradeOptions(a)}}},[t._v("\n\t\t\t\t\t"+t._s(t.$t("Upgrade Now"))+"\n\t\t\t\t")])],1)],1):t._e(),t._v(" "),t.subscription||t.isLoading?t._e():e("div",{staticClass:"card shadow-card"},[e("InfoBox",{staticStyle:{"margin-bottom":"0"}},[e("p",[t._v(t._s(t.$t("You don't have any subscription")))])])],1)])}),[],!1,null,null,null);a.default=_.exports},Hzq6:function(t,a,e){(t.exports=e("I1BE")(!1)).push([t.i,".form-label[data-v-1035a106]{display:flex;align-items:center;margin-bottom:30px}.form-label .icon[data-v-1035a106]{margin-right:10px}.form-label .icon circle[data-v-1035a106],.form-label .icon line[data-v-1035a106],.form-label .icon path[data-v-1035a106],.form-label .icon rect[data-v-1035a106]{color:inherit}.form-label .label[data-v-1035a106]{font-size:1.125em;font-weight:700}.dark .form-label .label[data-v-1035a106]{color:#bec6cf}",""])},KnjL:function(t,a,e){"use strict";var n={name:"InfoBox",props:["type"]},r=(e("0go1"),e("KHd+")),o=Object(r.a)(n,(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"info-box",class:this.type},[this._t("default")],2)}),[],!1,null,"b202b3ae",null);a.a=o.exports},Nvvg:function(t,a,e){"use strict";e("gJIj")},ST7V:function(t,a,e){var n=e("FPTY");"string"==typeof n&&(n=[[t.i,n,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};e("aET+")(n,r);n.locals&&(t.exports=n.locals)},WXiT:function(t,a,e){"use strict";e("ST7V")},cJdj:function(t,a,e){"use strict";e("kRqW")},eZ9V:function(t,a,e){"use strict";var n=e("CjXH"),r={name:"FormLabel",props:["icon"],components:{KeyIcon:n.K,Edit2Icon:n.u,SettingsIcon:n.cb,HardDriveIcon:n.F,SmartphoneIcon:n.eb}},o=(e("zthk"),e("KHd+")),i=Object(o.a)(r,(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticClass:"form-label"},[t.icon?t._e():e("edit-2-icon",{staticClass:"icon text-theme dark-text-theme",attrs:{size:"22"}}),t._v(" "),"settings"===t.icon?e("settings-icon",{staticClass:"icon text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"hard-drive"===t.icon?e("hard-drive-icon",{staticClass:"icon text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"smartphone"===t.icon?e("smartphone-icon",{staticClass:"icon text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),"key"===t.icon?e("key-icon",{staticClass:"icon text-theme dark-text-theme",attrs:{size:"22"}}):t._e(),t._v(" "),e("b",{staticClass:"label"},[t._t("default")],2)],1)}),[],!1,null,"1035a106",null);a.a=i.exports},gJIj:function(t,a,e){var n=e("lkHs");"string"==typeof n&&(n=[[t.i,n,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};e("aET+")(n,r);n.locals&&(t.exports=n.locals)},h6vl:function(t,a,e){"use strict";var n={name:"DotLabel",props:["color","title"]},r=(e("Nvvg"),e("KHd+")),o={name:"ProgressLine",props:["data"],components:{DotLabel:Object(r.a)(n,(function(){var t=this.$createElement,a=this._self._c||t;return a("div",{staticClass:"label"},[a("span",{class:["label-dot",this.color]}),this._v(" "),a("b",{staticClass:"label-title"},[this._v("\n "+this._s(this.title)+"\n ")])])}),[],!1,null,"65eb31b6",null).exports}},i=(e("WXiT"),Object(r.a)(o,(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",[e("div",{staticClass:"flex items-center mb-4 rounded dark:bg-2x-dark-foreground bg-light-300"},t._l(t.data,(function(a,n){return e("div",{key:n,staticClass:"chart-wrapper",style:{width:a.progress+"%"}},[1===t.data.length?e("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":a.progress<100,"border-none rounded-lg":a.progress>=100},a.color]}):t._e(),t._v(" "),t.data.length>1?e("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===n,"border-r-2 dark:border-gray-800 border-white":n<t.data.length-1,"rounded-tr-lg rounded-br-lg":n===t.data.length-1},a.color]}):t._e()])})),0),t._v(" "),e("footer",{staticClass:"flex items-center"},t._l(t.data,(function(t,a){return e("DotLabel",{key:a,staticClass:"mr-5",attrs:{color:t.color,title:t.title}})})),1)])}),[],!1,null,"6007c2ad",null));a.a=i.exports},jH4x:function(t,a,e){"use strict";var n={name:"AppInputSwitch",props:["description","isLast","title","error"]},r=e("KHd+"),o=Object(r.a)(n,(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticClass:"flex justify-between space-x-8 w-full",class:{"mb-7":!t.isLast}},[e("div",{staticClass:"leading-5"},[e("label",{staticClass:"text-sm font-bold dark:text-gray-400 text-gray-700 mb-1.5 block"},[t._v("\n\t\t\t"+t._s(t.title)+":\n\t\t")]),t._v(" "),t.description?e("span",{staticClass:"text-xs text-gray-500 leading-4 block",domProps:{innerHTML:t._s(t.description)}}):t._e(),t._v(" "),t.error?e("span",{staticClass:"error-message"},[t._v("\n\t\t\t"+t._s(t.error)+"\n\t\t")]):t._e()]),t._v(" "),e("div",[t._t("default")],2)])}),[],!1,null,null,null);a.a=o.exports},kRqW:function(t,a,e){var n=e("4X4q");"string"==typeof n&&(n=[[t.i,n,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};e("aET+")(n,r);n.locals&&(t.exports=n.locals)},lkHs:function(t,a,e){(t.exports=e("I1BE")(!1)).push([t.i,".label[data-v-65eb31b6]{display:flex;align-items:center}.label .label-dot[data-v-65eb31b6]{margin-right:10px;width:8px;height:8px;display:block;border-radius:8px;flex:none}.label .label-dot.success[data-v-65eb31b6]{background:#0abb87}.label .label-dot.danger[data-v-65eb31b6]{background:#fd397a}.label .label-dot.warning[data-v-65eb31b6]{background:#ffb822}.label .label-dot.info[data-v-65eb31b6]{background:#5578eb}.label .label-dot.primary[data-v-65eb31b6]{background:red}.label .label-dot.purple[data-v-65eb31b6]{background:#9d66fe}.label .label-dot.secondary[data-v-65eb31b6]{background:#e1e1ef}.label .label-title[data-v-65eb31b6]{font-size:16px;font-weight:700}",""])},qCtf:function(t,a,e){(t.exports=e("I1BE")(!1)).push([t.i,".info-box[data-v-b202b3ae]{padding:20px;border-radius:8px;margin-bottom:32px;background:#f4f5f6;text-align:left}.info-box.error[data-v-b202b3ae]{background:rgba(253,57,122,.1)}.info-box.error a[data-v-b202b3ae],.info-box.error p[data-v-b202b3ae]{color:#fd397a}.info-box.error a[data-v-b202b3ae]{text-decoration:underline}.info-box p[data-v-b202b3ae]{line-height:1.6;word-break:break-word;font-weight:600}.info-box p[data-v-b202b3ae],.info-box p[data-v-b202b3ae] a{font-size:15px}.info-box p[data-v-b202b3ae] b{font-size:15px;font-weight:700}.info-box a[data-v-b202b3ae],.info-box b[data-v-b202b3ae]{font-weight:700}.info-box a[data-v-b202b3ae]{font-size:.9375em;line-height:1.6}.info-box ul[data-v-b202b3ae]{margin-top:15px}.info-box ul[data-v-b202b3ae],.info-box ul li[data-v-b202b3ae],.info-box ul li a[data-v-b202b3ae]{display:block}@media only screen and (max-width:690px){.info-box[data-v-b202b3ae]{padding:15px}}.dark .info-box[data-v-b202b3ae]{background:#1e2024}.dark .info-box p[data-v-b202b3ae],.dark .info-box ul li[data-v-b202b3ae]{color:#bec6cf}",""])},qefO:function(t,a,e){"use strict";var n={name:"PageTab",props:["isLoading"],components:{Spinner:e("zTYo").a}},r=(e("cJdj"),e("KHd+")),o=Object(r.a)(n,(function(){var t=this.$createElement,a=this._self._c||t;return a("div",{staticClass:"page-tab"},[a("div",{directives:[{name:"show",rawName:"v-show",value:this.isLoading,expression:"isLoading"}],attrs:{id:"loader"}},[a("Spinner")],1),this._v(" "),this._t("default")],2)}),[],!1,null,"3dead278",null);a.a=o.exports},wR0I:function(t,a,e){var n=e("Hzq6");"string"==typeof n&&(n=[[t.i,n,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};e("aET+")(n,r);n.locals&&(t.exports=n.locals)},zthk:function(t,a,e){"use strict";e("wR0I")}}]);