芝麻web文件管理V1.00
编辑当前文件:/home/ezdajrnh/public_html/wp-content/plugins/google-listings-and-ads/js/build/settings.js
"use strict";(globalThis.webpackChunkgoogle_listings_and_ads=globalThis.webpackChunkgoogle_listings_and_ads||[]).push([[472],{521:(e,n,o)=>{o.d(n,{A:()=>d});var s=o(7143),t=o(6520),a=o(7692),i=o(2775);const c="products",l={products:[],intervals:[],totals:{}};function d(e){const n=(0,i.A)();return(0,s.useSelect)(o=>{const{getReport:s}=o(t.Ui),i=s(c,e,n,"primary"),d=s(c,e,n,"secondary"),r=i.loaded&&d.loaded;let g=l;return r&&i.data&&d.data&&(g={products:i.data.products||l.products,intervals:i.data.intervals||l.intervals,totals:(0,a.bM)(i.data.totals,d.data.totals,i.reportQuery.fields)}),{data:g,loaded:r}},[e,n])}},2379:(e,n,o)=>{o.r(n),o.d(n,{default:()=>je});var s=o(6087),t=o(6476),a=o(3905),i=o(14),c=o(8e3),l=o(1016),d=o(3666),r=o(3354),g=o(7723),u=o(8242),h=o(3741),x=o(6960),m=o(8864),_=o(8683),A=o(1177),j=o(850),p=o(4848);const y=({handleSubmit:e})=>{const{getInputProps:n,adapter:{isSubmitting:o}}=(0,x.h5)(),{onChange:t,...a}=n("tax_rate"),i=n=>{t(n),e()};return(0,p.jsx)(u.A,{title:(0,g.__)("Tax rate (required for U.S. only)","google-listings-and-ads"),description:(0,p.jsxs)("div",{children:[(0,p.jsx)("p",{children:(0,g.__)("This tax rate will be shown to potential customers, together with the cost of your product.","google-listings-and-ads")}),(0,p.jsx)("p",{children:(0,p.jsx)(A.A,{context:"setup-mc-tax-rate",linkId:"tax-rate-read-more",href:"https://support.google.com/merchants/answer/160162",children:(0,g.__)("Read more","google-listings-and-ads")})})]}),children:(0,p.jsx)(u.A.Card,{children:(0,p.jsx)(u.A.Card.Body,{children:(0,p.jsxs)(j.A,{size:"large",children:[(0,p.jsx)(_.A,{...a,label:(0,g.__)("My store uses destination-based tax rates.","google-listings-and-ads"),value:"destination",collapsible:!0,disabled:o,onChange:i,children:(0,p.jsx)(m.A,{children:(0,g.__)("Google’s estimated tax rates will automatically be applied to my product listings.","google-listings-and-ads")})}),(0,p.jsx)(_.A,{...a,label:(0,g.__)("My store does not use destination-based tax rates.","google-listings-and-ads"),value:"manual",collapsible:!0,disabled:o,onChange:i,children:(0,p.jsx)(m.A,{children:(0,s.createInterpolateElement)((0,g.__)("I’ll set my tax rates up manually in
Google Merchant Center. I understand that if I don’t set this up, my products will be disapproved.","google-listings-and-ads"),{link:(0,p.jsx)(A.A,{context:"setup-mc-tax-rate",linkId:"tax-rate-manual",href:"https://www.google.com/retail/solutions/merchant-center/"})})})})]})})})})};var f=o(873),C=o(7337);var v=o(5847),b=o(5640),G=o(6876);const w=new Set(["destination","manual"]);function S(){const{settings:e,saveSettings:n,syncSettings:o}=(0,f.A)(),{data:s}=(0,v.A)(),t=((e=null)=>{const{code:n}=(0,C.A)();return"US"===n||!(!e||!e.includes("US"))||(!n||null===e)&&null})(s),{createNotice:a}=(0,b.A)();return t&&e?.hasOwnProperty("tax_rate")?(0,p.jsx)(x.Ay,{initialValues:{tax_rate:e.tax_rate},validate:e=>{const n={};return w.has(e.tax_rate)||(n.tax_rate=(0,g.__)("Please specify tax rate option.","google-listings-and-ads")),n},onSubmit:async s=>{const t={...e,tax_rate:s.tax_rate};return n(t).then(o,e=>{(0,G.h)(e,(0,g.__)("There was an error saving tax rate.","google-listings-and-ads"))}).catch(e=>{(0,G.h)(e,(0,g.__)("There was an error synchronizing tax rate to Google Merchant Center.","google-listings-and-ads"))}).then(()=>{a("success",(0,g.__)("Your change to tax rate has been saved and will be synced to your Google Merchant Center.","google-listings-and-ads"))})},children:e=>(0,p.jsx)(y,{handleSubmit:e.handleSubmit})}):!1===t?null:(0,p.jsx)(u.A,{children:(0,p.jsx)(h.A,{})})}var k=o(6427),E=o(1968),D=o(7401),I=o(7916),T=o(1378),N=o(7892),F=o(6028),M=o(4790),P=o(8678),R=o(458),W=o(7807);function q(e){return(0,p.jsx)(u.A,{title:(0,g.__)("Linked accounts","google-listings-and-ads"),description:(0,g.__)("A WordPress.com account, Google account, Google Merchant Center account, and Google Ads account are required to use this extension in WooCommerce.","google-listings-and-ads"),...e})}var B=o(9457),O=o(7792),z=o(2434);const L="all-accounts",H="ads-account",K={[L]:{title:(0,g.__)("Disconnect all accounts","google-listings-and-ads"),confirmButton:(0,g.__)("Disconnect all accounts","google-listings-and-ads"),confirmation:(0,g.__)("Yes, I want to disconnect all my accounts.","google-listings-and-ads"),contents:[(0,g.__)("I understand that I am disconnecting any WordPress.com account, Google account, Google Merchant Center account and Google Ads account connected to this extension.","google-listings-and-ads"),(0,g.__)("Any active product listings will continue to show on Google. They can be managed, edited, or deleted manually from Google Merchant Center (merchants.google.com).","google-listings-and-ads"),(0,g.__)("Any ongoing campaigns will continue to run. They can be managed, edited, or deleted manually from Google Ads (ads.google.com).","google-listings-and-ads")]},[H]:{title:(0,g.__)("Disconnect Google Ads account","google-listings-and-ads"),confirmButton:(0,g.__)("Disconnect Google Ads Account","google-listings-and-ads"),confirmation:(0,g.__)("Yes, I want to disconnect my Google Ads account.","google-listings-and-ads"),contents:[(0,g.__)("I understand that I am disconnecting my Google Ads account from this WooCommerce extension.","google-listings-and-ads"),(0,g.__)("Any ongoing campaigns will continue to run. They can be managed, edited, or deleted manually from Google Ads (ads.google.com).","google-listings-and-ads"),(0,g.__)("Some configurations for Google Ads created through WooCommerce may be lost. This cannot be undone.","google-listings-and-ads")]}};function U({disconnectTarget:e,onRequestClose:n,onDisconnected:o,disconnectAction:t}){const[a,i]=(0,s.useState)(!1),[c,l]=(0,s.useState)(!1),d=(0,z.j)(),{title:r,confirmButton:u,confirmation:h,contents:x}=K[e],m=()=>{c||n()};return(0,p.jsxs)(B.A,{className:"gla-disconnect-accounts-modal",title:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(O.A,{size:20}),r]}),isDismissible:!c,buttons:[(0,p.jsx)(N.A,{isSecondary:!0,disabled:c,onClick:m,children:(0,g.__)("Never mind","google-listings-and-ads")},"1"),(0,p.jsx)(N.A,{isPrimary:!0,isDestructive:!0,loading:c,disabled:!a,onClick:()=>{let s=e===L?d.disconnectAllAccounts:d.disconnectGoogleAdsAccount;t&&(s=t),l(!0),s().then(()=>{o(),n()}).catch(()=>{l(!1)})},children:u},"2")],onRequestClose:m,children:[x.map((e,n)=>(0,p.jsx)("p",{children:e},n)),(0,p.jsx)(k.CheckboxControl,{label:h,checked:a,disabled:c,onChange:i})]})}function Y(e){return(0,p.jsx)(U,{...e})}var $=o(6473);const{CONNECTED:Q,INCOMPLETE:J}=a.Wn;function V(){const e=(0,E.A)(),{jetpack:n}=(0,D.A)(),{google:o}=(0,c.A)(),{googleMCAccount:t}=(0,I.A)(),{googleAdsAccount:a}=(0,T.A)(),i=!(n&&o&&t&&a),l=[Q,J].includes(a?.status),[r,h]=(0,s.useState)(null);return(0,p.jsxs)(q,{children:[r&&(0,p.jsx)(Y,{onRequestClose:()=>h(null),onDisconnected:()=>{(0,$.Ff)("gla_disconnected_accounts",{context:r});const n=r===L?e+(0,d.XG)():window.location.href;window.location.href=n},disconnectTarget:r}),i?(0,p.jsx)(F.A,{}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(M.LJ,{jetpack:n}),(0,p.jsx)(P.Az,{googleAccount:o,hideAccountSwitch:!0}),(0,p.jsx)(W.D,{googleMCAccount:t}),l&&(0,p.jsx)(R.Ez,{googleAdsAccount:a,hideAccountSwitch:!0,children:(0,p.jsx)(u.A.Card.Footer,{children:(0,p.jsx)(N.A,{isDestructive:!0,isLink:!0,onClick:()=>h(H),children:(0,g.__)("Disconnect Google Ads account only","google-listings-and-ads")})})}),(0,p.jsx)(k.Flex,{justify:"flex-end",children:(0,p.jsx)(N.A,{isPrimary:!0,isDestructive:!0,onClick:()=>h(L),children:(0,g.__)("Disconnect from all accounts","google-listings-and-ads")})})]})]})}var X=o(7677),Z=o(1903),ee=o(559);function ne(){const{jetpack:e}=(0,D.A)(),n="yes"===e?.active;return(0,s.useEffect)(()=>{n&&(0,t.getHistory)().replace((0,d.FN)())},[n]),e?(0,p.jsxs)(q,{children:[(0,p.jsx)(ee.A,{className:"gla-wpcom-connection-lost-card",isBorderless:!0,size:"small",icon:(0,p.jsx)(X.A,{icon:Z.A,size:24}),title:(0,g.__)("Your WordPress.com account has been disconnected.","google-listings-and-ads"),helper:(0,g.__)("Connect your WordPress.com account to ensure your products stay listed on Google. If you do not re-connect, your products can’t be automatically synced to Google, and any existing listings may be removed from Google.","google-listings-and-ads")}),(0,p.jsx)(M.s9,{})]}):(0,p.jsx)(h.A,{})}var oe=o(7400),se=o(9415);function te({email:e}){const n=(0,E.A)(),[o,a]=(0,s.useState)(null),{disconnectGoogleAccount:i}=(0,z.j)(),[c,l]=(0,s.useState)(!1);return(0,p.jsxs)(ee.A,{appearance:ee.x.GOOGLE,description:e,children:[(0,p.jsx)(k.CardDivider,{}),(0,p.jsx)(u.A.Card.Body,{children:(0,p.jsxs)(k.Notice,{status:"error",isDismissible:!1,children:[(0,p.jsx)("p",{children:(0,s.createInterpolateElement)((0,g.__)("This Google account,
, was not the Google account previously connected to this integration.","google-listings-and-ads"),{accountEmail:(0,p.jsx)("strong",{children:e})})}),(0,p.jsx)("p",{children:(0,g.__)("Thus, it doesn‘t have access to the Google Merchant Center and/or Google Ads account currently connected to this WooCommerce store.","google-listings-and-ads")}),(0,p.jsx)("p",{children:(0,g.__)("Try connecting with a different Google account, or completely disconnect all your connected accounts.","google-listings-and-ads")})]})}),(0,p.jsxs)(u.A.Card.Footer,{justify:"flex-end",children:[o&&(0,p.jsx)(Y,{onRequestClose:()=>a(null),onDisconnected:()=>{const e=(0,t.getNewPath)(null,"/google/start",null);window.location.href=n+e},disconnectTarget:o}),(0,p.jsx)(N.A,{isSecondary:!0,isDestructive:!0,disabled:c,onClick:()=>a(L),children:(0,g.__)("Disconnect all accounts","google-listings-and-ads")}),(0,p.jsx)(N.A,{isPrimary:!0,loading:c,onClick:()=>{l(!0),i().catch(()=>{l(!1)})},children:(0,g.__)("Try another Google account","google-listings-and-ads")})]})]})}function ae(){const{data:e}=(0,se.A)("getGoogleAccountAccess"),n=(0,oe.A)(a.Th.adsSetupComplete,e?.scope),o="yes"===e?.active,i=o?"no"===e?.merchant_access||"no"===e?.ads_access:void 0,c=o&&!i&&n.reconnectionRequired;if((0,s.useEffect)(()=>{c&&(0,t.getHistory)().replace((0,d.uZ)())},[c]),!e)return(0,p.jsx)(h.A,{});if(!c){const n=i?(0,p.jsx)(te,{email:e.email}):(0,p.jsx)(P.Ay,{});return(0,p.jsx)(u.A,{title:(0,g.__)("Connect account","google-listings-and-ads"),children:n})}return null}var ie=o(6474),ce=o(5595),le=o(7539),de=o(2455);const re=()=>{(0,ie.A)("full-content");const{updateGoogleMCContactInformation:e}=(0,z.j)(),{data:n}=(0,ce.A)(),[o,a]=(0,s.useState)(!1),i=n.isAddressFilled&&n.isMCAddressDifferent;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(le.A,{title:(0,g.__)("Edit store address","google-listings-and-ads"),helpButton:(0,p.jsx)(de.A,{eventContext:"edit-store-address"}),backHref:(0,d.FN)()}),(0,p.jsxs)("div",{className:"gla-settings",children:[(0,p.jsx)(u.A,{title:(0,g.__)("Store address","google-listings-and-ads"),description:(0,p.jsxs)("div",{children:[(0,p.jsx)("p",{children:(0,g.__)("Your store address is required by Google for verification purposes. It will be shared with the Google Merchant Center and will not be displayed to customers.","google-listings-and-ads")}),(0,p.jsx)("p",{children:(0,p.jsx)(A.A,{context:"settings-store-address",linkId:"contact-information-read-more",href:"https://woocommerce.com/document/google-for-woocommerce/get-started/requirements/#contact-information",children:(0,g.__)("Learn more","google-listings-and-ads")})})]}),children:(0,p.jsx)(r.S,{})}),(0,p.jsx)(u.A,{children:(0,p.jsx)(k.Flex,{justify:"flex-end",children:(0,p.jsx)(N.A,{isPrimary:!0,loading:o,disabled:!i,eventName:"gla_contact_information_save_button_click",onClick:()=>{a(!0),e().then(()=>(0,t.getHistory)().push((0,d.FN)())).catch(()=>a(!1))},children:(0,g.__)("Save details","google-listings-and-ads")})})})]})]})};var ge=o(9927),ue=o(5246),he=o(7143);const xe="getEnableEnhancedConversions",me=()=>{const{hasGoogleAdsConnection:e,hasFinishedResolution:n}=(0,T.A)(),{isEnabled:o,hasFinishedResolution:t}=(()=>{const{hasGoogleAdsConnection:e,hasFinishedResolution:n}=(0,T.A)();return(0,he.useSelect)(o=>{if(!n||!e)return{isEnabled:!1,hasFinishedResolution:n};const s=o(z.U);return{isEnabled:s[xe](),hasFinishedResolution:s.hasFinishedResolution(xe,[])}},[e,n])})(),[a,i]=(0,s.useState)(!1),{createNotice:c}=(0,b.A)(),{updateEnhancedConversionsStatus:l}=(0,z.j)(),d=(0,s.useCallback)(async()=>{await l(!o)},[l,o]);let r=(0,g.__)("Please make sure to follow the documentation to enable Enhanced Conversions. The feature needs to be enabled both here on WooCommerce and on your Google Ads account.","google-listings-and-ads");e||(r=(0,g.__)("Please connect your Google Ads account in order to use Enhanced Conversions data.","google-listings-and-ads"));const h=n&&t,x=!e||a;return(0,p.jsxs)(u.A,{title:(0,g.__)("Improve conversion accuracy","google-listings-and-ads"),description:(0,p.jsxs)("div",{children:[(0,p.jsx)("p",{children:(0,g.__)("Enhanced Conversions is a feature designed to improve your measurement accuracy by collecting privacy-conscious data without the need for third-party cookies.","google-listings-and-ads")}),(0,p.jsx)("p",{children:(0,p.jsx)(A.A,{href:"https://support.google.com/google-ads/answer/9888656",context:"setup-enhanced-conversions",linkId:"enhanced-conversions-read-more",children:(0,g.__)("Read more","google-listings-and-ads")})})]}),children:[!h&&(0,p.jsx)(F.A,{}),h&&(0,p.jsx)(u.A.Card,{children:(0,p.jsx)(u.A.Card.Body,{children:(0,p.jsx)(k.CheckboxControl,{label:(0,g.__)("Send Enhanced Conversions data to Google Ads","google-listings-and-ads"),checked:o,disabled:x,onChange:async()=>{try{i(!0),await d(),c("success",(0,g.__)("Enhanced Conversions status updated successfully.","google-listings-and-ads"))}catch(e){}finally{i(!1)}},help:r})})})]})};var _e=o(2635);const Ae="gla-settings",je=()=>{const{subpath:e}=(0,t.getQuery)();(0,i.A)(),(0,l.A)();const{google:n}=(0,c.A)(),o=e===d.$K.reconnectGoogleAccount;switch((0,s.useEffect)(()=>{o||"no"!==n?.active||(0,t.getHistory)().replace((0,d.Ke)(a.iH.GOOGLE_DISCONNECTED))},[o,n]),e){case d.$K.reconnectWPComAccount:return(0,p.jsx)("div",{className:Ae,children:(0,p.jsx)(ne,{})});case d.$K.reconnectGoogleAccount:return(0,p.jsx)(ae,{});case d.$K.editStoreAddress:return(0,p.jsx)(re,{})}return(0,p.jsxs)("div",{className:Ae,children:[(0,p.jsx)(_e.A,{}),(0,p.jsx)(ge.A,{}),(0,p.jsx)(ue.A,{}),(0,p.jsx)(me,{}),(0,p.jsx)(r.h,{}),(0,p.jsx)(S,{}),(0,p.jsx)(V,{})]})}}}]);