/*! For license information please see wc-payments-test-to-live-notice.js.LICENSE.txt */
(()=>{var e={4788(e,t,r){"use strict";t.A=function(e){var t=e.size,r=void 0===t?24:t,n=e.onClick,c=(e.icon,e.className),a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],0<=t.indexOf(r)||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,i),l=["gridicon","gridicons-cross-small",c,!1,!1,!1].filter(Boolean).join(" ");return o.default.createElement("svg",s({className:l,height:r,width:r,onClick:n},a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),o.default.createElement("g",null,o.default.createElement("path",{d:"M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z"})))};var n,o=(n=r(1609))&&n.__esModule?n:{default:n},i=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},s.apply(this,arguments)}},9031(e,t,r){"use strict";t.A=function(e){var t=e.size,r=void 0===t?24:t,n=e.onClick,c=(e.icon,e.className),a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],0<=t.indexOf(r)||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,i),l=["gridicon","gridicons-notice-outline",c,!!function(e){return 0==e%18}(r)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return o.default.createElement("svg",s({className:l,height:r,width:r,onClick:n},a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),o.default.createElement("g",null,o.default.createElement("path",{d:"M12 4c4.411 0 8 3.589 8 8s-3.589 8-8 8-8-3.589-8-8 3.589-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))};var n,o=(n=r(1609))&&n.__esModule?n:{default:n},i=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},s.apply(this,arguments)}},5588(e,t,r){"use strict";t.A=function(e){var t=e.size,r=void 0===t?24:t,n=e.onClick,c=(e.icon,e.className),a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],0<=t.indexOf(r)||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,i),l=["gridicon","gridicons-notice",c,!!function(e){return 0==e%18}(r)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return o.default.createElement("svg",s({className:l,height:r,width:r,onClick:n},a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),o.default.createElement("g",null,o.default.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2l-.5-6h3l-.5 6z"})))};var n,o=(n=r(1609))&&n.__esModule?n:{default:n},i=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},s.apply(this,arguments)}},5338(e,t,r){"use strict";var n=r(5795);t.H=n.createRoot,n.hydrateRoot},1020(e,t,r){"use strict";var n=r(1609),o=Symbol.for("react.element"),i=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,r){var n,a={},l=null,u=null;for(n in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,n)&&!c.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:o,type:e,key:l,ref:u,props:a,_owner:s.current}}t.jsx=a,t.jsxs=a},4848(e,t,r){"use strict";e.exports=r(1020)},1609(e){"use strict";e.exports=window.React},5795(e){"use strict";e.exports=window.ReactDOM}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),r.p=window.wcpayAssets.url,(()=>{"use strict";r(1609);var e=r(5338);const t=window.wp.i18n,n=window.wp.element,o=window.wp.a11y;function i(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=i(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}const s=window.wp.primitives;var c=r(4848);const a=(0,c.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(s.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),l=(0,c.jsx)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(s.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})});var u=r(9031),p=r(5588),f=r(4788);const m=window.wp.components,d={success:a,error:p.A,warning:u.A,info:l},w=({icon:e,children:r,actions:s=[],className:a,status:l="info",isDismissible:u=!0,onRemove:p})=>{((e,t)=>{const r="string"==typeof t?t:(0,n.renderToString)(t),i="error"===e?"assertive":"polite";(0,n.useEffect)(()=>{r&&(0,o.speak)(r,i)},[r,i])})(l,r);const w=!0===e?d[l]:e,v=function(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=i(e))&&(n&&(n+=" "),n+=t);return n}(a,"wcpay-banner-notice","is-"+l);return(0,c.jsxs)("div",{className:v,children:[w&&(0,c.jsx)(m.Icon,{icon:w,className:"wcpay-banner-notice__icon"}),(0,c.jsxs)("div",{className:"wcpay-banner-notice__content",children:[r,s.length>0&&(0,c.jsx)("div",{className:"wcpay-banner-notice__actions",children:s.map(({className:e,label:t,variant:r,onClick:n,url:o,urlTarget:i},s)=>{let a=r;return"primary"!==r&&(a=o?"link":"secondary"),(0,c.jsx)(m.Button,{href:o,variant:a,onClick:o?void 0:n,className:e,target:i,__next40pxDefaultSize:!0,children:t},s)})})]}),u&&(0,c.jsx)(m.Button,{className:"wcpay-banner-notice__dismiss",icon:f.A,label:(0,t.__)("Dismiss this notice","woocommerce-payments"),onClick:()=>p?.(),showTooltip:!1,__next40pxDefaultSize:!0})]})},v=()=>{const e=window.wcpayTestToLiveNoticeSettings?.ctaUrl??"",r=window.wcpayTestToLiveNoticeSettings?.dismissUrl??"",o=window.wcpayTestToLiveNoticeSettings?.snoozeUrl??"";return(0,c.jsx)(w,{status:"success",icon:!0,isDismissible:!0,onRemove:()=>{window.location.href=r},actions:[{label:(0,t.__)("Turn on live payments","woocommerce-payments"),variant:"primary",url:e},{label:(0,t.__)("Maybe later","woocommerce-payments"),variant:"link",url:o}],children:(0,n.createInterpolateElement)((0,t.__)("<strong>You're ready to take real payments.</strong> Switch from test mode to start charging customers.","woocommerce-payments"),{strong:(0,c.jsx)("strong",{})})})},y="wcpay-test-to-live-notice";let h=null,g=null;const b=()=>{if(h&&document.body.contains(h))return;if(g){try{g.unmount()}catch{}g=null,h=null}let t=document.getElementById(y);if(!t){t=document.createElement("div"),t.id=y;const e=document.querySelector("#mainform .subsubsub"),r=document.querySelector("#mainform .woo-nav-tab-wrapper"),n=e??r;if(n)n.after(t);else{const e=document.querySelector(".woocommerce-layout__main")??document.querySelector("#wpbody-content .wrap");if(!e)return;const r=e.querySelector(".nav-tab-wrapper"),n=e.querySelector(".wp-header-end"),o=r??n;o?o.after(t):e.prepend(t)}}g=(0,e.H)(t),g.render((0,c.jsx)(v,{})),h=t},O=new MutationObserver(b),_=document.getElementById("wpbody-content")??document.body;O.observe(_,{childList:!0,subtree:!0}),b()})()})();