import{r as e,j as i}from"./vendor-react-wBh_31cN.js";import{u as o,j as f}from"./vendor-redux-CJZrIb6x.js";import{B as A}from"./back-button-CQo-pvZ0.js";import{d as g,e as x,b as h,a as j}from"./scope.selectors-C6FB6Cbj.js";import{r as m,aq as y}from"./index-dNe6i2rS.js";import{u as L}from"./useTitle-DQo_L6Ox.js";import{t as b}from"./titles-CzjGGAB3.js";import{A as E}from"./ApiForm-CIp0OHhC.js";import{c as S,u as k}from"./vendor-router-D1GqFWiT.js";import"./vendor-icons-BUUmD6ht.js";import"./vendor-utils-OeoE2qq_.js";import"./vendor-radix-BRyWS4bQ.js";import"./vendor-grid-CeFlDWv4.js";import"./callout-BFSXVeMz.js";import"./checkbox-group-C1CJIuf5.js";import"./checkbox-BlA4MwH9.js";import"./label-gPWmc6ow.js";import"./confirmation-dialog-C7dws5K4.js";import"./input-DFI7JniT.js";import"./useCopyToClipboard-DfzwgDFE.js";import"./useNotifier-BGMn6HaH.js";import"./notifications-5miqOdlG.js";import"./toast-wiGcevcF.js";import"./date-picker-K4pHuu1h.js";import"./popover-BzVbz_d3.js";import"./editable-select-DItn4ZHW.js";import"./index.esm-CAGtek53.js";import"./yup-XkUC3UEH.js";import"./card-BeQtvmcJ.js";import"./card-link-4kqDd55h.js";import"./getHopsDoc-B_Rq_F9V.js";import"./addDays-Cdit4yPz.js";const at=()=>{const{name:p}=S(),c=o(g),n=o(x),u=o(h),t=f(),s=k(),l=o(j);L(b.editAPI);const r=l.find(({name:a})=>a===p);e.useEffect(()=>(t.api.fetch(),t.scope.fetch(),()=>{t.api.clear()}),[t]);const d=e.useCallback(async a=>{await t.api.edit({data:a}),s(m.account.api.list)},[t,s]);return c||u||!r?i.jsx(y,{}):i.jsxs(i.Fragment,{children:[i.jsx(A,{className:"mb-3 self-start",onClick:()=>s(m.account.api.list),children:"All API keys"}),i.jsx(E,{isEdit:!0,initialData:r,isLoading:n,onSubmit:d})]})};export{at as default};
