var E=Object.defineProperty;var F=(j)=>j;function G(j,q){this[j]=F.bind(null,q)}var J=(j,q)=>{for(var w in q)E(j,w,{get:q[w],enumerable:!0,configurable:!0,set:G.bind(q,w)})};var K=(j,q)=>()=>(j&&(q=j(j=0)),q);import{defaultDocRegistry as H}from"@contractspec/lib.contracts-spec/docs";import{useMemo as I}from"react";function P(j,q){return I(()=>{try{return H.list().filter(({block:v})=>{let x=v.id.toLowerCase().includes(j.toLowerCase())||v.title.toLowerCase().includes(j.toLowerCase()),A=q?.some((B)=>v.tags?.some((C)=>C.toLowerCase().includes(B.toLowerCase())));return x||A}).map(({block:v,route:x})=>({id:v.id,title:v.title,summary:v.summary,route:x}))}catch(z){return console.error("Failed to fetch related docs:",z),[]}},[j,q])}export{P as useRelatedDocs};
