!function(e,n){for(var t in n)e[t]=n[t]}(window,function(e){function n(i){if(t[i])return t[i].exports;var c=t[i]={i:i,l:!1,exports:{}};return e[i].call(c.exports,c,c.exports,n),c.l=!0,c.exports}var t={};return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)n.d(i,c,function(n){return e[n]}.bind(null,c));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=0)}([function(){!function(e){function n(){l.prop("disabled",!0)}function t(){l.prop("disabled",!1)}function i(){k.hide(),a("confirm_safe_mode"),n(),e.ajax({method:"POST",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",s)},url:f+"jetpack/v4/identity-crisis/confirm-safe-mode",data:{},success:function(){u.hide(),_.removeClass("hide"),window.location.search&&1===window.location.search.indexOf("page=jetpack")&&window.location.reload()},error:function(e){b="confirm",r(e),t()}})}function c(){k.hide(),a("migrate"),n(),e.ajax({method:"POST",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",s)},url:f+"jetpack/v4/identity-crisis/migrate",data:{},success:function(){u.hide(),e("body").hasClass("toplevel_page_jetpack")&&window.location.reload(!0)},error:function(e){b="migrate",r(e),t()}})}function o(){k.hide(),a("start_fresh"),n(),e.ajax({method:"POST",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",s)},url:f+"jetpack/v4/identity-crisis/start-fresh",data:{},success:function(e){window.location=e+"&from=idc-notice"},error:function(e){b="start-fresh",r(e),t()}})}function r(n){var t=e(".jp-idc-error__desc");n&&n.responseJSON&&n.responseJSON.message?t.html(n.responseJSON.message):t.html(""),k.css("display","flex")}function a(e,n){(void 0===n||"object"!=typeof n)&&(n={}),e&&e.length&&"undefined"!=typeof analytics&&analytics.tracks&&analytics.mc&&(e=0===(e=e.replace(/-/g,"_")).indexOf("jetpack_idc_")?e:"jetpack_idc_"+e,analytics.tracks.recordEvent(e,n),e=(e=e.replace("jetpack_idc_","")).replace(/_/g,"-"),analytics.mc.bumpStat("jetpack-idc",e))}var s=idcL10n.nonce,d=idcL10n.currentUrl,f=idcL10n.apiRoot,u=e(".jp-idc-notice"),l=e(".jp-idc-notice .dops-button"),p=idcL10n.tracksUserData,m=idcL10n.tracksEventData,_=e("#wp-admin-bar-jetpack-idc"),j=e("#jp-idc-confirm-safe-mode-action"),h=e("#jp-idc-fix-connection-action"),y=e("#jp-idc-migrate-action"),w=e("#jp-idc-reconnect-site-action"),k=e(".jp-idc-error__notice"),b=!1;"undefined"!=typeof analytics&&analytics.initialize(p.userid,p.username),m.isAdmin?a("notice_view"):a("non_admin_notice_view",{page:m.currentScreen}),function(e){e=void 0!==e&&e,window.location.search&&-1!==window.location.search.indexOf("jetpack_idc_clear_confirmation")&&(a("clear_confirmation_clicked"),history&&history.pushState?history.pushState({},"",d):e&&(window.location.href=d))}(),u.on("click",".notice-dismiss",(function(){var e="https:"===window.location.protocol;wpCookies.set("jetpack_idc_dismiss_notice","1",604800,!1,!1,e),a("non_admin_notice_dismiss",{page:m.currentScreen})})),u.on("click","#jp-idc-error__action",(function(){switch(k.hide(),b){case"confirm":i();break;case"start-fresh":o();break;case"migrate":c()}})),j.on("click",i),h.on("click",(function(){k.hide(),a("fix_connection"),u.addClass("jp-idc-show-second-step")})),w.on("click",o),y.on("click",c)}(jQuery)}]));