"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.leaveTheRoom = void 0;
var _client = require("@xmpp/client");
const leaveTheRoom = (roomJID, client) => {
  if (!client.jid) {
    throw new Error('Client JID is not set. Ensure the client is authenticated before calling this function.');
  }
  const message = (0, _client.xml)('presence', {
    to: `${roomJID}/${client.jid.getLocal()}`,
    type: 'unavailable'
  });
  client.send(message);
};
exports.leaveTheRoom = leaveTheRoom;
//# sourceMappingURL=leaveTheRoom.xmpp.js.map