!function(t){"use strict";var e={selector:null,size:null,container:null,frame:function(){return this._frame||(this._frame=wp.media({title:"Media",button:{text:"Update"},multiple:!1}),this._frame.on("open",this.updateFrame).state("library").on("select",this.select)),this._frame},select:function(){var i=t("#custom-image-upload"),a=i.find(".idt-custom-imageupload"),n=i.find("img"),u=e.frame().state().get("selection").first().toJSON();n.attr("src",u.url),a.val(u.url)},init:function(){var i=t("#custom-image-upload");i.on("click","#add-image",(function(t){t.preventDefault(),e.frame().open()})),i.on("click","#remove-image",(function(e){var i=t("#custom-image-upload"),a=i.find(".idt-custom-imageupload"),n=i.find("img");e.preventDefault(),a.val(""),n.attr("src",n.data("default"))}))}};t(document).ready((function(){e.init()}))}(jQuery);