@ckeditor/ckeditor5-ai 46.0.1-alpha.2 → 46.0.1-alpha.3

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 _0x2690b2,Command as _0x2f5686}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x17d812,IconCheck as _0x43a506,IconError as _0xe85ea,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x5c7339,IconRobotPencil as _0xc320f2}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x40382e,CKEditorError as _0x423f6c,ObservableMixin as _0x998122,global as _0x591f24,isVisible as _0x405677,Rect as _0x1025cd,Collection as _0x4bcf0c,FocusTracker as et,KeystrokeHandler as rt,first as _0xbbdd6e}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x5be0cc,View as _0x2d6b66,SpinnerView as _0x35faaa,IconView as _0x330bfc,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x61d856,createDropdown as _0x47b7bf,addMenuToDropdown as _0x184a03,MenuBarMenuView as _0x46a21b,MenuBarMenuListItemButtonView as _0x49937f,DialogViewPosition as _0x853c75,MenuBarMenuListView as _0x2f57d2,MenuBarMenuListItemView as _0x4f0030}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x45b00e,ClipboardMarkersUtils as _0x37d6a8}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x24bc4b,ViewDataTransfer as _0x4fdcd4,ViewUpcastWriter as _0xfa7595,Matcher as _0x32df5c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x298227,InvokeModelWithResponseStreamCommand as _0x841a7f,InvokeModelCommand as _0xb79abd}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0xe85a03,_0x176c74){const _0x4ed738=(0x0,_0x176c74['t'])('Other');return _0xe85a03['length']?'groupId'in _0xe85a03[0x0]?_0xe85a03:[{'groupId':K,'groupLabel':_0x4ed738,'order':0x1/0x0,'commands':_0xe85a03}]:[{'groupId':K,'groupLabel':_0x4ed738,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x2690b2{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x28dfe6}=this,_0x2cfdb4=['ck-fake-ai-selection'];_0x28dfe6['config']['get']('ai.useTheme')&&_0x2cfdb4['push']('ck-ai-assistant-ui_theme'),_0x28dfe6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x2cfdb4,'priority':0xc}}),_0x28dfe6['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x12d001,{writer:_0x34389f})=>{if(!_0x12d001['markerRange']['isCollapsed'])return null;const _0x4d8951=_0x34389f['createUIElement']('span');return _0x34389f['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4d8951),_0x4d8951;}});}['afterInit'](){!async function(_0x1ea8df){const _0x5c9c8e=_0x9d5449([0x4c,0x66,0x63,0x79,0x35,0x52,0x44,0x48,0x6d,0x4d,0x30,0x68,0x6c,0x73,0x54,0x38,0x53,0x42,0x78,0x76,0x49,0x6f,0x5a,0x34,0x4b,0x47,0x59,0x64,0x70,0x33,0x32,0x4a,0x4f,0x43,0x36,0x56,0x6b,0x31,0x37,0x71,0x6e,0x74,0x57,0x58,0x65,0x62,0x77,0x4e,0x46,0x6a,0x51,0x55,0x67,0x39,0x75,0x61,0x50,0x7a,0x45,0x41,0x72,0x69]),_0x9e5b90=0x66e13412,_0x547c59=0x66e65b2a^_0x9e5b90,_0x2cb7ce=window[_0x9d5449([0x44,0x61,0x74,0x65])][_0x9d5449([0x6e,0x6f,0x77])](),_0x2afa5b=_0x1ea8df[_0x9d5449([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x5e9b86=new window[(_0x9d5449([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x17a85e=>{_0x2afa5b[_0x9d5449([0x6f,0x6e,0x63,0x65])](_0x9d5449([0x72,0x65,0x61,0x64,0x79]),_0x17a85e);}),_0x50c870={[_0x9d5449([0x6b,0x74,0x79])]:_0x9d5449([0x45,0x43]),[_0x9d5449([0x75,0x73,0x65])]:_0x9d5449([0x73,0x69,0x67]),[_0x9d5449([0x63,0x72,0x76])]:_0x9d5449([0x50,0x2d,0x32,0x35,0x36]),[_0x9d5449([0x78])]:_0x9d5449([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]),[_0x9d5449([0x79])]:_0x9d5449([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]),[_0x9d5449([0x61,0x6c,0x67])]:_0x9d5449([0x45,0x53,0x32,0x35,0x36])},_0x418936=_0x2afa5b[_0x9d5449([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x9d5449([0x67,0x65,0x74])](_0x9d5449([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x24414d(){let _0x595514,_0x43ced1=null,_0x5c6561=null;try{if(_0x418936==_0x9d5449([0x47,0x50,0x4c]))return _0x9d5449([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x595514=_0x2239fc(),!_0x595514)return _0x9d5449([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x595514[_0x9d5449([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x5c6561=_0x43281b(_0x595514[_0x9d5449([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x595514[_0x9d5449([0x6a,0x74,0x69])])),await _0x1327de()?_0x1ba391()?_0x1d3eed()?_0x9d5449([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2129b8()?(_0x595514[_0x9d5449([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x9d5449([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x43ced1=_0x1b3cd8(_0x9d5449([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x595514[_0x9d5449([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x9d5449([0x74,0x72,0x69,0x61,0x6c])&&(_0x43ced1=_0x1b3cd8(_0x9d5449([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x40d901()):_0x9d5449([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x9d5449([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x9d5449([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x9d5449([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1d3eed(){const _0x42a141=[_0x9d5449([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x9d5449([0x74,0x72,0x69,0x61,0x6c])][_0x9d5449([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x595514[_0x9d5449([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x2cb7ce/0x3e8:0xe10*_0x547c59;return _0x595514[_0x9d5449([0x65,0x78,0x70])]<_0x42a141;}function _0x1ba391(){const _0x616b8b=_0x595514[_0x9d5449([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x616b8b&&(!!_0x616b8b[_0x9d5449([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x9d5449([0x2a]))||!!_0x616b8b[_0x9d5449([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x9d5449([0x41,0x49])));}function _0x2129b8(){const _0x4d9d0c=_0x595514[_0x9d5449([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4d9d0c||0x0==_0x4d9d0c[_0x9d5449([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x211f01}=new URL(window[_0x9d5449([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4d9d0c[_0x9d5449([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x211f01))return!0x0;const _0x2efe8b=_0x211f01[_0x9d5449([0x73,0x70,0x6c,0x69,0x74])](_0x9d5449([0x2e]));return _0x4d9d0c[_0x9d5449([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xfdb35a=>_0xfdb35a[_0x9d5449([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x9d5449([0x2a])))[_0x9d5449([0x6d,0x61,0x70])](_0x2e846c=>_0x2e846c[_0x9d5449([0x73,0x70,0x6c,0x69,0x74])](_0x9d5449([0x2e])))[_0x9d5449([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x195dc6=>_0x195dc6[_0x9d5449([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x2efe8b[_0x9d5449([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x9d5449([0x6d,0x61,0x70])](_0x4558e1=>Array(_0x2efe8b[_0x9d5449([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x4558e1[_0x9d5449([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x9d5449([0x66,0x69,0x6c,0x6c])](_0x4558e1[0x0]===_0x9d5449([0x2a])?_0x9d5449([0x2a]):'')[_0x9d5449([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x4558e1))[_0x9d5449([0x73,0x6f,0x6d,0x65])](_0x11cee7=>_0x2efe8b[_0x9d5449([0x65,0x76,0x65,0x72,0x79])]((_0x432ddd,_0x31b0ea)=>_0x11cee7[_0x31b0ea]===_0x432ddd||_0x11cee7[_0x31b0ea]===_0x9d5449([0x2a])));}function _0x40d901(){return _0x43ced1&&_0x5c6561?new window[(_0x9d5449([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3cbdde,_0xe56aff)=>{_0x43ced1[_0x9d5449([0x74,0x68,0x65,0x6e])](_0x3cbdde,_0xe56aff),_0x5c6561[_0x9d5449([0x74,0x68,0x65,0x6e])](_0x47b176=>{_0x47b176!=_0x9d5449([0x56,0x61,0x6c,0x69,0x64])&&_0x3cbdde(_0x47b176);},_0xe56aff);}):_0x43ced1||_0x5c6561||_0x9d5449([0x56,0x61,0x6c,0x69,0x64]);}}function _0x43281b(_0x4d54e1,_0x359ee3){return new window[(_0x9d5449([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x44a39c=>{if(_0x48b529())return _0x44a39c(_0x9d5449([0x56,0x61,0x6c,0x69,0x64]));_0xa96ddf(),_0x2afa5b[_0x9d5449([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x9d5449([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x5e0db3=!0x1;const _0x5378ea=_0x40382e();function _0x293b9c(_0x271047){return!!_0x271047&&(typeof _0x271047===_0x9d5449([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x271047===_0x9d5449([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x271047[_0x9d5449([0x74,0x68,0x65,0x6e])]===_0x9d5449([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x271047[_0x9d5449([0x63,0x61,0x74,0x63,0x68])]===_0x9d5449([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x518aca(_0x80c177){_0x55874c(_0x80c177)[_0x9d5449([0x74,0x68,0x65,0x6e])](_0x42e594=>{if(!_0x42e594||_0x42e594[_0x9d5449([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x9d5449([0x6f,0x6b]))return _0x9d5449([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1b330c(_0x119af0(_0x5378ea+_0x359ee3))!=_0x42e594[_0x9d5449([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x9d5449([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x9d5449([0x56,0x61,0x6c,0x69,0x64]);})[_0x9d5449([0x74,0x68,0x65,0x6e])](_0x160619=>(_0x44dfb9(),_0x160619),()=>{const _0x210b6b=_0x56644d();return null==_0x210b6b?(_0x44dfb9(),_0x9d5449([0x56,0x61,0x6c,0x69,0x64])):_0x9d5449(_0x2cb7ce-_0x210b6b>(0x42edb012^_0x9e5b90)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x9d5449([0x74,0x68,0x65,0x6e])](_0x44a39c)[_0x9d5449([0x63,0x61,0x74,0x63,0x68])](()=>{_0x44a39c(_0x9d5449([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x497fa5=0x66d7da92^_0x9e5b90;function _0x44dfb9(){const _0x291701=_0x9d5449([0x6c,0x6c,0x63,0x74,0x2d])+_0x1b330c(_0x119af0(_0x4d54e1)),_0x2a686a=_0x416a67(_0x1b330c(window[_0x9d5449([0x4d,0x61,0x74,0x68])][_0x9d5449([0x63,0x65,0x69,0x6c])](_0x2cb7ce/_0x497fa5)));window[_0x9d5449([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x9d5449([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x291701,_0x2a686a);}function _0x56644d(){const _0x136988=_0x9d5449([0x6c,0x6c,0x63,0x74,0x2d])+_0x1b330c(_0x119af0(_0x4d54e1)),_0x57e2ca=window[_0x9d5449([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x9d5449([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x136988);return _0x57e2ca?window[_0x9d5449([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x416a67(_0x57e2ca),0x10)*_0x497fa5:null;}function _0x55874c(_0x50a58c){return new window[(_0x9d5449([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2f00c8,_0x58a0e2)=>{_0x50a58c[_0x9d5449([0x74,0x68,0x65,0x6e])](_0x2f00c8,_0x58a0e2),window[_0x9d5449([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x58a0e2,0x66e0e0d2^_0x9e5b90);});}}_0x2afa5b[_0x9d5449([0x6f,0x6e])](_0x9d5449([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5a841f,_0x5b0e72)=>{if(_0x5b0e72[0x0]!=_0x4d54e1)return _0x44a39c(_0x9d5449([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x5b0e72[0x1]={..._0x5b0e72[0x1],[_0x9d5449([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x5378ea};},{[_0x9d5449([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x9d5449([0x68,0x69,0x67,0x68])}),_0x2afa5b[_0x9d5449([0x6f,0x6e])](_0x9d5449([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x1cd604=>{_0x293b9c(_0x1cd604[_0x9d5449([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x5e0db3=!0x0,_0x518aca(_0x1cd604[_0x9d5449([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x9d5449([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x9d5449([0x6c,0x6f,0x77])}),_0x5e9b86[_0x9d5449([0x74,0x68,0x65,0x6e])](()=>{_0x5e0db3||_0x44a39c(_0x9d5449([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x48b529(){return _0x2afa5b[_0x9d5449([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x9d5449([0x76,0x69,0x65,0x77])][_0x9d5449([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x9d5449([0x61,0x75,0x74,0x6f]);}function _0xa96ddf(){_0x2afa5b[_0x9d5449([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x9d5449([0x76,0x69,0x65,0x77])][_0x9d5449([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x9d5449([0x61,0x75,0x74,0x6f]);}}function _0x1b3cd8(_0x43a51f){const _0x20ccec=[new window[(_0x9d5449([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x28aa72=>setTimeout(_0x28aa72,0x66e80ade^_0x9e5b90)),_0x5e9b86[_0x9d5449([0x74,0x68,0x65,0x6e])](()=>new window[(_0x9d5449([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3432eb=>{let _0x3e3b59=0x0;_0x2afa5b[_0x9d5449([0x6d,0x6f,0x64,0x65,0x6c])][_0x9d5449([0x6f,0x6e])](_0x9d5449([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4dc8c3,_0x5e6dc7)=>{_0x5e6dc7[0x0][_0x9d5449([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3e3b59++,_0x3e3b59==(0x66e135ea^_0x9e5b90)&&(_0x3432eb(),_0x4dc8c3[_0x9d5449([0x6f,0x66,0x66])]());});}))];return window[_0x9d5449([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x9d5449([0x72,0x61,0x63,0x65])](_0x20ccec)[_0x9d5449([0x74,0x68,0x65,0x6e])](()=>_0x43a51f);}async function _0x1bdf68(){await _0x5e9b86,_0x2afa5b[_0x9d5449([0x6d,0x6f,0x64,0x65,0x6c])][_0x9d5449([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x3362ea,_0x2afa5b[_0x9d5449([0x6d,0x6f,0x64,0x65,0x6c])][_0x9d5449([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x3362ea,_0x2afa5b[_0x9d5449([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x9d5449([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4bf686(_0x2dcd13){const _0xb82c38=_0x2a9598();_0x2afa5b[_0xb82c38]=_0x9d5449([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x2dcd13,_0x2dcd13!=_0x9d5449([0x56,0x61,0x6c,0x69,0x64])&&_0x1bdf68();}function _0x2a9598(){const _0x245492=window[_0x9d5449([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x9d5449([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x9d5449([0x6e,0x6f,0x77])]())[_0x9d5449([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x9d5449([0x2e]),'');let _0x237aa9=_0x9d5449([0x4c]);for(let _0x1d6e7e=0x0;_0x1d6e7e<_0x245492[_0x9d5449([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1d6e7e+=0x2){let _0x33e7bc=window[_0x9d5449([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x245492[_0x9d5449([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1d6e7e,_0x1d6e7e+0x2));_0x33e7bc>=_0x5c9c8e[_0x9d5449([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x33e7bc-=_0x5c9c8e[_0x9d5449([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x237aa9+=_0x5c9c8e[_0x33e7bc];}return _0x237aa9;}function _0x2239fc(){const _0x5a07be=_0x418936[_0x9d5449([0x73,0x70,0x6c,0x69,0x74])](_0x9d5449([0x2e]));if(0x3!=_0x5a07be[_0x9d5449([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x21a1d9(_0x5a07be[0x1]);function _0x21a1d9(_0x2cc9d6){const _0x438774=_0x3a71a3(_0x2cc9d6);return _0x438774&&_0x128d96()?_0x438774:null;function _0x128d96(){const _0x53866b=_0x438774[_0x9d5449([0x6a,0x74,0x69])],_0x2d3a37=window[_0x9d5449([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x53866b[_0x9d5449([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x53866b[_0x9d5449([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x1f4b35={..._0x438774,[_0x9d5449([0x6a,0x74,0x69])]:_0x53866b[_0x9d5449([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x53866b[_0x9d5449([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x1f4b35[_0x9d5449([0x76,0x63])],_0x119af0(_0x1f4b35)==_0x2d3a37;}}}async function _0x1327de(){let _0x4fb592=!0x0;try{const _0x3f1a06=_0x418936[_0x9d5449([0x73,0x70,0x6c,0x69,0x74])](_0x9d5449([0x2e])),[_0x2ab524,_0x4a8926,_0x4bb831]=_0x3f1a06;return _0x1ac227(_0x2ab524),await _0x1f8025(_0x2ab524,_0x4a8926,_0x4bb831),_0x4fb592;}catch{return!0x1;}function _0x1ac227(_0x4dd076){const _0x105ac6=_0x3a71a3(_0x4dd076);_0x105ac6&&_0x105ac6[_0x9d5449([0x61,0x6c,0x67])]==_0x9d5449([0x45,0x53,0x32,0x35,0x36])||(_0x4fb592=!0x1);}async function _0x1f8025(_0x18f886,_0x19bd97,_0x50b34d){const _0x538fd1=window[_0x9d5449([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x9d5449([0x66,0x72,0x6f,0x6d])](_0x18b6cb(_0x50b34d),_0x5a9971=>_0x5a9971[_0x9d5449([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x21f846=new window[(_0x9d5449([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x9d5449([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x18f886+_0x9d5449([0x2e])+_0x19bd97),_0x4db587=window[_0x9d5449([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x9d5449([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x4db587)return;const _0x5de715=await _0x4db587[_0x9d5449([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x9d5449([0x6a,0x77,0x6b]),_0x50c870,{[_0x9d5449([0x6e,0x61,0x6d,0x65])]:_0x9d5449([0x45,0x43,0x44,0x53,0x41]),[_0x9d5449([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x9d5449([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x9d5449([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x4db587[_0x9d5449([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x9d5449([0x6e,0x61,0x6d,0x65])]:_0x9d5449([0x45,0x43,0x44,0x53,0x41]),[_0x9d5449([0x68,0x61,0x73,0x68])]:{[_0x9d5449([0x6e,0x61,0x6d,0x65])]:_0x9d5449([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5de715,_0x538fd1,_0x21f846)||(_0x4fb592=!0x1);}}function _0x3a71a3(_0x32ded6){return _0x32ded6[_0x9d5449([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x9d5449([0x65,0x79]))?JSON[_0x9d5449([0x70,0x61,0x72,0x73,0x65])](_0x18b6cb(_0x32ded6)):null;}function _0x18b6cb(_0x25528b){return window[_0x9d5449([0x61,0x74,0x6f,0x62])](_0x25528b[_0x9d5449([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x9d5449([0x2b]))[_0x9d5449([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x9d5449([0x2f])));}function _0x119af0(_0x40ed10){let _0x524cd4=0x1505;function _0x346800(_0x5035d3){for(let _0x51bb19=0x0;_0x51bb19<_0x5035d3[_0x9d5449([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x51bb19++){const _0x75914=_0x5035d3[_0x9d5449([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x51bb19);_0x524cd4=(_0x524cd4<<0x5)+_0x524cd4+_0x75914,_0x524cd4&=_0x524cd4;}}function _0x4c6eff(_0x3e09cd){Array[_0x9d5449([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3e09cd)?_0x3e09cd[_0x9d5449([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x4c6eff):_0x3e09cd&&typeof _0x3e09cd==_0x9d5449([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x9d5449([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3e09cd)[_0x9d5449([0x73,0x6f,0x72,0x74])]()[_0x9d5449([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x14dd36,_0x3a5e00])=>{_0x346800(_0x14dd36),_0x4c6eff(_0x3a5e00);}):_0x346800(window[_0x9d5449([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3e09cd));}return _0x4c6eff(_0x40ed10),_0x524cd4>>>0x0;}function _0x1b330c(_0x535f89){return _0x535f89[_0x9d5449([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x9d5449([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x9d5449([0x30]));}function _0x416a67(_0x17948d){return _0x17948d[_0x9d5449([0x73,0x70,0x6c,0x69,0x74])]('')[_0x9d5449([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x9d5449([0x6a,0x6f,0x69,0x6e])]('');}function _0x3362ea(){}function _0x9d5449(_0x3186f3){return _0x3186f3['map'](_0x53bdd7=>String['fromCharCode'](_0x53bdd7))['join']('');}_0x4bf686(await _0x24414d());}(this);}['showFakeVisualSelection'](){const _0x226825=this['editor']['model'];_0x226825['change'](_0x2beab6=>{const _0x1a67e6=_0x226825['document']['selection']['getRanges']();let _0x538d4d=0x0;for(const _0x11ebc1 of _0x1a67e6){const _0x505211=w+':'+_0x538d4d;if(_0x226825['markers']['has'](_0x505211))_0x2beab6['updateMarker'](_0x505211,{'range':_0x11ebc1});else{if(_0x11ebc1['start']['isAtEnd']){const _0x53c593=_0x11ebc1['start']['getLastMatchingPosition'](({item:_0x46944c})=>!_0x226825['schema']['isContent'](_0x46944c),{'boundaries':_0x11ebc1});_0x2beab6['addMarker'](_0x505211,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2beab6['createRange'](_0x53c593,_0x11ebc1['end'])});}else _0x2beab6['addMarker'](_0x505211,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x11ebc1});}_0x538d4d++;}});}['hideFakeVisualSelection'](){const _0x144f69=this['editor']['model'],_0x4dc85e=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x4dc85e['length']&&_0x144f69['change'](_0x355497=>{_0x4dc85e['forEach'](_0x2c4dd9=>{_0x355497['removeMarker'](_0x2c4dd9);});});}['insertContent'](_0x1fa738,_0x27109c){const _0x1ab707=this['_getAISelection'](),_0x596e35=_0x27109c||_0x1ab707['getFirstRange']();this['editor']['model']['canEditAt'](_0x596e35)&&this['editor']['model']['change'](_0x51c065=>{this['hideFakeVisualSelection'](),_0x27109c||this['_resetContentOfSelectedTableCells'](_0x51c065,_0x1ab707),this['_pasteHTMLUsingClipboard']({'insertAt':_0x596e35,'writer':_0x51c065,'html':_0x1fa738});});}['insertContentBelow'](_0x1cf964){const {model:_0x31e9ff}=this['editor'],_0x4e2275=this['_getAISelection']();_0x31e9ff['change'](()=>{const _0x161a01=this['_prepareTableInsertBelowPosition'](_0x1cf964,_0x4e2275)||this['_getDefaultInsertBelowPosition'](_0x4e2275);this['insertContent'](_0x1cf964,_0x161a01);});}['_getAISelection'](){const _0x1fc108=this['editor']['model'],_0x2c7adc=Array['from'](_0x1fc108['markers']['getMarkersGroup'](w))['map'](_0x591c43=>_0x591c43['getRange']());return _0x1fc108['createSelection'](_0x2c7adc);}['_pasteHTMLUsingClipboard']({writer:_0xf9a48,html:_0x48e82e,insertAt:_0x3f3b3}){const {view:_0x25ec1d}=this['editor']['editing'],_0x3b6e0c=this['editor']['plugins']['get'](_0x45b00e),_0x111614=new gt();_0x111614['setData']('text/html',_0x48e82e);const _0x2a94d5=new ClipboardEvent('paste',{'clipboardData':_0x111614}),_0x403544=new _0x24bc4b(_0x25ec1d,_0x2a94d5,{'dataTransfer':new _0x4fdcd4(_0x111614)});_0xf9a48['setSelection'](_0x3f3b3);const _0x5c1859=(_0x195ce0,_0x528e7d)=>{_0x528e7d['resultRange']&&_0xf9a48['setSelection'](_0x528e7d['resultRange']);};_0x3b6e0c['once']('contentInsertion',_0x5c1859,{'priority':'lowest'}),_0x25ec1d['document']['fire']('paste',_0x403544),_0x3b6e0c['off']('contentInsertion',_0x5c1859);}['_getDefaultInsertBelowPosition'](_0x3dc652){const {model:_0x5bad92}=this['editor'],_0x1337a3=Array['from'](_0x3dc652['getSelectedBlocks']());return _0x1337a3['length']?_0x5bad92['createPositionAfter'](_0x1337a3['pop']()):_0x3dc652['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x44eba1,_0x55f452){const {model:_0xcec9ee,plugins:_0x224353}=this['editor'];if(_0x224353['has']('TableUtils')){const _0x5a67be=_0x224353['get']('TableUtils')['getSelectedTableCells'](_0x55f452);if(_0x5a67be['length']){const _0xdb10fe=this['_getTableRowCountFromContent'](_0x44eba1),_0x4258ed=this['_createEmptyTableRows'](_0x5a67be,_0xdb10fe);return _0xcec9ee['createPositionAt'](_0x4258ed,0x0);}}return null;}['_getTableRowCountFromContent'](_0x2a4c5c){const _0x1269ce=this['editor']['plugins']['get']('TableUtils'),_0x512ea5=this['editor']['data']['parse'](_0x2a4c5c),_0x3d192a=Array['from'](_0x512ea5['getChildren']())['filter'](_0x4bab04=>_0x4bab04['is']('element','table'));let _0x20bbf9=0x0;return _0x3d192a['forEach'](_0x252b08=>{_0x20bbf9+=_0x1269ce['getRows'](_0x252b08);}),_0x20bbf9;}['_createEmptyTableRows'](_0x2f42a5,_0x1d38bb){const _0x325d6d=this['editor']['plugins']['get']('TableUtils'),_0x20fabc=_0x325d6d['getRowIndexes'](_0x2f42a5),_0x29b1b6=_0x325d6d['getColumnIndexes'](_0x2f42a5),_0x15c599=_0x20fabc['last']+0x1,_0x4bc103=_0x29b1b6['first'],_0x13c460=_0x2f42a5[0x0]['findAncestor']('table');for(let _0x5c5836=0x0;_0x5c5836<_0x1d38bb;_0x5c5836++)_0x325d6d['insertRows'](_0x13c460,{'at':_0x15c599});return _0x13c460['getChild'](_0x15c599)['getChild'](_0x4bc103);}['_resetContentOfSelectedTableCells'](_0x36bc98,_0x3cc78c){const {plugins:_0x185702}=this['editor'],{model:_0x42266c}=_0x36bc98;if(!_0x185702['has']('TableUtils'))return;_0x185702['get']('TableUtils')['getSelectedTableCells'](_0x3cc78c)['length']&&_0x42266c['deleteContent'](_0x3cc78c);}}class x extends _0x2690b2{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x423f6c('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x2995d8){super(_0x2995d8),this['name']='AIRequestError';}}function i(_0x451f45,_0x2582b4,_0x18aac0){const t=_0x451f45['t'];switch(_0x2582b4){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',_0x18aac0);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x18aac0);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'},_0x18aac0);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 _0x2582b4;}}class E extends _0x2f5686{['_commandDefinitions'];constructor(_0x18db42,_0x5f379e){super(_0x18db42),this['_commandDefinitions']=_0x5f379e,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x134c3d,_0x4b7b75,_0x414987)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x414987));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x265ae7,_0x2c9ff5,_0x1def2c)=>{this['enabledCommandsIds']=_0x1def2c?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x23ca32=this['editor']['model'];this['_hasContext']=function(_0x326e7c){const _0x179b47=_0x326e7c['document']['selection'];return _0x179b47['isCollapsed']?0x0!==[..._0x179b47['getSelectedBlocks']()]['length']&&![..._0x179b47['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x326e7c['hasContent'](_0x179b47['getFirstRange']());}(_0x23ca32);const _0x1af516=_0x23ca32['document']['selection'],_0x3d64c7=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x429b1c of _0x1af516['getRanges']())for(const _0x5b8018 of _0x429b1c['getItems']())if(_0x5b8018['is']('element')&&_0x3d64c7['includes'](_0x5b8018['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x1015ea='',_0x241624='',_0x516b7e='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x1015ea,_0x241624,_0x516b7e);}}function F(_0x9c6244,_0x45cb60){const _0x1143a7=new Set();for(const _0x5e8cf1 of _0x9c6244['values']())(_0x45cb60||!0x1===_0x5e8cf1['requiresContent'])&&_0x1143a7['add'](_0x5e8cf1['id']);return Array['from'](_0x1143a7);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- _0x998122(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x1be632,_0x2f6e75,_0x313e7b){super(),this['editor']=_0x1be632,this['textAdapter']=_0x2f6e75,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x313e7b,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x52d413,_0x3f5e2d,_0x3f4c66)=>{this['view']['value']=this['_sanitizeHTML'](_0x3f4c66);}),this['listenTo'](this['view'],'submitPrompt',(_0x249ded,_0x45f17a)=>{const _0x1b2571=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x45f17a,_0x1b2571,'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:_0x3c809e,query:_0x51fcea,htmlContent:_0x56474d,label:_0x1ebfbb,mainActionLabel:_0xa0cbab}){this['view']['prompt']=_0x1ebfbb,this['view']['mainAction']=_0xa0cbab,this['initialContext']=_0x56474d,_0x51fcea&&(this['view']['isRendered']?this['_handleQuery'](_0x51fcea,_0x56474d,_0x3c809e,_0x1ebfbb):this['view']['once']('render',()=>{this['_handleQuery'](_0x51fcea,_0x56474d,_0x3c809e,_0x1ebfbb);}));}['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'](_0x1c16c5,_0x20ac0f,_0x387f3e,_0x46a866){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x20ac0f,this['previousQuery']=_0x1c16c5,this['previousLabel']=_0x46a866||_0x1c16c5,this['previousActionId']=_0x387f3e,new Promise(_0xc03dbe=>{this['textAdapter']['makeRequest']({'query':_0x1c16c5,'context':_0x20ac0f,'onData':_0x316aa3=>{this['currentResponse']=_0x316aa3,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x387f3e})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x15f898=>{_0x15f898 instanceof R?this['view']['handleError'](_0x15f898['message']):this['view']['handleError'](),_0xc03dbe();})['finally'](()=>{this['stopProcessing'](),_0xc03dbe();});});}['_parseAndNormalizeContent'](_0x248967,_0x416207=!0x1){const _0x31499e=Q['exec'](_0x248967);_0x248967=_0x31499e?_0x248967['substring'](_0x31499e[0x1]['length']):_0x248967['length']<0x64&&!_0x416207?'':this['_stripMarkdownSyntax'](_0x248967);const _0x5c557c=this['_domParser']['parseFromString'](_0x248967,'text/html');if(_0x31499e){const _0x4d7aef=Array['from'](_0x5c557c['body']['childNodes']);_0x4d7aef['reverse']();for(const _0x52ac72 of _0x4d7aef){if(_0x52ac72['nodeType']==Node['ELEMENT_NODE'])break;_0x52ac72['remove']();}}const _0x5c611f=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x5c557c['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x5c611f);const _0x4980ce=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x2999c1=this['editor']['data']['toModel'](_0x5c611f);return _0x4980ce||_0x2999c1['markers']['clear'](),this['editor']['data']['stringify'](_0x2999c1);}['_normalizeResponseHeadings'](_0x5c9e01){const _0x28bb75=new _0xfa7595(this['editor']['editing']['view']['document']),_0x4c0dcc=new _0x32df5c({'name':/^h[1-5]$/}),_0xcae331=[];let _0x35d394=!0x1;for(const _0x5bd2a8 of _0x5c9e01)_0x5bd2a8['is']('element')&&_0x4c0dcc['match'](_0x5bd2a8)&&(_0xcae331['push'](_0x5bd2a8),'h1'==_0x5bd2a8['name']&&(_0x35d394=!0x0));if(_0x35d394){for(const _0x39a657 of _0xcae331)_0x28bb75['rename']('h'+(parseInt(_0x39a657['name'][0x1])+0x1),_0x39a657);}}['_isH1TagSupportEnabled'](){const {data:_0x49b38a,editing:_0x409d9f}=this['editor'],_0x280b6a=_0x49b38a['htmlProcessor']['toView']('<h1></h1>'),_0x47ed8a=_0x49b38a['toView'](_0x49b38a['toModel'](_0x280b6a));return!!_0x409d9f['view']['domConverter']['viewToDom'](_0x47ed8a)['querySelector']('h1');}['_sanitizeHTML'](_0x29464a){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x29464a),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4dd01c){const _0x276605=_0x4dd01c['trim']();return _0x276605['startsWith']('```html')?_0x276605['endsWith']('```')?_0x276605['substring'](0x7,_0x276605['length']-0x3):_0x276605['substring'](0x7):_0x4dd01c;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x5dfae4){super(_0x5dfae4),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x5bf713=>i(_0x5dfae4,'AI_'+_0x5bf713['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x5dfae4,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x5dfae4,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x5dfae4,'Stop'));const _0x11e950=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x11e950['if']('isVisible','ck-hidden',_0x515a8c=>!_0x515a8c)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x567bdb,_0x5dba39){const _0x12f1e5=new _0x5be0cc(this['locale']);return _0x12f1e5['set']({'label':_0x567bdb,'class':_0x5dba39||'','isVisible':!0x0,'withText':!0x0}),_0x12f1e5;}}class ct extends _0x2d6b66{['contentFieldView'];['copyButtonView'];constructor(_0x40abf2,_0x1ed4a3=''){super(_0x40abf2),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2a1a96=this['bindTemplate'];this['contentFieldView']=new bt(_0x40abf2,_0x1ed4a3),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x2a1a96['if']('isVisible','ck-hidden',_0x11c050=>!_0x11c050)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x2a1a96['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 _0x4d9eb6=!0x1;this['on']('change:value',(_0x9129cd,_0x45f552,_0x4d9f50)=>{const _0x2d7572=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x4d9f50),this['isProcessing']&&_0x2d7572&&!_0x4d9eb6&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x5cfa2b,_0x3857df,_0x3055ac)=>{_0x4d9eb6=!0x1,_0x3055ac?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4d9eb6=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4d9eb6=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x48185c=this['locale'],_0x19da86=new _0x5be0cc(this['locale']),_0x513774='ck-ai-form__copy-button';return _0x19da86['set']({'label':i(_0x48185c,'Copy'),'icon':_0x17d812,'class':_0x513774,'tooltip':!0x0}),_0x19da86['bind']('isVisible')['to'](this,'value',_0x14843e=>!!_0x14843e),_0x19da86['bind']('isEnabled')['to'](this,'isProcessing',_0x5252fc=>!_0x5252fc),_0x19da86['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x19da86['icon']=_0x43a506,_0x19da86['class']=_0x513774+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x19da86['icon']=_0x17d812,_0x19da86['class']=_0x513774;},0x3e8);}),_0x19da86;}['_copyHTMLToClipboard'](_0x56f174){const {window:_0x5af981,document:_0x260f18}=_0x591f24;if(_0x5af981['ClipboardItem']){const {Blob:_0x3949b2,ClipboardItem:_0x32ed01}=_0x5af981,_0x43a848=[new _0x32ed01({'text/html':new _0x3949b2([_0x56f174['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3949b2([_0x56f174['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x43a848);}else{const _0x137877=_0x260f18['createElement']('div');_0x137877['style']['position']='absolute',_0x137877['style']['left']='-9999px',_0x137877['innerHTML']='<span>[</span>'+_0x56f174['innerHTML']+'<span>]</span>',_0x260f18['body']['appendChild'](_0x137877);const _0x291c76=_0x260f18['createRange']();_0x291c76['setStartAfter'](_0x137877['firstElementChild']),_0x291c76['setEndBefore'](_0x137877['lastElementChild']);const _0xd0df96=_0x5af981['getSelection']();_0xd0df96['removeAllRanges'](),_0xd0df96['addRange'](_0x291c76),_0x260f18['execCommand']('copy'),_0x137877['remove']();}}}class bt extends _0x2d6b66{constructor(_0x2cc39e,_0x49182a=''){super(_0x2cc39e),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x49182a,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xc4ee84){this['element']['innerHTML']=_0xc4ee84;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x139011=new _0x2d6b66(),_0x2e0d44=this['locale'],_0x2292b9=new _0x35faaa();return _0x2292b9['isVisible']=!0x0,_0x139011['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x2292b9,{'text':i(_0x2e0d44,'AI\x20is\x20writing...')}]}),_0x139011['render'](),_0x139011;}}class mt extends _0x2d6b66{constructor(_0x3e769c,_0x5c73f5=''){super(_0x3e769c);const _0x54b810=new _0x330bfc(),_0x29ac84=this['bindTemplate'];this['set']('text',_0x5c73f5),_0x54b810['content']=_0xe85ea,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x54b810,{'text':_0x29ac84['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x3fbf18,_0x57b5b5){super(_0x3fbf18,_0x57b5b5),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',(_0x5a311c,_0x749eff)=>{_0x5a311c['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x749eff());});}['_createSubmitButton'](){const _0x563006=new _0x5be0cc(this['locale']),_0x35f20c=this['locale'];return _0x563006['set']({'icon':it,'label':i(_0x35f20c,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x563006['on']('execute',()=>{this['submit']();}),_0x563006['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x25001e,_0x3b1adf)=>!_0x25001e&&_0x3b1adf),_0x563006;}['_createShowHistoryButton'](){const _0x4b100a=new _0x5be0cc(this['locale']),_0x395726=this['resultsView'],_0x4fb963=this['locale'];_0x4b100a['set']({'label':i(_0x4fb963,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4b100a['bind']('isOn')['to'](_0x395726,'isVisible'),_0x4b100a['bind']('isEnabled')['to'](this,'isEnabled'),_0x4b100a['on']('execute',()=>{_0x395726['isVisible']=!_0x395726['isVisible'],_0x395726['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1b6aed=()=>{_0x591f24['window']['requestAnimationFrame'](()=>{if(_0x405677(this['element'])){const _0x2a676d=new _0x1025cd(this['queryView']['fieldView']['element']),_0x17ea28=_0x2a676d['width'],_0x322d84='rtl'===_0x4fb963['uiLanguageDirection']?'left':'right';_0x2a676d['excludeScrollbarsAndBorders'](),_0x4b100a['element']['style'][_0x322d84]=_0x17ea28-_0x2a676d['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1b6aed),this['on']('render',_0x1b6aed),_0x4b100a;}['submit'](){const _0x76863d=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x76863d);}['focus'](_0x9ecbb1){-0x1===_0x9ecbb1?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0xf48114){super(_0xf48114),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0xf48114,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x440412=0x0;for(const _0x3ec3a2 of this['items'])_0x440412+=_0x3ec3a2['items']['length'];return{'resultsCount':_0x440412,'totalItemsCount':_0x440412};}['_createClearHistoryButton'](){const _0x266e80=this['locale'],_0x3204ab=new _0x5be0cc(this['locale']);return _0x3204ab['set']({'label':'('+i(_0x266e80,'Clear')+')','withText':!0x0}),_0x3204ab['on']('execute',()=>this['fire']('clearHistory')),_0x3204ab;}}class ut extends xt{constructor(_0x3789ba){super();const _0x1871c4=new wt(),_0x1c3789=new _0x5be0cc(this['locale'],_0x1871c4);this['children']['add'](_0x1c3789),_0x1c3789['set']({'label':_0x3789ba['prompt'],'withText':!0x0}),_0x1c3789['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x3789ba['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x4bcf0c{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3f74c7,_0x50a78d)=>{const _0x399065=os(_0x50a78d['prompt']);for(const _0x531269 of this)if(_0x531269!=_0x50a78d&&os(_0x531269['prompt'])===_0x399065){this['remove'](_0x531269);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x446638=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x446638));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x474ba9=>_0x474ba9)));}}function os(_0x28dfcb){return _0x28dfcb['toLowerCase']()['trim']();}class k extends _0x2d6b66{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x31739f,_0x4c3e23,_0x1ec1b0=''){super(_0x31739f),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(_0x31739f),this['contentArea']=new ct(_0x31739f,_0x1ec1b0),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 _0x51587f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4c3e23],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x51587f['if']('isError','ck-hidden',_0x5b3a07=>!_0x5b3a07)]},'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'](_0x45abd8=0x1){-0x1===_0x45abd8?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 _0x4d3501=this['locale'],_0xd9da8d=new lt(_0x4d3501,{'queryView':{'label':i(_0x4d3501,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x4d3501,'Empty\x20history'),'secondary':i(_0x4d3501,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xd9da8d['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2034cb,_0x312d8c)=>_0x2034cb&&!_0x312d8c),this['listenTo'](_0xd9da8d,'submit',(_0x9d1655,_0x3b3b05)=>{this['prompt']=_0x3b3b05;const _0x476fca=ft(_0x3b3b05);this['fire']('submitPrompt',_0x476fca),_0x3b3b05['trim']()&&this['_promptHistory']['add']({'prompt':_0x476fca},0x0);},{'priority':'high'}),_0xd9da8d;}['_createHistoryView'](){const _0x2ebe54=new pt(this['locale']);return _0x2ebe54['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x2ebe54['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2ebe54;}['_createToolbar'](){const _0x4c3966=new at(this['locale']);return _0x4c3966['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x495985,_0x1cc39e,_0x5a6e64)=>_0x495985&&!_0x1cc39e&&!!_0x5a6e64),_0x4c3966['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4c3966['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x22c9ac,_0x45c37a,_0x315057)=>_0x22c9ac&&!_0x45c37a&&!!_0x315057),_0x4c3966['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4c3966['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1bd27b,_0x4c7d4b)=>_0x1bd27b&&!_0x4c7d4b),_0x4c3966['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4c3966['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4c3966['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4c3966;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x121fac=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x121fac,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x521ae6){const _0x5bb829=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x521ae6||i(_0x5bb829,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x2690b2{['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[_0x37d6a8,a,x,_0x61d856];}constructor(_0x2eea9e){super(_0x2eea9e),_0x2eea9e['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2eea9e['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2eea9e['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2eea9e['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x46c851}=this;this['_aiAdapter']=_0x46c851['plugins']['get'](x),this['_dialog']=_0x46c851['plugins']['get'](_0x61d856),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x33cc24=new E(_0x46c851,Array['from'](this['_commandDefinitions']['values']()));_0x46c851['commands']['add']('showAIAssistant',_0x33cc24),_0x46c851['ui']['componentFactory']['add']('aiCommands',_0x477d91=>{const _0x1a05c6=_0x47b7bf(_0x477d91);return _0x1a05c6['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1a05c6['buttonView']['set']({'label':i(_0x477d91,'AI\x20Commands'),'icon':_0x5c7339,'tooltip':!0x0}),_0x1a05c6['on']('execute',_0x92219c=>this['_onExecute'](_0x92219c['source']['id'])),_0x184a03(_0x1a05c6,_0x46c851['ui']['view']['body'],function(_0x369212){const _0x37aed7=o(_0x369212['config']['get']('ai.aiAssistant.commands'),_0x369212['locale']),_0x3a201d=U(_0x369212,_0x37aed7)['filter'](_0x203912=>_0x203912['commands']['length']);if(0x1===_0x3a201d['length'])return U(_0x369212,_0x3a201d[0x0]['commands'])['map'](_0x336a89=>({'id':_0x336a89['id'],'label':_0x336a89['label']}));return _0x3a201d['map'](_0x36f613=>{const {groupId:_0x16bc27,groupLabel:_0x1a3450,commands:_0x31a2fb}=_0x36f613,_0x5a917d=U(_0x369212,_0x31a2fb)['map'](_0x42c507=>({'id':_0x42c507['id'],'label':_0x42c507['label']}));return{'id':_0x16bc27,'menu':_0x1a3450||_0x16bc27,'children':_0x5a917d};});}(_0x46c851),{'ariaLabel':i(_0x477d91,'AI\x20Commands')}),_0x1a05c6['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x33cc24['on']('change:enabledCommandsIds',_0x5d2271),_0x1a05c6['menuView']['once']('render',_0x5d2271),_0x1a05c6;function _0x5d2271(){_0x1a05c6['isEnabled']=_0x33cc24['enabledCommandsIds']['length']>0x0;for(const _0x55059f of _0x1a05c6['menuView']['buttons'])_0x55059f['isEnabled']=_0x33cc24['enabledCommandsIds']['includes'](_0x55059f['id']);}}),_0x46c851['ui']['componentFactory']['add']('menuBar:aiCommands',_0x44cdf7=>{const _0x1cfe0a=new _0x46a21b(_0x44cdf7);_0x1cfe0a['buttonView']['set']({'label':i(_0x44cdf7,'AI\x20Commands'),'icon':_0x5c7339}),_0x1cfe0a['bind']('isEnabled')['to'](_0x33cc24,'enabledCommandsIds',_0x5cf470=>_0x5cf470['length']>0x0);const _0x1984ff=o(_0x46c851['config']['get']('ai.aiAssistant.commands'),_0x44cdf7);return this['_populateMenuBarMenu'](_0x33cc24,_0x1cfe0a,_0x1984ff,_0x36922d=>this['_onExecute'](_0x36922d)),_0x1cfe0a;}),_0x46c851['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x128c82=this['_createAIAssistantUIButton'](_0x5be0cc);return _0x128c82['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x128c82;}),_0x46c851['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x3413de=this['_createAIAssistantUIButton'](_0x49937f);return _0x3413de['set']({'role':'menuitemcheckbox'}),_0x3413de;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x426b23=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x5ab32c;for(const _0x1875e2 in _0x426b23){const _0x263d23=_0x1875e2,_0x45d8d4=_0x426b23[_0x263d23];if('aiLicenseKeyValid'==_0x45d8d4||'aiLicenseKeyInvalid'==_0x45d8d4||'aiLicenseKeyExpired'==_0x45d8d4||'aiLicenseKeyDomainLimit'==_0x45d8d4||'aiLicenseKeyNotAllowed'==_0x45d8d4||'aiLicenseKeyEvaluationLimit'==_0x45d8d4||'aiLicenseKeyTrialLimit'==_0x45d8d4||'aiLicenseKeyUsageLimit'==_0x45d8d4){delete _0x426b23[_0x263d23],_0x5ab32c=_0x45d8d4,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x5ab32c&&_0x426b23['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x5ab32c&&_0x426b23['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x5ab32c&&_0x426b23['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x5ab32c&&_0x426b23['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x5ab32c&&_0x426b23['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x5ab32c&&_0x426b23['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x5ab32c&&_0x426b23['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x1df158='',_0x37b7d1='',_0x293b4e='custom'){const _0x3a4719=this['editor'],_0xcf17b=_0x3a4719['editing']['view'],_0x4be287=_0x3a4719['plugins']['get'](a),_0x1728fc=_0x3a4719['plugins']['get'](_0x37d6a8);_0x4be287['showFakeVisualSelection']();const _0x2b7ef7=new l(),_0x5ac99f=new ClipboardEvent('copy',{'clipboardData':_0x2b7ef7}),_0x4b0aca=new _0x4fdcd4(_0x2b7ef7),_0x30d364=new _0x24bc4b(_0xcf17b,_0x5ac99f,{'dataTransfer':_0x4b0aca});_0x1728fc['_forceMarkersCopy']('comment',()=>{_0xcf17b['document']['fire']('copy',_0x30d364);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x3a4719,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x1ee17a=_0x4b0aca['getData']('text/html');const _0x238791=_0x3a4719['model']['document']['selection'],_0x254150=Array['from'](_0x238791['getRanges']());0x1===_0x254150['length']&&_0x254150[0x0]['isFlat']&&!_0x238791['getSelectedElement']()&&''!==_0x1ee17a['replace'](/&nbsp;/g,'')['trim']()&&(_0x1ee17a='<p>'+_0x1ee17a+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x293b4e,'query':_0x1df158,'htmlContent':_0x1ee17a,'label':_0x37b7d1,'mainActionLabel':_[_0x3a4719['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0xc320f2,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x853c75['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4be287['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x4cd2c3=new Map(),_0xb98e68=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x775086 of _0xb98e68)for(const _0x200a57 of _0x775086['commands'])_0x4cd2c3['set'](_0x200a57['id'],{..._0x200a57,'groupId':_0x775086['groupId'],'groupLabel':_0x775086['groupLabel']||_0x775086['groupId']});return _0x4cd2c3;}['_createAIAssistantUIButton'](_0x13bd94){const _0x3fac9c=this['editor'],_0x2c39f5=_0x3fac9c['commands']['get']('showAIAssistant'),_0x3316aa=new _0x13bd94(_0x3fac9c['locale']);return _0x3316aa['set']({'label':i(_0x3fac9c['locale'],'AI\x20Assistant'),'icon':_0xc320f2,'isToggleable':!0x0}),_0x3316aa['bind']('isEnabled')['to'](_0x2c39f5),_0x3316aa['bind']('isOn')['to'](this['_dialog'],'id',_0x2a86b7=>'aiAssistant'===_0x2a86b7),this['listenTo'](_0x3316aa,'execute',()=>{_0x3316aa['isOn']?this['hideUI']():_0x2c39f5['execute']();}),_0x3316aa;}['_initView'](){const _0x745f5d=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',()=>{_0x745f5d['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x745f5d['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x278713,ui:{ariaLiveAnnouncer:_0x1c3019}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x461ceb,_0x4a8d1a,_0x167746)=>{const _0x1425b8=this['_aiAssistantController']['currentContext'];_0x167746?_0x1c3019['announce'](i(_0x278713,'AI\x20is\x20writing')):_0x1425b8&&_0x1c3019['announce'](i(_0x278713,'Generated\x20content:\x20%0',_0x1425b8),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x5ffb5c,_0x1a931f,_0x2d1721)=>{if(_0x2d1721){const _0xfc57cd=this['_formView']['errorView']['text'];_0x1c3019['announce'](i(_0x278713,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xfc57cd));}});}['_onExecute'](_0x1a718e){const _0x1c1709=this['_commandDefinitions']['get'](_0x1a718e),_0x22aeae=this['editor'],_0xa4c7ef=_0x22aeae['model']['document']['selection'],_0x1b2d9c=_0x22aeae['commands']['get']('showAIAssistant'),_0x57bab0=_0x22aeae['plugins']['get'](a),_0x3e336f=''+(_0x1c1709['groupId']!==K?_0x1c1709['groupLabel']+':\x20':'')+_0x1c1709['label'];if(!0x1!==_0x1c1709['requiresContent']&&_0xa4c7ef['isCollapsed']){const _0x15052f=_0xbbdd6e(_0xa4c7ef['getSelectedBlocks']())||_0x22aeae['model']['schema']['getLimitElement'](_0xa4c7ef);_0x22aeae['model']['change'](_0x3890e4=>{_0x3890e4['setSelection'](_0x15052f,'in');});}_0x57bab0['showFakeVisualSelection'](),_0x1b2d9c['execute'](_0x1c1709['prompt'],_0x3e336f,'command:'+_0x1a718e);}['_populateMenuBarMenu'](_0x1970c6,_0x43f204,_0x59856d,_0x36ee29){const _0xc8e8d=this['editor'],_0x228850=_0xc8e8d['locale'],_0x275e8f=new _0x2f57d2(_0x228850),_0x489d4e=U(_0xc8e8d,_0x59856d)['filter'](_0x1e801a=>_0x1e801a['commands']['length']);0x1===_0x489d4e['length']?this['_getMenuBarGroupButtons']({'command':_0x1970c6,'commands':_0x489d4e[0x0]['commands'],'parentMenuView':_0x43f204,'onExecute':_0x36ee29})['forEach'](_0xacb1a7=>_0x275e8f['items']['add'](_0xacb1a7)):_0x489d4e['forEach'](({groupId:_0x55f443,groupLabel:_0x1b8906,commands:_0x2f2c8a})=>{const _0x2c6d36=new _0x4f0030(_0x228850,_0x43f204),_0x4ee1bb=new _0x46a21b(_0x228850),_0x332245=new _0x2f57d2(_0x228850),_0x506217=this['_getMenuBarGroupButtons']({'command':_0x1970c6,'commands':_0x2f2c8a,'parentMenuView':_0x4ee1bb,'onExecute':_0x36ee29});_0x4ee1bb['buttonView']['set']({'label':_0x1b8906||_0x55f443}),_0x4ee1bb['delegate']('execute')['to'](_0x43f204),_0x332245['items']['addMany'](_0x506217),_0x4ee1bb['panelView']['children']['add'](_0x332245),_0x2c6d36['children']['add'](_0x4ee1bb),_0x275e8f['items']['add'](_0x2c6d36);}),_0x43f204['panelView']['children']['add'](_0x275e8f);}['_getMenuBarGroupButtons']({command:_0x1ed89f,commands:_0x572dfc,parentMenuView:_0x1a04b2,onExecute:_0x42b0f9}){const _0x3fc7b9=this['editor'],_0x346342=_0x3fc7b9['locale'];return U(_0x3fc7b9,_0x572dfc)['map'](_0x4a7684=>{const _0x4252e3=new _0x4f0030(_0x346342,_0x1a04b2),_0x334fe7=new _0x49937f(_0x346342);return _0x334fe7['set']({'label':_0x4a7684['label']}),_0x334fe7['delegate']('execute')['to'](_0x1a04b2),_0x334fe7['on']('execute',()=>_0x42b0f9(_0x4a7684['id'])),_0x334fe7['bind']('isEnabled')['to'](_0x1ed89f,'enabledCommandsIds',_0xf096a4=>_0xf096a4['includes'](_0x4a7684['id'])),_0x4252e3['children']['add'](_0x334fe7),_0x4252e3;});}}function T(_0x596272,_0x2712cf){return void 0x0!==_0x596272['order']&&void 0x0===_0x2712cf['order']?0x1:void 0x0===_0x596272['order']&&void 0x0!==_0x2712cf['order']?-0x1:void 0x0!==_0x596272['order']&&void 0x0!==_0x2712cf['order']?_0x596272['order']-_0x2712cf['order']:0x0;}function U(_0x79e22a,_0x336c0f){_0x336c0f['sort'](T);const _0x387bdd={},_0x33c35=[];for(const _0x347408 of _0x336c0f)if(void 0x0!==_0x347408['order']){if(_0x347408['order']in _0x387bdd)throw new _0x423f6c('ai-commands-config-order-collision',_0x79e22a,{'conflictingDefinitions':[_0x347408,_0x387bdd[_0x347408['order']]]});_0x387bdd[_0x347408['order']]=_0x347408,_0x33c35['splice'](_0x347408['order'],0x0,_0x347408);}else _0x33c35['push'](_0x347408);return _0x33c35;}class At extends _0x2690b2{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xc7e977){super(_0xc7e977);const _0x5d04d1=_0xc7e977['config'],_0x5a4f85=_0xc7e977['locale'];_0x5d04d1['define']('ai.aiAssistant.preserveComments',!0x0),_0x5d04d1['define']('ai.aiAssistant.commands',_t(_0x5a4f85)),_0x5d04d1['define']('ai.aiAssistant.extraCommandGroups',[]),_0x5d04d1['define']('ai.aiAssistant.removeCommands',[]);let _0x321e13=o(_0x5d04d1['get']('ai.aiAssistant.commands'),_0x5a4f85);const _0x1b21ee=_0x5d04d1['get']('ai.aiAssistant.extraCommandGroups'),_0x32dfd8=_0x5d04d1['get']('ai.aiAssistant.removeCommands');_0x1b21ee['forEach'](_0x51dace=>{const _0x173f59=_0x321e13['find'](_0x2baf7c=>_0x2baf7c['groupId']===_0x51dace['groupId']);_0x173f59?_0x173f59['commands']=_0x173f59['commands']['concat'](_0x51dace['commands']):_0x321e13['push'](_0x51dace);}),_0x321e13=_0x321e13['filter'](_0xf3142e=>!_0x32dfd8['includes'](_0xf3142e['groupId'])),_0x321e13['forEach'](_0x393daa=>{_0x393daa['commands']=_0x393daa['commands']['filter'](_0x2ac54e=>!_0x32dfd8['includes'](_0x2ac54e['id']));}),_0x5d04d1['set']('ai.aiAssistant.commands',_0x321e13);}}function _t(_0x4bced8){return[{'groupId':'editOrReview','groupLabel':i(_0x4bced8,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x4bced8,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x4bced8,'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(_0x4bced8,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x4bced8,'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(_0x4bced8,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x4bced8,'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(_0x4bced8,'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(_0x4bced8,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x4bced8,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x4bced8,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x4bced8,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x4bced8,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x4bced8,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x4bced8,'Change\x20style'),'commands':[{'id':'business','label':i(_0x4bced8,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x4bced8,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x4bced8,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x4bced8,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x4bced8,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x4bced8,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x4bced8,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x4bced8,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x4bced8,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x4bced8,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x4bced8,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x4bced8,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x4bced8,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x2690b2{['abortController'];static get['requires'](){return[x];}constructor(_0x333dd0){super(_0x333dd0),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'](_0x56f5bf){return this['sendRequest'](_0x56f5bf)['catch'](_0x3a5c50=>{if(_0x3a5c50 instanceof R)return Promise['reject'](_0x3a5c50);if('AbortError'==_0x3a5c50['name'])return Promise['resolve']();throw console['error'](_0x3a5c50),new _0x423f6c('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x74c3e3,_0x4cd3c9){const _0x937df9=this['editor']['locale'],_0x5614b4={'Content-Type':'application/json'};if('object'==typeof _0x74c3e3)Object['assign'](_0x5614b4,_0x74c3e3);else{if(_0x74c3e3)try{const _0x57057b=await _0x74c3e3(_0x4cd3c9);Object['assign'](_0x5614b4,_0x57057b);}catch{return Promise['reject'](new R(i(_0x937df9,'AI_ERROR_GET_HEADERS')));}}return _0x5614b4;}async['_prepareRequestParameters'](_0x25d7c0,_0x426ec2){const _0x553654=this['editor']['locale'];if('object'==typeof _0x25d7c0)return _0x25d7c0;try{return await _0x25d7c0(_0x426ec2);}catch{return Promise['reject'](new R(i(_0x553654,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4449d9){super(_0x4449d9),_0x4449d9['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4449d9['config']['get']('ai.openAI.requestParameters')||_0x4449d9['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4449d9['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x4449d9['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x4449d9['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x38532d,context:_0x2d9b1f,onData:_0x4db8d2,actionId:_0x4d277b}){const _0x1a32b1=this['editor']['locale'],_0x419da4=await this['prepareMessages'](_0x38532d,_0x2d9b1f,_0x4d277b),_0x3eb64e=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4d277b),_0x5ab934=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4d277b),_0x99ec4a={'messages':_0x419da4,..._0x5ab934},_0x400d9e={'method':'POST','headers':_0x3eb64e,'body':JSON['stringify'](_0x99ec4a),'signal':this['abortController']['signal']},_0x54fa21=await fetch(this['_apiUrl'],_0x400d9e);if(_0x54fa21['ok'])return _0x5ab934['stream']?await this['_readStreamableResponse'](_0x54fa21,_0x4db8d2):await this['_readStaticResponse'](_0x54fa21,_0x4db8d2),Promise['resolve']();{const _0x15c016=await _0x54fa21['text']();return _0x15c016['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x1a32b1,'AI_ERROR_CONTEXT_LENGTH'))):_0x15c016['includes']('Moderation')?Promise['reject'](new R(i(_0x1a32b1,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x15c016));}}async['prepareMessages'](_0x3d1acc,_0x28174c,_0x441ab4){let _0x25195f,_0x4ccf01;return _0x28174c?(_0x25195f='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.',_0x4ccf01='Instruction:\x0a'+_0x3d1acc+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x28174c):(_0x25195f='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.',_0x4ccf01=_0x3d1acc),[{'role':'system','content':_0x25195f},{'role':'user','content':_0x4ccf01}];}async['_readStreamableResponse'](_0x3dbce7,_0x4358bd){const _0x4c109e=_0x3dbce7['body']['getReader'](),_0x4e603f=new TextDecoder();let _0x5b098d='',_0x4e1ffe='',_0x4b05a2='',_0x22b4a9=!0x1;for(;!_0x22b4a9;){const {done:_0x41fa2a,value:_0x61141f}=await _0x4c109e['read'](),_0x1662f4=_0x5b098d+_0x4e603f['decode'](_0x61141f);let _0x39f15c='';_0x22b4a9=_0x41fa2a;try{_0x39f15c=this['_cleanUpData'](_0x1662f4),_0x5b098d='';}catch{_0x5b098d=_0x1662f4;continue;}_0x4e1ffe+=_0x39f15c,!_0x22b4a9&&this['_isBufferIncomplete'](_0x4e1ffe)||_0x4e1ffe&&(_0x4b05a2+=_0x4e1ffe,_0x4e1ffe='',_0x4358bd(_0x4b05a2));}return Promise['resolve']();}async['_readStaticResponse'](_0x40c94d,_0x3b68b8){return _0x3b68b8((await _0x40c94d['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x1dc1e0){const _0x504608=_0x1dc1e0['split']('<')['length']!==_0x1dc1e0['split']('>')['length'],_0x2e81bc=_0x1dc1e0['length']<0x1e;return _0x504608&&_0x2e81bc;}['_cleanUpData'](_0xec6a61){return _0xec6a61['split'](/\n(?![^{]*\})/g)['map'](_0x391bb5=>_0x391bb5['replace']('data:\x20',''))['filter'](_0x22e752=>_0x22e752&&_0x22e752['length']>0x0&&'[DONE]'!==_0x22e752)['map'](_0x3f6e76=>{const {choices:_0x2de53a}=JSON['parse'](_0x3f6e76);if(_0x2de53a[0x0]?.['delta']?.['content'])return _0x2de53a[0x0]['delta']['content'];})['filter'](_0x2f5edb=>_0x2f5edb)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x5b9e38){super(_0x5b9e38),_0x5b9e38['config']['get']('ai.aws.requestParameters')||_0x5b9e38['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']=_0x5b9e38['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x5b9e38['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x5b9e38['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x5b9e38['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x380dd5,context:_0x5896f2,onData:_0x68683f,actionId:_0x56663e}){const {model:_0x144d27,stream:_0x2de62a,..._0x1fe01b}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x56663e),_0x4036dc={'prompt':await this['preparePrompt'](_0x380dd5,_0x5896f2,_0x144d27,_0x56663e),..._0x1fe01b};this['_apiUrl']?await this['_processProxyRequest'](_0x4036dc,_0x144d27,_0x2de62a,_0x68683f,_0x56663e):await this['_processAWSRequest'](_0x4036dc,_0x144d27,_0x2de62a,_0x68683f);}async['preparePrompt'](_0x102c3c,_0x4fdc03,_0x51d385,_0x1067be){let _0x17d4e1,_0x2c3fd9;return _0x4fdc03?(_0x17d4e1='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.',_0x2c3fd9='Instruction:\x0a'+_0x102c3c+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4fdc03):(_0x17d4e1='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.',_0x2c3fd9=_0x102c3c),'meta.llama'==this['getModelFamily'](_0x51d385)?'<<SYS>>\x0a'+_0x17d4e1+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2c3fd9+'\x0a[/INST]':'Human:\x0a'+_0x17d4e1+'\x0a'+_0x2c3fd9+'\x0a\x0aAssistant:';}['getModelFamily'](_0x2d94b4){if(/^anthropic\.claude/['test'](_0x2d94b4))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x2d94b4))return'ai21.j2';if(/^cohere\.command/['test'](_0x2d94b4))return'cohere.command';if(/^meta\.llama/['test'](_0x2d94b4))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x2d94b4));}async['_processProxyRequest'](_0x28c8a3,_0x34e9e4,_0x38fe3c,_0x33f1e5,_0x449906){const _0x8539c8={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x449906),'body':JSON['stringify']({..._0x28c8a3,'model':_0x34e9e4,'stream':_0x38fe3c}),'signal':this['abortController']['signal']},_0x540abb=await fetch(this['_apiUrl'],_0x8539c8);_0x38fe3c?await this['_readStreamableResponse'](_0x540abb,_0x34e9e4,_0x33f1e5):await this['_readStaticResponse'](_0x540abb,_0x34e9e4,_0x33f1e5);}async['_processAWSRequest'](_0x54e772,_0x232e89,_0x434e1d,_0x158e65){const _0xe0f7fe=new _0x298227(this['_bedrockClientConfig']),_0x49f036={'body':JSON['stringify'](_0x54e772),'contentType':'application/json','accept':'application/json','modelId':_0x232e89};let _0x3c4ec7;if(_0x434e1d){const _0x4be583=new _0x841a7f(_0x49f036);_0x3c4ec7=await _0xe0f7fe['send'](_0x4be583,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x3c4ec7,_0x232e89,_0x158e65);}else{const _0x133951=new _0xb79abd(_0x49f036);_0x3c4ec7=await _0xe0f7fe['send'](_0x133951,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x3c4ec7,_0x232e89,_0x158e65);}}async['_readAsyncIterableResponse'](_0xa05f47,_0x7849a3,_0x1ecbfe){const _0x538b78=_0xa05f47['body'],_0x125ec8=new TextDecoder('utf-8');let _0x442342='';for await(const _0xae7412 of _0x538b78)if(_0xae7412['chunk']){const _0x1d28f6=_0x125ec8['decode'](_0xae7412['chunk']['bytes']),_0x39015a=JSON['parse'](_0x1d28f6);_0x442342+=this['_getGeneratedText'](_0x39015a,_0x7849a3),_0x1ecbfe(_0x442342);}return Promise['resolve']();}async['_readStreamableResponse'](_0x13d44d,_0x4f847f,_0x197b57){const _0x1f7f85=_0x13d44d['body'],_0x3584f1=new TextDecoder('utf-8'),_0x4f108c=_0x1f7f85['getReader']();let _0x55d67e='',_0x40a51c='',_0x493011=!0x1;for(;!_0x493011;){const {done:_0x2affca,value:_0x3f29f1}=await _0x4f108c['read']();if(_0x493011=_0x2affca,_0x493011)break;const _0x282d83=(_0x55d67e+_0x3584f1['decode'](_0x3f29f1))['split']('\x0a')['map'](_0x2df583=>{try{return _0x55d67e='',JSON['parse'](_0x2df583);}catch{return _0x55d67e=_0x2df583,null;}})['filter'](_0x29ff82=>null!==_0x29ff82);_0x282d83['length']&&(_0x40a51c+=_0x282d83['map'](_0x18c230=>this['_getGeneratedText'](_0x18c230,_0x4f847f))['join'](''),_0x197b57(_0x40a51c));}return Promise['resolve']();}async['_readStaticResponse'](_0x1f40e8,_0x560af1,_0x28ce84){let _0x17b488;return _0x17b488=_0x1f40e8 instanceof Response?await _0x1f40e8['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x1f40e8['body'])),(_0x28ce84(this['_getGeneratedText'](_0x17b488,_0x560af1)),Promise['resolve']());}['_getGeneratedText'](_0x49cd6a,_0x40d66c){switch(this['getModelFamily'](_0x40d66c)){case'anthropic.claude':return _0x49cd6a['completion'];case'ai21.j2':return _0x49cd6a['completions'][0x0]['data']['text'];case'cohere.command':return _0x49cd6a['generations'][0x0]['text'];case'meta.llama':return _0x49cd6a['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 _0xd548d4,Command as _0x5ea6f8}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5364ac,IconCheck as _0x1ec2f1,IconError as _0x167c8a,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x5854e8,IconRobotPencil as _0x17289f}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x1bb2f4,CKEditorError as _0x3d67af,ObservableMixin as _0x446068,global as _0x5014a5,isVisible as _0x4b919d,Rect as _0xe138ac,Collection as _0x1282bd,FocusTracker as et,KeystrokeHandler as rt,first as _0x431bf4}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x569b8f,View as _0x239a64,SpinnerView as _0x406e2d,IconView as _0x294804,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x48842c,createDropdown as _0x191aee,addMenuToDropdown as _0x350b9c,MenuBarMenuView as _0x280eea,MenuBarMenuListItemButtonView as _0x23913f,DialogViewPosition as _0x30974c,MenuBarMenuListView as _0x15c79c,MenuBarMenuListItemView as _0x390bbd}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x56e3b7,ClipboardMarkersUtils as _0x47ed07}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x418e3f,ViewDataTransfer as _0x1ae4bb,ViewUpcastWriter as _0x2aea8a,Matcher as _0xbfc6f2}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0xd4624f,InvokeModelWithResponseStreamCommand as _0x3dbc37,InvokeModelCommand as _0x2bda03}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x2645d6,_0x7f7838){const _0x5759ec=(0x0,_0x7f7838['t'])('Other');return _0x2645d6['length']?'groupId'in _0x2645d6[0x0]?_0x2645d6:[{'groupId':K,'groupLabel':_0x5759ec,'order':0x1/0x0,'commands':_0x2645d6}]:[{'groupId':K,'groupLabel':_0x5759ec,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0xd548d4{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0xfe8ec2}=this,_0x54743a=['ck-fake-ai-selection'];_0xfe8ec2['config']['get']('ai.useTheme')&&_0x54743a['push']('ck-ai-assistant-ui_theme'),_0xfe8ec2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x54743a,'priority':0xc}}),_0xfe8ec2['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x1e51c6,{writer:_0x4c4f3f})=>{if(!_0x1e51c6['markerRange']['isCollapsed'])return null;const _0x45dbfe=_0x4c4f3f['createUIElement']('span');return _0x4c4f3f['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x45dbfe),_0x45dbfe;}});}['afterInit'](){!async function(_0x543bdd){const _0x4fc773=_0x36de54([0x77,0x62,0x57,0x56,0x47,0x5a,0x4a,0x6e,0x41,0x49,0x35,0x37,0x6c,0x63,0x79,0x58,0x71,0x33,0x69,0x6a,0x34,0x74,0x67,0x76,0x68,0x36,0x6b,0x6f,0x55,0x51,0x43,0x45,0x61,0x30,0x78,0x52,0x32,0x54,0x42,0x64,0x46,0x38,0x73,0x65,0x53,0x44,0x59,0x39,0x4d,0x66,0x48,0x4b,0x50,0x72,0x4c,0x6d,0x31,0x4e,0x75,0x7a,0x70,0x4f]),_0x582ceb=0x313d70fa,_0x5d0b29=0x313a1faa^_0x582ceb,_0x4b3259=window[_0x36de54([0x44,0x61,0x74,0x65])][_0x36de54([0x6e,0x6f,0x77])](),_0x333b57=_0x543bdd[_0x36de54([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x24bc6c=new window[(_0x36de54([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4ad9b6=>{_0x333b57[_0x36de54([0x6f,0x6e,0x63,0x65])](_0x36de54([0x72,0x65,0x61,0x64,0x79]),_0x4ad9b6);}),_0x55c03f={[_0x36de54([0x6b,0x74,0x79])]:_0x36de54([0x45,0x43]),[_0x36de54([0x75,0x73,0x65])]:_0x36de54([0x73,0x69,0x67]),[_0x36de54([0x63,0x72,0x76])]:_0x36de54([0x50,0x2d,0x32,0x35,0x36]),[_0x36de54([0x78])]:_0x36de54([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]),[_0x36de54([0x79])]:_0x36de54([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]),[_0x36de54([0x61,0x6c,0x67])]:_0x36de54([0x45,0x53,0x32,0x35,0x36])},_0x4c6af8=_0x333b57[_0x36de54([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x36de54([0x67,0x65,0x74])](_0x36de54([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0xe9754b(){let _0xaedbcf,_0x23cb15=null,_0x3e9069=null;try{if(_0x4c6af8==_0x36de54([0x47,0x50,0x4c]))return _0x36de54([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0xaedbcf=_0x199a34(),!_0xaedbcf)return _0x36de54([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0xaedbcf[_0x36de54([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3e9069=_0x3e3756(_0xaedbcf[_0x36de54([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0xaedbcf[_0x36de54([0x6a,0x74,0x69])])),await _0x2b9eff()?_0x9f8cd1()?_0x2f36a6()?_0x36de54([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1085ee()?(_0xaedbcf[_0x36de54([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x36de54([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x23cb15=_0x319a46(_0x36de54([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0xaedbcf[_0x36de54([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x36de54([0x74,0x72,0x69,0x61,0x6c])&&(_0x23cb15=_0x319a46(_0x36de54([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x1d34a2()):_0x36de54([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x36de54([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x36de54([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x36de54([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2f36a6(){const _0x4446d5=[_0x36de54([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x36de54([0x74,0x72,0x69,0x61,0x6c])][_0x36de54([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xaedbcf[_0x36de54([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x4b3259/0x3e8:0xe10*_0x5d0b29;return _0xaedbcf[_0x36de54([0x65,0x78,0x70])]<_0x4446d5;}function _0x9f8cd1(){const _0x169cbe=_0xaedbcf[_0x36de54([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x169cbe&&(!!_0x169cbe[_0x36de54([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x36de54([0x2a]))||!!_0x169cbe[_0x36de54([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x36de54([0x41,0x49])));}function _0x1085ee(){const _0x19fffd=_0xaedbcf[_0x36de54([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x19fffd||0x0==_0x19fffd[_0x36de54([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x29b43e}=new URL(window[_0x36de54([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x19fffd[_0x36de54([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x29b43e))return!0x0;const _0x3534aa=_0x29b43e[_0x36de54([0x73,0x70,0x6c,0x69,0x74])](_0x36de54([0x2e]));return _0x19fffd[_0x36de54([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x37ff6c=>_0x37ff6c[_0x36de54([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x36de54([0x2a])))[_0x36de54([0x6d,0x61,0x70])](_0x22269c=>_0x22269c[_0x36de54([0x73,0x70,0x6c,0x69,0x74])](_0x36de54([0x2e])))[_0x36de54([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x25d963=>_0x25d963[_0x36de54([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x3534aa[_0x36de54([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x36de54([0x6d,0x61,0x70])](_0x48b632=>Array(_0x3534aa[_0x36de54([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x48b632[_0x36de54([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x36de54([0x66,0x69,0x6c,0x6c])](_0x48b632[0x0]===_0x36de54([0x2a])?_0x36de54([0x2a]):'')[_0x36de54([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x48b632))[_0x36de54([0x73,0x6f,0x6d,0x65])](_0x2d6164=>_0x3534aa[_0x36de54([0x65,0x76,0x65,0x72,0x79])]((_0x2dbc5d,_0x80fb55)=>_0x2d6164[_0x80fb55]===_0x2dbc5d||_0x2d6164[_0x80fb55]===_0x36de54([0x2a])));}function _0x1d34a2(){return _0x23cb15&&_0x3e9069?new window[(_0x36de54([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xf5ebc8,_0x329f15)=>{_0x23cb15[_0x36de54([0x74,0x68,0x65,0x6e])](_0xf5ebc8,_0x329f15),_0x3e9069[_0x36de54([0x74,0x68,0x65,0x6e])](_0x51ab29=>{_0x51ab29!=_0x36de54([0x56,0x61,0x6c,0x69,0x64])&&_0xf5ebc8(_0x51ab29);},_0x329f15);}):_0x23cb15||_0x3e9069||_0x36de54([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3e3756(_0x399991,_0x32a268){return new window[(_0x36de54([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xdef47e=>{if(_0x3d2c59())return _0xdef47e(_0x36de54([0x56,0x61,0x6c,0x69,0x64]));_0x1805aa(),_0x333b57[_0x36de54([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x36de54([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x35407a=!0x1;const _0x8b3e5f=_0x1bb2f4();function _0x4e5af6(_0x2363e9){return!!_0x2363e9&&(typeof _0x2363e9===_0x36de54([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2363e9===_0x36de54([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2363e9[_0x36de54([0x74,0x68,0x65,0x6e])]===_0x36de54([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2363e9[_0x36de54([0x63,0x61,0x74,0x63,0x68])]===_0x36de54([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2cbc54(_0xe5502a){_0x47590a(_0xe5502a)[_0x36de54([0x74,0x68,0x65,0x6e])](_0x2b0489=>{if(!_0x2b0489||_0x2b0489[_0x36de54([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x36de54([0x6f,0x6b]))return _0x36de54([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x566209(_0x429457(_0x8b3e5f+_0x32a268))!=_0x2b0489[_0x36de54([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x36de54([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x36de54([0x56,0x61,0x6c,0x69,0x64]);})[_0x36de54([0x74,0x68,0x65,0x6e])](_0x53aa16=>(_0x292616(),_0x53aa16),()=>{const _0x6d2393=_0x4ff6ac();return null==_0x6d2393?(_0x292616(),_0x36de54([0x56,0x61,0x6c,0x69,0x64])):_0x36de54(_0x4b3259-_0x6d2393>(0x1531f4fa^_0x582ceb)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x36de54([0x74,0x68,0x65,0x6e])](_0xdef47e)[_0x36de54([0x63,0x61,0x74,0x63,0x68])](()=>{_0xdef47e(_0x36de54([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x4dc051=0x310b9e7a^_0x582ceb;function _0x292616(){const _0x1e2867=_0x36de54([0x6c,0x6c,0x63,0x74,0x2d])+_0x566209(_0x429457(_0x399991)),_0x291013=_0x39d3dd(_0x566209(window[_0x36de54([0x4d,0x61,0x74,0x68])][_0x36de54([0x63,0x65,0x69,0x6c])](_0x4b3259/_0x4dc051)));window[_0x36de54([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x36de54([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1e2867,_0x291013);}function _0x4ff6ac(){const _0x3fee0a=_0x36de54([0x6c,0x6c,0x63,0x74,0x2d])+_0x566209(_0x429457(_0x399991)),_0x3f5944=window[_0x36de54([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x36de54([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3fee0a);return _0x3f5944?window[_0x36de54([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x39d3dd(_0x3f5944),0x10)*_0x4dc051:null;}function _0x47590a(_0x20b8f6){return new window[(_0x36de54([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xd3e88b,_0x433aa3)=>{_0x20b8f6[_0x36de54([0x74,0x68,0x65,0x6e])](_0xd3e88b,_0x433aa3),window[_0x36de54([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x433aa3,0x313ca43a^_0x582ceb);});}}_0x333b57[_0x36de54([0x6f,0x6e])](_0x36de54([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5ee2a5,_0xfe949)=>{if(_0xfe949[0x0]!=_0x399991)return _0xdef47e(_0x36de54([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0xfe949[0x1]={..._0xfe949[0x1],[_0x36de54([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x8b3e5f};},{[_0x36de54([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x36de54([0x68,0x69,0x67,0x68])}),_0x333b57[_0x36de54([0x6f,0x6e])](_0x36de54([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x29e65e=>{_0x4e5af6(_0x29e65e[_0x36de54([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x35407a=!0x0,_0x2cbc54(_0x29e65e[_0x36de54([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x36de54([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x36de54([0x6c,0x6f,0x77])}),_0x24bc6c[_0x36de54([0x74,0x68,0x65,0x6e])](()=>{_0x35407a||_0xdef47e(_0x36de54([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3d2c59(){return _0x333b57[_0x36de54([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x36de54([0x76,0x69,0x65,0x77])][_0x36de54([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x36de54([0x61,0x75,0x74,0x6f]);}function _0x1805aa(){_0x333b57[_0x36de54([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x36de54([0x76,0x69,0x65,0x77])][_0x36de54([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x36de54([0x61,0x75,0x74,0x6f]);}}function _0x319a46(_0x11889b){const _0x58394e=[new window[(_0x36de54([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3e7a58=>setTimeout(_0x3e7a58,0x31344e36^_0x582ceb)),_0x24bc6c[_0x36de54([0x74,0x68,0x65,0x6e])](()=>new window[(_0x36de54([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5b3fe3=>{let _0xcaa2ac=0x0;_0x333b57[_0x36de54([0x6d,0x6f,0x64,0x65,0x6c])][_0x36de54([0x6f,0x6e])](_0x36de54([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x383a01,_0x4244f9)=>{_0x4244f9[0x0][_0x36de54([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0xcaa2ac++,_0xcaa2ac==(0x313d7102^_0x582ceb)&&(_0x5b3fe3(),_0x383a01[_0x36de54([0x6f,0x66,0x66])]());});}))];return window[_0x36de54([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x36de54([0x72,0x61,0x63,0x65])](_0x58394e)[_0x36de54([0x74,0x68,0x65,0x6e])](()=>_0x11889b);}async function _0x51797c(){await _0x24bc6c,_0x333b57[_0x36de54([0x6d,0x6f,0x64,0x65,0x6c])][_0x36de54([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x46faee,_0x333b57[_0x36de54([0x6d,0x6f,0x64,0x65,0x6c])][_0x36de54([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x46faee,_0x333b57[_0x36de54([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x36de54([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x388f62(_0x2ae30e){const _0x219cb3=_0x3b1de8();_0x333b57[_0x219cb3]=_0x36de54([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x2ae30e,_0x2ae30e!=_0x36de54([0x56,0x61,0x6c,0x69,0x64])&&_0x51797c();}function _0x3b1de8(){const _0x2a7d28=window[_0x36de54([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x36de54([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x36de54([0x6e,0x6f,0x77])]())[_0x36de54([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x36de54([0x2e]),'');let _0x2ce8f2=_0x36de54([0x77]);for(let _0x23ac2b=0x0;_0x23ac2b<_0x2a7d28[_0x36de54([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x23ac2b+=0x2){let _0x3624f6=window[_0x36de54([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2a7d28[_0x36de54([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x23ac2b,_0x23ac2b+0x2));_0x3624f6>=_0x4fc773[_0x36de54([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3624f6-=_0x4fc773[_0x36de54([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x2ce8f2+=_0x4fc773[_0x3624f6];}return _0x2ce8f2;}function _0x199a34(){const _0x2a2a34=_0x4c6af8[_0x36de54([0x73,0x70,0x6c,0x69,0x74])](_0x36de54([0x2e]));if(0x3!=_0x2a2a34[_0x36de54([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x14bbbc(_0x2a2a34[0x1]);function _0x14bbbc(_0x1bdbb7){const _0x4e7dd4=_0x104ab9(_0x1bdbb7);return _0x4e7dd4&&_0x1193ac()?_0x4e7dd4:null;function _0x1193ac(){const _0x3c7a23=_0x4e7dd4[_0x36de54([0x6a,0x74,0x69])],_0x529804=window[_0x36de54([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3c7a23[_0x36de54([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3c7a23[_0x36de54([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x29bad5={..._0x4e7dd4,[_0x36de54([0x6a,0x74,0x69])]:_0x3c7a23[_0x36de54([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3c7a23[_0x36de54([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x29bad5[_0x36de54([0x76,0x63])],_0x429457(_0x29bad5)==_0x529804;}}}async function _0x2b9eff(){let _0xfe3c44=!0x0;try{const _0x4c5684=_0x4c6af8[_0x36de54([0x73,0x70,0x6c,0x69,0x74])](_0x36de54([0x2e])),[_0xe91b2c,_0x17af65,_0x3ef58b]=_0x4c5684;return _0x43385b(_0xe91b2c),await _0x565d74(_0xe91b2c,_0x17af65,_0x3ef58b),_0xfe3c44;}catch{return!0x1;}function _0x43385b(_0x1e9842){const _0x44fbd4=_0x104ab9(_0x1e9842);_0x44fbd4&&_0x44fbd4[_0x36de54([0x61,0x6c,0x67])]==_0x36de54([0x45,0x53,0x32,0x35,0x36])||(_0xfe3c44=!0x1);}async function _0x565d74(_0x1569f8,_0x342232,_0x178719){const _0x18e7ea=window[_0x36de54([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x36de54([0x66,0x72,0x6f,0x6d])](_0x5eef43(_0x178719),_0x520e10=>_0x520e10[_0x36de54([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x3e4715=new window[(_0x36de54([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x36de54([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x1569f8+_0x36de54([0x2e])+_0x342232),_0xe11d4=window[_0x36de54([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x36de54([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0xe11d4)return;const _0x57dd12=await _0xe11d4[_0x36de54([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x36de54([0x6a,0x77,0x6b]),_0x55c03f,{[_0x36de54([0x6e,0x61,0x6d,0x65])]:_0x36de54([0x45,0x43,0x44,0x53,0x41]),[_0x36de54([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x36de54([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x36de54([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0xe11d4[_0x36de54([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x36de54([0x6e,0x61,0x6d,0x65])]:_0x36de54([0x45,0x43,0x44,0x53,0x41]),[_0x36de54([0x68,0x61,0x73,0x68])]:{[_0x36de54([0x6e,0x61,0x6d,0x65])]:_0x36de54([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x57dd12,_0x18e7ea,_0x3e4715)||(_0xfe3c44=!0x1);}}function _0x104ab9(_0x54f433){return _0x54f433[_0x36de54([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x36de54([0x65,0x79]))?JSON[_0x36de54([0x70,0x61,0x72,0x73,0x65])](_0x5eef43(_0x54f433)):null;}function _0x5eef43(_0x2322a9){return window[_0x36de54([0x61,0x74,0x6f,0x62])](_0x2322a9[_0x36de54([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x36de54([0x2b]))[_0x36de54([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x36de54([0x2f])));}function _0x429457(_0x21cd07){let _0x491d72=0x1505;function _0x3f2968(_0x28b229){for(let _0x3df4c4=0x0;_0x3df4c4<_0x28b229[_0x36de54([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3df4c4++){const _0x5986b7=_0x28b229[_0x36de54([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x3df4c4);_0x491d72=(_0x491d72<<0x5)+_0x491d72+_0x5986b7,_0x491d72&=_0x491d72;}}function _0x3ba90e(_0x3c333e){Array[_0x36de54([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3c333e)?_0x3c333e[_0x36de54([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x3ba90e):_0x3c333e&&typeof _0x3c333e==_0x36de54([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x36de54([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3c333e)[_0x36de54([0x73,0x6f,0x72,0x74])]()[_0x36de54([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x406b15,_0x5bd890])=>{_0x3f2968(_0x406b15),_0x3ba90e(_0x5bd890);}):_0x3f2968(window[_0x36de54([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3c333e));}return _0x3ba90e(_0x21cd07),_0x491d72>>>0x0;}function _0x566209(_0x5df6e3){return _0x5df6e3[_0x36de54([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x36de54([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x36de54([0x30]));}function _0x39d3dd(_0x541407){return _0x541407[_0x36de54([0x73,0x70,0x6c,0x69,0x74])]('')[_0x36de54([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x36de54([0x6a,0x6f,0x69,0x6e])]('');}function _0x46faee(){}function _0x36de54(_0x5e9541){return _0x5e9541['map'](_0x51eb1e=>String['fromCharCode'](_0x51eb1e))['join']('');}_0x388f62(await _0xe9754b());}(this);}['showFakeVisualSelection'](){const _0x544242=this['editor']['model'];_0x544242['change'](_0x3a7187=>{const _0x34c128=_0x544242['document']['selection']['getRanges']();let _0x5dc674=0x0;for(const _0x146573 of _0x34c128){const _0x10acef=w+':'+_0x5dc674;if(_0x544242['markers']['has'](_0x10acef))_0x3a7187['updateMarker'](_0x10acef,{'range':_0x146573});else{if(_0x146573['start']['isAtEnd']){const _0x432df6=_0x146573['start']['getLastMatchingPosition'](({item:_0x37267f})=>!_0x544242['schema']['isContent'](_0x37267f),{'boundaries':_0x146573});_0x3a7187['addMarker'](_0x10acef,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3a7187['createRange'](_0x432df6,_0x146573['end'])});}else _0x3a7187['addMarker'](_0x10acef,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x146573});}_0x5dc674++;}});}['hideFakeVisualSelection'](){const _0x29c788=this['editor']['model'],_0x38e667=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x38e667['length']&&_0x29c788['change'](_0x84a555=>{_0x38e667['forEach'](_0x44b404=>{_0x84a555['removeMarker'](_0x44b404);});});}['insertContent'](_0x5e163b,_0x50477c){const _0x2ee08d=this['_getAISelection'](),_0x52feeb=_0x50477c||_0x2ee08d['getFirstRange']();this['editor']['model']['canEditAt'](_0x52feeb)&&this['editor']['model']['change'](_0x298364=>{this['hideFakeVisualSelection'](),_0x50477c||this['_resetContentOfSelectedTableCells'](_0x298364,_0x2ee08d),this['_pasteHTMLUsingClipboard']({'insertAt':_0x52feeb,'writer':_0x298364,'html':_0x5e163b});});}['insertContentBelow'](_0x1462f5){const {model:_0x30930b}=this['editor'],_0x24e29b=this['_getAISelection']();_0x30930b['change'](()=>{const _0x23cdd0=this['_prepareTableInsertBelowPosition'](_0x1462f5,_0x24e29b)||this['_getDefaultInsertBelowPosition'](_0x24e29b);this['insertContent'](_0x1462f5,_0x23cdd0);});}['_getAISelection'](){const _0xac4a53=this['editor']['model'],_0x117a8b=Array['from'](_0xac4a53['markers']['getMarkersGroup'](w))['map'](_0x4f1be9=>_0x4f1be9['getRange']());return _0xac4a53['createSelection'](_0x117a8b);}['_pasteHTMLUsingClipboard']({writer:_0x437266,html:_0x953622,insertAt:_0x1d6666}){const {view:_0x3aa0f9}=this['editor']['editing'],_0x1a7164=this['editor']['plugins']['get'](_0x56e3b7),_0x3d7be1=new gt();_0x3d7be1['setData']('text/html',_0x953622);const _0x49f154=new ClipboardEvent('paste',{'clipboardData':_0x3d7be1}),_0x2f3d08=new _0x418e3f(_0x3aa0f9,_0x49f154,{'dataTransfer':new _0x1ae4bb(_0x3d7be1)});_0x437266['setSelection'](_0x1d6666);const _0x518a5a=(_0x255cfe,_0x19dd84)=>{_0x19dd84['resultRange']&&_0x437266['setSelection'](_0x19dd84['resultRange']);};_0x1a7164['once']('contentInsertion',_0x518a5a,{'priority':'lowest'}),_0x3aa0f9['document']['fire']('paste',_0x2f3d08),_0x1a7164['off']('contentInsertion',_0x518a5a);}['_getDefaultInsertBelowPosition'](_0x11f9a9){const {model:_0x5b503d}=this['editor'],_0x4293d0=Array['from'](_0x11f9a9['getSelectedBlocks']());return _0x4293d0['length']?_0x5b503d['createPositionAfter'](_0x4293d0['pop']()):_0x11f9a9['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x65519c,_0x179826){const {model:_0x118900,plugins:_0x4d75e2}=this['editor'];if(_0x4d75e2['has']('TableUtils')){const _0x2bb3d9=_0x4d75e2['get']('TableUtils')['getSelectedTableCells'](_0x179826);if(_0x2bb3d9['length']){const _0x3333d0=this['_getTableRowCountFromContent'](_0x65519c),_0x11d45a=this['_createEmptyTableRows'](_0x2bb3d9,_0x3333d0);return _0x118900['createPositionAt'](_0x11d45a,0x0);}}return null;}['_getTableRowCountFromContent'](_0xb2a970){const _0x12a026=this['editor']['plugins']['get']('TableUtils'),_0x575114=this['editor']['data']['parse'](_0xb2a970),_0x4c6a51=Array['from'](_0x575114['getChildren']())['filter'](_0x55aa88=>_0x55aa88['is']('element','table'));let _0x16a061=0x0;return _0x4c6a51['forEach'](_0x1577e9=>{_0x16a061+=_0x12a026['getRows'](_0x1577e9);}),_0x16a061;}['_createEmptyTableRows'](_0x20449f,_0x2bd271){const _0xc96310=this['editor']['plugins']['get']('TableUtils'),_0x1869fa=_0xc96310['getRowIndexes'](_0x20449f),_0x18775f=_0xc96310['getColumnIndexes'](_0x20449f),_0xc2f4f2=_0x1869fa['last']+0x1,_0x49c639=_0x18775f['first'],_0x12040e=_0x20449f[0x0]['findAncestor']('table');for(let _0x380761=0x0;_0x380761<_0x2bd271;_0x380761++)_0xc96310['insertRows'](_0x12040e,{'at':_0xc2f4f2});return _0x12040e['getChild'](_0xc2f4f2)['getChild'](_0x49c639);}['_resetContentOfSelectedTableCells'](_0x523eed,_0x3a287c){const {plugins:_0x1429ee}=this['editor'],{model:_0x384460}=_0x523eed;if(!_0x1429ee['has']('TableUtils'))return;_0x1429ee['get']('TableUtils')['getSelectedTableCells'](_0x3a287c)['length']&&_0x384460['deleteContent'](_0x3a287c);}}class x extends _0xd548d4{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x3d67af('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x173755){super(_0x173755),this['name']='AIRequestError';}}function i(_0x33dfea,_0x5259b5,_0x3cd518){const t=_0x33dfea['t'];switch(_0x5259b5){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',_0x3cd518);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3cd518);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'},_0x3cd518);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 _0x5259b5;}}class E extends _0x5ea6f8{['_commandDefinitions'];constructor(_0x5aa6e7,_0x3faa06){super(_0x5aa6e7),this['_commandDefinitions']=_0x3faa06,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x2a085f,_0x1df744,_0x58c96a)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x58c96a));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x8f5ae,_0x274f6d,_0xd966ce)=>{this['enabledCommandsIds']=_0xd966ce?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x4aa444=this['editor']['model'];this['_hasContext']=function(_0x232599){const _0x114920=_0x232599['document']['selection'];return _0x114920['isCollapsed']?0x0!==[..._0x114920['getSelectedBlocks']()]['length']&&![..._0x114920['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x232599['hasContent'](_0x114920['getFirstRange']());}(_0x4aa444);const _0x11c060=_0x4aa444['document']['selection'],_0x39783e=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x3b9dda of _0x11c060['getRanges']())for(const _0x551d2d of _0x3b9dda['getItems']())if(_0x551d2d['is']('element')&&_0x39783e['includes'](_0x551d2d['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x38122f='',_0x53db95='',_0x43aa17='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x38122f,_0x53db95,_0x43aa17);}}function F(_0x4aa215,_0x444e80){const _0x48a582=new Set();for(const _0x2d5632 of _0x4aa215['values']())(_0x444e80||!0x1===_0x2d5632['requiresContent'])&&_0x48a582['add'](_0x2d5632['id']);return Array['from'](_0x48a582);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ _0x446068(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x37234f,_0x3b03b1,_0x5e801c){super(),this['editor']=_0x37234f,this['textAdapter']=_0x3b03b1,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x5e801c,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4686c6,_0x24395b,_0x340bc1)=>{this['view']['value']=this['_sanitizeHTML'](_0x340bc1);}),this['listenTo'](this['view'],'submitPrompt',(_0x4961d6,_0x2ea799)=>{const _0x5cf377=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x2ea799,_0x5cf377,'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:_0x1f540d,query:_0x592306,htmlContent:_0x7ef7c2,label:_0xfc7c3e,mainActionLabel:_0x294028}){this['view']['prompt']=_0xfc7c3e,this['view']['mainAction']=_0x294028,this['initialContext']=_0x7ef7c2,_0x592306&&(this['view']['isRendered']?this['_handleQuery'](_0x592306,_0x7ef7c2,_0x1f540d,_0xfc7c3e):this['view']['once']('render',()=>{this['_handleQuery'](_0x592306,_0x7ef7c2,_0x1f540d,_0xfc7c3e);}));}['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'](_0x2db618,_0x525bd2,_0x3cc982,_0x481708){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x525bd2,this['previousQuery']=_0x2db618,this['previousLabel']=_0x481708||_0x2db618,this['previousActionId']=_0x3cc982,new Promise(_0x38ca19=>{this['textAdapter']['makeRequest']({'query':_0x2db618,'context':_0x525bd2,'onData':_0x3cd2df=>{this['currentResponse']=_0x3cd2df,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x3cc982})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x9e975f=>{_0x9e975f instanceof R?this['view']['handleError'](_0x9e975f['message']):this['view']['handleError'](),_0x38ca19();})['finally'](()=>{this['stopProcessing'](),_0x38ca19();});});}['_parseAndNormalizeContent'](_0x25ab5e,_0x2da170=!0x1){const _0x488a12=Q['exec'](_0x25ab5e);_0x25ab5e=_0x488a12?_0x25ab5e['substring'](_0x488a12[0x1]['length']):_0x25ab5e['length']<0x64&&!_0x2da170?'':this['_stripMarkdownSyntax'](_0x25ab5e);const _0x369716=this['_domParser']['parseFromString'](_0x25ab5e,'text/html');if(_0x488a12){const _0x32d75f=Array['from'](_0x369716['body']['childNodes']);_0x32d75f['reverse']();for(const _0x538338 of _0x32d75f){if(_0x538338['nodeType']==Node['ELEMENT_NODE'])break;_0x538338['remove']();}}const _0x3fbe60=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x369716['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3fbe60);const _0x4c366b=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x3afae9=this['editor']['data']['toModel'](_0x3fbe60);return _0x4c366b||_0x3afae9['markers']['clear'](),this['editor']['data']['stringify'](_0x3afae9);}['_normalizeResponseHeadings'](_0x20570b){const _0x594cfe=new _0x2aea8a(this['editor']['editing']['view']['document']),_0x40df81=new _0xbfc6f2({'name':/^h[1-5]$/}),_0x55c71e=[];let _0x2c2ae9=!0x1;for(const _0x5b163a of _0x20570b)_0x5b163a['is']('element')&&_0x40df81['match'](_0x5b163a)&&(_0x55c71e['push'](_0x5b163a),'h1'==_0x5b163a['name']&&(_0x2c2ae9=!0x0));if(_0x2c2ae9){for(const _0x3bff7a of _0x55c71e)_0x594cfe['rename']('h'+(parseInt(_0x3bff7a['name'][0x1])+0x1),_0x3bff7a);}}['_isH1TagSupportEnabled'](){const {data:_0x5b16f7,editing:_0x7f2bf9}=this['editor'],_0x2c14f5=_0x5b16f7['htmlProcessor']['toView']('<h1></h1>'),_0x437478=_0x5b16f7['toView'](_0x5b16f7['toModel'](_0x2c14f5));return!!_0x7f2bf9['view']['domConverter']['viewToDom'](_0x437478)['querySelector']('h1');}['_sanitizeHTML'](_0xd518aa){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xd518aa),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x311baa){const _0x10180f=_0x311baa['trim']();return _0x10180f['startsWith']('```html')?_0x10180f['endsWith']('```')?_0x10180f['substring'](0x7,_0x10180f['length']-0x3):_0x10180f['substring'](0x7):_0x311baa;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x4ab5c3){super(_0x4ab5c3),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x5f312d=>i(_0x4ab5c3,'AI_'+_0x5f312d['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x4ab5c3,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x4ab5c3,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x4ab5c3,'Stop'));const _0x5e9a71=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x5e9a71['if']('isVisible','ck-hidden',_0x547dfa=>!_0x547dfa)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x1af4c0,_0x59c1b6){const _0x35b239=new _0x569b8f(this['locale']);return _0x35b239['set']({'label':_0x1af4c0,'class':_0x59c1b6||'','isVisible':!0x0,'withText':!0x0}),_0x35b239;}}class ct extends _0x239a64{['contentFieldView'];['copyButtonView'];constructor(_0x2eafd4,_0x5ce73e=''){super(_0x2eafd4),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x39c1b3=this['bindTemplate'];this['contentFieldView']=new bt(_0x2eafd4,_0x5ce73e),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x39c1b3['if']('isVisible','ck-hidden',_0x80e0a7=>!_0x80e0a7)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x39c1b3['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 _0x1c735f=!0x1;this['on']('change:value',(_0x1b5617,_0x1f4b50,_0x4447d0)=>{const _0x1efcfd=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x4447d0),this['isProcessing']&&_0x1efcfd&&!_0x1c735f&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1a27f2,_0x2a4e2f,_0x51f930)=>{_0x1c735f=!0x1,_0x51f930?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1c735f=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1c735f=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x565ad1=this['locale'],_0x2fe56c=new _0x569b8f(this['locale']),_0x4d4265='ck-ai-form__copy-button';return _0x2fe56c['set']({'label':i(_0x565ad1,'Copy'),'icon':_0x5364ac,'class':_0x4d4265,'tooltip':!0x0}),_0x2fe56c['bind']('isVisible')['to'](this,'value',_0x56671d=>!!_0x56671d),_0x2fe56c['bind']('isEnabled')['to'](this,'isProcessing',_0x54ca5b=>!_0x54ca5b),_0x2fe56c['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x2fe56c['icon']=_0x1ec2f1,_0x2fe56c['class']=_0x4d4265+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x2fe56c['icon']=_0x5364ac,_0x2fe56c['class']=_0x4d4265;},0x3e8);}),_0x2fe56c;}['_copyHTMLToClipboard'](_0x43c0a3){const {window:_0x2afe5f,document:_0x4abd96}=_0x5014a5;if(_0x2afe5f['ClipboardItem']){const {Blob:_0x3618d9,ClipboardItem:_0x317ddb}=_0x2afe5f,_0x1854bb=[new _0x317ddb({'text/html':new _0x3618d9([_0x43c0a3['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3618d9([_0x43c0a3['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1854bb);}else{const _0x616b7f=_0x4abd96['createElement']('div');_0x616b7f['style']['position']='absolute',_0x616b7f['style']['left']='-9999px',_0x616b7f['innerHTML']='<span>[</span>'+_0x43c0a3['innerHTML']+'<span>]</span>',_0x4abd96['body']['appendChild'](_0x616b7f);const _0x334400=_0x4abd96['createRange']();_0x334400['setStartAfter'](_0x616b7f['firstElementChild']),_0x334400['setEndBefore'](_0x616b7f['lastElementChild']);const _0x21b8c6=_0x2afe5f['getSelection']();_0x21b8c6['removeAllRanges'](),_0x21b8c6['addRange'](_0x334400),_0x4abd96['execCommand']('copy'),_0x616b7f['remove']();}}}class bt extends _0x239a64{constructor(_0x1af030,_0x541c76=''){super(_0x1af030),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x541c76,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x41dec8){this['element']['innerHTML']=_0x41dec8;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x531b79=new _0x239a64(),_0x1560fc=this['locale'],_0x1f088a=new _0x406e2d();return _0x1f088a['isVisible']=!0x0,_0x531b79['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1f088a,{'text':i(_0x1560fc,'AI\x20is\x20writing...')}]}),_0x531b79['render'](),_0x531b79;}}class mt extends _0x239a64{constructor(_0x276f55,_0x16cb8e=''){super(_0x276f55);const _0xea771b=new _0x294804(),_0x559d32=this['bindTemplate'];this['set']('text',_0x16cb8e),_0xea771b['content']=_0x167c8a,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0xea771b,{'text':_0x559d32['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x5e72fa,_0x144904){super(_0x5e72fa,_0x144904),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',(_0x325436,_0x293db0)=>{_0x325436['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x293db0());});}['_createSubmitButton'](){const _0x2b7ff9=new _0x569b8f(this['locale']),_0x40a527=this['locale'];return _0x2b7ff9['set']({'icon':it,'label':i(_0x40a527,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x2b7ff9['on']('execute',()=>{this['submit']();}),_0x2b7ff9['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x347ea5,_0x5e4f6f)=>!_0x347ea5&&_0x5e4f6f),_0x2b7ff9;}['_createShowHistoryButton'](){const _0x4fffcf=new _0x569b8f(this['locale']),_0x23b179=this['resultsView'],_0x562b02=this['locale'];_0x4fffcf['set']({'label':i(_0x562b02,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4fffcf['bind']('isOn')['to'](_0x23b179,'isVisible'),_0x4fffcf['bind']('isEnabled')['to'](this,'isEnabled'),_0x4fffcf['on']('execute',()=>{_0x23b179['isVisible']=!_0x23b179['isVisible'],_0x23b179['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x488f43=()=>{_0x5014a5['window']['requestAnimationFrame'](()=>{if(_0x4b919d(this['element'])){const _0x21bc1f=new _0xe138ac(this['queryView']['fieldView']['element']),_0x1cf4fd=_0x21bc1f['width'],_0x49577c='rtl'===_0x562b02['uiLanguageDirection']?'left':'right';_0x21bc1f['excludeScrollbarsAndBorders'](),_0x4fffcf['element']['style'][_0x49577c]=_0x1cf4fd-_0x21bc1f['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x488f43),this['on']('render',_0x488f43),_0x4fffcf;}['submit'](){const _0x13ca1c=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x13ca1c);}['focus'](_0x589625){-0x1===_0x589625?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x4afe78){super(_0x4afe78),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x4afe78,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x433cba=0x0;for(const _0x146f39 of this['items'])_0x433cba+=_0x146f39['items']['length'];return{'resultsCount':_0x433cba,'totalItemsCount':_0x433cba};}['_createClearHistoryButton'](){const _0x44d41d=this['locale'],_0x229178=new _0x569b8f(this['locale']);return _0x229178['set']({'label':'('+i(_0x44d41d,'Clear')+')','withText':!0x0}),_0x229178['on']('execute',()=>this['fire']('clearHistory')),_0x229178;}}class ut extends xt{constructor(_0x32977c){super();const _0x494e4e=new wt(),_0x12ad67=new _0x569b8f(this['locale'],_0x494e4e);this['children']['add'](_0x12ad67),_0x12ad67['set']({'label':_0x32977c['prompt'],'withText':!0x0}),_0x12ad67['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x32977c['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x1282bd{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1d50cd,_0x869ea3)=>{const _0xfa79e0=os(_0x869ea3['prompt']);for(const _0x220805 of this)if(_0x220805!=_0x869ea3&&os(_0x220805['prompt'])===_0xfa79e0){this['remove'](_0x220805);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x79f3e6=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x79f3e6));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x2f1074=>_0x2f1074)));}}function os(_0x2b1682){return _0x2b1682['toLowerCase']()['trim']();}class k extends _0x239a64{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x30daef,_0x2a3462,_0x426398=''){super(_0x30daef),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(_0x30daef),this['contentArea']=new ct(_0x30daef,_0x426398),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 _0x533d19=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x2a3462],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x533d19['if']('isError','ck-hidden',_0xd6b0b8=>!_0xd6b0b8)]},'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'](_0x5baa5b=0x1){-0x1===_0x5baa5b?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 _0x1feec8=this['locale'],_0x1b4f5e=new lt(_0x1feec8,{'queryView':{'label':i(_0x1feec8,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x1feec8,'Empty\x20history'),'secondary':i(_0x1feec8,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x1b4f5e['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x198632,_0x1320bd)=>_0x198632&&!_0x1320bd),this['listenTo'](_0x1b4f5e,'submit',(_0x4ab4dc,_0x1dc764)=>{this['prompt']=_0x1dc764;const _0x12a73a=ft(_0x1dc764);this['fire']('submitPrompt',_0x12a73a),_0x1dc764['trim']()&&this['_promptHistory']['add']({'prompt':_0x12a73a},0x0);},{'priority':'high'}),_0x1b4f5e;}['_createHistoryView'](){const _0x42c572=new pt(this['locale']);return _0x42c572['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x42c572['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x42c572;}['_createToolbar'](){const _0x13c4e7=new at(this['locale']);return _0x13c4e7['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x21d69d,_0x10a07a,_0x546c44)=>_0x21d69d&&!_0x10a07a&&!!_0x546c44),_0x13c4e7['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x13c4e7['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x977e52,_0x458ca2,_0x2b77b5)=>_0x977e52&&!_0x458ca2&&!!_0x2b77b5),_0x13c4e7['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x13c4e7['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x396832,_0x393b23)=>_0x396832&&!_0x393b23),_0x13c4e7['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x13c4e7['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x13c4e7['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x13c4e7;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0xbca83c=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0xbca83c,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3027d2){const _0x454663=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3027d2||i(_0x454663,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0xd548d4{['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[_0x47ed07,a,x,_0x48842c];}constructor(_0x41eb51){super(_0x41eb51),_0x41eb51['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x41eb51['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x41eb51['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x41eb51['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4585ff}=this;this['_aiAdapter']=_0x4585ff['plugins']['get'](x),this['_dialog']=_0x4585ff['plugins']['get'](_0x48842c),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1e8227=new E(_0x4585ff,Array['from'](this['_commandDefinitions']['values']()));_0x4585ff['commands']['add']('showAIAssistant',_0x1e8227),_0x4585ff['ui']['componentFactory']['add']('aiCommands',_0x15d725=>{const _0x4b2b82=_0x191aee(_0x15d725);return _0x4b2b82['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4b2b82['buttonView']['set']({'label':i(_0x15d725,'AI\x20Commands'),'icon':_0x5854e8,'tooltip':!0x0}),_0x4b2b82['on']('execute',_0x23d587=>this['_onExecute'](_0x23d587['source']['id'])),_0x350b9c(_0x4b2b82,_0x4585ff['ui']['view']['body'],function(_0x5190e8){const _0x261a7f=o(_0x5190e8['config']['get']('ai.aiAssistant.commands'),_0x5190e8['locale']),_0x298d5d=U(_0x5190e8,_0x261a7f)['filter'](_0x1e4fc6=>_0x1e4fc6['commands']['length']);if(0x1===_0x298d5d['length'])return U(_0x5190e8,_0x298d5d[0x0]['commands'])['map'](_0x576ccf=>({'id':_0x576ccf['id'],'label':_0x576ccf['label']}));return _0x298d5d['map'](_0x1979ea=>{const {groupId:_0x26afb6,groupLabel:_0x8fbe00,commands:_0xcfaa01}=_0x1979ea,_0x3c8279=U(_0x5190e8,_0xcfaa01)['map'](_0x170eb2=>({'id':_0x170eb2['id'],'label':_0x170eb2['label']}));return{'id':_0x26afb6,'menu':_0x8fbe00||_0x26afb6,'children':_0x3c8279};});}(_0x4585ff),{'ariaLabel':i(_0x15d725,'AI\x20Commands')}),_0x4b2b82['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1e8227['on']('change:enabledCommandsIds',_0x50ba0d),_0x4b2b82['menuView']['once']('render',_0x50ba0d),_0x4b2b82;function _0x50ba0d(){_0x4b2b82['isEnabled']=_0x1e8227['enabledCommandsIds']['length']>0x0;for(const _0xbec291 of _0x4b2b82['menuView']['buttons'])_0xbec291['isEnabled']=_0x1e8227['enabledCommandsIds']['includes'](_0xbec291['id']);}}),_0x4585ff['ui']['componentFactory']['add']('menuBar:aiCommands',_0x5606fa=>{const _0x21ed64=new _0x280eea(_0x5606fa);_0x21ed64['buttonView']['set']({'label':i(_0x5606fa,'AI\x20Commands'),'icon':_0x5854e8}),_0x21ed64['bind']('isEnabled')['to'](_0x1e8227,'enabledCommandsIds',_0x355ca5=>_0x355ca5['length']>0x0);const _0x2f508a=o(_0x4585ff['config']['get']('ai.aiAssistant.commands'),_0x5606fa);return this['_populateMenuBarMenu'](_0x1e8227,_0x21ed64,_0x2f508a,_0x1bde67=>this['_onExecute'](_0x1bde67)),_0x21ed64;}),_0x4585ff['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x247352=this['_createAIAssistantUIButton'](_0x569b8f);return _0x247352['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x247352;}),_0x4585ff['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4f6d8c=this['_createAIAssistantUIButton'](_0x23913f);return _0x4f6d8c['set']({'role':'menuitemcheckbox'}),_0x4f6d8c;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5b69ef=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2d5db2;for(const _0x4031e8 in _0x5b69ef){const _0x8eca21=_0x4031e8,_0x202bc3=_0x5b69ef[_0x8eca21];if('aiLicenseKeyValid'==_0x202bc3||'aiLicenseKeyInvalid'==_0x202bc3||'aiLicenseKeyExpired'==_0x202bc3||'aiLicenseKeyDomainLimit'==_0x202bc3||'aiLicenseKeyNotAllowed'==_0x202bc3||'aiLicenseKeyEvaluationLimit'==_0x202bc3||'aiLicenseKeyTrialLimit'==_0x202bc3||'aiLicenseKeyUsageLimit'==_0x202bc3){delete _0x5b69ef[_0x8eca21],_0x2d5db2=_0x202bc3,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2d5db2&&_0x5b69ef['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2d5db2&&_0x5b69ef['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2d5db2&&_0x5b69ef['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2d5db2&&_0x5b69ef['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2d5db2&&_0x5b69ef['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x2d5db2&&_0x5b69ef['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x2d5db2&&_0x5b69ef['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3a0aa1='',_0x58cba5='',_0x303d49='custom'){const _0x5be0cc=this['editor'],_0x216373=_0x5be0cc['editing']['view'],_0x27b0e1=_0x5be0cc['plugins']['get'](a),_0x194a71=_0x5be0cc['plugins']['get'](_0x47ed07);_0x27b0e1['showFakeVisualSelection']();const _0x3eee92=new l(),_0x36ddbc=new ClipboardEvent('copy',{'clipboardData':_0x3eee92}),_0x352a20=new _0x1ae4bb(_0x3eee92),_0x16afcb=new _0x418e3f(_0x216373,_0x36ddbc,{'dataTransfer':_0x352a20});_0x194a71['_forceMarkersCopy']('comment',()=>{_0x216373['document']['fire']('copy',_0x16afcb);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x5be0cc,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x218c5f=_0x352a20['getData']('text/html');const _0x293edd=_0x5be0cc['model']['document']['selection'],_0x2da03c=Array['from'](_0x293edd['getRanges']());0x1===_0x2da03c['length']&&_0x2da03c[0x0]['isFlat']&&!_0x293edd['getSelectedElement']()&&''!==_0x218c5f['replace'](/&nbsp;/g,'')['trim']()&&(_0x218c5f='<p>'+_0x218c5f+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x303d49,'query':_0x3a0aa1,'htmlContent':_0x218c5f,'label':_0x58cba5,'mainActionLabel':_[_0x5be0cc['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x17289f,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x30974c['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x27b0e1['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x4a1e7d=new Map(),_0x2bb63b=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0xf80054 of _0x2bb63b)for(const _0x1363ec of _0xf80054['commands'])_0x4a1e7d['set'](_0x1363ec['id'],{..._0x1363ec,'groupId':_0xf80054['groupId'],'groupLabel':_0xf80054['groupLabel']||_0xf80054['groupId']});return _0x4a1e7d;}['_createAIAssistantUIButton'](_0xe4e9b6){const _0x52e898=this['editor'],_0x432815=_0x52e898['commands']['get']('showAIAssistant'),_0x3a12e9=new _0xe4e9b6(_0x52e898['locale']);return _0x3a12e9['set']({'label':i(_0x52e898['locale'],'AI\x20Assistant'),'icon':_0x17289f,'isToggleable':!0x0}),_0x3a12e9['bind']('isEnabled')['to'](_0x432815),_0x3a12e9['bind']('isOn')['to'](this['_dialog'],'id',_0x2678b9=>'aiAssistant'===_0x2678b9),this['listenTo'](_0x3a12e9,'execute',()=>{_0x3a12e9['isOn']?this['hideUI']():_0x432815['execute']();}),_0x3a12e9;}['_initView'](){const _0x4dde01=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',()=>{_0x4dde01['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x4dde01['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x579425,ui:{ariaLiveAnnouncer:_0x2e45a5}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1a61df,_0xcab26b,_0x27c476)=>{const _0xc5b518=this['_aiAssistantController']['currentContext'];_0x27c476?_0x2e45a5['announce'](i(_0x579425,'AI\x20is\x20writing')):_0xc5b518&&_0x2e45a5['announce'](i(_0x579425,'Generated\x20content:\x20%0',_0xc5b518),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x1d033a,_0x5586bb,_0xc36dfa)=>{if(_0xc36dfa){const _0x2de818=this['_formView']['errorView']['text'];_0x2e45a5['announce'](i(_0x579425,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2de818));}});}['_onExecute'](_0x2f8ec7){const _0x5b37ca=this['_commandDefinitions']['get'](_0x2f8ec7),_0x3760e5=this['editor'],_0x551814=_0x3760e5['model']['document']['selection'],_0x57566f=_0x3760e5['commands']['get']('showAIAssistant'),_0x1ccacc=_0x3760e5['plugins']['get'](a),_0x18f291=''+(_0x5b37ca['groupId']!==K?_0x5b37ca['groupLabel']+':\x20':'')+_0x5b37ca['label'];if(!0x1!==_0x5b37ca['requiresContent']&&_0x551814['isCollapsed']){const _0x48887e=_0x431bf4(_0x551814['getSelectedBlocks']())||_0x3760e5['model']['schema']['getLimitElement'](_0x551814);_0x3760e5['model']['change'](_0x3d707=>{_0x3d707['setSelection'](_0x48887e,'in');});}_0x1ccacc['showFakeVisualSelection'](),_0x57566f['execute'](_0x5b37ca['prompt'],_0x18f291,'command:'+_0x2f8ec7);}['_populateMenuBarMenu'](_0x190603,_0x5f40e1,_0x7935da,_0x8901f2){const _0x4c14f5=this['editor'],_0x4d7bd6=_0x4c14f5['locale'],_0x3e5d2a=new _0x15c79c(_0x4d7bd6),_0x1929dd=U(_0x4c14f5,_0x7935da)['filter'](_0x10c570=>_0x10c570['commands']['length']);0x1===_0x1929dd['length']?this['_getMenuBarGroupButtons']({'command':_0x190603,'commands':_0x1929dd[0x0]['commands'],'parentMenuView':_0x5f40e1,'onExecute':_0x8901f2})['forEach'](_0x4c4a4f=>_0x3e5d2a['items']['add'](_0x4c4a4f)):_0x1929dd['forEach'](({groupId:_0x2a0019,groupLabel:_0x590e4e,commands:_0x3133d6})=>{const _0x295e83=new _0x390bbd(_0x4d7bd6,_0x5f40e1),_0x29fb90=new _0x280eea(_0x4d7bd6),_0x4bc821=new _0x15c79c(_0x4d7bd6),_0x124e00=this['_getMenuBarGroupButtons']({'command':_0x190603,'commands':_0x3133d6,'parentMenuView':_0x29fb90,'onExecute':_0x8901f2});_0x29fb90['buttonView']['set']({'label':_0x590e4e||_0x2a0019}),_0x29fb90['delegate']('execute')['to'](_0x5f40e1),_0x4bc821['items']['addMany'](_0x124e00),_0x29fb90['panelView']['children']['add'](_0x4bc821),_0x295e83['children']['add'](_0x29fb90),_0x3e5d2a['items']['add'](_0x295e83);}),_0x5f40e1['panelView']['children']['add'](_0x3e5d2a);}['_getMenuBarGroupButtons']({command:_0x5c76a5,commands:_0xe98ea8,parentMenuView:_0x438144,onExecute:_0x593309}){const _0x9ddf0b=this['editor'],_0x1830f6=_0x9ddf0b['locale'];return U(_0x9ddf0b,_0xe98ea8)['map'](_0x4b696d=>{const _0x5ea987=new _0x390bbd(_0x1830f6,_0x438144),_0x543742=new _0x23913f(_0x1830f6);return _0x543742['set']({'label':_0x4b696d['label']}),_0x543742['delegate']('execute')['to'](_0x438144),_0x543742['on']('execute',()=>_0x593309(_0x4b696d['id'])),_0x543742['bind']('isEnabled')['to'](_0x5c76a5,'enabledCommandsIds',_0x43c00a=>_0x43c00a['includes'](_0x4b696d['id'])),_0x5ea987['children']['add'](_0x543742),_0x5ea987;});}}function T(_0x77d12b,_0x4a4c71){return void 0x0!==_0x77d12b['order']&&void 0x0===_0x4a4c71['order']?0x1:void 0x0===_0x77d12b['order']&&void 0x0!==_0x4a4c71['order']?-0x1:void 0x0!==_0x77d12b['order']&&void 0x0!==_0x4a4c71['order']?_0x77d12b['order']-_0x4a4c71['order']:0x0;}function U(_0x2f62ad,_0x8c443e){_0x8c443e['sort'](T);const _0x3d25c9={},_0x4e12e7=[];for(const _0x48a3f8 of _0x8c443e)if(void 0x0!==_0x48a3f8['order']){if(_0x48a3f8['order']in _0x3d25c9)throw new _0x3d67af('ai-commands-config-order-collision',_0x2f62ad,{'conflictingDefinitions':[_0x48a3f8,_0x3d25c9[_0x48a3f8['order']]]});_0x3d25c9[_0x48a3f8['order']]=_0x48a3f8,_0x4e12e7['splice'](_0x48a3f8['order'],0x0,_0x48a3f8);}else _0x4e12e7['push'](_0x48a3f8);return _0x4e12e7;}class At extends _0xd548d4{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x84934b){super(_0x84934b);const _0x43c4c8=_0x84934b['config'],_0x1c5488=_0x84934b['locale'];_0x43c4c8['define']('ai.aiAssistant.preserveComments',!0x0),_0x43c4c8['define']('ai.aiAssistant.commands',_t(_0x1c5488)),_0x43c4c8['define']('ai.aiAssistant.extraCommandGroups',[]),_0x43c4c8['define']('ai.aiAssistant.removeCommands',[]);let _0x217d69=o(_0x43c4c8['get']('ai.aiAssistant.commands'),_0x1c5488);const _0x22ad4d=_0x43c4c8['get']('ai.aiAssistant.extraCommandGroups'),_0x41c29f=_0x43c4c8['get']('ai.aiAssistant.removeCommands');_0x22ad4d['forEach'](_0x38e98d=>{const _0x1b6565=_0x217d69['find'](_0x45c4b3=>_0x45c4b3['groupId']===_0x38e98d['groupId']);_0x1b6565?_0x1b6565['commands']=_0x1b6565['commands']['concat'](_0x38e98d['commands']):_0x217d69['push'](_0x38e98d);}),_0x217d69=_0x217d69['filter'](_0x50cdff=>!_0x41c29f['includes'](_0x50cdff['groupId'])),_0x217d69['forEach'](_0x4f2a69=>{_0x4f2a69['commands']=_0x4f2a69['commands']['filter'](_0x581884=>!_0x41c29f['includes'](_0x581884['id']));}),_0x43c4c8['set']('ai.aiAssistant.commands',_0x217d69);}}function _t(_0x4a1d81){return[{'groupId':'editOrReview','groupLabel':i(_0x4a1d81,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x4a1d81,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x4a1d81,'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(_0x4a1d81,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x4a1d81,'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(_0x4a1d81,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x4a1d81,'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(_0x4a1d81,'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(_0x4a1d81,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x4a1d81,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x4a1d81,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x4a1d81,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x4a1d81,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x4a1d81,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x4a1d81,'Change\x20style'),'commands':[{'id':'business','label':i(_0x4a1d81,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x4a1d81,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x4a1d81,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x4a1d81,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x4a1d81,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x4a1d81,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x4a1d81,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x4a1d81,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x4a1d81,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x4a1d81,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x4a1d81,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x4a1d81,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x4a1d81,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0xd548d4{['abortController'];static get['requires'](){return[x];}constructor(_0x3fba35){super(_0x3fba35),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'](_0x112180){return this['sendRequest'](_0x112180)['catch'](_0x193927=>{if(_0x193927 instanceof R)return Promise['reject'](_0x193927);if('AbortError'==_0x193927['name'])return Promise['resolve']();throw console['error'](_0x193927),new _0x3d67af('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x29254d,_0x56da02){const _0x46842b=this['editor']['locale'],_0x4592a1={'Content-Type':'application/json'};if('object'==typeof _0x29254d)Object['assign'](_0x4592a1,_0x29254d);else{if(_0x29254d)try{const _0x19d0bc=await _0x29254d(_0x56da02);Object['assign'](_0x4592a1,_0x19d0bc);}catch{return Promise['reject'](new R(i(_0x46842b,'AI_ERROR_GET_HEADERS')));}}return _0x4592a1;}async['_prepareRequestParameters'](_0x4bf0bb,_0x1e2713){const _0x34a648=this['editor']['locale'];if('object'==typeof _0x4bf0bb)return _0x4bf0bb;try{return await _0x4bf0bb(_0x1e2713);}catch{return Promise['reject'](new R(i(_0x34a648,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x57eaf6){super(_0x57eaf6),_0x57eaf6['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x57eaf6['config']['get']('ai.openAI.requestParameters')||_0x57eaf6['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x57eaf6['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x57eaf6['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x57eaf6['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x3b505f,context:_0x341675,onData:_0x1386e7,actionId:_0x5f052a}){const _0x25fc92=this['editor']['locale'],_0x1ec641=await this['prepareMessages'](_0x3b505f,_0x341675,_0x5f052a),_0x1b3564=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5f052a),_0x4257d3=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5f052a),_0xdbad7e={'messages':_0x1ec641,..._0x4257d3},_0x40b1da={'method':'POST','headers':_0x1b3564,'body':JSON['stringify'](_0xdbad7e),'signal':this['abortController']['signal']},_0x5be6f1=await fetch(this['_apiUrl'],_0x40b1da);if(_0x5be6f1['ok'])return _0x4257d3['stream']?await this['_readStreamableResponse'](_0x5be6f1,_0x1386e7):await this['_readStaticResponse'](_0x5be6f1,_0x1386e7),Promise['resolve']();{const _0xe06ffe=await _0x5be6f1['text']();return _0xe06ffe['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x25fc92,'AI_ERROR_CONTEXT_LENGTH'))):_0xe06ffe['includes']('Moderation')?Promise['reject'](new R(i(_0x25fc92,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0xe06ffe));}}async['prepareMessages'](_0x28a097,_0x18dafb,_0x44a357){let _0x5b8b1a,_0x570fa0;return _0x18dafb?(_0x5b8b1a='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.',_0x570fa0='Instruction:\x0a'+_0x28a097+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x18dafb):(_0x5b8b1a='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.',_0x570fa0=_0x28a097),[{'role':'system','content':_0x5b8b1a},{'role':'user','content':_0x570fa0}];}async['_readStreamableResponse'](_0x205634,_0x3b7505){const _0x558501=_0x205634['body']['getReader'](),_0x27737c=new TextDecoder();let _0x2384d6='',_0x97dc5f='',_0x4ad1ef='',_0x3173f3=!0x1;for(;!_0x3173f3;){const {done:_0x526a8d,value:_0x1a7558}=await _0x558501['read'](),_0x4e196d=_0x2384d6+_0x27737c['decode'](_0x1a7558);let _0xbd31b0='';_0x3173f3=_0x526a8d;try{_0xbd31b0=this['_cleanUpData'](_0x4e196d),_0x2384d6='';}catch{_0x2384d6=_0x4e196d;continue;}_0x97dc5f+=_0xbd31b0,!_0x3173f3&&this['_isBufferIncomplete'](_0x97dc5f)||_0x97dc5f&&(_0x4ad1ef+=_0x97dc5f,_0x97dc5f='',_0x3b7505(_0x4ad1ef));}return Promise['resolve']();}async['_readStaticResponse'](_0x1c737d,_0x5af781){return _0x5af781((await _0x1c737d['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x8dd2f6){const _0x224508=_0x8dd2f6['split']('<')['length']!==_0x8dd2f6['split']('>')['length'],_0x17c9e1=_0x8dd2f6['length']<0x1e;return _0x224508&&_0x17c9e1;}['_cleanUpData'](_0x556379){return _0x556379['split'](/\n(?![^{]*\})/g)['map'](_0x128e5c=>_0x128e5c['replace']('data:\x20',''))['filter'](_0x35422e=>_0x35422e&&_0x35422e['length']>0x0&&'[DONE]'!==_0x35422e)['map'](_0x300733=>{const {choices:_0x430502}=JSON['parse'](_0x300733);if(_0x430502[0x0]?.['delta']?.['content'])return _0x430502[0x0]['delta']['content'];})['filter'](_0x1d1a70=>_0x1d1a70)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x4e9e24){super(_0x4e9e24),_0x4e9e24['config']['get']('ai.aws.requestParameters')||_0x4e9e24['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']=_0x4e9e24['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x4e9e24['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x4e9e24['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x4e9e24['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x489030,context:_0x47c53b,onData:_0x5db905,actionId:_0x455b63}){const {model:_0x244953,stream:_0x13ed45,..._0x556c5}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x455b63),_0xd9dc5={'prompt':await this['preparePrompt'](_0x489030,_0x47c53b,_0x244953,_0x455b63),..._0x556c5};this['_apiUrl']?await this['_processProxyRequest'](_0xd9dc5,_0x244953,_0x13ed45,_0x5db905,_0x455b63):await this['_processAWSRequest'](_0xd9dc5,_0x244953,_0x13ed45,_0x5db905);}async['preparePrompt'](_0x1457e4,_0xe7aa97,_0x2e8dfb,_0x19b2ce){let _0x582432,_0x4c92bc;return _0xe7aa97?(_0x582432='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.',_0x4c92bc='Instruction:\x0a'+_0x1457e4+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xe7aa97):(_0x582432='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.',_0x4c92bc=_0x1457e4),'meta.llama'==this['getModelFamily'](_0x2e8dfb)?'<<SYS>>\x0a'+_0x582432+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4c92bc+'\x0a[/INST]':'Human:\x0a'+_0x582432+'\x0a'+_0x4c92bc+'\x0a\x0aAssistant:';}['getModelFamily'](_0x104198){if(/^anthropic\.claude/['test'](_0x104198))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x104198))return'ai21.j2';if(/^cohere\.command/['test'](_0x104198))return'cohere.command';if(/^meta\.llama/['test'](_0x104198))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x104198));}async['_processProxyRequest'](_0x4c362e,_0x4a2689,_0x23bcd7,_0x144284,_0x3a1fdb){const _0x5575c1={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3a1fdb),'body':JSON['stringify']({..._0x4c362e,'model':_0x4a2689,'stream':_0x23bcd7}),'signal':this['abortController']['signal']},_0x14a804=await fetch(this['_apiUrl'],_0x5575c1);_0x23bcd7?await this['_readStreamableResponse'](_0x14a804,_0x4a2689,_0x144284):await this['_readStaticResponse'](_0x14a804,_0x4a2689,_0x144284);}async['_processAWSRequest'](_0x487813,_0x1dd509,_0x3d08f6,_0xe8b71e){const _0x27836c=new _0xd4624f(this['_bedrockClientConfig']),_0x1c5f8a={'body':JSON['stringify'](_0x487813),'contentType':'application/json','accept':'application/json','modelId':_0x1dd509};let _0x254b15;if(_0x3d08f6){const _0x150313=new _0x3dbc37(_0x1c5f8a);_0x254b15=await _0x27836c['send'](_0x150313,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x254b15,_0x1dd509,_0xe8b71e);}else{const _0x417bdf=new _0x2bda03(_0x1c5f8a);_0x254b15=await _0x27836c['send'](_0x417bdf,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x254b15,_0x1dd509,_0xe8b71e);}}async['_readAsyncIterableResponse'](_0x19325a,_0x2d4203,_0x56922d){const _0xdcfd7f=_0x19325a['body'],_0xa9e6d9=new TextDecoder('utf-8');let _0x23519f='';for await(const _0x350e0a of _0xdcfd7f)if(_0x350e0a['chunk']){const _0x432af5=_0xa9e6d9['decode'](_0x350e0a['chunk']['bytes']),_0x43ce24=JSON['parse'](_0x432af5);_0x23519f+=this['_getGeneratedText'](_0x43ce24,_0x2d4203),_0x56922d(_0x23519f);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4e9819,_0x474447,_0x411c19){const _0x17bed3=_0x4e9819['body'],_0x13f009=new TextDecoder('utf-8'),_0x1ac440=_0x17bed3['getReader']();let _0x45df21='',_0x43c89e='',_0x32018a=!0x1;for(;!_0x32018a;){const {done:_0x335c1d,value:_0x366b0c}=await _0x1ac440['read']();if(_0x32018a=_0x335c1d,_0x32018a)break;const _0x4ac8e7=(_0x45df21+_0x13f009['decode'](_0x366b0c))['split']('\x0a')['map'](_0x345c69=>{try{return _0x45df21='',JSON['parse'](_0x345c69);}catch{return _0x45df21=_0x345c69,null;}})['filter'](_0x67054=>null!==_0x67054);_0x4ac8e7['length']&&(_0x43c89e+=_0x4ac8e7['map'](_0x580a90=>this['_getGeneratedText'](_0x580a90,_0x474447))['join'](''),_0x411c19(_0x43c89e));}return Promise['resolve']();}async['_readStaticResponse'](_0x32e9a9,_0x5855b2,_0x57e7fd){let _0x2a11de;return _0x2a11de=_0x32e9a9 instanceof Response?await _0x32e9a9['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x32e9a9['body'])),(_0x57e7fd(this['_getGeneratedText'](_0x2a11de,_0x5855b2)),Promise['resolve']());}['_getGeneratedText'](_0x15fbe6,_0x3d9564){switch(this['getModelFamily'](_0x3d9564)){case'anthropic.claude':return _0x15fbe6['completion'];case'ai21.j2':return _0x15fbe6['completions'][0x0]['data']['text'];case'cohere.command':return _0x15fbe6['generations'][0x0]['text'];case'meta.llama':return _0x15fbe6['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-ai",
3
- "version": "46.0.1-alpha.2",
3
+ "version": "46.0.1-alpha.3",
4
4
  "description": "AI Assistant feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -29,14 +29,14 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@aws-sdk/client-bedrock-runtime": "3.823.0",
32
- "@ckeditor/ckeditor5-clipboard": "46.0.1-alpha.2",
33
- "@ckeditor/ckeditor5-core": "46.0.1-alpha.2",
34
- "@ckeditor/ckeditor5-engine": "46.0.1-alpha.2",
35
- "@ckeditor/ckeditor5-icons": "46.0.1-alpha.2",
36
- "@ckeditor/ckeditor5-table": "46.0.1-alpha.2",
37
- "@ckeditor/ckeditor5-ui": "46.0.1-alpha.2",
38
- "@ckeditor/ckeditor5-utils": "46.0.1-alpha.2",
39
- "ckeditor5": "46.0.1-alpha.2",
32
+ "@ckeditor/ckeditor5-clipboard": "46.0.1-alpha.3",
33
+ "@ckeditor/ckeditor5-core": "46.0.1-alpha.3",
34
+ "@ckeditor/ckeditor5-engine": "46.0.1-alpha.3",
35
+ "@ckeditor/ckeditor5-icons": "46.0.1-alpha.3",
36
+ "@ckeditor/ckeditor5-table": "46.0.1-alpha.3",
37
+ "@ckeditor/ckeditor5-ui": "46.0.1-alpha.3",
38
+ "@ckeditor/ckeditor5-utils": "46.0.1-alpha.3",
39
+ "ckeditor5": "46.0.1-alpha.3",
40
40
  "es-toolkit": "1.39.5"
41
41
  },
42
42
  "type": "module",