const e=["http:","https:"],o=r=>{let t="";for(let n=0;n<r.length;n+=1){const s=r.charCodeAt(n);s>31&&s!==127&&(t+=r[n])}return t},i=r=>{if(typeof r!="string")return"#";const t=o(r).trim();if(t==="")return"#";if(!t.startsWith("//")&&(t.startsWith("/")||t.startsWith("#")||t.startsWith("?")))return t;try{const n=new URL(t,window.location.origin);return e.includes(n.protocol)?t:"#"}catch{return"#"}};export{i as s};
