@ckeditor/ckeditor5-ai 46.0.2-alpha.1 → 46.0.2

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/dist/index.js CHANGED
@@ -20,5 +20,5 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x500ecb,Command as _0xe2efa4}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x143f04,IconCheck as _0x48de83,IconError as _0x58f758,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x1096ba,IconRobotPencil as _0x2b1820}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x18bb56,CKEditorError as _0x426b7a,ObservableMixin as _0x2f6b3e,global as _0x4288e3,isVisible as _0x9e8af8,Rect as _0x44b2b0,Collection as _0x3634f3,FocusTracker as et,KeystrokeHandler as rt,first as _0x44fea0}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x150283,View as _0x15a16a,SpinnerView as _0x41b4d8,IconView as _0x1dfc9c,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x195576,createDropdown as _0x2d9384,addMenuToDropdown as _0x38e05d,MenuBarMenuView as _0x5197c8,MenuBarMenuListItemButtonView as _0x1ceadf,DialogViewPosition as _0x2500ec,MenuBarMenuListView as _0x2deade,MenuBarMenuListItemView as _0x5dfe0d}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x5ba177,ClipboardMarkersUtils as _0x234e84}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x59b8b3,ViewDataTransfer as _0x5e080f,ViewUpcastWriter as _0x3a579f,Matcher as _0x3d57c4}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x5d9c90,InvokeModelWithResponseStreamCommand as _0xff26e,InvokeModelCommand as _0xaad2e}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0xfb9e09,_0x192a18){const _0x6ce694=(0x0,_0x192a18['t'])('Other');return _0xfb9e09['length']?'groupId'in _0xfb9e09[0x0]?_0xfb9e09:[{'groupId':K,'groupLabel':_0x6ce694,'order':0x1/0x0,'commands':_0xfb9e09}]:[{'groupId':K,'groupLabel':_0x6ce694,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x500ecb{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x524e9c}=this,_0x126b1d=['ck-fake-ai-selection'];_0x524e9c['config']['get']('ai.useTheme')&&_0x126b1d['push']('ck-ai-assistant-ui_theme'),_0x524e9c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x126b1d,'priority':0xc}}),_0x524e9c['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x53c189,{writer:_0x41fb9e})=>{if(!_0x53c189['markerRange']['isCollapsed'])return null;const _0x4c1eee=_0x41fb9e['createUIElement']('span');return _0x41fb9e['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4c1eee),_0x4c1eee;}});}['afterInit'](){!async function(_0x142299){const _0x137335=_0x55e26a([0x76,0x6f,0x79,0x62,0x37,0x55,0x65,0x36,0x30,0x52,0x45,0x57,0x63,0x41,0x6a,0x50,0x58,0x74,0x48,0x72,0x5a,0x64,0x42,0x77,0x54,0x4d,0x56,0x69,0x49,0x59,0x6d,0x31,0x4c,0x6c,0x51,0x75,0x53,0x61,0x4e,0x4f,0x6e,0x71,0x4b,0x4a,0x78,0x6b,0x70,0x73,0x44,0x46,0x33,0x43,0x7a,0x47,0x39,0x66,0x32,0x68,0x34,0x35,0x38,0x67]),_0x2a53a6=0x3b1227d3,_0x25d63f=0x3b15573b^_0x2a53a6,_0x1bfbf5=window[_0x55e26a([0x44,0x61,0x74,0x65])][_0x55e26a([0x6e,0x6f,0x77])](),_0x485d07=_0x142299[_0x55e26a([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x407e7f=new window[(_0x55e26a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x490faf=>{_0x485d07[_0x55e26a([0x6f,0x6e,0x63,0x65])](_0x55e26a([0x72,0x65,0x61,0x64,0x79]),_0x490faf);}),_0x3e430d={[_0x55e26a([0x6b,0x74,0x79])]:_0x55e26a([0x45,0x43]),[_0x55e26a([0x75,0x73,0x65])]:_0x55e26a([0x73,0x69,0x67]),[_0x55e26a([0x63,0x72,0x76])]:_0x55e26a([0x50,0x2d,0x32,0x35,0x36]),[_0x55e26a([0x78])]:_0x55e26a([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]),[_0x55e26a([0x79])]:_0x55e26a([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]),[_0x55e26a([0x61,0x6c,0x67])]:_0x55e26a([0x45,0x53,0x32,0x35,0x36])},_0x1b1fcb=_0x485d07[_0x55e26a([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x55e26a([0x67,0x65,0x74])](_0x55e26a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x2d81c7(){let _0x1c64c4,_0x143674=null,_0x4dcd1a=null;try{if(_0x1b1fcb==_0x55e26a([0x47,0x50,0x4c]))return _0x55e26a([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x1c64c4=_0x8676fd(),!_0x1c64c4)return _0x55e26a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x1c64c4[_0x55e26a([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x4dcd1a=_0x3466b7(_0x1c64c4[_0x55e26a([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x1c64c4[_0x55e26a([0x6a,0x74,0x69])])),await _0x51409c()?_0x3350c0()?_0x199f5a()?_0x55e26a([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x5c91c9()?(_0x1c64c4[_0x55e26a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x55e26a([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x143674=_0x176733(_0x55e26a([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x1c64c4[_0x55e26a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x55e26a([0x74,0x72,0x69,0x61,0x6c])&&(_0x143674=_0x176733(_0x55e26a([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x5bcea6()):_0x55e26a([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x55e26a([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x55e26a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x55e26a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x199f5a(){const _0x529797=[_0x55e26a([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x55e26a([0x74,0x72,0x69,0x61,0x6c])][_0x55e26a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1c64c4[_0x55e26a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x1bfbf5/0x3e8:0xe10*_0x25d63f;return _0x1c64c4[_0x55e26a([0x65,0x78,0x70])]<_0x529797;}function _0x3350c0(){const _0xa126f6=_0x1c64c4[_0x55e26a([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0xa126f6&&(!!_0xa126f6[_0x55e26a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x55e26a([0x2a]))||!!_0xa126f6[_0x55e26a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x55e26a([0x41,0x49])));}function _0x5c91c9(){const _0x87a09=_0x1c64c4[_0x55e26a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x87a09||0x0==_0x87a09[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1f59af}=new URL(window[_0x55e26a([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x87a09[_0x55e26a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1f59af))return!0x0;const _0x304346=_0x1f59af[_0x55e26a([0x73,0x70,0x6c,0x69,0x74])](_0x55e26a([0x2e]));return _0x87a09[_0x55e26a([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x563fcb=>_0x563fcb[_0x55e26a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x55e26a([0x2a])))[_0x55e26a([0x6d,0x61,0x70])](_0x3fa8a2=>_0x3fa8a2[_0x55e26a([0x73,0x70,0x6c,0x69,0x74])](_0x55e26a([0x2e])))[_0x55e26a([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x9428c2=>_0x9428c2[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x304346[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x55e26a([0x6d,0x61,0x70])](_0x3d84e4=>Array(_0x304346[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x3d84e4[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x55e26a([0x66,0x69,0x6c,0x6c])](_0x3d84e4[0x0]===_0x55e26a([0x2a])?_0x55e26a([0x2a]):'')[_0x55e26a([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x3d84e4))[_0x55e26a([0x73,0x6f,0x6d,0x65])](_0x39ef1f=>_0x304346[_0x55e26a([0x65,0x76,0x65,0x72,0x79])]((_0x1f2040,_0x2cd716)=>_0x39ef1f[_0x2cd716]===_0x1f2040||_0x39ef1f[_0x2cd716]===_0x55e26a([0x2a])));}function _0x5bcea6(){return _0x143674&&_0x4dcd1a?new window[(_0x55e26a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x126ede,_0x2cf3ad)=>{_0x143674[_0x55e26a([0x74,0x68,0x65,0x6e])](_0x126ede,_0x2cf3ad),_0x4dcd1a[_0x55e26a([0x74,0x68,0x65,0x6e])](_0x399a88=>{_0x399a88!=_0x55e26a([0x56,0x61,0x6c,0x69,0x64])&&_0x126ede(_0x399a88);},_0x2cf3ad);}):_0x143674||_0x4dcd1a||_0x55e26a([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3466b7(_0xe6eeb,_0x414542){return new window[(_0x55e26a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1fb590=>{if(_0x5bef84())return _0x1fb590(_0x55e26a([0x56,0x61,0x6c,0x69,0x64]));_0x2add32(),_0x485d07[_0x55e26a([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x55e26a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x9a2e28=!0x1;const _0x2a6e7d=_0x18bb56();function _0x2a0341(_0x3942c1){return!!_0x3942c1&&(typeof _0x3942c1===_0x55e26a([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3942c1===_0x55e26a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3942c1[_0x55e26a([0x74,0x68,0x65,0x6e])]===_0x55e26a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3942c1[_0x55e26a([0x63,0x61,0x74,0x63,0x68])]===_0x55e26a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x5720aa(_0x3c7360){_0x190a41(_0x3c7360)[_0x55e26a([0x74,0x68,0x65,0x6e])](_0x59ea22=>{if(!_0x59ea22||_0x59ea22[_0x55e26a([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x55e26a([0x6f,0x6b]))return _0x55e26a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x51364d(_0xa00c77(_0x2a6e7d+_0x414542))!=_0x59ea22[_0x55e26a([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x55e26a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x55e26a([0x56,0x61,0x6c,0x69,0x64]);})[_0x55e26a([0x74,0x68,0x65,0x6e])](_0x209a44=>(_0x48a3ab(),_0x209a44),()=>{const _0x3ef610=_0x5904aa();return null==_0x3ef610?(_0x48a3ab(),_0x55e26a([0x56,0x61,0x6c,0x69,0x64])):_0x55e26a(_0x1bfbf5-_0x3ef610>(0x1f1ea3d3^_0x2a53a6)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x55e26a([0x74,0x68,0x65,0x6e])](_0x1fb590)[_0x55e26a([0x63,0x61,0x74,0x63,0x68])](()=>{_0x1fb590(_0x55e26a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5a19d8=0x3b24c953^_0x2a53a6;function _0x48a3ab(){const _0x92747c=_0x55e26a([0x6c,0x6c,0x63,0x74,0x2d])+_0x51364d(_0xa00c77(_0xe6eeb)),_0x37b745=_0x376c4b(_0x51364d(window[_0x55e26a([0x4d,0x61,0x74,0x68])][_0x55e26a([0x63,0x65,0x69,0x6c])](_0x1bfbf5/_0x5a19d8)));window[_0x55e26a([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x55e26a([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x92747c,_0x37b745);}function _0x5904aa(){const _0x221526=_0x55e26a([0x6c,0x6c,0x63,0x74,0x2d])+_0x51364d(_0xa00c77(_0xe6eeb)),_0xc2767b=window[_0x55e26a([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x55e26a([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x221526);return _0xc2767b?window[_0x55e26a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x376c4b(_0xc2767b),0x10)*_0x5a19d8:null;}function _0x190a41(_0x155128){return new window[(_0x55e26a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5948b4,_0x511bb5)=>{_0x155128[_0x55e26a([0x74,0x68,0x65,0x6e])](_0x5948b4,_0x511bb5),window[_0x55e26a([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x511bb5,0x3b13f313^_0x2a53a6);});}}_0x485d07[_0x55e26a([0x6f,0x6e])](_0x55e26a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3ec76e,_0x34a517)=>{if(_0x34a517[0x0]!=_0xe6eeb)return _0x1fb590(_0x55e26a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x34a517[0x1]={..._0x34a517[0x1],[_0x55e26a([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2a6e7d};},{[_0x55e26a([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x55e26a([0x68,0x69,0x67,0x68])}),_0x485d07[_0x55e26a([0x6f,0x6e])](_0x55e26a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x53c38a=>{_0x2a0341(_0x53c38a[_0x55e26a([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x9a2e28=!0x0,_0x5720aa(_0x53c38a[_0x55e26a([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x55e26a([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x55e26a([0x6c,0x6f,0x77])}),_0x407e7f[_0x55e26a([0x74,0x68,0x65,0x6e])](()=>{_0x9a2e28||_0x1fb590(_0x55e26a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5bef84(){return _0x485d07[_0x55e26a([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x55e26a([0x76,0x69,0x65,0x77])][_0x55e26a([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x55e26a([0x61,0x75,0x74,0x6f]);}function _0x2add32(){_0x485d07[_0x55e26a([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x55e26a([0x76,0x69,0x65,0x77])][_0x55e26a([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x55e26a([0x61,0x75,0x74,0x6f]);}}function _0x176733(_0x1fafe7){const _0x1ae1c8=[new window[(_0x55e26a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x23a78d=>setTimeout(_0x23a78d,0x3b1b191f^_0x2a53a6)),_0x407e7f[_0x55e26a([0x74,0x68,0x65,0x6e])](()=>new window[(_0x55e26a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x778153=>{let _0x5b92db=0x0;_0x485d07[_0x55e26a([0x6d,0x6f,0x64,0x65,0x6c])][_0x55e26a([0x6f,0x6e])](_0x55e26a([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3440dd,_0x2eac9a)=>{_0x2eac9a[0x0][_0x55e26a([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x5b92db++,_0x5b92db==(0x3b12262b^_0x2a53a6)&&(_0x778153(),_0x3440dd[_0x55e26a([0x6f,0x66,0x66])]());});}))];return window[_0x55e26a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x55e26a([0x72,0x61,0x63,0x65])](_0x1ae1c8)[_0x55e26a([0x74,0x68,0x65,0x6e])](()=>_0x1fafe7);}async function _0x536847(){await _0x407e7f,_0x485d07[_0x55e26a([0x6d,0x6f,0x64,0x65,0x6c])][_0x55e26a([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1d600c,_0x485d07[_0x55e26a([0x6d,0x6f,0x64,0x65,0x6c])][_0x55e26a([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1d600c,_0x485d07[_0x55e26a([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x55e26a([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2b3bf0(_0x11b635){const _0x3645b0=_0x5c4d8a();_0x485d07[_0x3645b0]=_0x55e26a([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x11b635,_0x11b635!=_0x55e26a([0x56,0x61,0x6c,0x69,0x64])&&_0x536847();}function _0x5c4d8a(){const _0x49347b=window[_0x55e26a([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x55e26a([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x55e26a([0x6e,0x6f,0x77])]())[_0x55e26a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x55e26a([0x2e]),'');let _0x2bf4db=_0x55e26a([0x76]);for(let _0x4c2474=0x0;_0x4c2474<_0x49347b[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4c2474+=0x2){let _0xa83163=window[_0x55e26a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x49347b[_0x55e26a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4c2474,_0x4c2474+0x2));_0xa83163>=_0x137335[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0xa83163-=_0x137335[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x2bf4db+=_0x137335[_0xa83163];}return _0x2bf4db;}function _0x8676fd(){const _0x40a736=_0x1b1fcb[_0x55e26a([0x73,0x70,0x6c,0x69,0x74])](_0x55e26a([0x2e]));if(0x3!=_0x40a736[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x569087(_0x40a736[0x1]);function _0x569087(_0x577c4e){const _0x29fa8b=_0x31e440(_0x577c4e);return _0x29fa8b&&_0x581286()?_0x29fa8b:null;function _0x581286(){const _0x31b05b=_0x29fa8b[_0x55e26a([0x6a,0x74,0x69])],_0x1213b6=window[_0x55e26a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x31b05b[_0x55e26a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x31b05b[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x326996={..._0x29fa8b,[_0x55e26a([0x6a,0x74,0x69])]:_0x31b05b[_0x55e26a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x31b05b[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x326996[_0x55e26a([0x76,0x63])],_0xa00c77(_0x326996)==_0x1213b6;}}}async function _0x51409c(){let _0x35bcb9=!0x0;try{const _0x351a79=_0x1b1fcb[_0x55e26a([0x73,0x70,0x6c,0x69,0x74])](_0x55e26a([0x2e])),[_0x40ff7a,_0xa8518c,_0x5b6e9f]=_0x351a79;return _0x2de8e0(_0x40ff7a),await _0x3e1199(_0x40ff7a,_0xa8518c,_0x5b6e9f),_0x35bcb9;}catch{return!0x1;}function _0x2de8e0(_0x3599cd){const _0x225908=_0x31e440(_0x3599cd);_0x225908&&_0x225908[_0x55e26a([0x61,0x6c,0x67])]==_0x55e26a([0x45,0x53,0x32,0x35,0x36])||(_0x35bcb9=!0x1);}async function _0x3e1199(_0x3c3710,_0x2bd0e9,_0xb5937f){const _0x38a347=window[_0x55e26a([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x55e26a([0x66,0x72,0x6f,0x6d])](_0x5d681c(_0xb5937f),_0x308661=>_0x308661[_0x55e26a([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2f21f6=new window[(_0x55e26a([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x55e26a([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3c3710+_0x55e26a([0x2e])+_0x2bd0e9),_0x27da63=window[_0x55e26a([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x55e26a([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x27da63)return;const _0xc01ec5=await _0x27da63[_0x55e26a([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x55e26a([0x6a,0x77,0x6b]),_0x3e430d,{[_0x55e26a([0x6e,0x61,0x6d,0x65])]:_0x55e26a([0x45,0x43,0x44,0x53,0x41]),[_0x55e26a([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x55e26a([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x55e26a([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x27da63[_0x55e26a([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x55e26a([0x6e,0x61,0x6d,0x65])]:_0x55e26a([0x45,0x43,0x44,0x53,0x41]),[_0x55e26a([0x68,0x61,0x73,0x68])]:{[_0x55e26a([0x6e,0x61,0x6d,0x65])]:_0x55e26a([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0xc01ec5,_0x38a347,_0x2f21f6)||(_0x35bcb9=!0x1);}}function _0x31e440(_0x164fc7){return _0x164fc7[_0x55e26a([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x55e26a([0x65,0x79]))?JSON[_0x55e26a([0x70,0x61,0x72,0x73,0x65])](_0x5d681c(_0x164fc7)):null;}function _0x5d681c(_0x28ce31){return window[_0x55e26a([0x61,0x74,0x6f,0x62])](_0x28ce31[_0x55e26a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x55e26a([0x2b]))[_0x55e26a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x55e26a([0x2f])));}function _0xa00c77(_0x20da1a){let _0x2c0898=0x1505;function _0x5c9344(_0x5e2f43){for(let _0x2af896=0x0;_0x2af896<_0x5e2f43[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2af896++){const _0x4a431d=_0x5e2f43[_0x55e26a([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2af896);_0x2c0898=(_0x2c0898<<0x5)+_0x2c0898+_0x4a431d,_0x2c0898&=_0x2c0898;}}function _0x380d30(_0x45a6ff){Array[_0x55e26a([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x45a6ff)?_0x45a6ff[_0x55e26a([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x380d30):_0x45a6ff&&typeof _0x45a6ff==_0x55e26a([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x55e26a([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x45a6ff)[_0x55e26a([0x73,0x6f,0x72,0x74])]()[_0x55e26a([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x45fce0,_0x2d1838])=>{_0x5c9344(_0x45fce0),_0x380d30(_0x2d1838);}):_0x5c9344(window[_0x55e26a([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x45a6ff));}return _0x380d30(_0x20da1a),_0x2c0898>>>0x0;}function _0x51364d(_0x568d07){return _0x568d07[_0x55e26a([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x55e26a([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x55e26a([0x30]));}function _0x376c4b(_0x1999d1){return _0x1999d1[_0x55e26a([0x73,0x70,0x6c,0x69,0x74])]('')[_0x55e26a([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x55e26a([0x6a,0x6f,0x69,0x6e])]('');}function _0x1d600c(){}function _0x55e26a(_0x4e6e2d){return _0x4e6e2d['map'](_0x160843=>String['fromCharCode'](_0x160843))['join']('');}_0x2b3bf0(await _0x2d81c7());}(this);}['showFakeVisualSelection'](){const _0x2247c4=this['editor']['model'];_0x2247c4['change'](_0x3505df=>{const _0xf54cae=_0x2247c4['document']['selection']['getRanges']();let _0x111dce=0x0;for(const _0x455141 of _0xf54cae){const _0xfc5418=w+':'+_0x111dce;if(_0x2247c4['markers']['has'](_0xfc5418))_0x3505df['updateMarker'](_0xfc5418,{'range':_0x455141});else{if(_0x455141['start']['isAtEnd']){const _0x5d4d86=_0x455141['start']['getLastMatchingPosition'](({item:_0x15fbfe})=>!_0x2247c4['schema']['isContent'](_0x15fbfe),{'boundaries':_0x455141});_0x3505df['addMarker'](_0xfc5418,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3505df['createRange'](_0x5d4d86,_0x455141['end'])});}else _0x3505df['addMarker'](_0xfc5418,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x455141});}_0x111dce++;}});}['hideFakeVisualSelection'](){const _0x4af5f4=this['editor']['model'],_0x36963f=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x36963f['length']&&_0x4af5f4['change'](_0x5e5482=>{_0x36963f['forEach'](_0x2d91e9=>{_0x5e5482['removeMarker'](_0x2d91e9);});});}['insertContent'](_0x24430f,_0x2929b2){const _0x7c0f5f=this['_getAISelection'](),_0x1f6955=_0x2929b2||_0x7c0f5f['getFirstRange']();this['editor']['model']['canEditAt'](_0x1f6955)&&this['editor']['model']['change'](_0x4a659d=>{this['hideFakeVisualSelection'](),_0x2929b2||this['_resetContentOfSelectedTableCells'](_0x4a659d,_0x7c0f5f),this['_pasteHTMLUsingClipboard']({'insertAt':_0x1f6955,'writer':_0x4a659d,'html':_0x24430f});});}['insertContentBelow'](_0x5427d8){const {model:_0x79e2c5}=this['editor'],_0xc1a80a=this['_getAISelection']();_0x79e2c5['change'](()=>{const _0x69f430=this['_prepareTableInsertBelowPosition'](_0x5427d8,_0xc1a80a)||this['_getDefaultInsertBelowPosition'](_0xc1a80a);this['insertContent'](_0x5427d8,_0x69f430);});}['_getAISelection'](){const _0x4ba8d2=this['editor']['model'],_0x32c729=Array['from'](_0x4ba8d2['markers']['getMarkersGroup'](w))['map'](_0x502d8d=>_0x502d8d['getRange']());return _0x4ba8d2['createSelection'](_0x32c729);}['_pasteHTMLUsingClipboard']({writer:_0x54aa04,html:_0x5c9bbf,insertAt:_0x508517}){const {view:_0x115e39}=this['editor']['editing'],_0x328487=this['editor']['plugins']['get'](_0x5ba177),_0x4cdf3c=new gt();_0x4cdf3c['setData']('text/html',_0x5c9bbf);const _0x3fec94=new ClipboardEvent('paste',{'clipboardData':_0x4cdf3c}),_0x442867=new _0x59b8b3(_0x115e39,_0x3fec94,{'dataTransfer':new _0x5e080f(_0x4cdf3c)});_0x54aa04['setSelection'](_0x508517);const _0x43746d=(_0x3484b1,_0x32bf00)=>{_0x32bf00['resultRange']&&_0x54aa04['setSelection'](_0x32bf00['resultRange']);};_0x328487['once']('contentInsertion',_0x43746d,{'priority':'lowest'}),_0x115e39['document']['fire']('paste',_0x442867),_0x328487['off']('contentInsertion',_0x43746d);}['_getDefaultInsertBelowPosition'](_0x2754da){const {model:_0xf98576}=this['editor'],_0x4be280=Array['from'](_0x2754da['getSelectedBlocks']());return _0x4be280['length']?_0xf98576['createPositionAfter'](_0x4be280['pop']()):_0x2754da['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x294faf,_0x32d788){const {model:_0x53eb24,plugins:_0x3b2cdb}=this['editor'];if(_0x3b2cdb['has']('TableUtils')){const _0x487cfe=_0x3b2cdb['get']('TableUtils')['getSelectedTableCells'](_0x32d788);if(_0x487cfe['length']){const _0x3f5e57=this['_getTableRowCountFromContent'](_0x294faf),_0x674a1c=this['_createEmptyTableRows'](_0x487cfe,_0x3f5e57);return _0x53eb24['createPositionAt'](_0x674a1c,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3c6c9a){const _0x3d11fd=this['editor']['plugins']['get']('TableUtils'),_0x31f98c=this['editor']['data']['parse'](_0x3c6c9a),_0x23f214=Array['from'](_0x31f98c['getChildren']())['filter'](_0x59ad39=>_0x59ad39['is']('element','table'));let _0x5790d0=0x0;return _0x23f214['forEach'](_0xcdb176=>{_0x5790d0+=_0x3d11fd['getRows'](_0xcdb176);}),_0x5790d0;}['_createEmptyTableRows'](_0x5e7d4c,_0x39c75d){const _0x1c271c=this['editor']['plugins']['get']('TableUtils'),_0xd320ed=_0x1c271c['getRowIndexes'](_0x5e7d4c),_0x8ad03d=_0x1c271c['getColumnIndexes'](_0x5e7d4c),_0x39b339=_0xd320ed['last']+0x1,_0x8f3cca=_0x8ad03d['first'],_0x10999c=_0x5e7d4c[0x0]['findAncestor']('table');for(let _0x5e7365=0x0;_0x5e7365<_0x39c75d;_0x5e7365++)_0x1c271c['insertRows'](_0x10999c,{'at':_0x39b339});return _0x10999c['getChild'](_0x39b339)['getChild'](_0x8f3cca);}['_resetContentOfSelectedTableCells'](_0x3ba1cd,_0x2517e8){const {plugins:_0x19e811}=this['editor'],{model:_0x4dd3bd}=_0x3ba1cd;if(!_0x19e811['has']('TableUtils'))return;_0x19e811['get']('TableUtils')['getSelectedTableCells'](_0x2517e8)['length']&&_0x4dd3bd['deleteContent'](_0x2517e8);}}class x extends _0x500ecb{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x426b7a('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x4ec8a3){super(_0x4ec8a3),this['name']='AIRequestError';}}function i(_0x491d0d,_0x23b1a6,_0x462e67){const t=_0x491d0d['t'];switch(_0x23b1a6){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',_0x462e67);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x462e67);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'},_0x462e67);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 _0x23b1a6;}}class E extends _0xe2efa4{['_commandDefinitions'];constructor(_0x550cb5,_0x2b7a9f){super(_0x550cb5),this['_commandDefinitions']=_0x2b7a9f,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x465082,_0xb60674,_0xe64fd6)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0xe64fd6));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x5dbb96,_0x7cec37,_0x36e22e)=>{this['enabledCommandsIds']=_0x36e22e?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x739c45=this['editor']['model'];this['_hasContext']=function(_0x38d320){const _0x46e599=_0x38d320['document']['selection'];return _0x46e599['isCollapsed']?0x0!==[..._0x46e599['getSelectedBlocks']()]['length']&&![..._0x46e599['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x38d320['hasContent'](_0x46e599['getFirstRange']());}(_0x739c45);const _0x2f2787=_0x739c45['document']['selection'],_0x3699b9=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x250ecb of _0x2f2787['getRanges']())for(const _0x398a6a of _0x250ecb['getItems']())if(_0x398a6a['is']('element')&&_0x3699b9['includes'](_0x398a6a['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x1d50da='',_0x4d8ac3='',_0x240b71='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x1d50da,_0x4d8ac3,_0x240b71);}}function F(_0x10a1b1,_0x50ba8c){const _0x3c06f8=new Set();for(const _0x4a2338 of _0x10a1b1['values']())(_0x50ba8c||!0x1===_0x4a2338['requiresContent'])&&_0x3c06f8['add'](_0x4a2338['id']);return Array['from'](_0x3c06f8);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- _0x2f6b3e(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3be1e8,_0xdd22d,_0x443730){super(),this['editor']=_0x3be1e8,this['textAdapter']=_0xdd22d,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x443730,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x118454,_0x583608,_0x5da120)=>{this['view']['value']=this['_sanitizeHTML'](_0x5da120);}),this['listenTo'](this['view'],'submitPrompt',(_0x205417,_0x24a9ee)=>{const _0xecc8cf=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x24a9ee,_0xecc8cf,'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:_0x4158ca,query:_0x4bf5ee,htmlContent:_0x34efee,label:_0x563a29,mainActionLabel:_0x24bf61}){this['view']['prompt']=_0x563a29,this['view']['mainAction']=_0x24bf61,this['initialContext']=_0x34efee,_0x4bf5ee&&(this['view']['isRendered']?this['_handleQuery'](_0x4bf5ee,_0x34efee,_0x4158ca,_0x563a29):this['view']['once']('render',()=>{this['_handleQuery'](_0x4bf5ee,_0x34efee,_0x4158ca,_0x563a29);}));}['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'](_0x43c11f,_0x384d51,_0x1be41f,_0x10f4df){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x384d51,this['previousQuery']=_0x43c11f,this['previousLabel']=_0x10f4df||_0x43c11f,this['previousActionId']=_0x1be41f,new Promise(_0x45862e=>{this['textAdapter']['makeRequest']({'query':_0x43c11f,'context':_0x384d51,'onData':_0x50181e=>{this['currentResponse']=_0x50181e,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1be41f})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x2f58a6=>{_0x2f58a6 instanceof R?this['view']['handleError'](_0x2f58a6['message']):this['view']['handleError'](),_0x45862e();})['finally'](()=>{this['stopProcessing'](),_0x45862e();});});}['_parseAndNormalizeContent'](_0x11ad6e,_0x3910fa=!0x1){const _0x362fa2=Q['exec'](_0x11ad6e);_0x11ad6e=_0x362fa2?_0x11ad6e['substring'](_0x362fa2[0x1]['length']):_0x11ad6e['length']<0x64&&!_0x3910fa?'':this['_stripMarkdownSyntax'](_0x11ad6e);const _0x4960d3=this['_domParser']['parseFromString'](_0x11ad6e,'text/html');if(_0x362fa2){const _0x21af97=Array['from'](_0x4960d3['body']['childNodes']);_0x21af97['reverse']();for(const _0x22e2ae of _0x21af97){if(_0x22e2ae['nodeType']==Node['ELEMENT_NODE'])break;_0x22e2ae['remove']();}}const _0x12fad2=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x4960d3['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x12fad2);const _0x45f53b=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x44a083=this['editor']['data']['toModel'](_0x12fad2);return _0x45f53b||_0x44a083['markers']['clear'](),this['editor']['data']['stringify'](_0x44a083);}['_normalizeResponseHeadings'](_0x942935){const _0x1e5420=new _0x3a579f(this['editor']['editing']['view']['document']),_0x105aa7=new _0x3d57c4({'name':/^h[1-5]$/}),_0xfa5524=[];let _0x3a46cf=!0x1;for(const _0x3d41b8 of _0x942935)_0x3d41b8['is']('element')&&_0x105aa7['match'](_0x3d41b8)&&(_0xfa5524['push'](_0x3d41b8),'h1'==_0x3d41b8['name']&&(_0x3a46cf=!0x0));if(_0x3a46cf){for(const _0x54f6df of _0xfa5524)_0x1e5420['rename']('h'+(parseInt(_0x54f6df['name'][0x1])+0x1),_0x54f6df);}}['_isH1TagSupportEnabled'](){const {data:_0x2a51e1,editing:_0x45be87}=this['editor'],_0x46f94b=_0x2a51e1['htmlProcessor']['toView']('<h1></h1>'),_0x56d5ec=_0x2a51e1['toView'](_0x2a51e1['toModel'](_0x46f94b));return!!_0x45be87['view']['domConverter']['viewToDom'](_0x56d5ec)['querySelector']('h1');}['_sanitizeHTML'](_0x4a4c14){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4a4c14),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x43921b){const _0x12df4f=_0x43921b['trim']();return _0x12df4f['startsWith']('```html')?_0x12df4f['endsWith']('```')?_0x12df4f['substring'](0x7,_0x12df4f['length']-0x3):_0x12df4f['substring'](0x7):_0x43921b;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x5a83db){super(_0x5a83db),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x426cb7=>i(_0x5a83db,'AI_'+_0x426cb7['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x5a83db,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x5a83db,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x5a83db,'Stop'));const _0x1b209d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x1b209d['if']('isVisible','ck-hidden',_0x3be2db=>!_0x3be2db)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x488908,_0x53d8e6){const _0xcd3558=new _0x150283(this['locale']);return _0xcd3558['set']({'label':_0x488908,'class':_0x53d8e6||'','isVisible':!0x0,'withText':!0x0}),_0xcd3558;}}class ct extends _0x15a16a{['contentFieldView'];['copyButtonView'];constructor(_0x14637b,_0x5bfd61=''){super(_0x14637b),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x574496=this['bindTemplate'];this['contentFieldView']=new bt(_0x14637b,_0x5bfd61),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x574496['if']('isVisible','ck-hidden',_0x38b833=>!_0x38b833)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x574496['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 _0x2570c8=!0x1;this['on']('change:value',(_0x1215ff,_0x499f80,_0x49dec3)=>{const _0x5f1555=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x49dec3),this['isProcessing']&&_0x5f1555&&!_0x2570c8&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x53cb15,_0x2408b3,_0x3fe4c1)=>{_0x2570c8=!0x1,_0x3fe4c1?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x2570c8=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x2570c8=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x490a91=this['locale'],_0x55e001=new _0x150283(this['locale']),_0x2aa131='ck-ai-form__copy-button';return _0x55e001['set']({'label':i(_0x490a91,'Copy'),'icon':_0x143f04,'class':_0x2aa131,'tooltip':!0x0}),_0x55e001['bind']('isVisible')['to'](this,'value',_0x12d641=>!!_0x12d641),_0x55e001['bind']('isEnabled')['to'](this,'isProcessing',_0x44a30b=>!_0x44a30b),_0x55e001['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x55e001['icon']=_0x48de83,_0x55e001['class']=_0x2aa131+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x55e001['icon']=_0x143f04,_0x55e001['class']=_0x2aa131;},0x3e8);}),_0x55e001;}['_copyHTMLToClipboard'](_0x4b5a23){const {window:_0x40c09d,document:_0x3829f2}=_0x4288e3;if(_0x40c09d['ClipboardItem']){const {Blob:_0xc7b5b4,ClipboardItem:_0x2d8e9f}=_0x40c09d,_0x35100f=[new _0x2d8e9f({'text/html':new _0xc7b5b4([_0x4b5a23['innerHTML']],{'type':'text/html'}),'text/plain':new _0xc7b5b4([_0x4b5a23['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x35100f);}else{const _0x24397b=_0x3829f2['createElement']('div');_0x24397b['style']['position']='absolute',_0x24397b['style']['left']='-9999px',_0x24397b['innerHTML']='<span>[</span>'+_0x4b5a23['innerHTML']+'<span>]</span>',_0x3829f2['body']['appendChild'](_0x24397b);const _0x46ceee=_0x3829f2['createRange']();_0x46ceee['setStartAfter'](_0x24397b['firstElementChild']),_0x46ceee['setEndBefore'](_0x24397b['lastElementChild']);const _0x5abe71=_0x40c09d['getSelection']();_0x5abe71['removeAllRanges'](),_0x5abe71['addRange'](_0x46ceee),_0x3829f2['execCommand']('copy'),_0x24397b['remove']();}}}class bt extends _0x15a16a{constructor(_0x145a50,_0x308691=''){super(_0x145a50),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x308691,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2dcae1){this['element']['innerHTML']=_0x2dcae1;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x9dafb2=new _0x15a16a(),_0x470605=this['locale'],_0x1dc40f=new _0x41b4d8();return _0x1dc40f['isVisible']=!0x0,_0x9dafb2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1dc40f,{'text':i(_0x470605,'AI\x20is\x20writing...')}]}),_0x9dafb2['render'](),_0x9dafb2;}}class mt extends _0x15a16a{constructor(_0x521833,_0x66f33b=''){super(_0x521833);const _0x531b31=new _0x1dfc9c(),_0x2ed247=this['bindTemplate'];this['set']('text',_0x66f33b),_0x531b31['content']=_0x58f758,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x531b31,{'text':_0x2ed247['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4930ba,_0x2ce0ea){super(_0x4930ba,_0x2ce0ea),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',(_0x11c1db,_0x215c94)=>{_0x11c1db['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x215c94());});}['_createSubmitButton'](){const _0x36c1bf=new _0x150283(this['locale']),_0x2ac0d8=this['locale'];return _0x36c1bf['set']({'icon':it,'label':i(_0x2ac0d8,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x36c1bf['on']('execute',()=>{this['submit']();}),_0x36c1bf['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x8ab743,_0x327316)=>!_0x8ab743&&_0x327316),_0x36c1bf;}['_createShowHistoryButton'](){const _0xb60091=new _0x150283(this['locale']),_0x429658=this['resultsView'],_0x375ddf=this['locale'];_0xb60091['set']({'label':i(_0x375ddf,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0xb60091['bind']('isOn')['to'](_0x429658,'isVisible'),_0xb60091['bind']('isEnabled')['to'](this,'isEnabled'),_0xb60091['on']('execute',()=>{_0x429658['isVisible']=!_0x429658['isVisible'],_0x429658['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5cfe68=()=>{_0x4288e3['window']['requestAnimationFrame'](()=>{if(_0x9e8af8(this['element'])){const _0x2aa0e1=new _0x44b2b0(this['queryView']['fieldView']['element']),_0x79bc08=_0x2aa0e1['width'],_0xb3c67e='rtl'===_0x375ddf['uiLanguageDirection']?'left':'right';_0x2aa0e1['excludeScrollbarsAndBorders'](),_0xb60091['element']['style'][_0xb3c67e]=_0x79bc08-_0x2aa0e1['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5cfe68),this['on']('render',_0x5cfe68),_0xb60091;}['submit'](){const _0x94a68d=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x94a68d);}['focus'](_0x3de16b){-0x1===_0x3de16b?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x11c319){super(_0x11c319),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x11c319,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xda37ce=0x0;for(const _0x4fe8fe of this['items'])_0xda37ce+=_0x4fe8fe['items']['length'];return{'resultsCount':_0xda37ce,'totalItemsCount':_0xda37ce};}['_createClearHistoryButton'](){const _0x44380e=this['locale'],_0x368728=new _0x150283(this['locale']);return _0x368728['set']({'label':'('+i(_0x44380e,'Clear')+')','withText':!0x0}),_0x368728['on']('execute',()=>this['fire']('clearHistory')),_0x368728;}}class ut extends xt{constructor(_0x2799f6){super();const _0x2db931=new wt(),_0x7a7316=new _0x150283(this['locale'],_0x2db931);this['children']['add'](_0x7a7316),_0x7a7316['set']({'label':_0x2799f6['prompt'],'withText':!0x0}),_0x7a7316['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x2799f6['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x3634f3{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3da64c,_0x503264)=>{const _0x3c4243=os(_0x503264['prompt']);for(const _0x52fa62 of this)if(_0x52fa62!=_0x503264&&os(_0x52fa62['prompt'])===_0x3c4243){this['remove'](_0x52fa62);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x23167f=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x23167f));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x460913=>_0x460913)));}}function os(_0x5bdb69){return _0x5bdb69['toLowerCase']()['trim']();}class k extends _0x15a16a{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0xefc9a5,_0x152a75,_0x4e83d7=''){super(_0xefc9a5),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(_0xefc9a5),this['contentArea']=new ct(_0xefc9a5,_0x4e83d7),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 _0x39876e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x152a75],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x39876e['if']('isError','ck-hidden',_0xcd5e13=>!_0xcd5e13)]},'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'](_0x39c37f=0x1){-0x1===_0x39c37f?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 _0x100a6c=this['locale'],_0x14445a=new lt(_0x100a6c,{'queryView':{'label':i(_0x100a6c,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x100a6c,'Empty\x20history'),'secondary':i(_0x100a6c,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x14445a['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x292327,_0x357b83)=>_0x292327&&!_0x357b83),this['listenTo'](_0x14445a,'submit',(_0x23d9db,_0x2b02a9)=>{this['prompt']=_0x2b02a9;const _0x192830=ft(_0x2b02a9);this['fire']('submitPrompt',_0x192830),_0x2b02a9['trim']()&&this['_promptHistory']['add']({'prompt':_0x192830},0x0);},{'priority':'high'}),_0x14445a;}['_createHistoryView'](){const _0x308f1d=new pt(this['locale']);return _0x308f1d['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x308f1d['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x308f1d;}['_createToolbar'](){const _0x1ecff9=new at(this['locale']);return _0x1ecff9['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xc31c02,_0x501919,_0x188349)=>_0xc31c02&&!_0x501919&&!!_0x188349),_0x1ecff9['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1ecff9['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5a387b,_0x31b60e,_0x2809f8)=>_0x5a387b&&!_0x31b60e&&!!_0x2809f8),_0x1ecff9['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1ecff9['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x16fdbd,_0x455af2)=>_0x16fdbd&&!_0x455af2),_0x1ecff9['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1ecff9['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1ecff9['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1ecff9;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3472af=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x3472af,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0xdd2e76){const _0x55a751=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0xdd2e76||i(_0x55a751,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x500ecb{['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[_0x234e84,a,x,_0x195576];}constructor(_0x45ac76){super(_0x45ac76),_0x45ac76['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x45ac76['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x45ac76['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x45ac76['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x2a3eca}=this;this['_aiAdapter']=_0x2a3eca['plugins']['get'](x),this['_dialog']=_0x2a3eca['plugins']['get'](_0x195576),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x41ee2c=new E(_0x2a3eca,Array['from'](this['_commandDefinitions']['values']()));_0x2a3eca['commands']['add']('showAIAssistant',_0x41ee2c),_0x2a3eca['ui']['componentFactory']['add']('aiCommands',_0x171d2a=>{const _0x9e426f=_0x2d9384(_0x171d2a);return _0x9e426f['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x9e426f['buttonView']['set']({'label':i(_0x171d2a,'AI\x20Commands'),'icon':_0x1096ba,'tooltip':!0x0}),_0x9e426f['on']('execute',_0x5e2ec5=>this['_onExecute'](_0x5e2ec5['source']['id'])),_0x38e05d(_0x9e426f,_0x2a3eca['ui']['view']['body'],function(_0x11eb90){const _0x55d199=o(_0x11eb90['config']['get']('ai.aiAssistant.commands'),_0x11eb90['locale']),_0x127f31=U(_0x11eb90,_0x55d199)['filter'](_0x50ef59=>_0x50ef59['commands']['length']);if(0x1===_0x127f31['length'])return U(_0x11eb90,_0x127f31[0x0]['commands'])['map'](_0x5c3f63=>({'id':_0x5c3f63['id'],'label':_0x5c3f63['label']}));return _0x127f31['map'](_0x54b2d0=>{const {groupId:_0x5f75b0,groupLabel:_0x144fec,commands:_0x2d6396}=_0x54b2d0,_0x4e9a9d=U(_0x11eb90,_0x2d6396)['map'](_0x1ffe4c=>({'id':_0x1ffe4c['id'],'label':_0x1ffe4c['label']}));return{'id':_0x5f75b0,'menu':_0x144fec||_0x5f75b0,'children':_0x4e9a9d};});}(_0x2a3eca),{'ariaLabel':i(_0x171d2a,'AI\x20Commands')}),_0x9e426f['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x41ee2c['on']('change:enabledCommandsIds',_0x4c95b8),_0x9e426f['menuView']['once']('render',_0x4c95b8),_0x9e426f;function _0x4c95b8(){_0x9e426f['isEnabled']=_0x41ee2c['enabledCommandsIds']['length']>0x0;for(const _0x49c492 of _0x9e426f['menuView']['buttons'])_0x49c492['isEnabled']=_0x41ee2c['enabledCommandsIds']['includes'](_0x49c492['id']);}}),_0x2a3eca['ui']['componentFactory']['add']('menuBar:aiCommands',_0x332c68=>{const _0x43a2d2=new _0x5197c8(_0x332c68);_0x43a2d2['buttonView']['set']({'label':i(_0x332c68,'AI\x20Commands'),'icon':_0x1096ba}),_0x43a2d2['bind']('isEnabled')['to'](_0x41ee2c,'enabledCommandsIds',_0x2902ed=>_0x2902ed['length']>0x0);const _0x46dc6e=o(_0x2a3eca['config']['get']('ai.aiAssistant.commands'),_0x332c68);return this['_populateMenuBarMenu'](_0x41ee2c,_0x43a2d2,_0x46dc6e,_0x4982fe=>this['_onExecute'](_0x4982fe)),_0x43a2d2;}),_0x2a3eca['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x11b7d8=this['_createAIAssistantUIButton'](_0x150283);return _0x11b7d8['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x11b7d8;}),_0x2a3eca['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x8437ef=this['_createAIAssistantUIButton'](_0x1ceadf);return _0x8437ef['set']({'role':'menuitemcheckbox'}),_0x8437ef;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x872c7f=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x406cfd;for(const _0x313b3f in _0x872c7f){const _0x569769=_0x313b3f,_0x4de37e=_0x872c7f[_0x569769];if('aiLicenseKeyValid'==_0x4de37e||'aiLicenseKeyInvalid'==_0x4de37e||'aiLicenseKeyExpired'==_0x4de37e||'aiLicenseKeyDomainLimit'==_0x4de37e||'aiLicenseKeyNotAllowed'==_0x4de37e||'aiLicenseKeyEvaluationLimit'==_0x4de37e||'aiLicenseKeyTrialLimit'==_0x4de37e||'aiLicenseKeyUsageLimit'==_0x4de37e){delete _0x872c7f[_0x569769],_0x406cfd=_0x4de37e,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x406cfd&&_0x872c7f['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x406cfd&&_0x872c7f['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x406cfd&&_0x872c7f['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x406cfd&&_0x872c7f['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x406cfd&&_0x872c7f['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x406cfd&&_0x872c7f['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x406cfd&&_0x872c7f['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x307fb6='',_0x508efb='',_0x34197e='custom'){const _0x529889=this['editor'],_0x530a77=_0x529889['editing']['view'],_0x5a900e=_0x529889['plugins']['get'](a),_0x55bc32=_0x529889['plugins']['get'](_0x234e84);_0x5a900e['showFakeVisualSelection']();const _0xb4cc7b=new l(),_0x58d854=new ClipboardEvent('copy',{'clipboardData':_0xb4cc7b}),_0x38f47f=new _0x5e080f(_0xb4cc7b),_0x1ed567=new _0x59b8b3(_0x530a77,_0x58d854,{'dataTransfer':_0x38f47f});_0x55bc32['_forceMarkersCopy']('comment',()=>{_0x530a77['document']['fire']('copy',_0x1ed567);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x529889,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x59195b=_0x38f47f['getData']('text/html');const _0x4f3403=_0x529889['model']['document']['selection'],_0x1b6ee4=Array['from'](_0x4f3403['getRanges']());0x1===_0x1b6ee4['length']&&_0x1b6ee4[0x0]['isFlat']&&!_0x4f3403['getSelectedElement']()&&''!==_0x59195b['replace'](/&nbsp;/g,'')['trim']()&&(_0x59195b='<p>'+_0x59195b+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x34197e,'query':_0x307fb6,'htmlContent':_0x59195b,'label':_0x508efb,'mainActionLabel':_[_0x529889['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2b1820,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2500ec['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5a900e['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2a7334=new Map(),_0x4da985=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x21c136 of _0x4da985)for(const _0x5300b4 of _0x21c136['commands'])_0x2a7334['set'](_0x5300b4['id'],{..._0x5300b4,'groupId':_0x21c136['groupId'],'groupLabel':_0x21c136['groupLabel']||_0x21c136['groupId']});return _0x2a7334;}['_createAIAssistantUIButton'](_0x23fb6a){const _0x2f8b47=this['editor'],_0x56def0=_0x2f8b47['commands']['get']('showAIAssistant'),_0x295d45=new _0x23fb6a(_0x2f8b47['locale']);return _0x295d45['set']({'label':i(_0x2f8b47['locale'],'AI\x20Assistant'),'icon':_0x2b1820,'isToggleable':!0x0}),_0x295d45['bind']('isEnabled')['to'](_0x56def0),_0x295d45['bind']('isOn')['to'](this['_dialog'],'id',_0x3d882a=>'aiAssistant'===_0x3d882a),this['listenTo'](_0x295d45,'execute',()=>{_0x295d45['isOn']?this['hideUI']():_0x56def0['execute']();}),_0x295d45;}['_initView'](){const _0x376892=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',()=>{_0x376892['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x376892['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0xa911df,ui:{ariaLiveAnnouncer:_0x54c326}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0xb6b157,_0x5bfac5,_0x2cc5bf)=>{const _0x3f1504=this['_aiAssistantController']['currentContext'];_0x2cc5bf?_0x54c326['announce'](i(_0xa911df,'AI\x20is\x20writing')):_0x3f1504&&_0x54c326['announce'](i(_0xa911df,'Generated\x20content:\x20%0',_0x3f1504),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x431600,_0x2b1750,_0x171f85)=>{if(_0x171f85){const _0x451459=this['_formView']['errorView']['text'];_0x54c326['announce'](i(_0xa911df,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x451459));}});}['_onExecute'](_0x4aeced){const _0x1d7ce7=this['_commandDefinitions']['get'](_0x4aeced),_0x100524=this['editor'],_0x10c726=_0x100524['model']['document']['selection'],_0x498885=_0x100524['commands']['get']('showAIAssistant'),_0x444059=_0x100524['plugins']['get'](a),_0x5c667c=''+(_0x1d7ce7['groupId']!==K?_0x1d7ce7['groupLabel']+':\x20':'')+_0x1d7ce7['label'];if(!0x1!==_0x1d7ce7['requiresContent']&&_0x10c726['isCollapsed']){const _0x21099f=_0x44fea0(_0x10c726['getSelectedBlocks']())||_0x100524['model']['schema']['getLimitElement'](_0x10c726);_0x100524['model']['change'](_0xa42f1e=>{_0xa42f1e['setSelection'](_0x21099f,'in');});}_0x444059['showFakeVisualSelection'](),_0x498885['execute'](_0x1d7ce7['prompt'],_0x5c667c,'command:'+_0x4aeced);}['_populateMenuBarMenu'](_0x422bd0,_0xa4af9f,_0x240c92,_0x33f4fe){const _0x18843=this['editor'],_0x3782c7=_0x18843['locale'],_0x5462a5=new _0x2deade(_0x3782c7),_0x92ec87=U(_0x18843,_0x240c92)['filter'](_0x41ccec=>_0x41ccec['commands']['length']);0x1===_0x92ec87['length']?this['_getMenuBarGroupButtons']({'command':_0x422bd0,'commands':_0x92ec87[0x0]['commands'],'parentMenuView':_0xa4af9f,'onExecute':_0x33f4fe})['forEach'](_0x5eb705=>_0x5462a5['items']['add'](_0x5eb705)):_0x92ec87['forEach'](({groupId:_0x482cf3,groupLabel:_0x5884bf,commands:_0x38438e})=>{const _0x541872=new _0x5dfe0d(_0x3782c7,_0xa4af9f),_0x48c2af=new _0x5197c8(_0x3782c7),_0x210957=new _0x2deade(_0x3782c7),_0x31dac1=this['_getMenuBarGroupButtons']({'command':_0x422bd0,'commands':_0x38438e,'parentMenuView':_0x48c2af,'onExecute':_0x33f4fe});_0x48c2af['buttonView']['set']({'label':_0x5884bf||_0x482cf3}),_0x48c2af['delegate']('execute')['to'](_0xa4af9f),_0x210957['items']['addMany'](_0x31dac1),_0x48c2af['panelView']['children']['add'](_0x210957),_0x541872['children']['add'](_0x48c2af),_0x5462a5['items']['add'](_0x541872);}),_0xa4af9f['panelView']['children']['add'](_0x5462a5);}['_getMenuBarGroupButtons']({command:_0x3efd32,commands:_0x7bf2db,parentMenuView:_0x404802,onExecute:_0x503545}){const _0x296d32=this['editor'],_0x317d7b=_0x296d32['locale'];return U(_0x296d32,_0x7bf2db)['map'](_0x16554d=>{const _0x2d8955=new _0x5dfe0d(_0x317d7b,_0x404802),_0x6f117d=new _0x1ceadf(_0x317d7b);return _0x6f117d['set']({'label':_0x16554d['label']}),_0x6f117d['delegate']('execute')['to'](_0x404802),_0x6f117d['on']('execute',()=>_0x503545(_0x16554d['id'])),_0x6f117d['bind']('isEnabled')['to'](_0x3efd32,'enabledCommandsIds',_0x410bdc=>_0x410bdc['includes'](_0x16554d['id'])),_0x2d8955['children']['add'](_0x6f117d),_0x2d8955;});}}function T(_0xbf7384,_0x1ac520){return void 0x0!==_0xbf7384['order']&&void 0x0===_0x1ac520['order']?0x1:void 0x0===_0xbf7384['order']&&void 0x0!==_0x1ac520['order']?-0x1:void 0x0!==_0xbf7384['order']&&void 0x0!==_0x1ac520['order']?_0xbf7384['order']-_0x1ac520['order']:0x0;}function U(_0x520499,_0x2d052c){_0x2d052c['sort'](T);const _0x3c5fbc={},_0x256347=[];for(const _0x4e1c08 of _0x2d052c)if(void 0x0!==_0x4e1c08['order']){if(_0x4e1c08['order']in _0x3c5fbc)throw new _0x426b7a('ai-commands-config-order-collision',_0x520499,{'conflictingDefinitions':[_0x4e1c08,_0x3c5fbc[_0x4e1c08['order']]]});_0x3c5fbc[_0x4e1c08['order']]=_0x4e1c08,_0x256347['splice'](_0x4e1c08['order'],0x0,_0x4e1c08);}else _0x256347['push'](_0x4e1c08);return _0x256347;}class At extends _0x500ecb{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x10a131){super(_0x10a131);const _0x74807a=_0x10a131['config'],_0x525c89=_0x10a131['locale'];_0x74807a['define']('ai.aiAssistant.preserveComments',!0x0),_0x74807a['define']('ai.aiAssistant.commands',_t(_0x525c89)),_0x74807a['define']('ai.aiAssistant.extraCommandGroups',[]),_0x74807a['define']('ai.aiAssistant.removeCommands',[]);let _0x15320c=o(_0x74807a['get']('ai.aiAssistant.commands'),_0x525c89);const _0x1de914=_0x74807a['get']('ai.aiAssistant.extraCommandGroups'),_0x10bd2f=_0x74807a['get']('ai.aiAssistant.removeCommands');_0x1de914['forEach'](_0x54b99c=>{const _0x2ca01b=_0x15320c['find'](_0xc3069e=>_0xc3069e['groupId']===_0x54b99c['groupId']);_0x2ca01b?_0x2ca01b['commands']=_0x2ca01b['commands']['concat'](_0x54b99c['commands']):_0x15320c['push'](_0x54b99c);}),_0x15320c=_0x15320c['filter'](_0x220ffe=>!_0x10bd2f['includes'](_0x220ffe['groupId'])),_0x15320c['forEach'](_0x21c308=>{_0x21c308['commands']=_0x21c308['commands']['filter'](_0x585904=>!_0x10bd2f['includes'](_0x585904['id']));}),_0x74807a['set']('ai.aiAssistant.commands',_0x15320c);}}function _t(_0x48bfeb){return[{'groupId':'editOrReview','groupLabel':i(_0x48bfeb,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x48bfeb,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x48bfeb,'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(_0x48bfeb,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x48bfeb,'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(_0x48bfeb,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x48bfeb,'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(_0x48bfeb,'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(_0x48bfeb,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x48bfeb,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x48bfeb,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x48bfeb,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x48bfeb,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x48bfeb,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x48bfeb,'Change\x20style'),'commands':[{'id':'business','label':i(_0x48bfeb,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x48bfeb,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x48bfeb,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x48bfeb,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x48bfeb,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x48bfeb,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x48bfeb,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x48bfeb,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x48bfeb,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x48bfeb,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x48bfeb,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x48bfeb,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x48bfeb,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x500ecb{['abortController'];static get['requires'](){return[x];}constructor(_0x16e4b9){super(_0x16e4b9),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'](_0x1965f2){return this['sendRequest'](_0x1965f2)['catch'](_0x3644be=>{if(_0x3644be instanceof R)return Promise['reject'](_0x3644be);if('AbortError'==_0x3644be['name'])return Promise['resolve']();throw console['error'](_0x3644be),new _0x426b7a('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x4325b8,_0x4fb15e){const _0x3570de=this['editor']['locale'],_0x5b6eb2={'Content-Type':'application/json'};if('object'==typeof _0x4325b8)Object['assign'](_0x5b6eb2,_0x4325b8);else{if(_0x4325b8)try{const _0xb486ed=await _0x4325b8(_0x4fb15e);Object['assign'](_0x5b6eb2,_0xb486ed);}catch{return Promise['reject'](new R(i(_0x3570de,'AI_ERROR_GET_HEADERS')));}}return _0x5b6eb2;}async['_prepareRequestParameters'](_0x2d1cf5,_0x590f77){const _0x1ab59c=this['editor']['locale'];if('object'==typeof _0x2d1cf5)return _0x2d1cf5;try{return await _0x2d1cf5(_0x590f77);}catch{return Promise['reject'](new R(i(_0x1ab59c,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x35aa0d){super(_0x35aa0d),_0x35aa0d['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x35aa0d['config']['get']('ai.openAI.requestParameters')||_0x35aa0d['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x35aa0d['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x35aa0d['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x35aa0d['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x44fb01,context:_0x25960d,onData:_0x2db606,actionId:_0x4b47fd}){const _0x3ff1a3=this['editor']['locale'],_0x2df81e=await this['prepareMessages'](_0x44fb01,_0x25960d,_0x4b47fd),_0x28e80f=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4b47fd),_0x53a6a0=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4b47fd),_0x5b9343={'messages':_0x2df81e,..._0x53a6a0},_0x3313f6={'method':'POST','headers':_0x28e80f,'body':JSON['stringify'](_0x5b9343),'signal':this['abortController']['signal']},_0x2259d4=await fetch(this['_apiUrl'],_0x3313f6);if(_0x2259d4['ok'])return _0x53a6a0['stream']?await this['_readStreamableResponse'](_0x2259d4,_0x2db606):await this['_readStaticResponse'](_0x2259d4,_0x2db606),Promise['resolve']();{const _0x282d1f=await _0x2259d4['text']();return _0x282d1f['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x3ff1a3,'AI_ERROR_CONTEXT_LENGTH'))):_0x282d1f['includes']('Moderation')?Promise['reject'](new R(i(_0x3ff1a3,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x282d1f));}}async['prepareMessages'](_0x223225,_0xe8967,_0x1dca02){let _0x409dae,_0x28281e;return _0xe8967?(_0x409dae='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.',_0x28281e='Instruction:\x0a'+_0x223225+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xe8967):(_0x409dae='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.',_0x28281e=_0x223225),[{'role':'system','content':_0x409dae},{'role':'user','content':_0x28281e}];}async['_readStreamableResponse'](_0x55ea55,_0x5d0173){const _0x474060=_0x55ea55['body']['getReader'](),_0x364830=new TextDecoder();let _0x401385='',_0x3ee3='',_0x4cae1d='',_0x36b5c8=!0x1;for(;!_0x36b5c8;){const {done:_0x5c8b6c,value:_0xb3e1aa}=await _0x474060['read'](),_0x1b4148=_0x401385+_0x364830['decode'](_0xb3e1aa);let _0xfe94d0='';_0x36b5c8=_0x5c8b6c;try{_0xfe94d0=this['_cleanUpData'](_0x1b4148),_0x401385='';}catch{_0x401385=_0x1b4148;continue;}_0x3ee3+=_0xfe94d0,!_0x36b5c8&&this['_isBufferIncomplete'](_0x3ee3)||_0x3ee3&&(_0x4cae1d+=_0x3ee3,_0x3ee3='',_0x5d0173(_0x4cae1d));}return Promise['resolve']();}async['_readStaticResponse'](_0x140a38,_0x4895e3){return _0x4895e3((await _0x140a38['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4f6b37){const _0x6823b8=_0x4f6b37['split']('<')['length']!==_0x4f6b37['split']('>')['length'],_0x2daaaf=_0x4f6b37['length']<0x1e;return _0x6823b8&&_0x2daaaf;}['_cleanUpData'](_0xe7097f){return _0xe7097f['split'](/\n(?![^{]*\})/g)['map'](_0x3c1609=>_0x3c1609['replace']('data:\x20',''))['filter'](_0x2b26dd=>_0x2b26dd&&_0x2b26dd['length']>0x0&&'[DONE]'!==_0x2b26dd)['map'](_0x444ec0=>{const {choices:_0xb4ad36}=JSON['parse'](_0x444ec0);if(_0xb4ad36[0x0]?.['delta']?.['content'])return _0xb4ad36[0x0]['delta']['content'];})['filter'](_0x30ea1a=>_0x30ea1a)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x1c6bbb){super(_0x1c6bbb),_0x1c6bbb['config']['get']('ai.aws.requestParameters')||_0x1c6bbb['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']=_0x1c6bbb['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x1c6bbb['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x1c6bbb['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x1c6bbb['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x3e42a1,context:_0x5df2e2,onData:_0x1c120c,actionId:_0x1b3e67}){const {model:_0x283283,stream:_0x4232bd,..._0x49c10d}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1b3e67),_0x115056={'prompt':await this['preparePrompt'](_0x3e42a1,_0x5df2e2,_0x283283,_0x1b3e67),..._0x49c10d};this['_apiUrl']?await this['_processProxyRequest'](_0x115056,_0x283283,_0x4232bd,_0x1c120c,_0x1b3e67):await this['_processAWSRequest'](_0x115056,_0x283283,_0x4232bd,_0x1c120c);}async['preparePrompt'](_0x3c7cf3,_0x45b7ce,_0x11f5f8,_0x35989b){let _0x308580,_0x455d14;return _0x45b7ce?(_0x308580='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.',_0x455d14='Instruction:\x0a'+_0x3c7cf3+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x45b7ce):(_0x308580='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.',_0x455d14=_0x3c7cf3),'meta.llama'==this['getModelFamily'](_0x11f5f8)?'<<SYS>>\x0a'+_0x308580+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x455d14+'\x0a[/INST]':'Human:\x0a'+_0x308580+'\x0a'+_0x455d14+'\x0a\x0aAssistant:';}['getModelFamily'](_0x17e9e9){if(/^anthropic\.claude/['test'](_0x17e9e9))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x17e9e9))return'ai21.j2';if(/^cohere\.command/['test'](_0x17e9e9))return'cohere.command';if(/^meta\.llama/['test'](_0x17e9e9))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x17e9e9));}async['_processProxyRequest'](_0x3af74c,_0x4984e7,_0x30d265,_0x33ecd5,_0x5914c2){const _0x52900e={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5914c2),'body':JSON['stringify']({..._0x3af74c,'model':_0x4984e7,'stream':_0x30d265}),'signal':this['abortController']['signal']},_0x527e2e=await fetch(this['_apiUrl'],_0x52900e);_0x30d265?await this['_readStreamableResponse'](_0x527e2e,_0x4984e7,_0x33ecd5):await this['_readStaticResponse'](_0x527e2e,_0x4984e7,_0x33ecd5);}async['_processAWSRequest'](_0x5e4ad0,_0x5db2ed,_0x196ebd,_0xdc60b1){const _0x51128c=new _0x5d9c90(this['_bedrockClientConfig']),_0x5bd4cc={'body':JSON['stringify'](_0x5e4ad0),'contentType':'application/json','accept':'application/json','modelId':_0x5db2ed};let _0x2fb795;if(_0x196ebd){const _0x3c7b83=new _0xff26e(_0x5bd4cc);_0x2fb795=await _0x51128c['send'](_0x3c7b83,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x2fb795,_0x5db2ed,_0xdc60b1);}else{const _0x49dea0=new _0xaad2e(_0x5bd4cc);_0x2fb795=await _0x51128c['send'](_0x49dea0,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x2fb795,_0x5db2ed,_0xdc60b1);}}async['_readAsyncIterableResponse'](_0x1eef41,_0x50bebe,_0x53ed4e){const _0x39068a=_0x1eef41['body'],_0x3313fa=new TextDecoder('utf-8');let _0x7783ac='';for await(const _0x4e9fcc of _0x39068a)if(_0x4e9fcc['chunk']){const _0x391078=_0x3313fa['decode'](_0x4e9fcc['chunk']['bytes']),_0x5ae8b8=JSON['parse'](_0x391078);_0x7783ac+=this['_getGeneratedText'](_0x5ae8b8,_0x50bebe),_0x53ed4e(_0x7783ac);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4d9555,_0x4d85b0,_0x5a95a5){const _0x408ce0=_0x4d9555['body'],_0x93cb1a=new TextDecoder('utf-8'),_0x52f855=_0x408ce0['getReader']();let _0x4b54da='',_0x48c664='',_0x519d5a=!0x1;for(;!_0x519d5a;){const {done:_0x1f9c4e,value:_0x5de4b1}=await _0x52f855['read']();if(_0x519d5a=_0x1f9c4e,_0x519d5a)break;const _0x56d509=(_0x4b54da+_0x93cb1a['decode'](_0x5de4b1))['split']('\x0a')['map'](_0x4f0e5c=>{try{return _0x4b54da='',JSON['parse'](_0x4f0e5c);}catch{return _0x4b54da=_0x4f0e5c,null;}})['filter'](_0x5a0e0d=>null!==_0x5a0e0d);_0x56d509['length']&&(_0x48c664+=_0x56d509['map'](_0x568163=>this['_getGeneratedText'](_0x568163,_0x4d85b0))['join'](''),_0x5a95a5(_0x48c664));}return Promise['resolve']();}async['_readStaticResponse'](_0x49543e,_0xf4ba5c,_0x4a6f77){let _0x4a41a5;return _0x4a41a5=_0x49543e instanceof Response?await _0x49543e['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x49543e['body'])),(_0x4a6f77(this['_getGeneratedText'](_0x4a41a5,_0xf4ba5c)),Promise['resolve']());}['_getGeneratedText'](_0x1847a5,_0x11dae2){switch(this['getModelFamily'](_0x11dae2)){case'anthropic.claude':return _0x1847a5['completion'];case'ai21.j2':return _0x1847a5['completions'][0x0]['data']['text'];case'cohere.command':return _0x1847a5['generations'][0x0]['text'];case'meta.llama':return _0x1847a5['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 _0x47d13d,Command as _0x3bf151}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x530858,IconCheck as _0x534137,IconError as _0x3145a9,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x4edd52,IconRobotPencil as _0x2e4d83}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x348b23,CKEditorError as _0x18ef2b,ObservableMixin as _0x5733b6,global as _0x542910,isVisible as _0x159f09,Rect as _0x37fb03,Collection as _0x1b4047,FocusTracker as et,KeystrokeHandler as rt,first as _0x43afe3}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x2db44c,View as _0x3bf81d,SpinnerView as _0x392235,IconView as _0x33f119,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x3f999e,createDropdown as _0x4275aa,addMenuToDropdown as _0x10381b,MenuBarMenuView as _0x1c05d1,MenuBarMenuListItemButtonView as _0x4151ae,DialogViewPosition as _0x49324c,MenuBarMenuListView as _0x1a8d4b,MenuBarMenuListItemView as _0x2fef60}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x15d4b1,ClipboardMarkersUtils as _0xf4919e}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x26acc9,ViewDataTransfer as _0x144e81,ViewUpcastWriter as _0x5f329a,Matcher as _0x2033b0}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x2408c7,InvokeModelWithResponseStreamCommand as _0xd9b0cc,InvokeModelCommand as _0x314eda}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x2e81c2,_0x19ae3d){const _0x4d67b6=(0x0,_0x19ae3d['t'])('Other');return _0x2e81c2['length']?'groupId'in _0x2e81c2[0x0]?_0x2e81c2:[{'groupId':K,'groupLabel':_0x4d67b6,'order':0x1/0x0,'commands':_0x2e81c2}]:[{'groupId':K,'groupLabel':_0x4d67b6,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x47d13d{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x5bd745}=this,_0x392bc8=['ck-fake-ai-selection'];_0x5bd745['config']['get']('ai.useTheme')&&_0x392bc8['push']('ck-ai-assistant-ui_theme'),_0x5bd745['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x392bc8,'priority':0xc}}),_0x5bd745['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x4436c8,{writer:_0x15c347})=>{if(!_0x4436c8['markerRange']['isCollapsed'])return null;const _0x54b9a9=_0x15c347['createUIElement']('span');return _0x15c347['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x54b9a9),_0x54b9a9;}});}['afterInit'](){!async function(_0x34d262){const _0xf2afe3=_0x345c84([0x66,0x65,0x4b,0x59,0x55,0x32,0x51,0x56,0x30,0x53,0x6b,0x68,0x79,0x62,0x6d,0x54,0x69,0x74,0x48,0x4e,0x43,0x78,0x6f,0x4a,0x41,0x6e,0x4d,0x70,0x6c,0x38,0x36,0x4f,0x7a,0x75,0x52,0x39,0x5a,0x42,0x49,0x76,0x71,0x47,0x64,0x46,0x73,0x6a,0x4c,0x45,0x72,0x44,0x33,0x31,0x67,0x77,0x35,0x58,0x61,0x57,0x34,0x63,0x37,0x50]),_0x580cd7=0x33c1dbe7,_0x2438ba=0x33c6ab0f^_0x580cd7,_0x54492e=window[_0x345c84([0x44,0x61,0x74,0x65])][_0x345c84([0x6e,0x6f,0x77])](),_0x47018d=_0x34d262[_0x345c84([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x5b8a4d=new window[(_0x345c84([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xaf4973=>{_0x47018d[_0x345c84([0x6f,0x6e,0x63,0x65])](_0x345c84([0x72,0x65,0x61,0x64,0x79]),_0xaf4973);}),_0x2baaa3={[_0x345c84([0x6b,0x74,0x79])]:_0x345c84([0x45,0x43]),[_0x345c84([0x75,0x73,0x65])]:_0x345c84([0x73,0x69,0x67]),[_0x345c84([0x63,0x72,0x76])]:_0x345c84([0x50,0x2d,0x32,0x35,0x36]),[_0x345c84([0x78])]:_0x345c84([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]),[_0x345c84([0x79])]:_0x345c84([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]),[_0x345c84([0x61,0x6c,0x67])]:_0x345c84([0x45,0x53,0x32,0x35,0x36])},_0x55f19b=_0x47018d[_0x345c84([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x345c84([0x67,0x65,0x74])](_0x345c84([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x11a91d(){let _0x5756c1,_0x4fa052=null,_0x203893=null;try{if(_0x55f19b==_0x345c84([0x47,0x50,0x4c]))return _0x345c84([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5756c1=_0x421dcf(),!_0x5756c1)return _0x345c84([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5756c1[_0x345c84([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x203893=_0xfb08d(_0x5756c1[_0x345c84([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5756c1[_0x345c84([0x6a,0x74,0x69])])),await _0x471d3b()?_0x3ed39e()?_0x3e70d()?_0x345c84([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1bb930()?(_0x5756c1[_0x345c84([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x345c84([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4fa052=_0x54bfba(_0x345c84([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x5756c1[_0x345c84([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x345c84([0x74,0x72,0x69,0x61,0x6c])&&(_0x4fa052=_0x54bfba(_0x345c84([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0xcc2864()):_0x345c84([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x345c84([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x345c84([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x345c84([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3e70d(){const _0x5a998f=[_0x345c84([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x345c84([0x74,0x72,0x69,0x61,0x6c])][_0x345c84([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5756c1[_0x345c84([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x54492e/0x3e8:0xe10*_0x2438ba;return _0x5756c1[_0x345c84([0x65,0x78,0x70])]<_0x5a998f;}function _0x3ed39e(){const _0xf8c53f=_0x5756c1[_0x345c84([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0xf8c53f&&(!!_0xf8c53f[_0x345c84([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x345c84([0x2a]))||!!_0xf8c53f[_0x345c84([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x345c84([0x41,0x49])));}function _0x1bb930(){const _0x4fd776=_0x5756c1[_0x345c84([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4fd776||0x0==_0x4fd776[_0x345c84([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x229e64}=new URL(window[_0x345c84([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4fd776[_0x345c84([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x229e64))return!0x0;const _0x5c15a9=_0x229e64[_0x345c84([0x73,0x70,0x6c,0x69,0x74])](_0x345c84([0x2e]));return _0x4fd776[_0x345c84([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5a8b74=>_0x5a8b74[_0x345c84([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x345c84([0x2a])))[_0x345c84([0x6d,0x61,0x70])](_0x1607e6=>_0x1607e6[_0x345c84([0x73,0x70,0x6c,0x69,0x74])](_0x345c84([0x2e])))[_0x345c84([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x44e9f0=>_0x44e9f0[_0x345c84([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5c15a9[_0x345c84([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x345c84([0x6d,0x61,0x70])](_0x484c37=>Array(_0x5c15a9[_0x345c84([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x484c37[_0x345c84([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x345c84([0x66,0x69,0x6c,0x6c])](_0x484c37[0x0]===_0x345c84([0x2a])?_0x345c84([0x2a]):'')[_0x345c84([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x484c37))[_0x345c84([0x73,0x6f,0x6d,0x65])](_0x40846b=>_0x5c15a9[_0x345c84([0x65,0x76,0x65,0x72,0x79])]((_0x4c2ddd,_0x5f3c07)=>_0x40846b[_0x5f3c07]===_0x4c2ddd||_0x40846b[_0x5f3c07]===_0x345c84([0x2a])));}function _0xcc2864(){return _0x4fa052&&_0x203893?new window[(_0x345c84([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4117eb,_0x19d42e)=>{_0x4fa052[_0x345c84([0x74,0x68,0x65,0x6e])](_0x4117eb,_0x19d42e),_0x203893[_0x345c84([0x74,0x68,0x65,0x6e])](_0x19cfc4=>{_0x19cfc4!=_0x345c84([0x56,0x61,0x6c,0x69,0x64])&&_0x4117eb(_0x19cfc4);},_0x19d42e);}):_0x4fa052||_0x203893||_0x345c84([0x56,0x61,0x6c,0x69,0x64]);}}function _0xfb08d(_0x37a516,_0x3c6919){return new window[(_0x345c84([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x194dfc=>{if(_0x5bad1d())return _0x194dfc(_0x345c84([0x56,0x61,0x6c,0x69,0x64]));_0x4a3c97(),_0x47018d[_0x345c84([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x345c84([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x14d95c=!0x1;const _0x15315f=_0x348b23();function _0x245f81(_0x28f2b0){return!!_0x28f2b0&&(typeof _0x28f2b0===_0x345c84([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x28f2b0===_0x345c84([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x28f2b0[_0x345c84([0x74,0x68,0x65,0x6e])]===_0x345c84([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x28f2b0[_0x345c84([0x63,0x61,0x74,0x63,0x68])]===_0x345c84([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1f040f(_0x474ff5){_0x3f07d6(_0x474ff5)[_0x345c84([0x74,0x68,0x65,0x6e])](_0x24d527=>{if(!_0x24d527||_0x24d527[_0x345c84([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x345c84([0x6f,0x6b]))return _0x345c84([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x2160df(_0x3afe46(_0x15315f+_0x3c6919))!=_0x24d527[_0x345c84([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x345c84([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x345c84([0x56,0x61,0x6c,0x69,0x64]);})[_0x345c84([0x74,0x68,0x65,0x6e])](_0xee2b45=>(_0x3c9f82(),_0xee2b45),()=>{const _0x23dbe7=_0x4f37c0();return null==_0x23dbe7?(_0x3c9f82(),_0x345c84([0x56,0x61,0x6c,0x69,0x64])):_0x345c84(_0x54492e-_0x23dbe7>(0x17cd5fe7^_0x580cd7)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x345c84([0x74,0x68,0x65,0x6e])](_0x194dfc)[_0x345c84([0x63,0x61,0x74,0x63,0x68])](()=>{_0x194dfc(_0x345c84([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x3a87c9=0x33f73567^_0x580cd7;function _0x3c9f82(){const _0x17685e=_0x345c84([0x6c,0x6c,0x63,0x74,0x2d])+_0x2160df(_0x3afe46(_0x37a516)),_0x3a74da=_0x52741c(_0x2160df(window[_0x345c84([0x4d,0x61,0x74,0x68])][_0x345c84([0x63,0x65,0x69,0x6c])](_0x54492e/_0x3a87c9)));window[_0x345c84([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x345c84([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x17685e,_0x3a74da);}function _0x4f37c0(){const _0x41a753=_0x345c84([0x6c,0x6c,0x63,0x74,0x2d])+_0x2160df(_0x3afe46(_0x37a516)),_0x39409c=window[_0x345c84([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x345c84([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x41a753);return _0x39409c?window[_0x345c84([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x52741c(_0x39409c),0x10)*_0x3a87c9:null;}function _0x3f07d6(_0x16c22f){return new window[(_0x345c84([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4c1826,_0x2de2a1)=>{_0x16c22f[_0x345c84([0x74,0x68,0x65,0x6e])](_0x4c1826,_0x2de2a1),window[_0x345c84([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x2de2a1,0x33c00f27^_0x580cd7);});}}_0x47018d[_0x345c84([0x6f,0x6e])](_0x345c84([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x39271e,_0x4d1339)=>{if(_0x4d1339[0x0]!=_0x37a516)return _0x194dfc(_0x345c84([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x4d1339[0x1]={..._0x4d1339[0x1],[_0x345c84([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x15315f};},{[_0x345c84([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x345c84([0x68,0x69,0x67,0x68])}),_0x47018d[_0x345c84([0x6f,0x6e])](_0x345c84([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x24ac99=>{_0x245f81(_0x24ac99[_0x345c84([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x14d95c=!0x0,_0x1f040f(_0x24ac99[_0x345c84([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x345c84([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x345c84([0x6c,0x6f,0x77])}),_0x5b8a4d[_0x345c84([0x74,0x68,0x65,0x6e])](()=>{_0x14d95c||_0x194dfc(_0x345c84([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5bad1d(){return _0x47018d[_0x345c84([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x345c84([0x76,0x69,0x65,0x77])][_0x345c84([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x345c84([0x61,0x75,0x74,0x6f]);}function _0x4a3c97(){_0x47018d[_0x345c84([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x345c84([0x76,0x69,0x65,0x77])][_0x345c84([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x345c84([0x61,0x75,0x74,0x6f]);}}function _0x54bfba(_0x7d7075){const _0x3b3e43=[new window[(_0x345c84([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3b785d=>setTimeout(_0x3b785d,0x33c8e52b^_0x580cd7)),_0x5b8a4d[_0x345c84([0x74,0x68,0x65,0x6e])](()=>new window[(_0x345c84([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1918e3=>{let _0x37a987=0x0;_0x47018d[_0x345c84([0x6d,0x6f,0x64,0x65,0x6c])][_0x345c84([0x6f,0x6e])](_0x345c84([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x292aad,_0x4c15d7)=>{_0x4c15d7[0x0][_0x345c84([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x37a987++,_0x37a987==(0x33c1da1f^_0x580cd7)&&(_0x1918e3(),_0x292aad[_0x345c84([0x6f,0x66,0x66])]());});}))];return window[_0x345c84([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x345c84([0x72,0x61,0x63,0x65])](_0x3b3e43)[_0x345c84([0x74,0x68,0x65,0x6e])](()=>_0x7d7075);}async function _0x5cc168(){await _0x5b8a4d,_0x47018d[_0x345c84([0x6d,0x6f,0x64,0x65,0x6c])][_0x345c84([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x47f4cd,_0x47018d[_0x345c84([0x6d,0x6f,0x64,0x65,0x6c])][_0x345c84([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x47f4cd,_0x47018d[_0x345c84([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x345c84([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x168970(_0x58ddec){const _0x4cfe4e=_0x308144();_0x47018d[_0x4cfe4e]=_0x345c84([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x58ddec,_0x58ddec!=_0x345c84([0x56,0x61,0x6c,0x69,0x64])&&_0x5cc168();}function _0x308144(){const _0x151a46=window[_0x345c84([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x345c84([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x345c84([0x6e,0x6f,0x77])]())[_0x345c84([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x345c84([0x2e]),'');let _0x5c9771=_0x345c84([0x66]);for(let _0x3d3f24=0x0;_0x3d3f24<_0x151a46[_0x345c84([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3d3f24+=0x2){let _0x9f6b68=window[_0x345c84([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x151a46[_0x345c84([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3d3f24,_0x3d3f24+0x2));_0x9f6b68>=_0xf2afe3[_0x345c84([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x9f6b68-=_0xf2afe3[_0x345c84([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x5c9771+=_0xf2afe3[_0x9f6b68];}return _0x5c9771;}function _0x421dcf(){const _0x6a025f=_0x55f19b[_0x345c84([0x73,0x70,0x6c,0x69,0x74])](_0x345c84([0x2e]));if(0x3!=_0x6a025f[_0x345c84([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1c6731(_0x6a025f[0x1]);function _0x1c6731(_0x56949a){const _0x1d693e=_0x44c197(_0x56949a);return _0x1d693e&&_0x9b6401()?_0x1d693e:null;function _0x9b6401(){const _0x3c5343=_0x1d693e[_0x345c84([0x6a,0x74,0x69])],_0x3fa3b8=window[_0x345c84([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3c5343[_0x345c84([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3c5343[_0x345c84([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x5e97d2={..._0x1d693e,[_0x345c84([0x6a,0x74,0x69])]:_0x3c5343[_0x345c84([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3c5343[_0x345c84([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x5e97d2[_0x345c84([0x76,0x63])],_0x3afe46(_0x5e97d2)==_0x3fa3b8;}}}async function _0x471d3b(){let _0x4be859=!0x0;try{const _0x5ce912=_0x55f19b[_0x345c84([0x73,0x70,0x6c,0x69,0x74])](_0x345c84([0x2e])),[_0x1cae5b,_0x51339b,_0x3dca58]=_0x5ce912;return _0x586185(_0x1cae5b),await _0x4190a5(_0x1cae5b,_0x51339b,_0x3dca58),_0x4be859;}catch{return!0x1;}function _0x586185(_0x513d90){const _0x466b07=_0x44c197(_0x513d90);_0x466b07&&_0x466b07[_0x345c84([0x61,0x6c,0x67])]==_0x345c84([0x45,0x53,0x32,0x35,0x36])||(_0x4be859=!0x1);}async function _0x4190a5(_0x4f9714,_0x54c855,_0x22a6d9){const _0x49159d=window[_0x345c84([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x345c84([0x66,0x72,0x6f,0x6d])](_0x3a6ff0(_0x22a6d9),_0x4ec997=>_0x4ec997[_0x345c84([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x36aa78=new window[(_0x345c84([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x345c84([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4f9714+_0x345c84([0x2e])+_0x54c855),_0x1d72a7=window[_0x345c84([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x345c84([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1d72a7)return;const _0x23a362=await _0x1d72a7[_0x345c84([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x345c84([0x6a,0x77,0x6b]),_0x2baaa3,{[_0x345c84([0x6e,0x61,0x6d,0x65])]:_0x345c84([0x45,0x43,0x44,0x53,0x41]),[_0x345c84([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x345c84([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x345c84([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1d72a7[_0x345c84([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x345c84([0x6e,0x61,0x6d,0x65])]:_0x345c84([0x45,0x43,0x44,0x53,0x41]),[_0x345c84([0x68,0x61,0x73,0x68])]:{[_0x345c84([0x6e,0x61,0x6d,0x65])]:_0x345c84([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x23a362,_0x49159d,_0x36aa78)||(_0x4be859=!0x1);}}function _0x44c197(_0x47cf8d){return _0x47cf8d[_0x345c84([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x345c84([0x65,0x79]))?JSON[_0x345c84([0x70,0x61,0x72,0x73,0x65])](_0x3a6ff0(_0x47cf8d)):null;}function _0x3a6ff0(_0x32c747){return window[_0x345c84([0x61,0x74,0x6f,0x62])](_0x32c747[_0x345c84([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x345c84([0x2b]))[_0x345c84([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x345c84([0x2f])));}function _0x3afe46(_0x271c48){let _0x5e994e=0x1505;function _0xe4d4ce(_0x363b02){for(let _0x4a38e9=0x0;_0x4a38e9<_0x363b02[_0x345c84([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4a38e9++){const _0x50f23d=_0x363b02[_0x345c84([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4a38e9);_0x5e994e=(_0x5e994e<<0x5)+_0x5e994e+_0x50f23d,_0x5e994e&=_0x5e994e;}}function _0x4fd3d6(_0x15cadf){Array[_0x345c84([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x15cadf)?_0x15cadf[_0x345c84([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x4fd3d6):_0x15cadf&&typeof _0x15cadf==_0x345c84([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x345c84([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x15cadf)[_0x345c84([0x73,0x6f,0x72,0x74])]()[_0x345c84([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x16b478,_0x493e37])=>{_0xe4d4ce(_0x16b478),_0x4fd3d6(_0x493e37);}):_0xe4d4ce(window[_0x345c84([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x15cadf));}return _0x4fd3d6(_0x271c48),_0x5e994e>>>0x0;}function _0x2160df(_0x52daa9){return _0x52daa9[_0x345c84([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x345c84([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x345c84([0x30]));}function _0x52741c(_0x4798cd){return _0x4798cd[_0x345c84([0x73,0x70,0x6c,0x69,0x74])]('')[_0x345c84([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x345c84([0x6a,0x6f,0x69,0x6e])]('');}function _0x47f4cd(){}function _0x345c84(_0x20553b){return _0x20553b['map'](_0x4b3221=>String['fromCharCode'](_0x4b3221))['join']('');}_0x168970(await _0x11a91d());}(this);}['showFakeVisualSelection'](){const _0x3fcf64=this['editor']['model'];_0x3fcf64['change'](_0x57a904=>{const _0x4e7b87=_0x3fcf64['document']['selection']['getRanges']();let _0x4ea240=0x0;for(const _0x90538d of _0x4e7b87){const _0x36e3ae=w+':'+_0x4ea240;if(_0x3fcf64['markers']['has'](_0x36e3ae))_0x57a904['updateMarker'](_0x36e3ae,{'range':_0x90538d});else{if(_0x90538d['start']['isAtEnd']){const _0x25820c=_0x90538d['start']['getLastMatchingPosition'](({item:_0x3b4c1f})=>!_0x3fcf64['schema']['isContent'](_0x3b4c1f),{'boundaries':_0x90538d});_0x57a904['addMarker'](_0x36e3ae,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x57a904['createRange'](_0x25820c,_0x90538d['end'])});}else _0x57a904['addMarker'](_0x36e3ae,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x90538d});}_0x4ea240++;}});}['hideFakeVisualSelection'](){const _0x339a9e=this['editor']['model'],_0x3e58e8=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x3e58e8['length']&&_0x339a9e['change'](_0x49bbc1=>{_0x3e58e8['forEach'](_0x2ee2a1=>{_0x49bbc1['removeMarker'](_0x2ee2a1);});});}['insertContent'](_0x58e362,_0x3cddd0){const _0x4d807b=this['_getAISelection'](),_0x575c02=_0x3cddd0||_0x4d807b['getFirstRange']();this['editor']['model']['canEditAt'](_0x575c02)&&this['editor']['model']['change'](_0x4fb047=>{this['hideFakeVisualSelection'](),_0x3cddd0||this['_resetContentOfSelectedTableCells'](_0x4fb047,_0x4d807b),this['_pasteHTMLUsingClipboard']({'insertAt':_0x575c02,'writer':_0x4fb047,'html':_0x58e362});});}['insertContentBelow'](_0x524972){const {model:_0x401d60}=this['editor'],_0x5dc94c=this['_getAISelection']();_0x401d60['change'](()=>{const _0x5b6d4a=this['_prepareTableInsertBelowPosition'](_0x524972,_0x5dc94c)||this['_getDefaultInsertBelowPosition'](_0x5dc94c);this['insertContent'](_0x524972,_0x5b6d4a);});}['_getAISelection'](){const _0x57a452=this['editor']['model'],_0x32df2a=Array['from'](_0x57a452['markers']['getMarkersGroup'](w))['map'](_0x4c8d0a=>_0x4c8d0a['getRange']());return _0x57a452['createSelection'](_0x32df2a);}['_pasteHTMLUsingClipboard']({writer:_0x509d79,html:_0x114d77,insertAt:_0xa176a4}){const {view:_0x4e8998}=this['editor']['editing'],_0x53af04=this['editor']['plugins']['get'](_0x15d4b1),_0x5557e9=new gt();_0x5557e9['setData']('text/html',_0x114d77);const _0x489d12=new ClipboardEvent('paste',{'clipboardData':_0x5557e9}),_0x28f3d1=new _0x26acc9(_0x4e8998,_0x489d12,{'dataTransfer':new _0x144e81(_0x5557e9)});_0x509d79['setSelection'](_0xa176a4);const _0x1c193f=(_0x579915,_0x2c9b1a)=>{_0x2c9b1a['resultRange']&&_0x509d79['setSelection'](_0x2c9b1a['resultRange']);};_0x53af04['once']('contentInsertion',_0x1c193f,{'priority':'lowest'}),_0x4e8998['document']['fire']('paste',_0x28f3d1),_0x53af04['off']('contentInsertion',_0x1c193f);}['_getDefaultInsertBelowPosition'](_0x210337){const {model:_0x4d6dda}=this['editor'],_0x4748ee=Array['from'](_0x210337['getSelectedBlocks']());return _0x4748ee['length']?_0x4d6dda['createPositionAfter'](_0x4748ee['pop']()):_0x210337['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x6a499b,_0x26ba02){const {model:_0x47490c,plugins:_0x10b293}=this['editor'];if(_0x10b293['has']('TableUtils')){const _0x2137ec=_0x10b293['get']('TableUtils')['getSelectedTableCells'](_0x26ba02);if(_0x2137ec['length']){const _0x4cbf10=this['_getTableRowCountFromContent'](_0x6a499b),_0x121419=this['_createEmptyTableRows'](_0x2137ec,_0x4cbf10);return _0x47490c['createPositionAt'](_0x121419,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1031cf){const _0x4a36cb=this['editor']['plugins']['get']('TableUtils'),_0x58a1fa=this['editor']['data']['parse'](_0x1031cf),_0x20bc87=Array['from'](_0x58a1fa['getChildren']())['filter'](_0x212551=>_0x212551['is']('element','table'));let _0xb74bad=0x0;return _0x20bc87['forEach'](_0x50e3e4=>{_0xb74bad+=_0x4a36cb['getRows'](_0x50e3e4);}),_0xb74bad;}['_createEmptyTableRows'](_0x17cfb6,_0x42e1a6){const _0x4db717=this['editor']['plugins']['get']('TableUtils'),_0x368f42=_0x4db717['getRowIndexes'](_0x17cfb6),_0x2d409c=_0x4db717['getColumnIndexes'](_0x17cfb6),_0x5f4ca4=_0x368f42['last']+0x1,_0x3d900a=_0x2d409c['first'],_0x494abb=_0x17cfb6[0x0]['findAncestor']('table');for(let _0x3c4b35=0x0;_0x3c4b35<_0x42e1a6;_0x3c4b35++)_0x4db717['insertRows'](_0x494abb,{'at':_0x5f4ca4});return _0x494abb['getChild'](_0x5f4ca4)['getChild'](_0x3d900a);}['_resetContentOfSelectedTableCells'](_0x2ed9ed,_0x4a09ae){const {plugins:_0x28765c}=this['editor'],{model:_0x38a352}=_0x2ed9ed;if(!_0x28765c['has']('TableUtils'))return;_0x28765c['get']('TableUtils')['getSelectedTableCells'](_0x4a09ae)['length']&&_0x38a352['deleteContent'](_0x4a09ae);}}class x extends _0x47d13d{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x18ef2b('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x5e3a9a){super(_0x5e3a9a),this['name']='AIRequestError';}}function i(_0x28a876,_0x3e476b,_0x1a815e){const t=_0x28a876['t'];switch(_0x3e476b){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',_0x1a815e);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1a815e);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'},_0x1a815e);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 _0x3e476b;}}class E extends _0x3bf151{['_commandDefinitions'];constructor(_0x4d8453,_0x542ccf){super(_0x4d8453),this['_commandDefinitions']=_0x542ccf,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3a076d,_0x884e49,_0x36c5da)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x36c5da));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x444a9e,_0x48fa48,_0x68595a)=>{this['enabledCommandsIds']=_0x68595a?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x250519=this['editor']['model'];this['_hasContext']=function(_0x11fcb8){const _0x59945f=_0x11fcb8['document']['selection'];return _0x59945f['isCollapsed']?0x0!==[..._0x59945f['getSelectedBlocks']()]['length']&&![..._0x59945f['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x11fcb8['hasContent'](_0x59945f['getFirstRange']());}(_0x250519);const _0x58f7fc=_0x250519['document']['selection'],_0xf82f9f=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x555624 of _0x58f7fc['getRanges']())for(const _0x502df4 of _0x555624['getItems']())if(_0x502df4['is']('element')&&_0xf82f9f['includes'](_0x502df4['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x23ce6a='',_0x1c0fc9='',_0x3c3247='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x23ce6a,_0x1c0fc9,_0x3c3247);}}function F(_0x12fc60,_0x2a605e){const _0x1331c2=new Set();for(const _0x1aa942 of _0x12fc60['values']())(_0x2a605e||!0x1===_0x1aa942['requiresContent'])&&_0x1331c2['add'](_0x1aa942['id']);return Array['from'](_0x1331c2);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ _0x5733b6(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x9f9e47,_0x5c27d5,_0x4bc4b7){super(),this['editor']=_0x9f9e47,this['textAdapter']=_0x5c27d5,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x4bc4b7,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x10d24f,_0x29f8a5,_0x89052f)=>{this['view']['value']=this['_sanitizeHTML'](_0x89052f);}),this['listenTo'](this['view'],'submitPrompt',(_0x3a3208,_0x396377)=>{const _0x287faa=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x396377,_0x287faa,'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:_0x56bc16,query:_0x3af559,htmlContent:_0xb86881,label:_0x1af13b,mainActionLabel:_0xfcb28e}){this['view']['prompt']=_0x1af13b,this['view']['mainAction']=_0xfcb28e,this['initialContext']=_0xb86881,_0x3af559&&(this['view']['isRendered']?this['_handleQuery'](_0x3af559,_0xb86881,_0x56bc16,_0x1af13b):this['view']['once']('render',()=>{this['_handleQuery'](_0x3af559,_0xb86881,_0x56bc16,_0x1af13b);}));}['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'](_0x477ab4,_0x1b0461,_0x4e3d88,_0x432e88){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x1b0461,this['previousQuery']=_0x477ab4,this['previousLabel']=_0x432e88||_0x477ab4,this['previousActionId']=_0x4e3d88,new Promise(_0x34caef=>{this['textAdapter']['makeRequest']({'query':_0x477ab4,'context':_0x1b0461,'onData':_0xdd68b7=>{this['currentResponse']=_0xdd68b7,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4e3d88})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x542a07=>{_0x542a07 instanceof R?this['view']['handleError'](_0x542a07['message']):this['view']['handleError'](),_0x34caef();})['finally'](()=>{this['stopProcessing'](),_0x34caef();});});}['_parseAndNormalizeContent'](_0x4948f0,_0x6a2ba0=!0x1){const _0x8c02aa=Q['exec'](_0x4948f0);_0x4948f0=_0x8c02aa?_0x4948f0['substring'](_0x8c02aa[0x1]['length']):_0x4948f0['length']<0x64&&!_0x6a2ba0?'':this['_stripMarkdownSyntax'](_0x4948f0);const _0xd5b2ce=this['_domParser']['parseFromString'](_0x4948f0,'text/html');if(_0x8c02aa){const _0x2a87cd=Array['from'](_0xd5b2ce['body']['childNodes']);_0x2a87cd['reverse']();for(const _0x11215c of _0x2a87cd){if(_0x11215c['nodeType']==Node['ELEMENT_NODE'])break;_0x11215c['remove']();}}const _0x403f13=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xd5b2ce['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x403f13);const _0x5dafbc=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x2cfdf7=this['editor']['data']['toModel'](_0x403f13);return _0x5dafbc||_0x2cfdf7['markers']['clear'](),this['editor']['data']['stringify'](_0x2cfdf7);}['_normalizeResponseHeadings'](_0x1423e9){const _0x50f78e=new _0x5f329a(this['editor']['editing']['view']['document']),_0x4d13be=new _0x2033b0({'name':/^h[1-5]$/}),_0x5ed474=[];let _0x5aa951=!0x1;for(const _0x1e1fde of _0x1423e9)_0x1e1fde['is']('element')&&_0x4d13be['match'](_0x1e1fde)&&(_0x5ed474['push'](_0x1e1fde),'h1'==_0x1e1fde['name']&&(_0x5aa951=!0x0));if(_0x5aa951){for(const _0x574c1b of _0x5ed474)_0x50f78e['rename']('h'+(parseInt(_0x574c1b['name'][0x1])+0x1),_0x574c1b);}}['_isH1TagSupportEnabled'](){const {data:_0x56959d,editing:_0xf36f55}=this['editor'],_0x4dd071=_0x56959d['htmlProcessor']['toView']('<h1></h1>'),_0x7cbf27=_0x56959d['toView'](_0x56959d['toModel'](_0x4dd071));return!!_0xf36f55['view']['domConverter']['viewToDom'](_0x7cbf27)['querySelector']('h1');}['_sanitizeHTML'](_0x5cd6a1){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x5cd6a1),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0xc40564){const _0x16cd32=_0xc40564['trim']();return _0x16cd32['startsWith']('```html')?_0x16cd32['endsWith']('```')?_0x16cd32['substring'](0x7,_0x16cd32['length']-0x3):_0x16cd32['substring'](0x7):_0xc40564;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x1276bf){super(_0x1276bf),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1d0c4c=>i(_0x1276bf,'AI_'+_0x1d0c4c['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x1276bf,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x1276bf,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x1276bf,'Stop'));const _0x12a2ff=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x12a2ff['if']('isVisible','ck-hidden',_0x37f466=>!_0x37f466)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x5797bd,_0xea3c51){const _0x233539=new _0x2db44c(this['locale']);return _0x233539['set']({'label':_0x5797bd,'class':_0xea3c51||'','isVisible':!0x0,'withText':!0x0}),_0x233539;}}class ct extends _0x3bf81d{['contentFieldView'];['copyButtonView'];constructor(_0x1846b7,_0x48a81b=''){super(_0x1846b7),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x40961c=this['bindTemplate'];this['contentFieldView']=new bt(_0x1846b7,_0x48a81b),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x40961c['if']('isVisible','ck-hidden',_0x15e0b6=>!_0x15e0b6)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x40961c['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 _0x1bf28d=!0x1;this['on']('change:value',(_0x1d8438,_0x42502b,_0x13c0ec)=>{const _0x53a1c7=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x13c0ec),this['isProcessing']&&_0x53a1c7&&!_0x1bf28d&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x40439e,_0x54b99d,_0x2a63f3)=>{_0x1bf28d=!0x1,_0x2a63f3?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1bf28d=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1bf28d=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x3bd525=this['locale'],_0x146f7d=new _0x2db44c(this['locale']),_0x12a07c='ck-ai-form__copy-button';return _0x146f7d['set']({'label':i(_0x3bd525,'Copy'),'icon':_0x530858,'class':_0x12a07c,'tooltip':!0x0}),_0x146f7d['bind']('isVisible')['to'](this,'value',_0x516b52=>!!_0x516b52),_0x146f7d['bind']('isEnabled')['to'](this,'isProcessing',_0x7bdb3d=>!_0x7bdb3d),_0x146f7d['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x146f7d['icon']=_0x534137,_0x146f7d['class']=_0x12a07c+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x146f7d['icon']=_0x530858,_0x146f7d['class']=_0x12a07c;},0x3e8);}),_0x146f7d;}['_copyHTMLToClipboard'](_0x5a2522){const {window:_0x116a1b,document:_0x462cf4}=_0x542910;if(_0x116a1b['ClipboardItem']){const {Blob:_0x1b85ac,ClipboardItem:_0x4ad2d7}=_0x116a1b,_0x52b5c4=[new _0x4ad2d7({'text/html':new _0x1b85ac([_0x5a2522['innerHTML']],{'type':'text/html'}),'text/plain':new _0x1b85ac([_0x5a2522['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x52b5c4);}else{const _0x463a4e=_0x462cf4['createElement']('div');_0x463a4e['style']['position']='absolute',_0x463a4e['style']['left']='-9999px',_0x463a4e['innerHTML']='<span>[</span>'+_0x5a2522['innerHTML']+'<span>]</span>',_0x462cf4['body']['appendChild'](_0x463a4e);const _0x1784c9=_0x462cf4['createRange']();_0x1784c9['setStartAfter'](_0x463a4e['firstElementChild']),_0x1784c9['setEndBefore'](_0x463a4e['lastElementChild']);const _0x4a7993=_0x116a1b['getSelection']();_0x4a7993['removeAllRanges'](),_0x4a7993['addRange'](_0x1784c9),_0x462cf4['execCommand']('copy'),_0x463a4e['remove']();}}}class bt extends _0x3bf81d{constructor(_0x3986ea,_0x44af22=''){super(_0x3986ea),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x44af22,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3371a1){this['element']['innerHTML']=_0x3371a1;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x241a0f=new _0x3bf81d(),_0xfe43a6=this['locale'],_0x3c152c=new _0x392235();return _0x3c152c['isVisible']=!0x0,_0x241a0f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3c152c,{'text':i(_0xfe43a6,'AI\x20is\x20writing...')}]}),_0x241a0f['render'](),_0x241a0f;}}class mt extends _0x3bf81d{constructor(_0x2aa159,_0x142130=''){super(_0x2aa159);const _0x326734=new _0x33f119(),_0x3711a9=this['bindTemplate'];this['set']('text',_0x142130),_0x326734['content']=_0x3145a9,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x326734,{'text':_0x3711a9['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x59a644,_0x3abc98){super(_0x59a644,_0x3abc98),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',(_0x3124a6,_0x1c3b65)=>{_0x3124a6['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1c3b65());});}['_createSubmitButton'](){const _0x5d0569=new _0x2db44c(this['locale']),_0x45ac95=this['locale'];return _0x5d0569['set']({'icon':it,'label':i(_0x45ac95,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x5d0569['on']('execute',()=>{this['submit']();}),_0x5d0569['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2ee219,_0x48b82d)=>!_0x2ee219&&_0x48b82d),_0x5d0569;}['_createShowHistoryButton'](){const _0x4d9503=new _0x2db44c(this['locale']),_0x56c6d8=this['resultsView'],_0x40088d=this['locale'];_0x4d9503['set']({'label':i(_0x40088d,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4d9503['bind']('isOn')['to'](_0x56c6d8,'isVisible'),_0x4d9503['bind']('isEnabled')['to'](this,'isEnabled'),_0x4d9503['on']('execute',()=>{_0x56c6d8['isVisible']=!_0x56c6d8['isVisible'],_0x56c6d8['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5724bf=()=>{_0x542910['window']['requestAnimationFrame'](()=>{if(_0x159f09(this['element'])){const _0x5ca945=new _0x37fb03(this['queryView']['fieldView']['element']),_0x4f9aa3=_0x5ca945['width'],_0x382ede='rtl'===_0x40088d['uiLanguageDirection']?'left':'right';_0x5ca945['excludeScrollbarsAndBorders'](),_0x4d9503['element']['style'][_0x382ede]=_0x4f9aa3-_0x5ca945['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5724bf),this['on']('render',_0x5724bf),_0x4d9503;}['submit'](){const _0x3c25ad=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x3c25ad);}['focus'](_0x55d025){-0x1===_0x55d025?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x2a06b9){super(_0x2a06b9),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x2a06b9,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x363606=0x0;for(const _0x445822 of this['items'])_0x363606+=_0x445822['items']['length'];return{'resultsCount':_0x363606,'totalItemsCount':_0x363606};}['_createClearHistoryButton'](){const _0x3597c6=this['locale'],_0x5b695d=new _0x2db44c(this['locale']);return _0x5b695d['set']({'label':'('+i(_0x3597c6,'Clear')+')','withText':!0x0}),_0x5b695d['on']('execute',()=>this['fire']('clearHistory')),_0x5b695d;}}class ut extends xt{constructor(_0x5c4b6d){super();const _0x3073f0=new wt(),_0x1ee4b5=new _0x2db44c(this['locale'],_0x3073f0);this['children']['add'](_0x1ee4b5),_0x1ee4b5['set']({'label':_0x5c4b6d['prompt'],'withText':!0x0}),_0x1ee4b5['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x5c4b6d['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x1b4047{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4b77d6,_0x151fb4)=>{const _0x27c591=os(_0x151fb4['prompt']);for(const _0x5ce5e9 of this)if(_0x5ce5e9!=_0x151fb4&&os(_0x5ce5e9['prompt'])===_0x27c591){this['remove'](_0x5ce5e9);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x50f515=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x50f515));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x310e08=>_0x310e08)));}}function os(_0xe8464c){return _0xe8464c['toLowerCase']()['trim']();}class k extends _0x3bf81d{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2afda3,_0x1c8e40,_0x239857=''){super(_0x2afda3),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(_0x2afda3),this['contentArea']=new ct(_0x2afda3,_0x239857),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 _0x3be2bd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x1c8e40],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3be2bd['if']('isError','ck-hidden',_0x3a049c=>!_0x3a049c)]},'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'](_0xc9d84a=0x1){-0x1===_0xc9d84a?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 _0x1161d9=this['locale'],_0x4a52da=new lt(_0x1161d9,{'queryView':{'label':i(_0x1161d9,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x1161d9,'Empty\x20history'),'secondary':i(_0x1161d9,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4a52da['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2e7653,_0x55b602)=>_0x2e7653&&!_0x55b602),this['listenTo'](_0x4a52da,'submit',(_0x26fb05,_0x6593b4)=>{this['prompt']=_0x6593b4;const _0xfa7fdb=ft(_0x6593b4);this['fire']('submitPrompt',_0xfa7fdb),_0x6593b4['trim']()&&this['_promptHistory']['add']({'prompt':_0xfa7fdb},0x0);},{'priority':'high'}),_0x4a52da;}['_createHistoryView'](){const _0x335abb=new pt(this['locale']);return _0x335abb['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x335abb['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x335abb;}['_createToolbar'](){const _0xbe1ebb=new at(this['locale']);return _0xbe1ebb['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5f2d86,_0x38a258,_0x12ed43)=>_0x5f2d86&&!_0x38a258&&!!_0x12ed43),_0xbe1ebb['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0xbe1ebb['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xf1dd68,_0x5b4fd8,_0x5260a5)=>_0xf1dd68&&!_0x5b4fd8&&!!_0x5260a5),_0xbe1ebb['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0xbe1ebb['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4f8c7f,_0x212632)=>_0x4f8c7f&&!_0x212632),_0xbe1ebb['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0xbe1ebb['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0xbe1ebb['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0xbe1ebb;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x146c70=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x146c70,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x1d5f5a){const _0x52c7b5=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x1d5f5a||i(_0x52c7b5,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x47d13d{['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[_0xf4919e,a,x,_0x3f999e];}constructor(_0x497d3d){super(_0x497d3d),_0x497d3d['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x497d3d['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x497d3d['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x497d3d['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3d9edb}=this;this['_aiAdapter']=_0x3d9edb['plugins']['get'](x),this['_dialog']=_0x3d9edb['plugins']['get'](_0x3f999e),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x3a1452=new E(_0x3d9edb,Array['from'](this['_commandDefinitions']['values']()));_0x3d9edb['commands']['add']('showAIAssistant',_0x3a1452),_0x3d9edb['ui']['componentFactory']['add']('aiCommands',_0x35ef80=>{const _0xd4865d=_0x4275aa(_0x35ef80);return _0xd4865d['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0xd4865d['buttonView']['set']({'label':i(_0x35ef80,'AI\x20Commands'),'icon':_0x4edd52,'tooltip':!0x0}),_0xd4865d['on']('execute',_0x3d1822=>this['_onExecute'](_0x3d1822['source']['id'])),_0x10381b(_0xd4865d,_0x3d9edb['ui']['view']['body'],function(_0x5d9319){const _0xedd5a0=o(_0x5d9319['config']['get']('ai.aiAssistant.commands'),_0x5d9319['locale']),_0x3d9162=U(_0x5d9319,_0xedd5a0)['filter'](_0x8a401d=>_0x8a401d['commands']['length']);if(0x1===_0x3d9162['length'])return U(_0x5d9319,_0x3d9162[0x0]['commands'])['map'](_0x236a7a=>({'id':_0x236a7a['id'],'label':_0x236a7a['label']}));return _0x3d9162['map'](_0x33a944=>{const {groupId:_0x4fe2db,groupLabel:_0xfa1122,commands:_0xb63e9f}=_0x33a944,_0x13758a=U(_0x5d9319,_0xb63e9f)['map'](_0x26cb01=>({'id':_0x26cb01['id'],'label':_0x26cb01['label']}));return{'id':_0x4fe2db,'menu':_0xfa1122||_0x4fe2db,'children':_0x13758a};});}(_0x3d9edb),{'ariaLabel':i(_0x35ef80,'AI\x20Commands')}),_0xd4865d['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x3a1452['on']('change:enabledCommandsIds',_0x151a50),_0xd4865d['menuView']['once']('render',_0x151a50),_0xd4865d;function _0x151a50(){_0xd4865d['isEnabled']=_0x3a1452['enabledCommandsIds']['length']>0x0;for(const _0x3b8ba1 of _0xd4865d['menuView']['buttons'])_0x3b8ba1['isEnabled']=_0x3a1452['enabledCommandsIds']['includes'](_0x3b8ba1['id']);}}),_0x3d9edb['ui']['componentFactory']['add']('menuBar:aiCommands',_0x59b6ec=>{const _0xc2fc01=new _0x1c05d1(_0x59b6ec);_0xc2fc01['buttonView']['set']({'label':i(_0x59b6ec,'AI\x20Commands'),'icon':_0x4edd52}),_0xc2fc01['bind']('isEnabled')['to'](_0x3a1452,'enabledCommandsIds',_0x38aaa1=>_0x38aaa1['length']>0x0);const _0x3abd17=o(_0x3d9edb['config']['get']('ai.aiAssistant.commands'),_0x59b6ec);return this['_populateMenuBarMenu'](_0x3a1452,_0xc2fc01,_0x3abd17,_0x464b57=>this['_onExecute'](_0x464b57)),_0xc2fc01;}),_0x3d9edb['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5e42cd=this['_createAIAssistantUIButton'](_0x2db44c);return _0x5e42cd['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5e42cd;}),_0x3d9edb['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x401191=this['_createAIAssistantUIButton'](_0x4151ae);return _0x401191['set']({'role':'menuitemcheckbox'}),_0x401191;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0xde75d9=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2c4b25;for(const _0x4a3353 in _0xde75d9){const _0x2867d5=_0x4a3353,_0x3554ac=_0xde75d9[_0x2867d5];if('aiLicenseKeyValid'==_0x3554ac||'aiLicenseKeyInvalid'==_0x3554ac||'aiLicenseKeyExpired'==_0x3554ac||'aiLicenseKeyDomainLimit'==_0x3554ac||'aiLicenseKeyNotAllowed'==_0x3554ac||'aiLicenseKeyEvaluationLimit'==_0x3554ac||'aiLicenseKeyTrialLimit'==_0x3554ac||'aiLicenseKeyUsageLimit'==_0x3554ac){delete _0xde75d9[_0x2867d5],_0x2c4b25=_0x3554ac,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2c4b25&&_0xde75d9['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2c4b25&&_0xde75d9['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2c4b25&&_0xde75d9['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2c4b25&&_0xde75d9['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2c4b25&&_0xde75d9['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x2c4b25&&_0xde75d9['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x2c4b25&&_0xde75d9['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x2f3049='',_0x1ed303='',_0x514334='custom'){const _0x329943=this['editor'],_0xd60c84=_0x329943['editing']['view'],_0x24ba44=_0x329943['plugins']['get'](a),_0x4353ec=_0x329943['plugins']['get'](_0xf4919e);_0x24ba44['showFakeVisualSelection']();const _0x4007e6=new l(),_0x1fae25=new ClipboardEvent('copy',{'clipboardData':_0x4007e6}),_0x10af6e=new _0x144e81(_0x4007e6),_0x1369fa=new _0x26acc9(_0xd60c84,_0x1fae25,{'dataTransfer':_0x10af6e});_0x4353ec['_forceMarkersCopy']('comment',()=>{_0xd60c84['document']['fire']('copy',_0x1369fa);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x329943,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x549473=_0x10af6e['getData']('text/html');const _0x555920=_0x329943['model']['document']['selection'],_0x1dc89c=Array['from'](_0x555920['getRanges']());0x1===_0x1dc89c['length']&&_0x1dc89c[0x0]['isFlat']&&!_0x555920['getSelectedElement']()&&''!==_0x549473['replace'](/&nbsp;/g,'')['trim']()&&(_0x549473='<p>'+_0x549473+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x514334,'query':_0x2f3049,'htmlContent':_0x549473,'label':_0x1ed303,'mainActionLabel':_[_0x329943['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2e4d83,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x49324c['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x24ba44['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x1ba5e8=new Map(),_0x2ce72a=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x34e5af of _0x2ce72a)for(const _0x25da63 of _0x34e5af['commands'])_0x1ba5e8['set'](_0x25da63['id'],{..._0x25da63,'groupId':_0x34e5af['groupId'],'groupLabel':_0x34e5af['groupLabel']||_0x34e5af['groupId']});return _0x1ba5e8;}['_createAIAssistantUIButton'](_0x52d6a5){const _0x357938=this['editor'],_0x479854=_0x357938['commands']['get']('showAIAssistant'),_0xab2fde=new _0x52d6a5(_0x357938['locale']);return _0xab2fde['set']({'label':i(_0x357938['locale'],'AI\x20Assistant'),'icon':_0x2e4d83,'isToggleable':!0x0}),_0xab2fde['bind']('isEnabled')['to'](_0x479854),_0xab2fde['bind']('isOn')['to'](this['_dialog'],'id',_0xe4b1d3=>'aiAssistant'===_0xe4b1d3),this['listenTo'](_0xab2fde,'execute',()=>{_0xab2fde['isOn']?this['hideUI']():_0x479854['execute']();}),_0xab2fde;}['_initView'](){const _0x28473b=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',()=>{_0x28473b['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x28473b['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x1204bf,ui:{ariaLiveAnnouncer:_0x2f1b0e}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x57dcfe,_0x56a2ba,_0x58f505)=>{const _0x2f1ddb=this['_aiAssistantController']['currentContext'];_0x58f505?_0x2f1b0e['announce'](i(_0x1204bf,'AI\x20is\x20writing')):_0x2f1ddb&&_0x2f1b0e['announce'](i(_0x1204bf,'Generated\x20content:\x20%0',_0x2f1ddb),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x4a81fc,_0x3a78a1,_0x52aec3)=>{if(_0x52aec3){const _0x9bc6aa=this['_formView']['errorView']['text'];_0x2f1b0e['announce'](i(_0x1204bf,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x9bc6aa));}});}['_onExecute'](_0x22630c){const _0x334bbf=this['_commandDefinitions']['get'](_0x22630c),_0x230401=this['editor'],_0x111b0e=_0x230401['model']['document']['selection'],_0x22fdec=_0x230401['commands']['get']('showAIAssistant'),_0x5711cc=_0x230401['plugins']['get'](a),_0x4678cb=''+(_0x334bbf['groupId']!==K?_0x334bbf['groupLabel']+':\x20':'')+_0x334bbf['label'];if(!0x1!==_0x334bbf['requiresContent']&&_0x111b0e['isCollapsed']){const _0x2acea4=_0x43afe3(_0x111b0e['getSelectedBlocks']())||_0x230401['model']['schema']['getLimitElement'](_0x111b0e);_0x230401['model']['change'](_0x26aade=>{_0x26aade['setSelection'](_0x2acea4,'in');});}_0x5711cc['showFakeVisualSelection'](),_0x22fdec['execute'](_0x334bbf['prompt'],_0x4678cb,'command:'+_0x22630c);}['_populateMenuBarMenu'](_0x186664,_0x4e44b3,_0x502937,_0x15b5f3){const _0xebfe44=this['editor'],_0x272a45=_0xebfe44['locale'],_0x735805=new _0x1a8d4b(_0x272a45),_0x9bcd8a=U(_0xebfe44,_0x502937)['filter'](_0x4ac6c4=>_0x4ac6c4['commands']['length']);0x1===_0x9bcd8a['length']?this['_getMenuBarGroupButtons']({'command':_0x186664,'commands':_0x9bcd8a[0x0]['commands'],'parentMenuView':_0x4e44b3,'onExecute':_0x15b5f3})['forEach'](_0x4fe71a=>_0x735805['items']['add'](_0x4fe71a)):_0x9bcd8a['forEach'](({groupId:_0x1677b6,groupLabel:_0x1eb7b4,commands:_0x59bb5f})=>{const _0x12047a=new _0x2fef60(_0x272a45,_0x4e44b3),_0x187460=new _0x1c05d1(_0x272a45),_0x17fb42=new _0x1a8d4b(_0x272a45),_0x243d26=this['_getMenuBarGroupButtons']({'command':_0x186664,'commands':_0x59bb5f,'parentMenuView':_0x187460,'onExecute':_0x15b5f3});_0x187460['buttonView']['set']({'label':_0x1eb7b4||_0x1677b6}),_0x187460['delegate']('execute')['to'](_0x4e44b3),_0x17fb42['items']['addMany'](_0x243d26),_0x187460['panelView']['children']['add'](_0x17fb42),_0x12047a['children']['add'](_0x187460),_0x735805['items']['add'](_0x12047a);}),_0x4e44b3['panelView']['children']['add'](_0x735805);}['_getMenuBarGroupButtons']({command:_0x222a48,commands:_0x61e668,parentMenuView:_0x5caa41,onExecute:_0x5681b2}){const _0x1f074f=this['editor'],_0x1efa33=_0x1f074f['locale'];return U(_0x1f074f,_0x61e668)['map'](_0x466147=>{const _0x57e2cb=new _0x2fef60(_0x1efa33,_0x5caa41),_0x3a6b0e=new _0x4151ae(_0x1efa33);return _0x3a6b0e['set']({'label':_0x466147['label']}),_0x3a6b0e['delegate']('execute')['to'](_0x5caa41),_0x3a6b0e['on']('execute',()=>_0x5681b2(_0x466147['id'])),_0x3a6b0e['bind']('isEnabled')['to'](_0x222a48,'enabledCommandsIds',_0x36558f=>_0x36558f['includes'](_0x466147['id'])),_0x57e2cb['children']['add'](_0x3a6b0e),_0x57e2cb;});}}function T(_0x3ea7d1,_0x36e6df){return void 0x0!==_0x3ea7d1['order']&&void 0x0===_0x36e6df['order']?0x1:void 0x0===_0x3ea7d1['order']&&void 0x0!==_0x36e6df['order']?-0x1:void 0x0!==_0x3ea7d1['order']&&void 0x0!==_0x36e6df['order']?_0x3ea7d1['order']-_0x36e6df['order']:0x0;}function U(_0x23a0ba,_0x1b70c1){_0x1b70c1['sort'](T);const _0xbc2fa1={},_0x1ff5f0=[];for(const _0x32b2e6 of _0x1b70c1)if(void 0x0!==_0x32b2e6['order']){if(_0x32b2e6['order']in _0xbc2fa1)throw new _0x18ef2b('ai-commands-config-order-collision',_0x23a0ba,{'conflictingDefinitions':[_0x32b2e6,_0xbc2fa1[_0x32b2e6['order']]]});_0xbc2fa1[_0x32b2e6['order']]=_0x32b2e6,_0x1ff5f0['splice'](_0x32b2e6['order'],0x0,_0x32b2e6);}else _0x1ff5f0['push'](_0x32b2e6);return _0x1ff5f0;}class At extends _0x47d13d{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2dad37){super(_0x2dad37);const _0x10d5f4=_0x2dad37['config'],_0x16817b=_0x2dad37['locale'];_0x10d5f4['define']('ai.aiAssistant.preserveComments',!0x0),_0x10d5f4['define']('ai.aiAssistant.commands',_t(_0x16817b)),_0x10d5f4['define']('ai.aiAssistant.extraCommandGroups',[]),_0x10d5f4['define']('ai.aiAssistant.removeCommands',[]);let _0x343e07=o(_0x10d5f4['get']('ai.aiAssistant.commands'),_0x16817b);const _0x21f7f8=_0x10d5f4['get']('ai.aiAssistant.extraCommandGroups'),_0x29c9e4=_0x10d5f4['get']('ai.aiAssistant.removeCommands');_0x21f7f8['forEach'](_0x532fd3=>{const _0x292262=_0x343e07['find'](_0x451822=>_0x451822['groupId']===_0x532fd3['groupId']);_0x292262?_0x292262['commands']=_0x292262['commands']['concat'](_0x532fd3['commands']):_0x343e07['push'](_0x532fd3);}),_0x343e07=_0x343e07['filter'](_0x6689b8=>!_0x29c9e4['includes'](_0x6689b8['groupId'])),_0x343e07['forEach'](_0x4e77ca=>{_0x4e77ca['commands']=_0x4e77ca['commands']['filter'](_0xc8a1a6=>!_0x29c9e4['includes'](_0xc8a1a6['id']));}),_0x10d5f4['set']('ai.aiAssistant.commands',_0x343e07);}}function _t(_0x2b0690){return[{'groupId':'editOrReview','groupLabel':i(_0x2b0690,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x2b0690,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x2b0690,'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(_0x2b0690,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x2b0690,'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(_0x2b0690,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x2b0690,'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(_0x2b0690,'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(_0x2b0690,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x2b0690,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x2b0690,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x2b0690,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x2b0690,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x2b0690,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x2b0690,'Change\x20style'),'commands':[{'id':'business','label':i(_0x2b0690,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x2b0690,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x2b0690,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x2b0690,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x2b0690,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x2b0690,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x2b0690,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x2b0690,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x2b0690,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x2b0690,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x2b0690,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x2b0690,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x2b0690,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x47d13d{['abortController'];static get['requires'](){return[x];}constructor(_0x112d01){super(_0x112d01),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'](_0x511eec){return this['sendRequest'](_0x511eec)['catch'](_0x4670fe=>{if(_0x4670fe instanceof R)return Promise['reject'](_0x4670fe);if('AbortError'==_0x4670fe['name'])return Promise['resolve']();throw console['error'](_0x4670fe),new _0x18ef2b('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x5bae8b,_0xd9b3b4){const _0x48f295=this['editor']['locale'],_0xcee2c4={'Content-Type':'application/json'};if('object'==typeof _0x5bae8b)Object['assign'](_0xcee2c4,_0x5bae8b);else{if(_0x5bae8b)try{const _0xaf133f=await _0x5bae8b(_0xd9b3b4);Object['assign'](_0xcee2c4,_0xaf133f);}catch{return Promise['reject'](new R(i(_0x48f295,'AI_ERROR_GET_HEADERS')));}}return _0xcee2c4;}async['_prepareRequestParameters'](_0x44b362,_0x83a9){const _0x10a418=this['editor']['locale'];if('object'==typeof _0x44b362)return _0x44b362;try{return await _0x44b362(_0x83a9);}catch{return Promise['reject'](new R(i(_0x10a418,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x12e4f9){super(_0x12e4f9),_0x12e4f9['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x12e4f9['config']['get']('ai.openAI.requestParameters')||_0x12e4f9['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x12e4f9['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x12e4f9['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x12e4f9['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x354ed9,context:_0x588c23,onData:_0x2176c0,actionId:_0x20382c}){const _0x2b1afd=this['editor']['locale'],_0x20eed2=await this['prepareMessages'](_0x354ed9,_0x588c23,_0x20382c),_0x360a4b=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x20382c),_0x242a23=await this['_prepareRequestParameters'](this['_requestParameters'],_0x20382c),_0x233b97={'messages':_0x20eed2,..._0x242a23},_0x1564d7={'method':'POST','headers':_0x360a4b,'body':JSON['stringify'](_0x233b97),'signal':this['abortController']['signal']},_0x25b82b=await fetch(this['_apiUrl'],_0x1564d7);if(_0x25b82b['ok'])return _0x242a23['stream']?await this['_readStreamableResponse'](_0x25b82b,_0x2176c0):await this['_readStaticResponse'](_0x25b82b,_0x2176c0),Promise['resolve']();{const _0x157adb=await _0x25b82b['text']();return _0x157adb['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x2b1afd,'AI_ERROR_CONTEXT_LENGTH'))):_0x157adb['includes']('Moderation')?Promise['reject'](new R(i(_0x2b1afd,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x157adb));}}async['prepareMessages'](_0x52c5e6,_0x3600a7,_0x504a9c){let _0x7bb93b,_0x878c6e;return _0x3600a7?(_0x7bb93b='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.',_0x878c6e='Instruction:\x0a'+_0x52c5e6+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3600a7):(_0x7bb93b='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.',_0x878c6e=_0x52c5e6),[{'role':'system','content':_0x7bb93b},{'role':'user','content':_0x878c6e}];}async['_readStreamableResponse'](_0x78caaa,_0x718efc){const _0x123ae2=_0x78caaa['body']['getReader'](),_0x36c165=new TextDecoder();let _0x597650='',_0x4316d9='',_0xac69d8='',_0x52d2d1=!0x1;for(;!_0x52d2d1;){const {done:_0x239a08,value:_0x964e3a}=await _0x123ae2['read'](),_0x3ae962=_0x597650+_0x36c165['decode'](_0x964e3a);let _0x2f9fff='';_0x52d2d1=_0x239a08;try{_0x2f9fff=this['_cleanUpData'](_0x3ae962),_0x597650='';}catch{_0x597650=_0x3ae962;continue;}_0x4316d9+=_0x2f9fff,!_0x52d2d1&&this['_isBufferIncomplete'](_0x4316d9)||_0x4316d9&&(_0xac69d8+=_0x4316d9,_0x4316d9='',_0x718efc(_0xac69d8));}return Promise['resolve']();}async['_readStaticResponse'](_0x4c5192,_0x42288b){return _0x42288b((await _0x4c5192['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x22664c){const _0x40390e=_0x22664c['split']('<')['length']!==_0x22664c['split']('>')['length'],_0x454ad3=_0x22664c['length']<0x1e;return _0x40390e&&_0x454ad3;}['_cleanUpData'](_0x288622){return _0x288622['split'](/\n(?![^{]*\})/g)['map'](_0x319c1d=>_0x319c1d['replace']('data:\x20',''))['filter'](_0x14613b=>_0x14613b&&_0x14613b['length']>0x0&&'[DONE]'!==_0x14613b)['map'](_0x1a17d5=>{const {choices:_0x3a4084}=JSON['parse'](_0x1a17d5);if(_0x3a4084[0x0]?.['delta']?.['content'])return _0x3a4084[0x0]['delta']['content'];})['filter'](_0x5937d7=>_0x5937d7)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x3369fa){super(_0x3369fa),_0x3369fa['config']['get']('ai.aws.requestParameters')||_0x3369fa['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']=_0x3369fa['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x3369fa['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x3369fa['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x3369fa['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x2436d0,context:_0x2ce905,onData:_0x472a18,actionId:_0x31d29e}){const {model:_0x222d95,stream:_0x55b1aa,..._0x33011b}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x31d29e),_0x3e0314={'prompt':await this['preparePrompt'](_0x2436d0,_0x2ce905,_0x222d95,_0x31d29e),..._0x33011b};this['_apiUrl']?await this['_processProxyRequest'](_0x3e0314,_0x222d95,_0x55b1aa,_0x472a18,_0x31d29e):await this['_processAWSRequest'](_0x3e0314,_0x222d95,_0x55b1aa,_0x472a18);}async['preparePrompt'](_0x423234,_0x40f9cf,_0x22df76,_0xcc605){let _0x4e9faa,_0x4b4c3f;return _0x40f9cf?(_0x4e9faa='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.',_0x4b4c3f='Instruction:\x0a'+_0x423234+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x40f9cf):(_0x4e9faa='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.',_0x4b4c3f=_0x423234),'meta.llama'==this['getModelFamily'](_0x22df76)?'<<SYS>>\x0a'+_0x4e9faa+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4b4c3f+'\x0a[/INST]':'Human:\x0a'+_0x4e9faa+'\x0a'+_0x4b4c3f+'\x0a\x0aAssistant:';}['getModelFamily'](_0x269192){if(/^anthropic\.claude/['test'](_0x269192))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x269192))return'ai21.j2';if(/^cohere\.command/['test'](_0x269192))return'cohere.command';if(/^meta\.llama/['test'](_0x269192))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x269192));}async['_processProxyRequest'](_0x3b4ef9,_0x48c7df,_0x20026a,_0x98fdfc,_0x3422c0){const _0x528ec4={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3422c0),'body':JSON['stringify']({..._0x3b4ef9,'model':_0x48c7df,'stream':_0x20026a}),'signal':this['abortController']['signal']},_0x40be1e=await fetch(this['_apiUrl'],_0x528ec4);_0x20026a?await this['_readStreamableResponse'](_0x40be1e,_0x48c7df,_0x98fdfc):await this['_readStaticResponse'](_0x40be1e,_0x48c7df,_0x98fdfc);}async['_processAWSRequest'](_0x3f52c8,_0x450c68,_0x1f0349,_0x55bc17){const _0x301b8a=new _0x2408c7(this['_bedrockClientConfig']),_0x37d7d5={'body':JSON['stringify'](_0x3f52c8),'contentType':'application/json','accept':'application/json','modelId':_0x450c68};let _0xb7c1d4;if(_0x1f0349){const _0x1ea0ac=new _0xd9b0cc(_0x37d7d5);_0xb7c1d4=await _0x301b8a['send'](_0x1ea0ac,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0xb7c1d4,_0x450c68,_0x55bc17);}else{const _0x776ef=new _0x314eda(_0x37d7d5);_0xb7c1d4=await _0x301b8a['send'](_0x776ef,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0xb7c1d4,_0x450c68,_0x55bc17);}}async['_readAsyncIterableResponse'](_0x4b2fc1,_0x597fca,_0x5c9505){const _0x2d01f3=_0x4b2fc1['body'],_0x19eea2=new TextDecoder('utf-8');let _0x1a17ff='';for await(const _0x3eb997 of _0x2d01f3)if(_0x3eb997['chunk']){const _0x2f30d6=_0x19eea2['decode'](_0x3eb997['chunk']['bytes']),_0x2f42fe=JSON['parse'](_0x2f30d6);_0x1a17ff+=this['_getGeneratedText'](_0x2f42fe,_0x597fca),_0x5c9505(_0x1a17ff);}return Promise['resolve']();}async['_readStreamableResponse'](_0x9653e,_0x259918,_0x2da289){const _0x53c1a=_0x9653e['body'],_0x36c53c=new TextDecoder('utf-8'),_0x318f17=_0x53c1a['getReader']();let _0x44d20c='',_0x5b2419='',_0x19936d=!0x1;for(;!_0x19936d;){const {done:_0xa3a843,value:_0x6de4b8}=await _0x318f17['read']();if(_0x19936d=_0xa3a843,_0x19936d)break;const _0x269a71=(_0x44d20c+_0x36c53c['decode'](_0x6de4b8))['split']('\x0a')['map'](_0xb25217=>{try{return _0x44d20c='',JSON['parse'](_0xb25217);}catch{return _0x44d20c=_0xb25217,null;}})['filter'](_0x13e7a2=>null!==_0x13e7a2);_0x269a71['length']&&(_0x5b2419+=_0x269a71['map'](_0x46085a=>this['_getGeneratedText'](_0x46085a,_0x259918))['join'](''),_0x2da289(_0x5b2419));}return Promise['resolve']();}async['_readStaticResponse'](_0x214c6b,_0x4dc28e,_0x401401){let _0x478de3;return _0x478de3=_0x214c6b instanceof Response?await _0x214c6b['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x214c6b['body'])),(_0x401401(this['_getGeneratedText'](_0x478de3,_0x4dc28e)),Promise['resolve']());}['_getGeneratedText'](_0x229ec0,_0x3ab9d5){switch(this['getModelFamily'](_0x3ab9d5)){case'anthropic.claude':return _0x229ec0['completion'];case'ai21.j2':return _0x229ec0['completions'][0x0]['data']['text'];case'cohere.command':return _0x229ec0['generations'][0x0]['text'];case'meta.llama':return _0x229ec0['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.2-alpha.1",
3
+ "version": "46.0.2",
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.2-alpha.1",
33
- "@ckeditor/ckeditor5-core": "46.0.2-alpha.1",
34
- "@ckeditor/ckeditor5-engine": "46.0.2-alpha.1",
35
- "@ckeditor/ckeditor5-icons": "46.0.2-alpha.1",
36
- "@ckeditor/ckeditor5-table": "46.0.2-alpha.1",
37
- "@ckeditor/ckeditor5-ui": "46.0.2-alpha.1",
38
- "@ckeditor/ckeditor5-utils": "46.0.2-alpha.1",
39
- "ckeditor5": "46.0.2-alpha.1",
32
+ "@ckeditor/ckeditor5-clipboard": "46.0.2",
33
+ "@ckeditor/ckeditor5-core": "46.0.2",
34
+ "@ckeditor/ckeditor5-engine": "46.0.2",
35
+ "@ckeditor/ckeditor5-icons": "46.0.2",
36
+ "@ckeditor/ckeditor5-table": "46.0.2",
37
+ "@ckeditor/ckeditor5-ui": "46.0.2",
38
+ "@ckeditor/ckeditor5-utils": "46.0.2",
39
+ "ckeditor5": "46.0.2",
40
40
  "es-toolkit": "1.39.5"
41
41
  },
42
42
  "type": "module",