UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

23 lines • 13.1 kB
/* * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * * * * * +---------------------------------------------------------------------------------+ * | | * | Hello stranger! | * | | * | | * | What you're currently looking at is the source code of a legally protected, | * | proprietary software. Any attempts to deobfuscate / disassemble this code | * | are forbidden and will result in legal consequences. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0x3660f3=_0x4493;function _0x4493(_0x4a346c,_0x46aa4d){const _0x12d7ed=_0x12d7();return _0x4493=function(_0x449381,_0x173060){_0x449381=_0x449381-0x1ac;let _0x16609b=_0x12d7ed[_0x449381];return _0x16609b;},_0x4493(_0x4a346c,_0x46aa4d);}function _0x12d7(){const _0x3e4087=['rearrange','last','6UPwrsO','getIndex','stopListening','_targetTop','_destroySidebarItemView','_updateLastItem','_recalculate','init','sidebar-setcontainer-invalid-element','context','object','_getMaxAvailableTop','_activeAnnotation','change:top','_spaceBetweenItems','_lastItem','container','content','get','updateHeight','unbind','config','865144kxFkfe','top','remove','change:targetRect','delete','change:bottom','_recalculateBuffer','element','destroy','_getTargetTop','setContainer','sidebar.preventScrollOutOfView','isActive','3OykSmj','_alignForTopChange','_alignAfterItem','define','pluginName','isOfficialPlugin','_alignToTargetRect','447412RmQBrJ','set','sidebar-attachtocontainer-missing-container','appendChild','nodeType','refresh','view','list','target','getSidebarItemView','_createSidebarView','_annotationToSidebarItemView','listenTo','sidebar.container','584vebwzZ','change:_lastItem','135972ZefnCd','render','Sidebar','max','1473468CymaGE','bottom','minHeight','_annotations','height','locale','bind','isPremiumPlugin','push','4535335InHsUN','targetRect','3316285XhTzHF','addAnnotation','isAnimationDisabled','_sidebarItemViewToAnnotation','_detachFromContainer','add','9148980hGpnrj','_getItemAfter','_attachToContainer','clear','_getItemBefore','_alignBeforeItem','_alignForBottomChange','_setItemTop','length','class'];_0x12d7=function(){return _0x3e4087;};return _0x12d7();}(function(_0x27961e,_0x38bcf1){const _0x47a22d=_0x4493,_0x1b3b36=_0x27961e();while(!![]){try{const _0x3aa405=parseInt(_0x47a22d(0x1c8))/0x1+-parseInt(_0x47a22d(0x1b4))/0x2+-parseInt(_0x47a22d(0x1c1))/0x3*(-parseInt(_0x47a22d(0x1dc))/0x4)+-parseInt(_0x47a22d(0x1e7))/0x5+parseInt(_0x47a22d(0x1f9))/0x6*(parseInt(_0x47a22d(0x1e5))/0x7)+parseInt(_0x47a22d(0x1d6))/0x8*(parseInt(_0x47a22d(0x1d8))/0x9)+-parseInt(_0x47a22d(0x1ed))/0xa;if(_0x3aa405===_0x38bcf1)break;else _0x1b3b36['push'](_0x1b3b36['shift']());}catch(_0x43ccc9){_0x1b3b36['push'](_0x1b3b36['shift']());}}}(_0x12d7,0x87b41));import{ContextPlugin as _0x373e19}from'ckeditor5/src/core.js';import{Rect as _0x3a00e6,CKEditorError as _0x108ecf}from'ckeditor5/src/utils.js';import _0x1c76c9 from'./view/sidebarview.js';import _0x3611c4 from'./view/sidebaritemview.js';export default class z extends _0x373e19{[_0x3660f3(0x1ce)];[_0x3660f3(0x205)];[_0x3660f3(0x1df)];[_0x3660f3(0x1ac)];[_0x3660f3(0x1ea)];[_0x3660f3(0x1d3)];[_0x3660f3(0x1ba)];static get[_0x3660f3(0x1c5)](){const _0x33cda0=_0x3660f3;return _0x33cda0(0x1da);}static get[_0x3660f3(0x1c6)](){return!0x0;}static get[_0x3660f3(0x1e3)](){return!0x0;}constructor(_0x579f0d){const _0x153d9f=_0x3660f3;super(_0x579f0d),this[_0x153d9f(0x1c9)](_0x153d9f(0x1ad),void 0x0),this[_0x153d9f(0x1ce)]=this[_0x153d9f(0x1d2)](),this[_0x153d9f(0x1c9)](_0x153d9f(0x1ae),null),this[_0x153d9f(0x1ac)]=0x19,this[_0x153d9f(0x1ea)]=new Map(),this[_0x153d9f(0x1d3)]=new Map(),this[_0x153d9f(0x202)][_0x153d9f(0x1b3)][_0x153d9f(0x1c4)](_0x153d9f(0x1bf),!0x1),this[_0x153d9f(0x1df)]=null,this[_0x153d9f(0x205)]=null,this[_0x153d9f(0x1ba)]=[];}[_0x3660f3(0x200)](){const _0x27d2db=_0x3660f3,_0x59c8e1=this[_0x27d2db(0x202)][_0x27d2db(0x1b3)][_0x27d2db(0x1b0)](_0x27d2db(0x1d5));_0x59c8e1&&this[_0x27d2db(0x1be)](_0x59c8e1);}[_0x3660f3(0x1be)](_0x1e14b4){const _0x2f65e9=_0x3660f3;if(!y(_0x1e14b4))throw new _0x108ecf(_0x2f65e9(0x201));this[_0x2f65e9(0x1ae)]=_0x1e14b4;}[_0x3660f3(0x1ef)]({viewClass:_0x15537b='',spaceBetweenItems:_0x1df1e6=0x19}={}){const _0x13466d=_0x3660f3;if(!y(this[_0x13466d(0x1ae)]))throw new _0x108ecf(_0x13466d(0x1ca),this);this[_0x13466d(0x1ae)][_0x13466d(0x1cb)](this[_0x13466d(0x1ce)][_0x13466d(0x1bb)]),this[_0x13466d(0x1ce)][_0x13466d(0x1f6)]=_0x15537b,this[_0x13466d(0x1ac)]=_0x1df1e6;}[_0x3660f3(0x1f7)]({removedAnnotation:_0x545a8c,previousAnnotation:_0x1dd0d1,nextAnnotation:_0x325718}){const _0x41b871=_0x3660f3,_0x4ff799=this[_0x41b871(0x1d1)](_0x545a8c);this[_0x41b871(0x1ce)][_0x41b871(0x1cf)][_0x41b871(0x1b6)](_0x4ff799),this[_0x41b871(0x1fd)](_0x545a8c),_0x1dd0d1&&this[_0x41b871(0x1c7)](this[_0x41b871(0x1d1)](_0x1dd0d1)),_0x325718&&this[_0x41b871(0x1c7)](this[_0x41b871(0x1d1)](_0x325718)),this[_0x41b871(0x1fe)]();}[_0x3660f3(0x1cd)]({blurredAnnotation:_0x2153e7,activatedAnnotation:_0x449a40,disableAnimationOnActivatedAnnotation:_0x4d3eb3}){const _0x3941c9=_0x3660f3;if(this[_0x3941c9(0x205)]=_0x449a40,_0x2153e7){_0x2153e7[_0x3941c9(0x1c0)]=!0x1;const _0x4041b8=this[_0x3941c9(0x1d1)](_0x2153e7);_0x4041b8&&_0x4d3eb3&&(_0x4041b8[_0x3941c9(0x1e9)]=!0x1);}if(_0x449a40){const _0x25f3c5=this[_0x3941c9(0x1d1)](_0x449a40);_0x25f3c5&&(_0x449a40[_0x3941c9(0x1c0)]=!0x0,_0x4d3eb3&&(_0x25f3c5[_0x3941c9(0x1e9)]=!0x0,_0x25f3c5[_0x3941c9(0x1b5)]+=0x1),this[_0x3941c9(0x1c7)](_0x25f3c5));}}[_0x3660f3(0x1eb)](_0x13d5ad){const _0x141af8=_0x3660f3;if(this[_0x141af8(0x1ce)][_0x141af8(0x1bb)][_0x141af8(0x1b6)](),_0x13d5ad){for(const _0x54f39b of _0x13d5ad)this[_0x141af8(0x1fd)](_0x54f39b);}this[_0x141af8(0x1ce)][_0x141af8(0x1cf)][_0x141af8(0x1f0)](),this[_0x141af8(0x1ce)][_0x141af8(0x1f6)]='',this[_0x141af8(0x1ad)]=null;}[_0x3660f3(0x1e8)](_0x464203,_0x3b2962){const _0x3c8887=_0x3660f3;_0x3b2962||(_0x3b2962=_0x464203[_0x3c8887(0x1ce)]);const _0x523282=new _0x3611c4(this[_0x3c8887(0x202)][_0x3c8887(0x1e1)]);this[_0x3c8887(0x1ea)][_0x3c8887(0x1c9)](_0x523282,_0x464203),this[_0x3c8887(0x1d3)][_0x3c8887(0x1c9)](_0x464203,_0x523282),_0x523282[_0x3c8887(0x1af)][_0x3c8887(0x1ec)](_0x3b2962),this[_0x3c8887(0x1d4)](_0x464203[_0x3c8887(0x1ce)],_0x3c8887(0x1b7),(_0x5d8175,_0x5284fc,_0x2dea30)=>{const _0x5c39d6=_0x3c8887,_0x50efee=this[_0x5c39d6(0x1bd)](_0x464203,_0x2dea30);_0x523282[_0x5c39d6(0x1fc)]!=_0x50efee&&(_0x523282[_0x5c39d6(0x1fc)]=_0x50efee,this[_0x5c39d6(0x1f4)](_0x523282,_0x50efee));}),this[_0x3c8887(0x1d4)](_0x523282,_0x3c8887(0x206),()=>{const _0x2ec37f=_0x3c8887;this[_0x2ec37f(0x1ff)](_0x523282,_0x2ec37f(0x1b5));}),this[_0x3c8887(0x1d4)](_0x523282,_0x3c8887(0x1b9),()=>{const _0xa30f49=_0x3c8887;this[_0xa30f49(0x1ff)](_0x523282,_0xa30f49(0x1dd));}),this[_0x3c8887(0x1c7)](_0x523282);const _0x2af7b2=this[_0x3c8887(0x1f1)](_0x523282);if(_0x2af7b2)this[_0x3c8887(0x1c3)](_0x2af7b2,_0x523282)||this[_0x3c8887(0x1c7)](_0x523282);else this[_0x3c8887(0x1c7)](_0x523282);return this[_0x3c8887(0x1fe)](),this[_0x3c8887(0x1ce)][_0x3c8887(0x1cf)][_0x3c8887(0x1ec)](_0x523282),_0x523282;}[_0x3660f3(0x1c2)](_0x47fc0e){const _0x59b685=_0x3660f3;if(!_0x47fc0e[_0x59b685(0x1af)][_0x59b685(0x1f5)])return;const _0x236601=this[_0x59b685(0x1f1)](_0x47fc0e);if(!_0x236601)return;const _0x2b4ffc=this[_0x59b685(0x1ea)][_0x59b685(0x1b0)](_0x236601),_0x14421d=this[_0x59b685(0x205)];_0x14421d&&_0x14421d===_0x2b4ffc?this[_0x59b685(0x1c3)](_0x236601,_0x47fc0e):this[_0x59b685(0x1f2)](_0x47fc0e,_0x236601);}[_0x3660f3(0x1f3)](_0x3d6da5){const _0x1624a1=_0x3660f3;if(!_0x3d6da5[_0x1624a1(0x1af)][_0x1624a1(0x1f5)])return;const _0x1b8e41=this[_0x1624a1(0x1ee)](_0x3d6da5);if(!_0x1b8e41)return;const _0x2f6204=this[_0x1624a1(0x1ea)][_0x1624a1(0x1b0)](_0x1b8e41),_0x1e40db=this[_0x1624a1(0x202)][_0x1624a1(0x1b3)][_0x1624a1(0x1b0)](_0x1624a1(0x1bf)),_0x3e1bf5=this[_0x1624a1(0x205)];_0x3e1bf5&&_0x3e1bf5===_0x2f6204&&_0x1e40db?(this[_0x1624a1(0x1f2)](_0x1b8e41,_0x3d6da5),this[_0x1624a1(0x1c3)](_0x3d6da5,_0x1b8e41)):_0x3e1bf5&&_0x3e1bf5===_0x2f6204?this[_0x1624a1(0x1f2)](_0x1b8e41,_0x3d6da5):this[_0x1624a1(0x1c3)](_0x3d6da5,_0x1b8e41);}[_0x3660f3(0x1ff)](_0x508895,_0x531fc8){const _0x5a19ee=_0x3660f3;0x0===this[_0x5a19ee(0x1ba)][_0x5a19ee(0x1f5)]&&setTimeout(()=>{const _0x3f61d0=_0x5a19ee;for(const {sidebarItemView:_0x13a706,changedProp:_0x12d3ad}of this[_0x3f61d0(0x1ba)])_0x3f61d0(0x1b5)===_0x12d3ad?this[_0x3f61d0(0x1c2)](_0x13a706):this[_0x3f61d0(0x1f3)](_0x13a706);this[_0x3f61d0(0x1ba)]=[];},0xa),this[_0x5a19ee(0x1ba)][_0x5a19ee(0x1e4)]({'sidebarItemView':_0x508895,'changedProp':_0x531fc8});}[_0x3660f3(0x1d1)](_0xc437d6){const _0x414933=_0x3660f3;return this[_0x414933(0x1d3)][_0x414933(0x1b0)](_0xc437d6);}[_0x3660f3(0x1bc)](){const _0xe0b85c=_0x3660f3;this[_0xe0b85c(0x1fb)](),this[_0xe0b85c(0x1ce)][_0xe0b85c(0x1bc)]();}[_0x3660f3(0x1fd)](_0x226761){const _0x4319b3=_0x3660f3,_0x42216c=this[_0x4319b3(0x1d1)](_0x226761);this[_0x4319b3(0x1fb)](_0x42216c),this[_0x4319b3(0x1fb)](_0x226761[_0x4319b3(0x1ce)]),_0x42216c[_0x4319b3(0x1bc)](),this[_0x4319b3(0x1d3)][_0x4319b3(0x1b8)](_0x226761),this[_0x4319b3(0x1ea)][_0x4319b3(0x1b8)](_0x42216c);}[_0x3660f3(0x1d2)](){const _0x3e19ab=_0x3660f3,_0x17793d=new _0x1c76c9(this[_0x3e19ab(0x202)][_0x3e19ab(0x1e1)]);return _0x17793d[_0x3e19ab(0x1d9)](),this['on'](_0x3e19ab(0x1d7),(_0x174572,_0x902c4c,_0x33a355,_0xdd1acb)=>{const _0x48a9e1=_0x3e19ab;_0xdd1acb&&_0x17793d[_0x48a9e1(0x1b2)](_0x48a9e1(0x1de)),_0x33a355?_0x17793d[_0x48a9e1(0x1e2)](_0x48a9e1(0x1de))['to'](_0x33a355,_0x48a9e1(0x1dd)):_0x17793d[_0x48a9e1(0x1de)]=null;}),_0x17793d;}[_0x3660f3(0x1fe)](){const _0x27c5ec=_0x3660f3;this[_0x27c5ec(0x1ad)]=this[_0x27c5ec(0x1df)]?.[_0x27c5ec(0x1f8)]?this[_0x27c5ec(0x1d1)](this[_0x27c5ec(0x1df)][_0x27c5ec(0x1f8)]):null;}[_0x3660f3(0x1f1)](_0x30ee8c){const _0x574df8=_0x3660f3,_0x406cb1=this[_0x574df8(0x1ea)][_0x574df8(0x1b0)](_0x30ee8c),_0x494d5e=_0x406cb1&&this[_0x574df8(0x1df)]?.[_0x574df8(0x1b0)](this[_0x574df8(0x1df)][_0x574df8(0x1fa)](_0x406cb1)-0x1);return _0x494d5e&&this[_0x574df8(0x1d1)](_0x494d5e)||null;}[_0x3660f3(0x1ee)](_0x22f0b7){const _0x51cfa7=_0x3660f3,_0x4de479=this[_0x51cfa7(0x1ea)][_0x51cfa7(0x1b0)](_0x22f0b7),_0x1e47ef=_0x4de479&&this[_0x51cfa7(0x1df)]?.[_0x51cfa7(0x1b0)](this[_0x51cfa7(0x1df)][_0x51cfa7(0x1fa)](_0x4de479)+0x1);return _0x1e47ef&&this[_0x51cfa7(0x1d1)](_0x1e47ef)||null;}[_0x3660f3(0x1f2)](_0x196008,_0x54e893){const _0x290068=_0x3660f3;_0x196008[_0x290068(0x1b1)]();const _0x2d9f78=R(_0x54e893[_0x290068(0x1dd)]+this[_0x290068(0x1ac)],_0x196008[_0x290068(0x1b5)]);return!!_0x2d9f78&&(this[_0x290068(0x1f4)](_0x54e893,_0x54e893[_0x290068(0x1b5)]-_0x2d9f78),!0x0);}[_0x3660f3(0x1c3)](_0x3edf9f,_0x62aef){const _0x400688=_0x3660f3;_0x3edf9f[_0x400688(0x1b1)]();const _0x41c7f3=R(_0x3edf9f[_0x400688(0x1dd)]+this[_0x400688(0x1ac)],_0x62aef[_0x400688(0x1b5)]);return!!_0x41c7f3&&(this[_0x400688(0x1f4)](_0x62aef,_0x62aef[_0x400688(0x1b5)]+_0x41c7f3,!0x1),!0x0);}[_0x3660f3(0x1c7)](_0x210f03){const _0x50179a=_0x3660f3,_0x4d7963=this[_0x50179a(0x1ea)][_0x50179a(0x1b0)](_0x210f03);if(!_0x4d7963||!_0x4d7963[_0x50179a(0x1d0)]||!_0x4d7963[_0x50179a(0x1e6)])return;const _0x392832=this[_0x50179a(0x1bd)](_0x4d7963,_0x4d7963[_0x50179a(0x1e6)]);this[_0x50179a(0x1f4)](_0x210f03,_0x392832);}[_0x3660f3(0x1bd)](_0x14dbde,_0x3b6ce0){const _0x4a5462=_0x3660f3;if(null===_0x3b6ce0)return 0x0;if(_0x14dbde[_0x4a5462(0x1d0)]instanceof _0x3a00e6)return _0x3b6ce0[_0x4a5462(0x1b5)];{const _0x3faed4=new _0x3a00e6(this[_0x4a5462(0x1ce)][_0x4a5462(0x1bb)])[_0x4a5462(0x1b5)];return _0x3b6ce0[_0x4a5462(0x1b5)]-_0x3faed4;}}[_0x3660f3(0x1f4)](_0x38d6cd,_0x4dfef,_0x484230=this[_0x3660f3(0x202)][_0x3660f3(0x1b3)][_0x3660f3(0x1b0)](_0x3660f3(0x1bf))){const _0x1ec2bb=_0x3660f3;_0x484230&&(_0x4dfef=Math[_0x1ec2bb(0x1db)](_0x4dfef,this[_0x1ec2bb(0x204)](_0x38d6cd))),_0x38d6cd[_0x1ec2bb(0x1b5)]=_0x4dfef;}[_0x3660f3(0x204)](_0x78c1ed){const _0x5de984=_0x3660f3;let _0x2ee5ba=this[_0x5de984(0x1f1)](_0x78c1ed),_0x298a61=0x0;for(;_0x2ee5ba;)_0x2ee5ba[_0x5de984(0x1b1)](),_0x298a61+=this[_0x5de984(0x1ac)]+_0x2ee5ba[_0x5de984(0x1e0)],_0x2ee5ba=this[_0x5de984(0x1f1)](_0x2ee5ba);return _0x298a61;}}function R(_0x589407,_0x494e37){const _0x5f0207=_0x3660f3;return Math[_0x5f0207(0x1db)](_0x589407-_0x494e37,0x0);}function y(_0x2c74bc){const _0xe6d831=_0x3660f3;return null!==_0x2c74bc&&_0xe6d831(0x203)==typeof _0x2c74bc&&0x1===_0x2c74bc[_0xe6d831(0x1cc)];}