document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("ftm_custom_profile_picture_button"),t=document.getElementById("ftm_custom_profile_picture_url"),n=document.getElementById("ftm_custom_profile_picture_preview");e.addEventListener("click",(function(e){e.preventDefault();var o=wp.media({title:"Upload Image",multiple:!1}).open().on("select",(function(){var e=o.state().get("selection").first().toJSON().url;console.log(e),t.value=e,n.src=e}))}))}));