import{aR as n}from"./main-tangy-colts-beg.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,o){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,o),o)}};const i=()=>n("pro_buddyboss/get-group-types"),a=()=>n("pro_buddyboss/get-all-groups"),l=()=>n("pro_buddyboss/get-all-profile-types"),r=()=>n("pro_buddyboss/get-all-forums"),u=()=>n("pro_buddyboss/get-extended-profile-fields");globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,o){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,o),o)}};const f=async e=>{e.setComponent("group",t=>{t.loading=!0});const{data:o,status:s}=await a();if(s==="error"){e.setComponent("group",t=>{e.util.isSelectComponent(t)&&(t.status=s,t.loading=!1,t.invalidMessage=JSON.stringify(o))});return}e.setComponent("group",t=>{e.util.isSelectComponent(t)&&(t.options=o,t.loading=!1)})},d=async e=>{e.setComponent("profile-type",t=>{t.loading=!0});const{data:o,status:s}=await l();if(s==="error"){e.setComponent("profile-type",t=>{e.util.isSelectComponent(t)&&(t.status=s,t.loading=!1,t.invalidMessage=JSON.stringify(o))});return}e.setComponent("profile-type",t=>{e.util.isSelectComponent(t)&&(t.options=o,t.loading=!1)})},g=async e=>{e.setComponent("forum-id",t=>{t.loading=!0});const{data:o,status:s}=await r();if(s==="error"){e.setComponent("forum-id",t=>{e.util.isSelectComponent(t)&&(t.status=s,t.loading=!1,t.invalidMessage=JSON.stringify(o))});return}e.setComponent("forum-id",t=>{e.util.isSelectComponent(t)&&(t.options=o,t.loading=!1)})},p=async e=>{e.setComponent("field-map",s=>{s.loading=!0});const{data:o}=await u();e.setComponent("field-map",s=>{if(!e.util.isRepeaterFieldComponent(s))return;const t=s.fieldsMetaData[0];t.options=o,s.loading=!1})},m=async e=>{e.setComponent("group-type",t=>{t.loading=!0});const{data:o,status:s}=await i();if(s==="error"){e.setComponent("group-type",t=>{e.util.isSelectComponent(t)&&(t.status=s,t.loading=!1,t.invalidMessage=JSON.stringify(o))});return}e.setComponent("group-type",t=>{e.util.isSelectComponent(t)&&(t.options=o,t.loading=!1)})};export{d as a,m as b,g as c,p as d,f};
