"use strict";(globalThis.webpackChunknewfold_Onboarding=globalThis.webpackChunknewfold_Onboarding||[]).push([[403],{1403:(e,t,a)=>{a.r(t),a.d(t,{default:()=>F});var n=a(1609),r=a(8468),l=a(7723),s=a(7677),o=a(5573);const c=(0,n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,n.createElement)(o.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"}));var d=a(7143),i=a(7675);const m=()=>{const{currentUserInfo:e}=(0,d.useSelect)((e=>({currentUserInfo:e(i.M).getCurrentUserDetails()})),[]);return e?(0,n.createElement)("div",{className:"nfd-onboarding-header__admin-bar"},(0,n.createElement)("div",{className:"nfd-onboarding-header__admin-bar__wplogo"},(0,n.createElement)(s.A,{icon:c}),(0,n.createElement)("span",null,(0,l.__)("WordPress","wp-module-onboarding"))),(0,n.createElement)("div",{className:"nfd-onboarding-header__admin-bar__profile"},(0,n.createElement)("span",{className:"nfd-onboarding-header__admin-bar__profile__greeting"},(0,n.createElement)("span",null,(0,l.__)("Howdy! ","wp-module-onboarding"),e.displayName)),(0,n.createElement)("div",{className:"nfd-onboarding-header__admin-bar__profile__avatar"},(0,n.createElement)("img",{src:e.avatarUrl,alt:e.displayName})))):null},p=({progress:e=20})=>(0,n.createElement)("div",{className:"nfd-onboarding-header__progress-bar"},(0,n.createElement)("div",{style:{width:`${e}%`},className:"nfd-onboarding-header__progress-bar__progress"}));var u=a(6427),g=a(8969),_=a(9034),E=a(1607),h=a(148),b=a(6942),v=a.n(b);const S=({children:e,onClick:t})=>(0,n.createElement)(u.Button,{onClick:()=>t(),className:v()("nfd-onboarding-button--dark")},e);var f=a(4635),w=a(4805);const N=({path:e})=>{const{siteGenErrorStatus:t}=(0,d.useSelect)((e=>({siteGenErrorStatus:e(i.M).getSiteGenErrorStatus()}))),{updateSiteGenErrorStatus:a}=(0,d.useDispatch)(i.M),r=(0,h.Zp)();return(0,n.createElement)(S,{onClick:()=>{!0===t&&a(!1),r(e,{state:{origin:"header"}})},variant:"secondary"},(0,n.createElement)(s.A,{icon:E.A}),(0,l.__)("Back","wp-module-onboarding"))},M=()=>{const{previousStep:e,currentStep:t}=(0,d.useSelect)((e=>({previousStep:e(i.M).getPreviousStep(),currentStep:e(i.M).getCurrentStep()})),[]),a=null===e||!1===e,r=t?.path===f.E?.path;return(0,n.createElement)("div",{className:"nfd-onboarding-header--sitegen__step-navigation"},a?(0,n.createElement)(n.Fragment,null):(0,n.createElement)(N,{path:r?w.O.path:e.path}))};var C=a(6087),k=a(3731);const F=(0,r.memo)((()=>{const{isHeaderNavigationEnabled:e,currentStep:t,allSteps:a}=(0,d.useSelect)((e=>({currentStep:e(i.M).getCurrentStep(),isHeaderNavigationEnabled:e(i.M).isHeaderNavigationEnabled(),allSteps:e(i.M).getAllSteps()}))),r=(0,C.findIndex)(a,{path:t?.path}),l=Math.abs((r-1)/(a.length-1)*100);return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(u.Fill,{name:`${g.Ix}/${g.KK}`},(0,n.createElement)(n.Fragment,null,(0,n.createElement)(m,null),t!==_.O&&t!==k.O&&(0,n.createElement)(p,{progress:l}))),(0,n.createElement)(u.Fill,{name:`${g.Ix}/${g.nK}`},(0,n.createElement)(n.Fragment,null,e&&(0,n.createElement)(M,null))),t?.header&&(0,n.createElement)(t.header,null))}))}}]);