Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/im/view/element/keyboard/dist/ |
Upload File : |
(function(exports,ui_designTokens,ui_vue,im_lib_utils,im_lib_logger){"use strict"; /** * Bitrix Messenger * Attach element Vue component * * @package bitrix * @subpackage im * @copyright 2001-2019 Bitrix */var _ButtonType=Object.freeze({newline:"NEWLINE",button:"BUTTON"});ui_vue.BitrixVue.component("bx-im-view-element-keyboard",{props:{buttons:{type:Array,default:function t(){return[]}},messageId:{default:0},userId:{default:0},dialogId:{default:0}},data:function t(){return{isMobile:im_lib_utils.Utils.platform.isMobile(),isBlocked:false,localButtons:[]}},created:function t(){this.localButtons=this.prepareButtons(this.buttons)},watch:{buttons:function t(){clearTimeout(this.recoverStateButton);this.isBlocked=false;this.localButtons=this.prepareButtons(this.buttons)}},methods:{click:function click(button){var _this=this;if(this.isBlocked){return false}if(button.DISABLED&&button.DISABLED==="Y"){return false}if(button.ACTION&&button.ACTION_VALUE.toString()){this.$emit("click",{action:"ACTION",params:{dialogId:this.dialogId,messageId:this.messageId,botId:button.BOT_ID,action:button.ACTION,value:button.ACTION_VALUE}})}else if(button.FUNCTION){var execFunction=button.FUNCTION.toString().replace("#MESSAGE_ID#",this.messageId).replace("#DIALOG_ID#",this.dialogId).replace("#USER_ID#",this.userId);eval(execFunction)}else if(button.APP_ID){im_lib_logger.Logger.warn("Messenger keyboard: open app is not implemented.")}else if(button.LINK){if(im_lib_utils.Utils.platform.isBitrixMobile()){app.openNewPage(button.LINK)}else{window.open(button.LINK,"_blank")}}else if(button.WAIT!=="Y"){if(button.BLOCK==="Y"){this.isBlocked=true}button.WAIT="Y";this.$emit("click",{action:"COMMAND",params:{dialogId:this.dialogId,messageId:this.messageId,botId:button.BOT_ID,command:button.COMMAND,params:button.COMMAND_PARAMS}});this.recoverStateButton=setTimeout((function(){_this.isBlocked=false;button.WAIT="N"}),1e4)}return true},getStyles:function t(e){var i={};if(e.WIDTH){i["width"]=e.WIDTH+"px"}else if(e.DISPLAY==="BLOCK"){i["width"]="225px"}if(e.BG_COLOR){i["backgroundColor"]=e.BG_COLOR}if(e.TEXT_COLOR){i["color"]=e.TEXT_COLOR}return i},prepareButtons:function t(e){return e.filter((function(t){if(!t.CONTEXT){return true}if(im_lib_utils.Utils.platform.isBitrixMobile()&&t.CONTEXT==="DESKTOP"){return false}if(!im_lib_utils.Utils.platform.isBitrixMobile()&&t.CONTEXT==="MOBILE"){return false}if(!im_lib_utils.Utils.platform.isBitrixMobile()&&(t.ACTION==="DIALOG"||t.ACTION==="CALL")){return false}return true}))}},computed:{ButtonType:function t(){return _ButtonType}},template:'\n\t\t<div :class="[\'bx-im-element-keyboard\', {\'bx-im-element-keyboard-mobile\': isMobile}]">\n\t\t\t<template v-for="(button, index) in localButtons">\n\t\t\t\t<div v-if="button.TYPE === ButtonType.newline" class="bx-im-element-keyboard-button-separator"></div>\n\t\t\t\t<span v-else-if="button.TYPE === ButtonType.button" :class="[\n\t\t\t\t\t\'bx-im-element-keyboard-button\', \n\t\t\t\t\t\'bx-im-element-keyboard-button-\'+button.DISPLAY.toLowerCase(), \n\t\t\t\t\t{\n\t\t\t\t\t\t\'bx-im-element-keyboard-button-disabled\': isBlocked || button.DISABLED === \'Y\',\n\t\t\t\t\t\t\'bx-im-element-keyboard-button-progress\': button.WAIT === \'Y\',\n\t\t\t\t\t}\n\t\t\t\t]" @click="click(button)">\n\t\t\t\t\t<span class="bx-im-element-keyboard-button-text" :style="getStyles(button)">{{button.TEXT}}</span>\n\t\t\t\t</span>\n\t\t\t</template>\n\t\t</div>\n\t'})})(this.window=this.window||{},BX,BX,BX.Messenger.Lib,BX.Messenger.Lib); //# sourceMappingURL=keyboard.bundle.map.js