(window["aioseopjsonp"]=window["aioseopjsonp"]||[]).push([["setup-wizard-LicenseKey-vue"],{"2f1c":function(e,t,s){"use strict";s.r(t);var i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"aioseo-wizard-license-key"},[s("wizard-header"),s("wizard-container",[s("wizard-body",{scopedSlots:e._u([{key:"footer",fn:function(){return[s("div",{staticClass:"go-back"},[s("router-link",{staticClass:"no-underline",attrs:{to:e.getPrevLink}},[e._v("←")]),e._v("   "),s("router-link",{attrs:{to:e.getPrevLink}},[e._v(e._s(e.strings.goBack))])],1),s("div",{staticClass:"spacer"}),s("base-button",{attrs:{type:"gray",tag:"router-link",to:e.getNextLink}},[e._v(e._s(e.strings.skipThisStep))])]},proxy:!0}])},[s("wizard-steps"),s("div",{staticClass:"header"},[e._v(" "+e._s(e.strings.enterYourLicenseKey)+" ")]),e.$isPro?e._e():s("div",{staticClass:"description",domProps:{innerHTML:e._s(e.noLicenseNeeded)}}),s("div",{staticClass:"license-cta-box"},[s("div",{domProps:{innerHTML:e._s(e.tooltipText)}}),s("br"),s("grid-row",e._l(e.getSelectedUpsellFeatures,(function(t,i){return s("grid-column",{key:i,attrs:{sm:"6"}},[s("svg-checkmark"),e._v(" "+e._s(t.name)+" ")],1)})),1)],1),e.$isPro?e._e():s("div",{domProps:{innerHTML:e._s(e.alreadyPurchased)}}),s("form",{staticClass:"license-key"},[s("input",{staticStyle:{display:"none"},attrs:{type:"text",name:"username",autocomplete:"username"}}),s("base-input",{attrs:{type:"password",placeholder:e.strings.placeholder,"append-icon":e.licenseKey?"circle-check":null,autocomplete:"new-password"},model:{value:e.licenseKey,callback:function(t){e.licenseKey=t},expression:"licenseKey"}}),s("base-button",{attrs:{type:"green",disabled:!e.licenseKey,loading:e.loading},on:{click:e.processConnectOrActivate}},[e._v(" "+e._s(e.strings.connect)+" ")])],1),e.error?s("core-alert",{staticClass:"license-key-error",attrs:{type:"red"},domProps:{innerHTML:e._s(e.error)}}):e._e()],1),s("wizard-close-and-exit")],1)],1)},n=[],r=s("5530"),o=(s("9911"),s("e935")),a=s("9c0e"),c=s("2f62"),l={mixins:[a["q"]],data:function(){return{error:null,loading:!1,stage:"license-key",licenseKey:null,strings:{enterYourLicenseKey:this.$t.sprintf(this.$t.__("Enter your %1$s License Key",this.$td),"AIOSEO"),boldText:this.$t.sprintf("%1$s %2$s","AIOSEO","Lite"),purchasedBoldText:this.$t.sprintf("%1$s %2$s","AIOSEO","Pro"),linkText:this.$t.sprintf(this.$t.__("upgrade to %1$s",this.$td),"Pro"),placeholder:this.$t.__("Paste your license key here",this.$td),connect:this.$t.__("Connect",this.$td)}}},watch:{licenseKey:function(e){this.updateLicenseKey(e)}},computed:Object(r["a"])(Object(r["a"])(Object(r["a"])({},Object(c["e"])(["options"])),Object(c["e"])("wizard",{stateLicenseKey:"licenseKey",presetFeatures:"features"})),{},{noLicenseNeeded:function(){return this.$t.sprintf(this.$t.__("You're using %1$s - no license needed. Enjoy!",this.$td)+" 🙂",this.strings.boldText)},link:function(){return this.$t.sprintf('%2$s',this.$links.utmUrl("general-settings","license-box"),this.strings.linkText)},tooltipText:function(){return this.$isPro?this.$t.__("To unlock the selected features, please enter your license key below.",this.$td):this.$t.sprintf(this.$t.__("To unlock the selected features, please %1$s and enter your license key below.",this.$td),this.link)},alreadyPurchased:function(){return this.$t.sprintf(this.$t.__("Already purchased? Simply enter your license key below to connect with %1$s!",this.$td),this.strings.purchasedBoldText)}}),methods:Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])({},Object(c["b"])(["getConnectUrl","processConnect","activate"])),Object(c["b"])("wizard",["saveWizard"])),Object(c["d"])("wizard",["updateLicenseKey"])),{},{processConnectOrActivate:function(){if(this.$isPro)return this.processActivateLicense();this.processGetConnectUrl()},processActivateLicense:function(){var e=this;this.error=null,this.loading=!0,this.$store.commit("loading",!0),this.activate(this.licenseKey).then((function(){e.$aioseo.internalOptions.internal.license.expired=!1,e.saveWizard("license-key").then((function(){e.$router.push(e.getNextLink)}))})).catch((function(t){if(e.loading=!1,e.licenseKey=null,e.$store.commit("loading",!1),t&&t.response&&t.response.body&&t.response.body.error&&t.response.body.licenseData){var s=t.response.body.licenseData;s.invalid?e.error=e.$t.__("The license key provided is invalid. Please use a different key to continue receiving automatic updates.",e.$tdPro):s.disabled?e.error=e.$t.__("The license key provided is disabled. Please use a different key to continue receiving automatic updates.",e.$tdPro):s.expired?e.error=e.licenseKeyExpired:s.activationsError?e.error=e.$t.__("This license key has reached the maximum number of activations. Please deactivate it from another site or purchase a new license to continue receiving automatic updates.",e.$tdPro):(s.connectionError||s.requestError)&&(e.error=e.$t.__("There was an error connecting to the licensing API. Please try again later.",e.$tdPro))}else e.error=e.$t.__("An unknown error occurred, please try again later.",e.$tdPro)}))},processGetConnectUrl:function(){var e=this;this.loading=!0,this.$store.commit("loading",!0),this.getConnectUrl({key:this.licenseKey,wizard:!0}).then((function(t){if(t.body.url){if(!t.body.popup)return e.loading=!1,e.$store.commit("loading",!1),window.open(t.body.url);e.openPopup(t.body.url)}}))},openPopup:function(e){Object(o["a"])(e,"_self",600,630,!0,["file","token"],this.completedCallback,this.closedCallback)},completedCallback:function(e){return e.wizard=!0,this.processConnect(e)},closedCallback:function(e){if(e)return window.location.reload();this.loading=!1,this.$store.commit("loading",!1)}}),mounted:function(){this.licenseKey=this.stateLicenseKey}},d=l,u=(s("8fc2"),s("2877")),p=Object(u["a"])(d,i,n,!1,null,null,null);t["default"]=p.exports},"8fc2":function(e,t,s){"use strict";s("f1ff")},f1ff:function(e,t,s){}}]);