PageSourceSearch

https://app.shipblink.com/assets/AccountConfig-DD1XXa_x.js

js shipblink.com collected 2026-10-02 05:55:14 UTC 52,551 bytes, 1 lines download raw bytes

1import{_ as $}from"./BaseConfigSection-C_FdHJNj.js";import{h as O}from"./moment-ZyBYzzoV.js";import{n as _,O as F,R as M,L as A,h as o,V as p,B as H,j as d,Q as G,l as h,m as u,c as f,k as W,o as D,d as S,f as c,b as n,u as Q,w,D as Y,_ as g,x as v,G as C,H as k,F as P,i as b,am as R,t as V,y as U,af as T,a as L,M as Z,v as J}from"./index-EpPWkJWS.js";import{_ as X,a as tt,b as et,c as st}from"./VExpansionPanelHeader-DfvRa4TJ.js";import"./VItemGroup-DkurNpvX.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"0912fc0634c3a842d7679a780738dd60904b7245"};var t=new s.Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="d863ad94-1c1b-4f0c-bf61-058944b64134",s._sentryDebugIdIdentifier="sentry-dbid-d863ad94-1c1b-4f0c-bf61-058944b64134")}catch{}})();const it={name:"account-contact-info",data(){return{browserWindow:{},address:{street1:"",street2:"",city:"",state:"",country:"",zip:"",email:"",phone:""},rules:{required:s=>!!s||"Required.",email:s=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@(([^<>()[\]\\.,;:\s@"]+\.)+[^<>()[\]\\.,;:\s@"]{2,})$/i.test(s)||"Invalid email."},countries:Q.COUNTRIES,formIsValid:!1,errorText:"",pageLoading:!0,snackbar:!1,loading:!1}},methods:{moment:O,initialize(){this.pageLoading=!0,axios.get("/account/details/").then(s=>{this.address=s.data.address}).finally(()=>{this.pageLoading=!1})},updateAccountAddress(){this.loading=!0,this.axios.patch("/account/address/",{address:this.address}).then(s=>{console.log(s),this.loading=!1,this.snackbar=!0,this.errorText="Updated Successfully",this.initialize(),this.$store.dispatch("loadMasterData",{isDetailedRequest:!1})}).catch(s=>{console.log(s),this.loading=!1,this.snackbar=!0,this.errorText="Something went wrong"})}},mounted(){this.browserWindow=window},created(){this.initialize()}};var at=function(){var t=this,e=t._self._c;return e(F,{staticClass:"mx-auto"},[e(M,{attrs:{value:t.pageLoading,absolute:"",color:"transparent"}},[e(A,{attrs:{indeterminate:"",size:"64",color:"primary"}})],1),t.pageLoading?t._e():e("div",[e(o,{attrs:{elevation:"1"}},[e(p,{staticClass:"font-weight-bold"},[t._v("Account Contact Info")]),e(H),e(d,[e(G,{ref:"Form",model:{value:t.formIsValid,callback:function(i){t.formIsValid=i},expression:"formIsValid"}},[e(h,[e(u,{staticClass:"ma-0 px-2 py-0"},[e(f,{attrs:{dense:"",label:"Email",outlined:"",rules:[t.rules.required,t.rules.email],required:""},model:{value:t.address.email,callback:function(i){t.$set(t.address,"email",i)},expression:"address.email"}})],1),e(u,{staticClass:"ma-0 px-2 py-0"},[e(f,{attrs:{rules:[t.rules.required],dense:"",type:"number",label:"Phone Number",outlined:""},model:{value:t.address.phone,callback:function(i){t.$set(t.address,"phone",i)},expression:"address.phone"}})],1)],1),e(p,{staticClass:"font-weight-bold py-0"},[t._v("Address")]),e(f,{staticClass:"px-5",attrs:{rules:[t.rules.required],dense:"",outlined:"",label:"Street Address",required:""},model:{value:t.address.street1,callback:function(i){t.$set(t.address,"street1",i)},expression:"address.street1"}}),e(h,{staticClass:"px-4"},[e(u,{staticClass:"ma-0 pa-2",attrs:{cols:"8"}},[e(f,{staticClass:"px-0",attrs:{dense:"",outlined:"",label:"Unit",hint:"Street Address 2"},model:{value:t.address.street2,callback:function(i){t.$set(t.address,"street2",i)},expression:"address.street2"}})],1),e(u,{staticClass:"ma-0 pa-2",attrs:{cols:"4"}},[e(f,{attrs:{dense:"",outlined:"",label:"City",required:""},model:{value:t.address.city,callback:function(i){t.$set(t.address,"city",i)},expression:"address.city"}})],1)],1),e(h,{staticClass:"px-4"},[e(u,{staticClass:"ma-0 pa-2",attrs:{cols:"4"}},[e(f,{attrs:{dense:"",outlined:"",label:"Zip",rules:[t.rules.required],required:""},model:{value:t.address.zip,callback:function(i){t.$set(t.address,"zip",i)},expression:"address.zip"}})],1),e(u,{staticClass:"ma-0 pa-2",attrs:{cols:"4"}},[e(f,{attrs:{dense:"",outlined:"",label:"State (e.g. CA)"},model:{value:t.address.state,callback:function(i){t.$set(t.address,"state",i)},expression:"address.state"}})],1),e(u,{staticClass:"ma-0 pa-2",attrs:{cols:"4"}},[e(W,{attrs:{dense:"",outlined:"",items:Object.keys(t.countries).map(i=>({value:i,text:t.countries[i]})),label:"Country",rules:[t.rules.required],required:""},model:{value:t.address.country,callback:function(i){t.$set(t.address,"country",i)},expression:"address.country"}})],1)],1)],1)],1),e(D,[e(S),e(c,{staticClass:"px-4",attrs:{color:"primary",disabled:!t.formIsValid,loading:t.loading},on:{click:function(i){return t.updateAccountAddress()}}},[e(n,[t._v("mdi-content-save-outline")]),t._v(" Save ")],1)],1)],1)],1)],1)},nt=[],lt=_(it,at,nt,!1,null,null);const j=lt.exports,rt={name:"PlanFeaturesList",props:{features:{type:Object,default:()=>({})},title:{type:String,default:"Plan Features"},showTitle:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!1},subscriptionAmount:{type:[Number,String],default:0}},data(){return{showCancelDialog:!1,cancelling:!1,cancelImpactItems:["Higher monthly label quotas","Advanced shipping features","Checkout rating capabilities","Priority support"]}},computed:{categorizedFeatures(){if(!this.features)return{fulfillment:{},checkout:{}};const s={fulfillment:{},checkout:{}};
1return Object.entries(this.features).forEach(([t,e])=>{typeof e!="object"||!(e.visible!==!1&&(e.type!=="boolean"||e.value===!0||e.value==="true"))||(this.isFulfillmentFeature(t,e)?s.fulfillment[t]=e:(this.isCheckoutFeature(t,e)||(s.fulfillment[t]=e),s.checkout[t]=e))}),s},hasFulfillmentFeatures(){return Object.keys(this.categorizedFeatures.fulfillment).length>0},hasCheckoutFeatures(){return Object.keys(this.categorizedFeatures.checkout).length>0},isFreePlan(){return Number(this.subscriptionAmount)===0}},methods:{async confirmCancellation(){this.cancelling=!0;try{this.$emit("cancel-subscription"),setTimeout(()=>{this.showCancelDialog=!1,this.cancelling=!1},500)}catch(s){console.error("Error cancelling subscription:",s),this.cancelling=!1}},isCheckoutFeature(s,t){const e=t.name?t.name.toLowerCase():"",i=t.description?t.description.toLowerCase():"";return!!(s.includes("SB_CR")||s.includes("CHECKOUT_")||s.includes("RATE_")||s.includes("QUOTES")||e.includes("checkout")||e.includes("rating")||i.includes("checkout")||i.includes("rating"))},isFulfillmentFeature(s,t){const e=t.name?t.name.toLowerCase():"",i=t.description?t.description.toLowerCase():"";return!!(s.includes("SB_FL")||s.includes("LABEL_")||s.includes("SHIP_")||e.includes("label")||e.includes("shipping")||i.includes("label")||i.includes("shipping"))}}};var ot=function(){var t=this,e=t._self._c;return e("div",{staticClass:"plan-features"},[t.showTitle?e("div",{staticClass:"subtitle-2 font-weight-medium mb-3"},[t._v(t._s(t.title))]):t._e(),t.hasFulfillmentFeatures?e("div",{staticClass:"mb-4 feature-category fulfillment-features"},[e("div",{staticClass:"subtitle-1 ml-1 mb-3 primary--text d-flex align-center"},[e(n,{staticClass:"mr-1",attrs:{color:"primary"}},[t._v("mdi-label")]),t._v(" Fulfillment Features ")],1),e(h,[t._l(t.categorizedFeatures.fulfillment,function(i,a){return[i.visible?e(u,{key:a,staticClass:"pa-2",attrs:{cols:"12",sm:"6",md:"4"}},[e(o,{staticClass:"pa-3",attrs:{outlined:""}},[e("div",{staticClass:"d-flex justify-space-between align-center"},[e("div",{staticClass:"d-flex align-center"},[e("div",{staticClass:"caption font-weight-medium"},[t._v(t._s(i.name))]),i.description?e(w,{attrs:{bottom:"","max-width":"300"},scopedSlots:t._u([{key:"activator",fn:function({on:l,attrs:r}){return[e(n,t._g(t._b({staticClass:"ml-1",attrs:{color:"grey lighten-1","x-small":""}},"v-icon",r,!1),l),[t._v(" mdi-information-outline ")])]}}],null,!0)},[e("span",[t._v(t._s(i.description))])]):t._e()],1),i.type==="limit"?e("div",{staticClass:"caption primary--text"},[t._v(" "+t._s(i.value===-1?"Unlimited":i.value)+" ")]):i.type==="boolean"&&i.value?e(n,{attrs:{color:"success",small:""}},[t._v(" mdi-check ")]):e(n,{attrs:{color:"error",small:""}},[t._v(" mdi-close ")])],1)])],1):t._e()]})],2)],1):t._e(),t.hasCheckoutFeatures?e("div",{staticClass:"mb-4 feature-category checkout-features"},[e("div",{staticClass:"subtitle-1 ml-1 mb-3 primary--text d-flex align-center"},[e(n,{staticClass:"mr-1",attrs:{color:"primary"}},[t._v("mdi-calculator")]),t._v(" Checkout Rating Features ")],1),e(h,[t._l(t.categorizedFeatures.checkout,function(i,a){return[i.visible?e(u,{key:a,staticClass:"pa-2",attrs:{cols:"12",sm:"6",md:"4"}},[e(o,{staticClass:"pa-3",attrs:{outlined:""}},[e("div",{staticClass:"d-flex justify-space-between align-center"},[e("div",{staticClass:"d-flex align-center"},[e("div",{staticClass:"caption font-weight-medium"},[t._v(t._s(i.name))]),i.description?e(w,{attrs:{bottom:"","max-width":"300"},scopedSlots:t._u([{key:"activator",fn:function({on:l,attrs:r}){return[e(n,t._g(t._b({staticClass:"ml-1",attrs:{color:"grey lighten-1","x-small":""}},"v-icon",r,!1),l),[t._v(" mdi-information-outline ")])]}}],null,!0)},[e("span",[t._v(t._s(i.description))])]):t._e()],1),i.type==="limit"?e("div",{staticClass:"caption primary--text"},[t._v(" "+t._s(i.value===-1?"Unlimited":i.value)+" ")]):i.type==="boolean"&&i.value?e(n,{attrs:{color:"success",small:""}},[t._v(" mdi-check ")]):e(n,{attrs:{color:"error",small:""}},[t._v(" mdi-close ")])],1)])],1):t._e()]})],2)],1):t._e(),t.showCancelButton?e("div",{staticClass:"mt-6 d-flex justify-end"},[t.isFreePlan?e(w,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:i,attrs:a}){return[e("div",t._g(t._b({},"div",a,!1),i),[e(c,{staticClass:"px-4",attrs:{color:"error",outlined:"",disabled:""}},[e(n,{attrs:{left:""}},[t._v("mdi-close-circle")]),t._v(" Cancel Subscription ")],1)],1)]}}],null,!1,1202273618)},[e("span",[t._v("Free plans are not eligible for cancellation")])]):t._e(),t.isFreePlan?t._e(
1):e(c,{staticClass:"px-4",attrs:{color:"error",outlined:""},on:{click:function(i){t.showCancelDialog=!0}}},[e(n,{attrs:{left:""}},[t._v("mdi-close-circle")]),t._v(" Cancel Subscription ")],1)],1):t._e(),e(Y,{attrs:{"max-width":"500",persistent:""},model:{value:t.showCancelDialog,callback:function(i){t.showCancelDialog=i},expression:"showCancelDialog"}},[e(o,[e(p,{staticClass:"headline error--text"},[e(n,{staticClass:"mr-2",attrs:{left:"",color:"error"}},[t._v("mdi-alert-circle")]),t._v(" Are you sure you want to cancel? ")],1),e(d,{staticClass:"pt-4"},[e("p",{staticClass:"mb-3"},[t._v("Cancelling your subscription means you'll lose access to premium features:")]),t._l(t.cancelImpactItems,function(i,a){return e(g,{key:a,staticClass:"px-0",attrs:{dense:""}},[e(v,{staticClass:"mr-2"},[e(n,{attrs:{color:"error",small:""}},[t._v("mdi-minus-circle")])],1),e(C,[e(k,[t._v(t._s(i))])],1)],1)}),e(P,{staticClass:"mt-4 mb-0",attrs:{color:"info",border:"left","colored-border":"",dense:""}},[e("strong",[t._v("Considering alternatives?")]),t._v(" You'll be downgraded to our Free tier but can upgrade again anytime. ")])],2),e(b),e(D,[e(S),e(c,{staticClass:"mr-2",attrs:{text:"",color:"primary"},on:{click:function(i){t.showCancelDialog=!1}}},[t._v(" Keep My Subscription ")]),e(c,{attrs:{color:"error",outlined:"",loading:t.cancelling},on:{click:t.confirmCancellation}},[t._v(" Proceed with Cancellation ")])],1)],1)],1)],1)},ct=[],ut=_(rt,ot,ct,!1,null,"61aef1ef");const q=ut.exports,dt={name:"UsageMetricsDisplay",props:{labelRemainingPercentage:{type:Number,default:100},labelRemaining:{type:[Number,String],default:0},labelLimit:{type:[Number,String],default:"Unlimited"},showLabelGeneration:{type:Boolean,default:!0},checkoutRemainingPercentage:{type:Number,default:100},checkoutRemaining:{type:[Number,String],default:0},checkoutLimit:{type:[Number,String],default:"Unlimited"},showCheckoutRating:{type:Boolean,default:!0}},computed:{formattedLabelRemainingPercentage(){return this.formatPercentage(this.labelRemainingPercentage)},formattedCheckoutRemainingPercentage(){return this.formatPercentage(this.checkoutRemainingPercentage)}},methods:{getColorByPercentage(s){return s<=25?"error":s<=50?"warning":"success"},formatPercentage(s){return s.toFixed(1)}}};var mt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"usage-metrics"},[t.showLabelGeneration?e("div",{staticClass:"mb-4"},[e("div",{staticClass:"caption grey--text"},[t._v("Label Generation")]),e(R,{attrs:{value:t.labelRemainingPercentage,height:"12",rounded:"",color:t.getColorByPercentage(t.labelRemainingPercentage)}}),e("div",{staticClass:"d-flex justify-space-between mt-1"},[e("span",{staticClass:"caption"},[t._v(" "+t._s(t.labelRemaining)+" of "+t._s(t.labelLimit)+" remaining "),e("span",{staticClass:"font-weight-medium"},[t._v("("+t._s(t.formattedLabelRemainingPercentage)+"% available)")])]),t.labelRemainingPercentage<=25?e("span",{staticClass:"caption error--text font-weight-bold"},[t._v(" Low remaining capacity! ")]):t.labelRemainingPercentage<=50?e("span",{staticClass:"caption warning--text font-weight-bold"},[t._v(" Medium remaining capacity ")]):t._e()])],1):t._e(),t.showCheckoutRating?e("div",{staticClass:"mb-4"},[e("div",{staticClass:"caption grey--text"},[t._v("Checkout Rating")]),e(R,{attrs:{value:t.checkoutRemainingPercentage,height:"12",rounded:"",color:t.getColorByPercentage(t.checkoutRemainingPercentage)}}),e("div",{staticClass:"d-flex justify-space-between mt-1"},[e("span",{staticClass:"caption"},[t._v(" "+t._s(t.checkoutRemaining)+" of "+t._s(t.checkoutLimit)+" remaining "),e("span",{staticClass:"font-weight-medium"},[t._v("("+t._s(t.formattedCheckoutRemainingPercentage)+"% available)")])]),t.checkoutRemainingPercentage<=25?e("span",{staticClass:"caption error--text font-weight-bold"},[t._v(" Low remaining capacity! ")]):t.checkoutRemainingPercentage<=50?e("span",{staticClass:"caption warning--text font-weight-bold"},[t._v(" Medium remaining capacity ")]):t._e()])],1):t._e()])},ht=[],_t=_(dt,mt,ht,!1,null,"c39310d6");const I=_t.exports,pt={name:"TrialBanner",props:{isActive:{type:Boolean,default:!1},expiryDate:{type:String,default:"N/A"},daysRemaining:{type:Number,default:0},color:{type:String,default:"primary"}}};var ft=function(){var t=this,e=t._self._c;return t.isActive?e(P,{staticClass:"mx-4 mt-1 mb-2 white--text",attrs:{dense:"",color:t.color,border:"left"}},[e("div",{staticClass:"d-flex align-center"},[e(n,{attrs:{left:"",color:"white"}},[t._v("mdi-clock-outline")]),e("div",[e("span",{staticClass:"font-weight-bold"},[t._v("Trial Period Active")]),t._v(" - Ends on "+t._s(t.expiryDate)+" "),e("div",{staticClass:"caption"},[t._v(t._s(t.daysRemaining)+" days remaining in your trial")])])],1)]):t._e()},gt=[],vt=_(pt,ft,gt,!1,null,null);const N=vt.exports,Ct={name:"CurrentPlanCard",components:{TrialBanner:N},props:{plan:{type:Object,default:null},nextBillingDate:{type:String,default:"N/A"},isTrialActive:{type:Boolean,default:!1},trialEndDate:{type:String,default:"N/A"},daysRemaining:{type:Number,default:0},loading:{type:Boolean,default:!1},color:{type:String,default:"primary"}}};var bt=function(){var t=this,e=t._self._c;return e(o,{staticClass:"mb-6",attrs:{outlined:""}},[e(p,{staticClass:"subtitle-1"},[e(n,{attrs:{left:"",color:"primary"}}
1,[t._v("mdi-package-variant-closed")]),t._v(" Current Subscription ")],1),e(N,{attrs:{"is-active":t.isTrialActive,"expiry-date":t.trialEndDate,"days-remaining":t.daysRemaining,color:t.color}}),e(d,[t.plan?e("div",{staticClass:"d-flex flex-wrap"},[e("div",{staticClass:"mr-6 mb-3"},[e("div",{staticClass:"caption grey--text"},[t._v("Current Plan")]),e("div",{staticClass:"subtitle-1 font-weight-medium"},[t._v(" "+t._s(t.plan.name)+" ")]),e("div",{staticClass:"caption"},[t._v(t._s(t.plan.description))])]),e("div",{staticClass:"mb-3"},[e("div",{staticClass:"caption grey--text"},[t._v("Monthly Price")]),e("div",{staticClass:"subtitle-1 font-weight-medium"},[t._v(" $"+t._s(t.plan.total)+" ")]),e("div",{staticClass:"caption"},[t._v("Next billing date: "+t._s(t.nextBillingDate))])])]):e("div",{staticClass:"text-center py-3"},[t.loading?e(A,{attrs:{indeterminate:"",color:"primary"}}):e("div",[t._v("No active subscription found")])],1),t._t("usage"),t._t("features")],2)],1)},Pt=[],yt=_(Ct,bt,Pt,!1,null,null);const z=yt.exports,x={async createHostedSession(s={}){try{return(await axios.post("billing/mantle/hosted-session/",s)).data}catch(t){throw console.error("Error creating Mantle hosted session:",t),t}},async getCustomerDetails(s={}){try{const t=await axios.get("billing/mantle/plans/",{params:s});return t.data&&t.data.customer?{plans:t.data.customer.plans||[],currentSubscription:t.data.customer.subscription||null,customer:t.data.customer}:{plans:t.data.plans||[],currentSubscription:t.data.currentSubscription||null}}catch(t){throw console.error("Error fetching Mantle plans:",t),t}},async createSubscription(s){try{if(!s.planId)throw new Error("Missing required field: planId");return(await axios.post("billing/mantle/subscriptions/",s)).data}catch(t){throw console.error("Error creating subscription:",t),t}}};function B(s,t){return!s||isNaN(s)||!t||t<=0?100:Math.max(0,100-Math.min(100,s/t*100))}function E(s,t){return!s||isNaN(s)?t||0:!t||t<=0?0:Math.max(0,t-s)}function kt(s){if(!s)return"N/A";const t=new Date(s),e={year:"numeric",month:"long",day:"numeric"};return t.toLocaleDateString(void 0,e)}function St(s){if(!s)return 0;const t=new Date,e=new Date(s);t.setHours(0,0,0,0),e.setHours(0,0,0,0);const i=e-t,a=Math.ceil(i/(1e3*60*60*24));return Math.max(0,a)}function Ft(s,t){if(!s||!t)return!1;const e=new Date().getTime(),i=new Date(s).getTime(),a=new Date(t).getTime();return e>=i&&e<=a}const wt={name:"AccountBilling",components:{TrialBanner:N,UsageMetricsDisplay:I,CurrentPlanCard:z,PlanFeaturesList:q},data(){return{loading:!1,updatingPlan:!1,error:null,errorMessage:null,plans:[],currentSubscription:null,customer:null,selectedPlanId:null,selectedFulfillmentPlanId:null,selectedCheckoutPlanId:null,showAllFulfillmentPlans:!1,showAllCheckoutPlans:!1,maxVisiblePlans:4,expandedPanel:null,activeTab:0,userChangingPlan:!1,hideMantleManagedBilling:!0,subscriptionManagementUnderMaintenance:!0}},created(){this.subscriptionManagementUnderMaintenance||this.initialize()},updateComponentPlansFromCombo(s){if(s&&s.customFields&&s.customFields.INTERNAL_FINANCE_SKUS){const t=s.customFields.INTERNAL_FINANCE_SKUS.split(",").map(e=>e.trim());this.plans.forEach(e=>{if(e.customFields&&e.customFields.INTERNAL_FINANCE_SKUS){const i=e.customFields.INTERNAL_FINANCE_SKUS;t.includes(i)&&(this.fulfillmentPlans.some(a=>a.id===e.id)&&this.selectedFulfillmentPlanId!==e.id&&(console.log("Setting fulfillment plan from combo:",e.id),this.selectedFulfillmentPlanId=e.id),this.checkoutPlans.some(a=>a.id===e.id)&&this.selectedCheckoutPlanId!==e.id&&(console.log("Setting checkout plan from combo:",e.id),this.selectedCheckoutPlanId=e.id))}})}},computed:{isTestUser(){if(this.customer&&this.customer.customFields.account_email){const s=this.customer.customFields.account_email.toLowerCase();return s.includes("@shipblink")||s.includes("@easypost")||s.includes("@sameerkumar")}return!1},fulfillmentPlans(){return this.plans.filter(s=>{if(!s.features||s.customFields&&s.customFields.COMBO_PLAN===!0)return!1;const t=s.features.SB_FL_QUOTA;return t&&t.value>0})},checkoutPlans(){return this.plans.filter(t=>{if(!t.features||t.customFields&&t.customFields.COMBO_PLAN===!0)return!1;if(t.id==="no_checkout_plan")return!0;const e=t.features.SB_CR_QUOTA;return e&&e.value>0}).sort((t,e)=>t.id==="no_checkout_plan"?-1:e.id==="no_checkout_plan"?1:0)},matchingComboPlan(){var a,l;if(!this.selectedFulfillmentPlanId||!this.selectedCheckoutPlanId)return null;const s=this.plans.find(r=>r.id===this.selectedFulfillmentPlanId),t=this.plans.find(r=>r.id===this.selectedCheckoutPlanId);if(!s||!t)return null;const e=(a=s.customFields)==null?void 0:a.INTERNAL_FINANCE_SKUS,i=(l=t.customFields)==null?void 0:l.INTERNAL_FINANCE_SKUS;return!e||!i?null:this.plans.find(r=>{if(!r.customFields||r.customFields.COMBO_PLAN!==!0||!r.customFields.INTERNAL_FINANCE_SKUS)return!1;const y=r.customFields.INTERNAL_FINANCE_SKUS.split(",").map(m=>m.trim());return y.includes(e)&&y.includes(i)})},selectedFulfillmentPlan(){return this.selectedFulfillmentPlanId?this.plans.find(s=>s.id===this.selectedFulfillmentPlanId):null},selectedCheckoutPlan(){return this.selectedCheckoutPlanId?this.plans.find(s=>s.id===this.selectedCheckoutPlanId):null},visibleFulfillmentPlans(){const s=this.fulfillmentPlans;return this.showAllFulfillmentPlans?s:s.slice(0,this.maxVisiblePlans)},visibleCheckoutPlans(){const s=this.checkoutPlans;return this.showAllCheckoutPlans?s:s.slice(0,this.maxVisiblePlans)},hasMoreFulfillmentPlans(){return this.fulfillmentPlans.length>this.maxVisiblePlans},hasMoreCheckoutPlans(){return this.checkoutPlans.length>this.maxVisiblePlans},currentPlan(){return this.currentSubscription?this.currentSubscription.plan:null},selectedPlan(){if(this.userChangingPlan){console.log("User is actively changing plans, using individual selections for summary");const s=this.selectedFulfillmentPlanId?this.plans.find(t=>
1t.id===this.selectedFulfillmentPlanId):null;if(s&&(!this.selectedCheckoutPlanId||this.selectedCheckoutPlanId===null))return s}return this.matchingComboPlan?this.matchingComboPlan:this.selectedCheckoutPlanId===null&&this.selectedFulfillmentPlanId?this.fulfillmentPlans.find(s=>s.id===this.selectedFulfillmentPlanId):this.selectedPlanId?this.plans.find(s=>s.id===this.selectedPlanId):this.selectedFulfillmentPlan},totalPrice(){return this.matchingComboPlan?this.matchingComboPlan.total:this.selectedPlan?this.selectedPlan.total:0},hasChanges(){if(!this.selectedFulfillmentPlanId)return!1;if(!this.currentSubscription||!this.currentSubscription.plan)return!0;const s=this.currentPlan,t=this.selectedPlan;return!s||!t?!0:s.customFields&&s.customFields.INTERNAL_FINANCE_SKUS&&t.customFields&&t.customFields.INTERNAL_FINANCE_SKUS?s.customFields.INTERNAL_FINANCE_SKUS!==t.customFields.INTERNAL_FINANCE_SKUS:s.id!==t.id},formattedNextBillingDate(){if(!this.currentSubscription||!this.currentSubscription.currentPeriodEnd)return"N/A";const s=new Date(this.currentSubscription.currentPeriodEnd),t={year:"numeric",month:"long",day:"numeric"};return s.toLocaleDateString(void 0,t)},getLabelUsage(){if(!this.customer||!this.customer.features||!this.customer.features.SB_FL_QUOTA)return 0;const s=this.customer.features.SB_FL_QUOTA;return s.usage&&s.usage.currentBillingPeriodValue?s.usage.currentBillingPeriodValue:0},getLabelLimit(){if(!this.customer||!this.customer.features||!this.customer.features.SB_FL_QUOTA)return 0;const s=this.customer.features.SB_FL_QUOTA;return s.value===-1?"Unlimited":s.value},getLabelRemaining(){if(!this.customer||!this.customer.features||!this.customer.features.SB_FL_QUOTA)return 0;const s=this.customer.features.SB_FL_QUOTA;if(s.value===-1)return"Unlimited";const t=s.usage&&s.usage.currentBillingPeriodValue?s.usage.currentBillingPeriodValue:0;return E(t,s.value)},getLabelRemainingPercentage(){if(!this.customer||!this.customer.features||!this.customer.features.SB_FL_QUOTA)return 100;const s=this.customer.features.SB_FL_QUOTA;if(s.value===-1)return 100;const t=s.usage&&s.usage.currentBillingPeriodValue?s.usage.currentBillingPeriodValue:0;return B(t,s.value)},hasCheckoutRatingFeature(){return this.currentPlan&&this.currentPlan.features&&this.currentPlan.features.SB_CR_QUOTA&&(this.currentPlan.features.SB_CR_QUOTA.value>0||this.currentPlan.features.SB_CR_QUOTA.value===-1)&&this.customer&&this.customer.features&&!!this.customer.features.SB_CR_QUOTA},getCheckoutUsage(){if(!this.hasCheckoutRatingFeature)return 0;const s=this.customer.features.SB_CR_QUOTA;return s.usage&&s.usage.currentBillingPeriodValue?s.usage.currentBillingPeriodValue:0},getCheckoutLimit(){if(!this.hasCheckoutRatingFeature)return 0;const s=this.customer.features.SB_CR_QUOTA;return s.value===-1?"Unlimited":s.value},getCheckoutRemaining(){if(!this.hasCheckoutRatingFeature)return 0;const s=this.customer.features.SB_CR_QUOTA;if(s.value===-1)return"Unlimited";const t=s.usage&&s.usage.currentBillingPeriodValue?s.usage.currentBillingPeriodValue:0;return E(t,s.value)},getCheckoutRemainingPercentage(){if(!this.hasCheckoutRatingFeature)return 100;const s=this.customer.features.SB_CR_QUOTA;if(s.value===-1)return 100;const t=s.usage&&s.usage.currentBillingPeriodValue?s.usage.currentBillingPeriodValue:0;return B(t,s.value)},isTrialActive(){return!this.customer||!this.customer.trialStartsAt||!this.customer.trialExpiresAt?!1:Ft(this.customer.trialStartsAt,this.customer.trialExpiresAt)},formattedTrialEndDate(){return!this.customer||!this.customer.trialExpiresAt?"N/A":kt(this.customer.trialExpiresAt)},trialDaysRemaining(){return!this.isTrialActive||!this.customer||!this.customer.trialExpiresAt?0:St(this.customer.trialExpiresAt)}},watch:{activeTab(s){console.log("Tab changed to:",s),this.userChangingPlan=!1},selectedFulfillmentPlanId(s,t){console.log("Fulfillment plan changed from:",t,"to:",s),this.userChangingPlan=!0,s&&(this.selectedPlanId=s,console.log("Setting selected plan ID to fulfillment plan:",s)),this.checkForComboPlan(),this.$forceUpdate(),setTimeout(()=>{this.userChangingPlan=!1,console.log("User plan change flag reset")},500)},selectedCheckoutPlanId(s,t){console.log("Checkout plan changed from:",t,"to:",s),this.userChangingPlan=!0,s===null&&console.log("No checkout plan selected"),this.checkForComboPlan(),this.$forceUpdate(),setTimeout(()=>{this.userChangingPlan=!1,console.log("User plan change flag reset")},500)},selectedPlanId(s){if(console.log("Selected plan changed to:",s),this.userChangingPlan){console.log("User is actively changing plans, not syncing selectedPlanId");return}const t=this.plans.find(e=>e.id===s);if(t)if(t.customFields&&t.customFields.COMBO_PLAN===!0){console.log("Selected plan is a combo plan");const e=t;e&&e.customFields&&e.customFields.INTERNAL_FINANCE_SKUS&&this.updateComponentPlansFromCombo(e)}else this.fulfillmentPlans.some(e=>e.id===t.id)&&(this.selectedFulfillmentPlanId=t.id,console.log("Setting selectedFulfillmentPlanId to match selectedPlanId:",t.id))},matchingComboPlan(s){s?this.selectedPlanId=s.id:this.selectedFulfillmentPlanId&&(this.selectedPlanId=this.selectedFulfillmentPlanId),this.$forceUpdate()}},methods:{getPremiumFeatures(s,t=null){const e=new Set;
1return s.forEach(i=>{i&&i.features&&Object.entries(i.features).forEach(([a,l])=>{t==="fulfillment"&&a.includes("SB_CR")||t==="checkout"&&a.includes("SB_FL")||l&&l.name&&l.visible&&l.type==="boolean"&&l.value===!0&&e.add(l.name)})}),Array.from(e)},hasPremiumFeature(s,t){return s.features?Object.values(s.features).some(e=>e.visible&&e.name===t&&(e.value===!0||e.type==="limit"&&(e.value>0||e.value===-1))):!1},isPremiumPlan(s){if(!s.features)return!1;const t=Object.values(s.features).some(i=>i.visible&&i.type==="limit"&&i.value===-1),e=Object.values(s.features).filter(i=>i.visible&&i.name&&!i.name.toLowerCase().includes("label")&&!i.name.toLowerCase().includes("carrier")&&(i.value===!0||i.type==="limit"&&(i.value>0||i.value===-1))).length;return t||e>2},isPremiumCheckoutPlan(s){if(!s.features||s.id==="no_checkout_plan")return!1;const t=Object.values(s.features).some(a=>a.visible&&a.type==="limit"&&a.name&&a.name.toLowerCase().includes("checkout")&&a.value===-1),e=s.features.SB_CR_QUOTA&&s.features.SB_CR_QUOTA.value&&s.features.SB_CR_QUOTA.value>5e3,i=Object.values(s.features).filter(a=>a.visible&&a.name&&!a.name.toLowerCase().includes("checkout")&&!a.name.toLowerCase().includes("quota")&&!a.name.toLowerCase().includes("revenue")&&(a.value===!0||a.type==="limit"&&(a.value>0||a.value===-1))).length;return t||e||i>1},async cancelSubscription(){var s;this.updatingPlan=!0;try{const t=(s=this.fulfillmentPlans)==null?void 0:s[0];if(!t)throw new Error("Free plan not available");this.selectedFulfillmentPlanId=t.id,this.selectedCheckoutPlanId=null,setTimeout(()=>{this.updateSubscription()},300),this.$store.dispatch("showNotification",{text:"Subscription cancellation in progress...",color:"info"})}catch(t){this.error="Unable to cancel subscription",this.errorMessage=t.message||"Please try again later or contact support.",this.updatingPlan=!1}},fetchCurrentSubscription(s){const t=s;t.customer&&(this.customer=t.customer),t.customer&&t.customer.subscription&&(this.currentSubscription=t.customer.subscription,this.selectedPlanId=this.currentSubscription.plan.id)},async initialize(){this.loading=!0,this.error=null,this.errorMessage=null;try{const s=await x.getCustomerDetails();if(s.plans&&s.plans.length>0){const t={id:"no_checkout_plan",name:"No Checkout Rating Plan",description:"I don't want to use checkout rating functionality",total:0,price:0,currency:"USD",features:{SB_CR_QUOTA:{value:0,visible:!0,type:"limit",name:"Checkout Rating Quota"}},customFields:{COMBO_PLAN:!1,INTERNAL_FINANCE_SKUS:"SB-"}};if(this.plans=[t,...s.plans],console.log(`Loaded ${this.plans.length} plans (including No Checkout Plan option)`),console.log(this.plans),this.fetchCurrentSubscription(s),this.currentSubscription&&this.selectedPlanId){const e=this.currentSubscription.plan;if(e&&e.customFields&&e.customFields.COMBO_PLAN===!0){const i=e.customFields.INTERNAL_FINANCE_SKUS.split(",").map(r=>r.trim()),a=this.fulfillmentPlans.find(r=>!r.customFields||!r.customFields.INTERNAL_FINANCE_SKUS?!1:r.customFields.INTERNAL_FINANCE_SKUS.split(",").map(m=>m.trim()).some(m=>i.includes(m))),l=this.checkoutPlans.find(r=>!r.customFields||!r.customFields.INTERNAL_FINANCE_SKUS?!1:r.customFields.INTERNAL_FINANCE_SKUS.split(",").map(m=>m.trim()).some(m=>i.includes(m)));a&&(this.selectedFulfillmentPlanId=a.id),l&&(this.selectedCheckoutPlanId=l.id)}}!this.selectedPlanId&&this.plans.length>0&&(this.selectedPlanId=this.plans[0].id),!this.selectedFulfillmentPlanId&&this.fulfillmentPlans.length>0&&(this.selectedFulfillmentPlanId=this.fulfillmentPlans[0].id)}else console.warn("No plans returned from API")}catch(s){this.error="Unable to load available plans",this.errorMessage=s.message||"Please try again later or contact support."}finally{this.loading=!1}},checkForComboPlan(){if(this.userChangingPlan){console.log("User is actively changing plans, not enforcing combo plan");return}this.matchingComboPlan?(this.selectedPlanId=this.matchingComboPlan.id,console.log("Using matching combo plan:",this.matchingComboPlan.id),this.updateComponentPlansFromCombo(this.matchingComboPlan)):this.selectedFulfillmentPlanId&&(this.selectedPlanId=this.selectedFulfillmentPlanId,console.log("Using fulfillment plan:",this.selectedFulfillmentPlanId))},async updateSubscription(){this.updatingPlan=!0,this.error=null,this.errorMessage=null;try{if(!this.selectedFulfillmentPlanId)throw new Error("Please select a fulfillment plan");this.selectedFulfillmentPlanId&&this.selectedCheckoutPlanId&&this.matchingComboPlan?this.selectedPlanId=this.matchingComboPlan.id:this.selectedPlanId||(this.selectedPlanId=this.selectedFulfillmentPlanId);const s=this.plans.find(i=>i.id===this.selectedPlanId);if(!s)throw new Error("Selected plan not found");if(!s.customFields||!s.customFields.INTERNAL_FINANCE_SKUS)throw new Error("Selected plan does not have valid SKUs");let t="";window.shopifyApp?t="https://admin.shopify.com/apps/shipblink-easypost/settings/account":t=window.location.href;const e=await x.createSubscription({planId:this.selectedPlanId,returnUrl:t,hosted:!0,test:this.isTestUser,useSavedPaymentMethod:!0,automaticTax:!1,requirePaymentMethod:"if_required",requireBillingAddress:!0});if(e.confirmationUrl)window.shopifyApp?open(e.confirmationUrl,"_top"):window.location.href=e.confirmationUrl;else if(e.plan)this.currentSubscription=e.plan,this.expandedPanel=null,this.$store.dispatch("showNotification",{text:"Subscription updated successfully",color:"success"}),this.updatingPlan=!1,this.initialize();else throw new Error("Invalid response from subscription service")}catch(s){this.error="Unable to update subscription",this.errorMessage=s.message||"Please try again later or contact support.",this.updatingPlan=!1}},async launchBillingPortal(){this.loading=!0,this.error=null,this.errorMessage=null;
1try{const s=await x.createHostedSession({return_url:`${window.location.href}`,type:"account"});s.session?window.location.href=s.session.url:(this.error="Unable to access billing portal",this.errorMessage="Please try again later or contact support.")}catch(s){if(console.error("Failed to create hosted session:",s),s.response&&s.response.status===403){const t=s.response.data;this.error=t.error||"Access to self-serve billing restricted",this.errorMessage=t.message||"Please contact support for billing assistance."}else this.error="Unable to access billing portal",this.errorMessage="Please try again later or contact support."}finally{this.loading=!1}}}};var xt=function(){var t=this,e=t._self._c;return e(F,{staticClass:"mx-auto"},[e(o,{staticClass:"mt-4 billing-card"},[e(p,{staticClass:"d-flex align-center"},[e(n,{staticClass:"mr-2",attrs:{color:"primary"}},[t._v("mdi-currency-usd")]),e("span",[t._v("Billing")])],1),e(d,[t.subscriptionManagementUnderMaintenance?e("div",[e(P,{staticClass:"mb-4",attrs:{type:"info",border:"left","colored-border":"",dense:""}},[e("div",{staticClass:"font-weight-bold"},[t._v("Self-serve subscription management is temporarily unavailable")]),e("div",{staticClass:"body-2"},[t._v(" We're making improvements to our billing experience. In the meantime, our Support team is happy to help with anything subscription-related. ")])]),e(h,{staticClass:"mb-2"},[e(u,{attrs:{cols:"12",md:"6"}},[e(o,{staticClass:"pa-4 h-100",attrs:{outlined:""}},[e("div",{staticClass:"d-flex align-center mb-2"},[e(n,{staticClass:"mr-2",attrs:{color:"primary"}},[t._v("mdi-account-check-outline")]),e("div",{staticClass:"subtitle-1 font-weight-bold"},[t._v("Existing Subscribers")])],1),e("p",{staticClass:"body-2 mb-0"},[t._v(" For plan changes, cancellations, invoices, or any other billing questions, email "),e("a",{attrs:{href:"mailto:[email protected]?subject=Subscription%20Inquiry"}},[t._v("[email protected]")]),t._v(". ")])])],1),e(u,{attrs:{cols:"12",md:"6"}},[e(o,{staticClass:"pa-4 h-100",attrs:{outlined:""}},[e("div",{staticClass:"d-flex align-center mb-2"},[e(n,{staticClass:"mr-2",attrs:{color:"primary"}},[t._v("mdi-rocket-launch-outline")]),e("div",{staticClass:"subtitle-1 font-weight-bold"},[t._v("Activate a New Subscription")])],1),e("p",{staticClass:"body-2 mb-0"},[t._v(" Email "),e("a",{attrs:{href:"mailto:[email protected]?subject=New%20Subscription%20Request"}},[t._v("[email protected]")]),t._v(" with the plan you're interested in. Our Support team will send you a secure link to complete activation. ")])])],1)],1)],1):[e("p",[t._v("Manage your billing settings, subscription plans, and payment methods.")]),t.isTestUser?e("p",{staticStyle:{color:"red"}},[t._v("Billing Test mode enabled")]):t._e(),t.error?e(P,{staticClass:"mb-4",attrs:{type:"error",dense:"",border:"left","colored-border":"",dismissible:""},on:{input:function(i){t.error=null}}},[e("div",{staticClass:"font-weight-bold"},[t._v(t._s(t.error))]),e("div",[t._v(t._s(t.errorMessage))])]):t._e(),e(z,{attrs:{plan:t.currentPlan,"next-billing-date":t.formattedNextBillingDate,"is-trial-active":t.isTrialActive,"trial-end-date":t.formattedTrialEndDate,"days-remaining":t.trialDaysRemaining,loading:t.loading,color:"success"},scopedSlots:t._u([{key:"usage",fn:function(){return[t.currentPlan?e(b,{staticClass:"my-3"}):t._e(),t.currentPlan?e("div",{staticClass:"mt-3"},[e("div",{staticClass:"subtitle-2 font-weight-medium mb-3"},[t._v("Current Usage")]),e(h,{staticClass:"mx-0"},[e(u,{staticClass:"pa-2",attrs:{cols:"12",sm:"6"}},[e(o,{staticClass:"pa-3 h-100",attrs:{outlined:""}},[e("div",{staticClass:"d-flex align-center mb-2"},[e(n,{staticClass:"mr-2",attrs:{small:"",color:"primary"}},[t._v("mdi-label")]),e("div",{staticClass:"subtitle-2"},[t._v("Label Generation")])],1),e(I,{attrs:{"label-remaining-percentage":t.getLabelRemainingPercentage,"label-remaining":t.getLabelRemaining,"label-limit":t.getLabelLimit,"show-label-generation":!0,"show-checkout-rating":!1}})],1)],1),t.hasCheckoutRatingFeature?e(u,{staticClass:"pa-2",attrs:{cols:"12",sm:"6"}},[e(o,{staticClass:"pa-3 h-100",attrs:{outlined:""}},[e("div",{staticClass:"d-flex align-center mb-2"},[e(n,{staticClass:"mr-2",attrs:{small:"",color:"primary"}},[t._v("mdi-calculator")]),e("div",{staticClass:"subtitle-2"},[t._v("Checkout Rating")])],1),e(I,{attrs:{"checkout-remaining-percentage":t.getCheckoutRemainingPercentage,"checkout-remaining":t.getCheckoutRemaining,"checkout-limit":t.getCheckoutLimit,"show-label-generation":!1,"show-checkout-rating":!0}})],1)],1):t._e()],1)],1):t._e()]},proxy:!0},{key:"features",fn:function(){var i;return[t.currentPlan?e(b,{staticClass:"my-3"}):t._e(),t.currentPlan?e("div",{staticClass:"mt-3"},[e(q,{attrs:{features:t.currentPlan.features,title:"Plan Features","show-title":!0,"show-cancel-button":!0,"subscription-amount":((i=t.currentPlan)==null?void 0:i.total)||0},on:{"cancel-subscription":t.cancelSubscription}})],1):t._e()]},proxy:!0}])}),e(X,{staticClass:"mb-6",model:{value:t.expandedPanel,callback:function(i){t.expandedPanel=i},expression:"expandedPanel"}},[e(tt,[e(et,[e("div",{staticClass:"d-flex align-center"},[e(n,{attrs:{left:"",color:"primary"}},[t._v("mdi-tag-outline")]),e("span",[t._v(t._s(this.currentPlan&&this.currentPlan.total>0?"Change":"Select")+" Subscription Plan")])],1)]),e(st,[e(h,[e(u,{attrs:{cols:"12",md:"3"}},[e(o,{staticClass:"mb-4"},[e(V,{attrs:{nav:"",dense:""}},[e(g,{class:{"success lighten-4":t.activeTab===0},on:{click:function(i){t.activeTab=0}}}
1,[e(v,[e(n,[t._v("mdi-package-variant-closed")])],1),e(C,[e(U,[t._v("Fulfillment Plans")])],1)],1),e(g,{class:{"success lighten-4":t.activeTab===1},on:{click:function(i){t.activeTab=1}}},[e(v,[e(n,[t._v("mdi-cart-outline")])],1),e(C,[e(U,[t._v("Checkout Rating Plans")])],1)],1)],1),e(b),e(d,{staticClass:"caption"},[t.activeTab===0?e("div",[e("h3",{staticClass:"subtitle-2 font-weight-bold mb-2"},[t._v("About Fulfillment Plans")]),e("p",[t._v("Fulfillment plans provide access to our core shipping software features:")]),e("ul",{staticClass:"pl-4"},[e("li",[t._v("Create and print shipping labels")]),e("li",[t._v("Connect to multiple carriers")]),e("li",[t._v("Manage orders and shipments")]),e("li",[t._v("Access discounted shipping rates")]),e("li",[t._v("Track packages and deliveries")])]),e("p",{staticClass:"mt-2"},[e("strong",[t._v("Choose a plan based on your monthly shipping volume.")])])]):t._e(),t.activeTab===1?e("div",[e("h3",{staticClass:"subtitle-2 font-weight-bold mb-2"},[t._v("About Checkout Rating Plans")]),e("p",[t._v("Checkout rating plans help you convert more customers:")]),e("ul",{staticClass:"pl-4"},[e("li",[t._v("Show real-time shipping rates at checkout")]),e("li",[t._v("Reduce cart abandonment")]),e("li",[t._v("Monetize shipping with markups")]),e("li",[t._v("Offer free shipping thresholds")]),e("li",[t._v("Create custom shipping rules")])]),e("p",{staticClass:"mt-2"},[e("strong",[t._v("Optional add-on to your fulfillment plan.")])])]):t._e()])],1)],1),e(u,{attrs:{cols:"12",md:"9"}},[e(o,{attrs:{flat:""}},[t.activeTab===0?e("div",[e(d,[e("h2",{staticClass:"headline mb-3"},[t._v("Fulfillment Plans")]),e("p",{staticClass:"mb-4"},[t._v("Select your preferred fulfillment plan:")]),e(o,{attrs:{outlined:""}},[e(d,{staticClass:"pa-0"},[e(T,{scopedSlots:t._u([{key:"default",fn:function(){return[e("thead",[e("tr",[e("th",{staticClass:"text-left"},[t._v("Feature")]),t._l(t.visibleFulfillmentPlans,function(i){return e("th",{key:i.id,staticClass:"text-center",class:{"success lighten-5":t.selectedFulfillmentPlanId===i.id,"amber lighten-5":t.currentSubscription&&t.currentSubscription.plan&&t.currentSubscription.plan.id===i.id}},[t._v(" "+t._s(i.name)+" "),t.currentSubscription&&t.currentSubscription.plan&&t.currentSubscription.plan.id===i.id?e("div",{staticClass:"caption amber--text text--darken-3"},[e(n,{attrs:{color:"amber darken-3","x-small":""}},[t._v("mdi-star")]),t._v(" Current Plan ")],1):t._e()])})],2),e("tr",[e("td",{staticClass:"font-weight-medium"},[t._v("Select")]),t._l(t.visibleFulfillmentPlans,function(i){return e("td",{key:"select-"+i.id,staticClass:"text-center"},[e("div",{staticClass:"d-flex justify-center"},[e(c,{staticClass:"ma-0",attrs:{color:t.selectedFulfillmentPlanId===i.id?"primary":"grey lighten-3","text-color":t.selectedFulfillmentPlanId===i.id?"white":"grey darken-2",small:"",icon:""},on:{click:function(a){t.selectedFulfillmentPlanId=i.id}}},[e(n,[t._v(t._s(t.selectedFulfillmentPlanId===i.id?"mdi-radiobox-marked":"mdi-radiobox-blank"))])],1)],1)])})],2)]),e("tbody",[e("tr",[e("td",{staticClass:"font-weight-medium"},[t._v("Monthly Price")]),t._l(t.visibleFulfillmentPlans,function(i){return e("td",{key:"price-"+i.id,staticClass:"text-center"},[e("div",{staticClass:"subtitle-1 font-weight-bold",class:{"primary--text":t.selectedFulfillmentPlanId===i.id}},[t._v(" $"+t._s(i.total)+" ")])])})],2),e("tr",[e("td",{staticClass:"font-weight-medium"},[t._v("Shipping Labels")]),t._l(t.visibleFulfillmentPlans,function(i){return e("td",{key:"labels-"+i.id,staticClass:"text-center"},[e("div",{staticClass:"font-weight-bold",class:{"primary--text":t.selectedFulfillmentPlanId===i.id}},[t._v(" "+t._s(i.features&&i.features.SB_FL_QUOTA?i.features.SB_FL_QUOTA.value===-1?"Unlimited":i.features.SB_FL_QUOTA.value:"0")+" ")]),e("div",{staticClass:"caption"},[t._v("per month")])])})],2),t._l(t.getPremiumFeatures(t.visibleFulfillmentPlans,"fulfillment"),function(i,a){return e("tr",{key:"feature-"+a},[e("td",{staticClass:"font-weight-medium"},[t._v(t._s(i))]),t._l(t.visibleFulfillmentPlans,function(l){return e("td",{key:"feature-"+l.id+"-"+a,staticClass:"text-center"}
1,[t.hasPremiumFeature(l,i)?e(n,{attrs:{color:"success",small:""}},[t._v(" mdi-check-circle ")]):e(n,{attrs:{color:"grey lighten-1",small:""}},[t._v("mdi-minus")])],1)})],2)})],2)]},proxy:!0}],null,!1,1905500809)})],1)],1),t.hasMoreFulfillmentPlans&&!t.showAllFulfillmentPlans?e("div",{staticClass:"text-center mt-2"},[e(c,{attrs:{text:"",small:"",color:"primary"},on:{click:function(i){t.showAllFulfillmentPlans=!0}}},[e(n,{staticClass:"mr-1",attrs:{small:""}},[t._v("mdi-chevron-down")]),t._v(" Show "+t._s(t.fulfillmentPlans.length-t.maxVisiblePlans)+" More Plans ")],1)],1):t._e(),t.showAllFulfillmentPlans?e("div",{staticClass:"text-center mt-2"},[e(c,{attrs:{text:"",small:"",color:"primary"},on:{click:function(i){t.showAllFulfillmentPlans=!1}}},[e(n,{staticClass:"mr-1",attrs:{small:""}},[t._v("mdi-chevron-up")]),t._v(" Show Fewer Plans ")],1)],1):t._e()],1)],1):t._e(),t.activeTab===1?e("div",[e(d,[e("h2",{staticClass:"headline mb-3"},[t._v("Checkout Rating Plans")]),e("p",{staticClass:"mb-4"},[t._v("Select your preferred checkout rating plan (optional):")]),e(o,{attrs:{outlined:""}},[e(d,{staticClass:"pa-0"},[e(T,{scopedSlots:t._u([{key:"default",fn:function(){return[e("thead",[e("tr",[e("th",{staticClass:"text-left"},[t._v("Feature")]),t._l(t.visibleCheckoutPlans,function(i){return e("th",{key:i.id,staticClass:"text-center",class:{"success lighten-5":i.id==="no_checkout_plan"&&t.selectedCheckoutPlanId===null||t.selectedCheckoutPlanId===i.id,"amber lighten-5":t.currentSubscription&&t.currentSubscription.plan&&(i.id==="no_checkout_plan"&&!t.currentSubscription.plan.id||i.id!=="no_checkout_plan"&&t.currentSubscription.plan.id===i.id)}},[t._v(" "+t._s(i.name)+" "),t.currentSubscription&&t.currentSubscription.plan&&(i.id==="no_checkout_plan"&&!t.currentSubscription.plan.id||i.id!=="no_checkout_plan"&&t.currentSubscription.plan.id===i.id)?e("div",{staticClass:"caption amber--text text--darken-3"},[e(n,{attrs:{color:"amber darken-3","x-small":""}},[t._v("mdi-star")]),t._v(" Current Plan ")],1):t._e()])})],2),e("tr",[e("td",{staticClass:"font-weight-medium"},[t._v("Select")]),t._l(t.visibleCheckoutPlans,function(i){return e("td",{key:"select-"+i.id,staticClass:"text-center"},[e("div",{staticClass:"d-flex justify-center"},[e(c,{staticClass:"ma-0",attrs:{color:i.id==="no_checkout_plan"&&t.selectedCheckoutPlanId===null||t.selectedCheckoutPlanId===i.id?"primary":"grey lighten-3","text-color":i.id==="no_checkout_plan"&&t.selectedCheckoutPlanId===null||t.selectedCheckoutPlanId===i.id?"white":"grey darken-2",small:"",icon:""},on:{click:function(a){t.selectedCheckoutPlanId=i.id==="no_checkout_plan"?null:i.id}}},[e(n,[t._v(t._s(i.id==="no_checkout_plan"&&t.selectedCheckoutPlanId===null||t.selectedCheckoutPlanId===i.id?"mdi-radiobox-marked":"mdi-radiobox-blank"))])],1)],1)])})],2)]),e("tbody",[e("tr",[e("td",{staticClass:"font-weight-medium"},[t._v("Monthly Price")]),t._l(t.visibleCheckoutPlans,function(i){return e("td",{key:"price-"+i.id,staticClass:"text-center"},[e("div",{staticClass:"subtitle-1 font-weight-bold",class:{"primary--text":i.id==="no_checkout_plan"&&t.selectedCheckoutPlanId===null||t.selectedCheckoutPlanId===i.id}},[t._v(" $"+t._s(i.total)+" ")])])})],2),e("tr",[e("td",{staticClass:"font-weight-medium"},[t._v("Checkout Ratings")]),t._l(t.visibleCheckoutPlans,function(i){return e("td",{key:"ratings-"+i.id,staticClass:"text-center"},[e("div",{staticClass:"font-weight-bold",class:{"primary--text":i.id==="no_checkout_plan"&&t.selectedCheckoutPlanId===null||t.selectedCheckoutPlanId===i.id}},[t._v(" "+t._s(i.id==="no_checkout_plan"?"None":i.features&&i.features.SB_CR_QUOTA?i.features.SB_CR_QUOTA.value===-1?"Unlimited":i.features.SB_CR_QUOTA.value:"0")+" ")]),i.id!=="no_checkout_plan"?e("div",{staticClass:"caption"},[t._v("per month")]):t._e()])})],2),t._l(t.getPremiumFeatures(t.visibleCheckoutPlans.filter(i=>i.id!=="no_checkout_plan"),"checkout"),function(i,a){return e("tr",{key:"feature-"+a},[e("td",{staticClass:"font-weight-medium"},[t._v(t._s(i))]),t._l(t.visibleCheckoutPlans,function(l){return e("td",{key:"feature-"+l.id+"-"+a,staticClass:"text-center"}
1,[l.id!=="no_checkout_plan"&&t.hasPremiumFeature(l,i)?e(n,{attrs:{color:"success",small:""}},[t._v(" mdi-check-circle ")]):e(n,{attrs:{color:"grey lighten-1",small:""}},[t._v("mdi-minus")])],1)})],2)})],2)]},proxy:!0}],null,!1,371157241)})],1)],1),t.hasMoreCheckoutPlans&&!t.showAllCheckoutPlans?e("div",{staticClass:"text-center mt-2"},[e(c,{attrs:{text:"",small:"",color:"primary"},on:{click:function(i){t.showAllCheckoutPlans=!0}}},[e(n,{staticClass:"mr-1",attrs:{small:""}},[t._v("mdi-chevron-down")]),t._v(" Show "+t._s(t.checkoutPlans.length-t.maxVisiblePlans)+" More Plans ")],1)],1):t._e(),t.showAllCheckoutPlans?e("div",{staticClass:"text-center mt-2"},[e(c,{attrs:{text:"",small:"",color:"primary"},on:{click:function(i){t.showAllCheckoutPlans=!1}}},[e(n,{staticClass:"mr-1",attrs:{small:""}},[t._v("mdi-chevron-up")]),t._v(" Show Fewer Plans ")],1)],1):t._e()],1)],1):t._e()])],1)],1),t.hasChanges?e(o,{staticClass:"mt-4",attrs:{outlined:""}},[e(p,{staticClass:"subtitle-1"},[t._v("Plan Change Summary")]),e(d,[e("div",{staticClass:"d-flex flex-wrap"},[e("div",{staticClass:"mr-6 mb-3"},[e("div",{staticClass:"caption grey--text mb-1"},[t._v("Current Plan")]),e("div",[t._v(t._s(t.currentPlan?t.currentPlan.name:"None"))]),e("div",{staticClass:"caption"},[t._v(t._s(t.currentPlan?t.currentPlan.description:""))])]),e("div",{staticClass:"mr-6 mb-3"},[e("div",{staticClass:"caption grey--text mb-1"},[t._v("New Plan")]),e("div",[t._v(t._s(t.selectedPlan?t.selectedPlan.name:"None"))]),e("div",{staticClass:"caption"},[t._v(t._s(t.selectedPlan?t.selectedPlan.description:""))])]),e("div",{staticClass:"mr-6 mb-3"},[e("div",{staticClass:"caption grey--text mb-1"},[t._v("Price Change")]),e("div",[t.currentPlan&&t.selectedPlan?e("span",[t._v(" $"+t._s(t.currentPlan.total)+" → $"+t._s(t.selectedPlan.total)+" ")]):t.selectedPlan?e("span",[t._v(" $"+t._s(t.selectedPlan.total)+" ")]):e("span",[t._v("-")])])])]),e("div",{staticClass:"d-flex align-center justify-space-between mt-3"},[e("div",[e("div",{staticClass:"caption grey--text"},[t._v("New Monthly Total")]),e("div",{staticClass:"subtitle-1 font-weight-bold primary--text"},[t._v(" $"+t._s(t.totalPrice)+"/month ")])]),e(c,{attrs:{color:"primary",loading:t.updatingPlan,disabled:t.updatingPlan},on:{click:t.updateSubscription}},[t._v(" Update Subscription ")])],1)])],1):t._e()],1)],1)],1)],e("div",{staticClass:"d-flex align-center"},[t.hideMantleManagedBilling?t._e():e(c,{staticClass:"mr-3",attrs:{color:"primary",loading:t.loading,disabled:t.loading},on:{click:t.launchBillingPortal}},[e(n,{attrs:{left:"",small:""}},[t._v("mdi-open-in-new")]),t._v(" Manage Billing ")],1),e(c,{attrs:{text:"",color:"primary",href:"mailto:[email protected]",small:""}},[e(n,{attrs:{left:"",small:""}},[t._v("mdi-email-outline")]),t._v(" Contact Support ")],1)],1)],2)],1)],1)},It=[],At=_(wt,xt,It,!1,null,"8947a89e");const K=At.exports,Nt={name:"account-usage",props:["showStoreInfo","showAutoFulfill","showOriginAddress","showStoreUnits","showDefaultCustomsInformation"],data(){return{pageLoading:!0,browserWindow:{},merchants:[],current_period_start_date:null}},methods:{moment:O,getSourceLogo:Q.getSourceLogo,contactSupport(){window.location.href="mailto:[email protected]"},initialize(){axios.get("/account/details/").then(s=>{this.merchants=s.data.merchants,this.current_period_start_date=s.data.current_period_start_date,this.pageLoading=!1})}},mounted(){this.browserWindow=window},created(){this.initialize()}};var Rt=function(){var t=this,e=t._self._c;return e(F,{staticClass:"mx-auto"},[e(M,{attrs:{value:t.pageLoading,absolute:"",color:"transparent"}},[e(A,{attrs:{indeterminate:"",size:"64",color:"primary"}})],1),t.pageLoading?t._e():e(o,{staticClass:"usage-card"},[e(p,{staticClass:"usage-period d-flex align-center py-6"},[e("div",[e("h3",{staticClass:"text-h6 mb-1"},[t._v("Current Usage Period")]),e("span",{staticClass:"text-subtitle-1 text--secondary"},[t._v(" "+t._s(t.moment(t.current_period_start_date).format("ll"))+" to "+t._s(t.moment(t.current_period_start_date).add(1,"month").format("ll"))+" ")])]),e(S),e(c,{staticClass:"text-none",attrs:{color:"primary",text:""},on:{click:t.contactSupport}},[e(n,{attrs:{left:"",small:""}},[t._v("mdi-information")]),t._v(" Plan Details ")],1)],1),e(b),e(d,{staticClass:"pt-6"},[e("div",{staticClass:"d-flex align-center mb-6"},[e("h4",{staticClass:"text-h6 mb-0"},[t._v("Connected Stores")]),e(L,{staticClass:"ml-3",attrs:{small:"",color:t.merchants.length>0?"success":"grey","text-color":"white"}},[t._v(" "+t._s(t.merchants.length)+" stores ")])],1),e(h,t._l(t.merchants,function(i,a){return e(u,{key:a,attrs:{cols:"12",sm:"6",md:"6",lg:"4"}},[e(o,{staticClass:"store-card",attrs:{outlined:""}},[e(p,{staticClass:"py-2 grey lighten-4"},[e(Z,{staticClass:"mr-2",attrs:{size:"32"}},[e(J,{attrs:{src:t.getSourceLogo(i.platform),contain:""}})],1),e("span",{staticClass:"text-truncate"},[t._v(t._s(i.display_name))]),e(S),e(L,{attrs:{"x-small":"",color:i.app_installed?"success":"error","text-color":"white"}},[t._v(" "+t._s(i.app_installed?"Active":"Inactive")+" ")])],1),e(d,{staticClass:"pt-4"},[e(V,{attrs:{dense:""}},[e(g,[e(v,{staticClass:"mr-2"},[e(n,{attrs:{small:"",color:"grey"}}
1,[t._v("mdi-web")])],1),e(C,[e(k,[t._v(t._s(i.domain))])],1)],1),e(g,[e(v,{staticClass:"mr-2"},[e(n,{attrs:{small:"",color:"grey"}},[t._v("mdi-label-outline")])],1),e(C,[e(k,[t._v(" "+t._s(i.shipments_30d)+" labels this period ")])],1)],1),e(g,[e(v,{staticClass:"mr-2"},[e(n,{attrs:{small:"",color:"grey"}},[t._v("mdi-calculator")])],1),e(C,[e(k,[t._v(" "+t._s(i.mtd_cart_count)+" rate quotes this period ")])],1)],1)],1)],1)],1)],1)}),1),e(P,{staticClass:"mt-6 mb-0",attrs:{color:"info",text:"",dense:""}},[e("div",{staticClass:"d-flex align-center"},[e("span",[t._v("To know more about your current plan or manage subscription, contact")]),e(c,{staticClass:"text-none ml-1",attrs:{text:"",small:"",color:"primary",href:"mailto:[email protected]"}},[t._v(" [email protected] ")])],1)])],1)],1)],1)},Ut=[],Tt=_(Nt,Rt,Ut,!1,null,"ffe4d113");const Lt=Tt.exports,Bt={components:{AccountContactInfo:j,AccountBilling:K,AccountUsage:Lt},data(){return{}}};var Et=function(){var t=this,e=t._self._c;return e(F,[t.$isFeatureEnabled("wallet")?e(K):t._e(),e(j)],1)},$t=[],Ot=_(Bt,Et,$t,!1,null,null);const Mt=Ot.exports,Dt={name:"AccountConfig",components:{BaseConfigSection:$,AccountView:Mt}};var Qt=function(){var t=this,e=t._self._c;return e($,{attrs:{title:"Account",description:"Account settings and billing","full-view-path":"/account"}},[e("account-view",{attrs:{embedded:""}})],1)},Vt=[],jt=_(Dt,Qt,Vt,!1,null,"30885cc9");const Wt=jt.exports;export{Wt 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.