403Webshell
Server IP : 172.67.158.161  /  Your IP : 3.147.55.69
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/giankuin/www/wp-content/plugins/woocommerce/packages/woocommerce-admin/dist/chunks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/giankuin/www/wp-content/plugins/woocommerce/packages/woocommerce-admin/dist/chunks/47.beecc03c8f2826f341f0.min.js
(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[47],{284:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n(5),c=n.n(o),r=n(34),i=n(28);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=window.location,o=n.pathname,c=n.search,a=Object(i.g)("connectNonce","");return t=s({"wccom-site":Object(i.g)("siteUrl"),"wccom-back":o+c,"wccom-woo-version":Object(i.g)("wcVersion"),"wccom-connect-nonce":a},t),Object(r.addQueryArgs)(e,t)}},746:function(e,t,n){"use strict";var o=n(756),c=["a","b","em","i","strong","p"],r=["target","href","rel","name","download"];t.a=function(e){return{__html:Object(o.sanitize)(e,{ALLOWED_TAGS:c,ALLOWED_ATTR:r})}}},763:function(e,t,n){},766:function(e,t,n){"use strict";n.d(t,"b",(function(){return g})),n.d(t,"a",(function(){return f}));var o=n(33),c=n.n(o),r=n(53),i=n.n(r),a=n(25),s=n.n(a),l=n(0),u=n(3),m=n(69),p=n(2),d=n(10),b=n(28),h=n(55),_=Object(b.g)("dataEndpoints",{countries:{}}).countries;function g(e){var t={};return e.addressLine1.length||(t.addressLine1=Object(u.__)("Please add an address",'woocommerce')),e.countryState.length||(t.countryState=Object(u.__)("Please select a country / region",'woocommerce')),e.city.length||(t.city=Object(u.__)("Please add a city",'woocommerce')),e.postCode.length||(t.postCode=Object(u.__)("Please add a post code",'woocommerce')),t}function f(e){var t=e.getInputProps,n=e.setValue,o=Object(d.useMemo)((function(){return _.reduce((function(e,t){if(!t.states.length)return e.push({key:t.code,label:Object(m.decodeEntities)(t.name)}),e;var n=t.states.map((function(e){return{key:t.code+":"+e.code,label:Object(m.decodeEntities)(t.name)+" β€” "+Object(m.decodeEntities)(e.name)}}));return e.push.apply(e,s()(n)),e}),[])}),[]),r=function(e,t,n){var o=Object(d.useState)(""),c=i()(o,2),r=c[0],a=c[1],s=Object(d.useState)(""),u=i()(s,2),m=u[0],b=u[1];return Object(d.useEffect)((function(){var o=[],c=new RegExp(Object(p.escapeRegExp)(r),"i");if((m.length||r.length)&&(o=e.filter((function(e){return c.test(e.label)}))),r.length&&m.length){var i=new RegExp(Object(p.escapeRegExp)(m.replace(/\s/g,"")),"i");if((o=o.filter((function(e){return i.test(e.label.replace("-","").replace(/\s/g,""))}))).length>1){var a;(a=o.filter((function(e){return c.test(e.key)}))).length>0&&(o=a)}if(o.length>1){var s;1===(s=o.filter((function(e){return i.test(e.key)}))).length&&(o=s)}}1===o.length&&t!==o[0].key&&n("countryState",o[0].key)}),[r,m]),Object(l.createElement)(l.Fragment,null,Object(l.createElement)("input",{onChange:function(e){return a(e.target.value)},value:r,name:"country",type:"text",className:"woocommerce-select-control__autofill-input",tabIndex:"-1",autoComplete:"country"}),Object(l.createElement)("input",{onChange:function(e){return b(e.target.value)},value:m,name:"state",type:"text",className:"woocommerce-select-control__autofill-input",tabIndex:"-1",autoComplete:"address-level1"}))}(o,t("countryState").value,n);return Object(l.createElement)("div",{className:"woocommerce-store-address-fields"},Object(l.createElement)(h.TextControl,c()({label:Object(u.__)("Address line 1",'woocommerce'),required:!0,autoComplete:"address-line1"},t("addressLine1"))),Object(l.createElement)(h.TextControl,c()({label:Object(u.__)("Address line 2 (optional)",'woocommerce'),required:!0,autoComplete:"address-line2"},t("addressLine2"))),Object(l.createElement)(h.SelectControl,c()({label:Object(u.__)("Country / Region",'woocommerce'),required:!0,options:o,excludeSelectedOptions:!1,showAllOnFocus:!0,isSearchable:!0},t("countryState"),{controlClassName:t("countryState").className}),r),Object(l.createElement)(h.TextControl,c()({label:Object(u.__)("City",'woocommerce'),required:!0},t("city"),{autoComplete:"address-level2"})),Object(l.createElement)(h.TextControl,c()({label:Object(u.__)("Post code",'woocommerce'),required:!0,autoComplete:"postal-code"},t("postCode"))))}},890:function(e,t,n){"use strict";var o=n(8),c=n(11),r=n(19),i=n(0),a=n(4),s=n.n(a),l=n(755),u=n(754);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var p={isBorderless:!1,isShady:!1,size:"medium"};t.a=function(e){var t=e.className,n=e.isShady,a=Object(r.a)(e,["className","isShady"]),d=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){Object(c.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},p,{},Object(u.b)(),{},e),b=d.isBorderless,h=d.size,_=s()("components-card__header",b&&"is-borderless",n&&"is-shady",h&&"is-size-".concat(h),t);return Object(i.createElement)(l.d,Object(o.a)({},a,{className:_}))}},902:function(e,t,n){"use strict";var o=n(8),c=n(19),r=n(0),i=n(4),a=n.n(i),s=n(2);t.a=function(e){var t=e.className,n=e.checked,i=e.id,l=e.onChange,u=void 0===l?s.noop:l,m=Object(c.a)(e,["className","checked","id","onChange"]),p=a()("components-form-toggle",t,{"is-checked":n});return Object(r.createElement)("span",{className:p},Object(r.createElement)("input",Object(o.a)({className:"components-form-toggle__input",id:i,type:"checkbox",checked:n,onChange:u},m)),Object(r.createElement)("span",{className:"components-form-toggle__track"}),Object(r.createElement)("span",{className:"components-form-toggle__thumb"}))}},927:function(e,t,n){"use strict";n.r(t);var o=n(25),c=n.n(o),r=n(13),i=n.n(r),a=n(12),s=n.n(a),l=n(14),u=n.n(l),m=n(15),p=n.n(m),d=n(6),b=n.n(d),h=n(0),_=n(3),g=n(185),f=n(4),O=n.n(f),y=n(90),j=n(759),k=n(920),w=n(890),v=n(921),S=n(24),E=n(452),P=n(51),C=Object(h.createElement)(P.c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(h.createElement)(P.b,{d:"M9 18.6L3.5 13l1-1L9 16.4l9.5-9.9 1 1z"})),N=n(789),x=n(2),T=n(55),R=n(29),A=n(46),I=(n(763),n(714)),M=n(69),D=n(28),L=n(148),U=n(746),F=n(63),q=n(284);function B(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=b()(e);if(t){var c=b()(this).constructor;n=Reflect.construct(o,arguments,c)}else n=o.apply(this,arguments);return p()(this,n)}}var J=function(e){u()(n,e);var t=B(n);function n(e){var o;return i()(this,n),(o=t.call(this,e)).state={purchaseNowButtonBusy:!1,purchaseLaterButtonBusy:!1},o}return s()(n,[{key:"onClickPurchaseNow",value:function(){var e=this.props,t=e.productIds,n=e.onClickPurchaseNow;if(this.setState({purchaseNowButtonBusy:!0}),t.length){Object(F.b)("tasklist_modal_proceed_checkout",{product_ids:t,purchase_install:!0});var o=Object(q.a)("https://woocommerce.com/cart",{"wccom-replace-with":t.join(",")});n?n(o):window.location=o}}},{key:"onClickPurchaseLater",value:function(){var e=this.props.productIds;Object(F.b)("tasklist_modal_proceed_checkout",{product_ids:e,purchase_install:!1}),this.setState({purchaseLaterButtonBusy:!0}),this.props.onClickPurchaseLater()}},{key:"onClose",value:function(){var e=this.props,t=e.onClose,n=e.productIds;Object(F.b)("tasklist_modal_proceed_checkout",{product_ids:n,purchase_install:!1}),t()}},{key:"renderProducts",value:function(){var e=this.props.productIds,t=Object(D.g)("onboarding",{}),n=t.productTypes,o=void 0===n?{}:n,c=t.themes,r=void 0===c?[]:c,i=[];return e.forEach((function(e){var t=Object(x.find)(o,(function(t){return t.product===e}));t&&i.push({title:t.label,content:t.description});var n=Object(x.find)(r,(function(t){return t.id===e}));n&&i.push({title:Object(_.sprintf)(Object(_.__)("%s β€” %s per year",'woocommerce'),n.title,Object(M.decodeEntities)(n.price)),content:Object(h.createElement)("span",{dangerouslySetInnerHTML:Object(U.a)(n.excerpt)})})})),Object(h.createElement)(T.List,{items:i})}},{key:"render",value:function(){var e=this,t=this.state,n=t.purchaseNowButtonBusy,o=t.purchaseLaterButtonBusy;return Object(h.createElement)(I.a,{title:Object(_.__)("Would you like to purchase and install the following features now?",'woocommerce'),onRequestClose:function(){return e.onClose()},className:"woocommerce-cart-modal"},this.renderProducts(),Object(h.createElement)("p",{className:"woocommerce-cart-modal__help-text"},Object(_.__)("You won't have access to this functionality until the extensions have been purchased and installed.",'woocommerce')),Object(h.createElement)("div",{className:"woocommerce-cart-modal__actions"},Object(h.createElement)(y.a,{isLink:!0,isBusy:o,onClick:function(){return e.onClickPurchaseLater()}},Object(_.__)("I'll do it later",'woocommerce')),Object(h.createElement)(y.a,{isPrimary:!0,isBusy:n,onClick:function(){return e.onClickPurchaseNow()}},Object(_.__)("Purchase & install now",'woocommerce'))))}}]),n}(h.Component),G=Object(g.a)(Object(S.withSelect)((function(e){var t=e(A.PLUGINS_STORE_NAME).getInstalledPlugins,n=(0,e(A.ONBOARDING_STORE_NAME).getProfileItems)(),o=t();return{profileItems:n,productIds:Object(L.e)(n,!1,o)}})))(J),V=n(16),z=n.n(V),H=n(37),Z=n.n(H),W=n(44),Q=n(5),Y=n.n(Q),K=n(7),X=n.n(K),$=n(31),ee=n.n($),te=n(36);function ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach((function(t){Y()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=b()(e);if(t){var c=b()(this).constructor;n=Reflect.construct(o,arguments,c)}else n=o.apply(this,arguments);return p()(this,n)}}var re=function(e){u()(c,e);var t,n,o=ce(c);function c(e){var t;i()(this,c),t=o.call(this,e);var n=Object(D.g)("onboarding",{}),r=n.hasHomepage,a=n.hasProducts;return t.stepVisibility={homepage:!r,import:!a},t.state={isDirty:!1,isPending:!1,logo:null,stepIndex:0,isUpdatingLogo:!1,isUpdatingNotice:!1,storeNoticeText:e.demoStoreNotice||""},t.completeStep=t.completeStep.bind(X()(t)),t.createHomepage=t.createHomepage.bind(X()(t)),t.importProducts=t.importProducts.bind(X()(t)),t.updateLogo=t.updateLogo.bind(X()(t)),t.updateNotice=t.updateNotice.bind(X()(t)),t}return s()(c,[{key:"componentDidMount",value:function(){var e=Object(D.g)("onboarding",{}).themeMods;e.custom_logo&&this.setState({logo:{id:e.custom_logo}})}},{key:"componentDidUpdate",value:function(e){var t=this,n=this.state,o=n.isPending,c=n.logo,r=this.props.demoStoreNotice;!c||c.url||o||(this.setState({isPending:!0}),wp.media.attachment(c.id).fetch().then((function(){var e=wp.media.attachment(c.id).get("url");t.setState({isPending:!1,logo:{id:c.id,url:e}})}))),r&&e.demoStoreNotice!==r&&this.setState({storeNoticeText:r})}},{key:"completeStep",value:function(){var e=this.state.stepIndex;this.getSteps()[e+1]?this.setState({stepIndex:e+1}):Object(R.getHistory)().push(Object(R.getNewPath)({},"/",{}))}},{key:"importProducts",value:function(){var e=this,t=this.props.createNotice;this.setState({isPending:!0}),Object(F.b)("tasklist_appearance_import_demo",{}),ee()({path:"".concat(te.f,"/onboarding/tasks/import_sample_products"),method:"POST"}).then((function(n){n.failed&&n.failed.length?t("error",Object(_.__)("There was an error importing some of the sample products.",'woocommerce')):(t("success",Object(_.__)("All sample products have been imported.",'woocommerce')),Object(D.h)("onboarding",oe(oe({},Object(D.g)("onboarding",{})),{},{hasProducts:!0}))),e.setState({isPending:!1}),e.completeStep()})).catch((function(n){t("error",n.message),e.setState({isPending:!1})}))}},{key:"createHomepage",value:function(){var e=this,t=this.props.createNotice;this.setState({isPending:!0}),Object(F.b)("tasklist_appearance_create_homepage",{create_homepage:!0}),ee()({path:"/wc-admin/onboarding/tasks/create_homepage",method:"POST"}).then((function(n){t(n.status,n.message,{actions:n.edit_post_link?[{label:Object(_.__)("Customize",'woocommerce'),onClick:function(){Object(F.a)("tasklist_appearance_customize_homepage",{}),window.location="".concat(n.edit_post_link,"&wc_onboarding_active_task=homepage")}}]:null}),e.setState({isPending:!1}),e.completeStep()})).catch((function(n){t("error",n.message),e.setState({isPending:!1})}))}},{key:"updateLogo",value:(n=Z()(z.a.mark((function e(){var t,n,o,c,r,i,a,s,l;return z.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props,n=t.updateOptions,o=t.createNotice,c=this.state.logo,r=Object(D.g)("onboarding",{}),i=r.stylesheet,a=r.themeMods,s=oe(oe({},a),{},{custom_logo:c?c.id:null}),Object(F.b)("tasklist_appearance_upload_logo"),Object(D.h)("onboarding",oe(oe({},Object(D.g)("onboarding",{})),{},{themeMods:s})),this.setState({isUpdatingLogo:!0}),e.next=9,n(Y()({},"theme_mods_".concat(i),s));case 9:(l=e.sent).success?(this.setState({isUpdatingLogo:!1}),o("success",Object(_.__)("Store logo updated sucessfully.",'woocommerce')),this.completeStep()):o("error",l.message);case 11:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"updateNotice",value:(t=Z()(z.a.mark((function e(){var t,n,o,c,r;return z.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props,n=t.updateOptions,o=t.createNotice,c=this.state.storeNoticeText,Object(F.b)("tasklist_appearance_set_store_notice",{added_text:Boolean(c.length)}),Object(D.h)("onboarding",oe(oe({},Object(D.g)("onboarding",{})),{},{isAppearanceComplete:!0})),this.setState({isUpdatingNotice:!0}),e.next=7,n({woocommerce_task_list_appearance_complete:!0,woocommerce_demo_store:c.length?"yes":"no",woocommerce_demo_store_notice:c});case 7:(r=e.sent).success?(this.setState({isUpdatingNotice:!1}),o("success",Object(_.__)("🎨 Your store is looking great! Don't forget to continue personalizing it.",'woocommerce')),this.completeStep()):o("error",r.message);case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getSteps",value:function(){var e=this,t=this.state,n=t.isDirty,o=t.isPending,c=t.logo,r=t.storeNoticeText,i=t.isUpdatingLogo,a=[{key:"import",label:Object(_.__)("Import sample products",'woocommerce'),description:Object(_.__)("We’ll add some products that will make it easier to see what your store looks like",'woocommerce'),content:Object(h.createElement)(h.Fragment,null,Object(h.createElement)(y.a,{onClick:this.importProducts,isBusy:o,isPrimary:!0},Object(_.__)("Import products",'woocommerce')),Object(h.createElement)(y.a,{onClick:function(){return e.completeStep()}},Object(_.__)("Skip",'woocommerce'))),visible:this.stepVisibility.import},{key:"homepage",label:Object(_.__)("Create a custom homepage",'woocommerce'),description:Object(_.__)("Create a new homepage and customize it to suit your needs",'woocommerce'),content:Object(h.createElement)(h.Fragment,null,Object(h.createElement)(y.a,{isPrimary:!0,isBusy:o,onClick:this.createHomepage},Object(_.__)("Create homepage",'woocommerce')),Object(h.createElement)(y.a,{onClick:function(){Object(F.b)("tasklist_appearance_create_homepage",{create_homepage:!1}),e.completeStep()}},Object(_.__)("Skip",'woocommerce'))),visible:this.stepVisibility.homepage},{key:"logo",label:Object(_.__)("Upload a logo",'woocommerce'),description:Object(_.__)("Ensure your store is on-brand by adding your logo",'woocommerce'),content:o?null:Object(h.createElement)(h.Fragment,null,Object(h.createElement)(T.ImageUpload,{image:c,onChange:function(t){return e.setState({isDirty:!0,logo:t})}}),Object(h.createElement)(y.a,{disabled:!c&&!n,onClick:this.updateLogo,isBusy:i,isPrimary:!0},Object(_.__)("Proceed",'woocommerce')),Object(h.createElement)(y.a,{isTertiary:!0,onClick:function(){return e.completeStep()}},Object(_.__)("Skip",'woocommerce'))),visible:!0},{key:"notice",label:Object(_.__)("Set a store notice",'woocommerce'),description:Object(_.__)("Optionally display a prominent notice across all pages of your store",'woocommerce'),content:Object(h.createElement)(h.Fragment,null,Object(h.createElement)(T.TextControl,{label:Object(_.__)("Store notice text",'woocommerce'),placeholder:Object(_.__)("Store notice text",'woocommerce'),value:r,onChange:function(t){return e.setState({storeNoticeText:t})}}),Object(h.createElement)(y.a,{onClick:this.updateNotice,isPrimary:!0},Object(_.__)("Complete task",'woocommerce'))),visible:!0}];return Object(x.filter)(a,(function(e){return e.visible}))}},{key:"render",value:function(){var e=this.state,t=e.isPending,n=e.stepIndex,o=e.isUpdatingLogo,c=e.isUpdatingNotice,r=this.getSteps()[n].key;return Object(h.createElement)("div",{className:"woocommerce-task-appearance"},Object(h.createElement)(T.Card,{className:"is-narrow"},Object(h.createElement)(T.Stepper,{isPending:c||o||t,isVertical:!0,currentStep:r,steps:this.getSteps()})))}}]),c}(h.Component),ie=Object(g.a)(Object(S.withSelect)((function(e){return{demoStoreNotice:(0,e(A.OPTIONS_STORE_NAME).getOption)("woocommerce_demo_store_notice")}})),Object(S.withDispatch)((function(e){return{createNotice:e("core/notices").createNotice,updateOptions:e(A.OPTIONS_STORE_NAME).updateOptions}})))(re);function ae(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=b()(e);if(t){var c=b()(this).constructor;n=Reflect.construct(o,arguments,c)}else n=o.apply(this,arguments);return p()(this,n)}}var se=[{title:Object(_.__)("Add manually (recommended)",'woocommerce'),content:Object(_.__)("For small stores we recommend adding products manually",'woocommerce'),before:Object(h.createElement)("i",{className:"material-icons-outlined"},"add_box"),after:Object(h.createElement)("i",{className:"material-icons-outlined"},"chevron_right"),onClick:function(){return Object(F.b)("tasklist_add_product",{method:"manually"})},href:Object(D.f)("post-new.php?post_type=product&wc_onboarding_active_task=products&tutorial=true")},{title:Object(_.__)("Import",'woocommerce'),content:Object(_.__)("For larger stores we recommend importing all products at once via CSV file",'woocommerce'),before:Object(h.createElement)("i",{className:"material-icons-outlined"},"import_export"),after:Object(h.createElement)("i",{className:"material-icons-outlined"},"chevron_right"),onClick:function(){return Object(F.b)("tasklist_add_product",{method:"import"})},href:Object(D.f)("edit.php?post_type=product&page=product_importer&wc_onboarding_active_task=product-import")},{title:Object(_.__)("Migrate",'woocommerce'),content:Object(_.__)("For stores currently selling elsewhere we suggest using a product migration service",'woocommerce'),before:Object(h.createElement)("i",{className:"material-icons-outlined"},"cloud_download"),after:Object(h.createElement)("i",{className:"material-icons-outlined"},"chevron_right"),onClick:function(){return Object(F.b)("tasklist_add_product",{method:"migrate"})},href:"https://woocommerce.com/products/cart2cart/",target:"_blank"}],le=function(e){u()(n,e);var t=ae(n);function n(){return i()(this,n),t.apply(this,arguments)}return s()(n,[{key:"render",value:function(){return Object(h.createElement)(h.Fragment,null,Object(h.createElement)(T.Card,{className:"woocommerce-task-card"},Object(h.createElement)(T.List,{items:se})))}}]),n}(h.Component),ue=n(33),me=n.n(ue),pe=n(42),de=n.n(pe),be=n(1),he=n.n(be);function _e(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=b()(e);if(t){var c=b()(this).constructor;n=Reflect.construct(o,arguments,c)}else n=o.apply(this,arguments);return p()(this,n)}}var ge=function(e){u()(o,e);var t,n=_e(o);function o(e){var t;return i()(this,o),(t=n.call(this,e)).state={isConnecting:!1},t.connectJetpack=t.connectJetpack.bind(X()(t)),e.setIsPending(!0),t}return s()(o,[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.createNotice,o=t.error,c=t.isRequesting,r=t.onError,i=t.setIsPending;e.isRequesting&&!c&&i(!1),o&&o!==e.error&&(r&&r(),n("error",o))}},{key:"connectJetpack",value:(t=Z()(z.a.mark((function e(){var t,n,o;return z.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.props,n=t.jetpackConnectUrl,o=t.onConnect,this.setState({isConnecting:!0},(function(){o&&o(),window.location=n}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this.props,t=e.hasErrors,n=e.isRequesting,o=e.onSkip,c=e.skipText;return Object(h.createElement)(h.Fragment,null,t?Object(h.createElement)(y.a,{isPrimary:!0,onClick:function(){return window.location.reload()}},Object(_.__)("Retry",'woocommerce')):Object(h.createElement)(y.a,{disabled:n,isBusy:this.state.isConnecting,isPrimary:!0,onClick:this.connectJetpack},Object(_.__)("Connect",'woocommerce')),o&&Object(h.createElement)(y.a,{onClick:o},c||Object(_.__)("No thanks",'woocommerce')))}}]),o}(h.Component);ge.propTypes={createNotice:he.a.func.isRequired,error:he.a.string,hasErrors:he.a.bool,isRequesting:he.a.bool,jetpackConnectUrl:he.a.string,onConnect:he.a.func,onError:he.a.func,onSkip:he.a.func,redirectUrl:he.a.string,skipText:he.a.string,setIsPending:he.a.func},ge.defaultProps={setIsPending:function(){}};var fe=Object(g.a)(Object(S.withSelect)((function(e,t){var n=e(A.PLUGINS_STORE_NAME),o=n.getJetpackConnectUrl,c=n.isPluginsRequesting,r=n.getPluginsError,i={redirect_url:t.redirectUrl||window.location.href},a=c("getJetpackConnectUrl");return{error:r("getJetpackConnectUrl")||"",isRequesting:a,jetpackConnectUrl:o(i)}})),Object(S.withDispatch)((function(e){return{createNotice:e("core/notices").createNotice}})))(ge),Oe=n(766);function ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(n),!0).forEach((function(t){Y()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ye(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ke(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=b()(e);if(t){var c=b()(this).constructor;n=Reflect.construct(o,arguments,c)}else n=o.apply(this,arguments);return p()(this,n)}}var we=function(e){u()(o,e);var t,n=ke(o);function o(){var e;return i()(this,o),(e=n.apply(this,arguments)).onSubmit=e.onSubmit.bind(X()(e)),e}return s()(o,[{key:"onSubmit",value:(t=Z()(z.a.mark((function e(t){var n,o,c,r,i,a;return z.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.props,o=n.onComplete,c=n.createNotice,r=n.isSettingsError,i=n.updateAndPersistSettingsForGroup,a=n.settings,e.next=3,i("general",{general:je(je({},a),{},{woocommerce_store_address:t.addressLine1,woocommerce_store_address_2:t.addressLine2,woocommerce_default_country:t.countryState,woocommerce_store_city:t.city,woocommerce_store_postcode:t.postCode})});case 3:r?c("error",Object(_.__)("There was a problem saving your store location.",'woocommerce')):o(t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"getInitialValues",value:function(){var e=this.props.settings;return{addressLine1:e.woocommerce_store_address||"",addressLine2:e.woocommerce_store_address_2||"",city:e.woocommerce_store_city||"",countryState:e.woocommerce_default_country||"",postCode:e.woocommerce_store_postcode||""}}},{key:"render",value:function(){return this.props.isSettingsRequesting?null:Object(h.createElement)(T.Form,{initialValues:this.getInitialValues(),onSubmitCallback:this.onSubmit,validate:Oe.b},(function(e){var t=e.getInputProps,n=e.handleSubmit,o=e.setValue;return Object(h.createElement)(h.Fragment,null,Object(h.createElement)(Oe.a,{getInputProps:t,setValue:o}),Object(h.createElement)(y.a,{isPrimary:!0,onClick:n},Object(_.__)("Continue",'woocommerce')))}))}}]),o}(h.Component),ve=n(902),Se=n(218);function Ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(n),!0).forEach((function(t){Y()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ee(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=b()(e);if(t){var c=b()(this).constructor;n=Reflect.construct(o,arguments,c)}else n=o.apply(this,arguments);return p()(this,n)}}var Ne=function(e){u()(o,e);var t,n=Ce(o);function o(){var e;return i()(this,o),(e=n.apply(this,arguments)).updateShippingZones=e.updateShippingZones.bind(X()(e)),e}return s()(o,[{key:"getShippingMethods",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e&&e.methods&&Array.isArray(e.methods)?t?e.methods?e.methods.filter((function(e){return e.method_id===t})):[]:e.methods:[]}},{key:"disableShippingMethods",value:function(e,t){t.length&&t.forEach((function(t){ee()({method:"POST",path:"/wc/v3/shipping/zones/".concat(e.id,"/methods/").concat(t.instance_id),data:{enabled:!1}})}))}},{key:"updateShippingZones",value:(t=Z()(z.a.mark((function e(t){var n,o,c,r,i,a=this;return z.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this.props,o=n.createNotice,c=n.shippingZones,r=!1,i=!1,c.forEach((function(e){0===e.id?r=e.toggleable&&t["".concat(e.id,"_enabled")]:i=""!==t["".concat(e.id,"_rate")]&&parseFloat(t["".concat(e.id,"_rate")])!==parseFloat(0);var n=a.getShippingMethods(e),o=parseFloat(t["".concat(e.id,"_rate")])===parseFloat(0)?"free_shipping":"flat_rate",c=a.getShippingMethods(e,o).length?a.getShippingMethods(e,o)[0]:null;if(!e.toggleable||t["".concat(e.id,"_enabled")]){if(c){var s=n.filter((function(e){return e.instance_id!==c.instance_id}));a.disableShippingMethods(e,s)}ee()({method:"POST",path:c?"/wc/v3/shipping/zones/".concat(e.id,"/methods/").concat(c.instance_id):"/wc/v3/shipping/zones/".concat(e.id,"/methods"),data:{method_id:o,enabled:!0,settings:{cost:t["".concat(e.id,"_rate")]}}})}else a.disableShippingMethods(e,n)})),Object(F.b)("tasklist_shipping_set_costs",{shipping_cost:i,rest_world:r}),Object(D.h)("onboarding",Pe(Pe({},Object(D.g)("onboarding",{})),{},{shippingZonesCount:1})),o("success",Object(_.__)("Your shipping rates have been updated.",'woocommerce')),this.props.onComplete();case 8:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"renderInputPrefix",value:function(){var e=this.context.getCurrencyConfig(),t=e.symbolPosition,n=e.symbol;return 0===t.indexOf("right")?null:Object(h.createElement)("span",{className:"woocommerce-shipping-rate__control-prefix"},n)}},{key:"renderInputSuffix",value:function(e){var t=this.context.getCurrencyConfig(),n=t.symbolPosition,o=t.symbol;return 0===n.indexOf("right")?Object(h.createElement)("span",{className:"woocommerce-shipping-rate__control-suffix"},o):parseFloat(e)===parseFloat(0)?Object(h.createElement)("span",{className:"woocommerce-shipping-rate__control-suffix"},Object(_.__)("Free shipping",'woocommerce')):null}},{key:"getFormattedRate",value:function(e){var t=this.context.formatDecimalString,n=t(e);return e.length&&n.length?t(e):t(0)}},{key:"getInitialValues",value:function(){var e=this,t=this.context.formatDecimalString,n={};return this.props.shippingZones.forEach((function(o){var c=e.getShippingMethods(o),r=c.length&&c[0].settings.cost?e.getFormattedRate(c[0].settings.cost.value):t(0);n["".concat(o.id,"_rate")]=r,c.length&&c[0].enabled?n["".concat(o.id,"_enabled")]=!0:n["".concat(o.id,"_enabled")]=!1})),n}},{key:"validate",value:function(e){var t={};return Object.keys(e).filter((function(e){return e.endsWith("_rate")})).forEach((function(n){e[n]<0&&(t[n]=Object(_.__)("Shipping rates can not be negative numbers.",'woocommerce'))})),t}},{key:"render",value:function(){var e=this,t=this.props,n=t.buttonText,o=t.shippingZones;return o.length?Object(h.createElement)(T.Form,{initialValues:this.getInitialValues(),onSubmitCallback:this.updateShippingZones,validate:this.validate},(function(t){var c=t.getInputProps,r=t.handleSubmit,i=t.setTouched,a=t.setValue,s=t.values;return Object(h.createElement)(h.Fragment,null,Object(h.createElement)("div",{className:"woocommerce-shipping-rates"},o.map((function(t){return Object(h.createElement)("div",{className:"woocommerce-shipping-rate",key:t.id},Object(h.createElement)("div",{className:"woocommerce-shipping-rate__icon"},t.locations?t.locations.map((function(e){return Object(h.createElement)(T.Flag,{size:24,code:e.code,key:e.code})})):Object(h.createElement)("i",{className:"material-icons-outlined"},"public")),Object(h.createElement)("div",{className:"woocommerce-shipping-rate__main"},t.toggleable?Object(h.createElement)("label",{htmlFor:"woocommerce-shipping-rate__toggle-".concat(t.id),className:"woocommerce-shipping-rate__name"},t.name,Object(h.createElement)(ve.a,me()({id:"woocommerce-shipping-rate__toggle-".concat(t.id)},c("".concat(t.id,"_enabled"))))):Object(h.createElement)("div",{className:"woocommerce-shipping-rate__name"},t.name),(!t.toggleable||s["".concat(t.id,"_enabled")])&&Object(h.createElement)(T.TextControlWithAffixes,me()({label:Object(_.__)("Shipping cost",'woocommerce'),required:!0},c("".concat(t.id,"_rate")),{onBlur:function(){i("".concat(t.id,"_rate")),a("".concat(t.id,"_rate"),e.getFormattedRate(s["".concat(t.id,"_rate")]))},prefix:e.renderInputPrefix(),suffix:e.renderInputSuffix(s["".concat(t.id,"_rate")]),className:"muriel-input-text woocommerce-shipping-rate__control-wrapper"}))))}))),Object(h.createElement)(y.a,{isPrimary:!0,onClick:r},n||Object(_.__)("Update",'woocommerce')))})):null}}]),o}(h.Component);Ne.propTypes={buttonText:he.a.string,onComplete:he.a.func.isRequired,createNotice:he.a.func.isRequired,shippingZones:he.a.array},Ne.defaultProps={shippingZones:[]},Ne.contextType=Se.a;var xe=Ne;function Te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=b()(e);if(t){var c=b()(this).constructor;n=Reflect.construct(o,arguments,c)}else n=o.apply(this,arguments);return p()(this,n)}}var Re=function(e){u()(o,e);var t,n=Te(o);function o(e){var t;return i()(this,o),(t=n.call(this,e)).initialState={isPending:!1,step:"store_location",shippingZones:[]},t.activePlugins=e.activePlugins,t.state=t.initialState,t.completeStep=t.completeStep.bind(X()(t)),t}return s()(o,[{key:"componentDidMount",value:function(){this.reset()}},{key:"reset",value:function(){this.setState(this.initialState)}},{key:"fetchShippingZones",value:(t=Z()(z.a.mark((function e(){var t,n,o,c,r,i,a;return z.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isPending:!0}),t=this.props,n=t.countryCode,o=t.countryName,c=[],e.next=5,ee()({path:"/wc/v3/shipping/zones"});case 5:return r=e.sent,i=!1,e.next=9,Promise.all(r.map(function(){var e=Z()(z.a.mark((function e(t){return z.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t.id){e.next=8;break}return e.next=3,ee()({path:"/wc/v3/shipping/zones/".concat(t.id,"/methods")});case 3:return t.methods=e.sent,t.name=Object(_.__)("Rest of the world",'woocommerce'),t.toggleable=!0,c.push(t),e.abrupt("return");case 8:return e.next=10,ee()({path:"/wc/v3/shipping/zones/".concat(t.id,"/locations")});case 10:if(t.locations=e.sent,!t.locations.find((function(e){return n===e.code}))){e.next=18;break}return e.next=15,ee()({path:"/wc/v3/shipping/zones/".concat(t.id,"/methods")});case 15:t.methods=e.sent,c.push(t),i=!0;case 18:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:if(i){e.next=17;break}return e.next=12,ee()({method:"POST",path:"/wc/v3/shipping/zones",data:{name:o}});case 12:return a=e.sent,e.next=15,ee()({method:"POST",path:"/wc/v3/shipping/zones/".concat(a.id,"/locations"),data:[{code:n,type:"country"}]});case 15:a.locations=e.sent,c.push(a);case 17:c.reverse(),this.setState({isPending:!1,shippingZones:c});case 19:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"componentDidUpdate",value:function(e,t){var n=this.props,o=n.countryCode,c=n.settings,r=c.woocommerce_store_address,i=c.woocommerce_default_country,a=c.woocommerce_store_postcode,s=this.state.step;"rates"!==s||e.countryCode===o&&"rates"===t.step||this.fetchShippingZones();var l=Boolean(r&&i&&a);"store_location"===s&&l&&this.completeStep()}},{key:"completeStep",value:function(){var e=this.props.createNotice,t=this.state.step,n=this.getSteps(),o=n.findIndex((function(e){return e.key===t})),c=n[o+1];c?this.setState({step:c.key}):(e("success",Object(_.__)("πŸ“¦ Shipping is done! Don't worry, you can always change it later.",'woocommerce')),Object(R.getHistory)().push(Object(R.getNewPath)({},"/",{})))}},{key:"getPluginsToActivate",value:function(){var e=this.props.countryCode,t=[];return["GB","CA","AU"].includes(e)?t.push("woocommerce-shipstation-integration"):"US"===e&&(t.push("woocommerce-services"),t.push("jetpack")),Object(x.difference)(t,this.activePlugins)}},{key:"getSteps",value:function(){var e=this,t=this.props,n=t.countryCode,o=t.isJetpackConnected,c=this.getPluginsToActivate(),r=!o&&"US"===n,i=[{key:"store_location",label:Object(_.__)("Set store location",'woocommerce'),description:Object(_.__)("The address from which your business operates",'woocommerce'),content:Object(h.createElement)(we,me()({},this.props,{onComplete:function(t){var n=Object(L.b)(t.countryState);Object(F.b)("tasklist_shipping_set_location",{country:n}),e.completeStep()}})),visible:!0},{key:"rates",label:Object(_.__)("Set shipping costs",'woocommerce'),description:Object(_.__)("Define how much customers pay to ship to different destinations",'woocommerce'),content:Object(h.createElement)(xe,me()({buttonText:c.length||r?Object(_.__)("Proceed",'woocommerce'):Object(_.__)("Complete task",'woocommerce'),shippingZones:this.state.shippingZones,onComplete:this.completeStep},this.props)),visible:!0},{key:"label_printing",label:Object(_.__)("Enable shipping label printing",'woocommerce'),description:c.includes("woocommerce-shipstation-integration")?de()({mixedString:Object(_.__)("We recommend using ShipStation to save time at the post office by printing your shipping labels at home. Try ShipStation free for 30 days. {{link}}Learn more{{/link}}.",'woocommerce'),components:{link:Object(h.createElement)(T.Link,{href:"https://woocommerce.com/products/shipstation-integration",target:"_blank",type:"external"})}}):Object(_.__)("With WooCommerce Services and Jetpack you can save time at the Post Office by printing your shipping labels at home",'woocommerce'),content:Object(h.createElement)(T.Plugins,me()({onComplete:function(){Object(F.b)("tasklist_shipping_label_printing",{install:!0,pluginsToActivate:c}),e.completeStep()},onSkip:function(){Object(F.b)("tasklist_shipping_label_printing",{install:!1,pluginsToActivate:c}),Object(R.getHistory)().push(Object(R.getNewPath)({},"/",{}))},pluginSlugs:c},this.props)),visible:c.length},{key:"connect",label:Object(_.__)("Connect your store",'woocommerce'),description:Object(_.__)("Connect your store to WordPress.com to enable label printing",'woocommerce'),content:Object(h.createElement)(fe,me()({redirectUrl:Object(D.f)("admin.php?page=wc-admin"),completeStep:this.completeStep},this.props,{onConnect:function(){Object(F.b)("tasklist_shipping_connect_store")}})),visible:r}];return Object(x.filter)(i,(function(e){return e.visible}))}},{key:"render",value:function(){var e=this.state,t=e.isPending,n=e.step,o=this.props.isUpdateSettingsRequesting;return Object(h.createElement)("div",{className:"woocommerce-task-shipping"},Object(h.createElement)(T.Card,{className:"is-narrow"},Object(h.createElement)(T.Stepper,{isPending:t||o,isVertical:!0,currentStep:n,steps:this.getSteps()})))}}]),o}(h.Component),Ae=Object(g.a)(Object(S.withSelect)((function(e){var t=e(A.SETTINGS_STORE_NAME),n=t.getSettings,o=t.isUpdateSettingsRequesting,c=e(A.PLUGINS_STORE_NAME),r=c.getActivePlugins,i=c.isJetpackConnected,a=n("general").general,s=void 0===a?{}:a,l=Object(L.b)(s.woocommerce_default_country),u=Object(D.g)("dataEndpoints",{}).countries,m=l?(void 0===u?[]:u).find((function(e){return e.code===l})):null,p=m?m.name:null,d=r();return{countryCode:l,countryName:p,isUpdateSettingsRequesting:o("general"),settings:s,activePlugins:d,isJetpackConnected:i()}})),Object(S.withDispatch)((function(e){return{createNotice:e("core/notices").createNotice,updateAndPersistSettingsForGroup:e(A.SETTINGS_STORE_NAME).updateAndPersistSettingsForGroup}})))(Re),Ie=n(220);function Me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function De(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(n),!0).forEach((function(t){Y()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=b()(e);if(t){var c=b()(this).constructor;n=Reflect.construct(o,arguments,c)}else n=o.apply(this,arguments);return p()(this,n)}}var Ue=function(e){u()(o,e);var t,n=Le(o);function o(e){var t;i()(this,o),t=n.call(this,e);var c=e.hasCompleteAddress,r=e.pluginsToActivate;return t.initialState={isPending:!1,stepIndex:c?1:0,cachedPluginsToActivate:r},t.state=t.initialState,t.completeStep=t.completeStep.bind(X()(t)),t}return s()(o,[{key:"componentDidMount",value:function(){this.reset()}},{key:"reset",value:function(){this.setState(this.initialState)}},{key:"shouldShowSuccessScreen",value:function(){var e=this.props,t=e.isJetpackConnected,n=e.hasCompleteAddress,o=e.pluginsToActivate;return n&&!o.length&&t&&this.isTaxJarSupported()}},{key:"isTaxJarSupported",value:function(){var e=this.props.countryCode,t=Object(D.g)("onboarding",{}),n=t.automatedTaxSupportedCountries,o=void 0===n?[]:n;return!t.taxJarActivated&&o.includes(e)}},{key:"completeStep",value:function(){var e=this.state.stepIndex;this.getSteps()[e+1]&&this.setState({stepIndex:e+1})}},{key:"manuallyConfigureTaxRates",value:(t=Z()(z.a.mark((function e(){var t,n,o,c=this;return z.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.props,n=t.generalSettings,o=t.updateAndPersistSettingsForGroup,"yes"!==n.woocommerce_calc_taxes?(this.setState({isPending:!0}),o("general",{general:De(De({},n),{},{woocommerce_calc_taxes:"yes"})}).then((function(){return c.redirectToTaxSettings()})).catch((function(e){return Object(Ie.a)(e)}))):this.redirectToTaxSettings();case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"updateAutomatedTax",value:function(e){var t=this,n=this.props,o=n.createNotice,c=n.updateAndPersistSettingsForGroup,r=n.generalSettings,i=n.taxSettings;Promise.all([c("tax",{tax:De(De({},i),{},{wc_connect_taxes_enabled:e?"yes":"no"})}),c("general",{general:De(De({},r),{},{woocommerce_calc_taxes:"yes"})})]).then((function(){Object(D.h)("onboarding",De(De({},Object(D.g)("onboarding",{})),{},{isTaxComplete:!0})),e?(o("success",Object(_.__)("You're awesome! One less item on your to-do list βœ…",'woocommerce')),Object(R.getHistory)().push(Object(R.getNewPath)({},"/",{}))):t.redirectToTaxSettings()})).catch((function(){o("error",Object(_.__)("There was a problem updating your tax settings.",'woocommerce'))}))}},{key:"redirectToTaxSettings",value:function(){window.location=Object(D.f)("admin.php?page=wc-settings&tab=tax&section=standard&wc_onboarding_active_task=tax")}},{key:"getSteps",value:function(){var e=this,t=this.props,n=t.generalSettings,o=t.isJetpackConnected,c=t.isPending,r=t.tosAccepted,i=t.updateOptions,a=this.state.cachedPluginsToActivate,s=[{key:"store_location",label:Object(_.__)("Set store location",'woocommerce'),description:Object(_.__)("The address from which your business operates",'woocommerce'),content:Object(h.createElement)(we,me()({},this.props,{onComplete:function(t){var n=Object(L.b)(t.countryState);Object(F.b)("tasklist_tax_set_location",{country:n}),e.completeStep()},isSettingsRequesting:!1,settings:n})),visible:!0},{key:"plugins",label:Object(_.__)("Install Jetpack and WooCommerce Services",'woocommerce'),description:Object(_.__)("Jetpack and WooCommerce Services allow you to automate sales tax calculations",'woocommerce'),content:Object(h.createElement)(h.Fragment,null,Object(h.createElement)(T.Plugins,{onComplete:function(){Object(F.b)("tasklist_tax_install_extensions",{install_extensions:!0}),i({woocommerce_setup_jetpack_opted_in:!0}),e.completeStep()},onSkip:function(){Object(F.a)("tasklist_tax_install_extensions",{install_extensions:!1}),e.manuallyConfigureTaxRates()},skipText:Object(_.__)("Set up tax rates manually",'woocommerce')}),!r&&Object(h.createElement)(j.a,{variant:"caption",className:"woocommerce-task__caption"},de()({mixedString:Object(_.__)("By installing Jetpack and WooCommerce Services you agree to the {{link}}Terms of Service{{/link}}.",'woocommerce'),components:{link:Object(h.createElement)(T.Link,{href:"https://wordpress.com/tos/",target:"_blank",type:"external"})}}))),visible:(a.length||!r)&&this.isTaxJarSupported()},{key:"connect",label:Object(_.__)("Connect your store",'woocommerce'),description:Object(_.__)("Connect your store to WordPress.com to enable automated sales tax calculations",'woocommerce'),content:Object(h.createElement)(fe,me()({},this.props,{onConnect:function(){Object(F.b)("tasklist_tax_connect_store",{connect:!0})},onSkip:function(){Object(F.a)("tasklist_tax_connect_store",{connect:!1}),e.manuallyConfigureTaxRates()},skipText:Object(_.__)("Set up tax rates manually",'woocommerce')})),visible:!o&&this.isTaxJarSupported()},{key:"manual_configuration",label:Object(_.__)("Configure tax rates",'woocommerce'),description:Object(_.__)("Head over to the tax rate settings screen to configure your tax rates",'woocommerce'),content:Object(h.createElement)(h.Fragment,null,Object(h.createElement)(y.a,{disabled:c,isPrimary:!0,isBusy:c,onClick:function(){Object(F.b)("tasklist_tax_config_rates"),e.manuallyConfigureTaxRates()}},Object(_.__)("Configure",'woocommerce')),Object(h.createElement)("p",null,"yes"!==n.woocommerce_calc_taxes&&de()({mixedString:Object(_.__)('By clicking "Configure" you\'re enabling tax rates and calculations. More info {{link}}here{{/link}}.','woocommerce'),components:{link:Object(h.createElement)(T.Link,{href:"https://docs.woocommerce.com/document/setting-up-taxes-in-woocommerce/#section-1",target:"_blank",type:"external"})}}))),visible:!this.isTaxJarSupported()}];return Object(x.filter)(s,(function(e){return e.visible}))}},{key:"render",value:function(){var e=this,t=this.state.stepIndex,n=this.props,o=n.isPending,c=n.isResolving,r=this.getSteps()[t];return Object(h.createElement)("div",{className:"woocommerce-task-tax"},Object(h.createElement)(T.Card,{className:"is-narrow"},this.shouldShowSuccessScreen()?Object(h.createElement)("div",{className:"woocommerce-task-tax__success"},Object(h.createElement)("span",{className:"woocommerce-task-tax__success-icon",role:"img","aria-labelledby":"woocommerce-task-tax__success-message"},"🎊"),Object(h.createElement)(T.H,{id:"woocommerce-task-tax__success-message"},Object(_.__)("Good news!",'woocommerce')),Object(h.createElement)("p",null,de()({mixedString:Object(_.__)("{{strong}}Jetpack{{/strong}} and {{strong}}WooCommerce Services{{/strong}} can automate your sales tax calculations for you.",'woocommerce'),components:{strong:Object(h.createElement)("strong",null)}})),Object(h.createElement)(y.a,{disabled:o,isPrimary:!0,isBusy:o,onClick:function(){Object(F.b)("tasklist_tax_setup_automated_proceed",{setup_automatically:!0}),e.updateAutomatedTax(!0)}},Object(_.__)("Yes please",'woocommerce')),Object(h.createElement)(y.a,{disabled:o,isBusy:o,onClick:function(){Object(F.b)("tasklist_tax_setup_automated_proceed",{setup_automatically:!1}),e.updateAutomatedTax(!1)}},Object(_.__)("No thanks, I'll configure taxes manually",'woocommerce'))):Object(h.createElement)(T.Stepper,{isPending:o||c,isVertical:!0,currentStep:r.key,steps:this.getSteps()})))}}]),o}(h.Component),Fe=Object(g.a)(Object(S.withSelect)((function(e){var t=e(A.SETTINGS_STORE_NAME),n=t.getSettings,o=t.isUpdateSettingsRequesting,c=e(A.OPTIONS_STORE_NAME).getOption,r=e(A.PLUGINS_STORE_NAME),i=r.getActivePlugins,a=r.isJetpackConnected,s=r.isPluginsRequesting,l=n("general").general,u=void 0===l?{}:l,m=Object(L.b)(u.woocommerce_default_country),p=u.woocommerce_store_address,d=u.woocommerce_default_country,b=u.woocommerce_store_postcode,h=Boolean(p&&d&&b),_=n("tax").tax,g=void 0===_?{}:_,f=i(),O=Object(x.difference)(["jetpack","woocommerce-services"],f),y=(c("wc_connect_options")||{}).tos_accepted||c("woocommerce_setup_jetpack_opted_in"),j=o("tax")||o("general"),k=s("getJetpackConnectUrl");return{countryCode:m,generalSettings:u,hasCompleteAddress:h,isJetpackConnected:a(),isPending:j,isResolving:k,pluginsToActivate:O,taxSettings:g,tosAccepted:y}})),Object(S.withDispatch)((function(e){var t=e("core/notices").createNotice,n=e(A.OPTIONS_STORE_NAME).updateOptions;return{createNotice:t,updateAndPersistSettingsForGroup:e(A.SETTINGS_STORE_NAME).updateAndPersistSettingsForGroup,updateOptions:n}})))(Ue),qe=n(104),Be=n(773);function Je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Je(Object(n),!0).forEach((function(t){Y()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Je(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ve(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=b()(e);if(t){var c=b()(this).constructor;n=Reflect.construct(o,arguments,c)}else n=o.apply(this,arguments);return p()(this,n)}}var ze=function(e){u()(c,e);var t,n,o=Ve(c);function c(e){var t;i()(this,c),t=o.apply(this,arguments);var n=e.methods,r={};return n.forEach((function(e){return r[e.key]=e.isEnabled})),t.state={busyMethod:null,enabledMethods:r,recommendedMethod:t.getRecommendedMethod()},t.completeTask=t.completeTask.bind(X()(t)),t.markConfigured=t.markConfigured.bind(X()(t)),t.skipTask=t.skipTask.bind(X()(t)),t}return s()(c,[{key:"componentDidUpdate",value:function(){var e=this.state.recommendedMethod,t=this.getRecommendedMethod();e!==t&&this.setState({recommendedMethod:t})}},{key:"getRecommendedMethod",value:function(){return this.props.methods.find((function(e){return"wcpay"===e.key&&e.visible}))?"wcpay":"stripe"}},{key:"completeTask",value:(n=Z()(z.a.mark((function e(){var t,n,o,c,r;return z.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props,n=t.createNotice,o=t.methods,c=t.updateOptions,e.next=3,c({woocommerce_task_list_payments:{completed:1,timestamp:Math.floor(Date.now()/1e3)}});case 3:r=e.sent,Object(F.b)("tasklist_payment_done",{configured:o.filter((function(e){return e.isConfigured})).map((function(e){return e.key}))}),r.success?(n("success",Object(_.__)("πŸ’° Ka-ching! Your store can now accept payments πŸ’³",'woocommerce')),Object(R.getHistory)().push(Object(R.getNewPath)({},"/",{}))):n("error",Object(_.__)("There was a problem updating settings",'woocommerce'));case 6:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"skipTask",value:function(){var e=this.props,t=e.methods;(0,e.updateOptions)({woocommerce_task_list_payments:{skipped:1,timestamp:Math.floor(Date.now()/1e3)}}),Object(F.b)("tasklist_payment_skip_task",{options:t.map((function(e){return e.key}))}),Object(R.getHistory)().push(Object(R.getNewPath)({},"/",{}))}},{key:"markConfigured",value:function(e){var t=this.state.enabledMethods;this.setState({enabledMethods:Ge(Ge({},t),{},Y()({},e,!0))}),Object(R.getHistory)().push(Object(R.getNewPath)({task:"payments"},"/",{})),Object(F.b)("tasklist_payment_connect_method",{payment_method:e})}},{key:"getCurrentMethod",value:function(){var e=this.props,t=e.methods,n=e.query;if(n.method)return t.find((function(e){return e.key===n.method}))}},{key:"getInstallStep",value:function(){var e=this.getCurrentMethod();if(e.plugins&&e.plugins.length){var t=this.props.activePlugins,n=e.plugins.filter((function(e){return!t.includes(e)})),o=e.plugins.map((function(e){return A.pluginNames[e]})).join(" "+Object(_.__)("and",'woocommerce')+" ");return{key:"install",label:Object(_.sprintf)(Object(_.__)("Install %s",'woocommerce'),o),content:Object(h.createElement)(T.Plugins,{onComplete:function(){Object(F.b)("tasklist_payment_install_method",{plugins:e.plugins})},autoInstall:!0,pluginSlugs:e.plugins}),isComplete:!n.length}}}},{key:"toggleMethod",value:function(e){var t=this.props,n=t.methods,o=t.options,c=t.updateOptions,r=this.state.enabledMethods,i=n.find((function(t){return t.key===e}));r[e]=!r[e],this.setState({enabledMethods:r}),Object(F.b)("tasklist_payment_toggle",{enabled:!i.isEnabled,payment_method:e}),c(Y()({},i.optionName,Ge(Ge({},o[i.optionName]),{},{enabled:i.isEnabled?"no":"yes"})))}},{key:"handleClick",value:(t=Z()(z.a.mark((function e(t){var n,o,c,r=this;return z.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.props.methods,o=t.key,c=t.onClick,Object(F.b)("tasklist_payment_setup",{options:n.map((function(e){return e.key})),selected:o}),!c){e.next=8;break}return this.setState({busyMethod:o}),e.next=7,new Promise(c).then((function(){r.setState({busyMethod:null})})).catch((function(){r.setState({busyMethod:null})}));case 7:return e.abrupt("return");case 8:Object(R.updateQueryString)({method:o});case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.getCurrentMethod(),n=this.state,o=n.busyMethod,c=n.enabledMethods,r=n.recommendedMethod,i=this.props,a=i.methods,s=i.query,l=i.requesting,u=Object.keys(c).filter((function(e){return c[e]})).length;return t?Object(h.createElement)(T.Card,{className:"woocommerce-task-payment-method is-narrow"},Object(h.cloneElement)(t.container,{query:s,installStep:this.getInstallStep(),markConfigured:this.markConfigured,hasCbdIndustry:t.hasCbdIndustry})):Object(h.createElement)("div",{className:"woocommerce-task-payments"},a.map((function(t){var n=t.before,i=t.container,a=t.content,s=t.isConfigured,l=t.key,u=t.title;if(!t.visible)return null;var m=O()("woocommerce-task-payment","is-narrow",!s&&"woocommerce-task-payment-not-configured","woocommerce-task-payment-"+l),p=l===r&&!s,d=p&&"wcpay"!==l,b=p&&"wcpay"===l;return Object(h.createElement)(T.Card,{key:l,className:m},Object(h.createElement)("div",{className:"woocommerce-task-payment__before"},d&&Object(h.createElement)("div",{className:"woocommerce-task-payment__recommended-ribbon"},Object(h.createElement)("span",null,Object(_.__)("Recommended",'woocommerce'))),n),Object(h.createElement)("div",{className:"woocommerce-task-payment__text"},Object(h.createElement)(T.H,{className:"woocommerce-task-payment__title"},u,b&&Object(h.createElement)("span",{className:"woocommerce-task-payment__recommended-pill"},Object(_.__)("Recommended",'woocommerce'))),Object(h.createElement)("div",{className:"woocommerce-task-payment__content"},a)),Object(h.createElement)("div",{className:"woocommerce-task-payment__after"},i&&!s?Object(h.createElement)(y.a,{isPrimary:l===r,isSecondary:l!==r,isBusy:o===l,disabled:o,onClick:function(){return e.handleClick(t)}},Object(_.__)("Set up",'woocommerce')):Object(h.createElement)(ve.a,{checked:c[l],onChange:function(){return e.toggleMethod(l)},onClick:function(e){return e.stopPropagation()}})))})),Object(h.createElement)("div",{className:"woocommerce-task-payments__actions"},u?Object(h.createElement)(y.a,{isPrimary:!0,isBusy:l,onClick:this.completeTask},Object(_.__)("Done",'woocommerce')):Object(h.createElement)(y.a,{isLink:!0,onClick:this.skipTask},Object(_.__)("My store doesn’t take payments",'woocommerce'))))}}]),c}(h.Component),He=Object(g.a)(Object(S.withDispatch)((function(e){return{createNotice:e("core/notices").createNotice,installAndActivatePlugins:e(A.PLUGINS_STORE_NAME).installAndActivatePlugins,updateOptions:e(A.OPTIONS_STORE_NAME).updateOptions}})),Object(qe.a)((function(e,t){var n=t.createNotice,o=t.installAndActivatePlugins,c=e(A.ONBOARDING_STORE_NAME).getProfileItems,r=e(A.OPTIONS_STORE_NAME),i=r.getOption,a=r.isOptionsUpdating,s=e(A.PLUGINS_STORE_NAME),l=s.getActivePlugins,u=s.isJetpackConnected,m=(0,e(A.SETTINGS_STORE_NAME).getSettings)("general").general,p=void 0===m?{}:m,d=l(),b=c(),h=["woocommerce_woocommerce_payments_settings","woocommerce_stripe_settings","woocommerce_ppec_paypal_settings","woocommerce_payfast_settings","woocommerce_square_credit_card_settings","woocommerce_klarna_payments_settings","woocommerce_kco_settings","wc_square_refresh_tokens","woocommerce_cod_settings","woocommerce_bacs_settings","woocommerce_bacs_accounts","woocommerce_eway_settings"].reduce((function(e,t){return e[t]=i(t),e}),{}),_=Object(L.b)(p.woocommerce_default_country);return{countryCode:_,profileItems:b,activePlugins:d,options:h,methods:Object(Be.a)({activePlugins:d,countryCode:_,createNotice:n,installAndActivatePlugins:o,isJetpackConnected:u(),options:h,profileItems:b}),requesting:a()}})))(ze);function Ze(e,t,n,o){Object(F.b)("task_view",{task_name:e,wcs_installed:o.includes("woocommerce-services"),wcs_active:n.includes("woocommerce-services"),jetpack_installed:o.includes("jetpack"),jetpack_active:n.includes("jetpack"),jetpack_connected:t})}function We(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=b()(e);if(t){var c=b()(this).constructor;n=Reflect.construct(o,arguments,c)}else n=o.apply(this,arguments);return p()(this,n)}}var Qe=function(e){u()(n,e);var t=We(n);function n(e){var o;return i()(this,n),(o=t.call(this,e)).state={isCartModalOpen:!1},o}return s()(n,[{key:"componentDidMount",value:function(){document.body.classList.add("woocommerce-onboarding"),document.body.classList.add("woocommerce-task-dashboard__body"),this.recordTaskView(),this.recordTaskListView(),this.possiblyCompleteTaskList(),this.possiblyTrackCompletedTasks()}},{key:"componentDidUpdate",value:function(e){var t=this.props.query;e.query.task!==t.task&&(window.document.documentElement.scrollTop=0,this.recordTaskView()),this.possiblyCompleteTaskList(),this.possiblyTrackCompletedTasks()}},{key:"possiblyCompleteTaskList",value:function(){var e=this.props,t=e.isTaskListComplete,n=e.updateOptions;this.getIncompleteTasks().length||t||n({woocommerce_task_list_complete:"yes"})}},{key:"getCompletedTaskKeys",value:function(){return this.getVisibleTasks().filter((function(e){return e.completed})).map((function(e){return e.key}))}},{key:"getIncompleteTasks",value:function(){return this.getAllTasks().filter((function(e){return e.visible&&!e.completed}))}},{key:"possiblyTrackCompletedTasks",value:function(){var e=this.props,t=e.trackedCompletedTasks,n=e.updateOptions,o=this.getCompletedTaskKeys();0!==Object(x.xor)(t,o).length&&n({woocommerce_task_list_tracked_completed_tasks:o})}},{key:"dismissTask",value:function(e){var t=this,n=this.props,o=n.createNotice,r=n.dismissedTasks,i=n.updateOptions;o("success",Object(_.__)("Task dismissed"),{actions:[{label:Object(_.__)("Undo",'woocommerce'),onClick:function(){return t.undoDismissTask(e)}}]}),Object(F.b)("tasklist_dismiss_task",{task_name:e}),i({woocommerce_task_list_dismissed_tasks:[].concat(c()(r),[e])})}},{key:"undoDismissTask",value:function(e){var t=this.props,n=t.dismissedTasks;(0,t.updateOptions)({woocommerce_task_list_dismissed_tasks:n.filter((function(t){return t!==e}))})}},{key:"componentWillUnmount",value:function(){document.body.classList.remove("woocommerce-onboarding"),document.body.classList.remove("woocommerce-task-dashboard__body")}},{key:"getAllTasks",value:function(){var e=this.props,t=e.countryCode,n=e.profileItems,o=e.query,c=e.taskListPayments,r=e.activePlugins,i=e.installedPlugins,a=e.installAndActivatePlugins,s=e.createNotice,l=e.isJetpackConnected;return function(e){var t=e.countryCode,n=e.profileItems,o=e.taskListPayments,c=e.query,r=e.toggleCartModal,i=e.activePlugins,a=e.installedPlugins,s=e.installAndActivatePlugins,l=e.createNotice,u=e.isJetpackConnected,m=Object(D.g)("onboarding",{hasPhysicalProducts:!1,hasProducts:!1,isAppearanceComplete:!1,isTaxComplete:!1,shippingZonesCount:0}),p=m.hasPhysicalProducts,d=m.hasProducts,b=m.isAppearanceComplete,g=m.isTaxComplete,f=m.shippingZonesCount,O=Object(L.a)(n,a),y=O.products,j=O.remainingProducts,k=O.uniqueItemsList,w=Boolean(o&&o.completed),v=Boolean(o&&o.skipped),S=-1!==a.indexOf("woocommerce-payments"),E=n.completed,P=n.product_types,C=Object(_.__)("Purchase & install extensions");if(1===k.length){var N=k[0],x=N.name,T="theme"===N.type?Object(_.__)("Purchase & install %s theme",'woocommerce'):Object(_.__)("Purchase & install %s extension",'woocommerce');C=Object(_.sprintf)(T,x)}var A,I=[{key:"store_details",title:Object(_.__)("Store details",'woocommerce'),container:null,onClick:function(){Object(F.b)("tasklist_click",{task_name:"store_details"}),Object(R.getHistory)().push(Object(R.getNewPath)({},"/profiler",{}))},completed:E,visible:!0,time:Object(_.__)("4 minutes",'woocommerce')},{key:"purchase",title:C,container:null,onClick:function(){return Object(F.b)("tasklist_click",{task_name:"purchase"}),j.length?r():null},visible:y.length,completed:y.length&&!j.length,time:Object(_.__)("2 minutes",'woocommerce'),isDismissable:!0},{key:"products",title:Object(_.__)("Add my products",'woocommerce'),container:Object(h.createElement)(le,null),onClick:function(){Object(F.b)("tasklist_click",{task_name:"products"}),Object(R.updateQueryString)({task:"products"})},completed:d,visible:!0,time:Object(_.__)("1 minute per product",'woocommerce')},{key:"woocommerce-payments",title:Object(_.__)("Set up WooCommerce Payments",'woocommerce'),container:Object(h.createElement)(h.Fragment,null),completed:w||v,onClick:(A=Z()(z.a.mark((function e(t){return z.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("A"!==t.target.nodeName){e.next=2;break}return e.abrupt("return",!1);case 2:return e.next=4,new Promise((function(e,t){return Ze("wcpay",u,i,a),Object(F.b)("tasklist_click",{task_name:"woocommerce-payments"}),Object(Be.b)(e,t,l,s)}));case 4:case"end":return e.stop()}}),e)}))),function(e){return A.apply(this,arguments)}),visible:window.wcAdminFeatures.wcpay&&S&&"US"===t,additionalInfo:Object(_.__)('By setting up, you are agreeing to the <a href="https://wordpress.com/tos/" target="_blank">Terms of Service</a>','woocommerce'),time:Object(_.__)("2 minutes",'woocommerce')},{key:"payments",title:Object(_.__)("Set up payments",'woocommerce'),container:Object(h.createElement)(He,null),completed:w||v,onClick:function(){Object(F.b)("tasklist_click",{task_name:"payments"}),Object(R.updateQueryString)({task:"payments"})},visible:!S,time:Object(_.__)("2 minutes",'woocommerce')},{key:"tax",title:Object(_.__)("Set up tax",'woocommerce'),container:Object(h.createElement)(Fe,null),onClick:function(){Object(F.b)("tasklist_click",{task_name:"tax"}),Object(R.updateQueryString)({task:"tax"})},completed:g,visible:!0,time:Object(_.__)("1 minute",'woocommerce')},{key:"shipping",title:Object(_.__)("Set up shipping",'woocommerce'),container:Object(h.createElement)(Ae,null),onClick:function(){Object(F.b)("tasklist_click",{task_name:"shipping"}),Object(R.updateQueryString)({task:"shipping"})},completed:f>0,visible:P&&P.includes("physical")||p,time:Object(_.__)("1 minute",'woocommerce')},{key:"appearance",title:Object(_.__)("Personalize my store",'woocommerce'),container:Object(h.createElement)(ie,null),onClick:function(){Object(F.b)("tasklist_click",{task_name:"appearance"}),Object(R.updateQueryString)({task:"appearance"})},completed:b,visible:!0,time:Object(_.__)("2 minutes",'woocommerce')}];return Object(W.applyFilters)("woocommerce_admin_onboarding_task_list",I,c)}({countryCode:t,profileItems:n,taskListPayments:c,query:o,toggleCartModal:this.toggleCartModal.bind(this),activePlugins:r,installedPlugins:i,installAndActivatePlugins:a,createNotice:s,isJetpackConnected:l})}},{key:"getVisibleTasks",value:function(){var e=this.props.dismissedTasks;return this.getAllTasks().filter((function(t){return t.visible&&!e.includes(t.key)}))}},{key:"recordTaskView",value:function(){var e=this.props,t=e.isJetpackConnected,n=e.activePlugins,o=e.installedPlugins,c=e.query.task;c&&Ze(c,t,n,o)}},{key:"recordTaskListView",value:function(){if(!this.getCurrentTask()){var e=this.props.profileItems,t=this.getVisibleTasks();Object(F.b)("tasklist_view",{number_tasks:t.length,store_connected:e.wccom_connected})}}},{key:"keepTaskCard",value:function(){Object(F.b)("tasklist_completed",{action:"keep_card"}),this.props.updateOptions({woocommerce_task_list_prompt_shown:!0})}},{key:"hideTaskCard",value:function(e){Object(F.b)("tasklist_completed",{action:e}),this.props.updateOptions({woocommerce_task_list_hidden:"yes",woocommerce_task_list_prompt_shown:!0})}},{key:"getCurrentTask",value:function(){var e=this.props.query.task,t=this.getAllTasks().find((function(t){return t.key===e}));return t||null}},{key:"renderMenu",value:function(){var e=this;return Object(h.createElement)("div",{className:"woocommerce-card__menu woocommerce-card__header-item"},Object(h.createElement)(T.EllipsisMenu,{label:Object(_.__)("Task List Options",'woocommerce'),renderContent:function(){return Object(h.createElement)("div",{className:"woocommerce-task-card__section-controls"},Object(h.createElement)(y.a,{onClick:function(){return e.hideTaskCard("remove_card")}},Object(_.__)("Hide this",'woocommerce')))}}))}},{key:"toggleCartModal",value:function(){var e=this.state.isCartModalOpen;e||Object(F.b)("tasklist_purchase_extensions"),this.setState({isCartModalOpen:!e})}},{key:"render",value:function(){var e=this,t=this.props.query,n=this.state.isCartModalOpen,o=this.getCurrentTask(),c=this.getVisibleTasks().map((function(t){return t.className=O()(t.completed?"is-complete":null,t.className),t.before=Object(h.createElement)("div",{className:"woocommerce-task__icon"},t.completed&&Object(h.createElement)(E.a,{icon:C})),t.title=Object(h.createElement)(j.a,{as:"div",variant:t.completed?"body.small":"button"},t.title,t.additionalInfo&&Object(h.createElement)("div",{className:"woocommerce-task__additional-info",dangerouslySetInnerHTML:Object(U.a)(t.additionalInfo)}),t.time&&!t.completed&&Object(h.createElement)("div",{className:"woocommerce-task__estimated-time"},t.time)),t.completed||(t.after=t.isDismissable?Object(h.createElement)(y.a,{isTertiary:!0,onClick:function(n){n.stopPropagation(),e.dismissTask(t.key)}},Object(_.__)("Dismiss",'woocommerce')):Object(h.createElement)(E.a,{icon:N.a})),t.onClick||(t.onClick=function(e){if("A"===e.target.nodeName)return!1;Object(R.updateQueryString)({task:t.key})}),t})),r=O()("woocommerce-task-card__progress-bar",{completed:c.length===this.getCompletedTaskKeys().length});return Object(h.createElement)(h.Fragment,null,Object(h.createElement)("div",{className:"woocommerce-task-dashboard__container"},o?Object(h.cloneElement)(o.container,{query:t}):Object(h.createElement)(h.Fragment,null,Object(h.createElement)(k.a,{size:"large",className:"woocommerce-task-card woocommerce-dashboard-card"},Object(h.createElement)("progress",{className:r,max:c.length,value:this.getCompletedTaskKeys().length}),Object(h.createElement)(w.a,{size:"medium"},Object(h.createElement)(j.a,{variant:"title.small"},Object(_.__)("Finish setup",'woocommerce')),this.renderMenu()),Object(h.createElement)(v.a,null,Object(h.createElement)(T.List,{items:c}))))),n&&Object(h.createElement)(G,{onClose:function(){return e.toggleCartModal()},onClickPurchaseLater:function(){return e.toggleCartModal()}}))}}]),n}(h.Component);t.default=Object(g.a)(Object(S.withSelect)((function(e){var t=e(A.ONBOARDING_STORE_NAME).getProfileItems,n=e(A.OPTIONS_STORE_NAME).getOption,o=e(A.SETTINGS_STORE_NAME).getSettings,c=e(A.PLUGINS_STORE_NAME),r=c.getActivePlugins,i=c.getInstalledPlugins,a=c.isJetpackConnected,s=t(),l=n("woocommerce_task_list_complete")||!1,u=n("woocommerce_task_list_payments"),m=n("woocommerce_task_list_tracked_completed_tasks")||[],p=n("woocommerce_task_list_payments"),d=n("woocommerce_task_list_dismissed_tasks")||[],b=o("general").general,h=void 0===b?{}:b,_=Object(L.b)(h.woocommerce_default_country),g=r(),f=i();return{activePlugins:g,countryCode:_,dismissedTasks:d,isJetpackConnected:a(),installedPlugins:f,isTaskListComplete:l,payments:p,profileItems:s,taskListPayments:u,trackedCompletedTasks:m}})),Object(S.withDispatch)((function(e){var t=e("core/notices").createNotice,n=e(A.OPTIONS_STORE_NAME).updateOptions;return{createNotice:t,installAndActivatePlugins:e(A.PLUGINS_STORE_NAME).installAndActivatePlugins,updateOptions:n}})))(Qe)}}]);

Youez - 2016 - github.com/yon3zu
LinuXploit