@ckeditor/ckeditor5-ai 44.2.0-alpha.3 → 44.2.0-alpha.4
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 _0xc924d8,Command as _0x301361,icons as _0x522d83}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x136710,CKEditorError as _0x567ba8,ObservableMixin as _0x198539,global as _0x1dd5c9,isVisible as it,Rect as st,Collection as _0x1cb9bb,FocusTracker as _0x21e63b,KeystrokeHandler as ts,first as _0x32d55e}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x2b981b,View as _0x5b848a,SpinnerView as _0x41e295,IconView as _0x5c1326,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x39988d,ButtonLabelView as te,FocusCycler as _0x48bbf9,createLabeledTextarea as _0xebfc45,Dialog as _0x407e06,createDropdown as _0xf86420,addMenuToDropdown as _0x10552a,MenuBarMenuView as _0x4507e7,MenuBarMenuListItemButtonView as _0x467b5c,DialogViewPosition as _0x2f2b27,MenuBarMenuListView as _0x458fdc,MenuBarMenuListItemView as _0x563a5a}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x49a6d8,ClipboardMarkersUtils as _0x2a385d}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x2aaf62,DataTransfer as _0x525304,UpcastWriter as _0xb35fc7,Matcher as _0x4dc0c1}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x522a75,escape as _0x1ca36f}from'lodash-es';import{BedrockRuntimeClient as _0x14af6e,InvokeModelWithResponseStreamCommand as _0x5b5899,InvokeModelCommand as _0x463689}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x2c25e7,_0x238c75){const _0x19f1d8=(0x0,_0x238c75['t'])('Other');return _0x2c25e7['length']?'groupId'in _0x2c25e7[0x0]?_0x2c25e7:[{'groupId':x,'groupLabel':_0x19f1d8,'order':0x1/0x0,'commands':_0x2c25e7}]:[{'groupId':x,'groupLabel':_0x19f1d8,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0xc924d8{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x12bc48}=this,_0x552071=['ck-fake-ai-selection'];_0x12bc48['config']['get']('ai.useTheme')&&_0x552071['push']('ck-ai-assistant-ui_theme'),_0x12bc48['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x552071,'priority':0xc}}),_0x12bc48['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x4b3cc4,{writer:_0x747f4c})=>{if(!_0x4b3cc4['markerRange']['isCollapsed'])return null;const _0x1a780a=_0x747f4c['createUIElement']('span');return _0x747f4c['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1a780a),_0x1a780a;}});}['afterInit'](){!async function(_0x38d694){const _0x14f7fd=_0x2d546e([0x47,0x6e,0x45,0x71,0x35,0x34,0x41,0x44,0x66,0x51,0x76,0x48,0x77,0x50,0x59,0x6a,0x73,0x72,0x38,0x49,0x53,0x33,0x6c,0x32,0x39,0x7a,0x4e,0x63,0x62,0x6f,0x74,0x68,0x67,0x4a,0x4d,0x61,0x57,0x4f,0x42,0x4b,0x58,0x78,0x43,0x79,0x52,0x54,0x37,0x75,0x65,0x31,0x70,0x4c,0x55,0x6d,0x30,0x36,0x46,0x6b,0x69,0x64,0x56,0x5a]),_0x2e8c79=0x62df0cca,_0x39cb9c=0x62d852e2^_0x2e8c79,_0x1b5d30=window[_0x2d546e([0x44,0x61,0x74,0x65])][_0x2d546e([0x6e,0x6f,0x77])](),_0x4aca7f=_0x38d694[_0x2d546e([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x50d31b=new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x317107=>{_0x4aca7f[_0x2d546e([0x6f,0x6e,0x63,0x65])](_0x2d546e([0x72,0x65,0x61,0x64,0x79]),_0x317107);}),_0x2dd10c={[_0x2d546e([0x6b,0x74,0x79])]:_0x2d546e([0x45,0x43]),[_0x2d546e([0x75,0x73,0x65])]:_0x2d546e([0x73,0x69,0x67]),[_0x2d546e([0x63,0x72,0x76])]:_0x2d546e([0x50,0x2d,0x32,0x35,0x36]),[_0x2d546e([0x78])]:_0x2d546e([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]),[_0x2d546e([0x79])]:_0x2d546e([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]),[_0x2d546e([0x61,0x6c,0x67])]:_0x2d546e([0x45,0x53,0x32,0x35,0x36])},_0x472ee6=_0x4aca7f[_0x2d546e([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2d546e([0x67,0x65,0x74])](_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5cfa95(){let _0x17fb3a,_0x121f29=null,_0x2aed36=null;try{if(_0x472ee6==_0x2d546e([0x47,0x50,0x4c]))return _0x2d546e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x17fb3a=_0x575b5b(),!_0x17fb3a)return _0x2d546e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x17fb3a[_0x2d546e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2aed36=_0x17f849(_0x17fb3a[_0x2d546e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x17fb3a[_0x2d546e([0x6a,0x74,0x69])])),await _0x3ffeb0()?_0x2ff653()?_0x56aa80()?_0x2d546e([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x388c7e()?(_0x17fb3a[_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2d546e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x121f29=_0x22f1e1(_0x2d546e([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x17fb3a[_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2d546e([0x74,0x72,0x69,0x61,0x6c])&&(_0x121f29=_0x22f1e1(_0x2d546e([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x54262b()):_0x2d546e([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2d546e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2d546e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0xfd2cc3){return _0x2d546e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x56aa80(){const _0x50ef53=[_0x2d546e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2d546e([0x74,0x72,0x69,0x61,0x6c])][_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x17fb3a[_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x1b5d30/0x3e8:0xe10*_0x39cb9c;return _0x17fb3a[_0x2d546e([0x65,0x78,0x70])]<_0x50ef53;}function _0x2ff653(){const _0x4c8416=_0x17fb3a[_0x2d546e([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4c8416&&(!!_0x4c8416[_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2d546e([0x2a]))||!!_0x4c8416[_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2d546e([0x41,0x49])));}function _0x388c7e(){const _0x370c40=_0x17fb3a[_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x370c40||0x0==_0x370c40[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x9fd667}=new URL(window[_0x2d546e([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x370c40[_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x9fd667))return!0x0;const _0x5f065a=_0x9fd667[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])](_0x2d546e([0x2e]));return _0x370c40[_0x2d546e([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x28f80e=>_0x28f80e[_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2d546e([0x2a])))[_0x2d546e([0x6d,0x61,0x70])](_0x9499b8=>_0x9499b8[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])](_0x2d546e([0x2e])))[_0x2d546e([0x73,0x6f,0x6d,0x65])](_0x34e2c4=>_0x5f065a[_0x2d546e([0x65,0x76,0x65,0x72,0x79])]((_0x48030d,_0x1e77a7)=>_0x34e2c4[_0x1e77a7]===_0x48030d||_0x34e2c4[_0x1e77a7]===_0x2d546e([0x2a])));}function _0x54262b(){return _0x121f29&&_0x2aed36?new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x23b72f,_0x2d0d9a)=>{_0x121f29[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x23b72f,_0x2d0d9a),_0x2aed36[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x1f78ce=>{_0x1f78ce!=_0x2d546e([0x56,0x61,0x6c,0x69,0x64])&&_0x23b72f(_0x1f78ce);},_0x2d0d9a);}):_0x121f29||_0x2aed36||_0x2d546e([0x56,0x61,0x6c,0x69,0x64]);}}function _0x17f849(_0x2bda66,_0x425b91){return new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x30ab6e=>{if(_0x12530e())return _0x30ab6e(_0x2d546e([0x56,0x61,0x6c,0x69,0x64]));_0x3289c2(),_0x4aca7f[_0x2d546e([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2d546e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x6609d0=!0x1;const _0x28b2db=_0x136710();function _0x4c1378(_0x3975b6){return!!_0x3975b6&&(typeof _0x3975b6===_0x2d546e([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3975b6===_0x2d546e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3975b6[_0x2d546e([0x74,0x68,0x65,0x6e])]===_0x2d546e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3975b6[_0x2d546e([0x63,0x61,0x74,0x63,0x68])]===_0x2d546e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2394f2(_0x37f7a9){_0x4d39d7(_0x37f7a9)[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x3fda3c=>{if(!_0x3fda3c||_0x3fda3c[_0x2d546e([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2d546e([0x6f,0x6b]))return _0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x15c2ff(_0x226bc6(_0x28b2db+_0x425b91))!=_0x3fda3c[_0x2d546e([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2d546e([0x56,0x61,0x6c,0x69,0x64]);})[_0x2d546e([0x74,0x68,0x65,0x6e])](_0xc33e57=>(_0x2c619f(),_0xc33e57),()=>{const _0x105887=_0x48553b();return null==_0x105887?(_0x2c619f(),_0x2d546e([0x56,0x61,0x6c,0x69,0x64])):_0x2d546e(_0x1b5d30-_0x105887>(0x46d388ca^_0x2e8c79)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x30ab6e)[_0x2d546e([0x63,0x61,0x74,0x63,0x68])](()=>{_0x30ab6e(_0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x1a01cf=0x62e9e24a^_0x2e8c79;function _0x2c619f(){const _0x24fb53=_0x2d546e([0x6c,0x6c,0x63,0x74,0x2d])+_0x15c2ff(_0x226bc6(_0x2bda66)),_0x40a45=_0x47225b(_0x15c2ff(window[_0x2d546e([0x4d,0x61,0x74,0x68])][_0x2d546e([0x63,0x65,0x69,0x6c])](_0x1b5d30/_0x1a01cf)));window[_0x2d546e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2d546e([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x24fb53,_0x40a45);}function _0x48553b(){const _0x3b7620=_0x2d546e([0x6c,0x6c,0x63,0x74,0x2d])+_0x15c2ff(_0x226bc6(_0x2bda66)),_0x49ce05=window[_0x2d546e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2d546e([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3b7620);return _0x49ce05?window[_0x2d546e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x47225b(_0x49ce05),0x10)*_0x1a01cf:null;}function _0x4d39d7(_0x5a4605){return new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2af823,_0x2d5535)=>{_0x5a4605[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x2af823,_0x2d5535),window[_0x2d546e([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x2d5535,0x62ded80a^_0x2e8c79);});}}_0x4aca7f[_0x2d546e([0x6f,0x6e])](_0x2d546e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0xac1148,_0x1552cb)=>{if(_0x1552cb[0x0]!=_0x2bda66)return _0x30ab6e(_0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x1552cb[0x1]={..._0x1552cb[0x1],[_0x2d546e([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x28b2db};},{[_0x2d546e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2d546e([0x68,0x69,0x67,0x68])}),_0x4aca7f[_0x2d546e([0x6f,0x6e])](_0x2d546e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x4afd9e=>{_0x4c1378(_0x4afd9e[_0x2d546e([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x6609d0=!0x0,_0x2394f2(_0x4afd9e[_0x2d546e([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2d546e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2d546e([0x6c,0x6f,0x77])}),_0x50d31b[_0x2d546e([0x74,0x68,0x65,0x6e])](()=>{_0x6609d0||_0x30ab6e(_0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x12530e(){return _0x4aca7f[_0x2d546e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2d546e([0x76,0x69,0x65,0x77])][_0x2d546e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2d546e([0x61,0x75,0x74,0x6f]);}function _0x3289c2(){_0x4aca7f[_0x2d546e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2d546e([0x76,0x69,0x65,0x77])][_0x2d546e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2d546e([0x61,0x75,0x74,0x6f]);}}function _0x22f1e1(_0x3e6619){const _0x3c4321=[new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x52b3be=>setTimeout(_0x52b3be,0x62d63206^_0x2e8c79)),_0x50d31b[_0x2d546e([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2da23f=>{let _0x526f2b=0x0;_0x4aca7f[_0x2d546e([0x6d,0x6f,0x64,0x65,0x6c])][_0x2d546e([0x6f,0x6e])](_0x2d546e([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x27dc63,_0x1a1eb2)=>{_0x1a1eb2[0x0][_0x2d546e([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x526f2b++,_0x526f2b==(0x62df0d32^_0x2e8c79)&&(_0x2da23f(),_0x27dc63[_0x2d546e([0x6f,0x66,0x66])]());});}))];return window[_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2d546e([0x72,0x61,0x63,0x65])](_0x3c4321)[_0x2d546e([0x74,0x68,0x65,0x6e])](()=>_0x3e6619);}async function _0x27251a(){await _0x50d31b,_0x4aca7f[_0x2d546e([0x6d,0x6f,0x64,0x65,0x6c])][_0x2d546e([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x35e9d6,_0x4aca7f[_0x2d546e([0x6d,0x6f,0x64,0x65,0x6c])][_0x2d546e([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x35e9d6,_0x4aca7f[_0x2d546e([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2d546e([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x25117c(_0x2f7984){const _0x36beda=_0x2726e6();_0x4aca7f[_0x36beda]=_0x2d546e([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x2f7984,_0x2f7984!=_0x2d546e([0x56,0x61,0x6c,0x69,0x64])&&_0x27251a();}function _0x2726e6(){const _0x35e4fe=window[_0x2d546e([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2d546e([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2d546e([0x6e,0x6f,0x77])]())[_0x2d546e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2d546e([0x2e]),'');let _0x5e9211=_0x2d546e([0x47]);for(let _0x5b9363=0x0;_0x5b9363<_0x35e4fe[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5b9363+=0x2){let _0x476b5a=window[_0x2d546e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x35e4fe[_0x2d546e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5b9363,_0x5b9363+0x2));_0x476b5a>=_0x14f7fd[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x476b5a-=_0x14f7fd[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x5e9211+=_0x14f7fd[_0x476b5a];}return _0x5e9211;}function _0x575b5b(){const _0x371fb4=_0x472ee6[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])](_0x2d546e([0x2e]));if(0x3!=_0x371fb4[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xe06b59(_0x371fb4[0x1]);function _0xe06b59(_0xd31e9e){const _0x5272d5=_0x4a1f64(_0xd31e9e);return _0x5272d5&&_0x32273c()?_0x5272d5:null;function _0x32273c(){const _0x28ccea=_0x5272d5[_0x2d546e([0x6a,0x74,0x69])],_0x5eb492=window[_0x2d546e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x28ccea[_0x2d546e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x28ccea[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x5202c3={..._0x5272d5,[_0x2d546e([0x6a,0x74,0x69])]:_0x28ccea[_0x2d546e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x28ccea[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x5202c3[_0x2d546e([0x76,0x63])],_0x226bc6(_0x5202c3)==_0x5eb492;}}}async function _0x3ffeb0(){let _0x27a3f3=!0x0;try{const _0x6a8c5b=_0x472ee6[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])](_0x2d546e([0x2e])),[_0x26968e,_0x2dc9a3,_0x5214d5]=_0x6a8c5b;return _0x9e79ac(_0x26968e),await _0x5ea7a4(_0x26968e,_0x2dc9a3,_0x5214d5),_0x27a3f3;}catch(_0x2d9a66){return!0x1;}function _0x9e79ac(_0x5cfcfe){const _0x3c2d62=_0x4a1f64(_0x5cfcfe);_0x3c2d62&&_0x3c2d62[_0x2d546e([0x61,0x6c,0x67])]==_0x2d546e([0x45,0x53,0x32,0x35,0x36])||(_0x27a3f3=!0x1);}async function _0x5ea7a4(_0x4f0652,_0x447f26,_0x13e122){const _0x3ea824=window[_0x2d546e([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2d546e([0x66,0x72,0x6f,0x6d])](_0x5a314c(_0x13e122),_0x1bc275=>_0x1bc275[_0x2d546e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x17c97c=new window[(_0x2d546e([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2d546e([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4f0652+_0x2d546e([0x2e])+_0x447f26),_0x1afbb1=window[_0x2d546e([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2d546e([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1afbb1)return;const _0x970227=await _0x1afbb1[_0x2d546e([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2d546e([0x6a,0x77,0x6b]),_0x2dd10c,{[_0x2d546e([0x6e,0x61,0x6d,0x65])]:_0x2d546e([0x45,0x43,0x44,0x53,0x41]),[_0x2d546e([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2d546e([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2d546e([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1afbb1[_0x2d546e([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2d546e([0x6e,0x61,0x6d,0x65])]:_0x2d546e([0x45,0x43,0x44,0x53,0x41]),[_0x2d546e([0x68,0x61,0x73,0x68])]:{[_0x2d546e([0x6e,0x61,0x6d,0x65])]:_0x2d546e([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x970227,_0x3ea824,_0x17c97c)||(_0x27a3f3=!0x1);}}function _0x4a1f64(_0x49fbf0){return _0x49fbf0[_0x2d546e([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2d546e([0x65,0x79]))?JSON[_0x2d546e([0x70,0x61,0x72,0x73,0x65])](_0x5a314c(_0x49fbf0)):null;}function _0x5a314c(_0x1a7ea1){return window[_0x2d546e([0x61,0x74,0x6f,0x62])](_0x1a7ea1[_0x2d546e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2d546e([0x2b]))[_0x2d546e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2d546e([0x2f])));}function _0x226bc6(_0x33c7dc){let _0xce51ed=0x1505;function _0x22c1fe(_0x4dc0f8){for(let _0x5ea99d=0x0;_0x5ea99d<_0x4dc0f8[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5ea99d++){const _0x29e03b=_0x4dc0f8[_0x2d546e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x5ea99d);_0xce51ed=(_0xce51ed<<0x5)+_0xce51ed+_0x29e03b,_0xce51ed&=_0xce51ed;}}function _0x270139(_0x292d88){Array[_0x2d546e([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x292d88)?_0x292d88[_0x2d546e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x270139):_0x292d88&&typeof _0x292d88==_0x2d546e([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2d546e([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x292d88)[_0x2d546e([0x73,0x6f,0x72,0x74])]()[_0x2d546e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x544076,_0x45c07d])=>{_0x22c1fe(_0x544076),_0x270139(_0x45c07d);}):_0x22c1fe(window[_0x2d546e([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x292d88));}return _0x270139(_0x33c7dc),_0xce51ed>>>0x0;}function _0x15c2ff(_0x3b1e5a){return _0x3b1e5a[_0x2d546e([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2d546e([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2d546e([0x30]));}function _0x47225b(_0x2320c8){return _0x2320c8[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2d546e([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2d546e([0x6a,0x6f,0x69,0x6e])]('');}function _0x35e9d6(){}function _0x2d546e(_0x1dbca2){return _0x1dbca2['map'](_0xcadf7e=>String['fromCharCode'](_0xcadf7e))['join']('');}_0x25117c(await _0x5cfa95());}(this);}['showFakeVisualSelection'](){const _0x2eddd7=this['editor']['model'];_0x2eddd7['change'](_0x5c24de=>{const _0x3d9bf0=_0x2eddd7['document']['selection']['getRanges']();let _0x2619f0=0x0;for(const _0x29883b of _0x3d9bf0){const _0x396afa=f+':'+_0x2619f0;if(_0x2eddd7['markers']['has'](_0x396afa))_0x5c24de['updateMarker'](_0x396afa,{'range':_0x29883b});else{if(_0x29883b['start']['isAtEnd']){const _0x4e3517=_0x29883b['start']['getLastMatchingPosition'](({item:_0x185d41})=>!_0x2eddd7['schema']['isContent'](_0x185d41),{'boundaries':_0x29883b});_0x5c24de['addMarker'](_0x396afa,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5c24de['createRange'](_0x4e3517,_0x29883b['end'])});}else _0x5c24de['addMarker'](_0x396afa,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x29883b});}_0x2619f0++;}});}['hideFakeVisualSelection'](){const _0x4583d6=this['editor']['model'],_0x5ba8cf=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x5ba8cf['length']&&_0x4583d6['change'](_0x50ccdf=>{_0x5ba8cf['forEach'](_0x4056d7=>{_0x50ccdf['removeMarker'](_0x4056d7);});});}['insertContent'](_0x66af6,_0x5b1581){const _0x5477ce=this['_getAISelection'](),_0x57845a=_0x5b1581||_0x5477ce['getFirstRange']();this['editor']['model']['canEditAt'](_0x57845a)&&this['editor']['model']['change'](_0x8f511d=>{this['hideFakeVisualSelection'](),_0x5b1581||this['_resetContentOfSelectedTableCells'](_0x8f511d,_0x5477ce),this['_pasteHTMLUsingClipboard']({'insertAt':_0x57845a,'writer':_0x8f511d,'html':_0x66af6});});}['insertContentBelow'](_0xdba881){const {model:_0x4ea55e}=this['editor'],_0x455062=this['_getAISelection']();_0x4ea55e['change'](()=>{const _0x13b1a4=this['_prepareTableInsertBelowPosition'](_0xdba881,_0x455062)||this['_getDefaultInsertBelowPosition'](_0x455062);this['insertContent'](_0xdba881,_0x13b1a4);});}['_getAISelection'](){const _0x5a080a=this['editor']['model'],_0x89f7a3=Array['from'](_0x5a080a['markers']['getMarkersGroup'](f))['map'](_0x33b0af=>_0x33b0af['getRange']());return _0x5a080a['createSelection'](_0x89f7a3);}['_pasteHTMLUsingClipboard']({writer:_0x24886b,html:_0x114714,insertAt:_0x256638}){const {view:_0x33156c}=this['editor']['editing'],_0x47b1ee=this['editor']['plugins']['get'](_0x49a6d8),_0x5e85ee=new dt();_0x5e85ee['setData']('text/html',_0x114714);const _0x434a4c=new ClipboardEvent('paste',{'clipboardData':_0x5e85ee}),_0x20b8ea=new _0x2aaf62(_0x33156c,_0x434a4c,{'dataTransfer':new _0x525304(_0x5e85ee)});_0x24886b['setSelection'](_0x256638);const _0x123a59=(_0x2bac12,_0x46092e)=>{_0x46092e['resultRange']&&_0x24886b['setSelection'](_0x46092e['resultRange']);};_0x47b1ee['once']('contentInsertion',_0x123a59,{'priority':'lowest'}),_0x33156c['document']['fire']('paste',_0x20b8ea),_0x47b1ee['off']('contentInsertion',_0x123a59);}['_getDefaultInsertBelowPosition'](_0x55c9eb){const {model:_0x3780a3}=this['editor'],_0x3ec9f9=Array['from'](_0x55c9eb['getSelectedBlocks']());return _0x3ec9f9['length']?_0x3780a3['createPositionAfter'](_0x3ec9f9['pop']()):_0x55c9eb['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3bc9c8,_0x33bf0a){const {model:_0x4440fc,plugins:_0x38f683}=this['editor'];if(_0x38f683['has']('TableUtils')){const _0x40a6a2=_0x38f683['get']('TableUtils')['getSelectedTableCells'](_0x33bf0a);if(_0x40a6a2['length']){const _0x4d1400=this['_getTableRowCountFromContent'](_0x3bc9c8),_0x3aa798=this['_createEmptyTableRows'](_0x40a6a2,_0x4d1400);return _0x4440fc['createPositionAt'](_0x3aa798,0x0);}}return null;}['_getTableRowCountFromContent'](_0x5b441c){const _0x275090=this['editor']['plugins']['get']('TableUtils'),_0x22044c=this['editor']['data']['parse'](_0x5b441c),_0x1d2cce=Array['from'](_0x22044c['getChildren']())['filter'](_0x33c46d=>_0x33c46d['is']('element','table'));let _0x31f7eb=0x0;return _0x1d2cce['forEach'](_0x8d989a=>{_0x31f7eb+=_0x275090['getRows'](_0x8d989a);}),_0x31f7eb;}['_createEmptyTableRows'](_0x5cee67,_0x29c7c7){const _0x25eec2=this['editor']['plugins']['get']('TableUtils'),_0x27dc3c=_0x25eec2['getRowIndexes'](_0x5cee67),_0x5d6046=_0x25eec2['getColumnIndexes'](_0x5cee67),_0xf87ff4=_0x27dc3c['last']+0x1,_0x3946c0=_0x5d6046['first'],_0x642f3f=_0x5cee67[0x0]['findAncestor']('table');for(let _0x51ce69=0x0;_0x51ce69<_0x29c7c7;_0x51ce69++)_0x25eec2['insertRows'](_0x642f3f,{'at':_0xf87ff4});return _0x642f3f['getChild'](_0xf87ff4)['getChild'](_0x3946c0);}['_resetContentOfSelectedTableCells'](_0x29926c,_0x202fe4){const {plugins:_0x43354d}=this['editor'],{model:_0x3df98c}=_0x29926c;if(!_0x43354d['has']('TableUtils'))return;_0x43354d['get']('TableUtils')['getSelectedTableCells'](_0x202fe4)['length']&&_0x3df98c['deleteContent'](_0x202fe4);}}class K extends _0xc924d8{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x567ba8('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x2c0fff){super(_0x2c0fff),this['name']='AIRequestError';}}function i(_0xc2cc5,_0xcd20bc,_0x187e13){const t=_0xc2cc5['t'];switch(_0xcd20bc){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',_0x187e13);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x187e13);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'},_0x187e13);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 _0xcd20bc;}}class E extends _0x301361{['_commandDefinitions'];constructor(_0x5d7d7d,_0x5d6c82){super(_0x5d7d7d),this['_commandDefinitions']=_0x5d6c82,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3c2c5d,_0x471a31,_0x56c68a)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x56c68a));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x5dbac2,_0x991980,_0x4ebfed)=>{this['enabledCommandsIds']=_0x4ebfed?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0xdb609e=this['editor']['model'];this['_hasContext']=function(_0x4bf303){const _0x4c352f=_0x4bf303['document']['selection'];return _0x4c352f['isCollapsed']?0x0!==[..._0x4c352f['getSelectedBlocks']()]['length']&&![..._0x4c352f['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4bf303['hasContent'](_0x4c352f['getFirstRange']());}(_0xdb609e);const _0x5b7568=_0xdb609e['document']['selection'],_0x353828=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x704cdc of _0x5b7568['getRanges']())for(const _0x17f8d7 of _0x704cdc['getItems']())if(_0x17f8d7['is']('element')&&_0x353828['includes'](_0x17f8d7['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2ff211='',_0x3d6b3d='',_0x1d0f1a='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x2ff211,_0x3d6b3d,_0x1d0f1a);}}function G(_0x58e10b,_0x1ee453){const _0x45ec3e=new Set();for(const _0x3d104a of _0x58e10b['values']())(_0x1ee453||!0x1===_0x3d104a['requiresContent'])&&_0x45ec3e['add'](_0x3d104a['id']);return Array['from'](_0x45ec3e);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x198539(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x270f04,_0x1f8a7b,_0x22c4da){super(),this['editor']=_0x270f04,this['textAdapter']=_0x1f8a7b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x22c4da,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x479483,_0x18014a,_0x1dacf4)=>{this['view']['value']=this['_sanitizeHTML'](_0x1dacf4);}),this['listenTo'](this['view'],'submitPrompt',(_0x16490c,_0x6710bd)=>{const _0x27d4f9=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x6710bd,_0x27d4f9,'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:_0x2a265a,query:_0x533be8,htmlContent:_0x35f790,label:_0x23a607,mainActionLabel:_0x42f1d6}){this['view']['prompt']=_0x23a607,this['view']['mainAction']=_0x42f1d6,this['initialContext']=_0x35f790,_0x533be8&&(this['view']['isRendered']?this['_handleQuery'](_0x533be8,_0x35f790,_0x2a265a,_0x23a607):this['view']['once']('render',()=>{this['_handleQuery'](_0x533be8,_0x35f790,_0x2a265a,_0x23a607);}));}['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'](_0x3cb08f,_0x3ec7d7,_0x3623a9,_0x831ac4){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3ec7d7,this['previousQuery']=_0x3cb08f,this['previousLabel']=_0x831ac4||_0x3cb08f,this['previousActionId']=_0x3623a9,new Promise(_0x1696bc=>{this['textAdapter']['makeRequest']({'query':_0x3cb08f,'context':_0x3ec7d7,'onData':_0x3cdd1d=>{this['currentResponse']=_0x3cdd1d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x3623a9})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x10ed5a=>{_0x10ed5a instanceof R?this['view']['handleError'](_0x10ed5a['message']):this['view']['handleError'](),_0x1696bc();})['finally'](()=>{this['stopProcessing'](),_0x1696bc();});});}['_parseAndNormalizeContent'](_0x2ae1b4,_0x5386a4=!0x1){const _0x34ecea=Z['exec'](_0x2ae1b4);_0x2ae1b4=_0x34ecea?_0x2ae1b4['substring'](_0x34ecea[0x1]['length']):_0x2ae1b4['length']<0x64&&!_0x5386a4?'':this['_stripMarkdownSyntax'](_0x2ae1b4);const _0xd758dc=this['_domParser']['parseFromString'](_0x2ae1b4,'text/html');if(_0x34ecea){const _0x1bb3b5=Array['from'](_0xd758dc['body']['childNodes']);_0x1bb3b5['reverse']();for(const _0xf61f77 of _0x1bb3b5){if(_0xf61f77['nodeType']==Node['ELEMENT_NODE'])break;_0xf61f77['remove']();}}const _0x797a71=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xd758dc['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x797a71);const _0x79e174=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x2c51e8=this['editor']['data']['toModel'](_0x797a71);return _0x79e174||_0x2c51e8['markers']['clear'](),this['editor']['data']['stringify'](_0x2c51e8);}['_normalizeResponseHeadings'](_0x32dd72){const _0xf4ce21=new _0xb35fc7(this['editor']['editing']['view']['document']),_0x5cfc55=new _0x4dc0c1({'name':/^h[1-5]$/}),_0x16eab5=[];let _0x53f1eb=!0x1;for(const _0x270af5 of _0x32dd72)_0x270af5['is']('element')&&_0x5cfc55['match'](_0x270af5)&&(_0x16eab5['push'](_0x270af5),'h1'==_0x270af5['name']&&(_0x53f1eb=!0x0));if(_0x53f1eb){for(const _0x2bdfe6 of _0x16eab5)_0xf4ce21['rename']('h'+(parseInt(_0x2bdfe6['name'][0x1])+0x1),_0x2bdfe6);}}['_isH1TagSupportEnabled'](){const {data:_0x442adc,editing:_0x4f0692}=this['editor'],_0x46777f=_0x442adc['htmlProcessor']['toView']('<h1></h1>'),_0xbf028c=_0x442adc['toView'](_0x442adc['toModel'](_0x46777f));return!!_0x4f0692['view']['domConverter']['viewToDom'](_0xbf028c)['querySelector']('h1');}['_sanitizeHTML'](_0x50c86c){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x50c86c),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x133f92){const _0x49c9c8=_0x133f92['trim']();return _0x49c9c8['startsWith']('```html')?_0x49c9c8['endsWith']('```')?_0x49c9c8['substring'](0x7,_0x49c9c8['length']-0x3):_0x49c9c8['substring'](0x7):_0x133f92;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x13f7a0){super(_0x13f7a0),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x280d61=>i(_0x13f7a0,'AI_'+_0x280d61['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x13f7a0,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x13f7a0,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x13f7a0,'Stop'));const _0x237f94=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x237f94['if']('isVisible','ck-hidden',_0x3a8133=>!_0x3a8133)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x2f2f14,_0x5550bd){const _0x3b8191=new _0x2b981b(this['locale']);return _0x3b8191['set']({'label':_0x2f2f14,'class':_0x5550bd||'','isVisible':!0x0,'withText':!0x0}),_0x3b8191;}}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 _0x5b848a{['contentFieldView'];['copyButtonView'];constructor(_0x539328,_0xe58597=''){super(_0x539328),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x249177=this['bindTemplate'];this['contentFieldView']=new mt(_0x539328,_0xe58597),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x249177['if']('isVisible','ck-hidden',_0x25d8c1=>!_0x25d8c1)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x249177['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 _0x4e8160=!0x1;this['on']('change:value',(_0x223f86,_0x4fb59b,_0x43df78)=>{const _0x459b67=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x43df78),this['isProcessing']&&_0x459b67&&!_0x4e8160&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x5f008b,_0x596696,_0x25979d)=>{_0x4e8160=!0x1,_0x25979d?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4e8160=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4e8160=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x3bf47e=this['locale'],_0x4dd4d5=new _0x2b981b(this['locale']),_0x2bd4a3='ck-ai-form__copy-button';return _0x4dd4d5['set']({'label':i(_0x3bf47e,'Copy'),'icon':W,'class':_0x2bd4a3,'tooltip':!0x0}),_0x4dd4d5['bind']('isVisible')['to'](this,'value',_0x9cd81e=>!!_0x9cd81e),_0x4dd4d5['bind']('isEnabled')['to'](this,'isProcessing',_0x18f895=>!_0x18f895),_0x4dd4d5['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4dd4d5['icon']=_0x522d83['check'],_0x4dd4d5['class']=_0x2bd4a3+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4dd4d5['icon']=W,_0x4dd4d5['class']=_0x2bd4a3;},0x3e8);}),_0x4dd4d5;}['_copyHTMLToClipboard'](_0x1c1ac0){const {window:_0x366b14,document:_0x4fc14e}=_0x1dd5c9;if(_0x366b14['ClipboardItem']){const {Blob:_0x3189b4,ClipboardItem:_0x3a9ed2}=_0x366b14,_0xa62ea6=[new _0x3a9ed2({'text/html':new _0x3189b4([_0x1c1ac0['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3189b4([_0x1c1ac0['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0xa62ea6);}else{const _0x4b0003=_0x4fc14e['createElement']('div');_0x4b0003['style']['position']='absolute',_0x4b0003['style']['left']='-9999px',_0x4b0003['innerHTML']='<span>[</span>'+_0x1c1ac0['innerHTML']+'<span>]</span>',_0x4fc14e['body']['appendChild'](_0x4b0003);const _0x197114=_0x4fc14e['createRange']();_0x197114['setStartAfter'](_0x4b0003['firstElementChild']),_0x197114['setEndBefore'](_0x4b0003['lastElementChild']);const _0x54436e=_0x366b14['getSelection']();_0x54436e['removeAllRanges'](),_0x54436e['addRange'](_0x197114),_0x4fc14e['execCommand']('copy'),_0x4b0003['remove']();}}}class mt extends _0x5b848a{constructor(_0x2530c3,_0x41b38f=''){super(_0x2530c3),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x41b38f,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3213c4){this['element']['innerHTML']=_0x3213c4;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x59037e=new _0x5b848a(),_0xa1795f=this['locale'],_0x8cc092=new _0x41e295();return _0x8cc092['isVisible']=!0x0,_0x59037e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x8cc092,{'text':i(_0xa1795f,'AI\x20is\x20writing...')}]}),_0x59037e['render'](),_0x59037e;}}class rt extends _0x5b848a{constructor(_0x3a1219,_0x5e4ad4=''){super(_0x3a1219);const _0x5990b5=new _0x5c1326(),_0x1ed605=this['bindTemplate'];this['set']('text',_0x5e4ad4),_0x5990b5['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':[_0x5990b5,{'text':_0x1ed605['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x145833,_0x2ce6b6){super(_0x145833,_0x2ce6b6),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',(_0x1902f8,_0x1f4df0)=>{_0x1902f8['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1f4df0());});}['_createSubmitButton'](){const _0x46dd25=new _0x2b981b(this['locale']),_0x5b5785=this['locale'];return _0x46dd25['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(_0x5b5785,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x46dd25['on']('execute',()=>{this['submit']();}),_0x46dd25['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x27133d,_0x3e0c07)=>!_0x27133d&&_0x3e0c07),_0x46dd25;}['_createShowHistoryButton'](){const _0x24738b=new _0x2b981b(this['locale']),_0x38d4e8=this['resultsView'],_0x3c7798=this['locale'];_0x24738b['set']({'label':i(_0x3c7798,'History'),'withText':!0x1,'icon':_0x522d83['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x24738b['bind']('isOn')['to'](_0x38d4e8,'isVisible'),_0x24738b['bind']('isEnabled')['to'](this,'isEnabled'),_0x24738b['on']('execute',()=>{_0x38d4e8['isVisible']=!_0x38d4e8['isVisible'],_0x38d4e8['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x128573=()=>{_0x1dd5c9['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x102e0c=new st(this['queryView']['fieldView']['element']),_0x1e86ba=_0x102e0c['width'],_0x1880cc='rtl'===_0x3c7798['uiLanguageDirection']?'left':'right';_0x102e0c['excludeScrollbarsAndBorders'](),_0x24738b['element']['style'][_0x1880cc]=_0x1e86ba-_0x102e0c['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x128573),this['on']('render',_0x128573),_0x24738b;}['submit'](){const _0x380cba=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x380cba);}['focus'](_0x5093a0){-0x1===_0x5093a0?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x4736ba){super(_0x4736ba),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x4736ba,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x19adfd=0x0;for(const _0x4d34dc of this['items'])_0x19adfd+=_0x4d34dc['items']['length'];return{'resultsCount':_0x19adfd,'totalItemsCount':_0x19adfd};}['_createClearHistoryButton'](){const _0x1656d7=this['locale'],_0x291595=new _0x2b981b(this['locale']);return _0x291595['set']({'label':'('+i(_0x1656d7,'Clear')+')','withText':!0x0}),_0x291595['on']('execute',()=>this['fire']('clearHistory')),_0x291595;}}class hs extends _0x39988d{constructor(_0x70fe87){super();const _0x5df28f=new te(),_0x49364c=new _0x2b981b(this['locale'],_0x5df28f);this['children']['add'](_0x49364c),_0x49364c['set']({'label':_0x70fe87['prompt'],'withText':!0x0}),_0x49364c['on']('execute',()=>{this['fire']('execute',{'value':_0x522a75(_0x70fe87['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x1cb9bb{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x46c30e,_0x47a0fc)=>{const _0x213433=Ss(_0x47a0fc['prompt']);for(const _0x4c0866 of this)if(_0x4c0866!=_0x47a0fc&&Ss(_0x4c0866['prompt'])===_0x213433){this['remove'](_0x4c0866);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x367bc8=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x367bc8));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x3352ca=>_0x3352ca)));}}function Ss(_0x10d7c1){return _0x10d7c1['toLowerCase']()['trim']();}class k extends _0x5b848a{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x258948,_0x4c1def,_0x15b3fb=''){super(_0x258948),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(_0x258948),this['contentArea']=new X(_0x258948,_0x15b3fb),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 _0x21e63b(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x48bbf9({'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 _0x5800ef=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4c1def],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x5800ef['if']('isError','ck-hidden',_0x1ecc39=>!_0x1ecc39)]},'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'](_0x40459e=0x1){-0x1===_0x40459e?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 _0x249f13=this['locale'],_0xf54625=new ht(_0x249f13,{'queryView':{'label':i(_0x249f13,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0xebfc45,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x249f13,'Empty\x20history'),'secondary':i(_0x249f13,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xf54625['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x45dc9f,_0x5035a6)=>_0x45dc9f&&!_0x5035a6),this['listenTo'](_0xf54625,'submit',(_0x4c852b,_0x6ca3d2)=>{this['prompt']=_0x6ca3d2;const _0x40f572=_0x1ca36f(_0x6ca3d2);this['fire']('submitPrompt',_0x40f572),_0x6ca3d2['trim']()&&this['_promptHistory']['add']({'prompt':_0x40f572},0x0);},{'priority':'high'}),_0xf54625;}['_createHistoryView'](){const _0x23d4d1=new rs(this['locale']);return _0x23d4d1['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x23d4d1['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x23d4d1;}['_createToolbar'](){const _0x46f669=new at(this['locale']);return _0x46f669['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5e4498,_0x4e8729,_0x3d3438)=>_0x5e4498&&!_0x4e8729&&!!_0x3d3438),_0x46f669['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x46f669['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4bf38c,_0x19b7b8,_0x25eb3c)=>_0x4bf38c&&!_0x19b7b8&&!!_0x25eb3c),_0x46f669['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x46f669['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3f181c,_0x5ea2bb)=>_0x3f181c&&!_0x5ea2bb),_0x46f669['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x46f669['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x46f669['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x46f669;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2b95e3=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x2b95e3,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x9db727){const _0x32748b=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x9db727||i(_0x32748b,'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 _0xc924d8{['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[_0x2a385d,a,K,_0x407e06];}constructor(_0x2209f3){super(_0x2209f3),_0x2209f3['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2209f3['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2209f3['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2209f3['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x38108f}=this;this['_aiAdapter']=_0x38108f['plugins']['get'](K),this['_dialog']=_0x38108f['plugins']['get'](_0x407e06),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1b1adc=new E(_0x38108f,Array['from'](this['_commandDefinitions']['values']()));_0x38108f['commands']['add']('showAIAssistant',_0x1b1adc),_0x38108f['ui']['componentFactory']['add']('aiCommands',_0x5c4421=>{const _0x2e6cf5=_0xf86420(_0x5c4421);return _0x2e6cf5['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2e6cf5['buttonView']['set']({'label':i(_0x5c4421,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x2e6cf5['on']('execute',_0x19c48c=>this['_onExecute'](_0x19c48c['source']['id'])),_0x10552a(_0x2e6cf5,_0x38108f['ui']['view']['body'],function(_0x3ab41c){const _0x852f7=o(_0x3ab41c['config']['get']('ai.aiAssistant.commands'),_0x3ab41c['locale']),_0x18a840=U(_0x3ab41c,_0x852f7)['filter'](_0x44097b=>_0x44097b['commands']['length']);if(0x1===_0x18a840['length'])return U(_0x3ab41c,_0x18a840[0x0]['commands'])['map'](_0x301726=>({'id':_0x301726['id'],'label':_0x301726['label']}));return _0x18a840['map'](_0x47fbf1=>{const {groupId:_0x2cad27,groupLabel:_0x21a72b,commands:_0x26a7db}=_0x47fbf1,_0x2f4f80=U(_0x3ab41c,_0x26a7db)['map'](_0x1075ea=>({'id':_0x1075ea['id'],'label':_0x1075ea['label']}));return{'id':_0x2cad27,'menu':_0x21a72b||_0x2cad27,'children':_0x2f4f80};});}(_0x38108f),{'ariaLabel':i(_0x5c4421,'AI\x20Commands')}),_0x2e6cf5['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1b1adc['on']('change:enabledCommandsIds',_0x589c17),_0x2e6cf5['menuView']['once']('render',_0x589c17),_0x2e6cf5;function _0x589c17(){_0x2e6cf5['isEnabled']=_0x1b1adc['enabledCommandsIds']['length']>0x0;for(const _0x555775 of _0x2e6cf5['menuView']['buttons'])_0x555775['isEnabled']=_0x1b1adc['enabledCommandsIds']['includes'](_0x555775['id']);}}),_0x38108f['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3e2d0b=>{const _0x59b0c1=new _0x4507e7(_0x3e2d0b);_0x59b0c1['buttonView']['set']({'label':i(_0x3e2d0b,'AI\x20Commands'),'icon':T}),_0x59b0c1['bind']('isEnabled')['to'](_0x1b1adc,'enabledCommandsIds',_0x46df04=>_0x46df04['length']>0x0);const _0x148a95=o(_0x38108f['config']['get']('ai.aiAssistant.commands'),_0x3e2d0b);return this['_populateMenuBarMenu'](_0x1b1adc,_0x59b0c1,_0x148a95,_0x241e8d=>this['_onExecute'](_0x241e8d)),_0x59b0c1;}),_0x38108f['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x2d7e18=this['_createAIAssistantUIButton'](_0x2b981b);return _0x2d7e18['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x2d7e18;}),_0x38108f['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1caca9=this['_createAIAssistantUIButton'](_0x467b5c);return _0x1caca9['set']({'role':'menuitemcheckbox'}),_0x1caca9;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x119911=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x47e627;for(const _0x22fb42 in _0x119911){const _0x270c51=_0x22fb42,_0x4e5a5b=_0x119911[_0x270c51];if('aiLicenseKeyValid'==_0x4e5a5b||'aiLicenseKeyInvalid'==_0x4e5a5b||'aiLicenseKeyExpired'==_0x4e5a5b||'aiLicenseKeyDomainLimit'==_0x4e5a5b||'aiLicenseKeyNotAllowed'==_0x4e5a5b||'aiLicenseKeyEvaluationLimit'==_0x4e5a5b||'aiLicenseKeyTrialLimit'==_0x4e5a5b||'aiLicenseKeyUsageLimit'==_0x4e5a5b){delete _0x119911[_0x270c51],_0x47e627=_0x4e5a5b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x47e627&&_0x119911['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x47e627&&_0x119911['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x47e627&&_0x119911['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x47e627&&_0x119911['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x47e627&&_0x119911['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x47e627&&_0x119911['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x47e627&&_0x119911['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x222a68='',_0x474b77='',_0x245f14='custom'){const _0x25b0bc=this['editor'],_0x443ed5=_0x25b0bc['editing']['view'],_0x4a7246=_0x25b0bc['plugins']['get'](a),_0x4c6809=_0x25b0bc['plugins']['get'](_0x2a385d);_0x4a7246['showFakeVisualSelection']();const _0x279897=new w(),_0x1fa33c=new ClipboardEvent('copy',{'clipboardData':_0x279897}),_0x1cb2e8=new _0x525304(_0x279897),_0x51810b=new _0x2aaf62(_0x443ed5,_0x1fa33c,{'dataTransfer':_0x1cb2e8});_0x4c6809['_forceMarkersCopy']('comment',()=>{_0x443ed5['document']['fire']('copy',_0x51810b);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x25b0bc,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x25ca45=_0x1cb2e8['getData']('text/html');const _0x88a02a=_0x25b0bc['model']['document']['selection'],_0x911428=Array['from'](_0x88a02a['getRanges']());0x1===_0x911428['length']&&_0x911428[0x0]['isFlat']&&!_0x88a02a['getSelectedElement']()&&''!==_0x25ca45['replace'](/ /g,'')['trim']()&&(_0x25ca45='<p>'+_0x25ca45+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x245f14,'query':_0x222a68,'htmlContent':_0x25ca45,'label':_0x474b77,'mainActionLabel':M[_0x25b0bc['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':_0x2f2b27['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4a7246['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x98e5f2=new Map(),_0x3ac554=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x45461a of _0x3ac554)for(const _0x57fbf4 of _0x45461a['commands'])_0x98e5f2['set'](_0x57fbf4['id'],{..._0x57fbf4,'groupId':_0x45461a['groupId'],'groupLabel':_0x45461a['groupLabel']||_0x45461a['groupId']});return _0x98e5f2;}['_createAIAssistantUIButton'](_0x1a2d92){const _0x5f0235=this['editor'],_0x317791=_0x5f0235['commands']['get']('showAIAssistant'),_0x383e22=new _0x1a2d92(_0x5f0235['locale']);return _0x383e22['set']({'label':i(_0x5f0235['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x383e22['bind']('isEnabled')['to'](_0x317791),_0x383e22['bind']('isOn')['to'](this['_dialog'],'id',_0x375469=>'aiAssistant'===_0x375469),this['listenTo'](_0x383e22,'execute',()=>{_0x383e22['isOn']?this['hideUI']():_0x317791['execute']();}),_0x383e22;}['_initView'](){const _0x55119c=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',()=>{_0x55119c['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x55119c['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x5539b0,ui:{ariaLiveAnnouncer:_0x43ee24}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x39e496,_0x106564,_0xc5771c)=>{const _0x24bd18=this['_aiAssistantController']['currentContext'];_0xc5771c?_0x43ee24['announce'](i(_0x5539b0,'AI\x20is\x20writing')):_0x24bd18&&_0x43ee24['announce'](i(_0x5539b0,'Generated\x20content:\x20%0',_0x24bd18),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3dc347,_0x431245,_0x190fc2)=>{if(_0x190fc2){const _0x508177=this['_formView']['errorView']['text'];_0x43ee24['announce'](i(_0x5539b0,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x508177));}});}['_onExecute'](_0x8407f1){const _0x5dcf19=this['_commandDefinitions']['get'](_0x8407f1),_0x19ad4a=this['editor'],_0x239989=_0x19ad4a['model']['document']['selection'],_0x1c8292=_0x19ad4a['commands']['get']('showAIAssistant'),_0x286e08=_0x19ad4a['plugins']['get'](a),_0x5c43d4=''+(_0x5dcf19['groupId']!==x?_0x5dcf19['groupLabel']+':\x20':'')+_0x5dcf19['label'];if(!0x1!==_0x5dcf19['requiresContent']&&_0x239989['isCollapsed']){const _0x4e9cb1=_0x32d55e(_0x239989['getSelectedBlocks']())||_0x19ad4a['model']['schema']['getLimitElement'](_0x239989);_0x19ad4a['model']['change'](_0x32a567=>{_0x32a567['setSelection'](_0x4e9cb1,'in');});}_0x286e08['showFakeVisualSelection'](),_0x1c8292['execute'](_0x5dcf19['prompt'],_0x5c43d4,'command:'+_0x8407f1);}['_populateMenuBarMenu'](_0xf122d5,_0x12bdf7,_0x1b8ba6,_0x3280bf){const _0x1058d1=this['editor'],_0x18fe87=_0x1058d1['locale'],_0x3a683c=new _0x458fdc(_0x18fe87),_0x1b2e7d=U(_0x1058d1,_0x1b8ba6)['filter'](_0x42edc7=>_0x42edc7['commands']['length']);0x1===_0x1b2e7d['length']?this['_getMenuBarGroupButtons']({'command':_0xf122d5,'commands':_0x1b2e7d[0x0]['commands'],'parentMenuView':_0x12bdf7,'onExecute':_0x3280bf})['forEach'](_0x3c4855=>_0x3a683c['items']['add'](_0x3c4855)):_0x1b2e7d['forEach'](({groupId:_0x23b9f2,groupLabel:_0x1ae647,commands:_0x3f6a09})=>{const _0x3f0f02=new _0x563a5a(_0x18fe87,_0x12bdf7),_0x444191=new _0x4507e7(_0x18fe87),_0x453304=new _0x458fdc(_0x18fe87),_0x220dbf=this['_getMenuBarGroupButtons']({'command':_0xf122d5,'commands':_0x3f6a09,'parentMenuView':_0x444191,'onExecute':_0x3280bf});_0x444191['buttonView']['set']({'label':_0x1ae647||_0x23b9f2}),_0x444191['delegate']('execute')['to'](_0x12bdf7),_0x453304['items']['addMany'](_0x220dbf),_0x444191['panelView']['children']['add'](_0x453304),_0x3f0f02['children']['add'](_0x444191),_0x3a683c['items']['add'](_0x3f0f02);}),_0x12bdf7['panelView']['children']['add'](_0x3a683c);}['_getMenuBarGroupButtons']({command:_0x2ded4e,commands:_0x3ccf27,parentMenuView:_0x472e13,onExecute:_0x534cfb}){const _0x257529=this['editor'],_0x328af7=_0x257529['locale'];return U(_0x257529,_0x3ccf27)['map'](_0x9bbdbd=>{const _0x55dbfc=new _0x563a5a(_0x328af7,_0x472e13),_0x4991e0=new _0x467b5c(_0x328af7);return _0x4991e0['set']({'label':_0x9bbdbd['label']}),_0x4991e0['delegate']('execute')['to'](_0x472e13),_0x4991e0['on']('execute',()=>_0x534cfb(_0x9bbdbd['id'])),_0x4991e0['bind']('isEnabled')['to'](_0x2ded4e,'enabledCommandsIds',_0x4755cf=>_0x4755cf['includes'](_0x9bbdbd['id'])),_0x55dbfc['children']['add'](_0x4991e0),_0x55dbfc;});}}function B(_0xd026c3,_0x46f277){return void 0x0!==_0xd026c3['order']&&void 0x0===_0x46f277['order']?0x1:void 0x0===_0xd026c3['order']&&void 0x0!==_0x46f277['order']?-0x1:void 0x0!==_0xd026c3['order']&&void 0x0!==_0x46f277['order']?_0xd026c3['order']-_0x46f277['order']:0x0;}function U(_0x577f11,_0xf78836){_0xf78836['sort'](B);const _0x3ee315={},_0x674185=[];for(const _0x1e33ff of _0xf78836)if(void 0x0!==_0x1e33ff['order']){if(_0x1e33ff['order']in _0x3ee315)throw new _0x567ba8('ai-commands-config-order-collision',_0x577f11,{'conflictingDefinitions':[_0x1e33ff,_0x3ee315[_0x1e33ff['order']]]});_0x3ee315[_0x1e33ff['order']]=_0x1e33ff,_0x674185['splice'](_0x1e33ff['order'],0x0,_0x1e33ff);}else _0x674185['push'](_0x1e33ff);return _0x674185;}class r extends _0xc924d8{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3cf5d8){super(_0x3cf5d8);const _0x2923b5=_0x3cf5d8['config'],_0x435828=_0x3cf5d8['locale'];_0x2923b5['define']('ai.aiAssistant.preserveComments',!0x0),_0x2923b5['define']('ai.aiAssistant.commands',function(_0xb50aa8){return[{'groupId':'editOrReview','groupLabel':i(_0xb50aa8,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0xb50aa8,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0xb50aa8,'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(_0xb50aa8,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0xb50aa8,'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(_0xb50aa8,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0xb50aa8,'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(_0xb50aa8,'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(_0xb50aa8,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0xb50aa8,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0xb50aa8,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0xb50aa8,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0xb50aa8,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0xb50aa8,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0xb50aa8,'Change\x20style'),'commands':[{'id':'business','label':i(_0xb50aa8,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0xb50aa8,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0xb50aa8,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0xb50aa8,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0xb50aa8,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0xb50aa8,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0xb50aa8,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0xb50aa8,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0xb50aa8,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0xb50aa8,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0xb50aa8,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0xb50aa8,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0xb50aa8,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x435828)),_0x2923b5['define']('ai.aiAssistant.extraCommandGroups',[]),_0x2923b5['define']('ai.aiAssistant.removeCommands',[]);let _0x55d13e=o(_0x2923b5['get']('ai.aiAssistant.commands'),_0x435828);const _0x24f21e=_0x2923b5['get']('ai.aiAssistant.extraCommandGroups'),_0x45fca8=_0x2923b5['get']('ai.aiAssistant.removeCommands');_0x24f21e['forEach'](_0x15501f=>{const _0x3f23cd=_0x55d13e['find'](_0x555274=>_0x555274['groupId']===_0x15501f['groupId']);_0x3f23cd?_0x3f23cd['commands']=_0x3f23cd['commands']['concat'](_0x15501f['commands']):_0x55d13e['push'](_0x15501f);}),_0x55d13e=_0x55d13e['filter'](_0x3317c2=>!_0x45fca8['includes'](_0x3317c2['groupId'])),_0x55d13e['forEach'](_0x3666f7=>{_0x3666f7['commands']=_0x3666f7['commands']['filter'](_0x58c809=>!_0x45fca8['includes'](_0x58c809['id']));}),_0x2923b5['set']('ai.aiAssistant.commands',_0x55d13e);}}class P extends _0xc924d8{['abortController'];static get['requires'](){return[K];}constructor(_0x5be120){super(_0x5be120),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'](_0x427347){return this['sendRequest'](_0x427347)['catch'](_0x3e0a88=>{if(_0x3e0a88 instanceof R)return Promise['reject'](_0x3e0a88);if('AbortError'==_0x3e0a88['name'])return Promise['resolve']();throw console['error'](_0x3e0a88),new _0x567ba8('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x5efec6,_0x2cf71a){const _0x27c71b=this['editor']['locale'],_0x5d522f={'Content-Type':'application/json'};if('object'==typeof _0x5efec6)Object['assign'](_0x5d522f,_0x5efec6);else{if(_0x5efec6)try{const _0x4da353=await _0x5efec6(_0x2cf71a);Object['assign'](_0x5d522f,_0x4da353);}catch(_0x276549){return Promise['reject'](new R(i(_0x27c71b,'AI_ERROR_GET_HEADERS')));}}return _0x5d522f;}async['_prepareRequestParameters'](_0x3e302b,_0x1ce485){const _0x11b8b8=this['editor']['locale'];if('object'==typeof _0x3e302b)return _0x3e302b;try{return await _0x3e302b(_0x1ce485);}catch(_0x4d5b2e){return Promise['reject'](new R(i(_0x11b8b8,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x95566e){super(_0x95566e),_0x95566e['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x95566e['config']['get']('ai.openAI.requestParameters')||_0x95566e['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x95566e['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x95566e['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x95566e['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x27f875,context:_0x3cfd05,onData:_0x59887a,actionId:_0x28f36c}){const _0x28b541=this['editor']['locale'],_0x3135f9=await this['prepareMessages'](_0x27f875,_0x3cfd05,_0x28f36c),_0x179f90=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x28f36c),_0x2e4060=await this['_prepareRequestParameters'](this['_requestParameters'],_0x28f36c),_0x556f8f={'messages':_0x3135f9,..._0x2e4060},_0x480210={'method':'POST','headers':_0x179f90,'body':JSON['stringify'](_0x556f8f),'signal':this['abortController']['signal']},_0x128a81=await fetch(this['_apiUrl'],_0x480210);if(_0x128a81['ok'])return _0x2e4060['stream']?await this['_readStreamableResponse'](_0x128a81,_0x59887a):await this['_readStaticResponse'](_0x128a81,_0x59887a),Promise['resolve']();{const _0x37a7db=await _0x128a81['text']();return _0x37a7db['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x28b541,'AI_ERROR_CONTEXT_LENGTH'))):_0x37a7db['includes']('Moderation')?Promise['reject'](new R(i(_0x28b541,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x37a7db));}}async['prepareMessages'](_0x2aeba4,_0x4cd8e1,_0x1c3e14){let _0x2fe640,_0x33c69f;return _0x4cd8e1?(_0x2fe640='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.',_0x33c69f='Instruction:\x0a'+_0x2aeba4+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4cd8e1):(_0x2fe640='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.',_0x33c69f=_0x2aeba4),[{'role':'system','content':_0x2fe640},{'role':'user','content':_0x33c69f}];}async['_readStreamableResponse'](_0x23b83b,_0x1aee3d){const _0x2058f2=_0x23b83b['body']['getReader'](),_0x4bf0e0=new TextDecoder();let _0x4cd281='',_0x1520b2='',_0x43e5e5='',_0x2c7abc=!0x1;for(;!_0x2c7abc;){const {done:_0x18537c,value:_0x50ca0a}=await _0x2058f2['read'](),_0x1d8aa5=_0x4cd281+_0x4bf0e0['decode'](_0x50ca0a);let _0xadd615='';_0x2c7abc=_0x18537c;try{_0xadd615=this['_cleanUpData'](_0x1d8aa5),_0x4cd281='';}catch(_0x2dcd76){_0x4cd281=_0x1d8aa5;continue;}_0x1520b2+=_0xadd615,!_0x2c7abc&&this['_isBufferIncomplete'](_0x1520b2)||_0x1520b2&&(_0x43e5e5+=_0x1520b2,_0x1520b2='',_0x1aee3d(_0x43e5e5));}return Promise['resolve']();}async['_readStaticResponse'](_0x249190,_0x5489d6){return _0x5489d6((await _0x249190['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x366f49){const _0x3b02c7=_0x366f49['split']('<')['length']!==_0x366f49['split']('>')['length'],_0x11562f=_0x366f49['length']<0x1e;return _0x3b02c7&&_0x11562f;}['_cleanUpData'](_0x3bbc33){return _0x3bbc33['split'](/\n(?![^{]*\})/g)['map'](_0xf3f574=>_0xf3f574['replace']('data:\x20',''))['filter'](_0x453cd4=>_0x453cd4&&_0x453cd4['length']>0x0&&'[DONE]'!==_0x453cd4)['map'](_0x140379=>{const {choices:_0x46bd2d}=JSON['parse'](_0x140379);if(_0x46bd2d[0x0]&&_0x46bd2d[0x0]['delta']&&_0x46bd2d[0x0]['delta']['content'])return _0x46bd2d[0x0]['delta']['content'];})['filter'](_0x508caf=>_0x508caf)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x168829){super(_0x168829),_0x168829['config']['get']('ai.aws.requestParameters')||_0x168829['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']=_0x168829['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x168829['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x168829['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x168829['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x4f8eb2,context:_0x441ffc,onData:_0x852819,actionId:_0x4b0322}){const {model:_0x392e45,stream:_0x1c9514,..._0x11005a}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4b0322),_0x1b7f1c={'prompt':await this['preparePrompt'](_0x4f8eb2,_0x441ffc,_0x392e45,_0x4b0322),..._0x11005a};this['_apiUrl']?await this['_processProxyRequest'](_0x1b7f1c,_0x392e45,_0x1c9514,_0x852819,_0x4b0322):await this['_processAWSRequest'](_0x1b7f1c,_0x392e45,_0x1c9514,_0x852819);}async['preparePrompt'](_0x4cf0a8,_0x478086,_0x41804e,_0x1003cf){let _0x3792a0,_0x4dc222;return _0x478086?(_0x3792a0='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.',_0x4dc222='Instruction:\x0a'+_0x4cf0a8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x478086):(_0x3792a0='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.',_0x4dc222=_0x4cf0a8),'meta.llama'==this['getModelFamily'](_0x41804e)?'<<SYS>>\x0a'+_0x3792a0+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4dc222+'\x0a[/INST]':'Human:\x0a'+_0x3792a0+'\x0a'+_0x4dc222+'\x0a\x0aAssistant:';}['getModelFamily'](_0x22ff9d){if(/^anthropic\.claude/['test'](_0x22ff9d))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x22ff9d))return'ai21.j2';if(/^cohere\.command/['test'](_0x22ff9d))return'cohere.command';if(/^meta\.llama/['test'](_0x22ff9d))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x22ff9d));}async['_processProxyRequest'](_0x27d60b,_0x485208,_0x1cff27,_0x4ad5bc,_0x3d3ab2){const _0x2e1635={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3d3ab2),'body':JSON['stringify']({..._0x27d60b,'model':_0x485208,'stream':_0x1cff27}),'signal':this['abortController']['signal']},_0x3660f5=await fetch(this['_apiUrl'],_0x2e1635);_0x1cff27?await this['_readStreamableResponse'](_0x3660f5,_0x485208,_0x4ad5bc):await this['_readStaticResponse'](_0x3660f5,_0x485208,_0x4ad5bc);}async['_processAWSRequest'](_0x508b28,_0x357b81,_0x18540e,_0x3f5c52){const _0x46e4f2=new _0x14af6e(this['_bedrockClientConfig']),_0x3fc1c8={'body':JSON['stringify'](_0x508b28),'contentType':'application/json','accept':'application/json','modelId':_0x357b81};let _0xfbf721;if(_0x18540e){const _0x434992=new _0x5b5899(_0x3fc1c8);_0xfbf721=await _0x46e4f2['send'](_0x434992,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0xfbf721,_0x357b81,_0x3f5c52);}else{const _0xdffc2b=new _0x463689(_0x3fc1c8);_0xfbf721=await _0x46e4f2['send'](_0xdffc2b,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0xfbf721,_0x357b81,_0x3f5c52);}}async['_readAsyncIterableResponse'](_0x4d7b57,_0x5e08bd,_0x1c1a39){const _0x7fbf8e=_0x4d7b57['body'],_0x42264a=new TextDecoder('utf-8');let _0x3220ab='';for await(const _0x542e94 of _0x7fbf8e)if(_0x542e94['chunk']){const _0x2da327=_0x42264a['decode'](_0x542e94['chunk']['bytes']),_0x1f85ce=JSON['parse'](_0x2da327);_0x3220ab+=this['_getGeneratedText'](_0x1f85ce,_0x5e08bd),_0x1c1a39(_0x3220ab);}return Promise['resolve']();}async['_readStreamableResponse'](_0x48e00e,_0x255f65,_0xaa746){const _0xcdf618=_0x48e00e['body'],_0x683582=new TextDecoder('utf-8'),_0x296b04=_0xcdf618['getReader']();let _0x574509='',_0x1046a5='',_0x1ff245=!0x1;for(;!_0x1ff245;){const {done:_0x1956eb,value:_0x190b5f}=await _0x296b04['read']();if(_0x1ff245=_0x1956eb,_0x1ff245)break;const _0x1cf56c=(_0x574509+_0x683582['decode'](_0x190b5f))['split']('\x0a')['map'](_0x42cd5b=>{try{return _0x574509='',JSON['parse'](_0x42cd5b);}catch(_0x2d1c10){return _0x574509=_0x42cd5b,null;}})['filter'](_0x240bc1=>null!==_0x240bc1);_0x1cf56c['length']&&(_0x1046a5+=_0x1cf56c['map'](_0x2c78e8=>this['_getGeneratedText'](_0x2c78e8,_0x255f65))['join'](''),_0xaa746(_0x1046a5));}return Promise['resolve']();}async['_readStaticResponse'](_0x2db993,_0x2dfce1,_0x560c4a){let _0x13bbcd;return _0x13bbcd=_0x2db993 instanceof Response?await _0x2db993['json']():JSON['parse'](Buffer['from'](_0x2db993['body'])['toString']('utf8')),(_0x560c4a(this['_getGeneratedText'](_0x13bbcd,_0x2dfce1)),Promise['resolve']());}['_getGeneratedText'](_0x85e1b9,_0x267a86){switch(this['getModelFamily'](_0x267a86)){case'anthropic.claude':return _0x85e1b9['completion'];case'ai21.j2':return _0x85e1b9['completions'][0x0]['data']['text'];case'cohere.command':return _0x85e1b9['generations'][0x0]['text'];case'meta.llama':return _0x85e1b9['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 _0x5c3869,Command as _0x44947f,icons as _0x50bcb8}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x47d5e5,CKEditorError as _0x50c17c,ObservableMixin as _0x3a2e50,global as _0x4334cb,isVisible as it,Rect as st,Collection as _0xcae739,FocusTracker as _0x5a9f9d,KeystrokeHandler as ts,first as _0x1a913c}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x1d3846,View as _0x438a2c,SpinnerView as _0x5549b0,IconView as _0x3d0dc4,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x2c6b63,ButtonLabelView as te,FocusCycler as _0x1f443f,createLabeledTextarea as _0x485039,Dialog as _0x352785,createDropdown as _0x3128ee,addMenuToDropdown as _0x3e5861,MenuBarMenuView as _0x3a2c13,MenuBarMenuListItemButtonView as _0xb92597,DialogViewPosition as _0x5af3cd,MenuBarMenuListView as _0x4c7c75,MenuBarMenuListItemView as _0x5b6d2c}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x33b98b,ClipboardMarkersUtils as _0x4bec40}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x3a4bcc,DataTransfer as _0xba96fd,UpcastWriter as _0x550b21,Matcher as _0x4b14ca}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x518ce3,escape as _0x450af6}from'lodash-es';import{BedrockRuntimeClient as _0x14c587,InvokeModelWithResponseStreamCommand as _0x5dc4c8,InvokeModelCommand as _0x53f45b}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x32d19a,_0x3e5d02){const _0x17e91e=(0x0,_0x3e5d02['t'])('Other');return _0x32d19a['length']?'groupId'in _0x32d19a[0x0]?_0x32d19a:[{'groupId':x,'groupLabel':_0x17e91e,'order':0x1/0x0,'commands':_0x32d19a}]:[{'groupId':x,'groupLabel':_0x17e91e,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x5c3869{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x87a989}=this,_0x6b4bc3=['ck-fake-ai-selection'];_0x87a989['config']['get']('ai.useTheme')&&_0x6b4bc3['push']('ck-ai-assistant-ui_theme'),_0x87a989['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x6b4bc3,'priority':0xc}}),_0x87a989['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0xd32a12,{writer:_0x5a4c0e})=>{if(!_0xd32a12['markerRange']['isCollapsed'])return null;const _0x4655da=_0x5a4c0e['createUIElement']('span');return _0x5a4c0e['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4655da),_0x4655da;}});}['afterInit'](){!async function(_0x1792d6){const _0x58adb5=_0x5c60dc([0x56,0x41,0x58,0x51,0x63,0x73,0x45,0x55,0x74,0x31,0x68,0x42,0x62,0x77,0x76,0x64,0x78,0x4a,0x75,0x61,0x7a,0x35,0x39,0x34,0x54,0x4d,0x69,0x49,0x44,0x6f,0x59,0x71,0x30,0x4f,0x70,0x65,0x4e,0x32,0x33,0x79,0x6b,0x6c,0x50,0x6d,0x53,0x38,0x43,0x66,0x67,0x57,0x46,0x47,0x48,0x4b,0x72,0x52,0x37,0x6a,0x5a,0x36,0x6e,0x4c]),_0x5e12d8=0x3898d9d0,_0x46ddd1=0x389f8790^_0x5e12d8,_0x5ecac2=window[_0x5c60dc([0x44,0x61,0x74,0x65])][_0x5c60dc([0x6e,0x6f,0x77])](),_0x532e46=_0x1792d6[_0x5c60dc([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x60fc0d=new window[(_0x5c60dc([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x54810c=>{_0x532e46[_0x5c60dc([0x6f,0x6e,0x63,0x65])](_0x5c60dc([0x72,0x65,0x61,0x64,0x79]),_0x54810c);}),_0x1bd8b6={[_0x5c60dc([0x6b,0x74,0x79])]:_0x5c60dc([0x45,0x43]),[_0x5c60dc([0x75,0x73,0x65])]:_0x5c60dc([0x73,0x69,0x67]),[_0x5c60dc([0x63,0x72,0x76])]:_0x5c60dc([0x50,0x2d,0x32,0x35,0x36]),[_0x5c60dc([0x78])]:_0x5c60dc([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]),[_0x5c60dc([0x79])]:_0x5c60dc([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]),[_0x5c60dc([0x61,0x6c,0x67])]:_0x5c60dc([0x45,0x53,0x32,0x35,0x36])},_0x12cf64=_0x532e46[_0x5c60dc([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x5c60dc([0x67,0x65,0x74])](_0x5c60dc([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x40106a(){let _0x461ddb,_0x308e10=null,_0x4df1c1=null;try{if(_0x12cf64==_0x5c60dc([0x47,0x50,0x4c]))return _0x5c60dc([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x461ddb=_0x1df50f(),!_0x461ddb)return _0x5c60dc([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x461ddb[_0x5c60dc([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x4df1c1=_0x1f29f9(_0x461ddb[_0x5c60dc([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x461ddb[_0x5c60dc([0x6a,0x74,0x69])])),await _0xc302b5()?_0x216ecd()?_0x5141a3()?_0x5c60dc([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3abbee()?(_0x461ddb[_0x5c60dc([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5c60dc([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x308e10=_0x2ee061(_0x5c60dc([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x461ddb[_0x5c60dc([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5c60dc([0x74,0x72,0x69,0x61,0x6c])&&(_0x308e10=_0x2ee061(_0x5c60dc([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x351246()):_0x5c60dc([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x5c60dc([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x5c60dc([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x53c36f){return _0x5c60dc([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5141a3(){const _0x3aea91=[_0x5c60dc([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x5c60dc([0x74,0x72,0x69,0x61,0x6c])][_0x5c60dc([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x461ddb[_0x5c60dc([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5ecac2/0x3e8:0xe10*_0x46ddd1;return _0x461ddb[_0x5c60dc([0x65,0x78,0x70])]<_0x3aea91;}function _0x216ecd(){const _0xfab6ab=_0x461ddb[_0x5c60dc([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0xfab6ab&&(!!_0xfab6ab[_0x5c60dc([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5c60dc([0x2a]))||!!_0xfab6ab[_0x5c60dc([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5c60dc([0x41,0x49])));}function _0x3abbee(){const _0x1535a0=_0x461ddb[_0x5c60dc([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1535a0||0x0==_0x1535a0[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x12ca79}=new URL(window[_0x5c60dc([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1535a0[_0x5c60dc([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x12ca79))return!0x0;const _0x313cd3=_0x12ca79[_0x5c60dc([0x73,0x70,0x6c,0x69,0x74])](_0x5c60dc([0x2e]));return _0x1535a0[_0x5c60dc([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3547e8=>_0x3547e8[_0x5c60dc([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5c60dc([0x2a])))[_0x5c60dc([0x6d,0x61,0x70])](_0x43b22f=>_0x43b22f[_0x5c60dc([0x73,0x70,0x6c,0x69,0x74])](_0x5c60dc([0x2e])))[_0x5c60dc([0x73,0x6f,0x6d,0x65])](_0x137e18=>_0x313cd3[_0x5c60dc([0x65,0x76,0x65,0x72,0x79])]((_0x151e8a,_0x4bad5e)=>_0x137e18[_0x4bad5e]===_0x151e8a||_0x137e18[_0x4bad5e]===_0x5c60dc([0x2a])));}function _0x351246(){return _0x308e10&&_0x4df1c1?new window[(_0x5c60dc([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xa5424a,_0x34b5c8)=>{_0x308e10[_0x5c60dc([0x74,0x68,0x65,0x6e])](_0xa5424a,_0x34b5c8),_0x4df1c1[_0x5c60dc([0x74,0x68,0x65,0x6e])](_0x3ec80f=>{_0x3ec80f!=_0x5c60dc([0x56,0x61,0x6c,0x69,0x64])&&_0xa5424a(_0x3ec80f);},_0x34b5c8);}):_0x308e10||_0x4df1c1||_0x5c60dc([0x56,0x61,0x6c,0x69,0x64]);}}function _0x1f29f9(_0x58ce82,_0x3e6d1b){return new window[(_0x5c60dc([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x514826=>{if(_0x1d3794())return _0x514826(_0x5c60dc([0x56,0x61,0x6c,0x69,0x64]));_0x552289(),_0x532e46[_0x5c60dc([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x5c60dc([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x2ba8d9=!0x1;const _0x25a376=_0x47d5e5();function _0x5acd57(_0x190cb6){return!!_0x190cb6&&(typeof _0x190cb6===_0x5c60dc([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x190cb6===_0x5c60dc([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x190cb6[_0x5c60dc([0x74,0x68,0x65,0x6e])]===_0x5c60dc([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x190cb6[_0x5c60dc([0x63,0x61,0x74,0x63,0x68])]===_0x5c60dc([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x5a7852(_0x5ec062){_0x3ebad9(_0x5ec062)[_0x5c60dc([0x74,0x68,0x65,0x6e])](_0xc0336b=>{if(!_0xc0336b||_0xc0336b[_0x5c60dc([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x5c60dc([0x6f,0x6b]))return _0x5c60dc([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1c50bb(_0x3dd950(_0x25a376+_0x3e6d1b))!=_0xc0336b[_0x5c60dc([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x5c60dc([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x5c60dc([0x56,0x61,0x6c,0x69,0x64]);})[_0x5c60dc([0x74,0x68,0x65,0x6e])](_0x55ca4f=>(_0x41641a(),_0x55ca4f),()=>{const _0xb7ee18=_0x217ede();return null==_0xb7ee18?(_0x41641a(),_0x5c60dc([0x56,0x61,0x6c,0x69,0x64])):_0x5c60dc(_0x5ecac2-_0xb7ee18>(0x1c945dd0^_0x5e12d8)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x5c60dc([0x74,0x68,0x65,0x6e])](_0x514826)[_0x5c60dc([0x63,0x61,0x74,0x63,0x68])](()=>{_0x514826(_0x5c60dc([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x4ec2eb=0x38ae3750^_0x5e12d8;function _0x41641a(){const _0x369ec9=_0x5c60dc([0x6c,0x6c,0x63,0x74,0x2d])+_0x1c50bb(_0x3dd950(_0x58ce82)),_0x566c9f=_0x260d37(_0x1c50bb(window[_0x5c60dc([0x4d,0x61,0x74,0x68])][_0x5c60dc([0x63,0x65,0x69,0x6c])](_0x5ecac2/_0x4ec2eb)));window[_0x5c60dc([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5c60dc([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x369ec9,_0x566c9f);}function _0x217ede(){const _0xbf17eb=_0x5c60dc([0x6c,0x6c,0x63,0x74,0x2d])+_0x1c50bb(_0x3dd950(_0x58ce82)),_0x5f1aeb=window[_0x5c60dc([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5c60dc([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xbf17eb);return _0x5f1aeb?window[_0x5c60dc([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x260d37(_0x5f1aeb),0x10)*_0x4ec2eb:null;}function _0x3ebad9(_0x52088d){return new window[(_0x5c60dc([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4bf511,_0x13499f)=>{_0x52088d[_0x5c60dc([0x74,0x68,0x65,0x6e])](_0x4bf511,_0x13499f),window[_0x5c60dc([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x13499f,0x38990d10^_0x5e12d8);});}}_0x532e46[_0x5c60dc([0x6f,0x6e])](_0x5c60dc([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x572f1d,_0xdc8934)=>{if(_0xdc8934[0x0]!=_0x58ce82)return _0x514826(_0x5c60dc([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0xdc8934[0x1]={..._0xdc8934[0x1],[_0x5c60dc([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x25a376};},{[_0x5c60dc([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5c60dc([0x68,0x69,0x67,0x68])}),_0x532e46[_0x5c60dc([0x6f,0x6e])](_0x5c60dc([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x376416=>{_0x5acd57(_0x376416[_0x5c60dc([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x2ba8d9=!0x0,_0x5a7852(_0x376416[_0x5c60dc([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x5c60dc([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5c60dc([0x6c,0x6f,0x77])}),_0x60fc0d[_0x5c60dc([0x74,0x68,0x65,0x6e])](()=>{_0x2ba8d9||_0x514826(_0x5c60dc([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x1d3794(){return _0x532e46[_0x5c60dc([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5c60dc([0x76,0x69,0x65,0x77])][_0x5c60dc([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x5c60dc([0x61,0x75,0x74,0x6f]);}function _0x552289(){_0x532e46[_0x5c60dc([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5c60dc([0x76,0x69,0x65,0x77])][_0x5c60dc([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x5c60dc([0x61,0x75,0x74,0x6f]);}}function _0x2ee061(_0x427961){const _0x76c412=[new window[(_0x5c60dc([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2d9d97=>setTimeout(_0x2d9d97,0x3891e71c^_0x5e12d8)),_0x60fc0d[_0x5c60dc([0x74,0x68,0x65,0x6e])](()=>new window[(_0x5c60dc([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x52419b=>{let _0x199e37=0x0;_0x532e46[_0x5c60dc([0x6d,0x6f,0x64,0x65,0x6c])][_0x5c60dc([0x6f,0x6e])](_0x5c60dc([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1f1b61,_0x101ad6)=>{_0x101ad6[0x0][_0x5c60dc([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x199e37++,_0x199e37==(0x3898d828^_0x5e12d8)&&(_0x52419b(),_0x1f1b61[_0x5c60dc([0x6f,0x66,0x66])]());});}))];return window[_0x5c60dc([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x5c60dc([0x72,0x61,0x63,0x65])](_0x76c412)[_0x5c60dc([0x74,0x68,0x65,0x6e])](()=>_0x427961);}async function _0x19e627(){await _0x60fc0d,_0x532e46[_0x5c60dc([0x6d,0x6f,0x64,0x65,0x6c])][_0x5c60dc([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x32e453,_0x532e46[_0x5c60dc([0x6d,0x6f,0x64,0x65,0x6c])][_0x5c60dc([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x32e453,_0x532e46[_0x5c60dc([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x5c60dc([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2b4db8(_0x24a786){const _0x3dc905=_0x429ebc();_0x532e46[_0x3dc905]=_0x5c60dc([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x24a786,_0x24a786!=_0x5c60dc([0x56,0x61,0x6c,0x69,0x64])&&_0x19e627();}function _0x429ebc(){const _0x1a6ed2=window[_0x5c60dc([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x5c60dc([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x5c60dc([0x6e,0x6f,0x77])]())[_0x5c60dc([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x5c60dc([0x2e]),'');let _0x45c078=_0x5c60dc([0x56]);for(let _0x497e77=0x0;_0x497e77<_0x1a6ed2[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x497e77+=0x2){let _0x3bbff4=window[_0x5c60dc([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1a6ed2[_0x5c60dc([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x497e77,_0x497e77+0x2));_0x3bbff4>=_0x58adb5[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3bbff4-=_0x58adb5[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x45c078+=_0x58adb5[_0x3bbff4];}return _0x45c078;}function _0x1df50f(){const _0x345719=_0x12cf64[_0x5c60dc([0x73,0x70,0x6c,0x69,0x74])](_0x5c60dc([0x2e]));if(0x3!=_0x345719[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3ce6df(_0x345719[0x1]);function _0x3ce6df(_0x4ebf9f){const _0x590c97=_0x348862(_0x4ebf9f);return _0x590c97&&_0x2e0fd6()?_0x590c97:null;function _0x2e0fd6(){const _0x574f2b=_0x590c97[_0x5c60dc([0x6a,0x74,0x69])],_0x464175=window[_0x5c60dc([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x574f2b[_0x5c60dc([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x574f2b[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x4338fa={..._0x590c97,[_0x5c60dc([0x6a,0x74,0x69])]:_0x574f2b[_0x5c60dc([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x574f2b[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x4338fa[_0x5c60dc([0x76,0x63])],_0x3dd950(_0x4338fa)==_0x464175;}}}async function _0xc302b5(){let _0x4db5e8=!0x0;try{const _0x5bbafc=_0x12cf64[_0x5c60dc([0x73,0x70,0x6c,0x69,0x74])](_0x5c60dc([0x2e])),[_0x4c47e8,_0x2f4569,_0x1c8c0c]=_0x5bbafc;return _0x43cd2f(_0x4c47e8),await _0x50e32f(_0x4c47e8,_0x2f4569,_0x1c8c0c),_0x4db5e8;}catch(_0x3cdf22){return!0x1;}function _0x43cd2f(_0x4daf6e){const _0x3dd781=_0x348862(_0x4daf6e);_0x3dd781&&_0x3dd781[_0x5c60dc([0x61,0x6c,0x67])]==_0x5c60dc([0x45,0x53,0x32,0x35,0x36])||(_0x4db5e8=!0x1);}async function _0x50e32f(_0x194e4b,_0x531a11,_0x26f841){const _0x5cb867=window[_0x5c60dc([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x5c60dc([0x66,0x72,0x6f,0x6d])](_0x4dbe7e(_0x26f841),_0x43789b=>_0x43789b[_0x5c60dc([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x3773e3=new window[(_0x5c60dc([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x5c60dc([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x194e4b+_0x5c60dc([0x2e])+_0x531a11),_0x32ac84=window[_0x5c60dc([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x5c60dc([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x32ac84)return;const _0x523a35=await _0x32ac84[_0x5c60dc([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x5c60dc([0x6a,0x77,0x6b]),_0x1bd8b6,{[_0x5c60dc([0x6e,0x61,0x6d,0x65])]:_0x5c60dc([0x45,0x43,0x44,0x53,0x41]),[_0x5c60dc([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x5c60dc([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x5c60dc([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x32ac84[_0x5c60dc([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x5c60dc([0x6e,0x61,0x6d,0x65])]:_0x5c60dc([0x45,0x43,0x44,0x53,0x41]),[_0x5c60dc([0x68,0x61,0x73,0x68])]:{[_0x5c60dc([0x6e,0x61,0x6d,0x65])]:_0x5c60dc([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x523a35,_0x5cb867,_0x3773e3)||(_0x4db5e8=!0x1);}}function _0x348862(_0x3a4554){return _0x3a4554[_0x5c60dc([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x5c60dc([0x65,0x79]))?JSON[_0x5c60dc([0x70,0x61,0x72,0x73,0x65])](_0x4dbe7e(_0x3a4554)):null;}function _0x4dbe7e(_0xfb6b03){return window[_0x5c60dc([0x61,0x74,0x6f,0x62])](_0xfb6b03[_0x5c60dc([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x5c60dc([0x2b]))[_0x5c60dc([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x5c60dc([0x2f])));}function _0x3dd950(_0x263564){let _0x5a7abd=0x1505;function _0x407e90(_0x2b5121){for(let _0x2d6e7d=0x0;_0x2d6e7d<_0x2b5121[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2d6e7d++){const _0x349aca=_0x2b5121[_0x5c60dc([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2d6e7d);_0x5a7abd=(_0x5a7abd<<0x5)+_0x5a7abd+_0x349aca,_0x5a7abd&=_0x5a7abd;}}function _0x3bc029(_0x3f54be){Array[_0x5c60dc([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3f54be)?_0x3f54be[_0x5c60dc([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x3bc029):_0x3f54be&&typeof _0x3f54be==_0x5c60dc([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x5c60dc([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3f54be)[_0x5c60dc([0x73,0x6f,0x72,0x74])]()[_0x5c60dc([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1459d0,_0x164c9c])=>{_0x407e90(_0x1459d0),_0x3bc029(_0x164c9c);}):_0x407e90(window[_0x5c60dc([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3f54be));}return _0x3bc029(_0x263564),_0x5a7abd>>>0x0;}function _0x1c50bb(_0x46108b){return _0x46108b[_0x5c60dc([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x5c60dc([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x5c60dc([0x30]));}function _0x260d37(_0x56513d){return _0x56513d[_0x5c60dc([0x73,0x70,0x6c,0x69,0x74])]('')[_0x5c60dc([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x5c60dc([0x6a,0x6f,0x69,0x6e])]('');}function _0x32e453(){}function _0x5c60dc(_0x5c9239){return _0x5c9239['map'](_0x534b4d=>String['fromCharCode'](_0x534b4d))['join']('');}_0x2b4db8(await _0x40106a());}(this);}['showFakeVisualSelection'](){const _0x4a763d=this['editor']['model'];_0x4a763d['change'](_0x18327c=>{const _0x48f1b2=_0x4a763d['document']['selection']['getRanges']();let _0x3d1b30=0x0;for(const _0xdca27c of _0x48f1b2){const _0x57f20e=f+':'+_0x3d1b30;if(_0x4a763d['markers']['has'](_0x57f20e))_0x18327c['updateMarker'](_0x57f20e,{'range':_0xdca27c});else{if(_0xdca27c['start']['isAtEnd']){const _0x5d1211=_0xdca27c['start']['getLastMatchingPosition'](({item:_0xf71f09})=>!_0x4a763d['schema']['isContent'](_0xf71f09),{'boundaries':_0xdca27c});_0x18327c['addMarker'](_0x57f20e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x18327c['createRange'](_0x5d1211,_0xdca27c['end'])});}else _0x18327c['addMarker'](_0x57f20e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xdca27c});}_0x3d1b30++;}});}['hideFakeVisualSelection'](){const _0x448cf4=this['editor']['model'],_0x363574=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x363574['length']&&_0x448cf4['change'](_0x272d5f=>{_0x363574['forEach'](_0x39118f=>{_0x272d5f['removeMarker'](_0x39118f);});});}['insertContent'](_0x299989,_0x4046dc){const _0x53b0cd=this['_getAISelection'](),_0x4fb7ba=_0x4046dc||_0x53b0cd['getFirstRange']();this['editor']['model']['canEditAt'](_0x4fb7ba)&&this['editor']['model']['change'](_0x59235d=>{this['hideFakeVisualSelection'](),_0x4046dc||this['_resetContentOfSelectedTableCells'](_0x59235d,_0x53b0cd),this['_pasteHTMLUsingClipboard']({'insertAt':_0x4fb7ba,'writer':_0x59235d,'html':_0x299989});});}['insertContentBelow'](_0x4f47eb){const {model:_0x314e6b}=this['editor'],_0x2e0704=this['_getAISelection']();_0x314e6b['change'](()=>{const _0x3fc6b8=this['_prepareTableInsertBelowPosition'](_0x4f47eb,_0x2e0704)||this['_getDefaultInsertBelowPosition'](_0x2e0704);this['insertContent'](_0x4f47eb,_0x3fc6b8);});}['_getAISelection'](){const _0x44af3c=this['editor']['model'],_0x44face=Array['from'](_0x44af3c['markers']['getMarkersGroup'](f))['map'](_0x122a5d=>_0x122a5d['getRange']());return _0x44af3c['createSelection'](_0x44face);}['_pasteHTMLUsingClipboard']({writer:_0x153264,html:_0x329bb6,insertAt:_0x55e394}){const {view:_0x4bcc71}=this['editor']['editing'],_0x3437c0=this['editor']['plugins']['get'](_0x33b98b),_0x1a20b4=new dt();_0x1a20b4['setData']('text/html',_0x329bb6);const _0x72911d=new ClipboardEvent('paste',{'clipboardData':_0x1a20b4}),_0x4da14a=new _0x3a4bcc(_0x4bcc71,_0x72911d,{'dataTransfer':new _0xba96fd(_0x1a20b4)});_0x153264['setSelection'](_0x55e394);const _0x3ef3d0=(_0x12c88b,_0x1a5491)=>{_0x1a5491['resultRange']&&_0x153264['setSelection'](_0x1a5491['resultRange']);};_0x3437c0['once']('contentInsertion',_0x3ef3d0,{'priority':'lowest'}),_0x4bcc71['document']['fire']('paste',_0x4da14a),_0x3437c0['off']('contentInsertion',_0x3ef3d0);}['_getDefaultInsertBelowPosition'](_0x2ee8f1){const {model:_0x24b724}=this['editor'],_0x50c1c1=Array['from'](_0x2ee8f1['getSelectedBlocks']());return _0x50c1c1['length']?_0x24b724['createPositionAfter'](_0x50c1c1['pop']()):_0x2ee8f1['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x43992b,_0x32be55){const {model:_0x1b05ec,plugins:_0x38f36c}=this['editor'];if(_0x38f36c['has']('TableUtils')){const _0x17838d=_0x38f36c['get']('TableUtils')['getSelectedTableCells'](_0x32be55);if(_0x17838d['length']){const _0xe366be=this['_getTableRowCountFromContent'](_0x43992b),_0x22a43a=this['_createEmptyTableRows'](_0x17838d,_0xe366be);return _0x1b05ec['createPositionAt'](_0x22a43a,0x0);}}return null;}['_getTableRowCountFromContent'](_0x499359){const _0x5c51b6=this['editor']['plugins']['get']('TableUtils'),_0x490de1=this['editor']['data']['parse'](_0x499359),_0x46ce80=Array['from'](_0x490de1['getChildren']())['filter'](_0x10ba2e=>_0x10ba2e['is']('element','table'));let _0xb9f4e6=0x0;return _0x46ce80['forEach'](_0x52c568=>{_0xb9f4e6+=_0x5c51b6['getRows'](_0x52c568);}),_0xb9f4e6;}['_createEmptyTableRows'](_0x36f754,_0x363ec1){const _0x1ce947=this['editor']['plugins']['get']('TableUtils'),_0x4380bd=_0x1ce947['getRowIndexes'](_0x36f754),_0x1b7642=_0x1ce947['getColumnIndexes'](_0x36f754),_0x538598=_0x4380bd['last']+0x1,_0x16c881=_0x1b7642['first'],_0x256443=_0x36f754[0x0]['findAncestor']('table');for(let _0xfa5963=0x0;_0xfa5963<_0x363ec1;_0xfa5963++)_0x1ce947['insertRows'](_0x256443,{'at':_0x538598});return _0x256443['getChild'](_0x538598)['getChild'](_0x16c881);}['_resetContentOfSelectedTableCells'](_0x406a6d,_0x1dcd82){const {plugins:_0x265146}=this['editor'],{model:_0xf18739}=_0x406a6d;if(!_0x265146['has']('TableUtils'))return;_0x265146['get']('TableUtils')['getSelectedTableCells'](_0x1dcd82)['length']&&_0xf18739['deleteContent'](_0x1dcd82);}}class K extends _0x5c3869{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x50c17c('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x62e5){super(_0x62e5),this['name']='AIRequestError';}}function i(_0x2b9d13,_0x382147,_0x2f6b8a){const t=_0x2b9d13['t'];switch(_0x382147){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',_0x2f6b8a);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2f6b8a);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'},_0x2f6b8a);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 _0x382147;}}class E extends _0x44947f{['_commandDefinitions'];constructor(_0x2e039a,_0x57310e){super(_0x2e039a),this['_commandDefinitions']=_0x57310e,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x10f530,_0xb538a8,_0x39175c)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x39175c));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xfb80d6,_0x40a20b,_0x55c5a3)=>{this['enabledCommandsIds']=_0x55c5a3?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x36bf95=this['editor']['model'];this['_hasContext']=function(_0x21bec6){const _0x22bf99=_0x21bec6['document']['selection'];return _0x22bf99['isCollapsed']?0x0!==[..._0x22bf99['getSelectedBlocks']()]['length']&&![..._0x22bf99['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x21bec6['hasContent'](_0x22bf99['getFirstRange']());}(_0x36bf95);const _0x255800=_0x36bf95['document']['selection'],_0x243286=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x49a063 of _0x255800['getRanges']())for(const _0x4f7cf1 of _0x49a063['getItems']())if(_0x4f7cf1['is']('element')&&_0x243286['includes'](_0x4f7cf1['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x1e20f9='',_0x516cef='',_0x3eb0fd='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x1e20f9,_0x516cef,_0x3eb0fd);}}function G(_0x1feb0c,_0x213ef8){const _0x49430b=new Set();for(const _0x216a52 of _0x1feb0c['values']())(_0x213ef8||!0x1===_0x216a52['requiresContent'])&&_0x49430b['add'](_0x216a52['id']);return Array['from'](_0x49430b);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x3a2e50(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x550a73,_0x482653,_0x37ca8e){super(),this['editor']=_0x550a73,this['textAdapter']=_0x482653,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x37ca8e,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x15f3a4,_0x4a95db,_0x3e6607)=>{this['view']['value']=this['_sanitizeHTML'](_0x3e6607);}),this['listenTo'](this['view'],'submitPrompt',(_0x2099af,_0x4ba920)=>{const _0x2f1029=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4ba920,_0x2f1029,'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:_0x7ce203,query:_0x45cdd7,htmlContent:_0x277892,label:_0x316171,mainActionLabel:_0x1f5a41}){this['view']['prompt']=_0x316171,this['view']['mainAction']=_0x1f5a41,this['initialContext']=_0x277892,_0x45cdd7&&(this['view']['isRendered']?this['_handleQuery'](_0x45cdd7,_0x277892,_0x7ce203,_0x316171):this['view']['once']('render',()=>{this['_handleQuery'](_0x45cdd7,_0x277892,_0x7ce203,_0x316171);}));}['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'](_0x13b133,_0x15a065,_0x5d2b0,_0x50b71d){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x15a065,this['previousQuery']=_0x13b133,this['previousLabel']=_0x50b71d||_0x13b133,this['previousActionId']=_0x5d2b0,new Promise(_0x245e09=>{this['textAdapter']['makeRequest']({'query':_0x13b133,'context':_0x15a065,'onData':_0x2988a5=>{this['currentResponse']=_0x2988a5,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5d2b0})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3cdc33=>{_0x3cdc33 instanceof R?this['view']['handleError'](_0x3cdc33['message']):this['view']['handleError'](),_0x245e09();})['finally'](()=>{this['stopProcessing'](),_0x245e09();});});}['_parseAndNormalizeContent'](_0x3d77ac,_0x179f00=!0x1){const _0x525598=Z['exec'](_0x3d77ac);_0x3d77ac=_0x525598?_0x3d77ac['substring'](_0x525598[0x1]['length']):_0x3d77ac['length']<0x64&&!_0x179f00?'':this['_stripMarkdownSyntax'](_0x3d77ac);const _0x3e5a53=this['_domParser']['parseFromString'](_0x3d77ac,'text/html');if(_0x525598){const _0x198895=Array['from'](_0x3e5a53['body']['childNodes']);_0x198895['reverse']();for(const _0x338abd of _0x198895){if(_0x338abd['nodeType']==Node['ELEMENT_NODE'])break;_0x338abd['remove']();}}const _0x124d1d=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x3e5a53['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x124d1d);const _0x3dd378=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x5b4128=this['editor']['data']['toModel'](_0x124d1d);return _0x3dd378||_0x5b4128['markers']['clear'](),this['editor']['data']['stringify'](_0x5b4128);}['_normalizeResponseHeadings'](_0xe6f4ad){const _0x414b2d=new _0x550b21(this['editor']['editing']['view']['document']),_0x3cca38=new _0x4b14ca({'name':/^h[1-5]$/}),_0x14d827=[];let _0x3fde8f=!0x1;for(const _0xdb1607 of _0xe6f4ad)_0xdb1607['is']('element')&&_0x3cca38['match'](_0xdb1607)&&(_0x14d827['push'](_0xdb1607),'h1'==_0xdb1607['name']&&(_0x3fde8f=!0x0));if(_0x3fde8f){for(const _0x53e9ce of _0x14d827)_0x414b2d['rename']('h'+(parseInt(_0x53e9ce['name'][0x1])+0x1),_0x53e9ce);}}['_isH1TagSupportEnabled'](){const {data:_0xb2bf97,editing:_0x3f6fbc}=this['editor'],_0x270a01=_0xb2bf97['htmlProcessor']['toView']('<h1></h1>'),_0x1a1a19=_0xb2bf97['toView'](_0xb2bf97['toModel'](_0x270a01));return!!_0x3f6fbc['view']['domConverter']['viewToDom'](_0x1a1a19)['querySelector']('h1');}['_sanitizeHTML'](_0x16bedf){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x16bedf),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x588dd6){const _0x10ddb9=_0x588dd6['trim']();return _0x10ddb9['startsWith']('```html')?_0x10ddb9['endsWith']('```')?_0x10ddb9['substring'](0x7,_0x10ddb9['length']-0x3):_0x10ddb9['substring'](0x7):_0x588dd6;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x6e0b0f){super(_0x6e0b0f),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x22d6aa=>i(_0x6e0b0f,'AI_'+_0x22d6aa['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x6e0b0f,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x6e0b0f,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x6e0b0f,'Stop'));const _0x57c4e2=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x57c4e2['if']('isVisible','ck-hidden',_0x1a4331=>!_0x1a4331)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3c204d,_0x29b962){const _0x59dbda=new _0x1d3846(this['locale']);return _0x59dbda['set']({'label':_0x3c204d,'class':_0x29b962||'','isVisible':!0x0,'withText':!0x0}),_0x59dbda;}}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 _0x438a2c{['contentFieldView'];['copyButtonView'];constructor(_0x3b1a0a,_0x3376f6=''){super(_0x3b1a0a),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1c490d=this['bindTemplate'];this['contentFieldView']=new mt(_0x3b1a0a,_0x3376f6),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1c490d['if']('isVisible','ck-hidden',_0x379ef4=>!_0x379ef4)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1c490d['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 _0x4405ac=!0x1;this['on']('change:value',(_0x1c5272,_0x3e0436,_0x49b51c)=>{const _0x318b06=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x49b51c),this['isProcessing']&&_0x318b06&&!_0x4405ac&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0xcbb6ce,_0x5a2e33,_0x44c873)=>{_0x4405ac=!0x1,_0x44c873?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4405ac=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4405ac=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0xae20d6=this['locale'],_0x8b502a=new _0x1d3846(this['locale']),_0x5f3f44='ck-ai-form__copy-button';return _0x8b502a['set']({'label':i(_0xae20d6,'Copy'),'icon':W,'class':_0x5f3f44,'tooltip':!0x0}),_0x8b502a['bind']('isVisible')['to'](this,'value',_0x2a9a13=>!!_0x2a9a13),_0x8b502a['bind']('isEnabled')['to'](this,'isProcessing',_0x212014=>!_0x212014),_0x8b502a['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x8b502a['icon']=_0x50bcb8['check'],_0x8b502a['class']=_0x5f3f44+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x8b502a['icon']=W,_0x8b502a['class']=_0x5f3f44;},0x3e8);}),_0x8b502a;}['_copyHTMLToClipboard'](_0x414d9a){const {window:_0x5c7e69,document:_0x18a32c}=_0x4334cb;if(_0x5c7e69['ClipboardItem']){const {Blob:_0x11113e,ClipboardItem:_0x17870f}=_0x5c7e69,_0x2de7e7=[new _0x17870f({'text/html':new _0x11113e([_0x414d9a['innerHTML']],{'type':'text/html'}),'text/plain':new _0x11113e([_0x414d9a['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2de7e7);}else{const _0x12f9da=_0x18a32c['createElement']('div');_0x12f9da['style']['position']='absolute',_0x12f9da['style']['left']='-9999px',_0x12f9da['innerHTML']='<span>[</span>'+_0x414d9a['innerHTML']+'<span>]</span>',_0x18a32c['body']['appendChild'](_0x12f9da);const _0x342e9e=_0x18a32c['createRange']();_0x342e9e['setStartAfter'](_0x12f9da['firstElementChild']),_0x342e9e['setEndBefore'](_0x12f9da['lastElementChild']);const _0x21d008=_0x5c7e69['getSelection']();_0x21d008['removeAllRanges'](),_0x21d008['addRange'](_0x342e9e),_0x18a32c['execCommand']('copy'),_0x12f9da['remove']();}}}class mt extends _0x438a2c{constructor(_0x2041b1,_0x152ba4=''){super(_0x2041b1),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x152ba4,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x57ba7d){this['element']['innerHTML']=_0x57ba7d;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4894d5=new _0x438a2c(),_0x4883cd=this['locale'],_0x4fb298=new _0x5549b0();return _0x4fb298['isVisible']=!0x0,_0x4894d5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x4fb298,{'text':i(_0x4883cd,'AI\x20is\x20writing...')}]}),_0x4894d5['render'](),_0x4894d5;}}class rt extends _0x438a2c{constructor(_0x187ab5,_0x50faf8=''){super(_0x187ab5);const _0x2d9031=new _0x3d0dc4(),_0x50bd3f=this['bindTemplate'];this['set']('text',_0x50faf8),_0x2d9031['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':[_0x2d9031,{'text':_0x50bd3f['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4bdc78,_0x1d8807){super(_0x4bdc78,_0x1d8807),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',(_0x48bb66,_0x175cff)=>{_0x48bb66['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x175cff());});}['_createSubmitButton'](){const _0x436667=new _0x1d3846(this['locale']),_0x112043=this['locale'];return _0x436667['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(_0x112043,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x436667['on']('execute',()=>{this['submit']();}),_0x436667['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x5b346a,_0x4dec37)=>!_0x5b346a&&_0x4dec37),_0x436667;}['_createShowHistoryButton'](){const _0x4596bf=new _0x1d3846(this['locale']),_0x4d8a1f=this['resultsView'],_0x513f71=this['locale'];_0x4596bf['set']({'label':i(_0x513f71,'History'),'withText':!0x1,'icon':_0x50bcb8['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4596bf['bind']('isOn')['to'](_0x4d8a1f,'isVisible'),_0x4596bf['bind']('isEnabled')['to'](this,'isEnabled'),_0x4596bf['on']('execute',()=>{_0x4d8a1f['isVisible']=!_0x4d8a1f['isVisible'],_0x4d8a1f['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1ecd82=()=>{_0x4334cb['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0xd2d621=new st(this['queryView']['fieldView']['element']),_0xe16426=_0xd2d621['width'],_0x10568c='rtl'===_0x513f71['uiLanguageDirection']?'left':'right';_0xd2d621['excludeScrollbarsAndBorders'](),_0x4596bf['element']['style'][_0x10568c]=_0xe16426-_0xd2d621['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1ecd82),this['on']('render',_0x1ecd82),_0x4596bf;}['submit'](){const _0x2f3fe3=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x2f3fe3);}['focus'](_0x180a82){-0x1===_0x180a82?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0xa6e5c8){super(_0xa6e5c8),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0xa6e5c8,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2b0400=0x0;for(const _0x5a86cf of this['items'])_0x2b0400+=_0x5a86cf['items']['length'];return{'resultsCount':_0x2b0400,'totalItemsCount':_0x2b0400};}['_createClearHistoryButton'](){const _0x56e8c4=this['locale'],_0x22d1b9=new _0x1d3846(this['locale']);return _0x22d1b9['set']({'label':'('+i(_0x56e8c4,'Clear')+')','withText':!0x0}),_0x22d1b9['on']('execute',()=>this['fire']('clearHistory')),_0x22d1b9;}}class hs extends _0x2c6b63{constructor(_0x1a0db1){super();const _0x1b5584=new te(),_0x15cf84=new _0x1d3846(this['locale'],_0x1b5584);this['children']['add'](_0x15cf84),_0x15cf84['set']({'label':_0x1a0db1['prompt'],'withText':!0x0}),_0x15cf84['on']('execute',()=>{this['fire']('execute',{'value':_0x518ce3(_0x1a0db1['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0xcae739{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3b05fd,_0x27dd37)=>{const _0xc7b00f=Ss(_0x27dd37['prompt']);for(const _0x30ddd1 of this)if(_0x30ddd1!=_0x27dd37&&Ss(_0x30ddd1['prompt'])===_0xc7b00f){this['remove'](_0x30ddd1);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x42f7b0=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x42f7b0));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x4bc175=>_0x4bc175)));}}function Ss(_0x4431b3){return _0x4431b3['toLowerCase']()['trim']();}class k extends _0x438a2c{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x441692,_0x35ce18,_0x49dd08=''){super(_0x441692),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(_0x441692),this['contentArea']=new X(_0x441692,_0x49dd08),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 _0x5a9f9d(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x1f443f({'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 _0x11e599=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x35ce18],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x11e599['if']('isError','ck-hidden',_0x30c495=>!_0x30c495)]},'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'](_0x438835=0x1){-0x1===_0x438835?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 _0x576032=this['locale'],_0x53b79d=new ht(_0x576032,{'queryView':{'label':i(_0x576032,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x485039,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x576032,'Empty\x20history'),'secondary':i(_0x576032,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x53b79d['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xce42fb,_0x1c4e05)=>_0xce42fb&&!_0x1c4e05),this['listenTo'](_0x53b79d,'submit',(_0x580cab,_0x42b8c4)=>{this['prompt']=_0x42b8c4;const _0x402967=_0x450af6(_0x42b8c4);this['fire']('submitPrompt',_0x402967),_0x42b8c4['trim']()&&this['_promptHistory']['add']({'prompt':_0x402967},0x0);},{'priority':'high'}),_0x53b79d;}['_createHistoryView'](){const _0x566021=new rs(this['locale']);return _0x566021['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x566021['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x566021;}['_createToolbar'](){const _0x520b36=new at(this['locale']);return _0x520b36['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x47c533,_0x444d7c,_0x4335f3)=>_0x47c533&&!_0x444d7c&&!!_0x4335f3),_0x520b36['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x520b36['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x869af,_0x2865d8,_0x193173)=>_0x869af&&!_0x2865d8&&!!_0x193173),_0x520b36['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x520b36['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x26a6da,_0x367d03)=>_0x26a6da&&!_0x367d03),_0x520b36['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x520b36['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x520b36['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x520b36;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x30eb4d=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x30eb4d,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2f9a4d){const _0xbaf9d8=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2f9a4d||i(_0xbaf9d8,'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 _0x5c3869{['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[_0x4bec40,a,K,_0x352785];}constructor(_0x3b4a38){super(_0x3b4a38),_0x3b4a38['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3b4a38['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x3b4a38['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3b4a38['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3bff89}=this;this['_aiAdapter']=_0x3bff89['plugins']['get'](K),this['_dialog']=_0x3bff89['plugins']['get'](_0x352785),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x4cca64=new E(_0x3bff89,Array['from'](this['_commandDefinitions']['values']()));_0x3bff89['commands']['add']('showAIAssistant',_0x4cca64),_0x3bff89['ui']['componentFactory']['add']('aiCommands',_0x456a8a=>{const _0x12ecd0=_0x3128ee(_0x456a8a);return _0x12ecd0['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x12ecd0['buttonView']['set']({'label':i(_0x456a8a,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x12ecd0['on']('execute',_0x35cc59=>this['_onExecute'](_0x35cc59['source']['id'])),_0x3e5861(_0x12ecd0,_0x3bff89['ui']['view']['body'],function(_0xdd3491){const _0x3125d5=o(_0xdd3491['config']['get']('ai.aiAssistant.commands'),_0xdd3491['locale']),_0x4d4eea=U(_0xdd3491,_0x3125d5)['filter'](_0x116686=>_0x116686['commands']['length']);if(0x1===_0x4d4eea['length'])return U(_0xdd3491,_0x4d4eea[0x0]['commands'])['map'](_0x1fab4e=>({'id':_0x1fab4e['id'],'label':_0x1fab4e['label']}));return _0x4d4eea['map'](_0x3c54c7=>{const {groupId:_0x2ca971,groupLabel:_0x5a33cd,commands:_0x4fd987}=_0x3c54c7,_0x77035a=U(_0xdd3491,_0x4fd987)['map'](_0x48ea88=>({'id':_0x48ea88['id'],'label':_0x48ea88['label']}));return{'id':_0x2ca971,'menu':_0x5a33cd||_0x2ca971,'children':_0x77035a};});}(_0x3bff89),{'ariaLabel':i(_0x456a8a,'AI\x20Commands')}),_0x12ecd0['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x4cca64['on']('change:enabledCommandsIds',_0x49f41a),_0x12ecd0['menuView']['once']('render',_0x49f41a),_0x12ecd0;function _0x49f41a(){_0x12ecd0['isEnabled']=_0x4cca64['enabledCommandsIds']['length']>0x0;for(const _0x5055fd of _0x12ecd0['menuView']['buttons'])_0x5055fd['isEnabled']=_0x4cca64['enabledCommandsIds']['includes'](_0x5055fd['id']);}}),_0x3bff89['ui']['componentFactory']['add']('menuBar:aiCommands',_0x567def=>{const _0x45fcf9=new _0x3a2c13(_0x567def);_0x45fcf9['buttonView']['set']({'label':i(_0x567def,'AI\x20Commands'),'icon':T}),_0x45fcf9['bind']('isEnabled')['to'](_0x4cca64,'enabledCommandsIds',_0x24dcf0=>_0x24dcf0['length']>0x0);const _0x33f69a=o(_0x3bff89['config']['get']('ai.aiAssistant.commands'),_0x567def);return this['_populateMenuBarMenu'](_0x4cca64,_0x45fcf9,_0x33f69a,_0x91cd12=>this['_onExecute'](_0x91cd12)),_0x45fcf9;}),_0x3bff89['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x7aa7ab=this['_createAIAssistantUIButton'](_0x1d3846);return _0x7aa7ab['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x7aa7ab;}),_0x3bff89['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x41e71a=this['_createAIAssistantUIButton'](_0xb92597);return _0x41e71a['set']({'role':'menuitemcheckbox'}),_0x41e71a;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x7f6bf0=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2b0b7e;for(const _0x373f59 in _0x7f6bf0){const _0x39f48a=_0x373f59,_0x4c5796=_0x7f6bf0[_0x39f48a];if('aiLicenseKeyValid'==_0x4c5796||'aiLicenseKeyInvalid'==_0x4c5796||'aiLicenseKeyExpired'==_0x4c5796||'aiLicenseKeyDomainLimit'==_0x4c5796||'aiLicenseKeyNotAllowed'==_0x4c5796||'aiLicenseKeyEvaluationLimit'==_0x4c5796||'aiLicenseKeyTrialLimit'==_0x4c5796||'aiLicenseKeyUsageLimit'==_0x4c5796){delete _0x7f6bf0[_0x39f48a],_0x2b0b7e=_0x4c5796,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2b0b7e&&_0x7f6bf0['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2b0b7e&&_0x7f6bf0['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2b0b7e&&_0x7f6bf0['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2b0b7e&&_0x7f6bf0['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2b0b7e&&_0x7f6bf0['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x2b0b7e&&_0x7f6bf0['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x2b0b7e&&_0x7f6bf0['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x57829c='',_0x10436d='',_0x3e23ae='custom'){const _0x299c32=this['editor'],_0x5efaf1=_0x299c32['editing']['view'],_0x5e178c=_0x299c32['plugins']['get'](a),_0x24bc31=_0x299c32['plugins']['get'](_0x4bec40);_0x5e178c['showFakeVisualSelection']();const _0x5b3f11=new w(),_0x41e0d0=new ClipboardEvent('copy',{'clipboardData':_0x5b3f11}),_0x1e5418=new _0xba96fd(_0x5b3f11),_0xa488d6=new _0x3a4bcc(_0x5efaf1,_0x41e0d0,{'dataTransfer':_0x1e5418});_0x24bc31['_forceMarkersCopy']('comment',()=>{_0x5efaf1['document']['fire']('copy',_0xa488d6);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x299c32,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x287ab0=_0x1e5418['getData']('text/html');const _0x4e3b69=_0x299c32['model']['document']['selection'],_0x3d72aa=Array['from'](_0x4e3b69['getRanges']());0x1===_0x3d72aa['length']&&_0x3d72aa[0x0]['isFlat']&&!_0x4e3b69['getSelectedElement']()&&''!==_0x287ab0['replace'](/ /g,'')['trim']()&&(_0x287ab0='<p>'+_0x287ab0+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x3e23ae,'query':_0x57829c,'htmlContent':_0x287ab0,'label':_0x10436d,'mainActionLabel':M[_0x299c32['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':_0x5af3cd['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5e178c['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0xb3b9e6=new Map(),_0xd1c009=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x249106 of _0xd1c009)for(const _0x475619 of _0x249106['commands'])_0xb3b9e6['set'](_0x475619['id'],{..._0x475619,'groupId':_0x249106['groupId'],'groupLabel':_0x249106['groupLabel']||_0x249106['groupId']});return _0xb3b9e6;}['_createAIAssistantUIButton'](_0x4ba571){const _0x43557a=this['editor'],_0x386245=_0x43557a['commands']['get']('showAIAssistant'),_0x43e15c=new _0x4ba571(_0x43557a['locale']);return _0x43e15c['set']({'label':i(_0x43557a['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x43e15c['bind']('isEnabled')['to'](_0x386245),_0x43e15c['bind']('isOn')['to'](this['_dialog'],'id',_0x4c4b3a=>'aiAssistant'===_0x4c4b3a),this['listenTo'](_0x43e15c,'execute',()=>{_0x43e15c['isOn']?this['hideUI']():_0x386245['execute']();}),_0x43e15c;}['_initView'](){const _0x6da367=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',()=>{_0x6da367['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x6da367['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2595b2,ui:{ariaLiveAnnouncer:_0x239879}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x21e93e,_0x46b29b,_0x164760)=>{const _0x1aeb24=this['_aiAssistantController']['currentContext'];_0x164760?_0x239879['announce'](i(_0x2595b2,'AI\x20is\x20writing')):_0x1aeb24&&_0x239879['announce'](i(_0x2595b2,'Generated\x20content:\x20%0',_0x1aeb24),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x57f4fc,_0x5429a7,_0x21c979)=>{if(_0x21c979){const _0x46da83=this['_formView']['errorView']['text'];_0x239879['announce'](i(_0x2595b2,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x46da83));}});}['_onExecute'](_0x163d64){const _0x5abe81=this['_commandDefinitions']['get'](_0x163d64),_0x5a8595=this['editor'],_0x175f26=_0x5a8595['model']['document']['selection'],_0x12d130=_0x5a8595['commands']['get']('showAIAssistant'),_0x421d86=_0x5a8595['plugins']['get'](a),_0x2942bc=''+(_0x5abe81['groupId']!==x?_0x5abe81['groupLabel']+':\x20':'')+_0x5abe81['label'];if(!0x1!==_0x5abe81['requiresContent']&&_0x175f26['isCollapsed']){const _0x350abc=_0x1a913c(_0x175f26['getSelectedBlocks']())||_0x5a8595['model']['schema']['getLimitElement'](_0x175f26);_0x5a8595['model']['change'](_0x266f05=>{_0x266f05['setSelection'](_0x350abc,'in');});}_0x421d86['showFakeVisualSelection'](),_0x12d130['execute'](_0x5abe81['prompt'],_0x2942bc,'command:'+_0x163d64);}['_populateMenuBarMenu'](_0x2a003e,_0x1a25a9,_0x317b3f,_0x5d3b9f){const _0x4b753c=this['editor'],_0x1deef7=_0x4b753c['locale'],_0x2ff7bc=new _0x4c7c75(_0x1deef7),_0x8e1674=U(_0x4b753c,_0x317b3f)['filter'](_0x471f60=>_0x471f60['commands']['length']);0x1===_0x8e1674['length']?this['_getMenuBarGroupButtons']({'command':_0x2a003e,'commands':_0x8e1674[0x0]['commands'],'parentMenuView':_0x1a25a9,'onExecute':_0x5d3b9f})['forEach'](_0x40b813=>_0x2ff7bc['items']['add'](_0x40b813)):_0x8e1674['forEach'](({groupId:_0x72e7e2,groupLabel:_0x2d17bc,commands:_0x4ea4ac})=>{const _0x2cb987=new _0x5b6d2c(_0x1deef7,_0x1a25a9),_0x30db9a=new _0x3a2c13(_0x1deef7),_0x5e3cc4=new _0x4c7c75(_0x1deef7),_0x5776fa=this['_getMenuBarGroupButtons']({'command':_0x2a003e,'commands':_0x4ea4ac,'parentMenuView':_0x30db9a,'onExecute':_0x5d3b9f});_0x30db9a['buttonView']['set']({'label':_0x2d17bc||_0x72e7e2}),_0x30db9a['delegate']('execute')['to'](_0x1a25a9),_0x5e3cc4['items']['addMany'](_0x5776fa),_0x30db9a['panelView']['children']['add'](_0x5e3cc4),_0x2cb987['children']['add'](_0x30db9a),_0x2ff7bc['items']['add'](_0x2cb987);}),_0x1a25a9['panelView']['children']['add'](_0x2ff7bc);}['_getMenuBarGroupButtons']({command:_0x2d01ae,commands:_0x4db0a0,parentMenuView:_0x15a707,onExecute:_0x7d0a89}){const _0x371524=this['editor'],_0x4fa7fe=_0x371524['locale'];return U(_0x371524,_0x4db0a0)['map'](_0x58db44=>{const _0x5ca2fe=new _0x5b6d2c(_0x4fa7fe,_0x15a707),_0x4fda70=new _0xb92597(_0x4fa7fe);return _0x4fda70['set']({'label':_0x58db44['label']}),_0x4fda70['delegate']('execute')['to'](_0x15a707),_0x4fda70['on']('execute',()=>_0x7d0a89(_0x58db44['id'])),_0x4fda70['bind']('isEnabled')['to'](_0x2d01ae,'enabledCommandsIds',_0x4de191=>_0x4de191['includes'](_0x58db44['id'])),_0x5ca2fe['children']['add'](_0x4fda70),_0x5ca2fe;});}}function B(_0x2d76f9,_0x59653b){return void 0x0!==_0x2d76f9['order']&&void 0x0===_0x59653b['order']?0x1:void 0x0===_0x2d76f9['order']&&void 0x0!==_0x59653b['order']?-0x1:void 0x0!==_0x2d76f9['order']&&void 0x0!==_0x59653b['order']?_0x2d76f9['order']-_0x59653b['order']:0x0;}function U(_0x37da12,_0x3e76b6){_0x3e76b6['sort'](B);const _0x353ce7={},_0x6957a7=[];for(const _0x17c096 of _0x3e76b6)if(void 0x0!==_0x17c096['order']){if(_0x17c096['order']in _0x353ce7)throw new _0x50c17c('ai-commands-config-order-collision',_0x37da12,{'conflictingDefinitions':[_0x17c096,_0x353ce7[_0x17c096['order']]]});_0x353ce7[_0x17c096['order']]=_0x17c096,_0x6957a7['splice'](_0x17c096['order'],0x0,_0x17c096);}else _0x6957a7['push'](_0x17c096);return _0x6957a7;}class r extends _0x5c3869{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x56f8a5){super(_0x56f8a5);const _0x5de1b4=_0x56f8a5['config'],_0xa638a=_0x56f8a5['locale'];_0x5de1b4['define']('ai.aiAssistant.preserveComments',!0x0),_0x5de1b4['define']('ai.aiAssistant.commands',function(_0x4a57a1){return[{'groupId':'editOrReview','groupLabel':i(_0x4a57a1,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x4a57a1,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x4a57a1,'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(_0x4a57a1,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x4a57a1,'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(_0x4a57a1,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x4a57a1,'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(_0x4a57a1,'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(_0x4a57a1,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x4a57a1,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x4a57a1,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x4a57a1,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x4a57a1,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x4a57a1,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x4a57a1,'Change\x20style'),'commands':[{'id':'business','label':i(_0x4a57a1,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x4a57a1,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x4a57a1,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x4a57a1,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x4a57a1,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x4a57a1,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x4a57a1,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x4a57a1,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x4a57a1,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x4a57a1,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x4a57a1,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x4a57a1,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x4a57a1,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0xa638a)),_0x5de1b4['define']('ai.aiAssistant.extraCommandGroups',[]),_0x5de1b4['define']('ai.aiAssistant.removeCommands',[]);let _0x343072=o(_0x5de1b4['get']('ai.aiAssistant.commands'),_0xa638a);const _0x7f48e7=_0x5de1b4['get']('ai.aiAssistant.extraCommandGroups'),_0x11f6ea=_0x5de1b4['get']('ai.aiAssistant.removeCommands');_0x7f48e7['forEach'](_0x33909f=>{const _0x43b478=_0x343072['find'](_0xe25175=>_0xe25175['groupId']===_0x33909f['groupId']);_0x43b478?_0x43b478['commands']=_0x43b478['commands']['concat'](_0x33909f['commands']):_0x343072['push'](_0x33909f);}),_0x343072=_0x343072['filter'](_0x290b51=>!_0x11f6ea['includes'](_0x290b51['groupId'])),_0x343072['forEach'](_0x47fc60=>{_0x47fc60['commands']=_0x47fc60['commands']['filter'](_0x4df156=>!_0x11f6ea['includes'](_0x4df156['id']));}),_0x5de1b4['set']('ai.aiAssistant.commands',_0x343072);}}class P extends _0x5c3869{['abortController'];static get['requires'](){return[K];}constructor(_0x5679e5){super(_0x5679e5),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'](_0x3e0c53){return this['sendRequest'](_0x3e0c53)['catch'](_0xfbfab1=>{if(_0xfbfab1 instanceof R)return Promise['reject'](_0xfbfab1);if('AbortError'==_0xfbfab1['name'])return Promise['resolve']();throw console['error'](_0xfbfab1),new _0x50c17c('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x29299d,_0x159ccb){const _0x13c1c3=this['editor']['locale'],_0x372ad8={'Content-Type':'application/json'};if('object'==typeof _0x29299d)Object['assign'](_0x372ad8,_0x29299d);else{if(_0x29299d)try{const _0x4bcfde=await _0x29299d(_0x159ccb);Object['assign'](_0x372ad8,_0x4bcfde);}catch(_0x49faf8){return Promise['reject'](new R(i(_0x13c1c3,'AI_ERROR_GET_HEADERS')));}}return _0x372ad8;}async['_prepareRequestParameters'](_0x3becdc,_0x1807c5){const _0x35c010=this['editor']['locale'];if('object'==typeof _0x3becdc)return _0x3becdc;try{return await _0x3becdc(_0x1807c5);}catch(_0x4eecae){return Promise['reject'](new R(i(_0x35c010,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x1cc05c){super(_0x1cc05c),_0x1cc05c['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x1cc05c['config']['get']('ai.openAI.requestParameters')||_0x1cc05c['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x1cc05c['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x1cc05c['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x1cc05c['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x89e400,context:_0x22a144,onData:_0x45dc30,actionId:_0x86f3b1}){const _0x105a7d=this['editor']['locale'],_0x3ebdbb=await this['prepareMessages'](_0x89e400,_0x22a144,_0x86f3b1),_0x2da193=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x86f3b1),_0x239fab=await this['_prepareRequestParameters'](this['_requestParameters'],_0x86f3b1),_0x2e0673={'messages':_0x3ebdbb,..._0x239fab},_0x8d367c={'method':'POST','headers':_0x2da193,'body':JSON['stringify'](_0x2e0673),'signal':this['abortController']['signal']},_0x4dbbe1=await fetch(this['_apiUrl'],_0x8d367c);if(_0x4dbbe1['ok'])return _0x239fab['stream']?await this['_readStreamableResponse'](_0x4dbbe1,_0x45dc30):await this['_readStaticResponse'](_0x4dbbe1,_0x45dc30),Promise['resolve']();{const _0xa1608f=await _0x4dbbe1['text']();return _0xa1608f['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x105a7d,'AI_ERROR_CONTEXT_LENGTH'))):_0xa1608f['includes']('Moderation')?Promise['reject'](new R(i(_0x105a7d,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0xa1608f));}}async['prepareMessages'](_0x2bedd8,_0x7a1487,_0xa6beb7){let _0x3c8882,_0x255dfd;return _0x7a1487?(_0x3c8882='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.',_0x255dfd='Instruction:\x0a'+_0x2bedd8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x7a1487):(_0x3c8882='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.',_0x255dfd=_0x2bedd8),[{'role':'system','content':_0x3c8882},{'role':'user','content':_0x255dfd}];}async['_readStreamableResponse'](_0x47b6e6,_0x57c91a){const _0x259572=_0x47b6e6['body']['getReader'](),_0x21cdf7=new TextDecoder();let _0x409943='',_0x53891f='',_0x55d8d4='',_0x3798b2=!0x1;for(;!_0x3798b2;){const {done:_0x3285d3,value:_0x47d2e9}=await _0x259572['read'](),_0x39c777=_0x409943+_0x21cdf7['decode'](_0x47d2e9);let _0x32dd96='';_0x3798b2=_0x3285d3;try{_0x32dd96=this['_cleanUpData'](_0x39c777),_0x409943='';}catch(_0x1d3b57){_0x409943=_0x39c777;continue;}_0x53891f+=_0x32dd96,!_0x3798b2&&this['_isBufferIncomplete'](_0x53891f)||_0x53891f&&(_0x55d8d4+=_0x53891f,_0x53891f='',_0x57c91a(_0x55d8d4));}return Promise['resolve']();}async['_readStaticResponse'](_0x17fff7,_0x9b193b){return _0x9b193b((await _0x17fff7['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x316955){const _0x6cf0d9=_0x316955['split']('<')['length']!==_0x316955['split']('>')['length'],_0x29f2fd=_0x316955['length']<0x1e;return _0x6cf0d9&&_0x29f2fd;}['_cleanUpData'](_0x2e9c9b){return _0x2e9c9b['split'](/\n(?![^{]*\})/g)['map'](_0x4c6d0c=>_0x4c6d0c['replace']('data:\x20',''))['filter'](_0x16014b=>_0x16014b&&_0x16014b['length']>0x0&&'[DONE]'!==_0x16014b)['map'](_0x38f511=>{const {choices:_0x2e3cec}=JSON['parse'](_0x38f511);if(_0x2e3cec[0x0]&&_0x2e3cec[0x0]['delta']&&_0x2e3cec[0x0]['delta']['content'])return _0x2e3cec[0x0]['delta']['content'];})['filter'](_0x14e632=>_0x14e632)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x889b00){super(_0x889b00),_0x889b00['config']['get']('ai.aws.requestParameters')||_0x889b00['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']=_0x889b00['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x889b00['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x889b00['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x889b00['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x39c1ef,context:_0x34fea9,onData:_0x3af186,actionId:_0x112e89}){const {model:_0x1e8aeb,stream:_0x5eee9f,..._0x3405ee}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x112e89),_0x27c0cd={'prompt':await this['preparePrompt'](_0x39c1ef,_0x34fea9,_0x1e8aeb,_0x112e89),..._0x3405ee};this['_apiUrl']?await this['_processProxyRequest'](_0x27c0cd,_0x1e8aeb,_0x5eee9f,_0x3af186,_0x112e89):await this['_processAWSRequest'](_0x27c0cd,_0x1e8aeb,_0x5eee9f,_0x3af186);}async['preparePrompt'](_0x572b18,_0x576a47,_0x1a9576,_0xce4f9e){let _0x4c44ca,_0xab2ebb;return _0x576a47?(_0x4c44ca='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.',_0xab2ebb='Instruction:\x0a'+_0x572b18+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x576a47):(_0x4c44ca='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.',_0xab2ebb=_0x572b18),'meta.llama'==this['getModelFamily'](_0x1a9576)?'<<SYS>>\x0a'+_0x4c44ca+'\x0a<</SYS>>\x0a[INST]\x0a'+_0xab2ebb+'\x0a[/INST]':'Human:\x0a'+_0x4c44ca+'\x0a'+_0xab2ebb+'\x0a\x0aAssistant:';}['getModelFamily'](_0x2a2727){if(/^anthropic\.claude/['test'](_0x2a2727))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x2a2727))return'ai21.j2';if(/^cohere\.command/['test'](_0x2a2727))return'cohere.command';if(/^meta\.llama/['test'](_0x2a2727))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x2a2727));}async['_processProxyRequest'](_0x140b79,_0x5dd80e,_0x2198c0,_0x199d56,_0x571302){const _0x49723c={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x571302),'body':JSON['stringify']({..._0x140b79,'model':_0x5dd80e,'stream':_0x2198c0}),'signal':this['abortController']['signal']},_0x2c7e1d=await fetch(this['_apiUrl'],_0x49723c);_0x2198c0?await this['_readStreamableResponse'](_0x2c7e1d,_0x5dd80e,_0x199d56):await this['_readStaticResponse'](_0x2c7e1d,_0x5dd80e,_0x199d56);}async['_processAWSRequest'](_0x1f6cf1,_0x4098e2,_0x50feac,_0x3fc837){const _0x118f99=new _0x14c587(this['_bedrockClientConfig']),_0x5f41a7={'body':JSON['stringify'](_0x1f6cf1),'contentType':'application/json','accept':'application/json','modelId':_0x4098e2};let _0x589ecb;if(_0x50feac){const _0x32de96=new _0x5dc4c8(_0x5f41a7);_0x589ecb=await _0x118f99['send'](_0x32de96,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x589ecb,_0x4098e2,_0x3fc837);}else{const _0x78cce8=new _0x53f45b(_0x5f41a7);_0x589ecb=await _0x118f99['send'](_0x78cce8,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x589ecb,_0x4098e2,_0x3fc837);}}async['_readAsyncIterableResponse'](_0x5c58ce,_0x598d00,_0x4a6818){const _0x1790f6=_0x5c58ce['body'],_0x59ebb7=new TextDecoder('utf-8');let _0x35c16f='';for await(const _0x13a258 of _0x1790f6)if(_0x13a258['chunk']){const _0x1838e5=_0x59ebb7['decode'](_0x13a258['chunk']['bytes']),_0xdaa4ee=JSON['parse'](_0x1838e5);_0x35c16f+=this['_getGeneratedText'](_0xdaa4ee,_0x598d00),_0x4a6818(_0x35c16f);}return Promise['resolve']();}async['_readStreamableResponse'](_0x3fe1c0,_0x2975bf,_0x6a0b7a){const _0x24dad9=_0x3fe1c0['body'],_0x3f3d67=new TextDecoder('utf-8'),_0x3b3adf=_0x24dad9['getReader']();let _0x267e78='',_0x45f147='',_0x10efbb=!0x1;for(;!_0x10efbb;){const {done:_0x5e0084,value:_0x1ff00a}=await _0x3b3adf['read']();if(_0x10efbb=_0x5e0084,_0x10efbb)break;const _0x3fdee4=(_0x267e78+_0x3f3d67['decode'](_0x1ff00a))['split']('\x0a')['map'](_0xbdc2e7=>{try{return _0x267e78='',JSON['parse'](_0xbdc2e7);}catch(_0x162aa9){return _0x267e78=_0xbdc2e7,null;}})['filter'](_0x3074d1=>null!==_0x3074d1);_0x3fdee4['length']&&(_0x45f147+=_0x3fdee4['map'](_0x10cce8=>this['_getGeneratedText'](_0x10cce8,_0x2975bf))['join'](''),_0x6a0b7a(_0x45f147));}return Promise['resolve']();}async['_readStaticResponse'](_0x2f72b9,_0x47ec59,_0x34ec3d){let _0x31abe8;return _0x31abe8=_0x2f72b9 instanceof Response?await _0x2f72b9['json']():JSON['parse'](Buffer['from'](_0x2f72b9['body'])['toString']('utf8')),(_0x34ec3d(this['_getGeneratedText'](_0x31abe8,_0x47ec59)),Promise['resolve']());}['_getGeneratedText'](_0x73b55c,_0x457057){switch(this['getModelFamily'](_0x457057)){case'anthropic.claude':return _0x73b55c['completion'];case'ai21.j2':return _0x73b55c['completions'][0x0]['data']['text'];case'cohere.command':return _0x73b55c['generations'][0x0]['text'];case'meta.llama':return _0x73b55c['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':_0x3ba2af=>0x1!=_0x3ba2af}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x5d81d6=>{const {af:{dictionary:_0xc43bbd,getPluralForm:_0x146619}}={'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':_0x5db0d7=>0x1!=_0x5db0d7}};_0x5d81d6['af']||={'dictionary':{},'getPluralForm':null},_0x5d81d6['af']['dictionary']=Object['assign'](_0x5d81d6['af']['dictionary'],_0xc43bbd),_0x5d81d6['af']['getPluralForm']=_0x146619;})(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':_0x488a5b=>0x0==_0x488a5b?0x0:0x1==_0x488a5b?0x1:0x2==_0x488a5b?0x2:_0x488a5b%0x64>=0x3&&_0x488a5b%0x64<=0xa?0x3:_0x488a5b%0x64>=0xb?0x4:0x5}};
|