@ckeditor/ckeditor5-ai 45.2.0-alpha.2 → 45.2.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ai.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +9 -9
- package/src/aiassistantediting.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x2ff2b4,Command as _0x24897b}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x49ca06,IconCheck as _0x2201d3,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x3fe608,IconRobotPencil as _0x2e8dc7}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x185018,CKEditorError as _0x286c33,ObservableMixin as _0x5b9ccd,global as _0x2dd121,isVisible as ot,Rect as it,Collection as _0x184f2a,FocusTracker as mt,KeystrokeHandler as ut,first as _0x19c61a}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x445947,View as _0x219631,SpinnerView as _0x4e1106,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x1df39b,createDropdown as _0x5dcd82,addMenuToDropdown as _0x2a483d,MenuBarMenuView as _0x1c02be,MenuBarMenuListItemButtonView as _0x2d66ee,DialogViewPosition as _0x4d9161,MenuBarMenuListView as _0x1aca70,MenuBarMenuListItemView as _0x275a7d}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0xe27caf,ClipboardMarkersUtils as _0x4d799e}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x41600e,DataTransfer as _0xcf33dd,UpcastWriter as _0x19895c,Matcher as _0x24290c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x814e00,InvokeModelWithResponseStreamCommand as _0x266f1d,InvokeModelCommand as _0x139fab}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x37ed7b,_0x1a7bbf){const _0x205941=(0x0,_0x1a7bbf['t'])('Other');return _0x37ed7b['length']?'groupId'in _0x37ed7b[0x0]?_0x37ed7b:[{'groupId':x,'groupLabel':_0x205941,'order':0x1/0x0,'commands':_0x37ed7b}]:[{'groupId':x,'groupLabel':_0x205941,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x2ff2b4{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x4b4140}=this,_0x54ab3f=['ck-fake-ai-selection'];_0x4b4140['config']['get']('ai.useTheme')&&_0x54ab3f['push']('ck-ai-assistant-ui_theme'),_0x4b4140['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x54ab3f,'priority':0xc}}),_0x4b4140['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0xeb193c,{writer:_0x7a87a})=>{if(!_0xeb193c['markerRange']['isCollapsed'])return null;const _0x42a9a2=_0x7a87a['createUIElement']('span');return _0x7a87a['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x42a9a2),_0x42a9a2;}});}['afterInit'](){!async function(_0xacd5a2){const _0x2eacc3=_0x35ec1c([0x71,0x32,0x35,0x73,0x34,0x61,0x6c,0x63,0x56,0x57,0x47,0x48,0x42,0x77,0x31,0x4a,0x52,0x70,0x55,0x33,0x41,0x49,0x4d,0x39,0x67,0x59,0x4c,0x6b,0x58,0x69,0x74,0x54,0x6d,0x46,0x4e,0x38,0x51,0x79,0x43,0x6f,0x7a,0x78,0x6e,0x50,0x36,0x66,0x68,0x64,0x44,0x5a,0x75,0x4b,0x37,0x30,0x76,0x45,0x72,0x4f,0x53,0x65,0x6a,0x62]),_0x5bd154=0x63c279b2,_0x26d1fb=0x63c510e2^_0x5bd154,_0x320857=window[_0x35ec1c([0x44,0x61,0x74,0x65])][_0x35ec1c([0x6e,0x6f,0x77])](),_0x2d630b=_0xacd5a2[_0x35ec1c([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x317c09=new window[(_0x35ec1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x15b388=>{_0x2d630b[_0x35ec1c([0x6f,0x6e,0x63,0x65])](_0x35ec1c([0x72,0x65,0x61,0x64,0x79]),_0x15b388);}),_0x44d858={[_0x35ec1c([0x6b,0x74,0x79])]:_0x35ec1c([0x45,0x43]),[_0x35ec1c([0x75,0x73,0x65])]:_0x35ec1c([0x73,0x69,0x67]),[_0x35ec1c([0x63,0x72,0x76])]:_0x35ec1c([0x50,0x2d,0x32,0x35,0x36]),[_0x35ec1c([0x78])]:_0x35ec1c([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]),[_0x35ec1c([0x79])]:_0x35ec1c([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]),[_0x35ec1c([0x61,0x6c,0x67])]:_0x35ec1c([0x45,0x53,0x32,0x35,0x36])},_0x2e3a9e=_0x2d630b[_0x35ec1c([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x35ec1c([0x67,0x65,0x74])](_0x35ec1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x52c5f8(){let _0x496e6c,_0x29406e=null,_0x383d2b=null;try{if(_0x2e3a9e==_0x35ec1c([0x47,0x50,0x4c]))return _0x35ec1c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x496e6c=_0x127ba5(),!_0x496e6c)return _0x35ec1c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x496e6c[_0x35ec1c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x383d2b=_0x45d760(_0x496e6c[_0x35ec1c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x496e6c[_0x35ec1c([0x6a,0x74,0x69])])),await _0x27a911()?_0x23cf8e()?_0x332640()?_0x35ec1c([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4c6482()?(_0x496e6c[_0x35ec1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x35ec1c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x29406e=_0x515d13(_0x35ec1c([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x496e6c[_0x35ec1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x35ec1c([0x74,0x72,0x69,0x61,0x6c])&&(_0x29406e=_0x515d13(_0x35ec1c([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x47c379()):_0x35ec1c([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x35ec1c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x35ec1c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x35ec1c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x332640(){const _0x194e62=[_0x35ec1c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x35ec1c([0x74,0x72,0x69,0x61,0x6c])][_0x35ec1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x496e6c[_0x35ec1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x320857/0x3e8:0xe10*_0x26d1fb;return _0x496e6c[_0x35ec1c([0x65,0x78,0x70])]<_0x194e62;}function _0x23cf8e(){const _0x7a39c6=_0x496e6c[_0x35ec1c([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x7a39c6&&(!!_0x7a39c6[_0x35ec1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x35ec1c([0x2a]))||!!_0x7a39c6[_0x35ec1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x35ec1c([0x41,0x49])));}function _0x4c6482(){const _0x472aed=_0x496e6c[_0x35ec1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x472aed||0x0==_0x472aed[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x572fbb}=new URL(window[_0x35ec1c([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x472aed[_0x35ec1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x572fbb))return!0x0;const _0x431eff=_0x572fbb[_0x35ec1c([0x73,0x70,0x6c,0x69,0x74])](_0x35ec1c([0x2e]));return _0x472aed[_0x35ec1c([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3f3f4b=>_0x3f3f4b[_0x35ec1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x35ec1c([0x2a])))[_0x35ec1c([0x6d,0x61,0x70])](_0x3a9fd5=>_0x3a9fd5[_0x35ec1c([0x73,0x70,0x6c,0x69,0x74])](_0x35ec1c([0x2e])))[_0x35ec1c([0x73,0x6f,0x6d,0x65])](_0x2885ca=>_0x431eff[_0x35ec1c([0x65,0x76,0x65,0x72,0x79])]((_0x567471,_0x3ef2b)=>_0x2885ca[_0x3ef2b]===_0x567471||_0x2885ca[_0x3ef2b]===_0x35ec1c([0x2a])));}function _0x47c379(){return _0x29406e&&_0x383d2b?new window[(_0x35ec1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3ebe21,_0x264979)=>{_0x29406e[_0x35ec1c([0x74,0x68,0x65,0x6e])](_0x3ebe21,_0x264979),_0x383d2b[_0x35ec1c([0x74,0x68,0x65,0x6e])](_0x5cab33=>{_0x5cab33!=_0x35ec1c([0x56,0x61,0x6c,0x69,0x64])&&_0x3ebe21(_0x5cab33);},_0x264979);}):_0x29406e||_0x383d2b||_0x35ec1c([0x56,0x61,0x6c,0x69,0x64]);}}function _0x45d760(_0x3f5065,_0x1086de){return new window[(_0x35ec1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5b224a=>{if(_0x106457())return _0x5b224a(_0x35ec1c([0x56,0x61,0x6c,0x69,0x64]));_0x3f8a17(),_0x2d630b[_0x35ec1c([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x35ec1c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x31f4f5=!0x1;const _0x9e952f=_0x185018();function _0x299343(_0x17408e){return!!_0x17408e&&(typeof _0x17408e===_0x35ec1c([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x17408e===_0x35ec1c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x17408e[_0x35ec1c([0x74,0x68,0x65,0x6e])]===_0x35ec1c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x17408e[_0x35ec1c([0x63,0x61,0x74,0x63,0x68])]===_0x35ec1c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x436e8e(_0x5aa9a5){_0x368c5e(_0x5aa9a5)[_0x35ec1c([0x74,0x68,0x65,0x6e])](_0x39df2b=>{if(!_0x39df2b||_0x39df2b[_0x35ec1c([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x35ec1c([0x6f,0x6b]))return _0x35ec1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5d9026(_0x3c4f46(_0x9e952f+_0x1086de))!=_0x39df2b[_0x35ec1c([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x35ec1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x35ec1c([0x56,0x61,0x6c,0x69,0x64]);})[_0x35ec1c([0x74,0x68,0x65,0x6e])](_0x1b730d=>(_0x28f10b(),_0x1b730d),()=>{const _0x5cf80b=_0x11baf4();return null==_0x5cf80b?(_0x28f10b(),_0x35ec1c([0x56,0x61,0x6c,0x69,0x64])):_0x35ec1c(_0x320857-_0x5cf80b>(0x47cefdb2^_0x5bd154)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x35ec1c([0x74,0x68,0x65,0x6e])](_0x5b224a)[_0x35ec1c([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5b224a(_0x35ec1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xfa8f2=0x63f49732^_0x5bd154;function _0x28f10b(){const _0x446ed7=_0x35ec1c([0x6c,0x6c,0x63,0x74,0x2d])+_0x5d9026(_0x3c4f46(_0x3f5065)),_0x1a6280=_0x45df50(_0x5d9026(window[_0x35ec1c([0x4d,0x61,0x74,0x68])][_0x35ec1c([0x63,0x65,0x69,0x6c])](_0x320857/_0xfa8f2)));window[_0x35ec1c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x35ec1c([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x446ed7,_0x1a6280);}function _0x11baf4(){const _0x386fb9=_0x35ec1c([0x6c,0x6c,0x63,0x74,0x2d])+_0x5d9026(_0x3c4f46(_0x3f5065)),_0x495a5c=window[_0x35ec1c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x35ec1c([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x386fb9);return _0x495a5c?window[_0x35ec1c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x45df50(_0x495a5c),0x10)*_0xfa8f2:null;}function _0x368c5e(_0x3b75b1){return new window[(_0x35ec1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1946f9,_0x5b9209)=>{_0x3b75b1[_0x35ec1c([0x74,0x68,0x65,0x6e])](_0x1946f9,_0x5b9209),window[_0x35ec1c([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x5b9209,0x63c3ad72^_0x5bd154);});}}_0x2d630b[_0x35ec1c([0x6f,0x6e])](_0x35ec1c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x7309b4,_0x15c226)=>{if(_0x15c226[0x0]!=_0x3f5065)return _0x5b224a(_0x35ec1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x15c226[0x1]={..._0x15c226[0x1],[_0x35ec1c([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x9e952f};},{[_0x35ec1c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x35ec1c([0x68,0x69,0x67,0x68])}),_0x2d630b[_0x35ec1c([0x6f,0x6e])](_0x35ec1c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x258c17=>{_0x299343(_0x258c17[_0x35ec1c([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x31f4f5=!0x0,_0x436e8e(_0x258c17[_0x35ec1c([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x35ec1c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x35ec1c([0x6c,0x6f,0x77])}),_0x317c09[_0x35ec1c([0x74,0x68,0x65,0x6e])](()=>{_0x31f4f5||_0x5b224a(_0x35ec1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x106457(){return _0x2d630b[_0x35ec1c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x35ec1c([0x76,0x69,0x65,0x77])][_0x35ec1c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x35ec1c([0x61,0x75,0x74,0x6f]);}function _0x3f8a17(){_0x2d630b[_0x35ec1c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x35ec1c([0x76,0x69,0x65,0x77])][_0x35ec1c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x35ec1c([0x61,0x75,0x74,0x6f]);}}function _0x515d13(_0x1fe672){const _0x5af3fe=[new window[(_0x35ec1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x43a54b=>setTimeout(_0x43a54b,0x63cb477e^_0x5bd154)),_0x317c09[_0x35ec1c([0x74,0x68,0x65,0x6e])](()=>new window[(_0x35ec1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1f1f5f=>{let _0x333d7d=0x0;_0x2d630b[_0x35ec1c([0x6d,0x6f,0x64,0x65,0x6c])][_0x35ec1c([0x6f,0x6e])](_0x35ec1c([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xd83cfd,_0x3b5c54)=>{_0x3b5c54[0x0][_0x35ec1c([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x333d7d++,_0x333d7d==(0x63c2784a^_0x5bd154)&&(_0x1f1f5f(),_0xd83cfd[_0x35ec1c([0x6f,0x66,0x66])]());});}))];return window[_0x35ec1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x35ec1c([0x72,0x61,0x63,0x65])](_0x5af3fe)[_0x35ec1c([0x74,0x68,0x65,0x6e])](()=>_0x1fe672);}async function _0x4167fe(){await _0x317c09,_0x2d630b[_0x35ec1c([0x6d,0x6f,0x64,0x65,0x6c])][_0x35ec1c([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x4003f8,_0x2d630b[_0x35ec1c([0x6d,0x6f,0x64,0x65,0x6c])][_0x35ec1c([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x4003f8,_0x2d630b[_0x35ec1c([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x35ec1c([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5b8ec8(_0x32c769){const _0x2eba33=_0x4d4a8e();_0x2d630b[_0x2eba33]=_0x35ec1c([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x32c769,_0x32c769!=_0x35ec1c([0x56,0x61,0x6c,0x69,0x64])&&_0x4167fe();}function _0x4d4a8e(){const _0x326d87=window[_0x35ec1c([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x35ec1c([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x35ec1c([0x6e,0x6f,0x77])]())[_0x35ec1c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x35ec1c([0x2e]),'');let _0x54f473=_0x35ec1c([0x71]);for(let _0x3542fd=0x0;_0x3542fd<_0x326d87[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3542fd+=0x2){let _0x5f0a56=window[_0x35ec1c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x326d87[_0x35ec1c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3542fd,_0x3542fd+0x2));_0x5f0a56>=_0x2eacc3[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5f0a56-=_0x2eacc3[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x54f473+=_0x2eacc3[_0x5f0a56];}return _0x54f473;}function _0x127ba5(){const _0x52fce7=_0x2e3a9e[_0x35ec1c([0x73,0x70,0x6c,0x69,0x74])](_0x35ec1c([0x2e]));if(0x3!=_0x52fce7[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x20c70d(_0x52fce7[0x1]);function _0x20c70d(_0x9fe1dd){const _0x45e0d1=_0x11665e(_0x9fe1dd);return _0x45e0d1&&_0x35de6d()?_0x45e0d1:null;function _0x35de6d(){const _0x1cf750=_0x45e0d1[_0x35ec1c([0x6a,0x74,0x69])],_0x1a574e=window[_0x35ec1c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1cf750[_0x35ec1c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1cf750[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x41ba84={..._0x45e0d1,[_0x35ec1c([0x6a,0x74,0x69])]:_0x1cf750[_0x35ec1c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x1cf750[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x41ba84[_0x35ec1c([0x76,0x63])],_0x3c4f46(_0x41ba84)==_0x1a574e;}}}async function _0x27a911(){let _0x4be8a7=!0x0;try{const _0xcbe529=_0x2e3a9e[_0x35ec1c([0x73,0x70,0x6c,0x69,0x74])](_0x35ec1c([0x2e])),[_0x16010d,_0x29bc88,_0x3f781d]=_0xcbe529;return _0x4b4148(_0x16010d),await _0xf85650(_0x16010d,_0x29bc88,_0x3f781d),_0x4be8a7;}catch{return!0x1;}function _0x4b4148(_0x3c80b1){const _0x1776f7=_0x11665e(_0x3c80b1);_0x1776f7&&_0x1776f7[_0x35ec1c([0x61,0x6c,0x67])]==_0x35ec1c([0x45,0x53,0x32,0x35,0x36])||(_0x4be8a7=!0x1);}async function _0xf85650(_0x291a80,_0x380445,_0x393ed7){const _0x58dafd=window[_0x35ec1c([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x35ec1c([0x66,0x72,0x6f,0x6d])](_0x3d7185(_0x393ed7),_0x1b3479=>_0x1b3479[_0x35ec1c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4e4281=new window[(_0x35ec1c([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x35ec1c([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x291a80+_0x35ec1c([0x2e])+_0x380445),_0x410075=window[_0x35ec1c([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x35ec1c([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x410075)return;const _0xb82ad5=await _0x410075[_0x35ec1c([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x35ec1c([0x6a,0x77,0x6b]),_0x44d858,{[_0x35ec1c([0x6e,0x61,0x6d,0x65])]:_0x35ec1c([0x45,0x43,0x44,0x53,0x41]),[_0x35ec1c([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x35ec1c([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x35ec1c([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x410075[_0x35ec1c([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x35ec1c([0x6e,0x61,0x6d,0x65])]:_0x35ec1c([0x45,0x43,0x44,0x53,0x41]),[_0x35ec1c([0x68,0x61,0x73,0x68])]:{[_0x35ec1c([0x6e,0x61,0x6d,0x65])]:_0x35ec1c([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0xb82ad5,_0x58dafd,_0x4e4281)||(_0x4be8a7=!0x1);}}function _0x11665e(_0x57559d){return _0x57559d[_0x35ec1c([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x35ec1c([0x65,0x79]))?JSON[_0x35ec1c([0x70,0x61,0x72,0x73,0x65])](_0x3d7185(_0x57559d)):null;}function _0x3d7185(_0x1e6da7){return window[_0x35ec1c([0x61,0x74,0x6f,0x62])](_0x1e6da7[_0x35ec1c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x35ec1c([0x2b]))[_0x35ec1c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x35ec1c([0x2f])));}function _0x3c4f46(_0x5d4182){let _0x5c1b0b=0x1505;function _0x362ab8(_0x16e1cf){for(let _0x296f6c=0x0;_0x296f6c<_0x16e1cf[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x296f6c++){const _0x12c5d4=_0x16e1cf[_0x35ec1c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x296f6c);_0x5c1b0b=(_0x5c1b0b<<0x5)+_0x5c1b0b+_0x12c5d4,_0x5c1b0b&=_0x5c1b0b;}}function _0x38d505(_0x4d8819){Array[_0x35ec1c([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x4d8819)?_0x4d8819[_0x35ec1c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x38d505):_0x4d8819&&typeof _0x4d8819==_0x35ec1c([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x35ec1c([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x4d8819)[_0x35ec1c([0x73,0x6f,0x72,0x74])]()[_0x35ec1c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x338500,_0x117c32])=>{_0x362ab8(_0x338500),_0x38d505(_0x117c32);}):_0x362ab8(window[_0x35ec1c([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x4d8819));}return _0x38d505(_0x5d4182),_0x5c1b0b>>>0x0;}function _0x5d9026(_0x297484){return _0x297484[_0x35ec1c([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x35ec1c([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x35ec1c([0x30]));}function _0x45df50(_0x43df39){return _0x43df39[_0x35ec1c([0x73,0x70,0x6c,0x69,0x74])]('')[_0x35ec1c([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x35ec1c([0x6a,0x6f,0x69,0x6e])]('');}function _0x4003f8(){}function _0x35ec1c(_0x2e2f8e){return _0x2e2f8e['map'](_0x1cf48b=>String['fromCharCode'](_0x1cf48b))['join']('');}_0x5b8ec8(await _0x52c5f8());}(this);}['showFakeVisualSelection'](){const _0x8965d4=this['editor']['model'];_0x8965d4['change'](_0x104773=>{const _0x52388a=_0x8965d4['document']['selection']['getRanges']();let _0x43c592=0x0;for(const _0x1ade6b of _0x52388a){const _0x491e65=f+':'+_0x43c592;if(_0x8965d4['markers']['has'](_0x491e65))_0x104773['updateMarker'](_0x491e65,{'range':_0x1ade6b});else{if(_0x1ade6b['start']['isAtEnd']){const _0x46e4e9=_0x1ade6b['start']['getLastMatchingPosition'](({item:_0x430376})=>!_0x8965d4['schema']['isContent'](_0x430376),{'boundaries':_0x1ade6b});_0x104773['addMarker'](_0x491e65,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x104773['createRange'](_0x46e4e9,_0x1ade6b['end'])});}else _0x104773['addMarker'](_0x491e65,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1ade6b});}_0x43c592++;}});}['hideFakeVisualSelection'](){const _0x94b33f=this['editor']['model'],_0x5f19b3=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x5f19b3['length']&&_0x94b33f['change'](_0x174000=>{_0x5f19b3['forEach'](_0x405a03=>{_0x174000['removeMarker'](_0x405a03);});});}['insertContent'](_0x155168,_0x236481){const _0x46d655=this['_getAISelection'](),_0x599b8b=_0x236481||_0x46d655['getFirstRange']();this['editor']['model']['canEditAt'](_0x599b8b)&&this['editor']['model']['change'](_0x2a042c=>{this['hideFakeVisualSelection'](),_0x236481||this['_resetContentOfSelectedTableCells'](_0x2a042c,_0x46d655),this['_pasteHTMLUsingClipboard']({'insertAt':_0x599b8b,'writer':_0x2a042c,'html':_0x155168});});}['insertContentBelow'](_0x35eeaa){const {model:_0x45adee}=this['editor'],_0xe258f0=this['_getAISelection']();_0x45adee['change'](()=>{const _0x29c952=this['_prepareTableInsertBelowPosition'](_0x35eeaa,_0xe258f0)||this['_getDefaultInsertBelowPosition'](_0xe258f0);this['insertContent'](_0x35eeaa,_0x29c952);});}['_getAISelection'](){const _0x5974d9=this['editor']['model'],_0x26fc5e=Array['from'](_0x5974d9['markers']['getMarkersGroup'](f))['map'](_0x40c109=>_0x40c109['getRange']());return _0x5974d9['createSelection'](_0x26fc5e);}['_pasteHTMLUsingClipboard']({writer:_0x401dc6,html:_0x3b34c3,insertAt:_0x160ad6}){const {view:_0x4eb331}=this['editor']['editing'],_0x4a438b=this['editor']['plugins']['get'](_0xe27caf),_0xe07489=new gt();_0xe07489['setData']('text/html',_0x3b34c3);const _0x1d30c1=new ClipboardEvent('paste',{'clipboardData':_0xe07489}),_0x373c47=new _0x41600e(_0x4eb331,_0x1d30c1,{'dataTransfer':new _0xcf33dd(_0xe07489)});_0x401dc6['setSelection'](_0x160ad6);const _0x3ec5aa=(_0x3866db,_0x40e91b)=>{_0x40e91b['resultRange']&&_0x401dc6['setSelection'](_0x40e91b['resultRange']);};_0x4a438b['once']('contentInsertion',_0x3ec5aa,{'priority':'lowest'}),_0x4eb331['document']['fire']('paste',_0x373c47),_0x4a438b['off']('contentInsertion',_0x3ec5aa);}['_getDefaultInsertBelowPosition'](_0x528fdf){const {model:_0x6f3eec}=this['editor'],_0x3cc4b3=Array['from'](_0x528fdf['getSelectedBlocks']());return _0x3cc4b3['length']?_0x6f3eec['createPositionAfter'](_0x3cc4b3['pop']()):_0x528fdf['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x23cf6e,_0x126107){const {model:_0xb42880,plugins:_0x53f1b0}=this['editor'];if(_0x53f1b0['has']('TableUtils')){const _0x276d44=_0x53f1b0['get']('TableUtils')['getSelectedTableCells'](_0x126107);if(_0x276d44['length']){const _0x249dcc=this['_getTableRowCountFromContent'](_0x23cf6e),_0x971cb8=this['_createEmptyTableRows'](_0x276d44,_0x249dcc);return _0xb42880['createPositionAt'](_0x971cb8,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1261c8){const _0x136de3=this['editor']['plugins']['get']('TableUtils'),_0x44e6ab=this['editor']['data']['parse'](_0x1261c8),_0x4fb0d0=Array['from'](_0x44e6ab['getChildren']())['filter'](_0x3ab77d=>_0x3ab77d['is']('element','table'));let _0x4450f0=0x0;return _0x4fb0d0['forEach'](_0x156a80=>{_0x4450f0+=_0x136de3['getRows'](_0x156a80);}),_0x4450f0;}['_createEmptyTableRows'](_0x517e41,_0x3c4a89){const _0x5d3cfa=this['editor']['plugins']['get']('TableUtils'),_0x28523b=_0x5d3cfa['getRowIndexes'](_0x517e41),_0xf0af16=_0x5d3cfa['getColumnIndexes'](_0x517e41),_0x320e9f=_0x28523b['last']+0x1,_0x5970f9=_0xf0af16['first'],_0x245220=_0x517e41[0x0]['findAncestor']('table');for(let _0x500581=0x0;_0x500581<_0x3c4a89;_0x500581++)_0x5d3cfa['insertRows'](_0x245220,{'at':_0x320e9f});return _0x245220['getChild'](_0x320e9f)['getChild'](_0x5970f9);}['_resetContentOfSelectedTableCells'](_0x202da5,_0x1f0042){const {plugins:_0x211786}=this['editor'],{model:_0x1890ff}=_0x202da5;if(!_0x211786['has']('TableUtils'))return;_0x211786['get']('TableUtils')['getSelectedTableCells'](_0x1f0042)['length']&&_0x1890ff['deleteContent'](_0x1f0042);}}class E extends _0x2ff2b4{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x286c33('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x4068e0){super(_0x4068e0),this['name']='AIRequestError';}}function i(_0x1c7386,_0x2080e5,_0x5693ec){const t=_0x1c7386['t'];switch(_0x2080e5){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',_0x5693ec);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5693ec);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'},_0x5693ec);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 _0x2080e5;}}class j extends _0x24897b{['_commandDefinitions'];constructor(_0x497467,_0xcff9c1){super(_0x497467),this['_commandDefinitions']=_0xcff9c1,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x2f9eaf,_0x10ff29,_0x2f15d6)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x2f15d6));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x556c1c,_0x5517d0,_0x524014)=>{this['enabledCommandsIds']=_0x524014?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x22b1a6=this['editor']['model'];this['_hasContext']=function(_0x1852aa){const _0x58081d=_0x1852aa['document']['selection'];return _0x58081d['isCollapsed']?0x0!==[..._0x58081d['getSelectedBlocks']()]['length']&&![..._0x58081d['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x1852aa['hasContent'](_0x58081d['getFirstRange']());}(_0x22b1a6);const _0x5c5d4a=_0x22b1a6['document']['selection'],_0x4e0aef=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x4b7f17 of _0x5c5d4a['getRanges']())for(const _0x312640 of _0x4b7f17['getItems']())if(_0x312640['is']('element')&&_0x4e0aef['includes'](_0x312640['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x38a5ea='',_0x8fd17f='',_0x335405='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x38a5ea,_0x8fd17f,_0x335405);}}function G(_0x1e25b8,_0x2191fc){const _0xe4371d=new Set();for(const _0x4659b2 of _0x1e25b8['values']())(_0x2191fc||!0x1===_0x4659b2['requiresContent'])&&_0xe4371d['add'](_0x4659b2['id']);return Array['from'](_0xe4371d);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x5b9ccd(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x332ba2,_0x2788b5,_0x475fed){super(),this['editor']=_0x332ba2,this['textAdapter']=_0x2788b5,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x475fed,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4ca2ac,_0x103187,_0x5e9adf)=>{this['view']['value']=this['_sanitizeHTML'](_0x5e9adf);}),this['listenTo'](this['view'],'submitPrompt',(_0x470c3a,_0x5f22bb)=>{const _0x4d5e5f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x5f22bb,_0x4d5e5f,'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:_0x3acac0,query:_0x518f93,htmlContent:_0x4ca4cf,label:_0xffa62b,mainActionLabel:_0x5600db}){this['view']['prompt']=_0xffa62b,this['view']['mainAction']=_0x5600db,this['initialContext']=_0x4ca4cf,_0x518f93&&(this['view']['isRendered']?this['_handleQuery'](_0x518f93,_0x4ca4cf,_0x3acac0,_0xffa62b):this['view']['once']('render',()=>{this['_handleQuery'](_0x518f93,_0x4ca4cf,_0x3acac0,_0xffa62b);}));}['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'](_0x4d788d,_0x3bf2fe,_0xb4317b,_0x36d77b){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3bf2fe,this['previousQuery']=_0x4d788d,this['previousLabel']=_0x36d77b||_0x4d788d,this['previousActionId']=_0xb4317b,new Promise(_0x55e7af=>{this['textAdapter']['makeRequest']({'query':_0x4d788d,'context':_0x3bf2fe,'onData':_0x23ae38=>{this['currentResponse']=_0x23ae38,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0xb4317b})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x30d098=>{_0x30d098 instanceof R?this['view']['handleError'](_0x30d098['message']):this['view']['handleError'](),_0x55e7af();})['finally'](()=>{this['stopProcessing'](),_0x55e7af();});});}['_parseAndNormalizeContent'](_0x3c06e5,_0x64a257=!0x1){const _0x27563f=Z['exec'](_0x3c06e5);_0x3c06e5=_0x27563f?_0x3c06e5['substring'](_0x27563f[0x1]['length']):_0x3c06e5['length']<0x64&&!_0x64a257?'':this['_stripMarkdownSyntax'](_0x3c06e5);const _0x2bac3b=this['_domParser']['parseFromString'](_0x3c06e5,'text/html');if(_0x27563f){const _0x5837ec=Array['from'](_0x2bac3b['body']['childNodes']);_0x5837ec['reverse']();for(const _0x29402f of _0x5837ec){if(_0x29402f['nodeType']==Node['ELEMENT_NODE'])break;_0x29402f['remove']();}}const _0x1e8497=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2bac3b['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1e8497);const _0x2dc844=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x1eb4f1=this['editor']['data']['toModel'](_0x1e8497);return _0x2dc844||_0x1eb4f1['markers']['clear'](),this['editor']['data']['stringify'](_0x1eb4f1);}['_normalizeResponseHeadings'](_0x3e39ca){const _0x6f746a=new _0x19895c(this['editor']['editing']['view']['document']),_0x3a956c=new _0x24290c({'name':/^h[1-5]$/}),_0x5ee028=[];let _0x5365a6=!0x1;for(const _0x44f171 of _0x3e39ca)_0x44f171['is']('element')&&_0x3a956c['match'](_0x44f171)&&(_0x5ee028['push'](_0x44f171),'h1'==_0x44f171['name']&&(_0x5365a6=!0x0));if(_0x5365a6){for(const _0x46dc36 of _0x5ee028)_0x6f746a['rename']('h'+(parseInt(_0x46dc36['name'][0x1])+0x1),_0x46dc36);}}['_isH1TagSupportEnabled'](){const {data:_0x1f763f,editing:_0x1c3c6d}=this['editor'],_0xaa361e=_0x1f763f['htmlProcessor']['toView']('<h1></h1>'),_0x1cbb3c=_0x1f763f['toView'](_0x1f763f['toModel'](_0xaa361e));return!!_0x1c3c6d['view']['domConverter']['viewToDom'](_0x1cbb3c)['querySelector']('h1');}['_sanitizeHTML'](_0x8b3510){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x8b3510),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x397c6e){const _0x4c10d3=_0x397c6e['trim']();return _0x4c10d3['startsWith']('```html')?_0x4c10d3['endsWith']('```')?_0x4c10d3['substring'](0x7,_0x4c10d3['length']-0x3):_0x4c10d3['substring'](0x7):_0x397c6e;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x14f0d9){super(_0x14f0d9),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x250c88=>i(_0x14f0d9,'AI_'+_0x250c88['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x14f0d9,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x14f0d9,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x14f0d9,'Stop'));const _0x5c3ace=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x5c3ace['if']('isVisible','ck-hidden',_0x2ccd66=>!_0x2ccd66)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x1cd682,_0x231066){const _0x58dd4a=new _0x445947(this['locale']);return _0x58dd4a['set']({'label':_0x1cd682,'class':_0x231066||'','isVisible':!0x0,'withText':!0x0}),_0x58dd4a;}}class Y extends _0x219631{['contentFieldView'];['copyButtonView'];constructor(_0x560d11,_0x48f9bb=''){super(_0x560d11),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x46672d=this['bindTemplate'];this['contentFieldView']=new At(_0x560d11,_0x48f9bb),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x46672d['if']('isVisible','ck-hidden',_0x4de0c9=>!_0x4de0c9)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x46672d['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 _0x27bbbe=!0x1;this['on']('change:value',(_0x355098,_0x55f726,_0x37e8e4)=>{const _0x5bb3e9=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x37e8e4),this['isProcessing']&&_0x5bb3e9&&!_0x27bbbe&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x24266c,_0x2f631d,_0x3b9058)=>{_0x27bbbe=!0x1,_0x3b9058?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x27bbbe=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x27bbbe=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x35a3d2=this['locale'],_0x365381=new _0x445947(this['locale']),_0x3de0ca='ck-ai-form__copy-button';return _0x365381['set']({'label':i(_0x35a3d2,'Copy'),'icon':_0x49ca06,'class':_0x3de0ca,'tooltip':!0x0}),_0x365381['bind']('isVisible')['to'](this,'value',_0x523174=>!!_0x523174),_0x365381['bind']('isEnabled')['to'](this,'isProcessing',_0x4bb6e4=>!_0x4bb6e4),_0x365381['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x365381['icon']=_0x2201d3,_0x365381['class']=_0x3de0ca+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x365381['icon']=_0x49ca06,_0x365381['class']=_0x3de0ca;},0x3e8);}),_0x365381;}['_copyHTMLToClipboard'](_0x367a63){const {window:_0xab4e1a,document:_0x59cab2}=_0x2dd121;if(_0xab4e1a['ClipboardItem']){const {Blob:_0x3331f5,ClipboardItem:_0x1232d0}=_0xab4e1a,_0x3217fa=[new _0x1232d0({'text/html':new _0x3331f5([_0x367a63['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3331f5([_0x367a63['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x3217fa);}else{const _0xd235b3=_0x59cab2['createElement']('div');_0xd235b3['style']['position']='absolute',_0xd235b3['style']['left']='-9999px',_0xd235b3['innerHTML']='<span>[</span>'+_0x367a63['innerHTML']+'<span>]</span>',_0x59cab2['body']['appendChild'](_0xd235b3);const _0x62c4af=_0x59cab2['createRange']();_0x62c4af['setStartAfter'](_0xd235b3['firstElementChild']),_0x62c4af['setEndBefore'](_0xd235b3['lastElementChild']);const _0x7b1ccd=_0xab4e1a['getSelection']();_0x7b1ccd['removeAllRanges'](),_0x7b1ccd['addRange'](_0x62c4af),_0x59cab2['execCommand']('copy'),_0xd235b3['remove']();}}}class At extends _0x219631{constructor(_0x499f03,_0x127a9b=''){super(_0x499f03),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x127a9b,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3cf1c5){this['element']['innerHTML']=_0x3cf1c5;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x455500=new _0x219631(),_0x32fb19=this['locale'],_0x4b7bbc=new _0x4e1106();return _0x4b7bbc['isVisible']=!0x0,_0x455500['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x4b7bbc,{'text':i(_0x32fb19,'AI\x20is\x20writing...')}]}),_0x455500['render'](),_0x455500;}}class st extends _0x219631{constructor(_0x389ff0,_0x4bb9b9=''){super(_0x389ff0);const _0x33fdd4=new rt(),_0x432aaf=this['bindTemplate'];this['set']('text',_0x4bb9b9),_0x33fdd4['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x33fdd4,{'text':_0x432aaf['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x3a489d,_0x35c6e7){super(_0x3a489d,_0x35c6e7),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',(_0xbb72a8,_0x1a2bec)=>{_0xbb72a8['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1a2bec());});}['_createSubmitButton'](){const _0x266af0=new _0x445947(this['locale']),_0x127718=this['locale'];return _0x266af0['set']({'icon':ht,'label':i(_0x127718,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x266af0['on']('execute',()=>{this['submit']();}),_0x266af0['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x196ba4,_0xa7c2fe)=>!_0x196ba4&&_0xa7c2fe),_0x266af0;}['_createShowHistoryButton'](){const _0x3b1d48=new _0x445947(this['locale']),_0xd60b71=this['resultsView'],_0x334d46=this['locale'];_0x3b1d48['set']({'label':i(_0x334d46,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3b1d48['bind']('isOn')['to'](_0xd60b71,'isVisible'),_0x3b1d48['bind']('isEnabled')['to'](this,'isEnabled'),_0x3b1d48['on']('execute',()=>{_0xd60b71['isVisible']=!_0xd60b71['isVisible'],_0xd60b71['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x294cea=()=>{_0x2dd121['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x57bca4=new it(this['queryView']['fieldView']['element']),_0x7ee7ce=_0x57bca4['width'],_0x4dc800='rtl'===_0x334d46['uiLanguageDirection']?'left':'right';_0x57bca4['excludeScrollbarsAndBorders'](),_0x3b1d48['element']['style'][_0x4dc800]=_0x7ee7ce-_0x57bca4['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x294cea),this['on']('render',_0x294cea),_0x3b1d48;}['submit'](){const _0x4a2dce=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4a2dce);}['focus'](_0x3cfc4f){-0x1===_0x3cfc4f?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x188370){super(_0x188370),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x188370,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x779a83=0x0;for(const _0x87f3b0 of this['items'])_0x779a83+=_0x87f3b0['items']['length'];return{'resultsCount':_0x779a83,'totalItemsCount':_0x779a83};}['_createClearHistoryButton'](){const _0x54b42c=this['locale'],_0x3d47d4=new _0x445947(this['locale']);return _0x3d47d4['set']({'label':'('+i(_0x54b42c,'Clear')+')','withText':!0x0}),_0x3d47d4['on']('execute',()=>this['fire']('clearHistory')),_0x3d47d4;}}class bt extends xt{constructor(_0x4e07b1){super();const _0x2a8e7a=new kt(),_0x3cb625=new _0x445947(this['locale'],_0x2a8e7a);this['children']['add'](_0x3cb625),_0x3cb625['set']({'label':_0x4e07b1['prompt'],'withText':!0x0}),_0x3cb625['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x4e07b1['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x184f2a{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1290b8,_0xa0573b)=>{const _0x3bdb08=os(_0xa0573b['prompt']);for(const _0x1eb0ca of this)if(_0x1eb0ca!=_0xa0573b&&os(_0x1eb0ca['prompt'])===_0x3bdb08){this['remove'](_0x1eb0ca);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0xad285e=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0xad285e));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x27c7b2=>_0x27c7b2)));}}function os(_0x3497b1){return _0x3497b1['toLowerCase']()['trim']();}class _ extends _0x219631{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2891f0,_0x1006e4,_0x3d5698=''){super(_0x2891f0),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new wt(),this['errorView']=new st(_0x2891f0),this['contentArea']=new Y(_0x2891f0,_0x3d5698),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 mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'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 _0x458f97=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x1006e4],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x458f97['if']('isError','ck-hidden',_0x3988ff=>!_0x3988ff)]},'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'](_0x8f3d3e=0x1){-0x1===_0x8f3d3e?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 _0x286155=this['locale'],_0x210408=new ct(_0x286155,{'queryView':{'label':i(_0x286155,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x286155,'Empty\x20history'),'secondary':i(_0x286155,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x210408['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x595bb6,_0x3ebe47)=>_0x595bb6&&!_0x3ebe47),this['listenTo'](_0x210408,'submit',(_0x3c9824,_0x2456e4)=>{this['prompt']=_0x2456e4;const _0x30c0e2=yt(_0x2456e4);this['fire']('submitPrompt',_0x30c0e2),_0x2456e4['trim']()&&this['_promptHistory']['add']({'prompt':_0x30c0e2},0x0);},{'priority':'high'}),_0x210408;}['_createHistoryView'](){const _0x5c2f4b=new ft(this['locale']);return _0x5c2f4b['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x5c2f4b['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x5c2f4b;}['_createToolbar'](){const _0xebcad9=new lt(this['locale']);return _0xebcad9['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xdacdff,_0x4353b0,_0x3c5eba)=>_0xdacdff&&!_0x4353b0&&!!_0x3c5eba),_0xebcad9['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0xebcad9['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xd02845,_0x299eaf,_0x5983d9)=>_0xd02845&&!_0x299eaf&&!!_0x5983d9),_0xebcad9['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0xebcad9['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x350258,_0x1e0149)=>_0x350258&&!_0x1e0149),_0xebcad9['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0xebcad9['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0xebcad9['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0xebcad9;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2e970d=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x2e970d,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2f7374){const _0x55be24=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2f7374||i(_0x55be24,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x2ff2b4{['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[_0x4d799e,a,E,_0x1df39b];}constructor(_0x2d4d40){super(_0x2d4d40),_0x2d4d40['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2d4d40['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2d4d40['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2d4d40['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x2ee771}=this;this['_aiAdapter']=_0x2ee771['plugins']['get'](E),this['_dialog']=_0x2ee771['plugins']['get'](_0x1df39b),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0xbf76c0=new j(_0x2ee771,Array['from'](this['_commandDefinitions']['values']()));_0x2ee771['commands']['add']('showAIAssistant',_0xbf76c0),_0x2ee771['ui']['componentFactory']['add']('aiCommands',_0x4e65c9=>{const _0x2759fe=_0x5dcd82(_0x4e65c9);return _0x2759fe['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2759fe['buttonView']['set']({'label':i(_0x4e65c9,'AI\x20Commands'),'icon':_0x3fe608,'tooltip':!0x0}),_0x2759fe['on']('execute',_0x47872c=>this['_onExecute'](_0x47872c['source']['id'])),_0x2a483d(_0x2759fe,_0x2ee771['ui']['view']['body'],function(_0x357f3a){const _0x2fff32=o(_0x357f3a['config']['get']('ai.aiAssistant.commands'),_0x357f3a['locale']),_0x5ee47b=U(_0x357f3a,_0x2fff32)['filter'](_0x3c208e=>_0x3c208e['commands']['length']);if(0x1===_0x5ee47b['length'])return U(_0x357f3a,_0x5ee47b[0x0]['commands'])['map'](_0x3585c7=>({'id':_0x3585c7['id'],'label':_0x3585c7['label']}));return _0x5ee47b['map'](_0x8ac7f0=>{const {groupId:_0x28a4e0,groupLabel:_0x125c22,commands:_0x2e88cd}=_0x8ac7f0,_0x305c66=U(_0x357f3a,_0x2e88cd)['map'](_0x1a55aa=>({'id':_0x1a55aa['id'],'label':_0x1a55aa['label']}));return{'id':_0x28a4e0,'menu':_0x125c22||_0x28a4e0,'children':_0x305c66};});}(_0x2ee771),{'ariaLabel':i(_0x4e65c9,'AI\x20Commands')}),_0x2759fe['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0xbf76c0['on']('change:enabledCommandsIds',_0x1eebd0),_0x2759fe['menuView']['once']('render',_0x1eebd0),_0x2759fe;function _0x1eebd0(){_0x2759fe['isEnabled']=_0xbf76c0['enabledCommandsIds']['length']>0x0;for(const _0x334528 of _0x2759fe['menuView']['buttons'])_0x334528['isEnabled']=_0xbf76c0['enabledCommandsIds']['includes'](_0x334528['id']);}}),_0x2ee771['ui']['componentFactory']['add']('menuBar:aiCommands',_0x172b3b=>{const _0x332c73=new _0x1c02be(_0x172b3b);_0x332c73['buttonView']['set']({'label':i(_0x172b3b,'AI\x20Commands'),'icon':_0x3fe608}),_0x332c73['bind']('isEnabled')['to'](_0xbf76c0,'enabledCommandsIds',_0x13042f=>_0x13042f['length']>0x0);const _0x48a9cf=o(_0x2ee771['config']['get']('ai.aiAssistant.commands'),_0x172b3b);return this['_populateMenuBarMenu'](_0xbf76c0,_0x332c73,_0x48a9cf,_0x1a7f15=>this['_onExecute'](_0x1a7f15)),_0x332c73;}),_0x2ee771['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1c6b49=this['_createAIAssistantUIButton'](_0x445947);return _0x1c6b49['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1c6b49;}),_0x2ee771['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x5c51a9=this['_createAIAssistantUIButton'](_0x2d66ee);return _0x5c51a9['set']({'role':'menuitemcheckbox'}),_0x5c51a9;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5ba2a3=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x30d14b;for(const _0x261e09 in _0x5ba2a3){const _0x59e941=_0x261e09,_0x41ffa1=_0x5ba2a3[_0x59e941];if('aiLicenseKeyValid'==_0x41ffa1||'aiLicenseKeyInvalid'==_0x41ffa1||'aiLicenseKeyExpired'==_0x41ffa1||'aiLicenseKeyDomainLimit'==_0x41ffa1||'aiLicenseKeyNotAllowed'==_0x41ffa1||'aiLicenseKeyEvaluationLimit'==_0x41ffa1||'aiLicenseKeyTrialLimit'==_0x41ffa1||'aiLicenseKeyUsageLimit'==_0x41ffa1){delete _0x5ba2a3[_0x59e941],_0x30d14b=_0x41ffa1,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x30d14b&&_0x5ba2a3['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x30d14b&&_0x5ba2a3['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x30d14b&&_0x5ba2a3['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x30d14b&&_0x5ba2a3['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x30d14b&&_0x5ba2a3['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x30d14b&&_0x5ba2a3['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x30d14b&&_0x5ba2a3['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5f7264='',_0x519d83='',_0x194c47='custom'){const _0xe14440=this['editor'],_0x5413fb=_0xe14440['editing']['view'],_0x839a3=_0xe14440['plugins']['get'](a),_0x5beff1=_0xe14440['plugins']['get'](_0x4d799e);_0x839a3['showFakeVisualSelection']();const _0x21f822=new w(),_0x3af1f0=new ClipboardEvent('copy',{'clipboardData':_0x21f822}),_0x3051c8=new _0xcf33dd(_0x21f822),_0x26253c=new _0x41600e(_0x5413fb,_0x3af1f0,{'dataTransfer':_0x3051c8});_0x5beff1['_forceMarkersCopy']('comment',()=>{_0x5413fb['document']['fire']('copy',_0x26253c);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0xe14440,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4c1ac7=_0x3051c8['getData']('text/html');const _0x19cc8e=_0xe14440['model']['document']['selection'],_0x4263a1=Array['from'](_0x19cc8e['getRanges']());0x1===_0x4263a1['length']&&_0x4263a1[0x0]['isFlat']&&!_0x19cc8e['getSelectedElement']()&&''!==_0x4c1ac7['replace'](/ /g,'')['trim']()&&(_0x4c1ac7='<p>'+_0x4c1ac7+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x194c47,'query':_0x5f7264,'htmlContent':_0x4c1ac7,'label':_0x519d83,'mainActionLabel':M[_0xe14440['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2e8dc7,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x4d9161['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x839a3['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x1c193e=new Map(),_0x240994=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x3c3d89 of _0x240994)for(const _0x35a7ae of _0x3c3d89['commands'])_0x1c193e['set'](_0x35a7ae['id'],{..._0x35a7ae,'groupId':_0x3c3d89['groupId'],'groupLabel':_0x3c3d89['groupLabel']||_0x3c3d89['groupId']});return _0x1c193e;}['_createAIAssistantUIButton'](_0x18ebb1){const _0x354bc1=this['editor'],_0x1a45e1=_0x354bc1['commands']['get']('showAIAssistant'),_0x1ae094=new _0x18ebb1(_0x354bc1['locale']);return _0x1ae094['set']({'label':i(_0x354bc1['locale'],'AI\x20Assistant'),'icon':_0x2e8dc7,'isToggleable':!0x0}),_0x1ae094['bind']('isEnabled')['to'](_0x1a45e1),_0x1ae094['bind']('isOn')['to'](this['_dialog'],'id',_0x54d361=>'aiAssistant'===_0x54d361),this['listenTo'](_0x1ae094,'execute',()=>{_0x1ae094['isOn']?this['hideUI']():_0x1a45e1['execute']();}),_0x1ae094;}['_initView'](){const _0x586c62=this['editor']['plugins']['get'](a);this['_formView']=new _(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',()=>{_0x586c62['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x586c62['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x48ace3,ui:{ariaLiveAnnouncer:_0x58a548}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x410a7c,_0x485357,_0x4b89f4)=>{const _0x29a381=this['_aiAssistantController']['currentContext'];_0x4b89f4?_0x58a548['announce'](i(_0x48ace3,'AI\x20is\x20writing')):_0x29a381&&_0x58a548['announce'](i(_0x48ace3,'Generated\x20content:\x20%0',_0x29a381),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x43cb27,_0x27b25b,_0x483cf5)=>{if(_0x483cf5){const _0x2b4c3f=this['_formView']['errorView']['text'];_0x58a548['announce'](i(_0x48ace3,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2b4c3f));}});}['_onExecute'](_0x3c9c84){const _0x2535f9=this['_commandDefinitions']['get'](_0x3c9c84),_0x37866c=this['editor'],_0x5b5624=_0x37866c['model']['document']['selection'],_0x195c91=_0x37866c['commands']['get']('showAIAssistant'),_0x13492b=_0x37866c['plugins']['get'](a),_0xf9845e=''+(_0x2535f9['groupId']!==x?_0x2535f9['groupLabel']+':\x20':'')+_0x2535f9['label'];if(!0x1!==_0x2535f9['requiresContent']&&_0x5b5624['isCollapsed']){const _0x28c7a6=_0x19c61a(_0x5b5624['getSelectedBlocks']())||_0x37866c['model']['schema']['getLimitElement'](_0x5b5624);_0x37866c['model']['change'](_0x173ee1=>{_0x173ee1['setSelection'](_0x28c7a6,'in');});}_0x13492b['showFakeVisualSelection'](),_0x195c91['execute'](_0x2535f9['prompt'],_0xf9845e,'command:'+_0x3c9c84);}['_populateMenuBarMenu'](_0x47ae76,_0x5f4549,_0x5e32df,_0x1b7ef0){const _0x19be46=this['editor'],_0x406c73=_0x19be46['locale'],_0x487da3=new _0x1aca70(_0x406c73),_0x48dbe2=U(_0x19be46,_0x5e32df)['filter'](_0x229ced=>_0x229ced['commands']['length']);0x1===_0x48dbe2['length']?this['_getMenuBarGroupButtons']({'command':_0x47ae76,'commands':_0x48dbe2[0x0]['commands'],'parentMenuView':_0x5f4549,'onExecute':_0x1b7ef0})['forEach'](_0x1df06a=>_0x487da3['items']['add'](_0x1df06a)):_0x48dbe2['forEach'](({groupId:_0x3a8c68,groupLabel:_0x26210c,commands:_0x31f3c1})=>{const _0x50d2f5=new _0x275a7d(_0x406c73,_0x5f4549),_0x84132a=new _0x1c02be(_0x406c73),_0x537e2f=new _0x1aca70(_0x406c73),_0x42fd7a=this['_getMenuBarGroupButtons']({'command':_0x47ae76,'commands':_0x31f3c1,'parentMenuView':_0x84132a,'onExecute':_0x1b7ef0});_0x84132a['buttonView']['set']({'label':_0x26210c||_0x3a8c68}),_0x84132a['delegate']('execute')['to'](_0x5f4549),_0x537e2f['items']['addMany'](_0x42fd7a),_0x84132a['panelView']['children']['add'](_0x537e2f),_0x50d2f5['children']['add'](_0x84132a),_0x487da3['items']['add'](_0x50d2f5);}),_0x5f4549['panelView']['children']['add'](_0x487da3);}['_getMenuBarGroupButtons']({command:_0x4bb62a,commands:_0x56bff2,parentMenuView:_0x267dbd,onExecute:_0x503ae4}){const _0x586d8b=this['editor'],_0x44f74b=_0x586d8b['locale'];return U(_0x586d8b,_0x56bff2)['map'](_0x5a802b=>{const _0xd0cc81=new _0x275a7d(_0x44f74b,_0x267dbd),_0xfe6a55=new _0x2d66ee(_0x44f74b);return _0xfe6a55['set']({'label':_0x5a802b['label']}),_0xfe6a55['delegate']('execute')['to'](_0x267dbd),_0xfe6a55['on']('execute',()=>_0x503ae4(_0x5a802b['id'])),_0xfe6a55['bind']('isEnabled')['to'](_0x4bb62a,'enabledCommandsIds',_0x411351=>_0x411351['includes'](_0x5a802b['id'])),_0xd0cc81['children']['add'](_0xfe6a55),_0xd0cc81;});}}function B(_0x37df9d,_0x6a8f91){return void 0x0!==_0x37df9d['order']&&void 0x0===_0x6a8f91['order']?0x1:void 0x0===_0x37df9d['order']&&void 0x0!==_0x6a8f91['order']?-0x1:void 0x0!==_0x37df9d['order']&&void 0x0!==_0x6a8f91['order']?_0x37df9d['order']-_0x6a8f91['order']:0x0;}function U(_0x37ba4d,_0x415d69){_0x415d69['sort'](B);const _0x74e70b={},_0x5dfe2c=[];for(const _0x34bb80 of _0x415d69)if(void 0x0!==_0x34bb80['order']){if(_0x34bb80['order']in _0x74e70b)throw new _0x286c33('ai-commands-config-order-collision',_0x37ba4d,{'conflictingDefinitions':[_0x34bb80,_0x74e70b[_0x34bb80['order']]]});_0x74e70b[_0x34bb80['order']]=_0x34bb80,_0x5dfe2c['splice'](_0x34bb80['order'],0x0,_0x34bb80);}else _0x5dfe2c['push'](_0x34bb80);return _0x5dfe2c;}class r extends _0x2ff2b4{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x34d1b1){super(_0x34d1b1);const _0x3482d3=_0x34d1b1['config'],_0x5011cd=_0x34d1b1['locale'];_0x3482d3['define']('ai.aiAssistant.preserveComments',!0x0),_0x3482d3['define']('ai.aiAssistant.commands',function(_0x110010){return[{'groupId':'editOrReview','groupLabel':i(_0x110010,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x110010,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x110010,'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(_0x110010,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x110010,'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(_0x110010,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x110010,'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(_0x110010,'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(_0x110010,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x110010,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x110010,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x110010,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x110010,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x110010,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x110010,'Change\x20style'),'commands':[{'id':'business','label':i(_0x110010,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x110010,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x110010,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x110010,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x110010,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x110010,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x110010,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x110010,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x110010,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x110010,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x110010,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x110010,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x110010,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x5011cd)),_0x3482d3['define']('ai.aiAssistant.extraCommandGroups',[]),_0x3482d3['define']('ai.aiAssistant.removeCommands',[]);let _0x4e7084=o(_0x3482d3['get']('ai.aiAssistant.commands'),_0x5011cd);const _0x541abb=_0x3482d3['get']('ai.aiAssistant.extraCommandGroups'),_0x4b4dbc=_0x3482d3['get']('ai.aiAssistant.removeCommands');_0x541abb['forEach'](_0x573bf9=>{const _0x5b57f1=_0x4e7084['find'](_0x5b177c=>_0x5b177c['groupId']===_0x573bf9['groupId']);_0x5b57f1?_0x5b57f1['commands']=_0x5b57f1['commands']['concat'](_0x573bf9['commands']):_0x4e7084['push'](_0x573bf9);}),_0x4e7084=_0x4e7084['filter'](_0x43e8c3=>!_0x4b4dbc['includes'](_0x43e8c3['groupId'])),_0x4e7084['forEach'](_0x408878=>{_0x408878['commands']=_0x408878['commands']['filter'](_0x1db6b0=>!_0x4b4dbc['includes'](_0x1db6b0['id']));}),_0x3482d3['set']('ai.aiAssistant.commands',_0x4e7084);}}class P extends _0x2ff2b4{['abortController'];static get['requires'](){return[E];}constructor(_0x1ef8be){super(_0x1ef8be),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x2a0d27){return this['sendRequest'](_0x2a0d27)['catch'](_0x18ffca=>{if(_0x18ffca instanceof R)return Promise['reject'](_0x18ffca);if('AbortError'==_0x18ffca['name'])return Promise['resolve']();throw console['error'](_0x18ffca),new _0x286c33('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x5402b7,_0x1f3387){const _0x4d9994=this['editor']['locale'],_0x2a08ac={'Content-Type':'application/json'};if('object'==typeof _0x5402b7)Object['assign'](_0x2a08ac,_0x5402b7);else{if(_0x5402b7)try{const _0x54323a=await _0x5402b7(_0x1f3387);Object['assign'](_0x2a08ac,_0x54323a);}catch{return Promise['reject'](new R(i(_0x4d9994,'AI_ERROR_GET_HEADERS')));}}return _0x2a08ac;}async['_prepareRequestParameters'](_0x31b14b,_0x43805c){const _0x4c7821=this['editor']['locale'];if('object'==typeof _0x31b14b)return _0x31b14b;try{return await _0x31b14b(_0x43805c);}catch{return Promise['reject'](new R(i(_0x4c7821,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x2d0bb9){super(_0x2d0bb9),_0x2d0bb9['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x2d0bb9['config']['get']('ai.openAI.requestParameters')||_0x2d0bb9['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x2d0bb9['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x2d0bb9['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x2d0bb9['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x44a866,context:_0x2a1d8c,onData:_0x23b7de,actionId:_0x3e8613}){const _0x573cfc=this['editor']['locale'],_0x258895=await this['prepareMessages'](_0x44a866,_0x2a1d8c,_0x3e8613),_0x3b47a8=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3e8613),_0x56adf9=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3e8613),_0x1c34ea={'messages':_0x258895,..._0x56adf9},_0x1360da={'method':'POST','headers':_0x3b47a8,'body':JSON['stringify'](_0x1c34ea),'signal':this['abortController']['signal']},_0x232f53=await fetch(this['_apiUrl'],_0x1360da);if(_0x232f53['ok'])return _0x56adf9['stream']?await this['_readStreamableResponse'](_0x232f53,_0x23b7de):await this['_readStaticResponse'](_0x232f53,_0x23b7de),Promise['resolve']();{const _0xf6e796=await _0x232f53['text']();return _0xf6e796['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x573cfc,'AI_ERROR_CONTEXT_LENGTH'))):_0xf6e796['includes']('Moderation')?Promise['reject'](new R(i(_0x573cfc,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0xf6e796));}}async['prepareMessages'](_0x526a46,_0xd05fb8,_0x523e22){let _0x2afd74,_0x3db109;return _0xd05fb8?(_0x2afd74='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.',_0x3db109='Instruction:\x0a'+_0x526a46+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xd05fb8):(_0x2afd74='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.',_0x3db109=_0x526a46),[{'role':'system','content':_0x2afd74},{'role':'user','content':_0x3db109}];}async['_readStreamableResponse'](_0x1b09ac,_0x5c5117){const _0x5c08ce=_0x1b09ac['body']['getReader'](),_0x183817=new TextDecoder();let _0x5173fd='',_0x5ae102='',_0x3f1731='',_0x4a9e18=!0x1;for(;!_0x4a9e18;){const {done:_0x11baa5,value:_0x5dfc48}=await _0x5c08ce['read'](),_0x3f262e=_0x5173fd+_0x183817['decode'](_0x5dfc48);let _0x4f91ba='';_0x4a9e18=_0x11baa5;try{_0x4f91ba=this['_cleanUpData'](_0x3f262e),_0x5173fd='';}catch{_0x5173fd=_0x3f262e;continue;}_0x5ae102+=_0x4f91ba,!_0x4a9e18&&this['_isBufferIncomplete'](_0x5ae102)||_0x5ae102&&(_0x3f1731+=_0x5ae102,_0x5ae102='',_0x5c5117(_0x3f1731));}return Promise['resolve']();}async['_readStaticResponse'](_0x296e02,_0x1b9822){return _0x1b9822((await _0x296e02['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x3f55b4){const _0x2c82d4=_0x3f55b4['split']('<')['length']!==_0x3f55b4['split']('>')['length'],_0x1352f6=_0x3f55b4['length']<0x1e;return _0x2c82d4&&_0x1352f6;}['_cleanUpData'](_0x466ff1){return _0x466ff1['split'](/\n(?![^{]*\})/g)['map'](_0x57c8ff=>_0x57c8ff['replace']('data:\x20',''))['filter'](_0x3c12bb=>_0x3c12bb&&_0x3c12bb['length']>0x0&&'[DONE]'!==_0x3c12bb)['map'](_0x530018=>{const {choices:_0x78458f}=JSON['parse'](_0x530018);if(_0x78458f[0x0]?.['delta']?.['content'])return _0x78458f[0x0]['delta']['content'];})['filter'](_0x4faffb=>_0x4faffb)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x40bbed){super(_0x40bbed),_0x40bbed['config']['get']('ai.aws.requestParameters')||_0x40bbed['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']=_0x40bbed['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x40bbed['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x40bbed['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x40bbed['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x4490cd,context:_0x505529,onData:_0x3ed0db,actionId:_0x58bc8f}){const {model:_0x3e900b,stream:_0x5055fe,..._0x331e0b}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x58bc8f),_0x426f02={'prompt':await this['preparePrompt'](_0x4490cd,_0x505529,_0x3e900b,_0x58bc8f),..._0x331e0b};this['_apiUrl']?await this['_processProxyRequest'](_0x426f02,_0x3e900b,_0x5055fe,_0x3ed0db,_0x58bc8f):await this['_processAWSRequest'](_0x426f02,_0x3e900b,_0x5055fe,_0x3ed0db);}async['preparePrompt'](_0x588a14,_0x26aa49,_0x507183,_0x409269){let _0x453051,_0x588db8;return _0x26aa49?(_0x453051='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.',_0x588db8='Instruction:\x0a'+_0x588a14+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x26aa49):(_0x453051='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.',_0x588db8=_0x588a14),'meta.llama'==this['getModelFamily'](_0x507183)?'<<SYS>>\x0a'+_0x453051+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x588db8+'\x0a[/INST]':'Human:\x0a'+_0x453051+'\x0a'+_0x588db8+'\x0a\x0aAssistant:';}['getModelFamily'](_0x1ee57a){if(/^anthropic\.claude/['test'](_0x1ee57a))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x1ee57a))return'ai21.j2';if(/^cohere\.command/['test'](_0x1ee57a))return'cohere.command';if(/^meta\.llama/['test'](_0x1ee57a))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x1ee57a));}async['_processProxyRequest'](_0x26cf86,_0x24d355,_0xd9ef55,_0x49ff62,_0x2ecd74){const _0x8b9777={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2ecd74),'body':JSON['stringify']({..._0x26cf86,'model':_0x24d355,'stream':_0xd9ef55}),'signal':this['abortController']['signal']},_0x341608=await fetch(this['_apiUrl'],_0x8b9777);_0xd9ef55?await this['_readStreamableResponse'](_0x341608,_0x24d355,_0x49ff62):await this['_readStaticResponse'](_0x341608,_0x24d355,_0x49ff62);}async['_processAWSRequest'](_0x2d90f9,_0x198576,_0x43ff0e,_0x372aab){const _0x29baf4=new _0x814e00(this['_bedrockClientConfig']),_0x2c6b4e={'body':JSON['stringify'](_0x2d90f9),'contentType':'application/json','accept':'application/json','modelId':_0x198576};let _0xe62e9b;if(_0x43ff0e){const _0x1af5ea=new _0x266f1d(_0x2c6b4e);_0xe62e9b=await _0x29baf4['send'](_0x1af5ea,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0xe62e9b,_0x198576,_0x372aab);}else{const _0x5c4862=new _0x139fab(_0x2c6b4e);_0xe62e9b=await _0x29baf4['send'](_0x5c4862,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0xe62e9b,_0x198576,_0x372aab);}}async['_readAsyncIterableResponse'](_0x2a2e5f,_0x522caa,_0x2baa63){const _0x6a6890=_0x2a2e5f['body'],_0x109daa=new TextDecoder('utf-8');let _0x1dd71b='';for await(const _0x15e5fa of _0x6a6890)if(_0x15e5fa['chunk']){const _0xe0356c=_0x109daa['decode'](_0x15e5fa['chunk']['bytes']),_0x191eb4=JSON['parse'](_0xe0356c);_0x1dd71b+=this['_getGeneratedText'](_0x191eb4,_0x522caa),_0x2baa63(_0x1dd71b);}return Promise['resolve']();}async['_readStreamableResponse'](_0x428718,_0x10e656,_0x3dd814){const _0x4cbabf=_0x428718['body'],_0xc512a4=new TextDecoder('utf-8'),_0x197cf0=_0x4cbabf['getReader']();let _0x43ac03='',_0x4b4828='',_0x5ed196=!0x1;for(;!_0x5ed196;){const {done:_0x58cb3d,value:_0xe8cbd4}=await _0x197cf0['read']();if(_0x5ed196=_0x58cb3d,_0x5ed196)break;const _0x6dcd3c=(_0x43ac03+_0xc512a4['decode'](_0xe8cbd4))['split']('\x0a')['map'](_0x454a9d=>{try{return _0x43ac03='',JSON['parse'](_0x454a9d);}catch{return _0x43ac03=_0x454a9d,null;}})['filter'](_0x2c9c33=>null!==_0x2c9c33);_0x6dcd3c['length']&&(_0x4b4828+=_0x6dcd3c['map'](_0x2865f6=>this['_getGeneratedText'](_0x2865f6,_0x10e656))['join'](''),_0x3dd814(_0x4b4828));}return Promise['resolve']();}async['_readStaticResponse'](_0x49a328,_0x695371,_0x5144bd){let _0x57e412;return _0x57e412=_0x49a328 instanceof Response?await _0x49a328['json']():JSON['parse'](Buffer['from'](_0x49a328['body'])['toString']('utf8')),(_0x5144bd(this['_getGeneratedText'](_0x57e412,_0x695371)),Promise['resolve']());}['_getGeneratedText'](_0x4f2e6f,_0x3a91e8){switch(this['getModelFamily'](_0x3a91e8)){case'anthropic.claude':return _0x4f2e6f['completion'];case'ai21.j2':return _0x4f2e6f['completions'][0x0]['data']['text'];case'cohere.command':return _0x4f2e6f['generations'][0x0]['text'];case'meta.llama':return _0x4f2e6f['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
|
|
23
|
+
import{Plugin as _0x24e675,Command as _0x2952ed}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x1a86c0,IconCheck as _0x3b483a,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x3cb38c,IconRobotPencil as _0x3e1a5d}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x31d56c,CKEditorError as _0x1ed59c,ObservableMixin as _0x370eab,global as _0x2dbbc9,isVisible as ot,Rect as it,Collection as _0x4ccbc3,FocusTracker as mt,KeystrokeHandler as ut,first as _0x9bd64f}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x269602,View as _0x437a39,SpinnerView as _0x4d4ebe,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x54ad93,createDropdown as _0x58b909,addMenuToDropdown as _0x5511ab,MenuBarMenuView as _0x595115,MenuBarMenuListItemButtonView as _0x53d973,DialogViewPosition as _0x550034,MenuBarMenuListView as _0x10d556,MenuBarMenuListItemView as _0x48fceb}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x102e51,ClipboardMarkersUtils as _0x514629}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x333171,DataTransfer as _0x4e16c7,UpcastWriter as _0x46e462,Matcher as _0x39bfc2}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x4967b9,InvokeModelWithResponseStreamCommand as _0x49e8cb,InvokeModelCommand as _0x13fb25}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x15f0a5,_0x37eb9d){const _0x498035=(0x0,_0x37eb9d['t'])('Other');return _0x15f0a5['length']?'groupId'in _0x15f0a5[0x0]?_0x15f0a5:[{'groupId':x,'groupLabel':_0x498035,'order':0x1/0x0,'commands':_0x15f0a5}]:[{'groupId':x,'groupLabel':_0x498035,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x24e675{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x331bb1}=this,_0x2931f4=['ck-fake-ai-selection'];_0x331bb1['config']['get']('ai.useTheme')&&_0x2931f4['push']('ck-ai-assistant-ui_theme'),_0x331bb1['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x2931f4,'priority':0xc}}),_0x331bb1['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x58b961,{writer:_0x48b520})=>{if(!_0x58b961['markerRange']['isCollapsed'])return null;const _0x27df34=_0x48b520['createUIElement']('span');return _0x48b520['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x27df34),_0x27df34;}});}['afterInit'](){!async function(_0x276048){const _0x137395=_0x1e4199([0x61,0x57,0x5a,0x64,0x4a,0x56,0x31,0x36,0x50,0x74,0x72,0x76,0x6b,0x73,0x79,0x6a,0x47,0x67,0x30,0x62,0x34,0x7a,0x35,0x6c,0x33,0x70,0x58,0x53,0x4e,0x4f,0x51,0x37,0x65,0x43,0x4b,0x78,0x42,0x38,0x32,0x69,0x39,0x6e,0x63,0x66,0x77,0x45,0x68,0x6f,0x41,0x44,0x4c,0x59,0x6d,0x52,0x55,0x4d,0x48,0x75,0x46,0x71,0x54,0x49]),_0x15edee=0x62379ca0,_0xcdd35=0x6230f520^_0x15edee,_0x4fd960=window[_0x1e4199([0x44,0x61,0x74,0x65])][_0x1e4199([0x6e,0x6f,0x77])](),_0x41d56e=_0x276048[_0x1e4199([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4cb242=new window[(_0x1e4199([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2f8c6f=>{_0x41d56e[_0x1e4199([0x6f,0x6e,0x63,0x65])](_0x1e4199([0x72,0x65,0x61,0x64,0x79]),_0x2f8c6f);}),_0x44a167={[_0x1e4199([0x6b,0x74,0x79])]:_0x1e4199([0x45,0x43]),[_0x1e4199([0x75,0x73,0x65])]:_0x1e4199([0x73,0x69,0x67]),[_0x1e4199([0x63,0x72,0x76])]:_0x1e4199([0x50,0x2d,0x32,0x35,0x36]),[_0x1e4199([0x78])]:_0x1e4199([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]),[_0x1e4199([0x79])]:_0x1e4199([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]),[_0x1e4199([0x61,0x6c,0x67])]:_0x1e4199([0x45,0x53,0x32,0x35,0x36])},_0x4acbf5=_0x41d56e[_0x1e4199([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x1e4199([0x67,0x65,0x74])](_0x1e4199([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5ad2f5(){let _0x25e448,_0x24b02f=null,_0x4eee96=null;try{if(_0x4acbf5==_0x1e4199([0x47,0x50,0x4c]))return _0x1e4199([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x25e448=_0x3395d8(),!_0x25e448)return _0x1e4199([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x25e448[_0x1e4199([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x4eee96=_0x2310c7(_0x25e448[_0x1e4199([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x25e448[_0x1e4199([0x6a,0x74,0x69])])),await _0xa4eac4()?_0x8bab41()?_0x2b3794()?_0x1e4199([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x52cf5c()?(_0x25e448[_0x1e4199([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1e4199([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x24b02f=_0x40adbb(_0x1e4199([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x25e448[_0x1e4199([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1e4199([0x74,0x72,0x69,0x61,0x6c])&&(_0x24b02f=_0x40adbb(_0x1e4199([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3f750f()):_0x1e4199([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x1e4199([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x1e4199([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x1e4199([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2b3794(){const _0x9df7c8=[_0x1e4199([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x1e4199([0x74,0x72,0x69,0x61,0x6c])][_0x1e4199([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25e448[_0x1e4199([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x4fd960/0x3e8:0xe10*_0xcdd35;return _0x25e448[_0x1e4199([0x65,0x78,0x70])]<_0x9df7c8;}function _0x8bab41(){const _0x2a6f80=_0x25e448[_0x1e4199([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x2a6f80&&(!!_0x2a6f80[_0x1e4199([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1e4199([0x2a]))||!!_0x2a6f80[_0x1e4199([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1e4199([0x41,0x49])));}function _0x52cf5c(){const _0x1763fe=_0x25e448[_0x1e4199([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1763fe||0x0==_0x1763fe[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x72f185}=new URL(window[_0x1e4199([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1763fe[_0x1e4199([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x72f185))return!0x0;const _0x544907=_0x72f185[_0x1e4199([0x73,0x70,0x6c,0x69,0x74])](_0x1e4199([0x2e]));return _0x1763fe[_0x1e4199([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x184f6c=>_0x184f6c[_0x1e4199([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1e4199([0x2a])))[_0x1e4199([0x6d,0x61,0x70])](_0x24a678=>_0x24a678[_0x1e4199([0x73,0x70,0x6c,0x69,0x74])](_0x1e4199([0x2e])))[_0x1e4199([0x73,0x6f,0x6d,0x65])](_0x4707ec=>_0x544907[_0x1e4199([0x65,0x76,0x65,0x72,0x79])]((_0x3276e0,_0x129d19)=>_0x4707ec[_0x129d19]===_0x3276e0||_0x4707ec[_0x129d19]===_0x1e4199([0x2a])));}function _0x3f750f(){return _0x24b02f&&_0x4eee96?new window[(_0x1e4199([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3f2aa2,_0x1103f2)=>{_0x24b02f[_0x1e4199([0x74,0x68,0x65,0x6e])](_0x3f2aa2,_0x1103f2),_0x4eee96[_0x1e4199([0x74,0x68,0x65,0x6e])](_0x235d56=>{_0x235d56!=_0x1e4199([0x56,0x61,0x6c,0x69,0x64])&&_0x3f2aa2(_0x235d56);},_0x1103f2);}):_0x24b02f||_0x4eee96||_0x1e4199([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2310c7(_0x4a502c,_0x35d973){return new window[(_0x1e4199([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x215a98=>{if(_0x8d87b2())return _0x215a98(_0x1e4199([0x56,0x61,0x6c,0x69,0x64]));_0x4b4368(),_0x41d56e[_0x1e4199([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x1e4199([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x224402=!0x1;const _0x226cb6=_0x31d56c();function _0x27fd17(_0x19b4b9){return!!_0x19b4b9&&(typeof _0x19b4b9===_0x1e4199([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x19b4b9===_0x1e4199([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x19b4b9[_0x1e4199([0x74,0x68,0x65,0x6e])]===_0x1e4199([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x19b4b9[_0x1e4199([0x63,0x61,0x74,0x63,0x68])]===_0x1e4199([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x255583(_0x474766){_0x38394c(_0x474766)[_0x1e4199([0x74,0x68,0x65,0x6e])](_0x1959bd=>{if(!_0x1959bd||_0x1959bd[_0x1e4199([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x1e4199([0x6f,0x6b]))return _0x1e4199([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x596d74(_0x398c9a(_0x226cb6+_0x35d973))!=_0x1959bd[_0x1e4199([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x1e4199([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x1e4199([0x56,0x61,0x6c,0x69,0x64]);})[_0x1e4199([0x74,0x68,0x65,0x6e])](_0x47b4c9=>(_0x30c038(),_0x47b4c9),()=>{const _0x492d03=_0x52bbcd();return null==_0x492d03?(_0x30c038(),_0x1e4199([0x56,0x61,0x6c,0x69,0x64])):_0x1e4199(_0x4fd960-_0x492d03>(0x463b18a0^_0x15edee)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x1e4199([0x74,0x68,0x65,0x6e])](_0x215a98)[_0x1e4199([0x63,0x61,0x74,0x63,0x68])](()=>{_0x215a98(_0x1e4199([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5f3007=0x62017220^_0x15edee;function _0x30c038(){const _0x4bc3fb=_0x1e4199([0x6c,0x6c,0x63,0x74,0x2d])+_0x596d74(_0x398c9a(_0x4a502c)),_0x5a204d=_0x273967(_0x596d74(window[_0x1e4199([0x4d,0x61,0x74,0x68])][_0x1e4199([0x63,0x65,0x69,0x6c])](_0x4fd960/_0x5f3007)));window[_0x1e4199([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1e4199([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4bc3fb,_0x5a204d);}function _0x52bbcd(){const _0x5eae85=_0x1e4199([0x6c,0x6c,0x63,0x74,0x2d])+_0x596d74(_0x398c9a(_0x4a502c)),_0x3bc1d4=window[_0x1e4199([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1e4199([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5eae85);return _0x3bc1d4?window[_0x1e4199([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x273967(_0x3bc1d4),0x10)*_0x5f3007:null;}function _0x38394c(_0x408fc7){return new window[(_0x1e4199([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x54b6f9,_0x312933)=>{_0x408fc7[_0x1e4199([0x74,0x68,0x65,0x6e])](_0x54b6f9,_0x312933),window[_0x1e4199([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x312933,0x62364860^_0x15edee);});}}_0x41d56e[_0x1e4199([0x6f,0x6e])](_0x1e4199([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x452d1e,_0x42cc7d)=>{if(_0x42cc7d[0x0]!=_0x4a502c)return _0x215a98(_0x1e4199([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x42cc7d[0x1]={..._0x42cc7d[0x1],[_0x1e4199([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x226cb6};},{[_0x1e4199([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1e4199([0x68,0x69,0x67,0x68])}),_0x41d56e[_0x1e4199([0x6f,0x6e])](_0x1e4199([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x15a31f=>{_0x27fd17(_0x15a31f[_0x1e4199([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x224402=!0x0,_0x255583(_0x15a31f[_0x1e4199([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x1e4199([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1e4199([0x6c,0x6f,0x77])}),_0x4cb242[_0x1e4199([0x74,0x68,0x65,0x6e])](()=>{_0x224402||_0x215a98(_0x1e4199([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x8d87b2(){return _0x41d56e[_0x1e4199([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1e4199([0x76,0x69,0x65,0x77])][_0x1e4199([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x1e4199([0x61,0x75,0x74,0x6f]);}function _0x4b4368(){_0x41d56e[_0x1e4199([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1e4199([0x76,0x69,0x65,0x77])][_0x1e4199([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x1e4199([0x61,0x75,0x74,0x6f]);}}function _0x40adbb(_0x388fe7){const _0x3e5eea=[new window[(_0x1e4199([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4bb15b=>setTimeout(_0x4bb15b,0x623ea26c^_0x15edee)),_0x4cb242[_0x1e4199([0x74,0x68,0x65,0x6e])](()=>new window[(_0x1e4199([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x50947b=>{let _0x27d32f=0x0;_0x41d56e[_0x1e4199([0x6d,0x6f,0x64,0x65,0x6c])][_0x1e4199([0x6f,0x6e])](_0x1e4199([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x53e08f,_0x177c93)=>{_0x177c93[0x0][_0x1e4199([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x27d32f++,_0x27d32f==(0x62379d58^_0x15edee)&&(_0x50947b(),_0x53e08f[_0x1e4199([0x6f,0x66,0x66])]());});}))];return window[_0x1e4199([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x1e4199([0x72,0x61,0x63,0x65])](_0x3e5eea)[_0x1e4199([0x74,0x68,0x65,0x6e])](()=>_0x388fe7);}async function _0x1e3064(){await _0x4cb242,_0x41d56e[_0x1e4199([0x6d,0x6f,0x64,0x65,0x6c])][_0x1e4199([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x2dce31,_0x41d56e[_0x1e4199([0x6d,0x6f,0x64,0x65,0x6c])][_0x1e4199([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x2dce31,_0x41d56e[_0x1e4199([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x1e4199([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5c9e49(_0x290414){const _0x2f066c=_0xe4c67e();_0x41d56e[_0x2f066c]=_0x1e4199([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x290414,_0x290414!=_0x1e4199([0x56,0x61,0x6c,0x69,0x64])&&_0x1e3064();}function _0xe4c67e(){const _0x5c67bf=window[_0x1e4199([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x1e4199([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x1e4199([0x6e,0x6f,0x77])]())[_0x1e4199([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x1e4199([0x2e]),'');let _0x59cae2=_0x1e4199([0x61]);for(let _0x5c1352=0x0;_0x5c1352<_0x5c67bf[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5c1352+=0x2){let _0x4d187b=window[_0x1e4199([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5c67bf[_0x1e4199([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5c1352,_0x5c1352+0x2));_0x4d187b>=_0x137395[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4d187b-=_0x137395[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x59cae2+=_0x137395[_0x4d187b];}return _0x59cae2;}function _0x3395d8(){const _0x3293cb=_0x4acbf5[_0x1e4199([0x73,0x70,0x6c,0x69,0x74])](_0x1e4199([0x2e]));if(0x3!=_0x3293cb[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x5314d5(_0x3293cb[0x1]);function _0x5314d5(_0x137d4f){const _0x1166dd=_0xc6aac(_0x137d4f);return _0x1166dd&&_0x282c46()?_0x1166dd:null;function _0x282c46(){const _0x4e3434=_0x1166dd[_0x1e4199([0x6a,0x74,0x69])],_0x504429=window[_0x1e4199([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4e3434[_0x1e4199([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4e3434[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x19b612={..._0x1166dd,[_0x1e4199([0x6a,0x74,0x69])]:_0x4e3434[_0x1e4199([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4e3434[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x19b612[_0x1e4199([0x76,0x63])],_0x398c9a(_0x19b612)==_0x504429;}}}async function _0xa4eac4(){let _0x572ea2=!0x0;try{const _0x2f0692=_0x4acbf5[_0x1e4199([0x73,0x70,0x6c,0x69,0x74])](_0x1e4199([0x2e])),[_0x165110,_0x219646,_0x295865]=_0x2f0692;return _0x479e02(_0x165110),await _0x58bccf(_0x165110,_0x219646,_0x295865),_0x572ea2;}catch{return!0x1;}function _0x479e02(_0x30037e){const _0x321c45=_0xc6aac(_0x30037e);_0x321c45&&_0x321c45[_0x1e4199([0x61,0x6c,0x67])]==_0x1e4199([0x45,0x53,0x32,0x35,0x36])||(_0x572ea2=!0x1);}async function _0x58bccf(_0x524b02,_0xa5338,_0x2d5466){const _0xda159d=window[_0x1e4199([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x1e4199([0x66,0x72,0x6f,0x6d])](_0x3737c0(_0x2d5466),_0x5a5b6f=>_0x5a5b6f[_0x1e4199([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x19e05b=new window[(_0x1e4199([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x1e4199([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x524b02+_0x1e4199([0x2e])+_0xa5338),_0x52c9ac=window[_0x1e4199([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x1e4199([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x52c9ac)return;const _0x4fb9a0=await _0x52c9ac[_0x1e4199([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x1e4199([0x6a,0x77,0x6b]),_0x44a167,{[_0x1e4199([0x6e,0x61,0x6d,0x65])]:_0x1e4199([0x45,0x43,0x44,0x53,0x41]),[_0x1e4199([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x1e4199([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x1e4199([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x52c9ac[_0x1e4199([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x1e4199([0x6e,0x61,0x6d,0x65])]:_0x1e4199([0x45,0x43,0x44,0x53,0x41]),[_0x1e4199([0x68,0x61,0x73,0x68])]:{[_0x1e4199([0x6e,0x61,0x6d,0x65])]:_0x1e4199([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x4fb9a0,_0xda159d,_0x19e05b)||(_0x572ea2=!0x1);}}function _0xc6aac(_0x490ac2){return _0x490ac2[_0x1e4199([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x1e4199([0x65,0x79]))?JSON[_0x1e4199([0x70,0x61,0x72,0x73,0x65])](_0x3737c0(_0x490ac2)):null;}function _0x3737c0(_0x444a36){return window[_0x1e4199([0x61,0x74,0x6f,0x62])](_0x444a36[_0x1e4199([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x1e4199([0x2b]))[_0x1e4199([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x1e4199([0x2f])));}function _0x398c9a(_0x12a7d2){let _0x3d56e8=0x1505;function _0x509a6e(_0x42a39d){for(let _0x3227ef=0x0;_0x3227ef<_0x42a39d[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3227ef++){const _0x48735b=_0x42a39d[_0x1e4199([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x3227ef);_0x3d56e8=(_0x3d56e8<<0x5)+_0x3d56e8+_0x48735b,_0x3d56e8&=_0x3d56e8;}}function _0x4da0d0(_0x194d56){Array[_0x1e4199([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x194d56)?_0x194d56[_0x1e4199([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x4da0d0):_0x194d56&&typeof _0x194d56==_0x1e4199([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x1e4199([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x194d56)[_0x1e4199([0x73,0x6f,0x72,0x74])]()[_0x1e4199([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x134fd2,_0x234a81])=>{_0x509a6e(_0x134fd2),_0x4da0d0(_0x234a81);}):_0x509a6e(window[_0x1e4199([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x194d56));}return _0x4da0d0(_0x12a7d2),_0x3d56e8>>>0x0;}function _0x596d74(_0x3371c9){return _0x3371c9[_0x1e4199([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x1e4199([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x1e4199([0x30]));}function _0x273967(_0x22c180){return _0x22c180[_0x1e4199([0x73,0x70,0x6c,0x69,0x74])]('')[_0x1e4199([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x1e4199([0x6a,0x6f,0x69,0x6e])]('');}function _0x2dce31(){}function _0x1e4199(_0x40143e){return _0x40143e['map'](_0x3b4ced=>String['fromCharCode'](_0x3b4ced))['join']('');}_0x5c9e49(await _0x5ad2f5());}(this);}['showFakeVisualSelection'](){const _0x534230=this['editor']['model'];_0x534230['change'](_0x2baf41=>{const _0x1a49f7=_0x534230['document']['selection']['getRanges']();let _0x314872=0x0;for(const _0x2463e9 of _0x1a49f7){const _0x4a24eb=f+':'+_0x314872;if(_0x534230['markers']['has'](_0x4a24eb))_0x2baf41['updateMarker'](_0x4a24eb,{'range':_0x2463e9});else{if(_0x2463e9['start']['isAtEnd']){const _0x125c23=_0x2463e9['start']['getLastMatchingPosition'](({item:_0x336a53})=>!_0x534230['schema']['isContent'](_0x336a53),{'boundaries':_0x2463e9});_0x2baf41['addMarker'](_0x4a24eb,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2baf41['createRange'](_0x125c23,_0x2463e9['end'])});}else _0x2baf41['addMarker'](_0x4a24eb,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2463e9});}_0x314872++;}});}['hideFakeVisualSelection'](){const _0x1a7024=this['editor']['model'],_0x43fdde=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x43fdde['length']&&_0x1a7024['change'](_0x5518de=>{_0x43fdde['forEach'](_0xbed6ed=>{_0x5518de['removeMarker'](_0xbed6ed);});});}['insertContent'](_0x2a2f49,_0x3fcd95){const _0x56026b=this['_getAISelection'](),_0x4a66e9=_0x3fcd95||_0x56026b['getFirstRange']();this['editor']['model']['canEditAt'](_0x4a66e9)&&this['editor']['model']['change'](_0x1fc971=>{this['hideFakeVisualSelection'](),_0x3fcd95||this['_resetContentOfSelectedTableCells'](_0x1fc971,_0x56026b),this['_pasteHTMLUsingClipboard']({'insertAt':_0x4a66e9,'writer':_0x1fc971,'html':_0x2a2f49});});}['insertContentBelow'](_0x4c5bab){const {model:_0x12906d}=this['editor'],_0x3d5285=this['_getAISelection']();_0x12906d['change'](()=>{const _0x1ac544=this['_prepareTableInsertBelowPosition'](_0x4c5bab,_0x3d5285)||this['_getDefaultInsertBelowPosition'](_0x3d5285);this['insertContent'](_0x4c5bab,_0x1ac544);});}['_getAISelection'](){const _0x4a3863=this['editor']['model'],_0xf4d27d=Array['from'](_0x4a3863['markers']['getMarkersGroup'](f))['map'](_0x27ca25=>_0x27ca25['getRange']());return _0x4a3863['createSelection'](_0xf4d27d);}['_pasteHTMLUsingClipboard']({writer:_0x939135,html:_0x37790c,insertAt:_0x6690d3}){const {view:_0x180e4b}=this['editor']['editing'],_0x1ed364=this['editor']['plugins']['get'](_0x102e51),_0x5ab9db=new gt();_0x5ab9db['setData']('text/html',_0x37790c);const _0x32fd75=new ClipboardEvent('paste',{'clipboardData':_0x5ab9db}),_0x3aea6c=new _0x333171(_0x180e4b,_0x32fd75,{'dataTransfer':new _0x4e16c7(_0x5ab9db)});_0x939135['setSelection'](_0x6690d3);const _0x5b66db=(_0xa7d0cb,_0x4ae823)=>{_0x4ae823['resultRange']&&_0x939135['setSelection'](_0x4ae823['resultRange']);};_0x1ed364['once']('contentInsertion',_0x5b66db,{'priority':'lowest'}),_0x180e4b['document']['fire']('paste',_0x3aea6c),_0x1ed364['off']('contentInsertion',_0x5b66db);}['_getDefaultInsertBelowPosition'](_0xadfa57){const {model:_0x4b385b}=this['editor'],_0x20d6af=Array['from'](_0xadfa57['getSelectedBlocks']());return _0x20d6af['length']?_0x4b385b['createPositionAfter'](_0x20d6af['pop']()):_0xadfa57['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x4b47fa,_0x4dc7ba){const {model:_0x55cf99,plugins:_0x4401cc}=this['editor'];if(_0x4401cc['has']('TableUtils')){const _0x2e97c4=_0x4401cc['get']('TableUtils')['getSelectedTableCells'](_0x4dc7ba);if(_0x2e97c4['length']){const _0x365552=this['_getTableRowCountFromContent'](_0x4b47fa),_0x39d5d7=this['_createEmptyTableRows'](_0x2e97c4,_0x365552);return _0x55cf99['createPositionAt'](_0x39d5d7,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1870a2){const _0x3633c0=this['editor']['plugins']['get']('TableUtils'),_0x26bd26=this['editor']['data']['parse'](_0x1870a2),_0x23a154=Array['from'](_0x26bd26['getChildren']())['filter'](_0xd6e9f1=>_0xd6e9f1['is']('element','table'));let _0x36bc83=0x0;return _0x23a154['forEach'](_0x368431=>{_0x36bc83+=_0x3633c0['getRows'](_0x368431);}),_0x36bc83;}['_createEmptyTableRows'](_0x18d122,_0x480cd4){const _0x2019ca=this['editor']['plugins']['get']('TableUtils'),_0x551752=_0x2019ca['getRowIndexes'](_0x18d122),_0x4c702b=_0x2019ca['getColumnIndexes'](_0x18d122),_0x391dc5=_0x551752['last']+0x1,_0x54509a=_0x4c702b['first'],_0x204ec1=_0x18d122[0x0]['findAncestor']('table');for(let _0x260266=0x0;_0x260266<_0x480cd4;_0x260266++)_0x2019ca['insertRows'](_0x204ec1,{'at':_0x391dc5});return _0x204ec1['getChild'](_0x391dc5)['getChild'](_0x54509a);}['_resetContentOfSelectedTableCells'](_0x3c43af,_0x1c7412){const {plugins:_0x46f39b}=this['editor'],{model:_0x37ad81}=_0x3c43af;if(!_0x46f39b['has']('TableUtils'))return;_0x46f39b['get']('TableUtils')['getSelectedTableCells'](_0x1c7412)['length']&&_0x37ad81['deleteContent'](_0x1c7412);}}class E extends _0x24e675{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1ed59c('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x113acc){super(_0x113acc),this['name']='AIRequestError';}}function i(_0x9dcce,_0x671b0,_0x3c50b6){const t=_0x9dcce['t'];switch(_0x671b0){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',_0x3c50b6);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3c50b6);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'},_0x3c50b6);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 _0x671b0;}}class j extends _0x2952ed{['_commandDefinitions'];constructor(_0x34a0d8,_0x5b12e7){super(_0x34a0d8),this['_commandDefinitions']=_0x5b12e7,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1cadd1,_0x2b579b,_0x181a66)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x181a66));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x217576,_0x2348ae,_0x5e1fa8)=>{this['enabledCommandsIds']=_0x5e1fa8?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2f2f32=this['editor']['model'];this['_hasContext']=function(_0xaabc56){const _0x201d6e=_0xaabc56['document']['selection'];return _0x201d6e['isCollapsed']?0x0!==[..._0x201d6e['getSelectedBlocks']()]['length']&&![..._0x201d6e['getSelectedBlocks']()][0x0]['isEmpty']:!!_0xaabc56['hasContent'](_0x201d6e['getFirstRange']());}(_0x2f2f32);const _0xf73d28=_0x2f2f32['document']['selection'],_0x43e715=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x29082c of _0xf73d28['getRanges']())for(const _0x189f38 of _0x29082c['getItems']())if(_0x189f38['is']('element')&&_0x43e715['includes'](_0x189f38['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x34243d='',_0x39bbb3='',_0x2ff279='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x34243d,_0x39bbb3,_0x2ff279);}}function G(_0x358cf0,_0x2434fe){const _0x4e7868=new Set();for(const _0x26cfc9 of _0x358cf0['values']())(_0x2434fe||!0x1===_0x26cfc9['requiresContent'])&&_0x4e7868['add'](_0x26cfc9['id']);return Array['from'](_0x4e7868);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x370eab(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x5ac885,_0x3bc34e,_0x290f63){super(),this['editor']=_0x5ac885,this['textAdapter']=_0x3bc34e,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x290f63,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x305c5e,_0x1e9c6c,_0x2039ea)=>{this['view']['value']=this['_sanitizeHTML'](_0x2039ea);}),this['listenTo'](this['view'],'submitPrompt',(_0x27f006,_0x42ca14)=>{const _0x446636=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x42ca14,_0x446636,'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:_0x259a6f,query:_0x1df33d,htmlContent:_0x3e6c01,label:_0x1ce8fb,mainActionLabel:_0x5eb675}){this['view']['prompt']=_0x1ce8fb,this['view']['mainAction']=_0x5eb675,this['initialContext']=_0x3e6c01,_0x1df33d&&(this['view']['isRendered']?this['_handleQuery'](_0x1df33d,_0x3e6c01,_0x259a6f,_0x1ce8fb):this['view']['once']('render',()=>{this['_handleQuery'](_0x1df33d,_0x3e6c01,_0x259a6f,_0x1ce8fb);}));}['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'](_0x51254e,_0x2e84f7,_0x4fe2bc,_0x43ffc9){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2e84f7,this['previousQuery']=_0x51254e,this['previousLabel']=_0x43ffc9||_0x51254e,this['previousActionId']=_0x4fe2bc,new Promise(_0x3d2405=>{this['textAdapter']['makeRequest']({'query':_0x51254e,'context':_0x2e84f7,'onData':_0x8fb481=>{this['currentResponse']=_0x8fb481,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4fe2bc})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x5733c4=>{_0x5733c4 instanceof R?this['view']['handleError'](_0x5733c4['message']):this['view']['handleError'](),_0x3d2405();})['finally'](()=>{this['stopProcessing'](),_0x3d2405();});});}['_parseAndNormalizeContent'](_0x195821,_0x358f5a=!0x1){const _0x1b11a5=Z['exec'](_0x195821);_0x195821=_0x1b11a5?_0x195821['substring'](_0x1b11a5[0x1]['length']):_0x195821['length']<0x64&&!_0x358f5a?'':this['_stripMarkdownSyntax'](_0x195821);const _0x49eb4a=this['_domParser']['parseFromString'](_0x195821,'text/html');if(_0x1b11a5){const _0x18fa7c=Array['from'](_0x49eb4a['body']['childNodes']);_0x18fa7c['reverse']();for(const _0x139cf2 of _0x18fa7c){if(_0x139cf2['nodeType']==Node['ELEMENT_NODE'])break;_0x139cf2['remove']();}}const _0x261d91=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x49eb4a['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x261d91);const _0x1831e7=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x4e5800=this['editor']['data']['toModel'](_0x261d91);return _0x1831e7||_0x4e5800['markers']['clear'](),this['editor']['data']['stringify'](_0x4e5800);}['_normalizeResponseHeadings'](_0xc45f96){const _0x170e72=new _0x46e462(this['editor']['editing']['view']['document']),_0x2e219d=new _0x39bfc2({'name':/^h[1-5]$/}),_0x1527cc=[];let _0x4662cf=!0x1;for(const _0x56408b of _0xc45f96)_0x56408b['is']('element')&&_0x2e219d['match'](_0x56408b)&&(_0x1527cc['push'](_0x56408b),'h1'==_0x56408b['name']&&(_0x4662cf=!0x0));if(_0x4662cf){for(const _0x3c6302 of _0x1527cc)_0x170e72['rename']('h'+(parseInt(_0x3c6302['name'][0x1])+0x1),_0x3c6302);}}['_isH1TagSupportEnabled'](){const {data:_0x2020d8,editing:_0xc66567}=this['editor'],_0x595cbb=_0x2020d8['htmlProcessor']['toView']('<h1></h1>'),_0x2375d8=_0x2020d8['toView'](_0x2020d8['toModel'](_0x595cbb));return!!_0xc66567['view']['domConverter']['viewToDom'](_0x2375d8)['querySelector']('h1');}['_sanitizeHTML'](_0x9a40a7){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x9a40a7),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x57bb03){const _0x577d0f=_0x57bb03['trim']();return _0x577d0f['startsWith']('```html')?_0x577d0f['endsWith']('```')?_0x577d0f['substring'](0x7,_0x577d0f['length']-0x3):_0x577d0f['substring'](0x7):_0x57bb03;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0xbc6eee){super(_0xbc6eee),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3459b4=>i(_0xbc6eee,'AI_'+_0x3459b4['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0xbc6eee,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0xbc6eee,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0xbc6eee,'Stop'));const _0x4596d0=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x4596d0['if']('isVisible','ck-hidden',_0x967372=>!_0x967372)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3ffbf9,_0x53e2c4){const _0x5e89d0=new _0x269602(this['locale']);return _0x5e89d0['set']({'label':_0x3ffbf9,'class':_0x53e2c4||'','isVisible':!0x0,'withText':!0x0}),_0x5e89d0;}}class Y extends _0x437a39{['contentFieldView'];['copyButtonView'];constructor(_0x51f5fb,_0x23f1d5=''){super(_0x51f5fb),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x136120=this['bindTemplate'];this['contentFieldView']=new At(_0x51f5fb,_0x23f1d5),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x136120['if']('isVisible','ck-hidden',_0x34d31b=>!_0x34d31b)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x136120['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 _0x47cd86=!0x1;this['on']('change:value',(_0x1a240e,_0x3c2560,_0x45b6f6)=>{const _0x36e25c=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x45b6f6),this['isProcessing']&&_0x36e25c&&!_0x47cd86&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3508fa,_0x20399e,_0x5a8e5e)=>{_0x47cd86=!0x1,_0x5a8e5e?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x47cd86=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x47cd86=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x154b7a=this['locale'],_0x11ed4f=new _0x269602(this['locale']),_0x473665='ck-ai-form__copy-button';return _0x11ed4f['set']({'label':i(_0x154b7a,'Copy'),'icon':_0x1a86c0,'class':_0x473665,'tooltip':!0x0}),_0x11ed4f['bind']('isVisible')['to'](this,'value',_0x1c6985=>!!_0x1c6985),_0x11ed4f['bind']('isEnabled')['to'](this,'isProcessing',_0x320d64=>!_0x320d64),_0x11ed4f['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x11ed4f['icon']=_0x3b483a,_0x11ed4f['class']=_0x473665+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x11ed4f['icon']=_0x1a86c0,_0x11ed4f['class']=_0x473665;},0x3e8);}),_0x11ed4f;}['_copyHTMLToClipboard'](_0x27fba5){const {window:_0x55bbb9,document:_0x4d70d1}=_0x2dbbc9;if(_0x55bbb9['ClipboardItem']){const {Blob:_0x3ffa1a,ClipboardItem:_0x248569}=_0x55bbb9,_0x2ec80d=[new _0x248569({'text/html':new _0x3ffa1a([_0x27fba5['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3ffa1a([_0x27fba5['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2ec80d);}else{const _0x29492c=_0x4d70d1['createElement']('div');_0x29492c['style']['position']='absolute',_0x29492c['style']['left']='-9999px',_0x29492c['innerHTML']='<span>[</span>'+_0x27fba5['innerHTML']+'<span>]</span>',_0x4d70d1['body']['appendChild'](_0x29492c);const _0x3830b4=_0x4d70d1['createRange']();_0x3830b4['setStartAfter'](_0x29492c['firstElementChild']),_0x3830b4['setEndBefore'](_0x29492c['lastElementChild']);const _0x2ad474=_0x55bbb9['getSelection']();_0x2ad474['removeAllRanges'](),_0x2ad474['addRange'](_0x3830b4),_0x4d70d1['execCommand']('copy'),_0x29492c['remove']();}}}class At extends _0x437a39{constructor(_0x1e3e8c,_0x4ee290=''){super(_0x1e3e8c),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4ee290,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x20bc62){this['element']['innerHTML']=_0x20bc62;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x2976c4=new _0x437a39(),_0x3a5a68=this['locale'],_0x1033c9=new _0x4d4ebe();return _0x1033c9['isVisible']=!0x0,_0x2976c4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1033c9,{'text':i(_0x3a5a68,'AI\x20is\x20writing...')}]}),_0x2976c4['render'](),_0x2976c4;}}class st extends _0x437a39{constructor(_0x4b53b8,_0x1ef90a=''){super(_0x4b53b8);const _0x516b70=new rt(),_0x495ac8=this['bindTemplate'];this['set']('text',_0x1ef90a),_0x516b70['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x516b70,{'text':_0x495ac8['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x14b126,_0x24668d){super(_0x14b126,_0x24668d),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',(_0x4f334c,_0x5c0934)=>{_0x4f334c['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5c0934());});}['_createSubmitButton'](){const _0x22a822=new _0x269602(this['locale']),_0x462e79=this['locale'];return _0x22a822['set']({'icon':ht,'label':i(_0x462e79,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x22a822['on']('execute',()=>{this['submit']();}),_0x22a822['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x51b271,_0x371958)=>!_0x51b271&&_0x371958),_0x22a822;}['_createShowHistoryButton'](){const _0x4a9913=new _0x269602(this['locale']),_0x301cd1=this['resultsView'],_0x4bb27d=this['locale'];_0x4a9913['set']({'label':i(_0x4bb27d,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4a9913['bind']('isOn')['to'](_0x301cd1,'isVisible'),_0x4a9913['bind']('isEnabled')['to'](this,'isEnabled'),_0x4a9913['on']('execute',()=>{_0x301cd1['isVisible']=!_0x301cd1['isVisible'],_0x301cd1['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4486b9=()=>{_0x2dbbc9['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x42cef0=new it(this['queryView']['fieldView']['element']),_0x2981d4=_0x42cef0['width'],_0x2cf20f='rtl'===_0x4bb27d['uiLanguageDirection']?'left':'right';_0x42cef0['excludeScrollbarsAndBorders'](),_0x4a9913['element']['style'][_0x2cf20f]=_0x2981d4-_0x42cef0['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4486b9),this['on']('render',_0x4486b9),_0x4a9913;}['submit'](){const _0x54efeb=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x54efeb);}['focus'](_0x24662a){-0x1===_0x24662a?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x4420ff){super(_0x4420ff),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x4420ff,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2b84dd=0x0;for(const _0x3481b2 of this['items'])_0x2b84dd+=_0x3481b2['items']['length'];return{'resultsCount':_0x2b84dd,'totalItemsCount':_0x2b84dd};}['_createClearHistoryButton'](){const _0x410314=this['locale'],_0x2acbb1=new _0x269602(this['locale']);return _0x2acbb1['set']({'label':'('+i(_0x410314,'Clear')+')','withText':!0x0}),_0x2acbb1['on']('execute',()=>this['fire']('clearHistory')),_0x2acbb1;}}class bt extends xt{constructor(_0x6a9960){super();const _0x286537=new kt(),_0x1afc59=new _0x269602(this['locale'],_0x286537);this['children']['add'](_0x1afc59),_0x1afc59['set']({'label':_0x6a9960['prompt'],'withText':!0x0}),_0x1afc59['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x6a9960['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x4ccbc3{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x328b1f,_0x1067c5)=>{const _0x399f2a=os(_0x1067c5['prompt']);for(const _0x226b0c of this)if(_0x226b0c!=_0x1067c5&&os(_0x226b0c['prompt'])===_0x399f2a){this['remove'](_0x226b0c);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x16ae48=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x16ae48));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x4b67b2=>_0x4b67b2)));}}function os(_0x5b61a2){return _0x5b61a2['toLowerCase']()['trim']();}class _ extends _0x437a39{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x13b519,_0x5f3ff9,_0x3b8deb=''){super(_0x13b519),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new wt(),this['errorView']=new st(_0x13b519),this['contentArea']=new Y(_0x13b519,_0x3b8deb),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 mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'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 _0x3f951c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x5f3ff9],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3f951c['if']('isError','ck-hidden',_0x2214ad=>!_0x2214ad)]},'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'](_0x4c69c1=0x1){-0x1===_0x4c69c1?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 _0x7df2d5=this['locale'],_0x2cdde4=new ct(_0x7df2d5,{'queryView':{'label':i(_0x7df2d5,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x7df2d5,'Empty\x20history'),'secondary':i(_0x7df2d5,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x2cdde4['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3ad993,_0x3ffba9)=>_0x3ad993&&!_0x3ffba9),this['listenTo'](_0x2cdde4,'submit',(_0x5e5236,_0x40d095)=>{this['prompt']=_0x40d095;const _0xf53b4b=yt(_0x40d095);this['fire']('submitPrompt',_0xf53b4b),_0x40d095['trim']()&&this['_promptHistory']['add']({'prompt':_0xf53b4b},0x0);},{'priority':'high'}),_0x2cdde4;}['_createHistoryView'](){const _0x8ef7e3=new ft(this['locale']);return _0x8ef7e3['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x8ef7e3['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x8ef7e3;}['_createToolbar'](){const _0x3463c8=new lt(this['locale']);return _0x3463c8['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x38b380,_0x22ae0e,_0x29c668)=>_0x38b380&&!_0x22ae0e&&!!_0x29c668),_0x3463c8['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x3463c8['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3dae02,_0x3deb9a,_0x36783f)=>_0x3dae02&&!_0x3deb9a&&!!_0x36783f),_0x3463c8['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x3463c8['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x34fc7a,_0x2a836c)=>_0x34fc7a&&!_0x2a836c),_0x3463c8['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x3463c8['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x3463c8['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x3463c8;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x5126ba=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x5126ba,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x1a9728){const _0xd4ba1f=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x1a9728||i(_0xd4ba1f,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x24e675{['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[_0x514629,a,E,_0x54ad93];}constructor(_0x2b5928){super(_0x2b5928),_0x2b5928['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2b5928['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2b5928['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2b5928['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1acf7a}=this;this['_aiAdapter']=_0x1acf7a['plugins']['get'](E),this['_dialog']=_0x1acf7a['plugins']['get'](_0x54ad93),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x64c30f=new j(_0x1acf7a,Array['from'](this['_commandDefinitions']['values']()));_0x1acf7a['commands']['add']('showAIAssistant',_0x64c30f),_0x1acf7a['ui']['componentFactory']['add']('aiCommands',_0x4d879d=>{const _0x4fe0d1=_0x58b909(_0x4d879d);return _0x4fe0d1['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4fe0d1['buttonView']['set']({'label':i(_0x4d879d,'AI\x20Commands'),'icon':_0x3cb38c,'tooltip':!0x0}),_0x4fe0d1['on']('execute',_0x2ae30b=>this['_onExecute'](_0x2ae30b['source']['id'])),_0x5511ab(_0x4fe0d1,_0x1acf7a['ui']['view']['body'],function(_0xf9035f){const _0x201c06=o(_0xf9035f['config']['get']('ai.aiAssistant.commands'),_0xf9035f['locale']),_0xce0cc9=U(_0xf9035f,_0x201c06)['filter'](_0x288215=>_0x288215['commands']['length']);if(0x1===_0xce0cc9['length'])return U(_0xf9035f,_0xce0cc9[0x0]['commands'])['map'](_0x13c17c=>({'id':_0x13c17c['id'],'label':_0x13c17c['label']}));return _0xce0cc9['map'](_0x281ad7=>{const {groupId:_0x2c4cc1,groupLabel:_0x49852b,commands:_0x4554c0}=_0x281ad7,_0x1eb13e=U(_0xf9035f,_0x4554c0)['map'](_0x4f417c=>({'id':_0x4f417c['id'],'label':_0x4f417c['label']}));return{'id':_0x2c4cc1,'menu':_0x49852b||_0x2c4cc1,'children':_0x1eb13e};});}(_0x1acf7a),{'ariaLabel':i(_0x4d879d,'AI\x20Commands')}),_0x4fe0d1['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x64c30f['on']('change:enabledCommandsIds',_0x346a31),_0x4fe0d1['menuView']['once']('render',_0x346a31),_0x4fe0d1;function _0x346a31(){_0x4fe0d1['isEnabled']=_0x64c30f['enabledCommandsIds']['length']>0x0;for(const _0x5f22c8 of _0x4fe0d1['menuView']['buttons'])_0x5f22c8['isEnabled']=_0x64c30f['enabledCommandsIds']['includes'](_0x5f22c8['id']);}}),_0x1acf7a['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3c0856=>{const _0x22e081=new _0x595115(_0x3c0856);_0x22e081['buttonView']['set']({'label':i(_0x3c0856,'AI\x20Commands'),'icon':_0x3cb38c}),_0x22e081['bind']('isEnabled')['to'](_0x64c30f,'enabledCommandsIds',_0x1818d4=>_0x1818d4['length']>0x0);const _0x1ec547=o(_0x1acf7a['config']['get']('ai.aiAssistant.commands'),_0x3c0856);return this['_populateMenuBarMenu'](_0x64c30f,_0x22e081,_0x1ec547,_0x125022=>this['_onExecute'](_0x125022)),_0x22e081;}),_0x1acf7a['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x526b1f=this['_createAIAssistantUIButton'](_0x269602);return _0x526b1f['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x526b1f;}),_0x1acf7a['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x2181fa=this['_createAIAssistantUIButton'](_0x53d973);return _0x2181fa['set']({'role':'menuitemcheckbox'}),_0x2181fa;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3894d3=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xc87d84;for(const _0x476d57 in _0x3894d3){const _0x401140=_0x476d57,_0x578c01=_0x3894d3[_0x401140];if('aiLicenseKeyValid'==_0x578c01||'aiLicenseKeyInvalid'==_0x578c01||'aiLicenseKeyExpired'==_0x578c01||'aiLicenseKeyDomainLimit'==_0x578c01||'aiLicenseKeyNotAllowed'==_0x578c01||'aiLicenseKeyEvaluationLimit'==_0x578c01||'aiLicenseKeyTrialLimit'==_0x578c01||'aiLicenseKeyUsageLimit'==_0x578c01){delete _0x3894d3[_0x401140],_0xc87d84=_0x578c01,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0xc87d84&&_0x3894d3['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0xc87d84&&_0x3894d3['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0xc87d84&&_0x3894d3['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0xc87d84&&_0x3894d3['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0xc87d84&&_0x3894d3['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0xc87d84&&_0x3894d3['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0xc87d84&&_0x3894d3['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x688fab='',_0xcae7ed='',_0x2b8c3d='custom'){const _0x53968a=this['editor'],_0x1cf263=_0x53968a['editing']['view'],_0x506baf=_0x53968a['plugins']['get'](a),_0x3af8d9=_0x53968a['plugins']['get'](_0x514629);_0x506baf['showFakeVisualSelection']();const _0x3d9473=new w(),_0x15cc8d=new ClipboardEvent('copy',{'clipboardData':_0x3d9473}),_0x5a4d8f=new _0x4e16c7(_0x3d9473),_0x107b46=new _0x333171(_0x1cf263,_0x15cc8d,{'dataTransfer':_0x5a4d8f});_0x3af8d9['_forceMarkersCopy']('comment',()=>{_0x1cf263['document']['fire']('copy',_0x107b46);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x53968a,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x51cafa=_0x5a4d8f['getData']('text/html');const _0x344207=_0x53968a['model']['document']['selection'],_0x2355d7=Array['from'](_0x344207['getRanges']());0x1===_0x2355d7['length']&&_0x2355d7[0x0]['isFlat']&&!_0x344207['getSelectedElement']()&&''!==_0x51cafa['replace'](/ /g,'')['trim']()&&(_0x51cafa='<p>'+_0x51cafa+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2b8c3d,'query':_0x688fab,'htmlContent':_0x51cafa,'label':_0xcae7ed,'mainActionLabel':M[_0x53968a['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x3e1a5d,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x550034['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x506baf['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2d783d=new Map(),_0xe92cd0=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x53fe70 of _0xe92cd0)for(const _0x48ac68 of _0x53fe70['commands'])_0x2d783d['set'](_0x48ac68['id'],{..._0x48ac68,'groupId':_0x53fe70['groupId'],'groupLabel':_0x53fe70['groupLabel']||_0x53fe70['groupId']});return _0x2d783d;}['_createAIAssistantUIButton'](_0x5c061f){const _0x5dba79=this['editor'],_0x2a8fbc=_0x5dba79['commands']['get']('showAIAssistant'),_0x5a8873=new _0x5c061f(_0x5dba79['locale']);return _0x5a8873['set']({'label':i(_0x5dba79['locale'],'AI\x20Assistant'),'icon':_0x3e1a5d,'isToggleable':!0x0}),_0x5a8873['bind']('isEnabled')['to'](_0x2a8fbc),_0x5a8873['bind']('isOn')['to'](this['_dialog'],'id',_0x33586e=>'aiAssistant'===_0x33586e),this['listenTo'](_0x5a8873,'execute',()=>{_0x5a8873['isOn']?this['hideUI']():_0x2a8fbc['execute']();}),_0x5a8873;}['_initView'](){const _0x263157=this['editor']['plugins']['get'](a);this['_formView']=new _(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',()=>{_0x263157['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x263157['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x18da1c,ui:{ariaLiveAnnouncer:_0x3886dd}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x44ef41,_0x28a643,_0x33619b)=>{const _0x3a737d=this['_aiAssistantController']['currentContext'];_0x33619b?_0x3886dd['announce'](i(_0x18da1c,'AI\x20is\x20writing')):_0x3a737d&&_0x3886dd['announce'](i(_0x18da1c,'Generated\x20content:\x20%0',_0x3a737d),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x4f0640,_0x12224d,_0x4514b7)=>{if(_0x4514b7){const _0x49525f=this['_formView']['errorView']['text'];_0x3886dd['announce'](i(_0x18da1c,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x49525f));}});}['_onExecute'](_0x153d02){const _0x1300b3=this['_commandDefinitions']['get'](_0x153d02),_0x7e22c1=this['editor'],_0x1802f9=_0x7e22c1['model']['document']['selection'],_0x1d697b=_0x7e22c1['commands']['get']('showAIAssistant'),_0x313c54=_0x7e22c1['plugins']['get'](a),_0x3d983e=''+(_0x1300b3['groupId']!==x?_0x1300b3['groupLabel']+':\x20':'')+_0x1300b3['label'];if(!0x1!==_0x1300b3['requiresContent']&&_0x1802f9['isCollapsed']){const _0x1e7cb9=_0x9bd64f(_0x1802f9['getSelectedBlocks']())||_0x7e22c1['model']['schema']['getLimitElement'](_0x1802f9);_0x7e22c1['model']['change'](_0x4cb1ba=>{_0x4cb1ba['setSelection'](_0x1e7cb9,'in');});}_0x313c54['showFakeVisualSelection'](),_0x1d697b['execute'](_0x1300b3['prompt'],_0x3d983e,'command:'+_0x153d02);}['_populateMenuBarMenu'](_0xfe66bc,_0xab045,_0x8601fc,_0x4d4807){const _0x28c3e7=this['editor'],_0x2f37bd=_0x28c3e7['locale'],_0x28f67c=new _0x10d556(_0x2f37bd),_0x39d755=U(_0x28c3e7,_0x8601fc)['filter'](_0x2d3db2=>_0x2d3db2['commands']['length']);0x1===_0x39d755['length']?this['_getMenuBarGroupButtons']({'command':_0xfe66bc,'commands':_0x39d755[0x0]['commands'],'parentMenuView':_0xab045,'onExecute':_0x4d4807})['forEach'](_0x170de0=>_0x28f67c['items']['add'](_0x170de0)):_0x39d755['forEach'](({groupId:_0x10bcfb,groupLabel:_0x5cb131,commands:_0x643e64})=>{const _0x3c3d0c=new _0x48fceb(_0x2f37bd,_0xab045),_0x125e20=new _0x595115(_0x2f37bd),_0x594bc7=new _0x10d556(_0x2f37bd),_0x457081=this['_getMenuBarGroupButtons']({'command':_0xfe66bc,'commands':_0x643e64,'parentMenuView':_0x125e20,'onExecute':_0x4d4807});_0x125e20['buttonView']['set']({'label':_0x5cb131||_0x10bcfb}),_0x125e20['delegate']('execute')['to'](_0xab045),_0x594bc7['items']['addMany'](_0x457081),_0x125e20['panelView']['children']['add'](_0x594bc7),_0x3c3d0c['children']['add'](_0x125e20),_0x28f67c['items']['add'](_0x3c3d0c);}),_0xab045['panelView']['children']['add'](_0x28f67c);}['_getMenuBarGroupButtons']({command:_0x339efb,commands:_0x517602,parentMenuView:_0x2b18e0,onExecute:_0x32c342}){const _0x36212e=this['editor'],_0x44de13=_0x36212e['locale'];return U(_0x36212e,_0x517602)['map'](_0x259cef=>{const _0x294650=new _0x48fceb(_0x44de13,_0x2b18e0),_0x3b7604=new _0x53d973(_0x44de13);return _0x3b7604['set']({'label':_0x259cef['label']}),_0x3b7604['delegate']('execute')['to'](_0x2b18e0),_0x3b7604['on']('execute',()=>_0x32c342(_0x259cef['id'])),_0x3b7604['bind']('isEnabled')['to'](_0x339efb,'enabledCommandsIds',_0x4404ce=>_0x4404ce['includes'](_0x259cef['id'])),_0x294650['children']['add'](_0x3b7604),_0x294650;});}}function B(_0x36828a,_0x4cb601){return void 0x0!==_0x36828a['order']&&void 0x0===_0x4cb601['order']?0x1:void 0x0===_0x36828a['order']&&void 0x0!==_0x4cb601['order']?-0x1:void 0x0!==_0x36828a['order']&&void 0x0!==_0x4cb601['order']?_0x36828a['order']-_0x4cb601['order']:0x0;}function U(_0x371598,_0xc9dffe){_0xc9dffe['sort'](B);const _0x2ce23f={},_0x1f0484=[];for(const _0x50f005 of _0xc9dffe)if(void 0x0!==_0x50f005['order']){if(_0x50f005['order']in _0x2ce23f)throw new _0x1ed59c('ai-commands-config-order-collision',_0x371598,{'conflictingDefinitions':[_0x50f005,_0x2ce23f[_0x50f005['order']]]});_0x2ce23f[_0x50f005['order']]=_0x50f005,_0x1f0484['splice'](_0x50f005['order'],0x0,_0x50f005);}else _0x1f0484['push'](_0x50f005);return _0x1f0484;}class r extends _0x24e675{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x50a8dd){super(_0x50a8dd);const _0x556a69=_0x50a8dd['config'],_0x3d8ce5=_0x50a8dd['locale'];_0x556a69['define']('ai.aiAssistant.preserveComments',!0x0),_0x556a69['define']('ai.aiAssistant.commands',function(_0x13c615){return[{'groupId':'editOrReview','groupLabel':i(_0x13c615,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x13c615,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x13c615,'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(_0x13c615,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x13c615,'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(_0x13c615,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x13c615,'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(_0x13c615,'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(_0x13c615,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x13c615,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x13c615,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x13c615,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x13c615,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x13c615,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x13c615,'Change\x20style'),'commands':[{'id':'business','label':i(_0x13c615,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x13c615,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x13c615,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x13c615,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x13c615,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x13c615,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x13c615,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x13c615,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x13c615,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x13c615,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x13c615,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x13c615,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x13c615,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x3d8ce5)),_0x556a69['define']('ai.aiAssistant.extraCommandGroups',[]),_0x556a69['define']('ai.aiAssistant.removeCommands',[]);let _0x5852ec=o(_0x556a69['get']('ai.aiAssistant.commands'),_0x3d8ce5);const _0x551449=_0x556a69['get']('ai.aiAssistant.extraCommandGroups'),_0x11e5fd=_0x556a69['get']('ai.aiAssistant.removeCommands');_0x551449['forEach'](_0x11da43=>{const _0xc52b6e=_0x5852ec['find'](_0x52179f=>_0x52179f['groupId']===_0x11da43['groupId']);_0xc52b6e?_0xc52b6e['commands']=_0xc52b6e['commands']['concat'](_0x11da43['commands']):_0x5852ec['push'](_0x11da43);}),_0x5852ec=_0x5852ec['filter'](_0x309341=>!_0x11e5fd['includes'](_0x309341['groupId'])),_0x5852ec['forEach'](_0x10c7f2=>{_0x10c7f2['commands']=_0x10c7f2['commands']['filter'](_0x5769c6=>!_0x11e5fd['includes'](_0x5769c6['id']));}),_0x556a69['set']('ai.aiAssistant.commands',_0x5852ec);}}class P extends _0x24e675{['abortController'];static get['requires'](){return[E];}constructor(_0x275dc5){super(_0x275dc5),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x18d65b){return this['sendRequest'](_0x18d65b)['catch'](_0x45b9c1=>{if(_0x45b9c1 instanceof R)return Promise['reject'](_0x45b9c1);if('AbortError'==_0x45b9c1['name'])return Promise['resolve']();throw console['error'](_0x45b9c1),new _0x1ed59c('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0xbb5e3,_0x488f6e){const _0xd71cf=this['editor']['locale'],_0x61ad5a={'Content-Type':'application/json'};if('object'==typeof _0xbb5e3)Object['assign'](_0x61ad5a,_0xbb5e3);else{if(_0xbb5e3)try{const _0xecd46a=await _0xbb5e3(_0x488f6e);Object['assign'](_0x61ad5a,_0xecd46a);}catch{return Promise['reject'](new R(i(_0xd71cf,'AI_ERROR_GET_HEADERS')));}}return _0x61ad5a;}async['_prepareRequestParameters'](_0x141923,_0x4c4afc){const _0x58d2f7=this['editor']['locale'];if('object'==typeof _0x141923)return _0x141923;try{return await _0x141923(_0x4c4afc);}catch{return Promise['reject'](new R(i(_0x58d2f7,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4d6f38){super(_0x4d6f38),_0x4d6f38['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4d6f38['config']['get']('ai.openAI.requestParameters')||_0x4d6f38['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4d6f38['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x4d6f38['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x4d6f38['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x172508,context:_0x164968,onData:_0x249369,actionId:_0x523ae6}){const _0x403853=this['editor']['locale'],_0x46366d=await this['prepareMessages'](_0x172508,_0x164968,_0x523ae6),_0xb821a0=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x523ae6),_0x1d9f05=await this['_prepareRequestParameters'](this['_requestParameters'],_0x523ae6),_0x38a6a1={'messages':_0x46366d,..._0x1d9f05},_0x4d3b07={'method':'POST','headers':_0xb821a0,'body':JSON['stringify'](_0x38a6a1),'signal':this['abortController']['signal']},_0x45211d=await fetch(this['_apiUrl'],_0x4d3b07);if(_0x45211d['ok'])return _0x1d9f05['stream']?await this['_readStreamableResponse'](_0x45211d,_0x249369):await this['_readStaticResponse'](_0x45211d,_0x249369),Promise['resolve']();{const _0x43c4f9=await _0x45211d['text']();return _0x43c4f9['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x403853,'AI_ERROR_CONTEXT_LENGTH'))):_0x43c4f9['includes']('Moderation')?Promise['reject'](new R(i(_0x403853,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x43c4f9));}}async['prepareMessages'](_0xaf5df7,_0xfd04d1,_0x38a13c){let _0x3a6585,_0x5e2c99;return _0xfd04d1?(_0x3a6585='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.',_0x5e2c99='Instruction:\x0a'+_0xaf5df7+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xfd04d1):(_0x3a6585='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.',_0x5e2c99=_0xaf5df7),[{'role':'system','content':_0x3a6585},{'role':'user','content':_0x5e2c99}];}async['_readStreamableResponse'](_0x17e347,_0x34fb10){const _0x3151c7=_0x17e347['body']['getReader'](),_0x353ca8=new TextDecoder();let _0x2b0066='',_0x3baa86='',_0x249d50='',_0x5571ad=!0x1;for(;!_0x5571ad;){const {done:_0x893266,value:_0x59e2cc}=await _0x3151c7['read'](),_0xa1422=_0x2b0066+_0x353ca8['decode'](_0x59e2cc);let _0x97e865='';_0x5571ad=_0x893266;try{_0x97e865=this['_cleanUpData'](_0xa1422),_0x2b0066='';}catch{_0x2b0066=_0xa1422;continue;}_0x3baa86+=_0x97e865,!_0x5571ad&&this['_isBufferIncomplete'](_0x3baa86)||_0x3baa86&&(_0x249d50+=_0x3baa86,_0x3baa86='',_0x34fb10(_0x249d50));}return Promise['resolve']();}async['_readStaticResponse'](_0x39b563,_0x123e63){return _0x123e63((await _0x39b563['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4fef27){const _0x536ba5=_0x4fef27['split']('<')['length']!==_0x4fef27['split']('>')['length'],_0x38270a=_0x4fef27['length']<0x1e;return _0x536ba5&&_0x38270a;}['_cleanUpData'](_0x3f6f0f){return _0x3f6f0f['split'](/\n(?![^{]*\})/g)['map'](_0x4b9231=>_0x4b9231['replace']('data:\x20',''))['filter'](_0x4adc13=>_0x4adc13&&_0x4adc13['length']>0x0&&'[DONE]'!==_0x4adc13)['map'](_0x596b3e=>{const {choices:_0x13ee5c}=JSON['parse'](_0x596b3e);if(_0x13ee5c[0x0]?.['delta']?.['content'])return _0x13ee5c[0x0]['delta']['content'];})['filter'](_0x549c85=>_0x549c85)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x1db43b){super(_0x1db43b),_0x1db43b['config']['get']('ai.aws.requestParameters')||_0x1db43b['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']=_0x1db43b['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x1db43b['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x1db43b['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x1db43b['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x314d5a,context:_0x33f1ba,onData:_0x2e02e6,actionId:_0x608371}){const {model:_0x36ff45,stream:_0x3176a8,..._0x5e9e71}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x608371),_0x2ea8ce={'prompt':await this['preparePrompt'](_0x314d5a,_0x33f1ba,_0x36ff45,_0x608371),..._0x5e9e71};this['_apiUrl']?await this['_processProxyRequest'](_0x2ea8ce,_0x36ff45,_0x3176a8,_0x2e02e6,_0x608371):await this['_processAWSRequest'](_0x2ea8ce,_0x36ff45,_0x3176a8,_0x2e02e6);}async['preparePrompt'](_0x435598,_0x553578,_0x1346af,_0x1642b5){let _0x2d73bc,_0xcae957;return _0x553578?(_0x2d73bc='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.',_0xcae957='Instruction:\x0a'+_0x435598+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x553578):(_0x2d73bc='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.',_0xcae957=_0x435598),'meta.llama'==this['getModelFamily'](_0x1346af)?'<<SYS>>\x0a'+_0x2d73bc+'\x0a<</SYS>>\x0a[INST]\x0a'+_0xcae957+'\x0a[/INST]':'Human:\x0a'+_0x2d73bc+'\x0a'+_0xcae957+'\x0a\x0aAssistant:';}['getModelFamily'](_0x331789){if(/^anthropic\.claude/['test'](_0x331789))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x331789))return'ai21.j2';if(/^cohere\.command/['test'](_0x331789))return'cohere.command';if(/^meta\.llama/['test'](_0x331789))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x331789));}async['_processProxyRequest'](_0x4d098a,_0x45bcc6,_0x4d6d69,_0x4f4bf3,_0x29c77b){const _0x2d46fb={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x29c77b),'body':JSON['stringify']({..._0x4d098a,'model':_0x45bcc6,'stream':_0x4d6d69}),'signal':this['abortController']['signal']},_0x24c85f=await fetch(this['_apiUrl'],_0x2d46fb);_0x4d6d69?await this['_readStreamableResponse'](_0x24c85f,_0x45bcc6,_0x4f4bf3):await this['_readStaticResponse'](_0x24c85f,_0x45bcc6,_0x4f4bf3);}async['_processAWSRequest'](_0x387829,_0x132b16,_0xf22b56,_0x58be0c){const _0x3ca7b2=new _0x4967b9(this['_bedrockClientConfig']),_0x390141={'body':JSON['stringify'](_0x387829),'contentType':'application/json','accept':'application/json','modelId':_0x132b16};let _0x53dd8c;if(_0xf22b56){const _0x3fe79f=new _0x49e8cb(_0x390141);_0x53dd8c=await _0x3ca7b2['send'](_0x3fe79f,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x53dd8c,_0x132b16,_0x58be0c);}else{const _0x157e44=new _0x13fb25(_0x390141);_0x53dd8c=await _0x3ca7b2['send'](_0x157e44,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x53dd8c,_0x132b16,_0x58be0c);}}async['_readAsyncIterableResponse'](_0x5a00d7,_0x11d525,_0xb085bc){const _0xb49ae9=_0x5a00d7['body'],_0x44acad=new TextDecoder('utf-8');let _0x4d87fd='';for await(const _0x83f821 of _0xb49ae9)if(_0x83f821['chunk']){const _0x2e795b=_0x44acad['decode'](_0x83f821['chunk']['bytes']),_0x553beb=JSON['parse'](_0x2e795b);_0x4d87fd+=this['_getGeneratedText'](_0x553beb,_0x11d525),_0xb085bc(_0x4d87fd);}return Promise['resolve']();}async['_readStreamableResponse'](_0x5c96a4,_0x2c1dfa,_0x5711af){const _0x6ec2d0=_0x5c96a4['body'],_0x275790=new TextDecoder('utf-8'),_0x23d06f=_0x6ec2d0['getReader']();let _0xffc3ff='',_0x57b818='',_0x566892=!0x1;for(;!_0x566892;){const {done:_0x2eaa47,value:_0x1ab6db}=await _0x23d06f['read']();if(_0x566892=_0x2eaa47,_0x566892)break;const _0x3c969e=(_0xffc3ff+_0x275790['decode'](_0x1ab6db))['split']('\x0a')['map'](_0x3a98e6=>{try{return _0xffc3ff='',JSON['parse'](_0x3a98e6);}catch{return _0xffc3ff=_0x3a98e6,null;}})['filter'](_0x8eff9c=>null!==_0x8eff9c);_0x3c969e['length']&&(_0x57b818+=_0x3c969e['map'](_0x37dc4a=>this['_getGeneratedText'](_0x37dc4a,_0x2c1dfa))['join'](''),_0x5711af(_0x57b818));}return Promise['resolve']();}async['_readStaticResponse'](_0x19ea9a,_0xf56c85,_0x2e12ca){let _0x256d33;return _0x256d33=_0x19ea9a instanceof Response?await _0x19ea9a['json']():JSON['parse'](Buffer['from'](_0x19ea9a['body'])['toString']('utf8')),(_0x2e12ca(this['_getGeneratedText'](_0x256d33,_0xf56c85)),Promise['resolve']());}['_getGeneratedText'](_0x544e28,_0x4384e3){switch(this['getModelFamily'](_0x4384e3)){case'anthropic.claude':return _0x544e28['completion'];case'ai21.j2':return _0x544e28['completions'][0x0]['data']['text'];case'cohere.command':return _0x544e28['generations'][0x0]['text'];case'meta.llama':return _0x544e28['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-ai",
|
|
3
|
-
"version": "45.2.0-alpha.
|
|
3
|
+
"version": "45.2.0-alpha.4",
|
|
4
4
|
"description": "AI Assistant feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@aws-sdk/client-bedrock-runtime": "3.621.0",
|
|
27
|
-
"@ckeditor/ckeditor5-clipboard": "45.2.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-core": "45.2.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-engine": "45.2.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-icons": "45.2.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-table": "45.2.0-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-ui": "45.2.0-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-utils": "45.2.0-alpha.
|
|
34
|
-
"ckeditor5": "45.2.0-alpha.
|
|
27
|
+
"@ckeditor/ckeditor5-clipboard": "45.2.0-alpha.4",
|
|
28
|
+
"@ckeditor/ckeditor5-core": "45.2.0-alpha.4",
|
|
29
|
+
"@ckeditor/ckeditor5-engine": "45.2.0-alpha.4",
|
|
30
|
+
"@ckeditor/ckeditor5-icons": "45.2.0-alpha.4",
|
|
31
|
+
"@ckeditor/ckeditor5-table": "45.2.0-alpha.4",
|
|
32
|
+
"@ckeditor/ckeditor5-ui": "45.2.0-alpha.4",
|
|
33
|
+
"@ckeditor/ckeditor5-utils": "45.2.0-alpha.4",
|
|
34
|
+
"ckeditor5": "45.2.0-alpha.4",
|
|
35
35
|
"es-toolkit": "1.32.0"
|
|
36
36
|
},
|
|
37
37
|
"type": "module",
|