"use strict";(self.webpackChunknewfold_Onboarding=self.webpackChunknewfold_Onboarding||[]).push([[560],{9964:(e,t,a)=>{a.d(t,{A:()=>i});var n=a(1609),r=a(6942),s=a.n(r);const i=({className:e="",size:t,colGap:a=0,children:r})=>(0,n.createElement)("div",{className:s()("nfd-onboarding-grid",e),style:{gridTemplateColumns:`repeat(${t}, 1fr)`,gridColumnGap:`${a}px`}},r)},560:(e,t,a)=>{a.r(t),a.d(t,{default:()=>f});var n=a(1609),r=a(148),s=a(8468),i=a(7143),o=a(8520),c=a(7675),l=a(3988),u=a(8969),m=a(4639),d=a(1032),p=a(7044),g=a(1056),h=a(7723);var w=a(2202),_=a(9964);const f=()=>{const e=(0,r.zy)(),[t,a]=(0,s.useState)(),[f,v]=(0,s.useState)([]),[b,E]=(0,s.useState)(0),{currentStep:S,currentData:k,themeStatus:y,themeVariations:C}=(0,i.useSelect)((t=>({currentStep:t(c.M).getStepFromPath(e.pathname),currentData:t(c.M).getCurrentOnboardingData(),themeStatus:t(c.M).getThemeStatus(),themeVariations:t(c.M).getStepPreviewData()})),[]),{setDrawerActiveView:P,setSidebarActiveView:D,setCurrentOnboardingData:N,updateThemeStatus:A}=(0,i.useDispatch)(c.M);(0,s.useEffect)((()=>{D(u.Qe),P(u.VG)}),[]),(0,s.useEffect)((()=>{y===u.Er&&async function(){const e=await(0,o.O)(S?.data?.patternId);if(e?.error)return A(u.So);a(function(e){const t=[];return e.forEach((e=>{t.push(e.content),f.push(e.slug)})),v(f),t}(e?.body)),""!==k?.data.sitePages.homepage?E(f?.indexOf(k?.data.sitePages.homepage)):(k.data.sitePages={...k.data.sitePages,homepage:f[0]},N(k))}()}),[y]);const O={heading:(0,h.__)("There’s no place like a great home page","wp-module-onboarding"),subheading:(0,h.__)("Pick a starter layout you can refine and remix with your content","wp-module-onboarding")};return(0,n.createElement)(d.UX,null,(0,n.createElement)(p.Th,null,(0,n.createElement)(l.A,null,(0,n.createElement)("div",{className:"homepage_preview"},(0,n.createElement)(m.A,{title:O.heading,subtitle:O.subheading}),(0,n.createElement)("div",{className:"homepage_preview__list"},(0,n.createElement)(_.A,{size:3,colGap:50},(0,n.createElement)(p._Z,{watch:t,count:C[S?.data?.patternId]?.previewCount,callback:function(){return t?.map(((e,t)=>e?(0,n.createElement)(p.ph,{key:t,className:"homepage_preview__list__item",selected:t===b,blockGrammer:e,viewportWidth:1200,styling:"custom",overlay:!1,onClick:()=>function(e){E(e);const t=f[e];k.data.sitePages={...k.data.sitePages,homepage:t},N(k),(0,g.v)(new g.iC(w.DN,t))}(t)}):null))},className:"homepage_preview__list__item",viewportWidth:1200})))))))}}}]);