@ckeditor/ckeditor5-ai 46.1.1-alpha.1 → 46.1.1-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -20,5 +20,5 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x203b64,Command as _0x2ede98}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x48c7c2,IconCheck as _0x55ed85,IconError as _0x179632,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x2d7888,IconRobotPencil as _0x4d8ec6}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x57444b,CKEditorError as _0x432637,ObservableMixin as _0x28aaa8,global as _0x21209c,isVisible as _0x3573da,Rect as _0x4adaae,Collection as _0x4b7e35,FocusTracker as et,KeystrokeHandler as rt,first as _0x5c978f}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x360d56,View as _0x539d26,SpinnerView as _0x4c268f,IconView as _0x3b7b9e,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x4cb503,createDropdown as _0x4a0f33,addMenuToDropdown as _0x26431b,MenuBarMenuView as _0x142d14,MenuBarMenuListItemButtonView as _0x41a769,DialogViewPosition as _0x1c3106,MenuBarMenuListView as _0x214386,MenuBarMenuListItemView as _0x379cd5}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x1ffa04,ClipboardMarkersUtils as _0x8c64db}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x3bcd25,ViewDataTransfer as _0x5bb7c8,ViewUpcastWriter as _0x308b75,Matcher as _0xabf76e}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x40efcc,InvokeModelWithResponseStreamCommand as _0x318244,InvokeModelCommand as _0x230025}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x60fbe,_0x591e3b){const _0x598e9f=(0x0,_0x591e3b['t'])('Other');return _0x60fbe['length']?'groupId'in _0x60fbe[0x0]?_0x60fbe:[{'groupId':K,'groupLabel':_0x598e9f,'order':0x1/0x0,'commands':_0x60fbe}]:[{'groupId':K,'groupLabel':_0x598e9f,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x203b64{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x57b0c3}=this,_0x44407=['ck-fake-ai-selection'];_0x57b0c3['config']['get']('ai.useTheme')&&_0x44407['push']('ck-ai-assistant-ui_theme'),_0x57b0c3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x44407,'priority':0xc}}),_0x57b0c3['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x125c75,{writer:_0x981048})=>{if(!_0x125c75['markerRange']['isCollapsed'])return null;const _0x507bb3=_0x981048['createUIElement']('span');return _0x981048['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x507bb3),_0x507bb3;}});}['afterInit'](){!async function(_0x5b0133){const _0x4b651c=_0x2aa2fa([0x6e,0x41,0x37,0x79,0x75,0x72,0x67,0x4f,0x48,0x62,0x5a,0x76,0x44,0x70,0x6c,0x52,0x6b,0x4a,0x73,0x63,0x64,0x49,0x43,0x6d,0x38,0x36,0x6f,0x50,0x57,0x78,0x39,0x32,0x66,0x31,0x71,0x46,0x30,0x4c,0x61,0x53,0x58,0x33,0x4e,0x47,0x77,0x54,0x4d,0x4b,0x34,0x6a,0x56,0x74,0x59,0x55,0x42,0x51,0x69,0x35,0x7a,0x68,0x65,0x45]),_0x820424=0x3dffc4e1,_0x163ffe=0x3df8b7a1^_0x820424,_0x42025f=window[_0x2aa2fa([0x44,0x61,0x74,0x65])][_0x2aa2fa([0x6e,0x6f,0x77])](),_0x38d1ff=_0x5b0133[_0x2aa2fa([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x596cf4=new window[(_0x2aa2fa([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x80f817=>{_0x38d1ff[_0x2aa2fa([0x6f,0x6e,0x63,0x65])](_0x2aa2fa([0x72,0x65,0x61,0x64,0x79]),_0x80f817);}),_0x10bb41={[_0x2aa2fa([0x6b,0x74,0x79])]:_0x2aa2fa([0x45,0x43]),[_0x2aa2fa([0x75,0x73,0x65])]:_0x2aa2fa([0x73,0x69,0x67]),[_0x2aa2fa([0x63,0x72,0x76])]:_0x2aa2fa([0x50,0x2d,0x32,0x35,0x36]),[_0x2aa2fa([0x78])]:_0x2aa2fa([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]),[_0x2aa2fa([0x79])]:_0x2aa2fa([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]),[_0x2aa2fa([0x61,0x6c,0x67])]:_0x2aa2fa([0x45,0x53,0x32,0x35,0x36])},_0x247210=_0x38d1ff[_0x2aa2fa([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2aa2fa([0x67,0x65,0x74])](_0x2aa2fa([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0xb86659(){let _0x227267,_0x23f896=null,_0x2ed10e=null;try{if(_0x247210==_0x2aa2fa([0x47,0x50,0x4c]))return _0x2aa2fa([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x227267=_0x1b26e7(),!_0x227267)return _0x2aa2fa([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x227267[_0x2aa2fa([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2ed10e=_0x2a732b(_0x227267[_0x2aa2fa([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x227267[_0x2aa2fa([0x6a,0x74,0x69])])),await _0xc38495()?_0x1bda2c()?_0x38eb72()?_0x2aa2fa([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1a96f2()?(_0x227267[_0x2aa2fa([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2aa2fa([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x23f896=_0x2764e0(_0x2aa2fa([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x227267[_0x2aa2fa([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2aa2fa([0x74,0x72,0x69,0x61,0x6c])&&(_0x23f896=_0x2764e0(_0x2aa2fa([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x40bf2d()):_0x2aa2fa([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2aa2fa([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2aa2fa([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x2aa2fa([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x38eb72(){const _0x413d4e=[_0x2aa2fa([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2aa2fa([0x74,0x72,0x69,0x61,0x6c])][_0x2aa2fa([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x227267[_0x2aa2fa([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x42025f/0x3e8:0xe10*_0x163ffe;return _0x227267[_0x2aa2fa([0x65,0x78,0x70])]<_0x413d4e;}function _0x1bda2c(){const _0x57c2a7=_0x227267[_0x2aa2fa([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x57c2a7&&(!!_0x57c2a7[_0x2aa2fa([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2aa2fa([0x2a]))||!!_0x57c2a7[_0x2aa2fa([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2aa2fa([0x41,0x49])));}function _0x1a96f2(){const _0x5baf34=_0x227267[_0x2aa2fa([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5baf34||0x0==_0x5baf34[_0x2aa2fa([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x49247f}=new URL(window[_0x2aa2fa([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5baf34[_0x2aa2fa([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x49247f))return!0x0;const _0x427ad0=_0x49247f[_0x2aa2fa([0x73,0x70,0x6c,0x69,0x74])](_0x2aa2fa([0x2e]));return _0x5baf34[_0x2aa2fa([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x573d46=>_0x573d46[_0x2aa2fa([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2aa2fa([0x2a])))[_0x2aa2fa([0x6d,0x61,0x70])](_0xfd9aae=>_0xfd9aae[_0x2aa2fa([0x73,0x70,0x6c,0x69,0x74])](_0x2aa2fa([0x2e])))[_0x2aa2fa([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2630e4=>_0x2630e4[_0x2aa2fa([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x427ad0[_0x2aa2fa([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2aa2fa([0x6d,0x61,0x70])](_0x459704=>Array(_0x427ad0[_0x2aa2fa([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x459704[_0x2aa2fa([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2aa2fa([0x66,0x69,0x6c,0x6c])](_0x459704[0x0]===_0x2aa2fa([0x2a])?_0x2aa2fa([0x2a]):'')[_0x2aa2fa([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x459704))[_0x2aa2fa([0x73,0x6f,0x6d,0x65])](_0x4ca915=>_0x427ad0[_0x2aa2fa([0x65,0x76,0x65,0x72,0x79])]((_0x3778ed,_0x499aa4)=>_0x4ca915[_0x499aa4]===_0x3778ed||_0x4ca915[_0x499aa4]===_0x2aa2fa([0x2a])));}function _0x40bf2d(){return _0x23f896&&_0x2ed10e?new window[(_0x2aa2fa([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x59a9b8,_0x9ada0e)=>{_0x23f896[_0x2aa2fa([0x74,0x68,0x65,0x6e])](_0x59a9b8,_0x9ada0e),_0x2ed10e[_0x2aa2fa([0x74,0x68,0x65,0x6e])](_0x1c9a49=>{_0x1c9a49!=_0x2aa2fa([0x56,0x61,0x6c,0x69,0x64])&&_0x59a9b8(_0x1c9a49);},_0x9ada0e);}):_0x23f896||_0x2ed10e||_0x2aa2fa([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2a732b(_0x2a6884,_0x370340){return new window[(_0x2aa2fa([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4290b7=>{if(_0x4a8197())return _0x4290b7(_0x2aa2fa([0x56,0x61,0x6c,0x69,0x64]));_0x3438d6(),_0x38d1ff[_0x2aa2fa([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2aa2fa([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x5c963f=!0x1;const _0x12bd1f=_0x57444b();function _0x1dd5f8(_0x3571a3){return!!_0x3571a3&&(typeof _0x3571a3===_0x2aa2fa([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3571a3===_0x2aa2fa([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3571a3[_0x2aa2fa([0x74,0x68,0x65,0x6e])]===_0x2aa2fa([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3571a3[_0x2aa2fa([0x63,0x61,0x74,0x63,0x68])]===_0x2aa2fa([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x70ce58(_0x58815f){_0x31565d(_0x58815f)[_0x2aa2fa([0x74,0x68,0x65,0x6e])](_0x54b539=>{if(!_0x54b539||_0x54b539[_0x2aa2fa([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2aa2fa([0x6f,0x6b]))return _0x2aa2fa([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0xf01c89(_0x418517(_0x12bd1f+_0x370340))!=_0x54b539[_0x2aa2fa([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2aa2fa([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2aa2fa([0x56,0x61,0x6c,0x69,0x64]);})[_0x2aa2fa([0x74,0x68,0x65,0x6e])](_0x138a24=>(_0x5e731b(),_0x138a24),()=>{const _0x381bc9=_0x5015ff();return null==_0x381bc9?(_0x5e731b(),_0x2aa2fa([0x56,0x61,0x6c,0x69,0x64])):_0x2aa2fa(_0x42025f-_0x381bc9>(0x19f340e1^_0x820424)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2aa2fa([0x74,0x68,0x65,0x6e])](_0x4290b7)[_0x2aa2fa([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4290b7(_0x2aa2fa([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x78131d=0x3dc92a61^_0x820424;function _0x5e731b(){const _0x5c88b1=_0x2aa2fa([0x6c,0x6c,0x63,0x74,0x2d])+_0xf01c89(_0x418517(_0x2a6884)),_0x11ca25=_0x19606f(_0xf01c89(window[_0x2aa2fa([0x4d,0x61,0x74,0x68])][_0x2aa2fa([0x63,0x65,0x69,0x6c])](_0x42025f/_0x78131d)));window[_0x2aa2fa([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2aa2fa([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5c88b1,_0x11ca25);}function _0x5015ff(){const _0x44771c=_0x2aa2fa([0x6c,0x6c,0x63,0x74,0x2d])+_0xf01c89(_0x418517(_0x2a6884)),_0x53c3c6=window[_0x2aa2fa([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2aa2fa([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x44771c);return _0x53c3c6?window[_0x2aa2fa([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x19606f(_0x53c3c6),0x10)*_0x78131d:null;}function _0x31565d(_0x599fd3){return new window[(_0x2aa2fa([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x555679,_0x23cbeb)=>{_0x599fd3[_0x2aa2fa([0x74,0x68,0x65,0x6e])](_0x555679,_0x23cbeb),window[_0x2aa2fa([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x23cbeb,0x3dfe1021^_0x820424);});}}_0x38d1ff[_0x2aa2fa([0x6f,0x6e])](_0x2aa2fa([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5a56bd,_0x9ff92b)=>{if(_0x9ff92b[0x0]!=_0x2a6884)return _0x4290b7(_0x2aa2fa([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x9ff92b[0x1]={..._0x9ff92b[0x1],[_0x2aa2fa([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x12bd1f};},{[_0x2aa2fa([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2aa2fa([0x68,0x69,0x67,0x68])}),_0x38d1ff[_0x2aa2fa([0x6f,0x6e])](_0x2aa2fa([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3ea161=>{_0x1dd5f8(_0x3ea161[_0x2aa2fa([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x5c963f=!0x0,_0x70ce58(_0x3ea161[_0x2aa2fa([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2aa2fa([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2aa2fa([0x6c,0x6f,0x77])}),_0x596cf4[_0x2aa2fa([0x74,0x68,0x65,0x6e])](()=>{_0x5c963f||_0x4290b7(_0x2aa2fa([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4a8197(){return _0x38d1ff[_0x2aa2fa([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2aa2fa([0x76,0x69,0x65,0x77])][_0x2aa2fa([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2aa2fa([0x61,0x75,0x74,0x6f]);}function _0x3438d6(){_0x38d1ff[_0x2aa2fa([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2aa2fa([0x76,0x69,0x65,0x77])][_0x2aa2fa([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2aa2fa([0x61,0x75,0x74,0x6f]);}}function _0x2764e0(_0x5940f5){const _0x66f6f7=[new window[(_0x2aa2fa([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x195e16=>setTimeout(_0x195e16,0x3df6fa2d^_0x820424)),_0x596cf4[_0x2aa2fa([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2aa2fa([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1672ca=>{let _0x446339=0x0;_0x38d1ff[_0x2aa2fa([0x6d,0x6f,0x64,0x65,0x6c])][_0x2aa2fa([0x6f,0x6e])](_0x2aa2fa([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3245ac,_0x4f24fc)=>{_0x4f24fc[0x0][_0x2aa2fa([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x446339++,_0x446339==(0x3dffc519^_0x820424)&&(_0x1672ca(),_0x3245ac[_0x2aa2fa([0x6f,0x66,0x66])]());});}))];return window[_0x2aa2fa([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2aa2fa([0x72,0x61,0x63,0x65])](_0x66f6f7)[_0x2aa2fa([0x74,0x68,0x65,0x6e])](()=>_0x5940f5);}async function _0x1261ce(){await _0x596cf4,_0x38d1ff[_0x2aa2fa([0x6d,0x6f,0x64,0x65,0x6c])][_0x2aa2fa([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x311270,_0x38d1ff[_0x2aa2fa([0x6d,0x6f,0x64,0x65,0x6c])][_0x2aa2fa([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x311270,_0x38d1ff[_0x2aa2fa([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2aa2fa([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2b41a3(_0x8fa4e){const _0x5476b7=_0x39ba29();_0x38d1ff[_0x5476b7]=_0x2aa2fa([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x8fa4e,_0x8fa4e!=_0x2aa2fa([0x56,0x61,0x6c,0x69,0x64])&&_0x1261ce();}function _0x39ba29(){const _0x372674=window[_0x2aa2fa([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2aa2fa([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2aa2fa([0x6e,0x6f,0x77])]())[_0x2aa2fa([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2aa2fa([0x2e]),'');let _0x203082=_0x2aa2fa([0x6e]);for(let _0x42a6c4=0x0;_0x42a6c4<_0x372674[_0x2aa2fa([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x42a6c4+=0x2){let _0x5cf97b=window[_0x2aa2fa([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x372674[_0x2aa2fa([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x42a6c4,_0x42a6c4+0x2));_0x5cf97b>=_0x4b651c[_0x2aa2fa([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5cf97b-=_0x4b651c[_0x2aa2fa([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x203082+=_0x4b651c[_0x5cf97b];}return _0x203082;}function _0x1b26e7(){const _0x5d80bb=_0x247210[_0x2aa2fa([0x73,0x70,0x6c,0x69,0x74])](_0x2aa2fa([0x2e]));if(0x3!=_0x5d80bb[_0x2aa2fa([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x41ceb0(_0x5d80bb[0x1]);function _0x41ceb0(_0x31e449){const _0x594244=_0x305797(_0x31e449);return _0x594244&&_0x1872ec()?_0x594244:null;function _0x1872ec(){const _0x134143=_0x594244[_0x2aa2fa([0x6a,0x74,0x69])],_0x14c3f4=window[_0x2aa2fa([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x134143[_0x2aa2fa([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x134143[_0x2aa2fa([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0xa5af65={..._0x594244,[_0x2aa2fa([0x6a,0x74,0x69])]:_0x134143[_0x2aa2fa([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x134143[_0x2aa2fa([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0xa5af65[_0x2aa2fa([0x76,0x63])],_0x418517(_0xa5af65)==_0x14c3f4;}}}async function _0xc38495(){let _0x2ba9b=!0x0;try{const _0x12a86b=_0x247210[_0x2aa2fa([0x73,0x70,0x6c,0x69,0x74])](_0x2aa2fa([0x2e])),[_0x45690a,_0x305feb,_0x2e603d]=_0x12a86b;return _0x139eaa(_0x45690a),await _0x1b00c2(_0x45690a,_0x305feb,_0x2e603d),_0x2ba9b;}catch{return!0x1;}function _0x139eaa(_0x8d0d5d){const _0x44659f=_0x305797(_0x8d0d5d);_0x44659f&&_0x44659f[_0x2aa2fa([0x61,0x6c,0x67])]==_0x2aa2fa([0x45,0x53,0x32,0x35,0x36])||(_0x2ba9b=!0x1);}async function _0x1b00c2(_0xf3761,_0x4fec16,_0x5c4d33){const _0x56830b=window[_0x2aa2fa([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2aa2fa([0x66,0x72,0x6f,0x6d])](_0x1f1d6f(_0x5c4d33),_0x470901=>_0x470901[_0x2aa2fa([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x10bb1e=new window[(_0x2aa2fa([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2aa2fa([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0xf3761+_0x2aa2fa([0x2e])+_0x4fec16),_0x1e54f7=window[_0x2aa2fa([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2aa2fa([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1e54f7)return;const _0x13699a=await _0x1e54f7[_0x2aa2fa([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2aa2fa([0x6a,0x77,0x6b]),_0x10bb41,{[_0x2aa2fa([0x6e,0x61,0x6d,0x65])]:_0x2aa2fa([0x45,0x43,0x44,0x53,0x41]),[_0x2aa2fa([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2aa2fa([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2aa2fa([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1e54f7[_0x2aa2fa([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2aa2fa([0x6e,0x61,0x6d,0x65])]:_0x2aa2fa([0x45,0x43,0x44,0x53,0x41]),[_0x2aa2fa([0x68,0x61,0x73,0x68])]:{[_0x2aa2fa([0x6e,0x61,0x6d,0x65])]:_0x2aa2fa([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x13699a,_0x56830b,_0x10bb1e)||(_0x2ba9b=!0x1);}}function _0x305797(_0x4f9eee){return _0x4f9eee[_0x2aa2fa([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2aa2fa([0x65,0x79]))?JSON[_0x2aa2fa([0x70,0x61,0x72,0x73,0x65])](_0x1f1d6f(_0x4f9eee)):null;}function _0x1f1d6f(_0x37c5b9){return window[_0x2aa2fa([0x61,0x74,0x6f,0x62])](_0x37c5b9[_0x2aa2fa([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2aa2fa([0x2b]))[_0x2aa2fa([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2aa2fa([0x2f])));}function _0x418517(_0x4c9e1a){let _0x580d8d=0x1505;function _0x2348c8(_0x17b22c){for(let _0x717ada=0x0;_0x717ada<_0x17b22c[_0x2aa2fa([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x717ada++){const _0x4cacda=_0x17b22c[_0x2aa2fa([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x717ada);_0x580d8d=(_0x580d8d<<0x5)+_0x580d8d+_0x4cacda,_0x580d8d&=_0x580d8d;}}function _0x58bf41(_0x5c73d4){Array[_0x2aa2fa([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x5c73d4)?_0x5c73d4[_0x2aa2fa([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x58bf41):_0x5c73d4&&typeof _0x5c73d4==_0x2aa2fa([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2aa2fa([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x5c73d4)[_0x2aa2fa([0x73,0x6f,0x72,0x74])]()[_0x2aa2fa([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x38cd68,_0x28c793])=>{_0x2348c8(_0x38cd68),_0x58bf41(_0x28c793);}):_0x2348c8(window[_0x2aa2fa([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x5c73d4));}return _0x58bf41(_0x4c9e1a),_0x580d8d>>>0x0;}function _0xf01c89(_0x51a21d){return _0x51a21d[_0x2aa2fa([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2aa2fa([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2aa2fa([0x30]));}function _0x19606f(_0x36d6ab){return _0x36d6ab[_0x2aa2fa([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2aa2fa([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2aa2fa([0x6a,0x6f,0x69,0x6e])]('');}function _0x311270(){}function _0x2aa2fa(_0x38a396){return _0x38a396['map'](_0x426ffe=>String['fromCharCode'](_0x426ffe))['join']('');}_0x2b41a3(await _0xb86659());}(this);}['showFakeVisualSelection'](){const _0x51253d=this['editor']['model'];_0x51253d['change'](_0x513e91=>{const _0xc79e5b=_0x51253d['document']['selection']['getRanges']();let _0x41cb96=0x0;for(const _0x1754e5 of _0xc79e5b){const _0x56a610=w+':'+_0x41cb96;if(_0x51253d['markers']['has'](_0x56a610))_0x513e91['updateMarker'](_0x56a610,{'range':_0x1754e5});else{if(_0x1754e5['start']['isAtEnd']){const _0x2a2fb5=_0x1754e5['start']['getLastMatchingPosition'](({item:_0x57f0c5})=>!_0x51253d['schema']['isContent'](_0x57f0c5),{'boundaries':_0x1754e5});_0x513e91['addMarker'](_0x56a610,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x513e91['createRange'](_0x2a2fb5,_0x1754e5['end'])});}else _0x513e91['addMarker'](_0x56a610,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1754e5});}_0x41cb96++;}});}['hideFakeVisualSelection'](){const _0x2c52b5=this['editor']['model'],_0x17be6e=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x17be6e['length']&&_0x2c52b5['change'](_0x31b0b9=>{_0x17be6e['forEach'](_0x421f77=>{_0x31b0b9['removeMarker'](_0x421f77);});});}['insertContent'](_0x12b89e,_0x1767f0){const _0x3a1a12=this['_getAISelection'](),_0x1dba58=_0x1767f0||_0x3a1a12['getFirstRange']();this['editor']['model']['canEditAt'](_0x1dba58)&&this['editor']['model']['change'](_0x3413e9=>{this['hideFakeVisualSelection'](),_0x1767f0||this['_resetContentOfSelectedTableCells'](_0x3413e9,_0x3a1a12),this['_pasteHTMLUsingClipboard']({'insertAt':_0x1dba58,'writer':_0x3413e9,'html':_0x12b89e});});}['insertContentBelow'](_0x3437ac){const {model:_0xfaa21}=this['editor'],_0x2284bf=this['_getAISelection']();_0xfaa21['change'](()=>{const _0x3177c2=this['_prepareTableInsertBelowPosition'](_0x3437ac,_0x2284bf)||this['_getDefaultInsertBelowPosition'](_0x2284bf);this['insertContent'](_0x3437ac,_0x3177c2);});}['_getAISelection'](){const _0x1fdd16=this['editor']['model'],_0x1677a2=Array['from'](_0x1fdd16['markers']['getMarkersGroup'](w))['map'](_0x4c0f57=>_0x4c0f57['getRange']());return _0x1fdd16['createSelection'](_0x1677a2);}['_pasteHTMLUsingClipboard']({writer:_0x1305ff,html:_0x34f40f,insertAt:_0x184ed0}){const {view:_0x218200}=this['editor']['editing'],_0xa8814d=this['editor']['plugins']['get'](_0x1ffa04),_0x846734=new gt();_0x846734['setData']('text/html',_0x34f40f);const _0x37a140=new ClipboardEvent('paste',{'clipboardData':_0x846734}),_0x2b630f=new _0x3bcd25(_0x218200,_0x37a140,{'dataTransfer':new _0x5bb7c8(_0x846734)});_0x1305ff['setSelection'](_0x184ed0);const _0x2703be=(_0x5e9c69,_0x1fc922)=>{_0x1fc922['resultRange']&&_0x1305ff['setSelection'](_0x1fc922['resultRange']);};_0xa8814d['once']('contentInsertion',_0x2703be,{'priority':'lowest'}),_0x218200['document']['fire']('paste',_0x2b630f),_0xa8814d['off']('contentInsertion',_0x2703be);}['_getDefaultInsertBelowPosition'](_0xfd47f2){const {model:_0x3fc0b1}=this['editor'],_0x22c31f=Array['from'](_0xfd47f2['getSelectedBlocks']());return _0x22c31f['length']?_0x3fc0b1['createPositionAfter'](_0x22c31f['pop']()):_0xfd47f2['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x466b77,_0x1c2284){const {model:_0x4f18c9,plugins:_0x1f5318}=this['editor'];if(_0x1f5318['has']('TableUtils')){const _0x25d5cf=_0x1f5318['get']('TableUtils')['getSelectedTableCells'](_0x1c2284);if(_0x25d5cf['length']){const _0x4030ae=this['_getTableRowCountFromContent'](_0x466b77),_0x4470da=this['_createEmptyTableRows'](_0x25d5cf,_0x4030ae);return _0x4f18c9['createPositionAt'](_0x4470da,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1d3c80){const _0x107dbe=this['editor']['plugins']['get']('TableUtils'),_0x1fc5a7=this['editor']['data']['parse'](_0x1d3c80),_0x46db26=Array['from'](_0x1fc5a7['getChildren']())['filter'](_0x269632=>_0x269632['is']('element','table'));let _0x46d212=0x0;return _0x46db26['forEach'](_0x404015=>{_0x46d212+=_0x107dbe['getRows'](_0x404015);}),_0x46d212;}['_createEmptyTableRows'](_0x2b5b47,_0x3f598d){const _0x5668c4=this['editor']['plugins']['get']('TableUtils'),_0x374859=_0x5668c4['getRowIndexes'](_0x2b5b47),_0x5e63f8=_0x5668c4['getColumnIndexes'](_0x2b5b47),_0x3461e7=_0x374859['last']+0x1,_0x521a60=_0x5e63f8['first'],_0x32c0ba=_0x2b5b47[0x0]['findAncestor']('table');for(let _0x288482=0x0;_0x288482<_0x3f598d;_0x288482++)_0x5668c4['insertRows'](_0x32c0ba,{'at':_0x3461e7});return _0x32c0ba['getChild'](_0x3461e7)['getChild'](_0x521a60);}['_resetContentOfSelectedTableCells'](_0x172ea7,_0x47558a){const {plugins:_0x51fcb6}=this['editor'],{model:_0x1a50c0}=_0x172ea7;if(!_0x51fcb6['has']('TableUtils'))return;_0x51fcb6['get']('TableUtils')['getSelectedTableCells'](_0x47558a)['length']&&_0x1a50c0['deleteContent'](_0x47558a);}}class x extends _0x203b64{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x432637('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x32c289){super(_0x32c289),this['name']='AIRequestError';}}function i(_0x21f225,_0x4b6ec2,_0x47edb9){const t=_0x21f225['t'];switch(_0x4b6ec2){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',_0x47edb9);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x47edb9);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'},_0x47edb9);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 _0x4b6ec2;}}class E extends _0x2ede98{['_commandDefinitions'];constructor(_0x12fa1f,_0xb19288){super(_0x12fa1f),this['_commandDefinitions']=_0xb19288,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x206940,_0x33379b,_0x42bc80)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x42bc80));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x1bf7f4,_0x5eb5b7,_0x32ce5b)=>{this['enabledCommandsIds']=_0x32ce5b?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x32865e=this['editor']['model'];this['_hasContext']=function(_0x49a4ec){const _0x5b1ba7=_0x49a4ec['document']['selection'];return _0x5b1ba7['isCollapsed']?0x0!==[..._0x5b1ba7['getSelectedBlocks']()]['length']&&![..._0x5b1ba7['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x49a4ec['hasContent'](_0x5b1ba7['getFirstRange']());}(_0x32865e);const _0x122c2c=_0x32865e['document']['selection'],_0x520718=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x35d46e of _0x122c2c['getRanges']())for(const _0x2db257 of _0x35d46e['getItems']())if(_0x2db257['is']('element')&&_0x520718['includes'](_0x2db257['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x12db34='',_0x16a8e1='',_0x32bce5='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x12db34,_0x16a8e1,_0x32bce5);}}function F(_0xf1841c,_0xd7243d){const _0x4a4ecd=new Set();for(const _0x385f7c of _0xf1841c['values']())(_0xd7243d||!0x1===_0x385f7c['requiresContent'])&&_0x4a4ecd['add'](_0x385f7c['id']);return Array['from'](_0x4a4ecd);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- _0x28aaa8(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x1deb6d,_0x5e0aa3,_0x521eec){super(),this['editor']=_0x1deb6d,this['textAdapter']=_0x5e0aa3,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x521eec,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x2f7204,_0x38216a,_0x5cf4de)=>{this['view']['value']=this['_sanitizeHTML'](_0x5cf4de);}),this['listenTo'](this['view'],'submitPrompt',(_0x4ac49e,_0x556757)=>{const _0x31bdbc=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x556757,_0x31bdbc,'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:_0x41fe07,query:_0x3cd123,htmlContent:_0x29feaa,label:_0x25381a,mainActionLabel:_0x57425e}){this['view']['prompt']=_0x25381a,this['view']['mainAction']=_0x57425e,this['initialContext']=_0x29feaa,_0x3cd123&&(this['view']['isRendered']?this['_handleQuery'](_0x3cd123,_0x29feaa,_0x41fe07,_0x25381a):this['view']['once']('render',()=>{this['_handleQuery'](_0x3cd123,_0x29feaa,_0x41fe07,_0x25381a);}));}['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'](_0x3e0769,_0x5eacc6,_0x8ec7d7,_0x5a72c2){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5eacc6,this['previousQuery']=_0x3e0769,this['previousLabel']=_0x5a72c2||_0x3e0769,this['previousActionId']=_0x8ec7d7,new Promise(_0x36b051=>{this['textAdapter']['makeRequest']({'query':_0x3e0769,'context':_0x5eacc6,'onData':_0x4e2cac=>{this['currentResponse']=_0x4e2cac,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x8ec7d7})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x4a1e2d=>{_0x4a1e2d instanceof R?this['view']['handleError'](_0x4a1e2d['message']):this['view']['handleError'](),_0x36b051();})['finally'](()=>{this['stopProcessing'](),_0x36b051();});});}['_parseAndNormalizeContent'](_0x43043e,_0x5be820=!0x1){const _0x3a617b=Q['exec'](_0x43043e);_0x43043e=_0x3a617b?_0x43043e['substring'](_0x3a617b[0x1]['length']):_0x43043e['length']<0x64&&!_0x5be820?'':this['_stripMarkdownSyntax'](_0x43043e);const _0x3106f3=this['_domParser']['parseFromString'](_0x43043e,'text/html');if(_0x3a617b){const _0x2185b5=Array['from'](_0x3106f3['body']['childNodes']);_0x2185b5['reverse']();for(const _0x13422b of _0x2185b5){if(_0x13422b['nodeType']==Node['ELEMENT_NODE'])break;_0x13422b['remove']();}}const _0x25208a=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x3106f3['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x25208a);const _0x8e223=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x45203d=this['editor']['data']['toModel'](_0x25208a);return _0x8e223||_0x45203d['markers']['clear'](),this['editor']['data']['stringify'](_0x45203d);}['_normalizeResponseHeadings'](_0x2f1197){const _0x421837=new _0x308b75(this['editor']['editing']['view']['document']),_0x1fefac=new _0xabf76e({'name':/^h[1-5]$/}),_0x1daddb=[];let _0x32e2db=!0x1;for(const _0x40f05a of _0x2f1197)_0x40f05a['is']('element')&&_0x1fefac['match'](_0x40f05a)&&(_0x1daddb['push'](_0x40f05a),'h1'==_0x40f05a['name']&&(_0x32e2db=!0x0));if(_0x32e2db){for(const _0x3d98b6 of _0x1daddb)_0x421837['rename']('h'+(parseInt(_0x3d98b6['name'][0x1])+0x1),_0x3d98b6);}}['_isH1TagSupportEnabled'](){const {data:_0x3146f8,editing:_0xbbdc11}=this['editor'],_0xcf5cc3=_0x3146f8['htmlProcessor']['toView']('<h1></h1>'),_0x4fe543=_0x3146f8['toView'](_0x3146f8['toModel'](_0xcf5cc3));return!!_0xbbdc11['view']['domConverter']['viewToDom'](_0x4fe543)['querySelector']('h1');}['_sanitizeHTML'](_0x5790ff){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x5790ff),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x592892){const _0xf9079b=_0x592892['trim']();return _0xf9079b['startsWith']('```html')?_0xf9079b['endsWith']('```')?_0xf9079b['substring'](0x7,_0xf9079b['length']-0x3):_0xf9079b['substring'](0x7):_0x592892;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x49fcad){super(_0x49fcad),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3062ae=>i(_0x49fcad,'AI_'+_0x3062ae['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x49fcad,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x49fcad,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x49fcad,'Stop'));const _0x384433=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x384433['if']('isVisible','ck-hidden',_0x3dcca3=>!_0x3dcca3)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x4e8f22,_0x410f06){const _0x3dc177=new _0x360d56(this['locale']);return _0x3dc177['set']({'label':_0x4e8f22,'class':_0x410f06||'','isVisible':!0x0,'withText':!0x0}),_0x3dc177;}}class ct extends _0x539d26{['contentFieldView'];['copyButtonView'];constructor(_0x150d15,_0x45ad9e=''){super(_0x150d15),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3f8543=this['bindTemplate'];this['contentFieldView']=new bt(_0x150d15,_0x45ad9e),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3f8543['if']('isVisible','ck-hidden',_0x37369a=>!_0x37369a)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3f8543['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 _0x42cdd1=!0x1;this['on']('change:value',(_0x51447a,_0x1d710e,_0x10c619)=>{const _0x158214=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x10c619),this['isProcessing']&&_0x158214&&!_0x42cdd1&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x5a8f96,_0x294ce4,_0x17171b)=>{_0x42cdd1=!0x1,_0x17171b?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x42cdd1=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x42cdd1=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0xe6bfe3=this['locale'],_0x25d04f=new _0x360d56(this['locale']),_0x4a9c76='ck-ai-form__copy-button';return _0x25d04f['set']({'label':i(_0xe6bfe3,'Copy'),'icon':_0x48c7c2,'class':_0x4a9c76,'tooltip':!0x0}),_0x25d04f['bind']('isVisible')['to'](this,'value',_0x130ed5=>!!_0x130ed5),_0x25d04f['bind']('isEnabled')['to'](this,'isProcessing',_0x5ca930=>!_0x5ca930),_0x25d04f['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x25d04f['icon']=_0x55ed85,_0x25d04f['class']=_0x4a9c76+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x25d04f['icon']=_0x48c7c2,_0x25d04f['class']=_0x4a9c76;},0x3e8);}),_0x25d04f;}['_copyHTMLToClipboard'](_0x380c79){const {window:_0x242d8f,document:_0x1048c3}=_0x21209c;if(_0x242d8f['ClipboardItem']){const {Blob:_0x1abece,ClipboardItem:_0xd398d2}=_0x242d8f,_0x4fa318=[new _0xd398d2({'text/html':new _0x1abece([_0x380c79['innerHTML']],{'type':'text/html'}),'text/plain':new _0x1abece([_0x380c79['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x4fa318);}else{const _0xe6b922=_0x1048c3['createElement']('div');_0xe6b922['style']['position']='absolute',_0xe6b922['style']['left']='-9999px',_0xe6b922['innerHTML']='<span>[</span>'+_0x380c79['innerHTML']+'<span>]</span>',_0x1048c3['body']['appendChild'](_0xe6b922);const _0x3196fc=_0x1048c3['createRange']();_0x3196fc['setStartAfter'](_0xe6b922['firstElementChild']),_0x3196fc['setEndBefore'](_0xe6b922['lastElementChild']);const _0x43250a=_0x242d8f['getSelection']();_0x43250a['removeAllRanges'](),_0x43250a['addRange'](_0x3196fc),_0x1048c3['execCommand']('copy'),_0xe6b922['remove']();}}}class bt extends _0x539d26{constructor(_0x3466a3,_0xd2be37=''){super(_0x3466a3),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0xd2be37,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1c1b63){this['element']['innerHTML']=_0x1c1b63;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4531bf=new _0x539d26(),_0x4e2883=this['locale'],_0x176573=new _0x4c268f();return _0x176573['isVisible']=!0x0,_0x4531bf['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x176573,{'text':i(_0x4e2883,'AI\x20is\x20writing...')}]}),_0x4531bf['render'](),_0x4531bf;}}class mt extends _0x539d26{constructor(_0x3848a5,_0x3d283e=''){super(_0x3848a5);const _0x4ea736=new _0x3b7b9e(),_0x558190=this['bindTemplate'];this['set']('text',_0x3d283e),_0x4ea736['content']=_0x179632,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4ea736,{'text':_0x558190['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x1f0384,_0x124cbd){super(_0x1f0384,_0x124cbd),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',(_0xfc85d9,_0xd3f356)=>{_0xfc85d9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xd3f356());});}['_createSubmitButton'](){const _0x343956=new _0x360d56(this['locale']),_0x1ac8d7=this['locale'];return _0x343956['set']({'icon':it,'label':i(_0x1ac8d7,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x343956['on']('execute',()=>{this['submit']();}),_0x343956['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x5eb961,_0x2e90e6)=>!_0x5eb961&&_0x2e90e6),_0x343956;}['_createShowHistoryButton'](){const _0x474375=new _0x360d56(this['locale']),_0x5ca09b=this['resultsView'],_0x4ff177=this['locale'];_0x474375['set']({'label':i(_0x4ff177,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x474375['bind']('isOn')['to'](_0x5ca09b,'isVisible'),_0x474375['bind']('isEnabled')['to'](this,'isEnabled'),_0x474375['on']('execute',()=>{_0x5ca09b['isVisible']=!_0x5ca09b['isVisible'],_0x5ca09b['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x34dcbd=()=>{_0x21209c['window']['requestAnimationFrame'](()=>{if(_0x3573da(this['element'])){const _0x1a7444=new _0x4adaae(this['queryView']['fieldView']['element']),_0x30fe0a=_0x1a7444['width'],_0x83a5de='rtl'===_0x4ff177['uiLanguageDirection']?'left':'right';_0x1a7444['excludeScrollbarsAndBorders'](),_0x474375['element']['style'][_0x83a5de]=_0x30fe0a-_0x1a7444['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x34dcbd),this['on']('render',_0x34dcbd),_0x474375;}['submit'](){const _0x3ceb4b=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x3ceb4b);}['focus'](_0x198389){-0x1===_0x198389?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x101ec6){super(_0x101ec6),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x101ec6,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x3547d3=0x0;for(const _0x4f0631 of this['items'])_0x3547d3+=_0x4f0631['items']['length'];return{'resultsCount':_0x3547d3,'totalItemsCount':_0x3547d3};}['_createClearHistoryButton'](){const _0x2001e6=this['locale'],_0x2912e6=new _0x360d56(this['locale']);return _0x2912e6['set']({'label':'('+i(_0x2001e6,'Clear')+')','withText':!0x0}),_0x2912e6['on']('execute',()=>this['fire']('clearHistory')),_0x2912e6;}}class ut extends xt{constructor(_0x43346){super();const _0x4d5770=new wt(),_0x7fba8f=new _0x360d56(this['locale'],_0x4d5770);this['children']['add'](_0x7fba8f),_0x7fba8f['set']({'label':_0x43346['prompt'],'withText':!0x0}),_0x7fba8f['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x43346['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x4b7e35{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x466cff,_0x2fd325)=>{const _0x354d79=os(_0x2fd325['prompt']);for(const _0x4f9d5c of this)if(_0x4f9d5c!=_0x2fd325&&os(_0x4f9d5c['prompt'])===_0x354d79){this['remove'](_0x4f9d5c);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x4d12df=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x4d12df));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x1bea07=>_0x1bea07)));}}function os(_0x2f006f){return _0x2f006f['toLowerCase']()['trim']();}class k extends _0x539d26{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1d661d,_0x2500a9,_0x33670c=''){super(_0x1d661d),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(_0x1d661d),this['contentArea']=new ct(_0x1d661d,_0x33670c),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 _0x36c881=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x2500a9],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x36c881['if']('isError','ck-hidden',_0x1ae0e4=>!_0x1ae0e4)]},'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'](_0x20beae=0x1){-0x1===_0x20beae?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 _0x46d070=this['locale'],_0x4592ae=new lt(_0x46d070,{'queryView':{'label':i(_0x46d070,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x46d070,'Empty\x20history'),'secondary':i(_0x46d070,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4592ae['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1cc8db,_0x14f2ec)=>_0x1cc8db&&!_0x14f2ec),this['listenTo'](_0x4592ae,'submit',(_0x41040b,_0x121395)=>{this['prompt']=_0x121395;const _0x1ed84b=ft(_0x121395);this['fire']('submitPrompt',_0x1ed84b),_0x121395['trim']()&&this['_promptHistory']['add']({'prompt':_0x1ed84b},0x0);},{'priority':'high'}),_0x4592ae;}['_createHistoryView'](){const _0x1a7a84=new pt(this['locale']);return _0x1a7a84['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x1a7a84['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x1a7a84;}['_createToolbar'](){const _0x21673a=new at(this['locale']);return _0x21673a['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x27c719,_0x373812,_0x287aca)=>_0x27c719&&!_0x373812&&!!_0x287aca),_0x21673a['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x21673a['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4e89c3,_0x1e8343,_0x3b685b)=>_0x4e89c3&&!_0x1e8343&&!!_0x3b685b),_0x21673a['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x21673a['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3957f6,_0x42aad6)=>_0x3957f6&&!_0x42aad6),_0x21673a['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x21673a['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x21673a['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x21673a;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0xd33a3=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0xd33a3,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3b815a){const _0x2a19bd=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3b815a||i(_0x2a19bd,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x203b64{['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[_0x8c64db,a,x,_0x4cb503];}constructor(_0x1074b0){super(_0x1074b0),_0x1074b0['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1074b0['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x1074b0['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1074b0['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x44738b}=this;this['_aiAdapter']=_0x44738b['plugins']['get'](x),this['_dialog']=_0x44738b['plugins']['get'](_0x4cb503),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x2f3703=new E(_0x44738b,Array['from'](this['_commandDefinitions']['values']()));_0x44738b['commands']['add']('showAIAssistant',_0x2f3703),_0x44738b['ui']['componentFactory']['add']('aiCommands',_0x1a5700=>{const _0x53d9f5=_0x4a0f33(_0x1a5700);return _0x53d9f5['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x53d9f5['buttonView']['set']({'label':i(_0x1a5700,'AI\x20Commands'),'icon':_0x2d7888,'tooltip':!0x0}),_0x53d9f5['on']('execute',_0x2af6c0=>this['_onExecute'](_0x2af6c0['source']['id'])),_0x26431b(_0x53d9f5,_0x44738b['ui']['view']['body'],function(_0x2f4fc2){const _0x21f493=o(_0x2f4fc2['config']['get']('ai.aiAssistant.commands'),_0x2f4fc2['locale']),_0x370960=U(_0x2f4fc2,_0x21f493)['filter'](_0x2605eb=>_0x2605eb['commands']['length']);if(0x1===_0x370960['length'])return U(_0x2f4fc2,_0x370960[0x0]['commands'])['map'](_0x1752c8=>({'id':_0x1752c8['id'],'label':_0x1752c8['label']}));return _0x370960['map'](_0x3968dc=>{const {groupId:_0x5824b3,groupLabel:_0x567b46,commands:_0x36e78f}=_0x3968dc,_0x3dbf67=U(_0x2f4fc2,_0x36e78f)['map'](_0xdd5564=>({'id':_0xdd5564['id'],'label':_0xdd5564['label']}));return{'id':_0x5824b3,'menu':_0x567b46||_0x5824b3,'children':_0x3dbf67};});}(_0x44738b),{'ariaLabel':i(_0x1a5700,'AI\x20Commands')}),_0x53d9f5['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x2f3703['on']('change:enabledCommandsIds',_0x111321),_0x53d9f5['menuView']['once']('render',_0x111321),_0x53d9f5;function _0x111321(){_0x53d9f5['isEnabled']=_0x2f3703['enabledCommandsIds']['length']>0x0;for(const _0x14a144 of _0x53d9f5['menuView']['buttons'])_0x14a144['isEnabled']=_0x2f3703['enabledCommandsIds']['includes'](_0x14a144['id']);}}),_0x44738b['ui']['componentFactory']['add']('menuBar:aiCommands',_0x2d4934=>{const _0x349b0a=new _0x142d14(_0x2d4934);_0x349b0a['buttonView']['set']({'label':i(_0x2d4934,'AI\x20Commands'),'icon':_0x2d7888}),_0x349b0a['bind']('isEnabled')['to'](_0x2f3703,'enabledCommandsIds',_0x53eb4=>_0x53eb4['length']>0x0);const _0x14365e=o(_0x44738b['config']['get']('ai.aiAssistant.commands'),_0x2d4934);return this['_populateMenuBarMenu'](_0x2f3703,_0x349b0a,_0x14365e,_0xeb6b0b=>this['_onExecute'](_0xeb6b0b)),_0x349b0a;}),_0x44738b['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x440e75=this['_createAIAssistantUIButton'](_0x360d56);return _0x440e75['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x440e75;}),_0x44738b['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0xb14e40=this['_createAIAssistantUIButton'](_0x41a769);return _0xb14e40['set']({'role':'menuitemcheckbox'}),_0xb14e40;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2cf0a8=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x54d033;for(const _0x563b30 in _0x2cf0a8){const _0x4927c5=_0x563b30,_0x503027=_0x2cf0a8[_0x4927c5];if('aiLicenseKeyValid'==_0x503027||'aiLicenseKeyInvalid'==_0x503027||'aiLicenseKeyExpired'==_0x503027||'aiLicenseKeyDomainLimit'==_0x503027||'aiLicenseKeyNotAllowed'==_0x503027||'aiLicenseKeyEvaluationLimit'==_0x503027||'aiLicenseKeyTrialLimit'==_0x503027||'aiLicenseKeyUsageLimit'==_0x503027){delete _0x2cf0a8[_0x4927c5],_0x54d033=_0x503027,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x54d033&&_0x2cf0a8['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x54d033&&_0x2cf0a8['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x54d033&&_0x2cf0a8['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x54d033&&_0x2cf0a8['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x54d033&&_0x2cf0a8['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x54d033&&_0x2cf0a8['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x54d033&&_0x2cf0a8['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5ab2b4='',_0x14fb59='',_0x2ff666='custom'){const _0x411917=this['editor'],_0x2a799b=_0x411917['editing']['view'],_0x4dce61=_0x411917['plugins']['get'](a),_0x14aae1=_0x411917['plugins']['get'](_0x8c64db);_0x4dce61['showFakeVisualSelection']();const _0x477859=new l(),_0x350754=new ClipboardEvent('copy',{'clipboardData':_0x477859}),_0x2533fc=new _0x5bb7c8(_0x477859),_0x16b102=new _0x3bcd25(_0x2a799b,_0x350754,{'dataTransfer':_0x2533fc});_0x14aae1['_forceMarkersCopy']('comment',()=>{_0x2a799b['document']['fire']('copy',_0x16b102);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x411917,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x576147=_0x2533fc['getData']('text/html');const _0x13e9e5=_0x411917['model']['document']['selection'],_0x48c564=Array['from'](_0x13e9e5['getRanges']());0x1===_0x48c564['length']&&_0x48c564[0x0]['isFlat']&&!_0x13e9e5['getSelectedElement']()&&''!==_0x576147['replace'](/&nbsp;/g,'')['trim']()&&(_0x576147='<p>'+_0x576147+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2ff666,'query':_0x5ab2b4,'htmlContent':_0x576147,'label':_0x14fb59,'mainActionLabel':_[_0x411917['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4d8ec6,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x1c3106['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4dce61['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x16f171=new Map(),_0x4795c1=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x38fba5 of _0x4795c1)for(const _0x566766 of _0x38fba5['commands'])_0x16f171['set'](_0x566766['id'],{..._0x566766,'groupId':_0x38fba5['groupId'],'groupLabel':_0x38fba5['groupLabel']||_0x38fba5['groupId']});return _0x16f171;}['_createAIAssistantUIButton'](_0x300fc5){const _0x2f781f=this['editor'],_0x533bd7=_0x2f781f['commands']['get']('showAIAssistant'),_0x245834=new _0x300fc5(_0x2f781f['locale']);return _0x245834['set']({'label':i(_0x2f781f['locale'],'AI\x20Assistant'),'icon':_0x4d8ec6,'isToggleable':!0x0}),_0x245834['bind']('isEnabled')['to'](_0x533bd7),_0x245834['bind']('isOn')['to'](this['_dialog'],'id',_0x29b74a=>'aiAssistant'===_0x29b74a),this['listenTo'](_0x245834,'execute',()=>{_0x245834['isOn']?this['hideUI']():_0x533bd7['execute']();}),_0x245834;}['_initView'](){const _0x1caf2f=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',()=>{_0x1caf2f['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1caf2f['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x260b26,ui:{ariaLiveAnnouncer:_0x146fe8}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x363704,_0x92a2f2,_0x49f0c3)=>{const _0x55adc0=this['_aiAssistantController']['currentContext'];_0x49f0c3?_0x146fe8['announce'](i(_0x260b26,'AI\x20is\x20writing')):_0x55adc0&&_0x146fe8['announce'](i(_0x260b26,'Generated\x20content:\x20%0',_0x55adc0),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x474ef5,_0x553625,_0x55fc7)=>{if(_0x55fc7){const _0x39eb06=this['_formView']['errorView']['text'];_0x146fe8['announce'](i(_0x260b26,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x39eb06));}});}['_onExecute'](_0x50147e){const _0x5a142c=this['_commandDefinitions']['get'](_0x50147e),_0x433f22=this['editor'],_0xea5876=_0x433f22['model']['document']['selection'],_0x11c880=_0x433f22['commands']['get']('showAIAssistant'),_0x2ad44b=_0x433f22['plugins']['get'](a),_0x72f70c=''+(_0x5a142c['groupId']!==K?_0x5a142c['groupLabel']+':\x20':'')+_0x5a142c['label'];if(!0x1!==_0x5a142c['requiresContent']&&_0xea5876['isCollapsed']){const _0x334d2a=_0x5c978f(_0xea5876['getSelectedBlocks']())||_0x433f22['model']['schema']['getLimitElement'](_0xea5876);_0x433f22['model']['change'](_0x195101=>{_0x195101['setSelection'](_0x334d2a,'in');});}_0x2ad44b['showFakeVisualSelection'](),_0x11c880['execute'](_0x5a142c['prompt'],_0x72f70c,'command:'+_0x50147e);}['_populateMenuBarMenu'](_0x361d93,_0x3b49d0,_0x319170,_0x4bf7ed){const _0x122bcc=this['editor'],_0xddfc15=_0x122bcc['locale'],_0x43815b=new _0x214386(_0xddfc15),_0x1d0367=U(_0x122bcc,_0x319170)['filter'](_0x20babc=>_0x20babc['commands']['length']);0x1===_0x1d0367['length']?this['_getMenuBarGroupButtons']({'command':_0x361d93,'commands':_0x1d0367[0x0]['commands'],'parentMenuView':_0x3b49d0,'onExecute':_0x4bf7ed})['forEach'](_0x3457cf=>_0x43815b['items']['add'](_0x3457cf)):_0x1d0367['forEach'](({groupId:_0x3b8d71,groupLabel:_0x548c0b,commands:_0x5dbe3a})=>{const _0x17630c=new _0x379cd5(_0xddfc15,_0x3b49d0),_0x4f2a6d=new _0x142d14(_0xddfc15),_0x2647d0=new _0x214386(_0xddfc15),_0x39e3ca=this['_getMenuBarGroupButtons']({'command':_0x361d93,'commands':_0x5dbe3a,'parentMenuView':_0x4f2a6d,'onExecute':_0x4bf7ed});_0x4f2a6d['buttonView']['set']({'label':_0x548c0b||_0x3b8d71}),_0x4f2a6d['delegate']('execute')['to'](_0x3b49d0),_0x2647d0['items']['addMany'](_0x39e3ca),_0x4f2a6d['panelView']['children']['add'](_0x2647d0),_0x17630c['children']['add'](_0x4f2a6d),_0x43815b['items']['add'](_0x17630c);}),_0x3b49d0['panelView']['children']['add'](_0x43815b);}['_getMenuBarGroupButtons']({command:_0x263f1c,commands:_0x3fcb8e,parentMenuView:_0x436077,onExecute:_0x374e03}){const _0x3f1fbf=this['editor'],_0x2a202e=_0x3f1fbf['locale'];return U(_0x3f1fbf,_0x3fcb8e)['map'](_0x18393a=>{const _0x438ee5=new _0x379cd5(_0x2a202e,_0x436077),_0x3e77c8=new _0x41a769(_0x2a202e);return _0x3e77c8['set']({'label':_0x18393a['label']}),_0x3e77c8['delegate']('execute')['to'](_0x436077),_0x3e77c8['on']('execute',()=>_0x374e03(_0x18393a['id'])),_0x3e77c8['bind']('isEnabled')['to'](_0x263f1c,'enabledCommandsIds',_0x1d8c73=>_0x1d8c73['includes'](_0x18393a['id'])),_0x438ee5['children']['add'](_0x3e77c8),_0x438ee5;});}}function T(_0x2ca80e,_0x211e25){return void 0x0!==_0x2ca80e['order']&&void 0x0===_0x211e25['order']?0x1:void 0x0===_0x2ca80e['order']&&void 0x0!==_0x211e25['order']?-0x1:void 0x0!==_0x2ca80e['order']&&void 0x0!==_0x211e25['order']?_0x2ca80e['order']-_0x211e25['order']:0x0;}function U(_0x484fa9,_0x3a24d7){_0x3a24d7['sort'](T);const _0x4a8c6b={},_0x54264c=[];for(const _0x488c25 of _0x3a24d7)if(void 0x0!==_0x488c25['order']){if(_0x488c25['order']in _0x4a8c6b)throw new _0x432637('ai-commands-config-order-collision',_0x484fa9,{'conflictingDefinitions':[_0x488c25,_0x4a8c6b[_0x488c25['order']]]});_0x4a8c6b[_0x488c25['order']]=_0x488c25,_0x54264c['splice'](_0x488c25['order'],0x0,_0x488c25);}else _0x54264c['push'](_0x488c25);return _0x54264c;}class At extends _0x203b64{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x15f0ed){super(_0x15f0ed);const _0x48fd49=_0x15f0ed['config'],_0x4c74ab=_0x15f0ed['locale'];_0x48fd49['define']('ai.aiAssistant.preserveComments',!0x0),_0x48fd49['define']('ai.aiAssistant.commands',_t(_0x4c74ab)),_0x48fd49['define']('ai.aiAssistant.extraCommandGroups',[]),_0x48fd49['define']('ai.aiAssistant.removeCommands',[]);let _0x30d83e=o(_0x48fd49['get']('ai.aiAssistant.commands'),_0x4c74ab);const _0x3204bd=_0x48fd49['get']('ai.aiAssistant.extraCommandGroups'),_0x519aad=_0x48fd49['get']('ai.aiAssistant.removeCommands');_0x3204bd['forEach'](_0x44d48c=>{const _0x4bc65f=_0x30d83e['find'](_0x4308dd=>_0x4308dd['groupId']===_0x44d48c['groupId']);_0x4bc65f?_0x4bc65f['commands']=_0x4bc65f['commands']['concat'](_0x44d48c['commands']):_0x30d83e['push'](_0x44d48c);}),_0x30d83e=_0x30d83e['filter'](_0x3327c2=>!_0x519aad['includes'](_0x3327c2['groupId'])),_0x30d83e['forEach'](_0x1f3627=>{_0x1f3627['commands']=_0x1f3627['commands']['filter'](_0x3625ed=>!_0x519aad['includes'](_0x3625ed['id']));}),_0x48fd49['set']('ai.aiAssistant.commands',_0x30d83e);}}function _t(_0x4507fd){return[{'groupId':'editOrReview','groupLabel':i(_0x4507fd,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x4507fd,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x4507fd,'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(_0x4507fd,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x4507fd,'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(_0x4507fd,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x4507fd,'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(_0x4507fd,'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(_0x4507fd,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x4507fd,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x4507fd,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x4507fd,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x4507fd,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x4507fd,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x4507fd,'Change\x20style'),'commands':[{'id':'business','label':i(_0x4507fd,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x4507fd,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x4507fd,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x4507fd,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x4507fd,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x4507fd,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x4507fd,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x4507fd,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x4507fd,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x4507fd,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x4507fd,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x4507fd,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x4507fd,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x203b64{['abortController'];static get['requires'](){return[x];}constructor(_0x54d6ce){super(_0x54d6ce),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'](_0x50bf41){return this['sendRequest'](_0x50bf41)['catch'](_0x416def=>{if(_0x416def instanceof R)return Promise['reject'](_0x416def);if('AbortError'==_0x416def['name'])return Promise['resolve']();throw console['error'](_0x416def),new _0x432637('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0xa550d5,_0x2448fd){const _0x4b8562=this['editor']['locale'],_0x46aad9={'Content-Type':'application/json'};if('object'==typeof _0xa550d5)Object['assign'](_0x46aad9,_0xa550d5);else{if(_0xa550d5)try{const _0x1568aa=await _0xa550d5(_0x2448fd);Object['assign'](_0x46aad9,_0x1568aa);}catch{return Promise['reject'](new R(i(_0x4b8562,'AI_ERROR_GET_HEADERS')));}}return _0x46aad9;}async['_prepareRequestParameters'](_0x368a15,_0x386917){const _0x18bca4=this['editor']['locale'];if('object'==typeof _0x368a15)return _0x368a15;try{return await _0x368a15(_0x386917);}catch{return Promise['reject'](new R(i(_0x18bca4,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0xa0d1f){super(_0xa0d1f),_0xa0d1f['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0xa0d1f['config']['get']('ai.openAI.requestParameters')||_0xa0d1f['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0xa0d1f['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0xa0d1f['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0xa0d1f['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x199483,context:_0x1efea4,onData:_0x410f95,actionId:_0x549219}){const _0x34ecce=this['editor']['locale'],_0x2cc4f1=await this['prepareMessages'](_0x199483,_0x1efea4,_0x549219),_0x412a93=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x549219),_0x85c327=await this['_prepareRequestParameters'](this['_requestParameters'],_0x549219),_0x1a67d1={'messages':_0x2cc4f1,..._0x85c327},_0x34c455={'method':'POST','headers':_0x412a93,'body':JSON['stringify'](_0x1a67d1),'signal':this['abortController']['signal']},_0x48efbe=await fetch(this['_apiUrl'],_0x34c455);if(_0x48efbe['ok'])return _0x85c327['stream']?await this['_readStreamableResponse'](_0x48efbe,_0x410f95):await this['_readStaticResponse'](_0x48efbe,_0x410f95),Promise['resolve']();{const _0x118b59=await _0x48efbe['text']();return _0x118b59['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x34ecce,'AI_ERROR_CONTEXT_LENGTH'))):_0x118b59['includes']('Moderation')?Promise['reject'](new R(i(_0x34ecce,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x118b59));}}async['prepareMessages'](_0x1090a9,_0x623ab0,_0x3afd98){let _0x6d000e,_0x215b7f;return _0x623ab0?(_0x6d000e='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.',_0x215b7f='Instruction:\x0a'+_0x1090a9+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x623ab0):(_0x6d000e='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.',_0x215b7f=_0x1090a9),[{'role':'system','content':_0x6d000e},{'role':'user','content':_0x215b7f}];}async['_readStreamableResponse'](_0x17f687,_0x2b4d21){const _0x5e36cf=_0x17f687['body']['getReader'](),_0x4a46d7=new TextDecoder();let _0x32931b='',_0x62fbce='',_0x45a606='',_0x45865c=!0x1;for(;!_0x45865c;){const {done:_0x602539,value:_0x1ca95c}=await _0x5e36cf['read'](),_0x4fffc1=_0x32931b+_0x4a46d7['decode'](_0x1ca95c);let _0x3baefc='';_0x45865c=_0x602539;try{_0x3baefc=this['_cleanUpData'](_0x4fffc1),_0x32931b='';}catch{_0x32931b=_0x4fffc1;continue;}_0x62fbce+=_0x3baefc,!_0x45865c&&this['_isBufferIncomplete'](_0x62fbce)||_0x62fbce&&(_0x45a606+=_0x62fbce,_0x62fbce='',_0x2b4d21(_0x45a606));}return Promise['resolve']();}async['_readStaticResponse'](_0x146adf,_0x163e6b){return _0x163e6b((await _0x146adf['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2b2625){const _0x5e450a=_0x2b2625['split']('<')['length']!==_0x2b2625['split']('>')['length'],_0x7c99fb=_0x2b2625['length']<0x1e;return _0x5e450a&&_0x7c99fb;}['_cleanUpData'](_0x2f7ece){return _0x2f7ece['split'](/\n(?![^{]*\})/g)['map'](_0x2a25c1=>_0x2a25c1['replace']('data:\x20',''))['filter'](_0x2119e5=>_0x2119e5&&_0x2119e5['length']>0x0&&'[DONE]'!==_0x2119e5)['map'](_0x7db53=>{const {choices:_0x36c04a}=JSON['parse'](_0x7db53);if(_0x36c04a[0x0]?.['delta']?.['content'])return _0x36c04a[0x0]['delta']['content'];})['filter'](_0x56ed80=>_0x56ed80)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0xf2c0e0){super(_0xf2c0e0),_0xf2c0e0['config']['get']('ai.aws.requestParameters')||_0xf2c0e0['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']=_0xf2c0e0['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0xf2c0e0['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0xf2c0e0['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0xf2c0e0['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x4598ea,context:_0x1330b0,onData:_0x36ae84,actionId:_0x299a4c}){const {model:_0x600760,stream:_0x413e46,..._0x506b25}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x299a4c),_0x45db30={'prompt':await this['preparePrompt'](_0x4598ea,_0x1330b0,_0x600760,_0x299a4c),..._0x506b25};this['_apiUrl']?await this['_processProxyRequest'](_0x45db30,_0x600760,_0x413e46,_0x36ae84,_0x299a4c):await this['_processAWSRequest'](_0x45db30,_0x600760,_0x413e46,_0x36ae84);}async['preparePrompt'](_0x5c5751,_0xd94c55,_0x515102,_0x5bd318){let _0x375ffb,_0x42ff7f;return _0xd94c55?(_0x375ffb='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.',_0x42ff7f='Instruction:\x0a'+_0x5c5751+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xd94c55):(_0x375ffb='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.',_0x42ff7f=_0x5c5751),'meta.llama'==this['getModelFamily'](_0x515102)?'<<SYS>>\x0a'+_0x375ffb+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x42ff7f+'\x0a[/INST]':'Human:\x0a'+_0x375ffb+'\x0a'+_0x42ff7f+'\x0a\x0aAssistant:';}['getModelFamily'](_0x998bc1){if(/^anthropic\.claude/['test'](_0x998bc1))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x998bc1))return'ai21.j2';if(/^cohere\.command/['test'](_0x998bc1))return'cohere.command';if(/^meta\.llama/['test'](_0x998bc1))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x998bc1));}async['_processProxyRequest'](_0x1e80ed,_0x2107bc,_0x36f706,_0x236d6a,_0x7e45eb){const _0x4b8808={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x7e45eb),'body':JSON['stringify']({..._0x1e80ed,'model':_0x2107bc,'stream':_0x36f706}),'signal':this['abortController']['signal']},_0x2fc303=await fetch(this['_apiUrl'],_0x4b8808);_0x36f706?await this['_readStreamableResponse'](_0x2fc303,_0x2107bc,_0x236d6a):await this['_readStaticResponse'](_0x2fc303,_0x2107bc,_0x236d6a);}async['_processAWSRequest'](_0x5b5945,_0xf13c47,_0x1baf52,_0x310448){const _0x14c38f=new _0x40efcc(this['_bedrockClientConfig']),_0x51157c={'body':JSON['stringify'](_0x5b5945),'contentType':'application/json','accept':'application/json','modelId':_0xf13c47};let _0x4b1ed4;if(_0x1baf52){const _0x3eda09=new _0x318244(_0x51157c);_0x4b1ed4=await _0x14c38f['send'](_0x3eda09,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x4b1ed4,_0xf13c47,_0x310448);}else{const _0x33a782=new _0x230025(_0x51157c);_0x4b1ed4=await _0x14c38f['send'](_0x33a782,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x4b1ed4,_0xf13c47,_0x310448);}}async['_readAsyncIterableResponse'](_0xeb6e72,_0xb9dbd,_0x536306){const _0x10607d=_0xeb6e72['body'],_0x51e135=new TextDecoder('utf-8');let _0x50b91d='';for await(const _0x260375 of _0x10607d)if(_0x260375['chunk']){const _0x213dfb=_0x51e135['decode'](_0x260375['chunk']['bytes']),_0x400d2a=JSON['parse'](_0x213dfb);_0x50b91d+=this['_getGeneratedText'](_0x400d2a,_0xb9dbd),_0x536306(_0x50b91d);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4c1747,_0x280706,_0x182962){const _0xba26ee=_0x4c1747['body'],_0x5e78c7=new TextDecoder('utf-8'),_0x1af2ef=_0xba26ee['getReader']();let _0x44a540='',_0x324985='',_0x459703=!0x1;for(;!_0x459703;){const {done:_0x4f8716,value:_0x26000e}=await _0x1af2ef['read']();if(_0x459703=_0x4f8716,_0x459703)break;const _0x499218=(_0x44a540+_0x5e78c7['decode'](_0x26000e))['split']('\x0a')['map'](_0x253ea0=>{try{return _0x44a540='',JSON['parse'](_0x253ea0);}catch{return _0x44a540=_0x253ea0,null;}})['filter'](_0x1245a0=>null!==_0x1245a0);_0x499218['length']&&(_0x324985+=_0x499218['map'](_0x52ce18=>this['_getGeneratedText'](_0x52ce18,_0x280706))['join'](''),_0x182962(_0x324985));}return Promise['resolve']();}async['_readStaticResponse'](_0x42ce1f,_0x43feb2,_0x396cc6){let _0x35bdf3;return _0x35bdf3=_0x42ce1f instanceof Response?await _0x42ce1f['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x42ce1f['body'])),(_0x396cc6(this['_getGeneratedText'](_0x35bdf3,_0x43feb2)),Promise['resolve']());}['_getGeneratedText'](_0x58a560,_0x55b750){switch(this['getModelFamily'](_0x55b750)){case'anthropic.claude':return _0x58a560['completion'];case'ai21.j2':return _0x58a560['completions'][0x0]['data']['text'];case'cohere.command':return _0x58a560['generations'][0x0]['text'];case'meta.llama':return _0x58a560['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 _0xa2aebb,Command as _0x11f10d}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x4229de,IconCheck as _0x37d51c,IconError as _0x93fbc8,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x4afa3b,IconRobotPencil as _0x49ac43}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x1eec10,CKEditorError as _0xa97696,ObservableMixin as _0x455c22,global as _0x466eb3,isVisible as _0x52e7a7,Rect as _0x456d6c,Collection as _0x5c19b8,FocusTracker as et,KeystrokeHandler as rt,first as _0x568f50}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x25b7ce,View as _0x33888c,SpinnerView as _0x267b2f,IconView as _0xef11c6,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x44d9b2,createDropdown as _0x1c43f9,addMenuToDropdown as _0x358282,MenuBarMenuView as _0xea1f72,MenuBarMenuListItemButtonView as _0x1bce39,DialogViewPosition as _0x46bd9d,MenuBarMenuListView as _0xaef931,MenuBarMenuListItemView as _0x9a245e}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x484822,ClipboardMarkersUtils as _0x1e3e11}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x5960d0,ViewDataTransfer as _0x53d16d,ViewUpcastWriter as _0x5e87c3,Matcher as _0xf46dd0}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x541bb0,InvokeModelWithResponseStreamCommand as _0xf413eb,InvokeModelCommand as _0x1f1126}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x1e8df0,_0x29ebc2){const _0x23ff48=(0x0,_0x29ebc2['t'])('Other');return _0x1e8df0['length']?'groupId'in _0x1e8df0[0x0]?_0x1e8df0:[{'groupId':K,'groupLabel':_0x23ff48,'order':0x1/0x0,'commands':_0x1e8df0}]:[{'groupId':K,'groupLabel':_0x23ff48,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0xa2aebb{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0xf1b71f}=this,_0x29aca4=['ck-fake-ai-selection'];_0xf1b71f['config']['get']('ai.useTheme')&&_0x29aca4['push']('ck-ai-assistant-ui_theme'),_0xf1b71f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x29aca4,'priority':0xc}}),_0xf1b71f['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x218887,{writer:_0x15a279})=>{if(!_0x218887['markerRange']['isCollapsed'])return null;const _0x3989c7=_0x15a279['createUIElement']('span');return _0x15a279['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3989c7),_0x3989c7;}});}['afterInit'](){!async function(_0x5e7120){const _0x52621e=_0x4f86e1([0x6e,0x41,0x37,0x79,0x75,0x72,0x67,0x4f,0x48,0x62,0x5a,0x76,0x44,0x70,0x6c,0x52,0x6b,0x4a,0x73,0x63,0x64,0x49,0x43,0x6d,0x38,0x36,0x6f,0x50,0x57,0x78,0x39,0x32,0x66,0x31,0x71,0x46,0x30,0x4c,0x61,0x53,0x58,0x33,0x4e,0x47,0x77,0x54,0x4d,0x4b,0x34,0x6a,0x56,0x74,0x59,0x55,0x42,0x51,0x69,0x35,0x7a,0x68,0x65,0x45]),_0x294bd0=0x3dffc4e1,_0x36eaa1=0x3df8b7b9^_0x294bd0,_0xcc604a=window[_0x4f86e1([0x44,0x61,0x74,0x65])][_0x4f86e1([0x6e,0x6f,0x77])](),_0x534023=_0x5e7120[_0x4f86e1([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4e5ad6=new window[(_0x4f86e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2f33b3=>{_0x534023[_0x4f86e1([0x6f,0x6e,0x63,0x65])](_0x4f86e1([0x72,0x65,0x61,0x64,0x79]),_0x2f33b3);}),_0x44719c={[_0x4f86e1([0x6b,0x74,0x79])]:_0x4f86e1([0x45,0x43]),[_0x4f86e1([0x75,0x73,0x65])]:_0x4f86e1([0x73,0x69,0x67]),[_0x4f86e1([0x63,0x72,0x76])]:_0x4f86e1([0x50,0x2d,0x32,0x35,0x36]),[_0x4f86e1([0x78])]:_0x4f86e1([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]),[_0x4f86e1([0x79])]:_0x4f86e1([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]),[_0x4f86e1([0x61,0x6c,0x67])]:_0x4f86e1([0x45,0x53,0x32,0x35,0x36])},_0x481226=_0x534023[_0x4f86e1([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4f86e1([0x67,0x65,0x74])](_0x4f86e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x547afb(){let _0x2cdaef,_0x2e36cf=null,_0x38a551=null;try{if(_0x481226==_0x4f86e1([0x47,0x50,0x4c]))return _0x4f86e1([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x2cdaef=_0xbb3ead(),!_0x2cdaef)return _0x4f86e1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x2cdaef[_0x4f86e1([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x38a551=_0x20df02(_0x2cdaef[_0x4f86e1([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x2cdaef[_0x4f86e1([0x6a,0x74,0x69])])),await _0x1fa4c0()?_0x5e8b1d()?_0x228dbe()?_0x4f86e1([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x59b38b()?(_0x2cdaef[_0x4f86e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4f86e1([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2e36cf=_0x334797(_0x4f86e1([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x2cdaef[_0x4f86e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4f86e1([0x74,0x72,0x69,0x61,0x6c])&&(_0x2e36cf=_0x334797(_0x4f86e1([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3808a4()):_0x4f86e1([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4f86e1([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4f86e1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x4f86e1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x228dbe(){const _0x417336=[_0x4f86e1([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4f86e1([0x74,0x72,0x69,0x61,0x6c])][_0x4f86e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2cdaef[_0x4f86e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0xcc604a/0x3e8:0xe10*_0x36eaa1;return _0x2cdaef[_0x4f86e1([0x65,0x78,0x70])]<_0x417336;}function _0x5e8b1d(){const _0x3ba631=_0x2cdaef[_0x4f86e1([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3ba631&&(!!_0x3ba631[_0x4f86e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4f86e1([0x2a]))||!!_0x3ba631[_0x4f86e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4f86e1([0x41,0x49])));}function _0x59b38b(){const _0x24ddad=_0x2cdaef[_0x4f86e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x24ddad||0x0==_0x24ddad[_0x4f86e1([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x11dc40}=new URL(window[_0x4f86e1([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x24ddad[_0x4f86e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x11dc40))return!0x0;const _0x5664f3=_0x11dc40[_0x4f86e1([0x73,0x70,0x6c,0x69,0x74])](_0x4f86e1([0x2e]));return _0x24ddad[_0x4f86e1([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2141e1=>_0x2141e1[_0x4f86e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4f86e1([0x2a])))[_0x4f86e1([0x6d,0x61,0x70])](_0x2d9a34=>_0x2d9a34[_0x4f86e1([0x73,0x70,0x6c,0x69,0x74])](_0x4f86e1([0x2e])))[_0x4f86e1([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2d8a4f=>_0x2d8a4f[_0x4f86e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5664f3[_0x4f86e1([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4f86e1([0x6d,0x61,0x70])](_0x53c2bb=>Array(_0x5664f3[_0x4f86e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x53c2bb[_0x4f86e1([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4f86e1([0x66,0x69,0x6c,0x6c])](_0x53c2bb[0x0]===_0x4f86e1([0x2a])?_0x4f86e1([0x2a]):'')[_0x4f86e1([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x53c2bb))[_0x4f86e1([0x73,0x6f,0x6d,0x65])](_0x296b38=>_0x5664f3[_0x4f86e1([0x65,0x76,0x65,0x72,0x79])]((_0x4fe26c,_0x5f3184)=>_0x296b38[_0x5f3184]===_0x4fe26c||_0x296b38[_0x5f3184]===_0x4f86e1([0x2a])));}function _0x3808a4(){return _0x2e36cf&&_0x38a551?new window[(_0x4f86e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x11ace8,_0x59aa28)=>{_0x2e36cf[_0x4f86e1([0x74,0x68,0x65,0x6e])](_0x11ace8,_0x59aa28),_0x38a551[_0x4f86e1([0x74,0x68,0x65,0x6e])](_0x3339a9=>{_0x3339a9!=_0x4f86e1([0x56,0x61,0x6c,0x69,0x64])&&_0x11ace8(_0x3339a9);},_0x59aa28);}):_0x2e36cf||_0x38a551||_0x4f86e1([0x56,0x61,0x6c,0x69,0x64]);}}function _0x20df02(_0x2c63a1,_0x8f4937){return new window[(_0x4f86e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5260f2=>{if(_0x2e2469())return _0x5260f2(_0x4f86e1([0x56,0x61,0x6c,0x69,0x64]));_0x411119(),_0x534023[_0x4f86e1([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4f86e1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xb83eca=!0x1;const _0x26cf1b=_0x1eec10();function _0x37c392(_0x402671){return!!_0x402671&&(typeof _0x402671===_0x4f86e1([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x402671===_0x4f86e1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x402671[_0x4f86e1([0x74,0x68,0x65,0x6e])]===_0x4f86e1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x402671[_0x4f86e1([0x63,0x61,0x74,0x63,0x68])]===_0x4f86e1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x4defe5(_0x3789a1){_0x48f430(_0x3789a1)[_0x4f86e1([0x74,0x68,0x65,0x6e])](_0xc382a3=>{if(!_0xc382a3||_0xc382a3[_0x4f86e1([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4f86e1([0x6f,0x6b]))return _0x4f86e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1b1b3a(_0x15ab9c(_0x26cf1b+_0x8f4937))!=_0xc382a3[_0x4f86e1([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4f86e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4f86e1([0x56,0x61,0x6c,0x69,0x64]);})[_0x4f86e1([0x74,0x68,0x65,0x6e])](_0x329111=>(_0x4ef3b2(),_0x329111),()=>{const _0x1997a1=_0xa7fb5b();return null==_0x1997a1?(_0x4ef3b2(),_0x4f86e1([0x56,0x61,0x6c,0x69,0x64])):_0x4f86e1(_0xcc604a-_0x1997a1>(0x19f340e1^_0x294bd0)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4f86e1([0x74,0x68,0x65,0x6e])](_0x5260f2)[_0x4f86e1([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5260f2(_0x4f86e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2e368c=0x3dc92a61^_0x294bd0;function _0x4ef3b2(){const _0x4a5e61=_0x4f86e1([0x6c,0x6c,0x63,0x74,0x2d])+_0x1b1b3a(_0x15ab9c(_0x2c63a1)),_0x5e1d3c=_0xdacf1(_0x1b1b3a(window[_0x4f86e1([0x4d,0x61,0x74,0x68])][_0x4f86e1([0x63,0x65,0x69,0x6c])](_0xcc604a/_0x2e368c)));window[_0x4f86e1([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4f86e1([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4a5e61,_0x5e1d3c);}function _0xa7fb5b(){const _0x3d488d=_0x4f86e1([0x6c,0x6c,0x63,0x74,0x2d])+_0x1b1b3a(_0x15ab9c(_0x2c63a1)),_0x74ada5=window[_0x4f86e1([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4f86e1([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3d488d);return _0x74ada5?window[_0x4f86e1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xdacf1(_0x74ada5),0x10)*_0x2e368c:null;}function _0x48f430(_0x45843a){return new window[(_0x4f86e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x20208a,_0x3766fa)=>{_0x45843a[_0x4f86e1([0x74,0x68,0x65,0x6e])](_0x20208a,_0x3766fa),window[_0x4f86e1([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3766fa,0x3dfe1021^_0x294bd0);});}}_0x534023[_0x4f86e1([0x6f,0x6e])](_0x4f86e1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x587f8d,_0x5ea479)=>{if(_0x5ea479[0x0]!=_0x2c63a1)return _0x5260f2(_0x4f86e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x5ea479[0x1]={..._0x5ea479[0x1],[_0x4f86e1([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x26cf1b};},{[_0x4f86e1([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4f86e1([0x68,0x69,0x67,0x68])}),_0x534023[_0x4f86e1([0x6f,0x6e])](_0x4f86e1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x110399=>{_0x37c392(_0x110399[_0x4f86e1([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xb83eca=!0x0,_0x4defe5(_0x110399[_0x4f86e1([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4f86e1([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4f86e1([0x6c,0x6f,0x77])}),_0x4e5ad6[_0x4f86e1([0x74,0x68,0x65,0x6e])](()=>{_0xb83eca||_0x5260f2(_0x4f86e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x2e2469(){return _0x534023[_0x4f86e1([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4f86e1([0x76,0x69,0x65,0x77])][_0x4f86e1([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4f86e1([0x61,0x75,0x74,0x6f]);}function _0x411119(){_0x534023[_0x4f86e1([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4f86e1([0x76,0x69,0x65,0x77])][_0x4f86e1([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4f86e1([0x61,0x75,0x74,0x6f]);}}function _0x334797(_0x197f4b){const _0x13d3d8=[new window[(_0x4f86e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4d7a3c=>setTimeout(_0x4d7a3c,0x3df6fa2d^_0x294bd0)),_0x4e5ad6[_0x4f86e1([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4f86e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x534967=>{let _0x4e6429=0x0;_0x534023[_0x4f86e1([0x6d,0x6f,0x64,0x65,0x6c])][_0x4f86e1([0x6f,0x6e])](_0x4f86e1([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x431dd7,_0xe6aa69)=>{_0xe6aa69[0x0][_0x4f86e1([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4e6429++,_0x4e6429==(0x3dffc519^_0x294bd0)&&(_0x534967(),_0x431dd7[_0x4f86e1([0x6f,0x66,0x66])]());});}))];return window[_0x4f86e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4f86e1([0x72,0x61,0x63,0x65])](_0x13d3d8)[_0x4f86e1([0x74,0x68,0x65,0x6e])](()=>_0x197f4b);}async function _0x262362(){await _0x4e5ad6,_0x534023[_0x4f86e1([0x6d,0x6f,0x64,0x65,0x6c])][_0x4f86e1([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x266447,_0x534023[_0x4f86e1([0x6d,0x6f,0x64,0x65,0x6c])][_0x4f86e1([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x266447,_0x534023[_0x4f86e1([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4f86e1([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4691fa(_0x111c8c){const _0x269c1e=_0x4a7801();_0x534023[_0x269c1e]=_0x4f86e1([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x111c8c,_0x111c8c!=_0x4f86e1([0x56,0x61,0x6c,0x69,0x64])&&_0x262362();}function _0x4a7801(){const _0x4d3690=window[_0x4f86e1([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4f86e1([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4f86e1([0x6e,0x6f,0x77])]())[_0x4f86e1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4f86e1([0x2e]),'');let _0x5611ad=_0x4f86e1([0x6e]);for(let _0x399855=0x0;_0x399855<_0x4d3690[_0x4f86e1([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x399855+=0x2){let _0xddf789=window[_0x4f86e1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4d3690[_0x4f86e1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x399855,_0x399855+0x2));_0xddf789>=_0x52621e[_0x4f86e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0xddf789-=_0x52621e[_0x4f86e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x5611ad+=_0x52621e[_0xddf789];}return _0x5611ad;}function _0xbb3ead(){const _0x51cb54=_0x481226[_0x4f86e1([0x73,0x70,0x6c,0x69,0x74])](_0x4f86e1([0x2e]));if(0x3!=_0x51cb54[_0x4f86e1([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xd6a549(_0x51cb54[0x1]);function _0xd6a549(_0x4c687a){const _0x6bf05e=_0x4616bf(_0x4c687a);return _0x6bf05e&&_0x5122c5()?_0x6bf05e:null;function _0x5122c5(){const _0x471469=_0x6bf05e[_0x4f86e1([0x6a,0x74,0x69])],_0x1a2c1c=window[_0x4f86e1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x471469[_0x4f86e1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x471469[_0x4f86e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x1a0cc4={..._0x6bf05e,[_0x4f86e1([0x6a,0x74,0x69])]:_0x471469[_0x4f86e1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x471469[_0x4f86e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x1a0cc4[_0x4f86e1([0x76,0x63])],_0x15ab9c(_0x1a0cc4)==_0x1a2c1c;}}}async function _0x1fa4c0(){let _0x35dce5=!0x0;try{const _0x2329ea=_0x481226[_0x4f86e1([0x73,0x70,0x6c,0x69,0x74])](_0x4f86e1([0x2e])),[_0x5e2142,_0x34e2d0,_0x46bfc7]=_0x2329ea;return _0x1691c4(_0x5e2142),await _0x2fa68a(_0x5e2142,_0x34e2d0,_0x46bfc7),_0x35dce5;}catch{return!0x1;}function _0x1691c4(_0x587317){const _0x168f76=_0x4616bf(_0x587317);_0x168f76&&_0x168f76[_0x4f86e1([0x61,0x6c,0x67])]==_0x4f86e1([0x45,0x53,0x32,0x35,0x36])||(_0x35dce5=!0x1);}async function _0x2fa68a(_0xae329b,_0x435252,_0x5c8647){const _0x39cdba=window[_0x4f86e1([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4f86e1([0x66,0x72,0x6f,0x6d])](_0x30c4e8(_0x5c8647),_0x4d56e3=>_0x4d56e3[_0x4f86e1([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x37bcc4=new window[(_0x4f86e1([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4f86e1([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0xae329b+_0x4f86e1([0x2e])+_0x435252),_0x4f796e=window[_0x4f86e1([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4f86e1([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x4f796e)return;const _0x25f2db=await _0x4f796e[_0x4f86e1([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4f86e1([0x6a,0x77,0x6b]),_0x44719c,{[_0x4f86e1([0x6e,0x61,0x6d,0x65])]:_0x4f86e1([0x45,0x43,0x44,0x53,0x41]),[_0x4f86e1([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4f86e1([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4f86e1([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x4f796e[_0x4f86e1([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4f86e1([0x6e,0x61,0x6d,0x65])]:_0x4f86e1([0x45,0x43,0x44,0x53,0x41]),[_0x4f86e1([0x68,0x61,0x73,0x68])]:{[_0x4f86e1([0x6e,0x61,0x6d,0x65])]:_0x4f86e1([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x25f2db,_0x39cdba,_0x37bcc4)||(_0x35dce5=!0x1);}}function _0x4616bf(_0x288b10){return _0x288b10[_0x4f86e1([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4f86e1([0x65,0x79]))?JSON[_0x4f86e1([0x70,0x61,0x72,0x73,0x65])](_0x30c4e8(_0x288b10)):null;}function _0x30c4e8(_0x3752f5){return window[_0x4f86e1([0x61,0x74,0x6f,0x62])](_0x3752f5[_0x4f86e1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4f86e1([0x2b]))[_0x4f86e1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4f86e1([0x2f])));}function _0x15ab9c(_0x3bd759){let _0x43fb4c=0x1505;function _0x528a15(_0x5b1d70){for(let _0x58ac1c=0x0;_0x58ac1c<_0x5b1d70[_0x4f86e1([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x58ac1c++){const _0x344bc0=_0x5b1d70[_0x4f86e1([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x58ac1c);_0x43fb4c=(_0x43fb4c<<0x5)+_0x43fb4c+_0x344bc0,_0x43fb4c&=_0x43fb4c;}}function _0x3217ec(_0x53deb3){Array[_0x4f86e1([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x53deb3)?_0x53deb3[_0x4f86e1([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x3217ec):_0x53deb3&&typeof _0x53deb3==_0x4f86e1([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4f86e1([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x53deb3)[_0x4f86e1([0x73,0x6f,0x72,0x74])]()[_0x4f86e1([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x30eea8,_0x330ea0])=>{_0x528a15(_0x30eea8),_0x3217ec(_0x330ea0);}):_0x528a15(window[_0x4f86e1([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x53deb3));}return _0x3217ec(_0x3bd759),_0x43fb4c>>>0x0;}function _0x1b1b3a(_0x45a61b){return _0x45a61b[_0x4f86e1([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4f86e1([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4f86e1([0x30]));}function _0xdacf1(_0x149783){return _0x149783[_0x4f86e1([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4f86e1([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4f86e1([0x6a,0x6f,0x69,0x6e])]('');}function _0x266447(){}function _0x4f86e1(_0x247528){return _0x247528['map'](_0x5a87bc=>String['fromCharCode'](_0x5a87bc))['join']('');}_0x4691fa(await _0x547afb());}(this);}['showFakeVisualSelection'](){const _0x7cd694=this['editor']['model'];_0x7cd694['change'](_0x43457c=>{const _0x3ddc91=_0x7cd694['document']['selection']['getRanges']();let _0x53758e=0x0;for(const _0x342795 of _0x3ddc91){const _0x517f20=w+':'+_0x53758e;if(_0x7cd694['markers']['has'](_0x517f20))_0x43457c['updateMarker'](_0x517f20,{'range':_0x342795});else{if(_0x342795['start']['isAtEnd']){const _0x42158c=_0x342795['start']['getLastMatchingPosition'](({item:_0x1dd347})=>!_0x7cd694['schema']['isContent'](_0x1dd347),{'boundaries':_0x342795});_0x43457c['addMarker'](_0x517f20,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x43457c['createRange'](_0x42158c,_0x342795['end'])});}else _0x43457c['addMarker'](_0x517f20,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x342795});}_0x53758e++;}});}['hideFakeVisualSelection'](){const _0x5d241a=this['editor']['model'],_0x265f59=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x265f59['length']&&_0x5d241a['change'](_0x38612c=>{_0x265f59['forEach'](_0x280f7a=>{_0x38612c['removeMarker'](_0x280f7a);});});}['insertContent'](_0x3be42f,_0xb41077){const _0x440835=this['_getAISelection'](),_0x48af6d=_0xb41077||_0x440835['getFirstRange']();this['editor']['model']['canEditAt'](_0x48af6d)&&this['editor']['model']['change'](_0x5147dd=>{this['hideFakeVisualSelection'](),_0xb41077||this['_resetContentOfSelectedTableCells'](_0x5147dd,_0x440835),this['_pasteHTMLUsingClipboard']({'insertAt':_0x48af6d,'writer':_0x5147dd,'html':_0x3be42f});});}['insertContentBelow'](_0x4d1bbe){const {model:_0x58d1e4}=this['editor'],_0x284624=this['_getAISelection']();_0x58d1e4['change'](()=>{const _0x301b1f=this['_prepareTableInsertBelowPosition'](_0x4d1bbe,_0x284624)||this['_getDefaultInsertBelowPosition'](_0x284624);this['insertContent'](_0x4d1bbe,_0x301b1f);});}['_getAISelection'](){const _0x513845=this['editor']['model'],_0x120dce=Array['from'](_0x513845['markers']['getMarkersGroup'](w))['map'](_0x4be0ee=>_0x4be0ee['getRange']());return _0x513845['createSelection'](_0x120dce);}['_pasteHTMLUsingClipboard']({writer:_0x5bca07,html:_0x2f6fed,insertAt:_0x5c8112}){const {view:_0x238b72}=this['editor']['editing'],_0x51a5f9=this['editor']['plugins']['get'](_0x484822),_0x34a211=new gt();_0x34a211['setData']('text/html',_0x2f6fed);const _0x52a090=new ClipboardEvent('paste',{'clipboardData':_0x34a211}),_0x2a5896=new _0x5960d0(_0x238b72,_0x52a090,{'dataTransfer':new _0x53d16d(_0x34a211)});_0x5bca07['setSelection'](_0x5c8112);const _0x3a9f37=(_0x25efba,_0x26fb24)=>{_0x26fb24['resultRange']&&_0x5bca07['setSelection'](_0x26fb24['resultRange']);};_0x51a5f9['once']('contentInsertion',_0x3a9f37,{'priority':'lowest'}),_0x238b72['document']['fire']('paste',_0x2a5896),_0x51a5f9['off']('contentInsertion',_0x3a9f37);}['_getDefaultInsertBelowPosition'](_0x39f6bf){const {model:_0x22ac37}=this['editor'],_0x33bafa=Array['from'](_0x39f6bf['getSelectedBlocks']());return _0x33bafa['length']?_0x22ac37['createPositionAfter'](_0x33bafa['pop']()):_0x39f6bf['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0xafbe32,_0x37d1b6){const {model:_0x4354de,plugins:_0x27d815}=this['editor'];if(_0x27d815['has']('TableUtils')){const _0x526e1a=_0x27d815['get']('TableUtils')['getSelectedTableCells'](_0x37d1b6);if(_0x526e1a['length']){const _0x32f783=this['_getTableRowCountFromContent'](_0xafbe32),_0x2e2060=this['_createEmptyTableRows'](_0x526e1a,_0x32f783);return _0x4354de['createPositionAt'](_0x2e2060,0x0);}}return null;}['_getTableRowCountFromContent'](_0x591d23){const _0x206352=this['editor']['plugins']['get']('TableUtils'),_0x1ae185=this['editor']['data']['parse'](_0x591d23),_0x5f07f6=Array['from'](_0x1ae185['getChildren']())['filter'](_0x3f8488=>_0x3f8488['is']('element','table'));let _0x332446=0x0;return _0x5f07f6['forEach'](_0x350d66=>{_0x332446+=_0x206352['getRows'](_0x350d66);}),_0x332446;}['_createEmptyTableRows'](_0x2ed595,_0x4555ab){const _0x39083c=this['editor']['plugins']['get']('TableUtils'),_0xa63e3e=_0x39083c['getRowIndexes'](_0x2ed595),_0x18cfc1=_0x39083c['getColumnIndexes'](_0x2ed595),_0x58f553=_0xa63e3e['last']+0x1,_0x54424a=_0x18cfc1['first'],_0x5c0197=_0x2ed595[0x0]['findAncestor']('table');for(let _0x1ff6ac=0x0;_0x1ff6ac<_0x4555ab;_0x1ff6ac++)_0x39083c['insertRows'](_0x5c0197,{'at':_0x58f553});return _0x5c0197['getChild'](_0x58f553)['getChild'](_0x54424a);}['_resetContentOfSelectedTableCells'](_0xeae060,_0x2222a8){const {plugins:_0x2d21e1}=this['editor'],{model:_0x291eb7}=_0xeae060;if(!_0x2d21e1['has']('TableUtils'))return;_0x2d21e1['get']('TableUtils')['getSelectedTableCells'](_0x2222a8)['length']&&_0x291eb7['deleteContent'](_0x2222a8);}}class x extends _0xa2aebb{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0xa97696('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x1e8b5a){super(_0x1e8b5a),this['name']='AIRequestError';}}function i(_0x35e704,_0x36c74e,_0x110de0){const t=_0x35e704['t'];switch(_0x36c74e){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',_0x110de0);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x110de0);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'},_0x110de0);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 _0x36c74e;}}class E extends _0x11f10d{['_commandDefinitions'];constructor(_0x2280f9,_0x3a813c){super(_0x2280f9),this['_commandDefinitions']=_0x3a813c,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x2d3830,_0x448d99,_0x521276)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x521276));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x529d76,_0x589a15,_0x4b7939)=>{this['enabledCommandsIds']=_0x4b7939?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x46e9ce=this['editor']['model'];this['_hasContext']=function(_0x33b5bb){const _0x213f43=_0x33b5bb['document']['selection'];return _0x213f43['isCollapsed']?0x0!==[..._0x213f43['getSelectedBlocks']()]['length']&&![..._0x213f43['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x33b5bb['hasContent'](_0x213f43['getFirstRange']());}(_0x46e9ce);const _0x44d906=_0x46e9ce['document']['selection'],_0x3ea192=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x489f5b of _0x44d906['getRanges']())for(const _0x238b00 of _0x489f5b['getItems']())if(_0x238b00['is']('element')&&_0x3ea192['includes'](_0x238b00['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x5dc510='',_0x10ef37='',_0x56bc7c='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x5dc510,_0x10ef37,_0x56bc7c);}}function F(_0x6b46c0,_0x1b0793){const _0x3ec791=new Set();for(const _0x2fbf1c of _0x6b46c0['values']())(_0x1b0793||!0x1===_0x2fbf1c['requiresContent'])&&_0x3ec791['add'](_0x2fbf1c['id']);return Array['from'](_0x3ec791);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ _0x455c22(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x5d2865,_0x2e138f,_0x308b8f){super(),this['editor']=_0x5d2865,this['textAdapter']=_0x2e138f,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x308b8f,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x5687e8,_0xa5ff2d,_0x1ba822)=>{this['view']['value']=this['_sanitizeHTML'](_0x1ba822);}),this['listenTo'](this['view'],'submitPrompt',(_0x560c2d,_0x3ffd1f)=>{const _0x4bbb4c=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x3ffd1f,_0x4bbb4c,'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:_0x5509c5,query:_0xfe78fc,htmlContent:_0x387eda,label:_0x3a69b2,mainActionLabel:_0x23bb0e}){this['view']['prompt']=_0x3a69b2,this['view']['mainAction']=_0x23bb0e,this['initialContext']=_0x387eda,_0xfe78fc&&(this['view']['isRendered']?this['_handleQuery'](_0xfe78fc,_0x387eda,_0x5509c5,_0x3a69b2):this['view']['once']('render',()=>{this['_handleQuery'](_0xfe78fc,_0x387eda,_0x5509c5,_0x3a69b2);}));}['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'](_0x516bbf,_0x170ce7,_0x1b2cf2,_0x1e5303){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x170ce7,this['previousQuery']=_0x516bbf,this['previousLabel']=_0x1e5303||_0x516bbf,this['previousActionId']=_0x1b2cf2,new Promise(_0x196a25=>{this['textAdapter']['makeRequest']({'query':_0x516bbf,'context':_0x170ce7,'onData':_0x5de71c=>{this['currentResponse']=_0x5de71c,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1b2cf2})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x51b9f1=>{_0x51b9f1 instanceof R?this['view']['handleError'](_0x51b9f1['message']):this['view']['handleError'](),_0x196a25();})['finally'](()=>{this['stopProcessing'](),_0x196a25();});});}['_parseAndNormalizeContent'](_0x4208a9,_0x1e99d2=!0x1){const _0x2cb0e9=Q['exec'](_0x4208a9);_0x4208a9=_0x2cb0e9?_0x4208a9['substring'](_0x2cb0e9[0x1]['length']):_0x4208a9['length']<0x64&&!_0x1e99d2?'':this['_stripMarkdownSyntax'](_0x4208a9);const _0x361282=this['_domParser']['parseFromString'](_0x4208a9,'text/html');if(_0x2cb0e9){const _0xe10b50=Array['from'](_0x361282['body']['childNodes']);_0xe10b50['reverse']();for(const _0x563627 of _0xe10b50){if(_0x563627['nodeType']==Node['ELEMENT_NODE'])break;_0x563627['remove']();}}const _0x4f0501=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x361282['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4f0501);const _0x381ca7=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x301f4b=this['editor']['data']['toModel'](_0x4f0501);return _0x381ca7||_0x301f4b['markers']['clear'](),this['editor']['data']['stringify'](_0x301f4b);}['_normalizeResponseHeadings'](_0xb689e1){const _0xc860d0=new _0x5e87c3(this['editor']['editing']['view']['document']),_0x652869=new _0xf46dd0({'name':/^h[1-5]$/}),_0x3078ad=[];let _0x153ad6=!0x1;for(const _0x1ddb2f of _0xb689e1)_0x1ddb2f['is']('element')&&_0x652869['match'](_0x1ddb2f)&&(_0x3078ad['push'](_0x1ddb2f),'h1'==_0x1ddb2f['name']&&(_0x153ad6=!0x0));if(_0x153ad6){for(const _0x249b2e of _0x3078ad)_0xc860d0['rename']('h'+(parseInt(_0x249b2e['name'][0x1])+0x1),_0x249b2e);}}['_isH1TagSupportEnabled'](){const {data:_0x289526,editing:_0x5b0e4a}=this['editor'],_0x2ff90c=_0x289526['htmlProcessor']['toView']('<h1></h1>'),_0x37bad8=_0x289526['toView'](_0x289526['toModel'](_0x2ff90c));return!!_0x5b0e4a['view']['domConverter']['viewToDom'](_0x37bad8)['querySelector']('h1');}['_sanitizeHTML'](_0x1661c5){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x1661c5),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0xb3d723){const _0x374b39=_0xb3d723['trim']();return _0x374b39['startsWith']('```html')?_0x374b39['endsWith']('```')?_0x374b39['substring'](0x7,_0x374b39['length']-0x3):_0x374b39['substring'](0x7):_0xb3d723;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x1f3d8e){super(_0x1f3d8e),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x26bcfa=>i(_0x1f3d8e,'AI_'+_0x26bcfa['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x1f3d8e,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x1f3d8e,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x1f3d8e,'Stop'));const _0x35f180=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x35f180['if']('isVisible','ck-hidden',_0x503d64=>!_0x503d64)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x5f49ed,_0x1baef2){const _0x244f63=new _0x25b7ce(this['locale']);return _0x244f63['set']({'label':_0x5f49ed,'class':_0x1baef2||'','isVisible':!0x0,'withText':!0x0}),_0x244f63;}}class ct extends _0x33888c{['contentFieldView'];['copyButtonView'];constructor(_0x1b7324,_0x546e77=''){super(_0x1b7324),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0xbf9071=this['bindTemplate'];this['contentFieldView']=new bt(_0x1b7324,_0x546e77),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0xbf9071['if']('isVisible','ck-hidden',_0x74ad3=>!_0x74ad3)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0xbf9071['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 _0x4f4530=!0x1;this['on']('change:value',(_0x13ab2d,_0x5f5d55,_0x2269e4)=>{const _0x31808f=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2269e4),this['isProcessing']&&_0x31808f&&!_0x4f4530&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0xc5c064,_0x265e59,_0x7e6af6)=>{_0x4f4530=!0x1,_0x7e6af6?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4f4530=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4f4530=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x492255=this['locale'],_0x59cc3d=new _0x25b7ce(this['locale']),_0x45d30a='ck-ai-form__copy-button';return _0x59cc3d['set']({'label':i(_0x492255,'Copy'),'icon':_0x4229de,'class':_0x45d30a,'tooltip':!0x0}),_0x59cc3d['bind']('isVisible')['to'](this,'value',_0x20da41=>!!_0x20da41),_0x59cc3d['bind']('isEnabled')['to'](this,'isProcessing',_0x2e3f86=>!_0x2e3f86),_0x59cc3d['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x59cc3d['icon']=_0x37d51c,_0x59cc3d['class']=_0x45d30a+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x59cc3d['icon']=_0x4229de,_0x59cc3d['class']=_0x45d30a;},0x3e8);}),_0x59cc3d;}['_copyHTMLToClipboard'](_0x2d43ab){const {window:_0x5c5cf5,document:_0x27f46e}=_0x466eb3;if(_0x5c5cf5['ClipboardItem']){const {Blob:_0x28b621,ClipboardItem:_0x208dbb}=_0x5c5cf5,_0x2adba0=[new _0x208dbb({'text/html':new _0x28b621([_0x2d43ab['innerHTML']],{'type':'text/html'}),'text/plain':new _0x28b621([_0x2d43ab['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2adba0);}else{const _0x403ee1=_0x27f46e['createElement']('div');_0x403ee1['style']['position']='absolute',_0x403ee1['style']['left']='-9999px',_0x403ee1['innerHTML']='<span>[</span>'+_0x2d43ab['innerHTML']+'<span>]</span>',_0x27f46e['body']['appendChild'](_0x403ee1);const _0x3bdafd=_0x27f46e['createRange']();_0x3bdafd['setStartAfter'](_0x403ee1['firstElementChild']),_0x3bdafd['setEndBefore'](_0x403ee1['lastElementChild']);const _0x5d2a96=_0x5c5cf5['getSelection']();_0x5d2a96['removeAllRanges'](),_0x5d2a96['addRange'](_0x3bdafd),_0x27f46e['execCommand']('copy'),_0x403ee1['remove']();}}}class bt extends _0x33888c{constructor(_0x72afdc,_0x525307=''){super(_0x72afdc),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x525307,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x17bcb){this['element']['innerHTML']=_0x17bcb;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0xa03ee0=new _0x33888c(),_0x4b75fe=this['locale'],_0x3874c8=new _0x267b2f();return _0x3874c8['isVisible']=!0x0,_0xa03ee0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3874c8,{'text':i(_0x4b75fe,'AI\x20is\x20writing...')}]}),_0xa03ee0['render'](),_0xa03ee0;}}class mt extends _0x33888c{constructor(_0x440c27,_0x51f9cf=''){super(_0x440c27);const _0x303221=new _0xef11c6(),_0x30d365=this['bindTemplate'];this['set']('text',_0x51f9cf),_0x303221['content']=_0x93fbc8,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x303221,{'text':_0x30d365['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0xb777af,_0x592258){super(_0xb777af,_0x592258),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',(_0x9db251,_0x2ad391)=>{_0x9db251['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2ad391());});}['_createSubmitButton'](){const _0x1a0e6f=new _0x25b7ce(this['locale']),_0x19f888=this['locale'];return _0x1a0e6f['set']({'icon':it,'label':i(_0x19f888,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1a0e6f['on']('execute',()=>{this['submit']();}),_0x1a0e6f['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x7c81b6,_0x458db4)=>!_0x7c81b6&&_0x458db4),_0x1a0e6f;}['_createShowHistoryButton'](){const _0x22de32=new _0x25b7ce(this['locale']),_0x5c2cb1=this['resultsView'],_0x3f88e7=this['locale'];_0x22de32['set']({'label':i(_0x3f88e7,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x22de32['bind']('isOn')['to'](_0x5c2cb1,'isVisible'),_0x22de32['bind']('isEnabled')['to'](this,'isEnabled'),_0x22de32['on']('execute',()=>{_0x5c2cb1['isVisible']=!_0x5c2cb1['isVisible'],_0x5c2cb1['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4b8cf1=()=>{_0x466eb3['window']['requestAnimationFrame'](()=>{if(_0x52e7a7(this['element'])){const _0x5bdb59=new _0x456d6c(this['queryView']['fieldView']['element']),_0x24c36f=_0x5bdb59['width'],_0x36a75d='rtl'===_0x3f88e7['uiLanguageDirection']?'left':'right';_0x5bdb59['excludeScrollbarsAndBorders'](),_0x22de32['element']['style'][_0x36a75d]=_0x24c36f-_0x5bdb59['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4b8cf1),this['on']('render',_0x4b8cf1),_0x22de32;}['submit'](){const _0x22d7d2=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x22d7d2);}['focus'](_0x41d37c){-0x1===_0x41d37c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x3d134a){super(_0x3d134a),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x3d134a,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xbf1650=0x0;for(const _0x59d417 of this['items'])_0xbf1650+=_0x59d417['items']['length'];return{'resultsCount':_0xbf1650,'totalItemsCount':_0xbf1650};}['_createClearHistoryButton'](){const _0x3ae3c0=this['locale'],_0x18ce56=new _0x25b7ce(this['locale']);return _0x18ce56['set']({'label':'('+i(_0x3ae3c0,'Clear')+')','withText':!0x0}),_0x18ce56['on']('execute',()=>this['fire']('clearHistory')),_0x18ce56;}}class ut extends xt{constructor(_0x3522dd){super();const _0x4f5084=new wt(),_0x287351=new _0x25b7ce(this['locale'],_0x4f5084);this['children']['add'](_0x287351),_0x287351['set']({'label':_0x3522dd['prompt'],'withText':!0x0}),_0x287351['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x3522dd['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x5c19b8{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3f7505,_0x2a8170)=>{const _0x4769a0=os(_0x2a8170['prompt']);for(const _0x2c46e6 of this)if(_0x2c46e6!=_0x2a8170&&os(_0x2c46e6['prompt'])===_0x4769a0){this['remove'](_0x2c46e6);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x36b212=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x36b212));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x14c23d=>_0x14c23d)));}}function os(_0x306cab){return _0x306cab['toLowerCase']()['trim']();}class k extends _0x33888c{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2f02ce,_0x31e649,_0x194c71=''){super(_0x2f02ce),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(_0x2f02ce),this['contentArea']=new ct(_0x2f02ce,_0x194c71),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 _0xd4f5f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x31e649],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0xd4f5f['if']('isError','ck-hidden',_0x2d3652=>!_0x2d3652)]},'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'](_0x1b1967=0x1){-0x1===_0x1b1967?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 _0x156b6e=this['locale'],_0x430f90=new lt(_0x156b6e,{'queryView':{'label':i(_0x156b6e,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x156b6e,'Empty\x20history'),'secondary':i(_0x156b6e,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x430f90['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1acf43,_0xd7ef1)=>_0x1acf43&&!_0xd7ef1),this['listenTo'](_0x430f90,'submit',(_0xc71dc2,_0x4f7267)=>{this['prompt']=_0x4f7267;const _0x22421b=ft(_0x4f7267);this['fire']('submitPrompt',_0x22421b),_0x4f7267['trim']()&&this['_promptHistory']['add']({'prompt':_0x22421b},0x0);},{'priority':'high'}),_0x430f90;}['_createHistoryView'](){const _0x58b405=new pt(this['locale']);return _0x58b405['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x58b405['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x58b405;}['_createToolbar'](){const _0x3d492f=new at(this['locale']);return _0x3d492f['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4fc6ab,_0x419c93,_0x2941f2)=>_0x4fc6ab&&!_0x419c93&&!!_0x2941f2),_0x3d492f['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x3d492f['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x312d39,_0x30e5e6,_0x46dbb2)=>_0x312d39&&!_0x30e5e6&&!!_0x46dbb2),_0x3d492f['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x3d492f['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2f587a,_0x332377)=>_0x2f587a&&!_0x332377),_0x3d492f['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x3d492f['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x3d492f['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x3d492f;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x344279=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x344279,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x264397){const _0x7eb523=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x264397||i(_0x7eb523,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0xa2aebb{['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[_0x1e3e11,a,x,_0x44d9b2];}constructor(_0x11ccef){super(_0x11ccef),_0x11ccef['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x11ccef['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x11ccef['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x11ccef['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x2e7026}=this;this['_aiAdapter']=_0x2e7026['plugins']['get'](x),this['_dialog']=_0x2e7026['plugins']['get'](_0x44d9b2),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x4e0cd7=new E(_0x2e7026,Array['from'](this['_commandDefinitions']['values']()));_0x2e7026['commands']['add']('showAIAssistant',_0x4e0cd7),_0x2e7026['ui']['componentFactory']['add']('aiCommands',_0x12b072=>{const _0x389c63=_0x1c43f9(_0x12b072);return _0x389c63['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x389c63['buttonView']['set']({'label':i(_0x12b072,'AI\x20Commands'),'icon':_0x4afa3b,'tooltip':!0x0}),_0x389c63['on']('execute',_0x8db4d9=>this['_onExecute'](_0x8db4d9['source']['id'])),_0x358282(_0x389c63,_0x2e7026['ui']['view']['body'],function(_0x355c42){const _0x563301=o(_0x355c42['config']['get']('ai.aiAssistant.commands'),_0x355c42['locale']),_0x75668a=U(_0x355c42,_0x563301)['filter'](_0xf9b8e7=>_0xf9b8e7['commands']['length']);if(0x1===_0x75668a['length'])return U(_0x355c42,_0x75668a[0x0]['commands'])['map'](_0x287504=>({'id':_0x287504['id'],'label':_0x287504['label']}));return _0x75668a['map'](_0x45d0d5=>{const {groupId:_0x39fbb1,groupLabel:_0x1726f0,commands:_0x168822}=_0x45d0d5,_0x11ebdb=U(_0x355c42,_0x168822)['map'](_0x2d8e84=>({'id':_0x2d8e84['id'],'label':_0x2d8e84['label']}));return{'id':_0x39fbb1,'menu':_0x1726f0||_0x39fbb1,'children':_0x11ebdb};});}(_0x2e7026),{'ariaLabel':i(_0x12b072,'AI\x20Commands')}),_0x389c63['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x4e0cd7['on']('change:enabledCommandsIds',_0x2a1523),_0x389c63['menuView']['once']('render',_0x2a1523),_0x389c63;function _0x2a1523(){_0x389c63['isEnabled']=_0x4e0cd7['enabledCommandsIds']['length']>0x0;for(const _0x406a42 of _0x389c63['menuView']['buttons'])_0x406a42['isEnabled']=_0x4e0cd7['enabledCommandsIds']['includes'](_0x406a42['id']);}}),_0x2e7026['ui']['componentFactory']['add']('menuBar:aiCommands',_0x1cd795=>{const _0x47245e=new _0xea1f72(_0x1cd795);_0x47245e['buttonView']['set']({'label':i(_0x1cd795,'AI\x20Commands'),'icon':_0x4afa3b}),_0x47245e['bind']('isEnabled')['to'](_0x4e0cd7,'enabledCommandsIds',_0x4b218c=>_0x4b218c['length']>0x0);const _0x5f019f=o(_0x2e7026['config']['get']('ai.aiAssistant.commands'),_0x1cd795);return this['_populateMenuBarMenu'](_0x4e0cd7,_0x47245e,_0x5f019f,_0x34ef65=>this['_onExecute'](_0x34ef65)),_0x47245e;}),_0x2e7026['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x525158=this['_createAIAssistantUIButton'](_0x25b7ce);return _0x525158['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x525158;}),_0x2e7026['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x54cc14=this['_createAIAssistantUIButton'](_0x1bce39);return _0x54cc14['set']({'role':'menuitemcheckbox'}),_0x54cc14;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x144764=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x5a3091;for(const _0xc8ddae in _0x144764){const _0x30f5e0=_0xc8ddae,_0x185428=_0x144764[_0x30f5e0];if('aiLicenseKeyValid'==_0x185428||'aiLicenseKeyInvalid'==_0x185428||'aiLicenseKeyExpired'==_0x185428||'aiLicenseKeyDomainLimit'==_0x185428||'aiLicenseKeyNotAllowed'==_0x185428||'aiLicenseKeyEvaluationLimit'==_0x185428||'aiLicenseKeyTrialLimit'==_0x185428||'aiLicenseKeyUsageLimit'==_0x185428){delete _0x144764[_0x30f5e0],_0x5a3091=_0x185428,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x5a3091&&_0x144764['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x5a3091&&_0x144764['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x5a3091&&_0x144764['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x5a3091&&_0x144764['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x5a3091&&_0x144764['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x5a3091&&_0x144764['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x5a3091&&_0x144764['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x54e6fb='',_0x29f9f5='',_0x3ba20d='custom'){const _0x3c54d4=this['editor'],_0x51e0cb=_0x3c54d4['editing']['view'],_0x5481d6=_0x3c54d4['plugins']['get'](a),_0x14dca3=_0x3c54d4['plugins']['get'](_0x1e3e11);_0x5481d6['showFakeVisualSelection']();const _0x3aa134=new l(),_0x31d582=new ClipboardEvent('copy',{'clipboardData':_0x3aa134}),_0x2fd7eb=new _0x53d16d(_0x3aa134),_0x3025ed=new _0x5960d0(_0x51e0cb,_0x31d582,{'dataTransfer':_0x2fd7eb});_0x14dca3['_forceMarkersCopy']('comment',()=>{_0x51e0cb['document']['fire']('copy',_0x3025ed);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x3c54d4,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x375acb=_0x2fd7eb['getData']('text/html');const _0x5127fb=_0x3c54d4['model']['document']['selection'],_0x34b4b6=Array['from'](_0x5127fb['getRanges']());0x1===_0x34b4b6['length']&&_0x34b4b6[0x0]['isFlat']&&!_0x5127fb['getSelectedElement']()&&''!==_0x375acb['replace'](/&nbsp;/g,'')['trim']()&&(_0x375acb='<p>'+_0x375acb+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x3ba20d,'query':_0x54e6fb,'htmlContent':_0x375acb,'label':_0x29f9f5,'mainActionLabel':_[_0x3c54d4['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x49ac43,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x46bd9d['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5481d6['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x39af98=new Map(),_0x5a5d23=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x37f3c3 of _0x5a5d23)for(const _0x4f4165 of _0x37f3c3['commands'])_0x39af98['set'](_0x4f4165['id'],{..._0x4f4165,'groupId':_0x37f3c3['groupId'],'groupLabel':_0x37f3c3['groupLabel']||_0x37f3c3['groupId']});return _0x39af98;}['_createAIAssistantUIButton'](_0x2af714){const _0x296735=this['editor'],_0xe61eaf=_0x296735['commands']['get']('showAIAssistant'),_0xb43b24=new _0x2af714(_0x296735['locale']);return _0xb43b24['set']({'label':i(_0x296735['locale'],'AI\x20Assistant'),'icon':_0x49ac43,'isToggleable':!0x0}),_0xb43b24['bind']('isEnabled')['to'](_0xe61eaf),_0xb43b24['bind']('isOn')['to'](this['_dialog'],'id',_0x36c391=>'aiAssistant'===_0x36c391),this['listenTo'](_0xb43b24,'execute',()=>{_0xb43b24['isOn']?this['hideUI']():_0xe61eaf['execute']();}),_0xb43b24;}['_initView'](){const _0x328532=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',()=>{_0x328532['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x328532['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x44b468,ui:{ariaLiveAnnouncer:_0x3f6f23}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x3ed6c2,_0x4b73cf,_0x48b483)=>{const _0x57c450=this['_aiAssistantController']['currentContext'];_0x48b483?_0x3f6f23['announce'](i(_0x44b468,'AI\x20is\x20writing')):_0x57c450&&_0x3f6f23['announce'](i(_0x44b468,'Generated\x20content:\x20%0',_0x57c450),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x2bd843,_0x282d0f,_0x1d3ec6)=>{if(_0x1d3ec6){const _0x5c2efe=this['_formView']['errorView']['text'];_0x3f6f23['announce'](i(_0x44b468,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5c2efe));}});}['_onExecute'](_0x28ef85){const _0x5d3d5a=this['_commandDefinitions']['get'](_0x28ef85),_0x24dee2=this['editor'],_0x20fd3e=_0x24dee2['model']['document']['selection'],_0x30b103=_0x24dee2['commands']['get']('showAIAssistant'),_0x1fce77=_0x24dee2['plugins']['get'](a),_0x6e503a=''+(_0x5d3d5a['groupId']!==K?_0x5d3d5a['groupLabel']+':\x20':'')+_0x5d3d5a['label'];if(!0x1!==_0x5d3d5a['requiresContent']&&_0x20fd3e['isCollapsed']){const _0x24e36a=_0x568f50(_0x20fd3e['getSelectedBlocks']())||_0x24dee2['model']['schema']['getLimitElement'](_0x20fd3e);_0x24dee2['model']['change'](_0x2dc11e=>{_0x2dc11e['setSelection'](_0x24e36a,'in');});}_0x1fce77['showFakeVisualSelection'](),_0x30b103['execute'](_0x5d3d5a['prompt'],_0x6e503a,'command:'+_0x28ef85);}['_populateMenuBarMenu'](_0x56cd6b,_0x65b951,_0x581af3,_0x5d7ace){const _0x51bbec=this['editor'],_0x5389c5=_0x51bbec['locale'],_0x438baa=new _0xaef931(_0x5389c5),_0xa21c81=U(_0x51bbec,_0x581af3)['filter'](_0x4adb6b=>_0x4adb6b['commands']['length']);0x1===_0xa21c81['length']?this['_getMenuBarGroupButtons']({'command':_0x56cd6b,'commands':_0xa21c81[0x0]['commands'],'parentMenuView':_0x65b951,'onExecute':_0x5d7ace})['forEach'](_0x3da0c1=>_0x438baa['items']['add'](_0x3da0c1)):_0xa21c81['forEach'](({groupId:_0xcd3b83,groupLabel:_0x4a7c01,commands:_0x28abbb})=>{const _0x21d413=new _0x9a245e(_0x5389c5,_0x65b951),_0x395598=new _0xea1f72(_0x5389c5),_0x41da81=new _0xaef931(_0x5389c5),_0x4eaab9=this['_getMenuBarGroupButtons']({'command':_0x56cd6b,'commands':_0x28abbb,'parentMenuView':_0x395598,'onExecute':_0x5d7ace});_0x395598['buttonView']['set']({'label':_0x4a7c01||_0xcd3b83}),_0x395598['delegate']('execute')['to'](_0x65b951),_0x41da81['items']['addMany'](_0x4eaab9),_0x395598['panelView']['children']['add'](_0x41da81),_0x21d413['children']['add'](_0x395598),_0x438baa['items']['add'](_0x21d413);}),_0x65b951['panelView']['children']['add'](_0x438baa);}['_getMenuBarGroupButtons']({command:_0x512283,commands:_0x4d04ec,parentMenuView:_0x30cf45,onExecute:_0x139341}){const _0xcaf4c5=this['editor'],_0x4009c8=_0xcaf4c5['locale'];return U(_0xcaf4c5,_0x4d04ec)['map'](_0x52185f=>{const _0x5e3f94=new _0x9a245e(_0x4009c8,_0x30cf45),_0x39f860=new _0x1bce39(_0x4009c8);return _0x39f860['set']({'label':_0x52185f['label']}),_0x39f860['delegate']('execute')['to'](_0x30cf45),_0x39f860['on']('execute',()=>_0x139341(_0x52185f['id'])),_0x39f860['bind']('isEnabled')['to'](_0x512283,'enabledCommandsIds',_0x2fd6a8=>_0x2fd6a8['includes'](_0x52185f['id'])),_0x5e3f94['children']['add'](_0x39f860),_0x5e3f94;});}}function T(_0x12c721,_0x31d11c){return void 0x0!==_0x12c721['order']&&void 0x0===_0x31d11c['order']?0x1:void 0x0===_0x12c721['order']&&void 0x0!==_0x31d11c['order']?-0x1:void 0x0!==_0x12c721['order']&&void 0x0!==_0x31d11c['order']?_0x12c721['order']-_0x31d11c['order']:0x0;}function U(_0xeeeabc,_0x1824d4){_0x1824d4['sort'](T);const _0x1d5c72={},_0xbd0c4b=[];for(const _0xd8f1c8 of _0x1824d4)if(void 0x0!==_0xd8f1c8['order']){if(_0xd8f1c8['order']in _0x1d5c72)throw new _0xa97696('ai-commands-config-order-collision',_0xeeeabc,{'conflictingDefinitions':[_0xd8f1c8,_0x1d5c72[_0xd8f1c8['order']]]});_0x1d5c72[_0xd8f1c8['order']]=_0xd8f1c8,_0xbd0c4b['splice'](_0xd8f1c8['order'],0x0,_0xd8f1c8);}else _0xbd0c4b['push'](_0xd8f1c8);return _0xbd0c4b;}class At extends _0xa2aebb{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3e5b54){super(_0x3e5b54);const _0xc3e7d9=_0x3e5b54['config'],_0x59db42=_0x3e5b54['locale'];_0xc3e7d9['define']('ai.aiAssistant.preserveComments',!0x0),_0xc3e7d9['define']('ai.aiAssistant.commands',_t(_0x59db42)),_0xc3e7d9['define']('ai.aiAssistant.extraCommandGroups',[]),_0xc3e7d9['define']('ai.aiAssistant.removeCommands',[]);let _0x30bff7=o(_0xc3e7d9['get']('ai.aiAssistant.commands'),_0x59db42);const _0xc07394=_0xc3e7d9['get']('ai.aiAssistant.extraCommandGroups'),_0x4f4d30=_0xc3e7d9['get']('ai.aiAssistant.removeCommands');_0xc07394['forEach'](_0x47aea4=>{const _0x421202=_0x30bff7['find'](_0x16cd7a=>_0x16cd7a['groupId']===_0x47aea4['groupId']);_0x421202?_0x421202['commands']=_0x421202['commands']['concat'](_0x47aea4['commands']):_0x30bff7['push'](_0x47aea4);}),_0x30bff7=_0x30bff7['filter'](_0x25b6d3=>!_0x4f4d30['includes'](_0x25b6d3['groupId'])),_0x30bff7['forEach'](_0x11e8c6=>{_0x11e8c6['commands']=_0x11e8c6['commands']['filter'](_0x496f4d=>!_0x4f4d30['includes'](_0x496f4d['id']));}),_0xc3e7d9['set']('ai.aiAssistant.commands',_0x30bff7);}}function _t(_0x4cb332){return[{'groupId':'editOrReview','groupLabel':i(_0x4cb332,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x4cb332,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x4cb332,'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(_0x4cb332,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x4cb332,'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(_0x4cb332,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x4cb332,'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(_0x4cb332,'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(_0x4cb332,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x4cb332,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x4cb332,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x4cb332,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x4cb332,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x4cb332,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x4cb332,'Change\x20style'),'commands':[{'id':'business','label':i(_0x4cb332,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x4cb332,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x4cb332,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x4cb332,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x4cb332,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x4cb332,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x4cb332,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x4cb332,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x4cb332,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x4cb332,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x4cb332,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x4cb332,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x4cb332,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0xa2aebb{['abortController'];static get['requires'](){return[x];}constructor(_0x52356a){super(_0x52356a),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'](_0x215ebe){return this['sendRequest'](_0x215ebe)['catch'](_0x19a3e5=>{if(_0x19a3e5 instanceof R)return Promise['reject'](_0x19a3e5);if('AbortError'==_0x19a3e5['name'])return Promise['resolve']();throw console['error'](_0x19a3e5),new _0xa97696('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x10ee1c,_0x2f9b30){const _0x3cf2a3=this['editor']['locale'],_0x1c96d3={'Content-Type':'application/json'};if('object'==typeof _0x10ee1c)Object['assign'](_0x1c96d3,_0x10ee1c);else{if(_0x10ee1c)try{const _0x25dc1d=await _0x10ee1c(_0x2f9b30);Object['assign'](_0x1c96d3,_0x25dc1d);}catch{return Promise['reject'](new R(i(_0x3cf2a3,'AI_ERROR_GET_HEADERS')));}}return _0x1c96d3;}async['_prepareRequestParameters'](_0x1eab69,_0x697b95){const _0x57d97c=this['editor']['locale'];if('object'==typeof _0x1eab69)return _0x1eab69;try{return await _0x1eab69(_0x697b95);}catch{return Promise['reject'](new R(i(_0x57d97c,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x21c86f){super(_0x21c86f),_0x21c86f['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x21c86f['config']['get']('ai.openAI.requestParameters')||_0x21c86f['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x21c86f['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x21c86f['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x21c86f['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x1c03b8,context:_0x18b7b3,onData:_0x26899a,actionId:_0x4a3b12}){const _0x299537=this['editor']['locale'],_0x49d2f3=await this['prepareMessages'](_0x1c03b8,_0x18b7b3,_0x4a3b12),_0x499ef7=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4a3b12),_0x3d4bc0=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4a3b12),_0x12f0ac={'messages':_0x49d2f3,..._0x3d4bc0},_0x853da3={'method':'POST','headers':_0x499ef7,'body':JSON['stringify'](_0x12f0ac),'signal':this['abortController']['signal']},_0x5acafb=await fetch(this['_apiUrl'],_0x853da3);if(_0x5acafb['ok'])return _0x3d4bc0['stream']?await this['_readStreamableResponse'](_0x5acafb,_0x26899a):await this['_readStaticResponse'](_0x5acafb,_0x26899a),Promise['resolve']();{const _0x5b32a7=await _0x5acafb['text']();return _0x5b32a7['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x299537,'AI_ERROR_CONTEXT_LENGTH'))):_0x5b32a7['includes']('Moderation')?Promise['reject'](new R(i(_0x299537,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x5b32a7));}}async['prepareMessages'](_0x181537,_0x11319a,_0x384deb){let _0x33b3f5,_0x5e0966;return _0x11319a?(_0x33b3f5='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.',_0x5e0966='Instruction:\x0a'+_0x181537+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x11319a):(_0x33b3f5='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.',_0x5e0966=_0x181537),[{'role':'system','content':_0x33b3f5},{'role':'user','content':_0x5e0966}];}async['_readStreamableResponse'](_0x1f34bd,_0x323a4a){const _0x5bf25e=_0x1f34bd['body']['getReader'](),_0x5ace77=new TextDecoder();let _0x5d077f='',_0x3ba6dc='',_0x95feb9='',_0x4ffbd3=!0x1;for(;!_0x4ffbd3;){const {done:_0x4530a4,value:_0x26fe58}=await _0x5bf25e['read'](),_0x181db6=_0x5d077f+_0x5ace77['decode'](_0x26fe58);let _0x483a56='';_0x4ffbd3=_0x4530a4;try{_0x483a56=this['_cleanUpData'](_0x181db6),_0x5d077f='';}catch{_0x5d077f=_0x181db6;continue;}_0x3ba6dc+=_0x483a56,!_0x4ffbd3&&this['_isBufferIncomplete'](_0x3ba6dc)||_0x3ba6dc&&(_0x95feb9+=_0x3ba6dc,_0x3ba6dc='',_0x323a4a(_0x95feb9));}return Promise['resolve']();}async['_readStaticResponse'](_0x3145ea,_0x1a2216){return _0x1a2216((await _0x3145ea['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x32ed94){const _0x345283=_0x32ed94['split']('<')['length']!==_0x32ed94['split']('>')['length'],_0x306ad8=_0x32ed94['length']<0x1e;return _0x345283&&_0x306ad8;}['_cleanUpData'](_0xcb6195){return _0xcb6195['split'](/\n(?![^{]*\})/g)['map'](_0x52c012=>_0x52c012['replace']('data:\x20',''))['filter'](_0x2e6c10=>_0x2e6c10&&_0x2e6c10['length']>0x0&&'[DONE]'!==_0x2e6c10)['map'](_0x13e1ed=>{const {choices:_0x22aaf4}=JSON['parse'](_0x13e1ed);if(_0x22aaf4[0x0]?.['delta']?.['content'])return _0x22aaf4[0x0]['delta']['content'];})['filter'](_0x2b9f18=>_0x2b9f18)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x50dc42){super(_0x50dc42),_0x50dc42['config']['get']('ai.aws.requestParameters')||_0x50dc42['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']=_0x50dc42['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x50dc42['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x50dc42['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x50dc42['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x3e6c04,context:_0x5cb296,onData:_0x8540e4,actionId:_0x5706fa}){const {model:_0x17006d,stream:_0x51e1fe,..._0x5e0096}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5706fa),_0x1b4140={'prompt':await this['preparePrompt'](_0x3e6c04,_0x5cb296,_0x17006d,_0x5706fa),..._0x5e0096};this['_apiUrl']?await this['_processProxyRequest'](_0x1b4140,_0x17006d,_0x51e1fe,_0x8540e4,_0x5706fa):await this['_processAWSRequest'](_0x1b4140,_0x17006d,_0x51e1fe,_0x8540e4);}async['preparePrompt'](_0x127eff,_0x424e05,_0x167d22,_0x49b511){let _0x5e5afa,_0x392708;return _0x424e05?(_0x5e5afa='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.',_0x392708='Instruction:\x0a'+_0x127eff+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x424e05):(_0x5e5afa='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.',_0x392708=_0x127eff),'meta.llama'==this['getModelFamily'](_0x167d22)?'<<SYS>>\x0a'+_0x5e5afa+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x392708+'\x0a[/INST]':'Human:\x0a'+_0x5e5afa+'\x0a'+_0x392708+'\x0a\x0aAssistant:';}['getModelFamily'](_0xc7b1fe){if(/^anthropic\.claude/['test'](_0xc7b1fe))return'anthropic.claude';if(/^ai21\.j2/['test'](_0xc7b1fe))return'ai21.j2';if(/^cohere\.command/['test'](_0xc7b1fe))return'cohere.command';if(/^meta\.llama/['test'](_0xc7b1fe))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0xc7b1fe));}async['_processProxyRequest'](_0x57b788,_0x592113,_0x3542ce,_0x2c285a,_0xc60aba){const _0x27e98f={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xc60aba),'body':JSON['stringify']({..._0x57b788,'model':_0x592113,'stream':_0x3542ce}),'signal':this['abortController']['signal']},_0x513027=await fetch(this['_apiUrl'],_0x27e98f);_0x3542ce?await this['_readStreamableResponse'](_0x513027,_0x592113,_0x2c285a):await this['_readStaticResponse'](_0x513027,_0x592113,_0x2c285a);}async['_processAWSRequest'](_0x5bb951,_0x4da80d,_0x5800e6,_0x10323c){const _0x39e75b=new _0x541bb0(this['_bedrockClientConfig']),_0x4f3980={'body':JSON['stringify'](_0x5bb951),'contentType':'application/json','accept':'application/json','modelId':_0x4da80d};let _0x163ab7;if(_0x5800e6){const _0x587ae0=new _0xf413eb(_0x4f3980);_0x163ab7=await _0x39e75b['send'](_0x587ae0,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x163ab7,_0x4da80d,_0x10323c);}else{const _0xf65e90=new _0x1f1126(_0x4f3980);_0x163ab7=await _0x39e75b['send'](_0xf65e90,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x163ab7,_0x4da80d,_0x10323c);}}async['_readAsyncIterableResponse'](_0xd237e7,_0x56da0b,_0x5bc15d){const _0x213e08=_0xd237e7['body'],_0x5c8003=new TextDecoder('utf-8');let _0x5777e2='';for await(const _0x3a2aa0 of _0x213e08)if(_0x3a2aa0['chunk']){const _0x285196=_0x5c8003['decode'](_0x3a2aa0['chunk']['bytes']),_0x12102b=JSON['parse'](_0x285196);_0x5777e2+=this['_getGeneratedText'](_0x12102b,_0x56da0b),_0x5bc15d(_0x5777e2);}return Promise['resolve']();}async['_readStreamableResponse'](_0xfdbea3,_0x3e1d78,_0x5a5b4c){const _0xabc20d=_0xfdbea3['body'],_0x53bc8f=new TextDecoder('utf-8'),_0x228b23=_0xabc20d['getReader']();let _0x3cdecd='',_0x30d3fb='',_0x5b20e4=!0x1;for(;!_0x5b20e4;){const {done:_0x509053,value:_0x14078c}=await _0x228b23['read']();if(_0x5b20e4=_0x509053,_0x5b20e4)break;const _0x345cbb=(_0x3cdecd+_0x53bc8f['decode'](_0x14078c))['split']('\x0a')['map'](_0x231390=>{try{return _0x3cdecd='',JSON['parse'](_0x231390);}catch{return _0x3cdecd=_0x231390,null;}})['filter'](_0x35af97=>null!==_0x35af97);_0x345cbb['length']&&(_0x30d3fb+=_0x345cbb['map'](_0x30df60=>this['_getGeneratedText'](_0x30df60,_0x3e1d78))['join'](''),_0x5a5b4c(_0x30d3fb));}return Promise['resolve']();}async['_readStaticResponse'](_0x12138c,_0x5104be,_0x338bdd){let _0x5c74dc;return _0x5c74dc=_0x12138c instanceof Response?await _0x12138c['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x12138c['body'])),(_0x338bdd(this['_getGeneratedText'](_0x5c74dc,_0x5104be)),Promise['resolve']());}['_getGeneratedText'](_0x343dc4,_0x1ac654){switch(this['getModelFamily'](_0x1ac654)){case'anthropic.claude':return _0x343dc4['completion'];case'ai21.j2':return _0x343dc4['completions'][0x0]['data']['text'];case'cohere.command':return _0x343dc4['generations'][0x0]['text'];case'meta.llama':return _0x343dc4['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.1.1-alpha.1",
3
+ "version": "46.1.1-alpha.2",
4
4
  "description": "AI Assistant feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -29,14 +29,14 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@aws-sdk/client-bedrock-runtime": "3.823.0",
32
- "@ckeditor/ckeditor5-clipboard": "46.1.1-alpha.1",
33
- "@ckeditor/ckeditor5-core": "46.1.1-alpha.1",
34
- "@ckeditor/ckeditor5-engine": "46.1.1-alpha.1",
35
- "@ckeditor/ckeditor5-icons": "46.1.1-alpha.1",
36
- "@ckeditor/ckeditor5-table": "46.1.1-alpha.1",
37
- "@ckeditor/ckeditor5-ui": "46.1.1-alpha.1",
38
- "@ckeditor/ckeditor5-utils": "46.1.1-alpha.1",
39
- "ckeditor5": "46.1.1-alpha.1",
32
+ "@ckeditor/ckeditor5-clipboard": "46.1.1-alpha.2",
33
+ "@ckeditor/ckeditor5-core": "46.1.1-alpha.2",
34
+ "@ckeditor/ckeditor5-engine": "46.1.1-alpha.2",
35
+ "@ckeditor/ckeditor5-icons": "46.1.1-alpha.2",
36
+ "@ckeditor/ckeditor5-table": "46.1.1-alpha.2",
37
+ "@ckeditor/ckeditor5-ui": "46.1.1-alpha.2",
38
+ "@ckeditor/ckeditor5-utils": "46.1.1-alpha.2",
39
+ "ckeditor5": "46.1.1-alpha.2",
40
40
  "es-toolkit": "1.39.5"
41
41
  },
42
42
  "type": "module",