openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 1.03 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{mS as t,pS as n}from"./control-ui-boot-shared-DFTSUQQ0.js";function r(e){return e===c||e.startsWith(`${c}/`)}function i(e,n=!1){let i=URL.parse(e,`http://localhost`);if(i)return i.origin===`http://localhost`?r(i.pathname)?`${i.pathname}${i.search}${i.hash}`:void 0:n&&t(i)?i.toString():void 0}function a(e){let t=e?.trim();return!!(t&&i(t,!1))}function o(e,t,n=!1){let a=e?.trim();if(!a)return;let o=i(a,n);if(o){if(!t?.trim())return o;try{let e=new URL(t),n=e.pathname.replace(/\/+$/,``);if(!n.startsWith(l))return o;let i=new URL(o,e.origin);return r(i.pathname)?(i.protocol=e.protocol,i.username=e.username,i.password=e.password,i.host=e.host,i.pathname=`${n}${i.pathname}`,i.toString()):o}catch{return o}}}function s(e,t){return t===`strict`||e===`strict`?``:e===`trusted`&&t!==`scripts`?`allow-scripts allow-same-origin`:`allow-scripts`}var c,l;function u(){return(u=e((()=>{n(),c=`/__openclaw__/canvas`,l=`/__openclaw__/cap`})))()}export{s as i,a as n,o as r,u as t};