UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

28 lines • 193 kB
/* * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * * * * * +---------------------------------------------------------------------------------+ * | | * | Hello stranger! | * | | * | | * | What you're currently looking at is the source code of a legally protected, | * | proprietary software. Any attempts to deobfuscate / disassemble this code | * | are forbidden and will result in legal consequences. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ import{Editor as _0x434303,ContextPlugin as _0x52f8b3,PendingActions as lt,Command as _0xf16dec,Plugin as _0x12e706,Context as _0x460ccf}from'@ckeditor/ckeditor5-core/dist/index.js';import{ObservableMixin as _0xb7886b,uid as _0x2e50a3,KeystrokeHandler as jt,FocusTracker as _0x5dc459,diff as _0x2ab04e,Collection as _0x5bc00b,Rect as _0x217dc0,CKEditorError as _0x4219d1,first as _0x57616a,priorities as Wt,scrollViewportToShowTarget as nt,getEnvKeystrokeText as tt,toUnit as Ht,DomEmitterMixin as _0x540dcd,keyCodes as _0x17c74f}from'@ckeditor/ckeditor5-utils/dist/index.js';import{UserView as _0x401199,AriaDescriptionView as Yt,setupThreadKeyboardNavigation as Zt,ConfirmMixin as ti,LateFocusButtonView as _0x3dc32b,trimHtml as ts,LateFocusDropdownButtonView as _0x3f239f,Users as it,getDateTimeFormatter as pt,hashObject as It,getAllMarkersDomElementsSorted as et,surroundingMarkersDetector as rt,FOCUS_ANNOTATION_KEYSTROKE as _0x3f8975}from'ckeditor5-collaboration/dist/index.js';import{throttle as Dt,isEqual as At,cloneDeep as wt,set as yt,unset as Ct,debounce as _0x587a9f}from'es-toolkit/compat';import{IconUndo as _0x5c9fff,IconCheck as _0x20566d,IconPencil as _0x3ab1ba,IconRemoveComment as _0x184855,IconThreeVerticalDots as _0x514ed2,IconAddComment as _0x4ca544,IconCommentsArchive as _0x52f6c8}from'@ckeditor/ckeditor5-icons/dist/index.js';import{EditorUIView as $t,InlineEditableUIView as Vt,EditorUI as Ut,View as kt,FocusCycler as _0x4fb0fe,ButtonView as _0x1523c0,ViewCollection as _0x30c6ce,createDropdown as _0x25794d,ListView as _0x518b96,focusChildOnDropdownOpen as _0x2fb599,ListItemView as _0x332576,MenuBarMenuListItemButtonView as _0x387789,BodyCollection as _0x2e26b2,BalloonPanelView as _0x4b2067,ContextualBalloon as _0x4f0c7f,Dialog as _0x1cfc6f,DialogViewPosition as _0x11ecb3}from'@ckeditor/ckeditor5-ui/dist/index.js';import{disableViewPlaceholder as St,enableViewPlaceholder as Ft,MouseObserver as _0x38bb3e}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 _0x460595}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{toWidget as _0x341f57}from'@ckeditor/ckeditor5-widget/dist/index.js';class vt extends/* #__PURE__ -- @preserve */ _0xb7886b(){['model'];['view'];constructor(_0x383092,_0x9e709d){super(),this['model']=_0x383092,this['model']['_isAttached']=!0x0,this['view']=_0x9e709d,this['listenTo'](_0x9e709d,'submitCommentThread',()=>this['submit']()),this['listenTo'](_0x9e709d,'removeCommentThread',()=>this['remove']()),this['listenTo'](_0x9e709d,'resolveCommentThread',()=>this['resolve']()),this['listenTo'](_0x9e709d,'reopenCommentThread',()=>this['reopen']()),this['listenTo'](_0x9e709d,'addComment',(_0x392596,_0x25cf25)=>this['addComment'](_0x25cf25)),this['listenTo'](_0x9e709d,'updateComment',(_0x2dcf0f,_0x3ddfcd,_0x589256)=>this['updateComment'](_0x3ddfcd,_0x589256)),this['listenTo'](_0x9e709d,'removeComment',(_0x244a0b,_0x5bd14e)=>this['removeComment'](_0x5bd14e));}['submit'](){this['model']['submit']();}['remove'](){this['model']['remove']();}['resolve'](){this['model']['isResolved']||this['model']['resolve']();}['reopen'](){this['model']['isResolved']&&this['model']['reopen']();}['addComment'](_0x24da4b){this['model']['addComment']({'content':_0x24da4b,'authorId':this['view']['_localUser']['id']});}['updateComment'](_0x4e9070,_0x291855){this['model']['getComment'](_0x4e9070)['update']({'content':_0x291855});}['removeComment'](_0x2b4b9b){this['model']['getComment'](_0x2b4b9b)['remove']();}['destroy'](){this['stopListening'](),this['model']['_isAttached']=!0x1;}}function N(_0x3f7c99,_0x4a80f6,_0xd5d112){const t=_0x3f7c99['t'];switch(_0x4a80f6){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'},_0xd5d112);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'},_0xd5d112);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'},_0xd5d112);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'},_0xd5d112);case'NUMBER_OF_COMMENTS':return t({'string':'%0\x20Comment','plural':'%0\x20Comments','id':'NUMBER_OF_COMMENTS'},_0xd5d112);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'},_0xd5d112);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'},_0xd5d112);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'},_0xd5d112);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(_0x1b9dee,_0x1f04bc){super(_0x1b9dee);const _0x49abca=_0x2e50a3();this['main']=this['createCollection'](),this['editable']=new Vt(_0x1b9dee,_0x1f04bc,void 0x0,{'label':()=>N(_0x1b9dee,'Comment\x20editor')}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-editor','ck-rounded-corners','ck-comment__input'],'dir':_0x1b9dee['uiLanguageDirection'],'lang':_0x1b9dee['uiLanguage'],'aria-labelledby':'cke-editor__aria-label_'+_0x49abca},'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(_0x5c68f5){super(_0x5c68f5),this['view']=new Rt(_0x5c68f5['locale'],_0x5c68f5['editing']['view']);}get['element'](){return this['view']['element'];}['init'](){const _0x1ab703=this['editor']['editing']['view'],_0x499fe2=this['view']['editable'],_0x3e6178=_0x1ab703['document']['getRoot']();_0x499fe2['name']=_0x3e6178['rootName'],this['view']['render']();const _0x48eb1a=_0x499fe2['element'];this['setEditableElement'](_0x499fe2['name'],_0x48eb1a),this['view']['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x1ab703['attachDomRoot'](_0x48eb1a),this['fire']('ready');}['destroy'](){super['destroy'](),this['view']['destroy']();}}const Qt=[qt,zt,Bt,Gt,Jt,Kt,Lt];class hs extends/* #__PURE__ -- @preserve */ _0xb7886b(_0x434303){static ['defaultPlugins']=/* #__PURE__ -- @preserve */ ((()=>Qt)());constructor(_0x5397de={}){function _0x42e91d(_0x12ad6a){return _0x12ad6a['map'](_0x2d7587=>String['fromCharCode'](_0x2d7587))['join']('');}(_0x5397de=Object['assign']({},_0x5397de))['plugins']||(_0x5397de['plugins']=hs['defaultPlugins']),super(_0x5397de),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[_0x42e91d([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x42e91d([0x76,0x69,0x65,0x77])][_0x42e91d([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x42e91d([0x61,0x75,0x74,0x6f]),this[_0x42e91d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74])]=()=>window[_0x42e91d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x42e91d([0x72,0x65,0x73,0x6f,0x6c,0x76,0x65])]({[_0x42e91d([0x73,0x74,0x61,0x74,0x75,0x73])]:_0x42e91d([0x6f,0x6b])});}['create'](){const _0x2c0b93=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x2c0b93))['then'](()=>this['fire']('ready'));}['destroy'](){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0x2d895a=>{const _0xde5411=this['model']['document']['getRoot'](),_0x4d312a=_0xde5411&&_0xde5411['getChild'](_0xde5411['childCount']-0x1);_0x2d895a['setSelection'](_0x4d312a,'end'),this['editing']['view']['focus']();});}['_updatePlaceholder'](){const _0x18af2a=this['editing']['view'],_0x3c6b10=_0x18af2a['document']['getRoot'](),_0x2d9190=_0x3c6b10['getChild'](0x0);_0x3c6b10['childCount']>0x1||!_0x2d9190||'p'!=_0x2d9190['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(St(_0x18af2a,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x2d9190['placeholder']=this['placeholder']),Ft({'view':_0x18af2a,'element':_0x2d9190,'keepOnFocus':!0x0}),this['placeholderElement']=_0x2d9190);}}class es extends kt{['keystrokes'];['focusTracker'];['focusables'];['focusCycler'];['submitButtonView'];['cancelButtonView'];['_editorConfig'];constructor(_0x27f7f9,_0x44117c={}){super(_0x27f7f9),this['editor']=null,this['_editorConfig']=_0x44117c,this['set']('value',_0x44117c['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',N(_0x27f7f9,'Reply...')),this['set']('submitLabel',N(_0x27f7f9,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['submitButtonView'],this['cancelButtonView']]),this['keystrokes']=new jt(),this['focusTracker']=new _0x5dc459(),this['focusCycler']=new _0x4fb0fe({'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',(_0x146555,_0x3d44a6)=>{this['cancelButtonView']['fire']('execute'),_0x3d44a6();}),this['keystrokes']['set']('Ctrl+Enter',(_0x68c0a0,_0x1aa4d7)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x1aa4d7());}),this['on']('submit',(_0x23dd39,_0x583b0c)=>{_0x583b0c['length']>0xfde8?(alert(N(_0x27f7f9,'TOO_LONG_COMMENT_ALERT',[_0x583b0c['length'],0xfde8])),_0x23dd39['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 _0x131b39=this['editor'];this['element']['insertBefore'](_0x131b39['ui']['element'],this['element']['firstChild']),_0x131b39['model']['document']['on']('change',()=>this['value']=_0x131b39['getData']()),_0x131b39['bind']('placeholder')['to'](this),this['focusables']['add'](_0x131b39['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x4fe2e5){-0x1===_0x4fe2e5?(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:_0x5946a2}=this,_0x2bf594=new _0x1523c0(_0x5946a2);return _0x2bf594['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--submit']}}),_0x2bf594['withText']=!0x0,_0x2bf594['bind']('label')['to'](this,'submitLabel'),_0x2bf594['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x2bf594['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0xf8e4c5,_0x2fdd21)=>!_0x2fdd21&&!!_0xf8e4c5['trim']()),_0x2bf594;}['_createCancelButton'](){const {locale:_0x295161}=this,_0x458e75=new _0x1523c0(_0x295161);return _0x458e75['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x458e75['label']=N(_0x295161,'Cancel'),_0x458e75['withText']=!0x0,_0x458e75['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x458e75;}['_setupKeyboardNavigation'](){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x5ae2d5=>{this['focusTracker']['add'](_0x5ae2d5['element']);}),this['focusables']['on']('change',(_0x50fdd0,_0x24448f)=>{for(const _0x5c3d5f of Array['from'](_0x24448f['added'])['reverse']())this['focusTracker']['add'](_0x5c3d5f['element']);});}}class ie extends kt{constructor(_0x5f5035,_0x4598a5,_0x46c449){super(_0x5f5035),this['commentInputView']=new es(_0x5f5035,_0x46c449),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x38503b,_0x39c21c)=>_0x38503b||!!_0x39c21c),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 _0x401199(_0x5f5035,_0x4598a5),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'](_0x5ada42){this['commentInputView']['focus'](_0x5ada42);}['_focusOnNonInteractiveMouseDown'](){this['listenTo'](this['element'],'mousedown',(_0x4d1983,_0x35493d)=>{const {submitButtonView:_0x303a05,cancelButtonView:_0x2009f5,editor:_0x4b4433}=this['commentInputView'];[_0x303a05['element'],_0x2009f5['element'],_0x4b4433?_0x4b4433['editing']['view']['getDomRoot']():null]['filter'](_0x2d00c3=>_0x2d00c3)['some'](_0x5cadc5=>_0x5cadc5['contains'](_0x35493d['target']))||(this['focus'](),_0x35493d['preventDefault']());});}}class rs extends kt{constructor(_0x1b7eb2){super(_0x1b7eb2);const _0x45231a=this['bindTemplate'];this['set']('count',void 0x0),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[{'text':_0x45231a['to']('count',_0x4fd34b=>N(_0x1b7eb2,'NUMBER_OF_COMMENTS',_0x4fd34b))}]});}}class te extends kt{['commentViews'];['resolvedCommentView'];['focusTracker'];['keystrokes'];['focusCycler'];['_model'];['_config'];['_collapsedCommentsView'];constructor(_0xbc45,_0x2f4dbd,_0x2ee2cf){super(_0xbc45);const _0x221cbb=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x2f4dbd['comments']['length']),this['set']('isActive',!0x1),this['_model']=_0x2f4dbd,this['_config']=_0x2ee2cf,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x5dc459(),this['keystrokes']=new jt(),this['focusCycler']=new _0x4fb0fe({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0xbeff62=>this['commentViews']['map'](_0x1af72a=>_0x1af72a['element'])['includes'](_0xbeff62['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new rs(_0xbc45),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x36bc4f=>_0x36bc4f-this['_config']['maxCommentsWhenCollapsed']);for(const _0x326ac4 of _0x2f4dbd['comments'])this['_handleNewCommentModel'](_0x326ac4);this['_handleInfoComment'](),this['listenTo'](_0x2f4dbd['comments'],'add',(_0x20b7ee,_0xdae4b0)=>{const _0x168ef2=this['_calculatePosition'](_0xdae4b0);this['length']++,this['_handleNewCommentModel'](_0xdae4b0,_0x168ef2),this['refreshVisibleViews']();}),this['listenTo'](_0x2f4dbd['comments'],'remove',(_0x4c860e,_0x62dee1)=>{this['length']--,this['_handleRemoveCommentModel'](_0x62dee1),this['refreshVisibleViews']();}),this['listenTo'](_0x2f4dbd,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x2f4dbd,'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',_0x221cbb['if']('length','ck-hidden',_0x14a2e5=>!_0x14a2e5)],'aria-label':N(_0xbc45,'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'](_0x34c6eb){-0x1===_0x34c6eb?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['destroy'](){this['_collapsedCommentsView']['destroy']();for(const _0x5a4b49 of this['commentViews'])_0x5a4b49['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}['_handleNewCommentModel'](_0xa7345b,_0x324e94){const _0x5c1a11=new this['_config']['CommentView'](this['locale'],_0xa7345b,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x5c1a11['viewUid']=_0xa7345b['id'],_0x5c1a11['delegate']('removeComment')['to'](this),_0x5c1a11['delegate']('updateComment')['to'](this),_0x5c1a11['delegate']('resolveCommentThread')['to'](this),_0x5c1a11['delegate']('editorReady')['to'](this),_0x5c1a11['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x5c1a11,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x5c1a11,_0x324e94);}['_calculatePosition'](_0x5d55da){const _0x50e2c8=this['_model']['_findOptimalIndex'](_0x5d55da);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x5d55da['authoredAt']?_0x50e2c8-0x1:_0x50e2c8:_0x50e2c8-0x1;}['_handleInfoComment'](){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x3daec1={'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'],_0x3daec1,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x3daec1));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}['_handleRemoveCommentModel'](_0x5e91a8){const _0x2f9c29=this['commentViews']['remove'](_0x5e91a8['id']);this['stopListening'](_0x2f9c29),_0x2f9c29['isEditMode']&&this['_updateHasDirtyComment'](),_0x2f9c29['destroy']();}['_updateHasDirtyComment'](){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x21e375=>_0x21e375['isEditMode']);}['_rearrangeCollapse'](){const _0x177652=function(_0x27495c){const _0x3d6cb5=new _0x5bc00b();for(const _0xf40cf8 of _0x27495c)_0x3d6cb5['add'](_0xf40cf8);return _0x3d6cb5;}(this['commentViews']),_0x186e00=this['_collapsedCommentsView']['count'];for(let _0x1afbf6=0x1;_0x1afbf6<=_0x186e00;_0x1afbf6++)_0x177652['remove'](0x1);for(const _0x542d74 of _0x177652)_0x542d74['collapse']();_0x186e00>0x0&&_0x177652['add'](this['_collapsedCommentsView'],0x1),ns(_0x2ab04e(Array['from'](this['visibleViews']),Array['from'](_0x177652)),this['visibleViews'],_0x177652);}['_rearrangeExpand'](){ns(_0x2ab04e(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x3de65e of this['visibleViews'])_0x3de65e['expand']();}['_setupKeyboardNavigation'](){this['commentViews']['forEach'](_0x4509a7=>{this['focusTracker']['add'](_0x4509a7['element']),this['keystrokes']['listenTo'](_0x4509a7['element']);}),this['commentViews']['on']('change',(_0x432305,_0x2253b0)=>{for(const _0xf5335b of _0x2253b0['removed'])this['focusTracker']['remove'](_0xf5335b['element']),this['keystrokes']['stopListening'](_0xf5335b['element']);for(const _0x20e993 of Array['from'](_0x2253b0['added'])['reverse']())this['focusTracker']['add'](_0x20e993['element']),this['keystrokes']['listenTo'](_0x20e993['element']);});}}function ns(_0x2af7fa,_0x43e75f,_0x298f9b){let _0x433694=0x0;for(const _0x103079 of _0x2af7fa)switch(_0x103079){case'insert':_0x43e75f['add'](_0x298f9b['get'](_0x433694),_0x433694),_0x433694++;break;case'delete':_0x43e75f['remove'](_0x433694);break;case'equal':_0x433694++;}}class oe extends kt{constructor(_0x394cfb){super(_0x394cfb);const _0x1d4094=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x1d4094['to']('contextValue',_0x498104=>N(_0x394cfb,'THREAD_CONTEXT_LABEL',_0x498104)),'tabindex':-0x1},'children':[{'text':_0x1d4094['to']('contextValue')}]});}['focus'](){this['element']['focus']();}}class Xt extends kt{['_model'];['reopenButtonView'];['contextView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];constructor(_0x518920,_0x137508){super(_0x518920);const _0x45385f=this['bindTemplate'];this['_model']=_0x137508,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x5dc459(),this['keystrokes']=new jt(),this['focusCycler']=new _0x4fb0fe({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x3dbbc0=>!!_0x3dbbc0),this['bind']('contextValue')['to'](this['_model'],'context',_0x2a447b=>_0x2a447b&&_0x2a447b['value']?this['_trimContextValue'](_0x2a447b['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',_0x45385f['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 _0x7bd0a8=new _0x1523c0(this['locale']);return _0x7bd0a8['label']=N(this['locale'],'Reopen'),_0x7bd0a8['tooltip']=N(this['locale'],'Reopen'),_0x7bd0a8['icon']=_0x5c9fff,_0x7bd0a8['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0xf90333=>!_0xf90333),_0x7bd0a8['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x489cbc,_0x3e3f05)=>_0x489cbc&&_0x3e3f05),_0x7bd0a8['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x7bd0a8;}['_trimContextValue'](_0x382b67){if(_0x382b67['length']<0x96)return _0x382b67;const _0x304d86=_0x382b67['lastIndexOf']('\x20',0x93);return _0x382b67['substring'](0x0,_0x304d86>-0x1?_0x304d86:0x93)+'...';}['_attachContextActions'](){const _0x10f182=this['element']['querySelector']('.ck-context'),_0x62e55e=_0x10f182['querySelector']('.ck-context__value');this['listenTo'](_0x10f182,'mouseenter',()=>{_0x62e55e['offsetWidth']<_0x62e55e['scrollWidth']&&_0x10f182['classList']['add']('overlay');}),this['listenTo'](_0x10f182,'mouseleave',()=>{_0x10f182['classList']['remove']('overlay');});}['_setupKeyboardNavigation'](){this['keystrokes']['listenTo'](this['element']);for(const _0x42750f of this['focusables'])this['focusTracker']['add'](_0x42750f['element']),this['keystrokes']['listenTo'](_0x42750f['element']);}['_createContextView'](){const _0x1eb8a8=new oe(this['locale']);return _0x1eb8a8['bind']('contextValue')['to'](this),_0x1eb8a8;}}class si extends kt{['_model'];['_config'];['commentThreadHeaderView'];['commentThreadInputView'];['ariaDescriptionView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];constructor(_0x4478f1,_0x696c38,_0x472c09,_0x3d8d98){super(_0x4478f1),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x696c38,this['_localUser']=_0x472c09,this['_config']=_0x3d8d98,this['commentThreadHeaderView']=new Xt(_0x4478f1,_0x696c38),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new Yt(_0x4478f1,N(_0x4478f1,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new te(_0x4478f1,_0x696c38,Object['assign']({'CommentView':this['_config']['CommentView']},_0x3d8d98)),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',(_0x166423,_0x159eb6)=>_0x166423||!!_0x159eb6),this['bind']('isUnlinked')['to'](_0x696c38,'unlinkedAt',_0xbf82c=>!!_0xbf82c),this['bind']('ariaLabel')['to'](this,'length',_0x3bb9b5=>{const _0xe8c753=this['_model']['comments']['first']?this['_model']['comments']['first']['author']['name']:this['_localUser']['name'];return N(this['locale'],'COMMENT_THREAD_LABEL',[_0x3bb9b5,_0xe8c753]);}),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x5dc459(),this['keystrokes']=new jt(),this['focusCycler']=new _0x4fb0fe({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0xe9dd1=>_0xe9dd1['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 _0x5810d0=new ie(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x29e314=_0x5810d0['commentInputView'];return _0x5810d0['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x29e314,'value',(_0x12bbab,_0x26bb12,_0x28f843,_0xa502a1,_0x190d8e)=>!!_0x190d8e||!!_0xa502a1&&_0x28f843&&!_0x26bb12||_0x12bbab&&_0x28f843&&!_0x26bb12),_0x29e314['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x2f1a86,_0x47311f,_0x48af5b)=>{let _0xf2b1bb;return _0xf2b1bb=_0x48af5b&&_0x47311f?'Reply\x20to\x20reopen\x20discussion...':_0x2f1a86?'Reply...':'Write\x20a\x20comment...',N(this['locale'],_0xf2b1bb);}),_0x29e314['bind']('submitLabel')['to'](this,'length',_0x2fa2a7=>N(this['locale'],_0x2fa2a7?'Reply':'Comment')),_0x29e314['on']('submit',(_0x2a2cba,_0x1abce2)=>{this['fire']('addComment',_0x1abce2),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x29e314['on']('cancel',()=>{this['focus']();}),_0x29e314['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x29e314['on']('cancel',_0x3d23d3=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x3d23d3['stop']());}),this['on']('change:isActive',(_0x5d15cf,_0x21d06f,_0x14e3ba)=>{_0x14e3ba||this['length']||_0x29e314['value']||this['fire']('removeCommentThread');}),_0x5810d0;}}class gt extends/* #__PURE__ -- @preserve */ ti(si){['commentThreadChildren'];['containerElement'];['resolveButton'];['_boundFirstCommentView'];constructor(_0x2fa601,_0x36b858,_0x2524c5,_0xf567c9){super(_0x2fa601,_0x36b858,_0x2524c5,_0xf567c9),this['commentThreadChildren']=this['createCollection']([this['commentsListView'],this['commentThreadInputView'],this['ariaDescriptionView']]),this['set']('actionIndicator',null),this['containerElement']=null,this['_boundFirstCommentView']=null,this['locale']=_0x2fa601,this['resolveButton']=this['_createResolveButton'](),this['setTemplate'](this['getTemplate']()),this['on']('change:isActive',(_0x4ccf8f,_0x436eeb,_0x2e78d3)=>{_0x2e78d3||this['_cancelAllConfirms']();}),this['listenTo'](this['_model'],'change:isReadOnly',(_0x376e85,_0x54a7a4,_0x3aef11)=>{_0x3aef11&&this['_cancelAllConfirms']();}),this['length']>0x0&&this['_bindFirstCommentView'](),this['listenTo'](this['commentsListView']['commentViews'],'add',()=>{this['_bindFirstCommentView']();});}['getTemplate'](){const _0x2f3d38=this['bindTemplate'];return{'tag':'div','attributes':{'class':['ck','ck-thread','ck-reset_all-excluded','ck-rounded-corners',_0x2f3d38['if']('isActive','ck-thread--active'),_0x2f3d38['if']('isUnlinked','ck-thread--unlinked'),_0x2f3d38['to']('actionIndicator',_0x2677e2=>_0x2677e2?'ck-thread--'+_0x2677e2:'')],'data-thread-id':this['_model']['id'],'tabindex':0x0,'role':'listitem','aria-label':_0x2f3d38['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 _0x10c890 of this['commentsListView']['commentViews'])_0x10c890['cancelConfirm']();}['_bindFirstCommentView'](){const {locale:_0x201aa1}=this,_0x3f09e8=this['commentsListView']['commentViews']['get'](0x0);_0x3f09e8===this['_boundFirstCommentView']||_0x3f09e8['isSystemComment']||(this['_boundFirstCommentView']=_0x3f09e8,this['unbind']('actionIndicator'),this['bind']('actionIndicator')['to'](_0x3f09e8,'actionIndicator',_0x499f9d=>'remove'===_0x499f9d?'remove':null),_0x3f09e8['placeholder']=N(_0x201aa1,'Write\x20a\x20comment...'),_0x3f09e8['removeButton']['on']('execute',_0x4c1bf5=>{_0x4c1bf5['stop'](),this['showConfirm'](N(_0x201aa1,'Delete\x20comment\x20thread?'),this['containerElement'])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),this['on']('removeConfirm',()=>{_0x3f09e8['focus']();}),_0x3f09e8['actionBar']['add'](this['resolveButton'],0x0),_0x3f09e8['focusables']['add'](this['resolveButton'],0x0));}['_createResolveButton'](){const _0x7de56a=new _0x3dc32b(this['locale']);return _0x7de56a['label']=N(this['locale'],'Resolve'),_0x7de56a['tooltip']=N(this['locale'],'Resolve'),_0x7de56a['icon']=_0x20566d,_0x7de56a['extendTemplate']({'attributes':{'class':'ck-comment--resolve'}}),_0x7de56a['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x1ea5a2=>!_0x1ea5a2),_0x7de56a['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x4e2aa2,_0x1a561b)=>_0x4e2aa2&&!_0x1a561b),_0x7de56a['on']('execute',()=>{this['fire']('resolveCommentThread',this['_model']['id']);}),_0x7de56a;}['_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(_0x314caa){super(_0x314caa),this['set']('content',''),this['setTemplate']({'tag':'div','attributes':{'class':['ck-content','ck-comment__content','ck-annotation__content']}});}['render'](){super['render'](),this['on']('change:content',(_0x4beb45,_0x2dfdf9,_0x2a28ef)=>{this['element']['innerHTML']=_0x2a28ef;}),this['element']['innerHTML']=this['content'];}}class di extends kt{['visibleView'];['ariaDescriptionView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];['_model'];['_config'];constructor(_0x19cb82,_0x1ac2dd,_0x51416){super(_0x19cb82),this['_model']=_0x1ac2dd,this['_config']=_0x51416,this['isSystemComment']=!!this['_config']['isSystemComment'],this['set']('isEditMode',!0x1),this['set']('isCollapsed',!0x0),this['bind']('ariaLabel')['to'](_0x1ac2dd,'content',_0x1ac2dd,'authoredAt',(_0x38e571,_0x53208d)=>N(_0x19cb82,'COMMENT_ARIA_LABEL',[_0x1ac2dd['author']['name'],_0x51416['formatDateTime'](_0x53208d),new DOMParser()['parseFromString'](_0x38e571,'text/html')['body']['textContent'],_0x1ac2dd['isExternal']?this['getExternalCommentNote']():''])),this['ariaDescriptionView']=new Yt(_0x19cb82,N(_0x19cb82,'COMMENT_THREAD_DESCRIPTION')),this['visibleView']=this['createCollection'](),this['visibleView']['add'](this['_createCommentContentView']()),this['focusables']=new _0x30c6ce(),this['focusTracker']=new _0x5dc459(),this['keystrokes']=new jt(),this['focusCycler']=new _0x4fb0fe({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x4b0ee3=>_0x4b0ee3['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 _0x133556=new is(this['locale']);return _0x133556['bind']('content')['to'](this['_model'],'content',this,'isCollapsed',(_0x4977ea,_0xcf38c9)=>_0xcf38c9?ts(_0x4977ea,{'limit':this['_config']['maxCommentCharsWhenCollapsed']}):_0x4977ea),_0x133556;}['_createCommentInputView'](){this['_config']['editorConfig']||(this['_config']['editorConfig']={}),this['_config']['editorConfig']['initialData']=this['_model']['content'];const _0x11a87c=new es(this['locale'],this['_config']['editorConfig']);return _0x11a87c['value']=this['_model']['content'],_0x11a87c['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x11a87c['submitLabel']=N(this['locale'],'Save'),_0x11a87c['on']('submit',(_0x33ac13,_0x4f68b2)=>{this['fire']('updateComment',this['_model']['id'],_0x4f68b2),this['switchToDisplayMode'](),this['focus']();}),_0x11a87c['on']('cancel',()=>{this['switchToDisplayMode'](),this['focus']();}),_0x11a87c['once']('editorReady',()=>{_0x11a87c['focus']();}),_0x11a87c['createEditor'](),_0x11a87c['delegate']('editorReady')['to'](this),_0x11a87c['delegate']('editorDestroyed')['to'](this),_0x11a87c;}['_setupKeyboardNavigation'](){const _0x295659=this['element'];this['keystrokes']['listenTo'](_0x295659);for(const _0x2c6609 of this['focusables'])this['focusTracker']['add'](_0x2c6609['element']),this['keystrokes']['listenTo'](_0x2c6609['element']);this['focusables']['on']('change',(_0x3a77c3,_0x2140f7)=>{for(const _0x5836cd of _0x2140f7['removed'])this['focusTracker']['remove'](_0x5836cd['element']),this['keystrokes']['stopListening'](_0x5836cd['element']);for(const _0xe0755a of _0x2140f7['added'])this['focusTracker']['add'](_0xe0755a['element']),this['keystrokes']['listenTo'](_0xe0755a['element']);}),this['keystrokes']['set']('enter',(_0x302ccf,_0x43824b)=>{_0x295659===_0x302ccf['target']&&(this['focusCycler']['focusFirst'](),_0x43824b());}),this['keystrokes']['set']('esc',(_0x42415c,_0x59b5a8)=>{_0x295659!==_0x42415c['target']&&(this['focus'](),_0x59b5a8());});}}class Tt extends/* #__PURE__ -- @preserve */ ti(di){['actionBar'];['userView'];constructor(_0x1f8bc4,_0x4f5956,_0x3d49e2){super(_0x1f8bc4,_0x4f5956,_0x3d49e2),this['set']('actionIndicator',null),this['set']('placeholder',N(_0x1f8bc4,'Reply...')),this['bind']('authoredAt')['to'](_0x4f5956),this['bind']('resolvedAt')['to'](_0x4f5956),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 _0x401199(_0x1f8bc4,_0x4f5956['author'],this['getUserViewNotificationText']()),this['userView']['extendTemplate']({'attributes':{'class':['ck-comment__user','ck-annotation__user'],'aria-hidden':!0x0}}),this['listenTo'](_0x4f5956,'change:isRemovable',()=>this['cancelConfirm']()),this['setTemplate'](this['getTemplate']());}['getTemplate'](){const _0x21368c=this['bindTemplate'],_0x3cd5ea=[{'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':_0x21368c['to']('authoredAt'),'class':['ck-comment__info-time','ck-annotation__info-time']},'children':[{'text':_0x21368c['to']('authoredAt',_0x1fba99=>this['_config']['formatDateTime'](_0x1fba99))}]}]},{'tag':'div','attributes':{'class':['ck-comment__actions','ck-annotation__actions',_0x21368c['if']('isEditMode','ck-comment__actions--hidden'),_0x21368c['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']&&_0x3cd5ea['push']({'tag':'div','attributes':{'class':['ck-comment__external']},'children':[{'text':this['getExternalCommentNote']()}]}),{'tag':'li','attributes':{'class':['ck-comment__wrapper'],'tabindex':-0x1,'aria-label':_0x21368c['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id'],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck-comment','ck-annotation',_0x21368c['if']('isEditMode','ck-comment--edit'),_0x21368c['if']('isSystemComment','ck-comment--info'),_0x21368c['to']('actionIndicator',_0x5c9142=>_0x5c9142?'ck-comment--'+_0x5c9142:'')],'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':_0x3cd5ea}]}]};}['_createEditButton'](){const _0x2a61a4=new _0x1523c0(this['locale']);return _0x2a61a4['label']=N(this['locale'],'Edit'),_0x2a61a4['icon']=_0x3ab1ba,_0x2a61a4['withText']=!0x0,_0x2a61a4['extendTemplate']({'attributes':{'class':'ck-comment--edit'}}),_0x2a61a4['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x440811=>!_0x440811),_0x2a61a4['bind']('isVisible')['to'](this['_model'],'isEditable'),_0x2a61a4['on']('execute',()=>this['switchToEditMode']()),_0x2a61a4;}['_createRemoveButton'](){const _0x59876e=new _0x1523c0(this['locale']);return _0x59876e['label']=N(this['locale'],'Remove'),_0x59876e['icon']=_0x184855,_0x59876e['withText']=!0x0,_0x59876e['extendTemplate']({'attributes':{'class':'ck-comment--remove'}}),_0x59876e['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x5bd66c=>!_0x5bd66c),_0x59876e['bind']('isVisible')['to'](this['_model'],'isRemovable'),_0x59876e['on']('execute',()=>{this['showConfirm'](N(this['locale'],'Delete\x20comment?'),this['element'])['then'](()=>{this['fire']('removeComment',this['_model']['id']);});}),_0x59876e;}['_createDropdown'](){const _0x5f4e66=_0x25794d(this['locale'],_0x3f239f),_0x77c54=_0x5f4e66['panelView']['children'],_0x505a07=new _0x518b96(this['locale']),_0x593736=_0x5f4e66['bindTemplate'];_0x2fb599(_0x5f4e66,()=>this['items']['find'](_0xc2f0a9=>_0xc2f0a9['isVisible'])),_0x5f4e66['extendTemplate']({'attributes':{'class':[_0x593736['if']('isVisible','ck-hidden',_0x3bb385=>!_0x3bb385)]}});const _0x45ab37=(_0x182155,_0x5bd3c1=-0x1)=>{const _0x4a95b0=new _0x332576(this['locale']);_0x4a95b0['children']['add'](_0x182155);const _0x536923=_0x5bd3c1>-0x1?_0x5bd3c1:_0x505a07['items']['length'];_0x505a07['items']['add'](_0x4a95b0,_0x536923);const _0x1b90b6=Array['from'](this['items']);_0x5f4e66['unbind']('isEnabled','isVisible'),_0x5f4e66['bind']('isEnabled')['toMany'](_0x1b90b6,'isEnabled',(..._0x11662e)=>_0x11662e['some'](_0x4aba96=>_0x4aba96)),_0x5f4e66['bind']('isVisible')['toMany'](_0x1b90b6,'isVisible',(..._0x5b3b0a)=>_0x5b3b0a['some'](_0x27939a=>_0x27939a));};_0x5f4e66['panelPosition']='sw',_0x5f4e66['buttonView']['set']({'label':N(this['locale'],'Show\x20more\x20items'),'icon':_0x514ed2});for(const _0x39a55a of this['items'])_0x45ab37(_0x39a55a);return _0x77c54['add'](_0x505a07),_0x5f4e66['listenTo'](this['items'],'add',(_0x5ea0c4,_0x56e27f,_0x4f1ccf)=>{_0x45ab37(_0x56e27f,_0x4f1ccf);}),_0x5f4e66['listenTo'](this['items'],'remove',(_0xe89333,_0x5ae336,_0x16e5eb)=>{_0x505a07['items']['remove'](_0x16e5eb);}),_0x5f4e66;}['_attachActions'](_0x2f5014,_0x541888){const _0x58a5b2=_0x2f5014&&_0x2f5014['element'];_0x58a5b2&&(this['listenTo'](_0x58a5b2,'mouseenter',()=>this['actionIndicator']=_0x541888),this['listenTo'](_0x58a5b2,'focus',()=>this['actionIndicator']=_0x541888),this['listenTo'](_0x58a5b2,'mouseleave',()=>this['actionIndicator']=null),this['listenTo'](_0x58a5b2,'blur',()=>this['actionIndicator']=null));}['_createCommentInputView'](){const _0x3bc0d0=super['_createCommentInputView']();return _0x3bc0d0['bind']('placeholder')['to'](this),_0x3bc0d0;}['render'](){super['render'](),this['_attachActions'](this['editButton'],'edit'),this['_attachActions'](this['removeButton'],'remove');}}function xt(_0x250ae7){const _0x4ba282=Dt(_0x250ae7,0x1e),_0xc8f45a=new MutationObserver(_0x40fd08=>{for(const _0x2852a2 of _0x40fd08)('attributes'==_0x2852a2['type']&&'class'==_0x2852a2['attributeName']||'childList'==_0x2852a2['type']||'characterData'==_0x2852a2['type'])&&_0x4ba282();});return{'attach'(_0x55c22c){_0xc8f45a['observe'](_0x55c22c,{'attributes':!0x0,'childList':!0x0,'subtree':!0x0,'characterData':!0x0});},'detach'(){_0xc8f45a['disco