@ckeditor/ckeditor5-ai 46.0.0-alpha.4 → 46.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ai.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +9 -9
- package/src/aiassistantediting.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x384ca4,Command as _0x29902d}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x1eba2f,IconCheck as _0x323056,IconError as _0x56017a,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x15b650,IconRobotPencil as _0x2394ca}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x5eb09c,CKEditorError as _0x52e74e,ObservableMixin as _0x1080fb,global as _0x1b1a79,isVisible as _0x149372,Rect as _0x55c4a2,Collection as _0x1df110,FocusTracker as et,KeystrokeHandler as rt,first as _0x31e7e6}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x58c277,View as _0x2a8937,SpinnerView as _0xfa9e58,IconView as _0x2decf2,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x3e70d4,createDropdown as _0x27a472,addMenuToDropdown as _0x50ff58,MenuBarMenuView as _0x242bb6,MenuBarMenuListItemButtonView as _0x2e85ef,DialogViewPosition as _0x2869f6,MenuBarMenuListView as _0x229224,MenuBarMenuListItemView as _0x375214}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x3b793d,ClipboardMarkersUtils as _0x1d859c}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x431b93,ViewDataTransfer as _0x4b8b8b,ViewUpcastWriter as _0x5ca384,Matcher as _0x140f61}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0xe076f4,InvokeModelWithResponseStreamCommand as _0x57dd39,InvokeModelCommand as _0x2a85c4}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x2600ea,_0x5c47d7){const _0x54f8bc=(0x0,_0x5c47d7['t'])('Other');return _0x2600ea['length']?'groupId'in _0x2600ea[0x0]?_0x2600ea:[{'groupId':K,'groupLabel':_0x54f8bc,'order':0x1/0x0,'commands':_0x2600ea}]:[{'groupId':K,'groupLabel':_0x54f8bc,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x384ca4{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2aa22a}=this,_0x490709=['ck-fake-ai-selection'];_0x2aa22a['config']['get']('ai.useTheme')&&_0x490709['push']('ck-ai-assistant-ui_theme'),_0x2aa22a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x490709,'priority':0xc}}),_0x2aa22a['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x58da9c,{writer:_0x5a3a41})=>{if(!_0x58da9c['markerRange']['isCollapsed'])return null;const _0x16aa22=_0x5a3a41['createUIElement']('span');return _0x5a3a41['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x16aa22),_0x16aa22;}});}['afterInit'](){!async function(_0x8c541a){const _0xf97c80=_0x57c6ed([0x4b,0x55,0x33,0x73,0x51,0x56,0x4c,0x68,0x46,0x47,0x72,0x59,0x65,0x6c,0x44,0x6d,0x34,0x53,0x30,0x4d,0x31,0x52,0x45,0x48,0x43,0x7a,0x32,0x58,0x42,0x74,0x38,0x4e,0x57,0x50,0x78,0x39,0x71,0x6f,0x61,0x6b,0x75,0x62,0x70,0x4f,0x49,0x69,0x37,0x4a,0x66,0x63,0x6e,0x5a,0x41,0x79,0x6a,0x77,0x64,0x35,0x54,0x36,0x67,0x76]),_0x468d8b=0x123f3a50,_0x3550b6=0x123856e0^_0x468d8b,_0x1267b6=window[_0x57c6ed([0x44,0x61,0x74,0x65])][_0x57c6ed([0x6e,0x6f,0x77])](),_0x304873=_0x8c541a[_0x57c6ed([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x38b4b7=new window[(_0x57c6ed([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x23c962=>{_0x304873[_0x57c6ed([0x6f,0x6e,0x63,0x65])](_0x57c6ed([0x72,0x65,0x61,0x64,0x79]),_0x23c962);}),_0xec86ac={[_0x57c6ed([0x6b,0x74,0x79])]:_0x57c6ed([0x45,0x43]),[_0x57c6ed([0x75,0x73,0x65])]:_0x57c6ed([0x73,0x69,0x67]),[_0x57c6ed([0x63,0x72,0x76])]:_0x57c6ed([0x50,0x2d,0x32,0x35,0x36]),[_0x57c6ed([0x78])]:_0x57c6ed([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]),[_0x57c6ed([0x79])]:_0x57c6ed([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]),[_0x57c6ed([0x61,0x6c,0x67])]:_0x57c6ed([0x45,0x53,0x32,0x35,0x36])},_0x246115=_0x304873[_0x57c6ed([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x57c6ed([0x67,0x65,0x74])](_0x57c6ed([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x22edd2(){let _0x444d87,_0x49f47c=null,_0x2bdb6e=null;try{if(_0x246115==_0x57c6ed([0x47,0x50,0x4c]))return _0x57c6ed([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x444d87=_0x5e7e0f(),!_0x444d87)return _0x57c6ed([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x444d87[_0x57c6ed([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2bdb6e=_0x28d862(_0x444d87[_0x57c6ed([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x444d87[_0x57c6ed([0x6a,0x74,0x69])])),await _0x36323e()?_0x410740()?_0x14c737()?_0x57c6ed([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x39310e()?(_0x444d87[_0x57c6ed([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x57c6ed([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x49f47c=_0x351394(_0x57c6ed([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x444d87[_0x57c6ed([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x57c6ed([0x74,0x72,0x69,0x61,0x6c])&&(_0x49f47c=_0x351394(_0x57c6ed([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x25a75e()):_0x57c6ed([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x57c6ed([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x57c6ed([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x57c6ed([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x14c737(){const _0x370db6=[_0x57c6ed([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x57c6ed([0x74,0x72,0x69,0x61,0x6c])][_0x57c6ed([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x444d87[_0x57c6ed([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x1267b6/0x3e8:0xe10*_0x3550b6;return _0x444d87[_0x57c6ed([0x65,0x78,0x70])]<_0x370db6;}function _0x410740(){const _0x300e50=_0x444d87[_0x57c6ed([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x300e50&&(!!_0x300e50[_0x57c6ed([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x57c6ed([0x2a]))||!!_0x300e50[_0x57c6ed([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x57c6ed([0x41,0x49])));}function _0x39310e(){const _0x31cc6c=_0x444d87[_0x57c6ed([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x31cc6c||0x0==_0x31cc6c[_0x57c6ed([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x244f4a}=new URL(window[_0x57c6ed([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x31cc6c[_0x57c6ed([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x244f4a))return!0x0;const _0x58abc8=_0x244f4a[_0x57c6ed([0x73,0x70,0x6c,0x69,0x74])](_0x57c6ed([0x2e]));return _0x31cc6c[_0x57c6ed([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x36e966=>_0x36e966[_0x57c6ed([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x57c6ed([0x2a])))[_0x57c6ed([0x6d,0x61,0x70])](_0x5c4331=>_0x5c4331[_0x57c6ed([0x73,0x70,0x6c,0x69,0x74])](_0x57c6ed([0x2e])))[_0x57c6ed([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2a5e68=>_0x2a5e68[_0x57c6ed([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x58abc8[_0x57c6ed([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x57c6ed([0x6d,0x61,0x70])](_0x28deca=>Array(_0x58abc8[_0x57c6ed([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x28deca[_0x57c6ed([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x57c6ed([0x66,0x69,0x6c,0x6c])](_0x28deca[0x0]===_0x57c6ed([0x2a])?_0x57c6ed([0x2a]):'')[_0x57c6ed([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x28deca))[_0x57c6ed([0x73,0x6f,0x6d,0x65])](_0x582802=>_0x58abc8[_0x57c6ed([0x65,0x76,0x65,0x72,0x79])]((_0x18b6ab,_0x4040fe)=>_0x582802[_0x4040fe]===_0x18b6ab||_0x582802[_0x4040fe]===_0x57c6ed([0x2a])));}function _0x25a75e(){return _0x49f47c&&_0x2bdb6e?new window[(_0x57c6ed([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x57c6f2,_0x14dd11)=>{_0x49f47c[_0x57c6ed([0x74,0x68,0x65,0x6e])](_0x57c6f2,_0x14dd11),_0x2bdb6e[_0x57c6ed([0x74,0x68,0x65,0x6e])](_0x28962a=>{_0x28962a!=_0x57c6ed([0x56,0x61,0x6c,0x69,0x64])&&_0x57c6f2(_0x28962a);},_0x14dd11);}):_0x49f47c||_0x2bdb6e||_0x57c6ed([0x56,0x61,0x6c,0x69,0x64]);}}function _0x28d862(_0x5f1364,_0x34dffe){return new window[(_0x57c6ed([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1412d9=>{if(_0x4b8a19())return _0x1412d9(_0x57c6ed([0x56,0x61,0x6c,0x69,0x64]));_0x54b0dc(),_0x304873[_0x57c6ed([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x57c6ed([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xd09f1b=!0x1;const _0x4ade20=_0x5eb09c();function _0xc5a8e2(_0x3640c6){return!!_0x3640c6&&(typeof _0x3640c6===_0x57c6ed([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3640c6===_0x57c6ed([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3640c6[_0x57c6ed([0x74,0x68,0x65,0x6e])]===_0x57c6ed([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3640c6[_0x57c6ed([0x63,0x61,0x74,0x63,0x68])]===_0x57c6ed([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1d0309(_0x1593d3){_0x2b55e0(_0x1593d3)[_0x57c6ed([0x74,0x68,0x65,0x6e])](_0x269327=>{if(!_0x269327||_0x269327[_0x57c6ed([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x57c6ed([0x6f,0x6b]))return _0x57c6ed([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x59fcf5(_0x47bc64(_0x4ade20+_0x34dffe))!=_0x269327[_0x57c6ed([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x57c6ed([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x57c6ed([0x56,0x61,0x6c,0x69,0x64]);})[_0x57c6ed([0x74,0x68,0x65,0x6e])](_0x4d9af6=>(_0x5e7d07(),_0x4d9af6),()=>{const _0xdf4476=_0x4d320d();return null==_0xdf4476?(_0x5e7d07(),_0x57c6ed([0x56,0x61,0x6c,0x69,0x64])):_0x57c6ed(_0x1267b6-_0xdf4476>(0x3633be50^_0x468d8b)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x57c6ed([0x74,0x68,0x65,0x6e])](_0x1412d9)[_0x57c6ed([0x63,0x61,0x74,0x63,0x68])](()=>{_0x1412d9(_0x57c6ed([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x396948=0x1209d4d0^_0x468d8b;function _0x5e7d07(){const _0x243d09=_0x57c6ed([0x6c,0x6c,0x63,0x74,0x2d])+_0x59fcf5(_0x47bc64(_0x5f1364)),_0x558ba2=_0x2ff97a(_0x59fcf5(window[_0x57c6ed([0x4d,0x61,0x74,0x68])][_0x57c6ed([0x63,0x65,0x69,0x6c])](_0x1267b6/_0x396948)));window[_0x57c6ed([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x57c6ed([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x243d09,_0x558ba2);}function _0x4d320d(){const _0x51d392=_0x57c6ed([0x6c,0x6c,0x63,0x74,0x2d])+_0x59fcf5(_0x47bc64(_0x5f1364)),_0x350dd0=window[_0x57c6ed([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x57c6ed([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x51d392);return _0x350dd0?window[_0x57c6ed([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2ff97a(_0x350dd0),0x10)*_0x396948:null;}function _0x2b55e0(_0x340859){return new window[(_0x57c6ed([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xd0fae7,_0x1b6af7)=>{_0x340859[_0x57c6ed([0x74,0x68,0x65,0x6e])](_0xd0fae7,_0x1b6af7),window[_0x57c6ed([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x1b6af7,0x123eee90^_0x468d8b);});}}_0x304873[_0x57c6ed([0x6f,0x6e])](_0x57c6ed([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x143ad1,_0x5c527c)=>{if(_0x5c527c[0x0]!=_0x5f1364)return _0x1412d9(_0x57c6ed([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x5c527c[0x1]={..._0x5c527c[0x1],[_0x57c6ed([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x4ade20};},{[_0x57c6ed([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x57c6ed([0x68,0x69,0x67,0x68])}),_0x304873[_0x57c6ed([0x6f,0x6e])](_0x57c6ed([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x4949ca=>{_0xc5a8e2(_0x4949ca[_0x57c6ed([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xd09f1b=!0x0,_0x1d0309(_0x4949ca[_0x57c6ed([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x57c6ed([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x57c6ed([0x6c,0x6f,0x77])}),_0x38b4b7[_0x57c6ed([0x74,0x68,0x65,0x6e])](()=>{_0xd09f1b||_0x1412d9(_0x57c6ed([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4b8a19(){return _0x304873[_0x57c6ed([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x57c6ed([0x76,0x69,0x65,0x77])][_0x57c6ed([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x57c6ed([0x61,0x75,0x74,0x6f]);}function _0x54b0dc(){_0x304873[_0x57c6ed([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x57c6ed([0x76,0x69,0x65,0x77])][_0x57c6ed([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x57c6ed([0x61,0x75,0x74,0x6f]);}}function _0x351394(_0x31ceae){const _0x457f2b=[new window[(_0x57c6ed([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4873f4=>setTimeout(_0x4873f4,0x1236049c^_0x468d8b)),_0x38b4b7[_0x57c6ed([0x74,0x68,0x65,0x6e])](()=>new window[(_0x57c6ed([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5e216d=>{let _0x26c72d=0x0;_0x304873[_0x57c6ed([0x6d,0x6f,0x64,0x65,0x6c])][_0x57c6ed([0x6f,0x6e])](_0x57c6ed([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x334cac,_0x4bf06e)=>{_0x4bf06e[0x0][_0x57c6ed([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x26c72d++,_0x26c72d==(0x123f3ba8^_0x468d8b)&&(_0x5e216d(),_0x334cac[_0x57c6ed([0x6f,0x66,0x66])]());});}))];return window[_0x57c6ed([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x57c6ed([0x72,0x61,0x63,0x65])](_0x457f2b)[_0x57c6ed([0x74,0x68,0x65,0x6e])](()=>_0x31ceae);}async function _0x53abcd(){await _0x38b4b7,_0x304873[_0x57c6ed([0x6d,0x6f,0x64,0x65,0x6c])][_0x57c6ed([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5a77df,_0x304873[_0x57c6ed([0x6d,0x6f,0x64,0x65,0x6c])][_0x57c6ed([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5a77df,_0x304873[_0x57c6ed([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x57c6ed([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5695ff(_0x84ac44){const _0x143347=_0x20030a();_0x304873[_0x143347]=_0x57c6ed([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x84ac44,_0x84ac44!=_0x57c6ed([0x56,0x61,0x6c,0x69,0x64])&&_0x53abcd();}function _0x20030a(){const _0x4f1c0b=window[_0x57c6ed([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x57c6ed([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x57c6ed([0x6e,0x6f,0x77])]())[_0x57c6ed([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x57c6ed([0x2e]),'');let _0x55e80f=_0x57c6ed([0x4b]);for(let _0x1163b6=0x0;_0x1163b6<_0x4f1c0b[_0x57c6ed([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1163b6+=0x2){let _0x27acf5=window[_0x57c6ed([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4f1c0b[_0x57c6ed([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1163b6,_0x1163b6+0x2));_0x27acf5>=_0xf97c80[_0x57c6ed([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x27acf5-=_0xf97c80[_0x57c6ed([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x55e80f+=_0xf97c80[_0x27acf5];}return _0x55e80f;}function _0x5e7e0f(){const _0x548a1e=_0x246115[_0x57c6ed([0x73,0x70,0x6c,0x69,0x74])](_0x57c6ed([0x2e]));if(0x3!=_0x548a1e[_0x57c6ed([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x19bd4b(_0x548a1e[0x1]);function _0x19bd4b(_0x332cfe){const _0x541be4=_0x45badf(_0x332cfe);return _0x541be4&&_0x2401d0()?_0x541be4:null;function _0x2401d0(){const _0x5d128c=_0x541be4[_0x57c6ed([0x6a,0x74,0x69])],_0x2c2580=window[_0x57c6ed([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5d128c[_0x57c6ed([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5d128c[_0x57c6ed([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x5b7aec={..._0x541be4,[_0x57c6ed([0x6a,0x74,0x69])]:_0x5d128c[_0x57c6ed([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x5d128c[_0x57c6ed([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x5b7aec[_0x57c6ed([0x76,0x63])],_0x47bc64(_0x5b7aec)==_0x2c2580;}}}async function _0x36323e(){let _0x31cc6f=!0x0;try{const _0x43daf6=_0x246115[_0x57c6ed([0x73,0x70,0x6c,0x69,0x74])](_0x57c6ed([0x2e])),[_0x4c47b3,_0x2d422f,_0x31ac97]=_0x43daf6;return _0x26dfed(_0x4c47b3),await _0x528d7e(_0x4c47b3,_0x2d422f,_0x31ac97),_0x31cc6f;}catch{return!0x1;}function _0x26dfed(_0x379126){const _0x5d81d1=_0x45badf(_0x379126);_0x5d81d1&&_0x5d81d1[_0x57c6ed([0x61,0x6c,0x67])]==_0x57c6ed([0x45,0x53,0x32,0x35,0x36])||(_0x31cc6f=!0x1);}async function _0x528d7e(_0x1ccff9,_0x1b4c95,_0x53aa9f){const _0x1e53a5=window[_0x57c6ed([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x57c6ed([0x66,0x72,0x6f,0x6d])](_0x590033(_0x53aa9f),_0x111daa=>_0x111daa[_0x57c6ed([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x202245=new window[(_0x57c6ed([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x57c6ed([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x1ccff9+_0x57c6ed([0x2e])+_0x1b4c95),_0x329289=window[_0x57c6ed([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x57c6ed([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x329289)return;const _0x261a25=await _0x329289[_0x57c6ed([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x57c6ed([0x6a,0x77,0x6b]),_0xec86ac,{[_0x57c6ed([0x6e,0x61,0x6d,0x65])]:_0x57c6ed([0x45,0x43,0x44,0x53,0x41]),[_0x57c6ed([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x57c6ed([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x57c6ed([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x329289[_0x57c6ed([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x57c6ed([0x6e,0x61,0x6d,0x65])]:_0x57c6ed([0x45,0x43,0x44,0x53,0x41]),[_0x57c6ed([0x68,0x61,0x73,0x68])]:{[_0x57c6ed([0x6e,0x61,0x6d,0x65])]:_0x57c6ed([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x261a25,_0x1e53a5,_0x202245)||(_0x31cc6f=!0x1);}}function _0x45badf(_0x200eac){return _0x200eac[_0x57c6ed([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x57c6ed([0x65,0x79]))?JSON[_0x57c6ed([0x70,0x61,0x72,0x73,0x65])](_0x590033(_0x200eac)):null;}function _0x590033(_0x2edef8){return window[_0x57c6ed([0x61,0x74,0x6f,0x62])](_0x2edef8[_0x57c6ed([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x57c6ed([0x2b]))[_0x57c6ed([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x57c6ed([0x2f])));}function _0x47bc64(_0x1b5bc0){let _0x2930e3=0x1505;function _0x58e3eb(_0x262b9e){for(let _0x3af9af=0x0;_0x3af9af<_0x262b9e[_0x57c6ed([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3af9af++){const _0x403f6b=_0x262b9e[_0x57c6ed([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x3af9af);_0x2930e3=(_0x2930e3<<0x5)+_0x2930e3+_0x403f6b,_0x2930e3&=_0x2930e3;}}function _0x570826(_0x4134e8){Array[_0x57c6ed([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x4134e8)?_0x4134e8[_0x57c6ed([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x570826):_0x4134e8&&typeof _0x4134e8==_0x57c6ed([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x57c6ed([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x4134e8)[_0x57c6ed([0x73,0x6f,0x72,0x74])]()[_0x57c6ed([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x486713,_0x408f38])=>{_0x58e3eb(_0x486713),_0x570826(_0x408f38);}):_0x58e3eb(window[_0x57c6ed([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x4134e8));}return _0x570826(_0x1b5bc0),_0x2930e3>>>0x0;}function _0x59fcf5(_0x4b762d){return _0x4b762d[_0x57c6ed([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x57c6ed([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x57c6ed([0x30]));}function _0x2ff97a(_0x51ab6c){return _0x51ab6c[_0x57c6ed([0x73,0x70,0x6c,0x69,0x74])]('')[_0x57c6ed([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x57c6ed([0x6a,0x6f,0x69,0x6e])]('');}function _0x5a77df(){}function _0x57c6ed(_0x410583){return _0x410583['map'](_0x45d960=>String['fromCharCode'](_0x45d960))['join']('');}_0x5695ff(await _0x22edd2());}(this);}['showFakeVisualSelection'](){const _0x5b0d3d=this['editor']['model'];_0x5b0d3d['change'](_0x33b136=>{const _0x3aeb79=_0x5b0d3d['document']['selection']['getRanges']();let _0x2e24ff=0x0;for(const _0x9bf686 of _0x3aeb79){const _0x3089fd=w+':'+_0x2e24ff;if(_0x5b0d3d['markers']['has'](_0x3089fd))_0x33b136['updateMarker'](_0x3089fd,{'range':_0x9bf686});else{if(_0x9bf686['start']['isAtEnd']){const _0x10bb6e=_0x9bf686['start']['getLastMatchingPosition'](({item:_0x319cc3})=>!_0x5b0d3d['schema']['isContent'](_0x319cc3),{'boundaries':_0x9bf686});_0x33b136['addMarker'](_0x3089fd,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x33b136['createRange'](_0x10bb6e,_0x9bf686['end'])});}else _0x33b136['addMarker'](_0x3089fd,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x9bf686});}_0x2e24ff++;}});}['hideFakeVisualSelection'](){const _0x37f9b0=this['editor']['model'],_0x59e897=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x59e897['length']&&_0x37f9b0['change'](_0x48694c=>{_0x59e897['forEach'](_0x58e96d=>{_0x48694c['removeMarker'](_0x58e96d);});});}['insertContent'](_0x5c317b,_0x27e70d){const _0x587566=this['_getAISelection'](),_0x568e87=_0x27e70d||_0x587566['getFirstRange']();this['editor']['model']['canEditAt'](_0x568e87)&&this['editor']['model']['change'](_0x2d22d2=>{this['hideFakeVisualSelection'](),_0x27e70d||this['_resetContentOfSelectedTableCells'](_0x2d22d2,_0x587566),this['_pasteHTMLUsingClipboard']({'insertAt':_0x568e87,'writer':_0x2d22d2,'html':_0x5c317b});});}['insertContentBelow'](_0x3a07bf){const {model:_0x1cc5f1}=this['editor'],_0x18cb51=this['_getAISelection']();_0x1cc5f1['change'](()=>{const _0x5c7e55=this['_prepareTableInsertBelowPosition'](_0x3a07bf,_0x18cb51)||this['_getDefaultInsertBelowPosition'](_0x18cb51);this['insertContent'](_0x3a07bf,_0x5c7e55);});}['_getAISelection'](){const _0x441845=this['editor']['model'],_0x3f2c47=Array['from'](_0x441845['markers']['getMarkersGroup'](w))['map'](_0x492e57=>_0x492e57['getRange']());return _0x441845['createSelection'](_0x3f2c47);}['_pasteHTMLUsingClipboard']({writer:_0xdf13e3,html:_0x133774,insertAt:_0x3c09a}){const {view:_0x3c0e0a}=this['editor']['editing'],_0x5bc3fe=this['editor']['plugins']['get'](_0x3b793d),_0x45d770=new gt();_0x45d770['setData']('text/html',_0x133774);const _0x190ff2=new ClipboardEvent('paste',{'clipboardData':_0x45d770}),_0x1f8371=new _0x431b93(_0x3c0e0a,_0x190ff2,{'dataTransfer':new _0x4b8b8b(_0x45d770)});_0xdf13e3['setSelection'](_0x3c09a);const _0x314c06=(_0x151059,_0x566797)=>{_0x566797['resultRange']&&_0xdf13e3['setSelection'](_0x566797['resultRange']);};_0x5bc3fe['once']('contentInsertion',_0x314c06,{'priority':'lowest'}),_0x3c0e0a['document']['fire']('paste',_0x1f8371),_0x5bc3fe['off']('contentInsertion',_0x314c06);}['_getDefaultInsertBelowPosition'](_0x4887c3){const {model:_0x22f0db}=this['editor'],_0x561006=Array['from'](_0x4887c3['getSelectedBlocks']());return _0x561006['length']?_0x22f0db['createPositionAfter'](_0x561006['pop']()):_0x4887c3['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x12b579,_0x30d5fa){const {model:_0x32f428,plugins:_0x307cb6}=this['editor'];if(_0x307cb6['has']('TableUtils')){const _0xb174b8=_0x307cb6['get']('TableUtils')['getSelectedTableCells'](_0x30d5fa);if(_0xb174b8['length']){const _0x166a2e=this['_getTableRowCountFromContent'](_0x12b579),_0x467292=this['_createEmptyTableRows'](_0xb174b8,_0x166a2e);return _0x32f428['createPositionAt'](_0x467292,0x0);}}return null;}['_getTableRowCountFromContent'](_0x126cf8){const _0xca3a39=this['editor']['plugins']['get']('TableUtils'),_0x48a7c8=this['editor']['data']['parse'](_0x126cf8),_0x4e7454=Array['from'](_0x48a7c8['getChildren']())['filter'](_0x5a8c4e=>_0x5a8c4e['is']('element','table'));let _0x2bb6b2=0x0;return _0x4e7454['forEach'](_0x4db7ae=>{_0x2bb6b2+=_0xca3a39['getRows'](_0x4db7ae);}),_0x2bb6b2;}['_createEmptyTableRows'](_0x14bae3,_0x108221){const _0x42ba9c=this['editor']['plugins']['get']('TableUtils'),_0x48f482=_0x42ba9c['getRowIndexes'](_0x14bae3),_0xa927d4=_0x42ba9c['getColumnIndexes'](_0x14bae3),_0x4ea2ff=_0x48f482['last']+0x1,_0x1ce9e9=_0xa927d4['first'],_0x23f056=_0x14bae3[0x0]['findAncestor']('table');for(let _0x16e92b=0x0;_0x16e92b<_0x108221;_0x16e92b++)_0x42ba9c['insertRows'](_0x23f056,{'at':_0x4ea2ff});return _0x23f056['getChild'](_0x4ea2ff)['getChild'](_0x1ce9e9);}['_resetContentOfSelectedTableCells'](_0x456a8b,_0x6ffaa3){const {plugins:_0x1554be}=this['editor'],{model:_0x299c65}=_0x456a8b;if(!_0x1554be['has']('TableUtils'))return;_0x1554be['get']('TableUtils')['getSelectedTableCells'](_0x6ffaa3)['length']&&_0x299c65['deleteContent'](_0x6ffaa3);}}class x extends _0x384ca4{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x52e74e('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x50fb6d){super(_0x50fb6d),this['name']='AIRequestError';}}function i(_0x558485,_0xe8ce4a,_0x42dc12){const t=_0x558485['t'];switch(_0xe8ce4a){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',_0x42dc12);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x42dc12);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'},_0x42dc12);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 _0xe8ce4a;}}class E extends _0x29902d{['_commandDefinitions'];constructor(_0xa84b32,_0x322f47){super(_0xa84b32),this['_commandDefinitions']=_0x322f47,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x4ddc28,_0x1681ce,_0x3902fe)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x3902fe));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x3d7187,_0xbfe031,_0x2a6df6)=>{this['enabledCommandsIds']=_0x2a6df6?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3ddf3e=this['editor']['model'];this['_hasContext']=function(_0xcfc3bc){const _0x42a7e0=_0xcfc3bc['document']['selection'];return _0x42a7e0['isCollapsed']?0x0!==[..._0x42a7e0['getSelectedBlocks']()]['length']&&![..._0x42a7e0['getSelectedBlocks']()][0x0]['isEmpty']:!!_0xcfc3bc['hasContent'](_0x42a7e0['getFirstRange']());}(_0x3ddf3e);const _0x5b6700=_0x3ddf3e['document']['selection'],_0x236ddd=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x378689 of _0x5b6700['getRanges']())for(const _0x1b9045 of _0x378689['getItems']())if(_0x1b9045['is']('element')&&_0x236ddd['includes'](_0x1b9045['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2446b4='',_0x18ed5e='',_0x16178a='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x2446b4,_0x18ed5e,_0x16178a);}}function F(_0x16358f,_0x378107){const _0x226ad5=new Set();for(const _0x390414 of _0x16358f['values']())(_0x378107||!0x1===_0x390414['requiresContent'])&&_0x226ad5['add'](_0x390414['id']);return Array['from'](_0x226ad5);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x1080fb(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3cff05,_0x41f58c,_0x3a8ace){super(),this['editor']=_0x3cff05,this['textAdapter']=_0x41f58c,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x3a8ace,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x5b796b,_0x45e2d6,_0x548a51)=>{this['view']['value']=this['_sanitizeHTML'](_0x548a51);}),this['listenTo'](this['view'],'submitPrompt',(_0x3d542f,_0x334511)=>{const _0x56e10d=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x334511,_0x56e10d,'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:_0x52e41d,query:_0x56a678,htmlContent:_0x542a28,label:_0x3f8019,mainActionLabel:_0x2eb38d}){this['view']['prompt']=_0x3f8019,this['view']['mainAction']=_0x2eb38d,this['initialContext']=_0x542a28,_0x56a678&&(this['view']['isRendered']?this['_handleQuery'](_0x56a678,_0x542a28,_0x52e41d,_0x3f8019):this['view']['once']('render',()=>{this['_handleQuery'](_0x56a678,_0x542a28,_0x52e41d,_0x3f8019);}));}['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'](_0x106170,_0x5355da,_0x1aa637,_0x4b1cfa){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5355da,this['previousQuery']=_0x106170,this['previousLabel']=_0x4b1cfa||_0x106170,this['previousActionId']=_0x1aa637,new Promise(_0x394eec=>{this['textAdapter']['makeRequest']({'query':_0x106170,'context':_0x5355da,'onData':_0x128618=>{this['currentResponse']=_0x128618,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1aa637})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x544e27=>{_0x544e27 instanceof R?this['view']['handleError'](_0x544e27['message']):this['view']['handleError'](),_0x394eec();})['finally'](()=>{this['stopProcessing'](),_0x394eec();});});}['_parseAndNormalizeContent'](_0x25d9f7,_0x47f925=!0x1){const _0x5ab708=Q['exec'](_0x25d9f7);_0x25d9f7=_0x5ab708?_0x25d9f7['substring'](_0x5ab708[0x1]['length']):_0x25d9f7['length']<0x64&&!_0x47f925?'':this['_stripMarkdownSyntax'](_0x25d9f7);const _0x5636d5=this['_domParser']['parseFromString'](_0x25d9f7,'text/html');if(_0x5ab708){const _0x3a2768=Array['from'](_0x5636d5['body']['childNodes']);_0x3a2768['reverse']();for(const _0x24ccb7 of _0x3a2768){if(_0x24ccb7['nodeType']==Node['ELEMENT_NODE'])break;_0x24ccb7['remove']();}}const _0x588297=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x5636d5['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x588297);const _0x58c189=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x316621=this['editor']['data']['toModel'](_0x588297);return _0x58c189||_0x316621['markers']['clear'](),this['editor']['data']['stringify'](_0x316621);}['_normalizeResponseHeadings'](_0x500a37){const _0x6d1f27=new _0x5ca384(this['editor']['editing']['view']['document']),_0x13d009=new _0x140f61({'name':/^h[1-5]$/}),_0x16e112=[];let _0x150b1c=!0x1;for(const _0x3de78e of _0x500a37)_0x3de78e['is']('element')&&_0x13d009['match'](_0x3de78e)&&(_0x16e112['push'](_0x3de78e),'h1'==_0x3de78e['name']&&(_0x150b1c=!0x0));if(_0x150b1c){for(const _0x58ae88 of _0x16e112)_0x6d1f27['rename']('h'+(parseInt(_0x58ae88['name'][0x1])+0x1),_0x58ae88);}}['_isH1TagSupportEnabled'](){const {data:_0x37667d,editing:_0x362515}=this['editor'],_0x18d39d=_0x37667d['htmlProcessor']['toView']('<h1></h1>'),_0x257a91=_0x37667d['toView'](_0x37667d['toModel'](_0x18d39d));return!!_0x362515['view']['domConverter']['viewToDom'](_0x257a91)['querySelector']('h1');}['_sanitizeHTML'](_0x2ddc72){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2ddc72),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x380565){const _0x3b8af0=_0x380565['trim']();return _0x3b8af0['startsWith']('```html')?_0x3b8af0['endsWith']('```')?_0x3b8af0['substring'](0x7,_0x3b8af0['length']-0x3):_0x3b8af0['substring'](0x7):_0x380565;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x425c3a){super(_0x425c3a),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x5d5d12=>i(_0x425c3a,'AI_'+_0x5d5d12['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x425c3a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x425c3a,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x425c3a,'Stop'));const _0x3ea436=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3ea436['if']('isVisible','ck-hidden',_0x49efa4=>!_0x49efa4)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x5c2dcb,_0x1358d7){const _0x357280=new _0x58c277(this['locale']);return _0x357280['set']({'label':_0x5c2dcb,'class':_0x1358d7||'','isVisible':!0x0,'withText':!0x0}),_0x357280;}}class ct extends _0x2a8937{['contentFieldView'];['copyButtonView'];constructor(_0x1e32d7,_0x20d5ea=''){super(_0x1e32d7),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x27877e=this['bindTemplate'];this['contentFieldView']=new bt(_0x1e32d7,_0x20d5ea),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x27877e['if']('isVisible','ck-hidden',_0x41c2ef=>!_0x41c2ef)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x27877e['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 _0x185454=!0x1;this['on']('change:value',(_0x51eda5,_0x261d8a,_0x3d60c1)=>{const _0x3bd561=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3d60c1),this['isProcessing']&&_0x3bd561&&!_0x185454&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x163740,_0x2e175b,_0x100dd5)=>{_0x185454=!0x1,_0x100dd5?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x185454=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x185454=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1498d6=this['locale'],_0x4626e3=new _0x58c277(this['locale']),_0x43c8ac='ck-ai-form__copy-button';return _0x4626e3['set']({'label':i(_0x1498d6,'Copy'),'icon':_0x1eba2f,'class':_0x43c8ac,'tooltip':!0x0}),_0x4626e3['bind']('isVisible')['to'](this,'value',_0x5d2fb6=>!!_0x5d2fb6),_0x4626e3['bind']('isEnabled')['to'](this,'isProcessing',_0x2b3172=>!_0x2b3172),_0x4626e3['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4626e3['icon']=_0x323056,_0x4626e3['class']=_0x43c8ac+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4626e3['icon']=_0x1eba2f,_0x4626e3['class']=_0x43c8ac;},0x3e8);}),_0x4626e3;}['_copyHTMLToClipboard'](_0x2eeb2b){const {window:_0x5c2ef0,document:_0x326f0a}=_0x1b1a79;if(_0x5c2ef0['ClipboardItem']){const {Blob:_0x17953e,ClipboardItem:_0x1ea322}=_0x5c2ef0,_0x535210=[new _0x1ea322({'text/html':new _0x17953e([_0x2eeb2b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x17953e([_0x2eeb2b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x535210);}else{const _0xdbfef3=_0x326f0a['createElement']('div');_0xdbfef3['style']['position']='absolute',_0xdbfef3['style']['left']='-9999px',_0xdbfef3['innerHTML']='<span>[</span>'+_0x2eeb2b['innerHTML']+'<span>]</span>',_0x326f0a['body']['appendChild'](_0xdbfef3);const _0x48a8d0=_0x326f0a['createRange']();_0x48a8d0['setStartAfter'](_0xdbfef3['firstElementChild']),_0x48a8d0['setEndBefore'](_0xdbfef3['lastElementChild']);const _0x158ac1=_0x5c2ef0['getSelection']();_0x158ac1['removeAllRanges'](),_0x158ac1['addRange'](_0x48a8d0),_0x326f0a['execCommand']('copy'),_0xdbfef3['remove']();}}}class bt extends _0x2a8937{constructor(_0x20f95e,_0x381a20=''){super(_0x20f95e),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x381a20,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x18a137){this['element']['innerHTML']=_0x18a137;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5ba675=new _0x2a8937(),_0x3f842b=this['locale'],_0xcee2d=new _0xfa9e58();return _0xcee2d['isVisible']=!0x0,_0x5ba675['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0xcee2d,{'text':i(_0x3f842b,'AI\x20is\x20writing...')}]}),_0x5ba675['render'](),_0x5ba675;}}class mt extends _0x2a8937{constructor(_0x919dea,_0x5320e4=''){super(_0x919dea);const _0x4a5280=new _0x2decf2(),_0x4ed46b=this['bindTemplate'];this['set']('text',_0x5320e4),_0x4a5280['content']=_0x56017a,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4a5280,{'text':_0x4ed46b['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x365328,_0x249b06){super(_0x365328,_0x249b06),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',(_0x36a017,_0x41dfc5)=>{_0x36a017['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x41dfc5());});}['_createSubmitButton'](){const _0xb34f7a=new _0x58c277(this['locale']),_0x1b3e0a=this['locale'];return _0xb34f7a['set']({'icon':it,'label':i(_0x1b3e0a,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xb34f7a['on']('execute',()=>{this['submit']();}),_0xb34f7a['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x93ff25,_0x2ee5d8)=>!_0x93ff25&&_0x2ee5d8),_0xb34f7a;}['_createShowHistoryButton'](){const _0x4d8034=new _0x58c277(this['locale']),_0x408bfd=this['resultsView'],_0x41d33e=this['locale'];_0x4d8034['set']({'label':i(_0x41d33e,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4d8034['bind']('isOn')['to'](_0x408bfd,'isVisible'),_0x4d8034['bind']('isEnabled')['to'](this,'isEnabled'),_0x4d8034['on']('execute',()=>{_0x408bfd['isVisible']=!_0x408bfd['isVisible'],_0x408bfd['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x39faf8=()=>{_0x1b1a79['window']['requestAnimationFrame'](()=>{if(_0x149372(this['element'])){const _0x2ddbb2=new _0x55c4a2(this['queryView']['fieldView']['element']),_0x8c446f=_0x2ddbb2['width'],_0x533cfb='rtl'===_0x41d33e['uiLanguageDirection']?'left':'right';_0x2ddbb2['excludeScrollbarsAndBorders'](),_0x4d8034['element']['style'][_0x533cfb]=_0x8c446f-_0x2ddbb2['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x39faf8),this['on']('render',_0x39faf8),_0x4d8034;}['submit'](){const _0x264a4c=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x264a4c);}['focus'](_0x2fafb4){-0x1===_0x2fafb4?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x1a9556){super(_0x1a9556),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x1a9556,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2b7422=0x0;for(const _0x19a677 of this['items'])_0x2b7422+=_0x19a677['items']['length'];return{'resultsCount':_0x2b7422,'totalItemsCount':_0x2b7422};}['_createClearHistoryButton'](){const _0x2bc3e8=this['locale'],_0x7112e=new _0x58c277(this['locale']);return _0x7112e['set']({'label':'('+i(_0x2bc3e8,'Clear')+')','withText':!0x0}),_0x7112e['on']('execute',()=>this['fire']('clearHistory')),_0x7112e;}}class ut extends xt{constructor(_0xd5263c){super();const _0x5ba553=new wt(),_0x5b0976=new _0x58c277(this['locale'],_0x5ba553);this['children']['add'](_0x5b0976),_0x5b0976['set']({'label':_0xd5263c['prompt'],'withText':!0x0}),_0x5b0976['on']('execute',()=>{this['fire']('execute',{'value':kt(_0xd5263c['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x1df110{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x5caeb9,_0x303f45)=>{const _0x50824c=os(_0x303f45['prompt']);for(const _0x1710c9 of this)if(_0x1710c9!=_0x303f45&&os(_0x1710c9['prompt'])===_0x50824c){this['remove'](_0x1710c9);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x127488=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x127488));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x543945=>_0x543945)));}}function os(_0x515ba0){return _0x515ba0['toLowerCase']()['trim']();}class k extends _0x2a8937{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1a225d,_0x3a4ad2,_0x49e7ae=''){super(_0x1a225d),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(_0x1a225d),this['contentArea']=new ct(_0x1a225d,_0x49e7ae),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 _0x24b03e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x3a4ad2],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x24b03e['if']('isError','ck-hidden',_0xc98ce1=>!_0xc98ce1)]},'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'](_0x3572e5=0x1){-0x1===_0x3572e5?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 _0x11db36=this['locale'],_0x316306=new lt(_0x11db36,{'queryView':{'label':i(_0x11db36,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x11db36,'Empty\x20history'),'secondary':i(_0x11db36,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x316306['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x456379,_0x5b2897)=>_0x456379&&!_0x5b2897),this['listenTo'](_0x316306,'submit',(_0x479af2,_0x3b957d)=>{this['prompt']=_0x3b957d;const _0x5817aa=ft(_0x3b957d);this['fire']('submitPrompt',_0x5817aa),_0x3b957d['trim']()&&this['_promptHistory']['add']({'prompt':_0x5817aa},0x0);},{'priority':'high'}),_0x316306;}['_createHistoryView'](){const _0x3b618d=new pt(this['locale']);return _0x3b618d['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x3b618d['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3b618d;}['_createToolbar'](){const _0x1d586b=new at(this['locale']);return _0x1d586b['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x190f8b,_0x5030eb,_0x3af96d)=>_0x190f8b&&!_0x5030eb&&!!_0x3af96d),_0x1d586b['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1d586b['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x195bc9,_0x38ce91,_0x6de915)=>_0x195bc9&&!_0x38ce91&&!!_0x6de915),_0x1d586b['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1d586b['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x436039,_0x4d567d)=>_0x436039&&!_0x4d567d),_0x1d586b['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1d586b['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1d586b['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1d586b;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x4366e1=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x4366e1,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2a17a1){const _0x3ba938=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2a17a1||i(_0x3ba938,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x384ca4{['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[_0x1d859c,a,x,_0x3e70d4];}constructor(_0x2e685d){super(_0x2e685d),_0x2e685d['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2e685d['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2e685d['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2e685d['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4acda9}=this;this['_aiAdapter']=_0x4acda9['plugins']['get'](x),this['_dialog']=_0x4acda9['plugins']['get'](_0x3e70d4),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x255b43=new E(_0x4acda9,Array['from'](this['_commandDefinitions']['values']()));_0x4acda9['commands']['add']('showAIAssistant',_0x255b43),_0x4acda9['ui']['componentFactory']['add']('aiCommands',_0x1293b8=>{const _0xa5f8a1=_0x27a472(_0x1293b8);return _0xa5f8a1['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0xa5f8a1['buttonView']['set']({'label':i(_0x1293b8,'AI\x20Commands'),'icon':_0x15b650,'tooltip':!0x0}),_0xa5f8a1['on']('execute',_0x18822d=>this['_onExecute'](_0x18822d['source']['id'])),_0x50ff58(_0xa5f8a1,_0x4acda9['ui']['view']['body'],function(_0x354d8e){const _0x12f43f=o(_0x354d8e['config']['get']('ai.aiAssistant.commands'),_0x354d8e['locale']),_0x4d12cb=U(_0x354d8e,_0x12f43f)['filter'](_0x2fd31a=>_0x2fd31a['commands']['length']);if(0x1===_0x4d12cb['length'])return U(_0x354d8e,_0x4d12cb[0x0]['commands'])['map'](_0x4a0264=>({'id':_0x4a0264['id'],'label':_0x4a0264['label']}));return _0x4d12cb['map'](_0x1f5b28=>{const {groupId:_0x4beb85,groupLabel:_0x189831,commands:_0x591c6f}=_0x1f5b28,_0x3a794d=U(_0x354d8e,_0x591c6f)['map'](_0x12fc09=>({'id':_0x12fc09['id'],'label':_0x12fc09['label']}));return{'id':_0x4beb85,'menu':_0x189831||_0x4beb85,'children':_0x3a794d};});}(_0x4acda9),{'ariaLabel':i(_0x1293b8,'AI\x20Commands')}),_0xa5f8a1['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x255b43['on']('change:enabledCommandsIds',_0x3d66a1),_0xa5f8a1['menuView']['once']('render',_0x3d66a1),_0xa5f8a1;function _0x3d66a1(){_0xa5f8a1['isEnabled']=_0x255b43['enabledCommandsIds']['length']>0x0;for(const _0x56b2ae of _0xa5f8a1['menuView']['buttons'])_0x56b2ae['isEnabled']=_0x255b43['enabledCommandsIds']['includes'](_0x56b2ae['id']);}}),_0x4acda9['ui']['componentFactory']['add']('menuBar:aiCommands',_0x22c638=>{const _0x31cf25=new _0x242bb6(_0x22c638);_0x31cf25['buttonView']['set']({'label':i(_0x22c638,'AI\x20Commands'),'icon':_0x15b650}),_0x31cf25['bind']('isEnabled')['to'](_0x255b43,'enabledCommandsIds',_0x1e62a8=>_0x1e62a8['length']>0x0);const _0x46eb73=o(_0x4acda9['config']['get']('ai.aiAssistant.commands'),_0x22c638);return this['_populateMenuBarMenu'](_0x255b43,_0x31cf25,_0x46eb73,_0x27879d=>this['_onExecute'](_0x27879d)),_0x31cf25;}),_0x4acda9['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1541c4=this['_createAIAssistantUIButton'](_0x58c277);return _0x1541c4['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1541c4;}),_0x4acda9['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1a9a47=this['_createAIAssistantUIButton'](_0x2e85ef);return _0x1a9a47['set']({'role':'menuitemcheckbox'}),_0x1a9a47;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x42b6bf=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x94cc5;for(const _0x1e3f37 in _0x42b6bf){const _0x27a49e=_0x1e3f37,_0x18084e=_0x42b6bf[_0x27a49e];if('aiLicenseKeyValid'==_0x18084e||'aiLicenseKeyInvalid'==_0x18084e||'aiLicenseKeyExpired'==_0x18084e||'aiLicenseKeyDomainLimit'==_0x18084e||'aiLicenseKeyNotAllowed'==_0x18084e||'aiLicenseKeyEvaluationLimit'==_0x18084e||'aiLicenseKeyTrialLimit'==_0x18084e||'aiLicenseKeyUsageLimit'==_0x18084e){delete _0x42b6bf[_0x27a49e],_0x94cc5=_0x18084e,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x94cc5&&_0x42b6bf['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x94cc5&&_0x42b6bf['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x94cc5&&_0x42b6bf['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x94cc5&&_0x42b6bf['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x94cc5&&_0x42b6bf['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x94cc5&&_0x42b6bf['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x94cc5&&_0x42b6bf['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x2d4153='',_0x3b333c='',_0x594c2c='custom'){const _0x27b0ef=this['editor'],_0xc8d19=_0x27b0ef['editing']['view'],_0x10016e=_0x27b0ef['plugins']['get'](a),_0x487146=_0x27b0ef['plugins']['get'](_0x1d859c);_0x10016e['showFakeVisualSelection']();const _0x4f4ea2=new l(),_0x4837e2=new ClipboardEvent('copy',{'clipboardData':_0x4f4ea2}),_0x32e3d3=new _0x4b8b8b(_0x4f4ea2),_0xabbcfc=new _0x431b93(_0xc8d19,_0x4837e2,{'dataTransfer':_0x32e3d3});_0x487146['_forceMarkersCopy']('comment',()=>{_0xc8d19['document']['fire']('copy',_0xabbcfc);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x27b0ef,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x5ae0df=_0x32e3d3['getData']('text/html');const _0x46a45b=_0x27b0ef['model']['document']['selection'],_0x5a8c6a=Array['from'](_0x46a45b['getRanges']());0x1===_0x5a8c6a['length']&&_0x5a8c6a[0x0]['isFlat']&&!_0x46a45b['getSelectedElement']()&&''!==_0x5ae0df['replace'](/ /g,'')['trim']()&&(_0x5ae0df='<p>'+_0x5ae0df+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x594c2c,'query':_0x2d4153,'htmlContent':_0x5ae0df,'label':_0x3b333c,'mainActionLabel':_[_0x27b0ef['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2394ca,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2869f6['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x10016e['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x3b8290=new Map(),_0x142dd4=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x4a334d of _0x142dd4)for(const _0xba01a1 of _0x4a334d['commands'])_0x3b8290['set'](_0xba01a1['id'],{..._0xba01a1,'groupId':_0x4a334d['groupId'],'groupLabel':_0x4a334d['groupLabel']||_0x4a334d['groupId']});return _0x3b8290;}['_createAIAssistantUIButton'](_0x5ead53){const _0x2ec6a0=this['editor'],_0x5a46cd=_0x2ec6a0['commands']['get']('showAIAssistant'),_0x3b3377=new _0x5ead53(_0x2ec6a0['locale']);return _0x3b3377['set']({'label':i(_0x2ec6a0['locale'],'AI\x20Assistant'),'icon':_0x2394ca,'isToggleable':!0x0}),_0x3b3377['bind']('isEnabled')['to'](_0x5a46cd),_0x3b3377['bind']('isOn')['to'](this['_dialog'],'id',_0x5785b3=>'aiAssistant'===_0x5785b3),this['listenTo'](_0x3b3377,'execute',()=>{_0x3b3377['isOn']?this['hideUI']():_0x5a46cd['execute']();}),_0x3b3377;}['_initView'](){const _0x554e63=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',()=>{_0x554e63['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x554e63['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x3ad8a8,ui:{ariaLiveAnnouncer:_0xfd7ba8}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x700aed,_0x2a1051,_0x233395)=>{const _0x556027=this['_aiAssistantController']['currentContext'];_0x233395?_0xfd7ba8['announce'](i(_0x3ad8a8,'AI\x20is\x20writing')):_0x556027&&_0xfd7ba8['announce'](i(_0x3ad8a8,'Generated\x20content:\x20%0',_0x556027),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0xfe5eb,_0x2d0c0b,_0x33b717)=>{if(_0x33b717){const _0x3aa20b=this['_formView']['errorView']['text'];_0xfd7ba8['announce'](i(_0x3ad8a8,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3aa20b));}});}['_onExecute'](_0xa82d69){const _0x36e02e=this['_commandDefinitions']['get'](_0xa82d69),_0x563028=this['editor'],_0x518e8f=_0x563028['model']['document']['selection'],_0xec036f=_0x563028['commands']['get']('showAIAssistant'),_0x23ac0d=_0x563028['plugins']['get'](a),_0x552a44=''+(_0x36e02e['groupId']!==K?_0x36e02e['groupLabel']+':\x20':'')+_0x36e02e['label'];if(!0x1!==_0x36e02e['requiresContent']&&_0x518e8f['isCollapsed']){const _0x3ac1a6=_0x31e7e6(_0x518e8f['getSelectedBlocks']())||_0x563028['model']['schema']['getLimitElement'](_0x518e8f);_0x563028['model']['change'](_0x2cec4f=>{_0x2cec4f['setSelection'](_0x3ac1a6,'in');});}_0x23ac0d['showFakeVisualSelection'](),_0xec036f['execute'](_0x36e02e['prompt'],_0x552a44,'command:'+_0xa82d69);}['_populateMenuBarMenu'](_0x25589b,_0x153d34,_0x30ec65,_0x57ae8c){const _0x1c2a12=this['editor'],_0x15eedf=_0x1c2a12['locale'],_0x5befc1=new _0x229224(_0x15eedf),_0x5974c4=U(_0x1c2a12,_0x30ec65)['filter'](_0x5ab25a=>_0x5ab25a['commands']['length']);0x1===_0x5974c4['length']?this['_getMenuBarGroupButtons']({'command':_0x25589b,'commands':_0x5974c4[0x0]['commands'],'parentMenuView':_0x153d34,'onExecute':_0x57ae8c})['forEach'](_0x1869fa=>_0x5befc1['items']['add'](_0x1869fa)):_0x5974c4['forEach'](({groupId:_0xc5759b,groupLabel:_0x39e5fb,commands:_0xee1c32})=>{const _0x4163f6=new _0x375214(_0x15eedf,_0x153d34),_0x1175ad=new _0x242bb6(_0x15eedf),_0x235d40=new _0x229224(_0x15eedf),_0x95dee9=this['_getMenuBarGroupButtons']({'command':_0x25589b,'commands':_0xee1c32,'parentMenuView':_0x1175ad,'onExecute':_0x57ae8c});_0x1175ad['buttonView']['set']({'label':_0x39e5fb||_0xc5759b}),_0x1175ad['delegate']('execute')['to'](_0x153d34),_0x235d40['items']['addMany'](_0x95dee9),_0x1175ad['panelView']['children']['add'](_0x235d40),_0x4163f6['children']['add'](_0x1175ad),_0x5befc1['items']['add'](_0x4163f6);}),_0x153d34['panelView']['children']['add'](_0x5befc1);}['_getMenuBarGroupButtons']({command:_0x1aeef7,commands:_0x55f80f,parentMenuView:_0x387550,onExecute:_0x39a53c}){const _0x480809=this['editor'],_0x14b027=_0x480809['locale'];return U(_0x480809,_0x55f80f)['map'](_0x17d11e=>{const _0x535aff=new _0x375214(_0x14b027,_0x387550),_0x29893e=new _0x2e85ef(_0x14b027);return _0x29893e['set']({'label':_0x17d11e['label']}),_0x29893e['delegate']('execute')['to'](_0x387550),_0x29893e['on']('execute',()=>_0x39a53c(_0x17d11e['id'])),_0x29893e['bind']('isEnabled')['to'](_0x1aeef7,'enabledCommandsIds',_0x5bdb5f=>_0x5bdb5f['includes'](_0x17d11e['id'])),_0x535aff['children']['add'](_0x29893e),_0x535aff;});}}function T(_0x508e41,_0x27e8da){return void 0x0!==_0x508e41['order']&&void 0x0===_0x27e8da['order']?0x1:void 0x0===_0x508e41['order']&&void 0x0!==_0x27e8da['order']?-0x1:void 0x0!==_0x508e41['order']&&void 0x0!==_0x27e8da['order']?_0x508e41['order']-_0x27e8da['order']:0x0;}function U(_0x387d4b,_0x24d2ee){_0x24d2ee['sort'](T);const _0x4a3863={},_0x426538=[];for(const _0x5ccc25 of _0x24d2ee)if(void 0x0!==_0x5ccc25['order']){if(_0x5ccc25['order']in _0x4a3863)throw new _0x52e74e('ai-commands-config-order-collision',_0x387d4b,{'conflictingDefinitions':[_0x5ccc25,_0x4a3863[_0x5ccc25['order']]]});_0x4a3863[_0x5ccc25['order']]=_0x5ccc25,_0x426538['splice'](_0x5ccc25['order'],0x0,_0x5ccc25);}else _0x426538['push'](_0x5ccc25);return _0x426538;}class At extends _0x384ca4{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2f1214){super(_0x2f1214);const _0x3fa262=_0x2f1214['config'],_0x59d0cb=_0x2f1214['locale'];_0x3fa262['define']('ai.aiAssistant.preserveComments',!0x0),_0x3fa262['define']('ai.aiAssistant.commands',_t(_0x59d0cb)),_0x3fa262['define']('ai.aiAssistant.extraCommandGroups',[]),_0x3fa262['define']('ai.aiAssistant.removeCommands',[]);let _0x5cdc44=o(_0x3fa262['get']('ai.aiAssistant.commands'),_0x59d0cb);const _0x19dbe6=_0x3fa262['get']('ai.aiAssistant.extraCommandGroups'),_0x2fcae2=_0x3fa262['get']('ai.aiAssistant.removeCommands');_0x19dbe6['forEach'](_0x150b73=>{const _0x1dd496=_0x5cdc44['find'](_0x50b984=>_0x50b984['groupId']===_0x150b73['groupId']);_0x1dd496?_0x1dd496['commands']=_0x1dd496['commands']['concat'](_0x150b73['commands']):_0x5cdc44['push'](_0x150b73);}),_0x5cdc44=_0x5cdc44['filter'](_0x378355=>!_0x2fcae2['includes'](_0x378355['groupId'])),_0x5cdc44['forEach'](_0x2871a5=>{_0x2871a5['commands']=_0x2871a5['commands']['filter'](_0x1abd50=>!_0x2fcae2['includes'](_0x1abd50['id']));}),_0x3fa262['set']('ai.aiAssistant.commands',_0x5cdc44);}}function _t(_0x1c9930){return[{'groupId':'editOrReview','groupLabel':i(_0x1c9930,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x1c9930,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x1c9930,'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(_0x1c9930,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x1c9930,'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(_0x1c9930,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x1c9930,'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(_0x1c9930,'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(_0x1c9930,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x1c9930,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x1c9930,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x1c9930,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x1c9930,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x1c9930,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x1c9930,'Change\x20style'),'commands':[{'id':'business','label':i(_0x1c9930,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x1c9930,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x1c9930,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x1c9930,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x1c9930,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x1c9930,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x1c9930,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x1c9930,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x1c9930,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x1c9930,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x1c9930,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x1c9930,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x1c9930,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x384ca4{['abortController'];static get['requires'](){return[x];}constructor(_0x340dcf){super(_0x340dcf),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'](_0x14f4f6){return this['sendRequest'](_0x14f4f6)['catch'](_0x13e759=>{if(_0x13e759 instanceof R)return Promise['reject'](_0x13e759);if('AbortError'==_0x13e759['name'])return Promise['resolve']();throw console['error'](_0x13e759),new _0x52e74e('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x353b84,_0x3d3aa7){const _0x33e2b0=this['editor']['locale'],_0x15a7a0={'Content-Type':'application/json'};if('object'==typeof _0x353b84)Object['assign'](_0x15a7a0,_0x353b84);else{if(_0x353b84)try{const _0x4583b6=await _0x353b84(_0x3d3aa7);Object['assign'](_0x15a7a0,_0x4583b6);}catch{return Promise['reject'](new R(i(_0x33e2b0,'AI_ERROR_GET_HEADERS')));}}return _0x15a7a0;}async['_prepareRequestParameters'](_0x4bbfcb,_0x2727ae){const _0x44d87d=this['editor']['locale'];if('object'==typeof _0x4bbfcb)return _0x4bbfcb;try{return await _0x4bbfcb(_0x2727ae);}catch{return Promise['reject'](new R(i(_0x44d87d,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5ae8d1){super(_0x5ae8d1),_0x5ae8d1['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5ae8d1['config']['get']('ai.openAI.requestParameters')||_0x5ae8d1['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5ae8d1['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x5ae8d1['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x5ae8d1['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x483e76,context:_0x573f71,onData:_0x425457,actionId:_0x5dcb90}){const _0x3f1b3f=this['editor']['locale'],_0x23ea4e=await this['prepareMessages'](_0x483e76,_0x573f71,_0x5dcb90),_0x10f0aa=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5dcb90),_0x5e928e=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5dcb90),_0x553f78={'messages':_0x23ea4e,..._0x5e928e},_0x10fbb5={'method':'POST','headers':_0x10f0aa,'body':JSON['stringify'](_0x553f78),'signal':this['abortController']['signal']},_0x38d6df=await fetch(this['_apiUrl'],_0x10fbb5);if(_0x38d6df['ok'])return _0x5e928e['stream']?await this['_readStreamableResponse'](_0x38d6df,_0x425457):await this['_readStaticResponse'](_0x38d6df,_0x425457),Promise['resolve']();{const _0x48f1c6=await _0x38d6df['text']();return _0x48f1c6['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x3f1b3f,'AI_ERROR_CONTEXT_LENGTH'))):_0x48f1c6['includes']('Moderation')?Promise['reject'](new R(i(_0x3f1b3f,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x48f1c6));}}async['prepareMessages'](_0x1aee1f,_0x56c0b2,_0x40aa0d){let _0x22ab9b,_0x362cb9;return _0x56c0b2?(_0x22ab9b='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.',_0x362cb9='Instruction:\x0a'+_0x1aee1f+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x56c0b2):(_0x22ab9b='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.',_0x362cb9=_0x1aee1f),[{'role':'system','content':_0x22ab9b},{'role':'user','content':_0x362cb9}];}async['_readStreamableResponse'](_0x3ae9c8,_0x25f461){const _0x36cb89=_0x3ae9c8['body']['getReader'](),_0x20a59f=new TextDecoder();let _0x5a9339='',_0x5e1bfa='',_0x1da096='',_0x4ecba8=!0x1;for(;!_0x4ecba8;){const {done:_0x500259,value:_0x4b9876}=await _0x36cb89['read'](),_0x305dab=_0x5a9339+_0x20a59f['decode'](_0x4b9876);let _0x238641='';_0x4ecba8=_0x500259;try{_0x238641=this['_cleanUpData'](_0x305dab),_0x5a9339='';}catch{_0x5a9339=_0x305dab;continue;}_0x5e1bfa+=_0x238641,!_0x4ecba8&&this['_isBufferIncomplete'](_0x5e1bfa)||_0x5e1bfa&&(_0x1da096+=_0x5e1bfa,_0x5e1bfa='',_0x25f461(_0x1da096));}return Promise['resolve']();}async['_readStaticResponse'](_0x127e81,_0x44c2e9){return _0x44c2e9((await _0x127e81['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x310df5){const _0x36f40a=_0x310df5['split']('<')['length']!==_0x310df5['split']('>')['length'],_0x4e5285=_0x310df5['length']<0x1e;return _0x36f40a&&_0x4e5285;}['_cleanUpData'](_0x1a3d3e){return _0x1a3d3e['split'](/\n(?![^{]*\})/g)['map'](_0x4c8adf=>_0x4c8adf['replace']('data:\x20',''))['filter'](_0x4ae039=>_0x4ae039&&_0x4ae039['length']>0x0&&'[DONE]'!==_0x4ae039)['map'](_0x291b20=>{const {choices:_0x436222}=JSON['parse'](_0x291b20);if(_0x436222[0x0]?.['delta']?.['content'])return _0x436222[0x0]['delta']['content'];})['filter'](_0x111487=>_0x111487)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x4cc182){super(_0x4cc182),_0x4cc182['config']['get']('ai.aws.requestParameters')||_0x4cc182['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']=_0x4cc182['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x4cc182['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x4cc182['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x4cc182['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0xaadde,context:_0x744db8,onData:_0x42d755,actionId:_0x8614fb}){const {model:_0x487a8a,stream:_0xeaf3e2,..._0x56144a}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x8614fb),_0x55ec89={'prompt':await this['preparePrompt'](_0xaadde,_0x744db8,_0x487a8a,_0x8614fb),..._0x56144a};this['_apiUrl']?await this['_processProxyRequest'](_0x55ec89,_0x487a8a,_0xeaf3e2,_0x42d755,_0x8614fb):await this['_processAWSRequest'](_0x55ec89,_0x487a8a,_0xeaf3e2,_0x42d755);}async['preparePrompt'](_0x11b17a,_0x4835a2,_0x25aef7,_0x345aec){let _0x33feb4,_0x47297d;return _0x4835a2?(_0x33feb4='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.',_0x47297d='Instruction:\x0a'+_0x11b17a+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4835a2):(_0x33feb4='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.',_0x47297d=_0x11b17a),'meta.llama'==this['getModelFamily'](_0x25aef7)?'<<SYS>>\x0a'+_0x33feb4+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x47297d+'\x0a[/INST]':'Human:\x0a'+_0x33feb4+'\x0a'+_0x47297d+'\x0a\x0aAssistant:';}['getModelFamily'](_0x1c96b5){if(/^anthropic\.claude/['test'](_0x1c96b5))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x1c96b5))return'ai21.j2';if(/^cohere\.command/['test'](_0x1c96b5))return'cohere.command';if(/^meta\.llama/['test'](_0x1c96b5))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x1c96b5));}async['_processProxyRequest'](_0xd484f8,_0x47c9d0,_0x152ce3,_0x5cde2f,_0xde1c15){const _0x252e42={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xde1c15),'body':JSON['stringify']({..._0xd484f8,'model':_0x47c9d0,'stream':_0x152ce3}),'signal':this['abortController']['signal']},_0xa128b6=await fetch(this['_apiUrl'],_0x252e42);_0x152ce3?await this['_readStreamableResponse'](_0xa128b6,_0x47c9d0,_0x5cde2f):await this['_readStaticResponse'](_0xa128b6,_0x47c9d0,_0x5cde2f);}async['_processAWSRequest'](_0xd99952,_0x5d2092,_0x120e5b,_0x10a2f3){const _0x18b3bc=new _0xe076f4(this['_bedrockClientConfig']),_0x230038={'body':JSON['stringify'](_0xd99952),'contentType':'application/json','accept':'application/json','modelId':_0x5d2092};let _0x2ae6db;if(_0x120e5b){const _0x1a88ea=new _0x57dd39(_0x230038);_0x2ae6db=await _0x18b3bc['send'](_0x1a88ea,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x2ae6db,_0x5d2092,_0x10a2f3);}else{const _0x121d9=new _0x2a85c4(_0x230038);_0x2ae6db=await _0x18b3bc['send'](_0x121d9,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x2ae6db,_0x5d2092,_0x10a2f3);}}async['_readAsyncIterableResponse'](_0xcda56d,_0x463dc9,_0x133426){const _0x24347d=_0xcda56d['body'],_0x2451c5=new TextDecoder('utf-8');let _0x245405='';for await(const _0x5aee53 of _0x24347d)if(_0x5aee53['chunk']){const _0x501f8a=_0x2451c5['decode'](_0x5aee53['chunk']['bytes']),_0x2a5aa5=JSON['parse'](_0x501f8a);_0x245405+=this['_getGeneratedText'](_0x2a5aa5,_0x463dc9),_0x133426(_0x245405);}return Promise['resolve']();}async['_readStreamableResponse'](_0x349dc4,_0x2511d3,_0x292876){const _0x362043=_0x349dc4['body'],_0x5e440f=new TextDecoder('utf-8'),_0x4fbec7=_0x362043['getReader']();let _0x7e32a7='',_0x3727b1='',_0x5ee2fc=!0x1;for(;!_0x5ee2fc;){const {done:_0x1da717,value:_0x471847}=await _0x4fbec7['read']();if(_0x5ee2fc=_0x1da717,_0x5ee2fc)break;const _0x3c4566=(_0x7e32a7+_0x5e440f['decode'](_0x471847))['split']('\x0a')['map'](_0x50c896=>{try{return _0x7e32a7='',JSON['parse'](_0x50c896);}catch{return _0x7e32a7=_0x50c896,null;}})['filter'](_0x20922a=>null!==_0x20922a);_0x3c4566['length']&&(_0x3727b1+=_0x3c4566['map'](_0x145e92=>this['_getGeneratedText'](_0x145e92,_0x2511d3))['join'](''),_0x292876(_0x3727b1));}return Promise['resolve']();}async['_readStaticResponse'](_0x1965a1,_0x5c42f5,_0x1a817f){let _0x18d312;return _0x18d312=_0x1965a1 instanceof Response?await _0x1965a1['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x1965a1['body'])),(_0x1a817f(this['_getGeneratedText'](_0x18d312,_0x5c42f5)),Promise['resolve']());}['_getGeneratedText'](_0x1f0540,_0x493e86){switch(this['getModelFamily'](_0x493e86)){case'anthropic.claude':return _0x1f0540['completion'];case'ai21.j2':return _0x1f0540['completions'][0x0]['data']['text'];case'cohere.command':return _0x1f0540['generations'][0x0]['text'];case'meta.llama':return _0x1f0540['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 _0x2c3381,Command as _0x1120f0}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x41d101,IconCheck as _0x544974,IconError as _0xafb196,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x4a0497,IconRobotPencil as _0x58695c}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x1982b2,CKEditorError as _0x276da2,ObservableMixin as _0x351208,global as _0x2c30c6,isVisible as _0x5404f2,Rect as _0x3bc612,Collection as _0x4ede85,FocusTracker as et,KeystrokeHandler as rt,first as _0x368270}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x2b30ea,View as _0x5ed200,SpinnerView as _0x5dc5ec,IconView as _0xab6436,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x403ebe,createDropdown as _0x487bf1,addMenuToDropdown as _0xb1d64e,MenuBarMenuView as _0x1e7bec,MenuBarMenuListItemButtonView as _0x711b55,DialogViewPosition as _0x286907,MenuBarMenuListView as _0x630c13,MenuBarMenuListItemView as _0x42f907}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x47ed0e,ClipboardMarkersUtils as _0x1c4768}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x28182f,ViewDataTransfer as _0x5c1c87,ViewUpcastWriter as _0x3c1b2d,Matcher as _0x15d301}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x3c89b7,InvokeModelWithResponseStreamCommand as _0x121273,InvokeModelCommand as _0x1820ba}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x8dcbc7,_0x4c82c7){const _0x25cdad=(0x0,_0x4c82c7['t'])('Other');return _0x8dcbc7['length']?'groupId'in _0x8dcbc7[0x0]?_0x8dcbc7:[{'groupId':K,'groupLabel':_0x25cdad,'order':0x1/0x0,'commands':_0x8dcbc7}]:[{'groupId':K,'groupLabel':_0x25cdad,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x2c3381{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x16cabe}=this,_0x1f5316=['ck-fake-ai-selection'];_0x16cabe['config']['get']('ai.useTheme')&&_0x1f5316['push']('ck-ai-assistant-ui_theme'),_0x16cabe['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x1f5316,'priority':0xc}}),_0x16cabe['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x5ce918,{writer:_0x1c9ba9})=>{if(!_0x5ce918['markerRange']['isCollapsed'])return null;const _0x3a8064=_0x1c9ba9['createUIElement']('span');return _0x1c9ba9['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3a8064),_0x3a8064;}});}['afterInit'](){!async function(_0x356489){const _0x3312cd=_0x2cbf07([0x53,0x42,0x75,0x59,0x4e,0x36,0x66,0x57,0x6a,0x4b,0x4f,0x4d,0x73,0x51,0x35,0x69,0x56,0x74,0x6d,0x62,0x34,0x7a,0x46,0x67,0x6f,0x5a,0x6b,0x78,0x32,0x37,0x70,0x71,0x6c,0x44,0x65,0x48,0x43,0x61,0x76,0x72,0x63,0x47,0x50,0x49,0x33,0x38,0x58,0x4a,0x64,0x4c,0x52,0x31,0x55,0x6e,0x79,0x77,0x39,0x41,0x68,0x30,0x54,0x45]),_0x1a1b6a=0x3269ca38,_0x2e00e8=0x326ea6f0^_0x1a1b6a,_0x342083=window[_0x2cbf07([0x44,0x61,0x74,0x65])][_0x2cbf07([0x6e,0x6f,0x77])](),_0x10692b=_0x356489[_0x2cbf07([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x40103e=new window[(_0x2cbf07([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x35d723=>{_0x10692b[_0x2cbf07([0x6f,0x6e,0x63,0x65])](_0x2cbf07([0x72,0x65,0x61,0x64,0x79]),_0x35d723);}),_0x3dd6ce={[_0x2cbf07([0x6b,0x74,0x79])]:_0x2cbf07([0x45,0x43]),[_0x2cbf07([0x75,0x73,0x65])]:_0x2cbf07([0x73,0x69,0x67]),[_0x2cbf07([0x63,0x72,0x76])]:_0x2cbf07([0x50,0x2d,0x32,0x35,0x36]),[_0x2cbf07([0x78])]:_0x2cbf07([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]),[_0x2cbf07([0x79])]:_0x2cbf07([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]),[_0x2cbf07([0x61,0x6c,0x67])]:_0x2cbf07([0x45,0x53,0x32,0x35,0x36])},_0x47226f=_0x10692b[_0x2cbf07([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2cbf07([0x67,0x65,0x74])](_0x2cbf07([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x1643b8(){let _0x19b852,_0x50ab4e=null,_0x142a92=null;try{if(_0x47226f==_0x2cbf07([0x47,0x50,0x4c]))return _0x2cbf07([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x19b852=_0x59bf4f(),!_0x19b852)return _0x2cbf07([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x19b852[_0x2cbf07([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x142a92=_0x29b3a0(_0x19b852[_0x2cbf07([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x19b852[_0x2cbf07([0x6a,0x74,0x69])])),await _0x24721c()?_0x44864c()?_0x73ada8()?_0x2cbf07([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xd525f8()?(_0x19b852[_0x2cbf07([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2cbf07([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x50ab4e=_0x14e250(_0x2cbf07([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x19b852[_0x2cbf07([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2cbf07([0x74,0x72,0x69,0x61,0x6c])&&(_0x50ab4e=_0x14e250(_0x2cbf07([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3352cf()):_0x2cbf07([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2cbf07([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2cbf07([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x2cbf07([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x73ada8(){const _0x3cb6ad=[_0x2cbf07([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2cbf07([0x74,0x72,0x69,0x61,0x6c])][_0x2cbf07([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x19b852[_0x2cbf07([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x342083/0x3e8:0xe10*_0x2e00e8;return _0x19b852[_0x2cbf07([0x65,0x78,0x70])]<_0x3cb6ad;}function _0x44864c(){const _0x5618b0=_0x19b852[_0x2cbf07([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x5618b0&&(!!_0x5618b0[_0x2cbf07([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2cbf07([0x2a]))||!!_0x5618b0[_0x2cbf07([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2cbf07([0x41,0x49])));}function _0xd525f8(){const _0x7f313d=_0x19b852[_0x2cbf07([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x7f313d||0x0==_0x7f313d[_0x2cbf07([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x5aae01}=new URL(window[_0x2cbf07([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x7f313d[_0x2cbf07([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5aae01))return!0x0;const _0x16f494=_0x5aae01[_0x2cbf07([0x73,0x70,0x6c,0x69,0x74])](_0x2cbf07([0x2e]));return _0x7f313d[_0x2cbf07([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2e29a4=>_0x2e29a4[_0x2cbf07([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2cbf07([0x2a])))[_0x2cbf07([0x6d,0x61,0x70])](_0x5d4577=>_0x5d4577[_0x2cbf07([0x73,0x70,0x6c,0x69,0x74])](_0x2cbf07([0x2e])))[_0x2cbf07([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5928e2=>_0x5928e2[_0x2cbf07([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x16f494[_0x2cbf07([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2cbf07([0x6d,0x61,0x70])](_0x1f7db3=>Array(_0x16f494[_0x2cbf07([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x1f7db3[_0x2cbf07([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2cbf07([0x66,0x69,0x6c,0x6c])](_0x1f7db3[0x0]===_0x2cbf07([0x2a])?_0x2cbf07([0x2a]):'')[_0x2cbf07([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x1f7db3))[_0x2cbf07([0x73,0x6f,0x6d,0x65])](_0x3632a4=>_0x16f494[_0x2cbf07([0x65,0x76,0x65,0x72,0x79])]((_0x4c5d46,_0x258008)=>_0x3632a4[_0x258008]===_0x4c5d46||_0x3632a4[_0x258008]===_0x2cbf07([0x2a])));}function _0x3352cf(){return _0x50ab4e&&_0x142a92?new window[(_0x2cbf07([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2dd11e,_0x451a11)=>{_0x50ab4e[_0x2cbf07([0x74,0x68,0x65,0x6e])](_0x2dd11e,_0x451a11),_0x142a92[_0x2cbf07([0x74,0x68,0x65,0x6e])](_0x390fb9=>{_0x390fb9!=_0x2cbf07([0x56,0x61,0x6c,0x69,0x64])&&_0x2dd11e(_0x390fb9);},_0x451a11);}):_0x50ab4e||_0x142a92||_0x2cbf07([0x56,0x61,0x6c,0x69,0x64]);}}function _0x29b3a0(_0x1657a5,_0x4158ef){return new window[(_0x2cbf07([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xab844a=>{if(_0x2b03ba())return _0xab844a(_0x2cbf07([0x56,0x61,0x6c,0x69,0x64]));_0x327227(),_0x10692b[_0x2cbf07([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2cbf07([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x142071=!0x1;const _0x31d18e=_0x1982b2();function _0x3046aa(_0x41bec4){return!!_0x41bec4&&(typeof _0x41bec4===_0x2cbf07([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x41bec4===_0x2cbf07([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x41bec4[_0x2cbf07([0x74,0x68,0x65,0x6e])]===_0x2cbf07([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x41bec4[_0x2cbf07([0x63,0x61,0x74,0x63,0x68])]===_0x2cbf07([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2903e7(_0x5b5548){_0x37c48c(_0x5b5548)[_0x2cbf07([0x74,0x68,0x65,0x6e])](_0x37dd81=>{if(!_0x37dd81||_0x37dd81[_0x2cbf07([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2cbf07([0x6f,0x6b]))return _0x2cbf07([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4b05a1(_0x5d5de2(_0x31d18e+_0x4158ef))!=_0x37dd81[_0x2cbf07([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2cbf07([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2cbf07([0x56,0x61,0x6c,0x69,0x64]);})[_0x2cbf07([0x74,0x68,0x65,0x6e])](_0x3af4ff=>(_0x4f3f10(),_0x3af4ff),()=>{const _0x48e950=_0x3c0c23();return null==_0x48e950?(_0x4f3f10(),_0x2cbf07([0x56,0x61,0x6c,0x69,0x64])):_0x2cbf07(_0x342083-_0x48e950>(0x16654e38^_0x1a1b6a)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2cbf07([0x74,0x68,0x65,0x6e])](_0xab844a)[_0x2cbf07([0x63,0x61,0x74,0x63,0x68])](()=>{_0xab844a(_0x2cbf07([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x3ab4ff=0x325f24b8^_0x1a1b6a;function _0x4f3f10(){const _0x33457c=_0x2cbf07([0x6c,0x6c,0x63,0x74,0x2d])+_0x4b05a1(_0x5d5de2(_0x1657a5)),_0xadf419=_0x7526f(_0x4b05a1(window[_0x2cbf07([0x4d,0x61,0x74,0x68])][_0x2cbf07([0x63,0x65,0x69,0x6c])](_0x342083/_0x3ab4ff)));window[_0x2cbf07([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2cbf07([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x33457c,_0xadf419);}function _0x3c0c23(){const _0x25df34=_0x2cbf07([0x6c,0x6c,0x63,0x74,0x2d])+_0x4b05a1(_0x5d5de2(_0x1657a5)),_0x18bcae=window[_0x2cbf07([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2cbf07([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x25df34);return _0x18bcae?window[_0x2cbf07([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x7526f(_0x18bcae),0x10)*_0x3ab4ff:null;}function _0x37c48c(_0x500737){return new window[(_0x2cbf07([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x255e13,_0x34aa6c)=>{_0x500737[_0x2cbf07([0x74,0x68,0x65,0x6e])](_0x255e13,_0x34aa6c),window[_0x2cbf07([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x34aa6c,0x32681ef8^_0x1a1b6a);});}}_0x10692b[_0x2cbf07([0x6f,0x6e])](_0x2cbf07([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0xf6d657,_0x3aa117)=>{if(_0x3aa117[0x0]!=_0x1657a5)return _0xab844a(_0x2cbf07([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3aa117[0x1]={..._0x3aa117[0x1],[_0x2cbf07([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x31d18e};},{[_0x2cbf07([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2cbf07([0x68,0x69,0x67,0x68])}),_0x10692b[_0x2cbf07([0x6f,0x6e])](_0x2cbf07([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3b28e3=>{_0x3046aa(_0x3b28e3[_0x2cbf07([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x142071=!0x0,_0x2903e7(_0x3b28e3[_0x2cbf07([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2cbf07([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2cbf07([0x6c,0x6f,0x77])}),_0x40103e[_0x2cbf07([0x74,0x68,0x65,0x6e])](()=>{_0x142071||_0xab844a(_0x2cbf07([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x2b03ba(){return _0x10692b[_0x2cbf07([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2cbf07([0x76,0x69,0x65,0x77])][_0x2cbf07([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2cbf07([0x61,0x75,0x74,0x6f]);}function _0x327227(){_0x10692b[_0x2cbf07([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2cbf07([0x76,0x69,0x65,0x77])][_0x2cbf07([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2cbf07([0x61,0x75,0x74,0x6f]);}}function _0x14e250(_0x3d1b37){const _0x44eb39=[new window[(_0x2cbf07([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x25cbb1=>setTimeout(_0x25cbb1,0x3260f4f4^_0x1a1b6a)),_0x40103e[_0x2cbf07([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2cbf07([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5c7893=>{let _0x2d8b0e=0x0;_0x10692b[_0x2cbf07([0x6d,0x6f,0x64,0x65,0x6c])][_0x2cbf07([0x6f,0x6e])](_0x2cbf07([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xe2a4de,_0x2567b8)=>{_0x2567b8[0x0][_0x2cbf07([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x2d8b0e++,_0x2d8b0e==(0x3269cbc0^_0x1a1b6a)&&(_0x5c7893(),_0xe2a4de[_0x2cbf07([0x6f,0x66,0x66])]());});}))];return window[_0x2cbf07([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2cbf07([0x72,0x61,0x63,0x65])](_0x44eb39)[_0x2cbf07([0x74,0x68,0x65,0x6e])](()=>_0x3d1b37);}async function _0x1b0b07(){await _0x40103e,_0x10692b[_0x2cbf07([0x6d,0x6f,0x64,0x65,0x6c])][_0x2cbf07([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x24babd,_0x10692b[_0x2cbf07([0x6d,0x6f,0x64,0x65,0x6c])][_0x2cbf07([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x24babd,_0x10692b[_0x2cbf07([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2cbf07([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5f5038(_0xd2901d){const _0xbb51f5=_0x42de06();_0x10692b[_0xbb51f5]=_0x2cbf07([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0xd2901d,_0xd2901d!=_0x2cbf07([0x56,0x61,0x6c,0x69,0x64])&&_0x1b0b07();}function _0x42de06(){const _0x14920c=window[_0x2cbf07([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2cbf07([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2cbf07([0x6e,0x6f,0x77])]())[_0x2cbf07([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2cbf07([0x2e]),'');let _0x19168d=_0x2cbf07([0x53]);for(let _0x4fd143=0x0;_0x4fd143<_0x14920c[_0x2cbf07([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4fd143+=0x2){let _0x12459e=window[_0x2cbf07([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x14920c[_0x2cbf07([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4fd143,_0x4fd143+0x2));_0x12459e>=_0x3312cd[_0x2cbf07([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x12459e-=_0x3312cd[_0x2cbf07([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x19168d+=_0x3312cd[_0x12459e];}return _0x19168d;}function _0x59bf4f(){const _0x2d7e0c=_0x47226f[_0x2cbf07([0x73,0x70,0x6c,0x69,0x74])](_0x2cbf07([0x2e]));if(0x3!=_0x2d7e0c[_0x2cbf07([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x19af82(_0x2d7e0c[0x1]);function _0x19af82(_0xdfff2e){const _0x419433=_0x387a84(_0xdfff2e);return _0x419433&&_0x1d719b()?_0x419433:null;function _0x1d719b(){const _0x29b327=_0x419433[_0x2cbf07([0x6a,0x74,0x69])],_0x591f68=window[_0x2cbf07([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x29b327[_0x2cbf07([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x29b327[_0x2cbf07([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x1d6621={..._0x419433,[_0x2cbf07([0x6a,0x74,0x69])]:_0x29b327[_0x2cbf07([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x29b327[_0x2cbf07([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x1d6621[_0x2cbf07([0x76,0x63])],_0x5d5de2(_0x1d6621)==_0x591f68;}}}async function _0x24721c(){let _0xb34bdb=!0x0;try{const _0x43d49d=_0x47226f[_0x2cbf07([0x73,0x70,0x6c,0x69,0x74])](_0x2cbf07([0x2e])),[_0x23ceb6,_0x1a9196,_0x496e24]=_0x43d49d;return _0x106205(_0x23ceb6),await _0x31c6e0(_0x23ceb6,_0x1a9196,_0x496e24),_0xb34bdb;}catch{return!0x1;}function _0x106205(_0x54aab0){const _0x465371=_0x387a84(_0x54aab0);_0x465371&&_0x465371[_0x2cbf07([0x61,0x6c,0x67])]==_0x2cbf07([0x45,0x53,0x32,0x35,0x36])||(_0xb34bdb=!0x1);}async function _0x31c6e0(_0x5f101e,_0x5d1e65,_0x3640fd){const _0x215ea8=window[_0x2cbf07([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2cbf07([0x66,0x72,0x6f,0x6d])](_0x542a6f(_0x3640fd),_0x43945e=>_0x43945e[_0x2cbf07([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4bce1c=new window[(_0x2cbf07([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2cbf07([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5f101e+_0x2cbf07([0x2e])+_0x5d1e65),_0x3d80ce=window[_0x2cbf07([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2cbf07([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x3d80ce)return;const _0x139201=await _0x3d80ce[_0x2cbf07([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2cbf07([0x6a,0x77,0x6b]),_0x3dd6ce,{[_0x2cbf07([0x6e,0x61,0x6d,0x65])]:_0x2cbf07([0x45,0x43,0x44,0x53,0x41]),[_0x2cbf07([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2cbf07([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2cbf07([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x3d80ce[_0x2cbf07([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2cbf07([0x6e,0x61,0x6d,0x65])]:_0x2cbf07([0x45,0x43,0x44,0x53,0x41]),[_0x2cbf07([0x68,0x61,0x73,0x68])]:{[_0x2cbf07([0x6e,0x61,0x6d,0x65])]:_0x2cbf07([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x139201,_0x215ea8,_0x4bce1c)||(_0xb34bdb=!0x1);}}function _0x387a84(_0x1b2dda){return _0x1b2dda[_0x2cbf07([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2cbf07([0x65,0x79]))?JSON[_0x2cbf07([0x70,0x61,0x72,0x73,0x65])](_0x542a6f(_0x1b2dda)):null;}function _0x542a6f(_0xd9f319){return window[_0x2cbf07([0x61,0x74,0x6f,0x62])](_0xd9f319[_0x2cbf07([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2cbf07([0x2b]))[_0x2cbf07([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2cbf07([0x2f])));}function _0x5d5de2(_0x2434d3){let _0x21df7c=0x1505;function _0x2b3fd3(_0x5e3149){for(let _0x4f0360=0x0;_0x4f0360<_0x5e3149[_0x2cbf07([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4f0360++){const _0x1f460e=_0x5e3149[_0x2cbf07([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4f0360);_0x21df7c=(_0x21df7c<<0x5)+_0x21df7c+_0x1f460e,_0x21df7c&=_0x21df7c;}}function _0x281738(_0x1f00f1){Array[_0x2cbf07([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x1f00f1)?_0x1f00f1[_0x2cbf07([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x281738):_0x1f00f1&&typeof _0x1f00f1==_0x2cbf07([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2cbf07([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x1f00f1)[_0x2cbf07([0x73,0x6f,0x72,0x74])]()[_0x2cbf07([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0xec9c6d,_0x4c8634])=>{_0x2b3fd3(_0xec9c6d),_0x281738(_0x4c8634);}):_0x2b3fd3(window[_0x2cbf07([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x1f00f1));}return _0x281738(_0x2434d3),_0x21df7c>>>0x0;}function _0x4b05a1(_0x2f109e){return _0x2f109e[_0x2cbf07([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2cbf07([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2cbf07([0x30]));}function _0x7526f(_0x49968f){return _0x49968f[_0x2cbf07([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2cbf07([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2cbf07([0x6a,0x6f,0x69,0x6e])]('');}function _0x24babd(){}function _0x2cbf07(_0x333ff6){return _0x333ff6['map'](_0x402af6=>String['fromCharCode'](_0x402af6))['join']('');}_0x5f5038(await _0x1643b8());}(this);}['showFakeVisualSelection'](){const _0x41956d=this['editor']['model'];_0x41956d['change'](_0x1db4e7=>{const _0x57efa4=_0x41956d['document']['selection']['getRanges']();let _0x236e59=0x0;for(const _0x1c1008 of _0x57efa4){const _0x2a5dd7=w+':'+_0x236e59;if(_0x41956d['markers']['has'](_0x2a5dd7))_0x1db4e7['updateMarker'](_0x2a5dd7,{'range':_0x1c1008});else{if(_0x1c1008['start']['isAtEnd']){const _0x37af54=_0x1c1008['start']['getLastMatchingPosition'](({item:_0x52d809})=>!_0x41956d['schema']['isContent'](_0x52d809),{'boundaries':_0x1c1008});_0x1db4e7['addMarker'](_0x2a5dd7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1db4e7['createRange'](_0x37af54,_0x1c1008['end'])});}else _0x1db4e7['addMarker'](_0x2a5dd7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1c1008});}_0x236e59++;}});}['hideFakeVisualSelection'](){const _0x581e1e=this['editor']['model'],_0x434114=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x434114['length']&&_0x581e1e['change'](_0x529266=>{_0x434114['forEach'](_0x2dca18=>{_0x529266['removeMarker'](_0x2dca18);});});}['insertContent'](_0x4cf9d5,_0x3ebfaa){const _0x50ff4e=this['_getAISelection'](),_0x132284=_0x3ebfaa||_0x50ff4e['getFirstRange']();this['editor']['model']['canEditAt'](_0x132284)&&this['editor']['model']['change'](_0x1a3e24=>{this['hideFakeVisualSelection'](),_0x3ebfaa||this['_resetContentOfSelectedTableCells'](_0x1a3e24,_0x50ff4e),this['_pasteHTMLUsingClipboard']({'insertAt':_0x132284,'writer':_0x1a3e24,'html':_0x4cf9d5});});}['insertContentBelow'](_0x3866df){const {model:_0x480ab7}=this['editor'],_0x2890e7=this['_getAISelection']();_0x480ab7['change'](()=>{const _0x15286b=this['_prepareTableInsertBelowPosition'](_0x3866df,_0x2890e7)||this['_getDefaultInsertBelowPosition'](_0x2890e7);this['insertContent'](_0x3866df,_0x15286b);});}['_getAISelection'](){const _0x188c72=this['editor']['model'],_0x5a30c6=Array['from'](_0x188c72['markers']['getMarkersGroup'](w))['map'](_0x50c940=>_0x50c940['getRange']());return _0x188c72['createSelection'](_0x5a30c6);}['_pasteHTMLUsingClipboard']({writer:_0x35deb3,html:_0x5a26e3,insertAt:_0x5831a6}){const {view:_0x36e164}=this['editor']['editing'],_0x177c46=this['editor']['plugins']['get'](_0x47ed0e),_0x2096ca=new gt();_0x2096ca['setData']('text/html',_0x5a26e3);const _0x462b1a=new ClipboardEvent('paste',{'clipboardData':_0x2096ca}),_0x35abad=new _0x28182f(_0x36e164,_0x462b1a,{'dataTransfer':new _0x5c1c87(_0x2096ca)});_0x35deb3['setSelection'](_0x5831a6);const _0x1e24b=(_0x243e54,_0xc26e70)=>{_0xc26e70['resultRange']&&_0x35deb3['setSelection'](_0xc26e70['resultRange']);};_0x177c46['once']('contentInsertion',_0x1e24b,{'priority':'lowest'}),_0x36e164['document']['fire']('paste',_0x35abad),_0x177c46['off']('contentInsertion',_0x1e24b);}['_getDefaultInsertBelowPosition'](_0x37c33c){const {model:_0x36cb38}=this['editor'],_0x4b85eb=Array['from'](_0x37c33c['getSelectedBlocks']());return _0x4b85eb['length']?_0x36cb38['createPositionAfter'](_0x4b85eb['pop']()):_0x37c33c['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x39360c,_0x5b5f9d){const {model:_0x2016fc,plugins:_0x3b2a78}=this['editor'];if(_0x3b2a78['has']('TableUtils')){const _0x49d9c5=_0x3b2a78['get']('TableUtils')['getSelectedTableCells'](_0x5b5f9d);if(_0x49d9c5['length']){const _0x43e92a=this['_getTableRowCountFromContent'](_0x39360c),_0xafcbb7=this['_createEmptyTableRows'](_0x49d9c5,_0x43e92a);return _0x2016fc['createPositionAt'](_0xafcbb7,0x0);}}return null;}['_getTableRowCountFromContent'](_0x30d4bc){const _0x493b46=this['editor']['plugins']['get']('TableUtils'),_0x266f16=this['editor']['data']['parse'](_0x30d4bc),_0x3ac7f3=Array['from'](_0x266f16['getChildren']())['filter'](_0x16dcc5=>_0x16dcc5['is']('element','table'));let _0x308b24=0x0;return _0x3ac7f3['forEach'](_0x17c32e=>{_0x308b24+=_0x493b46['getRows'](_0x17c32e);}),_0x308b24;}['_createEmptyTableRows'](_0x7d407a,_0x51b378){const _0x32a34e=this['editor']['plugins']['get']('TableUtils'),_0xecaa0a=_0x32a34e['getRowIndexes'](_0x7d407a),_0x15c740=_0x32a34e['getColumnIndexes'](_0x7d407a),_0x3c809d=_0xecaa0a['last']+0x1,_0x2b4068=_0x15c740['first'],_0x350165=_0x7d407a[0x0]['findAncestor']('table');for(let _0x3ec5e3=0x0;_0x3ec5e3<_0x51b378;_0x3ec5e3++)_0x32a34e['insertRows'](_0x350165,{'at':_0x3c809d});return _0x350165['getChild'](_0x3c809d)['getChild'](_0x2b4068);}['_resetContentOfSelectedTableCells'](_0x39d002,_0x64646e){const {plugins:_0x5cc31e}=this['editor'],{model:_0x337698}=_0x39d002;if(!_0x5cc31e['has']('TableUtils'))return;_0x5cc31e['get']('TableUtils')['getSelectedTableCells'](_0x64646e)['length']&&_0x337698['deleteContent'](_0x64646e);}}class x extends _0x2c3381{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x276da2('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x40dbb4){super(_0x40dbb4),this['name']='AIRequestError';}}function i(_0x5bb153,_0x4739c5,_0x3be2eb){const t=_0x5bb153['t'];switch(_0x4739c5){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',_0x3be2eb);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3be2eb);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'},_0x3be2eb);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 _0x4739c5;}}class E extends _0x1120f0{['_commandDefinitions'];constructor(_0x388122,_0x4e65df){super(_0x388122),this['_commandDefinitions']=_0x4e65df,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3b903e,_0x213b06,_0xe66c9)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0xe66c9));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xc94d21,_0x1f632e,_0x37822b)=>{this['enabledCommandsIds']=_0x37822b?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2d544f=this['editor']['model'];this['_hasContext']=function(_0x3a47e4){const _0x132f69=_0x3a47e4['document']['selection'];return _0x132f69['isCollapsed']?0x0!==[..._0x132f69['getSelectedBlocks']()]['length']&&![..._0x132f69['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x3a47e4['hasContent'](_0x132f69['getFirstRange']());}(_0x2d544f);const _0x222975=_0x2d544f['document']['selection'],_0x5c0df8=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x15b73c of _0x222975['getRanges']())for(const _0x335109 of _0x15b73c['getItems']())if(_0x335109['is']('element')&&_0x5c0df8['includes'](_0x335109['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3a8ecb='',_0x29f9da='',_0x12921f='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x3a8ecb,_0x29f9da,_0x12921f);}}function F(_0xd78d01,_0x42791d){const _0x1f7d92=new Set();for(const _0x420575 of _0xd78d01['values']())(_0x42791d||!0x1===_0x420575['requiresContent'])&&_0x1f7d92['add'](_0x420575['id']);return Array['from'](_0x1f7d92);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x351208(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x54bdf7,_0x44d2fd,_0x5e89e8){super(),this['editor']=_0x54bdf7,this['textAdapter']=_0x44d2fd,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x5e89e8,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x281fb8,_0x2afe2d,_0x49b859)=>{this['view']['value']=this['_sanitizeHTML'](_0x49b859);}),this['listenTo'](this['view'],'submitPrompt',(_0x3294d3,_0x8481)=>{const _0x3157d6=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x8481,_0x3157d6,'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:_0x56f5c4,query:_0x5f37c7,htmlContent:_0x3e00d5,label:_0x3d7e28,mainActionLabel:_0x331c4d}){this['view']['prompt']=_0x3d7e28,this['view']['mainAction']=_0x331c4d,this['initialContext']=_0x3e00d5,_0x5f37c7&&(this['view']['isRendered']?this['_handleQuery'](_0x5f37c7,_0x3e00d5,_0x56f5c4,_0x3d7e28):this['view']['once']('render',()=>{this['_handleQuery'](_0x5f37c7,_0x3e00d5,_0x56f5c4,_0x3d7e28);}));}['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'](_0x5bd6f1,_0x2c91a0,_0x3e64ce,_0xf5c805){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2c91a0,this['previousQuery']=_0x5bd6f1,this['previousLabel']=_0xf5c805||_0x5bd6f1,this['previousActionId']=_0x3e64ce,new Promise(_0x27331e=>{this['textAdapter']['makeRequest']({'query':_0x5bd6f1,'context':_0x2c91a0,'onData':_0x363830=>{this['currentResponse']=_0x363830,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x3e64ce})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x171080=>{_0x171080 instanceof R?this['view']['handleError'](_0x171080['message']):this['view']['handleError'](),_0x27331e();})['finally'](()=>{this['stopProcessing'](),_0x27331e();});});}['_parseAndNormalizeContent'](_0x2ad985,_0x5c0d43=!0x1){const _0x5a3106=Q['exec'](_0x2ad985);_0x2ad985=_0x5a3106?_0x2ad985['substring'](_0x5a3106[0x1]['length']):_0x2ad985['length']<0x64&&!_0x5c0d43?'':this['_stripMarkdownSyntax'](_0x2ad985);const _0x82b845=this['_domParser']['parseFromString'](_0x2ad985,'text/html');if(_0x5a3106){const _0x4c2a66=Array['from'](_0x82b845['body']['childNodes']);_0x4c2a66['reverse']();for(const _0x7717e of _0x4c2a66){if(_0x7717e['nodeType']==Node['ELEMENT_NODE'])break;_0x7717e['remove']();}}const _0x37201b=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x82b845['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x37201b);const _0x589411=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x5a1380=this['editor']['data']['toModel'](_0x37201b);return _0x589411||_0x5a1380['markers']['clear'](),this['editor']['data']['stringify'](_0x5a1380);}['_normalizeResponseHeadings'](_0x5e7513){const _0x28a3da=new _0x3c1b2d(this['editor']['editing']['view']['document']),_0x48de36=new _0x15d301({'name':/^h[1-5]$/}),_0x22f050=[];let _0x5ec990=!0x1;for(const _0x571baf of _0x5e7513)_0x571baf['is']('element')&&_0x48de36['match'](_0x571baf)&&(_0x22f050['push'](_0x571baf),'h1'==_0x571baf['name']&&(_0x5ec990=!0x0));if(_0x5ec990){for(const _0x3978e6 of _0x22f050)_0x28a3da['rename']('h'+(parseInt(_0x3978e6['name'][0x1])+0x1),_0x3978e6);}}['_isH1TagSupportEnabled'](){const {data:_0x5b3f3d,editing:_0x12d690}=this['editor'],_0x2b60b6=_0x5b3f3d['htmlProcessor']['toView']('<h1></h1>'),_0x15211e=_0x5b3f3d['toView'](_0x5b3f3d['toModel'](_0x2b60b6));return!!_0x12d690['view']['domConverter']['viewToDom'](_0x15211e)['querySelector']('h1');}['_sanitizeHTML'](_0xc97469){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xc97469),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x16536a){const _0x4efdca=_0x16536a['trim']();return _0x4efdca['startsWith']('```html')?_0x4efdca['endsWith']('```')?_0x4efdca['substring'](0x7,_0x4efdca['length']-0x3):_0x4efdca['substring'](0x7):_0x16536a;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x425dc4){super(_0x425dc4),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x478b0d=>i(_0x425dc4,'AI_'+_0x478b0d['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x425dc4,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x425dc4,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x425dc4,'Stop'));const _0x2b17b0=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x2b17b0['if']('isVisible','ck-hidden',_0x1fdc2e=>!_0x1fdc2e)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x4486f8,_0x49eb88){const _0x51a9f5=new _0x2b30ea(this['locale']);return _0x51a9f5['set']({'label':_0x4486f8,'class':_0x49eb88||'','isVisible':!0x0,'withText':!0x0}),_0x51a9f5;}}class ct extends _0x5ed200{['contentFieldView'];['copyButtonView'];constructor(_0x1c7b0e,_0x125e7c=''){super(_0x1c7b0e),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5dd36c=this['bindTemplate'];this['contentFieldView']=new bt(_0x1c7b0e,_0x125e7c),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x5dd36c['if']('isVisible','ck-hidden',_0x6fc3d9=>!_0x6fc3d9)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x5dd36c['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 _0x53360a=!0x1;this['on']('change:value',(_0x14c9e9,_0x3a72a2,_0x4d3a30)=>{const _0x1f14ee=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x4d3a30),this['isProcessing']&&_0x1f14ee&&!_0x53360a&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1145dd,_0x2c8d53,_0x56b949)=>{_0x53360a=!0x1,_0x56b949?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x53360a=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x53360a=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x47fd56=this['locale'],_0x2d7127=new _0x2b30ea(this['locale']),_0x13d60b='ck-ai-form__copy-button';return _0x2d7127['set']({'label':i(_0x47fd56,'Copy'),'icon':_0x41d101,'class':_0x13d60b,'tooltip':!0x0}),_0x2d7127['bind']('isVisible')['to'](this,'value',_0x3acaea=>!!_0x3acaea),_0x2d7127['bind']('isEnabled')['to'](this,'isProcessing',_0x1c8e64=>!_0x1c8e64),_0x2d7127['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x2d7127['icon']=_0x544974,_0x2d7127['class']=_0x13d60b+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x2d7127['icon']=_0x41d101,_0x2d7127['class']=_0x13d60b;},0x3e8);}),_0x2d7127;}['_copyHTMLToClipboard'](_0x5f0911){const {window:_0x2ee2de,document:_0x343507}=_0x2c30c6;if(_0x2ee2de['ClipboardItem']){const {Blob:_0x4f1932,ClipboardItem:_0x51ce67}=_0x2ee2de,_0x4d5d6f=[new _0x51ce67({'text/html':new _0x4f1932([_0x5f0911['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4f1932([_0x5f0911['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x4d5d6f);}else{const _0x53fe13=_0x343507['createElement']('div');_0x53fe13['style']['position']='absolute',_0x53fe13['style']['left']='-9999px',_0x53fe13['innerHTML']='<span>[</span>'+_0x5f0911['innerHTML']+'<span>]</span>',_0x343507['body']['appendChild'](_0x53fe13);const _0x2dd9e0=_0x343507['createRange']();_0x2dd9e0['setStartAfter'](_0x53fe13['firstElementChild']),_0x2dd9e0['setEndBefore'](_0x53fe13['lastElementChild']);const _0xb20b7e=_0x2ee2de['getSelection']();_0xb20b7e['removeAllRanges'](),_0xb20b7e['addRange'](_0x2dd9e0),_0x343507['execCommand']('copy'),_0x53fe13['remove']();}}}class bt extends _0x5ed200{constructor(_0x69444d,_0x487767=''){super(_0x69444d),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x487767,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x29229b){this['element']['innerHTML']=_0x29229b;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4acc27=new _0x5ed200(),_0xe8eb7e=this['locale'],_0x399698=new _0x5dc5ec();return _0x399698['isVisible']=!0x0,_0x4acc27['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x399698,{'text':i(_0xe8eb7e,'AI\x20is\x20writing...')}]}),_0x4acc27['render'](),_0x4acc27;}}class mt extends _0x5ed200{constructor(_0x40e8f1,_0x29eaa9=''){super(_0x40e8f1);const _0x48257f=new _0xab6436(),_0x4dfd53=this['bindTemplate'];this['set']('text',_0x29eaa9),_0x48257f['content']=_0xafb196,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x48257f,{'text':_0x4dfd53['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x28c94b,_0x3f54d1){super(_0x28c94b,_0x3f54d1),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',(_0x54ecfd,_0x288c83)=>{_0x54ecfd['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x288c83());});}['_createSubmitButton'](){const _0x16f833=new _0x2b30ea(this['locale']),_0x57ddc4=this['locale'];return _0x16f833['set']({'icon':it,'label':i(_0x57ddc4,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x16f833['on']('execute',()=>{this['submit']();}),_0x16f833['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x262adf,_0x2777f3)=>!_0x262adf&&_0x2777f3),_0x16f833;}['_createShowHistoryButton'](){const _0x1d045a=new _0x2b30ea(this['locale']),_0x3307e6=this['resultsView'],_0x218348=this['locale'];_0x1d045a['set']({'label':i(_0x218348,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x1d045a['bind']('isOn')['to'](_0x3307e6,'isVisible'),_0x1d045a['bind']('isEnabled')['to'](this,'isEnabled'),_0x1d045a['on']('execute',()=>{_0x3307e6['isVisible']=!_0x3307e6['isVisible'],_0x3307e6['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5a28c2=()=>{_0x2c30c6['window']['requestAnimationFrame'](()=>{if(_0x5404f2(this['element'])){const _0x49f8f6=new _0x3bc612(this['queryView']['fieldView']['element']),_0x4cf71b=_0x49f8f6['width'],_0x2fb9d7='rtl'===_0x218348['uiLanguageDirection']?'left':'right';_0x49f8f6['excludeScrollbarsAndBorders'](),_0x1d045a['element']['style'][_0x2fb9d7]=_0x4cf71b-_0x49f8f6['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5a28c2),this['on']('render',_0x5a28c2),_0x1d045a;}['submit'](){const _0x537675=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x537675);}['focus'](_0x4732e4){-0x1===_0x4732e4?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x149d1f){super(_0x149d1f),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x149d1f,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4c1dc0=0x0;for(const _0x18ce24 of this['items'])_0x4c1dc0+=_0x18ce24['items']['length'];return{'resultsCount':_0x4c1dc0,'totalItemsCount':_0x4c1dc0};}['_createClearHistoryButton'](){const _0x4a1ff5=this['locale'],_0x34693b=new _0x2b30ea(this['locale']);return _0x34693b['set']({'label':'('+i(_0x4a1ff5,'Clear')+')','withText':!0x0}),_0x34693b['on']('execute',()=>this['fire']('clearHistory')),_0x34693b;}}class ut extends xt{constructor(_0x3844e6){super();const _0xe7e164=new wt(),_0x4f1133=new _0x2b30ea(this['locale'],_0xe7e164);this['children']['add'](_0x4f1133),_0x4f1133['set']({'label':_0x3844e6['prompt'],'withText':!0x0}),_0x4f1133['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x3844e6['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x4ede85{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x22cdbe,_0x3eb7ae)=>{const _0x2db4d9=os(_0x3eb7ae['prompt']);for(const _0x261204 of this)if(_0x261204!=_0x3eb7ae&&os(_0x261204['prompt'])===_0x2db4d9){this['remove'](_0x261204);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x3dc536=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x3dc536));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x4f8f44=>_0x4f8f44)));}}function os(_0x4f433d){return _0x4f433d['toLowerCase']()['trim']();}class k extends _0x5ed200{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x435bea,_0x534bc9,_0x5cb804=''){super(_0x435bea),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(_0x435bea),this['contentArea']=new ct(_0x435bea,_0x5cb804),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 _0x5d691d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x534bc9],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x5d691d['if']('isError','ck-hidden',_0x5afb5e=>!_0x5afb5e)]},'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'](_0x419cbc=0x1){-0x1===_0x419cbc?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 _0x1e775a=this['locale'],_0x50e478=new lt(_0x1e775a,{'queryView':{'label':i(_0x1e775a,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x1e775a,'Empty\x20history'),'secondary':i(_0x1e775a,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x50e478['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xb60a7c,_0x1a7f1d)=>_0xb60a7c&&!_0x1a7f1d),this['listenTo'](_0x50e478,'submit',(_0x59a30c,_0x22a71f)=>{this['prompt']=_0x22a71f;const _0x34926f=ft(_0x22a71f);this['fire']('submitPrompt',_0x34926f),_0x22a71f['trim']()&&this['_promptHistory']['add']({'prompt':_0x34926f},0x0);},{'priority':'high'}),_0x50e478;}['_createHistoryView'](){const _0x2e7f5d=new pt(this['locale']);return _0x2e7f5d['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x2e7f5d['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2e7f5d;}['_createToolbar'](){const _0x19cb11=new at(this['locale']);return _0x19cb11['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3a90ab,_0x330c50,_0x259265)=>_0x3a90ab&&!_0x330c50&&!!_0x259265),_0x19cb11['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x19cb11['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x454ed0,_0x5821fe,_0x3512c0)=>_0x454ed0&&!_0x5821fe&&!!_0x3512c0),_0x19cb11['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x19cb11['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x18af51,_0x22b1cc)=>_0x18af51&&!_0x22b1cc),_0x19cb11['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x19cb11['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x19cb11['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x19cb11;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x332264=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x332264,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x58b301){const _0x5a831f=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x58b301||i(_0x5a831f,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x2c3381{['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[_0x1c4768,a,x,_0x403ebe];}constructor(_0x3cf49f){super(_0x3cf49f),_0x3cf49f['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3cf49f['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x3cf49f['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3cf49f['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x20f7ab}=this;this['_aiAdapter']=_0x20f7ab['plugins']['get'](x),this['_dialog']=_0x20f7ab['plugins']['get'](_0x403ebe),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x531261=new E(_0x20f7ab,Array['from'](this['_commandDefinitions']['values']()));_0x20f7ab['commands']['add']('showAIAssistant',_0x531261),_0x20f7ab['ui']['componentFactory']['add']('aiCommands',_0xb85083=>{const _0x45e536=_0x487bf1(_0xb85083);return _0x45e536['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x45e536['buttonView']['set']({'label':i(_0xb85083,'AI\x20Commands'),'icon':_0x4a0497,'tooltip':!0x0}),_0x45e536['on']('execute',_0x4f5579=>this['_onExecute'](_0x4f5579['source']['id'])),_0xb1d64e(_0x45e536,_0x20f7ab['ui']['view']['body'],function(_0xc1ea31){const _0x3d2a7f=o(_0xc1ea31['config']['get']('ai.aiAssistant.commands'),_0xc1ea31['locale']),_0x4b450f=U(_0xc1ea31,_0x3d2a7f)['filter'](_0x363f24=>_0x363f24['commands']['length']);if(0x1===_0x4b450f['length'])return U(_0xc1ea31,_0x4b450f[0x0]['commands'])['map'](_0x5604e8=>({'id':_0x5604e8['id'],'label':_0x5604e8['label']}));return _0x4b450f['map'](_0x3c5c36=>{const {groupId:_0x3d5b76,groupLabel:_0x2e4a62,commands:_0x120c7e}=_0x3c5c36,_0x199f6a=U(_0xc1ea31,_0x120c7e)['map'](_0x30c54a=>({'id':_0x30c54a['id'],'label':_0x30c54a['label']}));return{'id':_0x3d5b76,'menu':_0x2e4a62||_0x3d5b76,'children':_0x199f6a};});}(_0x20f7ab),{'ariaLabel':i(_0xb85083,'AI\x20Commands')}),_0x45e536['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x531261['on']('change:enabledCommandsIds',_0x2af780),_0x45e536['menuView']['once']('render',_0x2af780),_0x45e536;function _0x2af780(){_0x45e536['isEnabled']=_0x531261['enabledCommandsIds']['length']>0x0;for(const _0x29bbd5 of _0x45e536['menuView']['buttons'])_0x29bbd5['isEnabled']=_0x531261['enabledCommandsIds']['includes'](_0x29bbd5['id']);}}),_0x20f7ab['ui']['componentFactory']['add']('menuBar:aiCommands',_0x1e7001=>{const _0x8e56ff=new _0x1e7bec(_0x1e7001);_0x8e56ff['buttonView']['set']({'label':i(_0x1e7001,'AI\x20Commands'),'icon':_0x4a0497}),_0x8e56ff['bind']('isEnabled')['to'](_0x531261,'enabledCommandsIds',_0x2984d7=>_0x2984d7['length']>0x0);const _0x105d7e=o(_0x20f7ab['config']['get']('ai.aiAssistant.commands'),_0x1e7001);return this['_populateMenuBarMenu'](_0x531261,_0x8e56ff,_0x105d7e,_0x6dc10a=>this['_onExecute'](_0x6dc10a)),_0x8e56ff;}),_0x20f7ab['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x10599a=this['_createAIAssistantUIButton'](_0x2b30ea);return _0x10599a['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x10599a;}),_0x20f7ab['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0xb25dec=this['_createAIAssistantUIButton'](_0x711b55);return _0xb25dec['set']({'role':'menuitemcheckbox'}),_0xb25dec;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4fdd13=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x23cc34;for(const _0x1c2684 in _0x4fdd13){const _0x406bf5=_0x1c2684,_0x186c5b=_0x4fdd13[_0x406bf5];if('aiLicenseKeyValid'==_0x186c5b||'aiLicenseKeyInvalid'==_0x186c5b||'aiLicenseKeyExpired'==_0x186c5b||'aiLicenseKeyDomainLimit'==_0x186c5b||'aiLicenseKeyNotAllowed'==_0x186c5b||'aiLicenseKeyEvaluationLimit'==_0x186c5b||'aiLicenseKeyTrialLimit'==_0x186c5b||'aiLicenseKeyUsageLimit'==_0x186c5b){delete _0x4fdd13[_0x406bf5],_0x23cc34=_0x186c5b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x23cc34&&_0x4fdd13['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x23cc34&&_0x4fdd13['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x23cc34&&_0x4fdd13['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x23cc34&&_0x4fdd13['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x23cc34&&_0x4fdd13['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x23cc34&&_0x4fdd13['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x23cc34&&_0x4fdd13['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x36a185='',_0xdc15df='',_0x26e329='custom'){const _0x1fb6fd=this['editor'],_0x346750=_0x1fb6fd['editing']['view'],_0x5073f3=_0x1fb6fd['plugins']['get'](a),_0x56c99a=_0x1fb6fd['plugins']['get'](_0x1c4768);_0x5073f3['showFakeVisualSelection']();const _0x3b764b=new l(),_0x2c26b8=new ClipboardEvent('copy',{'clipboardData':_0x3b764b}),_0x4a17c6=new _0x5c1c87(_0x3b764b),_0x3aa4db=new _0x28182f(_0x346750,_0x2c26b8,{'dataTransfer':_0x4a17c6});_0x56c99a['_forceMarkersCopy']('comment',()=>{_0x346750['document']['fire']('copy',_0x3aa4db);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x1fb6fd,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x532e5c=_0x4a17c6['getData']('text/html');const _0x418fe0=_0x1fb6fd['model']['document']['selection'],_0x282997=Array['from'](_0x418fe0['getRanges']());0x1===_0x282997['length']&&_0x282997[0x0]['isFlat']&&!_0x418fe0['getSelectedElement']()&&''!==_0x532e5c['replace'](/ /g,'')['trim']()&&(_0x532e5c='<p>'+_0x532e5c+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x26e329,'query':_0x36a185,'htmlContent':_0x532e5c,'label':_0xdc15df,'mainActionLabel':_[_0x1fb6fd['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x58695c,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x286907['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5073f3['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x24f51c=new Map(),_0x1875c7=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x34903b of _0x1875c7)for(const _0x2d3522 of _0x34903b['commands'])_0x24f51c['set'](_0x2d3522['id'],{..._0x2d3522,'groupId':_0x34903b['groupId'],'groupLabel':_0x34903b['groupLabel']||_0x34903b['groupId']});return _0x24f51c;}['_createAIAssistantUIButton'](_0x1f5226){const _0x34ce98=this['editor'],_0x36a97c=_0x34ce98['commands']['get']('showAIAssistant'),_0x295afa=new _0x1f5226(_0x34ce98['locale']);return _0x295afa['set']({'label':i(_0x34ce98['locale'],'AI\x20Assistant'),'icon':_0x58695c,'isToggleable':!0x0}),_0x295afa['bind']('isEnabled')['to'](_0x36a97c),_0x295afa['bind']('isOn')['to'](this['_dialog'],'id',_0x2c6859=>'aiAssistant'===_0x2c6859),this['listenTo'](_0x295afa,'execute',()=>{_0x295afa['isOn']?this['hideUI']():_0x36a97c['execute']();}),_0x295afa;}['_initView'](){const _0x7ccec8=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',()=>{_0x7ccec8['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x7ccec8['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x33a7e8,ui:{ariaLiveAnnouncer:_0xeade16}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1fe3cc,_0xed2ce0,_0x39107c)=>{const _0x130bec=this['_aiAssistantController']['currentContext'];_0x39107c?_0xeade16['announce'](i(_0x33a7e8,'AI\x20is\x20writing')):_0x130bec&&_0xeade16['announce'](i(_0x33a7e8,'Generated\x20content:\x20%0',_0x130bec),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x55beea,_0x1efb96,_0xd0a406)=>{if(_0xd0a406){const _0x48216e=this['_formView']['errorView']['text'];_0xeade16['announce'](i(_0x33a7e8,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x48216e));}});}['_onExecute'](_0x160824){const _0x58e35d=this['_commandDefinitions']['get'](_0x160824),_0x412a19=this['editor'],_0x24f43c=_0x412a19['model']['document']['selection'],_0x64138b=_0x412a19['commands']['get']('showAIAssistant'),_0x13f596=_0x412a19['plugins']['get'](a),_0x3a8756=''+(_0x58e35d['groupId']!==K?_0x58e35d['groupLabel']+':\x20':'')+_0x58e35d['label'];if(!0x1!==_0x58e35d['requiresContent']&&_0x24f43c['isCollapsed']){const _0x219be5=_0x368270(_0x24f43c['getSelectedBlocks']())||_0x412a19['model']['schema']['getLimitElement'](_0x24f43c);_0x412a19['model']['change'](_0x6779bd=>{_0x6779bd['setSelection'](_0x219be5,'in');});}_0x13f596['showFakeVisualSelection'](),_0x64138b['execute'](_0x58e35d['prompt'],_0x3a8756,'command:'+_0x160824);}['_populateMenuBarMenu'](_0x33e0be,_0x7481ff,_0x4f27da,_0x50264d){const _0x124902=this['editor'],_0x235ad5=_0x124902['locale'],_0x4430db=new _0x630c13(_0x235ad5),_0x373ff7=U(_0x124902,_0x4f27da)['filter'](_0x4cf1b1=>_0x4cf1b1['commands']['length']);0x1===_0x373ff7['length']?this['_getMenuBarGroupButtons']({'command':_0x33e0be,'commands':_0x373ff7[0x0]['commands'],'parentMenuView':_0x7481ff,'onExecute':_0x50264d})['forEach'](_0x3fa4e8=>_0x4430db['items']['add'](_0x3fa4e8)):_0x373ff7['forEach'](({groupId:_0x69f5fe,groupLabel:_0x43dcf0,commands:_0x381c20})=>{const _0x4eba8f=new _0x42f907(_0x235ad5,_0x7481ff),_0x1c8464=new _0x1e7bec(_0x235ad5),_0x1163b0=new _0x630c13(_0x235ad5),_0x42e4e9=this['_getMenuBarGroupButtons']({'command':_0x33e0be,'commands':_0x381c20,'parentMenuView':_0x1c8464,'onExecute':_0x50264d});_0x1c8464['buttonView']['set']({'label':_0x43dcf0||_0x69f5fe}),_0x1c8464['delegate']('execute')['to'](_0x7481ff),_0x1163b0['items']['addMany'](_0x42e4e9),_0x1c8464['panelView']['children']['add'](_0x1163b0),_0x4eba8f['children']['add'](_0x1c8464),_0x4430db['items']['add'](_0x4eba8f);}),_0x7481ff['panelView']['children']['add'](_0x4430db);}['_getMenuBarGroupButtons']({command:_0x261d2d,commands:_0x394653,parentMenuView:_0x1c065c,onExecute:_0x49e294}){const _0x4b0e54=this['editor'],_0x3c6bc6=_0x4b0e54['locale'];return U(_0x4b0e54,_0x394653)['map'](_0x198a64=>{const _0x20e902=new _0x42f907(_0x3c6bc6,_0x1c065c),_0x35cc5c=new _0x711b55(_0x3c6bc6);return _0x35cc5c['set']({'label':_0x198a64['label']}),_0x35cc5c['delegate']('execute')['to'](_0x1c065c),_0x35cc5c['on']('execute',()=>_0x49e294(_0x198a64['id'])),_0x35cc5c['bind']('isEnabled')['to'](_0x261d2d,'enabledCommandsIds',_0x22da3f=>_0x22da3f['includes'](_0x198a64['id'])),_0x20e902['children']['add'](_0x35cc5c),_0x20e902;});}}function T(_0x139bad,_0x8517bf){return void 0x0!==_0x139bad['order']&&void 0x0===_0x8517bf['order']?0x1:void 0x0===_0x139bad['order']&&void 0x0!==_0x8517bf['order']?-0x1:void 0x0!==_0x139bad['order']&&void 0x0!==_0x8517bf['order']?_0x139bad['order']-_0x8517bf['order']:0x0;}function U(_0x3c03b7,_0x551966){_0x551966['sort'](T);const _0x14031d={},_0x2d4e70=[];for(const _0x1aa157 of _0x551966)if(void 0x0!==_0x1aa157['order']){if(_0x1aa157['order']in _0x14031d)throw new _0x276da2('ai-commands-config-order-collision',_0x3c03b7,{'conflictingDefinitions':[_0x1aa157,_0x14031d[_0x1aa157['order']]]});_0x14031d[_0x1aa157['order']]=_0x1aa157,_0x2d4e70['splice'](_0x1aa157['order'],0x0,_0x1aa157);}else _0x2d4e70['push'](_0x1aa157);return _0x2d4e70;}class At extends _0x2c3381{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4e050f){super(_0x4e050f);const _0x9d4241=_0x4e050f['config'],_0x30d11e=_0x4e050f['locale'];_0x9d4241['define']('ai.aiAssistant.preserveComments',!0x0),_0x9d4241['define']('ai.aiAssistant.commands',_t(_0x30d11e)),_0x9d4241['define']('ai.aiAssistant.extraCommandGroups',[]),_0x9d4241['define']('ai.aiAssistant.removeCommands',[]);let _0x338b07=o(_0x9d4241['get']('ai.aiAssistant.commands'),_0x30d11e);const _0x4bd4c1=_0x9d4241['get']('ai.aiAssistant.extraCommandGroups'),_0x147858=_0x9d4241['get']('ai.aiAssistant.removeCommands');_0x4bd4c1['forEach'](_0x19920a=>{const _0xce3beb=_0x338b07['find'](_0x50ae62=>_0x50ae62['groupId']===_0x19920a['groupId']);_0xce3beb?_0xce3beb['commands']=_0xce3beb['commands']['concat'](_0x19920a['commands']):_0x338b07['push'](_0x19920a);}),_0x338b07=_0x338b07['filter'](_0x154870=>!_0x147858['includes'](_0x154870['groupId'])),_0x338b07['forEach'](_0x18e80d=>{_0x18e80d['commands']=_0x18e80d['commands']['filter'](_0x17015d=>!_0x147858['includes'](_0x17015d['id']));}),_0x9d4241['set']('ai.aiAssistant.commands',_0x338b07);}}function _t(_0x5687b6){return[{'groupId':'editOrReview','groupLabel':i(_0x5687b6,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x5687b6,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x5687b6,'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(_0x5687b6,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x5687b6,'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(_0x5687b6,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x5687b6,'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(_0x5687b6,'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(_0x5687b6,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x5687b6,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x5687b6,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x5687b6,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x5687b6,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x5687b6,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x5687b6,'Change\x20style'),'commands':[{'id':'business','label':i(_0x5687b6,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x5687b6,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x5687b6,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x5687b6,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x5687b6,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x5687b6,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x5687b6,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x5687b6,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x5687b6,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x5687b6,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x5687b6,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x5687b6,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x5687b6,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x2c3381{['abortController'];static get['requires'](){return[x];}constructor(_0x24a1b5){super(_0x24a1b5),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'](_0x2fe5a7){return this['sendRequest'](_0x2fe5a7)['catch'](_0x390f4c=>{if(_0x390f4c instanceof R)return Promise['reject'](_0x390f4c);if('AbortError'==_0x390f4c['name'])return Promise['resolve']();throw console['error'](_0x390f4c),new _0x276da2('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0xae1825,_0x17940e){const _0x509d70=this['editor']['locale'],_0x3666d4={'Content-Type':'application/json'};if('object'==typeof _0xae1825)Object['assign'](_0x3666d4,_0xae1825);else{if(_0xae1825)try{const _0x5978b8=await _0xae1825(_0x17940e);Object['assign'](_0x3666d4,_0x5978b8);}catch{return Promise['reject'](new R(i(_0x509d70,'AI_ERROR_GET_HEADERS')));}}return _0x3666d4;}async['_prepareRequestParameters'](_0x2e67df,_0xdbaa77){const _0x5af63a=this['editor']['locale'];if('object'==typeof _0x2e67df)return _0x2e67df;try{return await _0x2e67df(_0xdbaa77);}catch{return Promise['reject'](new R(i(_0x5af63a,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x53ab0f){super(_0x53ab0f),_0x53ab0f['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x53ab0f['config']['get']('ai.openAI.requestParameters')||_0x53ab0f['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x53ab0f['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x53ab0f['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x53ab0f['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x12115c,context:_0x34b772,onData:_0x4eef24,actionId:_0x156257}){const _0x4ea785=this['editor']['locale'],_0x75aede=await this['prepareMessages'](_0x12115c,_0x34b772,_0x156257),_0x5c1ccb=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x156257),_0x509529=await this['_prepareRequestParameters'](this['_requestParameters'],_0x156257),_0xfaad79={'messages':_0x75aede,..._0x509529},_0x323a21={'method':'POST','headers':_0x5c1ccb,'body':JSON['stringify'](_0xfaad79),'signal':this['abortController']['signal']},_0x1ad5ff=await fetch(this['_apiUrl'],_0x323a21);if(_0x1ad5ff['ok'])return _0x509529['stream']?await this['_readStreamableResponse'](_0x1ad5ff,_0x4eef24):await this['_readStaticResponse'](_0x1ad5ff,_0x4eef24),Promise['resolve']();{const _0x5343ce=await _0x1ad5ff['text']();return _0x5343ce['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x4ea785,'AI_ERROR_CONTEXT_LENGTH'))):_0x5343ce['includes']('Moderation')?Promise['reject'](new R(i(_0x4ea785,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x5343ce));}}async['prepareMessages'](_0x23069a,_0x4d5204,_0x5c85b6){let _0x35bd15,_0x23839c;return _0x4d5204?(_0x35bd15='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.',_0x23839c='Instruction:\x0a'+_0x23069a+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4d5204):(_0x35bd15='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.',_0x23839c=_0x23069a),[{'role':'system','content':_0x35bd15},{'role':'user','content':_0x23839c}];}async['_readStreamableResponse'](_0x2e4fdf,_0x86077f){const _0x17668c=_0x2e4fdf['body']['getReader'](),_0x1a0e6e=new TextDecoder();let _0x3cc56a='',_0x123404='',_0x5003ae='',_0x36c1a9=!0x1;for(;!_0x36c1a9;){const {done:_0x3c8fbe,value:_0x518633}=await _0x17668c['read'](),_0xeecb20=_0x3cc56a+_0x1a0e6e['decode'](_0x518633);let _0x213a9f='';_0x36c1a9=_0x3c8fbe;try{_0x213a9f=this['_cleanUpData'](_0xeecb20),_0x3cc56a='';}catch{_0x3cc56a=_0xeecb20;continue;}_0x123404+=_0x213a9f,!_0x36c1a9&&this['_isBufferIncomplete'](_0x123404)||_0x123404&&(_0x5003ae+=_0x123404,_0x123404='',_0x86077f(_0x5003ae));}return Promise['resolve']();}async['_readStaticResponse'](_0x4f8983,_0x81495b){return _0x81495b((await _0x4f8983['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x36a6e0){const _0x19cf19=_0x36a6e0['split']('<')['length']!==_0x36a6e0['split']('>')['length'],_0x3b7023=_0x36a6e0['length']<0x1e;return _0x19cf19&&_0x3b7023;}['_cleanUpData'](_0x407b83){return _0x407b83['split'](/\n(?![^{]*\})/g)['map'](_0x11b57c=>_0x11b57c['replace']('data:\x20',''))['filter'](_0x18504c=>_0x18504c&&_0x18504c['length']>0x0&&'[DONE]'!==_0x18504c)['map'](_0x4ce066=>{const {choices:_0x48649e}=JSON['parse'](_0x4ce066);if(_0x48649e[0x0]?.['delta']?.['content'])return _0x48649e[0x0]['delta']['content'];})['filter'](_0x5e4ab6=>_0x5e4ab6)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0xa5fbc6){super(_0xa5fbc6),_0xa5fbc6['config']['get']('ai.aws.requestParameters')||_0xa5fbc6['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']=_0xa5fbc6['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0xa5fbc6['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0xa5fbc6['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0xa5fbc6['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x3ae724,context:_0x3b35ae,onData:_0x36ea75,actionId:_0x30b113}){const {model:_0x114742,stream:_0x173004,..._0x2a8312}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x30b113),_0x247d59={'prompt':await this['preparePrompt'](_0x3ae724,_0x3b35ae,_0x114742,_0x30b113),..._0x2a8312};this['_apiUrl']?await this['_processProxyRequest'](_0x247d59,_0x114742,_0x173004,_0x36ea75,_0x30b113):await this['_processAWSRequest'](_0x247d59,_0x114742,_0x173004,_0x36ea75);}async['preparePrompt'](_0xdc75e,_0x409981,_0x391d42,_0x474964){let _0x1d83b2,_0x4e5a5c;return _0x409981?(_0x1d83b2='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.',_0x4e5a5c='Instruction:\x0a'+_0xdc75e+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x409981):(_0x1d83b2='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.',_0x4e5a5c=_0xdc75e),'meta.llama'==this['getModelFamily'](_0x391d42)?'<<SYS>>\x0a'+_0x1d83b2+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4e5a5c+'\x0a[/INST]':'Human:\x0a'+_0x1d83b2+'\x0a'+_0x4e5a5c+'\x0a\x0aAssistant:';}['getModelFamily'](_0x56a3f8){if(/^anthropic\.claude/['test'](_0x56a3f8))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x56a3f8))return'ai21.j2';if(/^cohere\.command/['test'](_0x56a3f8))return'cohere.command';if(/^meta\.llama/['test'](_0x56a3f8))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x56a3f8));}async['_processProxyRequest'](_0x245de8,_0x415d70,_0x4d85cd,_0xb20eac,_0x19eeed){const _0x34d921={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x19eeed),'body':JSON['stringify']({..._0x245de8,'model':_0x415d70,'stream':_0x4d85cd}),'signal':this['abortController']['signal']},_0x37d528=await fetch(this['_apiUrl'],_0x34d921);_0x4d85cd?await this['_readStreamableResponse'](_0x37d528,_0x415d70,_0xb20eac):await this['_readStaticResponse'](_0x37d528,_0x415d70,_0xb20eac);}async['_processAWSRequest'](_0x1e6121,_0x5dd7ad,_0x17fdd8,_0x209c98){const _0xdafbed=new _0x3c89b7(this['_bedrockClientConfig']),_0x374b95={'body':JSON['stringify'](_0x1e6121),'contentType':'application/json','accept':'application/json','modelId':_0x5dd7ad};let _0x1891af;if(_0x17fdd8){const _0x10ee7c=new _0x121273(_0x374b95);_0x1891af=await _0xdafbed['send'](_0x10ee7c,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x1891af,_0x5dd7ad,_0x209c98);}else{const _0x451776=new _0x1820ba(_0x374b95);_0x1891af=await _0xdafbed['send'](_0x451776,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x1891af,_0x5dd7ad,_0x209c98);}}async['_readAsyncIterableResponse'](_0xd09b85,_0x29e44c,_0x3ead9b){const _0x243e97=_0xd09b85['body'],_0x153dd8=new TextDecoder('utf-8');let _0x3dfab8='';for await(const _0x4a8b9b of _0x243e97)if(_0x4a8b9b['chunk']){const _0x65eeb0=_0x153dd8['decode'](_0x4a8b9b['chunk']['bytes']),_0xe3cbb7=JSON['parse'](_0x65eeb0);_0x3dfab8+=this['_getGeneratedText'](_0xe3cbb7,_0x29e44c),_0x3ead9b(_0x3dfab8);}return Promise['resolve']();}async['_readStreamableResponse'](_0x487223,_0x2ba7d6,_0x23a4ed){const _0x19485e=_0x487223['body'],_0x55697b=new TextDecoder('utf-8'),_0x4a540e=_0x19485e['getReader']();let _0x2c163c='',_0x166132='',_0x21d519=!0x1;for(;!_0x21d519;){const {done:_0x503ee8,value:_0x445c68}=await _0x4a540e['read']();if(_0x21d519=_0x503ee8,_0x21d519)break;const _0x50fef0=(_0x2c163c+_0x55697b['decode'](_0x445c68))['split']('\x0a')['map'](_0x45ee76=>{try{return _0x2c163c='',JSON['parse'](_0x45ee76);}catch{return _0x2c163c=_0x45ee76,null;}})['filter'](_0x390a5f=>null!==_0x390a5f);_0x50fef0['length']&&(_0x166132+=_0x50fef0['map'](_0x1fad8d=>this['_getGeneratedText'](_0x1fad8d,_0x2ba7d6))['join'](''),_0x23a4ed(_0x166132));}return Promise['resolve']();}async['_readStaticResponse'](_0x402880,_0x138b05,_0x1af02f){let _0x2ebc6f;return _0x2ebc6f=_0x402880 instanceof Response?await _0x402880['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x402880['body'])),(_0x1af02f(this['_getGeneratedText'](_0x2ebc6f,_0x138b05)),Promise['resolve']());}['_getGeneratedText'](_0x141e7c,_0x59369b){switch(this['getModelFamily'](_0x59369b)){case'anthropic.claude':return _0x141e7c['completion'];case'ai21.j2':return _0x141e7c['completions'][0x0]['data']['text'];case'cohere.command':return _0x141e7c['generations'][0x0]['text'];case'meta.llama':return _0x141e7c['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-ai",
|
|
3
|
-
"version": "46.0.0-alpha.
|
|
3
|
+
"version": "46.0.0-alpha.5",
|
|
4
4
|
"description": "AI Assistant feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@aws-sdk/client-bedrock-runtime": "3.823.0",
|
|
32
|
-
"@ckeditor/ckeditor5-clipboard": "46.0.0-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-core": "46.0.0-alpha.
|
|
34
|
-
"@ckeditor/ckeditor5-engine": "46.0.0-alpha.
|
|
35
|
-
"@ckeditor/ckeditor5-icons": "46.0.0-alpha.
|
|
36
|
-
"@ckeditor/ckeditor5-table": "46.0.0-alpha.
|
|
37
|
-
"@ckeditor/ckeditor5-ui": "46.0.0-alpha.
|
|
38
|
-
"@ckeditor/ckeditor5-utils": "46.0.0-alpha.
|
|
39
|
-
"ckeditor5": "46.0.0-alpha.
|
|
32
|
+
"@ckeditor/ckeditor5-clipboard": "46.0.0-alpha.5",
|
|
33
|
+
"@ckeditor/ckeditor5-core": "46.0.0-alpha.5",
|
|
34
|
+
"@ckeditor/ckeditor5-engine": "46.0.0-alpha.5",
|
|
35
|
+
"@ckeditor/ckeditor5-icons": "46.0.0-alpha.5",
|
|
36
|
+
"@ckeditor/ckeditor5-table": "46.0.0-alpha.5",
|
|
37
|
+
"@ckeditor/ckeditor5-ui": "46.0.0-alpha.5",
|
|
38
|
+
"@ckeditor/ckeditor5-utils": "46.0.0-alpha.5",
|
|
39
|
+
"ckeditor5": "46.0.0-alpha.5",
|
|
40
40
|
"es-toolkit": "1.39.5"
|
|
41
41
|
},
|
|
42
42
|
"type": "module",
|