var FireBox_Upgrade_To_Plan_Modal=function(){function e(){this.modal=document.querySelector("#fireboxUpgradeToPlan"),this.modal&&this.initEvents()}var t=e.prototype;return t.initEvents=function(){this.modal.addEventListener("fpf_modal_open",function(e){this.handleProOpen(e)}.bind(this))},t.handleProOpen=function(e){var t,n,o,a,r,i,_,d,s,f,l,p,c,u,b=e.detail.initiator,m=b.getAttribute("data-fpf-modal");!m||(t=document.querySelector(".fpf-modal > .modal"+m))&&(n=b.getAttribute("data-fpf-modal-item")||!1,o=b.getAttribute("data-current-plan")||!1,a=b.getAttribute("data-upgrade-plan")||"pro",r=fbox_admin_js_object.langs.FEATURE_AVAILABLE_IN_X_PLAN,i=wp.i18n.sprintf(r,n,a),t.querySelector(".po-feature h2").innerHTML=i,_=fbox_admin_js_object.langs.SORRY_FEATURE_NOT_AVAILABLE_IN_YOUR_PLAN,d=wp.i18n.sprintf(_,n,a),t.querySelector(".po-feature p").innerHTML=d,s=fbox_admin_js_object.langs.UPGRADE_TO_X_PLAN,f=wp.i18n.sprintf(s,a),t.querySelector(".fpf-button span").innerHTML=f,l=fbox_admin_js_object.langs.PRO_MODAL_PERCENTAGE_OFF,p=wp.i18n.sprintf(l,"free"===o?fbox_admin_js_object.langs.LITE:o.charAt(0).toUpperCase()+o.slice(1)),t.querySelector(".pro-only-bonus").innerHTML=p,(c=t.querySelector("[data-href]"))&&(u=c.dataset.href,n&&(u+="&utm_content="+n.replace(/[\s\/\-]+/g,"-").toLowerCase()),a&&(u=wp.i18n.sprintf(u,a.toLowerCase())),fbox_admin_js_object.license_key&&""!==fbox_admin_js_object.license_key.trim()&&(u+="&key="+encodeURIComponent(fbox_admin_js_object.license_key)),c.setAttribute("href",u)))},e}();document.addEventListener("DOMContentLoaded",function(e){new FireBox_Upgrade_To_Plan_Modal});

