Current Path : /storage/v11800/romasitenew/public_html/wp-content/plugins/google-listings-and-ads/js/build/ |
Linux v11800 5.3.0-1023-aws #25~18.04.1-Ubuntu SMP Fri Jun 5 15:19:18 UTC 2020 aarch64
|
Current File : /storage/v11800/romasitenew/public_html/wp-content/plugins/google-listings-and-ads/js/build/commons.js |
"use strict";(self.webpackChunkgoogle_listings_and_ads=self.webpackChunkgoogle_listings_and_ads||[]).push([[351],{9770:function(e,t,n){n.d(t,{O:function(){return v},Z:function(){return S}});var a=n(7462),o=n(9307),l=n(5736),s=n(4184),r=n.n(s),i=n(5609),c=n(4886),d=n(1984),u=n(1526),g=n(1693),m=n(9054),p=n.p+"images/js/src/components/account-card/5585d65b9d8c575e5a1f.gogole-g-logo.svg",h=n.p+"images/js/src/components/account-card/6daf36ba57db9c82b6e0.google-merchant-center-logo.svg",_=n.p+"images/js/src/components/account-card/389bc604a859dff92f15.google-ads-logo.svg",f=n.p+"images/js/src/components/account-card/25a37606f64ef10ff60e.wp-logo.svg",E=n.p+"images/js/src/components/account-card/829c5735b6338e133556.final-url-icon.svg";const v={EMPTY:"empty",WPCOM:"wpcom",GOOGLE:"google",GOOGLE_MERCHANT_CENTER:"google_merchant_center",GOOGLE_ADS:"google_ads",PHONE:"phone",ADDRESS:"address",FINAL_URL:"final_url"},y=(0,o.createElement)("img",{src:p,alt:(0,l.__)("Google Logo","google-listings-and-ads"),width:"40",height:"40"}),b=(0,o.createElement)("img",{src:h,alt:(0,l.__)("Google Merchant Center Logo","google-listings-and-ads"),width:"40",height:"40"}),Z=(0,o.createElement)("img",{src:_,alt:(0,l.__)("Google Ads Logo","google-listings-and-ads"),width:"40",height:"40"}),C=(0,o.createElement)("img",{src:f,alt:(0,l.__)("WordPress.com Logo","google-listings-and-ads"),width:"40",height:"40"}),w=(0,o.createElement)("img",{src:E,alt:(0,l.__)("Final URL icon","google-listings-and-ads"),width:"50"}),k={[v.EMPTY]:{},[v.WPCOM]:{icon:C,title:"WordPress.com"},[v.GOOGLE]:{icon:y,title:(0,l.__)("Google","google-listings-and-ads")},[v.GOOGLE_MERCHANT_CENTER]:{icon:b,title:(0,l.__)("Google Merchant Center","google-listings-and-ads"),description:(0,l.__)("Required to sync products and list on Google.","google-listings-and-ads")},[v.GOOGLE_ADS]:{icon:Z,title:(0,l.__)("Google Ads","google-listings-and-ads"),description:(0,l.__)("Required to set up conversion measurement and create campaigns.","google-listings-and-ads")},[v.PHONE]:{icon:(0,o.createElement)(c.Z,{size:32}),title:(0,l.__)("Phone number","google-listings-and-ads")},[v.ADDRESS]:{icon:(0,o.createElement)(d.Z,{icon:u.Z,size:32}),title:(0,l.__)("Store address","google-listings-and-ads")},[v.FINAL_URL]:{icon:w,title:(0,l.__)("Final URL","google-listings-and-ads")}},N={center:!1,top:"gla-account-card__styled--align-top"};function S(e){let{className:t,disabled:n=!1,appearance:l=v.EMPTY,icon:s=k[l].icon,title:c=k[l].title,description:d=k[l].description,helper:u,alignIcon:p="center",indicator:h,alignIndicator:_="center",children:f,...E}=e;const y=r()("gla-account-card",!!n&&"gla-account-card--is-disabled",t),b=r()("gla-account-card__icon",N[p]),Z=r()("gla-account-card__indicator",N[_]);return(0,o.createElement)(g.Z.Card,(0,a.Z)({className:y},E),(0,o.createElement)(g.Z.Card.Body,null,(0,o.createElement)(i.Flex,{gap:4},s&&(0,o.createElement)(i.FlexItem,{className:b},s),(0,o.createElement)(i.FlexBlock,null,c&&(0,o.createElement)(m.Z.Title,{className:"gla-account-card__title"},c),d&&(0,o.createElement)("div",{className:"gla-account-card__description"},d),u&&(0,o.createElement)("div",{className:"gla-account-card__helper"},u)),h&&(0,o.createElement)(i.FlexItem,{className:Z},h))),f)}},4752:function(e,t,n){n.d(t,{Z:function(){return g},S:function(){return c}});var a=n(7462),o=n(9307),l=n(6020),s=n(2819),r=n(9160);const i=(0,o.createContext)(null);function c(){const e=(0,o.useContext)(i);if(null===e)throw new Error("useAdaptiveFormContext was used outside of its context provider AdaptiveForm.");return e}const d="submitting",u="submitted";var g=(0,o.forwardRef)((function(e,t){let{onSubmit:n,extendAdapter:c,children:g,...m}=e;const p=(0,o.useRef)(),h=(0,o.useRef)({submitter:null}),[_,f]=(0,o.useState)([]),[E,v]=(0,o.useState)(),y=(0,o.useCallback)((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];f((e=>[...e,t]))}),[]);(0,o.useEffect)((()=>{E&&h.current.setValueCompatibly(...E)}),[E]),(0,o.useImperativeHandle)(t,(()=>({setValue:y,...p.current})));const b=(0,r.Z)(),[Z,C]=(0,o.useState)(0),w=(0,o.useCallback)((()=>{C((e=>e+1))}),[]),k=(0,o.useCallback)((()=>{C(0)}),[]),[N,S]=(0,o.useState)(null),x=N===d,A=N===u;return n&&(m.onSubmit=async function(e){S(d);let t=!1;const a={submitter:h.current.submitter,signalFailedSubmission(){t=!0}};await n.call(this,e,a),b()&&(h.current.submitter=null,S(t?null:u))}),(0,o.createElement)(l.Form,(0,a.Z)({},m,{ref:p}),(e=>{let{setValue:t,setValues:n,getInputProps:a,handleSubmit:l,...r}=e;if(h.current.setValueCompatibly=(e,a)=>{n?n({[e]:a}):t(e,a)},r.setValue=y,r.getInputProps=e=>{const t=a(e);return{...t,onChange:function(n){(function(e){return(e?.nativeEvent||e)instanceof Event})(n)&&(n="checkbox"===n.target.type?!(0,s.get)(t.values,e):n.target.value),h.current.setValueCompatibly(e,n)}}},_.length&&setTimeout((()=>v(_.shift()))),r.handleSubmit=function(e){return h.current.submitter=e?.currentTarget||null,l.call(this,e)},r.adapter={isSubmitting:x,isSubmitted:A,submitter:h.current.submitter,validationRequestCount:Z,requestedShowValidation:Z>0,showValidation:w,hideValidation:k},"function"==typeof c){const e=c(r);Object.assign(r.adapter,e)}return(0,o.createElement)(i.Provider,{value:r},"function"==typeof g?g(r):g)}))}))},7714:function(e,t,n){var a=n(9307);t.Z=e=>{const{button:t,modal:n}=e,{onClick:o=(()=>{})}=t.props,{onRequestClose:l=(()=>{})}=n.props,[s,r]=(0,a.useState)(!1);return(0,a.createElement)(a.Fragment,null,(0,a.cloneElement)(t,{onClick:function(){r(!0),o(...arguments)}}),s&&(0,a.cloneElement)(n,{onRequestClose:function(){r(!1),l(...arguments)}}))}},965:function(e,t,n){var a=n(7462),o=n(9307),l=n(5609),s=n(6020),r=n(4184),i=n.n(r),c=n(1410);t.Z=e=>{const{className:t,disabled:n,loading:r,eventName:d,eventProps:u,text:g,onClick:m=(()=>{}),...p}=e,h=n||r,_=["app-button",t];let f;return r&&(f=(0,o.createElement)(s.Spinner,null)),g&&(f=(0,o.createElement)(o.Fragment,null,r&&(0,o.createElement)(s.Spinner,null),g),p.icon&&_.push("app-button--icon-with-text"),"right"===p.iconPosition&&_.push("app-button--icon-position-right")),(0,o.createElement)(l.Button,(0,a.Z)({className:i()(..._),disabled:h,"aria-disabled":h,text:f,onClick:function(){d&&(0,c.dk)(d,u),m(...arguments)}},p))}},8027:function(e,t,n){var a=n(7462),o=n(9307),l=n(3201);t.Z=e=>{const{context:t,linkId:n,href:s,...r}=e;return(0,o.createElement)(l.Z,(0,a.Z)({eventProps:{context:t,link_id:n,href:s},type:"external",target:"_blank",href:s},r,{eventName:"gla_documentation_link_click"}))}},2:function(e,t,n){var a=n(7462),o=n(9307),l=n(4184),s=n.n(l),r=n(5736),i=n(5609),c=n(6121);const d="app-input-control";t.Z=(0,o.forwardRef)(((e,t)=>{let{className:n,noPointerEvents:l=!1,maxCharacterCount:u=0,kindCharacterCount:g,...m}=e;const p=[d,n];let h;if(l&&p.push(`${d}--no-pointer-events`),u>0&&g){const e=(0,c.Z)(g)(m.value?.trim()||"");h=(0,r.sprintf)(
// translators: 1: number of character count. 2: the maximum number of character count.
(0,r.__)("%1$d/%2$d characters","google-listings-and-ads"),e,u),e>u&&p.push(`${d}--error-character-count`)}return(0,o.createElement)("div",{className:s()(p)},(0,o.createElement)(i.__experimentalInputControl,(0,a.Z)({ref:t},m)),h&&(0,o.createElement)("div",{className:"app-input-control__character-count"},h))}))},4594:function(e,t,n){n.d(t,{Z:function(){return d}});var a=n(7462),o=n(9307),l=n(2),s=(e,t)=>{const{decimalSeparator:n}=t,a=new RegExp("[^0-9-"+n+"]",["g"]),o=parseFloat((""+e).replace(/\((.*)\)/,"-$1").replace(a,"").replace(n,"."));return isNaN(o)?0:o},r=n(4485),i=e=>({...(0,r.Z)(),precision:0,...e}),c=n(2164),d=e=>{const{value:t,numberSettings:n,onChange:r=(()=>{}),onBlur:d=(()=>{}),...u}=e,g=i(n),m=(e=>{const t=i(e);return(0,c.Z)(t)})(n),[,p]=(0,o.useReducer)((e=>e+1),0),h=m(t),_=e=>{const t=s(e,g),n=m(t);return s(n,g)};return(0,o.createElement)(l.Z,(0,a.Z)({value:h,onChange:e=>{const t=_(e);r(t),p()},onBlur:e=>{const t=_(e.target.value);d(e,t)}},u))}},4140:function(e,t,n){var a=n(7462),o=n(9307),l=n(4485),s=n(4594);t.Z=e=>{const t=(0,l.Z)();return(0,o.createElement)(s.Z,(0,a.Z)({suffix:t.code,numberSettings:t},e))}},591:function(e,t,n){var a=n(7462),o=n(9307),l=n(5609),s=n(4184),r=n.n(s);const i={auto:!1,visible:"app-modal__styled--overflow-visible"};t.Z=e=>{let{className:t,overflow:n="auto",buttons:s=[],children:c,...d}=e;const u=r()("gla-admin-page","app-modal",i[n],t);return(0,o.createElement)(l.Modal,(0,a.Z)({className:u},d),c,s.length>=1&&(0,o.createElement)("div",{className:"app-modal__footer"},s))}},9985:function(e,t,n){var a=n(7462),o=n(9307),l=n(4184),s=n.n(l),r=n(5609);t.Z=e=>{const{className:t,label:n,value:l,selected:i,collapsible:c=!1,children:d,...u}=e,g=i===l;return(0,o.createElement)("div",{className:s()("app-radio-content-control",t)},(0,o.createElement)(r.RadioControl,(0,a.Z)({},u,{selected:i,checked:g,options:[{label:n,value:l}],help:""})),(!c||g)&&(0,o.createElement)("div",{className:"app-radio-content-control__content"},d))}},3091:function(e,t,n){var a=n(9307),o=n(5609),l=n(4184),s=n.n(l);t.Z=e=>{const{className:t,...n}=e;return(0,a.createElement)("div",{className:s()("app-select-control",t)},(0,a.createElement)(o.SelectControl,n))}},279:function(e,t,n){var a=n(9307),o=n(6020);t.Z=()=>(0,a.createElement)("div",{className:"app-spinner"},(0,a.createElement)(o.Spinner,null))},5809:function(e,t,n){var a=n(9307),o=n(5609);t.Z=e=>(0,a.createElement)("div",{className:"app-standalone-toggle-control"},(0,a.createElement)(o.ToggleControl,e))},5621:function(e,t,n){var a=n(9307),o=n(5609),l=n(6020),s=n(4184),r=n.n(s);t.Z=e=>{const{selectedKey:t,tabs:n}=e;return(0,a.createElement)(o.NavigableMenu,{role:"tablist",orientation:"horizontal",className:"subsubsub gla-sub-nav"},n.map(((e,o)=>{const s=e.key===t;return(0,a.createElement)(a.Fragment,{key:e.key},(0,a.createElement)(l.Link,{className:r()({current:s}),tabIndex:s?null:-1,id:`${e.key}`,href:e.href,role:"tab","aria-selected":s,"aria-controls":`${e.key}-view`,"aria-current":!!s&&"page"},e.title+" "),o<n.length-1?" | ":" ")})))}},4492:function(e,t,n){var a=n(7462),o=n(9307),l=n(5609),s=n(6020),r=n(4184),i=n.n(r);const c=e=>{let{tabId:t,href:n,children:l,selected:r,...i}=e;return(0,o.createElement)(s.Link,(0,a.Z)({role:"tab",tabIndex:r?null:-1,"aria-selected":r,id:t,href:n},i),l)};t.Z=e=>{const{selectedKey:t,tabs:n}=e;return(0,o.createElement)("div",{className:"app-tab-nav"},(0,o.createElement)(l.NavigableMenu,{role:"tablist",orientation:"horizontal",className:"app-tab-nav__tabs"},n.map((e=>(0,o.createElement)(c,{className:i()("components-button","app-tab-nav__tabs-item",{"is-active":e.key===t}),tabId:`${e.key}`,"aria-controls":`${e.key}-view`,selected:e.key===t,key:e.key,href:e.href},e.title)))))}},5720:function(e,t,n){var a=n(7462),o=n(9307),l=n(4184),s=n.n(l);t.Z=e=>{const{className:t,...n}=e;return(0,o.createElement)("div",(0,a.Z)({className:s()("app-table-card-div",t)},n))}},6308:function(e,t,n){var a=n(7462),o=n(9307),l=n(6020),s=n(5720),r=n(1410);const i=(e,t,n)=>{const a=t.includes(n)?"on":"off";(0,r.dk)("gla_table_header_toggle",{report:e,column:n,status:a})},c=(e,t,n)=>{(0,r.dk)("gla_table_sort",{report:e,column:t,direction:n})};t.Z=e=>{const{trackEventReportId:t,...n}=e;function r(e,n){return function(){for(var a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];t&&e(t,...o),n&&n(...o)}}return(0,o.createElement)(s.Z,null,(0,o.createElement)(l.TableCard,(0,a.Z)({},n,{onColumnsChange:r(i,e.onColumnsChange),onSort:r(c,e.onSort)})))}},4486:function(e,t,n){var a=n(7462),o=n(9307),l=n(4184),s=n.n(l);t.Z=e=>{let{variant:t,className:n="",children:l,as:r="p",...i}=e;const c=r;return(0,o.createElement)(c,(0,a.Z)({},i,{className:s()("gla-app-text",n,{[`gla-app-text--${t}`]:t})}),l)}},4863:function(e,t,n){var a=n(9307),o=n(5609);t.Z=e=>{const{children:t,...n}=e;let l;const s=a.Children.toArray(t);return 1===s.length&&(l=s[0].props?.disabled),(0,a.createElement)(o.Tooltip,n,(0,a.createElement)("div",{className:"gla-tooltip__children-container",disabled:l},t))}},9425:function(e,t,n){var a=n(9307),o=n(4184),l=n.n(o),s=n(5736),r=n(5609),i=n(3836);t.Z=e=>{const{className:t}=e;return(0,a.createElement)(r.Flex,{className:l()("gla-connected-icon-label",t),align:"center",gap:1},(0,a.createElement)(r.FlexItem,null,(0,a.createElement)(i.Z,null)),(0,a.createElement)(r.FlexItem,null,(0,s.__)("Connected","google-listings-and-ads")))}},1602:function(e,t,n){n.d(t,{Z:function(){return d}});var a=n(9307),o=n(5736),l=n(1984),s=n(7329),r=n(431),i=n(9770),c=n(965);function d(e){let{editHref:t,editEventName:n,loading:d,content:u,appearance:g,warning:m}=e;const{subpath:p}=(0,r.getQuery)(),h=(0,a.createElement)(c.Z,{isSecondary:!0,href:t,text:(0,o.__)("Edit","google-listings-and-ads"),eventName:n,eventProps:{path:(0,r.getPath)(),subpath:p}});let _,f;return d?_=(0,a.createElement)("span",{className:"gla-contact-info-preview-card__placeholder","aria-busy":"true",title:(0,o.__)("Loading…","google-listings-and-ads")}):m?(f=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(l.Z,{icon:s.Z,size:24,className:"gla-contact-info-preview-card__notice-icon"}),m),_=(0,a.createElement)("span",{className:"gla-contact-info-preview-card__notice-details"},u)):_=u,(0,a.createElement)(i.Z,{appearance:g,className:"gla-contact-info-preview-card",icon:null,title:f,description:_,indicator:h})}},2295:function(e,t,n){n.d(t,{_:function(){return v}});var a=n(9307),o=n(5736),l=n(146),s=n(4752),r=n(2500),i=n(1693),c=n(8300),d=n(8027),u=n(7667),g=n(3438),m=n(699);const p="contact-information-read-more",h="https://woocommerce.com/document/google-listings-and-ads/#contact-information",_=(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",null,(0,o.__)("Your contact information is required for verification by Google.","google-listings-and-ads")),(0,a.createElement)("p",null,(0,o.__)("It would be shared with Google Merchant Center for store verification and would not be displayed to customers.","google-listings-and-ads"))),f=(0,o.__)("Verify contact information","google-listings-and-ads"),E=(0,o.__)("Contact information","google-listings-and-ads");function v(){return(0,a.createElement)(i.Z,{title:E,description:_},(0,a.createElement)(c.Z,{size:"overlap"},(0,a.createElement)(u.z,{editHref:(0,l.jv)(),learnMore:(0,a.createElement)(d.Z,{context:"settings-no-phone-number-notice",linkId:p,href:h},(0,o.__)("Learn more","google-listings-and-ads"))}),(0,a.createElement)(g.B,{editHref:(0,l.jD)(),learnMore:(0,a.createElement)(d.Z,{context:"settings-no-store-address-notice",linkId:p,href:h},(0,o.__)("Learn more","google-listings-and-ads"))})))}t.Z=e=>{let{onPhoneNumberVerified:t}=e;const{adapter:n}=(0,s.S)(),l=(0,r.Z)(),E=f;return(0,m.Z)(l),(0,a.createElement)(i.Z,{title:E,description:(0,a.createElement)("div",null,_,(0,a.createElement)("p",null,(0,a.createElement)(d.Z,{context:"setup-mc-contact-information",linkId:p,href:h},(0,o.__)("Learn more","google-listings-and-ads"))))},(0,a.createElement)(c.Z,{size:"large"},(0,a.createElement)(u.Z,{view:"setup-mc",phoneNumber:l,showValidation:n.requestedShowValidation,onPhoneNumberVerified:t}),(0,a.createElement)(g.Z,{showValidation:n.requestedShowValidation})))}},7667:function(e,t,n){n.d(t,{z:function(){return V},Z:function(){return F}});var a=n(7462),o=n(9307),l=n(5736),s=n(5609),r=n(6020),i=n(9770),c=n(965),d=n(279),u=n(9814),g=n(533),m=n(9160),p=n(7613),h=n(1693),_=n(9054),f=n(2);const E=37,v=39,y=8,b=Array(6).fill(""),Z=e=>{const t=e.join("");return{code:t,isFilled:6===t.length}};function C(e){let{onCodeChange:t,resetNeedle:n=""}=e;const a=(0,o.useRef)([]),l=(0,o.useRef)(0),r=(0,o.useRef)(),[i,c]=(0,o.useState)(b);r.current=t;const d=e=>{const t=a.current[e];t&&t.focus()},u=e=>{const{dataset:t,selectionStart:n,selectionEnd:a,value:o}=e.target,l=Number(t.idx);switch(e.keyCode){case E:case y:0===n&&0===a&&d(l-1);break;case v:1!==n&&o||d(l+1)}},g=e=>{l.current=e.target.selectionStart},m=e=>{const{value:n,dataset:a}=e.target,o=Number(a.idx),s=n.substr(l.current,1).replace(/\D/,"");if(s!==n&&(e.target.value=s),s&&d(o+1),s!==i[o]){const e=[...i];e[o]=s,c(e),t(Z(e))}};return(0,o.useEffect)((()=>{a.current.forEach((e=>e.value="")),c(b),r.current(Z(b))}),[n]),(0,o.useEffect)((()=>{i===b&&d(0)}),[n,i]),(0,o.createElement)(s.Flex,{className:"gla-verification-code-control",justify:"normal",gap:2},i.map(((e,t)=>(0,o.createElement)(f.Z,{key:t,ref:e=>a.current[t]=e,"data-idx":t,value:e,onKeyDown:u,onBeforeInput:g,onInput:m,autoComplete:"off"}))))}const w=Object.freeze({SMS:"SMS",PHONE_CALL:"PHONE_CALL"}),k={[w.SMS]:{toInstruction(e){return(0,o.createInterpolateElement)((0,l.__)("A text message with the 6-digit verification code has been sent to <userPhoneNumber />.","google-listings-and-ads"),{userPhoneNumber:(0,o.createElement)("strong",null,e)})},textResend:(0,l.__)("Resend code","google-listings-and-ads"),
// translators: %d: seconds to wait until the next verification code can be requested via SMS.
textResendCooldown:(0,l.__)("Resend code (in %ds)","google-listings-and-ads"),textSwitch:(0,l.__)("Or, receive a verification code through a phone call","google-listings-and-ads")},[w.PHONE_CALL]:{toInstruction(e){return(0,o.createInterpolateElement)((0,l.__)("You will receive a phone call at <userPhoneNumber /> with an automated message containing the 6-digit verification code.","google-listings-and-ads"),{userPhoneNumber:(0,o.createElement)("strong",null,e)})},textResend:(0,l.__)("Call again","google-listings-and-ads"),
// translators: %d: seconds to wait until the next verification code can be requested via phone call.
textResendCooldown:(0,l.__)("Call again (in %ds)","google-listings-and-ads"),textSwitch:(0,l.__)("Or, receive a verification code through text message","google-listings-and-ads")}};function N(e){let{verificationMethod:t,country:n,number:a,display:r,onVerificationStateChange:i}=e;const d=(0,m.Z)(),[u,f]=(0,o.useState)(t),{second:E,callCount:v,startCountdown:y}=(0,p.Z)(u),[b,Z]=(0,o.useState)(null),[N,S]=(0,o.useState)(!1),[x,A]=(0,o.useState)(null),R=(0,o.useRef)({}),{requestPhoneVerificationCode:T,verifyPhoneNumber:O}=(0,g.T)(),P=u===w.SMS,G=(0,o.useCallback)((()=>{A(null),y(60),R.current[u]=null,T(n,a,u).then((e=>{let{verificationId:t}=e;R.current[u]=t})).catch((e=>{d()&&(A(e),y(0))}))}),[n,a,u,y,T,d]);(0,o.useEffect)((()=>{0===v&&G()}),[u,v,G]);const{toInstruction:I,textResend:L,textResendCooldown:M,textSwitch:F}=k[u],D=R.current[u],U=!(b?.isFilled&&D);return(0,o.createElement)("form",{onSubmit:e=>{e.preventDefault(),A(null),S(!0),i(!0,!1);const t=R.current[u];O(t,b.code,u).then((()=>{i(!1,!0)})).catch((e=>{d()&&(A(e),S(!1),i(!1,!1))}))}},(0,o.createElement)(h.Z.Card.Body,null,x&&(0,o.createElement)(_.Z,null,(0,o.createElement)(s.Notice,{status:"error",isDismissible:!1},x.display)),(0,o.createElement)(_.Z,null,(0,o.createElement)(_.Z.Title,null,(0,l.__)("Enter verification code","google-listings-and-ads")),I(r)),(0,o.createElement)(_.Z,null,(0,o.createElement)(C,{resetNeedle:u+v,onCodeChange:Z})),(0,o.createElement)(_.Z,null,(0,o.createElement)(s.Flex,{justify:"normal",gap:4},(0,o.createElement)(c.Z,{isSecondary:!0,disabled:U,loading:N,text:(0,l.__)("Verify phone number","google-listings-and-ads"),type:"submit"}),(0,o.createElement)(c.Z,{isSecondary:!0,disabled:E>0||N,text:E?(0,l.sprintf)(M,E):L,onClick:G})))),(0,o.createElement)(h.Z.Card.Footer,null,(0,o.createElement)(c.Z,{isLink:!0,disabled:N,text:F,onClick:()=>{f(P?w.PHONE_CALL:w.SMS)},"aria-label":(0,l.__)("Switch verification method","google-listings-and-ads")})))}var S=n(2319),x=n(4382),A=n(89),R=n(4741);const T=(e,t,n)=>({key:e,keywords:[n,t,e],label:`${n} (+${t})`});var O=n(5390);const P=[{label:(0,l.__)("Text message","google-listings-and-ads"),value:w.SMS},{label:(0,l.__)("Phone call","google-listings-and-ads"),value:w.PHONE_CALL}];function G(e){let{initCountry:t,initNationalNumber:n,onSendVerificationCodeClick:a}=e;const r=function(){const e=(0,R.Z)();return(0,o.useMemo)((()=>(0,x.o)().reduce(((t,n)=>{const a=e[n];if(a){const e=(0,A.G)(n);t.push(T(n,e,a))}return t}),[])),[e])}(),[i,d]=(0,o.useState)(t),[u,g]=(0,o.useState)(n),[m,p]=(0,o.useState)(w.SMS),[E,v]=(0,o.useState)(null);return(0,o.useEffect)((()=>{const e=(0,S._)(u,i),t=!!e&&e.isValid();v(e?{...e,isValid:t,display:e.formatInternational(),verificationMethod:m}:{isValid:t,country:i,number:"",display:"",verificationMethod:m})}),[u,i,m]),(0,o.createElement)(h.Z.Card.Body,null,(0,o.createElement)(s.Flex,{gap:4},(0,o.createElement)(s.FlexItem,null,(0,o.createElement)(O.Z,{label:(0,l.__)("Country code","google-listings-and-ads"),isSearchable:!0,excludeSelectedOptions:!1,options:r,selected:i,onChange:d})),(0,o.createElement)(s.FlexBlock,null,(0,o.createElement)(f.Z,{label:(0,l.__)("Phone number","google-listings-and-ads"),value:u,onChange:g}))),(0,o.createElement)(_.Z,null,(0,o.createElement)(_.Z.Title,null,(0,l.__)("Select verification method","google-listings-and-ads")),(0,o.createElement)(s.RadioControl,{selected:m,options:P,onChange:p})),(0,o.createElement)(_.Z,null,(0,o.createElement)(c.Z,{isSecondary:!0,disabled:!E?.isValid,text:(0,l.__)("Send verification code","google-listings-and-ads"),onClick:()=>a(E)})))}const I=()=>{},L={className:"gla-phone-number-card",appearance:i.O.PHONE};function M(e){let{phoneNumber:t,showValidation:n,onPhoneNumberVerified:r}=e;const{loaded:g,data:m}=t,[p,h]=(0,o.useState)(!1),[_,f]=(0,o.useState)(null);let E=(0,o.createElement)(d.Z,null);g&&(E=_?(0,o.createElement)(N,(0,a.Z)({},_,{onVerificationStateChange:(e,t)=>{h(e),t&&r()}})):(0,o.createElement)(G,{initCountry:m.country,initNationalNumber:m.nationalNumber,onSendVerificationCodeClick:f}));const v=_?_.display:(0,l.__)("Please enter a phone number to be used for verification.","google-listings-and-ads"),y=_?(0,o.createElement)(c.Z,{isSecondary:!0,text:(0,l.__)("Edit","google-listings-and-ads"),disabled:p,onClick:()=>f(null)}):null,b=n&&!m.isVerified?(0,o.createElement)(u.Z,{messages:(0,l.__)("A verified phone number is required.","google-listings-and-ads")}):null;return(0,o.createElement)(i.Z,(0,a.Z)({},L,{description:v,indicator:y,helper:b}),(0,o.createElement)(s.CardDivider,null),E)}var F=e=>{let{view:t,phoneNumber:n,initEditing:s=null,showValidation:d=!1,onEditClick:u,onPhoneNumberVerified:g=I}=e;const{loaded:m,data:p}=n,[h,_]=(0,o.useState)(s),f=(0,o.useRef)();f.current=g;const{isVerified:E}=p;if((0,o.useEffect)((()=>{m&&null===h&&_(!E)}),[m,E,h]),(0,o.useEffect)((()=>{!0!==s&&E&&f.current()}),[s,E]),null===h)return(0,o.createElement)(i.Z,(0,a.Z)({},L,{indicator:(0,o.createElement)(r.Spinner,null)}));if(h){const e=()=>{_(!1),g()};return(0,o.createElement)(M,{phoneNumber:n,showValidation:d,onPhoneNumberVerified:e})}let v=null,y=(0,o.createElement)(r.Spinner,null);return m&&(v=p.display,y=(0,o.createElement)(c.Z,{isSecondary:!0,eventName:"gla_mc_phone_number_edit_button_click",eventProps:{view:t},onClick:()=>{u?u():_(!0)}},(0,l.__)("Edit","google-listings-and-ads"))),(0,o.createElement)(i.Z,(0,a.Z)({},L,{description:v,indicator:y}))},D=n(2500),U=n(1602);function V(e){let{editHref:t,learnMore:n}=e;const{loaded:a,data:s}=(0,D.Z)();let r,c;if(a)if(s.isValid){const e=s.isVerified?(0,o.createElement)("div",{className:"gla-phone-number-card-preview__verified-status"},(0,l.__)("Verified","google-listings-and-ads")):(0,o.createElement)("div",{className:"gla-phone-number-card-preview__unverified-status"},(0,l.__)("Unverified","google-listings-and-ads"));r=(0,o.createElement)(o.Fragment,null,s.display,e)}else c=(0,l.__)("Please add your phone number","google-listings-and-ads"),r=(0,o.createElement)(o.Fragment,null,(0,l.__)("Google requires the phone number for all stores using Google Merchant Center. ","google-listings-and-ads"),n);return(0,o.createElement)(U.Z,{appearance:i.O.PHONE,editHref:t,editEventName:"gla_edit_mc_phone_number",learnMore:n,loading:!a,warning:c,content:r})}},3438:function(e,t,n){n.d(t,{B:function(){return y},Z:function(){return v}});var a=n(9307),o=n(5736),l=n(5609),s=n(6020),r=n(2120),i=n(431),c=n(2159),d=n(1693),u=n(9054),g=n(9770),m=n(965),p=n(9814),h=n(1602),_=n(3201);function f(e){const t={address_1:(0,o._x)("address line","The field name of the address line in store address","google-listings-and-ads"),city:(0,o._x)("city","The field name of the city in store address","google-listings-and-ads"),country:(0,o._x)("country/state","The field name of the country in store address","google-listings-and-ads"),postcode:(0,o._x)("postcode/zip","The field name of the postcode in store address","google-listings-and-ads")};return e.missingRequiredFields.map((e=>{const n=t[e]||e;return(0,o.sprintf)(
// translators: %s: The missing field name of store address.
(0,o.__)("The %s of store address is required.","google-listings-and-ads"),n)}))}var E=n(1410),v=e=>{let{showValidation:t=!1}=e;const{loaded:n,data:h,refetch:v}=(0,c.Z)(),y=(0,i.getPath)(),{subpath:b}=(0,i.getQuery)(),Z=(0,a.useRef)(null);n&&Z.current&&(Z.current(h),Z.current=null);const C=(0,a.createElement)(m.Z,{isSecondary:!0,icon:r.Z,iconSize:20,iconPosition:"right",text:(0,o.__)("Refresh to sync","google-listings-and-ads"),onClick:()=>{v(),Z.current=e=>{const t={path:y,subpath:b,country_code:e.countryCode,missing_fields:e.missingRequiredFields.join(",")};(0,E.dk)("gla_wc_store_address_validation",t)}},disabled:!n});let w;const k=(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",null,(0,a.createInterpolateElement)((0,o.__)("Edit your store address in your <link>WooCommerce settings</link>.","google-listings-and-ads"),{link:(0,a.createElement)(_.Z,{target:"_blank",type:"external",href:"admin.php?page=wc-settings",eventName:"gla_edit_wc_store_address",eventProps:{path:y,subpath:b}})})),(0,a.createElement)("p",null,(0,o.__)("Once you’ve saved your new address there, refresh to sync your new address with Google.","google-listings-and-ads")));if(n){const{address:e,address2:t,city:n,state:o,country:l,postcode:s}=h,r=[n,o?`${o} - ${l}`:l,s].filter(Boolean).join(", ");w=(0,a.createElement)("div",null,(0,a.createElement)("div",null,e),t&&(0,a.createElement)("div",null,t),(0,a.createElement)("div",null,r))}else w=(0,a.createElement)(s.Spinner,null);return(0,a.createElement)(g.Z,{className:"gla-store-address-card",appearance:g.O.ADDRESS,alignIcon:"top",alignIndicator:"top",description:k,indicator:C},(0,a.createElement)(l.CardDivider,null),(0,a.createElement)(d.Z.Card.Body,null,(0,a.createElement)(u.Z.Title,null,(0,o.__)("Store address","google-listings-and-ads")),w,t&&(0,a.createElement)(p.Z,{messages:f(h)})))};function y(e){let{editHref:t,learnMore:n}=e;const{loaded:l,data:s}=(0,c.Z)("mc");let r,i;if(l){const{isAddressFilled:e,isMCAddressDifferent:t,address:l,address2:c,city:d,state:u,country:g,postcode:m}=s;e&&!t?r=[l,c,d,u?`${u} - ${g}`:g,m].filter(Boolean).join(", "):(i=(0,o.__)("Please add your store address","google-listings-and-ads"),r=(0,a.createElement)(a.Fragment,null,(0,o.__)("Google requires the store address for all stores using Google Merchant Center. ","google-listings-and-ads"),n))}return(0,a.createElement)(h.Z,{appearance:g.O.ADDRESS,editHref:t,editEventName:"gla_edit_mc_store_address",loading:!l,warning:i,content:r})}},699:function(e,t,n){var a=n(9307),o=n(431),l=n(1410);t.Z=e=>{let{loaded:t,data:{display:n,isValid:s}}=e;const r=!!n,i=(0,o.getPath)();(0,a.useEffect)((()=>{t&&(0,l.dk)("gla_mc_phone_number_check",{path:i,exist:r,isValid:s})}),[r,s,t,i])}},6280:function(e,t,n){var a=n(7462),o=n(9307),l=n(4184),s=n.n(l);t.Z=e=>{const{className:t,...n}=e;return(0,o.createElement)("div",(0,a.Z)({className:s()("gla-content-button-layout",t)},n))}},663:function(e,t,n){n.d(t,{Z:function(){return g}});var a=n(9307),o=n(5736),l=n(5606),s=n(3108),r=n(9900),i=n(9818),c=n(6166),d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.EX;const n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c.EX;return(0,i.useSelect)((t=>t(e).getNotices()),[e])}(t).find((t=>t.content===e));return(0,a.useEffect)((()=>{const{removeNotice:e}=(0,i.dispatch)(t);return()=>{n&&e(n.id)}}),[n,t]),n||null},u=n(1410),g=e=>{let{eventContext:t,label:n,secondLabel:i}=e;return d(n,"core/notices2"),(0,a.createElement)(l.CustomerEffortScore,{label:n,title:n,firstQuestion:n,secondQuestion:i,recordScoreCallback:(e,n,a)=>{(0,u.dk)("gla_ces_feedback",{context:t,score:e,comments:a||""})},onNoticeShownCallback:()=>{r.Z.remove(s.dA.CAN_ONBOARDING_SETUP_CES_PROMPT_OPEN),(0,u.dk)("gla_ces_snackbar_open",{context:t})},onNoticeDismissedCallback:()=>{(0,u.dk)("gla_ces_snackbar_closed",{context:t})},onModalShownCallback:()=>{(0,u.dk)("gla_ces_modal_open",{context:t})},icon:(0,a.createElement)("span",{style:{height:21,width:21},role:"img","aria-label":(0,o.__)("Pencil icon","google-listings-and-ads")},"✏️")})}},3153:function(e,t,n){var a=n(9307),o=n(5736),l=n(5609),s=n(3497),r=n(4485),i=n(8027),c=n(3108);t.Z=e=>{let{context:t}=e;const{googleAdsAccount:n}=(0,s.Z)(),{code:d}=(0,r.Z)();return n&&n.status===c.GOOGLE_ADS_ACCOUNT_STATUS.CONNECTED&&n.currency!==d?(0,a.createElement)(l.Notice,{className:"gla-different-currency-notice",status:"warning",isDismissible:!1},(0,a.createInterpolateElement)((0,o.__)("Note: The currency set in your Google Ads account is <adsCurrency />, which is different from your store currency, <storeCurrency />. <readMoreLink>Read more</readMoreLink>","google-listings-and-ads"),{adsCurrency:(0,a.createElement)("strong",null,n.currency),storeCurrency:(0,a.createElement)("strong",null,d),readMoreLink:(0,a.createElement)(i.Z,{className:"gla-different-currency-notice__link",href:"https://support.google.com/google-ads/answer/9841530",context:t,linkId:"setting-up-currency"})})):null}},7581:function(e,t,n){var a=n(9307),o=n(6020),l=n(5736),s=n(1410);const r=()=>{};t.Z=e=>{let{productId:t,eventName:n,eventProps:i}=e;const c=`post.php?action=edit&post=${t}`,d=n?()=>(0,s.HR)(n,i):r;return(0,a.createElement)(o.Link,{href:c,onClick:d,type:"wp-admin"},(0,l.__)("Edit","google-listings-and-ads"))}},6013:function(e,t,n){var a=n(9307),o=n(7489);t.Z=e=>{let{size:t=18}=e;return(0,a.createElement)(o.Z,{className:"gla-error-icon",size:t})}},3832:function(e,t,n){n.d(t,{Z:function(){return d}});var a=n(9307),o=n(5736),l=n(5609),s=n(4184),r=n.n(s),i=n(1410);const c=(e,t,n)=>a=>{(0,i.dk)(e,{id:t,action:a?"expand":"collapse",context:n})};function d(e){let{trackName:t,faqItems:n,className:s,context:i}=e;return(0,a.createElement)(l.Panel,{className:r()("gla-faqs-panel",s),header:(0,o.__)("Frequently asked questions","google-listings-and-ads")},n.map((e=>{let{trackId:n,question:o,answer:s}=e;return(0,a.createElement)(l.PanelBody,{key:n,title:o,initialOpen:!1,onToggle:c(t,n,i)},(0,a.createElement)(l.PanelRow,null,s))})))}},1085:function(e,t,n){var a=n(9818),o=n(533);t.Z=()=>(0,a.useSelect)((e=>({settings:e(o.L).getSettings()})),[])},2984:function(e,t,n){n.d(t,{Z:function(){return Ze}});var a=n(9307),o=n(2819),l=n(6553),s=n(279),r=n(5736),i=n(5602),c=n.p+"images/js/src/components/free-listings/configure-product-listings/hero/fb15f79da797ad9cca81.google-free-listing.png",d=e=>{let{headerTitle:t}=e;return(0,a.createElement)("div",{className:"gla-setup-free-listing-hero"},(0,a.createElement)(i.Z,{className:"hero-text",title:t,description:(0,a.createElement)("div",null,(0,a.createElement)("p",{className:"hero-text__subtitle"},(0,r.__)("Your product listings will look something like this.","google-listings-and-ads")),(0,a.createElement)("p",{className:"hero-text__body"},(0,r.__)("Your product details, estimated shipping info and tax details will be displayed across Google.","google-listings-and-ads")))}),(0,a.createElement)("img",{className:"gla-setup-free-listing-hero__image",src:c,alt:(0,r.__)("Google Shopping search results example","google-listings-and-ads")}))},u=n(4752),g=n(9814),m=e=>e.rate>0;const p=new Set(["all","selected"]),h=new Set(["automatic","flat","manual"]),_=new Set(["flat","manual"]),f=new Set(["destination","manual"]);var E=e=>{if(e.some(m))return e.some((e=>e.options.free_shipping_threshold>0))},v=n(3538),y=n(2279),b=n(7462),Z=n(1693),C=e=>{const{className:t="",...n}=e;return(0,a.createElement)("span",(0,b.Z)({className:`wcdl-radio-helper-text ${t}`},n))},w=n(9985),k=n(8027),N=n(8300),S=()=>{const{getInputProps:e,adapter:{renderRequestedValidation:t}}=(0,u.S)();return(0,a.createElement)(Z.Z,{title:(0,r.__)("Tax rate (required for U.S. only)","google-listings-and-ads"),description:(0,a.createElement)("div",null,(0,a.createElement)("p",null,(0,r.__)("This tax rate will be shown to potential customers, together with the cost of your product.","google-listings-and-ads")),(0,a.createElement)("p",null,(0,a.createElement)(k.Z,{context:"setup-mc-tax-rate",linkId:"tax-rate-read-more",href:"https://support.google.com/merchants/answer/160162"},(0,r.__)("Read more","google-listings-and-ads"))))},(0,a.createElement)(Z.Z.Card,null,(0,a.createElement)(Z.Z.Card.Body,null,(0,a.createElement)(N.Z,{size:"large"},(0,a.createElement)(w.Z,(0,b.Z)({},e("tax_rate"),{label:(0,r.__)("My store uses destination-based tax rates.","google-listings-and-ads"),value:"destination",collapsible:!0}),(0,a.createElement)(C,null,(0,r.__)("Google’s estimated tax rates will automatically be applied to my product listings.","google-listings-and-ads"))),(0,a.createElement)(w.Z,(0,b.Z)({},e("tax_rate"),{label:(0,r.__)("My store does not use destination-based tax rates.","google-listings-and-ads"),value:"manual",collapsible:!0}),(0,a.createElement)(C,null,(0,a.createInterpolateElement)((0,r.__)("I’ll set my tax rates up manually in <link>Google Merchant Center</link>. I understand that if I don’t set this up, my products will be disapproved.","google-listings-and-ads"),{link:(0,a.createElement)(k.Z,{context:"setup-mc-tax-rate",linkId:"tax-rate-manual",href:"https://www.google.com/retail/solutions/merchant-center/"})})))),t("tax_rate"))))},x=n(5609),A=n(9054),R=n(2907),T=()=>{const{values:e,getInputProps:t,adapter:{renderRequestedValidation:n}}=(0,u.S)(),{locale:o,language:l}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Z.Z,{className:"gla-choose-audience-section",title:(0,r.__)("Audience","google-listings-and-ads"),description:(0,a.createElement)("p",null,(0,r.__)("Where do you want to sell your products?","google-listings-and-ads"))},(0,a.createElement)(Z.Z.Card,null,(0,a.createElement)(Z.Z.Card.Body,null,(0,a.createElement)(A.Z,null,(0,a.createElement)(A.Z.Title,null,(0,r.__)("Language","google-listings-and-ads")),(0,a.createElement)(A.Z.HelperText,{className:"gla-choose-audience-section__language-helper"},(0,a.createInterpolateElement)((0,r.__)("Listings can only be displayed in your site language. <link>Read more</link>","google-listings-and-ads"),{link:(0,a.createElement)(k.Z,{context:"setup-mc-audience",linkId:"site-language",href:"https://support.google.com/merchants/answer/160637"})})),(0,a.createElement)(x.RadioControl,{selected:o,options:[{label:l,value:o}]})),(0,a.createElement)(A.Z,null,(0,a.createElement)(A.Z.Title,null,(0,r.__)("Location","google-listings-and-ads")),(0,a.createElement)(A.Z.HelperText,null,(0,r.__)("Your store should already have the appropriate shipping and tax rates (if required) for potential customers in your selected location(s).","google-listings-and-ads")),(0,a.createElement)(N.Z,{size:"medium"},(0,a.createElement)(w.Z,(0,b.Z)({},t("location"),{collapsible:!0,label:(0,r.__)("Selected countries only","google-listings-and-ads"),value:"selected"}),(0,a.createElement)(R.Z,(0,b.Z)({multiple:!0},t("countries"),{help:(0,r.__)("Can’t find a country? Only supported countries can be selected.","google-listings-and-ads")})),n("countries")),(0,a.createElement)(w.Z,(0,b.Z)({},t("location"),{label:(0,r.__)("All countries","google-listings-and-ads"),value:"all"}),(0,a.createElement)(C,null,(0,r.__)("Your listings will be shown in all supported countries.","google-listings-and-ads")))))))))},O=n(3115),P=n(965),G=n(7714),I=n(4485),L=n(6020),M=n(4140),F=e=>{const t={};return 0===e.countries.length&&(t.countries=(0,r.__)("Please specify at least one country.","google-listings-and-ads")),Number.isFinite(e.rate)||(t.rate=(0,r.__)("Please enter the estimated shipping rate.","google-listings-and-ads")),e.rate<0&&(t.rate=(0,r.__)("The estimated shipping rate cannot be less than 0.","google-listings-and-ads")),t},D=n(591),U=e=>{let{countryOptions:t,initialValues:n,renderButtons:l=o.noop,onSubmit:s,onRequestClose:i}=e;const[c,d]=(0,a.useState)(!1);return(0,a.createElement)(L.Form,{initialValues:n,validate:F,onSubmit:s},(e=>{const{values:n,getInputProps:o}=e;return(0,a.createElement)(D.Z,{overflow:"visible",shouldCloseOnEsc:!c,shouldCloseOnClickOutside:!c,title:(0,r.__)("Estimate a shipping rate","google-listings-and-ads"),buttons:l(e),onRequestClose:i},(0,a.createElement)(N.Z,null,(0,a.createElement)(R.Z,(0,b.Z)({label:(0,r.__)("If customer is in","google-listings-and-ads"),countryCodes:t,onDropdownVisibilityChange:d},o("countries"))),(0,a.createElement)(M.Z,(0,b.Z)({label:(0,r.__)("Then the estimated shipping rate displayed in the product listing is","google-listings-and-ads"),suffix:n.currency},o("rate")))))}))},V=e=>{let{countryOptions:t,initialValues:n,onSubmit:l,onRequestClose:s=o.noop}=e;return(0,a.createElement)(U,{countryOptions:t,initialValues:n,renderButtons:e=>{const{isValidForm:t,handleSubmit:n}=e;return[(0,a.createElement)(P.Z,{key:"submit",isPrimary:!0,disabled:!t,onClick:()=>{s(),n()}},(0,r.__)("Add shipping rate","google-listings-and-ads"))]},onSubmit:l,onRequestClose:s})},q=e=>{let{countryOptions:t,initialValues:n,onSubmit:l,onRequestClose:s=o.noop,onDelete:i=o.noop}=e;const c=()=>{s(),i()};return(0,a.createElement)(U,{countryOptions:t,initialValues:n,renderButtons:e=>{const{isValidForm:t,handleSubmit:n}=e;return[(0,a.createElement)(P.Z,{key:"delete",isTertiary:!0,isDestructive:!0,onClick:c},(0,r.__)("Delete","google-listings-and-ads")),(0,a.createElement)(P.Z,{key:"submit",isPrimary:!0,disabled:!t,onClick:()=>{s(),n()}},(0,r.__)("Update shipping rate","google-listings-and-ads"))]},onSubmit:l,onRequestClose:s})},$=n(4741);const B=5;var z=e=>{const{countries:t,firstN:n=B,textWithMore:o,textWithoutMore:l}=e,s=(0,$.Z)(),i=t.slice(0,n).map((e=>s[e])),c=t.length>i.length?o:l;return(0,a.createInterpolateElement)((0,r.sprintf)(c,i.join(", "),t.length-i.length),{strong:(0,a.createElement)("strong",null)})},j=e=>{const{countries:t}=e;return(0,a.createElement)("div",null,(0,a.createElement)(z,{countries:t,textWithMore:
// translators: 1: list of country names separated by comma, up to 5 countries; 2: the remaining count of countries.
(0,r.__)("Shipping rate for <strong>%1$s</strong> + %2$d more","google-listings-and-ads"),textWithoutMore:
// translators: 1: list of country names separated by comma.
(0,r.__)("Shipping rate for <strong>%1$s</strong>","google-listings-and-ads")}))},H=e=>{let{countryOptions:t,value:n,onChange:o,onDelete:l}=e;const{countries:s,currency:i,rate:c}=n;return(0,a.createElement)("div",{className:"gla-shipping-rate-input-control"},(0,a.createElement)(M.Z,{label:(0,a.createElement)("div",{className:"label"},(0,a.createElement)(j,{countries:s}),(0,a.createElement)(G.Z,{button:(0,a.createElement)(P.Z,{isTertiary:!0},(0,r.__)("Edit","google-listings-and-ads")),modal:(0,a.createElement)(q,{countryOptions:t,initialValues:n,onSubmit:o,onDelete:l})})),suffix:i,value:c,onBlur:(e,t)=>{c!==t&&o({...n,rate:t})}}),0===c&&(0,a.createElement)("div",{className:"gla-input-pill-div"},(0,a.createElement)(L.Pill,null,(0,r.__)("Free shipping for all orders","google-listings-and-ads"))))};const W={options:{}};function Y(e){let{audienceCountries:t,value:n,helper:o,onChange:l}=e;const{code:s}=(0,I.Z)(),{handleAddSubmit:i,getChangeHandler:c,getDeleteHandler:d}=(e=>{let{value:t,onChange:n}=e;return{handleAddSubmit:e=>{let{countries:a,currency:o,rate:l}=e;const s=a.map((e=>({...W,country:e,currency:o,rate:l})));n(t.concat(s))},getChangeHandler:e=>a=>{const o=t.filter((t=>!(e.countries.includes(t.country)&&!a.countries.includes(t.country))));a.countries.forEach((e=>{const t=o.findIndex((t=>t.country===e)),n=o[t],l={...W,...n,country:e,currency:a.currency,rate:a.rate};m(l)||(l.options.free_shipping_threshold=void 0),t>=0?o[t]=l:o.push(l)})),n(o)},getDeleteHandler:e=>()=>{const a=t.filter((t=>!e.countries.includes(t.country)));n(a)}}})({value:n,onChange:l});return(0,a.createElement)(Z.Z.Card,null,(0,a.createElement)(Z.Z.Card.Body,null,(0,a.createElement)(Z.Z.Card.Title,null,(0,r.__)("Estimated shipping rates","google-listings-and-ads")),(0,a.createElement)(N.Z,{size:"large"},(()=>{const e=(e=>{const t=new Map;return e.forEach((e=>{const{country:n,currency:a,rate:o}=e,l=`${a} ${o} `,s=t.get(l)||{countries:[],currency:a,rate:o};s.countries.push(n),t.set(l,s)})),Array.from(t.values())})(n);if(0===e.length){const e={countries:t,currency:s,rate:void 0};return(0,a.createElement)(H,{countryOptions:t,value:e,onChange:c(e),onDelete:d(e)})}const o=t.filter((e=>!n.some((t=>t.country===e))));return(0,a.createElement)(a.Fragment,null,e.map((e=>(0,a.createElement)(H,{key:e.countries.join("-"),countryOptions:t,value:e,onChange:c(e),onDelete:d(e)}))),o.length>=1&&(0,a.createElement)("div",null,(0,a.createElement)(G.Z,{button:(0,a.createElement)(P.Z,{isSecondary:!0,icon:(0,a.createElement)(O.Z,null)},(0,r.__)("Add another rate","google-listings-and-ads")),modal:(0,a.createElement)(V,{countryOptions:o,initialValues:{countries:o,currency:s,rate:0},onSubmit:i})})))})()),o))}var Q=e=>{let{value:t,helper:n,onChange:o}=e;const l=e=>{o("yes"===e)};return(0,a.createElement)(Z.Z.Card,null,(0,a.createElement)(Z.Z.Card.Body,null,(0,a.createElement)(Z.Z.Card.Title,null,(0,r.__)("I offer free shipping for orders over a certain price","google-listings-and-ads")),(0,a.createElement)(N.Z,{size:"large"},(0,a.createElement)(w.Z,{label:(0,r.__)("Yes","google-listings-and-ads"),value:"yes",selected:!0===t&&"yes",onChange:l}),(0,a.createElement)(w.Z,{label:(0,r.__)("No","google-listings-and-ads"),value:"no",selected:!1===t&&"no",onChange:l})),n))},K=e=>{const t={};return 0===e.countries.length&&(t.countries=(0,r.__)("Please specify at least one country.","google-listings-and-ads")),e.threshold>0||(t.threshold=(0,r.__)("The minimum order amount must be greater than 0.","google-listings-and-ads")),t},J=e=>{let{countryOptions:t,renderButtons:n,initialValues:o,onSubmit:l,onRequestClose:s}=e;const[i,c]=(0,a.useState)(!1);return(0,a.createElement)(L.Form,{initialValues:o,validate:K,onSubmit:l},(e=>{const{getInputProps:o,values:l,setValue:d}=e;return(0,a.createElement)(D.Z,{overflow:"visible",shouldCloseOnEsc:!i,shouldCloseOnClickOutside:!i,title:(0,r.__)("Minimum order to qualify for free shipping","google-listings-and-ads"),buttons:n(e),onRequestClose:s},(0,a.createElement)(N.Z,null,(0,a.createElement)(R.Z,(0,b.Z)({label:(0,r.__)("If customer is in","google-listings-and-ads"),countryCodes:t,onDropdownVisibilityChange:c},o("countries"))),(0,a.createElement)(M.Z,(0,b.Z)({label:(0,r.__)("Then they qualify for free shipping if their order is over","google-listings-and-ads"),suffix:l.currency},o("threshold"),{onBlur:(e,t)=>{o("threshold").onBlur(e),d("threshold",t>0?t:void 0)}}))))}))},X=e=>{let{countryOptions:t,initialValues:n,onSubmit:o,onRequestClose:l}=e;return(0,a.createElement)(J,{countryOptions:t,initialValues:n,renderButtons:e=>{const{isValidForm:t,handleSubmit:n}=e;return[(0,a.createElement)(P.Z,{key:"save",isPrimary:!0,disabled:!t,onClick:()=>{l(),n()}},(0,r.__)("Add minimum order","google-listings-and-ads"))]},onSubmit:o,onRequestClose:l})},ee=e=>{let{countryOptions:t,initialValues:n,onSubmit:o,onRequestClose:l,onDelete:s}=e;const i=()=>{l(),s()};return(0,a.createElement)(J,{countryOptions:t,initialValues:n,renderButtons:e=>{const{isValidForm:t,handleSubmit:n}=e;return[(0,a.createElement)(P.Z,{key:"delete",isTertiary:!0,isDestructive:!0,onClick:i},(0,r.__)("Delete","google-listings-and-ads")),(0,a.createElement)(P.Z,{key:"save",isPrimary:!0,disabled:!t,onClick:()=>{l(),n()}},(0,r.__)("Update minimum order","google-listings-and-ads"))]},onSubmit:o,onRequestClose:l})},te=e=>{const{countries:t}=e;return(0,a.createElement)("div",null,(0,a.createElement)(z,{countries:t,textWithMore:
// translators: 1: list of country names separated by comma, up to 5 countries; 2: the remaining count of countries.
(0,r.__)("Minimum order for <strong>%1$s</strong> + %2$d more","google-listings-and-ads"),textWithoutMore:
// translators: 1: list of country names separated by comma.
(0,r.__)("Minimum order for <strong>%1$s</strong>","google-listings-and-ads")}))},ne=e=>{const{countryOptions:t,value:n,onChange:o,onDelete:l}=e,{countries:s,threshold:i,currency:c}=n;return(0,a.createElement)(M.Z,{className:"gla-minimum-order-input-control",label:(0,a.createElement)("div",{className:"gla-minimum-order-input-control__label"},(0,a.createElement)(te,{countries:s}),(0,a.createElement)(G.Z,{button:(0,a.createElement)(P.Z,{isTertiary:!0},(0,r.__)("Edit","google-listings-and-ads")),modal:(0,a.createElement)(ee,{countryOptions:t,initialValues:n,onSubmit:o,onDelete:l})})),suffix:c,value:i,onBlur:(e,t)=>{t!==n.threshold&&o({countries:s,threshold:t>0?t:void 0,currency:c})}})};const ae=(e,t,n)=>e.map((e=>{const a={...e,options:{...e.options}};return n?.countries.includes(a.country)?a.options.free_shipping_threshold=n.threshold:t?.countries.includes(a.country)&&(a.options.free_shipping_threshold=void 0),a}));var oe=e=>{let{value:t=[],helper:n,onChange:o}=e;return(0,a.createElement)(Z.Z.Card,{className:"gla-minimum-order-card"},(0,a.createElement)(Z.Z.Card.Body,null,(0,a.createElement)(Z.Z.Card.Title,null,(0,r.__)("Minimum order to qualify for free shipping","google-listings-and-ads")),(0,a.createElement)(N.Z,{size:"large"},(()=>{const e=t.filter(m),n=(e=>{const t=new Map;return e.forEach((e=>{const{options:{free_shipping_threshold:n},currency:a}=e,o=`${n} ${a}`,l=t.get(o)||{countries:[],threshold:n,currency:a};l.countries.push(e.country),t.set(o,l)})),Array.from(t.values())})(e),l=e.map((e=>e.country)),s=e=>n=>{o(ae(t,e,n))},i=e=>()=>{o(ae(t,e))};if(1===n.length)return(0,a.createElement)(ne,{countryOptions:l,value:n[0],onChange:s(n[0]),onDelete:i(n[0])});const c=n.filter((e=>void 0!==e.threshold)),d=n.find((e=>void 0===e.threshold));return(0,a.createElement)(a.Fragment,null,c.map((e=>(0,a.createElement)(ne,{key:e.countries.join("-"),countryOptions:l,value:e,onChange:s(e),onDelete:i(e)}))),d&&(0,a.createElement)("div",null,(0,a.createElement)(G.Z,{button:(0,a.createElement)(P.Z,{isSecondary:!0,icon:(0,a.createElement)(O.Z,null)},(0,r.__)("Add another minimum order","google-listings-and-ads")),modal:(0,a.createElement)(X,{countryOptions:d.countries,initialValues:d,onSubmit:e=>{o(ae(t,null,e))}})})))})()),n))},le=()=>{const{getInputProps:e,values:t,adapter:n}=(0,u.S)(),o=t.shipping_country_rates.some(m);function l(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return{...e(t),helper:n.renderRequestedValidation(a)}}return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Y,(0,b.Z)({audienceCountries:n.audienceCountries},l("shipping_country_rates"))),o&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Q,l("offer_free_shipping")),t.offer_free_shipping&&(0,a.createElement)(oe,l("shipping_country_rates","free_shipping_threshold"))))},se=()=>{const{getInputProps:e,values:t}=(0,u.S)(),n=e("shipping_rate");return(0,a.createElement)(Z.Z,{title:(0,r.__)("Shipping rates","google-listings-and-ads"),description:(0,a.createElement)("div",null,(0,a.createElement)("p",null,(0,r.__)("Your estimated shipping rates and times will be shown to potential customers on Google.","google-listings-and-ads")),(0,a.createElement)("p",null,(0,a.createElement)(k.Z,{context:"setup-mc-shipping",linkId:"shipping-read-more",href:"https://support.google.com/merchants/answer/7050921"},(0,r.__)("Read more","google-listings-and-ads"))))},(0,a.createElement)(N.Z,{size:"large"},(0,a.createElement)(Z.Z.Card,null,(0,a.createElement)(Z.Z.Card.Body,null,(0,a.createElement)(N.Z,{size:"large"},(0,a.createElement)(w.Z,(0,b.Z)({},n,{label:(0,a.createInterpolateElement)((0,r.__)("<strong>Recommended:</strong> Automatically sync my store’s shipping settings to Google.","google-listings-and-ads"),{strong:(0,a.createElement)("strong",null)}),value:"automatic",collapsible:!0}),(0,a.createElement)(C,null,(0,r.__)("My current settings and any future changes to my store’s shipping rates and classes will be automatically synced to Google Merchant Center.","google-listings-and-ads"))),(0,a.createElement)(w.Z,(0,b.Z)({},n,{label:(0,r.__)("My shipping settings are simple. I can manually estimate flat shipping rates.","google-listings-and-ads"),value:"flat",collapsible:!0})),(0,a.createElement)(w.Z,(0,b.Z)({},n,{label:(0,r.__)("My shipping settings are complex. I will enter my shipping rates and times manually in Google Merchant Center.","google-listings-and-ads"),value:"manual",collapsible:!0}),(0,a.createElement)(C,null,(0,a.createInterpolateElement)((0,r.__)("I understand that if I don’t set this up manually in <link>Google Merchant Center</link>, my products will be disapproved by Google.","google-listings-and-ads"),{link:(0,a.createElement)(k.Z,{context:"setup-mc-shipping",linkId:"shipping-manual",href:"https://www.google.com/retail/solutions/merchant-center/"})})))))),"flat"===t.shipping_rate&&(0,a.createElement)(le,null)))},re=n(4594),ie=e=>{const t={};return 0===e.countries.length&&(t.countries=(0,r.__)("Please specify at least one country.","google-listings-and-ads")),Number.isInteger(e.time)||(t.time=(0,r.__)("Please enter the estimated shipping time.","google-listings-and-ads")),e.time<0&&(t.time=(0,r.__)("The estimated shipping time cannot be less than 0.","google-listings-and-ads")),t},ce=e=>{let{countries:t,onRequestClose:n,onSubmit:o}=e;const[l,s]=(0,a.useState)(!1);return(0,a.createElement)(L.Form,{initialValues:{countries:t,time:0},validate:ie,onSubmit:e=>{o(e),n()}},(e=>{const{getInputProps:o,isValidForm:i,handleSubmit:c}=e;return(0,a.createElement)(D.Z,{overflow:"visible",shouldCloseOnEsc:!l,shouldCloseOnClickOutside:!l,title:(0,r.__)("Estimate shipping time","google-listings-and-ads"),buttons:[(0,a.createElement)(P.Z,{key:"save",isPrimary:!0,disabled:!i,onClick:c},(0,r.__)("Add shipping time","google-listings-and-ads"))],onRequestClose:n},(0,a.createElement)(N.Z,null,(0,a.createElement)(R.Z,(0,b.Z)({label:(0,r.__)("If customer is in","google-listings-and-ads"),countryCodes:t,onDropdownVisibilityChange:s},o("countries"))),(0,a.createElement)(re.Z,(0,b.Z)({label:(0,r.__)("Then the estimated shipping time displayed in the product listing is","google-listings-and-ads"),suffix:(0,r.__)("days","google-listings-and-ads")},o("time")))))}))},de=e=>{const[t,n]=(0,a.useState)(!1);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(P.Z,{isSecondary:!0,icon:(0,a.createElement)(O.Z,null),onClick:()=>{n(!0)}},(0,r.__)("Add another time","google-listings-and-ads")),t&&(0,a.createElement)(ce,(0,b.Z)({onRequestClose:()=>{n(!1)}},e)))},ue=e=>{const{countries:t}=e;return(0,a.createElement)("div",null,(0,a.createElement)(z,{countries:t,textWithMore:
// translators: 1: list of country names separated by comma, up to 5 countries; 2: the remaining count of countries.
(0,r.__)("Shipping time for <strong>%1$s</strong> + %2$d more","google-listings-and-ads"),textWithoutMore:
// translators: 1: list of country names separated by comma.
(0,r.__)("Shipping time for <strong>%1$s</strong>","google-listings-and-ads")}))},ge=e=>{let{audienceCountries:t,time:n,onDelete:o,onSubmit:l,onRequestClose:s}=e;const[i,c]=(0,a.useState)(!1),d=Array.from(new Set([...n.countries,...t])),u=()=>{o(n.countries)};return(0,a.createElement)(L.Form,{initialValues:{countries:n.countries,time:n.time},validate:ie,onSubmit:e=>{const t=new Set(e.countries),a=n.countries.filter((e=>!t.has(e)));l(e,a)}},(e=>{const{getInputProps:t,isValidForm:n,handleSubmit:o}=e;return(0,a.createElement)(D.Z,{overflow:"visible",shouldCloseOnEsc:!i,shouldCloseOnClickOutside:!i,title:(0,r.__)("Estimate shipping time","google-listings-and-ads"),buttons:[(0,a.createElement)(P.Z,{key:"delete",isTertiary:!0,isDestructive:!0,onClick:u},(0,r.__)("Delete","google-listings-and-ads")),(0,a.createElement)(P.Z,{key:"save",isPrimary:!0,disabled:!n,onClick:o},(0,r.__)("Update shipping time","google-listings-and-ads"))],onRequestClose:s},(0,a.createElement)(N.Z,null,(0,a.createElement)(R.Z,(0,b.Z)({label:(0,r.__)("If customer is in","google-listings-and-ads"),countryCodes:d,onDropdownVisibilityChange:c},t("countries"))),(0,a.createElement)(re.Z,(0,b.Z)({label:(0,r.__)("Then the estimated shipping time displayed in the product listing is","google-listings-and-ads"),suffix:(0,r.__)("days","google-listings-and-ads")},t("time")))))}))},me=e=>{let{audienceCountries:t,time:n,onChange:o,onDelete:l}=e;const[s,i]=(0,a.useState)(!1);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(P.Z,{className:"gla-edit-time-button",isTertiary:!0,onClick:()=>{i(!0)}},(0,r.__)("Edit","google-listings-and-ads")),s&&(0,a.createElement)(ge,{audienceCountries:t,time:n,onSubmit:function(){o(...arguments),i(!1)},onDelete:e=>{l(e),i(!1)},onRequestClose:()=>{i(!1)}}))},pe=e=>{let{value:t,audienceCountries:n,onChange:o,onDelete:l}=e;const{countries:i,time:c}=t;return n?(0,a.createElement)("div",{className:"gla-countries-time-input"},(0,a.createElement)(re.Z,{label:(0,a.createElement)("div",{className:"label"},(0,a.createElement)(ue,{countries:i}),(0,a.createElement)(me,{audienceCountries:n,onChange:o,onDelete:l,time:t})),suffix:(0,r.__)("days","google-listings-and-ads"),value:c,onBlur:(e,t)=>{c!==t&&o({countries:i,time:t})}})):(0,a.createElement)(s.Z,null)};function he(e){let{value:t,audienceCountries:n,onChange:o}=e;const l=t.length,s=new Map(t.map((e=>[e.countryCode,e]))),r=n.filter((e=>!s.has(e))),i=r.length,c=(e=>{const t=new Map;return e.forEach((e=>{const{countryCode:n,time:a}=e,o=t.get(a)||{countries:[],time:a};o.countries.push(n),t.set(a,o)})),Array.from(t.values())})(t);function d(e){o(t.filter((t=>!e.includes(t.countryCode))))}function u(e){let{countries:t,time:n}=e;(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).forEach((e=>s.delete(e))),t.forEach((e=>{s.set(e,{countryCode:e,time:n})})),o(Array.from(s.values()))}return 0===c.length&&c.push({countries:n,time:null}),(0,a.createElement)("div",{className:"countries-time"},(0,a.createElement)(N.Z,null,c.map((e=>(0,a.createElement)("div",{key:e.countries.join("-"),className:"countries-time-input-form"},(0,a.createElement)(pe,{value:e,audienceCountries:n,onChange:u,onDelete:d})))),l>=1&&i>=1&&(0,a.createElement)("div",{className:"add-time-button"},(0,a.createElement)(de,{countries:r,onSubmit:function(e){let{countries:n,time:a}=e;const l=n.map((e=>({countryCode:e,time:a})));o(t.concat(l))}}))))}var _e=()=>{const{getInputProps:e,adapter:{audienceCountries:t,renderRequestedValidation:n}}=(0,u.S)();return t?(0,a.createElement)(Z.Z.Card,null,(0,a.createElement)(Z.Z.Card.Body,null,(0,a.createElement)(Z.Z.Card.Title,null,(0,r.__)("Estimated shipping times","google-listings-and-ads")),(0,a.createElement)(he,(0,b.Z)({},e("shipping_country_times"),{audienceCountries:t})),n("shipping_country_times"))):(0,a.createElement)(s.Z,null)},fe=()=>(0,a.createElement)(Z.Z,{title:(0,r.__)("Shipping times","google-listings-and-ads"),description:(0,a.createElement)("div",null,(0,a.createElement)("p",null,(0,r.__)("Your shipping times will be shown to potential customers on Google.","google-listings-and-ads")),(0,a.createElement)("p",null,(0,a.createElement)(k.Z,{context:"setup-mc-shipping",linkId:"shipping-read-more",href:"https://support.google.com/merchants/answer/7050921"},(0,r.__)("Read more","google-listings-and-ads"))))},(0,a.createElement)(_e,null)),Ee=e=>{let{show:t,children:n}=e;switch(t){case!0:return n;case!1:return null;default:return(0,a.createElement)(Z.Z,null,(0,a.createElement)(s.Z,null))}},ve=e=>{let{submitLabel:t=(0,r.__)("Complete setup","google-listings-and-ads")}=e;const{values:n,isValidForm:o,handleSubmit:s,adapter:i}=(0,u.S)(),c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const{code:t}=(0,l.Z)();return"US"===t||!(!e||!e.includes("US"))||(!t||null===e)&&null}(i.audienceCountries),d="flat"===n.shipping_time;return(0,a.createElement)(v.Z,null,(0,a.createElement)(T,null),(0,a.createElement)(se,null),d&&(0,a.createElement)(fe,null),(0,a.createElement)(Ee,{show:c},(0,a.createElement)(S,null)),(0,a.createElement)(y.Z,null,(0,a.createElement)(P.Z,{isPrimary:!0,loading:i.isSubmitting,onClick:e=>{if(null!==c&&o)return s(e);i.showValidation()}},t)))};const ye=["locale","language","location","countries"],be=["shipping_rate","shipping_time","tax_rate","website_live","checkout_process_secure","payment_methods_visible","refund_tos_visible","contact_info_visible"];var Ze=e=>{let{targetAudience:t,resolveFinalCountries:n,onTargetAudienceChange:i=o.noop,settings:c,onSettingsChange:v=o.noop,shippingRates:y,onShippingRatesChange:b=o.noop,shippingTimes:Z,onShippingTimesChange:C=o.noop,onContinue:w=o.noop,submitLabel:k,headerTitle:N}=e;const S=(0,a.useRef)(),{code:x}=(0,l.Z)();return t&&c&&y&&Z?(0,a.createElement)("div",{className:"gla-setup-free-listings"},(0,a.createElement)(d,{headerTitle:N}),(0,a.createElement)(u.Z,{ref:S,initialValues:{locale:t.locale,language:t.language,location:t.location,countries:t.countries||[],shipping_rate:c.shipping_rate,shipping_time:c.shipping_time,tax_rate:c.tax_rate,website_live:c.website_live,checkout_process_secure:c.checkout_process_secure,payment_methods_visible:c.payment_methods_visible,refund_tos_visible:c.refund_tos_visible,contact_info_visible:c.contact_info_visible,offer_free_shipping:E(y),shipping_country_rates:y,shipping_country_times:Z},extendAdapter:e=>({audienceCountries:n(e.values),renderRequestedValidation(t){return e.adapter.requestedShowValidation?(0,a.createElement)(g.Z,{messages:e.errors[t]}):null}}),onChange:(e,t)=>{const{setValue:a}=S.current;if("shipping_country_rates"===e.name)b(t.shipping_country_rates),e.value.some(m)||a("offer_free_shipping",void 0);else if("offer_free_shipping"===e.name){if(!1===e.value){const e=t.shipping_country_rates.map((e=>({...e,options:{...e.options,free_shipping_threshold:void 0}})));a("shipping_country_rates",e)}}else if("shipping_country_times"===e.name)C(t.shipping_country_times);else if(be.includes(e.name)){let n=!0;if("shipping_rate"===e.name){const o="manual"===e.value?"manual":"flat";o!==t.shipping_time&&(n=!1,a("shipping_time",o))}n&&v((e=>(0,o.pick)(e,be))(t))}else ye.includes(e.name)&&(i((0,o.pick)(t,ye)),["shipping_country_rates","shipping_country_times"].forEach((e=>{const o=n(t),l=t[e],s=l.filter((e=>o.includes(e.country||e.countryCode)));s.length!==l.length&&a(e,s)})))},validate:e=>{const t=n(e),{shipping_country_times:a}=e;return((e,t,n,a)=>{const o={};return p.has(e.location)||(o.location=(0,r.__)("Please select a location option.","google-listings-and-ads")),"selected"===e.location&&0===e.countries.length&&(o.countries=(0,r.__)("Please select at least one country.","google-listings-and-ads")),h.has(e.shipping_rate)||(o.shipping_rate=(0,r.__)("Please select a shipping rate option.","google-listings-and-ads")),"flat"===e.shipping_rate&&(e.shipping_country_rates.length<n.length||e.shipping_country_rates.some((e=>e.rate<0)))&&(o.shipping_country_rates=(0,r.__)("Please specify estimated shipping rates for all the countries, and the rate cannot be less than 0.","google-listings-and-ads")),"flat"===e.shipping_rate&&(void 0===e.offer_free_shipping&&e.shipping_country_rates.some(m)&&(o.offer_free_shipping=(0,r.__)("Please select an option for whether to offer free shipping.","google-listings-and-ads")),!0===e.offer_free_shipping&&e.shipping_country_rates.every((e=>void 0===e.options.free_shipping_threshold))&&(o.free_shipping_threshold=(0,r.__)("Please enter minimum order for free shipping.","google-listings-and-ads"))),_.has(e.shipping_time)||(o.shipping_time=(0,r.__)("Please select a shipping time option.","google-listings-and-ads")),"flat"===e.shipping_time&&(t.length<n.length||t.some((e=>e.time<0)))&&(o.shipping_country_times=(0,r.__)("Please specify estimated shipping times for all the countries, and the time cannot be less than 0.","google-listings-and-ads")),"US"!==a&&!n.includes("US")||f.has(e.tax_rate)||(o.tax_rate=(0,r.__)("Please specify tax rate option.","google-listings-and-ads")),o})(e,a,t,x)},onSubmit:w},(0,a.createElement)(ve,{submitLabel:k}))):(0,a.createElement)(s.Z,null)}},5631:function(e,t,n){n.d(t,{$:function(){return y},Z:function(){return Z}});var a=n(9307),o=n(1969),l=n(279),s=n(9770),r=n(5736),i=n(3108),c=n(965),d=n(8027),u=(0,a.createElement)(d.Z,{context:"setup-mc-accounts",linkId:"required-google-permissions",href:"https://woocommerce.com/document/google-listings-and-ads/#required-google-permissions"}),g=n(2760),m=n(1166),p=(e,t)=>{const{createNotice:n}=(0,g.Z)(),[a,o]=(0,m.Z)(e,t);return[async()=>{try{const{url:e}=await a();window.location.href=e}catch(e){n("error",(0,r.__)("Unable to connect your Google account. Please try again later.","google-listings-and-ads"))}},o]},h=e=>{let{additionalScopeEmail:t}=e;const n=i.glaData.mcSetupComplete?"reconnect":"setup-mc",[o,{loading:l,data:d}]=p(n,t);return(0,a.createElement)(s.Z,{appearance:s.O.GOOGLE,alignIcon:"top",description:(0,a.createElement)(a.Fragment,null,t,(0,a.createElement)("p",null,(0,a.createElement)("em",null,(0,a.createInterpolateElement)((0,r.__)("<alert>Uh-oh!</alert> You did not allow WooCommerce sufficient access to your Google account. You must allow all required permissions in the Google authorization page to proceed. <link>Read more</link>","google-listings-and-ads"),{alert:(0,a.createElement)("span",{className:"gla-authorize-google-account-card__error-text"}),link:u})))),alignIndicator:"top",indicator:(0,a.createElement)(c.Z,{isSecondary:!0,isDestructive:!0,loading:l||d,eventName:"gla_google_account_connect_button_click",eventProps:{context:n,action:"scope"},text:(0,r.__)("Allow full access","google-listings-and-ads"),onClick:o})})},_=n(9425),f=n(1693),E=n(6166),v=n(4773),y=e=>{let{googleAccount:t,helper:n,hideAccountSwitch:o=!1}=e;const[l,{loading:i}]=(()=>{const{createNotice:e,removeNotice:t}=(0,g.Z)(),[n,{loading:a}]=(0,v.Z)({path:`${E.Pj}/mc/connection`,method:"DELETE"}),[o,{loading:l}]=(0,v.Z)({path:`${E.Pj}/google/connect`,method:"DELETE"}),[s,{loading:i,data:c}]=(0,m.Z)("setup-mc");return[async()=>{const{notice:a}=await e("info",(0,r.__)("Connecting to a different Google account, please wait…","google-listings-and-ads"));try{await n(),await o();const{url:e}=await s();window.location.href=e}catch(n){t(a.id),e("error",(0,r.__)("Unable to connect to a different Google account. Please try again later.","google-listings-and-ads"))}},{loading:a||l||i||c}]})();return(0,a.createElement)(s.Z,{appearance:s.O.GOOGLE,description:t.email,helper:n,indicator:(0,a.createElement)(_.Z,null)},!o&&(0,a.createElement)(f.Z.Card.Footer,null,(0,a.createElement)(c.Z,{isLink:!0,disabled:i,text:(0,r.__)("Or, connect to a different Google account","google-listings-and-ads"),eventName:"gla_google_account_connect_different_account_button_click",onClick:l})))},b=e=>{let{disabled:t}=e;const n=i.glaData.mcSetupComplete?"reconnect":"setup-mc",[o,{loading:l,data:d}]=p(n);return(0,a.createElement)(s.Z,{appearance:s.O.GOOGLE,disabled:t,alignIcon:"top",description:(0,a.createElement)(a.Fragment,null,(0,r.__)("Required to sync with Google Merchant Center and Google Ads.","google-listings-and-ads"),(0,a.createElement)("p",null,(0,a.createElement)("em",null,(0,a.createInterpolateElement)((0,r.__)("You will be prompted to give WooCommerce access to your Google account. Please check all the checkboxes to give WooCommerce all required permissions. <link>Read more</link>","google-listings-and-ads"),{link:u})))),alignIndicator:"top",indicator:(0,a.createElement)(c.Z,{isSecondary:!0,disabled:t,loading:l||d,eventName:"gla_google_account_connect_button_click",eventProps:{context:n,action:"authorization"},text:(0,r.__)("Connect","google-listings-and-ads"),onClick:o})})};function Z(e){let{disabled:t=!1}=e;const{google:n,scope:r,hasFinishedResolution:i}=(0,o.Z)();if(!i)return(0,a.createElement)(s.Z,{description:(0,a.createElement)(l.Z,null)});const c="yes"===n?.active;return c&&r.glaRequired?(0,a.createElement)(y,{googleAccount:n}):c&&!r.glaRequired?(0,a.createElement)(h,{additionalScopeEmail:n.email}):(0,a.createElement)(b,{disabled:t})}},9498:function(e,t,n){n.d(t,{w:function(){return y},Z:function(){return W}});var a=n(9307),o=n(5609),l=n(5736),s=n(3108),r=n(1142),i=n(1969),c=n(3497),d=n(7462),u=n(585),g=n(9770),m=n(9425),p=n(1693),h=n(533),_=n(965),f=n(9862),E=n(1410),v=()=>{const{disconnectGoogleAdsAccount:e}=(0,h.T)(),[t,n]=(0,a.useState)(!1),o=(0,f.Z)(E.P),s=(0,a.useCallback)((()=>{n(!0),e(!0).catch((()=>n(!1)))}),[e]);return(0,a.createElement)(_.Z,{isTertiary:!0,loading:t,text:(0,l.__)("Or, connect to a different Google Ads account","google-listings-and-ads"),eventName:"gla_ads_account_disconnect_button_click",eventProps:o(),onClick:s})};function y(e){let{googleAdsAccount:t,hideAccountSwitch:n=!1,children:l,...s}=e;return(0,a.createElement)(g.Z,(0,d.Z)({appearance:g.O.GOOGLE_ADS,description:(0,a.createElement)(o.ExternalLink,{href:"https://ads.google.com/aw/overview"},(0,u.Z)(t.id)),indicator:(0,a.createElement)(m.Z,null)},s),l,!n&&(0,a.createElement)(p.Z.Card.Footer,null,(0,a.createElement)(v,null)))}var b=n(325),Z=()=>{const{fetchGoogleAdsAccountStatus:e}=(0,h.T)();return(0,b.Z)(e,30),(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",{className:"gla-ads-claim-account-notice"},(0,l.__)("Claim your new Google Ads account to complete this setup.","google-listings-and-ads")),(0,a.createElement)(p.Z.Card.Footer,null,(0,a.createElement)(v,null)))},C=n(2819),w=n(5145),k=n(363),N=e=>{let{onClick:t=C.noop,...n}=e;const{inviteLink:o}=(0,k.Z)(),l=(0,f.Z)(E.P);return(0,a.createElement)(_.Z,(0,d.Z)({},n,{eventName:"gla_open_ads_account_claim_invitation_button_click",eventProps:l(),onClick:e=>{const{defaultView:n}=e.target.ownerDocument,a=(0,w.Z)(n,600,800);n.open(o,"_blank",a),t(e)}}))},S=n(591),x=e=>{let{onRequestClose:t}=e;const{hasAccess:n}=(0,k.Z)();return(0,a.useEffect)((()=>{n&&t()}),[t,n]),(0,a.createElement)(S.Z,{className:"gla-ads-invite-modal",title:(0,l.__)("Claim your Google Ads account","google-listings-and-ads"),buttons:[(0,a.createElement)(N,{key:"1",isPrimary:!0,onClick:t},(0,l.__)("Claim account in Google Ads","google-listings-and-ads"))],onRequestClose:t},(0,a.createElement)("p",null,(0,l.__)("Claiming your account lets you access Google Ads and sets up conversion measurement. You must claim your account in the next 20 days.","google-listings-and-ads")),(0,a.createElement)("p",null,(0,l.__)("When you claim your account, you’ll be asked to set up billing. This step is optional and you only need to complete it if you want to create Google Ads campaigns. If you don’t want to set up billing, close the window after you’ve clicked ‘Continue’ on the next page.","google-listings-and-ads")))},A=n(8027),R=e=>{let{onCreateAccount:t=(()=>{}),onRequestClose:n=(()=>{})}=e;const[s,r]=(0,a.useState)(!1),i=(0,f.Z)(E.P);return(0,a.createElement)(S.Z,{className:"gla-ads-terms-modal",title:(0,l.__)("Create Google Ads Account","google-listings-and-ads"),buttons:[(0,a.createElement)(_.Z,{key:"1",isPrimary:!0,disabled:!s,eventName:"gla_ads_account_create_button_click",eventProps:i(),onClick:()=>{t(),n()}},(0,l.__)("Create account","google-listings-and-ads"))],onRequestClose:n},(0,a.createElement)("p",{className:"main"},(0,l.__)("By creating a Google Ads account, you agree to the following terms and conditions:","google-listings-and-ads")),(0,a.createElement)("p",null,(0,a.createInterpolateElement)((0,l.__)("You agree to comply with Google’s terms and policies, including <policylink>Shopping ads policies</policylink> and <termslink>Google Ads Terms and Conditions</termslink>.","google-listings-and-ads"),{policylink:(0,a.createElement)(A.Z,{context:"setup-ads",linkId:"shopping-ads-policies",href:"https://support.google.com/merchants/answer/6149970"}),termslink:(0,a.createElement)(A.Z,{context:"setup-ads",linkId:"google-ads-terms-of-service",href:"https://support.google.com/adspolicy/answer/54818"})})),(0,a.createElement)(o.CheckboxControl,{label:(0,l.__)("I have read and accept these terms","google-listings-and-ads"),checked:s,onChange:r}))},T=e=>{let{onCreateAccount:t}=e;const[n,o]=(0,a.useState)(!1);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(_.Z,{isSecondary:!0,text:(0,l.__)("Create account","google-listings-and-ads"),onClick:()=>{o(!0)}}),n&&(0,a.createElement)(R,{onCreateAccount:t,onRequestClose:()=>{o(!1)}}))},O=n(6166),P=n(4773),G=n(2760),I=e=>{const{allowShowExisting:t,onShowExisting:n}=e,[o,s]=(0,a.useState)(!1),{googleAdsAccount:r}=(0,c.Z)(),{hasAccess:i,step:d}=(0,k.Z)(),[u,{loading:m,action:f}]=(()=>{const{googleAdsAccount:e}=(0,c.Z)(),{createNotice:t}=(0,G.Z)(),{fetchGoogleAdsAccount:n,fetchGoogleAdsAccountStatus:o}=(0,h.T)(),[s,r]=(0,a.useState)(null),i=!e?.id,[d]=(0,P.Z)({path:`${O.Pj}/ads/accounts`,method:"POST",data:{id:e?.id||void 0}});return[(0,a.useCallback)((async()=>{r(i?"create":"update");try{await d({parse:!1})}catch(e){428!==e.status&&t("error",(0,l.__)("Unable to create Google Ads account. Please try again later.","google-listings-and-ads"))}await Promise.all([n(),o()]),r(null)}),[i,t,d,n,o]),{loading:null!==s,action:s}]})(),E=Boolean(r.id&&!1===i),v=async()=>{await u(),s(!0)};return(0,a.useEffect)((()=>{!0===i&&"conversion_action"===d&&u()}),[i,u,d]),(0,a.createElement)(g.Z,{appearance:g.O.GOOGLE_ADS,alignIcon:"top",indicator:(()=>{if(m){const e="create"===f?(0,l.__)("Creating…","google-listings-and-ads"):(0,l.__)("Updating…","google-listings-and-ads");return(0,a.createElement)(_.Z,{loading:!0,text:e})}return E?(0,a.createElement)(N,{isSecondary:!0},(0,l.__)("Claim Account","google-listings-and-ads")):(0,a.createElement)(T,{onCreateAccount:v})})()},t&&!E&&(0,a.createElement)(p.Z.Card.Footer,null,(0,a.createElement)(_.Z,{isLink:!0,disabled:m,onClick:n},(0,l.__)("Or, use your existing Google Ads account","google-listings-and-ads"))),E&&(0,a.createElement)(a.Fragment,null,o&&(0,a.createElement)(x,{onRequestClose:()=>{s(!1)}}),(0,a.createElement)(Z,null)))},L=n(9818),M=n(6280),F=n(6020);function D(e){let{text:t}=e;return(0,a.createElement)("div",{className:"gla-loading-label"},(0,a.createElement)(F.Spinner,null),t)}var U=n(9054),V=n(3091),q=e=>{const{accounts:t,...n}=e,o=[{value:"",label:(0,l.__)("Select one","google-listings-and-ads")},...t.map((e=>({value:e.id,label:(0,l.sprintf)(
// translators: 1: account name, 2: account ID.
(0,l.__)("%1$s (%2$s)","google-listings-and-ads"),e.name,e.id)})))];return(0,a.createElement)(V.Z,(0,d.Z)({options:o},n))},$=e=>{const{accounts:t,onCreateNew:n=(()=>{})}=e,[s,r]=(0,a.useState)(),[i,d]=(0,a.useState)(!1),[u]=(0,P.Z)({path:"/wc/gla/ads/accounts",method:"POST",data:{id:s}}),{refetchGoogleAdsAccount:m}=(0,c.Z)(),v=(0,f.Z)(E.P),{createNotice:y}=(0,G.Z)(),{fetchGoogleAdsAccountStatus:b}=(0,h.T)(),Z=t.length>1;return(0,a.createElement)(g.Z,{className:"gla-connect-ads",alignIcon:"top",appearance:g.O.GOOGLE_ADS},(0,a.createElement)(o.CardDivider,null),(0,a.createElement)(p.Z.Card.Body,null,(0,a.createElement)(U.Z.Title,null,(0,l.__)("Select an existing account","google-listings-and-ads")),Z&&(0,a.createElement)(U.Z.Body,null,(0,a.createInterpolateElement)((0,l.__)("If you manage multiple sub-accounts in Google Ads, please connect the relevant sub-account, not a manager account. <link>Learn more</link>","google-listings-and-ads"),{link:(0,a.createElement)(A.Z,{context:"setup-ads-connect-account",linkId:"connect-sub-account",href:"https://support.google.com/google-ads/answer/6139186"})})),(0,a.createElement)(M.Z,null,(0,a.createElement)(q,{accounts:t,value:s,onChange:r}),i?(0,a.createElement)(D,{text:(0,l.__)("Connecting…","google-listings-and-ads")}):(0,a.createElement)(_.Z,{isSecondary:!0,disabled:!s,eventName:"gla_ads_account_connect_button_click",eventProps:v({id:Number(s)}),onClick:async()=>{if(s){d(!0);try{await u(),await b(),await m()}catch(e){d(!1),y("error",(0,l.__)("Unable to connect your Google Ads account. Please try again later.","google-listings-and-ads"))}}}},(0,l.__)("Connect","google-listings-and-ads")))),(0,a.createElement)(p.Z.Card.Footer,null,(0,a.createElement)(_.Z,{isTertiary:!0,disabled:i,onClick:n},(0,l.__)("Or, create a new Google Ads account","google-listings-and-ads"))))},B=()=>{const{existingAccounts:e}=(0,L.useSelect)((e=>({existingAccounts:e(O.Ls).getExistingGoogleAdsAccounts(),isResolving:e(O.Ls).isResolving("getExistingGoogleAdsAccounts")})),[]),[t,n]=(0,a.useState)(!1),{googleAdsAccount:o}=(0,c.Z)(),{hasAccess:l,step:s}=(0,k.Z)();return e?0===e.length||t||o.id&&!0!==l||!0===l&&"conversion_action"===s?(0,a.createElement)(I,{allowShowExisting:t,onShowExisting:()=>{n(!1)}}):(0,a.createElement)($,{accounts:e,onCreateNew:()=>{n(!0)}}):(0,a.createElement)(r.Z,null)},z=n(1166),j=e=>{let{additionalScopeEmail:t}=e;const n=s.glaData.mcSetupComplete?"setup-ads":"setup-mc",{createNotice:o}=(0,G.Z)(),[r,{loading:i,data:c}]=(0,z.Z)(n,t);return(0,a.createElement)(g.Z,{appearance:g.O.GOOGLE_ADS,alignIcon:"top",indicator:(0,a.createElement)(_.Z,{isSecondary:!0,loading:i||c,onClick:()=>{r().then((e=>{let{url:t}=e;window.location.href=t})).catch((()=>{o("error",(0,l.__)("Unable to get Google authorization page. Please try again later.","google-listings-and-ads"))}))},text:(0,l.__)("Allow full access","google-listings-and-ads"),eventName:"gla_google_account_connect_button_click",eventProps:{context:"setup-ads",action:"scope"}})})},H=()=>(0,a.createElement)(g.Z,{disabled:!0,appearance:g.O.GOOGLE_ADS});function W(){const{google:e,scope:t,hasFinishedResolution:n}=(0,i.Z)(),{googleAdsAccount:d,hasFinishedResolution:u}=(0,c.Z)(),{hasAccess:g,step:m,hasFinishedResolution:p}=(0,k.Z)();if(!n||!u||!p||null===d)return(0,a.createElement)(r.Z,null);if(!e||"no"===e.active)return(0,a.createElement)(H,null);if(!t.adsRequired)return(0,a.createElement)(j,{additionalScopeEmail:e.email});if(d.status===s.GOOGLE_ADS_ACCOUNT_STATUS.DISCONNECTED||!0!==g||!0===g&&"conversion_action"===m)return(0,a.createElement)(B,null);const h=d.status===s.GOOGLE_ADS_ACCOUNT_STATUS.CONNECTED||"link_merchant"===d.step;return(0,a.createElement)(y,{googleAdsAccount:d},h?(0,a.createElement)(o.Notice,{status:"success",isDismissible:!1},(0,l.__)("Conversion measurement has been set up. You can create a campaign later.","google-listings-and-ads")):null)}},332:function(e,t,n){n.d(t,{Z:function(){return _},C:function(){return W}});var a=n(9307),o=n(1142),l=n(6883),s=n(5736),r=n(4617),i=n(9770),c=n(965),d=n(9425),u=n(1693),g=n(6166),m=n(2760),p=n(4773),h=n(533),_=e=>{let{googleMCAccount:t,hideAccountSwitch:n=!1}=e;const{createNotice:o,removeNotice:l}=(0,m.Z)(),{invalidateResolution:_}=(0,h.T)(),[f,{loading:E}]=(0,p.Z)({path:`${g.Pj}/mc/connection`,method:"DELETE"}),v=new URL((0,r.getSetting)("homeUrl")).host;return(0,a.createElement)(i.Z,{appearance:i.O.GOOGLE_MERCHANT_CENTER,description:(0,s.sprintf)(
// translators: 1: account domain, 2: account ID.
(0,s.__)("%1$s (%2$s)","google-listings-and-ads"),v,t.id),indicator:(0,a.createElement)(d.Z,null)},!n&&(0,a.createElement)(u.Z.Card.Footer,null,(0,a.createElement)(c.Z,{isLink:!0,disabled:E,text:(0,s.__)("Or, connect to a different Google Merchant Center account","google-listings-and-ads"),eventName:"gla_mc_account_connect_different_account_button_click",onClick:async()=>{const{notice:e}=await o("info",(0,s.__)("Disconnecting your Google Merchant Center account, please wait…","google-listings-and-ads"));try{await f(),_("getExistingGoogleMCAccounts",[]),_("getGoogleMCAccount",[])}catch(e){o("error",(0,s.__)("Unable to disconnect your Google Merchant Center account. Please try again later.","google-listings-and-ads"))}l(e.id)}})))},f=()=>(0,a.createElement)(i.Z,{disabled:!0,appearance:i.O.GOOGLE_MERCHANT_CENTER}),E=n(2109),v=()=>(0,E.Z)("getExistingGoogleMCAccounts"),y=n(5609),b=n(7462),Z=n(3091),C=e=>{let{value:t,onChange:n=(()=>{}),...o}=e;const{data:l=[]}=v(),r=l.map((e=>({value:e.id,label:(0,s.sprintf)(
// translators: 1: account name, 2: account domain, 3: account ID.
(0,s.__)("%1$s ・ %2$s (%3$s)","google-listings-and-ads"),e.name,e.domain,e.id)})));return r.sort(((e,t)=>e.label.localeCompare(t.label))),(0,a.useEffect)((()=>{void 0===t&&n(r[0]?.value)}),[r,n,t]),(0,a.createElement)(Z.Z,(0,b.Z)({options:r,onChange:n,value:t},o))},w=n(9054),k=n(6280),N=n(2819),S=n(8027),x=n(1984),A=n(8406),R=n(4184),T=n.n(R),O=n(2),P=e=>{const{className:t,...n}=e;return(0,a.createElement)(O.Z,(0,b.Z)({className:T()("app-input-link-control",t),prefix:(0,a.createElement)(x.Z,{icon:A.Z,size:24})},n))},G=e=>{let{id:t,websiteUrl:n,onSwitchAccount:o=N.noop}=e;const{invalidateResolution:l}=(0,h.T)(),[d,{loading:g,error:m,reset:_}]=(0,p.Z)({path:"/wc/gla/mc/accounts/claim-overwrite",method:"POST",data:{id:t}}),f=(0,r.getSetting)("homeUrl");return(0,a.createElement)(i.Z,{className:"gla-reclaim-url-card",appearance:i.O.GOOGLE_MERCHANT_CENTER,description:(0,s.sprintf)(
// translators: 1: website URL, 2: account ID.
(0,s.__)("%1$s (%2$s)","google-listings-and-ads"),n,t),indicator:(0,a.createElement)(c.Z,{isSecondary:!0,disabled:g,eventName:"gla_mc_account_switch_account_button_click",eventProps:{context:"reclaim-url"},onClick:o},(0,s.__)("Switch account","google-listings-and-ads"))},(0,a.createElement)(y.CardDivider,null),(0,a.createElement)(u.Z.Card.Body,null,(0,a.createElement)(w.Z.Title,null,(0,s.__)("Reclaim your URL","google-listings-and-ads")),(0,a.createElement)(w.Z.Body,null,(0,s.__)("Your URL is currently claimed by another Merchant Center account.","google-listings-and-ads")),(0,a.createElement)(k.Z,null,(0,a.createElement)(P,{disabled:!0,value:f}),(0,a.createElement)(c.Z,{isSecondary:!0,loading:g,eventName:"gla_mc_account_reclaim_url_button_click",onClick:async()=>{_(),await d({parse:!1}),l("getGoogleMCAccount",[])}},(0,s.__)("Reclaim my URL","google-listings-and-ads"))),(0,a.createElement)(w.Z.HelperText,null,(0,a.createInterpolateElement)((0,s.__)("If you reclaim this URL, it will cause any existing product listings or ads to stop running, and the other verified account will be notified that they have lost their claim. <link>Learn more</link>.","google-listings-and-ads"),{link:(0,a.createElement)(S.Z,{context:"setup-mc",linkId:"claim-url",href:"https://support.google.com/merchants/answer/176793"})})),m&&(0,a.createElement)(y.Notice,{status:"error",isDismissible:!1},(0,a.createInterpolateElement)((0,s.__)("<strong>We were unable to reclaim this URL.</strong> You may not have permission to reclaim this URL, or an error might have occurred. Try again later or contact your Google account administrator.","google-listings-and-ads"),{strong:(0,a.createElement)("strong",null)}))))},I=e=>{let{id:t,claimedUrl:n,newUrl:o,onSelectAnotherAccount:l=(()=>{})}=e;const{createNotice:d}=(0,m.Z)(),{invalidateResolution:g}=(0,h.T)(),[_,{loading:f,error:E,response:v}]=(0,p.Z)({path:"/wc/gla/mc/accounts/switch-url",method:"POST",data:{id:t}}),b=(0,r.getSetting)("homeUrl"),Z=()=>{l()};return v&&403===v.status?(0,a.createElement)(G,{id:E.id,websiteUrl:E.website_url,onSwitchAccount:Z}):(0,a.createElement)(i.Z,{className:"gla-switch-url-card",appearance:i.O.GOOGLE_MERCHANT_CENTER,description:(0,s.sprintf)(
// translators: 1: the new URL, 2: account ID.
(0,s.__)("%1$s (%2$s)","google-listings-and-ads"),o,t),indicator:(0,a.createElement)(c.Z,{isSecondary:!0,disabled:f,eventName:"gla_mc_account_switch_account_button_click",eventProps:{context:"switch-url"},onClick:Z},(0,s.__)("Switch account","google-listings-and-ads"))},(0,a.createElement)(y.CardDivider,null),(0,a.createElement)(u.Z.Card.Body,null,(0,a.createElement)(w.Z.Title,null,(0,s.__)("Switch to this new URL","google-listings-and-ads")),(0,a.createElement)(w.Z.Body,null,(0,s.sprintf)(
// translators: %s: claimed URL.
(0,s.__)("This Merchant Center account already has a verified and claimed URL, %s.","google-listings-and-ads"),n)),(0,a.createElement)(k.Z,null,(0,a.createElement)(P,{disabled:!0,value:b}),(0,a.createElement)(c.Z,{isSecondary:!0,loading:f,eventName:"gla_mc_account_switch_url_button_click",onClick:async()=>{try{await _({parse:!1}),g("getGoogleMCAccount",[])}catch(e){if(403!==e.status){const t=(await e.json()).message||(0,s.__)("Unable to switch to your new URL. Please try again later.","google-listings-and-ads");d("error",t)}}}},(0,s.__)("Switch to this new URL","google-listings-and-ads"))),(0,a.createElement)(w.Z.HelperText,null,(0,s.sprintf)(/* translators: 1: new URL. 2: claimed URL. */
(0,s.__)("If you switch your claimed URL to %1$s, you will lose your claim to %2$s. This will cause any existing product listings tied to %2$s to stop running.","google-listings-and-ads"),o,n))))},L=n(591),M=n(8144),F=e=>{let{existingAccount:t,onContinue:n=(()=>{}),onRequestClose:o=(()=>{})}=e;return(0,a.createElement)(L.Z,{className:"gla-mc-warning-modal",title:(0,s.__)("Create Google Merchant Center Account","google-listings-and-ads"),buttons:[(0,a.createElement)(c.Z,{key:"confirm",isSecondary:!0,eventName:"gla_mc_account_warning_modal_confirm_button_click",onClick:()=>{n()}},(0,s.__)("Yes, I want a new account","google-listings-and-ads")),(0,a.createElement)(c.Z,{key:"cancel",isPrimary:!0,onClick:o},(0,s.__)("Cancel","google-listings-and-ads"))],onRequestClose:o},(0,a.createElement)("p",{className:"gla-mc-warning-modal__warning-text"},(0,a.createElement)(M.Z,null),(0,a.createElement)("span",null,(0,s.__)("Are you sure you want to create a new Google Merchant Center account?","google-listings-and-ads"))),(0,a.createElement)("p",null,(0,a.createInterpolateElement)((0,s.__)("You already have another verified account, <storename />, which is connected to this store’s URL, <storeurl />.","google-listings-and-ads"),{storename:(0,a.createElement)("strong",null,t.name),storeurl:(0,a.createElement)("strong",null,t.domain)})),(0,a.createElement)("p",null,(0,s.__)("If you create a new Google Merchant Center account, you will have to reclaim this store’s URL with the new account. This will cause any existing product listings or ads to stop running, and the other verified account will lose its claim.","google-listings-and-ads")))},D=e=>{let{onCreateAccount:t=(()=>{}),onRequestClose:n=(()=>{})}=e;const[o,l]=(0,a.useState)(!1);return(0,a.createElement)(L.Z,{className:"gla-mc-terms-modal",title:(0,s.__)("Create Google Merchant Center Account","google-listings-and-ads"),buttons:[(0,a.createElement)(c.Z,{key:"1",isPrimary:!0,disabled:!o,eventName:"gla_mc_account_create_button_click",onClick:()=>{t(),n()}},(0,s.__)("Create account","google-listings-and-ads"))],onRequestClose:n},(0,a.createElement)("p",{className:"main"},(0,s.__)("By creating a Google Merchant Center account, you agree to the following terms and conditions:","google-listings-and-ads")),(0,a.createElement)("p",null,(0,a.createInterpolateElement)((0,s.__)("You agree to comply with Google’s terms and policies, including <link>Google Merchant Center Terms of Service</link>.","google-listings-and-ads"),{link:(0,a.createElement)(S.Z,{context:"setup-mc",linkId:"google-mc-terms-of-service",href:"https://support.google.com/merchants/answer/160173"})})),(0,a.createElement)(y.CheckboxControl,{label:(0,s.__)("I have read and accept these terms","google-listings-and-ads"),checked:o,onChange:l}))};const U=Object.freeze({NONE:"NONE",WARNING:"WARNING",TERMS:"TERMS"});var V=e=>{const{onCreateAccount:t=N.noop,onClick:n=N.noop,...o}=e,[l,s]=(0,a.useState)(U.NONE),{data:i}=v(),d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=new URL((0,r.getSetting)("homeUrl")).toString();return e.find((e=>{try{return new URL(e.domain).toString()===t}catch(e){return!1}}))}(i),u=()=>{s(U.NONE)};return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(c.Z,(0,b.Z)({onClick:()=>{s(d?U.WARNING:U.TERMS),n()}},o)),l===U.WARNING&&(0,a.createElement)(F,{existingAccount:d,onContinue:()=>{s(U.TERMS)},onRequestClose:u}),l===U.TERMS&&(0,a.createElement)(D,{onCreateAccount:t,onRequestClose:u}))},q=()=>{const{createNotice:e}=(0,m.Z)(),{invalidateResolution:t}=(0,h.T)(),[n,a]=(0,p.Z)({path:"/wc/gla/mc/accounts",method:"POST"});return[async()=>{try{await n({data:a.error?.id&&{id:a.error.id},parse:!1}),t("getGoogleMCAccount",[])}catch(t){if(![403,503].includes(t.status)){const n=(await t.json()).message||(0,s.__)("Unable to create Merchant Center account. Please try again later.","google-listings-and-ads");e("error",n)}}},a]},$=e=>{const{retryAfter:t,onRetry:n=(()=>{})}=e;return(0,a.useEffect)((()=>{if(!t)return;const e=setInterval((()=>{n()}),1e3*t);return()=>clearInterval(e)}),[t,n]),(0,a.createElement)(i.Z,{appearance:i.O.GOOGLE_MERCHANT_CENTER,description:(0,s.__)("This may take a few minutes, please wait a moment…","google-listings-and-ads"),indicator:(0,a.createElement)(c.Z,{loading:!0},(0,s.__)("Creating…","google-listings-and-ads"))})},B=()=>{const[e,t]=(0,a.useState)(),[n,o]=(e=>{const{createNotice:t}=(0,m.Z)(),[n,a]=(0,p.Z)({path:"/wc/gla/mc/accounts",method:"POST",data:{id:e}}),{invalidateResolution:o}=(0,h.T)();return[async()=>{if(e)try{await n({parse:!1}),o("getGoogleMCAccount",[])}catch(e){if(![409,403].includes(e.status)){const n=(await e.json()).message||(0,s.__)("Unable to connect Merchant Center account. Please try again later.","google-listings-and-ads");t("error",n)}}},a]})(e),[l,r]=q();return 409===o.response?.status?(0,a.createElement)(I,{id:o.error.id,message:o.error.message,claimedUrl:o.error.claimed_url,newUrl:o.error.new_url,onSelectAnotherAccount:o.reset}):403===o.response?.status||403===r.response?.status?(0,a.createElement)(G,{id:o.error?.id||r.error?.id,websiteUrl:o.error?.website_url||r.error?.website_url,onSwitchAccount:()=>{o.reset(),r.reset()}}):r.loading||503===r.response?.status?(0,a.createElement)($,{retryAfter:r.error?.retry_after,onRetry:l}):(0,a.createElement)(i.Z,{className:"gla-connect-mc-card",appearance:i.O.GOOGLE_MERCHANT_CENTER},(0,a.createElement)(y.CardDivider,null),(0,a.createElement)(u.Z.Card.Body,null,(0,a.createElement)(w.Z.Title,null,(0,s.__)("Select an existing account","google-listings-and-ads")),(0,a.createElement)(k.Z,null,(0,a.createElement)(C,{value:e,onChange:t}),(0,a.createElement)(c.Z,{isSecondary:!0,loading:o.loading,disabled:!e,eventName:"gla_mc_account_connect_button_click",eventProps:{id:Number(e)},onClick:n},(0,s.__)("Connect","google-listings-and-ads")))),(0,a.createElement)(u.Z.Card.Footer,null,(0,a.createElement)(V,{isLink:!0,disabled:o.loading,onCreateAccount:l},(0,s.__)("Or, create a new Merchant Center account","google-listings-and-ads"))))},z=e=>{const{onCreateAccount:t}=e;return(0,a.createElement)(i.Z,{appearance:i.O.GOOGLE_MERCHANT_CENTER,indicator:(0,a.createElement)(V,{isSecondary:!0,onCreateAccount:t},(0,s.__)("Create account","google-listings-and-ads"))})},j=e=>{const{onSwitchAccount:t}=e,[n,{loading:o,error:l,response:s}]=q();return o||s&&503===s.status?(0,a.createElement)($,{retryAfter:l&&l.retry_after,onRetry:n}):s&&403===s.status?(0,a.createElement)(G,{id:l.id,websiteUrl:l.website_url,onSwitchAccount:t}):(0,a.createElement)(z,{onCreateAccount:n})},H=()=>{const{data:e,hasFinishedResolution:t,invalidateResolution:n}=v();return t?e.length>0?(0,a.createElement)(B,null):(0,a.createElement)(j,{onSwitchAccount:n}):(0,a.createElement)(o.Z,null)},W=()=>{const{hasFinishedResolution:e,isPreconditionReady:t,googleMCAccount:n}=(0,l.Z)();return e?t?0===n.id||"connected"!==n.status&&"link_ads"!==n.step?(0,a.createElement)(H,null):(0,a.createElement)(_,{googleMCAccount:n}):(0,a.createElement)(f,null):(0,a.createElement)(o.Z,null)}},56:function(e,t,n){n.d(t,{Z:function(){return i},_:function(){return c}});var a=n(7462),o=n(9307),l=n(4184),s=n.n(l),r=n(3201);function i(e){let{title:t,children:n}=e;return(0,o.createElement)("div",{className:"gla-guide__page-content"},(0,o.createElement)("h2",{className:"gla-guide__page-content__header"},t),(0,o.createElement)("div",{className:"gla-guide__page-content__body"},n))}function c(e){const{context:t,href:n,className:l,...i}=e;return(0,o.createElement)(r.Z,(0,a.Z)({className:s()("gla-guide__page-content__link",l),eventName:"gla_modal_content_link_click",eventProps:{context:t,href:n},type:"external",target:"_blank",href:n},i))}},741:function(e,t,n){n.d(t,{Z:function(){return c}});var a=n(7462),o=n(9307),l=n(5736),s=n(7719),r=n(965),i=e=>{const{icon:t,text:n,className:l="",...s}=e;return(0,o.createElement)(r.Z,(0,a.Z)({className:`app-icon-button ${l}`},s),(0,o.createElement)("div",null,t),n)},c=e=>{const{eventContext:t,...n}=e;return(0,o.createElement)(i,(0,a.Z)({icon:(0,o.createElement)(s.Z,null),text:(0,l.__)("Help","google-listings-and-ads"),href:"https://woocommerce.com/document/google-listings-and-ads/",target:"_blank",eventName:"gla_help_click",eventProps:{context:t}},n))}},8500:function(e,t,n){var a=n(7462),o=n(9307),l=n(4184),s=n.n(l),r=n(5736),i=n(5609),c=n(7719),d=n(1410);t.Z=e=>{let{className:t,id:n,disabled:l=!1,iconSize:u=16,children:g,...m}=e;const[p,h]=(0,o.useState)(!1);return(0,o.createElement)("span",{className:s()("help-popover",t)},(0,o.createElement)("button",{"aria-label":(0,r.__)("Open popover","google-listings-and-ads"),disabled:l,onClick:()=>{h(!0),n&&(0,d.dk)("gla_tooltip_viewed",{id:n})}},(0,o.createElement)(c.Z,{size:u})),p&&!l&&(0,o.createElement)(i.Popover,(0,a.Z)({focusOnMount:"container",inline:!0,onClose:()=>{h(!1)}},m),g))}},6439:function(e,t,n){n.d(t,{Z:function(){return g}});var a=n(9307),o=n(5736),l=n(431),s=n(3108),r=n(4492),i=n(3816);let c=[{key:"dashboard",title:(0,o.__)("Dashboard","google-listings-and-ads"),href:(0,l.getNewPath)({},"/google/dashboard",{})},{key:"reports",title:(0,o.__)("Reports","google-listings-and-ads"),href:(0,l.getNewPath)({},"/google/reports",{})},{key:"product-feed",title:(0,o.__)("Product Feed","google-listings-and-ads"),href:(0,l.getNewPath)({},"/google/product-feed",{})},{key:"attribute-mapping",title:(0,o.__)("Attributes","google-listings-and-ads"),href:(0,l.getNewPath)({},"/google/attribute-mapping",{})},{key:"settings",title:(0,o.__)("Settings","google-listings-and-ads"),href:(0,l.getNewPath)({},"/google/settings",{})}];s.glaData.enableReports||(c=c.filter((e=>{let{key:t}=e;return"reports"!==t})));var d=()=>{(0,i.Z)();const e=(()=>{const e=(0,l.getPath)();return c.find((t=>e.includes(t.key)))?.key})();return(0,a.createElement)(r.Z,{tabs:c,selectedKey:e})},u=n(7018),g=()=>(0,u.Z)()?null:(0,a.createElement)(d,null)},8749:function(e,t,n){var a=n(7462),o=n(9307),l=n(5736),s=n(431),r=n(965),i=n(3108),c=n(146),d=n(1410);t.Z=e=>{const{eventName:t="gla_add_paid_campaign_clicked",eventProps:n,children:u,onClick:g=(()=>{}),...m}=e,{adsSetupComplete:p}=i.glaData,h=p?(0,c.F0)():(0,s.getNewPath)({},"/google/setup-ads",{}),_={context:"",href:h};return(0,o.createElement)(r.Z,(0,a.Z)({isSmall:!0,isSecondary:!0,onClick:function(){(0,d.dk)(t,{..._,...n}),(0,s.getHistory)().push(h),g(...arguments)}},m),u||(0,l.__)("Add paid campaign","google-listings-and-ads"))}},3313:function(e,t,n){n.d(t,{Z:function(){return h}});var a=n(9307),o=n(5736),l=n(3538),s=n(5602),r=n(2279),i=n(8027),c=n(965),d=n(4752),u=n(8194),g=n(1706),m=n(4565),p=n(4963);function h(e){let{campaign:t,onContinue:n,trackingContext:h}=e;const _=!t,f=(0,d.S)(),{isValidForm:E}=f,v=!f.values.countryCodes.length,y=_?(0,o.__)("You can only choose from countries you’ve selected during product listings configuration.","google-listings-and-ads"):(0,o.__)("Once a campaign has been created, you cannot change the target country(s).","google-listings-and-ads");return(0,a.createElement)(l.Z,null,(0,a.createElement)(s.Z,{title:_?(0,o.__)("Create your paid campaign","google-listings-and-ads"):(0,o.__)("Edit your paid campaign","google-listings-and-ads"),description:(0,a.createInterpolateElement)((0,o.__)("Paid Performance Max campaigns are automatically optimized for you by Google. <link>See what your ads will look like.</link>","google-listings-and-ads"),{link:(0,a.createElement)(i.Z,{context:h,linkId:"see-what-ads-look-like",href:"https://support.google.com/google-ads/answer/6275294"})})}),(0,a.createElement)(u.Z,{disabled:!_,multiple:_||t.allowMultiple,countrySelectHelperText:y,formProps:f}),(0,a.createElement)(g.Z,{formProps:f,disabled:v},(0,a.createElement)(m.y,null)),(0,a.createElement)(p.Z,null),(0,a.createElement)(r.Z,null,(0,a.createElement)(c.Z,{isPrimary:!0,disabled:!E,onClick:n},(0,o.__)("Continue","google-listings-and-ads"))))}},6323:function(e,t,n){n.d(t,{A:function(){return X},ZP:function(){return te}});var a=n(9307),o=n(5736),l=n(3108),s=n(4752),r=n(3538),i=n(5602),c=n(2279),d=n(965),u=n(5609),g=n(1693),m=n(8300),p=n(4184),h=n.n(p),_=n(9770),f=n(6989),E=n.n(f),v=n(6483),y=n(6020),b=n(2760),Z=n(5390),C=n(6166);function w(){return"."}function k(e){let{onAssetsLoaded:t}=e;const n=(0,a.useRef)({}),l=(0,a.useRef)(),[s,r]=(0,a.useState)([]),[i,c]=(0,a.useState)(!1),[u,g]=(0,a.useState)(!1),{createNotice:m}=(0,b.Z)(),{finalUrl:p}=s[0]||{};return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Z.Z,{className:"gla-assets-loader",label:(0,a.createElement)(a.Fragment,null,(0,o.__)("Select final URL","google-listings-and-ads"),i&&(0,a.createElement)(y.Spinner,null)),placeholder:(0,o.__)("Search page","google-listings-and-ads"),isSearchable:!0,hideBeforeSearch:!0,excludeSelectedOptions:!1,disabled:u,options:[],selected:s,onSearch:async(e,t)=>{var d;i||c(!0),t!==s[0]?.label&&r([{label:t}]);const u=new Promise((e=>setTimeout(e,300)));if(l.current=u,await u,l.current!==u)return e;const g=n.current,m=t.trim().toLowerCase();return null!==(d=g[m])&&void 0!==d||(g[m]=function(e){const t=`${C.Pj}/assets/final-url/suggestions`,n={search:e};return E()({path:(0,v.addQueryArgs)(t,n)})}(m).then((e=>function(e,t){const n=e.map((e=>({finalUrl:e,key:`${e.type}-${e.id}`,keywords:[e.title],label:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"gla-assets-loader__option-title"},e.title),(0,a.createElement)("div",{className:"gla-assets-loader__option-url"},e.url))})));return""===t&&e.length&&n.unshift({key:"disabled-option-suggestion",label:(0,o.__)("SUGGESTIONS","google-listings-and-ads"),isDisabled:!0}),0===e.length&&n.unshift({key:"disabled-option-no-results",label:(0,o.__)("No matching results","google-listings-and-ads"),keywords:[t],isDisabled:!0}),n}(e,m)))),g[m].finally((()=>{c(!1)})),g[m]},onChange:e=>{let[t]=e;if(t){const e={...t,label:t.finalUrl.title};r([e])}else r([])},getSearchExpression:w}),(0,a.createElement)(d.Z,{isSecondary:!0,text:u?"":(0,o.__)("Select","google-listings-and-ads"),eventName:"gla_import_assets_by_final_url_button_click",eventProps:{type:p?.type},disabled:!p,loading:u,onClick:async()=>{const{finalUrl:e}=s[0];g(!0),function(e,t){const n=`${C.Pj}/assets/suggestions`,a={id:e,type:t};return E()({path:(0,v.addQueryArgs)(n,a)})}(e.id,e.type).then(t).catch((()=>{g(!1),m("error",(0,o.__)("Unable to load assets data from the selected page.","google-listings-and-ads"))}))}}))}function N(e){let{onAssetsChange:t,initialFinalUrl:n,hideFooter:s=!1}=e;const[r,i]=(0,a.useState)(n||null),c=r?(0,a.createElement)(u.ExternalLink,{href:r},r):(0,o.__)("Choose a page that you want people to reach after clicking your ad. This might be your homepage, or a more specific page.","google-listings-and-ads"),m=h()({"gla-final-url-card":!0,"gla-final-url-card--has-selected-url":r});return(0,a.createElement)(_.Z,{className:m,appearance:_.O.FINAL_URL,alignIcon:"top",description:c},(0,a.createElement)(g.Z.Card.Footer,{align:"end",gap:4,hidden:s},r?(0,a.createElement)(d.Z,{isTertiary:!0,text:(0,o.__)("Or, select a different Final URL","google-listings-and-ads"),eventName:"gla_reselect_another_final_url_button_click",onClick:()=>{i(null),t(null)}}):(0,a.createElement)(k,{onAssetsLoaded:e=>{i(e[l.JX.FINAL_URL]),t(e)}})))}var S=n(2),x=n(9814),A=n(2819),R=n(737);function T(e){let{minWidth:t,minHeight:n,suggestedWidth:l,suggestedHeight:s,onSelect:r,onDelete:i,ratioPercentError:c=1}=e;const d=(0,a.useRef)({});return d.current.onSelect=r,d.current.onDelete=i,{openSelector:(0,a.useCallback)((e=>{const{media:a}=wp,r=(0,o.sprintf)(
// translators: 1: Minimum width, 2: Minimum height.
(0,o.__)("Image size needs to be at least %1$d x %2$d","google-listings-and-ads"),t,n),i=a({button:{text:(0,o.__)("Select","google-listings-and-ads"),close:!1},states:[new a.controller.Library({title:(0,o.__)("Select or upload image","google-listings-and-ads"),library:a.query({type:"image"}),date:!1,suggestedWidth:l,suggestedHeight:s}),new a.controller.CustomizeImageCropper({imgSelectOptions:(e,a)=>{const o=[e.get("width"),e.get("height"),t,n],l=function(e,t,n,a){const[o,l]=function(e,t,n,a){const o=n/a;return e/t>o?e=Math.round(t*o):t=Math.round(e/o),[e,t]}(...arguments),s=(e-o)/2,r=(t-l)/2;return{handles:!0,instance:!0,persistent:!0,imageWidth:e,imageHeight:t,minWidth:n,minHeight:a,x1:s,y1:r,x2:s+o,y2:r+l,aspectRatio:`${n}:${a}`}}(...o);if(function(e,t,n,a){const o=e/t,l=n/a;return 100*((o>l?o/l:l/o)-1)}(...o)<c){a.set("canSkipCrop",!0);const e=e=>{a.frame.toolbar.get().get("insert").model.set("disabled",e)};a.cropperView.once("image-loaded",(()=>{e(!0)})),l.onSelectEnd=(t,n)=>{e(n.width===l.imageWidth&&n.height===l.imageHeight)}}return l.onSelectChange=(e,t)=>{Number.isNaN(t.width)&&setTimeout((()=>function(e,t,n){const a=getComputedStyle(n),{style:o}=n,l=new Map;["width","height"].forEach((e=>{const t=parseFloat(a[e]);if(Number.isInteger(t)||!Number.isFinite(t))return;l.set(e,[o.getPropertyValue(e),o.getPropertyPriority(e)]);const n=`${Math.ceil(t)}px`;o.setProperty(e,n)}));const{x1:s,y1:r,x2:i,y2:c}=t;e.imgSelect.setSelection(s,r,i,c),e.imgSelect.update(),l.forEach(((e,t)=>{let[n,a]=e;o.setProperty(t,n,a)}))}(a,l,e)))},l},control:{params:{}}})]});function u(){if(this===i)return void setTimeout(u);const e=i.state().get("selection"),a=i.toolbar.get();let o;if(e.length){const{width:a,height:l}=e.first().toJSON();o=a<t||l<n}const l=a.primary.el;o?(l.dataset.errorMessage=r,l.classList.add("gla-decorated-error-message"),a.get("select").model.set("disabled",!0)):delete l.dataset.errorMessage}i.on("select",(function(){i.setState("cropper")}),i).on("cropped skippedcrop",(function(e){e instanceof a.model.Attachment&&(e=e.toJSON()),d.current.onSelect(e)}),i).on("close",(function(){const e=i.state("library");e.get("library").off(null,null,i),e.get("selection").off(null,null,i),i.off(null,null,i),i.remove()}),i),i.state("library").get("selection").on("selection:single selection:unsingle",u,i),i.state("library").get("library").once("attachments:received",(function(t){if(!e)return;const n=t.get(e);n&&i.state().get("selection").reset([n])}),i).on("reset",u,i).on("destroy",(function(e){d.current.onDelete(e)}),i),i.open()}),[t,n,l,s,c])}}var O=n(4863),P=n(7462),G=n(3115);function I(e){return(0,a.createElement)(d.Z,(0,P.Z)({className:"gla-add-asset-item-button",isLink:!0,icon:(0,a.createElement)(G.Z,null),iconSize:16},e))}function L(e){let{imageConfig:t,initialImageUrls:n=[],maxNumberOfImages:l=-1,reachedMaxNumberTip:s,children:r,onChange:i=A.noop}=e;const c=(0,a.useRef)(),[u,g]=(0,a.useState)(null),[m,p]=(0,a.useState)((()=>n.map((e=>({url:e,id:e,alt:""}))))),h=e=>{p(e),i(e.map((e=>e.url)))};c.current=h;const _=e=>{e.id===u?.id&&g(null),h(m.filter((t=>{let{id:n}=t;return n!==e.id})))};(0,a.useEffect)((()=>{l>-1&&m.length>l&&c.current(m.slice(0,l))}),[m,l]);const f=T({...t,onDelete:_,onSelect(e){const t=[...m];let n=t.findIndex((t=>{let{id:n}=t;return n===e.id}));u&&(-1!==n&&e.id!==u.id&&t.splice(n,1,{...u}),n=t.indexOf(u)),-1===n?t.push(e):t.splice(n,1,e),g(null),h(t)}}),E=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;g(t),f.openSelector(t?.id)};return(0,a.createElement)("div",{className:"gla-images-selector"},(0,a.createElement)("div",{className:"gla-images-selector__image-list"},m.map((e=>(0,a.createElement)("div",{key:e.url,className:"gla-images-selector__image-item"},(0,a.createElement)(d.Z,{className:"gla-images-selector__replace-image-button","aria-label":(0,o.__)("Replace image","google-listings-and-ads"),onClick:()=>E(null,e)},(0,a.createElement)("img",{className:"gla-images-selector__image",alt:e.alt,src:e.url})),(0,a.createElement)(d.Z,{className:"gla-images-selector__remove-image-button","aria-label":(0,o.__)("Remove image","google-listings-and-ads"),icon:(0,a.createElement)(R.Z,null),iconSize:20,onClick:()=>_(e)}))))),r,(()=>{const e=-1!==l&&m.length>=l,t=(0,a.createElement)(I,{disabled:e,text:(0,o.__)("Add image","google-listings-and-ads"),onClick:E});return e&&s?(0,a.createElement)(O.Z,{position:"top center",text:s},t):t})())}var M=n(4006);function F(e){let{initialTexts:t=[],minNumberOfTexts:n=0,maxNumberOfTexts:l=0,maxCharacterCounts:s,addButtonText:r,placeholder:i,children:c,onChange:u=A.noop}=e;const g=(0,a.useRef)(),[m,p]=(0,a.useState)(t),h=e=>{p(e),u(e)};g.current=h,(0,a.useEffect)((()=>{(l>0&&m.length>l||n>0&&m.length<n)&&g.current(function(e,t,n){const a=Math.max(t-e.length,0),o=Array.from({length:a},(()=>"")),l=[0];return n>0&&l.push(n),e.concat(o).slice(...l)}(m,n,l))}),[m,l,n]);const _=(e,t)=>{let{event:n}=t;const{index:a}=n.target.dataset,o=[...m];o[a]=e.trim(),h(o)},f=e=>{const{index:t}=e.currentTarget.dataset,n=[...m];n.splice(t,1),h(n)},E=[s].flat();return(0,a.createElement)("div",{className:"gla-texts-editor"},(0,a.createElement)("div",{className:"gla-texts-editor__text-list"},m.map(((e,t)=>{var l;const s=null!==(l=E[t])&&void 0!==l?l:E[0];return(0,a.createElement)("div",{key:t,className:"gla-texts-editor__text-item"},(0,a.createElement)(S.Z,{className:"gla-texts-editor__text-input",value:e,kindCharacterCount:"google-ads",maxCharacterCount:s,placeholder:i,"data-index":t,onChange:_}),(0,a.createElement)("div",{className:"gla-texts-editor__remove-text-button-anchor"},t+1>n&&(0,a.createElement)(d.Z,{className:"gla-texts-editor__remove-text-button","aria-label":(0,o.__)("Remove text","google-listings-and-ads"),icon:(0,a.createElement)(M.Z,null),iconSize:20,"data-index":t,onClick:f})))}))),c,(0,a.createElement)(I,{hidden:n>0&&n===l,"aria-label":(0,o.__)("Add text","google-listings-and-ads"),disabled:l>0&&m.length>=l,text:r,onClick:()=>{h(m.concat(""))}}))}var D=n(4333),U=n(6015),V=n(3904),q=n(8500),$=(0,a.forwardRef)((function(e,t){let{className:n,heading:l,subheading:s,help:r,numOfIssues:i=0,initialExpanded:c=!1,markOptional:u=!1,disabled:g=!1,children:m}=e;const p=(0,a.useRef)(),[_,f]=(0,a.useState)(c),E=(0,D.useReducedMotion)();(0,a.useImperativeHandle)(t,(()=>({scrollIntoComponent(){p.current.scrollIntoView({behavior:E?"auto":"smooth",inline:"nearest",block:"nearest"})}})));const v=(0,o.sprintf)(
// translators: %d: number of issues in an asset field.
(0,o._n)("%d issue","%d issues",i,"google-listings-and-ads"),i),b=h()("gla-asset-field",n,!!g&&"gla-asset-field--is-disabled"),Z=_&&!g;return(0,a.createElement)("div",{className:b,ref:p},(0,a.createElement)("header",{className:"gla-asset-field__header"},(0,a.createElement)("div",{className:"gla-asset-field__heading-part"},(0,a.createElement)("h2",{className:"gla-asset-field__heading"},l,u&&(0,a.createElement)("span",{className:"gla-asset-field__optional-label"},(0,o._x)("(Optional)","A label behind the heading to indicate a field is optional","google-listings-and-ads")),(0,a.createElement)(q.Z,{className:"gla-asset-field__help-popover",position:"top",iconSize:20,disabled:g},(0,a.createElement)("div",{className:"gla-asset-field__help-popover__content"},r))),s&&(0,a.createElement)("h3",{className:"gla-asset-field__subheading"},s)),i>0&&(0,a.createElement)(y.Pill,{className:"gla-asset-field__issue-pill"},v),(0,a.createElement)("div",{className:"gla-asset-field__toggle-button-anchor"},(0,a.createElement)(d.Z,{className:"gla-asset-field__toggle-button",icon:Z?U.Z:V.Z,"aria-expanded":Z,"aria-label":(0,o.__)("Toggle asset","google-listings-and-ads"),disabled:g,onClick:()=>{f(!_)}}))),(0,a.createElement)("div",{className:"gla-asset-field__content",hidden:!Z},m))})),B=n(2240);const z=[{label:"Automated",value:""},{label:"Learn more",value:"learn_more"},{label:"Get quote",value:"get_quote"},{label:"Apply now",value:"apply_now"},{label:"Sign up",value:"sign_up"},{label:"Contact us",value:"contact_us"},{label:"Subscribe",value:"subscribe"},{label:"Download",value:"download"},{label:"Book now",value:"book_now"},{label:"Shop now",value:"shop_now"}];function j(){const e=(0,a.useRef)(),{values:t,setValue:n,getInputProps:r,adapter:{baseAssetGroup:i,validationRequestCount:c,assetGroupErrors:d}}=(0,s.S)(),g=i[l.GE.FINAL_URL],m=g?new URL(g).hostname:"",p=Boolean(g),h=r(l.GE.CALL_TO_ACTION_SELECTION);function _(e){if(!p||0===c)return 0;const t=d[e];return Array.isArray(t)?t.length:t?1:0}function f(e){return 0===_(e)?null:(0,a.createElement)(x.Z,{messages:d[e]})}function E(t){e.current||0===_(this)||(e.current=t)}e.current=null,(0,a.useEffect)((()=>{c>0&&e.current&&e.current.scrollIntoComponent()}),[c]);const v=(0,a.useRef)(p);p||(v.current=p);const y=v.current?t:i;return(0,a.createElement)("div",{key:g,className:"gla-asset-group-card"},B.vx.map((e=>{const n=y[e.key],o=r(e.key);return(0,a.createElement)($,{key:e.key,ref:E.bind(e.key),heading:e.heading,subheading:e.subheading,help:e.help,numOfIssues:_(e.key),markOptional:0===e.min,disabled:!p,initialExpanded:p},(0,a.createElement)(L,{initialImageUrls:n,maxNumberOfImages:e.getMax(t),reachedMaxNumberTip:e.getMaxNumberTip(t),imageConfig:e.imageConfig,onChange:o.onChange},f(e.key)))})),B.bq.map((e=>{const t=[y[e.key]].flat(),n=r(e.key);return(0,a.createElement)($,{key:e.key,ref:E.bind(e.key),heading:e.heading,subheading:(0,a.createElement)(a.Fragment,null,e.subheading,p&&e.extraSubheading),help:e.help,numOfIssues:_(e.key),disabled:!p,initialExpanded:p},(0,a.createElement)(F,{initialTexts:t,minNumberOfTexts:e.min,maxNumberOfTexts:e.max,maxCharacterCounts:e.maxCharacterCounts,placeholder:e.capitalizedName,addButtonText:e.addButtonText,onChange:t=>{e.requiredSingleValue?n.onChange(t[0]):n.onChange(t)}},f(e.key)))})),(0,a.createElement)($,{className:"gla-asset-field-call-to-action",heading:(0,o.__)("Call to action","google-listings-and-ads"),help:(0,o.__)("Select a call to action that aligns with your goals, or use automated call to action which allows Google to automatically choose the most relevant call to action for you.","google-listings-and-ads"),disabled:!p,initialExpanded:p},(0,a.createElement)(u.SelectControl,{options:z,value:h.value||z[0].value,onChange:h.onChange})),(0,a.createElement)($,{ref:E.bind(l.GE.DISPLAY_URL_PATH),className:"gla-asset-field-display-url-path",heading:(0,o.__)("Display URL Path","google-listings-and-ads"),subheading:m,help:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",null,(0,o.__)("The display URL gives potential customers a clear idea of what webpage they'll reach once they click your ad, so your path text should describe your ad's landing page.","google-listings-and-ads")),(0,a.createElement)("div",null,(0,o.__)('To create your display URL, Google Ads will combine the domain (for example, "www.google.com" in www.google.com/nonprofits) from your final URL and the path text (for example, "nonprofits" in www.google.com/nonprofits).',"google-listings-and-ads"))),numOfIssues:_(l.GE.DISPLAY_URL_PATH),markOptional:!0,disabled:!p,initialExpanded:p},B.Q6.map(((e,o)=>{const s=t[l.GE.DISPLAY_URL_PATH];return(0,a.createElement)(a.Fragment,{key:o},(0,a.createElement)("span",{className:"gla-asset-field-display-url-path__slash"},"/"),(0,a.createElement)(S.Z,{className:"gla-asset-field-display-url-path__text-input",kindCharacterCount:"google-ads",maxCharacterCount:e.maxCharacterCount,value:s[o]||"",onChange:e=>{const t=s.slice();t[o]=e,n(l.GE.DISPLAY_URL_PATH,t)}}))})),f(l.GE.DISPLAY_URL_PATH)))}var H=n(8027);function W(){const{adapter:e}=(0,s.S)(),t=e.hasImportedAssets;return(0,a.createElement)(g.Z,{className:"gla-asset-group-section",title:(0,a.createInterpolateElement)((0,o.__)("Add additional assets <optional>(Optional)</optional>","google-listings-and-ads"),{optional:(0,a.createElement)("span",{className:"gla-asset-group-section__optional-label"})}),description:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",{className:"gla-asset-group-section__primary-description"},(0,o.__)("Upload text and image assets to effectively reach and engage your target shoppers. Google will mix and match your assets, continually testing combinations to create personalized and optimal shopping experiences.","google-listings-and-ads")),(0,a.createElement)("p",null,(0,a.createElement)(H.Z,{context:"asset-group",linkId:"asset-group-learn-more",href:"https://support.google.com/google-ads/answer/10729160"},(0,o.__)("Learn more","google-listings-and-ads"))))},(0,a.createElement)(m.Z,{size:"medium"},(0,a.createElement)(N,{initialFinalUrl:e.baseAssetGroup[l.GE.FINAL_URL],onAssetsChange:e.resetAssetGroup,hideFooter:!e.isEmptyAssetEntityGroup}),t&&(0,a.createElement)(u.Tip,null,(0,o.__)("We auto-populated assets directly from your Final URL. We encourage you to edit or add more in order to best showcase your business.","google-listings-and-ads")),(0,a.createElement)(j,null)))}var Y=n(3832);const Q=[{trackId:"what-will-my-ads-look-like",question:(0,o.__)("What will my ads look like?","google-listings-and-ads"),answer:(0,a.createElement)("div",null,(0,a.createInterpolateElement)((0,o.__)("Google will generate text ads and responsive display ads in various combinations and formats from the headlines, images, and descriptions you add. Your ads will automatically adjust their size, appearance, and format to fit available ad spaces. <link>See common ad formats</link>","google-listings-and-ads"),{link:(0,a.createElement)(H.Z,{context:"assets-faq",linkId:"assets-faq-about-ad-formats-available-in-different-campaign-types",href:"https://support.google.com/google-ads/answer/1722124"})}))},{trackId:"what-makes-these-ads-different-from-product-ads",question:(0,o.__)("What makes these ads different from product ads?","google-listings-and-ads"),answer:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",null,(0,o.__)("Text and image assets can elevate your campaign by offering a variety of ad combinations that capture your audience's attention and generate maximum engagement. By leveraging Google's asset-mixing technology, your ads can be optimized to deliver the right message, to the right people, at the right time.","google-listings-and-ads")),(0,a.createElement)("div",null,(0,o.__)("Compared to product ads—which showcase individual products and are designed to drive direct sales and revenue— ads with creative assets are typically used to highlight your business, generate interest, and attract new customers. While both types of ads can drive conversions, using them together can generate even greater results.","google-listings-and-ads")))}];var K=()=>(0,a.createElement)(g.Z,null,(0,a.createElement)(Y.Z,{context:"campaign-management",faqItems:Q})),J=n(1410);const X="submit-campaign-and-assets",ee="submit-campaign-only";function te(e){let{campaign:t}=e;const n=!t,{isValidForm:u,handleSubmit:g,adapter:m,values:p}=(0,s.S)(),{isValidAssetGroup:h,isSubmitting:_,isSubmitted:f,submitter:E}=m,v=E?.dataset.action;function y(e){const t=p[l.GE.FINAL_URL],a={context:n?"campaign-creation":"campaign-editing",action:e.target.dataset.action,audiences:p.countryCodes.join(","),budget:p.amount.toString(),assets_validation:h?"valid":"invalid"};t||(a.assets_validation="unknown"),Object.values(l.GE).forEach((e=>{const n=`number_of_${e}`,o=[p[e]].flat().filter(Boolean).length;a[n]=t?o.toString():"unknown"})),(0,J.dk)("gla_submit_campaign_button_click",a)}return(0,a.createElement)(r.Z,null,(0,a.createElement)(i.Z,{title:(0,o.__)("Optimize your campaign","google-listings-and-ads"),description:(0,o.__)("Drive greater performance by adding text and image assets to create personalized and engaging ads","google-listings-and-ads")}),(0,a.createElement)(W,null),(0,a.createElement)(K,null),(0,a.createElement)(c.Z,null,(n||m.isEmptyAssetEntityGroup)&&(0,a.createElement)(d.Z,{isTertiary:!0,"data-action":ee,disabled:!u||f||v===X,loading:_&&v===ee,onClick:e=>{g(e),y(e)}},(0,o.__)("Skip this step","google-listings-and-ads")),(0,a.createElement)(d.Z,{isPrimary:!0,"data-action":X,disabled:!m.baseAssetGroup[l.GE.FINAL_URL]||f||v===ee,loading:_&&v===X,onClick:e=>{h?g(e):m.showValidation(),y(e)}},n?(0,o.__)("Launch paid campaign","google-listings-and-ads"):(0,o.__)("Save changes","google-listings-and-ads"))))}},8194:function(e,t,n){n.d(t,{Z:function(){return p}});var a=n(9307),o=n(5736),l=n(5609),s=n(4741),r=n(1693),i=n(7462),c=n(2907),d=n(279),u=n(5351),g=e=>{let{additionalCountryCodes:t,...n}=e,{data:o}=(0,u.Z)();return o?(t&&(o=Array.from(new Set(o.concat(t)))),(0,a.createElement)(c.Z,(0,i.Z)({},n,{countryCodes:o}))):(0,a.createElement)(d.Z,null)};function m(e,t){return e.map((e=>({label:t[e],value:e})))}var p=e=>{const{formProps:{getInputProps:t},multiple:n=!0,disabled:i=!1,countrySelectHelperText:c}=e,d=(0,s.Z)(),u=t("countryCodes"),p=n?(0,a.createElement)(g,{label:(0,o.__)("Select country/s","google-listings-and-ads"),help:c,disabled:i,value:u.value,additionalCountryCodes:i?u.value:void 0,onChange:u.onChange}):(0,a.createElement)(l.SelectControl,{label:(0,o.__)("Select one country","google-listings-and-ads"),help:c,disabled:i,options:m(u.value,d),value:u.selected[0],onChange:u.onChange,role:"combobox"});return(0,a.createElement)(r.Z,{className:"gla-audience-section",disabled:i,title:(0,o.__)("Ads audience","google-listings-and-ads"),description:(0,a.createElement)("p",null,(0,o.__)("Choose where you want your product ads to appear","google-listings-and-ads"))},(0,a.createElement)(r.Z.Card,null,(0,a.createElement)(r.Z.Card.Body,null,p)))}},2674:function(e,t,n){n.d(t,{wD:function(){return w},ZP:function(){return S},aN:function(){return k}});var a=n(9307),o=n(5736),l=n(457),s=n(5609),r=n(4885),i=n(1142),c=n(6755),d=n(279),u=n(3497),g=n(1693),m=n(965),p=n(9862),h=n(6989),_=n.n(h),f=n(2819),E=n(533),v=n(325),y=n(2760),b=n(3108),Z=n(5145),C=n(1410),w=e=>{let{billingUrl:t,onSetupComplete:n}=e;const{googleAdsAccount:l}=(0,u.Z)(),r=(0,p.Z)(C.P);if(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f.noop;const{createNotice:t}=(0,y.Z)(),{receiveGoogleAdsAccountBillingStatus:n}=(0,E.T)(),l=(0,a.useRef)(),s=(0,a.useRef)();s.current=e;const r=(0,a.useCallback)((async()=>{const e=l.current,a=await _()({path:"/wc/gla/ads/billing-status"});if(l.current=a.status,e!==a.status&&a.status===b.GOOGLE_ADS_BILLING_STATUS.APPROVED)try{await _()({path:"/wc/gla/ads/accounts",method:"POST"}),await s.current(),n(a)}catch(e){t("error",(0,o.__)("Unable to complete your Google Ads account setup. Please try again later.","google-listings-and-ads"))}}),[t,n]);(0,v.Z)(r,30)}(n),!l)return(0,a.createElement)(d.Z,null);const i=e=>{const n=r({link_id:"set-up-billing",href:t});if((0,C.dk)("gla_ads_set_up_billing_click",n),"BUTTON"===e.currentTarget.nodeName){const{defaultView:n}=e.target.ownerDocument,a=(0,Z.Z)(n,600,800);n.open(t,"_blank",a)}};return(0,a.createElement)(g.Z.Card,{className:"gla-google-ads-billing-setup-card"},(0,a.createElement)(g.Z.Card.Body,null,(0,a.createElement)("div",{className:"gla-google-ads-billing-setup-card__description"},(0,o.__)("You do not have billing information set up in your Google Ads account. Once you have set up billing, you can start running ads.","google-listings-and-ads"),(0,a.createElement)("div",{className:"gla-google-ads-billing-setup-card__description__helper"},(0,a.createInterpolateElement)((0,o.__)("You will be directed to Google Ads for this step. In case your browser is unable to open the pop-up, <link>click here instead <icon /></link>.","google-listings-and-ads"),{link:(0,a.createElement)("a",{target:"_blank",rel:"external noreferrer noopener",href:t,onClick:i}),icon:(0,a.createElement)(s.Icon,{icon:c.Z,size:12})}))),(0,a.createElement)(m.Z,{isSecondary:!0,onClick:i},(0,o.__)("Set up billing","google-listings-and-ads"))))},k="https://support.google.com/google-ads/answer/2375375";const{APPROVED:N}=b.GOOGLE_ADS_BILLING_STATUS;function S(){const{billingStatus:e,hasFinishedResolution:t}=(0,r.Z)();return t?e.status===N?(0,a.createElement)(s.Flex,{className:"gla-google-ads-billing-card__success-status"},(0,a.createElement)(l.Z,{size:18}),(0,a.createElement)(s.FlexBlock,null,(0,o.__)("Billing method for Google Ads added successfully","google-listings-and-ads"))):(0,a.createElement)(w,{billingUrl:e.billing_url||k}):(0,a.createElement)(i.Z,null)}},1706:function(e,t,n){n.d(t,{Z:function(){return f}});var a=n(7462),o=n(9307),l=n(5736),s=n(1693),r=n(5609),i=n(5683),c=n(4741),d=n(6483),u=n(6166),g=n(3639),m=e=>{const{countryCodes:t,dailyAverageCost:n=1/0}=e,{data:a}=(e=>{const t=`${u.Pj}/ads/campaigns/budget-recommendation`,n={country_codes:e},a=(0,d.addQueryArgs)(t,n);return(0,g.Z)({path:a})})(t),s=(0,c.Z)();if(!a)return null;const{currency:m,recommendations:p}=a,{daily_budget:h,country:_}=function(e){return e.reduce(((e,t)=>t.daily_budget>e.daily_budget?t:e))}(p),f=s[_],E=function(e){const t={strong:(0,o.createElement)("strong",null),em:(0,o.createElement)("em",null),br:(0,o.createElement)("br",null)},n=e?
// translators: it's a range of recommended budget amount. 1: the value of the budget, 2: the currency of amount.
(0,l.__)("Google will optimize your ads to maximize performance across the country/s you select.<br /><em>Tip: Most merchants targeting similar countries <strong>set a daily budget of %1$f %2$s</strong></em>","google-listings-and-ads"):
// translators: it's a range of recommended budget amount. 1: the value of the budget, 2: the currency of amount 3: a country name selected by the merchant.
(0,l.__)("Google will optimize your ads to maximize performance across the country/s you select.<br /><em>Tip: Most merchants targeting <strong>%3$s set a daily budget of %1$f %2$s</strong></em>","google-listings-and-ads");for(var a=arguments.length,s=new Array(a>1?a-1:0),r=1;r<a;r++)s[r-1]=arguments[r];return(0,o.createInterpolateElement)((0,l.sprintf)(n,...s),t)}(p.length>1,h,m,f),v=n<h;return(0,o.createElement)("div",{className:"gla-budget-recommendation"},v&&(0,o.createElement)("div",{className:"gla-budget-recommendation__low-budget"},(0,o.createElement)(i.Z,null),(0,o.createElement)("div",null,(0,l.__)("With a budget lower than your competitor range, your campaign may not get noticeable results.","google-listings-and-ads"))),(0,o.createElement)(r.Tip,null,E))},p=n(3497),h=n(4140);const _={noPointerEvents:!0,readOnly:!0,tabIndex:-1};var f=e=>{let{formProps:t,disabled:n=!1,children:r}=e;const{getInputProps:i,setValue:c,values:d}=t,{countryCodes:u,amount:g}=d,{googleAdsAccount:f}=(0,p.Z)(),E=30.4*g,v=f?.currency,y=(0,o.useRef)();y.current=c;const b=(0,o.useRef)(g);return(0,o.useEffect)((()=>{const e=n?void 0:b.current;y.current("amount",e)}),[n]),(0,o.createElement)("div",{className:"gla-budget-section"},(0,o.createElement)(s.Z,{disabled:n,title:(0,l.__)("Set your budget","google-listings-and-ads"),description:(0,l.__)("With Performance Max campaigns, you can set your own budget and Google’s Smart Bidding technology will serve the most appropriate ad, with the optimal bid, to maximize campaign performance. You only pay when people click on your ads, and you can start or stop your campaign whenever you want.","google-listings-and-ads")},(0,o.createElement)(s.Z.Card,null,(0,o.createElement)(s.Z.Card.Body,{className:"gla-budget-section__card-body"},(0,o.createElement)("div",{className:"gla-budget-section__card-body__cost"},(0,o.createElement)(h.Z,(0,a.Z)({label:(0,l.__)("Daily average cost","google-listings-and-ads"),suffix:v},i("amount"),n&&_)),(0,o.createElement)(h.Z,{disabled:!0,label:(0,l.__)("Monthly max, estimated","google-listings-and-ads"),suffix:v,value:E})),u.length>0&&(0,o.createElement)(m,{countryCodes:u,dailyAverageCost:g}))),r))}},6381:function(e,t,n){n.d(t,{Z:function(){return g}});var a=n(7462),o=n(9307),l=n(3108),s=n(4752),r=n(922),i=n(5736),c=n(6121),d=n(2240);const u={[l.GE.FINAL_URL]:null,[l.GE.BUSINESS_NAME]:"",[l.GE.MARKETING_IMAGE]:[],[l.GE.SQUARE_MARKETING_IMAGE]:[],[l.GE.PORTRAIT_MARKETING_IMAGE]:[],[l.GE.LOGO]:[],[l.GE.HEADLINE]:[],[l.GE.LONG_HEADLINE]:[],[l.GE.DESCRIPTION]:[],[l.GE.CALL_TO_ACTION_SELECTION]:null,[l.GE.DISPLAY_URL_PATH]:[]};function g(e){let{initialCampaign:t,assetEntityGroup:n,...g}=e;const m=(0,o.useMemo)((()=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{assets:t={}}=e,n={...u};return Object.keys(u).forEach((a=>{if(e.hasOwnProperty(a))n[a]=e[a];else if(t.hasOwnProperty(a)){const e=t[a];Array.isArray(e)?n[a]=e.map((e=>{let{content:t}=e;return t})):n[a]=e.content}})),n}(n)),[n]),[p,h]=(0,o.useState)(m),[_,f]=(0,o.useState)(!1);return(0,o.createElement)(s.Z,(0,a.Z)({initialValues:{...t,...m},validate:r.Z,extendAdapter:e=>{const t=function(e){const t={};d.vx.forEach((n=>{e[n.key].length<n.min&&(t[n.key]=(0,i.sprintf)(
// translators: 1: The minimal number of this item. 2: Asset field name.
(0,i._n)("Add at least %1$d %2$s image","Add at least %1$d %2$s images",n.min,"google-listings-and-ads"),n.min,n.lowercaseName))}));const n=(0,c.Z)("google-ads");d.bq.forEach((a=>{const o=[],l=[e[a.key]].flat(),s=l.filter(Boolean);if(a.min>=2&&Array.isArray(a.maxCharacterCounts)){const[e,t]=a.maxCharacterCounts;if(e<t&&""===l[0]){const e=(0,i.sprintf)(
// translators: Asset field name.
(0,i.__)("The %s in the first field is required","google-listings-and-ads"),a.lowercaseSingularName);o.push(e)}}if(s.length<a.min){const e=1===a.min?a.lowercaseSingularName:a.lowercasePluralName,t=a.requiredSingleValue?
// translators: 1: Asset field name.
(0,i.__)("The %1$s is required","google-listings-and-ads"):
// translators: 1: Asset field name. 2: The minimal number of this item.
(0,i.__)("Add at least %2$d %1$s","google-listings-and-ads"),n=(0,i.sprintf)(t,e,a.min);o.push(n)}if(new Set(s).size!==s.length){const e=(0,i.sprintf)(
// translators: Asset field name.
(0,i.__)("%s are identical","google-listings-and-ads"),a.heading);o.push(e)}const r=[a.maxCharacterCounts].flat();l.forEach(((e,t)=>{var l;const s=null!==(l=r[t])&&void 0!==l?l:r[0];if(n(e)>s){const e=a.requiredSingleValue?(0,i.__)("Character limit exceeded","google-listings-and-ads"):
// translators: 1: Asset field name. 2: The sequential number of the asset field.
(0,i.__)("%1$s %2$d: Character limit exceeded","google-listings-and-ads"),n=(0,i.sprintf)(e,a.capitalizedName,t+1);o.push(n)}})),o.length&&(t[a.key]=o)}));const a=e[l.GE.DISPLAY_URL_PATH];if(a.length){const e=[],[o,s]=a;if(!o&&s){const t=(0,i.sprintf)(
// translators: Asset field name.
(0,i.__)("%s is incomplete","google-listings-and-ads"),d.Q6[0].capitalizedName);e.push(t)}d.Q6.forEach(((t,o)=>{const l=a[o]||"";if(n(l)>t.maxCharacterCount){const n=(0,i.sprintf)(
// translators: Asset field name.
(0,i.__)("%s: Character limit exceeded","google-listings-and-ads"),t.capitalizedName);e.push(n)}})),e.length&&(t[l.GE.DISPLAY_URL_PATH]=e)}return t}(e.values),a=n?.[l.JX.FINAL_URL];return{isEmptyAssetEntityGroup:!a,baseAssetGroup:p,assetGroupErrors:t,hasImportedAssets:_,isValidAssetGroup:0===Object.keys(t).length,resetAssetGroup(t){const n=t||m;let a=!1;Object.keys(u).forEach((o=>{t&&t[o]?.length&&(a=!0),e.setValue(o,n[o])})),f(a),h(n),e.adapter.hideValidation()}}}},g))}},4565:function(e,t,n){n.d(t,{y:function(){return z},Z:function(){return V}});var a=n(9307),o=n(5736),l=n(666),s=n(9670),r=n(7844),i=n.n(r),c=n(4617),d=n(7613),u=n(2109),g=n(279),m=n(4184),p=n.n(m);const h={default:!1,thinnest:"gla-ads-mockup__placeholder--thinnest",thinner:"gla-ads-mockup__placeholder--thinner",thicker:"gla-ads-mockup__placeholder--thicker",blue:"gla-ads-mockup__placeholder--blue","gray-100":"gla-ads-mockup__placeholder--gray-100","gray-200":"gla-ads-mockup__placeholder--gray-200","gray-300":"gla-ads-mockup__placeholder--gray-300","gray-400":"gla-ads-mockup__placeholder--gray-400","gray-500":"gla-ads-mockup__placeholder--gray-500"};function _(e){let{width:t,color:n="gray-100",stroke:o="default"}=e;const l=p()("gla-ads-mockup__placeholder",h[n],h[o]);let s;return void 0!==t&&(s={width:/^\d+$/.test(t)?`${t}px`:t}),(0,a.createElement)("div",{className:l,style:s})}const f={default:!1,adBadge:"gla-ads-mockup__scaled-text--ad-badge",smaller:"gla-ads-mockup__scaled-text--smaller",larger:"gla-ads-mockup__scaled-text--larger",blue:"gla-ads-mockup__scaled-text--blue","gray-700":"gla-ads-mockup__scaled-text--gray-700","gray-800":"gla-ads-mockup__scaled-text--gray-800"};function E(e){let{adBadge:t=!1,size:n="default",color:o="gray-700",children:l}=e;const s=p()("gla-ads-mockup__scaled-text",f[o],f[n],t&&f.adBadge);return(0,a.createElement)("div",{className:s,children:l})}function v(e){let{product:t}=e;const n={backgroundImage:`url(${t.coverUrl})`};return(0,a.createElement)("div",{className:"gla-ads-mockup__product-cover",style:n})}var y=n.p+"images/js/src/components/paid-ads/campaign-preview/images/53f7ebba3e0e05545002.google-shopping-logo.svg",b=n(8359),Z=n.p+"images/js/src/components/paid-ads/campaign-preview/images/6ad8e32cee58c14f05a5.youtube-logo.svg",C=n(5609),w=n(2908);function k(e){let{hideMenu:t=!1}=e;return(0,a.createElement)("div",{className:"gla-ads-mockup__search-bar"},(0,a.createElement)(w.Z,{size:13}),(0,a.createElement)("div",{className:"gla-ads-mockup__search-bar-menu",hidden:t},(0,a.createElement)(_,{stroke:"thinnest",color:"gray-400"}),(0,a.createElement)(_,{stroke:"thinnest",color:"gray-400"}),(0,a.createElement)(_,{stroke:"thinnest",color:"gray-400"})))}function N(e){let{product:t}=e;const n={backgroundImage:`url(${t.shopLogoUrl})`};return(0,a.createElement)("div",{className:"gla-ads-mockup__shop-logo",style:n})}var S=n(5314);function x(e){let{product:t}=e;return(0,a.createElement)("div",{className:"gla-ads-mockup__product-banner"},(0,a.createElement)("div",{className:"gla-ads-mockup__product-banner-info"},(0,a.createElement)(E,{size:"smaller",adBadge:!0},t.shopName),(0,a.createElement)(_,{stroke:"thinner",width:"85",color:"gray-300"}),(0,a.createElement)(_,{stroke:"thinner",width:"65",color:"gray-300"}),(0,a.createElement)(_,{stroke:"thinner",width:"27",color:"blue"})),(0,a.createElement)(N,{product:t}))}var A=n.p+"images/js/src/components/paid-ads/campaign-preview/images/ccb636afd5f179a2a92c.gmail-logo.svg";function R(){return(0,a.createElement)("div",{className:"gla-ads-mockup__mail-item"},(0,a.createElement)(_,{stroke:"thinner",color:"gray-200",width:"65"}),(0,a.createElement)(_,{stroke:"thinner",color:"gray-200"}),(0,a.createElement)(_,{stroke:"thinner",width:"122"}))}var T=n(1714),O=n.p+"images/js/src/components/paid-ads/campaign-preview/images/e398c276792a4a469b92.ad-corner-buttons-image.svg",P=n(4315),G=n.p+"images/js/src/components/paid-ads/campaign-preview/images/093d4a30c2447b174c17.map-background.png",I=n.p+"images/js/src/components/paid-ads/campaign-preview/images/8955ab13b4b35353af90.product-sample-image.jpg",L=n.p+"images/js/src/components/paid-ads/campaign-preview/images/26a3f83547ba2af2f541.shop-sample-logo.png",M=n(3108);const F={title:(0,o._x)("White tee","A sample product title for demonstrating the paid ads shown on Google services.","google-listings-and-ads"),price:(0,o._x)("$10.00","A sample product price for demonstrating the paid ads shown on Google services.","google-listings-and-ads"),shopName:(0,o._x)("Colleen's Tee Store","A sample name of an online shop for demonstrating the paid ads shown on Google services.","google-listings-and-ads"),coverUrl:I,shopLogoUrl:L,shopUrl:"colleensteestore.com"},D={page:1,per_page:1,orderby:"total_sales",order:"desc"},U=[function(e){let{product:t}=e;return(0,a.createElement)("div",{className:"gla-ads-mockup"},(0,a.createElement)("div",{className:"gla-ads-mockup__tab-list"},(0,a.createElement)(_,{stroke:"thicker"}),(0,a.createElement)(_,{stroke:"thicker"}),(0,a.createElement)("div",{className:"gla-ads-mockup__tab-item-with-logo"},(0,a.createElement)("img",{height:"30",src:y,alt:(0,o.__)("Google Shopping Logo","google-listings-and-ads")}),(0,a.createElement)(_,{stroke:"thinner",color:"gray-500"})),(0,a.createElement)(_,{stroke:"thicker"})),(0,a.createElement)("div",{className:"gla-ads-mockup__shopping-product"},(0,a.createElement)(v,{product:t}),(0,a.createElement)("div",{className:"gla-ads-mockup__shopping-product-info"},(0,a.createElement)(E,{size:"larger",color:"gray-800"},t.title),(0,a.createElement)(E,{color:"gray-800"},t.price),(0,a.createElement)(E,{size:"smaller"},t.shopName))))},function(e){let{product:t}=e;return(0,a.createElement)("div",{className:"gla-ads-mockup"},(0,a.createElement)("div",{className:"gla-ads-mockup__youtube-header"},(0,a.createElement)("img",{height:"16",src:Z,alt:(0,o.__)("YouTube Logo","google-listings-and-ads")})),(0,a.createElement)("div",{className:"gla-ads-mockup__youtube-product"},(0,a.createElement)(v,{product:t}),(0,a.createElement)("div",{className:"gla-ads-mockup__youtube-learn-more-row"},(0,a.createElement)("div",null,(0,a.createElement)(E,{size:"smaller",color:"blue"},(0,o.__)("LEARN MORE","google-listings-and-ads"))),(0,a.createElement)(b.Z,{size:10})),(0,a.createElement)("div",{className:"gla-ads-mockup__youtube-product-info"},(0,a.createElement)(E,{size:"larger",color:"gray-800"},t.title),(0,a.createElement)(_,null),(0,a.createElement)(_,{width:"135"}),(0,a.createElement)(E,{size:"smaller",adBadge:!0},t.shopName))))},function(e){let{product:t}=e;return(0,a.createElement)("div",{className:"gla-ads-mockup gla-ads-mockup-search"},(0,a.createElement)("div",{className:"gla-ads-mockup__search-header"},(0,a.createElement)("img",{height:"22",src:S,alt:(0,o.__)("Google Logo","google-listings-and-ads")})),(0,a.createElement)(k,{hideMenu:!0}),(0,a.createElement)("div",{className:"gla-ads-mockup__search-keywords"},(0,a.createElement)(_,{width:"30",stroke:"thicker",color:"gray-500"}),(0,a.createElement)(_,{width:"42",stroke:"thicker"}),(0,a.createElement)(_,{width:"32",stroke:"thicker"}),(0,a.createElement)(_,{width:"45",stroke:"thicker"}),(0,a.createElement)(_,{width:"30",stroke:"thinner",color:"gray-500"})),(0,a.createElement)("div",{className:"gla-ads-mockup__search-card"},(0,a.createElement)("div",{className:"gla-ads-mockup__search-card-header"},(0,a.createElement)(E,{size:"smaller",adBadge:!0},t.shopUrl),(0,a.createElement)(_,{stroke:"thinner",width:"79",color:"blue"})),(0,a.createElement)(C.Flex,{align:"stretch"},(0,a.createElement)("div",{className:"gla-ads-mockup__search-card-placeholders"},(0,a.createElement)(_,{width:"100"}),(0,a.createElement)(_,{width:"97"}),(0,a.createElement)(_,{width:"95"}),(0,a.createElement)(_,{width:"99"}),(0,a.createElement)(_,{width:"90"}),(0,a.createElement)(_,{width:"78"})),(0,a.createElement)(N,{product:t}))),(0,a.createElement)("div",{className:"gla-ads-mockup__search-card"},(0,a.createElement)("div",{className:"gla-ads-mockup__search-card-placeholders"},(0,a.createElement)(_,{stroke:"thinner",width:"79",color:"gray-400"}),(0,a.createElement)(_,{stroke:"thinner",color:"gray-300"}),(0,a.createElement)(_,{width:"122"}),(0,a.createElement)(_,{width:"108"}),(0,a.createElement)(_,{width:"100"}),(0,a.createElement)(_,{width:"55"}))),(0,a.createElement)("div",{className:"gla-ads-mockup__search-card"},(0,a.createElement)("div",{className:"gla-ads-mockup__search-card-placeholders"},(0,a.createElement)(_,{stroke:"thinner",width:"79",color:"gray-400"}))))},function(e){let{product:t}=e;return(0,a.createElement)("div",{className:"gla-ads-mockup gla-ads-mockup-map",style:{backgroundImage:`url(${G})`}},(0,a.createElement)(k,null),(0,a.createElement)(P.Z,{size:45}),(0,a.createElement)(x,{product:t}))},function(e){let{product:t}=e;return(0,a.createElement)("div",{className:"gla-ads-mockup gla-ads-mockup-display"},(0,a.createElement)("div",{className:"gla-ads-mockup__display-placeholders"},(0,a.createElement)(_,{stroke:"thinner",color:"gray-300"}),(0,a.createElement)(_,{stroke:"thinner",color:"gray-300",width:"146"}),(0,a.createElement)(_,{stroke:"thinner",color:"gray-300",width:"149"}),(0,a.createElement)(_,{stroke:"thinner",color:"gray-300",width:"135"})),(0,a.createElement)("div",{className:"gla-ads-mockup__display-product"},(0,a.createElement)("div",{className:"gla-ads-mockup__display-product-locator"},(0,a.createElement)(v,{product:t}),(0,a.createElement)("img",{className:"gla-ads-mockup__display-corner-buttons",src:O,alt:(0,o.__)("Simulated the info and close buttons at the corner of a Google ad","google-listings-and-ads")}),(0,a.createElement)("div",{className:"gla-ads-mockup__display-chevron-button"},(0,a.createElement)(T.Z,{size:16}))),(0,a.createElement)(_,{stroke:"thinner",color:"gray-500"})),(0,a.createElement)("div",{className:"gla-ads-mockup__display-placeholders"},(0,a.createElement)(_,null),(0,a.createElement)(_,{width:"151"}),(0,a.createElement)(_,{width:"135"}),(0,a.createElement)(_,null),(0,a.createElement)(_,null),(0,a.createElement)(_,{width:"151"})))},function(e){let{product:t}=e;return(0,a.createElement)("div",{className:"gla-ads-mockup gla-ads-mockup-gmail"},(0,a.createElement)("div",{className:"gla-ads-mockup__gmail-header"},(0,a.createElement)("img",{height:"15",src:A,alt:(0,o.__)("Gmail Logo","google-listings-and-ads")}),(0,a.createElement)(k,{hideMenu:!0})),(0,a.createElement)(x,{product:t}),(0,a.createElement)(R,null),(0,a.createElement)(R,null),(0,a.createElement)(R,null),(0,a.createElement)(R,null),(0,a.createElement)(R,null))}];var V=(0,a.forwardRef)((function(e,t){let{autoplay:n=!0}=e;const[o,r]=(0,a.useState)(0),{second:m,callCount:p,startCountdown:h}=(0,d.Z)(),{hasFinishedResolution:_,data:f}=(0,u.Z)("getMCProductFeed",D),E=n&&_,v=(0,a.useCallback)((e=>{r((t=>(t+e+U.length)%U.length))}),[]);if((0,a.useEffect)((()=>{E&&0===m&&(p>0&&v(1),h(5))}),[E,m,p,h,v]),(0,a.useImperativeHandle)(t,(()=>({moveBy:v}))),!_)return(0,a.createElement)("div",{className:"gla-ads-mockup"},(0,a.createElement)(g.Z,null));const y=U[o],b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=i()((0,c.getSetting)("currency")),[n={}]=e,{title:a,price:o,image_url:l}=n,s={title:a,coverUrl:l,price:t.formatAmount(o),shopName:(0,c.getSetting)("siteTitle"),shopUrl:new URL((0,c.getSetting)("homeUrl")).host,shopLogoUrl:M.glaData.siteLogoUrl};return Object.entries(s).forEach((e=>{let[t,n]=e;n||(s[t]=F[t])})),s}(f?.products);return(0,a.createElement)(l.Z,{className:"gla-campaign-preview"},(0,a.createElement)(s.Z,{key:o,classNames:"gla-campaign-preview__transition-blur",timeout:500},(0,a.createElement)(y,{product:b})))})),q=n(8222),$=n(1693),B=n(965);function z(){const e=(0,a.useRef)(),t=t=>{const n=Number(t.currentTarget.dataset.step);e.current.moveBy(n)};return(0,a.createElement)($.Z.Card,{className:"gla-campaign-preview-card"},(0,a.createElement)($.Z.Card.Body,null,(0,a.createElement)(C.Flex,{align:"start",gap:9},(0,a.createElement)(C.FlexBlock,null,(0,a.createElement)($.Z.Card.Title,null,(0,o.__)("Preview product ad","google-listings-and-ads")),(0,a.createElement)("div",null,(0,o.__)("Each of your product variants will have its own ad. Previews shown here are examples and don't include all possible formats.","google-listings-and-ads"))),(0,a.createElement)(C.FlexItem,null,(0,a.createElement)(C.Flex,{align:"center",gap:5},(0,a.createElement)(B.Z,{className:"gla-campaign-preview-card__moving-button",icon:(0,a.createElement)(q.Z,null),iconSize:16,onClick:t,"data-step":"-1"}),(0,a.createElement)(V,{ref:e,autoplay:!1}),(0,a.createElement)(B.Z,{className:"gla-campaign-preview-card__moving-button",icon:(0,a.createElement)(T.Z,null),iconSize:16,onClick:t,"data-step":"1"}))))))}},621:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(3108);function o(e,t){const[n,o]=t[a.GE.DISPLAY_URL_PATH],l=function(e,t){const n=[],o=e.assets;function l(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),o=1;o<t;o++)a[o-1]=arguments[o];const l=a.map((t=>({...t,content:null,field_type:e})));n.push(...l)}return Object.values(a.am).forEach((e=>{const a=[t[e]].flat().filter(Boolean),s=[o[e]].flat().filter(Boolean);let r=0;a.forEach((t=>{do{const n=s[r];if(t===n?.content)break;n&&l(e,n),r+=1}while(r<s.length);r>=s.length&&n.push({id:null,content:t,field_type:e}),r+=1})),l(e,...s.slice(r))})),n}(e,t);return{final_url:t[a.GE.FINAL_URL],path1:n,path2:o,assets:l}}},4963:function(e,t,n){var a=n(9307),o=n(5736),l=n(1693),s=n(3832);const r=[{trackId:"how-does-google-ads-work",question:(0,o.__)("How does Google Ads work?","google-listings-and-ads"),answer:(0,o.__)("Google Ads works by displaying your ad when people search online for the products and services you offer. By leveraging smart technology, Google Ads helps get your ads in front of potential customers at just the moment they’re ready to take action.","google-listings-and-ads")},{trackId:"what-is-a-product-feed",question:(0,o.__)("What is a product feed?","google-listings-and-ads"),answer:(0,o.__)("Your product feed is the central data source that contains a list of products you want to advertise through Merchant Center. By default, Google syncs all active products from your WooCommerce inventory. You can choose to exclude products later after this setup.","google-listings-and-ads")},{trackId:"how-much-does-google-ads-cost",question:(0,o.__)("How much does Google Ads cost?","google-listings-and-ads"),answer:(0,o.__)("With Google Ads, you decide how much to spend. There’s no minimum spend, and no time commitment. Your costs may vary from day to day, but you won’t be charged more than your daily budget times the number of days in a month. You pay only for the actual clicks and calls that your ad receives.","google-listings-and-ads")},{trackId:"where-will-my-products-appear",question:(0,o.__)("Where will my products appear?","google-listings-and-ads"),answer:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",null,(0,o.__)("If you’re selling in the US, then eligible free listings can appear in search results across Google Search, Google Images, and the Google Shopping tab. If you’re selling outside the US, free listings will appear on the Shopping tab.","google-listings-and-ads")),(0,a.createElement)("div",null,(0,o.__)("If you’re running a Performance Max Campaign, your approved products can appear on Google Search, Google Maps, the Shopping tab, Gmail, Youtube, the Google Display Network, and Discover feed.","google-listings-and-ads")))},{trackId:"how-long-until-i-see-results-with-google-ads",question:(0,o.__)("How long until I see results with Google Ads?","google-listings-and-ads"),answer:(0,o.__)("Google’s Performance Max campaigns are powered by machine learning models. These models train and adapt based on the data you provide in your campaign. This means performance optimization can take time. Typically, this learning process takes 1—2 weeks.","google-listings-and-ads")}];t.Z=()=>(0,a.createElement)(l.Z,null,(0,a.createElement)(s.Z,{trackName:"gla_setup_ads_faq",context:"setup-ads",faqItems:r}))},922:function(e,t,n){var a=n(5736);t.Z=e=>{const t={};return 0===e.countryCodes.length&&(t.countryCodes=(0,a.__)("Please select at least one country for your ads campaign.","google-listings-and-ads")),(!Number.isFinite(e.amount)||e.amount<=0)&&(t.amount=(0,a.__)("Please make sure daily average cost is greater than 0.","google-listings-and-ads")),t}},3976:function(e,t,n){n.d(t,{Z:function(){return u}});var a=n(7462),o=n(9307),l=n(5736),s=n(5609),r=n(4752),i=n(965),c=n(1410);const d=e=>t=>{(0,c.dk)("pre-launch-checklist",{id:e,action:t?"expand":"collapse"})};function u(e){let{fieldName:t,firstPersonTitle:n,secondPersonTitle:c,children:u}=e;const{getInputProps:g,setValue:m,values:p}=(0,r.S)(),h=p[t],_=(0,o.useRef)(h);return h?(0,o.createElement)(s.CheckboxControl,(0,a.Z)({label:_.current?n:c},g(t),{disabled:!0})):(0,o.createElement)("div",{className:"gla-pre-launch-checklist__checkbox"},(0,o.createElement)(s.CheckboxControl,g(t)),(0,o.createElement)(s.Panel,null,(0,o.createElement)(s.PanelBody,{title:c,initialOpen:!1,onToggle:d(t)},(0,o.createElement)(s.PanelRow,null,u,(0,o.createElement)(i.Z,{isPrimary:!0,onClick:()=>m(t,!0)},(0,l.__)("Confirm","google-listings-and-ads"))))))}},1142:function(e,t,n){var a=n(9307),o=n(279),l=n(1693);t.Z=()=>(0,a.createElement)(l.Z.Card,null,(0,a.createElement)(l.Z.Card.Body,null,(0,a.createElement)(o.Z,null)))},2279:function(e,t,n){var a=n(7462),o=n(9307);t.Z=e=>{const{className:t="",...n}=e;return(0,o.createElement)("div",(0,a.Z)({className:`gla-step-content-footer ${t}`},n))}},5602:function(e,t,n){var a=n(9307);t.Z=e=>{const{className:t="",title:n,description:o}=e;return(0,a.createElement)("header",{className:`gla-step-content-header ${t}`},(0,a.createElement)("h1",null,n),(0,a.createElement)("div",{className:"gla-step-content-header__description"},o))}},3538:function(e,t,n){var a=n(7462),o=n(9307);t.Z=e=>{const{className:t="",children:n,...l}=e;return(0,o.createElement)("div",(0,a.Z)({className:`gla-step-content ${t}`},l),(0,o.createElement)("div",{className:"gla-step-content__container"},n))}},6025:function(e,t,n){var a=n(9307),o=n(6020),l=n(8222);t.Z=e=>{let{title:t,backHref:n,helpButton:s,onBackButtonClick:r}=e;return(0,a.createElement)("div",{className:"gla-stepper-top-bar"},(0,a.createElement)(o.Link,{className:"components-button gla-stepper-top-bar__back-button",href:n,type:"wc-admin",onClick:r},(0,a.createElement)(l.Z,null)),(0,a.createElement)("span",{className:"gla-stepper-top-bar__title"},t),s)}},9192:function(e,t,n){var a=n(9307),o=n(3836);t.Z=e=>{let{size:t=18}=e;return(0,a.createElement)(o.Z,{className:"gla-success-icon",size:t})}},2907:function(e,t,n){n.d(t,{Z:function(){return A}});var a=n(7462),o=n(9307),l=n(5736),s=n(4333),r=n(4184),i=n.n(r),c=n(2819),d=n(5904),u=n(6529),g=n(6020),m=n(965),p=e=>{let{tags:t=[],disabled:n,maxVisibleTags:a=0,onChange:s=(()=>{})}=e;const[r,i]=(0,o.useState)(!1),c=Math.max(0,a),d=r||!c?t:t.slice(0,c);if(!t.length)return null;const u=e=>()=>{n||s(t.filter((t=>t.id!==e)))};return(0,o.createElement)("div",{className:"woocommerce-tree-select-control__tags"},d.map(((e,n)=>{if(!e.label)return null;const a=(0,l.sprintf)(
// translators: 1: Tag Label, 2: Current Tag index, 3: Total amount of tags.
(0,l.__)("%1$s (%2$d of %3$d)","woocommerce-admin"),e.label,n+1,t.length);return(0,o.createElement)(g.Tag,{key:e.id,id:e.id,label:e.label,screenReaderLabel:a,remove:u})})),c>0&&t.length>c&&(0,o.createElement)(m.Z,{isTertiary:!0,className:"woocommerce-tree-select-control__show-more",onClick:()=>{i(!r)}},r?(0,l.__)("Show less","google-listing-and-ads"):(0,l.sprintf)(
// translators: %d: The number of extra tags to show
(0,l.__)("+ %d more","google-listing-and-ads"),t.length-c)))};const h="__WC_TREE_SELECT_COMPONENT_ROOT__";var _=(0,o.forwardRef)(((e,t)=>{let{tags:n=[],instanceId:a,placeholder:l,isExpanded:s,disabled:r,maxVisibleTags:d,value:u="",onFocus:g=(()=>{}),onTagsChange:m=(()=>{}),onInputChange:h=(()=>{}),onControlClick:_=c.noop}=e;const f=n.length>0,E=!f&&!s;return(0,o.createElement)("div",{className:i()("components-base-control","woocommerce-tree-select-control__control",{"is-disabled":r,"has-tags":f}),onClick:e=>{t.current.focus(),_(e)}},f&&(0,o.createElement)(p,{disabled:r,tags:n,maxVisibleTags:d,onChange:m}),(0,o.createElement)("div",{className:"components-base-control__field"},(0,o.createElement)("input",{ref:t,id:`woocommerce-tree-select-control-${a}__control-input`,type:"search",placeholder:E?l:"",autoComplete:"off",className:"woocommerce-tree-select-control__control-input",role:"combobox","aria-autocomplete":"list",value:u,"aria-expanded":s,disabled:r,onFocus:g,onChange:h,onKeyDown:e=>{if("Backspace"===e.key){if(u)return;m(n.slice(0,-1)),e.preventDefault()}}})))})),f=n(5609),E=n(1984),v=n(6015),y=n(3904),b=n(8184),Z=e=>{var t,n;let{option:l,checked:s,className:r,...i}=e;return l?(0,o.createElement)("div",{className:r},(0,o.createElement)("div",{className:"components-base-control__field"},(0,o.createElement)("span",{className:"components-checkbox-control__input-container"},(0,o.createElement)("input",(0,a.Z)({id:`inspector-checkbox-control-${null!==(t=l.key)&&void 0!==t?t:l.value}`,className:"components-checkbox-control__input",type:"checkbox",tabIndex:"-1",value:l.value,checked:s},i)),s&&(0,o.createElement)(E.Z,{icon:b.Z,role:"presentation",className:"components-checkbox-control__checked"})),(0,o.createElement)("label",{className:"components-checkbox-control__label",htmlFor:`inspector-checkbox-control-${null!==(n=l.key)&&void 0!==n?n:l.value}`},l.label))):null};const C=e=>{let{options:t=[],onChange:n=(()=>{}),onExpanderClick:a=c.noop,onToggleExpanded:l=c.noop}=e;return t.map((e=>{var t;const s=e.value===h,{hasChildren:r,checked:c,partialChecked:d,expanded:u}=e;return(0,o.createElement)("div",{key:`${null!==(t=e.key)&&void 0!==t?t:e.value}`,role:r?"treegroup":"treeitem","aria-expanded":r?u:void 0,className:i()("woocommerce-tree-select-control__node",r&&"has-children")},(0,o.createElement)(f.Flex,{justify:"flex-start"},!s&&(0,o.createElement)("button",{className:i()("woocommerce-tree-select-control__expander",!r&&"is-hidden"),tabIndex:"-1",onClick:t=>{a(t),l(e)}},(0,o.createElement)(E.Z,{icon:u?v.Z:y.Z})),(0,o.createElement)(Z,{className:i()("components-base-control","woocommerce-tree-select-control__option",d&&"is-partially-checked"),option:e,checked:c,onChange:t=>{n(t.target.checked,e)},onKeyDown:t=>{((e,t)=>{t.hasChildren&&("ArrowRight"!==e.key||t.expanded?"ArrowLeft"===e.key&&t.expanded&&l(t):l(t))})(t,e)}})),r&&u&&(0,o.createElement)("div",{className:i()("woocommerce-tree-select-control__children",s&&"woocommerce-tree-select-control__main")},(0,o.createElement)(C,{options:e.children,onChange:n,onExpanderClick:a,onToggleExpanded:l})))}))};var w=C;const k=e=>{let{id:t,label:n,selectAllLabel:r=(0,l.__)("All","google-listings-and-ads"),help:g,placeholder:m,className:p,disabled:f,options:E=[],value:v=[],maxVisibleTags:y,onChange:b=(()=>{}),onDropdownVisibilityChange:Z=c.noop}=e,C=(0,s.useInstanceId)(k);C=null!=t?t:C;const[N,S]=(0,o.useState)(!1),[x,A]=(0,o.useState)([]),[R,T]=(0,o.useState)(""),O=(0,o.useRef)(),P=(0,o.useRef)(),G=(0,o.useRef)();G.current=Z;const I=(0,o.useRef)({filteredOptionsMap:new Map});I.current.expandedValues=x,I.current.selectedValues=v;const L=!f&&N,M=!1!==r?{label:r,value:h,children:E}:null,F=(0,u.Z)(M?[M]:E),D=(0,s.__experimentalUseFocusOutside)((()=>{S(!1)})),U=R.trim().toLowerCase(),V=U.length>=3?U:"",q=(0,o.useMemo)((()=>{const e={};return I.current.filteredOptionsMap.clear(),F.forEach((function t(n,a){const{children:o=[]}=n;var l;n.parent=a,o.forEach((e=>t(e,n.value))),o.length||(e[null!==(l=n.key)&&void 0!==l?l:n.value]=n)})),e}),[F]),$=(0,o.useMemo)((()=>{const{current:e}=I,t=e.filteredOptionsMap.get(V);if(t)return t;const n=Boolean(V),a={hasChildren:{get(){return this.children?.length>0}},leaves:{get(){return this.hasChildren?this.children.flatMap((e=>e.hasChildren?e.leaves:e)):[]}},checked:{get(){return this.hasChildren?this.leaves.every((e=>e.checked)):e.selectedValues.includes(this.value)}},partialChecked:{get(){return!!this.hasChildren&&!this.checked&&this.leaves.some((e=>e.checked||e.partialChecked))}},expanded:{get(){return n||this.value===h||e.expandedValues.includes(this.value)}}},l=(e,t)=>{let{children:s=[],...r}=t;if(s.length){if(r.children=s.reduce(l,[]),!r.children.length)return e}else if(n){const t=r.label.toLowerCase().indexOf(V);if(-1===t)return e;r.label=((e,t)=>{const a=t+V.length;return n?(0,o.createElement)("span",null,(0,o.createElement)("span",null,e.substring(0,t)),(0,o.createElement)("strong",null,e.substring(t,a)),(0,o.createElement)("span",null,e.substring(a))):e})(r.label,t)}return Object.defineProperties(r,a),e.push(r),e},s=F.reduce(l,[]);return e.filteredOptionsMap.set(V,s),s}),[F,V]);(0,o.useEffect)((()=>{G.current(L)}),[L]);const B=e=>{A(e.expanded?x.filter((t=>e.value!==t)):[...x,e.value])};return(0,o.createElement)("div",(0,a.Z)({},D,{onKeyDown:e=>{if(f)return;"Escape"===e.key&&S(!1),"Enter"===e.key&&(S(!0),e.preventDefault());const t={ArrowUp:-1,ArrowDown:1}[e.key];if(t&&P.current&&$.length){const n=d.focus.focusable.find(P.current).filter((e=>"checkbox"===e.type)),a=n.indexOf(e.target),o=Math.max(a+t,-1)%n.length;n.at(o).focus(),e.preventDefault()}},className:i()("woocommerce-tree-select-control",p)}),!!n&&(0,o.createElement)("label",{htmlFor:`woocommerce-tree-select-control-${C}__control-input`,className:"woocommerce-tree-select-control__label"},n),(0,o.createElement)(_,{ref:O,disabled:f,tags:E.length?v.map((e=>{const t=q[e];return{id:e,label:t?.label}})):[],isExpanded:L,onFocus:()=>{S(!0)},onControlClick:()=>{f||S(!0)},instanceId:C,placeholder:m,label:n,maxVisibleTags:y,value:R,onTagsChange:e=>{b([...e.map((e=>e.id))])},onInputChange:e=>{T(e.target.value)}}),L&&(0,o.createElement)("div",{ref:P,className:"woocommerce-tree-select-control__tree",role:"tree",tabIndex:"-1"},(0,o.createElement)(w,{options:$,onChange:(e,t)=>{t.hasChildren?((e,t)=>{let n;const a=t.leaves.filter((t=>t.checked!==e)).map((e=>e.value));e?(t.expanded||B(t),n=v.concat(a)):n=v.filter((e=>!a.includes(e))),b(n)})(e,t):((e,t)=>{const n=e?[...v,t.value]:v.filter((e=>e!==t.value));b(n)})(e,t),T(""),x.includes(t.parent)||O.current.focus()},onExpanderClick:e=>{const t=d.focus.focusable.find(P.current),n=t.indexOf(e.currentTarget)+1;t.at(n).focus()},onToggleExpanded:B})),g&&(0,o.createElement)("div",{className:"woocommerce-tree-select-control__help"},g))};var N=k,S=n(2109);const x=[];function A(e){let{countryCodes:t,className:n,...r}=e;const c=(0,s.useViewportMatch)("medium","<")?5:10,d=function(e){const{data:{countries:t,continents:n},hasFinishedResolution:a}=(0,S.Z)("getMCCountriesAndContinents");return(0,o.useMemo)((()=>{if(!a)return x;const o=e||Object.keys(t);return Object.entries(n).reduce(((e,n)=>{let[a,l]=n;const s=l.countries.reduce(((e,n)=>(o.includes(n)&&e.push({value:n,label:t[n].name}),e)),[]);return s.length&&e.push({value:a,label:l.name,children:s}),e}),[])}),[e,t,n,a])}(t);return(0,o.createElement)(N,(0,a.Z)({className:i()("gla-supported-country-select",n),placeholder:(0,l.__)("Start typing to filter countries…","google-listings-and-ads"),selectAllLabel:(0,l.__)("All countries","google-listings-and-ads"),maxVisibleTags:c,options:d},r))}},2438:function(e,t,n){var a=n(9307),o=n(8249),l=n(4184),s=n.n(l);t.Z=e=>{let{size:t=18,className:n}=e;return(0,a.createElement)(o.Z,{className:s()("gla-sync-icon",n),size:t})}},5831:function(e,t,n){var a=n(9307),o=n(9054),l=n(6280);t.Z=e=>{const{title:t,button:n}=e;return(0,a.createElement)(l.Z,{className:"gla-title-button-layout"},(0,a.createElement)(o.Z.Title,{className:"title"},t),n)}},3201:function(e,t,n){var a=n(7462),o=n(9307),l=n(6020),s=n(1410);t.Z=e=>{const{eventName:t,eventProps:n,onClick:r=(()=>{}),...i}=e;return(0,o.createElement)(l.Link,(0,a.Z)({},i,{onClick:e=>{t&&(0,s.dk)(t,n),r(e)}}))}},9814:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(9307);function o(e){let{messages:t}=e,n=t;return t?.length?(Array.isArray(t)||(n=[t]),(0,a.createElement)("ul",{className:"gla-validation-errors"},n.map((e=>(0,a.createElement)("li",{key:e},e))))):null}},8300:function(e,t,n){var a=n(7462),o=n(9307),l=n(4184),s=n.n(l);const r={normal:!1,medium:"gla-vertical-gap-layout__medium",large:"gla-vertical-gap-layout__large",overlap:"gla-vertical-gap-layout__overlap"};t.Z=e=>{const{className:t,size:n="normal",...l}=e;return(0,o.createElement)("div",(0,a.Z)({className:s()("gla-vertical-gap-layout",r[n],t)},l))}},8144:function(e,t,n){var a=n(9307),o=n(5683);t.Z=e=>{let{size:t=18}=e;return(0,a.createElement)(o.Z,{className:"gla-warning-icon",size:t})}},5409:function(e,t,n){n.d(t,{Z:function(){return d}});var a=n(7462),o=n(9307),l=n(5736),s=n(4184),r=n.n(s),i=n(2819);const c={allow:"fullscreen",allowtransparency:"true",scrolling:"no",width:"100%",height:"100%",className:"wistia_embed",name:"wistia_embed"};var d=e=>{const{id:t,src:n,title:s,iframeProps:d={}}=e,[u,g]=(0,o.useState)(!1);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.noop;(0,o.useEffect)((()=>{const n=document.createElement("script");return n.src=e,n.async=!0,document.body.appendChild(n),n.onload=()=>{t()},()=>{document.body.removeChild(n)}}),[e,t])}("https://fast.wistia.com/assets/external/E-v1.js",(0,o.useCallback)((()=>{window._wq&&window._wq.push({id:t,onReady:e=>{e.bind("play",(()=>g(!0)))}})}),[t,g])),(0,o.createElement)("div",{className:r()("gla-wistia-video",u?"is-playing":"")},(0,o.createElement)("div",{className:"gla-wistia-video__container"},(0,o.createElement)("iframe",(0,a.Z)({src:n,title:s?(0,l.sprintf)(
// translators: %s: The title of the iframe.
(0,l.__)("%s Video","google-listings-and-ads"),s):(0,l.__)("Wistia Video","google-listings-and-ads")},c,d))))}},6313:function(e,t,n){n.d(t,{Oc:function(){return h},qq:function(){return i},ZP:function(){return _}});var a=n(9307),o=n(5736);function l(e){return"yes"!==e.active?"":"yes"===e.owner?e.email:(0,o.__)("Successfully connected through Jetpack","google-listings-and-ads")}var s=n(9770),r=n(9425),i=e=>{let{jetpack:t}=e;return(0,a.createElement)(s.Z,{appearance:s.O.WPCOM,description:l(t),indicator:(0,a.createElement)(r.Z,null)})},c=n(6483),d=n(3108),u=n(6166),g=n(965),m=n(2760),p=n(4773),h=()=>{const{createNotice:e}=(0,m.Z)(),t=d.glaData.mcSetupComplete?"reconnect":"setup-mc",n={next_page_name:t},l=(0,c.addQueryArgs)(`${u.Pj}/jetpack/connect`,n),[r,{loading:i,data:h}]=(0,p.Z)({path:l});return(0,a.createElement)(s.Z,{appearance:s.O.WPCOM,description:(0,o.__)("Required to connect with Google","google-listings-and-ads"),indicator:(0,a.createElement)(g.Z,{isSecondary:!0,loading:i||h,eventName:"gla_wordpress_account_connect_button_click",eventProps:{context:t},onClick:async()=>{try{const e=await r();window.location.href=e.url}catch(t){e("error",(0,o.__)("Unable to connect your WordPress.com account. Please try again later.","google-listings-and-ads"))}}},(0,o.__)("Connect","google-listings-and-ads"))})},_=e=>{let{jetpack:t}=e;return"yes"===t.active?(0,a.createElement)(i,{jetpack:t}):(0,a.createElement)(h,null)}},4848:function(e,t,n){var a=n(431),o=n(3108),l=n(9497);t.Z=()=>{const e=(0,l.Z)()[o.vt]?o.vt:o.ue;return(0,a.getQuery)()?.issueType||e}},2548:function(e,t,n){var a=n(4617);t.Z=()=>(0,a.getSetting)("adminUrl")},4126:function(e,t,n){var a=n(9818),o=n(533),l=n(3108),s=n(6529);const r="getAdsCampaigns";t.Z=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=(0,s.Z)(t);return(0,a.useSelect)((e=>{const{adsSetupComplete:t}=l.glaData;if(!t)return{loading:!1,loaded:!0,data:[]};const n=e(o.L),a=n[r](...i);return{loading:n.isResolving(r,i),loaded:n.hasFinishedResolution(r,i),data:a}}),[i])}},3745:function(e,t,n){n.d(t,{Z:function(){return i}});var a=n(9307),o=n(7844),l=n.n(o),s=n(4485),r=n(3497);function i(){const e=(0,s.Z)(),{googleAdsAccount:t}=(0,r.Z)(),n=t?.currency||"",o=t?.symbol||"",i=(0,a.useMemo)((()=>({...e,code:n,symbol:o})),[e,n,o]),c=(0,a.useMemo)((()=>l()(i).formatAmount),[i]);return{adsCurrencyConfig:i,formatAmount:c}}},6154:function(e,t,n){n.d(t,{Z:function(){return c}});var a=n(5736),o=n(9307),l=n(6989),s=n.n(l),r=n(533),i=n(2760);function c(){const{createAdsCampaign:e}=(0,r.T)(),{createNotice:t}=(0,i.Z)(),[n,l]=(0,o.useState)(!1),c=(0,o.useCallback)((()=>s()({path:"/wc/gla/ads/setup/complete",method:"POST"}).catch((()=>(t("error",(0,a.__)("Unable to complete your ads setup. Please try again later.","google-listings-and-ads")),Promise.reject())))),[t]);return[(0,o.useCallback)(((t,n,a)=>(l(!0),e(t,n).then(c).then(a).catch((()=>l(!1))))),[e,c]),n]}},4773:function(e,t,n){var a=n(9307),o=n(6989),l=n.n(o),s=n(6529);const r="START",i="FINISH",c="ERROR",d="RESET",u={loading:!1,error:void 0,data:void 0,response:void 0,options:void 0},g=(e,t)=>{switch(t.type){case r:return{...e,loading:!0,options:t.options};case i:return{...e,loading:!1,data:t.data,response:t.response,options:t.options};case c:return{...e,loading:!1,error:t.error,response:t.response,options:t.options};case d:return t.state}},m=e=>{const{parse:t=!0}=e;return t};t.Z=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;const n=(0,s.Z)(e),o={...u,...t},[p,h]=(0,a.useReducer)(g,o);return[(0,a.useCallback)((async e=>{const t={...n,...e};h({type:r,options:t});try{const e=await l()({...t,parse:!1}),n=e.clone(),a=n.json&&await n.json();return h({type:i,data:a,response:e,options:t}),m(t)?a:e}catch(e){if("fetch_error"===e.code)throw h({type:c,error:e,response:void 0,options:t}),e;const n=e;let a;try{const e=n.clone();a=e.json?await e.json():new Error("No content body in fetch response.")}catch(e){a=new Error("Error parsing response.")}throw h({type:c,error:a,response:n,options:t}),m(t)?a:n}}),[n]),{...p,reset:e=>{h({type:d,state:{...o,...e}})}}]}},3639:function(e,t,n){var a=n(9307),o=n(4773),l=n(6529);t.Z=e=>{const t=(0,l.Z)(e),[n,s]=(0,o.Z)(t,{loading:!0});return(0,a.useEffect)((()=>{t&&n()}),[n,t]),s}},2109:function(e,t,n){var a=n(9818),o=n(9307),l=n(6166),s=n(533),r=n(6529);t.Z=function(e){const{invalidateResolution:t}=(0,s.T)();for(var n=arguments.length,i=new Array(n>1?n-1:0),c=1;c<n;c++)i[c-1]=arguments[c];const d=(0,r.Z)(i),u=(0,o.useCallback)((()=>{t(e,d)}),[t,e,d]);return(0,a.useSelect)((t=>{const{isResolving:n,hasFinishedResolution:a}=t(l.Ls),o=t(l.Ls)[e](...d);return{isResolving:n(e,d),hasFinishedResolution:a(e,d),data:o,invalidateResolution:u}}),[u,e,d])}},1653:function(e,t,n){var a=n(5736),o=n(2109),l=n(3108);const s=(0,a._x)(", ","the separator for concatenating the categories where the Attribute mapping rule is applied.","google-listings-and-ads"),r=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(c)},i=e=>e.slice(0,l.E).map((e=>e.label)).join(s),c=e=>({key:e.id,label:e.name,value:e.id});t.Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const{data:t,hasFinishedResolution:n}=(0,o.Z)("getStoreCategories");if(!n)return{hasFinishedResolution:n,categories:[],selected:[],names:""};const l=e.filter((e=>!t.find((t=>t.id.toString()===e)))).map((e=>{return{id:e,name:(t=e,(0,a.sprintf)(
// translators: %d: number of categories.
(0,a.__)("Category ID %s (deleted)","google-listings-and-ads"),[t])),parent:0};var t})),s=[...t,...l],d=((e,t)=>e.map((e=>{const n=t.find((t=>t.id.toString()===e));return c(n)})))(e,s);return{hasFinishedResolution:n,selected:d,categories:r(s),names:i(d)}}},7613:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(9307);function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"single";const t=(0,a.useRef)({}),[n,o]=(0,a.useState)(0);t.current.usingHandle=e,t.current[e]=t.current[e]||{callCount:0};const l=(0,a.useCallback)((n=>{o(n);const a=t.current[e],l=(new Date).getTime()+1e3*n;a.id&&clearInterval(a.id),a.updateSecond=()=>{let n=(l-(new Date).getTime())/1e3;n=Math.max(Math.round(n),0),t.current.usingHandle===e&&o(n),0===n&&clearInterval(a.id)},a.id=setInterval(a.updateSecond,1e3),a.callCount+=1}),[e]);(0,a.useEffect)((()=>{const{updateSecond:n}=t.current[e];n&&n()}),[e]),(0,a.useEffect)((()=>{const e=t.current;return()=>{Object.values(e).forEach((e=>clearInterval(e.id)))}}),[]);const{callCount:s}=t.current[e];return{second:n,callCount:s,startCountdown:l}}},4741:function(e,t,n){var a=n(2629),o=n(4617);t.Z=()=>{const e={...(0,o.getSetting)("countries")};return Object.keys(e).forEach((t=>{e[t]=(0,a.decodeEntities)(e[t])})),e}},2164:function(e,t,n){var a=n(9307),o=n(1595),l=n(4485);t.Z=e=>{const t=(0,l.Z)();return(0,a.useMemo)((()=>{const n={...t,...e};return e=>(0,o.numberFormat)(n,e)}),[t,e])}},2760:function(e,t,n){var a=n(9818);t.Z=()=>(0,a.useDispatch)("core/notices")},9862:function(e,t,n){n.d(t,{Z:function(){return r}});var a=n(9307),o=n(2819),l=n(6529),s=n(1410);function r(e,t){const n=(0,l.Z)((0,o.pick)(t,s.Im.get(e))),[,r]=(0,a.useReducer)((e=>e+1),0);return(0,a.useEffect)((()=>{const t=`${s.A7}/${(0,o.uniqueId)()}`;return Object.keys(n).length&&s.PT.addFilter(e,t,(e=>({...e,...n}))),r(),()=>{s.PT.removeFilter(e,t)}}),[e,n]),(0,a.useCallback)((t=>s.PT.applyFilters(e,t)),[e])}},4282:function(e,t,n){var a=n(1921),o=n(3497);t.Z=()=>{const{googleAdsAccount:e}=(0,o.Z)();return e&&e.sub_account&&(0,a.getDateDifferenceInDays)(new Date,new Date(1e3*e.created_timestamp))<60}},1969:function(e,t,n){var a=n(9818),o=n(3108),l=n(6166),s=n(2807),r=n(5004);t.Z=()=>{const{jetpack:e,isResolving:t,hasFinishedResolution:n}=(0,r.Z)();return(0,a.useSelect)((a=>{if(!e||"no"===e.active)return{google:void 0,scope:(0,s.Z)(o.glaData.adsSetupComplete),isResolving:t,hasFinishedResolution:n};const{getGoogleAccount:r,isResolving:i,hasFinishedResolution:c}=a(l.Ls),d=r();return{google:d,scope:(0,s.Z)(o.glaData.adsSetupComplete,d?.scope),isResolving:i("getGoogleAccount"),hasFinishedResolution:c("getGoogleAccount")}}),[e,t,n])}},3497:function(e,t,n){var a=n(9818),o=n(9307),l=n(6166),s=n(533),r=n(3108),i=n(1969);const c="getGoogleAdsAccount";t.Z=()=>{const{google:e,isResolving:t,hasFinishedResolution:n}=(0,i.Z)(),d=(0,s.T)(),u=(0,o.useCallback)((()=>{d.invalidateResolution(c,[])}),[d]);return(0,a.useSelect)((a=>{if(!e||"no"===e.active)return{googleAdsAccount:void 0,isResolving:t,hasFinishedResolution:n};const o=a(l.Ls),s=o[c](),i=o.isResolving(c),d=[r.GOOGLE_ADS_ACCOUNT_STATUS.CONNECTED,r.GOOGLE_ADS_ACCOUNT_STATUS.INCOMPLETE].includes(s?.status);return{googleAdsAccount:s,isResolving:i,refetchGoogleAdsAccount:u,hasFinishedResolution:o.hasFinishedResolution(c),hasGoogleAdsConnection:d}}),[e,t,n,u])}},4885:function(e,t,n){var a=n(9818),o=n(6166);const l="getGoogleAdsAccountBillingStatus";t.Z=()=>(0,a.useSelect)((e=>{const t=e(o.Ls);return{billingStatus:t[l](),hasFinishedResolution:t.hasFinishedResolution(l,[])}}),[])},363:function(e,t,n){var a=n(9818),o=n(6166);const l="getGoogleAdsAccountStatus";t.Z=()=>(0,a.useSelect)((e=>{const t=e(o.Ls),{hasAccess:n,inviteLink:a,step:s}=t[l]();return{hasAccess:n,inviteLink:a,step:s,hasFinishedResolution:t.hasFinishedResolution(l)}}),[])},1166:function(e,t,n){n.d(t,{Z:function(){return r}});var a=n(9307),o=n(6483),l=n(6166),s=n(4773);function r(e,t){const n=(0,a.useMemo)((()=>{const n={next_page_name:e,login_hint:t};return{path:(0,o.addQueryArgs)(`${l.Pj}/google/connect`,n)}}),[e,t]);return(0,s.Z)(n)}},6883:function(e,t,n){var a=n(9818),o=n(6166),l=n(1969);t.Z=()=>{const{google:e,scope:t,isResolving:n,hasFinishedResolution:s}=(0,l.Z)();return(0,a.useSelect)((a=>{if(!e||"no"===e.active||!t.gmcRequired)return{googleMCAccount:void 0,isResolving:n,hasFinishedResolution:s,isPreconditionReady:!1};const{getGoogleMCAccount:l,isResolving:r,hasFinishedResolution:i}=a(o.Ls);return{googleMCAccount:l(),isResolving:r("getGoogleMCAccount"),hasFinishedResolution:i("getGoogleMCAccount"),isPreconditionReady:!0}}),[e,t.gmcRequired,n,s])}},2500:function(e,t,n){n.d(t,{Z:function(){return r}});var a=n(9818),o=n(2319),l=n(6166);const s={country:"",countryCallingCode:"",nationalNumber:"",isValid:!1,isVerified:!1,display:""};function r(){return(0,a.useSelect)((e=>{const{getGoogleMCPhoneNumber:t}=e(l.Ls),{data:n,loaded:a}=t();let r=s;if(n){const e=(0,o._)(n.phone_number||"");e&&(r={...e,isValid:e.isValid(),isVerified:"verified"===n.phone_verification_status,display:e.formatInternational()},delete r.metadata)}return{loaded:a,data:r}}),[])}},6529:function(e,t,n){var a=n(2819),o=n(9307);t.Z=e=>{const t=(0,o.useRef)(e);return(0,a.isEqual)(t.current,e)||(t.current=e),t.current}},9160:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(9307);function o(){const e=(0,a.useRef)(!1);return(0,a.useEffect)((()=>(e.current=!0,()=>{e.current=!1})),[]),(0,a.useCallback)((()=>e.current),[])}},5004:function(e,t,n){var a=n(9818),o=n(6166);t.Z=()=>(0,a.useSelect)((e=>({jetpack:e(o.Ls).getJetpackAccount(),isResolving:e(o.Ls).isResolving("getJetpackAccount"),hasFinishedResolution:e(o.Ls).hasFinishedResolution("getJetpackAccount")})),[])},9959:function(e,t,n){n.d(t,{Z:function(){return l}});var a=n(9307);const o={"full-page":["woocommerce-admin-full-screen","is-wp-toolbar-disabled","gla-full-page"],"full-content":["gla-full-content"]};function l(e){(0,a.useEffect)((()=>{if(!o.hasOwnProperty(e))return;const t=document.body.classList,n=o[e].filter((e=>!t.contains(e)));return t.add(...n),()=>{t.remove(...n)}}),[e])}},3816:function(e,t,n){n.d(t,{Z:function(){return s}});var a=n(9307),o=n(7018);const l={match:{url:"/google/dashboard"},wpOpenMenu:"toplevel_page_woocommerce-marketing"};function s(){const e=(0,o.Z)();return(0,a.useEffect)((()=>{e||window.wpNavMenuClassChange(l,l.match.url)}),[e])}},70:function(e,t,n){var a=n(2109);t.Z=()=>{const e=(0,a.Z)("getMCCountriesAndContinents");return{...e,data:e.data.countries}}},9497:function(e,t,n){var a=n(3108),o=n(9685);const l=e=>{const t=Object.values(e).reduce(((e,t)=>e+t),0);return Number.isInteger(t)?t:void 0};t.Z=()=>{const e={[a.vt]:(0,o.Z)(a.vt)?.data?.total,[a.ue]:(0,o.Z)(a.ue)?.data?.total};return{...e,total:l(e)}}},9685:function(e,t,n){var a=n(3108),o=n(2109);const l={page:1,per_page:a.bc};t.Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.vt,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.page,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.per_page;return(0,o.Z)("getMCIssues",{page:t,issue_type:e,per_page:n})}},7995:function(e,t,n){var a=n(9307),o=n(2109),l=n(7613),s=n(4773),r=n(533);t.Z=()=>{const{second:e,callCount:t,startCountdown:n}=(0,l.Z)(),{invalidateResolutionForStoreSelector:i}=(0,r.T)(),{data:c,hasFinishedResolution:d,invalidateResolution:u,...g}=(0,o.Z)("getMCProductStatistics"),m=!(!d||!c?.loading),p=!(!d||!c?.statistics),[h]=(0,s.Z)({path:"/wc/gla/mc/product-statistics/refresh",method:"GET"}),_=(0,a.useCallback)((async()=>{await h(),u()}),[h,u]);return(0,a.useEffect)((()=>{m&&0===e&&(n(15),t>0&&u()),p&&t>0&&(n(0),i("getMCProductFeed"))}),[e,t,m,p,u,i,n]),{data:c,invalidateResolution:u,hasFinishedResolution:d,refreshStats:_,...g}}},4766:function(e,t,n){var a=n(2109);t.Z=()=>(0,a.Z)("getMCSetup")},724:function(e,t,n){var a=n(2109);t.Z=()=>(0,a.Z)("getMappingAttributes")},3922:function(e,t,n){var a=n(2109);t.Z=e=>(0,a.Z)("getMappingSources",e)},796:function(e,t,n){var a=n(2109);t.Z=e=>{let{page:t=1,perPage:n=10}=e;return(0,a.Z)("getMappingRules",{page:t,perPage:n})}},5248:function(e,t,n){n.d(t,{Z:function(){return r}});var a=n(9307),o=n(431),l=n(2819);const s=()=>!0;function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;const{key:r}=(0,o.getHistory)().location;(0,a.useEffect)((()=>{let a=l.noop;return t&&(a=(0,o.getHistory)().block((t=>{const{location:o,retry:l}=t;let s=!0;n(function(e){return{...e,pathname:e.pathname.replace(/^(\/wp-admin)?\//,"")}}(o))&&(s=window.confirm(e)),s&&(a(),l())}))),()=>{a()}}),[r,e,t,n])}},5873:function(e,t,n){var a=n(9307);t.Z=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const[o,l]=(0,a.useState)({}),s=(0,a.useCallback)((t=>{l((n=>({...n,[e]:t})))}),[e]);return{page:null!==(t=o[e])&&void 0!==t?t:n,setPage:s}}},5635:function(e,t,n){var a=n(2109);t.Z=()=>(0,a.Z)("getPolicyCheck")},7543:function(e,t,n){n.d(t,{Z:function(){return s}});var a=n(9307),o=n(4773),l=n(7613);function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{second:s,callCount:r,startCountdown:i}=(0,l.Z)(),[c,{data:d}]=(0,o.Z)(e),u=!d||!n,g=(0,a.useCallback)((()=>{const e=c();return e.finally((()=>i(t))),e}),[c,i,t]);return(0,a.useEffect)((()=>{0===s&&r>0&&u&&g()}),[s,r,g,u]),{start:g,data:d}}},2848:function(e,t,n){n.d(t,{Z:function(){return c}});var a=n(9307),o=n(533),l=n(3071),s=n(2819),r=(e,t)=>void 0!==e.id&&e.id===t.id||e.country===t.country,i=n(5170),c=()=>{const{data:e}=(0,i.Z)(),{deleteShippingRates:t,upsertShippingRates:n}=(0,o.T)();return{saveShippingRates:(0,a.useCallback)((async a=>{const o=((e,t)=>((e,t)=>(0,s.differenceWith)(t,e,r))(e,t).map((e=>e.id)))(a,e);o.length&&await t(o);const i=(0,l.Z)(a,e);i.length&&await n(i)}),[t,e,n])}}},5494:function(e,t,n){n.d(t,{Z:function(){return r}});var a=n(9307),o=n(533),l=n(1067),s=n(2819),r=()=>{const{data:e}=(0,l.Z)(),{deleteShippingTimes:t,upsertShippingTimes:n}=(0,o.T)();return{saveShippingTimes:(0,a.useCallback)((async a=>{const o=((e,t)=>((e,t)=>(0,s.differenceBy)(t,e,"countryCode"))(e,t).map((e=>e.countryCode)))(a,e);o.length&&await t(o);const l=(r=a,i=e,(0,s.differenceWith)(r,i,s.isEqual));var r,i;if(l.length){const e=(e=>{const t=new Map;return e.forEach((e=>{let{countryCode:n,time:a}=e;const o=t.get(a)||{countryCodes:[],time:a};o.countryCodes.push(n),t.set(a,o)})),Array.from(t.values())})(l).map((e=>n(e)));await Promise.all(e)}}),[t,e,n])}}},5170:function(e,t,n){var a=n(2109);t.Z=()=>(0,a.Z)("getShippingRates")},1067:function(e,t,n){var a=n(2109);t.Z=()=>(0,a.Z)("getShippingTimes")},2159:function(e,t,n){n.d(t,{Z:function(){return s}});var a=n(2109),o=n(4741);const l={address:"",address2:"",city:"",state:"",country:"",postcode:"",isMCAddressDifferent:null,isAddressFilled:null,missingRequiredFields:[]};function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"wc";const{data:t,hasFinishedResolution:n,invalidateResolution:s}=(0,a.Z)("getGoogleMCContactInformation"),r=(0,o.Z)();let i=l;if(n&&t){const{is_mc_address_different:n,wc_address_errors:a}=t,o="wc"===e?t.wc_address:t.mc_address,l=o?.street_address||"",s=o?.locality||"",c=o?.region||"",d=o?.postal_code||"",[u,g=""]=l.split("\n"),m=r[o?.country]||"";i={countryCode:o?.country||"",address:u,address2:g,city:s,state:c,country:m,postcode:d,isAddressFilled:!a.length,isMCAddressDifferent:n,missingRequiredFields:a}}return{refetch:s,loaded:n,data:i}}},6553:function(e,t,n){n.d(t,{Z:function(){return s}});var a=n(9818),o=n(7221),l=n(4617);function s(){return(0,a.useSelect)((e=>{const t=e(o.OPTIONS_STORE_NAME),n="getOption",a=["woocommerce_default_country"],s=t[n](...a);let r=null,i=null;if(t.hasFinishedResolution(n,a)){const e=(0,l.getSetting)("countries");[r]=s.split(":"),i=e[r]}return{code:r,name:i}}),[])}},4485:function(e,t,n){var a=n(9307),o=n(1595),l=n(4617);t.Z=()=>{const e=(0,l.getSetting)("currency");return(0,a.useMemo)((()=>({...e,formatNumber:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.precision;const a={...e,precision:n};return(0,o.numberFormat)(a,t)}})),[e])}},921:function(e,t,n){var a=n(2109);t.Z=()=>(0,a.Z)("getTargetAudience")},5351:function(e,t,n){var a=n(9818),o=n(533),l=n(70);t.Z=()=>{const{data:e,isResolving:t}=(0,l.Z)();return(0,a.useSelect)((function(n){const{getTargetAudience:a,isResolving:l}=n(o.L),s=a(),r=l("getTargetAudience")||t,i=e&&Object.keys(e);function c(e){return"all"===e?.location?i:e?.countries}return{loading:r,data:c(s),targetAudience:s,getFinalCountries:c}}),[e,t])}},9136:function(e,t,n){var a=n(9307),o=n(533),l=n(2109);t.Z=e=>{const t=(0,l.Z)("getTour",e),{upsertTour:n}=(0,o.T)(),s=t.data?.checked;return{tourChecked:!t.hasFinishedResolution||Boolean(s),setTourChecked:(0,a.useCallback)((t=>{t!==s&&n({id:e,checked:t},!0)}),[e,s,n])}}},5125:function(e,t,n){n.d(t,{Z:function(){return l}});var a=n(431),o=n(6529);function l(){const e=(0,a.getQuery)();return(0,o.Z)(e)}},325:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(9307),o=(e,t)=>{const n=(()=>{const[e,t]=(0,a.useState)(document.hasFocus());return(0,a.useEffect)((()=>{const e=()=>{t(!0)},n=()=>{t(!1)};return window.addEventListener("focus",e),window.addEventListener("blur",n),()=>{window.removeEventListener("focus",e),window.removeEventListener("blur",n)}}),[]),e})();(0,a.useEffect)((()=>{if(!n)return;e();const a=setInterval(e,1e3*t);return()=>clearInterval(a)}),[e,t,n])}},8931:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(5736);async function o(e,t){const n=(await Promise.allSettled(e)).reduce(((e,n,a)=>("rejected"===n.status&&t[a]&&e.push(t[a]),e)),[]);return function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.length){const n=(0,a._x)(", ","the separator for concatenating the messages of failed actions","google-listings-and-ads"),o=(0,a.sprintf)(
// translators: 1: optional string when there are multiple failed actions, and it's a concatenated text of failed actions except for the last one. 2: the last one or the only failed action.
(0,a._n)("There is an error in the following action: %1$s%2$s.","There are errors in the following actions: %1$s and %2$s.",e.length,"google-listings-and-ads"),e.slice(0,-1).join(n),e.at(-1)),l=t?
// translators: text for the failed action(s).
(0,a.__)("%s Other changes have been saved. Please try again later.","google-listings-and-ads"):
// translators: text for the failed action(s).
(0,a.__)("%s Please try again later.","google-listings-and-ads");return(0,a.sprintf)(l,o)}return null}(n,n.length<e.length)}},8299:function(e,t,n){var a=n(3108);const o=a.glaData.dateFormat+(a.glaData.dateFormat.trim()&&a.glaData.timeFormat.trim()?", ":"")+a.glaData.timeFormat;t.Z=o},3071:function(e,t,n){var a=n(2819);const o=(e,t)=>{const n=["country","currency","rate","options.free_shipping_threshold"];return(0,a.isEqual)((0,a.at)(e,n),(0,a.at)(t,n))};t.Z=(e,t)=>(0,a.differenceWith)(e,t,o)},2249:function(e,t,n){function a(e){return Object.entries(e).reduce(((e,t)=>{let[n,a]=t;return"not_synced"===n?e:e+a}),0)}n.d(t,{Z:function(){return a}})},1333:function(e,t,n){var a=n(431);t.Z=()=>{const e=(0,a.getQuery)();return"products"===e?.reportKey?"products":"programs"}},5145:function(e,t){t.Z=(e,t,n)=>{const{innerWidth:a,innerHeight:o,screenX:l,screenY:s,screen:r}=e,i=Math.min(t,r.availWidth),c=Math.min(n,r.availHeight);return`popup=1,left=${(a-i)/2+l},top=${(o-c)/2+s},width=${i},height=${c}`}},1416:function(e,t){t.Z=()=>!!window.wcTracks?.isEnabled},9900:function(e,t){const n="undefined"!=typeof window&&"localStorage"in window,a={get(e){return n?window.localStorage.getItem(e):null},set(e,t){return n?window.localStorage.setItem(e,t):null},remove(e){return n?window.localStorage.removeItem(e):null}};t.Z=a},585:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(5736);function o(e){
// translators: %s: user's account ID
return(0,a.sprintf)((0,a.__)("Account %s","google-listings-and-ads"),e)}},2807:function(e,t,n){n.d(t,{Z:function(){return o}});const a={CONTENT:"https://www.googleapis.com/auth/content",SITE_VERIFICATION_VERIFY_ONLY:"https://www.googleapis.com/auth/siteverification.verify_only",AD_WORDS:"https://www.googleapis.com/auth/adwords"};function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n={adsRequired:t.includes(a.AD_WORDS)};return n.gmcRequired=t.includes(a.CONTENT)&&t.includes(a.SITE_VERIFICATION_VERIFY_ONLY),n.glaRequired=e?n.gmcRequired&&n.adsRequired:n.gmcRequired,n}},3036:function(e,t,n){n.d(t,{Z:function(){return d}});var a=n(7462),o=n(9307),l=n(5609),s=n(4184),r=n.n(s),i=n(9054);const c=e=>{let{size:t="",...n}=e;return(0,o.createElement)(l.Card,(0,a.Z)({},n,{size:t}))};c.Body=e=>{const{className:t,...n}=e;return(0,o.createElement)(l.CardBody,(0,a.Z)({className:r()("wcdl-section-card-body",t)},n))},c.Footer=e=>{const{children:t,...n}=e;return(0,o.createElement)(l.CardFooter,(0,a.Z)({className:"wcdl-section-card-footer"},n),t)},c.Title=e=>{const{className:t,...n}=e;return(0,o.createElement)(i.Z.Title,(0,a.Z)({className:r()("wcdl-section-card-title",t)},n))};var d=c},1693:function(e,t,n){var a=n(9307),o=n(4184),l=n.n(o),s=n(3036);const r=e=>{let{className:t,title:n,description:o,topContent:s,children:r,disabled:i,disabledLeft:c}=e;const d=l()("wcdl-section",!!i&&"wcdl-section--is-disabled",!!c&&"wcdl-section--is-disabled-left",t);return(0,a.createElement)("section",{className:d},(0,a.createElement)("header",{className:"wcdl-section__header"},s&&(0,a.createElement)("p",null,s),n&&(0,a.createElement)("h1",null,n),o),(0,a.createElement)("div",{className:"wcdl-section__body"},r))};r.Card=s.Z,t.Z=r},5390:function(e,t,n){var a=n(7462),o=n(9307),l=n(6020),s=n(4184),r=n.n(s);t.Z=e=>{const{label:t,helperText:n,className:s,...i}=e;return(0,o.createElement)("div",{className:r()("wcdl-select-control",s)},t&&(0,o.createElement)("div",{className:"wcdl-select-control__label"},t),(0,o.createElement)("div",{className:"wcdl-select-control__input"},(0,o.createElement)(l.SelectControl,(0,a.Z)({},i,{help:""}))),n&&(0,o.createElement)("div",{className:"wcdl-select-control__helper-text"},n))}},9054:function(e,t,n){n.d(t,{Z:function(){return i}});var a=n(7462),o=n(9307),l=n(4184),s=n.n(l);const r=e=>{const{className:t="",...n}=e;return(0,o.createElement)("div",(0,a.Z)({className:`wcdl-subsection ${t}`},n))};r.Title=e=>{const{className:t,...n}=e;return(0,o.createElement)("div",(0,a.Z)({className:s()("wcdl-subsection-title",t)},n))},r.Subtitle=e=>{const{className:t,...n}=e;return(0,o.createElement)("div",(0,a.Z)({className:s()("wcdl-subsection-subtitle",t)},n))},r.Body=e=>{const{children:t}=e;return(0,o.createElement)("div",{className:"wcdl-subsection-body"},t)},r.HelperText=e=>{const{className:t,children:n}=e;return(0,o.createElement)("div",{className:s()("wcdl-subsection-helper-text",t)},n)};var i=r},5314:function(e,t,n){e.exports=n.p+"images/js/src/images/64742f6405be8486218c.google-logo.svg"}}]);