!function(t){"use strict";var n={init:function(){var n=this;t(document).ready((function(){n.addGutenbergSyncButton()}))},addGutenbergSyncButton:function(){if("undefined"==typeof wp||void 0===wp.data)return!1;var n=t(".interface-interface-skeleton__sidebar .edit-post-sidebar");if(n.length||(n=t(".edit-post-sidebar")),n.length||(n=t(".editor-sidebar")),n.length||(n=t(".interface-complementary-area")),n.length||(n=t(".interface-interface-skeleton__sidebar")),n.length&&!t("#rsl-ie-sync-content-btn").length){var e,o,i,a,d=t("<div>").addClass("components-panel__body rsl-ie-gutenberg-sync-panel is-opened").attr("id","rsl-ie-gutenberg-sync-panel"),r=t("<h2>").addClass("components-panel__body-title").html('<button type="button" class="components-button components-panel__body-toggle" aria-expanded="true"><span aria-hidden="true"><svg class="components-panel__arrow" width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"></path></svg></span>'+((null===(e=window.rslIeData)||void 0===e||null===(o=e.i18n)||void 0===o?void 0:o.syncContent)||"Sync Content")+"</button></h2>"),s=t("<div>").css({padding:"16px"}),l=t("<button>").attr("type","button").attr("id","rsl-ie-sync-content-btn").addClass("button button-secondary").css("width","100%").html((null===(i=window.rslIeData)||void 0===i||null===(a=i.i18n)||void 0===a?void 0:a.syncThisPost)||"Sync This Post");s.append(l),d.append(r,s);var u=n.find(".components-panel__body").first();return u.length?u.after(d):n.prepend(d),r.find("button").on("click",(function(){var n=t(this),e=n.closest(".components-panel__body"),o="true"===n.attr("aria-expanded");n.attr("aria-expanded",!o),e.toggleClass("is-opened"),s.slideToggle(200)})),!0}return!1},retryAddButton:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!(n>=10||this.addGutenbergSyncButton())){var e=500*Math.pow(1.5,n);setTimeout((function(){return t.retryAddButton(n+1)}),e)}}};n.init(),setTimeout((function(){return n.retryAddButton()}),1e3)}(jQuery);
//# sourceMappingURL=gutenberg-sync.js.map