@ckeditor/ckeditor5-ai 46.0.1-alpha.11 → 46.0.1-alpha.13

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 _0x48e375,Command as _0x4cdc30}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x368b6b,IconCheck as _0x12961e,IconError as _0x24c3e1,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x1c4e14,IconRobotPencil as _0x2afd3d}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x23acdb,CKEditorError as _0x4e334e,ObservableMixin as _0x33dbbd,global as _0x5ed61a,isVisible as _0x4b5849,Rect as _0x576b0e,Collection as _0x3da1f0,FocusTracker as et,KeystrokeHandler as rt,first as _0x8c7799}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x540c1c,View as _0x2a5385,SpinnerView as _0x8d595a,IconView as _0x3253f3,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x3b8582,createDropdown as _0x3840ca,addMenuToDropdown as _0x116b60,MenuBarMenuView as _0x4d400f,MenuBarMenuListItemButtonView as _0x35e67f,DialogViewPosition as _0x946f3f,MenuBarMenuListView as _0x1471d4,MenuBarMenuListItemView as _0x5e6eea}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x29ee02,ClipboardMarkersUtils as _0x24adfd}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x53f948,ViewDataTransfer as _0x362fea,ViewUpcastWriter as _0x4bc545,Matcher as _0x20c8d9}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0xe96c7a,InvokeModelWithResponseStreamCommand as _0x2b647c,InvokeModelCommand as _0x5530c8}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x4a98c7,_0x5e24e8){const _0x590201=(0x0,_0x5e24e8['t'])('Other');return _0x4a98c7['length']?'groupId'in _0x4a98c7[0x0]?_0x4a98c7:[{'groupId':K,'groupLabel':_0x590201,'order':0x1/0x0,'commands':_0x4a98c7}]:[{'groupId':K,'groupLabel':_0x590201,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x48e375{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x23479b}=this,_0x44f741=['ck-fake-ai-selection'];_0x23479b['config']['get']('ai.useTheme')&&_0x44f741['push']('ck-ai-assistant-ui_theme'),_0x23479b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x44f741,'priority':0xc}}),_0x23479b['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x1eeea1,{writer:_0x24e55e})=>{if(!_0x1eeea1['markerRange']['isCollapsed'])return null;const _0x1f721c=_0x24e55e['createUIElement']('span');return _0x24e55e['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1f721c),_0x1f721c;}});}['afterInit'](){!async function(_0x56d28f){const _0x568fb4=_0x515c7a([0x51,0x55,0x5a,0x6d,0x72,0x44,0x41,0x4a,0x62,0x68,0x4b,0x45,0x34,0x56,0x4d,0x46,0x49,0x70,0x47,0x37,0x30,0x36,0x39,0x6e,0x4f,0x74,0x59,0x65,0x57,0x38,0x6c,0x71,0x63,0x54,0x4c,0x79,0x58,0x31,0x32,0x6b,0x33,0x43,0x67,0x52,0x66,0x73,0x48,0x75,0x69,0x35,0x78,0x6f,0x42,0x4e,0x50,0x53,0x64,0x61,0x76,0x6a,0x7a,0x77]),_0x24a510=0x4169d9af,_0xaac4e6=0x416eb64f^_0x24a510,_0x1825c9=window[_0x515c7a([0x44,0x61,0x74,0x65])][_0x515c7a([0x6e,0x6f,0x77])](),_0xc5d22b=_0x56d28f[_0x515c7a([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4ebbf6=new window[(_0x515c7a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x45dc41=>{_0xc5d22b[_0x515c7a([0x6f,0x6e,0x63,0x65])](_0x515c7a([0x72,0x65,0x61,0x64,0x79]),_0x45dc41);}),_0x37ba22={[_0x515c7a([0x6b,0x74,0x79])]:_0x515c7a([0x45,0x43]),[_0x515c7a([0x75,0x73,0x65])]:_0x515c7a([0x73,0x69,0x67]),[_0x515c7a([0x63,0x72,0x76])]:_0x515c7a([0x50,0x2d,0x32,0x35,0x36]),[_0x515c7a([0x78])]:_0x515c7a([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]),[_0x515c7a([0x79])]:_0x515c7a([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]),[_0x515c7a([0x61,0x6c,0x67])]:_0x515c7a([0x45,0x53,0x32,0x35,0x36])},_0x45606f=_0xc5d22b[_0x515c7a([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x515c7a([0x67,0x65,0x74])](_0x515c7a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x21df64(){let _0xafad2f,_0x598e6a=null,_0x4193b4=null;try{if(_0x45606f==_0x515c7a([0x47,0x50,0x4c]))return _0x515c7a([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0xafad2f=_0x4f8083(),!_0xafad2f)return _0x515c7a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0xafad2f[_0x515c7a([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x4193b4=_0x5e5904(_0xafad2f[_0x515c7a([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0xafad2f[_0x515c7a([0x6a,0x74,0x69])])),await _0x3d4dc9()?_0x21919e()?_0x5a50b8()?_0x515c7a([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x592755()?(_0xafad2f[_0x515c7a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x515c7a([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x598e6a=_0x4c4524(_0x515c7a([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0xafad2f[_0x515c7a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x515c7a([0x74,0x72,0x69,0x61,0x6c])&&(_0x598e6a=_0x4c4524(_0x515c7a([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4378c5()):_0x515c7a([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x515c7a([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x515c7a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x515c7a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5a50b8(){const _0x1da241=[_0x515c7a([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x515c7a([0x74,0x72,0x69,0x61,0x6c])][_0x515c7a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xafad2f[_0x515c7a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x1825c9/0x3e8:0xe10*_0xaac4e6;return _0xafad2f[_0x515c7a([0x65,0x78,0x70])]<_0x1da241;}function _0x21919e(){const _0xf2551b=_0xafad2f[_0x515c7a([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0xf2551b&&(!!_0xf2551b[_0x515c7a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x515c7a([0x2a]))||!!_0xf2551b[_0x515c7a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x515c7a([0x41,0x49])));}function _0x592755(){const _0x34482c=_0xafad2f[_0x515c7a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x34482c||0x0==_0x34482c[_0x515c7a([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x33aa34}=new URL(window[_0x515c7a([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x34482c[_0x515c7a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x33aa34))return!0x0;const _0x554f93=_0x33aa34[_0x515c7a([0x73,0x70,0x6c,0x69,0x74])](_0x515c7a([0x2e]));return _0x34482c[_0x515c7a([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x401d03=>_0x401d03[_0x515c7a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x515c7a([0x2a])))[_0x515c7a([0x6d,0x61,0x70])](_0x334095=>_0x334095[_0x515c7a([0x73,0x70,0x6c,0x69,0x74])](_0x515c7a([0x2e])))[_0x515c7a([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x22c831=>_0x22c831[_0x515c7a([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x554f93[_0x515c7a([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x515c7a([0x6d,0x61,0x70])](_0x52f7e5=>Array(_0x554f93[_0x515c7a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x52f7e5[_0x515c7a([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x515c7a([0x66,0x69,0x6c,0x6c])](_0x52f7e5[0x0]===_0x515c7a([0x2a])?_0x515c7a([0x2a]):'')[_0x515c7a([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x52f7e5))[_0x515c7a([0x73,0x6f,0x6d,0x65])](_0x133434=>_0x554f93[_0x515c7a([0x65,0x76,0x65,0x72,0x79])]((_0x27536e,_0x25202d)=>_0x133434[_0x25202d]===_0x27536e||_0x133434[_0x25202d]===_0x515c7a([0x2a])));}function _0x4378c5(){return _0x598e6a&&_0x4193b4?new window[(_0x515c7a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x247628,_0x298917)=>{_0x598e6a[_0x515c7a([0x74,0x68,0x65,0x6e])](_0x247628,_0x298917),_0x4193b4[_0x515c7a([0x74,0x68,0x65,0x6e])](_0x21c847=>{_0x21c847!=_0x515c7a([0x56,0x61,0x6c,0x69,0x64])&&_0x247628(_0x21c847);},_0x298917);}):_0x598e6a||_0x4193b4||_0x515c7a([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5e5904(_0x198d2a,_0xdab7c6){return new window[(_0x515c7a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1ad946=>{if(_0x2070e0())return _0x1ad946(_0x515c7a([0x56,0x61,0x6c,0x69,0x64]));_0x52540f(),_0xc5d22b[_0x515c7a([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x515c7a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x533607=!0x1;const _0x4d7893=_0x23acdb();function _0x427861(_0x192499){return!!_0x192499&&(typeof _0x192499===_0x515c7a([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x192499===_0x515c7a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x192499[_0x515c7a([0x74,0x68,0x65,0x6e])]===_0x515c7a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x192499[_0x515c7a([0x63,0x61,0x74,0x63,0x68])]===_0x515c7a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2b06c3(_0x3eed64){_0x223a51(_0x3eed64)[_0x515c7a([0x74,0x68,0x65,0x6e])](_0x4ad7c7=>{if(!_0x4ad7c7||_0x4ad7c7[_0x515c7a([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x515c7a([0x6f,0x6b]))return _0x515c7a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x509527(_0x43b143(_0x4d7893+_0xdab7c6))!=_0x4ad7c7[_0x515c7a([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x515c7a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x515c7a([0x56,0x61,0x6c,0x69,0x64]);})[_0x515c7a([0x74,0x68,0x65,0x6e])](_0x4059f6=>(_0x22b9ce(),_0x4059f6),()=>{const _0x4ad27e=_0x465018();return null==_0x4ad27e?(_0x22b9ce(),_0x515c7a([0x56,0x61,0x6c,0x69,0x64])):_0x515c7a(_0x1825c9-_0x4ad27e>(0x65655daf^_0x24a510)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x515c7a([0x74,0x68,0x65,0x6e])](_0x1ad946)[_0x515c7a([0x63,0x61,0x74,0x63,0x68])](()=>{_0x1ad946(_0x515c7a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x34ece6=0x415f372f^_0x24a510;function _0x22b9ce(){const _0x26c8ef=_0x515c7a([0x6c,0x6c,0x63,0x74,0x2d])+_0x509527(_0x43b143(_0x198d2a)),_0x9c0c2d=_0x1872f9(_0x509527(window[_0x515c7a([0x4d,0x61,0x74,0x68])][_0x515c7a([0x63,0x65,0x69,0x6c])](_0x1825c9/_0x34ece6)));window[_0x515c7a([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x515c7a([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x26c8ef,_0x9c0c2d);}function _0x465018(){const _0x411285=_0x515c7a([0x6c,0x6c,0x63,0x74,0x2d])+_0x509527(_0x43b143(_0x198d2a)),_0x560497=window[_0x515c7a([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x515c7a([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x411285);return _0x560497?window[_0x515c7a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1872f9(_0x560497),0x10)*_0x34ece6:null;}function _0x223a51(_0xe135a9){return new window[(_0x515c7a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5f1a44,_0x30cac5)=>{_0xe135a9[_0x515c7a([0x74,0x68,0x65,0x6e])](_0x5f1a44,_0x30cac5),window[_0x515c7a([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x30cac5,0x41680d6f^_0x24a510);});}}_0xc5d22b[_0x515c7a([0x6f,0x6e])](_0x515c7a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2e2d7b,_0x52c7ed)=>{if(_0x52c7ed[0x0]!=_0x198d2a)return _0x1ad946(_0x515c7a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x52c7ed[0x1]={..._0x52c7ed[0x1],[_0x515c7a([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x4d7893};},{[_0x515c7a([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x515c7a([0x68,0x69,0x67,0x68])}),_0xc5d22b[_0x515c7a([0x6f,0x6e])](_0x515c7a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x5bc51e=>{_0x427861(_0x5bc51e[_0x515c7a([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x533607=!0x0,_0x2b06c3(_0x5bc51e[_0x515c7a([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x515c7a([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x515c7a([0x6c,0x6f,0x77])}),_0x4ebbf6[_0x515c7a([0x74,0x68,0x65,0x6e])](()=>{_0x533607||_0x1ad946(_0x515c7a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x2070e0(){return _0xc5d22b[_0x515c7a([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x515c7a([0x76,0x69,0x65,0x77])][_0x515c7a([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x515c7a([0x61,0x75,0x74,0x6f]);}function _0x52540f(){_0xc5d22b[_0x515c7a([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x515c7a([0x76,0x69,0x65,0x77])][_0x515c7a([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x515c7a([0x61,0x75,0x74,0x6f]);}}function _0x4c4524(_0x32468b){const _0x4c74de=[new window[(_0x515c7a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x153385=>setTimeout(_0x153385,0x4160e763^_0x24a510)),_0x4ebbf6[_0x515c7a([0x74,0x68,0x65,0x6e])](()=>new window[(_0x515c7a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x31aa7b=>{let _0x3f33cf=0x0;_0xc5d22b[_0x515c7a([0x6d,0x6f,0x64,0x65,0x6c])][_0x515c7a([0x6f,0x6e])](_0x515c7a([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x43edbf,_0x299aab)=>{_0x299aab[0x0][_0x515c7a([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3f33cf++,_0x3f33cf==(0x4169d857^_0x24a510)&&(_0x31aa7b(),_0x43edbf[_0x515c7a([0x6f,0x66,0x66])]());});}))];return window[_0x515c7a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x515c7a([0x72,0x61,0x63,0x65])](_0x4c74de)[_0x515c7a([0x74,0x68,0x65,0x6e])](()=>_0x32468b);}async function _0x279b61(){await _0x4ebbf6,_0xc5d22b[_0x515c7a([0x6d,0x6f,0x64,0x65,0x6c])][_0x515c7a([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x3f89f7,_0xc5d22b[_0x515c7a([0x6d,0x6f,0x64,0x65,0x6c])][_0x515c7a([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x3f89f7,_0xc5d22b[_0x515c7a([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x515c7a([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x34fa9e(_0x4fd62c){const _0x40867f=_0x24ea94();_0xc5d22b[_0x40867f]=_0x515c7a([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x4fd62c,_0x4fd62c!=_0x515c7a([0x56,0x61,0x6c,0x69,0x64])&&_0x279b61();}function _0x24ea94(){const _0x598b3c=window[_0x515c7a([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x515c7a([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x515c7a([0x6e,0x6f,0x77])]())[_0x515c7a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x515c7a([0x2e]),'');let _0x176e49=_0x515c7a([0x51]);for(let _0x585aa6=0x0;_0x585aa6<_0x598b3c[_0x515c7a([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x585aa6+=0x2){let _0x1030af=window[_0x515c7a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x598b3c[_0x515c7a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x585aa6,_0x585aa6+0x2));_0x1030af>=_0x568fb4[_0x515c7a([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1030af-=_0x568fb4[_0x515c7a([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x176e49+=_0x568fb4[_0x1030af];}return _0x176e49;}function _0x4f8083(){const _0x3a9bff=_0x45606f[_0x515c7a([0x73,0x70,0x6c,0x69,0x74])](_0x515c7a([0x2e]));if(0x3!=_0x3a9bff[_0x515c7a([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x11f9b0(_0x3a9bff[0x1]);function _0x11f9b0(_0x5ce3d1){const _0x5990fc=_0x551bbd(_0x5ce3d1);return _0x5990fc&&_0x1e6d54()?_0x5990fc:null;function _0x1e6d54(){const _0x4286a8=_0x5990fc[_0x515c7a([0x6a,0x74,0x69])],_0x39bf=window[_0x515c7a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4286a8[_0x515c7a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4286a8[_0x515c7a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x34d7d7={..._0x5990fc,[_0x515c7a([0x6a,0x74,0x69])]:_0x4286a8[_0x515c7a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4286a8[_0x515c7a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x34d7d7[_0x515c7a([0x76,0x63])],_0x43b143(_0x34d7d7)==_0x39bf;}}}async function _0x3d4dc9(){let _0x17722c=!0x0;try{const _0x346a16=_0x45606f[_0x515c7a([0x73,0x70,0x6c,0x69,0x74])](_0x515c7a([0x2e])),[_0x589b95,_0x22da2d,_0x3705b7]=_0x346a16;return _0x4b068a(_0x589b95),await _0xd809dd(_0x589b95,_0x22da2d,_0x3705b7),_0x17722c;}catch{return!0x1;}function _0x4b068a(_0x485525){const _0x5d7b31=_0x551bbd(_0x485525);_0x5d7b31&&_0x5d7b31[_0x515c7a([0x61,0x6c,0x67])]==_0x515c7a([0x45,0x53,0x32,0x35,0x36])||(_0x17722c=!0x1);}async function _0xd809dd(_0x457ed4,_0x408e86,_0x5ce6cf){const _0x41f89d=window[_0x515c7a([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x515c7a([0x66,0x72,0x6f,0x6d])](_0x19e4c5(_0x5ce6cf),_0x468ce2=>_0x468ce2[_0x515c7a([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x47f267=new window[(_0x515c7a([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x515c7a([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x457ed4+_0x515c7a([0x2e])+_0x408e86),_0x23dde7=window[_0x515c7a([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x515c7a([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x23dde7)return;const _0x256956=await _0x23dde7[_0x515c7a([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x515c7a([0x6a,0x77,0x6b]),_0x37ba22,{[_0x515c7a([0x6e,0x61,0x6d,0x65])]:_0x515c7a([0x45,0x43,0x44,0x53,0x41]),[_0x515c7a([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x515c7a([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x515c7a([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x23dde7[_0x515c7a([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x515c7a([0x6e,0x61,0x6d,0x65])]:_0x515c7a([0x45,0x43,0x44,0x53,0x41]),[_0x515c7a([0x68,0x61,0x73,0x68])]:{[_0x515c7a([0x6e,0x61,0x6d,0x65])]:_0x515c7a([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x256956,_0x41f89d,_0x47f267)||(_0x17722c=!0x1);}}function _0x551bbd(_0x52b249){return _0x52b249[_0x515c7a([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x515c7a([0x65,0x79]))?JSON[_0x515c7a([0x70,0x61,0x72,0x73,0x65])](_0x19e4c5(_0x52b249)):null;}function _0x19e4c5(_0x218725){return window[_0x515c7a([0x61,0x74,0x6f,0x62])](_0x218725[_0x515c7a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x515c7a([0x2b]))[_0x515c7a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x515c7a([0x2f])));}function _0x43b143(_0x533c8b){let _0xb89f5e=0x1505;function _0x3c509d(_0x1fe0a0){for(let _0x15aa95=0x0;_0x15aa95<_0x1fe0a0[_0x515c7a([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x15aa95++){const _0x32a6f0=_0x1fe0a0[_0x515c7a([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x15aa95);_0xb89f5e=(_0xb89f5e<<0x5)+_0xb89f5e+_0x32a6f0,_0xb89f5e&=_0xb89f5e;}}function _0x5e8231(_0x45750d){Array[_0x515c7a([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x45750d)?_0x45750d[_0x515c7a([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x5e8231):_0x45750d&&typeof _0x45750d==_0x515c7a([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x515c7a([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x45750d)[_0x515c7a([0x73,0x6f,0x72,0x74])]()[_0x515c7a([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x5d9b4a,_0x497ce1])=>{_0x3c509d(_0x5d9b4a),_0x5e8231(_0x497ce1);}):_0x3c509d(window[_0x515c7a([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x45750d));}return _0x5e8231(_0x533c8b),_0xb89f5e>>>0x0;}function _0x509527(_0x450ec7){return _0x450ec7[_0x515c7a([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x515c7a([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x515c7a([0x30]));}function _0x1872f9(_0x411eb6){return _0x411eb6[_0x515c7a([0x73,0x70,0x6c,0x69,0x74])]('')[_0x515c7a([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x515c7a([0x6a,0x6f,0x69,0x6e])]('');}function _0x3f89f7(){}function _0x515c7a(_0x267c15){return _0x267c15['map'](_0x5eb311=>String['fromCharCode'](_0x5eb311))['join']('');}_0x34fa9e(await _0x21df64());}(this);}['showFakeVisualSelection'](){const _0xf7a1a=this['editor']['model'];_0xf7a1a['change'](_0x22f132=>{const _0x577c36=_0xf7a1a['document']['selection']['getRanges']();let _0xb55041=0x0;for(const _0x2e592c of _0x577c36){const _0x2630a7=w+':'+_0xb55041;if(_0xf7a1a['markers']['has'](_0x2630a7))_0x22f132['updateMarker'](_0x2630a7,{'range':_0x2e592c});else{if(_0x2e592c['start']['isAtEnd']){const _0x42ae56=_0x2e592c['start']['getLastMatchingPosition'](({item:_0x4e2170})=>!_0xf7a1a['schema']['isContent'](_0x4e2170),{'boundaries':_0x2e592c});_0x22f132['addMarker'](_0x2630a7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x22f132['createRange'](_0x42ae56,_0x2e592c['end'])});}else _0x22f132['addMarker'](_0x2630a7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2e592c});}_0xb55041++;}});}['hideFakeVisualSelection'](){const _0x5536c3=this['editor']['model'],_0x145b4f=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x145b4f['length']&&_0x5536c3['change'](_0x459cb2=>{_0x145b4f['forEach'](_0x520704=>{_0x459cb2['removeMarker'](_0x520704);});});}['insertContent'](_0x363e0c,_0x45f79c){const _0x45a4ea=this['_getAISelection'](),_0x431058=_0x45f79c||_0x45a4ea['getFirstRange']();this['editor']['model']['canEditAt'](_0x431058)&&this['editor']['model']['change'](_0x1892b0=>{this['hideFakeVisualSelection'](),_0x45f79c||this['_resetContentOfSelectedTableCells'](_0x1892b0,_0x45a4ea),this['_pasteHTMLUsingClipboard']({'insertAt':_0x431058,'writer':_0x1892b0,'html':_0x363e0c});});}['insertContentBelow'](_0x5e2ac2){const {model:_0x4e37e8}=this['editor'],_0x5a4a59=this['_getAISelection']();_0x4e37e8['change'](()=>{const _0x1a8978=this['_prepareTableInsertBelowPosition'](_0x5e2ac2,_0x5a4a59)||this['_getDefaultInsertBelowPosition'](_0x5a4a59);this['insertContent'](_0x5e2ac2,_0x1a8978);});}['_getAISelection'](){const _0x27717d=this['editor']['model'],_0x30d927=Array['from'](_0x27717d['markers']['getMarkersGroup'](w))['map'](_0xa4065d=>_0xa4065d['getRange']());return _0x27717d['createSelection'](_0x30d927);}['_pasteHTMLUsingClipboard']({writer:_0x4d7fb4,html:_0x508aba,insertAt:_0x406cf}){const {view:_0x8fef97}=this['editor']['editing'],_0x37e948=this['editor']['plugins']['get'](_0x29ee02),_0x54475e=new gt();_0x54475e['setData']('text/html',_0x508aba);const _0x1553f0=new ClipboardEvent('paste',{'clipboardData':_0x54475e}),_0x6958fa=new _0x53f948(_0x8fef97,_0x1553f0,{'dataTransfer':new _0x362fea(_0x54475e)});_0x4d7fb4['setSelection'](_0x406cf);const _0xe8c0d7=(_0x1622e8,_0x401562)=>{_0x401562['resultRange']&&_0x4d7fb4['setSelection'](_0x401562['resultRange']);};_0x37e948['once']('contentInsertion',_0xe8c0d7,{'priority':'lowest'}),_0x8fef97['document']['fire']('paste',_0x6958fa),_0x37e948['off']('contentInsertion',_0xe8c0d7);}['_getDefaultInsertBelowPosition'](_0x24b242){const {model:_0x5c571f}=this['editor'],_0x256d6e=Array['from'](_0x24b242['getSelectedBlocks']());return _0x256d6e['length']?_0x5c571f['createPositionAfter'](_0x256d6e['pop']()):_0x24b242['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x240435,_0x14f9ee){const {model:_0x103432,plugins:_0x49e42c}=this['editor'];if(_0x49e42c['has']('TableUtils')){const _0x40116c=_0x49e42c['get']('TableUtils')['getSelectedTableCells'](_0x14f9ee);if(_0x40116c['length']){const _0x10e4d2=this['_getTableRowCountFromContent'](_0x240435),_0x3da725=this['_createEmptyTableRows'](_0x40116c,_0x10e4d2);return _0x103432['createPositionAt'](_0x3da725,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1a46cc){const _0x598011=this['editor']['plugins']['get']('TableUtils'),_0x595362=this['editor']['data']['parse'](_0x1a46cc),_0x35359c=Array['from'](_0x595362['getChildren']())['filter'](_0x1a2bfc=>_0x1a2bfc['is']('element','table'));let _0x3d887e=0x0;return _0x35359c['forEach'](_0x4a9706=>{_0x3d887e+=_0x598011['getRows'](_0x4a9706);}),_0x3d887e;}['_createEmptyTableRows'](_0x54b422,_0x15c13f){const _0x430b94=this['editor']['plugins']['get']('TableUtils'),_0x2f32cb=_0x430b94['getRowIndexes'](_0x54b422),_0x16ae3b=_0x430b94['getColumnIndexes'](_0x54b422),_0x502453=_0x2f32cb['last']+0x1,_0x33e6be=_0x16ae3b['first'],_0x26e4b1=_0x54b422[0x0]['findAncestor']('table');for(let _0x309d20=0x0;_0x309d20<_0x15c13f;_0x309d20++)_0x430b94['insertRows'](_0x26e4b1,{'at':_0x502453});return _0x26e4b1['getChild'](_0x502453)['getChild'](_0x33e6be);}['_resetContentOfSelectedTableCells'](_0x519f4f,_0x1a70db){const {plugins:_0x1547b0}=this['editor'],{model:_0x2cd6d4}=_0x519f4f;if(!_0x1547b0['has']('TableUtils'))return;_0x1547b0['get']('TableUtils')['getSelectedTableCells'](_0x1a70db)['length']&&_0x2cd6d4['deleteContent'](_0x1a70db);}}class x extends _0x48e375{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x4e334e('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x28e30a){super(_0x28e30a),this['name']='AIRequestError';}}function i(_0x1eabd0,_0x5daea3,_0x2a0b2e){const t=_0x1eabd0['t'];switch(_0x5daea3){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',_0x2a0b2e);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2a0b2e);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'},_0x2a0b2e);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 _0x5daea3;}}class E extends _0x4cdc30{['_commandDefinitions'];constructor(_0x5a3066,_0x1f2594){super(_0x5a3066),this['_commandDefinitions']=_0x1f2594,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x5ec38f,_0x340cd1,_0xdbd4bd)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0xdbd4bd));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x3b2952,_0x22e7aa,_0x5e2e43)=>{this['enabledCommandsIds']=_0x5e2e43?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x698e1e=this['editor']['model'];this['_hasContext']=function(_0x45f0c9){const _0x542184=_0x45f0c9['document']['selection'];return _0x542184['isCollapsed']?0x0!==[..._0x542184['getSelectedBlocks']()]['length']&&![..._0x542184['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x45f0c9['hasContent'](_0x542184['getFirstRange']());}(_0x698e1e);const _0x308aa2=_0x698e1e['document']['selection'],_0x5d36bf=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x46276d of _0x308aa2['getRanges']())for(const _0x25ba51 of _0x46276d['getItems']())if(_0x25ba51['is']('element')&&_0x5d36bf['includes'](_0x25ba51['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0xa0184a='',_0xe330b3='',_0x105ba2='custom'){this['editor']['plugins']['get'](n)['showUI'](_0xa0184a,_0xe330b3,_0x105ba2);}}function F(_0x6f4feb,_0x5cece9){const _0x3a5e3a=new Set();for(const _0x5b6ea4 of _0x6f4feb['values']())(_0x5cece9||!0x1===_0x5b6ea4['requiresContent'])&&_0x3a5e3a['add'](_0x5b6ea4['id']);return Array['from'](_0x3a5e3a);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- _0x33dbbd(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x399c58,_0x2d6817,_0x29837){super(),this['editor']=_0x399c58,this['textAdapter']=_0x2d6817,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x29837,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x5734d1,_0x73f0f,_0x2baca1)=>{this['view']['value']=this['_sanitizeHTML'](_0x2baca1);}),this['listenTo'](this['view'],'submitPrompt',(_0x2e48a9,_0x5f7f8d)=>{const _0x382ce3=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x5f7f8d,_0x382ce3,'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:_0x1bd673,query:_0x34499b,htmlContent:_0x46bd61,label:_0x2e259e,mainActionLabel:_0x6b9589}){this['view']['prompt']=_0x2e259e,this['view']['mainAction']=_0x6b9589,this['initialContext']=_0x46bd61,_0x34499b&&(this['view']['isRendered']?this['_handleQuery'](_0x34499b,_0x46bd61,_0x1bd673,_0x2e259e):this['view']['once']('render',()=>{this['_handleQuery'](_0x34499b,_0x46bd61,_0x1bd673,_0x2e259e);}));}['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'](_0x128dc4,_0xb76634,_0x4e9be4,_0x5303c8){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0xb76634,this['previousQuery']=_0x128dc4,this['previousLabel']=_0x5303c8||_0x128dc4,this['previousActionId']=_0x4e9be4,new Promise(_0x239c46=>{this['textAdapter']['makeRequest']({'query':_0x128dc4,'context':_0xb76634,'onData':_0x2d5c25=>{this['currentResponse']=_0x2d5c25,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4e9be4})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x5a1ba4=>{_0x5a1ba4 instanceof R?this['view']['handleError'](_0x5a1ba4['message']):this['view']['handleError'](),_0x239c46();})['finally'](()=>{this['stopProcessing'](),_0x239c46();});});}['_parseAndNormalizeContent'](_0x3402c6,_0x3740e7=!0x1){const _0xcae66e=Q['exec'](_0x3402c6);_0x3402c6=_0xcae66e?_0x3402c6['substring'](_0xcae66e[0x1]['length']):_0x3402c6['length']<0x64&&!_0x3740e7?'':this['_stripMarkdownSyntax'](_0x3402c6);const _0xac2c6d=this['_domParser']['parseFromString'](_0x3402c6,'text/html');if(_0xcae66e){const _0x270b7d=Array['from'](_0xac2c6d['body']['childNodes']);_0x270b7d['reverse']();for(const _0x5c3dfe of _0x270b7d){if(_0x5c3dfe['nodeType']==Node['ELEMENT_NODE'])break;_0x5c3dfe['remove']();}}const _0x520aad=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xac2c6d['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x520aad);const _0x20f651=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x44aaa9=this['editor']['data']['toModel'](_0x520aad);return _0x20f651||_0x44aaa9['markers']['clear'](),this['editor']['data']['stringify'](_0x44aaa9);}['_normalizeResponseHeadings'](_0x4d2f04){const _0x2c2ec3=new _0x4bc545(this['editor']['editing']['view']['document']),_0x3cb038=new _0x20c8d9({'name':/^h[1-5]$/}),_0x541b30=[];let _0x537c48=!0x1;for(const _0x22fc94 of _0x4d2f04)_0x22fc94['is']('element')&&_0x3cb038['match'](_0x22fc94)&&(_0x541b30['push'](_0x22fc94),'h1'==_0x22fc94['name']&&(_0x537c48=!0x0));if(_0x537c48){for(const _0x111f19 of _0x541b30)_0x2c2ec3['rename']('h'+(parseInt(_0x111f19['name'][0x1])+0x1),_0x111f19);}}['_isH1TagSupportEnabled'](){const {data:_0x4d887d,editing:_0xf55e1d}=this['editor'],_0x488303=_0x4d887d['htmlProcessor']['toView']('<h1></h1>'),_0x5a061d=_0x4d887d['toView'](_0x4d887d['toModel'](_0x488303));return!!_0xf55e1d['view']['domConverter']['viewToDom'](_0x5a061d)['querySelector']('h1');}['_sanitizeHTML'](_0x2616f8){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2616f8),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x3772e1){const _0x511b7b=_0x3772e1['trim']();return _0x511b7b['startsWith']('```html')?_0x511b7b['endsWith']('```')?_0x511b7b['substring'](0x7,_0x511b7b['length']-0x3):_0x511b7b['substring'](0x7):_0x3772e1;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x1c9551){super(_0x1c9551),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x40fd12=>i(_0x1c9551,'AI_'+_0x40fd12['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x1c9551,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x1c9551,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x1c9551,'Stop'));const _0x3cd1ad=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3cd1ad['if']('isVisible','ck-hidden',_0x3b18c2=>!_0x3b18c2)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x15b988,_0x2fab1b){const _0x1e96b9=new _0x540c1c(this['locale']);return _0x1e96b9['set']({'label':_0x15b988,'class':_0x2fab1b||'','isVisible':!0x0,'withText':!0x0}),_0x1e96b9;}}class ct extends _0x2a5385{['contentFieldView'];['copyButtonView'];constructor(_0x3f4e6d,_0x3a0f9e=''){super(_0x3f4e6d),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3d3dc8=this['bindTemplate'];this['contentFieldView']=new bt(_0x3f4e6d,_0x3a0f9e),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3d3dc8['if']('isVisible','ck-hidden',_0x299907=>!_0x299907)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3d3dc8['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 _0x53680c=!0x1;this['on']('change:value',(_0x56bbb8,_0x505628,_0x48a418)=>{const _0x56baf1=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x48a418),this['isProcessing']&&_0x56baf1&&!_0x53680c&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x2d2962,_0x1cf7fa,_0x2d3c8f)=>{_0x53680c=!0x1,_0x2d3c8f?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x53680c=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x53680c=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4da73b=this['locale'],_0x48fe2a=new _0x540c1c(this['locale']),_0x578851='ck-ai-form__copy-button';return _0x48fe2a['set']({'label':i(_0x4da73b,'Copy'),'icon':_0x368b6b,'class':_0x578851,'tooltip':!0x0}),_0x48fe2a['bind']('isVisible')['to'](this,'value',_0x3dfde8=>!!_0x3dfde8),_0x48fe2a['bind']('isEnabled')['to'](this,'isProcessing',_0x4aede=>!_0x4aede),_0x48fe2a['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x48fe2a['icon']=_0x12961e,_0x48fe2a['class']=_0x578851+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x48fe2a['icon']=_0x368b6b,_0x48fe2a['class']=_0x578851;},0x3e8);}),_0x48fe2a;}['_copyHTMLToClipboard'](_0x3ffd46){const {window:_0x4f51c9,document:_0x39ee35}=_0x5ed61a;if(_0x4f51c9['ClipboardItem']){const {Blob:_0x85846d,ClipboardItem:_0x2db59b}=_0x4f51c9,_0x377180=[new _0x2db59b({'text/html':new _0x85846d([_0x3ffd46['innerHTML']],{'type':'text/html'}),'text/plain':new _0x85846d([_0x3ffd46['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x377180);}else{const _0x537700=_0x39ee35['createElement']('div');_0x537700['style']['position']='absolute',_0x537700['style']['left']='-9999px',_0x537700['innerHTML']='<span>[</span>'+_0x3ffd46['innerHTML']+'<span>]</span>',_0x39ee35['body']['appendChild'](_0x537700);const _0x53493d=_0x39ee35['createRange']();_0x53493d['setStartAfter'](_0x537700['firstElementChild']),_0x53493d['setEndBefore'](_0x537700['lastElementChild']);const _0x327e3e=_0x4f51c9['getSelection']();_0x327e3e['removeAllRanges'](),_0x327e3e['addRange'](_0x53493d),_0x39ee35['execCommand']('copy'),_0x537700['remove']();}}}class bt extends _0x2a5385{constructor(_0x4a9791,_0x2496c6=''){super(_0x4a9791),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2496c6,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x13e621){this['element']['innerHTML']=_0x13e621;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x33a9ca=new _0x2a5385(),_0x182996=this['locale'],_0x2a06b1=new _0x8d595a();return _0x2a06b1['isVisible']=!0x0,_0x33a9ca['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x2a06b1,{'text':i(_0x182996,'AI\x20is\x20writing...')}]}),_0x33a9ca['render'](),_0x33a9ca;}}class mt extends _0x2a5385{constructor(_0x5925b9,_0x1ed988=''){super(_0x5925b9);const _0xe5b5d9=new _0x3253f3(),_0x52d193=this['bindTemplate'];this['set']('text',_0x1ed988),_0xe5b5d9['content']=_0x24c3e1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0xe5b5d9,{'text':_0x52d193['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x381d8c,_0x6d2141){super(_0x381d8c,_0x6d2141),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',(_0x34e81a,_0x3c8edc)=>{_0x34e81a['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3c8edc());});}['_createSubmitButton'](){const _0x148ff6=new _0x540c1c(this['locale']),_0x30c57a=this['locale'];return _0x148ff6['set']({'icon':it,'label':i(_0x30c57a,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x148ff6['on']('execute',()=>{this['submit']();}),_0x148ff6['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x44bdc9,_0xa64966)=>!_0x44bdc9&&_0xa64966),_0x148ff6;}['_createShowHistoryButton'](){const _0x535c08=new _0x540c1c(this['locale']),_0x342856=this['resultsView'],_0x59afa3=this['locale'];_0x535c08['set']({'label':i(_0x59afa3,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x535c08['bind']('isOn')['to'](_0x342856,'isVisible'),_0x535c08['bind']('isEnabled')['to'](this,'isEnabled'),_0x535c08['on']('execute',()=>{_0x342856['isVisible']=!_0x342856['isVisible'],_0x342856['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5eb09e=()=>{_0x5ed61a['window']['requestAnimationFrame'](()=>{if(_0x4b5849(this['element'])){const _0x4f7a1d=new _0x576b0e(this['queryView']['fieldView']['element']),_0x46ce20=_0x4f7a1d['width'],_0x316aac='rtl'===_0x59afa3['uiLanguageDirection']?'left':'right';_0x4f7a1d['excludeScrollbarsAndBorders'](),_0x535c08['element']['style'][_0x316aac]=_0x46ce20-_0x4f7a1d['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5eb09e),this['on']('render',_0x5eb09e),_0x535c08;}['submit'](){const _0xeb5a35=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0xeb5a35);}['focus'](_0x1d8741){-0x1===_0x1d8741?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x3e9a78){super(_0x3e9a78),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x3e9a78,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x5e642b=0x0;for(const _0x4cf087 of this['items'])_0x5e642b+=_0x4cf087['items']['length'];return{'resultsCount':_0x5e642b,'totalItemsCount':_0x5e642b};}['_createClearHistoryButton'](){const _0x14c896=this['locale'],_0x18cfaf=new _0x540c1c(this['locale']);return _0x18cfaf['set']({'label':'('+i(_0x14c896,'Clear')+')','withText':!0x0}),_0x18cfaf['on']('execute',()=>this['fire']('clearHistory')),_0x18cfaf;}}class ut extends xt{constructor(_0x395d46){super();const _0xb8a8f=new wt(),_0x4a6960=new _0x540c1c(this['locale'],_0xb8a8f);this['children']['add'](_0x4a6960),_0x4a6960['set']({'label':_0x395d46['prompt'],'withText':!0x0}),_0x4a6960['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x395d46['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x3da1f0{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x36bdbf,_0x13a64a)=>{const _0xed0b80=os(_0x13a64a['prompt']);for(const _0x1c3b17 of this)if(_0x1c3b17!=_0x13a64a&&os(_0x1c3b17['prompt'])===_0xed0b80){this['remove'](_0x1c3b17);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x1eb7e7=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x1eb7e7));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x166521=>_0x166521)));}}function os(_0x531177){return _0x531177['toLowerCase']()['trim']();}class k extends _0x2a5385{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4214c8,_0x55b2df,_0xddc650=''){super(_0x4214c8),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(_0x4214c8),this['contentArea']=new ct(_0x4214c8,_0xddc650),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 _0x2bba58=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x55b2df],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x2bba58['if']('isError','ck-hidden',_0x9c7d43=>!_0x9c7d43)]},'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'](_0xc8c015=0x1){-0x1===_0xc8c015?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 _0x4174c5=this['locale'],_0x1ad0a8=new lt(_0x4174c5,{'queryView':{'label':i(_0x4174c5,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x4174c5,'Empty\x20history'),'secondary':i(_0x4174c5,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x1ad0a8['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x22c0de,_0x2f560d)=>_0x22c0de&&!_0x2f560d),this['listenTo'](_0x1ad0a8,'submit',(_0x294186,_0xb0447f)=>{this['prompt']=_0xb0447f;const _0x19f8d3=ft(_0xb0447f);this['fire']('submitPrompt',_0x19f8d3),_0xb0447f['trim']()&&this['_promptHistory']['add']({'prompt':_0x19f8d3},0x0);},{'priority':'high'}),_0x1ad0a8;}['_createHistoryView'](){const _0x567071=new pt(this['locale']);return _0x567071['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x567071['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x567071;}['_createToolbar'](){const _0x28b341=new at(this['locale']);return _0x28b341['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x53c12e,_0x53572f,_0x70c465)=>_0x53c12e&&!_0x53572f&&!!_0x70c465),_0x28b341['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x28b341['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3c8022,_0x1c8bc5,_0xa131f6)=>_0x3c8022&&!_0x1c8bc5&&!!_0xa131f6),_0x28b341['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x28b341['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3fe254,_0x4598fc)=>_0x3fe254&&!_0x4598fc),_0x28b341['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x28b341['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x28b341['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x28b341;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x22c54e=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x22c54e,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3c89df){const _0x3b8fd7=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3c89df||i(_0x3b8fd7,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x48e375{['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[_0x24adfd,a,x,_0x3b8582];}constructor(_0x37c581){super(_0x37c581),_0x37c581['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x37c581['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x37c581['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x37c581['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x212834}=this;this['_aiAdapter']=_0x212834['plugins']['get'](x),this['_dialog']=_0x212834['plugins']['get'](_0x3b8582),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x2c8d69=new E(_0x212834,Array['from'](this['_commandDefinitions']['values']()));_0x212834['commands']['add']('showAIAssistant',_0x2c8d69),_0x212834['ui']['componentFactory']['add']('aiCommands',_0x132317=>{const _0x4d25c2=_0x3840ca(_0x132317);return _0x4d25c2['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4d25c2['buttonView']['set']({'label':i(_0x132317,'AI\x20Commands'),'icon':_0x1c4e14,'tooltip':!0x0}),_0x4d25c2['on']('execute',_0x4dde95=>this['_onExecute'](_0x4dde95['source']['id'])),_0x116b60(_0x4d25c2,_0x212834['ui']['view']['body'],function(_0x40aabc){const _0x2ca83b=o(_0x40aabc['config']['get']('ai.aiAssistant.commands'),_0x40aabc['locale']),_0x1351bd=U(_0x40aabc,_0x2ca83b)['filter'](_0x20380f=>_0x20380f['commands']['length']);if(0x1===_0x1351bd['length'])return U(_0x40aabc,_0x1351bd[0x0]['commands'])['map'](_0x5a6bd4=>({'id':_0x5a6bd4['id'],'label':_0x5a6bd4['label']}));return _0x1351bd['map'](_0x14f279=>{const {groupId:_0x113f55,groupLabel:_0xccc09f,commands:_0xe318a4}=_0x14f279,_0x3cc985=U(_0x40aabc,_0xe318a4)['map'](_0x20837a=>({'id':_0x20837a['id'],'label':_0x20837a['label']}));return{'id':_0x113f55,'menu':_0xccc09f||_0x113f55,'children':_0x3cc985};});}(_0x212834),{'ariaLabel':i(_0x132317,'AI\x20Commands')}),_0x4d25c2['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x2c8d69['on']('change:enabledCommandsIds',_0x41aa79),_0x4d25c2['menuView']['once']('render',_0x41aa79),_0x4d25c2;function _0x41aa79(){_0x4d25c2['isEnabled']=_0x2c8d69['enabledCommandsIds']['length']>0x0;for(const _0x552f6c of _0x4d25c2['menuView']['buttons'])_0x552f6c['isEnabled']=_0x2c8d69['enabledCommandsIds']['includes'](_0x552f6c['id']);}}),_0x212834['ui']['componentFactory']['add']('menuBar:aiCommands',_0x1674d0=>{const _0x1540d6=new _0x4d400f(_0x1674d0);_0x1540d6['buttonView']['set']({'label':i(_0x1674d0,'AI\x20Commands'),'icon':_0x1c4e14}),_0x1540d6['bind']('isEnabled')['to'](_0x2c8d69,'enabledCommandsIds',_0x51d90f=>_0x51d90f['length']>0x0);const _0x579f47=o(_0x212834['config']['get']('ai.aiAssistant.commands'),_0x1674d0);return this['_populateMenuBarMenu'](_0x2c8d69,_0x1540d6,_0x579f47,_0x5058e5=>this['_onExecute'](_0x5058e5)),_0x1540d6;}),_0x212834['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x2886aa=this['_createAIAssistantUIButton'](_0x540c1c);return _0x2886aa['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x2886aa;}),_0x212834['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x32d45b=this['_createAIAssistantUIButton'](_0x35e67f);return _0x32d45b['set']({'role':'menuitemcheckbox'}),_0x32d45b;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x418156=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1b52b4;for(const _0x1f5dae in _0x418156){const _0x28e490=_0x1f5dae,_0x9fb0d4=_0x418156[_0x28e490];if('aiLicenseKeyValid'==_0x9fb0d4||'aiLicenseKeyInvalid'==_0x9fb0d4||'aiLicenseKeyExpired'==_0x9fb0d4||'aiLicenseKeyDomainLimit'==_0x9fb0d4||'aiLicenseKeyNotAllowed'==_0x9fb0d4||'aiLicenseKeyEvaluationLimit'==_0x9fb0d4||'aiLicenseKeyTrialLimit'==_0x9fb0d4||'aiLicenseKeyUsageLimit'==_0x9fb0d4){delete _0x418156[_0x28e490],_0x1b52b4=_0x9fb0d4,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1b52b4&&_0x418156['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1b52b4&&_0x418156['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1b52b4&&_0x418156['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1b52b4&&_0x418156['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1b52b4&&_0x418156['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x1b52b4&&_0x418156['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x1b52b4&&_0x418156['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x35ae72='',_0x5ee013='',_0x1a4389='custom'){const _0x2a6a11=this['editor'],_0x31ce27=_0x2a6a11['editing']['view'],_0x704b24=_0x2a6a11['plugins']['get'](a),_0x8e8fa0=_0x2a6a11['plugins']['get'](_0x24adfd);_0x704b24['showFakeVisualSelection']();const _0x25d7c4=new l(),_0x2147c2=new ClipboardEvent('copy',{'clipboardData':_0x25d7c4}),_0x46d6e9=new _0x362fea(_0x25d7c4),_0x4b4341=new _0x53f948(_0x31ce27,_0x2147c2,{'dataTransfer':_0x46d6e9});_0x8e8fa0['_forceMarkersCopy']('comment',()=>{_0x31ce27['document']['fire']('copy',_0x4b4341);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x2a6a11,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x50fdf3=_0x46d6e9['getData']('text/html');const _0x220f3=_0x2a6a11['model']['document']['selection'],_0x5ed984=Array['from'](_0x220f3['getRanges']());0x1===_0x5ed984['length']&&_0x5ed984[0x0]['isFlat']&&!_0x220f3['getSelectedElement']()&&''!==_0x50fdf3['replace'](/&nbsp;/g,'')['trim']()&&(_0x50fdf3='<p>'+_0x50fdf3+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x1a4389,'query':_0x35ae72,'htmlContent':_0x50fdf3,'label':_0x5ee013,'mainActionLabel':_[_0x2a6a11['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2afd3d,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x946f3f['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x704b24['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x446c6a=new Map(),_0x52da31=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x1afb10 of _0x52da31)for(const _0x4143d5 of _0x1afb10['commands'])_0x446c6a['set'](_0x4143d5['id'],{..._0x4143d5,'groupId':_0x1afb10['groupId'],'groupLabel':_0x1afb10['groupLabel']||_0x1afb10['groupId']});return _0x446c6a;}['_createAIAssistantUIButton'](_0x5fb8a3){const _0x48c94c=this['editor'],_0x3f2417=_0x48c94c['commands']['get']('showAIAssistant'),_0x1f50f4=new _0x5fb8a3(_0x48c94c['locale']);return _0x1f50f4['set']({'label':i(_0x48c94c['locale'],'AI\x20Assistant'),'icon':_0x2afd3d,'isToggleable':!0x0}),_0x1f50f4['bind']('isEnabled')['to'](_0x3f2417),_0x1f50f4['bind']('isOn')['to'](this['_dialog'],'id',_0x1ea663=>'aiAssistant'===_0x1ea663),this['listenTo'](_0x1f50f4,'execute',()=>{_0x1f50f4['isOn']?this['hideUI']():_0x3f2417['execute']();}),_0x1f50f4;}['_initView'](){const _0x291e6b=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',()=>{_0x291e6b['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x291e6b['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x508bb4,ui:{ariaLiveAnnouncer:_0x461f86}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x46288e,_0x344797,_0x27ea1e)=>{const _0xfb781b=this['_aiAssistantController']['currentContext'];_0x27ea1e?_0x461f86['announce'](i(_0x508bb4,'AI\x20is\x20writing')):_0xfb781b&&_0x461f86['announce'](i(_0x508bb4,'Generated\x20content:\x20%0',_0xfb781b),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x366df4,_0x37bda6,_0x2f1112)=>{if(_0x2f1112){const _0x483b84=this['_formView']['errorView']['text'];_0x461f86['announce'](i(_0x508bb4,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x483b84));}});}['_onExecute'](_0x251421){const _0x7a165=this['_commandDefinitions']['get'](_0x251421),_0x21fd90=this['editor'],_0x1fc5fc=_0x21fd90['model']['document']['selection'],_0x2cf12b=_0x21fd90['commands']['get']('showAIAssistant'),_0x2b358b=_0x21fd90['plugins']['get'](a),_0x1c2ea1=''+(_0x7a165['groupId']!==K?_0x7a165['groupLabel']+':\x20':'')+_0x7a165['label'];if(!0x1!==_0x7a165['requiresContent']&&_0x1fc5fc['isCollapsed']){const _0x3845f3=_0x8c7799(_0x1fc5fc['getSelectedBlocks']())||_0x21fd90['model']['schema']['getLimitElement'](_0x1fc5fc);_0x21fd90['model']['change'](_0x7d29f0=>{_0x7d29f0['setSelection'](_0x3845f3,'in');});}_0x2b358b['showFakeVisualSelection'](),_0x2cf12b['execute'](_0x7a165['prompt'],_0x1c2ea1,'command:'+_0x251421);}['_populateMenuBarMenu'](_0x290ad2,_0x8efef4,_0x50ef08,_0x4e8516){const _0x55ba63=this['editor'],_0x2bdb48=_0x55ba63['locale'],_0x3ebd06=new _0x1471d4(_0x2bdb48),_0x49ba11=U(_0x55ba63,_0x50ef08)['filter'](_0x3924bc=>_0x3924bc['commands']['length']);0x1===_0x49ba11['length']?this['_getMenuBarGroupButtons']({'command':_0x290ad2,'commands':_0x49ba11[0x0]['commands'],'parentMenuView':_0x8efef4,'onExecute':_0x4e8516})['forEach'](_0x2cab83=>_0x3ebd06['items']['add'](_0x2cab83)):_0x49ba11['forEach'](({groupId:_0xd9a506,groupLabel:_0x413cb8,commands:_0x327de5})=>{const _0x488731=new _0x5e6eea(_0x2bdb48,_0x8efef4),_0x3b5532=new _0x4d400f(_0x2bdb48),_0x2cefa5=new _0x1471d4(_0x2bdb48),_0x45debb=this['_getMenuBarGroupButtons']({'command':_0x290ad2,'commands':_0x327de5,'parentMenuView':_0x3b5532,'onExecute':_0x4e8516});_0x3b5532['buttonView']['set']({'label':_0x413cb8||_0xd9a506}),_0x3b5532['delegate']('execute')['to'](_0x8efef4),_0x2cefa5['items']['addMany'](_0x45debb),_0x3b5532['panelView']['children']['add'](_0x2cefa5),_0x488731['children']['add'](_0x3b5532),_0x3ebd06['items']['add'](_0x488731);}),_0x8efef4['panelView']['children']['add'](_0x3ebd06);}['_getMenuBarGroupButtons']({command:_0x590136,commands:_0x30d442,parentMenuView:_0x3532f4,onExecute:_0x5daf23}){const _0x2b836f=this['editor'],_0x40ca32=_0x2b836f['locale'];return U(_0x2b836f,_0x30d442)['map'](_0x4aeedd=>{const _0x33baca=new _0x5e6eea(_0x40ca32,_0x3532f4),_0x337daf=new _0x35e67f(_0x40ca32);return _0x337daf['set']({'label':_0x4aeedd['label']}),_0x337daf['delegate']('execute')['to'](_0x3532f4),_0x337daf['on']('execute',()=>_0x5daf23(_0x4aeedd['id'])),_0x337daf['bind']('isEnabled')['to'](_0x590136,'enabledCommandsIds',_0x8de8fb=>_0x8de8fb['includes'](_0x4aeedd['id'])),_0x33baca['children']['add'](_0x337daf),_0x33baca;});}}function T(_0x424f5d,_0x537f02){return void 0x0!==_0x424f5d['order']&&void 0x0===_0x537f02['order']?0x1:void 0x0===_0x424f5d['order']&&void 0x0!==_0x537f02['order']?-0x1:void 0x0!==_0x424f5d['order']&&void 0x0!==_0x537f02['order']?_0x424f5d['order']-_0x537f02['order']:0x0;}function U(_0x2543cb,_0x611bb6){_0x611bb6['sort'](T);const _0x3d1305={},_0x552426=[];for(const _0xaebd2f of _0x611bb6)if(void 0x0!==_0xaebd2f['order']){if(_0xaebd2f['order']in _0x3d1305)throw new _0x4e334e('ai-commands-config-order-collision',_0x2543cb,{'conflictingDefinitions':[_0xaebd2f,_0x3d1305[_0xaebd2f['order']]]});_0x3d1305[_0xaebd2f['order']]=_0xaebd2f,_0x552426['splice'](_0xaebd2f['order'],0x0,_0xaebd2f);}else _0x552426['push'](_0xaebd2f);return _0x552426;}class At extends _0x48e375{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x357a97){super(_0x357a97);const _0x44e967=_0x357a97['config'],_0x112068=_0x357a97['locale'];_0x44e967['define']('ai.aiAssistant.preserveComments',!0x0),_0x44e967['define']('ai.aiAssistant.commands',_t(_0x112068)),_0x44e967['define']('ai.aiAssistant.extraCommandGroups',[]),_0x44e967['define']('ai.aiAssistant.removeCommands',[]);let _0x5d6c74=o(_0x44e967['get']('ai.aiAssistant.commands'),_0x112068);const _0x5c51c8=_0x44e967['get']('ai.aiAssistant.extraCommandGroups'),_0x235f47=_0x44e967['get']('ai.aiAssistant.removeCommands');_0x5c51c8['forEach'](_0x445f8d=>{const _0x4e60c1=_0x5d6c74['find'](_0x3f2229=>_0x3f2229['groupId']===_0x445f8d['groupId']);_0x4e60c1?_0x4e60c1['commands']=_0x4e60c1['commands']['concat'](_0x445f8d['commands']):_0x5d6c74['push'](_0x445f8d);}),_0x5d6c74=_0x5d6c74['filter'](_0x2186df=>!_0x235f47['includes'](_0x2186df['groupId'])),_0x5d6c74['forEach'](_0xc48bbe=>{_0xc48bbe['commands']=_0xc48bbe['commands']['filter'](_0x355f47=>!_0x235f47['includes'](_0x355f47['id']));}),_0x44e967['set']('ai.aiAssistant.commands',_0x5d6c74);}}function _t(_0x3146b8){return[{'groupId':'editOrReview','groupLabel':i(_0x3146b8,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x3146b8,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x3146b8,'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(_0x3146b8,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x3146b8,'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(_0x3146b8,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x3146b8,'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(_0x3146b8,'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(_0x3146b8,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x3146b8,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x3146b8,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x3146b8,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x3146b8,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x3146b8,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x3146b8,'Change\x20style'),'commands':[{'id':'business','label':i(_0x3146b8,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x3146b8,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x3146b8,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x3146b8,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x3146b8,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x3146b8,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x3146b8,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x3146b8,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x3146b8,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x3146b8,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x3146b8,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x3146b8,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x3146b8,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x48e375{['abortController'];static get['requires'](){return[x];}constructor(_0x571055){super(_0x571055),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'](_0x2f15bd){return this['sendRequest'](_0x2f15bd)['catch'](_0x18c421=>{if(_0x18c421 instanceof R)return Promise['reject'](_0x18c421);if('AbortError'==_0x18c421['name'])return Promise['resolve']();throw console['error'](_0x18c421),new _0x4e334e('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x3be915,_0x4c40c8){const _0x25d58c=this['editor']['locale'],_0x4791ed={'Content-Type':'application/json'};if('object'==typeof _0x3be915)Object['assign'](_0x4791ed,_0x3be915);else{if(_0x3be915)try{const _0x32d737=await _0x3be915(_0x4c40c8);Object['assign'](_0x4791ed,_0x32d737);}catch{return Promise['reject'](new R(i(_0x25d58c,'AI_ERROR_GET_HEADERS')));}}return _0x4791ed;}async['_prepareRequestParameters'](_0x52d763,_0x3b35d1){const _0x488d03=this['editor']['locale'];if('object'==typeof _0x52d763)return _0x52d763;try{return await _0x52d763(_0x3b35d1);}catch{return Promise['reject'](new R(i(_0x488d03,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x2bb363){super(_0x2bb363),_0x2bb363['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x2bb363['config']['get']('ai.openAI.requestParameters')||_0x2bb363['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x2bb363['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x2bb363['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x2bb363['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x3bb5d3,context:_0x308490,onData:_0x46d018,actionId:_0xdd911b}){const _0x23dedd=this['editor']['locale'],_0x4c405e=await this['prepareMessages'](_0x3bb5d3,_0x308490,_0xdd911b),_0x5258ad=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xdd911b),_0xd5664f=await this['_prepareRequestParameters'](this['_requestParameters'],_0xdd911b),_0x5e01df={'messages':_0x4c405e,..._0xd5664f},_0x134ea5={'method':'POST','headers':_0x5258ad,'body':JSON['stringify'](_0x5e01df),'signal':this['abortController']['signal']},_0x386cc8=await fetch(this['_apiUrl'],_0x134ea5);if(_0x386cc8['ok'])return _0xd5664f['stream']?await this['_readStreamableResponse'](_0x386cc8,_0x46d018):await this['_readStaticResponse'](_0x386cc8,_0x46d018),Promise['resolve']();{const _0x2910bd=await _0x386cc8['text']();return _0x2910bd['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x23dedd,'AI_ERROR_CONTEXT_LENGTH'))):_0x2910bd['includes']('Moderation')?Promise['reject'](new R(i(_0x23dedd,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x2910bd));}}async['prepareMessages'](_0x2d57fa,_0x5bd6d7,_0x41bcb6){let _0x59162a,_0x4e9c36;return _0x5bd6d7?(_0x59162a='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.',_0x4e9c36='Instruction:\x0a'+_0x2d57fa+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5bd6d7):(_0x59162a='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.',_0x4e9c36=_0x2d57fa),[{'role':'system','content':_0x59162a},{'role':'user','content':_0x4e9c36}];}async['_readStreamableResponse'](_0x14fac7,_0xcb5cd3){const _0x48b592=_0x14fac7['body']['getReader'](),_0x117b5e=new TextDecoder();let _0x234663='',_0x2b0393='',_0x439eb0='',_0x818a75=!0x1;for(;!_0x818a75;){const {done:_0x4d5d03,value:_0x230232}=await _0x48b592['read'](),_0x527deb=_0x234663+_0x117b5e['decode'](_0x230232);let _0x1a8b1f='';_0x818a75=_0x4d5d03;try{_0x1a8b1f=this['_cleanUpData'](_0x527deb),_0x234663='';}catch{_0x234663=_0x527deb;continue;}_0x2b0393+=_0x1a8b1f,!_0x818a75&&this['_isBufferIncomplete'](_0x2b0393)||_0x2b0393&&(_0x439eb0+=_0x2b0393,_0x2b0393='',_0xcb5cd3(_0x439eb0));}return Promise['resolve']();}async['_readStaticResponse'](_0x38d759,_0x3e4e0b){return _0x3e4e0b((await _0x38d759['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x572927){const _0x5e56af=_0x572927['split']('<')['length']!==_0x572927['split']('>')['length'],_0x324388=_0x572927['length']<0x1e;return _0x5e56af&&_0x324388;}['_cleanUpData'](_0x4d1f5e){return _0x4d1f5e['split'](/\n(?![^{]*\})/g)['map'](_0x6ffd7=>_0x6ffd7['replace']('data:\x20',''))['filter'](_0x1ee690=>_0x1ee690&&_0x1ee690['length']>0x0&&'[DONE]'!==_0x1ee690)['map'](_0x43da86=>{const {choices:_0x4f939a}=JSON['parse'](_0x43da86);if(_0x4f939a[0x0]?.['delta']?.['content'])return _0x4f939a[0x0]['delta']['content'];})['filter'](_0xf3fc62=>_0xf3fc62)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0xe54670){super(_0xe54670),_0xe54670['config']['get']('ai.aws.requestParameters')||_0xe54670['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']=_0xe54670['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0xe54670['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0xe54670['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0xe54670['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x2ee41c,context:_0xb1a6a0,onData:_0x2fefba,actionId:_0x4cb217}){const {model:_0x3689b5,stream:_0x3e621,..._0x577adc}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4cb217),_0x10c9bf={'prompt':await this['preparePrompt'](_0x2ee41c,_0xb1a6a0,_0x3689b5,_0x4cb217),..._0x577adc};this['_apiUrl']?await this['_processProxyRequest'](_0x10c9bf,_0x3689b5,_0x3e621,_0x2fefba,_0x4cb217):await this['_processAWSRequest'](_0x10c9bf,_0x3689b5,_0x3e621,_0x2fefba);}async['preparePrompt'](_0x4389a0,_0x193642,_0xb018f8,_0x4774c2){let _0x3e3868,_0x3070d7;return _0x193642?(_0x3e3868='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.',_0x3070d7='Instruction:\x0a'+_0x4389a0+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x193642):(_0x3e3868='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.',_0x3070d7=_0x4389a0),'meta.llama'==this['getModelFamily'](_0xb018f8)?'<<SYS>>\x0a'+_0x3e3868+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x3070d7+'\x0a[/INST]':'Human:\x0a'+_0x3e3868+'\x0a'+_0x3070d7+'\x0a\x0aAssistant:';}['getModelFamily'](_0x1a1acd){if(/^anthropic\.claude/['test'](_0x1a1acd))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x1a1acd))return'ai21.j2';if(/^cohere\.command/['test'](_0x1a1acd))return'cohere.command';if(/^meta\.llama/['test'](_0x1a1acd))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x1a1acd));}async['_processProxyRequest'](_0x1160a2,_0x4a7a8f,_0xa5f7b6,_0x34e380,_0x5766d2){const _0x4e4686={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5766d2),'body':JSON['stringify']({..._0x1160a2,'model':_0x4a7a8f,'stream':_0xa5f7b6}),'signal':this['abortController']['signal']},_0x37662d=await fetch(this['_apiUrl'],_0x4e4686);_0xa5f7b6?await this['_readStreamableResponse'](_0x37662d,_0x4a7a8f,_0x34e380):await this['_readStaticResponse'](_0x37662d,_0x4a7a8f,_0x34e380);}async['_processAWSRequest'](_0x2a4e2d,_0xc4c1d3,_0x2c2a83,_0x5f0688){const _0x5cb01e=new _0xe96c7a(this['_bedrockClientConfig']),_0x472e84={'body':JSON['stringify'](_0x2a4e2d),'contentType':'application/json','accept':'application/json','modelId':_0xc4c1d3};let _0x3d1a86;if(_0x2c2a83){const _0x1966a1=new _0x2b647c(_0x472e84);_0x3d1a86=await _0x5cb01e['send'](_0x1966a1,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x3d1a86,_0xc4c1d3,_0x5f0688);}else{const _0x1d5868=new _0x5530c8(_0x472e84);_0x3d1a86=await _0x5cb01e['send'](_0x1d5868,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x3d1a86,_0xc4c1d3,_0x5f0688);}}async['_readAsyncIterableResponse'](_0x3366b6,_0x21a049,_0x11af43){const _0x53d27c=_0x3366b6['body'],_0x2314e7=new TextDecoder('utf-8');let _0x5a16c6='';for await(const _0x59c2a7 of _0x53d27c)if(_0x59c2a7['chunk']){const _0xccee2d=_0x2314e7['decode'](_0x59c2a7['chunk']['bytes']),_0x4942b9=JSON['parse'](_0xccee2d);_0x5a16c6+=this['_getGeneratedText'](_0x4942b9,_0x21a049),_0x11af43(_0x5a16c6);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4359ff,_0x58eaa6,_0x3bf078){const _0x5e79e9=_0x4359ff['body'],_0x255d61=new TextDecoder('utf-8'),_0x5cd6d5=_0x5e79e9['getReader']();let _0x4b0630='',_0x484937='',_0x58571d=!0x1;for(;!_0x58571d;){const {done:_0x3f89e2,value:_0x77aec0}=await _0x5cd6d5['read']();if(_0x58571d=_0x3f89e2,_0x58571d)break;const _0x12b614=(_0x4b0630+_0x255d61['decode'](_0x77aec0))['split']('\x0a')['map'](_0x6914e9=>{try{return _0x4b0630='',JSON['parse'](_0x6914e9);}catch{return _0x4b0630=_0x6914e9,null;}})['filter'](_0x1b0c54=>null!==_0x1b0c54);_0x12b614['length']&&(_0x484937+=_0x12b614['map'](_0x23600d=>this['_getGeneratedText'](_0x23600d,_0x58eaa6))['join'](''),_0x3bf078(_0x484937));}return Promise['resolve']();}async['_readStaticResponse'](_0x104b76,_0x5a22e3,_0x4d0474){let _0x77c0ef;return _0x77c0ef=_0x104b76 instanceof Response?await _0x104b76['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x104b76['body'])),(_0x4d0474(this['_getGeneratedText'](_0x77c0ef,_0x5a22e3)),Promise['resolve']());}['_getGeneratedText'](_0x40641f,_0x215a91){switch(this['getModelFamily'](_0x215a91)){case'anthropic.claude':return _0x40641f['completion'];case'ai21.j2':return _0x40641f['completions'][0x0]['data']['text'];case'cohere.command':return _0x40641f['generations'][0x0]['text'];case'meta.llama':return _0x40641f['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 _0x2b6c54,Command as _0x1dccc8}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x304d4d,IconCheck as _0xcff105,IconError as _0x2b859a,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x50f945,IconRobotPencil as _0x343916}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x22b484,CKEditorError as _0x21c9cb,ObservableMixin as _0x54cca6,global as _0x57a210,isVisible as _0x2146f8,Rect as _0x69d59,Collection as _0x1dfbd0,FocusTracker as et,KeystrokeHandler as rt,first as _0x596ae9}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x2e9743,View as _0x14eb86,SpinnerView as _0x2919c2,IconView as _0x33f3c5,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0xd35e38,createDropdown as _0x5f1cff,addMenuToDropdown as _0x2cb014,MenuBarMenuView as _0x459809,MenuBarMenuListItemButtonView as _0x1b20a1,DialogViewPosition as _0x4165ed,MenuBarMenuListView as _0x393361,MenuBarMenuListItemView as _0x32dda9}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x205f38,ClipboardMarkersUtils as _0x3704da}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x3b7ecc,ViewDataTransfer as _0x2f0709,ViewUpcastWriter as _0x26eafd,Matcher as _0x34d36b}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x541297,InvokeModelWithResponseStreamCommand as _0x4b1a54,InvokeModelCommand as _0x88711c}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x39f2bf,_0x456ab6){const _0x531b85=(0x0,_0x456ab6['t'])('Other');return _0x39f2bf['length']?'groupId'in _0x39f2bf[0x0]?_0x39f2bf:[{'groupId':K,'groupLabel':_0x531b85,'order':0x1/0x0,'commands':_0x39f2bf}]:[{'groupId':K,'groupLabel':_0x531b85,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x2b6c54{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0xc616b5}=this,_0x29fbf6=['ck-fake-ai-selection'];_0xc616b5['config']['get']('ai.useTheme')&&_0x29fbf6['push']('ck-ai-assistant-ui_theme'),_0xc616b5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x29fbf6,'priority':0xc}}),_0xc616b5['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x12f236,{writer:_0x517746})=>{if(!_0x12f236['markerRange']['isCollapsed'])return null;const _0x505c7c=_0x517746['createUIElement']('span');return _0x517746['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x505c7c),_0x505c7c;}});}['afterInit'](){!async function(_0x1cd050){const _0x4f7444=_0x1b167b([0x4c,0x4f,0x50,0x31,0x4a,0x7a,0x4d,0x69,0x59,0x45,0x49,0x57,0x6e,0x62,0x39,0x68,0x52,0x79,0x32,0x34,0x56,0x73,0x48,0x42,0x43,0x4b,0x30,0x64,0x78,0x65,0x54,0x58,0x36,0x6a,0x33,0x76,0x37,0x41,0x70,0x4e,0x6b,0x72,0x63,0x6d,0x71,0x51,0x38,0x6f,0x61,0x53,0x74,0x77,0x6c,0x5a,0x75,0x46,0x66,0x67,0x55,0x44,0x35,0x47]),_0xea1269=0x537cf9ac,_0x5188fb=0x537b89bc^_0xea1269,_0x572d16=window[_0x1b167b([0x44,0x61,0x74,0x65])][_0x1b167b([0x6e,0x6f,0x77])](),_0x485081=_0x1cd050[_0x1b167b([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x28996b=new window[(_0x1b167b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1c1627=>{_0x485081[_0x1b167b([0x6f,0x6e,0x63,0x65])](_0x1b167b([0x72,0x65,0x61,0x64,0x79]),_0x1c1627);}),_0x4222f3={[_0x1b167b([0x6b,0x74,0x79])]:_0x1b167b([0x45,0x43]),[_0x1b167b([0x75,0x73,0x65])]:_0x1b167b([0x73,0x69,0x67]),[_0x1b167b([0x63,0x72,0x76])]:_0x1b167b([0x50,0x2d,0x32,0x35,0x36]),[_0x1b167b([0x78])]:_0x1b167b([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]),[_0x1b167b([0x79])]:_0x1b167b([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]),[_0x1b167b([0x61,0x6c,0x67])]:_0x1b167b([0x45,0x53,0x32,0x35,0x36])},_0x7c6404=_0x485081[_0x1b167b([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x1b167b([0x67,0x65,0x74])](_0x1b167b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x15061c(){let _0x12248b,_0x43c792=null,_0x31c22d=null;try{if(_0x7c6404==_0x1b167b([0x47,0x50,0x4c]))return _0x1b167b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x12248b=_0xb4b751(),!_0x12248b)return _0x1b167b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x12248b[_0x1b167b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x31c22d=_0x536ac2(_0x12248b[_0x1b167b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x12248b[_0x1b167b([0x6a,0x74,0x69])])),await _0x40c64e()?_0x6ba98b()?_0x4dc287()?_0x1b167b([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x506dc3()?(_0x12248b[_0x1b167b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1b167b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x43c792=_0x45f60d(_0x1b167b([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x12248b[_0x1b167b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1b167b([0x74,0x72,0x69,0x61,0x6c])&&(_0x43c792=_0x45f60d(_0x1b167b([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2fa327()):_0x1b167b([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x1b167b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x1b167b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x1b167b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x4dc287(){const _0x57d9d3=[_0x1b167b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x1b167b([0x74,0x72,0x69,0x61,0x6c])][_0x1b167b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x12248b[_0x1b167b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x572d16/0x3e8:0xe10*_0x5188fb;return _0x12248b[_0x1b167b([0x65,0x78,0x70])]<_0x57d9d3;}function _0x6ba98b(){const _0xdfffcd=_0x12248b[_0x1b167b([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0xdfffcd&&(!!_0xdfffcd[_0x1b167b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b167b([0x2a]))||!!_0xdfffcd[_0x1b167b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b167b([0x41,0x49])));}function _0x506dc3(){const _0x2e1b8d=_0x12248b[_0x1b167b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x2e1b8d||0x0==_0x2e1b8d[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1232a6}=new URL(window[_0x1b167b([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x2e1b8d[_0x1b167b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1232a6))return!0x0;const _0x310358=_0x1232a6[_0x1b167b([0x73,0x70,0x6c,0x69,0x74])](_0x1b167b([0x2e]));return _0x2e1b8d[_0x1b167b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x35b95f=>_0x35b95f[_0x1b167b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b167b([0x2a])))[_0x1b167b([0x6d,0x61,0x70])](_0x10c812=>_0x10c812[_0x1b167b([0x73,0x70,0x6c,0x69,0x74])](_0x1b167b([0x2e])))[_0x1b167b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x18396a=>_0x18396a[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x310358[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1b167b([0x6d,0x61,0x70])](_0x1e0754=>Array(_0x310358[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x1e0754[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1b167b([0x66,0x69,0x6c,0x6c])](_0x1e0754[0x0]===_0x1b167b([0x2a])?_0x1b167b([0x2a]):'')[_0x1b167b([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x1e0754))[_0x1b167b([0x73,0x6f,0x6d,0x65])](_0x17d088=>_0x310358[_0x1b167b([0x65,0x76,0x65,0x72,0x79])]((_0x54d19a,_0x47fc5e)=>_0x17d088[_0x47fc5e]===_0x54d19a||_0x17d088[_0x47fc5e]===_0x1b167b([0x2a])));}function _0x2fa327(){return _0x43c792&&_0x31c22d?new window[(_0x1b167b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x232ff9,_0x1ad934)=>{_0x43c792[_0x1b167b([0x74,0x68,0x65,0x6e])](_0x232ff9,_0x1ad934),_0x31c22d[_0x1b167b([0x74,0x68,0x65,0x6e])](_0x3e295f=>{_0x3e295f!=_0x1b167b([0x56,0x61,0x6c,0x69,0x64])&&_0x232ff9(_0x3e295f);},_0x1ad934);}):_0x43c792||_0x31c22d||_0x1b167b([0x56,0x61,0x6c,0x69,0x64]);}}function _0x536ac2(_0x194f36,_0x1c671b){return new window[(_0x1b167b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x37f779=>{if(_0x4c01b0())return _0x37f779(_0x1b167b([0x56,0x61,0x6c,0x69,0x64]));_0x5758c6(),_0x485081[_0x1b167b([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x1b167b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x41f638=!0x1;const _0x20b1fd=_0x22b484();function _0x2d0f7c(_0x248e29){return!!_0x248e29&&(typeof _0x248e29===_0x1b167b([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x248e29===_0x1b167b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x248e29[_0x1b167b([0x74,0x68,0x65,0x6e])]===_0x1b167b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x248e29[_0x1b167b([0x63,0x61,0x74,0x63,0x68])]===_0x1b167b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x538e00(_0x454387){_0x4ff6c7(_0x454387)[_0x1b167b([0x74,0x68,0x65,0x6e])](_0x3b0d72=>{if(!_0x3b0d72||_0x3b0d72[_0x1b167b([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x1b167b([0x6f,0x6b]))return _0x1b167b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x58a798(_0x449d38(_0x20b1fd+_0x1c671b))!=_0x3b0d72[_0x1b167b([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x1b167b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x1b167b([0x56,0x61,0x6c,0x69,0x64]);})[_0x1b167b([0x74,0x68,0x65,0x6e])](_0x28d55c=>(_0x4ddb67(),_0x28d55c),()=>{const _0x5ff8a9=_0x2b7cac();return null==_0x5ff8a9?(_0x4ddb67(),_0x1b167b([0x56,0x61,0x6c,0x69,0x64])):_0x1b167b(_0x572d16-_0x5ff8a9>(0x77707dac^_0xea1269)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x1b167b([0x74,0x68,0x65,0x6e])](_0x37f779)[_0x1b167b([0x63,0x61,0x74,0x63,0x68])](()=>{_0x37f779(_0x1b167b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2ba6cd=0x534a172c^_0xea1269;function _0x4ddb67(){const _0x53f0cb=_0x1b167b([0x6c,0x6c,0x63,0x74,0x2d])+_0x58a798(_0x449d38(_0x194f36)),_0x2e784a=_0x361ca5(_0x58a798(window[_0x1b167b([0x4d,0x61,0x74,0x68])][_0x1b167b([0x63,0x65,0x69,0x6c])](_0x572d16/_0x2ba6cd)));window[_0x1b167b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1b167b([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x53f0cb,_0x2e784a);}function _0x2b7cac(){const _0x3a3dd6=_0x1b167b([0x6c,0x6c,0x63,0x74,0x2d])+_0x58a798(_0x449d38(_0x194f36)),_0x2d96e5=window[_0x1b167b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1b167b([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3a3dd6);return _0x2d96e5?window[_0x1b167b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x361ca5(_0x2d96e5),0x10)*_0x2ba6cd:null;}function _0x4ff6c7(_0x5500d6){return new window[(_0x1b167b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x59d430,_0x5d4331)=>{_0x5500d6[_0x1b167b([0x74,0x68,0x65,0x6e])](_0x59d430,_0x5d4331),window[_0x1b167b([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x5d4331,0x537d2d6c^_0xea1269);});}}_0x485081[_0x1b167b([0x6f,0x6e])](_0x1b167b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x203e28,_0x7e0cfb)=>{if(_0x7e0cfb[0x0]!=_0x194f36)return _0x37f779(_0x1b167b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x7e0cfb[0x1]={..._0x7e0cfb[0x1],[_0x1b167b([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x20b1fd};},{[_0x1b167b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1b167b([0x68,0x69,0x67,0x68])}),_0x485081[_0x1b167b([0x6f,0x6e])](_0x1b167b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0xff4d99=>{_0x2d0f7c(_0xff4d99[_0x1b167b([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x41f638=!0x0,_0x538e00(_0xff4d99[_0x1b167b([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x1b167b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1b167b([0x6c,0x6f,0x77])}),_0x28996b[_0x1b167b([0x74,0x68,0x65,0x6e])](()=>{_0x41f638||_0x37f779(_0x1b167b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4c01b0(){return _0x485081[_0x1b167b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1b167b([0x76,0x69,0x65,0x77])][_0x1b167b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x1b167b([0x61,0x75,0x74,0x6f]);}function _0x5758c6(){_0x485081[_0x1b167b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1b167b([0x76,0x69,0x65,0x77])][_0x1b167b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x1b167b([0x61,0x75,0x74,0x6f]);}}function _0x45f60d(_0x25f721){const _0x4a4af5=[new window[(_0x1b167b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xc50812=>setTimeout(_0xc50812,0x5375c760^_0xea1269)),_0x28996b[_0x1b167b([0x74,0x68,0x65,0x6e])](()=>new window[(_0x1b167b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x296688=>{let _0x1709dc=0x0;_0x485081[_0x1b167b([0x6d,0x6f,0x64,0x65,0x6c])][_0x1b167b([0x6f,0x6e])](_0x1b167b([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x54dc11,_0x12c2aa)=>{_0x12c2aa[0x0][_0x1b167b([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1709dc++,_0x1709dc==(0x537cf854^_0xea1269)&&(_0x296688(),_0x54dc11[_0x1b167b([0x6f,0x66,0x66])]());});}))];return window[_0x1b167b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x1b167b([0x72,0x61,0x63,0x65])](_0x4a4af5)[_0x1b167b([0x74,0x68,0x65,0x6e])](()=>_0x25f721);}async function _0x180a44(){await _0x28996b,_0x485081[_0x1b167b([0x6d,0x6f,0x64,0x65,0x6c])][_0x1b167b([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x390be9,_0x485081[_0x1b167b([0x6d,0x6f,0x64,0x65,0x6c])][_0x1b167b([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x390be9,_0x485081[_0x1b167b([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x1b167b([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x75bd7c(_0x4eca6f){const _0x5b4247=_0x4c879f();_0x485081[_0x5b4247]=_0x1b167b([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x4eca6f,_0x4eca6f!=_0x1b167b([0x56,0x61,0x6c,0x69,0x64])&&_0x180a44();}function _0x4c879f(){const _0x5874da=window[_0x1b167b([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x1b167b([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x1b167b([0x6e,0x6f,0x77])]())[_0x1b167b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x1b167b([0x2e]),'');let _0x466e2b=_0x1b167b([0x4c]);for(let _0x3fb31a=0x0;_0x3fb31a<_0x5874da[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3fb31a+=0x2){let _0x34c320=window[_0x1b167b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5874da[_0x1b167b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3fb31a,_0x3fb31a+0x2));_0x34c320>=_0x4f7444[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x34c320-=_0x4f7444[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x466e2b+=_0x4f7444[_0x34c320];}return _0x466e2b;}function _0xb4b751(){const _0x1352e9=_0x7c6404[_0x1b167b([0x73,0x70,0x6c,0x69,0x74])](_0x1b167b([0x2e]));if(0x3!=_0x1352e9[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x31f4d6(_0x1352e9[0x1]);function _0x31f4d6(_0x5cd6ab){const _0x1832e9=_0x1fb99f(_0x5cd6ab);return _0x1832e9&&_0x4a9c0b()?_0x1832e9:null;function _0x4a9c0b(){const _0x53ef5d=_0x1832e9[_0x1b167b([0x6a,0x74,0x69])],_0x4462c4=window[_0x1b167b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x53ef5d[_0x1b167b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x53ef5d[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3c3358={..._0x1832e9,[_0x1b167b([0x6a,0x74,0x69])]:_0x53ef5d[_0x1b167b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x53ef5d[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3c3358[_0x1b167b([0x76,0x63])],_0x449d38(_0x3c3358)==_0x4462c4;}}}async function _0x40c64e(){let _0x534060=!0x0;try{const _0x66e64e=_0x7c6404[_0x1b167b([0x73,0x70,0x6c,0x69,0x74])](_0x1b167b([0x2e])),[_0x53cc10,_0x47e97c,_0x110fe0]=_0x66e64e;return _0x2f9e63(_0x53cc10),await _0x3ae43f(_0x53cc10,_0x47e97c,_0x110fe0),_0x534060;}catch{return!0x1;}function _0x2f9e63(_0x5cdef3){const _0x579b3f=_0x1fb99f(_0x5cdef3);_0x579b3f&&_0x579b3f[_0x1b167b([0x61,0x6c,0x67])]==_0x1b167b([0x45,0x53,0x32,0x35,0x36])||(_0x534060=!0x1);}async function _0x3ae43f(_0x5c3e16,_0x34f026,_0x5e7701){const _0x498cd7=window[_0x1b167b([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x1b167b([0x66,0x72,0x6f,0x6d])](_0x541b68(_0x5e7701),_0x5727a7=>_0x5727a7[_0x1b167b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x27464d=new window[(_0x1b167b([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x1b167b([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5c3e16+_0x1b167b([0x2e])+_0x34f026),_0x8af9a8=window[_0x1b167b([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x1b167b([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x8af9a8)return;const _0x525c51=await _0x8af9a8[_0x1b167b([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x1b167b([0x6a,0x77,0x6b]),_0x4222f3,{[_0x1b167b([0x6e,0x61,0x6d,0x65])]:_0x1b167b([0x45,0x43,0x44,0x53,0x41]),[_0x1b167b([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x1b167b([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x1b167b([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x8af9a8[_0x1b167b([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x1b167b([0x6e,0x61,0x6d,0x65])]:_0x1b167b([0x45,0x43,0x44,0x53,0x41]),[_0x1b167b([0x68,0x61,0x73,0x68])]:{[_0x1b167b([0x6e,0x61,0x6d,0x65])]:_0x1b167b([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x525c51,_0x498cd7,_0x27464d)||(_0x534060=!0x1);}}function _0x1fb99f(_0x3a86ab){return _0x3a86ab[_0x1b167b([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x1b167b([0x65,0x79]))?JSON[_0x1b167b([0x70,0x61,0x72,0x73,0x65])](_0x541b68(_0x3a86ab)):null;}function _0x541b68(_0x449667){return window[_0x1b167b([0x61,0x74,0x6f,0x62])](_0x449667[_0x1b167b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x1b167b([0x2b]))[_0x1b167b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x1b167b([0x2f])));}function _0x449d38(_0x383f26){let _0x4e86fb=0x1505;function _0x160679(_0x3e3954){for(let _0xeb5d74=0x0;_0xeb5d74<_0x3e3954[_0x1b167b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xeb5d74++){const _0x2c74ee=_0x3e3954[_0x1b167b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0xeb5d74);_0x4e86fb=(_0x4e86fb<<0x5)+_0x4e86fb+_0x2c74ee,_0x4e86fb&=_0x4e86fb;}}function _0x53d108(_0x348041){Array[_0x1b167b([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x348041)?_0x348041[_0x1b167b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x53d108):_0x348041&&typeof _0x348041==_0x1b167b([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x1b167b([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x348041)[_0x1b167b([0x73,0x6f,0x72,0x74])]()[_0x1b167b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x377b98,_0x209c3e])=>{_0x160679(_0x377b98),_0x53d108(_0x209c3e);}):_0x160679(window[_0x1b167b([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x348041));}return _0x53d108(_0x383f26),_0x4e86fb>>>0x0;}function _0x58a798(_0x31ead5){return _0x31ead5[_0x1b167b([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x1b167b([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x1b167b([0x30]));}function _0x361ca5(_0x587076){return _0x587076[_0x1b167b([0x73,0x70,0x6c,0x69,0x74])]('')[_0x1b167b([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x1b167b([0x6a,0x6f,0x69,0x6e])]('');}function _0x390be9(){}function _0x1b167b(_0x241d18){return _0x241d18['map'](_0x5ba4e9=>String['fromCharCode'](_0x5ba4e9))['join']('');}_0x75bd7c(await _0x15061c());}(this);}['showFakeVisualSelection'](){const _0x48426e=this['editor']['model'];_0x48426e['change'](_0xf3f4bb=>{const _0x1a34cf=_0x48426e['document']['selection']['getRanges']();let _0x195af9=0x0;for(const _0x2237dd of _0x1a34cf){const _0x3e6a57=w+':'+_0x195af9;if(_0x48426e['markers']['has'](_0x3e6a57))_0xf3f4bb['updateMarker'](_0x3e6a57,{'range':_0x2237dd});else{if(_0x2237dd['start']['isAtEnd']){const _0xe834fa=_0x2237dd['start']['getLastMatchingPosition'](({item:_0x340c53})=>!_0x48426e['schema']['isContent'](_0x340c53),{'boundaries':_0x2237dd});_0xf3f4bb['addMarker'](_0x3e6a57,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xf3f4bb['createRange'](_0xe834fa,_0x2237dd['end'])});}else _0xf3f4bb['addMarker'](_0x3e6a57,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2237dd});}_0x195af9++;}});}['hideFakeVisualSelection'](){const _0x55136f=this['editor']['model'],_0x1b7782=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x1b7782['length']&&_0x55136f['change'](_0x50bf24=>{_0x1b7782['forEach'](_0x5bb3e3=>{_0x50bf24['removeMarker'](_0x5bb3e3);});});}['insertContent'](_0x5df652,_0x553943){const _0x4d4e15=this['_getAISelection'](),_0x2d4bba=_0x553943||_0x4d4e15['getFirstRange']();this['editor']['model']['canEditAt'](_0x2d4bba)&&this['editor']['model']['change'](_0x2e5a34=>{this['hideFakeVisualSelection'](),_0x553943||this['_resetContentOfSelectedTableCells'](_0x2e5a34,_0x4d4e15),this['_pasteHTMLUsingClipboard']({'insertAt':_0x2d4bba,'writer':_0x2e5a34,'html':_0x5df652});});}['insertContentBelow'](_0x45e3bb){const {model:_0x4ab98a}=this['editor'],_0x46e84c=this['_getAISelection']();_0x4ab98a['change'](()=>{const _0x475ff7=this['_prepareTableInsertBelowPosition'](_0x45e3bb,_0x46e84c)||this['_getDefaultInsertBelowPosition'](_0x46e84c);this['insertContent'](_0x45e3bb,_0x475ff7);});}['_getAISelection'](){const _0x486336=this['editor']['model'],_0x180bb4=Array['from'](_0x486336['markers']['getMarkersGroup'](w))['map'](_0x2d3059=>_0x2d3059['getRange']());return _0x486336['createSelection'](_0x180bb4);}['_pasteHTMLUsingClipboard']({writer:_0x354116,html:_0x429d05,insertAt:_0x18f5b2}){const {view:_0x49c928}=this['editor']['editing'],_0x4527a9=this['editor']['plugins']['get'](_0x205f38),_0x5eb536=new gt();_0x5eb536['setData']('text/html',_0x429d05);const _0x2e4c21=new ClipboardEvent('paste',{'clipboardData':_0x5eb536}),_0x3e2407=new _0x3b7ecc(_0x49c928,_0x2e4c21,{'dataTransfer':new _0x2f0709(_0x5eb536)});_0x354116['setSelection'](_0x18f5b2);const _0x1acf9d=(_0x2b2eb1,_0xc2d4c5)=>{_0xc2d4c5['resultRange']&&_0x354116['setSelection'](_0xc2d4c5['resultRange']);};_0x4527a9['once']('contentInsertion',_0x1acf9d,{'priority':'lowest'}),_0x49c928['document']['fire']('paste',_0x3e2407),_0x4527a9['off']('contentInsertion',_0x1acf9d);}['_getDefaultInsertBelowPosition'](_0x361494){const {model:_0x326466}=this['editor'],_0x3ade50=Array['from'](_0x361494['getSelectedBlocks']());return _0x3ade50['length']?_0x326466['createPositionAfter'](_0x3ade50['pop']()):_0x361494['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x5a34a6,_0x4d64b0){const {model:_0x253580,plugins:_0x2bc223}=this['editor'];if(_0x2bc223['has']('TableUtils')){const _0x116b3f=_0x2bc223['get']('TableUtils')['getSelectedTableCells'](_0x4d64b0);if(_0x116b3f['length']){const _0x5a0204=this['_getTableRowCountFromContent'](_0x5a34a6),_0x55eb4d=this['_createEmptyTableRows'](_0x116b3f,_0x5a0204);return _0x253580['createPositionAt'](_0x55eb4d,0x0);}}return null;}['_getTableRowCountFromContent'](_0x359948){const _0x1268fb=this['editor']['plugins']['get']('TableUtils'),_0x3be6ac=this['editor']['data']['parse'](_0x359948),_0x483702=Array['from'](_0x3be6ac['getChildren']())['filter'](_0x154fb2=>_0x154fb2['is']('element','table'));let _0x4b5225=0x0;return _0x483702['forEach'](_0x342886=>{_0x4b5225+=_0x1268fb['getRows'](_0x342886);}),_0x4b5225;}['_createEmptyTableRows'](_0x4ea11c,_0x1d1dba){const _0xf0f21e=this['editor']['plugins']['get']('TableUtils'),_0x4616a1=_0xf0f21e['getRowIndexes'](_0x4ea11c),_0xea7cf1=_0xf0f21e['getColumnIndexes'](_0x4ea11c),_0x4a1cd0=_0x4616a1['last']+0x1,_0x32105a=_0xea7cf1['first'],_0x59ed72=_0x4ea11c[0x0]['findAncestor']('table');for(let _0x1bdbd0=0x0;_0x1bdbd0<_0x1d1dba;_0x1bdbd0++)_0xf0f21e['insertRows'](_0x59ed72,{'at':_0x4a1cd0});return _0x59ed72['getChild'](_0x4a1cd0)['getChild'](_0x32105a);}['_resetContentOfSelectedTableCells'](_0x5a3357,_0x3caf77){const {plugins:_0xaac91e}=this['editor'],{model:_0x55a911}=_0x5a3357;if(!_0xaac91e['has']('TableUtils'))return;_0xaac91e['get']('TableUtils')['getSelectedTableCells'](_0x3caf77)['length']&&_0x55a911['deleteContent'](_0x3caf77);}}class x extends _0x2b6c54{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x21c9cb('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x46c796){super(_0x46c796),this['name']='AIRequestError';}}function i(_0x38c487,_0x3eceac,_0x337506){const t=_0x38c487['t'];switch(_0x3eceac){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',_0x337506);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x337506);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'},_0x337506);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 _0x3eceac;}}class E extends _0x1dccc8{['_commandDefinitions'];constructor(_0x111fe7,_0x735865){super(_0x111fe7),this['_commandDefinitions']=_0x735865,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x33145f,_0x3b8575,_0x2000ad)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x2000ad));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x10105d,_0x4a9ac2,_0x1b2ae8)=>{this['enabledCommandsIds']=_0x1b2ae8?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x69c76b=this['editor']['model'];this['_hasContext']=function(_0x50fd47){const _0x34e4b8=_0x50fd47['document']['selection'];return _0x34e4b8['isCollapsed']?0x0!==[..._0x34e4b8['getSelectedBlocks']()]['length']&&![..._0x34e4b8['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x50fd47['hasContent'](_0x34e4b8['getFirstRange']());}(_0x69c76b);const _0xc7e6f1=_0x69c76b['document']['selection'],_0x5d6a00=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x3c7689 of _0xc7e6f1['getRanges']())for(const _0x4bdb09 of _0x3c7689['getItems']())if(_0x4bdb09['is']('element')&&_0x5d6a00['includes'](_0x4bdb09['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x5d5087='',_0x1f978c='',_0x415475='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x5d5087,_0x1f978c,_0x415475);}}function F(_0x2494fe,_0xcea98){const _0x2adc56=new Set();for(const _0x57d387 of _0x2494fe['values']())(_0xcea98||!0x1===_0x57d387['requiresContent'])&&_0x2adc56['add'](_0x57d387['id']);return Array['from'](_0x2adc56);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ _0x54cca6(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x211870,_0x279980,_0x32487c){super(),this['editor']=_0x211870,this['textAdapter']=_0x279980,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x32487c,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4721b8,_0x1241b8,_0x289fc2)=>{this['view']['value']=this['_sanitizeHTML'](_0x289fc2);}),this['listenTo'](this['view'],'submitPrompt',(_0x2084d1,_0x4c5266)=>{const _0x14146a=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4c5266,_0x14146a,'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:_0x1d9994,query:_0x76bd84,htmlContent:_0x12ccd6,label:_0x164fcb,mainActionLabel:_0x1e7528}){this['view']['prompt']=_0x164fcb,this['view']['mainAction']=_0x1e7528,this['initialContext']=_0x12ccd6,_0x76bd84&&(this['view']['isRendered']?this['_handleQuery'](_0x76bd84,_0x12ccd6,_0x1d9994,_0x164fcb):this['view']['once']('render',()=>{this['_handleQuery'](_0x76bd84,_0x12ccd6,_0x1d9994,_0x164fcb);}));}['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'](_0x3cd401,_0x1df0b4,_0x39c1d4,_0x4bbaab){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x1df0b4,this['previousQuery']=_0x3cd401,this['previousLabel']=_0x4bbaab||_0x3cd401,this['previousActionId']=_0x39c1d4,new Promise(_0x2ea808=>{this['textAdapter']['makeRequest']({'query':_0x3cd401,'context':_0x1df0b4,'onData':_0x1eeb0e=>{this['currentResponse']=_0x1eeb0e,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x39c1d4})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x9c27c6=>{_0x9c27c6 instanceof R?this['view']['handleError'](_0x9c27c6['message']):this['view']['handleError'](),_0x2ea808();})['finally'](()=>{this['stopProcessing'](),_0x2ea808();});});}['_parseAndNormalizeContent'](_0x401aef,_0x2bcef2=!0x1){const _0x152079=Q['exec'](_0x401aef);_0x401aef=_0x152079?_0x401aef['substring'](_0x152079[0x1]['length']):_0x401aef['length']<0x64&&!_0x2bcef2?'':this['_stripMarkdownSyntax'](_0x401aef);const _0x9a6341=this['_domParser']['parseFromString'](_0x401aef,'text/html');if(_0x152079){const _0x235c70=Array['from'](_0x9a6341['body']['childNodes']);_0x235c70['reverse']();for(const _0x14892a of _0x235c70){if(_0x14892a['nodeType']==Node['ELEMENT_NODE'])break;_0x14892a['remove']();}}const _0x28fb59=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x9a6341['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x28fb59);const _0xf70766=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0xb9e10=this['editor']['data']['toModel'](_0x28fb59);return _0xf70766||_0xb9e10['markers']['clear'](),this['editor']['data']['stringify'](_0xb9e10);}['_normalizeResponseHeadings'](_0x2eee1d){const _0x223f39=new _0x26eafd(this['editor']['editing']['view']['document']),_0x1dd465=new _0x34d36b({'name':/^h[1-5]$/}),_0x30b918=[];let _0x460712=!0x1;for(const _0x4fdeec of _0x2eee1d)_0x4fdeec['is']('element')&&_0x1dd465['match'](_0x4fdeec)&&(_0x30b918['push'](_0x4fdeec),'h1'==_0x4fdeec['name']&&(_0x460712=!0x0));if(_0x460712){for(const _0x2745e2 of _0x30b918)_0x223f39['rename']('h'+(parseInt(_0x2745e2['name'][0x1])+0x1),_0x2745e2);}}['_isH1TagSupportEnabled'](){const {data:_0x5be3bf,editing:_0xe88c17}=this['editor'],_0x557ac3=_0x5be3bf['htmlProcessor']['toView']('<h1></h1>'),_0x349188=_0x5be3bf['toView'](_0x5be3bf['toModel'](_0x557ac3));return!!_0xe88c17['view']['domConverter']['viewToDom'](_0x349188)['querySelector']('h1');}['_sanitizeHTML'](_0x4a10c3){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4a10c3),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x1bff1b){const _0x498c97=_0x1bff1b['trim']();return _0x498c97['startsWith']('```html')?_0x498c97['endsWith']('```')?_0x498c97['substring'](0x7,_0x498c97['length']-0x3):_0x498c97['substring'](0x7):_0x1bff1b;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x39ca2f){super(_0x39ca2f),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x15397c=>i(_0x39ca2f,'AI_'+_0x15397c['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x39ca2f,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x39ca2f,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x39ca2f,'Stop'));const _0x398e77=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x398e77['if']('isVisible','ck-hidden',_0x42a69b=>!_0x42a69b)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x66c82,_0x5e80e1){const _0x418330=new _0x2e9743(this['locale']);return _0x418330['set']({'label':_0x66c82,'class':_0x5e80e1||'','isVisible':!0x0,'withText':!0x0}),_0x418330;}}class ct extends _0x14eb86{['contentFieldView'];['copyButtonView'];constructor(_0x4f9395,_0x2148e0=''){super(_0x4f9395),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x37c352=this['bindTemplate'];this['contentFieldView']=new bt(_0x4f9395,_0x2148e0),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x37c352['if']('isVisible','ck-hidden',_0x4ff802=>!_0x4ff802)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x37c352['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 _0x4d1982=!0x1;this['on']('change:value',(_0x59fad9,_0x2663cb,_0x2b528f)=>{const _0x4963e7=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2b528f),this['isProcessing']&&_0x4963e7&&!_0x4d1982&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x508de2,_0x3ce74f,_0x2c6df6)=>{_0x4d1982=!0x1,_0x2c6df6?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4d1982=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4d1982=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1b5f68=this['locale'],_0x14b855=new _0x2e9743(this['locale']),_0x59dfcc='ck-ai-form__copy-button';return _0x14b855['set']({'label':i(_0x1b5f68,'Copy'),'icon':_0x304d4d,'class':_0x59dfcc,'tooltip':!0x0}),_0x14b855['bind']('isVisible')['to'](this,'value',_0x27cd4d=>!!_0x27cd4d),_0x14b855['bind']('isEnabled')['to'](this,'isProcessing',_0x6752d0=>!_0x6752d0),_0x14b855['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x14b855['icon']=_0xcff105,_0x14b855['class']=_0x59dfcc+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x14b855['icon']=_0x304d4d,_0x14b855['class']=_0x59dfcc;},0x3e8);}),_0x14b855;}['_copyHTMLToClipboard'](_0x3d2720){const {window:_0x279312,document:_0x5c6007}=_0x57a210;if(_0x279312['ClipboardItem']){const {Blob:_0x15e24e,ClipboardItem:_0x251e43}=_0x279312,_0x44be6d=[new _0x251e43({'text/html':new _0x15e24e([_0x3d2720['innerHTML']],{'type':'text/html'}),'text/plain':new _0x15e24e([_0x3d2720['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x44be6d);}else{const _0x2559ea=_0x5c6007['createElement']('div');_0x2559ea['style']['position']='absolute',_0x2559ea['style']['left']='-9999px',_0x2559ea['innerHTML']='<span>[</span>'+_0x3d2720['innerHTML']+'<span>]</span>',_0x5c6007['body']['appendChild'](_0x2559ea);const _0x2d0e3d=_0x5c6007['createRange']();_0x2d0e3d['setStartAfter'](_0x2559ea['firstElementChild']),_0x2d0e3d['setEndBefore'](_0x2559ea['lastElementChild']);const _0x51b9ef=_0x279312['getSelection']();_0x51b9ef['removeAllRanges'](),_0x51b9ef['addRange'](_0x2d0e3d),_0x5c6007['execCommand']('copy'),_0x2559ea['remove']();}}}class bt extends _0x14eb86{constructor(_0x4ca721,_0x511089=''){super(_0x4ca721),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x511089,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x27d386){this['element']['innerHTML']=_0x27d386;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x39a935=new _0x14eb86(),_0x301eb8=this['locale'],_0x12b9a4=new _0x2919c2();return _0x12b9a4['isVisible']=!0x0,_0x39a935['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x12b9a4,{'text':i(_0x301eb8,'AI\x20is\x20writing...')}]}),_0x39a935['render'](),_0x39a935;}}class mt extends _0x14eb86{constructor(_0x474e74,_0xad9882=''){super(_0x474e74);const _0x47b90e=new _0x33f3c5(),_0x5e604c=this['bindTemplate'];this['set']('text',_0xad9882),_0x47b90e['content']=_0x2b859a,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x47b90e,{'text':_0x5e604c['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x25d84c,_0x328590){super(_0x25d84c,_0x328590),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',(_0x1bfe28,_0x3c9f75)=>{_0x1bfe28['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3c9f75());});}['_createSubmitButton'](){const _0x864f96=new _0x2e9743(this['locale']),_0x4fe82f=this['locale'];return _0x864f96['set']({'icon':it,'label':i(_0x4fe82f,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x864f96['on']('execute',()=>{this['submit']();}),_0x864f96['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4cdc30,_0x4aaeeb)=>!_0x4cdc30&&_0x4aaeeb),_0x864f96;}['_createShowHistoryButton'](){const _0x420bf6=new _0x2e9743(this['locale']),_0x180ecf=this['resultsView'],_0x3de3ca=this['locale'];_0x420bf6['set']({'label':i(_0x3de3ca,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x420bf6['bind']('isOn')['to'](_0x180ecf,'isVisible'),_0x420bf6['bind']('isEnabled')['to'](this,'isEnabled'),_0x420bf6['on']('execute',()=>{_0x180ecf['isVisible']=!_0x180ecf['isVisible'],_0x180ecf['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4400ef=()=>{_0x57a210['window']['requestAnimationFrame'](()=>{if(_0x2146f8(this['element'])){const _0xa045b6=new _0x69d59(this['queryView']['fieldView']['element']),_0x3f1060=_0xa045b6['width'],_0x1d4a4f='rtl'===_0x3de3ca['uiLanguageDirection']?'left':'right';_0xa045b6['excludeScrollbarsAndBorders'](),_0x420bf6['element']['style'][_0x1d4a4f]=_0x3f1060-_0xa045b6['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4400ef),this['on']('render',_0x4400ef),_0x420bf6;}['submit'](){const _0x24d115=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x24d115);}['focus'](_0x13f9d7){-0x1===_0x13f9d7?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x171093){super(_0x171093),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x171093,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2650f2=0x0;for(const _0x338417 of this['items'])_0x2650f2+=_0x338417['items']['length'];return{'resultsCount':_0x2650f2,'totalItemsCount':_0x2650f2};}['_createClearHistoryButton'](){const _0x6d7345=this['locale'],_0x103188=new _0x2e9743(this['locale']);return _0x103188['set']({'label':'('+i(_0x6d7345,'Clear')+')','withText':!0x0}),_0x103188['on']('execute',()=>this['fire']('clearHistory')),_0x103188;}}class ut extends xt{constructor(_0x3b90cf){super();const _0x492490=new wt(),_0xc8254c=new _0x2e9743(this['locale'],_0x492490);this['children']['add'](_0xc8254c),_0xc8254c['set']({'label':_0x3b90cf['prompt'],'withText':!0x0}),_0xc8254c['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x3b90cf['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x1dfbd0{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x26642a,_0x2c2e9b)=>{const _0x16cf12=os(_0x2c2e9b['prompt']);for(const _0x16ff7f of this)if(_0x16ff7f!=_0x2c2e9b&&os(_0x16ff7f['prompt'])===_0x16cf12){this['remove'](_0x16ff7f);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2a8144=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x2a8144));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x170e53=>_0x170e53)));}}function os(_0x441b62){return _0x441b62['toLowerCase']()['trim']();}class k extends _0x14eb86{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2d0360,_0x401e82,_0x107d5e=''){super(_0x2d0360),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(_0x2d0360),this['contentArea']=new ct(_0x2d0360,_0x107d5e),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 _0x1233b0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x401e82],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x1233b0['if']('isError','ck-hidden',_0x27dfa9=>!_0x27dfa9)]},'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'](_0x3aaa65=0x1){-0x1===_0x3aaa65?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 _0x3404f1=this['locale'],_0x5d0649=new lt(_0x3404f1,{'queryView':{'label':i(_0x3404f1,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x3404f1,'Empty\x20history'),'secondary':i(_0x3404f1,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5d0649['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2915a,_0x59214c)=>_0x2915a&&!_0x59214c),this['listenTo'](_0x5d0649,'submit',(_0x241aec,_0x7f53e6)=>{this['prompt']=_0x7f53e6;const _0x40d4c5=ft(_0x7f53e6);this['fire']('submitPrompt',_0x40d4c5),_0x7f53e6['trim']()&&this['_promptHistory']['add']({'prompt':_0x40d4c5},0x0);},{'priority':'high'}),_0x5d0649;}['_createHistoryView'](){const _0x3d5764=new pt(this['locale']);return _0x3d5764['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x3d5764['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3d5764;}['_createToolbar'](){const _0x269da2=new at(this['locale']);return _0x269da2['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5bb8d0,_0x2b303a,_0x9a7367)=>_0x5bb8d0&&!_0x2b303a&&!!_0x9a7367),_0x269da2['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x269da2['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x982d35,_0x805cdf,_0x4f1909)=>_0x982d35&&!_0x805cdf&&!!_0x4f1909),_0x269da2['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x269da2['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x47ce4e,_0x3c6fa5)=>_0x47ce4e&&!_0x3c6fa5),_0x269da2['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x269da2['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x269da2['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x269da2;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x17d2b1=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x17d2b1,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2f71f9){const _0x10094a=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2f71f9||i(_0x10094a,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x2b6c54{['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[_0x3704da,a,x,_0xd35e38];}constructor(_0x2d7b5e){super(_0x2d7b5e),_0x2d7b5e['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2d7b5e['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2d7b5e['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2d7b5e['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4361df}=this;this['_aiAdapter']=_0x4361df['plugins']['get'](x),this['_dialog']=_0x4361df['plugins']['get'](_0xd35e38),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x4b0cdc=new E(_0x4361df,Array['from'](this['_commandDefinitions']['values']()));_0x4361df['commands']['add']('showAIAssistant',_0x4b0cdc),_0x4361df['ui']['componentFactory']['add']('aiCommands',_0x2a19d8=>{const _0x3b8fbb=_0x5f1cff(_0x2a19d8);return _0x3b8fbb['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x3b8fbb['buttonView']['set']({'label':i(_0x2a19d8,'AI\x20Commands'),'icon':_0x50f945,'tooltip':!0x0}),_0x3b8fbb['on']('execute',_0x17af02=>this['_onExecute'](_0x17af02['source']['id'])),_0x2cb014(_0x3b8fbb,_0x4361df['ui']['view']['body'],function(_0x4dfd6d){const _0x53b3b5=o(_0x4dfd6d['config']['get']('ai.aiAssistant.commands'),_0x4dfd6d['locale']),_0x2bd5c6=U(_0x4dfd6d,_0x53b3b5)['filter'](_0x1edca4=>_0x1edca4['commands']['length']);if(0x1===_0x2bd5c6['length'])return U(_0x4dfd6d,_0x2bd5c6[0x0]['commands'])['map'](_0x32e4fb=>({'id':_0x32e4fb['id'],'label':_0x32e4fb['label']}));return _0x2bd5c6['map'](_0x36c3f9=>{const {groupId:_0x2ea9a4,groupLabel:_0x4d6897,commands:_0x1827c3}=_0x36c3f9,_0x101e55=U(_0x4dfd6d,_0x1827c3)['map'](_0x4f999d=>({'id':_0x4f999d['id'],'label':_0x4f999d['label']}));return{'id':_0x2ea9a4,'menu':_0x4d6897||_0x2ea9a4,'children':_0x101e55};});}(_0x4361df),{'ariaLabel':i(_0x2a19d8,'AI\x20Commands')}),_0x3b8fbb['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x4b0cdc['on']('change:enabledCommandsIds',_0x14e427),_0x3b8fbb['menuView']['once']('render',_0x14e427),_0x3b8fbb;function _0x14e427(){_0x3b8fbb['isEnabled']=_0x4b0cdc['enabledCommandsIds']['length']>0x0;for(const _0x1af78c of _0x3b8fbb['menuView']['buttons'])_0x1af78c['isEnabled']=_0x4b0cdc['enabledCommandsIds']['includes'](_0x1af78c['id']);}}),_0x4361df['ui']['componentFactory']['add']('menuBar:aiCommands',_0x29a7d6=>{const _0x1dd896=new _0x459809(_0x29a7d6);_0x1dd896['buttonView']['set']({'label':i(_0x29a7d6,'AI\x20Commands'),'icon':_0x50f945}),_0x1dd896['bind']('isEnabled')['to'](_0x4b0cdc,'enabledCommandsIds',_0x41200e=>_0x41200e['length']>0x0);const _0xa62b00=o(_0x4361df['config']['get']('ai.aiAssistant.commands'),_0x29a7d6);return this['_populateMenuBarMenu'](_0x4b0cdc,_0x1dd896,_0xa62b00,_0x149b34=>this['_onExecute'](_0x149b34)),_0x1dd896;}),_0x4361df['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x36bee2=this['_createAIAssistantUIButton'](_0x2e9743);return _0x36bee2['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x36bee2;}),_0x4361df['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x460f76=this['_createAIAssistantUIButton'](_0x1b20a1);return _0x460f76['set']({'role':'menuitemcheckbox'}),_0x460f76;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x435023=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1e7eab;for(const _0x2363fa in _0x435023){const _0x363ad6=_0x2363fa,_0x2b28a2=_0x435023[_0x363ad6];if('aiLicenseKeyValid'==_0x2b28a2||'aiLicenseKeyInvalid'==_0x2b28a2||'aiLicenseKeyExpired'==_0x2b28a2||'aiLicenseKeyDomainLimit'==_0x2b28a2||'aiLicenseKeyNotAllowed'==_0x2b28a2||'aiLicenseKeyEvaluationLimit'==_0x2b28a2||'aiLicenseKeyTrialLimit'==_0x2b28a2||'aiLicenseKeyUsageLimit'==_0x2b28a2){delete _0x435023[_0x363ad6],_0x1e7eab=_0x2b28a2,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1e7eab&&_0x435023['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1e7eab&&_0x435023['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1e7eab&&_0x435023['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1e7eab&&_0x435023['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1e7eab&&_0x435023['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x1e7eab&&_0x435023['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x1e7eab&&_0x435023['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5a16e0='',_0x565692='',_0x3ea789='custom'){const _0xf1622a=this['editor'],_0x5b9063=_0xf1622a['editing']['view'],_0x5683e9=_0xf1622a['plugins']['get'](a),_0x1f85d6=_0xf1622a['plugins']['get'](_0x3704da);_0x5683e9['showFakeVisualSelection']();const _0xc92910=new l(),_0x2a7c82=new ClipboardEvent('copy',{'clipboardData':_0xc92910}),_0x223a7d=new _0x2f0709(_0xc92910),_0x55cc67=new _0x3b7ecc(_0x5b9063,_0x2a7c82,{'dataTransfer':_0x223a7d});_0x1f85d6['_forceMarkersCopy']('comment',()=>{_0x5b9063['document']['fire']('copy',_0x55cc67);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0xf1622a,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3d5056=_0x223a7d['getData']('text/html');const _0x218c4b=_0xf1622a['model']['document']['selection'],_0x5e23ec=Array['from'](_0x218c4b['getRanges']());0x1===_0x5e23ec['length']&&_0x5e23ec[0x0]['isFlat']&&!_0x218c4b['getSelectedElement']()&&''!==_0x3d5056['replace'](/&nbsp;/g,'')['trim']()&&(_0x3d5056='<p>'+_0x3d5056+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x3ea789,'query':_0x5a16e0,'htmlContent':_0x3d5056,'label':_0x565692,'mainActionLabel':_[_0xf1622a['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x343916,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x4165ed['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5683e9['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x3483bc=new Map(),_0x504ab3=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x1f1cde of _0x504ab3)for(const _0x3e00ef of _0x1f1cde['commands'])_0x3483bc['set'](_0x3e00ef['id'],{..._0x3e00ef,'groupId':_0x1f1cde['groupId'],'groupLabel':_0x1f1cde['groupLabel']||_0x1f1cde['groupId']});return _0x3483bc;}['_createAIAssistantUIButton'](_0x31e397){const _0x5e5581=this['editor'],_0x3f7f5f=_0x5e5581['commands']['get']('showAIAssistant'),_0x468d63=new _0x31e397(_0x5e5581['locale']);return _0x468d63['set']({'label':i(_0x5e5581['locale'],'AI\x20Assistant'),'icon':_0x343916,'isToggleable':!0x0}),_0x468d63['bind']('isEnabled')['to'](_0x3f7f5f),_0x468d63['bind']('isOn')['to'](this['_dialog'],'id',_0x4e4feb=>'aiAssistant'===_0x4e4feb),this['listenTo'](_0x468d63,'execute',()=>{_0x468d63['isOn']?this['hideUI']():_0x3f7f5f['execute']();}),_0x468d63;}['_initView'](){const _0x543a3e=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',()=>{_0x543a3e['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x543a3e['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4e8ae5,ui:{ariaLiveAnnouncer:_0x2085dc}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1e913d,_0x296d38,_0x4fe047)=>{const _0x359154=this['_aiAssistantController']['currentContext'];_0x4fe047?_0x2085dc['announce'](i(_0x4e8ae5,'AI\x20is\x20writing')):_0x359154&&_0x2085dc['announce'](i(_0x4e8ae5,'Generated\x20content:\x20%0',_0x359154),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3059e8,_0x40e88e,_0x59e31d)=>{if(_0x59e31d){const _0x48a5a3=this['_formView']['errorView']['text'];_0x2085dc['announce'](i(_0x4e8ae5,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x48a5a3));}});}['_onExecute'](_0x3e77c5){const _0x8b2af8=this['_commandDefinitions']['get'](_0x3e77c5),_0xd67383=this['editor'],_0x8dfb08=_0xd67383['model']['document']['selection'],_0x559ec8=_0xd67383['commands']['get']('showAIAssistant'),_0x1ebab6=_0xd67383['plugins']['get'](a),_0x4eafc0=''+(_0x8b2af8['groupId']!==K?_0x8b2af8['groupLabel']+':\x20':'')+_0x8b2af8['label'];if(!0x1!==_0x8b2af8['requiresContent']&&_0x8dfb08['isCollapsed']){const _0xabc658=_0x596ae9(_0x8dfb08['getSelectedBlocks']())||_0xd67383['model']['schema']['getLimitElement'](_0x8dfb08);_0xd67383['model']['change'](_0x167ff2=>{_0x167ff2['setSelection'](_0xabc658,'in');});}_0x1ebab6['showFakeVisualSelection'](),_0x559ec8['execute'](_0x8b2af8['prompt'],_0x4eafc0,'command:'+_0x3e77c5);}['_populateMenuBarMenu'](_0x2b1109,_0x691889,_0x54a633,_0xfc6c10){const _0x2a4127=this['editor'],_0x895465=_0x2a4127['locale'],_0xd4588b=new _0x393361(_0x895465),_0x1fd22e=U(_0x2a4127,_0x54a633)['filter'](_0x21dcc7=>_0x21dcc7['commands']['length']);0x1===_0x1fd22e['length']?this['_getMenuBarGroupButtons']({'command':_0x2b1109,'commands':_0x1fd22e[0x0]['commands'],'parentMenuView':_0x691889,'onExecute':_0xfc6c10})['forEach'](_0x3312fa=>_0xd4588b['items']['add'](_0x3312fa)):_0x1fd22e['forEach'](({groupId:_0x1d3196,groupLabel:_0x6a05fa,commands:_0x2909f0})=>{const _0x2a6247=new _0x32dda9(_0x895465,_0x691889),_0x37b380=new _0x459809(_0x895465),_0x168db1=new _0x393361(_0x895465),_0x2d73a3=this['_getMenuBarGroupButtons']({'command':_0x2b1109,'commands':_0x2909f0,'parentMenuView':_0x37b380,'onExecute':_0xfc6c10});_0x37b380['buttonView']['set']({'label':_0x6a05fa||_0x1d3196}),_0x37b380['delegate']('execute')['to'](_0x691889),_0x168db1['items']['addMany'](_0x2d73a3),_0x37b380['panelView']['children']['add'](_0x168db1),_0x2a6247['children']['add'](_0x37b380),_0xd4588b['items']['add'](_0x2a6247);}),_0x691889['panelView']['children']['add'](_0xd4588b);}['_getMenuBarGroupButtons']({command:_0x3387e0,commands:_0x1eacd9,parentMenuView:_0x4a8269,onExecute:_0x4b5d15}){const _0x436377=this['editor'],_0x5d119a=_0x436377['locale'];return U(_0x436377,_0x1eacd9)['map'](_0x5e3716=>{const _0x41205e=new _0x32dda9(_0x5d119a,_0x4a8269),_0x88d548=new _0x1b20a1(_0x5d119a);return _0x88d548['set']({'label':_0x5e3716['label']}),_0x88d548['delegate']('execute')['to'](_0x4a8269),_0x88d548['on']('execute',()=>_0x4b5d15(_0x5e3716['id'])),_0x88d548['bind']('isEnabled')['to'](_0x3387e0,'enabledCommandsIds',_0xfc8ed4=>_0xfc8ed4['includes'](_0x5e3716['id'])),_0x41205e['children']['add'](_0x88d548),_0x41205e;});}}function T(_0x713fa7,_0x3962d4){return void 0x0!==_0x713fa7['order']&&void 0x0===_0x3962d4['order']?0x1:void 0x0===_0x713fa7['order']&&void 0x0!==_0x3962d4['order']?-0x1:void 0x0!==_0x713fa7['order']&&void 0x0!==_0x3962d4['order']?_0x713fa7['order']-_0x3962d4['order']:0x0;}function U(_0x35fa89,_0x267eea){_0x267eea['sort'](T);const _0x307417={},_0x40dd10=[];for(const _0x51e2f2 of _0x267eea)if(void 0x0!==_0x51e2f2['order']){if(_0x51e2f2['order']in _0x307417)throw new _0x21c9cb('ai-commands-config-order-collision',_0x35fa89,{'conflictingDefinitions':[_0x51e2f2,_0x307417[_0x51e2f2['order']]]});_0x307417[_0x51e2f2['order']]=_0x51e2f2,_0x40dd10['splice'](_0x51e2f2['order'],0x0,_0x51e2f2);}else _0x40dd10['push'](_0x51e2f2);return _0x40dd10;}class At extends _0x2b6c54{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4ae62d){super(_0x4ae62d);const _0x291d7b=_0x4ae62d['config'],_0x4bcc69=_0x4ae62d['locale'];_0x291d7b['define']('ai.aiAssistant.preserveComments',!0x0),_0x291d7b['define']('ai.aiAssistant.commands',_t(_0x4bcc69)),_0x291d7b['define']('ai.aiAssistant.extraCommandGroups',[]),_0x291d7b['define']('ai.aiAssistant.removeCommands',[]);let _0xbb2d33=o(_0x291d7b['get']('ai.aiAssistant.commands'),_0x4bcc69);const _0x4242a1=_0x291d7b['get']('ai.aiAssistant.extraCommandGroups'),_0x304e39=_0x291d7b['get']('ai.aiAssistant.removeCommands');_0x4242a1['forEach'](_0xd9dba0=>{const _0x111056=_0xbb2d33['find'](_0x17acd9=>_0x17acd9['groupId']===_0xd9dba0['groupId']);_0x111056?_0x111056['commands']=_0x111056['commands']['concat'](_0xd9dba0['commands']):_0xbb2d33['push'](_0xd9dba0);}),_0xbb2d33=_0xbb2d33['filter'](_0x12b077=>!_0x304e39['includes'](_0x12b077['groupId'])),_0xbb2d33['forEach'](_0x5af369=>{_0x5af369['commands']=_0x5af369['commands']['filter'](_0x2aab35=>!_0x304e39['includes'](_0x2aab35['id']));}),_0x291d7b['set']('ai.aiAssistant.commands',_0xbb2d33);}}function _t(_0x3c1d23){return[{'groupId':'editOrReview','groupLabel':i(_0x3c1d23,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x3c1d23,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x3c1d23,'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(_0x3c1d23,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x3c1d23,'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(_0x3c1d23,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x3c1d23,'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(_0x3c1d23,'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(_0x3c1d23,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x3c1d23,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x3c1d23,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x3c1d23,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x3c1d23,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x3c1d23,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x3c1d23,'Change\x20style'),'commands':[{'id':'business','label':i(_0x3c1d23,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x3c1d23,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x3c1d23,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x3c1d23,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x3c1d23,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x3c1d23,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x3c1d23,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x3c1d23,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x3c1d23,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x3c1d23,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x3c1d23,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x3c1d23,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x3c1d23,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x2b6c54{['abortController'];static get['requires'](){return[x];}constructor(_0x44d6a8){super(_0x44d6a8),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'](_0x151242){return this['sendRequest'](_0x151242)['catch'](_0x38c843=>{if(_0x38c843 instanceof R)return Promise['reject'](_0x38c843);if('AbortError'==_0x38c843['name'])return Promise['resolve']();throw console['error'](_0x38c843),new _0x21c9cb('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x33641b,_0x32a23d){const _0xbb38c8=this['editor']['locale'],_0x5b376e={'Content-Type':'application/json'};if('object'==typeof _0x33641b)Object['assign'](_0x5b376e,_0x33641b);else{if(_0x33641b)try{const _0x2c2f0d=await _0x33641b(_0x32a23d);Object['assign'](_0x5b376e,_0x2c2f0d);}catch{return Promise['reject'](new R(i(_0xbb38c8,'AI_ERROR_GET_HEADERS')));}}return _0x5b376e;}async['_prepareRequestParameters'](_0x1a6d2c,_0x4746d6){const _0x257d4c=this['editor']['locale'];if('object'==typeof _0x1a6d2c)return _0x1a6d2c;try{return await _0x1a6d2c(_0x4746d6);}catch{return Promise['reject'](new R(i(_0x257d4c,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x2c1ac2){super(_0x2c1ac2),_0x2c1ac2['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x2c1ac2['config']['get']('ai.openAI.requestParameters')||_0x2c1ac2['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x2c1ac2['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x2c1ac2['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x2c1ac2['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x3101f2,context:_0x592f6a,onData:_0xcd05d5,actionId:_0x3aa23a}){const _0x561cfc=this['editor']['locale'],_0x50c27e=await this['prepareMessages'](_0x3101f2,_0x592f6a,_0x3aa23a),_0x53b50b=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3aa23a),_0x52aafd=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3aa23a),_0x2e8c86={'messages':_0x50c27e,..._0x52aafd},_0x46aab0={'method':'POST','headers':_0x53b50b,'body':JSON['stringify'](_0x2e8c86),'signal':this['abortController']['signal']},_0x3d82c4=await fetch(this['_apiUrl'],_0x46aab0);if(_0x3d82c4['ok'])return _0x52aafd['stream']?await this['_readStreamableResponse'](_0x3d82c4,_0xcd05d5):await this['_readStaticResponse'](_0x3d82c4,_0xcd05d5),Promise['resolve']();{const _0x1ad906=await _0x3d82c4['text']();return _0x1ad906['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x561cfc,'AI_ERROR_CONTEXT_LENGTH'))):_0x1ad906['includes']('Moderation')?Promise['reject'](new R(i(_0x561cfc,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1ad906));}}async['prepareMessages'](_0x27191e,_0x30ae65,_0x5b65ec){let _0x3102c7,_0x24d90c;return _0x30ae65?(_0x3102c7='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.',_0x24d90c='Instruction:\x0a'+_0x27191e+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x30ae65):(_0x3102c7='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.',_0x24d90c=_0x27191e),[{'role':'system','content':_0x3102c7},{'role':'user','content':_0x24d90c}];}async['_readStreamableResponse'](_0x18755d,_0x3dab38){const _0x56272a=_0x18755d['body']['getReader'](),_0x3a2379=new TextDecoder();let _0x424dff='',_0x134beb='',_0x57ebe8='',_0xf31631=!0x1;for(;!_0xf31631;){const {done:_0xcf58d7,value:_0x58e446}=await _0x56272a['read'](),_0x117531=_0x424dff+_0x3a2379['decode'](_0x58e446);let _0x547451='';_0xf31631=_0xcf58d7;try{_0x547451=this['_cleanUpData'](_0x117531),_0x424dff='';}catch{_0x424dff=_0x117531;continue;}_0x134beb+=_0x547451,!_0xf31631&&this['_isBufferIncomplete'](_0x134beb)||_0x134beb&&(_0x57ebe8+=_0x134beb,_0x134beb='',_0x3dab38(_0x57ebe8));}return Promise['resolve']();}async['_readStaticResponse'](_0x3c2cb4,_0x4fa9ba){return _0x4fa9ba((await _0x3c2cb4['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x11c474){const _0x121c4d=_0x11c474['split']('<')['length']!==_0x11c474['split']('>')['length'],_0x4a9919=_0x11c474['length']<0x1e;return _0x121c4d&&_0x4a9919;}['_cleanUpData'](_0x149868){return _0x149868['split'](/\n(?![^{]*\})/g)['map'](_0x3382da=>_0x3382da['replace']('data:\x20',''))['filter'](_0x3049e2=>_0x3049e2&&_0x3049e2['length']>0x0&&'[DONE]'!==_0x3049e2)['map'](_0xa14fbd=>{const {choices:_0x50573c}=JSON['parse'](_0xa14fbd);if(_0x50573c[0x0]?.['delta']?.['content'])return _0x50573c[0x0]['delta']['content'];})['filter'](_0x5e87bd=>_0x5e87bd)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x1e0515){super(_0x1e0515),_0x1e0515['config']['get']('ai.aws.requestParameters')||_0x1e0515['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']=_0x1e0515['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x1e0515['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x1e0515['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x1e0515['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x12dae4,context:_0x436e2b,onData:_0x11c78c,actionId:_0x7d3572}){const {model:_0x556866,stream:_0x5765a8,..._0x2bbc9d}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x7d3572),_0x14cecf={'prompt':await this['preparePrompt'](_0x12dae4,_0x436e2b,_0x556866,_0x7d3572),..._0x2bbc9d};this['_apiUrl']?await this['_processProxyRequest'](_0x14cecf,_0x556866,_0x5765a8,_0x11c78c,_0x7d3572):await this['_processAWSRequest'](_0x14cecf,_0x556866,_0x5765a8,_0x11c78c);}async['preparePrompt'](_0x5c4689,_0x578e72,_0x3d5451,_0x3e1c1d){let _0x1b11bc,_0x4dc264;return _0x578e72?(_0x1b11bc='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.',_0x4dc264='Instruction:\x0a'+_0x5c4689+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x578e72):(_0x1b11bc='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.',_0x4dc264=_0x5c4689),'meta.llama'==this['getModelFamily'](_0x3d5451)?'<<SYS>>\x0a'+_0x1b11bc+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4dc264+'\x0a[/INST]':'Human:\x0a'+_0x1b11bc+'\x0a'+_0x4dc264+'\x0a\x0aAssistant:';}['getModelFamily'](_0x106ca8){if(/^anthropic\.claude/['test'](_0x106ca8))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x106ca8))return'ai21.j2';if(/^cohere\.command/['test'](_0x106ca8))return'cohere.command';if(/^meta\.llama/['test'](_0x106ca8))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x106ca8));}async['_processProxyRequest'](_0x451325,_0x1529ce,_0x39290b,_0x4312b8,_0xa399cc){const _0x486936={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xa399cc),'body':JSON['stringify']({..._0x451325,'model':_0x1529ce,'stream':_0x39290b}),'signal':this['abortController']['signal']},_0x2b6fbc=await fetch(this['_apiUrl'],_0x486936);_0x39290b?await this['_readStreamableResponse'](_0x2b6fbc,_0x1529ce,_0x4312b8):await this['_readStaticResponse'](_0x2b6fbc,_0x1529ce,_0x4312b8);}async['_processAWSRequest'](_0x5846cb,_0x1ae77c,_0x5efe1a,_0x4bd767){const _0xd96552=new _0x541297(this['_bedrockClientConfig']),_0x2a257a={'body':JSON['stringify'](_0x5846cb),'contentType':'application/json','accept':'application/json','modelId':_0x1ae77c};let _0x579d99;if(_0x5efe1a){const _0x18910c=new _0x4b1a54(_0x2a257a);_0x579d99=await _0xd96552['send'](_0x18910c,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x579d99,_0x1ae77c,_0x4bd767);}else{const _0x4fd829=new _0x88711c(_0x2a257a);_0x579d99=await _0xd96552['send'](_0x4fd829,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x579d99,_0x1ae77c,_0x4bd767);}}async['_readAsyncIterableResponse'](_0x2f1a05,_0x4cae31,_0x26ddaf){const _0x58d847=_0x2f1a05['body'],_0x41d109=new TextDecoder('utf-8');let _0x348456='';for await(const _0xa2fbf3 of _0x58d847)if(_0xa2fbf3['chunk']){const _0xf3f2d0=_0x41d109['decode'](_0xa2fbf3['chunk']['bytes']),_0x522c12=JSON['parse'](_0xf3f2d0);_0x348456+=this['_getGeneratedText'](_0x522c12,_0x4cae31),_0x26ddaf(_0x348456);}return Promise['resolve']();}async['_readStreamableResponse'](_0x359d2e,_0x52cca9,_0x28a43f){const _0x45c36d=_0x359d2e['body'],_0x5a2330=new TextDecoder('utf-8'),_0x2c58ce=_0x45c36d['getReader']();let _0x3bed02='',_0x5e29ff='',_0x5f5df9=!0x1;for(;!_0x5f5df9;){const {done:_0x545bf3,value:_0x3dba67}=await _0x2c58ce['read']();if(_0x5f5df9=_0x545bf3,_0x5f5df9)break;const _0x4cee01=(_0x3bed02+_0x5a2330['decode'](_0x3dba67))['split']('\x0a')['map'](_0x3689c5=>{try{return _0x3bed02='',JSON['parse'](_0x3689c5);}catch{return _0x3bed02=_0x3689c5,null;}})['filter'](_0x3d87c4=>null!==_0x3d87c4);_0x4cee01['length']&&(_0x5e29ff+=_0x4cee01['map'](_0x19587c=>this['_getGeneratedText'](_0x19587c,_0x52cca9))['join'](''),_0x28a43f(_0x5e29ff));}return Promise['resolve']();}async['_readStaticResponse'](_0x387b44,_0x115738,_0x4236a8){let _0x192b8c;return _0x192b8c=_0x387b44 instanceof Response?await _0x387b44['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x387b44['body'])),(_0x4236a8(this['_getGeneratedText'](_0x192b8c,_0x115738)),Promise['resolve']());}['_getGeneratedText'](_0x5e160c,_0x497976){switch(this['getModelFamily'](_0x497976)){case'anthropic.claude':return _0x5e160c['completion'];case'ai21.j2':return _0x5e160c['completions'][0x0]['data']['text'];case'cohere.command':return _0x5e160c['generations'][0x0]['text'];case'meta.llama':return _0x5e160c['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.11",
3
+ "version": "46.0.1-alpha.13",
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.11",
33
- "@ckeditor/ckeditor5-core": "46.0.1-alpha.11",
34
- "@ckeditor/ckeditor5-engine": "46.0.1-alpha.11",
35
- "@ckeditor/ckeditor5-icons": "46.0.1-alpha.11",
36
- "@ckeditor/ckeditor5-table": "46.0.1-alpha.11",
37
- "@ckeditor/ckeditor5-ui": "46.0.1-alpha.11",
38
- "@ckeditor/ckeditor5-utils": "46.0.1-alpha.11",
39
- "ckeditor5": "46.0.1-alpha.11",
32
+ "@ckeditor/ckeditor5-clipboard": "46.0.1-alpha.13",
33
+ "@ckeditor/ckeditor5-core": "46.0.1-alpha.13",
34
+ "@ckeditor/ckeditor5-engine": "46.0.1-alpha.13",
35
+ "@ckeditor/ckeditor5-icons": "46.0.1-alpha.13",
36
+ "@ckeditor/ckeditor5-table": "46.0.1-alpha.13",
37
+ "@ckeditor/ckeditor5-ui": "46.0.1-alpha.13",
38
+ "@ckeditor/ckeditor5-utils": "46.0.1-alpha.13",
39
+ "ckeditor5": "46.0.1-alpha.13",
40
40
  "es-toolkit": "1.39.5"
41
41
  },
42
42
  "type": "module",