import{t as e}from"./command-format-CLxIPuLR.js";import{g as t}from"./session-key-C7F_iqYg.js";const n=new Map;function r(e){return(e??``).trim()||`default`}function i(t){let i=r(t),a=n.get(i)??null;if(!a)throw Error(`No active WhatsApp Web listener (account: ${i}). Start the gateway, then link WhatsApp with: ${e(`openclaw channels login --channel whatsapp --account ${i}`)}.`);return{accountId:i,listener:a}}function a(e,i){let{accountId:a,listener:o}=typeof e==`string`?{accountId:e,listener:i??null}:{accountId:t,listener:e??null},s=r(a);o?n.set(s,o):n.delete(s)}function o(e){let t=r(e);return n.get(t)??null}export{i as n,a as r,o as t};
