window.wp=window.wp||{};(function(c){var x,n,k,t,q,j,v,m=/\s?\bwp-format-[^ ]+/g,g=120,s=360,u="standard",b="short-format",e=["status"],i=["status","aside","image","audio","video"],f=["status","aside"],d=["standard","chat","status","aside","gallery"];function w(B,z){var A=c("#"+B.settings.drop_element+" .media-progress-bar div");A.width(z.percent+"%")}function a(z){c("#"+z.settings.drop_element+" .wp-format-media-select").append('
')}function r(){c(".media-progress-bar",c(".wp-format-media-holder[data-format=image]")).remove()}function l(C){var B,A,z=wp.media.string.image({size:"full",align:false,link:getUserSetting("urlbutton")},C.attributes);B=c(".wp-format-media-holder[data-format=image]");c(".media-progress-bar",B).remove();if("image"!==C.attributes.type){return}A=c("#wp_format_"+B.data("format"));A.val(z);c("#image-preview").remove();B.parent().prepend(['
','","
"].join(""))}var p={dropzone:c(".wp-format-media-holder[data-format=image]"),success:l,error:r,plupload:{},params:{}};p=new wp.Uploader(p);p.uploader.bind("BeforeUpload",a);p.uploader.bind("UploadProgress",w);function y(z){q.val(z);c.each([k,t,j],function(B,A){A.prop("className",A.prop("className").replace(m,"")).addClass("wp-format-"+z)})}function h(C,A){var z,B=c("#content, #content_ifr");z=B.outerHeight();if(g600){F=600}I+=' width="'+F+'"'}if(L.height){H=L.height;if(L.width&&F<'+K+I+' class="wp-'+K+'-shortcode" controls="controls" preload="none">");c(".wp-"+K+"-shortcode").mediaelementplayer()};x.on("select",function(){var F=0,H=0,G,I=x.state().get("selection").first().toJSON();if(0===I.mime.indexOf("audio")){A.val(I.url);B(I)}else{if(0===I.mime.indexOf("video")){I.src=I.url;A.val(wp.shortcode.string({tag:"video",attrs:_.pick(I,"src","width","height")}));B(I)}else{G=wp.media.string.image({size:"full",align:false,link:getUserSetting("urlbutton")},I);A.val(G);c("#image-preview").remove();if(I.width){F=I.width>600?600:I.width}if(I.height){H=I.height}if(F','",""].join(""))}}});x.open()})})}(jQuery));