PageSourceSearch

https://gronde.eu/assets/router-compat-D-RDzRaH.js

js gronde.eu collected 2026-10-06 12:51:32 UTC 3,063 bytes, 1 lines download raw bytes

1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-C21x__mS.js";import{B as n,t as r}from"./useStore-BJttE7X0.js";import{t as i}from"./invariant-DEEwAagU.js";import{a,i as o,n as s}from"./Match-SEwyzhwz.js";import{t as c}from"./link-xRWfe8Hn.js";import{t as l}from"./jsx-runtime-BdxMnOeJ.js";import{t as u}from"./useRouter-BZFJt2Xp.js";var d=e(t(),1),f={get(){},subscribe(){return{unsubscribe(){}}}};function p(e,t){let r=d.useRef();return i=>{let a=e?.select?e.select(i):i;return e?.structuralSharing??t.options.defaultStructuralSharing?r.current=n(r.current,a):a}}function m(e){let t=u(),n=d.useContext(e.from?o:a),s=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),c=p(e,t),l=r(s??f,e=>e?c(e):f);if(l!==f)return l;(e.shouldThrow??!0)&&i()}function h(e){return m({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function g(e){let t=u();return d.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function _(e){let t=u();return r(t.stores.location,p(e,t))}var v=l();function y(e){let[t,n]=(e??``).split(`#`),[r,i]=(t??``).split(`?`);return{pathname:r||`.`,search:i?Object.fromEntries(new URLSearchParams(i)):void 0,hash:n||void 0}}function b(){let e=g(),t=u();return(0,d.useCallback)((n,r)=>{if(typeof n==`number`){t.history.go(n);return}let{pathname:i,search:a,hash:o}=y(n);e({to:i,search:a,hash:o,state:r?.state,replace:r?.replace})},[e,t])}function x(){let e=_();return(0,d.useMemo)(()=>({pathname:e.pathname,search:e.searchStr?`?${e.searchStr}`:``,hash:e.hash??``,state:e.state??null,key:e.pathname+(e.searchStr??``)}),[e.pathname,e.searchStr,e.hash,e.state])}function S(){return h({strict:!1})}function C(){let e=_(),t=g(),n=u();return[(0,d.useMemo)(()=>new URLSearchParams(e.searchStr??``),[e.searchStr]),(0,d.useCallback)((e,r)=>{let i=n.state.location,a=new URLSearchParams(i.searchStr??``),o=typeof e==`function`?e(a):e instanceof URLSearchParams?e:new URLSearchParams(e),s={};o.forEach((e,t)=>{s[t]=e}),t({to:i.pathname,search:s,replace:r?.replace})},[t,n])]}var w=(0,d.forwardRef)(function({to:e,replace:t,state:n,children:r,...i},a){let{pathname:o,search:s,hash:l}=y(e);return(0,v.jsx)(c,{ref:a,to:o,search:s,hash:l,replace:t,state:n,...i??{},children:r})});function T({to:e,replace:t,state:n}){let r=b(),i=_(),a=(0,d.useRef)(null),o=`${i.pathname}${i.searchStr??``}`;return(0,d.useEffect)(()=>{a.current!==e&&e!==o&&(a.current=e,r(e,{replace:t,state:n}))},[e,o,t,n,r]),null}var E=s,D=(0,d.forwardRef)(function({className:e,style:t,children:n,end:r,to:i,...a},o){let{pathname:s}=x(),c=y(i).pathname,l=r?s===c:s===c||s.startsWith(`${c}/`),u={isActive:l,isPending:!1,isTransitioning:!1};return(0,v.jsx)(w,{ref:o,to:i,className:typeof e==`function`?e(u):e,style:typeof t==`function`?t(u):t,"aria-current":l?`page`:void 0,...a,children:typeof n==`function`?n(u):n})});export{x as a,C as c,h as d,m as f,E as i,_ as l,D as n,b as o,T as r,S as s,w as t,g as u};

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.