/*! For license information please see subscriptions-empty-state.js.LICENSE.txt */
(()=>{var e={1020(e,t,r){"use strict";var s=r(1609),o=Symbol.for("react.element"),n=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),c=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,r){var s,a={},p=null,_=null;for(s in void 0!==r&&(p=""+r),void 0!==t.key&&(p=""+t.key),void 0!==t.ref&&(_=t.ref),t)n.call(t,s)&&!i.hasOwnProperty(s)&&(a[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===a[s]&&(a[s]=t[s]);return{$$typeof:o,type:e,key:p,ref:_,props:a,_owner:c.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}},t={};function r(s){var o=t[s];if(void 0!==o)return o.exports;var n=t[s]={exports:{}};return e[s](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{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 s=t.getElementsByTagName("script");if(s.length)for(var o=s.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=s[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);const e=window.wp.i18n,t=window.wp.element,s=window.wp.components,o=window.wp.domReady;var n=r.n(o);const c=(e,t={})=>{if(window.wcpaySettings){Object.assign(t,{is_test_mode:wcpaySettings.testMode,jetpack_connected:wcpaySettings.isJetpackConnected,wcpay_version:wcpaySettings.version,woo_country_code:wcpaySettings.connect.country,hosting_provider:wcpaySettings.trackingInfo?.hosting_provider});for(const e in t)void 0===t[e]&&delete t[e]}n()(()=>{(wc?.tracks?.recordEvent??wcTracks.recordEvent)(e,t)})},i=r.p+"../assets/images/subscriptions-empty-state-unconnected.svg?ver=4b933b521c687a443831";var a=r(4848);const{wcpay:{connectUrl:p,isConnected:_,newProductUrl:u}}=window,d=()=>(0,a.jsx)("img",{src:i,alt:""}),l=()=>(0,a.jsx)("p",{className:"woo_subscriptions_empty_state__description",children:(0,e.sprintf)((0,e.__)("Track recurring revenue and manage active subscriptions directly from your store’s dashboard — powered by %s.","woocommerce-payments"),"WooPayments")}),w=()=>(0,a.jsx)("p",{className:"wcpay-empty-subscriptions__tos",children:(0,t.createInterpolateElement)((0,e.__)('By clicking "Finish setup", you agree to the <a>Terms of Service</a>',"woocommerce-payments"),{a:(0,a.jsx)("a",{href:"https://wordpress.com/tos/",target:"_blank",rel:"noreferrer"})})}),y=()=>{const[r,o]=(0,t.useState)(!1),[n,i]=(0,t.useState)(!1);return(0,a.jsxs)("div",{className:"woo_subscriptions_empty_state__button_container",children:[(0,a.jsx)(s.Button,{disabled:r,href:p,isBusy:r,variant:"primary",onClick:()=>{c("wcpay_subscriptions_empty_state_finish_setup"),o(!0)},__next40pxDefaultSize:!0,children:(0,e.__)("Finish setup","woocommerce-payments")}),(0,a.jsx)(s.Button,{disabled:n,href:u,isBusy:n,variant:"secondary",onClick:()=>{c("wcpay_subscriptions_empty_state_create_product"),i(!0)},__next40pxDefaultSize:!0,children:(0,e.__)("Create subscription product","woocommerce-payments")})]})},m=()=>(0,a.jsxs)("div",{className:"woo_subscriptions_empty_state__container",children:[(0,a.jsx)(d,{}),(0,a.jsx)(l,{}),(0,a.jsx)(w,{}),(0,a.jsx)(y,{})]}),f=document.querySelector("#woo_subscriptions_empty_state");f&&(c("wcpay_subscriptions_empty_state_view",{is_connected:_?"yes":"no"}),_||(0,t.render)((0,a.jsx)(m,{}),f))})()})();