@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
23 lines • 13.4 kB
JavaScript
/*
* Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
*
*
*
*
* +---------------------------------------------------------------------------------+
* | |
* | Hello stranger! |
* | |
* | |
* | What you're currently looking at is the source code of a legally protected, |
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
* | are forbidden and will result in legal consequences. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
const _0x5e2313=_0x3124;(function(_0x2dc477,_0x52ec4c){const _0x529d0d=_0x3124,_0x1d604b=_0x2dc477();while(!![]){try{const _0x2bf880=-parseInt(_0x529d0d(0x15d))/0x1+parseInt(_0x529d0d(0x12a))/0x2*(-parseInt(_0x529d0d(0x127))/0x3)+-parseInt(_0x529d0d(0x138))/0x4*(parseInt(_0x529d0d(0x126))/0x5)+-parseInt(_0x529d0d(0x11b))/0x6+-parseInt(_0x529d0d(0x15f))/0x7*(parseInt(_0x529d0d(0x13a))/0x8)+-parseInt(_0x529d0d(0x148))/0x9+-parseInt(_0x529d0d(0x14a))/0xa*(-parseInt(_0x529d0d(0x115))/0xb);if(_0x2bf880===_0x52ec4c)break;else _0x1d604b['push'](_0x1d604b['shift']());}catch(_0x2f7f15){_0x1d604b['push'](_0x1d604b['shift']());}}}(_0x2b8c,0xde206));import{KeystrokeHandler as _0xb72b4f}from'ckeditor5/src/utils.js';function _0x2b8c(){const _0x418a5a=['detachFromDom','AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','_createActionsDropdownOrButton','balloonPanelView','add','esc','length','14617908KBSEJg','remove','12244310cGjPhG','isVisible','AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','balloonPanelClass','tooltip','setTemplate','AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','_updateDropdownActions','ck-ai-chat__feed__ai-suggestion__actions--no-animation','button','slice','_firstRender','children','insertSuggestion','uiLanguageDirection','listItemModels','set','arrowView','source','1618227kbBkRk','listenTo','7udBdvC','showChangeInTextModel','pin','bind','_createActionsButton','isEnabled','attachToDom','bindTemplate','_createActionsDropdown','label','left','unbind','width','keys','arrowless','AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','_dropdownOriginalConfig','fire','_dropdownCurrentConfig','content','_setUpList','applySuggestion','actionName','77bcInJd','listView','createCollection','showChangeInText','div','bottom','6797622cCWakt','AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','hide','bodyCollection','ck-ai-button-primary','_partsCount','ck-hidden','focus','change:isTrackChangesOn','map','35VrPYsc','21mpOWPG','open','execute','504534srnXvo','actionsButton','ck-ai-chat__feed__ai-suggestion__actions','AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','insertSuggestionModel','items','has','isTrackChangesOn','locale','ck-ai-chat__feed__ai-suggestion__actions__balloon','updateLabels','applySuggestionModel','_setUpKeystrokes','delegate','507708QMQeBK','ck-ai-chat__feed__ai-suggestion__actions\x20','5051624YsLVkM','element','keystrokeHandler','ltr','destroy','class','filter'];_0x2b8c=function(){return _0x418a5a;};return _0x2b8c();}import{BalloonPanelView as _0x8d0a3b,BodyCollection as _0x2bddb7,ButtonView as _0x2a86e5,clickOutsideHandler as _0x7e7f69,ListItemButtonView as _0x384639,ListItemView as _0x32ff44,ListView as _0x3c989b,SplitButtonView as _0x565970,UIModel as _0x27b976,View as _0x11faa8}from'ckeditor5/src/ui.js';import{IconCheck as _0x2e199e,IconAddComment as _0x42addd,IconDocumentWithLoupe as _0x2bf589}from'ckeditor5/src/icons.js';import{getTranslation as _0x2459b7}from'../../../aicore/utils/common-translations.js';export const AI_REPLY_ACTIONS=[_0x5e2313(0x113),_0x5e2313(0x157),_0x5e2313(0x118)];export class AIChatFeedSuggestionItemActionsView extends _0x11faa8{[_0x5e2313(0x12b)];[_0x5e2313(0x156)];[_0x5e2313(0x135)];[_0x5e2313(0x160)];[_0x5e2313(0x12e)];[_0x5e2313(0x121)]=0x1;[_0x5e2313(0x10e)];[_0x5e2313(0x110)];[_0x5e2313(0x155)]=!0x0;constructor(_0x2ee2b5,_0x1138d4){const _0xc62215=_0x5e2313;super(_0x2ee2b5),this[_0xc62215(0x10e)]=_0x1138d4||[...AI_REPLY_ACTIONS],this[_0xc62215(0x110)]=[...this[_0xc62215(0x10e)]];const _0x1325e4=this[_0xc62215(0x166)];this[_0xc62215(0x15a)](_0xc62215(0x164),!0x0),this[_0xc62215(0x15a)](_0xc62215(0x14b),!0x0),this[_0xc62215(0x15a)](_0xc62215(0x131),!0x1),this[_0xc62215(0x135)]=new _0x27b976({'label':Pn(_0xc62215(0x113),_0x2ee2b5,this[_0xc62215(0x121)]),'icon':_0x2e199e,'withText':!0x0,'type':_0xc62215(0x153),'actionName':_0xc62215(0x113)}),this[_0xc62215(0x160)]=new _0x27b976({'label':Pn(_0xc62215(0x118),_0x2ee2b5,this[_0xc62215(0x121)]),'icon':_0x2bf589,'withText':!0x0,'type':_0xc62215(0x153),'actionName':_0xc62215(0x118)}),this[_0xc62215(0x12e)]=new _0x27b976({'label':Pn(_0xc62215(0x157),_0x2ee2b5,this[_0xc62215(0x121)]),'icon':_0x42addd,'withText':!0x0,'type':_0xc62215(0x153),'actionName':_0xc62215(0x157)}),this[_0xc62215(0x12b)]=this[_0xc62215(0x143)](_0x2ee2b5),this[_0xc62215(0x156)]=this[_0xc62215(0x117)](),this[_0xc62215(0x12b)]&&this[_0xc62215(0x156)][_0xc62215(0x145)](this[_0xc62215(0x12b)]),this[_0xc62215(0x14f)]({'tag':_0xc62215(0x119),'attributes':{'class':['ck',_0xc62215(0x12c),_0x1325e4['if'](_0xc62215(0x14b),_0xc62215(0x122),_0x12db36=>!_0x12db36)]},'children':this[_0xc62215(0x156)]}),this['on'](_0xc62215(0x124),()=>{const _0x55bc2f=_0xc62215;this[_0x55bc2f(0x110)]=this[_0x55bc2f(0x131)]?this[_0x55bc2f(0x10e)][_0x55bc2f(0x140)](_0x3cfabb=>_0x55bc2f(0x113)!==_0x3cfabb):[...this[_0x55bc2f(0x10e)]],this[_0x55bc2f(0x151)](_0x2ee2b5);});}[_0x5e2313(0x151)](_0x4e63b2){const _0x5e6513=_0x5e2313;this[_0x5e6513(0x12b)]&&this[_0x5e6513(0x156)][_0x5e6513(0x130)](this[_0x5e6513(0x12b)])&&(this[_0x5e6513(0x156)][_0x5e6513(0x149)](this[_0x5e6513(0x12b)]),this[_0x5e6513(0x12b)][_0x5e6513(0x13e)]()),this[_0x5e6513(0x12b)]=this[_0x5e6513(0x143)](_0x4e63b2),this[_0x5e6513(0x12b)]&&this[_0x5e6513(0x156)][_0x5e6513(0x145)](this[_0x5e6513(0x12b)]);}[_0x5e2313(0x143)](_0x190345){const _0x6706a2=_0x5e2313;if(0x0==this[_0x6706a2(0x110)][_0x6706a2(0x147)])return null;const _0x2c868c=0x1===this[_0x6706a2(0x110)][_0x6706a2(0x147)]?this[_0x6706a2(0x163)](_0x190345):this[_0x6706a2(0x106)](_0x190345),_0x3c2416=this[_0x6706a2(0x155)]?'':_0x6706a2(0x152);_0x2c868c[_0x6706a2(0x15a)]({'label':Pn(this[_0x6706a2(0x110)][0x0],_0x190345,this[_0x6706a2(0x121)]),'tooltip':Hn(this[_0x6706a2(0x110)][0x0],_0x190345,this[_0x6706a2(0x121)]),'withText':!0x0,'class':_0x6706a2(0x139)+_0x3c2416});for(const _0x42f563 of this[_0x6706a2(0x110)])_0x2c868c['on'](_0x42f563,()=>{const _0x484a1b=_0x6706a2;this[_0x484a1b(0x10f)](_0x42f563);});return this[_0x6706a2(0x155)]=!0x1,_0x2c868c;}[_0x5e2313(0x163)](_0xf8ea99){const _0x3fa21a=_0x5e2313,_0x38c418=new _0x2a86e5(_0xf8ea99);return _0x38c418[_0x3fa21a(0x15a)]({'class':_0x3fa21a(0x120),'withText':!0x0}),_0x38c418['on'](_0x3fa21a(0x129),()=>{const _0x2db898=_0x3fa21a;_0x38c418[_0x2db898(0x10f)](this[_0x2db898(0x110)][0x0]);}),_0x38c418;}[_0x5e2313(0x106)](_0x28084f){const _0x557b6d=_0x5e2313,_0x4e7575=new Nn(_0x28084f,{'listItemModels':this[_0x557b6d(0x110)][_0x557b6d(0x125)](_0x5b44ad=>{const _0x4845e8=_0x557b6d;switch(_0x5b44ad){case _0x4845e8(0x113):return this[_0x4845e8(0x135)];case _0x4845e8(0x118):return this[_0x4845e8(0x160)];case _0x4845e8(0x157):return this[_0x4845e8(0x12e)];}})});return _0x4e7575[_0x557b6d(0x15a)]({'label':Pn(this[_0x557b6d(0x110)][0x0],_0x28084f,this[_0x557b6d(0x121)]),'tooltip':Hn(this[_0x557b6d(0x110)][0x0],_0x28084f,this[_0x557b6d(0x121)]),'withText':!0x0,'class':_0x557b6d(0x12c),'balloonPanelClass':_0x557b6d(0x133)}),_0x4e7575[_0x557b6d(0x162)](_0x557b6d(0x164))['to'](this),_0x4e7575;}[_0x5e2313(0x134)](_0x2f30ac){const _0x287af4=_0x5e2313,_0x4e7164=this[_0x287af4(0x132)];this[_0x287af4(0x121)]=_0x2f30ac||this[_0x287af4(0x121)],this[_0x287af4(0x12b)][_0x287af4(0x15a)]({'label':Pn(this[_0x287af4(0x110)][0x0],_0x4e7164,this[_0x287af4(0x121)]),'tooltip':Hn(this[_0x287af4(0x110)][0x0],_0x4e7164,this[_0x287af4(0x121)])}),this[_0x287af4(0x135)][_0x287af4(0x107)]=Pn(_0x287af4(0x113),_0x4e7164,this[_0x287af4(0x121)]),this[_0x287af4(0x160)][_0x287af4(0x107)]=Pn(_0x287af4(0x118),_0x4e7164,this[_0x287af4(0x121)]),this[_0x287af4(0x12e)][_0x287af4(0x107)]=Pn(_0x287af4(0x157),_0x4e7164,this[_0x287af4(0x121)]);}}class Nn extends _0x565970{[_0x5e2313(0x11f)];[_0x5e2313(0x144)];[_0x5e2313(0x116)];[_0x5e2313(0x13c)];constructor(_0x5ba4d0,_0x346346){const _0x126212=_0x5e2313;super(_0x5ba4d0),this[_0x126212(0x144)]=new _0x8d0a3b(this[_0x126212(0x132)]),this[_0x126212(0x11f)]=new _0x2bddb7(this[_0x126212(0x132)]),this[_0x126212(0x11f)][_0x126212(0x165)](),this[_0x126212(0x15a)](_0x126212(0x14d),''),this[_0x126212(0x144)][_0x126212(0x162)](_0x126212(0x13f))['to'](this,_0x126212(0x14d)),this[_0x126212(0x116)]=this[_0x126212(0x112)](_0x346346[_0x126212(0x159)][_0x126212(0x154)](0x1)),this[_0x126212(0x11f)][_0x126212(0x145)](this[_0x126212(0x144)]),this[_0x126212(0x144)][_0x126212(0x111)][_0x126212(0x145)](this[_0x126212(0x116)]),this[_0x126212(0x15b)][_0x126212(0x109)](_0x126212(0x14e)),this[_0x126212(0x15b)][_0x126212(0x15a)](_0x126212(0x14e),_0x2459b7(this[_0x126212(0x132)],_0x126212(0x11c))),this[_0x126212(0x136)](),this['on'](_0x126212(0x129),()=>{const _0x1d6779=_0x126212,_0xfbac3d=_0x346346[_0x1d6779(0x159)][0x0][_0x1d6779(0x114)];this[_0x1d6779(0x10f)](_0xfbac3d),this[_0x1d6779(0x144)][_0x1d6779(0x11e)](),this[_0x1d6779(0x15b)][_0x1d6779(0x123)]();}),this['on'](_0x126212(0x128),()=>{const _0x274225=_0x126212;this[_0x274225(0x144)][_0x274225(0x14b)]?(this[_0x274225(0x144)][_0x274225(0x11e)](),this[_0x274225(0x15b)][_0x274225(0x123)]()):(this[_0x274225(0x144)][_0x274225(0x161)]({'target':this[_0x274225(0x13b)],'positions':[_0x274225(0x13d)===this[_0x274225(0x132)][_0x274225(0x158)]?Gn:yn]}),this[_0x274225(0x116)][_0x274225(0x123)]());}),_0x7e7f69({'emitter':this[_0x126212(0x144)],'callback':()=>{const _0x379a44=_0x126212;this[_0x379a44(0x144)][_0x379a44(0x11e)]();},'activator':()=>this[_0x126212(0x144)][_0x126212(0x14b)],'contextElements':()=>[this[_0x126212(0x13b)],this[_0x126212(0x144)][_0x126212(0x13b)]]});}[_0x5e2313(0x112)](_0x35853e){const _0x41868=_0x5e2313,_0x55abbb=this[_0x41868(0x132)],_0x241e61=new _0x3c989b(_0x55abbb);for(const _0x57f6e1 of _0x35853e){const _0x503182=new _0x32ff44(_0x55abbb),_0x4ef460=new _0x384639(_0x55abbb);_0x4ef460[_0x41868(0x162)](...Object[_0x41868(0x10b)](_0x57f6e1))['to'](_0x57f6e1),_0x4ef460[_0x41868(0x137)](_0x41868(0x129))['to'](_0x241e61),_0x503182[_0x41868(0x156)][_0x41868(0x145)](_0x4ef460),_0x241e61[_0x41868(0x12f)][_0x41868(0x145)](_0x503182);}return _0x241e61[_0x41868(0x12f)][_0x41868(0x137)](_0x41868(0x129))['to'](this),_0x241e61['on'](_0x41868(0x129),_0x488294=>{const _0x21fa59=_0x41868,_0x13fc88=_0x488294[_0x21fa59(0x15c)];this[_0x21fa59(0x10f)](_0x13fc88[_0x21fa59(0x114)]),this[_0x21fa59(0x144)][_0x21fa59(0x11e)](),this[_0x21fa59(0x15b)][_0x21fa59(0x123)]();}),_0x241e61;}[_0x5e2313(0x136)](){const _0x8a774b=_0x5e2313;this[_0x8a774b(0x13c)]=new _0xb72b4f(),this[_0x8a774b(0x13c)][_0x8a774b(0x15e)](this[_0x8a774b(0x144)][_0x8a774b(0x13b)]),this[_0x8a774b(0x13c)][_0x8a774b(0x15a)](_0x8a774b(0x146),(_0xbb23cc,_0x135735)=>{const _0x3970b8=_0x8a774b;this[_0x3970b8(0x144)][_0x3970b8(0x11e)](),this[_0x3970b8(0x15b)][_0x3970b8(0x123)](),_0x135735();});}[_0x5e2313(0x13e)](){const _0xe523d9=_0x5e2313;super[_0xe523d9(0x13e)](),this[_0xe523d9(0x13c)][_0xe523d9(0x13e)](),this[_0xe523d9(0x144)][_0xe523d9(0x13e)](),this[_0xe523d9(0x11f)][_0xe523d9(0x141)]();}}function Gn(_0x1486d0){const _0x3d8c47=_0x5e2313;return{'top':_0x1486d0[_0x3d8c47(0x11a)],'left':_0x1486d0[_0x3d8c47(0x108)],'name':_0x3d8c47(0x10c),'config':{'withArrow':!0x1}};}function _0x3124(_0x4298a5,_0x3505e7){const _0x2b8c63=_0x2b8c();return _0x3124=function(_0x3124a1,_0x4f976f){_0x3124a1=_0x3124a1-0x106;let _0x268bdf=_0x2b8c63[_0x3124a1];return _0x268bdf;},_0x3124(_0x4298a5,_0x3505e7);}function yn(_0x348d89,_0x1ab2ee){const _0x5494b7=_0x5e2313;return{'top':_0x348d89[_0x5494b7(0x11a)],'left':_0x348d89[_0x5494b7(0x108)]-(_0x1ab2ee[_0x5494b7(0x10a)]-_0x348d89[_0x5494b7(0x10a)]),'name':_0x5494b7(0x10c),'config':{'withArrow':!0x1}};}function Pn(_0x27e756,_0x32accb,_0x4c5f70){const _0x37fb0d=_0x5e2313;switch(_0x27e756){case _0x37fb0d(0x113):return _0x2459b7(_0x32accb,_0x37fb0d(0x11d),_0x4c5f70);case _0x37fb0d(0x118):return _0x2459b7(_0x32accb,_0x37fb0d(0x142),_0x4c5f70);case _0x37fb0d(0x157):return _0x2459b7(_0x32accb,_0x37fb0d(0x150),_0x4c5f70);}}function Hn(_0x239b5b,_0x4d8fe7,_0x188381){const _0x21a161=_0x5e2313;switch(_0x239b5b){case _0x21a161(0x113):return _0x2459b7(_0x4d8fe7,_0x21a161(0x12d),_0x188381);case _0x21a161(0x118):return _0x2459b7(_0x4d8fe7,_0x21a161(0x10d),_0x188381);case _0x21a161(0x157):return _0x2459b7(_0x4d8fe7,_0x21a161(0x14c),_0x188381);}}