var FPF_Pro_Modal=function(){function e(){this.modal=document.querySelector("#fpfUpgradeToPro"),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=e.detail.initiator,r=t.getAttribute("data-fpf-modal");if(r){var o=document.querySelector(".fpf-modal > .modal"+r);if(o){var n=t.getAttribute("data-fpf-modal-item")||!1,a=t.getAttribute("data-current-plan")||fbox_admin_js_object.langs.FREE,i=t.getAttribute("data-upgrade-plan")||"pro",d=fbox_admin_js_object.langs.PRO_MODAL_IS_PRO_FEATURE,l=wp.i18n.sprintf(d,n);o.querySelector(".po-feature h2").innerHTML=l;var s=fbox_admin_js_object.langs.PRO_MODAL_WERE_SORRY,p=wp.i18n.sprintf(s,n);o.querySelector(".po-feature p").innerHTML=p;var f=fbox_admin_js_object.langs.PRO_MODAL_PERCENTAGE_OFF,u=wp.i18n.sprintf(f,"free"===a.toLowerCase()?fbox_admin_js_object.langs.LITE:a.charAt(0).toUpperCase()+a.slice(1));o.querySelector(".pro-only-bonus").innerHTML=u,n?(o.querySelector(".po-feature").style.display="",o.querySelector(".po-upgrade").style.display="none"):(o.querySelector(".po-feature").style.display="none",o.querySelector(".po-upgrade").style.display="");var _=o.querySelector("[data-href]");if(_){var c=_.dataset.href;n&&(c+="&utm_content="+n.replace(/[\s\/\-]+/g,"-").toLowerCase()),i&&(c=wp.i18n.sprintf(c,i.toLowerCase())),_.setAttribute("href",c)}}}},e}();document.addEventListener("DOMContentLoaded",function(e){new FPF_Pro_Modal});

