import{n as e}from"./chunk-DrgAwqJ9.js";import{n as t}from"./jsx-runtime-C3uB2UIS.js";import{t as n,y as r}from"./useRouterState-xMX6SC4L.js";import{n as i,t as a}from"./matchContext-DJGtnHV7.js";var o=e(t(),1);function s(e){let t=o.useContext(e.from?a:i);return n({select:n=>{let i=n.matches.find(n=>e.from?e.from===n.routeId:n.id===t);if(r(!((e.shouldThrow??!0)&&!i),`Could not find ${e.from?`an active match from "${e.from}"`:`a nearest match!`}`),i!==void 0)return e.select?e.select(i):i},structuralSharing:e.structuralSharing})}function c(e){return s({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}export{s as n,c as t};
//# sourceMappingURL=useSearch-BnhMxnIE.js.map