import{r as l}from"./index-76fb7be0.js";import{h as p,i as v}from"./dataProvider-3f13e24d.js";import{a as h,b as m}from"./Button-a22a3ea5.js";import{R as g}from"./useRecordContext-3e1d0ecf.js";var o=globalThis&&globalThis.__assign||function(){return o=Object.assign||function(n){for(var a,t=1,r=arguments.length;t<r;t++){a=arguments[t];for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(n[e]=a[e])}return n},o.apply(this,arguments)},w=function(){var n=p(),a=h(),t=m();return l.useCallback(function(r,e,f,c,i){if(e===void 0&&(e=""),i===void 0&&(i={}),r)if(typeof r=="function"){var s=r(e,f,c),u=typeof s=="string"?"".concat(a,"/").concat(s):o({pathname:"".concat(a,"/").concat(s.pathname)},s);n(typeof u=="string"?v(u):u,{state:o({_scrollToTop:!0},i)});return}else if(typeof r=="string"&&r.startsWith("http")&&window){window.location.href=r;return}else{n(t({resource:e,id:f,type:r}),{state:o({_scrollToTop:!0},i)});return}else return},[n,a,t])},O=function(n){var a=n.value,t=n.children;return a?l.createElement(g,{value:a},t):t};export{O,w as u};
