← Back
Editing: wc-payments-post-kyc-activation-notice.js
(()=>{var e={9572(e,t,n){"use strict";t.A=function(e){var t=e.size,n=void 0===t?24:t,r=e.onClick,a=(e.icon,e.className),l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),c=["gridicon","gridicons-cross-small",a,!1,!1,!1].filter(Boolean).join(" ");return o.default.createElement("svg",s({className:c,height:n,width:n,onClick:r},l,{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 r,o=(r=n(1609))&&r.__esModule?r:{default:r},i=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},s.apply(this,arguments)}},8295(e,t,n){"use strict";t.A=function(e){var t=e.size,n=void 0===t?24:t,r=e.onClick,a=(e.icon,e.className),l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),c=["gridicon","gridicons-notice-outline",a,!!function(e){return 0==e%18}(n)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return o.default.createElement("svg",s({className:c,height:n,width:n,onClick:r},l,{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 r,o=(r=n(1609))&&r.__esModule?r:{default:r},i=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},s.apply(this,arguments)}},9044(e,t,n){"use strict";t.A=function(e){var t=e.size,n=void 0===t?24:t,r=e.onClick,a=(e.icon,e.className),l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),c=["gridicon","gridicons-notice",a,!!function(e){return 0==e%18}(n)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return o.default.createElement("svg",s({className:c,height:n,width:n,onClick:r},l,{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 r,o=(r=n(1609))&&r.__esModule?r:{default:r},i=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},s.apply(this,arguments)}},1609(e){"use strict";e.exports=window.React}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),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 r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.p=window.wcpayAssets.url,(()=>{"use strict";n(1609);const e=window.ReactDOM,t=window.wp.i18n,r=window.wp.element,o=window.wp.a11y;function i(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=i(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}const s=window.wp.primitives,a=window.ReactJSXRuntime,l=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.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"})}),c=(0,a.jsx)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,a.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=n(8295),m=n(9044),p=n(9572);const d=window.wp.components,f={success:l,error:m.A,warning:u.A,info:c},w=({icon:e,children:n,actions:s=[],className:l,status:c="info",isDismissible:u=!0,onRemove:m})=>{((e,t)=>{const n="string"==typeof t?t:(0,r.renderToString)(t),i="error"===e?"assertive":"polite";(0,r.useEffect)(()=>{n&&(0,o.speak)(n,i)},[n,i])})(c,n);const w=!0===e?f[c]:e,h=function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=i(e))&&(r&&(r+=" "),r+=t);return r}(l,"wcpay-banner-notice","is-"+c);return(0,a.jsxs)("div",{className:h,children:[w&&(0,a.jsx)(d.Icon,{icon:w,className:"wcpay-banner-notice__icon"}),(0,a.jsxs)("div",{className:"wcpay-banner-notice__content",children:[n,s.length>0&&(0,a.jsx)("div",{className:"wcpay-banner-notice__actions",children:s.map(({className:e,label:t,variant:n,onClick:r,url:o,urlTarget:i},s)=>{let l=n;return"primary"!==n&&(l=o?"link":"secondary"),(0,a.jsx)(d.Button,{href:o,variant:l,onClick:o?void 0:r,className:e,target:i,__next40pxDefaultSize:!0,children:t},s)})})]}),u&&(0,a.jsx)(d.Button,{className:"wcpay-banner-notice__dismiss",icon:p.A,label:(0,t.__)("Dismiss this notice","woocommerce-payments"),onClick:()=>m?.(),showTooltip:!1,__next40pxDefaultSize:!0})]})},h={7:(0,t.__)("<strong>Your store is open. Now bring in your first customer.</strong> Share your store link with your network, on social, or by email to spread the word.","woocommerce-payments"),14:(0,t.__)("<strong>Two weeks on, still no first sale?</strong> Most first sales come from word of mouth or social shares. If you've already tried those, marketing tools can help reach a wider audience.","woocommerce-payments"),30:(0,t.__)("<strong>A month in. Let's get your first sale.</strong> If organic sharing hasn't worked, marketing tools can help: paid ads, email campaigns, or SEO improvements usually move the needle.","woocommerce-payments")},g=()=>{const{stage:e,ctaUrl:n,dismissUrl:o}=window.wcpayPostKycActivationNoticeSettings??{},i=e?h[e]:null;return i?(0,a.jsx)(w,{status:"info",isDismissible:!0,onRemove:()=>{window.location.href=o??""},actions:[{label:(0,t.__)("Promote my store","woocommerce-payments"),variant:"primary",url:n??""}],children:(0,r.createInterpolateElement)(i,{strong:(0,a.jsx)("strong",{})})}):null},v="wcpay-post-kyc-activation-notice";let y=null,b=null;const O=()=>{if(y&&document.body.contains(y))return;if(b){try{b.unmount()}catch{}b=null,y=null}let t=document.getElementById(v);if(!t){t=document.createElement("div"),t.id=v;const e=document.querySelector("#mainform .subsubsub"),n=document.querySelector("#mainform .woo-nav-tab-wrapper"),r=e??n;if(r)r.after(t);else{const e=document.querySelector(".woocommerce-layout__main")??document.querySelector("#wpbody-content .wrap");if(!e)return;const n=e.querySelector(".nav-tab-wrapper"),r=e.querySelector(".wp-header-end"),o=n??r;o?o.after(t):e.prepend(t)}}b=(0,e.createRoot)(t),b.render((0,a.jsx)(g,{})),y=t},j=new MutationObserver(O),x=document.getElementById("wpbody-content")??document.body;j.observe(x,{childList:!0,subtree:!0}),O()})()})();
Save File
Cancel