openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 1.4 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{ar as t,cr as n,lr as r,rr as i,tr as a}from"./control-ui-connection-Bfj9beF_.js";import{Kx as o,MT as s,NT as c,PT as l,qx as u}from"./control-ui-boot-shared-DFTSUQQ0.js";function d(e,t,n,i=!1){let a=new Set(t),o=new Set(e),s=i?a:o,c=new Set(n),l=new Set(e.filter(e=>!a.has(e))),u=n.filter(e=>!l.has(e)),d=t.filter(e=>s.has(e)&&c.has(e)),f=e.filter(e=>a.has(e)&&c.has(e));if(i||!r(d,f)){let e=0;u=u.map(t=>s.has(t)?d[e++]??t:t)}for(let e=0;e<t.length;e+=1){let n=t[e];if(o.has(n)||u.includes(n))continue;let r=t.slice(0,e).findLast(e=>u.includes(e)),i=t.slice(e+1).find(e=>u.includes(e)),a=r===void 0?i===void 0?u.length:u.indexOf(i):u.indexOf(r)+1;u.splice(a,0,n)}return u}function f(e){let t={};for(let r of a)n(r)&&Object.hasOwn(e,r)&&Object.assign(t,{[r]:e[r]});return t.sidebarEntries&&e.sidebarEntriesBase&&(t.sidebarEntriesBase=e.sidebarEntriesBase,t.sidebarEntriesOrder=e.sidebarEntriesOrder),t}function p(e,t,n){if(!e)return null;for(let r of c(t))Object.hasOwn(t,r)&&l(e,t,r)&&(delete e[r],n.delete(r));return e.sidebarEntries||i(e),Object.keys(e).length?e:null}function m(e,t,n,r){let s={...e,...t};if(i(s),!n)return s;let c=o(r);for(let e of a)Object.hasOwn(t,e)&&t[e]===null&&(c[e]===void 0?delete s[e]:Object.assign(s,{[e]:c[e]}));return s}function h(){return(h=e((()=>{s(),u(),t()})))()}export{m as a,f as i,d as n,p as r,h as t};