import{u as P}from"./useQuery-DJhJ3Hj4.js";import{u as j}from"./useDataProvider-BTi1EEZL.js";import{r as i}from"./index-BP8_t0zE.js";import{p as d}from"./defaultI18nProvider-C_r1y4tu.js";var c=function(){return c=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++){o=arguments[n];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(t[a]=o[a])}return t},c.apply(this,arguments)},w=function(t,o){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&o.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(t);a<r.length;a++)o.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]]);return n},G=function(t,o,n){var r=o.id,a=o.meta;n===void 0&&(n={});var s=j(),l=n.onError,O=l===void 0?f:l,v=n.onSuccess,b=v===void 0?f:v,g=n.onSettled,E=g===void 0?f:g,u=n.enabled,h=w(n,["onError","onSuccess","onSettled","enabled"]),m=d(b),p=d(O),y=d(E),e=P(c({queryKey:[t,"getOne",{id:String(r),meta:a}],queryFn:function(S){return r==null?new Promise(function(){}):s.getOne(t,{id:r,meta:a,signal:s.supportAbortSignal===!0?S.signal:void 0}).then(function(_){var F=_.data;return F})},enabled:u??r!=null},h));return i.useEffect(function(){e.data===void 0||e.error!=null||e.isFetching||m(e.data)},[m,e.data,e.error,e.isFetching]),i.useEffect(function(){e.error==null||e.isFetching||p(e.error)},[p,e.error,e.isFetching]),i.useEffect(function(){e.status==="pending"||e.isFetching||y(e.data,e.error)},[y,e.data,e.error,e.status,e.isFetching]),e},f=function(){};export{G as u};
