import{_ as e,y as s}from"./main-tangy-colts-beg.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,t){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,t),t)}};const r=n=>({componentName:n.componentName.connection,connectionsTypes:[{encryptKeys:["username","password"],label:e("Basic Auth"),type:"basic_auth",verifyConnection:{headers:{Authorization:"","Content-Type":"application/json"},method:"GET",responseKeyMatch:[],url:""}}],extraComponents:[{className:"my-3",componentName:n.componentName.note,id:"note",label:e("Note"),note:[e("## Generating API Client Key and Secret"),e("To use the API, you need to generate a **Client Key** and **Client Secret** key pair."),e("### Steps to Create the Key Pair:"),e("1. Navigate to the **Newsletter** > **API Addon Management** panel."),e("2. Click the **‘Create Key’** button to generate your keys.")],render:!0}],extraData:{},fieldType:"config",id:"connection-id",label:e("Select Connection"),onConnectionAddChange:"CONNECTION_ADD_CHANGE",onConnectionChange:"SET_CONNECTION",render:!0,value:void 0}),l=({$:n,e:t})=>{n.setThisComponent(a=>{n.util.isConnectionComponent(a)&&a.connectionsTypes.forEach(o=>{var i;o.type==="basic_auth"&&((i=o.verifyConnection)!=null&&i.headers)&&(o.verifyConnection.url=`${s.WP_API_URL.base}newsletter/v2/newsletters`,o.verifyConnection.headers.Authorization="Basic "+btoa(`${t.username}:${t.password}`))})})},C=[{label:e("Email Address"),value:"email"},{label:e("First Name"),value:"first_name"},{label:e("Last Name"),value:"last_name"},{label:e("Country"),value:"country"},{label:e("Region"),value:"region"},{label:e("City"),value:"city"}];export{r as c,l as h,C as s};
