import{r as l}from"./index-BP8_t0zE.js";import{b as c,q as v,r as m}from"./defaultI18nProvider-C_r1y4tu.js";var o=function(){return o=Object.assign||function(e){for(var a,r=1,n=arguments.length;r<n;r++){a=arguments[r];for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},o.apply(this,arguments)},y=function(){var e=c(),a=v(),r=m();return l.useCallback(function(n,t,u,f,s){if(t===void 0&&(t=""),s===void 0&&(s={}),n)if(typeof n=="function"){var i=n(t,u,f),p=typeof i=="string"?"".concat(a,"/").concat(i):o({pathname:"".concat(a,"/").concat(i.pathname)},i);e(p,{state:o({_scrollToTop:!0},s)});return}else if(typeof n=="string"&&n.startsWith("http")&&window){window.location.href=n;return}else{e(r({resource:t,id:u,type:n}),{state:n==="list"?s:o({_scrollToTop:!0},s)});return}else return},[e,a,r])};export{y as u};
