UNPKG

@ckeditor/ckeditor5-ai

Version:

AI features for CKEditor 5.

23 lines • 10.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. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0xd2459a=_0x31ba;(function(_0x5a4ce4,_0x28da66){const _0x3c4169=_0x31ba,_0x918ced=_0x5a4ce4();while(!![]){try{const _0x41afa7=parseInt(_0x3c4169(0x1be))/0x1*(parseInt(_0x3c4169(0x1d4))/0x2)+parseInt(_0x3c4169(0x1d7))/0x3*(-parseInt(_0x3c4169(0x1a4))/0x4)+-parseInt(_0x3c4169(0x1e3))/0x5+parseInt(_0x3c4169(0x1c6))/0x6+-parseInt(_0x3c4169(0x1d9))/0x7+-parseInt(_0x3c4169(0x19b))/0x8*(-parseInt(_0x3c4169(0x1a1))/0x9)+-parseInt(_0x3c4169(0x1c2))/0xa*(parseInt(_0x3c4169(0x1d0))/0xb);if(_0x41afa7===_0x28da66)break;else _0x918ced['push'](_0x918ced['shift']());}catch(_0x5ce5d0){_0x918ced['push'](_0x918ced['shift']());}}}(_0xaab1,0x72fa5));function _0xaab1(){const _0x3b18c0=['hideBalloon','3462gdDJIo','width','2206967GBeUSm','.ck-ai-review-mode__change_active','right','from','remove','push','clientY','setTemplate','ck-reset','_setupClickOutsideHandler','475160oITgTO','top','_getPointedRectIndexFromEvent','_pinnedTargetElement','unpin','extendTemplate','_getBestRectPositionOnClick','forEach','locale','classList','render','add','innerHTML','getBoundingClientRect','ck-content','pin','88WMJpuB','delegate','showDiff','_getBestRectPositionOnHover','getIntersection','span[data-marker-id*=\x22','358164rFBwlO','hover','fire','1796GXeeoe','isDiffActive','set','showBalloon','div','arrow_','ck-ai-review-mode__suggestion-text','element','resultItemView','clientX','_createContentView','arrow_se','isVisible','reverse','updateContent','show','_pinnedTargetChangeId','click','deactivateChange','hideDiffInBalloon','documentElement','querySelectorAll','contentDiffed','_isPinnedRectVisible','bindTemplate','left','2zwjmsv','showDiffInBalloon','changeId','position','3432190tpziga','ck-ai-review-mode-balloon-panel-suggestion','dismissChange','replace','4296528YfXQvh','acceptChange','resultResponseView','bottom','content','_removeActiveClassFromMarkers','_pinnedRectIndex','length','ck-ai-review-mode__change_active','document','22RmISYH','ck-ai-review-mode-balloon-panel-suggestion_diff-active','hide','_setActiveClassOnMarker','932002leNqnD','getClientRects'];_0xaab1=function(){return _0x3b18c0;};return _0xaab1();}import{Rect as _0x44dee2,getConstrainedViewportRect as _0x1ce69c,global as _0x312d6c}from'ckeditor5/src/utils.js';import{BalloonPanelView as _0x529c72,View as _0x53e696,clickOutsideHandler as _0x578e3e}from'ckeditor5/src/ui.js';import{AIReviewModeReviewCheckListItemResultsView as _0x35da87}from'./aireviewmodechecklistitemresultview.js';import'../../../theme/aireviewmode/aireviewmode-balloon-panel-suggestion.css';import'../../../theme/aireviewmode/aireviewmode-check-run-result.css';function _0x31ba(_0x1a18bd,_0x12411a){const _0xaab19c=_0xaab1();return _0x31ba=function(_0x31ba44,_0x5de34e){_0x31ba44=_0x31ba44-0x18f;let _0x516649=_0xaab19c[_0x31ba44];return _0x516649;},_0x31ba(_0x1a18bd,_0x12411a);}export class AIReviewModeBalloonSuggestionItemView extends _0x529c72{[_0xd2459a(0x1ac)];[_0xd2459a(0x1cc)]=void 0x0;[_0xd2459a(0x1e6)]=void 0x0;[_0xd2459a(0x1b4)]=void 0x0;constructor(_0x3e8315,_0x101d20){const _0x5c30fd=_0xd2459a;super(_0x3e8315),this[_0x5c30fd(0x1a6)]({'isVisible':!0x1,'position':_0x5c30fd(0x1af),'class':null,'top':0x0,'left':0x0}),this[_0x5c30fd(0x190)]({'tag':_0x5c30fd(0x1a8),'attributes':{'class':[_0x5c30fd(0x1e1)],'tabindex':'-1'}}),this[_0x5c30fd(0x1a6)](_0x5c30fd(0x1a5),!0x1),this[_0x5c30fd(0x1ca)][_0x5c30fd(0x196)](this[_0x5c30fd(0x1ae)]()),_0x101d20[_0x5c30fd(0x196)](this);}[_0xd2459a(0x195)](){const _0x269626=_0xd2459a;super[_0x269626(0x195)](),this[_0x269626(0x1e2)]();}[_0xd2459a(0x1b2)](_0x584e39){const _0x20c3f9=_0xd2459a;this[_0x20c3f9(0x1ac)][_0x20c3f9(0x1c0)]=_0x584e39['id'],this[_0x20c3f9(0x1ac)][_0x20c3f9(0x1c8)][_0x20c3f9(0x1ab)][_0x20c3f9(0x197)]=_0x584e39[_0x20c3f9(0x1ba)];}[_0xd2459a(0x1a7)](_0x4f8e06,_0x1f2d3f,_0x3cf9bc,_0x5d1c07,_0x435a2d,_0x254975){const _0x2077c5=_0xd2459a;this[_0x2077c5(0x1cb)](),this[_0x2077c5(0x1b2)](_0x4f8e06),this[_0x2077c5(0x1b3)]();const _0x3dccbb=Array[_0x2077c5(0x1dc)](_0x1f2d3f[_0x2077c5(0x1d5)]())[_0x2077c5(0x1b1)](),_0x3534f0=this[_0x2077c5(0x1e5)](_0x3cf9bc,_0x3dccbb);_0x2077c5(0x1b5)===_0x5d1c07?(this[_0x2077c5(0x1a5)]=!0x0,this[_0x2077c5(0x1d3)](_0x4f8e06['id']),this[_0x2077c5(0x19a)]({'target':()=>this[_0x2077c5(0x191)](_0x1f2d3f,_0x3534f0,_0x4f8e06['id'],_0x435a2d,_0x254975)})):_0x2077c5(0x1a2)===_0x5d1c07&&(this[_0x2077c5(0x1a5)]=!0x1,this[_0x2077c5(0x19a)]({'target':()=>this[_0x2077c5(0x19e)](_0x1f2d3f,_0x3534f0,_0x4f8e06['id'])}));}[_0xd2459a(0x1d6)](){const _0x32f9f8=_0xd2459a;this[_0x32f9f8(0x1d2)](),this[_0x32f9f8(0x18f)](),this[_0x32f9f8(0x1cb)](),this[_0x32f9f8(0x1cc)]=void 0x0,this[_0x32f9f8(0x1e6)]=void 0x0,this[_0x32f9f8(0x1b4)]=void 0x0;}[_0xd2459a(0x1b7)](){const _0x4db291=_0xd2459a;this[_0x4db291(0x1ac)][_0x4db291(0x19d)]=!0x1;}[_0xd2459a(0x1bf)](){const _0x1efdb7=_0xd2459a;this[_0x1efdb7(0x1ac)][_0x1efdb7(0x19d)]=!0x0;}[_0xd2459a(0x1b6)](){const _0x4bffde=_0xd2459a;this[_0x4bffde(0x1a3)](_0x4bffde(0x1b6));}[_0xd2459a(0x1cb)](){const _0x1cec20=_0xd2459a;_0x312d6c[_0x1cec20(0x1cf)][_0x1cec20(0x1b9)](_0x1cec20(0x1da))[_0x1cec20(0x192)](_0x1d9ff4=>{const _0x5b3707=_0x1cec20;_0x1d9ff4[_0x5b3707(0x194)][_0x5b3707(0x1dd)](_0x5b3707(0x1ce));});}[_0xd2459a(0x1d3)](_0x541bb7){const _0x432bdf=_0xd2459a;_0x312d6c[_0x432bdf(0x1cf)][_0x432bdf(0x1b9)](_0x432bdf(0x1a0)+_0x541bb7+'\x22]')[_0x432bdf(0x192)](_0x439f86=>{const _0x2f1bfb=_0x432bdf;_0x439f86[_0x2f1bfb(0x194)][_0x2f1bfb(0x196)](_0x2f1bfb(0x1ce));});}[_0xd2459a(0x1e2)](){const _0x3144a8=_0xd2459a;_0x578e3e({'emitter':this,'activator':()=>this[_0x3144a8(0x1b0)],'contextElements':()=>{const _0x570062=_0x3144a8,_0x330ea3=[this[_0x570062(0x1ab)]];return this[_0x570062(0x1e6)]&&_0x330ea3[_0x570062(0x1de)](this[_0x570062(0x1e6)]),_0x330ea3;},'callback':()=>{const _0x522546=_0x3144a8;this[_0x522546(0x1d2)](),this[_0x522546(0x18f)](),this[_0x522546(0x1cb)](),this[_0x522546(0x1b6)](),this[_0x522546(0x1e6)]=void 0x0,this[_0x522546(0x1cc)]=void 0x0,this[_0x522546(0x1b4)]=void 0x0;}});}[_0xd2459a(0x1ae)](){const _0x1ff84d=_0xd2459a,_0xc1797b=new _0x53e696();return this[_0x1ff84d(0x1ac)]=new _0x35da87(this[_0x1ff84d(0x193)],''),this[_0x1ff84d(0x1ac)][_0x1ff84d(0x1c8)][_0x1ff84d(0x190)]({'attributes':{'class':[_0x1ff84d(0x199)]}}),this[_0x1ff84d(0x1ac)][_0x1ff84d(0x19c)](_0x1ff84d(0x1c7),_0x1ff84d(0x1c4))['to'](this),_0xc1797b[_0x1ff84d(0x1e0)]({'tag':_0x1ff84d(0x1a8),'attributes':{'class':[_0x1ff84d(0x1e1),_0x1ff84d(0x1c3),this[_0x1ff84d(0x1bc)]['if'](_0x1ff84d(0x1a5),_0x1ff84d(0x1d1))]},'children':[{'tag':'p','attributes':{'class':[_0x1ff84d(0x1aa)]},'children':[this[_0x1ff84d(0x1ac)]]}]}),_0xc1797b;}[_0xd2459a(0x191)](_0x2be4ff,_0x27e15c,_0x3c7b66,_0x5fab68,_0xbd6c4c){const _0x3aa3f1=_0xd2459a,_0xca3424=this[_0x3aa3f1(0x1c1)][_0x3aa3f1(0x1c5)](_0x3aa3f1(0x1a9),''),_0x4de02d=Array[_0x3aa3f1(0x1dc)](_0x2be4ff[_0x3aa3f1(0x1d5)]());let _0x1153bc,_0x43b661=_0x4de02d[_0x3aa3f1(0x1b1)]();return void 0x0!==_0x27e15c&&this[_0x3aa3f1(0x1bb)](_0x43b661[_0x27e15c],_0x5fab68,_0xbd6c4c)?(_0x1153bc=_0x43b661[_0x27e15c],this[_0x3aa3f1(0x1cc)]=_0x27e15c):this[_0x3aa3f1(0x1bb)](_0x43b661[0x0],_0x5fab68,_0xbd6c4c)&&void 0x0===_0x27e15c?_0x1153bc=_0x43b661[0x0]:(_0x43b661='s'==_0xca3424[0x0]?[..._0x4de02d][_0x3aa3f1(0x1b1)]():_0x4de02d,_0x43b661[_0x3aa3f1(0x192)](_0x1489af=>{const _0x1524a3=_0x3aa3f1;this[_0x1524a3(0x1bb)](_0x1489af,_0x5fab68,_0xbd6c4c)&&(_0x1153bc=_0x1489af);})),this[_0x3aa3f1(0x1b4)]=_0x3c7b66,this[_0x3aa3f1(0x1e6)]=_0x2be4ff,_0x1153bc||_0x2be4ff[_0x3aa3f1(0x198)]();}[_0xd2459a(0x19e)](_0x4fee98,_0x2592f8,_0x2e39bc){const _0x53d705=_0xd2459a,_0x39ab99=Array[_0x53d705(0x1dc)](_0x4fee98[_0x53d705(0x1d5)]())[_0x53d705(0x1b1)]();if(void 0x0===this[_0x53d705(0x1cc)]&&void 0x0!==_0x2592f8&&this[_0x53d705(0x1b4)]!==_0x2e39bc)return this[_0x53d705(0x1cc)]=_0x2592f8,this[_0x53d705(0x1e6)]=_0x4fee98,this[_0x53d705(0x1b4)]=_0x2e39bc,_0x39ab99[_0x2592f8];if(void 0x0!==this[_0x53d705(0x1cc)]&&this[_0x53d705(0x1b4)]===_0x2e39bc){if(_0x4fee98!==this[_0x53d705(0x1e6)])return Array[_0x53d705(0x1dc)](this[_0x53d705(0x1e6)][_0x53d705(0x1d5)]())[_0x53d705(0x1b1)]()[this[_0x53d705(0x1cc)]];return _0x39ab99[this[_0x53d705(0x1cc)]];}return void 0x0!==_0x2592f8&&this[_0x53d705(0x1b4)]!==_0x2e39bc?(this[_0x53d705(0x1cc)]=_0x2592f8,this[_0x53d705(0x1e6)]=_0x4fee98,this[_0x53d705(0x1b4)]=_0x2e39bc,_0x39ab99[_0x2592f8]):_0x4fee98[_0x53d705(0x198)]();}[_0xd2459a(0x1e5)](_0x30e447,_0x428592){const _0x24e970=_0xd2459a;if(_0x30e447)for(let _0x38351a=0x0;_0x38351a<_0x428592[_0x24e970(0x1cd)];_0x38351a++){const _0x1fdbf6=_0x428592[_0x38351a];if(_0x30e447[_0x24e970(0x1ad)]>=_0x1fdbf6[_0x24e970(0x1bd)]-0x3&&_0x30e447[_0x24e970(0x1ad)]<=_0x1fdbf6[_0x24e970(0x1db)]+0x3&&_0x30e447[_0x24e970(0x1df)]>=_0x1fdbf6[_0x24e970(0x1e4)]-0x3&&_0x30e447[_0x24e970(0x1df)]<=_0x1fdbf6[_0x24e970(0x1c9)]+0x3)return _0x38351a;}}[_0xd2459a(0x1bb)](_0x39ec75,_0x2d957a,_0x516696){const _0x22805d=_0xd2459a,_0x42abf9=new _0x44dee2(_0x39ec75),_0x54f0af=_0x2d957a||document[_0x22805d(0x1b8)],_0x2f831d=_0x42abf9[_0x22805d(0x19f)](_0x1ce69c(_0x516696)),_0x29b2a9=new _0x44dee2(_0x54f0af)[_0x22805d(0x19f)](_0x42abf9);return!!(_0x2f831d&&_0x29b2a9&&_0x42abf9[_0x22805d(0x1d8)]>0x0);}}