@ckeditor/ckeditor5-ai 44.3.0-alpha.0 → 44.3.0-alpha.1
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 _0x2df1c9,Command as _0x43f027,icons as _0x1d77a9}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x482414,CKEditorError as _0x20fe4c,ObservableMixin as _0x43ba7f,global as _0x2035af,isVisible as it,Rect as st,Collection as _0x802b10,FocusTracker as _0x55f37d,KeystrokeHandler as ts,first as _0x4d1f1b}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x286689,View as _0x5a0a27,SpinnerView as _0x33b1d6,IconView as _0x575ffd,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x476cb0,ButtonLabelView as te,FocusCycler as _0x42935d,createLabeledTextarea as _0x3b7956,Dialog as _0xec6ecf,createDropdown as _0x1942a8,addMenuToDropdown as _0x47d818,MenuBarMenuView as _0x310226,MenuBarMenuListItemButtonView as _0x3bc795,DialogViewPosition as _0x31289f,MenuBarMenuListView as _0x28f541,MenuBarMenuListItemView as _0x5e14a6}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x1dc24a,ClipboardMarkersUtils as _0x35e822}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x3e6fe3,DataTransfer as _0x302572,UpcastWriter as _0x133b37,Matcher as _0x39bec5}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x13b18a,escape as _0x306991}from'lodash-es';import{BedrockRuntimeClient as _0x15759a,InvokeModelWithResponseStreamCommand as _0x379557,InvokeModelCommand as _0x144e6f}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x470344,_0x6d2208){const _0x94ba67=(0x0,_0x6d2208['t'])('Other');return _0x470344['length']?'groupId'in _0x470344[0x0]?_0x470344:[{'groupId':x,'groupLabel':_0x94ba67,'order':0x1/0x0,'commands':_0x470344}]:[{'groupId':x,'groupLabel':_0x94ba67,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x2df1c9{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1405ab}=this,_0x328de7=['ck-fake-ai-selection'];_0x1405ab['config']['get']('ai.useTheme')&&_0x328de7['push']('ck-ai-assistant-ui_theme'),_0x1405ab['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x328de7,'priority':0xc}}),_0x1405ab['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x13d24b,{writer:_0x5338cf})=>{if(!_0x13d24b['markerRange']['isCollapsed'])return null;const _0x3cb77d=_0x5338cf['createUIElement']('span');return _0x5338cf['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3cb77d),_0x3cb77d;}});}['afterInit'](){!async function(_0xa155be){const _0x260155=_0x2f802e([0x57,0x4b,0x6a,0x50,0x45,0x5a,0x76,0x75,0x63,0x78,0x65,0x49,0x30,0x67,0x74,0x7a,0x31,0x4d,0x4a,0x42,0x6c,0x64,0x36,0x68,0x73,0x51,0x37,0x41,0x6b,0x66,0x39,0x77,0x6e,0x48,0x43,0x70,0x35,0x59,0x71,0x38,0x46,0x72,0x54,0x4e,0x62,0x69,0x58,0x79,0x32,0x33,0x56,0x6d,0x6f,0x52,0x47,0x61,0x53,0x4f,0x34,0x44,0x4c,0x55]),_0x1bed53=0x4f81245d,_0x1c11f9=0x4f8644c5^_0x1bed53,_0x579ed6=window[_0x2f802e([0x44,0x61,0x74,0x65])][_0x2f802e([0x6e,0x6f,0x77])](),_0x40f82b=_0xa155be[_0x2f802e([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x18fd1a=new window[(_0x2f802e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2149c0=>{_0x40f82b[_0x2f802e([0x6f,0x6e,0x63,0x65])](_0x2f802e([0x72,0x65,0x61,0x64,0x79]),_0x2149c0);}),_0x47a4e0={[_0x2f802e([0x6b,0x74,0x79])]:_0x2f802e([0x45,0x43]),[_0x2f802e([0x75,0x73,0x65])]:_0x2f802e([0x73,0x69,0x67]),[_0x2f802e([0x63,0x72,0x76])]:_0x2f802e([0x50,0x2d,0x32,0x35,0x36]),[_0x2f802e([0x78])]:_0x2f802e([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]),[_0x2f802e([0x79])]:_0x2f802e([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]),[_0x2f802e([0x61,0x6c,0x67])]:_0x2f802e([0x45,0x53,0x32,0x35,0x36])},_0x9ca0df=_0x40f82b[_0x2f802e([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2f802e([0x67,0x65,0x74])](_0x2f802e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x53f115(){let _0x21ec0c,_0x4ecfe2=null,_0x154163=null;try{if(_0x9ca0df==_0x2f802e([0x47,0x50,0x4c]))return _0x2f802e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x21ec0c=_0x553bba(),!_0x21ec0c)return _0x2f802e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x21ec0c[_0x2f802e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x154163=_0x30d4a0(_0x21ec0c[_0x2f802e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x21ec0c[_0x2f802e([0x6a,0x74,0x69])])),await _0x2f0463()?_0x536dc1()?_0x469feb()?_0x2f802e([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4cea25()?(_0x21ec0c[_0x2f802e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2f802e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4ecfe2=_0x5bc625(_0x2f802e([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x21ec0c[_0x2f802e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2f802e([0x74,0x72,0x69,0x61,0x6c])&&(_0x4ecfe2=_0x5bc625(_0x2f802e([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0xd97e6b()):_0x2f802e([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2f802e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2f802e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x4f18b8){return _0x2f802e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x469feb(){const _0x59356a=[_0x2f802e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2f802e([0x74,0x72,0x69,0x61,0x6c])][_0x2f802e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x21ec0c[_0x2f802e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x579ed6/0x3e8:0xe10*_0x1c11f9;return _0x21ec0c[_0x2f802e([0x65,0x78,0x70])]<_0x59356a;}function _0x536dc1(){const _0x517fcc=_0x21ec0c[_0x2f802e([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x517fcc&&(!!_0x517fcc[_0x2f802e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2f802e([0x2a]))||!!_0x517fcc[_0x2f802e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2f802e([0x41,0x49])));}function _0x4cea25(){const _0x3e7bf1=_0x21ec0c[_0x2f802e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3e7bf1||0x0==_0x3e7bf1[_0x2f802e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x3d7bbb}=new URL(window[_0x2f802e([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3e7bf1[_0x2f802e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3d7bbb))return!0x0;const _0x3a50d8=_0x3d7bbb[_0x2f802e([0x73,0x70,0x6c,0x69,0x74])](_0x2f802e([0x2e]));return _0x3e7bf1[_0x2f802e([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x395897=>_0x395897[_0x2f802e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2f802e([0x2a])))[_0x2f802e([0x6d,0x61,0x70])](_0x368d1a=>_0x368d1a[_0x2f802e([0x73,0x70,0x6c,0x69,0x74])](_0x2f802e([0x2e])))[_0x2f802e([0x73,0x6f,0x6d,0x65])](_0x5ad14c=>_0x3a50d8[_0x2f802e([0x65,0x76,0x65,0x72,0x79])]((_0x39cb50,_0x3ee50c)=>_0x5ad14c[_0x3ee50c]===_0x39cb50||_0x5ad14c[_0x3ee50c]===_0x2f802e([0x2a])));}function _0xd97e6b(){return _0x4ecfe2&&_0x154163?new window[(_0x2f802e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2954ce,_0x2f6efe)=>{_0x4ecfe2[_0x2f802e([0x74,0x68,0x65,0x6e])](_0x2954ce,_0x2f6efe),_0x154163[_0x2f802e([0x74,0x68,0x65,0x6e])](_0x21853c=>{_0x21853c!=_0x2f802e([0x56,0x61,0x6c,0x69,0x64])&&_0x2954ce(_0x21853c);},_0x2f6efe);}):_0x4ecfe2||_0x154163||_0x2f802e([0x56,0x61,0x6c,0x69,0x64]);}}function _0x30d4a0(_0x3d8932,_0x2aaff4){return new window[(_0x2f802e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x13c785=>{if(_0x5aed3b())return _0x13c785(_0x2f802e([0x56,0x61,0x6c,0x69,0x64]));_0x44e1de(),_0x40f82b[_0x2f802e([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2f802e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1bdef0=!0x1;const _0x4b96db=_0x482414();function _0x96127a(_0x196895){return!!_0x196895&&(typeof _0x196895===_0x2f802e([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x196895===_0x2f802e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x196895[_0x2f802e([0x74,0x68,0x65,0x6e])]===_0x2f802e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x196895[_0x2f802e([0x63,0x61,0x74,0x63,0x68])]===_0x2f802e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x697c48(_0x17f29a){_0x32bd7a(_0x17f29a)[_0x2f802e([0x74,0x68,0x65,0x6e])](_0x310f89=>{if(!_0x310f89||_0x310f89[_0x2f802e([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2f802e([0x6f,0x6b]))return _0x2f802e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4ab138(_0x3a1433(_0x4b96db+_0x2aaff4))!=_0x310f89[_0x2f802e([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2f802e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2f802e([0x56,0x61,0x6c,0x69,0x64]);})[_0x2f802e([0x74,0x68,0x65,0x6e])](_0x150e17=>(_0x4d8746(),_0x150e17),()=>{const _0x17e855=_0x118e06();return null==_0x17e855?(_0x4d8746(),_0x2f802e([0x56,0x61,0x6c,0x69,0x64])):_0x2f802e(_0x579ed6-_0x17e855>(0x6b8da05d^_0x1bed53)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2f802e([0x74,0x68,0x65,0x6e])](_0x13c785)[_0x2f802e([0x63,0x61,0x74,0x63,0x68])](()=>{_0x13c785(_0x2f802e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x27f1df=0x4fb7cadd^_0x1bed53;function _0x4d8746(){const _0x3e7f4f=_0x2f802e([0x6c,0x6c,0x63,0x74,0x2d])+_0x4ab138(_0x3a1433(_0x3d8932)),_0x33300f=_0x5bd671(_0x4ab138(window[_0x2f802e([0x4d,0x61,0x74,0x68])][_0x2f802e([0x63,0x65,0x69,0x6c])](_0x579ed6/_0x27f1df)));window[_0x2f802e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2f802e([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3e7f4f,_0x33300f);}function _0x118e06(){const _0x160d1a=_0x2f802e([0x6c,0x6c,0x63,0x74,0x2d])+_0x4ab138(_0x3a1433(_0x3d8932)),_0x4289a8=window[_0x2f802e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2f802e([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x160d1a);return _0x4289a8?window[_0x2f802e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5bd671(_0x4289a8),0x10)*_0x27f1df:null;}function _0x32bd7a(_0x5bbc96){return new window[(_0x2f802e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x39a7e1,_0x5f0e63)=>{_0x5bbc96[_0x2f802e([0x74,0x68,0x65,0x6e])](_0x39a7e1,_0x5f0e63),window[_0x2f802e([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x5f0e63,0x4f80f09d^_0x1bed53);});}}_0x40f82b[_0x2f802e([0x6f,0x6e])](_0x2f802e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5168b0,_0x12fd93)=>{if(_0x12fd93[0x0]!=_0x3d8932)return _0x13c785(_0x2f802e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x12fd93[0x1]={..._0x12fd93[0x1],[_0x2f802e([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x4b96db};},{[_0x2f802e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2f802e([0x68,0x69,0x67,0x68])}),_0x40f82b[_0x2f802e([0x6f,0x6e])](_0x2f802e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3d213e=>{_0x96127a(_0x3d213e[_0x2f802e([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1bdef0=!0x0,_0x697c48(_0x3d213e[_0x2f802e([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2f802e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2f802e([0x6c,0x6f,0x77])}),_0x18fd1a[_0x2f802e([0x74,0x68,0x65,0x6e])](()=>{_0x1bdef0||_0x13c785(_0x2f802e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5aed3b(){return _0x40f82b[_0x2f802e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2f802e([0x76,0x69,0x65,0x77])][_0x2f802e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2f802e([0x61,0x75,0x74,0x6f]);}function _0x44e1de(){_0x40f82b[_0x2f802e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2f802e([0x76,0x69,0x65,0x77])][_0x2f802e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2f802e([0x61,0x75,0x74,0x6f]);}}function _0x5bc625(_0x49f848){const _0x4a5b1f=[new window[(_0x2f802e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x35c032=>setTimeout(_0x35c032,0x4f881a91^_0x1bed53)),_0x18fd1a[_0x2f802e([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2f802e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x41a52a=>{let _0x388e05=0x0;_0x40f82b[_0x2f802e([0x6d,0x6f,0x64,0x65,0x6c])][_0x2f802e([0x6f,0x6e])](_0x2f802e([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x22a015,_0x2a98db)=>{_0x2a98db[0x0][_0x2f802e([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x388e05++,_0x388e05==(0x4f8125a5^_0x1bed53)&&(_0x41a52a(),_0x22a015[_0x2f802e([0x6f,0x66,0x66])]());});}))];return window[_0x2f802e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2f802e([0x72,0x61,0x63,0x65])](_0x4a5b1f)[_0x2f802e([0x74,0x68,0x65,0x6e])](()=>_0x49f848);}async function _0x259222(){await _0x18fd1a,_0x40f82b[_0x2f802e([0x6d,0x6f,0x64,0x65,0x6c])][_0x2f802e([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x10502e,_0x40f82b[_0x2f802e([0x6d,0x6f,0x64,0x65,0x6c])][_0x2f802e([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x10502e,_0x40f82b[_0x2f802e([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2f802e([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x378a5a(_0x1759d2){const _0x2cd82d=_0x1c76b2();_0x40f82b[_0x2cd82d]=_0x2f802e([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x1759d2,_0x1759d2!=_0x2f802e([0x56,0x61,0x6c,0x69,0x64])&&_0x259222();}function _0x1c76b2(){const _0x2eddf8=window[_0x2f802e([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2f802e([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2f802e([0x6e,0x6f,0x77])]())[_0x2f802e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2f802e([0x2e]),'');let _0x4672f8=_0x2f802e([0x57]);for(let _0x410b20=0x0;_0x410b20<_0x2eddf8[_0x2f802e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x410b20+=0x2){let _0x423cfe=window[_0x2f802e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2eddf8[_0x2f802e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x410b20,_0x410b20+0x2));_0x423cfe>=_0x260155[_0x2f802e([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x423cfe-=_0x260155[_0x2f802e([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4672f8+=_0x260155[_0x423cfe];}return _0x4672f8;}function _0x553bba(){const _0x7cdfed=_0x9ca0df[_0x2f802e([0x73,0x70,0x6c,0x69,0x74])](_0x2f802e([0x2e]));if(0x3!=_0x7cdfed[_0x2f802e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x27ab2c(_0x7cdfed[0x1]);function _0x27ab2c(_0x189f44){const _0x37c347=_0x2e43a8(_0x189f44);return _0x37c347&&_0x2b80a1()?_0x37c347:null;function _0x2b80a1(){const _0x3d72bd=_0x37c347[_0x2f802e([0x6a,0x74,0x69])],_0x4dbc6e=window[_0x2f802e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3d72bd[_0x2f802e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3d72bd[_0x2f802e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2481fb={..._0x37c347,[_0x2f802e([0x6a,0x74,0x69])]:_0x3d72bd[_0x2f802e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3d72bd[_0x2f802e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2481fb[_0x2f802e([0x76,0x63])],_0x3a1433(_0x2481fb)==_0x4dbc6e;}}}async function _0x2f0463(){let _0x4a6bc1=!0x0;try{const _0x5125fc=_0x9ca0df[_0x2f802e([0x73,0x70,0x6c,0x69,0x74])](_0x2f802e([0x2e])),[_0x2de8d8,_0x14eb8f,_0x9825cb]=_0x5125fc;return _0x5dcfaf(_0x2de8d8),await _0x526f92(_0x2de8d8,_0x14eb8f,_0x9825cb),_0x4a6bc1;}catch(_0xf8f1d7){return!0x1;}function _0x5dcfaf(_0x3a8176){const _0x3575d4=_0x2e43a8(_0x3a8176);_0x3575d4&&_0x3575d4[_0x2f802e([0x61,0x6c,0x67])]==_0x2f802e([0x45,0x53,0x32,0x35,0x36])||(_0x4a6bc1=!0x1);}async function _0x526f92(_0x934bf8,_0x49a5af,_0x416701){const _0x2f59a1=window[_0x2f802e([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2f802e([0x66,0x72,0x6f,0x6d])](_0x3ac74f(_0x416701),_0x4894e2=>_0x4894e2[_0x2f802e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x5013c8=new window[(_0x2f802e([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2f802e([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x934bf8+_0x2f802e([0x2e])+_0x49a5af),_0xced473=window[_0x2f802e([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2f802e([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0xced473)return;const _0x4ede39=await _0xced473[_0x2f802e([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2f802e([0x6a,0x77,0x6b]),_0x47a4e0,{[_0x2f802e([0x6e,0x61,0x6d,0x65])]:_0x2f802e([0x45,0x43,0x44,0x53,0x41]),[_0x2f802e([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2f802e([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2f802e([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0xced473[_0x2f802e([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2f802e([0x6e,0x61,0x6d,0x65])]:_0x2f802e([0x45,0x43,0x44,0x53,0x41]),[_0x2f802e([0x68,0x61,0x73,0x68])]:{[_0x2f802e([0x6e,0x61,0x6d,0x65])]:_0x2f802e([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x4ede39,_0x2f59a1,_0x5013c8)||(_0x4a6bc1=!0x1);}}function _0x2e43a8(_0x349268){return _0x349268[_0x2f802e([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2f802e([0x65,0x79]))?JSON[_0x2f802e([0x70,0x61,0x72,0x73,0x65])](_0x3ac74f(_0x349268)):null;}function _0x3ac74f(_0x556b9d){return window[_0x2f802e([0x61,0x74,0x6f,0x62])](_0x556b9d[_0x2f802e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2f802e([0x2b]))[_0x2f802e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2f802e([0x2f])));}function _0x3a1433(_0x1d5ecf){let _0x1b8f79=0x1505;function _0x2b01be(_0xc65b0e){for(let _0x150b94=0x0;_0x150b94<_0xc65b0e[_0x2f802e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x150b94++){const _0x414dbd=_0xc65b0e[_0x2f802e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x150b94);_0x1b8f79=(_0x1b8f79<<0x5)+_0x1b8f79+_0x414dbd,_0x1b8f79&=_0x1b8f79;}}function _0xf99a56(_0x2153f4){Array[_0x2f802e([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x2153f4)?_0x2153f4[_0x2f802e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0xf99a56):_0x2153f4&&typeof _0x2153f4==_0x2f802e([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2f802e([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x2153f4)[_0x2f802e([0x73,0x6f,0x72,0x74])]()[_0x2f802e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x5ca789,_0x263421])=>{_0x2b01be(_0x5ca789),_0xf99a56(_0x263421);}):_0x2b01be(window[_0x2f802e([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x2153f4));}return _0xf99a56(_0x1d5ecf),_0x1b8f79>>>0x0;}function _0x4ab138(_0x1d45c6){return _0x1d45c6[_0x2f802e([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2f802e([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2f802e([0x30]));}function _0x5bd671(_0x21ea16){return _0x21ea16[_0x2f802e([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2f802e([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2f802e([0x6a,0x6f,0x69,0x6e])]('');}function _0x10502e(){}function _0x2f802e(_0x40236d){return _0x40236d['map'](_0x2daa3a=>String['fromCharCode'](_0x2daa3a))['join']('');}_0x378a5a(await _0x53f115());}(this);}['showFakeVisualSelection'](){const _0x31d364=this['editor']['model'];_0x31d364['change'](_0x2b142e=>{const _0x281885=_0x31d364['document']['selection']['getRanges']();let _0x3b6524=0x0;for(const _0x85ea28 of _0x281885){const _0x44e4f8=f+':'+_0x3b6524;if(_0x31d364['markers']['has'](_0x44e4f8))_0x2b142e['updateMarker'](_0x44e4f8,{'range':_0x85ea28});else{if(_0x85ea28['start']['isAtEnd']){const _0x375076=_0x85ea28['start']['getLastMatchingPosition'](({item:_0x46bcbb})=>!_0x31d364['schema']['isContent'](_0x46bcbb),{'boundaries':_0x85ea28});_0x2b142e['addMarker'](_0x44e4f8,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2b142e['createRange'](_0x375076,_0x85ea28['end'])});}else _0x2b142e['addMarker'](_0x44e4f8,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x85ea28});}_0x3b6524++;}});}['hideFakeVisualSelection'](){const _0xd8c3b3=this['editor']['model'],_0x4f79a3=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x4f79a3['length']&&_0xd8c3b3['change'](_0x578c6c=>{_0x4f79a3['forEach'](_0x205a22=>{_0x578c6c['removeMarker'](_0x205a22);});});}['insertContent'](_0x4583b9,_0x3c22f6){const _0xc42426=this['_getAISelection'](),_0x579ded=_0x3c22f6||_0xc42426['getFirstRange']();this['editor']['model']['canEditAt'](_0x579ded)&&this['editor']['model']['change'](_0xfc5062=>{this['hideFakeVisualSelection'](),_0x3c22f6||this['_resetContentOfSelectedTableCells'](_0xfc5062,_0xc42426),this['_pasteHTMLUsingClipboard']({'insertAt':_0x579ded,'writer':_0xfc5062,'html':_0x4583b9});});}['insertContentBelow'](_0x203069){const {model:_0x3abfdd}=this['editor'],_0x4337c4=this['_getAISelection']();_0x3abfdd['change'](()=>{const _0x346523=this['_prepareTableInsertBelowPosition'](_0x203069,_0x4337c4)||this['_getDefaultInsertBelowPosition'](_0x4337c4);this['insertContent'](_0x203069,_0x346523);});}['_getAISelection'](){const _0x52b2e6=this['editor']['model'],_0x4db0ca=Array['from'](_0x52b2e6['markers']['getMarkersGroup'](f))['map'](_0x1225bf=>_0x1225bf['getRange']());return _0x52b2e6['createSelection'](_0x4db0ca);}['_pasteHTMLUsingClipboard']({writer:_0x6b3ecf,html:_0x56839d,insertAt:_0x20469c}){const {view:_0x4b2f60}=this['editor']['editing'],_0x9d410=this['editor']['plugins']['get'](_0x1dc24a),_0x23fa34=new dt();_0x23fa34['setData']('text/html',_0x56839d);const _0x368409=new ClipboardEvent('paste',{'clipboardData':_0x23fa34}),_0x42c179=new _0x3e6fe3(_0x4b2f60,_0x368409,{'dataTransfer':new _0x302572(_0x23fa34)});_0x6b3ecf['setSelection'](_0x20469c);const _0x15ceb2=(_0x449fb1,_0x595b3b)=>{_0x595b3b['resultRange']&&_0x6b3ecf['setSelection'](_0x595b3b['resultRange']);};_0x9d410['once']('contentInsertion',_0x15ceb2,{'priority':'lowest'}),_0x4b2f60['document']['fire']('paste',_0x42c179),_0x9d410['off']('contentInsertion',_0x15ceb2);}['_getDefaultInsertBelowPosition'](_0x116c06){const {model:_0x4b98a1}=this['editor'],_0x57cb3f=Array['from'](_0x116c06['getSelectedBlocks']());return _0x57cb3f['length']?_0x4b98a1['createPositionAfter'](_0x57cb3f['pop']()):_0x116c06['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x32b41e,_0x2aeb6d){const {model:_0x37ce6b,plugins:_0x34b67c}=this['editor'];if(_0x34b67c['has']('TableUtils')){const _0xda14c9=_0x34b67c['get']('TableUtils')['getSelectedTableCells'](_0x2aeb6d);if(_0xda14c9['length']){const _0x2bc309=this['_getTableRowCountFromContent'](_0x32b41e),_0x380666=this['_createEmptyTableRows'](_0xda14c9,_0x2bc309);return _0x37ce6b['createPositionAt'](_0x380666,0x0);}}return null;}['_getTableRowCountFromContent'](_0x39093b){const _0x573bb8=this['editor']['plugins']['get']('TableUtils'),_0x7f71e2=this['editor']['data']['parse'](_0x39093b),_0x557622=Array['from'](_0x7f71e2['getChildren']())['filter'](_0x7fb764=>_0x7fb764['is']('element','table'));let _0x2c02fb=0x0;return _0x557622['forEach'](_0x50e9e2=>{_0x2c02fb+=_0x573bb8['getRows'](_0x50e9e2);}),_0x2c02fb;}['_createEmptyTableRows'](_0x1bb4ae,_0x9c21fa){const _0x3e94ec=this['editor']['plugins']['get']('TableUtils'),_0x5caad8=_0x3e94ec['getRowIndexes'](_0x1bb4ae),_0x2bfa03=_0x3e94ec['getColumnIndexes'](_0x1bb4ae),_0x35601=_0x5caad8['last']+0x1,_0x5356c8=_0x2bfa03['first'],_0x4becb5=_0x1bb4ae[0x0]['findAncestor']('table');for(let _0x8d1e4c=0x0;_0x8d1e4c<_0x9c21fa;_0x8d1e4c++)_0x3e94ec['insertRows'](_0x4becb5,{'at':_0x35601});return _0x4becb5['getChild'](_0x35601)['getChild'](_0x5356c8);}['_resetContentOfSelectedTableCells'](_0x462b0b,_0x1b0694){const {plugins:_0x3b2f0f}=this['editor'],{model:_0x3b522e}=_0x462b0b;if(!_0x3b2f0f['has']('TableUtils'))return;_0x3b2f0f['get']('TableUtils')['getSelectedTableCells'](_0x1b0694)['length']&&_0x3b522e['deleteContent'](_0x1b0694);}}class K extends _0x2df1c9{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x20fe4c('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x47c089){super(_0x47c089),this['name']='AIRequestError';}}function i(_0x258601,_0x2b8998,_0x3e3deb){const t=_0x258601['t'];switch(_0x2b8998){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',_0x3e3deb);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3e3deb);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'},_0x3e3deb);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 _0x2b8998;}}class E extends _0x43f027{['_commandDefinitions'];constructor(_0x414e04,_0x44d28d){super(_0x414e04),this['_commandDefinitions']=_0x44d28d,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x17f75b,_0x25c484,_0x439c34)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x439c34));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x9acfff,_0x4a23c5,_0x436911)=>{this['enabledCommandsIds']=_0x436911?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x39d852=this['editor']['model'];this['_hasContext']=function(_0x5a9de8){const _0x5b17ff=_0x5a9de8['document']['selection'];return _0x5b17ff['isCollapsed']?0x0!==[..._0x5b17ff['getSelectedBlocks']()]['length']&&![..._0x5b17ff['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x5a9de8['hasContent'](_0x5b17ff['getFirstRange']());}(_0x39d852);const _0x2516be=_0x39d852['document']['selection'],_0x20c86c=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x28da51 of _0x2516be['getRanges']())for(const _0x572fea of _0x28da51['getItems']())if(_0x572fea['is']('element')&&_0x20c86c['includes'](_0x572fea['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x5ce9bd='',_0x269077='',_0x827513='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x5ce9bd,_0x269077,_0x827513);}}function G(_0x191eb1,_0x3301f3){const _0x4753dc=new Set();for(const _0x368000 of _0x191eb1['values']())(_0x3301f3||!0x1===_0x368000['requiresContent'])&&_0x4753dc['add'](_0x368000['id']);return Array['from'](_0x4753dc);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x43ba7f(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x5d8a19,_0x35fa14,_0x5b6911){super(),this['editor']=_0x5d8a19,this['textAdapter']=_0x35fa14,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x5b6911,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1f44d4,_0x143c4e,_0x2e01db)=>{this['view']['value']=this['_sanitizeHTML'](_0x2e01db);}),this['listenTo'](this['view'],'submitPrompt',(_0x59fcf7,_0x458e61)=>{const _0x26d16b=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x458e61,_0x26d16b,'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:_0xab871f,query:_0xd23954,htmlContent:_0xef6d09,label:_0x56274a,mainActionLabel:_0x2df006}){this['view']['prompt']=_0x56274a,this['view']['mainAction']=_0x2df006,this['initialContext']=_0xef6d09,_0xd23954&&(this['view']['isRendered']?this['_handleQuery'](_0xd23954,_0xef6d09,_0xab871f,_0x56274a):this['view']['once']('render',()=>{this['_handleQuery'](_0xd23954,_0xef6d09,_0xab871f,_0x56274a);}));}['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'](_0x4d8854,_0x2a8564,_0x582dc9,_0x524e62){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2a8564,this['previousQuery']=_0x4d8854,this['previousLabel']=_0x524e62||_0x4d8854,this['previousActionId']=_0x582dc9,new Promise(_0x398370=>{this['textAdapter']['makeRequest']({'query':_0x4d8854,'context':_0x2a8564,'onData':_0x3db6df=>{this['currentResponse']=_0x3db6df,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x582dc9})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x562d4b=>{_0x562d4b instanceof R?this['view']['handleError'](_0x562d4b['message']):this['view']['handleError'](),_0x398370();})['finally'](()=>{this['stopProcessing'](),_0x398370();});});}['_parseAndNormalizeContent'](_0x1b8e07,_0x5b2578=!0x1){const _0x237cbc=Z['exec'](_0x1b8e07);_0x1b8e07=_0x237cbc?_0x1b8e07['substring'](_0x237cbc[0x1]['length']):_0x1b8e07['length']<0x64&&!_0x5b2578?'':this['_stripMarkdownSyntax'](_0x1b8e07);const _0x545d98=this['_domParser']['parseFromString'](_0x1b8e07,'text/html');if(_0x237cbc){const _0x20cd90=Array['from'](_0x545d98['body']['childNodes']);_0x20cd90['reverse']();for(const _0x1e1ad1 of _0x20cd90){if(_0x1e1ad1['nodeType']==Node['ELEMENT_NODE'])break;_0x1e1ad1['remove']();}}const _0x37b75a=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x545d98['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x37b75a);const _0x2ef552=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x137180=this['editor']['data']['toModel'](_0x37b75a);return _0x2ef552||_0x137180['markers']['clear'](),this['editor']['data']['stringify'](_0x137180);}['_normalizeResponseHeadings'](_0x3444d0){const _0xa72d3c=new _0x133b37(this['editor']['editing']['view']['document']),_0x1feaf5=new _0x39bec5({'name':/^h[1-5]$/}),_0x246bf5=[];let _0x765afe=!0x1;for(const _0x428059 of _0x3444d0)_0x428059['is']('element')&&_0x1feaf5['match'](_0x428059)&&(_0x246bf5['push'](_0x428059),'h1'==_0x428059['name']&&(_0x765afe=!0x0));if(_0x765afe){for(const _0x4107b9 of _0x246bf5)_0xa72d3c['rename']('h'+(parseInt(_0x4107b9['name'][0x1])+0x1),_0x4107b9);}}['_isH1TagSupportEnabled'](){const {data:_0x162f40,editing:_0x62d68f}=this['editor'],_0x3445d3=_0x162f40['htmlProcessor']['toView']('<h1></h1>'),_0x425376=_0x162f40['toView'](_0x162f40['toModel'](_0x3445d3));return!!_0x62d68f['view']['domConverter']['viewToDom'](_0x425376)['querySelector']('h1');}['_sanitizeHTML'](_0xe01a48){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xe01a48),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5d9c1f){const _0x3784e5=_0x5d9c1f['trim']();return _0x3784e5['startsWith']('```html')?_0x3784e5['endsWith']('```')?_0x3784e5['substring'](0x7,_0x3784e5['length']-0x3):_0x3784e5['substring'](0x7):_0x5d9c1f;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x4c1a7a){super(_0x4c1a7a),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x366d9f=>i(_0x4c1a7a,'AI_'+_0x366d9f['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x4c1a7a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x4c1a7a,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x4c1a7a,'Stop'));const _0xc5507=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xc5507['if']('isVisible','ck-hidden',_0x2ec32c=>!_0x2ec32c)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0xcb28b9,_0x2850d3){const _0x27099a=new _0x286689(this['locale']);return _0x27099a['set']({'label':_0xcb28b9,'class':_0x2850d3||'','isVisible':!0x0,'withText':!0x0}),_0x27099a;}}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 _0x5a0a27{['contentFieldView'];['copyButtonView'];constructor(_0x34a7ca,_0x340d3e=''){super(_0x34a7ca),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3ff585=this['bindTemplate'];this['contentFieldView']=new mt(_0x34a7ca,_0x340d3e),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3ff585['if']('isVisible','ck-hidden',_0x3bb1a4=>!_0x3bb1a4)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3ff585['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 _0x5e2275=!0x1;this['on']('change:value',(_0x293eb3,_0x28b200,_0x2db7c7)=>{const _0x4ce194=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2db7c7),this['isProcessing']&&_0x4ce194&&!_0x5e2275&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x29d69a,_0x3eb210,_0x4129bd)=>{_0x5e2275=!0x1,_0x4129bd?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x5e2275=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x5e2275=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2666d2=this['locale'],_0x75f96=new _0x286689(this['locale']),_0x9b81ae='ck-ai-form__copy-button';return _0x75f96['set']({'label':i(_0x2666d2,'Copy'),'icon':W,'class':_0x9b81ae,'tooltip':!0x0}),_0x75f96['bind']('isVisible')['to'](this,'value',_0xe65d9=>!!_0xe65d9),_0x75f96['bind']('isEnabled')['to'](this,'isProcessing',_0x1edf15=>!_0x1edf15),_0x75f96['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x75f96['icon']=_0x1d77a9['check'],_0x75f96['class']=_0x9b81ae+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x75f96['icon']=W,_0x75f96['class']=_0x9b81ae;},0x3e8);}),_0x75f96;}['_copyHTMLToClipboard'](_0x3d5c6c){const {window:_0x25e222,document:_0xadc364}=_0x2035af;if(_0x25e222['ClipboardItem']){const {Blob:_0x3ac1a2,ClipboardItem:_0x4a7f8e}=_0x25e222,_0x3126ce=[new _0x4a7f8e({'text/html':new _0x3ac1a2([_0x3d5c6c['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3ac1a2([_0x3d5c6c['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x3126ce);}else{const _0x377e3c=_0xadc364['createElement']('div');_0x377e3c['style']['position']='absolute',_0x377e3c['style']['left']='-9999px',_0x377e3c['innerHTML']='<span>[</span>'+_0x3d5c6c['innerHTML']+'<span>]</span>',_0xadc364['body']['appendChild'](_0x377e3c);const _0x233d35=_0xadc364['createRange']();_0x233d35['setStartAfter'](_0x377e3c['firstElementChild']),_0x233d35['setEndBefore'](_0x377e3c['lastElementChild']);const _0x3acffc=_0x25e222['getSelection']();_0x3acffc['removeAllRanges'](),_0x3acffc['addRange'](_0x233d35),_0xadc364['execCommand']('copy'),_0x377e3c['remove']();}}}class mt extends _0x5a0a27{constructor(_0x58cbc4,_0x195f1a=''){super(_0x58cbc4),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x195f1a,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x30b657){this['element']['innerHTML']=_0x30b657;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x39752d=new _0x5a0a27(),_0x190e6d=this['locale'],_0x228902=new _0x33b1d6();return _0x228902['isVisible']=!0x0,_0x39752d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x228902,{'text':i(_0x190e6d,'AI\x20is\x20writing...')}]}),_0x39752d['render'](),_0x39752d;}}class rt extends _0x5a0a27{constructor(_0x2b3d9f,_0x2c8e98=''){super(_0x2b3d9f);const _0x1f4b70=new _0x575ffd(),_0x34c520=this['bindTemplate'];this['set']('text',_0x2c8e98),_0x1f4b70['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':[_0x1f4b70,{'text':_0x34c520['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x585cb4,_0x4d695e){super(_0x585cb4,_0x4d695e),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',(_0xff71f9,_0x5e40c6)=>{_0xff71f9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5e40c6());});}['_createSubmitButton'](){const _0x2573f1=new _0x286689(this['locale']),_0x245a0f=this['locale'];return _0x2573f1['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(_0x245a0f,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x2573f1['on']('execute',()=>{this['submit']();}),_0x2573f1['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0xef6059,_0x4f6e2c)=>!_0xef6059&&_0x4f6e2c),_0x2573f1;}['_createShowHistoryButton'](){const _0x334875=new _0x286689(this['locale']),_0x2feab7=this['resultsView'],_0x3a8e92=this['locale'];_0x334875['set']({'label':i(_0x3a8e92,'History'),'withText':!0x1,'icon':_0x1d77a9['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x334875['bind']('isOn')['to'](_0x2feab7,'isVisible'),_0x334875['bind']('isEnabled')['to'](this,'isEnabled'),_0x334875['on']('execute',()=>{_0x2feab7['isVisible']=!_0x2feab7['isVisible'],_0x2feab7['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x19bd48=()=>{_0x2035af['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x30b342=new st(this['queryView']['fieldView']['element']),_0x4d2d6d=_0x30b342['width'],_0x138220='rtl'===_0x3a8e92['uiLanguageDirection']?'left':'right';_0x30b342['excludeScrollbarsAndBorders'](),_0x334875['element']['style'][_0x138220]=_0x4d2d6d-_0x30b342['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x19bd48),this['on']('render',_0x19bd48),_0x334875;}['submit'](){const _0x2b0c04=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x2b0c04);}['focus'](_0x52b3d2){-0x1===_0x52b3d2?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x20926d){super(_0x20926d),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x20926d,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x463072=0x0;for(const _0x28e355 of this['items'])_0x463072+=_0x28e355['items']['length'];return{'resultsCount':_0x463072,'totalItemsCount':_0x463072};}['_createClearHistoryButton'](){const _0x1cde9e=this['locale'],_0x2c3f78=new _0x286689(this['locale']);return _0x2c3f78['set']({'label':'('+i(_0x1cde9e,'Clear')+')','withText':!0x0}),_0x2c3f78['on']('execute',()=>this['fire']('clearHistory')),_0x2c3f78;}}class hs extends _0x476cb0{constructor(_0x4608d9){super();const _0x245f6f=new te(),_0x256b4e=new _0x286689(this['locale'],_0x245f6f);this['children']['add'](_0x256b4e),_0x256b4e['set']({'label':_0x4608d9['prompt'],'withText':!0x0}),_0x256b4e['on']('execute',()=>{this['fire']('execute',{'value':_0x13b18a(_0x4608d9['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x802b10{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0xe5841,_0x202edd)=>{const _0x29908f=Ss(_0x202edd['prompt']);for(const _0x5bd295 of this)if(_0x5bd295!=_0x202edd&&Ss(_0x5bd295['prompt'])===_0x29908f){this['remove'](_0x5bd295);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x406f4b=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x406f4b));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x511fe8=>_0x511fe8)));}}function Ss(_0x115027){return _0x115027['toLowerCase']()['trim']();}class k extends _0x5a0a27{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2aca16,_0x53416e,_0xff3e5a=''){super(_0x2aca16),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(_0x2aca16),this['contentArea']=new X(_0x2aca16,_0xff3e5a),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 _0x55f37d(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x42935d({'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 _0x4d5fac=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x53416e],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x4d5fac['if']('isError','ck-hidden',_0x18953b=>!_0x18953b)]},'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'](_0x1192f7=0x1){-0x1===_0x1192f7?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 _0x2c5709=this['locale'],_0x1d064b=new ht(_0x2c5709,{'queryView':{'label':i(_0x2c5709,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x3b7956,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x2c5709,'Empty\x20history'),'secondary':i(_0x2c5709,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x1d064b['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x253ace,_0x567c58)=>_0x253ace&&!_0x567c58),this['listenTo'](_0x1d064b,'submit',(_0x5bfc78,_0xa91cbc)=>{this['prompt']=_0xa91cbc;const _0xdb858d=_0x306991(_0xa91cbc);this['fire']('submitPrompt',_0xdb858d),_0xa91cbc['trim']()&&this['_promptHistory']['add']({'prompt':_0xdb858d},0x0);},{'priority':'high'}),_0x1d064b;}['_createHistoryView'](){const _0x2c4c7c=new rs(this['locale']);return _0x2c4c7c['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x2c4c7c['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2c4c7c;}['_createToolbar'](){const _0x11b664=new at(this['locale']);return _0x11b664['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1c635a,_0x68196a,_0x464387)=>_0x1c635a&&!_0x68196a&&!!_0x464387),_0x11b664['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x11b664['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5350c1,_0x5b6a04,_0x172cf5)=>_0x5350c1&&!_0x5b6a04&&!!_0x172cf5),_0x11b664['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x11b664['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4c41aa,_0x3211d4)=>_0x4c41aa&&!_0x3211d4),_0x11b664['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x11b664['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x11b664['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x11b664;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x244f4c=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x244f4c,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x4aa793){const _0x4e7b68=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x4aa793||i(_0x4e7b68,'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 _0x2df1c9{['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[_0x35e822,a,K,_0xec6ecf];}constructor(_0x375e8c){super(_0x375e8c),_0x375e8c['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x375e8c['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x375e8c['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x375e8c['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x361b91}=this;this['_aiAdapter']=_0x361b91['plugins']['get'](K),this['_dialog']=_0x361b91['plugins']['get'](_0xec6ecf),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x59335c=new E(_0x361b91,Array['from'](this['_commandDefinitions']['values']()));_0x361b91['commands']['add']('showAIAssistant',_0x59335c),_0x361b91['ui']['componentFactory']['add']('aiCommands',_0x4e6226=>{const _0x1ca042=_0x1942a8(_0x4e6226);return _0x1ca042['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1ca042['buttonView']['set']({'label':i(_0x4e6226,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x1ca042['on']('execute',_0x4ab9ad=>this['_onExecute'](_0x4ab9ad['source']['id'])),_0x47d818(_0x1ca042,_0x361b91['ui']['view']['body'],function(_0x227078){const _0x2bfc42=o(_0x227078['config']['get']('ai.aiAssistant.commands'),_0x227078['locale']),_0x228f22=U(_0x227078,_0x2bfc42)['filter'](_0x1721ad=>_0x1721ad['commands']['length']);if(0x1===_0x228f22['length'])return U(_0x227078,_0x228f22[0x0]['commands'])['map'](_0x3a0dab=>({'id':_0x3a0dab['id'],'label':_0x3a0dab['label']}));return _0x228f22['map'](_0x49e057=>{const {groupId:_0x223b2b,groupLabel:_0x4b6667,commands:_0x789c52}=_0x49e057,_0x7aeae8=U(_0x227078,_0x789c52)['map'](_0x34e29f=>({'id':_0x34e29f['id'],'label':_0x34e29f['label']}));return{'id':_0x223b2b,'menu':_0x4b6667||_0x223b2b,'children':_0x7aeae8};});}(_0x361b91),{'ariaLabel':i(_0x4e6226,'AI\x20Commands')}),_0x1ca042['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x59335c['on']('change:enabledCommandsIds',_0x748e84),_0x1ca042['menuView']['once']('render',_0x748e84),_0x1ca042;function _0x748e84(){_0x1ca042['isEnabled']=_0x59335c['enabledCommandsIds']['length']>0x0;for(const _0x11a847 of _0x1ca042['menuView']['buttons'])_0x11a847['isEnabled']=_0x59335c['enabledCommandsIds']['includes'](_0x11a847['id']);}}),_0x361b91['ui']['componentFactory']['add']('menuBar:aiCommands',_0x53fe54=>{const _0x2dffde=new _0x310226(_0x53fe54);_0x2dffde['buttonView']['set']({'label':i(_0x53fe54,'AI\x20Commands'),'icon':T}),_0x2dffde['bind']('isEnabled')['to'](_0x59335c,'enabledCommandsIds',_0x5a4970=>_0x5a4970['length']>0x0);const _0x24f254=o(_0x361b91['config']['get']('ai.aiAssistant.commands'),_0x53fe54);return this['_populateMenuBarMenu'](_0x59335c,_0x2dffde,_0x24f254,_0x3303f9=>this['_onExecute'](_0x3303f9)),_0x2dffde;}),_0x361b91['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x17e306=this['_createAIAssistantUIButton'](_0x286689);return _0x17e306['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x17e306;}),_0x361b91['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x21e124=this['_createAIAssistantUIButton'](_0x3bc795);return _0x21e124['set']({'role':'menuitemcheckbox'}),_0x21e124;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x212298=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4533e1;for(const _0x226c11 in _0x212298){const _0x423945=_0x226c11,_0x3d0a63=_0x212298[_0x423945];if('aiLicenseKeyValid'==_0x3d0a63||'aiLicenseKeyInvalid'==_0x3d0a63||'aiLicenseKeyExpired'==_0x3d0a63||'aiLicenseKeyDomainLimit'==_0x3d0a63||'aiLicenseKeyNotAllowed'==_0x3d0a63||'aiLicenseKeyEvaluationLimit'==_0x3d0a63||'aiLicenseKeyTrialLimit'==_0x3d0a63||'aiLicenseKeyUsageLimit'==_0x3d0a63){delete _0x212298[_0x423945],_0x4533e1=_0x3d0a63,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x4533e1&&_0x212298['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x4533e1&&_0x212298['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x4533e1&&_0x212298['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x4533e1&&_0x212298['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x4533e1&&_0x212298['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x4533e1&&_0x212298['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x4533e1&&_0x212298['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x2bad5f='',_0x1f4a42='',_0x3f2a84='custom'){const _0x12c27e=this['editor'],_0x5791f3=_0x12c27e['editing']['view'],_0x268f1d=_0x12c27e['plugins']['get'](a),_0x5f4a5c=_0x12c27e['plugins']['get'](_0x35e822);_0x268f1d['showFakeVisualSelection']();const _0xf217bd=new w(),_0x44a013=new ClipboardEvent('copy',{'clipboardData':_0xf217bd}),_0x333a3b=new _0x302572(_0xf217bd),_0x2fe0e0=new _0x3e6fe3(_0x5791f3,_0x44a013,{'dataTransfer':_0x333a3b});_0x5f4a5c['_forceMarkersCopy']('comment',()=>{_0x5791f3['document']['fire']('copy',_0x2fe0e0);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x12c27e,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x1e777b=_0x333a3b['getData']('text/html');const _0x45c70f=_0x12c27e['model']['document']['selection'],_0x135277=Array['from'](_0x45c70f['getRanges']());0x1===_0x135277['length']&&_0x135277[0x0]['isFlat']&&!_0x45c70f['getSelectedElement']()&&''!==_0x1e777b['replace'](/ /g,'')['trim']()&&(_0x1e777b='<p>'+_0x1e777b+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x3f2a84,'query':_0x2bad5f,'htmlContent':_0x1e777b,'label':_0x1f4a42,'mainActionLabel':M[_0x12c27e['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':_0x31289f['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x268f1d['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x34c774=new Map(),_0xe85405=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x4d6c92 of _0xe85405)for(const _0x53b9da of _0x4d6c92['commands'])_0x34c774['set'](_0x53b9da['id'],{..._0x53b9da,'groupId':_0x4d6c92['groupId'],'groupLabel':_0x4d6c92['groupLabel']||_0x4d6c92['groupId']});return _0x34c774;}['_createAIAssistantUIButton'](_0x284c7c){const _0x6653cd=this['editor'],_0x1cc594=_0x6653cd['commands']['get']('showAIAssistant'),_0x17cc24=new _0x284c7c(_0x6653cd['locale']);return _0x17cc24['set']({'label':i(_0x6653cd['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x17cc24['bind']('isEnabled')['to'](_0x1cc594),_0x17cc24['bind']('isOn')['to'](this['_dialog'],'id',_0x47dd1c=>'aiAssistant'===_0x47dd1c),this['listenTo'](_0x17cc24,'execute',()=>{_0x17cc24['isOn']?this['hideUI']():_0x1cc594['execute']();}),_0x17cc24;}['_initView'](){const _0x2ad3c0=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',()=>{_0x2ad3c0['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x2ad3c0['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x428b0a,ui:{ariaLiveAnnouncer:_0xc201bc}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x527240,_0x6b3064,_0x426b76)=>{const _0x53ca23=this['_aiAssistantController']['currentContext'];_0x426b76?_0xc201bc['announce'](i(_0x428b0a,'AI\x20is\x20writing')):_0x53ca23&&_0xc201bc['announce'](i(_0x428b0a,'Generated\x20content:\x20%0',_0x53ca23),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x184545,_0x409e6f,_0x318f24)=>{if(_0x318f24){const _0x15efc5=this['_formView']['errorView']['text'];_0xc201bc['announce'](i(_0x428b0a,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x15efc5));}});}['_onExecute'](_0x134b19){const _0x553f5b=this['_commandDefinitions']['get'](_0x134b19),_0x258945=this['editor'],_0x4eeeb0=_0x258945['model']['document']['selection'],_0x829428=_0x258945['commands']['get']('showAIAssistant'),_0x311e97=_0x258945['plugins']['get'](a),_0xaaafdd=''+(_0x553f5b['groupId']!==x?_0x553f5b['groupLabel']+':\x20':'')+_0x553f5b['label'];if(!0x1!==_0x553f5b['requiresContent']&&_0x4eeeb0['isCollapsed']){const _0x4eec3=_0x4d1f1b(_0x4eeeb0['getSelectedBlocks']())||_0x258945['model']['schema']['getLimitElement'](_0x4eeeb0);_0x258945['model']['change'](_0x27a7b3=>{_0x27a7b3['setSelection'](_0x4eec3,'in');});}_0x311e97['showFakeVisualSelection'](),_0x829428['execute'](_0x553f5b['prompt'],_0xaaafdd,'command:'+_0x134b19);}['_populateMenuBarMenu'](_0x51e080,_0x114af7,_0x56176a,_0x2896c3){const _0x9f3cd0=this['editor'],_0xa85ef9=_0x9f3cd0['locale'],_0x437373=new _0x28f541(_0xa85ef9),_0x5273ac=U(_0x9f3cd0,_0x56176a)['filter'](_0x171588=>_0x171588['commands']['length']);0x1===_0x5273ac['length']?this['_getMenuBarGroupButtons']({'command':_0x51e080,'commands':_0x5273ac[0x0]['commands'],'parentMenuView':_0x114af7,'onExecute':_0x2896c3})['forEach'](_0x4d6edb=>_0x437373['items']['add'](_0x4d6edb)):_0x5273ac['forEach'](({groupId:_0x15abff,groupLabel:_0xc77f73,commands:_0x549550})=>{const _0x14753a=new _0x5e14a6(_0xa85ef9,_0x114af7),_0x2691f5=new _0x310226(_0xa85ef9),_0x35c7a2=new _0x28f541(_0xa85ef9),_0x3dd5aa=this['_getMenuBarGroupButtons']({'command':_0x51e080,'commands':_0x549550,'parentMenuView':_0x2691f5,'onExecute':_0x2896c3});_0x2691f5['buttonView']['set']({'label':_0xc77f73||_0x15abff}),_0x2691f5['delegate']('execute')['to'](_0x114af7),_0x35c7a2['items']['addMany'](_0x3dd5aa),_0x2691f5['panelView']['children']['add'](_0x35c7a2),_0x14753a['children']['add'](_0x2691f5),_0x437373['items']['add'](_0x14753a);}),_0x114af7['panelView']['children']['add'](_0x437373);}['_getMenuBarGroupButtons']({command:_0x15aa66,commands:_0x133d86,parentMenuView:_0x27142,onExecute:_0x599ba8}){const _0xf0b613=this['editor'],_0x2be420=_0xf0b613['locale'];return U(_0xf0b613,_0x133d86)['map'](_0x55a602=>{const _0x1a3a65=new _0x5e14a6(_0x2be420,_0x27142),_0x31bd33=new _0x3bc795(_0x2be420);return _0x31bd33['set']({'label':_0x55a602['label']}),_0x31bd33['delegate']('execute')['to'](_0x27142),_0x31bd33['on']('execute',()=>_0x599ba8(_0x55a602['id'])),_0x31bd33['bind']('isEnabled')['to'](_0x15aa66,'enabledCommandsIds',_0x28ea2c=>_0x28ea2c['includes'](_0x55a602['id'])),_0x1a3a65['children']['add'](_0x31bd33),_0x1a3a65;});}}function B(_0x129d25,_0x30a07f){return void 0x0!==_0x129d25['order']&&void 0x0===_0x30a07f['order']?0x1:void 0x0===_0x129d25['order']&&void 0x0!==_0x30a07f['order']?-0x1:void 0x0!==_0x129d25['order']&&void 0x0!==_0x30a07f['order']?_0x129d25['order']-_0x30a07f['order']:0x0;}function U(_0x134c9c,_0x47a504){_0x47a504['sort'](B);const _0x23b3fc={},_0x3e7a64=[];for(const _0x47b935 of _0x47a504)if(void 0x0!==_0x47b935['order']){if(_0x47b935['order']in _0x23b3fc)throw new _0x20fe4c('ai-commands-config-order-collision',_0x134c9c,{'conflictingDefinitions':[_0x47b935,_0x23b3fc[_0x47b935['order']]]});_0x23b3fc[_0x47b935['order']]=_0x47b935,_0x3e7a64['splice'](_0x47b935['order'],0x0,_0x47b935);}else _0x3e7a64['push'](_0x47b935);return _0x3e7a64;}class r extends _0x2df1c9{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x531420){super(_0x531420);const _0x394903=_0x531420['config'],_0x2f5afc=_0x531420['locale'];_0x394903['define']('ai.aiAssistant.preserveComments',!0x0),_0x394903['define']('ai.aiAssistant.commands',function(_0x480043){return[{'groupId':'editOrReview','groupLabel':i(_0x480043,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x480043,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x480043,'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(_0x480043,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x480043,'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(_0x480043,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x480043,'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(_0x480043,'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(_0x480043,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x480043,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x480043,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x480043,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x480043,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x480043,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x480043,'Change\x20style'),'commands':[{'id':'business','label':i(_0x480043,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x480043,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x480043,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x480043,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x480043,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x480043,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x480043,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x480043,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x480043,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x480043,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x480043,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x480043,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x480043,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x2f5afc)),_0x394903['define']('ai.aiAssistant.extraCommandGroups',[]),_0x394903['define']('ai.aiAssistant.removeCommands',[]);let _0xe33150=o(_0x394903['get']('ai.aiAssistant.commands'),_0x2f5afc);const _0x54300e=_0x394903['get']('ai.aiAssistant.extraCommandGroups'),_0x3fa297=_0x394903['get']('ai.aiAssistant.removeCommands');_0x54300e['forEach'](_0xa7fea9=>{const _0x17df9e=_0xe33150['find'](_0x152e1f=>_0x152e1f['groupId']===_0xa7fea9['groupId']);_0x17df9e?_0x17df9e['commands']=_0x17df9e['commands']['concat'](_0xa7fea9['commands']):_0xe33150['push'](_0xa7fea9);}),_0xe33150=_0xe33150['filter'](_0x4f5f76=>!_0x3fa297['includes'](_0x4f5f76['groupId'])),_0xe33150['forEach'](_0x436122=>{_0x436122['commands']=_0x436122['commands']['filter'](_0x353c6d=>!_0x3fa297['includes'](_0x353c6d['id']));}),_0x394903['set']('ai.aiAssistant.commands',_0xe33150);}}class P extends _0x2df1c9{['abortController'];static get['requires'](){return[K];}constructor(_0x1fc539){super(_0x1fc539),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'](_0x15518a){return this['sendRequest'](_0x15518a)['catch'](_0x124095=>{if(_0x124095 instanceof R)return Promise['reject'](_0x124095);if('AbortError'==_0x124095['name'])return Promise['resolve']();throw console['error'](_0x124095),new _0x20fe4c('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x4bee6c,_0x454c3d){const _0x34b1d9=this['editor']['locale'],_0x2b9eb7={'Content-Type':'application/json'};if('object'==typeof _0x4bee6c)Object['assign'](_0x2b9eb7,_0x4bee6c);else{if(_0x4bee6c)try{const _0x2946c7=await _0x4bee6c(_0x454c3d);Object['assign'](_0x2b9eb7,_0x2946c7);}catch(_0x1921e3){return Promise['reject'](new R(i(_0x34b1d9,'AI_ERROR_GET_HEADERS')));}}return _0x2b9eb7;}async['_prepareRequestParameters'](_0x35399d,_0x6579ec){const _0x1ee914=this['editor']['locale'];if('object'==typeof _0x35399d)return _0x35399d;try{return await _0x35399d(_0x6579ec);}catch(_0x23601a){return Promise['reject'](new R(i(_0x1ee914,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x39299b){super(_0x39299b),_0x39299b['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x39299b['config']['get']('ai.openAI.requestParameters')||_0x39299b['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x39299b['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x39299b['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x39299b['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x8ecd86,context:_0x3364c7,onData:_0x4c2759,actionId:_0x39b784}){const _0x1fbf92=this['editor']['locale'],_0x5796bb=await this['prepareMessages'](_0x8ecd86,_0x3364c7,_0x39b784),_0x20eaab=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x39b784),_0x226dd0=await this['_prepareRequestParameters'](this['_requestParameters'],_0x39b784),_0x13c827={'messages':_0x5796bb,..._0x226dd0},_0x18d68f={'method':'POST','headers':_0x20eaab,'body':JSON['stringify'](_0x13c827),'signal':this['abortController']['signal']},_0x4069ca=await fetch(this['_apiUrl'],_0x18d68f);if(_0x4069ca['ok'])return _0x226dd0['stream']?await this['_readStreamableResponse'](_0x4069ca,_0x4c2759):await this['_readStaticResponse'](_0x4069ca,_0x4c2759),Promise['resolve']();{const _0x4f642e=await _0x4069ca['text']();return _0x4f642e['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x1fbf92,'AI_ERROR_CONTEXT_LENGTH'))):_0x4f642e['includes']('Moderation')?Promise['reject'](new R(i(_0x1fbf92,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x4f642e));}}async['prepareMessages'](_0x58252c,_0x41bd60,_0x1318db){let _0x454ebf,_0x2fcd57;return _0x41bd60?(_0x454ebf='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.',_0x2fcd57='Instruction:\x0a'+_0x58252c+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x41bd60):(_0x454ebf='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.',_0x2fcd57=_0x58252c),[{'role':'system','content':_0x454ebf},{'role':'user','content':_0x2fcd57}];}async['_readStreamableResponse'](_0x2033ad,_0x78df98){const _0x36ad3d=_0x2033ad['body']['getReader'](),_0x429223=new TextDecoder();let _0x3eca8e='',_0x5d958e='',_0x16b9fe='',_0x2a4222=!0x1;for(;!_0x2a4222;){const {done:_0x5cc36f,value:_0x350064}=await _0x36ad3d['read'](),_0x2217bb=_0x3eca8e+_0x429223['decode'](_0x350064);let _0x507f73='';_0x2a4222=_0x5cc36f;try{_0x507f73=this['_cleanUpData'](_0x2217bb),_0x3eca8e='';}catch(_0x4f0982){_0x3eca8e=_0x2217bb;continue;}_0x5d958e+=_0x507f73,!_0x2a4222&&this['_isBufferIncomplete'](_0x5d958e)||_0x5d958e&&(_0x16b9fe+=_0x5d958e,_0x5d958e='',_0x78df98(_0x16b9fe));}return Promise['resolve']();}async['_readStaticResponse'](_0x5bded6,_0x5ee9fc){return _0x5ee9fc((await _0x5bded6['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x595260){const _0x3677ee=_0x595260['split']('<')['length']!==_0x595260['split']('>')['length'],_0x1cddfb=_0x595260['length']<0x1e;return _0x3677ee&&_0x1cddfb;}['_cleanUpData'](_0x28436d){return _0x28436d['split'](/\n(?![^{]*\})/g)['map'](_0x1e92de=>_0x1e92de['replace']('data:\x20',''))['filter'](_0x1b7c71=>_0x1b7c71&&_0x1b7c71['length']>0x0&&'[DONE]'!==_0x1b7c71)['map'](_0x29a49c=>{const {choices:_0x2ad624}=JSON['parse'](_0x29a49c);if(_0x2ad624[0x0]&&_0x2ad624[0x0]['delta']&&_0x2ad624[0x0]['delta']['content'])return _0x2ad624[0x0]['delta']['content'];})['filter'](_0x21afd1=>_0x21afd1)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x492b8f){super(_0x492b8f),_0x492b8f['config']['get']('ai.aws.requestParameters')||_0x492b8f['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']=_0x492b8f['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x492b8f['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x492b8f['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x492b8f['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x180005,context:_0x32d53b,onData:_0x2fa785,actionId:_0x45c454}){const {model:_0x28a680,stream:_0xc6f39b,..._0x45f9e3}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x45c454),_0x5733f4={'prompt':await this['preparePrompt'](_0x180005,_0x32d53b,_0x28a680,_0x45c454),..._0x45f9e3};this['_apiUrl']?await this['_processProxyRequest'](_0x5733f4,_0x28a680,_0xc6f39b,_0x2fa785,_0x45c454):await this['_processAWSRequest'](_0x5733f4,_0x28a680,_0xc6f39b,_0x2fa785);}async['preparePrompt'](_0x3c34c,_0x2c4a66,_0x2746e4,_0x4eddcf){let _0x2b9360,_0x5957f2;return _0x2c4a66?(_0x2b9360='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.',_0x5957f2='Instruction:\x0a'+_0x3c34c+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2c4a66):(_0x2b9360='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.',_0x5957f2=_0x3c34c),'meta.llama'==this['getModelFamily'](_0x2746e4)?'<<SYS>>\x0a'+_0x2b9360+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x5957f2+'\x0a[/INST]':'Human:\x0a'+_0x2b9360+'\x0a'+_0x5957f2+'\x0a\x0aAssistant:';}['getModelFamily'](_0x241d4e){if(/^anthropic\.claude/['test'](_0x241d4e))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x241d4e))return'ai21.j2';if(/^cohere\.command/['test'](_0x241d4e))return'cohere.command';if(/^meta\.llama/['test'](_0x241d4e))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x241d4e));}async['_processProxyRequest'](_0x532943,_0x2e0afc,_0x58e610,_0x5ed37b,_0x24f50f){const _0x1ffd2c={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x24f50f),'body':JSON['stringify']({..._0x532943,'model':_0x2e0afc,'stream':_0x58e610}),'signal':this['abortController']['signal']},_0x5e1803=await fetch(this['_apiUrl'],_0x1ffd2c);_0x58e610?await this['_readStreamableResponse'](_0x5e1803,_0x2e0afc,_0x5ed37b):await this['_readStaticResponse'](_0x5e1803,_0x2e0afc,_0x5ed37b);}async['_processAWSRequest'](_0x545287,_0x230420,_0x3334f2,_0x1e07a3){const _0x29eb68=new _0x15759a(this['_bedrockClientConfig']),_0x59408c={'body':JSON['stringify'](_0x545287),'contentType':'application/json','accept':'application/json','modelId':_0x230420};let _0x20dcc1;if(_0x3334f2){const _0x200817=new _0x379557(_0x59408c);_0x20dcc1=await _0x29eb68['send'](_0x200817,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x20dcc1,_0x230420,_0x1e07a3);}else{const _0x2dea93=new _0x144e6f(_0x59408c);_0x20dcc1=await _0x29eb68['send'](_0x2dea93,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x20dcc1,_0x230420,_0x1e07a3);}}async['_readAsyncIterableResponse'](_0x58e3b0,_0xd97a70,_0x452a21){const _0x2dadfd=_0x58e3b0['body'],_0x26741f=new TextDecoder('utf-8');let _0x2a4b9b='';for await(const _0x226513 of _0x2dadfd)if(_0x226513['chunk']){const _0x4b25c6=_0x26741f['decode'](_0x226513['chunk']['bytes']),_0x46152c=JSON['parse'](_0x4b25c6);_0x2a4b9b+=this['_getGeneratedText'](_0x46152c,_0xd97a70),_0x452a21(_0x2a4b9b);}return Promise['resolve']();}async['_readStreamableResponse'](_0x326b40,_0x4b92d4,_0x24bba9){const _0x5dc11f=_0x326b40['body'],_0x3fce11=new TextDecoder('utf-8'),_0x3776ce=_0x5dc11f['getReader']();let _0xe11412='',_0xd8b2f2='',_0x27b06e=!0x1;for(;!_0x27b06e;){const {done:_0x41743e,value:_0x334be0}=await _0x3776ce['read']();if(_0x27b06e=_0x41743e,_0x27b06e)break;const _0x5784bf=(_0xe11412+_0x3fce11['decode'](_0x334be0))['split']('\x0a')['map'](_0x5ea420=>{try{return _0xe11412='',JSON['parse'](_0x5ea420);}catch(_0xea6545){return _0xe11412=_0x5ea420,null;}})['filter'](_0x502cff=>null!==_0x502cff);_0x5784bf['length']&&(_0xd8b2f2+=_0x5784bf['map'](_0x285722=>this['_getGeneratedText'](_0x285722,_0x4b92d4))['join'](''),_0x24bba9(_0xd8b2f2));}return Promise['resolve']();}async['_readStaticResponse'](_0x467279,_0x4de5f5,_0x54204b){let _0x535ffc;return _0x535ffc=_0x467279 instanceof Response?await _0x467279['json']():JSON['parse'](Buffer['from'](_0x467279['body'])['toString']('utf8')),(_0x54204b(this['_getGeneratedText'](_0x535ffc,_0x4de5f5)),Promise['resolve']());}['_getGeneratedText'](_0x5999c5,_0x59f159){switch(this['getModelFamily'](_0x59f159)){case'anthropic.claude':return _0x5999c5['completion'];case'ai21.j2':return _0x5999c5['completions'][0x0]['data']['text'];case'cohere.command':return _0x5999c5['generations'][0x0]['text'];case'meta.llama':return _0x5999c5['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 _0x5b41a4,Command as _0x2c6a2c,icons as _0x40a29f}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x55f305,CKEditorError as _0x918a5e,ObservableMixin as _0x1cad79,global as _0x14f3b1,isVisible as it,Rect as st,Collection as _0x320bfa,FocusTracker as _0x2e8a9b,KeystrokeHandler as ts,first as _0x474c7c}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x52e4b1,View as _0x1dcffe,SpinnerView as _0x199281,IconView as _0x4e5d35,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x13466d,ButtonLabelView as te,FocusCycler as _0x436d0e,createLabeledTextarea as _0x15cea1,Dialog as _0xf80c01,createDropdown as _0x3cba5b,addMenuToDropdown as _0x1fbf52,MenuBarMenuView as _0x27b750,MenuBarMenuListItemButtonView as _0x7b2d5e,DialogViewPosition as _0x40eed2,MenuBarMenuListView as _0x371569,MenuBarMenuListItemView as _0x5c5be5}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x3461ea,ClipboardMarkersUtils as _0x538972}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x533de9,DataTransfer as _0x14401b,UpcastWriter as _0x1ec204,Matcher as _0x30140b}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x32b605,escape as _0xebdeba}from'lodash-es';import{BedrockRuntimeClient as _0x4975ad,InvokeModelWithResponseStreamCommand as _0x5c4661,InvokeModelCommand as _0x152e38}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x3fe2e5,_0x13e76d){const _0x3ef8ae=(0x0,_0x13e76d['t'])('Other');return _0x3fe2e5['length']?'groupId'in _0x3fe2e5[0x0]?_0x3fe2e5:[{'groupId':x,'groupLabel':_0x3ef8ae,'order':0x1/0x0,'commands':_0x3fe2e5}]:[{'groupId':x,'groupLabel':_0x3ef8ae,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x5b41a4{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x5e2362}=this,_0x148180=['ck-fake-ai-selection'];_0x5e2362['config']['get']('ai.useTheme')&&_0x148180['push']('ck-ai-assistant-ui_theme'),_0x5e2362['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x148180,'priority':0xc}}),_0x5e2362['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x3e898e,{writer:_0x2fce0c})=>{if(!_0x3e898e['markerRange']['isCollapsed'])return null;const _0x10d48b=_0x2fce0c['createUIElement']('span');return _0x2fce0c['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x10d48b),_0x10d48b;}});}['afterInit'](){!async function(_0x43cad2){const _0xd8366d=_0x3c8cf2([0x68,0x64,0x32,0x6f,0x66,0x43,0x31,0x6d,0x4a,0x74,0x77,0x72,0x54,0x7a,0x6a,0x35,0x52,0x56,0x75,0x55,0x63,0x37,0x38,0x6b,0x53,0x57,0x33,0x42,0x47,0x49,0x51,0x39,0x46,0x44,0x50,0x61,0x78,0x76,0x79,0x6c,0x4e,0x70,0x71,0x62,0x4b,0x67,0x58,0x4c,0x65,0x5a,0x6e,0x41,0x73,0x45,0x4d,0x36,0x30,0x34,0x48,0x69,0x4f,0x59]),_0x177e8a=0x6d6740af,_0x5a95af=0x6d60201f^_0x177e8a,_0x472df5=window[_0x3c8cf2([0x44,0x61,0x74,0x65])][_0x3c8cf2([0x6e,0x6f,0x77])](),_0x5e071f=_0x43cad2[_0x3c8cf2([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x243334=new window[(_0x3c8cf2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x134e59=>{_0x5e071f[_0x3c8cf2([0x6f,0x6e,0x63,0x65])](_0x3c8cf2([0x72,0x65,0x61,0x64,0x79]),_0x134e59);}),_0x320fa0={[_0x3c8cf2([0x6b,0x74,0x79])]:_0x3c8cf2([0x45,0x43]),[_0x3c8cf2([0x75,0x73,0x65])]:_0x3c8cf2([0x73,0x69,0x67]),[_0x3c8cf2([0x63,0x72,0x76])]:_0x3c8cf2([0x50,0x2d,0x32,0x35,0x36]),[_0x3c8cf2([0x78])]:_0x3c8cf2([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]),[_0x3c8cf2([0x79])]:_0x3c8cf2([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]),[_0x3c8cf2([0x61,0x6c,0x67])]:_0x3c8cf2([0x45,0x53,0x32,0x35,0x36])},_0x755650=_0x5e071f[_0x3c8cf2([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3c8cf2([0x67,0x65,0x74])](_0x3c8cf2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x340370(){let _0x36b600,_0x16f28a=null,_0x3b5673=null;try{if(_0x755650==_0x3c8cf2([0x47,0x50,0x4c]))return _0x3c8cf2([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x36b600=_0x15a2ed(),!_0x36b600)return _0x3c8cf2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x36b600[_0x3c8cf2([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3b5673=_0x29c0cd(_0x36b600[_0x3c8cf2([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x36b600[_0x3c8cf2([0x6a,0x74,0x69])])),await _0x389365()?_0x45e456()?_0xfa05ae()?_0x3c8cf2([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x48966e()?(_0x36b600[_0x3c8cf2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3c8cf2([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x16f28a=_0x3685e8(_0x3c8cf2([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x36b600[_0x3c8cf2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3c8cf2([0x74,0x72,0x69,0x61,0x6c])&&(_0x16f28a=_0x3685e8(_0x3c8cf2([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x463d3b()):_0x3c8cf2([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3c8cf2([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3c8cf2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x481f3d){return _0x3c8cf2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0xfa05ae(){const _0x43fc9a=[_0x3c8cf2([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3c8cf2([0x74,0x72,0x69,0x61,0x6c])][_0x3c8cf2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x36b600[_0x3c8cf2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x472df5/0x3e8:0xe10*_0x5a95af;return _0x36b600[_0x3c8cf2([0x65,0x78,0x70])]<_0x43fc9a;}function _0x45e456(){const _0x47dfed=_0x36b600[_0x3c8cf2([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x47dfed&&(!!_0x47dfed[_0x3c8cf2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c8cf2([0x2a]))||!!_0x47dfed[_0x3c8cf2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c8cf2([0x41,0x49])));}function _0x48966e(){const _0x1f61af=_0x36b600[_0x3c8cf2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1f61af||0x0==_0x1f61af[_0x3c8cf2([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x384f96}=new URL(window[_0x3c8cf2([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1f61af[_0x3c8cf2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x384f96))return!0x0;const _0x1e8c0b=_0x384f96[_0x3c8cf2([0x73,0x70,0x6c,0x69,0x74])](_0x3c8cf2([0x2e]));return _0x1f61af[_0x3c8cf2([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x113a0b=>_0x113a0b[_0x3c8cf2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c8cf2([0x2a])))[_0x3c8cf2([0x6d,0x61,0x70])](_0xb19aa=>_0xb19aa[_0x3c8cf2([0x73,0x70,0x6c,0x69,0x74])](_0x3c8cf2([0x2e])))[_0x3c8cf2([0x73,0x6f,0x6d,0x65])](_0x59b39a=>_0x1e8c0b[_0x3c8cf2([0x65,0x76,0x65,0x72,0x79])]((_0x53184a,_0x27c7a5)=>_0x59b39a[_0x27c7a5]===_0x53184a||_0x59b39a[_0x27c7a5]===_0x3c8cf2([0x2a])));}function _0x463d3b(){return _0x16f28a&&_0x3b5673?new window[(_0x3c8cf2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4b91d3,_0x16a74c)=>{_0x16f28a[_0x3c8cf2([0x74,0x68,0x65,0x6e])](_0x4b91d3,_0x16a74c),_0x3b5673[_0x3c8cf2([0x74,0x68,0x65,0x6e])](_0x6322a6=>{_0x6322a6!=_0x3c8cf2([0x56,0x61,0x6c,0x69,0x64])&&_0x4b91d3(_0x6322a6);},_0x16a74c);}):_0x16f28a||_0x3b5673||_0x3c8cf2([0x56,0x61,0x6c,0x69,0x64]);}}function _0x29c0cd(_0x3b9d0c,_0x3b2998){return new window[(_0x3c8cf2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x43361e=>{if(_0x1b2e3f())return _0x43361e(_0x3c8cf2([0x56,0x61,0x6c,0x69,0x64]));_0x29e006(),_0x5e071f[_0x3c8cf2([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3c8cf2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3e1582=!0x1;const _0x3c6b4=_0x55f305();function _0x3dbcd2(_0x2c0bb8){return!!_0x2c0bb8&&(typeof _0x2c0bb8===_0x3c8cf2([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2c0bb8===_0x3c8cf2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2c0bb8[_0x3c8cf2([0x74,0x68,0x65,0x6e])]===_0x3c8cf2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2c0bb8[_0x3c8cf2([0x63,0x61,0x74,0x63,0x68])]===_0x3c8cf2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0xcf135(_0xf0f3aa){_0x10e1d6(_0xf0f3aa)[_0x3c8cf2([0x74,0x68,0x65,0x6e])](_0x22af4b=>{if(!_0x22af4b||_0x22af4b[_0x3c8cf2([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3c8cf2([0x6f,0x6b]))return _0x3c8cf2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x9b21a1(_0x4592a4(_0x3c6b4+_0x3b2998))!=_0x22af4b[_0x3c8cf2([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3c8cf2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3c8cf2([0x56,0x61,0x6c,0x69,0x64]);})[_0x3c8cf2([0x74,0x68,0x65,0x6e])](_0x29715d=>(_0x41d1ad(),_0x29715d),()=>{const _0xb2060d=_0x66b339();return null==_0xb2060d?(_0x41d1ad(),_0x3c8cf2([0x56,0x61,0x6c,0x69,0x64])):_0x3c8cf2(_0x472df5-_0xb2060d>(0x496bc4af^_0x177e8a)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3c8cf2([0x74,0x68,0x65,0x6e])](_0x43361e)[_0x3c8cf2([0x63,0x61,0x74,0x63,0x68])](()=>{_0x43361e(_0x3c8cf2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x4fef72=0x6d51ae2f^_0x177e8a;function _0x41d1ad(){const _0x594e3b=_0x3c8cf2([0x6c,0x6c,0x63,0x74,0x2d])+_0x9b21a1(_0x4592a4(_0x3b9d0c)),_0x626cbf=_0x53c944(_0x9b21a1(window[_0x3c8cf2([0x4d,0x61,0x74,0x68])][_0x3c8cf2([0x63,0x65,0x69,0x6c])](_0x472df5/_0x4fef72)));window[_0x3c8cf2([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3c8cf2([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x594e3b,_0x626cbf);}function _0x66b339(){const _0x2aa655=_0x3c8cf2([0x6c,0x6c,0x63,0x74,0x2d])+_0x9b21a1(_0x4592a4(_0x3b9d0c)),_0x1c426b=window[_0x3c8cf2([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3c8cf2([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2aa655);return _0x1c426b?window[_0x3c8cf2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x53c944(_0x1c426b),0x10)*_0x4fef72:null;}function _0x10e1d6(_0x2b0d02){return new window[(_0x3c8cf2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x30476c,_0x42fb23)=>{_0x2b0d02[_0x3c8cf2([0x74,0x68,0x65,0x6e])](_0x30476c,_0x42fb23),window[_0x3c8cf2([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x42fb23,0x6d66946f^_0x177e8a);});}}_0x5e071f[_0x3c8cf2([0x6f,0x6e])](_0x3c8cf2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3914c8,_0x8f09b9)=>{if(_0x8f09b9[0x0]!=_0x3b9d0c)return _0x43361e(_0x3c8cf2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x8f09b9[0x1]={..._0x8f09b9[0x1],[_0x3c8cf2([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3c6b4};},{[_0x3c8cf2([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3c8cf2([0x68,0x69,0x67,0x68])}),_0x5e071f[_0x3c8cf2([0x6f,0x6e])](_0x3c8cf2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3e2c18=>{_0x3dbcd2(_0x3e2c18[_0x3c8cf2([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3e1582=!0x0,_0xcf135(_0x3e2c18[_0x3c8cf2([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3c8cf2([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3c8cf2([0x6c,0x6f,0x77])}),_0x243334[_0x3c8cf2([0x74,0x68,0x65,0x6e])](()=>{_0x3e1582||_0x43361e(_0x3c8cf2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x1b2e3f(){return _0x5e071f[_0x3c8cf2([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3c8cf2([0x76,0x69,0x65,0x77])][_0x3c8cf2([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3c8cf2([0x61,0x75,0x74,0x6f]);}function _0x29e006(){_0x5e071f[_0x3c8cf2([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3c8cf2([0x76,0x69,0x65,0x77])][_0x3c8cf2([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3c8cf2([0x61,0x75,0x74,0x6f]);}}function _0x3685e8(_0x624a97){const _0x51a260=[new window[(_0x3c8cf2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x6ba77=>setTimeout(_0x6ba77,0x6d6e7e63^_0x177e8a)),_0x243334[_0x3c8cf2([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3c8cf2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x484b32=>{let _0x5b61c6=0x0;_0x5e071f[_0x3c8cf2([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c8cf2([0x6f,0x6e])](_0x3c8cf2([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x38c5da,_0x12b801)=>{_0x12b801[0x0][_0x3c8cf2([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x5b61c6++,_0x5b61c6==(0x6d674157^_0x177e8a)&&(_0x484b32(),_0x38c5da[_0x3c8cf2([0x6f,0x66,0x66])]());});}))];return window[_0x3c8cf2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3c8cf2([0x72,0x61,0x63,0x65])](_0x51a260)[_0x3c8cf2([0x74,0x68,0x65,0x6e])](()=>_0x624a97);}async function _0x440f78(){await _0x243334,_0x5e071f[_0x3c8cf2([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c8cf2([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x434f72,_0x5e071f[_0x3c8cf2([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c8cf2([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x434f72,_0x5e071f[_0x3c8cf2([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3c8cf2([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3c1e5e(_0x47d310){const _0x2a38b3=_0x5cf8bb();_0x5e071f[_0x2a38b3]=_0x3c8cf2([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x47d310,_0x47d310!=_0x3c8cf2([0x56,0x61,0x6c,0x69,0x64])&&_0x440f78();}function _0x5cf8bb(){const _0x114ad0=window[_0x3c8cf2([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3c8cf2([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3c8cf2([0x6e,0x6f,0x77])]())[_0x3c8cf2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3c8cf2([0x2e]),'');let _0xa6e2b9=_0x3c8cf2([0x68]);for(let _0x28c2b3=0x0;_0x28c2b3<_0x114ad0[_0x3c8cf2([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x28c2b3+=0x2){let _0x45b9e2=window[_0x3c8cf2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x114ad0[_0x3c8cf2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x28c2b3,_0x28c2b3+0x2));_0x45b9e2>=_0xd8366d[_0x3c8cf2([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x45b9e2-=_0xd8366d[_0x3c8cf2([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0xa6e2b9+=_0xd8366d[_0x45b9e2];}return _0xa6e2b9;}function _0x15a2ed(){const _0x5e8ae1=_0x755650[_0x3c8cf2([0x73,0x70,0x6c,0x69,0x74])](_0x3c8cf2([0x2e]));if(0x3!=_0x5e8ae1[_0x3c8cf2([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x403b3f(_0x5e8ae1[0x1]);function _0x403b3f(_0x357be3){const _0x561660=_0x5bd07d(_0x357be3);return _0x561660&&_0x5d1be4()?_0x561660:null;function _0x5d1be4(){const _0x6c9ffa=_0x561660[_0x3c8cf2([0x6a,0x74,0x69])],_0x462e08=window[_0x3c8cf2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x6c9ffa[_0x3c8cf2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x6c9ffa[_0x3c8cf2([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x42dff4={..._0x561660,[_0x3c8cf2([0x6a,0x74,0x69])]:_0x6c9ffa[_0x3c8cf2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x6c9ffa[_0x3c8cf2([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x42dff4[_0x3c8cf2([0x76,0x63])],_0x4592a4(_0x42dff4)==_0x462e08;}}}async function _0x389365(){let _0x1c36fe=!0x0;try{const _0x1d70cb=_0x755650[_0x3c8cf2([0x73,0x70,0x6c,0x69,0x74])](_0x3c8cf2([0x2e])),[_0x5c585d,_0x5e5fd0,_0x3e297c]=_0x1d70cb;return _0x13a58f(_0x5c585d),await _0x49e72e(_0x5c585d,_0x5e5fd0,_0x3e297c),_0x1c36fe;}catch(_0x4eb6dc){return!0x1;}function _0x13a58f(_0x4620bc){const _0x56f0f0=_0x5bd07d(_0x4620bc);_0x56f0f0&&_0x56f0f0[_0x3c8cf2([0x61,0x6c,0x67])]==_0x3c8cf2([0x45,0x53,0x32,0x35,0x36])||(_0x1c36fe=!0x1);}async function _0x49e72e(_0x5b8067,_0xf9d73c,_0x3a7232){const _0x2fed9d=window[_0x3c8cf2([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3c8cf2([0x66,0x72,0x6f,0x6d])](_0x46bdb6(_0x3a7232),_0x534e8c=>_0x534e8c[_0x3c8cf2([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x53365f=new window[(_0x3c8cf2([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3c8cf2([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5b8067+_0x3c8cf2([0x2e])+_0xf9d73c),_0x37c317=window[_0x3c8cf2([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3c8cf2([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x37c317)return;const _0x1e40ea=await _0x37c317[_0x3c8cf2([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3c8cf2([0x6a,0x77,0x6b]),_0x320fa0,{[_0x3c8cf2([0x6e,0x61,0x6d,0x65])]:_0x3c8cf2([0x45,0x43,0x44,0x53,0x41]),[_0x3c8cf2([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3c8cf2([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3c8cf2([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x37c317[_0x3c8cf2([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3c8cf2([0x6e,0x61,0x6d,0x65])]:_0x3c8cf2([0x45,0x43,0x44,0x53,0x41]),[_0x3c8cf2([0x68,0x61,0x73,0x68])]:{[_0x3c8cf2([0x6e,0x61,0x6d,0x65])]:_0x3c8cf2([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1e40ea,_0x2fed9d,_0x53365f)||(_0x1c36fe=!0x1);}}function _0x5bd07d(_0x6c24fb){return _0x6c24fb[_0x3c8cf2([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3c8cf2([0x65,0x79]))?JSON[_0x3c8cf2([0x70,0x61,0x72,0x73,0x65])](_0x46bdb6(_0x6c24fb)):null;}function _0x46bdb6(_0x2f4c39){return window[_0x3c8cf2([0x61,0x74,0x6f,0x62])](_0x2f4c39[_0x3c8cf2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3c8cf2([0x2b]))[_0x3c8cf2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3c8cf2([0x2f])));}function _0x4592a4(_0x18b23c){let _0x28554c=0x1505;function _0xa218b7(_0x771704){for(let _0x3c45ad=0x0;_0x3c45ad<_0x771704[_0x3c8cf2([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3c45ad++){const _0x1e7983=_0x771704[_0x3c8cf2([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x3c45ad);_0x28554c=(_0x28554c<<0x5)+_0x28554c+_0x1e7983,_0x28554c&=_0x28554c;}}function _0x128194(_0x145677){Array[_0x3c8cf2([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x145677)?_0x145677[_0x3c8cf2([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x128194):_0x145677&&typeof _0x145677==_0x3c8cf2([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3c8cf2([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x145677)[_0x3c8cf2([0x73,0x6f,0x72,0x74])]()[_0x3c8cf2([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4e66ed,_0x38d6d1])=>{_0xa218b7(_0x4e66ed),_0x128194(_0x38d6d1);}):_0xa218b7(window[_0x3c8cf2([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x145677));}return _0x128194(_0x18b23c),_0x28554c>>>0x0;}function _0x9b21a1(_0x785446){return _0x785446[_0x3c8cf2([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3c8cf2([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3c8cf2([0x30]));}function _0x53c944(_0x4dbbed){return _0x4dbbed[_0x3c8cf2([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3c8cf2([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3c8cf2([0x6a,0x6f,0x69,0x6e])]('');}function _0x434f72(){}function _0x3c8cf2(_0xb5c14c){return _0xb5c14c['map'](_0x1d4ab4=>String['fromCharCode'](_0x1d4ab4))['join']('');}_0x3c1e5e(await _0x340370());}(this);}['showFakeVisualSelection'](){const _0x11fa7e=this['editor']['model'];_0x11fa7e['change'](_0x27a864=>{const _0x469482=_0x11fa7e['document']['selection']['getRanges']();let _0x20c4c8=0x0;for(const _0x2389de of _0x469482){const _0x22ba56=f+':'+_0x20c4c8;if(_0x11fa7e['markers']['has'](_0x22ba56))_0x27a864['updateMarker'](_0x22ba56,{'range':_0x2389de});else{if(_0x2389de['start']['isAtEnd']){const _0x44028e=_0x2389de['start']['getLastMatchingPosition'](({item:_0x3234f9})=>!_0x11fa7e['schema']['isContent'](_0x3234f9),{'boundaries':_0x2389de});_0x27a864['addMarker'](_0x22ba56,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x27a864['createRange'](_0x44028e,_0x2389de['end'])});}else _0x27a864['addMarker'](_0x22ba56,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2389de});}_0x20c4c8++;}});}['hideFakeVisualSelection'](){const _0xac9c42=this['editor']['model'],_0x16abf7=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x16abf7['length']&&_0xac9c42['change'](_0x3e7f31=>{_0x16abf7['forEach'](_0x590e90=>{_0x3e7f31['removeMarker'](_0x590e90);});});}['insertContent'](_0x1572c8,_0x43fe57){const _0x135102=this['_getAISelection'](),_0x467e84=_0x43fe57||_0x135102['getFirstRange']();this['editor']['model']['canEditAt'](_0x467e84)&&this['editor']['model']['change'](_0x586031=>{this['hideFakeVisualSelection'](),_0x43fe57||this['_resetContentOfSelectedTableCells'](_0x586031,_0x135102),this['_pasteHTMLUsingClipboard']({'insertAt':_0x467e84,'writer':_0x586031,'html':_0x1572c8});});}['insertContentBelow'](_0x3a3296){const {model:_0x3ea0de}=this['editor'],_0x412157=this['_getAISelection']();_0x3ea0de['change'](()=>{const _0x474327=this['_prepareTableInsertBelowPosition'](_0x3a3296,_0x412157)||this['_getDefaultInsertBelowPosition'](_0x412157);this['insertContent'](_0x3a3296,_0x474327);});}['_getAISelection'](){const _0x499d52=this['editor']['model'],_0x5e3334=Array['from'](_0x499d52['markers']['getMarkersGroup'](f))['map'](_0x81a6af=>_0x81a6af['getRange']());return _0x499d52['createSelection'](_0x5e3334);}['_pasteHTMLUsingClipboard']({writer:_0x4adda5,html:_0x559ca4,insertAt:_0x278ce6}){const {view:_0x40bcfa}=this['editor']['editing'],_0x1388af=this['editor']['plugins']['get'](_0x3461ea),_0x349de2=new dt();_0x349de2['setData']('text/html',_0x559ca4);const _0x1819a3=new ClipboardEvent('paste',{'clipboardData':_0x349de2}),_0x57c06a=new _0x533de9(_0x40bcfa,_0x1819a3,{'dataTransfer':new _0x14401b(_0x349de2)});_0x4adda5['setSelection'](_0x278ce6);const _0x43b294=(_0x18a77f,_0x131941)=>{_0x131941['resultRange']&&_0x4adda5['setSelection'](_0x131941['resultRange']);};_0x1388af['once']('contentInsertion',_0x43b294,{'priority':'lowest'}),_0x40bcfa['document']['fire']('paste',_0x57c06a),_0x1388af['off']('contentInsertion',_0x43b294);}['_getDefaultInsertBelowPosition'](_0x365e38){const {model:_0x2f593c}=this['editor'],_0x2141c7=Array['from'](_0x365e38['getSelectedBlocks']());return _0x2141c7['length']?_0x2f593c['createPositionAfter'](_0x2141c7['pop']()):_0x365e38['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0xb8720c,_0xf4b66f){const {model:_0x2c90a9,plugins:_0x4835e7}=this['editor'];if(_0x4835e7['has']('TableUtils')){const _0x5a09a0=_0x4835e7['get']('TableUtils')['getSelectedTableCells'](_0xf4b66f);if(_0x5a09a0['length']){const _0x4ae7c0=this['_getTableRowCountFromContent'](_0xb8720c),_0x2c9e60=this['_createEmptyTableRows'](_0x5a09a0,_0x4ae7c0);return _0x2c90a9['createPositionAt'](_0x2c9e60,0x0);}}return null;}['_getTableRowCountFromContent'](_0x219153){const _0x2b6838=this['editor']['plugins']['get']('TableUtils'),_0x32259f=this['editor']['data']['parse'](_0x219153),_0x2f6b4b=Array['from'](_0x32259f['getChildren']())['filter'](_0x365dd9=>_0x365dd9['is']('element','table'));let _0x1998a9=0x0;return _0x2f6b4b['forEach'](_0x15ebec=>{_0x1998a9+=_0x2b6838['getRows'](_0x15ebec);}),_0x1998a9;}['_createEmptyTableRows'](_0x2865a5,_0x412cbb){const _0x143351=this['editor']['plugins']['get']('TableUtils'),_0x42ccee=_0x143351['getRowIndexes'](_0x2865a5),_0x20d0ff=_0x143351['getColumnIndexes'](_0x2865a5),_0x5a2ab3=_0x42ccee['last']+0x1,_0x12862b=_0x20d0ff['first'],_0x5135ab=_0x2865a5[0x0]['findAncestor']('table');for(let _0x50a348=0x0;_0x50a348<_0x412cbb;_0x50a348++)_0x143351['insertRows'](_0x5135ab,{'at':_0x5a2ab3});return _0x5135ab['getChild'](_0x5a2ab3)['getChild'](_0x12862b);}['_resetContentOfSelectedTableCells'](_0x507d91,_0x5cc3ae){const {plugins:_0x1cc400}=this['editor'],{model:_0x121f42}=_0x507d91;if(!_0x1cc400['has']('TableUtils'))return;_0x1cc400['get']('TableUtils')['getSelectedTableCells'](_0x5cc3ae)['length']&&_0x121f42['deleteContent'](_0x5cc3ae);}}class K extends _0x5b41a4{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x918a5e('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x1834aa){super(_0x1834aa),this['name']='AIRequestError';}}function i(_0x41f302,_0x6e46ba,_0x324827){const t=_0x41f302['t'];switch(_0x6e46ba){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',_0x324827);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x324827);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'},_0x324827);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 _0x6e46ba;}}class E extends _0x2c6a2c{['_commandDefinitions'];constructor(_0x86886d,_0x408218){super(_0x86886d),this['_commandDefinitions']=_0x408218,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x496795,_0x514710,_0xb78ade)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0xb78ade));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x153e55,_0x500d98,_0x386686)=>{this['enabledCommandsIds']=_0x386686?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x184288=this['editor']['model'];this['_hasContext']=function(_0x40fd88){const _0x25c413=_0x40fd88['document']['selection'];return _0x25c413['isCollapsed']?0x0!==[..._0x25c413['getSelectedBlocks']()]['length']&&![..._0x25c413['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x40fd88['hasContent'](_0x25c413['getFirstRange']());}(_0x184288);const _0x196b5d=_0x184288['document']['selection'],_0xb7bccf=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x54fb1b of _0x196b5d['getRanges']())for(const _0xde2a1b of _0x54fb1b['getItems']())if(_0xde2a1b['is']('element')&&_0xb7bccf['includes'](_0xde2a1b['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x23d40d='',_0xe1c5c9='',_0x491767='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x23d40d,_0xe1c5c9,_0x491767);}}function G(_0x3fa5e9,_0x4fc628){const _0x410cb9=new Set();for(const _0xb232ce of _0x3fa5e9['values']())(_0x4fc628||!0x1===_0xb232ce['requiresContent'])&&_0x410cb9['add'](_0xb232ce['id']);return Array['from'](_0x410cb9);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x1cad79(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0xaa6e20,_0x4010e2,_0x166960){super(),this['editor']=_0xaa6e20,this['textAdapter']=_0x4010e2,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x166960,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x383c3a,_0x5692d7,_0x1aaf27)=>{this['view']['value']=this['_sanitizeHTML'](_0x1aaf27);}),this['listenTo'](this['view'],'submitPrompt',(_0x55b051,_0x42a9d3)=>{const _0x4945b4=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x42a9d3,_0x4945b4,'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:_0x13ae71,query:_0x528f8a,htmlContent:_0xedde1,label:_0x9a36fa,mainActionLabel:_0x46014d}){this['view']['prompt']=_0x9a36fa,this['view']['mainAction']=_0x46014d,this['initialContext']=_0xedde1,_0x528f8a&&(this['view']['isRendered']?this['_handleQuery'](_0x528f8a,_0xedde1,_0x13ae71,_0x9a36fa):this['view']['once']('render',()=>{this['_handleQuery'](_0x528f8a,_0xedde1,_0x13ae71,_0x9a36fa);}));}['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'](_0xd40a99,_0xb6e6df,_0x14e929,_0x174b15){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0xb6e6df,this['previousQuery']=_0xd40a99,this['previousLabel']=_0x174b15||_0xd40a99,this['previousActionId']=_0x14e929,new Promise(_0x3d851b=>{this['textAdapter']['makeRequest']({'query':_0xd40a99,'context':_0xb6e6df,'onData':_0x4f8237=>{this['currentResponse']=_0x4f8237,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x14e929})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x208c9d=>{_0x208c9d instanceof R?this['view']['handleError'](_0x208c9d['message']):this['view']['handleError'](),_0x3d851b();})['finally'](()=>{this['stopProcessing'](),_0x3d851b();});});}['_parseAndNormalizeContent'](_0x1c7fc0,_0x12df11=!0x1){const _0x324d12=Z['exec'](_0x1c7fc0);_0x1c7fc0=_0x324d12?_0x1c7fc0['substring'](_0x324d12[0x1]['length']):_0x1c7fc0['length']<0x64&&!_0x12df11?'':this['_stripMarkdownSyntax'](_0x1c7fc0);const _0xc20e05=this['_domParser']['parseFromString'](_0x1c7fc0,'text/html');if(_0x324d12){const _0x248799=Array['from'](_0xc20e05['body']['childNodes']);_0x248799['reverse']();for(const _0x17be1d of _0x248799){if(_0x17be1d['nodeType']==Node['ELEMENT_NODE'])break;_0x17be1d['remove']();}}const _0x4173d3=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xc20e05['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4173d3);const _0x1b3f4e=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x745a66=this['editor']['data']['toModel'](_0x4173d3);return _0x1b3f4e||_0x745a66['markers']['clear'](),this['editor']['data']['stringify'](_0x745a66);}['_normalizeResponseHeadings'](_0x22eff1){const _0x439a70=new _0x1ec204(this['editor']['editing']['view']['document']),_0x101760=new _0x30140b({'name':/^h[1-5]$/}),_0x53fcd9=[];let _0x2781a3=!0x1;for(const _0x3ee44f of _0x22eff1)_0x3ee44f['is']('element')&&_0x101760['match'](_0x3ee44f)&&(_0x53fcd9['push'](_0x3ee44f),'h1'==_0x3ee44f['name']&&(_0x2781a3=!0x0));if(_0x2781a3){for(const _0x50e0e6 of _0x53fcd9)_0x439a70['rename']('h'+(parseInt(_0x50e0e6['name'][0x1])+0x1),_0x50e0e6);}}['_isH1TagSupportEnabled'](){const {data:_0x1863cf,editing:_0x264cba}=this['editor'],_0x3afb93=_0x1863cf['htmlProcessor']['toView']('<h1></h1>'),_0x28825f=_0x1863cf['toView'](_0x1863cf['toModel'](_0x3afb93));return!!_0x264cba['view']['domConverter']['viewToDom'](_0x28825f)['querySelector']('h1');}['_sanitizeHTML'](_0x1ad670){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x1ad670),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x511457){const _0x2adaa3=_0x511457['trim']();return _0x2adaa3['startsWith']('```html')?_0x2adaa3['endsWith']('```')?_0x2adaa3['substring'](0x7,_0x2adaa3['length']-0x3):_0x2adaa3['substring'](0x7):_0x511457;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x8c7b02){super(_0x8c7b02),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x45bf94=>i(_0x8c7b02,'AI_'+_0x45bf94['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x8c7b02,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x8c7b02,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x8c7b02,'Stop'));const _0x10a099=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x10a099['if']('isVisible','ck-hidden',_0x3e9a8a=>!_0x3e9a8a)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x8f433e,_0x380fd1){const _0x481eef=new _0x52e4b1(this['locale']);return _0x481eef['set']({'label':_0x8f433e,'class':_0x380fd1||'','isVisible':!0x0,'withText':!0x0}),_0x481eef;}}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 _0x1dcffe{['contentFieldView'];['copyButtonView'];constructor(_0x1d8b91,_0x30cf27=''){super(_0x1d8b91),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5e7bbb=this['bindTemplate'];this['contentFieldView']=new mt(_0x1d8b91,_0x30cf27),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x5e7bbb['if']('isVisible','ck-hidden',_0x39a1e0=>!_0x39a1e0)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x5e7bbb['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 _0x2f9fdf=!0x1;this['on']('change:value',(_0x40aeb7,_0x23a931,_0x20c8b8)=>{const _0x479a11=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x20c8b8),this['isProcessing']&&_0x479a11&&!_0x2f9fdf&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1a7035,_0x9ae50d,_0x307b0e)=>{_0x2f9fdf=!0x1,_0x307b0e?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x2f9fdf=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x2f9fdf=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5ee93c=this['locale'],_0x237cc6=new _0x52e4b1(this['locale']),_0x51a3b3='ck-ai-form__copy-button';return _0x237cc6['set']({'label':i(_0x5ee93c,'Copy'),'icon':W,'class':_0x51a3b3,'tooltip':!0x0}),_0x237cc6['bind']('isVisible')['to'](this,'value',_0x4f66a7=>!!_0x4f66a7),_0x237cc6['bind']('isEnabled')['to'](this,'isProcessing',_0x50ab0c=>!_0x50ab0c),_0x237cc6['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x237cc6['icon']=_0x40a29f['check'],_0x237cc6['class']=_0x51a3b3+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x237cc6['icon']=W,_0x237cc6['class']=_0x51a3b3;},0x3e8);}),_0x237cc6;}['_copyHTMLToClipboard'](_0x528aee){const {window:_0xabbe7c,document:_0x543f8b}=_0x14f3b1;if(_0xabbe7c['ClipboardItem']){const {Blob:_0x4e717c,ClipboardItem:_0x239b4a}=_0xabbe7c,_0xf80218=[new _0x239b4a({'text/html':new _0x4e717c([_0x528aee['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4e717c([_0x528aee['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0xf80218);}else{const _0x3323b4=_0x543f8b['createElement']('div');_0x3323b4['style']['position']='absolute',_0x3323b4['style']['left']='-9999px',_0x3323b4['innerHTML']='<span>[</span>'+_0x528aee['innerHTML']+'<span>]</span>',_0x543f8b['body']['appendChild'](_0x3323b4);const _0x15ac95=_0x543f8b['createRange']();_0x15ac95['setStartAfter'](_0x3323b4['firstElementChild']),_0x15ac95['setEndBefore'](_0x3323b4['lastElementChild']);const _0x1ca895=_0xabbe7c['getSelection']();_0x1ca895['removeAllRanges'](),_0x1ca895['addRange'](_0x15ac95),_0x543f8b['execCommand']('copy'),_0x3323b4['remove']();}}}class mt extends _0x1dcffe{constructor(_0x5752d8,_0xa65a81=''){super(_0x5752d8),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0xa65a81,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xe1285c){this['element']['innerHTML']=_0xe1285c;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4060da=new _0x1dcffe(),_0x6e0508=this['locale'],_0x33a9e0=new _0x199281();return _0x33a9e0['isVisible']=!0x0,_0x4060da['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x33a9e0,{'text':i(_0x6e0508,'AI\x20is\x20writing...')}]}),_0x4060da['render'](),_0x4060da;}}class rt extends _0x1dcffe{constructor(_0x19ec4e,_0x237bb1=''){super(_0x19ec4e);const _0xf52973=new _0x4e5d35(),_0x5264f4=this['bindTemplate'];this['set']('text',_0x237bb1),_0xf52973['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':[_0xf52973,{'text':_0x5264f4['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x1f6c9b,_0x49749d){super(_0x1f6c9b,_0x49749d),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',(_0x45ff19,_0x47fa29)=>{_0x45ff19['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x47fa29());});}['_createSubmitButton'](){const _0x579814=new _0x52e4b1(this['locale']),_0x480173=this['locale'];return _0x579814['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(_0x480173,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x579814['on']('execute',()=>{this['submit']();}),_0x579814['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3dbf6b,_0xa95481)=>!_0x3dbf6b&&_0xa95481),_0x579814;}['_createShowHistoryButton'](){const _0x9844b0=new _0x52e4b1(this['locale']),_0x5a4eca=this['resultsView'],_0x3560bf=this['locale'];_0x9844b0['set']({'label':i(_0x3560bf,'History'),'withText':!0x1,'icon':_0x40a29f['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x9844b0['bind']('isOn')['to'](_0x5a4eca,'isVisible'),_0x9844b0['bind']('isEnabled')['to'](this,'isEnabled'),_0x9844b0['on']('execute',()=>{_0x5a4eca['isVisible']=!_0x5a4eca['isVisible'],_0x5a4eca['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1be777=()=>{_0x14f3b1['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0xbed6cb=new st(this['queryView']['fieldView']['element']),_0x52f1cc=_0xbed6cb['width'],_0x119dfa='rtl'===_0x3560bf['uiLanguageDirection']?'left':'right';_0xbed6cb['excludeScrollbarsAndBorders'](),_0x9844b0['element']['style'][_0x119dfa]=_0x52f1cc-_0xbed6cb['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1be777),this['on']('render',_0x1be777),_0x9844b0;}['submit'](){const _0x16de98=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x16de98);}['focus'](_0x508087){-0x1===_0x508087?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x21e70e){super(_0x21e70e),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x21e70e,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x418dfc=0x0;for(const _0x137601 of this['items'])_0x418dfc+=_0x137601['items']['length'];return{'resultsCount':_0x418dfc,'totalItemsCount':_0x418dfc};}['_createClearHistoryButton'](){const _0x28f9b6=this['locale'],_0x3f2689=new _0x52e4b1(this['locale']);return _0x3f2689['set']({'label':'('+i(_0x28f9b6,'Clear')+')','withText':!0x0}),_0x3f2689['on']('execute',()=>this['fire']('clearHistory')),_0x3f2689;}}class hs extends _0x13466d{constructor(_0x259e87){super();const _0x21e8e4=new te(),_0x25486c=new _0x52e4b1(this['locale'],_0x21e8e4);this['children']['add'](_0x25486c),_0x25486c['set']({'label':_0x259e87['prompt'],'withText':!0x0}),_0x25486c['on']('execute',()=>{this['fire']('execute',{'value':_0x32b605(_0x259e87['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x320bfa{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x54b978,_0x2713a0)=>{const _0x34ff9c=Ss(_0x2713a0['prompt']);for(const _0x1f49fc of this)if(_0x1f49fc!=_0x2713a0&&Ss(_0x1f49fc['prompt'])===_0x34ff9c){this['remove'](_0x1f49fc);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x210d05=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x210d05));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x4e69ce=>_0x4e69ce)));}}function Ss(_0x5668ff){return _0x5668ff['toLowerCase']()['trim']();}class k extends _0x1dcffe{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2cd0aa,_0x1f739b,_0x406598=''){super(_0x2cd0aa),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(_0x2cd0aa),this['contentArea']=new X(_0x2cd0aa,_0x406598),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 _0x2e8a9b(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x436d0e({'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 _0x3a9a14=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x1f739b],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3a9a14['if']('isError','ck-hidden',_0x116c1a=>!_0x116c1a)]},'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'](_0x4d8cb8=0x1){-0x1===_0x4d8cb8?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 _0x4e2bd0=this['locale'],_0x3e45a0=new ht(_0x4e2bd0,{'queryView':{'label':i(_0x4e2bd0,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x15cea1,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x4e2bd0,'Empty\x20history'),'secondary':i(_0x4e2bd0,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3e45a0['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x41e3ef,_0x3bf5f0)=>_0x41e3ef&&!_0x3bf5f0),this['listenTo'](_0x3e45a0,'submit',(_0x5211b7,_0xc65ec5)=>{this['prompt']=_0xc65ec5;const _0x750d5e=_0xebdeba(_0xc65ec5);this['fire']('submitPrompt',_0x750d5e),_0xc65ec5['trim']()&&this['_promptHistory']['add']({'prompt':_0x750d5e},0x0);},{'priority':'high'}),_0x3e45a0;}['_createHistoryView'](){const _0x393d81=new rs(this['locale']);return _0x393d81['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x393d81['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x393d81;}['_createToolbar'](){const _0x57aff8=new at(this['locale']);return _0x57aff8['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2a2ea2,_0x1da026,_0x5838a5)=>_0x2a2ea2&&!_0x1da026&&!!_0x5838a5),_0x57aff8['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x57aff8['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x480812,_0x1b8d4e,_0x1b724a)=>_0x480812&&!_0x1b8d4e&&!!_0x1b724a),_0x57aff8['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x57aff8['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2a3558,_0x217896)=>_0x2a3558&&!_0x217896),_0x57aff8['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x57aff8['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x57aff8['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x57aff8;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x4905cd=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x4905cd,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x5d34d0){const _0x3f6fc6=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x5d34d0||i(_0x3f6fc6,'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 _0x5b41a4{['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[_0x538972,a,K,_0xf80c01];}constructor(_0x5f4094){super(_0x5f4094),_0x5f4094['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x5f4094['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x5f4094['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x5f4094['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x32ad4f}=this;this['_aiAdapter']=_0x32ad4f['plugins']['get'](K),this['_dialog']=_0x32ad4f['plugins']['get'](_0xf80c01),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x35bdee=new E(_0x32ad4f,Array['from'](this['_commandDefinitions']['values']()));_0x32ad4f['commands']['add']('showAIAssistant',_0x35bdee),_0x32ad4f['ui']['componentFactory']['add']('aiCommands',_0x5da61c=>{const _0x3698ae=_0x3cba5b(_0x5da61c);return _0x3698ae['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x3698ae['buttonView']['set']({'label':i(_0x5da61c,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x3698ae['on']('execute',_0xa1ce73=>this['_onExecute'](_0xa1ce73['source']['id'])),_0x1fbf52(_0x3698ae,_0x32ad4f['ui']['view']['body'],function(_0x78d848){const _0x342ac3=o(_0x78d848['config']['get']('ai.aiAssistant.commands'),_0x78d848['locale']),_0x1bd2ef=U(_0x78d848,_0x342ac3)['filter'](_0x294d4a=>_0x294d4a['commands']['length']);if(0x1===_0x1bd2ef['length'])return U(_0x78d848,_0x1bd2ef[0x0]['commands'])['map'](_0x32c20e=>({'id':_0x32c20e['id'],'label':_0x32c20e['label']}));return _0x1bd2ef['map'](_0x2f8580=>{const {groupId:_0x5edf0c,groupLabel:_0x57cbb6,commands:_0x29a3d7}=_0x2f8580,_0x3fd7f7=U(_0x78d848,_0x29a3d7)['map'](_0x1b21ba=>({'id':_0x1b21ba['id'],'label':_0x1b21ba['label']}));return{'id':_0x5edf0c,'menu':_0x57cbb6||_0x5edf0c,'children':_0x3fd7f7};});}(_0x32ad4f),{'ariaLabel':i(_0x5da61c,'AI\x20Commands')}),_0x3698ae['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x35bdee['on']('change:enabledCommandsIds',_0x6f99ff),_0x3698ae['menuView']['once']('render',_0x6f99ff),_0x3698ae;function _0x6f99ff(){_0x3698ae['isEnabled']=_0x35bdee['enabledCommandsIds']['length']>0x0;for(const _0x2d34c8 of _0x3698ae['menuView']['buttons'])_0x2d34c8['isEnabled']=_0x35bdee['enabledCommandsIds']['includes'](_0x2d34c8['id']);}}),_0x32ad4f['ui']['componentFactory']['add']('menuBar:aiCommands',_0x344120=>{const _0x1e252a=new _0x27b750(_0x344120);_0x1e252a['buttonView']['set']({'label':i(_0x344120,'AI\x20Commands'),'icon':T}),_0x1e252a['bind']('isEnabled')['to'](_0x35bdee,'enabledCommandsIds',_0x3d847c=>_0x3d847c['length']>0x0);const _0x2ac3f4=o(_0x32ad4f['config']['get']('ai.aiAssistant.commands'),_0x344120);return this['_populateMenuBarMenu'](_0x35bdee,_0x1e252a,_0x2ac3f4,_0x3f96b4=>this['_onExecute'](_0x3f96b4)),_0x1e252a;}),_0x32ad4f['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x446e43=this['_createAIAssistantUIButton'](_0x52e4b1);return _0x446e43['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x446e43;}),_0x32ad4f['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x30d28f=this['_createAIAssistantUIButton'](_0x7b2d5e);return _0x30d28f['set']({'role':'menuitemcheckbox'}),_0x30d28f;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x184e01=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3aa822;for(const _0xa1f53d in _0x184e01){const _0x29ca01=_0xa1f53d,_0xb747bd=_0x184e01[_0x29ca01];if('aiLicenseKeyValid'==_0xb747bd||'aiLicenseKeyInvalid'==_0xb747bd||'aiLicenseKeyExpired'==_0xb747bd||'aiLicenseKeyDomainLimit'==_0xb747bd||'aiLicenseKeyNotAllowed'==_0xb747bd||'aiLicenseKeyEvaluationLimit'==_0xb747bd||'aiLicenseKeyTrialLimit'==_0xb747bd||'aiLicenseKeyUsageLimit'==_0xb747bd){delete _0x184e01[_0x29ca01],_0x3aa822=_0xb747bd,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3aa822&&_0x184e01['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3aa822&&_0x184e01['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3aa822&&_0x184e01['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3aa822&&_0x184e01['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3aa822&&_0x184e01['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x3aa822&&_0x184e01['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x3aa822&&_0x184e01['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3e5184='',_0x296938='',_0x5802b8='custom'){const _0x48f092=this['editor'],_0xab24d4=_0x48f092['editing']['view'],_0x35f797=_0x48f092['plugins']['get'](a),_0x5180c4=_0x48f092['plugins']['get'](_0x538972);_0x35f797['showFakeVisualSelection']();const _0x45b514=new w(),_0x3dab05=new ClipboardEvent('copy',{'clipboardData':_0x45b514}),_0x457414=new _0x14401b(_0x45b514),_0x4bef56=new _0x533de9(_0xab24d4,_0x3dab05,{'dataTransfer':_0x457414});_0x5180c4['_forceMarkersCopy']('comment',()=>{_0xab24d4['document']['fire']('copy',_0x4bef56);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x48f092,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x2ff67f=_0x457414['getData']('text/html');const _0x23cee9=_0x48f092['model']['document']['selection'],_0x378899=Array['from'](_0x23cee9['getRanges']());0x1===_0x378899['length']&&_0x378899[0x0]['isFlat']&&!_0x23cee9['getSelectedElement']()&&''!==_0x2ff67f['replace'](/ /g,'')['trim']()&&(_0x2ff67f='<p>'+_0x2ff67f+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5802b8,'query':_0x3e5184,'htmlContent':_0x2ff67f,'label':_0x296938,'mainActionLabel':M[_0x48f092['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':_0x40eed2['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x35f797['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x90ef3c=new Map(),_0x416588=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x4bdbc1 of _0x416588)for(const _0x1c1480 of _0x4bdbc1['commands'])_0x90ef3c['set'](_0x1c1480['id'],{..._0x1c1480,'groupId':_0x4bdbc1['groupId'],'groupLabel':_0x4bdbc1['groupLabel']||_0x4bdbc1['groupId']});return _0x90ef3c;}['_createAIAssistantUIButton'](_0x41ae68){const _0x15fb1b=this['editor'],_0xaf82cd=_0x15fb1b['commands']['get']('showAIAssistant'),_0x2ef044=new _0x41ae68(_0x15fb1b['locale']);return _0x2ef044['set']({'label':i(_0x15fb1b['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x2ef044['bind']('isEnabled')['to'](_0xaf82cd),_0x2ef044['bind']('isOn')['to'](this['_dialog'],'id',_0x579349=>'aiAssistant'===_0x579349),this['listenTo'](_0x2ef044,'execute',()=>{_0x2ef044['isOn']?this['hideUI']():_0xaf82cd['execute']();}),_0x2ef044;}['_initView'](){const _0x4f91dd=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',()=>{_0x4f91dd['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x4f91dd['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x55b988,ui:{ariaLiveAnnouncer:_0x4ab76d}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x3fc569,_0x5186a7,_0x3390b0)=>{const _0x288b87=this['_aiAssistantController']['currentContext'];_0x3390b0?_0x4ab76d['announce'](i(_0x55b988,'AI\x20is\x20writing')):_0x288b87&&_0x4ab76d['announce'](i(_0x55b988,'Generated\x20content:\x20%0',_0x288b87),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x51c690,_0x2c6c1b,_0x1de69e)=>{if(_0x1de69e){const _0x442096=this['_formView']['errorView']['text'];_0x4ab76d['announce'](i(_0x55b988,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x442096));}});}['_onExecute'](_0x37e937){const _0x421a75=this['_commandDefinitions']['get'](_0x37e937),_0x5eeef0=this['editor'],_0x36c1f3=_0x5eeef0['model']['document']['selection'],_0x47fb9d=_0x5eeef0['commands']['get']('showAIAssistant'),_0x7e27e4=_0x5eeef0['plugins']['get'](a),_0x40ae8d=''+(_0x421a75['groupId']!==x?_0x421a75['groupLabel']+':\x20':'')+_0x421a75['label'];if(!0x1!==_0x421a75['requiresContent']&&_0x36c1f3['isCollapsed']){const _0x3928d3=_0x474c7c(_0x36c1f3['getSelectedBlocks']())||_0x5eeef0['model']['schema']['getLimitElement'](_0x36c1f3);_0x5eeef0['model']['change'](_0x4017f7=>{_0x4017f7['setSelection'](_0x3928d3,'in');});}_0x7e27e4['showFakeVisualSelection'](),_0x47fb9d['execute'](_0x421a75['prompt'],_0x40ae8d,'command:'+_0x37e937);}['_populateMenuBarMenu'](_0x1a1a20,_0x6f739,_0x5ef600,_0x3adc75){const _0x13caef=this['editor'],_0x58eaca=_0x13caef['locale'],_0x529d28=new _0x371569(_0x58eaca),_0x1a88b0=U(_0x13caef,_0x5ef600)['filter'](_0x3f9958=>_0x3f9958['commands']['length']);0x1===_0x1a88b0['length']?this['_getMenuBarGroupButtons']({'command':_0x1a1a20,'commands':_0x1a88b0[0x0]['commands'],'parentMenuView':_0x6f739,'onExecute':_0x3adc75})['forEach'](_0x175f09=>_0x529d28['items']['add'](_0x175f09)):_0x1a88b0['forEach'](({groupId:_0x376119,groupLabel:_0x59167d,commands:_0x589f03})=>{const _0x179f0d=new _0x5c5be5(_0x58eaca,_0x6f739),_0x2fe388=new _0x27b750(_0x58eaca),_0x16d740=new _0x371569(_0x58eaca),_0xf8f816=this['_getMenuBarGroupButtons']({'command':_0x1a1a20,'commands':_0x589f03,'parentMenuView':_0x2fe388,'onExecute':_0x3adc75});_0x2fe388['buttonView']['set']({'label':_0x59167d||_0x376119}),_0x2fe388['delegate']('execute')['to'](_0x6f739),_0x16d740['items']['addMany'](_0xf8f816),_0x2fe388['panelView']['children']['add'](_0x16d740),_0x179f0d['children']['add'](_0x2fe388),_0x529d28['items']['add'](_0x179f0d);}),_0x6f739['panelView']['children']['add'](_0x529d28);}['_getMenuBarGroupButtons']({command:_0x7bfc07,commands:_0x123d9c,parentMenuView:_0x4e30d3,onExecute:_0x46e1ad}){const _0x2a72c4=this['editor'],_0x438221=_0x2a72c4['locale'];return U(_0x2a72c4,_0x123d9c)['map'](_0x3affa9=>{const _0x217eea=new _0x5c5be5(_0x438221,_0x4e30d3),_0xe6cbc9=new _0x7b2d5e(_0x438221);return _0xe6cbc9['set']({'label':_0x3affa9['label']}),_0xe6cbc9['delegate']('execute')['to'](_0x4e30d3),_0xe6cbc9['on']('execute',()=>_0x46e1ad(_0x3affa9['id'])),_0xe6cbc9['bind']('isEnabled')['to'](_0x7bfc07,'enabledCommandsIds',_0x1492c0=>_0x1492c0['includes'](_0x3affa9['id'])),_0x217eea['children']['add'](_0xe6cbc9),_0x217eea;});}}function B(_0x509d7f,_0x17848f){return void 0x0!==_0x509d7f['order']&&void 0x0===_0x17848f['order']?0x1:void 0x0===_0x509d7f['order']&&void 0x0!==_0x17848f['order']?-0x1:void 0x0!==_0x509d7f['order']&&void 0x0!==_0x17848f['order']?_0x509d7f['order']-_0x17848f['order']:0x0;}function U(_0x544d40,_0x28b03a){_0x28b03a['sort'](B);const _0xecee0={},_0x1ae4b7=[];for(const _0x2a5f2e of _0x28b03a)if(void 0x0!==_0x2a5f2e['order']){if(_0x2a5f2e['order']in _0xecee0)throw new _0x918a5e('ai-commands-config-order-collision',_0x544d40,{'conflictingDefinitions':[_0x2a5f2e,_0xecee0[_0x2a5f2e['order']]]});_0xecee0[_0x2a5f2e['order']]=_0x2a5f2e,_0x1ae4b7['splice'](_0x2a5f2e['order'],0x0,_0x2a5f2e);}else _0x1ae4b7['push'](_0x2a5f2e);return _0x1ae4b7;}class r extends _0x5b41a4{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3b498e){super(_0x3b498e);const _0x88c358=_0x3b498e['config'],_0x287116=_0x3b498e['locale'];_0x88c358['define']('ai.aiAssistant.preserveComments',!0x0),_0x88c358['define']('ai.aiAssistant.commands',function(_0x102369){return[{'groupId':'editOrReview','groupLabel':i(_0x102369,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x102369,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x102369,'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(_0x102369,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x102369,'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(_0x102369,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x102369,'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(_0x102369,'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(_0x102369,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x102369,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x102369,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x102369,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x102369,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x102369,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x102369,'Change\x20style'),'commands':[{'id':'business','label':i(_0x102369,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x102369,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x102369,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x102369,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x102369,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x102369,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x102369,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x102369,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x102369,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x102369,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x102369,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x102369,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x102369,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x287116)),_0x88c358['define']('ai.aiAssistant.extraCommandGroups',[]),_0x88c358['define']('ai.aiAssistant.removeCommands',[]);let _0x3080ff=o(_0x88c358['get']('ai.aiAssistant.commands'),_0x287116);const _0x23d100=_0x88c358['get']('ai.aiAssistant.extraCommandGroups'),_0xe8f50f=_0x88c358['get']('ai.aiAssistant.removeCommands');_0x23d100['forEach'](_0x449e39=>{const _0x3218fb=_0x3080ff['find'](_0x57abd0=>_0x57abd0['groupId']===_0x449e39['groupId']);_0x3218fb?_0x3218fb['commands']=_0x3218fb['commands']['concat'](_0x449e39['commands']):_0x3080ff['push'](_0x449e39);}),_0x3080ff=_0x3080ff['filter'](_0x29e579=>!_0xe8f50f['includes'](_0x29e579['groupId'])),_0x3080ff['forEach'](_0x20ac08=>{_0x20ac08['commands']=_0x20ac08['commands']['filter'](_0x516cb4=>!_0xe8f50f['includes'](_0x516cb4['id']));}),_0x88c358['set']('ai.aiAssistant.commands',_0x3080ff);}}class P extends _0x5b41a4{['abortController'];static get['requires'](){return[K];}constructor(_0x5b3623){super(_0x5b3623),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'](_0x5508b8){return this['sendRequest'](_0x5508b8)['catch'](_0x38fdc8=>{if(_0x38fdc8 instanceof R)return Promise['reject'](_0x38fdc8);if('AbortError'==_0x38fdc8['name'])return Promise['resolve']();throw console['error'](_0x38fdc8),new _0x918a5e('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x10d6cf,_0x4183b7){const _0x4d5bc3=this['editor']['locale'],_0x5f1b41={'Content-Type':'application/json'};if('object'==typeof _0x10d6cf)Object['assign'](_0x5f1b41,_0x10d6cf);else{if(_0x10d6cf)try{const _0x44774a=await _0x10d6cf(_0x4183b7);Object['assign'](_0x5f1b41,_0x44774a);}catch(_0x3fa1ae){return Promise['reject'](new R(i(_0x4d5bc3,'AI_ERROR_GET_HEADERS')));}}return _0x5f1b41;}async['_prepareRequestParameters'](_0x155b9a,_0x370972){const _0x4bcae2=this['editor']['locale'];if('object'==typeof _0x155b9a)return _0x155b9a;try{return await _0x155b9a(_0x370972);}catch(_0x18591c){return Promise['reject'](new R(i(_0x4bcae2,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x11feea){super(_0x11feea),_0x11feea['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x11feea['config']['get']('ai.openAI.requestParameters')||_0x11feea['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x11feea['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x11feea['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x11feea['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x3e952d,context:_0x111607,onData:_0x583c21,actionId:_0x383e29}){const _0x76b224=this['editor']['locale'],_0x5128ec=await this['prepareMessages'](_0x3e952d,_0x111607,_0x383e29),_0xc96970=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x383e29),_0x4444d4=await this['_prepareRequestParameters'](this['_requestParameters'],_0x383e29),_0x200d9e={'messages':_0x5128ec,..._0x4444d4},_0x2cec97={'method':'POST','headers':_0xc96970,'body':JSON['stringify'](_0x200d9e),'signal':this['abortController']['signal']},_0x57e94e=await fetch(this['_apiUrl'],_0x2cec97);if(_0x57e94e['ok'])return _0x4444d4['stream']?await this['_readStreamableResponse'](_0x57e94e,_0x583c21):await this['_readStaticResponse'](_0x57e94e,_0x583c21),Promise['resolve']();{const _0x4e2a36=await _0x57e94e['text']();return _0x4e2a36['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x76b224,'AI_ERROR_CONTEXT_LENGTH'))):_0x4e2a36['includes']('Moderation')?Promise['reject'](new R(i(_0x76b224,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x4e2a36));}}async['prepareMessages'](_0x2ae8f7,_0x1cad56,_0x56e6ad){let _0x15cac1,_0x2f8200;return _0x1cad56?(_0x15cac1='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.',_0x2f8200='Instruction:\x0a'+_0x2ae8f7+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1cad56):(_0x15cac1='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.',_0x2f8200=_0x2ae8f7),[{'role':'system','content':_0x15cac1},{'role':'user','content':_0x2f8200}];}async['_readStreamableResponse'](_0x901ddc,_0x30f33d){const _0x1f6e11=_0x901ddc['body']['getReader'](),_0x295c8a=new TextDecoder();let _0x1cf4e0='',_0x2c513f='',_0x4f236f='',_0x279cff=!0x1;for(;!_0x279cff;){const {done:_0x26be6d,value:_0x50df40}=await _0x1f6e11['read'](),_0x24ffbe=_0x1cf4e0+_0x295c8a['decode'](_0x50df40);let _0x32ab50='';_0x279cff=_0x26be6d;try{_0x32ab50=this['_cleanUpData'](_0x24ffbe),_0x1cf4e0='';}catch(_0x485bcb){_0x1cf4e0=_0x24ffbe;continue;}_0x2c513f+=_0x32ab50,!_0x279cff&&this['_isBufferIncomplete'](_0x2c513f)||_0x2c513f&&(_0x4f236f+=_0x2c513f,_0x2c513f='',_0x30f33d(_0x4f236f));}return Promise['resolve']();}async['_readStaticResponse'](_0x4b11db,_0x1f9ba3){return _0x1f9ba3((await _0x4b11db['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x54a740){const _0x8024b3=_0x54a740['split']('<')['length']!==_0x54a740['split']('>')['length'],_0x546c28=_0x54a740['length']<0x1e;return _0x8024b3&&_0x546c28;}['_cleanUpData'](_0x4c489a){return _0x4c489a['split'](/\n(?![^{]*\})/g)['map'](_0x4ed2ea=>_0x4ed2ea['replace']('data:\x20',''))['filter'](_0x2d18fa=>_0x2d18fa&&_0x2d18fa['length']>0x0&&'[DONE]'!==_0x2d18fa)['map'](_0xb5a4a1=>{const {choices:_0x2a7bd8}=JSON['parse'](_0xb5a4a1);if(_0x2a7bd8[0x0]&&_0x2a7bd8[0x0]['delta']&&_0x2a7bd8[0x0]['delta']['content'])return _0x2a7bd8[0x0]['delta']['content'];})['filter'](_0x44450a=>_0x44450a)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x418264){super(_0x418264),_0x418264['config']['get']('ai.aws.requestParameters')||_0x418264['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']=_0x418264['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x418264['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x418264['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x418264['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x394954,context:_0xc7cd61,onData:_0x187b8d,actionId:_0x247495}){const {model:_0xec53bf,stream:_0x2d337d,..._0x284c26}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x247495),_0xe6dbea={'prompt':await this['preparePrompt'](_0x394954,_0xc7cd61,_0xec53bf,_0x247495),..._0x284c26};this['_apiUrl']?await this['_processProxyRequest'](_0xe6dbea,_0xec53bf,_0x2d337d,_0x187b8d,_0x247495):await this['_processAWSRequest'](_0xe6dbea,_0xec53bf,_0x2d337d,_0x187b8d);}async['preparePrompt'](_0x1836a7,_0x41e92a,_0x5b98e5,_0x4bae04){let _0x46e546,_0x44800d;return _0x41e92a?(_0x46e546='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.',_0x44800d='Instruction:\x0a'+_0x1836a7+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x41e92a):(_0x46e546='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.',_0x44800d=_0x1836a7),'meta.llama'==this['getModelFamily'](_0x5b98e5)?'<<SYS>>\x0a'+_0x46e546+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x44800d+'\x0a[/INST]':'Human:\x0a'+_0x46e546+'\x0a'+_0x44800d+'\x0a\x0aAssistant:';}['getModelFamily'](_0x153e5e){if(/^anthropic\.claude/['test'](_0x153e5e))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x153e5e))return'ai21.j2';if(/^cohere\.command/['test'](_0x153e5e))return'cohere.command';if(/^meta\.llama/['test'](_0x153e5e))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x153e5e));}async['_processProxyRequest'](_0x53e627,_0x21b7c0,_0x536ffc,_0x412362,_0x4add4c){const _0x4b0704={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4add4c),'body':JSON['stringify']({..._0x53e627,'model':_0x21b7c0,'stream':_0x536ffc}),'signal':this['abortController']['signal']},_0x55d467=await fetch(this['_apiUrl'],_0x4b0704);_0x536ffc?await this['_readStreamableResponse'](_0x55d467,_0x21b7c0,_0x412362):await this['_readStaticResponse'](_0x55d467,_0x21b7c0,_0x412362);}async['_processAWSRequest'](_0x5c0c16,_0x498251,_0x3f3bde,_0x88e7b9){const _0x44cdb3=new _0x4975ad(this['_bedrockClientConfig']),_0x5dca39={'body':JSON['stringify'](_0x5c0c16),'contentType':'application/json','accept':'application/json','modelId':_0x498251};let _0x20beb4;if(_0x3f3bde){const _0x4eb35b=new _0x5c4661(_0x5dca39);_0x20beb4=await _0x44cdb3['send'](_0x4eb35b,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x20beb4,_0x498251,_0x88e7b9);}else{const _0x36c1dd=new _0x152e38(_0x5dca39);_0x20beb4=await _0x44cdb3['send'](_0x36c1dd,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x20beb4,_0x498251,_0x88e7b9);}}async['_readAsyncIterableResponse'](_0x5a60dc,_0x26e7c1,_0x226cee){const _0xd30335=_0x5a60dc['body'],_0x424d41=new TextDecoder('utf-8');let _0x2f18bb='';for await(const _0x187f96 of _0xd30335)if(_0x187f96['chunk']){const _0x47dfea=_0x424d41['decode'](_0x187f96['chunk']['bytes']),_0x1889a0=JSON['parse'](_0x47dfea);_0x2f18bb+=this['_getGeneratedText'](_0x1889a0,_0x26e7c1),_0x226cee(_0x2f18bb);}return Promise['resolve']();}async['_readStreamableResponse'](_0x1de6da,_0x32d8a4,_0x482461){const _0x95d9e0=_0x1de6da['body'],_0x4732f8=new TextDecoder('utf-8'),_0x35265a=_0x95d9e0['getReader']();let _0xd4b1fb='',_0x76aa9c='',_0x533f99=!0x1;for(;!_0x533f99;){const {done:_0x1ecd60,value:_0xb69cb8}=await _0x35265a['read']();if(_0x533f99=_0x1ecd60,_0x533f99)break;const _0x558bbf=(_0xd4b1fb+_0x4732f8['decode'](_0xb69cb8))['split']('\x0a')['map'](_0x1ab876=>{try{return _0xd4b1fb='',JSON['parse'](_0x1ab876);}catch(_0x5a4256){return _0xd4b1fb=_0x1ab876,null;}})['filter'](_0x2ba6c3=>null!==_0x2ba6c3);_0x558bbf['length']&&(_0x76aa9c+=_0x558bbf['map'](_0x11349d=>this['_getGeneratedText'](_0x11349d,_0x32d8a4))['join'](''),_0x482461(_0x76aa9c));}return Promise['resolve']();}async['_readStaticResponse'](_0x5eee89,_0x5cf735,_0x4340b3){let _0xdf7954;return _0xdf7954=_0x5eee89 instanceof Response?await _0x5eee89['json']():JSON['parse'](Buffer['from'](_0x5eee89['body'])['toString']('utf8')),(_0x4340b3(this['_getGeneratedText'](_0xdf7954,_0x5cf735)),Promise['resolve']());}['_getGeneratedText'](_0x383f2d,_0x539480){switch(this['getModelFamily'](_0x539480)){case'anthropic.claude':return _0x383f2d['completion'];case'ai21.j2':return _0x383f2d['completions'][0x0]['data']['text'];case'cohere.command':return _0x383f2d['generations'][0x0]['text'];case'meta.llama':return _0x383f2d['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':_0x57cb29=>0x1!=_0x57cb29}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x303294=>{const {af:{dictionary:_0x286924,getPluralForm:_0x15a562}}={'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':_0x1c6149=>0x1!=_0x1c6149}};_0x303294['af']||={'dictionary':{},'getPluralForm':null},_0x303294['af']['dictionary']=Object['assign'](_0x303294['af']['dictionary'],_0x286924),_0x303294['af']['getPluralForm']=_0x15a562;})(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':_0x286499=>0x0==_0x286499?0x0:0x1==_0x286499?0x1:0x2==_0x286499?0x2:_0x286499%0x64>=0x3&&_0x286499%0x64<=0xa?0x3:_0x286499%0x64>=0xb?0x4:0x5}};
|