@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
23 lines • 11.6 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 _0x556339=_0x23e7;(function(_0x5f0a2f,_0x447fff){const _0x2ee388=_0x23e7,_0x472e9f=_0x5f0a2f();while(!![]){try{const _0x25e6a7=-parseInt(_0x2ee388(0x1af))/0x1+parseInt(_0x2ee388(0x1c9))/0x2*(-parseInt(_0x2ee388(0x1b1))/0x3)+-parseInt(_0x2ee388(0x195))/0x4+-parseInt(_0x2ee388(0x1a2))/0x5*(parseInt(_0x2ee388(0x1be))/0x6)+-parseInt(_0x2ee388(0x191))/0x7+parseInt(_0x2ee388(0x18d))/0x8*(parseInt(_0x2ee388(0x1b2))/0x9)+parseInt(_0x2ee388(0x1ad))/0xa*(parseInt(_0x2ee388(0x199))/0xb);if(_0x25e6a7===_0x447fff)break;else _0x472e9f['push'](_0x472e9f['shift']());}catch(_0x30ba39){_0x472e9f['push'](_0x472e9f['shift']());}}}(_0x398c,0x1d71f));import{View as _0x15e7bf,IconView as _0x4b7e97,ToolbarView as _0x1913d3,ButtonView as _0x53bdf5}from'ckeditor5/src/ui.js';import{IconAddComment as _0x3c0436,IconDocumentWithLoupe as _0x238493,IconDocumentWithCheckmark as _0x5635cf,IconDocumentWithCross as _0x5993f9,IconRemove as _0x83133,IconThreeStars as _0x3d737c}from'ckeditor5/src/icons.js';function _0x398c(){const _0x562111=['992453ImRtWd','ck-ai-suggestion__body__content-part__content','stream','bind','548040mFjmbX','toString','rejected','ck-ai-suggestion__body__content-part__icon-outdated','314919kEgWZX','toggleHeader','state','includes','showChangeInText','ck-ai-suggestion__body__content-part__title','ck-ai-suggestion__body__content-part__title__label','add','content','7335uhzwTh','delegate','extendTemplate','updateContent','_iconStateRejected','hasChanges','ck-ai-suggestion__body__content-part__icon-accepted','AI_SUGGESTION_CONTENT_PART_REJECTED','setTemplate','element','remove','190jxtZxj','AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','121843FKoWJm','outdated','83289EqPdrl','9NAKlUc','_iconStateOutdated','animation:\x20ck-html-streamer-fade-in\x20.5s','ck-ai-suggestion__body__content-part__icon-title','ck-ai-suggestion__body__content-part_active','addMany','set','_toolbarView','push','AI_SUGGESTION_CONTENT_PART_TITLE','bindTemplate','isVisible','654UNHDCh','accepted','partDefinition','pending','ck-ai-suggestion__body__content-part','streaming','span','insertSuggestion','change:state','mouseLeaveSuggestion','AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','6WmhNdM','has','createCollection','innerHTML','mouseOverSuggestion','execute','children','index','AI_SUGGESTION_CONTENT_PART_OUTDATED','headerView','contentView','AI_SUGGESTION_CONTENT_PART_DELETE','rejectSuggestion','fire','isEnabled','ck-hidden','ck-reset_all-excluded','ck-ai-suggestion__body__content-part_','htmlStreamer','ck-ai-suggestion__body__content-part__icon-rejected','div','AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','1763840kFGFoq','items','ck-content','_iconStateAccepted'];_0x398c=function(){return _0x562111;};return _0x398c();}import{HTMLStreamer as _0x1debe5}from'../../utils/htmlstreamer.js';import{getTranslation as _0x4f586c}from'../../utils/common-translations.js';import{serialize as _0x214ee0}from'../../utils/htmlparser.js';function _0x23e7(_0x311648,_0x5f3b65){const _0x398c5f=_0x398c();return _0x23e7=function(_0x23e709,_0x45e45c){_0x23e709=_0x23e709-0x18d;let _0x5e8569=_0x398c5f[_0x23e709];return _0x5e8569;},_0x23e7(_0x311648,_0x5f3b65);}import{AI_SUGGESTION_UI_EVENT_NAMES as _0xacb148}from'../../utils/eventnames.js';export class AISuggestionBodyViewContentPartView extends _0x15e7bf{[_0x556339(0x1db)];[_0x556339(0x1cf)];[_0x556339(0x1d2)];[_0x556339(0x1d3)];constructor(_0x308f41,{part:_0x371e4b,uiIndex:_0x397714,areActionsDisabled:_0x208bd0,availableActions:_0x4f3379}){const _0x251d26=_0x556339;super(_0x308f41),this[_0x251d26(0x1b8)](_0x251d26(0x1c0),_0x371e4b),this[_0x251d26(0x1b8)](_0x251d26(0x19b),_0x251d26(0x1c1)),this[_0x251d26(0x1b8)](_0x251d26(0x1bd),!0x1),this[_0x251d26(0x194)](_0x251d26(0x1d7))['to'](this,_0x251d26(0x19b),_0x255a78=>_0x251d26(0x1c1)==_0x255a78&&!_0x208bd0),this[_0x251d26(0x1cf)]=this[_0x251d26(0x1cb)](),this[_0x251d26(0x1db)]=new _0x1debe5({'textNodeStyle':_0x251d26(0x1b4),'delay':0x14}),this[_0x251d26(0x1d2)]=new Un(_0x308f41,{'part':_0x371e4b,'uiIndex':_0x397714,'availableActions':_0x4f3379}),this[_0x251d26(0x1d2)][_0x251d26(0x194)](_0x251d26(0x1c0))['to'](this),this[_0x251d26(0x1d2)][_0x251d26(0x194)](_0x251d26(0x1d7))['to'](this),this[_0x251d26(0x1d2)][_0x251d26(0x194)](_0x251d26(0x19b))['to'](this),this[_0x251d26(0x1d2)][_0x251d26(0x1a3)](..._0xacb148)['to'](this);const _0xa6444a=this[_0x251d26(0x1bc)];this[_0x251d26(0x1d3)]=new _0x15e7bf(),this[_0x251d26(0x1d3)][_0x251d26(0x1aa)]({'tag':_0x251d26(0x1dd),'attributes':{'class':['ck',_0x251d26(0x18f),_0x251d26(0x1d9),_0x251d26(0x192)]}}),this[_0x251d26(0x1cf)][_0x251d26(0x1b7)]([this[_0x251d26(0x1d3)]]),this[_0x251d26(0x1aa)]({'tag':_0x251d26(0x1dd),'attributes':{'class':['ck',_0x251d26(0x1c2),_0xa6444a['to'](_0x251d26(0x19b),_0x15eb90=>_0x251d26(0x1da)+_0x15eb90),_0xa6444a['to'](_0x251d26(0x1d7),_0x572af4=>_0x572af4?_0x251d26(0x1b6):void 0x0),_0xa6444a['if'](_0x251d26(0x1bd),_0x251d26(0x1d8),_0x510117=>!_0x510117)]},'children':this[_0x251d26(0x1cf)],'on':{'mouseenter':_0xa6444a['to'](()=>{const _0x1310cb=_0x251d26;this[_0x1310cb(0x1d7)]&&this[_0x1310cb(0x1d6)](_0x1310cb(0x1cd),{'index':_0x371e4b[_0x1310cb(0x1d0)]});}),'mouseleave':_0xa6444a['to'](()=>{const _0x282a4f=_0x251d26;this[_0x282a4f(0x1d7)]&&this[_0x282a4f(0x1d6)](_0x282a4f(0x1c7),{'index':_0x371e4b[_0x282a4f(0x1d0)]});})}});}async[_0x556339(0x1a5)]({part:_0x1e1011,renderingStrategy:_0x5aba41,showUnchangedParts:_0x213545=!0x1,abortSignal:_0x40c027}){const _0x38cf14=_0x556339;this[_0x38cf14(0x1c0)]=_0x1e1011,this[_0x38cf14(0x1bd)]=this[_0x38cf14(0x1c0)][_0x38cf14(0x1a7)]||_0x213545,this[_0x38cf14(0x1bd)]&&(_0x38cf14(0x1c3)===_0x5aba41?await this[_0x38cf14(0x1db)][_0x38cf14(0x193)]({'document':this[_0x38cf14(0x1c0)][_0x38cf14(0x1a1)],'targetElement':this[_0x38cf14(0x1d3)][_0x38cf14(0x1ab)],'abortSignal':_0x40c027}):this[_0x38cf14(0x1d3)][_0x38cf14(0x1ab)][_0x38cf14(0x1cc)]=_0x214ee0(this[_0x38cf14(0x1c0)][_0x38cf14(0x1a1)]));}[_0x556339(0x19a)](_0x312327){const _0x19644b=_0x556339;_0x312327?this[_0x19644b(0x1cf)][_0x19644b(0x1ca)](this[_0x19644b(0x1d2)])||this[_0x19644b(0x1cf)][_0x19644b(0x1a0)](this[_0x19644b(0x1d2)],0x0):this[_0x19644b(0x1cf)][_0x19644b(0x1ca)](this[_0x19644b(0x1d2)])&&this[_0x19644b(0x1cf)][_0x19644b(0x1ac)](this[_0x19644b(0x1d2)]);}}class Un extends _0x15e7bf{[_0x556339(0x1cf)];[_0x556339(0x1b9)];[_0x556339(0x190)];[_0x556339(0x1a6)];[_0x556339(0x1b3)];constructor(_0x23d25b,{part:_0xa50941,uiIndex:_0x442b84,availableActions:_0x1f8d6d}){const _0x6152c7=_0x556339;super(_0x23d25b),this[_0x6152c7(0x1b8)](_0x6152c7(0x1c0),_0xa50941),this[_0x6152c7(0x1b8)](_0x6152c7(0x1d7),!0x0),this[_0x6152c7(0x1b8)](_0x6152c7(0x19b),_0x6152c7(0x1c1));const _0x22b748=new _0x4b7e97();_0x22b748[_0x6152c7(0x1a1)]=_0x3d737c,_0x22b748[_0x6152c7(0x1a4)]({'attributes':{'class':[_0x6152c7(0x1b5)]}});const _0x219579=[];if(_0x1f8d6d[_0x6152c7(0x19c)](_0x6152c7(0x19d))){const _0x38138c=new _0x53bdf5(_0x23d25b);_0x38138c[_0x6152c7(0x1b8)]({'label':_0x4f586c(_0x23d25b,_0x6152c7(0x1c8)),'tooltip':!0x0,'withText':!0x1,'icon':_0x238493}),_0x38138c[_0x6152c7(0x194)](_0x6152c7(0x1d7))['to'](this),_0x38138c['on'](_0x6152c7(0x1ce),()=>{const _0x5ecd0a=_0x6152c7;this[_0x5ecd0a(0x1d6)](_0x5ecd0a(0x19d),{'index':_0xa50941[_0x5ecd0a(0x1d0)]});}),_0x219579[_0x6152c7(0x1ba)](_0x38138c);}if(_0x1f8d6d[_0x6152c7(0x19c)](_0x6152c7(0x1c5))){const _0x764007=new _0x53bdf5(_0x23d25b);_0x764007[_0x6152c7(0x1b8)]({'label':_0x4f586c(_0x23d25b,_0x6152c7(0x1de)),'tooltip':!0x0,'withText':!0x1,'icon':_0x3c0436}),_0x764007[_0x6152c7(0x194)](_0x6152c7(0x1d7))['to'](this),_0x764007['on'](_0x6152c7(0x1ce),()=>{const _0x140c25=_0x6152c7;this[_0x140c25(0x1d6)](_0x140c25(0x1c5),{'index':_0xa50941[_0x140c25(0x1d0)]});}),_0x219579[_0x6152c7(0x1ba)](_0x764007);}const _0x16f74f=new _0x53bdf5(_0x23d25b);_0x16f74f[_0x6152c7(0x1b8)]({'label':_0x4f586c(_0x23d25b,_0x6152c7(0x1d4)),'tooltip':!0x0,'withText':!0x1,'icon':_0x83133}),_0x16f74f[_0x6152c7(0x194)](_0x6152c7(0x1d7))['to'](this),_0x16f74f['on'](_0x6152c7(0x1ce),()=>{const _0x413606=_0x6152c7;this[_0x413606(0x1d6)](_0x413606(0x1d5),{'index':_0xa50941[_0x413606(0x1d0)]});}),_0x219579[_0x6152c7(0x1ba)](_0x16f74f),this[_0x6152c7(0x1b9)]=new _0x1913d3(_0x23d25b),this[_0x6152c7(0x1b9)][_0x6152c7(0x18e)][_0x6152c7(0x1b7)](_0x219579),this[_0x6152c7(0x190)]=new _0x4b7e97(),this[_0x6152c7(0x190)][_0x6152c7(0x1a1)]=_0x5635cf,this[_0x6152c7(0x190)][_0x6152c7(0x1a4)]({'attributes':{'class':[_0x6152c7(0x1a8)],'data-cke-tooltip-text':_0x4f586c(_0x23d25b,_0x6152c7(0x1ae)),'data-cke-tooltip-position':'n'}}),this[_0x6152c7(0x1a6)]=new _0x4b7e97(),this[_0x6152c7(0x1a6)][_0x6152c7(0x1a1)]=_0x5993f9,this[_0x6152c7(0x1a6)][_0x6152c7(0x1a4)]({'attributes':{'class':[_0x6152c7(0x1dc)],'data-cke-tooltip-text':_0x4f586c(_0x23d25b,_0x6152c7(0x1a9)),'data-cke-tooltip-position':'n'}}),this[_0x6152c7(0x1b3)]=new _0x4b7e97(),this[_0x6152c7(0x1b3)][_0x6152c7(0x1a1)]=_0x5993f9,this[_0x6152c7(0x1b3)][_0x6152c7(0x1a4)]({'attributes':{'class':[_0x6152c7(0x198)],'data-cke-tooltip-text':_0x4f586c(_0x23d25b,_0x6152c7(0x1d1)),'data-cke-tooltip-position':'n'}});const _0x690404=new _0x15e7bf(_0x23d25b);_0x690404[_0x6152c7(0x1aa)]({'tag':_0x6152c7(0x1c4),'attributes':{'class':['ck',_0x6152c7(0x19f)]},'children':[_0x4f586c(_0x23d25b,_0x6152c7(0x1bb),_0x442b84[_0x6152c7(0x196)]())]}),this[_0x6152c7(0x1cf)]=this[_0x6152c7(0x1cb)](),this[_0x6152c7(0x1cf)][_0x6152c7(0x1b7)]([_0x22b748,_0x690404,this[_0x6152c7(0x1b9)]]),this[_0x6152c7(0x1aa)]({'tag':_0x6152c7(0x1dd),'attributes':{'class':['ck',_0x6152c7(0x1d9),_0x6152c7(0x19e)]},'children':this[_0x6152c7(0x1cf)]}),this['on'](_0x6152c7(0x1c6),(_0x7ee45,_0x4ea0ca,_0x3b8084,_0x38e022)=>{const _0x60439d=_0x6152c7;switch(_0x38e022){case _0x60439d(0x1c1):this[_0x60439d(0x1cf)][_0x60439d(0x1ac)](this[_0x60439d(0x1b9)]);break;case _0x60439d(0x1bf):this[_0x60439d(0x1cf)][_0x60439d(0x1ac)](this[_0x60439d(0x190)]);break;case _0x60439d(0x197):this[_0x60439d(0x1cf)][_0x60439d(0x1ac)](this[_0x60439d(0x1a6)]);break;case _0x60439d(0x1b0):this[_0x60439d(0x1cf)][_0x60439d(0x1ac)](this[_0x60439d(0x1b3)]);}switch(_0x3b8084){case _0x60439d(0x1c1):this[_0x60439d(0x1cf)][_0x60439d(0x1a0)](this[_0x60439d(0x1b9)]);break;case _0x60439d(0x1bf):this[_0x60439d(0x1cf)][_0x60439d(0x1a0)](this[_0x60439d(0x190)]);break;case _0x60439d(0x197):this[_0x60439d(0x1cf)][_0x60439d(0x1a0)](this[_0x60439d(0x1a6)]);break;case _0x60439d(0x1b0):this[_0x60439d(0x1cf)][_0x60439d(0x1a0)](this[_0x60439d(0x1b3)]);}});}}