const c="user_id",o="token",i="theme",D="lang",a="ui_mode",d="embedded",m="src_host",u="src_url";function f(t,e,n,r="light",s,_){if(!t)return t;try{const E=new URL(t);return e&&E.searchParams.set(c,String(e)),n&&E.searchParams.set(o,n),E.searchParams.set(i,r),s&&E.searchParams.set(D,s),E.searchParams.set(a,d),typeof window<"u"&&(E.searchParams.set(m,window.location.origin),E.searchParams.set(u,window.location.href)),E.toString()}catch{return t}}function h(){return typeof document>"u"?"light":document.documentElement.classList.contains("dark")?"dark":"light"}export{f as b,h as d};
