@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
23 lines • 12.7 kB
JavaScript
/*
* 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 _0xc492c4=_0x5ede;function _0x34dd(){const _0x490f41=['includes','refresh','getFirstRange','_removeAnnotationFromBalloon','13xrEBqq','update','switchTo','visibleView','afterInit','change:isFocused','detach','register','139086sSlYHv','editor','_balloon','init','attach','view','collapse','viewRangeToDom','fromRect','add','hasActive','inline','left','annotations','set','requires','stopListening','hasView','getBoundingClientRect','_closeAnnotation','top','getByView','listenTo','has','_getBalloonTargetForAnnotation','InlineAnnotations','setActiveAnnotation','_setSelectedAnnotations','inlineannotations-not-allowed-with-context','inlineannotations-attach-already-attached','document','destroy','5928076deKfSl','context','isAttached','isFocused','76332PVRlYF','change:visibleView','editing','blur','4055304qruffm','target','18MktsBs','right','map','get','_addAnnotationToBalloon','push','focus','width','length','inlineannotations-detach-not-attached','getOrderedSelectedAnnotations','pluginName','3920xKjkGI','activeAnnotation','_addedAnnotations','targetRect','mousedown','delete','editableElement','every','addObserver','from','129110iDfTgE','isPremiumPlugin','129sVLEac','isActive','Esc','focusTracker','bottom','_forceRefresh','_selectedAnnotations','isOfficialPlugin','clear','getClientRects','plugins','selection','find','updatePosition','domConverter','remove','change:height','keystrokes','_manuallyClosed','showStack','5667840uVBaGw','5454imfwzN'];_0x34dd=function(){return _0x490f41;};return _0x34dd();}(function(_0x379356,_0x51d42f){const _0x3e9f1f=_0x5ede,_0x410224=_0x379356();while(!![]){try{const _0x3a74b6=parseInt(_0x3e9f1f(0x1cd))/0x1*(parseInt(_0x3e9f1f(0x1d5))/0x2)+-parseInt(_0x3e9f1f(0x1b3))/0x3*(parseInt(_0x3e9f1f(0x1f9))/0x4)+-parseInt(_0x3e9f1f(0x1b1))/0x5*(-parseInt(_0x3e9f1f(0x1ff))/0x6)+-parseInt(_0x3e9f1f(0x1f5))/0x7+parseInt(_0x3e9f1f(0x20b))/0x8*(parseInt(_0x3e9f1f(0x1c8))/0x9)+parseInt(_0x3e9f1f(0x1c7))/0xa+parseInt(_0x3e9f1f(0x1fd))/0xb;if(_0x3a74b6===_0x51d42f)break;else _0x410224['push'](_0x410224['shift']());}catch(_0x581130){_0x410224['push'](_0x410224['shift']());}}}(_0x34dd,0x856ac));import{Plugin as _0x3dcdbe}from'ckeditor5/src/core.js';import{AnnotationsUIs as _0x4b77b6}from'./annotationsuis.js';import{EditorAnnotations as _0x5aa8da}from'./editorannotations.js';import{ContextualBalloon as _0x126675}from'ckeditor5/src/ui.js';import{MouseObserver as _0x548182}from'ckeditor5/src/engine.js';function _0x5ede(_0x18745a,_0x2be42f){const _0x34ddb6=_0x34dd();return _0x5ede=function(_0x5ede75,_0x57994e){_0x5ede75=_0x5ede75-0x1ae;let _0x308ec9=_0x34ddb6[_0x5ede75];return _0x308ec9;},_0x5ede(_0x18745a,_0x2be42f);}import{CKEditorError as _0x108ec9,Rect as _0x226373}from'ckeditor5/src/utils.js';import'./../../theme/annotation-inline.css';export class InlineAnnotations extends _0x3dcdbe{[_0xc492c4(0x1f7)];[_0xc492c4(0x1e2)];[_0xc492c4(0x1c5)];[_0xc492c4(0x1d7)];[_0xc492c4(0x20d)];[_0xc492c4(0x1b9)];[_0xc492c4(0x1b8)];static get[_0xc492c4(0x1e4)](){return[_0x5aa8da,_0x126675,_0x4b77b6];}static get[_0xc492c4(0x20a)](){const _0x508af9=_0xc492c4;return _0x508af9(0x1ee);}static get[_0xc492c4(0x1ba)](){return!0x0;}static get[_0xc492c4(0x1b2)](){return!0x0;}constructor(_0x2f9371){const _0x35cd87=_0xc492c4;super(_0x2f9371),_0x2f9371[_0x35cd87(0x1fb)][_0x35cd87(0x1da)][_0x35cd87(0x1af)](_0x548182),this[_0x35cd87(0x1f7)]=!0x1,this[_0x35cd87(0x1e3)](_0x35cd87(0x20c),null),this[_0x35cd87(0x1e2)]=null,this[_0x35cd87(0x1c5)]=new Set(),this[_0x35cd87(0x1d7)]=_0x2f9371[_0x35cd87(0x1bd)][_0x35cd87(0x202)](_0x126675),this[_0x35cd87(0x20d)]=new Set(),this[_0x35cd87(0x1b9)]=[],this[_0x35cd87(0x1b8)]=!0x1;}[_0xc492c4(0x1d8)](){const _0x4315fd=_0xc492c4,_0x906b49=this[_0x4315fd(0x1d6)][_0x4315fd(0x1bd)][_0x4315fd(0x202)](_0x4b77b6);_0x906b49[_0x4315fd(0x1f6)]===this[_0x4315fd(0x1d6)]&&(_0x906b49[_0x4315fd(0x1d4)](_0x4315fd(0x1e0),this),this[_0x4315fd(0x1d6)][_0x4315fd(0x1c4)][_0x4315fd(0x1e3)](_0x4315fd(0x1b5),(_0x4dd1ae,_0x59e384)=>{const _0x5df46e=_0x4315fd,_0x1db867=this[_0x5df46e(0x1d7)];if(this[_0x5df46e(0x1f7)]&&_0x1db867[_0x5df46e(0x1d0)]){const _0x5eb6de=this[_0x5df46e(0x1e2)][_0x5df46e(0x1ea)](_0x1db867[_0x5df46e(0x1d0)]);_0x5eb6de&&this[_0x5df46e(0x1e8)](_0x5eb6de),_0x59e384();}}));}[_0xc492c4(0x1d1)](){const _0x2d84af=_0xc492c4,_0x41602b=this[_0x2d84af(0x1d6)][_0x2d84af(0x1bd)][_0x2d84af(0x202)](_0x4b77b6);_0x41602b[_0x2d84af(0x1f6)]===this[_0x2d84af(0x1d6)]&&(_0x41602b[_0x2d84af(0x1df)]()||_0x41602b[_0x2d84af(0x1cf)](_0x2d84af(0x1e0)));}[_0xc492c4(0x1ef)](_0x1a6333){const _0x410a3f=_0xc492c4;_0x1a6333!==this[_0x410a3f(0x20c)]&&(this[_0x410a3f(0x20c)]&&(this[_0x410a3f(0x20c)][_0x410a3f(0x1b4)]=!0x1),_0x1a6333&&this[_0x410a3f(0x1d6)]['ui'][_0x410a3f(0x1b6)][_0x410a3f(0x1f8)]&&(this[_0x410a3f(0x1e2)][_0x410a3f(0x1ec)](_0x1a6333)&&this[_0x410a3f(0x203)](_0x1a6333,!0x0),_0x1a6333[_0x410a3f(0x1b4)]=!0x0),_0x1a6333||this[_0x410a3f(0x1f0)]([]),this[_0x410a3f(0x20c)]=_0x1a6333);}[_0xc492c4(0x1d9)](_0x23cfc0){const _0x69446a=_0xc492c4;this[_0x69446a(0x1e2)]=_0x23cfc0;const _0x3e50ca=this[_0x69446a(0x1d6)][_0x69446a(0x1bd)][_0x69446a(0x202)](_0x4b77b6),_0x24213e=this[_0x69446a(0x1d7)];if(this[_0x69446a(0x1f7)])throw new _0x108ec9(_0x69446a(0x1f2),this);if(_0x3e50ca[_0x69446a(0x1f6)]!==this[_0x69446a(0x1d6)])throw new _0x108ec9(_0x69446a(0x1f1),this);const _0x278069=this[_0x69446a(0x1d6)][_0x69446a(0x1bd)][_0x69446a(0x202)](_0x5aa8da);this[_0x69446a(0x1eb)](_0x278069,_0x69446a(0x1ca),()=>{const _0x34ccd8=_0x69446a,_0x141f8f=_0x278069[_0x34ccd8(0x209)]({'annotations':this[_0x34ccd8(0x1e2)],'activeAnnotation':this[_0x34ccd8(0x20c)]});var _0x2c9e02,_0x526eb1;!this[_0x34ccd8(0x1b8)]&&(_0x2c9e02=_0x141f8f,_0x526eb1=this[_0x34ccd8(0x1b9)],_0x2c9e02[_0x34ccd8(0x207)]===_0x526eb1[_0x34ccd8(0x207)]&&_0x2c9e02[_0x34ccd8(0x1ae)](_0x1b3c46=>_0x526eb1[_0x34ccd8(0x1c9)](_0x1b3c46)))||(this[_0x34ccd8(0x1b8)]=!0x1,this[_0x34ccd8(0x1f0)](_0x141f8f),this[_0x34ccd8(0x1ef)](_0x141f8f[0x0]||null));}),this[_0x69446a(0x1eb)](_0x278069,_0x69446a(0x1fc),(_0x4d3d0b,{isAnnotationTracked:_0x56af97})=>{const _0x30ecb2=_0x69446a;this[_0x30ecb2(0x20c)]&&_0x56af97(this[_0x30ecb2(0x20c)])&&(this[_0x30ecb2(0x1f0)]([]),this[_0x30ecb2(0x1ef)](null));}),this[_0x69446a(0x1eb)](this[_0x69446a(0x1d6)]['ui'][_0x69446a(0x1b6)],_0x69446a(0x1d2),(_0x451283,_0xffe151,_0x2ee279)=>{const _0xe5c2a9=_0x69446a;_0x2ee279||this[_0xe5c2a9(0x1ef)](null);}),this[_0x69446a(0x1eb)](_0x23cfc0,_0x69446a(0x1c2),(_0x1ef6d9,_0x44ce95)=>{const _0x263c09=_0x69446a;this[_0x263c09(0x1cc)](_0x44ce95),_0x44ce95===this[_0x263c09(0x20c)]&&this[_0x263c09(0x1ef)](null);}),this[_0x69446a(0x1eb)](_0x24213e,_0x69446a(0x1fa),(_0x303b01,_0x267423,_0x2188a9,_0x4eeb7c)=>{const _0x29bc67=_0x69446a;_0x4eeb7c&&this[_0x29bc67(0x1e5)](_0x4eeb7c);const _0x380685=_0x23cfc0[_0x29bc67(0x1ea)](_0x2188a9);_0x2188a9&&_0x380685&&(this[_0x29bc67(0x1eb)](_0x2188a9,_0x29bc67(0x1c3),()=>{const _0x3b62dd=_0x29bc67;_0x24213e[_0x3b62dd(0x1c0)]();}),this[_0x29bc67(0x1eb)](_0x2188a9,_0x29bc67(0x1b5),()=>{const _0x474a5a=_0x29bc67;this[_0x474a5a(0x1e8)](_0x380685),this[_0x474a5a(0x1d6)][_0x474a5a(0x1fb)][_0x474a5a(0x1da)][_0x474a5a(0x205)]();}),this[_0x29bc67(0x20c)]!==_0x380685&&this[_0x29bc67(0x1ef)](_0x380685));}),this[_0x69446a(0x1eb)](this[_0x69446a(0x1d6)]['ui'],_0x69446a(0x1ce),()=>{const _0x2f4299=_0x69446a;_0x24213e[_0x2f4299(0x1d0)]&&(_0x23cfc0[_0x2f4299(0x1ea)](_0x24213e[_0x2f4299(0x1d0)])&&_0x24213e[_0x2f4299(0x1c0)]());}),this[_0x69446a(0x1eb)](this[_0x69446a(0x1d6)][_0x69446a(0x1fb)][_0x69446a(0x1da)][_0x69446a(0x1f3)],_0x69446a(0x20f),()=>{const _0x459da4=_0x69446a;this[_0x459da4(0x1b8)]=!0x0,this[_0x459da4(0x1c5)][_0x459da4(0x1bb)]();}),this[_0x69446a(0x1d6)][_0x69446a(0x1fb)][_0x69446a(0x1da)][_0x69446a(0x1f3)][_0x69446a(0x1be)][_0x69446a(0x211)]&&this[_0x69446a(0x1d6)][_0x69446a(0x1fb)][_0x69446a(0x1da)][_0x69446a(0x205)](),this[_0x69446a(0x1f7)]=!0x0;}[_0xc492c4(0x1d3)](){const _0xcd7f24=_0xc492c4;if(!this[_0xcd7f24(0x1f7)])throw new _0x108ec9(_0xcd7f24(0x208),this);this[_0xcd7f24(0x1ef)](null);for(const _0x27c407 of this[_0xcd7f24(0x20d)])this[_0xcd7f24(0x1cc)](_0x27c407);this[_0xcd7f24(0x1e5)](),this[_0xcd7f24(0x1f7)]=!0x1,this[_0xcd7f24(0x1e2)]=null;}[_0xc492c4(0x1f4)](){const _0x33cbed=_0xc492c4;this[_0x33cbed(0x1f7)]&&this[_0x33cbed(0x1d3)]();}[_0xc492c4(0x1f0)](_0x2a472e){const _0x1c56c0=_0xc492c4;for(const _0x5e94fc of this[_0x1c56c0(0x1b9)])_0x2a472e[_0x1c56c0(0x1c9)](_0x5e94fc)||this[_0x1c56c0(0x1c5)][_0x1c56c0(0x210)](_0x5e94fc);for(const _0x2a3d64 of this[_0x1c56c0(0x1e2)])_0x2a472e[_0x1c56c0(0x1c9)](_0x2a3d64)||this[_0x1c56c0(0x1cc)](_0x2a3d64);if(this[_0x1c56c0(0x1d6)]['ui'][_0x1c56c0(0x1b6)][_0x1c56c0(0x1f8)]){for(const _0x27052c of _0x2a472e)this[_0x1c56c0(0x203)](_0x27052c);}this[_0x1c56c0(0x1b9)]=_0x2a472e;}[_0xc492c4(0x203)](_0x10e45e,_0x2e6b8d=!0x1){const _0x4339a8=_0xc492c4;this[_0x4339a8(0x1c5)][_0x4339a8(0x1ec)](_0x10e45e)||(this[_0x4339a8(0x20d)][_0x4339a8(0x1ec)](_0x10e45e)||this[_0x4339a8(0x1d7)][_0x4339a8(0x1e6)](_0x10e45e[_0x4339a8(0x1da)])||(this[_0x4339a8(0x20d)][_0x4339a8(0x1de)](_0x10e45e),this[_0x4339a8(0x1d7)][_0x4339a8(0x1de)]({'stackId':_0x10e45e[_0x4339a8(0x1da)]['id'],'view':_0x10e45e[_0x4339a8(0x1da)],'position':{'target':()=>this[_0x4339a8(0x1ed)](_0x10e45e)}})),_0x2e6b8d&&this[_0x4339a8(0x1d7)][_0x4339a8(0x1c6)](_0x10e45e[_0x4339a8(0x1da)]['id']));}[_0xc492c4(0x1ed)](_0x200fee){const _0x467938=_0xc492c4,_0x2bdb46=_0x200fee[_0x467938(0x1fe)],_0x548165=this[_0x467938(0x1d6)][_0x467938(0x1fb)][_0x467938(0x1da)],_0x1ea893=_0x548165[_0x467938(0x1f3)][_0x467938(0x1be)][_0x467938(0x1cb)](),_0x351561=_0x548165[_0x467938(0x1c1)][_0x467938(0x1dc)](_0x1ea893);if(_0x351561[_0x467938(0x1db)](!0x0),_0x2bdb46){if(_0x2bdb46 instanceof _0x226373)return _0x2bdb46;let _0x587bb7=[];for(const _0x2fabf3 of _0x2bdb46)_0x587bb7[_0x467938(0x204)](...F(_0x2fabf3[_0x467938(0x1bc)]()));_0x587bb7=function(_0x41f85c){const _0x353801=_0x467938,_0x33f7a4=[];let _0x14c8d5=_0x41f85c[0x0];for(let _0x1d7333=0x1;_0x1d7333<_0x41f85c[_0x353801(0x207)];_0x1d7333++)P(_0x14c8d5,_0x41f85c[_0x1d7333])?_0x14c8d5[_0x353801(0x206)]+=_0x41f85c[_0x1d7333][_0x353801(0x206)]:(_0x33f7a4[_0x353801(0x204)](_0x14c8d5),_0x14c8d5=_0x41f85c[_0x1d7333]);return _0x33f7a4[_0x353801(0x204)](_0x14c8d5),_0x33f7a4;}(_0x587bb7);const _0x49d40b=_0x351561[_0x467938(0x1e7)]();return _0x587bb7[_0x467938(0x1bf)](_0xd7e174=>_0xd7e174[_0x467938(0x1e9)]<=_0x49d40b[_0x467938(0x1e9)]&&_0xd7e174[_0x467938(0x1b7)]>=_0x49d40b[_0x467938(0x1b7)]&&_0xd7e174[_0x467938(0x1e1)]<=_0x49d40b[_0x467938(0x1e1)]&&_0xd7e174[_0x467938(0x200)]>=_0x49d40b[_0x467938(0x200)])||_0x587bb7[0x0];}return _0x200fee[_0x467938(0x20e)]||_0x351561;}[_0xc492c4(0x1cc)](_0x2e391d){const _0x482348=_0xc492c4;this[_0x482348(0x20d)][_0x482348(0x1ec)](_0x2e391d)&&this[_0x482348(0x1d7)][_0x482348(0x1e6)](_0x2e391d[_0x482348(0x1da)])&&(this[_0x482348(0x20d)][_0x482348(0x210)](_0x2e391d),this[_0x482348(0x1d7)][_0x482348(0x1c2)](_0x2e391d[_0x482348(0x1da)]));}[_0xc492c4(0x1e8)](_0x147287){const _0x3d4a34=_0xc492c4;this[_0x3d4a34(0x1c5)][_0x3d4a34(0x1de)](_0x147287),this[_0x3d4a34(0x1cc)](_0x147287);}}function F(_0x34c103){const _0x2b4989=_0xc492c4;return Array[_0x2b4989(0x1b0)](_0x34c103)[_0x2b4989(0x201)](DOMRect[_0x2b4989(0x1dd)]);}function P(_0x2e9397,_0x5d87b4){const _0x540657=_0xc492c4;return _0x2e9397[_0x540657(0x1e9)]===_0x5d87b4[_0x540657(0x1e9)]&&_0x2e9397[_0x540657(0x1b7)]===_0x5d87b4[_0x540657(0x1b7)]&&_0x2e9397[_0x540657(0x200)]===_0x5d87b4[_0x540657(0x1e1)];}