@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
28 lines • 193 kB
JavaScript
/*
* Copyright (c) 2003-2026, 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. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
import{Editor as _0x1f8384,ContextPlugin as _0x152fb7,PendingActions as lt,Command as _0x39b56b,Plugin as _0x165a5f,Context as _0x4eea4a}from'@ckeditor/ckeditor5-core/dist/index.js';import{ObservableMixin as _0x41c8cb,uid as _0x4c5e37,KeystrokeHandler as jt,FocusTracker as _0x5f5319,diff as _0x52b175,Collection as _0x139e96,Rect as _0x3f14b6,CKEditorError as _0x266f92,first as _0x49bf05,priorities as Wt,scrollViewportToShowTarget as nt,getEnvKeystrokeText as tt,toUnit as Ht,DomEmitterMixin as _0x2bb24d,keyCodes as _0x63f92}from'@ckeditor/ckeditor5-utils/dist/index.js';import{UserView as _0x193858,AriaDescriptionView as Yt,setupThreadKeyboardNavigation as Zt,ConfirmMixin as ti,LateFocusButtonView as _0x188cb3,trimHtml as ts,LateFocusDropdownButtonView as _0x539736,Users as it,getDateTimeFormatter as pt,hashObject as It,getAllMarkersDomElementsSorted as et,surroundingMarkersDetector as rt,FOCUS_ANNOTATION_KEYSTROKE as _0x355e93}from'ckeditor5-collaboration/dist/index.js';import{throttle as Dt,isEqual as At,cloneDeep as wt,set as yt,unset as Ct,debounce as _0x3b904d}from'es-toolkit/compat';import{IconUndo as _0x130a47,IconCheck as _0x2a328a,IconPencil as _0x5939de,IconRemoveComment as _0x92b88,IconThreeVerticalDots as _0x44b678,IconAddComment as _0x1b49ba,IconCommentsArchive as _0x54b5f6}from'@ckeditor/ckeditor5-icons/dist/index.js';import{EditorUIView as $t,InlineEditableUIView as Vt,EditorUI as Ut,View as kt,FocusCycler as _0x140f1f,ButtonView as _0x47a354,ViewCollection as _0x577399,createDropdown as _0x3deee8,ListView as _0x5ca25c,focusChildOnDropdownOpen as _0x1518f9,ListItemView as _0x365663,MenuBarMenuListItemButtonView as _0x320df3,BodyCollection as _0x530e58,BalloonPanelView as _0x4534d9,ContextualBalloon as _0x15b3ff,Dialog as _0x20864c,DialogViewPosition as _0x22636}from'@ckeditor/ckeditor5-ui/dist/index.js';import{disableViewPlaceholder as St,enableViewPlaceholder as Ft,MouseObserver as _0x1cac50}from'@ckeditor/ckeditor5-engine/dist/index.js';import{Clipboard as qt,ClipboardMarkersUtils as Mt,ClipboardPipeline as Pt}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{Enter as zt,ShiftEnter as Bt}from'@ckeditor/ckeditor5-enter/dist/index.js';import{SelectAll as Gt}from'@ckeditor/ckeditor5-select-all/dist/index.js';import{Typing as Jt}from'@ckeditor/ckeditor5-typing/dist/index.js';import{Undo as Kt}from'@ckeditor/ckeditor5-undo/dist/index.js';import{Paragraph as Lt}from'@ckeditor/ckeditor5-paragraph/dist/index.js';import{FOCUS_ANNOTATION_KEYSTROKE as _0x3b0de7}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{toWidget as _0x4359cf}from'@ckeditor/ckeditor5-widget/dist/index.js';class vt extends/* #__PURE__ -- @preserve */
_0x41c8cb(){['model'];['view'];constructor(_0x35177d,_0x61bc16){super(),this['model']=_0x35177d,this['model']['_isAttached']=!0x0,this['view']=_0x61bc16,this['listenTo'](_0x61bc16,'submitCommentThread',()=>this['submit']()),this['listenTo'](_0x61bc16,'removeCommentThread',()=>this['remove']()),this['listenTo'](_0x61bc16,'resolveCommentThread',()=>this['resolve']()),this['listenTo'](_0x61bc16,'reopenCommentThread',()=>this['reopen']()),this['listenTo'](_0x61bc16,'addComment',(_0x5e0975,_0xb98570)=>this['addComment'](_0xb98570)),this['listenTo'](_0x61bc16,'updateComment',(_0x5c2753,_0x5dc974,_0x5ecfdc)=>this['updateComment'](_0x5dc974,_0x5ecfdc)),this['listenTo'](_0x61bc16,'removeComment',(_0x133a12,_0x3cd7c4)=>this['removeComment'](_0x3cd7c4));}['submit'](){this['model']['submit']();}['remove'](){this['model']['remove']();}['resolve'](){this['model']['isResolved']||this['model']['resolve']();}['reopen'](){this['model']['isResolved']&&this['model']['reopen']();}['addComment'](_0x1ffbf4){this['model']['addComment']({'content':_0x1ffbf4,'authorId':this['view']['_localUser']['id']});}['updateComment'](_0x2def70,_0x14031d){this['model']['getComment'](_0x2def70)['update']({'content':_0x14031d});}['removeComment'](_0x900bb7){this['model']['getComment'](_0x900bb7)['remove']();}['destroy'](){this['stopListening'](),this['model']['_isAttached']=!0x1;}}function N(_0x14d22b,_0x58bdc0,_0x149b13){const t=_0x14d22b['t'];switch(_0x58bdc0){case'PENDING_ACTION_COMMENT_THREAD':return t({'string':'Unsaved\x20change\x20in\x20comment\x20thread.','id':'PENDING_ACTION_COMMENT_THREAD'});case'Comment':return t('Comment');case'Reply...':return t('Reply...');case'Reply\x20to\x20reopen\x20discussion...':return t('Reply\x20to\x20reopen\x20discussion...');case'Write\x20a\x20comment...':return t('Write\x20a\x20comment...');case'Comment\x20was\x20made\x20on\x20an\x20element':return t('Comment\x20was\x20made\x20on\x20an\x20element');case'Comment\x20editor':return t('Comment\x20editor');case'Delete\x20comment\x20thread?':return t('Delete\x20comment\x20thread?');case'Delete\x20comment?':return t('Delete\x20comment?');case'Marked\x20as\x20resolved':return t('Marked\x20as\x20resolved');case'Show\x20more\x20items':return t('Show\x20more\x20items');case'Cancel':return t('Cancel');case'Edit':return t('Edit');case'Resolve':return t('Resolve');case'Reopen':return t('Reopen');case'Remove':return t('Remove');case'Reply':return t('Reply');case'Save':return t('Save');case'Annotations\x20sidebar':return t('Annotations\x20sidebar');case'Annotations\x20list':return t('Annotations\x20list');case'Thread\x20comments':return t('Thread\x20comments');case'THREAD_CONTEXT_LABEL':return t({'string':'Thread\x20context:\x20%0','id':'THREAD_CONTEXT_LABEL'},_0x149b13);case'COMMENT_THREAD_LABEL':return t({'string':'Comment\x20thread\x20by\x20%1.\x20%1\x20reply.','plural':'Comment\x20thread\x20by\x20%1.\x20%0\x20replies.','id':'COMMENT_THREAD_LABEL'},_0x149b13);case'COMMENT_THREAD_DESCRIPTION':return t({'string':'Press\x20Enter\x20for\x20more\x20options.\x20Press\x20Escape\x20to\x20exit.','id':'COMMENT_THREAD_DESCRIPTION'});case'COMMENT_ARIA_LABEL':return t({'string':'Comment\x20by\x20%0.\x20Created\x20on\x20%1.\x20%2.\x20%3','id':'COMMENT_ARIA_LABEL'},_0x149b13);case'LEAVE_COMMENT_ANNOUNCEMENT':return t({'string':'Leaving\x20a\x20content\x20with\x20comments.','id':'LEAVE_COMMENT_ANNOUNCEMENT'});case'ENTER_COMMENT_ANNOUNCEMENT':return t({'string':'Entering\x20a\x20content\x20with\x20comments.\x20Press\x20%0\x20to\x20go\x20to\x20the\x20discussion.','id':'ENTER_COMMENT_ANNOUNCEMENT'},_0x149b13);case'NUMBER_OF_COMMENTS':return t({'string':'%0\x20Comment','plural':'%0\x20Comments','id':'NUMBER_OF_COMMENTS'},_0x149b13);case'TOO_LONG_COMMENT_ALERT':return t({'string':'Comment\x20content\x20is\x20too\x20long.\x20Your\x20comment\x20has\x20%0\x20characters\x20but\x20the\x20limit\x20is\x20%1\x20characters.','id':'TOO_LONG_COMMENT_ALERT'},_0x149b13);case'EXTERNAL_COMMENT':return t({'string':'This\x20comment\x20comes\x20from\x20an\x20external\x20source.','id':'EXTERNAL_COMMENT'});case'EXTERNAL_IMPORT_WORD_COMMENT':return t({'string':'This\x20comment\x20comes\x20from\x20an\x20imported\x20Word\x20file.','id':'EXTERNAL_IMPORT_WORD_COMMENT'});case'EXTERNAL_AVATAR':return t({'string':'Displayed\x20author\x20name\x20comes\x20from\x20external\x20source\x20(added\x20by\x20%0)','id':'EXTERNAL_AVATAR'},_0x149b13);case'EXTERNAL_IMPORT_WORD_AVATAR':return t({'string':'Displayed\x20author\x20name\x20comes\x20from\x20a\x20Word\x20document\x20imported\x20by\x20%0','id':'EXTERNAL_IMPORT_WORD_AVATAR'},_0x149b13);case'COMMENTS_ARCHIVE':return t({'string':'Comments\x20archive','id':'COMMENTS_ARCHIVE'});case'EMPTY_COMMENTS_ARCHIVE':return t({'string':'There\x20are\x20no\x20archived\x20comment\x20threads.','id':'EMPTY_COMMENTS_ARCHIVE'});case'COMMENTS_ARCHIVE_LIST_LABEL':return t({'string':'List\x20of\x20comments','id':'COMMENTS_ARCHIVE_LIST_LABEL'});case'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP':return t({'string':'Keystrokes\x20for\x20interacting\x20with\x20annotation\x20threads\x20(e.g.\x20comments,\x20track\x20changes\x20suggestions)','id':'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'});case'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO':return t({'string':'Move\x20focus\x20to\x20the\x20thread\x20when\x20the\x20selection\x20is\x20anchored\x20in\x20its\x20marker','id':'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'});case'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT':return t({'string':'Exit\x20the\x20annotation\x20and\x20move\x20focus\x20back\x20to\x20the\x20edited\x20content','id':'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'});case'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER':return t({'string':'Browse\x20the\x20focused\x20annotation\x20thread\x20or\x20thread\x20comment','id':'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'});case'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS':return t({'string':'Move\x20across\x20internals\x20of\x20the\x20annotation\x20thread','id':'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'});case'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT':return t({'string':'Submit\x20the\x20reply\x20while\x20writing\x20a\x20comment','id':'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'});case'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS':return t({'string':'Move\x20to\x20the\x20previous\x20or\x20next\x20thread\x20in\x20the\x20annotations\x20sidebar\x20or\x20comments\x20archive','id':'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'});default:return'';}}class Rt extends $t{['main'];['editable'];constructor(_0x923db3,_0x1d166b){super(_0x923db3);const _0x2cf00b=_0x4c5e37();this['main']=this['createCollection'](),this['editable']=new Vt(_0x923db3,_0x1d166b,void 0x0,{'label':()=>N(_0x923db3,'Comment\x20editor')}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-editor','ck-rounded-corners','ck-comment__input'],'dir':_0x923db3['uiLanguageDirection'],'lang':_0x923db3['uiLanguage'],'aria-labelledby':'cke-editor__aria-label_'+_0x2cf00b},'children':[{'tag':'div','attributes':{'class':'ck-editor__main','role':'presentation'},'children':this['main']}]});}['render'](){super['render'](),this['main']['add'](this['editable']);}['focus'](){this['editable']['element']['focus']();}}class Et extends Ut{['view'];constructor(_0x51911d){super(_0x51911d),this['view']=new Rt(_0x51911d['locale'],_0x51911d['editing']['view']);}get['element'](){return this['view']['element'];}['init'](){const _0x317777=this['editor']['editing']['view'],_0xb9bd04=this['view']['editable'],_0x2e7663=_0x317777['document']['getRoot']();_0xb9bd04['name']=_0x2e7663['rootName'],this['view']['render']();const _0x3d5294=_0xb9bd04['element'];this['setEditableElement'](_0xb9bd04['name'],_0x3d5294),this['view']['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x317777['attachDomRoot'](_0x3d5294),this['fire']('ready');}['destroy'](){super['destroy'](),this['view']['destroy']();}}const Qt=[qt,zt,Bt,Gt,Jt,Kt,Lt];class hs extends/* #__PURE__ -- @preserve */
_0x41c8cb(_0x1f8384){static ['defaultPlugins']=/* #__PURE__ -- @preserve */
((()=>Qt)());constructor(_0x3c4fe9={}){function _0x3cddeb(_0x4d3ce4){return _0x4d3ce4['map'](_0x285a6a=>String['fromCharCode'](_0x285a6a))['join']('');}(_0x3c4fe9=Object['assign']({},_0x3c4fe9))['plugins']||(_0x3c4fe9['plugins']=hs['defaultPlugins']),super(_0x3c4fe9),this['ui']=new Et(this),this['set']('placeholder',''),this['model']['document']['on']('change',()=>this['_updatePlaceholder'](),{'priority':'low'}),this['on']('change:placeholder',()=>this['_updatePlaceholder']()),this['model']['document']['createRoot'](),this[_0x3cddeb([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3cddeb([0x76,0x69,0x65,0x77])][_0x3cddeb([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3cddeb([0x61,0x75,0x74,0x6f]),this[_0x3cddeb([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74])]=()=>window[_0x3cddeb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3cddeb([0x72,0x65,0x73,0x6f,0x6c,0x76,0x65])]({[_0x3cddeb([0x73,0x74,0x61,0x74,0x75,0x73])]:_0x3cddeb([0x6f,0x6b])});}['create'](){const _0x5e5868=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x5e5868))['then'](()=>this['fire']('ready'));}['destroy'](){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0xc18d11=>{const _0x3ef22d=this['model']['document']['getRoot'](),_0x4879d3=_0x3ef22d&&_0x3ef22d['getChild'](_0x3ef22d['childCount']-0x1);_0xc18d11['setSelection'](_0x4879d3,'end'),this['editing']['view']['focus']();});}['_updatePlaceholder'](){const _0x44bae1=this['editing']['view'],_0x49cd6b=_0x44bae1['document']['getRoot'](),_0x524568=_0x49cd6b['getChild'](0x0);_0x49cd6b['childCount']>0x1||!_0x524568||'p'!=_0x524568['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(St(_0x44bae1,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x524568['placeholder']=this['placeholder']),Ft({'view':_0x44bae1,'element':_0x524568,'keepOnFocus':!0x0}),this['placeholderElement']=_0x524568);}}class es extends kt{['keystrokes'];['focusTracker'];['focusables'];['focusCycler'];['submitButtonView'];['cancelButtonView'];['_editorConfig'];constructor(_0x532e96,_0x3375e1={}){super(_0x532e96),this['editor']=null,this['_editorConfig']=_0x3375e1,this['set']('value',_0x3375e1['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',N(_0x532e96,'Reply...')),this['set']('submitLabel',N(_0x532e96,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['submitButtonView'],this['cancelButtonView']]),this['keystrokes']=new jt(),this['focusTracker']=new _0x5f5319(),this['focusCycler']=new _0x140f1f({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-comment__input-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-comment__input-actions',this['bindTemplate']['if']('showButtons','ck-comment__input-actions--active')]},'children':[this['submitButtonView'],this['cancelButtonView']]}]}),this['keystrokes']['set']('Esc',(_0x24dd75,_0x24ba18)=>{this['cancelButtonView']['fire']('execute'),_0x24ba18();}),this['keystrokes']['set']('Ctrl+Enter',(_0x3b56d0,_0x3ee3b5)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x3ee3b5());}),this['on']('submit',(_0x34139d,_0x31e5db)=>{_0x31e5db['length']>0xfde8?(alert(N(_0x532e96,'TOO_LONG_COMMENT_ALERT',[_0x31e5db['length'],0xfde8])),_0x34139d['stop']()):this['editor']['setData']('');},{'priority':'high'});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}['createEditor'](){return this['editor']||(this['editor']=new hs(this['_editorConfig']),this['_editorCreationPromise']=this['editor']['create']()['then'](()=>{if(this['_isDestroyed'])return;const _0x16aa56=this['editor'];this['element']['insertBefore'](_0x16aa56['ui']['element'],this['element']['firstChild']),_0x16aa56['model']['document']['on']('change',()=>this['value']=_0x16aa56['getData']()),_0x16aa56['bind']('placeholder')['to'](this),this['focusables']['add'](_0x16aa56['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x4638a8){-0x1===_0x4638a8?(this['focusCycler']['focusFirst'](),this['focusCycler']['focusLast']()):this['focusCycler']['focusFirst']();}async['destroy'](){this['_isDestroyed']||(this['_isDestroyed']=!0x0,this['editor']&&(await this['_editorCreationPromise'],await this['editor']['destroy'](),this['fire']('editorDestroyed',this['editor'])),await super['destroy']());}['_createSubmitButton'](){const {locale:_0x9d630}=this,_0x52d7e6=new _0x47a354(_0x9d630);return _0x52d7e6['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--submit']}}),_0x52d7e6['withText']=!0x0,_0x52d7e6['bind']('label')['to'](this,'submitLabel'),_0x52d7e6['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x52d7e6['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x536e64,_0x168a8c)=>!_0x168a8c&&!!_0x536e64['trim']()),_0x52d7e6;}['_createCancelButton'](){const {locale:_0x4b32b5}=this,_0x33c61f=new _0x47a354(_0x4b32b5);return _0x33c61f['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x33c61f['label']=N(_0x4b32b5,'Cancel'),_0x33c61f['withText']=!0x0,_0x33c61f['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x33c61f;}['_setupKeyboardNavigation'](){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x5d789f=>{this['focusTracker']['add'](_0x5d789f['element']);}),this['focusables']['on']('change',(_0x46e03d,_0x472025)=>{for(const _0x1a79cd of Array['from'](_0x472025['added'])['reverse']())this['focusTracker']['add'](_0x1a79cd['element']);});}}class ie extends kt{constructor(_0x186388,_0x4c9eb5,_0x28ca93){super(_0x186388),this['commentInputView']=new es(_0x186388,_0x28ca93),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x4adc72,_0x2d4e40)=>_0x4adc72||!!_0x2d4e40),this['set']('showInput',!0x1),this['on']('change:showInput',()=>{this['showInput']&&!this['commentInputView']['editor']&&this['commentInputView']['createEditor']();}),this['commentInputView']['delegate']('editorReady')['to'](this),this['commentInputView']['delegate']('editorDestroyed')['to'](this),this['userView']=new _0x193858(_0x186388,_0x4c9eb5),this['userView']['extendTemplate']({'attributes':{'class':'ck-thread__user','aria-hidden':!0x0}}),this['commentInputView']['extendTemplate']({'attributes':{'class':'ck-thread__input'}}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-comment__input-container',this['bindTemplate']['if']('showInput','ck-comment__input-container--active')]},'children':[this['userView'],this['commentInputView']]});}['render'](){super['render'](),this['_focusOnNonInteractiveMouseDown']();}['destroy'](){return this['commentInputView']['destroy']()['then'](()=>super['destroy']());}['focus'](_0x32f95c){this['commentInputView']['focus'](_0x32f95c);}['_focusOnNonInteractiveMouseDown'](){this['listenTo'](this['element'],'mousedown',(_0x21b9a3,_0x2ee8cd)=>{const {submitButtonView:_0x464707,cancelButtonView:_0x16df27,editor:_0x3386de}=this['commentInputView'];[_0x464707['element'],_0x16df27['element'],_0x3386de?_0x3386de['editing']['view']['getDomRoot']():null]['filter'](_0x4c0274=>_0x4c0274)['some'](_0xe054f=>_0xe054f['contains'](_0x2ee8cd['target']))||(this['focus'](),_0x2ee8cd['preventDefault']());});}}class rs extends kt{constructor(_0x22f4cc){super(_0x22f4cc);const _0x50de5d=this['bindTemplate'];this['set']('count',void 0x0),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[{'text':_0x50de5d['to']('count',_0x143643=>N(_0x22f4cc,'NUMBER_OF_COMMENTS',_0x143643))}]});}}class te extends kt{['commentViews'];['resolvedCommentView'];['focusTracker'];['keystrokes'];['focusCycler'];['_model'];['_config'];['_collapsedCommentsView'];constructor(_0x2f4030,_0x9ab699,_0x5781f3){super(_0x2f4030);const _0x3343b3=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x9ab699['comments']['length']),this['set']('isActive',!0x1),this['_model']=_0x9ab699,this['_config']=_0x5781f3,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x5f5319(),this['keystrokes']=new jt(),this['focusCycler']=new _0x140f1f({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x360176=>this['commentViews']['map'](_0x571d04=>_0x571d04['element'])['includes'](_0x360176['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new rs(_0x2f4030),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x239242=>_0x239242-this['_config']['maxCommentsWhenCollapsed']);for(const _0x4eb311 of _0x9ab699['comments'])this['_handleNewCommentModel'](_0x4eb311);this['_handleInfoComment'](),this['listenTo'](_0x9ab699['comments'],'add',(_0x3514,_0x49de90)=>{const _0x1906df=this['_calculatePosition'](_0x49de90);this['length']++,this['_handleNewCommentModel'](_0x49de90,_0x1906df),this['refreshVisibleViews']();}),this['listenTo'](_0x9ab699['comments'],'remove',(_0x5994c5,_0x4e5a28)=>{this['length']--,this['_handleRemoveCommentModel'](_0x4e5a28),this['refreshVisibleViews']();}),this['listenTo'](_0x9ab699,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x9ab699,'change:isResolved',()=>this['_handleInfoComment']()),this['on']('change:isActive',()=>this['refreshVisibleViews']()),this['on']('change:hasDirtyComment',()=>this['refreshVisibleViews']()),this['setTemplate']({'tag':'ul','attributes':{'class':['ck-thread__comments',_0x3343b3['if']('length','ck-hidden',_0x2f3031=>!_0x2f3031)],'aria-label':N(_0x2f4030,'Thread\x20comments')},'children':this['visibleViews']});}get['_shouldCollapse'](){return this['_model']['weight']>this['_config']['maxThreadTotalWeight']&&!this['isActive']&&!this['hasDirtyComment'];}['render'](){super['render'](),this['refreshVisibleViews'](),this['_setupKeyboardNavigation']();}['focus'](_0x2e1e2b){-0x1===_0x2e1e2b?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['destroy'](){this['_collapsedCommentsView']['destroy']();for(const _0x33cfd2 of this['commentViews'])_0x33cfd2['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}['_handleNewCommentModel'](_0x5a1b5f,_0x39fb16){const _0x133917=new this['_config']['CommentView'](this['locale'],_0x5a1b5f,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x133917['viewUid']=_0x5a1b5f['id'],_0x133917['delegate']('removeComment')['to'](this),_0x133917['delegate']('updateComment')['to'](this),_0x133917['delegate']('resolveCommentThread')['to'](this),_0x133917['delegate']('editorReady')['to'](this),_0x133917['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x133917,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x133917,_0x39fb16);}['_calculatePosition'](_0x4ca0e7){const _0xaaee6c=this['_model']['_findOptimalIndex'](_0x4ca0e7);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x4ca0e7['authoredAt']?_0xaaee6c-0x1:_0xaaee6c:_0xaaee6c-0x1;}['_handleInfoComment'](){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x56eb59={'id':'resolved','author':this['_model']['resolvedBy'],'authoredAt':this['_model']['resolvedAt'],'content':N(this['locale'],'Marked\x20as\x20resolved'),'attributes':{}};this['resolvedCommentView']=new this['_config']['CommentView'](this['locale'],_0x56eb59,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x56eb59));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}['_handleRemoveCommentModel'](_0x232955){const _0xe272c2=this['commentViews']['remove'](_0x232955['id']);this['stopListening'](_0xe272c2),_0xe272c2['isEditMode']&&this['_updateHasDirtyComment'](),_0xe272c2['destroy']();}['_updateHasDirtyComment'](){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x1ea64c=>_0x1ea64c['isEditMode']);}['_rearrangeCollapse'](){const _0x3aef9a=function(_0x381723){const _0xc579d=new _0x139e96();for(const _0x29819c of _0x381723)_0xc579d['add'](_0x29819c);return _0xc579d;}(this['commentViews']),_0x3a6c23=this['_collapsedCommentsView']['count'];for(let _0x39bf2f=0x1;_0x39bf2f<=_0x3a6c23;_0x39bf2f++)_0x3aef9a['remove'](0x1);for(const _0x4b8a0b of _0x3aef9a)_0x4b8a0b['collapse']();_0x3a6c23>0x0&&_0x3aef9a['add'](this['_collapsedCommentsView'],0x1),ns(_0x52b175(Array['from'](this['visibleViews']),Array['from'](_0x3aef9a)),this['visibleViews'],_0x3aef9a);}['_rearrangeExpand'](){ns(_0x52b175(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x111ed6 of this['visibleViews'])_0x111ed6['expand']();}['_setupKeyboardNavigation'](){this['commentViews']['forEach'](_0x539bcb=>{this['focusTracker']['add'](_0x539bcb['element']),this['keystrokes']['listenTo'](_0x539bcb['element']);}),this['commentViews']['on']('change',(_0x1ae5d9,_0x47aafd)=>{for(const _0x328654 of _0x47aafd['removed'])this['focusTracker']['remove'](_0x328654['element']),this['keystrokes']['stopListening'](_0x328654['element']);for(const _0x4cf4f1 of Array['from'](_0x47aafd['added'])['reverse']())this['focusTracker']['add'](_0x4cf4f1['element']),this['keystrokes']['listenTo'](_0x4cf4f1['element']);});}}function ns(_0xdd8c44,_0x49dbe2,_0x273ecf){let _0x5e87b8=0x0;for(const _0x5bb72a of _0xdd8c44)switch(_0x5bb72a){case'insert':_0x49dbe2['add'](_0x273ecf['get'](_0x5e87b8),_0x5e87b8),_0x5e87b8++;break;case'delete':_0x49dbe2['remove'](_0x5e87b8);break;case'equal':_0x5e87b8++;}}class oe extends kt{constructor(_0x4a4f13){super(_0x4a4f13);const _0x4e6007=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x4e6007['to']('contextValue',_0x127637=>N(_0x4a4f13,'THREAD_CONTEXT_LABEL',_0x127637)),'tabindex':-0x1},'children':[{'text':_0x4e6007['to']('contextValue')}]});}['focus'](){this['element']['focus']();}}class Xt extends kt{['_model'];['reopenButtonView'];['contextView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];constructor(_0x2b150d,_0x377fa5){super(_0x2b150d);const _0x2bcdcd=this['bindTemplate'];this['_model']=_0x377fa5,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x5f5319(),this['keystrokes']=new jt(),this['focusCycler']=new _0x140f1f({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x5a6a75=>!!_0x5a6a75),this['bind']('contextValue')['to'](this['_model'],'context',_0x3b46ea=>_0x3b46ea&&_0x3b46ea['value']?this['_trimContextValue'](_0x3b46ea['value']):N(this['locale'],'Comment\x20was\x20made\x20on\x20an\x20element')),this['setTemplate']({'tag':'div','attributes':{'class':['ck-thread__header']},'children':[{'tag':'div','attributes':{'class':['ck-context-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-context',_0x2bcdcd['if']('hasContext','ck-context--quotes')]},'children':[this['contextView']]}]},{'tag':'div','attributes':{'class':['ck-annotation__actions']},'children':[this['reopenButtonView']]}]});}['render'](){super['render'](),this['_attachContextActions'](),this['_setupKeyboardNavigation']();}['focus'](){this['focusCycler']['focusFirst']();}['_createReopenButton'](){const _0x172aaa=new _0x47a354(this['locale']);return _0x172aaa['label']=N(this['locale'],'Reopen'),_0x172aaa['tooltip']=N(this['locale'],'Reopen'),_0x172aaa['icon']=_0x130a47,_0x172aaa['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x54f77=>!_0x54f77),_0x172aaa['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x42ec5c,_0x194a95)=>_0x42ec5c&&_0x194a95),_0x172aaa['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x172aaa;}['_trimContextValue'](_0x5c18a5){if(_0x5c18a5['length']<0x96)return _0x5c18a5;const _0x161674=_0x5c18a5['lastIndexOf']('\x20',0x93);return _0x5c18a5['substring'](0x0,_0x161674>-0x1?_0x161674:0x93)+'...';}['_attachContextActions'](){const _0x247bca=this['element']['querySelector']('.ck-context'),_0x465291=_0x247bca['querySelector']('.ck-context__value');this['listenTo'](_0x247bca,'mouseenter',()=>{_0x465291['offsetWidth']<_0x465291['scrollWidth']&&_0x247bca['classList']['add']('overlay');}),this['listenTo'](_0x247bca,'mouseleave',()=>{_0x247bca['classList']['remove']('overlay');});}['_setupKeyboardNavigation'](){this['keystrokes']['listenTo'](this['element']);for(const _0x47fa2b of this['focusables'])this['focusTracker']['add'](_0x47fa2b['element']),this['keystrokes']['listenTo'](_0x47fa2b['element']);}['_createContextView'](){const _0x16c793=new oe(this['locale']);return _0x16c793['bind']('contextValue')['to'](this),_0x16c793;}}class si extends kt{['_model'];['_config'];['commentThreadHeaderView'];['commentThreadInputView'];['ariaDescriptionView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];constructor(_0x54b277,_0x2705b5,_0x44f53d,_0x225fb5){super(_0x54b277),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x2705b5,this['_localUser']=_0x44f53d,this['_config']=_0x225fb5,this['commentThreadHeaderView']=new Xt(_0x54b277,_0x2705b5),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new Yt(_0x54b277,N(_0x54b277,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new te(_0x54b277,_0x2705b5,Object['assign']({'CommentView':this['_config']['CommentView']},_0x225fb5)),this['commentsListView']['delegate']('removeComment')['to'](this),this['commentsListView']['delegate']('updateComment')['to'](this),this['commentsListView']['delegate']('resolveCommentThread')['to'](this),this['commentsListView']['delegate']('editorReady')['to'](this),this['commentsListView']['delegate']('editorDestroyed')['to'](this),this['commentsListView']['bind']('isActive')['to'](this),this['listenTo'](this,'resolveCommentThread',()=>{this['focus']();}),this['set']('length',this['commentsListView']['length']),this['bind']('length')['to'](this['commentsListView'],'length'),this['commentThreadInputView']=this['_createCommentThreadInputView'](),this['commentThreadInputView']['delegate']('editorReady')['to'](this),this['commentThreadInputView']['delegate']('editorDestroyed')['to'](this),this['on']('removeComment',()=>this['focus']()),this['bind']('isDirty')['to'](this['commentsListView'],'hasDirtyComment',this['commentThreadInputView']['commentInputView'],'value',(_0x4b933c,_0x1dd826)=>_0x4b933c||!!_0x1dd826),this['bind']('isUnlinked')['to'](_0x2705b5,'unlinkedAt',_0x2bbc7b=>!!_0x2bbc7b),this['bind']('ariaLabel')['to'](this,'length',_0x49ad7a=>{const _0x9f9537=this['_model']['comments']['first']?this['_model']['comments']['first']['author']['name']:this['_localUser']['name'];return N(this['locale'],'COMMENT_THREAD_LABEL',[_0x49ad7a,_0x9f9537]);}),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x5f5319(),this['keystrokes']=new jt(),this['focusCycler']=new _0x140f1f({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x356ad7=>_0x356ad7['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),Zt(this,this['focusables']);}async['destroy'](){this['isDirty']=!0x1,this['commentsListView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}['_createCommentThreadInputView'](){const _0x21e3fd=new ie(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x48f60a=_0x21e3fd['commentInputView'];return _0x21e3fd['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x48f60a,'value',(_0x2c1a97,_0x1b4dd2,_0x44448c,_0x171611,_0x161c98)=>!!_0x161c98||!!_0x171611&&_0x44448c&&!_0x1b4dd2||_0x2c1a97&&_0x44448c&&!_0x1b4dd2),_0x48f60a['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x5d3337,_0x4174bc,_0x4d3357)=>{let _0x1b215d;return _0x1b215d=_0x4d3357&&_0x4174bc?'Reply\x20to\x20reopen\x20discussion...':_0x5d3337?'Reply...':'Write\x20a\x20comment...',N(this['locale'],_0x1b215d);}),_0x48f60a['bind']('submitLabel')['to'](this,'length',_0x40baca=>N(this['locale'],_0x40baca?'Reply':'Comment')),_0x48f60a['on']('submit',(_0x2c77b1,_0xa60ad6)=>{this['fire']('addComment',_0xa60ad6),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x48f60a['on']('cancel',()=>{this['focus']();}),_0x48f60a['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x48f60a['on']('cancel',_0x86753a=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x86753a['stop']());}),this['on']('change:isActive',(_0x59ea1d,_0x11da3f,_0x12bd8a)=>{_0x12bd8a||this['length']||_0x48f60a['value']||this['fire']('removeCommentThread');}),_0x21e3fd;}}class gt extends/* #__PURE__ -- @preserve */
ti(si){['commentThreadChildren'];['containerElement'];['resolveButton'];['_boundFirstCommentView'];constructor(_0x40ae74,_0x50e3d,_0x38a291,_0x558856){super(_0x40ae74,_0x50e3d,_0x38a291,_0x558856),this['commentThreadChildren']=this['createCollection']([this['commentsListView'],this['commentThreadInputView'],this['ariaDescriptionView']]),this['set']('actionIndicator',null),this['containerElement']=null,this['_boundFirstCommentView']=null,this['locale']=_0x40ae74,this['resolveButton']=this['_createResolveButton'](),this['setTemplate'](this['getTemplate']()),this['on']('change:isActive',(_0x330c17,_0x341fbd,_0x201b9b)=>{_0x201b9b||this['_cancelAllConfirms']();}),this['listenTo'](this['_model'],'change:isReadOnly',(_0x308a97,_0x89e4f,_0x2f80d8)=>{_0x2f80d8&&this['_cancelAllConfirms']();}),this['length']>0x0&&this['_bindFirstCommentView'](),this['listenTo'](this['commentsListView']['commentViews'],'add',()=>{this['_bindFirstCommentView']();});}['getTemplate'](){const _0x34d771=this['bindTemplate'];return{'tag':'div','attributes':{'class':['ck','ck-thread','ck-reset_all-excluded','ck-rounded-corners',_0x34d771['if']('isActive','ck-thread--active'),_0x34d771['if']('isUnlinked','ck-thread--unlinked'),_0x34d771['to']('actionIndicator',_0x54d1e8=>_0x54d1e8?'ck-thread--'+_0x54d1e8:'')],'data-thread-id':this['_model']['id'],'tabindex':0x0,'role':'listitem','aria-label':_0x34d771['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id']},'children':[{'tag':'div','attributes':{'class':'ck-thread__container'},'children':this['commentThreadChildren']}]};}['render'](){super['render'](),this['containerElement']=this['element']['querySelector']('.ck-thread__container'),this['_model']['on']('change:archivedAt',()=>{this['_updateArchivedThreadHeader']();}),this['_updateArchivedThreadHeader']();}['_cancelAllConfirms'](){this['cancelConfirm']();for(const _0x31b5c6 of this['commentsListView']['commentViews'])_0x31b5c6['cancelConfirm']();}['_bindFirstCommentView'](){const {locale:_0x648028}=this,_0x3007ba=this['commentsListView']['commentViews']['get'](0x0);_0x3007ba===this['_boundFirstCommentView']||_0x3007ba['isSystemComment']||(this['_boundFirstCommentView']=_0x3007ba,this['unbind']('actionIndicator'),this['bind']('actionIndicator')['to'](_0x3007ba,'actionIndicator',_0x400930=>'remove'===_0x400930?'remove':null),_0x3007ba['placeholder']=N(_0x648028,'Write\x20a\x20comment...'),_0x3007ba['removeButton']['on']('execute',_0x7183d5=>{_0x7183d5['stop'](),this['showConfirm'](N(_0x648028,'Delete\x20comment\x20thread?'),this['containerElement'])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),this['on']('removeConfirm',()=>{_0x3007ba['focus']();}),_0x3007ba['actionBar']['add'](this['resolveButton'],0x0),_0x3007ba['focusables']['add'](this['resolveButton'],0x0));}['_createResolveButton'](){const _0x2d4084=new _0x188cb3(this['locale']);return _0x2d4084['label']=N(this['locale'],'Resolve'),_0x2d4084['tooltip']=N(this['locale'],'Resolve'),_0x2d4084['icon']=_0x2a328a,_0x2d4084['extendTemplate']({'attributes':{'class':'ck-comment--resolve'}}),_0x2d4084['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x415828=>!_0x415828),_0x2d4084['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0xea1c2b,_0x558482)=>_0xea1c2b&&!_0x558482),_0x2d4084['on']('execute',()=>{this['fire']('resolveCommentThread',this['_model']['id']);}),_0x2d4084;}['_updateArchivedThreadHeader'](){this['_model']['archivedAt']?this['commentThreadChildren']['has'](this['commentThreadHeaderView'])||(this['commentThreadChildren']['add'](this['commentThreadHeaderView'],0x0),this['focusables']['add'](this['commentThreadHeaderView'],0x0)):this['commentThreadChildren']['has'](this['commentThreadHeaderView'])&&(this['commentThreadChildren']['remove'](this['commentThreadHeaderView']),this['focusables']['remove'](this['commentThreadHeaderView']));}}class is extends kt{constructor(_0xd808c1){super(_0xd808c1),this['set']('content',''),this['setTemplate']({'tag':'div','attributes':{'class':['ck-content','ck-comment__content','ck-annotation__content']}});}['render'](){super['render'](),this['on']('change:content',(_0x1bc05d,_0x427bf7,_0x5f100c)=>{this['element']['innerHTML']=_0x5f100c;}),this['element']['innerHTML']=this['content'];}}class di extends kt{['visibleView'];['ariaDescriptionView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];['_model'];['_config'];constructor(_0x57563c,_0x3ae401,_0x3fb87c){super(_0x57563c),this['_model']=_0x3ae401,this['_config']=_0x3fb87c,this['isSystemComment']=!!this['_config']['isSystemComment'],this['set']('isEditMode',!0x1),this['set']('isCollapsed',!0x0),this['bind']('ariaLabel')['to'](_0x3ae401,'content',_0x3ae401,'authoredAt',(_0x53a348,_0x1d4ba0)=>N(_0x57563c,'COMMENT_ARIA_LABEL',[_0x3ae401['author']['name'],_0x3fb87c['formatDateTime'](_0x1d4ba0),new DOMParser()['parseFromString'](_0x53a348,'text/html')['body']['textContent'],_0x3ae401['isExternal']?this['getExternalCommentNote']():''])),this['ariaDescriptionView']=new Yt(_0x57563c,N(_0x57563c,'COMMENT_THREAD_DESCRIPTION')),this['visibleView']=this['createCollection'](),this['visibleView']['add'](this['_createCommentContentView']()),this['focusables']=new _0x577399(),this['focusTracker']=new _0x5f5319(),this['keystrokes']=new jt(),this['focusCycler']=new _0x140f1f({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x1a8b3d=>_0x1a8b3d['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['expand'](){this['isCollapsed']=!0x1;}['collapse'](){this['isEditMode']||(this['isCollapsed']=!0x0);}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['_setupKeyboardNavigation']();}async['destroy'](){await this['visibleView']['get'](0x0)['destroy'](),super['destroy']();}['switchToEditMode'](){this['isEditMode']||(this['isEditMode']=!0x0,this['visibleView']['remove'](0x0)['destroy'](),this['visibleView']['add'](this['_createCommentInputView']()));}['switchToDisplayMode'](){this['isEditMode']&&(this['isEditMode']=!0x1,this['visibleView']['remove'](0x0)['destroy'](),this['visibleView']['add'](this['_createCommentContentView']()));}['getExternalCommentNote'](){return'importWord'===this['_model']['attributes']['@external']['source']?N(this['locale'],'EXTERNAL_IMPORT_WORD_COMMENT'):N(this['locale'],'EXTERNAL_COMMENT');}['getUserViewNotificationText'](){return this['_model']['isExternal']?'importWord'===this['_model']['attributes']['@external']['source']?N(this['locale'],'EXTERNAL_IMPORT_WORD_AVATAR',this['_model']['creator']['name']):N(this['locale'],'EXTERNAL_AVATAR',this['_model']['creator']['name']):null;}['_createCommentContentView'](){const _0x3063f2=new is(this['locale']);return _0x3063f2['bind']('content')['to'](this['_model'],'content',this,'isCollapsed',(_0x3b8e17,_0x1ef626)=>_0x1ef626?ts(_0x3b8e17,{'limit':this['_config']['maxCommentCharsWhenCollapsed']}):_0x3b8e17),_0x3063f2;}['_createCommentInputView'](){this['_config']['editorConfig']||(this['_config']['editorConfig']={}),this['_config']['editorConfig']['initialData']=this['_model']['content'];const _0x5387b2=new es(this['locale'],this['_config']['editorConfig']);return _0x5387b2['value']=this['_model']['content'],_0x5387b2['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x5387b2['submitLabel']=N(this['locale'],'Save'),_0x5387b2['on']('submit',(_0x104525,_0x54d33d)=>{this['fire']('updateComment',this['_model']['id'],_0x54d33d),this['switchToDisplayMode'](),this['focus']();}),_0x5387b2['on']('cancel',()=>{this['switchToDisplayMode'](),this['focus']();}),_0x5387b2['once']('editorReady',()=>{_0x5387b2['focus']();}),_0x5387b2['createEditor'](),_0x5387b2['delegate']('editorReady')['to'](this),_0x5387b2['delegate']('editorDestroyed')['to'](this),_0x5387b2;}['_setupKeyboardNavigation'](){const _0x5e7a2b=this['element'];this['keystrokes']['listenTo'](_0x5e7a2b);for(const _0x38dd59 of this['focusables'])this['focusTracker']['add'](_0x38dd59['element']),this['keystrokes']['listenTo'](_0x38dd59['element']);this['focusables']['on']('change',(_0x57c64f,_0x103357)=>{for(const _0x3749ee of _0x103357['removed'])this['focusTracker']['remove'](_0x3749ee['element']),this['keystrokes']['stopListening'](_0x3749ee['element']);for(const _0x578dcc of _0x103357['added'])this['focusTracker']['add'](_0x578dcc['element']),this['keystrokes']['listenTo'](_0x578dcc['element']);}),this['keystrokes']['set']('enter',(_0x389905,_0x493482)=>{_0x5e7a2b===_0x389905['target']&&(this['focusCycler']['focusFirst'](),_0x493482());}),this['keystrokes']['set']('esc',(_0x51809c,_0xed9c8e)=>{_0x5e7a2b!==_0x51809c['target']&&(this['focus'](),_0xed9c8e());});}}class Tt extends/* #__PURE__ -- @preserve */
ti(di){['actionBar'];['userView'];constructor(_0x4d7379,_0x49c673,_0x1a2f64){super(_0x4d7379,_0x49c673,_0x1a2f64),this['set']('actionIndicator',null),this['set']('placeholder',N(_0x4d7379,'Reply...')),this['bind']('authoredAt')['to'](_0x49c673),this['bind']('resolvedAt')['to'](_0x49c673),this['actionBar']=this['createCollection'](),this['isSystemComment']||(this['editButton']=this['_createEditButton'](),this['removeButton']=this['_createRemoveButton'](),this['items']=this['createCollection'](),this['items']['addMany']([this['editButton'],this['removeButton']]),this['dropdown']=this['_createDropdown'](),this['actionBar']['add'](this['dropdown']),this['focusables']['add'](this['dropdown'])),this['userView']=new _0x193858(_0x4d7379,_0x49c673['author'],this['getUserViewNotificationText']()),this['userView']['extendTemplate']({'attributes':{'class':['ck-comment__user','ck-annotation__user'],'aria-hidden':!0x0}}),this['listenTo'](_0x49c673,'change:isRemovable',()=>this['cancelConfirm']()),this['setTemplate'](this['getTemplate']());}['getTemplate'](){const _0x1b5272=this['bindTemplate'],_0x48068a=[{'tag':'div','attributes':{'class':['ck-comment__info','ck-annotation__info']},'children':[{'tag':'span','children':[{'text':this['userView']['name']}],'attributes':{'class':['ck-comment__info-name','ck-annotation__info-name'],'data-cke-tooltip-text':this['userView']['name']}},{'tag':'time','attributes':{'datetime':_0x1b5272['to']('authoredAt'),'class':['ck-comment__info-time','ck-annotation__info-time']},'children':[{'text':_0x1b5272['to']('authoredAt',_0x4f024e=>this['_config']['formatDateTime'](_0x4f024e))}]}]},{'tag':'div','attributes':{'class':['ck-comment__actions','ck-annotation__actions',_0x1b5272['if']('isEditMode','ck-comment__actions--hidden'),_0x1b5272['if']('isEditMode','ck-annotation__actions--hidden')]},'children':this['actionBar']},{'tag':'div','attributes':{'class':['ck-annotation__content-wrapper']},'children':this['visibleView']},this['ariaDescriptionView']];return this['_model']['isExternal']&&_0x48068a['push']({'tag':'div','attributes':{'class':['ck-comment__external']},'children':[{'text':this['getExternalCommentNote']()}]}),{'tag':'li','attributes':{'class':['ck-comment__wrapper'],'tabindex':-0x1,'aria-label':_0x1b5272['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id'],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck-comment','ck-annotation',_0x1b5272['if']('isEditMode','ck-comment--edit'),_0x1b5272['if']('isSystemComment','ck-comment--info'),_0x1b5272['to']('actionIndicator',_0x19d792=>_0x19d792?'ck-comment--'+_0x19d792:'')],'data-author-id':this['_model']['author']['id'],'data-comment-id':this['_model']['id'],'role':'group'},'children':[this['userView'],{'tag':'div','attributes':{'class':['ck-comment__main','ck-annotation__main']},'children':_0x48068a}]}]};}['_createEditButton'](){const _0xf4fe27=new _0x47a354(this['locale']);return _0xf4fe27['label']=N(this['locale'],'Edit'),_0xf4fe27['icon']=_0x5939de,_0xf4fe27['withText']=!0x0,_0xf4fe27['extendTemplate']({'attributes':{'class':'ck-comment--edit'}}),_0xf4fe27['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x55e0a1=>!_0x55e0a1),_0xf4fe27['bind']('isVisible')['to'](this['_model'],'isEditable'),_0xf4fe27['on']('execute',()=>this['switchToEditMode']()),_0xf4fe27;}['_createRemoveButton'](){const _0x31516f=new _0x47a354(this['locale']);return _0x31516f['label']=N(this['locale'],'Remove'),_0x31516f['icon']=_0x92b88,_0x31516f['withText']=!0x0,_0x31516f['extendTemplate']({'attributes':{'class':'ck-comment--remove'}}),_0x31516f['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0xf033ae=>!_0xf033ae),_0x31516f['bind']('isVisible')['to'](this['_model'],'isRemovable'),_0x31516f['on']('execute',()=>{this['showConfirm'](N(this['locale'],'Delete\x20comment?'),this['element'])['then'](()=>{this['fire']('removeComment',this['_model']['id']);});}),_0x31516f;}['_createDropdown'](){const _0x535109=_0x3deee8(this['locale'],_0x539736),_0x7dcfcd=_0x535109['panelView']['children'],_0x433d3f=new _0x5ca25c(this['locale']),_0x88c7ed=_0x535109['bindTemplate'];_0x1518f9(_0x535109,()=>this['items']['find'](_0x44d54c=>_0x44d54c['isVisible'])),_0x535109['extendTemplate']({'attributes':{'class':[_0x88c7ed['if']('isVisible','ck-hidden',_0xe60691=>!_0xe60691)]}});const _0x4b1e0b=(_0x5acd43,_0x38479b=-0x1)=>{const _0x3ea0bd=new _0x365663(this['locale']);_0x3ea0bd['children']['add'](_0x5acd43);const _0x55f01f=_0x38479b>-0x1?_0x38479b:_0x433d3f['items']['length'];_0x433d3f['items']['add'](_0x3ea0bd,_0x55f01f);const _0x16e998=Array['from'](this['items']);_0x535109['unbind']('isEnabled','isVisible'),_0x535109['bind']('isEnabled')['toMany'](_0x16e998,'isEnabled',(..._0x51a35c)=>_0x51a35c['some'](_0x3214ad=>_0x3214ad)),_0x535109['bind']('isVisible')['toMany'](_0x16e998,'isVisible',(..._0x5390b0)=>_0x5390b0['some'](_0x9fac88=>_0x9fac88));};_0x535109['panelPosition']='sw',_0x535109['buttonView']['set']({'label':N(this['locale'],'Show\x20more\x20items'),'icon':_0x44b678});for(const _0x27dad0 of this['items'])_0x4b1e0b(_0x27dad0);return _0x7dcfcd['add'](_0x433d3f),_0x535109['listenTo'](this['items'],'add',(_0x6ac6d0,_0x550cd2,_0xc88233)=>{_0x4b1e0b(_0x550cd2,_0xc88233);}),_0x535109['listenTo'](this['items'],'remove',(_0x5508d7,_0x135aaa,_0x596809)=>{_0x433d3f['items']['remove'](_0x596809);}),_0x535109;}['_attachActions'](_0x18dd8e,_0x5e77a4){const _0x48482f=_0x18dd8e&&_0x18dd8e['element'];_0x48482f&&(this['listenTo'](_0x48482f,'mouseenter',()=>this['actionIndicator']=_0x5e77a4),this['listenTo'](_0x48482f,'focus',()=>this['actionIndicator']=_0x5e77a4),this['listenTo'](_0x48482f,'mouseleave',()=>this['actionIndicator']=null),this['listenTo'](_0x48482f,'blur',()=>this['actionIndicator']=null));}['_createCommentInputView'](){const _0x46a7ef=super['_createCommentInputView']();return _0x46a7ef['bind']('placeholder')['to'](this),_0x46a7ef;}['render'](){super['render'](),this['_attachActions'](this['editButton'],'edit'),this['_attachActions'](this['removeButton'],'remove');}}function xt(_0x2ee6d5){const _0x1bf762=Dt(_0x2ee6d5,0x1e),_0x19f99d=new MutationObserver(_0x1ed9e4=>{for(const _0x572cee of _0x1ed9e4)('attributes'==_0x572cee['type']&&'class'==_0x572cee['attributeName']||'childList'==_0x572cee['type']||'characterData'==_0x572cee['type'])&&_0x1bf762();});return{'attach'(_0x448b45){_0x19f99d['observe'](_0x448b45,{'attributes':!0x0,'childList':!0x0,'subtree':!0x0,'characterData':!0x0});},'detach'(){_0x19f99d['discon