@ckeditor/ckeditor5-comments 48.4.0-alpha.3 → 48.4.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -11
- package/package.json +16 -16
package/dist/index.js
CHANGED
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Command as
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
((()=>Ot)());constructor(_0x532b80={}){(_0x532b80=Object['assign']({},_0x532b80))['plugins']||(_0x532b80['plugins']=CommentEditor['defaultPlugins']),super(_0x532b80),this['ui']=new Nt(this),this['set']('placeholder',''),this['model']['document']['on']('change',()=>this['_updatePlaceholder'](),{'priority':'low'}),this['on']('change:placeholder',()=>this['_updatePlaceholder']()),this['model']['document']['createRoot'](),this['editing']['view']['_overlayModeHint']='auto',this['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}create(){const _0x2b4a5e=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x2b4a5e))['then'](()=>this['fire']('ready'));}destroy(){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0x28bbe5=>{const _0x112750=this['model']['document']['getRoot'](),_0x38f415=_0x112750&&_0x112750['getChild'](_0x112750['childCount']-0x1);_0x28bbe5['setSelection'](_0x38f415,'end'),this['editing']['view']['focus']();});}_updatePlaceholder(){const _0x414060=this['editing']['view'],_0x35e9bf=_0x414060['document']['getRoot'](),_0x384c14=_0x35e9bf['getChild'](0x0);_0x35e9bf['childCount']>0x1||!_0x384c14||'p'!=_0x384c14['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(mt(_0x414060,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x384c14['placeholder']=this['placeholder']),ut({'view':_0x414060,'element':_0x384c14,'keepOnFocus':!0x0}),this['placeholderElement']=_0x384c14);}},St=class extends ht{keystrokes;['focusTracker'];['focusables'];['focusCycler'];submitButtonView;cancelButtonView;_editorConfig;constructor(_0x560bd9,_0x17df0d={}){super(_0x560bd9),this['editor']=null,this['_editorConfig']=_0x17df0d,this['set']('value',_0x17df0d['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',Et(_0x560bd9,'Reply...')),this['set']('submitLabel',Et(_0x560bd9,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['submitButtonView'],this['cancelButtonView']]),this['keystrokes']=new _0x4d6908(),this['focusTracker']=new _0x1bc134(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x3047d5=>!_0x3047d5['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',(_0x1f0f42,_0x5e7a9e)=>{this['cancelButtonView']['fire']('execute'),_0x5e7a9e();}),this['keystrokes']['set']('Ctrl+Enter',(_0x5dbd0b,_0xd8a6a1)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0xd8a6a1());}),this['on']('submit',(_0x1bd42e,_0x98a7f3)=>{_0x98a7f3['length']>0xfde8?(alert(Et(_0x560bd9,'TOO_LONG_COMMENT_ALERT',[_0x98a7f3['length'],0xfde8])),_0x1bd42e['stop']()):this['editor']['setData']('');},{'priority':'high'});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}createEditor(){return this['editor']||(this['editor']=new Rt(this['_editorConfig']),this['_editorCreationPromise']=this['editor']['create']()['then'](()=>{if(this['_isDestroyed'])return;const _0x27be2f=this['editor'];this['element']['insertBefore'](_0x27be2f['ui']['element'],this['element']['firstChild']),_0x27be2f['model']['document']['on']('change',()=>this['value']=_0x27be2f['getData']()),_0x27be2f['bind']('placeholder')['to'](this),this['focusables']['add'](_0x27be2f['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x5b6a19){-0x1===_0x5b6a19?(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:_0x5b1b9e}=this,_0x5a8300=new _0x4695a0(_0x5b1b9e);return _0x5a8300['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--submit']}}),_0x5a8300['withText']=!0x0,_0x5a8300['bind']('label')['to'](this,'submitLabel'),_0x5a8300['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x5a8300['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0xf2dd80,_0x36acce)=>!_0x36acce&&!!_0xf2dd80['trim']()),_0x5a8300;}_createCancelButton(){const {locale:_0x414d25}=this,_0x29c256=new _0x4695a0(_0x414d25);return _0x29c256['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x29c256['label']=Et(_0x414d25,'Cancel'),_0x29c256['withText']=!0x0,_0x29c256['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x29c256;}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x468a94=>{this['focusTracker']['add'](_0x468a94['element']);}),this['focusables']['on']('change',(_0x382f7e,_0x167b80)=>{for(const _0x4f2e40 of Array['from'](_0x167b80['added'])['reverse']())this['focusTracker']['add'](_0x4f2e40['element']);});}},xt=class extends ht{constructor(_0x1aa8c1,_0x3c81b9,_0x3c49c8){super(_0x1aa8c1),this['commentInputView']=new St(_0x1aa8c1,_0x3c49c8),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x51eafd,_0x391fc2)=>_0x51eafd||!!_0x391fc2),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 _0x3d8fe9(_0x1aa8c1,_0x3c81b9),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'](_0x4e34a7){this['commentInputView']['focus'](_0x4e34a7);}_focusOnNonInteractiveMouseDown(){this['listenTo'](this['element'],'mousedown',(_0xaa5314,_0x1395d0)=>{const {submitButtonView:_0x483d59,cancelButtonView:_0x2b5368,editor:_0x4088b0}=this['commentInputView'];[_0x483d59['element'],_0x2b5368['element'],_0x4088b0?_0x4088b0['editing']['view']['getDomRoot']():null]['filter'](_0x5cc702=>_0x5cc702)['some'](_0x414928=>_0x414928['contains'](_0x1395d0['target']))||(this['focus'](),_0x1395d0['preventDefault']());});}},Pt=class extends ht{constructor(_0x8f1144){super(_0x8f1144);const _0x343058=this['bindTemplate'];this['set']('count',void 0x0),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[{'text':_0x343058['to']('count',_0x1d1580=>Et(_0x8f1144,'NUMBER_OF_COMMENTS',_0x1d1580))}]});}},Lt=class extends ht{commentViews;resolvedCommentView;['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];_collapsedCommentsView;constructor(_0x125f12,_0x36de7a,_0xd85389){super(_0x125f12);const _0x5c1530=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x36de7a['comments']['length']),this['set']('isActive',!0x1),this['_model']=_0x36de7a,this['_config']=_0xd85389,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x1bc134(),this['keystrokes']=new _0x4d6908(),this['focusCycler']=new et({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x20a94a=>this['commentViews']['map'](_0x2184f7=>_0x2184f7['element'])['includes'](_0x20a94a['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new Pt(_0x125f12),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x24c52a=>_0x24c52a-this['_config']['maxCommentsWhenCollapsed']);for(const _0xad5fa3 of _0x36de7a['comments'])this['_handleNewCommentModel'](_0xad5fa3);this['_handleInfoComment'](),this['listenTo'](_0x36de7a['comments'],'add',(_0xef8603,_0x327787)=>{const _0x5d863a=this['_calculatePosition'](_0x327787);this['length']++,this['_handleNewCommentModel'](_0x327787,_0x5d863a),this['refreshVisibleViews']();}),this['listenTo'](_0x36de7a['comments'],'remove',(_0x4ce811,_0x2452bc)=>{this['length']--,this['_handleRemoveCommentModel'](_0x2452bc),this['refreshVisibleViews']();}),this['listenTo'](_0x36de7a,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x36de7a,'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',_0x5c1530['if']('length','ck-hidden',_0x40c189=>!_0x40c189)],'aria-label':Et(_0x125f12,'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'](_0xcc720a){-0x1===_0xcc720a?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}destroy(){this['_collapsedCommentsView']['destroy']();for(const _0x4c354f of this['commentViews'])_0x4c354f['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}_handleNewCommentModel(_0x27170c,_0xd5875e){const _0x4667c3=new this['_config']['CommentView'](this['locale'],_0x27170c,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x4667c3['viewUid']=_0x27170c['id'],_0x4667c3['delegate']('removeComment')['to'](this),_0x4667c3['delegate']('updateComment')['to'](this),_0x4667c3['delegate']('resolveCommentThread')['to'](this),_0x4667c3['delegate']('editorReady')['to'](this),_0x4667c3['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x4667c3,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x4667c3,_0xd5875e);}_calculatePosition(_0x151ae6){const _0x2dedc2=this['_model']['_findOptimalIndex'](_0x151ae6);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x151ae6['authoredAt']?_0x2dedc2-0x1:_0x2dedc2:_0x2dedc2-0x1;}_handleInfoComment(){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x1dc2b2={'id':'resolved','author':this['_model']['resolvedBy'],'authoredAt':this['_model']['resolvedAt'],'content':Et(this['locale'],'Marked\x20as\x20resolved'),'attributes':{}};this['resolvedCommentView']=new this['_config']['CommentView'](this['locale'],_0x1dc2b2,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x1dc2b2));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}_handleRemoveCommentModel(_0x1d9268){const _0x44a5f3=this['commentViews']['remove'](_0x1d9268['id']);this['stopListening'](_0x44a5f3),_0x44a5f3['isEditMode']&&this['_updateHasDirtyComment'](),_0x44a5f3['destroy']();}_updateHasDirtyComment(){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x4a4674=>_0x4a4674['isEditMode']);}['_rearrangeCollapse'](){const _0x51a7aa=function(_0x1d57d6){const _0x445740=new _0x3a878e();for(const _0x49939b of _0x1d57d6)_0x445740['add'](_0x49939b);return _0x445740;}(this['commentViews']),_0x200860=this['_collapsedCommentsView']['count'];for(let _0x567a3d=0x1;_0x567a3d<=_0x200860;_0x567a3d++)_0x51a7aa['remove'](0x1);for(const _0x1d19a0 of _0x51a7aa)_0x1d19a0['collapse']();_0x200860>0x0&&_0x51a7aa['add'](this['_collapsedCommentsView'],0x1),Dt(_0x45fda3(Array['from'](this['visibleViews']),Array['from'](_0x51a7aa)),this['visibleViews'],_0x51a7aa);}['_rearrangeExpand'](){Dt(_0x45fda3(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x2ea716 of this['visibleViews'])_0x2ea716['expand']();}_setupKeyboardNavigation(){this['commentViews']['forEach'](_0x30d739=>{this['focusTracker']['add'](_0x30d739['element']),this['keystrokes']['listenTo'](_0x30d739['element']);}),this['commentViews']['on']('change',(_0x9030a5,_0x5e808b)=>{for(const _0xd2b518 of _0x5e808b['removed'])this['focusTracker']['remove'](_0xd2b518['element']),this['keystrokes']['stopListening'](_0xd2b518['element']);for(const _0x243ea4 of Array['from'](_0x5e808b['added'])['reverse']())this['focusTracker']['add'](_0x243ea4['element']),this['keystrokes']['listenTo'](_0x243ea4['element']);});}};function Dt(_0x7082d2,_0x598c7f,_0x1794d9){let _0x50a297=0x0;for(const _0x31071d of _0x7082d2)switch(_0x31071d){case'insert':_0x598c7f['add'](_0x1794d9['get'](_0x50a297),_0x50a297),_0x50a297++;break;case'delete':_0x598c7f['remove'](_0x50a297);break;case'equal':_0x50a297++;}}var Vt=class extends ht{constructor(_0x240915){super(_0x240915);const _0x2cc718=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x2cc718['to']('contextValue',_0x539587=>Et(_0x240915,'THREAD_CONTEXT_LABEL',_0x539587)),'tabindex':-0x1},'children':[{'text':_0x2cc718['to']('contextValue')}]});}['focus'](){this['element']['focus']();}},Bt=class extends ht{['_model'];reopenButtonView;contextView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x5813e3,_0xf63ab){super(_0x5813e3);const _0x41e91a=this['bindTemplate'];this['_model']=_0xf63ab,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x1bc134(),this['keystrokes']=new _0x4d6908(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x367e53=>!!_0x367e53),this['bind']('contextValue')['to'](this['_model'],'context',_0x397d22=>_0x397d22&&_0x397d22['value']?this['_trimContextValue'](_0x397d22['value']):Et(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',_0x41e91a['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 _0x2815a2=new _0x4695a0(this['locale']);return _0x2815a2['label']=Et(this['locale'],'Reopen'),_0x2815a2['tooltip']=Et(this['locale'],'Reopen'),_0x2815a2['icon']=_0x2afc5d,_0x2815a2['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x2e55eb=>!_0x2e55eb),_0x2815a2['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x1417aa,_0x1fd347)=>_0x1417aa&&_0x1fd347),_0x2815a2['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x2815a2;}_trimContextValue(_0x371ba9){if(_0x371ba9['length']<0x96)return _0x371ba9;const _0x5ecfc6=_0x371ba9['lastIndexOf']('\x20',0x93);return _0x371ba9['substring'](0x0,_0x5ecfc6>-0x1?_0x5ecfc6:0x93)+'...';}_attachContextActions(){const _0x40cc10=this['element']['querySelector']('.ck-context'),_0x595484=_0x40cc10['querySelector']('.ck-context__value');this['listenTo'](_0x40cc10,'mouseenter',()=>{_0x595484['offsetWidth']<_0x595484['scrollWidth']&&_0x40cc10['classList']['add']('overlay');}),this['listenTo'](_0x40cc10,'mouseleave',()=>{_0x40cc10['classList']['remove']('overlay');});}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']);for(const _0x3bcd9a of this['focusables'])this['focusTracker']['add'](_0x3bcd9a['element']),this['keystrokes']['listenTo'](_0x3bcd9a['element']);}_createContextView(){const _0x35a519=new Vt(this['locale']);return _0x35a519['bind']('contextValue')['to'](this),_0x35a519;}},Ht=class extends ht{['_model'];['_config'];commentThreadHeaderView;commentThreadInputView;ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x5db4c4,_0x28f995,_0x5d9714,_0x54ce63){super(_0x5db4c4),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x28f995,this['_localUser']=_0x5d9714,this['_config']=_0x54ce63,this['commentThreadHeaderView']=new Bt(_0x5db4c4,_0x28f995),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x3790e4(_0x5db4c4,Et(_0x5db4c4,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new Lt(_0x5db4c4,_0x28f995,Object['assign']({'CommentView':this['_config']['CommentView']},_0x54ce63)),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',(_0x48879c,_0x1ffbb2)=>_0x48879c||!!_0x1ffbb2),this['bind']('isUnlinked')['to'](_0x28f995,'unlinkedAt',_0x15d495=>!!_0x15d495);let _0x55151f=null;const _0xbfa803=()=>{const _0xc4e03f=this['_model']['comments']['first']||null;_0xc4e03f!==_0x55151f&&(_0x55151f&&this['stopListening'](_0x55151f,'change:content'),_0x55151f=_0xc4e03f,_0xc4e03f&&this['listenTo'](_0xc4e03f,'change:content',_0xbfa803));const _0x4e037b=_0xc4e03f?_0xc4e03f['author']['name']:this['_localUser']['name'],_0x105ef0=_0xc4e03f?new DOMParser()['parseFromString'](_0x4effb0(_0xc4e03f['content'],{'limit':this['_config']['maxCommentCharsWhenCollapsed']}),'text/html')['body']['textContent']:'',_0x472de9=Et(this['locale'],'COMMENT_THREAD_LABEL',[this['length'],_0x4e037b]);this['set']('ariaLabel',_0x105ef0?_0x472de9+'\x20'+_0x105ef0:_0x472de9);};this['listenTo'](this['_model']['comments'],'change',_0xbfa803),_0xbfa803(),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x1bc134(),this['keystrokes']=new _0x4d6908(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x4b5f7b=>_0x4b5f7b['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0x2e9506(this,this['focusables']);}async destroy(){this['isDirty']=!0x1,this['commentsListView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}_createCommentThreadInputView(){const _0x2f9529=new xt(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x336203=_0x2f9529['commentInputView'];return _0x2f9529['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x336203,'value',(_0x238571,_0x31fc91,_0x1a886e,_0x1d6da7,_0x5f1c29)=>!!_0x5f1c29||!!_0x1d6da7&&_0x1a886e&&!_0x31fc91||_0x238571&&_0x1a886e&&!_0x31fc91),_0x336203['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0xdd55fa,_0x142fc0,_0x405526)=>{let _0x469b20;return _0x469b20=_0x405526&&_0x142fc0?'Reply\x20to\x20reopen\x20discussion...':_0xdd55fa?'Reply...':'Write\x20a\x20comment...',Et(this['locale'],_0x469b20);}),_0x336203['bind']('submitLabel')['to'](this,'length',_0x18822a=>Et(this['locale'],_0x18822a?'Reply':'Comment')),_0x336203['on']('submit',(_0x5d5cec,_0x15dee3)=>{this['fire']('addComment',_0x15dee3),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x336203['on']('cancel',()=>{this['focus']();}),_0x336203['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x336203['on']('cancel',_0x280e23=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x280e23['stop']());}),this['on']('change:isActive',(_0x8435c3,_0x2ffe38,_0x40be65)=>{_0x40be65||this['length']||_0x336203['value']||this['fire']('removeCommentThread');}),_0x2f9529;}};const Ft=/* #__PURE__ -- @preserve */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
_0x4c9f3d();var $t=class Annotation extends jt{['view'];focusableElements;_type;_target;constructor({view:_0x1f9670,target:_0x3e828a,type:_0xd3372d,isVisible:_0x5bc7f8=!0x0}){super(),this['view']=_0x1f9670,this['view']['element']||this['view']['render'](),this['_type']=_0xd3372d,this['_target']=_0x3e828a,Annotation['_assertCorrectTarget'](this['_getNormalizedTarget']()),this['focusableElements']=new _0x3a878e([this['view']['element']],{'idProperty':'_id'}),this['focusableElements']['on']('add',(_0x4cb4e2,_0x827114)=>{this['view']['focusTracker']['add'](_0x827114);}),this['focusableElements']['on']('remove',(_0x18a8d3,_0xbcf8cf)=>{this['view']['focusTracker']['remove'](_0xbcf8cf);}),this['set']('isVisible',_0x5bc7f8);}get type(){return'function'==typeof this['_type']?this['_type']():this['_type'];}get['innerView'](){return this['view']['mainView'];}get target(){const _0x11f740=this['_getNormalizedTarget']();return Annotation['_assertCorrectTarget'](_0x11f740),_0x11f740;}get targetRect(){const _0x589a94=this['target'];if(null===_0x589a94)return null;if(_0x589a94 instanceof _0x5b8deb)return _0x589a94;const _0x3febe8=_0x589a94['filter'](_0x1646a8=>function(_0x1aac24){return!!_0x1aac24['offsetParent']||!!_0x1aac24['getClientRects']()['item'](0x0);}(_0x1646a8));return 0x0===_0x3febe8['length']?null:_0x5b8deb['getDomElementRects'](_0x3febe8[0x0])[0x0];}get isActive(){return this['view']['isActive'];}set isActive(_0x5aedcf){this['view']['isActive']=_0x5aedcf,this['view']['mainView']['isActive']=_0x5aedcf;}updateTargetRect(){this['view']['targetRect']=this['targetRect'];}destroy(){this['focusableElements']['stopListening'](),this['focusableElements']['clear'](),this['stopListening']();}refreshVisibility(){this['isVisible']=!!this['targetRect'];}static _assertCorrectTarget(_0x208302){if(!(null===_0x208302||_0x208302 instanceof _0x5b8deb||Array['isArray'](_0x208302)&&_0x208302['every'](_0x1b9a35=>zt(_0x1b9a35))))throw new _0x4542a4('annotation-invalid-target',null,{'target':_0x208302});}_getNormalizedTarget(){const _0x549159='function'==typeof this['_target']?this['_target']():this['_target'];return zt(_0x549159)?[_0x549159]:_0x549159;}};function zt(_0xdb71a2){return null!==_0xdb71a2&&'object'==typeof _0xdb71a2&&'nodeType'in _0xdb71a2&&0x1===_0xdb71a2['nodeType'];}var Jt=class extends _0x3a878e{_innerViewToAnnotation;_viewToAnnotation;['_focusTracker'];constructor(_0x3a3788=[]){super(),this['_innerViewToAnnotation']=new Map(),this['_viewToAnnotation']=new Map(),this['_focusTracker']=new _0x1bc134(),this['_focusTracker']['on']('change:isFocused',(_0x266a63,_0x372b78,_0x4d285d)=>{_0x4d285d||this['fire']('blur');});for(const _0xdc523e of _0x3a3788)this['add'](_0xdc523e);}get['isFocused'](){return this['_focusTracker']['isFocused'];}['add'](_0xc77968){if(this['has'](_0xc77968))throw new _0x4542a4('annotationcollection-duplicated-item',null);this['_innerViewToAnnotation']['set'](_0xc77968['innerView'],_0xc77968),this['_viewToAnnotation']['set'](_0xc77968['view'],_0xc77968);for(const _0x25013b of _0xc77968['focusableElements'])this['_focusTracker']['add'](_0x25013b);if(this['listenTo'](_0xc77968['focusableElements'],'add',(_0x15f31e,_0x5804a8)=>{this['_focusTracker']['add'](_0x5804a8);}),this['listenTo'](_0xc77968['focusableElements'],'remove',(_0x1e2ee2,_0x49c6cf)=>{this['_focusTracker']['remove'](_0x49c6cf);}),this['listenTo'](_0xc77968['view']['focusTracker'],'change:isFocused',(_0x118cf3,_0x3b6d83,_0x31c45c)=>{_0x31c45c&&this['fire']('focus',_0xc77968);}),_0xc77968['updateTargetRect'](),this['_areCachedRectsStale']()){for(const _0xcd61b4 of this)_0xcd61b4['updateTargetRect']();}const _0x44cda3=this['_getOrderInContent'](_0xc77968['view']['targetRect']);return super['add'](_0xc77968,_0x44cda3);}['remove'](_0x4f02ff){if(!this['has'](_0x4f02ff))throw new _0x4542a4('annotationcollection-not-existing-item',null);this['stopListening'](_0x4f02ff['view']['focusTracker']),this['stopListening'](_0x4f02ff['focusableElements']);for(const _0x3d84a9 of _0x4f02ff['focusableElements'])this['_focusTracker']['remove'](_0x3d84a9);return this['_viewToAnnotation']['delete'](_0x4f02ff['view']),this['_innerViewToAnnotation']['delete'](_0x4f02ff['innerView']),super['remove'](_0x4f02ff);}getByInnerView(_0x149d34){return this['_innerViewToAnnotation']['get'](_0x149d34);}getByView(_0x2e66ec){return this['_viewToAnnotation']['get'](_0x2e66ec);}destroy(){super['clear'](),this['stopListening'](),this['_innerViewToAnnotation']['clear'](),this['_viewToAnnotation']['clear'](),this['_focusTracker']['destroy']();}refreshPositioning(){for(const _0x5a3bd7 of this)_0x5a3bd7['updateTargetRect']();this['_sort']();}_sort(){const _0x6ac8b2=Array['from'](this)['sort']((_0x5d6d86,_0x357cd6)=>Zt(_0x5d6d86['view']['targetRect'],_0x357cd6['view']['targetRect']));for(let _0x314f39=_0x6ac8b2['length']-0x1;_0x314f39>0x0;_0x314f39--){const _0x29f50b=_0x6ac8b2[_0x314f39];_0x314f39!==this['getIndex'](_0x29f50b)&&(this['remove'](_0x29f50b),this['add'](_0x29f50b));}}_getOrderInContent(_0x547e42){let _0x390c4f=0x0;if(!_0x547e42)return this['length'];for(const _0x1608cc of this){const _0x25267f=_0x1608cc['view']['targetRect'];if(_0x25267f){if(Zt(_0x547e42,_0x25267f)<0x0)return _0x390c4f;_0x390c4f++;}}return _0x390c4f;}_areCachedRectsStale(){const _0x5e3c2a=this['get'](0x0);if(!_0x5e3c2a)return!0x1;const _0x23d2af=_0x5e3c2a['view']['targetRect'],_0x54fb84=_0x5e3c2a['targetRect'];return!(!_0x23d2af||!_0x54fb84)&&(_0x23d2af['top']!==_0x54fb84['top']||_0x23d2af['left']!==_0x54fb84['left']);}};function Qt({source:_0x41cb6c,target:_0x5ccb19,filter:_0x5e6eac}){for(const _0x4f9087 of _0x41cb6c)_0x5e6eac(_0x4f9087)&&_0x5ccb19['add'](_0x4f9087);_0x5ccb19['listenTo'](_0x41cb6c,'add',(_0xce1f6d,_0x1033a4)=>{_0x5e6eac(_0x1033a4)&&_0x5ccb19['add'](_0x1033a4);}),_0x5ccb19['listenTo'](_0x41cb6c,'remove',(_0x3f68fd,_0x57de17)=>{_0x5ccb19['has'](_0x57de17)&&_0x5ccb19['remove'](_0x57de17);});}function Zt(_0x58511c,_0x17fa0f){if(null===_0x58511c&&null===_0x17fa0f)return 0x0;if(null===_0x58511c)return-0x1;if(null===_0x17fa0f)return 0x1;const _0x5307fd=_0x58511c['top']-_0x17fa0f['top'];return 0x0==_0x5307fd?_0x58511c['left']-_0x17fa0f['left']:_0x5307fd;}var ti=class extends _0x5bc735{collection;_visibleAnnotations;static get['pluginName'](){return'Annotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2512ff){if(super(_0x2512ff),this['collection']=new Jt(),this['_visibleAnnotations']=new Jt(),this['set']('activeAnnotations',new Set()),this['_bindAnnotationsToVisibleAnnotations'](),_0x2512ff instanceof _0x4c61cd){const _0xcd2921=_0x2512ff['locale'];_0x2512ff['accessibility']['addKeystrokeInfoGroup']({'id':'annotations','label':Et(_0xcd2921,'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'),'keystrokes':[{'label':Et(_0xcd2921,'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'),'keystroke':'Ctrl+Shift+E'},{'label':Et(_0xcd2921,'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'),'keystroke':'Esc'},{'label':Et(_0xcd2921,'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'),'keystroke':'Enter'},{'label':Et(_0xcd2921,'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'),'keystroke':[['Tab'],['Shift+Tab']]},{'label':Et(_0xcd2921,'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'),'keystroke':['Ctrl+Enter']},{'label':Et(_0xcd2921,'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'),'keystroke':[['Arrowup'],['Arrowdown']]}]});}this['_setupEnterAnnotationKeystroke'](),this['_setupEscapeAnnotationHandling']();}['add'](_0x1b9585){this['collection']['add'](_0x1b9585);}['remove'](_0xad2df6){this['collection']['remove'](_0xad2df6),_0xad2df6['destroy']();}refreshVisibility(){for(const _0xa3ffa9 of this['collection'])_0xa3ffa9['refreshVisibility']();}refreshPositioning(){this['_visibleAnnotations']['refreshPositioning']();}getByInnerView(_0x1d39f4){return this['collection']['getByInnerView'](_0x1d39f4);}deactivateAll(){this['fire']('_deactivateAllAnnotations');}destroy(){for(const _0x206d31 of this['collection'])_0x206d31['destroy']();this['_visibleAnnotations']['destroy'](),this['collection']['destroy'](),super['destroy']();}activate(_0x447f93){this['fire']('_activateAnnotation',_0x447f93);}createAnnotation(_0x1dbe5e){return new $t(_0x1dbe5e);}createAnnotationView(_0x20d8d7,_0x360ca1){return new qt(_0x20d8d7,_0x360ca1);}_addActiveAnnotation(_0x3f19ba){const _0x403440=new Set(this['activeAnnotations']);_0x403440['add'](_0x3f19ba),this['activeAnnotations']=_0x403440;}_removeActiveAnnotation(_0x2201d0){const _0x3f612c=new Set(this['activeAnnotations']);_0x3f612c['delete'](_0x2201d0),this['activeAnnotations']=_0x3f612c;}_bindAnnotationsToVisibleAnnotations(){const _0x17e3e0=this['collection'],_0x94c73b=this['_visibleAnnotations'];function _0x138ee0(_0x57747a){const _0x3adf45=_0x57747a['source'];_0x3adf45['isVisible']&&!_0x94c73b['has'](_0x3adf45)?_0x94c73b['add'](_0x3adf45):!_0x3adf45['isVisible']&&_0x94c73b['has'](_0x3adf45)&&_0x94c73b['remove'](_0x3adf45),_0x3adf45['view']['focusTracker']['remove'](_0x3adf45['view']['element']),_0x3adf45['view']['focusTracker']['add'](_0x3adf45['view']['element']);}this['listenTo'](_0x17e3e0,'add',(_0x3ab23b,_0x25948c)=>{_0x25948c['isVisible']&&_0x94c73b['add'](_0x25948c),this['listenTo'](_0x25948c,'change:isVisible',_0x138ee0);}),this['listenTo'](_0x17e3e0,'remove',(_0x35280b,_0x5489ad)=>{_0x94c73b['has'](_0x5489ad)&&_0x94c73b['remove'](_0x5489ad),this['stopListening'](_0x5489ad,'change:isVisible',_0x138ee0);});}_setupEnterAnnotationKeystroke(){const _0x5af26c=_0x81a3e0=>{_0x81a3e0['on']('ready',()=>{_0x81a3e0['keystrokes']['set'](_0x5bd6c1,(_0xb51f93,_0x3eaf40)=>{const _0x4fd4cf=_0x1f79f6(this['activeAnnotations']['values']());_0x4fd4cf&&(_0x4fd4cf['view']['focus'](),_0x3eaf40());});});};this['context']instanceof _0x4c61cd?_0x5af26c(this['context']):this['context']['editors']&&this['context']['editors']['on']('add',(_0x532751,_0x2fa574)=>{_0x5af26c(_0x2fa574);});}_setupEscapeAnnotationHandling(){const _0x102989=_0x1b30e7=>{const _0xd42ce2=_0x1b30e7['source'],_0x80d673=[];let _0x71dc88;if(Array['isArray'](_0xd42ce2['target'])){_0x71dc88=_0xd42ce2['target'][0x0],this['context']instanceof _0x4c61cd?_0x80d673['push'](this['context']):this['context']['editors']&&_0x80d673['push'](...this['context']['editors']);for(const _0x145b7e of _0x80d673)for(const _0x1e024d of _0x145b7e['editing']['view']['domRoots']['values']())if(_0x1e024d['contains'](_0x71dc88))return void _0x145b7e['editing']['view']['focus']();_0x71dc88['focus']();}};this['listenTo'](this['collection'],'add',(_0x3f05c8,_0x4783e7)=>{this['listenTo'](_0x4783e7,'escape',_0x102989,{'priority':'low'});}),this['listenTo'](this['collection'],'remove',(_0x5ac5d3,_0x2c6e7d)=>{this['stopListening'](_0x2c6e7d,'escape',_0x102989);});}};const ii=Symbol('noChannel'),ei={'admin':!0x0,'modifyAll':!0x1,'write':!0x0,'resolve':!0x0},si=/* #__PURE__ -- @preserve */
|
|
30
|
-
|
|
31
|
-
_0x4c9f3d();var oi=class extends _0x5bc735{_threads;_threadToController;_viewToController;static get requires(){return[ti,_0x1082ad,_0x459e31];}static get['pluginName'](){return'CommentsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x53af7e){super(_0x53af7e),this['_threads']=new Map(),this['_threadToController']=new Map(),this['_viewToController']=new Map(),this['set']('_readOnlyChannels',new Set()),this['set']('_permissions',new Map());const _0x4196cb=this['context']['config'];_0x4196cb['define']('comments.maxCommentsWhenCollapsed',0x2),_0x4196cb['define']('comments.maxThreadTotalWeight',0x1f4),_0x4196cb['define']('comments.maxCommentCharsWhenCollapsed',0x8c),_0x4196cb['define']('comments.CommentThreadView',Ut),_0x4196cb['define']('comments.CommentView',Yt),_0x4196cb['get']('comments.editorConfig')||console['warn']('Missing\x20comments\x20editor\x20configuration\x20(`comments.editorConfig`).\x20Default\x20configuration\x20will\x20be\x20used\x20instead.');}init(){const _0x44cbeb=this['context']['plugins']['get'](ti);this['set']('activeCommentThread',null),this['on']('addCommentThread',(_0x884686,_0xe0a925)=>this['_addCommentThread'](_0xe0a925)),this['on']('submitCommentThread',(_0xc21721,_0xf895bc)=>this['_submitCommentThread'](_0xf895bc)),this['on']('resolveCommentThread',(_0x2af0ac,_0x3a0a12)=>this['_resolveCommentThread'](_0x3a0a12)),this['on']('resolveCommentThread',(_0x2a6a26,_0x15b500)=>this['_updateActiveAnnotation'](_0x15b500),{'priority':'lowest'}),this['on']('reopenCommentThread',(_0x23c6e3,_0x501c1d)=>this['_reopenCommentThread'](_0x501c1d)),this['on']('reopenCommentThread',(_0x52f06a,_0xab4097)=>this['_updateActiveAnnotation'](_0xab4097),{'priority':'lowest'}),this['on']('removeCommentThread',(_0x5191e0,_0x4d8b46)=>this['_removeCommentThread'](_0x4d8b46)),this['on']('updateCommentThread',(_0x2c6aa1,_0x1f3d7b)=>this['_updateCommentThread'](_0x1f3d7b)),this['on']('updateCommentThread',(_0xb48083,_0x83b346)=>this['_updateActiveAnnotation'](_0x83b346),{'priority':'lowest'}),this['on']('addComment',(_0x1e2fa5,_0x24b1ae)=>this['_addComment'](_0x24b1ae)),this['on']('updateComment',(_0x2b2b86,_0x4cc2c9)=>this['_updateComment'](_0x4cc2c9)),this['on']('removeComment',(_0x1d9d42,_0x28c4a8)=>this['_removeComment'](_0x28c4a8)),this['on']('addComment',(_0x546df6,{threadId:_0x4e19e4,isFromAdapter:_0x43162b})=>{if(_0x43162b)return;const _0x30f816=this['getCommentThread'](_0x4e19e4),_0x141bf4=_0x30f816&&this['_threadToController']['get'](_0x30f816);_0x141bf4&&_0x141bf4['view']['commentsListView']['focus'](-0x1);},{'priority':'lowest'}),this['listenTo'](_0x44cbeb,'change:activeAnnotations',(_0x46c48b,_0x509e75,_0x3cc715)=>{const _0x22f6cb=Array['from'](_0x3cc715)['map'](_0x579ed8=>this['_viewToController']['get'](_0x579ed8['innerView']))['filter'](Boolean)[0x0];this['activeCommentThread']=_0x22f6cb?_0x22f6cb['model']:null;});}set adapter(_0x3cdb73){if(this['_adapter'])throw new _0x4542a4('commentsrepository-adapter-already-set');this['_adapter']=_0x3cdb73;}get adapter(){return this['_adapter'];}addCommentThread({channelId:_0x5767f1=ii,threadId:_0x8ac6a1=_0x31754c(),comments:_0x502282=[],unlinkedAt:_0x43390e=null,resolvedAt:_0x1d9a98=null,resolvedBy:_0x4d4e02=null,target:_0x818bf3=null,context:_0x4dc97c=null,attributes:_0x5b7418={},isResolvable:_0x4f67f2=!0x0,isSubmitted:_0x2d529c=!0x1,isFromAdapter:_0x27f7ed=!0x1}={}){return this['fire'](ai('addCommentThread',_0x5767f1),{'channelId':_0x5767f1,'threadId':_0x8ac6a1,'comments':_0x502282,'unlinkedAt':_0x43390e,'resolvedAt':_0x1d9a98,'resolvedBy':_0x4d4e02,'target':_0x818bf3,'context':_0x4dc97c,'attributes':_0x5b7418,'isFromAdapter':_0x27f7ed,'isResolvable':_0x4f67f2,'isSubmitted':_0x2d529c}),this['getCommentThread'](_0x8ac6a1);}openNewCommentThread({channelId:_0x21a6a3=ii,threadId:_0x4b2832=_0x31754c(),target:_0x556e02,context:_0x487f3a=null,isResolvable:_0xd81f1e=!0x0}){if(this['_readOnlyChannels']['has'](_0x21a6a3)||this['_readOnlyChannels']['has'](void 0x0))return null;if(!_0x556e02)throw new _0x4542a4('commentsrepository-missing-target');const _0x3ac2d8=this['addCommentThread']({'channelId':_0x21a6a3,'threadId':_0x4b2832,'target':_0x556e02,'context':_0x487f3a,'isResolvable':_0xd81f1e});if(!_0x3ac2d8)return null;const _0x3c5e71=this['_threadToController']['get'](_0x3ac2d8),_0x2aea13=_0x3c5e71['view']['commentThreadInputView']['commentInputView'],_0x30da37=this['context']['plugins']['get'](ti),_0x1a92be=_0x30da37['getByInnerView'](_0x3c5e71['view']);return _0x30da37['activate'](_0x1a92be),_0x2aea13['once']('editorReady',()=>_0x2aea13['focus']()),_0x3ac2d8;}hasCommentThread(_0x41b09b){if('string'!=typeof _0x41b09b)throw new _0x4542a4('commentsrepository-invalid-comment-thread-id');return this['_threads']['has'](_0x41b09b);}updateCommentThread({channelId:_0x1f3340=ii,threadId:_0x3b719b,context:_0x1d28b5,unlinkedAt:_0x1923af,attributes:_0x4c1a89,isFromAdapter:_0x1626c5=!0x1}){return this['fire'](ai('updateCommentThread',_0x1f3340),{'channelId':_0x1f3340,'threadId':_0x3b719b,'context':_0x1d28b5,'unlinkedAt':_0x1923af,'attributes':_0x4c1a89,'isFromAdapter':_0x1626c5}),this['getCommentThread'](_0x3b719b);}getCommentThread(_0x184721){if('string'!=typeof _0x184721)throw new _0x4542a4('commentsrepository-invalid-comment-thread-id');return this['_threads']['get'](_0x184721);}fetchCommentThread({channelId:_0x4eebbd,threadId:_0x6983a0}={}){const _0x3a4094=this['getCommentThread'](_0x6983a0);if(_0x3a4094)return Promise['resolve'](_0x3a4094);if(!this['adapter'])return Promise['resolve'](void 0x0);if('function'!=typeof this['adapter']['getCommentThread'])throw new _0x4542a4('commentsrepository-missing-thread-and-adapter-method',this['context']);return this['adapter']['getCommentThread']({'channelId':_0x4eebbd,'threadId':_0x6983a0})['then'](_0x17ef8f=>this['hasCommentThread'](_0x6983a0)?this['getCommentThread'](_0x6983a0):_0x17ef8f?this['addCommentThread'](Object['assign']({'isFromAdapter':!0x0,'channelId':_0x4eebbd},_0x17ef8f)):void 0x0)['catch'](_0x2c4605=>{throw console['error'](_0x2c4605),new _0x4542a4('commentsrepository-fetch-comment-thread',this['context']);});}getCommentThreads({channelId:_0x3e2c0a,skipNotAttached:_0x53ad9a=!0x1,skipEmpty:_0x1a6869=!0x1,toJSON:_0x11121e=!0x1}={}){const _0x5e4106=[];for(const _0x1925af of this['_threads']['values']())_0x3e2c0a&&_0x1925af['channelId']!==_0x3e2c0a||_0x53ad9a&&!_0x1925af['isAttached']||_0x1a6869&&0x0===_0x1925af['length']||_0x5e4106['push'](_0x1925af);return _0x11121e?_0x5e4106['map'](_0x36f20a=>_0x36f20a['toJSON']()):_0x5e4106;}getAnnotationForCommentThread(_0x233c42){const _0x47e979=this['_threadToController']['get'](_0x233c42);return _0x47e979&&this['context']['plugins']['get'](ti)['getByInnerView'](_0x47e979['view'])||null;}getCommentThreadForAnnotation(_0x7e6687){const _0x25b587=this['_viewToController']['get'](_0x7e6687['innerView']);return _0x25b587?_0x25b587['model']:null;}setActiveCommentThread(_0xe9d299){const _0x101ff0=this['context']['plugins']['get'](ti);if(!_0xe9d299)return void(this['activeCommentThread']&&_0x101ff0['deactivateAll']());const _0x278f20=this['getCommentThread'](_0xe9d299);if(!_0x278f20)throw new _0x4542a4('commentsrepository-active-missing-comment-thread',null,{'threadId':_0xe9d299});if(!this['_threadToController']['has'](_0x278f20))throw new _0x4542a4('commentsrepository-active-not-attached',null,{'threadId':_0xe9d299});const _0x1bdefc=_0x101ff0['getByInnerView'](this['_threadToController']['get'](_0x278f20)['view']);_0x101ff0['activate'](_0x1bdefc);}switchReadOnly(_0x4bf63f,_0x590f23){_0x4bf63f?this['_readOnlyChannels']['add'](_0x590f23):this['_readOnlyChannels']['delete'](_0x590f23),this['fire']('change:_readOnlyChannels','_readOnlyChannels',this['_readOnlyChannels'],this['_readOnlyChannels']);}['isReadOnly'](_0x340d3f){return this['_readOnlyChannels']['has'](_0x340d3f)||this['_readOnlyChannels']['has'](void 0x0);}createCommentThreadController(_0x3bbe08,_0xe015d9){return new bt(_0x3bbe08,_0xe015d9);}setPermissions(_0x548926,_0x281577=ii){this['_permissions']['set'](_0x281577,_0x548926),this['fire']('change:_permissions','_permissions',this['_permissions'],this['_permissions']);}getPermissions(_0x213392=ii){return this['_permissions']['has'](_0x213392)?this['_permissions']['get'](_0x213392):ei;}_addCommentThread({channelId:_0x1061c7,threadId:_0x542844,comments:_0xb714a,unlinkedAt:_0x595df5,resolvedAt:_0x2847fe,resolvedBy:_0x4ab1c7,target:_0x5ade99,context:_0x236453,attributes:_0x1f4cb7,isFromAdapter:_0x2a9498,isResolvable:_0x3aaed3,isSubmitted:_0x44edea}){if('string'!=typeof _0x542844)throw new _0x4542a4('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x542844});if(this['hasCommentThread'](_0x542844))throw new _0x4542a4('commentsrepository-duplicated-comment-thread-id',null,{'threadId':_0x542844});const _0x42a088=new ri(this,{'channelId':_0x1061c7,'id':_0x542844,'context':_0x236453,'attributes':_0x1f4cb7,'unlinkedAt':_0x595df5,'resolvedAt':_0x2847fe,'resolvedBy':_0x4ab1c7?this['context']['plugins']['get'](_0x459e31)['getUser'](_0x4ab1c7):null,'isResolvable':_0x3aaed3,'isSubmitted':_0x44edea||_0x2a9498});this['_threads']['set'](_0x542844,_0x42a088);for(const _0x3d6a74 of _0xb714a)_0x42a088['_add'](this['_createNewComment']({'threadId':_0x542844,..._0x3d6a74}));return _0x5ade99&&_0x42a088['attachTo'](_0x5ade99),_0x2a9498||!_0x42a088['length']?Promise['resolve']():this['_submitCommentThread']({'channelId':_0x1061c7,'threadId':_0x542844});}_submitCommentThread({channelId:_0x323f05,threadId:_0x549b65}){if(!this['hasCommentThread'](_0x549b65))throw new _0x4542a4('commentsrepository-missing-comment-thread',this);const _0x2bdeaa=this['getCommentThread'](_0x549b65);if(_0x2bdeaa['_isSubmitted']=!0x0,!this['adapter']||'function'!=typeof this['adapter']['addCommentThread'])return Promise['resolve']();const {id:_0x2c3e68,comments:_0x3f5806,resolvedAt:_0x4df91b,resolvedBy:_0x29a877,context:_0x2a8856,attributes:_0x595284}=_0x2bdeaa,_0x56eaa4=this['context']['plugins']['get']('PendingActions'),_0x2fbba6=_0x56eaa4['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['addCommentThread']({'channelId':_0x323f05,'threadId':_0x2c3e68,'comments':_0x3f5806['map'](_0x532768=>_0x532768['toJSON']()),'resolvedAt':_0x4df91b,'resolvedBy':_0x29a877?_0x29a877['id']:_0x29a877,'context':_0x2a8856,'attributes':_0x595284})['then'](({comments:_0xf1a121})=>{_0x56eaa4['remove'](_0x2fbba6);for(const _0x241670 of _0xf1a121)this['_updateComment']({'channelId':_0x323f05,'threadId':_0x549b65,'commentId':_0x241670['commentId'],'createdAt':_0x241670['createdAt'],'isFromAdapter':!0x0});})['catch'](_0xcf7d40=>{throw console['error'](_0xcf7d40),new _0x4542a4('commentsrepository-add-comment-thread-internal-error',this);});}_attachCommentThread({threadId:_0x498c3a,target:_0x33c6cb}){const _0x46553d=this['getCommentThread'](_0x498c3a);if(!_0x46553d)throw new _0x4542a4('commentsrepository-attach-missing-comment-thread',this);const _0x44b8bd=this['context']['plugins']['get']('PendingActions'),_0x16e3de=this['context']['plugins']['get'](ti),_0x4f7b38=this['_createCommentThreadView'](_0x46553d),_0x3a27ca=new bt(_0x46553d,_0x4f7b38);let _0x4da5fb=null;_0x4f7b38['on']('change:isDirty',(_0x5e95a8,_0xd82021,_0x50b6e1)=>{_0x50b6e1?_0x4da5fb=_0x44b8bd['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD')):_0x4da5fb&&(_0x44b8bd['remove'](_0x4da5fb),_0x4da5fb=null);}),this['_threadToController']['set'](_0x46553d,_0x3a27ca),this['_viewToController']['set'](_0x4f7b38,_0x3a27ca);const _0x3398bc=new qt(this['context']['locale'],_0x4f7b38);_0x3398bc['bind']('length')['to'](_0x4f7b38),_0x3398bc['bind']('isDirty')['to'](_0x4f7b38,'isDirty',_0x4f7b38,'length',(_0x5641f1,_0x423b12)=>_0x5641f1||!_0x423b12),_0x3398bc['bind']('isActive')['to'](_0x4f7b38),_0x3398bc['type']='comment';const _0x3eb44a=new $t({'view':_0x3398bc,'target':_0x33c6cb,'type':'comment','isVisible':!_0x46553d['archivedAt']&&!!('function'==typeof _0x33c6cb?_0x33c6cb():_0x33c6cb)});return _0x4f7b38['on']('escape',()=>{_0x3eb44a['fire']('escape');}),this['_bindAnnotationToEditors'](_0x4f7b38,_0x3eb44a),_0x16e3de['add'](_0x3eb44a),_0x3eb44a;}_bindAnnotationToEditors(_0x2791aa,_0x3746d6){this['listenTo'](_0x2791aa,'editorReady',(_0x375ca3,_0x22030c)=>{const _0x29d952=_0x22030c['ui']['view']['body']['bodyCollectionContainer'];_0x3746d6['focusableElements']['add'](_0x29d952),this['context']instanceof _0x4c61cd&&this['context']['ui']['focusTracker']['add'](_0x29d952);},{'priority':'highest'}),this['listenTo'](_0x2791aa,'editorDestroyed',(_0x313cdb,_0x35f76c)=>{const _0x3e85fe=_0x35f76c['ui']['view']['body']['bodyCollectionContainer'];_0x3746d6['focusableElements']['has'](_0x3e85fe)&&_0x3746d6['focusableElements']['remove'](_0x3e85fe),this['context']instanceof _0x4c61cd&&this['context']['ui']['focusTracker']['remove'](_0x3e85fe);});}_unbindEditors(_0x54c647){this['stopListening'](_0x54c647,'editorReady'),this['stopListening'](_0x54c647,'editorDestroyed');}_createCommentThreadView(_0x1dfbef){const _0x476837=this['context']['plugins']['get'](_0x459e31),{config:_0x4f0a31,locale:_0x328552}=this['context'],_0x37376c=_0x167475(_0x4f0a31['get']('locale'),_0x328552);return new(0x0,(_0x4f0a31['get']('comments'))['CommentThreadView'])(_0x328552,_0x1dfbef,_0x476837['me'],{'editorConfig':{..._0x4f0a31['get']('comments.editorConfig'),'licenseKey':this['context']['config']['get']('licenseKey')},'copyMarkers':_0x4f0a31['get']('comments.copyMarkers'),'maxCommentsWhenCollapsed':_0x4f0a31['get']('comments.maxCommentsWhenCollapsed'),'maxThreadTotalWeight':_0x4f0a31['get']('comments.maxThreadTotalWeight'),'maxCommentCharsWhenCollapsed':_0x4f0a31['get']('comments.maxCommentCharsWhenCollapsed'),'formatDateTime':_0x37376c,'CommentView':_0x4f0a31['get']('comments')['CommentView']});}_resolveCommentThread({threadId:_0x235a6d,channelId:_0x500e70,resolvedAt:_0x2937c4,resolvedBy:_0x40c52f,isFromAdapter:_0x360653}){if(!this['hasCommentThread'](_0x235a6d))throw new _0x4542a4('commentsrepository-missing-comment-thread',null,{'threadId':_0x235a6d});const _0x5e36c9=this['getCommentThread'](_0x235a6d);if(_0x5e36c9['isResolved'])throw new _0x4542a4('commentsrepository-resolved-comment-thread',null,{'threadId':_0x235a6d});const _0x105f8d=this['context']['plugins']['get'](_0x459e31);if(_0x5e36c9['resolvedBy']=_0x105f8d['getUser'](_0x40c52f),_0x5e36c9['resolvedAt']=_0x2937c4,_0x360653||!this['adapter']||'function'!=typeof this['adapter']['resolveCommentThread'])return Promise['resolve']();const _0xb98fca=this['context']['plugins']['get']('PendingActions'),_0x50e08a=_0xb98fca['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['resolveCommentThread']({'channelId':_0x500e70,'threadId':_0x235a6d})['then'](({resolvedAt:_0x126b3b,resolvedBy:_0x2dd36d})=>{_0xb98fca['remove'](_0x50e08a),_0x5e36c9['resolvedBy']['id']!==_0x2dd36d&&(_0x5e36c9['resolvedBy']=_0x105f8d['getUser'](_0x2dd36d)),_0x5e36c9['resolvedAt']=_0x126b3b;})['catch'](_0x1ca627=>{throw console['error'](_0x1ca627),new _0x4542a4('commentsrepository-resolve-comment-thread-internal-error',this);});}_reopenCommentThread({threadId:_0x8474d4,channelId:_0x14f0b6,isFromAdapter:_0xfbc0ee}){if(!this['hasCommentThread'](_0x8474d4))throw new _0x4542a4('commentsrepository-missing-comment-thread',null,{'threadId':_0x8474d4});const _0x56dabc=this['getCommentThread'](_0x8474d4);if(!_0x56dabc['isResolved'])throw new _0x4542a4('commentsrepository-reopen-comment-thread',null,{'threadId':_0x8474d4});if(_0x56dabc['resolvedBy']=null,_0x56dabc['resolvedAt']=null,_0xfbc0ee||!this['adapter']||'function'!=typeof this['adapter']['reopenCommentThread'])return Promise['resolve']();const _0x17496f=this['context']['plugins']['get']('PendingActions'),_0x508eef=_0x17496f['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['reopenCommentThread']({'channelId':_0x14f0b6,'threadId':_0x8474d4})['then'](()=>_0x17496f['remove'](_0x508eef))['catch'](_0x481f42=>{throw console['error'](_0x481f42),new _0x4542a4('commentsrepository-reopen-comment-thread-internal-error',this);});}_removeCommentThread({threadId:_0x507feb,isFromAdapter:_0x53138a}){const _0x307d63=this['getCommentThread'](_0x507feb);if(!_0x307d63)throw new _0x4542a4('commentsrepository-remove-missing-comment-thread',this);if(this['_detachCommentThread'](_0x507feb),this['_threads']['delete'](_0x507feb),!_0x307d63['isSubmitted']||_0x53138a||!this['adapter']||'function'!=typeof this['adapter']['removeCommentThread'])return Promise['resolve']();const _0x2c5f1c=this['context']['plugins']['get']('PendingActions'),{channelId:_0x23ab12}=_0x307d63,_0x8392fb=_0x2c5f1c['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeCommentThread']({'channelId':_0x23ab12,'threadId':_0x507feb})['then'](()=>_0x2c5f1c['remove'](_0x8392fb))['catch'](_0x4358dc=>{throw console['error'](_0x4358dc),new _0x4542a4('commentsrepository-remove-comment-thread-internal-error',this);});}_updateCommentThread({threadId:_0x19742d,unlinkedAt:_0x2f9677,context:_0x1de190,attributes:_0x19cf92,isFromAdapter:_0x4aa564}){if('string'!=typeof _0x19742d)throw new _0x4542a4('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x19742d});if(!this['hasCommentThread'](_0x19742d))throw new _0x4542a4('commentsrepository-missing-comment-thread',null,{'threadId':_0x19742d});const _0x1dbab2=this['getCommentThread'](_0x19742d);let _0x36f71e=!0x1;if(void 0x0!==_0x1de190&&_0x1dbab2['context']!==_0x1de190&&(_0x1dbab2['context']=_0x1de190,_0x36f71e=!0x0),void 0x0!==_0x2f9677&&_0x1dbab2['unlinkedAt']!==_0x2f9677&&(_0x1dbab2['unlinkedAt']=_0x2f9677,_0x36f71e=!0x0),_0x19cf92&&!_0x3b95fa(_0x19cf92,_0x1dbab2['attributes'])&&(_0x1dbab2['attributes']=_0x19cf92,_0x36f71e=!0x0),!_0x36f71e)return Promise['resolve']();if(!_0x1dbab2['isSubmitted']||_0x4aa564||!this['adapter']||'function'!=typeof this['adapter']['updateCommentThread'])return Promise['resolve']();const _0x489a73=this['context']['plugins']['get']('PendingActions'),{channelId:_0x37c5fb}=_0x1dbab2,_0x53a52d=_0x489a73['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateCommentThread']({'channelId':_0x37c5fb,'threadId':_0x19742d,'context':_0x1de190,'unlinkedAt':_0x2f9677,'attributes':_0x19cf92})['then'](()=>_0x489a73['remove'](_0x53a52d))['catch'](_0x129ee1=>{throw console['error'](_0x129ee1),new _0x4542a4('commentsrepository-update-comment-thread-internal-error',this);});}_detachCommentThread(_0x3c4273){const _0x1d3c17=this['context']['plugins']['get'](ti),_0x28a150=this['getCommentThread'](_0x3c4273);if(_0x28a150['_isAttached']=!0x1,this['_threadToController']['has'](_0x28a150)){const _0x119b96=this['_threadToController']['get'](_0x28a150),_0x178c14=_0x119b96['view'],_0x579bbc=_0x1d3c17['getByInnerView'](_0x178c14);this['_threadToController']['delete'](_0x28a150),this['_viewToController']['delete'](_0x178c14),_0x579bbc&&_0x1d3c17['remove'](_0x579bbc),_0x119b96['destroy'](),_0x178c14['destroy']()['then'](()=>{this['_unbindEditors'](_0x178c14);});}}_updateActiveAnnotation({threadId:_0x400cb3,resolvedAt:_0x106d76,unlinkedAt:_0x137cd7}){const _0xe73600=!!_0x106d76,_0x1b2c3f=this['context']['plugins']['get'](ti),_0x57554c=this['getCommentThread'](_0x400cb3);if(this['_threadToController']['has'](_0x57554c)){const _0x5575bf=this['_threadToController']['get'](_0x57554c)['view'],_0x288b29=_0x1b2c3f['getByInnerView'](_0x5575bf);_0x288b29&&(_0xe73600&&_0x1b2c3f['_removeActiveAnnotation'](_0x288b29),_0x137cd7?_0x288b29['isVisible']=!0x1:_0x288b29['refreshVisibility']());}}_getExternalAuthor(_0x14a990){const _0x57c423=this['context']['plugins']['get'](_0x459e31),_0x50963c=_0x463e81('external:'+_0x14a990),_0x2d6f12=_0x57c423['getUser'](_0x50963c);return _0x2d6f12||_0x57c423['addUser']({'id':_0x50963c,'name':_0x14a990});}_createNewComment({threadId:_0x444270,commentId:_0x1d2a91=_0x31754c(),content:_0x215e98,authorId:_0x5f30fc,createdAt:_0x5b6d0e,attributes:_0x545d97}){if('string'!=typeof _0x1d2a91)throw new _0x4542a4('commentsrepository-invalid-commentid');if('string'!=typeof _0x5f30fc)throw new _0x4542a4('commentsrepository-invalid-comment-authorid');if('string'!=typeof _0x215e98||!_0x215e98['trim']())throw new _0x4542a4('commentsrepository-invalid-comment-content');const _0x3300d6=this['context']['plugins']['get'](_0x459e31)['getUser'](_0x5f30fc);if(!_0x3300d6)throw new _0x4542a4('commentsrepository-add-comment-user-not-exists',null,{'authorId':_0x5f30fc});let _0x3dbb9e=null,_0x2f17b2=_0x5b6d0e;return _0x545d97?.['@external']&&(_0x3dbb9e=this['_getExternalAuthor'](_0x545d97['@external']['authorName']),_0x2f17b2=new Date(_0x545d97['@external']['createdAt'])),new hi(this,{'threadId':_0x444270,'id':_0x1d2a91,'author':_0x3dbb9e||_0x3300d6,'creator':_0x3300d6,'content':_0x215e98,'createdAt':_0x5b6d0e,'authoredAt':_0x2f17b2,'attributes':_0x545d97});}_addComment(_0x550b0c){let {threadId:_0x949e9d,content:_0x27ab51,attributes:_0x214ddf,isFromAdapter:_0x1f4b30}=_0x550b0c;const _0x4ea116=this['getCommentThread'](_0x550b0c['threadId']);if(!_0x4ea116)throw new _0x4542a4('commentsrepository-add-comment-to-missing-comment-thread',this);const _0x4910cc=this['_createNewComment'](_0x550b0c),{id:_0x1fd8ac}=_0x4910cc;if(_0x4ea116['_add'](_0x4910cc),_0x1f4b30||!this['adapter']||'function'!=typeof this['adapter']['addComment']||!_0x4ea116['isSubmitted'])return Promise['resolve']();const _0x332967=this['context']['plugins']['get']('PendingActions'),{channelId:_0x444d62}=_0x4ea116,_0x554844=_0x332967['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return _0x214ddf||(_0x214ddf={}),this['adapter']['addComment']({'channelId':_0x444d62,'threadId':_0x949e9d,'commentId':_0x1fd8ac,'content':_0x27ab51,'attributes':_0x214ddf})['then'](_0x4d01f2=>{_0x332967['remove'](_0x554844),_0x4d01f2&&this['_updateComment']({'channelId':_0x444d62,'threadId':_0x949e9d,'commentId':_0x1fd8ac,'createdAt':_0x4d01f2['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x42a884=>{throw console['error'](_0x42a884),new _0x4542a4('commentsrepository-add-comment-internal-error',this);});}_updateComment({threadId:_0x59ee4d,commentId:_0x21b06a,content:_0x2b3c4b,createdAt:_0x439f84,attributes:_0x56df22,isFromAdapter:_0x5e358d}){if(void 0x0!==_0x2b3c4b&&('string'!=typeof _0x2b3c4b||!_0x2b3c4b['trim']()['length']))throw new _0x4542a4('commentsrepository-update-comment-invalid-content');const _0xa6a7bd=this['getCommentThread'](_0x59ee4d),_0x3d8c27=_0xa6a7bd['getComment'](_0x21b06a);if(!_0x3d8c27)throw new _0x4542a4('commentsrepository-update-missing-comment',this);let _0x618c62=!0x1;if(_0x2b3c4b&&_0x2b3c4b!==_0x3d8c27['content']&&(_0x3d8c27['isEditable']||_0x5e358d)&&(_0x3d8c27['content']=_0x2b3c4b,_0x618c62=!0x0),_0x439f84&&_0x439f84!==_0x3d8c27['createdAt']&&(_0x3d8c27['createdAt']=_0x439f84,_0x3d8c27['isExternal']||(_0x3d8c27['authoredAt']=_0x439f84),_0x618c62=!0x0),_0x56df22&&!_0x3b95fa(_0x56df22,_0x3d8c27['attributes'])&&(_0x3d8c27['attributes']=_0x56df22,_0x618c62=!0x0),!_0x618c62)return Promise['resolve']();if(_0xa6a7bd['fire']('commentUpdated'),_0x5e358d||!this['adapter']||'function'!=typeof this['adapter']['updateComment'])return Promise['resolve']();const _0x41db69=this['context']['plugins']['get']('PendingActions'),{channelId:_0x546813}=this['getCommentThread'](_0x3d8c27['threadId']),_0x1efb48=_0x41db69['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateComment']({'channelId':_0x546813,'threadId':_0x59ee4d,'commentId':_0x21b06a,'content':_0x2b3c4b,'attributes':_0x56df22})['then'](()=>_0x41db69['remove'](_0x1efb48))['catch'](_0x46a33b=>{throw console['error'](_0x46a33b),new _0x4542a4('commentsrepository-update-comment-internal-error',this);});}_removeComment({threadId:_0x6c3e22,commentId:_0x3f5099,isFromAdapter:_0x3e28af}){const _0x326fdf=this['getCommentThread'](_0x6c3e22),_0x5a8952=_0x326fdf['getComment'](_0x3f5099);if(!_0x5a8952)throw new _0x4542a4('commentsrepository-remove-missing-comment',this);if(_0x326fdf['_remove'](_0x5a8952),_0x3e28af||!this['adapter']||'function'!=typeof this['adapter']['removeComment'])return Promise['resolve']();const _0xb46ba3=this['context']['plugins']['get']('PendingActions'),{channelId:_0x137e8b}=_0x326fdf,_0xb9782a=_0xb46ba3['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeComment']({'channelId':_0x137e8b,'threadId':_0x6c3e22,'commentId':_0x3f5099})['then'](()=>_0xb46ba3['remove'](_0xb9782a))['catch'](_0x4bffaf=>{throw console['error'](_0x4bffaf),new _0x4542a4('commentsrepository-remove-comment-internal-error',this);});}},ri=class extends si{['channelId'];['id'];_isAttached;_isSubmitted;comments;_repository;constructor(_0x2e7824,_0x3b75df){super();const _0x2670c3=_0x3b75df['isResolvable'];this['channelId']=_0x3b75df['channelId'],this['id']=_0x3b75df['id'],this['comments']=new _0x3a878e(),this['_repository']=_0x2e7824,this['_isAttached']=!0x1,this['_isSubmitted']=_0x3b75df['isSubmitted'],this['set']('_hasTargetInContent',!0x0),this['bind']('isReadOnly')['to'](_0x2e7824,'_permissions',_0x2e7824,'_readOnlyChannels',()=>_0x2e7824['isReadOnly'](this['channelId'])),this['bind']('isRemovable')['to'](_0x2e7824,'_permissions',()=>_0x2e7824['getPermissions'](this['channelId'])['admin']),this['bind']('canComment')['to'](_0x2e7824,'_permissions',()=>{const _0x306e92=_0x2e7824['getPermissions'](this['channelId']);return _0x306e92['write']||_0x306e92['admin'];}),this['bind']('isResolvable')['to'](_0x2e7824,'_permissions',()=>_0x2670c3&&_0x2e7824['getPermissions'](this['channelId'])['resolve']),this['set']('context',_0x3b75df['context']),this['bind']('archivedAt')['to'](this,'resolvedAt',this,'unlinkedAt',(_0x355755,_0x5eb2b8)=>_0x355755?_0x5eb2b8?_0x355755<_0x5eb2b8?_0x355755:_0x5eb2b8:_0x355755:_0x5eb2b8),this['set']('unlinkedAt',_0x3b75df['unlinkedAt']||null),this['set']('resolvedAt',_0x3b75df['resolvedAt']||null),this['set']('resolvedBy',_0x3b75df['resolvedBy']||null),this['bind']('isResolved')['to'](this,'resolvedAt',_0x103e3c=>!!_0x103e3c),this['set']('attributes',_0x3b75df['attributes']||{});}get weight(){return Array['from'](this['comments'])['reduce']((_0x3a7dd0,_0x20e652)=>_0x3a7dd0+_0x20e652['weight'],0x0);}get length(){return this['comments']['length'];}get isAttached(){return this['_isAttached'];}get isSubmitted(){return this['_isSubmitted'];}submit(){const {channelId:_0x2ff6eb,id:_0x16da74}=this;this['_repository']['fire'](ai('submitCommentThread',_0x2ff6eb),{'channelId':_0x2ff6eb,'threadId':_0x16da74});}setUnlinkedAt(_0xd2dacb){this['_update']({'unlinkedAt':_0xd2dacb});}['resolve']({resolvedAt:_0x235b7c=new Date(),resolvedBy:_0x1b8d97='',isFromAdapter:_0x292cb0=!0x1}={}){const _0x3fac0b=this['_repository']['context']['plugins']['get'](_0x459e31)['me'],{channelId:_0x2eb664,id:_0x453d9c}=this;this['_repository']['fire'](ai('resolveCommentThread',_0x2eb664),{'channelId':_0x2eb664,'threadId':_0x453d9c,'resolvedAt':_0x235b7c,'resolvedBy':_0x1b8d97||_0x3fac0b['id'],'isFromAdapter':_0x292cb0});}['reopen']({isFromAdapter:_0x5eb70a=!0x1}={}){const {channelId:_0x1edf79,id:_0x57d105}=this;this['_repository']['fire'](ai('reopenCommentThread',_0x1edf79),{'channelId':_0x1edf79,'threadId':_0x57d105,'isFromAdapter':_0x5eb70a});}setContext(_0x18a924){this['context']||this['_update']({'context':_0x18a924});}setAttribute(_0x451900,_0x27fa15){const _0x14f7d9=_0x271638(this['attributes']);_0x25aad1(_0x14f7d9,_0x451900,_0x27fa15),this['_update']({'attributes':_0x14f7d9});}removeAttribute(_0x1aec79){const _0x3cab6a=_0x271638(this['attributes']);_0x263f15(_0x3cab6a,_0x1aec79),this['_update']({'attributes':_0x3cab6a});}['remove']({isFromAdapter:_0x34c80a=!0x1}={}){const {channelId:_0x285d72,id:_0x402aeb}=this;this['_repository']['fire'](ai('removeCommentThread',_0x285d72),{'channelId':_0x285d72,'threadId':_0x402aeb,'isFromAdapter':_0x34c80a});}attachTo(_0x2a8df5){return this['_repository']['_attachCommentThread']({'threadId':this['id'],'target':_0x2a8df5});}addComment(_0x2d08e0){const {channelId:_0x51d4ac,id:_0x44fbc4}=this;this['_repository']['fire'](ai('addComment',_0x51d4ac,_0x44fbc4),Object['assign']({'channelId':_0x51d4ac,'threadId':_0x44fbc4},_0x2d08e0));}getComment(_0x56c842){if('string'!=typeof _0x56c842)throw new _0x4542a4('commentsrepository-get-comment-invalid-id',null,{'commentId':_0x56c842});return this['comments']['get'](_0x56c842);}toJSON(){return{'threadId':this['id'],'context':this['context'],'unlinkedAt':this['unlinkedAt'],'resolvedAt':this['resolvedAt'],'resolvedBy':this['resolvedBy']?this['resolvedBy']['id']:null,'archivedAt':this['archivedAt'],'comments':this['comments']['map'](_0x2709f3=>_0x2709f3['toJSON']()),'attributes':this['attributes']};}['_add'](_0x15d5ac){return this['listenTo'](_0x15d5ac,'change:authoredAt',()=>{const _0x5bb824=this['_findOptimalIndex'](_0x15d5ac),_0x22fa87=this['comments'];_0x5bb824-0x1!=_0x22fa87['getIndex'](_0x15d5ac)&&_0x5bb824+0x1!=_0x22fa87['getIndex'](_0x15d5ac)&&(this['_remove'](_0x15d5ac),this['_add'](_0x15d5ac));}),this['comments']['add'](_0x15d5ac,this['_findOptimalIndex'](_0x15d5ac));}_update(_0x1e93c1){const {channelId:_0x3e175f,id:_0x284d5c}=this;this['_repository']['fire'](ai('updateCommentThread',_0x3e175f),{..._0x1e93c1,'channelId':_0x3e175f,'threadId':_0x284d5c});}['_remove'](_0x20f67a){return this['stopListening'](_0x20f67a),_0x20f67a['destroy'](),this['comments']['remove'](_0x20f67a);}_findOptimalIndex(_0x70445f){const _0xfc3fb0=this['comments']['find'](_0x35da94=>new Date(_0x35da94['authoredAt'])['getTime']()>new Date(_0x70445f['authoredAt'])['getTime']());return _0xfc3fb0?this['comments']['getIndex'](_0xfc3fb0):this['length'];}},hi=class extends ni{['id'];threadId;author;creator;createdAt;_repository;constructor(_0x54c739,_0x13daca){super();const _0x4ba8a1=_0x54c739['context']['plugins']['get'](_0x459e31)['me'],_0x3a77c6=_0x54c739['getCommentThread'](_0x13daca['threadId']),_0x94d852=0x0===_0x3a77c6['comments']['length'],_0x10f44c=_0x4ba8a1===_0x13daca['author'];this['id']=_0x13daca['id'],this['threadId']=_0x13daca['threadId'],this['author']=_0x13daca['author'],this['creator']=_0x13daca['creator'],this['set']('content',_0x13daca['content']),this['createdAt']=_0x13daca['createdAt']||new Date(),this['set']('authoredAt',_0x13daca['authoredAt']||new Date()),this['bind']('resolvedAt')['to'](_0x3a77c6,'resolvedAt'),this['set']('attributes',_0x13daca['attributes']||{}),this['bind']('isEditable')['to'](_0x54c739,'_permissions',()=>{const _0x3e0eb5=_0x54c739['getPermissions'](_0x3a77c6['channelId'])['write'],_0x545d43=_0x54c739['getPermissions'](_0x3a77c6['channelId'])['modifyAll'];return _0x10f44c&&_0x3e0eb5||!_0x10f44c&&_0x545d43;}),this['bind']('isRemovable')['to'](_0x3a77c6,'isRemovable',_0x54c739,'_permissions',_0x4ce203=>{const _0x2265e7=_0x54c739['getPermissions'](_0x3a77c6['channelId'])['write'],_0x11879c=_0x54c739['getPermissions'](_0x3a77c6['channelId'])['modifyAll'];return _0x10f44c&&_0x2265e7||_0x4ce203&&_0x94d852||!_0x10f44c&&_0x11879c&&!_0x94d852;}),this['bind']('isReadOnly')['to'](_0x3a77c6,'isReadOnly'),this['_repository']=_0x54c739;}get isExternal(){return Boolean(this['attributes']&&this['attributes']['@external']);}get weight(){return Math['max'](function(_0x47bc77){const _0x4be1dd=document['createElement']('div');return _0x4be1dd['innerHTML']=_0x47bc77,_0x4be1dd['textContent']['length'];}(this['content']),0xc8);}update(_0x479fe8){const {threadId:_0x39abdf,id:_0x1aa173}=this;if(!this['_repository']['hasCommentThread'](_0x39abdf))throw new _0x4542a4('commentsrepository-update-comment-missing-comment-thread',this);const {channelId:_0x1b2fc1}=this['_repository']['getCommentThread'](_0x39abdf);this['_repository']['fire'](ai('updateComment',_0x1b2fc1,_0x39abdf),{'channelId':_0x1b2fc1,'threadId':_0x39abdf,'commentId':_0x1aa173,..._0x479fe8});}setAttribute(_0x203811,_0x4b236f){const _0x3bdf71=_0x271638(this['attributes']);_0x25aad1(_0x3bdf71,_0x203811,_0x4b236f),this['update']({'attributes':_0x3bdf71});}removeAttribute(_0x47e73b){const _0x598980=_0x271638(this['attributes']);_0x263f15(_0x598980,_0x47e73b),this['update']({'attributes':_0x598980});}['remove'](_0x8a1da2={}){if(!_0x8a1da2['isFromAdapter']&&!this['isRemovable'])return;const {threadId:_0x492ec1,id:_0x108ccd}=this;if(!this['_repository']['hasCommentThread'](_0x492ec1))throw new _0x4542a4('commentsrepository-remove-comment-missing-comment-thread',this);const {channelId:_0x173679}=this['_repository']['getCommentThread'](_0x492ec1);this['_repository']['fire'](ai('removeComment',_0x173679,_0x492ec1),{'channelId':_0x173679,'threadId':_0x492ec1,'commentId':_0x108ccd,..._0x8a1da2});}toJSON(){return{'commentId':this['id'],'content':this['content'],'createdAt':this['createdAt'],'authorId':this['creator']['id'],'attributes':this['attributes']};}destroy(){this['stopListening']();}};function ai(_0x261cfb,..._0x439a7b){for(const _0x456f8e of _0x439a7b)void 0x0!==_0x456f8e&&(_0x261cfb+=':'+String(_0x456f8e));return _0x261cfb;}var ci=class extends _0x2c1906{constructor(_0x2889c6){super(_0x2889c6),this['set']('hasContent',!0x1);}['refresh'](){const _0x2a34a7=this['editor']['model']['document']['selection'];this['isEnabled']=!0x0,this['hasContent']=!0x1;for(const _0x34b4e3 of _0x2a34a7['getRanges']())if(this['_hasContent'](_0x34b4e3))return void(this['hasContent']=!0x0);}execute({threadId:_0x409a2b=_0x31754c(),ranges:_0x2ace23,comment:_0x399703}={}){const _0x42378c=this['editor']['model'],_0x4fa47c=_0x2ace23??Array['from'](_0x42378c['document']['selection']['getRanges']()),_0x5a2dc5=[];for(const _0x29d0da of _0x4fa47c)this['_hasContent'](_0x29d0da)&&_0x5a2dc5['push'](this['_trimToContent'](_0x29d0da));if(!_0x5a2dc5['length'])throw new _0x4542a4('addcommentthreadcommand-incorrect-ranges',null);_0x399703&&this['_createCommentThread'](_0x409a2b,_0x399703),this['_createMarkersFromRanges'](_0x409a2b,_0x5a2dc5,!!_0x399703);}_createMarkersFromRanges(_0x15ecee,_0x20d5ec,_0x1afc70){this['editor']['model']['change'](_0x28fff6=>{for(const _0x48e22d of _0x20d5ec){const _0x53978e='comment:'+_0x15ecee+':'+_0x31754c()['substr'](0x1,0x5);_0x28fff6['addMarker'](_0x53978e,{'range':_0x48e22d,'usingOperation':_0x1afc70,'affectsData':_0x1afc70});}});}_createCommentThread(_0x16db8f,_0x267851){const _0x18ab8d=this['editor']['plugins']['get']('CommentsRepository'),_0xd2e29b=this['editor']['config']['get']('collaboration.channelId'),_0x2ccb54=this['editor']['plugins']['get']('Users')['me'];if(!_0x2ccb54)throw new _0x4542a4('addcommentthreadcommand-user-not-found',null);_0x18ab8d['addCommentThread']({'threadId':_0x16db8f,'channelId':_0xd2e29b,'comments':[{'authorId':_0x2ccb54['id'],'content':_0x267851,'createdAt':new Date(),'attributes':{}}]});}_hasContent(_0x206567){for(const _0x5620fd of _0x206567['getItems']())if(this['_itemIsContent'](_0x5620fd))return!0x0;return!0x1;}_itemIsContent(_0x541420){return _0x541420['is']('$textProxy')||this['editor']['model']['schema']['isObject'](_0x541420)&&!_0x541420['is']('element','tableCell');}_trimToContent(_0x580a96){const _0x817694=_0x1bb6ee=>!this['_itemIsContent'](_0x1bb6ee['item']),_0x55b7e4=_0x580a96['start']['getLastMatchingPosition'](_0x817694),_0x5304e5=_0x580a96['end']['getLastMatchingPosition'](_0x817694,{'direction':'backward'});return this['editor']['model']['createRange'](_0x55b7e4,_0x5304e5);}},di=class extends _0x573609{_dataCollectors;_editorAnnotations;static get requires(){return[ti];}static get['pluginName'](){return'EditorAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x51a7d0){super(_0x51a7d0),this['_dataCollectors']=new Set(),this['_editorAnnotations']=new Set();}init(){const _0x59525a=this['editor'],_0x59743f=_0x59525a['model']['document']['selection'],_0x5c1bd6=_0x130064(()=>this['refreshSelectedViews'](),0xa);_0x59743f['on']('change:range',(_0x4a9ab4,_0x36cbdf)=>{_0x36cbdf['directChange']&&(_0x5c1bd6['cancel'](),this['refreshSelectedViews']());}),this['listenTo'](_0x59525a['editing']['view']['document'],'change:isFocused',(_0x219514,_0x4db1ad,_0x2a2343)=>{_0x2a2343&&_0x5c1bd6();}),this['listenTo'](_0x59525a['ui']['focusTracker'],'change:isFocused',(_0x19a35,_0x38db8e,_0x1cb44f)=>{_0x1cb44f||this['fire']('blur',{'isAnnotationTracked':_0xf29afe=>this['_editorAnnotationsData']['has'](_0xf29afe['innerView'])});}),this['listenTo'](this['editor']['ui'],'update',()=>this['fire']('uiUpdate'));}registerAnnotation(_0x4d716e){if(this['_editorAnnotations']['has'](_0x4d716e['view']))return;this['_editorAnnotations']['add'](_0x4d716e['view']),this['editor']['ui']['focusTracker']['add'](_0x4d716e['view']['element']);const _0x28115b=this['editor']['plugins']['get'](ti);this['listenTo'](_0x28115b['collection'],'remove',(_0x2dc073,_0x501240)=>{this['editor']['ui']['focusTracker']['remove'](_0x501240['view']['element']),this['_editorAnnotations']['delete'](_0x501240['view']);});}hasDomSelection(){return this['editor']['editing']['view']['hasDomSelection'];}addSourceCollector(_0x3058c6){if('function'!=typeof _0x3058c6)throw new _0x4542a4('editorannotations-invalid-source-callback');this['_dataCollectors']['add'](_0x3058c6);}refreshSelectedViews(){this['fire']('refresh');}getOrderedSelectedAnnotations({activeAnnotation:_0x27f56d,annotations:_0x369a70}){const _0x27513b=[],_0x1653a6=this['editor']['model']['document']['selection'],_0x4d9c02=Array['from'](_0x1653a6['getRanges']());for(const [_0x49ed13,_0xec0cad]of this['_editorAnnotationsData']){const _0x41f858=_0x1a9954(_0xec0cad),_0xb3a489=_0x369a70['getByInnerView'](_0x49ed13);_0x41f858&&_0xb3a489&&_0x27513b['push']({'annotation':_0xb3a489,'range':_0x41f858});}function _0x1a9954(_0x52e38a){for(const _0x4befdf of _0x52e38a)for(const _0x315348 of _0x4d9c02)if(_0x4befdf['containsRange'](_0x315348,!_0x1653a6['isCollapsed']))return _0x4befdf;return null;}return _0x27513b['sort']((_0x1d4ea7,_0x3acd5d)=>{const _0x51747d=_0x1d4ea7['range'],_0x37b31e=_0x3acd5d['range'];if(!_0x51747d['isEqual'](_0x37b31e)){if(_0x51747d['containsRange'](_0x37b31e,!0x0))return 0x1;if(_0x37b31e['containsRange'](_0x51747d,!0x0))return-0x1;}return _0x1d4ea7['annotation']==_0x27f56d?-0x1:_0x3acd5d['annotation']==_0x27f56d?0x1:0x0;})['map'](_0x24a2d1=>_0x24a2d1['annotation']);}get _editorAnnotationsData(){const _0x24aefa=new Map();for(const _0x277f11 of Array['from'](this['_dataCollectors']))for(const [_0x10e4b4,_0x1883e8]of _0x277f11())_0x24aefa['set'](_0x10e4b4,_0x1883e8);return _0x24aefa;}},li=class extends _0x573609{afterInit(){const _0x337e87=this['editor'];_0x337e87['plugins']['has']('RestrictedEditingModeEditing')&&_0x337e87['plugins']['get']('RestrictedEditingModeEditing')['enableCommand']('addCommentThread');}},mi=class extends _0x573609{constructor(_0x3e16ab){super(_0x3e16ab),this['editor']['config']['define']('importWord.formatting.comments','basic');}afterInit(){const _0x484363=this['editor'],_0x2eb51c=_0x484363['commands']['get']('importWord'),_0xa7f72b=_0x484363['plugins']['get'](_0x459e31);_0x2eb51c&&(_0x2eb51c['on']('execute',(_0x403378,[,_0x25dcf6])=>{_0x25dcf6['collaboration_features']={'comments':!0x0,'user_id':_0xa7f72b['me']['id']};},{'priority':_0x4d0af8['high']+0xa}),this['listenTo'](_0x2eb51c,'dataInsert',this['_handleImportedData']));}_handleImportedData(_0x1037c9,_0x20cf0d){const {comment_threads:_0x7e0ab6}=_0x20cf0d;_0x7e0ab6&&_0x7e0ab6['forEach'](({thread_id:_0x13e2e1,comments:_0x9f1861,is_resolved:_0x38d7f2})=>{const _0x1b8974=new Date(),_0x513b01=_0x9f1861['map'](({author:_0x31e5a1,content:_0x364f81,created_at:_0x4ae5b3})=>({'content':_0x364f81,'authorId':this['editor']['plugins']['get'](_0x459e31)['me']['id'],'createdAt':_0x1b8974,'attributes':{'@external':{'authorName':_0x31e5a1,'createdAt':_0x4ae5b3?new Date(_0x4ae5b3):new Date(),'source':'importWord'}}})),_0x1793d5=this['editor']['config']['get']('collaboration.channelId');this['editor']['plugins']['get'](oi)['addCommentThread']({'channelId':_0x1793d5,'threadId':_0x13e2e1,'comments':_0x513b01,'resolvedAt':_0x38d7f2?_0x1b8974:null});});}},ui=class extends _0x573609{constructor(_0x243b8d){super(_0x243b8d),this['editor']['config']['define']('comments.copyMarkers','default');}static get requires(){return[pt,wt];}afterInit(){const _0x364ccf=this['editor']['plugins']['get']('ClipboardPipeline');this['_registerMarkerInClipboardPipeline'](),this['listenTo'](_0x364ccf,'contentInsertion',(_0x1a6c75,_0x3773d0)=>this['_removeMarkersWithoutThreads'](_0x3773d0['content']['markers']),{'priority':'highest'});}_removeMarkersWithoutThreads(_0x5e4971){if(!this['editor']['plugins']['has']('CommentsRepository'))return _0x5e4971;const _0x14527e=this['editor']['plugins']['get']('CommentsRepository');for(const _0x5de0ec of _0x5e4971['keys']()){const [_0x18f910,_0x51759d]=_0x5de0ec['split'](':');'comment'!=_0x18f910||_0x14527e['hasCommentThread'](_0x51759d)||_0x5e4971['delete'](_0x5de0ec);}return _0x5e4971;}_registerMarkerInClipboardPipeline(){const _0x1e67fb=this['editor']['plugins']['get']('ClipboardMarkersUtils'),_0x2fed27=this['_mapCommentsCopyConfigToRegisterConfiguration'](this['editor']['config']['get']('comments.copyMarkers'));_0x2fed27&&_0x1e67fb['_registerMarkerToCopy']('comment',_0x2fed27);}_mapCommentsCopyConfigToRegisterConfiguration(_0x2493b7){switch(_0x2493b7){case'always':return{'allowedActions':'all','copyPartiallySelected':!0x1,'duplicateOnPaste':!0x0};case'default':return{'allowedActions':['cut','dragstart'],'copyPartiallySelected':!0x1,'duplicateOnPaste':!0x1};default:return null;}}};function fi(_0x21ed33){const _0x4d599c=_0x21ed33['split'](':');return{'group':_0x4d599c[0x0],'id':_0x4d599c[0x1],'part':_0x4d599c[0x2]};}var pi=class extends _0x573609{init(){this['overrideMarkerConverters'](),this['overrideHorizontalRuleConverter'](),this['overrideImageInlineConverter'](),this['overrideMediaEmbedConverter']();}overrideMarkerConverters(){this['editor']['conversion']['for']('dataDowncast')['markerToHighlight']({'model':'comment','view':(_0xfa5c8a,_0x19f55f)=>{if(!_0x19f55f['options']['showCommentHighlights'])return null;if(_0x19f55f['options']['ignoreResolvedComments']){const {id:_0x1ff717}=fi(_0xfa5c8a['markerName']);if(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x1ff717)?.['isResolved']&&_0xfa5c8a['item'])return _0x19f55f['consumable']['consume'](_0xfa5c8a['item'],'addMarker:'+_0xfa5c8a['markerName']),_0x19f55f['consumable']['consume'](_0xfa5c8a['item'],'removeMarker:'+_0xfa5c8a['markerName']),null;}return{'classes':['ck-comment-marker']};}}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x2de0e2=>{_0x2de0e2['on']('addMarker:comment',(_0x19af7b,_0x4e6ffc,_0x3b99a8)=>{if(!_0x3b99a8['options']['showCommentHighlights'])return;const _0x523467=_0x4e6ffc['item'];if(!_0x523467)return;const _0x4f6a62=_0x3b99a8['mapper']['toViewElement'](_0x523467);this['editor']['model']['schema']['isObject'](_0x523467)&&_0x4f6a62&&!_0x4f6a62['getCustomProperty']('widget')&&_0x4f6a62['is']('containerElement')&&Ct(_0x4f6a62,_0x3b99a8['writer']);},{'priority':'high'});});}overrideHorizontalRuleConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'horizontalLine','view':(_0x5ae187,{writer:_0x26c923,options:_0x434760})=>{if(!_0x434760['showCommentHighlights'])return null;const _0x1f7fc3=_0x26c923['createContainerElement']('div'),_0x43ad5b=_0x26c923['createEmptyElement']('hr');return _0x26c923['addClass']('ck-horizontal-line',_0x1f7fc3),_0x26c923['insert'](_0x26c923['createPositionAt'](_0x1f7fc3,0x0),_0x43ad5b),_0x1f7fc3;},'converterPriority':'high'});}overrideImageInlineConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'imageInline','view':(_0x22994d,{writer:_0x2fe4be,options:_0x410552})=>{if(!_0x410552['showCommentHighlights'])return null;const _0x45cc93=_0x2fe4be['createContainerElement']('span'),_0x5002a0=_0x2fe4be['createEmptyElement']('img');return _0x2fe4be['addClass']('image-inline',_0x45cc93),_0x2fe4be['insert'](_0x2fe4be['createPositionAt'](_0x45cc93,0x0),_0x5002a0),_0x45cc93;},'converterPriority':'high'});}overrideMediaEmbedConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToElement']({'model':'media','view':(_0x53b98a,{writer:_0x507f50,options:_0x269173})=>{if(_0x269173['showCommentHighlights'])return _0x507f50['createEmptyElement']('div');},'converterPriority':'high'}),this['editor']['data']['downcastDispatcher']['on']('attribute:url:media',(_0x40313b,_0x54358a,_0x17d6f9)=>{_0x17d6f9['options']['showCommentHighlights']&&_0x40313b['stop']();},{'priority':'high'});}},wi=class extends _0x573609{static get requires(){return[oi,di,_0x459e31,li,mi,ui,pi];}static get['pluginName'](){return'CommentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x29900c){super(_0x29900c),this['set']('isThreadsLoadingPaused',!0x0),_0x29900c['data']['once']('ready',()=>this['isThreadsLoadingPaused']=!0x1),this['set']('activeMarker',null),this['on']('change:activeMarker',(_0x36d971,_0x10423c,_0x26f58b,_0x67cb2f)=>{const _0xd35346=_0x29900c['plugins']['get'](oi),_0x5c824b=_0x26f58b?fi(_0x26f58b)['id']:null;_0x29900c['model']['change'](()=>{if(_0x5c824b){const _0x428e10=this['getAllMarkersForId'](_0x5c824b);for(const _0x22f63c of _0x428e10)_0x29900c['editing']['reconvertMarker'](_0x22f63c);}if(_0x67cb2f){const {id:_0x1fa972}=fi(_0x67cb2f),_0xc9bdb3=_0xd35346['getCommentThread'](_0x1fa972);if(_0xc9bdb3&&_0xc9bdb3['unlinkedAt'])return;if(_0xc9bdb3&&!_0xc9bdb3['isAttached'])return;const _0x302050=this['getAllMarkersForId'](_0x1fa972);for(const _0x39f213 of _0x302050)_0x29900c['editing']['reconvertMarker'](_0x39f213);}}),_0x5c824b&&this['scrollToThreadMarker'](_0x5c824b);}),this['_initAriaMarkerChangeAnnouncements']();}init(){const _0x32c1c6=this['editor'],_0x4e46cf=_0x32c1c6['plugins']['get'](oi),_0x15ad26=_0x32c1c6['config']['get']('collaboration.channelId'),_0x3156a1=_0x4e46cf['getCommentThreads']()['filter'](_0x3cc0cf=>_0x3cc0cf['channelId']!==_0x15ad26);_0x32c1c6['commands']['add']('addCommentThread',new ci(_0x32c1c6)),this['listenTo'](_0x32c1c6,'change:isReadOnly',(_0xe95329,_0x329910,_0x2db610)=>{_0x4e46cf['switchReadOnly'](_0x2db610,_0x32c1c6['config']['get']('collaboration.channelId'));}),this['listenTo'](_0x4e46cf,gi('addCommentThread',_0x15ad26),(_0x3a36fd,{threadId:_0x39b0e1})=>{this['editor']['plugins']['get'](oi)['getCommentThread'](_0x39b0e1)?.['unlinkedAt']&&this['_attachArchivedThread'](_0x39b0e1);}),this['listenTo'](_0x4e46cf,gi('removeCommentThread',_0x15ad26),(_0x4d0892,{threadId:_0x55ac92})=>{_0x32c1c6['model']['enqueueChange']({'isUndoable':!0x1},_0x236bdc=>{const _0x49e2de=this['getAllMarkersForId'](_0x55ac92);for(const _0x2b6e56 of _0x49e2de)_0x236bdc['removeMarker'](_0x2b6e56);});}),this['listenTo'](_0x4e46cf,gi('resolveCommentThread',_0x15ad26),(_0x554213,{threadId:_0x1095b4})=>{this['_reconvertMarkers'](_0x1095b4);const _0x3f43e2=this['editor']['plugins']['get'](ti);(this['editor']['editing']['view']['hasDomSelection']||_0x3f43e2['collection']['isFocused'])&&(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x1095b4)['unlinkedAt']||this['editor']['editing']['view']['focus']());},{'priority':'low'}),this['listenTo'](_0x4e46cf,gi('reopenCommentThread',_0x15ad26),(_0x694bb1,{threadId:_0x5bb6dd})=>{this['_reconvertMarkers'](_0x5bb6dd);},{'priority':'low'}),this['listenTo'](_0x4e46cf,gi('addComment',_0x15ad26),(_0x4e9bed,{threadId:_0x22aa64,isFromAdapter:_0x6ef869})=>{const _0xe125fa=this['getAllMarkersForId'](_0x22aa64);!_0x6ef869&&0x0!=_0xe125fa['length']&&_0x4e46cf['hasCommentThread'](_0x22aa64)&&0x1===_0x4e46cf['getCommentThread'](_0x22aa64)['length']&&_0x32c1c6['model']['enqueueChange']({'isUndoable':!0x1},_0x3edf22=>{for(const _0x18c6ae of _0xe125fa)_0x3edf22['updateMarker'](_0x18c6ae,{'usingOperation':!0x0,'affectsData':!0x0});});},{'priority':'low'}),this['_initializeMarkerConverters'](),this['_handleMarkerAddAndRemove'](),this['_handleInitialThreads'](_0x3156a1);}afterInit(){!async function(_0x17b537){const _0x4ef5fd='KpOBJGNSEgqCyfVF1kZ8lbnRjM7eIzAsDQHw9aThu6rcYi05UmPL4d3X2Wotvx',_0x49142f=0x79170,_0x37bf2d=window['Date']['now'](),_0xd24a11=_0x17b537['editor'],_0x3d97c2=new window['Promise'](_0x5e30e0=>{_0xd24a11['once']('ready',_0x5e30e0);}),_0x5b8eb9={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x5b4a46=_0xd24a11['config']['get']('licenseKey');async function _0x376e82(){let _0x1d8bd7,_0x1de350=null,_0x24c7e0=null;try{return'GPL'==_0x5b4a46?'NotAllowed':(_0x1d8bd7=_0x2680ff(),_0x1d8bd7?(_0x1d8bd7['usageEndpoint']&&(_0x24c7e0=_0x3335d6(_0x1d8bd7['usageEndpoint'],_0x1d8bd7['jti'])),await _0x79ff71()?_0x48ca0f()?_0x28a476()?'Expired':_0x52dc98()?('evaluation'==_0x1d8bd7['licenseType']&&(_0x1de350=_0x275a54('EvaluationLimit')),await _0x15c68f()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x28a476(){const _0x361b02=['evaluation','trial']['includes'](_0x1d8bd7['licenseType'])?_0x37bf2d/0x3e8:0xe10*_0x49142f;return _0x1d8bd7['exp']<_0x361b02;}function _0x48ca0f(){const _0x214acc=_0x1d8bd7['features'];if(!_0x214acc)return!0x1;if(_0x214acc['includes']('*'))return!0x0;if(_0x214acc['includes']('CMT'))return!0x0;if(_0x214acc['includes']('TRILIUM')&&_0x54ca63())return!0x0;if(_0x214acc['includes']('RCMT')){if(_0x4a9c16())return!0x0;if(_0x4dee5b()||_0x3ee200())return!0x0;}return!0x1;}function _0x52dc98(){const _0x57c12c=_0x1d8bd7['licensedHosts'];if(!_0x57c12c||0x0==_0x57c12c['length'])return!0x0;const {hostname:_0x13c4d3}=new URL(window['location']['href']);if(_0x57c12c['includes'](_0x13c4d3))return!0x0;const _0x1862ce=_0x13c4d3['split']('.');return _0x57c12c['filter'](_0x3d873e=>_0x3d873e['includes']('*'))['map'](_0xc1310c=>_0xc1310c['split']('.'))['filter'](_0xf066f8=>_0xf066f8['length']<=_0x1862ce['length'])['map'](_0x165da3=>Array(_0x1862ce['length']-_0x165da3['length'])['fill']('*'===_0x165da3[0x0]?'*':'')['concat'](_0x165da3))['some'](_0x48764d=>_0x1862ce['every']((_0x24d503,_0x1e7e3e)=>_0x48764d[_0x1e7e3e]===_0x24d503||'*'===_0x48764d[_0x1e7e3e]));}function _0x15c68f(){return _0x1de350&&_0x24c7e0?new window['Promise']((_0x2a01fd,_0x1b0f58)=>{_0x1de350['then'](_0x2a01fd,_0x1b0f58),_0x24c7e0['then'](_0x49daaf=>{'Valid'!=_0x49daaf&&_0x2a01fd(_0x49daaf);},_0x1b0f58);}):_0x1de350||_0x24c7e0||'Valid';}}function _0x3335d6(_0x2d34fd,_0x56434f){return new window['Promise'](_0x2a975d=>{if(_0xcad208())return _0x2a975d('Valid');_0x51eba0(),_0xd24a11['decorate']('_sendUsageRequest');let _0x3e802c=!0x1;const _0x268847=_0x31754c();function _0x2a3530(_0x2511c2){return!!_0x2511c2&&('object'==typeof _0x2511c2||'function'==typeof _0x2511c2)&&'function'==typeof _0x2511c2['then']&&'function'==typeof _0x2511c2['catch'];}function _0x13b2ad(_0x1aaf75){_0x22404e(_0x1aaf75)['then'](_0x5c2873=>_0x5c2873&&'ok'==_0x5c2873['status']?_0x1db13e(_0x43a50f(_0x268847+_0x56434f))!=_0x5c2873['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x5b96b7=>(_0xad5bac(),_0x5b96b7),()=>{const _0x4edc26=_0x30cb84();return null==_0x4edc26?(_0xad5bac(),'Valid'):_0x37bf2d-_0x4edc26>0x240c8400?'UsageLimit':'Valid';})['then'](_0x2a975d)['catch'](()=>{_0x2a975d('UsageLimit');});const _0x353233=0x36ee80;function _0xad5bac(){const _0x7e3770='llct-'+_0x1db13e(_0x43a50f(_0x2d34fd)),_0x447866=_0x452be4(_0x1db13e(window['Math']['ceil'](_0x37bf2d/_0x353233)));window['localStorage']['setItem'](_0x7e3770,_0x447866);}function _0x30cb84(){const _0x524761='llct-'+_0x1db13e(_0x43a50f(_0x2d34fd)),_0x3741a6=window['localStorage']['getItem'](_0x524761);return _0x3741a6?window['parseInt'](_0x452be4(_0x3741a6),0x10)*_0x353233:null;}function _0x22404e(_0x4a0fb7){return new window['Promise']((_0xc9067a,_0x492d16)=>{_0x4a0fb7['then'](_0xc9067a,_0x492d16),window['setTimeout'](_0x492d16,0x1d4c0);});}}_0xd24a11['on']('_sendUsageRequest',(_0x1ff453,_0x4f4491)=>{if(_0x4f4491[0x0]!=_0x2d34fd)return _0x2a975d('UsageLimit');_0x4f4491[0x1]={..._0x4f4491[0x1],'requestId':_0x268847};},{'priority':'high'}),_0xd24a11['on']('_sendUsageRequest',_0xd278e=>{_0x2a3530(_0xd278e['return'])&&(_0x3e802c=!0x0,_0x13b2ad(_0xd278e['return']));},{'priority':'low'}),_0x3d97c2['then'](()=>{_0x3e802c||_0x2a975d('UsageLimit');});});function _0xcad208(){return'auto'==_0xd24a11['editing']['view']['_overlayModeHint'];}function _0x51eba0(){_0xd24a11['editing']['view']['_overlayModeHint']='auto';}}function _0x275a54(_0x8bc2e5){const _0x1a1fcf=[new window['Promise'](_0x577992=>setTimeout(_0x577992,0x93ecc)),_0x3d97c2['then'](()=>new window['Promise'](_0x1c4ef1=>{let _0x1d0912=0x0;_0xd24a11['model']['on']('applyOperation',(_0x5231d0,_0xf7de7)=>{_0xf7de7[0x0]['isDocumentOperation']&&_0x1d0912++,0x5e8==_0x1d0912&&(_0x1c4ef1(),_0x5231d0['off']());});}))];return window['Promise']['race'](_0x1a1fcf)['then'](()=>_0x8bc2e5);}async function _0x4ab1ef(){await _0x3d97c2,_0xd24a11['model']['change']=_0x4ffb5f,_0xd24a11['model']['enqueueChange']=_0x4ffb5f,_0xd24a11['enableReadOnlyMode']('model');}function _0x54ca63(){return window['glob']&&window['glob']['triliumVersion'];}function _0x4a9c16(){return _0x21207f('WebSocketGateway')&&'connected'==_0x169e6f('WebSocketGateway')['state'];}function _0x4dee5b(){return _0x21207f('RevisionViewerIntegration');}function _0x3ee200(){return _0x21207f('TrackChangesDataGetter');}function _0x5b8a35(_0x35e5a0){const _0x4dca0c=_0x3d40d7();_0xd24a11[_0x4dca0c]='commentsLicenseKey'+_0x35e5a0,'Valid'!=_0x35e5a0&&_0x4ab1ef();}function _0x3d40d7(){const _0x4c0fdf=window['String'](window['performance']['now']())['replace']('.','');let _0x4525c1='K';for(let _0x300138=0x0;_0x300138<_0x4c0fdf['length'];_0x300138+=0x2){let _0x2318d2=window['parseInt'](_0x4c0fdf['substring'](_0x300138,_0x300138+0x2));_0x2318d2>=0x3e&&(_0x2318d2-=0x3e),_0x4525c1+=_0x4ef5fd[_0x2318d2];}return _0x4525c1;}function _0x2680ff(){const _0x1cd4fe=_0x5b4a46['split']('.');if(0x3!=_0x1cd4fe['length'])return null;return _0x4de1dc(_0x1cd4fe[0x1]);function _0x4de1dc(_0x5cd260){const _0x396b27=_0xadc68b(_0x5cd260);return _0x396b27&&_0x419160()?_0x396b27:null;function _0x419160(){const _0x36e01e=_0x396b27['jti'],_0x2592b3=window['parseInt'](_0x36e01e['substring'](_0x36e01e['length']-0x8),0x10),_0x223b16={..._0x396b27,'jti':_0x36e01e['substring'](0x0,_0x36e01e['length']-0x8)};return delete _0x223b16['vc'],_0x43a50f(_0x223b16)==_0x2592b3;}}}async function _0x79ff71(){let _0x3effc4=!0x0;try{const [_0x57e916,_0x5c6011,_0x2c7e23]=_0x5b4a46['split']('.');return _0x55b85f(_0x57e916),await _0x487e98(_0x57e916,_0x5c6011,_0x2c7e23),_0x3effc4;}catch{return!0x1;}function _0x55b85f(_0x2b8056){const _0xd64546=_0xadc68b(_0x2b8056);_0xd64546&&'ES256'==_0xd64546['alg']||(_0x3effc4=!0x1);}async function _0x487e98(_0xd8ad8f,_0x570c12,_0x566b52){const _0x3c7007=window['Uint8Array']['from'](_0x389836(_0x566b52),_0x333b64=>_0x333b64['charCodeAt'](0x0)),_0x2083c6=new window['TextEncoder']()['encode'](_0xd8ad8f+'.'+_0x570c12),_0x19603a=window['crypto']['subtle'];if(!_0x19603a)return;const _0x799f54=await _0x19603a['importKey']('jwk',_0x5b8eb9,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x19603a['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x799f54,_0x3c7007,_0x2083c6)||(_0x3effc4=!0x1);}}function _0xadc68b(_0x5a5762){return _0x5a5762['startsWith']('ey')?JSON['parse'](_0x389836(_0x5a5762)):null;}function _0x389836(_0x51a2ed){return window['atob'](_0x51a2ed['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x43a50f(_0x3bb4e7){let _0x476abb=0x1505;function _0x1892c5(_0x585774){for(let _0x46ae48=0x0;_0x46ae48<_0x585774['length'];_0x46ae48++){const _0xeb53f9=_0x585774['charCodeAt'](_0x46ae48);_0x476abb=(_0x476abb<<0x5)+_0x476abb+_0xeb53f9,_0x476abb&=_0x476abb;}}function _0x1dc137(_0x56d585){Array['isArray'](_0x56d585)?_0x56d585['forEach'](_0x1dc137):_0x56d585&&'object'==typeof _0x56d585?Object['entries'](_0x56d585)['sort']()['forEach'](([_0x1176c0,_0x3c9ef9])=>{_0x1892c5(_0x1176c0),_0x1dc137(_0x3c9ef9);}):_0x1892c5(window['String'](_0x56d585));}return _0x1dc137(_0x3bb4e7),_0x476abb>>>0x0;}function _0x1db13e(_0x15b5ab){return _0x15b5ab['toString'](0x10)['padStart'](0x8,'0');}function _0x452be4(_0x411f00){return _0x411f00['split']('')['reverse']()['join']('');}function _0x21207f(_0x4bc2ce){return _0xd24a11['plugins']['has'](_0x4bc2ce);}function _0x169e6f(_0x285eef){return _0xd24a11['plugins']['get'](_0x285eef);}function _0x4ffb5f(){}_0x5b8a35(await _0x376e82());}(this);}destroy(){const _0x13c639=this['editor']['plugins']['get'](oi),_0x2fe933=this['editor']['config']['get']('collaboration.channelId');for(const _0x39184f of _0x13c639['getCommentThreads']({'channelId':_0x2fe933}))_0x13c639['_detachCommentThread'](_0x39184f['id']),_0x13c639['_threads']['delete'](_0x39184f['id']);super['destroy']();}['hasMarkerForId'](_0x36282b){return this['getAllMarkersForId'](_0x36282b)['length']>0x0;}getAllMarkersForId(_0x319302){const _0x28f167=[];for(const _0x562984 of this['editor']['model']['markers'])_0x562984['name']['startsWith']('comment:'+_0x319302)&&_0x28f167['push'](_0x562984);return _0x28f167;}['scrollToThreadMarker'](_0x511407){setTimeout(()=>{const _0x1bcbdf=this['_getTargetForId'](_0x511407);_0x1bcbdf&&this['activeMarker']&&fi(this['activeMarker'])['id']===_0x511407&&_0x3cbb74({'target':_0x1bcbdf[0x0],'viewportOffset':0x64,'alignToTop':!0x0});},0x32);}_reconvertMarkers(_0x3437c7){this['editor']['model']['change'](()=>{for(const _0x1443cf of this['getAllMarkersForId'](_0x3437c7))this['editor']['editing']['reconvertMarker'](_0x1443cf);});}_attachArchivedThread(_0x32e313){const _0x5ab276=this['editor']['plugins']['get'](oi),_0x4c8d9c=this['editor']['plugins']['get'](di),_0x322d44=_0x5ab276['getCommentThread'](_0x32e313);if(!_0x322d44['isAttached']){const _0x2767ff=_0x322d44['attachTo'](()=>this['_getTargetForId'](_0x322d44['id']));_0x4c8d9c['registerAnnotation'](_0x2767ff),_0x322d44['_hasTargetInContent']=!0x1;}}_initializeMarkerConverters(){const _0x4d5cc6=this['editor'],_0x3bedfb=_0x4d5cc6['plugins']['get'](_0x459e31);_0x4d5cc6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'comment','view':(_0x5d88e0,_0x410eb7)=>{const {id:_0x23345f}=fi(_0x5d88e0['markerName']),_0x3693d2=_0x4d5cc6['plugins']['get'](oi)['getCommentThread'](_0x23345f),_0x43aacf=this['activeMarker']&&fi(this['activeMarker'])['id']===_0x23345f;let _0x10e19c;if(_0x3693d2&&_0x3693d2['isResolved']&&!_0x43aacf&&_0x5d88e0['item'])return _0x410eb7['consumable']['consume'](_0x5d88e0['item'],'addMarker:'+_0x5d88e0['markerName']),_0x410eb7['consumable']['consume'](_0x5d88e0['item'],'removeMarker:'+_0x5d88e0['markerName']),null;const _0x424995=['ck-comment-marker'];return _0x43aacf&&_0x424995['push']('ck-comment-marker--active'),_0x10e19c=_0x3693d2?.['length']?_0x3693d2['comments']['first']['author']['id']:_0x3bedfb['me']['id'],{'classes':_0x424995,'attributes':{'data-comment':_0x23345f,'data-author-id':_0x10e19c}};}}),_0x4d5cc6['conversion']['for']('dataDowncast')['markerToData']({'model':'comment','view':(_0x16ba70,{options:_0x48de88})=>{if(_0x48de88['showCommentHighlights'])return null;const _0x322334=_0x4d5cc6['plugins']['get'](oi),_0x115585=_0x4d5cc6['model']['markers']['get'](_0x16ba70),{id:_0x54aab2,part:_0x364527}=fi(_0x16ba70);return _0x115585&&!_0x115585['affectsData']||_0x48de88['ignoreResolvedComments']&&_0x322334['getCommentThread'](_0x54aab2)?.['isResolved']?null:{'group':'comment','name':_0x364527?_0x54aab2+':'+_0x364527:_0x54aab2};}}),_0x4d5cc6['conversion']['for']('upcast')['elementToElement']({'view':{'name':'comment','attributes':{'id':/^\w/}},'model':(_0x2aacea,{writer:_0x281da4})=>_0x281da4['createElement']('$marker',{'data-name':'comment:'+_0x2aacea['getAttribute']('id')})}),_0x4d5cc6['conversion']['for']('upcast')['dataToMarker']({'view':'comment'});}['_handleMarkerAddAndRemove'](){const _0xb6b49a=this['editor'],_0x506697=_0xb6b49a['plugins']['get'](oi),_0x3a4550=new Set(),_0x1fabbf=new Set();_0xb6b49a['model']['document']['registerPostFixer'](_0x52ce42=>{let _0x47baf7=!0x1;for(const {name:_0x1bfaeb,data:_0x218bb0}of _0xb6b49a['model']['document']['differ']['getChangedMarkers']()){const {group:_0x157d10,id:_0x31b53a}=fi(_0x1bfaeb);let _0x37606f=_0x218bb0['newRange'];if('comment'!==_0x157d10||!_0x37606f)continue;const _0x2afcf5='$graveyard'===_0x37606f['root']['rootName'];_0x2afcf5||(_0x37606f=_i(_0x37606f,_0xb6b49a['model']),!_0x37606f||_0x37606f['isCollapsed']||!_0x218bb0['newRange']||_0x37606f['isEqual'](_0x218bb0['newRange']))?_0xb6b49a['model']['hasContent'](_0x37606f)&&!_0x2afcf5?this['isThreadsLoadingPaused']?_0x3a4550['add'](_0x1bfaeb):this['_handleThreadMarker'](_0x1bfaeb,_0x31b53a):(_0x1fabbf['add'](_0x1bfaeb),_0x3a4550['delete'](_0x1bfaeb),_0x52ce42['removeMarker'](_0x1bfaeb),_0x47baf7=!0x0):(_0x52ce42['updateMarker'](_0x1bfaeb,{'range':_0x37606f}),_0x47baf7=!0x0);}return _0x47baf7;}),this['on']('change:isThreadsLoadingPaused',(_0x222f5a,_0x4cd5b0,_0x21f9f8)=>{if(!_0x21f9f8&&_0x3a4550['size'])for(const _0x141d3a of _0x3a4550){const {id:_0x2795e4}=fi(_0x141d3a);_0x3a4550['delete'](_0x141d3a),_0xb6b49a['model']['markers']['get'](_0x141d3a)&&this['_handleThreadMarker'](_0x141d3a,_0x2795e4);}}),this['listenTo'](_0xb6b49a['model']['document'],'change',()=>{for(const {name:_0x5591a8,data:{newRange:_0x583442}}of _0xb6b49a['model']['document']['differ']['getChangedMarkers']()){const {group:_0x19ced7,id:_0x4733f2}=fi(_0x5591a8);if('comment'!==_0x19ced7)continue;const _0x43d29b=_0x506697['getCommentThread'](_0x4733f2),_0x1e9f59=this['hasMarkerForId'](_0x4733f2);_0x43d29b&&(!_0x43d29b['_hasTargetInContent']&&_0x583442&&_0xb6b49a['editing']['view']['once']('render',()=>{const _0x46d3da=_0xb6b49a['plugins']['get'](ti),_0x2dde72=_0x506697['_threadToController']['get'](_0x43d29b)['view'];_0x46d3da['getByInnerView'](_0x2dde72)['refreshVisibility']();},{'priority':'low'}),_0x43d29b['_hasTargetInContent']=_0x1e9f59||!!_0x583442),_0x583442||(_0x1fabbf['add'](_0x5591a8),_0x3a4550['delete'](_0x5591a8));}for(const _0x2ce60b of _0x1fabbf){const {id:_0x2f5817}=fi(_0x2ce60b),_0x5c5af0=_0x506697['getCommentThread'](_0x2f5817);if(_0x3a4550['delete'](_0x2ce60b),!_0x5c5af0)continue;const _0x351fab=this['hasMarkerForId'](_0x2f5817);_0x351fab||_0x5c5af0['isSubmitted']?_0x351fab||_0x5c5af0['unlinkedAt']||_0x5c5af0['setUnlinkedAt'](new Date()):_0x5c5af0['remove']();}_0x1fabbf['clear']();});}_handleInitialThreads(_0x299a6f){_0x299a6f['forEach'](_0x10097f=>{_0x10097f['unlinkedAt']&&this['_attachArchivedThread'](_0x10097f['id']);});}_getTargetForId(_0x524ec2){const _0x154ae0=this['editor'],_0x50a93c=this['getAllMarkersForId'](_0x524ec2);return _0xb56ba2(_0x154ae0['editing'],_0x50a93c);}_getTextContext(_0x4b69a1){const _0xafe5f7=this['getAllMarkersForId'](_0x4b69a1);let _0x289908='',_0x2af2fe=!0x1;for(const _0x3b4637 of _0xafe5f7){const _0x56410a=_0x3b4637['getRange']();for(const _0x462c38 of Array['from'](_0x56410a['getItems']()))_0x462c38['is']('$textProxy')?(_0x289908&&_0x2af2fe&&(_0x289908+='\x20',_0x2af2fe=!0x1),_0x289908+=_0x462c38['data']):_0x2af2fe=!0x0;_0x2af2fe=!0x0;}return _0x289908['substring'](0x0,0x96);}_attachMarkerToThread(_0x3dcb45,_0x52ff9d){const _0x2485d6=this['editor'],_0x338d14=_0x2485d6['plugins']['get'](oi);let _0xb9eb83=_0x338d14['getCommentThread'](_0x52ff9d);const _0x4028e5=_0x2485d6['config']['get']('collaboration.channelId'),_0x7561f9=_0x2485d6['plugins']['get'](di);return _0xb9eb83&&(_0xb9eb83['unlinkedAt']&&_0xb9eb83['setUnlinkedAt'](null),_0xb9eb83['isAttached'])||(this['getAllMarkersForId'](_0x52ff9d)[0x0]['managedUsingOperations']?_0x338d14['fetchCommentThread']({'channelId':_0x4028e5,'threadId':_0x52ff9d})['then'](_0x16f9d1=>{if('destroyed'!==_0x2485d6['state']){if(_0xb9eb83=_0x16f9d1,_0xb9eb83&&!_0xb9eb83['isAttached']){const _0x17e253=_0xb9eb83['attachTo'](()=>this['_getTargetForId'](_0x52ff9d));_0x7561f9['registerAnnotation'](_0x17e253),_0xb9eb83['isResolved']&&this['_reconvertMarkers'](_0x52ff9d);}else{if(!_0xb9eb83){const _0x141490=this['getAllMarkersForId'](_0x52ff9d);_0x2485d6['model']['change'](_0x2e8ba0=>{for(const _0xba5b33 of _0x141490)_0x2e8ba0['removeMarker'](_0xba5b33);});}}}}):_0x2485d6['editing']['view']['once']('render',()=>{if(_0x338d14['getCommentThread'](_0x52ff9d))return;const _0x59501b=_0x2485d6['plugins']['get'](ti);_0xb9eb83=_0x338d14['openNewCommentThread']({'channelId':_0x4028e5,'threadId':_0x52ff9d,'target':()=>this['_getTargetForId'](_0x52ff9d),'context':{'type':'text','value':this['_getTextContext'](_0x52ff9d)}});const _0x5414c9=_0x338d14['_threadToController']['get'](_0xb9eb83)['view'],_0x58b84c=_0x59501b['getByInnerView'](_0x5414c9);_0x58b84c&&_0x7561f9['registerAnnotation'](_0x58b84c);},{'priority':'low'})),_0xb9eb83;}['_handleThreadMarker'](_0xaff112,_0x240d7f){const _0x36e635=this['_attachMarkerToThread'](_0xaff112,_0x240d7f);_0x36e635&&!_0x36e635['context']&&_0x36e635['setContext']({'type':'text','value':this['_getTextContext'](_0x240d7f)});}_initAriaMarkerChangeAnnouncements(){const _0x14322c=this['editor'];_0x487256(_0x14322c['model'],({left:_0x4efaf6,entered:_0x3d4f45})=>{for(const _0x3ea71d of _0x4efaf6)if(Ai(_0x3ea71d)){_0x14322c['ui']['ariaLiveAnnouncer']['announce'](Et(_0x14322c['locale'],'LEAVE_COMMENT_ANNOUNCEMENT'));break;}for(const _0x4dbe42 of _0x3d4f45)if(Ai(_0x4dbe42)){_0x14322c['ui']['ariaLiveAnnouncer']['announce'](Et(_0x14322c['locale'],'ENTER_COMMENT_ANNOUNCEMENT',_0x26c345(_0x5bd6c1)));break;}});}};function gi(_0x5a63b2,_0x44d6df){return _0x44d6df?_0x5a63b2+':'+_0x44d6df:_0x5a63b2;}function _i(_0x5a4ce7,_0xae659c){const _0x5c6881=_0xae659c['schema'],_0xb955b5=_0xae659c['createRange'](_0x5a4ce7['start']);for(const _0x497272 of _0x5a4ce7['getWalker']()){const {type:_0x3b86d3,item:_0x796a05,nextPosition:_0x29c841}=_0x497272;if('text'===_0x3b86d3||_0x5c6881['isObject'](_0x796a05)){const _0x1cd6f2=_0xae659c['createPositionBefore'](_0x796a05);_0xb955b5['isCollapsed']&&(_0xb955b5['start']=_0x1cd6f2),_0xb955b5['end']=_0x29c841;}}return _0xb955b5;}function Ai(_0x5aaaea){return'comment'===fi(_0x5aaaea['name'])['group'];}var vi=class extends _0x573609{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'CommentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,wi,di,ti];}get CommentsListView(){return Lt;}get CommentThreadInputView(){return xt;}init(){const _0x3e300c=this['editor'],_0x27076f=_0x3e300c['plugins']['get'](oi),_0x377012=_0x3e300c['plugins']['get'](wi),_0x18d057=_0x3e300c['plugins']['get'](ti),_0x19be59=_0x3e300c['plugins']['get'](di);_0x3e300c['ui']['componentFactory']['add']('comment',()=>{const _0x7f1ea9=this['_createUIButton'](_0x4695a0);return _0x7f1ea9['tooltip']=!0x0,_0x7f1ea9;}),_0x3e300c['ui']['componentFactory']['add']('menuBar:comment',()=>this['_createUIButton'](rt)),_0x19be59['addSourceCollector'](()=>{const _0x298710=[];for(const [_0x56ab48,_0x57330c]of _0x27076f['_threadToController']){const _0x545aa0=_0x377012['getAllMarkersForId'](_0x56ab48['id']),_0x273190=_0x545aa0['map'](_0x27068b=>_0x27068b['getRange']());_0x545aa0['length']>0x0&&_0x298710['push']([_0x57330c['view'],_0x273190]);}return _0x298710;}),this['listenTo'](_0x18d057,'change:activeAnnotations',(_0x2c6853,_0x48b746,_0x51f3a2)=>{const _0x1b4a6a=Array['from'](_0x51f3a2)['map'](_0x1e43ae=>_0x1e43ae['innerView'])['find'](_0x3bba3d=>_0x27076f['_viewToController']['has'](_0x3bba3d));if(!_0x1b4a6a)return void(_0x377012['activeMarker']=null);const _0x396eba=_0x27076f['_viewToController']['get'](_0x1b4a6a)['model']['id'],_0x7a224e='comment:'+_0x396eba;_0x396eba&&_0x377012['hasMarkerForId'](_0x396eba)?_0x377012['activeMarker']=_0x7a224e:_0x377012['activeMarker']&&(_0x377012['activeMarker']=null);}),this['listenTo'](_0x27076f,'removeCommentThread',(_0x8c3c45,{threadId:_0x5bdbe1,isFromAdapter:_0x49ebe5})=>{!_0x49ebe5&&_0x3e300c['ui']['focusTracker']['isFocused']&&_0x377012['hasMarkerForId'](_0x5bdbe1)&&_0x3e300c['editing']['view']['focus']();},{'priority':'highest'}),this['listenTo'](_0x27076f,'addComment',(_0x22f89c,{threadId:_0x11c733,isFromAdapter:_0x151124})=>{!_0x151124&&_0x377012['hasMarkerForId'](_0x11c733)&&_0x27076f['hasCommentThread'](_0x11c733)&&0x1===_0x27076f['getCommentThread'](_0x11c733)['length']&&(_0x3e300c['editing']['view']['focus'](),_0x22f89c['stop']());},{'priority':'low'}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1c735d=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1f4e8a;for(const _0x4c4c93 in _0x1c735d){const _0x33f225=_0x4c4c93,_0x24fe3f=_0x1c735d[_0x33f225];if('commentsLicenseKeyValid'==_0x24fe3f||'commentsLicenseKeyInvalid'==_0x24fe3f||'commentsLicenseKeyExpired'==_0x24fe3f||'commentsLicenseKeyDomainLimit'==_0x24fe3f||'commentsLicenseKeyNotAllowed'==_0x24fe3f||'commentsLicenseKeyEvaluationLimit'==_0x24fe3f||'commentsLicenseKeyUsageLimit'==_0x24fe3f){delete _0x1c735d[_0x33f225],_0x1f4e8a=_0x24fe3f,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'commentsLicenseKeyInvalid'==_0x1f4e8a&&_0x1c735d['_showLicenseError']('invalid'),'commentsLicenseKeyExpired'==_0x1f4e8a&&_0x1c735d['_showLicenseError']('expired'),'commentsLicenseKeyDomainLimit'==_0x1f4e8a&&_0x1c735d['_showLicenseError']('domainLimit'),'commentsLicenseKeyNotAllowed'==_0x1f4e8a&&_0x1c735d['_showLicenseError']('featureNotAllowed','Comments'),'commentsLicenseKeyEvaluationLimit'==_0x1f4e8a&&_0x1c735d['_showLicenseError']('evaluationLimit'),'commentsLicenseKeyUsageLimit'==_0x1f4e8a&&_0x1c735d['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_createUIButton(_0x5e608d){const _0x1161a5=this['editor'],_0x556242=new _0x5e608d(_0x1161a5['locale']),_0x5d5f14=_0x1161a5['commands']['get']('addCommentThread');return _0x556242['set']({'label':Et(_0x1161a5['locale'],'Comment'),'icon':_0x38462c}),_0x556242['bind']('isEnabled')['to'](_0x5d5f14,'isEnabled',_0x5d5f14,'hasContent',(_0x234981,_0x56cbfa)=>_0x234981&&_0x56cbfa),this['listenTo'](_0x556242,'execute',()=>{_0x5d5f14['execute']();}),_0x556242;}},yi=class extends _0x573609{static get['pluginName'](){return'CommentsOnly';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[wi];}constructor(_0x5d2ef2){super(_0x5d2ef2),this['set']('isEnabled',!0x1),this['on']('change:isEnabled',(_0xc2393a,_0x414a34,_0x18e000)=>{_0x18e000?this['_enableCommentsOnlyMode']():this['_disableCommentsOnlyMode']();});}afterInit(){!this['isEnabled']&&this['editor']['config']['get']('commentsOnly')&&(this['isEnabled']=!0x0);}_enableCommentsOnlyMode(){for(const [_0x321c86,_0xc44b6c]of this['editor']['commands'])_0xc44b6c['affectsData']&&'addCommentThread'!==_0x321c86&&_0xc44b6c['forceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('DragDrop')&&this['editor']['plugins']['get']('DragDrop')['forceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['forceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['forceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['forceDisabled']('commentsOnlyMode');const _0x54affc=this['editor']['editing']['view']['document'];this['listenTo'](_0x54affc,'cut',_0x3e93e9=>_0x3e93e9['stop'](),{'priority':'highest'}),this['listenTo'](_0x54affc,'clipboardInput',_0x4de890=>_0x4de890['stop'](),{'priority':'highest'}),this['listenTo'](_0x54affc,'delete',_0x26985a=>_0x26985a['stop'](),{'priority':'highest'});}_disableCommentsOnlyMode(){for(const [_0x42be62,_0x4224b4]of this['editor']['commands'])_0x4224b4['affectsData']&&'addCommentThread'!==_0x42be62&&_0x4224b4['clearForceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['clearForceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['clearForceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['clearForceDisabled']('commentsOnlyMode'),this['stopListening'](this['editor']['editing']['view']['document']);}},Ti=class extends _0x5bc735{activeUIs;uisData;['_uis'];static get requires(){return[ti];}static get['pluginName'](){return'AnnotationsUIs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5c9a2a){super(_0x5c9a2a),this['activeUIs']=new Set(),this['_uis']=new Map(),this['uisData']=new Map();}init(){const _0x51e11e=this['context']['plugins']['get'](ti);this['listenTo'](_0x51e11e,'_activateAnnotation',(_0x1d03f4,_0x2f8740)=>{for(const _0x367f8c of this['activeUIs']){const _0xf68f74=this['_uis']['get'](_0x367f8c);(0x0,this['uisData']['get'](_0x367f8c)['filter'])(_0x2f8740)&&_0xf68f74['setActiveAnnotation'](_0x2f8740);}}),this['listenTo'](_0x51e11e,'_deactivateAllAnnotations',()=>{for(const _0x5c06cd of this['activeUIs'])this['_uis']['get'](_0x5c06cd)['setActiveAnnotation'](null);}),this['listenTo'](_0x51e11e['_visibleAnnotations'],'add',(_0x583a85,_0x476936)=>{this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x476936);});}hasActive(){return this['activeUIs']['size']>0x0;}isActive(_0xb0e2e3){return this['activeUIs']['has'](_0xb0e2e3);}activate(_0x3d0e93,_0x11f175=this['defaultFilter']){const _0x48f4ce=this['context']['plugins']['get'](ti);if(!this['_uis']['has'](_0x3d0e93))throw new _0x4542a4('annotationsuis-missing-ui',this,{'uiName':_0x3d0e93});this['isActive'](_0x3d0e93)&&this['deactivate'](_0x3d0e93),this['activeUIs']['add'](_0x3d0e93);const _0x1bbe04=new Jt();Qt({'source':_0x48f4ce['_visibleAnnotations'],'target':_0x1bbe04,'filter':_0x11f175}),this['uisData']['set'](_0x3d0e93,{'collection':_0x1bbe04,'filter':_0x11f175});const _0x5f35cd=this['_uis']['get'](_0x3d0e93);_0x5f35cd['attach'](_0x1bbe04),this['listenTo'](_0x5f35cd,'change:activeAnnotation',(_0x194f66,_0x405736,_0x5e79b8,_0x353cb6)=>{_0x353cb6&&_0x48f4ce['_removeActiveAnnotation'](_0x353cb6),_0x5e79b8&&_0x48f4ce['_addActiveAnnotation'](_0x5e79b8);});}deactivate(_0x43c738){if(this['activeUIs']['delete'](_0x43c738),!this['_uis']['has'](_0x43c738))throw new _0x4542a4('annotationsuis-missing-ui',this,{'uiName':_0x43c738});const _0x2b3330=this['_uis']['get'](_0x43c738);_0x2b3330['detach'](),this['stopListening'](_0x2b3330),this['uisData']['get'](_0x43c738)['collection']['destroy'](),this['uisData']['delete'](_0x43c738);}switchTo(_0x3485c8){if(!this['_uis']['has'](_0x3485c8))throw new _0x4542a4('annotationsuis-missing-ui',this,{'uiName':_0x3485c8});const _0x4aa8a3=this['context']['plugins']['get'](ti),_0x304c82=Array['from'](_0x4aa8a3['activeAnnotations'])[0x0]||null;this['deactivateAll'](),this['activate'](_0x3485c8);const _0x13f9ce=this['_uis']['get'](_0x3485c8);_0x13f9ce['setActiveAnnotation'](_0x304c82),_0x13f9ce['_setSelectedAnnotations']&&_0x304c82&&_0x13f9ce['_setSelectedAnnotations']([_0x304c82]);}deactivateAll(){for(const _0x2a53ee of this['activeUIs'])this['deactivate'](_0x2a53ee);}register(_0x4f637c,_0x3416fe){if(this['_uis']['has'](_0x4f637c))throw new _0x4542a4('annotationsuis-register-already-registered');if('function'!=typeof _0x3416fe['attach']||'function'!=typeof _0x3416fe['detach']||'function'!=typeof _0x3416fe['setActiveAnnotation'])throw new _0x4542a4('annotationsuis-register-invalid-interface',null);this['_uis']['set'](_0x4f637c,_0x3416fe);}refilterAnnotations(){const _0x24e495=this['context']['plugins']['get'](ti)['collection'],_0x30f62c=new Map(),_0x19ee2c=Array['from'](this['activeUIs']);for(const _0x38a23e of this['activeUIs']){const _0x192267=this['uisData']['get'](_0x38a23e)['collection'];for(const _0x1512e6 of _0x192267)_0x30f62c['set'](_0x1512e6,_0x38a23e);}for(const _0x314b4e of _0x24e495){const _0x435066=_0x30f62c['get'](_0x314b4e);this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x314b4e);const _0x372229=_0x19ee2c['find'](_0x5298af=>this['uisData']['get'](_0x5298af)['filter'](_0x314b4e));_0x435066!==_0x372229&&(_0x435066&&this['uisData']['get'](_0x435066)['collection']['remove'](_0x314b4e),_0x372229&&this['uisData']['get'](_0x372229)['collection']['add'](_0x314b4e));}}destroy(){this['deactivateAll'](),super['destroy']();}defaultFilter(){return!0x0;}_assertAnnotationDoesNotBelongToMultipleUIs(_0x21dcc4){const _0x3834d9=[];for(const _0x163ef8 of this['activeUIs']){(0x0,this['uisData']['get'](_0x163ef8)['filter'])(_0x21dcc4)&&_0x3834d9['push'](_0x163ef8);}if(_0x3834d9['length']>0x1)throw new _0x4542a4('annotationsuis-annotation-mismatch',null,{'matchedUIs':_0x3834d9,'annotationType':_0x21dcc4['type']});}};const Ci=/* #__PURE__ -- @preserve */
|
|
32
|
-
|
|
33
|
-
_0x16910d('px');var Ei=class extends ht{content;_targetTop;_mutationObserver;constructor(_0x4fe964){super(_0x4fe964),this['set']('top',0x0),this['set']('height',0x0),this['bind']('bottom')['to'](this,'top',this,'height',(_0x9defa1,_0x453f85)=>_0x9defa1+_0x453f85),this['set']('isAnimationDisabled',!0x1),this['_mutationObserver']=Xt(()=>this['updateHeight']()),this['_targetTop']=null,this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this);const _0xefe0b9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-sidebar-item',_0xefe0b9['to']('isAnimationDisabled',_0xd45a95=>_0xd45a95?'ck-sidebar-item--no-animation':'')],'style':{'top':_0xefe0b9['to']('top',_0x2ba194=>bi(_0x2ba194))},'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['_mutationObserver']['attach'](this['element']);}['focus'](){this['content']['first']&&this['content']['first']['focus']();}updateHeight(){const _0x13ba0d=this['element']['clientHeight'];_0x13ba0d&&(this['height']=_0x13ba0d);}destroy(){this['content']['clear'](),this['_mutationObserver']['detach'](),super['destroy']();}},ki=class extends _0x5bc735{['view'];_activeAnnotation;_annotations;_spaceBetweenItems;_sidebarItemViewToAnnotation;_annotationToSidebarItemView;_recalculateBuffer;static get['pluginName'](){return'Sidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x20920d){super(_0x20920d),this['set']('_lastItem',void 0x0),this['view']=this['_createSidebarView'](),this['set']('container',null),this['_spaceBetweenItems']=0x19,this['_sidebarItemViewToAnnotation']=new Map(),this['_annotationToSidebarItemView']=new Map(),this['context']['config']['define']('sidebar.preventScrollOutOfView',!0x1),this['_annotations']=null,this['_activeAnnotation']=null,this['_recalculateBuffer']=[];}init(){const _0x2dc9a7=this['context']['config']['get']('sidebar.container');_0x2dc9a7&&this['setContainer'](_0x2dc9a7);}setContainer(_0x1ea542){if(!Oi(_0x1ea542))throw new _0x4542a4('sidebar-setcontainer-invalid-element');this['container']=_0x1ea542;}_attachToContainer({viewClass:_0x9902a0='',spaceBetweenItems:_0x4be5cc=0x19}={}){if(!Oi(this['container']))throw new _0x4542a4('sidebar-attachtocontainer-missing-container',this);this['container']['appendChild'](this['view']['element']),this['view']['class']=_0x9902a0,this['_spaceBetweenItems']=_0x4be5cc;}['rearrange']({removedAnnotation:_0x2cde28,previousAnnotation:_0x3af23a,nextAnnotation:_0x52fe5c}){const _0x3a967e=this['getSidebarItemView'](_0x2cde28);this['view']['list']['remove'](_0x3a967e),this['_destroySidebarItemView'](_0x2cde28),_0x3af23a&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x3af23a)),_0x52fe5c&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x52fe5c)),this['_updateLastItem']();}['refresh']({blurredAnnotation:_0x160fb6,activatedAnnotation:_0x18f927,disableAnimationOnActivatedAnnotation:_0x18e1d4}){if(this['_activeAnnotation']=_0x18f927,_0x160fb6){_0x160fb6['isActive']=!0x1;const _0x41a1ba=this['getSidebarItemView'](_0x160fb6);_0x41a1ba&&_0x18e1d4&&(_0x41a1ba['isAnimationDisabled']=!0x1);}if(_0x18f927){const _0x192fa1=this['getSidebarItemView'](_0x18f927);_0x192fa1&&(_0x18f927['isActive']=!0x0,_0x18e1d4&&(_0x192fa1['isAnimationDisabled']=!0x0,_0x192fa1['top']+=0x1),this['_alignToTargetRect'](_0x192fa1));}}_detachFromContainer(_0xa78f15){if(this['view']['element']['remove'](),_0xa78f15){for(const _0x8ed238 of _0xa78f15)this['_destroySidebarItemView'](_0x8ed238);}this['view']['list']['clear'](),this['view']['class']='',this['_lastItem']=null;}addAnnotation(_0x440cac,_0x2e3d47){_0x2e3d47||(_0x2e3d47=_0x440cac['view']);const _0x2daffd=new Ei(this['context']['locale']);this['_sidebarItemViewToAnnotation']['set'](_0x2daffd,_0x440cac),this['_annotationToSidebarItemView']['set'](_0x440cac,_0x2daffd),_0x2daffd['content']['add'](_0x2e3d47),this['listenTo'](_0x440cac['view'],'change:targetRect',(_0x40c4c4,_0x5c5c5d,_0x419b16)=>{const _0x37fbcd=this['_getTargetTop'](_0x440cac,_0x419b16);_0x2daffd['_targetTop']!=_0x37fbcd&&(_0x2daffd['_targetTop']=_0x37fbcd,this['_setItemTop'](_0x2daffd,_0x37fbcd));}),this['listenTo'](_0x2daffd,'change:top',()=>{this['_recalculate'](_0x2daffd,'top');}),this['listenTo'](_0x2daffd,'change:bottom',()=>{this['_recalculate'](_0x2daffd,'bottom');}),this['_alignToTargetRect'](_0x2daffd);const _0x58e295=this['_getItemBefore'](_0x2daffd);return _0x58e295&&this['_alignAfterItem'](_0x58e295,_0x2daffd)||this['_alignToTargetRect'](_0x2daffd),this['_updateLastItem'](),this['view']['list']['add'](_0x2daffd),_0x2daffd;}['_alignForTopChange'](_0x547229){if(!_0x547229['content']['length'])return;const _0x288790=this['_getItemBefore'](_0x547229);if(!_0x288790)return;const _0x1038cc=this['_sidebarItemViewToAnnotation']['get'](_0x288790),_0x21f40d=this['_activeAnnotation'];_0x21f40d&&_0x21f40d===_0x1038cc?this['_alignAfterItem'](_0x288790,_0x547229):this['_alignBeforeItem'](_0x547229,_0x288790);}_alignForBottomChange(_0x382684){if(!_0x382684['content']['length'])return;const _0x306423=this['_getItemAfter'](_0x382684);if(!_0x306423)return;const _0x574d8d=this['_sidebarItemViewToAnnotation']['get'](_0x306423),_0x19b457=this['context']['config']['get']('sidebar.preventScrollOutOfView'),_0x3cd0b7=this['_activeAnnotation'];_0x3cd0b7&&_0x3cd0b7===_0x574d8d&&_0x19b457?(this['_alignBeforeItem'](_0x306423,_0x382684),this['_alignAfterItem'](_0x382684,_0x306423)):_0x3cd0b7&&_0x3cd0b7===_0x574d8d?this['_alignBeforeItem'](_0x306423,_0x382684):this['_alignAfterItem'](_0x382684,_0x306423);}_recalculate(_0x109879,_0x3cae6b){0x0===this['_recalculateBuffer']['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x440027,changedProp:_0x3da12a}of this['_recalculateBuffer'])'top'===_0x3da12a?this['_alignForTopChange'](_0x440027):this['_alignForBottomChange'](_0x440027);this['_recalculateBuffer']=[];},0xa),this['_recalculateBuffer']['push']({'sidebarItemView':_0x109879,'changedProp':_0x3cae6b});}getSidebarItemView(_0x5aff82){return this['_annotationToSidebarItemView']['get'](_0x5aff82);}destroy(){this['stopListening'](),this['view']['destroy']();}_destroySidebarItemView(_0x36f306){const _0x1be362=this['getSidebarItemView'](_0x36f306);this['stopListening'](_0x1be362),this['stopListening'](_0x36f306['view']),_0x1be362['destroy'](),this['_annotationToSidebarItemView']['delete'](_0x36f306),this['_sidebarItemViewToAnnotation']['delete'](_0x1be362);}_createSidebarView(){const _0x3dfbbf=new Ii(this['context']['locale']);return _0x3dfbbf['render'](),this['on']('change:_lastItem',(_0x39742d,_0x38ff5a,_0x3a7e0b,_0x25d3ae)=>{_0x25d3ae&&_0x3dfbbf['unbind']('minHeight'),_0x3a7e0b?_0x3dfbbf['bind']('minHeight')['to'](_0x3a7e0b,'bottom'):_0x3dfbbf['minHeight']=null;}),_0x3dfbbf;}_updateLastItem(){this['_lastItem']=this['_annotations']?.['last']?this['getSidebarItemView'](this['_annotations']['last']):null;}_getItemBefore(_0x54d65d){const _0x49204c=this['_sidebarItemViewToAnnotation']['get'](_0x54d65d),_0x3727c8=_0x49204c&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x49204c)-0x1);return _0x3727c8&&this['getSidebarItemView'](_0x3727c8)||null;}_getItemAfter(_0x2ccb11){const _0x263b36=this['_sidebarItemViewToAnnotation']['get'](_0x2ccb11),_0x264ba2=_0x263b36&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x263b36)+0x1);return _0x264ba2&&this['getSidebarItemView'](_0x264ba2)||null;}_alignBeforeItem(_0x528d11,_0x3c19a4){_0x528d11['updateHeight']();const _0x2c793e=Ni(_0x3c19a4['bottom']+this['_spaceBetweenItems'],_0x528d11['top']);return!!_0x2c793e&&(this['_setItemTop'](_0x3c19a4,_0x3c19a4['top']-_0x2c793e),!0x0);}_alignAfterItem(_0x466076,_0x434f42){_0x466076['updateHeight']();const _0x32b93f=Ni(_0x466076['bottom']+this['_spaceBetweenItems'],_0x434f42['top']);return!!_0x32b93f&&(this['_setItemTop'](_0x434f42,_0x434f42['top']+_0x32b93f,!0x1),!0x0);}_alignToTargetRect(_0x3e8599){const _0x5ebb9d=this['_sidebarItemViewToAnnotation']['get'](_0x3e8599);if(!_0x5ebb9d||!_0x5ebb9d['target']||!_0x5ebb9d['targetRect'])return;const _0x35b452=this['_getTargetTop'](_0x5ebb9d,_0x5ebb9d['targetRect']);this['_setItemTop'](_0x3e8599,_0x35b452);}_getTargetTop(_0xcc032e,_0x3b2f3e){if(null===_0x3b2f3e)return 0x0;if(_0xcc032e['target']instanceof _0x5b8deb)return _0x3b2f3e['top'];{const _0x9beaf2=new _0x5b8deb(this['view']['element'])['top'];return _0x3b2f3e['top']-_0x9beaf2;}}_setItemTop(_0x1e26f9,_0x11689e,_0x32c4d5=this['context']['config']['get']('sidebar.preventScrollOutOfView')){_0x32c4d5&&(_0x11689e=Math['max'](_0x11689e,this['_getMaxAvailableTop'](_0x1e26f9))),_0x1e26f9['top']=_0x11689e;}_getMaxAvailableTop(_0x5c167e){let _0x44c532=this['_getItemBefore'](_0x5c167e),_0x5d36c7=0x0;for(;_0x44c532;)_0x44c532['updateHeight'](),_0x5d36c7+=this['_spaceBetweenItems']+_0x44c532['height'],_0x44c532=this['_getItemBefore'](_0x44c532);return _0x5d36c7;}};function Ni(_0x21b048,_0x5adb54){return Math['max'](_0x21b048-_0x5adb54,0x0);}function Oi(_0x3df173){return null!==_0x3df173&&'object'==typeof _0x3df173&&0x1===_0x3df173['nodeType'];}var Mi=class extends _0x5bc735{isAttached;annotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'WideSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2bc63d){super(_0x2bc63d),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_editorAnnotations']=new _0x3a878e(),this['_refreshPositioningDebounced']=_0x130064(()=>{_0x2bc63d['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();},0xfa,{'leading':!0x1});}init(){const _0x31cb63=this['context']['plugins']['get'](Ti),_0xe1d2a9=this['context']['plugins']['get'](ki);_0x31cb63['register']('wideSidebar',this),_0xe1d2a9['container']&&_0x31cb63['switchTo']('wideSidebar');}setActiveAnnotation(_0x5bf809){if(_0x5bf809===this['activeAnnotation'])return;const _0x2b8372=this['context']['plugins']['get'](ki);_0x2b8372['_activeAnnotation']=_0x5bf809;const _0x32a6d4=this['activeAnnotation'];_0x2b8372['refresh']({'blurredAnnotation':_0x32a6d4,'activatedAnnotation':_0x5bf809}),this['activeAnnotation']=_0x5bf809;}attach(_0x33df5a){this['annotations']=_0x33df5a;const _0xdad7ad=this['context']['plugins']['get'](ki);if(_0xdad7ad['_annotations']=_0x33df5a,this['isAttached'])throw new _0x4542a4('widesidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0xdad7ad,'set:container',()=>{this['detach'](),this['listenTo'](_0xdad7ad,'change:container',_0x4e7de0=>{_0x4e7de0['off'](),this['attach'](_0x33df5a);});}),_0xdad7ad['_attachToContainer']({'viewClass':'ck-sidebar--wide'});const _0x2d4083=_0x2d29bd=>{_0x2d29bd['updateTargetRect'](),_0xdad7ad['addAnnotation'](_0x2d29bd);};for(const _0x49dd5a of _0x33df5a)_0x2d4083(_0x49dd5a);this['listenTo'](_0x33df5a,'add',(_0x2c82ed,_0x5a8778)=>{_0x2d4083(_0x5a8778);}),this['listenTo'](_0x33df5a,'remove',(_0x82401d,_0x4fb4fb,_0x2043f6)=>{_0xdad7ad['rearrange']({'removedAnnotation':_0x4fb4fb,'previousAnnotation':_0x33df5a['get'](_0x2043f6-0x1),'nextAnnotation':_0x33df5a['get'](_0x2043f6+0x1)}),_0x4fb4fb===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'high'}),this['listenTo'](_0x33df5a,'focus',(_0xf36192,_0x4c44ed)=>{this['setActiveAnnotation'](_0x4c44ed);}),this['listenTo'](_0x33df5a,'blur',()=>{this['setActiveAnnotation'](null);});const _0x5b6965=this['context']instanceof _0x2ed90d?this['context']['editors']:new _0x3a878e([this['context']]);for(const _0xf2592a of _0x5b6965)this['_integrateWithEditorAnnotations'](_0xf2592a);this['listenTo'](_0x5b6965,'add',(_0x5a0925,_0x14f4b4)=>{this['listenTo'](_0x14f4b4,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x14f4b4);});}),this['listenTo'](_0x5b6965,'remove',(_0x578d9b,_0xb2b32e)=>{_0xb2b32e['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0xb2b32e['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();}detach(){if(!this['isAttached'])throw new _0x4542a4('widesidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x1916c7=this['context']['plugins']['get'](ki);_0x1916c7['_detachFromContainer'](this['annotations']),this['stopListening'](_0x1916c7),this['stopListening'](this['annotations']),this['context']instanceof _0x2ed90d&&this['stopListening'](this['context']['editors']);for(const _0x15ffd8 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x15ffd8);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['activeAnnotation']=null,this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach']();}_integrateWithEditorAnnotations(_0x191703){if(!_0x191703['plugins']['has']('EditorAnnotations'))return;const _0x55479d=_0x191703['plugins']['get']('EditorAnnotations'),_0x5a4f5e=()=>{const _0x428a19=_0x55479d['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['setActiveAnnotation'](_0x428a19[0x0]||null);};this['listenTo'](_0x55479d,'refresh',_0x5a4f5e),this['listenTo'](_0x55479d,'blur',(_0x584ebc,{isAnnotationTracked:_0x59bdc4})=>{this['activeAnnotation']&&_0x59bdc4(this['activeAnnotation'])&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x55479d,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](this['annotations'],'blur',_0x1cab1=>{_0x55479d['hasDomSelection']()&&(_0x5a4f5e(),_0x1cab1['stop']());},{'priority':'high'}),this['_editorAnnotations']['add'](_0x55479d);}_destroyEditorAnnotationsIntegration(_0x4a0e20){this['stopListening'](_0x4a0e20),this['_editorAnnotations']['remove'](_0x4a0e20);}},Ri=class extends _0x4695a0{counterView;constructor(_0x4c6cd2){super(_0x4c6cd2);const _0x2651c9=this['bindTemplate'];this['set']('isDirty',!0x1),this['set']('number',0x0),this['bind']('_badge')['to'](this,'isDirty',this,'number',(_0x52aaeb,_0x3847a6)=>_0x52aaeb?'...':_0x3847a6['toString']()),this['set']('annotationType',''),this['icon']=_0x38462c,this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this['counterView']=new ht(),this['counterView']['setTemplate']({'tag':'span','attributes':{'class':['ck-annotation-counter__badge',_0x2651c9['to']('annotationType',_0x2f7cfa=>'ck-annotation-counter__badge--'+_0x2f7cfa),_0x2651c9['if']('isDirty','ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x2651c9['to']('_badge')}]}),this['children']['add'](this['counterView']);}},Si=class extends _0x5bc735{isAttached;annotations;_manuallyClosedAnnotationViews;_domEmitter;_annotationToNarrowView;_selectedAnnotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'NarrowSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x560d4c){super(_0x560d4c),this['isAttached']=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this['_domEmitter']=new(_0x3b6b98())(),this['_annotationToNarrowView']=new Map(),this['set']('activeAnnotation',null),this['annotations']=null,this['_selectedAnnotations']=[],this['_editorAnnotations']=new _0x3a878e(),this['_refreshPositioningDebounced']=_0x130064(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}init(){this['context']['plugins']['get'](Ti)['register']('narrowSidebar',this),this['bodyCollection']=new _0x4a5e13(this['context']['locale']),this['balloonPanelView']=new _0x4e0b34(this['context']['locale']),this['bodyCollection']['attachToDom'](),this['bodyCollection']['add'](this['balloonPanelView']);}attach(_0x33e23e){this['annotations']=_0x33e23e;const _0x525b27=this['context']['plugins']['get'](ki),_0x42c432=this['balloonPanelView'];if(_0x525b27['_annotations']=_0x33e23e,this['isAttached'])throw new _0x4542a4('narrowsidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x525b27,'set:container',()=>{this['detach'](),this['listenTo'](_0x525b27,'change:container',_0x4795e8=>{_0x4795e8['off'](),this['attach'](_0x33e23e);});}),_0x525b27['_attachToContainer']({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5});const _0x2bc84c=_0x159167=>{const _0x324507=new Ri(this['context']['locale']);_0x525b27['addAnnotation'](_0x159167,_0x324507),this['_annotationToNarrowView']['set'](_0x159167,_0x324507),_0x324507['bind']('isDirty','annotationType','number')['to'](_0x159167['view'],'isDirty','type','length'),_0x324507['on']('execute',()=>{this['_manuallyClosedAnnotationViews']['clear'](),_0x42c432['content']['first']!==_0x159167['view']?(this['_showBalloon'](_0x159167),_0x159167['view']['element']['focus'](),this['setActiveAnnotation'](_0x159167)):this['setActiveAnnotation'](null);});};for(const _0x58ffc2 of _0x33e23e)_0x2bc84c(_0x58ffc2);this['listenTo'](_0x33e23e,'add',(_0x2f7f87,_0x3e42f9)=>{_0x2bc84c(_0x3e42f9);}),this['listenTo'](_0x33e23e,'remove',(_0x488f66,_0x188f81,_0x34823e)=>{this['_annotationToNarrowView']['get'](_0x188f81)['destroy'](),this['_annotationToNarrowView']['delete'](_0x188f81),_0x525b27['rearrange']({'removedAnnotation':_0x188f81,'previousAnnotation':_0x33e23e['get'](_0x34823e-0x1),'nextAnnotation':_0x33e23e['get'](_0x34823e+0x1)}),_0x188f81===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'low'}),this['listenTo'](_0x33e23e,'focus',(_0x32d27e,_0x551840)=>{this['setActiveAnnotation'](_0x551840);}),this['listenTo'](_0x33e23e,'blur',()=>{this['setActiveAnnotation'](null);}),this['_domEmitter']['listenTo'](document,'keydown',(_0xcf733e,_0x3f534c)=>{_0x3f534c['keyCode']===_0x48080c['esc']&&_0x42c432['isVisible']&&(this['_manuallyClosedAnnotationViews']['add'](_0x42c432['content']['first']),this['_hideBalloon'](),_0x3f534c['stopPropagation'](),_0x3f534c['preventDefault']());}),this['_domEmitter']['listenTo'](document,'mousedown',(_0x218e0c,_0x498261)=>{const _0x364bc0=_0x498261['target'];_0x42c432['isVisible']&&_0x42c432['element']['contains'](_0x364bc0)||_0x525b27['view']['element']['contains'](_0x364bc0)||_0x218e0c['preventClosingBalloon']||this['activeAnnotation']&&this['activeAnnotation']['focusableElements']['find'](_0x2e5761=>_0x2e5761['contains'](_0x364bc0))||(this['_manuallyClosedAnnotationViews']['clear'](),this['_hideBalloon'](),this['setActiveAnnotation'](null));});const _0x5eb928=this['context']instanceof _0x2ed90d?this['context']['editors']:new _0x3a878e([this['context']]);for(const _0x2e812c of _0x5eb928)this['_integrateWithEditorAnnotations'](_0x2e812c);this['listenTo'](_0x5eb928,'add',(_0x10263d,_0x5480ab)=>{this['listenTo'](_0x5480ab,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x5480ab);});}),this['listenTo'](_0x5eb928,'remove',(_0x508a3f,_0x128ace)=>{_0x128ace['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x128ace['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioning']();}setActiveAnnotation(_0x3fdcce){if(_0x3fdcce===this['activeAnnotation'])return;const _0xd22690=this['context']['plugins']['get'](ki);_0xd22690['refresh']({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x3fdcce,'disableAnimationOnActivatedAnnotation':!0x0}),_0x3fdcce&&_0xd22690['getSidebarItemView'](_0x3fdcce)?this['_showBalloon'](_0x3fdcce):this['_hideBalloon'](),this['activeAnnotation']=_0x3fdcce;}detach(){if(!this['isAttached'])throw new _0x4542a4('narrowsidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x3611e1=this['context']['plugins']['get'](ki);this['_hideBalloon'](),Array['from'](this['_annotationToNarrowView']['values'](),_0x15fe4f=>_0x15fe4f['destroy']()),this['_annotationToNarrowView']['clear'](),_0x3611e1['_detachFromContainer'](this['annotations']),this['stopListening'](),this['_domEmitter']['stopListening'](),this['context']instanceof _0x2ed90d&&this['stopListening'](this['context']['editors']);for(const _0x621a68 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x621a68);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['_selectedAnnotations']=[],this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['bodyCollection']['detachFromDom']();}_integrateWithEditorAnnotations(_0xbc6677){if(!_0xbc6677['plugins']['has']('EditorAnnotations'))return;const _0x3d8694=_0xbc6677['plugins']['get']('EditorAnnotations'),_0x61207a=this['context']['plugins']['get'](ki),_0x2a308c=this['annotations'],_0x1f37c5=this['balloonPanelView'],_0x539931=()=>{const _0x4ce36b=_0x3d8694['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['_setSelectedAnnotations'](_0x4ce36b),this['setActiveAnnotation'](_0x4ce36b[0x0]||null);};this['listenTo'](_0x3d8694,'refresh',_0x539931),this['listenTo'](_0x3d8694,'blur',(_0x537449,{isAnnotationTracked:_0x197b23})=>{this['activeAnnotation']&&_0x197b23(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x3d8694,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](_0x2a308c,'blur',_0x3ed2ee=>{_0x3d8694['hasDomSelection']()&&_0x3ed2ee['stop']();},{'priority':'high'}),this['listenTo'](this['_domEmitter'],'mousedown',(_0x62b6bc,_0x55311)=>{const _0x35804f=_0x55311['target'];_0x1f37c5['isVisible']&&_0x1f37c5['element']['contains'](_0x35804f)||_0x61207a['view']['element']['contains'](_0x35804f)||this['activeAnnotation']&&_0x3d8694['hasDomSelection']()&&(_0x539931(),_0x62b6bc['preventClosingBalloon']=!0x0);},{'priority':'high'}),this['_editorAnnotations']['add'](_0x3d8694);}_destroyEditorAnnotationsIntegration(_0x5be9e9){_0x5be9e9&&(this['stopListening'](_0x5be9e9),this['_editorAnnotations']['remove'](_0x5be9e9));}_setSelectedAnnotations(_0x32fe0f){for(const _0x36a39 of this['_selectedAnnotations'])_0x32fe0f['includes'](_0x36a39)||this['_manuallyClosedAnnotationViews']['delete'](_0x36a39['view']);this['_selectedAnnotations']=_0x32fe0f;}_refreshPositioning(){const _0x45a87=this['balloonPanelView'];this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning'](),_0x45a87['isVisible']&&this['_updateBalloonPosition']();}['_showBalloon'](_0x45bdb3){if(this['_manuallyClosedAnnotationViews']['has'](_0x45bdb3['view']))return;const _0x5034f1=this['balloonPanelView']['content']['first'];_0x5034f1!==_0x45bdb3['view']?(_0x5034f1&&this['_detachListeners'](_0x5034f1),this['_attachListeners'](_0x45bdb3['view']),this['balloonPanelView']['content']['clear'](),this['balloonPanelView']['content']['add'](_0x45bdb3['view']),this['_updateBalloonPosition']()):this['_updateBalloonPosition']();}_updateBalloonPosition(){const _0xf2d57b=this['balloonPanelView']['content']['first'],_0x444d84=_0xf2d57b&&this['annotations']['getByView'](_0xf2d57b);if(!_0x444d84||!this['_annotationToNarrowView']['has'](_0x444d84))return;const _0x2effaf=this['_annotationToNarrowView']['get'](_0x444d84)['element'],_0x2fe238=(function(){const _0x12aafe=_0x4e0b34['defaultPositions'];return[_0x12aafe['southArrowNorthEast'],_0x12aafe['northArrowSouthEast'],_0x12aafe['southArrowNorth'],_0x12aafe['northArrowSouth'],_0x12aafe['southArrowNorthWest'],_0x12aafe['northArrowSouthWest']];}());this['balloonPanelView']['pin']({'target':_0x2effaf,'positions':_0x2fe238});}['_hideBalloon'](){const _0x446623=this['balloonPanelView'],_0x381195=_0x446623['content']['first'];_0x381195&&(this['_detachListeners'](_0x381195),_0x446623['unpin'](),_0x446623['content']['clear']());}_attachListeners(_0x9dfa3a){this['listenTo'](_0x9dfa3a,'change:height',()=>this['_updateBalloonPosition']()),this['listenTo'](_0x9dfa3a,'Esc',(_0x4dd713,_0x871841)=>{this['_manuallyClosedAnnotationViews']['add'](_0x9dfa3a),this['_hideBalloon'](),_0x871841();});}_detachListeners(_0x3706d1){this['stopListening'](_0x3706d1);}},xi=class extends _0x573609{isAttached;annotations;['_manuallyClosed'];['_balloon'];_addedAnnotations;_selectedAnnotations;['_forceRefresh'];_refreshVisibilityDebounced;static get requires(){return[di,_0x4d63f2,Ti];}static get['pluginName'](){return'InlineAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4537f6){super(_0x4537f6),_0x4537f6['editing']['view']['addObserver'](lt),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_manuallyClosed']=new Set(),this['_balloon']=_0x4537f6['plugins']['get'](_0x4d63f2),this['_addedAnnotations']=new Set(),this['_selectedAnnotations']=[],this['_forceRefresh']=!0x1,this['_refreshVisibilityDebounced']=_0x130064(()=>{this['editor']['plugins']['get']('Annotations')['refreshVisibility']();},0xfa,{'leading':!0x1});}init(){const _0x51abdc=this['editor']['plugins']['get'](Ti);_0x51abdc['context']===this['editor']&&(_0x51abdc['register']('inline',this),this['editor']['keystrokes']['set']('Esc',(_0x16053e,_0x2b7be9)=>{const _0x13d806=this['_balloon'];if(this['isAttached']&&_0x13d806['visibleView']){const _0x55698f=this['annotations']['getByView'](_0x13d806['visibleView']);_0x55698f&&this['_closeAnnotation'](_0x55698f),_0x2b7be9();}}));}afterInit(){const _0x40693c=this['editor']['plugins']['get'](Ti);_0x40693c['context']===this['editor']&&(_0x40693c['hasActive']()||_0x40693c['switchTo']('inline'));}setActiveAnnotation(_0x417a76){_0x417a76!==this['activeAnnotation']&&(this['activeAnnotation']&&(this['activeAnnotation']['isActive']=!0x1),_0x417a76&&this['editor']['ui']['focusTracker']['isFocused']&&(this['annotations']['has'](_0x417a76)&&this['_addAnnotationToBalloon'](_0x417a76,!0x0),_0x417a76['isActive']=!0x0),_0x417a76||this['_setSelectedAnnotations']([]),this['activeAnnotation']=_0x417a76);}attach(_0xd390f2){this['annotations']=_0xd390f2;const _0x5a397f=this['editor']['plugins']['get'](Ti),_0x10be1a=this['_balloon'];if(this['isAttached'])throw new _0x4542a4('inlineannotations-attach-already-attached',this);if(_0x5a397f['context']!==this['editor'])throw new _0x4542a4('inlineannotations-not-allowed-with-context',this);const _0xd7f6a9=this['editor']['plugins']['get'](di);this['listenTo'](_0xd7f6a9,'refresh',()=>{const _0x59014e=_0xd7f6a9['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});var _0x4ce35f,_0x4bc9b9;!this['_forceRefresh']&&(_0x4ce35f=_0x59014e,_0x4bc9b9=this['_selectedAnnotations'],_0x4ce35f['length']===_0x4bc9b9['length']&&_0x4ce35f['every'](_0x5018f0=>_0x4bc9b9['includes'](_0x5018f0)))||(this['_forceRefresh']=!0x1,this['_setSelectedAnnotations'](_0x59014e),this['setActiveAnnotation'](_0x59014e[0x0]||null));}),this['listenTo'](_0xd7f6a9,'blur',(_0x6b2ec8,{isAnnotationTracked:_0x2eb989})=>{this['activeAnnotation']&&_0x2eb989(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0xd7f6a9,'uiUpdate',()=>{this['_refreshVisibilityDebounced']();}),this['listenTo'](this['editor']['ui']['focusTracker'],'change:isFocused',(_0x1bc314,_0x497044,_0x60e14)=>{_0x60e14||this['setActiveAnnotation'](null);}),this['listenTo'](_0xd390f2,'remove',(_0x4828e7,_0x27609e)=>{this['_removeAnnotationFromBalloon'](_0x27609e),_0x27609e===this['activeAnnotation']&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x10be1a,'change:visibleView',(_0x5c9f05,_0x48750b,_0x40f373,_0x11f7ac)=>{_0x11f7ac&&this['stopListening'](_0x11f7ac);const _0x496274=_0xd390f2['getByView'](_0x40f373);_0x40f373&&_0x496274&&(this['listenTo'](_0x40f373,'change:height',()=>{_0x10be1a['updatePosition']();}),this['listenTo'](_0x40f373,'Esc',()=>{this['_closeAnnotation'](_0x496274),this['editor']['editing']['view']['focus']();}),this['activeAnnotation']!==_0x496274&&this['setActiveAnnotation'](_0x496274));}),this['listenTo'](this['editor']['ui'],'update',()=>{_0x10be1a['visibleView']&&_0xd390f2['getByView'](_0x10be1a['visibleView'])&&_0x10be1a['updatePosition']();}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',()=>{this['_forceRefresh']=!0x0,this['_manuallyClosed']['clear']();}),this['editor']['editing']['view']['document']['selection']['editableElement']&&this['editor']['editing']['view']['focus'](),this['isAttached']=!0x0;}detach(){if(!this['isAttached'])throw new _0x4542a4('inlineannotations-detach-not-attached',this);this['setActiveAnnotation'](null);for(const _0x49b102 of this['_addedAnnotations'])this['_removeAnnotationFromBalloon'](_0x49b102);this['_refreshVisibilityDebounced']['cancel'](),this['stopListening'](),this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_refreshVisibilityDebounced']['cancel']();}_setSelectedAnnotations(_0x1d01fe){for(const _0x3bf067 of this['_selectedAnnotations'])_0x1d01fe['includes'](_0x3bf067)||this['_manuallyClosed']['delete'](_0x3bf067);for(const _0x11fa2a of this['annotations'])_0x1d01fe['includes'](_0x11fa2a)||this['_removeAnnotationFromBalloon'](_0x11fa2a);if(this['editor']['ui']['focusTracker']['isFocused']){for(const _0x3f6314 of _0x1d01fe)this['_addAnnotationToBalloon'](_0x3f6314);}this['_selectedAnnotations']=_0x1d01fe;}_addAnnotationToBalloon(_0xfcce40,_0x305d81=!0x1){this['_manuallyClosed']['has'](_0xfcce40)||(this['_addedAnnotations']['has'](_0xfcce40)||this['_balloon']['hasView'](_0xfcce40['view'])||(this['_addedAnnotations']['add'](_0xfcce40),this['_balloon']['add']({'stackId':_0xfcce40['view']['id'],'view':_0xfcce40['view'],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0xfcce40)}})),_0x305d81&&this['_balloon']['showStack'](_0xfcce40['view']['id']));}_getBalloonTargetForAnnotation(_0x4ed75f){const _0x2febd7=_0x4ed75f['target'],_0x3270d4=this['editor']['editing']['view'],_0x52b877=_0x3270d4['document']['selection']['getFirstRange'](),_0x1f04ef=_0x3270d4['domConverter']['viewRangeToDom'](_0x52b877);if(_0x1f04ef['collapse'](!0x0),_0x2febd7){if(_0x2febd7 instanceof _0x5b8deb)return _0x2febd7;let _0x2e2d31=[];for(const _0x2ecbfd of _0x2febd7)_0x2e2d31['push'](..._0x5b8deb['getDomElementRects'](_0x2ecbfd));_0x2e2d31=function(_0x5683b0){const _0x1061a8=[];let _0x111284=_0x5683b0[0x0];for(let _0x2f4120=0x1;_0x2f4120<_0x5683b0['length'];_0x2f4120++)if(Pi(_0x111284,_0x5683b0[_0x2f4120])){const _0x30c962=_0x5683b0[_0x2f4120]['width'];_0x111284['width']+=_0x30c962,_0x111284['right']+=_0x30c962;}else _0x1061a8['push'](_0x111284),_0x111284=_0x5683b0[_0x2f4120];return _0x1061a8['push'](_0x111284),_0x1061a8;}(_0x2e2d31);const _0x17459e=_0x1f04ef['getBoundingClientRect']();return _0x2e2d31['find'](_0x59e685=>_0x59e685['top']<=_0x17459e['top']&&_0x59e685['bottom']>=_0x17459e['bottom']&&_0x59e685['left']<=_0x17459e['left']&&_0x59e685['right']>=_0x17459e['right'])||_0x2e2d31[0x0];}return _0x4ed75f['targetRect']||_0x1f04ef;}_removeAnnotationFromBalloon(_0xa5c16b){this['_addedAnnotations']['has'](_0xa5c16b)&&this['_balloon']['hasView'](_0xa5c16b['view'])&&(this['_addedAnnotations']['delete'](_0xa5c16b),this['_balloon']['remove'](_0xa5c16b['view']));}_closeAnnotation(_0x4d3b2b){this['_manuallyClosed']['add'](_0x4d3b2b),this['_removeAnnotationFromBalloon'](_0x4d3b2b);}};function Pi(_0x2b0c76,_0x955fc0){return _0x2b0c76['top']===_0x955fc0['top']&&_0x2b0c76['bottom']===_0x955fc0['bottom']&&_0x2b0c76['right']===_0x955fc0['left'];}var Li=class extends ht{['focusTracker'];['focusCycler'];_annotationViews;constructor(_0x4ee89a,_0x3789b2){super(_0x4ee89a),this['set']('isEmpty',!_0x3789b2['length']),this['focusTracker']=new _0x1bc134(),this['_annotationViews']=_0x3789b2,this['_annotationViews']['delegate']('arrowup','arrowdown')['to'](this),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['focusCycler']=new et({'focusables':_0x3789b2,'focusTracker':this['focusTracker']}),this['listenTo'](_0x3789b2,'add',()=>{this['isEmpty']=!0x1;}),this['listenTo'](_0x3789b2,'remove',(_0x153e0c,_0xa0b9f8)=>{_0xa0b9f8['isActive']&&this['focus'](),_0x3789b2['length']||(this['isEmpty']=!0x0);});const _0x463041=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'dir':'auto','class':['ck','ck-comments-archive'],'tabindex':-0x1,'role':'list','aria-label':Et(_0x4ee89a,'COMMENTS_ARCHIVE_LIST_LABEL')},'children':[{'tag':'div','attributes':{'class':['ck-comments-archive__content'],'role':'presentation'},'children':[{'tag':'div','attributes':{'role':'presentation'},'children':_0x3789b2},{'tag':'p','attributes':{'class':['ck-comments-archive__info',_0x463041['if']('isEmpty','ck-hidden',_0x2d3bf5=>!_0x2d3bf5)]},'children':[{'text':Et(_0x4ee89a,'EMPTY_COMMENTS_ARCHIVE')}]}]}]});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}destroy(){super['destroy'](),this['focusTracker']['destroy']();}['focus'](){this['focusCycler']['first']?this['focusCycler']['focusFirst']():this['element']['focus']();}_setupKeyboardNavigation(){for(const _0x57abd1 of this['_annotationViews'])this['focusTracker']['add'](_0x57abd1['element']);this['_annotationViews']['on']('change',(_0x4a715d,{added:_0x1974e6,removed:_0x44c497})=>{for(const _0x17ab9b of _0x1974e6)this['focusTracker']['add'](_0x17ab9b['element']);for(const _0x3f4ffb of _0x44c497)this['focusTracker']['remove'](_0x3f4ffb['element']);});}},Di=class extends _0x5bc735{static get['pluginName'](){return'CommentsArchive';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,ti];}constructor(_0x531e10){super(_0x531e10),this['archivedThreads']=new _0x3a878e();}init(){const _0x56300a=this['context'],_0x541792=_0x56300a['plugins']['get'](oi),_0x8c07bf=_0x56300a['plugins']['get'](ti);this['listenTo'](_0x541792,'addCommentThread',(_0x23c457,{threadId:_0x3d3ff0})=>{const _0x28dc2e=_0x541792['getCommentThread'](_0x3d3ff0);_0x28dc2e['archivedAt']&&this['archivedThreads']['add'](_0x28dc2e,this['_calculatePosition'](_0x28dc2e['archivedAt'])),this['listenTo'](_0x28dc2e,'change:archivedAt',(_0xad90f,_0x507d37,_0x24ca00)=>{_0x24ca00?this['archivedThreads']['has'](_0x28dc2e)||this['archivedThreads']['add'](_0x28dc2e,this['_calculatePosition'](_0x28dc2e['archivedAt'])):this['archivedThreads']['has'](_0x28dc2e)&&this['archivedThreads']['remove'](_0x28dc2e);});}),this['listenTo'](_0x541792,'removeCommentThread',(_0x3ce167,{threadId:_0x20278f})=>{const _0x1f88dc=_0x541792['getCommentThread'](_0x20278f);this['stopListening'](_0x1f88dc),this['archivedThreads']['has'](_0x1f88dc)&&this['archivedThreads']['remove'](_0x1f88dc);},{'priority':'highest'}),this['listenTo'](_0x8c07bf['collection'],'focus',(_0xeff820,_0xc66128)=>{_0xc66128['isVisible']||(_0xc66128['isActive']=!0x0,_0x8c07bf['activate'](_0xc66128));});}_calculatePosition(_0x2439ec){const _0x540af4=[...this['archivedThreads']]['findIndex'](_0x5054ce=>_0x5054ce['archivedAt']<_0x2439ec);return _0x540af4>-0x1?_0x540af4:this['archivedThreads']['length'];}},Vi=class extends _0x573609{commentsArchiveView;annotationViews;['_pendingThreads'];static get['pluginName'](){return'CommentsArchiveUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Di,_0x5dfd34];}constructor(_0x16de32){super(_0x16de32),this['annotationViews']=new at(),this['_pendingThreads']=[];}init(){const _0x51e336=this['editor'],_0xcb7d7c=this['_hideDialogOnAnnotationEscape']['bind'](this);_0x51e336['ui']['componentFactory']['add']('commentsArchive',()=>this['_createCommentsArchiveButton'](_0x4695a0,!0x0)),_0x51e336['ui']['componentFactory']['add']('menuBar:commentsArchive',()=>{const _0x6bb926=this['_createCommentsArchiveButton'](rt);return _0x6bb926['set']({'role':'menuitemcheckbox'}),_0x6bb926;});const _0xc76b4d=_0x51e336['plugins']['get'](Di),_0x5e7c49=_0x51e336['plugins']['get']('Annotations'),_0x5c4033=_0x51e336['plugins']['get']('CommentsRepository');_0xc76b4d['archivedThreads']['forEach'](_0x53968a=>{this['_handleNewThread'](_0x53968a);}),this['listenTo'](_0xc76b4d['archivedThreads'],'add',(_0x17ad7c,_0x31da04)=>{this['_handleNewThread'](_0x31da04);}),this['listenTo'](_0x5e7c49['collection'],'add',(_0x1ee631,_0x303fcf)=>{const _0x16c35f=this['_pendingThreads']['find'](_0x494781=>{const _0x3f91f4=_0x5c4033['_threadToController']['get'](_0x494781);return _0x3f91f4&&_0x303fcf['innerView']===_0x3f91f4['view'];});if(_0x16c35f){const _0x3b659d=this['_calculatePosition'](_0x16c35f['archivedAt']);this['_addAnnotationToArchive'](_0x303fcf,_0x3b659d),this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x16c35f),0x1);}}),this['listenTo'](_0xc76b4d['archivedThreads'],'remove',(_0x1e0b71,_0x4b3058)=>{const _0x3c134e=_0x51e336['config']['get']('collaboration.channelId');if(!_0x3c134e||_0x4b3058['channelId']===_0x3c134e){if(this['_pendingThreads']['includes'](_0x4b3058))this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x4b3058),0x1);else{const _0xb5ff3a=_0x5c4033['_threadToController']['get'](_0x4b3058),_0x1fc080=_0x5e7c49['getByInnerView'](_0xb5ff3a['view']);this['annotationViews']['remove'](_0x1fc080['view']),this['stopListening'](_0x1fc080),this['stopListening'](_0x1fc080['focusableElements']);}}}),this['listenTo'](_0x5e7c49['collection'],'add',(_0x47da92,_0x545529)=>{this['listenTo'](_0x545529,'escape',_0xcb7d7c);}),this['listenTo'](_0x5e7c49['collection'],'remove',(_0x10801c,_0x336d98)=>{this['stopListening'](_0x336d98,'escape',_0xcb7d7c);});}_addAnnotationToArchive(_0x23b573,_0x4b1383){this['listenTo'](_0x23b573,'set:isVisible',_0x39062b=>{_0x39062b['return']=!0x1,_0x39062b['stop']();}),this['annotationViews']['add'](_0x23b573['view'],_0x4b1383);}['_handleNewThread'](_0x64f4e1){const _0xe8b3c6=this['editor']['plugins']['get']('CommentsRepository'),_0x3b9b01=this['editor']['plugins']['get']('Annotations'),_0x1b6282=this['editor']['config']['get']('collaboration.channelId');if(!_0x1b6282||_0x64f4e1['channelId']===_0x1b6282){const _0x41e204=_0xe8b3c6['_threadToController']['get'](_0x64f4e1);if(!_0x41e204)return void this['_pendingThreads']['push'](_0x64f4e1);const _0xac5bec=this['_calculatePosition'](_0x64f4e1['archivedAt']),_0x382bfc=_0x3b9b01['getByInnerView'](_0x41e204['view']);_0x382bfc['isVisible']&&_0x3b9b01['_visibleAnnotations']['remove'](_0x382bfc),this['_addAnnotationToArchive'](_0x382bfc,_0xac5bec);}}_calculatePosition(_0x2eed1c){const _0x380e35=this['editor']['config']['get']('collaboration.channelId'),_0x32f736=[...this['editor']['plugins']['get'](Di)['archivedThreads']]['filter'](_0x2051d3=>_0x2051d3['channelId']===_0x380e35)['findIndex'](_0x39ab54=>_0x39ab54['archivedAt']<_0x2eed1c);return _0x32f736<0x0||_0x32f736>this['annotationViews']['length']?this['annotationViews']['length']:_0x32f736-0x1;}_toggleDialog(){const _0x15973b=this['editor'],_0x4c35f4=_0x15973b['plugins']['get']('Dialog');this['commentsArchiveView']||(this['commentsArchiveView']=new Li(_0x15973b['locale'],this['annotationViews'])),'commentsArchive'===_0x4c35f4['id']?_0x4c35f4['hide']():_0x4c35f4['show']({'id':'commentsArchive','title':Et(_0x15973b['locale'],'COMMENTS_ARCHIVE'),'icon':_0x4e5e21,'hasCloseButton':!0x0,'content':this['commentsArchiveView'],'position':_0x10710f['EDITOR_TOP_SIDE']});}_createCommentsArchiveButton(_0x129f37,_0x37654a=!0x1){const _0x68b5be=this['editor']['locale'],_0x335a1a=this['editor']['plugins']['get']('Dialog'),_0x18f438=new _0x129f37(_0x68b5be);return _0x18f438['bind']('isEnabled')['to'](this,'isEnabled'),_0x18f438['bind']('isOn')['to'](_0x335a1a,'id',_0x4054ed=>'commentsArchive'===_0x4054ed),_0x18f438['set']({'label':Et(_0x68b5be,'COMMENTS_ARCHIVE'),'icon':_0x4e5e21,'isToggleable':!0x0}),_0x37654a&&(_0x18f438['tooltip']=!0x0),this['listenTo'](_0x18f438,'execute',()=>this['_toggleDialog']()),_0x18f438;}_hideDialogOnAnnotationEscape=_0x5b2024=>{const _0x4d940e=_0x5b2024['source'];if(!this['annotationViews']['has'](_0x4d940e['view']))return;const _0x32d943=this['editor']['plugins']['get']('Dialog');_0x32d943['isOpen']&&'commentsArchive'===_0x32d943['id']&&(_0x32d943['hide'](),_0x5b2024['stop']());};},Bi=class extends _0x573609{static get requires(){return[oi,wi,vi,Di,Vi,yi,Mi,Si,xi];}static get['pluginName'](){return'Comments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{ci as AddCommentThreadCommand,$t as Annotation,Jt as AnnotationCollection,Ri as AnnotationCounterButtonView,qt as AnnotationView,ti as Annotations,Ei as AnnotationsSidebarItemView,Ii as AnnotationsSidebarView,Ti as AnnotationsUIs,Ht as BaseCommentThreadView,Kt as BaseCommentView,hi as Comment,ri as CommentThread,bt as CommentThreadController,xt as CommentThreadInputView,Ut as CommentThreadView,Yt as CommentView,Bi as Comments,Di as CommentsArchive,Vi as CommentsArchiveUI,wi as CommentsEditing,Lt as CommentsListView,yi as CommentsOnly,oi as CommentsRepository,vi as CommentsUI,di as EditorAnnotations,xi as InlineAnnotations,Si as NarrowSidebar,ki as Sidebar,Mi as WideSidebar,Qt as bindAnnotationCollections};
|
|
23
|
+
import{Command as _0x412ddc,Context as _0x5dcde4,ContextPlugin as _0x333ed9,Editor as _0x25e8b1,PendingActions as _0x2e4006,Plugin as _0x3de2ea}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x50ddc5,Collection as _0x549ed4,DomEmitterMixin as _0x3be4b8,FocusTracker as _0x1d3923,KeystrokeHandler as _0x172e53,ObservableMixin as _0x178707,Rect as _0x2a80a4,diff as _0x218ca2,first as _0x9c8dae,getEnvKeystrokeText as _0x2a76af,keyCodes as _0x30127a,priorities as _0xd25c7d,scrollViewportToShowTarget as _0x47daa2,toUnit as _0x3e4b52,uid as _0x5c5379}from'@ckeditor/ckeditor5-utils';import{AriaDescriptionView as _0x4f8e71,ConfirmMixin as _0x451317,FOCUS_ANNOTATION_KEYSTROKE as _0x2f9b22,LateFocusButtonView as _0x18b828,LateFocusDropdownButtonView as _0x2ec44f,UserView as _0x9b3755,Users as _0x1b2b4f,getAllMarkersDomElementsSorted as _0x3d1e87,getDateTimeFormatter as _0x474445,hashObject as _0x544dfc,setupThreadKeyboardNavigation as _0xb2f554,surroundingMarkersDetector as _0x18a7fa,trimHtml as _0x6448ca}from'@ckeditor/ckeditor5-collaboration-core';import{cloneDeep as _0x267281,debounce as _0x174c5f,isEqual as _0x19f69e,set as _0x5a9c0d,throttle as _0x8dd7ca,unset as _0x43de5a}from'es-toolkit/compat';import{IconAddComment as _0x5e7948,IconCheck as _0x259a04,IconCommentsArchive as _0x48d9e2,IconPencil as _0x3bdce3,IconRemoveComment as _0x22bfcd,IconThreeVerticalDots as _0x13dae8,IconUndo as _0xe2fb2d}from'@ckeditor/ckeditor5-icons';import{BalloonPanelView as _0x44b29b,BodyCollection as _0x3958e2,ButtonView as _0x126747,ContextualBalloon as _0x853866,Dialog as _0x21ea5c,DialogViewPosition as _0x184e59,EditorUI as tt,EditorUIView as it,FocusCycler as et,InlineEditableUIView as st,ListItemView as nt,ListView as ot,MenuBarMenuListItemButtonView as rt,View as ht,ViewCollection as at,createDropdown as ct,focusChildOnDropdownOpen as dt}from'@ckeditor/ckeditor5-ui';import{MouseObserver as lt,disableViewPlaceholder as mt,enableViewPlaceholder as ut}from'@ckeditor/ckeditor5-engine';import{Clipboard as ft,ClipboardMarkersUtils as pt,ClipboardPipeline as wt}from'@ckeditor/ckeditor5-clipboard';import{Enter as gt,ShiftEnter as _t}from'@ckeditor/ckeditor5-enter';import{SelectAll as At}from'@ckeditor/ckeditor5-select-all';import{Typing as vt}from'@ckeditor/ckeditor5-typing';import{Undo as yt}from'@ckeditor/ckeditor5-undo';import{Paragraph as Tt}from'@ckeditor/ckeditor5-paragraph';import{toWidget as Ct}from'@ckeditor/ckeditor5-widget';const It=/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x178707();var bt=class extends It{['model'];['view'];constructor(_0x53213e,_0xf478bd){super(),this['model']=_0x53213e,this['model']['_isAttached']=!0x0,this['view']=_0xf478bd,this['listenTo'](_0xf478bd,'submitCommentThread',()=>this['submit']()),this['listenTo'](_0xf478bd,'removeCommentThread',()=>this['remove']()),this['listenTo'](_0xf478bd,'resolveCommentThread',()=>this['resolve']()),this['listenTo'](_0xf478bd,'reopenCommentThread',()=>this['reopen']()),this['listenTo'](_0xf478bd,'addComment',(_0x4a1584,_0x572ee5)=>this['addComment'](_0x572ee5)),this['listenTo'](_0xf478bd,'updateComment',(_0x30bca9,_0x4ae40b,_0x223350)=>this['updateComment'](_0x4ae40b,_0x223350)),this['listenTo'](_0xf478bd,'removeComment',(_0x5b9aec,_0xcbf180)=>this['removeComment'](_0xcbf180));}submit(){this['model']['submit']();}['remove'](){this['model']['remove']();}['resolve'](){this['model']['isResolved']||this['model']['resolve']();}['reopen'](){this['model']['isResolved']&&this['model']['reopen']();}addComment(_0x95a59c){this['model']['addComment']({'content':_0x95a59c,'authorId':this['view']['_localUser']['id']});}updateComment(_0x5bd9f7,_0xde99ef){this['model']['getComment'](_0x5bd9f7)['update']({'content':_0xde99ef});}removeComment(_0x3303dc){this['model']['getComment'](_0x3303dc)['remove']();}destroy(){this['stopListening'](),this['model']['_isAttached']=!0x1;}};function Et(_0x5344df,_0x31357c,_0x115921){const t=_0x5344df['t'];switch(_0x31357c){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'},_0x115921);case'COMMENT_THREAD_LABEL':return t({'string':'Comment\x20thread\x20by\x20%1.\x20%0\x20reply.','plural':'Comment\x20thread\x20by\x20%1.\x20%0\x20replies.','id':'COMMENT_THREAD_LABEL'},_0x115921);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'},_0x115921);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'},_0x115921);case'NUMBER_OF_COMMENTS':return t({'string':'%0\x20Comment','plural':'%0\x20Comments','id':'NUMBER_OF_COMMENTS'},_0x115921);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'},_0x115921);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'},_0x115921);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'},_0x115921);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'';}}var kt=class extends it{['main'];editable;constructor(_0xbcf8ea,_0x2250fd){super(_0xbcf8ea);const _0x9c328f=_0x5c5379();this['main']=this['createCollection'](),this['editable']=new st(_0xbcf8ea,_0x2250fd,void 0x0,{'label':()=>Et(_0xbcf8ea,'Comment\x20editor')}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-editor','ck-rounded-corners','ck-comment__input'],'dir':_0xbcf8ea['uiLanguageDirection'],'lang':_0xbcf8ea['uiLanguage'],'aria-labelledby':'cke-editor__aria-label_'+_0x9c328f},'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']();}},Nt=class extends tt{['view'];constructor(_0xa15324){super(_0xa15324),this['view']=new kt(_0xa15324['locale'],_0xa15324['editing']['view']);}get element(){return this['view']['element'];}init(){const _0xd3183a=this['editor']['editing']['view'],_0x26f244=this['view']['editable'];_0x26f244['name']=_0xd3183a['document']['getRoot']()['rootName'],this['view']['render']();const _0x1cd5b8=_0x26f244['element'];this['setEditableElement'](_0x26f244['name'],_0x1cd5b8),this['view']['editable']['bind']('isFocused')['to'](this['focusTracker']),_0xd3183a['attachDomRoot'](_0x1cd5b8),this['fire']('ready');}destroy(){super['destroy'](),this['view']['destroy']();}};const Ot=[ft,gt,_t,At,vt,yt,Tt],Mt=/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x178707(_0x25e8b1);var Rt=class CommentEditor extends Mt{static defaultPlugins=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>Ot)());constructor(_0x356985={}){(_0x356985=Object['assign']({},_0x356985))['plugins']||(_0x356985['plugins']=CommentEditor['defaultPlugins']),super(_0x356985),this['ui']=new Nt(this),this['set']('placeholder',''),this['model']['document']['on']('change',()=>this['_updatePlaceholder'](),{'priority':'low'}),this['on']('change:placeholder',()=>this['_updatePlaceholder']()),this['model']['document']['createRoot'](),this['editing']['view']['_overlayModeHint']='auto',this['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}create(){const _0x43dbfb=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x43dbfb))['then'](()=>this['fire']('ready'));}destroy(){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0x5f2a30=>{const _0x24fc5f=this['model']['document']['getRoot'](),_0x3d4e63=_0x24fc5f&&_0x24fc5f['getChild'](_0x24fc5f['childCount']-0x1);_0x5f2a30['setSelection'](_0x3d4e63,'end'),this['editing']['view']['focus']();});}_updatePlaceholder(){const _0x3e3eb6=this['editing']['view'],_0x547e0f=_0x3e3eb6['document']['getRoot'](),_0x9e7b46=_0x547e0f['getChild'](0x0);_0x547e0f['childCount']>0x1||!_0x9e7b46||'p'!=_0x9e7b46['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(mt(_0x3e3eb6,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x9e7b46['placeholder']=this['placeholder']),ut({'view':_0x3e3eb6,'element':_0x9e7b46,'keepOnFocus':!0x0}),this['placeholderElement']=_0x9e7b46);}},St=class extends ht{keystrokes;['focusTracker'];['focusables'];['focusCycler'];submitButtonView;cancelButtonView;_editorConfig;constructor(_0x33f204,_0x188ff0={}){super(_0x33f204),this['editor']=null,this['_editorConfig']=_0x188ff0,this['set']('value',_0x188ff0['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',Et(_0x33f204,'Reply...')),this['set']('submitLabel',Et(_0x33f204,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['submitButtonView'],this['cancelButtonView']]),this['keystrokes']=new _0x172e53(),this['focusTracker']=new _0x1d3923(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x34c860=>!_0x34c860['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',(_0xf5bd9d,_0x22538f)=>{this['cancelButtonView']['fire']('execute'),_0x22538f();}),this['keystrokes']['set']('Ctrl+Enter',(_0x43c8dd,_0x1d8a91)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x1d8a91());}),this['on']('submit',(_0x4aade7,_0x319f76)=>{_0x319f76['length']>0xfde8?(alert(Et(_0x33f204,'TOO_LONG_COMMENT_ALERT',[_0x319f76['length'],0xfde8])),_0x4aade7['stop']()):this['editor']['setData']('');},{'priority':'high'});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}createEditor(){return this['editor']||(this['editor']=new Rt(this['_editorConfig']),this['_editorCreationPromise']=this['editor']['create']()['then'](()=>{if(this['_isDestroyed'])return;const _0x3f3c9e=this['editor'];this['element']['insertBefore'](_0x3f3c9e['ui']['element'],this['element']['firstChild']),_0x3f3c9e['model']['document']['on']('change',()=>this['value']=_0x3f3c9e['getData']()),_0x3f3c9e['bind']('placeholder')['to'](this),this['focusables']['add'](_0x3f3c9e['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x482de8){-0x1===_0x482de8?(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:_0x3dac26}=this,_0x3c931f=new _0x126747(_0x3dac26);return _0x3c931f['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--submit']}}),_0x3c931f['withText']=!0x0,_0x3c931f['bind']('label')['to'](this,'submitLabel'),_0x3c931f['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x3c931f['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x40c8ad,_0x541ae1)=>!_0x541ae1&&!!_0x40c8ad['trim']()),_0x3c931f;}_createCancelButton(){const {locale:_0x2063a5}=this,_0x4dd230=new _0x126747(_0x2063a5);return _0x4dd230['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x4dd230['label']=Et(_0x2063a5,'Cancel'),_0x4dd230['withText']=!0x0,_0x4dd230['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x4dd230;}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x329a44=>{this['focusTracker']['add'](_0x329a44['element']);}),this['focusables']['on']('change',(_0x5e1a05,_0x277aa5)=>{for(const _0x76ddfa of Array['from'](_0x277aa5['added'])['reverse']())this['focusTracker']['add'](_0x76ddfa['element']);});}},xt=class extends ht{constructor(_0x1c2c6e,_0x23a6f4,_0x3aff5e){super(_0x1c2c6e),this['commentInputView']=new St(_0x1c2c6e,_0x3aff5e),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x8fd226,_0xc7af1)=>_0x8fd226||!!_0xc7af1),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 _0x9b3755(_0x1c2c6e,_0x23a6f4),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'](_0x39ae98){this['commentInputView']['focus'](_0x39ae98);}_focusOnNonInteractiveMouseDown(){this['listenTo'](this['element'],'mousedown',(_0x23cbf4,_0x5ebe06)=>{const {submitButtonView:_0x1ca7c5,cancelButtonView:_0x20e305,editor:_0x153901}=this['commentInputView'];[_0x1ca7c5['element'],_0x20e305['element'],_0x153901?_0x153901['editing']['view']['getDomRoot']():null]['filter'](_0x188241=>_0x188241)['some'](_0xe5433c=>_0xe5433c['contains'](_0x5ebe06['target']))||(this['focus'](),_0x5ebe06['preventDefault']());});}},Pt=class extends ht{constructor(_0x256935){super(_0x256935);const _0x6adb78=this['bindTemplate'];this['set']('count',void 0x0),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[{'text':_0x6adb78['to']('count',_0x597af5=>Et(_0x256935,'NUMBER_OF_COMMENTS',_0x597af5))}]});}},Lt=class extends ht{commentViews;resolvedCommentView;['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];_collapsedCommentsView;constructor(_0x1e4668,_0x173914,_0x352714){super(_0x1e4668);const _0x88c700=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x173914['comments']['length']),this['set']('isActive',!0x1),this['_model']=_0x173914,this['_config']=_0x352714,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x1d3923(),this['keystrokes']=new _0x172e53(),this['focusCycler']=new et({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x2e893e=>this['commentViews']['map'](_0x3f0df6=>_0x3f0df6['element'])['includes'](_0x2e893e['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new Pt(_0x1e4668),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0xc08318=>_0xc08318-this['_config']['maxCommentsWhenCollapsed']);for(const _0x5d563d of _0x173914['comments'])this['_handleNewCommentModel'](_0x5d563d);this['_handleInfoComment'](),this['listenTo'](_0x173914['comments'],'add',(_0x4299f1,_0x57e942)=>{const _0x4b1488=this['_calculatePosition'](_0x57e942);this['length']++,this['_handleNewCommentModel'](_0x57e942,_0x4b1488),this['refreshVisibleViews']();}),this['listenTo'](_0x173914['comments'],'remove',(_0x3a4eeb,_0x20a74f)=>{this['length']--,this['_handleRemoveCommentModel'](_0x20a74f),this['refreshVisibleViews']();}),this['listenTo'](_0x173914,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x173914,'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',_0x88c700['if']('length','ck-hidden',_0x5e71c0=>!_0x5e71c0)],'aria-label':Et(_0x1e4668,'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'](_0x3824d7){-0x1===_0x3824d7?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}destroy(){this['_collapsedCommentsView']['destroy']();for(const _0x46ba31 of this['commentViews'])_0x46ba31['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}_handleNewCommentModel(_0x3c9c05,_0x3f2222){const _0xfd57eb=new this['_config']['CommentView'](this['locale'],_0x3c9c05,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0xfd57eb['viewUid']=_0x3c9c05['id'],_0xfd57eb['delegate']('removeComment')['to'](this),_0xfd57eb['delegate']('updateComment')['to'](this),_0xfd57eb['delegate']('resolveCommentThread')['to'](this),_0xfd57eb['delegate']('editorReady')['to'](this),_0xfd57eb['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0xfd57eb,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0xfd57eb,_0x3f2222);}_calculatePosition(_0x5cf3eb){const _0x5cf76e=this['_model']['_findOptimalIndex'](_0x5cf3eb);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x5cf3eb['authoredAt']?_0x5cf76e-0x1:_0x5cf76e:_0x5cf76e-0x1;}_handleInfoComment(){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x5abc7d={'id':'resolved','author':this['_model']['resolvedBy'],'authoredAt':this['_model']['resolvedAt'],'content':Et(this['locale'],'Marked\x20as\x20resolved'),'attributes':{}};this['resolvedCommentView']=new this['_config']['CommentView'](this['locale'],_0x5abc7d,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x5abc7d));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}_handleRemoveCommentModel(_0x5ade3b){const _0x5067b2=this['commentViews']['remove'](_0x5ade3b['id']);this['stopListening'](_0x5067b2),_0x5067b2['isEditMode']&&this['_updateHasDirtyComment'](),_0x5067b2['destroy']();}_updateHasDirtyComment(){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x3f9b3c=>_0x3f9b3c['isEditMode']);}['_rearrangeCollapse'](){const _0x507969=function(_0x5f350b){const _0xdedd0b=new _0x549ed4();for(const _0x510980 of _0x5f350b)_0xdedd0b['add'](_0x510980);return _0xdedd0b;}(this['commentViews']),_0x29ef9f=this['_collapsedCommentsView']['count'];for(let _0x43c7a5=0x1;_0x43c7a5<=_0x29ef9f;_0x43c7a5++)_0x507969['remove'](0x1);for(const _0x95c280 of _0x507969)_0x95c280['collapse']();_0x29ef9f>0x0&&_0x507969['add'](this['_collapsedCommentsView'],0x1),Dt(_0x218ca2(Array['from'](this['visibleViews']),Array['from'](_0x507969)),this['visibleViews'],_0x507969);}['_rearrangeExpand'](){Dt(_0x218ca2(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x19e8d8 of this['visibleViews'])_0x19e8d8['expand']();}_setupKeyboardNavigation(){this['commentViews']['forEach'](_0x33eccb=>{this['focusTracker']['add'](_0x33eccb['element']),this['keystrokes']['listenTo'](_0x33eccb['element']);}),this['commentViews']['on']('change',(_0x2181d9,_0x565e99)=>{for(const _0x956161 of _0x565e99['removed'])this['focusTracker']['remove'](_0x956161['element']),this['keystrokes']['stopListening'](_0x956161['element']);for(const _0x5a58cf of Array['from'](_0x565e99['added'])['reverse']())this['focusTracker']['add'](_0x5a58cf['element']),this['keystrokes']['listenTo'](_0x5a58cf['element']);});}};function Dt(_0x56acfd,_0x312f6,_0x2fe5e5){let _0x5e930b=0x0;for(const _0x37591f of _0x56acfd)switch(_0x37591f){case'insert':_0x312f6['add'](_0x2fe5e5['get'](_0x5e930b),_0x5e930b),_0x5e930b++;break;case'delete':_0x312f6['remove'](_0x5e930b);break;case'equal':_0x5e930b++;}}var Vt=class extends ht{constructor(_0x2ef141){super(_0x2ef141);const _0xba792f=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0xba792f['to']('contextValue',_0x5cbd02=>Et(_0x2ef141,'THREAD_CONTEXT_LABEL',_0x5cbd02)),'tabindex':-0x1},'children':[{'text':_0xba792f['to']('contextValue')}]});}['focus'](){this['element']['focus']();}},Bt=class extends ht{['_model'];reopenButtonView;contextView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x5f2482,_0x3905fc){super(_0x5f2482);const _0x1ab844=this['bindTemplate'];this['_model']=_0x3905fc,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x1d3923(),this['keystrokes']=new _0x172e53(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0x4353e9=>!!_0x4353e9),this['bind']('contextValue')['to'](this['_model'],'context',_0x5fc783=>_0x5fc783&&_0x5fc783['value']?this['_trimContextValue'](_0x5fc783['value']):Et(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',_0x1ab844['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 _0x3a4ca1=new _0x126747(this['locale']);return _0x3a4ca1['label']=Et(this['locale'],'Reopen'),_0x3a4ca1['tooltip']=Et(this['locale'],'Reopen'),_0x3a4ca1['icon']=_0xe2fb2d,_0x3a4ca1['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x27c427=>!_0x27c427),_0x3a4ca1['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x1c268e,_0x470c39)=>_0x1c268e&&_0x470c39),_0x3a4ca1['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x3a4ca1;}_trimContextValue(_0x463622){if(_0x463622['length']<0x96)return _0x463622;const _0x5f214d=_0x463622['lastIndexOf']('\x20',0x93);return _0x463622['substring'](0x0,_0x5f214d>-0x1?_0x5f214d:0x93)+'...';}_attachContextActions(){const _0x1b2248=this['element']['querySelector']('.ck-context'),_0x247139=_0x1b2248['querySelector']('.ck-context__value');this['listenTo'](_0x1b2248,'mouseenter',()=>{_0x247139['offsetWidth']<_0x247139['scrollWidth']&&_0x1b2248['classList']['add']('overlay');}),this['listenTo'](_0x1b2248,'mouseleave',()=>{_0x1b2248['classList']['remove']('overlay');});}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']);for(const _0x22a63f of this['focusables'])this['focusTracker']['add'](_0x22a63f['element']),this['keystrokes']['listenTo'](_0x22a63f['element']);}_createContextView(){const _0x4ad32f=new Vt(this['locale']);return _0x4ad32f['bind']('contextValue')['to'](this),_0x4ad32f;}},Ht=class extends ht{['_model'];['_config'];commentThreadHeaderView;commentThreadInputView;ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x184eb2,_0x2c94a1,_0x1ac87b,_0x2598f6){super(_0x184eb2),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x2c94a1,this['_localUser']=_0x1ac87b,this['_config']=_0x2598f6,this['commentThreadHeaderView']=new Bt(_0x184eb2,_0x2c94a1),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x4f8e71(_0x184eb2,Et(_0x184eb2,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new Lt(_0x184eb2,_0x2c94a1,Object['assign']({'CommentView':this['_config']['CommentView']},_0x2598f6)),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',(_0x51ba01,_0x73bfd1)=>_0x51ba01||!!_0x73bfd1),this['bind']('isUnlinked')['to'](_0x2c94a1,'unlinkedAt',_0x25b4b8=>!!_0x25b4b8);let _0xfc522c=null;const _0x4a4c9b=()=>{const _0x3ba14e=this['_model']['comments']['first']||null;_0x3ba14e!==_0xfc522c&&(_0xfc522c&&this['stopListening'](_0xfc522c,'change:content'),_0xfc522c=_0x3ba14e,_0x3ba14e&&this['listenTo'](_0x3ba14e,'change:content',_0x4a4c9b));const _0x4cc381=_0x3ba14e?_0x3ba14e['author']['name']:this['_localUser']['name'],_0x59b2b6=_0x3ba14e?new DOMParser()['parseFromString'](_0x6448ca(_0x3ba14e['content'],{'limit':this['_config']['maxCommentCharsWhenCollapsed']}),'text/html')['body']['textContent']:'',_0x12a7a9=Et(this['locale'],'COMMENT_THREAD_LABEL',[this['length'],_0x4cc381]);this['set']('ariaLabel',_0x59b2b6?_0x12a7a9+'\x20'+_0x59b2b6:_0x12a7a9);};this['listenTo'](this['_model']['comments'],'change',_0x4a4c9b),_0x4a4c9b(),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x1d3923(),this['keystrokes']=new _0x172e53(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0xfdf1a8=>_0xfdf1a8['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0xb2f554(this,this['focusables']);}async destroy(){this['isDirty']=!0x1,this['commentsListView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}_createCommentThreadInputView(){const _0x55694f=new xt(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x549e86=_0x55694f['commentInputView'];return _0x55694f['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x549e86,'value',(_0x56b504,_0x42cb19,_0x4944ae,_0x3b643e,_0x7cc841)=>!!_0x7cc841||!!_0x3b643e&&_0x4944ae&&!_0x42cb19||_0x56b504&&_0x4944ae&&!_0x42cb19),_0x549e86['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x745be6,_0x242709,_0x46a585)=>{let _0x5330b9;return _0x5330b9=_0x46a585&&_0x242709?'Reply\x20to\x20reopen\x20discussion...':_0x745be6?'Reply...':'Write\x20a\x20comment...',Et(this['locale'],_0x5330b9);}),_0x549e86['bind']('submitLabel')['to'](this,'length',_0xe37e56=>Et(this['locale'],_0xe37e56?'Reply':'Comment')),_0x549e86['on']('submit',(_0x6d6823,_0x7d2392)=>{this['fire']('addComment',_0x7d2392),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x549e86['on']('cancel',()=>{this['focus']();}),_0x549e86['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x549e86['on']('cancel',_0x45a005=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x45a005['stop']());}),this['on']('change:isActive',(_0x40b907,_0xdcf872,_0x36f100)=>{_0x36f100||this['length']||_0x549e86['value']||this['fire']('removeCommentThread');}),_0x55694f;}};const Ft=/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x451317(Ht);var Ut=class extends Ft{commentThreadChildren;containerElement;resolveButton;_boundFirstCommentView;constructor(_0x49afac,_0xd980be,_0x4a4f59,_0x55e05d){super(_0x49afac,_0xd980be,_0x4a4f59,_0x55e05d),this['commentThreadChildren']=this['createCollection']([this['commentsListView'],this['commentThreadInputView'],this['ariaDescriptionView']]),this['set']('actionIndicator',null),this['containerElement']=null,this['_boundFirstCommentView']=null,this['locale']=_0x49afac,this['resolveButton']=this['_createResolveButton'](),this['setTemplate'](this['getTemplate']()),this['on']('change:isActive',(_0x2eec21,_0x33f3aa,_0x556433)=>{_0x556433||this['_cancelAllConfirms']();}),this['listenTo'](this['_model'],'change:isReadOnly',(_0x584e43,_0x472a6a,_0x3e6390)=>{_0x3e6390&&this['_cancelAllConfirms']();}),this['length']>0x0&&this['_bindFirstCommentView'](),this['listenTo'](this['commentsListView']['commentViews'],'add',()=>{this['_bindFirstCommentView']();});}getTemplate(){const _0x438458=this['bindTemplate'];return{'tag':'div','attributes':{'class':['ck','ck-thread','ck-reset_all-excluded','ck-rounded-corners',_0x438458['if']('isActive','ck-thread--active'),_0x438458['if']('isUnlinked','ck-thread--unlinked'),_0x438458['to']('actionIndicator',_0x9f337a=>_0x9f337a?'ck-thread--'+_0x9f337a:'')],'data-thread-id':this['_model']['id'],'tabindex':0x0,'role':'listitem','aria-label':_0x438458['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 _0x16dab3 of this['commentsListView']['commentViews'])_0x16dab3['cancelConfirm']();}_bindFirstCommentView(){const {locale:_0x5847c4}=this,_0x509075=this['commentsListView']['commentViews']['get'](0x0);_0x509075===this['_boundFirstCommentView']||_0x509075['isSystemComment']||(this['_boundFirstCommentView']=_0x509075,this['unbind']('actionIndicator'),this['bind']('actionIndicator')['to'](_0x509075,'actionIndicator',_0x2b4192=>'remove'===_0x2b4192?'remove':null),_0x509075['placeholder']=Et(_0x5847c4,'Write\x20a\x20comment...'),_0x509075['removeButton']['on']('execute',_0x3387c0=>{_0x3387c0['stop'](),this['showConfirm'](Et(_0x5847c4,'Delete\x20comment\x20thread?'),this['containerElement'])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),this['on']('removeConfirm',()=>{_0x509075['focus']();}),_0x509075['actionBar']['add'](this['resolveButton'],0x0),_0x509075['focusables']['add'](this['resolveButton'],0x0));}_createResolveButton(){const _0x2a5e81=new _0x18b828(this['locale']);return _0x2a5e81['label']=Et(this['locale'],'Resolve'),_0x2a5e81['tooltip']=Et(this['locale'],'Resolve'),_0x2a5e81['icon']=_0x259a04,_0x2a5e81['extendTemplate']({'attributes':{'class':'ck-comment--resolve'}}),_0x2a5e81['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x5b7707=>!_0x5b7707),_0x2a5e81['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x38d97e,_0x315b27)=>_0x38d97e&&!_0x315b27),_0x2a5e81['on']('execute',()=>{this['fire']('resolveCommentThread',this['_model']['id']);}),_0x2a5e81;}_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']));}},Wt=class extends ht{constructor(_0xa7e6c4){super(_0xa7e6c4),this['set']('content',''),this['setTemplate']({'tag':'div','attributes':{'class':['ck-content','ck-comment__content','ck-annotation__content']}});}['render'](){super['render'](),this['on']('change:content',(_0x47c7d3,_0x2a2a91,_0x19f0c7)=>{this['element']['innerHTML']=_0x19f0c7;}),this['element']['innerHTML']=this['content'];}},Kt=class extends ht{['visibleView'];ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];constructor(_0x4923aa,_0x23a52e,_0x32daac){super(_0x4923aa),this['_model']=_0x23a52e,this['_config']=_0x32daac,this['isSystemComment']=!!this['_config']['isSystemComment'],this['set']('isEditMode',!0x1),this['set']('isCollapsed',!0x0),this['bind']('ariaLabel')['to'](_0x23a52e,'content',_0x23a52e,'authoredAt',(_0x2a24aa,_0x50d8b6)=>Et(_0x4923aa,'COMMENT_ARIA_LABEL',[_0x23a52e['author']['name'],_0x32daac['formatDateTime'](_0x50d8b6),new DOMParser()['parseFromString'](_0x2a24aa,'text/html')['body']['textContent'],_0x23a52e['isExternal']?this['getExternalCommentNote']():''])),this['ariaDescriptionView']=new _0x4f8e71(_0x4923aa,Et(_0x4923aa,'COMMENT_THREAD_DESCRIPTION')),this['visibleView']=this['createCollection'](),this['visibleView']['add'](this['_createCommentContentView']()),this['focusables']=new at(),this['focusTracker']=new _0x1d3923(),this['keystrokes']=new _0x172e53(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x2e2683=>_0x2e2683['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']?Et(this['locale'],'EXTERNAL_IMPORT_WORD_COMMENT'):Et(this['locale'],'EXTERNAL_COMMENT');}getUserViewNotificationText(){return this['_model']['isExternal']?'importWord'===this['_model']['attributes']['@external']['source']?Et(this['locale'],'EXTERNAL_IMPORT_WORD_AVATAR',this['_model']['creator']['name']):Et(this['locale'],'EXTERNAL_AVATAR',this['_model']['creator']['name']):null;}_createCommentContentView(){const _0x290d60=new Wt(this['locale']);return _0x290d60['bind']('content')['to'](this['_model'],'content',this,'isCollapsed',(_0x1febcd,_0x2e5e83)=>_0x2e5e83?_0x6448ca(_0x1febcd,{'limit':this['_config']['maxCommentCharsWhenCollapsed']}):_0x1febcd),_0x290d60;}_createCommentInputView(){this['_config']['editorConfig']||(this['_config']['editorConfig']={}),this['_config']['editorConfig']['initialData']=this['_model']['content'];const _0x22539b=new St(this['locale'],this['_config']['editorConfig']);return _0x22539b['value']=this['_model']['content'],_0x22539b['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x22539b['submitLabel']=Et(this['locale'],'Save'),_0x22539b['on']('submit',(_0x1206c3,_0x2097af)=>{this['fire']('updateComment',this['_model']['id'],_0x2097af),this['switchToDisplayMode'](),this['focus']();}),_0x22539b['on']('cancel',()=>{this['switchToDisplayMode'](),this['focus']();}),_0x22539b['once']('editorReady',()=>{_0x22539b['focus']();}),_0x22539b['createEditor'](),_0x22539b['delegate']('editorReady')['to'](this),_0x22539b['delegate']('editorDestroyed')['to'](this),_0x22539b;}_setupKeyboardNavigation(){const _0xa21377=this['element'];this['keystrokes']['listenTo'](_0xa21377);for(const _0x5021a6 of this['focusables'])this['focusTracker']['add'](_0x5021a6['element']),this['keystrokes']['listenTo'](_0x5021a6['element']);this['focusables']['on']('change',(_0x19e00c,_0x556c83)=>{for(const _0x42f316 of _0x556c83['removed'])this['focusTracker']['remove'](_0x42f316['element']),this['keystrokes']['stopListening'](_0x42f316['element']);for(const _0x5637f6 of _0x556c83['added'])this['focusTracker']['add'](_0x5637f6['element']),this['keystrokes']['listenTo'](_0x5637f6['element']);}),this['keystrokes']['set']('enter',(_0x16512e,_0x2c3ca0)=>{_0xa21377===_0x16512e['target']&&(this['focusCycler']['focusFirst'](),_0x2c3ca0());}),this['keystrokes']['set']('esc',(_0x3461f0,_0x501c74)=>{_0xa21377!==_0x3461f0['target']&&(this['focus'](),_0x501c74());});}};const Gt=/* #__PURE__ -- @preserve */
|
|
28
|
+
_0x451317(Kt);var Yt=class extends Gt{actionBar;['userView'];constructor(_0x3303c2,_0x1bada9,_0x1fc5c9){super(_0x3303c2,_0x1bada9,_0x1fc5c9),this['set']('actionIndicator',null),this['set']('placeholder',Et(_0x3303c2,'Reply...')),this['bind']('authoredAt')['to'](_0x1bada9),this['bind']('resolvedAt')['to'](_0x1bada9),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 _0x9b3755(_0x3303c2,_0x1bada9['author'],this['getUserViewNotificationText']()),this['userView']['extendTemplate']({'attributes':{'class':['ck-comment__user','ck-annotation__user'],'aria-hidden':!0x0}}),this['listenTo'](_0x1bada9,'change:isRemovable',()=>this['cancelConfirm']()),this['setTemplate'](this['getTemplate']());}getTemplate(){const _0x26688f=this['bindTemplate'],_0x2aa7f1=[{'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':_0x26688f['to']('authoredAt'),'class':['ck-comment__info-time','ck-annotation__info-time']},'children':[{'text':_0x26688f['to']('authoredAt',_0x55f933=>this['_config']['formatDateTime'](_0x55f933))}]}]},{'tag':'div','attributes':{'class':['ck-comment__actions','ck-annotation__actions',_0x26688f['if']('isEditMode','ck-comment__actions--hidden'),_0x26688f['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']&&_0x2aa7f1['push']({'tag':'div','attributes':{'class':['ck-comment__external']},'children':[{'text':this['getExternalCommentNote']()}]}),{'tag':'li','attributes':{'class':['ck-comment__wrapper'],'tabindex':-0x1,'aria-label':_0x26688f['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id'],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck-comment','ck-annotation',_0x26688f['if']('isEditMode','ck-comment--edit'),_0x26688f['if']('isSystemComment','ck-comment--info'),_0x26688f['to']('actionIndicator',_0x30bf6d=>_0x30bf6d?'ck-comment--'+_0x30bf6d:'')],'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':_0x2aa7f1}]}]};}_createEditButton(){const _0x8f8cfc=new _0x126747(this['locale']);return _0x8f8cfc['label']=Et(this['locale'],'Edit'),_0x8f8cfc['icon']=_0x3bdce3,_0x8f8cfc['withText']=!0x0,_0x8f8cfc['extendTemplate']({'attributes':{'class':'ck-comment--edit'}}),_0x8f8cfc['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x41b95c=>!_0x41b95c),_0x8f8cfc['bind']('isVisible')['to'](this['_model'],'isEditable'),_0x8f8cfc['on']('execute',()=>this['switchToEditMode']()),_0x8f8cfc;}_createRemoveButton(){const _0x37dfc4=new _0x126747(this['locale']);return _0x37dfc4['label']=Et(this['locale'],'Remove'),_0x37dfc4['icon']=_0x22bfcd,_0x37dfc4['withText']=!0x0,_0x37dfc4['extendTemplate']({'attributes':{'class':'ck-comment--remove'}}),_0x37dfc4['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x539373=>!_0x539373),_0x37dfc4['bind']('isVisible')['to'](this['_model'],'isRemovable'),_0x37dfc4['on']('execute',()=>{this['showConfirm'](Et(this['locale'],'Delete\x20comment?'),this['element'])['then'](()=>{this['fire']('removeComment',this['_model']['id']);});}),_0x37dfc4;}_createDropdown(){const _0x2ef3fc=ct(this['locale'],_0x2ec44f),_0xcf9445=_0x2ef3fc['panelView']['children'],_0x41f342=new ot(this['locale']),_0x2175b6=_0x2ef3fc['bindTemplate'];dt(_0x2ef3fc,()=>this['items']['find'](_0x2b18de=>_0x2b18de['isVisible'])),_0x2ef3fc['extendTemplate']({'attributes':{'class':[_0x2175b6['if']('isVisible','ck-hidden',_0x39ebba=>!_0x39ebba)]}});const _0x49a6e0=(_0x166242,_0xca0768=-0x1)=>{const _0x3e1a32=new nt(this['locale']);_0x3e1a32['children']['add'](_0x166242);const _0x106d5c=_0xca0768>-0x1?_0xca0768:_0x41f342['items']['length'];_0x41f342['items']['add'](_0x3e1a32,_0x106d5c);const _0x283ecc=Array['from'](this['items']);_0x2ef3fc['unbind']('isEnabled','isVisible'),_0x2ef3fc['bind']('isEnabled')['toMany'](_0x283ecc,'isEnabled',(..._0x55092d)=>_0x55092d['some'](_0x5c0fc1=>_0x5c0fc1)),_0x2ef3fc['bind']('isVisible')['toMany'](_0x283ecc,'isVisible',(..._0x5e946c)=>_0x5e946c['some'](_0x452750=>_0x452750));};_0x2ef3fc['panelPosition']='sw',_0x2ef3fc['buttonView']['set']({'label':Et(this['locale'],'Show\x20more\x20items'),'icon':_0x13dae8});for(const _0x4788ee of this['items'])_0x49a6e0(_0x4788ee);return _0xcf9445['add'](_0x41f342),_0x2ef3fc['listenTo'](this['items'],'add',(_0x581403,_0x18a4e2,_0x3566f0)=>{_0x49a6e0(_0x18a4e2,_0x3566f0);}),_0x2ef3fc['listenTo'](this['items'],'remove',(_0x2cab52,_0x1a4b9e,_0x4cb255)=>{_0x41f342['items']['remove'](_0x4cb255);}),_0x2ef3fc;}_attachActions(_0x50e3c6,_0x432eef){const _0x1ef164=_0x50e3c6&&_0x50e3c6['element'];_0x1ef164&&(this['listenTo'](_0x1ef164,'mouseenter',()=>this['actionIndicator']=_0x432eef),this['listenTo'](_0x1ef164,'focus',()=>this['actionIndicator']=_0x432eef),this['listenTo'](_0x1ef164,'mouseleave',()=>this['actionIndicator']=null),this['listenTo'](_0x1ef164,'blur',()=>this['actionIndicator']=null));}_createCommentInputView(){const _0x366f1f=super['_createCommentInputView']();return _0x366f1f['bind']('placeholder')['to'](this),_0x366f1f;}['render'](){super['render'](),this['_attachActions'](this['editButton'],'edit'),this['_attachActions'](this['removeButton'],'remove');}};function Xt(_0x2988de){const _0x34ad84=_0x8dd7ca(_0x2988de,0x1e),_0x21ca7b=new MutationObserver(_0x2f2f8f=>{for(const _0x7d378 of _0x2f2f8f)('attributes'==_0x7d378['type']&&'class'==_0x7d378['attributeName']||'childList'==_0x7d378['type']||'characterData'==_0x7d378['type'])&&_0x34ad84();});return{'attach'(_0x3becda){_0x21ca7b['observe'](_0x3becda,{'attributes':!0x0,'childList':!0x0,'subtree':!0x0,'characterData':!0x0});},'detach'(){_0x21ca7b['disconnect'](),_0x34ad84['cancel']();}};}var qt=class extends ht{['focusTracker'];['id'];keystrokes;content;['mainView'];_mutationObserver;constructor(_0x2fccca,_0x46a708){super(_0x2fccca),this['id']=_0x5c5379(),this['focusTracker']=new _0x1d3923(),this['keystrokes']=new _0x172e53(),this['keystrokes']['set']('Esc',(_0x560a5a,_0x4a5c74)=>this['fire']('Esc',_0x4a5c74)),this['set']('targetRect',{'top':0x0,'right':0x0,'bottom':0x0,'left':0x0}),this['set']('height',0x0),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['set']('length',0x0),this['set']('type',''),this['_mutationObserver']=Xt(()=>this['_updateHeight']()),this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this),this['content']['add'](_0x46a708),this['mainView']=_0x46a708;const _0xc53aea=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-annotation-wrapper','ck-rounded-corners',_0xc53aea['if']('isActive','ck-annotation-wrapper--active')],'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['focusTracker']['add'](this['element']),this['keystrokes']['listenTo'](this['element']),this['_mutationObserver']['attach'](this['element']);}destroy(){this['content']['clear'](),this['keystrokes']['destroy'](),this['focusTracker']['destroy'](),this['_mutationObserver']['detach'](),super['destroy']();}['focus'](){this['content']['first']&&this['content']['first']['focus']();}_updateHeight(){const _0xa7560e=this['element']['clientHeight'];_0xa7560e&&(this['height']=_0xa7560e);}};const jt=/* #__PURE__ -- @preserve */
|
|
29
|
+
_0x178707();var $t=class Annotation extends jt{['view'];focusableElements;_type;_target;constructor({view:_0xe21ea2,target:_0x2e3324,type:_0x24c6cc,isVisible:_0x3ad57c=!0x0}){super(),this['view']=_0xe21ea2,this['view']['element']||this['view']['render'](),this['_type']=_0x24c6cc,this['_target']=_0x2e3324,Annotation['_assertCorrectTarget'](this['_getNormalizedTarget']()),this['focusableElements']=new _0x549ed4([this['view']['element']],{'idProperty':'_id'}),this['focusableElements']['on']('add',(_0x4bf70a,_0x22490b)=>{this['view']['focusTracker']['add'](_0x22490b);}),this['focusableElements']['on']('remove',(_0x150abf,_0x496bd6)=>{this['view']['focusTracker']['remove'](_0x496bd6);}),this['set']('isVisible',_0x3ad57c);}get type(){return'function'==typeof this['_type']?this['_type']():this['_type'];}get['innerView'](){return this['view']['mainView'];}get target(){const _0x56ecec=this['_getNormalizedTarget']();return Annotation['_assertCorrectTarget'](_0x56ecec),_0x56ecec;}get targetRect(){const _0x36a1b5=this['target'];if(null===_0x36a1b5)return null;if(_0x36a1b5 instanceof _0x2a80a4)return _0x36a1b5;const _0x413818=_0x36a1b5['filter'](_0x33e439=>function(_0x4f2c56){return!!_0x4f2c56['offsetParent']||!!_0x4f2c56['getClientRects']()['item'](0x0);}(_0x33e439));return 0x0===_0x413818['length']?null:_0x2a80a4['getDomElementRects'](_0x413818[0x0])[0x0];}get isActive(){return this['view']['isActive'];}set isActive(_0x2798ae){this['view']['isActive']=_0x2798ae,this['view']['mainView']['isActive']=_0x2798ae;}updateTargetRect(){this['view']['targetRect']=this['targetRect'];}destroy(){this['focusableElements']['stopListening'](),this['focusableElements']['clear'](),this['stopListening']();}refreshVisibility(){this['isVisible']=!!this['targetRect'];}static _assertCorrectTarget(_0x155d44){if(!(null===_0x155d44||_0x155d44 instanceof _0x2a80a4||Array['isArray'](_0x155d44)&&_0x155d44['every'](_0x3269cd=>zt(_0x3269cd))))throw new _0x50ddc5('annotation-invalid-target',null,{'target':_0x155d44});}_getNormalizedTarget(){const _0x181121='function'==typeof this['_target']?this['_target']():this['_target'];return zt(_0x181121)?[_0x181121]:_0x181121;}};function zt(_0x13054a){return null!==_0x13054a&&'object'==typeof _0x13054a&&'nodeType'in _0x13054a&&0x1===_0x13054a['nodeType'];}var Jt=class extends _0x549ed4{_innerViewToAnnotation;_viewToAnnotation;['_focusTracker'];constructor(_0x3343f7=[]){super(),this['_innerViewToAnnotation']=new Map(),this['_viewToAnnotation']=new Map(),this['_focusTracker']=new _0x1d3923(),this['_focusTracker']['on']('change:isFocused',(_0x1aad2b,_0x3b686f,_0x1b9f59)=>{_0x1b9f59||this['fire']('blur');});for(const _0x1a2091 of _0x3343f7)this['add'](_0x1a2091);}get['isFocused'](){return this['_focusTracker']['isFocused'];}['add'](_0x1a2856){if(this['has'](_0x1a2856))throw new _0x50ddc5('annotationcollection-duplicated-item',null);this['_innerViewToAnnotation']['set'](_0x1a2856['innerView'],_0x1a2856),this['_viewToAnnotation']['set'](_0x1a2856['view'],_0x1a2856);for(const _0x2d40d8 of _0x1a2856['focusableElements'])this['_focusTracker']['add'](_0x2d40d8);if(this['listenTo'](_0x1a2856['focusableElements'],'add',(_0x26ea0b,_0x3633e1)=>{this['_focusTracker']['add'](_0x3633e1);}),this['listenTo'](_0x1a2856['focusableElements'],'remove',(_0x3fd52c,_0x30f498)=>{this['_focusTracker']['remove'](_0x30f498);}),this['listenTo'](_0x1a2856['view']['focusTracker'],'change:isFocused',(_0x30018c,_0x21cec7,_0x3a0671)=>{_0x3a0671&&this['fire']('focus',_0x1a2856);}),_0x1a2856['updateTargetRect'](),this['_areCachedRectsStale']()){for(const _0xb8360a of this)_0xb8360a['updateTargetRect']();}const _0x4f7a6c=this['_getOrderInContent'](_0x1a2856['view']['targetRect']);return super['add'](_0x1a2856,_0x4f7a6c);}['remove'](_0x99c65){if(!this['has'](_0x99c65))throw new _0x50ddc5('annotationcollection-not-existing-item',null);this['stopListening'](_0x99c65['view']['focusTracker']),this['stopListening'](_0x99c65['focusableElements']);for(const _0x40a1e1 of _0x99c65['focusableElements'])this['_focusTracker']['remove'](_0x40a1e1);return this['_viewToAnnotation']['delete'](_0x99c65['view']),this['_innerViewToAnnotation']['delete'](_0x99c65['innerView']),super['remove'](_0x99c65);}getByInnerView(_0x1fa28f){return this['_innerViewToAnnotation']['get'](_0x1fa28f);}getByView(_0x17f56e){return this['_viewToAnnotation']['get'](_0x17f56e);}destroy(){super['clear'](),this['stopListening'](),this['_innerViewToAnnotation']['clear'](),this['_viewToAnnotation']['clear'](),this['_focusTracker']['destroy']();}refreshPositioning(){for(const _0x2a9494 of this)_0x2a9494['updateTargetRect']();this['_sort']();}_sort(){const _0x1c24a5=Array['from'](this)['sort']((_0xdc59fc,_0x1c4902)=>Zt(_0xdc59fc['view']['targetRect'],_0x1c4902['view']['targetRect']));for(let _0x4e24f7=_0x1c24a5['length']-0x1;_0x4e24f7>0x0;_0x4e24f7--){const _0x4e9b9a=_0x1c24a5[_0x4e24f7];_0x4e24f7!==this['getIndex'](_0x4e9b9a)&&(this['remove'](_0x4e9b9a),this['add'](_0x4e9b9a));}}_getOrderInContent(_0x123bc5){let _0x4af7d0=0x0;if(!_0x123bc5)return this['length'];for(const _0x1cef7d of this){const _0x3beb19=_0x1cef7d['view']['targetRect'];if(_0x3beb19){if(Zt(_0x123bc5,_0x3beb19)<0x0)return _0x4af7d0;_0x4af7d0++;}}return _0x4af7d0;}_areCachedRectsStale(){const _0x2e8358=this['get'](0x0);if(!_0x2e8358)return!0x1;const _0xf677bc=_0x2e8358['view']['targetRect'],_0xdeeb2d=_0x2e8358['targetRect'];return!(!_0xf677bc||!_0xdeeb2d)&&(_0xf677bc['top']!==_0xdeeb2d['top']||_0xf677bc['left']!==_0xdeeb2d['left']);}};function Qt({source:_0x5946ea,target:_0x10bd17,filter:_0x969937}){for(const _0x1b2370 of _0x5946ea)_0x969937(_0x1b2370)&&_0x10bd17['add'](_0x1b2370);_0x10bd17['listenTo'](_0x5946ea,'add',(_0x506ac7,_0x7ff957)=>{_0x969937(_0x7ff957)&&_0x10bd17['add'](_0x7ff957);}),_0x10bd17['listenTo'](_0x5946ea,'remove',(_0x534887,_0x1bf6b4)=>{_0x10bd17['has'](_0x1bf6b4)&&_0x10bd17['remove'](_0x1bf6b4);});}function Zt(_0x3358e7,_0x421ef7){if(null===_0x3358e7&&null===_0x421ef7)return 0x0;if(null===_0x3358e7)return-0x1;if(null===_0x421ef7)return 0x1;const _0x3bb544=_0x3358e7['top']-_0x421ef7['top'];return 0x0==_0x3bb544?_0x3358e7['left']-_0x421ef7['left']:_0x3bb544;}var ti=class extends _0x333ed9{collection;_visibleAnnotations;static get['pluginName'](){return'Annotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x276be1){if(super(_0x276be1),this['collection']=new Jt(),this['_visibleAnnotations']=new Jt(),this['set']('activeAnnotations',new Set()),this['_bindAnnotationsToVisibleAnnotations'](),_0x276be1 instanceof _0x25e8b1){const _0xa4d801=_0x276be1['locale'];_0x276be1['accessibility']['addKeystrokeInfoGroup']({'id':'annotations','label':Et(_0xa4d801,'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'),'keystrokes':[{'label':Et(_0xa4d801,'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'),'keystroke':'Ctrl+Shift+E'},{'label':Et(_0xa4d801,'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'),'keystroke':'Esc'},{'label':Et(_0xa4d801,'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'),'keystroke':'Enter'},{'label':Et(_0xa4d801,'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'),'keystroke':[['Tab'],['Shift+Tab']]},{'label':Et(_0xa4d801,'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'),'keystroke':['Ctrl+Enter']},{'label':Et(_0xa4d801,'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'),'keystroke':[['Arrowup'],['Arrowdown']]}]});}this['_setupEnterAnnotationKeystroke'](),this['_setupEscapeAnnotationHandling']();}['add'](_0x1c877b){this['collection']['add'](_0x1c877b);}['remove'](_0x175916){this['collection']['remove'](_0x175916),_0x175916['destroy']();}refreshVisibility(){for(const _0x4b0bf2 of this['collection'])_0x4b0bf2['refreshVisibility']();}refreshPositioning(){this['_visibleAnnotations']['refreshPositioning']();}getByInnerView(_0x5df193){return this['collection']['getByInnerView'](_0x5df193);}deactivateAll(){this['fire']('_deactivateAllAnnotations');}destroy(){for(const _0x37cf28 of this['collection'])_0x37cf28['destroy']();this['_visibleAnnotations']['destroy'](),this['collection']['destroy'](),super['destroy']();}activate(_0x1c86e4){this['fire']('_activateAnnotation',_0x1c86e4);}createAnnotation(_0x5c1cd1){return new $t(_0x5c1cd1);}createAnnotationView(_0x9704a3,_0x3752a3){return new qt(_0x9704a3,_0x3752a3);}_addActiveAnnotation(_0x4b1834){const _0x400e75=new Set(this['activeAnnotations']);_0x400e75['add'](_0x4b1834),this['activeAnnotations']=_0x400e75;}_removeActiveAnnotation(_0x2f91cc){const _0xa9278=new Set(this['activeAnnotations']);_0xa9278['delete'](_0x2f91cc),this['activeAnnotations']=_0xa9278;}_bindAnnotationsToVisibleAnnotations(){const _0x4863e1=this['collection'],_0x191cd3=this['_visibleAnnotations'];function _0x51bee4(_0x3634c2){const _0x2eb306=_0x3634c2['source'];_0x2eb306['isVisible']&&!_0x191cd3['has'](_0x2eb306)?_0x191cd3['add'](_0x2eb306):!_0x2eb306['isVisible']&&_0x191cd3['has'](_0x2eb306)&&_0x191cd3['remove'](_0x2eb306),_0x2eb306['view']['focusTracker']['remove'](_0x2eb306['view']['element']),_0x2eb306['view']['focusTracker']['add'](_0x2eb306['view']['element']);}this['listenTo'](_0x4863e1,'add',(_0x1afe04,_0x5d17ce)=>{_0x5d17ce['isVisible']&&_0x191cd3['add'](_0x5d17ce),this['listenTo'](_0x5d17ce,'change:isVisible',_0x51bee4);}),this['listenTo'](_0x4863e1,'remove',(_0x131c4f,_0x4cbcd6)=>{_0x191cd3['has'](_0x4cbcd6)&&_0x191cd3['remove'](_0x4cbcd6),this['stopListening'](_0x4cbcd6,'change:isVisible',_0x51bee4);});}_setupEnterAnnotationKeystroke(){const _0x521318=_0x5f3488=>{_0x5f3488['on']('ready',()=>{_0x5f3488['keystrokes']['set'](_0x2f9b22,(_0x1dc778,_0x384e27)=>{const _0x19c88f=_0x9c8dae(this['activeAnnotations']['values']());_0x19c88f&&(_0x19c88f['view']['focus'](),_0x384e27());});});};this['context']instanceof _0x25e8b1?_0x521318(this['context']):this['context']['editors']&&this['context']['editors']['on']('add',(_0x1db447,_0x4018d7)=>{_0x521318(_0x4018d7);});}_setupEscapeAnnotationHandling(){const _0x6130de=_0xcd08ed=>{const _0x2a13ef=_0xcd08ed['source'],_0x31d84d=[];let _0x5cd020;if(Array['isArray'](_0x2a13ef['target'])){_0x5cd020=_0x2a13ef['target'][0x0],this['context']instanceof _0x25e8b1?_0x31d84d['push'](this['context']):this['context']['editors']&&_0x31d84d['push'](...this['context']['editors']);for(const _0x724c61 of _0x31d84d)for(const _0x5be50d of _0x724c61['editing']['view']['domRoots']['values']())if(_0x5be50d['contains'](_0x5cd020))return void _0x724c61['editing']['view']['focus']();_0x5cd020['focus']();}};this['listenTo'](this['collection'],'add',(_0x3fa929,_0x2c3296)=>{this['listenTo'](_0x2c3296,'escape',_0x6130de,{'priority':'low'});}),this['listenTo'](this['collection'],'remove',(_0x10690c,_0x2bfe83)=>{this['stopListening'](_0x2bfe83,'escape',_0x6130de);});}};const ii=Symbol('noChannel'),ei={'admin':!0x0,'modifyAll':!0x1,'write':!0x0,'resolve':!0x0},si=/* #__PURE__ -- @preserve */
|
|
30
|
+
_0x178707(),ni=/* #__PURE__ -- @preserve */
|
|
31
|
+
_0x178707();var oi=class extends _0x333ed9{_threads;_threadToController;_viewToController;static get requires(){return[ti,_0x2e4006,_0x1b2b4f];}static get['pluginName'](){return'CommentsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x33642){super(_0x33642),this['_threads']=new Map(),this['_threadToController']=new Map(),this['_viewToController']=new Map(),this['set']('_readOnlyChannels',new Set()),this['set']('_permissions',new Map());const _0x512b84=this['context']['config'];_0x512b84['define']('comments.maxCommentsWhenCollapsed',0x2),_0x512b84['define']('comments.maxThreadTotalWeight',0x1f4),_0x512b84['define']('comments.maxCommentCharsWhenCollapsed',0x8c),_0x512b84['define']('comments.CommentThreadView',Ut),_0x512b84['define']('comments.CommentView',Yt),_0x512b84['get']('comments.editorConfig')||console['warn']('Missing\x20comments\x20editor\x20configuration\x20(`comments.editorConfig`).\x20Default\x20configuration\x20will\x20be\x20used\x20instead.');}init(){const _0x52bd85=this['context']['plugins']['get'](ti);this['set']('activeCommentThread',null),this['on']('addCommentThread',(_0x4d5a71,_0x532186)=>this['_addCommentThread'](_0x532186)),this['on']('submitCommentThread',(_0x1bc6d2,_0x4fdd76)=>this['_submitCommentThread'](_0x4fdd76)),this['on']('resolveCommentThread',(_0x110e6a,_0x4e35dc)=>this['_resolveCommentThread'](_0x4e35dc)),this['on']('resolveCommentThread',(_0x485725,_0x39fea2)=>this['_updateActiveAnnotation'](_0x39fea2),{'priority':'lowest'}),this['on']('reopenCommentThread',(_0x41318e,_0x196cd7)=>this['_reopenCommentThread'](_0x196cd7)),this['on']('reopenCommentThread',(_0x46288f,_0x47d5f4)=>this['_updateActiveAnnotation'](_0x47d5f4),{'priority':'lowest'}),this['on']('removeCommentThread',(_0x324293,_0x40ad91)=>this['_removeCommentThread'](_0x40ad91)),this['on']('updateCommentThread',(_0x24c0bf,_0x265e14)=>this['_updateCommentThread'](_0x265e14)),this['on']('updateCommentThread',(_0x3ceeb0,_0x3955f0)=>this['_updateActiveAnnotation'](_0x3955f0),{'priority':'lowest'}),this['on']('addComment',(_0x50c202,_0x180089)=>this['_addComment'](_0x180089)),this['on']('updateComment',(_0x3d9b21,_0x37649b)=>this['_updateComment'](_0x37649b)),this['on']('removeComment',(_0x213b87,_0x420c39)=>this['_removeComment'](_0x420c39)),this['on']('addComment',(_0xf73502,{threadId:_0x5092c6,isFromAdapter:_0x86cc00})=>{if(_0x86cc00)return;const _0x51698a=this['getCommentThread'](_0x5092c6),_0x2d1287=_0x51698a&&this['_threadToController']['get'](_0x51698a);_0x2d1287&&_0x2d1287['view']['commentsListView']['focus'](-0x1);},{'priority':'lowest'}),this['listenTo'](_0x52bd85,'change:activeAnnotations',(_0x3fd12d,_0x365a5d,_0x551e53)=>{const _0xcb9977=Array['from'](_0x551e53)['map'](_0x5b6222=>this['_viewToController']['get'](_0x5b6222['innerView']))['filter'](Boolean)[0x0];this['activeCommentThread']=_0xcb9977?_0xcb9977['model']:null;});}set adapter(_0x191cbb){if(this['_adapter'])throw new _0x50ddc5('commentsrepository-adapter-already-set');this['_adapter']=_0x191cbb;}get adapter(){return this['_adapter'];}addCommentThread({channelId:_0x436f4d=ii,threadId:_0x1fa77e=_0x5c5379(),comments:_0x1feecf=[],unlinkedAt:_0xad8076=null,resolvedAt:_0x368d08=null,resolvedBy:_0x5bcdbc=null,target:_0x3211a3=null,context:_0x2aa4a7=null,attributes:_0xc38aa={},isResolvable:_0x1cf366=!0x0,isSubmitted:_0x4bc6f8=!0x1,isFromAdapter:_0x1b8212=!0x1}={}){return this['fire'](ai('addCommentThread',_0x436f4d),{'channelId':_0x436f4d,'threadId':_0x1fa77e,'comments':_0x1feecf,'unlinkedAt':_0xad8076,'resolvedAt':_0x368d08,'resolvedBy':_0x5bcdbc,'target':_0x3211a3,'context':_0x2aa4a7,'attributes':_0xc38aa,'isFromAdapter':_0x1b8212,'isResolvable':_0x1cf366,'isSubmitted':_0x4bc6f8}),this['getCommentThread'](_0x1fa77e);}openNewCommentThread({channelId:_0x2c7ee2=ii,threadId:_0x526625=_0x5c5379(),target:_0xec307,context:_0xebb6e1=null,isResolvable:_0x89012a=!0x0}){if(this['_readOnlyChannels']['has'](_0x2c7ee2)||this['_readOnlyChannels']['has'](void 0x0))return null;if(!_0xec307)throw new _0x50ddc5('commentsrepository-missing-target');const _0x2cc874=this['addCommentThread']({'channelId':_0x2c7ee2,'threadId':_0x526625,'target':_0xec307,'context':_0xebb6e1,'isResolvable':_0x89012a});if(!_0x2cc874)return null;const _0x4a38b6=this['_threadToController']['get'](_0x2cc874),_0x4c54aa=_0x4a38b6['view']['commentThreadInputView']['commentInputView'],_0x526684=this['context']['plugins']['get'](ti),_0x560839=_0x526684['getByInnerView'](_0x4a38b6['view']);return _0x526684['activate'](_0x560839),_0x4c54aa['once']('editorReady',()=>_0x4c54aa['focus']()),_0x2cc874;}hasCommentThread(_0x5e4e74){if('string'!=typeof _0x5e4e74)throw new _0x50ddc5('commentsrepository-invalid-comment-thread-id');return this['_threads']['has'](_0x5e4e74);}updateCommentThread({channelId:_0x23626f=ii,threadId:_0x19d465,context:_0x70c988,unlinkedAt:_0xc2ef6e,attributes:_0xc9b0c8,isFromAdapter:_0x5a7c88=!0x1}){return this['fire'](ai('updateCommentThread',_0x23626f),{'channelId':_0x23626f,'threadId':_0x19d465,'context':_0x70c988,'unlinkedAt':_0xc2ef6e,'attributes':_0xc9b0c8,'isFromAdapter':_0x5a7c88}),this['getCommentThread'](_0x19d465);}getCommentThread(_0x4f1eb4){if('string'!=typeof _0x4f1eb4)throw new _0x50ddc5('commentsrepository-invalid-comment-thread-id');return this['_threads']['get'](_0x4f1eb4);}fetchCommentThread({channelId:_0x222a3b,threadId:_0x1c7d50}={}){const _0x4f4c04=this['getCommentThread'](_0x1c7d50);if(_0x4f4c04)return Promise['resolve'](_0x4f4c04);if(!this['adapter'])return Promise['resolve'](void 0x0);if('function'!=typeof this['adapter']['getCommentThread'])throw new _0x50ddc5('commentsrepository-missing-thread-and-adapter-method',this['context']);return this['adapter']['getCommentThread']({'channelId':_0x222a3b,'threadId':_0x1c7d50})['then'](_0x1180d6=>this['hasCommentThread'](_0x1c7d50)?this['getCommentThread'](_0x1c7d50):_0x1180d6?this['addCommentThread'](Object['assign']({'isFromAdapter':!0x0,'channelId':_0x222a3b},_0x1180d6)):void 0x0)['catch'](_0x1dda6d=>{throw console['error'](_0x1dda6d),new _0x50ddc5('commentsrepository-fetch-comment-thread',this['context']);});}getCommentThreads({channelId:_0x4a3a21,skipNotAttached:_0x509674=!0x1,skipEmpty:_0x1cc449=!0x1,toJSON:_0x5a7073=!0x1}={}){const _0xaff3af=[];for(const _0x41fe15 of this['_threads']['values']())_0x4a3a21&&_0x41fe15['channelId']!==_0x4a3a21||_0x509674&&!_0x41fe15['isAttached']||_0x1cc449&&0x0===_0x41fe15['length']||_0xaff3af['push'](_0x41fe15);return _0x5a7073?_0xaff3af['map'](_0x3df936=>_0x3df936['toJSON']()):_0xaff3af;}getAnnotationForCommentThread(_0x317883){const _0x27c2f8=this['_threadToController']['get'](_0x317883);return _0x27c2f8&&this['context']['plugins']['get'](ti)['getByInnerView'](_0x27c2f8['view'])||null;}getCommentThreadForAnnotation(_0x5ac887){const _0x3d1ba9=this['_viewToController']['get'](_0x5ac887['innerView']);return _0x3d1ba9?_0x3d1ba9['model']:null;}setActiveCommentThread(_0xd9c8ce){const _0x317ed6=this['context']['plugins']['get'](ti);if(!_0xd9c8ce)return void(this['activeCommentThread']&&_0x317ed6['deactivateAll']());const _0x4c3505=this['getCommentThread'](_0xd9c8ce);if(!_0x4c3505)throw new _0x50ddc5('commentsrepository-active-missing-comment-thread',null,{'threadId':_0xd9c8ce});if(!this['_threadToController']['has'](_0x4c3505))throw new _0x50ddc5('commentsrepository-active-not-attached',null,{'threadId':_0xd9c8ce});const _0x483d96=_0x317ed6['getByInnerView'](this['_threadToController']['get'](_0x4c3505)['view']);_0x317ed6['activate'](_0x483d96);}switchReadOnly(_0x1cee2b,_0x396162){_0x1cee2b?this['_readOnlyChannels']['add'](_0x396162):this['_readOnlyChannels']['delete'](_0x396162),this['fire']('change:_readOnlyChannels','_readOnlyChannels',this['_readOnlyChannels'],this['_readOnlyChannels']);}['isReadOnly'](_0x53926b){return this['_readOnlyChannels']['has'](_0x53926b)||this['_readOnlyChannels']['has'](void 0x0);}createCommentThreadController(_0x5c9e3b,_0x2ea539){return new bt(_0x5c9e3b,_0x2ea539);}setPermissions(_0x5e35d8,_0x1e1d7a=ii){this['_permissions']['set'](_0x1e1d7a,_0x5e35d8),this['fire']('change:_permissions','_permissions',this['_permissions'],this['_permissions']);}getPermissions(_0xc06acc=ii){return this['_permissions']['has'](_0xc06acc)?this['_permissions']['get'](_0xc06acc):ei;}_addCommentThread({channelId:_0x485aba,threadId:_0x5814c8,comments:_0x591346,unlinkedAt:_0x11ecbb,resolvedAt:_0x289aa7,resolvedBy:_0x31b2d9,target:_0x28b306,context:_0x3cb7ca,attributes:_0xb2ad81,isFromAdapter:_0x5895cf,isResolvable:_0x243efd,isSubmitted:_0x138d1f}){if('string'!=typeof _0x5814c8)throw new _0x50ddc5('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x5814c8});if(this['hasCommentThread'](_0x5814c8))throw new _0x50ddc5('commentsrepository-duplicated-comment-thread-id',null,{'threadId':_0x5814c8});const _0x5b11a0=new ri(this,{'channelId':_0x485aba,'id':_0x5814c8,'context':_0x3cb7ca,'attributes':_0xb2ad81,'unlinkedAt':_0x11ecbb,'resolvedAt':_0x289aa7,'resolvedBy':_0x31b2d9?this['context']['plugins']['get'](_0x1b2b4f)['getUser'](_0x31b2d9):null,'isResolvable':_0x243efd,'isSubmitted':_0x138d1f||_0x5895cf});this['_threads']['set'](_0x5814c8,_0x5b11a0);for(const _0x77fea of _0x591346)_0x5b11a0['_add'](this['_createNewComment']({'threadId':_0x5814c8,..._0x77fea}));return _0x28b306&&_0x5b11a0['attachTo'](_0x28b306),_0x5895cf||!_0x5b11a0['length']?Promise['resolve']():this['_submitCommentThread']({'channelId':_0x485aba,'threadId':_0x5814c8});}_submitCommentThread({channelId:_0x9146c9,threadId:_0x3c89ab}){if(!this['hasCommentThread'](_0x3c89ab))throw new _0x50ddc5('commentsrepository-missing-comment-thread',this);const _0x2badcf=this['getCommentThread'](_0x3c89ab);if(_0x2badcf['_isSubmitted']=!0x0,!this['adapter']||'function'!=typeof this['adapter']['addCommentThread'])return Promise['resolve']();const {id:_0xa45a75,comments:_0x68e5e2,resolvedAt:_0x5485d5,resolvedBy:_0x4a760f,context:_0x160e90,attributes:_0x1953e4}=_0x2badcf,_0x3b225f=this['context']['plugins']['get']('PendingActions'),_0xa42b50=_0x3b225f['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['addCommentThread']({'channelId':_0x9146c9,'threadId':_0xa45a75,'comments':_0x68e5e2['map'](_0x35c9ff=>_0x35c9ff['toJSON']()),'resolvedAt':_0x5485d5,'resolvedBy':_0x4a760f?_0x4a760f['id']:_0x4a760f,'context':_0x160e90,'attributes':_0x1953e4})['then'](({comments:_0xd22c9e})=>{_0x3b225f['remove'](_0xa42b50);for(const _0x363a93 of _0xd22c9e)this['_updateComment']({'channelId':_0x9146c9,'threadId':_0x3c89ab,'commentId':_0x363a93['commentId'],'createdAt':_0x363a93['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x48bf17=>{throw console['error'](_0x48bf17),new _0x50ddc5('commentsrepository-add-comment-thread-internal-error',this);});}_attachCommentThread({threadId:_0x50ca6c,target:_0x3dba11}){const _0x341d8d=this['getCommentThread'](_0x50ca6c);if(!_0x341d8d)throw new _0x50ddc5('commentsrepository-attach-missing-comment-thread',this);const _0x30f4a9=this['context']['plugins']['get']('PendingActions'),_0x2f29c2=this['context']['plugins']['get'](ti),_0x3322d6=this['_createCommentThreadView'](_0x341d8d),_0x3a2598=new bt(_0x341d8d,_0x3322d6);let _0x32cac2=null;_0x3322d6['on']('change:isDirty',(_0x55f557,_0x5b5842,_0x1c2300)=>{_0x1c2300?_0x32cac2=_0x30f4a9['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD')):_0x32cac2&&(_0x30f4a9['remove'](_0x32cac2),_0x32cac2=null);}),this['_threadToController']['set'](_0x341d8d,_0x3a2598),this['_viewToController']['set'](_0x3322d6,_0x3a2598);const _0x319a2e=new qt(this['context']['locale'],_0x3322d6);_0x319a2e['bind']('length')['to'](_0x3322d6),_0x319a2e['bind']('isDirty')['to'](_0x3322d6,'isDirty',_0x3322d6,'length',(_0x17eaa6,_0x53325a)=>_0x17eaa6||!_0x53325a),_0x319a2e['bind']('isActive')['to'](_0x3322d6),_0x319a2e['type']='comment';const _0x36ec75=new $t({'view':_0x319a2e,'target':_0x3dba11,'type':'comment','isVisible':!_0x341d8d['archivedAt']&&!!('function'==typeof _0x3dba11?_0x3dba11():_0x3dba11)});return _0x3322d6['on']('escape',()=>{_0x36ec75['fire']('escape');}),this['_bindAnnotationToEditors'](_0x3322d6,_0x36ec75),_0x2f29c2['add'](_0x36ec75),_0x36ec75;}_bindAnnotationToEditors(_0x3b0c3e,_0x12141e){this['listenTo'](_0x3b0c3e,'editorReady',(_0x216c3d,_0x1d3acd)=>{const _0x1af560=_0x1d3acd['ui']['view']['body']['bodyCollectionContainer'];_0x12141e['focusableElements']['add'](_0x1af560),this['context']instanceof _0x25e8b1&&this['context']['ui']['focusTracker']['add'](_0x1af560);},{'priority':'highest'}),this['listenTo'](_0x3b0c3e,'editorDestroyed',(_0xce8c69,_0x271c54)=>{const _0x1cb917=_0x271c54['ui']['view']['body']['bodyCollectionContainer'];_0x12141e['focusableElements']['has'](_0x1cb917)&&_0x12141e['focusableElements']['remove'](_0x1cb917),this['context']instanceof _0x25e8b1&&this['context']['ui']['focusTracker']['remove'](_0x1cb917);});}_unbindEditors(_0x323206){this['stopListening'](_0x323206,'editorReady'),this['stopListening'](_0x323206,'editorDestroyed');}_createCommentThreadView(_0x35f4fe){const _0xf9821b=this['context']['plugins']['get'](_0x1b2b4f),{config:_0x4f9544,locale:_0x3977cd}=this['context'],_0x1148a1=_0x474445(_0x4f9544['get']('locale'),_0x3977cd);return new(0x0,(_0x4f9544['get']('comments'))['CommentThreadView'])(_0x3977cd,_0x35f4fe,_0xf9821b['me'],{'editorConfig':{..._0x4f9544['get']('comments.editorConfig'),'licenseKey':this['context']['config']['get']('licenseKey')},'copyMarkers':_0x4f9544['get']('comments.copyMarkers'),'maxCommentsWhenCollapsed':_0x4f9544['get']('comments.maxCommentsWhenCollapsed'),'maxThreadTotalWeight':_0x4f9544['get']('comments.maxThreadTotalWeight'),'maxCommentCharsWhenCollapsed':_0x4f9544['get']('comments.maxCommentCharsWhenCollapsed'),'formatDateTime':_0x1148a1,'CommentView':_0x4f9544['get']('comments')['CommentView']});}_resolveCommentThread({threadId:_0x1bd68e,channelId:_0x104b87,resolvedAt:_0x352289,resolvedBy:_0x49cc82,isFromAdapter:_0x2dbc8f}){if(!this['hasCommentThread'](_0x1bd68e))throw new _0x50ddc5('commentsrepository-missing-comment-thread',null,{'threadId':_0x1bd68e});const _0x4f025b=this['getCommentThread'](_0x1bd68e);if(_0x4f025b['isResolved'])throw new _0x50ddc5('commentsrepository-resolved-comment-thread',null,{'threadId':_0x1bd68e});const _0x2e07a6=this['context']['plugins']['get'](_0x1b2b4f);if(_0x4f025b['resolvedBy']=_0x2e07a6['getUser'](_0x49cc82),_0x4f025b['resolvedAt']=_0x352289,_0x2dbc8f||!this['adapter']||'function'!=typeof this['adapter']['resolveCommentThread'])return Promise['resolve']();const _0x1f2311=this['context']['plugins']['get']('PendingActions'),_0x118973=_0x1f2311['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['resolveCommentThread']({'channelId':_0x104b87,'threadId':_0x1bd68e})['then'](({resolvedAt:_0x589154,resolvedBy:_0x475d60})=>{_0x1f2311['remove'](_0x118973),_0x4f025b['resolvedBy']['id']!==_0x475d60&&(_0x4f025b['resolvedBy']=_0x2e07a6['getUser'](_0x475d60)),_0x4f025b['resolvedAt']=_0x589154;})['catch'](_0x32a9e9=>{throw console['error'](_0x32a9e9),new _0x50ddc5('commentsrepository-resolve-comment-thread-internal-error',this);});}_reopenCommentThread({threadId:_0x1f840b,channelId:_0x378c42,isFromAdapter:_0x20ec22}){if(!this['hasCommentThread'](_0x1f840b))throw new _0x50ddc5('commentsrepository-missing-comment-thread',null,{'threadId':_0x1f840b});const _0x556f1e=this['getCommentThread'](_0x1f840b);if(!_0x556f1e['isResolved'])throw new _0x50ddc5('commentsrepository-reopen-comment-thread',null,{'threadId':_0x1f840b});if(_0x556f1e['resolvedBy']=null,_0x556f1e['resolvedAt']=null,_0x20ec22||!this['adapter']||'function'!=typeof this['adapter']['reopenCommentThread'])return Promise['resolve']();const _0x4b6609=this['context']['plugins']['get']('PendingActions'),_0x1e8349=_0x4b6609['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['reopenCommentThread']({'channelId':_0x378c42,'threadId':_0x1f840b})['then'](()=>_0x4b6609['remove'](_0x1e8349))['catch'](_0x304c95=>{throw console['error'](_0x304c95),new _0x50ddc5('commentsrepository-reopen-comment-thread-internal-error',this);});}_removeCommentThread({threadId:_0x116f0a,isFromAdapter:_0xeb3ce4}){const _0x3585fc=this['getCommentThread'](_0x116f0a);if(!_0x3585fc)throw new _0x50ddc5('commentsrepository-remove-missing-comment-thread',this);if(this['_detachCommentThread'](_0x116f0a),this['_threads']['delete'](_0x116f0a),!_0x3585fc['isSubmitted']||_0xeb3ce4||!this['adapter']||'function'!=typeof this['adapter']['removeCommentThread'])return Promise['resolve']();const _0x464d9b=this['context']['plugins']['get']('PendingActions'),{channelId:_0x557a60}=_0x3585fc,_0x1c56e2=_0x464d9b['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeCommentThread']({'channelId':_0x557a60,'threadId':_0x116f0a})['then'](()=>_0x464d9b['remove'](_0x1c56e2))['catch'](_0x288018=>{throw console['error'](_0x288018),new _0x50ddc5('commentsrepository-remove-comment-thread-internal-error',this);});}_updateCommentThread({threadId:_0x3a0ec6,unlinkedAt:_0xa89629,context:_0x182786,attributes:_0x5c39ca,isFromAdapter:_0x20336d}){if('string'!=typeof _0x3a0ec6)throw new _0x50ddc5('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x3a0ec6});if(!this['hasCommentThread'](_0x3a0ec6))throw new _0x50ddc5('commentsrepository-missing-comment-thread',null,{'threadId':_0x3a0ec6});const _0x104761=this['getCommentThread'](_0x3a0ec6);let _0x5a5f40=!0x1;if(void 0x0!==_0x182786&&_0x104761['context']!==_0x182786&&(_0x104761['context']=_0x182786,_0x5a5f40=!0x0),void 0x0!==_0xa89629&&_0x104761['unlinkedAt']!==_0xa89629&&(_0x104761['unlinkedAt']=_0xa89629,_0x5a5f40=!0x0),_0x5c39ca&&!_0x19f69e(_0x5c39ca,_0x104761['attributes'])&&(_0x104761['attributes']=_0x5c39ca,_0x5a5f40=!0x0),!_0x5a5f40)return Promise['resolve']();if(!_0x104761['isSubmitted']||_0x20336d||!this['adapter']||'function'!=typeof this['adapter']['updateCommentThread'])return Promise['resolve']();const _0x487166=this['context']['plugins']['get']('PendingActions'),{channelId:_0x53b7b0}=_0x104761,_0x512163=_0x487166['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateCommentThread']({'channelId':_0x53b7b0,'threadId':_0x3a0ec6,'context':_0x182786,'unlinkedAt':_0xa89629,'attributes':_0x5c39ca})['then'](()=>_0x487166['remove'](_0x512163))['catch'](_0x464680=>{throw console['error'](_0x464680),new _0x50ddc5('commentsrepository-update-comment-thread-internal-error',this);});}_detachCommentThread(_0x31882c){const _0x4f7e43=this['context']['plugins']['get'](ti),_0x16471f=this['getCommentThread'](_0x31882c);if(_0x16471f['_isAttached']=!0x1,this['_threadToController']['has'](_0x16471f)){const _0xf3c2bc=this['_threadToController']['get'](_0x16471f),_0x1364b4=_0xf3c2bc['view'],_0x3b4d15=_0x4f7e43['getByInnerView'](_0x1364b4);this['_threadToController']['delete'](_0x16471f),this['_viewToController']['delete'](_0x1364b4),_0x3b4d15&&_0x4f7e43['remove'](_0x3b4d15),_0xf3c2bc['destroy'](),_0x1364b4['destroy']()['then'](()=>{this['_unbindEditors'](_0x1364b4);});}}_updateActiveAnnotation({threadId:_0x17600d,resolvedAt:_0x23d294,unlinkedAt:_0xc0357d}){const _0x5d8ef4=!!_0x23d294,_0x226b1c=this['context']['plugins']['get'](ti),_0x45d3e8=this['getCommentThread'](_0x17600d);if(this['_threadToController']['has'](_0x45d3e8)){const _0x209fff=this['_threadToController']['get'](_0x45d3e8)['view'],_0x12dee9=_0x226b1c['getByInnerView'](_0x209fff);_0x12dee9&&(_0x5d8ef4&&_0x226b1c['_removeActiveAnnotation'](_0x12dee9),_0xc0357d?_0x12dee9['isVisible']=!0x1:_0x12dee9['refreshVisibility']());}}_getExternalAuthor(_0x1b7d3d){const _0x8c8962=this['context']['plugins']['get'](_0x1b2b4f),_0x3ac154=_0x544dfc('external:'+_0x1b7d3d),_0x31e0eb=_0x8c8962['getUser'](_0x3ac154);return _0x31e0eb||_0x8c8962['addUser']({'id':_0x3ac154,'name':_0x1b7d3d});}_createNewComment({threadId:_0x58eb5f,commentId:_0x4200f4=_0x5c5379(),content:_0x196c10,authorId:_0xbeb407,createdAt:_0x3a131f,attributes:_0x360a5e}){if('string'!=typeof _0x4200f4)throw new _0x50ddc5('commentsrepository-invalid-commentid');if('string'!=typeof _0xbeb407)throw new _0x50ddc5('commentsrepository-invalid-comment-authorid');if('string'!=typeof _0x196c10||!_0x196c10['trim']())throw new _0x50ddc5('commentsrepository-invalid-comment-content');const _0x4703b5=this['context']['plugins']['get'](_0x1b2b4f)['getUser'](_0xbeb407);if(!_0x4703b5)throw new _0x50ddc5('commentsrepository-add-comment-user-not-exists',null,{'authorId':_0xbeb407});let _0x3e539d=null,_0x59f9f8=_0x3a131f;return _0x360a5e?.['@external']&&(_0x3e539d=this['_getExternalAuthor'](_0x360a5e['@external']['authorName']),_0x59f9f8=new Date(_0x360a5e['@external']['createdAt'])),new hi(this,{'threadId':_0x58eb5f,'id':_0x4200f4,'author':_0x3e539d||_0x4703b5,'creator':_0x4703b5,'content':_0x196c10,'createdAt':_0x3a131f,'authoredAt':_0x59f9f8,'attributes':_0x360a5e});}_addComment(_0x114661){let {threadId:_0x3a8a4c,content:_0xa2837c,attributes:_0x2e74b4,isFromAdapter:_0x515da6}=_0x114661;const _0x42c573=this['getCommentThread'](_0x114661['threadId']);if(!_0x42c573)throw new _0x50ddc5('commentsrepository-add-comment-to-missing-comment-thread',this);const _0x8dd8a8=this['_createNewComment'](_0x114661),{id:_0x1cc62d}=_0x8dd8a8;if(_0x42c573['_add'](_0x8dd8a8),_0x515da6||!this['adapter']||'function'!=typeof this['adapter']['addComment']||!_0x42c573['isSubmitted'])return Promise['resolve']();const _0x1cc0aa=this['context']['plugins']['get']('PendingActions'),{channelId:_0x2d9114}=_0x42c573,_0x5c420a=_0x1cc0aa['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return _0x2e74b4||(_0x2e74b4={}),this['adapter']['addComment']({'channelId':_0x2d9114,'threadId':_0x3a8a4c,'commentId':_0x1cc62d,'content':_0xa2837c,'attributes':_0x2e74b4})['then'](_0x3b799e=>{_0x1cc0aa['remove'](_0x5c420a),_0x3b799e&&this['_updateComment']({'channelId':_0x2d9114,'threadId':_0x3a8a4c,'commentId':_0x1cc62d,'createdAt':_0x3b799e['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x1e55a4=>{throw console['error'](_0x1e55a4),new _0x50ddc5('commentsrepository-add-comment-internal-error',this);});}_updateComment({threadId:_0x3bdc96,commentId:_0x429b55,content:_0x32a95a,createdAt:_0x5d1414,attributes:_0x5b0094,isFromAdapter:_0x1b907f}){if(void 0x0!==_0x32a95a&&('string'!=typeof _0x32a95a||!_0x32a95a['trim']()['length']))throw new _0x50ddc5('commentsrepository-update-comment-invalid-content');const _0x2ac22a=this['getCommentThread'](_0x3bdc96),_0x5e9644=_0x2ac22a['getComment'](_0x429b55);if(!_0x5e9644)throw new _0x50ddc5('commentsrepository-update-missing-comment',this);let _0x7af8e1=!0x1;if(_0x32a95a&&_0x32a95a!==_0x5e9644['content']&&(_0x5e9644['isEditable']||_0x1b907f)&&(_0x5e9644['content']=_0x32a95a,_0x7af8e1=!0x0),_0x5d1414&&_0x5d1414!==_0x5e9644['createdAt']&&(_0x5e9644['createdAt']=_0x5d1414,_0x5e9644['isExternal']||(_0x5e9644['authoredAt']=_0x5d1414),_0x7af8e1=!0x0),_0x5b0094&&!_0x19f69e(_0x5b0094,_0x5e9644['attributes'])&&(_0x5e9644['attributes']=_0x5b0094,_0x7af8e1=!0x0),!_0x7af8e1)return Promise['resolve']();if(_0x2ac22a['fire']('commentUpdated'),_0x1b907f||!this['adapter']||'function'!=typeof this['adapter']['updateComment'])return Promise['resolve']();const _0x362742=this['context']['plugins']['get']('PendingActions'),{channelId:_0x200790}=this['getCommentThread'](_0x5e9644['threadId']),_0x4b5e54=_0x362742['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateComment']({'channelId':_0x200790,'threadId':_0x3bdc96,'commentId':_0x429b55,'content':_0x32a95a,'attributes':_0x5b0094})['then'](()=>_0x362742['remove'](_0x4b5e54))['catch'](_0xe19846=>{throw console['error'](_0xe19846),new _0x50ddc5('commentsrepository-update-comment-internal-error',this);});}_removeComment({threadId:_0x36dc40,commentId:_0x45c0db,isFromAdapter:_0x196657}){const _0x15eb5f=this['getCommentThread'](_0x36dc40),_0x215ea8=_0x15eb5f['getComment'](_0x45c0db);if(!_0x215ea8)throw new _0x50ddc5('commentsrepository-remove-missing-comment',this);if(_0x15eb5f['_remove'](_0x215ea8),_0x196657||!this['adapter']||'function'!=typeof this['adapter']['removeComment'])return Promise['resolve']();const _0x2be21f=this['context']['plugins']['get']('PendingActions'),{channelId:_0x5c3e5f}=_0x15eb5f,_0x2d1522=_0x2be21f['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeComment']({'channelId':_0x5c3e5f,'threadId':_0x36dc40,'commentId':_0x45c0db})['then'](()=>_0x2be21f['remove'](_0x2d1522))['catch'](_0x230173=>{throw console['error'](_0x230173),new _0x50ddc5('commentsrepository-remove-comment-internal-error',this);});}},ri=class extends si{['channelId'];['id'];_isAttached;_isSubmitted;comments;_repository;constructor(_0x2d240f,_0x49177c){super();const _0x4ad0ee=_0x49177c['isResolvable'];this['channelId']=_0x49177c['channelId'],this['id']=_0x49177c['id'],this['comments']=new _0x549ed4(),this['_repository']=_0x2d240f,this['_isAttached']=!0x1,this['_isSubmitted']=_0x49177c['isSubmitted'],this['set']('_hasTargetInContent',!0x0),this['bind']('isReadOnly')['to'](_0x2d240f,'_permissions',_0x2d240f,'_readOnlyChannels',()=>_0x2d240f['isReadOnly'](this['channelId'])),this['bind']('isRemovable')['to'](_0x2d240f,'_permissions',()=>_0x2d240f['getPermissions'](this['channelId'])['admin']),this['bind']('canComment')['to'](_0x2d240f,'_permissions',()=>{const _0x5b14d9=_0x2d240f['getPermissions'](this['channelId']);return _0x5b14d9['write']||_0x5b14d9['admin'];}),this['bind']('isResolvable')['to'](_0x2d240f,'_permissions',()=>_0x4ad0ee&&_0x2d240f['getPermissions'](this['channelId'])['resolve']),this['set']('context',_0x49177c['context']),this['bind']('archivedAt')['to'](this,'resolvedAt',this,'unlinkedAt',(_0x39625d,_0x1fddc7)=>_0x39625d?_0x1fddc7?_0x39625d<_0x1fddc7?_0x39625d:_0x1fddc7:_0x39625d:_0x1fddc7),this['set']('unlinkedAt',_0x49177c['unlinkedAt']||null),this['set']('resolvedAt',_0x49177c['resolvedAt']||null),this['set']('resolvedBy',_0x49177c['resolvedBy']||null),this['bind']('isResolved')['to'](this,'resolvedAt',_0x251ceb=>!!_0x251ceb),this['set']('attributes',_0x49177c['attributes']||{});}get weight(){return Array['from'](this['comments'])['reduce']((_0x4f9796,_0x111185)=>_0x4f9796+_0x111185['weight'],0x0);}get length(){return this['comments']['length'];}get isAttached(){return this['_isAttached'];}get isSubmitted(){return this['_isSubmitted'];}submit(){const {channelId:_0x54ef40,id:_0x225eaa}=this;this['_repository']['fire'](ai('submitCommentThread',_0x54ef40),{'channelId':_0x54ef40,'threadId':_0x225eaa});}setUnlinkedAt(_0x16228e){this['_update']({'unlinkedAt':_0x16228e});}['resolve']({resolvedAt:_0x398db1=new Date(),resolvedBy:_0x42728a='',isFromAdapter:_0x4f9e82=!0x1}={}){const _0x303f03=this['_repository']['context']['plugins']['get'](_0x1b2b4f)['me'],{channelId:_0x2f7e50,id:_0xd86ce0}=this;this['_repository']['fire'](ai('resolveCommentThread',_0x2f7e50),{'channelId':_0x2f7e50,'threadId':_0xd86ce0,'resolvedAt':_0x398db1,'resolvedBy':_0x42728a||_0x303f03['id'],'isFromAdapter':_0x4f9e82});}['reopen']({isFromAdapter:_0x131426=!0x1}={}){const {channelId:_0x22a8c1,id:_0x20f630}=this;this['_repository']['fire'](ai('reopenCommentThread',_0x22a8c1),{'channelId':_0x22a8c1,'threadId':_0x20f630,'isFromAdapter':_0x131426});}setContext(_0x1285d2){this['context']||this['_update']({'context':_0x1285d2});}setAttribute(_0x5ae314,_0x10ca10){const _0x4fd181=_0x267281(this['attributes']);_0x5a9c0d(_0x4fd181,_0x5ae314,_0x10ca10),this['_update']({'attributes':_0x4fd181});}removeAttribute(_0xbe576){const _0x3e8a7d=_0x267281(this['attributes']);_0x43de5a(_0x3e8a7d,_0xbe576),this['_update']({'attributes':_0x3e8a7d});}['remove']({isFromAdapter:_0x4efb60=!0x1}={}){const {channelId:_0x3edf80,id:_0xd6f7be}=this;this['_repository']['fire'](ai('removeCommentThread',_0x3edf80),{'channelId':_0x3edf80,'threadId':_0xd6f7be,'isFromAdapter':_0x4efb60});}attachTo(_0x3dbbe0){return this['_repository']['_attachCommentThread']({'threadId':this['id'],'target':_0x3dbbe0});}addComment(_0x2f2094){const {channelId:_0x43c582,id:_0x170008}=this;this['_repository']['fire'](ai('addComment',_0x43c582,_0x170008),Object['assign']({'channelId':_0x43c582,'threadId':_0x170008},_0x2f2094));}getComment(_0x4cafdd){if('string'!=typeof _0x4cafdd)throw new _0x50ddc5('commentsrepository-get-comment-invalid-id',null,{'commentId':_0x4cafdd});return this['comments']['get'](_0x4cafdd);}toJSON(){return{'threadId':this['id'],'context':this['context'],'unlinkedAt':this['unlinkedAt'],'resolvedAt':this['resolvedAt'],'resolvedBy':this['resolvedBy']?this['resolvedBy']['id']:null,'archivedAt':this['archivedAt'],'comments':this['comments']['map'](_0x109ef1=>_0x109ef1['toJSON']()),'attributes':this['attributes']};}['_add'](_0x52ded9){return this['listenTo'](_0x52ded9,'change:authoredAt',()=>{const _0x3f64fc=this['_findOptimalIndex'](_0x52ded9),_0x5c883c=this['comments'];_0x3f64fc-0x1!=_0x5c883c['getIndex'](_0x52ded9)&&_0x3f64fc+0x1!=_0x5c883c['getIndex'](_0x52ded9)&&(this['_remove'](_0x52ded9),this['_add'](_0x52ded9));}),this['comments']['add'](_0x52ded9,this['_findOptimalIndex'](_0x52ded9));}_update(_0x256a77){const {channelId:_0x2cac85,id:_0x424e0f}=this;this['_repository']['fire'](ai('updateCommentThread',_0x2cac85),{..._0x256a77,'channelId':_0x2cac85,'threadId':_0x424e0f});}['_remove'](_0x3708a6){return this['stopListening'](_0x3708a6),_0x3708a6['destroy'](),this['comments']['remove'](_0x3708a6);}_findOptimalIndex(_0x4ee4c3){const _0x27899f=this['comments']['find'](_0x419927=>new Date(_0x419927['authoredAt'])['getTime']()>new Date(_0x4ee4c3['authoredAt'])['getTime']());return _0x27899f?this['comments']['getIndex'](_0x27899f):this['length'];}},hi=class extends ni{['id'];threadId;author;creator;createdAt;_repository;constructor(_0x1eec33,_0xa704b6){super();const _0x357124=_0x1eec33['context']['plugins']['get'](_0x1b2b4f)['me'],_0x394e0b=_0x1eec33['getCommentThread'](_0xa704b6['threadId']),_0x1a0e79=0x0===_0x394e0b['comments']['length'],_0x45edfa=_0x357124===_0xa704b6['author'];this['id']=_0xa704b6['id'],this['threadId']=_0xa704b6['threadId'],this['author']=_0xa704b6['author'],this['creator']=_0xa704b6['creator'],this['set']('content',_0xa704b6['content']),this['createdAt']=_0xa704b6['createdAt']||new Date(),this['set']('authoredAt',_0xa704b6['authoredAt']||new Date()),this['bind']('resolvedAt')['to'](_0x394e0b,'resolvedAt'),this['set']('attributes',_0xa704b6['attributes']||{}),this['bind']('isEditable')['to'](_0x1eec33,'_permissions',()=>{const _0x3006cb=_0x1eec33['getPermissions'](_0x394e0b['channelId'])['write'],_0x2f851b=_0x1eec33['getPermissions'](_0x394e0b['channelId'])['modifyAll'];return _0x45edfa&&_0x3006cb||!_0x45edfa&&_0x2f851b;}),this['bind']('isRemovable')['to'](_0x394e0b,'isRemovable',_0x1eec33,'_permissions',_0x527ff6=>{const _0x3eff5a=_0x1eec33['getPermissions'](_0x394e0b['channelId'])['write'],_0x2cb349=_0x1eec33['getPermissions'](_0x394e0b['channelId'])['modifyAll'];return _0x45edfa&&_0x3eff5a||_0x527ff6&&_0x1a0e79||!_0x45edfa&&_0x2cb349&&!_0x1a0e79;}),this['bind']('isReadOnly')['to'](_0x394e0b,'isReadOnly'),this['_repository']=_0x1eec33;}get isExternal(){return Boolean(this['attributes']&&this['attributes']['@external']);}get weight(){return Math['max'](function(_0x3d9be8){const _0x5936fb=document['createElement']('div');return _0x5936fb['innerHTML']=_0x3d9be8,_0x5936fb['textContent']['length'];}(this['content']),0xc8);}update(_0x3ab0cc){const {threadId:_0x187f27,id:_0x584c52}=this;if(!this['_repository']['hasCommentThread'](_0x187f27))throw new _0x50ddc5('commentsrepository-update-comment-missing-comment-thread',this);const {channelId:_0x4ba58f}=this['_repository']['getCommentThread'](_0x187f27);this['_repository']['fire'](ai('updateComment',_0x4ba58f,_0x187f27),{'channelId':_0x4ba58f,'threadId':_0x187f27,'commentId':_0x584c52,..._0x3ab0cc});}setAttribute(_0x225ce5,_0x4547a9){const _0x1bd838=_0x267281(this['attributes']);_0x5a9c0d(_0x1bd838,_0x225ce5,_0x4547a9),this['update']({'attributes':_0x1bd838});}removeAttribute(_0xcc853c){const _0x4e4b27=_0x267281(this['attributes']);_0x43de5a(_0x4e4b27,_0xcc853c),this['update']({'attributes':_0x4e4b27});}['remove'](_0xf1d06f={}){if(!_0xf1d06f['isFromAdapter']&&!this['isRemovable'])return;const {threadId:_0x80b0ef,id:_0x15b608}=this;if(!this['_repository']['hasCommentThread'](_0x80b0ef))throw new _0x50ddc5('commentsrepository-remove-comment-missing-comment-thread',this);const {channelId:_0x15fa89}=this['_repository']['getCommentThread'](_0x80b0ef);this['_repository']['fire'](ai('removeComment',_0x15fa89,_0x80b0ef),{'channelId':_0x15fa89,'threadId':_0x80b0ef,'commentId':_0x15b608,..._0xf1d06f});}toJSON(){return{'commentId':this['id'],'content':this['content'],'createdAt':this['createdAt'],'authorId':this['creator']['id'],'attributes':this['attributes']};}destroy(){this['stopListening']();}};function ai(_0x3d8e7a,..._0x5adf08){for(const _0x90c179 of _0x5adf08)void 0x0!==_0x90c179&&(_0x3d8e7a+=':'+String(_0x90c179));return _0x3d8e7a;}var ci=class extends _0x412ddc{constructor(_0x43dd06){super(_0x43dd06),this['set']('hasContent',!0x1);}['refresh'](){const _0x485537=this['editor']['model']['document']['selection'];this['isEnabled']=!0x0,this['hasContent']=!0x1;for(const _0x310b14 of _0x485537['getRanges']())if(this['_hasContent'](_0x310b14))return void(this['hasContent']=!0x0);}execute({threadId:_0x59d259=_0x5c5379(),ranges:_0x6c412d,comment:_0x444c03}={}){const _0x5bc4ba=this['editor']['model'],_0x20c9f3=_0x6c412d??Array['from'](_0x5bc4ba['document']['selection']['getRanges']()),_0x37d719=[];for(const _0x4b665d of _0x20c9f3)this['_hasContent'](_0x4b665d)&&_0x37d719['push'](this['_trimToContent'](_0x4b665d));if(!_0x37d719['length'])throw new _0x50ddc5('addcommentthreadcommand-incorrect-ranges',null);_0x444c03&&this['_createCommentThread'](_0x59d259,_0x444c03),this['_createMarkersFromRanges'](_0x59d259,_0x37d719,!!_0x444c03);}_createMarkersFromRanges(_0x4587ae,_0x3c13af,_0x1d18ba){this['editor']['model']['change'](_0x527021=>{for(const _0x2f18ce of _0x3c13af){const _0x524893='comment:'+_0x4587ae+':'+_0x5c5379()['substr'](0x1,0x5);_0x527021['addMarker'](_0x524893,{'range':_0x2f18ce,'usingOperation':_0x1d18ba,'affectsData':_0x1d18ba});}});}_createCommentThread(_0x1a6d5f,_0x446a23){const _0x16ab9b=this['editor']['plugins']['get']('CommentsRepository'),_0x695e76=this['editor']['config']['get']('collaboration.channelId'),_0x9120e=this['editor']['plugins']['get']('Users')['me'];if(!_0x9120e)throw new _0x50ddc5('addcommentthreadcommand-user-not-found',null);_0x16ab9b['addCommentThread']({'threadId':_0x1a6d5f,'channelId':_0x695e76,'comments':[{'authorId':_0x9120e['id'],'content':_0x446a23,'createdAt':new Date(),'attributes':{}}]});}_hasContent(_0x2efb66){for(const _0xa20c33 of _0x2efb66['getItems']())if(this['_itemIsContent'](_0xa20c33))return!0x0;return!0x1;}_itemIsContent(_0x32bc8f){return _0x32bc8f['is']('$textProxy')||this['editor']['model']['schema']['isObject'](_0x32bc8f)&&!_0x32bc8f['is']('element','tableCell');}_trimToContent(_0x2bb3e4){const _0x3c6235=_0x25054a=>!this['_itemIsContent'](_0x25054a['item']),_0x1dc21b=_0x2bb3e4['start']['getLastMatchingPosition'](_0x3c6235),_0x4d3ab6=_0x2bb3e4['end']['getLastMatchingPosition'](_0x3c6235,{'direction':'backward'});return this['editor']['model']['createRange'](_0x1dc21b,_0x4d3ab6);}},di=class extends _0x3de2ea{_dataCollectors;_editorAnnotations;static get requires(){return[ti];}static get['pluginName'](){return'EditorAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x28ba55){super(_0x28ba55),this['_dataCollectors']=new Set(),this['_editorAnnotations']=new Set();}init(){const _0xa6abc=this['editor'],_0x417026=_0xa6abc['model']['document']['selection'],_0x28771b=_0x174c5f(()=>this['refreshSelectedViews'](),0xa);_0x417026['on']('change:range',(_0x14fac3,_0x18bbf5)=>{_0x18bbf5['directChange']&&(_0x28771b['cancel'](),this['refreshSelectedViews']());}),this['listenTo'](_0xa6abc['editing']['view']['document'],'change:isFocused',(_0xa7f5f9,_0x379c54,_0x24256b)=>{_0x24256b&&_0x28771b();}),this['listenTo'](_0xa6abc['ui']['focusTracker'],'change:isFocused',(_0x460f28,_0x5c821e,_0x1ee2a0)=>{_0x1ee2a0||this['fire']('blur',{'isAnnotationTracked':_0x4085c1=>this['_editorAnnotationsData']['has'](_0x4085c1['innerView'])});}),this['listenTo'](this['editor']['ui'],'update',()=>this['fire']('uiUpdate'));}registerAnnotation(_0x412c90){if(this['_editorAnnotations']['has'](_0x412c90['view']))return;this['_editorAnnotations']['add'](_0x412c90['view']),this['editor']['ui']['focusTracker']['add'](_0x412c90['view']['element']);const _0x59654e=this['editor']['plugins']['get'](ti);this['listenTo'](_0x59654e['collection'],'remove',(_0x274375,_0x59b2f1)=>{this['editor']['ui']['focusTracker']['remove'](_0x59b2f1['view']['element']),this['_editorAnnotations']['delete'](_0x59b2f1['view']);});}hasDomSelection(){return this['editor']['editing']['view']['hasDomSelection'];}addSourceCollector(_0x18e820){if('function'!=typeof _0x18e820)throw new _0x50ddc5('editorannotations-invalid-source-callback');this['_dataCollectors']['add'](_0x18e820);}refreshSelectedViews(){this['fire']('refresh');}getOrderedSelectedAnnotations({activeAnnotation:_0x2506be,annotations:_0x35326a}){const _0x33bf80=[],_0x29615a=this['editor']['model']['document']['selection'],_0x278418=Array['from'](_0x29615a['getRanges']());for(const [_0x236650,_0x5887f4]of this['_editorAnnotationsData']){const _0x324674=_0x3c699d(_0x5887f4),_0x4bff1b=_0x35326a['getByInnerView'](_0x236650);_0x324674&&_0x4bff1b&&_0x33bf80['push']({'annotation':_0x4bff1b,'range':_0x324674});}function _0x3c699d(_0x2e4a30){for(const _0x89ff74 of _0x2e4a30)for(const _0x41ec58 of _0x278418)if(_0x89ff74['containsRange'](_0x41ec58,!_0x29615a['isCollapsed']))return _0x89ff74;return null;}return _0x33bf80['sort']((_0x490229,_0x232b68)=>{const _0x20f993=_0x490229['range'],_0x47ed80=_0x232b68['range'];if(!_0x20f993['isEqual'](_0x47ed80)){if(_0x20f993['containsRange'](_0x47ed80,!0x0))return 0x1;if(_0x47ed80['containsRange'](_0x20f993,!0x0))return-0x1;}return _0x490229['annotation']==_0x2506be?-0x1:_0x232b68['annotation']==_0x2506be?0x1:0x0;})['map'](_0x4dce97=>_0x4dce97['annotation']);}get _editorAnnotationsData(){const _0x4ef9fb=new Map();for(const _0x336895 of Array['from'](this['_dataCollectors']))for(const [_0x24ce3a,_0x44d300]of _0x336895())_0x4ef9fb['set'](_0x24ce3a,_0x44d300);return _0x4ef9fb;}},li=class extends _0x3de2ea{afterInit(){const _0x1f477d=this['editor'];_0x1f477d['plugins']['has']('RestrictedEditingModeEditing')&&_0x1f477d['plugins']['get']('RestrictedEditingModeEditing')['enableCommand']('addCommentThread');}},mi=class extends _0x3de2ea{constructor(_0x494ebb){super(_0x494ebb),this['editor']['config']['define']('importWord.formatting.comments','basic');}afterInit(){const _0x5cd082=this['editor'],_0x3f2e25=_0x5cd082['commands']['get']('importWord'),_0x193434=_0x5cd082['plugins']['get'](_0x1b2b4f);_0x3f2e25&&(_0x3f2e25['on']('execute',(_0x204e25,[,_0x145d16])=>{_0x145d16['collaboration_features']={'comments':!0x0,'user_id':_0x193434['me']['id']};},{'priority':_0xd25c7d['high']+0xa}),this['listenTo'](_0x3f2e25,'dataInsert',this['_handleImportedData']));}_handleImportedData(_0x5e6d31,_0x19167b){const {comment_threads:_0x113c9c}=_0x19167b;_0x113c9c&&_0x113c9c['forEach'](({thread_id:_0x2fdc7f,comments:_0x23a47a,is_resolved:_0x163a77})=>{const _0x1d407c=new Date(),_0x15f1b9=_0x23a47a['map'](({author:_0x12f741,content:_0x4f5ef2,created_at:_0x1b008c})=>({'content':_0x4f5ef2,'authorId':this['editor']['plugins']['get'](_0x1b2b4f)['me']['id'],'createdAt':_0x1d407c,'attributes':{'@external':{'authorName':_0x12f741,'createdAt':_0x1b008c?new Date(_0x1b008c):new Date(),'source':'importWord'}}})),_0xe119e1=this['editor']['config']['get']('collaboration.channelId');this['editor']['plugins']['get'](oi)['addCommentThread']({'channelId':_0xe119e1,'threadId':_0x2fdc7f,'comments':_0x15f1b9,'resolvedAt':_0x163a77?_0x1d407c:null});});}},ui=class extends _0x3de2ea{constructor(_0x5ccb13){super(_0x5ccb13),this['editor']['config']['define']('comments.copyMarkers','default');}static get requires(){return[pt,wt];}afterInit(){const _0x57aa64=this['editor']['plugins']['get']('ClipboardPipeline');this['_registerMarkerInClipboardPipeline'](),this['listenTo'](_0x57aa64,'contentInsertion',(_0x351eaf,_0x22c5cc)=>this['_removeMarkersWithoutThreads'](_0x22c5cc['content']['markers']),{'priority':'highest'});}_removeMarkersWithoutThreads(_0x504f41){if(!this['editor']['plugins']['has']('CommentsRepository'))return _0x504f41;const _0x2ee7de=this['editor']['plugins']['get']('CommentsRepository');for(const _0x233290 of _0x504f41['keys']()){const [_0x24561b,_0x1491ef]=_0x233290['split'](':');'comment'!=_0x24561b||_0x2ee7de['hasCommentThread'](_0x1491ef)||_0x504f41['delete'](_0x233290);}return _0x504f41;}_registerMarkerInClipboardPipeline(){const _0x203b38=this['editor']['plugins']['get']('ClipboardMarkersUtils'),_0x5bedac=this['_mapCommentsCopyConfigToRegisterConfiguration'](this['editor']['config']['get']('comments.copyMarkers'));_0x5bedac&&_0x203b38['_registerMarkerToCopy']('comment',_0x5bedac);}_mapCommentsCopyConfigToRegisterConfiguration(_0x253f4d){switch(_0x253f4d){case'always':return{'allowedActions':'all','copyPartiallySelected':!0x1,'duplicateOnPaste':!0x0};case'default':return{'allowedActions':['cut','dragstart'],'copyPartiallySelected':!0x1,'duplicateOnPaste':!0x1};default:return null;}}};function fi(_0x205604){const _0x510b6d=_0x205604['split'](':');return{'group':_0x510b6d[0x0],'id':_0x510b6d[0x1],'part':_0x510b6d[0x2]};}var pi=class extends _0x3de2ea{init(){this['overrideMarkerConverters'](),this['overrideHorizontalRuleConverter'](),this['overrideImageInlineConverter'](),this['overrideMediaEmbedConverter']();}overrideMarkerConverters(){this['editor']['conversion']['for']('dataDowncast')['markerToHighlight']({'model':'comment','view':(_0x109ccd,_0x467e84)=>{if(!_0x467e84['options']['showCommentHighlights'])return null;if(_0x467e84['options']['ignoreResolvedComments']){const {id:_0x32d99b}=fi(_0x109ccd['markerName']);if(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x32d99b)?.['isResolved']&&_0x109ccd['item'])return _0x467e84['consumable']['consume'](_0x109ccd['item'],'addMarker:'+_0x109ccd['markerName']),_0x467e84['consumable']['consume'](_0x109ccd['item'],'removeMarker:'+_0x109ccd['markerName']),null;}return{'classes':['ck-comment-marker']};}}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x3ebc64=>{_0x3ebc64['on']('addMarker:comment',(_0x55caae,_0x5d5949,_0x21b05e)=>{if(!_0x21b05e['options']['showCommentHighlights'])return;const _0x36b9da=_0x5d5949['item'];if(!_0x36b9da)return;const _0x51c10f=_0x21b05e['mapper']['toViewElement'](_0x36b9da);this['editor']['model']['schema']['isObject'](_0x36b9da)&&_0x51c10f&&!_0x51c10f['getCustomProperty']('widget')&&_0x51c10f['is']('containerElement')&&Ct(_0x51c10f,_0x21b05e['writer']);},{'priority':'high'});});}overrideHorizontalRuleConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'horizontalLine','view':(_0x36a293,{writer:_0x509aaa,options:_0x4d2e82})=>{if(!_0x4d2e82['showCommentHighlights'])return null;const _0x333ec4=_0x509aaa['createContainerElement']('div'),_0x1a2c16=_0x509aaa['createEmptyElement']('hr');return _0x509aaa['addClass']('ck-horizontal-line',_0x333ec4),_0x509aaa['insert'](_0x509aaa['createPositionAt'](_0x333ec4,0x0),_0x1a2c16),_0x333ec4;},'converterPriority':'high'});}overrideImageInlineConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'imageInline','view':(_0x513021,{writer:_0x57d005,options:_0x4b959a})=>{if(!_0x4b959a['showCommentHighlights'])return null;const _0x55a485=_0x57d005['createContainerElement']('span'),_0x3fc3d4=_0x57d005['createEmptyElement']('img');return _0x57d005['addClass']('image-inline',_0x55a485),_0x57d005['insert'](_0x57d005['createPositionAt'](_0x55a485,0x0),_0x3fc3d4),_0x55a485;},'converterPriority':'high'});}overrideMediaEmbedConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToElement']({'model':'media','view':(_0x10126d,{writer:_0x3d76fd,options:_0x1d8960})=>{if(_0x1d8960['showCommentHighlights'])return _0x3d76fd['createEmptyElement']('div');},'converterPriority':'high'}),this['editor']['data']['downcastDispatcher']['on']('attribute:url:media',(_0x390deb,_0x40c292,_0x3d1be0)=>{_0x3d1be0['options']['showCommentHighlights']&&_0x390deb['stop']();},{'priority':'high'});}},wi=class extends _0x3de2ea{static get requires(){return[oi,di,_0x1b2b4f,li,mi,ui,pi];}static get['pluginName'](){return'CommentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x24b134){super(_0x24b134),this['set']('isThreadsLoadingPaused',!0x0),_0x24b134['data']['once']('ready',()=>this['isThreadsLoadingPaused']=!0x1),this['set']('activeMarker',null),this['on']('change:activeMarker',(_0xce3053,_0x5b9e90,_0x1920e4,_0x365c32)=>{const _0x146429=_0x24b134['plugins']['get'](oi),_0x3dd6de=_0x1920e4?fi(_0x1920e4)['id']:null;_0x24b134['model']['change'](()=>{if(_0x3dd6de){const _0x24697c=this['getAllMarkersForId'](_0x3dd6de);for(const _0x2e746f of _0x24697c)_0x24b134['editing']['reconvertMarker'](_0x2e746f);}if(_0x365c32){const {id:_0x12813a}=fi(_0x365c32),_0xb02426=_0x146429['getCommentThread'](_0x12813a);if(_0xb02426&&_0xb02426['unlinkedAt'])return;if(_0xb02426&&!_0xb02426['isAttached'])return;const _0x4b3fda=this['getAllMarkersForId'](_0x12813a);for(const _0x22b8d5 of _0x4b3fda)_0x24b134['editing']['reconvertMarker'](_0x22b8d5);}}),_0x3dd6de&&this['scrollToThreadMarker'](_0x3dd6de);}),this['_initAriaMarkerChangeAnnouncements']();}init(){const _0x447378=this['editor'],_0x3e9975=_0x447378['plugins']['get'](oi),_0x319792=_0x447378['config']['get']('collaboration.channelId'),_0x25eaa4=_0x3e9975['getCommentThreads']()['filter'](_0x3e042e=>_0x3e042e['channelId']!==_0x319792);_0x447378['commands']['add']('addCommentThread',new ci(_0x447378)),this['listenTo'](_0x447378,'change:isReadOnly',(_0x555b70,_0x3f9a80,_0x51126d)=>{_0x3e9975['switchReadOnly'](_0x51126d,_0x447378['config']['get']('collaboration.channelId'));}),this['listenTo'](_0x3e9975,gi('addCommentThread',_0x319792),(_0x52e8bd,{threadId:_0x1acd51})=>{this['editor']['plugins']['get'](oi)['getCommentThread'](_0x1acd51)?.['unlinkedAt']&&this['_attachArchivedThread'](_0x1acd51);}),this['listenTo'](_0x3e9975,gi('removeCommentThread',_0x319792),(_0x2b5ac2,{threadId:_0x13e785})=>{_0x447378['model']['enqueueChange']({'isUndoable':!0x1},_0x1b2531=>{const _0x427ec1=this['getAllMarkersForId'](_0x13e785);for(const _0x545538 of _0x427ec1)_0x1b2531['removeMarker'](_0x545538);});}),this['listenTo'](_0x3e9975,gi('resolveCommentThread',_0x319792),(_0x11ec9f,{threadId:_0x54a8ab})=>{this['_reconvertMarkers'](_0x54a8ab);const _0x3e0393=this['editor']['plugins']['get'](ti);(this['editor']['editing']['view']['hasDomSelection']||_0x3e0393['collection']['isFocused'])&&(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x54a8ab)['unlinkedAt']||this['editor']['editing']['view']['focus']());},{'priority':'low'}),this['listenTo'](_0x3e9975,gi('reopenCommentThread',_0x319792),(_0x2b79e2,{threadId:_0x2355ae})=>{this['_reconvertMarkers'](_0x2355ae);},{'priority':'low'}),this['listenTo'](_0x3e9975,gi('addComment',_0x319792),(_0x181025,{threadId:_0x41b951,isFromAdapter:_0x2cbf67})=>{const _0x2c260b=this['getAllMarkersForId'](_0x41b951);!_0x2cbf67&&0x0!=_0x2c260b['length']&&_0x3e9975['hasCommentThread'](_0x41b951)&&0x1===_0x3e9975['getCommentThread'](_0x41b951)['length']&&_0x447378['model']['enqueueChange']({'isUndoable':!0x1},_0xbac8ce=>{for(const _0x1ff670 of _0x2c260b)_0xbac8ce['updateMarker'](_0x1ff670,{'usingOperation':!0x0,'affectsData':!0x0});});},{'priority':'low'}),this['_initializeMarkerConverters'](),this['_handleMarkerAddAndRemove'](),this['_handleInitialThreads'](_0x25eaa4);}afterInit(){!async function(_0x4d54fb){const _0x42c918='KpOBJGNSEgqCyfVF1kZ8lbnRjM7eIzAsDQHw9aThu6rcYi05UmPL4d3X2Wotvx',_0x4d39b2=0x79188,_0x47c0de=window['Date']['now'](),_0x3405cb=_0x4d54fb['editor'],_0x198b82=new window['Promise'](_0x3888f3=>{_0x3405cb['once']('ready',_0x3888f3);}),_0x1ec23c={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x66aa4d=_0x3405cb['config']['get']('licenseKey');async function _0x30e8b5(){let _0x40160e,_0x46c7f6=null,_0x3e719a=null;try{return'GPL'==_0x66aa4d?'NotAllowed':(_0x40160e=_0x41123e(),_0x40160e?(_0x40160e['usageEndpoint']&&(_0x3e719a=_0x5891bb(_0x40160e['usageEndpoint'],_0x40160e['jti'])),await _0x3d83c3()?_0x1b16d4()?_0x8ab1d8()?'Expired':_0x2a3e79()?('evaluation'==_0x40160e['licenseType']&&(_0x46c7f6=_0x231123('EvaluationLimit')),await _0x60d50d()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x8ab1d8(){const _0x2b4cd2=['evaluation','trial']['includes'](_0x40160e['licenseType'])?_0x47c0de/0x3e8:0xe10*_0x4d39b2;return _0x40160e['exp']<_0x2b4cd2;}function _0x1b16d4(){const _0x20d202=_0x40160e['features'];if(!_0x20d202)return!0x1;if(_0x20d202['includes']('*'))return!0x0;if(_0x20d202['includes']('CMT'))return!0x0;if(_0x20d202['includes']('TRILIUM')&&_0x363ef2())return!0x0;if(_0x20d202['includes']('RCMT')){if(_0x2815a0())return!0x0;if(_0x14cb30()||_0x11ab61())return!0x0;}return!0x1;}function _0x2a3e79(){const _0x4629d1=_0x40160e['licensedHosts'];if(!_0x4629d1||0x0==_0x4629d1['length'])return!0x0;const {hostname:_0x257397}=new URL(window['location']['href']);if(_0x4629d1['includes'](_0x257397))return!0x0;const _0x3be311=_0x257397['split']('.');return _0x4629d1['filter'](_0x5c9362=>_0x5c9362['includes']('*'))['map'](_0x215240=>_0x215240['split']('.'))['filter'](_0x1fa870=>_0x1fa870['length']<=_0x3be311['length'])['map'](_0x312146=>Array(_0x3be311['length']-_0x312146['length'])['fill']('*'===_0x312146[0x0]?'*':'')['concat'](_0x312146))['some'](_0x1fec6a=>_0x3be311['every']((_0x3c0bea,_0x1cdfab)=>_0x1fec6a[_0x1cdfab]===_0x3c0bea||'*'===_0x1fec6a[_0x1cdfab]));}function _0x60d50d(){return _0x46c7f6&&_0x3e719a?new window['Promise']((_0x106fad,_0x4bab83)=>{_0x46c7f6['then'](_0x106fad,_0x4bab83),_0x3e719a['then'](_0x159b77=>{'Valid'!=_0x159b77&&_0x106fad(_0x159b77);},_0x4bab83);}):_0x46c7f6||_0x3e719a||'Valid';}}function _0x5891bb(_0x36108f,_0xe19bc0){return new window['Promise'](_0x42d303=>{if(_0x1bd594())return _0x42d303('Valid');_0x2aaee9(),_0x3405cb['decorate']('_sendUsageRequest');let _0x3a8b4d=!0x1;const _0x33a597=_0x5c5379();function _0x287bc1(_0x1e0cf5){return!!_0x1e0cf5&&('object'==typeof _0x1e0cf5||'function'==typeof _0x1e0cf5)&&'function'==typeof _0x1e0cf5['then']&&'function'==typeof _0x1e0cf5['catch'];}function _0x64706b(_0x4b5f2f){_0x1ba577(_0x4b5f2f)['then'](_0x3ac5fa=>_0x3ac5fa&&'ok'==_0x3ac5fa['status']?_0x2fc028(_0x5918c8(_0x33a597+_0xe19bc0))!=_0x3ac5fa['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x1a07eb=>(_0x26dea3(),_0x1a07eb),()=>{const _0x38840f=_0x493a7f();return null==_0x38840f?(_0x26dea3(),'Valid'):_0x47c0de-_0x38840f>0x240c8400?'UsageLimit':'Valid';})['then'](_0x42d303)['catch'](()=>{_0x42d303('UsageLimit');});const _0x1ce2d2=0x36ee80;function _0x26dea3(){const _0x566c60='llct-'+_0x2fc028(_0x5918c8(_0x36108f)),_0x484bc5=_0x2c4270(_0x2fc028(window['Math']['ceil'](_0x47c0de/_0x1ce2d2)));window['localStorage']['setItem'](_0x566c60,_0x484bc5);}function _0x493a7f(){const _0x26eb80='llct-'+_0x2fc028(_0x5918c8(_0x36108f)),_0xa71e89=window['localStorage']['getItem'](_0x26eb80);return _0xa71e89?window['parseInt'](_0x2c4270(_0xa71e89),0x10)*_0x1ce2d2:null;}function _0x1ba577(_0x260dbb){return new window['Promise']((_0x113418,_0x557f89)=>{_0x260dbb['then'](_0x113418,_0x557f89),window['setTimeout'](_0x557f89,0x1d4c0);});}}_0x3405cb['on']('_sendUsageRequest',(_0x1a550a,_0x15c898)=>{if(_0x15c898[0x0]!=_0x36108f)return _0x42d303('UsageLimit');_0x15c898[0x1]={..._0x15c898[0x1],'requestId':_0x33a597};},{'priority':'high'}),_0x3405cb['on']('_sendUsageRequest',_0x5e2314=>{_0x287bc1(_0x5e2314['return'])&&(_0x3a8b4d=!0x0,_0x64706b(_0x5e2314['return']));},{'priority':'low'}),_0x198b82['then'](()=>{_0x3a8b4d||_0x42d303('UsageLimit');});});function _0x1bd594(){return'auto'==_0x3405cb['editing']['view']['_overlayModeHint'];}function _0x2aaee9(){_0x3405cb['editing']['view']['_overlayModeHint']='auto';}}function _0x231123(_0x3173c8){const _0x1ab79c=[new window['Promise'](_0x2779d8=>setTimeout(_0x2779d8,0x93ecc)),_0x198b82['then'](()=>new window['Promise'](_0x21f324=>{let _0x4c5f72=0x0;_0x3405cb['model']['on']('applyOperation',(_0x3812f9,_0x281cab)=>{_0x281cab[0x0]['isDocumentOperation']&&_0x4c5f72++,0x5e8==_0x4c5f72&&(_0x21f324(),_0x3812f9['off']());});}))];return window['Promise']['race'](_0x1ab79c)['then'](()=>_0x3173c8);}async function _0x319b35(){await _0x198b82,_0x3405cb['model']['change']=_0x12c4e5,_0x3405cb['model']['enqueueChange']=_0x12c4e5,_0x3405cb['enableReadOnlyMode']('model');}function _0x363ef2(){return window['glob']&&window['glob']['triliumVersion'];}function _0x2815a0(){return _0x4113c3('WebSocketGateway')&&'connected'==_0x185c0c('WebSocketGateway')['state'];}function _0x14cb30(){return _0x4113c3('RevisionViewerIntegration');}function _0x11ab61(){return _0x4113c3('TrackChangesDataGetter');}function _0x482285(_0x12d925){const _0x3d0638=_0x1625fb();_0x3405cb[_0x3d0638]='commentsLicenseKey'+_0x12d925,'Valid'!=_0x12d925&&_0x319b35();}function _0x1625fb(){const _0x4e1539=window['String'](window['performance']['now']())['replace']('.','');let _0x224c9f='K';for(let _0x3ebd78=0x0;_0x3ebd78<_0x4e1539['length'];_0x3ebd78+=0x2){let _0x9586dc=window['parseInt'](_0x4e1539['substring'](_0x3ebd78,_0x3ebd78+0x2));_0x9586dc>=0x3e&&(_0x9586dc-=0x3e),_0x224c9f+=_0x42c918[_0x9586dc];}return _0x224c9f;}function _0x41123e(){const _0x599b1e=_0x66aa4d['split']('.');if(0x3!=_0x599b1e['length'])return null;return _0x359b7b(_0x599b1e[0x1]);function _0x359b7b(_0x2c8bf8){const _0x31e746=_0x42ed41(_0x2c8bf8);return _0x31e746&&_0x2315fb()?_0x31e746:null;function _0x2315fb(){const _0x12b087=_0x31e746['jti'],_0x30cfcb=window['parseInt'](_0x12b087['substring'](_0x12b087['length']-0x8),0x10),_0x464bb3={..._0x31e746,'jti':_0x12b087['substring'](0x0,_0x12b087['length']-0x8)};return delete _0x464bb3['vc'],_0x5918c8(_0x464bb3)==_0x30cfcb;}}}async function _0x3d83c3(){let _0x2773e5=!0x0;try{const [_0xa260e9,_0x5fbfc6,_0x3b6a3b]=_0x66aa4d['split']('.');return _0x51a6db(_0xa260e9),await _0x44fecc(_0xa260e9,_0x5fbfc6,_0x3b6a3b),_0x2773e5;}catch{return!0x1;}function _0x51a6db(_0x48ffae){const _0x559bb3=_0x42ed41(_0x48ffae);_0x559bb3&&'ES256'==_0x559bb3['alg']||(_0x2773e5=!0x1);}async function _0x44fecc(_0x25cd29,_0x144365,_0xbdbfdb){const _0x3a1919=window['Uint8Array']['from'](_0x19622f(_0xbdbfdb),_0x665592=>_0x665592['charCodeAt'](0x0)),_0x4fecfc=new window['TextEncoder']()['encode'](_0x25cd29+'.'+_0x144365),_0x214d6e=window['crypto']['subtle'];if(!_0x214d6e)return;const _0x33dd7a=await _0x214d6e['importKey']('jwk',_0x1ec23c,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x214d6e['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x33dd7a,_0x3a1919,_0x4fecfc)||(_0x2773e5=!0x1);}}function _0x42ed41(_0x4eda5e){return _0x4eda5e['startsWith']('ey')?JSON['parse'](_0x19622f(_0x4eda5e)):null;}function _0x19622f(_0x3fe8c4){return window['atob'](_0x3fe8c4['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5918c8(_0xf662d2){let _0x5f1638=0x1505;function _0x4b62d5(_0x23f83f){for(let _0x32a347=0x0;_0x32a347<_0x23f83f['length'];_0x32a347++){const _0x1ad97b=_0x23f83f['charCodeAt'](_0x32a347);_0x5f1638=(_0x5f1638<<0x5)+_0x5f1638+_0x1ad97b,_0x5f1638&=_0x5f1638;}}function _0x1f2526(_0x303ccb){Array['isArray'](_0x303ccb)?_0x303ccb['forEach'](_0x1f2526):_0x303ccb&&'object'==typeof _0x303ccb?Object['entries'](_0x303ccb)['sort']()['forEach'](([_0x266992,_0x5213d9])=>{_0x4b62d5(_0x266992),_0x1f2526(_0x5213d9);}):_0x4b62d5(window['String'](_0x303ccb));}return _0x1f2526(_0xf662d2),_0x5f1638>>>0x0;}function _0x2fc028(_0x5eab95){return _0x5eab95['toString'](0x10)['padStart'](0x8,'0');}function _0x2c4270(_0x146617){return _0x146617['split']('')['reverse']()['join']('');}function _0x4113c3(_0x477307){return _0x3405cb['plugins']['has'](_0x477307);}function _0x185c0c(_0x37e647){return _0x3405cb['plugins']['get'](_0x37e647);}function _0x12c4e5(){}_0x482285(await _0x30e8b5());}(this);}destroy(){const _0x28ce22=this['editor']['plugins']['get'](oi),_0x52a548=this['editor']['config']['get']('collaboration.channelId');for(const _0x3c57d1 of _0x28ce22['getCommentThreads']({'channelId':_0x52a548}))_0x28ce22['_detachCommentThread'](_0x3c57d1['id']),_0x28ce22['_threads']['delete'](_0x3c57d1['id']);super['destroy']();}['hasMarkerForId'](_0x1c6780){return this['getAllMarkersForId'](_0x1c6780)['length']>0x0;}getAllMarkersForId(_0x384b60){const _0x93bbe9=[];for(const _0x2c2c6c of this['editor']['model']['markers'])_0x2c2c6c['name']['startsWith']('comment:'+_0x384b60)&&_0x93bbe9['push'](_0x2c2c6c);return _0x93bbe9;}['scrollToThreadMarker'](_0x1077f4){setTimeout(()=>{const _0x4f4b0c=this['_getTargetForId'](_0x1077f4);_0x4f4b0c&&this['activeMarker']&&fi(this['activeMarker'])['id']===_0x1077f4&&_0x47daa2({'target':_0x4f4b0c[0x0],'viewportOffset':0x64,'alignToTop':!0x0});},0x32);}_reconvertMarkers(_0x72631b){this['editor']['model']['change'](()=>{for(const _0x8b12c7 of this['getAllMarkersForId'](_0x72631b))this['editor']['editing']['reconvertMarker'](_0x8b12c7);});}_attachArchivedThread(_0x47207d){const _0x3fa190=this['editor']['plugins']['get'](oi),_0x73538f=this['editor']['plugins']['get'](di),_0x360bda=_0x3fa190['getCommentThread'](_0x47207d);if(!_0x360bda['isAttached']){const _0xc2ec4=_0x360bda['attachTo'](()=>this['_getTargetForId'](_0x360bda['id']));_0x73538f['registerAnnotation'](_0xc2ec4),_0x360bda['_hasTargetInContent']=!0x1;}}_initializeMarkerConverters(){const _0x3a718f=this['editor'],_0x1299de=_0x3a718f['plugins']['get'](_0x1b2b4f);_0x3a718f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'comment','view':(_0x386a07,_0x513dc2)=>{const {id:_0x2006d5}=fi(_0x386a07['markerName']),_0x5c0f46=_0x3a718f['plugins']['get'](oi)['getCommentThread'](_0x2006d5),_0x30880a=this['activeMarker']&&fi(this['activeMarker'])['id']===_0x2006d5;let _0x29ffc5;if(_0x5c0f46&&_0x5c0f46['isResolved']&&!_0x30880a&&_0x386a07['item'])return _0x513dc2['consumable']['consume'](_0x386a07['item'],'addMarker:'+_0x386a07['markerName']),_0x513dc2['consumable']['consume'](_0x386a07['item'],'removeMarker:'+_0x386a07['markerName']),null;const _0x17b3ab=['ck-comment-marker'];return _0x30880a&&_0x17b3ab['push']('ck-comment-marker--active'),_0x29ffc5=_0x5c0f46?.['length']?_0x5c0f46['comments']['first']['author']['id']:_0x1299de['me']['id'],{'classes':_0x17b3ab,'attributes':{'data-comment':_0x2006d5,'data-author-id':_0x29ffc5}};}}),_0x3a718f['conversion']['for']('dataDowncast')['markerToData']({'model':'comment','view':(_0x2bffcb,{options:_0x232f18})=>{if(_0x232f18['showCommentHighlights'])return null;const _0x3a45db=_0x3a718f['plugins']['get'](oi),_0x5043ab=_0x3a718f['model']['markers']['get'](_0x2bffcb),{id:_0xf37d23,part:_0x2037ab}=fi(_0x2bffcb);return _0x5043ab&&!_0x5043ab['affectsData']||_0x232f18['ignoreResolvedComments']&&_0x3a45db['getCommentThread'](_0xf37d23)?.['isResolved']?null:{'group':'comment','name':_0x2037ab?_0xf37d23+':'+_0x2037ab:_0xf37d23};}}),_0x3a718f['conversion']['for']('upcast')['elementToElement']({'view':{'name':'comment','attributes':{'id':/^\w/}},'model':(_0x4e4382,{writer:_0x27fe52})=>_0x27fe52['createElement']('$marker',{'data-name':'comment:'+_0x4e4382['getAttribute']('id')})}),_0x3a718f['conversion']['for']('upcast')['dataToMarker']({'view':'comment'});}['_handleMarkerAddAndRemove'](){const _0x4e59bf=this['editor'],_0x26a40d=_0x4e59bf['plugins']['get'](oi),_0x46e437=new Set(),_0x36dd6b=new Set();_0x4e59bf['model']['document']['registerPostFixer'](_0x55d420=>{let _0x25b5e0=!0x1;for(const {name:_0x14e7ed,data:_0x4ea030}of _0x4e59bf['model']['document']['differ']['getChangedMarkers']()){const {group:_0x271a40,id:_0xc97e57}=fi(_0x14e7ed);let _0x225315=_0x4ea030['newRange'];if('comment'!==_0x271a40||!_0x225315)continue;const _0x233496='$graveyard'===_0x225315['root']['rootName'];_0x233496||(_0x225315=_i(_0x225315,_0x4e59bf['model']),!_0x225315||_0x225315['isCollapsed']||!_0x4ea030['newRange']||_0x225315['isEqual'](_0x4ea030['newRange']))?_0x4e59bf['model']['hasContent'](_0x225315)&&!_0x233496?this['isThreadsLoadingPaused']?_0x46e437['add'](_0x14e7ed):this['_handleThreadMarker'](_0x14e7ed,_0xc97e57):(_0x36dd6b['add'](_0x14e7ed),_0x46e437['delete'](_0x14e7ed),_0x55d420['removeMarker'](_0x14e7ed),_0x25b5e0=!0x0):(_0x55d420['updateMarker'](_0x14e7ed,{'range':_0x225315}),_0x25b5e0=!0x0);}return _0x25b5e0;}),this['on']('change:isThreadsLoadingPaused',(_0x3c69c0,_0x5d5d72,_0x258f9a)=>{if(!_0x258f9a&&_0x46e437['size'])for(const _0x2744fc of _0x46e437){const {id:_0x3cee03}=fi(_0x2744fc);_0x46e437['delete'](_0x2744fc),_0x4e59bf['model']['markers']['get'](_0x2744fc)&&this['_handleThreadMarker'](_0x2744fc,_0x3cee03);}}),this['listenTo'](_0x4e59bf['model']['document'],'change',()=>{for(const {name:_0xb44f0c,data:{newRange:_0x3d9521}}of _0x4e59bf['model']['document']['differ']['getChangedMarkers']()){const {group:_0x10e75d,id:_0xa4930c}=fi(_0xb44f0c);if('comment'!==_0x10e75d)continue;const _0x7d99c0=_0x26a40d['getCommentThread'](_0xa4930c),_0x14eaae=this['hasMarkerForId'](_0xa4930c);_0x7d99c0&&(!_0x7d99c0['_hasTargetInContent']&&_0x3d9521&&_0x4e59bf['editing']['view']['once']('render',()=>{const _0x8c1591=_0x4e59bf['plugins']['get'](ti),_0x2d3a3f=_0x26a40d['_threadToController']['get'](_0x7d99c0)['view'];_0x8c1591['getByInnerView'](_0x2d3a3f)['refreshVisibility']();},{'priority':'low'}),_0x7d99c0['_hasTargetInContent']=_0x14eaae||!!_0x3d9521),_0x3d9521||(_0x36dd6b['add'](_0xb44f0c),_0x46e437['delete'](_0xb44f0c));}for(const _0x537da8 of _0x36dd6b){const {id:_0x21da40}=fi(_0x537da8),_0x31e7c8=_0x26a40d['getCommentThread'](_0x21da40);if(_0x46e437['delete'](_0x537da8),!_0x31e7c8)continue;const _0x49a889=this['hasMarkerForId'](_0x21da40);_0x49a889||_0x31e7c8['isSubmitted']?_0x49a889||_0x31e7c8['unlinkedAt']||_0x31e7c8['setUnlinkedAt'](new Date()):_0x31e7c8['remove']();}_0x36dd6b['clear']();});}_handleInitialThreads(_0x38cc85){_0x38cc85['forEach'](_0x4da1c2=>{_0x4da1c2['unlinkedAt']&&this['_attachArchivedThread'](_0x4da1c2['id']);});}_getTargetForId(_0x5a304f){const _0x5630a6=this['editor'],_0x5ed416=this['getAllMarkersForId'](_0x5a304f);return _0x3d1e87(_0x5630a6['editing'],_0x5ed416);}_getTextContext(_0x271a13){const _0x33c036=this['getAllMarkersForId'](_0x271a13);let _0x3968a2='',_0x3c9ff8=!0x1;for(const _0x57cd9b of _0x33c036){const _0x5587e8=_0x57cd9b['getRange']();for(const _0x34c73f of Array['from'](_0x5587e8['getItems']()))_0x34c73f['is']('$textProxy')?(_0x3968a2&&_0x3c9ff8&&(_0x3968a2+='\x20',_0x3c9ff8=!0x1),_0x3968a2+=_0x34c73f['data']):_0x3c9ff8=!0x0;_0x3c9ff8=!0x0;}return _0x3968a2['substring'](0x0,0x96);}_attachMarkerToThread(_0xccd617,_0x452394){const _0x2d0698=this['editor'],_0x4bf897=_0x2d0698['plugins']['get'](oi);let _0x78e103=_0x4bf897['getCommentThread'](_0x452394);const _0x14562e=_0x2d0698['config']['get']('collaboration.channelId'),_0x248a28=_0x2d0698['plugins']['get'](di);return _0x78e103&&(_0x78e103['unlinkedAt']&&_0x78e103['setUnlinkedAt'](null),_0x78e103['isAttached'])||(this['getAllMarkersForId'](_0x452394)[0x0]['managedUsingOperations']?_0x4bf897['fetchCommentThread']({'channelId':_0x14562e,'threadId':_0x452394})['then'](_0x5f49a0=>{if('destroyed'!==_0x2d0698['state']){if(_0x78e103=_0x5f49a0,_0x78e103&&!_0x78e103['isAttached']){const _0x33ca28=_0x78e103['attachTo'](()=>this['_getTargetForId'](_0x452394));_0x248a28['registerAnnotation'](_0x33ca28),_0x78e103['isResolved']&&this['_reconvertMarkers'](_0x452394);}else{if(!_0x78e103){const _0x383099=this['getAllMarkersForId'](_0x452394);_0x2d0698['model']['change'](_0x509cc5=>{for(const _0x2a2761 of _0x383099)_0x509cc5['removeMarker'](_0x2a2761);});}}}}):_0x2d0698['editing']['view']['once']('render',()=>{if(_0x4bf897['getCommentThread'](_0x452394))return;const _0x1c1da0=_0x2d0698['plugins']['get'](ti);_0x78e103=_0x4bf897['openNewCommentThread']({'channelId':_0x14562e,'threadId':_0x452394,'target':()=>this['_getTargetForId'](_0x452394),'context':{'type':'text','value':this['_getTextContext'](_0x452394)}});const _0x462404=_0x4bf897['_threadToController']['get'](_0x78e103)['view'],_0x2cdc87=_0x1c1da0['getByInnerView'](_0x462404);_0x2cdc87&&_0x248a28['registerAnnotation'](_0x2cdc87);},{'priority':'low'})),_0x78e103;}['_handleThreadMarker'](_0x33162e,_0x383abd){const _0x36e01c=this['_attachMarkerToThread'](_0x33162e,_0x383abd);_0x36e01c&&!_0x36e01c['context']&&_0x36e01c['setContext']({'type':'text','value':this['_getTextContext'](_0x383abd)});}_initAriaMarkerChangeAnnouncements(){const _0x3f6d19=this['editor'];_0x18a7fa(_0x3f6d19['model'],({left:_0x19a307,entered:_0x104a55})=>{for(const _0x149789 of _0x19a307)if(Ai(_0x149789)){_0x3f6d19['ui']['ariaLiveAnnouncer']['announce'](Et(_0x3f6d19['locale'],'LEAVE_COMMENT_ANNOUNCEMENT'));break;}for(const _0x65a6b2 of _0x104a55)if(Ai(_0x65a6b2)){_0x3f6d19['ui']['ariaLiveAnnouncer']['announce'](Et(_0x3f6d19['locale'],'ENTER_COMMENT_ANNOUNCEMENT',_0x2a76af(_0x2f9b22)));break;}});}};function gi(_0x4186a8,_0x2c775c){return _0x2c775c?_0x4186a8+':'+_0x2c775c:_0x4186a8;}function _i(_0x89eaa4,_0x2f0233){const _0x542b12=_0x2f0233['schema'],_0x78dfd6=_0x2f0233['createRange'](_0x89eaa4['start']);for(const _0x36173d of _0x89eaa4['getWalker']()){const {type:_0x4b7493,item:_0x197932,nextPosition:_0x29f1ae}=_0x36173d;if('text'===_0x4b7493||_0x542b12['isObject'](_0x197932)){const _0x2e711c=_0x2f0233['createPositionBefore'](_0x197932);_0x78dfd6['isCollapsed']&&(_0x78dfd6['start']=_0x2e711c),_0x78dfd6['end']=_0x29f1ae;}}return _0x78dfd6;}function Ai(_0x583671){return'comment'===fi(_0x583671['name'])['group'];}var vi=class extends _0x3de2ea{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'CommentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,wi,di,ti];}get CommentsListView(){return Lt;}get CommentThreadInputView(){return xt;}init(){const _0x188a1e=this['editor'],_0x52fdfa=_0x188a1e['plugins']['get'](oi),_0x40d8c9=_0x188a1e['plugins']['get'](wi),_0x28e3d8=_0x188a1e['plugins']['get'](ti),_0x4557ea=_0x188a1e['plugins']['get'](di);_0x188a1e['ui']['componentFactory']['add']('comment',()=>{const _0x5862b8=this['_createUIButton'](_0x126747);return _0x5862b8['tooltip']=!0x0,_0x5862b8;}),_0x188a1e['ui']['componentFactory']['add']('menuBar:comment',()=>this['_createUIButton'](rt)),_0x4557ea['addSourceCollector'](()=>{const _0x5cfc39=[];for(const [_0x4405c2,_0x48fdae]of _0x52fdfa['_threadToController']){const _0x372db0=_0x40d8c9['getAllMarkersForId'](_0x4405c2['id']),_0x5725d2=_0x372db0['map'](_0x5544bd=>_0x5544bd['getRange']());_0x372db0['length']>0x0&&_0x5cfc39['push']([_0x48fdae['view'],_0x5725d2]);}return _0x5cfc39;}),this['listenTo'](_0x28e3d8,'change:activeAnnotations',(_0x54441a,_0x14fa4b,_0x1616d7)=>{const _0x1b02ca=Array['from'](_0x1616d7)['map'](_0x58a74f=>_0x58a74f['innerView'])['find'](_0x1eb201=>_0x52fdfa['_viewToController']['has'](_0x1eb201));if(!_0x1b02ca)return void(_0x40d8c9['activeMarker']=null);const _0x2b2db0=_0x52fdfa['_viewToController']['get'](_0x1b02ca)['model']['id'],_0x538bc7='comment:'+_0x2b2db0;_0x2b2db0&&_0x40d8c9['hasMarkerForId'](_0x2b2db0)?_0x40d8c9['activeMarker']=_0x538bc7:_0x40d8c9['activeMarker']&&(_0x40d8c9['activeMarker']=null);}),this['listenTo'](_0x52fdfa,'removeCommentThread',(_0x3f22a6,{threadId:_0x174552,isFromAdapter:_0x4cbee7})=>{!_0x4cbee7&&_0x188a1e['ui']['focusTracker']['isFocused']&&_0x40d8c9['hasMarkerForId'](_0x174552)&&_0x188a1e['editing']['view']['focus']();},{'priority':'highest'}),this['listenTo'](_0x52fdfa,'addComment',(_0x2bf2b6,{threadId:_0x2dd3e8,isFromAdapter:_0x2bae53})=>{!_0x2bae53&&_0x40d8c9['hasMarkerForId'](_0x2dd3e8)&&_0x52fdfa['hasCommentThread'](_0x2dd3e8)&&0x1===_0x52fdfa['getCommentThread'](_0x2dd3e8)['length']&&(_0x188a1e['editing']['view']['focus'](),_0x2bf2b6['stop']());},{'priority':'low'}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x371fc3=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x27922d;for(const _0x3f85b1 in _0x371fc3){const _0x1afd28=_0x3f85b1,_0x332c9f=_0x371fc3[_0x1afd28];if('commentsLicenseKeyValid'==_0x332c9f||'commentsLicenseKeyInvalid'==_0x332c9f||'commentsLicenseKeyExpired'==_0x332c9f||'commentsLicenseKeyDomainLimit'==_0x332c9f||'commentsLicenseKeyNotAllowed'==_0x332c9f||'commentsLicenseKeyEvaluationLimit'==_0x332c9f||'commentsLicenseKeyUsageLimit'==_0x332c9f){delete _0x371fc3[_0x1afd28],_0x27922d=_0x332c9f,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'commentsLicenseKeyInvalid'==_0x27922d&&_0x371fc3['_showLicenseError']('invalid'),'commentsLicenseKeyExpired'==_0x27922d&&_0x371fc3['_showLicenseError']('expired'),'commentsLicenseKeyDomainLimit'==_0x27922d&&_0x371fc3['_showLicenseError']('domainLimit'),'commentsLicenseKeyNotAllowed'==_0x27922d&&_0x371fc3['_showLicenseError']('featureNotAllowed','Comments'),'commentsLicenseKeyEvaluationLimit'==_0x27922d&&_0x371fc3['_showLicenseError']('evaluationLimit'),'commentsLicenseKeyUsageLimit'==_0x27922d&&_0x371fc3['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_createUIButton(_0x2e52f2){const _0x5070af=this['editor'],_0x1263b6=new _0x2e52f2(_0x5070af['locale']),_0x23f260=_0x5070af['commands']['get']('addCommentThread');return _0x1263b6['set']({'label':Et(_0x5070af['locale'],'Comment'),'icon':_0x5e7948}),_0x1263b6['bind']('isEnabled')['to'](_0x23f260,'isEnabled',_0x23f260,'hasContent',(_0x36fa0c,_0x428241)=>_0x36fa0c&&_0x428241),this['listenTo'](_0x1263b6,'execute',()=>{_0x23f260['execute']();}),_0x1263b6;}},yi=class extends _0x3de2ea{static get['pluginName'](){return'CommentsOnly';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[wi];}constructor(_0x5c7e84){super(_0x5c7e84),this['set']('isEnabled',!0x1),this['on']('change:isEnabled',(_0x433f15,_0x16e6b1,_0x1762d0)=>{_0x1762d0?this['_enableCommentsOnlyMode']():this['_disableCommentsOnlyMode']();});}afterInit(){!this['isEnabled']&&this['editor']['config']['get']('commentsOnly')&&(this['isEnabled']=!0x0);}_enableCommentsOnlyMode(){for(const [_0x5096ba,_0x14bf0a]of this['editor']['commands'])_0x14bf0a['affectsData']&&'addCommentThread'!==_0x5096ba&&_0x14bf0a['forceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('DragDrop')&&this['editor']['plugins']['get']('DragDrop')['forceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['forceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['forceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['forceDisabled']('commentsOnlyMode');const _0x4de317=this['editor']['editing']['view']['document'];this['listenTo'](_0x4de317,'cut',_0x1b800b=>_0x1b800b['stop'](),{'priority':'highest'}),this['listenTo'](_0x4de317,'clipboardInput',_0xd3aa6c=>_0xd3aa6c['stop'](),{'priority':'highest'}),this['listenTo'](_0x4de317,'delete',_0x5db564=>_0x5db564['stop'](),{'priority':'highest'});}_disableCommentsOnlyMode(){for(const [_0x34b5d0,_0x12a3c6]of this['editor']['commands'])_0x12a3c6['affectsData']&&'addCommentThread'!==_0x34b5d0&&_0x12a3c6['clearForceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['clearForceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['clearForceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['clearForceDisabled']('commentsOnlyMode'),this['stopListening'](this['editor']['editing']['view']['document']);}},Ti=class extends _0x333ed9{activeUIs;uisData;['_uis'];static get requires(){return[ti];}static get['pluginName'](){return'AnnotationsUIs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x51f57d){super(_0x51f57d),this['activeUIs']=new Set(),this['_uis']=new Map(),this['uisData']=new Map();}init(){const _0x48d548=this['context']['plugins']['get'](ti);this['listenTo'](_0x48d548,'_activateAnnotation',(_0xb46ffc,_0x2ad97)=>{for(const _0x4b4179 of this['activeUIs']){const _0x1b6891=this['_uis']['get'](_0x4b4179);(0x0,this['uisData']['get'](_0x4b4179)['filter'])(_0x2ad97)&&_0x1b6891['setActiveAnnotation'](_0x2ad97);}}),this['listenTo'](_0x48d548,'_deactivateAllAnnotations',()=>{for(const _0x4c1194 of this['activeUIs'])this['_uis']['get'](_0x4c1194)['setActiveAnnotation'](null);}),this['listenTo'](_0x48d548['_visibleAnnotations'],'add',(_0x913676,_0x6d38b3)=>{this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x6d38b3);});}hasActive(){return this['activeUIs']['size']>0x0;}isActive(_0x57b008){return this['activeUIs']['has'](_0x57b008);}activate(_0x45e8bb,_0x445719=this['defaultFilter']){const _0x77d065=this['context']['plugins']['get'](ti);if(!this['_uis']['has'](_0x45e8bb))throw new _0x50ddc5('annotationsuis-missing-ui',this,{'uiName':_0x45e8bb});this['isActive'](_0x45e8bb)&&this['deactivate'](_0x45e8bb),this['activeUIs']['add'](_0x45e8bb);const _0x3cc206=new Jt();Qt({'source':_0x77d065['_visibleAnnotations'],'target':_0x3cc206,'filter':_0x445719}),this['uisData']['set'](_0x45e8bb,{'collection':_0x3cc206,'filter':_0x445719});const _0x594c7d=this['_uis']['get'](_0x45e8bb);_0x594c7d['attach'](_0x3cc206),this['listenTo'](_0x594c7d,'change:activeAnnotation',(_0x3c315c,_0x127018,_0x73788d,_0x4d7c06)=>{_0x4d7c06&&_0x77d065['_removeActiveAnnotation'](_0x4d7c06),_0x73788d&&_0x77d065['_addActiveAnnotation'](_0x73788d);});}deactivate(_0x7077a2){if(this['activeUIs']['delete'](_0x7077a2),!this['_uis']['has'](_0x7077a2))throw new _0x50ddc5('annotationsuis-missing-ui',this,{'uiName':_0x7077a2});const _0x466594=this['_uis']['get'](_0x7077a2);_0x466594['detach'](),this['stopListening'](_0x466594),this['uisData']['get'](_0x7077a2)['collection']['destroy'](),this['uisData']['delete'](_0x7077a2);}switchTo(_0x215b67){if(!this['_uis']['has'](_0x215b67))throw new _0x50ddc5('annotationsuis-missing-ui',this,{'uiName':_0x215b67});const _0x2500a8=this['context']['plugins']['get'](ti),_0x3b7c92=Array['from'](_0x2500a8['activeAnnotations'])[0x0]||null;this['deactivateAll'](),this['activate'](_0x215b67);const _0x597a2c=this['_uis']['get'](_0x215b67);_0x597a2c['setActiveAnnotation'](_0x3b7c92),_0x597a2c['_setSelectedAnnotations']&&_0x3b7c92&&_0x597a2c['_setSelectedAnnotations']([_0x3b7c92]);}deactivateAll(){for(const _0x11637b of this['activeUIs'])this['deactivate'](_0x11637b);}register(_0x21c653,_0x400228){if(this['_uis']['has'](_0x21c653))throw new _0x50ddc5('annotationsuis-register-already-registered');if('function'!=typeof _0x400228['attach']||'function'!=typeof _0x400228['detach']||'function'!=typeof _0x400228['setActiveAnnotation'])throw new _0x50ddc5('annotationsuis-register-invalid-interface',null);this['_uis']['set'](_0x21c653,_0x400228);}refilterAnnotations(){const _0x3a2ce0=this['context']['plugins']['get'](ti)['collection'],_0xecbd27=new Map(),_0x8a99a=Array['from'](this['activeUIs']);for(const _0x30084b of this['activeUIs']){const _0x26a0af=this['uisData']['get'](_0x30084b)['collection'];for(const _0x110495 of _0x26a0af)_0xecbd27['set'](_0x110495,_0x30084b);}for(const _0x568240 of _0x3a2ce0){const _0x3d04f0=_0xecbd27['get'](_0x568240);this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x568240);const _0x17f510=_0x8a99a['find'](_0x1f454a=>this['uisData']['get'](_0x1f454a)['filter'](_0x568240));_0x3d04f0!==_0x17f510&&(_0x3d04f0&&this['uisData']['get'](_0x3d04f0)['collection']['remove'](_0x568240),_0x17f510&&this['uisData']['get'](_0x17f510)['collection']['add'](_0x568240));}}destroy(){this['deactivateAll'](),super['destroy']();}defaultFilter(){return!0x0;}_assertAnnotationDoesNotBelongToMultipleUIs(_0x1dff6a){const _0x555fb9=[];for(const _0x22f334 of this['activeUIs']){(0x0,this['uisData']['get'](_0x22f334)['filter'])(_0x1dff6a)&&_0x555fb9['push'](_0x22f334);}if(_0x555fb9['length']>0x1)throw new _0x50ddc5('annotationsuis-annotation-mismatch',null,{'matchedUIs':_0x555fb9,'annotationType':_0x1dff6a['type']});}};const Ci=/* #__PURE__ -- @preserve */
|
|
32
|
+
_0x3e4b52('px');var Ii=class extends ht{list;['focusables'];['focusTracker'];['focusCycler'];constructor(_0x170057){super(_0x170057);const _0x149de1=this['bindTemplate'];this['set']('minHeight',0x0),this['set']('class',''),this['list']=this['createCollection'](),this['focusables']=this['createCollection'](),this['list']['delegate']('arrowup','arrowdown')['to'](this),this['focusTracker']=new _0x1d3923(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-sidebar','ck-reset',_0x149de1['to']('class')],'style':{'minHeight':_0x149de1['to']('minHeight',_0x3727bc=>'number'==typeof _0x3727bc?Ci(_0x3727bc+0xa):null)},'dir':_0x170057['uiLanguageDirection'],'role':'application','aria-label':Et(_0x170057,'Annotations\x20sidebar'),'tabindex':0x0},'children':[{'tag':'div','attributes':{'role':'list','aria-label':Et(_0x170057,'Annotations\x20list')},'children':this['list']}]});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}['focus'](){this['focusCycler']['focusFirst']();}_setupKeyboardNavigation(){this['list']['delegate']('change:top')['to'](this),this['on']('change:top',_0xd88871=>{this['_updateItemPositionInFocusables'](_0xd88871['source']);}),this['list']['forEach'](_0x561d58=>{this['focusTracker']['add'](_0x561d58['element']),this['_updateItemPositionInFocusables'](_0x561d58);}),this['list']['on']('change',(_0x230fab,_0x4065d7)=>{for(const _0x29db4d of _0x4065d7['removed'])this['focusTracker']['remove'](_0x29db4d['element']),this['focusables']['remove'](_0x29db4d);for(const _0x38edcb of _0x4065d7['added'])this['focusTracker']['add'](_0x38edcb['element']),this['_updateItemPositionInFocusables'](_0x38edcb);}),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['listenTo'](this['element'],'focus',()=>{this['focus']();});}_updateItemPositionInFocusables(_0x138c76){const _0x1d1923=this['focusables']['getIndex'](_0x138c76);let _0x4e2643,_0x1b5a9d;for(const _0xa72fa9 of this['focusables'])if(_0x138c76['top']<_0xa72fa9['top']){_0x4e2643=_0xa72fa9;break;}if(_0x1b5a9d=_0x4e2643?this['focusables']['getIndex'](_0x4e2643):this['focusables']['length'],-0x1!==_0x1d1923){if(_0x1d1923===_0x1b5a9d-0x1)return;this['focusables']['remove'](_0x138c76),_0x1b5a9d=_0x4e2643?this['focusables']['getIndex'](_0x4e2643):this['focusables']['length'];}this['focusables']['add'](_0x138c76,_0x1b5a9d);}};const bi=/* #__PURE__ -- @preserve */
|
|
33
|
+
_0x3e4b52('px');var Ei=class extends ht{content;_targetTop;_mutationObserver;constructor(_0x355666){super(_0x355666),this['set']('top',0x0),this['set']('height',0x0),this['bind']('bottom')['to'](this,'top',this,'height',(_0x15811e,_0x121770)=>_0x15811e+_0x121770),this['set']('isAnimationDisabled',!0x1),this['_mutationObserver']=Xt(()=>this['updateHeight']()),this['_targetTop']=null,this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this);const _0x204b34=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-sidebar-item',_0x204b34['to']('isAnimationDisabled',_0x1ea946=>_0x1ea946?'ck-sidebar-item--no-animation':'')],'style':{'top':_0x204b34['to']('top',_0x294967=>bi(_0x294967))},'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['_mutationObserver']['attach'](this['element']);}['focus'](){this['content']['first']&&this['content']['first']['focus']();}updateHeight(){const _0x2996da=this['element']['clientHeight'];_0x2996da&&(this['height']=_0x2996da);}destroy(){this['content']['clear'](),this['_mutationObserver']['detach'](),super['destroy']();}},ki=class extends _0x333ed9{['view'];_activeAnnotation;_annotations;_spaceBetweenItems;_sidebarItemViewToAnnotation;_annotationToSidebarItemView;_recalculateBuffer;static get['pluginName'](){return'Sidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x475c1b){super(_0x475c1b),this['set']('_lastItem',void 0x0),this['view']=this['_createSidebarView'](),this['set']('container',null),this['_spaceBetweenItems']=0x19,this['_sidebarItemViewToAnnotation']=new Map(),this['_annotationToSidebarItemView']=new Map(),this['context']['config']['define']('sidebar.preventScrollOutOfView',!0x1),this['_annotations']=null,this['_activeAnnotation']=null,this['_recalculateBuffer']=[];}init(){const _0x48a3da=this['context']['config']['get']('sidebar.container');_0x48a3da&&this['setContainer'](_0x48a3da);}setContainer(_0x53182c){if(!Oi(_0x53182c))throw new _0x50ddc5('sidebar-setcontainer-invalid-element');this['container']=_0x53182c;}_attachToContainer({viewClass:_0x5dd142='',spaceBetweenItems:_0x4960a9=0x19}={}){if(!Oi(this['container']))throw new _0x50ddc5('sidebar-attachtocontainer-missing-container',this);this['container']['appendChild'](this['view']['element']),this['view']['class']=_0x5dd142,this['_spaceBetweenItems']=_0x4960a9;}['rearrange']({removedAnnotation:_0x1e6b07,previousAnnotation:_0xa6e9cc,nextAnnotation:_0x1d6394}){const _0x471dbd=this['getSidebarItemView'](_0x1e6b07);this['view']['list']['remove'](_0x471dbd),this['_destroySidebarItemView'](_0x1e6b07),_0xa6e9cc&&this['_alignToTargetRect'](this['getSidebarItemView'](_0xa6e9cc)),_0x1d6394&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x1d6394)),this['_updateLastItem']();}['refresh']({blurredAnnotation:_0xa52e70,activatedAnnotation:_0x3dcfa0,disableAnimationOnActivatedAnnotation:_0x4d8fd2}){if(this['_activeAnnotation']=_0x3dcfa0,_0xa52e70){_0xa52e70['isActive']=!0x1;const _0x18750f=this['getSidebarItemView'](_0xa52e70);_0x18750f&&_0x4d8fd2&&(_0x18750f['isAnimationDisabled']=!0x1);}if(_0x3dcfa0){const _0x1d1a65=this['getSidebarItemView'](_0x3dcfa0);_0x1d1a65&&(_0x3dcfa0['isActive']=!0x0,_0x4d8fd2&&(_0x1d1a65['isAnimationDisabled']=!0x0,_0x1d1a65['top']+=0x1),this['_alignToTargetRect'](_0x1d1a65));}}_detachFromContainer(_0x517b8e){if(this['view']['element']['remove'](),_0x517b8e){for(const _0x80925b of _0x517b8e)this['_destroySidebarItemView'](_0x80925b);}this['view']['list']['clear'](),this['view']['class']='',this['_lastItem']=null;}addAnnotation(_0x9c0ec2,_0x309a0e){_0x309a0e||(_0x309a0e=_0x9c0ec2['view']);const _0x3ee239=new Ei(this['context']['locale']);this['_sidebarItemViewToAnnotation']['set'](_0x3ee239,_0x9c0ec2),this['_annotationToSidebarItemView']['set'](_0x9c0ec2,_0x3ee239),_0x3ee239['content']['add'](_0x309a0e),this['listenTo'](_0x9c0ec2['view'],'change:targetRect',(_0x46c7c9,_0x5590b6,_0x4162de)=>{const _0x12086a=this['_getTargetTop'](_0x9c0ec2,_0x4162de);_0x3ee239['_targetTop']!=_0x12086a&&(_0x3ee239['_targetTop']=_0x12086a,this['_setItemTop'](_0x3ee239,_0x12086a));}),this['listenTo'](_0x3ee239,'change:top',()=>{this['_recalculate'](_0x3ee239,'top');}),this['listenTo'](_0x3ee239,'change:bottom',()=>{this['_recalculate'](_0x3ee239,'bottom');}),this['_alignToTargetRect'](_0x3ee239);const _0x3042fe=this['_getItemBefore'](_0x3ee239);return _0x3042fe&&this['_alignAfterItem'](_0x3042fe,_0x3ee239)||this['_alignToTargetRect'](_0x3ee239),this['_updateLastItem'](),this['view']['list']['add'](_0x3ee239),_0x3ee239;}['_alignForTopChange'](_0x2855bf){if(!_0x2855bf['content']['length'])return;const _0xddf46f=this['_getItemBefore'](_0x2855bf);if(!_0xddf46f)return;const _0x270778=this['_sidebarItemViewToAnnotation']['get'](_0xddf46f),_0x500db0=this['_activeAnnotation'];_0x500db0&&_0x500db0===_0x270778?this['_alignAfterItem'](_0xddf46f,_0x2855bf):this['_alignBeforeItem'](_0x2855bf,_0xddf46f);}_alignForBottomChange(_0x299625){if(!_0x299625['content']['length'])return;const _0x1fa845=this['_getItemAfter'](_0x299625);if(!_0x1fa845)return;const _0x45adc1=this['_sidebarItemViewToAnnotation']['get'](_0x1fa845),_0x4eeabe=this['context']['config']['get']('sidebar.preventScrollOutOfView'),_0xca1b98=this['_activeAnnotation'];_0xca1b98&&_0xca1b98===_0x45adc1&&_0x4eeabe?(this['_alignBeforeItem'](_0x1fa845,_0x299625),this['_alignAfterItem'](_0x299625,_0x1fa845)):_0xca1b98&&_0xca1b98===_0x45adc1?this['_alignBeforeItem'](_0x1fa845,_0x299625):this['_alignAfterItem'](_0x299625,_0x1fa845);}_recalculate(_0x1ef073,_0x25e60f){0x0===this['_recalculateBuffer']['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x4f891f,changedProp:_0x5897d0}of this['_recalculateBuffer'])'top'===_0x5897d0?this['_alignForTopChange'](_0x4f891f):this['_alignForBottomChange'](_0x4f891f);this['_recalculateBuffer']=[];},0xa),this['_recalculateBuffer']['push']({'sidebarItemView':_0x1ef073,'changedProp':_0x25e60f});}getSidebarItemView(_0x5d4754){return this['_annotationToSidebarItemView']['get'](_0x5d4754);}destroy(){this['stopListening'](),this['view']['destroy']();}_destroySidebarItemView(_0xbf3b83){const _0x244396=this['getSidebarItemView'](_0xbf3b83);this['stopListening'](_0x244396),this['stopListening'](_0xbf3b83['view']),_0x244396['destroy'](),this['_annotationToSidebarItemView']['delete'](_0xbf3b83),this['_sidebarItemViewToAnnotation']['delete'](_0x244396);}_createSidebarView(){const _0x219277=new Ii(this['context']['locale']);return _0x219277['render'](),this['on']('change:_lastItem',(_0x286b6f,_0x248675,_0x564b3f,_0x132d39)=>{_0x132d39&&_0x219277['unbind']('minHeight'),_0x564b3f?_0x219277['bind']('minHeight')['to'](_0x564b3f,'bottom'):_0x219277['minHeight']=null;}),_0x219277;}_updateLastItem(){this['_lastItem']=this['_annotations']?.['last']?this['getSidebarItemView'](this['_annotations']['last']):null;}_getItemBefore(_0x3aa4f4){const _0x151ed8=this['_sidebarItemViewToAnnotation']['get'](_0x3aa4f4),_0x4d2438=_0x151ed8&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x151ed8)-0x1);return _0x4d2438&&this['getSidebarItemView'](_0x4d2438)||null;}_getItemAfter(_0x1674db){const _0x5ca647=this['_sidebarItemViewToAnnotation']['get'](_0x1674db),_0xe6cbcb=_0x5ca647&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x5ca647)+0x1);return _0xe6cbcb&&this['getSidebarItemView'](_0xe6cbcb)||null;}_alignBeforeItem(_0x3ff250,_0x28db07){_0x3ff250['updateHeight']();const _0x11fab3=Ni(_0x28db07['bottom']+this['_spaceBetweenItems'],_0x3ff250['top']);return!!_0x11fab3&&(this['_setItemTop'](_0x28db07,_0x28db07['top']-_0x11fab3),!0x0);}_alignAfterItem(_0x4a651b,_0x311d38){_0x4a651b['updateHeight']();const _0x1ce55b=Ni(_0x4a651b['bottom']+this['_spaceBetweenItems'],_0x311d38['top']);return!!_0x1ce55b&&(this['_setItemTop'](_0x311d38,_0x311d38['top']+_0x1ce55b,!0x1),!0x0);}_alignToTargetRect(_0x298aa9){const _0x267da1=this['_sidebarItemViewToAnnotation']['get'](_0x298aa9);if(!_0x267da1||!_0x267da1['target']||!_0x267da1['targetRect'])return;const _0x29b9e5=this['_getTargetTop'](_0x267da1,_0x267da1['targetRect']);this['_setItemTop'](_0x298aa9,_0x29b9e5);}_getTargetTop(_0x50e41c,_0x3b75be){if(null===_0x3b75be)return 0x0;if(_0x50e41c['target']instanceof _0x2a80a4)return _0x3b75be['top'];{const _0x5f0eff=new _0x2a80a4(this['view']['element'])['top'];return _0x3b75be['top']-_0x5f0eff;}}_setItemTop(_0x2692cd,_0x39e4e4,_0x546db8=this['context']['config']['get']('sidebar.preventScrollOutOfView')){_0x546db8&&(_0x39e4e4=Math['max'](_0x39e4e4,this['_getMaxAvailableTop'](_0x2692cd))),_0x2692cd['top']=_0x39e4e4;}_getMaxAvailableTop(_0x3ada0e){let _0x3ac9ab=this['_getItemBefore'](_0x3ada0e),_0x28266d=0x0;for(;_0x3ac9ab;)_0x3ac9ab['updateHeight'](),_0x28266d+=this['_spaceBetweenItems']+_0x3ac9ab['height'],_0x3ac9ab=this['_getItemBefore'](_0x3ac9ab);return _0x28266d;}};function Ni(_0x333f9e,_0x438174){return Math['max'](_0x333f9e-_0x438174,0x0);}function Oi(_0x15d8b1){return null!==_0x15d8b1&&'object'==typeof _0x15d8b1&&0x1===_0x15d8b1['nodeType'];}var Mi=class extends _0x333ed9{isAttached;annotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'WideSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5b8c19){super(_0x5b8c19),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_editorAnnotations']=new _0x549ed4(),this['_refreshPositioningDebounced']=_0x174c5f(()=>{_0x5b8c19['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();},0xfa,{'leading':!0x1});}init(){const _0xd6669b=this['context']['plugins']['get'](Ti),_0x1cca2b=this['context']['plugins']['get'](ki);_0xd6669b['register']('wideSidebar',this),_0x1cca2b['container']&&_0xd6669b['switchTo']('wideSidebar');}setActiveAnnotation(_0x134cda){if(_0x134cda===this['activeAnnotation'])return;const _0x40c754=this['context']['plugins']['get'](ki);_0x40c754['_activeAnnotation']=_0x134cda;const _0x4d435a=this['activeAnnotation'];_0x40c754['refresh']({'blurredAnnotation':_0x4d435a,'activatedAnnotation':_0x134cda}),this['activeAnnotation']=_0x134cda;}attach(_0x261af1){this['annotations']=_0x261af1;const _0x5a4b79=this['context']['plugins']['get'](ki);if(_0x5a4b79['_annotations']=_0x261af1,this['isAttached'])throw new _0x50ddc5('widesidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x5a4b79,'set:container',()=>{this['detach'](),this['listenTo'](_0x5a4b79,'change:container',_0x531866=>{_0x531866['off'](),this['attach'](_0x261af1);});}),_0x5a4b79['_attachToContainer']({'viewClass':'ck-sidebar--wide'});const _0x313ed0=_0x1a7dce=>{_0x1a7dce['updateTargetRect'](),_0x5a4b79['addAnnotation'](_0x1a7dce);};for(const _0x58894f of _0x261af1)_0x313ed0(_0x58894f);this['listenTo'](_0x261af1,'add',(_0x4babd7,_0x46f96c)=>{_0x313ed0(_0x46f96c);}),this['listenTo'](_0x261af1,'remove',(_0x5621a6,_0x48457a,_0x50e40b)=>{_0x5a4b79['rearrange']({'removedAnnotation':_0x48457a,'previousAnnotation':_0x261af1['get'](_0x50e40b-0x1),'nextAnnotation':_0x261af1['get'](_0x50e40b+0x1)}),_0x48457a===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'high'}),this['listenTo'](_0x261af1,'focus',(_0x37c0e6,_0x335730)=>{this['setActiveAnnotation'](_0x335730);}),this['listenTo'](_0x261af1,'blur',()=>{this['setActiveAnnotation'](null);});const _0xc00640=this['context']instanceof _0x5dcde4?this['context']['editors']:new _0x549ed4([this['context']]);for(const _0x1b84ff of _0xc00640)this['_integrateWithEditorAnnotations'](_0x1b84ff);this['listenTo'](_0xc00640,'add',(_0xb34b2a,_0x369e0d)=>{this['listenTo'](_0x369e0d,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x369e0d);});}),this['listenTo'](_0xc00640,'remove',(_0x56ee16,_0x56bd42)=>{_0x56bd42['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x56bd42['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();}detach(){if(!this['isAttached'])throw new _0x50ddc5('widesidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x44484d=this['context']['plugins']['get'](ki);_0x44484d['_detachFromContainer'](this['annotations']),this['stopListening'](_0x44484d),this['stopListening'](this['annotations']),this['context']instanceof _0x5dcde4&&this['stopListening'](this['context']['editors']);for(const _0x11e471 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x11e471);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['activeAnnotation']=null,this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach']();}_integrateWithEditorAnnotations(_0x457b31){if(!_0x457b31['plugins']['has']('EditorAnnotations'))return;const _0x13a68d=_0x457b31['plugins']['get']('EditorAnnotations'),_0x3d8547=()=>{const _0x4ac2cc=_0x13a68d['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['setActiveAnnotation'](_0x4ac2cc[0x0]||null);};this['listenTo'](_0x13a68d,'refresh',_0x3d8547),this['listenTo'](_0x13a68d,'blur',(_0xc0421c,{isAnnotationTracked:_0x58894d})=>{this['activeAnnotation']&&_0x58894d(this['activeAnnotation'])&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x13a68d,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](this['annotations'],'blur',_0x5299d8=>{_0x13a68d['hasDomSelection']()&&(_0x3d8547(),_0x5299d8['stop']());},{'priority':'high'}),this['_editorAnnotations']['add'](_0x13a68d);}_destroyEditorAnnotationsIntegration(_0x2907bc){this['stopListening'](_0x2907bc),this['_editorAnnotations']['remove'](_0x2907bc);}},Ri=class extends _0x126747{counterView;constructor(_0x3b85a2){super(_0x3b85a2);const _0x3c67ea=this['bindTemplate'];this['set']('isDirty',!0x1),this['set']('number',0x0),this['bind']('_badge')['to'](this,'isDirty',this,'number',(_0x5ba276,_0x4a2936)=>_0x5ba276?'...':_0x4a2936['toString']()),this['set']('annotationType',''),this['icon']=_0x5e7948,this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this['counterView']=new ht(),this['counterView']['setTemplate']({'tag':'span','attributes':{'class':['ck-annotation-counter__badge',_0x3c67ea['to']('annotationType',_0x469296=>'ck-annotation-counter__badge--'+_0x469296),_0x3c67ea['if']('isDirty','ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x3c67ea['to']('_badge')}]}),this['children']['add'](this['counterView']);}},Si=class extends _0x333ed9{isAttached;annotations;_manuallyClosedAnnotationViews;_domEmitter;_annotationToNarrowView;_selectedAnnotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'NarrowSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x49d16f){super(_0x49d16f),this['isAttached']=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this['_domEmitter']=new(_0x3be4b8())(),this['_annotationToNarrowView']=new Map(),this['set']('activeAnnotation',null),this['annotations']=null,this['_selectedAnnotations']=[],this['_editorAnnotations']=new _0x549ed4(),this['_refreshPositioningDebounced']=_0x174c5f(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}init(){this['context']['plugins']['get'](Ti)['register']('narrowSidebar',this),this['bodyCollection']=new _0x3958e2(this['context']['locale']),this['balloonPanelView']=new _0x44b29b(this['context']['locale']),this['bodyCollection']['attachToDom'](),this['bodyCollection']['add'](this['balloonPanelView']);}attach(_0x561436){this['annotations']=_0x561436;const _0x4f362a=this['context']['plugins']['get'](ki),_0x19e090=this['balloonPanelView'];if(_0x4f362a['_annotations']=_0x561436,this['isAttached'])throw new _0x50ddc5('narrowsidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x4f362a,'set:container',()=>{this['detach'](),this['listenTo'](_0x4f362a,'change:container',_0xcec8af=>{_0xcec8af['off'](),this['attach'](_0x561436);});}),_0x4f362a['_attachToContainer']({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5});const _0x15d1b4=_0x53b0eb=>{const _0x2730c6=new Ri(this['context']['locale']);_0x4f362a['addAnnotation'](_0x53b0eb,_0x2730c6),this['_annotationToNarrowView']['set'](_0x53b0eb,_0x2730c6),_0x2730c6['bind']('isDirty','annotationType','number')['to'](_0x53b0eb['view'],'isDirty','type','length'),_0x2730c6['on']('execute',()=>{this['_manuallyClosedAnnotationViews']['clear'](),_0x19e090['content']['first']!==_0x53b0eb['view']?(this['_showBalloon'](_0x53b0eb),_0x53b0eb['view']['element']['focus'](),this['setActiveAnnotation'](_0x53b0eb)):this['setActiveAnnotation'](null);});};for(const _0x594b77 of _0x561436)_0x15d1b4(_0x594b77);this['listenTo'](_0x561436,'add',(_0x5d62f0,_0x469ff0)=>{_0x15d1b4(_0x469ff0);}),this['listenTo'](_0x561436,'remove',(_0x8fa61f,_0x3855b3,_0x584130)=>{this['_annotationToNarrowView']['get'](_0x3855b3)['destroy'](),this['_annotationToNarrowView']['delete'](_0x3855b3),_0x4f362a['rearrange']({'removedAnnotation':_0x3855b3,'previousAnnotation':_0x561436['get'](_0x584130-0x1),'nextAnnotation':_0x561436['get'](_0x584130+0x1)}),_0x3855b3===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'low'}),this['listenTo'](_0x561436,'focus',(_0x3cd404,_0x206191)=>{this['setActiveAnnotation'](_0x206191);}),this['listenTo'](_0x561436,'blur',()=>{this['setActiveAnnotation'](null);}),this['_domEmitter']['listenTo'](document,'keydown',(_0x132f19,_0xa250b1)=>{_0xa250b1['keyCode']===_0x30127a['esc']&&_0x19e090['isVisible']&&(this['_manuallyClosedAnnotationViews']['add'](_0x19e090['content']['first']),this['_hideBalloon'](),_0xa250b1['stopPropagation'](),_0xa250b1['preventDefault']());}),this['_domEmitter']['listenTo'](document,'mousedown',(_0x253e48,_0x232cf7)=>{const _0x38cc95=_0x232cf7['target'];_0x19e090['isVisible']&&_0x19e090['element']['contains'](_0x38cc95)||_0x4f362a['view']['element']['contains'](_0x38cc95)||_0x253e48['preventClosingBalloon']||this['activeAnnotation']&&this['activeAnnotation']['focusableElements']['find'](_0x28a707=>_0x28a707['contains'](_0x38cc95))||(this['_manuallyClosedAnnotationViews']['clear'](),this['_hideBalloon'](),this['setActiveAnnotation'](null));});const _0x52e3f3=this['context']instanceof _0x5dcde4?this['context']['editors']:new _0x549ed4([this['context']]);for(const _0x224f7d of _0x52e3f3)this['_integrateWithEditorAnnotations'](_0x224f7d);this['listenTo'](_0x52e3f3,'add',(_0x43e212,_0x4a4637)=>{this['listenTo'](_0x4a4637,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x4a4637);});}),this['listenTo'](_0x52e3f3,'remove',(_0x74e86b,_0x4703a6)=>{_0x4703a6['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x4703a6['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioning']();}setActiveAnnotation(_0x36dcdd){if(_0x36dcdd===this['activeAnnotation'])return;const _0x188b6c=this['context']['plugins']['get'](ki);_0x188b6c['refresh']({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x36dcdd,'disableAnimationOnActivatedAnnotation':!0x0}),_0x36dcdd&&_0x188b6c['getSidebarItemView'](_0x36dcdd)?this['_showBalloon'](_0x36dcdd):this['_hideBalloon'](),this['activeAnnotation']=_0x36dcdd;}detach(){if(!this['isAttached'])throw new _0x50ddc5('narrowsidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0xcfedf4=this['context']['plugins']['get'](ki);this['_hideBalloon'](),Array['from'](this['_annotationToNarrowView']['values'](),_0x42fa2c=>_0x42fa2c['destroy']()),this['_annotationToNarrowView']['clear'](),_0xcfedf4['_detachFromContainer'](this['annotations']),this['stopListening'](),this['_domEmitter']['stopListening'](),this['context']instanceof _0x5dcde4&&this['stopListening'](this['context']['editors']);for(const _0x3843e1 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x3843e1);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['_selectedAnnotations']=[],this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['bodyCollection']['detachFromDom']();}_integrateWithEditorAnnotations(_0x125635){if(!_0x125635['plugins']['has']('EditorAnnotations'))return;const _0x4beaad=_0x125635['plugins']['get']('EditorAnnotations'),_0x57a57a=this['context']['plugins']['get'](ki),_0x51a82a=this['annotations'],_0x9c4ac=this['balloonPanelView'],_0x1716c6=()=>{const _0x9d0940=_0x4beaad['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['_setSelectedAnnotations'](_0x9d0940),this['setActiveAnnotation'](_0x9d0940[0x0]||null);};this['listenTo'](_0x4beaad,'refresh',_0x1716c6),this['listenTo'](_0x4beaad,'blur',(_0x18d116,{isAnnotationTracked:_0x579aaa})=>{this['activeAnnotation']&&_0x579aaa(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x4beaad,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](_0x51a82a,'blur',_0x22b753=>{_0x4beaad['hasDomSelection']()&&_0x22b753['stop']();},{'priority':'high'}),this['listenTo'](this['_domEmitter'],'mousedown',(_0x1fcc6f,_0x37e04d)=>{const _0xaba4=_0x37e04d['target'];_0x9c4ac['isVisible']&&_0x9c4ac['element']['contains'](_0xaba4)||_0x57a57a['view']['element']['contains'](_0xaba4)||this['activeAnnotation']&&_0x4beaad['hasDomSelection']()&&(_0x1716c6(),_0x1fcc6f['preventClosingBalloon']=!0x0);},{'priority':'high'}),this['_editorAnnotations']['add'](_0x4beaad);}_destroyEditorAnnotationsIntegration(_0x1cd1e6){_0x1cd1e6&&(this['stopListening'](_0x1cd1e6),this['_editorAnnotations']['remove'](_0x1cd1e6));}_setSelectedAnnotations(_0x43dfeb){for(const _0x5d6850 of this['_selectedAnnotations'])_0x43dfeb['includes'](_0x5d6850)||this['_manuallyClosedAnnotationViews']['delete'](_0x5d6850['view']);this['_selectedAnnotations']=_0x43dfeb;}_refreshPositioning(){const _0x338016=this['balloonPanelView'];this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning'](),_0x338016['isVisible']&&this['_updateBalloonPosition']();}['_showBalloon'](_0x13214c){if(this['_manuallyClosedAnnotationViews']['has'](_0x13214c['view']))return;const _0x37a86f=this['balloonPanelView']['content']['first'];_0x37a86f!==_0x13214c['view']?(_0x37a86f&&this['_detachListeners'](_0x37a86f),this['_attachListeners'](_0x13214c['view']),this['balloonPanelView']['content']['clear'](),this['balloonPanelView']['content']['add'](_0x13214c['view']),this['_updateBalloonPosition']()):this['_updateBalloonPosition']();}_updateBalloonPosition(){const _0x4717e8=this['balloonPanelView']['content']['first'],_0x49f8a0=_0x4717e8&&this['annotations']['getByView'](_0x4717e8);if(!_0x49f8a0||!this['_annotationToNarrowView']['has'](_0x49f8a0))return;const _0x5e5ca4=this['_annotationToNarrowView']['get'](_0x49f8a0)['element'],_0x27a820=(function(){const _0x43bc8f=_0x44b29b['defaultPositions'];return[_0x43bc8f['southArrowNorthEast'],_0x43bc8f['northArrowSouthEast'],_0x43bc8f['southArrowNorth'],_0x43bc8f['northArrowSouth'],_0x43bc8f['southArrowNorthWest'],_0x43bc8f['northArrowSouthWest']];}());this['balloonPanelView']['pin']({'target':_0x5e5ca4,'positions':_0x27a820});}['_hideBalloon'](){const _0x25cb77=this['balloonPanelView'],_0x1dd9a1=_0x25cb77['content']['first'];_0x1dd9a1&&(this['_detachListeners'](_0x1dd9a1),_0x25cb77['unpin'](),_0x25cb77['content']['clear']());}_attachListeners(_0x512157){this['listenTo'](_0x512157,'change:height',()=>this['_updateBalloonPosition']()),this['listenTo'](_0x512157,'Esc',(_0xf0a15b,_0x1ad2cc)=>{this['_manuallyClosedAnnotationViews']['add'](_0x512157),this['_hideBalloon'](),_0x1ad2cc();});}_detachListeners(_0x457438){this['stopListening'](_0x457438);}},xi=class extends _0x3de2ea{isAttached;annotations;['_manuallyClosed'];['_balloon'];_addedAnnotations;_selectedAnnotations;['_forceRefresh'];_refreshVisibilityDebounced;static get requires(){return[di,_0x853866,Ti];}static get['pluginName'](){return'InlineAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x6f7241){super(_0x6f7241),_0x6f7241['editing']['view']['addObserver'](lt),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_manuallyClosed']=new Set(),this['_balloon']=_0x6f7241['plugins']['get'](_0x853866),this['_addedAnnotations']=new Set(),this['_selectedAnnotations']=[],this['_forceRefresh']=!0x1,this['_refreshVisibilityDebounced']=_0x174c5f(()=>{this['editor']['plugins']['get']('Annotations')['refreshVisibility']();},0xfa,{'leading':!0x1});}init(){const _0x73a318=this['editor']['plugins']['get'](Ti);_0x73a318['context']===this['editor']&&(_0x73a318['register']('inline',this),this['editor']['keystrokes']['set']('Esc',(_0x56a98a,_0x26a246)=>{const _0x34d90f=this['_balloon'];if(this['isAttached']&&_0x34d90f['visibleView']){const _0x3038f5=this['annotations']['getByView'](_0x34d90f['visibleView']);_0x3038f5&&this['_closeAnnotation'](_0x3038f5),_0x26a246();}}));}afterInit(){const _0x5d3416=this['editor']['plugins']['get'](Ti);_0x5d3416['context']===this['editor']&&(_0x5d3416['hasActive']()||_0x5d3416['switchTo']('inline'));}setActiveAnnotation(_0x2b892e){_0x2b892e!==this['activeAnnotation']&&(this['activeAnnotation']&&(this['activeAnnotation']['isActive']=!0x1),_0x2b892e&&this['editor']['ui']['focusTracker']['isFocused']&&(this['annotations']['has'](_0x2b892e)&&this['_addAnnotationToBalloon'](_0x2b892e,!0x0),_0x2b892e['isActive']=!0x0),_0x2b892e||this['_setSelectedAnnotations']([]),this['activeAnnotation']=_0x2b892e);}attach(_0x433024){this['annotations']=_0x433024;const _0x25bfdd=this['editor']['plugins']['get'](Ti),_0x2c579d=this['_balloon'];if(this['isAttached'])throw new _0x50ddc5('inlineannotations-attach-already-attached',this);if(_0x25bfdd['context']!==this['editor'])throw new _0x50ddc5('inlineannotations-not-allowed-with-context',this);const _0x119d4a=this['editor']['plugins']['get'](di);this['listenTo'](_0x119d4a,'refresh',()=>{const _0x71f2fa=_0x119d4a['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});var _0xadc5c2,_0x50e99b;!this['_forceRefresh']&&(_0xadc5c2=_0x71f2fa,_0x50e99b=this['_selectedAnnotations'],_0xadc5c2['length']===_0x50e99b['length']&&_0xadc5c2['every'](_0x1eb0ee=>_0x50e99b['includes'](_0x1eb0ee)))||(this['_forceRefresh']=!0x1,this['_setSelectedAnnotations'](_0x71f2fa),this['setActiveAnnotation'](_0x71f2fa[0x0]||null));}),this['listenTo'](_0x119d4a,'blur',(_0x3d6d77,{isAnnotationTracked:_0x453323})=>{this['activeAnnotation']&&_0x453323(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x119d4a,'uiUpdate',()=>{this['_refreshVisibilityDebounced']();}),this['listenTo'](this['editor']['ui']['focusTracker'],'change:isFocused',(_0x38ffe2,_0x30b7b2,_0x27d15a)=>{_0x27d15a||this['setActiveAnnotation'](null);}),this['listenTo'](_0x433024,'remove',(_0x430544,_0x5295cd)=>{this['_removeAnnotationFromBalloon'](_0x5295cd),_0x5295cd===this['activeAnnotation']&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x2c579d,'change:visibleView',(_0x224545,_0x5f0e06,_0x387175,_0x54b914)=>{_0x54b914&&this['stopListening'](_0x54b914);const _0x1276ac=_0x433024['getByView'](_0x387175);_0x387175&&_0x1276ac&&(this['listenTo'](_0x387175,'change:height',()=>{_0x2c579d['updatePosition']();}),this['listenTo'](_0x387175,'Esc',()=>{this['_closeAnnotation'](_0x1276ac),this['editor']['editing']['view']['focus']();}),this['activeAnnotation']!==_0x1276ac&&this['setActiveAnnotation'](_0x1276ac));}),this['listenTo'](this['editor']['ui'],'update',()=>{_0x2c579d['visibleView']&&_0x433024['getByView'](_0x2c579d['visibleView'])&&_0x2c579d['updatePosition']();}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',()=>{this['_forceRefresh']=!0x0,this['_manuallyClosed']['clear']();}),this['editor']['editing']['view']['document']['selection']['editableElement']&&this['editor']['editing']['view']['focus'](),this['isAttached']=!0x0;}detach(){if(!this['isAttached'])throw new _0x50ddc5('inlineannotations-detach-not-attached',this);this['setActiveAnnotation'](null);for(const _0x4041e3 of this['_addedAnnotations'])this['_removeAnnotationFromBalloon'](_0x4041e3);this['_refreshVisibilityDebounced']['cancel'](),this['stopListening'](),this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_refreshVisibilityDebounced']['cancel']();}_setSelectedAnnotations(_0x157e98){for(const _0x1dd6b5 of this['_selectedAnnotations'])_0x157e98['includes'](_0x1dd6b5)||this['_manuallyClosed']['delete'](_0x1dd6b5);for(const _0xca814d of this['annotations'])_0x157e98['includes'](_0xca814d)||this['_removeAnnotationFromBalloon'](_0xca814d);if(this['editor']['ui']['focusTracker']['isFocused']){for(const _0xac2348 of _0x157e98)this['_addAnnotationToBalloon'](_0xac2348);}this['_selectedAnnotations']=_0x157e98;}_addAnnotationToBalloon(_0xf9f2d0,_0x32db7f=!0x1){this['_manuallyClosed']['has'](_0xf9f2d0)||(this['_addedAnnotations']['has'](_0xf9f2d0)||this['_balloon']['hasView'](_0xf9f2d0['view'])||(this['_addedAnnotations']['add'](_0xf9f2d0),this['_balloon']['add']({'stackId':_0xf9f2d0['view']['id'],'view':_0xf9f2d0['view'],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0xf9f2d0)}})),_0x32db7f&&this['_balloon']['showStack'](_0xf9f2d0['view']['id']));}_getBalloonTargetForAnnotation(_0x40c460){const _0x2d7c60=_0x40c460['target'],_0x5c57f1=this['editor']['editing']['view'],_0xe652ad=_0x5c57f1['document']['selection']['getFirstRange'](),_0x3dee60=_0x5c57f1['domConverter']['viewRangeToDom'](_0xe652ad);if(_0x3dee60['collapse'](!0x0),_0x2d7c60){if(_0x2d7c60 instanceof _0x2a80a4)return _0x2d7c60;let _0x2fa7f6=[];for(const _0x77b801 of _0x2d7c60)_0x2fa7f6['push'](..._0x2a80a4['getDomElementRects'](_0x77b801));_0x2fa7f6=function(_0x4f1a7f){const _0x3eb5e7=[];let _0x2b8d11=_0x4f1a7f[0x0];for(let _0x3ed29c=0x1;_0x3ed29c<_0x4f1a7f['length'];_0x3ed29c++)if(Pi(_0x2b8d11,_0x4f1a7f[_0x3ed29c])){const _0xddde81=_0x4f1a7f[_0x3ed29c]['width'];_0x2b8d11['width']+=_0xddde81,_0x2b8d11['right']+=_0xddde81;}else _0x3eb5e7['push'](_0x2b8d11),_0x2b8d11=_0x4f1a7f[_0x3ed29c];return _0x3eb5e7['push'](_0x2b8d11),_0x3eb5e7;}(_0x2fa7f6);const _0x44f067=_0x3dee60['getBoundingClientRect']();return _0x2fa7f6['find'](_0x34cea4=>_0x34cea4['top']<=_0x44f067['top']&&_0x34cea4['bottom']>=_0x44f067['bottom']&&_0x34cea4['left']<=_0x44f067['left']&&_0x34cea4['right']>=_0x44f067['right'])||_0x2fa7f6[0x0];}return _0x40c460['targetRect']||_0x3dee60;}_removeAnnotationFromBalloon(_0x49d07e){this['_addedAnnotations']['has'](_0x49d07e)&&this['_balloon']['hasView'](_0x49d07e['view'])&&(this['_addedAnnotations']['delete'](_0x49d07e),this['_balloon']['remove'](_0x49d07e['view']));}_closeAnnotation(_0x18d2d6){this['_manuallyClosed']['add'](_0x18d2d6),this['_removeAnnotationFromBalloon'](_0x18d2d6);}};function Pi(_0x1af280,_0x474ea8){return _0x1af280['top']===_0x474ea8['top']&&_0x1af280['bottom']===_0x474ea8['bottom']&&_0x1af280['right']===_0x474ea8['left'];}var Li=class extends ht{['focusTracker'];['focusCycler'];_annotationViews;constructor(_0x2774be,_0x443186){super(_0x2774be),this['set']('isEmpty',!_0x443186['length']),this['focusTracker']=new _0x1d3923(),this['_annotationViews']=_0x443186,this['_annotationViews']['delegate']('arrowup','arrowdown')['to'](this),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['focusCycler']=new et({'focusables':_0x443186,'focusTracker':this['focusTracker']}),this['listenTo'](_0x443186,'add',()=>{this['isEmpty']=!0x1;}),this['listenTo'](_0x443186,'remove',(_0xd253fb,_0x1f4f8a)=>{_0x1f4f8a['isActive']&&this['focus'](),_0x443186['length']||(this['isEmpty']=!0x0);});const _0x46e20d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'dir':'auto','class':['ck','ck-comments-archive'],'tabindex':-0x1,'role':'list','aria-label':Et(_0x2774be,'COMMENTS_ARCHIVE_LIST_LABEL')},'children':[{'tag':'div','attributes':{'class':['ck-comments-archive__content'],'role':'presentation'},'children':[{'tag':'div','attributes':{'role':'presentation'},'children':_0x443186},{'tag':'p','attributes':{'class':['ck-comments-archive__info',_0x46e20d['if']('isEmpty','ck-hidden',_0x58158d=>!_0x58158d)]},'children':[{'text':Et(_0x2774be,'EMPTY_COMMENTS_ARCHIVE')}]}]}]});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}destroy(){super['destroy'](),this['focusTracker']['destroy']();}['focus'](){this['focusCycler']['first']?this['focusCycler']['focusFirst']():this['element']['focus']();}_setupKeyboardNavigation(){for(const _0x48775b of this['_annotationViews'])this['focusTracker']['add'](_0x48775b['element']);this['_annotationViews']['on']('change',(_0x5d3383,{added:_0x333812,removed:_0x296b21})=>{for(const _0x50782a of _0x333812)this['focusTracker']['add'](_0x50782a['element']);for(const _0x57fefa of _0x296b21)this['focusTracker']['remove'](_0x57fefa['element']);});}},Di=class extends _0x333ed9{static get['pluginName'](){return'CommentsArchive';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,ti];}constructor(_0x2fcd0c){super(_0x2fcd0c),this['archivedThreads']=new _0x549ed4();}init(){const _0x12e196=this['context'],_0x342aa1=_0x12e196['plugins']['get'](oi),_0x17bbe4=_0x12e196['plugins']['get'](ti);this['listenTo'](_0x342aa1,'addCommentThread',(_0x1b2893,{threadId:_0x4d4337})=>{const _0x210810=_0x342aa1['getCommentThread'](_0x4d4337);_0x210810['archivedAt']&&this['archivedThreads']['add'](_0x210810,this['_calculatePosition'](_0x210810['archivedAt'])),this['listenTo'](_0x210810,'change:archivedAt',(_0x48ffb2,_0x3707a9,_0x5622a4)=>{_0x5622a4?this['archivedThreads']['has'](_0x210810)||this['archivedThreads']['add'](_0x210810,this['_calculatePosition'](_0x210810['archivedAt'])):this['archivedThreads']['has'](_0x210810)&&this['archivedThreads']['remove'](_0x210810);});}),this['listenTo'](_0x342aa1,'removeCommentThread',(_0x4e5e12,{threadId:_0x5509f3})=>{const _0xdb3560=_0x342aa1['getCommentThread'](_0x5509f3);this['stopListening'](_0xdb3560),this['archivedThreads']['has'](_0xdb3560)&&this['archivedThreads']['remove'](_0xdb3560);},{'priority':'highest'}),this['listenTo'](_0x17bbe4['collection'],'focus',(_0x377740,_0x4e5f1b)=>{_0x4e5f1b['isVisible']||(_0x4e5f1b['isActive']=!0x0,_0x17bbe4['activate'](_0x4e5f1b));});}_calculatePosition(_0x589589){const _0x39d3ad=[...this['archivedThreads']]['findIndex'](_0x1d9865=>_0x1d9865['archivedAt']<_0x589589);return _0x39d3ad>-0x1?_0x39d3ad:this['archivedThreads']['length'];}},Vi=class extends _0x3de2ea{commentsArchiveView;annotationViews;['_pendingThreads'];static get['pluginName'](){return'CommentsArchiveUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Di,_0x21ea5c];}constructor(_0x33b157){super(_0x33b157),this['annotationViews']=new at(),this['_pendingThreads']=[];}init(){const _0x58a9e3=this['editor'],_0x5e37db=this['_hideDialogOnAnnotationEscape']['bind'](this);_0x58a9e3['ui']['componentFactory']['add']('commentsArchive',()=>this['_createCommentsArchiveButton'](_0x126747,!0x0)),_0x58a9e3['ui']['componentFactory']['add']('menuBar:commentsArchive',()=>{const _0x2eebb0=this['_createCommentsArchiveButton'](rt);return _0x2eebb0['set']({'role':'menuitemcheckbox'}),_0x2eebb0;});const _0x3f7880=_0x58a9e3['plugins']['get'](Di),_0x2d42c5=_0x58a9e3['plugins']['get']('Annotations'),_0x1ce703=_0x58a9e3['plugins']['get']('CommentsRepository');_0x3f7880['archivedThreads']['forEach'](_0x4dee88=>{this['_handleNewThread'](_0x4dee88);}),this['listenTo'](_0x3f7880['archivedThreads'],'add',(_0x40630a,_0x1dec3d)=>{this['_handleNewThread'](_0x1dec3d);}),this['listenTo'](_0x2d42c5['collection'],'add',(_0x4d2690,_0x172bf8)=>{const _0x402011=this['_pendingThreads']['find'](_0x757091=>{const _0x2ced10=_0x1ce703['_threadToController']['get'](_0x757091);return _0x2ced10&&_0x172bf8['innerView']===_0x2ced10['view'];});if(_0x402011){const _0x110d51=this['_calculatePosition'](_0x402011['archivedAt']);this['_addAnnotationToArchive'](_0x172bf8,_0x110d51),this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x402011),0x1);}}),this['listenTo'](_0x3f7880['archivedThreads'],'remove',(_0x167347,_0x129435)=>{const _0x76d268=_0x58a9e3['config']['get']('collaboration.channelId');if(!_0x76d268||_0x129435['channelId']===_0x76d268){if(this['_pendingThreads']['includes'](_0x129435))this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x129435),0x1);else{const _0x4c5297=_0x1ce703['_threadToController']['get'](_0x129435),_0x52f789=_0x2d42c5['getByInnerView'](_0x4c5297['view']);this['annotationViews']['remove'](_0x52f789['view']),this['stopListening'](_0x52f789),this['stopListening'](_0x52f789['focusableElements']);}}}),this['listenTo'](_0x2d42c5['collection'],'add',(_0x4655dc,_0x325fdf)=>{this['listenTo'](_0x325fdf,'escape',_0x5e37db);}),this['listenTo'](_0x2d42c5['collection'],'remove',(_0x394ebd,_0x126ff5)=>{this['stopListening'](_0x126ff5,'escape',_0x5e37db);});}_addAnnotationToArchive(_0x5b9270,_0x388d22){this['listenTo'](_0x5b9270,'set:isVisible',_0x7d942a=>{_0x7d942a['return']=!0x1,_0x7d942a['stop']();}),this['annotationViews']['add'](_0x5b9270['view'],_0x388d22);}['_handleNewThread'](_0x3e8133){const _0x3b7f45=this['editor']['plugins']['get']('CommentsRepository'),_0x58727e=this['editor']['plugins']['get']('Annotations'),_0x533304=this['editor']['config']['get']('collaboration.channelId');if(!_0x533304||_0x3e8133['channelId']===_0x533304){const _0x4775e7=_0x3b7f45['_threadToController']['get'](_0x3e8133);if(!_0x4775e7)return void this['_pendingThreads']['push'](_0x3e8133);const _0x4a59e7=this['_calculatePosition'](_0x3e8133['archivedAt']),_0x193e89=_0x58727e['getByInnerView'](_0x4775e7['view']);_0x193e89['isVisible']&&_0x58727e['_visibleAnnotations']['remove'](_0x193e89),this['_addAnnotationToArchive'](_0x193e89,_0x4a59e7);}}_calculatePosition(_0x239880){const _0x34e8a9=this['editor']['config']['get']('collaboration.channelId'),_0x5b131a=[...this['editor']['plugins']['get'](Di)['archivedThreads']]['filter'](_0x3f8962=>_0x3f8962['channelId']===_0x34e8a9)['findIndex'](_0x270b0f=>_0x270b0f['archivedAt']<_0x239880);return _0x5b131a<0x0||_0x5b131a>this['annotationViews']['length']?this['annotationViews']['length']:_0x5b131a-0x1;}_toggleDialog(){const _0x16eda2=this['editor'],_0x592940=_0x16eda2['plugins']['get']('Dialog');this['commentsArchiveView']||(this['commentsArchiveView']=new Li(_0x16eda2['locale'],this['annotationViews'])),'commentsArchive'===_0x592940['id']?_0x592940['hide']():_0x592940['show']({'id':'commentsArchive','title':Et(_0x16eda2['locale'],'COMMENTS_ARCHIVE'),'icon':_0x48d9e2,'hasCloseButton':!0x0,'content':this['commentsArchiveView'],'position':_0x184e59['EDITOR_TOP_SIDE']});}_createCommentsArchiveButton(_0x3183d4,_0x227702=!0x1){const _0x4ba976=this['editor']['locale'],_0x48daa9=this['editor']['plugins']['get']('Dialog'),_0x3bb89f=new _0x3183d4(_0x4ba976);return _0x3bb89f['bind']('isEnabled')['to'](this,'isEnabled'),_0x3bb89f['bind']('isOn')['to'](_0x48daa9,'id',_0xb045ed=>'commentsArchive'===_0xb045ed),_0x3bb89f['set']({'label':Et(_0x4ba976,'COMMENTS_ARCHIVE'),'icon':_0x48d9e2,'isToggleable':!0x0}),_0x227702&&(_0x3bb89f['tooltip']=!0x0),this['listenTo'](_0x3bb89f,'execute',()=>this['_toggleDialog']()),_0x3bb89f;}_hideDialogOnAnnotationEscape=_0x341dac=>{const _0x1c81aa=_0x341dac['source'];if(!this['annotationViews']['has'](_0x1c81aa['view']))return;const _0x15d145=this['editor']['plugins']['get']('Dialog');_0x15d145['isOpen']&&'commentsArchive'===_0x15d145['id']&&(_0x15d145['hide'](),_0x341dac['stop']());};},Bi=class extends _0x3de2ea{static get requires(){return[oi,wi,vi,Di,Vi,yi,Mi,Si,xi];}static get['pluginName'](){return'Comments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{ci as AddCommentThreadCommand,$t as Annotation,Jt as AnnotationCollection,Ri as AnnotationCounterButtonView,qt as AnnotationView,ti as Annotations,Ei as AnnotationsSidebarItemView,Ii as AnnotationsSidebarView,Ti as AnnotationsUIs,Ht as BaseCommentThreadView,Kt as BaseCommentView,hi as Comment,ri as CommentThread,bt as CommentThreadController,xt as CommentThreadInputView,Ut as CommentThreadView,Yt as CommentView,Bi as Comments,Di as CommentsArchive,Vi as CommentsArchiveUI,wi as CommentsEditing,Lt as CommentsListView,yi as CommentsOnly,oi as CommentsRepository,vi as CommentsUI,di as EditorAnnotations,xi as InlineAnnotations,Si as NarrowSidebar,ki as Sidebar,Mi as WideSidebar,Qt as bindAnnotationCollections};
|