@ckeditor/ckeditor5-ai 45.2.0-alpha.5 → 45.2.0-alpha.7
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 _0x1b36ae,Command as _0x1bb2af}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x4c3526,IconCheck as _0x386754,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0xf59f00,IconRobotPencil as _0x5418d4}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x5f3eef,CKEditorError as _0x54aebf,ObservableMixin as _0x48a603,global as _0x4dfb0a,isVisible as ot,Rect as it,Collection as _0x2a372e,FocusTracker as mt,KeystrokeHandler as ut,first as _0x1aa9f1}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x1d9c42,View as _0x9da3c1,SpinnerView as _0xccea55,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x450c47,createDropdown as _0xed54d7,addMenuToDropdown as _0x2fe561,MenuBarMenuView as _0x30d9e3,MenuBarMenuListItemButtonView as _0x14ae59,DialogViewPosition as _0x5e497d,MenuBarMenuListView as _0x512bac,MenuBarMenuListItemView as _0x5dd50e}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x115093,ClipboardMarkersUtils as _0x1685eb}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x3dbcec,DataTransfer as _0x468a5a,UpcastWriter as _0x4144b3,Matcher as _0x4ee861}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x122d1e,InvokeModelWithResponseStreamCommand as _0x3a6bba,InvokeModelCommand as _0x33435d}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x563b30,_0x21fbb0){const _0x159720=(0x0,_0x21fbb0['t'])('Other');return _0x563b30['length']?'groupId'in _0x563b30[0x0]?_0x563b30:[{'groupId':x,'groupLabel':_0x159720,'order':0x1/0x0,'commands':_0x563b30}]:[{'groupId':x,'groupLabel':_0x159720,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x1b36ae{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x77d3ba}=this,_0x1dad60=['ck-fake-ai-selection'];_0x77d3ba['config']['get']('ai.useTheme')&&_0x1dad60['push']('ck-ai-assistant-ui_theme'),_0x77d3ba['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x1dad60,'priority':0xc}}),_0x77d3ba['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x2485f1,{writer:_0x2564e5})=>{if(!_0x2485f1['markerRange']['isCollapsed'])return null;const _0x22fa94=_0x2564e5['createUIElement']('span');return _0x2564e5['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x22fa94),_0x22fa94;}});}['afterInit'](){!async function(_0x465aa8){const _0x37f30f=_0x45de2a([0x4f,0x33,0x68,0x5a,0x42,0x48,0x73,0x67,0x4b,0x76,0x56,0x79,0x4a,0x71,0x32,0x46,0x64,0x72,0x65,0x53,0x30,0x6c,0x58,0x6f,0x6a,0x75,0x54,0x66,0x4d,0x4e,0x52,0x37,0x41,0x63,0x31,0x47,0x50,0x70,0x57,0x51,0x74,0x38,0x4c,0x7a,0x6e,0x61,0x39,0x55,0x78,0x35,0x34,0x77,0x43,0x45,0x6b,0x44,0x49,0x6d,0x59,0x62,0x69,0x36]),_0x101902=0x4f123dd1,_0x3ef1fe=0x4f155449^_0x101902,_0x5a88ed=window[_0x45de2a([0x44,0x61,0x74,0x65])][_0x45de2a([0x6e,0x6f,0x77])](),_0x3b53da=_0x465aa8[_0x45de2a([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x535d96=new window[(_0x45de2a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5c1aa1=>{_0x3b53da[_0x45de2a([0x6f,0x6e,0x63,0x65])](_0x45de2a([0x72,0x65,0x61,0x64,0x79]),_0x5c1aa1);}),_0x13bddd={[_0x45de2a([0x6b,0x74,0x79])]:_0x45de2a([0x45,0x43]),[_0x45de2a([0x75,0x73,0x65])]:_0x45de2a([0x73,0x69,0x67]),[_0x45de2a([0x63,0x72,0x76])]:_0x45de2a([0x50,0x2d,0x32,0x35,0x36]),[_0x45de2a([0x78])]:_0x45de2a([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]),[_0x45de2a([0x79])]:_0x45de2a([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]),[_0x45de2a([0x61,0x6c,0x67])]:_0x45de2a([0x45,0x53,0x32,0x35,0x36])},_0x21a953=_0x3b53da[_0x45de2a([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x45de2a([0x67,0x65,0x74])](_0x45de2a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x415cae(){let _0x12b98a,_0x4a3f7b=null,_0x3a92ed=null;try{if(_0x21a953==_0x45de2a([0x47,0x50,0x4c]))return _0x45de2a([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x12b98a=_0x47250e(),!_0x12b98a)return _0x45de2a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x12b98a[_0x45de2a([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3a92ed=_0x5425d7(_0x12b98a[_0x45de2a([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x12b98a[_0x45de2a([0x6a,0x74,0x69])])),await _0x156f68()?_0xa103a0()?_0x455ab6()?_0x45de2a([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xf21153()?(_0x12b98a[_0x45de2a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x45de2a([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4a3f7b=_0x210cee(_0x45de2a([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x12b98a[_0x45de2a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x45de2a([0x74,0x72,0x69,0x61,0x6c])&&(_0x4a3f7b=_0x210cee(_0x45de2a([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0xc16669()):_0x45de2a([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x45de2a([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x45de2a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x45de2a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x455ab6(){const _0x48bf47=[_0x45de2a([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x45de2a([0x74,0x72,0x69,0x61,0x6c])][_0x45de2a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x12b98a[_0x45de2a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5a88ed/0x3e8:0xe10*_0x3ef1fe;return _0x12b98a[_0x45de2a([0x65,0x78,0x70])]<_0x48bf47;}function _0xa103a0(){const _0xca89ff=_0x12b98a[_0x45de2a([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0xca89ff&&(!!_0xca89ff[_0x45de2a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x45de2a([0x2a]))||!!_0xca89ff[_0x45de2a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x45de2a([0x41,0x49])));}function _0xf21153(){const _0x2e87b4=_0x12b98a[_0x45de2a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x2e87b4||0x0==_0x2e87b4[_0x45de2a([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x229711}=new URL(window[_0x45de2a([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x2e87b4[_0x45de2a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x229711))return!0x0;const _0x341174=_0x229711[_0x45de2a([0x73,0x70,0x6c,0x69,0x74])](_0x45de2a([0x2e]));return _0x2e87b4[_0x45de2a([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1e86c6=>_0x1e86c6[_0x45de2a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x45de2a([0x2a])))[_0x45de2a([0x6d,0x61,0x70])](_0x529e63=>_0x529e63[_0x45de2a([0x73,0x70,0x6c,0x69,0x74])](_0x45de2a([0x2e])))[_0x45de2a([0x73,0x6f,0x6d,0x65])](_0x5b84a1=>_0x341174[_0x45de2a([0x65,0x76,0x65,0x72,0x79])]((_0x35101f,_0x3cca92)=>_0x5b84a1[_0x3cca92]===_0x35101f||_0x5b84a1[_0x3cca92]===_0x45de2a([0x2a])));}function _0xc16669(){return _0x4a3f7b&&_0x3a92ed?new window[(_0x45de2a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x59dad1,_0x11e65d)=>{_0x4a3f7b[_0x45de2a([0x74,0x68,0x65,0x6e])](_0x59dad1,_0x11e65d),_0x3a92ed[_0x45de2a([0x74,0x68,0x65,0x6e])](_0x97ac3b=>{_0x97ac3b!=_0x45de2a([0x56,0x61,0x6c,0x69,0x64])&&_0x59dad1(_0x97ac3b);},_0x11e65d);}):_0x4a3f7b||_0x3a92ed||_0x45de2a([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5425d7(_0xa00a41,_0x3e65af){return new window[(_0x45de2a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1c7ce8=>{if(_0x2bf086())return _0x1c7ce8(_0x45de2a([0x56,0x61,0x6c,0x69,0x64]));_0xdcf1ef(),_0x3b53da[_0x45de2a([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x45de2a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x452782=!0x1;const _0x52b057=_0x5f3eef();function _0x3458b3(_0xd858ba){return!!_0xd858ba&&(typeof _0xd858ba===_0x45de2a([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0xd858ba===_0x45de2a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0xd858ba[_0x45de2a([0x74,0x68,0x65,0x6e])]===_0x45de2a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0xd858ba[_0x45de2a([0x63,0x61,0x74,0x63,0x68])]===_0x45de2a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x319740(_0x28d97a){_0x1de37e(_0x28d97a)[_0x45de2a([0x74,0x68,0x65,0x6e])](_0x1d2856=>{if(!_0x1d2856||_0x1d2856[_0x45de2a([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x45de2a([0x6f,0x6b]))return _0x45de2a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x45f044(_0x231966(_0x52b057+_0x3e65af))!=_0x1d2856[_0x45de2a([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x45de2a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x45de2a([0x56,0x61,0x6c,0x69,0x64]);})[_0x45de2a([0x74,0x68,0x65,0x6e])](_0x5e5f9b=>(_0x4f2400(),_0x5e5f9b),()=>{const _0xb9ec21=_0x47b32d();return null==_0xb9ec21?(_0x4f2400(),_0x45de2a([0x56,0x61,0x6c,0x69,0x64])):_0x45de2a(_0x5a88ed-_0xb9ec21>(0x6b1eb9d1^_0x101902)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x45de2a([0x74,0x68,0x65,0x6e])](_0x1c7ce8)[_0x45de2a([0x63,0x61,0x74,0x63,0x68])](()=>{_0x1c7ce8(_0x45de2a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x48c4fc=0x4f24d351^_0x101902;function _0x4f2400(){const _0x55c6cb=_0x45de2a([0x6c,0x6c,0x63,0x74,0x2d])+_0x45f044(_0x231966(_0xa00a41)),_0x5026db=_0x551498(_0x45f044(window[_0x45de2a([0x4d,0x61,0x74,0x68])][_0x45de2a([0x63,0x65,0x69,0x6c])](_0x5a88ed/_0x48c4fc)));window[_0x45de2a([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x45de2a([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x55c6cb,_0x5026db);}function _0x47b32d(){const _0x14d221=_0x45de2a([0x6c,0x6c,0x63,0x74,0x2d])+_0x45f044(_0x231966(_0xa00a41)),_0x54a720=window[_0x45de2a([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x45de2a([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x14d221);return _0x54a720?window[_0x45de2a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x551498(_0x54a720),0x10)*_0x48c4fc:null;}function _0x1de37e(_0x4b63ac){return new window[(_0x45de2a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x59f2ea,_0x37ade5)=>{_0x4b63ac[_0x45de2a([0x74,0x68,0x65,0x6e])](_0x59f2ea,_0x37ade5),window[_0x45de2a([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x37ade5,0x4f13e911^_0x101902);});}}_0x3b53da[_0x45de2a([0x6f,0x6e])](_0x45de2a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3f1354,_0x391c23)=>{if(_0x391c23[0x0]!=_0xa00a41)return _0x1c7ce8(_0x45de2a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x391c23[0x1]={..._0x391c23[0x1],[_0x45de2a([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x52b057};},{[_0x45de2a([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x45de2a([0x68,0x69,0x67,0x68])}),_0x3b53da[_0x45de2a([0x6f,0x6e])](_0x45de2a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0xea4b1f=>{_0x3458b3(_0xea4b1f[_0x45de2a([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x452782=!0x0,_0x319740(_0xea4b1f[_0x45de2a([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x45de2a([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x45de2a([0x6c,0x6f,0x77])}),_0x535d96[_0x45de2a([0x74,0x68,0x65,0x6e])](()=>{_0x452782||_0x1c7ce8(_0x45de2a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x2bf086(){return _0x3b53da[_0x45de2a([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x45de2a([0x76,0x69,0x65,0x77])][_0x45de2a([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x45de2a([0x61,0x75,0x74,0x6f]);}function _0xdcf1ef(){_0x3b53da[_0x45de2a([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x45de2a([0x76,0x69,0x65,0x77])][_0x45de2a([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x45de2a([0x61,0x75,0x74,0x6f]);}}function _0x210cee(_0x5013ef){const _0x3aa0fd=[new window[(_0x45de2a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2188ec=>setTimeout(_0x2188ec,0x4f1b031d^_0x101902)),_0x535d96[_0x45de2a([0x74,0x68,0x65,0x6e])](()=>new window[(_0x45de2a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x496ee9=>{let _0x2ca626=0x0;_0x3b53da[_0x45de2a([0x6d,0x6f,0x64,0x65,0x6c])][_0x45de2a([0x6f,0x6e])](_0x45de2a([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1c102d,_0x996924)=>{_0x996924[0x0][_0x45de2a([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x2ca626++,_0x2ca626==(0x4f123c29^_0x101902)&&(_0x496ee9(),_0x1c102d[_0x45de2a([0x6f,0x66,0x66])]());});}))];return window[_0x45de2a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x45de2a([0x72,0x61,0x63,0x65])](_0x3aa0fd)[_0x45de2a([0x74,0x68,0x65,0x6e])](()=>_0x5013ef);}async function _0x3d7800(){await _0x535d96,_0x3b53da[_0x45de2a([0x6d,0x6f,0x64,0x65,0x6c])][_0x45de2a([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x48e0bf,_0x3b53da[_0x45de2a([0x6d,0x6f,0x64,0x65,0x6c])][_0x45de2a([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x48e0bf,_0x3b53da[_0x45de2a([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x45de2a([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xe678cf(_0x463b54){const _0x570ce0=_0x34e670();_0x3b53da[_0x570ce0]=_0x45de2a([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x463b54,_0x463b54!=_0x45de2a([0x56,0x61,0x6c,0x69,0x64])&&_0x3d7800();}function _0x34e670(){const _0x23e9b0=window[_0x45de2a([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x45de2a([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x45de2a([0x6e,0x6f,0x77])]())[_0x45de2a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x45de2a([0x2e]),'');let _0x50f563=_0x45de2a([0x4f]);for(let _0x24e343=0x0;_0x24e343<_0x23e9b0[_0x45de2a([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x24e343+=0x2){let _0xdd9177=window[_0x45de2a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x23e9b0[_0x45de2a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x24e343,_0x24e343+0x2));_0xdd9177>=_0x37f30f[_0x45de2a([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0xdd9177-=_0x37f30f[_0x45de2a([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x50f563+=_0x37f30f[_0xdd9177];}return _0x50f563;}function _0x47250e(){const _0x1590fe=_0x21a953[_0x45de2a([0x73,0x70,0x6c,0x69,0x74])](_0x45de2a([0x2e]));if(0x3!=_0x1590fe[_0x45de2a([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4ecbed(_0x1590fe[0x1]);function _0x4ecbed(_0x1b3194){const _0x16252b=_0x501afb(_0x1b3194);return _0x16252b&&_0x17814b()?_0x16252b:null;function _0x17814b(){const _0x2d1bd3=_0x16252b[_0x45de2a([0x6a,0x74,0x69])],_0x4ea3e4=window[_0x45de2a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2d1bd3[_0x45de2a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2d1bd3[_0x45de2a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x42f97f={..._0x16252b,[_0x45de2a([0x6a,0x74,0x69])]:_0x2d1bd3[_0x45de2a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2d1bd3[_0x45de2a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x42f97f[_0x45de2a([0x76,0x63])],_0x231966(_0x42f97f)==_0x4ea3e4;}}}async function _0x156f68(){let _0x4484aa=!0x0;try{const _0x468175=_0x21a953[_0x45de2a([0x73,0x70,0x6c,0x69,0x74])](_0x45de2a([0x2e])),[_0x5cc6ac,_0x331b75,_0x5def6e]=_0x468175;return _0x2673f3(_0x5cc6ac),await _0x2b7376(_0x5cc6ac,_0x331b75,_0x5def6e),_0x4484aa;}catch{return!0x1;}function _0x2673f3(_0x5bc228){const _0x4e758a=_0x501afb(_0x5bc228);_0x4e758a&&_0x4e758a[_0x45de2a([0x61,0x6c,0x67])]==_0x45de2a([0x45,0x53,0x32,0x35,0x36])||(_0x4484aa=!0x1);}async function _0x2b7376(_0x313234,_0x2e7818,_0x2763e6){const _0x467c27=window[_0x45de2a([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x45de2a([0x66,0x72,0x6f,0x6d])](_0x50e7c0(_0x2763e6),_0x278213=>_0x278213[_0x45de2a([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2d9e0a=new window[(_0x45de2a([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x45de2a([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x313234+_0x45de2a([0x2e])+_0x2e7818),_0x320e5d=window[_0x45de2a([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x45de2a([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x320e5d)return;const _0x1adb16=await _0x320e5d[_0x45de2a([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x45de2a([0x6a,0x77,0x6b]),_0x13bddd,{[_0x45de2a([0x6e,0x61,0x6d,0x65])]:_0x45de2a([0x45,0x43,0x44,0x53,0x41]),[_0x45de2a([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x45de2a([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x45de2a([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x320e5d[_0x45de2a([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x45de2a([0x6e,0x61,0x6d,0x65])]:_0x45de2a([0x45,0x43,0x44,0x53,0x41]),[_0x45de2a([0x68,0x61,0x73,0x68])]:{[_0x45de2a([0x6e,0x61,0x6d,0x65])]:_0x45de2a([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1adb16,_0x467c27,_0x2d9e0a)||(_0x4484aa=!0x1);}}function _0x501afb(_0xd6d6f0){return _0xd6d6f0[_0x45de2a([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x45de2a([0x65,0x79]))?JSON[_0x45de2a([0x70,0x61,0x72,0x73,0x65])](_0x50e7c0(_0xd6d6f0)):null;}function _0x50e7c0(_0x42cdeb){return window[_0x45de2a([0x61,0x74,0x6f,0x62])](_0x42cdeb[_0x45de2a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x45de2a([0x2b]))[_0x45de2a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x45de2a([0x2f])));}function _0x231966(_0x1679e7){let _0x1f0985=0x1505;function _0x5612f2(_0x57bedd){for(let _0x3ca15a=0x0;_0x3ca15a<_0x57bedd[_0x45de2a([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3ca15a++){const _0x41fefd=_0x57bedd[_0x45de2a([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x3ca15a);_0x1f0985=(_0x1f0985<<0x5)+_0x1f0985+_0x41fefd,_0x1f0985&=_0x1f0985;}}function _0x1b6579(_0x1b28f1){Array[_0x45de2a([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x1b28f1)?_0x1b28f1[_0x45de2a([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x1b6579):_0x1b28f1&&typeof _0x1b28f1==_0x45de2a([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x45de2a([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x1b28f1)[_0x45de2a([0x73,0x6f,0x72,0x74])]()[_0x45de2a([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4354ff,_0x19c7c8])=>{_0x5612f2(_0x4354ff),_0x1b6579(_0x19c7c8);}):_0x5612f2(window[_0x45de2a([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x1b28f1));}return _0x1b6579(_0x1679e7),_0x1f0985>>>0x0;}function _0x45f044(_0x168e46){return _0x168e46[_0x45de2a([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x45de2a([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x45de2a([0x30]));}function _0x551498(_0x5b4a10){return _0x5b4a10[_0x45de2a([0x73,0x70,0x6c,0x69,0x74])]('')[_0x45de2a([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x45de2a([0x6a,0x6f,0x69,0x6e])]('');}function _0x48e0bf(){}function _0x45de2a(_0x5ee6e2){return _0x5ee6e2['map'](_0x1c3914=>String['fromCharCode'](_0x1c3914))['join']('');}_0xe678cf(await _0x415cae());}(this);}['showFakeVisualSelection'](){const _0xd38487=this['editor']['model'];_0xd38487['change'](_0x30de0f=>{const _0x4f97b1=_0xd38487['document']['selection']['getRanges']();let _0x4cc792=0x0;for(const _0x2346eb of _0x4f97b1){const _0x3396b4=f+':'+_0x4cc792;if(_0xd38487['markers']['has'](_0x3396b4))_0x30de0f['updateMarker'](_0x3396b4,{'range':_0x2346eb});else{if(_0x2346eb['start']['isAtEnd']){const _0x1dbfaf=_0x2346eb['start']['getLastMatchingPosition'](({item:_0x315da9})=>!_0xd38487['schema']['isContent'](_0x315da9),{'boundaries':_0x2346eb});_0x30de0f['addMarker'](_0x3396b4,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x30de0f['createRange'](_0x1dbfaf,_0x2346eb['end'])});}else _0x30de0f['addMarker'](_0x3396b4,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2346eb});}_0x4cc792++;}});}['hideFakeVisualSelection'](){const _0x671e22=this['editor']['model'],_0x535082=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x535082['length']&&_0x671e22['change'](_0x1928c3=>{_0x535082['forEach'](_0x164d38=>{_0x1928c3['removeMarker'](_0x164d38);});});}['insertContent'](_0x364abf,_0x26fdc6){const _0x325349=this['_getAISelection'](),_0x1f601f=_0x26fdc6||_0x325349['getFirstRange']();this['editor']['model']['canEditAt'](_0x1f601f)&&this['editor']['model']['change'](_0x2e0a29=>{this['hideFakeVisualSelection'](),_0x26fdc6||this['_resetContentOfSelectedTableCells'](_0x2e0a29,_0x325349),this['_pasteHTMLUsingClipboard']({'insertAt':_0x1f601f,'writer':_0x2e0a29,'html':_0x364abf});});}['insertContentBelow'](_0x4e6492){const {model:_0xa20e5f}=this['editor'],_0x266c55=this['_getAISelection']();_0xa20e5f['change'](()=>{const _0x48d7e4=this['_prepareTableInsertBelowPosition'](_0x4e6492,_0x266c55)||this['_getDefaultInsertBelowPosition'](_0x266c55);this['insertContent'](_0x4e6492,_0x48d7e4);});}['_getAISelection'](){const _0x345e53=this['editor']['model'],_0x2f8d93=Array['from'](_0x345e53['markers']['getMarkersGroup'](f))['map'](_0x4b2a89=>_0x4b2a89['getRange']());return _0x345e53['createSelection'](_0x2f8d93);}['_pasteHTMLUsingClipboard']({writer:_0x407dcd,html:_0xfea5cf,insertAt:_0x12bc4b}){const {view:_0x52a9eb}=this['editor']['editing'],_0x5817fd=this['editor']['plugins']['get'](_0x115093),_0x4e0960=new gt();_0x4e0960['setData']('text/html',_0xfea5cf);const _0x2cc34e=new ClipboardEvent('paste',{'clipboardData':_0x4e0960}),_0x2d67ae=new _0x3dbcec(_0x52a9eb,_0x2cc34e,{'dataTransfer':new _0x468a5a(_0x4e0960)});_0x407dcd['setSelection'](_0x12bc4b);const _0x3171a3=(_0x15ec7e,_0x47e7f4)=>{_0x47e7f4['resultRange']&&_0x407dcd['setSelection'](_0x47e7f4['resultRange']);};_0x5817fd['once']('contentInsertion',_0x3171a3,{'priority':'lowest'}),_0x52a9eb['document']['fire']('paste',_0x2d67ae),_0x5817fd['off']('contentInsertion',_0x3171a3);}['_getDefaultInsertBelowPosition'](_0x41ff6b){const {model:_0xcc0062}=this['editor'],_0x488149=Array['from'](_0x41ff6b['getSelectedBlocks']());return _0x488149['length']?_0xcc0062['createPositionAfter'](_0x488149['pop']()):_0x41ff6b['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x64ed0e,_0x591f09){const {model:_0x3a65ee,plugins:_0x372ffa}=this['editor'];if(_0x372ffa['has']('TableUtils')){const _0x9295aa=_0x372ffa['get']('TableUtils')['getSelectedTableCells'](_0x591f09);if(_0x9295aa['length']){const _0x2957c5=this['_getTableRowCountFromContent'](_0x64ed0e),_0x325e99=this['_createEmptyTableRows'](_0x9295aa,_0x2957c5);return _0x3a65ee['createPositionAt'](_0x325e99,0x0);}}return null;}['_getTableRowCountFromContent'](_0x26cb60){const _0x34ff6c=this['editor']['plugins']['get']('TableUtils'),_0x466cc6=this['editor']['data']['parse'](_0x26cb60),_0x58b6cd=Array['from'](_0x466cc6['getChildren']())['filter'](_0x4aff54=>_0x4aff54['is']('element','table'));let _0x2bae11=0x0;return _0x58b6cd['forEach'](_0x2d72fb=>{_0x2bae11+=_0x34ff6c['getRows'](_0x2d72fb);}),_0x2bae11;}['_createEmptyTableRows'](_0x8ee037,_0x167f40){const _0x1baa6c=this['editor']['plugins']['get']('TableUtils'),_0x3e3ec8=_0x1baa6c['getRowIndexes'](_0x8ee037),_0x23c113=_0x1baa6c['getColumnIndexes'](_0x8ee037),_0x12b2c7=_0x3e3ec8['last']+0x1,_0x108534=_0x23c113['first'],_0x16e05f=_0x8ee037[0x0]['findAncestor']('table');for(let _0x4d7058=0x0;_0x4d7058<_0x167f40;_0x4d7058++)_0x1baa6c['insertRows'](_0x16e05f,{'at':_0x12b2c7});return _0x16e05f['getChild'](_0x12b2c7)['getChild'](_0x108534);}['_resetContentOfSelectedTableCells'](_0x2535e8,_0x2d2c0f){const {plugins:_0x2f23b6}=this['editor'],{model:_0x4d5a73}=_0x2535e8;if(!_0x2f23b6['has']('TableUtils'))return;_0x2f23b6['get']('TableUtils')['getSelectedTableCells'](_0x2d2c0f)['length']&&_0x4d5a73['deleteContent'](_0x2d2c0f);}}class E extends _0x1b36ae{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x54aebf('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x18be09){super(_0x18be09),this['name']='AIRequestError';}}function i(_0x5ad858,_0x1d22b4,_0x420688){const t=_0x5ad858['t'];switch(_0x1d22b4){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',_0x420688);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x420688);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'},_0x420688);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 _0x1d22b4;}}class j extends _0x1bb2af{['_commandDefinitions'];constructor(_0xe1bfa1,_0x5ad3c1){super(_0xe1bfa1),this['_commandDefinitions']=_0x5ad3c1,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1c352b,_0x2a72e3,_0x5a65f5)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x5a65f5));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x251b8e,_0x73340f,_0x3d8484)=>{this['enabledCommandsIds']=_0x3d8484?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x328254=this['editor']['model'];this['_hasContext']=function(_0x5f4a03){const _0x54f3b3=_0x5f4a03['document']['selection'];return _0x54f3b3['isCollapsed']?0x0!==[..._0x54f3b3['getSelectedBlocks']()]['length']&&![..._0x54f3b3['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x5f4a03['hasContent'](_0x54f3b3['getFirstRange']());}(_0x328254);const _0x587324=_0x328254['document']['selection'],_0x4fb6e8=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x190669 of _0x587324['getRanges']())for(const _0x4caa0f of _0x190669['getItems']())if(_0x4caa0f['is']('element')&&_0x4fb6e8['includes'](_0x4caa0f['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3fd716='',_0x383c90='',_0xc9c7d8='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x3fd716,_0x383c90,_0xc9c7d8);}}function G(_0x2398ee,_0x36f3eb){const _0x160135=new Set();for(const _0x1cdffe of _0x2398ee['values']())(_0x36f3eb||!0x1===_0x1cdffe['requiresContent'])&&_0x160135['add'](_0x1cdffe['id']);return Array['from'](_0x160135);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x48a603(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x1395f3,_0x1e4547,_0x43f6c1){super(),this['editor']=_0x1395f3,this['textAdapter']=_0x1e4547,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x43f6c1,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4dd5a6,_0x1a04b8,_0x274064)=>{this['view']['value']=this['_sanitizeHTML'](_0x274064);}),this['listenTo'](this['view'],'submitPrompt',(_0x44fd71,_0x3819c8)=>{const _0x2b5403=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x3819c8,_0x2b5403,'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:_0x17e091,query:_0x1d032a,htmlContent:_0x591d05,label:_0x494764,mainActionLabel:_0xc5c9a2}){this['view']['prompt']=_0x494764,this['view']['mainAction']=_0xc5c9a2,this['initialContext']=_0x591d05,_0x1d032a&&(this['view']['isRendered']?this['_handleQuery'](_0x1d032a,_0x591d05,_0x17e091,_0x494764):this['view']['once']('render',()=>{this['_handleQuery'](_0x1d032a,_0x591d05,_0x17e091,_0x494764);}));}['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'](_0xbe5538,_0x213240,_0x30877e,_0x44681c){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x213240,this['previousQuery']=_0xbe5538,this['previousLabel']=_0x44681c||_0xbe5538,this['previousActionId']=_0x30877e,new Promise(_0x59cb27=>{this['textAdapter']['makeRequest']({'query':_0xbe5538,'context':_0x213240,'onData':_0x594187=>{this['currentResponse']=_0x594187,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x30877e})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x20b12c=>{_0x20b12c instanceof R?this['view']['handleError'](_0x20b12c['message']):this['view']['handleError'](),_0x59cb27();})['finally'](()=>{this['stopProcessing'](),_0x59cb27();});});}['_parseAndNormalizeContent'](_0x514a19,_0x3a4318=!0x1){const _0x55a169=Z['exec'](_0x514a19);_0x514a19=_0x55a169?_0x514a19['substring'](_0x55a169[0x1]['length']):_0x514a19['length']<0x64&&!_0x3a4318?'':this['_stripMarkdownSyntax'](_0x514a19);const _0xa589ae=this['_domParser']['parseFromString'](_0x514a19,'text/html');if(_0x55a169){const _0x3d6013=Array['from'](_0xa589ae['body']['childNodes']);_0x3d6013['reverse']();for(const _0x195e2c of _0x3d6013){if(_0x195e2c['nodeType']==Node['ELEMENT_NODE'])break;_0x195e2c['remove']();}}const _0x4f470e=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xa589ae['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4f470e);const _0x52bc46=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x524323=this['editor']['data']['toModel'](_0x4f470e);return _0x52bc46||_0x524323['markers']['clear'](),this['editor']['data']['stringify'](_0x524323);}['_normalizeResponseHeadings'](_0x3855c7){const _0x45a07d=new _0x4144b3(this['editor']['editing']['view']['document']),_0x12771d=new _0x4ee861({'name':/^h[1-5]$/}),_0xd1eee7=[];let _0xc507ad=!0x1;for(const _0x1354a2 of _0x3855c7)_0x1354a2['is']('element')&&_0x12771d['match'](_0x1354a2)&&(_0xd1eee7['push'](_0x1354a2),'h1'==_0x1354a2['name']&&(_0xc507ad=!0x0));if(_0xc507ad){for(const _0x3a34a3 of _0xd1eee7)_0x45a07d['rename']('h'+(parseInt(_0x3a34a3['name'][0x1])+0x1),_0x3a34a3);}}['_isH1TagSupportEnabled'](){const {data:_0xc87ee6,editing:_0x3d7192}=this['editor'],_0x95752e=_0xc87ee6['htmlProcessor']['toView']('<h1></h1>'),_0xb365ca=_0xc87ee6['toView'](_0xc87ee6['toModel'](_0x95752e));return!!_0x3d7192['view']['domConverter']['viewToDom'](_0xb365ca)['querySelector']('h1');}['_sanitizeHTML'](_0x56005c){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x56005c),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x246b32){const _0x16933f=_0x246b32['trim']();return _0x16933f['startsWith']('```html')?_0x16933f['endsWith']('```')?_0x16933f['substring'](0x7,_0x16933f['length']-0x3):_0x16933f['substring'](0x7):_0x246b32;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x52c9c7){super(_0x52c9c7),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4e51b4=>i(_0x52c9c7,'AI_'+_0x4e51b4['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x52c9c7,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x52c9c7,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x52c9c7,'Stop'));const _0x4045d3=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x4045d3['if']('isVisible','ck-hidden',_0x3c0ece=>!_0x3c0ece)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x10359e,_0x3b7d24){const _0x53a4e1=new _0x1d9c42(this['locale']);return _0x53a4e1['set']({'label':_0x10359e,'class':_0x3b7d24||'','isVisible':!0x0,'withText':!0x0}),_0x53a4e1;}}class Y extends _0x9da3c1{['contentFieldView'];['copyButtonView'];constructor(_0x14944c,_0x469c1e=''){super(_0x14944c),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2971ec=this['bindTemplate'];this['contentFieldView']=new At(_0x14944c,_0x469c1e),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x2971ec['if']('isVisible','ck-hidden',_0x331de5=>!_0x331de5)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x2971ec['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 _0x2fbd17=!0x1;this['on']('change:value',(_0x2cdfbb,_0x474b78,_0x487a42)=>{const _0x11d8cb=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x487a42),this['isProcessing']&&_0x11d8cb&&!_0x2fbd17&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3140d7,_0x5d5fdd,_0xb5fc88)=>{_0x2fbd17=!0x1,_0xb5fc88?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x2fbd17=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x2fbd17=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x219b2e=this['locale'],_0x574508=new _0x1d9c42(this['locale']),_0x349f7e='ck-ai-form__copy-button';return _0x574508['set']({'label':i(_0x219b2e,'Copy'),'icon':_0x4c3526,'class':_0x349f7e,'tooltip':!0x0}),_0x574508['bind']('isVisible')['to'](this,'value',_0x5b5986=>!!_0x5b5986),_0x574508['bind']('isEnabled')['to'](this,'isProcessing',_0x402906=>!_0x402906),_0x574508['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x574508['icon']=_0x386754,_0x574508['class']=_0x349f7e+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x574508['icon']=_0x4c3526,_0x574508['class']=_0x349f7e;},0x3e8);}),_0x574508;}['_copyHTMLToClipboard'](_0x134253){const {window:_0x31a271,document:_0x3e419f}=_0x4dfb0a;if(_0x31a271['ClipboardItem']){const {Blob:_0x120d30,ClipboardItem:_0x3e293b}=_0x31a271,_0x257f86=[new _0x3e293b({'text/html':new _0x120d30([_0x134253['innerHTML']],{'type':'text/html'}),'text/plain':new _0x120d30([_0x134253['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x257f86);}else{const _0x1910cc=_0x3e419f['createElement']('div');_0x1910cc['style']['position']='absolute',_0x1910cc['style']['left']='-9999px',_0x1910cc['innerHTML']='<span>[</span>'+_0x134253['innerHTML']+'<span>]</span>',_0x3e419f['body']['appendChild'](_0x1910cc);const _0x7586d3=_0x3e419f['createRange']();_0x7586d3['setStartAfter'](_0x1910cc['firstElementChild']),_0x7586d3['setEndBefore'](_0x1910cc['lastElementChild']);const _0x13dd2c=_0x31a271['getSelection']();_0x13dd2c['removeAllRanges'](),_0x13dd2c['addRange'](_0x7586d3),_0x3e419f['execCommand']('copy'),_0x1910cc['remove']();}}}class At extends _0x9da3c1{constructor(_0x8b808,_0x239e2f=''){super(_0x8b808),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x239e2f,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1e5a55){this['element']['innerHTML']=_0x1e5a55;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4c2d8d=new _0x9da3c1(),_0x124406=this['locale'],_0x311b57=new _0xccea55();return _0x311b57['isVisible']=!0x0,_0x4c2d8d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x311b57,{'text':i(_0x124406,'AI\x20is\x20writing...')}]}),_0x4c2d8d['render'](),_0x4c2d8d;}}class st extends _0x9da3c1{constructor(_0xd51300,_0x302cf9=''){super(_0xd51300);const _0x2a458d=new rt(),_0x53e520=this['bindTemplate'];this['set']('text',_0x302cf9),_0x2a458d['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2a458d,{'text':_0x53e520['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x152828,_0x1f5116){super(_0x152828,_0x1f5116),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',(_0x124559,_0x338736)=>{_0x124559['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x338736());});}['_createSubmitButton'](){const _0x4c4477=new _0x1d9c42(this['locale']),_0x5ed32a=this['locale'];return _0x4c4477['set']({'icon':ht,'label':i(_0x5ed32a,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x4c4477['on']('execute',()=>{this['submit']();}),_0x4c4477['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0xf1d647,_0x1a2740)=>!_0xf1d647&&_0x1a2740),_0x4c4477;}['_createShowHistoryButton'](){const _0x499ceb=new _0x1d9c42(this['locale']),_0x456dd8=this['resultsView'],_0x36a0cd=this['locale'];_0x499ceb['set']({'label':i(_0x36a0cd,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x499ceb['bind']('isOn')['to'](_0x456dd8,'isVisible'),_0x499ceb['bind']('isEnabled')['to'](this,'isEnabled'),_0x499ceb['on']('execute',()=>{_0x456dd8['isVisible']=!_0x456dd8['isVisible'],_0x456dd8['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x353c90=()=>{_0x4dfb0a['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x3f857d=new it(this['queryView']['fieldView']['element']),_0x53e245=_0x3f857d['width'],_0x4ed850='rtl'===_0x36a0cd['uiLanguageDirection']?'left':'right';_0x3f857d['excludeScrollbarsAndBorders'](),_0x499ceb['element']['style'][_0x4ed850]=_0x53e245-_0x3f857d['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x353c90),this['on']('render',_0x353c90),_0x499ceb;}['submit'](){const _0x390de8=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x390de8);}['focus'](_0x59a705){-0x1===_0x59a705?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x19395c){super(_0x19395c),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x19395c,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x17d699=0x0;for(const _0x4f8ec2 of this['items'])_0x17d699+=_0x4f8ec2['items']['length'];return{'resultsCount':_0x17d699,'totalItemsCount':_0x17d699};}['_createClearHistoryButton'](){const _0x565448=this['locale'],_0x3b72a7=new _0x1d9c42(this['locale']);return _0x3b72a7['set']({'label':'('+i(_0x565448,'Clear')+')','withText':!0x0}),_0x3b72a7['on']('execute',()=>this['fire']('clearHistory')),_0x3b72a7;}}class bt extends xt{constructor(_0x45b1a1){super();const _0x54a23e=new kt(),_0x3ee108=new _0x1d9c42(this['locale'],_0x54a23e);this['children']['add'](_0x3ee108),_0x3ee108['set']({'label':_0x45b1a1['prompt'],'withText':!0x0}),_0x3ee108['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x45b1a1['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x2a372e{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x31b92b,_0x5cec55)=>{const _0x2ed12c=os(_0x5cec55['prompt']);for(const _0x4aa00f of this)if(_0x4aa00f!=_0x5cec55&&os(_0x4aa00f['prompt'])===_0x2ed12c){this['remove'](_0x4aa00f);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x17ee29=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x17ee29));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x68dbf=>_0x68dbf)));}}function os(_0x247082){return _0x247082['toLowerCase']()['trim']();}class _ extends _0x9da3c1{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2a324e,_0x293528,_0x184a7c=''){super(_0x2a324e),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new wt(),this['errorView']=new st(_0x2a324e),this['contentArea']=new Y(_0x2a324e,_0x184a7c),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 mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'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 _0x132c30=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x293528],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x132c30['if']('isError','ck-hidden',_0x2e8f9f=>!_0x2e8f9f)]},'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'](_0x28cc09=0x1){-0x1===_0x28cc09?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 _0x3f9507=this['locale'],_0x4f1367=new ct(_0x3f9507,{'queryView':{'label':i(_0x3f9507,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x3f9507,'Empty\x20history'),'secondary':i(_0x3f9507,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4f1367['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3db4c9,_0x442414)=>_0x3db4c9&&!_0x442414),this['listenTo'](_0x4f1367,'submit',(_0x2170e6,_0x35e113)=>{this['prompt']=_0x35e113;const _0x4d614a=yt(_0x35e113);this['fire']('submitPrompt',_0x4d614a),_0x35e113['trim']()&&this['_promptHistory']['add']({'prompt':_0x4d614a},0x0);},{'priority':'high'}),_0x4f1367;}['_createHistoryView'](){const _0x54518d=new ft(this['locale']);return _0x54518d['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x54518d['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x54518d;}['_createToolbar'](){const _0x4b1012=new lt(this['locale']);return _0x4b1012['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x546cee,_0x483fc0,_0x15ed48)=>_0x546cee&&!_0x483fc0&&!!_0x15ed48),_0x4b1012['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4b1012['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x437d89,_0x25a378,_0x5d72c4)=>_0x437d89&&!_0x25a378&&!!_0x5d72c4),_0x4b1012['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4b1012['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x91614e,_0x1b5b53)=>_0x91614e&&!_0x1b5b53),_0x4b1012['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4b1012['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4b1012['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4b1012;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x46da72=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x46da72,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x189811){const _0x55b9a5=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x189811||i(_0x55b9a5,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x1b36ae{['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[_0x1685eb,a,E,_0x450c47];}constructor(_0x1f340b){super(_0x1f340b),_0x1f340b['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1f340b['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x1f340b['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1f340b['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1c93ce}=this;this['_aiAdapter']=_0x1c93ce['plugins']['get'](E),this['_dialog']=_0x1c93ce['plugins']['get'](_0x450c47),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x58b02d=new j(_0x1c93ce,Array['from'](this['_commandDefinitions']['values']()));_0x1c93ce['commands']['add']('showAIAssistant',_0x58b02d),_0x1c93ce['ui']['componentFactory']['add']('aiCommands',_0x22d146=>{const _0x534989=_0xed54d7(_0x22d146);return _0x534989['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x534989['buttonView']['set']({'label':i(_0x22d146,'AI\x20Commands'),'icon':_0xf59f00,'tooltip':!0x0}),_0x534989['on']('execute',_0x1d7388=>this['_onExecute'](_0x1d7388['source']['id'])),_0x2fe561(_0x534989,_0x1c93ce['ui']['view']['body'],function(_0x4499f2){const _0x34b70e=o(_0x4499f2['config']['get']('ai.aiAssistant.commands'),_0x4499f2['locale']),_0x5e7383=U(_0x4499f2,_0x34b70e)['filter'](_0x2cd37f=>_0x2cd37f['commands']['length']);if(0x1===_0x5e7383['length'])return U(_0x4499f2,_0x5e7383[0x0]['commands'])['map'](_0x450ce1=>({'id':_0x450ce1['id'],'label':_0x450ce1['label']}));return _0x5e7383['map'](_0x2571b2=>{const {groupId:_0x5a8f54,groupLabel:_0x197755,commands:_0x40f773}=_0x2571b2,_0x180e4a=U(_0x4499f2,_0x40f773)['map'](_0x2be94e=>({'id':_0x2be94e['id'],'label':_0x2be94e['label']}));return{'id':_0x5a8f54,'menu':_0x197755||_0x5a8f54,'children':_0x180e4a};});}(_0x1c93ce),{'ariaLabel':i(_0x22d146,'AI\x20Commands')}),_0x534989['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x58b02d['on']('change:enabledCommandsIds',_0x2d447d),_0x534989['menuView']['once']('render',_0x2d447d),_0x534989;function _0x2d447d(){_0x534989['isEnabled']=_0x58b02d['enabledCommandsIds']['length']>0x0;for(const _0x1fff57 of _0x534989['menuView']['buttons'])_0x1fff57['isEnabled']=_0x58b02d['enabledCommandsIds']['includes'](_0x1fff57['id']);}}),_0x1c93ce['ui']['componentFactory']['add']('menuBar:aiCommands',_0x557782=>{const _0x67aab8=new _0x30d9e3(_0x557782);_0x67aab8['buttonView']['set']({'label':i(_0x557782,'AI\x20Commands'),'icon':_0xf59f00}),_0x67aab8['bind']('isEnabled')['to'](_0x58b02d,'enabledCommandsIds',_0x581e93=>_0x581e93['length']>0x0);const _0x2ceb0a=o(_0x1c93ce['config']['get']('ai.aiAssistant.commands'),_0x557782);return this['_populateMenuBarMenu'](_0x58b02d,_0x67aab8,_0x2ceb0a,_0x2a4c6b=>this['_onExecute'](_0x2a4c6b)),_0x67aab8;}),_0x1c93ce['ui']['componentFactory']['add']('aiAssistant',()=>{const _0xb062af=this['_createAIAssistantUIButton'](_0x1d9c42);return _0xb062af['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0xb062af;}),_0x1c93ce['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x58d551=this['_createAIAssistantUIButton'](_0x14ae59);return _0x58d551['set']({'role':'menuitemcheckbox'}),_0x58d551;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2e91f9=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x107044;for(const _0xf89702 in _0x2e91f9){const _0xfb724c=_0xf89702,_0x529192=_0x2e91f9[_0xfb724c];if('aiLicenseKeyValid'==_0x529192||'aiLicenseKeyInvalid'==_0x529192||'aiLicenseKeyExpired'==_0x529192||'aiLicenseKeyDomainLimit'==_0x529192||'aiLicenseKeyNotAllowed'==_0x529192||'aiLicenseKeyEvaluationLimit'==_0x529192||'aiLicenseKeyTrialLimit'==_0x529192||'aiLicenseKeyUsageLimit'==_0x529192){delete _0x2e91f9[_0xfb724c],_0x107044=_0x529192,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x107044&&_0x2e91f9['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x107044&&_0x2e91f9['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x107044&&_0x2e91f9['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x107044&&_0x2e91f9['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x107044&&_0x2e91f9['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x107044&&_0x2e91f9['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x107044&&_0x2e91f9['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x1be830='',_0x2c76ea='',_0x37362d='custom'){const _0xcf6240=this['editor'],_0x3125a4=_0xcf6240['editing']['view'],_0x4e780b=_0xcf6240['plugins']['get'](a),_0x29faf0=_0xcf6240['plugins']['get'](_0x1685eb);_0x4e780b['showFakeVisualSelection']();const _0x252acd=new w(),_0x197ed1=new ClipboardEvent('copy',{'clipboardData':_0x252acd}),_0x12912b=new _0x468a5a(_0x252acd),_0x1e79bd=new _0x3dbcec(_0x3125a4,_0x197ed1,{'dataTransfer':_0x12912b});_0x29faf0['_forceMarkersCopy']('comment',()=>{_0x3125a4['document']['fire']('copy',_0x1e79bd);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0xcf6240,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x11a686=_0x12912b['getData']('text/html');const _0x2b4ad1=_0xcf6240['model']['document']['selection'],_0xbcd411=Array['from'](_0x2b4ad1['getRanges']());0x1===_0xbcd411['length']&&_0xbcd411[0x0]['isFlat']&&!_0x2b4ad1['getSelectedElement']()&&''!==_0x11a686['replace'](/ /g,'')['trim']()&&(_0x11a686='<p>'+_0x11a686+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x37362d,'query':_0x1be830,'htmlContent':_0x11a686,'label':_0x2c76ea,'mainActionLabel':M[_0xcf6240['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x5418d4,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x5e497d['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4e780b['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x1c7919=new Map(),_0x4d634c=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x433169 of _0x4d634c)for(const _0x5d6172 of _0x433169['commands'])_0x1c7919['set'](_0x5d6172['id'],{..._0x5d6172,'groupId':_0x433169['groupId'],'groupLabel':_0x433169['groupLabel']||_0x433169['groupId']});return _0x1c7919;}['_createAIAssistantUIButton'](_0x1b1e32){const _0x9adefe=this['editor'],_0x5c1387=_0x9adefe['commands']['get']('showAIAssistant'),_0x8f288e=new _0x1b1e32(_0x9adefe['locale']);return _0x8f288e['set']({'label':i(_0x9adefe['locale'],'AI\x20Assistant'),'icon':_0x5418d4,'isToggleable':!0x0}),_0x8f288e['bind']('isEnabled')['to'](_0x5c1387),_0x8f288e['bind']('isOn')['to'](this['_dialog'],'id',_0xa13997=>'aiAssistant'===_0xa13997),this['listenTo'](_0x8f288e,'execute',()=>{_0x8f288e['isOn']?this['hideUI']():_0x5c1387['execute']();}),_0x8f288e;}['_initView'](){const _0x1371d0=this['editor']['plugins']['get'](a);this['_formView']=new _(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',()=>{_0x1371d0['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1371d0['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x487956,ui:{ariaLiveAnnouncer:_0x474b9a}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5ee2c7,_0x521df7,_0x32a529)=>{const _0x4928c8=this['_aiAssistantController']['currentContext'];_0x32a529?_0x474b9a['announce'](i(_0x487956,'AI\x20is\x20writing')):_0x4928c8&&_0x474b9a['announce'](i(_0x487956,'Generated\x20content:\x20%0',_0x4928c8),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3670de,_0x3a7729,_0x4971f7)=>{if(_0x4971f7){const _0x1e6bfe=this['_formView']['errorView']['text'];_0x474b9a['announce'](i(_0x487956,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1e6bfe));}});}['_onExecute'](_0x52f42c){const _0x15c9e9=this['_commandDefinitions']['get'](_0x52f42c),_0x10057c=this['editor'],_0xc5cb1a=_0x10057c['model']['document']['selection'],_0x8572f0=_0x10057c['commands']['get']('showAIAssistant'),_0x3018ad=_0x10057c['plugins']['get'](a),_0x3fd070=''+(_0x15c9e9['groupId']!==x?_0x15c9e9['groupLabel']+':\x20':'')+_0x15c9e9['label'];if(!0x1!==_0x15c9e9['requiresContent']&&_0xc5cb1a['isCollapsed']){const _0x362057=_0x1aa9f1(_0xc5cb1a['getSelectedBlocks']())||_0x10057c['model']['schema']['getLimitElement'](_0xc5cb1a);_0x10057c['model']['change'](_0x29396b=>{_0x29396b['setSelection'](_0x362057,'in');});}_0x3018ad['showFakeVisualSelection'](),_0x8572f0['execute'](_0x15c9e9['prompt'],_0x3fd070,'command:'+_0x52f42c);}['_populateMenuBarMenu'](_0x186727,_0x416265,_0x34f07c,_0x49bb80){const _0x1e2f64=this['editor'],_0x498099=_0x1e2f64['locale'],_0x5ec03c=new _0x512bac(_0x498099),_0x44ba24=U(_0x1e2f64,_0x34f07c)['filter'](_0x307e54=>_0x307e54['commands']['length']);0x1===_0x44ba24['length']?this['_getMenuBarGroupButtons']({'command':_0x186727,'commands':_0x44ba24[0x0]['commands'],'parentMenuView':_0x416265,'onExecute':_0x49bb80})['forEach'](_0x75de75=>_0x5ec03c['items']['add'](_0x75de75)):_0x44ba24['forEach'](({groupId:_0x4ba180,groupLabel:_0x1b2e8c,commands:_0x4c512d})=>{const _0x684221=new _0x5dd50e(_0x498099,_0x416265),_0x20e95e=new _0x30d9e3(_0x498099),_0x572eca=new _0x512bac(_0x498099),_0x2a503f=this['_getMenuBarGroupButtons']({'command':_0x186727,'commands':_0x4c512d,'parentMenuView':_0x20e95e,'onExecute':_0x49bb80});_0x20e95e['buttonView']['set']({'label':_0x1b2e8c||_0x4ba180}),_0x20e95e['delegate']('execute')['to'](_0x416265),_0x572eca['items']['addMany'](_0x2a503f),_0x20e95e['panelView']['children']['add'](_0x572eca),_0x684221['children']['add'](_0x20e95e),_0x5ec03c['items']['add'](_0x684221);}),_0x416265['panelView']['children']['add'](_0x5ec03c);}['_getMenuBarGroupButtons']({command:_0x48e0ac,commands:_0x1c28bd,parentMenuView:_0x2a3fd6,onExecute:_0xc844a5}){const _0x1b61ad=this['editor'],_0x25a96e=_0x1b61ad['locale'];return U(_0x1b61ad,_0x1c28bd)['map'](_0x4f7c85=>{const _0x3aed89=new _0x5dd50e(_0x25a96e,_0x2a3fd6),_0x17af2f=new _0x14ae59(_0x25a96e);return _0x17af2f['set']({'label':_0x4f7c85['label']}),_0x17af2f['delegate']('execute')['to'](_0x2a3fd6),_0x17af2f['on']('execute',()=>_0xc844a5(_0x4f7c85['id'])),_0x17af2f['bind']('isEnabled')['to'](_0x48e0ac,'enabledCommandsIds',_0x18879f=>_0x18879f['includes'](_0x4f7c85['id'])),_0x3aed89['children']['add'](_0x17af2f),_0x3aed89;});}}function B(_0x4622b8,_0x6dbcbc){return void 0x0!==_0x4622b8['order']&&void 0x0===_0x6dbcbc['order']?0x1:void 0x0===_0x4622b8['order']&&void 0x0!==_0x6dbcbc['order']?-0x1:void 0x0!==_0x4622b8['order']&&void 0x0!==_0x6dbcbc['order']?_0x4622b8['order']-_0x6dbcbc['order']:0x0;}function U(_0x1568d6,_0x6ad135){_0x6ad135['sort'](B);const _0x116c9c={},_0x1dc4b5=[];for(const _0x21b8d0 of _0x6ad135)if(void 0x0!==_0x21b8d0['order']){if(_0x21b8d0['order']in _0x116c9c)throw new _0x54aebf('ai-commands-config-order-collision',_0x1568d6,{'conflictingDefinitions':[_0x21b8d0,_0x116c9c[_0x21b8d0['order']]]});_0x116c9c[_0x21b8d0['order']]=_0x21b8d0,_0x1dc4b5['splice'](_0x21b8d0['order'],0x0,_0x21b8d0);}else _0x1dc4b5['push'](_0x21b8d0);return _0x1dc4b5;}class r extends _0x1b36ae{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xb7aafd){super(_0xb7aafd);const _0x46ead9=_0xb7aafd['config'],_0x1a66a2=_0xb7aafd['locale'];_0x46ead9['define']('ai.aiAssistant.preserveComments',!0x0),_0x46ead9['define']('ai.aiAssistant.commands',function(_0x314811){return[{'groupId':'editOrReview','groupLabel':i(_0x314811,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x314811,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x314811,'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(_0x314811,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x314811,'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(_0x314811,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x314811,'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(_0x314811,'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(_0x314811,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x314811,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x314811,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x314811,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x314811,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x314811,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x314811,'Change\x20style'),'commands':[{'id':'business','label':i(_0x314811,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x314811,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x314811,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x314811,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x314811,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x314811,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x314811,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x314811,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x314811,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x314811,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x314811,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x314811,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x314811,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x1a66a2)),_0x46ead9['define']('ai.aiAssistant.extraCommandGroups',[]),_0x46ead9['define']('ai.aiAssistant.removeCommands',[]);let _0x21bae6=o(_0x46ead9['get']('ai.aiAssistant.commands'),_0x1a66a2);const _0x1719dc=_0x46ead9['get']('ai.aiAssistant.extraCommandGroups'),_0x35cf72=_0x46ead9['get']('ai.aiAssistant.removeCommands');_0x1719dc['forEach'](_0x265f00=>{const _0x16110=_0x21bae6['find'](_0x562134=>_0x562134['groupId']===_0x265f00['groupId']);_0x16110?_0x16110['commands']=_0x16110['commands']['concat'](_0x265f00['commands']):_0x21bae6['push'](_0x265f00);}),_0x21bae6=_0x21bae6['filter'](_0x404f10=>!_0x35cf72['includes'](_0x404f10['groupId'])),_0x21bae6['forEach'](_0x1bd328=>{_0x1bd328['commands']=_0x1bd328['commands']['filter'](_0xe2563=>!_0x35cf72['includes'](_0xe2563['id']));}),_0x46ead9['set']('ai.aiAssistant.commands',_0x21bae6);}}class P extends _0x1b36ae{['abortController'];static get['requires'](){return[E];}constructor(_0x2fb76d){super(_0x2fb76d),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x31361a){return this['sendRequest'](_0x31361a)['catch'](_0x5d043b=>{if(_0x5d043b instanceof R)return Promise['reject'](_0x5d043b);if('AbortError'==_0x5d043b['name'])return Promise['resolve']();throw console['error'](_0x5d043b),new _0x54aebf('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x187aa3,_0x4e376d){const _0x22c536=this['editor']['locale'],_0x3db0e9={'Content-Type':'application/json'};if('object'==typeof _0x187aa3)Object['assign'](_0x3db0e9,_0x187aa3);else{if(_0x187aa3)try{const _0x43ec3c=await _0x187aa3(_0x4e376d);Object['assign'](_0x3db0e9,_0x43ec3c);}catch{return Promise['reject'](new R(i(_0x22c536,'AI_ERROR_GET_HEADERS')));}}return _0x3db0e9;}async['_prepareRequestParameters'](_0x266b74,_0x12ca05){const _0x1420c8=this['editor']['locale'];if('object'==typeof _0x266b74)return _0x266b74;try{return await _0x266b74(_0x12ca05);}catch{return Promise['reject'](new R(i(_0x1420c8,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x34132d){super(_0x34132d),_0x34132d['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x34132d['config']['get']('ai.openAI.requestParameters')||_0x34132d['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x34132d['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x34132d['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x34132d['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x5e9c47,context:_0x17ec74,onData:_0x44c78e,actionId:_0x383d9d}){const _0x4f08ff=this['editor']['locale'],_0x4f4888=await this['prepareMessages'](_0x5e9c47,_0x17ec74,_0x383d9d),_0x356e3e=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x383d9d),_0x2a4054=await this['_prepareRequestParameters'](this['_requestParameters'],_0x383d9d),_0x528e9a={'messages':_0x4f4888,..._0x2a4054},_0x121d01={'method':'POST','headers':_0x356e3e,'body':JSON['stringify'](_0x528e9a),'signal':this['abortController']['signal']},_0x21ccbe=await fetch(this['_apiUrl'],_0x121d01);if(_0x21ccbe['ok'])return _0x2a4054['stream']?await this['_readStreamableResponse'](_0x21ccbe,_0x44c78e):await this['_readStaticResponse'](_0x21ccbe,_0x44c78e),Promise['resolve']();{const _0x5e359c=await _0x21ccbe['text']();return _0x5e359c['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x4f08ff,'AI_ERROR_CONTEXT_LENGTH'))):_0x5e359c['includes']('Moderation')?Promise['reject'](new R(i(_0x4f08ff,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x5e359c));}}async['prepareMessages'](_0x42fea9,_0x34732,_0x3e5fe2){let _0x12a3d9,_0x5f09b6;return _0x34732?(_0x12a3d9='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.',_0x5f09b6='Instruction:\x0a'+_0x42fea9+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x34732):(_0x12a3d9='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.',_0x5f09b6=_0x42fea9),[{'role':'system','content':_0x12a3d9},{'role':'user','content':_0x5f09b6}];}async['_readStreamableResponse'](_0x58ffaa,_0x3fc824){const _0x1779dc=_0x58ffaa['body']['getReader'](),_0xef02c7=new TextDecoder();let _0x3c5225='',_0x386b9c='',_0x593a62='',_0x19c02e=!0x1;for(;!_0x19c02e;){const {done:_0x27af2f,value:_0x3de78f}=await _0x1779dc['read'](),_0x24d91f=_0x3c5225+_0xef02c7['decode'](_0x3de78f);let _0x35b664='';_0x19c02e=_0x27af2f;try{_0x35b664=this['_cleanUpData'](_0x24d91f),_0x3c5225='';}catch{_0x3c5225=_0x24d91f;continue;}_0x386b9c+=_0x35b664,!_0x19c02e&&this['_isBufferIncomplete'](_0x386b9c)||_0x386b9c&&(_0x593a62+=_0x386b9c,_0x386b9c='',_0x3fc824(_0x593a62));}return Promise['resolve']();}async['_readStaticResponse'](_0x203aa8,_0x46881f){return _0x46881f((await _0x203aa8['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0xf2a80c){const _0xde5db=_0xf2a80c['split']('<')['length']!==_0xf2a80c['split']('>')['length'],_0x3baacf=_0xf2a80c['length']<0x1e;return _0xde5db&&_0x3baacf;}['_cleanUpData'](_0x34bcf5){return _0x34bcf5['split'](/\n(?![^{]*\})/g)['map'](_0x3ca1ee=>_0x3ca1ee['replace']('data:\x20',''))['filter'](_0x369cd9=>_0x369cd9&&_0x369cd9['length']>0x0&&'[DONE]'!==_0x369cd9)['map'](_0x1e5985=>{const {choices:_0x3a4bce}=JSON['parse'](_0x1e5985);if(_0x3a4bce[0x0]?.['delta']?.['content'])return _0x3a4bce[0x0]['delta']['content'];})['filter'](_0x74b84c=>_0x74b84c)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x38fa98){super(_0x38fa98),_0x38fa98['config']['get']('ai.aws.requestParameters')||_0x38fa98['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']=_0x38fa98['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x38fa98['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x38fa98['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x38fa98['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x2ef870,context:_0x1bf414,onData:_0x33f6ea,actionId:_0x9a9d17}){const {model:_0x5c8eb8,stream:_0x2ae69d,..._0x123729}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x9a9d17),_0x78bdf0={'prompt':await this['preparePrompt'](_0x2ef870,_0x1bf414,_0x5c8eb8,_0x9a9d17),..._0x123729};this['_apiUrl']?await this['_processProxyRequest'](_0x78bdf0,_0x5c8eb8,_0x2ae69d,_0x33f6ea,_0x9a9d17):await this['_processAWSRequest'](_0x78bdf0,_0x5c8eb8,_0x2ae69d,_0x33f6ea);}async['preparePrompt'](_0x11b212,_0x38b68f,_0x10640c,_0x492071){let _0x44270e,_0x4d9918;return _0x38b68f?(_0x44270e='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.',_0x4d9918='Instruction:\x0a'+_0x11b212+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x38b68f):(_0x44270e='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.',_0x4d9918=_0x11b212),'meta.llama'==this['getModelFamily'](_0x10640c)?'<<SYS>>\x0a'+_0x44270e+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4d9918+'\x0a[/INST]':'Human:\x0a'+_0x44270e+'\x0a'+_0x4d9918+'\x0a\x0aAssistant:';}['getModelFamily'](_0xe5f7f4){if(/^anthropic\.claude/['test'](_0xe5f7f4))return'anthropic.claude';if(/^ai21\.j2/['test'](_0xe5f7f4))return'ai21.j2';if(/^cohere\.command/['test'](_0xe5f7f4))return'cohere.command';if(/^meta\.llama/['test'](_0xe5f7f4))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0xe5f7f4));}async['_processProxyRequest'](_0x5ad9c7,_0x4ff75e,_0x1f4248,_0x2087c2,_0x38b6c2){const _0x98daf0={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x38b6c2),'body':JSON['stringify']({..._0x5ad9c7,'model':_0x4ff75e,'stream':_0x1f4248}),'signal':this['abortController']['signal']},_0x167de8=await fetch(this['_apiUrl'],_0x98daf0);_0x1f4248?await this['_readStreamableResponse'](_0x167de8,_0x4ff75e,_0x2087c2):await this['_readStaticResponse'](_0x167de8,_0x4ff75e,_0x2087c2);}async['_processAWSRequest'](_0x2a2f32,_0x5b452c,_0x20946b,_0x207e39){const _0x4486b=new _0x122d1e(this['_bedrockClientConfig']),_0xc8fc86={'body':JSON['stringify'](_0x2a2f32),'contentType':'application/json','accept':'application/json','modelId':_0x5b452c};let _0x51eea7;if(_0x20946b){const _0x59b270=new _0x3a6bba(_0xc8fc86);_0x51eea7=await _0x4486b['send'](_0x59b270,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x51eea7,_0x5b452c,_0x207e39);}else{const _0x4057c1=new _0x33435d(_0xc8fc86);_0x51eea7=await _0x4486b['send'](_0x4057c1,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x51eea7,_0x5b452c,_0x207e39);}}async['_readAsyncIterableResponse'](_0x20aa25,_0xbed546,_0x70f989){const _0x492a32=_0x20aa25['body'],_0x16d8c0=new TextDecoder('utf-8');let _0x3fce50='';for await(const _0x55d262 of _0x492a32)if(_0x55d262['chunk']){const _0x5199c2=_0x16d8c0['decode'](_0x55d262['chunk']['bytes']),_0x24bb09=JSON['parse'](_0x5199c2);_0x3fce50+=this['_getGeneratedText'](_0x24bb09,_0xbed546),_0x70f989(_0x3fce50);}return Promise['resolve']();}async['_readStreamableResponse'](_0x44dade,_0x224303,_0x1bda43){const _0x51af52=_0x44dade['body'],_0x541374=new TextDecoder('utf-8'),_0x48cce1=_0x51af52['getReader']();let _0x122484='',_0xedb505='',_0x2ead0b=!0x1;for(;!_0x2ead0b;){const {done:_0x5bac93,value:_0x280a43}=await _0x48cce1['read']();if(_0x2ead0b=_0x5bac93,_0x2ead0b)break;const _0x2c6195=(_0x122484+_0x541374['decode'](_0x280a43))['split']('\x0a')['map'](_0x2515a4=>{try{return _0x122484='',JSON['parse'](_0x2515a4);}catch{return _0x122484=_0x2515a4,null;}})['filter'](_0x47f180=>null!==_0x47f180);_0x2c6195['length']&&(_0xedb505+=_0x2c6195['map'](_0x29748e=>this['_getGeneratedText'](_0x29748e,_0x224303))['join'](''),_0x1bda43(_0xedb505));}return Promise['resolve']();}async['_readStaticResponse'](_0x10f7ec,_0x49f1c1,_0x317e0b){let _0x27ab65;return _0x27ab65=_0x10f7ec instanceof Response?await _0x10f7ec['json']():JSON['parse'](Buffer['from'](_0x10f7ec['body'])['toString']('utf8')),(_0x317e0b(this['_getGeneratedText'](_0x27ab65,_0x49f1c1)),Promise['resolve']());}['_getGeneratedText'](_0x2f30fb,_0x41e94a){switch(this['getModelFamily'](_0x41e94a)){case'anthropic.claude':return _0x2f30fb['completion'];case'ai21.j2':return _0x2f30fb['completions'][0x0]['data']['text'];case'cohere.command':return _0x2f30fb['generations'][0x0]['text'];case'meta.llama':return _0x2f30fb['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
|
|
23
|
+
import{Plugin as _0x2141a7,Command as _0x1753db}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x25d06d,IconCheck as _0x3d4704,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0xfcc0af,IconRobotPencil as _0x4a2c5f}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x1678c8,CKEditorError as _0x2c453e,ObservableMixin as _0x32a727,global as _0x280648,isVisible as ot,Rect as it,Collection as _0x193d7b,FocusTracker as mt,KeystrokeHandler as ut,first as _0x589312}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x1d57a2,View as _0xd64d08,SpinnerView as _0x53dc20,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x3e357e,createDropdown as _0x5b23cd,addMenuToDropdown as _0x52b4e5,MenuBarMenuView as _0x5e7641,MenuBarMenuListItemButtonView as _0xb1dcc0,DialogViewPosition as _0x3073c0,MenuBarMenuListView as _0x4e401a,MenuBarMenuListItemView as _0x35210b}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x5cad60,ClipboardMarkersUtils as _0x3650f3}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x2cb29c,DataTransfer as _0x3ed6a0,UpcastWriter as _0x143e6a,Matcher as _0x15c29a}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x55fd7a,InvokeModelWithResponseStreamCommand as _0x5d8c68,InvokeModelCommand as _0x32bf9}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x214ac4,_0x79a6b0){const _0x1e8053=(0x0,_0x79a6b0['t'])('Other');return _0x214ac4['length']?'groupId'in _0x214ac4[0x0]?_0x214ac4:[{'groupId':x,'groupLabel':_0x1e8053,'order':0x1/0x0,'commands':_0x214ac4}]:[{'groupId':x,'groupLabel':_0x1e8053,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x2141a7{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x106b4a}=this,_0x484701=['ck-fake-ai-selection'];_0x106b4a['config']['get']('ai.useTheme')&&_0x484701['push']('ck-ai-assistant-ui_theme'),_0x106b4a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x484701,'priority':0xc}}),_0x106b4a['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x567a27,{writer:_0x5c4d1b})=>{if(!_0x567a27['markerRange']['isCollapsed'])return null;const _0x272c0e=_0x5c4d1b['createUIElement']('span');return _0x5c4d1b['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x272c0e),_0x272c0e;}});}['afterInit'](){!async function(_0x203690){const _0x3b7b11=_0x446e19([0x5a,0x73,0x42,0x4a,0x35,0x68,0x6c,0x55,0x50,0x53,0x70,0x48,0x79,0x65,0x63,0x6b,0x34,0x30,0x32,0x6a,0x76,0x51,0x78,0x57,0x52,0x7a,0x4d,0x45,0x75,0x6d,0x66,0x77,0x62,0x71,0x37,0x69,0x4f,0x67,0x31,0x74,0x4e,0x4c,0x41,0x59,0x49,0x54,0x47,0x4b,0x39,0x46,0x61,0x56,0x58,0x72,0x6f,0x64,0x33,0x44,0x38,0x43,0x6e,0x36]),_0x18dfbf=0x7bc975de,_0x64065f=0x7bce1c16^_0x18dfbf,_0x5334df=window[_0x446e19([0x44,0x61,0x74,0x65])][_0x446e19([0x6e,0x6f,0x77])](),_0x5404fa=_0x203690[_0x446e19([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x1acf3e=new window[(_0x446e19([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x27be14=>{_0x5404fa[_0x446e19([0x6f,0x6e,0x63,0x65])](_0x446e19([0x72,0x65,0x61,0x64,0x79]),_0x27be14);}),_0x36670e={[_0x446e19([0x6b,0x74,0x79])]:_0x446e19([0x45,0x43]),[_0x446e19([0x75,0x73,0x65])]:_0x446e19([0x73,0x69,0x67]),[_0x446e19([0x63,0x72,0x76])]:_0x446e19([0x50,0x2d,0x32,0x35,0x36]),[_0x446e19([0x78])]:_0x446e19([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]),[_0x446e19([0x79])]:_0x446e19([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]),[_0x446e19([0x61,0x6c,0x67])]:_0x446e19([0x45,0x53,0x32,0x35,0x36])},_0x139ae6=_0x5404fa[_0x446e19([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x446e19([0x67,0x65,0x74])](_0x446e19([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x20a63a(){let _0x5bd3d6,_0x430077=null,_0x2f363a=null;try{if(_0x139ae6==_0x446e19([0x47,0x50,0x4c]))return _0x446e19([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5bd3d6=_0x4146bf(),!_0x5bd3d6)return _0x446e19([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5bd3d6[_0x446e19([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2f363a=_0x59040a(_0x5bd3d6[_0x446e19([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5bd3d6[_0x446e19([0x6a,0x74,0x69])])),await _0x2fd72f()?_0x2ac597()?_0x288ede()?_0x446e19([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xd7f100()?(_0x5bd3d6[_0x446e19([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x446e19([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x430077=_0x420de0(_0x446e19([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x5bd3d6[_0x446e19([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x446e19([0x74,0x72,0x69,0x61,0x6c])&&(_0x430077=_0x420de0(_0x446e19([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x193871()):_0x446e19([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x446e19([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x446e19([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x446e19([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x288ede(){const _0x5b0e8e=[_0x446e19([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x446e19([0x74,0x72,0x69,0x61,0x6c])][_0x446e19([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5bd3d6[_0x446e19([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5334df/0x3e8:0xe10*_0x64065f;return _0x5bd3d6[_0x446e19([0x65,0x78,0x70])]<_0x5b0e8e;}function _0x2ac597(){const _0x5df87a=_0x5bd3d6[_0x446e19([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x5df87a&&(!!_0x5df87a[_0x446e19([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x446e19([0x2a]))||!!_0x5df87a[_0x446e19([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x446e19([0x41,0x49])));}function _0xd7f100(){const _0x1a5c27=_0x5bd3d6[_0x446e19([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1a5c27||0x0==_0x1a5c27[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x46f6af}=new URL(window[_0x446e19([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1a5c27[_0x446e19([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x46f6af))return!0x0;const _0x16c9ea=_0x46f6af[_0x446e19([0x73,0x70,0x6c,0x69,0x74])](_0x446e19([0x2e]));return _0x1a5c27[_0x446e19([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3bd8c1=>_0x3bd8c1[_0x446e19([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x446e19([0x2a])))[_0x446e19([0x6d,0x61,0x70])](_0xacea29=>_0xacea29[_0x446e19([0x73,0x70,0x6c,0x69,0x74])](_0x446e19([0x2e])))[_0x446e19([0x73,0x6f,0x6d,0x65])](_0x2df84d=>_0x16c9ea[_0x446e19([0x65,0x76,0x65,0x72,0x79])]((_0x5705f4,_0xba5455)=>_0x2df84d[_0xba5455]===_0x5705f4||_0x2df84d[_0xba5455]===_0x446e19([0x2a])));}function _0x193871(){return _0x430077&&_0x2f363a?new window[(_0x446e19([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4cfec4,_0x3bc7b3)=>{_0x430077[_0x446e19([0x74,0x68,0x65,0x6e])](_0x4cfec4,_0x3bc7b3),_0x2f363a[_0x446e19([0x74,0x68,0x65,0x6e])](_0x558839=>{_0x558839!=_0x446e19([0x56,0x61,0x6c,0x69,0x64])&&_0x4cfec4(_0x558839);},_0x3bc7b3);}):_0x430077||_0x2f363a||_0x446e19([0x56,0x61,0x6c,0x69,0x64]);}}function _0x59040a(_0x302a6b,_0xf60d10){return new window[(_0x446e19([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2b01da=>{if(_0x30be9b())return _0x2b01da(_0x446e19([0x56,0x61,0x6c,0x69,0x64]));_0x19e0d0(),_0x5404fa[_0x446e19([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x446e19([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3e85e0=!0x1;const _0x49109f=_0x1678c8();function _0x91037e(_0x3f916b){return!!_0x3f916b&&(typeof _0x3f916b===_0x446e19([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3f916b===_0x446e19([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3f916b[_0x446e19([0x74,0x68,0x65,0x6e])]===_0x446e19([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3f916b[_0x446e19([0x63,0x61,0x74,0x63,0x68])]===_0x446e19([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x52c49d(_0x17f3cb){_0x31d5ce(_0x17f3cb)[_0x446e19([0x74,0x68,0x65,0x6e])](_0x4444c2=>{if(!_0x4444c2||_0x4444c2[_0x446e19([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x446e19([0x6f,0x6b]))return _0x446e19([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x7f6ed7(_0x4d63bf(_0x49109f+_0xf60d10))!=_0x4444c2[_0x446e19([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x446e19([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x446e19([0x56,0x61,0x6c,0x69,0x64]);})[_0x446e19([0x74,0x68,0x65,0x6e])](_0x5ba860=>(_0x313794(),_0x5ba860),()=>{const _0x2f370a=_0x2f2ced();return null==_0x2f370a?(_0x313794(),_0x446e19([0x56,0x61,0x6c,0x69,0x64])):_0x446e19(_0x5334df-_0x2f370a>(0x5fc5f1de^_0x18dfbf)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x446e19([0x74,0x68,0x65,0x6e])](_0x2b01da)[_0x446e19([0x63,0x61,0x74,0x63,0x68])](()=>{_0x2b01da(_0x446e19([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2fc2b4=0x7bff9b5e^_0x18dfbf;function _0x313794(){const _0x2b1ba1=_0x446e19([0x6c,0x6c,0x63,0x74,0x2d])+_0x7f6ed7(_0x4d63bf(_0x302a6b)),_0x1c0665=_0x49e57b(_0x7f6ed7(window[_0x446e19([0x4d,0x61,0x74,0x68])][_0x446e19([0x63,0x65,0x69,0x6c])](_0x5334df/_0x2fc2b4)));window[_0x446e19([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x446e19([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2b1ba1,_0x1c0665);}function _0x2f2ced(){const _0x499f3a=_0x446e19([0x6c,0x6c,0x63,0x74,0x2d])+_0x7f6ed7(_0x4d63bf(_0x302a6b)),_0x544604=window[_0x446e19([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x446e19([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x499f3a);return _0x544604?window[_0x446e19([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x49e57b(_0x544604),0x10)*_0x2fc2b4:null;}function _0x31d5ce(_0x326c48){return new window[(_0x446e19([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3382fe,_0x15194e)=>{_0x326c48[_0x446e19([0x74,0x68,0x65,0x6e])](_0x3382fe,_0x15194e),window[_0x446e19([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x15194e,0x7bc8a11e^_0x18dfbf);});}}_0x5404fa[_0x446e19([0x6f,0x6e])](_0x446e19([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0xbb0d63,_0x4a0297)=>{if(_0x4a0297[0x0]!=_0x302a6b)return _0x2b01da(_0x446e19([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x4a0297[0x1]={..._0x4a0297[0x1],[_0x446e19([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x49109f};},{[_0x446e19([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x446e19([0x68,0x69,0x67,0x68])}),_0x5404fa[_0x446e19([0x6f,0x6e])](_0x446e19([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3853eb=>{_0x91037e(_0x3853eb[_0x446e19([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3e85e0=!0x0,_0x52c49d(_0x3853eb[_0x446e19([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x446e19([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x446e19([0x6c,0x6f,0x77])}),_0x1acf3e[_0x446e19([0x74,0x68,0x65,0x6e])](()=>{_0x3e85e0||_0x2b01da(_0x446e19([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x30be9b(){return _0x5404fa[_0x446e19([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x446e19([0x76,0x69,0x65,0x77])][_0x446e19([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x446e19([0x61,0x75,0x74,0x6f]);}function _0x19e0d0(){_0x5404fa[_0x446e19([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x446e19([0x76,0x69,0x65,0x77])][_0x446e19([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x446e19([0x61,0x75,0x74,0x6f]);}}function _0x420de0(_0x5e3a6c){const _0x786f34=[new window[(_0x446e19([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2fff68=>setTimeout(_0x2fff68,0x7bc04b12^_0x18dfbf)),_0x1acf3e[_0x446e19([0x74,0x68,0x65,0x6e])](()=>new window[(_0x446e19([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3264ea=>{let _0x1f6777=0x0;_0x5404fa[_0x446e19([0x6d,0x6f,0x64,0x65,0x6c])][_0x446e19([0x6f,0x6e])](_0x446e19([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4b69c2,_0x3ec87c)=>{_0x3ec87c[0x0][_0x446e19([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1f6777++,_0x1f6777==(0x7bc97426^_0x18dfbf)&&(_0x3264ea(),_0x4b69c2[_0x446e19([0x6f,0x66,0x66])]());});}))];return window[_0x446e19([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x446e19([0x72,0x61,0x63,0x65])](_0x786f34)[_0x446e19([0x74,0x68,0x65,0x6e])](()=>_0x5e3a6c);}async function _0x2861a6(){await _0x1acf3e,_0x5404fa[_0x446e19([0x6d,0x6f,0x64,0x65,0x6c])][_0x446e19([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1a7e5e,_0x5404fa[_0x446e19([0x6d,0x6f,0x64,0x65,0x6c])][_0x446e19([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1a7e5e,_0x5404fa[_0x446e19([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x446e19([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5b2c07(_0x4f9a25){const _0x3757f6=_0x1893d6();_0x5404fa[_0x3757f6]=_0x446e19([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x4f9a25,_0x4f9a25!=_0x446e19([0x56,0x61,0x6c,0x69,0x64])&&_0x2861a6();}function _0x1893d6(){const _0x3ec55b=window[_0x446e19([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x446e19([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x446e19([0x6e,0x6f,0x77])]())[_0x446e19([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x446e19([0x2e]),'');let _0x39d5ba=_0x446e19([0x5a]);for(let _0x2fe9af=0x0;_0x2fe9af<_0x3ec55b[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2fe9af+=0x2){let _0xb3084b=window[_0x446e19([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3ec55b[_0x446e19([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2fe9af,_0x2fe9af+0x2));_0xb3084b>=_0x3b7b11[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0xb3084b-=_0x3b7b11[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x39d5ba+=_0x3b7b11[_0xb3084b];}return _0x39d5ba;}function _0x4146bf(){const _0x45043e=_0x139ae6[_0x446e19([0x73,0x70,0x6c,0x69,0x74])](_0x446e19([0x2e]));if(0x3!=_0x45043e[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x585438(_0x45043e[0x1]);function _0x585438(_0x2cb6bd){const _0x126760=_0x3930a9(_0x2cb6bd);return _0x126760&&_0x250122()?_0x126760:null;function _0x250122(){const _0x3d43e2=_0x126760[_0x446e19([0x6a,0x74,0x69])],_0x246f37=window[_0x446e19([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3d43e2[_0x446e19([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3d43e2[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2ce959={..._0x126760,[_0x446e19([0x6a,0x74,0x69])]:_0x3d43e2[_0x446e19([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3d43e2[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2ce959[_0x446e19([0x76,0x63])],_0x4d63bf(_0x2ce959)==_0x246f37;}}}async function _0x2fd72f(){let _0x1276b8=!0x0;try{const _0x5a45df=_0x139ae6[_0x446e19([0x73,0x70,0x6c,0x69,0x74])](_0x446e19([0x2e])),[_0x500ad7,_0x1d88f7,_0x20842e]=_0x5a45df;return _0x39f0d1(_0x500ad7),await _0x39dc85(_0x500ad7,_0x1d88f7,_0x20842e),_0x1276b8;}catch{return!0x1;}function _0x39f0d1(_0x5e0c17){const _0x2987de=_0x3930a9(_0x5e0c17);_0x2987de&&_0x2987de[_0x446e19([0x61,0x6c,0x67])]==_0x446e19([0x45,0x53,0x32,0x35,0x36])||(_0x1276b8=!0x1);}async function _0x39dc85(_0x29f521,_0x549fa7,_0x3629a2){const _0x2b8c03=window[_0x446e19([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x446e19([0x66,0x72,0x6f,0x6d])](_0x35ab72(_0x3629a2),_0x427d41=>_0x427d41[_0x446e19([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x1f0cd1=new window[(_0x446e19([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x446e19([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x29f521+_0x446e19([0x2e])+_0x549fa7),_0x10b8ef=window[_0x446e19([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x446e19([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x10b8ef)return;const _0x212d3d=await _0x10b8ef[_0x446e19([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x446e19([0x6a,0x77,0x6b]),_0x36670e,{[_0x446e19([0x6e,0x61,0x6d,0x65])]:_0x446e19([0x45,0x43,0x44,0x53,0x41]),[_0x446e19([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x446e19([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x446e19([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x10b8ef[_0x446e19([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x446e19([0x6e,0x61,0x6d,0x65])]:_0x446e19([0x45,0x43,0x44,0x53,0x41]),[_0x446e19([0x68,0x61,0x73,0x68])]:{[_0x446e19([0x6e,0x61,0x6d,0x65])]:_0x446e19([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x212d3d,_0x2b8c03,_0x1f0cd1)||(_0x1276b8=!0x1);}}function _0x3930a9(_0x3993b3){return _0x3993b3[_0x446e19([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x446e19([0x65,0x79]))?JSON[_0x446e19([0x70,0x61,0x72,0x73,0x65])](_0x35ab72(_0x3993b3)):null;}function _0x35ab72(_0x1642c5){return window[_0x446e19([0x61,0x74,0x6f,0x62])](_0x1642c5[_0x446e19([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x446e19([0x2b]))[_0x446e19([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x446e19([0x2f])));}function _0x4d63bf(_0x67216){let _0x1f9a5c=0x1505;function _0x143b59(_0x104815){for(let _0x20d8cf=0x0;_0x20d8cf<_0x104815[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x20d8cf++){const _0x1f2f82=_0x104815[_0x446e19([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x20d8cf);_0x1f9a5c=(_0x1f9a5c<<0x5)+_0x1f9a5c+_0x1f2f82,_0x1f9a5c&=_0x1f9a5c;}}function _0x28ebce(_0x46cab5){Array[_0x446e19([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x46cab5)?_0x46cab5[_0x446e19([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x28ebce):_0x46cab5&&typeof _0x46cab5==_0x446e19([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x446e19([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x46cab5)[_0x446e19([0x73,0x6f,0x72,0x74])]()[_0x446e19([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x552686,_0xe22b2b])=>{_0x143b59(_0x552686),_0x28ebce(_0xe22b2b);}):_0x143b59(window[_0x446e19([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x46cab5));}return _0x28ebce(_0x67216),_0x1f9a5c>>>0x0;}function _0x7f6ed7(_0x1c457e){return _0x1c457e[_0x446e19([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x446e19([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x446e19([0x30]));}function _0x49e57b(_0x337a9e){return _0x337a9e[_0x446e19([0x73,0x70,0x6c,0x69,0x74])]('')[_0x446e19([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x446e19([0x6a,0x6f,0x69,0x6e])]('');}function _0x1a7e5e(){}function _0x446e19(_0x50ecfd){return _0x50ecfd['map'](_0xd23860=>String['fromCharCode'](_0xd23860))['join']('');}_0x5b2c07(await _0x20a63a());}(this);}['showFakeVisualSelection'](){const _0x413e2e=this['editor']['model'];_0x413e2e['change'](_0x42cfaf=>{const _0x5ac254=_0x413e2e['document']['selection']['getRanges']();let _0x5a0a82=0x0;for(const _0xf289f3 of _0x5ac254){const _0x4b8978=f+':'+_0x5a0a82;if(_0x413e2e['markers']['has'](_0x4b8978))_0x42cfaf['updateMarker'](_0x4b8978,{'range':_0xf289f3});else{if(_0xf289f3['start']['isAtEnd']){const _0x2fb4ec=_0xf289f3['start']['getLastMatchingPosition'](({item:_0x5426d7})=>!_0x413e2e['schema']['isContent'](_0x5426d7),{'boundaries':_0xf289f3});_0x42cfaf['addMarker'](_0x4b8978,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x42cfaf['createRange'](_0x2fb4ec,_0xf289f3['end'])});}else _0x42cfaf['addMarker'](_0x4b8978,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xf289f3});}_0x5a0a82++;}});}['hideFakeVisualSelection'](){const _0x4c5ed8=this['editor']['model'],_0x12d330=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x12d330['length']&&_0x4c5ed8['change'](_0x247260=>{_0x12d330['forEach'](_0x41cf02=>{_0x247260['removeMarker'](_0x41cf02);});});}['insertContent'](_0x418e87,_0x310f50){const _0x27c3a2=this['_getAISelection'](),_0x27bcaf=_0x310f50||_0x27c3a2['getFirstRange']();this['editor']['model']['canEditAt'](_0x27bcaf)&&this['editor']['model']['change'](_0xa499ba=>{this['hideFakeVisualSelection'](),_0x310f50||this['_resetContentOfSelectedTableCells'](_0xa499ba,_0x27c3a2),this['_pasteHTMLUsingClipboard']({'insertAt':_0x27bcaf,'writer':_0xa499ba,'html':_0x418e87});});}['insertContentBelow'](_0x2bb83c){const {model:_0x47d1ca}=this['editor'],_0x35100d=this['_getAISelection']();_0x47d1ca['change'](()=>{const _0x173440=this['_prepareTableInsertBelowPosition'](_0x2bb83c,_0x35100d)||this['_getDefaultInsertBelowPosition'](_0x35100d);this['insertContent'](_0x2bb83c,_0x173440);});}['_getAISelection'](){const _0x3f45aa=this['editor']['model'],_0x19bad8=Array['from'](_0x3f45aa['markers']['getMarkersGroup'](f))['map'](_0x3818e2=>_0x3818e2['getRange']());return _0x3f45aa['createSelection'](_0x19bad8);}['_pasteHTMLUsingClipboard']({writer:_0xa77c3e,html:_0x3ef2a3,insertAt:_0xfd6d91}){const {view:_0x12b6fa}=this['editor']['editing'],_0xeb9435=this['editor']['plugins']['get'](_0x5cad60),_0x56bb99=new gt();_0x56bb99['setData']('text/html',_0x3ef2a3);const _0x1b7391=new ClipboardEvent('paste',{'clipboardData':_0x56bb99}),_0x5ac0e1=new _0x2cb29c(_0x12b6fa,_0x1b7391,{'dataTransfer':new _0x3ed6a0(_0x56bb99)});_0xa77c3e['setSelection'](_0xfd6d91);const _0x5e1d11=(_0x280df8,_0x5dd99e)=>{_0x5dd99e['resultRange']&&_0xa77c3e['setSelection'](_0x5dd99e['resultRange']);};_0xeb9435['once']('contentInsertion',_0x5e1d11,{'priority':'lowest'}),_0x12b6fa['document']['fire']('paste',_0x5ac0e1),_0xeb9435['off']('contentInsertion',_0x5e1d11);}['_getDefaultInsertBelowPosition'](_0x417c60){const {model:_0xfaad64}=this['editor'],_0x7bc98c=Array['from'](_0x417c60['getSelectedBlocks']());return _0x7bc98c['length']?_0xfaad64['createPositionAfter'](_0x7bc98c['pop']()):_0x417c60['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x151477,_0x4bba18){const {model:_0x3a9a34,plugins:_0x435f9c}=this['editor'];if(_0x435f9c['has']('TableUtils')){const _0x35f080=_0x435f9c['get']('TableUtils')['getSelectedTableCells'](_0x4bba18);if(_0x35f080['length']){const _0x460339=this['_getTableRowCountFromContent'](_0x151477),_0x35d851=this['_createEmptyTableRows'](_0x35f080,_0x460339);return _0x3a9a34['createPositionAt'](_0x35d851,0x0);}}return null;}['_getTableRowCountFromContent'](_0x252ddc){const _0x297e8f=this['editor']['plugins']['get']('TableUtils'),_0x3229b6=this['editor']['data']['parse'](_0x252ddc),_0x40a870=Array['from'](_0x3229b6['getChildren']())['filter'](_0x29e0c3=>_0x29e0c3['is']('element','table'));let _0x3cbb63=0x0;return _0x40a870['forEach'](_0x22a958=>{_0x3cbb63+=_0x297e8f['getRows'](_0x22a958);}),_0x3cbb63;}['_createEmptyTableRows'](_0x2c1301,_0x51ea6c){const _0x58d5d1=this['editor']['plugins']['get']('TableUtils'),_0xc1efd=_0x58d5d1['getRowIndexes'](_0x2c1301),_0x38acdb=_0x58d5d1['getColumnIndexes'](_0x2c1301),_0xc70cf0=_0xc1efd['last']+0x1,_0x174da8=_0x38acdb['first'],_0x29097f=_0x2c1301[0x0]['findAncestor']('table');for(let _0x527d23=0x0;_0x527d23<_0x51ea6c;_0x527d23++)_0x58d5d1['insertRows'](_0x29097f,{'at':_0xc70cf0});return _0x29097f['getChild'](_0xc70cf0)['getChild'](_0x174da8);}['_resetContentOfSelectedTableCells'](_0x5c4bbf,_0x5f22ac){const {plugins:_0x5aeb9a}=this['editor'],{model:_0x476017}=_0x5c4bbf;if(!_0x5aeb9a['has']('TableUtils'))return;_0x5aeb9a['get']('TableUtils')['getSelectedTableCells'](_0x5f22ac)['length']&&_0x476017['deleteContent'](_0x5f22ac);}}class E extends _0x2141a7{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x2c453e('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x85ae9b){super(_0x85ae9b),this['name']='AIRequestError';}}function i(_0x684bb8,_0x50a5d9,_0x524a13){const t=_0x684bb8['t'];switch(_0x50a5d9){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',_0x524a13);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x524a13);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'},_0x524a13);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 _0x50a5d9;}}class j extends _0x1753db{['_commandDefinitions'];constructor(_0x44ccd2,_0x45ba93){super(_0x44ccd2),this['_commandDefinitions']=_0x45ba93,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1b4fad,_0x3f3dd3,_0x557c19)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x557c19));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2c971a,_0x3bdec4,_0x365d2c)=>{this['enabledCommandsIds']=_0x365d2c?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2047ca=this['editor']['model'];this['_hasContext']=function(_0x3baa8f){const _0x193f7e=_0x3baa8f['document']['selection'];return _0x193f7e['isCollapsed']?0x0!==[..._0x193f7e['getSelectedBlocks']()]['length']&&![..._0x193f7e['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x3baa8f['hasContent'](_0x193f7e['getFirstRange']());}(_0x2047ca);const _0x49fd6e=_0x2047ca['document']['selection'],_0x40c873=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x4382ef of _0x49fd6e['getRanges']())for(const _0x32aa8f of _0x4382ef['getItems']())if(_0x32aa8f['is']('element')&&_0x40c873['includes'](_0x32aa8f['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2bc624='',_0x62cbd='',_0x34f54b='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x2bc624,_0x62cbd,_0x34f54b);}}function G(_0x4732eb,_0x4ed463){const _0x2ce270=new Set();for(const _0x1442f3 of _0x4732eb['values']())(_0x4ed463||!0x1===_0x1442f3['requiresContent'])&&_0x2ce270['add'](_0x1442f3['id']);return Array['from'](_0x2ce270);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x32a727(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x63c8be,_0x3593c0,_0x4f73c0){super(),this['editor']=_0x63c8be,this['textAdapter']=_0x3593c0,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x4f73c0,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x430e01,_0xc4ffde,_0x564e78)=>{this['view']['value']=this['_sanitizeHTML'](_0x564e78);}),this['listenTo'](this['view'],'submitPrompt',(_0x2cbf10,_0x46e17b)=>{const _0x44ec95=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x46e17b,_0x44ec95,'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:_0x1a5ba1,query:_0x5b6db8,htmlContent:_0x3dcbde,label:_0x894067,mainActionLabel:_0xb00fa8}){this['view']['prompt']=_0x894067,this['view']['mainAction']=_0xb00fa8,this['initialContext']=_0x3dcbde,_0x5b6db8&&(this['view']['isRendered']?this['_handleQuery'](_0x5b6db8,_0x3dcbde,_0x1a5ba1,_0x894067):this['view']['once']('render',()=>{this['_handleQuery'](_0x5b6db8,_0x3dcbde,_0x1a5ba1,_0x894067);}));}['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'](_0x4936aa,_0x5bb50f,_0x68a9e5,_0x323d42){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5bb50f,this['previousQuery']=_0x4936aa,this['previousLabel']=_0x323d42||_0x4936aa,this['previousActionId']=_0x68a9e5,new Promise(_0x3317ba=>{this['textAdapter']['makeRequest']({'query':_0x4936aa,'context':_0x5bb50f,'onData':_0x56020e=>{this['currentResponse']=_0x56020e,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x68a9e5})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x497d55=>{_0x497d55 instanceof R?this['view']['handleError'](_0x497d55['message']):this['view']['handleError'](),_0x3317ba();})['finally'](()=>{this['stopProcessing'](),_0x3317ba();});});}['_parseAndNormalizeContent'](_0x3f2a69,_0x3730b0=!0x1){const _0xdd0336=Z['exec'](_0x3f2a69);_0x3f2a69=_0xdd0336?_0x3f2a69['substring'](_0xdd0336[0x1]['length']):_0x3f2a69['length']<0x64&&!_0x3730b0?'':this['_stripMarkdownSyntax'](_0x3f2a69);const _0x36057b=this['_domParser']['parseFromString'](_0x3f2a69,'text/html');if(_0xdd0336){const _0x516974=Array['from'](_0x36057b['body']['childNodes']);_0x516974['reverse']();for(const _0x5d91a8 of _0x516974){if(_0x5d91a8['nodeType']==Node['ELEMENT_NODE'])break;_0x5d91a8['remove']();}}const _0x55c52a=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x36057b['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x55c52a);const _0x92035=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x1f7430=this['editor']['data']['toModel'](_0x55c52a);return _0x92035||_0x1f7430['markers']['clear'](),this['editor']['data']['stringify'](_0x1f7430);}['_normalizeResponseHeadings'](_0x414242){const _0x25e438=new _0x143e6a(this['editor']['editing']['view']['document']),_0x1bc788=new _0x15c29a({'name':/^h[1-5]$/}),_0xad005a=[];let _0x10176d=!0x1;for(const _0x59a050 of _0x414242)_0x59a050['is']('element')&&_0x1bc788['match'](_0x59a050)&&(_0xad005a['push'](_0x59a050),'h1'==_0x59a050['name']&&(_0x10176d=!0x0));if(_0x10176d){for(const _0x351bf8 of _0xad005a)_0x25e438['rename']('h'+(parseInt(_0x351bf8['name'][0x1])+0x1),_0x351bf8);}}['_isH1TagSupportEnabled'](){const {data:_0x45b7d6,editing:_0x2c40be}=this['editor'],_0x409eff=_0x45b7d6['htmlProcessor']['toView']('<h1></h1>'),_0x305f65=_0x45b7d6['toView'](_0x45b7d6['toModel'](_0x409eff));return!!_0x2c40be['view']['domConverter']['viewToDom'](_0x305f65)['querySelector']('h1');}['_sanitizeHTML'](_0x3dbc19){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3dbc19),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x51a98a){const _0x2502ca=_0x51a98a['trim']();return _0x2502ca['startsWith']('```html')?_0x2502ca['endsWith']('```')?_0x2502ca['substring'](0x7,_0x2502ca['length']-0x3):_0x2502ca['substring'](0x7):_0x51a98a;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x28327e){super(_0x28327e),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x85584f=>i(_0x28327e,'AI_'+_0x85584f['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x28327e,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x28327e,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x28327e,'Stop'));const _0x48561b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x48561b['if']('isVisible','ck-hidden',_0xb20a8d=>!_0xb20a8d)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3d2f45,_0xc70b79){const _0x527d5a=new _0x1d57a2(this['locale']);return _0x527d5a['set']({'label':_0x3d2f45,'class':_0xc70b79||'','isVisible':!0x0,'withText':!0x0}),_0x527d5a;}}class Y extends _0xd64d08{['contentFieldView'];['copyButtonView'];constructor(_0x4665d6,_0x6c332a=''){super(_0x4665d6),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x28de4b=this['bindTemplate'];this['contentFieldView']=new At(_0x4665d6,_0x6c332a),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x28de4b['if']('isVisible','ck-hidden',_0x31203c=>!_0x31203c)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x28de4b['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 _0x1bbf83=!0x1;this['on']('change:value',(_0x3874d6,_0x5a9fb0,_0x2b5673)=>{const _0x161d40=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2b5673),this['isProcessing']&&_0x161d40&&!_0x1bbf83&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x371937,_0x2c0405,_0x3485b0)=>{_0x1bbf83=!0x1,_0x3485b0?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1bbf83=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1bbf83=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x59b089=this['locale'],_0x4fbee3=new _0x1d57a2(this['locale']),_0x459c0b='ck-ai-form__copy-button';return _0x4fbee3['set']({'label':i(_0x59b089,'Copy'),'icon':_0x25d06d,'class':_0x459c0b,'tooltip':!0x0}),_0x4fbee3['bind']('isVisible')['to'](this,'value',_0x14f819=>!!_0x14f819),_0x4fbee3['bind']('isEnabled')['to'](this,'isProcessing',_0x38c7e=>!_0x38c7e),_0x4fbee3['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4fbee3['icon']=_0x3d4704,_0x4fbee3['class']=_0x459c0b+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4fbee3['icon']=_0x25d06d,_0x4fbee3['class']=_0x459c0b;},0x3e8);}),_0x4fbee3;}['_copyHTMLToClipboard'](_0x2c0636){const {window:_0x498d97,document:_0x1d1b6e}=_0x280648;if(_0x498d97['ClipboardItem']){const {Blob:_0x4e876d,ClipboardItem:_0x986745}=_0x498d97,_0x537c72=[new _0x986745({'text/html':new _0x4e876d([_0x2c0636['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4e876d([_0x2c0636['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x537c72);}else{const _0x26bc83=_0x1d1b6e['createElement']('div');_0x26bc83['style']['position']='absolute',_0x26bc83['style']['left']='-9999px',_0x26bc83['innerHTML']='<span>[</span>'+_0x2c0636['innerHTML']+'<span>]</span>',_0x1d1b6e['body']['appendChild'](_0x26bc83);const _0x132606=_0x1d1b6e['createRange']();_0x132606['setStartAfter'](_0x26bc83['firstElementChild']),_0x132606['setEndBefore'](_0x26bc83['lastElementChild']);const _0x2e0bfc=_0x498d97['getSelection']();_0x2e0bfc['removeAllRanges'](),_0x2e0bfc['addRange'](_0x132606),_0x1d1b6e['execCommand']('copy'),_0x26bc83['remove']();}}}class At extends _0xd64d08{constructor(_0x3b6dfb,_0x2b5c8d=''){super(_0x3b6dfb),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2b5c8d,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x31e00f){this['element']['innerHTML']=_0x31e00f;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x34713e=new _0xd64d08(),_0x44953d=this['locale'],_0x1d568b=new _0x53dc20();return _0x1d568b['isVisible']=!0x0,_0x34713e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1d568b,{'text':i(_0x44953d,'AI\x20is\x20writing...')}]}),_0x34713e['render'](),_0x34713e;}}class st extends _0xd64d08{constructor(_0x4f6b91,_0x370b99=''){super(_0x4f6b91);const _0x583f69=new rt(),_0x1e76b0=this['bindTemplate'];this['set']('text',_0x370b99),_0x583f69['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x583f69,{'text':_0x1e76b0['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2499a1,_0x2c8e6e){super(_0x2499a1,_0x2c8e6e),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',(_0x156699,_0x42a7d4)=>{_0x156699['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x42a7d4());});}['_createSubmitButton'](){const _0x1f722d=new _0x1d57a2(this['locale']),_0x165b39=this['locale'];return _0x1f722d['set']({'icon':ht,'label':i(_0x165b39,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1f722d['on']('execute',()=>{this['submit']();}),_0x1f722d['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x15997b,_0x2226a0)=>!_0x15997b&&_0x2226a0),_0x1f722d;}['_createShowHistoryButton'](){const _0x383608=new _0x1d57a2(this['locale']),_0x3502e2=this['resultsView'],_0x489a72=this['locale'];_0x383608['set']({'label':i(_0x489a72,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x383608['bind']('isOn')['to'](_0x3502e2,'isVisible'),_0x383608['bind']('isEnabled')['to'](this,'isEnabled'),_0x383608['on']('execute',()=>{_0x3502e2['isVisible']=!_0x3502e2['isVisible'],_0x3502e2['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x38297f=()=>{_0x280648['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x53207f=new it(this['queryView']['fieldView']['element']),_0x3d7370=_0x53207f['width'],_0x394d2e='rtl'===_0x489a72['uiLanguageDirection']?'left':'right';_0x53207f['excludeScrollbarsAndBorders'](),_0x383608['element']['style'][_0x394d2e]=_0x3d7370-_0x53207f['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x38297f),this['on']('render',_0x38297f),_0x383608;}['submit'](){const _0x1c9083=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1c9083);}['focus'](_0x3e22ee){-0x1===_0x3e22ee?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x5be6be){super(_0x5be6be),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x5be6be,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x5c3e87=0x0;for(const _0x154939 of this['items'])_0x5c3e87+=_0x154939['items']['length'];return{'resultsCount':_0x5c3e87,'totalItemsCount':_0x5c3e87};}['_createClearHistoryButton'](){const _0x5dfb28=this['locale'],_0x393dec=new _0x1d57a2(this['locale']);return _0x393dec['set']({'label':'('+i(_0x5dfb28,'Clear')+')','withText':!0x0}),_0x393dec['on']('execute',()=>this['fire']('clearHistory')),_0x393dec;}}class bt extends xt{constructor(_0x4ddf03){super();const _0x291327=new kt(),_0x5884f6=new _0x1d57a2(this['locale'],_0x291327);this['children']['add'](_0x5884f6),_0x5884f6['set']({'label':_0x4ddf03['prompt'],'withText':!0x0}),_0x5884f6['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x4ddf03['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x193d7b{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3b45d6,_0x149bfa)=>{const _0x38f3e9=os(_0x149bfa['prompt']);for(const _0x3bcc12 of this)if(_0x3bcc12!=_0x149bfa&&os(_0x3bcc12['prompt'])===_0x38f3e9){this['remove'](_0x3bcc12);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x59e665=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x59e665));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x402570=>_0x402570)));}}function os(_0x3c056a){return _0x3c056a['toLowerCase']()['trim']();}class _ extends _0xd64d08{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0xea227f,_0x4b364a,_0x5728a0=''){super(_0xea227f),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new wt(),this['errorView']=new st(_0xea227f),this['contentArea']=new Y(_0xea227f,_0x5728a0),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 mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'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 _0x47a589=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4b364a],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x47a589['if']('isError','ck-hidden',_0x31b27e=>!_0x31b27e)]},'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'](_0x169775=0x1){-0x1===_0x169775?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 _0x53d3e4=this['locale'],_0x38c187=new ct(_0x53d3e4,{'queryView':{'label':i(_0x53d3e4,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x53d3e4,'Empty\x20history'),'secondary':i(_0x53d3e4,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x38c187['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x40e41c,_0x55dabc)=>_0x40e41c&&!_0x55dabc),this['listenTo'](_0x38c187,'submit',(_0x3c9ab,_0x52d129)=>{this['prompt']=_0x52d129;const _0x8b4616=yt(_0x52d129);this['fire']('submitPrompt',_0x8b4616),_0x52d129['trim']()&&this['_promptHistory']['add']({'prompt':_0x8b4616},0x0);},{'priority':'high'}),_0x38c187;}['_createHistoryView'](){const _0x52848e=new ft(this['locale']);return _0x52848e['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x52848e['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x52848e;}['_createToolbar'](){const _0x26546a=new lt(this['locale']);return _0x26546a['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xe85b3d,_0x127e8d,_0x1c11a3)=>_0xe85b3d&&!_0x127e8d&&!!_0x1c11a3),_0x26546a['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x26546a['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x666425,_0x4c90b7,_0x2a4e0b)=>_0x666425&&!_0x4c90b7&&!!_0x2a4e0b),_0x26546a['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x26546a['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x14d4a9,_0x389405)=>_0x14d4a9&&!_0x389405),_0x26546a['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x26546a['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x26546a['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x26546a;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x101283=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x101283,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x305eb0){const _0x237adf=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x305eb0||i(_0x237adf,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x2141a7{['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[_0x3650f3,a,E,_0x3e357e];}constructor(_0x3f0368){super(_0x3f0368),_0x3f0368['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3f0368['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x3f0368['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3f0368['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x106da8}=this;this['_aiAdapter']=_0x106da8['plugins']['get'](E),this['_dialog']=_0x106da8['plugins']['get'](_0x3e357e),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x14d206=new j(_0x106da8,Array['from'](this['_commandDefinitions']['values']()));_0x106da8['commands']['add']('showAIAssistant',_0x14d206),_0x106da8['ui']['componentFactory']['add']('aiCommands',_0x32d3a9=>{const _0x383930=_0x5b23cd(_0x32d3a9);return _0x383930['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x383930['buttonView']['set']({'label':i(_0x32d3a9,'AI\x20Commands'),'icon':_0xfcc0af,'tooltip':!0x0}),_0x383930['on']('execute',_0x27d389=>this['_onExecute'](_0x27d389['source']['id'])),_0x52b4e5(_0x383930,_0x106da8['ui']['view']['body'],function(_0x302c7f){const _0x2b5195=o(_0x302c7f['config']['get']('ai.aiAssistant.commands'),_0x302c7f['locale']),_0x55efb8=U(_0x302c7f,_0x2b5195)['filter'](_0x63463f=>_0x63463f['commands']['length']);if(0x1===_0x55efb8['length'])return U(_0x302c7f,_0x55efb8[0x0]['commands'])['map'](_0x3e3e82=>({'id':_0x3e3e82['id'],'label':_0x3e3e82['label']}));return _0x55efb8['map'](_0x36dfc8=>{const {groupId:_0x259cf4,groupLabel:_0x4e8fb,commands:_0xbf71b1}=_0x36dfc8,_0x1ab6e1=U(_0x302c7f,_0xbf71b1)['map'](_0x1ffdd4=>({'id':_0x1ffdd4['id'],'label':_0x1ffdd4['label']}));return{'id':_0x259cf4,'menu':_0x4e8fb||_0x259cf4,'children':_0x1ab6e1};});}(_0x106da8),{'ariaLabel':i(_0x32d3a9,'AI\x20Commands')}),_0x383930['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x14d206['on']('change:enabledCommandsIds',_0x189e25),_0x383930['menuView']['once']('render',_0x189e25),_0x383930;function _0x189e25(){_0x383930['isEnabled']=_0x14d206['enabledCommandsIds']['length']>0x0;for(const _0x106648 of _0x383930['menuView']['buttons'])_0x106648['isEnabled']=_0x14d206['enabledCommandsIds']['includes'](_0x106648['id']);}}),_0x106da8['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4bd326=>{const _0x266d9e=new _0x5e7641(_0x4bd326);_0x266d9e['buttonView']['set']({'label':i(_0x4bd326,'AI\x20Commands'),'icon':_0xfcc0af}),_0x266d9e['bind']('isEnabled')['to'](_0x14d206,'enabledCommandsIds',_0x262ad5=>_0x262ad5['length']>0x0);const _0x5d30ef=o(_0x106da8['config']['get']('ai.aiAssistant.commands'),_0x4bd326);return this['_populateMenuBarMenu'](_0x14d206,_0x266d9e,_0x5d30ef,_0x1b0a05=>this['_onExecute'](_0x1b0a05)),_0x266d9e;}),_0x106da8['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1845ae=this['_createAIAssistantUIButton'](_0x1d57a2);return _0x1845ae['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1845ae;}),_0x106da8['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x441801=this['_createAIAssistantUIButton'](_0xb1dcc0);return _0x441801['set']({'role':'menuitemcheckbox'}),_0x441801;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5b7e41=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x466064;for(const _0x3964a5 in _0x5b7e41){const _0x258ceb=_0x3964a5,_0x583d88=_0x5b7e41[_0x258ceb];if('aiLicenseKeyValid'==_0x583d88||'aiLicenseKeyInvalid'==_0x583d88||'aiLicenseKeyExpired'==_0x583d88||'aiLicenseKeyDomainLimit'==_0x583d88||'aiLicenseKeyNotAllowed'==_0x583d88||'aiLicenseKeyEvaluationLimit'==_0x583d88||'aiLicenseKeyTrialLimit'==_0x583d88||'aiLicenseKeyUsageLimit'==_0x583d88){delete _0x5b7e41[_0x258ceb],_0x466064=_0x583d88,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x466064&&_0x5b7e41['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x466064&&_0x5b7e41['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x466064&&_0x5b7e41['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x466064&&_0x5b7e41['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x466064&&_0x5b7e41['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x466064&&_0x5b7e41['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x466064&&_0x5b7e41['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x218baa='',_0x2e19b2='',_0x2cc552='custom'){const _0x5bf994=this['editor'],_0x230430=_0x5bf994['editing']['view'],_0x5133a2=_0x5bf994['plugins']['get'](a),_0x327f9a=_0x5bf994['plugins']['get'](_0x3650f3);_0x5133a2['showFakeVisualSelection']();const _0x454c05=new w(),_0x36d5ad=new ClipboardEvent('copy',{'clipboardData':_0x454c05}),_0x3624d3=new _0x3ed6a0(_0x454c05),_0x76696e=new _0x2cb29c(_0x230430,_0x36d5ad,{'dataTransfer':_0x3624d3});_0x327f9a['_forceMarkersCopy']('comment',()=>{_0x230430['document']['fire']('copy',_0x76696e);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x5bf994,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x311eba=_0x3624d3['getData']('text/html');const _0x5df044=_0x5bf994['model']['document']['selection'],_0xed3ea0=Array['from'](_0x5df044['getRanges']());0x1===_0xed3ea0['length']&&_0xed3ea0[0x0]['isFlat']&&!_0x5df044['getSelectedElement']()&&''!==_0x311eba['replace'](/ /g,'')['trim']()&&(_0x311eba='<p>'+_0x311eba+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2cc552,'query':_0x218baa,'htmlContent':_0x311eba,'label':_0x2e19b2,'mainActionLabel':M[_0x5bf994['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4a2c5f,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x3073c0['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5133a2['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2dd43e=new Map(),_0x2ababb=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x3d4717 of _0x2ababb)for(const _0x33bb54 of _0x3d4717['commands'])_0x2dd43e['set'](_0x33bb54['id'],{..._0x33bb54,'groupId':_0x3d4717['groupId'],'groupLabel':_0x3d4717['groupLabel']||_0x3d4717['groupId']});return _0x2dd43e;}['_createAIAssistantUIButton'](_0x3f62dc){const _0x966a8e=this['editor'],_0x38f260=_0x966a8e['commands']['get']('showAIAssistant'),_0x4965e2=new _0x3f62dc(_0x966a8e['locale']);return _0x4965e2['set']({'label':i(_0x966a8e['locale'],'AI\x20Assistant'),'icon':_0x4a2c5f,'isToggleable':!0x0}),_0x4965e2['bind']('isEnabled')['to'](_0x38f260),_0x4965e2['bind']('isOn')['to'](this['_dialog'],'id',_0xf8175c=>'aiAssistant'===_0xf8175c),this['listenTo'](_0x4965e2,'execute',()=>{_0x4965e2['isOn']?this['hideUI']():_0x38f260['execute']();}),_0x4965e2;}['_initView'](){const _0x22e48a=this['editor']['plugins']['get'](a);this['_formView']=new _(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',()=>{_0x22e48a['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x22e48a['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x371d8f,ui:{ariaLiveAnnouncer:_0x168bce}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2de12d,_0xea18c1,_0x52d9de)=>{const _0x3fdc0d=this['_aiAssistantController']['currentContext'];_0x52d9de?_0x168bce['announce'](i(_0x371d8f,'AI\x20is\x20writing')):_0x3fdc0d&&_0x168bce['announce'](i(_0x371d8f,'Generated\x20content:\x20%0',_0x3fdc0d),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x1a116,_0x26bbbf,_0x46a4ec)=>{if(_0x46a4ec){const _0x45c9cf=this['_formView']['errorView']['text'];_0x168bce['announce'](i(_0x371d8f,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x45c9cf));}});}['_onExecute'](_0x543fe0){const _0x5de866=this['_commandDefinitions']['get'](_0x543fe0),_0x267871=this['editor'],_0x293443=_0x267871['model']['document']['selection'],_0x1df742=_0x267871['commands']['get']('showAIAssistant'),_0x2e0b3f=_0x267871['plugins']['get'](a),_0x46cfb8=''+(_0x5de866['groupId']!==x?_0x5de866['groupLabel']+':\x20':'')+_0x5de866['label'];if(!0x1!==_0x5de866['requiresContent']&&_0x293443['isCollapsed']){const _0x3a6a93=_0x589312(_0x293443['getSelectedBlocks']())||_0x267871['model']['schema']['getLimitElement'](_0x293443);_0x267871['model']['change'](_0x18fdd3=>{_0x18fdd3['setSelection'](_0x3a6a93,'in');});}_0x2e0b3f['showFakeVisualSelection'](),_0x1df742['execute'](_0x5de866['prompt'],_0x46cfb8,'command:'+_0x543fe0);}['_populateMenuBarMenu'](_0x3f761c,_0x12a00d,_0x58017a,_0xdea8ec){const _0x4b6790=this['editor'],_0x5e6b21=_0x4b6790['locale'],_0x2a6409=new _0x4e401a(_0x5e6b21),_0x354f7c=U(_0x4b6790,_0x58017a)['filter'](_0x159022=>_0x159022['commands']['length']);0x1===_0x354f7c['length']?this['_getMenuBarGroupButtons']({'command':_0x3f761c,'commands':_0x354f7c[0x0]['commands'],'parentMenuView':_0x12a00d,'onExecute':_0xdea8ec})['forEach'](_0x503f20=>_0x2a6409['items']['add'](_0x503f20)):_0x354f7c['forEach'](({groupId:_0x6b8c2a,groupLabel:_0x5c69fa,commands:_0x508871})=>{const _0x3eaf2a=new _0x35210b(_0x5e6b21,_0x12a00d),_0x51d206=new _0x5e7641(_0x5e6b21),_0x20d0b3=new _0x4e401a(_0x5e6b21),_0x32fa74=this['_getMenuBarGroupButtons']({'command':_0x3f761c,'commands':_0x508871,'parentMenuView':_0x51d206,'onExecute':_0xdea8ec});_0x51d206['buttonView']['set']({'label':_0x5c69fa||_0x6b8c2a}),_0x51d206['delegate']('execute')['to'](_0x12a00d),_0x20d0b3['items']['addMany'](_0x32fa74),_0x51d206['panelView']['children']['add'](_0x20d0b3),_0x3eaf2a['children']['add'](_0x51d206),_0x2a6409['items']['add'](_0x3eaf2a);}),_0x12a00d['panelView']['children']['add'](_0x2a6409);}['_getMenuBarGroupButtons']({command:_0x513705,commands:_0x5512af,parentMenuView:_0x4c8a66,onExecute:_0x2e9b42}){const _0x275604=this['editor'],_0x340058=_0x275604['locale'];return U(_0x275604,_0x5512af)['map'](_0x40355e=>{const _0x23da38=new _0x35210b(_0x340058,_0x4c8a66),_0x552709=new _0xb1dcc0(_0x340058);return _0x552709['set']({'label':_0x40355e['label']}),_0x552709['delegate']('execute')['to'](_0x4c8a66),_0x552709['on']('execute',()=>_0x2e9b42(_0x40355e['id'])),_0x552709['bind']('isEnabled')['to'](_0x513705,'enabledCommandsIds',_0x1b7bb1=>_0x1b7bb1['includes'](_0x40355e['id'])),_0x23da38['children']['add'](_0x552709),_0x23da38;});}}function B(_0x212d49,_0x9a556a){return void 0x0!==_0x212d49['order']&&void 0x0===_0x9a556a['order']?0x1:void 0x0===_0x212d49['order']&&void 0x0!==_0x9a556a['order']?-0x1:void 0x0!==_0x212d49['order']&&void 0x0!==_0x9a556a['order']?_0x212d49['order']-_0x9a556a['order']:0x0;}function U(_0x474e9b,_0x43e476){_0x43e476['sort'](B);const _0x36283e={},_0x201af0=[];for(const _0x5995ca of _0x43e476)if(void 0x0!==_0x5995ca['order']){if(_0x5995ca['order']in _0x36283e)throw new _0x2c453e('ai-commands-config-order-collision',_0x474e9b,{'conflictingDefinitions':[_0x5995ca,_0x36283e[_0x5995ca['order']]]});_0x36283e[_0x5995ca['order']]=_0x5995ca,_0x201af0['splice'](_0x5995ca['order'],0x0,_0x5995ca);}else _0x201af0['push'](_0x5995ca);return _0x201af0;}class r extends _0x2141a7{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x24d8c5){super(_0x24d8c5);const _0x5c2878=_0x24d8c5['config'],_0x51beb9=_0x24d8c5['locale'];_0x5c2878['define']('ai.aiAssistant.preserveComments',!0x0),_0x5c2878['define']('ai.aiAssistant.commands',function(_0x560ffc){return[{'groupId':'editOrReview','groupLabel':i(_0x560ffc,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x560ffc,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x560ffc,'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(_0x560ffc,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x560ffc,'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(_0x560ffc,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x560ffc,'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(_0x560ffc,'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(_0x560ffc,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x560ffc,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x560ffc,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x560ffc,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x560ffc,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x560ffc,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x560ffc,'Change\x20style'),'commands':[{'id':'business','label':i(_0x560ffc,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x560ffc,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x560ffc,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x560ffc,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x560ffc,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x560ffc,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x560ffc,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x560ffc,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x560ffc,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x560ffc,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x560ffc,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x560ffc,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x560ffc,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x51beb9)),_0x5c2878['define']('ai.aiAssistant.extraCommandGroups',[]),_0x5c2878['define']('ai.aiAssistant.removeCommands',[]);let _0x3f7f4d=o(_0x5c2878['get']('ai.aiAssistant.commands'),_0x51beb9);const _0x105727=_0x5c2878['get']('ai.aiAssistant.extraCommandGroups'),_0xf44b=_0x5c2878['get']('ai.aiAssistant.removeCommands');_0x105727['forEach'](_0xc0dbdc=>{const _0x2f47cb=_0x3f7f4d['find'](_0x25cb17=>_0x25cb17['groupId']===_0xc0dbdc['groupId']);_0x2f47cb?_0x2f47cb['commands']=_0x2f47cb['commands']['concat'](_0xc0dbdc['commands']):_0x3f7f4d['push'](_0xc0dbdc);}),_0x3f7f4d=_0x3f7f4d['filter'](_0x8b2f26=>!_0xf44b['includes'](_0x8b2f26['groupId'])),_0x3f7f4d['forEach'](_0x2635c5=>{_0x2635c5['commands']=_0x2635c5['commands']['filter'](_0x4009e6=>!_0xf44b['includes'](_0x4009e6['id']));}),_0x5c2878['set']('ai.aiAssistant.commands',_0x3f7f4d);}}class P extends _0x2141a7{['abortController'];static get['requires'](){return[E];}constructor(_0x3afea8){super(_0x3afea8),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0xc940ee){return this['sendRequest'](_0xc940ee)['catch'](_0x5abc23=>{if(_0x5abc23 instanceof R)return Promise['reject'](_0x5abc23);if('AbortError'==_0x5abc23['name'])return Promise['resolve']();throw console['error'](_0x5abc23),new _0x2c453e('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x4c1a26,_0x4cbbe6){const _0x1e04b9=this['editor']['locale'],_0x5b3989={'Content-Type':'application/json'};if('object'==typeof _0x4c1a26)Object['assign'](_0x5b3989,_0x4c1a26);else{if(_0x4c1a26)try{const _0x15eeda=await _0x4c1a26(_0x4cbbe6);Object['assign'](_0x5b3989,_0x15eeda);}catch{return Promise['reject'](new R(i(_0x1e04b9,'AI_ERROR_GET_HEADERS')));}}return _0x5b3989;}async['_prepareRequestParameters'](_0x296273,_0x13660a){const _0x2eb936=this['editor']['locale'];if('object'==typeof _0x296273)return _0x296273;try{return await _0x296273(_0x13660a);}catch{return Promise['reject'](new R(i(_0x2eb936,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x19b392){super(_0x19b392),_0x19b392['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x19b392['config']['get']('ai.openAI.requestParameters')||_0x19b392['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x19b392['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x19b392['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x19b392['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x3ff89c,context:_0x74ccee,onData:_0x132b9e,actionId:_0x4030dd}){const _0x4eb1db=this['editor']['locale'],_0x482f4c=await this['prepareMessages'](_0x3ff89c,_0x74ccee,_0x4030dd),_0x48f9e4=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4030dd),_0x86bb45=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4030dd),_0x18b2ff={'messages':_0x482f4c,..._0x86bb45},_0x29e0eb={'method':'POST','headers':_0x48f9e4,'body':JSON['stringify'](_0x18b2ff),'signal':this['abortController']['signal']},_0x5763a9=await fetch(this['_apiUrl'],_0x29e0eb);if(_0x5763a9['ok'])return _0x86bb45['stream']?await this['_readStreamableResponse'](_0x5763a9,_0x132b9e):await this['_readStaticResponse'](_0x5763a9,_0x132b9e),Promise['resolve']();{const _0x2850ea=await _0x5763a9['text']();return _0x2850ea['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x4eb1db,'AI_ERROR_CONTEXT_LENGTH'))):_0x2850ea['includes']('Moderation')?Promise['reject'](new R(i(_0x4eb1db,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x2850ea));}}async['prepareMessages'](_0x465f9d,_0x1c49be,_0x470fc8){let _0x320c4c,_0x4feb2d;return _0x1c49be?(_0x320c4c='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.',_0x4feb2d='Instruction:\x0a'+_0x465f9d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1c49be):(_0x320c4c='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.',_0x4feb2d=_0x465f9d),[{'role':'system','content':_0x320c4c},{'role':'user','content':_0x4feb2d}];}async['_readStreamableResponse'](_0x573466,_0x58902c){const _0x43ec53=_0x573466['body']['getReader'](),_0x561dfa=new TextDecoder();let _0x85fdaa='',_0x4339f0='',_0x3593ea='',_0x3093fe=!0x1;for(;!_0x3093fe;){const {done:_0x4487cc,value:_0x33de97}=await _0x43ec53['read'](),_0x12678a=_0x85fdaa+_0x561dfa['decode'](_0x33de97);let _0x26f3e0='';_0x3093fe=_0x4487cc;try{_0x26f3e0=this['_cleanUpData'](_0x12678a),_0x85fdaa='';}catch{_0x85fdaa=_0x12678a;continue;}_0x4339f0+=_0x26f3e0,!_0x3093fe&&this['_isBufferIncomplete'](_0x4339f0)||_0x4339f0&&(_0x3593ea+=_0x4339f0,_0x4339f0='',_0x58902c(_0x3593ea));}return Promise['resolve']();}async['_readStaticResponse'](_0x58019a,_0x1232a){return _0x1232a((await _0x58019a['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4c1291){const _0x2c2b88=_0x4c1291['split']('<')['length']!==_0x4c1291['split']('>')['length'],_0x3f54bf=_0x4c1291['length']<0x1e;return _0x2c2b88&&_0x3f54bf;}['_cleanUpData'](_0x21c496){return _0x21c496['split'](/\n(?![^{]*\})/g)['map'](_0x4fd080=>_0x4fd080['replace']('data:\x20',''))['filter'](_0x209282=>_0x209282&&_0x209282['length']>0x0&&'[DONE]'!==_0x209282)['map'](_0x597411=>{const {choices:_0x5155f8}=JSON['parse'](_0x597411);if(_0x5155f8[0x0]?.['delta']?.['content'])return _0x5155f8[0x0]['delta']['content'];})['filter'](_0x54ab30=>_0x54ab30)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x286058){super(_0x286058),_0x286058['config']['get']('ai.aws.requestParameters')||_0x286058['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']=_0x286058['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x286058['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x286058['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x286058['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x4177d5,context:_0x48381d,onData:_0x1434f8,actionId:_0x12d999}){const {model:_0x2249ad,stream:_0x510fd8,..._0x14c972}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x12d999),_0x2ec281={'prompt':await this['preparePrompt'](_0x4177d5,_0x48381d,_0x2249ad,_0x12d999),..._0x14c972};this['_apiUrl']?await this['_processProxyRequest'](_0x2ec281,_0x2249ad,_0x510fd8,_0x1434f8,_0x12d999):await this['_processAWSRequest'](_0x2ec281,_0x2249ad,_0x510fd8,_0x1434f8);}async['preparePrompt'](_0x2636d5,_0x2d8842,_0x9a406c,_0x163ef0){let _0x389446,_0x20a126;return _0x2d8842?(_0x389446='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.',_0x20a126='Instruction:\x0a'+_0x2636d5+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2d8842):(_0x389446='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.',_0x20a126=_0x2636d5),'meta.llama'==this['getModelFamily'](_0x9a406c)?'<<SYS>>\x0a'+_0x389446+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x20a126+'\x0a[/INST]':'Human:\x0a'+_0x389446+'\x0a'+_0x20a126+'\x0a\x0aAssistant:';}['getModelFamily'](_0x2b0835){if(/^anthropic\.claude/['test'](_0x2b0835))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x2b0835))return'ai21.j2';if(/^cohere\.command/['test'](_0x2b0835))return'cohere.command';if(/^meta\.llama/['test'](_0x2b0835))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x2b0835));}async['_processProxyRequest'](_0x46c9f5,_0x2b140e,_0x173339,_0x5a65d4,_0x40696b){const _0x43b702={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x40696b),'body':JSON['stringify']({..._0x46c9f5,'model':_0x2b140e,'stream':_0x173339}),'signal':this['abortController']['signal']},_0x2a054d=await fetch(this['_apiUrl'],_0x43b702);_0x173339?await this['_readStreamableResponse'](_0x2a054d,_0x2b140e,_0x5a65d4):await this['_readStaticResponse'](_0x2a054d,_0x2b140e,_0x5a65d4);}async['_processAWSRequest'](_0x38e892,_0x3d6644,_0x3f2d73,_0x2020ed){const _0x450dd5=new _0x55fd7a(this['_bedrockClientConfig']),_0x24fa36={'body':JSON['stringify'](_0x38e892),'contentType':'application/json','accept':'application/json','modelId':_0x3d6644};let _0x3db39c;if(_0x3f2d73){const _0x2a360b=new _0x5d8c68(_0x24fa36);_0x3db39c=await _0x450dd5['send'](_0x2a360b,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x3db39c,_0x3d6644,_0x2020ed);}else{const _0x5f4633=new _0x32bf9(_0x24fa36);_0x3db39c=await _0x450dd5['send'](_0x5f4633,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x3db39c,_0x3d6644,_0x2020ed);}}async['_readAsyncIterableResponse'](_0x38ceec,_0x197f0e,_0x5c01be){const _0x136067=_0x38ceec['body'],_0x3fa7d5=new TextDecoder('utf-8');let _0x12b94b='';for await(const _0x539f35 of _0x136067)if(_0x539f35['chunk']){const _0x1ffc7f=_0x3fa7d5['decode'](_0x539f35['chunk']['bytes']),_0x53d1b6=JSON['parse'](_0x1ffc7f);_0x12b94b+=this['_getGeneratedText'](_0x53d1b6,_0x197f0e),_0x5c01be(_0x12b94b);}return Promise['resolve']();}async['_readStreamableResponse'](_0x142ae1,_0xc98dc0,_0x435b77){const _0x263ccd=_0x142ae1['body'],_0x15ae10=new TextDecoder('utf-8'),_0x393711=_0x263ccd['getReader']();let _0x2bf84b='',_0x2ff795='',_0x4f69db=!0x1;for(;!_0x4f69db;){const {done:_0x5bb781,value:_0x7695aa}=await _0x393711['read']();if(_0x4f69db=_0x5bb781,_0x4f69db)break;const _0x5e8386=(_0x2bf84b+_0x15ae10['decode'](_0x7695aa))['split']('\x0a')['map'](_0x4d6b2d=>{try{return _0x2bf84b='',JSON['parse'](_0x4d6b2d);}catch{return _0x2bf84b=_0x4d6b2d,null;}})['filter'](_0x26e8e8=>null!==_0x26e8e8);_0x5e8386['length']&&(_0x2ff795+=_0x5e8386['map'](_0x3545c9=>this['_getGeneratedText'](_0x3545c9,_0xc98dc0))['join'](''),_0x435b77(_0x2ff795));}return Promise['resolve']();}async['_readStaticResponse'](_0x2510d2,_0x1b48e4,_0x52539b){let _0xf5edc2;return _0xf5edc2=_0x2510d2 instanceof Response?await _0x2510d2['json']():JSON['parse'](Buffer['from'](_0x2510d2['body'])['toString']('utf8')),(_0x52539b(this['_getGeneratedText'](_0xf5edc2,_0x1b48e4)),Promise['resolve']());}['_getGeneratedText'](_0x5c88fa,_0x376bbf){switch(this['getModelFamily'](_0x376bbf)){case'anthropic.claude':return _0x5c88fa['completion'];case'ai21.j2':return _0x5c88fa['completions'][0x0]['data']['text'];case'cohere.command':return _0x5c88fa['generations'][0x0]['text'];case'meta.llama':return _0x5c88fa['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-ai",
|
|
3
|
-
"version": "45.2.0-alpha.
|
|
3
|
+
"version": "45.2.0-alpha.7",
|
|
4
4
|
"description": "AI Assistant feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@aws-sdk/client-bedrock-runtime": "3.621.0",
|
|
27
|
-
"@ckeditor/ckeditor5-clipboard": "45.2.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-core": "45.2.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-engine": "45.2.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-icons": "45.2.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-table": "45.2.0-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-ui": "45.2.0-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-utils": "45.2.0-alpha.
|
|
34
|
-
"ckeditor5": "45.2.0-alpha.
|
|
27
|
+
"@ckeditor/ckeditor5-clipboard": "45.2.0-alpha.7",
|
|
28
|
+
"@ckeditor/ckeditor5-core": "45.2.0-alpha.7",
|
|
29
|
+
"@ckeditor/ckeditor5-engine": "45.2.0-alpha.7",
|
|
30
|
+
"@ckeditor/ckeditor5-icons": "45.2.0-alpha.7",
|
|
31
|
+
"@ckeditor/ckeditor5-table": "45.2.0-alpha.7",
|
|
32
|
+
"@ckeditor/ckeditor5-ui": "45.2.0-alpha.7",
|
|
33
|
+
"@ckeditor/ckeditor5-utils": "45.2.0-alpha.7",
|
|
34
|
+
"ckeditor5": "45.2.0-alpha.7",
|
|
35
35
|
"es-toolkit": "1.32.0"
|
|
36
36
|
},
|
|
37
37
|
"type": "module",
|