1!function(){try{var r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new r.Error).stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="678995f9-3057-46f3-b5d1-6f8c1c4dd0ba",r._sentryDebugIdIdentifier="sentry-dbid-678995f9-3057-46f3-b5d1-6f8c1c4dd0ba")}catch(r){}}();import{a as r}from"./rolldown-runtime-BBzOAo5_.js";import{Cn as t,_n as n,a as e,c as o,d as i,f as a,i as u,n as s,r as d,u as l}from"./ApolloContext-WzkWO5Qv.js";import{n as c,r as f,t as v}from"./parser-D61KDmzg.js";t();var g=r(s());function m(r,t){var o=f(null==t?void 0:t.client);c(r,v.Mutation);var i=g.useState({called:!1,loading:!1,client:o}),u=i[0],s=i[1],l=g.useRef({result:u,mutationId:0,isMounted:!0,client:o,mutation:r,options:t});Object.assign(l.current,{client:o,options:t,mutation:r});var m=g.useCallback((function(r){void 0===r&&(r={});var t=l.current,o=t.options,i=t.mutation,u=n(n({},o),{mutation:i}),c=r.client||l.current.client;l.current.result.loading||u.ignoreResults||!l.current.isMounted||s(l.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:c});var f=++l.current.mutationId,v=a(u,r);return c.mutate(v).then((function(t){var n,o,i=t.data,a=t.errors,u=a&&a.length>0?new e({graphQLErrors:a}):void 0,g=r.onError||(null===(n=l.current.options)||void 0===n?void 0:n.onError);if(u&&g&&g(u,v),f===l.current.mutationId&&!v.ignoreResults){var m={called:!0,loading:!1,data:i,error:u,client:c};l.current.isMounted&&!d(l.current.result,m)&&s(l.current.result=m)}var p=r.onCompleted||(null===(o=l.current.options)||void 0===o?void 0:o.onCompleted);return u||null==p||p(t.data,v),t})).catch((function(t){var n;if(f===l.current.mutationId&&l.current.isMounted){var e={loading:!1,error:t,data:void 0,called:!0,client:c};d(l.current.result,e)||s(l.current.result=e)}var o=r.onError||(null===(n=l.current.options)||void 0===n?void 0:n.onError);if(o)return o(t,v),{data:void 0,errors:t};throw t}))}),[]),p=g.useCallback((function(){if(l.current.isMounted){var r={called:!1,loading:!1,client:o};Object.assign(l.current,{mutationId:0,result:r}),s(r)}}),[]);return g.useEffect((function(){return l.current.isMounted=!0,function(){l.current.isMounted=!1}}),[]),[m,n({reset:p},u)]}l(),u(),o();export{m as t}; 2//# sourceMappingURL=useMutation-Dlh4SgeV.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.