(()=>{"use strict";var e={36299(){},10790(e){e.exports=window.ReactJSXRuntime},1455(e){e.exports=window.wp.apiFetch},86087(e){e.exports=window.wp.element},52619(e){e.exports=window.wp.hooks},27723(e){e.exports=window.wp.i18n}},t={};function i(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n=i(1455),a=i.n(n),o=i(86087),r=i(52619),s=i(27723),c=(i(36299),i(10790));const __=s.__,d=({isConnected:e})=>{const[t,i]=(0,o.useState)([{id:"none",name:__("None","jetpack")}]),[n,r]=(0,o.useState)("none"),[s,d]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{e&&(d(!0),a()({path:"/wpcom/v2/mailchimp/settings",method:"GET"}).then(e=>{e.audiences&&(i([{id:"none",name:__("None","jetpack")},...e.audiences]),e.follower_list_id&&e.audiences.find(({id:t})=>t===e.follower_list_id)&&r(e.follower_list_id),d(!1))}))},[e]),e?(0,c.jsx)("div",{className:"jetpack-mailchimp-settings",children:(0,c.jsxs)("label",{htmlFor:"jetpack-mailchimp-audience",children:[__("Audience that your visitors can subscribe to:","jetpack"),(0,c.jsx)("select",{id:"jetpack-mailchimp-audience",name:"jetpack-mailchimp-audience",onChange:e=>r(e.target.value),value:n,disabled:s,children:t.map(e=>(0,c.jsx)("option",{value:e.id,children:e.name},e.id))})]})}):null};(0,r.addFilter)("jetpack.externalConnections.extraSettings","jetpack/mailchimp/admin",(e,t)=>"mailchimp"!==t?e:d)})();