import{i as e,t}from"./useQuery-qKYvnzn0.js";import{t as n}from"./useMutation-C6r_dxL-.js";import{t as r}from"./client-BAPwymp0.js";function i(e={}){let n=new URLSearchParams;return Object.entries(e).forEach(([e,t])=>{t!=null&&n.set(e,String(t))}),t({queryKey:[`notes`,e],queryFn:()=>r.get(`/api/v1/notes?${n.toString()}`)})}function a(e){return t({queryKey:[`note`,e],queryFn:()=>r.get(`/api/v1/notes/${e}`),enabled:!!e})}function o(){let t=e();return n({mutationFn:({id:e,...t})=>r.patch(`/api/v1/notes/${e}`,t),onSuccess:(e,n)=>{t.invalidateQueries({queryKey:[`notes`]}),t.invalidateQueries({queryKey:[`note`,n.id]})}})}function s(){let t=e();return n({mutationFn:e=>r.del(`/api/v1/notes/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:[`notes`]})})}function c(e){return t({queryKey:[`note-tags`,e],queryFn:()=>r.get(`/api/v1/notes/${e}/tags`),enabled:!!e})}function l(){let t=e();return n({mutationFn:({noteId:e,tags:t})=>r.post(`/api/v1/notes/${e}/tags`,{tags:t}),onSuccess:(e,n)=>{t.invalidateQueries({queryKey:[`note-tags`,n.noteId]})}})}function u(){let t=e();return n({mutationFn:({noteId:e,tagId:t})=>r.del(`/api/v1/notes/${e}/tags/${t}`),onSuccess:(e,n)=>{t.invalidateQueries({queryKey:[`note-tags`,n.noteId]})}})}function d(){let t=e();return n({mutationFn:e=>r.post(`/api/v1/notes/${e}/summarize`),onSuccess:(e,n)=>{t.invalidateQueries({queryKey:[`note`,n]}),t.invalidateQueries({queryKey:[`notes`]})}})}function f(){let t=e();return n({mutationFn:e=>r.post(`/api/v1/notes/${e}/generate-title`),onSuccess:(e,n)=>{t.invalidateQueries({queryKey:[`note`,n]}),t.invalidateQueries({queryKey:[`notes`]})}})}export{c as a,d as c,a as i,o as l,s as n,i as o,f as r,u as s,l as t};