import{r as u}from"./index-76fb7be0.js";import"./index-d3ea75b5.js";import{N as x,k as E,l as F,h as O,m as P,o as _,q as y,e as T}from"./dataProvider-3f13e24d.js";/**
 * React Router DOM v6.21.3
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},v.apply(this,arguments)}function j(e,t){if(e==null)return{};var i={},n=Object.keys(e),a,s;for(s=0;s<n.length;s++)a=n[s],!(t.indexOf(a)>=0)&&(i[a]=e[a]);return i}function K(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function B(e,t){return e.button===0&&(!t||t==="_self")&&!K(e)}const N=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],W=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",q=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,G=u.forwardRef(function(t,i){let{onClick:n,relative:a,reloadDocument:s,replace:o,state:f,target:c,to:r,preventScrollReset:d,unstable_viewTransition:h}=t,m=j(t,N),{basename:S}=u.useContext(x),w,b=!1;if(typeof r=="string"&&q.test(r)&&(w=r,W))try{let l=new URL(window.location.href),p=r.startsWith("//")?new URL(l.protocol+r):new URL(r),g=E(p.pathname,S);p.origin===l.origin&&g!=null?r=g+p.search+p.hash:b=!0}catch{}let L=F(r,{relative:a}),R=z(r,{replace:o,state:f,target:c,preventScrollReset:d,relative:a,unstable_viewTransition:h});function k(l){n&&n(l),l.defaultPrevented||R(l)}return u.createElement("a",v({},m,{href:w||L,onClick:b||s?n:k,ref:i,target:c}))});var U;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(U||(U={}));var C;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(C||(C={}));function z(e,t){let{target:i,replace:n,state:a,preventScrollReset:s,relative:o,unstable_viewTransition:f}=t===void 0?{}:t,c=O(),r=P(),d=_(e,{relative:o});return u.useCallback(h=>{if(B(h,i)){h.preventDefault();let m=n!==void 0?n:y(r)===y(d);c(e,{replace:m,state:a,preventScrollReset:s,relative:o,unstable_viewTransition:f})}},[r,c,d,n,a,i,e,s,o,f])}var M=function(){var e=T();return u.useCallback(function(){e.invalidateQueries()},[e])};export{G as L,M as u};
