UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

28 lines • 196 kB
/* * 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 _0x4305fd,ContextPlugin as _0x13d3af,PendingActions as _0x5567fe,Command as _0x2b0101,Plugin as _0x1dcff1,Context as _0x23855d}from'@ckeditor/ckeditor5-core/dist/index.js';import{ObservableMixin as _0x336fb1,uid as _0x1b3ead,KeystrokeHandler as _0x33c420,FocusTracker as _0x38a95f,diff as _0x236a86,Collection as _0x80b602,Rect as _0x4da549,CKEditorError as _0xb919f,first as _0x668494,priorities as _0x555eee,scrollViewportToShowTarget as _0x47b367,getEnvKeystrokeText as _0x2af0e8,toUnit as _0x1a59a1,DomEmitterMixin as _0xdf42d0,keyCodes as _0x4f4113}from'@ckeditor/ckeditor5-utils/dist/index.js';import{UserView as _0x4b944c,AriaDescriptionView as _0x53a347,setupThreadKeyboardNavigation as _0x113c07,ConfirmMixin as _0x62d738,LateFocusButtonView as _0x4b87f3,trimHtml as _0x14a3ac,LateFocusDropdownButtonView as _0x47c53c,FOCUS_ANNOTATION_KEYSTROKE as _0x347574,Users as _0x192c57,getDateTimeFormatter as _0x54ebfc,hashObject as _0x15a02b,getAllMarkersDomElementsSorted as _0x26ba2d,surroundingMarkersDetector as _0x20b027}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{throttle as _0x50ae35,cloneDeep as _0x2b50c0,set as _0xc4af84,unset as _0x3fcc9e,isEqual as _0x51fc62,debounce as _0x133c6c}from'es-toolkit/compat';import{IconUndo as _0xe0b2b5,IconCheck as _0x532667,IconPencil as _0x2e5494,IconRemoveComment as _0x82b7cd,IconThreeVerticalDots as _0x58b294,IconAddComment as _0x4f5594,IconCommentsArchive as _0x460631}from'@ckeditor/ckeditor5-icons/dist/index.js';import{EditorUIView as _0x56b153,InlineEditableUIView as _0xdf9c0d,EditorUI as _0x5e51e1,View as _0x5ad1e4,FocusCycler as _0x332d41,ButtonView as _0x4fe59a,ViewCollection as tt,createDropdown as et,ListView as it,focusChildOnDropdownOpen as st,ListItemView as nt,MenuBarMenuListItemButtonView as ot,BodyCollection as rt,BalloonPanelView as ht,ContextualBalloon as at,Dialog as ct,DialogViewPosition as dt}from'@ckeditor/ckeditor5-ui/dist/index.js';import{disableViewPlaceholder as mt,enableViewPlaceholder as lt,MouseObserver as ut}from'@ckeditor/ckeditor5-engine/dist/index.js';import{Clipboard as ft,ClipboardMarkersUtils as pt,ClipboardPipeline as wt}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{Enter as At,ShiftEnter as gt}from'@ckeditor/ckeditor5-enter/dist/index.js';import{SelectAll as Ct}from'@ckeditor/ckeditor5-select-all/dist/index.js';import{Typing as _t}from'@ckeditor/ckeditor5-typing/dist/index.js';import{Undo as Tt}from'@ckeditor/ckeditor5-undo/dist/index.js';import{Paragraph as yt}from'@ckeditor/ckeditor5-paragraph/dist/index.js';import{toWidget as It}from'@ckeditor/ckeditor5-widget/dist/index.js';class CommentThreadController extends/* #__PURE__ -- @preserve */ _0x336fb1(){['model'];['view'];constructor(_0x4dcdbc,_0x264e65){super(),this['model']=_0x4dcdbc,this['model']['_isAttached']=!0x0,this['view']=_0x264e65,this['listenTo'](_0x264e65,'submitCommentThread',()=>this['submit']()),this['listenTo'](_0x264e65,'removeCommentThread',()=>this['remove']()),this['listenTo'](_0x264e65,'resolveCommentThread',()=>this['resolve']()),this['listenTo'](_0x264e65,'reopenCommentThread',()=>this['reopen']()),this['listenTo'](_0x264e65,'addComment',(_0x17bfd4,_0x4c37f8)=>this['addComment'](_0x4c37f8)),this['listenTo'](_0x264e65,'updateComment',(_0x5ef110,_0x51f26b,_0x1ddc5f)=>this['updateComment'](_0x51f26b,_0x1ddc5f)),this['listenTo'](_0x264e65,'removeComment',(_0x306b67,_0xd5c545)=>this['removeComment'](_0xd5c545));}['submit'](){this['model']['submit']();}['remove'](){this['model']['remove']();}['resolve'](){this['model']['isResolved']||this['model']['resolve']();}['reopen'](){this['model']['isResolved']&&this['model']['reopen']();}['addComment'](_0x219747){this['model']['addComment']({'content':_0x219747,'authorId':this['view']['_localUser']['id']});}['updateComment'](_0x5d529b,_0x42a4b8){this['model']['getComment'](_0x5d529b)['update']({'content':_0x42a4b8});}['removeComment'](_0xf48d94){this['model']['getComment'](_0xf48d94)['remove']();}['destroy'](){this['stopListening'](),this['model']['_isAttached']=!0x1;}}function vt(_0x281c10,_0x9c2f77,_0x13df83){const t=_0x281c10['t'];switch(_0x9c2f77){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'},_0x13df83);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'},_0x13df83);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'},_0x13df83);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'},_0x13df83);case'NUMBER_OF_COMMENTS':return t({'string':'%0\x20Comment','plural':'%0\x20Comments','id':'NUMBER_OF_COMMENTS'},_0x13df83);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'},_0x13df83);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'},_0x13df83);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'},_0x13df83);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 CommentEditorUIView extends _0x56b153{['main'];['editable'];constructor(_0x3018c5,_0xde32a5){super(_0x3018c5);const _0x5c93a7=_0x1b3ead();this['main']=this['createCollection'](),this['editable']=new _0xdf9c0d(_0x3018c5,_0xde32a5,void 0x0,{'label':()=>vt(_0x3018c5,'Comment\x20editor')}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-editor','ck-rounded-corners','ck-comment__input'],'dir':_0x3018c5['uiLanguageDirection'],'lang':_0x3018c5['uiLanguage'],'aria-labelledby':'cke-editor__aria-label_'+_0x5c93a7},'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 CommentEditorUI extends _0x5e51e1{['view'];constructor(_0x591bab){super(_0x591bab),this['view']=new CommentEditorUIView(_0x591bab['locale'],_0x591bab['editing']['view']);}get['element'](){return this['view']['element'];}['init'](){const _0x3bb12a=this['editor']['editing']['view'],_0xf6e5f1=this['view']['editable'],_0x26943d=_0x3bb12a['document']['getRoot']();_0xf6e5f1['name']=_0x26943d['rootName'],this['view']['render']();const _0x5c2ba4=_0xf6e5f1['element'];this['setEditableElement'](_0xf6e5f1['name'],_0x5c2ba4),this['view']['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x3bb12a['attachDomRoot'](_0x5c2ba4),this['fire']('ready');}['destroy'](){super['destroy'](),this['view']['destroy']();}}const bt=[ft,At,gt,Ct,_t,Tt,yt];class CommentEditor extends/* #__PURE__ -- @preserve */ _0x336fb1(_0x4305fd){static ['defaultPlugins']=/* #__PURE__ -- @preserve */ ((()=>bt)());constructor(_0xef4a94={}){function _0x51e497(_0x7e899c){return _0x7e899c['map'](_0x43798a=>String['fromCharCode'](_0x43798a))['join']('');}(_0xef4a94=Object['assign']({},_0xef4a94))['plugins']||(_0xef4a94['plugins']=CommentEditor['defaultPlugins']),super(_0xef4a94),this['ui']=new CommentEditorUI(this),this['set']('placeholder',''),this['model']['document']['on']('change',()=>this['_updatePlaceholder'](),{'priority':'low'}),this['on']('change:placeholder',()=>this['_updatePlaceholder']()),this['model']['document']['createRoot'](),this[_0x51e497([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x51e497([0x76,0x69,0x65,0x77])][_0x51e497([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x51e497([0x61,0x75,0x74,0x6f]),this[_0x51e497([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74])]=()=>window[_0x51e497([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x51e497([0x72,0x65,0x73,0x6f,0x6c,0x76,0x65])]({[_0x51e497([0x73,0x74,0x61,0x74,0x75,0x73])]:_0x51e497([0x6f,0x6b])});}['create'](){const _0x470eac=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x470eac))['then'](()=>this['fire']('ready'));}['destroy'](){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0x56f7c6=>{const _0x2c2fb=this['model']['document']['getRoot'](),_0x3874b2=_0x2c2fb&&_0x2c2fb['getChild'](_0x2c2fb['childCount']-0x1);_0x56f7c6['setSelection'](_0x3874b2,'end'),this['editing']['view']['focus']();});}['_updatePlaceholder'](){const _0x1dfe5a=this['editing']['view'],_0x14ca4b=_0x1dfe5a['document']['getRoot'](),_0x50ccfe=_0x14ca4b['getChild'](0x0);_0x14ca4b['childCount']>0x1||!_0x50ccfe||'p'!=_0x50ccfe['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(mt(_0x1dfe5a,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x50ccfe['placeholder']=this['placeholder']),lt({'view':_0x1dfe5a,'element':_0x50ccfe,'keepOnFocus':!0x0}),this['placeholderElement']=_0x50ccfe);}}class CommentInputView extends _0x5ad1e4{['keystrokes'];['focusTracker'];['focusables'];['focusCycler'];['submitButtonView'];['cancelButtonView'];['_editorConfig'];constructor(_0x117148,_0x317a9e={}){super(_0x117148),this['editor']=null,this['_editorConfig']=_0x317a9e,this['set']('value',_0x317a9e['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',vt(_0x117148,'Reply...')),this['set']('submitLabel',vt(_0x117148,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['submitButtonView'],this['cancelButtonView']]),this['keystrokes']=new _0x33c420(),this['focusTracker']=new _0x38a95f(),this['focusCycler']=new _0x332d41({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x53289c=>!_0x53289c['defaultPrevented']},'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',(_0x24d3c5,_0x42abe8)=>{this['cancelButtonView']['fire']('execute'),_0x42abe8();}),this['keystrokes']['set']('Ctrl+Enter',(_0xf0cdf0,_0x430e08)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x430e08());}),this['on']('submit',(_0x4b2917,_0x308da8)=>{_0x308da8['length']>0xfde8?(alert(vt(_0x117148,'TOO_LONG_COMMENT_ALERT',[_0x308da8['length'],0xfde8])),_0x4b2917['stop']()):this['editor']['setData']('');},{'priority':'high'});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}['createEditor'](){return this['editor']||(this['editor']=new CommentEditor(this['_editorConfig']),this['_editorCreationPromise']=this['editor']['create']()['then'](()=>{if(this['_isDestroyed'])return;const _0x5c00be=this['editor'];this['element']['insertBefore'](_0x5c00be['ui']['element'],this['element']['firstChild']),_0x5c00be['model']['document']['on']('change',()=>this['value']=_0x5c00be['getData']()),_0x5c00be['bind']('placeholder')['to'](this),this['focusables']['add'](_0x5c00be['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x511ba5){-0x1===_0x511ba5?(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:_0x16bd10}=this,_0x58cf23=new _0x4fe59a(_0x16bd10);return _0x58cf23['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--submit']}}),_0x58cf23['withText']=!0x0,_0x58cf23['bind']('label')['to'](this,'submitLabel'),_0x58cf23['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x58cf23['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x303bd6,_0x364e5f)=>!_0x364e5f&&!!_0x303bd6['trim']()),_0x58cf23;}['_createCancelButton'](){const {locale:_0x436808}=this,_0x1195d5=new _0x4fe59a(_0x436808);return _0x1195d5['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x1195d5['label']=vt(_0x436808,'Cancel'),_0x1195d5['withText']=!0x0,_0x1195d5['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x1195d5;}['_setupKeyboardNavigation'](){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0xacee98=>{this['focusTracker']['add'](_0xacee98['element']);}),this['focusables']['on']('change',(_0x4f44a1,_0xf2d769)=>{for(const _0x10210e of Array['from'](_0xf2d769['added'])['reverse']())this['focusTracker']['add'](_0x10210e['element']);});}}class CommentThreadInputView extends _0x5ad1e4{constructor(_0x281f38,_0x2512b7,_0x52f6a8){super(_0x281f38),this['commentInputView']=new CommentInputView(_0x281f38,_0x52f6a8),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x4cd687,_0x1e5e39)=>_0x4cd687||!!_0x1e5e39),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 _0x4b944c(_0x281f38,_0x2512b7),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'](_0x233186){this['commentInputView']['focus'](_0x233186);}['_focusOnNonInteractiveMouseDown'](){this['listenTo'](this['element'],'mousedown',(_0x57d4e2,_0x191b0e)=>{const {submitButtonView:_0x271059,cancelButtonView:_0x14f9b3,editor:_0x23bb75}=this['commentInputView'];[_0x271059['element'],_0x14f9b3['element'],_0x23bb75?_0x23bb75['editing']['view']['getDomRoot']():null]['filter'](_0x71ca5c=>_0x71ca5c)['some'](_0x26d60e=>_0x26d60e['contains'](_0x191b0e['target']))||(this['focus'](),_0x191b0e['preventDefault']());});}}class CollapsedCommentsView extends _0x5ad1e4{constructor(_0x4b11f0){super(_0x4b11f0);const _0x503a67=this['bindTemplate'];this['set']('count',void 0x0),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[{'text':_0x503a67['to']('count',_0x3f510e=>vt(_0x4b11f0,'NUMBER_OF_COMMENTS',_0x3f510e))}]});}}class CommentsListView extends _0x5ad1e4{['commentViews'];['resolvedCommentView'];['focusTracker'];['keystrokes'];['focusCycler'];['_model'];['_config'];['_collapsedCommentsView'];constructor(_0x3fa32a,_0x28e6a9,_0x5627dd){super(_0x3fa32a);const _0x1f3aa1=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x28e6a9['comments']['length']),this['set']('isActive',!0x1),this['_model']=_0x28e6a9,this['_config']=_0x5627dd,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x38a95f(),this['keystrokes']=new _0x33c420(),this['focusCycler']=new _0x332d41({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x171f93=>this['commentViews']['map'](_0x56aec0=>_0x56aec0['element'])['includes'](_0x171f93['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new CollapsedCommentsView(_0x3fa32a),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x29e9d4=>_0x29e9d4-this['_config']['maxCommentsWhenCollapsed']);for(const _0x5b6025 of _0x28e6a9['comments'])this['_handleNewCommentModel'](_0x5b6025);this['_handleInfoComment'](),this['listenTo'](_0x28e6a9['comments'],'add',(_0x36e954,_0x59d125)=>{const _0x4d5831=this['_calculatePosition'](_0x59d125);this['length']++,this['_handleNewCommentModel'](_0x59d125,_0x4d5831),this['refreshVisibleViews']();}),this['listenTo'](_0x28e6a9['comments'],'remove',(_0x36f6e3,_0x11d1a0)=>{this['length']--,this['_handleRemoveCommentModel'](_0x11d1a0),this['refreshVisibleViews']();}),this['listenTo'](_0x28e6a9,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x28e6a9,'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',_0x1f3aa1['if']('length','ck-hidden',_0x29fc73=>!_0x29fc73)],'aria-label':vt(_0x3fa32a,'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'](_0x4dde9a){-0x1===_0x4dde9a?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['destroy'](){this['_collapsedCommentsView']['destroy']();for(const _0x2a858f of this['commentViews'])_0x2a858f['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}['_handleNewCommentModel'](_0xa08d2e,_0x21cc7e){const _0x4896e2=new this['_config']['CommentView'](this['locale'],_0xa08d2e,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x4896e2['viewUid']=_0xa08d2e['id'],_0x4896e2['delegate']('removeComment')['to'](this),_0x4896e2['delegate']('updateComment')['to'](this),_0x4896e2['delegate']('resolveCommentThread')['to'](this),_0x4896e2['delegate']('editorReady')['to'](this),_0x4896e2['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x4896e2,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x4896e2,_0x21cc7e);}['_calculatePosition'](_0x4e1137){const _0x77b960=this['_model']['_findOptimalIndex'](_0x4e1137);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x4e1137['authoredAt']?_0x77b960-0x1:_0x77b960:_0x77b960-0x1;}['_handleInfoComment'](){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x46c800={'id':'resolved','author':this['_model']['resolvedBy'],'authoredAt':this['_model']['resolvedAt'],'content':vt(this['locale'],'Marked\x20as\x20resolved'),'attributes':{}};this['resolvedCommentView']=new this['_config']['CommentView'](this['locale'],_0x46c800,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x46c800));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}['_handleRemoveCommentModel'](_0x3b6038){const _0x30314d=this['commentViews']['remove'](_0x3b6038['id']);this['stopListening'](_0x30314d),_0x30314d['isEditMode']&&this['_updateHasDirtyComment'](),_0x30314d['destroy']();}['_updateHasDirtyComment'](){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x8af085=>_0x8af085['isEditMode']);}['_rearrangeCollapse'](){const _0x4dd195=function(_0x51ae26){const _0x56450c=new _0x80b602();for(const _0x116ad1 of _0x51ae26)_0x56450c['add'](_0x116ad1);return _0x56450c;}(this['commentViews']),_0x2feb84=this['_collapsedCommentsView']['count'];for(let _0x3bbe28=0x1;_0x3bbe28<=_0x2feb84;_0x3bbe28++)_0x4dd195['remove'](0x1);for(const _0x435308 of _0x4dd195)_0x435308['collapse']();_0x2feb84>0x0&&_0x4dd195['add'](this['_collapsedCommentsView'],0x1),Et(_0x236a86(Array['from'](this['visibleViews']),Array['from'](_0x4dd195)),this['visibleViews'],_0x4dd195);}['_rearrangeExpand'](){Et(_0x236a86(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x347def of this['visibleViews'])_0x347def['expand']();}['_setupKeyboardNavigation'](){this['commentViews']['forEach'](_0x33426a=>{this['focusTracker']['add'](_0x33426a['element']),this['keystrokes']['listenTo'](_0x33426a['element']);}),this['commentViews']['on']('change',(_0x2e3477,_0x538656)=>{for(const _0x2be894 of _0x538656['removed'])this['focusTracker']['remove'](_0x2be894['element']),this['keystrokes']['stopListening'](_0x2be894['element']);for(const _0x226642 of Array['from'](_0x538656['added'])['reverse']())this['focusTracker']['add'](_0x226642['element']),this['keystrokes']['listenTo'](_0x226642['element']);});}}function Et(_0x1d5c2d,_0x594137,_0x14a143){let _0x3b74ce=0x0;for(const _0x21dd3c of _0x1d5c2d)switch(_0x21dd3c){case'insert':_0x594137['add'](_0x14a143['get'](_0x3b74ce),_0x3b74ce),_0x3b74ce++;break;case'delete':_0x594137['remove'](_0x3b74ce);break;case'equal':_0x3b74ce++;}}class CommentThreadHeaderContextView extends _0x5ad1e4{constructor(_0x4be22a){super(_0x4be22a);const _0x1507b6=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x1507b6['to']('contextValue',_0x4fa0ee=>vt(_0x4be22a,'THREAD_CONTEXT_LABEL',_0x4fa0ee)),'tabindex':-0x1},'children':[{'text':_0x1507b6['to']('contextValue')}]});}['focus'](){this['element']['focus']();}}class CommentThreadHeaderView extends _0x5ad1e4{['_model'];['reopenButtonView'];['contextView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];constructor(_0x160629,_0x415c2b){super(_0x160629);const _0x4c1f61=this['bindTemplate'];this['_model']=_0x415c2b,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x38a95f(),this['keystrokes']=new _0x33c420(),this['focusCycler']=new _0x332d41({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x45179d=>!!_0x45179d),this['bind']('contextValue')['to'](this['_model'],'context',_0x1f072b=>_0x1f072b&&_0x1f072b['value']?this['_trimContextValue'](_0x1f072b['value']):vt(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',_0x4c1f61['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 _0x5821de=new _0x4fe59a(this['locale']);return _0x5821de['label']=vt(this['locale'],'Reopen'),_0x5821de['tooltip']=vt(this['locale'],'Reopen'),_0x5821de['icon']=_0xe0b2b5,_0x5821de['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x245543=>!_0x245543),_0x5821de['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0xfb846c,_0x572b34)=>_0xfb846c&&_0x572b34),_0x5821de['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x5821de;}['_trimContextValue'](_0x44f7de){if(_0x44f7de['length']<0x96)return _0x44f7de;const _0x2602d9=_0x44f7de['lastIndexOf']('\x20',0x93);return _0x44f7de['substring'](0x0,_0x2602d9>-0x1?_0x2602d9:0x93)+'...';}['_attachContextActions'](){const _0x571761=this['element']['querySelector']('.ck-context'),_0x316462=_0x571761['querySelector']('.ck-context__value');this['listenTo'](_0x571761,'mouseenter',()=>{_0x316462['offsetWidth']<_0x316462['scrollWidth']&&_0x571761['classList']['add']('overlay');}),this['listenTo'](_0x571761,'mouseleave',()=>{_0x571761['classList']['remove']('overlay');});}['_setupKeyboardNavigation'](){this['keystrokes']['listenTo'](this['element']);for(const _0x146d5f of this['focusables'])this['focusTracker']['add'](_0x146d5f['element']),this['keystrokes']['listenTo'](_0x146d5f['element']);}['_createContextView'](){const _0x1a84a7=new CommentThreadHeaderContextView(this['locale']);return _0x1a84a7['bind']('contextValue')['to'](this),_0x1a84a7;}}class BaseCommentThreadView extends _0x5ad1e4{['_model'];['_config'];['commentThreadHeaderView'];['commentThreadInputView'];['ariaDescriptionView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];constructor(_0x10d8c6,_0x485859,_0x42a8c4,_0x2ec221){super(_0x10d8c6),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x485859,this['_localUser']=_0x42a8c4,this['_config']=_0x2ec221,this['commentThreadHeaderView']=new CommentThreadHeaderView(_0x10d8c6,_0x485859),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x53a347(_0x10d8c6,vt(_0x10d8c6,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new CommentsListView(_0x10d8c6,_0x485859,Object['assign']({'CommentView':this['_config']['CommentView']},_0x2ec221)),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',(_0x31f65c,_0x2c99ae)=>_0x31f65c||!!_0x2c99ae),this['bind']('isUnlinked')['to'](_0x485859,'unlinkedAt',_0x2e5a81=>!!_0x2e5a81),this['bind']('ariaLabel')['to'](this,'length',_0x23c899=>{const _0x56b0a4=this['_model']['comments']['first']?this['_model']['comments']['first']['author']['name']:this['_localUser']['name'];return vt(this['locale'],'COMMENT_THREAD_LABEL',[_0x23c899,_0x56b0a4]);}),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x38a95f(),this['keystrokes']=new _0x33c420(),this['focusCycler']=new _0x332d41({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x3b924b=>_0x3b924b['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0x113c07(this,this['focusables']);}async['destroy'](){this['isDirty']=!0x1,this['commentsListView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}['_createCommentThreadInputView'](){const _0x43f477=new CommentThreadInputView(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x3aa466=_0x43f477['commentInputView'];return _0x43f477['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x3aa466,'value',(_0x42e4e5,_0x397432,_0x29a537,_0x13bd9e,_0x419aca)=>!!_0x419aca||!!_0x13bd9e&&_0x29a537&&!_0x397432||_0x42e4e5&&_0x29a537&&!_0x397432),_0x3aa466['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x10593f,_0x5d21c2,_0x3d854c)=>{let _0x3c373b;return _0x3c373b=_0x3d854c&&_0x5d21c2?'Reply\x20to\x20reopen\x20discussion...':_0x10593f?'Reply...':'Write\x20a\x20comment...',vt(this['locale'],_0x3c373b);}),_0x3aa466['bind']('submitLabel')['to'](this,'length',_0x1bfcc0=>vt(this['locale'],_0x1bfcc0?'Reply':'Comment')),_0x3aa466['on']('submit',(_0x23157f,_0x493399)=>{this['fire']('addComment',_0x493399),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x3aa466['on']('cancel',()=>{this['focus']();}),_0x3aa466['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x3aa466['on']('cancel',_0x4e255b=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x4e255b['stop']());}),this['on']('change:isActive',(_0x4369df,_0x1bf10f,_0x50fd82)=>{_0x50fd82||this['length']||_0x3aa466['value']||this['fire']('removeCommentThread');}),_0x43f477;}}class CommentThreadView extends/* #__PURE__ -- @preserve */ _0x62d738(BaseCommentThreadView){['commentThreadChildren'];['containerElement'];['resolveButton'];['_boundFirstCommentView'];constructor(_0x289167,_0x20b985,_0x4fd75c,_0x3363de){super(_0x289167,_0x20b985,_0x4fd75c,_0x3363de),this['commentThreadChildren']=this['createCollection']([this['commentsListView'],this['commentThreadInputView'],this['ariaDescriptionView']]),this['set']('actionIndicator',null),this['containerElement']=null,this['_boundFirstCommentView']=null,this['locale']=_0x289167,this['resolveButton']=this['_createResolveButton'](),this['setTemplate'](this['getTemplate']()),this['on']('change:isActive',(_0x3455ac,_0xb361e0,_0x2e77f9)=>{_0x2e77f9||this['_cancelAllConfirms']();}),this['listenTo'](this['_model'],'change:isReadOnly',(_0x2af360,_0x4bd6c4,_0x211bb5)=>{_0x211bb5&&this['_cancelAllConfirms']();}),this['length']>0x0&&this['_bindFirstCommentView'](),this['listenTo'](this['commentsListView']['commentViews'],'add',()=>{this['_bindFirstCommentView']();});}['getTemplate'](){const _0x1ee0ae=this['bindTemplate'];return{'tag':'div','attributes':{'class':['ck','ck-thread','ck-reset_all-excluded','ck-rounded-corners',_0x1ee0ae['if']('isActive','ck-thread--active'),_0x1ee0ae['if']('isUnlinked','ck-thread--unlinked'),_0x1ee0ae['to']('actionIndicator',_0x2703e9=>_0x2703e9?'ck-thread--'+_0x2703e9:'')],'data-thread-id':this['_model']['id'],'tabindex':0x0,'role':'listitem','aria-label':_0x1ee0ae['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 _0x29ddc1 of this['commentsListView']['commentViews'])_0x29ddc1['cancelConfirm']();}['_bindFirstCommentView'](){const {locale:_0x4bf095}=this,_0x51c20c=this['commentsListView']['commentViews']['get'](0x0);_0x51c20c===this['_boundFirstCommentView']||_0x51c20c['isSystemComment']||(this['_boundFirstCommentView']=_0x51c20c,this['unbind']('actionIndicator'),this['bind']('actionIndicator')['to'](_0x51c20c,'actionIndicator',_0x3b1a23=>'remove'===_0x3b1a23?'remove':null),_0x51c20c['placeholder']=vt(_0x4bf095,'Write\x20a\x20comment...'),_0x51c20c['removeButton']['on']('execute',_0x56dc30=>{_0x56dc30['stop'](),this['showConfirm'](vt(_0x4bf095,'Delete\x20comment\x20thread?'),this['containerElement'])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),this['on']('removeConfirm',()=>{_0x51c20c['focus']();}),_0x51c20c['actionBar']['add'](this['resolveButton'],0x0),_0x51c20c['focusables']['add'](this['resolveButton'],0x0));}['_createResolveButton'](){const _0x3f1cd1=new _0x4b87f3(this['locale']);return _0x3f1cd1['label']=vt(this['locale'],'Resolve'),_0x3f1cd1['tooltip']=vt(this['locale'],'Resolve'),_0x3f1cd1['icon']=_0x532667,_0x3f1cd1['extendTemplate']({'attributes':{'class':'ck-comment--resolve'}}),_0x3f1cd1['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x5bc516=>!_0x5bc516),_0x3f1cd1['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0xc8c891,_0x6757dc)=>_0xc8c891&&!_0x6757dc),_0x3f1cd1['on']('execute',()=>{this['fire']('resolveCommentThread',this['_model']['id']);}),_0x3f1cd1;}['_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 CommentContentView extends _0x5ad1e4{constructor(_0x722737){super(_0x722737),this['set']('content',''),this['setTemplate']({'tag':'div','attributes':{'class':['ck-content','ck-comment__content','ck-annotation__content']}});}['render'](){super['render'](),this['on']('change:content',(_0x197acd,_0x36fcbe,_0x31568c)=>{this['element']['innerHTML']=_0x31568c;}),this['element']['innerHTML']=this['content'];}}class BaseCommentView extends _0x5ad1e4{['visibleView'];['ariaDescriptionView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];['_model'];['_config'];constructor(_0x7440f7,_0x276161,_0x275cf4){super(_0x7440f7),this['_model']=_0x276161,this['_config']=_0x275cf4,this['isSystemComment']=!!this['_config']['isSystemComment'],this['set']('isEditMode',!0x1),this['set']('isCollapsed',!0x0),this['bind']('ariaLabel')['to'](_0x276161,'content',_0x276161,'authoredAt',(_0x341b3f,_0x5a0b6b)=>vt(_0x7440f7,'COMMENT_ARIA_LABEL',[_0x276161['author']['name'],_0x275cf4['formatDateTime'](_0x5a0b6b),new DOMParser()['parseFromString'](_0x341b3f,'text/html')['body']['textContent'],_0x276161['isExternal']?this['getExternalCommentNote']():''])),this['ariaDescriptionView']=new _0x53a347(_0x7440f7,vt(_0x7440f7,'COMMENT_THREAD_DESCRIPTION')),this['visibleView']=this['createCollection'](),this['visibleView']['add'](this['_createCommentContentView']()),this['focusables']=new tt(),this['focusTracker']=new _0x38a95f(),this['keystrokes']=new _0x33c420(),this['focusCycler']=new _0x332d41({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x1330af=>_0x1330af['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']?vt(this['locale'],'EXTERNAL_IMPORT_WORD_COMMENT'):vt(this['locale'],'EXTERNAL_COMMENT');}['getUserViewNotificationText'](){return this['_model']['isExternal']?'importWord'===this['_model']['attributes']['@external']['source']?vt(this['locale'],'EXTERNAL_IMPORT_WORD_AVATAR',this['_model']['creator']['name']):vt(this['locale'],'EXTERNAL_AVATAR',this['_model']['creator']['name']):null;}['_createCommentContentView'](){const _0x3962a9=new CommentContentView(this['locale']);return _0x3962a9['bind']('content')['to'](this['_model'],'content',this,'isCollapsed',(_0x308770,_0x136c2d)=>_0x136c2d?_0x14a3ac(_0x308770,{'limit':this['_config']['maxCommentCharsWhenCollapsed']}):_0x308770),_0x3962a9;}['_createCommentInputView'](){this['_config']['editorConfig']||(this['_config']['editorConfig']={}),this['_config']['editorConfig']['initialData']=this['_model']['content'];const _0x2bfeed=new CommentInputView(this['locale'],this['_config']['editorConfig']);return _0x2bfeed['value']=this['_model']['content'],_0x2bfeed['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x2bfeed['submitLabel']=vt(this['locale'],'Save'),_0x2bfeed['on']('submit',(_0x1ec865,_0x2d6436)=>{this['fire']('updateComment',this['_model']['id'],_0x2d6436),this['switchToDisplayMode'](),this['focus']();}),_0x2bfeed['on']('cancel',()=>{this['switchToDisplayMode'](),this['focus']();}),_0x2bfeed['once']('editorReady',()=>{_0x2bfeed['focus']();}),_0x2bfeed['createEditor'](),_0x2bfeed['delegate']('editorReady')['to'](this),_0x2bfeed['delegate']('editorDestroyed')['to'](this),_0x2bfeed;}['_setupKeyboardNavigation'](){const _0x3dd91d=this['element'];this['keystrokes']['listenTo'](_0x3dd91d);for(const _0x1823bf of this['focusables'])this['focusTracker']['add'](_0x1823bf['element']),this['keystrokes']['listenTo'](_0x1823bf['element']);this['focusables']['on']('change',(_0x5c2fbe,_0x160950)=>{for(const _0x4d537c of _0x160950['removed'])this['focusTracker']['remove'](_0x4d537c['element']),this['keystrokes']['stopListening'](_0x4d537c['element']);for(const _0x1313ec of _0x160950['added'])this['focusTracker']['add'](_0x1313ec['element']),this['keystrokes']['listenTo'](_0x1313ec['element']);}),this['keystrokes']['set']('enter',(_0x1e2372,_0x47a4be)=>{_0x3dd91d===_0x1e2372['target']&&(this['focusCycler']['focusFirst'](),_0x47a4be());}),this['keystrokes']['set']('esc',(_0x4e4e9a,_0x5cd9b3)=>{_0x3dd91d!==_0x4e4e9a['target']&&(this['focus'](),_0x5cd9b3());});}}class CommentView extends/* #__PURE__ -- @preserve */ _0x62d738(BaseCommentView){['actionBar'];['userView'];constructor(_0x458136,_0x4a16d9,_0x4e012f){super(_0x458136,_0x4a16d9,_0x4e012f),this['set']('actionIndicator',null),this['set']('placeholder',vt(_0x458136,'Reply...')),this['bind']('authoredAt')['to'](_0x4a16d9),this['bind']('resolvedAt')['to'](_0x4a16d9),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 _0x4b944c(_0x458136,_0x4a16d9['author'],this['getUserViewNotificationText']()),this['userView']['extendTemplate']({'attributes':{'class':['ck-comment__user','ck-annotation__user'],'aria-hidden':!0x0}}),this['listenTo'](_0x4a16d9,'change:isRemovable',()=>this['cancelConfirm']()),this['setTemplate'](this['getTemplate']());}['getTemplate'](){const _0x276a67=this['bindTemplate'],_0x8e0a61=[{'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':_0x276a67['to']('authoredAt'),'class':['ck-comment__info-time','ck-annotation__info-time']},'children':[{'text':_0x276a67['to']('authoredAt',_0x2eedfc=>this['_config']['formatDateTime'](_0x2eedfc))}]}]},{'tag':'div','attributes':{'class':['ck-comment__actions','ck-annotation__actions',_0x276a67['if']('isEditMode','ck-comment__actions--hidden'),_0x276a67['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']&&_0x8e0a61['push']({'tag':'div','attributes':{'class':['ck-comment__external']},'children':[{'text':this['getExternalCommentNote']()}]}),{'tag':'li','attributes':{'class':['ck-comment__wrapper'],'tabindex':-0x1,'aria-label':_0x276a67['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id'],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck-comment','ck-annotation',_0x276a67['if']('isEditMode','ck-comment--edit'),_0x276a67['if']('isSystemComment','ck-comment--info'),_0x276a67['to']('actionIndicator',_0xc131aa=>_0xc131aa?'ck-comment--'+_0xc131aa:'')],'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':_0x8e0a61}]}]};}['_createEditButton'](){const _0x85f757=new _0x4fe59a(this['locale']);return _0x85f757['label']=vt(this['locale'],'Edit'),_0x85f757['icon']=_0x2e5494,_0x85f757['withText']=!0x0,_0x85f757['extendTemplate']({'attributes':{'class':'ck-comment--edit'}}),_0x85f757['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x49a833=>!_0x49a833),_0x85f757['bind']('isVisible')['to'](this['_model'],'isEditable'),_0x85f757['on']('execute',()=>this['switchToEditMode']()),_0x85f757;}['_createRemoveButton'](){const _0x30242e=new _0x4fe59a(this['locale']);return _0x30242e['label']=vt(this['locale'],'Remove'),_0x30242e['icon']=_0x82b7cd,_0x30242e['withText']=!0x0,_0x30242e['extendTemplate']({'attributes':{'class':'ck-comment--remove'}}),_0x30242e['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x544291=>!_0x544291),_0x30242e['bind']('isVisible')['to'](this['_model'],'isRemovable'),_0x30242e['on']('execute',()=>{this['showConfirm'](vt(this['locale'],'Delete\x20comment?'),this['element'])['then'](()=>{this['fire']('removeComment',this['_model']['id']);});}),_0x30242e;}['_createDropdown'](){const _0x5b37dc=et(this['locale'],_0x47c53c),_0x1ee934=_0x5b37dc['panelView']['children'],_0x330611=new it(this['locale']),_0x3836fb=_0x5b37dc['bindTemplate'];st(_0x5b37dc,()=>this['items']['find'](_0x220796=>_0x220796['isVisible'])),_0x5b37dc['extendTemplate']({'attributes':{'class':[_0x3836fb['if']('isVisible','ck-hidden',_0x12e7c1=>!_0x12e7c1)]}});const _0x32b1d4=(_0x4c657f,_0x31d57c=-0x1)=>{const _0x542c15=new nt(this['locale']);_0x542c15['children']['add'](_0x4c657f);const _0x3fc5c3=_0x31d57c>-0x1?_0x31d57c:_0x330611['items']['length'];_0x330611['items']['add'](_0x542c15,_0x3fc5c3);const _0x591991=Array['from'](this['items']);_0x5b37dc['unbind']('isEnabled','isVisible'),_0x5b37dc['bind']('isEnabled')['toMany'](_0x591991,'isEnabled',(..._0x4a46a4)=>_0x4a46a4['some'](_0x512d98=>_0x512d98)),_0x5b37dc['bind']('isVisible')['toMany'](_0x591991,'isVisible',(..._0x2c4bac)=>_0x2c4bac['some'](_0x4270ef=>_0x4270ef));};_0x5b37dc['panelPosition']='sw',_0x5b37dc['buttonView']['set']({'label':vt(this['locale'],'Show\x20more\x20items'),'icon':_0x58b294});for(const _0x462335 of this['items'])_0x32b1d4(_0x462335);return _0x1ee934['add'](_0x330611),_0x5b37dc['listenTo'](this['items'],'add',(_0x3ad0fd,_0x4fe40f,_0x21cf04)=>{_0x32b1d4(_0x4fe40f,_0x21cf04);}),_0x5b37dc['listenTo'](this['items'],'remove',(_0xd9aff6,_0x41d6a8,_0x787804)=>{_0x330611['items']['remove'](_0x787804);}),_0x5b37dc;}['_attachActions'](_0x406b5a,_0xbbacfb){const _0x238735=_0x406b5a&&_0x406b5a['element'];_0x238735&&(this['listenTo'](_0x238735,'mouseenter',()=>this['actionIndicator']=_0xbbacfb),this['listenTo'](_0x238735,'focus',()=>this['actionIndicator']=_0xbbacfb),this['listenTo'](_0x238735,'mouseleave',()=>this['actionIndicator']=null),this['listenTo'](_0x238735,'blur',()=>this['actionIndicator']=null));}['_createCommen