Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/landing/ui/button/ |
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/landing/ui/button/ai_text_button.min.js |
(function(){"use strict";BX.namespace("BX.Landing.UI.Button");BX.Landing.UI.Button.AiText=function(t,n){BX.Landing.UI.Button.EditorAction.apply(this,arguments);this.sections=n.sections;this.onSelect=n.onSelect};BX.Landing.UI.Button.AiText.getInstance=function(t,n){if(true||!BX.Landing.UI.Button.AiText.instance){BX.Landing.UI.Button.AiText.instance=new BX.Landing.UI.Button.AiText(t,n)}return BX.Landing.UI.Button.AiText.instance};BX.Landing.UI.Button.AiText.prototype={constructor:BX.Landing.UI.Button.AiText,__proto__:BX.Landing.UI.Button.EditorAction.prototype,onClick:function(){BX.Landing.UI.Panel.EditorPanel.getInstance().hide();const t=BX.Landing.Main.getInstance()["options"]["blocks"];const n=this.sections||[];const e={};for(let i=0,o=n.length;i<o;i++){const o=n[i];if(t[o]&&t[o]["meta"]){if(t[o]["meta"]["ai_text_max_tokens"]){e["max_tokens"]=parseInt(t[o]["meta"]["ai_text_max_tokens"])}}}if(!this.aiTextPicker){const t=BX.Landing.Main.getInstance()["options"]["site_id"];const n=top.BX.AI?top.BX.AI.Picker:BX.AI.Picker;this.aiTextPicker=new n({moduleId:"landing",contextId:"text_site_"+t,analyticLabel:"landing_text",history:true,onSelect:this.onSelect,onTariffRestriction:function(){BX.UI.InfoHelper.show("limit_sites_TextAssistant_AI")}});this.aiTextPicker.setLangSpace(BX.AI.Picker.LangSpace.text)}this.aiTextPicker.setSelectCallback(this.onSelect);this.aiTextPicker.setEngineParameters(e);this.aiTextPicker.text()}}})(); //# sourceMappingURL=ai_text_button.map.js