Edit file File name : 340.js Content :"use strict";(globalThis.webpackChunknewfold_Onboarding=globalThis.webpackChunknewfold_Onboarding||[]).push([[340],{2607:(e,t,a)=>{a.d(t,{A:()=>b});var r=a(1609),o=a(7723),l=a(8468),n=a(6427),i=a(7143),s=a(148),c=a(4371),d=a(6079),u=a(7675),m=a(2014),p=a(8969),w=a(2202),_=a(6942),g=a.n(_);const b=(0,l.memo)((({callback:e=!1,className:t,text:a})=>{const l=(0,s.Zp)(),_=(0,s.zy)(),{nextStep:b,currentData:h,socialData:v}=(0,i.useSelect)((e=>({nextStep:e(u.M).getNextStep(),currentData:e(u.M).getCurrentOnboardingData(),socialData:e(u.M).getOnboardingSocialData()})),[]),f=null===b||!1===b,{setOnboardingSocialData:E}=(0,i.useDispatch)(u.M);return(0,r.createElement)(n.Button,{className:g()("skip-button",t),onClick:f?()=>async function(e){if(h){if(h.isComplete=(new Date).getTime(),e?.includes("basic-info")){const e=await async function(){const e=await(0,m.mt)(),t=await(0,m.oc)(v);return null!==t?.error?e?.body:t?.body}();e&&E(e),await c.y.dispatchEvents(w.XJ)}(0,d.V1)(h)}window.location.replace(p.R0)}(_.pathname):()=>("function"==typeof e&&e(),void l(b.path))},a||(0,o.__)("Skip this Step","wp-module-onboarding"))}))},1340:(e,t,a)=>{a.r(t),a.d(t,{default:()=>A});var r=a(1609),o=a(3988),l=a(4639),n=a(7143),i=a(3582),s=a(8468),c=a(7723),d=a(3474);const u=()=>({heading:(0,c.sprintf)(/* translators: %s: website or store */ /* translators: %s: website or store */ (0,c.__)("Introduce us to this %s","wp-module-onboarding"),(0,d.P)("website")),subheading:(0,c.__)("So we can introduce it to the web","wp-module-onboarding"),siteTitle:{title:(0,c.sprintf)(/* translators: %s: Site */ /* translators: %s: Site */ (0,c.__)("%s Title","wp-module-onboarding"),(0,d.P)("Site")),placeholder:(0,c.sprintf)(/* translators: %s: Site or Store */ /* translators: %s: Site or Store */ (0,c.__)("WordPress %s","wp-module-onboarding"),(0,d.P)("Site")),hint:(0,c.__)("Shown to visitors, search engine and social media posts.","wp-module-onboarding"),maxCharacters:(0,c.__)("80","wp-module-onboarding")},siteDesc:{title:(0,c.sprintf)(/* translators: %s: Site or Store */ /* translators: %s: Site or Store */ (0,c.__)("%s Description","wp-module-onboarding"),(0,d.P)("Site")),placeholder:(0,c.sprintf)(/* translators: %s: Site or Store */ /* translators: %s: Site or Store */ (0,c.__)("Just another WordPress %s.","wp-module-onboarding"),(0,d.P)("Site")),hint:(0,c.sprintf)(/* translators: %s: site or store */ /* translators: %s: site or store */ (0,c.__)("Tell people who you are, what you sell and why they should visit your %s.","wp-module-onboarding"),(0,d.P)("site")),maxCharacters:(0,c.__)("160","wp-module-onboarding")},error:{title:(0,c.__)("Error Saving Data, Try Again!","wp-module-onboarding")}}),m=(0,s.memo)((({title:e,hint:t,placeholder:a,height:o,maxCharacters:l,textValue:n,textValueSetter:i})=>{const d=(0,s.useRef)(null),[u,m]=(0,s.useState)("nfd-input__field");return(0,s.useEffect)((()=>{d.current.style.height=o;const e=d.current.scrollHeight;d.current.style.height=e+"px"}),[n]),(0,r.createElement)("div",{className:"nfd-input"},(0,r.createElement)("label",{htmlFor:u},(0,r.createElement)("div",{className:"nfd-input__label"},(0,r.createElement)("p",{className:"nfd-input__label_title"},e),(0,r.createElement)("p",{className:"nfd-input__label_maxChar"},(p=l-n?.length,{charactersLeftPrompt:{text:(0,c.sprintf)(/* translators: %d: Character count */ /* translators: %d: Character count */ (0,c.__)("(%d characters left)","wp-module-onboarding"),p)}}).charactersLeftPrompt.text)),(0,r.createElement)("textarea",{type:"text",className:u,ref:d,style:{height:o},placeholder:a,value:n,maxLength:l,onChange:e=>(e=>{e.preventDefault(),i(e.target.value),e.target.value.length===l?m("nfd-input__field nfd-input__field_error"):m("nfd-input__field")})(e)}),(0,r.createElement)("p",{className:"nfd-input__hint"},t)));var p}));var p=a(2607),w=a(7675);const _=(0,s.memo)((({title:e,desc:t,icon:a,isSocialFormOpen:o,setIsSocialFormOpen:l})=>{const{socialDataStore:i,brandUrl:u}=(0,n.useSelect)((e=>({socialDataStore:e(w.M).getOnboardingSocialData(),brandUrl:e(w.M).getNewfoldBrandUrl()})),[]),m=((e="")=>({heading:(0,c.__)("Preview","wp-module-onboarding"),defaultTitle:(0,c.sprintf)(/* translators: %s: Site or Store */ /* translators: %s: Site or Store */ (0,c.__)("WordPress %s","wp-module-onboarding"),(0,d.P)("Site")),defaultDesc:(0,c.sprintf)(/* translators: %s: Site */ /* translators: %s: Site */ (0,c.__)("Just another WordPress %s","wp-module-onboarding"),(0,d.P)("Site")),defaultUrl:e}))(u),p=""===e?m.defaultTitle:e,_=""===t?m.defaultDesc:t,g=""===e?m.defaultUrl:`https://${e?.toLowerCase().replace(/\s/g,"").replace(/\W/g,"")}.com`,[b,h]=(0,s.useState)(""),[v,f]=(0,s.useState)(""),[E,y]=(0,s.useState)(""),[N,k]=(0,s.useState)(""),[S,T]=(0,s.useState)(""),[D,L]=(0,s.useState)(""),[x,O]=(0,s.useState)("");(0,s.useEffect)((()=>{var e,t,a,r,o;if(h(null!==(e=i?.facebook_site)&&void 0!==e?e:""),f(null!==(t=i?.twitter_site)&&void 0!==t?t:""),y(null!==(a=i?.instagram_url)&&void 0!==a?a:""),k(null!==(r=i?.youtube_url)&&void 0!==r?r:""),T(null!==(o=i?.linkedin_url)&&void 0!==o?o:""),i&&Object.keys(i).includes("other_social_urls")){const e=i.other_social_urls;var l,n;Object.keys(e).includes("yelp_url")&&L(null!==(l=e.yelp_url)&&void 0!==l?l:""),Object.keys(e).includes("tiktok_url")&&O(null!==(n=e.tiktok_url)&&void 0!==n?n:"")}}),[i]);const R=e=>{let t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol},I=[{url:b,image:"var(--facebook-icon)"},{url:v,image:"var(--twitter-icon)"},{url:E,image:"var(--instagram-icon)"},{url:N,image:"var(--youtube-icon)"},{url:S,image:"var(--linkedin-icon)"},{url:D,image:"var(--yelp-icon)"},{url:x,image:"var(--tiktok-icon)"}];return(0,r.createElement)("div",null,(0,r.createElement)("h4",{className:"mini-preview"},m.heading),(0,r.createElement)("div",{className:"browser-container"},(0,r.createElement)("div",{className:"browser-row-title"},(0,r.createElement)("div",{className:"browser-row-title_main"},(0,r.createElement)("div",{className:"browser-row-title_buttons"},(0,r.createElement)("span",{className:"browser-dot",style:{background:"#ED594A"}}),(0,r.createElement)("span",{className:"browser-dot",style:{background:"#FDD800"}}),(0,r.createElement)("span",{className:"browser-dot",style:{background:"#5AC05A"}}))),(0,r.createElement)("div",{className:"browser-row-title_bar"},(0,r.createElement)("div",{className:"browser-row-title_bar_before"},(0,r.createElement)("div",{className:"browser-row-title_bar_before-curve"})),(0,r.createElement)("div",{className:"browser-row-title_bar_main"},(void 0===a||0===a?.id)&&(0,r.createElement)("div",{className:"browser-icon-title",style:{content:"var(--default-logo-icon)"}}),void 0!==a&&0!==a?.id&&(0,r.createElement)("img",{className:"browser-icon-title",src:a?.url,alt:"Thumb"}),(0,r.createElement)("div",{className:"browser-row-title_bar_main-text"},p?.substring(0,20)),(0,r.createElement)("div",{className:"browser-row-title_bar_main-cross"},"x")),(0,r.createElement)("div",{className:"browser-row-title_bar_after"},(0,r.createElement)("div",{className:"browser-row-title_bar_after-curve"})))),(0,r.createElement)("div",{className:"browser-row-search"},(0,r.createElement)("div",{className:"browser-row-search__icons"},(0,r.createElement)("div",{className:"browser-icon",style:{backgroundImage:"var(--back-icon)"}}),(0,r.createElement)("div",{className:"browser-icon",style:{backgroundImage:"var(--forward-icon)"}}),(0,r.createElement)("div",{className:"browser-icon",style:{backgroundImage:"var(--reload-icon)"}})),(0,r.createElement)("div",{className:"browser-row-search__search-box"},(0,r.createElement)("input",{className:"browser-row-search__search-box_input",type:"text",onChange:()=>{},value:g})),(0,r.createElement)("div",{className:"browser-row-search__more"},(0,r.createElement)("div",{className:"browser-icon",style:{backgroundImage:"var(--more-icon)"}}))),(0,r.createElement)("div",{className:"browser-content"},(0,r.createElement)("div",{className:"browser-content_top-row"},(0,r.createElement)("h4",{className:"browser-content_top-row-name"},p),(0,r.createElement)("span",{className:"browser-content_top-row-link"},g)),(0,r.createElement)("h5",{className:"browser-content_desc"},_),(0,r.createElement)("div",{className:"browser-content_social"},I.map(((e,t)=>(0,r.createElement)("div",{key:e.image,tabIndex:t+1,role:"button",onClick:()=>l(!o),onKeyDown:()=>l(!o),className:`browser-content_social_icon ${e.url?R(e.url)||"--invalid-url":"--no-url"}`,style:{backgroundImage:e.image}})))))))}));var g=a(431),b=a(2014),h=a(518),v=a(9645);const f=(0,s.memo)((({icon:e,iconSetter:t})=>{const a=(0,s.useRef)(null),[o,l]=(0,s.useState)(!1),[n,i]=(0,s.useState)(!1);async function d(e){if(e){l(!0);const a=await(0,v.V)(e);if(a){const e=a?.body?.id,r=a?.body?.source_url;t({id:e,url:r})}}l(!1)}return(0,r.createElement)("div",{className:"image-uploader"},(0,r.createElement)("h4",{className:"image-uploader_heading"},(0,c.__)("Logo","wp-module-onboarding")),o?(0,r.createElement)("div",{className:"image-uploader_window"},(0,r.createElement)(h.c,null)):(0,r.createElement)("div",{className:`image-uploader_window ${n&&"image-uploader_window--on-drag"}`,onDrop:e=>(e=>{e.preventDefault(),e.stopPropagation(),i(!1),e?.dataTransfer?.files&&e?.dataTransfer?.files.length>0&&"image"===e?.dataTransfer?.files[0]?.type.split("/")[0]&&d(e?.dataTransfer?.files[0])})(e),onDragOver:e=>(e=>{e.preventDefault(),e.stopPropagation(),i(!0)})(e),onDragEnter:e=>(e=>{e.preventDefault(),e.stopPropagation(),i(!0)})(e),onDragLeave:e=>(e=>{e.preventDefault(),e.stopPropagation(),i(!1)})(e)},(0,r.createElement)("div",{className:"image-uploader_window-empty"}),(0,r.createElement)("div",{className:"image-uploader_window-logo"},(void 0===e||0===e?.id)&&(0,r.createElement)("div",{className:"image-uploader_window-logo-icon-empty"}),0!==e?.id&&void 0!==e?.id&&(0,r.createElement)("img",{className:"image-uploader_window-logo-icon-selected",src:e?.url,alt:"Thumb"})),(0,r.createElement)("div",{className:"image-uploader_window-reset"},void 0!==e&&0!==e?.id&&(0,r.createElement)("button",{className:"image-uploader_window-reset-btn",onClick:()=>{t({id:0,url:""}),a?.current?.files.length>0&&(a.current.value="")}},(0,c.__)("RESET","wp-module-onboarding")),(void 0===e||0===e?.id)&&(0,r.createElement)("button",{className:"image-uploader_window-reset-btn",onClick:()=>{a?.current.click()}},(0,c.__)("UPLOAD","wp-module-onboarding")),(0,r.createElement)("input",{className:"image-uploader_window-select-btn",accept:"image/*",type:"file",ref:a,onChange:e=>{e?.target?.files&&e?.target?.files.length>0&&d(e?.target?.files[0])}}))))})),E=e=>{let t;const[a,o]=(0,r.useState)(!0);return"hide"==e.content?(0,r.createElement)("div",null,e.children):(0,r.createElement)("div",{className:"Tooltip-Wrapper",onMouseEnter:()=>{t=setTimeout((()=>{o(!0)}),e.delay||400)},onMouseLeave:()=>{clearInterval(t),o(!1)}},e.children,a&&(0,r.createElement)("div",{className:`Tooltip-Tip ${e.direction||"top"}`},e.content))};var y=a(2538);const N=new Set(["twitter","instagram","youtube"]),k=(e,t)=>{const a=new RegExp(/goo\.gl.*|bit\.ly.*|buff\.ly.*|tinyurl\.com.*|bl\.ink.*|short\.io.*|ow\.ly.*|is\.gd.*|adf\.ly.*|bit\.do.*|t\.co.*|clk\.sh.*|gplinks\.in.*|tiny\.cc.*|wp\.me.*/gi),r=new RegExp(/.*www\./gi),o=new RegExp(/https?:\/\//gi),l=new RegExp(/((https?:\/\/(?:www\.|(?!www)))?[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi);if(e.match(a)){const a=e.match(r),l=e.match(o);return a||l||(e="https://www."+e),t.error=y.L.AD_LINK_ERROR,t.url=e,t}const n=e.match(l);if(!n)return t.error=y.L.INVALID_LINK_ERROR,t.url=e,t;let i=n[0];const s=n[0].match(r),c=n[0].match(o);return i.match(new RegExp(/http:/gi))&&(i=i.replace(/http:/gi,"https:")),s||c?!s&&c?i=i.replace(/https?:\/\//gi,"https://www."):s&&!c&&(i="https://"+i):i="https://www."+i,t.url=i,t.error=y.L.NONE,t},S=e=>!!e.match("^@?[A-Za-z0-9_]{1,25}$");var T=a(148),D=a(6427);const L=({showModal:e,setShowModal:t,modalTitle:a,modalText:o})=>{const l=(0,T.Zp)(),{navErrorModalPath:i}=(0,n.useSelect)((e=>({navErrorModalPath:e(w.M).getNavErrorPath()})),[]),{showNavErrorDialog:d,resetNavError:u}=(0,n.useDispatch)(w.M),m=()=>{u(),d(!0),t(!1)};return(0,r.createElement)(s.Fragment,null,e&&(0,r.createElement)(D.Modal,{title:a,onRequestClose:()=>m()},(0,r.createElement)("p",null,o),(0,r.createElement)(D.ButtonGroup,{className:"nfd-onboarding-etw__buttons"},(0,r.createElement)(D.Button,{variant:"secondary",onClick:()=>m()},(0,c.__)("Edit URLs","wp-module-onboarding")),(0,r.createElement)(D.Button,{variant:"primary",onClick:()=>{u(),l(i)}},(0,c.__)("Proceed Anyways","wp-module-onboarding")))))},x=({socialData:e,setSocialData:t,isSocialFormOpen:a,setIsSocialFormOpen:o})=>{const l={heading:(0,c.__)("Social Media","wp-module-onboarding"),modals:{shortUrl:{modalTitle:(0,c.__)("It looks like you're using a URL shortener!","wp-module-onboarding"),modalText:(0,c.__)("That's smart, but we encourage you to enter the standard URL for your social profiles to help search engines know this website is associated with your profile using Yoast's Open Graph support. You can always change the URLs used within your site to trackable in the future.","wp-module-onboarding")},invalidUrl:{modalTitle:(0,c.__)("One of those URLs doesn't look like a social media URL.","wp-module-onboarding"),modalText:(0,c.__)("We recommend using your official social URL to help search engines know this website is associated with your profile using Yoast's Open Graph support. You can always change the URLs used within your site in the future.","wp-module-onboarding")}},errorText:{adLinkErrorText:(0,c.__)("That's clever! Short URLs are a great way to track clicks. However, To help build your social graph, we need the full URLs to your social profiles. You can go into your menus and change your social icon links after setup.","wp-module-onboarding"),invalidLinkErrorText:(0,c.__)("To help build your social graph, we need the full URLs to your social profiles. Please check your URLs for typos and try copy & paste with the official URL if you continue to see this error.","wp-module-onboarding")}},[i,d]=(0,s.useState)(""),[u,m]=(0,s.useState)(""),[p,_]=(0,s.useState)(""),[g,b]=(0,s.useState)(""),[h,v]=(0,s.useState)(""),[f,T]=(0,s.useState)(""),[D,x]=(0,s.useState)(""),[O,R]=(0,s.useState)(!1),[I,A]=(0,s.useState)([]),[C,P]=(0,s.useState)(Object),{showNavErrorDialog:M,setOnboardingSocialData:U,resetNavError:V}=(0,n.useDispatch)(w.M),{navErrorModalPath:F}=(0,n.useSelect)((e=>({navErrorModalPath:e(w.M).getNavErrorPath()})),[]),K={FACEBOOK:{id:"facebook",value:i,name:(0,c.__)("Facebook","wp-module-onboarding")},TWITTER:{id:"twitter",value:u,name:(0,c.__)("Twitter","wp-module-onboarding")},INSTAGRAM:{id:"instagram",value:p,name:(0,c.__)("Instagram","wp-module-onboarding")},YOUTUBE:{id:"youtube",value:g,name:(0,c.__)("Youtube","wp-module-onboarding")},LINKEDIN:{id:"linkedin",value:h,name:(0,c.__)("Linkedin","wp-module-onboarding")},YELP:{id:"yelp",value:f,name:(0,c.__)("Yelp","wp-module-onboarding")},TIKTOK:{id:"tiktok",value:D,name:(0,c.__)("Tiktok","wp-module-onboarding")}};(0,s.useEffect)((()=>{""!==F&&R(!0)}),[F]),(0,s.useEffect)((()=>{var t,a,r,o,l;if(d(null!==(t=e?.facebook_site)&&void 0!==t?t:""),m(null!==(a=e?.twitter_site)&&void 0!==a?a:""),_(null!==(r=e?.instagram_url)&&void 0!==r?r:""),b(null!==(o=e?.youtube_url)&&void 0!==o?o:""),v(null!==(l=e?.linkedin_url)&&void 0!==l?l:""),e&&Object.keys(e).includes("other_social_urls")){const t=e.other_social_urls;var n,i;Object.keys(t).includes("yelp_url")&&T(null!==(n=t.yelp_url)&&void 0!==n?n:""),Object.keys(t).includes("tiktok_url")&&x(null!==(i=t.tiktok_url)&&void 0!==i?i:"")}}),[e]);const z=(a,r)=>{switch(r){case K.FACEBOOK.id:d(a),e.facebook_site=a;break;case K.TWITTER.id:m(a),e.twitter_site=a;break;case K.INSTAGRAM.id:_(a),e.instagram_url=a;break;case K.YOUTUBE.id:b(a),e.youtube_url=a;break;case K.LINKEDIN.id:v(a),e.linkedin_url=a;break;case K.YELP.id:T(a),e.other_social_urls={...e.other_social_urls},e.other_social_urls.yelp_url=a;break;case K.TIKTOK.id:x(a),e.other_social_urls={...e.other_social_urls},e.other_social_urls.tiktok_url=a}U(e),t(e)},B=()=>{let e=y.L.NONE;for(const t in C)C[t]!==y.L.NONE&&(e=C[t]);return e},Y=e=>{const t=e.target.value,a=e.target.id,r=((e,t)=>{const a={url:t,error:y.L.NONE};if(""===t)return a;if(!N.has(e))return k(t,a);switch(e){case"twitter":return((e,t)=>S(e)?("@"===e.charAt(0)&&(e=e.substr(1)),t.url="https://www.twitter.com/"+e,t):k(e,t))(t,a);case"instagram":return((e,t)=>S(e)?("@"===e.charAt(0)&&(e=e.substr(1)),t.url="https://www.instagram.com/"+e,t):k(e,t))(t,a);case"youtube":return((e,t)=>S(e)?(t.url="https://www.youtube.com/"+e,t):k(e,t))(t,a)}})(a,t);C[a]=r.error,P(C),((e,t)=>{if(t)I.includes(e)||A([...I,e]);else{const t=I.filter((function(t){return t!==e}));A(t)}})(a,r.error!==y.L.NONE),B()!==y.L.NONE?M(!0):V(),z(r.url,a)};return(0,r.createElement)("div",{className:"social-form"},O&&(()=>{switch(B()){case y.L.AD_LINK_ERROR:return(0,r.createElement)(L,{showModal:O,setShowModal:R,modalTitle:l.modals.shortUrl.modalTitle,modalText:l.modals.shortUrl.modalText});case y.L.INVALID_LINK_ERROR:return(0,r.createElement)(L,{showModal:O,setShowModal:R,modalTitle:l.modals.invalidUrl.modalTitle,modalText:l.modals.invalidUrl.modalText});default:return null}})(),(0,r.createElement)("div",{role:"button",tabIndex:0,onKeyDown:()=>o(!a),className:"social-form__top-row",onClick:()=>o(!a)},(0,r.createElement)("div",{className:"social-form__top-row_heading"},l.heading),(0,r.createElement)("div",{className:"social-form__top-row_icon "+(a?"social-form__top-row_icon_opened":"")})),(0,r.createElement)("form",{className:a?"social-form__main-active":"social-form__main-hidden"},Object.keys(K).map((e=>{return(0,r.createElement)("div",{key:K[e].id},(0,r.createElement)("label",{htmlFor:K[e].id,className:`social-form__label social-form__label-${K[e].id}`},(0,r.createElement)("div",{className:"social-form__label_icon",style:{backgroundImage:`var(--${K[e].id}-icon)`}}),(0,r.createElement)("div",{className:"social-form__label_name"},K[e].name)),(0,r.createElement)(E,{content:I.includes(K[e].id)?(t=K[e].id,"ad-link-error"===C[t]?l.errorText.adLinkErrorText:l.errorText.invalidLinkErrorText):"hide",direction:K[e].id===K.TIKTOK.id?"top":"bottom"},(0,r.createElement)("input",{className:I.includes(K[e].id)?"social-form__box-error":"social-form__box",type:"url",id:`${K[e].id}`,value:K[e].value,onChange:e=>{(e=>{const t=e.target.value,a=e.target.id;z(t,a)})(e)},onBlur:e=>Y(e)})));var t}))))},O=()=>{const e=(0,s.useRef)(null),[t,a]=(0,s.useState)(),[o,l]=(0,s.useState)(!1),[c,d]=(0,s.useState)(),[h,v]=(0,s.useState)(""),[E,y]=(0,s.useState)(""),[N,k]=(0,s.useState)(),[S,T]=(0,s.useState)(),[D,L]=(0,s.useState)(!1),{setOnboardingSocialData:O,setCurrentOnboardingData:R}=(0,n.useDispatch)(w.M),{editEntityRecord:I}=(0,n.useDispatch)(i.store),{getEditedEntityRecord:A}=(0,n.useSelect)((e=>e(i.store)),[]),{currentData:C}=(0,n.useSelect)((e=>({currentData:e(w.M).getCurrentOnboardingData()})),[]),P=u();return(0,s.useEffect)((()=>{D&&e.current.scrollIntoView()}),[D]),(0,s.useEffect)((()=>{var e,r;o||async function(){const e=await(0,b.mt)();T(e?.body),a(C),d(t),l(!0),O(e?.body)}(),A("root","site"),o&&(k(t?.data?.siteLogo),v(null!==(e=t?.data?.blogName)&&void 0!==e?e:""),y(null!==(r=t?.data?.blogDescription)&&void 0!==r?r:""))}),[o]),(0,s.useEffect)((()=>{const e=setTimeout((()=>{o&&d({data:{siteLogo:N,blogName:h,blogDescription:E,socialData:S}})}),600);return()=>{clearTimeout(e)}}),[h,E,N,S]),(0,s.useEffect)((()=>{c&&(async()=>{var e,t,a;const r=C;var o,l,n;r.data.siteLogo=null!==(e=c.data.siteLogo)&&void 0!==e?e:r.data.siteLogo,r.data.blogName=null!==(t=c.data.blogName)&&void 0!==t?t:r.data.blogName,r.data.blogDescription=null!==(a=c.data.blogDescription)&&void 0!==a?a:r.data.blogDescription,o=r.data.siteLogo,l=r.data.blogName,n=r.data.blogDescription,I("root","site",void 0,{site_logo:o?.id?o.id:null,description:n,title:l}),R(r)})()}),[c]),(0,r.createElement)(g.A,{type:"fade-in-disabled",after:"object"==typeof t&&"object"==typeof S},(0,r.createElement)("div",{className:"basic-info"},(0,r.createElement)("div",{className:"basic-info-form"},(0,r.createElement)("div",{className:"basic-info-form__left"},(0,r.createElement)(m,{title:P.siteTitle.title,hint:P.siteTitle.hint,placeholder:P.siteTitle.placeholder,maxCharacters:P.siteTitle.maxCharacters,height:"47px",textValue:h,textValueSetter:v}),(0,r.createElement)(m,{title:P.siteDesc.title,hint:P.siteDesc.hint,placeholder:P.siteDesc.placeholder,maxCharacters:P.siteDesc.maxCharacters,height:"100px",textValue:E,textValueSetter:y}),(0,r.createElement)("div",{ref:e},(0,r.createElement)(x,{socialData:S,setSocialData:T,isSocialFormOpen:D,setIsSocialFormOpen:L}))),(0,r.createElement)("div",{className:"basic-info-form__right"},(0,r.createElement)(f,{icon:N,iconSetter:k}),(0,r.createElement)(_,{icon:N,title:h,desc:E,isSocialFormOpen:D,setIsSocialFormOpen:L}))),(0,r.createElement)(p.A,null)))};var R=a(8969),I=a(9491);const A=()=>{const e=(0,I.useViewportMatch)("medium"),{setIsDrawerOpened:t,setDrawerActiveView:a,setSidebarActiveView:i,setIsDrawerSuppressed:c,setIsHeaderNavigationEnabled:d}=(0,n.useDispatch)(w.M),m=u();return(0,s.useEffect)((()=>{e&&t(!0),i(R.Qe),c(!1),a(R.vO),d(!0)}),[]),(0,r.createElement)(o.A,{isVerticallyCentered:!0},(0,r.createElement)(l.A,{title:m.heading,subtitle:m.subheading}),(0,r.createElement)(O,null))}},9645:(e,t,a)=>{a.d(t,{V:()=>i});var r=a(5435),o=a(8674),l=a(1455),n=a.n(l);async function i(e){const t=await function(e){return new Promise(((t,a)=>{const r=new FileReader;r.addEventListener("loadend",(e=>t(e.target.result))),r.addEventListener("error",a),r.readAsArrayBuffer(e)}))}(e),a={"Content-Type":"image/png"};return a["Content-Disposition"]="attachment; filename="+e.name,await(0,r.h)(n()({url:(0,o.zV)("media"),method:"POST",headers:a,body:t}))}}}]); Save