PageSourceSearch

https://app.helpspace.com/build/assets/_single-addon.modal-C_eSgo9S.js

js helpspace.com collected 2026-10-09 23:15:50 UTC 4,309 bytes, 1 lines download raw bytes

1import{M as g}from"./modal-form-layout-CGrw4uhu.js";import{v as y,a3 as h,R as o,Y as m,z as a,C as b,M as r,y as d,U as i,B as A,E as w,$ as _,N as u}from"./translation-D__16jkl.js";import{S as L}from"./number-selector-DExVi-iX.js";const v={components:{ModalFormLayout:g,SpmNumberSelector:L,SpmLoader:h},data(){return{isLoading:!1,form:{},fields:{amount:this.$store.getters.subscription.conditions[this.$store.getters.formModal.params.type]},plans:null}},computed:{params(){return this.$store.getters.formModal.params},diffAmount(){return this.fields.amount-this.$store.getters.subscription.conditions[this.params.type]},currentAddonAmount(){return this.plans?this.$store.getters.subscription.conditions[this.params.type]-this.plans[this.$store.getters.subscription.plan_name.toLowerCase()].conditions[this.params.type]:0},minQuantity(){return this.plans&&this.plans?this.plans[this.$store.getters.subscription.plan_name.toLowerCase()].conditions[this.params.type]:0}},mounted(){this.getPlans()},methods:{getPlans(){axios.get("/billing/plans").then(e=>{this.plans=e.data.data,this.isLoading=!1}).catch(e=>{this.$notify.error(this.$trans.get("There was an error, please try later again."),4e3)})},updateAddOn(e){return this.isLoading=!0,axios.post("/billing/subscription/update/addon",{type:this.params.type,quantity:e-this.minQuantity}).then(n=>{this.success(),this.$notify.success(this.$trans.get("Your subscription has been updated."),4e3)}).catch(n=>{console.log(n),this.$notify.error(this.$trans.get("There was an error, please try later again."),4e3)})},success(){this.params.refresh(),this.$store.commit("hideFormModal")}}},M=["innerHTML"],k={key:0,class:"flex items-center flex-wrap px-2"},C=["disabled"],Q={key:0,class:"text-orange-600 w-full p-2 px-3 text-sm font-medium leading-5 rounded-lg bg-orange-150"},x={class:"w-full font-medium text-xs text-gray-800 text-center mt-4 px-2 leading-relaxed"};function N(e,n,V,T,s,t){const p=o("spm-number-selector"),c=o("spm-loader"),f=o("modal-form-layout");return a(),m(f,{title:e.$trans.get("Manage Add-On")},{default:b(()=>[r("div",null,[r("p",{class:"text-sm text-gray-900 px-2 mb-4 leading-relaxed",innerHTML:e.$trans.get("You currently have a total of :amount :type in your subscription. Your current plan (:plan) has :included :type inclusive and you have :currentAddonAmount additional :type booked.",{plan:e.$store.getters.subscription.plan_name,included:t.minQuantity,currentAddonAmount:t.currentAddonAmount,amount:e.$store.getters.subscription.conditions[t.params.type],type:e.$trans.get(t.params.type)})},null,8,M)]),t.minQuantity?(a(),d("div",k,[A(p,{modelValue:s.fields.amount,"onUpdate:modelValue":n[0]||(n[0]=l=>s.fields.amount=l),label:e.$trans.get(":type Total",{type:e.$trans.get(t.params.type)}),class:"w-full",min:1,"has-error":e.$store.state.account.customerInfo.usage.amount>s.fields.amount,"additional-text":t.diffAmount>0?"+"+t.diffAmount:t.diffAmount==0?"":t.diffAmount,"error-message":e.$trans.get("You currently have :amount :type set up!",{amount:e.$store.state.account.customerInfo.usage.amount,type:e.$trans.get(t.params.type)})},null,8,["modelValue","label","has-error","additional-text","error-message"]),r("button",{disabled:t.diffAmount==0||s.fields.amount<t.minQuantity||s.isLoading,type:"button",class:w([{"btn-green-500":t.diffAmount>0,"btn-gray-200 opacity-50":t.diffAmount==0||s.fields.amount<t.minQuantity,"btn-red-500":t.diffAmount<0,"btn-green-600":s.isLoading},"btn mb-2 w-full flex items-center"]),onClick:n[1]||(n[1]=l=>t.updateAddOn(s.fields.amount))},[s.isLoading?(a(),m(c,{key:0,size:"4",color:"white",class:"pr-1 -ml-2"})):i("",!0),_(" "+u(t.diffAmount>=0?e.$trans.get("Add :amount more :type to your subscription",{amount:t.diffAmount,type:e.$trans.get(t.params.type)}):e.$trans.get("Remove :amount :type from subscription",{amount:Math.abs(t.diffAmount),type:e.$trans.get(t.params.type)})),1)],10,C),s.fields.amount<t.minQuantity?(a(),d("p",Q,u(e.$trans.get("Your current plan (:plan) has :included :type inclusive.",{plan:e.$store.getters.subscription.plan_name,included:t.minQuantity,type:e.$trans.get(t.params.type)})),1)):i("",!0),r("p",x,u(e.$trans.get("New add-ons will be charged on a pro-rata basis.")),1)])):i("",!0)],void 0,!0),_:1},8,["title"])}const z=y(v,[["render",N]]);export{z as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.