"use strict";(globalThis.webpackChunknewfold_Onboarding=globalThis.webpackChunknewfold_Onboarding||[]).push([[546],{9964:(e,t,a)=>{a.d(t,{A:()=>r});var n=a(1609),s=a(6942),i=a.n(s);const r=({className:e="",size:t,colGap:a=0,children:s})=>(0,n.createElement)("div",{className:i()("nfd-onboarding-grid",e),style:{gridTemplateColumns:`repeat(${t}, 1fr)`,gridColumnGap:`${a}px`}},s)},1546:(e,t,a)=>{a.r(t),a.d(t,{default:()=>y});var n=a(1609),s=a(7143),i=a(8468),r=a(148),l=a(2364),o=a(7675),c=a(3988),d=a(4639),m=a(7225),u=a(8520),p=a(7517),h=a(8294),g=a(8969),S=a(1032),_=a(7044),b=a(2940),w=a(1056),v=a(2202),f=a(9964);const y=()=>{const e=(0,l.A)(),t=(0,r.zy)(),[a,y]=(0,i.useState)(),[k,E]=(0,i.useState)(),[C,A]=(0,i.useState)(),x=(0,r.Zp)(),{currentStep:N,nextStep:D,currentData:M,storedPreviewSettings:P,allSteps:z,themeStatus:G,themeVariations:O}=(0,s.useSelect)((e=>({currentStep:e(o.M).getStepFromPath(t.pathname),nextStep:e(o.M).getNextStep(),currentData:e(o.M).getCurrentOnboardingData(),storedPreviewSettings:e(o.M).getPreviewSettings(),allSteps:e(o.M).getAllSteps(),themeStatus:e(o.M).getThemeStatus(),themeVariations:e(o.M).getStepPreviewData()})),[]),{setDrawerActiveView:T,setSidebarActiveView:V,updatePreviewSettings:$,setCurrentOnboardingData:F,updateThemeStatus:I,updateAllSteps:W}=(0,s.useDispatch)(o.M);return(0,i.useEffect)((()=>{V(g.Qe),T(g.VG)}),[]),(0,i.useEffect)((()=>{G===g.Er&&(async()=>{const e=await(0,u.O)(N?.data?.patternId,!0);if(e?.error)return I(g.So);const t=await(0,p.w6)(!0);if(t?.error)return I(g.So);A(M.data.theme.variation),y(e?.body),E(t?.body),A(M.data.theme.variation)})()}),[G]),(0,n.createElement)(S.UX,null,(0,n.createElement)(c.A,null,(0,n.createElement)("div",{className:"theme-styles-menu"},(0,n.createElement)(d.A,{title:e.heading},(0,n.createElement)("h3",{className:"nfd-main-heading__subtitle"},`${e.subheading} `,(0,n.createElement)("button",{className:"theme-styles-menu__custom-pages-link",onClick:()=>{const e=(0,b.xG)(z,h.x.conditionalSteps);W(e.allSteps),M.data.customDesign=!0,F(M),x(h.x.conditionalSteps[0].path)}},e.subheading_link))),(0,n.createElement)("div",{className:"theme-styles-menu__list"},(0,n.createElement)(f.A,{size:3},(0,n.createElement)(_._Z,{className:"theme-styles-menu__list__item",count:O[N?.data?.patternId]?.previewCount,watch:a&&k,callback:()=>k?.map(((e,t)=>(0,n.createElement)(_.ph,{key:t,className:"theme-styles-menu__list__item",selected:e.title===C,blockGrammer:a,viewportWidth:900,styling:"custom",previewSettings:e,overlay:!0,onClick:()=>(e=>{const t=k[e];$((0,m.AN)(t,P)),A(t.title),M.data.theme.variation=t.title,F(M),x(D.path),(0,w.v)(new w.iC(v.hi,t.title))})(t)}))),viewportWidth:900}))))))}},2364:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(7723);const s=()=>({heading:(0,n.__)("Lets tailor your theme for the perfect fit","wp-module-onboarding"),subheading:(0,n.__)("Start with a style preset or","wp-module-onboarding"),
/* translators: build a custom design is a link, this would be concatenated with "Start with a style preset or" making it
     "Start with a style preset or build a custom design."*/
subheading_link:(0,n.__)("build a custom design.","wp-module-onboarding"),checkbox_label:(0,n.__)("Customize Colors & Fonts?","wp-module-onboarding"),checkbox_hint:(0,n.__)("Check to customize in the next few steps (or leave empty and use the Site Editor later)","wp-module-onboarding")})}}]);