@ckeditor/ckeditor5-ai 46.0.1-alpha.4 → 46.0.1-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ai.js +1 -1
- package/dist/index.css +2 -2
- 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/be.js +1 -1
- package/dist/translations/be.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/theme/ai-form.css +2 -2
package/dist/index.css
CHANGED
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
@media screen and (max-width: 600px) {
|
|
198
198
|
.ck .ck-ai-form {
|
|
199
199
|
/* Allow the for the layout to be fluid in narrow viewports to avoid breaking it due to limited
|
|
200
|
-
* horizontal space (https://github.com/
|
|
200
|
+
* horizontal space (https://github.com/ckeditor/ckeditor5-commercial/issues/5913). */
|
|
201
201
|
--ck-ai-form-view-width: 100vw;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
}
|
|
332
332
|
/* Squash the textarea horizontally if necessary on narrow layouts
|
|
333
333
|
* to avoid breaking the layout even at the cost of the placeholder
|
|
334
|
-
* being cut off (https://github.com/
|
|
334
|
+
* being cut off (https://github.com/ckeditor/ckeditor5-commercial/issues/5913). */
|
|
335
335
|
@media screen and (max-width: 600px) {
|
|
336
336
|
.ck .ck-ai-form .ck-ai-form-content .ck-autocomplete .ck-textarea {
|
|
337
337
|
--ck-input-width: auto;
|
package/dist/index.js
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x176f29,Command as _0x27deb2}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x39010b,IconCheck as _0x2d2a40,IconError as _0x21ffa3,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x282791,IconRobotPencil as _0x3fcfb5}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x5b648e,CKEditorError as _0x2f33fd,ObservableMixin as _0x3432e3,global as _0x44ecdb,isVisible as _0x13b1e0,Rect as _0x5aa3a8,Collection as _0x8c49c7,FocusTracker as et,KeystrokeHandler as rt,first as _0x171255}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x21f3e2,View as _0x1877c1,SpinnerView as _0x4f0373,IconView as _0x22679d,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x4bd31b,createDropdown as _0x503ce9,addMenuToDropdown as _0x34cb00,MenuBarMenuView as _0x306c23,MenuBarMenuListItemButtonView as _0x377594,DialogViewPosition as _0xd3a8bc,MenuBarMenuListView as _0x334386,MenuBarMenuListItemView as _0x3fb2f1}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x3096a7,ClipboardMarkersUtils as _0x193153}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x5884e4,ViewDataTransfer as _0x24e6e6,ViewUpcastWriter as _0x3c990f,Matcher as _0x2ced42}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x3c3b78,InvokeModelWithResponseStreamCommand as _0x541f19,InvokeModelCommand as _0x232135}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x465a31,_0x371124){const _0x50fdd3=(0x0,_0x371124['t'])('Other');return _0x465a31['length']?'groupId'in _0x465a31[0x0]?_0x465a31:[{'groupId':K,'groupLabel':_0x50fdd3,'order':0x1/0x0,'commands':_0x465a31}]:[{'groupId':K,'groupLabel':_0x50fdd3,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x176f29{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x84c674}=this,_0x5515b5=['ck-fake-ai-selection'];_0x84c674['config']['get']('ai.useTheme')&&_0x5515b5['push']('ck-ai-assistant-ui_theme'),_0x84c674['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x5515b5,'priority':0xc}}),_0x84c674['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x458826,{writer:_0x5ca05b})=>{if(!_0x458826['markerRange']['isCollapsed'])return null;const _0x485444=_0x5ca05b['createUIElement']('span');return _0x5ca05b['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x485444),_0x485444;}});}['afterInit'](){!async function(_0xd5680){const _0x1ca0e1=_0x3a6218([0x37,0x72,0x32,0x6d,0x66,0x4d,0x70,0x39,0x6e,0x59,0x41,0x64,0x47,0x35,0x33,0x57,0x4f,0x7a,0x53,0x42,0x49,0x54,0x61,0x63,0x58,0x4a,0x65,0x78,0x51,0x4e,0x55,0x34,0x36,0x46,0x45,0x69,0x77,0x44,0x5a,0x6b,0x43,0x4b,0x75,0x79,0x31,0x38,0x74,0x68,0x71,0x50,0x52,0x48,0x67,0x73,0x6f,0x6c,0x62,0x4c,0x76,0x6a,0x30,0x56]),_0x3258f3=0x60240aac,_0x49e241=0x602365c4^_0x3258f3,_0x3108d2=window[_0x3a6218([0x44,0x61,0x74,0x65])][_0x3a6218([0x6e,0x6f,0x77])](),_0x5cbe87=_0xd5680[_0x3a6218([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4213f5=new window[(_0x3a6218([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x253de7=>{_0x5cbe87[_0x3a6218([0x6f,0x6e,0x63,0x65])](_0x3a6218([0x72,0x65,0x61,0x64,0x79]),_0x253de7);}),_0x198599={[_0x3a6218([0x6b,0x74,0x79])]:_0x3a6218([0x45,0x43]),[_0x3a6218([0x75,0x73,0x65])]:_0x3a6218([0x73,0x69,0x67]),[_0x3a6218([0x63,0x72,0x76])]:_0x3a6218([0x50,0x2d,0x32,0x35,0x36]),[_0x3a6218([0x78])]:_0x3a6218([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]),[_0x3a6218([0x79])]:_0x3a6218([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]),[_0x3a6218([0x61,0x6c,0x67])]:_0x3a6218([0x45,0x53,0x32,0x35,0x36])},_0x5c10d2=_0x5cbe87[_0x3a6218([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3a6218([0x67,0x65,0x74])](_0x3a6218([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x49238a(){let _0x45759c,_0x5df1b7=null,_0x226133=null;try{if(_0x5c10d2==_0x3a6218([0x47,0x50,0x4c]))return _0x3a6218([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x45759c=_0x4c1767(),!_0x45759c)return _0x3a6218([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x45759c[_0x3a6218([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x226133=_0x526800(_0x45759c[_0x3a6218([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x45759c[_0x3a6218([0x6a,0x74,0x69])])),await _0x3f62ac()?_0xbdd975()?_0x27a680()?_0x3a6218([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x5f1f3c()?(_0x45759c[_0x3a6218([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3a6218([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x5df1b7=_0x191248(_0x3a6218([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x45759c[_0x3a6218([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3a6218([0x74,0x72,0x69,0x61,0x6c])&&(_0x5df1b7=_0x191248(_0x3a6218([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0xef2349()):_0x3a6218([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3a6218([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3a6218([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3a6218([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x27a680(){const _0x2db7f1=[_0x3a6218([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3a6218([0x74,0x72,0x69,0x61,0x6c])][_0x3a6218([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x45759c[_0x3a6218([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3108d2/0x3e8:0xe10*_0x49e241;return _0x45759c[_0x3a6218([0x65,0x78,0x70])]<_0x2db7f1;}function _0xbdd975(){const _0x3e7254=_0x45759c[_0x3a6218([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3e7254&&(!!_0x3e7254[_0x3a6218([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3a6218([0x2a]))||!!_0x3e7254[_0x3a6218([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3a6218([0x41,0x49])));}function _0x5f1f3c(){const _0x23aba5=_0x45759c[_0x3a6218([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x23aba5||0x0==_0x23aba5[_0x3a6218([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1eb3fd}=new URL(window[_0x3a6218([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x23aba5[_0x3a6218([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1eb3fd))return!0x0;const _0x5c154b=_0x1eb3fd[_0x3a6218([0x73,0x70,0x6c,0x69,0x74])](_0x3a6218([0x2e]));return _0x23aba5[_0x3a6218([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3aa7ee=>_0x3aa7ee[_0x3a6218([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3a6218([0x2a])))[_0x3a6218([0x6d,0x61,0x70])](_0x448899=>_0x448899[_0x3a6218([0x73,0x70,0x6c,0x69,0x74])](_0x3a6218([0x2e])))[_0x3a6218([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1f3463=>_0x1f3463[_0x3a6218([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5c154b[_0x3a6218([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3a6218([0x6d,0x61,0x70])](_0x5d151c=>Array(_0x5c154b[_0x3a6218([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5d151c[_0x3a6218([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3a6218([0x66,0x69,0x6c,0x6c])](_0x5d151c[0x0]===_0x3a6218([0x2a])?_0x3a6218([0x2a]):'')[_0x3a6218([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5d151c))[_0x3a6218([0x73,0x6f,0x6d,0x65])](_0x2b51aa=>_0x5c154b[_0x3a6218([0x65,0x76,0x65,0x72,0x79])]((_0x1301f6,_0x2b71b5)=>_0x2b51aa[_0x2b71b5]===_0x1301f6||_0x2b51aa[_0x2b71b5]===_0x3a6218([0x2a])));}function _0xef2349(){return _0x5df1b7&&_0x226133?new window[(_0x3a6218([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4b45e3,_0x5ae206)=>{_0x5df1b7[_0x3a6218([0x74,0x68,0x65,0x6e])](_0x4b45e3,_0x5ae206),_0x226133[_0x3a6218([0x74,0x68,0x65,0x6e])](_0x315dac=>{_0x315dac!=_0x3a6218([0x56,0x61,0x6c,0x69,0x64])&&_0x4b45e3(_0x315dac);},_0x5ae206);}):_0x5df1b7||_0x226133||_0x3a6218([0x56,0x61,0x6c,0x69,0x64]);}}function _0x526800(_0x280784,_0x38a3a6){return new window[(_0x3a6218([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4d263c=>{if(_0x5bc62a())return _0x4d263c(_0x3a6218([0x56,0x61,0x6c,0x69,0x64]));_0x302f22(),_0x5cbe87[_0x3a6218([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3a6218([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x18a846=!0x1;const _0x159491=_0x5b648e();function _0x10c892(_0x1b322a){return!!_0x1b322a&&(typeof _0x1b322a===_0x3a6218([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x1b322a===_0x3a6218([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x1b322a[_0x3a6218([0x74,0x68,0x65,0x6e])]===_0x3a6218([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x1b322a[_0x3a6218([0x63,0x61,0x74,0x63,0x68])]===_0x3a6218([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1facb6(_0xef9c55){_0x3194a5(_0xef9c55)[_0x3a6218([0x74,0x68,0x65,0x6e])](_0x44eb5b=>{if(!_0x44eb5b||_0x44eb5b[_0x3a6218([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3a6218([0x6f,0x6b]))return _0x3a6218([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x165980(_0x5a583f(_0x159491+_0x38a3a6))!=_0x44eb5b[_0x3a6218([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3a6218([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3a6218([0x56,0x61,0x6c,0x69,0x64]);})[_0x3a6218([0x74,0x68,0x65,0x6e])](_0x3ca8b7=>(_0x5b3a21(),_0x3ca8b7),()=>{const _0x3e6133=_0x120377();return null==_0x3e6133?(_0x5b3a21(),_0x3a6218([0x56,0x61,0x6c,0x69,0x64])):_0x3a6218(_0x3108d2-_0x3e6133>(0x44288eac^_0x3258f3)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3a6218([0x74,0x68,0x65,0x6e])](_0x4d263c)[_0x3a6218([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4d263c(_0x3a6218([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x320be3=0x6012e42c^_0x3258f3;function _0x5b3a21(){const _0x4a59c9=_0x3a6218([0x6c,0x6c,0x63,0x74,0x2d])+_0x165980(_0x5a583f(_0x280784)),_0x158d7c=_0x589768(_0x165980(window[_0x3a6218([0x4d,0x61,0x74,0x68])][_0x3a6218([0x63,0x65,0x69,0x6c])](_0x3108d2/_0x320be3)));window[_0x3a6218([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3a6218([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4a59c9,_0x158d7c);}function _0x120377(){const _0x4ab3a6=_0x3a6218([0x6c,0x6c,0x63,0x74,0x2d])+_0x165980(_0x5a583f(_0x280784)),_0x4d21b7=window[_0x3a6218([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3a6218([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4ab3a6);return _0x4d21b7?window[_0x3a6218([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x589768(_0x4d21b7),0x10)*_0x320be3:null;}function _0x3194a5(_0x116852){return new window[(_0x3a6218([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5b197d,_0x1e0ffd)=>{_0x116852[_0x3a6218([0x74,0x68,0x65,0x6e])](_0x5b197d,_0x1e0ffd),window[_0x3a6218([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x1e0ffd,0x6025de6c^_0x3258f3);});}}_0x5cbe87[_0x3a6218([0x6f,0x6e])](_0x3a6218([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x228d2e,_0x2382db)=>{if(_0x2382db[0x0]!=_0x280784)return _0x4d263c(_0x3a6218([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x2382db[0x1]={..._0x2382db[0x1],[_0x3a6218([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x159491};},{[_0x3a6218([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3a6218([0x68,0x69,0x67,0x68])}),_0x5cbe87[_0x3a6218([0x6f,0x6e])](_0x3a6218([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x6e5435=>{_0x10c892(_0x6e5435[_0x3a6218([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x18a846=!0x0,_0x1facb6(_0x6e5435[_0x3a6218([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3a6218([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3a6218([0x6c,0x6f,0x77])}),_0x4213f5[_0x3a6218([0x74,0x68,0x65,0x6e])](()=>{_0x18a846||_0x4d263c(_0x3a6218([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5bc62a(){return _0x5cbe87[_0x3a6218([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3a6218([0x76,0x69,0x65,0x77])][_0x3a6218([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3a6218([0x61,0x75,0x74,0x6f]);}function _0x302f22(){_0x5cbe87[_0x3a6218([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3a6218([0x76,0x69,0x65,0x77])][_0x3a6218([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3a6218([0x61,0x75,0x74,0x6f]);}}function _0x191248(_0x5cd8e4){const _0x1dbb2a=[new window[(_0x3a6218([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x523da7=>setTimeout(_0x523da7,0x602d3460^_0x3258f3)),_0x4213f5[_0x3a6218([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3a6218([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2ce6d4=>{let _0x18fdc7=0x0;_0x5cbe87[_0x3a6218([0x6d,0x6f,0x64,0x65,0x6c])][_0x3a6218([0x6f,0x6e])](_0x3a6218([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x46d883,_0x18ea68)=>{_0x18ea68[0x0][_0x3a6218([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x18fdc7++,_0x18fdc7==(0x60240b54^_0x3258f3)&&(_0x2ce6d4(),_0x46d883[_0x3a6218([0x6f,0x66,0x66])]());});}))];return window[_0x3a6218([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3a6218([0x72,0x61,0x63,0x65])](_0x1dbb2a)[_0x3a6218([0x74,0x68,0x65,0x6e])](()=>_0x5cd8e4);}async function _0x553e72(){await _0x4213f5,_0x5cbe87[_0x3a6218([0x6d,0x6f,0x64,0x65,0x6c])][_0x3a6218([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x39c7d8,_0x5cbe87[_0x3a6218([0x6d,0x6f,0x64,0x65,0x6c])][_0x3a6218([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x39c7d8,_0x5cbe87[_0x3a6218([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3a6218([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x58d537(_0x39baf0){const _0x10b1cb=_0x10c73d();_0x5cbe87[_0x10b1cb]=_0x3a6218([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x39baf0,_0x39baf0!=_0x3a6218([0x56,0x61,0x6c,0x69,0x64])&&_0x553e72();}function _0x10c73d(){const _0x301997=window[_0x3a6218([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3a6218([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3a6218([0x6e,0x6f,0x77])]())[_0x3a6218([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3a6218([0x2e]),'');let _0x54f5e5=_0x3a6218([0x72]);for(let _0x2d5267=0x0;_0x2d5267<_0x301997[_0x3a6218([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2d5267+=0x2){let _0x102e03=window[_0x3a6218([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x301997[_0x3a6218([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2d5267,_0x2d5267+0x2));_0x102e03>=_0x1ca0e1[_0x3a6218([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x102e03-=_0x1ca0e1[_0x3a6218([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x54f5e5+=_0x1ca0e1[_0x102e03];}return _0x54f5e5;}function _0x4c1767(){const _0x1375c2=_0x5c10d2[_0x3a6218([0x73,0x70,0x6c,0x69,0x74])](_0x3a6218([0x2e]));if(0x3!=_0x1375c2[_0x3a6218([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x2ebc34(_0x1375c2[0x1]);function _0x2ebc34(_0x41277d){const _0xae3332=_0x3c9bbd(_0x41277d);return _0xae3332&&_0x3fd5cd()?_0xae3332:null;function _0x3fd5cd(){const _0x1ddf60=_0xae3332[_0x3a6218([0x6a,0x74,0x69])],_0x456d22=window[_0x3a6218([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1ddf60[_0x3a6218([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1ddf60[_0x3a6218([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x1a8b8e={..._0xae3332,[_0x3a6218([0x6a,0x74,0x69])]:_0x1ddf60[_0x3a6218([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x1ddf60[_0x3a6218([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x1a8b8e[_0x3a6218([0x76,0x63])],_0x5a583f(_0x1a8b8e)==_0x456d22;}}}async function _0x3f62ac(){let _0x5ac692=!0x0;try{const _0x2eb4f2=_0x5c10d2[_0x3a6218([0x73,0x70,0x6c,0x69,0x74])](_0x3a6218([0x2e])),[_0xccfef7,_0x3f55da,_0x4d10f5]=_0x2eb4f2;return _0xca6cf4(_0xccfef7),await _0x23c38a(_0xccfef7,_0x3f55da,_0x4d10f5),_0x5ac692;}catch{return!0x1;}function _0xca6cf4(_0x5d980d){const _0x452acd=_0x3c9bbd(_0x5d980d);_0x452acd&&_0x452acd[_0x3a6218([0x61,0x6c,0x67])]==_0x3a6218([0x45,0x53,0x32,0x35,0x36])||(_0x5ac692=!0x1);}async function _0x23c38a(_0x41d586,_0x2e4c63,_0xa36821){const _0x3256fd=window[_0x3a6218([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3a6218([0x66,0x72,0x6f,0x6d])](_0x52b3e8(_0xa36821),_0x4b226b=>_0x4b226b[_0x3a6218([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2876e0=new window[(_0x3a6218([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3a6218([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x41d586+_0x3a6218([0x2e])+_0x2e4c63),_0x5735b7=window[_0x3a6218([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3a6218([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x5735b7)return;const _0x42778f=await _0x5735b7[_0x3a6218([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3a6218([0x6a,0x77,0x6b]),_0x198599,{[_0x3a6218([0x6e,0x61,0x6d,0x65])]:_0x3a6218([0x45,0x43,0x44,0x53,0x41]),[_0x3a6218([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3a6218([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3a6218([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x5735b7[_0x3a6218([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3a6218([0x6e,0x61,0x6d,0x65])]:_0x3a6218([0x45,0x43,0x44,0x53,0x41]),[_0x3a6218([0x68,0x61,0x73,0x68])]:{[_0x3a6218([0x6e,0x61,0x6d,0x65])]:_0x3a6218([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x42778f,_0x3256fd,_0x2876e0)||(_0x5ac692=!0x1);}}function _0x3c9bbd(_0x599602){return _0x599602[_0x3a6218([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3a6218([0x65,0x79]))?JSON[_0x3a6218([0x70,0x61,0x72,0x73,0x65])](_0x52b3e8(_0x599602)):null;}function _0x52b3e8(_0x3309a5){return window[_0x3a6218([0x61,0x74,0x6f,0x62])](_0x3309a5[_0x3a6218([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3a6218([0x2b]))[_0x3a6218([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3a6218([0x2f])));}function _0x5a583f(_0x25391b){let _0x2e26d2=0x1505;function _0x346aaa(_0x32ab1d){for(let _0x341b82=0x0;_0x341b82<_0x32ab1d[_0x3a6218([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x341b82++){const _0x3e385d=_0x32ab1d[_0x3a6218([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x341b82);_0x2e26d2=(_0x2e26d2<<0x5)+_0x2e26d2+_0x3e385d,_0x2e26d2&=_0x2e26d2;}}function _0x1af180(_0x1404d5){Array[_0x3a6218([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x1404d5)?_0x1404d5[_0x3a6218([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x1af180):_0x1404d5&&typeof _0x1404d5==_0x3a6218([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3a6218([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x1404d5)[_0x3a6218([0x73,0x6f,0x72,0x74])]()[_0x3a6218([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x272f24,_0x57f885])=>{_0x346aaa(_0x272f24),_0x1af180(_0x57f885);}):_0x346aaa(window[_0x3a6218([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x1404d5));}return _0x1af180(_0x25391b),_0x2e26d2>>>0x0;}function _0x165980(_0x595356){return _0x595356[_0x3a6218([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3a6218([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3a6218([0x30]));}function _0x589768(_0x260933){return _0x260933[_0x3a6218([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3a6218([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3a6218([0x6a,0x6f,0x69,0x6e])]('');}function _0x39c7d8(){}function _0x3a6218(_0x244004){return _0x244004['map'](_0x126faa=>String['fromCharCode'](_0x126faa))['join']('');}_0x58d537(await _0x49238a());}(this);}['showFakeVisualSelection'](){const _0x3c511e=this['editor']['model'];_0x3c511e['change'](_0x134f06=>{const _0x29b43a=_0x3c511e['document']['selection']['getRanges']();let _0x4881b1=0x0;for(const _0x2f0da1 of _0x29b43a){const _0x4c0563=w+':'+_0x4881b1;if(_0x3c511e['markers']['has'](_0x4c0563))_0x134f06['updateMarker'](_0x4c0563,{'range':_0x2f0da1});else{if(_0x2f0da1['start']['isAtEnd']){const _0x257be1=_0x2f0da1['start']['getLastMatchingPosition'](({item:_0x250389})=>!_0x3c511e['schema']['isContent'](_0x250389),{'boundaries':_0x2f0da1});_0x134f06['addMarker'](_0x4c0563,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x134f06['createRange'](_0x257be1,_0x2f0da1['end'])});}else _0x134f06['addMarker'](_0x4c0563,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2f0da1});}_0x4881b1++;}});}['hideFakeVisualSelection'](){const _0x5e1e3c=this['editor']['model'],_0x4164d7=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x4164d7['length']&&_0x5e1e3c['change'](_0x168c64=>{_0x4164d7['forEach'](_0x1ab40a=>{_0x168c64['removeMarker'](_0x1ab40a);});});}['insertContent'](_0x4e1506,_0x1c0af0){const _0x5b73d2=this['_getAISelection'](),_0x3f5728=_0x1c0af0||_0x5b73d2['getFirstRange']();this['editor']['model']['canEditAt'](_0x3f5728)&&this['editor']['model']['change'](_0x48e94a=>{this['hideFakeVisualSelection'](),_0x1c0af0||this['_resetContentOfSelectedTableCells'](_0x48e94a,_0x5b73d2),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3f5728,'writer':_0x48e94a,'html':_0x4e1506});});}['insertContentBelow'](_0x5dac37){const {model:_0x15f48d}=this['editor'],_0x41069f=this['_getAISelection']();_0x15f48d['change'](()=>{const _0xfa1dab=this['_prepareTableInsertBelowPosition'](_0x5dac37,_0x41069f)||this['_getDefaultInsertBelowPosition'](_0x41069f);this['insertContent'](_0x5dac37,_0xfa1dab);});}['_getAISelection'](){const _0x5c0252=this['editor']['model'],_0x28a470=Array['from'](_0x5c0252['markers']['getMarkersGroup'](w))['map'](_0x3bd68f=>_0x3bd68f['getRange']());return _0x5c0252['createSelection'](_0x28a470);}['_pasteHTMLUsingClipboard']({writer:_0x1cab39,html:_0x8561d6,insertAt:_0x2ac7b0}){const {view:_0xca100c}=this['editor']['editing'],_0x541af4=this['editor']['plugins']['get'](_0x3096a7),_0x27c8b4=new gt();_0x27c8b4['setData']('text/html',_0x8561d6);const _0x5f4a8b=new ClipboardEvent('paste',{'clipboardData':_0x27c8b4}),_0x1a6aa2=new _0x5884e4(_0xca100c,_0x5f4a8b,{'dataTransfer':new _0x24e6e6(_0x27c8b4)});_0x1cab39['setSelection'](_0x2ac7b0);const _0x3fa4f2=(_0x3db932,_0x4c2fd6)=>{_0x4c2fd6['resultRange']&&_0x1cab39['setSelection'](_0x4c2fd6['resultRange']);};_0x541af4['once']('contentInsertion',_0x3fa4f2,{'priority':'lowest'}),_0xca100c['document']['fire']('paste',_0x1a6aa2),_0x541af4['off']('contentInsertion',_0x3fa4f2);}['_getDefaultInsertBelowPosition'](_0x2dd504){const {model:_0x2f3ab5}=this['editor'],_0x2d3365=Array['from'](_0x2dd504['getSelectedBlocks']());return _0x2d3365['length']?_0x2f3ab5['createPositionAfter'](_0x2d3365['pop']()):_0x2dd504['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x5754e7,_0x43481c){const {model:_0x528972,plugins:_0x2325c1}=this['editor'];if(_0x2325c1['has']('TableUtils')){const _0x2a380d=_0x2325c1['get']('TableUtils')['getSelectedTableCells'](_0x43481c);if(_0x2a380d['length']){const _0x46116f=this['_getTableRowCountFromContent'](_0x5754e7),_0x2fde4d=this['_createEmptyTableRows'](_0x2a380d,_0x46116f);return _0x528972['createPositionAt'](_0x2fde4d,0x0);}}return null;}['_getTableRowCountFromContent'](_0x959d10){const _0x3287bb=this['editor']['plugins']['get']('TableUtils'),_0x1bfb8a=this['editor']['data']['parse'](_0x959d10),_0x402604=Array['from'](_0x1bfb8a['getChildren']())['filter'](_0x3048b6=>_0x3048b6['is']('element','table'));let _0x1ffe52=0x0;return _0x402604['forEach'](_0x189b0d=>{_0x1ffe52+=_0x3287bb['getRows'](_0x189b0d);}),_0x1ffe52;}['_createEmptyTableRows'](_0x22fef6,_0x336db1){const _0x5e1696=this['editor']['plugins']['get']('TableUtils'),_0x4e8d2e=_0x5e1696['getRowIndexes'](_0x22fef6),_0x3d06c7=_0x5e1696['getColumnIndexes'](_0x22fef6),_0x4cdf1e=_0x4e8d2e['last']+0x1,_0x58dd25=_0x3d06c7['first'],_0x1d172e=_0x22fef6[0x0]['findAncestor']('table');for(let _0x1dbc60=0x0;_0x1dbc60<_0x336db1;_0x1dbc60++)_0x5e1696['insertRows'](_0x1d172e,{'at':_0x4cdf1e});return _0x1d172e['getChild'](_0x4cdf1e)['getChild'](_0x58dd25);}['_resetContentOfSelectedTableCells'](_0x1370a7,_0x302e55){const {plugins:_0x12d8dc}=this['editor'],{model:_0x4ff75c}=_0x1370a7;if(!_0x12d8dc['has']('TableUtils'))return;_0x12d8dc['get']('TableUtils')['getSelectedTableCells'](_0x302e55)['length']&&_0x4ff75c['deleteContent'](_0x302e55);}}class x extends _0x176f29{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x2f33fd('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x43ad66){super(_0x43ad66),this['name']='AIRequestError';}}function i(_0x3dba0f,_0x308087,_0x22a67e){const t=_0x3dba0f['t'];switch(_0x308087){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',_0x22a67e);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x22a67e);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'},_0x22a67e);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 _0x308087;}}class E extends _0x27deb2{['_commandDefinitions'];constructor(_0x108fa5,_0x2039d6){super(_0x108fa5),this['_commandDefinitions']=_0x2039d6,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x5240a7,_0x52ae5c,_0x12da8a)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x12da8a));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x251bcc,_0x3c0b6e,_0x4ce22c)=>{this['enabledCommandsIds']=_0x4ce22c?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x1f0dc0=this['editor']['model'];this['_hasContext']=function(_0x3048dc){const _0x2381af=_0x3048dc['document']['selection'];return _0x2381af['isCollapsed']?0x0!==[..._0x2381af['getSelectedBlocks']()]['length']&&![..._0x2381af['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x3048dc['hasContent'](_0x2381af['getFirstRange']());}(_0x1f0dc0);const _0x3baf2f=_0x1f0dc0['document']['selection'],_0x140770=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x3315db of _0x3baf2f['getRanges']())for(const _0x48b15c of _0x3315db['getItems']())if(_0x48b15c['is']('element')&&_0x140770['includes'](_0x48b15c['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x50e877='',_0x49bca6='',_0x58d72e='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x50e877,_0x49bca6,_0x58d72e);}}function F(_0x1ff621,_0x34e6b0){const _0x4263f0=new Set();for(const _0x249dcb of _0x1ff621['values']())(_0x34e6b0||!0x1===_0x249dcb['requiresContent'])&&_0x4263f0['add'](_0x249dcb['id']);return Array['from'](_0x4263f0);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x3432e3(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3f521a,_0x4a3e93,_0xa8dddd){super(),this['editor']=_0x3f521a,this['textAdapter']=_0x4a3e93,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xa8dddd,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x53c99d,_0x2fdd9e,_0x13108e)=>{this['view']['value']=this['_sanitizeHTML'](_0x13108e);}),this['listenTo'](this['view'],'submitPrompt',(_0x174847,_0x27f766)=>{const _0x36fd03=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x27f766,_0x36fd03,'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:_0xbb9c06,query:_0x33c48a,htmlContent:_0x364e90,label:_0x421c5a,mainActionLabel:_0x412e20}){this['view']['prompt']=_0x421c5a,this['view']['mainAction']=_0x412e20,this['initialContext']=_0x364e90,_0x33c48a&&(this['view']['isRendered']?this['_handleQuery'](_0x33c48a,_0x364e90,_0xbb9c06,_0x421c5a):this['view']['once']('render',()=>{this['_handleQuery'](_0x33c48a,_0x364e90,_0xbb9c06,_0x421c5a);}));}['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'](_0x57132e,_0x1258e4,_0x390512,_0x20afc7){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x1258e4,this['previousQuery']=_0x57132e,this['previousLabel']=_0x20afc7||_0x57132e,this['previousActionId']=_0x390512,new Promise(_0x4d8788=>{this['textAdapter']['makeRequest']({'query':_0x57132e,'context':_0x1258e4,'onData':_0x278e4b=>{this['currentResponse']=_0x278e4b,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x390512})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x40a715=>{_0x40a715 instanceof R?this['view']['handleError'](_0x40a715['message']):this['view']['handleError'](),_0x4d8788();})['finally'](()=>{this['stopProcessing'](),_0x4d8788();});});}['_parseAndNormalizeContent'](_0x29d63a,_0x1cc415=!0x1){const _0x2b20ce=Q['exec'](_0x29d63a);_0x29d63a=_0x2b20ce?_0x29d63a['substring'](_0x2b20ce[0x1]['length']):_0x29d63a['length']<0x64&&!_0x1cc415?'':this['_stripMarkdownSyntax'](_0x29d63a);const _0x3b3a1c=this['_domParser']['parseFromString'](_0x29d63a,'text/html');if(_0x2b20ce){const _0x13000c=Array['from'](_0x3b3a1c['body']['childNodes']);_0x13000c['reverse']();for(const _0x454a99 of _0x13000c){if(_0x454a99['nodeType']==Node['ELEMENT_NODE'])break;_0x454a99['remove']();}}const _0x1fee96=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x3b3a1c['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1fee96);const _0x518530=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x2095de=this['editor']['data']['toModel'](_0x1fee96);return _0x518530||_0x2095de['markers']['clear'](),this['editor']['data']['stringify'](_0x2095de);}['_normalizeResponseHeadings'](_0x461adc){const _0x48a575=new _0x3c990f(this['editor']['editing']['view']['document']),_0x229001=new _0x2ced42({'name':/^h[1-5]$/}),_0x14ae65=[];let _0x3c72e5=!0x1;for(const _0x3c241e of _0x461adc)_0x3c241e['is']('element')&&_0x229001['match'](_0x3c241e)&&(_0x14ae65['push'](_0x3c241e),'h1'==_0x3c241e['name']&&(_0x3c72e5=!0x0));if(_0x3c72e5){for(const _0x371e75 of _0x14ae65)_0x48a575['rename']('h'+(parseInt(_0x371e75['name'][0x1])+0x1),_0x371e75);}}['_isH1TagSupportEnabled'](){const {data:_0x37f1f8,editing:_0x4bae4c}=this['editor'],_0x6491ae=_0x37f1f8['htmlProcessor']['toView']('<h1></h1>'),_0x49b53f=_0x37f1f8['toView'](_0x37f1f8['toModel'](_0x6491ae));return!!_0x4bae4c['view']['domConverter']['viewToDom'](_0x49b53f)['querySelector']('h1');}['_sanitizeHTML'](_0x2968c3){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2968c3),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x41483d){const _0x4d8838=_0x41483d['trim']();return _0x4d8838['startsWith']('```html')?_0x4d8838['endsWith']('```')?_0x4d8838['substring'](0x7,_0x4d8838['length']-0x3):_0x4d8838['substring'](0x7):_0x41483d;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x18bb7a){super(_0x18bb7a),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4e5bf0=>i(_0x18bb7a,'AI_'+_0x4e5bf0['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x18bb7a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x18bb7a,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x18bb7a,'Stop'));const _0x47699b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x47699b['if']('isVisible','ck-hidden',_0x1f1011=>!_0x1f1011)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x228634,_0x4191f9){const _0x47e274=new _0x21f3e2(this['locale']);return _0x47e274['set']({'label':_0x228634,'class':_0x4191f9||'','isVisible':!0x0,'withText':!0x0}),_0x47e274;}}class ct extends _0x1877c1{['contentFieldView'];['copyButtonView'];constructor(_0x582d9f,_0x47a30a=''){super(_0x582d9f),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1a83cf=this['bindTemplate'];this['contentFieldView']=new bt(_0x582d9f,_0x47a30a),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1a83cf['if']('isVisible','ck-hidden',_0x372ec6=>!_0x372ec6)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1a83cf['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 _0x336b0=!0x1;this['on']('change:value',(_0x45c436,_0x242c8b,_0x2af081)=>{const _0x16caae=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2af081),this['isProcessing']&&_0x16caae&&!_0x336b0&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x5b525e,_0x3731a6,_0x14be92)=>{_0x336b0=!0x1,_0x14be92?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x336b0=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x336b0=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x55c878=this['locale'],_0x1d2afa=new _0x21f3e2(this['locale']),_0x2a1c8f='ck-ai-form__copy-button';return _0x1d2afa['set']({'label':i(_0x55c878,'Copy'),'icon':_0x39010b,'class':_0x2a1c8f,'tooltip':!0x0}),_0x1d2afa['bind']('isVisible')['to'](this,'value',_0x41ccb7=>!!_0x41ccb7),_0x1d2afa['bind']('isEnabled')['to'](this,'isProcessing',_0x8021a7=>!_0x8021a7),_0x1d2afa['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x1d2afa['icon']=_0x2d2a40,_0x1d2afa['class']=_0x2a1c8f+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x1d2afa['icon']=_0x39010b,_0x1d2afa['class']=_0x2a1c8f;},0x3e8);}),_0x1d2afa;}['_copyHTMLToClipboard'](_0x193880){const {window:_0x44804e,document:_0x30932c}=_0x44ecdb;if(_0x44804e['ClipboardItem']){const {Blob:_0xb10cf1,ClipboardItem:_0x188ee1}=_0x44804e,_0x18ca46=[new _0x188ee1({'text/html':new _0xb10cf1([_0x193880['innerHTML']],{'type':'text/html'}),'text/plain':new _0xb10cf1([_0x193880['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x18ca46);}else{const _0x3c29f3=_0x30932c['createElement']('div');_0x3c29f3['style']['position']='absolute',_0x3c29f3['style']['left']='-9999px',_0x3c29f3['innerHTML']='<span>[</span>'+_0x193880['innerHTML']+'<span>]</span>',_0x30932c['body']['appendChild'](_0x3c29f3);const _0x7241d4=_0x30932c['createRange']();_0x7241d4['setStartAfter'](_0x3c29f3['firstElementChild']),_0x7241d4['setEndBefore'](_0x3c29f3['lastElementChild']);const _0x367c6f=_0x44804e['getSelection']();_0x367c6f['removeAllRanges'](),_0x367c6f['addRange'](_0x7241d4),_0x30932c['execCommand']('copy'),_0x3c29f3['remove']();}}}class bt extends _0x1877c1{constructor(_0x3bd953,_0x237315=''){super(_0x3bd953),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x237315,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x45f42d){this['element']['innerHTML']=_0x45f42d;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x11eb15=new _0x1877c1(),_0x49fa74=this['locale'],_0x4fe2cc=new _0x4f0373();return _0x4fe2cc['isVisible']=!0x0,_0x11eb15['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x4fe2cc,{'text':i(_0x49fa74,'AI\x20is\x20writing...')}]}),_0x11eb15['render'](),_0x11eb15;}}class mt extends _0x1877c1{constructor(_0x23e90b,_0x57e0d2=''){super(_0x23e90b);const _0x3d386f=new _0x22679d(),_0x297516=this['bindTemplate'];this['set']('text',_0x57e0d2),_0x3d386f['content']=_0x21ffa3,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x3d386f,{'text':_0x297516['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x58a152,_0x350356){super(_0x58a152,_0x350356),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',(_0x417eb1,_0x578398)=>{_0x417eb1['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x578398());});}['_createSubmitButton'](){const _0x4411d5=new _0x21f3e2(this['locale']),_0x10798e=this['locale'];return _0x4411d5['set']({'icon':it,'label':i(_0x10798e,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x4411d5['on']('execute',()=>{this['submit']();}),_0x4411d5['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2776b0,_0x1cffed)=>!_0x2776b0&&_0x1cffed),_0x4411d5;}['_createShowHistoryButton'](){const _0x30a884=new _0x21f3e2(this['locale']),_0x4408e2=this['resultsView'],_0x140806=this['locale'];_0x30a884['set']({'label':i(_0x140806,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x30a884['bind']('isOn')['to'](_0x4408e2,'isVisible'),_0x30a884['bind']('isEnabled')['to'](this,'isEnabled'),_0x30a884['on']('execute',()=>{_0x4408e2['isVisible']=!_0x4408e2['isVisible'],_0x4408e2['isVisible']?this['filteredView']['focus']():this['focus']();});const _0xe2deff=()=>{_0x44ecdb['window']['requestAnimationFrame'](()=>{if(_0x13b1e0(this['element'])){const _0x19eda6=new _0x5aa3a8(this['queryView']['fieldView']['element']),_0xf6b570=_0x19eda6['width'],_0xd4d2af='rtl'===_0x140806['uiLanguageDirection']?'left':'right';_0x19eda6['excludeScrollbarsAndBorders'](),_0x30a884['element']['style'][_0xd4d2af]=_0xf6b570-_0x19eda6['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0xe2deff),this['on']('render',_0xe2deff),_0x30a884;}['submit'](){const _0x39d4db=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x39d4db);}['focus'](_0xdc4887){-0x1===_0xdc4887?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x235718){super(_0x235718),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x235718,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x46644c=0x0;for(const _0x3eef7e of this['items'])_0x46644c+=_0x3eef7e['items']['length'];return{'resultsCount':_0x46644c,'totalItemsCount':_0x46644c};}['_createClearHistoryButton'](){const _0x303931=this['locale'],_0x34a9a5=new _0x21f3e2(this['locale']);return _0x34a9a5['set']({'label':'('+i(_0x303931,'Clear')+')','withText':!0x0}),_0x34a9a5['on']('execute',()=>this['fire']('clearHistory')),_0x34a9a5;}}class ut extends xt{constructor(_0x3a76a0){super();const _0x38643e=new wt(),_0x37c1c4=new _0x21f3e2(this['locale'],_0x38643e);this['children']['add'](_0x37c1c4),_0x37c1c4['set']({'label':_0x3a76a0['prompt'],'withText':!0x0}),_0x37c1c4['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x3a76a0['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x8c49c7{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4528a4,_0xbc8f5c)=>{const _0x26748d=os(_0xbc8f5c['prompt']);for(const _0x133be5 of this)if(_0x133be5!=_0xbc8f5c&&os(_0x133be5['prompt'])===_0x26748d){this['remove'](_0x133be5);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x551b00=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x551b00));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x367ca7=>_0x367ca7)));}}function os(_0x4218e5){return _0x4218e5['toLowerCase']()['trim']();}class k extends _0x1877c1{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4df907,_0x4a9174,_0x5388d=''){super(_0x4df907),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x4df907),this['contentArea']=new ct(_0x4df907,_0x5388d),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 et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'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 _0x5e5482=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4a9174],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x5e5482['if']('isError','ck-hidden',_0x1318e8=>!_0x1318e8)]},'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'](_0x3831a0=0x1){-0x1===_0x3831a0?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 _0x4361eb=this['locale'],_0x5d906f=new lt(_0x4361eb,{'queryView':{'label':i(_0x4361eb,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x4361eb,'Empty\x20history'),'secondary':i(_0x4361eb,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5d906f['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x5a084e,_0x10ebf9)=>_0x5a084e&&!_0x10ebf9),this['listenTo'](_0x5d906f,'submit',(_0x217fd5,_0x12fbce)=>{this['prompt']=_0x12fbce;const _0x3308c1=ft(_0x12fbce);this['fire']('submitPrompt',_0x3308c1),_0x12fbce['trim']()&&this['_promptHistory']['add']({'prompt':_0x3308c1},0x0);},{'priority':'high'}),_0x5d906f;}['_createHistoryView'](){const _0x3ad921=new pt(this['locale']);return _0x3ad921['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x3ad921['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3ad921;}['_createToolbar'](){const _0x2d7eff=new at(this['locale']);return _0x2d7eff['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5704dc,_0x215ee0,_0x45d8d9)=>_0x5704dc&&!_0x215ee0&&!!_0x45d8d9),_0x2d7eff['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2d7eff['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4a5757,_0x1ab503,_0xa1b9f6)=>_0x4a5757&&!_0x1ab503&&!!_0xa1b9f6),_0x2d7eff['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2d7eff['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x5cdd56,_0x4b6980)=>_0x5cdd56&&!_0x4b6980),_0x2d7eff['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2d7eff['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2d7eff['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2d7eff;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x314d8a=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x314d8a,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2a85c8){const _0x96be4d=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2a85c8||i(_0x96be4d,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x176f29{['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[_0x193153,a,x,_0x4bd31b];}constructor(_0x56cfd4){super(_0x56cfd4),_0x56cfd4['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x56cfd4['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x56cfd4['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x56cfd4['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x747f93}=this;this['_aiAdapter']=_0x747f93['plugins']['get'](x),this['_dialog']=_0x747f93['plugins']['get'](_0x4bd31b),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x3fc09b=new E(_0x747f93,Array['from'](this['_commandDefinitions']['values']()));_0x747f93['commands']['add']('showAIAssistant',_0x3fc09b),_0x747f93['ui']['componentFactory']['add']('aiCommands',_0x32fdbf=>{const _0x2c9d52=_0x503ce9(_0x32fdbf);return _0x2c9d52['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2c9d52['buttonView']['set']({'label':i(_0x32fdbf,'AI\x20Commands'),'icon':_0x282791,'tooltip':!0x0}),_0x2c9d52['on']('execute',_0x56faa5=>this['_onExecute'](_0x56faa5['source']['id'])),_0x34cb00(_0x2c9d52,_0x747f93['ui']['view']['body'],function(_0x10557f){const _0x4caf0b=o(_0x10557f['config']['get']('ai.aiAssistant.commands'),_0x10557f['locale']),_0x7e6957=U(_0x10557f,_0x4caf0b)['filter'](_0x3ba511=>_0x3ba511['commands']['length']);if(0x1===_0x7e6957['length'])return U(_0x10557f,_0x7e6957[0x0]['commands'])['map'](_0x1efd3f=>({'id':_0x1efd3f['id'],'label':_0x1efd3f['label']}));return _0x7e6957['map'](_0x4e5d87=>{const {groupId:_0x3b618e,groupLabel:_0x1bc112,commands:_0x1da78a}=_0x4e5d87,_0x3beabc=U(_0x10557f,_0x1da78a)['map'](_0x49b7eb=>({'id':_0x49b7eb['id'],'label':_0x49b7eb['label']}));return{'id':_0x3b618e,'menu':_0x1bc112||_0x3b618e,'children':_0x3beabc};});}(_0x747f93),{'ariaLabel':i(_0x32fdbf,'AI\x20Commands')}),_0x2c9d52['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x3fc09b['on']('change:enabledCommandsIds',_0x315b3a),_0x2c9d52['menuView']['once']('render',_0x315b3a),_0x2c9d52;function _0x315b3a(){_0x2c9d52['isEnabled']=_0x3fc09b['enabledCommandsIds']['length']>0x0;for(const _0x1376c0 of _0x2c9d52['menuView']['buttons'])_0x1376c0['isEnabled']=_0x3fc09b['enabledCommandsIds']['includes'](_0x1376c0['id']);}}),_0x747f93['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4359f6=>{const _0x1bd2a6=new _0x306c23(_0x4359f6);_0x1bd2a6['buttonView']['set']({'label':i(_0x4359f6,'AI\x20Commands'),'icon':_0x282791}),_0x1bd2a6['bind']('isEnabled')['to'](_0x3fc09b,'enabledCommandsIds',_0x354fce=>_0x354fce['length']>0x0);const _0x4753a9=o(_0x747f93['config']['get']('ai.aiAssistant.commands'),_0x4359f6);return this['_populateMenuBarMenu'](_0x3fc09b,_0x1bd2a6,_0x4753a9,_0xa03009=>this['_onExecute'](_0xa03009)),_0x1bd2a6;}),_0x747f93['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x15f7c0=this['_createAIAssistantUIButton'](_0x21f3e2);return _0x15f7c0['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x15f7c0;}),_0x747f93['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x3d7291=this['_createAIAssistantUIButton'](_0x377594);return _0x3d7291['set']({'role':'menuitemcheckbox'}),_0x3d7291;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x39c682=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x58982b;for(const _0x126233 in _0x39c682){const _0x16c140=_0x126233,_0x2edf50=_0x39c682[_0x16c140];if('aiLicenseKeyValid'==_0x2edf50||'aiLicenseKeyInvalid'==_0x2edf50||'aiLicenseKeyExpired'==_0x2edf50||'aiLicenseKeyDomainLimit'==_0x2edf50||'aiLicenseKeyNotAllowed'==_0x2edf50||'aiLicenseKeyEvaluationLimit'==_0x2edf50||'aiLicenseKeyTrialLimit'==_0x2edf50||'aiLicenseKeyUsageLimit'==_0x2edf50){delete _0x39c682[_0x16c140],_0x58982b=_0x2edf50,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x58982b&&_0x39c682['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x58982b&&_0x39c682['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x58982b&&_0x39c682['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x58982b&&_0x39c682['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x58982b&&_0x39c682['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x58982b&&_0x39c682['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x58982b&&_0x39c682['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x1a0a0a='',_0x138f49='',_0x233fd3='custom'){const _0x526ceb=this['editor'],_0x53a242=_0x526ceb['editing']['view'],_0x5109ab=_0x526ceb['plugins']['get'](a),_0x229120=_0x526ceb['plugins']['get'](_0x193153);_0x5109ab['showFakeVisualSelection']();const _0x532a14=new l(),_0x4b8cb5=new ClipboardEvent('copy',{'clipboardData':_0x532a14}),_0x3b5960=new _0x24e6e6(_0x532a14),_0x169701=new _0x5884e4(_0x53a242,_0x4b8cb5,{'dataTransfer':_0x3b5960});_0x229120['_forceMarkersCopy']('comment',()=>{_0x53a242['document']['fire']('copy',_0x169701);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x526ceb,this['_aiAdapter']['textAdapter'],this['_formView']));let _0xf32554=_0x3b5960['getData']('text/html');const _0x47d52a=_0x526ceb['model']['document']['selection'],_0x1cb891=Array['from'](_0x47d52a['getRanges']());0x1===_0x1cb891['length']&&_0x1cb891[0x0]['isFlat']&&!_0x47d52a['getSelectedElement']()&&''!==_0xf32554['replace'](/ /g,'')['trim']()&&(_0xf32554='<p>'+_0xf32554+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x233fd3,'query':_0x1a0a0a,'htmlContent':_0xf32554,'label':_0x138f49,'mainActionLabel':_[_0x526ceb['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x3fcfb5,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0xd3a8bc['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5109ab['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x285c73=new Map(),_0x22316b=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x13a666 of _0x22316b)for(const _0x454bb0 of _0x13a666['commands'])_0x285c73['set'](_0x454bb0['id'],{..._0x454bb0,'groupId':_0x13a666['groupId'],'groupLabel':_0x13a666['groupLabel']||_0x13a666['groupId']});return _0x285c73;}['_createAIAssistantUIButton'](_0x2fc3ac){const _0x3fbcd0=this['editor'],_0x53304e=_0x3fbcd0['commands']['get']('showAIAssistant'),_0x1415a5=new _0x2fc3ac(_0x3fbcd0['locale']);return _0x1415a5['set']({'label':i(_0x3fbcd0['locale'],'AI\x20Assistant'),'icon':_0x3fcfb5,'isToggleable':!0x0}),_0x1415a5['bind']('isEnabled')['to'](_0x53304e),_0x1415a5['bind']('isOn')['to'](this['_dialog'],'id',_0x494c4a=>'aiAssistant'===_0x494c4a),this['listenTo'](_0x1415a5,'execute',()=>{_0x1415a5['isOn']?this['hideUI']():_0x53304e['execute']();}),_0x1415a5;}['_initView'](){const _0x2c41ae=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',()=>{_0x2c41ae['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x2c41ae['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4b78d7,ui:{ariaLiveAnnouncer:_0x4e510e}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5a7285,_0x3bfeba,_0x23d0a3)=>{const _0x27f779=this['_aiAssistantController']['currentContext'];_0x23d0a3?_0x4e510e['announce'](i(_0x4b78d7,'AI\x20is\x20writing')):_0x27f779&&_0x4e510e['announce'](i(_0x4b78d7,'Generated\x20content:\x20%0',_0x27f779),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x238752,_0x282f6c,_0x27b813)=>{if(_0x27b813){const _0x41507d=this['_formView']['errorView']['text'];_0x4e510e['announce'](i(_0x4b78d7,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x41507d));}});}['_onExecute'](_0x4f7693){const _0x50c93d=this['_commandDefinitions']['get'](_0x4f7693),_0x2f3c9c=this['editor'],_0x7930cb=_0x2f3c9c['model']['document']['selection'],_0x50dc14=_0x2f3c9c['commands']['get']('showAIAssistant'),_0x50b1fb=_0x2f3c9c['plugins']['get'](a),_0x5e6f03=''+(_0x50c93d['groupId']!==K?_0x50c93d['groupLabel']+':\x20':'')+_0x50c93d['label'];if(!0x1!==_0x50c93d['requiresContent']&&_0x7930cb['isCollapsed']){const _0x103e4b=_0x171255(_0x7930cb['getSelectedBlocks']())||_0x2f3c9c['model']['schema']['getLimitElement'](_0x7930cb);_0x2f3c9c['model']['change'](_0x58e79f=>{_0x58e79f['setSelection'](_0x103e4b,'in');});}_0x50b1fb['showFakeVisualSelection'](),_0x50dc14['execute'](_0x50c93d['prompt'],_0x5e6f03,'command:'+_0x4f7693);}['_populateMenuBarMenu'](_0x4372cd,_0x55264d,_0x4684ba,_0xf95a94){const _0x524f3b=this['editor'],_0x3dc1d9=_0x524f3b['locale'],_0x59477f=new _0x334386(_0x3dc1d9),_0x57d2f1=U(_0x524f3b,_0x4684ba)['filter'](_0x4759cd=>_0x4759cd['commands']['length']);0x1===_0x57d2f1['length']?this['_getMenuBarGroupButtons']({'command':_0x4372cd,'commands':_0x57d2f1[0x0]['commands'],'parentMenuView':_0x55264d,'onExecute':_0xf95a94})['forEach'](_0x26f1bc=>_0x59477f['items']['add'](_0x26f1bc)):_0x57d2f1['forEach'](({groupId:_0x51b9c3,groupLabel:_0x1b6d4d,commands:_0x395208})=>{const _0x5a889d=new _0x3fb2f1(_0x3dc1d9,_0x55264d),_0x368d8d=new _0x306c23(_0x3dc1d9),_0x1680f4=new _0x334386(_0x3dc1d9),_0xce31de=this['_getMenuBarGroupButtons']({'command':_0x4372cd,'commands':_0x395208,'parentMenuView':_0x368d8d,'onExecute':_0xf95a94});_0x368d8d['buttonView']['set']({'label':_0x1b6d4d||_0x51b9c3}),_0x368d8d['delegate']('execute')['to'](_0x55264d),_0x1680f4['items']['addMany'](_0xce31de),_0x368d8d['panelView']['children']['add'](_0x1680f4),_0x5a889d['children']['add'](_0x368d8d),_0x59477f['items']['add'](_0x5a889d);}),_0x55264d['panelView']['children']['add'](_0x59477f);}['_getMenuBarGroupButtons']({command:_0x45ac68,commands:_0x38d513,parentMenuView:_0x83abcf,onExecute:_0xa3fcd8}){const _0x23609d=this['editor'],_0x1a8423=_0x23609d['locale'];return U(_0x23609d,_0x38d513)['map'](_0x18b225=>{const _0x51509e=new _0x3fb2f1(_0x1a8423,_0x83abcf),_0x15697d=new _0x377594(_0x1a8423);return _0x15697d['set']({'label':_0x18b225['label']}),_0x15697d['delegate']('execute')['to'](_0x83abcf),_0x15697d['on']('execute',()=>_0xa3fcd8(_0x18b225['id'])),_0x15697d['bind']('isEnabled')['to'](_0x45ac68,'enabledCommandsIds',_0x159dd4=>_0x159dd4['includes'](_0x18b225['id'])),_0x51509e['children']['add'](_0x15697d),_0x51509e;});}}function T(_0x36850e,_0x5e6189){return void 0x0!==_0x36850e['order']&&void 0x0===_0x5e6189['order']?0x1:void 0x0===_0x36850e['order']&&void 0x0!==_0x5e6189['order']?-0x1:void 0x0!==_0x36850e['order']&&void 0x0!==_0x5e6189['order']?_0x36850e['order']-_0x5e6189['order']:0x0;}function U(_0x42de85,_0x365e06){_0x365e06['sort'](T);const _0x2e57f1={},_0x40a0d6=[];for(const _0x561462 of _0x365e06)if(void 0x0!==_0x561462['order']){if(_0x561462['order']in _0x2e57f1)throw new _0x2f33fd('ai-commands-config-order-collision',_0x42de85,{'conflictingDefinitions':[_0x561462,_0x2e57f1[_0x561462['order']]]});_0x2e57f1[_0x561462['order']]=_0x561462,_0x40a0d6['splice'](_0x561462['order'],0x0,_0x561462);}else _0x40a0d6['push'](_0x561462);return _0x40a0d6;}class At extends _0x176f29{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x12ef42){super(_0x12ef42);const _0x572f06=_0x12ef42['config'],_0x1ba90d=_0x12ef42['locale'];_0x572f06['define']('ai.aiAssistant.preserveComments',!0x0),_0x572f06['define']('ai.aiAssistant.commands',_t(_0x1ba90d)),_0x572f06['define']('ai.aiAssistant.extraCommandGroups',[]),_0x572f06['define']('ai.aiAssistant.removeCommands',[]);let _0x49ccc3=o(_0x572f06['get']('ai.aiAssistant.commands'),_0x1ba90d);const _0x41f374=_0x572f06['get']('ai.aiAssistant.extraCommandGroups'),_0x235662=_0x572f06['get']('ai.aiAssistant.removeCommands');_0x41f374['forEach'](_0x16a25b=>{const _0x4899be=_0x49ccc3['find'](_0x1747f7=>_0x1747f7['groupId']===_0x16a25b['groupId']);_0x4899be?_0x4899be['commands']=_0x4899be['commands']['concat'](_0x16a25b['commands']):_0x49ccc3['push'](_0x16a25b);}),_0x49ccc3=_0x49ccc3['filter'](_0xab49a=>!_0x235662['includes'](_0xab49a['groupId'])),_0x49ccc3['forEach'](_0x45507b=>{_0x45507b['commands']=_0x45507b['commands']['filter'](_0x2eddc3=>!_0x235662['includes'](_0x2eddc3['id']));}),_0x572f06['set']('ai.aiAssistant.commands',_0x49ccc3);}}function _t(_0x48a112){return[{'groupId':'editOrReview','groupLabel':i(_0x48a112,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x48a112,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x48a112,'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(_0x48a112,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x48a112,'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(_0x48a112,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x48a112,'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(_0x48a112,'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(_0x48a112,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x48a112,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x48a112,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x48a112,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x48a112,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x48a112,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x48a112,'Change\x20style'),'commands':[{'id':'business','label':i(_0x48a112,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x48a112,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x48a112,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x48a112,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x48a112,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x48a112,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x48a112,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x48a112,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x48a112,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x48a112,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x48a112,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x48a112,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x48a112,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x176f29{['abortController'];static get['requires'](){return[x];}constructor(_0x1a646d){super(_0x1a646d),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0xc8fc5d){return this['sendRequest'](_0xc8fc5d)['catch'](_0x400c91=>{if(_0x400c91 instanceof R)return Promise['reject'](_0x400c91);if('AbortError'==_0x400c91['name'])return Promise['resolve']();throw console['error'](_0x400c91),new _0x2f33fd('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x133db4,_0x31ba47){const _0x15fc9e=this['editor']['locale'],_0x4cf1ee={'Content-Type':'application/json'};if('object'==typeof _0x133db4)Object['assign'](_0x4cf1ee,_0x133db4);else{if(_0x133db4)try{const _0x1f4779=await _0x133db4(_0x31ba47);Object['assign'](_0x4cf1ee,_0x1f4779);}catch{return Promise['reject'](new R(i(_0x15fc9e,'AI_ERROR_GET_HEADERS')));}}return _0x4cf1ee;}async['_prepareRequestParameters'](_0x12fb81,_0xd50586){const _0x4c68ad=this['editor']['locale'];if('object'==typeof _0x12fb81)return _0x12fb81;try{return await _0x12fb81(_0xd50586);}catch{return Promise['reject'](new R(i(_0x4c68ad,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x2ad5d9){super(_0x2ad5d9),_0x2ad5d9['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x2ad5d9['config']['get']('ai.openAI.requestParameters')||_0x2ad5d9['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x2ad5d9['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x2ad5d9['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x2ad5d9['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x409526,context:_0x707efd,onData:_0x5e0e37,actionId:_0x5b9a46}){const _0x12d05f=this['editor']['locale'],_0x2667af=await this['prepareMessages'](_0x409526,_0x707efd,_0x5b9a46),_0x33de11=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5b9a46),_0x4a3940=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5b9a46),_0x3d3c1c={'messages':_0x2667af,..._0x4a3940},_0x7bfc1f={'method':'POST','headers':_0x33de11,'body':JSON['stringify'](_0x3d3c1c),'signal':this['abortController']['signal']},_0x56af80=await fetch(this['_apiUrl'],_0x7bfc1f);if(_0x56af80['ok'])return _0x4a3940['stream']?await this['_readStreamableResponse'](_0x56af80,_0x5e0e37):await this['_readStaticResponse'](_0x56af80,_0x5e0e37),Promise['resolve']();{const _0x22bd19=await _0x56af80['text']();return _0x22bd19['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x12d05f,'AI_ERROR_CONTEXT_LENGTH'))):_0x22bd19['includes']('Moderation')?Promise['reject'](new R(i(_0x12d05f,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x22bd19));}}async['prepareMessages'](_0xc89dbe,_0x295495,_0x68dad2){let _0x272593,_0x499a;return _0x295495?(_0x272593='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.',_0x499a='Instruction:\x0a'+_0xc89dbe+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x295495):(_0x272593='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.',_0x499a=_0xc89dbe),[{'role':'system','content':_0x272593},{'role':'user','content':_0x499a}];}async['_readStreamableResponse'](_0x4b1d82,_0x19837e){const _0x15139d=_0x4b1d82['body']['getReader'](),_0x582b1d=new TextDecoder();let _0x2c998f='',_0x2141ef='',_0x22f135='',_0x331a76=!0x1;for(;!_0x331a76;){const {done:_0x595868,value:_0x5583fc}=await _0x15139d['read'](),_0x2f47f2=_0x2c998f+_0x582b1d['decode'](_0x5583fc);let _0x11458d='';_0x331a76=_0x595868;try{_0x11458d=this['_cleanUpData'](_0x2f47f2),_0x2c998f='';}catch{_0x2c998f=_0x2f47f2;continue;}_0x2141ef+=_0x11458d,!_0x331a76&&this['_isBufferIncomplete'](_0x2141ef)||_0x2141ef&&(_0x22f135+=_0x2141ef,_0x2141ef='',_0x19837e(_0x22f135));}return Promise['resolve']();}async['_readStaticResponse'](_0x1671b0,_0x13a3ea){return _0x13a3ea((await _0x1671b0['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x10b0e4){const _0x4f89e0=_0x10b0e4['split']('<')['length']!==_0x10b0e4['split']('>')['length'],_0x19111c=_0x10b0e4['length']<0x1e;return _0x4f89e0&&_0x19111c;}['_cleanUpData'](_0x1c5189){return _0x1c5189['split'](/\n(?![^{]*\})/g)['map'](_0x4eb494=>_0x4eb494['replace']('data:\x20',''))['filter'](_0x23bf53=>_0x23bf53&&_0x23bf53['length']>0x0&&'[DONE]'!==_0x23bf53)['map'](_0x4e7fc2=>{const {choices:_0x143111}=JSON['parse'](_0x4e7fc2);if(_0x143111[0x0]?.['delta']?.['content'])return _0x143111[0x0]['delta']['content'];})['filter'](_0xf4c3d4=>_0xf4c3d4)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x53add9){super(_0x53add9),_0x53add9['config']['get']('ai.aws.requestParameters')||_0x53add9['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']=_0x53add9['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x53add9['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x53add9['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x53add9['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x38a82f,context:_0x8490e6,onData:_0x11eafa,actionId:_0xf9ddcd}){const {model:_0x31c70d,stream:_0x34fb39,..._0x240262}=await this['_prepareRequestParameters'](this['_requestParameters'],_0xf9ddcd),_0x365140={'prompt':await this['preparePrompt'](_0x38a82f,_0x8490e6,_0x31c70d,_0xf9ddcd),..._0x240262};this['_apiUrl']?await this['_processProxyRequest'](_0x365140,_0x31c70d,_0x34fb39,_0x11eafa,_0xf9ddcd):await this['_processAWSRequest'](_0x365140,_0x31c70d,_0x34fb39,_0x11eafa);}async['preparePrompt'](_0x3543ec,_0x32e01c,_0x7aa3bf,_0x5d6477){let _0x1fd730,_0x1f5343;return _0x32e01c?(_0x1fd730='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.',_0x1f5343='Instruction:\x0a'+_0x3543ec+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x32e01c):(_0x1fd730='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.',_0x1f5343=_0x3543ec),'meta.llama'==this['getModelFamily'](_0x7aa3bf)?'<<SYS>>\x0a'+_0x1fd730+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x1f5343+'\x0a[/INST]':'Human:\x0a'+_0x1fd730+'\x0a'+_0x1f5343+'\x0a\x0aAssistant:';}['getModelFamily'](_0x47026c){if(/^anthropic\.claude/['test'](_0x47026c))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x47026c))return'ai21.j2';if(/^cohere\.command/['test'](_0x47026c))return'cohere.command';if(/^meta\.llama/['test'](_0x47026c))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x47026c));}async['_processProxyRequest'](_0x3876e0,_0x34db94,_0x4c1b67,_0x2f7d74,_0x3f2206){const _0xca1067={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3f2206),'body':JSON['stringify']({..._0x3876e0,'model':_0x34db94,'stream':_0x4c1b67}),'signal':this['abortController']['signal']},_0x34c760=await fetch(this['_apiUrl'],_0xca1067);_0x4c1b67?await this['_readStreamableResponse'](_0x34c760,_0x34db94,_0x2f7d74):await this['_readStaticResponse'](_0x34c760,_0x34db94,_0x2f7d74);}async['_processAWSRequest'](_0xf3d359,_0xc087b8,_0xadc64,_0x5b1c77){const _0x16b1d7=new _0x3c3b78(this['_bedrockClientConfig']),_0x3cd93e={'body':JSON['stringify'](_0xf3d359),'contentType':'application/json','accept':'application/json','modelId':_0xc087b8};let _0x48da18;if(_0xadc64){const _0x4fd767=new _0x541f19(_0x3cd93e);_0x48da18=await _0x16b1d7['send'](_0x4fd767,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x48da18,_0xc087b8,_0x5b1c77);}else{const _0x7616cb=new _0x232135(_0x3cd93e);_0x48da18=await _0x16b1d7['send'](_0x7616cb,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x48da18,_0xc087b8,_0x5b1c77);}}async['_readAsyncIterableResponse'](_0x5ae2f6,_0x31daaf,_0x3b2d2a){const _0x4d4886=_0x5ae2f6['body'],_0x53b135=new TextDecoder('utf-8');let _0xe0efc0='';for await(const _0x108b71 of _0x4d4886)if(_0x108b71['chunk']){const _0x5c2d2e=_0x53b135['decode'](_0x108b71['chunk']['bytes']),_0x421d62=JSON['parse'](_0x5c2d2e);_0xe0efc0+=this['_getGeneratedText'](_0x421d62,_0x31daaf),_0x3b2d2a(_0xe0efc0);}return Promise['resolve']();}async['_readStreamableResponse'](_0x26912e,_0xe4ef1f,_0x4136df){const _0x386388=_0x26912e['body'],_0x3cac91=new TextDecoder('utf-8'),_0x22d7ed=_0x386388['getReader']();let _0x38ffc3='',_0x3465cc='',_0x53b3fe=!0x1;for(;!_0x53b3fe;){const {done:_0x2ee47d,value:_0xe9b74f}=await _0x22d7ed['read']();if(_0x53b3fe=_0x2ee47d,_0x53b3fe)break;const _0x3c7ed5=(_0x38ffc3+_0x3cac91['decode'](_0xe9b74f))['split']('\x0a')['map'](_0x639ac4=>{try{return _0x38ffc3='',JSON['parse'](_0x639ac4);}catch{return _0x38ffc3=_0x639ac4,null;}})['filter'](_0x27f038=>null!==_0x27f038);_0x3c7ed5['length']&&(_0x3465cc+=_0x3c7ed5['map'](_0x2aba3f=>this['_getGeneratedText'](_0x2aba3f,_0xe4ef1f))['join'](''),_0x4136df(_0x3465cc));}return Promise['resolve']();}async['_readStaticResponse'](_0x20ed99,_0x309b5e,_0x53da95){let _0x2db3c1;return _0x2db3c1=_0x20ed99 instanceof Response?await _0x20ed99['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x20ed99['body'])),(_0x53da95(this['_getGeneratedText'](_0x2db3c1,_0x309b5e)),Promise['resolve']());}['_getGeneratedText'](_0x49dfed,_0x5f1b9f){switch(this['getModelFamily'](_0x5f1b9f)){case'anthropic.claude':return _0x49dfed['completion'];case'ai21.j2':return _0x49dfed['completions'][0x0]['data']['text'];case'cohere.command':return _0x49dfed['generations'][0x0]['text'];case'meta.llama':return _0x49dfed['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x1bf9e9,Command as _0x2370a4}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x22e80d,IconCheck as _0x28c87b,IconError as _0x1eb11b,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x2f1260,IconRobotPencil as _0x39ad39}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x36eb00,CKEditorError as _0x566d24,ObservableMixin as _0xe8ec6c,global as _0x4eb04a,isVisible as _0x4ba54b,Rect as _0x1db1ce,Collection as _0x3319fa,FocusTracker as et,KeystrokeHandler as rt,first as _0x532a24}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x3da3ef,View as _0x169f0c,SpinnerView as _0x361f45,IconView as _0x449483,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x490a4f,createDropdown as _0x228de3,addMenuToDropdown as _0xe00517,MenuBarMenuView as _0x56c20f,MenuBarMenuListItemButtonView as _0xea9c5a,DialogViewPosition as _0x27d528,MenuBarMenuListView as _0x3b3f24,MenuBarMenuListItemView as _0x2259cc}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0xfc22d,ClipboardMarkersUtils as _0x30e969}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x30c4ad,ViewDataTransfer as _0x281318,ViewUpcastWriter as _0x2169f9,Matcher as _0xe82244}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x4c36cd,InvokeModelWithResponseStreamCommand as _0x31a7b7,InvokeModelCommand as _0x451884}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x4d79c6,_0x459487){const _0x1b1428=(0x0,_0x459487['t'])('Other');return _0x4d79c6['length']?'groupId'in _0x4d79c6[0x0]?_0x4d79c6:[{'groupId':K,'groupLabel':_0x1b1428,'order':0x1/0x0,'commands':_0x4d79c6}]:[{'groupId':K,'groupLabel':_0x1b1428,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x1bf9e9{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x549610}=this,_0x458422=['ck-fake-ai-selection'];_0x549610['config']['get']('ai.useTheme')&&_0x458422['push']('ck-ai-assistant-ui_theme'),_0x549610['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x458422,'priority':0xc}}),_0x549610['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x27cb72,{writer:_0xe8d8a5})=>{if(!_0x27cb72['markerRange']['isCollapsed'])return null;const _0x33d093=_0xe8d8a5['createUIElement']('span');return _0xe8d8a5['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x33d093),_0x33d093;}});}['afterInit'](){!async function(_0x259105){const _0x402558=_0x4f3818([0x76,0x4b,0x45,0x56,0x6f,0x64,0x46,0x61,0x72,0x53,0x70,0x38,0x42,0x77,0x6d,0x6b,0x48,0x49,0x43,0x6e,0x79,0x69,0x6a,0x33,0x39,0x37,0x32,0x73,0x6c,0x35,0x65,0x4e,0x4c,0x63,0x4f,0x52,0x55,0x75,0x7a,0x68,0x44,0x54,0x67,0x41,0x47,0x57,0x51,0x5a,0x36,0x58,0x31,0x71,0x34,0x4a,0x59,0x50,0x78,0x62,0x66,0x30,0x4d,0x74]),_0xcb676d=0x50ed7bca,_0x461783=0x50ea1452^_0xcb676d,_0x149aa7=window[_0x4f3818([0x44,0x61,0x74,0x65])][_0x4f3818([0x6e,0x6f,0x77])](),_0x1726ae=_0x259105[_0x4f3818([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4b4fd3=new window[(_0x4f3818([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x870983=>{_0x1726ae[_0x4f3818([0x6f,0x6e,0x63,0x65])](_0x4f3818([0x72,0x65,0x61,0x64,0x79]),_0x870983);}),_0x14a231={[_0x4f3818([0x6b,0x74,0x79])]:_0x4f3818([0x45,0x43]),[_0x4f3818([0x75,0x73,0x65])]:_0x4f3818([0x73,0x69,0x67]),[_0x4f3818([0x63,0x72,0x76])]:_0x4f3818([0x50,0x2d,0x32,0x35,0x36]),[_0x4f3818([0x78])]:_0x4f3818([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]),[_0x4f3818([0x79])]:_0x4f3818([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]),[_0x4f3818([0x61,0x6c,0x67])]:_0x4f3818([0x45,0x53,0x32,0x35,0x36])},_0x5d2711=_0x1726ae[_0x4f3818([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4f3818([0x67,0x65,0x74])](_0x4f3818([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x43f80c(){let _0x2ccd76,_0x3c8400=null,_0x4a8b2f=null;try{if(_0x5d2711==_0x4f3818([0x47,0x50,0x4c]))return _0x4f3818([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x2ccd76=_0x1d6f07(),!_0x2ccd76)return _0x4f3818([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x2ccd76[_0x4f3818([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x4a8b2f=_0x4322c2(_0x2ccd76[_0x4f3818([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x2ccd76[_0x4f3818([0x6a,0x74,0x69])])),await _0x570467()?_0x1b7012()?_0x1cd1cb()?_0x4f3818([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4872d0()?(_0x2ccd76[_0x4f3818([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4f3818([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x3c8400=_0x53604d(_0x4f3818([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x2ccd76[_0x4f3818([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4f3818([0x74,0x72,0x69,0x61,0x6c])&&(_0x3c8400=_0x53604d(_0x4f3818([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2c51a4()):_0x4f3818([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4f3818([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4f3818([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x4f3818([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1cd1cb(){const _0x21cd88=[_0x4f3818([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4f3818([0x74,0x72,0x69,0x61,0x6c])][_0x4f3818([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2ccd76[_0x4f3818([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x149aa7/0x3e8:0xe10*_0x461783;return _0x2ccd76[_0x4f3818([0x65,0x78,0x70])]<_0x21cd88;}function _0x1b7012(){const _0x1689f8=_0x2ccd76[_0x4f3818([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1689f8&&(!!_0x1689f8[_0x4f3818([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4f3818([0x2a]))||!!_0x1689f8[_0x4f3818([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4f3818([0x41,0x49])));}function _0x4872d0(){const _0x424c8f=_0x2ccd76[_0x4f3818([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x424c8f||0x0==_0x424c8f[_0x4f3818([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x118688}=new URL(window[_0x4f3818([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x424c8f[_0x4f3818([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x118688))return!0x0;const _0x29452d=_0x118688[_0x4f3818([0x73,0x70,0x6c,0x69,0x74])](_0x4f3818([0x2e]));return _0x424c8f[_0x4f3818([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3fb9e1=>_0x3fb9e1[_0x4f3818([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4f3818([0x2a])))[_0x4f3818([0x6d,0x61,0x70])](_0x4da655=>_0x4da655[_0x4f3818([0x73,0x70,0x6c,0x69,0x74])](_0x4f3818([0x2e])))[_0x4f3818([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x388615=>_0x388615[_0x4f3818([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x29452d[_0x4f3818([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4f3818([0x6d,0x61,0x70])](_0x2bdfdc=>Array(_0x29452d[_0x4f3818([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x2bdfdc[_0x4f3818([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4f3818([0x66,0x69,0x6c,0x6c])](_0x2bdfdc[0x0]===_0x4f3818([0x2a])?_0x4f3818([0x2a]):'')[_0x4f3818([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x2bdfdc))[_0x4f3818([0x73,0x6f,0x6d,0x65])](_0x431afe=>_0x29452d[_0x4f3818([0x65,0x76,0x65,0x72,0x79])]((_0x1a560b,_0x6ef74a)=>_0x431afe[_0x6ef74a]===_0x1a560b||_0x431afe[_0x6ef74a]===_0x4f3818([0x2a])));}function _0x2c51a4(){return _0x3c8400&&_0x4a8b2f?new window[(_0x4f3818([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x158695,_0x5a5827)=>{_0x3c8400[_0x4f3818([0x74,0x68,0x65,0x6e])](_0x158695,_0x5a5827),_0x4a8b2f[_0x4f3818([0x74,0x68,0x65,0x6e])](_0xf7fb13=>{_0xf7fb13!=_0x4f3818([0x56,0x61,0x6c,0x69,0x64])&&_0x158695(_0xf7fb13);},_0x5a5827);}):_0x3c8400||_0x4a8b2f||_0x4f3818([0x56,0x61,0x6c,0x69,0x64]);}}function _0x4322c2(_0x3df483,_0x46fc2f){return new window[(_0x4f3818([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x48aac0=>{if(_0x315344())return _0x48aac0(_0x4f3818([0x56,0x61,0x6c,0x69,0x64]));_0x5218ae(),_0x1726ae[_0x4f3818([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4f3818([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x5235c7=!0x1;const _0x5c74da=_0x36eb00();function _0x276972(_0x3e2d9e){return!!_0x3e2d9e&&(typeof _0x3e2d9e===_0x4f3818([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3e2d9e===_0x4f3818([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3e2d9e[_0x4f3818([0x74,0x68,0x65,0x6e])]===_0x4f3818([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3e2d9e[_0x4f3818([0x63,0x61,0x74,0x63,0x68])]===_0x4f3818([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x79ece0(_0x14d0dd){_0x467404(_0x14d0dd)[_0x4f3818([0x74,0x68,0x65,0x6e])](_0xf5538=>{if(!_0xf5538||_0xf5538[_0x4f3818([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4f3818([0x6f,0x6b]))return _0x4f3818([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x3a838e(_0x1547a1(_0x5c74da+_0x46fc2f))!=_0xf5538[_0x4f3818([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4f3818([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4f3818([0x56,0x61,0x6c,0x69,0x64]);})[_0x4f3818([0x74,0x68,0x65,0x6e])](_0x23f566=>(_0x5ba1b7(),_0x23f566),()=>{const _0x3f9ba3=_0x46b205();return null==_0x3f9ba3?(_0x5ba1b7(),_0x4f3818([0x56,0x61,0x6c,0x69,0x64])):_0x4f3818(_0x149aa7-_0x3f9ba3>(0x74e1ffca^_0xcb676d)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4f3818([0x74,0x68,0x65,0x6e])](_0x48aac0)[_0x4f3818([0x63,0x61,0x74,0x63,0x68])](()=>{_0x48aac0(_0x4f3818([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x787e2a=0x50db954a^_0xcb676d;function _0x5ba1b7(){const _0x273acf=_0x4f3818([0x6c,0x6c,0x63,0x74,0x2d])+_0x3a838e(_0x1547a1(_0x3df483)),_0x8de1cc=_0x2ea8aa(_0x3a838e(window[_0x4f3818([0x4d,0x61,0x74,0x68])][_0x4f3818([0x63,0x65,0x69,0x6c])](_0x149aa7/_0x787e2a)));window[_0x4f3818([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4f3818([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x273acf,_0x8de1cc);}function _0x46b205(){const _0x171d23=_0x4f3818([0x6c,0x6c,0x63,0x74,0x2d])+_0x3a838e(_0x1547a1(_0x3df483)),_0x5d3557=window[_0x4f3818([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4f3818([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x171d23);return _0x5d3557?window[_0x4f3818([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2ea8aa(_0x5d3557),0x10)*_0x787e2a:null;}function _0x467404(_0x5e64bd){return new window[(_0x4f3818([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2a2a29,_0x3c6005)=>{_0x5e64bd[_0x4f3818([0x74,0x68,0x65,0x6e])](_0x2a2a29,_0x3c6005),window[_0x4f3818([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3c6005,0x50ecaf0a^_0xcb676d);});}}_0x1726ae[_0x4f3818([0x6f,0x6e])](_0x4f3818([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3d3193,_0x42e0ba)=>{if(_0x42e0ba[0x0]!=_0x3df483)return _0x48aac0(_0x4f3818([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x42e0ba[0x1]={..._0x42e0ba[0x1],[_0x4f3818([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x5c74da};},{[_0x4f3818([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4f3818([0x68,0x69,0x67,0x68])}),_0x1726ae[_0x4f3818([0x6f,0x6e])](_0x4f3818([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x34d17d=>{_0x276972(_0x34d17d[_0x4f3818([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x5235c7=!0x0,_0x79ece0(_0x34d17d[_0x4f3818([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4f3818([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4f3818([0x6c,0x6f,0x77])}),_0x4b4fd3[_0x4f3818([0x74,0x68,0x65,0x6e])](()=>{_0x5235c7||_0x48aac0(_0x4f3818([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x315344(){return _0x1726ae[_0x4f3818([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4f3818([0x76,0x69,0x65,0x77])][_0x4f3818([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4f3818([0x61,0x75,0x74,0x6f]);}function _0x5218ae(){_0x1726ae[_0x4f3818([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4f3818([0x76,0x69,0x65,0x77])][_0x4f3818([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4f3818([0x61,0x75,0x74,0x6f]);}}function _0x53604d(_0x2fbb73){const _0x2d694a=[new window[(_0x4f3818([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2bffe8=>setTimeout(_0x2bffe8,0x50e44506^_0xcb676d)),_0x4b4fd3[_0x4f3818([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4f3818([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x12a107=>{let _0x284eb9=0x0;_0x1726ae[_0x4f3818([0x6d,0x6f,0x64,0x65,0x6c])][_0x4f3818([0x6f,0x6e])](_0x4f3818([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x345c0d,_0x441baf)=>{_0x441baf[0x0][_0x4f3818([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x284eb9++,_0x284eb9==(0x50ed7a32^_0xcb676d)&&(_0x12a107(),_0x345c0d[_0x4f3818([0x6f,0x66,0x66])]());});}))];return window[_0x4f3818([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4f3818([0x72,0x61,0x63,0x65])](_0x2d694a)[_0x4f3818([0x74,0x68,0x65,0x6e])](()=>_0x2fbb73);}async function _0x5bcd4f(){await _0x4b4fd3,_0x1726ae[_0x4f3818([0x6d,0x6f,0x64,0x65,0x6c])][_0x4f3818([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x4103dd,_0x1726ae[_0x4f3818([0x6d,0x6f,0x64,0x65,0x6c])][_0x4f3818([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x4103dd,_0x1726ae[_0x4f3818([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4f3818([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x41388a(_0x5751bd){const _0x4367ab=_0x1360e5();_0x1726ae[_0x4367ab]=_0x4f3818([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x5751bd,_0x5751bd!=_0x4f3818([0x56,0x61,0x6c,0x69,0x64])&&_0x5bcd4f();}function _0x1360e5(){const _0x219ec1=window[_0x4f3818([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4f3818([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4f3818([0x6e,0x6f,0x77])]())[_0x4f3818([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4f3818([0x2e]),'');let _0x4c9434=_0x4f3818([0x76]);for(let _0x558e72=0x0;_0x558e72<_0x219ec1[_0x4f3818([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x558e72+=0x2){let _0x136d53=window[_0x4f3818([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x219ec1[_0x4f3818([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x558e72,_0x558e72+0x2));_0x136d53>=_0x402558[_0x4f3818([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x136d53-=_0x402558[_0x4f3818([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4c9434+=_0x402558[_0x136d53];}return _0x4c9434;}function _0x1d6f07(){const _0x3f4a80=_0x5d2711[_0x4f3818([0x73,0x70,0x6c,0x69,0x74])](_0x4f3818([0x2e]));if(0x3!=_0x3f4a80[_0x4f3818([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x590137(_0x3f4a80[0x1]);function _0x590137(_0x3efae5){const _0x4a55f2=_0x198c0c(_0x3efae5);return _0x4a55f2&&_0x57a7c1()?_0x4a55f2:null;function _0x57a7c1(){const _0x4f5792=_0x4a55f2[_0x4f3818([0x6a,0x74,0x69])],_0x5e2404=window[_0x4f3818([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4f5792[_0x4f3818([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4f5792[_0x4f3818([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2ccd43={..._0x4a55f2,[_0x4f3818([0x6a,0x74,0x69])]:_0x4f5792[_0x4f3818([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4f5792[_0x4f3818([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2ccd43[_0x4f3818([0x76,0x63])],_0x1547a1(_0x2ccd43)==_0x5e2404;}}}async function _0x570467(){let _0x32a317=!0x0;try{const _0x2a7c97=_0x5d2711[_0x4f3818([0x73,0x70,0x6c,0x69,0x74])](_0x4f3818([0x2e])),[_0xf7a7a4,_0x31451a,_0x56d1d6]=_0x2a7c97;return _0x5f2cfe(_0xf7a7a4),await _0xa8d38f(_0xf7a7a4,_0x31451a,_0x56d1d6),_0x32a317;}catch{return!0x1;}function _0x5f2cfe(_0x41fd07){const _0x2a9291=_0x198c0c(_0x41fd07);_0x2a9291&&_0x2a9291[_0x4f3818([0x61,0x6c,0x67])]==_0x4f3818([0x45,0x53,0x32,0x35,0x36])||(_0x32a317=!0x1);}async function _0xa8d38f(_0x1c541e,_0x98ba23,_0x5e449){const _0x31be25=window[_0x4f3818([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4f3818([0x66,0x72,0x6f,0x6d])](_0x166c14(_0x5e449),_0x3f7160=>_0x3f7160[_0x4f3818([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4c0242=new window[(_0x4f3818([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4f3818([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x1c541e+_0x4f3818([0x2e])+_0x98ba23),_0x11568e=window[_0x4f3818([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4f3818([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x11568e)return;const _0x50f386=await _0x11568e[_0x4f3818([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4f3818([0x6a,0x77,0x6b]),_0x14a231,{[_0x4f3818([0x6e,0x61,0x6d,0x65])]:_0x4f3818([0x45,0x43,0x44,0x53,0x41]),[_0x4f3818([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4f3818([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4f3818([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x11568e[_0x4f3818([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4f3818([0x6e,0x61,0x6d,0x65])]:_0x4f3818([0x45,0x43,0x44,0x53,0x41]),[_0x4f3818([0x68,0x61,0x73,0x68])]:{[_0x4f3818([0x6e,0x61,0x6d,0x65])]:_0x4f3818([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x50f386,_0x31be25,_0x4c0242)||(_0x32a317=!0x1);}}function _0x198c0c(_0x30e141){return _0x30e141[_0x4f3818([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4f3818([0x65,0x79]))?JSON[_0x4f3818([0x70,0x61,0x72,0x73,0x65])](_0x166c14(_0x30e141)):null;}function _0x166c14(_0x25f697){return window[_0x4f3818([0x61,0x74,0x6f,0x62])](_0x25f697[_0x4f3818([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4f3818([0x2b]))[_0x4f3818([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4f3818([0x2f])));}function _0x1547a1(_0x621afb){let _0x9df70d=0x1505;function _0x50aece(_0x3969b5){for(let _0x1ddf78=0x0;_0x1ddf78<_0x3969b5[_0x4f3818([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1ddf78++){const _0x145d8d=_0x3969b5[_0x4f3818([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1ddf78);_0x9df70d=(_0x9df70d<<0x5)+_0x9df70d+_0x145d8d,_0x9df70d&=_0x9df70d;}}function _0x39a707(_0x3fbf13){Array[_0x4f3818([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3fbf13)?_0x3fbf13[_0x4f3818([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x39a707):_0x3fbf13&&typeof _0x3fbf13==_0x4f3818([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4f3818([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3fbf13)[_0x4f3818([0x73,0x6f,0x72,0x74])]()[_0x4f3818([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x302642,_0x4ca7aa])=>{_0x50aece(_0x302642),_0x39a707(_0x4ca7aa);}):_0x50aece(window[_0x4f3818([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3fbf13));}return _0x39a707(_0x621afb),_0x9df70d>>>0x0;}function _0x3a838e(_0x341497){return _0x341497[_0x4f3818([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4f3818([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4f3818([0x30]));}function _0x2ea8aa(_0x1d6cee){return _0x1d6cee[_0x4f3818([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4f3818([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4f3818([0x6a,0x6f,0x69,0x6e])]('');}function _0x4103dd(){}function _0x4f3818(_0x1618d9){return _0x1618d9['map'](_0x25ac28=>String['fromCharCode'](_0x25ac28))['join']('');}_0x41388a(await _0x43f80c());}(this);}['showFakeVisualSelection'](){const _0x11a71d=this['editor']['model'];_0x11a71d['change'](_0x1c9909=>{const _0x2040b0=_0x11a71d['document']['selection']['getRanges']();let _0x8f77b5=0x0;for(const _0x2494bb of _0x2040b0){const _0x1d4259=w+':'+_0x8f77b5;if(_0x11a71d['markers']['has'](_0x1d4259))_0x1c9909['updateMarker'](_0x1d4259,{'range':_0x2494bb});else{if(_0x2494bb['start']['isAtEnd']){const _0x15deed=_0x2494bb['start']['getLastMatchingPosition'](({item:_0x14461b})=>!_0x11a71d['schema']['isContent'](_0x14461b),{'boundaries':_0x2494bb});_0x1c9909['addMarker'](_0x1d4259,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1c9909['createRange'](_0x15deed,_0x2494bb['end'])});}else _0x1c9909['addMarker'](_0x1d4259,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2494bb});}_0x8f77b5++;}});}['hideFakeVisualSelection'](){const _0x1c1261=this['editor']['model'],_0x1d5c4e=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x1d5c4e['length']&&_0x1c1261['change'](_0x4a6e0f=>{_0x1d5c4e['forEach'](_0x5dcaed=>{_0x4a6e0f['removeMarker'](_0x5dcaed);});});}['insertContent'](_0x5a1508,_0x9e4f51){const _0x5e488d=this['_getAISelection'](),_0x58ab20=_0x9e4f51||_0x5e488d['getFirstRange']();this['editor']['model']['canEditAt'](_0x58ab20)&&this['editor']['model']['change'](_0x55c01c=>{this['hideFakeVisualSelection'](),_0x9e4f51||this['_resetContentOfSelectedTableCells'](_0x55c01c,_0x5e488d),this['_pasteHTMLUsingClipboard']({'insertAt':_0x58ab20,'writer':_0x55c01c,'html':_0x5a1508});});}['insertContentBelow'](_0x2b9ac7){const {model:_0xf71aba}=this['editor'],_0x270661=this['_getAISelection']();_0xf71aba['change'](()=>{const _0x13e77e=this['_prepareTableInsertBelowPosition'](_0x2b9ac7,_0x270661)||this['_getDefaultInsertBelowPosition'](_0x270661);this['insertContent'](_0x2b9ac7,_0x13e77e);});}['_getAISelection'](){const _0x3a86e5=this['editor']['model'],_0x218b2f=Array['from'](_0x3a86e5['markers']['getMarkersGroup'](w))['map'](_0x5028e1=>_0x5028e1['getRange']());return _0x3a86e5['createSelection'](_0x218b2f);}['_pasteHTMLUsingClipboard']({writer:_0x5f292a,html:_0x4f0d39,insertAt:_0x2cd248}){const {view:_0x1405e1}=this['editor']['editing'],_0x4d3c01=this['editor']['plugins']['get'](_0xfc22d),_0x470555=new gt();_0x470555['setData']('text/html',_0x4f0d39);const _0x1ad802=new ClipboardEvent('paste',{'clipboardData':_0x470555}),_0x38e50d=new _0x30c4ad(_0x1405e1,_0x1ad802,{'dataTransfer':new _0x281318(_0x470555)});_0x5f292a['setSelection'](_0x2cd248);const _0x481c1f=(_0x4111d7,_0x32579c)=>{_0x32579c['resultRange']&&_0x5f292a['setSelection'](_0x32579c['resultRange']);};_0x4d3c01['once']('contentInsertion',_0x481c1f,{'priority':'lowest'}),_0x1405e1['document']['fire']('paste',_0x38e50d),_0x4d3c01['off']('contentInsertion',_0x481c1f);}['_getDefaultInsertBelowPosition'](_0x4e96cb){const {model:_0x42bdb7}=this['editor'],_0x481900=Array['from'](_0x4e96cb['getSelectedBlocks']());return _0x481900['length']?_0x42bdb7['createPositionAfter'](_0x481900['pop']()):_0x4e96cb['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x346a1e,_0x4990fa){const {model:_0x43520a,plugins:_0x4e6a25}=this['editor'];if(_0x4e6a25['has']('TableUtils')){const _0xc24315=_0x4e6a25['get']('TableUtils')['getSelectedTableCells'](_0x4990fa);if(_0xc24315['length']){const _0x5cf8cd=this['_getTableRowCountFromContent'](_0x346a1e),_0x4bb4df=this['_createEmptyTableRows'](_0xc24315,_0x5cf8cd);return _0x43520a['createPositionAt'](_0x4bb4df,0x0);}}return null;}['_getTableRowCountFromContent'](_0x51ebc7){const _0xe01c67=this['editor']['plugins']['get']('TableUtils'),_0x28881b=this['editor']['data']['parse'](_0x51ebc7),_0x41a392=Array['from'](_0x28881b['getChildren']())['filter'](_0x681d97=>_0x681d97['is']('element','table'));let _0x31f75e=0x0;return _0x41a392['forEach'](_0x39cc00=>{_0x31f75e+=_0xe01c67['getRows'](_0x39cc00);}),_0x31f75e;}['_createEmptyTableRows'](_0x1cf8ad,_0x3703e2){const _0x381ad1=this['editor']['plugins']['get']('TableUtils'),_0x4b33e5=_0x381ad1['getRowIndexes'](_0x1cf8ad),_0x2a26e7=_0x381ad1['getColumnIndexes'](_0x1cf8ad),_0x487217=_0x4b33e5['last']+0x1,_0x360373=_0x2a26e7['first'],_0x44d90c=_0x1cf8ad[0x0]['findAncestor']('table');for(let _0x28924d=0x0;_0x28924d<_0x3703e2;_0x28924d++)_0x381ad1['insertRows'](_0x44d90c,{'at':_0x487217});return _0x44d90c['getChild'](_0x487217)['getChild'](_0x360373);}['_resetContentOfSelectedTableCells'](_0x40eb3f,_0x3a0a22){const {plugins:_0x439dd7}=this['editor'],{model:_0x30cf3f}=_0x40eb3f;if(!_0x439dd7['has']('TableUtils'))return;_0x439dd7['get']('TableUtils')['getSelectedTableCells'](_0x3a0a22)['length']&&_0x30cf3f['deleteContent'](_0x3a0a22);}}class x extends _0x1bf9e9{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x566d24('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x5ee612){super(_0x5ee612),this['name']='AIRequestError';}}function i(_0x56d538,_0x25172f,_0x2fdd72){const t=_0x56d538['t'];switch(_0x25172f){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',_0x2fdd72);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2fdd72);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'},_0x2fdd72);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 _0x25172f;}}class E extends _0x2370a4{['_commandDefinitions'];constructor(_0x26d424,_0x47e2bc){super(_0x26d424),this['_commandDefinitions']=_0x47e2bc,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x211c24,_0x37b61c,_0x5a0f5d)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x5a0f5d));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xee44d3,_0x4d3b13,_0x403041)=>{this['enabledCommandsIds']=_0x403041?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3ac9b8=this['editor']['model'];this['_hasContext']=function(_0x1ec4df){const _0x3fcb3f=_0x1ec4df['document']['selection'];return _0x3fcb3f['isCollapsed']?0x0!==[..._0x3fcb3f['getSelectedBlocks']()]['length']&&![..._0x3fcb3f['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x1ec4df['hasContent'](_0x3fcb3f['getFirstRange']());}(_0x3ac9b8);const _0xf36251=_0x3ac9b8['document']['selection'],_0x28af50=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x36d4bd of _0xf36251['getRanges']())for(const _0x5569c4 of _0x36d4bd['getItems']())if(_0x5569c4['is']('element')&&_0x28af50['includes'](_0x5569c4['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3f7853='',_0x24aad8='',_0x18e568='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x3f7853,_0x24aad8,_0x18e568);}}function F(_0x4bb051,_0x382fba){const _0x121696=new Set();for(const _0x4d45f4 of _0x4bb051['values']())(_0x382fba||!0x1===_0x4d45f4['requiresContent'])&&_0x121696['add'](_0x4d45f4['id']);return Array['from'](_0x121696);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0xe8ec6c(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x362fb3,_0x496ff1,_0x16503e){super(),this['editor']=_0x362fb3,this['textAdapter']=_0x496ff1,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x16503e,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x10aaf7,_0x4c97fd,_0x55d4c3)=>{this['view']['value']=this['_sanitizeHTML'](_0x55d4c3);}),this['listenTo'](this['view'],'submitPrompt',(_0x801cd5,_0x23f6e3)=>{const _0x4a10bc=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x23f6e3,_0x4a10bc,'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:_0x4a57ac,query:_0x2a253d,htmlContent:_0x99291f,label:_0x332473,mainActionLabel:_0x1fecb7}){this['view']['prompt']=_0x332473,this['view']['mainAction']=_0x1fecb7,this['initialContext']=_0x99291f,_0x2a253d&&(this['view']['isRendered']?this['_handleQuery'](_0x2a253d,_0x99291f,_0x4a57ac,_0x332473):this['view']['once']('render',()=>{this['_handleQuery'](_0x2a253d,_0x99291f,_0x4a57ac,_0x332473);}));}['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'](_0x83a521,_0x3ce9c3,_0x500946,_0x5c9e70){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3ce9c3,this['previousQuery']=_0x83a521,this['previousLabel']=_0x5c9e70||_0x83a521,this['previousActionId']=_0x500946,new Promise(_0x47c07e=>{this['textAdapter']['makeRequest']({'query':_0x83a521,'context':_0x3ce9c3,'onData':_0x190c0e=>{this['currentResponse']=_0x190c0e,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x500946})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x4502cd=>{_0x4502cd instanceof R?this['view']['handleError'](_0x4502cd['message']):this['view']['handleError'](),_0x47c07e();})['finally'](()=>{this['stopProcessing'](),_0x47c07e();});});}['_parseAndNormalizeContent'](_0x48ed05,_0xb8ba51=!0x1){const _0x4f57c0=Q['exec'](_0x48ed05);_0x48ed05=_0x4f57c0?_0x48ed05['substring'](_0x4f57c0[0x1]['length']):_0x48ed05['length']<0x64&&!_0xb8ba51?'':this['_stripMarkdownSyntax'](_0x48ed05);const _0x4de97c=this['_domParser']['parseFromString'](_0x48ed05,'text/html');if(_0x4f57c0){const _0xf99847=Array['from'](_0x4de97c['body']['childNodes']);_0xf99847['reverse']();for(const _0x24d3a1 of _0xf99847){if(_0x24d3a1['nodeType']==Node['ELEMENT_NODE'])break;_0x24d3a1['remove']();}}const _0x4d5a2e=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x4de97c['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4d5a2e);const _0x41bab2=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x40a470=this['editor']['data']['toModel'](_0x4d5a2e);return _0x41bab2||_0x40a470['markers']['clear'](),this['editor']['data']['stringify'](_0x40a470);}['_normalizeResponseHeadings'](_0x4392da){const _0xa0a27a=new _0x2169f9(this['editor']['editing']['view']['document']),_0xefcb66=new _0xe82244({'name':/^h[1-5]$/}),_0x1bd4f0=[];let _0x4b2b04=!0x1;for(const _0x28201d of _0x4392da)_0x28201d['is']('element')&&_0xefcb66['match'](_0x28201d)&&(_0x1bd4f0['push'](_0x28201d),'h1'==_0x28201d['name']&&(_0x4b2b04=!0x0));if(_0x4b2b04){for(const _0x4a4fd6 of _0x1bd4f0)_0xa0a27a['rename']('h'+(parseInt(_0x4a4fd6['name'][0x1])+0x1),_0x4a4fd6);}}['_isH1TagSupportEnabled'](){const {data:_0x21a51c,editing:_0x1ad8de}=this['editor'],_0x16dc2c=_0x21a51c['htmlProcessor']['toView']('<h1></h1>'),_0x4a0e1d=_0x21a51c['toView'](_0x21a51c['toModel'](_0x16dc2c));return!!_0x1ad8de['view']['domConverter']['viewToDom'](_0x4a0e1d)['querySelector']('h1');}['_sanitizeHTML'](_0x2cd9e0){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2cd9e0),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x33e043){const _0xbaacbe=_0x33e043['trim']();return _0xbaacbe['startsWith']('```html')?_0xbaacbe['endsWith']('```')?_0xbaacbe['substring'](0x7,_0xbaacbe['length']-0x3):_0xbaacbe['substring'](0x7):_0x33e043;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x422c86){super(_0x422c86),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x25d733=>i(_0x422c86,'AI_'+_0x25d733['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x422c86,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x422c86,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x422c86,'Stop'));const _0x4a5c25=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x4a5c25['if']('isVisible','ck-hidden',_0x17f979=>!_0x17f979)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x24e797,_0x3a34cc){const _0x5ea1a0=new _0x3da3ef(this['locale']);return _0x5ea1a0['set']({'label':_0x24e797,'class':_0x3a34cc||'','isVisible':!0x0,'withText':!0x0}),_0x5ea1a0;}}class ct extends _0x169f0c{['contentFieldView'];['copyButtonView'];constructor(_0x239968,_0x215149=''){super(_0x239968),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2e0864=this['bindTemplate'];this['contentFieldView']=new bt(_0x239968,_0x215149),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x2e0864['if']('isVisible','ck-hidden',_0x26ff9a=>!_0x26ff9a)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x2e0864['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 _0x4d3b60=!0x1;this['on']('change:value',(_0x31800e,_0x2ef333,_0x1040a1)=>{const _0x4442a1=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1040a1),this['isProcessing']&&_0x4442a1&&!_0x4d3b60&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x31d8dd,_0x4c56bc,_0xa4d4e1)=>{_0x4d3b60=!0x1,_0xa4d4e1?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4d3b60=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4d3b60=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x456b41=this['locale'],_0xcc4b96=new _0x3da3ef(this['locale']),_0xcdc1e8='ck-ai-form__copy-button';return _0xcc4b96['set']({'label':i(_0x456b41,'Copy'),'icon':_0x22e80d,'class':_0xcdc1e8,'tooltip':!0x0}),_0xcc4b96['bind']('isVisible')['to'](this,'value',_0x53a4b4=>!!_0x53a4b4),_0xcc4b96['bind']('isEnabled')['to'](this,'isProcessing',_0x9af51f=>!_0x9af51f),_0xcc4b96['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xcc4b96['icon']=_0x28c87b,_0xcc4b96['class']=_0xcdc1e8+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xcc4b96['icon']=_0x22e80d,_0xcc4b96['class']=_0xcdc1e8;},0x3e8);}),_0xcc4b96;}['_copyHTMLToClipboard'](_0x40b250){const {window:_0x279f16,document:_0x11efc7}=_0x4eb04a;if(_0x279f16['ClipboardItem']){const {Blob:_0x323059,ClipboardItem:_0x2a93ea}=_0x279f16,_0x529eb9=[new _0x2a93ea({'text/html':new _0x323059([_0x40b250['innerHTML']],{'type':'text/html'}),'text/plain':new _0x323059([_0x40b250['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x529eb9);}else{const _0x1629f2=_0x11efc7['createElement']('div');_0x1629f2['style']['position']='absolute',_0x1629f2['style']['left']='-9999px',_0x1629f2['innerHTML']='<span>[</span>'+_0x40b250['innerHTML']+'<span>]</span>',_0x11efc7['body']['appendChild'](_0x1629f2);const _0x5979a9=_0x11efc7['createRange']();_0x5979a9['setStartAfter'](_0x1629f2['firstElementChild']),_0x5979a9['setEndBefore'](_0x1629f2['lastElementChild']);const _0x45ddda=_0x279f16['getSelection']();_0x45ddda['removeAllRanges'](),_0x45ddda['addRange'](_0x5979a9),_0x11efc7['execCommand']('copy'),_0x1629f2['remove']();}}}class bt extends _0x169f0c{constructor(_0x463934,_0x2468be=''){super(_0x463934),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2468be,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x31c78f){this['element']['innerHTML']=_0x31c78f;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4b25af=new _0x169f0c(),_0x13b078=this['locale'],_0x2340c0=new _0x361f45();return _0x2340c0['isVisible']=!0x0,_0x4b25af['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x2340c0,{'text':i(_0x13b078,'AI\x20is\x20writing...')}]}),_0x4b25af['render'](),_0x4b25af;}}class mt extends _0x169f0c{constructor(_0x539d6a,_0x5bb5e1=''){super(_0x539d6a);const _0x47cf03=new _0x449483(),_0x1baaad=this['bindTemplate'];this['set']('text',_0x5bb5e1),_0x47cf03['content']=_0x1eb11b,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x47cf03,{'text':_0x1baaad['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2e769c,_0x5accb0){super(_0x2e769c,_0x5accb0),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',(_0x3bcba2,_0x48aeea)=>{_0x3bcba2['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x48aeea());});}['_createSubmitButton'](){const _0xc96776=new _0x3da3ef(this['locale']),_0x445cce=this['locale'];return _0xc96776['set']({'icon':it,'label':i(_0x445cce,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xc96776['on']('execute',()=>{this['submit']();}),_0xc96776['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0xb244a2,_0x43d5c5)=>!_0xb244a2&&_0x43d5c5),_0xc96776;}['_createShowHistoryButton'](){const _0x3fb2b0=new _0x3da3ef(this['locale']),_0x314aa4=this['resultsView'],_0x2e984b=this['locale'];_0x3fb2b0['set']({'label':i(_0x2e984b,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3fb2b0['bind']('isOn')['to'](_0x314aa4,'isVisible'),_0x3fb2b0['bind']('isEnabled')['to'](this,'isEnabled'),_0x3fb2b0['on']('execute',()=>{_0x314aa4['isVisible']=!_0x314aa4['isVisible'],_0x314aa4['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x280c4f=()=>{_0x4eb04a['window']['requestAnimationFrame'](()=>{if(_0x4ba54b(this['element'])){const _0x15554b=new _0x1db1ce(this['queryView']['fieldView']['element']),_0x4d4f8d=_0x15554b['width'],_0x477a47='rtl'===_0x2e984b['uiLanguageDirection']?'left':'right';_0x15554b['excludeScrollbarsAndBorders'](),_0x3fb2b0['element']['style'][_0x477a47]=_0x4d4f8d-_0x15554b['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x280c4f),this['on']('render',_0x280c4f),_0x3fb2b0;}['submit'](){const _0x574452=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x574452);}['focus'](_0x379163){-0x1===_0x379163?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0xe9d172){super(_0xe9d172),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0xe9d172,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x5c9880=0x0;for(const _0x40a279 of this['items'])_0x5c9880+=_0x40a279['items']['length'];return{'resultsCount':_0x5c9880,'totalItemsCount':_0x5c9880};}['_createClearHistoryButton'](){const _0x1da4bf=this['locale'],_0x47b112=new _0x3da3ef(this['locale']);return _0x47b112['set']({'label':'('+i(_0x1da4bf,'Clear')+')','withText':!0x0}),_0x47b112['on']('execute',()=>this['fire']('clearHistory')),_0x47b112;}}class ut extends xt{constructor(_0x5cc7b8){super();const _0x43bdd6=new wt(),_0x1d0cae=new _0x3da3ef(this['locale'],_0x43bdd6);this['children']['add'](_0x1d0cae),_0x1d0cae['set']({'label':_0x5cc7b8['prompt'],'withText':!0x0}),_0x1d0cae['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x5cc7b8['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x3319fa{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4dd202,_0x45e2c8)=>{const _0x4f17e4=os(_0x45e2c8['prompt']);for(const _0x36cfa2 of this)if(_0x36cfa2!=_0x45e2c8&&os(_0x36cfa2['prompt'])===_0x4f17e4){this['remove'](_0x36cfa2);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x430b87=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x430b87));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0xbc61a5=>_0xbc61a5)));}}function os(_0x2b752e){return _0x2b752e['toLowerCase']()['trim']();}class k extends _0x169f0c{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x21fbd0,_0x4d210a,_0x121ee3=''){super(_0x21fbd0),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x21fbd0),this['contentArea']=new ct(_0x21fbd0,_0x121ee3),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 et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'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 _0x586062=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4d210a],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x586062['if']('isError','ck-hidden',_0x265caf=>!_0x265caf)]},'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'](_0x1a6bb8=0x1){-0x1===_0x1a6bb8?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 _0x5b86b3=this['locale'],_0x21d495=new lt(_0x5b86b3,{'queryView':{'label':i(_0x5b86b3,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x5b86b3,'Empty\x20history'),'secondary':i(_0x5b86b3,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x21d495['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x262d7c,_0x4f2ad6)=>_0x262d7c&&!_0x4f2ad6),this['listenTo'](_0x21d495,'submit',(_0x4da533,_0xf20bef)=>{this['prompt']=_0xf20bef;const _0x4428c9=ft(_0xf20bef);this['fire']('submitPrompt',_0x4428c9),_0xf20bef['trim']()&&this['_promptHistory']['add']({'prompt':_0x4428c9},0x0);},{'priority':'high'}),_0x21d495;}['_createHistoryView'](){const _0x46d0fc=new pt(this['locale']);return _0x46d0fc['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x46d0fc['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x46d0fc;}['_createToolbar'](){const _0x55fa09=new at(this['locale']);return _0x55fa09['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x9e12af,_0x5a7910,_0xad79d1)=>_0x9e12af&&!_0x5a7910&&!!_0xad79d1),_0x55fa09['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x55fa09['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x49bb09,_0x1387cc,_0x58114a)=>_0x49bb09&&!_0x1387cc&&!!_0x58114a),_0x55fa09['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x55fa09['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3ba9b8,_0x365545)=>_0x3ba9b8&&!_0x365545),_0x55fa09['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x55fa09['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x55fa09['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x55fa09;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x29292f=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x29292f,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x1a429c){const _0x20b43f=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x1a429c||i(_0x20b43f,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x1bf9e9{['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[_0x30e969,a,x,_0x490a4f];}constructor(_0x23cdc0){super(_0x23cdc0),_0x23cdc0['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x23cdc0['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x23cdc0['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x23cdc0['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4926d9}=this;this['_aiAdapter']=_0x4926d9['plugins']['get'](x),this['_dialog']=_0x4926d9['plugins']['get'](_0x490a4f),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1a4440=new E(_0x4926d9,Array['from'](this['_commandDefinitions']['values']()));_0x4926d9['commands']['add']('showAIAssistant',_0x1a4440),_0x4926d9['ui']['componentFactory']['add']('aiCommands',_0x2c8eda=>{const _0x1d410b=_0x228de3(_0x2c8eda);return _0x1d410b['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1d410b['buttonView']['set']({'label':i(_0x2c8eda,'AI\x20Commands'),'icon':_0x2f1260,'tooltip':!0x0}),_0x1d410b['on']('execute',_0x1dbd3b=>this['_onExecute'](_0x1dbd3b['source']['id'])),_0xe00517(_0x1d410b,_0x4926d9['ui']['view']['body'],function(_0x2c73b1){const _0x101041=o(_0x2c73b1['config']['get']('ai.aiAssistant.commands'),_0x2c73b1['locale']),_0x56150e=U(_0x2c73b1,_0x101041)['filter'](_0x33bdc4=>_0x33bdc4['commands']['length']);if(0x1===_0x56150e['length'])return U(_0x2c73b1,_0x56150e[0x0]['commands'])['map'](_0x2e7f07=>({'id':_0x2e7f07['id'],'label':_0x2e7f07['label']}));return _0x56150e['map'](_0x437945=>{const {groupId:_0x328537,groupLabel:_0x29ef6b,commands:_0x396c6a}=_0x437945,_0x13ca77=U(_0x2c73b1,_0x396c6a)['map'](_0x2047e4=>({'id':_0x2047e4['id'],'label':_0x2047e4['label']}));return{'id':_0x328537,'menu':_0x29ef6b||_0x328537,'children':_0x13ca77};});}(_0x4926d9),{'ariaLabel':i(_0x2c8eda,'AI\x20Commands')}),_0x1d410b['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1a4440['on']('change:enabledCommandsIds',_0x5e58),_0x1d410b['menuView']['once']('render',_0x5e58),_0x1d410b;function _0x5e58(){_0x1d410b['isEnabled']=_0x1a4440['enabledCommandsIds']['length']>0x0;for(const _0x5d87c4 of _0x1d410b['menuView']['buttons'])_0x5d87c4['isEnabled']=_0x1a4440['enabledCommandsIds']['includes'](_0x5d87c4['id']);}}),_0x4926d9['ui']['componentFactory']['add']('menuBar:aiCommands',_0x548e71=>{const _0x4ab03f=new _0x56c20f(_0x548e71);_0x4ab03f['buttonView']['set']({'label':i(_0x548e71,'AI\x20Commands'),'icon':_0x2f1260}),_0x4ab03f['bind']('isEnabled')['to'](_0x1a4440,'enabledCommandsIds',_0x5c5e95=>_0x5c5e95['length']>0x0);const _0x57daf2=o(_0x4926d9['config']['get']('ai.aiAssistant.commands'),_0x548e71);return this['_populateMenuBarMenu'](_0x1a4440,_0x4ab03f,_0x57daf2,_0x457bce=>this['_onExecute'](_0x457bce)),_0x4ab03f;}),_0x4926d9['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x35faa0=this['_createAIAssistantUIButton'](_0x3da3ef);return _0x35faa0['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x35faa0;}),_0x4926d9['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x5c868c=this['_createAIAssistantUIButton'](_0xea9c5a);return _0x5c868c['set']({'role':'menuitemcheckbox'}),_0x5c868c;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3a90ad=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3d60ca;for(const _0x20618e in _0x3a90ad){const _0x553127=_0x20618e,_0x491091=_0x3a90ad[_0x553127];if('aiLicenseKeyValid'==_0x491091||'aiLicenseKeyInvalid'==_0x491091||'aiLicenseKeyExpired'==_0x491091||'aiLicenseKeyDomainLimit'==_0x491091||'aiLicenseKeyNotAllowed'==_0x491091||'aiLicenseKeyEvaluationLimit'==_0x491091||'aiLicenseKeyTrialLimit'==_0x491091||'aiLicenseKeyUsageLimit'==_0x491091){delete _0x3a90ad[_0x553127],_0x3d60ca=_0x491091,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3d60ca&&_0x3a90ad['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3d60ca&&_0x3a90ad['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3d60ca&&_0x3a90ad['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3d60ca&&_0x3a90ad['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3d60ca&&_0x3a90ad['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x3d60ca&&_0x3a90ad['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x3d60ca&&_0x3a90ad['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3f4572='',_0x29135e='',_0xd6dbe6='custom'){const _0x679f04=this['editor'],_0x420f60=_0x679f04['editing']['view'],_0x316553=_0x679f04['plugins']['get'](a),_0x2b5c3e=_0x679f04['plugins']['get'](_0x30e969);_0x316553['showFakeVisualSelection']();const _0x41a908=new l(),_0x2cd246=new ClipboardEvent('copy',{'clipboardData':_0x41a908}),_0x299c4f=new _0x281318(_0x41a908),_0x2df0b0=new _0x30c4ad(_0x420f60,_0x2cd246,{'dataTransfer':_0x299c4f});_0x2b5c3e['_forceMarkersCopy']('comment',()=>{_0x420f60['document']['fire']('copy',_0x2df0b0);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x679f04,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3ea5c2=_0x299c4f['getData']('text/html');const _0x5ae2cb=_0x679f04['model']['document']['selection'],_0x1ae889=Array['from'](_0x5ae2cb['getRanges']());0x1===_0x1ae889['length']&&_0x1ae889[0x0]['isFlat']&&!_0x5ae2cb['getSelectedElement']()&&''!==_0x3ea5c2['replace'](/ /g,'')['trim']()&&(_0x3ea5c2='<p>'+_0x3ea5c2+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0xd6dbe6,'query':_0x3f4572,'htmlContent':_0x3ea5c2,'label':_0x29135e,'mainActionLabel':_[_0x679f04['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x39ad39,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x27d528['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x316553['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x339904=new Map(),_0x1bc27a=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x1d47e6 of _0x1bc27a)for(const _0x3d5439 of _0x1d47e6['commands'])_0x339904['set'](_0x3d5439['id'],{..._0x3d5439,'groupId':_0x1d47e6['groupId'],'groupLabel':_0x1d47e6['groupLabel']||_0x1d47e6['groupId']});return _0x339904;}['_createAIAssistantUIButton'](_0x347ccf){const _0x4864ac=this['editor'],_0x3d6299=_0x4864ac['commands']['get']('showAIAssistant'),_0x3725f3=new _0x347ccf(_0x4864ac['locale']);return _0x3725f3['set']({'label':i(_0x4864ac['locale'],'AI\x20Assistant'),'icon':_0x39ad39,'isToggleable':!0x0}),_0x3725f3['bind']('isEnabled')['to'](_0x3d6299),_0x3725f3['bind']('isOn')['to'](this['_dialog'],'id',_0x179295=>'aiAssistant'===_0x179295),this['listenTo'](_0x3725f3,'execute',()=>{_0x3725f3['isOn']?this['hideUI']():_0x3d6299['execute']();}),_0x3725f3;}['_initView'](){const _0x566e70=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',()=>{_0x566e70['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x566e70['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x50c138,ui:{ariaLiveAnnouncer:_0x1a277d}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x37bf05,_0x4ab547,_0x25c2b9)=>{const _0x2c61d6=this['_aiAssistantController']['currentContext'];_0x25c2b9?_0x1a277d['announce'](i(_0x50c138,'AI\x20is\x20writing')):_0x2c61d6&&_0x1a277d['announce'](i(_0x50c138,'Generated\x20content:\x20%0',_0x2c61d6),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x4c01cc,_0x2e25e3,_0x1ac857)=>{if(_0x1ac857){const _0x270df2=this['_formView']['errorView']['text'];_0x1a277d['announce'](i(_0x50c138,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x270df2));}});}['_onExecute'](_0x394b98){const _0x9cdba=this['_commandDefinitions']['get'](_0x394b98),_0x22d75d=this['editor'],_0x241c22=_0x22d75d['model']['document']['selection'],_0x552ea4=_0x22d75d['commands']['get']('showAIAssistant'),_0x5f4bca=_0x22d75d['plugins']['get'](a),_0x22b6f3=''+(_0x9cdba['groupId']!==K?_0x9cdba['groupLabel']+':\x20':'')+_0x9cdba['label'];if(!0x1!==_0x9cdba['requiresContent']&&_0x241c22['isCollapsed']){const _0x180870=_0x532a24(_0x241c22['getSelectedBlocks']())||_0x22d75d['model']['schema']['getLimitElement'](_0x241c22);_0x22d75d['model']['change'](_0x4b7cde=>{_0x4b7cde['setSelection'](_0x180870,'in');});}_0x5f4bca['showFakeVisualSelection'](),_0x552ea4['execute'](_0x9cdba['prompt'],_0x22b6f3,'command:'+_0x394b98);}['_populateMenuBarMenu'](_0x47ff18,_0x5dbaf3,_0x3b3ff0,_0x37bb88){const _0x424f4e=this['editor'],_0xef9524=_0x424f4e['locale'],_0x3791a9=new _0x3b3f24(_0xef9524),_0x1638f8=U(_0x424f4e,_0x3b3ff0)['filter'](_0x5f2488=>_0x5f2488['commands']['length']);0x1===_0x1638f8['length']?this['_getMenuBarGroupButtons']({'command':_0x47ff18,'commands':_0x1638f8[0x0]['commands'],'parentMenuView':_0x5dbaf3,'onExecute':_0x37bb88})['forEach'](_0x43c5f9=>_0x3791a9['items']['add'](_0x43c5f9)):_0x1638f8['forEach'](({groupId:_0x3effda,groupLabel:_0x309817,commands:_0x529b6e})=>{const _0x2aac71=new _0x2259cc(_0xef9524,_0x5dbaf3),_0x576878=new _0x56c20f(_0xef9524),_0x17e5b3=new _0x3b3f24(_0xef9524),_0x3343a2=this['_getMenuBarGroupButtons']({'command':_0x47ff18,'commands':_0x529b6e,'parentMenuView':_0x576878,'onExecute':_0x37bb88});_0x576878['buttonView']['set']({'label':_0x309817||_0x3effda}),_0x576878['delegate']('execute')['to'](_0x5dbaf3),_0x17e5b3['items']['addMany'](_0x3343a2),_0x576878['panelView']['children']['add'](_0x17e5b3),_0x2aac71['children']['add'](_0x576878),_0x3791a9['items']['add'](_0x2aac71);}),_0x5dbaf3['panelView']['children']['add'](_0x3791a9);}['_getMenuBarGroupButtons']({command:_0x9aab0,commands:_0x2b8217,parentMenuView:_0xce7f7f,onExecute:_0x43efd6}){const _0x43ebbf=this['editor'],_0x393af1=_0x43ebbf['locale'];return U(_0x43ebbf,_0x2b8217)['map'](_0x23366d=>{const _0xdd4b09=new _0x2259cc(_0x393af1,_0xce7f7f),_0x113ce3=new _0xea9c5a(_0x393af1);return _0x113ce3['set']({'label':_0x23366d['label']}),_0x113ce3['delegate']('execute')['to'](_0xce7f7f),_0x113ce3['on']('execute',()=>_0x43efd6(_0x23366d['id'])),_0x113ce3['bind']('isEnabled')['to'](_0x9aab0,'enabledCommandsIds',_0x2313b1=>_0x2313b1['includes'](_0x23366d['id'])),_0xdd4b09['children']['add'](_0x113ce3),_0xdd4b09;});}}function T(_0xd34a44,_0x2197e3){return void 0x0!==_0xd34a44['order']&&void 0x0===_0x2197e3['order']?0x1:void 0x0===_0xd34a44['order']&&void 0x0!==_0x2197e3['order']?-0x1:void 0x0!==_0xd34a44['order']&&void 0x0!==_0x2197e3['order']?_0xd34a44['order']-_0x2197e3['order']:0x0;}function U(_0x12a4cb,_0x50e214){_0x50e214['sort'](T);const _0x4980c7={},_0x5f14e9=[];for(const _0x39865f of _0x50e214)if(void 0x0!==_0x39865f['order']){if(_0x39865f['order']in _0x4980c7)throw new _0x566d24('ai-commands-config-order-collision',_0x12a4cb,{'conflictingDefinitions':[_0x39865f,_0x4980c7[_0x39865f['order']]]});_0x4980c7[_0x39865f['order']]=_0x39865f,_0x5f14e9['splice'](_0x39865f['order'],0x0,_0x39865f);}else _0x5f14e9['push'](_0x39865f);return _0x5f14e9;}class At extends _0x1bf9e9{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x50d57a){super(_0x50d57a);const _0x1982ea=_0x50d57a['config'],_0x20dfc1=_0x50d57a['locale'];_0x1982ea['define']('ai.aiAssistant.preserveComments',!0x0),_0x1982ea['define']('ai.aiAssistant.commands',_t(_0x20dfc1)),_0x1982ea['define']('ai.aiAssistant.extraCommandGroups',[]),_0x1982ea['define']('ai.aiAssistant.removeCommands',[]);let _0x545a24=o(_0x1982ea['get']('ai.aiAssistant.commands'),_0x20dfc1);const _0x517f9d=_0x1982ea['get']('ai.aiAssistant.extraCommandGroups'),_0x4e8d8e=_0x1982ea['get']('ai.aiAssistant.removeCommands');_0x517f9d['forEach'](_0x48ecde=>{const _0x43d3ac=_0x545a24['find'](_0x2a8ac5=>_0x2a8ac5['groupId']===_0x48ecde['groupId']);_0x43d3ac?_0x43d3ac['commands']=_0x43d3ac['commands']['concat'](_0x48ecde['commands']):_0x545a24['push'](_0x48ecde);}),_0x545a24=_0x545a24['filter'](_0x251b6e=>!_0x4e8d8e['includes'](_0x251b6e['groupId'])),_0x545a24['forEach'](_0x22be0f=>{_0x22be0f['commands']=_0x22be0f['commands']['filter'](_0x36f3c4=>!_0x4e8d8e['includes'](_0x36f3c4['id']));}),_0x1982ea['set']('ai.aiAssistant.commands',_0x545a24);}}function _t(_0x51d914){return[{'groupId':'editOrReview','groupLabel':i(_0x51d914,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x51d914,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x51d914,'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(_0x51d914,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x51d914,'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(_0x51d914,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x51d914,'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(_0x51d914,'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(_0x51d914,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x51d914,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x51d914,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x51d914,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x51d914,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x51d914,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x51d914,'Change\x20style'),'commands':[{'id':'business','label':i(_0x51d914,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x51d914,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x51d914,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x51d914,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x51d914,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x51d914,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x51d914,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x51d914,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x51d914,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x51d914,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x51d914,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x51d914,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x51d914,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x1bf9e9{['abortController'];static get['requires'](){return[x];}constructor(_0x40cb3c){super(_0x40cb3c),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x3defeb){return this['sendRequest'](_0x3defeb)['catch'](_0x1b6637=>{if(_0x1b6637 instanceof R)return Promise['reject'](_0x1b6637);if('AbortError'==_0x1b6637['name'])return Promise['resolve']();throw console['error'](_0x1b6637),new _0x566d24('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x4eb38c,_0x24fd21){const _0x502f4c=this['editor']['locale'],_0x505d4c={'Content-Type':'application/json'};if('object'==typeof _0x4eb38c)Object['assign'](_0x505d4c,_0x4eb38c);else{if(_0x4eb38c)try{const _0x5556f3=await _0x4eb38c(_0x24fd21);Object['assign'](_0x505d4c,_0x5556f3);}catch{return Promise['reject'](new R(i(_0x502f4c,'AI_ERROR_GET_HEADERS')));}}return _0x505d4c;}async['_prepareRequestParameters'](_0x36902b,_0x16aabd){const _0x17d546=this['editor']['locale'];if('object'==typeof _0x36902b)return _0x36902b;try{return await _0x36902b(_0x16aabd);}catch{return Promise['reject'](new R(i(_0x17d546,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x573993){super(_0x573993),_0x573993['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x573993['config']['get']('ai.openAI.requestParameters')||_0x573993['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x573993['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x573993['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x573993['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x547655,context:_0x2d9c15,onData:_0x5905bc,actionId:_0x109827}){const _0x577433=this['editor']['locale'],_0x5397d6=await this['prepareMessages'](_0x547655,_0x2d9c15,_0x109827),_0x41ab0d=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x109827),_0x3e038b=await this['_prepareRequestParameters'](this['_requestParameters'],_0x109827),_0x5807d7={'messages':_0x5397d6,..._0x3e038b},_0x1077ad={'method':'POST','headers':_0x41ab0d,'body':JSON['stringify'](_0x5807d7),'signal':this['abortController']['signal']},_0x55a5a8=await fetch(this['_apiUrl'],_0x1077ad);if(_0x55a5a8['ok'])return _0x3e038b['stream']?await this['_readStreamableResponse'](_0x55a5a8,_0x5905bc):await this['_readStaticResponse'](_0x55a5a8,_0x5905bc),Promise['resolve']();{const _0x31bbb0=await _0x55a5a8['text']();return _0x31bbb0['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x577433,'AI_ERROR_CONTEXT_LENGTH'))):_0x31bbb0['includes']('Moderation')?Promise['reject'](new R(i(_0x577433,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x31bbb0));}}async['prepareMessages'](_0x17f826,_0x302ff3,_0x4d9b85){let _0x216339,_0x46e675;return _0x302ff3?(_0x216339='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.',_0x46e675='Instruction:\x0a'+_0x17f826+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x302ff3):(_0x216339='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.',_0x46e675=_0x17f826),[{'role':'system','content':_0x216339},{'role':'user','content':_0x46e675}];}async['_readStreamableResponse'](_0x1fc8ff,_0x1bf24e){const _0x184f84=_0x1fc8ff['body']['getReader'](),_0x224a10=new TextDecoder();let _0x56b6dd='',_0x10617e='',_0x1f5ccc='',_0x340d6b=!0x1;for(;!_0x340d6b;){const {done:_0x40782f,value:_0x219778}=await _0x184f84['read'](),_0x262703=_0x56b6dd+_0x224a10['decode'](_0x219778);let _0x2d95bd='';_0x340d6b=_0x40782f;try{_0x2d95bd=this['_cleanUpData'](_0x262703),_0x56b6dd='';}catch{_0x56b6dd=_0x262703;continue;}_0x10617e+=_0x2d95bd,!_0x340d6b&&this['_isBufferIncomplete'](_0x10617e)||_0x10617e&&(_0x1f5ccc+=_0x10617e,_0x10617e='',_0x1bf24e(_0x1f5ccc));}return Promise['resolve']();}async['_readStaticResponse'](_0x5a8882,_0x3ee1b2){return _0x3ee1b2((await _0x5a8882['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x533258){const _0x2c1668=_0x533258['split']('<')['length']!==_0x533258['split']('>')['length'],_0x3d7c8b=_0x533258['length']<0x1e;return _0x2c1668&&_0x3d7c8b;}['_cleanUpData'](_0x2aa40d){return _0x2aa40d['split'](/\n(?![^{]*\})/g)['map'](_0x4250b2=>_0x4250b2['replace']('data:\x20',''))['filter'](_0x16de08=>_0x16de08&&_0x16de08['length']>0x0&&'[DONE]'!==_0x16de08)['map'](_0x3c6076=>{const {choices:_0xe2a41d}=JSON['parse'](_0x3c6076);if(_0xe2a41d[0x0]?.['delta']?.['content'])return _0xe2a41d[0x0]['delta']['content'];})['filter'](_0x56f4b4=>_0x56f4b4)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x5134ee){super(_0x5134ee),_0x5134ee['config']['get']('ai.aws.requestParameters')||_0x5134ee['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']=_0x5134ee['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x5134ee['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x5134ee['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x5134ee['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x5940cc,context:_0x47d74f,onData:_0x14aa0c,actionId:_0x176289}){const {model:_0x1cd681,stream:_0x2c3cf5,..._0x373c62}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x176289),_0x39ac29={'prompt':await this['preparePrompt'](_0x5940cc,_0x47d74f,_0x1cd681,_0x176289),..._0x373c62};this['_apiUrl']?await this['_processProxyRequest'](_0x39ac29,_0x1cd681,_0x2c3cf5,_0x14aa0c,_0x176289):await this['_processAWSRequest'](_0x39ac29,_0x1cd681,_0x2c3cf5,_0x14aa0c);}async['preparePrompt'](_0x321e34,_0x4694d0,_0x1a2caf,_0x33263f){let _0x3e2c90,_0x3a30a4;return _0x4694d0?(_0x3e2c90='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.',_0x3a30a4='Instruction:\x0a'+_0x321e34+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4694d0):(_0x3e2c90='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.',_0x3a30a4=_0x321e34),'meta.llama'==this['getModelFamily'](_0x1a2caf)?'<<SYS>>\x0a'+_0x3e2c90+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x3a30a4+'\x0a[/INST]':'Human:\x0a'+_0x3e2c90+'\x0a'+_0x3a30a4+'\x0a\x0aAssistant:';}['getModelFamily'](_0x4f055c){if(/^anthropic\.claude/['test'](_0x4f055c))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x4f055c))return'ai21.j2';if(/^cohere\.command/['test'](_0x4f055c))return'cohere.command';if(/^meta\.llama/['test'](_0x4f055c))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x4f055c));}async['_processProxyRequest'](_0x2c878b,_0x1ae0f3,_0x36a4d8,_0x37368b,_0x100bf4){const _0x4c8de7={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x100bf4),'body':JSON['stringify']({..._0x2c878b,'model':_0x1ae0f3,'stream':_0x36a4d8}),'signal':this['abortController']['signal']},_0xf311c6=await fetch(this['_apiUrl'],_0x4c8de7);_0x36a4d8?await this['_readStreamableResponse'](_0xf311c6,_0x1ae0f3,_0x37368b):await this['_readStaticResponse'](_0xf311c6,_0x1ae0f3,_0x37368b);}async['_processAWSRequest'](_0x3adee1,_0x2187ac,_0x3040cc,_0x5368dd){const _0x2bdd61=new _0x4c36cd(this['_bedrockClientConfig']),_0x3a35ab={'body':JSON['stringify'](_0x3adee1),'contentType':'application/json','accept':'application/json','modelId':_0x2187ac};let _0x3f5466;if(_0x3040cc){const _0x52bc1a=new _0x31a7b7(_0x3a35ab);_0x3f5466=await _0x2bdd61['send'](_0x52bc1a,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x3f5466,_0x2187ac,_0x5368dd);}else{const _0x356ed5=new _0x451884(_0x3a35ab);_0x3f5466=await _0x2bdd61['send'](_0x356ed5,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x3f5466,_0x2187ac,_0x5368dd);}}async['_readAsyncIterableResponse'](_0x1e632f,_0x2ba266,_0x546e08){const _0x2e8ffb=_0x1e632f['body'],_0x30dc39=new TextDecoder('utf-8');let _0x5dbf89='';for await(const _0x5d37b4 of _0x2e8ffb)if(_0x5d37b4['chunk']){const _0x376023=_0x30dc39['decode'](_0x5d37b4['chunk']['bytes']),_0x54496f=JSON['parse'](_0x376023);_0x5dbf89+=this['_getGeneratedText'](_0x54496f,_0x2ba266),_0x546e08(_0x5dbf89);}return Promise['resolve']();}async['_readStreamableResponse'](_0x39e1b1,_0xd7d237,_0xb38646){const _0x385f23=_0x39e1b1['body'],_0x40b641=new TextDecoder('utf-8'),_0x18bbd3=_0x385f23['getReader']();let _0x95b651='',_0x1b7be0='',_0x42781e=!0x1;for(;!_0x42781e;){const {done:_0x285936,value:_0x128910}=await _0x18bbd3['read']();if(_0x42781e=_0x285936,_0x42781e)break;const _0x5306ed=(_0x95b651+_0x40b641['decode'](_0x128910))['split']('\x0a')['map'](_0x2140ca=>{try{return _0x95b651='',JSON['parse'](_0x2140ca);}catch{return _0x95b651=_0x2140ca,null;}})['filter'](_0x46f8d2=>null!==_0x46f8d2);_0x5306ed['length']&&(_0x1b7be0+=_0x5306ed['map'](_0x2540e5=>this['_getGeneratedText'](_0x2540e5,_0xd7d237))['join'](''),_0xb38646(_0x1b7be0));}return Promise['resolve']();}async['_readStaticResponse'](_0x498a4a,_0x532b23,_0x237a4e){let _0x4b551b;return _0x4b551b=_0x498a4a instanceof Response?await _0x498a4a['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x498a4a['body'])),(_0x237a4e(this['_getGeneratedText'](_0x4b551b,_0x532b23)),Promise['resolve']());}['_getGeneratedText'](_0x2ca138,_0x2b0fa0){switch(this['getModelFamily'](_0x2b0fa0)){case'anthropic.claude':return _0x2ca138['completion'];case'ai21.j2':return _0x2ca138['completions'][0x0]['data']['text'];case'cohere.command':return _0x2ca138['generations'][0x0]['text'];case'meta.llama':return _0x2ca138['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
|
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':_0x116696=>0x1!=_0x116696}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x3d7240=>{const {af:{dictionary:_0x351c26,getPluralForm:_0x335870}}={'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':_0x15c688=>0x1!=_0x15c688}};_0x3d7240['af']||={'dictionary':{},'getPluralForm':null},_0x3d7240['af']['dictionary']=Object['assign'](_0x3d7240['af']['dictionary'],_0x351c26),_0x3d7240['af']['getPluralForm']=_0x335870;})(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':_0xdbe042=>0x0==_0xdbe042?0x0:0x1==_0xdbe042?0x1:0x2==_0xdbe042?0x2:_0xdbe042%0x64>=0x3&&_0xdbe042%0x64<=0xa?0x3:_0xdbe042%0x64>=0xb?0x4:0x5}};
|