import{r as e}from"./norm-f7iXVy-b.js";import{n as t,t as n}from"./webAppConfig-Cy2Ep-IO.js";var r=`https://bysjob.com`,i=()=>{try{if(String(globalThis?.location?.protocol||``)===`chrome-extension:`)return``}catch{}return t()},a=t=>{let n=e(t),r=n.startsWith(`#`)?n.slice(1):n,a=r.startsWith(`/`)?r:`/${r}`;try{if(String(globalThis?.location?.protocol||``)===`chrome-extension:`){let e=globalThis?.chrome?.runtime;if(e?.getURL)return`${String(e.getURL(`index.html`)||``).trim()}#${a}`}}catch{}let o=i();if(o)return`${o}${a}`;try{let e=globalThis?.chrome?.runtime;if(e?.getURL)return`${String(e.getURL(`index.html`)||``).trim()}#${a}`}catch{}try{let e=String(globalThis?.location?.protocol||``),t=String(globalThis?.location?.origin||``);if(e===`chrome-extension:`&&t)return`${t.replace(/\/+$/g,``)}/index.html#${a}`}catch{}return a},o=async t=>{let i=e(t)||`/`,a=i.startsWith(`/`)?i:`/${i}`,o=await n()||r;return`${String(o||r).replace(/\/+$/g,``)}${a}`},s=(t,n)=>{let r=e(t);if(!r)return;let i=typeof n?.active==`boolean`?n.active:!0;try{let e=chrome?.tabs;if(e?.create){e.create({url:r,active:i});return}}catch{}try{window.open(r,`_blank`,`noopener,noreferrer`)}catch{}};export{o as n,s as r,a as t};