Files
2026-04-28 15:13:50 +02:00

2 lines
3.9 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*! 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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(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(/#.*$/,"").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()((()=>{var r;(null!==(r=wc?.tracks?.recordEvent)&&void 0!==r?r: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:""}),w=()=>(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 stores dashboard — powered by %s.","woocommerce-payments"),"WooPayments")}),l=()=>(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)(w,{}),(0,a.jsx)(l,{}),(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))})()})();