@ckeditor/ckeditor5-ai 44.2.0-alpha.3 → 44.2.0-alpha.5
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 _0x454c11,Command as _0x268214,icons as _0x502dc9}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x41dbe0,CKEditorError as _0x153b71,ObservableMixin as _0xae9dc4,global as _0xf6b9b9,isVisible as it,Rect as st,Collection as _0x579d51,FocusTracker as _0x51a8ad,KeystrokeHandler as ts,first as _0x21543c}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x2c4d9e,View as _0x23806c,SpinnerView as _0x2ae8f4,IconView as _0x1e8aef,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x139bfb,ButtonLabelView as te,FocusCycler as _0x3c0f58,createLabeledTextarea as _0x3c94e8,Dialog as _0x2c7d3f,createDropdown as _0x1193ed,addMenuToDropdown as _0x2051f6,MenuBarMenuView as _0x1e65bd,MenuBarMenuListItemButtonView as _0x31bbe5,DialogViewPosition as _0x584113,MenuBarMenuListView as _0x282be8,MenuBarMenuListItemView as _0x4c364a}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x47b320,ClipboardMarkersUtils as _0x2bcedf}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x9388cf,DataTransfer as _0x2981e5,UpcastWriter as _0x207491,Matcher as _0xbf8ba0}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x20307c,escape as _0x29393c}from'lodash-es';import{BedrockRuntimeClient as _0x56414c,InvokeModelWithResponseStreamCommand as _0x5194b5,InvokeModelCommand as _0x5e7f9a}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x32bd52,_0x27ebcb){const _0x382eb7=(0x0,_0x27ebcb['t'])('Other');return _0x32bd52['length']?'groupId'in _0x32bd52[0x0]?_0x32bd52:[{'groupId':x,'groupLabel':_0x382eb7,'order':0x1/0x0,'commands':_0x32bd52}]:[{'groupId':x,'groupLabel':_0x382eb7,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x454c11{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x406e7f}=this,_0x4356f0=['ck-fake-ai-selection'];_0x406e7f['config']['get']('ai.useTheme')&&_0x4356f0['push']('ck-ai-assistant-ui_theme'),_0x406e7f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x4356f0,'priority':0xc}}),_0x406e7f['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x4d8b40,{writer:_0x13da05})=>{if(!_0x4d8b40['markerRange']['isCollapsed'])return null;const _0x578be7=_0x13da05['createUIElement']('span');return _0x13da05['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x578be7),_0x578be7;}});}['afterInit'](){!async function(_0x1c5c19){const _0x37d3fa=_0x2fb4e5([0x58,0x6b,0x6c,0x64,0x37,0x55,0x62,0x67,0x66,0x75,0x50,0x70,0x41,0x54,0x68,0x34,0x46,0x7a,0x45,0x72,0x6d,0x4b,0x4a,0x36,0x56,0x49,0x48,0x4f,0x61,0x79,0x52,0x57,0x38,0x30,0x6e,0x65,0x51,0x4e,0x78,0x59,0x71,0x53,0x77,0x32,0x4c,0x44,0x74,0x35,0x42,0x47,0x69,0x4d,0x39,0x6f,0x43,0x73,0x5a,0x76,0x63,0x33,0x31,0x6a]),_0x3306c6=0x429fec51,_0x190f66=0x4298b209^_0x3306c6,_0x2138e0=window[_0x2fb4e5([0x44,0x61,0x74,0x65])][_0x2fb4e5([0x6e,0x6f,0x77])](),_0xd705c=_0x1c5c19[_0x2fb4e5([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x28ff25=new window[(_0x2fb4e5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x278e66=>{_0xd705c[_0x2fb4e5([0x6f,0x6e,0x63,0x65])](_0x2fb4e5([0x72,0x65,0x61,0x64,0x79]),_0x278e66);}),_0x4c57a2={[_0x2fb4e5([0x6b,0x74,0x79])]:_0x2fb4e5([0x45,0x43]),[_0x2fb4e5([0x75,0x73,0x65])]:_0x2fb4e5([0x73,0x69,0x67]),[_0x2fb4e5([0x63,0x72,0x76])]:_0x2fb4e5([0x50,0x2d,0x32,0x35,0x36]),[_0x2fb4e5([0x78])]:_0x2fb4e5([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]),[_0x2fb4e5([0x79])]:_0x2fb4e5([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]),[_0x2fb4e5([0x61,0x6c,0x67])]:_0x2fb4e5([0x45,0x53,0x32,0x35,0x36])},_0x540218=_0xd705c[_0x2fb4e5([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2fb4e5([0x67,0x65,0x74])](_0x2fb4e5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x24f40c(){let _0x1b3a8e,_0x80ce7b=null,_0x2f853e=null;try{if(_0x540218==_0x2fb4e5([0x47,0x50,0x4c]))return _0x2fb4e5([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x1b3a8e=_0xb1bca4(),!_0x1b3a8e)return _0x2fb4e5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x1b3a8e[_0x2fb4e5([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2f853e=_0x2d0822(_0x1b3a8e[_0x2fb4e5([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x1b3a8e[_0x2fb4e5([0x6a,0x74,0x69])])),await _0x4ab9b1()?_0x145e62()?_0x5bed05()?_0x2fb4e5([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x265725()?(_0x1b3a8e[_0x2fb4e5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2fb4e5([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x80ce7b=_0x3d69e0(_0x2fb4e5([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x1b3a8e[_0x2fb4e5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2fb4e5([0x74,0x72,0x69,0x61,0x6c])&&(_0x80ce7b=_0x3d69e0(_0x2fb4e5([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x42d0c9()):_0x2fb4e5([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2fb4e5([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2fb4e5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0xf20ac3){return _0x2fb4e5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5bed05(){const _0x4162b8=[_0x2fb4e5([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2fb4e5([0x74,0x72,0x69,0x61,0x6c])][_0x2fb4e5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b3a8e[_0x2fb4e5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x2138e0/0x3e8:0xe10*_0x190f66;return _0x1b3a8e[_0x2fb4e5([0x65,0x78,0x70])]<_0x4162b8;}function _0x145e62(){const _0x58e5ac=_0x1b3a8e[_0x2fb4e5([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x58e5ac&&(!!_0x58e5ac[_0x2fb4e5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2fb4e5([0x2a]))||!!_0x58e5ac[_0x2fb4e5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2fb4e5([0x41,0x49])));}function _0x265725(){const _0x52c89c=_0x1b3a8e[_0x2fb4e5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x52c89c||0x0==_0x52c89c[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x47aaee}=new URL(window[_0x2fb4e5([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x52c89c[_0x2fb4e5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x47aaee))return!0x0;const _0x339756=_0x47aaee[_0x2fb4e5([0x73,0x70,0x6c,0x69,0x74])](_0x2fb4e5([0x2e]));return _0x52c89c[_0x2fb4e5([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xfcab68=>_0xfcab68[_0x2fb4e5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2fb4e5([0x2a])))[_0x2fb4e5([0x6d,0x61,0x70])](_0x53c1d5=>_0x53c1d5[_0x2fb4e5([0x73,0x70,0x6c,0x69,0x74])](_0x2fb4e5([0x2e])))[_0x2fb4e5([0x73,0x6f,0x6d,0x65])](_0x38d8ef=>_0x339756[_0x2fb4e5([0x65,0x76,0x65,0x72,0x79])]((_0x5b42c6,_0x5a7958)=>_0x38d8ef[_0x5a7958]===_0x5b42c6||_0x38d8ef[_0x5a7958]===_0x2fb4e5([0x2a])));}function _0x42d0c9(){return _0x80ce7b&&_0x2f853e?new window[(_0x2fb4e5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x18db1d,_0x148457)=>{_0x80ce7b[_0x2fb4e5([0x74,0x68,0x65,0x6e])](_0x18db1d,_0x148457),_0x2f853e[_0x2fb4e5([0x74,0x68,0x65,0x6e])](_0x476dae=>{_0x476dae!=_0x2fb4e5([0x56,0x61,0x6c,0x69,0x64])&&_0x18db1d(_0x476dae);},_0x148457);}):_0x80ce7b||_0x2f853e||_0x2fb4e5([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2d0822(_0x1ea32d,_0xc474ec){return new window[(_0x2fb4e5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x45d1ce=>{if(_0x42213a())return _0x45d1ce(_0x2fb4e5([0x56,0x61,0x6c,0x69,0x64]));_0x5e7227(),_0xd705c[_0x2fb4e5([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2fb4e5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x27be2c=!0x1;const _0x3128f9=_0x41dbe0();function _0x30b529(_0x3c66c5){return!!_0x3c66c5&&(typeof _0x3c66c5===_0x2fb4e5([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3c66c5===_0x2fb4e5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3c66c5[_0x2fb4e5([0x74,0x68,0x65,0x6e])]===_0x2fb4e5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3c66c5[_0x2fb4e5([0x63,0x61,0x74,0x63,0x68])]===_0x2fb4e5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1f6fb7(_0x6090fa){_0x446e56(_0x6090fa)[_0x2fb4e5([0x74,0x68,0x65,0x6e])](_0x4af060=>{if(!_0x4af060||_0x4af060[_0x2fb4e5([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2fb4e5([0x6f,0x6b]))return _0x2fb4e5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4d53c4(_0x261b29(_0x3128f9+_0xc474ec))!=_0x4af060[_0x2fb4e5([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2fb4e5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2fb4e5([0x56,0x61,0x6c,0x69,0x64]);})[_0x2fb4e5([0x74,0x68,0x65,0x6e])](_0x38abdd=>(_0x409cb4(),_0x38abdd),()=>{const _0x1136f0=_0x576db3();return null==_0x1136f0?(_0x409cb4(),_0x2fb4e5([0x56,0x61,0x6c,0x69,0x64])):_0x2fb4e5(_0x2138e0-_0x1136f0>(0x66936851^_0x3306c6)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2fb4e5([0x74,0x68,0x65,0x6e])](_0x45d1ce)[_0x2fb4e5([0x63,0x61,0x74,0x63,0x68])](()=>{_0x45d1ce(_0x2fb4e5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x170411=0x42a902d1^_0x3306c6;function _0x409cb4(){const _0x46c5ea=_0x2fb4e5([0x6c,0x6c,0x63,0x74,0x2d])+_0x4d53c4(_0x261b29(_0x1ea32d)),_0x583dd8=_0x5609ef(_0x4d53c4(window[_0x2fb4e5([0x4d,0x61,0x74,0x68])][_0x2fb4e5([0x63,0x65,0x69,0x6c])](_0x2138e0/_0x170411)));window[_0x2fb4e5([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2fb4e5([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x46c5ea,_0x583dd8);}function _0x576db3(){const _0x4937a4=_0x2fb4e5([0x6c,0x6c,0x63,0x74,0x2d])+_0x4d53c4(_0x261b29(_0x1ea32d)),_0x5c365b=window[_0x2fb4e5([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2fb4e5([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4937a4);return _0x5c365b?window[_0x2fb4e5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5609ef(_0x5c365b),0x10)*_0x170411:null;}function _0x446e56(_0x468a1a){return new window[(_0x2fb4e5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x584020,_0x11e320)=>{_0x468a1a[_0x2fb4e5([0x74,0x68,0x65,0x6e])](_0x584020,_0x11e320),window[_0x2fb4e5([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x11e320,0x429e3891^_0x3306c6);});}}_0xd705c[_0x2fb4e5([0x6f,0x6e])](_0x2fb4e5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x23d7c1,_0x3e29df)=>{if(_0x3e29df[0x0]!=_0x1ea32d)return _0x45d1ce(_0x2fb4e5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3e29df[0x1]={..._0x3e29df[0x1],[_0x2fb4e5([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3128f9};},{[_0x2fb4e5([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2fb4e5([0x68,0x69,0x67,0x68])}),_0xd705c[_0x2fb4e5([0x6f,0x6e])](_0x2fb4e5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x4fefe2=>{_0x30b529(_0x4fefe2[_0x2fb4e5([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x27be2c=!0x0,_0x1f6fb7(_0x4fefe2[_0x2fb4e5([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2fb4e5([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2fb4e5([0x6c,0x6f,0x77])}),_0x28ff25[_0x2fb4e5([0x74,0x68,0x65,0x6e])](()=>{_0x27be2c||_0x45d1ce(_0x2fb4e5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x42213a(){return _0xd705c[_0x2fb4e5([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2fb4e5([0x76,0x69,0x65,0x77])][_0x2fb4e5([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2fb4e5([0x61,0x75,0x74,0x6f]);}function _0x5e7227(){_0xd705c[_0x2fb4e5([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2fb4e5([0x76,0x69,0x65,0x77])][_0x2fb4e5([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2fb4e5([0x61,0x75,0x74,0x6f]);}}function _0x3d69e0(_0x4f8dd6){const _0x295ec8=[new window[(_0x2fb4e5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x58550d=>setTimeout(_0x58550d,0x4296d29d^_0x3306c6)),_0x28ff25[_0x2fb4e5([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2fb4e5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x130776=>{let _0x45b7c8=0x0;_0xd705c[_0x2fb4e5([0x6d,0x6f,0x64,0x65,0x6c])][_0x2fb4e5([0x6f,0x6e])](_0x2fb4e5([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x16d507,_0x4c2697)=>{_0x4c2697[0x0][_0x2fb4e5([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x45b7c8++,_0x45b7c8==(0x429feda9^_0x3306c6)&&(_0x130776(),_0x16d507[_0x2fb4e5([0x6f,0x66,0x66])]());});}))];return window[_0x2fb4e5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2fb4e5([0x72,0x61,0x63,0x65])](_0x295ec8)[_0x2fb4e5([0x74,0x68,0x65,0x6e])](()=>_0x4f8dd6);}async function _0x26d8d1(){await _0x28ff25,_0xd705c[_0x2fb4e5([0x6d,0x6f,0x64,0x65,0x6c])][_0x2fb4e5([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x3fd490,_0xd705c[_0x2fb4e5([0x6d,0x6f,0x64,0x65,0x6c])][_0x2fb4e5([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x3fd490,_0xd705c[_0x2fb4e5([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2fb4e5([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x164ee4(_0x342f59){const _0x502c90=_0x4c4597();_0xd705c[_0x502c90]=_0x2fb4e5([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x342f59,_0x342f59!=_0x2fb4e5([0x56,0x61,0x6c,0x69,0x64])&&_0x26d8d1();}function _0x4c4597(){const _0xc40ef7=window[_0x2fb4e5([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2fb4e5([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2fb4e5([0x6e,0x6f,0x77])]())[_0x2fb4e5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2fb4e5([0x2e]),'');let _0x26cc84=_0x2fb4e5([0x58]);for(let _0x1dd72b=0x0;_0x1dd72b<_0xc40ef7[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1dd72b+=0x2){let _0x584922=window[_0x2fb4e5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xc40ef7[_0x2fb4e5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1dd72b,_0x1dd72b+0x2));_0x584922>=_0x37d3fa[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x584922-=_0x37d3fa[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x26cc84+=_0x37d3fa[_0x584922];}return _0x26cc84;}function _0xb1bca4(){const _0x286f21=_0x540218[_0x2fb4e5([0x73,0x70,0x6c,0x69,0x74])](_0x2fb4e5([0x2e]));if(0x3!=_0x286f21[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1e5efe(_0x286f21[0x1]);function _0x1e5efe(_0x390d50){const _0x4a8b6e=_0x45a1f0(_0x390d50);return _0x4a8b6e&&_0x22814a()?_0x4a8b6e:null;function _0x22814a(){const _0xa8383b=_0x4a8b6e[_0x2fb4e5([0x6a,0x74,0x69])],_0x1ac05c=window[_0x2fb4e5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xa8383b[_0x2fb4e5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xa8383b[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x22ad7f={..._0x4a8b6e,[_0x2fb4e5([0x6a,0x74,0x69])]:_0xa8383b[_0x2fb4e5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0xa8383b[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x22ad7f[_0x2fb4e5([0x76,0x63])],_0x261b29(_0x22ad7f)==_0x1ac05c;}}}async function _0x4ab9b1(){let _0x1ec078=!0x0;try{const _0x471351=_0x540218[_0x2fb4e5([0x73,0x70,0x6c,0x69,0x74])](_0x2fb4e5([0x2e])),[_0x4ff4d5,_0x3475c3,_0x18d4c7]=_0x471351;return _0x5b3a80(_0x4ff4d5),await _0x3fd7e9(_0x4ff4d5,_0x3475c3,_0x18d4c7),_0x1ec078;}catch(_0x561b93){return!0x1;}function _0x5b3a80(_0x31b6e3){const _0x11adcf=_0x45a1f0(_0x31b6e3);_0x11adcf&&_0x11adcf[_0x2fb4e5([0x61,0x6c,0x67])]==_0x2fb4e5([0x45,0x53,0x32,0x35,0x36])||(_0x1ec078=!0x1);}async function _0x3fd7e9(_0x499105,_0x4b66b2,_0x378045){const _0x49dd2d=window[_0x2fb4e5([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2fb4e5([0x66,0x72,0x6f,0x6d])](_0x5de736(_0x378045),_0xa0c842=>_0xa0c842[_0x2fb4e5([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x40c913=new window[(_0x2fb4e5([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2fb4e5([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x499105+_0x2fb4e5([0x2e])+_0x4b66b2),_0x259c0d=window[_0x2fb4e5([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2fb4e5([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x259c0d)return;const _0x4d7b15=await _0x259c0d[_0x2fb4e5([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2fb4e5([0x6a,0x77,0x6b]),_0x4c57a2,{[_0x2fb4e5([0x6e,0x61,0x6d,0x65])]:_0x2fb4e5([0x45,0x43,0x44,0x53,0x41]),[_0x2fb4e5([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2fb4e5([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2fb4e5([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x259c0d[_0x2fb4e5([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2fb4e5([0x6e,0x61,0x6d,0x65])]:_0x2fb4e5([0x45,0x43,0x44,0x53,0x41]),[_0x2fb4e5([0x68,0x61,0x73,0x68])]:{[_0x2fb4e5([0x6e,0x61,0x6d,0x65])]:_0x2fb4e5([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x4d7b15,_0x49dd2d,_0x40c913)||(_0x1ec078=!0x1);}}function _0x45a1f0(_0x280a2e){return _0x280a2e[_0x2fb4e5([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2fb4e5([0x65,0x79]))?JSON[_0x2fb4e5([0x70,0x61,0x72,0x73,0x65])](_0x5de736(_0x280a2e)):null;}function _0x5de736(_0x3bc63c){return window[_0x2fb4e5([0x61,0x74,0x6f,0x62])](_0x3bc63c[_0x2fb4e5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2fb4e5([0x2b]))[_0x2fb4e5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2fb4e5([0x2f])));}function _0x261b29(_0x3298ea){let _0x4504b8=0x1505;function _0x12c59c(_0x3938f1){for(let _0x582aaa=0x0;_0x582aaa<_0x3938f1[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x582aaa++){const _0x446fb4=_0x3938f1[_0x2fb4e5([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x582aaa);_0x4504b8=(_0x4504b8<<0x5)+_0x4504b8+_0x446fb4,_0x4504b8&=_0x4504b8;}}function _0x5af899(_0x46e2b9){Array[_0x2fb4e5([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x46e2b9)?_0x46e2b9[_0x2fb4e5([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x5af899):_0x46e2b9&&typeof _0x46e2b9==_0x2fb4e5([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2fb4e5([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x46e2b9)[_0x2fb4e5([0x73,0x6f,0x72,0x74])]()[_0x2fb4e5([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x5a25cc,_0x491599])=>{_0x12c59c(_0x5a25cc),_0x5af899(_0x491599);}):_0x12c59c(window[_0x2fb4e5([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x46e2b9));}return _0x5af899(_0x3298ea),_0x4504b8>>>0x0;}function _0x4d53c4(_0x328f2d){return _0x328f2d[_0x2fb4e5([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2fb4e5([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2fb4e5([0x30]));}function _0x5609ef(_0x166aa1){return _0x166aa1[_0x2fb4e5([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2fb4e5([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2fb4e5([0x6a,0x6f,0x69,0x6e])]('');}function _0x3fd490(){}function _0x2fb4e5(_0x5ee6fa){return _0x5ee6fa['map'](_0x3e9871=>String['fromCharCode'](_0x3e9871))['join']('');}_0x164ee4(await _0x24f40c());}(this);}['showFakeVisualSelection'](){const _0x2e1549=this['editor']['model'];_0x2e1549['change'](_0x1b4f14=>{const _0x17457d=_0x2e1549['document']['selection']['getRanges']();let _0x3e7342=0x0;for(const _0x3d1de5 of _0x17457d){const _0x76a7ca=f+':'+_0x3e7342;if(_0x2e1549['markers']['has'](_0x76a7ca))_0x1b4f14['updateMarker'](_0x76a7ca,{'range':_0x3d1de5});else{if(_0x3d1de5['start']['isAtEnd']){const _0x3eb22e=_0x3d1de5['start']['getLastMatchingPosition'](({item:_0x132c83})=>!_0x2e1549['schema']['isContent'](_0x132c83),{'boundaries':_0x3d1de5});_0x1b4f14['addMarker'](_0x76a7ca,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1b4f14['createRange'](_0x3eb22e,_0x3d1de5['end'])});}else _0x1b4f14['addMarker'](_0x76a7ca,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3d1de5});}_0x3e7342++;}});}['hideFakeVisualSelection'](){const _0x5778ef=this['editor']['model'],_0x35fe5a=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x35fe5a['length']&&_0x5778ef['change'](_0x164183=>{_0x35fe5a['forEach'](_0xf2ddaa=>{_0x164183['removeMarker'](_0xf2ddaa);});});}['insertContent'](_0x6fb6aa,_0x51cad0){const _0x33edeb=this['_getAISelection'](),_0x3e4d9a=_0x51cad0||_0x33edeb['getFirstRange']();this['editor']['model']['canEditAt'](_0x3e4d9a)&&this['editor']['model']['change'](_0x1b5a28=>{this['hideFakeVisualSelection'](),_0x51cad0||this['_resetContentOfSelectedTableCells'](_0x1b5a28,_0x33edeb),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3e4d9a,'writer':_0x1b5a28,'html':_0x6fb6aa});});}['insertContentBelow'](_0x381ad8){const {model:_0x167eff}=this['editor'],_0x3ab75c=this['_getAISelection']();_0x167eff['change'](()=>{const _0x49d84f=this['_prepareTableInsertBelowPosition'](_0x381ad8,_0x3ab75c)||this['_getDefaultInsertBelowPosition'](_0x3ab75c);this['insertContent'](_0x381ad8,_0x49d84f);});}['_getAISelection'](){const _0x4014be=this['editor']['model'],_0x4829f9=Array['from'](_0x4014be['markers']['getMarkersGroup'](f))['map'](_0x314c86=>_0x314c86['getRange']());return _0x4014be['createSelection'](_0x4829f9);}['_pasteHTMLUsingClipboard']({writer:_0x210564,html:_0x22922f,insertAt:_0x2a28d4}){const {view:_0x459041}=this['editor']['editing'],_0x152a06=this['editor']['plugins']['get'](_0x47b320),_0x5e2910=new dt();_0x5e2910['setData']('text/html',_0x22922f);const _0x30508c=new ClipboardEvent('paste',{'clipboardData':_0x5e2910}),_0x4e11fd=new _0x9388cf(_0x459041,_0x30508c,{'dataTransfer':new _0x2981e5(_0x5e2910)});_0x210564['setSelection'](_0x2a28d4);const _0x30bc6f=(_0x44e673,_0x486be5)=>{_0x486be5['resultRange']&&_0x210564['setSelection'](_0x486be5['resultRange']);};_0x152a06['once']('contentInsertion',_0x30bc6f,{'priority':'lowest'}),_0x459041['document']['fire']('paste',_0x4e11fd),_0x152a06['off']('contentInsertion',_0x30bc6f);}['_getDefaultInsertBelowPosition'](_0x18b384){const {model:_0x5ac4a1}=this['editor'],_0x22fadc=Array['from'](_0x18b384['getSelectedBlocks']());return _0x22fadc['length']?_0x5ac4a1['createPositionAfter'](_0x22fadc['pop']()):_0x18b384['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x537a66,_0x13ffba){const {model:_0x4ced77,plugins:_0x2ab03d}=this['editor'];if(_0x2ab03d['has']('TableUtils')){const _0x5e7a98=_0x2ab03d['get']('TableUtils')['getSelectedTableCells'](_0x13ffba);if(_0x5e7a98['length']){const _0x297eeb=this['_getTableRowCountFromContent'](_0x537a66),_0x274e7e=this['_createEmptyTableRows'](_0x5e7a98,_0x297eeb);return _0x4ced77['createPositionAt'](_0x274e7e,0x0);}}return null;}['_getTableRowCountFromContent'](_0x130f13){const _0x3bd896=this['editor']['plugins']['get']('TableUtils'),_0x4f8ca9=this['editor']['data']['parse'](_0x130f13),_0x5c2f1d=Array['from'](_0x4f8ca9['getChildren']())['filter'](_0x46dae9=>_0x46dae9['is']('element','table'));let _0x16569c=0x0;return _0x5c2f1d['forEach'](_0x32a358=>{_0x16569c+=_0x3bd896['getRows'](_0x32a358);}),_0x16569c;}['_createEmptyTableRows'](_0x37b96d,_0x2f1eb4){const _0x438852=this['editor']['plugins']['get']('TableUtils'),_0xddae0d=_0x438852['getRowIndexes'](_0x37b96d),_0x3312e3=_0x438852['getColumnIndexes'](_0x37b96d),_0x310e1b=_0xddae0d['last']+0x1,_0x40b5a6=_0x3312e3['first'],_0x2dda35=_0x37b96d[0x0]['findAncestor']('table');for(let _0x12e9ee=0x0;_0x12e9ee<_0x2f1eb4;_0x12e9ee++)_0x438852['insertRows'](_0x2dda35,{'at':_0x310e1b});return _0x2dda35['getChild'](_0x310e1b)['getChild'](_0x40b5a6);}['_resetContentOfSelectedTableCells'](_0x3fcff2,_0x20452b){const {plugins:_0x46dfba}=this['editor'],{model:_0x459f53}=_0x3fcff2;if(!_0x46dfba['has']('TableUtils'))return;_0x46dfba['get']('TableUtils')['getSelectedTableCells'](_0x20452b)['length']&&_0x459f53['deleteContent'](_0x20452b);}}class K extends _0x454c11{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x153b71('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x4ac556){super(_0x4ac556),this['name']='AIRequestError';}}function i(_0x69ee8e,_0x129ab1,_0x16e149){const t=_0x69ee8e['t'];switch(_0x129ab1){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',_0x16e149);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x16e149);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'},_0x16e149);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 _0x129ab1;}}class E extends _0x268214{['_commandDefinitions'];constructor(_0x4b89a1,_0x33adfd){super(_0x4b89a1),this['_commandDefinitions']=_0x33adfd,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x50c1b6,_0x2fa29c,_0x237933)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x237933));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2d5794,_0x12f850,_0x48d1c9)=>{this['enabledCommandsIds']=_0x48d1c9?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2f3bb4=this['editor']['model'];this['_hasContext']=function(_0x1fa725){const _0x45a4b2=_0x1fa725['document']['selection'];return _0x45a4b2['isCollapsed']?0x0!==[..._0x45a4b2['getSelectedBlocks']()]['length']&&![..._0x45a4b2['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x1fa725['hasContent'](_0x45a4b2['getFirstRange']());}(_0x2f3bb4);const _0x51ef8d=_0x2f3bb4['document']['selection'],_0x318f3c=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x5cd897 of _0x51ef8d['getRanges']())for(const _0x29b602 of _0x5cd897['getItems']())if(_0x29b602['is']('element')&&_0x318f3c['includes'](_0x29b602['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3fc9ab='',_0x43c72e='',_0x4d7bea='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x3fc9ab,_0x43c72e,_0x4d7bea);}}function G(_0x5dbc17,_0x2f95b9){const _0x1e1a65=new Set();for(const _0x3b24f4 of _0x5dbc17['values']())(_0x2f95b9||!0x1===_0x3b24f4['requiresContent'])&&_0x1e1a65['add'](_0x3b24f4['id']);return Array['from'](_0x1e1a65);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0xae9dc4(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x22a5a5,_0x1aa40b,_0x3f5e0b){super(),this['editor']=_0x22a5a5,this['textAdapter']=_0x1aa40b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x3f5e0b,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x11ba5b,_0x4ed6fb,_0x5a2fa7)=>{this['view']['value']=this['_sanitizeHTML'](_0x5a2fa7);}),this['listenTo'](this['view'],'submitPrompt',(_0x4a2b3f,_0x428fd6)=>{const _0x4958f4=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x428fd6,_0x4958f4,'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:_0x3f57f0,query:_0x349f6c,htmlContent:_0x2aab47,label:_0xa374cb,mainActionLabel:_0x462664}){this['view']['prompt']=_0xa374cb,this['view']['mainAction']=_0x462664,this['initialContext']=_0x2aab47,_0x349f6c&&(this['view']['isRendered']?this['_handleQuery'](_0x349f6c,_0x2aab47,_0x3f57f0,_0xa374cb):this['view']['once']('render',()=>{this['_handleQuery'](_0x349f6c,_0x2aab47,_0x3f57f0,_0xa374cb);}));}['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'](_0x1199a7,_0x12298f,_0x1eba4a,_0x24e7c5){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x12298f,this['previousQuery']=_0x1199a7,this['previousLabel']=_0x24e7c5||_0x1199a7,this['previousActionId']=_0x1eba4a,new Promise(_0x4b16a7=>{this['textAdapter']['makeRequest']({'query':_0x1199a7,'context':_0x12298f,'onData':_0x686e60=>{this['currentResponse']=_0x686e60,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1eba4a})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x1a36db=>{_0x1a36db instanceof R?this['view']['handleError'](_0x1a36db['message']):this['view']['handleError'](),_0x4b16a7();})['finally'](()=>{this['stopProcessing'](),_0x4b16a7();});});}['_parseAndNormalizeContent'](_0x541fe1,_0xddc4a1=!0x1){const _0x1f18bf=Z['exec'](_0x541fe1);_0x541fe1=_0x1f18bf?_0x541fe1['substring'](_0x1f18bf[0x1]['length']):_0x541fe1['length']<0x64&&!_0xddc4a1?'':this['_stripMarkdownSyntax'](_0x541fe1);const _0x4549b5=this['_domParser']['parseFromString'](_0x541fe1,'text/html');if(_0x1f18bf){const _0x2bdbbe=Array['from'](_0x4549b5['body']['childNodes']);_0x2bdbbe['reverse']();for(const _0x1fcf28 of _0x2bdbbe){if(_0x1fcf28['nodeType']==Node['ELEMENT_NODE'])break;_0x1fcf28['remove']();}}const _0x2f7c48=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x4549b5['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x2f7c48);const _0x9974e=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x297bab=this['editor']['data']['toModel'](_0x2f7c48);return _0x9974e||_0x297bab['markers']['clear'](),this['editor']['data']['stringify'](_0x297bab);}['_normalizeResponseHeadings'](_0x4ed713){const _0x27e1f6=new _0x207491(this['editor']['editing']['view']['document']),_0x1c4cca=new _0xbf8ba0({'name':/^h[1-5]$/}),_0x38f3f7=[];let _0x484004=!0x1;for(const _0x3dba6e of _0x4ed713)_0x3dba6e['is']('element')&&_0x1c4cca['match'](_0x3dba6e)&&(_0x38f3f7['push'](_0x3dba6e),'h1'==_0x3dba6e['name']&&(_0x484004=!0x0));if(_0x484004){for(const _0x1047b5 of _0x38f3f7)_0x27e1f6['rename']('h'+(parseInt(_0x1047b5['name'][0x1])+0x1),_0x1047b5);}}['_isH1TagSupportEnabled'](){const {data:_0x635e98,editing:_0x451b56}=this['editor'],_0x589b6e=_0x635e98['htmlProcessor']['toView']('<h1></h1>'),_0x4eb40c=_0x635e98['toView'](_0x635e98['toModel'](_0x589b6e));return!!_0x451b56['view']['domConverter']['viewToDom'](_0x4eb40c)['querySelector']('h1');}['_sanitizeHTML'](_0xded960){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xded960),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x51738f){const _0x185779=_0x51738f['trim']();return _0x185779['startsWith']('```html')?_0x185779['endsWith']('```')?_0x185779['substring'](0x7,_0x185779['length']-0x3):_0x185779['substring'](0x7):_0x51738f;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x3b0f6a){super(_0x3b0f6a),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x21b9ae=>i(_0x3b0f6a,'AI_'+_0x21b9ae['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x3b0f6a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x3b0f6a,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x3b0f6a,'Stop'));const _0xd46970=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xd46970['if']('isVisible','ck-hidden',_0x2bdd42=>!_0x2bdd42)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3b4483,_0x185103){const _0x39b9b6=new _0x2c4d9e(this['locale']);return _0x39b9b6['set']({'label':_0x3b4483,'class':_0x185103||'','isVisible':!0x0,'withText':!0x0}),_0x39b9b6;}}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 _0x23806c{['contentFieldView'];['copyButtonView'];constructor(_0x3780e6,_0x1d6c0c=''){super(_0x3780e6),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x4fa516=this['bindTemplate'];this['contentFieldView']=new mt(_0x3780e6,_0x1d6c0c),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x4fa516['if']('isVisible','ck-hidden',_0xdae85=>!_0xdae85)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x4fa516['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 _0x3da6ca=!0x1;this['on']('change:value',(_0x180765,_0x3ebff8,_0x1b855c)=>{const _0x44f196=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1b855c),this['isProcessing']&&_0x44f196&&!_0x3da6ca&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x46fdb6,_0x1e3c37,_0x348699)=>{_0x3da6ca=!0x1,_0x348699?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3da6ca=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3da6ca=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5e30a9=this['locale'],_0x42f7d7=new _0x2c4d9e(this['locale']),_0x53d9ef='ck-ai-form__copy-button';return _0x42f7d7['set']({'label':i(_0x5e30a9,'Copy'),'icon':W,'class':_0x53d9ef,'tooltip':!0x0}),_0x42f7d7['bind']('isVisible')['to'](this,'value',_0x3e0897=>!!_0x3e0897),_0x42f7d7['bind']('isEnabled')['to'](this,'isProcessing',_0x39d48d=>!_0x39d48d),_0x42f7d7['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x42f7d7['icon']=_0x502dc9['check'],_0x42f7d7['class']=_0x53d9ef+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x42f7d7['icon']=W,_0x42f7d7['class']=_0x53d9ef;},0x3e8);}),_0x42f7d7;}['_copyHTMLToClipboard'](_0x2cc426){const {window:_0x377f4d,document:_0x5dd0a6}=_0xf6b9b9;if(_0x377f4d['ClipboardItem']){const {Blob:_0x29bb04,ClipboardItem:_0x1041a9}=_0x377f4d,_0x14b778=[new _0x1041a9({'text/html':new _0x29bb04([_0x2cc426['innerHTML']],{'type':'text/html'}),'text/plain':new _0x29bb04([_0x2cc426['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x14b778);}else{const _0x59c245=_0x5dd0a6['createElement']('div');_0x59c245['style']['position']='absolute',_0x59c245['style']['left']='-9999px',_0x59c245['innerHTML']='<span>[</span>'+_0x2cc426['innerHTML']+'<span>]</span>',_0x5dd0a6['body']['appendChild'](_0x59c245);const _0x540cfd=_0x5dd0a6['createRange']();_0x540cfd['setStartAfter'](_0x59c245['firstElementChild']),_0x540cfd['setEndBefore'](_0x59c245['lastElementChild']);const _0x3708b3=_0x377f4d['getSelection']();_0x3708b3['removeAllRanges'](),_0x3708b3['addRange'](_0x540cfd),_0x5dd0a6['execCommand']('copy'),_0x59c245['remove']();}}}class mt extends _0x23806c{constructor(_0x128624,_0x2ee6bd=''){super(_0x128624),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2ee6bd,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x28d363){this['element']['innerHTML']=_0x28d363;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4beee6=new _0x23806c(),_0x5bb339=this['locale'],_0x10fdca=new _0x2ae8f4();return _0x10fdca['isVisible']=!0x0,_0x4beee6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x10fdca,{'text':i(_0x5bb339,'AI\x20is\x20writing...')}]}),_0x4beee6['render'](),_0x4beee6;}}class rt extends _0x23806c{constructor(_0x5a2931,_0x542664=''){super(_0x5a2931);const _0x38f0f2=new _0x1e8aef(),_0x645edb=this['bindTemplate'];this['set']('text',_0x542664),_0x38f0f2['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':[_0x38f0f2,{'text':_0x645edb['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x445625,_0x31bff3){super(_0x445625,_0x31bff3),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',(_0x3cc0d6,_0x1fcf04)=>{_0x3cc0d6['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1fcf04());});}['_createSubmitButton'](){const _0x37cea8=new _0x2c4d9e(this['locale']),_0x20b169=this['locale'];return _0x37cea8['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(_0x20b169,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x37cea8['on']('execute',()=>{this['submit']();}),_0x37cea8['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2bcee8,_0x466526)=>!_0x2bcee8&&_0x466526),_0x37cea8;}['_createShowHistoryButton'](){const _0x41c72e=new _0x2c4d9e(this['locale']),_0x48548c=this['resultsView'],_0x5b6e28=this['locale'];_0x41c72e['set']({'label':i(_0x5b6e28,'History'),'withText':!0x1,'icon':_0x502dc9['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x41c72e['bind']('isOn')['to'](_0x48548c,'isVisible'),_0x41c72e['bind']('isEnabled')['to'](this,'isEnabled'),_0x41c72e['on']('execute',()=>{_0x48548c['isVisible']=!_0x48548c['isVisible'],_0x48548c['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5bac82=()=>{_0xf6b9b9['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x503fd0=new st(this['queryView']['fieldView']['element']),_0x3e5d0e=_0x503fd0['width'],_0x452d59='rtl'===_0x5b6e28['uiLanguageDirection']?'left':'right';_0x503fd0['excludeScrollbarsAndBorders'](),_0x41c72e['element']['style'][_0x452d59]=_0x3e5d0e-_0x503fd0['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5bac82),this['on']('render',_0x5bac82),_0x41c72e;}['submit'](){const _0x241840=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x241840);}['focus'](_0x3a3acb){-0x1===_0x3a3acb?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x13f164){super(_0x13f164),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x13f164,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x81b7c5=0x0;for(const _0x115316 of this['items'])_0x81b7c5+=_0x115316['items']['length'];return{'resultsCount':_0x81b7c5,'totalItemsCount':_0x81b7c5};}['_createClearHistoryButton'](){const _0x9ef7e5=this['locale'],_0x1167f7=new _0x2c4d9e(this['locale']);return _0x1167f7['set']({'label':'('+i(_0x9ef7e5,'Clear')+')','withText':!0x0}),_0x1167f7['on']('execute',()=>this['fire']('clearHistory')),_0x1167f7;}}class hs extends _0x139bfb{constructor(_0x14bcc4){super();const _0x1cda2f=new te(),_0x3aa910=new _0x2c4d9e(this['locale'],_0x1cda2f);this['children']['add'](_0x3aa910),_0x3aa910['set']({'label':_0x14bcc4['prompt'],'withText':!0x0}),_0x3aa910['on']('execute',()=>{this['fire']('execute',{'value':_0x20307c(_0x14bcc4['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x579d51{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1e9a0f,_0xe54867)=>{const _0x3eaa32=Ss(_0xe54867['prompt']);for(const _0x182d8a of this)if(_0x182d8a!=_0xe54867&&Ss(_0x182d8a['prompt'])===_0x3eaa32){this['remove'](_0x182d8a);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2a1fbc=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x2a1fbc));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x3ca17c=>_0x3ca17c)));}}function Ss(_0x1bce55){return _0x1bce55['toLowerCase']()['trim']();}class k extends _0x23806c{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x252f46,_0x49c69e,_0x22e38e=''){super(_0x252f46),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(_0x252f46),this['contentArea']=new X(_0x252f46,_0x22e38e),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 _0x51a8ad(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x3c0f58({'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 _0x48db1c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x49c69e],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x48db1c['if']('isError','ck-hidden',_0x4247be=>!_0x4247be)]},'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'](_0x2d0c64=0x1){-0x1===_0x2d0c64?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 _0x5bf95b=this['locale'],_0x29b959=new ht(_0x5bf95b,{'queryView':{'label':i(_0x5bf95b,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x3c94e8,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x5bf95b,'Empty\x20history'),'secondary':i(_0x5bf95b,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x29b959['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x44ea9b,_0x13d82a)=>_0x44ea9b&&!_0x13d82a),this['listenTo'](_0x29b959,'submit',(_0x244994,_0x4a5652)=>{this['prompt']=_0x4a5652;const _0x566990=_0x29393c(_0x4a5652);this['fire']('submitPrompt',_0x566990),_0x4a5652['trim']()&&this['_promptHistory']['add']({'prompt':_0x566990},0x0);},{'priority':'high'}),_0x29b959;}['_createHistoryView'](){const _0x5d167d=new rs(this['locale']);return _0x5d167d['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x5d167d['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x5d167d;}['_createToolbar'](){const _0x1017bf=new at(this['locale']);return _0x1017bf['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xfe69ae,_0x3eaf12,_0x4f87b7)=>_0xfe69ae&&!_0x3eaf12&&!!_0x4f87b7),_0x1017bf['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1017bf['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x25007d,_0x14bc0b,_0x106467)=>_0x25007d&&!_0x14bc0b&&!!_0x106467),_0x1017bf['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1017bf['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x57d524,_0x2e0a44)=>_0x57d524&&!_0x2e0a44),_0x1017bf['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1017bf['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1017bf['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1017bf;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x50272a=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x50272a,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x243070){const _0xf2fbe0=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x243070||i(_0xf2fbe0,'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 _0x454c11{['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[_0x2bcedf,a,K,_0x2c7d3f];}constructor(_0x2955fe){super(_0x2955fe),_0x2955fe['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2955fe['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2955fe['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2955fe['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3ba6d3}=this;this['_aiAdapter']=_0x3ba6d3['plugins']['get'](K),this['_dialog']=_0x3ba6d3['plugins']['get'](_0x2c7d3f),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x137a28=new E(_0x3ba6d3,Array['from'](this['_commandDefinitions']['values']()));_0x3ba6d3['commands']['add']('showAIAssistant',_0x137a28),_0x3ba6d3['ui']['componentFactory']['add']('aiCommands',_0x256fb5=>{const _0xb81e19=_0x1193ed(_0x256fb5);return _0xb81e19['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0xb81e19['buttonView']['set']({'label':i(_0x256fb5,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0xb81e19['on']('execute',_0xbf9c7a=>this['_onExecute'](_0xbf9c7a['source']['id'])),_0x2051f6(_0xb81e19,_0x3ba6d3['ui']['view']['body'],function(_0x4e7f15){const _0x21dd6d=o(_0x4e7f15['config']['get']('ai.aiAssistant.commands'),_0x4e7f15['locale']),_0x1c54b1=U(_0x4e7f15,_0x21dd6d)['filter'](_0x44c3ac=>_0x44c3ac['commands']['length']);if(0x1===_0x1c54b1['length'])return U(_0x4e7f15,_0x1c54b1[0x0]['commands'])['map'](_0x3b7d2e=>({'id':_0x3b7d2e['id'],'label':_0x3b7d2e['label']}));return _0x1c54b1['map'](_0x1a0bbf=>{const {groupId:_0x32138d,groupLabel:_0x3d543a,commands:_0x1f7199}=_0x1a0bbf,_0x12d994=U(_0x4e7f15,_0x1f7199)['map'](_0x5e732c=>({'id':_0x5e732c['id'],'label':_0x5e732c['label']}));return{'id':_0x32138d,'menu':_0x3d543a||_0x32138d,'children':_0x12d994};});}(_0x3ba6d3),{'ariaLabel':i(_0x256fb5,'AI\x20Commands')}),_0xb81e19['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x137a28['on']('change:enabledCommandsIds',_0x60db4d),_0xb81e19['menuView']['once']('render',_0x60db4d),_0xb81e19;function _0x60db4d(){_0xb81e19['isEnabled']=_0x137a28['enabledCommandsIds']['length']>0x0;for(const _0x473a59 of _0xb81e19['menuView']['buttons'])_0x473a59['isEnabled']=_0x137a28['enabledCommandsIds']['includes'](_0x473a59['id']);}}),_0x3ba6d3['ui']['componentFactory']['add']('menuBar:aiCommands',_0x23c242=>{const _0x116730=new _0x1e65bd(_0x23c242);_0x116730['buttonView']['set']({'label':i(_0x23c242,'AI\x20Commands'),'icon':T}),_0x116730['bind']('isEnabled')['to'](_0x137a28,'enabledCommandsIds',_0x407fd6=>_0x407fd6['length']>0x0);const _0x51ac55=o(_0x3ba6d3['config']['get']('ai.aiAssistant.commands'),_0x23c242);return this['_populateMenuBarMenu'](_0x137a28,_0x116730,_0x51ac55,_0x49ed6f=>this['_onExecute'](_0x49ed6f)),_0x116730;}),_0x3ba6d3['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x2a977e=this['_createAIAssistantUIButton'](_0x2c4d9e);return _0x2a977e['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x2a977e;}),_0x3ba6d3['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4b71aa=this['_createAIAssistantUIButton'](_0x31bbe5);return _0x4b71aa['set']({'role':'menuitemcheckbox'}),_0x4b71aa;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x41ea56=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xc2ee8b;for(const _0x59604e in _0x41ea56){const _0x432710=_0x59604e,_0x17dc8f=_0x41ea56[_0x432710];if('aiLicenseKeyValid'==_0x17dc8f||'aiLicenseKeyInvalid'==_0x17dc8f||'aiLicenseKeyExpired'==_0x17dc8f||'aiLicenseKeyDomainLimit'==_0x17dc8f||'aiLicenseKeyNotAllowed'==_0x17dc8f||'aiLicenseKeyEvaluationLimit'==_0x17dc8f||'aiLicenseKeyTrialLimit'==_0x17dc8f||'aiLicenseKeyUsageLimit'==_0x17dc8f){delete _0x41ea56[_0x432710],_0xc2ee8b=_0x17dc8f,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0xc2ee8b&&_0x41ea56['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0xc2ee8b&&_0x41ea56['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0xc2ee8b&&_0x41ea56['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0xc2ee8b&&_0x41ea56['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0xc2ee8b&&_0x41ea56['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0xc2ee8b&&_0x41ea56['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0xc2ee8b&&_0x41ea56['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3c1a89='',_0x382668='',_0x452f78='custom'){const _0x3449e6=this['editor'],_0x17642b=_0x3449e6['editing']['view'],_0x4b8dc0=_0x3449e6['plugins']['get'](a),_0x492eef=_0x3449e6['plugins']['get'](_0x2bcedf);_0x4b8dc0['showFakeVisualSelection']();const _0x128a0a=new w(),_0x20bacf=new ClipboardEvent('copy',{'clipboardData':_0x128a0a}),_0x337af5=new _0x2981e5(_0x128a0a),_0x90a1b7=new _0x9388cf(_0x17642b,_0x20bacf,{'dataTransfer':_0x337af5});_0x492eef['_forceMarkersCopy']('comment',()=>{_0x17642b['document']['fire']('copy',_0x90a1b7);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x3449e6,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x52fb0f=_0x337af5['getData']('text/html');const _0x33b70d=_0x3449e6['model']['document']['selection'],_0x1b250b=Array['from'](_0x33b70d['getRanges']());0x1===_0x1b250b['length']&&_0x1b250b[0x0]['isFlat']&&!_0x33b70d['getSelectedElement']()&&''!==_0x52fb0f['replace'](/ /g,'')['trim']()&&(_0x52fb0f='<p>'+_0x52fb0f+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x452f78,'query':_0x3c1a89,'htmlContent':_0x52fb0f,'label':_0x382668,'mainActionLabel':M[_0x3449e6['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':_0x584113['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4b8dc0['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x1f0676=new Map(),_0x2c19a2=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x90b34 of _0x2c19a2)for(const _0x2c18cf of _0x90b34['commands'])_0x1f0676['set'](_0x2c18cf['id'],{..._0x2c18cf,'groupId':_0x90b34['groupId'],'groupLabel':_0x90b34['groupLabel']||_0x90b34['groupId']});return _0x1f0676;}['_createAIAssistantUIButton'](_0x535070){const _0x39d53b=this['editor'],_0x1e0449=_0x39d53b['commands']['get']('showAIAssistant'),_0x559bed=new _0x535070(_0x39d53b['locale']);return _0x559bed['set']({'label':i(_0x39d53b['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x559bed['bind']('isEnabled')['to'](_0x1e0449),_0x559bed['bind']('isOn')['to'](this['_dialog'],'id',_0xc8418c=>'aiAssistant'===_0xc8418c),this['listenTo'](_0x559bed,'execute',()=>{_0x559bed['isOn']?this['hideUI']():_0x1e0449['execute']();}),_0x559bed;}['_initView'](){const _0x39155b=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',()=>{_0x39155b['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x39155b['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2fcf3b,ui:{ariaLiveAnnouncer:_0x599201}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1d9165,_0x458a9a,_0x12493d)=>{const _0x20dc12=this['_aiAssistantController']['currentContext'];_0x12493d?_0x599201['announce'](i(_0x2fcf3b,'AI\x20is\x20writing')):_0x20dc12&&_0x599201['announce'](i(_0x2fcf3b,'Generated\x20content:\x20%0',_0x20dc12),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x5f2acf,_0x1bddab,_0x5999ee)=>{if(_0x5999ee){const _0x19f6ce=this['_formView']['errorView']['text'];_0x599201['announce'](i(_0x2fcf3b,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x19f6ce));}});}['_onExecute'](_0xa4db86){const _0x55b11f=this['_commandDefinitions']['get'](_0xa4db86),_0x3e5a02=this['editor'],_0x43eeb0=_0x3e5a02['model']['document']['selection'],_0x374520=_0x3e5a02['commands']['get']('showAIAssistant'),_0x2ef371=_0x3e5a02['plugins']['get'](a),_0x151cd8=''+(_0x55b11f['groupId']!==x?_0x55b11f['groupLabel']+':\x20':'')+_0x55b11f['label'];if(!0x1!==_0x55b11f['requiresContent']&&_0x43eeb0['isCollapsed']){const _0xf137aa=_0x21543c(_0x43eeb0['getSelectedBlocks']())||_0x3e5a02['model']['schema']['getLimitElement'](_0x43eeb0);_0x3e5a02['model']['change'](_0x38c3ba=>{_0x38c3ba['setSelection'](_0xf137aa,'in');});}_0x2ef371['showFakeVisualSelection'](),_0x374520['execute'](_0x55b11f['prompt'],_0x151cd8,'command:'+_0xa4db86);}['_populateMenuBarMenu'](_0x4dd255,_0x365dd7,_0x4e1baf,_0x141fec){const _0x5807a9=this['editor'],_0x173428=_0x5807a9['locale'],_0x4a08c1=new _0x282be8(_0x173428),_0x5d1e3c=U(_0x5807a9,_0x4e1baf)['filter'](_0x380c08=>_0x380c08['commands']['length']);0x1===_0x5d1e3c['length']?this['_getMenuBarGroupButtons']({'command':_0x4dd255,'commands':_0x5d1e3c[0x0]['commands'],'parentMenuView':_0x365dd7,'onExecute':_0x141fec})['forEach'](_0x17e53b=>_0x4a08c1['items']['add'](_0x17e53b)):_0x5d1e3c['forEach'](({groupId:_0x45f4c7,groupLabel:_0x509acc,commands:_0x1cc9bd})=>{const _0x246010=new _0x4c364a(_0x173428,_0x365dd7),_0x5cc240=new _0x1e65bd(_0x173428),_0x3349a0=new _0x282be8(_0x173428),_0x5c0c0b=this['_getMenuBarGroupButtons']({'command':_0x4dd255,'commands':_0x1cc9bd,'parentMenuView':_0x5cc240,'onExecute':_0x141fec});_0x5cc240['buttonView']['set']({'label':_0x509acc||_0x45f4c7}),_0x5cc240['delegate']('execute')['to'](_0x365dd7),_0x3349a0['items']['addMany'](_0x5c0c0b),_0x5cc240['panelView']['children']['add'](_0x3349a0),_0x246010['children']['add'](_0x5cc240),_0x4a08c1['items']['add'](_0x246010);}),_0x365dd7['panelView']['children']['add'](_0x4a08c1);}['_getMenuBarGroupButtons']({command:_0x4d654b,commands:_0x324923,parentMenuView:_0x8f9a38,onExecute:_0x3ffd7e}){const _0x2b3a21=this['editor'],_0x839659=_0x2b3a21['locale'];return U(_0x2b3a21,_0x324923)['map'](_0x5eb2c7=>{const _0x12e66a=new _0x4c364a(_0x839659,_0x8f9a38),_0x448c2c=new _0x31bbe5(_0x839659);return _0x448c2c['set']({'label':_0x5eb2c7['label']}),_0x448c2c['delegate']('execute')['to'](_0x8f9a38),_0x448c2c['on']('execute',()=>_0x3ffd7e(_0x5eb2c7['id'])),_0x448c2c['bind']('isEnabled')['to'](_0x4d654b,'enabledCommandsIds',_0x4acc32=>_0x4acc32['includes'](_0x5eb2c7['id'])),_0x12e66a['children']['add'](_0x448c2c),_0x12e66a;});}}function B(_0x4e4347,_0x3081d1){return void 0x0!==_0x4e4347['order']&&void 0x0===_0x3081d1['order']?0x1:void 0x0===_0x4e4347['order']&&void 0x0!==_0x3081d1['order']?-0x1:void 0x0!==_0x4e4347['order']&&void 0x0!==_0x3081d1['order']?_0x4e4347['order']-_0x3081d1['order']:0x0;}function U(_0x53b762,_0x3e1237){_0x3e1237['sort'](B);const _0x1b23cb={},_0x18294e=[];for(const _0x415939 of _0x3e1237)if(void 0x0!==_0x415939['order']){if(_0x415939['order']in _0x1b23cb)throw new _0x153b71('ai-commands-config-order-collision',_0x53b762,{'conflictingDefinitions':[_0x415939,_0x1b23cb[_0x415939['order']]]});_0x1b23cb[_0x415939['order']]=_0x415939,_0x18294e['splice'](_0x415939['order'],0x0,_0x415939);}else _0x18294e['push'](_0x415939);return _0x18294e;}class r extends _0x454c11{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xe67a39){super(_0xe67a39);const _0x3d8854=_0xe67a39['config'],_0x284ea4=_0xe67a39['locale'];_0x3d8854['define']('ai.aiAssistant.preserveComments',!0x0),_0x3d8854['define']('ai.aiAssistant.commands',function(_0x35a873){return[{'groupId':'editOrReview','groupLabel':i(_0x35a873,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x35a873,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x35a873,'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(_0x35a873,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x35a873,'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(_0x35a873,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x35a873,'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(_0x35a873,'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(_0x35a873,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x35a873,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x35a873,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x35a873,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x35a873,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x35a873,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x35a873,'Change\x20style'),'commands':[{'id':'business','label':i(_0x35a873,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x35a873,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x35a873,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x35a873,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x35a873,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x35a873,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x35a873,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x35a873,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x35a873,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x35a873,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x35a873,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x35a873,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x35a873,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x284ea4)),_0x3d8854['define']('ai.aiAssistant.extraCommandGroups',[]),_0x3d8854['define']('ai.aiAssistant.removeCommands',[]);let _0x37420a=o(_0x3d8854['get']('ai.aiAssistant.commands'),_0x284ea4);const _0xbb0962=_0x3d8854['get']('ai.aiAssistant.extraCommandGroups'),_0x42f0c6=_0x3d8854['get']('ai.aiAssistant.removeCommands');_0xbb0962['forEach'](_0x2b7e7c=>{const _0x9d33a2=_0x37420a['find'](_0x85db10=>_0x85db10['groupId']===_0x2b7e7c['groupId']);_0x9d33a2?_0x9d33a2['commands']=_0x9d33a2['commands']['concat'](_0x2b7e7c['commands']):_0x37420a['push'](_0x2b7e7c);}),_0x37420a=_0x37420a['filter'](_0x1412b2=>!_0x42f0c6['includes'](_0x1412b2['groupId'])),_0x37420a['forEach'](_0x5ec42e=>{_0x5ec42e['commands']=_0x5ec42e['commands']['filter'](_0x485b77=>!_0x42f0c6['includes'](_0x485b77['id']));}),_0x3d8854['set']('ai.aiAssistant.commands',_0x37420a);}}class P extends _0x454c11{['abortController'];static get['requires'](){return[K];}constructor(_0x506255){super(_0x506255),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'](_0x4f0ab5){return this['sendRequest'](_0x4f0ab5)['catch'](_0x59052b=>{if(_0x59052b instanceof R)return Promise['reject'](_0x59052b);if('AbortError'==_0x59052b['name'])return Promise['resolve']();throw console['error'](_0x59052b),new _0x153b71('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x269ffd,_0x5519d4){const _0x2dbe6a=this['editor']['locale'],_0x1d691c={'Content-Type':'application/json'};if('object'==typeof _0x269ffd)Object['assign'](_0x1d691c,_0x269ffd);else{if(_0x269ffd)try{const _0x513ddc=await _0x269ffd(_0x5519d4);Object['assign'](_0x1d691c,_0x513ddc);}catch(_0x1362e5){return Promise['reject'](new R(i(_0x2dbe6a,'AI_ERROR_GET_HEADERS')));}}return _0x1d691c;}async['_prepareRequestParameters'](_0x4e35cf,_0x256f01){const _0xde2ecb=this['editor']['locale'];if('object'==typeof _0x4e35cf)return _0x4e35cf;try{return await _0x4e35cf(_0x256f01);}catch(_0x3b638f){return Promise['reject'](new R(i(_0xde2ecb,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5c2772){super(_0x5c2772),_0x5c2772['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5c2772['config']['get']('ai.openAI.requestParameters')||_0x5c2772['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5c2772['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x5c2772['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x5c2772['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x3ff370,context:_0x4020c9,onData:_0x26a9d6,actionId:_0x260614}){const _0x2548a1=this['editor']['locale'],_0x1f3485=await this['prepareMessages'](_0x3ff370,_0x4020c9,_0x260614),_0x183ca4=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x260614),_0x561f32=await this['_prepareRequestParameters'](this['_requestParameters'],_0x260614),_0x2732eb={'messages':_0x1f3485,..._0x561f32},_0x3dbb51={'method':'POST','headers':_0x183ca4,'body':JSON['stringify'](_0x2732eb),'signal':this['abortController']['signal']},_0x482d4c=await fetch(this['_apiUrl'],_0x3dbb51);if(_0x482d4c['ok'])return _0x561f32['stream']?await this['_readStreamableResponse'](_0x482d4c,_0x26a9d6):await this['_readStaticResponse'](_0x482d4c,_0x26a9d6),Promise['resolve']();{const _0x531d48=await _0x482d4c['text']();return _0x531d48['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x2548a1,'AI_ERROR_CONTEXT_LENGTH'))):_0x531d48['includes']('Moderation')?Promise['reject'](new R(i(_0x2548a1,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x531d48));}}async['prepareMessages'](_0x2add30,_0x7c368c,_0x42894c){let _0xfc16c3,_0x217ab6;return _0x7c368c?(_0xfc16c3='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.',_0x217ab6='Instruction:\x0a'+_0x2add30+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x7c368c):(_0xfc16c3='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.',_0x217ab6=_0x2add30),[{'role':'system','content':_0xfc16c3},{'role':'user','content':_0x217ab6}];}async['_readStreamableResponse'](_0xf5f39e,_0x3bda04){const _0x80b490=_0xf5f39e['body']['getReader'](),_0x2b24a4=new TextDecoder();let _0xb75092='',_0x36ada6='',_0x4c939c='',_0x82904=!0x1;for(;!_0x82904;){const {done:_0x5b5b23,value:_0x2ed51a}=await _0x80b490['read'](),_0x431999=_0xb75092+_0x2b24a4['decode'](_0x2ed51a);let _0x337358='';_0x82904=_0x5b5b23;try{_0x337358=this['_cleanUpData'](_0x431999),_0xb75092='';}catch(_0x5bebae){_0xb75092=_0x431999;continue;}_0x36ada6+=_0x337358,!_0x82904&&this['_isBufferIncomplete'](_0x36ada6)||_0x36ada6&&(_0x4c939c+=_0x36ada6,_0x36ada6='',_0x3bda04(_0x4c939c));}return Promise['resolve']();}async['_readStaticResponse'](_0x61fc,_0x5611e8){return _0x5611e8((await _0x61fc['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x1c89d2){const _0x5282d7=_0x1c89d2['split']('<')['length']!==_0x1c89d2['split']('>')['length'],_0x532c22=_0x1c89d2['length']<0x1e;return _0x5282d7&&_0x532c22;}['_cleanUpData'](_0x73e74c){return _0x73e74c['split'](/\n(?![^{]*\})/g)['map'](_0x3c6957=>_0x3c6957['replace']('data:\x20',''))['filter'](_0x6ae4d0=>_0x6ae4d0&&_0x6ae4d0['length']>0x0&&'[DONE]'!==_0x6ae4d0)['map'](_0x3d6edf=>{const {choices:_0x83f620}=JSON['parse'](_0x3d6edf);if(_0x83f620[0x0]&&_0x83f620[0x0]['delta']&&_0x83f620[0x0]['delta']['content'])return _0x83f620[0x0]['delta']['content'];})['filter'](_0x31ead7=>_0x31ead7)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x56c814){super(_0x56c814),_0x56c814['config']['get']('ai.aws.requestParameters')||_0x56c814['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']=_0x56c814['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x56c814['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x56c814['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x56c814['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x132f79,context:_0x1014bf,onData:_0x5468ba,actionId:_0x2c2826}){const {model:_0x228300,stream:_0x1a9a1b,..._0x3a2946}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2c2826),_0x45c4ed={'prompt':await this['preparePrompt'](_0x132f79,_0x1014bf,_0x228300,_0x2c2826),..._0x3a2946};this['_apiUrl']?await this['_processProxyRequest'](_0x45c4ed,_0x228300,_0x1a9a1b,_0x5468ba,_0x2c2826):await this['_processAWSRequest'](_0x45c4ed,_0x228300,_0x1a9a1b,_0x5468ba);}async['preparePrompt'](_0x2f5387,_0x28ab04,_0x23a5c0,_0xaffde8){let _0x3f687b,_0x2a59c6;return _0x28ab04?(_0x3f687b='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.',_0x2a59c6='Instruction:\x0a'+_0x2f5387+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x28ab04):(_0x3f687b='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.',_0x2a59c6=_0x2f5387),'meta.llama'==this['getModelFamily'](_0x23a5c0)?'<<SYS>>\x0a'+_0x3f687b+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2a59c6+'\x0a[/INST]':'Human:\x0a'+_0x3f687b+'\x0a'+_0x2a59c6+'\x0a\x0aAssistant:';}['getModelFamily'](_0x290f28){if(/^anthropic\.claude/['test'](_0x290f28))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x290f28))return'ai21.j2';if(/^cohere\.command/['test'](_0x290f28))return'cohere.command';if(/^meta\.llama/['test'](_0x290f28))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x290f28));}async['_processProxyRequest'](_0x386430,_0xffcc81,_0x591ed9,_0x7d377b,_0x58fc55){const _0x53db63={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x58fc55),'body':JSON['stringify']({..._0x386430,'model':_0xffcc81,'stream':_0x591ed9}),'signal':this['abortController']['signal']},_0x3a669d=await fetch(this['_apiUrl'],_0x53db63);_0x591ed9?await this['_readStreamableResponse'](_0x3a669d,_0xffcc81,_0x7d377b):await this['_readStaticResponse'](_0x3a669d,_0xffcc81,_0x7d377b);}async['_processAWSRequest'](_0x17e004,_0x4b2074,_0x51cf7f,_0x53662f){const _0x5482f6=new _0x56414c(this['_bedrockClientConfig']),_0x1bdca6={'body':JSON['stringify'](_0x17e004),'contentType':'application/json','accept':'application/json','modelId':_0x4b2074};let _0x2f9271;if(_0x51cf7f){const _0xeee46f=new _0x5194b5(_0x1bdca6);_0x2f9271=await _0x5482f6['send'](_0xeee46f,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x2f9271,_0x4b2074,_0x53662f);}else{const _0x5c9429=new _0x5e7f9a(_0x1bdca6);_0x2f9271=await _0x5482f6['send'](_0x5c9429,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x2f9271,_0x4b2074,_0x53662f);}}async['_readAsyncIterableResponse'](_0xbd298f,_0x3f8719,_0x162cbb){const _0x2be00e=_0xbd298f['body'],_0x46339d=new TextDecoder('utf-8');let _0x43003e='';for await(const _0x4a326c of _0x2be00e)if(_0x4a326c['chunk']){const _0x2f3909=_0x46339d['decode'](_0x4a326c['chunk']['bytes']),_0x2ddd17=JSON['parse'](_0x2f3909);_0x43003e+=this['_getGeneratedText'](_0x2ddd17,_0x3f8719),_0x162cbb(_0x43003e);}return Promise['resolve']();}async['_readStreamableResponse'](_0x531cc3,_0x4a3c1b,_0x179998){const _0x315a49=_0x531cc3['body'],_0x199d43=new TextDecoder('utf-8'),_0x368a0c=_0x315a49['getReader']();let _0x164162='',_0x43fcf3='',_0x3680cb=!0x1;for(;!_0x3680cb;){const {done:_0x558925,value:_0xc4b1f8}=await _0x368a0c['read']();if(_0x3680cb=_0x558925,_0x3680cb)break;const _0x50fd1e=(_0x164162+_0x199d43['decode'](_0xc4b1f8))['split']('\x0a')['map'](_0x180741=>{try{return _0x164162='',JSON['parse'](_0x180741);}catch(_0x3f991a){return _0x164162=_0x180741,null;}})['filter'](_0x33a848=>null!==_0x33a848);_0x50fd1e['length']&&(_0x43fcf3+=_0x50fd1e['map'](_0x14ad5f=>this['_getGeneratedText'](_0x14ad5f,_0x4a3c1b))['join'](''),_0x179998(_0x43fcf3));}return Promise['resolve']();}async['_readStaticResponse'](_0x2112e9,_0x1410c3,_0x27fbcb){let _0x12ea11;return _0x12ea11=_0x2112e9 instanceof Response?await _0x2112e9['json']():JSON['parse'](Buffer['from'](_0x2112e9['body'])['toString']('utf8')),(_0x27fbcb(this['_getGeneratedText'](_0x12ea11,_0x1410c3)),Promise['resolve']());}['_getGeneratedText'](_0x56d11b,_0x179791){switch(this['getModelFamily'](_0x179791)){case'anthropic.claude':return _0x56d11b['completion'];case'ai21.j2':return _0x56d11b['completions'][0x0]['data']['text'];case'cohere.command':return _0x56d11b['generations'][0x0]['text'];case'meta.llama':return _0x56d11b['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}};
|