"use strict";(self.webpackChunknewfold_Onboarding=self.webpackChunknewfold_Onboarding||[]).push([[328],{2607:(e,t,n)=>{n.d(t,{A:()=>b});var a=n(1609),o=n(7723),i=n(8468),r=n(6427),d=n(7143),c=n(148),s=n(4371),l=n(6079),p=n(7675),u=n(2014),g=n(8969),w=n(2202),m=n(6942),_=n.n(m);const b=(0,i.memo)((({callback:e=!1,className:t,text:n})=>{const i=(0,c.Zp)(),m=(0,c.zy)(),{nextStep:b,currentData:f,socialData:h}=(0,d.useSelect)((e=>({nextStep:e(p.M).getNextStep(),currentData:e(p.M).getCurrentOnboardingData(),socialData:e(p.M).getOnboardingSocialData()})),[]),y=null===b||!1===b,{setOnboardingSocialData:v}=(0,d.useDispatch)(p.M);return(0,a.createElement)(r.Button,{className:_()("skip-button",t),onClick:y?()=>async function(e){if(f){if(f.isComplete=(new Date).getTime(),e?.includes("basic-info")){const e=await async function(){const e=await(0,u.mt)(),t=await(0,u.oc)(h);return null!==t?.error?e?.body:t?.body}();e&&v(e),await s.y.dispatchEvents(w.XJ)}(0,l.V1)(f)}window.location.replace(g.R0)}(m.pathname):()=>("function"==typeof e&&e(),void i(b.path))},n||(0,o.__)("Skip this Step","wp-module-onboarding"))}))},328:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var a=n(1609),o=n(7723),i=n(9491),r=n(8468),d=n(7143),c=n(2607),s=n(7675),l=n(3988),p=n(4639),u=n(7677),g=n(8351),w=n(6427);const m=({id:e,path:t,title:n,desc:i,isSelected:r,onSelectedChange:d})=>(0,a.createElement)(w.Card,{className:`nfd-card ${r&&"nfd-selected-card-box"}`,onClick:t=>d(e)},(0,a.createElement)("div",{className:"nfd-card__top_row"},(0,a.createElement)("div",{className:"nfd-card__icon"},(0,a.createElement)("div",{className:r?"nfd-card__icon_box nfd-card__icon_box-selected":"nfd-card__icon_box",style:{backgroundImage:`var(${t})`}})),(0,a.createElement)("div",{className:r?"nfd-card__icon_selected":"nfd-card__icon_unselected"},(0,a.createElement)(u.A,{className:"nfd-card__icon_selected_path",icon:g.A,size:64}))),(0,a.createElement)("div",{className:`nfd-card__body ${r&&"nfd-selected-card"}`},(0,a.createElement)("h2",{className:"nfd-card__body_title"},(0,o.__)(n,"wp-module-onboarding")),(0,a.createElement)("p",{className:"nfd-card__body_description"},(0,o.__)(i,"wp-module-onboarding")))),_=({contents:e,selected:t,onSelectedChange:n})=>{const o=e.map(((e,o)=>(0,a.createElement)(m,{id:o,key:o,path:e.icon,title:e.title,desc:e.desc,onSelectedChange:n,isSelected:o===t})));return(0,a.createElement)("div",{className:"selectable_cards"},o)};var b=n(1056),f=n(2202),h=n(8969),y=n(8744);const v=()=>{const e={0:"publishing",1:"selling",2:"designing"},t={publishing:"content",selling:"store",designing:"design"},[n,u]=(0,r.useState)(0),[g,w]=(0,r.useState)(!1),m=(0,i.useViewportMatch)("medium"),{setDrawerActiveView:v,setIsDrawerOpened:S,setSidebarActiveView:E,setCurrentOnboardingData:D,setIsDrawerSuppressed:C,setIsHeaderNavigationEnabled:N}=(0,d.useDispatch)(s.M),{currentData:O,currentStep:k}=(0,d.useSelect)((e=>({currentData:e(s.M).getCurrentOnboardingData(),currentStep:e(s.M).getCurrentStep()})),[]);(0,r.useEffect)((()=>{m&&S(!0),E(!1),C(!1),v(h.vO),N(!0)}),[]),(0,r.useEffect)((()=>{g||async function(){if(O){const a=await(O?.data.topPriority.priority1);""!==a?u(parseInt((t=a,Object?.keys(e).find((n=>e[n]===t))))):(O.data.topPriority.priority1=e[n],D(O))}var t;w(!0)}()}),[g]),(0,r.useEffect)((()=>{const a=e[n];O.data.topPriority.priority1=a,D(O),(0,b.v)(new b.iC(f.N0,t[a])),"selling"===a?y.eS!==window.nfdOnboarding.currentFlow&&(window.nfdOnboarding.newFlow=y.eS,window.nfdOnboarding.currentFlow=y.eS):(window.nfdOnboarding.newFlow=void 0,window.nfdOnboarding.currentFlow=y.rA)}),[n]);const x={heading:(0,o.__)("Tell us your top priority","wp-module-onboarding"),subheading:(0,o.__)("We'll prioritize getting you there.","wp-module-onboarding"),options:[{icon:"--nfd-publish-icon",title:(0,o.__)("Publishing","wp-module-onboarding"),desc:(0,o.__)("From blogs, to newsletters, to podcasts and videos, we help the web find your content.","wp-module-onboarding")},{icon:"--nfd-selling-icon",title:(0,o.__)("Selling","wp-module-onboarding"),desc:(0,o.__)("Startup or seasoned business, drop-shipping or downloads, we've got ecommerce covered.","wp-module-onboarding")},{icon:"--nfd-design-icon",title:(0,o.__)("Designing","wp-module-onboarding"),desc:(0,o.__)("With smart style presets and powerful options, we help your site look and feel polished.","wp-module-onboarding")}]};return(0,a.createElement)(l.A,{isVerticallyCentered:!0},(0,a.createElement)(p.A,{title:x.heading,subtitle:x.subheading}),(0,a.createElement)(_,{contents:x.options,selected:n,onSelectedChange:u}),(0,a.createElement)("div",{className:"center"},(0,a.createElement)("p",{className:"info-top-priority"},(0,o.__)("Where would you like to start? We'll start there and then move into next steps.","wp-module-onboarding")),(0,a.createElement)(c.A,{callback:()=>{window.nfdOnboarding.newFlow=void 0,O.data.topPriority.priority1=e[0],D(O),(0,b.v)(new b.iC(f.vO,k.slug))}})))}}}]);