import{At as e}from"./vendor-all-0-fRSUBfCr.js";import{Eb as s,Tb as t,Vm as r,zm as a}from"./shared-0-C4kdVF7Y.js";import{t as o}from"./c19ac20ec-CkiiKeZW.js";import{x as n}from"./c71860c77-CgnwypB-.js";var i="approvals-org-settings",c="mere_dipper";function u(e){return{"anthropic-version":"2023-06-01",...e?{"x-organization-uuid":e}:{}}}function d(e){return e instanceof t&&!(e instanceof s)&&(404===e.statusCode||501===e.statusCode||403===e.statusCode&&o(e))}function p(e){const s=n();return r("/v1/code/approvals/org-settings",{queryKey:[i,s],headers:u(s),enabled:e&&!!s,staleTime:3e5,meta:{noToast:!0,silent:d}})}function l(){const s=n(),t=e();return a("/v1/code/approvals/org-settings","PUT",{headers:u(s),transformVariables:({enabled:e,orgUuid:t})=>{if(!s||s!==t)throw new Error("approvals org-settings PUT requires the settled org");return{enabled:e}},meta:{noToast:!0,silent:d},redactResponseBodyInReports:!0,onSuccess:async(e,s)=>{if(!e)return;const r=[i,s.orgUuid];await t.cancelQueries({queryKey:r}),t.setQueryData(r,{...e,settings:e.settings??{enabled:s.enabled}})}})}export{l as a,p as i,u as n,d as r,c as t};