UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

28 lines • 192 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 _0x2d455d,ContextPlugin as _0x2738de,PendingActions as ht,Command as _0x385260,Plugin as _0x5ddc0e,Context as _0x449ace}from'@ckeditor/ckeditor5-core/dist/index.js';import{ObservableMixin as _0x362d6f,uid as _0x58c8cf,KeystrokeHandler as jt,FocusTracker as _0x199d2b,diff as _0x159fc8,Collection as _0x23eb0b,Rect as _0x37570f,CKEditorError as _0x51f518,first as _0x5ae716,priorities as Wt,scrollViewportToShowTarget as nt,getEnvKeystrokeText as tt,toUnit as Ht,DomEmitterMixin as _0x35e1dc,keyCodes as _0x5b1abd}from'@ckeditor/ckeditor5-utils/dist/index.js';import{UserView as _0x5de8e0,AriaDescriptionView as Yt,setupThreadKeyboardNavigation as Zt,ConfirmMixin as ti,LateFocusButtonView as _0x21109b,trimHtml as ts,LateFocusDropdownButtonView as _0x11425f,Users as it,getDateTimeFormatter as lt,hashObject as pt,getAllMarkersDomElementsSorted as et,surroundingMarkersDetector as ot,FOCUS_ANNOTATION_KEYSTROKE as _0x542398}from'ckeditor5-collaboration/dist/index.js';import{throttle as Dt,isEqual as wt,cloneDeep as It,set as At,unset as Ct,debounce as _0x40c01b}from'es-toolkit/compat';import{IconUndo as _0x4a17ef,IconCheck as _0x1299c5,IconPencil as _0x7ba0fb,IconRemoveComment as _0x37d2b3,IconThreeVerticalDots as _0x1fc351,IconAddComment as _0x224626,IconCommentsArchive as _0x314692}from'@ckeditor/ckeditor5-icons/dist/index.js';import{EditorUIView as $t,InlineEditableUIView as Vt,EditorUI as Ut,View as kt,FocusCycler as _0x2f1de9,ButtonView as _0x49f2c7,ViewCollection as _0xae5e8b,createDropdown as _0x12ae92,ListView as _0x1a323c,focusChildOnDropdownOpen as _0x4391eb,ListItemView as _0x8512b5,MenuBarMenuListItemButtonView as _0x58cd9a,BodyCollection as _0x5a4cd6,BalloonPanelView as _0x263b66,ContextualBalloon as _0x36b0f0,Dialog as _0xeb9489,DialogViewPosition as _0xd16eae}from'@ckeditor/ckeditor5-ui/dist/index.js';import{disableViewPlaceholder as qt,enableViewPlaceholder as St,MouseObserver as _0x5d0a9d}from'@ckeditor/ckeditor5-engine/dist/index.js';import{Clipboard as zt,ClipboardMarkersUtils as Mt,ClipboardPipeline as Pt}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{Enter as Bt,ShiftEnter as Et}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 _0xe143ff}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{toWidget as _0x1ed711}from'@ckeditor/ckeditor5-widget/dist/index.js';class yt extends/* #__PURE__ -- @preserve */ _0x362d6f(){['model'];['view'];constructor(_0x55c334,_0x449fc9){super(),this['model']=_0x55c334,this['model']['_isAttached']=!0x0,this['view']=_0x449fc9,this['listenTo'](_0x449fc9,'submitCommentThread',()=>this['submit']()),this['listenTo'](_0x449fc9,'removeCommentThread',()=>this['remove']()),this['listenTo'](_0x449fc9,'resolveCommentThread',()=>this['resolve']()),this['listenTo'](_0x449fc9,'reopenCommentThread',()=>this['reopen']()),this['listenTo'](_0x449fc9,'addComment',(_0x5ae497,_0x159dd3)=>this['addComment'](_0x159dd3)),this['listenTo'](_0x449fc9,'updateComment',(_0x303e82,_0x546d06,_0x3e8ba5)=>this['updateComment'](_0x546d06,_0x3e8ba5)),this['listenTo'](_0x449fc9,'removeComment',(_0x43d7f9,_0x339947)=>this['removeComment'](_0x339947));}['submit'](){this['model']['submit']();}['remove'](){this['model']['remove']();}['resolve'](){this['model']['isResolved']||this['model']['resolve']();}['reopen'](){this['model']['isResolved']&&this['model']['reopen']();}['addComment'](_0x6e2bd8){this['model']['addComment']({'content':_0x6e2bd8,'authorId':this['view']['_localUser']['id']});}['updateComment'](_0x1ebe3e,_0xf27533){this['model']['getComment'](_0x1ebe3e)['update']({'content':_0xf27533});}['removeComment'](_0x554edd){this['model']['getComment'](_0x554edd)['remove']();}['destroy'](){this['stopListening'](),this['model']['_isAttached']=!0x1;}}function N(_0x49b7cb,_0x87113a,_0x2c6aaf){const t=_0x49b7cb['t'];switch(_0x87113a){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'},_0x2c6aaf);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'},_0x2c6aaf);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'},_0x2c6aaf);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'},_0x2c6aaf);case'NUMBER_OF_COMMENTS':return t({'string':'%0\x20Comment','plural':'%0\x20Comments','id':'NUMBER_OF_COMMENTS'},_0x2c6aaf);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'},_0x2c6aaf);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'},_0x2c6aaf);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'},_0x2c6aaf);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(_0x2734da,_0x55873c){super(_0x2734da);const _0x5b227f=_0x58c8cf();this['main']=this['createCollection'](),this['editable']=new Vt(_0x2734da,_0x55873c,void 0x0,{'label':()=>N(_0x2734da,'Comment\x20editor')}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-editor','ck-rounded-corners','ck-comment__input'],'dir':_0x2734da['uiLanguageDirection'],'lang':_0x2734da['uiLanguage'],'aria-labelledby':'cke-editor__aria-label_'+_0x5b227f},'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 Ft extends Ut{['view'];constructor(_0x2c5580){super(_0x2c5580),this['view']=new Rt(_0x2c5580['locale'],_0x2c5580['editing']['view']);}get['element'](){return this['view']['element'];}['init'](){const _0xe8dded=this['editor']['editing']['view'],_0x1c3235=this['view']['editable'],_0x515c80=_0xe8dded['document']['getRoot']();_0x1c3235['name']=_0x515c80['rootName'],this['view']['render']();const _0x7a2b1=_0x1c3235['element'];this['setEditableElement'](_0x1c3235['name'],_0x7a2b1),this['view']['editable']['bind']('isFocused')['to'](this['focusTracker']),_0xe8dded['attachDomRoot'](_0x7a2b1),this['fire']('ready');}['destroy'](){super['destroy'](),this['view']['destroy']();}}const Nt=[zt,Bt,Et,Gt,Jt,Kt,Lt];class Qt extends/* #__PURE__ -- @preserve */ _0x362d6f(_0x2d455d){static ['defaultPlugins']=/* #__PURE__ -- @preserve */ ((()=>Nt)());constructor(_0x28f75e={}){function _0x145755(_0x1386d6){return _0x1386d6['map'](_0x1d46c5=>String['fromCharCode'](_0x1d46c5))['join']('');}(_0x28f75e=Object['assign']({},_0x28f75e))['plugins']||(_0x28f75e['plugins']=Qt['defaultPlugins']),super(_0x28f75e),this['ui']=new Ft(this),this['set']('placeholder',''),this['model']['document']['on']('change',()=>this['_updatePlaceholder'](),{'priority':'low'}),this['on']('change:placeholder',()=>this['_updatePlaceholder']()),this['model']['document']['createRoot'](),this[_0x145755([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x145755([0x76,0x69,0x65,0x77])][_0x145755([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x145755([0x61,0x75,0x74,0x6f]),this[_0x145755([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74])]=()=>window[_0x145755([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x145755([0x72,0x65,0x73,0x6f,0x6c,0x76,0x65])]({[_0x145755([0x73,0x74,0x61,0x74,0x75,0x73])]:_0x145755([0x6f,0x6b])});}['create'](){const _0x5e6e29=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x5e6e29))['then'](()=>this['fire']('ready'));}['destroy'](){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0x2f37d2=>{const _0x5ef89a=this['model']['document']['getRoot'](),_0x362fbd=_0x5ef89a&&_0x5ef89a['getChild'](_0x5ef89a['childCount']-0x1);_0x2f37d2['setSelection'](_0x362fbd,'end'),this['editing']['view']['focus']();});}['_updatePlaceholder'](){const _0x464082=this['editing']['view'],_0x3e4c85=_0x464082['document']['getRoot'](),_0xea507f=_0x3e4c85['getChild'](0x0);_0x3e4c85['childCount']>0x1||!_0xea507f||'p'!=_0xea507f['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(qt(_0x464082,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0xea507f['placeholder']=this['placeholder']),St({'view':_0x464082,'element':_0xea507f,'keepOnFocus':!0x0}),this['placeholderElement']=_0xea507f);}}class es extends kt{['keystrokes'];['focusTracker'];['focusables'];['focusCycler'];['submitButtonView'];['cancelButtonView'];['_editorConfig'];constructor(_0x1dbf65,_0x541675={}){super(_0x1dbf65),this['editor']=null,this['_editorConfig']=_0x541675,this['set']('value',_0x541675['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',N(_0x1dbf65,'Reply...')),this['set']('submitLabel',N(_0x1dbf65,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['submitButtonView'],this['cancelButtonView']]),this['keystrokes']=new jt(),this['focusTracker']=new _0x199d2b(),this['focusCycler']=new _0x2f1de9({'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',(_0x34fbbc,_0x21e0e7)=>{this['cancelButtonView']['fire']('execute'),_0x21e0e7();}),this['keystrokes']['set']('Ctrl+Enter',(_0x27e835,_0x36a8c1)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x36a8c1());}),this['on']('submit',(_0x308dce,_0x7adeba)=>{_0x7adeba['length']>0xfde8?(alert(N(_0x1dbf65,'TOO_LONG_COMMENT_ALERT',[_0x7adeba['length'],0xfde8])),_0x308dce['stop']()):this['editor']['setData']('');},{'priority':'high'});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}['createEditor'](){return this['editor']||(this['editor']=new Qt(this['_editorConfig']),this['_editorCreationPromise']=this['editor']['create']()['then'](()=>{if(this['_isDestroyed'])return;const _0x361965=this['editor'];this['element']['insertBefore'](_0x361965['ui']['element'],this['element']['firstChild']),_0x361965['model']['document']['on']('change',()=>this['value']=_0x361965['getData']()),_0x361965['bind']('placeholder')['to'](this),this['focusables']['add'](_0x361965['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x38b789){-0x1===_0x38b789?(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:_0x296760}=this,_0x2df636=new _0x49f2c7(_0x296760);return _0x2df636['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--submit']}}),_0x2df636['withText']=!0x0,_0x2df636['bind']('label')['to'](this,'submitLabel'),_0x2df636['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x2df636['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x240c46,_0x3292b4)=>!_0x3292b4&&!!_0x240c46['trim']()),_0x2df636;}['_createCancelButton'](){const {locale:_0x12630d}=this,_0x32aff9=new _0x49f2c7(_0x12630d);return _0x32aff9['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x32aff9['label']=N(_0x12630d,'Cancel'),_0x32aff9['withText']=!0x0,_0x32aff9['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x32aff9;}['_setupKeyboardNavigation'](){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x1bda23=>{this['focusTracker']['add'](_0x1bda23['element']);}),this['focusables']['on']('change',(_0x4112bb,_0x47ae22)=>{for(const _0x4ec78f of Array['from'](_0x47ae22['added'])['reverse']())this['focusTracker']['add'](_0x4ec78f['element']);});}}class ie extends kt{constructor(_0x2df037,_0x243287,_0x2e8ed1){super(_0x2df037),this['commentInputView']=new es(_0x2df037,_0x2e8ed1),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x3ded75,_0x51f45b)=>_0x3ded75||!!_0x51f45b),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 _0x5de8e0(_0x2df037,_0x243287),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'](_0x30c977){this['commentInputView']['focus'](_0x30c977);}['_focusOnNonInteractiveMouseDown'](){this['listenTo'](this['element'],'mousedown',(_0x5a259b,_0x455904)=>{const {submitButtonView:_0x249aaa,cancelButtonView:_0x549bc7,editor:_0x24f419}=this['commentInputView'];[_0x249aaa['element'],_0x549bc7['element'],_0x24f419?_0x24f419['editing']['view']['getDomRoot']():null]['filter'](_0x3834f1=>_0x3834f1)['some'](_0xe07cac=>_0xe07cac['contains'](_0x455904['target']))||(this['focus'](),_0x455904['preventDefault']());});}}class os extends kt{constructor(_0x576298){super(_0x576298);const _0x3e26c0=this['bindTemplate'];this['set']('count',void 0x0),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[{'text':_0x3e26c0['to']('count',_0x5e3a85=>N(_0x576298,'NUMBER_OF_COMMENTS',_0x5e3a85))}]});}}class te extends kt{['commentViews'];['resolvedCommentView'];['focusTracker'];['keystrokes'];['focusCycler'];['_model'];['_config'];['_collapsedCommentsView'];constructor(_0x2c604d,_0xb84121,_0x6217af){super(_0x2c604d);const _0x27b0da=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0xb84121['comments']['length']),this['set']('isActive',!0x1),this['_model']=_0xb84121,this['_config']=_0x6217af,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x199d2b(),this['keystrokes']=new jt(),this['focusCycler']=new _0x2f1de9({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x174b58=>this['commentViews']['map'](_0x2dc29e=>_0x2dc29e['element'])['includes'](_0x174b58['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new os(_0x2c604d),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x18e6b2=>_0x18e6b2-this['_config']['maxCommentsWhenCollapsed']);for(const _0x1b55e4 of _0xb84121['comments'])this['_handleNewCommentModel'](_0x1b55e4);this['_handleInfoComment'](),this['listenTo'](_0xb84121['comments'],'add',(_0x5bd343,_0x59a9bb)=>{const _0x29502a=this['_calculatePosition'](_0x59a9bb);this['length']++,this['_handleNewCommentModel'](_0x59a9bb,_0x29502a),this['refreshVisibleViews']();}),this['listenTo'](_0xb84121['comments'],'remove',(_0x28dfab,_0x4adf89)=>{this['length']--,this['_handleRemoveCommentModel'](_0x4adf89),this['refreshVisibleViews']();}),this['listenTo'](_0xb84121,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0xb84121,'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',_0x27b0da['if']('length','ck-hidden',_0x3dba85=>!_0x3dba85)],'aria-label':N(_0x2c604d,'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'](_0x6255d7){-0x1===_0x6255d7?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['destroy'](){this['_collapsedCommentsView']['destroy']();for(const _0x564f5e of this['commentViews'])_0x564f5e['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}['_handleNewCommentModel'](_0x433bf8,_0x5cc075){const _0x497406=new this['_config']['CommentView'](this['locale'],_0x433bf8,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x497406['viewUid']=_0x433bf8['id'],_0x497406['delegate']('removeComment')['to'](this),_0x497406['delegate']('updateComment')['to'](this),_0x497406['delegate']('resolveCommentThread')['to'](this),_0x497406['delegate']('editorReady')['to'](this),_0x497406['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x497406,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x497406,_0x5cc075);}['_calculatePosition'](_0x5a32fa){const _0x1bf155=this['_model']['_findOptimalIndex'](_0x5a32fa);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x5a32fa['authoredAt']?_0x1bf155-0x1:_0x1bf155:_0x1bf155-0x1;}['_handleInfoComment'](){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x5344f2={'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'],_0x5344f2,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x5344f2));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}['_handleRemoveCommentModel'](_0x3f3870){const _0x16d8c3=this['commentViews']['remove'](_0x3f3870['id']);this['stopListening'](_0x16d8c3),_0x16d8c3['isEditMode']&&this['_updateHasDirtyComment'](),_0x16d8c3['destroy']();}['_updateHasDirtyComment'](){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x5cc5d9=>_0x5cc5d9['isEditMode']);}['_rearrangeCollapse'](){const _0x1c002a=function(_0x248877){const _0x5680a5=new _0x23eb0b();for(const _0x1a4c63 of _0x248877)_0x5680a5['add'](_0x1a4c63);return _0x5680a5;}(this['commentViews']),_0x1ad8f3=this['_collapsedCommentsView']['count'];for(let _0x4a7d7c=0x1;_0x4a7d7c<=_0x1ad8f3;_0x4a7d7c++)_0x1c002a['remove'](0x1);for(const _0x3422ba of _0x1c002a)_0x3422ba['collapse']();_0x1ad8f3>0x0&&_0x1c002a['add'](this['_collapsedCommentsView'],0x1),rs(_0x159fc8(Array['from'](this['visibleViews']),Array['from'](_0x1c002a)),this['visibleViews'],_0x1c002a);}['_rearrangeExpand'](){rs(_0x159fc8(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x3b1939 of this['visibleViews'])_0x3b1939['expand']();}['_setupKeyboardNavigation'](){this['commentViews']['forEach'](_0x5dd4f2=>{this['focusTracker']['add'](_0x5dd4f2['element']),this['keystrokes']['listenTo'](_0x5dd4f2['element']);}),this['commentViews']['on']('change',(_0x526207,_0x1563b2)=>{for(const _0x1d3d94 of _0x1563b2['removed'])this['focusTracker']['remove'](_0x1d3d94['element']),this['keystrokes']['stopListening'](_0x1d3d94['element']);for(const _0x3b067f of Array['from'](_0x1563b2['added'])['reverse']())this['focusTracker']['add'](_0x3b067f['element']),this['keystrokes']['listenTo'](_0x3b067f['element']);});}}function rs(_0x2310fd,_0x26b676,_0x1afbec){let _0x2af8bc=0x0;for(const _0x9d6cea of _0x2310fd)switch(_0x9d6cea){case'insert':_0x26b676['add'](_0x1afbec['get'](_0x2af8bc),_0x2af8bc),_0x2af8bc++;break;case'delete':_0x26b676['remove'](_0x2af8bc);break;case'equal':_0x2af8bc++;}}class oe extends kt{constructor(_0x34ca81){super(_0x34ca81);const _0x455fa2=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x455fa2['to']('contextValue',_0x34cc5d=>N(_0x34ca81,'THREAD_CONTEXT_LABEL',_0x34cc5d)),'tabindex':-0x1},'children':[{'text':_0x455fa2['to']('contextValue')}]});}['focus'](){this['element']['focus']();}}class Xt extends kt{['_model'];['reopenButtonView'];['contextView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];constructor(_0x5512ee,_0x2dc581){super(_0x5512ee);const _0x5ed35c=this['bindTemplate'];this['_model']=_0x2dc581,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x199d2b(),this['keystrokes']=new jt(),this['focusCycler']=new _0x2f1de9({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x7659d8=>!!_0x7659d8),this['bind']('contextValue')['to'](this['_model'],'context',_0x1dd0ac=>_0x1dd0ac&&_0x1dd0ac['value']?this['_trimContextValue'](_0x1dd0ac['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',_0x5ed35c['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 _0x298ccb=new _0x49f2c7(this['locale']);return _0x298ccb['label']=N(this['locale'],'Reopen'),_0x298ccb['tooltip']=N(this['locale'],'Reopen'),_0x298ccb['icon']=_0x4a17ef,_0x298ccb['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x4713fb=>!_0x4713fb),_0x298ccb['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x35aa24,_0x21f43d)=>_0x35aa24&&_0x21f43d),_0x298ccb['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x298ccb;}['_trimContextValue'](_0x40ef82){if(_0x40ef82['length']<0x96)return _0x40ef82;const _0x45ed53=_0x40ef82['lastIndexOf']('\x20',0x93);return _0x40ef82['substring'](0x0,_0x45ed53>-0x1?_0x45ed53:0x93)+'...';}['_attachContextActions'](){const _0x340967=this['element']['querySelector']('.ck-context'),_0x58f9fe=_0x340967['querySelector']('.ck-context__value');this['listenTo'](_0x340967,'mouseenter',()=>{_0x58f9fe['offsetWidth']<_0x58f9fe['scrollWidth']&&_0x340967['classList']['add']('overlay');}),this['listenTo'](_0x340967,'mouseleave',()=>{_0x340967['classList']['remove']('overlay');});}['_setupKeyboardNavigation'](){this['keystrokes']['listenTo'](this['element']);for(const _0x3bd157 of this['focusables'])this['focusTracker']['add'](_0x3bd157['element']),this['keystrokes']['listenTo'](_0x3bd157['element']);}['_createContextView'](){const _0x16228f=new oe(this['locale']);return _0x16228f['bind']('contextValue')['to'](this),_0x16228f;}}class si extends kt{['_model'];['_config'];['commentThreadHeaderView'];['commentThreadInputView'];['ariaDescriptionView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];constructor(_0x2eabb3,_0x33d820,_0x355ca5,_0x373df7){super(_0x2eabb3),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x33d820,this['_localUser']=_0x355ca5,this['_config']=_0x373df7,this['commentThreadHeaderView']=new Xt(_0x2eabb3,_0x33d820),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new Yt(_0x2eabb3,N(_0x2eabb3,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new te(_0x2eabb3,_0x33d820,Object['assign']({'CommentView':this['_config']['CommentView']},_0x373df7)),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',(_0x423559,_0x23bfcd)=>_0x423559||!!_0x23bfcd),this['bind']('isUnlinked')['to'](_0x33d820,'unlinkedAt',_0x302e37=>!!_0x302e37),this['bind']('ariaLabel')['to'](this,'length',_0x30a5d5=>{const _0x240d6e=this['_model']['comments']['first']?this['_model']['comments']['first']['author']['name']:this['_localUser']['name'];return N(this['locale'],'COMMENT_THREAD_LABEL',[_0x30a5d5,_0x240d6e]);}),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x199d2b(),this['keystrokes']=new jt(),this['focusCycler']=new _0x2f1de9({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x3e48e4=>_0x3e48e4['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 _0x2ccb96=new ie(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x585086=_0x2ccb96['commentInputView'];return _0x2ccb96['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x585086,'value',(_0x25d42e,_0x309e4f,_0x440391,_0x4e609f,_0x253879)=>!!_0x253879||!!_0x4e609f&&_0x440391&&!_0x309e4f||_0x25d42e&&_0x440391&&!_0x309e4f),_0x585086['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x3ba7f2,_0x578048,_0x22261e)=>{let _0x2a2593;return _0x2a2593=_0x22261e&&_0x578048?'Reply\x20to\x20reopen\x20discussion...':_0x3ba7f2?'Reply...':'Write\x20a\x20comment...',N(this['locale'],_0x2a2593);}),_0x585086['bind']('submitLabel')['to'](this,'length',_0x4dc962=>N(this['locale'],_0x4dc962?'Reply':'Comment')),_0x585086['on']('submit',(_0x32f1f9,_0x22b74f)=>{this['fire']('addComment',_0x22b74f),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x585086['on']('cancel',()=>{this['focus']();}),_0x585086['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x585086['on']('cancel',_0x24be22=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x24be22['stop']());}),this['on']('change:isActive',(_0x330d66,_0xb9c603,_0x5c7b94)=>{_0x5c7b94||this['length']||_0x585086['value']||this['fire']('removeCommentThread');}),_0x2ccb96;}}class vt extends/* #__PURE__ -- @preserve */ ti(si){['commentThreadChildren'];['containerElement'];['resolveButton'];['_boundFirstCommentView'];constructor(_0x4397f7,_0x3b760a,_0x476ee8,_0x1c3dec){super(_0x4397f7,_0x3b760a,_0x476ee8,_0x1c3dec),this['commentThreadChildren']=this['createCollection']([this['commentsListView'],this['commentThreadInputView'],this['ariaDescriptionView']]),this['set']('actionIndicator',null),this['containerElement']=null,this['_boundFirstCommentView']=null,this['locale']=_0x4397f7,this['resolveButton']=this['_createResolveButton'](),this['setTemplate'](this['getTemplate']()),this['on']('change:isActive',(_0x2749f2,_0x4d298a,_0x10fc14)=>{_0x10fc14||this['_cancelAllConfirms']();}),this['listenTo'](this['_model'],'change:isReadOnly',(_0x5039d3,_0x2c888e,_0x381ec8)=>{_0x381ec8&&this['_cancelAllConfirms']();}),this['length']>0x0&&this['_bindFirstCommentView'](),this['listenTo'](this['commentsListView']['commentViews'],'add',()=>{this['_bindFirstCommentView']();});}['getTemplate'](){const _0x4d3e8b=this['bindTemplate'];return{'tag':'div','attributes':{'class':['ck','ck-thread','ck-reset_all-excluded','ck-rounded-corners',_0x4d3e8b['if']('isActive','ck-thread--active'),_0x4d3e8b['if']('isUnlinked','ck-thread--unlinked'),_0x4d3e8b['if']('isConfirm','ck-thread--remove-confirmation'),_0x4d3e8b['to']('actionIndicator',_0xd81804=>_0xd81804?'ck-thread--'+_0xd81804:'')],'data-thread-id':this['_model']['id'],'tabindex':0x0,'role':'listitem','aria-label':_0x4d3e8b['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 _0x4b160d of this['commentsListView']['commentViews'])_0x4b160d['cancelConfirm']();}['_bindFirstCommentView'](){const {locale:_0x31beec}=this,_0x1cde10=this['commentsListView']['commentViews']['get'](0x0);_0x1cde10===this['_boundFirstCommentView']||_0x1cde10['isSystemComment']||(this['_boundFirstCommentView']=_0x1cde10,this['unbind']('actionIndicator'),this['bind']('actionIndicator')['to'](_0x1cde10,'actionIndicator',_0x36ec44=>'remove'===_0x36ec44?'remove':null),_0x1cde10['placeholder']=N(_0x31beec,'Write\x20a\x20comment...'),_0x1cde10['removeButton']['on']('execute',_0x5d6f13=>{_0x5d6f13['stop'](),this['showConfirm'](N(_0x31beec,'Delete\x20comment\x20thread?'),this['containerElement'])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),this['on']('removeConfirm',()=>{_0x1cde10['focus']();}),_0x1cde10['actionBar']['add'](this['resolveButton'],0x0),_0x1cde10['focusables']['add'](this['resolveButton'],0x0));}['_createResolveButton'](){const _0x5c39de=new _0x21109b(this['locale']);return _0x5c39de['label']=N(this['locale'],'Resolve'),_0x5c39de['tooltip']=N(this['locale'],'Resolve'),_0x5c39de['icon']=_0x1299c5,_0x5c39de['extendTemplate']({'attributes':{'class':'ck-comment--resolve'}}),_0x5c39de['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x3780ba=>!_0x3780ba),_0x5c39de['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x383af2,_0x4ed226)=>_0x383af2&&!_0x4ed226),_0x5c39de['on']('execute',()=>{this['fire']('resolveCommentThread',this['_model']['id']);}),_0x5c39de;}['_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(_0x22d4dd){super(_0x22d4dd),this['set']('content',''),this['setTemplate']({'tag':'div','attributes':{'class':['ck-content','ck-comment__content','ck-annotation__content']}});}['render'](){super['render'](),this['on']('change:content',(_0x40de0a,_0xc0d152,_0x31be35)=>{this['element']['innerHTML']=_0x31be35;}),this['element']['innerHTML']=this['content'];}}class di extends kt{['visibleView'];['ariaDescriptionView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];['_model'];['_config'];constructor(_0x513146,_0x1f321d,_0x53ae8f){super(_0x513146),this['_model']=_0x1f321d,this['_config']=_0x53ae8f,this['isSystemComment']=!!this['_config']['isSystemComment'],this['set']('isEditMode',!0x1),this['set']('isCollapsed',!0x0),this['bind']('ariaLabel')['to'](_0x1f321d,'content',_0x1f321d,'authoredAt',(_0x239219,_0x5585e9)=>N(_0x513146,'COMMENT_ARIA_LABEL',[_0x1f321d['author']['name'],_0x53ae8f['formatDateTime'](_0x5585e9),new DOMParser()['parseFromString'](_0x239219,'text/html')['body']['textContent'],_0x1f321d['isExternal']?this['getExternalCommentNote']():''])),this['ariaDescriptionView']=new Yt(_0x513146,N(_0x513146,'COMMENT_THREAD_DESCRIPTION')),this['visibleView']=this['createCollection'](),this['visibleView']['add'](this['_createCommentContentView']()),this['focusables']=new _0xae5e8b(),this['focusTracker']=new _0x199d2b(),this['keystrokes']=new jt(),this['focusCycler']=new _0x2f1de9({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x377930=>_0x377930['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 _0x3b54e5=new is(this['locale']);return _0x3b54e5['bind']('content')['to'](this['_model'],'content',this,'isCollapsed',(_0xd7df45,_0x5931ba)=>_0x5931ba?ts(_0xd7df45,{'limit':this['_config']['maxCommentCharsWhenCollapsed']}):_0xd7df45),_0x3b54e5;}['_createCommentInputView'](){this['_config']['editorConfig']||(this['_config']['editorConfig']={}),this['_config']['editorConfig']['initialData']=this['_model']['content'];const _0x27c718=new es(this['locale'],this['_config']['editorConfig']);return _0x27c718['value']=this['_model']['content'],_0x27c718['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x27c718['submitLabel']=N(this['locale'],'Save'),_0x27c718['on']('submit',(_0x14a44c,_0x1bf5ac)=>{this['fire']('updateComment',this['_model']['id'],_0x1bf5ac),this['switchToDisplayMode'](),this['focus']();}),_0x27c718['on']('cancel',()=>{this['switchToDisplayMode'](),this['focus']();}),_0x27c718['once']('editorReady',()=>{_0x27c718['focus']();}),_0x27c718['createEditor'](),_0x27c718['delegate']('editorReady')['to'](this),_0x27c718['delegate']('editorDestroyed')['to'](this),_0x27c718;}['_setupKeyboardNavigation'](){const _0x15ea07=this['element'];this['keystrokes']['listenTo'](_0x15ea07);for(const _0x4c56a8 of this['focusables'])this['focusTracker']['add'](_0x4c56a8['element']),this['keystrokes']['listenTo'](_0x4c56a8['element']);this['focusables']['on']('change',(_0x51a01d,_0x19ee70)=>{for(const _0x3c297c of _0x19ee70['removed'])this['focusTracker']['remove'](_0x3c297c['element']),this['keystrokes']['stopListening'](_0x3c297c['element']);for(const _0x8c85a9 of _0x19ee70['added'])this['focusTracker']['add'](_0x8c85a9['element']),this['keystrokes']['listenTo'](_0x8c85a9['element']);}),this['keystrokes']['set']('enter',(_0x228b7f,_0x19c401)=>{_0x15ea07===_0x228b7f['target']&&(this['focusCycler']['focusFirst'](),_0x19c401());}),this['keystrokes']['set']('esc',(_0x4f27fd,_0x47f078)=>{_0x15ea07!==_0x4f27fd['target']&&(this['focus'](),_0x47f078());});}}class gt extends/* #__PURE__ -- @preserve */ ti(di){['actionBar'];['userView'];constructor(_0x18595a,_0xbfce03,_0x5c3863){super(_0x18595a,_0xbfce03,_0x5c3863),this['set']('actionIndicator',null),this['set']('placeholder',N(_0x18595a,'Reply...')),this['bind']('authoredAt')['to'](_0xbfce03),this['bind']('resolvedAt')['to'](_0xbfce03),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 _0x5de8e0(_0x18595a,_0xbfce03['author'],this['getUserViewNotificationText']()),this['userView']['extendTemplate']({'attributes':{'class':['ck-comment__user','ck-annotation__user'],'aria-hidden':!0x0}}),this['listenTo'](_0xbfce03,'change:isRemovable',()=>this['cancelConfirm']()),this['setTemplate'](this['getTemplate']());}['getTemplate'](){const _0x460cc5=this['bindTemplate'],_0x83f579=[{'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':_0x460cc5['to']('authoredAt'),'class':['ck-comment__info-time','ck-annotation__info-time']},'children':[{'text':_0x460cc5['to']('authoredAt',_0x5debba=>this['_config']['formatDateTime'](_0x5debba))}]}]},{'tag':'div','attributes':{'class':['ck-comment__actions','ck-annotation__actions',_0x460cc5['if']('isEditMode','ck-comment__actions--hidden'),_0x460cc5['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']&&_0x83f579['push']({'tag':'div','attributes':{'class':['ck-comment__external']},'children':[{'text':this['getExternalCommentNote']()}]}),{'tag':'li','attributes':{'class':['ck-comment__wrapper',_0x460cc5['if']('isConfirm','ck-comment--remove-confirmation')],'tabindex':-0x1,'aria-label':_0x460cc5['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id'],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck-comment','ck-annotation',_0x460cc5['if']('isEditMode','ck-comment--edit'),_0x460cc5['if']('isSystemComment','ck-comment--info'),_0x460cc5['to']('actionIndicator',_0x15bfa3=>_0x15bfa3?'ck-comment--'+_0x15bfa3:'')],'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':_0x83f579}]}]};}['_createEditButton'](){const _0x349885=new _0x49f2c7(this['locale']);return _0x349885['label']=N(this['locale'],'Edit'),_0x349885['icon']=_0x7ba0fb,_0x349885['withText']=!0x0,_0x349885['extendTemplate']({'attributes':{'class':'ck-comment--edit'}}),_0x349885['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x142603=>!_0x142603),_0x349885['bind']('isVisible')['to'](this['_model'],'isEditable'),_0x349885['on']('execute',()=>this['switchToEditMode']()),_0x349885;}['_createRemoveButton'](){const _0x33cd48=new _0x49f2c7(this['locale']);return _0x33cd48['label']=N(this['locale'],'Remove'),_0x33cd48['icon']=_0x37d2b3,_0x33cd48['withText']=!0x0,_0x33cd48['extendTemplate']({'attributes':{'class':'ck-comment--remove'}}),_0x33cd48['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x51cb4e=>!_0x51cb4e),_0x33cd48['bind']('isVisible')['to'](this['_model'],'isRemovable'),_0x33cd48['on']('execute',()=>{this['showConfirm'](N(this['locale'],'Delete\x20comment?'),this['element'])['then'](()=>{this['fire']('removeComment',this['_model']['id']);});}),_0x33cd48;}['_createDropdown'](){const _0x30eb6f=_0x12ae92(this['locale'],_0x11425f),_0x2bab78=_0x30eb6f['panelView']['children'],_0x1a5f1e=new _0x1a323c(this['locale']),_0x4ec3e0=_0x30eb6f['bindTemplate'];_0x4391eb(_0x30eb6f,()=>this['items']['find'](_0x46180d=>_0x46180d['isVisible'])),_0x30eb6f['extendTemplate']({'attributes':{'class':[_0x4ec3e0['if']('isVisible','ck-hidden',_0x1300c5=>!_0x1300c5)]}});const _0x409b4c=(_0x7a7d61,_0x3bec6d=-0x1)=>{const _0xc7c31f=new _0x8512b5(this['locale']);_0xc7c31f['children']['add'](_0x7a7d61);const _0x5a6b19=_0x3bec6d>-0x1?_0x3bec6d:_0x1a5f1e['items']['length'];_0x1a5f1e['items']['add'](_0xc7c31f,_0x5a6b19);const _0x31638d=Array['from'](this['items']);_0x30eb6f['unbind']('isEnabled','isVisible'),_0x30eb6f['bind']('isEnabled')['toMany'](_0x31638d,'isEnabled',(..._0xab3846)=>_0xab3846['some'](_0x462681=>_0x462681)),_0x30eb6f['bind']('isVisible')['toMany'](_0x31638d,'isVisible',(..._0x21ebde)=>_0x21ebde['some'](_0x3cbe18=>_0x3cbe18));};_0x30eb6f['panelPosition']='sw',_0x30eb6f['buttonView']['set']({'label':N(this['locale'],'Show\x20more\x20items'),'icon':_0x1fc351});for(const _0x455ac0 of this['items'])_0x409b4c(_0x455ac0);return _0x2bab78['add'](_0x1a5f1e),_0x30eb6f['listenTo'](this['items'],'add',(_0x312499,_0x1e4048,_0x38fde6)=>{_0x409b4c(_0x1e4048,_0x38fde6);}),_0x30eb6f['listenTo'](this['items'],'remove',(_0x3ca9b1,_0x100cc4,_0x5a1082)=>{_0x1a5f1e['items']['remove'](_0x5a1082);}),_0x30eb6f;}['_attachActions'](_0x8c2ce0,_0x136065){const _0x2008a2=_0x8c2ce0&&_0x8c2ce0['element'];_0x2008a2&&(this['listenTo'](_0x2008a2,'mouseenter',()=>this['actionIndicator']=_0x136065),this['listenTo'](_0x2008a2,'focus',()=>this['actionIndicator']=_0x136065),this['listenTo'](_0x2008a2,'mouseleave',()=>this['actionIndicator']=null),this['listenTo'](_0x2008a2,'blur',()=>this['actionIndicator']=null));}['_createCommentInputView'](){const _0x149edf=super['_createCommentInputView']();return _0x149edf['bind']('placeholder')['to'](this),_0x149edf;}['render'](){super['render'](),this['_attachActions'](this['editButton'],'edit'),this['_attachActions'](this['removeButton'],'remove');}}function xt(_0x404d18){const _0x3df5c6=Dt(_0x404d18,0x1e),_0x57af1d=new MutationObserver(_0x14376c=>{for(const _0x4999c4 of _0x14376c)('attributes'==_0x4999c4['type']&&'class'==_0x4999c4['attributeName']||'childList'==_0x4999c4['type']||'characterData'==_0x4999c4['type'])&&_0x3df5c6();});return{'attach'(_0x1f4