!function(n){"use strict";n(document).ready(function(){var e="single";default_global_customization_type&&(e="global"),0==n("body").hasClass("post-type-attachment")&&0<n("#postbox-container-1").length&&(n(document).on("click",".yp-btn",function(){var o=null;0<n("#sample-permalink a").length&&(o=n("#sample-permalink a").attr("href")),null!=o&&null!=o&&""!=o||(o=n("#post-preview").attr("href")),n(window).off("beforeunload.edit-post"),wp.autosave.server.tempBlockSave(),n("form#post").submit(),-1!=o.indexOf("://")&&(o=o.split("://")[1]);var t=n("#post_ID").val();o="admin.php?page=yellow-pencil-editor&href="+encodeURIComponent(o)+"&yp_page_id="+t+"&yp_page_type="+typenow+"&yp_mode="+e,window.open(o,"_blank")}),n("#postbox-container-1").prepend("<a class='yp-btn'><span class='dashicons dashicons-admin-appearance'></span>Edit Page - YellowPencil</a>")),n("body").hasClass("block-editor-page")&&(window.ypLoaderBlock=setInterval(function(){0<n(".edit-post-header-toolbar").length&&(clearInterval(window.ypLoaderBlock),n(document).on("click",".yp-btn",function(){0<n(".editor-post-save-draft").length&&n(".editor-post-save-draft").trigger("click");var o="admin.php?page=yellow-pencil-editor&href&yp_page_id="+n("#post_ID").val()+"&yp_page_type="+typenow+"&yp_mode="+e;window.open(o,"_blank")}),0<n(".edit-post-header-toolbar__block-toolbar").length?n(".edit-post-header-toolbar__block-toolbar").before("<button type='button' class='components-button components-icon-button yp-btn'><span class='dashicons dashicons-admin-appearance'></span></button>"):n(".edit-post-header-toolbar").append("<button type='button' class='components-button components-icon-button yp-btn'><span class='dashicons dashicons-admin-appearance'></span></button>"))},300))})}(jQuery);