UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

23 lines • 12.4 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. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ function _0x252d(_0x4a9082,_0x288ae9){const _0x36270e=_0x3627();return _0x252d=function(_0x252da4,_0x214875){_0x252da4=_0x252da4-0x10f;let _0x51b5ca=_0x36270e[_0x252da4];return _0x51b5ca;},_0x252d(_0x4a9082,_0x288ae9);}const _0x3be123=_0x252d;(function(_0x248aa2,_0x1e9946){const _0x4c30c7=_0x252d,_0x56545e=_0x248aa2();while(!![]){try{const _0x4c75b2=-parseInt(_0x4c30c7(0x166))/0x1+-parseInt(_0x4c30c7(0x154))/0x2*(-parseInt(_0x4c30c7(0x139))/0x3)+-parseInt(_0x4c30c7(0x149))/0x4+-parseInt(_0x4c30c7(0x161))/0x5+-parseInt(_0x4c30c7(0x148))/0x6+parseInt(_0x4c30c7(0x123))/0x7*(parseInt(_0x4c30c7(0x12e))/0x8)+-parseInt(_0x4c30c7(0x15f))/0x9*(-parseInt(_0x4c30c7(0x132))/0xa);if(_0x4c75b2===_0x1e9946)break;else _0x56545e['push'](_0x56545e['shift']());}catch(_0x111f4d){_0x56545e['push'](_0x56545e['shift']());}}}(_0x3627,0x8b892));import{Plugin as _0x53d859}from'ckeditor5/src/core.js';function _0x3627(){const _0x337956=['afterInit','mousedown','addObserver','getOrderedSelectedAnnotations','attach','3211206BvqVAl','3047936NCftYf','switchTo','document','fromRect','keystrokes','getClientRects','delete','_addedAnnotations','remove','change:visibleView','showStack','147124MYthnk','inlineannotations-not-allowed-with-context','context','_manuallyClosed','setActiveAnnotation','focus','length','hasActive','stopListening','change:height','_balloon','10413540CFlFpY','from','2072170lLNpFx','isActive','has','targetRect','activeAnnotation','866854UPJIkh','_removeAnnotationFromBalloon','_closeAnnotation','every','visibleView','push','focusTracker','isPremiumPlugin','add','getFirstRange','isOfficialPlugin','view','editor','editableElement','isFocused','requires','editing','width','pluginName','_setSelectedAnnotations','change:isFocused','includes','hasView','get','Esc','isAttached','listenTo','inlineannotations-attach-already-attached','_selectedAnnotations','plugins','update','_getBalloonTargetForAnnotation','203IbIFMB','domConverter','_addAnnotationToBalloon','selection','top','set','viewRangeToDom','register','annotations','right','target','306264UUuwle','collapse','inlineannotations-detach-not-attached','destroy','10rRGUSM','left','inline','init','getByView','find','refresh','36DCSSVE','clear','updatePosition','bottom','getBoundingClientRect','detach','InlineAnnotations','map','blur','_forceRefresh'];_0x3627=function(){return _0x337956;};return _0x3627();}import _0x2108bb from'./annotationsuis.js';import _0x2a0138 from'./editorannotations.js';import{ContextualBalloon as _0x1df4f1}from'ckeditor5/src/ui.js';import{MouseObserver as _0x4634a2}from'ckeditor5/src/engine.js';import{CKEditorError as _0x49e05f,Rect as _0x50a6a0}from'ckeditor5/src/utils.js';import'./../../theme/annotation-inline.css';export default class c extends _0x53d859{static get[_0x3be123(0x112)](){return[_0x2a0138,_0x1df4f1,_0x2108bb];}static get[_0x3be123(0x115)](){const _0x55e0cf=_0x3be123;return _0x55e0cf(0x13f);}static get[_0x3be123(0x170)](){return!0x0;}static get[_0x3be123(0x16d)](){return!0x0;}constructor(_0x250992){const _0x37cff2=_0x3be123;super(_0x250992),_0x250992[_0x37cff2(0x113)][_0x37cff2(0x171)][_0x37cff2(0x145)](_0x4634a2),this[_0x37cff2(0x11c)]=!0x1,this[_0x37cff2(0x128)](_0x37cff2(0x165),null),this[_0x37cff2(0x12b)]=null,this[_0x37cff2(0x157)]=new Set(),this[_0x37cff2(0x15e)]=_0x250992[_0x37cff2(0x120)][_0x37cff2(0x11a)](_0x1df4f1),this[_0x37cff2(0x150)]=new Set(),this[_0x37cff2(0x11f)]=[],this[_0x37cff2(0x142)]=!0x1;}[_0x3be123(0x135)](){const _0x1f5c50=_0x3be123,_0x234aeb=this[_0x1f5c50(0x10f)][_0x1f5c50(0x120)][_0x1f5c50(0x11a)](_0x2108bb);_0x234aeb[_0x1f5c50(0x156)]===this[_0x1f5c50(0x10f)]&&(_0x234aeb[_0x1f5c50(0x12a)](_0x1f5c50(0x134),this),this[_0x1f5c50(0x10f)][_0x1f5c50(0x14d)][_0x1f5c50(0x128)](_0x1f5c50(0x11b),(_0x2fedc9,_0x134dc2)=>{const _0x22bb9e=_0x1f5c50,_0x3744da=this[_0x22bb9e(0x15e)];if(this[_0x22bb9e(0x11c)]&&_0x3744da[_0x22bb9e(0x16a)]){const _0x5aa4be=this[_0x22bb9e(0x12b)][_0x22bb9e(0x136)](_0x3744da[_0x22bb9e(0x16a)]);_0x5aa4be&&this[_0x22bb9e(0x168)](_0x5aa4be),_0x134dc2();}}));}[_0x3be123(0x143)](){const _0x4a6c20=_0x3be123,_0x3d4cb0=this[_0x4a6c20(0x10f)][_0x4a6c20(0x120)][_0x4a6c20(0x11a)](_0x2108bb);_0x3d4cb0[_0x4a6c20(0x156)]===this[_0x4a6c20(0x10f)]&&(_0x3d4cb0[_0x4a6c20(0x15b)]()||_0x3d4cb0[_0x4a6c20(0x14a)](_0x4a6c20(0x134)));}[_0x3be123(0x158)](_0x2051bf){const _0x4f9194=_0x3be123;_0x2051bf!==this[_0x4f9194(0x165)]&&(this[_0x4f9194(0x165)]&&(this[_0x4f9194(0x165)][_0x4f9194(0x162)]=!0x1),_0x2051bf&&this[_0x4f9194(0x10f)]['ui'][_0x4f9194(0x16c)][_0x4f9194(0x111)]&&(this[_0x4f9194(0x12b)][_0x4f9194(0x163)](_0x2051bf)&&this[_0x4f9194(0x125)](_0x2051bf,!0x0),_0x2051bf[_0x4f9194(0x162)]=!0x0),_0x2051bf||this[_0x4f9194(0x116)]([]),this[_0x4f9194(0x165)]=_0x2051bf);}[_0x3be123(0x147)](_0x4c26f0){const _0x32976c=_0x3be123;this[_0x32976c(0x12b)]=_0x4c26f0;const _0x292487=this[_0x32976c(0x10f)][_0x32976c(0x120)][_0x32976c(0x11a)](_0x2108bb),_0xf795dc=this[_0x32976c(0x15e)];if(this[_0x32976c(0x11c)])throw new _0x49e05f(_0x32976c(0x11e),this);if(_0x292487[_0x32976c(0x156)]!==this[_0x32976c(0x10f)])throw new _0x49e05f(_0x32976c(0x155),this);const _0x44673d=this[_0x32976c(0x10f)][_0x32976c(0x120)][_0x32976c(0x11a)](_0x2a0138);this[_0x32976c(0x11d)](_0x44673d,_0x32976c(0x138),()=>{const _0x51edec=_0x32976c,_0x2fd180=_0x44673d[_0x51edec(0x146)]({'annotations':this[_0x51edec(0x12b)],'activeAnnotation':this[_0x51edec(0x165)]});var _0x43c39e,_0x1cd3bf;!this[_0x51edec(0x142)]&&(_0x43c39e=_0x2fd180,_0x1cd3bf=this[_0x51edec(0x11f)],_0x43c39e[_0x51edec(0x15a)]===_0x1cd3bf[_0x51edec(0x15a)]&&_0x43c39e[_0x51edec(0x169)](_0x29e914=>_0x1cd3bf[_0x51edec(0x118)](_0x29e914)))||(this[_0x51edec(0x142)]=!0x1,this[_0x51edec(0x116)](_0x2fd180),this[_0x51edec(0x158)](_0x2fd180[0x0]||null));}),this[_0x32976c(0x11d)](_0x44673d,_0x32976c(0x141),(_0x55bc02,{isAnnotationTracked:_0x5ea9f3})=>{const _0x281fa6=_0x32976c;this[_0x281fa6(0x165)]&&_0x5ea9f3(this[_0x281fa6(0x165)])&&(this[_0x281fa6(0x116)]([]),this[_0x281fa6(0x158)](null));}),this[_0x32976c(0x11d)](this[_0x32976c(0x10f)]['ui'][_0x32976c(0x16c)],_0x32976c(0x117),(_0x5dee72,_0x463161,_0x195998)=>{const _0xbba847=_0x32976c;_0x195998||this[_0xbba847(0x158)](null);}),this[_0x32976c(0x11d)](_0x4c26f0,_0x32976c(0x151),(_0x53e31a,_0x6ec588)=>{const _0x17e6d9=_0x32976c;this[_0x17e6d9(0x167)](_0x6ec588),_0x6ec588===this[_0x17e6d9(0x165)]&&this[_0x17e6d9(0x158)](null);}),this[_0x32976c(0x11d)](_0xf795dc,_0x32976c(0x152),(_0x1dbd8c,_0x5ccf24,_0x2ba0f9,_0x9be2ce)=>{const _0x474b5f=_0x32976c;_0x9be2ce&&this[_0x474b5f(0x15c)](_0x9be2ce);const _0x510fff=_0x4c26f0[_0x474b5f(0x136)](_0x2ba0f9);_0x2ba0f9&&_0x510fff&&(this[_0x474b5f(0x11d)](_0x2ba0f9,_0x474b5f(0x15d),()=>{const _0x4607f9=_0x474b5f;_0xf795dc[_0x4607f9(0x13b)]();}),this[_0x474b5f(0x11d)](_0x2ba0f9,_0x474b5f(0x11b),()=>{const _0x506aae=_0x474b5f;this[_0x506aae(0x168)](_0x510fff),this[_0x506aae(0x10f)][_0x506aae(0x113)][_0x506aae(0x171)][_0x506aae(0x159)]();}),this[_0x474b5f(0x165)]!==_0x510fff&&this[_0x474b5f(0x158)](_0x510fff));}),this[_0x32976c(0x11d)](this[_0x32976c(0x10f)]['ui'],_0x32976c(0x121),()=>{const _0x18d98b=_0x32976c;_0xf795dc[_0x18d98b(0x16a)]&&(_0x4c26f0[_0x18d98b(0x136)](_0xf795dc[_0x18d98b(0x16a)])&&_0xf795dc[_0x18d98b(0x13b)]());}),this[_0x32976c(0x11d)](this[_0x32976c(0x10f)][_0x32976c(0x113)][_0x32976c(0x171)][_0x32976c(0x14b)],_0x32976c(0x144),()=>{const _0xb4cc59=_0x32976c;this[_0xb4cc59(0x142)]=!0x0,this[_0xb4cc59(0x157)][_0xb4cc59(0x13a)]();}),this[_0x32976c(0x10f)][_0x32976c(0x113)][_0x32976c(0x171)][_0x32976c(0x14b)][_0x32976c(0x126)][_0x32976c(0x110)]&&this[_0x32976c(0x10f)][_0x32976c(0x113)][_0x32976c(0x171)][_0x32976c(0x159)](),this[_0x32976c(0x11c)]=!0x0;}[_0x3be123(0x13e)](){const _0x4f8ce9=_0x3be123;if(!this[_0x4f8ce9(0x11c)])throw new _0x49e05f(_0x4f8ce9(0x130),this);this[_0x4f8ce9(0x158)](null);for(const _0x59dd01 of this[_0x4f8ce9(0x150)])this[_0x4f8ce9(0x167)](_0x59dd01);this[_0x4f8ce9(0x15c)](),this[_0x4f8ce9(0x11c)]=!0x1,this[_0x4f8ce9(0x12b)]=null;}[_0x3be123(0x131)](){const _0x3d2e0f=_0x3be123;this[_0x3d2e0f(0x11c)]&&this[_0x3d2e0f(0x13e)]();}[_0x3be123(0x116)](_0x365e4a){const _0x3e0820=_0x3be123;for(const _0x30b282 of this[_0x3e0820(0x11f)])_0x365e4a[_0x3e0820(0x118)](_0x30b282)||this[_0x3e0820(0x157)][_0x3e0820(0x14f)](_0x30b282);for(const _0x1c438f of this[_0x3e0820(0x12b)])_0x365e4a[_0x3e0820(0x118)](_0x1c438f)||this[_0x3e0820(0x167)](_0x1c438f);if(this[_0x3e0820(0x10f)]['ui'][_0x3e0820(0x16c)][_0x3e0820(0x111)]){for(const _0x387d7e of _0x365e4a)this[_0x3e0820(0x125)](_0x387d7e);}this[_0x3e0820(0x11f)]=_0x365e4a;}[_0x3be123(0x125)](_0x2f6955,_0x16d5c9=!0x1){const _0x5bddac=_0x3be123;this[_0x5bddac(0x157)][_0x5bddac(0x163)](_0x2f6955)||(this[_0x5bddac(0x150)][_0x5bddac(0x163)](_0x2f6955)||this[_0x5bddac(0x15e)][_0x5bddac(0x119)](_0x2f6955[_0x5bddac(0x171)])||(this[_0x5bddac(0x150)][_0x5bddac(0x16e)](_0x2f6955),this[_0x5bddac(0x15e)][_0x5bddac(0x16e)]({'stackId':_0x2f6955[_0x5bddac(0x171)]['id'],'view':_0x2f6955[_0x5bddac(0x171)],'position':{'target':()=>this[_0x5bddac(0x122)](_0x2f6955)}})),_0x16d5c9&&this[_0x5bddac(0x15e)][_0x5bddac(0x153)](_0x2f6955[_0x5bddac(0x171)]['id']));}[_0x3be123(0x122)](_0xafced8){const _0x3e0624=_0x3be123,_0x29f806=_0xafced8[_0x3e0624(0x12d)],_0x2d37c9=this[_0x3e0624(0x10f)][_0x3e0624(0x113)][_0x3e0624(0x171)],_0x4917ca=_0x2d37c9[_0x3e0624(0x14b)][_0x3e0624(0x126)][_0x3e0624(0x16f)](),_0x575f61=_0x2d37c9[_0x3e0624(0x124)][_0x3e0624(0x129)](_0x4917ca);if(_0x575f61[_0x3e0624(0x12f)](!0x0),_0x29f806){if(_0x29f806 instanceof _0x50a6a0)return _0x29f806;let _0x49ccca=[];for(const _0x13b608 of _0x29f806)_0x49ccca[_0x3e0624(0x16b)](...(_0x1e06f5=_0x13b608[_0x3e0624(0x14e)](),Array[_0x3e0624(0x160)](_0x1e06f5)[_0x3e0624(0x140)](DOMRect[_0x3e0624(0x14c)])));_0x49ccca=function(_0x327d84){const _0x32bb5a=_0x3e0624,_0xc9d704=[];let _0x27abe8=_0x327d84[0x0];for(let _0x2c2e44=0x1;_0x2c2e44<_0x327d84[_0x32bb5a(0x15a)];_0x2c2e44++)b(_0x27abe8,_0x327d84[_0x2c2e44])?_0x27abe8[_0x32bb5a(0x114)]+=_0x327d84[_0x2c2e44][_0x32bb5a(0x114)]:(_0xc9d704[_0x32bb5a(0x16b)](_0x27abe8),_0x27abe8=_0x327d84[_0x2c2e44]);return _0xc9d704[_0x32bb5a(0x16b)](_0x27abe8),_0xc9d704;}(_0x49ccca);const _0x3854ca=_0x575f61[_0x3e0624(0x13d)]();return _0x49ccca[_0x3e0624(0x137)](_0x55ae21=>_0x55ae21[_0x3e0624(0x127)]<=_0x3854ca[_0x3e0624(0x127)]&&_0x55ae21[_0x3e0624(0x13c)]>=_0x3854ca[_0x3e0624(0x13c)]&&_0x55ae21[_0x3e0624(0x133)]<=_0x3854ca[_0x3e0624(0x133)]&&_0x55ae21[_0x3e0624(0x12c)]>=_0x3854ca[_0x3e0624(0x12c)])||_0x49ccca[0x0];}var _0x1e06f5;return _0xafced8[_0x3e0624(0x164)]||_0x575f61;}[_0x3be123(0x167)](_0x4f8c46){const _0x38d4bd=_0x3be123;this[_0x38d4bd(0x150)][_0x38d4bd(0x163)](_0x4f8c46)&&this[_0x38d4bd(0x15e)][_0x38d4bd(0x119)](_0x4f8c46[_0x38d4bd(0x171)])&&(this[_0x38d4bd(0x150)][_0x38d4bd(0x14f)](_0x4f8c46),this[_0x38d4bd(0x15e)][_0x38d4bd(0x151)](_0x4f8c46[_0x38d4bd(0x171)]));}[_0x3be123(0x168)](_0xa72879){const _0x193625=_0x3be123;this[_0x193625(0x157)][_0x193625(0x16e)](_0xa72879),this[_0x193625(0x167)](_0xa72879);}}function b(_0x35a917,_0x1d6052){const _0x492d90=_0x3be123;return _0x35a917[_0x492d90(0x127)]===_0x1d6052[_0x492d90(0x127)]&&_0x35a917[_0x492d90(0x13c)]===_0x1d6052[_0x492d90(0x13c)]&&_0x35a917[_0x492d90(0x12c)]===_0x1d6052[_0x492d90(0x133)];}