var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,d,c){a instanceof String&&(a=String(a));for(var f=a.length,e=0;e<f;e++){var g=a[e];if(d.call(c,g,e,a))return{i:e,v:g}}return{i:-1,v:void 0}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,d,c){a!=Array.prototype&&a!=Object.prototype&&(a[d]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};
$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,d,c,f){if(d){c=$jscomp.global;a=a.split(".");for(f=0;f<a.length-1;f++){var e=a[f];e in c||(c[e]={});c=c[e]}a=a[a.length-1];f=c[a];d=d(f);d!=f&&null!=d&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:d})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6-impl","es3");
(function(a){function d(b){(b||a(".document-gallery[data-icon-width]")).each(function(){var b=a(this).data("icon-width");"undefined"!==typeof b&&a(this).find(".document-icon").width(b+"%")})}function c(){l&&tinymce.PluginManager.add("dg",function(b,c){b.on("LoadContent update.dg undo",function(b){a(b.target.contentDocument).find('[data-wpview-type="dg"] [data-shortcode]').each(function(){g("object"===typeof a(this).data("shortcode")?a(this).data("shortcode"):JSON.parse(decodeURIComponent(a(this).data("shortcode"))),
a(this))})})})}function f(){a("body").delegate(".dg-paginate-wrapper .paginate a","click",function(b){var c=a(this).closest(".dg-paginate-wrapper"),d=c.data("shortcode");d.skip=0;var e=a(this).attr("href").split("#")[1].split("=");2<=e.length&&(d.skip=d.limit*(e.pop()-1));g(d,c,function(b){var c=a("#wpadminbar").height()||0;b=b.offset().top-c;a(document).scrollTop()>b&&a("html, body").animate({scrollTop:b-20},"slow")});b.preventDefault()})}function e(){h=[];k=0;a(".document-gallery img[data-id]").each(function(){var b=
a(this).data("id");-1===a.inArray(b,h)&&h.push(b)});m()}function g(b,c,f){"undefined"===typeof b.id&&(b.id=wp.media.dgDefaults.id);a.post(ajaxurl,{action:"dg_generate_gallery",atts:b},function(b){b=a(a.parseHTML(b));l&&!n&&b.find(p).length&&(n=!0,a("#insert-media-button").trigger("ready.dg"));var g=c.attr("id");b.attr("id",g);c.replaceWith(b);c=a("#"+g);d(c);e();"undefined"!==typeof f&&f(c)})}function m(){for(var b=[];k<h.length&&4!==b.length;k++)b.push(h[k]);0!==b.length&&a.ajax({type:"POST",url:ajaxurl,
dataType:"json",data:{action:"dg_generate_icons",ids:b},success:q,error:function(a){console.error(a.responseText)}})}function q(b){for(var c in b)if(b.hasOwnProperty(c)){var d=a('.document-gallery img[data-id="'+c+'"]');d.removeAttr("data-id");(function(c,d){d.fadeOut("fast",function(){a(this).attr("src",b[c]);a(this).fadeIn("fast")})})(c,d)}m()}var h,k,l,p='.document-gallery [data-ext="'+"doc docx ppt pptx xls xlsx pub vsd vsdx".split(" ").join('"],[data-ext="')+'"]',n=!1;a(document).ready(function(){l=
"undefined"!==typeof tinymce;d();e();c();f()})})(jQuery);
