@ckeditor/ckeditor5-ai 46.0.1-alpha.8 → 46.0.1-alpha.9
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/build/ai.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +9 -9
- package/src/aiassistantediting.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x44e5f7,Command as _0x67ccfd}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x41433e,IconCheck as _0x3aa6c6,IconError as _0x3611e8,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x32b9cb,IconRobotPencil as _0x2479cb}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x3a6748,CKEditorError as _0x1d1ad9,ObservableMixin as _0x47c1b8,global as _0x1dd8fb,isVisible as _0x385bef,Rect as _0x3e5ee8,Collection as _0x44f40a,FocusTracker as et,KeystrokeHandler as rt,first as _0x5c9d83}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x57a4a2,View as _0x1f21dc,SpinnerView as _0x330507,IconView as _0x3aab38,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0xbf705b,createDropdown as _0x9d4488,addMenuToDropdown as _0xd9b79e,MenuBarMenuView as _0x33647f,MenuBarMenuListItemButtonView as _0x35221c,DialogViewPosition as _0x593c3e,MenuBarMenuListView as _0x26de47,MenuBarMenuListItemView as _0x194be2}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x59027d,ClipboardMarkersUtils as _0x15772c}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x55c6ae,ViewDataTransfer as _0x170372,ViewUpcastWriter as _0x25aa26,Matcher as _0x229015}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x534bf0,InvokeModelWithResponseStreamCommand as _0x203508,InvokeModelCommand as _0x36c6ee}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x463ab5,_0x5b60f7){const _0x4fe761=(0x0,_0x5b60f7['t'])('Other');return _0x463ab5['length']?'groupId'in _0x463ab5[0x0]?_0x463ab5:[{'groupId':K,'groupLabel':_0x4fe761,'order':0x1/0x0,'commands':_0x463ab5}]:[{'groupId':K,'groupLabel':_0x4fe761,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x44e5f7{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x6387e2}=this,_0x1d3c0e=['ck-fake-ai-selection'];_0x6387e2['config']['get']('ai.useTheme')&&_0x1d3c0e['push']('ck-ai-assistant-ui_theme'),_0x6387e2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x1d3c0e,'priority':0xc}}),_0x6387e2['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x39baab,{writer:_0x9c111})=>{if(!_0x39baab['markerRange']['isCollapsed'])return null;const _0x47f9ef=_0x9c111['createUIElement']('span');return _0x9c111['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x47f9ef),_0x47f9ef;}});}['afterInit'](){!async function(_0x160bae){const _0x2d1f23=_0x1b1281([0x64,0x32,0x78,0x65,0x61,0x7a,0x37,0x79,0x4b,0x33,0x68,0x75,0x51,0x46,0x42,0x70,0x36,0x4d,0x6b,0x74,0x48,0x44,0x38,0x73,0x4e,0x71,0x31,0x6c,0x63,0x6e,0x4a,0x34,0x6a,0x62,0x77,0x56,0x39,0x69,0x52,0x45,0x50,0x53,0x66,0x41,0x76,0x6f,0x43,0x4f,0x35,0x67,0x57,0x30,0x72,0x58,0x55,0x6d,0x49,0x59,0x54,0x4c,0x5a,0x47]),_0x5c041e=0x3fadcfe7,_0x22c1f7=0x3faaa057^_0x5c041e,_0x279a1a=window[_0x1b1281([0x44,0x61,0x74,0x65])][_0x1b1281([0x6e,0x6f,0x77])](),_0x1f8454=_0x160bae[_0x1b1281([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x1897bf=new window[(_0x1b1281([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x41b21b=>{_0x1f8454[_0x1b1281([0x6f,0x6e,0x63,0x65])](_0x1b1281([0x72,0x65,0x61,0x64,0x79]),_0x41b21b);}),_0x42b587={[_0x1b1281([0x6b,0x74,0x79])]:_0x1b1281([0x45,0x43]),[_0x1b1281([0x75,0x73,0x65])]:_0x1b1281([0x73,0x69,0x67]),[_0x1b1281([0x63,0x72,0x76])]:_0x1b1281([0x50,0x2d,0x32,0x35,0x36]),[_0x1b1281([0x78])]:_0x1b1281([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x1b1281([0x79])]:_0x1b1281([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x1b1281([0x61,0x6c,0x67])]:_0x1b1281([0x45,0x53,0x32,0x35,0x36])},_0x9f3b50=_0x1f8454[_0x1b1281([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x1b1281([0x67,0x65,0x74])](_0x1b1281([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x1b4522(){let _0x5173bb,_0x1ecb80=null,_0x2386b6=null;try{if(_0x9f3b50==_0x1b1281([0x47,0x50,0x4c]))return _0x1b1281([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5173bb=_0x51e3bb(),!_0x5173bb)return _0x1b1281([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5173bb[_0x1b1281([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2386b6=_0x471b2d(_0x5173bb[_0x1b1281([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5173bb[_0x1b1281([0x6a,0x74,0x69])])),await _0x5eacf6()?_0x2b7f03()?_0x27d94f()?_0x1b1281([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x536c8f()?(_0x5173bb[_0x1b1281([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1b1281([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1ecb80=_0x4e2360(_0x1b1281([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x5173bb[_0x1b1281([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1b1281([0x74,0x72,0x69,0x61,0x6c])&&(_0x1ecb80=_0x4e2360(_0x1b1281([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x23ce0b()):_0x1b1281([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x1b1281([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x1b1281([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x1b1281([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x27d94f(){const _0x25feba=[_0x1b1281([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x1b1281([0x74,0x72,0x69,0x61,0x6c])][_0x1b1281([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5173bb[_0x1b1281([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x279a1a/0x3e8:0xe10*_0x22c1f7;return _0x5173bb[_0x1b1281([0x65,0x78,0x70])]<_0x25feba;}function _0x2b7f03(){const _0x43fbf2=_0x5173bb[_0x1b1281([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x43fbf2&&(!!_0x43fbf2[_0x1b1281([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b1281([0x2a]))||!!_0x43fbf2[_0x1b1281([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b1281([0x41,0x49])));}function _0x536c8f(){const _0x53ae85=_0x5173bb[_0x1b1281([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x53ae85||0x0==_0x53ae85[_0x1b1281([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x2537c6}=new URL(window[_0x1b1281([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x53ae85[_0x1b1281([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2537c6))return!0x0;const _0x1a9c15=_0x2537c6[_0x1b1281([0x73,0x70,0x6c,0x69,0x74])](_0x1b1281([0x2e]));return _0x53ae85[_0x1b1281([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x24a276=>_0x24a276[_0x1b1281([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b1281([0x2a])))[_0x1b1281([0x6d,0x61,0x70])](_0x193f4f=>_0x193f4f[_0x1b1281([0x73,0x70,0x6c,0x69,0x74])](_0x1b1281([0x2e])))[_0x1b1281([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x59a1e0=>_0x59a1e0[_0x1b1281([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x1a9c15[_0x1b1281([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1b1281([0x6d,0x61,0x70])](_0x1164b9=>Array(_0x1a9c15[_0x1b1281([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x1164b9[_0x1b1281([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1b1281([0x66,0x69,0x6c,0x6c])](_0x1164b9[0x0]===_0x1b1281([0x2a])?_0x1b1281([0x2a]):'')[_0x1b1281([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x1164b9))[_0x1b1281([0x73,0x6f,0x6d,0x65])](_0x756a6b=>_0x1a9c15[_0x1b1281([0x65,0x76,0x65,0x72,0x79])]((_0x28c68d,_0x596b05)=>_0x756a6b[_0x596b05]===_0x28c68d||_0x756a6b[_0x596b05]===_0x1b1281([0x2a])));}function _0x23ce0b(){return _0x1ecb80&&_0x2386b6?new window[(_0x1b1281([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xbe7c4b,_0x36038c)=>{_0x1ecb80[_0x1b1281([0x74,0x68,0x65,0x6e])](_0xbe7c4b,_0x36038c),_0x2386b6[_0x1b1281([0x74,0x68,0x65,0x6e])](_0x1ae564=>{_0x1ae564!=_0x1b1281([0x56,0x61,0x6c,0x69,0x64])&&_0xbe7c4b(_0x1ae564);},_0x36038c);}):_0x1ecb80||_0x2386b6||_0x1b1281([0x56,0x61,0x6c,0x69,0x64]);}}function _0x471b2d(_0x136dcd,_0x41c7e8){return new window[(_0x1b1281([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x53d67c=>{if(_0x5fdc7b())return _0x53d67c(_0x1b1281([0x56,0x61,0x6c,0x69,0x64]));_0x44a6ab(),_0x1f8454[_0x1b1281([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x1b1281([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x497487=!0x1;const _0x3a64c5=_0x3a6748();function _0x59fa0e(_0x5ed750){return!!_0x5ed750&&(typeof _0x5ed750===_0x1b1281([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x5ed750===_0x1b1281([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x5ed750[_0x1b1281([0x74,0x68,0x65,0x6e])]===_0x1b1281([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x5ed750[_0x1b1281([0x63,0x61,0x74,0x63,0x68])]===_0x1b1281([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x4a4a21(_0x4b9cda){_0x39d4dd(_0x4b9cda)[_0x1b1281([0x74,0x68,0x65,0x6e])](_0x24e133=>{if(!_0x24e133||_0x24e133[_0x1b1281([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x1b1281([0x6f,0x6b]))return _0x1b1281([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x37572a(_0x231a91(_0x3a64c5+_0x41c7e8))!=_0x24e133[_0x1b1281([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x1b1281([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x1b1281([0x56,0x61,0x6c,0x69,0x64]);})[_0x1b1281([0x74,0x68,0x65,0x6e])](_0x4b3d51=>(_0x549305(),_0x4b3d51),()=>{const _0x3a2285=_0x27f7c9();return null==_0x3a2285?(_0x549305(),_0x1b1281([0x56,0x61,0x6c,0x69,0x64])):_0x1b1281(_0x279a1a-_0x3a2285>(0x1ba14be7^_0x5c041e)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x1b1281([0x74,0x68,0x65,0x6e])](_0x53d67c)[_0x1b1281([0x63,0x61,0x74,0x63,0x68])](()=>{_0x53d67c(_0x1b1281([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x3909da=0x3f9b2167^_0x5c041e;function _0x549305(){const _0x271a10=_0x1b1281([0x6c,0x6c,0x63,0x74,0x2d])+_0x37572a(_0x231a91(_0x136dcd)),_0x455636=_0x2bb9e3(_0x37572a(window[_0x1b1281([0x4d,0x61,0x74,0x68])][_0x1b1281([0x63,0x65,0x69,0x6c])](_0x279a1a/_0x3909da)));window[_0x1b1281([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1b1281([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x271a10,_0x455636);}function _0x27f7c9(){const _0x46b5a2=_0x1b1281([0x6c,0x6c,0x63,0x74,0x2d])+_0x37572a(_0x231a91(_0x136dcd)),_0xd11266=window[_0x1b1281([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1b1281([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x46b5a2);return _0xd11266?window[_0x1b1281([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2bb9e3(_0xd11266),0x10)*_0x3909da:null;}function _0x39d4dd(_0x3b45a9){return new window[(_0x1b1281([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x859d6a,_0x4e2d03)=>{_0x3b45a9[_0x1b1281([0x74,0x68,0x65,0x6e])](_0x859d6a,_0x4e2d03),window[_0x1b1281([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4e2d03,0x3fac1b27^_0x5c041e);});}}_0x1f8454[_0x1b1281([0x6f,0x6e])](_0x1b1281([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0xca7273,_0x4c1558)=>{if(_0x4c1558[0x0]!=_0x136dcd)return _0x53d67c(_0x1b1281([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x4c1558[0x1]={..._0x4c1558[0x1],[_0x1b1281([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3a64c5};},{[_0x1b1281([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1b1281([0x68,0x69,0x67,0x68])}),_0x1f8454[_0x1b1281([0x6f,0x6e])](_0x1b1281([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3aca6d=>{_0x59fa0e(_0x3aca6d[_0x1b1281([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x497487=!0x0,_0x4a4a21(_0x3aca6d[_0x1b1281([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x1b1281([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1b1281([0x6c,0x6f,0x77])}),_0x1897bf[_0x1b1281([0x74,0x68,0x65,0x6e])](()=>{_0x497487||_0x53d67c(_0x1b1281([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5fdc7b(){return _0x1f8454[_0x1b1281([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1b1281([0x76,0x69,0x65,0x77])][_0x1b1281([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x1b1281([0x61,0x75,0x74,0x6f]);}function _0x44a6ab(){_0x1f8454[_0x1b1281([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1b1281([0x76,0x69,0x65,0x77])][_0x1b1281([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x1b1281([0x61,0x75,0x74,0x6f]);}}function _0x4e2360(_0x77e7a9){const _0x5c2d1e=[new window[(_0x1b1281([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xa18839=>setTimeout(_0xa18839,0x3fa4f12b^_0x5c041e)),_0x1897bf[_0x1b1281([0x74,0x68,0x65,0x6e])](()=>new window[(_0x1b1281([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4e2369=>{let _0x1d3e86=0x0;_0x1f8454[_0x1b1281([0x6d,0x6f,0x64,0x65,0x6c])][_0x1b1281([0x6f,0x6e])](_0x1b1281([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3059e8,_0x4933d0)=>{_0x4933d0[0x0][_0x1b1281([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1d3e86++,_0x1d3e86==(0x3fadce1f^_0x5c041e)&&(_0x4e2369(),_0x3059e8[_0x1b1281([0x6f,0x66,0x66])]());});}))];return window[_0x1b1281([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x1b1281([0x72,0x61,0x63,0x65])](_0x5c2d1e)[_0x1b1281([0x74,0x68,0x65,0x6e])](()=>_0x77e7a9);}async function _0x185e6f(){await _0x1897bf,_0x1f8454[_0x1b1281([0x6d,0x6f,0x64,0x65,0x6c])][_0x1b1281([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x569d51,_0x1f8454[_0x1b1281([0x6d,0x6f,0x64,0x65,0x6c])][_0x1b1281([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x569d51,_0x1f8454[_0x1b1281([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x1b1281([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xe127ac(_0x27d485){const _0x2a6fdb=_0x1cb887();_0x1f8454[_0x2a6fdb]=_0x1b1281([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x27d485,_0x27d485!=_0x1b1281([0x56,0x61,0x6c,0x69,0x64])&&_0x185e6f();}function _0x1cb887(){const _0x44ee82=window[_0x1b1281([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x1b1281([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x1b1281([0x6e,0x6f,0x77])]())[_0x1b1281([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x1b1281([0x2e]),'');let _0x16e102=_0x1b1281([0x64]);for(let _0x3f490f=0x0;_0x3f490f<_0x44ee82[_0x1b1281([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3f490f+=0x2){let _0x478dd3=window[_0x1b1281([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x44ee82[_0x1b1281([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3f490f,_0x3f490f+0x2));_0x478dd3>=_0x2d1f23[_0x1b1281([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x478dd3-=_0x2d1f23[_0x1b1281([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x16e102+=_0x2d1f23[_0x478dd3];}return _0x16e102;}function _0x51e3bb(){const _0x5bd517=_0x9f3b50[_0x1b1281([0x73,0x70,0x6c,0x69,0x74])](_0x1b1281([0x2e]));if(0x3!=_0x5bd517[_0x1b1281([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1ebe11(_0x5bd517[0x1]);function _0x1ebe11(_0x134d0a){const _0x1a788f=_0x25b075(_0x134d0a);return _0x1a788f&&_0x5a35d4()?_0x1a788f:null;function _0x5a35d4(){const _0x34b25f=_0x1a788f[_0x1b1281([0x6a,0x74,0x69])],_0x5ef36a=window[_0x1b1281([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x34b25f[_0x1b1281([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x34b25f[_0x1b1281([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x276011={..._0x1a788f,[_0x1b1281([0x6a,0x74,0x69])]:_0x34b25f[_0x1b1281([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x34b25f[_0x1b1281([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x276011[_0x1b1281([0x76,0x63])],_0x231a91(_0x276011)==_0x5ef36a;}}}async function _0x5eacf6(){let _0x2f71a0=!0x0;try{const _0x217bdf=_0x9f3b50[_0x1b1281([0x73,0x70,0x6c,0x69,0x74])](_0x1b1281([0x2e])),[_0x15b4e9,_0x2e4702,_0x1b25de]=_0x217bdf;return _0xccbea9(_0x15b4e9),await _0x12c342(_0x15b4e9,_0x2e4702,_0x1b25de),_0x2f71a0;}catch{return!0x1;}function _0xccbea9(_0xf0e9ba){const _0x30ee04=_0x25b075(_0xf0e9ba);_0x30ee04&&_0x30ee04[_0x1b1281([0x61,0x6c,0x67])]==_0x1b1281([0x45,0x53,0x32,0x35,0x36])||(_0x2f71a0=!0x1);}async function _0x12c342(_0x47381f,_0x211d13,_0x53d172){const _0x54767a=window[_0x1b1281([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x1b1281([0x66,0x72,0x6f,0x6d])](_0x37e4c9(_0x53d172),_0x486f45=>_0x486f45[_0x1b1281([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x221bf0=new window[(_0x1b1281([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x1b1281([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x47381f+_0x1b1281([0x2e])+_0x211d13),_0x42d767=window[_0x1b1281([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x1b1281([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x42d767)return;const _0x5c3f06=await _0x42d767[_0x1b1281([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x1b1281([0x6a,0x77,0x6b]),_0x42b587,{[_0x1b1281([0x6e,0x61,0x6d,0x65])]:_0x1b1281([0x45,0x43,0x44,0x53,0x41]),[_0x1b1281([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x1b1281([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x1b1281([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x42d767[_0x1b1281([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x1b1281([0x6e,0x61,0x6d,0x65])]:_0x1b1281([0x45,0x43,0x44,0x53,0x41]),[_0x1b1281([0x68,0x61,0x73,0x68])]:{[_0x1b1281([0x6e,0x61,0x6d,0x65])]:_0x1b1281([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5c3f06,_0x54767a,_0x221bf0)||(_0x2f71a0=!0x1);}}function _0x25b075(_0x24c189){return _0x24c189[_0x1b1281([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x1b1281([0x65,0x79]))?JSON[_0x1b1281([0x70,0x61,0x72,0x73,0x65])](_0x37e4c9(_0x24c189)):null;}function _0x37e4c9(_0x30fcf4){return window[_0x1b1281([0x61,0x74,0x6f,0x62])](_0x30fcf4[_0x1b1281([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x1b1281([0x2b]))[_0x1b1281([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x1b1281([0x2f])));}function _0x231a91(_0xe17c4){let _0x3f416b=0x1505;function _0xe08a3d(_0x24dd0d){for(let _0xd1f3a6=0x0;_0xd1f3a6<_0x24dd0d[_0x1b1281([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xd1f3a6++){const _0x2e4764=_0x24dd0d[_0x1b1281([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0xd1f3a6);_0x3f416b=(_0x3f416b<<0x5)+_0x3f416b+_0x2e4764,_0x3f416b&=_0x3f416b;}}function _0x4aaceb(_0x3e115f){Array[_0x1b1281([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3e115f)?_0x3e115f[_0x1b1281([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x4aaceb):_0x3e115f&&typeof _0x3e115f==_0x1b1281([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x1b1281([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3e115f)[_0x1b1281([0x73,0x6f,0x72,0x74])]()[_0x1b1281([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x592065,_0x42c035])=>{_0xe08a3d(_0x592065),_0x4aaceb(_0x42c035);}):_0xe08a3d(window[_0x1b1281([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3e115f));}return _0x4aaceb(_0xe17c4),_0x3f416b>>>0x0;}function _0x37572a(_0x582ee7){return _0x582ee7[_0x1b1281([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x1b1281([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x1b1281([0x30]));}function _0x2bb9e3(_0x591341){return _0x591341[_0x1b1281([0x73,0x70,0x6c,0x69,0x74])]('')[_0x1b1281([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x1b1281([0x6a,0x6f,0x69,0x6e])]('');}function _0x569d51(){}function _0x1b1281(_0x4f72ba){return _0x4f72ba['map'](_0x30cfde=>String['fromCharCode'](_0x30cfde))['join']('');}_0xe127ac(await _0x1b4522());}(this);}['showFakeVisualSelection'](){const _0x2b9268=this['editor']['model'];_0x2b9268['change'](_0x1b5c3c=>{const _0x4b920f=_0x2b9268['document']['selection']['getRanges']();let _0x39ac15=0x0;for(const _0x3895c0 of _0x4b920f){const _0x4317bd=w+':'+_0x39ac15;if(_0x2b9268['markers']['has'](_0x4317bd))_0x1b5c3c['updateMarker'](_0x4317bd,{'range':_0x3895c0});else{if(_0x3895c0['start']['isAtEnd']){const _0x4fa2e7=_0x3895c0['start']['getLastMatchingPosition'](({item:_0x3de008})=>!_0x2b9268['schema']['isContent'](_0x3de008),{'boundaries':_0x3895c0});_0x1b5c3c['addMarker'](_0x4317bd,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1b5c3c['createRange'](_0x4fa2e7,_0x3895c0['end'])});}else _0x1b5c3c['addMarker'](_0x4317bd,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3895c0});}_0x39ac15++;}});}['hideFakeVisualSelection'](){const _0xd1888a=this['editor']['model'],_0xd2ec73=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0xd2ec73['length']&&_0xd1888a['change'](_0xe78330=>{_0xd2ec73['forEach'](_0x2d43a2=>{_0xe78330['removeMarker'](_0x2d43a2);});});}['insertContent'](_0x10b2f7,_0x1cea33){const _0x2b38b2=this['_getAISelection'](),_0x44a5f8=_0x1cea33||_0x2b38b2['getFirstRange']();this['editor']['model']['canEditAt'](_0x44a5f8)&&this['editor']['model']['change'](_0x26ab13=>{this['hideFakeVisualSelection'](),_0x1cea33||this['_resetContentOfSelectedTableCells'](_0x26ab13,_0x2b38b2),this['_pasteHTMLUsingClipboard']({'insertAt':_0x44a5f8,'writer':_0x26ab13,'html':_0x10b2f7});});}['insertContentBelow'](_0x5884f9){const {model:_0x1cd242}=this['editor'],_0x592c7b=this['_getAISelection']();_0x1cd242['change'](()=>{const _0x5be6d1=this['_prepareTableInsertBelowPosition'](_0x5884f9,_0x592c7b)||this['_getDefaultInsertBelowPosition'](_0x592c7b);this['insertContent'](_0x5884f9,_0x5be6d1);});}['_getAISelection'](){const _0x2d0b4e=this['editor']['model'],_0x2991ab=Array['from'](_0x2d0b4e['markers']['getMarkersGroup'](w))['map'](_0x52c3b2=>_0x52c3b2['getRange']());return _0x2d0b4e['createSelection'](_0x2991ab);}['_pasteHTMLUsingClipboard']({writer:_0x1c3905,html:_0x1bb7cd,insertAt:_0x12c335}){const {view:_0x620db3}=this['editor']['editing'],_0x2a5cfd=this['editor']['plugins']['get'](_0x59027d),_0x376d79=new gt();_0x376d79['setData']('text/html',_0x1bb7cd);const _0x58cd0c=new ClipboardEvent('paste',{'clipboardData':_0x376d79}),_0x4e53e0=new _0x55c6ae(_0x620db3,_0x58cd0c,{'dataTransfer':new _0x170372(_0x376d79)});_0x1c3905['setSelection'](_0x12c335);const _0x4a405b=(_0x43ccd1,_0x35f7dd)=>{_0x35f7dd['resultRange']&&_0x1c3905['setSelection'](_0x35f7dd['resultRange']);};_0x2a5cfd['once']('contentInsertion',_0x4a405b,{'priority':'lowest'}),_0x620db3['document']['fire']('paste',_0x4e53e0),_0x2a5cfd['off']('contentInsertion',_0x4a405b);}['_getDefaultInsertBelowPosition'](_0x5676ae){const {model:_0x4fc17d}=this['editor'],_0x1edb63=Array['from'](_0x5676ae['getSelectedBlocks']());return _0x1edb63['length']?_0x4fc17d['createPositionAfter'](_0x1edb63['pop']()):_0x5676ae['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x277fec,_0x2e7434){const {model:_0x2985d3,plugins:_0x48769f}=this['editor'];if(_0x48769f['has']('TableUtils')){const _0x13a7c7=_0x48769f['get']('TableUtils')['getSelectedTableCells'](_0x2e7434);if(_0x13a7c7['length']){const _0x319847=this['_getTableRowCountFromContent'](_0x277fec),_0x2bf72d=this['_createEmptyTableRows'](_0x13a7c7,_0x319847);return _0x2985d3['createPositionAt'](_0x2bf72d,0x0);}}return null;}['_getTableRowCountFromContent'](_0x296a){const _0xdaa92e=this['editor']['plugins']['get']('TableUtils'),_0x33359b=this['editor']['data']['parse'](_0x296a),_0x293d44=Array['from'](_0x33359b['getChildren']())['filter'](_0x351344=>_0x351344['is']('element','table'));let _0x2417c4=0x0;return _0x293d44['forEach'](_0xa4f7e3=>{_0x2417c4+=_0xdaa92e['getRows'](_0xa4f7e3);}),_0x2417c4;}['_createEmptyTableRows'](_0x2e06c2,_0x33a00f){const _0x393e86=this['editor']['plugins']['get']('TableUtils'),_0x4a45a8=_0x393e86['getRowIndexes'](_0x2e06c2),_0x54522a=_0x393e86['getColumnIndexes'](_0x2e06c2),_0x57837c=_0x4a45a8['last']+0x1,_0x82e3f0=_0x54522a['first'],_0x23bea6=_0x2e06c2[0x0]['findAncestor']('table');for(let _0x5de430=0x0;_0x5de430<_0x33a00f;_0x5de430++)_0x393e86['insertRows'](_0x23bea6,{'at':_0x57837c});return _0x23bea6['getChild'](_0x57837c)['getChild'](_0x82e3f0);}['_resetContentOfSelectedTableCells'](_0x2bc852,_0x3e7fec){const {plugins:_0x4783bf}=this['editor'],{model:_0x1bad62}=_0x2bc852;if(!_0x4783bf['has']('TableUtils'))return;_0x4783bf['get']('TableUtils')['getSelectedTableCells'](_0x3e7fec)['length']&&_0x1bad62['deleteContent'](_0x3e7fec);}}class x extends _0x44e5f7{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1d1ad9('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x42c848){super(_0x42c848),this['name']='AIRequestError';}}function i(_0x447459,_0x2df03c,_0x4a66d5){const t=_0x447459['t'];switch(_0x2df03c){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x4a66d5);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4a66d5);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x4a66d5);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x2df03c;}}class E extends _0x67ccfd{['_commandDefinitions'];constructor(_0x9bad36,_0x4e9329){super(_0x9bad36),this['_commandDefinitions']=_0x4e9329,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x593f9f,_0x2554ae,_0x4036d8)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x4036d8));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x46cd70,_0x37167a,_0x292a65)=>{this['enabledCommandsIds']=_0x292a65?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3a881b=this['editor']['model'];this['_hasContext']=function(_0x2ea849){const _0x188019=_0x2ea849['document']['selection'];return _0x188019['isCollapsed']?0x0!==[..._0x188019['getSelectedBlocks']()]['length']&&![..._0x188019['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x2ea849['hasContent'](_0x188019['getFirstRange']());}(_0x3a881b);const _0x4fd9fd=_0x3a881b['document']['selection'],_0x493fec=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x338277 of _0x4fd9fd['getRanges']())for(const _0x697d70 of _0x338277['getItems']())if(_0x697d70['is']('element')&&_0x493fec['includes'](_0x697d70['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3ba58e='',_0x4f1399='',_0xdaf302='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x3ba58e,_0x4f1399,_0xdaf302);}}function F(_0x16bc3d,_0x3d2339){const _0x55344a=new Set();for(const _0x57e7f6 of _0x16bc3d['values']())(_0x3d2339||!0x1===_0x57e7f6['requiresContent'])&&_0x55344a['add'](_0x57e7f6['id']);return Array['from'](_0x55344a);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x47c1b8(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3c0984,_0x460c5a,_0x415101){super(),this['editor']=_0x3c0984,this['textAdapter']=_0x460c5a,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x415101,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x19a3b1,_0x5e949f,_0x546eb5)=>{this['view']['value']=this['_sanitizeHTML'](_0x546eb5);}),this['listenTo'](this['view'],'submitPrompt',(_0x4720b3,_0x422f5e)=>{const _0x4e524e=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x422f5e,_0x4e524e,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x160d67,query:_0x150051,htmlContent:_0xb3fb23,label:_0x3c64a0,mainActionLabel:_0x28ed3c}){this['view']['prompt']=_0x3c64a0,this['view']['mainAction']=_0x28ed3c,this['initialContext']=_0xb3fb23,_0x150051&&(this['view']['isRendered']?this['_handleQuery'](_0x150051,_0xb3fb23,_0x160d67,_0x3c64a0):this['view']['once']('render',()=>{this['_handleQuery'](_0x150051,_0xb3fb23,_0x160d67,_0x3c64a0);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x5a2cd8,_0x403406,_0x592a15,_0x46edbc){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x403406,this['previousQuery']=_0x5a2cd8,this['previousLabel']=_0x46edbc||_0x5a2cd8,this['previousActionId']=_0x592a15,new Promise(_0x12c5d2=>{this['textAdapter']['makeRequest']({'query':_0x5a2cd8,'context':_0x403406,'onData':_0xeaa414=>{this['currentResponse']=_0xeaa414,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x592a15})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x4f26c5=>{_0x4f26c5 instanceof R?this['view']['handleError'](_0x4f26c5['message']):this['view']['handleError'](),_0x12c5d2();})['finally'](()=>{this['stopProcessing'](),_0x12c5d2();});});}['_parseAndNormalizeContent'](_0x48950a,_0x5859c8=!0x1){const _0x53d62d=Q['exec'](_0x48950a);_0x48950a=_0x53d62d?_0x48950a['substring'](_0x53d62d[0x1]['length']):_0x48950a['length']<0x64&&!_0x5859c8?'':this['_stripMarkdownSyntax'](_0x48950a);const _0xe12513=this['_domParser']['parseFromString'](_0x48950a,'text/html');if(_0x53d62d){const _0x5d6460=Array['from'](_0xe12513['body']['childNodes']);_0x5d6460['reverse']();for(const _0x142803 of _0x5d6460){if(_0x142803['nodeType']==Node['ELEMENT_NODE'])break;_0x142803['remove']();}}const _0x26a201=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xe12513['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x26a201);const _0x21217b=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x51b92c=this['editor']['data']['toModel'](_0x26a201);return _0x21217b||_0x51b92c['markers']['clear'](),this['editor']['data']['stringify'](_0x51b92c);}['_normalizeResponseHeadings'](_0x4b4ccf){const _0x118eec=new _0x25aa26(this['editor']['editing']['view']['document']),_0x4ad1d8=new _0x229015({'name':/^h[1-5]$/}),_0x20306e=[];let _0x218616=!0x1;for(const _0x412f38 of _0x4b4ccf)_0x412f38['is']('element')&&_0x4ad1d8['match'](_0x412f38)&&(_0x20306e['push'](_0x412f38),'h1'==_0x412f38['name']&&(_0x218616=!0x0));if(_0x218616){for(const _0x5577f8 of _0x20306e)_0x118eec['rename']('h'+(parseInt(_0x5577f8['name'][0x1])+0x1),_0x5577f8);}}['_isH1TagSupportEnabled'](){const {data:_0x1cd5ee,editing:_0x58d7b7}=this['editor'],_0x571361=_0x1cd5ee['htmlProcessor']['toView']('<h1></h1>'),_0x5c8ef9=_0x1cd5ee['toView'](_0x1cd5ee['toModel'](_0x571361));return!!_0x58d7b7['view']['domConverter']['viewToDom'](_0x5c8ef9)['querySelector']('h1');}['_sanitizeHTML'](_0x3d93f9){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3d93f9),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x1404fa){const _0x48163c=_0x1404fa['trim']();return _0x48163c['startsWith']('```html')?_0x48163c['endsWith']('```')?_0x48163c['substring'](0x7,_0x48163c['length']-0x3):_0x48163c['substring'](0x7):_0x1404fa;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x1c96f9){super(_0x1c96f9),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4061df=>i(_0x1c96f9,'AI_'+_0x4061df['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x1c96f9,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x1c96f9,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x1c96f9,'Stop'));const _0x1068d1=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x1068d1['if']('isVisible','ck-hidden',_0x367576=>!_0x367576)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x33c00c,_0x200dc2){const _0x234f82=new _0x57a4a2(this['locale']);return _0x234f82['set']({'label':_0x33c00c,'class':_0x200dc2||'','isVisible':!0x0,'withText':!0x0}),_0x234f82;}}class ct extends _0x1f21dc{['contentFieldView'];['copyButtonView'];constructor(_0x34d158,_0x4c004a=''){super(_0x34d158),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3c0815=this['bindTemplate'];this['contentFieldView']=new bt(_0x34d158,_0x4c004a),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3c0815['if']('isVisible','ck-hidden',_0x5a09cb=>!_0x5a09cb)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3c0815['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x204e6f=!0x1;this['on']('change:value',(_0x475796,_0x3fc6cc,_0x5672a3)=>{const _0x3d0341=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x5672a3),this['isProcessing']&&_0x3d0341&&!_0x204e6f&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0xc8ccf0,_0x701c1c,_0x221a87)=>{_0x204e6f=!0x1,_0x221a87?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x204e6f=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x204e6f=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x30ede6=this['locale'],_0x45495e=new _0x57a4a2(this['locale']),_0x5ac1ea='ck-ai-form__copy-button';return _0x45495e['set']({'label':i(_0x30ede6,'Copy'),'icon':_0x41433e,'class':_0x5ac1ea,'tooltip':!0x0}),_0x45495e['bind']('isVisible')['to'](this,'value',_0x499199=>!!_0x499199),_0x45495e['bind']('isEnabled')['to'](this,'isProcessing',_0x5f2864=>!_0x5f2864),_0x45495e['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x45495e['icon']=_0x3aa6c6,_0x45495e['class']=_0x5ac1ea+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x45495e['icon']=_0x41433e,_0x45495e['class']=_0x5ac1ea;},0x3e8);}),_0x45495e;}['_copyHTMLToClipboard'](_0x386625){const {window:_0x533300,document:_0x4b8347}=_0x1dd8fb;if(_0x533300['ClipboardItem']){const {Blob:_0x4751a1,ClipboardItem:_0x5a7077}=_0x533300,_0x55226a=[new _0x5a7077({'text/html':new _0x4751a1([_0x386625['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4751a1([_0x386625['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x55226a);}else{const _0x2262af=_0x4b8347['createElement']('div');_0x2262af['style']['position']='absolute',_0x2262af['style']['left']='-9999px',_0x2262af['innerHTML']='<span>[</span>'+_0x386625['innerHTML']+'<span>]</span>',_0x4b8347['body']['appendChild'](_0x2262af);const _0x4577ab=_0x4b8347['createRange']();_0x4577ab['setStartAfter'](_0x2262af['firstElementChild']),_0x4577ab['setEndBefore'](_0x2262af['lastElementChild']);const _0x1a92a5=_0x533300['getSelection']();_0x1a92a5['removeAllRanges'](),_0x1a92a5['addRange'](_0x4577ab),_0x4b8347['execCommand']('copy'),_0x2262af['remove']();}}}class bt extends _0x1f21dc{constructor(_0x2e3d89,_0x4f54a2=''){super(_0x2e3d89),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4f54a2,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x183dcf){this['element']['innerHTML']=_0x183dcf;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5d1a37=new _0x1f21dc(),_0x4b8c6c=this['locale'],_0xc942a8=new _0x330507();return _0xc942a8['isVisible']=!0x0,_0x5d1a37['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0xc942a8,{'text':i(_0x4b8c6c,'AI\x20is\x20writing...')}]}),_0x5d1a37['render'](),_0x5d1a37;}}class mt extends _0x1f21dc{constructor(_0x4b27c9,_0x4c1caa=''){super(_0x4b27c9);const _0x313a86=new _0x3aab38(),_0x42c359=this['bindTemplate'];this['set']('text',_0x4c1caa),_0x313a86['content']=_0x3611e8,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x313a86,{'text':_0x42c359['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x36f785,_0x4bca5f){super(_0x36f785,_0x4bca5f),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x434abd,_0x2d614a)=>{_0x434abd['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2d614a());});}['_createSubmitButton'](){const _0x11e748=new _0x57a4a2(this['locale']),_0x4e92fa=this['locale'];return _0x11e748['set']({'icon':it,'label':i(_0x4e92fa,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x11e748['on']('execute',()=>{this['submit']();}),_0x11e748['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x1c5b32,_0x3dffb9)=>!_0x1c5b32&&_0x3dffb9),_0x11e748;}['_createShowHistoryButton'](){const _0x2dbec3=new _0x57a4a2(this['locale']),_0x3d5d87=this['resultsView'],_0x184310=this['locale'];_0x2dbec3['set']({'label':i(_0x184310,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x2dbec3['bind']('isOn')['to'](_0x3d5d87,'isVisible'),_0x2dbec3['bind']('isEnabled')['to'](this,'isEnabled'),_0x2dbec3['on']('execute',()=>{_0x3d5d87['isVisible']=!_0x3d5d87['isVisible'],_0x3d5d87['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1c648c=()=>{_0x1dd8fb['window']['requestAnimationFrame'](()=>{if(_0x385bef(this['element'])){const _0x1d183c=new _0x3e5ee8(this['queryView']['fieldView']['element']),_0x13e02e=_0x1d183c['width'],_0x405a61='rtl'===_0x184310['uiLanguageDirection']?'left':'right';_0x1d183c['excludeScrollbarsAndBorders'](),_0x2dbec3['element']['style'][_0x405a61]=_0x13e02e-_0x1d183c['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1c648c),this['on']('render',_0x1c648c),_0x2dbec3;}['submit'](){const _0x4d6d53=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4d6d53);}['focus'](_0x5553ad){-0x1===_0x5553ad?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0xec208a){super(_0xec208a),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0xec208a,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x108978=0x0;for(const _0x10513a of this['items'])_0x108978+=_0x10513a['items']['length'];return{'resultsCount':_0x108978,'totalItemsCount':_0x108978};}['_createClearHistoryButton'](){const _0x1a58b7=this['locale'],_0x14f100=new _0x57a4a2(this['locale']);return _0x14f100['set']({'label':'('+i(_0x1a58b7,'Clear')+')','withText':!0x0}),_0x14f100['on']('execute',()=>this['fire']('clearHistory')),_0x14f100;}}class ut extends xt{constructor(_0x5524c1){super();const _0x531639=new wt(),_0x59b369=new _0x57a4a2(this['locale'],_0x531639);this['children']['add'](_0x59b369),_0x59b369['set']({'label':_0x5524c1['prompt'],'withText':!0x0}),_0x59b369['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x5524c1['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x44f40a{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4f295a,_0x1b695a)=>{const _0x4573ee=os(_0x1b695a['prompt']);for(const _0x4811d1 of this)if(_0x4811d1!=_0x1b695a&&os(_0x4811d1['prompt'])===_0x4573ee){this['remove'](_0x4811d1);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x8eeedc=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x8eeedc));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x29ccb6=>_0x29ccb6)));}}function os(_0x4f6e6f){return _0x4f6e6f['toLowerCase']()['trim']();}class k extends _0x1f21dc{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x169fcc,_0xd2dfbc,_0x5175b1=''){super(_0x169fcc),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x169fcc),this['contentArea']=new ct(_0x169fcc,_0x5175b1),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x492f76=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0xd2dfbc],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x492f76['if']('isError','ck-hidden',_0x317f41=>!_0x317f41)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x4c74e8=0x1){-0x1===_0x4c74e8?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x3f9e4b=this['locale'],_0x435eed=new lt(_0x3f9e4b,{'queryView':{'label':i(_0x3f9e4b,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x3f9e4b,'Empty\x20history'),'secondary':i(_0x3f9e4b,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x435eed['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x709532,_0x4a1903)=>_0x709532&&!_0x4a1903),this['listenTo'](_0x435eed,'submit',(_0xf999df,_0x190c3a)=>{this['prompt']=_0x190c3a;const _0x36fafe=ft(_0x190c3a);this['fire']('submitPrompt',_0x36fafe),_0x190c3a['trim']()&&this['_promptHistory']['add']({'prompt':_0x36fafe},0x0);},{'priority':'high'}),_0x435eed;}['_createHistoryView'](){const _0x3fbfe3=new pt(this['locale']);return _0x3fbfe3['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x3fbfe3['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3fbfe3;}['_createToolbar'](){const _0x2895b5=new at(this['locale']);return _0x2895b5['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x381cb0,_0x2b786c,_0x5bab65)=>_0x381cb0&&!_0x2b786c&&!!_0x5bab65),_0x2895b5['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2895b5['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2333ef,_0x56220b,_0x14f2bd)=>_0x2333ef&&!_0x56220b&&!!_0x14f2bd),_0x2895b5['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2895b5['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1eaf28,_0x1f2630)=>_0x1eaf28&&!_0x1f2630),_0x2895b5['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2895b5['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2895b5['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2895b5;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x49d6bd=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x49d6bd,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x25a4f3){const _0x1b64fd=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x25a4f3||i(_0x1b64fd,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x44e5f7{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x15772c,a,x,_0xbf705b];}constructor(_0x544598){super(_0x544598),_0x544598['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x544598['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x544598['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x544598['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x2814ad}=this;this['_aiAdapter']=_0x2814ad['plugins']['get'](x),this['_dialog']=_0x2814ad['plugins']['get'](_0xbf705b),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x76647b=new E(_0x2814ad,Array['from'](this['_commandDefinitions']['values']()));_0x2814ad['commands']['add']('showAIAssistant',_0x76647b),_0x2814ad['ui']['componentFactory']['add']('aiCommands',_0x2b3022=>{const _0x397bb5=_0x9d4488(_0x2b3022);return _0x397bb5['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x397bb5['buttonView']['set']({'label':i(_0x2b3022,'AI\x20Commands'),'icon':_0x32b9cb,'tooltip':!0x0}),_0x397bb5['on']('execute',_0x20f1d2=>this['_onExecute'](_0x20f1d2['source']['id'])),_0xd9b79e(_0x397bb5,_0x2814ad['ui']['view']['body'],function(_0x3ca19f){const _0x59d5c7=o(_0x3ca19f['config']['get']('ai.aiAssistant.commands'),_0x3ca19f['locale']),_0x1d1f68=U(_0x3ca19f,_0x59d5c7)['filter'](_0x389125=>_0x389125['commands']['length']);if(0x1===_0x1d1f68['length'])return U(_0x3ca19f,_0x1d1f68[0x0]['commands'])['map'](_0xff1ec4=>({'id':_0xff1ec4['id'],'label':_0xff1ec4['label']}));return _0x1d1f68['map'](_0x3810a1=>{const {groupId:_0x116f49,groupLabel:_0x1962d9,commands:_0x4851af}=_0x3810a1,_0x487ecb=U(_0x3ca19f,_0x4851af)['map'](_0x37cabc=>({'id':_0x37cabc['id'],'label':_0x37cabc['label']}));return{'id':_0x116f49,'menu':_0x1962d9||_0x116f49,'children':_0x487ecb};});}(_0x2814ad),{'ariaLabel':i(_0x2b3022,'AI\x20Commands')}),_0x397bb5['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x76647b['on']('change:enabledCommandsIds',_0x4322ad),_0x397bb5['menuView']['once']('render',_0x4322ad),_0x397bb5;function _0x4322ad(){_0x397bb5['isEnabled']=_0x76647b['enabledCommandsIds']['length']>0x0;for(const _0xd08ad9 of _0x397bb5['menuView']['buttons'])_0xd08ad9['isEnabled']=_0x76647b['enabledCommandsIds']['includes'](_0xd08ad9['id']);}}),_0x2814ad['ui']['componentFactory']['add']('menuBar:aiCommands',_0x221b22=>{const _0x16c52d=new _0x33647f(_0x221b22);_0x16c52d['buttonView']['set']({'label':i(_0x221b22,'AI\x20Commands'),'icon':_0x32b9cb}),_0x16c52d['bind']('isEnabled')['to'](_0x76647b,'enabledCommandsIds',_0xf71057=>_0xf71057['length']>0x0);const _0x44e85a=o(_0x2814ad['config']['get']('ai.aiAssistant.commands'),_0x221b22);return this['_populateMenuBarMenu'](_0x76647b,_0x16c52d,_0x44e85a,_0x138ef8=>this['_onExecute'](_0x138ef8)),_0x16c52d;}),_0x2814ad['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x13c637=this['_createAIAssistantUIButton'](_0x57a4a2);return _0x13c637['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x13c637;}),_0x2814ad['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x452446=this['_createAIAssistantUIButton'](_0x35221c);return _0x452446['set']({'role':'menuitemcheckbox'}),_0x452446;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2dfdcd=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2269c0;for(const _0x35e88d in _0x2dfdcd){const _0x3909e0=_0x35e88d,_0x1f5602=_0x2dfdcd[_0x3909e0];if('aiLicenseKeyValid'==_0x1f5602||'aiLicenseKeyInvalid'==_0x1f5602||'aiLicenseKeyExpired'==_0x1f5602||'aiLicenseKeyDomainLimit'==_0x1f5602||'aiLicenseKeyNotAllowed'==_0x1f5602||'aiLicenseKeyEvaluationLimit'==_0x1f5602||'aiLicenseKeyTrialLimit'==_0x1f5602||'aiLicenseKeyUsageLimit'==_0x1f5602){delete _0x2dfdcd[_0x3909e0],_0x2269c0=_0x1f5602,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2269c0&&_0x2dfdcd['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2269c0&&_0x2dfdcd['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2269c0&&_0x2dfdcd['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2269c0&&_0x2dfdcd['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2269c0&&_0x2dfdcd['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x2269c0&&_0x2dfdcd['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x2269c0&&_0x2dfdcd['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x16b11e='',_0x56ba28='',_0x3f7cf1='custom'){const _0x323c59=this['editor'],_0x2ccd16=_0x323c59['editing']['view'],_0x402d2a=_0x323c59['plugins']['get'](a),_0x3e03fa=_0x323c59['plugins']['get'](_0x15772c);_0x402d2a['showFakeVisualSelection']();const _0x2ed0d3=new l(),_0x115374=new ClipboardEvent('copy',{'clipboardData':_0x2ed0d3}),_0x2f121d=new _0x170372(_0x2ed0d3),_0x3efa4e=new _0x55c6ae(_0x2ccd16,_0x115374,{'dataTransfer':_0x2f121d});_0x3e03fa['_forceMarkersCopy']('comment',()=>{_0x2ccd16['document']['fire']('copy',_0x3efa4e);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x323c59,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x1f27c9=_0x2f121d['getData']('text/html');const _0x51fb07=_0x323c59['model']['document']['selection'],_0x5658cc=Array['from'](_0x51fb07['getRanges']());0x1===_0x5658cc['length']&&_0x5658cc[0x0]['isFlat']&&!_0x51fb07['getSelectedElement']()&&''!==_0x1f27c9['replace'](/ /g,'')['trim']()&&(_0x1f27c9='<p>'+_0x1f27c9+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x3f7cf1,'query':_0x16b11e,'htmlContent':_0x1f27c9,'label':_0x56ba28,'mainActionLabel':_[_0x323c59['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2479cb,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x593c3e['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x402d2a['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x399536=new Map(),_0x1974c4=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0xac3f5e of _0x1974c4)for(const _0xd8a978 of _0xac3f5e['commands'])_0x399536['set'](_0xd8a978['id'],{..._0xd8a978,'groupId':_0xac3f5e['groupId'],'groupLabel':_0xac3f5e['groupLabel']||_0xac3f5e['groupId']});return _0x399536;}['_createAIAssistantUIButton'](_0x501033){const _0x2f05e9=this['editor'],_0x1e5635=_0x2f05e9['commands']['get']('showAIAssistant'),_0x22ae75=new _0x501033(_0x2f05e9['locale']);return _0x22ae75['set']({'label':i(_0x2f05e9['locale'],'AI\x20Assistant'),'icon':_0x2479cb,'isToggleable':!0x0}),_0x22ae75['bind']('isEnabled')['to'](_0x1e5635),_0x22ae75['bind']('isOn')['to'](this['_dialog'],'id',_0x471c4e=>'aiAssistant'===_0x471c4e),this['listenTo'](_0x22ae75,'execute',()=>{_0x22ae75['isOn']?this['hideUI']():_0x1e5635['execute']();}),_0x22ae75;}['_initView'](){const _0x9b444f=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x9b444f['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x9b444f['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x572995,ui:{ariaLiveAnnouncer:_0x528264}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x54b652,_0x348627,_0x4c7616)=>{const _0xbeb04f=this['_aiAssistantController']['currentContext'];_0x4c7616?_0x528264['announce'](i(_0x572995,'AI\x20is\x20writing')):_0xbeb04f&&_0x528264['announce'](i(_0x572995,'Generated\x20content:\x20%0',_0xbeb04f),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x210431,_0x7cf59,_0x14902d)=>{if(_0x14902d){const _0x3dfbe2=this['_formView']['errorView']['text'];_0x528264['announce'](i(_0x572995,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3dfbe2));}});}['_onExecute'](_0xf6e252){const _0x46b603=this['_commandDefinitions']['get'](_0xf6e252),_0x5a3bd3=this['editor'],_0x24521d=_0x5a3bd3['model']['document']['selection'],_0x55c7ce=_0x5a3bd3['commands']['get']('showAIAssistant'),_0x288787=_0x5a3bd3['plugins']['get'](a),_0x439199=''+(_0x46b603['groupId']!==K?_0x46b603['groupLabel']+':\x20':'')+_0x46b603['label'];if(!0x1!==_0x46b603['requiresContent']&&_0x24521d['isCollapsed']){const _0x2799f5=_0x5c9d83(_0x24521d['getSelectedBlocks']())||_0x5a3bd3['model']['schema']['getLimitElement'](_0x24521d);_0x5a3bd3['model']['change'](_0x1c8fcd=>{_0x1c8fcd['setSelection'](_0x2799f5,'in');});}_0x288787['showFakeVisualSelection'](),_0x55c7ce['execute'](_0x46b603['prompt'],_0x439199,'command:'+_0xf6e252);}['_populateMenuBarMenu'](_0x168744,_0xd68e0e,_0x4c1908,_0x311b32){const _0x31cbf9=this['editor'],_0x48ddf6=_0x31cbf9['locale'],_0x371dfe=new _0x26de47(_0x48ddf6),_0x5b2f4c=U(_0x31cbf9,_0x4c1908)['filter'](_0x39cb2c=>_0x39cb2c['commands']['length']);0x1===_0x5b2f4c['length']?this['_getMenuBarGroupButtons']({'command':_0x168744,'commands':_0x5b2f4c[0x0]['commands'],'parentMenuView':_0xd68e0e,'onExecute':_0x311b32})['forEach'](_0x5ebc35=>_0x371dfe['items']['add'](_0x5ebc35)):_0x5b2f4c['forEach'](({groupId:_0x2a896c,groupLabel:_0x3ec5e1,commands:_0x110b6f})=>{const _0x3926cf=new _0x194be2(_0x48ddf6,_0xd68e0e),_0x5b0605=new _0x33647f(_0x48ddf6),_0x2f3bb8=new _0x26de47(_0x48ddf6),_0x21177f=this['_getMenuBarGroupButtons']({'command':_0x168744,'commands':_0x110b6f,'parentMenuView':_0x5b0605,'onExecute':_0x311b32});_0x5b0605['buttonView']['set']({'label':_0x3ec5e1||_0x2a896c}),_0x5b0605['delegate']('execute')['to'](_0xd68e0e),_0x2f3bb8['items']['addMany'](_0x21177f),_0x5b0605['panelView']['children']['add'](_0x2f3bb8),_0x3926cf['children']['add'](_0x5b0605),_0x371dfe['items']['add'](_0x3926cf);}),_0xd68e0e['panelView']['children']['add'](_0x371dfe);}['_getMenuBarGroupButtons']({command:_0x343642,commands:_0x1e5d32,parentMenuView:_0x444852,onExecute:_0x319e26}){const _0x1726ec=this['editor'],_0x45246e=_0x1726ec['locale'];return U(_0x1726ec,_0x1e5d32)['map'](_0x5fadc6=>{const _0x59fa1b=new _0x194be2(_0x45246e,_0x444852),_0x12afd3=new _0x35221c(_0x45246e);return _0x12afd3['set']({'label':_0x5fadc6['label']}),_0x12afd3['delegate']('execute')['to'](_0x444852),_0x12afd3['on']('execute',()=>_0x319e26(_0x5fadc6['id'])),_0x12afd3['bind']('isEnabled')['to'](_0x343642,'enabledCommandsIds',_0x5cb0a8=>_0x5cb0a8['includes'](_0x5fadc6['id'])),_0x59fa1b['children']['add'](_0x12afd3),_0x59fa1b;});}}function T(_0x217b63,_0x259ab2){return void 0x0!==_0x217b63['order']&&void 0x0===_0x259ab2['order']?0x1:void 0x0===_0x217b63['order']&&void 0x0!==_0x259ab2['order']?-0x1:void 0x0!==_0x217b63['order']&&void 0x0!==_0x259ab2['order']?_0x217b63['order']-_0x259ab2['order']:0x0;}function U(_0x727bf8,_0x2786a1){_0x2786a1['sort'](T);const _0x3337ed={},_0x487547=[];for(const _0x3f2185 of _0x2786a1)if(void 0x0!==_0x3f2185['order']){if(_0x3f2185['order']in _0x3337ed)throw new _0x1d1ad9('ai-commands-config-order-collision',_0x727bf8,{'conflictingDefinitions':[_0x3f2185,_0x3337ed[_0x3f2185['order']]]});_0x3337ed[_0x3f2185['order']]=_0x3f2185,_0x487547['splice'](_0x3f2185['order'],0x0,_0x3f2185);}else _0x487547['push'](_0x3f2185);return _0x487547;}class At extends _0x44e5f7{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x152a75){super(_0x152a75);const _0x1396cf=_0x152a75['config'],_0x6d4092=_0x152a75['locale'];_0x1396cf['define']('ai.aiAssistant.preserveComments',!0x0),_0x1396cf['define']('ai.aiAssistant.commands',_t(_0x6d4092)),_0x1396cf['define']('ai.aiAssistant.extraCommandGroups',[]),_0x1396cf['define']('ai.aiAssistant.removeCommands',[]);let _0x54181d=o(_0x1396cf['get']('ai.aiAssistant.commands'),_0x6d4092);const _0x43add0=_0x1396cf['get']('ai.aiAssistant.extraCommandGroups'),_0x195cff=_0x1396cf['get']('ai.aiAssistant.removeCommands');_0x43add0['forEach'](_0x38a598=>{const _0x23635f=_0x54181d['find'](_0x201ffd=>_0x201ffd['groupId']===_0x38a598['groupId']);_0x23635f?_0x23635f['commands']=_0x23635f['commands']['concat'](_0x38a598['commands']):_0x54181d['push'](_0x38a598);}),_0x54181d=_0x54181d['filter'](_0x3599a8=>!_0x195cff['includes'](_0x3599a8['groupId'])),_0x54181d['forEach'](_0x3e7e55=>{_0x3e7e55['commands']=_0x3e7e55['commands']['filter'](_0x543c28=>!_0x195cff['includes'](_0x543c28['id']));}),_0x1396cf['set']('ai.aiAssistant.commands',_0x54181d);}}function _t(_0x36d846){return[{'groupId':'editOrReview','groupLabel':i(_0x36d846,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x36d846,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x36d846,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':i(_0x36d846,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x36d846,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':i(_0x36d846,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x36d846,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':i(_0x36d846,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':i(_0x36d846,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x36d846,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x36d846,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x36d846,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x36d846,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x36d846,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x36d846,'Change\x20style'),'commands':[{'id':'business','label':i(_0x36d846,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x36d846,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x36d846,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x36d846,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x36d846,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x36d846,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x36d846,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x36d846,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x36d846,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x36d846,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x36d846,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x36d846,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x36d846,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x44e5f7{['abortController'];static get['requires'](){return[x];}constructor(_0x5c5bc0){super(_0x5c5bc0),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0xd3f0b9){return this['sendRequest'](_0xd3f0b9)['catch'](_0x3e6d2a=>{if(_0x3e6d2a instanceof R)return Promise['reject'](_0x3e6d2a);if('AbortError'==_0x3e6d2a['name'])return Promise['resolve']();throw console['error'](_0x3e6d2a),new _0x1d1ad9('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x43fa55,_0x30ab5e){const _0x3effa1=this['editor']['locale'],_0x295f46={'Content-Type':'application/json'};if('object'==typeof _0x43fa55)Object['assign'](_0x295f46,_0x43fa55);else{if(_0x43fa55)try{const _0x18c2b4=await _0x43fa55(_0x30ab5e);Object['assign'](_0x295f46,_0x18c2b4);}catch{return Promise['reject'](new R(i(_0x3effa1,'AI_ERROR_GET_HEADERS')));}}return _0x295f46;}async['_prepareRequestParameters'](_0x541f42,_0x1168bf){const _0x358501=this['editor']['locale'];if('object'==typeof _0x541f42)return _0x541f42;try{return await _0x541f42(_0x1168bf);}catch{return Promise['reject'](new R(i(_0x358501,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4173a3){super(_0x4173a3),_0x4173a3['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4173a3['config']['get']('ai.openAI.requestParameters')||_0x4173a3['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4173a3['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x4173a3['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x4173a3['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x20dba1,context:_0x4289ff,onData:_0x43ab54,actionId:_0x5651f3}){const _0x56026e=this['editor']['locale'],_0x4572c1=await this['prepareMessages'](_0x20dba1,_0x4289ff,_0x5651f3),_0x490c87=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5651f3),_0x55caa1=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5651f3),_0x451e38={'messages':_0x4572c1,..._0x55caa1},_0x51db43={'method':'POST','headers':_0x490c87,'body':JSON['stringify'](_0x451e38),'signal':this['abortController']['signal']},_0x245872=await fetch(this['_apiUrl'],_0x51db43);if(_0x245872['ok'])return _0x55caa1['stream']?await this['_readStreamableResponse'](_0x245872,_0x43ab54):await this['_readStaticResponse'](_0x245872,_0x43ab54),Promise['resolve']();{const _0x36b76e=await _0x245872['text']();return _0x36b76e['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x56026e,'AI_ERROR_CONTEXT_LENGTH'))):_0x36b76e['includes']('Moderation')?Promise['reject'](new R(i(_0x56026e,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x36b76e));}}async['prepareMessages'](_0x48fc9d,_0x41bcd2,_0x1a87e0){let _0x5481dc,_0x17863c;return _0x41bcd2?(_0x5481dc='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x17863c='Instruction:\x0a'+_0x48fc9d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x41bcd2):(_0x5481dc='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x17863c=_0x48fc9d),[{'role':'system','content':_0x5481dc},{'role':'user','content':_0x17863c}];}async['_readStreamableResponse'](_0x4101ec,_0x4bd1c0){const _0x71b6db=_0x4101ec['body']['getReader'](),_0x5409d3=new TextDecoder();let _0x54dd74='',_0x54754d='',_0x37b21e='',_0x17f002=!0x1;for(;!_0x17f002;){const {done:_0x242db7,value:_0x3015a1}=await _0x71b6db['read'](),_0x3ddbb6=_0x54dd74+_0x5409d3['decode'](_0x3015a1);let _0x344337='';_0x17f002=_0x242db7;try{_0x344337=this['_cleanUpData'](_0x3ddbb6),_0x54dd74='';}catch{_0x54dd74=_0x3ddbb6;continue;}_0x54754d+=_0x344337,!_0x17f002&&this['_isBufferIncomplete'](_0x54754d)||_0x54754d&&(_0x37b21e+=_0x54754d,_0x54754d='',_0x4bd1c0(_0x37b21e));}return Promise['resolve']();}async['_readStaticResponse'](_0x6143d6,_0x87e44e){return _0x87e44e((await _0x6143d6['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x328c26){const _0xaf6751=_0x328c26['split']('<')['length']!==_0x328c26['split']('>')['length'],_0x55a08e=_0x328c26['length']<0x1e;return _0xaf6751&&_0x55a08e;}['_cleanUpData'](_0x3760d4){return _0x3760d4['split'](/\n(?![^{]*\})/g)['map'](_0x48c4bf=>_0x48c4bf['replace']('data:\x20',''))['filter'](_0x3c2a40=>_0x3c2a40&&_0x3c2a40['length']>0x0&&'[DONE]'!==_0x3c2a40)['map'](_0x5f0e27=>{const {choices:_0x74c404}=JSON['parse'](_0x5f0e27);if(_0x74c404[0x0]?.['delta']?.['content'])return _0x74c404[0x0]['delta']['content'];})['filter'](_0x5642b1=>_0x5642b1)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x77979e){super(_0x77979e),_0x77979e['config']['get']('ai.aws.requestParameters')||_0x77979e['config']['define']('ai.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x77979e['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x77979e['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x77979e['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x77979e['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x4c1d77,context:_0x2d15cf,onData:_0x410f02,actionId:_0x3e0c80}){const {model:_0x73d856,stream:_0x400761,..._0x41ecd1}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3e0c80),_0x3d6858={'prompt':await this['preparePrompt'](_0x4c1d77,_0x2d15cf,_0x73d856,_0x3e0c80),..._0x41ecd1};this['_apiUrl']?await this['_processProxyRequest'](_0x3d6858,_0x73d856,_0x400761,_0x410f02,_0x3e0c80):await this['_processAWSRequest'](_0x3d6858,_0x73d856,_0x400761,_0x410f02);}async['preparePrompt'](_0x35dcc5,_0x47bcdc,_0x108729,_0x43ca9b){let _0xeb51da,_0x14e37d;return _0x47bcdc?(_0xeb51da='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x14e37d='Instruction:\x0a'+_0x35dcc5+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x47bcdc):(_0xeb51da='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x14e37d=_0x35dcc5),'meta.llama'==this['getModelFamily'](_0x108729)?'<<SYS>>\x0a'+_0xeb51da+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x14e37d+'\x0a[/INST]':'Human:\x0a'+_0xeb51da+'\x0a'+_0x14e37d+'\x0a\x0aAssistant:';}['getModelFamily'](_0x30bc3d){if(/^anthropic\.claude/['test'](_0x30bc3d))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x30bc3d))return'ai21.j2';if(/^cohere\.command/['test'](_0x30bc3d))return'cohere.command';if(/^meta\.llama/['test'](_0x30bc3d))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x30bc3d));}async['_processProxyRequest'](_0x40ddbf,_0x1d7100,_0x4a8ef5,_0x2b424b,_0x470192){const _0x5d5ff2={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x470192),'body':JSON['stringify']({..._0x40ddbf,'model':_0x1d7100,'stream':_0x4a8ef5}),'signal':this['abortController']['signal']},_0x1eac67=await fetch(this['_apiUrl'],_0x5d5ff2);_0x4a8ef5?await this['_readStreamableResponse'](_0x1eac67,_0x1d7100,_0x2b424b):await this['_readStaticResponse'](_0x1eac67,_0x1d7100,_0x2b424b);}async['_processAWSRequest'](_0x27847d,_0x381516,_0x2a96ef,_0x5e8ca0){const _0x24ba79=new _0x534bf0(this['_bedrockClientConfig']),_0x516067={'body':JSON['stringify'](_0x27847d),'contentType':'application/json','accept':'application/json','modelId':_0x381516};let _0x5c558d;if(_0x2a96ef){const _0x213044=new _0x203508(_0x516067);_0x5c558d=await _0x24ba79['send'](_0x213044,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x5c558d,_0x381516,_0x5e8ca0);}else{const _0x3c0eb0=new _0x36c6ee(_0x516067);_0x5c558d=await _0x24ba79['send'](_0x3c0eb0,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x5c558d,_0x381516,_0x5e8ca0);}}async['_readAsyncIterableResponse'](_0x142d92,_0x3aa0ed,_0x41a08a){const _0x24d06e=_0x142d92['body'],_0x2490a7=new TextDecoder('utf-8');let _0x567e29='';for await(const _0x1e830b of _0x24d06e)if(_0x1e830b['chunk']){const _0x45b4c5=_0x2490a7['decode'](_0x1e830b['chunk']['bytes']),_0x4c1f26=JSON['parse'](_0x45b4c5);_0x567e29+=this['_getGeneratedText'](_0x4c1f26,_0x3aa0ed),_0x41a08a(_0x567e29);}return Promise['resolve']();}async['_readStreamableResponse'](_0xc9219f,_0x1e96f9,_0x12e226){const _0x3a6fa1=_0xc9219f['body'],_0x120dac=new TextDecoder('utf-8'),_0x1450e0=_0x3a6fa1['getReader']();let _0x230dea='',_0x2d3d74='',_0x4dbe3e=!0x1;for(;!_0x4dbe3e;){const {done:_0x1f21f5,value:_0x5d03d9}=await _0x1450e0['read']();if(_0x4dbe3e=_0x1f21f5,_0x4dbe3e)break;const _0x4e7169=(_0x230dea+_0x120dac['decode'](_0x5d03d9))['split']('\x0a')['map'](_0x2a60ed=>{try{return _0x230dea='',JSON['parse'](_0x2a60ed);}catch{return _0x230dea=_0x2a60ed,null;}})['filter'](_0x3f25df=>null!==_0x3f25df);_0x4e7169['length']&&(_0x2d3d74+=_0x4e7169['map'](_0x245bd7=>this['_getGeneratedText'](_0x245bd7,_0x1e96f9))['join'](''),_0x12e226(_0x2d3d74));}return Promise['resolve']();}async['_readStaticResponse'](_0x54146b,_0x32b2e6,_0x2bd140){let _0x332c90;return _0x332c90=_0x54146b instanceof Response?await _0x54146b['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x54146b['body'])),(_0x2bd140(this['_getGeneratedText'](_0x332c90,_0x32b2e6)),Promise['resolve']());}['_getGeneratedText'](_0x4cd8a6,_0x3ac22a){switch(this['getModelFamily'](_0x3ac22a)){case'anthropic.claude':return _0x4cd8a6['completion'];case'ai21.j2':return _0x4cd8a6['completions'][0x0]['data']['text'];case'cohere.command':return _0x4cd8a6['generations'][0x0]['text'];case'meta.llama':return _0x4cd8a6['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x79df7f,Command as _0x57e141}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x18e128,IconCheck as _0x1a8284,IconError as _0x5d6f38,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x1c8c09,IconRobotPencil as _0x4e7f8e}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x43c569,CKEditorError as _0x31f53a,ObservableMixin as _0x1a04e9,global as _0x38d498,isVisible as _0x2a8359,Rect as _0x8cd30b,Collection as _0x2197ad,FocusTracker as et,KeystrokeHandler as rt,first as _0x5d1380}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x243c46,View as _0x315dd6,SpinnerView as _0x57ab1b,IconView as _0x173f5c,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x14799d,createDropdown as _0x445275,addMenuToDropdown as _0x3532bf,MenuBarMenuView as _0x58da05,MenuBarMenuListItemButtonView as _0x1d8a4f,DialogViewPosition as _0x5e961b,MenuBarMenuListView as _0x56611d,MenuBarMenuListItemView as _0x35a1dc}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x278642,ClipboardMarkersUtils as _0x5f161a}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x56d237,ViewDataTransfer as _0x1e5433,ViewUpcastWriter as _0x146d0d,Matcher as _0x4873a8}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x2c193d,InvokeModelWithResponseStreamCommand as _0x47d31f,InvokeModelCommand as _0x2ac079}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x3c8318,_0x37fae0){const _0xe5738b=(0x0,_0x37fae0['t'])('Other');return _0x3c8318['length']?'groupId'in _0x3c8318[0x0]?_0x3c8318:[{'groupId':K,'groupLabel':_0xe5738b,'order':0x1/0x0,'commands':_0x3c8318}]:[{'groupId':K,'groupLabel':_0xe5738b,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x79df7f{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x3b8239}=this,_0x2e99ba=['ck-fake-ai-selection'];_0x3b8239['config']['get']('ai.useTheme')&&_0x2e99ba['push']('ck-ai-assistant-ui_theme'),_0x3b8239['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x2e99ba,'priority':0xc}}),_0x3b8239['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x386f3e,{writer:_0x3b47fd})=>{if(!_0x386f3e['markerRange']['isCollapsed'])return null;const _0xa518da=_0x3b47fd['createUIElement']('span');return _0x3b47fd['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0xa518da),_0xa518da;}});}['afterInit'](){!async function(_0x259002){const _0x4d0fc4=_0x5805e1([0x7a,0x62,0x36,0x31,0x46,0x4d,0x49,0x42,0x32,0x67,0x41,0x59,0x6c,0x39,0x37,0x51,0x72,0x35,0x44,0x70,0x6b,0x6a,0x56,0x4e,0x6d,0x6e,0x38,0x75,0x63,0x34,0x6f,0x77,0x64,0x68,0x45,0x58,0x73,0x33,0x78,0x54,0x30,0x53,0x4a,0x52,0x74,0x4b,0x71,0x50,0x65,0x79,0x5a,0x55,0x57,0x61,0x43,0x47,0x66,0x4f,0x76,0x48,0x4c,0x69]),_0x386fc9=0x155df333,_0x172081=0x155a9cfb^_0x386fc9,_0x50febe=window[_0x5805e1([0x44,0x61,0x74,0x65])][_0x5805e1([0x6e,0x6f,0x77])](),_0x697a88=_0x259002[_0x5805e1([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x58726a=new window[(_0x5805e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2c688a=>{_0x697a88[_0x5805e1([0x6f,0x6e,0x63,0x65])](_0x5805e1([0x72,0x65,0x61,0x64,0x79]),_0x2c688a);}),_0x499b95={[_0x5805e1([0x6b,0x74,0x79])]:_0x5805e1([0x45,0x43]),[_0x5805e1([0x75,0x73,0x65])]:_0x5805e1([0x73,0x69,0x67]),[_0x5805e1([0x63,0x72,0x76])]:_0x5805e1([0x50,0x2d,0x32,0x35,0x36]),[_0x5805e1([0x78])]:_0x5805e1([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x5805e1([0x79])]:_0x5805e1([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x5805e1([0x61,0x6c,0x67])]:_0x5805e1([0x45,0x53,0x32,0x35,0x36])},_0x5c15c7=_0x697a88[_0x5805e1([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x5805e1([0x67,0x65,0x74])](_0x5805e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x3cc183(){let _0x157f07,_0x2e7447=null,_0x448ef9=null;try{if(_0x5c15c7==_0x5805e1([0x47,0x50,0x4c]))return _0x5805e1([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x157f07=_0x39f69a(),!_0x157f07)return _0x5805e1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x157f07[_0x5805e1([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x448ef9=_0xa15d(_0x157f07[_0x5805e1([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x157f07[_0x5805e1([0x6a,0x74,0x69])])),await _0x4bb1ac()?_0x333837()?_0x149622()?_0x5805e1([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1ffb27()?(_0x157f07[_0x5805e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5805e1([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2e7447=_0x5a43cc(_0x5805e1([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x157f07[_0x5805e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5805e1([0x74,0x72,0x69,0x61,0x6c])&&(_0x2e7447=_0x5a43cc(_0x5805e1([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x54e5bd()):_0x5805e1([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x5805e1([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x5805e1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x5805e1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x149622(){const _0x2d9958=[_0x5805e1([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x5805e1([0x74,0x72,0x69,0x61,0x6c])][_0x5805e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x157f07[_0x5805e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x50febe/0x3e8:0xe10*_0x172081;return _0x157f07[_0x5805e1([0x65,0x78,0x70])]<_0x2d9958;}function _0x333837(){const _0x5b0d45=_0x157f07[_0x5805e1([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x5b0d45&&(!!_0x5b0d45[_0x5805e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5805e1([0x2a]))||!!_0x5b0d45[_0x5805e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5805e1([0x41,0x49])));}function _0x1ffb27(){const _0x15afe2=_0x157f07[_0x5805e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x15afe2||0x0==_0x15afe2[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x5160fc}=new URL(window[_0x5805e1([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x15afe2[_0x5805e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5160fc))return!0x0;const _0x5d6e11=_0x5160fc[_0x5805e1([0x73,0x70,0x6c,0x69,0x74])](_0x5805e1([0x2e]));return _0x15afe2[_0x5805e1([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5e6625=>_0x5e6625[_0x5805e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5805e1([0x2a])))[_0x5805e1([0x6d,0x61,0x70])](_0x91d38e=>_0x91d38e[_0x5805e1([0x73,0x70,0x6c,0x69,0x74])](_0x5805e1([0x2e])))[_0x5805e1([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x246556=>_0x246556[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5d6e11[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5805e1([0x6d,0x61,0x70])](_0x21f2a8=>Array(_0x5d6e11[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x21f2a8[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5805e1([0x66,0x69,0x6c,0x6c])](_0x21f2a8[0x0]===_0x5805e1([0x2a])?_0x5805e1([0x2a]):'')[_0x5805e1([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x21f2a8))[_0x5805e1([0x73,0x6f,0x6d,0x65])](_0x48b430=>_0x5d6e11[_0x5805e1([0x65,0x76,0x65,0x72,0x79])]((_0x1389f8,_0x1904fe)=>_0x48b430[_0x1904fe]===_0x1389f8||_0x48b430[_0x1904fe]===_0x5805e1([0x2a])));}function _0x54e5bd(){return _0x2e7447&&_0x448ef9?new window[(_0x5805e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xc1af0d,_0x332da8)=>{_0x2e7447[_0x5805e1([0x74,0x68,0x65,0x6e])](_0xc1af0d,_0x332da8),_0x448ef9[_0x5805e1([0x74,0x68,0x65,0x6e])](_0xe42b78=>{_0xe42b78!=_0x5805e1([0x56,0x61,0x6c,0x69,0x64])&&_0xc1af0d(_0xe42b78);},_0x332da8);}):_0x2e7447||_0x448ef9||_0x5805e1([0x56,0x61,0x6c,0x69,0x64]);}}function _0xa15d(_0x12bf71,_0x349b86){return new window[(_0x5805e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x222e9e=>{if(_0x262a05())return _0x222e9e(_0x5805e1([0x56,0x61,0x6c,0x69,0x64]));_0x1bd7a2(),_0x697a88[_0x5805e1([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x5805e1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x262e4d=!0x1;const _0x32915d=_0x43c569();function _0x395329(_0x37c45a){return!!_0x37c45a&&(typeof _0x37c45a===_0x5805e1([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x37c45a===_0x5805e1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x37c45a[_0x5805e1([0x74,0x68,0x65,0x6e])]===_0x5805e1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x37c45a[_0x5805e1([0x63,0x61,0x74,0x63,0x68])]===_0x5805e1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x3184bd(_0x1e74ec){_0x1bf211(_0x1e74ec)[_0x5805e1([0x74,0x68,0x65,0x6e])](_0x3c9157=>{if(!_0x3c9157||_0x3c9157[_0x5805e1([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x5805e1([0x6f,0x6b]))return _0x5805e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x41850f(_0x516eaa(_0x32915d+_0x349b86))!=_0x3c9157[_0x5805e1([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x5805e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x5805e1([0x56,0x61,0x6c,0x69,0x64]);})[_0x5805e1([0x74,0x68,0x65,0x6e])](_0x125865=>(_0x381090(),_0x125865),()=>{const _0x4b4076=_0x34075f();return null==_0x4b4076?(_0x381090(),_0x5805e1([0x56,0x61,0x6c,0x69,0x64])):_0x5805e1(_0x50febe-_0x4b4076>(0x31517733^_0x386fc9)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x5805e1([0x74,0x68,0x65,0x6e])](_0x222e9e)[_0x5805e1([0x63,0x61,0x74,0x63,0x68])](()=>{_0x222e9e(_0x5805e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x17b05f=0x156b1db3^_0x386fc9;function _0x381090(){const _0x5bb3ef=_0x5805e1([0x6c,0x6c,0x63,0x74,0x2d])+_0x41850f(_0x516eaa(_0x12bf71)),_0x804906=_0x1ec095(_0x41850f(window[_0x5805e1([0x4d,0x61,0x74,0x68])][_0x5805e1([0x63,0x65,0x69,0x6c])](_0x50febe/_0x17b05f)));window[_0x5805e1([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5805e1([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5bb3ef,_0x804906);}function _0x34075f(){const _0xb0d064=_0x5805e1([0x6c,0x6c,0x63,0x74,0x2d])+_0x41850f(_0x516eaa(_0x12bf71)),_0x2670ad=window[_0x5805e1([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5805e1([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xb0d064);return _0x2670ad?window[_0x5805e1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1ec095(_0x2670ad),0x10)*_0x17b05f:null;}function _0x1bf211(_0x224f50){return new window[(_0x5805e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x15b57d,_0x3dadae)=>{_0x224f50[_0x5805e1([0x74,0x68,0x65,0x6e])](_0x15b57d,_0x3dadae),window[_0x5805e1([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3dadae,0x155c27f3^_0x386fc9);});}}_0x697a88[_0x5805e1([0x6f,0x6e])](_0x5805e1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1a34e1,_0x420393)=>{if(_0x420393[0x0]!=_0x12bf71)return _0x222e9e(_0x5805e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x420393[0x1]={..._0x420393[0x1],[_0x5805e1([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x32915d};},{[_0x5805e1([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5805e1([0x68,0x69,0x67,0x68])}),_0x697a88[_0x5805e1([0x6f,0x6e])](_0x5805e1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x5f2a92=>{_0x395329(_0x5f2a92[_0x5805e1([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x262e4d=!0x0,_0x3184bd(_0x5f2a92[_0x5805e1([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x5805e1([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5805e1([0x6c,0x6f,0x77])}),_0x58726a[_0x5805e1([0x74,0x68,0x65,0x6e])](()=>{_0x262e4d||_0x222e9e(_0x5805e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x262a05(){return _0x697a88[_0x5805e1([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5805e1([0x76,0x69,0x65,0x77])][_0x5805e1([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x5805e1([0x61,0x75,0x74,0x6f]);}function _0x1bd7a2(){_0x697a88[_0x5805e1([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5805e1([0x76,0x69,0x65,0x77])][_0x5805e1([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x5805e1([0x61,0x75,0x74,0x6f]);}}function _0x5a43cc(_0x277cdb){const _0x3d31a9=[new window[(_0x5805e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1fd4d7=>setTimeout(_0x1fd4d7,0x1554cdff^_0x386fc9)),_0x58726a[_0x5805e1([0x74,0x68,0x65,0x6e])](()=>new window[(_0x5805e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2ac1d1=>{let _0x42a02d=0x0;_0x697a88[_0x5805e1([0x6d,0x6f,0x64,0x65,0x6c])][_0x5805e1([0x6f,0x6e])](_0x5805e1([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xc3b445,_0x1510af)=>{_0x1510af[0x0][_0x5805e1([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x42a02d++,_0x42a02d==(0x155df2cb^_0x386fc9)&&(_0x2ac1d1(),_0xc3b445[_0x5805e1([0x6f,0x66,0x66])]());});}))];return window[_0x5805e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x5805e1([0x72,0x61,0x63,0x65])](_0x3d31a9)[_0x5805e1([0x74,0x68,0x65,0x6e])](()=>_0x277cdb);}async function _0x297db7(){await _0x58726a,_0x697a88[_0x5805e1([0x6d,0x6f,0x64,0x65,0x6c])][_0x5805e1([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x4fa75a,_0x697a88[_0x5805e1([0x6d,0x6f,0x64,0x65,0x6c])][_0x5805e1([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x4fa75a,_0x697a88[_0x5805e1([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x5805e1([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x1822f0(_0x4c32fd){const _0x7f071=_0x5dd34a();_0x697a88[_0x7f071]=_0x5805e1([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x4c32fd,_0x4c32fd!=_0x5805e1([0x56,0x61,0x6c,0x69,0x64])&&_0x297db7();}function _0x5dd34a(){const _0x5ee210=window[_0x5805e1([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x5805e1([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x5805e1([0x6e,0x6f,0x77])]())[_0x5805e1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x5805e1([0x2e]),'');let _0x1e86cb=_0x5805e1([0x7a]);for(let _0x559053=0x0;_0x559053<_0x5ee210[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x559053+=0x2){let _0x3cc373=window[_0x5805e1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5ee210[_0x5805e1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x559053,_0x559053+0x2));_0x3cc373>=_0x4d0fc4[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3cc373-=_0x4d0fc4[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1e86cb+=_0x4d0fc4[_0x3cc373];}return _0x1e86cb;}function _0x39f69a(){const _0x15a7a1=_0x5c15c7[_0x5805e1([0x73,0x70,0x6c,0x69,0x74])](_0x5805e1([0x2e]));if(0x3!=_0x15a7a1[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xefbe57(_0x15a7a1[0x1]);function _0xefbe57(_0x237e55){const _0x45cf6c=_0x13e640(_0x237e55);return _0x45cf6c&&_0x27362c()?_0x45cf6c:null;function _0x27362c(){const _0x2c7299=_0x45cf6c[_0x5805e1([0x6a,0x74,0x69])],_0x40f8a0=window[_0x5805e1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2c7299[_0x5805e1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2c7299[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0xcc3f11={..._0x45cf6c,[_0x5805e1([0x6a,0x74,0x69])]:_0x2c7299[_0x5805e1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2c7299[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0xcc3f11[_0x5805e1([0x76,0x63])],_0x516eaa(_0xcc3f11)==_0x40f8a0;}}}async function _0x4bb1ac(){let _0x56376c=!0x0;try{const _0x1b9ec5=_0x5c15c7[_0x5805e1([0x73,0x70,0x6c,0x69,0x74])](_0x5805e1([0x2e])),[_0xd6f7cf,_0x32aff4,_0x330084]=_0x1b9ec5;return _0x7c99d5(_0xd6f7cf),await _0x271c2b(_0xd6f7cf,_0x32aff4,_0x330084),_0x56376c;}catch{return!0x1;}function _0x7c99d5(_0x1bee29){const _0x233367=_0x13e640(_0x1bee29);_0x233367&&_0x233367[_0x5805e1([0x61,0x6c,0x67])]==_0x5805e1([0x45,0x53,0x32,0x35,0x36])||(_0x56376c=!0x1);}async function _0x271c2b(_0x3e045b,_0x251a68,_0x1d6226){const _0x14cf1f=window[_0x5805e1([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x5805e1([0x66,0x72,0x6f,0x6d])](_0x32fef6(_0x1d6226),_0x4721d1=>_0x4721d1[_0x5805e1([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x18d68f=new window[(_0x5805e1([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x5805e1([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3e045b+_0x5805e1([0x2e])+_0x251a68),_0x2856ee=window[_0x5805e1([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x5805e1([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2856ee)return;const _0x2d215e=await _0x2856ee[_0x5805e1([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x5805e1([0x6a,0x77,0x6b]),_0x499b95,{[_0x5805e1([0x6e,0x61,0x6d,0x65])]:_0x5805e1([0x45,0x43,0x44,0x53,0x41]),[_0x5805e1([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x5805e1([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x5805e1([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2856ee[_0x5805e1([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x5805e1([0x6e,0x61,0x6d,0x65])]:_0x5805e1([0x45,0x43,0x44,0x53,0x41]),[_0x5805e1([0x68,0x61,0x73,0x68])]:{[_0x5805e1([0x6e,0x61,0x6d,0x65])]:_0x5805e1([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2d215e,_0x14cf1f,_0x18d68f)||(_0x56376c=!0x1);}}function _0x13e640(_0xbab1d9){return _0xbab1d9[_0x5805e1([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x5805e1([0x65,0x79]))?JSON[_0x5805e1([0x70,0x61,0x72,0x73,0x65])](_0x32fef6(_0xbab1d9)):null;}function _0x32fef6(_0x895ac){return window[_0x5805e1([0x61,0x74,0x6f,0x62])](_0x895ac[_0x5805e1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x5805e1([0x2b]))[_0x5805e1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x5805e1([0x2f])));}function _0x516eaa(_0xc5983a){let _0x39107f=0x1505;function _0x284714(_0x823ce0){for(let _0x4f57e6=0x0;_0x4f57e6<_0x823ce0[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4f57e6++){const _0x39a1a9=_0x823ce0[_0x5805e1([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4f57e6);_0x39107f=(_0x39107f<<0x5)+_0x39107f+_0x39a1a9,_0x39107f&=_0x39107f;}}function _0x66623a(_0x592022){Array[_0x5805e1([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x592022)?_0x592022[_0x5805e1([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x66623a):_0x592022&&typeof _0x592022==_0x5805e1([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x5805e1([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x592022)[_0x5805e1([0x73,0x6f,0x72,0x74])]()[_0x5805e1([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4f60c0,_0x17b69e])=>{_0x284714(_0x4f60c0),_0x66623a(_0x17b69e);}):_0x284714(window[_0x5805e1([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x592022));}return _0x66623a(_0xc5983a),_0x39107f>>>0x0;}function _0x41850f(_0xb20e91){return _0xb20e91[_0x5805e1([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x5805e1([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x5805e1([0x30]));}function _0x1ec095(_0x422fa6){return _0x422fa6[_0x5805e1([0x73,0x70,0x6c,0x69,0x74])]('')[_0x5805e1([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x5805e1([0x6a,0x6f,0x69,0x6e])]('');}function _0x4fa75a(){}function _0x5805e1(_0x37793e){return _0x37793e['map'](_0x430fe0=>String['fromCharCode'](_0x430fe0))['join']('');}_0x1822f0(await _0x3cc183());}(this);}['showFakeVisualSelection'](){const _0x91367c=this['editor']['model'];_0x91367c['change'](_0x125a80=>{const _0x16dc54=_0x91367c['document']['selection']['getRanges']();let _0xd294f=0x0;for(const _0x25ab79 of _0x16dc54){const _0x5c07d5=w+':'+_0xd294f;if(_0x91367c['markers']['has'](_0x5c07d5))_0x125a80['updateMarker'](_0x5c07d5,{'range':_0x25ab79});else{if(_0x25ab79['start']['isAtEnd']){const _0x1857d1=_0x25ab79['start']['getLastMatchingPosition'](({item:_0x242ec4})=>!_0x91367c['schema']['isContent'](_0x242ec4),{'boundaries':_0x25ab79});_0x125a80['addMarker'](_0x5c07d5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x125a80['createRange'](_0x1857d1,_0x25ab79['end'])});}else _0x125a80['addMarker'](_0x5c07d5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x25ab79});}_0xd294f++;}});}['hideFakeVisualSelection'](){const _0x34eb9c=this['editor']['model'],_0x338210=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x338210['length']&&_0x34eb9c['change'](_0x229cde=>{_0x338210['forEach'](_0x4517dd=>{_0x229cde['removeMarker'](_0x4517dd);});});}['insertContent'](_0x709be1,_0x2845a7){const _0x39a85d=this['_getAISelection'](),_0x10bbbf=_0x2845a7||_0x39a85d['getFirstRange']();this['editor']['model']['canEditAt'](_0x10bbbf)&&this['editor']['model']['change'](_0x2a6599=>{this['hideFakeVisualSelection'](),_0x2845a7||this['_resetContentOfSelectedTableCells'](_0x2a6599,_0x39a85d),this['_pasteHTMLUsingClipboard']({'insertAt':_0x10bbbf,'writer':_0x2a6599,'html':_0x709be1});});}['insertContentBelow'](_0x19b3d9){const {model:_0x54f8a0}=this['editor'],_0x49f3df=this['_getAISelection']();_0x54f8a0['change'](()=>{const _0x106dc2=this['_prepareTableInsertBelowPosition'](_0x19b3d9,_0x49f3df)||this['_getDefaultInsertBelowPosition'](_0x49f3df);this['insertContent'](_0x19b3d9,_0x106dc2);});}['_getAISelection'](){const _0x1c23ee=this['editor']['model'],_0x4f0b15=Array['from'](_0x1c23ee['markers']['getMarkersGroup'](w))['map'](_0x22c882=>_0x22c882['getRange']());return _0x1c23ee['createSelection'](_0x4f0b15);}['_pasteHTMLUsingClipboard']({writer:_0x40778a,html:_0x49340e,insertAt:_0x46f8bd}){const {view:_0x2337ef}=this['editor']['editing'],_0x6ffef6=this['editor']['plugins']['get'](_0x278642),_0x3739f5=new gt();_0x3739f5['setData']('text/html',_0x49340e);const _0xfddf7e=new ClipboardEvent('paste',{'clipboardData':_0x3739f5}),_0xb4c310=new _0x56d237(_0x2337ef,_0xfddf7e,{'dataTransfer':new _0x1e5433(_0x3739f5)});_0x40778a['setSelection'](_0x46f8bd);const _0x439300=(_0x4d343f,_0x18712c)=>{_0x18712c['resultRange']&&_0x40778a['setSelection'](_0x18712c['resultRange']);};_0x6ffef6['once']('contentInsertion',_0x439300,{'priority':'lowest'}),_0x2337ef['document']['fire']('paste',_0xb4c310),_0x6ffef6['off']('contentInsertion',_0x439300);}['_getDefaultInsertBelowPosition'](_0x5e6897){const {model:_0x229eec}=this['editor'],_0x4b375c=Array['from'](_0x5e6897['getSelectedBlocks']());return _0x4b375c['length']?_0x229eec['createPositionAfter'](_0x4b375c['pop']()):_0x5e6897['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3b8909,_0x2c34bf){const {model:_0x483491,plugins:_0x1b76cc}=this['editor'];if(_0x1b76cc['has']('TableUtils')){const _0x33934f=_0x1b76cc['get']('TableUtils')['getSelectedTableCells'](_0x2c34bf);if(_0x33934f['length']){const _0x5828a1=this['_getTableRowCountFromContent'](_0x3b8909),_0x21f890=this['_createEmptyTableRows'](_0x33934f,_0x5828a1);return _0x483491['createPositionAt'](_0x21f890,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1a5a09){const _0x51f573=this['editor']['plugins']['get']('TableUtils'),_0xf8f87=this['editor']['data']['parse'](_0x1a5a09),_0x3772c9=Array['from'](_0xf8f87['getChildren']())['filter'](_0x3d7ae4=>_0x3d7ae4['is']('element','table'));let _0x56a65e=0x0;return _0x3772c9['forEach'](_0x596f7b=>{_0x56a65e+=_0x51f573['getRows'](_0x596f7b);}),_0x56a65e;}['_createEmptyTableRows'](_0x2f45ec,_0x26a03b){const _0x4dd2be=this['editor']['plugins']['get']('TableUtils'),_0x6e4914=_0x4dd2be['getRowIndexes'](_0x2f45ec),_0x51b50c=_0x4dd2be['getColumnIndexes'](_0x2f45ec),_0x2ee861=_0x6e4914['last']+0x1,_0x9dcecd=_0x51b50c['first'],_0x4047d2=_0x2f45ec[0x0]['findAncestor']('table');for(let _0x196ec5=0x0;_0x196ec5<_0x26a03b;_0x196ec5++)_0x4dd2be['insertRows'](_0x4047d2,{'at':_0x2ee861});return _0x4047d2['getChild'](_0x2ee861)['getChild'](_0x9dcecd);}['_resetContentOfSelectedTableCells'](_0x1a31f5,_0xb75946){const {plugins:_0x1dfbcd}=this['editor'],{model:_0x4ce610}=_0x1a31f5;if(!_0x1dfbcd['has']('TableUtils'))return;_0x1dfbcd['get']('TableUtils')['getSelectedTableCells'](_0xb75946)['length']&&_0x4ce610['deleteContent'](_0xb75946);}}class x extends _0x79df7f{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x31f53a('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x3fda56){super(_0x3fda56),this['name']='AIRequestError';}}function i(_0x4e45f4,_0xb43446,_0x160771){const t=_0x4e45f4['t'];switch(_0xb43446){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x160771);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x160771);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x160771);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0xb43446;}}class E extends _0x57e141{['_commandDefinitions'];constructor(_0x53b595,_0xd521a6){super(_0x53b595),this['_commandDefinitions']=_0xd521a6,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0xb280f3,_0xf1b8d0,_0x4e2af7)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x4e2af7));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x423840,_0x3afc7f,_0x44962e)=>{this['enabledCommandsIds']=_0x44962e?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3fd3ce=this['editor']['model'];this['_hasContext']=function(_0x56d8e1){const _0x1f215b=_0x56d8e1['document']['selection'];return _0x1f215b['isCollapsed']?0x0!==[..._0x1f215b['getSelectedBlocks']()]['length']&&![..._0x1f215b['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x56d8e1['hasContent'](_0x1f215b['getFirstRange']());}(_0x3fd3ce);const _0x196fab=_0x3fd3ce['document']['selection'],_0x5021d9=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x240547 of _0x196fab['getRanges']())for(const _0x19aba5 of _0x240547['getItems']())if(_0x19aba5['is']('element')&&_0x5021d9['includes'](_0x19aba5['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x473047='',_0x119c4a='',_0x3a2645='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x473047,_0x119c4a,_0x3a2645);}}function F(_0x14af6c,_0x83b9d7){const _0x36af52=new Set();for(const _0x2ffedd of _0x14af6c['values']())(_0x83b9d7||!0x1===_0x2ffedd['requiresContent'])&&_0x36af52['add'](_0x2ffedd['id']);return Array['from'](_0x36af52);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x1a04e9(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x175084,_0x260b28,_0x74840c){super(),this['editor']=_0x175084,this['textAdapter']=_0x260b28,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x74840c,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x312763,_0x22baf3,_0x541141)=>{this['view']['value']=this['_sanitizeHTML'](_0x541141);}),this['listenTo'](this['view'],'submitPrompt',(_0x504c1a,_0x1240af)=>{const _0x3fded9=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1240af,_0x3fded9,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x18804a,query:_0x19d168,htmlContent:_0x279bd9,label:_0xd97c9c,mainActionLabel:_0x4acc5d}){this['view']['prompt']=_0xd97c9c,this['view']['mainAction']=_0x4acc5d,this['initialContext']=_0x279bd9,_0x19d168&&(this['view']['isRendered']?this['_handleQuery'](_0x19d168,_0x279bd9,_0x18804a,_0xd97c9c):this['view']['once']('render',()=>{this['_handleQuery'](_0x19d168,_0x279bd9,_0x18804a,_0xd97c9c);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x4b8cc9,_0x363b04,_0x891021,_0x45ec89){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x363b04,this['previousQuery']=_0x4b8cc9,this['previousLabel']=_0x45ec89||_0x4b8cc9,this['previousActionId']=_0x891021,new Promise(_0x23f3b6=>{this['textAdapter']['makeRequest']({'query':_0x4b8cc9,'context':_0x363b04,'onData':_0x41846c=>{this['currentResponse']=_0x41846c,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x891021})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x423b5e=>{_0x423b5e instanceof R?this['view']['handleError'](_0x423b5e['message']):this['view']['handleError'](),_0x23f3b6();})['finally'](()=>{this['stopProcessing'](),_0x23f3b6();});});}['_parseAndNormalizeContent'](_0x132888,_0x5f18e0=!0x1){const _0xcfefdb=Q['exec'](_0x132888);_0x132888=_0xcfefdb?_0x132888['substring'](_0xcfefdb[0x1]['length']):_0x132888['length']<0x64&&!_0x5f18e0?'':this['_stripMarkdownSyntax'](_0x132888);const _0x51478d=this['_domParser']['parseFromString'](_0x132888,'text/html');if(_0xcfefdb){const _0x209236=Array['from'](_0x51478d['body']['childNodes']);_0x209236['reverse']();for(const _0x58ae1b of _0x209236){if(_0x58ae1b['nodeType']==Node['ELEMENT_NODE'])break;_0x58ae1b['remove']();}}const _0x12eece=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x51478d['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x12eece);const _0x32d2a7=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x527353=this['editor']['data']['toModel'](_0x12eece);return _0x32d2a7||_0x527353['markers']['clear'](),this['editor']['data']['stringify'](_0x527353);}['_normalizeResponseHeadings'](_0x2633a3){const _0x9efd43=new _0x146d0d(this['editor']['editing']['view']['document']),_0x450513=new _0x4873a8({'name':/^h[1-5]$/}),_0x20e443=[];let _0x29606a=!0x1;for(const _0x34ce2d of _0x2633a3)_0x34ce2d['is']('element')&&_0x450513['match'](_0x34ce2d)&&(_0x20e443['push'](_0x34ce2d),'h1'==_0x34ce2d['name']&&(_0x29606a=!0x0));if(_0x29606a){for(const _0x3e0814 of _0x20e443)_0x9efd43['rename']('h'+(parseInt(_0x3e0814['name'][0x1])+0x1),_0x3e0814);}}['_isH1TagSupportEnabled'](){const {data:_0x5c8efa,editing:_0x975ab7}=this['editor'],_0x5a0c72=_0x5c8efa['htmlProcessor']['toView']('<h1></h1>'),_0xad71b2=_0x5c8efa['toView'](_0x5c8efa['toModel'](_0x5a0c72));return!!_0x975ab7['view']['domConverter']['viewToDom'](_0xad71b2)['querySelector']('h1');}['_sanitizeHTML'](_0x743606){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x743606),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x59d8ed){const _0x976bba=_0x59d8ed['trim']();return _0x976bba['startsWith']('```html')?_0x976bba['endsWith']('```')?_0x976bba['substring'](0x7,_0x976bba['length']-0x3):_0x976bba['substring'](0x7):_0x59d8ed;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x103b44){super(_0x103b44),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x505fdb=>i(_0x103b44,'AI_'+_0x505fdb['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x103b44,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x103b44,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x103b44,'Stop'));const _0x2fa3da=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x2fa3da['if']('isVisible','ck-hidden',_0x33fb8c=>!_0x33fb8c)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x4a45aa,_0x304f81){const _0x4502cd=new _0x243c46(this['locale']);return _0x4502cd['set']({'label':_0x4a45aa,'class':_0x304f81||'','isVisible':!0x0,'withText':!0x0}),_0x4502cd;}}class ct extends _0x315dd6{['contentFieldView'];['copyButtonView'];constructor(_0x11d8e8,_0x3075b5=''){super(_0x11d8e8),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x13c909=this['bindTemplate'];this['contentFieldView']=new bt(_0x11d8e8,_0x3075b5),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x13c909['if']('isVisible','ck-hidden',_0x3d778c=>!_0x3d778c)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x13c909['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x2adb92=!0x1;this['on']('change:value',(_0x534973,_0x12fd5b,_0x2c8be9)=>{const _0xa84f47=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2c8be9),this['isProcessing']&&_0xa84f47&&!_0x2adb92&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1a03d1,_0x4b8843,_0x2a9d96)=>{_0x2adb92=!0x1,_0x2a9d96?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x2adb92=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x2adb92=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x114bf5=this['locale'],_0x21946d=new _0x243c46(this['locale']),_0x25a868='ck-ai-form__copy-button';return _0x21946d['set']({'label':i(_0x114bf5,'Copy'),'icon':_0x18e128,'class':_0x25a868,'tooltip':!0x0}),_0x21946d['bind']('isVisible')['to'](this,'value',_0x72a3c9=>!!_0x72a3c9),_0x21946d['bind']('isEnabled')['to'](this,'isProcessing',_0x29b653=>!_0x29b653),_0x21946d['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x21946d['icon']=_0x1a8284,_0x21946d['class']=_0x25a868+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x21946d['icon']=_0x18e128,_0x21946d['class']=_0x25a868;},0x3e8);}),_0x21946d;}['_copyHTMLToClipboard'](_0x20a1c7){const {window:_0x52f40b,document:_0x2f2c8b}=_0x38d498;if(_0x52f40b['ClipboardItem']){const {Blob:_0x304ce1,ClipboardItem:_0x23fb00}=_0x52f40b,_0x2cde29=[new _0x23fb00({'text/html':new _0x304ce1([_0x20a1c7['innerHTML']],{'type':'text/html'}),'text/plain':new _0x304ce1([_0x20a1c7['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2cde29);}else{const _0x32f8b3=_0x2f2c8b['createElement']('div');_0x32f8b3['style']['position']='absolute',_0x32f8b3['style']['left']='-9999px',_0x32f8b3['innerHTML']='<span>[</span>'+_0x20a1c7['innerHTML']+'<span>]</span>',_0x2f2c8b['body']['appendChild'](_0x32f8b3);const _0x1036a9=_0x2f2c8b['createRange']();_0x1036a9['setStartAfter'](_0x32f8b3['firstElementChild']),_0x1036a9['setEndBefore'](_0x32f8b3['lastElementChild']);const _0x2036ff=_0x52f40b['getSelection']();_0x2036ff['removeAllRanges'](),_0x2036ff['addRange'](_0x1036a9),_0x2f2c8b['execCommand']('copy'),_0x32f8b3['remove']();}}}class bt extends _0x315dd6{constructor(_0x62bc22,_0x33c240=''){super(_0x62bc22),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x33c240,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x179c2b){this['element']['innerHTML']=_0x179c2b;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4c96cd=new _0x315dd6(),_0x57b805=this['locale'],_0x427a3e=new _0x57ab1b();return _0x427a3e['isVisible']=!0x0,_0x4c96cd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x427a3e,{'text':i(_0x57b805,'AI\x20is\x20writing...')}]}),_0x4c96cd['render'](),_0x4c96cd;}}class mt extends _0x315dd6{constructor(_0x4692bc,_0x2bdd7e=''){super(_0x4692bc);const _0xadbea7=new _0x173f5c(),_0x1c5619=this['bindTemplate'];this['set']('text',_0x2bdd7e),_0xadbea7['content']=_0x5d6f38,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0xadbea7,{'text':_0x1c5619['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x10a2b1,_0x496fbc){super(_0x10a2b1,_0x496fbc),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x43b4b0,_0xce49d0)=>{_0x43b4b0['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xce49d0());});}['_createSubmitButton'](){const _0x52077c=new _0x243c46(this['locale']),_0x342e46=this['locale'];return _0x52077c['set']({'icon':it,'label':i(_0x342e46,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x52077c['on']('execute',()=>{this['submit']();}),_0x52077c['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x59763b,_0x2e5f0a)=>!_0x59763b&&_0x2e5f0a),_0x52077c;}['_createShowHistoryButton'](){const _0x355ab4=new _0x243c46(this['locale']),_0x48356c=this['resultsView'],_0x86856=this['locale'];_0x355ab4['set']({'label':i(_0x86856,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x355ab4['bind']('isOn')['to'](_0x48356c,'isVisible'),_0x355ab4['bind']('isEnabled')['to'](this,'isEnabled'),_0x355ab4['on']('execute',()=>{_0x48356c['isVisible']=!_0x48356c['isVisible'],_0x48356c['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2ffc47=()=>{_0x38d498['window']['requestAnimationFrame'](()=>{if(_0x2a8359(this['element'])){const _0x53c29e=new _0x8cd30b(this['queryView']['fieldView']['element']),_0x1d7e14=_0x53c29e['width'],_0x5ed01d='rtl'===_0x86856['uiLanguageDirection']?'left':'right';_0x53c29e['excludeScrollbarsAndBorders'](),_0x355ab4['element']['style'][_0x5ed01d]=_0x1d7e14-_0x53c29e['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2ffc47),this['on']('render',_0x2ffc47),_0x355ab4;}['submit'](){const _0x3870b3=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x3870b3);}['focus'](_0x12e077){-0x1===_0x12e077?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x5b8ca4){super(_0x5b8ca4),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x5b8ca4,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x55e82b=0x0;for(const _0x34891e of this['items'])_0x55e82b+=_0x34891e['items']['length'];return{'resultsCount':_0x55e82b,'totalItemsCount':_0x55e82b};}['_createClearHistoryButton'](){const _0x3d3af5=this['locale'],_0x1ec567=new _0x243c46(this['locale']);return _0x1ec567['set']({'label':'('+i(_0x3d3af5,'Clear')+')','withText':!0x0}),_0x1ec567['on']('execute',()=>this['fire']('clearHistory')),_0x1ec567;}}class ut extends xt{constructor(_0xb8a8b5){super();const _0x59b26f=new wt(),_0x5a4bee=new _0x243c46(this['locale'],_0x59b26f);this['children']['add'](_0x5a4bee),_0x5a4bee['set']({'label':_0xb8a8b5['prompt'],'withText':!0x0}),_0x5a4bee['on']('execute',()=>{this['fire']('execute',{'value':kt(_0xb8a8b5['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x2197ad{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x18be4f,_0x58027c)=>{const _0x1baba6=os(_0x58027c['prompt']);for(const _0x116bc0 of this)if(_0x116bc0!=_0x58027c&&os(_0x116bc0['prompt'])===_0x1baba6){this['remove'](_0x116bc0);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2c7bd8=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x2c7bd8));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x5ab588=>_0x5ab588)));}}function os(_0x29d5d7){return _0x29d5d7['toLowerCase']()['trim']();}class k extends _0x315dd6{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2d94ab,_0x36efd6,_0x3669d7=''){super(_0x2d94ab),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x2d94ab),this['contentArea']=new ct(_0x2d94ab,_0x3669d7),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x51ed9d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x36efd6],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x51ed9d['if']('isError','ck-hidden',_0xb00ba9=>!_0xb00ba9)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x3f7fdf=0x1){-0x1===_0x3f7fdf?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x572e49=this['locale'],_0x5ce0e4=new lt(_0x572e49,{'queryView':{'label':i(_0x572e49,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x572e49,'Empty\x20history'),'secondary':i(_0x572e49,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5ce0e4['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x431ca5,_0x5cd404)=>_0x431ca5&&!_0x5cd404),this['listenTo'](_0x5ce0e4,'submit',(_0x11cd86,_0x3658b3)=>{this['prompt']=_0x3658b3;const _0x437205=ft(_0x3658b3);this['fire']('submitPrompt',_0x437205),_0x3658b3['trim']()&&this['_promptHistory']['add']({'prompt':_0x437205},0x0);},{'priority':'high'}),_0x5ce0e4;}['_createHistoryView'](){const _0x43b76f=new pt(this['locale']);return _0x43b76f['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x43b76f['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x43b76f;}['_createToolbar'](){const _0x2dade4=new at(this['locale']);return _0x2dade4['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1b8402,_0x40b5e8,_0x1ac2c3)=>_0x1b8402&&!_0x40b5e8&&!!_0x1ac2c3),_0x2dade4['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2dade4['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1793bd,_0x253560,_0x3a225d)=>_0x1793bd&&!_0x253560&&!!_0x3a225d),_0x2dade4['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2dade4['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x246080,_0x4743ca)=>_0x246080&&!_0x4743ca),_0x2dade4['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2dade4['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2dade4['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2dade4;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x4b9786=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x4b9786,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x436623){const _0xf27ea5=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x436623||i(_0xf27ea5,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x79df7f{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x5f161a,a,x,_0x14799d];}constructor(_0x158e44){super(_0x158e44),_0x158e44['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x158e44['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x158e44['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x158e44['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xc899e9}=this;this['_aiAdapter']=_0xc899e9['plugins']['get'](x),this['_dialog']=_0xc899e9['plugins']['get'](_0x14799d),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x343fb6=new E(_0xc899e9,Array['from'](this['_commandDefinitions']['values']()));_0xc899e9['commands']['add']('showAIAssistant',_0x343fb6),_0xc899e9['ui']['componentFactory']['add']('aiCommands',_0x22c543=>{const _0x28893a=_0x445275(_0x22c543);return _0x28893a['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x28893a['buttonView']['set']({'label':i(_0x22c543,'AI\x20Commands'),'icon':_0x1c8c09,'tooltip':!0x0}),_0x28893a['on']('execute',_0x1a5b69=>this['_onExecute'](_0x1a5b69['source']['id'])),_0x3532bf(_0x28893a,_0xc899e9['ui']['view']['body'],function(_0x2143a3){const _0x446eff=o(_0x2143a3['config']['get']('ai.aiAssistant.commands'),_0x2143a3['locale']),_0x28ad25=U(_0x2143a3,_0x446eff)['filter'](_0x384262=>_0x384262['commands']['length']);if(0x1===_0x28ad25['length'])return U(_0x2143a3,_0x28ad25[0x0]['commands'])['map'](_0x5d5281=>({'id':_0x5d5281['id'],'label':_0x5d5281['label']}));return _0x28ad25['map'](_0x4d1ddb=>{const {groupId:_0xf01714,groupLabel:_0x297b22,commands:_0x3523e2}=_0x4d1ddb,_0x474014=U(_0x2143a3,_0x3523e2)['map'](_0x37b0af=>({'id':_0x37b0af['id'],'label':_0x37b0af['label']}));return{'id':_0xf01714,'menu':_0x297b22||_0xf01714,'children':_0x474014};});}(_0xc899e9),{'ariaLabel':i(_0x22c543,'AI\x20Commands')}),_0x28893a['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x343fb6['on']('change:enabledCommandsIds',_0x1eefdf),_0x28893a['menuView']['once']('render',_0x1eefdf),_0x28893a;function _0x1eefdf(){_0x28893a['isEnabled']=_0x343fb6['enabledCommandsIds']['length']>0x0;for(const _0x2bd7a5 of _0x28893a['menuView']['buttons'])_0x2bd7a5['isEnabled']=_0x343fb6['enabledCommandsIds']['includes'](_0x2bd7a5['id']);}}),_0xc899e9['ui']['componentFactory']['add']('menuBar:aiCommands',_0x250a8a=>{const _0x3db10a=new _0x58da05(_0x250a8a);_0x3db10a['buttonView']['set']({'label':i(_0x250a8a,'AI\x20Commands'),'icon':_0x1c8c09}),_0x3db10a['bind']('isEnabled')['to'](_0x343fb6,'enabledCommandsIds',_0x2dd499=>_0x2dd499['length']>0x0);const _0xd73dfb=o(_0xc899e9['config']['get']('ai.aiAssistant.commands'),_0x250a8a);return this['_populateMenuBarMenu'](_0x343fb6,_0x3db10a,_0xd73dfb,_0x39abca=>this['_onExecute'](_0x39abca)),_0x3db10a;}),_0xc899e9['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5a3d53=this['_createAIAssistantUIButton'](_0x243c46);return _0x5a3d53['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5a3d53;}),_0xc899e9['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x264730=this['_createAIAssistantUIButton'](_0x1d8a4f);return _0x264730['set']({'role':'menuitemcheckbox'}),_0x264730;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5406c7=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1321d7;for(const _0x15ecb2 in _0x5406c7){const _0x158278=_0x15ecb2,_0x3469e0=_0x5406c7[_0x158278];if('aiLicenseKeyValid'==_0x3469e0||'aiLicenseKeyInvalid'==_0x3469e0||'aiLicenseKeyExpired'==_0x3469e0||'aiLicenseKeyDomainLimit'==_0x3469e0||'aiLicenseKeyNotAllowed'==_0x3469e0||'aiLicenseKeyEvaluationLimit'==_0x3469e0||'aiLicenseKeyTrialLimit'==_0x3469e0||'aiLicenseKeyUsageLimit'==_0x3469e0){delete _0x5406c7[_0x158278],_0x1321d7=_0x3469e0,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1321d7&&_0x5406c7['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1321d7&&_0x5406c7['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1321d7&&_0x5406c7['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1321d7&&_0x5406c7['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1321d7&&_0x5406c7['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x1321d7&&_0x5406c7['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x1321d7&&_0x5406c7['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x25600f='',_0x2aaf00='',_0x5eeea3='custom'){const _0x13800e=this['editor'],_0x5aa55a=_0x13800e['editing']['view'],_0x99c4da=_0x13800e['plugins']['get'](a),_0x5a06b1=_0x13800e['plugins']['get'](_0x5f161a);_0x99c4da['showFakeVisualSelection']();const _0x577672=new l(),_0x37bec3=new ClipboardEvent('copy',{'clipboardData':_0x577672}),_0xd29b6d=new _0x1e5433(_0x577672),_0x3f3479=new _0x56d237(_0x5aa55a,_0x37bec3,{'dataTransfer':_0xd29b6d});_0x5a06b1['_forceMarkersCopy']('comment',()=>{_0x5aa55a['document']['fire']('copy',_0x3f3479);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x13800e,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x323722=_0xd29b6d['getData']('text/html');const _0x530522=_0x13800e['model']['document']['selection'],_0x402c3a=Array['from'](_0x530522['getRanges']());0x1===_0x402c3a['length']&&_0x402c3a[0x0]['isFlat']&&!_0x530522['getSelectedElement']()&&''!==_0x323722['replace'](/ /g,'')['trim']()&&(_0x323722='<p>'+_0x323722+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5eeea3,'query':_0x25600f,'htmlContent':_0x323722,'label':_0x2aaf00,'mainActionLabel':_[_0x13800e['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4e7f8e,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x5e961b['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x99c4da['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x59093f=new Map(),_0x4c0454=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x30b488 of _0x4c0454)for(const _0x3600f9 of _0x30b488['commands'])_0x59093f['set'](_0x3600f9['id'],{..._0x3600f9,'groupId':_0x30b488['groupId'],'groupLabel':_0x30b488['groupLabel']||_0x30b488['groupId']});return _0x59093f;}['_createAIAssistantUIButton'](_0x3c2154){const _0xf6ff02=this['editor'],_0x1b4346=_0xf6ff02['commands']['get']('showAIAssistant'),_0x3eea2f=new _0x3c2154(_0xf6ff02['locale']);return _0x3eea2f['set']({'label':i(_0xf6ff02['locale'],'AI\x20Assistant'),'icon':_0x4e7f8e,'isToggleable':!0x0}),_0x3eea2f['bind']('isEnabled')['to'](_0x1b4346),_0x3eea2f['bind']('isOn')['to'](this['_dialog'],'id',_0x914db1=>'aiAssistant'===_0x914db1),this['listenTo'](_0x3eea2f,'execute',()=>{_0x3eea2f['isOn']?this['hideUI']():_0x1b4346['execute']();}),_0x3eea2f;}['_initView'](){const _0x14b3df=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x14b3df['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x14b3df['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2465d3,ui:{ariaLiveAnnouncer:_0x544d78}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x122f4b,_0x290abd,_0x324043)=>{const _0x368889=this['_aiAssistantController']['currentContext'];_0x324043?_0x544d78['announce'](i(_0x2465d3,'AI\x20is\x20writing')):_0x368889&&_0x544d78['announce'](i(_0x2465d3,'Generated\x20content:\x20%0',_0x368889),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x58916c,_0x1f6e47,_0xc5a0d4)=>{if(_0xc5a0d4){const _0x28b98f=this['_formView']['errorView']['text'];_0x544d78['announce'](i(_0x2465d3,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x28b98f));}});}['_onExecute'](_0x49b813){const _0x5d80ea=this['_commandDefinitions']['get'](_0x49b813),_0xa94a39=this['editor'],_0x2052a7=_0xa94a39['model']['document']['selection'],_0x52e846=_0xa94a39['commands']['get']('showAIAssistant'),_0x1b05de=_0xa94a39['plugins']['get'](a),_0x27eefa=''+(_0x5d80ea['groupId']!==K?_0x5d80ea['groupLabel']+':\x20':'')+_0x5d80ea['label'];if(!0x1!==_0x5d80ea['requiresContent']&&_0x2052a7['isCollapsed']){const _0x2fb4ce=_0x5d1380(_0x2052a7['getSelectedBlocks']())||_0xa94a39['model']['schema']['getLimitElement'](_0x2052a7);_0xa94a39['model']['change'](_0xd947c9=>{_0xd947c9['setSelection'](_0x2fb4ce,'in');});}_0x1b05de['showFakeVisualSelection'](),_0x52e846['execute'](_0x5d80ea['prompt'],_0x27eefa,'command:'+_0x49b813);}['_populateMenuBarMenu'](_0x1af07b,_0x501a06,_0x92445c,_0x256569){const _0x4fb1de=this['editor'],_0x95d4ec=_0x4fb1de['locale'],_0x40f803=new _0x56611d(_0x95d4ec),_0x228d30=U(_0x4fb1de,_0x92445c)['filter'](_0x6b1093=>_0x6b1093['commands']['length']);0x1===_0x228d30['length']?this['_getMenuBarGroupButtons']({'command':_0x1af07b,'commands':_0x228d30[0x0]['commands'],'parentMenuView':_0x501a06,'onExecute':_0x256569})['forEach'](_0x29dbc2=>_0x40f803['items']['add'](_0x29dbc2)):_0x228d30['forEach'](({groupId:_0x58167c,groupLabel:_0x1d8235,commands:_0x4c748c})=>{const _0x154aec=new _0x35a1dc(_0x95d4ec,_0x501a06),_0x265690=new _0x58da05(_0x95d4ec),_0x46251d=new _0x56611d(_0x95d4ec),_0x161dce=this['_getMenuBarGroupButtons']({'command':_0x1af07b,'commands':_0x4c748c,'parentMenuView':_0x265690,'onExecute':_0x256569});_0x265690['buttonView']['set']({'label':_0x1d8235||_0x58167c}),_0x265690['delegate']('execute')['to'](_0x501a06),_0x46251d['items']['addMany'](_0x161dce),_0x265690['panelView']['children']['add'](_0x46251d),_0x154aec['children']['add'](_0x265690),_0x40f803['items']['add'](_0x154aec);}),_0x501a06['panelView']['children']['add'](_0x40f803);}['_getMenuBarGroupButtons']({command:_0x51a71d,commands:_0x678a65,parentMenuView:_0x16a98b,onExecute:_0x55d674}){const _0x177f83=this['editor'],_0x53231b=_0x177f83['locale'];return U(_0x177f83,_0x678a65)['map'](_0x3067d9=>{const _0x55a57a=new _0x35a1dc(_0x53231b,_0x16a98b),_0x54aebe=new _0x1d8a4f(_0x53231b);return _0x54aebe['set']({'label':_0x3067d9['label']}),_0x54aebe['delegate']('execute')['to'](_0x16a98b),_0x54aebe['on']('execute',()=>_0x55d674(_0x3067d9['id'])),_0x54aebe['bind']('isEnabled')['to'](_0x51a71d,'enabledCommandsIds',_0x48bdff=>_0x48bdff['includes'](_0x3067d9['id'])),_0x55a57a['children']['add'](_0x54aebe),_0x55a57a;});}}function T(_0x238eb0,_0x6f84f){return void 0x0!==_0x238eb0['order']&&void 0x0===_0x6f84f['order']?0x1:void 0x0===_0x238eb0['order']&&void 0x0!==_0x6f84f['order']?-0x1:void 0x0!==_0x238eb0['order']&&void 0x0!==_0x6f84f['order']?_0x238eb0['order']-_0x6f84f['order']:0x0;}function U(_0x9000d5,_0x864ce4){_0x864ce4['sort'](T);const _0x5b8bf3={},_0x1b98d8=[];for(const _0x181ab9 of _0x864ce4)if(void 0x0!==_0x181ab9['order']){if(_0x181ab9['order']in _0x5b8bf3)throw new _0x31f53a('ai-commands-config-order-collision',_0x9000d5,{'conflictingDefinitions':[_0x181ab9,_0x5b8bf3[_0x181ab9['order']]]});_0x5b8bf3[_0x181ab9['order']]=_0x181ab9,_0x1b98d8['splice'](_0x181ab9['order'],0x0,_0x181ab9);}else _0x1b98d8['push'](_0x181ab9);return _0x1b98d8;}class At extends _0x79df7f{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4ea030){super(_0x4ea030);const _0x4626fd=_0x4ea030['config'],_0x1ca602=_0x4ea030['locale'];_0x4626fd['define']('ai.aiAssistant.preserveComments',!0x0),_0x4626fd['define']('ai.aiAssistant.commands',_t(_0x1ca602)),_0x4626fd['define']('ai.aiAssistant.extraCommandGroups',[]),_0x4626fd['define']('ai.aiAssistant.removeCommands',[]);let _0x54adf3=o(_0x4626fd['get']('ai.aiAssistant.commands'),_0x1ca602);const _0x2e26d0=_0x4626fd['get']('ai.aiAssistant.extraCommandGroups'),_0x52b77d=_0x4626fd['get']('ai.aiAssistant.removeCommands');_0x2e26d0['forEach'](_0x5e3bbe=>{const _0x13563a=_0x54adf3['find'](_0x28f67b=>_0x28f67b['groupId']===_0x5e3bbe['groupId']);_0x13563a?_0x13563a['commands']=_0x13563a['commands']['concat'](_0x5e3bbe['commands']):_0x54adf3['push'](_0x5e3bbe);}),_0x54adf3=_0x54adf3['filter'](_0x57a617=>!_0x52b77d['includes'](_0x57a617['groupId'])),_0x54adf3['forEach'](_0x1b0090=>{_0x1b0090['commands']=_0x1b0090['commands']['filter'](_0x51a802=>!_0x52b77d['includes'](_0x51a802['id']));}),_0x4626fd['set']('ai.aiAssistant.commands',_0x54adf3);}}function _t(_0x306e1a){return[{'groupId':'editOrReview','groupLabel':i(_0x306e1a,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x306e1a,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x306e1a,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':i(_0x306e1a,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x306e1a,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':i(_0x306e1a,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x306e1a,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':i(_0x306e1a,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':i(_0x306e1a,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x306e1a,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x306e1a,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x306e1a,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x306e1a,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x306e1a,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x306e1a,'Change\x20style'),'commands':[{'id':'business','label':i(_0x306e1a,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x306e1a,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x306e1a,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x306e1a,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x306e1a,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x306e1a,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x306e1a,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x306e1a,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x306e1a,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x306e1a,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x306e1a,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x306e1a,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x306e1a,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x79df7f{['abortController'];static get['requires'](){return[x];}constructor(_0xcd289a){super(_0xcd289a),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x3678c1){return this['sendRequest'](_0x3678c1)['catch'](_0x4f635a=>{if(_0x4f635a instanceof R)return Promise['reject'](_0x4f635a);if('AbortError'==_0x4f635a['name'])return Promise['resolve']();throw console['error'](_0x4f635a),new _0x31f53a('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x43e333,_0x4e10f6){const _0x2d172c=this['editor']['locale'],_0x41395c={'Content-Type':'application/json'};if('object'==typeof _0x43e333)Object['assign'](_0x41395c,_0x43e333);else{if(_0x43e333)try{const _0x582100=await _0x43e333(_0x4e10f6);Object['assign'](_0x41395c,_0x582100);}catch{return Promise['reject'](new R(i(_0x2d172c,'AI_ERROR_GET_HEADERS')));}}return _0x41395c;}async['_prepareRequestParameters'](_0xe985bf,_0x133cdc){const _0x48fcad=this['editor']['locale'];if('object'==typeof _0xe985bf)return _0xe985bf;try{return await _0xe985bf(_0x133cdc);}catch{return Promise['reject'](new R(i(_0x48fcad,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x281f0e){super(_0x281f0e),_0x281f0e['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x281f0e['config']['get']('ai.openAI.requestParameters')||_0x281f0e['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x281f0e['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x281f0e['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x281f0e['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x49092a,context:_0x18a241,onData:_0x590a77,actionId:_0x56e192}){const _0x847872=this['editor']['locale'],_0x554b3b=await this['prepareMessages'](_0x49092a,_0x18a241,_0x56e192),_0x522575=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x56e192),_0xb7df81=await this['_prepareRequestParameters'](this['_requestParameters'],_0x56e192),_0x4a868d={'messages':_0x554b3b,..._0xb7df81},_0x5bf4dc={'method':'POST','headers':_0x522575,'body':JSON['stringify'](_0x4a868d),'signal':this['abortController']['signal']},_0x123ee5=await fetch(this['_apiUrl'],_0x5bf4dc);if(_0x123ee5['ok'])return _0xb7df81['stream']?await this['_readStreamableResponse'](_0x123ee5,_0x590a77):await this['_readStaticResponse'](_0x123ee5,_0x590a77),Promise['resolve']();{const _0x518aeb=await _0x123ee5['text']();return _0x518aeb['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x847872,'AI_ERROR_CONTEXT_LENGTH'))):_0x518aeb['includes']('Moderation')?Promise['reject'](new R(i(_0x847872,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x518aeb));}}async['prepareMessages'](_0x5dedeb,_0x58cfa7,_0x5b7a43){let _0x288045,_0x3e6a8b;return _0x58cfa7?(_0x288045='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x3e6a8b='Instruction:\x0a'+_0x5dedeb+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x58cfa7):(_0x288045='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x3e6a8b=_0x5dedeb),[{'role':'system','content':_0x288045},{'role':'user','content':_0x3e6a8b}];}async['_readStreamableResponse'](_0x123938,_0x8b37){const _0x29e148=_0x123938['body']['getReader'](),_0x91dc=new TextDecoder();let _0x199175='',_0x2ab31e='',_0x3b28f7='',_0x50717f=!0x1;for(;!_0x50717f;){const {done:_0xf8af2d,value:_0x479c10}=await _0x29e148['read'](),_0x50ea48=_0x199175+_0x91dc['decode'](_0x479c10);let _0x445f8a='';_0x50717f=_0xf8af2d;try{_0x445f8a=this['_cleanUpData'](_0x50ea48),_0x199175='';}catch{_0x199175=_0x50ea48;continue;}_0x2ab31e+=_0x445f8a,!_0x50717f&&this['_isBufferIncomplete'](_0x2ab31e)||_0x2ab31e&&(_0x3b28f7+=_0x2ab31e,_0x2ab31e='',_0x8b37(_0x3b28f7));}return Promise['resolve']();}async['_readStaticResponse'](_0x59687e,_0x155f34){return _0x155f34((await _0x59687e['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x558b56){const _0x27622d=_0x558b56['split']('<')['length']!==_0x558b56['split']('>')['length'],_0x5a5851=_0x558b56['length']<0x1e;return _0x27622d&&_0x5a5851;}['_cleanUpData'](_0x189180){return _0x189180['split'](/\n(?![^{]*\})/g)['map'](_0x3e62ad=>_0x3e62ad['replace']('data:\x20',''))['filter'](_0x1450bb=>_0x1450bb&&_0x1450bb['length']>0x0&&'[DONE]'!==_0x1450bb)['map'](_0x3995e0=>{const {choices:_0x475991}=JSON['parse'](_0x3995e0);if(_0x475991[0x0]?.['delta']?.['content'])return _0x475991[0x0]['delta']['content'];})['filter'](_0x21f8bd=>_0x21f8bd)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x1829a0){super(_0x1829a0),_0x1829a0['config']['get']('ai.aws.requestParameters')||_0x1829a0['config']['define']('ai.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x1829a0['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x1829a0['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x1829a0['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x1829a0['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x3d347e,context:_0x4c0b77,onData:_0x2671ce,actionId:_0x5ba840}){const {model:_0x3484ac,stream:_0x367ad8,..._0x2d6ccb}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5ba840),_0x19e419={'prompt':await this['preparePrompt'](_0x3d347e,_0x4c0b77,_0x3484ac,_0x5ba840),..._0x2d6ccb};this['_apiUrl']?await this['_processProxyRequest'](_0x19e419,_0x3484ac,_0x367ad8,_0x2671ce,_0x5ba840):await this['_processAWSRequest'](_0x19e419,_0x3484ac,_0x367ad8,_0x2671ce);}async['preparePrompt'](_0x32a0c8,_0x44c116,_0x3b3a51,_0xfcdc53){let _0xbbdb61,_0x3a02c7;return _0x44c116?(_0xbbdb61='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x3a02c7='Instruction:\x0a'+_0x32a0c8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x44c116):(_0xbbdb61='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x3a02c7=_0x32a0c8),'meta.llama'==this['getModelFamily'](_0x3b3a51)?'<<SYS>>\x0a'+_0xbbdb61+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x3a02c7+'\x0a[/INST]':'Human:\x0a'+_0xbbdb61+'\x0a'+_0x3a02c7+'\x0a\x0aAssistant:';}['getModelFamily'](_0x2a8d8f){if(/^anthropic\.claude/['test'](_0x2a8d8f))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x2a8d8f))return'ai21.j2';if(/^cohere\.command/['test'](_0x2a8d8f))return'cohere.command';if(/^meta\.llama/['test'](_0x2a8d8f))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x2a8d8f));}async['_processProxyRequest'](_0x50bc30,_0x355b5f,_0x469cd0,_0x43ea5b,_0x5b2cd3){const _0x1e3ca6={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5b2cd3),'body':JSON['stringify']({..._0x50bc30,'model':_0x355b5f,'stream':_0x469cd0}),'signal':this['abortController']['signal']},_0x206681=await fetch(this['_apiUrl'],_0x1e3ca6);_0x469cd0?await this['_readStreamableResponse'](_0x206681,_0x355b5f,_0x43ea5b):await this['_readStaticResponse'](_0x206681,_0x355b5f,_0x43ea5b);}async['_processAWSRequest'](_0x526a5e,_0x305f0a,_0x449ae3,_0x42675f){const _0x2be2d2=new _0x2c193d(this['_bedrockClientConfig']),_0x169652={'body':JSON['stringify'](_0x526a5e),'contentType':'application/json','accept':'application/json','modelId':_0x305f0a};let _0x4d68d9;if(_0x449ae3){const _0x24b096=new _0x47d31f(_0x169652);_0x4d68d9=await _0x2be2d2['send'](_0x24b096,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x4d68d9,_0x305f0a,_0x42675f);}else{const _0x48a762=new _0x2ac079(_0x169652);_0x4d68d9=await _0x2be2d2['send'](_0x48a762,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x4d68d9,_0x305f0a,_0x42675f);}}async['_readAsyncIterableResponse'](_0x5d0aff,_0x635638,_0xb743db){const _0x44c773=_0x5d0aff['body'],_0x18e59c=new TextDecoder('utf-8');let _0x1a49eb='';for await(const _0x1bd2a5 of _0x44c773)if(_0x1bd2a5['chunk']){const _0xd0d3b=_0x18e59c['decode'](_0x1bd2a5['chunk']['bytes']),_0x406bb3=JSON['parse'](_0xd0d3b);_0x1a49eb+=this['_getGeneratedText'](_0x406bb3,_0x635638),_0xb743db(_0x1a49eb);}return Promise['resolve']();}async['_readStreamableResponse'](_0x2302b8,_0x10cfdd,_0x5e3cf4){const _0x3da8da=_0x2302b8['body'],_0x4ad577=new TextDecoder('utf-8'),_0x7d254f=_0x3da8da['getReader']();let _0x2b3716='',_0x2100dc='',_0xfc474f=!0x1;for(;!_0xfc474f;){const {done:_0x5673be,value:_0x3adc75}=await _0x7d254f['read']();if(_0xfc474f=_0x5673be,_0xfc474f)break;const _0x517a60=(_0x2b3716+_0x4ad577['decode'](_0x3adc75))['split']('\x0a')['map'](_0x1fb0e0=>{try{return _0x2b3716='',JSON['parse'](_0x1fb0e0);}catch{return _0x2b3716=_0x1fb0e0,null;}})['filter'](_0x5217eb=>null!==_0x5217eb);_0x517a60['length']&&(_0x2100dc+=_0x517a60['map'](_0x19ea5b=>this['_getGeneratedText'](_0x19ea5b,_0x10cfdd))['join'](''),_0x5e3cf4(_0x2100dc));}return Promise['resolve']();}async['_readStaticResponse'](_0x295e73,_0x12d1fe,_0x535dbd){let _0x2fccbb;return _0x2fccbb=_0x295e73 instanceof Response?await _0x295e73['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x295e73['body'])),(_0x535dbd(this['_getGeneratedText'](_0x2fccbb,_0x12d1fe)),Promise['resolve']());}['_getGeneratedText'](_0x3fb3e6,_0x165a1c){switch(this['getModelFamily'](_0x165a1c)){case'anthropic.claude':return _0x3fb3e6['completion'];case'ai21.j2':return _0x3fb3e6['completions'][0x0]['data']['text'];case'cohere.command':return _0x3fb3e6['generations'][0x0]['text'];case'meta.llama':return _0x3fb3e6['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-ai",
|
|
3
|
-
"version": "46.0.1-alpha.
|
|
3
|
+
"version": "46.0.1-alpha.9",
|
|
4
4
|
"description": "AI Assistant feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@aws-sdk/client-bedrock-runtime": "3.823.0",
|
|
32
|
-
"@ckeditor/ckeditor5-clipboard": "46.0.1-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-core": "46.0.1-alpha.
|
|
34
|
-
"@ckeditor/ckeditor5-engine": "46.0.1-alpha.
|
|
35
|
-
"@ckeditor/ckeditor5-icons": "46.0.1-alpha.
|
|
36
|
-
"@ckeditor/ckeditor5-table": "46.0.1-alpha.
|
|
37
|
-
"@ckeditor/ckeditor5-ui": "46.0.1-alpha.
|
|
38
|
-
"@ckeditor/ckeditor5-utils": "46.0.1-alpha.
|
|
39
|
-
"ckeditor5": "46.0.1-alpha.
|
|
32
|
+
"@ckeditor/ckeditor5-clipboard": "46.0.1-alpha.9",
|
|
33
|
+
"@ckeditor/ckeditor5-core": "46.0.1-alpha.9",
|
|
34
|
+
"@ckeditor/ckeditor5-engine": "46.0.1-alpha.9",
|
|
35
|
+
"@ckeditor/ckeditor5-icons": "46.0.1-alpha.9",
|
|
36
|
+
"@ckeditor/ckeditor5-table": "46.0.1-alpha.9",
|
|
37
|
+
"@ckeditor/ckeditor5-ui": "46.0.1-alpha.9",
|
|
38
|
+
"@ckeditor/ckeditor5-utils": "46.0.1-alpha.9",
|
|
39
|
+
"ckeditor5": "46.0.1-alpha.9",
|
|
40
40
|
"es-toolkit": "1.39.5"
|
|
41
41
|
},
|
|
42
42
|
"type": "module",
|