(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[48],{507:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var i=c(7);function o(e){const{createNotice:t}=Object(i.dispatch)("core/notices");e.error_data&&e.errors&&Object.keys(e.errors).length?Object.keys(e.errors).forEach(c=>{t("error",e.errors[c].join(" "))}):e.message&&t(e.code?"error":"success",e.message)}},537:function(e,t,c){"use strict";var i=Object.assign||function(e){for(var t,c=1;cnull)})=>{const{updateOptions:c}=Object(n.useDispatch)(j.OPTIONS_STORE_NAME),s=Object(i.useContext)(N),M=()=>{t(),c({[s]:"yes"})};return Object(i.createElement)(r.CardHeader,null,Object(i.createElement)("div",{className:"woocommerce-dismissable-list__header"},e),Object(i.createElement)("div",null,Object(i.createElement)(a.EllipsisMenu,{label:Object(o.__)("Task List Options",'woocommerce'),renderContent:()=>Object(i.createElement)("div",{className:"woocommerce-dismissable-list__controls"},Object(i.createElement)(r.Button,{onClick:M},Object(o.__)("Hide this",'woocommerce')))})))},g=({children:e,className:t,dismissOptionName:c})=>Object(n.useSelect)(e=>{const{getOption:t,hasFinishedResolution:i}=e(j.OPTIONS_STORE_NAME),o=i("getOption",[c]),n="yes"===t(c);return o&&!n})?Object(i.createElement)(r.Card,{size:"medium",className:l()("woocommerce-dismissable-list",t)},Object(i.createElement)(N.Provider,{value:c},e)):null;var S=c(13),y=(c(588),c(589)),E=c.n(y);var T=({onSetupClick:e,pluginsBeingSetup:t})=>{Object(S.f)("wcAdminAssetUrl","");const{createSuccessNotice:c}=Object(n.useDispatch)("core/notices"),s=Object(n.useSelect)(e=>e(j.PLUGINS_STORE_NAME).isJetpackConnected());return Object(i.createElement)("div",{className:"woocommerce-list__item-inner woocommerce-services-item"},Object(i.createElement)("div",{className:"woocommerce-list__item-before"},Object(i.createElement)("img",{className:"woocommerce-services-item__logo",src:E.a,alt:""})),Object(i.createElement)("div",{className:"woocommerce-list__item-text"},Object(i.createElement)("span",{className:"woocommerce-list__item-title"},Object(o.__)("Woocommerce Shipping",'woocommerce'),Object(i.createElement)(a.Pill,null,Object(o.__)("Recommended",'woocommerce'))),Object(i.createElement)("span",{className:"woocommerce-list__item-content"},Object(o.__)("Print USPS and DHL Express labels straight from your WooCommerce dashboard and save on shipping.",'woocommerce'),Object(i.createElement)("br",null),Object(i.createElement)(r.ExternalLink,{href:"https://woocommerce.com/woocommerce-shipping/"},Object(o.__)("Learn more",'woocommerce')))),Object(i.createElement)("div",{className:"woocommerce-list__item-after"},Object(i.createElement)(r.Button,{isSecondary:!0,onClick:()=>{e(["woocommerce-services"]).then(()=>{const e=[];s||e.push({url:Object(S.e)("plugins.php"),label:Object(o.__)("Finish the setup by connecting your store to Jetpack.",'woocommerce')}),c(Object(o.__)("🎉 WooCommerce Shipping is installed!",'woocommerce'),{actions:e})})},isBusy:t.includes("woocommerce-services"),disabled:t.length>0},Object(o.__)("Get started",'woocommerce'))))};c(590);const d=({children:e})=>Object(i.createElement)(g,{className:"woocommerce-recommended-shipping-extensions",dismissOptionName:"woocommerce_settings_shipping_recommendations_hidden"},Object(i.createElement)(O,null,Object(i.createElement)(s.Text,{variant:"title.small",as:"p",size:"20",lineHeight:"28px"},Object(o.__)("Recommended shipping solutions",'woocommerce')),Object(i.createElement)(s.Text,{className:"woocommerce-recommended-shipping__header-heading",variant:"caption",as:"p",size:"12",lineHeight:"16px"},Object(o.__)('We recommend adding one of the following shipping extensions to your store. The extension will be installed and activated for you when you click "Get started".','woocommerce'))),Object(i.createElement)("ul",{className:"woocommerce-list"},i.Children.map(e,e=>Object(i.createElement)("li",{className:"woocommerce-list__item"},e))),Object(i.createElement)(r.CardFooter,null,Object(i.createElement)(r.Button,{className:"woocommerce-recommended-shipping-extensions__more_options_cta",href:"https://woocommerce.com/product-category/woocommerce-extensions/shipping-methods/?utm_source=shipping_recommendations",target:"_blank",isTertiary:!0},Object(o.__)("See more options",'woocommerce'),Object(i.createElement)(r.VisuallyHidden,null,Object(o.__)("(opens in a new tab)",'woocommerce')),Object(i.createElement)(u.a,{size:18}))));t.default=()=>{const[e,t]=(()=>{const[e,t]=Object(i.useState)([]),{installAndActivatePlugins:c}=Object(n.useDispatch)(j.PLUGINS_STORE_NAME);return[e,i=>e.length>0?Promise.resolve():(t(i),c(i).then(()=>{t([])}).catch(e=>(Object(m.a)(e),t([]),Promise.reject())))]})();return Object(n.useSelect)(e=>e(j.PLUGINS_STORE_NAME).getActivePlugins()).includes("woocommerce-services")?null:Object(i.createElement)(d,null,Object(i.createElement)(T,{pluginsBeingSetup:e,onSetupClick:t}))}}}]);