import{_ as a}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 s=n=>({$:t,e})=>{t.setThisComponent(o=>{o.value=e}),t.setDb(o=>{o[n]=e})},c=n=>({addConnectionHelpingText:a('To get access token and business ID information, please visit <a target="_blank" class="text-blue-600 underline" rel="noopener noreferrer nofollow" href="https://developers.facebook.com/docs/whatsapp/business-management-api/get-started">WhatsApp Business API</a>'),componentName:n.componentName.connection,connectionsTypes:[{encryptKeys:["token"],label:a("WhatsApp Business API"),type:"bearer_token",verifyConnection:{headers:{Authorization:""},method:"GET",responseKeyMatch:["id","name"],url:""}}],extraComponents:[{componentName:n.componentName.input,id:"business-id",label:a("Business ID"),onChange:"HANDLE_BUSINESS_ID",render:!0,required:!0,value:void 0,wrapperClassName:"mb-2"},{componentName:n.componentName.input,fieldType:"config",id:"phone-number-id",label:a("Phone Number ID "),onChange:"SET_PHONE_NUMBER_ID",path:"phoneNumberId",render:!0,required:!0,value:void 0,wrapperClassName:"mb-2"}],extraData:{},fieldType:"config",id:"connection-id",label:a("Select Connection"),onConnectionAddChange:"CONNECTION_ADD_CHANGE",onConnectionChange:"SET_CONNECTION",render:!0,value:void 0}),u=({$:n,e:t})=>{n.setThisComponent(e=>{n.util.isConnectionComponent(e)&&e.connectionsTypes.forEach(o=>{var i;o.type==="bearer_token"&&((i=o.verifyConnection)!=null&&i.headers)&&t.token&&(o.verifyConnection.headers.Authorization="Bearer "+t.token)})})},h=({$:n,e:t})=>{n.setThisComponent(e=>{e.value=t.target.value}),n.setDb(e=>{e.businessId=t.target.value}),n.setComponent("connection-id",e=>{var o;n.util.isConnectionComponent(e)&&((o=e.connectionsTypes[0])!=null&&o.verifyConnection&&(e.connectionsTypes[0].verifyConnection.url=`https://graph.facebook.com/v19.0/${t.target.value}`),e.extraData||(e.extraData={}),e.extraData.businessId=t.target.value)})},p=({$:n,e:t})=>{n.setThisComponent(e=>{e.value=t.target.value}),n.setDb(e=>{e.phoneNumberId=t.target.value}),n.setComponent("connection-id",e=>{n.util.isConnectionComponent(e)&&(e.extraData||(e.extraData={}),e.extraData.phoneNumberId=t.target.value)})},l=n=>({componentName:n.componentName.mixInput,helperText:a("Enter the recipient phone number in international format with country code, without using ' + '. Ex: 919822012345. you must preregister the receiver's phone number in Meta's developer console."),id:"recipient-phone-number",label:a("Recipient Phone Number"),onChange:"SET_RECIPIENT_NUMBER",path:"to",render:"IF_CONNECTION_SELECTED",required:!0,value:[]});export{p as a,h as b,u as c,c as d,s as h,l as r};
