{"version":3,"file":"message_drawer_helper.min.js","sources":["../src/message_drawer_helper.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Provides some helper functions to trigger actions in the message drawer.\n *\n * @module     core_message/message_drawer_helper\n * @package    message\n * @copyright  2018 Ryan Wyllie <ryan@moodle.com>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(\n[\n    'core/pubsub',\n    'core_message/message_drawer_events'\n],\nfunction(\n    PubSub,\n    MessageDrawerEvents\n) {\n\n    /**\n     * Trigger an event to create a new conversation in the message drawer.\n     *\n     * @param {Number} userId The user id to start a conversation.\n     */\n    var createConversationWithUser = function(args) {\n        PubSub.publish(MessageDrawerEvents.CREATE_CONVERSATION_WITH_USER, args);\n    };\n\n    /**\n     * Trigger an event to hide the message drawer.\n     */\n    var hide = function() {\n        PubSub.publish(MessageDrawerEvents.HIDE);\n    };\n\n    /**\n     * Trigger an event to show the message drawer.\n     */\n    var show = function() {\n        PubSub.publish(MessageDrawerEvents.SHOW);\n    };\n\n    /**\n     * Trigger an event to show the given conversation.\n     *\n     * @param {int} conversationId Id for the conversation to show.\n     */\n    var showConversation = function(args) {\n        PubSub.publish(MessageDrawerEvents.SHOW_CONVERSATION, args);\n    };\n\n    /**\n     * Trigger an event to show messaging settings.\n     */\n    var showSettings = function() {\n        PubSub.publish(MessageDrawerEvents.SHOW_SETTINGS);\n    };\n\n    return {\n        createConversationWithUser: createConversationWithUser,\n        hide: hide,\n        show: show,\n        showConversation: showConversation,\n        showSettings: showSettings\n    };\n});\n"],"names":["define","PubSub","MessageDrawerEvents","createConversationWithUser","args","publish","CREATE_CONVERSATION_WITH_USER","hide","HIDE","show","SHOW","showConversation","SHOW_CONVERSATION","showSettings","SHOW_SETTINGS"],"mappings":";;;;;;;;AAuBAA,4CACA,CACI,cACA,uCAEJ,SACIC,OACAC,2BA0CO,CACHC,2BAnC6B,SAASC,MACtCH,OAAOI,QAAQH,oBAAoBI,8BAA+BF,OAmClEG,KA7BO,WACPN,OAAOI,QAAQH,oBAAoBM,OA6BnCC,KAvBO,WACPR,OAAOI,QAAQH,oBAAoBQ,OAuBnCC,iBAfmB,SAASP,MAC5BH,OAAOI,QAAQH,oBAAoBU,kBAAmBR,OAetDS,aATe,WACfZ,OAAOI,QAAQH,oBAAoBY"}