@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
28 lines • 196 kB
JavaScript
/*
* Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
*
*
*
*
* +---------------------------------------------------------------------------------+
* | |
* | Hello stranger! |
* | |
* | |
* | What you're currently looking at is the source code of a legally protected, |
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
* | are forbidden and will result in legal consequences. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
import{Editor as _0x441226,ContextPlugin as _0x283925,PendingActions as _0x1dce2a,Command as _0x11f7ba,Plugin as _0x4e3a6a,Context as _0x353685}from'@ckeditor/ckeditor5-core/dist/index.js';import{ObservableMixin as _0x1861d7,uid as _0x308b6,KeystrokeHandler as _0x846282,FocusTracker as _0x252bbd,diff as _0xdd14c4,Collection as _0x499a27,Rect as _0x416d7d,CKEditorError as _0x21ce1d,first as _0x548c32,priorities as _0x45a290,scrollViewportToShowTarget as _0x590e11,getEnvKeystrokeText as _0x23bd78,toUnit as _0x2746e8,DomEmitterMixin as _0x1f5773,keyCodes as _0x4350d7}from'@ckeditor/ckeditor5-utils/dist/index.js';import{UserView as _0x159892,AriaDescriptionView as _0x3182ea,setupThreadKeyboardNavigation as _0xa38b70,ConfirmMixin as _0xd164fc,LateFocusButtonView as _0x4090a8,trimHtml as _0x6e9498,LateFocusDropdownButtonView as _0x3e25c5,FOCUS_ANNOTATION_KEYSTROKE as _0x130533,Users as _0x3bef93,getDateTimeFormatter as _0x3a40bc,hashObject as _0x4a0ba1,getAllMarkersDomElementsSorted as _0x28774f,surroundingMarkersDetector as _0xb7f08d}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{throttle as _0x94919a,cloneDeep as _0x2211cc,set as _0x40cab1,unset as _0x27a806,isEqual as _0x187522,debounce as _0x4aa75f}from'es-toolkit/compat';import{IconUndo as _0x15ef58,IconCheck as _0x463891,IconPencil as _0x34d770,IconRemoveComment as _0x246a50,IconThreeVerticalDots as _0x2040c2,IconAddComment as _0x15a2cf,IconCommentsArchive as _0x56a931}from'@ckeditor/ckeditor5-icons/dist/index.js';import{EditorUIView as _0x35564b,InlineEditableUIView as _0x321159,EditorUI as _0x1b2dd2,View as _0x4e8972,FocusCycler as _0x10e0b,ButtonView as _0x1bde71,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 */
_0x1861d7(){['model'];['view'];constructor(_0x1a7fac,_0x8f6c22){super(),this['model']=_0x1a7fac,this['model']['_isAttached']=!0x0,this['view']=_0x8f6c22,this['listenTo'](_0x8f6c22,'submitCommentThread',()=>this['submit']()),this['listenTo'](_0x8f6c22,'removeCommentThread',()=>this['remove']()),this['listenTo'](_0x8f6c22,'resolveCommentThread',()=>this['resolve']()),this['listenTo'](_0x8f6c22,'reopenCommentThread',()=>this['reopen']()),this['listenTo'](_0x8f6c22,'addComment',(_0x3e15a4,_0x33aa6a)=>this['addComment'](_0x33aa6a)),this['listenTo'](_0x8f6c22,'updateComment',(_0x2378fa,_0x3a7191,_0x24d981)=>this['updateComment'](_0x3a7191,_0x24d981)),this['listenTo'](_0x8f6c22,'removeComment',(_0x405325,_0x27225c)=>this['removeComment'](_0x27225c));}['submit'](){this['model']['submit']();}['remove'](){this['model']['remove']();}['resolve'](){this['model']['isResolved']||this['model']['resolve']();}['reopen'](){this['model']['isResolved']&&this['model']['reopen']();}['addComment'](_0x5da16a){this['model']['addComment']({'content':_0x5da16a,'authorId':this['view']['_localUser']['id']});}['updateComment'](_0xa9c500,_0x3174df){this['model']['getComment'](_0xa9c500)['update']({'content':_0x3174df});}['removeComment'](_0x301236){this['model']['getComment'](_0x301236)['remove']();}['destroy'](){this['stopListening'](),this['model']['_isAttached']=!0x1;}}function vt(_0x1d54b0,_0x2549fa,_0x5209a3){const t=_0x1d54b0['t'];switch(_0x2549fa){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'},_0x5209a3);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'},_0x5209a3);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'},_0x5209a3);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'},_0x5209a3);case'NUMBER_OF_COMMENTS':return t({'string':'%0\x20Comment','plural':'%0\x20Comments','id':'NUMBER_OF_COMMENTS'},_0x5209a3);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'},_0x5209a3);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'},_0x5209a3);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'},_0x5209a3);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 _0x35564b{['main'];['editable'];constructor(_0x54843b,_0x3c94ab){super(_0x54843b);const _0xc48406=_0x308b6();this['main']=this['createCollection'](),this['editable']=new _0x321159(_0x54843b,_0x3c94ab,void 0x0,{'label':()=>vt(_0x54843b,'Comment\x20editor')}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-editor','ck-rounded-corners','ck-comment__input'],'dir':_0x54843b['uiLanguageDirection'],'lang':_0x54843b['uiLanguage'],'aria-labelledby':'cke-editor__aria-label_'+_0xc48406},'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 _0x1b2dd2{['view'];constructor(_0x11bb1b){super(_0x11bb1b),this['view']=new CommentEditorUIView(_0x11bb1b['locale'],_0x11bb1b['editing']['view']);}get['element'](){return this['view']['element'];}['init'](){const _0x518a91=this['editor']['editing']['view'],_0x15b2b2=this['view']['editable'],_0x2f2388=_0x518a91['document']['getRoot']();_0x15b2b2['name']=_0x2f2388['rootName'],this['view']['render']();const _0x455e5d=_0x15b2b2['element'];this['setEditableElement'](_0x15b2b2['name'],_0x455e5d),this['view']['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x518a91['attachDomRoot'](_0x455e5d),this['fire']('ready');}['destroy'](){super['destroy'](),this['view']['destroy']();}}const bt=[ft,At,gt,Ct,_t,Tt,yt];class CommentEditor extends/* #__PURE__ -- @preserve */
_0x1861d7(_0x441226){static ['defaultPlugins']=/* #__PURE__ -- @preserve */
((()=>bt)());constructor(_0x102b11={}){function _0x535737(_0x46edbc){return _0x46edbc['map'](_0xa92c1f=>String['fromCharCode'](_0xa92c1f))['join']('');}(_0x102b11=Object['assign']({},_0x102b11))['plugins']||(_0x102b11['plugins']=CommentEditor['defaultPlugins']),super(_0x102b11),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[_0x535737([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x535737([0x76,0x69,0x65,0x77])][_0x535737([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x535737([0x61,0x75,0x74,0x6f]),this[_0x535737([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74])]=()=>window[_0x535737([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x535737([0x72,0x65,0x73,0x6f,0x6c,0x76,0x65])]({[_0x535737([0x73,0x74,0x61,0x74,0x75,0x73])]:_0x535737([0x6f,0x6b])});}['create'](){const _0x30aaf2=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x30aaf2))['then'](()=>this['fire']('ready'));}['destroy'](){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0x49ceb0=>{const _0x1353fd=this['model']['document']['getRoot'](),_0x1c4df5=_0x1353fd&&_0x1353fd['getChild'](_0x1353fd['childCount']-0x1);_0x49ceb0['setSelection'](_0x1c4df5,'end'),this['editing']['view']['focus']();});}['_updatePlaceholder'](){const _0x3e13d3=this['editing']['view'],_0x11f825=_0x3e13d3['document']['getRoot'](),_0x21dfee=_0x11f825['getChild'](0x0);_0x11f825['childCount']>0x1||!_0x21dfee||'p'!=_0x21dfee['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(mt(_0x3e13d3,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x21dfee['placeholder']=this['placeholder']),lt({'view':_0x3e13d3,'element':_0x21dfee,'keepOnFocus':!0x0}),this['placeholderElement']=_0x21dfee);}}class CommentInputView extends _0x4e8972{['keystrokes'];['focusTracker'];['focusables'];['focusCycler'];['submitButtonView'];['cancelButtonView'];['_editorConfig'];constructor(_0x48d42c,_0x4a9b86={}){super(_0x48d42c),this['editor']=null,this['_editorConfig']=_0x4a9b86,this['set']('value',_0x4a9b86['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',vt(_0x48d42c,'Reply...')),this['set']('submitLabel',vt(_0x48d42c,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['submitButtonView'],this['cancelButtonView']]),this['keystrokes']=new _0x846282(),this['focusTracker']=new _0x252bbd(),this['focusCycler']=new _0x10e0b({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x466374=>!_0x466374['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',(_0x29679a,_0x31f07c)=>{this['cancelButtonView']['fire']('execute'),_0x31f07c();}),this['keystrokes']['set']('Ctrl+Enter',(_0x3b1325,_0x4f651e)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x4f651e());}),this['on']('submit',(_0x475b87,_0x8a9449)=>{_0x8a9449['length']>0xfde8?(alert(vt(_0x48d42c,'TOO_LONG_COMMENT_ALERT',[_0x8a9449['length'],0xfde8])),_0x475b87['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 _0x324882=this['editor'];this['element']['insertBefore'](_0x324882['ui']['element'],this['element']['firstChild']),_0x324882['model']['document']['on']('change',()=>this['value']=_0x324882['getData']()),_0x324882['bind']('placeholder')['to'](this),this['focusables']['add'](_0x324882['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x103909){-0x1===_0x103909?(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:_0x4b54b5}=this,_0x2caa9f=new _0x1bde71(_0x4b54b5);return _0x2caa9f['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--submit']}}),_0x2caa9f['withText']=!0x0,_0x2caa9f['bind']('label')['to'](this,'submitLabel'),_0x2caa9f['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x2caa9f['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x4f6cc2,_0x8dff61)=>!_0x8dff61&&!!_0x4f6cc2['trim']()),_0x2caa9f;}['_createCancelButton'](){const {locale:_0x48dcbb}=this,_0x1dbb3e=new _0x1bde71(_0x48dcbb);return _0x1dbb3e['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x1dbb3e['label']=vt(_0x48dcbb,'Cancel'),_0x1dbb3e['withText']=!0x0,_0x1dbb3e['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x1dbb3e;}['_setupKeyboardNavigation'](){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x2ddaf0=>{this['focusTracker']['add'](_0x2ddaf0['element']);}),this['focusables']['on']('change',(_0x2ec0d2,_0x111bc0)=>{for(const _0xf24348 of Array['from'](_0x111bc0['added'])['reverse']())this['focusTracker']['add'](_0xf24348['element']);});}}class CommentThreadInputView extends _0x4e8972{constructor(_0x11f6ed,_0x51799d,_0x35d891){super(_0x11f6ed),this['commentInputView']=new CommentInputView(_0x11f6ed,_0x35d891),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x3d89fd,_0x5bd5b7)=>_0x3d89fd||!!_0x5bd5b7),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 _0x159892(_0x11f6ed,_0x51799d),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'](_0x41efa8){this['commentInputView']['focus'](_0x41efa8);}['_focusOnNonInteractiveMouseDown'](){this['listenTo'](this['element'],'mousedown',(_0x376ae6,_0x2d22d2)=>{const {submitButtonView:_0x2ed883,cancelButtonView:_0x443b44,editor:_0xb87896}=this['commentInputView'];[_0x2ed883['element'],_0x443b44['element'],_0xb87896?_0xb87896['editing']['view']['getDomRoot']():null]['filter'](_0x523478=>_0x523478)['some'](_0x5d2ec6=>_0x5d2ec6['contains'](_0x2d22d2['target']))||(this['focus'](),_0x2d22d2['preventDefault']());});}}class CollapsedCommentsView extends _0x4e8972{constructor(_0x2b0dbd){super(_0x2b0dbd);const _0x23c1c8=this['bindTemplate'];this['set']('count',void 0x0),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[{'text':_0x23c1c8['to']('count',_0x1fd650=>vt(_0x2b0dbd,'NUMBER_OF_COMMENTS',_0x1fd650))}]});}}class CommentsListView extends _0x4e8972{['commentViews'];['resolvedCommentView'];['focusTracker'];['keystrokes'];['focusCycler'];['_model'];['_config'];['_collapsedCommentsView'];constructor(_0x1db52b,_0x5cdb49,_0x19230b){super(_0x1db52b);const _0x5b1863=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x5cdb49['comments']['length']),this['set']('isActive',!0x1),this['_model']=_0x5cdb49,this['_config']=_0x19230b,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x252bbd(),this['keystrokes']=new _0x846282(),this['focusCycler']=new _0x10e0b({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x251f96=>this['commentViews']['map'](_0x27635d=>_0x27635d['element'])['includes'](_0x251f96['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new CollapsedCommentsView(_0x1db52b),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x26a0e6=>_0x26a0e6-this['_config']['maxCommentsWhenCollapsed']);for(const _0xcb91f6 of _0x5cdb49['comments'])this['_handleNewCommentModel'](_0xcb91f6);this['_handleInfoComment'](),this['listenTo'](_0x5cdb49['comments'],'add',(_0x5782fe,_0x1980f7)=>{const _0x4bb8a2=this['_calculatePosition'](_0x1980f7);this['length']++,this['_handleNewCommentModel'](_0x1980f7,_0x4bb8a2),this['refreshVisibleViews']();}),this['listenTo'](_0x5cdb49['comments'],'remove',(_0x3aa1b2,_0x2a4cdf)=>{this['length']--,this['_handleRemoveCommentModel'](_0x2a4cdf),this['refreshVisibleViews']();}),this['listenTo'](_0x5cdb49,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x5cdb49,'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',_0x5b1863['if']('length','ck-hidden',_0x483684=>!_0x483684)],'aria-label':vt(_0x1db52b,'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'](_0x280128){-0x1===_0x280128?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['destroy'](){this['_collapsedCommentsView']['destroy']();for(const _0x4b3d4d of this['commentViews'])_0x4b3d4d['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}['_handleNewCommentModel'](_0x36c004,_0x35e30a){const _0x3a7f38=new this['_config']['CommentView'](this['locale'],_0x36c004,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x3a7f38['viewUid']=_0x36c004['id'],_0x3a7f38['delegate']('removeComment')['to'](this),_0x3a7f38['delegate']('updateComment')['to'](this),_0x3a7f38['delegate']('resolveCommentThread')['to'](this),_0x3a7f38['delegate']('editorReady')['to'](this),_0x3a7f38['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x3a7f38,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x3a7f38,_0x35e30a);}['_calculatePosition'](_0x59ff97){const _0x399c68=this['_model']['_findOptimalIndex'](_0x59ff97);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x59ff97['authoredAt']?_0x399c68-0x1:_0x399c68:_0x399c68-0x1;}['_handleInfoComment'](){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x5df575={'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'],_0x5df575,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x5df575));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}['_handleRemoveCommentModel'](_0x263c7e){const _0x4d2859=this['commentViews']['remove'](_0x263c7e['id']);this['stopListening'](_0x4d2859),_0x4d2859['isEditMode']&&this['_updateHasDirtyComment'](),_0x4d2859['destroy']();}['_updateHasDirtyComment'](){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x13fc16=>_0x13fc16['isEditMode']);}['_rearrangeCollapse'](){const _0x2bf46b=function(_0x14c195){const _0x6a15d7=new _0x499a27();for(const _0xc6fab1 of _0x14c195)_0x6a15d7['add'](_0xc6fab1);return _0x6a15d7;}(this['commentViews']),_0x1ad04b=this['_collapsedCommentsView']['count'];for(let _0x2efed1=0x1;_0x2efed1<=_0x1ad04b;_0x2efed1++)_0x2bf46b['remove'](0x1);for(const _0x5b7698 of _0x2bf46b)_0x5b7698['collapse']();_0x1ad04b>0x0&&_0x2bf46b['add'](this['_collapsedCommentsView'],0x1),Et(_0xdd14c4(Array['from'](this['visibleViews']),Array['from'](_0x2bf46b)),this['visibleViews'],_0x2bf46b);}['_rearrangeExpand'](){Et(_0xdd14c4(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x42635e of this['visibleViews'])_0x42635e['expand']();}['_setupKeyboardNavigation'](){this['commentViews']['forEach'](_0x4669b7=>{this['focusTracker']['add'](_0x4669b7['element']),this['keystrokes']['listenTo'](_0x4669b7['element']);}),this['commentViews']['on']('change',(_0x5d3745,_0x9cc04f)=>{for(const _0x30a7b9 of _0x9cc04f['removed'])this['focusTracker']['remove'](_0x30a7b9['element']),this['keystrokes']['stopListening'](_0x30a7b9['element']);for(const _0x296f99 of Array['from'](_0x9cc04f['added'])['reverse']())this['focusTracker']['add'](_0x296f99['element']),this['keystrokes']['listenTo'](_0x296f99['element']);});}}function Et(_0x181c70,_0x22537e,_0x46d061){let _0x4884ac=0x0;for(const _0x422e46 of _0x181c70)switch(_0x422e46){case'insert':_0x22537e['add'](_0x46d061['get'](_0x4884ac),_0x4884ac),_0x4884ac++;break;case'delete':_0x22537e['remove'](_0x4884ac);break;case'equal':_0x4884ac++;}}class CommentThreadHeaderContextView extends _0x4e8972{constructor(_0x23cdc3){super(_0x23cdc3);const _0x5abfef=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x5abfef['to']('contextValue',_0x473de8=>vt(_0x23cdc3,'THREAD_CONTEXT_LABEL',_0x473de8)),'tabindex':-0x1},'children':[{'text':_0x5abfef['to']('contextValue')}]});}['focus'](){this['element']['focus']();}}class CommentThreadHeaderView extends _0x4e8972{['_model'];['reopenButtonView'];['contextView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];constructor(_0xb0f464,_0xbcb683){super(_0xb0f464);const _0x35b6c5=this['bindTemplate'];this['_model']=_0xbcb683,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x252bbd(),this['keystrokes']=new _0x846282(),this['focusCycler']=new _0x10e0b({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x585147=>!!_0x585147),this['bind']('contextValue')['to'](this['_model'],'context',_0x59d9d8=>_0x59d9d8&&_0x59d9d8['value']?this['_trimContextValue'](_0x59d9d8['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',_0x35b6c5['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 _0x3083c3=new _0x1bde71(this['locale']);return _0x3083c3['label']=vt(this['locale'],'Reopen'),_0x3083c3['tooltip']=vt(this['locale'],'Reopen'),_0x3083c3['icon']=_0x15ef58,_0x3083c3['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x16f2ac=>!_0x16f2ac),_0x3083c3['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x3cf733,_0x26b526)=>_0x3cf733&&_0x26b526),_0x3083c3['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x3083c3;}['_trimContextValue'](_0x3b6c66){if(_0x3b6c66['length']<0x96)return _0x3b6c66;const _0x19a192=_0x3b6c66['lastIndexOf']('\x20',0x93);return _0x3b6c66['substring'](0x0,_0x19a192>-0x1?_0x19a192:0x93)+'...';}['_attachContextActions'](){const _0x20b77c=this['element']['querySelector']('.ck-context'),_0x3d48e5=_0x20b77c['querySelector']('.ck-context__value');this['listenTo'](_0x20b77c,'mouseenter',()=>{_0x3d48e5['offsetWidth']<_0x3d48e5['scrollWidth']&&_0x20b77c['classList']['add']('overlay');}),this['listenTo'](_0x20b77c,'mouseleave',()=>{_0x20b77c['classList']['remove']('overlay');});}['_setupKeyboardNavigation'](){this['keystrokes']['listenTo'](this['element']);for(const _0x4d24aa of this['focusables'])this['focusTracker']['add'](_0x4d24aa['element']),this['keystrokes']['listenTo'](_0x4d24aa['element']);}['_createContextView'](){const _0xde9e33=new CommentThreadHeaderContextView(this['locale']);return _0xde9e33['bind']('contextValue')['to'](this),_0xde9e33;}}class BaseCommentThreadView extends _0x4e8972{['_model'];['_config'];['commentThreadHeaderView'];['commentThreadInputView'];['ariaDescriptionView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];constructor(_0x5326c8,_0x173032,_0x50bb2a,_0x4e858d){super(_0x5326c8),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x173032,this['_localUser']=_0x50bb2a,this['_config']=_0x4e858d,this['commentThreadHeaderView']=new CommentThreadHeaderView(_0x5326c8,_0x173032),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x3182ea(_0x5326c8,vt(_0x5326c8,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new CommentsListView(_0x5326c8,_0x173032,Object['assign']({'CommentView':this['_config']['CommentView']},_0x4e858d)),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',(_0x5cfacf,_0x2d8fcc)=>_0x5cfacf||!!_0x2d8fcc),this['bind']('isUnlinked')['to'](_0x173032,'unlinkedAt',_0x493be1=>!!_0x493be1),this['bind']('ariaLabel')['to'](this,'length',_0x3ed18e=>{const _0x17c70e=this['_model']['comments']['first']?this['_model']['comments']['first']['author']['name']:this['_localUser']['name'];return vt(this['locale'],'COMMENT_THREAD_LABEL',[_0x3ed18e,_0x17c70e]);}),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x252bbd(),this['keystrokes']=new _0x846282(),this['focusCycler']=new _0x10e0b({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x59bb79=>_0x59bb79['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0xa38b70(this,this['focusables']);}async['destroy'](){this['isDirty']=!0x1,this['commentsListView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}['_createCommentThreadInputView'](){const _0x509f57=new CommentThreadInputView(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x2af7c5=_0x509f57['commentInputView'];return _0x509f57['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x2af7c5,'value',(_0x1383cc,_0x3a8ad5,_0x511a5a,_0x584674,_0x4a33e3)=>!!_0x4a33e3||!!_0x584674&&_0x511a5a&&!_0x3a8ad5||_0x1383cc&&_0x511a5a&&!_0x3a8ad5),_0x2af7c5['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x4dc5e2,_0x1aede1,_0x1857e0)=>{let _0x760f8c;return _0x760f8c=_0x1857e0&&_0x1aede1?'Reply\x20to\x20reopen\x20discussion...':_0x4dc5e2?'Reply...':'Write\x20a\x20comment...',vt(this['locale'],_0x760f8c);}),_0x2af7c5['bind']('submitLabel')['to'](this,'length',_0x5ec999=>vt(this['locale'],_0x5ec999?'Reply':'Comment')),_0x2af7c5['on']('submit',(_0x34da39,_0x5bfb8d)=>{this['fire']('addComment',_0x5bfb8d),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x2af7c5['on']('cancel',()=>{this['focus']();}),_0x2af7c5['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x2af7c5['on']('cancel',_0x39cde5=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x39cde5['stop']());}),this['on']('change:isActive',(_0x3391f8,_0x282970,_0x32fbe9)=>{_0x32fbe9||this['length']||_0x2af7c5['value']||this['fire']('removeCommentThread');}),_0x509f57;}}class CommentThreadView extends/* #__PURE__ -- @preserve */
_0xd164fc(BaseCommentThreadView){['commentThreadChildren'];['containerElement'];['resolveButton'];['_boundFirstCommentView'];constructor(_0xe4c109,_0x8c6c0a,_0x5a936a,_0x44d5bd){super(_0xe4c109,_0x8c6c0a,_0x5a936a,_0x44d5bd),this['commentThreadChildren']=this['createCollection']([this['commentsListView'],this['commentThreadInputView'],this['ariaDescriptionView']]),this['set']('actionIndicator',null),this['containerElement']=null,this['_boundFirstCommentView']=null,this['locale']=_0xe4c109,this['resolveButton']=this['_createResolveButton'](),this['setTemplate'](this['getTemplate']()),this['on']('change:isActive',(_0x4d8e69,_0x52f285,_0x3a6b99)=>{_0x3a6b99||this['_cancelAllConfirms']();}),this['listenTo'](this['_model'],'change:isReadOnly',(_0x54feca,_0x30be2b,_0x446d01)=>{_0x446d01&&this['_cancelAllConfirms']();}),this['length']>0x0&&this['_bindFirstCommentView'](),this['listenTo'](this['commentsListView']['commentViews'],'add',()=>{this['_bindFirstCommentView']();});}['getTemplate'](){const _0x454e19=this['bindTemplate'];return{'tag':'div','attributes':{'class':['ck','ck-thread','ck-reset_all-excluded','ck-rounded-corners',_0x454e19['if']('isActive','ck-thread--active'),_0x454e19['if']('isUnlinked','ck-thread--unlinked'),_0x454e19['to']('actionIndicator',_0xa6a36a=>_0xa6a36a?'ck-thread--'+_0xa6a36a:'')],'data-thread-id':this['_model']['id'],'tabindex':0x0,'role':'listitem','aria-label':_0x454e19['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 _0x517477 of this['commentsListView']['commentViews'])_0x517477['cancelConfirm']();}['_bindFirstCommentView'](){const {locale:_0x1b7df3}=this,_0x178a82=this['commentsListView']['commentViews']['get'](0x0);_0x178a82===this['_boundFirstCommentView']||_0x178a82['isSystemComment']||(this['_boundFirstCommentView']=_0x178a82,this['unbind']('actionIndicator'),this['bind']('actionIndicator')['to'](_0x178a82,'actionIndicator',_0x3faa58=>'remove'===_0x3faa58?'remove':null),_0x178a82['placeholder']=vt(_0x1b7df3,'Write\x20a\x20comment...'),_0x178a82['removeButton']['on']('execute',_0x40835d=>{_0x40835d['stop'](),this['showConfirm'](vt(_0x1b7df3,'Delete\x20comment\x20thread?'),this['containerElement'])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),this['on']('removeConfirm',()=>{_0x178a82['focus']();}),_0x178a82['actionBar']['add'](this['resolveButton'],0x0),_0x178a82['focusables']['add'](this['resolveButton'],0x0));}['_createResolveButton'](){const _0x15f11d=new _0x4090a8(this['locale']);return _0x15f11d['label']=vt(this['locale'],'Resolve'),_0x15f11d['tooltip']=vt(this['locale'],'Resolve'),_0x15f11d['icon']=_0x463891,_0x15f11d['extendTemplate']({'attributes':{'class':'ck-comment--resolve'}}),_0x15f11d['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x3054c3=>!_0x3054c3),_0x15f11d['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x5e391f,_0x377f5e)=>_0x5e391f&&!_0x377f5e),_0x15f11d['on']('execute',()=>{this['fire']('resolveCommentThread',this['_model']['id']);}),_0x15f11d;}['_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 _0x4e8972{constructor(_0x46fae0){super(_0x46fae0),this['set']('content',''),this['setTemplate']({'tag':'div','attributes':{'class':['ck-content','ck-comment__content','ck-annotation__content']}});}['render'](){super['render'](),this['on']('change:content',(_0x42dc19,_0x51d576,_0x4ea66a)=>{this['element']['innerHTML']=_0x4ea66a;}),this['element']['innerHTML']=this['content'];}}class BaseCommentView extends _0x4e8972{['visibleView'];['ariaDescriptionView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];['_model'];['_config'];constructor(_0x359b44,_0x4ca790,_0x168b06){super(_0x359b44),this['_model']=_0x4ca790,this['_config']=_0x168b06,this['isSystemComment']=!!this['_config']['isSystemComment'],this['set']('isEditMode',!0x1),this['set']('isCollapsed',!0x0),this['bind']('ariaLabel')['to'](_0x4ca790,'content',_0x4ca790,'authoredAt',(_0x5c7082,_0x1ab228)=>vt(_0x359b44,'COMMENT_ARIA_LABEL',[_0x4ca790['author']['name'],_0x168b06['formatDateTime'](_0x1ab228),new DOMParser()['parseFromString'](_0x5c7082,'text/html')['body']['textContent'],_0x4ca790['isExternal']?this['getExternalCommentNote']():''])),this['ariaDescriptionView']=new _0x3182ea(_0x359b44,vt(_0x359b44,'COMMENT_THREAD_DESCRIPTION')),this['visibleView']=this['createCollection'](),this['visibleView']['add'](this['_createCommentContentView']()),this['focusables']=new tt(),this['focusTracker']=new _0x252bbd(),this['keystrokes']=new _0x846282(),this['focusCycler']=new _0x10e0b({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x2c237a=>_0x2c237a['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 _0x20b714=new CommentContentView(this['locale']);return _0x20b714['bind']('content')['to'](this['_model'],'content',this,'isCollapsed',(_0x10aac0,_0x276c20)=>_0x276c20?_0x6e9498(_0x10aac0,{'limit':this['_config']['maxCommentCharsWhenCollapsed']}):_0x10aac0),_0x20b714;}['_createCommentInputView'](){this['_config']['editorConfig']||(this['_config']['editorConfig']={}),this['_config']['editorConfig']['initialData']=this['_model']['content'];const _0x4f7d80=new CommentInputView(this['locale'],this['_config']['editorConfig']);return _0x4f7d80['value']=this['_model']['content'],_0x4f7d80['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x4f7d80['submitLabel']=vt(this['locale'],'Save'),_0x4f7d80['on']('submit',(_0x42eba0,_0x4502e0)=>{this['fire']('updateComment',this['_model']['id'],_0x4502e0),this['switchToDisplayMode'](),this['focus']();}),_0x4f7d80['on']('cancel',()=>{this['switchToDisplayMode'](),this['focus']();}),_0x4f7d80['once']('editorReady',()=>{_0x4f7d80['focus']();}),_0x4f7d80['createEditor'](),_0x4f7d80['delegate']('editorReady')['to'](this),_0x4f7d80['delegate']('editorDestroyed')['to'](this),_0x4f7d80;}['_setupKeyboardNavigation'](){const _0x3d6ffb=this['element'];this['keystrokes']['listenTo'](_0x3d6ffb);for(const _0x48cc79 of this['focusables'])this['focusTracker']['add'](_0x48cc79['element']),this['keystrokes']['listenTo'](_0x48cc79['element']);this['focusables']['on']('change',(_0x22ea27,_0x11089a)=>{for(const _0x17e29b of _0x11089a['removed'])this['focusTracker']['remove'](_0x17e29b['element']),this['keystrokes']['stopListening'](_0x17e29b['element']);for(const _0x10b9a0 of _0x11089a['added'])this['focusTracker']['add'](_0x10b9a0['element']),this['keystrokes']['listenTo'](_0x10b9a0['element']);}),this['keystrokes']['set']('enter',(_0x1c3248,_0x3e7d40)=>{_0x3d6ffb===_0x1c3248['target']&&(this['focusCycler']['focusFirst'](),_0x3e7d40());}),this['keystrokes']['set']('esc',(_0x56bcbe,_0x17ae04)=>{_0x3d6ffb!==_0x56bcbe['target']&&(this['focus'](),_0x17ae04());});}}class CommentView extends/* #__PURE__ -- @preserve */
_0xd164fc(BaseCommentView){['actionBar'];['userView'];constructor(_0x355aba,_0x37f880,_0x50a053){super(_0x355aba,_0x37f880,_0x50a053),this['set']('actionIndicator',null),this['set']('placeholder',vt(_0x355aba,'Reply...')),this['bind']('authoredAt')['to'](_0x37f880),this['bind']('resolvedAt')['to'](_0x37f880),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 _0x159892(_0x355aba,_0x37f880['author'],this['getUserViewNotificationText']()),this['userView']['extendTemplate']({'attributes':{'class':['ck-comment__user','ck-annotation__user'],'aria-hidden':!0x0}}),this['listenTo'](_0x37f880,'change:isRemovable',()=>this['cancelConfirm']()),this['setTemplate'](this['getTemplate']());}['getTemplate'](){const _0x23f808=this['bindTemplate'],_0x4442cb=[{'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':_0x23f808['to']('authoredAt'),'class':['ck-comment__info-time','ck-annotation__info-time']},'children':[{'text':_0x23f808['to']('authoredAt',_0x11a5e1=>this['_config']['formatDateTime'](_0x11a5e1))}]}]},{'tag':'div','attributes':{'class':['ck-comment__actions','ck-annotation__actions',_0x23f808['if']('isEditMode','ck-comment__actions--hidden'),_0x23f808['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']&&_0x4442cb['push']({'tag':'div','attributes':{'class':['ck-comment__external']},'children':[{'text':this['getExternalCommentNote']()}]}),{'tag':'li','attributes':{'class':['ck-comment__wrapper'],'tabindex':-0x1,'aria-label':_0x23f808['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id'],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck-comment','ck-annotation',_0x23f808['if']('isEditMode','ck-comment--edit'),_0x23f808['if']('isSystemComment','ck-comment--info'),_0x23f808['to']('actionIndicator',_0x1db974=>_0x1db974?'ck-comment--'+_0x1db974:'')],'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':_0x4442cb}]}]};}['_createEditButton'](){const _0xd96e6c=new _0x1bde71(this['locale']);return _0xd96e6c['label']=vt(this['locale'],'Edit'),_0xd96e6c['icon']=_0x34d770,_0xd96e6c['withText']=!0x0,_0xd96e6c['extendTemplate']({'attributes':{'class':'ck-comment--edit'}}),_0xd96e6c['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0xaefdd7=>!_0xaefdd7),_0xd96e6c['bind']('isVisible')['to'](this['_model'],'isEditable'),_0xd96e6c['on']('execute',()=>this['switchToEditMode']()),_0xd96e6c;}['_createRemoveButton'](){const _0x4a23ec=new _0x1bde71(this['locale']);return _0x4a23ec['label']=vt(this['locale'],'Remove'),_0x4a23ec['icon']=_0x246a50,_0x4a23ec['withText']=!0x0,_0x4a23ec['extendTemplate']({'attributes':{'class':'ck-comment--remove'}}),_0x4a23ec['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x459d73=>!_0x459d73),_0x4a23ec['bind']('isVisible')['to'](this['_model'],'isRemovable'),_0x4a23ec['on']('execute',()=>{this['showConfirm'](vt(this['locale'],'Delete\x20comment?'),this['element'])['then'](()=>{this['fire']('removeComment',this['_model']['id']);});}),_0x4a23ec;}['_createDropdown'](){const _0xacba00=et(this['locale'],_0x3e25c5),_0x16580f=_0xacba00['panelView']['children'],_0x55f1a8=new it(this['locale']),_0x421ce5=_0xacba00['bindTemplate'];st(_0xacba00,()=>this['items']['find'](_0x37d5a4=>_0x37d5a4['isVisible'])),_0xacba00['extendTemplate']({'attributes':{'class':[_0x421ce5['if']('isVisible','ck-hidden',_0x2e8b7d=>!_0x2e8b7d)]}});const _0x10dc2c=(_0x4a879b,_0x11bcdc=-0x1)=>{const _0x1d1a29=new nt(this['locale']);_0x1d1a29['children']['add'](_0x4a879b);const _0x590fda=_0x11bcdc>-0x1?_0x11bcdc:_0x55f1a8['items']['length'];_0x55f1a8['items']['add'](_0x1d1a29,_0x590fda);const _0x351048=Array['from'](this['items']);_0xacba00['unbind']('isEnabled','isVisible'),_0xacba00['bind']('isEnabled')['toMany'](_0x351048,'isEnabled',(..._0x32f2df)=>_0x32f2df['some'](_0x2e72a0=>_0x2e72a0)),_0xacba00['bind']('isVisible')['toMany'](_0x351048,'isVisible',(..._0x42f3a6)=>_0x42f3a6['some'](_0x351ca2=>_0x351ca2));};_0xacba00['panelPosition']='sw',_0xacba00['buttonView']['set']({'label':vt(this['locale'],'Show\x20more\x20items'),'icon':_0x2040c2});for(const _0x273fb8 of this['items'])_0x10dc2c(_0x273fb8);return _0x16580f['add'](_0x55f1a8),_0xacba00['listenTo'](this['items'],'add',(_0x1dc549,_0x22cd69,_0x1077e0)=>{_0x10dc2c(_0x22cd69,_0x1077e0);}),_0xacba00['listenTo'](this['items'],'remove',(_0x1d6b2e,_0x4acc3b,_0x1d65f4)=>{_0x55f1a8['items']['remove'](_0x1d65f4);}),_0xacba00;}['_attachActions'](_0x25da2d,_0x1722a3){const _0x406052=_0x25da2d&&_0x25da2d['element'];_0x406052&&(this['listenTo'](_0x406052,'mouseenter',()=>this['actionIndicator']=_0x1722a3),this['listenTo'](_0x406052,'focus',()=>this['actionIndicator']=_0x1722a3),this['listenTo'](_0x406052,'mouseleave',()=>this['actionIndicator']=null),this['listenTo'](_0x406052,'blur',()=>this['actionIndicator']=null));}['_createCommentIn