import{c as e,f as r,d as a}from"./router.chunk.YsRm4bSN.js";import{_ as __}from"./wordpress.chunk.BVds2GcU.js";import{bj as s,aw as n,ax as u,w as o}from"./main.chunk.N-eZ2ybB.js";const d=r=>e({queryKey:["CampaignRewards",r],queryFn:()=>(s(r,__("Campaign ID is required","growfund")),(e=>n.get(u.CAMPAIGN_REWARDS(e)).then(e=>e.data))(r)),enabled:!!r}),i=({campaign_id:e,...r})=>n.post(u.CAMPAIGN_REWARDS(e),r),t=()=>{const e=r();return a({mutationFn:i,onSuccess:()=>{o.success(__("Reward created successfully","growfund")),e.invalidateQueries({queryKey:["CampaignRewards"]})},onError:e=>{o.error(e.message)}})},c=({campaign_id:e,reward_id:r,...a})=>n.put(u.CAMPAIGN_REWARD_WITH_ID(e,r),a),m=()=>{const e=r();return a({mutationFn:c,onSuccess:()=>{o.success(__("Reward updated successfully","growfund")),e.invalidateQueries({queryKey:["CampaignRewards"]})},onError:e=>{o.error(e.message)}})},g=({campaign_id:e,reward_id:r})=>n.delete(u.CAMPAIGN_REWARD_WITH_ID(e,r)),p=()=>{const e=r();return a({mutationFn:g,onSuccess(){e.invalidateQueries({queryKey:["CampaignRewards"]}),o.success(__("Reward is deleted from the campaign.","growfund"))},onError(e){o.error(e.message)}})};export{t as a,m as b,p as c,d as u};
