@ckeditor/ckeditor5-ai 46.0.1-alpha.1 → 46.0.1-alpha.10
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 _0x445f1d,Command as _0x264c7f}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x35790e,IconCheck as _0x501ee8,IconError as _0x4b13de,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x55a326,IconRobotPencil as _0x31cd4a}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x252ce,CKEditorError as _0x121e37,ObservableMixin as _0x3d44b9,global as _0x52b4bd,isVisible as _0x2fe5c6,Rect as _0x5ccf5c,Collection as _0x1d2ade,FocusTracker as et,KeystrokeHandler as rt,first as _0xa7c24}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x41d325,View as _0x3908bc,SpinnerView as _0x3e46f7,IconView as _0x4b658a,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x1a963f,createDropdown as _0x42d16c,addMenuToDropdown as _0x3f1bb6,MenuBarMenuView as _0x45507d,MenuBarMenuListItemButtonView as _0x22e955,DialogViewPosition as _0x45fd36,MenuBarMenuListView as _0x5bd3d0,MenuBarMenuListItemView as _0xd01a97}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x166864,ClipboardMarkersUtils as _0x56c6b4}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x52f274,ViewDataTransfer as _0x4683fe,ViewUpcastWriter as _0x2bcd5a,Matcher as _0x1981f7}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x34025c,InvokeModelWithResponseStreamCommand as _0x225c82,InvokeModelCommand as _0x711519}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x5ed33c,_0x4f9fdf){const _0x4a4bb9=(0x0,_0x4f9fdf['t'])('Other');return _0x5ed33c['length']?'groupId'in _0x5ed33c[0x0]?_0x5ed33c:[{'groupId':K,'groupLabel':_0x4a4bb9,'order':0x1/0x0,'commands':_0x5ed33c}]:[{'groupId':K,'groupLabel':_0x4a4bb9,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x445f1d{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x50421d}=this,_0x534f92=['ck-fake-ai-selection'];_0x50421d['config']['get']('ai.useTheme')&&_0x534f92['push']('ck-ai-assistant-ui_theme'),_0x50421d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x534f92,'priority':0xc}}),_0x50421d['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x413dda,{writer:_0x5d011e})=>{if(!_0x413dda['markerRange']['isCollapsed'])return null;const _0x3636ed=_0x5d011e['createUIElement']('span');return _0x5d011e['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3636ed),_0x3636ed;}});}['afterInit'](){!async function(_0x2d46c0){const _0x12cf18=_0x5307a4([0x71,0x76,0x77,0x6f,0x45,0x6a,0x30,0x62,0x36,0x4e,0x53,0x34,0x55,0x52,0x46,0x6d,0x75,0x44,0x49,0x47,0x70,0x58,0x78,0x4f,0x56,0x37,0x59,0x63,0x35,0x6c,0x38,0x4a,0x73,0x67,0x4d,0x69,0x61,0x68,0x43,0x48,0x66,0x54,0x72,0x4c,0x41,0x64,0x6e,0x51,0x79,0x33,0x6b,0x5a,0x57,0x74,0x42,0x32,0x50,0x7a,0x4b,0x31,0x65,0x39]),_0x563013=0x6aa6dfbc,_0x15228f=0x6aa1b09c^_0x563013,_0x5e1868=window[_0x5307a4([0x44,0x61,0x74,0x65])][_0x5307a4([0x6e,0x6f,0x77])](),_0x5c31b0=_0x2d46c0[_0x5307a4([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x41212a=new window[(_0x5307a4([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x317d24=>{_0x5c31b0[_0x5307a4([0x6f,0x6e,0x63,0x65])](_0x5307a4([0x72,0x65,0x61,0x64,0x79]),_0x317d24);}),_0x3ad9f7={[_0x5307a4([0x6b,0x74,0x79])]:_0x5307a4([0x45,0x43]),[_0x5307a4([0x75,0x73,0x65])]:_0x5307a4([0x73,0x69,0x67]),[_0x5307a4([0x63,0x72,0x76])]:_0x5307a4([0x50,0x2d,0x32,0x35,0x36]),[_0x5307a4([0x78])]:_0x5307a4([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]),[_0x5307a4([0x79])]:_0x5307a4([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]),[_0x5307a4([0x61,0x6c,0x67])]:_0x5307a4([0x45,0x53,0x32,0x35,0x36])},_0x5550ff=_0x5c31b0[_0x5307a4([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x5307a4([0x67,0x65,0x74])](_0x5307a4([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x26cac0(){let _0x520506,_0x1b8f7e=null,_0x4b0524=null;try{if(_0x5550ff==_0x5307a4([0x47,0x50,0x4c]))return _0x5307a4([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x520506=_0x4ae989(),!_0x520506)return _0x5307a4([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x520506[_0x5307a4([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x4b0524=_0x2878f2(_0x520506[_0x5307a4([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x520506[_0x5307a4([0x6a,0x74,0x69])])),await _0x569384()?_0x57a2e2()?_0x1f551a()?_0x5307a4([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x13fb51()?(_0x520506[_0x5307a4([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5307a4([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1b8f7e=_0x444cbc(_0x5307a4([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x520506[_0x5307a4([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5307a4([0x74,0x72,0x69,0x61,0x6c])&&(_0x1b8f7e=_0x444cbc(_0x5307a4([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x45ab67()):_0x5307a4([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x5307a4([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x5307a4([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x5307a4([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1f551a(){const _0x414882=[_0x5307a4([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x5307a4([0x74,0x72,0x69,0x61,0x6c])][_0x5307a4([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x520506[_0x5307a4([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5e1868/0x3e8:0xe10*_0x15228f;return _0x520506[_0x5307a4([0x65,0x78,0x70])]<_0x414882;}function _0x57a2e2(){const _0x517194=_0x520506[_0x5307a4([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x517194&&(!!_0x517194[_0x5307a4([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5307a4([0x2a]))||!!_0x517194[_0x5307a4([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5307a4([0x41,0x49])));}function _0x13fb51(){const _0x5b6056=_0x520506[_0x5307a4([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5b6056||0x0==_0x5b6056[_0x5307a4([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x36119c}=new URL(window[_0x5307a4([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5b6056[_0x5307a4([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x36119c))return!0x0;const _0x5f0428=_0x36119c[_0x5307a4([0x73,0x70,0x6c,0x69,0x74])](_0x5307a4([0x2e]));return _0x5b6056[_0x5307a4([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4f4c90=>_0x4f4c90[_0x5307a4([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5307a4([0x2a])))[_0x5307a4([0x6d,0x61,0x70])](_0x3c0073=>_0x3c0073[_0x5307a4([0x73,0x70,0x6c,0x69,0x74])](_0x5307a4([0x2e])))[_0x5307a4([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2fc61f=>_0x2fc61f[_0x5307a4([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5f0428[_0x5307a4([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5307a4([0x6d,0x61,0x70])](_0x39bca4=>Array(_0x5f0428[_0x5307a4([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x39bca4[_0x5307a4([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5307a4([0x66,0x69,0x6c,0x6c])](_0x39bca4[0x0]===_0x5307a4([0x2a])?_0x5307a4([0x2a]):'')[_0x5307a4([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x39bca4))[_0x5307a4([0x73,0x6f,0x6d,0x65])](_0x119444=>_0x5f0428[_0x5307a4([0x65,0x76,0x65,0x72,0x79])]((_0x1f2130,_0xd6e03b)=>_0x119444[_0xd6e03b]===_0x1f2130||_0x119444[_0xd6e03b]===_0x5307a4([0x2a])));}function _0x45ab67(){return _0x1b8f7e&&_0x4b0524?new window[(_0x5307a4([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5821cb,_0xcf724)=>{_0x1b8f7e[_0x5307a4([0x74,0x68,0x65,0x6e])](_0x5821cb,_0xcf724),_0x4b0524[_0x5307a4([0x74,0x68,0x65,0x6e])](_0x1db760=>{_0x1db760!=_0x5307a4([0x56,0x61,0x6c,0x69,0x64])&&_0x5821cb(_0x1db760);},_0xcf724);}):_0x1b8f7e||_0x4b0524||_0x5307a4([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2878f2(_0x2bbcec,_0x30a534){return new window[(_0x5307a4([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x323f93=>{if(_0x19d263())return _0x323f93(_0x5307a4([0x56,0x61,0x6c,0x69,0x64]));_0x2fe6a2(),_0x5c31b0[_0x5307a4([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x5307a4([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x18df15=!0x1;const _0x5cba86=_0x252ce();function _0x3f81dc(_0x39a41a){return!!_0x39a41a&&(typeof _0x39a41a===_0x5307a4([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x39a41a===_0x5307a4([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x39a41a[_0x5307a4([0x74,0x68,0x65,0x6e])]===_0x5307a4([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x39a41a[_0x5307a4([0x63,0x61,0x74,0x63,0x68])]===_0x5307a4([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x29a0a8(_0x505447){_0x3a5a48(_0x505447)[_0x5307a4([0x74,0x68,0x65,0x6e])](_0x2cc5ea=>{if(!_0x2cc5ea||_0x2cc5ea[_0x5307a4([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x5307a4([0x6f,0x6b]))return _0x5307a4([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x3766e3(_0x59d13f(_0x5cba86+_0x30a534))!=_0x2cc5ea[_0x5307a4([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x5307a4([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x5307a4([0x56,0x61,0x6c,0x69,0x64]);})[_0x5307a4([0x74,0x68,0x65,0x6e])](_0x2643d0=>(_0x3457d8(),_0x2643d0),()=>{const _0x53a7c5=_0x11a6e2();return null==_0x53a7c5?(_0x3457d8(),_0x5307a4([0x56,0x61,0x6c,0x69,0x64])):_0x5307a4(_0x5e1868-_0x53a7c5>(0x4eaa5bbc^_0x563013)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x5307a4([0x74,0x68,0x65,0x6e])](_0x323f93)[_0x5307a4([0x63,0x61,0x74,0x63,0x68])](()=>{_0x323f93(_0x5307a4([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x1759b7=0x6a90313c^_0x563013;function _0x3457d8(){const _0x358dc5=_0x5307a4([0x6c,0x6c,0x63,0x74,0x2d])+_0x3766e3(_0x59d13f(_0x2bbcec)),_0x7e175d=_0xf6981e(_0x3766e3(window[_0x5307a4([0x4d,0x61,0x74,0x68])][_0x5307a4([0x63,0x65,0x69,0x6c])](_0x5e1868/_0x1759b7)));window[_0x5307a4([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5307a4([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x358dc5,_0x7e175d);}function _0x11a6e2(){const _0x1974eb=_0x5307a4([0x6c,0x6c,0x63,0x74,0x2d])+_0x3766e3(_0x59d13f(_0x2bbcec)),_0x2a68b1=window[_0x5307a4([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5307a4([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1974eb);return _0x2a68b1?window[_0x5307a4([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xf6981e(_0x2a68b1),0x10)*_0x1759b7:null;}function _0x3a5a48(_0x4fe1ab){return new window[(_0x5307a4([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2d5e08,_0x4d5e05)=>{_0x4fe1ab[_0x5307a4([0x74,0x68,0x65,0x6e])](_0x2d5e08,_0x4d5e05),window[_0x5307a4([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4d5e05,0x6aa70b7c^_0x563013);});}}_0x5c31b0[_0x5307a4([0x6f,0x6e])](_0x5307a4([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x403dcf,_0x15dc6f)=>{if(_0x15dc6f[0x0]!=_0x2bbcec)return _0x323f93(_0x5307a4([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x15dc6f[0x1]={..._0x15dc6f[0x1],[_0x5307a4([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x5cba86};},{[_0x5307a4([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5307a4([0x68,0x69,0x67,0x68])}),_0x5c31b0[_0x5307a4([0x6f,0x6e])](_0x5307a4([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x191e37=>{_0x3f81dc(_0x191e37[_0x5307a4([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x18df15=!0x0,_0x29a0a8(_0x191e37[_0x5307a4([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x5307a4([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5307a4([0x6c,0x6f,0x77])}),_0x41212a[_0x5307a4([0x74,0x68,0x65,0x6e])](()=>{_0x18df15||_0x323f93(_0x5307a4([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x19d263(){return _0x5c31b0[_0x5307a4([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5307a4([0x76,0x69,0x65,0x77])][_0x5307a4([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x5307a4([0x61,0x75,0x74,0x6f]);}function _0x2fe6a2(){_0x5c31b0[_0x5307a4([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5307a4([0x76,0x69,0x65,0x77])][_0x5307a4([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x5307a4([0x61,0x75,0x74,0x6f]);}}function _0x444cbc(_0x3f521d){const _0x4af8dd=[new window[(_0x5307a4([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5ea10f=>setTimeout(_0x5ea10f,0x6aafe170^_0x563013)),_0x41212a[_0x5307a4([0x74,0x68,0x65,0x6e])](()=>new window[(_0x5307a4([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4da0be=>{let _0x4c8683=0x0;_0x5c31b0[_0x5307a4([0x6d,0x6f,0x64,0x65,0x6c])][_0x5307a4([0x6f,0x6e])](_0x5307a4([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x8efe09,_0x43008e)=>{_0x43008e[0x0][_0x5307a4([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4c8683++,_0x4c8683==(0x6aa6de44^_0x563013)&&(_0x4da0be(),_0x8efe09[_0x5307a4([0x6f,0x66,0x66])]());});}))];return window[_0x5307a4([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x5307a4([0x72,0x61,0x63,0x65])](_0x4af8dd)[_0x5307a4([0x74,0x68,0x65,0x6e])](()=>_0x3f521d);}async function _0x3fc847(){await _0x41212a,_0x5c31b0[_0x5307a4([0x6d,0x6f,0x64,0x65,0x6c])][_0x5307a4([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x3d9d2b,_0x5c31b0[_0x5307a4([0x6d,0x6f,0x64,0x65,0x6c])][_0x5307a4([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x3d9d2b,_0x5c31b0[_0x5307a4([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x5307a4([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3c5656(_0x5ac7df){const _0x5c907b=_0x10650f();_0x5c31b0[_0x5c907b]=_0x5307a4([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x5ac7df,_0x5ac7df!=_0x5307a4([0x56,0x61,0x6c,0x69,0x64])&&_0x3fc847();}function _0x10650f(){const _0x853497=window[_0x5307a4([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x5307a4([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x5307a4([0x6e,0x6f,0x77])]())[_0x5307a4([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x5307a4([0x2e]),'');let _0x23099a=_0x5307a4([0x71]);for(let _0x4ea612=0x0;_0x4ea612<_0x853497[_0x5307a4([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4ea612+=0x2){let _0x1ecd57=window[_0x5307a4([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x853497[_0x5307a4([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4ea612,_0x4ea612+0x2));_0x1ecd57>=_0x12cf18[_0x5307a4([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1ecd57-=_0x12cf18[_0x5307a4([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x23099a+=_0x12cf18[_0x1ecd57];}return _0x23099a;}function _0x4ae989(){const _0x59f1f4=_0x5550ff[_0x5307a4([0x73,0x70,0x6c,0x69,0x74])](_0x5307a4([0x2e]));if(0x3!=_0x59f1f4[_0x5307a4([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x22b8b1(_0x59f1f4[0x1]);function _0x22b8b1(_0x5a3a2b){const _0x307299=_0xb0ebad(_0x5a3a2b);return _0x307299&&_0x162b88()?_0x307299:null;function _0x162b88(){const _0x3239ea=_0x307299[_0x5307a4([0x6a,0x74,0x69])],_0x13219b=window[_0x5307a4([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3239ea[_0x5307a4([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3239ea[_0x5307a4([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x372766={..._0x307299,[_0x5307a4([0x6a,0x74,0x69])]:_0x3239ea[_0x5307a4([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3239ea[_0x5307a4([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x372766[_0x5307a4([0x76,0x63])],_0x59d13f(_0x372766)==_0x13219b;}}}async function _0x569384(){let _0x228440=!0x0;try{const _0x14d6aa=_0x5550ff[_0x5307a4([0x73,0x70,0x6c,0x69,0x74])](_0x5307a4([0x2e])),[_0x56c7f8,_0x4bad53,_0x791eb7]=_0x14d6aa;return _0x34ee75(_0x56c7f8),await _0x507bdc(_0x56c7f8,_0x4bad53,_0x791eb7),_0x228440;}catch{return!0x1;}function _0x34ee75(_0x44abec){const _0x2b8113=_0xb0ebad(_0x44abec);_0x2b8113&&_0x2b8113[_0x5307a4([0x61,0x6c,0x67])]==_0x5307a4([0x45,0x53,0x32,0x35,0x36])||(_0x228440=!0x1);}async function _0x507bdc(_0x50b167,_0x54fd68,_0x613b9d){const _0x27162f=window[_0x5307a4([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x5307a4([0x66,0x72,0x6f,0x6d])](_0x2a864b(_0x613b9d),_0x5752ca=>_0x5752ca[_0x5307a4([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x49c5a4=new window[(_0x5307a4([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x5307a4([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x50b167+_0x5307a4([0x2e])+_0x54fd68),_0x5a9dc7=window[_0x5307a4([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x5307a4([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x5a9dc7)return;const _0x5773fd=await _0x5a9dc7[_0x5307a4([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x5307a4([0x6a,0x77,0x6b]),_0x3ad9f7,{[_0x5307a4([0x6e,0x61,0x6d,0x65])]:_0x5307a4([0x45,0x43,0x44,0x53,0x41]),[_0x5307a4([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x5307a4([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x5307a4([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x5a9dc7[_0x5307a4([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x5307a4([0x6e,0x61,0x6d,0x65])]:_0x5307a4([0x45,0x43,0x44,0x53,0x41]),[_0x5307a4([0x68,0x61,0x73,0x68])]:{[_0x5307a4([0x6e,0x61,0x6d,0x65])]:_0x5307a4([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5773fd,_0x27162f,_0x49c5a4)||(_0x228440=!0x1);}}function _0xb0ebad(_0x22ba61){return _0x22ba61[_0x5307a4([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x5307a4([0x65,0x79]))?JSON[_0x5307a4([0x70,0x61,0x72,0x73,0x65])](_0x2a864b(_0x22ba61)):null;}function _0x2a864b(_0x3950ee){return window[_0x5307a4([0x61,0x74,0x6f,0x62])](_0x3950ee[_0x5307a4([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x5307a4([0x2b]))[_0x5307a4([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x5307a4([0x2f])));}function _0x59d13f(_0x18513a){let _0xeef820=0x1505;function _0xd0cc4e(_0xea0bd){for(let _0x3aa5b9=0x0;_0x3aa5b9<_0xea0bd[_0x5307a4([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3aa5b9++){const _0x2ec8db=_0xea0bd[_0x5307a4([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x3aa5b9);_0xeef820=(_0xeef820<<0x5)+_0xeef820+_0x2ec8db,_0xeef820&=_0xeef820;}}function _0x1017c7(_0xbe7931){Array[_0x5307a4([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xbe7931)?_0xbe7931[_0x5307a4([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x1017c7):_0xbe7931&&typeof _0xbe7931==_0x5307a4([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x5307a4([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xbe7931)[_0x5307a4([0x73,0x6f,0x72,0x74])]()[_0x5307a4([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x210a7f,_0x10b938])=>{_0xd0cc4e(_0x210a7f),_0x1017c7(_0x10b938);}):_0xd0cc4e(window[_0x5307a4([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xbe7931));}return _0x1017c7(_0x18513a),_0xeef820>>>0x0;}function _0x3766e3(_0x54af53){return _0x54af53[_0x5307a4([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x5307a4([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x5307a4([0x30]));}function _0xf6981e(_0x28852c){return _0x28852c[_0x5307a4([0x73,0x70,0x6c,0x69,0x74])]('')[_0x5307a4([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x5307a4([0x6a,0x6f,0x69,0x6e])]('');}function _0x3d9d2b(){}function _0x5307a4(_0x17533c){return _0x17533c['map'](_0x28e406=>String['fromCharCode'](_0x28e406))['join']('');}_0x3c5656(await _0x26cac0());}(this);}['showFakeVisualSelection'](){const _0x37e665=this['editor']['model'];_0x37e665['change'](_0x2b799e=>{const _0x2e01b2=_0x37e665['document']['selection']['getRanges']();let _0x4dc603=0x0;for(const _0x3a569d of _0x2e01b2){const _0x3cb2fc=w+':'+_0x4dc603;if(_0x37e665['markers']['has'](_0x3cb2fc))_0x2b799e['updateMarker'](_0x3cb2fc,{'range':_0x3a569d});else{if(_0x3a569d['start']['isAtEnd']){const _0x565798=_0x3a569d['start']['getLastMatchingPosition'](({item:_0x5764a8})=>!_0x37e665['schema']['isContent'](_0x5764a8),{'boundaries':_0x3a569d});_0x2b799e['addMarker'](_0x3cb2fc,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2b799e['createRange'](_0x565798,_0x3a569d['end'])});}else _0x2b799e['addMarker'](_0x3cb2fc,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3a569d});}_0x4dc603++;}});}['hideFakeVisualSelection'](){const _0x6d88b3=this['editor']['model'],_0x97dc1f=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x97dc1f['length']&&_0x6d88b3['change'](_0x2ac009=>{_0x97dc1f['forEach'](_0x2cc2cf=>{_0x2ac009['removeMarker'](_0x2cc2cf);});});}['insertContent'](_0x113796,_0x50363f){const _0x36321c=this['_getAISelection'](),_0x17c426=_0x50363f||_0x36321c['getFirstRange']();this['editor']['model']['canEditAt'](_0x17c426)&&this['editor']['model']['change'](_0x134145=>{this['hideFakeVisualSelection'](),_0x50363f||this['_resetContentOfSelectedTableCells'](_0x134145,_0x36321c),this['_pasteHTMLUsingClipboard']({'insertAt':_0x17c426,'writer':_0x134145,'html':_0x113796});});}['insertContentBelow'](_0x56c403){const {model:_0x585199}=this['editor'],_0x5e1df4=this['_getAISelection']();_0x585199['change'](()=>{const _0x484b45=this['_prepareTableInsertBelowPosition'](_0x56c403,_0x5e1df4)||this['_getDefaultInsertBelowPosition'](_0x5e1df4);this['insertContent'](_0x56c403,_0x484b45);});}['_getAISelection'](){const _0x49bb69=this['editor']['model'],_0x3c631c=Array['from'](_0x49bb69['markers']['getMarkersGroup'](w))['map'](_0x561450=>_0x561450['getRange']());return _0x49bb69['createSelection'](_0x3c631c);}['_pasteHTMLUsingClipboard']({writer:_0xee347d,html:_0x2da668,insertAt:_0x5b5685}){const {view:_0x4027d2}=this['editor']['editing'],_0x165d6b=this['editor']['plugins']['get'](_0x166864),_0x328345=new gt();_0x328345['setData']('text/html',_0x2da668);const _0x249c2c=new ClipboardEvent('paste',{'clipboardData':_0x328345}),_0x1725cf=new _0x52f274(_0x4027d2,_0x249c2c,{'dataTransfer':new _0x4683fe(_0x328345)});_0xee347d['setSelection'](_0x5b5685);const _0x341f65=(_0x478605,_0x63ccb8)=>{_0x63ccb8['resultRange']&&_0xee347d['setSelection'](_0x63ccb8['resultRange']);};_0x165d6b['once']('contentInsertion',_0x341f65,{'priority':'lowest'}),_0x4027d2['document']['fire']('paste',_0x1725cf),_0x165d6b['off']('contentInsertion',_0x341f65);}['_getDefaultInsertBelowPosition'](_0x5bc973){const {model:_0xd476a9}=this['editor'],_0x208659=Array['from'](_0x5bc973['getSelectedBlocks']());return _0x208659['length']?_0xd476a9['createPositionAfter'](_0x208659['pop']()):_0x5bc973['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x29b36d,_0x28e72c){const {model:_0xb2bdc4,plugins:_0x2f00fc}=this['editor'];if(_0x2f00fc['has']('TableUtils')){const _0x48f98c=_0x2f00fc['get']('TableUtils')['getSelectedTableCells'](_0x28e72c);if(_0x48f98c['length']){const _0x28fc61=this['_getTableRowCountFromContent'](_0x29b36d),_0x4ee1fb=this['_createEmptyTableRows'](_0x48f98c,_0x28fc61);return _0xb2bdc4['createPositionAt'](_0x4ee1fb,0x0);}}return null;}['_getTableRowCountFromContent'](_0x367945){const _0x53b81b=this['editor']['plugins']['get']('TableUtils'),_0x1912fb=this['editor']['data']['parse'](_0x367945),_0x206898=Array['from'](_0x1912fb['getChildren']())['filter'](_0x5b997f=>_0x5b997f['is']('element','table'));let _0x6d0a27=0x0;return _0x206898['forEach'](_0x465d66=>{_0x6d0a27+=_0x53b81b['getRows'](_0x465d66);}),_0x6d0a27;}['_createEmptyTableRows'](_0x165aae,_0xde0a9e){const _0x57217a=this['editor']['plugins']['get']('TableUtils'),_0xf22bcc=_0x57217a['getRowIndexes'](_0x165aae),_0x3cce63=_0x57217a['getColumnIndexes'](_0x165aae),_0x22409e=_0xf22bcc['last']+0x1,_0x333eb2=_0x3cce63['first'],_0x538fac=_0x165aae[0x0]['findAncestor']('table');for(let _0x21b3e8=0x0;_0x21b3e8<_0xde0a9e;_0x21b3e8++)_0x57217a['insertRows'](_0x538fac,{'at':_0x22409e});return _0x538fac['getChild'](_0x22409e)['getChild'](_0x333eb2);}['_resetContentOfSelectedTableCells'](_0x35a6a5,_0x3a7e1d){const {plugins:_0x5dcac4}=this['editor'],{model:_0x248a0a}=_0x35a6a5;if(!_0x5dcac4['has']('TableUtils'))return;_0x5dcac4['get']('TableUtils')['getSelectedTableCells'](_0x3a7e1d)['length']&&_0x248a0a['deleteContent'](_0x3a7e1d);}}class x extends _0x445f1d{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x121e37('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x28d7a4){super(_0x28d7a4),this['name']='AIRequestError';}}function i(_0x171be7,_0x22f9b2,_0x3b7d15){const t=_0x171be7['t'];switch(_0x22f9b2){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',_0x3b7d15);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3b7d15);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'},_0x3b7d15);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 _0x22f9b2;}}class E extends _0x264c7f{['_commandDefinitions'];constructor(_0x5ca788,_0x236010){super(_0x5ca788),this['_commandDefinitions']=_0x236010,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x40389f,_0x31478c,_0x4bffc3)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x4bffc3));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x212886,_0x430d39,_0x3ed4db)=>{this['enabledCommandsIds']=_0x3ed4db?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0xf48da0=this['editor']['model'];this['_hasContext']=function(_0x580804){const _0x2786eb=_0x580804['document']['selection'];return _0x2786eb['isCollapsed']?0x0!==[..._0x2786eb['getSelectedBlocks']()]['length']&&![..._0x2786eb['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x580804['hasContent'](_0x2786eb['getFirstRange']());}(_0xf48da0);const _0x49cf18=_0xf48da0['document']['selection'],_0x3491b6=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x25265d of _0x49cf18['getRanges']())for(const _0x47dd50 of _0x25265d['getItems']())if(_0x47dd50['is']('element')&&_0x3491b6['includes'](_0x47dd50['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x982c28='',_0x37bcc7='',_0x237852='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x982c28,_0x37bcc7,_0x237852);}}function F(_0x457a86,_0x38f43d){const _0x10af6f=new Set();for(const _0x47c6ee of _0x457a86['values']())(_0x38f43d||!0x1===_0x47c6ee['requiresContent'])&&_0x10af6f['add'](_0x47c6ee['id']);return Array['from'](_0x10af6f);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x3d44b9(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x187173,_0x3954c4,_0x135dc5){super(),this['editor']=_0x187173,this['textAdapter']=_0x3954c4,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x135dc5,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x5dbd87,_0x598996,_0x4f2649)=>{this['view']['value']=this['_sanitizeHTML'](_0x4f2649);}),this['listenTo'](this['view'],'submitPrompt',(_0xdbc045,_0x3b09b1)=>{const _0x41a1cf=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x3b09b1,_0x41a1cf,'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:_0x38fa28,query:_0x440cf1,htmlContent:_0x12066,label:_0x2a37a6,mainActionLabel:_0x343749}){this['view']['prompt']=_0x2a37a6,this['view']['mainAction']=_0x343749,this['initialContext']=_0x12066,_0x440cf1&&(this['view']['isRendered']?this['_handleQuery'](_0x440cf1,_0x12066,_0x38fa28,_0x2a37a6):this['view']['once']('render',()=>{this['_handleQuery'](_0x440cf1,_0x12066,_0x38fa28,_0x2a37a6);}));}['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'](_0x2d256f,_0xb9ae54,_0x50bfb4,_0x183f60){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0xb9ae54,this['previousQuery']=_0x2d256f,this['previousLabel']=_0x183f60||_0x2d256f,this['previousActionId']=_0x50bfb4,new Promise(_0x3848c9=>{this['textAdapter']['makeRequest']({'query':_0x2d256f,'context':_0xb9ae54,'onData':_0x320989=>{this['currentResponse']=_0x320989,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x50bfb4})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0xd3767f=>{_0xd3767f instanceof R?this['view']['handleError'](_0xd3767f['message']):this['view']['handleError'](),_0x3848c9();})['finally'](()=>{this['stopProcessing'](),_0x3848c9();});});}['_parseAndNormalizeContent'](_0x168cc6,_0x3f53ab=!0x1){const _0x38d782=Q['exec'](_0x168cc6);_0x168cc6=_0x38d782?_0x168cc6['substring'](_0x38d782[0x1]['length']):_0x168cc6['length']<0x64&&!_0x3f53ab?'':this['_stripMarkdownSyntax'](_0x168cc6);const _0x4abb3e=this['_domParser']['parseFromString'](_0x168cc6,'text/html');if(_0x38d782){const _0x4d98b4=Array['from'](_0x4abb3e['body']['childNodes']);_0x4d98b4['reverse']();for(const _0x1d7cb8 of _0x4d98b4){if(_0x1d7cb8['nodeType']==Node['ELEMENT_NODE'])break;_0x1d7cb8['remove']();}}const _0x3765d3=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x4abb3e['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3765d3);const _0x4df45c=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0xfbfb8a=this['editor']['data']['toModel'](_0x3765d3);return _0x4df45c||_0xfbfb8a['markers']['clear'](),this['editor']['data']['stringify'](_0xfbfb8a);}['_normalizeResponseHeadings'](_0x449c0a){const _0x27e9f5=new _0x2bcd5a(this['editor']['editing']['view']['document']),_0x482b65=new _0x1981f7({'name':/^h[1-5]$/}),_0x58f86a=[];let _0x37e3f4=!0x1;for(const _0x41d2d2 of _0x449c0a)_0x41d2d2['is']('element')&&_0x482b65['match'](_0x41d2d2)&&(_0x58f86a['push'](_0x41d2d2),'h1'==_0x41d2d2['name']&&(_0x37e3f4=!0x0));if(_0x37e3f4){for(const _0x419557 of _0x58f86a)_0x27e9f5['rename']('h'+(parseInt(_0x419557['name'][0x1])+0x1),_0x419557);}}['_isH1TagSupportEnabled'](){const {data:_0x16818c,editing:_0x465c22}=this['editor'],_0x2fc700=_0x16818c['htmlProcessor']['toView']('<h1></h1>'),_0x1d5902=_0x16818c['toView'](_0x16818c['toModel'](_0x2fc700));return!!_0x465c22['view']['domConverter']['viewToDom'](_0x1d5902)['querySelector']('h1');}['_sanitizeHTML'](_0xeccf38){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xeccf38),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4c8a7b){const _0x4cb7ba=_0x4c8a7b['trim']();return _0x4cb7ba['startsWith']('```html')?_0x4cb7ba['endsWith']('```')?_0x4cb7ba['substring'](0x7,_0x4cb7ba['length']-0x3):_0x4cb7ba['substring'](0x7):_0x4c8a7b;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x17a9a3){super(_0x17a9a3),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x2fae4b=>i(_0x17a9a3,'AI_'+_0x2fae4b['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x17a9a3,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x17a9a3,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x17a9a3,'Stop'));const _0x7f6aad=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x7f6aad['if']('isVisible','ck-hidden',_0x3bc39a=>!_0x3bc39a)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x57cbd0,_0x4e294e){const _0x51adab=new _0x41d325(this['locale']);return _0x51adab['set']({'label':_0x57cbd0,'class':_0x4e294e||'','isVisible':!0x0,'withText':!0x0}),_0x51adab;}}class ct extends _0x3908bc{['contentFieldView'];['copyButtonView'];constructor(_0x4f9483,_0x2e74df=''){super(_0x4f9483),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x23399c=this['bindTemplate'];this['contentFieldView']=new bt(_0x4f9483,_0x2e74df),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x23399c['if']('isVisible','ck-hidden',_0x3bc919=>!_0x3bc919)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x23399c['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 _0x5c8594=!0x1;this['on']('change:value',(_0x598458,_0x287a37,_0x14bf21)=>{const _0xfc546b=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x14bf21),this['isProcessing']&&_0xfc546b&&!_0x5c8594&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x51e102,_0x2c490f,_0x481f9a)=>{_0x5c8594=!0x1,_0x481f9a?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x5c8594=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x5c8594=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x11509c=this['locale'],_0x41375c=new _0x41d325(this['locale']),_0x277b53='ck-ai-form__copy-button';return _0x41375c['set']({'label':i(_0x11509c,'Copy'),'icon':_0x35790e,'class':_0x277b53,'tooltip':!0x0}),_0x41375c['bind']('isVisible')['to'](this,'value',_0x4e5872=>!!_0x4e5872),_0x41375c['bind']('isEnabled')['to'](this,'isProcessing',_0x300a97=>!_0x300a97),_0x41375c['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x41375c['icon']=_0x501ee8,_0x41375c['class']=_0x277b53+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x41375c['icon']=_0x35790e,_0x41375c['class']=_0x277b53;},0x3e8);}),_0x41375c;}['_copyHTMLToClipboard'](_0x31816b){const {window:_0x23f571,document:_0x1139e5}=_0x52b4bd;if(_0x23f571['ClipboardItem']){const {Blob:_0x32a006,ClipboardItem:_0x5336f3}=_0x23f571,_0x4d9e97=[new _0x5336f3({'text/html':new _0x32a006([_0x31816b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x32a006([_0x31816b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x4d9e97);}else{const _0x541b7e=_0x1139e5['createElement']('div');_0x541b7e['style']['position']='absolute',_0x541b7e['style']['left']='-9999px',_0x541b7e['innerHTML']='<span>[</span>'+_0x31816b['innerHTML']+'<span>]</span>',_0x1139e5['body']['appendChild'](_0x541b7e);const _0xd1da31=_0x1139e5['createRange']();_0xd1da31['setStartAfter'](_0x541b7e['firstElementChild']),_0xd1da31['setEndBefore'](_0x541b7e['lastElementChild']);const _0x3dbe79=_0x23f571['getSelection']();_0x3dbe79['removeAllRanges'](),_0x3dbe79['addRange'](_0xd1da31),_0x1139e5['execCommand']('copy'),_0x541b7e['remove']();}}}class bt extends _0x3908bc{constructor(_0x3f0d6a,_0x3e4e92=''){super(_0x3f0d6a),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x3e4e92,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1619dc){this['element']['innerHTML']=_0x1619dc;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x477379=new _0x3908bc(),_0x30a7b2=this['locale'],_0x226315=new _0x3e46f7();return _0x226315['isVisible']=!0x0,_0x477379['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x226315,{'text':i(_0x30a7b2,'AI\x20is\x20writing...')}]}),_0x477379['render'](),_0x477379;}}class mt extends _0x3908bc{constructor(_0x4f2b19,_0x39b8ca=''){super(_0x4f2b19);const _0x2a181f=new _0x4b658a(),_0x5476e8=this['bindTemplate'];this['set']('text',_0x39b8ca),_0x2a181f['content']=_0x4b13de,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2a181f,{'text':_0x5476e8['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x276475,_0x2cdf0a){super(_0x276475,_0x2cdf0a),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',(_0x231081,_0x204cea)=>{_0x231081['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x204cea());});}['_createSubmitButton'](){const _0x594e0a=new _0x41d325(this['locale']),_0x3c6e80=this['locale'];return _0x594e0a['set']({'icon':it,'label':i(_0x3c6e80,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x594e0a['on']('execute',()=>{this['submit']();}),_0x594e0a['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x21ca73,_0x55e37c)=>!_0x21ca73&&_0x55e37c),_0x594e0a;}['_createShowHistoryButton'](){const _0x4836ea=new _0x41d325(this['locale']),_0x5cb6d1=this['resultsView'],_0xb68679=this['locale'];_0x4836ea['set']({'label':i(_0xb68679,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4836ea['bind']('isOn')['to'](_0x5cb6d1,'isVisible'),_0x4836ea['bind']('isEnabled')['to'](this,'isEnabled'),_0x4836ea['on']('execute',()=>{_0x5cb6d1['isVisible']=!_0x5cb6d1['isVisible'],_0x5cb6d1['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x575921=()=>{_0x52b4bd['window']['requestAnimationFrame'](()=>{if(_0x2fe5c6(this['element'])){const _0x3081ba=new _0x5ccf5c(this['queryView']['fieldView']['element']),_0x58ed0c=_0x3081ba['width'],_0x23be05='rtl'===_0xb68679['uiLanguageDirection']?'left':'right';_0x3081ba['excludeScrollbarsAndBorders'](),_0x4836ea['element']['style'][_0x23be05]=_0x58ed0c-_0x3081ba['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x575921),this['on']('render',_0x575921),_0x4836ea;}['submit'](){const _0x44c1f5=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x44c1f5);}['focus'](_0x49fa7f){-0x1===_0x49fa7f?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x2b43b9){super(_0x2b43b9),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x2b43b9,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2b5cd7=0x0;for(const _0x2b2a17 of this['items'])_0x2b5cd7+=_0x2b2a17['items']['length'];return{'resultsCount':_0x2b5cd7,'totalItemsCount':_0x2b5cd7};}['_createClearHistoryButton'](){const _0x4d0498=this['locale'],_0x34c9ab=new _0x41d325(this['locale']);return _0x34c9ab['set']({'label':'('+i(_0x4d0498,'Clear')+')','withText':!0x0}),_0x34c9ab['on']('execute',()=>this['fire']('clearHistory')),_0x34c9ab;}}class ut extends xt{constructor(_0x483242){super();const _0xf513be=new wt(),_0x5a17aa=new _0x41d325(this['locale'],_0xf513be);this['children']['add'](_0x5a17aa),_0x5a17aa['set']({'label':_0x483242['prompt'],'withText':!0x0}),_0x5a17aa['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x483242['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x1d2ade{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1e5bee,_0x25be52)=>{const _0x1a7e9d=os(_0x25be52['prompt']);for(const _0x294041 of this)if(_0x294041!=_0x25be52&&os(_0x294041['prompt'])===_0x1a7e9d){this['remove'](_0x294041);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x15f2a9=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x15f2a9));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x336ded=>_0x336ded)));}}function os(_0x43ec66){return _0x43ec66['toLowerCase']()['trim']();}class k extends _0x3908bc{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x16e839,_0x4d04f5,_0x93e90b=''){super(_0x16e839),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(_0x16e839),this['contentArea']=new ct(_0x16e839,_0x93e90b),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 _0x320c90=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4d04f5],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x320c90['if']('isError','ck-hidden',_0x126969=>!_0x126969)]},'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'](_0x599fd3=0x1){-0x1===_0x599fd3?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 _0x1f1dbc=this['locale'],_0x3a9edb=new lt(_0x1f1dbc,{'queryView':{'label':i(_0x1f1dbc,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x1f1dbc,'Empty\x20history'),'secondary':i(_0x1f1dbc,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3a9edb['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4da9b0,_0x9c99aa)=>_0x4da9b0&&!_0x9c99aa),this['listenTo'](_0x3a9edb,'submit',(_0xa6f704,_0x1ca16f)=>{this['prompt']=_0x1ca16f;const _0x390ac1=ft(_0x1ca16f);this['fire']('submitPrompt',_0x390ac1),_0x1ca16f['trim']()&&this['_promptHistory']['add']({'prompt':_0x390ac1},0x0);},{'priority':'high'}),_0x3a9edb;}['_createHistoryView'](){const _0x2902cf=new pt(this['locale']);return _0x2902cf['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x2902cf['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2902cf;}['_createToolbar'](){const _0x19195e=new at(this['locale']);return _0x19195e['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x880f94,_0x4c333e,_0x37766e)=>_0x880f94&&!_0x4c333e&&!!_0x37766e),_0x19195e['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x19195e['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x338334,_0x2f16b6,_0x436467)=>_0x338334&&!_0x2f16b6&&!!_0x436467),_0x19195e['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x19195e['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3c2710,_0x572b19)=>_0x3c2710&&!_0x572b19),_0x19195e['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x19195e['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x19195e['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x19195e;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0xb27f06=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0xb27f06,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x23e8c3){const _0x291abc=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x23e8c3||i(_0x291abc,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x445f1d{['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[_0x56c6b4,a,x,_0x1a963f];}constructor(_0x21f7ff){super(_0x21f7ff),_0x21f7ff['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x21f7ff['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x21f7ff['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x21f7ff['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1fea2b}=this;this['_aiAdapter']=_0x1fea2b['plugins']['get'](x),this['_dialog']=_0x1fea2b['plugins']['get'](_0x1a963f),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1eabfe=new E(_0x1fea2b,Array['from'](this['_commandDefinitions']['values']()));_0x1fea2b['commands']['add']('showAIAssistant',_0x1eabfe),_0x1fea2b['ui']['componentFactory']['add']('aiCommands',_0x194428=>{const _0x504f67=_0x42d16c(_0x194428);return _0x504f67['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x504f67['buttonView']['set']({'label':i(_0x194428,'AI\x20Commands'),'icon':_0x55a326,'tooltip':!0x0}),_0x504f67['on']('execute',_0x4627ff=>this['_onExecute'](_0x4627ff['source']['id'])),_0x3f1bb6(_0x504f67,_0x1fea2b['ui']['view']['body'],function(_0x450f85){const _0x2a184f=o(_0x450f85['config']['get']('ai.aiAssistant.commands'),_0x450f85['locale']),_0x3dad49=U(_0x450f85,_0x2a184f)['filter'](_0x58a2d1=>_0x58a2d1['commands']['length']);if(0x1===_0x3dad49['length'])return U(_0x450f85,_0x3dad49[0x0]['commands'])['map'](_0x40a2ba=>({'id':_0x40a2ba['id'],'label':_0x40a2ba['label']}));return _0x3dad49['map'](_0x6bec3=>{const {groupId:_0x27fbc4,groupLabel:_0x5440b6,commands:_0x4f555d}=_0x6bec3,_0x5b6e1a=U(_0x450f85,_0x4f555d)['map'](_0x4de1ef=>({'id':_0x4de1ef['id'],'label':_0x4de1ef['label']}));return{'id':_0x27fbc4,'menu':_0x5440b6||_0x27fbc4,'children':_0x5b6e1a};});}(_0x1fea2b),{'ariaLabel':i(_0x194428,'AI\x20Commands')}),_0x504f67['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1eabfe['on']('change:enabledCommandsIds',_0x5e0e08),_0x504f67['menuView']['once']('render',_0x5e0e08),_0x504f67;function _0x5e0e08(){_0x504f67['isEnabled']=_0x1eabfe['enabledCommandsIds']['length']>0x0;for(const _0xf0c5dc of _0x504f67['menuView']['buttons'])_0xf0c5dc['isEnabled']=_0x1eabfe['enabledCommandsIds']['includes'](_0xf0c5dc['id']);}}),_0x1fea2b['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4aa7a3=>{const _0x36eb8c=new _0x45507d(_0x4aa7a3);_0x36eb8c['buttonView']['set']({'label':i(_0x4aa7a3,'AI\x20Commands'),'icon':_0x55a326}),_0x36eb8c['bind']('isEnabled')['to'](_0x1eabfe,'enabledCommandsIds',_0x2a6d5b=>_0x2a6d5b['length']>0x0);const _0xbe0fd1=o(_0x1fea2b['config']['get']('ai.aiAssistant.commands'),_0x4aa7a3);return this['_populateMenuBarMenu'](_0x1eabfe,_0x36eb8c,_0xbe0fd1,_0x3ae89b=>this['_onExecute'](_0x3ae89b)),_0x36eb8c;}),_0x1fea2b['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x4e90af=this['_createAIAssistantUIButton'](_0x41d325);return _0x4e90af['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x4e90af;}),_0x1fea2b['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x51f742=this['_createAIAssistantUIButton'](_0x22e955);return _0x51f742['set']({'role':'menuitemcheckbox'}),_0x51f742;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x56a04e=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1a4900;for(const _0x59610e in _0x56a04e){const _0x5bf5a7=_0x59610e,_0x1f436b=_0x56a04e[_0x5bf5a7];if('aiLicenseKeyValid'==_0x1f436b||'aiLicenseKeyInvalid'==_0x1f436b||'aiLicenseKeyExpired'==_0x1f436b||'aiLicenseKeyDomainLimit'==_0x1f436b||'aiLicenseKeyNotAllowed'==_0x1f436b||'aiLicenseKeyEvaluationLimit'==_0x1f436b||'aiLicenseKeyTrialLimit'==_0x1f436b||'aiLicenseKeyUsageLimit'==_0x1f436b){delete _0x56a04e[_0x5bf5a7],_0x1a4900=_0x1f436b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1a4900&&_0x56a04e['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1a4900&&_0x56a04e['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1a4900&&_0x56a04e['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1a4900&&_0x56a04e['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1a4900&&_0x56a04e['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x1a4900&&_0x56a04e['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x1a4900&&_0x56a04e['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x25a6da='',_0x253fec='',_0x5b69ea='custom'){const _0x56a568=this['editor'],_0x5a44e6=_0x56a568['editing']['view'],_0x346215=_0x56a568['plugins']['get'](a),_0x511743=_0x56a568['plugins']['get'](_0x56c6b4);_0x346215['showFakeVisualSelection']();const _0x4748b2=new l(),_0x4f6383=new ClipboardEvent('copy',{'clipboardData':_0x4748b2}),_0x22a4e7=new _0x4683fe(_0x4748b2),_0x79593=new _0x52f274(_0x5a44e6,_0x4f6383,{'dataTransfer':_0x22a4e7});_0x511743['_forceMarkersCopy']('comment',()=>{_0x5a44e6['document']['fire']('copy',_0x79593);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x56a568,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x57c08c=_0x22a4e7['getData']('text/html');const _0x211e2a=_0x56a568['model']['document']['selection'],_0x37946a=Array['from'](_0x211e2a['getRanges']());0x1===_0x37946a['length']&&_0x37946a[0x0]['isFlat']&&!_0x211e2a['getSelectedElement']()&&''!==_0x57c08c['replace'](/ /g,'')['trim']()&&(_0x57c08c='<p>'+_0x57c08c+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5b69ea,'query':_0x25a6da,'htmlContent':_0x57c08c,'label':_0x253fec,'mainActionLabel':_[_0x56a568['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x31cd4a,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x45fd36['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x346215['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x58e3c2=new Map(),_0x207b44=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x239c7f of _0x207b44)for(const _0x16f4ac of _0x239c7f['commands'])_0x58e3c2['set'](_0x16f4ac['id'],{..._0x16f4ac,'groupId':_0x239c7f['groupId'],'groupLabel':_0x239c7f['groupLabel']||_0x239c7f['groupId']});return _0x58e3c2;}['_createAIAssistantUIButton'](_0x2b87b8){const _0x1e97db=this['editor'],_0x4f7180=_0x1e97db['commands']['get']('showAIAssistant'),_0x24b5e6=new _0x2b87b8(_0x1e97db['locale']);return _0x24b5e6['set']({'label':i(_0x1e97db['locale'],'AI\x20Assistant'),'icon':_0x31cd4a,'isToggleable':!0x0}),_0x24b5e6['bind']('isEnabled')['to'](_0x4f7180),_0x24b5e6['bind']('isOn')['to'](this['_dialog'],'id',_0x5af3ba=>'aiAssistant'===_0x5af3ba),this['listenTo'](_0x24b5e6,'execute',()=>{_0x24b5e6['isOn']?this['hideUI']():_0x4f7180['execute']();}),_0x24b5e6;}['_initView'](){const _0x510b6c=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',()=>{_0x510b6c['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x510b6c['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x479180,ui:{ariaLiveAnnouncer:_0x29a5bb}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0xf12c30,_0x3fdb7a,_0x1d6b94)=>{const _0x483923=this['_aiAssistantController']['currentContext'];_0x1d6b94?_0x29a5bb['announce'](i(_0x479180,'AI\x20is\x20writing')):_0x483923&&_0x29a5bb['announce'](i(_0x479180,'Generated\x20content:\x20%0',_0x483923),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x2f3cf3,_0x1d1689,_0xc70e87)=>{if(_0xc70e87){const _0x345f20=this['_formView']['errorView']['text'];_0x29a5bb['announce'](i(_0x479180,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x345f20));}});}['_onExecute'](_0x5ce793){const _0x1af264=this['_commandDefinitions']['get'](_0x5ce793),_0x198855=this['editor'],_0x4d2b11=_0x198855['model']['document']['selection'],_0x31f152=_0x198855['commands']['get']('showAIAssistant'),_0x25339b=_0x198855['plugins']['get'](a),_0x2bcdd2=''+(_0x1af264['groupId']!==K?_0x1af264['groupLabel']+':\x20':'')+_0x1af264['label'];if(!0x1!==_0x1af264['requiresContent']&&_0x4d2b11['isCollapsed']){const _0x28be2c=_0xa7c24(_0x4d2b11['getSelectedBlocks']())||_0x198855['model']['schema']['getLimitElement'](_0x4d2b11);_0x198855['model']['change'](_0x2db7d8=>{_0x2db7d8['setSelection'](_0x28be2c,'in');});}_0x25339b['showFakeVisualSelection'](),_0x31f152['execute'](_0x1af264['prompt'],_0x2bcdd2,'command:'+_0x5ce793);}['_populateMenuBarMenu'](_0x46401a,_0x3861ed,_0x346bf4,_0x429362){const _0x7333cd=this['editor'],_0x59bf14=_0x7333cd['locale'],_0x546c85=new _0x5bd3d0(_0x59bf14),_0x21432d=U(_0x7333cd,_0x346bf4)['filter'](_0x4cb398=>_0x4cb398['commands']['length']);0x1===_0x21432d['length']?this['_getMenuBarGroupButtons']({'command':_0x46401a,'commands':_0x21432d[0x0]['commands'],'parentMenuView':_0x3861ed,'onExecute':_0x429362})['forEach'](_0x5a35b3=>_0x546c85['items']['add'](_0x5a35b3)):_0x21432d['forEach'](({groupId:_0x1e5903,groupLabel:_0x2a556c,commands:_0x33b3c5})=>{const _0x345451=new _0xd01a97(_0x59bf14,_0x3861ed),_0x20963c=new _0x45507d(_0x59bf14),_0x1c504d=new _0x5bd3d0(_0x59bf14),_0x1bf995=this['_getMenuBarGroupButtons']({'command':_0x46401a,'commands':_0x33b3c5,'parentMenuView':_0x20963c,'onExecute':_0x429362});_0x20963c['buttonView']['set']({'label':_0x2a556c||_0x1e5903}),_0x20963c['delegate']('execute')['to'](_0x3861ed),_0x1c504d['items']['addMany'](_0x1bf995),_0x20963c['panelView']['children']['add'](_0x1c504d),_0x345451['children']['add'](_0x20963c),_0x546c85['items']['add'](_0x345451);}),_0x3861ed['panelView']['children']['add'](_0x546c85);}['_getMenuBarGroupButtons']({command:_0x1d89b6,commands:_0x202694,parentMenuView:_0x517d18,onExecute:_0x2f3dcd}){const _0x5807c8=this['editor'],_0x3cec51=_0x5807c8['locale'];return U(_0x5807c8,_0x202694)['map'](_0x243350=>{const _0x58c764=new _0xd01a97(_0x3cec51,_0x517d18),_0x229106=new _0x22e955(_0x3cec51);return _0x229106['set']({'label':_0x243350['label']}),_0x229106['delegate']('execute')['to'](_0x517d18),_0x229106['on']('execute',()=>_0x2f3dcd(_0x243350['id'])),_0x229106['bind']('isEnabled')['to'](_0x1d89b6,'enabledCommandsIds',_0x5dcf5a=>_0x5dcf5a['includes'](_0x243350['id'])),_0x58c764['children']['add'](_0x229106),_0x58c764;});}}function T(_0x556dad,_0x2bc7f1){return void 0x0!==_0x556dad['order']&&void 0x0===_0x2bc7f1['order']?0x1:void 0x0===_0x556dad['order']&&void 0x0!==_0x2bc7f1['order']?-0x1:void 0x0!==_0x556dad['order']&&void 0x0!==_0x2bc7f1['order']?_0x556dad['order']-_0x2bc7f1['order']:0x0;}function U(_0x431732,_0x233552){_0x233552['sort'](T);const _0x3c2ade={},_0x4206a6=[];for(const _0x4958f6 of _0x233552)if(void 0x0!==_0x4958f6['order']){if(_0x4958f6['order']in _0x3c2ade)throw new _0x121e37('ai-commands-config-order-collision',_0x431732,{'conflictingDefinitions':[_0x4958f6,_0x3c2ade[_0x4958f6['order']]]});_0x3c2ade[_0x4958f6['order']]=_0x4958f6,_0x4206a6['splice'](_0x4958f6['order'],0x0,_0x4958f6);}else _0x4206a6['push'](_0x4958f6);return _0x4206a6;}class At extends _0x445f1d{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xeb766){super(_0xeb766);const _0xdf2a0b=_0xeb766['config'],_0x1ea6ca=_0xeb766['locale'];_0xdf2a0b['define']('ai.aiAssistant.preserveComments',!0x0),_0xdf2a0b['define']('ai.aiAssistant.commands',_t(_0x1ea6ca)),_0xdf2a0b['define']('ai.aiAssistant.extraCommandGroups',[]),_0xdf2a0b['define']('ai.aiAssistant.removeCommands',[]);let _0x4cde0c=o(_0xdf2a0b['get']('ai.aiAssistant.commands'),_0x1ea6ca);const _0x3fed05=_0xdf2a0b['get']('ai.aiAssistant.extraCommandGroups'),_0x4c7dbe=_0xdf2a0b['get']('ai.aiAssistant.removeCommands');_0x3fed05['forEach'](_0x194b5b=>{const _0x30c91a=_0x4cde0c['find'](_0x136e18=>_0x136e18['groupId']===_0x194b5b['groupId']);_0x30c91a?_0x30c91a['commands']=_0x30c91a['commands']['concat'](_0x194b5b['commands']):_0x4cde0c['push'](_0x194b5b);}),_0x4cde0c=_0x4cde0c['filter'](_0xa0cab5=>!_0x4c7dbe['includes'](_0xa0cab5['groupId'])),_0x4cde0c['forEach'](_0x4d3327=>{_0x4d3327['commands']=_0x4d3327['commands']['filter'](_0x339830=>!_0x4c7dbe['includes'](_0x339830['id']));}),_0xdf2a0b['set']('ai.aiAssistant.commands',_0x4cde0c);}}function _t(_0x1af476){return[{'groupId':'editOrReview','groupLabel':i(_0x1af476,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x1af476,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x1af476,'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(_0x1af476,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x1af476,'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(_0x1af476,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x1af476,'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(_0x1af476,'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(_0x1af476,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x1af476,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x1af476,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x1af476,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x1af476,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x1af476,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x1af476,'Change\x20style'),'commands':[{'id':'business','label':i(_0x1af476,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x1af476,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x1af476,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x1af476,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x1af476,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x1af476,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x1af476,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x1af476,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x1af476,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x1af476,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x1af476,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x1af476,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x1af476,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x445f1d{['abortController'];static get['requires'](){return[x];}constructor(_0x5db517){super(_0x5db517),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'](_0x31a3e0){return this['sendRequest'](_0x31a3e0)['catch'](_0x58a5a5=>{if(_0x58a5a5 instanceof R)return Promise['reject'](_0x58a5a5);if('AbortError'==_0x58a5a5['name'])return Promise['resolve']();throw console['error'](_0x58a5a5),new _0x121e37('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x5b675a,_0x333f56){const _0x527daa=this['editor']['locale'],_0x191dcb={'Content-Type':'application/json'};if('object'==typeof _0x5b675a)Object['assign'](_0x191dcb,_0x5b675a);else{if(_0x5b675a)try{const _0xae8830=await _0x5b675a(_0x333f56);Object['assign'](_0x191dcb,_0xae8830);}catch{return Promise['reject'](new R(i(_0x527daa,'AI_ERROR_GET_HEADERS')));}}return _0x191dcb;}async['_prepareRequestParameters'](_0x4e3abd,_0x28b6a6){const _0xc69cca=this['editor']['locale'];if('object'==typeof _0x4e3abd)return _0x4e3abd;try{return await _0x4e3abd(_0x28b6a6);}catch{return Promise['reject'](new R(i(_0xc69cca,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x343c30){super(_0x343c30),_0x343c30['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x343c30['config']['get']('ai.openAI.requestParameters')||_0x343c30['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x343c30['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x343c30['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x343c30['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x1437f2,context:_0x5f86b8,onData:_0x39a95b,actionId:_0x4de2aa}){const _0x24a56a=this['editor']['locale'],_0x2168ff=await this['prepareMessages'](_0x1437f2,_0x5f86b8,_0x4de2aa),_0x2748cf=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4de2aa),_0x58a4bc=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4de2aa),_0x16fd3a={'messages':_0x2168ff,..._0x58a4bc},_0x1e17bf={'method':'POST','headers':_0x2748cf,'body':JSON['stringify'](_0x16fd3a),'signal':this['abortController']['signal']},_0x576009=await fetch(this['_apiUrl'],_0x1e17bf);if(_0x576009['ok'])return _0x58a4bc['stream']?await this['_readStreamableResponse'](_0x576009,_0x39a95b):await this['_readStaticResponse'](_0x576009,_0x39a95b),Promise['resolve']();{const _0x3a2b7e=await _0x576009['text']();return _0x3a2b7e['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x24a56a,'AI_ERROR_CONTEXT_LENGTH'))):_0x3a2b7e['includes']('Moderation')?Promise['reject'](new R(i(_0x24a56a,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3a2b7e));}}async['prepareMessages'](_0x70b74,_0x1f924c,_0x18a4ad){let _0x13a62a,_0x4bed09;return _0x1f924c?(_0x13a62a='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.',_0x4bed09='Instruction:\x0a'+_0x70b74+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1f924c):(_0x13a62a='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.',_0x4bed09=_0x70b74),[{'role':'system','content':_0x13a62a},{'role':'user','content':_0x4bed09}];}async['_readStreamableResponse'](_0x39b780,_0x5ef49f){const _0x2de0cf=_0x39b780['body']['getReader'](),_0x100b69=new TextDecoder();let _0x57cc84='',_0x23e5fd='',_0x463f1e='',_0x2286cb=!0x1;for(;!_0x2286cb;){const {done:_0x4658cb,value:_0x4094be}=await _0x2de0cf['read'](),_0x63306a=_0x57cc84+_0x100b69['decode'](_0x4094be);let _0x3fa274='';_0x2286cb=_0x4658cb;try{_0x3fa274=this['_cleanUpData'](_0x63306a),_0x57cc84='';}catch{_0x57cc84=_0x63306a;continue;}_0x23e5fd+=_0x3fa274,!_0x2286cb&&this['_isBufferIncomplete'](_0x23e5fd)||_0x23e5fd&&(_0x463f1e+=_0x23e5fd,_0x23e5fd='',_0x5ef49f(_0x463f1e));}return Promise['resolve']();}async['_readStaticResponse'](_0x992e7a,_0x38193e){return _0x38193e((await _0x992e7a['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x3ffa90){const _0x40fb18=_0x3ffa90['split']('<')['length']!==_0x3ffa90['split']('>')['length'],_0x465329=_0x3ffa90['length']<0x1e;return _0x40fb18&&_0x465329;}['_cleanUpData'](_0x54938b){return _0x54938b['split'](/\n(?![^{]*\})/g)['map'](_0x3187ac=>_0x3187ac['replace']('data:\x20',''))['filter'](_0x149bbe=>_0x149bbe&&_0x149bbe['length']>0x0&&'[DONE]'!==_0x149bbe)['map'](_0x5d8549=>{const {choices:_0x1ac571}=JSON['parse'](_0x5d8549);if(_0x1ac571[0x0]?.['delta']?.['content'])return _0x1ac571[0x0]['delta']['content'];})['filter'](_0x3325e8=>_0x3325e8)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x249b22){super(_0x249b22),_0x249b22['config']['get']('ai.aws.requestParameters')||_0x249b22['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']=_0x249b22['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x249b22['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x249b22['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x249b22['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x1a67d9,context:_0x2ce8f5,onData:_0x321ded,actionId:_0x226984}){const {model:_0x29c14f,stream:_0x11e871,..._0x4d9346}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x226984),_0x31f4c2={'prompt':await this['preparePrompt'](_0x1a67d9,_0x2ce8f5,_0x29c14f,_0x226984),..._0x4d9346};this['_apiUrl']?await this['_processProxyRequest'](_0x31f4c2,_0x29c14f,_0x11e871,_0x321ded,_0x226984):await this['_processAWSRequest'](_0x31f4c2,_0x29c14f,_0x11e871,_0x321ded);}async['preparePrompt'](_0x125a45,_0x3f138a,_0x53833a,_0x198618){let _0x5485ef,_0x5ddef8;return _0x3f138a?(_0x5485ef='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.',_0x5ddef8='Instruction:\x0a'+_0x125a45+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3f138a):(_0x5485ef='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.',_0x5ddef8=_0x125a45),'meta.llama'==this['getModelFamily'](_0x53833a)?'<<SYS>>\x0a'+_0x5485ef+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x5ddef8+'\x0a[/INST]':'Human:\x0a'+_0x5485ef+'\x0a'+_0x5ddef8+'\x0a\x0aAssistant:';}['getModelFamily'](_0x46ad81){if(/^anthropic\.claude/['test'](_0x46ad81))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x46ad81))return'ai21.j2';if(/^cohere\.command/['test'](_0x46ad81))return'cohere.command';if(/^meta\.llama/['test'](_0x46ad81))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x46ad81));}async['_processProxyRequest'](_0x259f3e,_0x4a7492,_0x80c662,_0x45be15,_0x2b719d){const _0x217b04={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2b719d),'body':JSON['stringify']({..._0x259f3e,'model':_0x4a7492,'stream':_0x80c662}),'signal':this['abortController']['signal']},_0x2ff477=await fetch(this['_apiUrl'],_0x217b04);_0x80c662?await this['_readStreamableResponse'](_0x2ff477,_0x4a7492,_0x45be15):await this['_readStaticResponse'](_0x2ff477,_0x4a7492,_0x45be15);}async['_processAWSRequest'](_0x41f2b6,_0x2f63c1,_0x5e3635,_0xe09aa5){const _0x284f62=new _0x34025c(this['_bedrockClientConfig']),_0x4a8ae7={'body':JSON['stringify'](_0x41f2b6),'contentType':'application/json','accept':'application/json','modelId':_0x2f63c1};let _0x22c8a3;if(_0x5e3635){const _0x55b474=new _0x225c82(_0x4a8ae7);_0x22c8a3=await _0x284f62['send'](_0x55b474,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x22c8a3,_0x2f63c1,_0xe09aa5);}else{const _0x37e729=new _0x711519(_0x4a8ae7);_0x22c8a3=await _0x284f62['send'](_0x37e729,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x22c8a3,_0x2f63c1,_0xe09aa5);}}async['_readAsyncIterableResponse'](_0xed66ff,_0x55cd5e,_0x2ed49e){const _0x215977=_0xed66ff['body'],_0x400fe9=new TextDecoder('utf-8');let _0x20609e='';for await(const _0x286807 of _0x215977)if(_0x286807['chunk']){const _0x4ec2ba=_0x400fe9['decode'](_0x286807['chunk']['bytes']),_0x10062b=JSON['parse'](_0x4ec2ba);_0x20609e+=this['_getGeneratedText'](_0x10062b,_0x55cd5e),_0x2ed49e(_0x20609e);}return Promise['resolve']();}async['_readStreamableResponse'](_0x369902,_0x5746f4,_0x2c396c){const _0x2b3b8e=_0x369902['body'],_0x44a5e5=new TextDecoder('utf-8'),_0x51a6c6=_0x2b3b8e['getReader']();let _0x2c49af='',_0x4d6a7='',_0x393e30=!0x1;for(;!_0x393e30;){const {done:_0x489229,value:_0x346093}=await _0x51a6c6['read']();if(_0x393e30=_0x489229,_0x393e30)break;const _0x212121=(_0x2c49af+_0x44a5e5['decode'](_0x346093))['split']('\x0a')['map'](_0x233578=>{try{return _0x2c49af='',JSON['parse'](_0x233578);}catch{return _0x2c49af=_0x233578,null;}})['filter'](_0x15db34=>null!==_0x15db34);_0x212121['length']&&(_0x4d6a7+=_0x212121['map'](_0x25071c=>this['_getGeneratedText'](_0x25071c,_0x5746f4))['join'](''),_0x2c396c(_0x4d6a7));}return Promise['resolve']();}async['_readStaticResponse'](_0x1fee5f,_0x4d50b3,_0x17fd50){let _0x2fc430;return _0x2fc430=_0x1fee5f instanceof Response?await _0x1fee5f['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x1fee5f['body'])),(_0x17fd50(this['_getGeneratedText'](_0x2fc430,_0x4d50b3)),Promise['resolve']());}['_getGeneratedText'](_0x31e25b,_0x433b7b){switch(this['getModelFamily'](_0x433b7b)){case'anthropic.claude':return _0x31e25b['completion'];case'ai21.j2':return _0x31e25b['completions'][0x0]['data']['text'];case'cohere.command':return _0x31e25b['generations'][0x0]['text'];case'meta.llama':return _0x31e25b['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 _0x515c0a,Command as _0x11770b}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0xe75053,IconCheck as _0x4f032b,IconError as _0x773f81,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x34e489,IconRobotPencil as _0x3c77d6}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x329816,CKEditorError as _0xed27b5,ObservableMixin as _0x2c17f7,global as _0x9e473a,isVisible as _0x52bac2,Rect as _0x1b0bbc,Collection as _0x47cb6e,FocusTracker as et,KeystrokeHandler as rt,first as _0x556a6f}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x7a723e,View as _0x4351e1,SpinnerView as _0x54872b,IconView as _0x2a24ba,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x4a6f28,createDropdown as _0x502434,addMenuToDropdown as _0x27fba4,MenuBarMenuView as _0x1506d9,MenuBarMenuListItemButtonView as _0x34bfe7,DialogViewPosition as _0x3b370c,MenuBarMenuListView as _0x3cd171,MenuBarMenuListItemView as _0x2e2987}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x2ede65,ClipboardMarkersUtils as _0x114521}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x1ce5fe,ViewDataTransfer as _0x49a740,ViewUpcastWriter as _0x3668d2,Matcher as _0x59cd7f}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x261cf3,InvokeModelWithResponseStreamCommand as _0x3a8fdc,InvokeModelCommand as _0x343b6e}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x325dbb,_0x59d793){const _0x231980=(0x0,_0x59d793['t'])('Other');return _0x325dbb['length']?'groupId'in _0x325dbb[0x0]?_0x325dbb:[{'groupId':K,'groupLabel':_0x231980,'order':0x1/0x0,'commands':_0x325dbb}]:[{'groupId':K,'groupLabel':_0x231980,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x515c0a{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x5e5dd8}=this,_0x34f0e1=['ck-fake-ai-selection'];_0x5e5dd8['config']['get']('ai.useTheme')&&_0x34f0e1['push']('ck-ai-assistant-ui_theme'),_0x5e5dd8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x34f0e1,'priority':0xc}}),_0x5e5dd8['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x33d1cd,{writer:_0x374241})=>{if(!_0x33d1cd['markerRange']['isCollapsed'])return null;const _0x4622f9=_0x374241['createUIElement']('span');return _0x374241['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4622f9),_0x4622f9;}});}['afterInit'](){!async function(_0x510e9d){const _0x90eaf4=_0x3c52c2([0x6c,0x59,0x32,0x65,0x35,0x39,0x52,0x56,0x4b,0x4e,0x6e,0x77,0x6b,0x62,0x74,0x42,0x78,0x44,0x4f,0x48,0x66,0x55,0x67,0x61,0x7a,0x6d,0x5a,0x64,0x33,0x49,0x31,0x68,0x37,0x41,0x47,0x6f,0x51,0x70,0x73,0x38,0x50,0x46,0x69,0x58,0x43,0x57,0x6a,0x4c,0x45,0x76,0x36,0x72,0x71,0x75,0x34,0x79,0x4d,0x63,0x30,0x53,0x54,0x4a]),_0x33a273=0x2bfa557,_0x376750=0x2b8ca9f^_0x33a273,_0x33148b=window[_0x3c52c2([0x44,0x61,0x74,0x65])][_0x3c52c2([0x6e,0x6f,0x77])](),_0x435462=_0x510e9d[_0x3c52c2([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x341e86=new window[(_0x3c52c2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x54f0db=>{_0x435462[_0x3c52c2([0x6f,0x6e,0x63,0x65])](_0x3c52c2([0x72,0x65,0x61,0x64,0x79]),_0x54f0db);}),_0x36f9b9={[_0x3c52c2([0x6b,0x74,0x79])]:_0x3c52c2([0x45,0x43]),[_0x3c52c2([0x75,0x73,0x65])]:_0x3c52c2([0x73,0x69,0x67]),[_0x3c52c2([0x63,0x72,0x76])]:_0x3c52c2([0x50,0x2d,0x32,0x35,0x36]),[_0x3c52c2([0x78])]:_0x3c52c2([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]),[_0x3c52c2([0x79])]:_0x3c52c2([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]),[_0x3c52c2([0x61,0x6c,0x67])]:_0x3c52c2([0x45,0x53,0x32,0x35,0x36])},_0x25e071=_0x435462[_0x3c52c2([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3c52c2([0x67,0x65,0x74])](_0x3c52c2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5b1d82(){let _0x21c749,_0x180a36=null,_0x3c3d80=null;try{if(_0x25e071==_0x3c52c2([0x47,0x50,0x4c]))return _0x3c52c2([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x21c749=_0x32f7db(),!_0x21c749)return _0x3c52c2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x21c749[_0x3c52c2([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3c3d80=_0x3d25d7(_0x21c749[_0x3c52c2([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x21c749[_0x3c52c2([0x6a,0x74,0x69])])),await _0x2170c1()?_0x1bcb64()?_0x46875b()?_0x3c52c2([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1ae833()?(_0x21c749[_0x3c52c2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3c52c2([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x180a36=_0xddc0c9(_0x3c52c2([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x21c749[_0x3c52c2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3c52c2([0x74,0x72,0x69,0x61,0x6c])&&(_0x180a36=_0xddc0c9(_0x3c52c2([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3627b1()):_0x3c52c2([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3c52c2([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3c52c2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3c52c2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x46875b(){const _0x4bf9ad=[_0x3c52c2([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3c52c2([0x74,0x72,0x69,0x61,0x6c])][_0x3c52c2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x21c749[_0x3c52c2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x33148b/0x3e8:0xe10*_0x376750;return _0x21c749[_0x3c52c2([0x65,0x78,0x70])]<_0x4bf9ad;}function _0x1bcb64(){const _0x563339=_0x21c749[_0x3c52c2([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x563339&&(!!_0x563339[_0x3c52c2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c52c2([0x2a]))||!!_0x563339[_0x3c52c2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c52c2([0x41,0x49])));}function _0x1ae833(){const _0x5414dc=_0x21c749[_0x3c52c2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5414dc||0x0==_0x5414dc[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x4c4f31}=new URL(window[_0x3c52c2([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5414dc[_0x3c52c2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4c4f31))return!0x0;const _0x342eed=_0x4c4f31[_0x3c52c2([0x73,0x70,0x6c,0x69,0x74])](_0x3c52c2([0x2e]));return _0x5414dc[_0x3c52c2([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2b146a=>_0x2b146a[_0x3c52c2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c52c2([0x2a])))[_0x3c52c2([0x6d,0x61,0x70])](_0x5559e4=>_0x5559e4[_0x3c52c2([0x73,0x70,0x6c,0x69,0x74])](_0x3c52c2([0x2e])))[_0x3c52c2([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xb6767d=>_0xb6767d[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x342eed[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3c52c2([0x6d,0x61,0x70])](_0x2aa13c=>Array(_0x342eed[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x2aa13c[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3c52c2([0x66,0x69,0x6c,0x6c])](_0x2aa13c[0x0]===_0x3c52c2([0x2a])?_0x3c52c2([0x2a]):'')[_0x3c52c2([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x2aa13c))[_0x3c52c2([0x73,0x6f,0x6d,0x65])](_0x4a9d9c=>_0x342eed[_0x3c52c2([0x65,0x76,0x65,0x72,0x79])]((_0x527f3c,_0x27a44e)=>_0x4a9d9c[_0x27a44e]===_0x527f3c||_0x4a9d9c[_0x27a44e]===_0x3c52c2([0x2a])));}function _0x3627b1(){return _0x180a36&&_0x3c3d80?new window[(_0x3c52c2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x42a32e,_0x1510d9)=>{_0x180a36[_0x3c52c2([0x74,0x68,0x65,0x6e])](_0x42a32e,_0x1510d9),_0x3c3d80[_0x3c52c2([0x74,0x68,0x65,0x6e])](_0x35d315=>{_0x35d315!=_0x3c52c2([0x56,0x61,0x6c,0x69,0x64])&&_0x42a32e(_0x35d315);},_0x1510d9);}):_0x180a36||_0x3c3d80||_0x3c52c2([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3d25d7(_0x373e3c,_0x578231){return new window[(_0x3c52c2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x17cecd=>{if(_0x4fa37d())return _0x17cecd(_0x3c52c2([0x56,0x61,0x6c,0x69,0x64]));_0x186d2a(),_0x435462[_0x3c52c2([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3c52c2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x297c88=!0x1;const _0xa4c8bf=_0x329816();function _0x3a4ca3(_0x1a7611){return!!_0x1a7611&&(typeof _0x1a7611===_0x3c52c2([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x1a7611===_0x3c52c2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x1a7611[_0x3c52c2([0x74,0x68,0x65,0x6e])]===_0x3c52c2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x1a7611[_0x3c52c2([0x63,0x61,0x74,0x63,0x68])]===_0x3c52c2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x565182(_0x3ef71c){_0x99ebb7(_0x3ef71c)[_0x3c52c2([0x74,0x68,0x65,0x6e])](_0x3c3b42=>{if(!_0x3c3b42||_0x3c3b42[_0x3c52c2([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3c52c2([0x6f,0x6b]))return _0x3c52c2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1c0a61(_0x4ee7b5(_0xa4c8bf+_0x578231))!=_0x3c3b42[_0x3c52c2([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3c52c2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3c52c2([0x56,0x61,0x6c,0x69,0x64]);})[_0x3c52c2([0x74,0x68,0x65,0x6e])](_0x467a52=>(_0x4b7e40(),_0x467a52),()=>{const _0x58f790=_0x440656();return null==_0x58f790?(_0x4b7e40(),_0x3c52c2([0x56,0x61,0x6c,0x69,0x64])):_0x3c52c2(_0x33148b-_0x58f790>(0x26b32157^_0x33a273)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3c52c2([0x74,0x68,0x65,0x6e])](_0x17cecd)[_0x3c52c2([0x63,0x61,0x74,0x63,0x68])](()=>{_0x17cecd(_0x3c52c2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xe74f3b=0x2894bd7^_0x33a273;function _0x4b7e40(){const _0x23bbad=_0x3c52c2([0x6c,0x6c,0x63,0x74,0x2d])+_0x1c0a61(_0x4ee7b5(_0x373e3c)),_0x2ae4cc=_0x532b94(_0x1c0a61(window[_0x3c52c2([0x4d,0x61,0x74,0x68])][_0x3c52c2([0x63,0x65,0x69,0x6c])](_0x33148b/_0xe74f3b)));window[_0x3c52c2([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3c52c2([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x23bbad,_0x2ae4cc);}function _0x440656(){const _0x5a7888=_0x3c52c2([0x6c,0x6c,0x63,0x74,0x2d])+_0x1c0a61(_0x4ee7b5(_0x373e3c)),_0x25651e=window[_0x3c52c2([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3c52c2([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5a7888);return _0x25651e?window[_0x3c52c2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x532b94(_0x25651e),0x10)*_0xe74f3b:null;}function _0x99ebb7(_0x5e334b){return new window[(_0x3c52c2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x26dbeb,_0x53adc3)=>{_0x5e334b[_0x3c52c2([0x74,0x68,0x65,0x6e])](_0x26dbeb,_0x53adc3),window[_0x3c52c2([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x53adc3,0x2be7197^_0x33a273);});}}_0x435462[_0x3c52c2([0x6f,0x6e])](_0x3c52c2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1bb633,_0x5e1acc)=>{if(_0x5e1acc[0x0]!=_0x373e3c)return _0x17cecd(_0x3c52c2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x5e1acc[0x1]={..._0x5e1acc[0x1],[_0x3c52c2([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0xa4c8bf};},{[_0x3c52c2([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3c52c2([0x68,0x69,0x67,0x68])}),_0x435462[_0x3c52c2([0x6f,0x6e])](_0x3c52c2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x487f58=>{_0x3a4ca3(_0x487f58[_0x3c52c2([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x297c88=!0x0,_0x565182(_0x487f58[_0x3c52c2([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3c52c2([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3c52c2([0x6c,0x6f,0x77])}),_0x341e86[_0x3c52c2([0x74,0x68,0x65,0x6e])](()=>{_0x297c88||_0x17cecd(_0x3c52c2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4fa37d(){return _0x435462[_0x3c52c2([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3c52c2([0x76,0x69,0x65,0x77])][_0x3c52c2([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3c52c2([0x61,0x75,0x74,0x6f]);}function _0x186d2a(){_0x435462[_0x3c52c2([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3c52c2([0x76,0x69,0x65,0x77])][_0x3c52c2([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3c52c2([0x61,0x75,0x74,0x6f]);}}function _0xddc0c9(_0x3b9d46){const _0x35a1e8=[new window[(_0x3c52c2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5cf55b=>setTimeout(_0x5cf55b,0x2b69b9b^_0x33a273)),_0x341e86[_0x3c52c2([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3c52c2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x15b39e=>{let _0x485fba=0x0;_0x435462[_0x3c52c2([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c52c2([0x6f,0x6e])](_0x3c52c2([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3cfad1,_0x464690)=>{_0x464690[0x0][_0x3c52c2([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x485fba++,_0x485fba==(0x2bfa4af^_0x33a273)&&(_0x15b39e(),_0x3cfad1[_0x3c52c2([0x6f,0x66,0x66])]());});}))];return window[_0x3c52c2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3c52c2([0x72,0x61,0x63,0x65])](_0x35a1e8)[_0x3c52c2([0x74,0x68,0x65,0x6e])](()=>_0x3b9d46);}async function _0xbafdc4(){await _0x341e86,_0x435462[_0x3c52c2([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c52c2([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x16bd8e,_0x435462[_0x3c52c2([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c52c2([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x16bd8e,_0x435462[_0x3c52c2([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3c52c2([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2e1e2b(_0x1ee75c){const _0x1d9676=_0x6303e3();_0x435462[_0x1d9676]=_0x3c52c2([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x1ee75c,_0x1ee75c!=_0x3c52c2([0x56,0x61,0x6c,0x69,0x64])&&_0xbafdc4();}function _0x6303e3(){const _0x1d3aa4=window[_0x3c52c2([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3c52c2([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3c52c2([0x6e,0x6f,0x77])]())[_0x3c52c2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3c52c2([0x2e]),'');let _0x1edaab=_0x3c52c2([0x6c]);for(let _0x171e83=0x0;_0x171e83<_0x1d3aa4[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x171e83+=0x2){let _0xb0570d=window[_0x3c52c2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1d3aa4[_0x3c52c2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x171e83,_0x171e83+0x2));_0xb0570d>=_0x90eaf4[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0xb0570d-=_0x90eaf4[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1edaab+=_0x90eaf4[_0xb0570d];}return _0x1edaab;}function _0x32f7db(){const _0x7928f7=_0x25e071[_0x3c52c2([0x73,0x70,0x6c,0x69,0x74])](_0x3c52c2([0x2e]));if(0x3!=_0x7928f7[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3b546e(_0x7928f7[0x1]);function _0x3b546e(_0x545ce6){const _0xe8ad10=_0x5c1c29(_0x545ce6);return _0xe8ad10&&_0x1b28c2()?_0xe8ad10:null;function _0x1b28c2(){const _0x7cec43=_0xe8ad10[_0x3c52c2([0x6a,0x74,0x69])],_0x2e51e2=window[_0x3c52c2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x7cec43[_0x3c52c2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x7cec43[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x5e40d2={..._0xe8ad10,[_0x3c52c2([0x6a,0x74,0x69])]:_0x7cec43[_0x3c52c2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x7cec43[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x5e40d2[_0x3c52c2([0x76,0x63])],_0x4ee7b5(_0x5e40d2)==_0x2e51e2;}}}async function _0x2170c1(){let _0x4537bb=!0x0;try{const _0x5efd5d=_0x25e071[_0x3c52c2([0x73,0x70,0x6c,0x69,0x74])](_0x3c52c2([0x2e])),[_0x527e2f,_0x48c0e7,_0x45b72b]=_0x5efd5d;return _0x58a9fe(_0x527e2f),await _0x18b16e(_0x527e2f,_0x48c0e7,_0x45b72b),_0x4537bb;}catch{return!0x1;}function _0x58a9fe(_0x2f9852){const _0x515490=_0x5c1c29(_0x2f9852);_0x515490&&_0x515490[_0x3c52c2([0x61,0x6c,0x67])]==_0x3c52c2([0x45,0x53,0x32,0x35,0x36])||(_0x4537bb=!0x1);}async function _0x18b16e(_0x1fb3b3,_0x10115b,_0x3c9dac){const _0x274813=window[_0x3c52c2([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3c52c2([0x66,0x72,0x6f,0x6d])](_0x37c5fb(_0x3c9dac),_0x579cf7=>_0x579cf7[_0x3c52c2([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4d2884=new window[(_0x3c52c2([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3c52c2([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x1fb3b3+_0x3c52c2([0x2e])+_0x10115b),_0x44aa0a=window[_0x3c52c2([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3c52c2([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x44aa0a)return;const _0x18f8a1=await _0x44aa0a[_0x3c52c2([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3c52c2([0x6a,0x77,0x6b]),_0x36f9b9,{[_0x3c52c2([0x6e,0x61,0x6d,0x65])]:_0x3c52c2([0x45,0x43,0x44,0x53,0x41]),[_0x3c52c2([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3c52c2([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3c52c2([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x44aa0a[_0x3c52c2([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3c52c2([0x6e,0x61,0x6d,0x65])]:_0x3c52c2([0x45,0x43,0x44,0x53,0x41]),[_0x3c52c2([0x68,0x61,0x73,0x68])]:{[_0x3c52c2([0x6e,0x61,0x6d,0x65])]:_0x3c52c2([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x18f8a1,_0x274813,_0x4d2884)||(_0x4537bb=!0x1);}}function _0x5c1c29(_0x5427ea){return _0x5427ea[_0x3c52c2([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3c52c2([0x65,0x79]))?JSON[_0x3c52c2([0x70,0x61,0x72,0x73,0x65])](_0x37c5fb(_0x5427ea)):null;}function _0x37c5fb(_0x2b5a25){return window[_0x3c52c2([0x61,0x74,0x6f,0x62])](_0x2b5a25[_0x3c52c2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3c52c2([0x2b]))[_0x3c52c2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3c52c2([0x2f])));}function _0x4ee7b5(_0x278433){let _0x36b79c=0x1505;function _0x1a1046(_0x2d659b){for(let _0x434b80=0x0;_0x434b80<_0x2d659b[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x434b80++){const _0x2e7aa0=_0x2d659b[_0x3c52c2([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x434b80);_0x36b79c=(_0x36b79c<<0x5)+_0x36b79c+_0x2e7aa0,_0x36b79c&=_0x36b79c;}}function _0x588ee5(_0xd60836){Array[_0x3c52c2([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xd60836)?_0xd60836[_0x3c52c2([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x588ee5):_0xd60836&&typeof _0xd60836==_0x3c52c2([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3c52c2([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xd60836)[_0x3c52c2([0x73,0x6f,0x72,0x74])]()[_0x3c52c2([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x373b43,_0x11a164])=>{_0x1a1046(_0x373b43),_0x588ee5(_0x11a164);}):_0x1a1046(window[_0x3c52c2([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xd60836));}return _0x588ee5(_0x278433),_0x36b79c>>>0x0;}function _0x1c0a61(_0x4ae224){return _0x4ae224[_0x3c52c2([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3c52c2([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3c52c2([0x30]));}function _0x532b94(_0x19764c){return _0x19764c[_0x3c52c2([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3c52c2([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3c52c2([0x6a,0x6f,0x69,0x6e])]('');}function _0x16bd8e(){}function _0x3c52c2(_0x57a76b){return _0x57a76b['map'](_0xc3e1b=>String['fromCharCode'](_0xc3e1b))['join']('');}_0x2e1e2b(await _0x5b1d82());}(this);}['showFakeVisualSelection'](){const _0x1feb4c=this['editor']['model'];_0x1feb4c['change'](_0x5da3ce=>{const _0x31c6e8=_0x1feb4c['document']['selection']['getRanges']();let _0x394814=0x0;for(const _0x30470b of _0x31c6e8){const _0x9ee9a5=w+':'+_0x394814;if(_0x1feb4c['markers']['has'](_0x9ee9a5))_0x5da3ce['updateMarker'](_0x9ee9a5,{'range':_0x30470b});else{if(_0x30470b['start']['isAtEnd']){const _0x303a53=_0x30470b['start']['getLastMatchingPosition'](({item:_0x4377bb})=>!_0x1feb4c['schema']['isContent'](_0x4377bb),{'boundaries':_0x30470b});_0x5da3ce['addMarker'](_0x9ee9a5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5da3ce['createRange'](_0x303a53,_0x30470b['end'])});}else _0x5da3ce['addMarker'](_0x9ee9a5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x30470b});}_0x394814++;}});}['hideFakeVisualSelection'](){const _0xf15632=this['editor']['model'],_0x35b187=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x35b187['length']&&_0xf15632['change'](_0x1cf130=>{_0x35b187['forEach'](_0x35601a=>{_0x1cf130['removeMarker'](_0x35601a);});});}['insertContent'](_0x3121fe,_0x112b63){const _0x16405f=this['_getAISelection'](),_0x351ae4=_0x112b63||_0x16405f['getFirstRange']();this['editor']['model']['canEditAt'](_0x351ae4)&&this['editor']['model']['change'](_0x1681b9=>{this['hideFakeVisualSelection'](),_0x112b63||this['_resetContentOfSelectedTableCells'](_0x1681b9,_0x16405f),this['_pasteHTMLUsingClipboard']({'insertAt':_0x351ae4,'writer':_0x1681b9,'html':_0x3121fe});});}['insertContentBelow'](_0x3a970c){const {model:_0x488f95}=this['editor'],_0x539788=this['_getAISelection']();_0x488f95['change'](()=>{const _0x1bfb5a=this['_prepareTableInsertBelowPosition'](_0x3a970c,_0x539788)||this['_getDefaultInsertBelowPosition'](_0x539788);this['insertContent'](_0x3a970c,_0x1bfb5a);});}['_getAISelection'](){const _0x2fff9c=this['editor']['model'],_0x1e3177=Array['from'](_0x2fff9c['markers']['getMarkersGroup'](w))['map'](_0x159d35=>_0x159d35['getRange']());return _0x2fff9c['createSelection'](_0x1e3177);}['_pasteHTMLUsingClipboard']({writer:_0x1dd3f7,html:_0x231097,insertAt:_0x295100}){const {view:_0x3cc9bf}=this['editor']['editing'],_0x5ad345=this['editor']['plugins']['get'](_0x2ede65),_0x5165c2=new gt();_0x5165c2['setData']('text/html',_0x231097);const _0x41a049=new ClipboardEvent('paste',{'clipboardData':_0x5165c2}),_0x2dd061=new _0x1ce5fe(_0x3cc9bf,_0x41a049,{'dataTransfer':new _0x49a740(_0x5165c2)});_0x1dd3f7['setSelection'](_0x295100);const _0x52a5c7=(_0x42e3ac,_0x2036fb)=>{_0x2036fb['resultRange']&&_0x1dd3f7['setSelection'](_0x2036fb['resultRange']);};_0x5ad345['once']('contentInsertion',_0x52a5c7,{'priority':'lowest'}),_0x3cc9bf['document']['fire']('paste',_0x2dd061),_0x5ad345['off']('contentInsertion',_0x52a5c7);}['_getDefaultInsertBelowPosition'](_0x428a20){const {model:_0x99005a}=this['editor'],_0x5f4250=Array['from'](_0x428a20['getSelectedBlocks']());return _0x5f4250['length']?_0x99005a['createPositionAfter'](_0x5f4250['pop']()):_0x428a20['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x9129ec,_0x28315c){const {model:_0x35a2d5,plugins:_0x581fa8}=this['editor'];if(_0x581fa8['has']('TableUtils')){const _0x2f990b=_0x581fa8['get']('TableUtils')['getSelectedTableCells'](_0x28315c);if(_0x2f990b['length']){const _0x309bff=this['_getTableRowCountFromContent'](_0x9129ec),_0x6cedfe=this['_createEmptyTableRows'](_0x2f990b,_0x309bff);return _0x35a2d5['createPositionAt'](_0x6cedfe,0x0);}}return null;}['_getTableRowCountFromContent'](_0x295ee8){const _0x40aa2c=this['editor']['plugins']['get']('TableUtils'),_0x25e430=this['editor']['data']['parse'](_0x295ee8),_0x2e7abd=Array['from'](_0x25e430['getChildren']())['filter'](_0xcff0db=>_0xcff0db['is']('element','table'));let _0x2d8944=0x0;return _0x2e7abd['forEach'](_0x28332d=>{_0x2d8944+=_0x40aa2c['getRows'](_0x28332d);}),_0x2d8944;}['_createEmptyTableRows'](_0x8d750,_0x350ce0){const _0x96491a=this['editor']['plugins']['get']('TableUtils'),_0x2b91ff=_0x96491a['getRowIndexes'](_0x8d750),_0x3f01c2=_0x96491a['getColumnIndexes'](_0x8d750),_0xcdc051=_0x2b91ff['last']+0x1,_0x2a7c63=_0x3f01c2['first'],_0x54f5e0=_0x8d750[0x0]['findAncestor']('table');for(let _0x14ab6d=0x0;_0x14ab6d<_0x350ce0;_0x14ab6d++)_0x96491a['insertRows'](_0x54f5e0,{'at':_0xcdc051});return _0x54f5e0['getChild'](_0xcdc051)['getChild'](_0x2a7c63);}['_resetContentOfSelectedTableCells'](_0x44e416,_0x49fe8b){const {plugins:_0x1c7a18}=this['editor'],{model:_0x3247cf}=_0x44e416;if(!_0x1c7a18['has']('TableUtils'))return;_0x1c7a18['get']('TableUtils')['getSelectedTableCells'](_0x49fe8b)['length']&&_0x3247cf['deleteContent'](_0x49fe8b);}}class x extends _0x515c0a{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0xed27b5('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x2e0918){super(_0x2e0918),this['name']='AIRequestError';}}function i(_0x1ad05e,_0x4b02de,_0x1d2f2c){const t=_0x1ad05e['t'];switch(_0x4b02de){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',_0x1d2f2c);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1d2f2c);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'},_0x1d2f2c);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 _0x4b02de;}}class E extends _0x11770b{['_commandDefinitions'];constructor(_0x2d4a09,_0x16a8ff){super(_0x2d4a09),this['_commandDefinitions']=_0x16a8ff,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x39c886,_0x2577f6,_0x4d4e4f)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x4d4e4f));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x7ac9dd,_0x55a908,_0x30876b)=>{this['enabledCommandsIds']=_0x30876b?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x1513f2=this['editor']['model'];this['_hasContext']=function(_0x48f389){const _0x411746=_0x48f389['document']['selection'];return _0x411746['isCollapsed']?0x0!==[..._0x411746['getSelectedBlocks']()]['length']&&![..._0x411746['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x48f389['hasContent'](_0x411746['getFirstRange']());}(_0x1513f2);const _0x549087=_0x1513f2['document']['selection'],_0x169ede=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x117cd3 of _0x549087['getRanges']())for(const _0x2faf50 of _0x117cd3['getItems']())if(_0x2faf50['is']('element')&&_0x169ede['includes'](_0x2faf50['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2f1101='',_0x48ec91='',_0x476e0a='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x2f1101,_0x48ec91,_0x476e0a);}}function F(_0xa94ebc,_0x13f74e){const _0x2209db=new Set();for(const _0x46a2e5 of _0xa94ebc['values']())(_0x13f74e||!0x1===_0x46a2e5['requiresContent'])&&_0x2209db['add'](_0x46a2e5['id']);return Array['from'](_0x2209db);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x2c17f7(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x47c1f3,_0x318e6b,_0x36135a){super(),this['editor']=_0x47c1f3,this['textAdapter']=_0x318e6b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x36135a,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1fbb70,_0x5e1e,_0x35360e)=>{this['view']['value']=this['_sanitizeHTML'](_0x35360e);}),this['listenTo'](this['view'],'submitPrompt',(_0x1d5e72,_0x50b2c8)=>{const _0x5b56cc=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x50b2c8,_0x5b56cc,'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:_0x13b30c,query:_0x31011d,htmlContent:_0x10f5cf,label:_0x7aaa8a,mainActionLabel:_0x3271c1}){this['view']['prompt']=_0x7aaa8a,this['view']['mainAction']=_0x3271c1,this['initialContext']=_0x10f5cf,_0x31011d&&(this['view']['isRendered']?this['_handleQuery'](_0x31011d,_0x10f5cf,_0x13b30c,_0x7aaa8a):this['view']['once']('render',()=>{this['_handleQuery'](_0x31011d,_0x10f5cf,_0x13b30c,_0x7aaa8a);}));}['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'](_0x1a0e3c,_0x3f37cc,_0x46527d,_0x46c7ca){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3f37cc,this['previousQuery']=_0x1a0e3c,this['previousLabel']=_0x46c7ca||_0x1a0e3c,this['previousActionId']=_0x46527d,new Promise(_0x452785=>{this['textAdapter']['makeRequest']({'query':_0x1a0e3c,'context':_0x3f37cc,'onData':_0x935ca5=>{this['currentResponse']=_0x935ca5,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x46527d})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x540040=>{_0x540040 instanceof R?this['view']['handleError'](_0x540040['message']):this['view']['handleError'](),_0x452785();})['finally'](()=>{this['stopProcessing'](),_0x452785();});});}['_parseAndNormalizeContent'](_0x3e5bef,_0x59d2f2=!0x1){const _0x554283=Q['exec'](_0x3e5bef);_0x3e5bef=_0x554283?_0x3e5bef['substring'](_0x554283[0x1]['length']):_0x3e5bef['length']<0x64&&!_0x59d2f2?'':this['_stripMarkdownSyntax'](_0x3e5bef);const _0x2b3845=this['_domParser']['parseFromString'](_0x3e5bef,'text/html');if(_0x554283){const _0x1a2542=Array['from'](_0x2b3845['body']['childNodes']);_0x1a2542['reverse']();for(const _0x14b2ec of _0x1a2542){if(_0x14b2ec['nodeType']==Node['ELEMENT_NODE'])break;_0x14b2ec['remove']();}}const _0x1b7ed4=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2b3845['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1b7ed4);const _0x2c011e=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x4917d4=this['editor']['data']['toModel'](_0x1b7ed4);return _0x2c011e||_0x4917d4['markers']['clear'](),this['editor']['data']['stringify'](_0x4917d4);}['_normalizeResponseHeadings'](_0x5abd7e){const _0x16cae1=new _0x3668d2(this['editor']['editing']['view']['document']),_0x29b7bb=new _0x59cd7f({'name':/^h[1-5]$/}),_0x4dd4d9=[];let _0xc9ac6c=!0x1;for(const _0x47885b of _0x5abd7e)_0x47885b['is']('element')&&_0x29b7bb['match'](_0x47885b)&&(_0x4dd4d9['push'](_0x47885b),'h1'==_0x47885b['name']&&(_0xc9ac6c=!0x0));if(_0xc9ac6c){for(const _0x5cece2 of _0x4dd4d9)_0x16cae1['rename']('h'+(parseInt(_0x5cece2['name'][0x1])+0x1),_0x5cece2);}}['_isH1TagSupportEnabled'](){const {data:_0x5d53b2,editing:_0x59c3fc}=this['editor'],_0x15a7cc=_0x5d53b2['htmlProcessor']['toView']('<h1></h1>'),_0x693ca2=_0x5d53b2['toView'](_0x5d53b2['toModel'](_0x15a7cc));return!!_0x59c3fc['view']['domConverter']['viewToDom'](_0x693ca2)['querySelector']('h1');}['_sanitizeHTML'](_0x334128){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x334128),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x2aed4e){const _0x27b332=_0x2aed4e['trim']();return _0x27b332['startsWith']('```html')?_0x27b332['endsWith']('```')?_0x27b332['substring'](0x7,_0x27b332['length']-0x3):_0x27b332['substring'](0x7):_0x2aed4e;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x4037fb){super(_0x4037fb),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xd66335=>i(_0x4037fb,'AI_'+_0xd66335['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x4037fb,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x4037fb,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x4037fb,'Stop'));const _0x2c02bd=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x2c02bd['if']('isVisible','ck-hidden',_0x27a031=>!_0x27a031)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x1a477c,_0x31d112){const _0x552c00=new _0x7a723e(this['locale']);return _0x552c00['set']({'label':_0x1a477c,'class':_0x31d112||'','isVisible':!0x0,'withText':!0x0}),_0x552c00;}}class ct extends _0x4351e1{['contentFieldView'];['copyButtonView'];constructor(_0x5e7407,_0x379496=''){super(_0x5e7407),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1c5062=this['bindTemplate'];this['contentFieldView']=new bt(_0x5e7407,_0x379496),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1c5062['if']('isVisible','ck-hidden',_0x15241d=>!_0x15241d)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1c5062['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 _0x3b0f06=!0x1;this['on']('change:value',(_0x4126e4,_0x740fd3,_0x319bb1)=>{const _0x269083=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x319bb1),this['isProcessing']&&_0x269083&&!_0x3b0f06&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4a954b,_0x36c12a,_0x52afeb)=>{_0x3b0f06=!0x1,_0x52afeb?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3b0f06=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3b0f06=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x20c228=this['locale'],_0xce09a8=new _0x7a723e(this['locale']),_0x5a3e53='ck-ai-form__copy-button';return _0xce09a8['set']({'label':i(_0x20c228,'Copy'),'icon':_0xe75053,'class':_0x5a3e53,'tooltip':!0x0}),_0xce09a8['bind']('isVisible')['to'](this,'value',_0x190372=>!!_0x190372),_0xce09a8['bind']('isEnabled')['to'](this,'isProcessing',_0xcf1ca4=>!_0xcf1ca4),_0xce09a8['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xce09a8['icon']=_0x4f032b,_0xce09a8['class']=_0x5a3e53+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xce09a8['icon']=_0xe75053,_0xce09a8['class']=_0x5a3e53;},0x3e8);}),_0xce09a8;}['_copyHTMLToClipboard'](_0x298eb8){const {window:_0x5a09a1,document:_0x292364}=_0x9e473a;if(_0x5a09a1['ClipboardItem']){const {Blob:_0x506c91,ClipboardItem:_0xaf8d81}=_0x5a09a1,_0x1fd15d=[new _0xaf8d81({'text/html':new _0x506c91([_0x298eb8['innerHTML']],{'type':'text/html'}),'text/plain':new _0x506c91([_0x298eb8['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1fd15d);}else{const _0x1b0f38=_0x292364['createElement']('div');_0x1b0f38['style']['position']='absolute',_0x1b0f38['style']['left']='-9999px',_0x1b0f38['innerHTML']='<span>[</span>'+_0x298eb8['innerHTML']+'<span>]</span>',_0x292364['body']['appendChild'](_0x1b0f38);const _0x84cb87=_0x292364['createRange']();_0x84cb87['setStartAfter'](_0x1b0f38['firstElementChild']),_0x84cb87['setEndBefore'](_0x1b0f38['lastElementChild']);const _0x1bb0f3=_0x5a09a1['getSelection']();_0x1bb0f3['removeAllRanges'](),_0x1bb0f3['addRange'](_0x84cb87),_0x292364['execCommand']('copy'),_0x1b0f38['remove']();}}}class bt extends _0x4351e1{constructor(_0x5cb708,_0x361f24=''){super(_0x5cb708),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x361f24,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x37dfed){this['element']['innerHTML']=_0x37dfed;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x19621e=new _0x4351e1(),_0x22f1cf=this['locale'],_0x29bf5a=new _0x54872b();return _0x29bf5a['isVisible']=!0x0,_0x19621e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x29bf5a,{'text':i(_0x22f1cf,'AI\x20is\x20writing...')}]}),_0x19621e['render'](),_0x19621e;}}class mt extends _0x4351e1{constructor(_0x234216,_0x5952d5=''){super(_0x234216);const _0x484264=new _0x2a24ba(),_0x1816cb=this['bindTemplate'];this['set']('text',_0x5952d5),_0x484264['content']=_0x773f81,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x484264,{'text':_0x1816cb['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x13a18f,_0x438ecc){super(_0x13a18f,_0x438ecc),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',(_0x14ddfa,_0x2e0d8c)=>{_0x14ddfa['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2e0d8c());});}['_createSubmitButton'](){const _0x51d252=new _0x7a723e(this['locale']),_0x5491b0=this['locale'];return _0x51d252['set']({'icon':it,'label':i(_0x5491b0,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x51d252['on']('execute',()=>{this['submit']();}),_0x51d252['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x963a4e,_0x9e86e3)=>!_0x963a4e&&_0x9e86e3),_0x51d252;}['_createShowHistoryButton'](){const _0x514a1b=new _0x7a723e(this['locale']),_0x1135c4=this['resultsView'],_0x2f9f78=this['locale'];_0x514a1b['set']({'label':i(_0x2f9f78,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x514a1b['bind']('isOn')['to'](_0x1135c4,'isVisible'),_0x514a1b['bind']('isEnabled')['to'](this,'isEnabled'),_0x514a1b['on']('execute',()=>{_0x1135c4['isVisible']=!_0x1135c4['isVisible'],_0x1135c4['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1f4778=()=>{_0x9e473a['window']['requestAnimationFrame'](()=>{if(_0x52bac2(this['element'])){const _0x33473b=new _0x1b0bbc(this['queryView']['fieldView']['element']),_0x856ec=_0x33473b['width'],_0x33d75c='rtl'===_0x2f9f78['uiLanguageDirection']?'left':'right';_0x33473b['excludeScrollbarsAndBorders'](),_0x514a1b['element']['style'][_0x33d75c]=_0x856ec-_0x33473b['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1f4778),this['on']('render',_0x1f4778),_0x514a1b;}['submit'](){const _0x4cd415=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4cd415);}['focus'](_0xdb3df4){-0x1===_0xdb3df4?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x193979){super(_0x193979),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x193979,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x287d32=0x0;for(const _0x4f86b6 of this['items'])_0x287d32+=_0x4f86b6['items']['length'];return{'resultsCount':_0x287d32,'totalItemsCount':_0x287d32};}['_createClearHistoryButton'](){const _0x134ce8=this['locale'],_0x370e13=new _0x7a723e(this['locale']);return _0x370e13['set']({'label':'('+i(_0x134ce8,'Clear')+')','withText':!0x0}),_0x370e13['on']('execute',()=>this['fire']('clearHistory')),_0x370e13;}}class ut extends xt{constructor(_0x3d5a0d){super();const _0x4e6f65=new wt(),_0x812dda=new _0x7a723e(this['locale'],_0x4e6f65);this['children']['add'](_0x812dda),_0x812dda['set']({'label':_0x3d5a0d['prompt'],'withText':!0x0}),_0x812dda['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x3d5a0d['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x47cb6e{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4e6043,_0x15943b)=>{const _0x464c69=os(_0x15943b['prompt']);for(const _0x38a814 of this)if(_0x38a814!=_0x15943b&&os(_0x38a814['prompt'])===_0x464c69){this['remove'](_0x38a814);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x1aa665=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x1aa665));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x14e5ec=>_0x14e5ec)));}}function os(_0x294c08){return _0x294c08['toLowerCase']()['trim']();}class k extends _0x4351e1{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4df651,_0xcb3d6b,_0x104e29=''){super(_0x4df651),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(_0x4df651),this['contentArea']=new ct(_0x4df651,_0x104e29),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 _0x56f4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0xcb3d6b],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x56f4['if']('isError','ck-hidden',_0x12bc58=>!_0x12bc58)]},'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'](_0x57bd9b=0x1){-0x1===_0x57bd9b?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 _0x22ff83=this['locale'],_0x4f022b=new lt(_0x22ff83,{'queryView':{'label':i(_0x22ff83,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x22ff83,'Empty\x20history'),'secondary':i(_0x22ff83,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4f022b['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x536874,_0x42ed12)=>_0x536874&&!_0x42ed12),this['listenTo'](_0x4f022b,'submit',(_0x3e0b8f,_0x2105fd)=>{this['prompt']=_0x2105fd;const _0x366991=ft(_0x2105fd);this['fire']('submitPrompt',_0x366991),_0x2105fd['trim']()&&this['_promptHistory']['add']({'prompt':_0x366991},0x0);},{'priority':'high'}),_0x4f022b;}['_createHistoryView'](){const _0x2bf272=new pt(this['locale']);return _0x2bf272['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x2bf272['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2bf272;}['_createToolbar'](){const _0x29f245=new at(this['locale']);return _0x29f245['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1f164f,_0x112b5a,_0x1bb60b)=>_0x1f164f&&!_0x112b5a&&!!_0x1bb60b),_0x29f245['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x29f245['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x30d1af,_0x2b8339,_0x2c9378)=>_0x30d1af&&!_0x2b8339&&!!_0x2c9378),_0x29f245['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x29f245['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1fc73c,_0x7684e9)=>_0x1fc73c&&!_0x7684e9),_0x29f245['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x29f245['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x29f245['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x29f245;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1091fb=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x1091fb,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x29ec65){const _0x229465=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x29ec65||i(_0x229465,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x515c0a{['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[_0x114521,a,x,_0x4a6f28];}constructor(_0x123941){super(_0x123941),_0x123941['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x123941['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x123941['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x123941['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x5b7ff5}=this;this['_aiAdapter']=_0x5b7ff5['plugins']['get'](x),this['_dialog']=_0x5b7ff5['plugins']['get'](_0x4a6f28),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x3cbe99=new E(_0x5b7ff5,Array['from'](this['_commandDefinitions']['values']()));_0x5b7ff5['commands']['add']('showAIAssistant',_0x3cbe99),_0x5b7ff5['ui']['componentFactory']['add']('aiCommands',_0x4434ae=>{const _0x106262=_0x502434(_0x4434ae);return _0x106262['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x106262['buttonView']['set']({'label':i(_0x4434ae,'AI\x20Commands'),'icon':_0x34e489,'tooltip':!0x0}),_0x106262['on']('execute',_0x278c6f=>this['_onExecute'](_0x278c6f['source']['id'])),_0x27fba4(_0x106262,_0x5b7ff5['ui']['view']['body'],function(_0x5a0e03){const _0xbfa58c=o(_0x5a0e03['config']['get']('ai.aiAssistant.commands'),_0x5a0e03['locale']),_0x3d5045=U(_0x5a0e03,_0xbfa58c)['filter'](_0xaf5d99=>_0xaf5d99['commands']['length']);if(0x1===_0x3d5045['length'])return U(_0x5a0e03,_0x3d5045[0x0]['commands'])['map'](_0x10fccb=>({'id':_0x10fccb['id'],'label':_0x10fccb['label']}));return _0x3d5045['map'](_0x59e7c9=>{const {groupId:_0x4a7489,groupLabel:_0x5bf595,commands:_0x36f909}=_0x59e7c9,_0x1542f0=U(_0x5a0e03,_0x36f909)['map'](_0xc5fb65=>({'id':_0xc5fb65['id'],'label':_0xc5fb65['label']}));return{'id':_0x4a7489,'menu':_0x5bf595||_0x4a7489,'children':_0x1542f0};});}(_0x5b7ff5),{'ariaLabel':i(_0x4434ae,'AI\x20Commands')}),_0x106262['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x3cbe99['on']('change:enabledCommandsIds',_0x516f2c),_0x106262['menuView']['once']('render',_0x516f2c),_0x106262;function _0x516f2c(){_0x106262['isEnabled']=_0x3cbe99['enabledCommandsIds']['length']>0x0;for(const _0x5581c3 of _0x106262['menuView']['buttons'])_0x5581c3['isEnabled']=_0x3cbe99['enabledCommandsIds']['includes'](_0x5581c3['id']);}}),_0x5b7ff5['ui']['componentFactory']['add']('menuBar:aiCommands',_0x37a826=>{const _0x15aae7=new _0x1506d9(_0x37a826);_0x15aae7['buttonView']['set']({'label':i(_0x37a826,'AI\x20Commands'),'icon':_0x34e489}),_0x15aae7['bind']('isEnabled')['to'](_0x3cbe99,'enabledCommandsIds',_0x2ccd1d=>_0x2ccd1d['length']>0x0);const _0x168c03=o(_0x5b7ff5['config']['get']('ai.aiAssistant.commands'),_0x37a826);return this['_populateMenuBarMenu'](_0x3cbe99,_0x15aae7,_0x168c03,_0x5dff9a=>this['_onExecute'](_0x5dff9a)),_0x15aae7;}),_0x5b7ff5['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x16d5d6=this['_createAIAssistantUIButton'](_0x7a723e);return _0x16d5d6['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x16d5d6;}),_0x5b7ff5['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x16969b=this['_createAIAssistantUIButton'](_0x34bfe7);return _0x16969b['set']({'role':'menuitemcheckbox'}),_0x16969b;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x116de8=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x38102e;for(const _0x4fc825 in _0x116de8){const _0x3d19ab=_0x4fc825,_0x35d547=_0x116de8[_0x3d19ab];if('aiLicenseKeyValid'==_0x35d547||'aiLicenseKeyInvalid'==_0x35d547||'aiLicenseKeyExpired'==_0x35d547||'aiLicenseKeyDomainLimit'==_0x35d547||'aiLicenseKeyNotAllowed'==_0x35d547||'aiLicenseKeyEvaluationLimit'==_0x35d547||'aiLicenseKeyTrialLimit'==_0x35d547||'aiLicenseKeyUsageLimit'==_0x35d547){delete _0x116de8[_0x3d19ab],_0x38102e=_0x35d547,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x38102e&&_0x116de8['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x38102e&&_0x116de8['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x38102e&&_0x116de8['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x38102e&&_0x116de8['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x38102e&&_0x116de8['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x38102e&&_0x116de8['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x38102e&&_0x116de8['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x422065='',_0x27ae7c='',_0xcc07c='custom'){const _0x2c350b=this['editor'],_0x36a39e=_0x2c350b['editing']['view'],_0x28acc1=_0x2c350b['plugins']['get'](a),_0x35036a=_0x2c350b['plugins']['get'](_0x114521);_0x28acc1['showFakeVisualSelection']();const _0x482c10=new l(),_0x378957=new ClipboardEvent('copy',{'clipboardData':_0x482c10}),_0x5ec60c=new _0x49a740(_0x482c10),_0x3736d7=new _0x1ce5fe(_0x36a39e,_0x378957,{'dataTransfer':_0x5ec60c});_0x35036a['_forceMarkersCopy']('comment',()=>{_0x36a39e['document']['fire']('copy',_0x3736d7);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x2c350b,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x2d9161=_0x5ec60c['getData']('text/html');const _0x411ee3=_0x2c350b['model']['document']['selection'],_0x5a41ab=Array['from'](_0x411ee3['getRanges']());0x1===_0x5a41ab['length']&&_0x5a41ab[0x0]['isFlat']&&!_0x411ee3['getSelectedElement']()&&''!==_0x2d9161['replace'](/ /g,'')['trim']()&&(_0x2d9161='<p>'+_0x2d9161+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0xcc07c,'query':_0x422065,'htmlContent':_0x2d9161,'label':_0x27ae7c,'mainActionLabel':_[_0x2c350b['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x3c77d6,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x3b370c['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x28acc1['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x44fd1d=new Map(),_0x588033=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x10008d of _0x588033)for(const _0x196b35 of _0x10008d['commands'])_0x44fd1d['set'](_0x196b35['id'],{..._0x196b35,'groupId':_0x10008d['groupId'],'groupLabel':_0x10008d['groupLabel']||_0x10008d['groupId']});return _0x44fd1d;}['_createAIAssistantUIButton'](_0x578e2c){const _0x11fdca=this['editor'],_0x3cd337=_0x11fdca['commands']['get']('showAIAssistant'),_0x29770c=new _0x578e2c(_0x11fdca['locale']);return _0x29770c['set']({'label':i(_0x11fdca['locale'],'AI\x20Assistant'),'icon':_0x3c77d6,'isToggleable':!0x0}),_0x29770c['bind']('isEnabled')['to'](_0x3cd337),_0x29770c['bind']('isOn')['to'](this['_dialog'],'id',_0x593f8c=>'aiAssistant'===_0x593f8c),this['listenTo'](_0x29770c,'execute',()=>{_0x29770c['isOn']?this['hideUI']():_0x3cd337['execute']();}),_0x29770c;}['_initView'](){const _0x3f496f=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',()=>{_0x3f496f['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3f496f['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x3ab150,ui:{ariaLiveAnnouncer:_0x13d9ce}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x48ca1f,_0x2973ea,_0x1189b8)=>{const _0x20a7c8=this['_aiAssistantController']['currentContext'];_0x1189b8?_0x13d9ce['announce'](i(_0x3ab150,'AI\x20is\x20writing')):_0x20a7c8&&_0x13d9ce['announce'](i(_0x3ab150,'Generated\x20content:\x20%0',_0x20a7c8),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x1ed199,_0x5a5374,_0x3c46f6)=>{if(_0x3c46f6){const _0xcad9f=this['_formView']['errorView']['text'];_0x13d9ce['announce'](i(_0x3ab150,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xcad9f));}});}['_onExecute'](_0x3f63f0){const _0x5426c4=this['_commandDefinitions']['get'](_0x3f63f0),_0x18214b=this['editor'],_0x5daeee=_0x18214b['model']['document']['selection'],_0x280077=_0x18214b['commands']['get']('showAIAssistant'),_0x15df05=_0x18214b['plugins']['get'](a),_0x409848=''+(_0x5426c4['groupId']!==K?_0x5426c4['groupLabel']+':\x20':'')+_0x5426c4['label'];if(!0x1!==_0x5426c4['requiresContent']&&_0x5daeee['isCollapsed']){const _0x5add39=_0x556a6f(_0x5daeee['getSelectedBlocks']())||_0x18214b['model']['schema']['getLimitElement'](_0x5daeee);_0x18214b['model']['change'](_0x287741=>{_0x287741['setSelection'](_0x5add39,'in');});}_0x15df05['showFakeVisualSelection'](),_0x280077['execute'](_0x5426c4['prompt'],_0x409848,'command:'+_0x3f63f0);}['_populateMenuBarMenu'](_0x459da0,_0x1f31c1,_0x53d220,_0x1c2d4d){const _0x4bd154=this['editor'],_0x207951=_0x4bd154['locale'],_0x5a9de0=new _0x3cd171(_0x207951),_0x2edb82=U(_0x4bd154,_0x53d220)['filter'](_0x7c76f=>_0x7c76f['commands']['length']);0x1===_0x2edb82['length']?this['_getMenuBarGroupButtons']({'command':_0x459da0,'commands':_0x2edb82[0x0]['commands'],'parentMenuView':_0x1f31c1,'onExecute':_0x1c2d4d})['forEach'](_0x5a2ac3=>_0x5a9de0['items']['add'](_0x5a2ac3)):_0x2edb82['forEach'](({groupId:_0x14d98f,groupLabel:_0x551c08,commands:_0x23c87b})=>{const _0xc3f21e=new _0x2e2987(_0x207951,_0x1f31c1),_0x2b161e=new _0x1506d9(_0x207951),_0x527ebd=new _0x3cd171(_0x207951),_0x9ccaf7=this['_getMenuBarGroupButtons']({'command':_0x459da0,'commands':_0x23c87b,'parentMenuView':_0x2b161e,'onExecute':_0x1c2d4d});_0x2b161e['buttonView']['set']({'label':_0x551c08||_0x14d98f}),_0x2b161e['delegate']('execute')['to'](_0x1f31c1),_0x527ebd['items']['addMany'](_0x9ccaf7),_0x2b161e['panelView']['children']['add'](_0x527ebd),_0xc3f21e['children']['add'](_0x2b161e),_0x5a9de0['items']['add'](_0xc3f21e);}),_0x1f31c1['panelView']['children']['add'](_0x5a9de0);}['_getMenuBarGroupButtons']({command:_0x402415,commands:_0xadfc4c,parentMenuView:_0x5766ff,onExecute:_0x358d10}){const _0x3cd2f0=this['editor'],_0x84219d=_0x3cd2f0['locale'];return U(_0x3cd2f0,_0xadfc4c)['map'](_0x198520=>{const _0x250c0e=new _0x2e2987(_0x84219d,_0x5766ff),_0x497841=new _0x34bfe7(_0x84219d);return _0x497841['set']({'label':_0x198520['label']}),_0x497841['delegate']('execute')['to'](_0x5766ff),_0x497841['on']('execute',()=>_0x358d10(_0x198520['id'])),_0x497841['bind']('isEnabled')['to'](_0x402415,'enabledCommandsIds',_0x4ccf2a=>_0x4ccf2a['includes'](_0x198520['id'])),_0x250c0e['children']['add'](_0x497841),_0x250c0e;});}}function T(_0x32a03d,_0x1f3fb8){return void 0x0!==_0x32a03d['order']&&void 0x0===_0x1f3fb8['order']?0x1:void 0x0===_0x32a03d['order']&&void 0x0!==_0x1f3fb8['order']?-0x1:void 0x0!==_0x32a03d['order']&&void 0x0!==_0x1f3fb8['order']?_0x32a03d['order']-_0x1f3fb8['order']:0x0;}function U(_0x14ffae,_0x28609d){_0x28609d['sort'](T);const _0x32b60a={},_0x309f5f=[];for(const _0x2ea631 of _0x28609d)if(void 0x0!==_0x2ea631['order']){if(_0x2ea631['order']in _0x32b60a)throw new _0xed27b5('ai-commands-config-order-collision',_0x14ffae,{'conflictingDefinitions':[_0x2ea631,_0x32b60a[_0x2ea631['order']]]});_0x32b60a[_0x2ea631['order']]=_0x2ea631,_0x309f5f['splice'](_0x2ea631['order'],0x0,_0x2ea631);}else _0x309f5f['push'](_0x2ea631);return _0x309f5f;}class At extends _0x515c0a{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4397fc){super(_0x4397fc);const _0x1ec184=_0x4397fc['config'],_0x775f0d=_0x4397fc['locale'];_0x1ec184['define']('ai.aiAssistant.preserveComments',!0x0),_0x1ec184['define']('ai.aiAssistant.commands',_t(_0x775f0d)),_0x1ec184['define']('ai.aiAssistant.extraCommandGroups',[]),_0x1ec184['define']('ai.aiAssistant.removeCommands',[]);let _0x46e7cf=o(_0x1ec184['get']('ai.aiAssistant.commands'),_0x775f0d);const _0x49cd6=_0x1ec184['get']('ai.aiAssistant.extraCommandGroups'),_0x4dfb6e=_0x1ec184['get']('ai.aiAssistant.removeCommands');_0x49cd6['forEach'](_0x2f4e86=>{const _0x3601fb=_0x46e7cf['find'](_0x328ff6=>_0x328ff6['groupId']===_0x2f4e86['groupId']);_0x3601fb?_0x3601fb['commands']=_0x3601fb['commands']['concat'](_0x2f4e86['commands']):_0x46e7cf['push'](_0x2f4e86);}),_0x46e7cf=_0x46e7cf['filter'](_0x391e54=>!_0x4dfb6e['includes'](_0x391e54['groupId'])),_0x46e7cf['forEach'](_0x3e05ee=>{_0x3e05ee['commands']=_0x3e05ee['commands']['filter'](_0x1fade0=>!_0x4dfb6e['includes'](_0x1fade0['id']));}),_0x1ec184['set']('ai.aiAssistant.commands',_0x46e7cf);}}function _t(_0xe3b550){return[{'groupId':'editOrReview','groupLabel':i(_0xe3b550,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0xe3b550,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0xe3b550,'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(_0xe3b550,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0xe3b550,'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(_0xe3b550,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0xe3b550,'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(_0xe3b550,'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(_0xe3b550,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0xe3b550,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0xe3b550,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0xe3b550,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0xe3b550,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0xe3b550,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0xe3b550,'Change\x20style'),'commands':[{'id':'business','label':i(_0xe3b550,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0xe3b550,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0xe3b550,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0xe3b550,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0xe3b550,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0xe3b550,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0xe3b550,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0xe3b550,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0xe3b550,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0xe3b550,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0xe3b550,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0xe3b550,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0xe3b550,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x515c0a{['abortController'];static get['requires'](){return[x];}constructor(_0x1454d6){super(_0x1454d6),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'](_0x4be1b4){return this['sendRequest'](_0x4be1b4)['catch'](_0x545071=>{if(_0x545071 instanceof R)return Promise['reject'](_0x545071);if('AbortError'==_0x545071['name'])return Promise['resolve']();throw console['error'](_0x545071),new _0xed27b5('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x581d6b,_0x133305){const _0xe4a06e=this['editor']['locale'],_0x4a8d1a={'Content-Type':'application/json'};if('object'==typeof _0x581d6b)Object['assign'](_0x4a8d1a,_0x581d6b);else{if(_0x581d6b)try{const _0x1a9a45=await _0x581d6b(_0x133305);Object['assign'](_0x4a8d1a,_0x1a9a45);}catch{return Promise['reject'](new R(i(_0xe4a06e,'AI_ERROR_GET_HEADERS')));}}return _0x4a8d1a;}async['_prepareRequestParameters'](_0x45ba57,_0x1fe826){const _0x1a98df=this['editor']['locale'];if('object'==typeof _0x45ba57)return _0x45ba57;try{return await _0x45ba57(_0x1fe826);}catch{return Promise['reject'](new R(i(_0x1a98df,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x1b28e1){super(_0x1b28e1),_0x1b28e1['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x1b28e1['config']['get']('ai.openAI.requestParameters')||_0x1b28e1['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x1b28e1['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x1b28e1['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x1b28e1['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x35287e,context:_0x49cefa,onData:_0x1b7ec2,actionId:_0x46c4a6}){const _0x4e5652=this['editor']['locale'],_0x57b57a=await this['prepareMessages'](_0x35287e,_0x49cefa,_0x46c4a6),_0x22afbd=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x46c4a6),_0x165a8c=await this['_prepareRequestParameters'](this['_requestParameters'],_0x46c4a6),_0x2f9c92={'messages':_0x57b57a,..._0x165a8c},_0x500063={'method':'POST','headers':_0x22afbd,'body':JSON['stringify'](_0x2f9c92),'signal':this['abortController']['signal']},_0x57ac91=await fetch(this['_apiUrl'],_0x500063);if(_0x57ac91['ok'])return _0x165a8c['stream']?await this['_readStreamableResponse'](_0x57ac91,_0x1b7ec2):await this['_readStaticResponse'](_0x57ac91,_0x1b7ec2),Promise['resolve']();{const _0x77dcb=await _0x57ac91['text']();return _0x77dcb['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x4e5652,'AI_ERROR_CONTEXT_LENGTH'))):_0x77dcb['includes']('Moderation')?Promise['reject'](new R(i(_0x4e5652,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x77dcb));}}async['prepareMessages'](_0x4d2029,_0x345b1d,_0x5e432e){let _0x525575,_0x127fe3;return _0x345b1d?(_0x525575='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.',_0x127fe3='Instruction:\x0a'+_0x4d2029+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x345b1d):(_0x525575='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.',_0x127fe3=_0x4d2029),[{'role':'system','content':_0x525575},{'role':'user','content':_0x127fe3}];}async['_readStreamableResponse'](_0x43fabc,_0x5a52c1){const _0x1d430d=_0x43fabc['body']['getReader'](),_0x2e9e8=new TextDecoder();let _0x508eb6='',_0xe99b1='',_0x56fa2c='',_0x18dcbd=!0x1;for(;!_0x18dcbd;){const {done:_0x375458,value:_0x2e9f14}=await _0x1d430d['read'](),_0x393cbe=_0x508eb6+_0x2e9e8['decode'](_0x2e9f14);let _0x65c289='';_0x18dcbd=_0x375458;try{_0x65c289=this['_cleanUpData'](_0x393cbe),_0x508eb6='';}catch{_0x508eb6=_0x393cbe;continue;}_0xe99b1+=_0x65c289,!_0x18dcbd&&this['_isBufferIncomplete'](_0xe99b1)||_0xe99b1&&(_0x56fa2c+=_0xe99b1,_0xe99b1='',_0x5a52c1(_0x56fa2c));}return Promise['resolve']();}async['_readStaticResponse'](_0x37a7c2,_0x338095){return _0x338095((await _0x37a7c2['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x25710c){const _0x18ed95=_0x25710c['split']('<')['length']!==_0x25710c['split']('>')['length'],_0x12d204=_0x25710c['length']<0x1e;return _0x18ed95&&_0x12d204;}['_cleanUpData'](_0x542111){return _0x542111['split'](/\n(?![^{]*\})/g)['map'](_0x21ffdf=>_0x21ffdf['replace']('data:\x20',''))['filter'](_0x35514e=>_0x35514e&&_0x35514e['length']>0x0&&'[DONE]'!==_0x35514e)['map'](_0x3beb40=>{const {choices:_0xbd3a8a}=JSON['parse'](_0x3beb40);if(_0xbd3a8a[0x0]?.['delta']?.['content'])return _0xbd3a8a[0x0]['delta']['content'];})['filter'](_0x43651d=>_0x43651d)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x5a166f){super(_0x5a166f),_0x5a166f['config']['get']('ai.aws.requestParameters')||_0x5a166f['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']=_0x5a166f['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x5a166f['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x5a166f['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x5a166f['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x29d7fa,context:_0x1bbb61,onData:_0x11d89b,actionId:_0x1ede9c}){const {model:_0x2edbc3,stream:_0xd2df99,..._0x34f9c5}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1ede9c),_0x47610d={'prompt':await this['preparePrompt'](_0x29d7fa,_0x1bbb61,_0x2edbc3,_0x1ede9c),..._0x34f9c5};this['_apiUrl']?await this['_processProxyRequest'](_0x47610d,_0x2edbc3,_0xd2df99,_0x11d89b,_0x1ede9c):await this['_processAWSRequest'](_0x47610d,_0x2edbc3,_0xd2df99,_0x11d89b);}async['preparePrompt'](_0x73e65,_0x248c45,_0xb89f0,_0x1f53e6){let _0x3ecafc,_0x8877d;return _0x248c45?(_0x3ecafc='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.',_0x8877d='Instruction:\x0a'+_0x73e65+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x248c45):(_0x3ecafc='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.',_0x8877d=_0x73e65),'meta.llama'==this['getModelFamily'](_0xb89f0)?'<<SYS>>\x0a'+_0x3ecafc+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x8877d+'\x0a[/INST]':'Human:\x0a'+_0x3ecafc+'\x0a'+_0x8877d+'\x0a\x0aAssistant:';}['getModelFamily'](_0x561492){if(/^anthropic\.claude/['test'](_0x561492))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x561492))return'ai21.j2';if(/^cohere\.command/['test'](_0x561492))return'cohere.command';if(/^meta\.llama/['test'](_0x561492))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x561492));}async['_processProxyRequest'](_0x563046,_0x52a7f9,_0x5c88f2,_0x1b636d,_0x280acc){const _0x549d68={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x280acc),'body':JSON['stringify']({..._0x563046,'model':_0x52a7f9,'stream':_0x5c88f2}),'signal':this['abortController']['signal']},_0x33c90a=await fetch(this['_apiUrl'],_0x549d68);_0x5c88f2?await this['_readStreamableResponse'](_0x33c90a,_0x52a7f9,_0x1b636d):await this['_readStaticResponse'](_0x33c90a,_0x52a7f9,_0x1b636d);}async['_processAWSRequest'](_0x4b33bd,_0x536b6f,_0xddb77c,_0x4326c4){const _0x56ecf8=new _0x261cf3(this['_bedrockClientConfig']),_0x4bf9c1={'body':JSON['stringify'](_0x4b33bd),'contentType':'application/json','accept':'application/json','modelId':_0x536b6f};let _0x482542;if(_0xddb77c){const _0x4ca438=new _0x3a8fdc(_0x4bf9c1);_0x482542=await _0x56ecf8['send'](_0x4ca438,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x482542,_0x536b6f,_0x4326c4);}else{const _0xff13=new _0x343b6e(_0x4bf9c1);_0x482542=await _0x56ecf8['send'](_0xff13,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x482542,_0x536b6f,_0x4326c4);}}async['_readAsyncIterableResponse'](_0x354cc5,_0x504346,_0x2f59bf){const _0x31bc90=_0x354cc5['body'],_0x48461d=new TextDecoder('utf-8');let _0x335025='';for await(const _0x334f94 of _0x31bc90)if(_0x334f94['chunk']){const _0x23f09c=_0x48461d['decode'](_0x334f94['chunk']['bytes']),_0x26fa3c=JSON['parse'](_0x23f09c);_0x335025+=this['_getGeneratedText'](_0x26fa3c,_0x504346),_0x2f59bf(_0x335025);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4a6b9b,_0x1553ee,_0x1a6c86){const _0x2ed237=_0x4a6b9b['body'],_0x5e5832=new TextDecoder('utf-8'),_0x5b9363=_0x2ed237['getReader']();let _0x431aed='',_0x4ec806='',_0x44cb49=!0x1;for(;!_0x44cb49;){const {done:_0x3d93d4,value:_0x3c3375}=await _0x5b9363['read']();if(_0x44cb49=_0x3d93d4,_0x44cb49)break;const _0x394cbb=(_0x431aed+_0x5e5832['decode'](_0x3c3375))['split']('\x0a')['map'](_0x4c1b94=>{try{return _0x431aed='',JSON['parse'](_0x4c1b94);}catch{return _0x431aed=_0x4c1b94,null;}})['filter'](_0xc1c837=>null!==_0xc1c837);_0x394cbb['length']&&(_0x4ec806+=_0x394cbb['map'](_0x322687=>this['_getGeneratedText'](_0x322687,_0x1553ee))['join'](''),_0x1a6c86(_0x4ec806));}return Promise['resolve']();}async['_readStaticResponse'](_0x1223b5,_0x2f6dfe,_0x2bad61){let _0x473d7b;return _0x473d7b=_0x1223b5 instanceof Response?await _0x1223b5['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x1223b5['body'])),(_0x2bad61(this['_getGeneratedText'](_0x473d7b,_0x2f6dfe)),Promise['resolve']());}['_getGeneratedText'](_0x46fa8f,_0x5d36d7){switch(this['getModelFamily'](_0x5d36d7)){case'anthropic.claude':return _0x46fa8f['completion'];case'ai21.j2':return _0x46fa8f['completions'][0x0]['data']['text'];case'cohere.command':return _0x46fa8f['generations'][0x0]['text'];case'meta.llama':return _0x46fa8f['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':_0x1b1360=>0x1!=_0x1b1360}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x21327b=>{const {af:{dictionary:_0x37bea4,getPluralForm:_0x1478f6}}={'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':_0x54e32b=>0x1!=_0x54e32b}};_0x21327b['af']||={'dictionary':{},'getPluralForm':null},_0x21327b['af']['dictionary']=Object['assign'](_0x21327b['af']['dictionary'],_0x37bea4),_0x21327b['af']['getPluralForm']=_0x1478f6;})(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':_0x210295=>0x0==_0x210295?0x0:0x1==_0x210295?0x1:0x2==_0x210295?0x2:_0x210295%0x64>=0x3&&_0x210295%0x64<=0xa?0x3:_0x210295%0x64>=0xb?0x4:0x5}};
|