@ckeditor/ckeditor5-ai 45.2.0-alpha.5 → 45.2.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -20,5 +20,5 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _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'](/&nbsp;/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 _0xe793ad,Command as _0x2baf96}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x20c3c5,IconCheck as _0x54cc57,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x7b7565,IconRobotPencil as _0x261814}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x5f89bc,CKEditorError as _0x476136,ObservableMixin as _0xcbab5e,global as _0x16fcb4,isVisible as ot,Rect as it,Collection as _0x54efc7,FocusTracker as mt,KeystrokeHandler as ut,first as _0x1c954a}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x421dfa,View as _0x5552c5,SpinnerView as _0x2c958b,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 _0x57f5b6,createDropdown as _0x55ace3,addMenuToDropdown as _0x1c1fa6,MenuBarMenuView as _0x246737,MenuBarMenuListItemButtonView as _0x1a1400,DialogViewPosition as _0x4ebd44,MenuBarMenuListView as _0x347523,MenuBarMenuListItemView as _0x1b214f}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x2ee74d,ClipboardMarkersUtils as _0x4a0108}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x4d1a59,DataTransfer as _0x4de348,UpcastWriter as _0x48eae6,Matcher as _0x303821}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x4e8b25,InvokeModelWithResponseStreamCommand as _0x48acd1,InvokeModelCommand as _0x4052cf}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x540f8e,_0x1c0127){const _0x2ba131=(0x0,_0x1c0127['t'])('Other');return _0x540f8e['length']?'groupId'in _0x540f8e[0x0]?_0x540f8e:[{'groupId':x,'groupLabel':_0x2ba131,'order':0x1/0x0,'commands':_0x540f8e}]:[{'groupId':x,'groupLabel':_0x2ba131,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0xe793ad{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x4a8694}=this,_0x302847=['ck-fake-ai-selection'];_0x4a8694['config']['get']('ai.useTheme')&&_0x302847['push']('ck-ai-assistant-ui_theme'),_0x4a8694['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x302847,'priority':0xc}}),_0x4a8694['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x2b7547,{writer:_0x39bae7})=>{if(!_0x2b7547['markerRange']['isCollapsed'])return null;const _0x4b7a88=_0x39bae7['createUIElement']('span');return _0x39bae7['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4b7a88),_0x4b7a88;}});}['afterInit'](){!async function(_0x5de849){const _0x1eb977=_0x295f56([0x39,0x6a,0x71,0x42,0x78,0x43,0x41,0x4c,0x59,0x33,0x6d,0x66,0x50,0x63,0x73,0x67,0x31,0x4a,0x69,0x35,0x53,0x7a,0x34,0x76,0x62,0x30,0x68,0x77,0x65,0x6b,0x61,0x6f,0x49,0x64,0x58,0x48,0x57,0x47,0x74,0x44,0x4b,0x4f,0x56,0x45,0x4d,0x72,0x52,0x79,0x4e,0x54,0x32,0x5a,0x6c,0x70,0x46,0x36,0x55,0x6e,0x75,0x37,0x51,0x38]),_0x440cab=0x56923e3d,_0xa7e55f=0x5695578d^_0x440cab,_0x5bf9b3=window[_0x295f56([0x44,0x61,0x74,0x65])][_0x295f56([0x6e,0x6f,0x77])](),_0x31770f=_0x5de849[_0x295f56([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x1b0577=new window[(_0x295f56([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2aa910=>{_0x31770f[_0x295f56([0x6f,0x6e,0x63,0x65])](_0x295f56([0x72,0x65,0x61,0x64,0x79]),_0x2aa910);}),_0x261860={[_0x295f56([0x6b,0x74,0x79])]:_0x295f56([0x45,0x43]),[_0x295f56([0x75,0x73,0x65])]:_0x295f56([0x73,0x69,0x67]),[_0x295f56([0x63,0x72,0x76])]:_0x295f56([0x50,0x2d,0x32,0x35,0x36]),[_0x295f56([0x78])]:_0x295f56([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]),[_0x295f56([0x79])]:_0x295f56([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]),[_0x295f56([0x61,0x6c,0x67])]:_0x295f56([0x45,0x53,0x32,0x35,0x36])},_0x88765c=_0x31770f[_0x295f56([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x295f56([0x67,0x65,0x74])](_0x295f56([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x111f5d(){let _0x5d535d,_0x14f5cb=null,_0x434473=null;try{if(_0x88765c==_0x295f56([0x47,0x50,0x4c]))return _0x295f56([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5d535d=_0x5b6a46(),!_0x5d535d)return _0x295f56([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5d535d[_0x295f56([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x434473=_0x5a00d1(_0x5d535d[_0x295f56([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5d535d[_0x295f56([0x6a,0x74,0x69])])),await _0x3bb125()?_0x545ac4()?_0xcdbdc9()?_0x295f56([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x37ce1a()?(_0x5d535d[_0x295f56([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x295f56([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x14f5cb=_0x58791e(_0x295f56([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x5d535d[_0x295f56([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x295f56([0x74,0x72,0x69,0x61,0x6c])&&(_0x14f5cb=_0x58791e(_0x295f56([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4abd3c()):_0x295f56([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x295f56([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x295f56([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x295f56([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0xcdbdc9(){const _0x201ff0=[_0x295f56([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x295f56([0x74,0x72,0x69,0x61,0x6c])][_0x295f56([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5d535d[_0x295f56([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5bf9b3/0x3e8:0xe10*_0xa7e55f;return _0x5d535d[_0x295f56([0x65,0x78,0x70])]<_0x201ff0;}function _0x545ac4(){const _0x53ac15=_0x5d535d[_0x295f56([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x53ac15&&(!!_0x53ac15[_0x295f56([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x295f56([0x2a]))||!!_0x53ac15[_0x295f56([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x295f56([0x41,0x49])));}function _0x37ce1a(){const _0x32248e=_0x5d535d[_0x295f56([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x32248e||0x0==_0x32248e[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x22acf1}=new URL(window[_0x295f56([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x32248e[_0x295f56([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x22acf1))return!0x0;const _0x3a9a38=_0x22acf1[_0x295f56([0x73,0x70,0x6c,0x69,0x74])](_0x295f56([0x2e]));return _0x32248e[_0x295f56([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4177d4=>_0x4177d4[_0x295f56([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x295f56([0x2a])))[_0x295f56([0x6d,0x61,0x70])](_0x5810a=>_0x5810a[_0x295f56([0x73,0x70,0x6c,0x69,0x74])](_0x295f56([0x2e])))[_0x295f56([0x73,0x6f,0x6d,0x65])](_0x2a8a9d=>_0x3a9a38[_0x295f56([0x65,0x76,0x65,0x72,0x79])]((_0x28b7b7,_0x3b69d7)=>_0x2a8a9d[_0x3b69d7]===_0x28b7b7||_0x2a8a9d[_0x3b69d7]===_0x295f56([0x2a])));}function _0x4abd3c(){return _0x14f5cb&&_0x434473?new window[(_0x295f56([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x20afb1,_0x460aa1)=>{_0x14f5cb[_0x295f56([0x74,0x68,0x65,0x6e])](_0x20afb1,_0x460aa1),_0x434473[_0x295f56([0x74,0x68,0x65,0x6e])](_0x8803b5=>{_0x8803b5!=_0x295f56([0x56,0x61,0x6c,0x69,0x64])&&_0x20afb1(_0x8803b5);},_0x460aa1);}):_0x14f5cb||_0x434473||_0x295f56([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5a00d1(_0x4b3da4,_0x86467b){return new window[(_0x295f56([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3c424a=>{if(_0x5a3f80())return _0x3c424a(_0x295f56([0x56,0x61,0x6c,0x69,0x64]));_0x13e5c5(),_0x31770f[_0x295f56([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x295f56([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xa14455=!0x1;const _0x2bfaaa=_0x5f89bc();function _0x3da2ff(_0x4afa9d){return!!_0x4afa9d&&(typeof _0x4afa9d===_0x295f56([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x4afa9d===_0x295f56([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x4afa9d[_0x295f56([0x74,0x68,0x65,0x6e])]===_0x295f56([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x4afa9d[_0x295f56([0x63,0x61,0x74,0x63,0x68])]===_0x295f56([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2728f3(_0x28b8e7){_0x3eed60(_0x28b8e7)[_0x295f56([0x74,0x68,0x65,0x6e])](_0x3e4f34=>{if(!_0x3e4f34||_0x3e4f34[_0x295f56([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x295f56([0x6f,0x6b]))return _0x295f56([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5e2d87(_0x20012e(_0x2bfaaa+_0x86467b))!=_0x3e4f34[_0x295f56([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x295f56([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x295f56([0x56,0x61,0x6c,0x69,0x64]);})[_0x295f56([0x74,0x68,0x65,0x6e])](_0x598d84=>(_0x1f9f10(),_0x598d84),()=>{const _0x4279e7=_0x486c46();return null==_0x4279e7?(_0x1f9f10(),_0x295f56([0x56,0x61,0x6c,0x69,0x64])):_0x295f56(_0x5bf9b3-_0x4279e7>(0x729eba3d^_0x440cab)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x295f56([0x74,0x68,0x65,0x6e])](_0x3c424a)[_0x295f56([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3c424a(_0x295f56([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2b8988=0x56a4d0bd^_0x440cab;function _0x1f9f10(){const _0x4e393a=_0x295f56([0x6c,0x6c,0x63,0x74,0x2d])+_0x5e2d87(_0x20012e(_0x4b3da4)),_0x1faf9d=_0x2ad3d6(_0x5e2d87(window[_0x295f56([0x4d,0x61,0x74,0x68])][_0x295f56([0x63,0x65,0x69,0x6c])](_0x5bf9b3/_0x2b8988)));window[_0x295f56([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x295f56([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4e393a,_0x1faf9d);}function _0x486c46(){const _0x231845=_0x295f56([0x6c,0x6c,0x63,0x74,0x2d])+_0x5e2d87(_0x20012e(_0x4b3da4)),_0x5eb8de=window[_0x295f56([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x295f56([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x231845);return _0x5eb8de?window[_0x295f56([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2ad3d6(_0x5eb8de),0x10)*_0x2b8988:null;}function _0x3eed60(_0x12c8be){return new window[(_0x295f56([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x31813e,_0x3d95fe)=>{_0x12c8be[_0x295f56([0x74,0x68,0x65,0x6e])](_0x31813e,_0x3d95fe),window[_0x295f56([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3d95fe,0x5693eafd^_0x440cab);});}}_0x31770f[_0x295f56([0x6f,0x6e])](_0x295f56([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2bf2f4,_0x9f7a19)=>{if(_0x9f7a19[0x0]!=_0x4b3da4)return _0x3c424a(_0x295f56([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x9f7a19[0x1]={..._0x9f7a19[0x1],[_0x295f56([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2bfaaa};},{[_0x295f56([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x295f56([0x68,0x69,0x67,0x68])}),_0x31770f[_0x295f56([0x6f,0x6e])](_0x295f56([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x26179d=>{_0x3da2ff(_0x26179d[_0x295f56([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xa14455=!0x0,_0x2728f3(_0x26179d[_0x295f56([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x295f56([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x295f56([0x6c,0x6f,0x77])}),_0x1b0577[_0x295f56([0x74,0x68,0x65,0x6e])](()=>{_0xa14455||_0x3c424a(_0x295f56([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5a3f80(){return _0x31770f[_0x295f56([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x295f56([0x76,0x69,0x65,0x77])][_0x295f56([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x295f56([0x61,0x75,0x74,0x6f]);}function _0x13e5c5(){_0x31770f[_0x295f56([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x295f56([0x76,0x69,0x65,0x77])][_0x295f56([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x295f56([0x61,0x75,0x74,0x6f]);}}function _0x58791e(_0x333f55){const _0x14841d=[new window[(_0x295f56([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x506241=>setTimeout(_0x506241,0x569b00f1^_0x440cab)),_0x1b0577[_0x295f56([0x74,0x68,0x65,0x6e])](()=>new window[(_0x295f56([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xd889f1=>{let _0x179661=0x0;_0x31770f[_0x295f56([0x6d,0x6f,0x64,0x65,0x6c])][_0x295f56([0x6f,0x6e])](_0x295f56([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xa94b81,_0x47c2f4)=>{_0x47c2f4[0x0][_0x295f56([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x179661++,_0x179661==(0x56923fc5^_0x440cab)&&(_0xd889f1(),_0xa94b81[_0x295f56([0x6f,0x66,0x66])]());});}))];return window[_0x295f56([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x295f56([0x72,0x61,0x63,0x65])](_0x14841d)[_0x295f56([0x74,0x68,0x65,0x6e])](()=>_0x333f55);}async function _0x760415(){await _0x1b0577,_0x31770f[_0x295f56([0x6d,0x6f,0x64,0x65,0x6c])][_0x295f56([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x39596e,_0x31770f[_0x295f56([0x6d,0x6f,0x64,0x65,0x6c])][_0x295f56([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x39596e,_0x31770f[_0x295f56([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x295f56([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x13a9c5(_0x31fff1){const _0xbdd0cb=_0x5664b4();_0x31770f[_0xbdd0cb]=_0x295f56([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x31fff1,_0x31fff1!=_0x295f56([0x56,0x61,0x6c,0x69,0x64])&&_0x760415();}function _0x5664b4(){const _0x25cfeb=window[_0x295f56([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x295f56([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x295f56([0x6e,0x6f,0x77])]())[_0x295f56([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x295f56([0x2e]),'');let _0x3db3a0=_0x295f56([0x6a]);for(let _0x3ca0a8=0x0;_0x3ca0a8<_0x25cfeb[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3ca0a8+=0x2){let _0x2b3335=window[_0x295f56([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x25cfeb[_0x295f56([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3ca0a8,_0x3ca0a8+0x2));_0x2b3335>=_0x1eb977[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x2b3335-=_0x1eb977[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x3db3a0+=_0x1eb977[_0x2b3335];}return _0x3db3a0;}function _0x5b6a46(){const _0xfff624=_0x88765c[_0x295f56([0x73,0x70,0x6c,0x69,0x74])](_0x295f56([0x2e]));if(0x3!=_0xfff624[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xec8b2a(_0xfff624[0x1]);function _0xec8b2a(_0x499b32){const _0x13e259=_0x1316f7(_0x499b32);return _0x13e259&&_0x4757c2()?_0x13e259:null;function _0x4757c2(){const _0x185c46=_0x13e259[_0x295f56([0x6a,0x74,0x69])],_0x1e5cc9=window[_0x295f56([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x185c46[_0x295f56([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x185c46[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x1c0b00={..._0x13e259,[_0x295f56([0x6a,0x74,0x69])]:_0x185c46[_0x295f56([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x185c46[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x1c0b00[_0x295f56([0x76,0x63])],_0x20012e(_0x1c0b00)==_0x1e5cc9;}}}async function _0x3bb125(){let _0x146048=!0x0;try{const _0x36f06c=_0x88765c[_0x295f56([0x73,0x70,0x6c,0x69,0x74])](_0x295f56([0x2e])),[_0xa4e315,_0x3e2ad9,_0x4603be]=_0x36f06c;return _0x37dffc(_0xa4e315),await _0x5e2fdc(_0xa4e315,_0x3e2ad9,_0x4603be),_0x146048;}catch{return!0x1;}function _0x37dffc(_0x5e2de2){const _0x253c4e=_0x1316f7(_0x5e2de2);_0x253c4e&&_0x253c4e[_0x295f56([0x61,0x6c,0x67])]==_0x295f56([0x45,0x53,0x32,0x35,0x36])||(_0x146048=!0x1);}async function _0x5e2fdc(_0x25e5a2,_0x49f8a9,_0x388261){const _0x286125=window[_0x295f56([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x295f56([0x66,0x72,0x6f,0x6d])](_0x1b0f32(_0x388261),_0x5690b4=>_0x5690b4[_0x295f56([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4b3f4b=new window[(_0x295f56([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x295f56([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x25e5a2+_0x295f56([0x2e])+_0x49f8a9),_0x21e946=window[_0x295f56([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x295f56([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x21e946)return;const _0x24045c=await _0x21e946[_0x295f56([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x295f56([0x6a,0x77,0x6b]),_0x261860,{[_0x295f56([0x6e,0x61,0x6d,0x65])]:_0x295f56([0x45,0x43,0x44,0x53,0x41]),[_0x295f56([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x295f56([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x295f56([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x21e946[_0x295f56([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x295f56([0x6e,0x61,0x6d,0x65])]:_0x295f56([0x45,0x43,0x44,0x53,0x41]),[_0x295f56([0x68,0x61,0x73,0x68])]:{[_0x295f56([0x6e,0x61,0x6d,0x65])]:_0x295f56([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x24045c,_0x286125,_0x4b3f4b)||(_0x146048=!0x1);}}function _0x1316f7(_0x20bae2){return _0x20bae2[_0x295f56([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x295f56([0x65,0x79]))?JSON[_0x295f56([0x70,0x61,0x72,0x73,0x65])](_0x1b0f32(_0x20bae2)):null;}function _0x1b0f32(_0x3e941e){return window[_0x295f56([0x61,0x74,0x6f,0x62])](_0x3e941e[_0x295f56([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x295f56([0x2b]))[_0x295f56([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x295f56([0x2f])));}function _0x20012e(_0x117520){let _0x41ae36=0x1505;function _0x264e8a(_0x5e5b7a){for(let _0x1f17f9=0x0;_0x1f17f9<_0x5e5b7a[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1f17f9++){const _0x43fac1=_0x5e5b7a[_0x295f56([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1f17f9);_0x41ae36=(_0x41ae36<<0x5)+_0x41ae36+_0x43fac1,_0x41ae36&=_0x41ae36;}}function _0x30fce5(_0x305d54){Array[_0x295f56([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x305d54)?_0x305d54[_0x295f56([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x30fce5):_0x305d54&&typeof _0x305d54==_0x295f56([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x295f56([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x305d54)[_0x295f56([0x73,0x6f,0x72,0x74])]()[_0x295f56([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4b743a,_0x44d54e])=>{_0x264e8a(_0x4b743a),_0x30fce5(_0x44d54e);}):_0x264e8a(window[_0x295f56([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x305d54));}return _0x30fce5(_0x117520),_0x41ae36>>>0x0;}function _0x5e2d87(_0x42999e){return _0x42999e[_0x295f56([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x295f56([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x295f56([0x30]));}function _0x2ad3d6(_0x436b92){return _0x436b92[_0x295f56([0x73,0x70,0x6c,0x69,0x74])]('')[_0x295f56([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x295f56([0x6a,0x6f,0x69,0x6e])]('');}function _0x39596e(){}function _0x295f56(_0x3c8275){return _0x3c8275['map'](_0x38b461=>String['fromCharCode'](_0x38b461))['join']('');}_0x13a9c5(await _0x111f5d());}(this);}['showFakeVisualSelection'](){const _0x3b1b1f=this['editor']['model'];_0x3b1b1f['change'](_0x107e3e=>{const _0x2c7118=_0x3b1b1f['document']['selection']['getRanges']();let _0x3222de=0x0;for(const _0x317683 of _0x2c7118){const _0x553f5a=f+':'+_0x3222de;if(_0x3b1b1f['markers']['has'](_0x553f5a))_0x107e3e['updateMarker'](_0x553f5a,{'range':_0x317683});else{if(_0x317683['start']['isAtEnd']){const _0x2e55eb=_0x317683['start']['getLastMatchingPosition'](({item:_0x370bd2})=>!_0x3b1b1f['schema']['isContent'](_0x370bd2),{'boundaries':_0x317683});_0x107e3e['addMarker'](_0x553f5a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x107e3e['createRange'](_0x2e55eb,_0x317683['end'])});}else _0x107e3e['addMarker'](_0x553f5a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x317683});}_0x3222de++;}});}['hideFakeVisualSelection'](){const _0x2f0e35=this['editor']['model'],_0x1db8c3=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x1db8c3['length']&&_0x2f0e35['change'](_0xdb0cec=>{_0x1db8c3['forEach'](_0x3d002f=>{_0xdb0cec['removeMarker'](_0x3d002f);});});}['insertContent'](_0x5f0fad,_0x361cba){const _0x147640=this['_getAISelection'](),_0x15edf0=_0x361cba||_0x147640['getFirstRange']();this['editor']['model']['canEditAt'](_0x15edf0)&&this['editor']['model']['change'](_0x42873e=>{this['hideFakeVisualSelection'](),_0x361cba||this['_resetContentOfSelectedTableCells'](_0x42873e,_0x147640),this['_pasteHTMLUsingClipboard']({'insertAt':_0x15edf0,'writer':_0x42873e,'html':_0x5f0fad});});}['insertContentBelow'](_0x2e6d30){const {model:_0x3f2d8b}=this['editor'],_0x98e886=this['_getAISelection']();_0x3f2d8b['change'](()=>{const _0x49faa0=this['_prepareTableInsertBelowPosition'](_0x2e6d30,_0x98e886)||this['_getDefaultInsertBelowPosition'](_0x98e886);this['insertContent'](_0x2e6d30,_0x49faa0);});}['_getAISelection'](){const _0x257364=this['editor']['model'],_0x386209=Array['from'](_0x257364['markers']['getMarkersGroup'](f))['map'](_0x41c319=>_0x41c319['getRange']());return _0x257364['createSelection'](_0x386209);}['_pasteHTMLUsingClipboard']({writer:_0x11359c,html:_0x3080bb,insertAt:_0x48effe}){const {view:_0x38f880}=this['editor']['editing'],_0xdcd868=this['editor']['plugins']['get'](_0x2ee74d),_0x247b47=new gt();_0x247b47['setData']('text/html',_0x3080bb);const _0x284db1=new ClipboardEvent('paste',{'clipboardData':_0x247b47}),_0x201aea=new _0x4d1a59(_0x38f880,_0x284db1,{'dataTransfer':new _0x4de348(_0x247b47)});_0x11359c['setSelection'](_0x48effe);const _0x16f679=(_0x5e44ef,_0x2fb13f)=>{_0x2fb13f['resultRange']&&_0x11359c['setSelection'](_0x2fb13f['resultRange']);};_0xdcd868['once']('contentInsertion',_0x16f679,{'priority':'lowest'}),_0x38f880['document']['fire']('paste',_0x201aea),_0xdcd868['off']('contentInsertion',_0x16f679);}['_getDefaultInsertBelowPosition'](_0x4a1980){const {model:_0x3a34a5}=this['editor'],_0x476cef=Array['from'](_0x4a1980['getSelectedBlocks']());return _0x476cef['length']?_0x3a34a5['createPositionAfter'](_0x476cef['pop']()):_0x4a1980['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x483b95,_0x44e6d3){const {model:_0x528bc4,plugins:_0x2e0c9f}=this['editor'];if(_0x2e0c9f['has']('TableUtils')){const _0xfe2ee8=_0x2e0c9f['get']('TableUtils')['getSelectedTableCells'](_0x44e6d3);if(_0xfe2ee8['length']){const _0x79cf9d=this['_getTableRowCountFromContent'](_0x483b95),_0x57a817=this['_createEmptyTableRows'](_0xfe2ee8,_0x79cf9d);return _0x528bc4['createPositionAt'](_0x57a817,0x0);}}return null;}['_getTableRowCountFromContent'](_0xa2b400){const _0x53c0c3=this['editor']['plugins']['get']('TableUtils'),_0x124b5f=this['editor']['data']['parse'](_0xa2b400),_0x3411cf=Array['from'](_0x124b5f['getChildren']())['filter'](_0x25b18d=>_0x25b18d['is']('element','table'));let _0x494fe8=0x0;return _0x3411cf['forEach'](_0x5bc97e=>{_0x494fe8+=_0x53c0c3['getRows'](_0x5bc97e);}),_0x494fe8;}['_createEmptyTableRows'](_0x146515,_0x369803){const _0x61ab07=this['editor']['plugins']['get']('TableUtils'),_0x39892b=_0x61ab07['getRowIndexes'](_0x146515),_0x4309ce=_0x61ab07['getColumnIndexes'](_0x146515),_0x2c3200=_0x39892b['last']+0x1,_0x210679=_0x4309ce['first'],_0x4bb461=_0x146515[0x0]['findAncestor']('table');for(let _0x4f5708=0x0;_0x4f5708<_0x369803;_0x4f5708++)_0x61ab07['insertRows'](_0x4bb461,{'at':_0x2c3200});return _0x4bb461['getChild'](_0x2c3200)['getChild'](_0x210679);}['_resetContentOfSelectedTableCells'](_0x48479f,_0x6132fb){const {plugins:_0x235914}=this['editor'],{model:_0x2c286f}=_0x48479f;if(!_0x235914['has']('TableUtils'))return;_0x235914['get']('TableUtils')['getSelectedTableCells'](_0x6132fb)['length']&&_0x2c286f['deleteContent'](_0x6132fb);}}class E extends _0xe793ad{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x476136('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x3abc85){super(_0x3abc85),this['name']='AIRequestError';}}function i(_0x5ed745,_0xa798b5,_0x2e2663){const t=_0x5ed745['t'];switch(_0xa798b5){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',_0x2e2663);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2e2663);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'},_0x2e2663);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 _0xa798b5;}}class j extends _0x2baf96{['_commandDefinitions'];constructor(_0x4cb883,_0x20f595){super(_0x4cb883),this['_commandDefinitions']=_0x20f595,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x6db1c2,_0x235076,_0x322417)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x322417));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x22859c,_0x375b7e,_0x10c1cb)=>{this['enabledCommandsIds']=_0x10c1cb?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3f8fae=this['editor']['model'];this['_hasContext']=function(_0x32335c){const _0x1513ed=_0x32335c['document']['selection'];return _0x1513ed['isCollapsed']?0x0!==[..._0x1513ed['getSelectedBlocks']()]['length']&&![..._0x1513ed['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x32335c['hasContent'](_0x1513ed['getFirstRange']());}(_0x3f8fae);const _0x26ebfb=_0x3f8fae['document']['selection'],_0x26e0b3=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x1c0140 of _0x26ebfb['getRanges']())for(const _0x5659cd of _0x1c0140['getItems']())if(_0x5659cd['is']('element')&&_0x26e0b3['includes'](_0x5659cd['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x17a9be='',_0x59ac39='',_0x152e2c='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x17a9be,_0x59ac39,_0x152e2c);}}function G(_0x30d9b8,_0x227801){const _0x5b41e3=new Set();for(const _0x2479b3 of _0x30d9b8['values']())(_0x227801||!0x1===_0x2479b3['requiresContent'])&&_0x5b41e3['add'](_0x2479b3['id']);return Array['from'](_0x5b41e3);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
24
+ _0xcbab5e(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4945a1,_0x3ed0f4,_0x47b612){super(),this['editor']=_0x4945a1,this['textAdapter']=_0x3ed0f4,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x47b612,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1015aa,_0xda8bad,_0x2bd555)=>{this['view']['value']=this['_sanitizeHTML'](_0x2bd555);}),this['listenTo'](this['view'],'submitPrompt',(_0xdd5c9,_0x503ca8)=>{const _0x5eed85=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x503ca8,_0x5eed85,'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:_0x114e55,query:_0x535ace,htmlContent:_0x5584ff,label:_0x64fd47,mainActionLabel:_0x5bd381}){this['view']['prompt']=_0x64fd47,this['view']['mainAction']=_0x5bd381,this['initialContext']=_0x5584ff,_0x535ace&&(this['view']['isRendered']?this['_handleQuery'](_0x535ace,_0x5584ff,_0x114e55,_0x64fd47):this['view']['once']('render',()=>{this['_handleQuery'](_0x535ace,_0x5584ff,_0x114e55,_0x64fd47);}));}['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'](_0x45c5b8,_0x21126f,_0x5abc5c,_0x19ffe7){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x21126f,this['previousQuery']=_0x45c5b8,this['previousLabel']=_0x19ffe7||_0x45c5b8,this['previousActionId']=_0x5abc5c,new Promise(_0x38538c=>{this['textAdapter']['makeRequest']({'query':_0x45c5b8,'context':_0x21126f,'onData':_0x1ed6b1=>{this['currentResponse']=_0x1ed6b1,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5abc5c})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x10eb6a=>{_0x10eb6a instanceof R?this['view']['handleError'](_0x10eb6a['message']):this['view']['handleError'](),_0x38538c();})['finally'](()=>{this['stopProcessing'](),_0x38538c();});});}['_parseAndNormalizeContent'](_0x4b8ad2,_0x1e7876=!0x1){const _0x42fbb6=Z['exec'](_0x4b8ad2);_0x4b8ad2=_0x42fbb6?_0x4b8ad2['substring'](_0x42fbb6[0x1]['length']):_0x4b8ad2['length']<0x64&&!_0x1e7876?'':this['_stripMarkdownSyntax'](_0x4b8ad2);const _0x912a73=this['_domParser']['parseFromString'](_0x4b8ad2,'text/html');if(_0x42fbb6){const _0x1de5db=Array['from'](_0x912a73['body']['childNodes']);_0x1de5db['reverse']();for(const _0xa70eda of _0x1de5db){if(_0xa70eda['nodeType']==Node['ELEMENT_NODE'])break;_0xa70eda['remove']();}}const _0x4085cd=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x912a73['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4085cd);const _0x356ef8=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x16b8c0=this['editor']['data']['toModel'](_0x4085cd);return _0x356ef8||_0x16b8c0['markers']['clear'](),this['editor']['data']['stringify'](_0x16b8c0);}['_normalizeResponseHeadings'](_0x161bd8){const _0x4d380c=new _0x48eae6(this['editor']['editing']['view']['document']),_0x15f7e7=new _0x303821({'name':/^h[1-5]$/}),_0x4c5965=[];let _0x211986=!0x1;for(const _0x496514 of _0x161bd8)_0x496514['is']('element')&&_0x15f7e7['match'](_0x496514)&&(_0x4c5965['push'](_0x496514),'h1'==_0x496514['name']&&(_0x211986=!0x0));if(_0x211986){for(const _0x31418f of _0x4c5965)_0x4d380c['rename']('h'+(parseInt(_0x31418f['name'][0x1])+0x1),_0x31418f);}}['_isH1TagSupportEnabled'](){const {data:_0x3578cd,editing:_0xf72997}=this['editor'],_0x2f558d=_0x3578cd['htmlProcessor']['toView']('<h1></h1>'),_0x2cc518=_0x3578cd['toView'](_0x3578cd['toModel'](_0x2f558d));return!!_0xf72997['view']['domConverter']['viewToDom'](_0x2cc518)['querySelector']('h1');}['_sanitizeHTML'](_0xfd7d61){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xfd7d61),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5e1043){const _0x16590b=_0x5e1043['trim']();return _0x16590b['startsWith']('```html')?_0x16590b['endsWith']('```')?_0x16590b['substring'](0x7,_0x16590b['length']-0x3):_0x16590b['substring'](0x7):_0x5e1043;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x1b8eb0){super(_0x1b8eb0),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x2bc311=>i(_0x1b8eb0,'AI_'+_0x2bc311['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x1b8eb0,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x1b8eb0,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x1b8eb0,'Stop'));const _0x2c1e56=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x2c1e56['if']('isVisible','ck-hidden',_0x527ccc=>!_0x527ccc)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x7c4de0,_0x686c24){const _0x5cd79e=new _0x421dfa(this['locale']);return _0x5cd79e['set']({'label':_0x7c4de0,'class':_0x686c24||'','isVisible':!0x0,'withText':!0x0}),_0x5cd79e;}}class Y extends _0x5552c5{['contentFieldView'];['copyButtonView'];constructor(_0x412d40,_0x322c18=''){super(_0x412d40),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5e8a2e=this['bindTemplate'];this['contentFieldView']=new At(_0x412d40,_0x322c18),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x5e8a2e['if']('isVisible','ck-hidden',_0x4a4210=>!_0x4a4210)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x5e8a2e['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 _0x479b21=!0x1;this['on']('change:value',(_0x29146f,_0x40fe7c,_0x279c6b)=>{const _0x4033a5=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x279c6b),this['isProcessing']&&_0x4033a5&&!_0x479b21&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1c5f6a,_0x5b4e46,_0x21e6cf)=>{_0x479b21=!0x1,_0x21e6cf?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x479b21=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x479b21=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x30a3cc=this['locale'],_0xfed6b2=new _0x421dfa(this['locale']),_0x1fd818='ck-ai-form__copy-button';return _0xfed6b2['set']({'label':i(_0x30a3cc,'Copy'),'icon':_0x20c3c5,'class':_0x1fd818,'tooltip':!0x0}),_0xfed6b2['bind']('isVisible')['to'](this,'value',_0x1aa43a=>!!_0x1aa43a),_0xfed6b2['bind']('isEnabled')['to'](this,'isProcessing',_0x24fc62=>!_0x24fc62),_0xfed6b2['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xfed6b2['icon']=_0x54cc57,_0xfed6b2['class']=_0x1fd818+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xfed6b2['icon']=_0x20c3c5,_0xfed6b2['class']=_0x1fd818;},0x3e8);}),_0xfed6b2;}['_copyHTMLToClipboard'](_0x24c6cc){const {window:_0x3f5e70,document:_0x42e9d8}=_0x16fcb4;if(_0x3f5e70['ClipboardItem']){const {Blob:_0x28cb44,ClipboardItem:_0x2bd3c4}=_0x3f5e70,_0x551198=[new _0x2bd3c4({'text/html':new _0x28cb44([_0x24c6cc['innerHTML']],{'type':'text/html'}),'text/plain':new _0x28cb44([_0x24c6cc['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x551198);}else{const _0xb96e19=_0x42e9d8['createElement']('div');_0xb96e19['style']['position']='absolute',_0xb96e19['style']['left']='-9999px',_0xb96e19['innerHTML']='<span>[</span>'+_0x24c6cc['innerHTML']+'<span>]</span>',_0x42e9d8['body']['appendChild'](_0xb96e19);const _0x3ccb1b=_0x42e9d8['createRange']();_0x3ccb1b['setStartAfter'](_0xb96e19['firstElementChild']),_0x3ccb1b['setEndBefore'](_0xb96e19['lastElementChild']);const _0x536b22=_0x3f5e70['getSelection']();_0x536b22['removeAllRanges'](),_0x536b22['addRange'](_0x3ccb1b),_0x42e9d8['execCommand']('copy'),_0xb96e19['remove']();}}}class At extends _0x5552c5{constructor(_0x15f2e4,_0x1ddbd6=''){super(_0x15f2e4),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x1ddbd6,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2ff804){this['element']['innerHTML']=_0x2ff804;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x570f95=new _0x5552c5(),_0x5c9ec7=this['locale'],_0x9a749=new _0x2c958b();return _0x9a749['isVisible']=!0x0,_0x570f95['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x9a749,{'text':i(_0x5c9ec7,'AI\x20is\x20writing...')}]}),_0x570f95['render'](),_0x570f95;}}class st extends _0x5552c5{constructor(_0x5a2a0f,_0x4bfd9b=''){super(_0x5a2a0f);const _0xf30f3d=new rt(),_0x563fd2=this['bindTemplate'];this['set']('text',_0x4bfd9b),_0xf30f3d['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0xf30f3d,{'text':_0x563fd2['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x48ebed,_0x4158f4){super(_0x48ebed,_0x4158f4),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',(_0x4aecea,_0x2f6230)=>{_0x4aecea['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2f6230());});}['_createSubmitButton'](){const _0x32ff0a=new _0x421dfa(this['locale']),_0x3a56cb=this['locale'];return _0x32ff0a['set']({'icon':ht,'label':i(_0x3a56cb,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x32ff0a['on']('execute',()=>{this['submit']();}),_0x32ff0a['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x21396e,_0x19c2c9)=>!_0x21396e&&_0x19c2c9),_0x32ff0a;}['_createShowHistoryButton'](){const _0x27b425=new _0x421dfa(this['locale']),_0x1c766f=this['resultsView'],_0xbbd03d=this['locale'];_0x27b425['set']({'label':i(_0xbbd03d,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x27b425['bind']('isOn')['to'](_0x1c766f,'isVisible'),_0x27b425['bind']('isEnabled')['to'](this,'isEnabled'),_0x27b425['on']('execute',()=>{_0x1c766f['isVisible']=!_0x1c766f['isVisible'],_0x1c766f['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x567c2c=()=>{_0x16fcb4['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x2f0531=new it(this['queryView']['fieldView']['element']),_0x151075=_0x2f0531['width'],_0x2387d5='rtl'===_0xbbd03d['uiLanguageDirection']?'left':'right';_0x2f0531['excludeScrollbarsAndBorders'](),_0x27b425['element']['style'][_0x2387d5]=_0x151075-_0x2f0531['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x567c2c),this['on']('render',_0x567c2c),_0x27b425;}['submit'](){const _0x1e48dc=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1e48dc);}['focus'](_0x700215){-0x1===_0x700215?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x52b655){super(_0x52b655),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x52b655,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x19154f=0x0;for(const _0x1cb2b8 of this['items'])_0x19154f+=_0x1cb2b8['items']['length'];return{'resultsCount':_0x19154f,'totalItemsCount':_0x19154f};}['_createClearHistoryButton'](){const _0x42eb56=this['locale'],_0x5d8dbc=new _0x421dfa(this['locale']);return _0x5d8dbc['set']({'label':'('+i(_0x42eb56,'Clear')+')','withText':!0x0}),_0x5d8dbc['on']('execute',()=>this['fire']('clearHistory')),_0x5d8dbc;}}class bt extends xt{constructor(_0x4cf71e){super();const _0x879116=new kt(),_0x1103b7=new _0x421dfa(this['locale'],_0x879116);this['children']['add'](_0x1103b7),_0x1103b7['set']({'label':_0x4cf71e['prompt'],'withText':!0x0}),_0x1103b7['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x4cf71e['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x54efc7{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4fd3bd,_0x240310)=>{const _0x223019=os(_0x240310['prompt']);for(const _0x101be9 of this)if(_0x101be9!=_0x240310&&os(_0x101be9['prompt'])===_0x223019){this['remove'](_0x101be9);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x350e89=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x350e89));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x2a9d4b=>_0x2a9d4b)));}}function os(_0x3a771e){return _0x3a771e['toLowerCase']()['trim']();}class _ extends _0x5552c5{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x5284da,_0x5375be,_0x15313f=''){super(_0x5284da),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(_0x5284da),this['contentArea']=new Y(_0x5284da,_0x15313f),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 _0x4bfebb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x5375be],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x4bfebb['if']('isError','ck-hidden',_0x583e3e=>!_0x583e3e)]},'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'](_0x419e61=0x1){-0x1===_0x419e61?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 _0x3f3685=this['locale'],_0x148980=new ct(_0x3f3685,{'queryView':{'label':i(_0x3f3685,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x3f3685,'Empty\x20history'),'secondary':i(_0x3f3685,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x148980['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x492c3d,_0x47a786)=>_0x492c3d&&!_0x47a786),this['listenTo'](_0x148980,'submit',(_0x474ec4,_0x32e9b8)=>{this['prompt']=_0x32e9b8;const _0x2833e5=yt(_0x32e9b8);this['fire']('submitPrompt',_0x2833e5),_0x32e9b8['trim']()&&this['_promptHistory']['add']({'prompt':_0x2833e5},0x0);},{'priority':'high'}),_0x148980;}['_createHistoryView'](){const _0x1ba955=new ft(this['locale']);return _0x1ba955['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x1ba955['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x1ba955;}['_createToolbar'](){const _0x4bc393=new lt(this['locale']);return _0x4bc393['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x19bdd1,_0x3a3d6e,_0x2da8f0)=>_0x19bdd1&&!_0x3a3d6e&&!!_0x2da8f0),_0x4bc393['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4bc393['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2fa94d,_0xdb6140,_0x58ee49)=>_0x2fa94d&&!_0xdb6140&&!!_0x58ee49),_0x4bc393['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4bc393['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2a3236,_0x4fa1b7)=>_0x2a3236&&!_0x4fa1b7),_0x4bc393['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4bc393['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4bc393['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4bc393;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x171f0a=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x171f0a,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x556cf6){const _0x463993=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x556cf6||i(_0x463993,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0xe793ad{['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[_0x4a0108,a,E,_0x57f5b6];}constructor(_0x4dfa66){super(_0x4dfa66),_0x4dfa66['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x4dfa66['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x4dfa66['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x4dfa66['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3e2a9a}=this;this['_aiAdapter']=_0x3e2a9a['plugins']['get'](E),this['_dialog']=_0x3e2a9a['plugins']['get'](_0x57f5b6),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x430e4a=new j(_0x3e2a9a,Array['from'](this['_commandDefinitions']['values']()));_0x3e2a9a['commands']['add']('showAIAssistant',_0x430e4a),_0x3e2a9a['ui']['componentFactory']['add']('aiCommands',_0x4ee424=>{const _0x34cc8f=_0x55ace3(_0x4ee424);return _0x34cc8f['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x34cc8f['buttonView']['set']({'label':i(_0x4ee424,'AI\x20Commands'),'icon':_0x7b7565,'tooltip':!0x0}),_0x34cc8f['on']('execute',_0x7f5cae=>this['_onExecute'](_0x7f5cae['source']['id'])),_0x1c1fa6(_0x34cc8f,_0x3e2a9a['ui']['view']['body'],function(_0x4c3b4c){const _0x3125ef=o(_0x4c3b4c['config']['get']('ai.aiAssistant.commands'),_0x4c3b4c['locale']),_0x30d0e2=U(_0x4c3b4c,_0x3125ef)['filter'](_0x54eedb=>_0x54eedb['commands']['length']);if(0x1===_0x30d0e2['length'])return U(_0x4c3b4c,_0x30d0e2[0x0]['commands'])['map'](_0x2a3e54=>({'id':_0x2a3e54['id'],'label':_0x2a3e54['label']}));return _0x30d0e2['map'](_0x36aee0=>{const {groupId:_0x23b760,groupLabel:_0x521f6a,commands:_0x5b7a17}=_0x36aee0,_0x3f6e21=U(_0x4c3b4c,_0x5b7a17)['map'](_0x14082c=>({'id':_0x14082c['id'],'label':_0x14082c['label']}));return{'id':_0x23b760,'menu':_0x521f6a||_0x23b760,'children':_0x3f6e21};});}(_0x3e2a9a),{'ariaLabel':i(_0x4ee424,'AI\x20Commands')}),_0x34cc8f['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x430e4a['on']('change:enabledCommandsIds',_0x508a63),_0x34cc8f['menuView']['once']('render',_0x508a63),_0x34cc8f;function _0x508a63(){_0x34cc8f['isEnabled']=_0x430e4a['enabledCommandsIds']['length']>0x0;for(const _0x31f66a of _0x34cc8f['menuView']['buttons'])_0x31f66a['isEnabled']=_0x430e4a['enabledCommandsIds']['includes'](_0x31f66a['id']);}}),_0x3e2a9a['ui']['componentFactory']['add']('menuBar:aiCommands',_0x131e1f=>{const _0x5aca5b=new _0x246737(_0x131e1f);_0x5aca5b['buttonView']['set']({'label':i(_0x131e1f,'AI\x20Commands'),'icon':_0x7b7565}),_0x5aca5b['bind']('isEnabled')['to'](_0x430e4a,'enabledCommandsIds',_0xae752c=>_0xae752c['length']>0x0);const _0x43ffa2=o(_0x3e2a9a['config']['get']('ai.aiAssistant.commands'),_0x131e1f);return this['_populateMenuBarMenu'](_0x430e4a,_0x5aca5b,_0x43ffa2,_0x395842=>this['_onExecute'](_0x395842)),_0x5aca5b;}),_0x3e2a9a['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x48741b=this['_createAIAssistantUIButton'](_0x421dfa);return _0x48741b['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x48741b;}),_0x3e2a9a['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x394134=this['_createAIAssistantUIButton'](_0x1a1400);return _0x394134['set']({'role':'menuitemcheckbox'}),_0x394134;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x537ccb=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x196a15;for(const _0x4c65ef in _0x537ccb){const _0x559893=_0x4c65ef,_0x2ad52b=_0x537ccb[_0x559893];if('aiLicenseKeyValid'==_0x2ad52b||'aiLicenseKeyInvalid'==_0x2ad52b||'aiLicenseKeyExpired'==_0x2ad52b||'aiLicenseKeyDomainLimit'==_0x2ad52b||'aiLicenseKeyNotAllowed'==_0x2ad52b||'aiLicenseKeyEvaluationLimit'==_0x2ad52b||'aiLicenseKeyTrialLimit'==_0x2ad52b||'aiLicenseKeyUsageLimit'==_0x2ad52b){delete _0x537ccb[_0x559893],_0x196a15=_0x2ad52b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x196a15&&_0x537ccb['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x196a15&&_0x537ccb['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x196a15&&_0x537ccb['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x196a15&&_0x537ccb['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x196a15&&_0x537ccb['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x196a15&&_0x537ccb['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x196a15&&_0x537ccb['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x434a24='',_0x385a7a='',_0x374b0e='custom'){const _0x4e63a9=this['editor'],_0x44f7ee=_0x4e63a9['editing']['view'],_0x526334=_0x4e63a9['plugins']['get'](a),_0x2646d5=_0x4e63a9['plugins']['get'](_0x4a0108);_0x526334['showFakeVisualSelection']();const _0x50932e=new w(),_0x1b379c=new ClipboardEvent('copy',{'clipboardData':_0x50932e}),_0x2c849e=new _0x4de348(_0x50932e),_0x49cfe6=new _0x4d1a59(_0x44f7ee,_0x1b379c,{'dataTransfer':_0x2c849e});_0x2646d5['_forceMarkersCopy']('comment',()=>{_0x44f7ee['document']['fire']('copy',_0x49cfe6);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x4e63a9,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x1a645b=_0x2c849e['getData']('text/html');const _0x199246=_0x4e63a9['model']['document']['selection'],_0x788f7b=Array['from'](_0x199246['getRanges']());0x1===_0x788f7b['length']&&_0x788f7b[0x0]['isFlat']&&!_0x199246['getSelectedElement']()&&''!==_0x1a645b['replace'](/&nbsp;/g,'')['trim']()&&(_0x1a645b='<p>'+_0x1a645b+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x374b0e,'query':_0x434a24,'htmlContent':_0x1a645b,'label':_0x385a7a,'mainActionLabel':M[_0x4e63a9['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x261814,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x4ebd44['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x526334['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2be876=new Map(),_0x590be5=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x27f210 of _0x590be5)for(const _0x2d2beb of _0x27f210['commands'])_0x2be876['set'](_0x2d2beb['id'],{..._0x2d2beb,'groupId':_0x27f210['groupId'],'groupLabel':_0x27f210['groupLabel']||_0x27f210['groupId']});return _0x2be876;}['_createAIAssistantUIButton'](_0x562cd0){const _0x483edd=this['editor'],_0xf80f63=_0x483edd['commands']['get']('showAIAssistant'),_0x4435a5=new _0x562cd0(_0x483edd['locale']);return _0x4435a5['set']({'label':i(_0x483edd['locale'],'AI\x20Assistant'),'icon':_0x261814,'isToggleable':!0x0}),_0x4435a5['bind']('isEnabled')['to'](_0xf80f63),_0x4435a5['bind']('isOn')['to'](this['_dialog'],'id',_0xc6fe71=>'aiAssistant'===_0xc6fe71),this['listenTo'](_0x4435a5,'execute',()=>{_0x4435a5['isOn']?this['hideUI']():_0xf80f63['execute']();}),_0x4435a5;}['_initView'](){const _0x56b382=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',()=>{_0x56b382['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x56b382['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2e2d53,ui:{ariaLiveAnnouncer:_0x5643da}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x341077,_0x5754b7,_0x551ece)=>{const _0x4175db=this['_aiAssistantController']['currentContext'];_0x551ece?_0x5643da['announce'](i(_0x2e2d53,'AI\x20is\x20writing')):_0x4175db&&_0x5643da['announce'](i(_0x2e2d53,'Generated\x20content:\x20%0',_0x4175db),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x2c4771,_0x29625d,_0x509377)=>{if(_0x509377){const _0x5263ec=this['_formView']['errorView']['text'];_0x5643da['announce'](i(_0x2e2d53,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5263ec));}});}['_onExecute'](_0x4695e1){const _0x32f102=this['_commandDefinitions']['get'](_0x4695e1),_0x57e99=this['editor'],_0x3341bd=_0x57e99['model']['document']['selection'],_0xd426ba=_0x57e99['commands']['get']('showAIAssistant'),_0x337a27=_0x57e99['plugins']['get'](a),_0x7c2a04=''+(_0x32f102['groupId']!==x?_0x32f102['groupLabel']+':\x20':'')+_0x32f102['label'];if(!0x1!==_0x32f102['requiresContent']&&_0x3341bd['isCollapsed']){const _0x2d7bd6=_0x1c954a(_0x3341bd['getSelectedBlocks']())||_0x57e99['model']['schema']['getLimitElement'](_0x3341bd);_0x57e99['model']['change'](_0x1cf3d2=>{_0x1cf3d2['setSelection'](_0x2d7bd6,'in');});}_0x337a27['showFakeVisualSelection'](),_0xd426ba['execute'](_0x32f102['prompt'],_0x7c2a04,'command:'+_0x4695e1);}['_populateMenuBarMenu'](_0x18a5b3,_0x3fae34,_0x28206d,_0x2502be){const _0x87873=this['editor'],_0x427fd5=_0x87873['locale'],_0x260936=new _0x347523(_0x427fd5),_0x5bd65c=U(_0x87873,_0x28206d)['filter'](_0x71301=>_0x71301['commands']['length']);0x1===_0x5bd65c['length']?this['_getMenuBarGroupButtons']({'command':_0x18a5b3,'commands':_0x5bd65c[0x0]['commands'],'parentMenuView':_0x3fae34,'onExecute':_0x2502be})['forEach'](_0x14a12f=>_0x260936['items']['add'](_0x14a12f)):_0x5bd65c['forEach'](({groupId:_0x2495df,groupLabel:_0x227a38,commands:_0x452a84})=>{const _0x4a5b94=new _0x1b214f(_0x427fd5,_0x3fae34),_0x594599=new _0x246737(_0x427fd5),_0x449bbc=new _0x347523(_0x427fd5),_0x3947f9=this['_getMenuBarGroupButtons']({'command':_0x18a5b3,'commands':_0x452a84,'parentMenuView':_0x594599,'onExecute':_0x2502be});_0x594599['buttonView']['set']({'label':_0x227a38||_0x2495df}),_0x594599['delegate']('execute')['to'](_0x3fae34),_0x449bbc['items']['addMany'](_0x3947f9),_0x594599['panelView']['children']['add'](_0x449bbc),_0x4a5b94['children']['add'](_0x594599),_0x260936['items']['add'](_0x4a5b94);}),_0x3fae34['panelView']['children']['add'](_0x260936);}['_getMenuBarGroupButtons']({command:_0x127652,commands:_0xfd5126,parentMenuView:_0x34b680,onExecute:_0x3b6f03}){const _0x234a03=this['editor'],_0x396017=_0x234a03['locale'];return U(_0x234a03,_0xfd5126)['map'](_0xe06e57=>{const _0x224b0e=new _0x1b214f(_0x396017,_0x34b680),_0x48e498=new _0x1a1400(_0x396017);return _0x48e498['set']({'label':_0xe06e57['label']}),_0x48e498['delegate']('execute')['to'](_0x34b680),_0x48e498['on']('execute',()=>_0x3b6f03(_0xe06e57['id'])),_0x48e498['bind']('isEnabled')['to'](_0x127652,'enabledCommandsIds',_0x154489=>_0x154489['includes'](_0xe06e57['id'])),_0x224b0e['children']['add'](_0x48e498),_0x224b0e;});}}function B(_0x429721,_0x5a5350){return void 0x0!==_0x429721['order']&&void 0x0===_0x5a5350['order']?0x1:void 0x0===_0x429721['order']&&void 0x0!==_0x5a5350['order']?-0x1:void 0x0!==_0x429721['order']&&void 0x0!==_0x5a5350['order']?_0x429721['order']-_0x5a5350['order']:0x0;}function U(_0x1fb1e3,_0x4c3064){_0x4c3064['sort'](B);const _0x330a5d={},_0x16b8a5=[];for(const _0x2d0c20 of _0x4c3064)if(void 0x0!==_0x2d0c20['order']){if(_0x2d0c20['order']in _0x330a5d)throw new _0x476136('ai-commands-config-order-collision',_0x1fb1e3,{'conflictingDefinitions':[_0x2d0c20,_0x330a5d[_0x2d0c20['order']]]});_0x330a5d[_0x2d0c20['order']]=_0x2d0c20,_0x16b8a5['splice'](_0x2d0c20['order'],0x0,_0x2d0c20);}else _0x16b8a5['push'](_0x2d0c20);return _0x16b8a5;}class r extends _0xe793ad{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5f4312){super(_0x5f4312);const _0x452718=_0x5f4312['config'],_0x239e0a=_0x5f4312['locale'];_0x452718['define']('ai.aiAssistant.preserveComments',!0x0),_0x452718['define']('ai.aiAssistant.commands',function(_0x3d9dd0){return[{'groupId':'editOrReview','groupLabel':i(_0x3d9dd0,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x3d9dd0,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x3d9dd0,'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(_0x3d9dd0,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x3d9dd0,'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(_0x3d9dd0,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x3d9dd0,'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(_0x3d9dd0,'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(_0x3d9dd0,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x3d9dd0,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x3d9dd0,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x3d9dd0,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x3d9dd0,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x3d9dd0,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x3d9dd0,'Change\x20style'),'commands':[{'id':'business','label':i(_0x3d9dd0,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x3d9dd0,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x3d9dd0,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x3d9dd0,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x3d9dd0,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x3d9dd0,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x3d9dd0,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x3d9dd0,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x3d9dd0,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x3d9dd0,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x3d9dd0,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x3d9dd0,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x3d9dd0,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x239e0a)),_0x452718['define']('ai.aiAssistant.extraCommandGroups',[]),_0x452718['define']('ai.aiAssistant.removeCommands',[]);let _0x1da6d7=o(_0x452718['get']('ai.aiAssistant.commands'),_0x239e0a);const _0x4988c8=_0x452718['get']('ai.aiAssistant.extraCommandGroups'),_0x36544d=_0x452718['get']('ai.aiAssistant.removeCommands');_0x4988c8['forEach'](_0x1f227d=>{const _0x17ecf5=_0x1da6d7['find'](_0x648ed3=>_0x648ed3['groupId']===_0x1f227d['groupId']);_0x17ecf5?_0x17ecf5['commands']=_0x17ecf5['commands']['concat'](_0x1f227d['commands']):_0x1da6d7['push'](_0x1f227d);}),_0x1da6d7=_0x1da6d7['filter'](_0x38e08e=>!_0x36544d['includes'](_0x38e08e['groupId'])),_0x1da6d7['forEach'](_0x4d0a58=>{_0x4d0a58['commands']=_0x4d0a58['commands']['filter'](_0x1c2648=>!_0x36544d['includes'](_0x1c2648['id']));}),_0x452718['set']('ai.aiAssistant.commands',_0x1da6d7);}}class P extends _0xe793ad{['abortController'];static get['requires'](){return[E];}constructor(_0x762246){super(_0x762246),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'](_0x2489f5){return this['sendRequest'](_0x2489f5)['catch'](_0x5264e3=>{if(_0x5264e3 instanceof R)return Promise['reject'](_0x5264e3);if('AbortError'==_0x5264e3['name'])return Promise['resolve']();throw console['error'](_0x5264e3),new _0x476136('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1cf2b5,_0x235ce6){const _0x38f98c=this['editor']['locale'],_0x9aa13c={'Content-Type':'application/json'};if('object'==typeof _0x1cf2b5)Object['assign'](_0x9aa13c,_0x1cf2b5);else{if(_0x1cf2b5)try{const _0x48d5af=await _0x1cf2b5(_0x235ce6);Object['assign'](_0x9aa13c,_0x48d5af);}catch{return Promise['reject'](new R(i(_0x38f98c,'AI_ERROR_GET_HEADERS')));}}return _0x9aa13c;}async['_prepareRequestParameters'](_0xce3779,_0x4b25cc){const _0x84da39=this['editor']['locale'];if('object'==typeof _0xce3779)return _0xce3779;try{return await _0xce3779(_0x4b25cc);}catch{return Promise['reject'](new R(i(_0x84da39,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x144408){super(_0x144408),_0x144408['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x144408['config']['get']('ai.openAI.requestParameters')||_0x144408['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x144408['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x144408['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x144408['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x4a00c3,context:_0x2e10d2,onData:_0xd1ba3a,actionId:_0x1be094}){const _0x531cff=this['editor']['locale'],_0x3eeb1c=await this['prepareMessages'](_0x4a00c3,_0x2e10d2,_0x1be094),_0x369369=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1be094),_0x45c3b6=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1be094),_0x3d632d={'messages':_0x3eeb1c,..._0x45c3b6},_0x1dc71a={'method':'POST','headers':_0x369369,'body':JSON['stringify'](_0x3d632d),'signal':this['abortController']['signal']},_0x3544f5=await fetch(this['_apiUrl'],_0x1dc71a);if(_0x3544f5['ok'])return _0x45c3b6['stream']?await this['_readStreamableResponse'](_0x3544f5,_0xd1ba3a):await this['_readStaticResponse'](_0x3544f5,_0xd1ba3a),Promise['resolve']();{const _0x42138c=await _0x3544f5['text']();return _0x42138c['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x531cff,'AI_ERROR_CONTEXT_LENGTH'))):_0x42138c['includes']('Moderation')?Promise['reject'](new R(i(_0x531cff,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x42138c));}}async['prepareMessages'](_0x93611,_0x52bbb0,_0x5a9483){let _0x5df957,_0x42cce6;return _0x52bbb0?(_0x5df957='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.',_0x42cce6='Instruction:\x0a'+_0x93611+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x52bbb0):(_0x5df957='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.',_0x42cce6=_0x93611),[{'role':'system','content':_0x5df957},{'role':'user','content':_0x42cce6}];}async['_readStreamableResponse'](_0x532b97,_0x65abad){const _0x106085=_0x532b97['body']['getReader'](),_0x2142af=new TextDecoder();let _0x5bc5a8='',_0x4bd2ee='',_0x242964='',_0x37f8cb=!0x1;for(;!_0x37f8cb;){const {done:_0x243b6b,value:_0x5a23ee}=await _0x106085['read'](),_0x2486fa=_0x5bc5a8+_0x2142af['decode'](_0x5a23ee);let _0x140a63='';_0x37f8cb=_0x243b6b;try{_0x140a63=this['_cleanUpData'](_0x2486fa),_0x5bc5a8='';}catch{_0x5bc5a8=_0x2486fa;continue;}_0x4bd2ee+=_0x140a63,!_0x37f8cb&&this['_isBufferIncomplete'](_0x4bd2ee)||_0x4bd2ee&&(_0x242964+=_0x4bd2ee,_0x4bd2ee='',_0x65abad(_0x242964));}return Promise['resolve']();}async['_readStaticResponse'](_0x502fce,_0x3871af){return _0x3871af((await _0x502fce['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2f675f){const _0xdc39fd=_0x2f675f['split']('<')['length']!==_0x2f675f['split']('>')['length'],_0x18a72e=_0x2f675f['length']<0x1e;return _0xdc39fd&&_0x18a72e;}['_cleanUpData'](_0x48a24f){return _0x48a24f['split'](/\n(?![^{]*\})/g)['map'](_0x3e69fd=>_0x3e69fd['replace']('data:\x20',''))['filter'](_0x504ae6=>_0x504ae6&&_0x504ae6['length']>0x0&&'[DONE]'!==_0x504ae6)['map'](_0xe7d46e=>{const {choices:_0x4a10f1}=JSON['parse'](_0xe7d46e);if(_0x4a10f1[0x0]?.['delta']?.['content'])return _0x4a10f1[0x0]['delta']['content'];})['filter'](_0x6519ef=>_0x6519ef)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x32d378){super(_0x32d378),_0x32d378['config']['get']('ai.aws.requestParameters')||_0x32d378['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']=_0x32d378['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x32d378['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x32d378['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x32d378['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x35fcca,context:_0x5b1430,onData:_0x5bee38,actionId:_0x57d49b}){const {model:_0x5dfd42,stream:_0x4c1089,..._0x38ce54}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x57d49b),_0x57e964={'prompt':await this['preparePrompt'](_0x35fcca,_0x5b1430,_0x5dfd42,_0x57d49b),..._0x38ce54};this['_apiUrl']?await this['_processProxyRequest'](_0x57e964,_0x5dfd42,_0x4c1089,_0x5bee38,_0x57d49b):await this['_processAWSRequest'](_0x57e964,_0x5dfd42,_0x4c1089,_0x5bee38);}async['preparePrompt'](_0x3c93f6,_0x3c0bd6,_0x50cb39,_0x4f0d15){let _0x3cd74d,_0x538883;return _0x3c0bd6?(_0x3cd74d='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.',_0x538883='Instruction:\x0a'+_0x3c93f6+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3c0bd6):(_0x3cd74d='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.',_0x538883=_0x3c93f6),'meta.llama'==this['getModelFamily'](_0x50cb39)?'<<SYS>>\x0a'+_0x3cd74d+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x538883+'\x0a[/INST]':'Human:\x0a'+_0x3cd74d+'\x0a'+_0x538883+'\x0a\x0aAssistant:';}['getModelFamily'](_0x357272){if(/^anthropic\.claude/['test'](_0x357272))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x357272))return'ai21.j2';if(/^cohere\.command/['test'](_0x357272))return'cohere.command';if(/^meta\.llama/['test'](_0x357272))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x357272));}async['_processProxyRequest'](_0x9e113d,_0x2b7d1e,_0x50c1f9,_0x432e8a,_0x2e540a){const _0x19e5a9={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2e540a),'body':JSON['stringify']({..._0x9e113d,'model':_0x2b7d1e,'stream':_0x50c1f9}),'signal':this['abortController']['signal']},_0x2d6224=await fetch(this['_apiUrl'],_0x19e5a9);_0x50c1f9?await this['_readStreamableResponse'](_0x2d6224,_0x2b7d1e,_0x432e8a):await this['_readStaticResponse'](_0x2d6224,_0x2b7d1e,_0x432e8a);}async['_processAWSRequest'](_0x3c74c4,_0xfbfadf,_0x41d561,_0x139608){const _0x45b32c=new _0x4e8b25(this['_bedrockClientConfig']),_0x40349e={'body':JSON['stringify'](_0x3c74c4),'contentType':'application/json','accept':'application/json','modelId':_0xfbfadf};let _0x1997ec;if(_0x41d561){const _0x3d4a48=new _0x48acd1(_0x40349e);_0x1997ec=await _0x45b32c['send'](_0x3d4a48,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x1997ec,_0xfbfadf,_0x139608);}else{const _0x5564cb=new _0x4052cf(_0x40349e);_0x1997ec=await _0x45b32c['send'](_0x5564cb,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x1997ec,_0xfbfadf,_0x139608);}}async['_readAsyncIterableResponse'](_0x6d166c,_0x13fd3b,_0x533ff1){const _0x24d95c=_0x6d166c['body'],_0x1673d8=new TextDecoder('utf-8');let _0x2c5517='';for await(const _0x394d28 of _0x24d95c)if(_0x394d28['chunk']){const _0x22779e=_0x1673d8['decode'](_0x394d28['chunk']['bytes']),_0x2bca4e=JSON['parse'](_0x22779e);_0x2c5517+=this['_getGeneratedText'](_0x2bca4e,_0x13fd3b),_0x533ff1(_0x2c5517);}return Promise['resolve']();}async['_readStreamableResponse'](_0x5550be,_0x4f36f3,_0x46e9d5){const _0x532f33=_0x5550be['body'],_0x3a71f6=new TextDecoder('utf-8'),_0x3b3352=_0x532f33['getReader']();let _0x13028e='',_0x4b99dd='',_0x43c032=!0x1;for(;!_0x43c032;){const {done:_0x18c731,value:_0x39f72d}=await _0x3b3352['read']();if(_0x43c032=_0x18c731,_0x43c032)break;const _0x599f7f=(_0x13028e+_0x3a71f6['decode'](_0x39f72d))['split']('\x0a')['map'](_0x3a480d=>{try{return _0x13028e='',JSON['parse'](_0x3a480d);}catch{return _0x13028e=_0x3a480d,null;}})['filter'](_0x437b1c=>null!==_0x437b1c);_0x599f7f['length']&&(_0x4b99dd+=_0x599f7f['map'](_0x588c7e=>this['_getGeneratedText'](_0x588c7e,_0x4f36f3))['join'](''),_0x46e9d5(_0x4b99dd));}return Promise['resolve']();}async['_readStaticResponse'](_0xcf5d30,_0x370c19,_0x41e6ed){let _0x210baa;return _0x210baa=_0xcf5d30 instanceof Response?await _0xcf5d30['json']():JSON['parse'](Buffer['from'](_0xcf5d30['body'])['toString']('utf8')),(_0x41e6ed(this['_getGeneratedText'](_0x210baa,_0x370c19)),Promise['resolve']());}['_getGeneratedText'](_0xfea0ac,_0x4b6ea0){switch(this['getModelFamily'](_0x4b6ea0)){case'anthropic.claude':return _0xfea0ac['completion'];case'ai21.j2':return _0xfea0ac['completions'][0x0]['data']['text'];case'cohere.command':return _0xfea0ac['generations'][0x0]['text'];case'meta.llama':return _0xfea0ac['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.5",
3
+ "version": "45.2.0-alpha.6",
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.5",
28
- "@ckeditor/ckeditor5-core": "45.2.0-alpha.5",
29
- "@ckeditor/ckeditor5-engine": "45.2.0-alpha.5",
30
- "@ckeditor/ckeditor5-icons": "45.2.0-alpha.5",
31
- "@ckeditor/ckeditor5-table": "45.2.0-alpha.5",
32
- "@ckeditor/ckeditor5-ui": "45.2.0-alpha.5",
33
- "@ckeditor/ckeditor5-utils": "45.2.0-alpha.5",
34
- "ckeditor5": "45.2.0-alpha.5",
27
+ "@ckeditor/ckeditor5-clipboard": "45.2.0-alpha.6",
28
+ "@ckeditor/ckeditor5-core": "45.2.0-alpha.6",
29
+ "@ckeditor/ckeditor5-engine": "45.2.0-alpha.6",
30
+ "@ckeditor/ckeditor5-icons": "45.2.0-alpha.6",
31
+ "@ckeditor/ckeditor5-table": "45.2.0-alpha.6",
32
+ "@ckeditor/ckeditor5-ui": "45.2.0-alpha.6",
33
+ "@ckeditor/ckeditor5-utils": "45.2.0-alpha.6",
34
+ "ckeditor5": "45.2.0-alpha.6",
35
35
  "es-toolkit": "1.32.0"
36
36
  },
37
37
  "type": "module",