@ckeditor/ckeditor5-ai 44.2.0-alpha.7 → 44.2.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ai.js +1 -1
- package/dist/index.js +2 -2
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +9 -9
- package/src/adapters/aiadapter.js +1 -1
- package/src/adapters/aitextadapter.js +1 -1
- package/src/adapters/awstextadapter.js +1 -1
- package/src/adapters/openaitextadapter.js +1 -1
- package/src/aiassistant.js +1 -1
- package/src/aiassistantediting.js +1 -1
- package/src/aiassistantui.js +1 -1
- package/src/index.js +1 -1
- package/src/legacyerrors.js +1 -1
- package/src/ui/aiassistantcontroller.js +2 -2
- package/src/ui/form/aiformcontentarea.js +1 -1
- package/src/ui/form/aiformerrorview.js +1 -1
- package/src/ui/form/aiformpromptview.js +1 -1
- package/src/ui/form/aiformtoolbarview.js +1 -1
- package/src/ui/form/aiformview.js +1 -1
- package/src/ui/form/aihistorylistitemview.js +1 -1
- package/src/ui/form/aihistorylistview.js +1 -1
- package/src/ui/form/prompthistory.js +1 -1
- package/src/ui/showaiassistantcommand.js +1 -1
- package/src/utils/common-translations.js +1 -1
- package/src/utils/normalizecommandsconfig.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x166283,Command as _0x46d2d6,icons as _0x1a0b68}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x4dbbf6,CKEditorError as _0xa8682e,ObservableMixin as _0x29a6a3,global as _0x2f87f3,isVisible as it,Rect as st,Collection as _0x2fcc60,FocusTracker as _0x57320c,KeystrokeHandler as ts,first as _0x24de88}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x317755,View as _0x51e4fd,SpinnerView as _0x2b7739,IconView as _0xb24c75,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x27b819,ButtonLabelView as te,FocusCycler as _0x138fca,createLabeledTextarea as _0x1188ea,Dialog as _0x4aebcd,createDropdown as _0x334429,addMenuToDropdown as _0x390a9c,MenuBarMenuView as _0x2cf723,MenuBarMenuListItemButtonView as _0x1b137b,DialogViewPosition as _0x55fa78,MenuBarMenuListView as _0x5cdd37,MenuBarMenuListItemView as _0x1226d5}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x1e09e9,ClipboardMarkersUtils as _0x45d88e}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x22c2f0,DataTransfer as _0x39a236,UpcastWriter as _0x31b1eb,Matcher as _0x1f2569}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0xc2d9dc,escape as _0x34c32d}from'lodash-es';import{BedrockRuntimeClient as _0x5df8b5,InvokeModelWithResponseStreamCommand as _0x595d99,InvokeModelCommand as _0x2c86a7}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x562826,_0x464f2a){const _0x46c1db=(0x0,_0x464f2a['t'])('Other');return _0x562826['length']?'groupId'in _0x562826[0x0]?_0x562826:[{'groupId':x,'groupLabel':_0x46c1db,'order':0x1/0x0,'commands':_0x562826}]:[{'groupId':x,'groupLabel':_0x46c1db,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x166283{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x9b1dee}=this,_0x34fe39=['ck-fake-ai-selection'];_0x9b1dee['config']['get']('ai.useTheme')&&_0x34fe39['push']('ck-ai-assistant-ui_theme'),_0x9b1dee['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x34fe39,'priority':0xc}}),_0x9b1dee['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x29c1ae,{writer:_0x5a99ba})=>{if(!_0x29c1ae['markerRange']['isCollapsed'])return null;const _0x2caec5=_0x5a99ba['createUIElement']('span');return _0x5a99ba['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x2caec5),_0x2caec5;}});}['afterInit'](){!async function(_0x54e501){const _0x154224=_0x2ab031([0x30,0x34,0x39,0x47,0x75,0x38,0x77,0x57,0x58,0x71,0x54,0x6e,0x6a,0x59,0x52,0x4f,0x31,0x6b,0x41,0x4b,0x5a,0x67,0x55,0x6d,0x36,0x73,0x7a,0x76,0x50,0x42,0x4a,0x6c,0x49,0x37,0x43,0x74,0x66,0x56,0x62,0x4d,0x79,0x35,0x51,0x45,0x32,0x64,0x65,0x4c,0x33,0x78,0x53,0x69,0x70,0x48,0x72,0x44,0x6f,0x46,0x4e,0x63,0x61,0x68]),_0x546b28=0x6243817c,_0x3519b8=0x6244dff4^_0x546b28,_0x98c8cb=window[_0x2ab031([0x44,0x61,0x74,0x65])][_0x2ab031([0x6e,0x6f,0x77])](),_0xa19a0e=_0x54e501[_0x2ab031([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x21a6be=new window[(_0x2ab031([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x29350b=>{_0xa19a0e[_0x2ab031([0x6f,0x6e,0x63,0x65])](_0x2ab031([0x72,0x65,0x61,0x64,0x79]),_0x29350b);}),_0x445c6c={[_0x2ab031([0x6b,0x74,0x79])]:_0x2ab031([0x45,0x43]),[_0x2ab031([0x75,0x73,0x65])]:_0x2ab031([0x73,0x69,0x67]),[_0x2ab031([0x63,0x72,0x76])]:_0x2ab031([0x50,0x2d,0x32,0x35,0x36]),[_0x2ab031([0x78])]:_0x2ab031([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]),[_0x2ab031([0x79])]:_0x2ab031([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]),[_0x2ab031([0x61,0x6c,0x67])]:_0x2ab031([0x45,0x53,0x32,0x35,0x36])},_0x5cfa3b=_0xa19a0e[_0x2ab031([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2ab031([0x67,0x65,0x74])](_0x2ab031([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x38eea5(){let _0x34e106,_0x54ec0c=null,_0x309591=null;try{if(_0x5cfa3b==_0x2ab031([0x47,0x50,0x4c]))return _0x2ab031([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x34e106=_0x3e03fe(),!_0x34e106)return _0x2ab031([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x34e106[_0x2ab031([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x309591=_0x1c89cf(_0x34e106[_0x2ab031([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x34e106[_0x2ab031([0x6a,0x74,0x69])])),await _0x2814e2()?_0x467dc0()?_0x5059da()?_0x2ab031([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2e31b9()?(_0x34e106[_0x2ab031([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2ab031([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x54ec0c=_0x5de118(_0x2ab031([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x34e106[_0x2ab031([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2ab031([0x74,0x72,0x69,0x61,0x6c])&&(_0x54ec0c=_0x5de118(_0x2ab031([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x414c87()):_0x2ab031([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2ab031([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2ab031([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x3a9dcf){return _0x2ab031([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5059da(){const _0x4e210e=[_0x2ab031([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2ab031([0x74,0x72,0x69,0x61,0x6c])][_0x2ab031([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x34e106[_0x2ab031([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x98c8cb/0x3e8:0xe10*_0x3519b8;return _0x34e106[_0x2ab031([0x65,0x78,0x70])]<_0x4e210e;}function _0x467dc0(){const _0x3c5203=_0x34e106[_0x2ab031([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3c5203&&(!!_0x3c5203[_0x2ab031([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2ab031([0x2a]))||!!_0x3c5203[_0x2ab031([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2ab031([0x41,0x49])));}function _0x2e31b9(){const _0x245639=_0x34e106[_0x2ab031([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x245639||0x0==_0x245639[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x413885}=new URL(window[_0x2ab031([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x245639[_0x2ab031([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x413885))return!0x0;const _0x4f5363=_0x413885[_0x2ab031([0x73,0x70,0x6c,0x69,0x74])](_0x2ab031([0x2e]));return _0x245639[_0x2ab031([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2740dd=>_0x2740dd[_0x2ab031([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2ab031([0x2a])))[_0x2ab031([0x6d,0x61,0x70])](_0x59a718=>_0x59a718[_0x2ab031([0x73,0x70,0x6c,0x69,0x74])](_0x2ab031([0x2e])))[_0x2ab031([0x73,0x6f,0x6d,0x65])](_0x58d9f9=>_0x4f5363[_0x2ab031([0x65,0x76,0x65,0x72,0x79])]((_0x5d9355,_0x3212e2)=>_0x58d9f9[_0x3212e2]===_0x5d9355||_0x58d9f9[_0x3212e2]===_0x2ab031([0x2a])));}function _0x414c87(){return _0x54ec0c&&_0x309591?new window[(_0x2ab031([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1d192b,_0x2f8633)=>{_0x54ec0c[_0x2ab031([0x74,0x68,0x65,0x6e])](_0x1d192b,_0x2f8633),_0x309591[_0x2ab031([0x74,0x68,0x65,0x6e])](_0x7d58c8=>{_0x7d58c8!=_0x2ab031([0x56,0x61,0x6c,0x69,0x64])&&_0x1d192b(_0x7d58c8);},_0x2f8633);}):_0x54ec0c||_0x309591||_0x2ab031([0x56,0x61,0x6c,0x69,0x64]);}}function _0x1c89cf(_0x229e44,_0x3b5a44){return new window[(_0x2ab031([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x39f990=>{if(_0x264ac7())return _0x39f990(_0x2ab031([0x56,0x61,0x6c,0x69,0x64]));_0x8c4be6(),_0xa19a0e[_0x2ab031([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2ab031([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1c0c3a=!0x1;const _0x337db6=_0x4dbbf6();function _0x559ab5(_0x3b13e7){return!!_0x3b13e7&&(typeof _0x3b13e7===_0x2ab031([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3b13e7===_0x2ab031([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3b13e7[_0x2ab031([0x74,0x68,0x65,0x6e])]===_0x2ab031([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3b13e7[_0x2ab031([0x63,0x61,0x74,0x63,0x68])]===_0x2ab031([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x3fb6ae(_0x1cac58){_0x2b0da5(_0x1cac58)[_0x2ab031([0x74,0x68,0x65,0x6e])](_0x1f8b8e=>{if(!_0x1f8b8e||_0x1f8b8e[_0x2ab031([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2ab031([0x6f,0x6b]))return _0x2ab031([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x46a16b(_0x591451(_0x337db6+_0x3b5a44))!=_0x1f8b8e[_0x2ab031([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2ab031([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2ab031([0x56,0x61,0x6c,0x69,0x64]);})[_0x2ab031([0x74,0x68,0x65,0x6e])](_0x16c4d0=>(_0x1613d5(),_0x16c4d0),()=>{const _0x5a052a=_0x892bb();return null==_0x5a052a?(_0x1613d5(),_0x2ab031([0x56,0x61,0x6c,0x69,0x64])):_0x2ab031(_0x98c8cb-_0x5a052a>(0x464f057c^_0x546b28)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2ab031([0x74,0x68,0x65,0x6e])](_0x39f990)[_0x2ab031([0x63,0x61,0x74,0x63,0x68])](()=>{_0x39f990(_0x2ab031([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xf85970=0x62756ffc^_0x546b28;function _0x1613d5(){const _0x22dea7=_0x2ab031([0x6c,0x6c,0x63,0x74,0x2d])+_0x46a16b(_0x591451(_0x229e44)),_0x3c1134=_0x3b3826(_0x46a16b(window[_0x2ab031([0x4d,0x61,0x74,0x68])][_0x2ab031([0x63,0x65,0x69,0x6c])](_0x98c8cb/_0xf85970)));window[_0x2ab031([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2ab031([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x22dea7,_0x3c1134);}function _0x892bb(){const _0x3cc4b9=_0x2ab031([0x6c,0x6c,0x63,0x74,0x2d])+_0x46a16b(_0x591451(_0x229e44)),_0x194f81=window[_0x2ab031([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2ab031([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3cc4b9);return _0x194f81?window[_0x2ab031([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3b3826(_0x194f81),0x10)*_0xf85970:null;}function _0x2b0da5(_0x115332){return new window[(_0x2ab031([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4a0e8e,_0x2ce5e1)=>{_0x115332[_0x2ab031([0x74,0x68,0x65,0x6e])](_0x4a0e8e,_0x2ce5e1),window[_0x2ab031([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x2ce5e1,0x624255bc^_0x546b28);});}}_0xa19a0e[_0x2ab031([0x6f,0x6e])](_0x2ab031([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x37ddf1,_0x4a5e10)=>{if(_0x4a5e10[0x0]!=_0x229e44)return _0x39f990(_0x2ab031([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x4a5e10[0x1]={..._0x4a5e10[0x1],[_0x2ab031([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x337db6};},{[_0x2ab031([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2ab031([0x68,0x69,0x67,0x68])}),_0xa19a0e[_0x2ab031([0x6f,0x6e])](_0x2ab031([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x556256=>{_0x559ab5(_0x556256[_0x2ab031([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1c0c3a=!0x0,_0x3fb6ae(_0x556256[_0x2ab031([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2ab031([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2ab031([0x6c,0x6f,0x77])}),_0x21a6be[_0x2ab031([0x74,0x68,0x65,0x6e])](()=>{_0x1c0c3a||_0x39f990(_0x2ab031([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x264ac7(){return _0xa19a0e[_0x2ab031([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2ab031([0x76,0x69,0x65,0x77])][_0x2ab031([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2ab031([0x61,0x75,0x74,0x6f]);}function _0x8c4be6(){_0xa19a0e[_0x2ab031([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2ab031([0x76,0x69,0x65,0x77])][_0x2ab031([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2ab031([0x61,0x75,0x74,0x6f]);}}function _0x5de118(_0x281a7d){const _0x3e8922=[new window[(_0x2ab031([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2d9e1d=>setTimeout(_0x2d9e1d,0x624abfb0^_0x546b28)),_0x21a6be[_0x2ab031([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2ab031([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x38fd73=>{let _0x38314e=0x0;_0xa19a0e[_0x2ab031([0x6d,0x6f,0x64,0x65,0x6c])][_0x2ab031([0x6f,0x6e])](_0x2ab031([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x12c5b2,_0x30a505)=>{_0x30a505[0x0][_0x2ab031([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x38314e++,_0x38314e==(0x62438084^_0x546b28)&&(_0x38fd73(),_0x12c5b2[_0x2ab031([0x6f,0x66,0x66])]());});}))];return window[_0x2ab031([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2ab031([0x72,0x61,0x63,0x65])](_0x3e8922)[_0x2ab031([0x74,0x68,0x65,0x6e])](()=>_0x281a7d);}async function _0x1b2ee0(){await _0x21a6be,_0xa19a0e[_0x2ab031([0x6d,0x6f,0x64,0x65,0x6c])][_0x2ab031([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x10659f,_0xa19a0e[_0x2ab031([0x6d,0x6f,0x64,0x65,0x6c])][_0x2ab031([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x10659f,_0xa19a0e[_0x2ab031([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2ab031([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x82d8dc(_0x783b09){const _0xac2ed0=_0x57f63b();_0xa19a0e[_0xac2ed0]=_0x2ab031([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x783b09,_0x783b09!=_0x2ab031([0x56,0x61,0x6c,0x69,0x64])&&_0x1b2ee0();}function _0x57f63b(){const _0x552990=window[_0x2ab031([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2ab031([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2ab031([0x6e,0x6f,0x77])]())[_0x2ab031([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2ab031([0x2e]),'');let _0x126d91=_0x2ab031([0x47]);for(let _0x162caa=0x0;_0x162caa<_0x552990[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x162caa+=0x2){let _0x28298f=window[_0x2ab031([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x552990[_0x2ab031([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x162caa,_0x162caa+0x2));_0x28298f>=_0x154224[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x28298f-=_0x154224[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x126d91+=_0x154224[_0x28298f];}return _0x126d91;}function _0x3e03fe(){const _0xb08fb8=_0x5cfa3b[_0x2ab031([0x73,0x70,0x6c,0x69,0x74])](_0x2ab031([0x2e]));if(0x3!=_0xb08fb8[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4848de(_0xb08fb8[0x1]);function _0x4848de(_0x56a56d){const _0x3f3f58=_0xf5c5d9(_0x56a56d);return _0x3f3f58&&_0x2928a7()?_0x3f3f58:null;function _0x2928a7(){const _0x48db44=_0x3f3f58[_0x2ab031([0x6a,0x74,0x69])],_0x259874=window[_0x2ab031([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x48db44[_0x2ab031([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x48db44[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3761eb={..._0x3f3f58,[_0x2ab031([0x6a,0x74,0x69])]:_0x48db44[_0x2ab031([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x48db44[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3761eb[_0x2ab031([0x76,0x63])],_0x591451(_0x3761eb)==_0x259874;}}}async function _0x2814e2(){let _0x4a2ac0=!0x0;try{const _0x36242e=_0x5cfa3b[_0x2ab031([0x73,0x70,0x6c,0x69,0x74])](_0x2ab031([0x2e])),[_0x110bfe,_0x15d35c,_0xf87d73]=_0x36242e;return _0x1c08b3(_0x110bfe),await _0x3f510e(_0x110bfe,_0x15d35c,_0xf87d73),_0x4a2ac0;}catch(_0x12d071){return!0x1;}function _0x1c08b3(_0x43476a){const _0x190ba3=_0xf5c5d9(_0x43476a);_0x190ba3&&_0x190ba3[_0x2ab031([0x61,0x6c,0x67])]==_0x2ab031([0x45,0x53,0x32,0x35,0x36])||(_0x4a2ac0=!0x1);}async function _0x3f510e(_0x15d84d,_0x15f5ca,_0x43c9f6){const _0x212b94=window[_0x2ab031([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2ab031([0x66,0x72,0x6f,0x6d])](_0xb03470(_0x43c9f6),_0x5da465=>_0x5da465[_0x2ab031([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0xe0e155=new window[(_0x2ab031([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2ab031([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x15d84d+_0x2ab031([0x2e])+_0x15f5ca),_0x16851e=window[_0x2ab031([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2ab031([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x16851e)return;const _0xf999df=await _0x16851e[_0x2ab031([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2ab031([0x6a,0x77,0x6b]),_0x445c6c,{[_0x2ab031([0x6e,0x61,0x6d,0x65])]:_0x2ab031([0x45,0x43,0x44,0x53,0x41]),[_0x2ab031([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2ab031([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2ab031([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x16851e[_0x2ab031([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2ab031([0x6e,0x61,0x6d,0x65])]:_0x2ab031([0x45,0x43,0x44,0x53,0x41]),[_0x2ab031([0x68,0x61,0x73,0x68])]:{[_0x2ab031([0x6e,0x61,0x6d,0x65])]:_0x2ab031([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0xf999df,_0x212b94,_0xe0e155)||(_0x4a2ac0=!0x1);}}function _0xf5c5d9(_0x2bb110){return _0x2bb110[_0x2ab031([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2ab031([0x65,0x79]))?JSON[_0x2ab031([0x70,0x61,0x72,0x73,0x65])](_0xb03470(_0x2bb110)):null;}function _0xb03470(_0x4ea44a){return window[_0x2ab031([0x61,0x74,0x6f,0x62])](_0x4ea44a[_0x2ab031([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2ab031([0x2b]))[_0x2ab031([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2ab031([0x2f])));}function _0x591451(_0x2a1201){let _0x14a69f=0x1505;function _0x3b4124(_0x1b7852){for(let _0x104da1=0x0;_0x104da1<_0x1b7852[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x104da1++){const _0x3d650d=_0x1b7852[_0x2ab031([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x104da1);_0x14a69f=(_0x14a69f<<0x5)+_0x14a69f+_0x3d650d,_0x14a69f&=_0x14a69f;}}function _0x40a339(_0x872766){Array[_0x2ab031([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x872766)?_0x872766[_0x2ab031([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x40a339):_0x872766&&typeof _0x872766==_0x2ab031([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2ab031([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x872766)[_0x2ab031([0x73,0x6f,0x72,0x74])]()[_0x2ab031([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1d6152,_0x3bbd97])=>{_0x3b4124(_0x1d6152),_0x40a339(_0x3bbd97);}):_0x3b4124(window[_0x2ab031([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x872766));}return _0x40a339(_0x2a1201),_0x14a69f>>>0x0;}function _0x46a16b(_0x153407){return _0x153407[_0x2ab031([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2ab031([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2ab031([0x30]));}function _0x3b3826(_0x4c6feb){return _0x4c6feb[_0x2ab031([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2ab031([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2ab031([0x6a,0x6f,0x69,0x6e])]('');}function _0x10659f(){}function _0x2ab031(_0x566a08){return _0x566a08['map'](_0x2edf98=>String['fromCharCode'](_0x2edf98))['join']('');}_0x82d8dc(await _0x38eea5());}(this);}['showFakeVisualSelection'](){const _0x34aaf6=this['editor']['model'];_0x34aaf6['change'](_0x39c0d9=>{const _0x500d74=_0x34aaf6['document']['selection']['getRanges']();let _0x1ec854=0x0;for(const _0x443559 of _0x500d74){const _0x386e24=f+':'+_0x1ec854;if(_0x34aaf6['markers']['has'](_0x386e24))_0x39c0d9['updateMarker'](_0x386e24,{'range':_0x443559});else{if(_0x443559['start']['isAtEnd']){const _0x2f4bd2=_0x443559['start']['getLastMatchingPosition'](({item:_0x2be8fd})=>!_0x34aaf6['schema']['isContent'](_0x2be8fd),{'boundaries':_0x443559});_0x39c0d9['addMarker'](_0x386e24,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x39c0d9['createRange'](_0x2f4bd2,_0x443559['end'])});}else _0x39c0d9['addMarker'](_0x386e24,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x443559});}_0x1ec854++;}});}['hideFakeVisualSelection'](){const _0x349aca=this['editor']['model'],_0x14bb0d=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x14bb0d['length']&&_0x349aca['change'](_0x26ed6a=>{_0x14bb0d['forEach'](_0x5ba370=>{_0x26ed6a['removeMarker'](_0x5ba370);});});}['insertContent'](_0x5564f9,_0x4f14e1){const _0x1c5b64=this['_getAISelection'](),_0xb4f620=_0x4f14e1||_0x1c5b64['getFirstRange']();this['editor']['model']['canEditAt'](_0xb4f620)&&this['editor']['model']['change'](_0x1d10c5=>{this['hideFakeVisualSelection'](),_0x4f14e1||this['_resetContentOfSelectedTableCells'](_0x1d10c5,_0x1c5b64),this['_pasteHTMLUsingClipboard']({'insertAt':_0xb4f620,'writer':_0x1d10c5,'html':_0x5564f9});});}['insertContentBelow'](_0x10d382){const {model:_0x57ad1b}=this['editor'],_0x44a772=this['_getAISelection']();_0x57ad1b['change'](()=>{const _0x3d0c1d=this['_prepareTableInsertBelowPosition'](_0x10d382,_0x44a772)||this['_getDefaultInsertBelowPosition'](_0x44a772);this['insertContent'](_0x10d382,_0x3d0c1d);});}['_getAISelection'](){const _0xde2daa=this['editor']['model'],_0x36e042=Array['from'](_0xde2daa['markers']['getMarkersGroup'](f))['map'](_0x1af566=>_0x1af566['getRange']());return _0xde2daa['createSelection'](_0x36e042);}['_pasteHTMLUsingClipboard']({writer:_0x2739dd,html:_0x571568,insertAt:_0x3bb5be}){const {view:_0x5752fe}=this['editor']['editing'],_0x267617=this['editor']['plugins']['get'](_0x1e09e9),_0x18cfdb=new dt();_0x18cfdb['setData']('text/html',_0x571568);const _0x4a23d3=new ClipboardEvent('paste',{'clipboardData':_0x18cfdb}),_0x37fc54=new _0x22c2f0(_0x5752fe,_0x4a23d3,{'dataTransfer':new _0x39a236(_0x18cfdb)});_0x2739dd['setSelection'](_0x3bb5be);const _0x246fac=(_0x430cc4,_0x12ba37)=>{_0x12ba37['resultRange']&&_0x2739dd['setSelection'](_0x12ba37['resultRange']);};_0x267617['once']('contentInsertion',_0x246fac,{'priority':'lowest'}),_0x5752fe['document']['fire']('paste',_0x37fc54),_0x267617['off']('contentInsertion',_0x246fac);}['_getDefaultInsertBelowPosition'](_0x51ddfc){const {model:_0xd8cfa5}=this['editor'],_0x4da5ba=Array['from'](_0x51ddfc['getSelectedBlocks']());return _0x4da5ba['length']?_0xd8cfa5['createPositionAfter'](_0x4da5ba['pop']()):_0x51ddfc['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x49bb72,_0x4a8cc4){const {model:_0x18d7b3,plugins:_0x41e924}=this['editor'];if(_0x41e924['has']('TableUtils')){const _0x37a21=_0x41e924['get']('TableUtils')['getSelectedTableCells'](_0x4a8cc4);if(_0x37a21['length']){const _0x1ec5c6=this['_getTableRowCountFromContent'](_0x49bb72),_0x106b83=this['_createEmptyTableRows'](_0x37a21,_0x1ec5c6);return _0x18d7b3['createPositionAt'](_0x106b83,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3a27ad){const _0x49d405=this['editor']['plugins']['get']('TableUtils'),_0x3c6a82=this['editor']['data']['parse'](_0x3a27ad),_0x1289ef=Array['from'](_0x3c6a82['getChildren']())['filter'](_0x2ed58d=>_0x2ed58d['is']('element','table'));let _0x16a1ac=0x0;return _0x1289ef['forEach'](_0x11dc7b=>{_0x16a1ac+=_0x49d405['getRows'](_0x11dc7b);}),_0x16a1ac;}['_createEmptyTableRows'](_0x3bd459,_0x3232b4){const _0x35d065=this['editor']['plugins']['get']('TableUtils'),_0x3e1c93=_0x35d065['getRowIndexes'](_0x3bd459),_0x4e3338=_0x35d065['getColumnIndexes'](_0x3bd459),_0x415535=_0x3e1c93['last']+0x1,_0x9e0e54=_0x4e3338['first'],_0x1d5e12=_0x3bd459[0x0]['findAncestor']('table');for(let _0x3ee06b=0x0;_0x3ee06b<_0x3232b4;_0x3ee06b++)_0x35d065['insertRows'](_0x1d5e12,{'at':_0x415535});return _0x1d5e12['getChild'](_0x415535)['getChild'](_0x9e0e54);}['_resetContentOfSelectedTableCells'](_0xf77bd8,_0x32b8fc){const {plugins:_0x3eecae}=this['editor'],{model:_0x3f36ee}=_0xf77bd8;if(!_0x3eecae['has']('TableUtils'))return;_0x3eecae['get']('TableUtils')['getSelectedTableCells'](_0x32b8fc)['length']&&_0x3f36ee['deleteContent'](_0x32b8fc);}}class K extends _0x166283{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0xa8682e('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x5cfc89){super(_0x5cfc89),this['name']='AIRequestError';}}function i(_0x2d5955,_0x2d8447,_0x5e734c){const t=_0x2d5955['t'];switch(_0x2d8447){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',_0x5e734c);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5e734c);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'},_0x5e734c);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 _0x2d8447;}}class E extends _0x46d2d6{['_commandDefinitions'];constructor(_0x526af2,_0x509810){super(_0x526af2),this['_commandDefinitions']=_0x509810,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x4406a5,_0x5b7f0a,_0x140993)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x140993));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x24d317,_0x2a748a,_0x172602)=>{this['enabledCommandsIds']=_0x172602?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2d1e46=this['editor']['model'];this['_hasContext']=function(_0x5d919e){const _0x9344c5=_0x5d919e['document']['selection'];return _0x9344c5['isCollapsed']?0x0!==[..._0x9344c5['getSelectedBlocks']()]['length']&&![..._0x9344c5['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x5d919e['hasContent'](_0x9344c5['getFirstRange']());}(_0x2d1e46);const _0x5b53fe=_0x2d1e46['document']['selection'],_0x15bd5a=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x3f9b93 of _0x5b53fe['getRanges']())for(const _0x1234cf of _0x3f9b93['getItems']())if(_0x1234cf['is']('element')&&_0x15bd5a['includes'](_0x1234cf['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x49fc81='',_0x1f432f='',_0x50e1ee='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x49fc81,_0x1f432f,_0x50e1ee);}}function G(_0x22cc80,_0x3f3338){const _0x5a26a9=new Set();for(const _0x4cd426 of _0x22cc80['values']())(_0x3f3338||!0x1===_0x4cd426['requiresContent'])&&_0x5a26a9['add'](_0x4cd426['id']);return Array['from'](_0x5a26a9);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x29a6a3(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x37966f,_0x220c52,_0x5eea76){super(),this['editor']=_0x37966f,this['textAdapter']=_0x220c52,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x5eea76,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x514ce9,_0x1663c0,_0x1e3064)=>{this['view']['value']=this['_sanitizeHTML'](_0x1e3064);}),this['listenTo'](this['view'],'submitPrompt',(_0x1f4f32,_0x19a203)=>{const _0x42076b=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x19a203,_0x42076b,'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:_0x141389,query:_0x2f473c,htmlContent:_0x572e4d,label:_0x1e0a18,mainActionLabel:_0x3c0b60}){this['view']['prompt']=_0x1e0a18,this['view']['mainAction']=_0x3c0b60,this['initialContext']=_0x572e4d,_0x2f473c&&(this['view']['isRendered']?this['_handleQuery'](_0x2f473c,_0x572e4d,_0x141389,_0x1e0a18):this['view']['once']('render',()=>{this['_handleQuery'](_0x2f473c,_0x572e4d,_0x141389,_0x1e0a18);}));}['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'](_0x2e3e39,_0x2e90a2,_0x356db2,_0x190750){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2e90a2,this['previousQuery']=_0x2e3e39,this['previousLabel']=_0x190750||_0x2e3e39,this['previousActionId']=_0x356db2,new Promise(_0x2182e2=>{this['textAdapter']['makeRequest']({'query':_0x2e3e39,'context':_0x2e90a2,'onData':_0x2a57ce=>{this['currentResponse']=_0x2a57ce,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x356db2})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x369c7f=>{_0x369c7f instanceof R?this['view']['handleError'](_0x369c7f['message']):this['view']['handleError'](),_0x2182e2();})['finally'](()=>{this['stopProcessing'](),_0x2182e2();});});}['_parseAndNormalizeContent'](_0x483e5e,_0x5d6eb7=!0x1){const _0x246ffa=Z['exec'](_0x483e5e);_0x483e5e=_0x246ffa?_0x483e5e['substring'](_0x246ffa[0x1]['length']):_0x483e5e['length']<0x64&&!_0x5d6eb7?'':this['_stripMarkdownSyntax'](_0x483e5e);const _0x2993a1=this['_domParser']['parseFromString'](_0x483e5e,'text/html');if(_0x246ffa){const _0xe1b491=Array['from'](_0x2993a1['body']['childNodes']);_0xe1b491['reverse']();for(const _0x3975c7 of _0xe1b491){if(_0x3975c7['nodeType']==Node['ELEMENT_NODE'])break;_0x3975c7['remove']();}}const _0x179306=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2993a1['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x179306);const _0x3a462a=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x4bc3f6=this['editor']['data']['toModel'](_0x179306);return _0x3a462a||_0x4bc3f6['markers']['clear'](),this['editor']['data']['stringify'](_0x4bc3f6);}['_normalizeResponseHeadings'](_0x152935){const _0x738ec1=new _0x31b1eb(this['editor']['editing']['view']['document']),_0x125df8=new _0x1f2569({'name':/^h[1-5]$/}),_0x2c9803=[];let _0x1c8a81=!0x1;for(const _0x238b68 of _0x152935)_0x238b68['is']('element')&&_0x125df8['match'](_0x238b68)&&(_0x2c9803['push'](_0x238b68),'h1'==_0x238b68['name']&&(_0x1c8a81=!0x0));if(_0x1c8a81){for(const _0x28f0ff of _0x2c9803)_0x738ec1['rename']('h'+(parseInt(_0x28f0ff['name'][0x1])+0x1),_0x28f0ff);}}['_isH1TagSupportEnabled'](){const {data:_0x1cc7ab,editing:_0x8c426e}=this['editor'],_0x2d6212=_0x1cc7ab['htmlProcessor']['toView']('<h1></h1>'),_0x3a6df0=_0x1cc7ab['toView'](_0x1cc7ab['toModel'](_0x2d6212));return!!_0x8c426e['view']['domConverter']['viewToDom'](_0x3a6df0)['querySelector']('h1');}['_sanitizeHTML'](_0x315f0a){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x315f0a),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x52ea39){const _0x1a6065=_0x52ea39['trim']();return _0x1a6065['startsWith']('```html')?_0x1a6065['endsWith']('```')?_0x1a6065['substring'](0x7,_0x1a6065['length']-0x3):_0x1a6065['substring'](0x7):_0x52ea39;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x69d2ff){super(_0x69d2ff),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x455e10=>i(_0x69d2ff,'AI_'+_0x455e10['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x69d2ff,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x69d2ff,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x69d2ff,'Stop'));const _0xf2b601=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xf2b601['if']('isVisible','ck-hidden',_0x565790=>!_0x565790)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x4f71e0,_0x278eab){const _0x3e6cf3=new _0x317755(this['locale']);return _0x3e6cf3['set']({'label':_0x4f71e0,'class':_0x278eab||'','isVisible':!0x0,'withText':!0x0}),_0x3e6cf3;}}var W='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class X extends _0x51e4fd{['contentFieldView'];['copyButtonView'];constructor(_0x3b53da,_0x2d78b3=''){super(_0x3b53da),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0xef705f=this['bindTemplate'];this['contentFieldView']=new mt(_0x3b53da,_0x2d78b3),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0xef705f['if']('isVisible','ck-hidden',_0x492c05=>!_0x492c05)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0xef705f['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 _0x43bed7=!0x1;this['on']('change:value',(_0xa3b2b9,_0x1d7e62,_0x23b80c)=>{const _0x1806a3=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x23b80c),this['isProcessing']&&_0x1806a3&&!_0x43bed7&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0xe46235,_0x3a5558,_0x12df98)=>{_0x43bed7=!0x1,_0x12df98?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x43bed7=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x43bed7=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1078e5=this['locale'],_0x4a8bd9=new _0x317755(this['locale']),_0x4f41d0='ck-ai-form__copy-button';return _0x4a8bd9['set']({'label':i(_0x1078e5,'Copy'),'icon':W,'class':_0x4f41d0,'tooltip':!0x0}),_0x4a8bd9['bind']('isVisible')['to'](this,'value',_0x2743bc=>!!_0x2743bc),_0x4a8bd9['bind']('isEnabled')['to'](this,'isProcessing',_0x49da1d=>!_0x49da1d),_0x4a8bd9['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4a8bd9['icon']=_0x1a0b68['check'],_0x4a8bd9['class']=_0x4f41d0+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4a8bd9['icon']=W,_0x4a8bd9['class']=_0x4f41d0;},0x3e8);}),_0x4a8bd9;}['_copyHTMLToClipboard'](_0x2f3ee3){const {window:_0x1b8de9,document:_0x22c83b}=_0x2f87f3;if(_0x1b8de9['ClipboardItem']){const {Blob:_0x5adac4,ClipboardItem:_0x1ea8e9}=_0x1b8de9,_0x556fdb=[new _0x1ea8e9({'text/html':new _0x5adac4([_0x2f3ee3['innerHTML']],{'type':'text/html'}),'text/plain':new _0x5adac4([_0x2f3ee3['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x556fdb);}else{const _0x23b17c=_0x22c83b['createElement']('div');_0x23b17c['style']['position']='absolute',_0x23b17c['style']['left']='-9999px',_0x23b17c['innerHTML']='<span>[</span>'+_0x2f3ee3['innerHTML']+'<span>]</span>',_0x22c83b['body']['appendChild'](_0x23b17c);const _0x5f252c=_0x22c83b['createRange']();_0x5f252c['setStartAfter'](_0x23b17c['firstElementChild']),_0x5f252c['setEndBefore'](_0x23b17c['lastElementChild']);const _0x5d7ddc=_0x1b8de9['getSelection']();_0x5d7ddc['removeAllRanges'](),_0x5d7ddc['addRange'](_0x5f252c),_0x22c83b['execCommand']('copy'),_0x23b17c['remove']();}}}class mt extends _0x51e4fd{constructor(_0x16d5c1,_0x267f7c=''){super(_0x16d5c1),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x267f7c,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1a425c){this['element']['innerHTML']=_0x1a425c;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x2bd2e3=new _0x51e4fd(),_0x5212f4=this['locale'],_0x15f118=new _0x2b7739();return _0x15f118['isVisible']=!0x0,_0x2bd2e3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x15f118,{'text':i(_0x5212f4,'AI\x20is\x20writing...')}]}),_0x2bd2e3['render'](),_0x2bd2e3;}}class rt extends _0x51e4fd{constructor(_0x177c3f,_0x4c5a01=''){super(_0x177c3f);const _0x27b798=new _0xb24c75(),_0x27ef8e=this['bindTemplate'];this['set']('text',_0x4c5a01),_0x27b798['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x27b798,{'text':_0x27ef8e['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4e9ad3,_0xa3ae27){super(_0x4e9ad3,_0xa3ae27),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',(_0xd8f13b,_0x3cabb7)=>{_0xd8f13b['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3cabb7());});}['_createSubmitButton'](){const _0x1e89cc=new _0x317755(this['locale']),_0x4283f9=this['locale'];return _0x1e89cc['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x4283f9,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1e89cc['on']('execute',()=>{this['submit']();}),_0x1e89cc['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3493b3,_0x513445)=>!_0x3493b3&&_0x513445),_0x1e89cc;}['_createShowHistoryButton'](){const _0x3d0cb1=new _0x317755(this['locale']),_0x526113=this['resultsView'],_0x1626d2=this['locale'];_0x3d0cb1['set']({'label':i(_0x1626d2,'History'),'withText':!0x1,'icon':_0x1a0b68['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3d0cb1['bind']('isOn')['to'](_0x526113,'isVisible'),_0x3d0cb1['bind']('isEnabled')['to'](this,'isEnabled'),_0x3d0cb1['on']('execute',()=>{_0x526113['isVisible']=!_0x526113['isVisible'],_0x526113['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1bcf4a=()=>{_0x2f87f3['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x24d824=new st(this['queryView']['fieldView']['element']),_0x23f5a1=_0x24d824['width'],_0x19f0b6='rtl'===_0x1626d2['uiLanguageDirection']?'left':'right';_0x24d824['excludeScrollbarsAndBorders'](),_0x3d0cb1['element']['style'][_0x19f0b6]=_0x23f5a1-_0x24d824['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1bcf4a),this['on']('render',_0x1bcf4a),_0x3d0cb1;}['submit'](){const _0x5852ff=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x5852ff);}['focus'](_0x4a706e){-0x1===_0x4a706e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x17c6d8){super(_0x17c6d8),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x17c6d8,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x45183f=0x0;for(const _0xb021d0 of this['items'])_0x45183f+=_0xb021d0['items']['length'];return{'resultsCount':_0x45183f,'totalItemsCount':_0x45183f};}['_createClearHistoryButton'](){const _0x2db0c0=this['locale'],_0x12aa58=new _0x317755(this['locale']);return _0x12aa58['set']({'label':'('+i(_0x2db0c0,'Clear')+')','withText':!0x0}),_0x12aa58['on']('execute',()=>this['fire']('clearHistory')),_0x12aa58;}}class hs extends _0x27b819{constructor(_0x45f791){super();const _0x370e36=new te(),_0x35d16e=new _0x317755(this['locale'],_0x370e36);this['children']['add'](_0x35d16e),_0x35d16e['set']({'label':_0x45f791['prompt'],'withText':!0x0}),_0x35d16e['on']('execute',()=>{this['fire']('execute',{'value':_0xc2d9dc(_0x45f791['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x2fcc60{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x38892a,_0x4e98db)=>{const _0x326b81=Ss(_0x4e98db['prompt']);for(const _0x4d342d of this)if(_0x4d342d!=_0x4e98db&&Ss(_0x4d342d['prompt'])===_0x326b81){this['remove'](_0x4d342d);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x101f6b=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x101f6b));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x277dbf=>_0x277dbf)));}}function Ss(_0x23e2c2){return _0x23e2c2['toLowerCase']()['trim']();}class k extends _0x51e4fd{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2ae922,_0x253a10,_0x5d697e=''){super(_0x2ae922),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 os(),this['errorView']=new rt(_0x2ae922),this['contentArea']=new X(_0x2ae922,_0x5d697e),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 _0x57320c(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x138fca({'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 _0x34e9ca=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x253a10],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x34e9ca['if']('isError','ck-hidden',_0x2b807b=>!_0x2b807b)]},'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'](_0x573646=0x1){-0x1===_0x573646?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 _0x204d98=this['locale'],_0x175d18=new ht(_0x204d98,{'queryView':{'label':i(_0x204d98,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x1188ea,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x204d98,'Empty\x20history'),'secondary':i(_0x204d98,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x175d18['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x52a35a,_0x2c3518)=>_0x52a35a&&!_0x2c3518),this['listenTo'](_0x175d18,'submit',(_0xe15aea,_0x46d868)=>{this['prompt']=_0x46d868;const _0xdf2f5b=_0x34c32d(_0x46d868);this['fire']('submitPrompt',_0xdf2f5b),_0x46d868['trim']()&&this['_promptHistory']['add']({'prompt':_0xdf2f5b},0x0);},{'priority':'high'}),_0x175d18;}['_createHistoryView'](){const _0x119793=new rs(this['locale']);return _0x119793['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x119793['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x119793;}['_createToolbar'](){const _0x24caee=new at(this['locale']);return _0x24caee['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4b27bd,_0x268697,_0x3642e9)=>_0x4b27bd&&!_0x268697&&!!_0x3642e9),_0x24caee['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x24caee['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1173cb,_0x52000d,_0x2aa5fd)=>_0x1173cb&&!_0x52000d&&!!_0x2aa5fd),_0x24caee['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x24caee['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x47ae7b,_0x5d10d9)=>_0x47ae7b&&!_0x5d10d9),_0x24caee['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x24caee['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x24caee['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x24caee;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x548db7=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x548db7,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2704a2){const _0x11997f=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2704a2||i(_0x11997f,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var T='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const w=globalThis['DataTransfer'];class n extends _0x166283{['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[_0x45d88e,a,K,_0x4aebcd];}constructor(_0x5dbdf3){super(_0x5dbdf3),_0x5dbdf3['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x5dbdf3['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x5dbdf3['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x5dbdf3['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1e8729}=this;this['_aiAdapter']=_0x1e8729['plugins']['get'](K),this['_dialog']=_0x1e8729['plugins']['get'](_0x4aebcd),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x560253=new E(_0x1e8729,Array['from'](this['_commandDefinitions']['values']()));_0x1e8729['commands']['add']('showAIAssistant',_0x560253),_0x1e8729['ui']['componentFactory']['add']('aiCommands',_0xae71eb=>{const _0x281649=_0x334429(_0xae71eb);return _0x281649['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x281649['buttonView']['set']({'label':i(_0xae71eb,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x281649['on']('execute',_0x27fe6e=>this['_onExecute'](_0x27fe6e['source']['id'])),_0x390a9c(_0x281649,_0x1e8729['ui']['view']['body'],function(_0x1295d0){const _0x39343a=o(_0x1295d0['config']['get']('ai.aiAssistant.commands'),_0x1295d0['locale']),_0x4f6d94=U(_0x1295d0,_0x39343a)['filter'](_0x580e29=>_0x580e29['commands']['length']);if(0x1===_0x4f6d94['length'])return U(_0x1295d0,_0x4f6d94[0x0]['commands'])['map'](_0x526cbd=>({'id':_0x526cbd['id'],'label':_0x526cbd['label']}));return _0x4f6d94['map'](_0x124d43=>{const {groupId:_0x42d10f,groupLabel:_0x310617,commands:_0x643fa1}=_0x124d43,_0x3c4726=U(_0x1295d0,_0x643fa1)['map'](_0x23d285=>({'id':_0x23d285['id'],'label':_0x23d285['label']}));return{'id':_0x42d10f,'menu':_0x310617||_0x42d10f,'children':_0x3c4726};});}(_0x1e8729),{'ariaLabel':i(_0xae71eb,'AI\x20Commands')}),_0x281649['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x560253['on']('change:enabledCommandsIds',_0x1d405d),_0x281649['menuView']['once']('render',_0x1d405d),_0x281649;function _0x1d405d(){_0x281649['isEnabled']=_0x560253['enabledCommandsIds']['length']>0x0;for(const _0x47b7b7 of _0x281649['menuView']['buttons'])_0x47b7b7['isEnabled']=_0x560253['enabledCommandsIds']['includes'](_0x47b7b7['id']);}}),_0x1e8729['ui']['componentFactory']['add']('menuBar:aiCommands',_0x30d85e=>{const _0x307dcf=new _0x2cf723(_0x30d85e);_0x307dcf['buttonView']['set']({'label':i(_0x30d85e,'AI\x20Commands'),'icon':T}),_0x307dcf['bind']('isEnabled')['to'](_0x560253,'enabledCommandsIds',_0x144841=>_0x144841['length']>0x0);const _0x4498fc=o(_0x1e8729['config']['get']('ai.aiAssistant.commands'),_0x30d85e);return this['_populateMenuBarMenu'](_0x560253,_0x307dcf,_0x4498fc,_0x11a428=>this['_onExecute'](_0x11a428)),_0x307dcf;}),_0x1e8729['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x8a565f=this['_createAIAssistantUIButton'](_0x317755);return _0x8a565f['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x8a565f;}),_0x1e8729['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x54c56b=this['_createAIAssistantUIButton'](_0x1b137b);return _0x54c56b['set']({'role':'menuitemcheckbox'}),_0x54c56b;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x540439=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x33d02e;for(const _0x330b39 in _0x540439){const _0x389366=_0x330b39,_0x4b0120=_0x540439[_0x389366];if('aiLicenseKeyValid'==_0x4b0120||'aiLicenseKeyInvalid'==_0x4b0120||'aiLicenseKeyExpired'==_0x4b0120||'aiLicenseKeyDomainLimit'==_0x4b0120||'aiLicenseKeyNotAllowed'==_0x4b0120||'aiLicenseKeyEvaluationLimit'==_0x4b0120||'aiLicenseKeyTrialLimit'==_0x4b0120||'aiLicenseKeyUsageLimit'==_0x4b0120){delete _0x540439[_0x389366],_0x33d02e=_0x4b0120,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x33d02e&&_0x540439['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x33d02e&&_0x540439['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x33d02e&&_0x540439['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x33d02e&&_0x540439['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x33d02e&&_0x540439['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x33d02e&&_0x540439['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x33d02e&&_0x540439['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x500ac9='',_0x3eaf64='',_0x2c05ec='custom'){const _0xd4578a=this['editor'],_0x3ab00e=_0xd4578a['editing']['view'],_0x179b20=_0xd4578a['plugins']['get'](a),_0x1e6923=_0xd4578a['plugins']['get'](_0x45d88e);_0x179b20['showFakeVisualSelection']();const _0x418e13=new w(),_0x550d03=new ClipboardEvent('copy',{'clipboardData':_0x418e13}),_0x58036e=new _0x39a236(_0x418e13),_0x56d1ed=new _0x22c2f0(_0x3ab00e,_0x550d03,{'dataTransfer':_0x58036e});_0x1e6923['_forceMarkersCopy']('comment',()=>{_0x3ab00e['document']['fire']('copy',_0x56d1ed);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0xd4578a,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x532a40=_0x58036e['getData']('text/html');const _0x7030fd=_0xd4578a['model']['document']['selection'],_0xe74fe2=Array['from'](_0x7030fd['getRanges']());0x1===_0xe74fe2['length']&&_0xe74fe2[0x0]['isFlat']&&!_0x7030fd['getSelectedElement']()&&''!==_0x532a40['replace'](/ /g,'')['trim']()&&(_0x532a40='<p>'+_0x532a40+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2c05ec,'query':_0x500ac9,'htmlContent':_0x532a40,'label':_0x3eaf64,'mainActionLabel':M[_0xd4578a['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ct['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x55fa78['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x179b20['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x14ba00=new Map(),_0x3b1eb5=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x30e2b9 of _0x3b1eb5)for(const _0x533735 of _0x30e2b9['commands'])_0x14ba00['set'](_0x533735['id'],{..._0x533735,'groupId':_0x30e2b9['groupId'],'groupLabel':_0x30e2b9['groupLabel']||_0x30e2b9['groupId']});return _0x14ba00;}['_createAIAssistantUIButton'](_0x3ea4a4){const _0x3ad0b5=this['editor'],_0x39153c=_0x3ad0b5['commands']['get']('showAIAssistant'),_0x5a500c=new _0x3ea4a4(_0x3ad0b5['locale']);return _0x5a500c['set']({'label':i(_0x3ad0b5['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x5a500c['bind']('isEnabled')['to'](_0x39153c),_0x5a500c['bind']('isOn')['to'](this['_dialog'],'id',_0x450f36=>'aiAssistant'===_0x450f36),this['listenTo'](_0x5a500c,'execute',()=>{_0x5a500c['isOn']?this['hideUI']():_0x39153c['execute']();}),_0x5a500c;}['_initView'](){const _0x3cc5a2=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x3cc5a2['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3cc5a2['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x574b0e,ui:{ariaLiveAnnouncer:_0x160b43}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x16ceee,_0x33a26a,_0x7964bb)=>{const _0x2da6d2=this['_aiAssistantController']['currentContext'];_0x7964bb?_0x160b43['announce'](i(_0x574b0e,'AI\x20is\x20writing')):_0x2da6d2&&_0x160b43['announce'](i(_0x574b0e,'Generated\x20content:\x20%0',_0x2da6d2),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x183fe0,_0x19b00f,_0xfa6969)=>{if(_0xfa6969){const _0x55d73c=this['_formView']['errorView']['text'];_0x160b43['announce'](i(_0x574b0e,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x55d73c));}});}['_onExecute'](_0x1f841c){const _0x118afc=this['_commandDefinitions']['get'](_0x1f841c),_0x968df4=this['editor'],_0x43a931=_0x968df4['model']['document']['selection'],_0x3c7cef=_0x968df4['commands']['get']('showAIAssistant'),_0x450174=_0x968df4['plugins']['get'](a),_0x25d937=''+(_0x118afc['groupId']!==x?_0x118afc['groupLabel']+':\x20':'')+_0x118afc['label'];if(!0x1!==_0x118afc['requiresContent']&&_0x43a931['isCollapsed']){const _0x5dee13=_0x24de88(_0x43a931['getSelectedBlocks']())||_0x968df4['model']['schema']['getLimitElement'](_0x43a931);_0x968df4['model']['change'](_0x12cad0=>{_0x12cad0['setSelection'](_0x5dee13,'in');});}_0x450174['showFakeVisualSelection'](),_0x3c7cef['execute'](_0x118afc['prompt'],_0x25d937,'command:'+_0x1f841c);}['_populateMenuBarMenu'](_0x267ff9,_0x222e52,_0x2147a6,_0x19b73a){const _0x364ad3=this['editor'],_0x9b5063=_0x364ad3['locale'],_0x10c679=new _0x5cdd37(_0x9b5063),_0x947c70=U(_0x364ad3,_0x2147a6)['filter'](_0x532e70=>_0x532e70['commands']['length']);0x1===_0x947c70['length']?this['_getMenuBarGroupButtons']({'command':_0x267ff9,'commands':_0x947c70[0x0]['commands'],'parentMenuView':_0x222e52,'onExecute':_0x19b73a})['forEach'](_0x43452a=>_0x10c679['items']['add'](_0x43452a)):_0x947c70['forEach'](({groupId:_0x49f59c,groupLabel:_0x3101cf,commands:_0x16425b})=>{const _0x33afff=new _0x1226d5(_0x9b5063,_0x222e52),_0x1fe692=new _0x2cf723(_0x9b5063),_0x583a15=new _0x5cdd37(_0x9b5063),_0x528222=this['_getMenuBarGroupButtons']({'command':_0x267ff9,'commands':_0x16425b,'parentMenuView':_0x1fe692,'onExecute':_0x19b73a});_0x1fe692['buttonView']['set']({'label':_0x3101cf||_0x49f59c}),_0x1fe692['delegate']('execute')['to'](_0x222e52),_0x583a15['items']['addMany'](_0x528222),_0x1fe692['panelView']['children']['add'](_0x583a15),_0x33afff['children']['add'](_0x1fe692),_0x10c679['items']['add'](_0x33afff);}),_0x222e52['panelView']['children']['add'](_0x10c679);}['_getMenuBarGroupButtons']({command:_0x314162,commands:_0x305837,parentMenuView:_0x5974eb,onExecute:_0x26299e}){const _0x52e4f5=this['editor'],_0x511b6e=_0x52e4f5['locale'];return U(_0x52e4f5,_0x305837)['map'](_0x256728=>{const _0xd391a2=new _0x1226d5(_0x511b6e,_0x5974eb),_0x5e5a9a=new _0x1b137b(_0x511b6e);return _0x5e5a9a['set']({'label':_0x256728['label']}),_0x5e5a9a['delegate']('execute')['to'](_0x5974eb),_0x5e5a9a['on']('execute',()=>_0x26299e(_0x256728['id'])),_0x5e5a9a['bind']('isEnabled')['to'](_0x314162,'enabledCommandsIds',_0x25e5f0=>_0x25e5f0['includes'](_0x256728['id'])),_0xd391a2['children']['add'](_0x5e5a9a),_0xd391a2;});}}function B(_0x5d3f22,_0x27f04f){return void 0x0!==_0x5d3f22['order']&&void 0x0===_0x27f04f['order']?0x1:void 0x0===_0x5d3f22['order']&&void 0x0!==_0x27f04f['order']?-0x1:void 0x0!==_0x5d3f22['order']&&void 0x0!==_0x27f04f['order']?_0x5d3f22['order']-_0x27f04f['order']:0x0;}function U(_0x1fab65,_0x1ca1ce){_0x1ca1ce['sort'](B);const _0x656b9d={},_0x47250d=[];for(const _0x3a1eff of _0x1ca1ce)if(void 0x0!==_0x3a1eff['order']){if(_0x3a1eff['order']in _0x656b9d)throw new _0xa8682e('ai-commands-config-order-collision',_0x1fab65,{'conflictingDefinitions':[_0x3a1eff,_0x656b9d[_0x3a1eff['order']]]});_0x656b9d[_0x3a1eff['order']]=_0x3a1eff,_0x47250d['splice'](_0x3a1eff['order'],0x0,_0x3a1eff);}else _0x47250d['push'](_0x3a1eff);return _0x47250d;}class r extends _0x166283{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4bb1a5){super(_0x4bb1a5);const _0xef69aa=_0x4bb1a5['config'],_0x49ecec=_0x4bb1a5['locale'];_0xef69aa['define']('ai.aiAssistant.preserveComments',!0x0),_0xef69aa['define']('ai.aiAssistant.commands',function(_0x63980b){return[{'groupId':'editOrReview','groupLabel':i(_0x63980b,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x63980b,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x63980b,'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(_0x63980b,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x63980b,'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(_0x63980b,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x63980b,'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(_0x63980b,'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(_0x63980b,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x63980b,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x63980b,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x63980b,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x63980b,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x63980b,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x63980b,'Change\x20style'),'commands':[{'id':'business','label':i(_0x63980b,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x63980b,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x63980b,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x63980b,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x63980b,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x63980b,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x63980b,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x63980b,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x63980b,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x63980b,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x63980b,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x63980b,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x63980b,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x49ecec)),_0xef69aa['define']('ai.aiAssistant.extraCommandGroups',[]),_0xef69aa['define']('ai.aiAssistant.removeCommands',[]);let _0x2e5575=o(_0xef69aa['get']('ai.aiAssistant.commands'),_0x49ecec);const _0x158a3c=_0xef69aa['get']('ai.aiAssistant.extraCommandGroups'),_0x8e1e37=_0xef69aa['get']('ai.aiAssistant.removeCommands');_0x158a3c['forEach'](_0x25d039=>{const _0x4797d7=_0x2e5575['find'](_0x2e34cb=>_0x2e34cb['groupId']===_0x25d039['groupId']);_0x4797d7?_0x4797d7['commands']=_0x4797d7['commands']['concat'](_0x25d039['commands']):_0x2e5575['push'](_0x25d039);}),_0x2e5575=_0x2e5575['filter'](_0x3d2375=>!_0x8e1e37['includes'](_0x3d2375['groupId'])),_0x2e5575['forEach'](_0x1e1c66=>{_0x1e1c66['commands']=_0x1e1c66['commands']['filter'](_0x1860f2=>!_0x8e1e37['includes'](_0x1860f2['id']));}),_0xef69aa['set']('ai.aiAssistant.commands',_0x2e5575);}}class P extends _0x166283{['abortController'];static get['requires'](){return[K];}constructor(_0x522c49){super(_0x522c49),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x550e45){return this['sendRequest'](_0x550e45)['catch'](_0x14f847=>{if(_0x14f847 instanceof R)return Promise['reject'](_0x14f847);if('AbortError'==_0x14f847['name'])return Promise['resolve']();throw console['error'](_0x14f847),new _0xa8682e('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x3a8708,_0x2492af){const _0x1c4135=this['editor']['locale'],_0x500a92={'Content-Type':'application/json'};if('object'==typeof _0x3a8708)Object['assign'](_0x500a92,_0x3a8708);else{if(_0x3a8708)try{const _0x1f3650=await _0x3a8708(_0x2492af);Object['assign'](_0x500a92,_0x1f3650);}catch(_0x12c52b){return Promise['reject'](new R(i(_0x1c4135,'AI_ERROR_GET_HEADERS')));}}return _0x500a92;}async['_prepareRequestParameters'](_0x5dfc16,_0x2a2f20){const _0x48e010=this['editor']['locale'];if('object'==typeof _0x5dfc16)return _0x5dfc16;try{return await _0x5dfc16(_0x2a2f20);}catch(_0x33b02e){return Promise['reject'](new R(i(_0x48e010,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4f4b3c){super(_0x4f4b3c),_0x4f4b3c['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4f4b3c['config']['get']('ai.openAI.requestParameters')||_0x4f4b3c['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4f4b3c['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x4f4b3c['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x4f4b3c['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x38a678,context:_0x5cba7c,onData:_0xd5c973,actionId:_0x4f4bec}){const _0x3178f0=this['editor']['locale'],_0x5cac4a=await this['prepareMessages'](_0x38a678,_0x5cba7c,_0x4f4bec),_0x1e7caa=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4f4bec),_0x36f0ee=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4f4bec),_0xe52085={'messages':_0x5cac4a,..._0x36f0ee},_0xadbe2d={'method':'POST','headers':_0x1e7caa,'body':JSON['stringify'](_0xe52085),'signal':this['abortController']['signal']},_0x81ac04=await fetch(this['_apiUrl'],_0xadbe2d);if(_0x81ac04['ok'])return _0x36f0ee['stream']?await this['_readStreamableResponse'](_0x81ac04,_0xd5c973):await this['_readStaticResponse'](_0x81ac04,_0xd5c973),Promise['resolve']();{const _0x39e27a=await _0x81ac04['text']();return _0x39e27a['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x3178f0,'AI_ERROR_CONTEXT_LENGTH'))):_0x39e27a['includes']('Moderation')?Promise['reject'](new R(i(_0x3178f0,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x39e27a));}}async['prepareMessages'](_0x55d730,_0x18fe90,_0x58625b){let _0x2a797e,_0x46ad00;return _0x18fe90?(_0x2a797e='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.',_0x46ad00='Instruction:\x0a'+_0x55d730+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x18fe90):(_0x2a797e='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.',_0x46ad00=_0x55d730),[{'role':'system','content':_0x2a797e},{'role':'user','content':_0x46ad00}];}async['_readStreamableResponse'](_0xc2f179,_0x4a7dcf){const _0x1635a7=_0xc2f179['body']['getReader'](),_0x162384=new TextDecoder();let _0x4cdff2='',_0x30ca95='',_0xe24743='',_0x5f18a3=!0x1;for(;!_0x5f18a3;){const {done:_0x41d548,value:_0x2847e1}=await _0x1635a7['read'](),_0x522cc6=_0x4cdff2+_0x162384['decode'](_0x2847e1);let _0x37a927='';_0x5f18a3=_0x41d548;try{_0x37a927=this['_cleanUpData'](_0x522cc6),_0x4cdff2='';}catch(_0x202b2b){_0x4cdff2=_0x522cc6;continue;}_0x30ca95+=_0x37a927,!_0x5f18a3&&this['_isBufferIncomplete'](_0x30ca95)||_0x30ca95&&(_0xe24743+=_0x30ca95,_0x30ca95='',_0x4a7dcf(_0xe24743));}return Promise['resolve']();}async['_readStaticResponse'](_0x3945dd,_0x48ea16){return _0x48ea16((await _0x3945dd['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x12c553){const _0x4ba65a=_0x12c553['split']('<')['length']!==_0x12c553['split']('>')['length'],_0x25ac07=_0x12c553['length']<0x1e;return _0x4ba65a&&_0x25ac07;}['_cleanUpData'](_0x137ee3){return _0x137ee3['split'](/\n(?![^{]*\})/g)['map'](_0x3de5d9=>_0x3de5d9['replace']('data:\x20',''))['filter'](_0x28e6d1=>_0x28e6d1&&_0x28e6d1['length']>0x0&&'[DONE]'!==_0x28e6d1)['map'](_0x3b6130=>{const {choices:_0x237cc3}=JSON['parse'](_0x3b6130);if(_0x237cc3[0x0]&&_0x237cc3[0x0]['delta']&&_0x237cc3[0x0]['delta']['content'])return _0x237cc3[0x0]['delta']['content'];})['filter'](_0x577b13=>_0x577b13)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2b4b54){super(_0x2b4b54),_0x2b4b54['config']['get']('ai.aws.requestParameters')||_0x2b4b54['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']=_0x2b4b54['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x2b4b54['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2b4b54['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x2b4b54['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x217352,context:_0x57c8ea,onData:_0x40a5eb,actionId:_0x34d2d9}){const {model:_0x533525,stream:_0x58bd70,..._0x33c3c7}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x34d2d9),_0x27a45b={'prompt':await this['preparePrompt'](_0x217352,_0x57c8ea,_0x533525,_0x34d2d9),..._0x33c3c7};this['_apiUrl']?await this['_processProxyRequest'](_0x27a45b,_0x533525,_0x58bd70,_0x40a5eb,_0x34d2d9):await this['_processAWSRequest'](_0x27a45b,_0x533525,_0x58bd70,_0x40a5eb);}async['preparePrompt'](_0x317752,_0x8f3e60,_0x1cd141,_0x43b369){let _0x53db36,_0x3f227d;return _0x8f3e60?(_0x53db36='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.',_0x3f227d='Instruction:\x0a'+_0x317752+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x8f3e60):(_0x53db36='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.',_0x3f227d=_0x317752),'meta.llama'==this['getModelFamily'](_0x1cd141)?'<<SYS>>\x0a'+_0x53db36+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x3f227d+'\x0a[/INST]':'Human:\x0a'+_0x53db36+'\x0a'+_0x3f227d+'\x0a\x0aAssistant:';}['getModelFamily'](_0x1cfd2c){if(/^anthropic\.claude/['test'](_0x1cfd2c))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x1cfd2c))return'ai21.j2';if(/^cohere\.command/['test'](_0x1cfd2c))return'cohere.command';if(/^meta\.llama/['test'](_0x1cfd2c))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x1cfd2c));}async['_processProxyRequest'](_0x9b2258,_0x220f72,_0x2dd78a,_0x4719ce,_0x5ceafe){const _0x260dde={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5ceafe),'body':JSON['stringify']({..._0x9b2258,'model':_0x220f72,'stream':_0x2dd78a}),'signal':this['abortController']['signal']},_0xd78e0f=await fetch(this['_apiUrl'],_0x260dde);_0x2dd78a?await this['_readStreamableResponse'](_0xd78e0f,_0x220f72,_0x4719ce):await this['_readStaticResponse'](_0xd78e0f,_0x220f72,_0x4719ce);}async['_processAWSRequest'](_0x1e7d80,_0x626fde,_0x34e2a4,_0x3c2046){const _0xd0112e=new _0x5df8b5(this['_bedrockClientConfig']),_0x305337={'body':JSON['stringify'](_0x1e7d80),'contentType':'application/json','accept':'application/json','modelId':_0x626fde};let _0x20f2ea;if(_0x34e2a4){const _0x4951b3=new _0x595d99(_0x305337);_0x20f2ea=await _0xd0112e['send'](_0x4951b3,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x20f2ea,_0x626fde,_0x3c2046);}else{const _0x1929a0=new _0x2c86a7(_0x305337);_0x20f2ea=await _0xd0112e['send'](_0x1929a0,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x20f2ea,_0x626fde,_0x3c2046);}}async['_readAsyncIterableResponse'](_0x13332f,_0xc834ea,_0x3533d2){const _0x29bf9a=_0x13332f['body'],_0x5cdd2b=new TextDecoder('utf-8');let _0x23afb8='';for await(const _0x671692 of _0x29bf9a)if(_0x671692['chunk']){const _0x25024d=_0x5cdd2b['decode'](_0x671692['chunk']['bytes']),_0x45cd3d=JSON['parse'](_0x25024d);_0x23afb8+=this['_getGeneratedText'](_0x45cd3d,_0xc834ea),_0x3533d2(_0x23afb8);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4be2b2,_0x54174c,_0x3847c3){const _0x7bfbd3=_0x4be2b2['body'],_0x67c1b0=new TextDecoder('utf-8'),_0x47f6dd=_0x7bfbd3['getReader']();let _0x27201b='',_0x118bf3='',_0x597bb6=!0x1;for(;!_0x597bb6;){const {done:_0x59f206,value:_0x10a300}=await _0x47f6dd['read']();if(_0x597bb6=_0x59f206,_0x597bb6)break;const _0x30bad3=(_0x27201b+_0x67c1b0['decode'](_0x10a300))['split']('\x0a')['map'](_0x1279b9=>{try{return _0x27201b='',JSON['parse'](_0x1279b9);}catch(_0x2fcf62){return _0x27201b=_0x1279b9,null;}})['filter'](_0x4f6b9a=>null!==_0x4f6b9a);_0x30bad3['length']&&(_0x118bf3+=_0x30bad3['map'](_0x2d0a35=>this['_getGeneratedText'](_0x2d0a35,_0x54174c))['join'](''),_0x3847c3(_0x118bf3));}return Promise['resolve']();}async['_readStaticResponse'](_0x1ac435,_0x34e3f5,_0x211703){let _0x5ebd2d;return _0x5ebd2d=_0x1ac435 instanceof Response?await _0x1ac435['json']():JSON['parse'](Buffer['from'](_0x1ac435['body'])['toString']('utf8')),(_0x211703(this['_getGeneratedText'](_0x5ebd2d,_0x34e3f5)),Promise['resolve']());}['_getGeneratedText'](_0x5d5ccc,_0x515d6a){switch(this['getModelFamily'](_0x515d6a)){case'anthropic.claude':return _0x5d5ccc['completion'];case'ai21.j2':return _0x5d5ccc['completions'][0x0]['data']['text'];case'cohere.command':return _0x5d5ccc['generations'][0x0]['text'];case'meta.llama':return _0x5d5ccc['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
|
23
|
+
import{Plugin as _0x35e6b4,Command as _0x13870c,icons as _0x3d5100}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x104178,CKEditorError as _0x5214d7,ObservableMixin as _0x18cb8b,global as _0x213c0d,isVisible as it,Rect as st,Collection as _0x4cabb9,FocusTracker as _0x33c50d,KeystrokeHandler as ts,first as _0x1bbd49}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0xb1a835,View as _0x24daac,SpinnerView as _0x198eaa,IconView as _0x780b05,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x231fd2,ButtonLabelView as te,FocusCycler as _0x3dc487,createLabeledTextarea as _0x4b1830,Dialog as _0x41a95c,createDropdown as _0x33ae9b,addMenuToDropdown as _0xf8e484,MenuBarMenuView as _0x518aec,MenuBarMenuListItemButtonView as _0x31b645,DialogViewPosition as _0x29ac9d,MenuBarMenuListView as _0x315c2d,MenuBarMenuListItemView as _0x1e2e1d}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x30b3b1,ClipboardMarkersUtils as _0x5f4ba6}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x5ce0c2,DataTransfer as _0x1b5f2b,UpcastWriter as _0x3e2e87,Matcher as _0x596cb8}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0xc46e0c,escape as _0x574ba3}from'lodash-es';import{BedrockRuntimeClient as _0x1df7f4,InvokeModelWithResponseStreamCommand as _0x45becd,InvokeModelCommand as _0x5898f7}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x42086a,_0xb9689f){const _0x4b6c55=(0x0,_0xb9689f['t'])('Other');return _0x42086a['length']?'groupId'in _0x42086a[0x0]?_0x42086a:[{'groupId':x,'groupLabel':_0x4b6c55,'order':0x1/0x0,'commands':_0x42086a}]:[{'groupId':x,'groupLabel':_0x4b6c55,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x35e6b4{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x199065}=this,_0x59e898=['ck-fake-ai-selection'];_0x199065['config']['get']('ai.useTheme')&&_0x59e898['push']('ck-ai-assistant-ui_theme'),_0x199065['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x59e898,'priority':0xc}}),_0x199065['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x3df8f4,{writer:_0x97becb})=>{if(!_0x3df8f4['markerRange']['isCollapsed'])return null;const _0x1b7af6=_0x97becb['createUIElement']('span');return _0x97becb['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1b7af6),_0x1b7af6;}});}['afterInit'](){!async function(_0x4dff1a){const _0x3e23dc=_0x2aaf3c([0x74,0x54,0x5a,0x35,0x43,0x61,0x71,0x46,0x44,0x6d,0x70,0x69,0x4b,0x64,0x53,0x45,0x72,0x58,0x48,0x66,0x4e,0x6b,0x59,0x32,0x4a,0x41,0x4f,0x55,0x37,0x30,0x65,0x39,0x77,0x73,0x36,0x4c,0x7a,0x78,0x76,0x33,0x57,0x56,0x50,0x79,0x67,0x68,0x38,0x34,0x6e,0x4d,0x42,0x6c,0x47,0x52,0x75,0x63,0x49,0x6a,0x62,0x6f,0x51,0x31]),_0x4c7b0d=0x2115a6c9,_0x5b4a83=0x2112f841^_0x4c7b0d,_0xbf8ddb=window[_0x2aaf3c([0x44,0x61,0x74,0x65])][_0x2aaf3c([0x6e,0x6f,0x77])](),_0x3def3c=_0x4dff1a[_0x2aaf3c([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x15657b=new window[(_0x2aaf3c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x349114=>{_0x3def3c[_0x2aaf3c([0x6f,0x6e,0x63,0x65])](_0x2aaf3c([0x72,0x65,0x61,0x64,0x79]),_0x349114);}),_0x188a1c={[_0x2aaf3c([0x6b,0x74,0x79])]:_0x2aaf3c([0x45,0x43]),[_0x2aaf3c([0x75,0x73,0x65])]:_0x2aaf3c([0x73,0x69,0x67]),[_0x2aaf3c([0x63,0x72,0x76])]:_0x2aaf3c([0x50,0x2d,0x32,0x35,0x36]),[_0x2aaf3c([0x78])]:_0x2aaf3c([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]),[_0x2aaf3c([0x79])]:_0x2aaf3c([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]),[_0x2aaf3c([0x61,0x6c,0x67])]:_0x2aaf3c([0x45,0x53,0x32,0x35,0x36])},_0xcbc326=_0x3def3c[_0x2aaf3c([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2aaf3c([0x67,0x65,0x74])](_0x2aaf3c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x4fc45d(){let _0x3d0594,_0x458bef=null,_0x59467=null;try{if(_0xcbc326==_0x2aaf3c([0x47,0x50,0x4c]))return _0x2aaf3c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3d0594=_0x947394(),!_0x3d0594)return _0x2aaf3c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3d0594[_0x2aaf3c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x59467=_0x489ebd(_0x3d0594[_0x2aaf3c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3d0594[_0x2aaf3c([0x6a,0x74,0x69])])),await _0x491d98()?_0xe3f7fa()?_0x3b6e03()?_0x2aaf3c([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x23f7ec()?(_0x3d0594[_0x2aaf3c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2aaf3c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x458bef=_0x287de0(_0x2aaf3c([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x3d0594[_0x2aaf3c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2aaf3c([0x74,0x72,0x69,0x61,0x6c])&&(_0x458bef=_0x287de0(_0x2aaf3c([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3fa160()):_0x2aaf3c([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2aaf3c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2aaf3c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x285cec){return _0x2aaf3c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3b6e03(){const _0x5f42f5=[_0x2aaf3c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2aaf3c([0x74,0x72,0x69,0x61,0x6c])][_0x2aaf3c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3d0594[_0x2aaf3c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0xbf8ddb/0x3e8:0xe10*_0x5b4a83;return _0x3d0594[_0x2aaf3c([0x65,0x78,0x70])]<_0x5f42f5;}function _0xe3f7fa(){const _0x11bd41=_0x3d0594[_0x2aaf3c([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x11bd41&&(!!_0x11bd41[_0x2aaf3c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2aaf3c([0x2a]))||!!_0x11bd41[_0x2aaf3c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2aaf3c([0x41,0x49])));}function _0x23f7ec(){const _0x64045=_0x3d0594[_0x2aaf3c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x64045||0x0==_0x64045[_0x2aaf3c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x477fe6}=new URL(window[_0x2aaf3c([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x64045[_0x2aaf3c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x477fe6))return!0x0;const _0x54b656=_0x477fe6[_0x2aaf3c([0x73,0x70,0x6c,0x69,0x74])](_0x2aaf3c([0x2e]));return _0x64045[_0x2aaf3c([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x568d42=>_0x568d42[_0x2aaf3c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2aaf3c([0x2a])))[_0x2aaf3c([0x6d,0x61,0x70])](_0x3305d2=>_0x3305d2[_0x2aaf3c([0x73,0x70,0x6c,0x69,0x74])](_0x2aaf3c([0x2e])))[_0x2aaf3c([0x73,0x6f,0x6d,0x65])](_0x4ae60b=>_0x54b656[_0x2aaf3c([0x65,0x76,0x65,0x72,0x79])]((_0x2f7b49,_0x43d452)=>_0x4ae60b[_0x43d452]===_0x2f7b49||_0x4ae60b[_0x43d452]===_0x2aaf3c([0x2a])));}function _0x3fa160(){return _0x458bef&&_0x59467?new window[(_0x2aaf3c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5af985,_0x55a22d)=>{_0x458bef[_0x2aaf3c([0x74,0x68,0x65,0x6e])](_0x5af985,_0x55a22d),_0x59467[_0x2aaf3c([0x74,0x68,0x65,0x6e])](_0xc5d6c4=>{_0xc5d6c4!=_0x2aaf3c([0x56,0x61,0x6c,0x69,0x64])&&_0x5af985(_0xc5d6c4);},_0x55a22d);}):_0x458bef||_0x59467||_0x2aaf3c([0x56,0x61,0x6c,0x69,0x64]);}}function _0x489ebd(_0x578d8d,_0x495169){return new window[(_0x2aaf3c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3d67f4=>{if(_0xe02e1c())return _0x3d67f4(_0x2aaf3c([0x56,0x61,0x6c,0x69,0x64]));_0x16068a(),_0x3def3c[_0x2aaf3c([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2aaf3c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x18343a=!0x1;const _0x3509e1=_0x104178();function _0x3668db(_0x1b4234){return!!_0x1b4234&&(typeof _0x1b4234===_0x2aaf3c([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x1b4234===_0x2aaf3c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x1b4234[_0x2aaf3c([0x74,0x68,0x65,0x6e])]===_0x2aaf3c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x1b4234[_0x2aaf3c([0x63,0x61,0x74,0x63,0x68])]===_0x2aaf3c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x37f328(_0xd7fe5c){_0x511ecc(_0xd7fe5c)[_0x2aaf3c([0x74,0x68,0x65,0x6e])](_0x11c632=>{if(!_0x11c632||_0x11c632[_0x2aaf3c([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2aaf3c([0x6f,0x6b]))return _0x2aaf3c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1eafe0(_0x16839b(_0x3509e1+_0x495169))!=_0x11c632[_0x2aaf3c([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2aaf3c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2aaf3c([0x56,0x61,0x6c,0x69,0x64]);})[_0x2aaf3c([0x74,0x68,0x65,0x6e])](_0x46ae9a=>(_0x5b3940(),_0x46ae9a),()=>{const _0x40be48=_0xd055bc();return null==_0x40be48?(_0x5b3940(),_0x2aaf3c([0x56,0x61,0x6c,0x69,0x64])):_0x2aaf3c(_0xbf8ddb-_0x40be48>(0x51922c9^_0x4c7b0d)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2aaf3c([0x74,0x68,0x65,0x6e])](_0x3d67f4)[_0x2aaf3c([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3d67f4(_0x2aaf3c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x1a659f=0x21234849^_0x4c7b0d;function _0x5b3940(){const _0x2d71ed=_0x2aaf3c([0x6c,0x6c,0x63,0x74,0x2d])+_0x1eafe0(_0x16839b(_0x578d8d)),_0x5374ef=_0x3dfda1(_0x1eafe0(window[_0x2aaf3c([0x4d,0x61,0x74,0x68])][_0x2aaf3c([0x63,0x65,0x69,0x6c])](_0xbf8ddb/_0x1a659f)));window[_0x2aaf3c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2aaf3c([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2d71ed,_0x5374ef);}function _0xd055bc(){const _0x48087b=_0x2aaf3c([0x6c,0x6c,0x63,0x74,0x2d])+_0x1eafe0(_0x16839b(_0x578d8d)),_0x2e62c4=window[_0x2aaf3c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2aaf3c([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x48087b);return _0x2e62c4?window[_0x2aaf3c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3dfda1(_0x2e62c4),0x10)*_0x1a659f:null;}function _0x511ecc(_0x269648){return new window[(_0x2aaf3c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3b8b1a,_0x38d4f2)=>{_0x269648[_0x2aaf3c([0x74,0x68,0x65,0x6e])](_0x3b8b1a,_0x38d4f2),window[_0x2aaf3c([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x38d4f2,0x21147209^_0x4c7b0d);});}}_0x3def3c[_0x2aaf3c([0x6f,0x6e])](_0x2aaf3c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3634b6,_0x4e3436)=>{if(_0x4e3436[0x0]!=_0x578d8d)return _0x3d67f4(_0x2aaf3c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x4e3436[0x1]={..._0x4e3436[0x1],[_0x2aaf3c([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3509e1};},{[_0x2aaf3c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2aaf3c([0x68,0x69,0x67,0x68])}),_0x3def3c[_0x2aaf3c([0x6f,0x6e])](_0x2aaf3c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2c9c64=>{_0x3668db(_0x2c9c64[_0x2aaf3c([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x18343a=!0x0,_0x37f328(_0x2c9c64[_0x2aaf3c([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2aaf3c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2aaf3c([0x6c,0x6f,0x77])}),_0x15657b[_0x2aaf3c([0x74,0x68,0x65,0x6e])](()=>{_0x18343a||_0x3d67f4(_0x2aaf3c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0xe02e1c(){return _0x3def3c[_0x2aaf3c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2aaf3c([0x76,0x69,0x65,0x77])][_0x2aaf3c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2aaf3c([0x61,0x75,0x74,0x6f]);}function _0x16068a(){_0x3def3c[_0x2aaf3c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2aaf3c([0x76,0x69,0x65,0x77])][_0x2aaf3c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2aaf3c([0x61,0x75,0x74,0x6f]);}}function _0x287de0(_0x2da370){const _0x37741c=[new window[(_0x2aaf3c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1963e1=>setTimeout(_0x1963e1,0x211c9805^_0x4c7b0d)),_0x15657b[_0x2aaf3c([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2aaf3c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x51852c=>{let _0x5d34ea=0x0;_0x3def3c[_0x2aaf3c([0x6d,0x6f,0x64,0x65,0x6c])][_0x2aaf3c([0x6f,0x6e])](_0x2aaf3c([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1cf67a,_0x3aa824)=>{_0x3aa824[0x0][_0x2aaf3c([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x5d34ea++,_0x5d34ea==(0x2115a731^_0x4c7b0d)&&(_0x51852c(),_0x1cf67a[_0x2aaf3c([0x6f,0x66,0x66])]());});}))];return window[_0x2aaf3c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2aaf3c([0x72,0x61,0x63,0x65])](_0x37741c)[_0x2aaf3c([0x74,0x68,0x65,0x6e])](()=>_0x2da370);}async function _0x556eed(){await _0x15657b,_0x3def3c[_0x2aaf3c([0x6d,0x6f,0x64,0x65,0x6c])][_0x2aaf3c([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0xb42682,_0x3def3c[_0x2aaf3c([0x6d,0x6f,0x64,0x65,0x6c])][_0x2aaf3c([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0xb42682,_0x3def3c[_0x2aaf3c([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2aaf3c([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x1dbbdb(_0x2cb81c){const _0x1e8a2c=_0x4efbc4();_0x3def3c[_0x1e8a2c]=_0x2aaf3c([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x2cb81c,_0x2cb81c!=_0x2aaf3c([0x56,0x61,0x6c,0x69,0x64])&&_0x556eed();}function _0x4efbc4(){const _0x47c9c0=window[_0x2aaf3c([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2aaf3c([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2aaf3c([0x6e,0x6f,0x77])]())[_0x2aaf3c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2aaf3c([0x2e]),'');let _0x4bcc77=_0x2aaf3c([0x74]);for(let _0xddfa91=0x0;_0xddfa91<_0x47c9c0[_0x2aaf3c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xddfa91+=0x2){let _0x2e0c4d=window[_0x2aaf3c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x47c9c0[_0x2aaf3c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xddfa91,_0xddfa91+0x2));_0x2e0c4d>=_0x3e23dc[_0x2aaf3c([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x2e0c4d-=_0x3e23dc[_0x2aaf3c([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4bcc77+=_0x3e23dc[_0x2e0c4d];}return _0x4bcc77;}function _0x947394(){const _0x4bf33d=_0xcbc326[_0x2aaf3c([0x73,0x70,0x6c,0x69,0x74])](_0x2aaf3c([0x2e]));if(0x3!=_0x4bf33d[_0x2aaf3c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3c07c9(_0x4bf33d[0x1]);function _0x3c07c9(_0x3e4cc8){const _0x1b32d3=_0x3f8cb2(_0x3e4cc8);return _0x1b32d3&&_0xe15198()?_0x1b32d3:null;function _0xe15198(){const _0x1c4e43=_0x1b32d3[_0x2aaf3c([0x6a,0x74,0x69])],_0x19cb7f=window[_0x2aaf3c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1c4e43[_0x2aaf3c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1c4e43[_0x2aaf3c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x5549fe={..._0x1b32d3,[_0x2aaf3c([0x6a,0x74,0x69])]:_0x1c4e43[_0x2aaf3c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x1c4e43[_0x2aaf3c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x5549fe[_0x2aaf3c([0x76,0x63])],_0x16839b(_0x5549fe)==_0x19cb7f;}}}async function _0x491d98(){let _0x1386f6=!0x0;try{const _0x22486a=_0xcbc326[_0x2aaf3c([0x73,0x70,0x6c,0x69,0x74])](_0x2aaf3c([0x2e])),[_0x53f386,_0x449c1c,_0x29a2a4]=_0x22486a;return _0x4b4bee(_0x53f386),await _0x216b2f(_0x53f386,_0x449c1c,_0x29a2a4),_0x1386f6;}catch(_0xd15f6b){return!0x1;}function _0x4b4bee(_0x1a4864){const _0x1bd43a=_0x3f8cb2(_0x1a4864);_0x1bd43a&&_0x1bd43a[_0x2aaf3c([0x61,0x6c,0x67])]==_0x2aaf3c([0x45,0x53,0x32,0x35,0x36])||(_0x1386f6=!0x1);}async function _0x216b2f(_0x3eebf1,_0xb27795,_0x417b46){const _0x11c740=window[_0x2aaf3c([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2aaf3c([0x66,0x72,0x6f,0x6d])](_0x255892(_0x417b46),_0x3a9c0e=>_0x3a9c0e[_0x2aaf3c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2f79c0=new window[(_0x2aaf3c([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2aaf3c([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3eebf1+_0x2aaf3c([0x2e])+_0xb27795),_0x5d0eef=window[_0x2aaf3c([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2aaf3c([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x5d0eef)return;const _0x440a18=await _0x5d0eef[_0x2aaf3c([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2aaf3c([0x6a,0x77,0x6b]),_0x188a1c,{[_0x2aaf3c([0x6e,0x61,0x6d,0x65])]:_0x2aaf3c([0x45,0x43,0x44,0x53,0x41]),[_0x2aaf3c([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2aaf3c([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2aaf3c([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x5d0eef[_0x2aaf3c([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2aaf3c([0x6e,0x61,0x6d,0x65])]:_0x2aaf3c([0x45,0x43,0x44,0x53,0x41]),[_0x2aaf3c([0x68,0x61,0x73,0x68])]:{[_0x2aaf3c([0x6e,0x61,0x6d,0x65])]:_0x2aaf3c([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x440a18,_0x11c740,_0x2f79c0)||(_0x1386f6=!0x1);}}function _0x3f8cb2(_0x18bd1d){return _0x18bd1d[_0x2aaf3c([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2aaf3c([0x65,0x79]))?JSON[_0x2aaf3c([0x70,0x61,0x72,0x73,0x65])](_0x255892(_0x18bd1d)):null;}function _0x255892(_0xc70ea7){return window[_0x2aaf3c([0x61,0x74,0x6f,0x62])](_0xc70ea7[_0x2aaf3c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2aaf3c([0x2b]))[_0x2aaf3c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2aaf3c([0x2f])));}function _0x16839b(_0x702ba4){let _0x5dc445=0x1505;function _0x54f976(_0x20668c){for(let _0x183e3c=0x0;_0x183e3c<_0x20668c[_0x2aaf3c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x183e3c++){const _0x1e8a23=_0x20668c[_0x2aaf3c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x183e3c);_0x5dc445=(_0x5dc445<<0x5)+_0x5dc445+_0x1e8a23,_0x5dc445&=_0x5dc445;}}function _0x508a19(_0x3dd088){Array[_0x2aaf3c([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3dd088)?_0x3dd088[_0x2aaf3c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x508a19):_0x3dd088&&typeof _0x3dd088==_0x2aaf3c([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2aaf3c([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3dd088)[_0x2aaf3c([0x73,0x6f,0x72,0x74])]()[_0x2aaf3c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x358b56,_0x482f56])=>{_0x54f976(_0x358b56),_0x508a19(_0x482f56);}):_0x54f976(window[_0x2aaf3c([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3dd088));}return _0x508a19(_0x702ba4),_0x5dc445>>>0x0;}function _0x1eafe0(_0x4d00a9){return _0x4d00a9[_0x2aaf3c([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2aaf3c([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2aaf3c([0x30]));}function _0x3dfda1(_0x1e01a4){return _0x1e01a4[_0x2aaf3c([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2aaf3c([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2aaf3c([0x6a,0x6f,0x69,0x6e])]('');}function _0xb42682(){}function _0x2aaf3c(_0x1cda25){return _0x1cda25['map'](_0x7a35aa=>String['fromCharCode'](_0x7a35aa))['join']('');}_0x1dbbdb(await _0x4fc45d());}(this);}['showFakeVisualSelection'](){const _0x58cb26=this['editor']['model'];_0x58cb26['change'](_0x205e5c=>{const _0x361a17=_0x58cb26['document']['selection']['getRanges']();let _0x599830=0x0;for(const _0x4cae2d of _0x361a17){const _0x46a4e6=f+':'+_0x599830;if(_0x58cb26['markers']['has'](_0x46a4e6))_0x205e5c['updateMarker'](_0x46a4e6,{'range':_0x4cae2d});else{if(_0x4cae2d['start']['isAtEnd']){const _0x31d47f=_0x4cae2d['start']['getLastMatchingPosition'](({item:_0x4363ae})=>!_0x58cb26['schema']['isContent'](_0x4363ae),{'boundaries':_0x4cae2d});_0x205e5c['addMarker'](_0x46a4e6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x205e5c['createRange'](_0x31d47f,_0x4cae2d['end'])});}else _0x205e5c['addMarker'](_0x46a4e6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4cae2d});}_0x599830++;}});}['hideFakeVisualSelection'](){const _0x13aec8=this['editor']['model'],_0x1dc0d9=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x1dc0d9['length']&&_0x13aec8['change'](_0x525c31=>{_0x1dc0d9['forEach'](_0x5c29ab=>{_0x525c31['removeMarker'](_0x5c29ab);});});}['insertContent'](_0x5f2b8a,_0x449120){const _0x24a52c=this['_getAISelection'](),_0x11e5bd=_0x449120||_0x24a52c['getFirstRange']();this['editor']['model']['canEditAt'](_0x11e5bd)&&this['editor']['model']['change'](_0x7f32b0=>{this['hideFakeVisualSelection'](),_0x449120||this['_resetContentOfSelectedTableCells'](_0x7f32b0,_0x24a52c),this['_pasteHTMLUsingClipboard']({'insertAt':_0x11e5bd,'writer':_0x7f32b0,'html':_0x5f2b8a});});}['insertContentBelow'](_0x3ad180){const {model:_0x239eb8}=this['editor'],_0x223e2d=this['_getAISelection']();_0x239eb8['change'](()=>{const _0x3dd20f=this['_prepareTableInsertBelowPosition'](_0x3ad180,_0x223e2d)||this['_getDefaultInsertBelowPosition'](_0x223e2d);this['insertContent'](_0x3ad180,_0x3dd20f);});}['_getAISelection'](){const _0x4f4684=this['editor']['model'],_0x7bd17b=Array['from'](_0x4f4684['markers']['getMarkersGroup'](f))['map'](_0x214cc9=>_0x214cc9['getRange']());return _0x4f4684['createSelection'](_0x7bd17b);}['_pasteHTMLUsingClipboard']({writer:_0x3bf4a4,html:_0x21dcd1,insertAt:_0x47ac0d}){const {view:_0x2d1df9}=this['editor']['editing'],_0x3d4fc8=this['editor']['plugins']['get'](_0x30b3b1),_0x9f2fad=new dt();_0x9f2fad['setData']('text/html',_0x21dcd1);const _0x15c001=new ClipboardEvent('paste',{'clipboardData':_0x9f2fad}),_0x5c3fd4=new _0x5ce0c2(_0x2d1df9,_0x15c001,{'dataTransfer':new _0x1b5f2b(_0x9f2fad)});_0x3bf4a4['setSelection'](_0x47ac0d);const _0x1fe84a=(_0x1bac82,_0x6a3d54)=>{_0x6a3d54['resultRange']&&_0x3bf4a4['setSelection'](_0x6a3d54['resultRange']);};_0x3d4fc8['once']('contentInsertion',_0x1fe84a,{'priority':'lowest'}),_0x2d1df9['document']['fire']('paste',_0x5c3fd4),_0x3d4fc8['off']('contentInsertion',_0x1fe84a);}['_getDefaultInsertBelowPosition'](_0xf0bc93){const {model:_0x2d2b01}=this['editor'],_0x5be3f7=Array['from'](_0xf0bc93['getSelectedBlocks']());return _0x5be3f7['length']?_0x2d2b01['createPositionAfter'](_0x5be3f7['pop']()):_0xf0bc93['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x523bd5,_0x4b42ba){const {model:_0x5281d4,plugins:_0x343b45}=this['editor'];if(_0x343b45['has']('TableUtils')){const _0x21e859=_0x343b45['get']('TableUtils')['getSelectedTableCells'](_0x4b42ba);if(_0x21e859['length']){const _0x5ccac2=this['_getTableRowCountFromContent'](_0x523bd5),_0x322981=this['_createEmptyTableRows'](_0x21e859,_0x5ccac2);return _0x5281d4['createPositionAt'](_0x322981,0x0);}}return null;}['_getTableRowCountFromContent'](_0x4cd95d){const _0x4cc0ef=this['editor']['plugins']['get']('TableUtils'),_0x4d014a=this['editor']['data']['parse'](_0x4cd95d),_0xe40622=Array['from'](_0x4d014a['getChildren']())['filter'](_0x3f28b1=>_0x3f28b1['is']('element','table'));let _0x514cb6=0x0;return _0xe40622['forEach'](_0x160a8b=>{_0x514cb6+=_0x4cc0ef['getRows'](_0x160a8b);}),_0x514cb6;}['_createEmptyTableRows'](_0x5d4767,_0x314d0b){const _0x473c1c=this['editor']['plugins']['get']('TableUtils'),_0x1dec97=_0x473c1c['getRowIndexes'](_0x5d4767),_0x307aee=_0x473c1c['getColumnIndexes'](_0x5d4767),_0xcef940=_0x1dec97['last']+0x1,_0x1b02b4=_0x307aee['first'],_0x10976e=_0x5d4767[0x0]['findAncestor']('table');for(let _0x30d94b=0x0;_0x30d94b<_0x314d0b;_0x30d94b++)_0x473c1c['insertRows'](_0x10976e,{'at':_0xcef940});return _0x10976e['getChild'](_0xcef940)['getChild'](_0x1b02b4);}['_resetContentOfSelectedTableCells'](_0xf4cc9f,_0x54fed1){const {plugins:_0x1bb6da}=this['editor'],{model:_0x3d6c0e}=_0xf4cc9f;if(!_0x1bb6da['has']('TableUtils'))return;_0x1bb6da['get']('TableUtils')['getSelectedTableCells'](_0x54fed1)['length']&&_0x3d6c0e['deleteContent'](_0x54fed1);}}class K extends _0x35e6b4{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x5214d7('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x806e9d){super(_0x806e9d),this['name']='AIRequestError';}}function i(_0x22c51f,_0xde5efe,_0x89873c){const t=_0x22c51f['t'];switch(_0xde5efe){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',_0x89873c);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x89873c);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'},_0x89873c);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 _0xde5efe;}}class E extends _0x13870c{['_commandDefinitions'];constructor(_0x256faf,_0x40016a){super(_0x256faf),this['_commandDefinitions']=_0x40016a,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0xfaab11,_0x25dc67,_0x567fb1)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x567fb1));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x340e98,_0x1268c5,_0x4262d9)=>{this['enabledCommandsIds']=_0x4262d9?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x4b2c9e=this['editor']['model'];this['_hasContext']=function(_0x5e4540){const _0x58df9c=_0x5e4540['document']['selection'];return _0x58df9c['isCollapsed']?0x0!==[..._0x58df9c['getSelectedBlocks']()]['length']&&![..._0x58df9c['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x5e4540['hasContent'](_0x58df9c['getFirstRange']());}(_0x4b2c9e);const _0x314d01=_0x4b2c9e['document']['selection'],_0x50d6e8=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x3c007c of _0x314d01['getRanges']())for(const _0x52aacc of _0x3c007c['getItems']())if(_0x52aacc['is']('element')&&_0x50d6e8['includes'](_0x52aacc['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x47f247='',_0x485fbd='',_0x28d0e3='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x47f247,_0x485fbd,_0x28d0e3);}}function G(_0x19d8c2,_0x37364c){const _0x205ac2=new Set();for(const _0x21c935 of _0x19d8c2['values']())(_0x37364c||!0x1===_0x21c935['requiresContent'])&&_0x205ac2['add'](_0x21c935['id']);return Array['from'](_0x205ac2);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x18cb8b(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x10a58b,_0x43fc88,_0x530a3f){super(),this['editor']=_0x10a58b,this['textAdapter']=_0x43fc88,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x530a3f,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0xa97b9,_0x1a9d41,_0x11e8a5)=>{this['view']['value']=this['_sanitizeHTML'](_0x11e8a5);}),this['listenTo'](this['view'],'submitPrompt',(_0x1192d7,_0x4cb9e6)=>{const _0x416d39=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4cb9e6,_0x416d39,'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:_0x23c3e8,query:_0x1ebb7,htmlContent:_0x25c3fa,label:_0x19c640,mainActionLabel:_0x339afe}){this['view']['prompt']=_0x19c640,this['view']['mainAction']=_0x339afe,this['initialContext']=_0x25c3fa,_0x1ebb7&&(this['view']['isRendered']?this['_handleQuery'](_0x1ebb7,_0x25c3fa,_0x23c3e8,_0x19c640):this['view']['once']('render',()=>{this['_handleQuery'](_0x1ebb7,_0x25c3fa,_0x23c3e8,_0x19c640);}));}['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'](_0x12b63d,_0x597ed2,_0x1873a0,_0x1db664){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x597ed2,this['previousQuery']=_0x12b63d,this['previousLabel']=_0x1db664||_0x12b63d,this['previousActionId']=_0x1873a0,new Promise(_0x3ed27c=>{this['textAdapter']['makeRequest']({'query':_0x12b63d,'context':_0x597ed2,'onData':_0x2e12d4=>{this['currentResponse']=_0x2e12d4,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1873a0})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x292546=>{_0x292546 instanceof R?this['view']['handleError'](_0x292546['message']):this['view']['handleError'](),_0x3ed27c();})['finally'](()=>{this['stopProcessing'](),_0x3ed27c();});});}['_parseAndNormalizeContent'](_0x4f848e,_0x593b17=!0x1){const _0x3cfdb0=Z['exec'](_0x4f848e);_0x4f848e=_0x3cfdb0?_0x4f848e['substring'](_0x3cfdb0[0x1]['length']):_0x4f848e['length']<0x64&&!_0x593b17?'':this['_stripMarkdownSyntax'](_0x4f848e);const _0x3ba73a=this['_domParser']['parseFromString'](_0x4f848e,'text/html');if(_0x3cfdb0){const _0x408a39=Array['from'](_0x3ba73a['body']['childNodes']);_0x408a39['reverse']();for(const _0x3febf5 of _0x408a39){if(_0x3febf5['nodeType']==Node['ELEMENT_NODE'])break;_0x3febf5['remove']();}}const _0x3b8617=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x3ba73a['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3b8617);const _0x5a0f4a=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0xf9168f=this['editor']['data']['toModel'](_0x3b8617);return _0x5a0f4a||_0xf9168f['markers']['clear'](),this['editor']['data']['stringify'](_0xf9168f);}['_normalizeResponseHeadings'](_0x578d73){const _0x2872a7=new _0x3e2e87(this['editor']['editing']['view']['document']),_0x58c423=new _0x596cb8({'name':/^h[1-5]$/}),_0x44c348=[];let _0x40eda2=!0x1;for(const _0x4c9138 of _0x578d73)_0x4c9138['is']('element')&&_0x58c423['match'](_0x4c9138)&&(_0x44c348['push'](_0x4c9138),'h1'==_0x4c9138['name']&&(_0x40eda2=!0x0));if(_0x40eda2){for(const _0x1b6fb0 of _0x44c348)_0x2872a7['rename']('h'+(parseInt(_0x1b6fb0['name'][0x1])+0x1),_0x1b6fb0);}}['_isH1TagSupportEnabled'](){const {data:_0x548176,editing:_0x238c4e}=this['editor'],_0x3838cc=_0x548176['htmlProcessor']['toView']('<h1></h1>'),_0x405dbb=_0x548176['toView'](_0x548176['toModel'](_0x3838cc));return!!_0x238c4e['view']['domConverter']['viewToDom'](_0x405dbb)['querySelector']('h1');}['_sanitizeHTML'](_0x329ac7){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x329ac7),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x39ad81){const _0x32a52d=_0x39ad81['trim']();return _0x32a52d['startsWith']('```html')?_0x32a52d['endsWith']('```')?_0x32a52d['substring'](0x7,_0x32a52d['length']-0x3):_0x32a52d['substring'](0x7):_0x39ad81;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x5d0e2e){super(_0x5d0e2e),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x298532=>i(_0x5d0e2e,'AI_'+_0x298532['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x5d0e2e,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x5d0e2e,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x5d0e2e,'Stop'));const _0x398f08=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x398f08['if']('isVisible','ck-hidden',_0x57fb35=>!_0x57fb35)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x556e89,_0x4eb281){const _0x27efee=new _0xb1a835(this['locale']);return _0x27efee['set']({'label':_0x556e89,'class':_0x4eb281||'','isVisible':!0x0,'withText':!0x0}),_0x27efee;}}var W='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class X extends _0x24daac{['contentFieldView'];['copyButtonView'];constructor(_0x5e3f5c,_0x507c11=''){super(_0x5e3f5c),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2b1b0f=this['bindTemplate'];this['contentFieldView']=new mt(_0x5e3f5c,_0x507c11),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x2b1b0f['if']('isVisible','ck-hidden',_0x6de39f=>!_0x6de39f)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x2b1b0f['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 _0x34abe7=!0x1;this['on']('change:value',(_0xad3562,_0x2d3d44,_0x103508)=>{const _0x282ea5=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x103508),this['isProcessing']&&_0x282ea5&&!_0x34abe7&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x2b6cef,_0xbfa61f,_0x3ba101)=>{_0x34abe7=!0x1,_0x3ba101?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x34abe7=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x34abe7=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5eb4c0=this['locale'],_0x47f09c=new _0xb1a835(this['locale']),_0x39751e='ck-ai-form__copy-button';return _0x47f09c['set']({'label':i(_0x5eb4c0,'Copy'),'icon':W,'class':_0x39751e,'tooltip':!0x0}),_0x47f09c['bind']('isVisible')['to'](this,'value',_0x15df47=>!!_0x15df47),_0x47f09c['bind']('isEnabled')['to'](this,'isProcessing',_0x5c96cb=>!_0x5c96cb),_0x47f09c['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x47f09c['icon']=_0x3d5100['check'],_0x47f09c['class']=_0x39751e+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x47f09c['icon']=W,_0x47f09c['class']=_0x39751e;},0x3e8);}),_0x47f09c;}['_copyHTMLToClipboard'](_0x1bf37d){const {window:_0x245397,document:_0x2010ac}=_0x213c0d;if(_0x245397['ClipboardItem']){const {Blob:_0x22853f,ClipboardItem:_0x1ae8e3}=_0x245397,_0xf34154=[new _0x1ae8e3({'text/html':new _0x22853f([_0x1bf37d['innerHTML']],{'type':'text/html'}),'text/plain':new _0x22853f([_0x1bf37d['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0xf34154);}else{const _0x16fdb4=_0x2010ac['createElement']('div');_0x16fdb4['style']['position']='absolute',_0x16fdb4['style']['left']='-9999px',_0x16fdb4['innerHTML']='<span>[</span>'+_0x1bf37d['innerHTML']+'<span>]</span>',_0x2010ac['body']['appendChild'](_0x16fdb4);const _0x3011b3=_0x2010ac['createRange']();_0x3011b3['setStartAfter'](_0x16fdb4['firstElementChild']),_0x3011b3['setEndBefore'](_0x16fdb4['lastElementChild']);const _0x25417b=_0x245397['getSelection']();_0x25417b['removeAllRanges'](),_0x25417b['addRange'](_0x3011b3),_0x2010ac['execCommand']('copy'),_0x16fdb4['remove']();}}}class mt extends _0x24daac{constructor(_0x5a7ba0,_0x16711b=''){super(_0x5a7ba0),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x16711b,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x41e40e){this['element']['innerHTML']=_0x41e40e;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x585bd0=new _0x24daac(),_0x5dba5e=this['locale'],_0xe5792a=new _0x198eaa();return _0xe5792a['isVisible']=!0x0,_0x585bd0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0xe5792a,{'text':i(_0x5dba5e,'AI\x20is\x20writing...')}]}),_0x585bd0['render'](),_0x585bd0;}}class rt extends _0x24daac{constructor(_0x564ecc,_0x3ef3d5=''){super(_0x564ecc);const _0x3b63a6=new _0x780b05(),_0x7244ed=this['bindTemplate'];this['set']('text',_0x3ef3d5),_0x3b63a6['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x3b63a6,{'text':_0x7244ed['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x3f1dd1,_0x22fa64){super(_0x3f1dd1,_0x22fa64),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',(_0x51c239,_0x31a8f1)=>{_0x51c239['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x31a8f1());});}['_createSubmitButton'](){const _0x5c73cb=new _0xb1a835(this['locale']),_0x3d07f0=this['locale'];return _0x5c73cb['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x3d07f0,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x5c73cb['on']('execute',()=>{this['submit']();}),_0x5c73cb['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x565a70,_0x58a80d)=>!_0x565a70&&_0x58a80d),_0x5c73cb;}['_createShowHistoryButton'](){const _0x3eba12=new _0xb1a835(this['locale']),_0x274897=this['resultsView'],_0x4c61a8=this['locale'];_0x3eba12['set']({'label':i(_0x4c61a8,'History'),'withText':!0x1,'icon':_0x3d5100['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3eba12['bind']('isOn')['to'](_0x274897,'isVisible'),_0x3eba12['bind']('isEnabled')['to'](this,'isEnabled'),_0x3eba12['on']('execute',()=>{_0x274897['isVisible']=!_0x274897['isVisible'],_0x274897['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2a6c99=()=>{_0x213c0d['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x4ef491=new st(this['queryView']['fieldView']['element']),_0x1574dd=_0x4ef491['width'],_0xf52399='rtl'===_0x4c61a8['uiLanguageDirection']?'left':'right';_0x4ef491['excludeScrollbarsAndBorders'](),_0x3eba12['element']['style'][_0xf52399]=_0x1574dd-_0x4ef491['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2a6c99),this['on']('render',_0x2a6c99),_0x3eba12;}['submit'](){const _0x58ab22=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x58ab22);}['focus'](_0x102fc3){-0x1===_0x102fc3?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x54295f){super(_0x54295f),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x54295f,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4f18f5=0x0;for(const _0x3131e0 of this['items'])_0x4f18f5+=_0x3131e0['items']['length'];return{'resultsCount':_0x4f18f5,'totalItemsCount':_0x4f18f5};}['_createClearHistoryButton'](){const _0x378fc6=this['locale'],_0x29c919=new _0xb1a835(this['locale']);return _0x29c919['set']({'label':'('+i(_0x378fc6,'Clear')+')','withText':!0x0}),_0x29c919['on']('execute',()=>this['fire']('clearHistory')),_0x29c919;}}class hs extends _0x231fd2{constructor(_0x415114){super();const _0x512844=new te(),_0x4335c4=new _0xb1a835(this['locale'],_0x512844);this['children']['add'](_0x4335c4),_0x4335c4['set']({'label':_0x415114['prompt'],'withText':!0x0}),_0x4335c4['on']('execute',()=>{this['fire']('execute',{'value':_0xc46e0c(_0x415114['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x4cabb9{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4e4955,_0xf171db)=>{const _0x1bcd49=Ss(_0xf171db['prompt']);for(const _0x3f375f of this)if(_0x3f375f!=_0xf171db&&Ss(_0x3f375f['prompt'])===_0x1bcd49){this['remove'](_0x3f375f);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x3fdbb9=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x3fdbb9));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x5580af=>_0x5580af)));}}function Ss(_0x2a6423){return _0x2a6423['toLowerCase']()['trim']();}class k extends _0x24daac{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x130ee1,_0x2a9e85,_0x25c29a=''){super(_0x130ee1),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 os(),this['errorView']=new rt(_0x130ee1),this['contentArea']=new X(_0x130ee1,_0x25c29a),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 _0x33c50d(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x3dc487({'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 _0x4dfe3f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x2a9e85],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x4dfe3f['if']('isError','ck-hidden',_0x9384=>!_0x9384)]},'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'](_0x7debf8=0x1){-0x1===_0x7debf8?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 _0x58bf5f=this['locale'],_0xabe433=new ht(_0x58bf5f,{'queryView':{'label':i(_0x58bf5f,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x4b1830,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x58bf5f,'Empty\x20history'),'secondary':i(_0x58bf5f,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xabe433['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2916fc,_0x52ce9f)=>_0x2916fc&&!_0x52ce9f),this['listenTo'](_0xabe433,'submit',(_0x458949,_0x1cc485)=>{this['prompt']=_0x1cc485;const _0x53d051=_0x574ba3(_0x1cc485);this['fire']('submitPrompt',_0x53d051),_0x1cc485['trim']()&&this['_promptHistory']['add']({'prompt':_0x53d051},0x0);},{'priority':'high'}),_0xabe433;}['_createHistoryView'](){const _0x495abf=new rs(this['locale']);return _0x495abf['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x495abf['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x495abf;}['_createToolbar'](){const _0x2a0aba=new at(this['locale']);return _0x2a0aba['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5f2b96,_0x252337,_0x1e8ee7)=>_0x5f2b96&&!_0x252337&&!!_0x1e8ee7),_0x2a0aba['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2a0aba['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4217b1,_0x25d6d3,_0x163bf3)=>_0x4217b1&&!_0x25d6d3&&!!_0x163bf3),_0x2a0aba['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2a0aba['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1c5983,_0x45210a)=>_0x1c5983&&!_0x45210a),_0x2a0aba['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2a0aba['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2a0aba['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2a0aba;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x81ef08=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x81ef08,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x242d22){const _0x40b77e=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x242d22||i(_0x40b77e,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var T='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const w=globalThis['DataTransfer'];class n extends _0x35e6b4{['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[_0x5f4ba6,a,K,_0x41a95c];}constructor(_0x1b9f89){super(_0x1b9f89),_0x1b9f89['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1b9f89['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x1b9f89['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1b9f89['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x2503ce}=this;this['_aiAdapter']=_0x2503ce['plugins']['get'](K),this['_dialog']=_0x2503ce['plugins']['get'](_0x41a95c),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0xa423e4=new E(_0x2503ce,Array['from'](this['_commandDefinitions']['values']()));_0x2503ce['commands']['add']('showAIAssistant',_0xa423e4),_0x2503ce['ui']['componentFactory']['add']('aiCommands',_0x3b6749=>{const _0x52a507=_0x33ae9b(_0x3b6749);return _0x52a507['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x52a507['buttonView']['set']({'label':i(_0x3b6749,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x52a507['on']('execute',_0x2f46d8=>this['_onExecute'](_0x2f46d8['source']['id'])),_0xf8e484(_0x52a507,_0x2503ce['ui']['view']['body'],function(_0x4d6f62){const _0x4e0b4b=o(_0x4d6f62['config']['get']('ai.aiAssistant.commands'),_0x4d6f62['locale']),_0x1649a8=U(_0x4d6f62,_0x4e0b4b)['filter'](_0x432d71=>_0x432d71['commands']['length']);if(0x1===_0x1649a8['length'])return U(_0x4d6f62,_0x1649a8[0x0]['commands'])['map'](_0x3ca975=>({'id':_0x3ca975['id'],'label':_0x3ca975['label']}));return _0x1649a8['map'](_0x139f15=>{const {groupId:_0x333c7a,groupLabel:_0x2a7c9f,commands:_0x1f1cb6}=_0x139f15,_0x1803f6=U(_0x4d6f62,_0x1f1cb6)['map'](_0x2e4a6b=>({'id':_0x2e4a6b['id'],'label':_0x2e4a6b['label']}));return{'id':_0x333c7a,'menu':_0x2a7c9f||_0x333c7a,'children':_0x1803f6};});}(_0x2503ce),{'ariaLabel':i(_0x3b6749,'AI\x20Commands')}),_0x52a507['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0xa423e4['on']('change:enabledCommandsIds',_0x484e0e),_0x52a507['menuView']['once']('render',_0x484e0e),_0x52a507;function _0x484e0e(){_0x52a507['isEnabled']=_0xa423e4['enabledCommandsIds']['length']>0x0;for(const _0xa31753 of _0x52a507['menuView']['buttons'])_0xa31753['isEnabled']=_0xa423e4['enabledCommandsIds']['includes'](_0xa31753['id']);}}),_0x2503ce['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3b2ecf=>{const _0xee85e1=new _0x518aec(_0x3b2ecf);_0xee85e1['buttonView']['set']({'label':i(_0x3b2ecf,'AI\x20Commands'),'icon':T}),_0xee85e1['bind']('isEnabled')['to'](_0xa423e4,'enabledCommandsIds',_0x3f4db9=>_0x3f4db9['length']>0x0);const _0x4396f3=o(_0x2503ce['config']['get']('ai.aiAssistant.commands'),_0x3b2ecf);return this['_populateMenuBarMenu'](_0xa423e4,_0xee85e1,_0x4396f3,_0x12a6dc=>this['_onExecute'](_0x12a6dc)),_0xee85e1;}),_0x2503ce['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x76250a=this['_createAIAssistantUIButton'](_0xb1a835);return _0x76250a['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x76250a;}),_0x2503ce['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1502db=this['_createAIAssistantUIButton'](_0x31b645);return _0x1502db['set']({'role':'menuitemcheckbox'}),_0x1502db;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x15467d=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x155b9b;for(const _0x10a26f in _0x15467d){const _0xce5d97=_0x10a26f,_0x54264f=_0x15467d[_0xce5d97];if('aiLicenseKeyValid'==_0x54264f||'aiLicenseKeyInvalid'==_0x54264f||'aiLicenseKeyExpired'==_0x54264f||'aiLicenseKeyDomainLimit'==_0x54264f||'aiLicenseKeyNotAllowed'==_0x54264f||'aiLicenseKeyEvaluationLimit'==_0x54264f||'aiLicenseKeyTrialLimit'==_0x54264f||'aiLicenseKeyUsageLimit'==_0x54264f){delete _0x15467d[_0xce5d97],_0x155b9b=_0x54264f,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x155b9b&&_0x15467d['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x155b9b&&_0x15467d['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x155b9b&&_0x15467d['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x155b9b&&_0x15467d['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x155b9b&&_0x15467d['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x155b9b&&_0x15467d['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x155b9b&&_0x15467d['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x1d6f21='',_0x5e661d='',_0x10a7d7='custom'){const _0x1b90af=this['editor'],_0xcea1a8=_0x1b90af['editing']['view'],_0x4b4a17=_0x1b90af['plugins']['get'](a),_0x3c096e=_0x1b90af['plugins']['get'](_0x5f4ba6);_0x4b4a17['showFakeVisualSelection']();const _0x116828=new w(),_0x1568fa=new ClipboardEvent('copy',{'clipboardData':_0x116828}),_0x38914b=new _0x1b5f2b(_0x116828),_0x4ac85f=new _0x5ce0c2(_0xcea1a8,_0x1568fa,{'dataTransfer':_0x38914b});_0x3c096e['_forceMarkersCopy']('comment',()=>{_0xcea1a8['document']['fire']('copy',_0x4ac85f);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x1b90af,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x39f6b6=_0x38914b['getData']('text/html');const _0x2ec537=_0x1b90af['model']['document']['selection'],_0x43a7be=Array['from'](_0x2ec537['getRanges']());0x1===_0x43a7be['length']&&_0x43a7be[0x0]['isFlat']&&!_0x2ec537['getSelectedElement']()&&''!==_0x39f6b6['replace'](/ /g,'')['trim']()&&(_0x39f6b6='<p>'+_0x39f6b6+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x10a7d7,'query':_0x1d6f21,'htmlContent':_0x39f6b6,'label':_0x5e661d,'mainActionLabel':M[_0x1b90af['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ct['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x29ac9d['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4b4a17['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2aae77=new Map(),_0x226107=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x262557 of _0x226107)for(const _0x4cd4a8 of _0x262557['commands'])_0x2aae77['set'](_0x4cd4a8['id'],{..._0x4cd4a8,'groupId':_0x262557['groupId'],'groupLabel':_0x262557['groupLabel']||_0x262557['groupId']});return _0x2aae77;}['_createAIAssistantUIButton'](_0x34a714){const _0x213aa6=this['editor'],_0x43ed97=_0x213aa6['commands']['get']('showAIAssistant'),_0x1c4f59=new _0x34a714(_0x213aa6['locale']);return _0x1c4f59['set']({'label':i(_0x213aa6['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x1c4f59['bind']('isEnabled')['to'](_0x43ed97),_0x1c4f59['bind']('isOn')['to'](this['_dialog'],'id',_0x30b525=>'aiAssistant'===_0x30b525),this['listenTo'](_0x1c4f59,'execute',()=>{_0x1c4f59['isOn']?this['hideUI']():_0x43ed97['execute']();}),_0x1c4f59;}['_initView'](){const _0x1e5628=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x1e5628['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1e5628['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4db2cd,ui:{ariaLiveAnnouncer:_0x3df6d5}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x51100c,_0x382414,_0x55072a)=>{const _0x2ca929=this['_aiAssistantController']['currentContext'];_0x55072a?_0x3df6d5['announce'](i(_0x4db2cd,'AI\x20is\x20writing')):_0x2ca929&&_0x3df6d5['announce'](i(_0x4db2cd,'Generated\x20content:\x20%0',_0x2ca929),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x198769,_0x59abcf,_0x191480)=>{if(_0x191480){const _0x50379b=this['_formView']['errorView']['text'];_0x3df6d5['announce'](i(_0x4db2cd,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x50379b));}});}['_onExecute'](_0x17c229){const _0x5d4166=this['_commandDefinitions']['get'](_0x17c229),_0x5ec1c5=this['editor'],_0x3f28fa=_0x5ec1c5['model']['document']['selection'],_0x445f83=_0x5ec1c5['commands']['get']('showAIAssistant'),_0x378e52=_0x5ec1c5['plugins']['get'](a),_0x59e9a6=''+(_0x5d4166['groupId']!==x?_0x5d4166['groupLabel']+':\x20':'')+_0x5d4166['label'];if(!0x1!==_0x5d4166['requiresContent']&&_0x3f28fa['isCollapsed']){const _0x1704f3=_0x1bbd49(_0x3f28fa['getSelectedBlocks']())||_0x5ec1c5['model']['schema']['getLimitElement'](_0x3f28fa);_0x5ec1c5['model']['change'](_0x92aebd=>{_0x92aebd['setSelection'](_0x1704f3,'in');});}_0x378e52['showFakeVisualSelection'](),_0x445f83['execute'](_0x5d4166['prompt'],_0x59e9a6,'command:'+_0x17c229);}['_populateMenuBarMenu'](_0x37faff,_0x56362b,_0x2057ce,_0x1d4881){const _0x156584=this['editor'],_0x36db80=_0x156584['locale'],_0x5b6f31=new _0x315c2d(_0x36db80),_0x3d1b23=U(_0x156584,_0x2057ce)['filter'](_0x56f3e9=>_0x56f3e9['commands']['length']);0x1===_0x3d1b23['length']?this['_getMenuBarGroupButtons']({'command':_0x37faff,'commands':_0x3d1b23[0x0]['commands'],'parentMenuView':_0x56362b,'onExecute':_0x1d4881})['forEach'](_0x1c1180=>_0x5b6f31['items']['add'](_0x1c1180)):_0x3d1b23['forEach'](({groupId:_0x428eb4,groupLabel:_0x1605b3,commands:_0x649c89})=>{const _0x347507=new _0x1e2e1d(_0x36db80,_0x56362b),_0x49bfa7=new _0x518aec(_0x36db80),_0x48a8d3=new _0x315c2d(_0x36db80),_0x2550ad=this['_getMenuBarGroupButtons']({'command':_0x37faff,'commands':_0x649c89,'parentMenuView':_0x49bfa7,'onExecute':_0x1d4881});_0x49bfa7['buttonView']['set']({'label':_0x1605b3||_0x428eb4}),_0x49bfa7['delegate']('execute')['to'](_0x56362b),_0x48a8d3['items']['addMany'](_0x2550ad),_0x49bfa7['panelView']['children']['add'](_0x48a8d3),_0x347507['children']['add'](_0x49bfa7),_0x5b6f31['items']['add'](_0x347507);}),_0x56362b['panelView']['children']['add'](_0x5b6f31);}['_getMenuBarGroupButtons']({command:_0x103b3f,commands:_0x3f7c50,parentMenuView:_0xf61823,onExecute:_0x5cf913}){const _0x43e3f7=this['editor'],_0x312376=_0x43e3f7['locale'];return U(_0x43e3f7,_0x3f7c50)['map'](_0x1a8e64=>{const _0x721347=new _0x1e2e1d(_0x312376,_0xf61823),_0x550135=new _0x31b645(_0x312376);return _0x550135['set']({'label':_0x1a8e64['label']}),_0x550135['delegate']('execute')['to'](_0xf61823),_0x550135['on']('execute',()=>_0x5cf913(_0x1a8e64['id'])),_0x550135['bind']('isEnabled')['to'](_0x103b3f,'enabledCommandsIds',_0x368d89=>_0x368d89['includes'](_0x1a8e64['id'])),_0x721347['children']['add'](_0x550135),_0x721347;});}}function B(_0x2ea890,_0x5952b3){return void 0x0!==_0x2ea890['order']&&void 0x0===_0x5952b3['order']?0x1:void 0x0===_0x2ea890['order']&&void 0x0!==_0x5952b3['order']?-0x1:void 0x0!==_0x2ea890['order']&&void 0x0!==_0x5952b3['order']?_0x2ea890['order']-_0x5952b3['order']:0x0;}function U(_0x3606fe,_0x10ac9a){_0x10ac9a['sort'](B);const _0x1be9e8={},_0x38384a=[];for(const _0xa05aa0 of _0x10ac9a)if(void 0x0!==_0xa05aa0['order']){if(_0xa05aa0['order']in _0x1be9e8)throw new _0x5214d7('ai-commands-config-order-collision',_0x3606fe,{'conflictingDefinitions':[_0xa05aa0,_0x1be9e8[_0xa05aa0['order']]]});_0x1be9e8[_0xa05aa0['order']]=_0xa05aa0,_0x38384a['splice'](_0xa05aa0['order'],0x0,_0xa05aa0);}else _0x38384a['push'](_0xa05aa0);return _0x38384a;}class r extends _0x35e6b4{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x506f07){super(_0x506f07);const _0x2f4f44=_0x506f07['config'],_0x358ca6=_0x506f07['locale'];_0x2f4f44['define']('ai.aiAssistant.preserveComments',!0x0),_0x2f4f44['define']('ai.aiAssistant.commands',function(_0x176b3e){return[{'groupId':'editOrReview','groupLabel':i(_0x176b3e,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x176b3e,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x176b3e,'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(_0x176b3e,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x176b3e,'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(_0x176b3e,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x176b3e,'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(_0x176b3e,'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(_0x176b3e,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x176b3e,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x176b3e,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x176b3e,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x176b3e,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x176b3e,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x176b3e,'Change\x20style'),'commands':[{'id':'business','label':i(_0x176b3e,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x176b3e,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x176b3e,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x176b3e,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x176b3e,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x176b3e,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x176b3e,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x176b3e,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x176b3e,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x176b3e,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x176b3e,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x176b3e,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x176b3e,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x358ca6)),_0x2f4f44['define']('ai.aiAssistant.extraCommandGroups',[]),_0x2f4f44['define']('ai.aiAssistant.removeCommands',[]);let _0x4823c0=o(_0x2f4f44['get']('ai.aiAssistant.commands'),_0x358ca6);const _0x223b2e=_0x2f4f44['get']('ai.aiAssistant.extraCommandGroups'),_0x3f5209=_0x2f4f44['get']('ai.aiAssistant.removeCommands');_0x223b2e['forEach'](_0x295ace=>{const _0x403b2c=_0x4823c0['find'](_0x550cd8=>_0x550cd8['groupId']===_0x295ace['groupId']);_0x403b2c?_0x403b2c['commands']=_0x403b2c['commands']['concat'](_0x295ace['commands']):_0x4823c0['push'](_0x295ace);}),_0x4823c0=_0x4823c0['filter'](_0x734ffe=>!_0x3f5209['includes'](_0x734ffe['groupId'])),_0x4823c0['forEach'](_0x3b9ae0=>{_0x3b9ae0['commands']=_0x3b9ae0['commands']['filter'](_0x112c38=>!_0x3f5209['includes'](_0x112c38['id']));}),_0x2f4f44['set']('ai.aiAssistant.commands',_0x4823c0);}}class P extends _0x35e6b4{['abortController'];static get['requires'](){return[K];}constructor(_0x28bc61){super(_0x28bc61),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x34cd1d){return this['sendRequest'](_0x34cd1d)['catch'](_0x2e0942=>{if(_0x2e0942 instanceof R)return Promise['reject'](_0x2e0942);if('AbortError'==_0x2e0942['name'])return Promise['resolve']();throw console['error'](_0x2e0942),new _0x5214d7('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1cf5e3,_0x2039a7){const _0x39bead=this['editor']['locale'],_0x56f36f={'Content-Type':'application/json'};if('object'==typeof _0x1cf5e3)Object['assign'](_0x56f36f,_0x1cf5e3);else{if(_0x1cf5e3)try{const _0x19f176=await _0x1cf5e3(_0x2039a7);Object['assign'](_0x56f36f,_0x19f176);}catch(_0x1067f0){return Promise['reject'](new R(i(_0x39bead,'AI_ERROR_GET_HEADERS')));}}return _0x56f36f;}async['_prepareRequestParameters'](_0x2bf8d0,_0x289299){const _0x39b13a=this['editor']['locale'];if('object'==typeof _0x2bf8d0)return _0x2bf8d0;try{return await _0x2bf8d0(_0x289299);}catch(_0x329da6){return Promise['reject'](new R(i(_0x39b13a,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x248536){super(_0x248536),_0x248536['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x248536['config']['get']('ai.openAI.requestParameters')||_0x248536['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x248536['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x248536['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x248536['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x86d1bb,context:_0x47afe3,onData:_0x226961,actionId:_0x4ced1c}){const _0x430a27=this['editor']['locale'],_0x4cc91a=await this['prepareMessages'](_0x86d1bb,_0x47afe3,_0x4ced1c),_0x3a738a=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4ced1c),_0x51d526=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4ced1c),_0x4c8aac={'messages':_0x4cc91a,..._0x51d526},_0x29adbf={'method':'POST','headers':_0x3a738a,'body':JSON['stringify'](_0x4c8aac),'signal':this['abortController']['signal']},_0x12cf24=await fetch(this['_apiUrl'],_0x29adbf);if(_0x12cf24['ok'])return _0x51d526['stream']?await this['_readStreamableResponse'](_0x12cf24,_0x226961):await this['_readStaticResponse'](_0x12cf24,_0x226961),Promise['resolve']();{const _0x469133=await _0x12cf24['text']();return _0x469133['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x430a27,'AI_ERROR_CONTEXT_LENGTH'))):_0x469133['includes']('Moderation')?Promise['reject'](new R(i(_0x430a27,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x469133));}}async['prepareMessages'](_0x562fc4,_0x1e5d0e,_0xfea821){let _0x4c7e55,_0x4df732;return _0x1e5d0e?(_0x4c7e55='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.',_0x4df732='Instruction:\x0a'+_0x562fc4+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1e5d0e):(_0x4c7e55='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.',_0x4df732=_0x562fc4),[{'role':'system','content':_0x4c7e55},{'role':'user','content':_0x4df732}];}async['_readStreamableResponse'](_0x29f6bd,_0x80553){const _0x4f0dbc=_0x29f6bd['body']['getReader'](),_0x5ceab2=new TextDecoder();let _0x5eaf07='',_0x3ea669='',_0x42a397='',_0xce3ea=!0x1;for(;!_0xce3ea;){const {done:_0x22ffce,value:_0x55760e}=await _0x4f0dbc['read'](),_0x3691a0=_0x5eaf07+_0x5ceab2['decode'](_0x55760e);let _0x4835af='';_0xce3ea=_0x22ffce;try{_0x4835af=this['_cleanUpData'](_0x3691a0),_0x5eaf07='';}catch(_0x3b4c76){_0x5eaf07=_0x3691a0;continue;}_0x3ea669+=_0x4835af,!_0xce3ea&&this['_isBufferIncomplete'](_0x3ea669)||_0x3ea669&&(_0x42a397+=_0x3ea669,_0x3ea669='',_0x80553(_0x42a397));}return Promise['resolve']();}async['_readStaticResponse'](_0x551502,_0x108790){return _0x108790((await _0x551502['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x296f24){const _0x30617a=_0x296f24['split']('<')['length']!==_0x296f24['split']('>')['length'],_0x36382a=_0x296f24['length']<0x1e;return _0x30617a&&_0x36382a;}['_cleanUpData'](_0x16f66d){return _0x16f66d['split'](/\n(?![^{]*\})/g)['map'](_0x578c23=>_0x578c23['replace']('data:\x20',''))['filter'](_0x598b60=>_0x598b60&&_0x598b60['length']>0x0&&'[DONE]'!==_0x598b60)['map'](_0x3a1356=>{const {choices:_0x1a9a1a}=JSON['parse'](_0x3a1356);if(_0x1a9a1a[0x0]&&_0x1a9a1a[0x0]['delta']&&_0x1a9a1a[0x0]['delta']['content'])return _0x1a9a1a[0x0]['delta']['content'];})['filter'](_0x5b5109=>_0x5b5109)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2a64c5){super(_0x2a64c5),_0x2a64c5['config']['get']('ai.aws.requestParameters')||_0x2a64c5['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']=_0x2a64c5['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x2a64c5['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2a64c5['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x2a64c5['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x2cbdcc,context:_0xb50f1a,onData:_0x42dd4a,actionId:_0x1cdcfe}){const {model:_0x1c7bdf,stream:_0x1afe9c,..._0x5c2440}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1cdcfe),_0x292a6c={'prompt':await this['preparePrompt'](_0x2cbdcc,_0xb50f1a,_0x1c7bdf,_0x1cdcfe),..._0x5c2440};this['_apiUrl']?await this['_processProxyRequest'](_0x292a6c,_0x1c7bdf,_0x1afe9c,_0x42dd4a,_0x1cdcfe):await this['_processAWSRequest'](_0x292a6c,_0x1c7bdf,_0x1afe9c,_0x42dd4a);}async['preparePrompt'](_0x3fea8c,_0x1cd83e,_0x57a4ea,_0x49b35c){let _0x40203d,_0x127866;return _0x1cd83e?(_0x40203d='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.',_0x127866='Instruction:\x0a'+_0x3fea8c+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1cd83e):(_0x40203d='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.',_0x127866=_0x3fea8c),'meta.llama'==this['getModelFamily'](_0x57a4ea)?'<<SYS>>\x0a'+_0x40203d+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x127866+'\x0a[/INST]':'Human:\x0a'+_0x40203d+'\x0a'+_0x127866+'\x0a\x0aAssistant:';}['getModelFamily'](_0x36c01f){if(/^anthropic\.claude/['test'](_0x36c01f))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x36c01f))return'ai21.j2';if(/^cohere\.command/['test'](_0x36c01f))return'cohere.command';if(/^meta\.llama/['test'](_0x36c01f))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x36c01f));}async['_processProxyRequest'](_0x4b022b,_0x7972b4,_0x3d34e4,_0x121de0,_0x4b58b6){const _0x2efaf4={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4b58b6),'body':JSON['stringify']({..._0x4b022b,'model':_0x7972b4,'stream':_0x3d34e4}),'signal':this['abortController']['signal']},_0x1a25a7=await fetch(this['_apiUrl'],_0x2efaf4);_0x3d34e4?await this['_readStreamableResponse'](_0x1a25a7,_0x7972b4,_0x121de0):await this['_readStaticResponse'](_0x1a25a7,_0x7972b4,_0x121de0);}async['_processAWSRequest'](_0x512001,_0x5e1c5f,_0x41db58,_0x4e5368){const _0x561e1e=new _0x1df7f4(this['_bedrockClientConfig']),_0x1f9637={'body':JSON['stringify'](_0x512001),'contentType':'application/json','accept':'application/json','modelId':_0x5e1c5f};let _0x422b9a;if(_0x41db58){const _0x477957=new _0x45becd(_0x1f9637);_0x422b9a=await _0x561e1e['send'](_0x477957,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x422b9a,_0x5e1c5f,_0x4e5368);}else{const _0x51a950=new _0x5898f7(_0x1f9637);_0x422b9a=await _0x561e1e['send'](_0x51a950,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x422b9a,_0x5e1c5f,_0x4e5368);}}async['_readAsyncIterableResponse'](_0x4e8541,_0x2a9884,_0x39118b){const _0x1667b7=_0x4e8541['body'],_0x198e4a=new TextDecoder('utf-8');let _0x75a377='';for await(const _0x99fb29 of _0x1667b7)if(_0x99fb29['chunk']){const _0x3005c2=_0x198e4a['decode'](_0x99fb29['chunk']['bytes']),_0x4a53fa=JSON['parse'](_0x3005c2);_0x75a377+=this['_getGeneratedText'](_0x4a53fa,_0x2a9884),_0x39118b(_0x75a377);}return Promise['resolve']();}async['_readStreamableResponse'](_0xf1343b,_0x3f2aad,_0x1d7e9d){const _0x1147f2=_0xf1343b['body'],_0x4db7d0=new TextDecoder('utf-8'),_0x386a92=_0x1147f2['getReader']();let _0x30486b='',_0x106044='',_0x4d4674=!0x1;for(;!_0x4d4674;){const {done:_0x4996c1,value:_0xa30190}=await _0x386a92['read']();if(_0x4d4674=_0x4996c1,_0x4d4674)break;const _0xc33320=(_0x30486b+_0x4db7d0['decode'](_0xa30190))['split']('\x0a')['map'](_0x261e9b=>{try{return _0x30486b='',JSON['parse'](_0x261e9b);}catch(_0x28c8c0){return _0x30486b=_0x261e9b,null;}})['filter'](_0x3dc211=>null!==_0x3dc211);_0xc33320['length']&&(_0x106044+=_0xc33320['map'](_0x41d1e8=>this['_getGeneratedText'](_0x41d1e8,_0x3f2aad))['join'](''),_0x1d7e9d(_0x106044));}return Promise['resolve']();}async['_readStaticResponse'](_0x5542f7,_0x5aefe0,_0x43bc69){let _0x48a687;return _0x48a687=_0x5542f7 instanceof Response?await _0x5542f7['json']():JSON['parse'](Buffer['from'](_0x5542f7['body'])['toString']('utf8')),(_0x43bc69(this['_getGeneratedText'](_0x48a687,_0x5aefe0)),Promise['resolve']());}['_getGeneratedText'](_0x3bbf28,_0x185aac){switch(this['getModelFamily'](_0x185aac)){case'anthropic.claude':return _0x3bbf28['completion'];case'ai21.j2':return _0x3bbf28['completions'][0x0]['data']['text'];case'cohere.command':return _0x3bbf28['generations'][0x0]['text'];case'meta.llama':return _0x3bbf28['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
package/dist/translations/af.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':
|
|
23
|
+
export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x463ecc=>0x1!=_0x463ecc}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x340e11=>{const {af:{dictionary:_0x24fd88,getPluralForm:_0xc4d1cd}}={'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x33cddc=>0x1!=_0x33cddc}};_0x340e11['af']||={'dictionary':{},'getPluralForm':null},_0x340e11['af']['dictionary']=Object['assign'](_0x340e11['af']['dictionary'],_0x24fd88),_0x340e11['af']['getPluralForm']=_0xc4d1cd;})(window['CKEDITOR_TRANSLATIONS']||={});
|
package/dist/translations/ar.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':
|
|
23
|
+
export default{'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':_0x1ad4ee=>0x0==_0x1ad4ee?0x0:0x1==_0x1ad4ee?0x1:0x2==_0x1ad4ee?0x2:_0x1ad4ee%0x64>=0x3&&_0x1ad4ee%0x64<=0xa?0x3:_0x1ad4ee%0x64>=0xb?0x4:0x5}};
|