@ckeditor/ckeditor5-ai 0.0.0-nightly-20231123.0 → 0.0.0-nightly-20231124.0
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/package.json +3 -3
- package/src/aiassistant.js +1 -1
- package/src/aiassistantediting.js +1 -1
- package/src/aiassistantui.js +1 -1
- package/src/aiconnector.js +1 -1
- package/src/ui/aiassistantcontroller.js +1 -1
- package/src/ui/dropdown/aicommandslistview.js +1 -1
- package/src/ui/dropdown/buttonlabelwithhighlightview.js +1 -1
- package/src/ui/dropdown/labelwithhighlightview.js +1 -1
- package/src/ui/form/aiformcontentarea.js +1 -1
- package/src/ui/form/aiformerrorview.js +1 -1
- package/src/ui/form/aiformpromptview.js +1 -1
- package/src/ui/form/aiformtoolbarview.js +1 -1
- package/src/ui/form/aiformview.js +1 -1
- package/src/ui/form/aihistorylistitemview.js +1 -1
- package/src/ui/form/aihistorylistview.js +1 -1
- package/src/ui/form/prompthistory.js +1 -1
- package/src/ui/showaiassistantcommand.js +1 -1
- package/src/utils/common-translations.js +1 -1
package/src/aiconnector.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x5357=['rename','Authorization','AI_ERROR_AUTH_REQUEST','max_tokens','join','Instruction:\x0a','choices','json','POST','AIConnector','https://api.openai.com/v1/chat/completions','_parseAndNormalizeContent','Moderation','temperature','_apiUrl','error','processPrompt','serializeToString','AI_ERROR_CONTEXT_LENGTH','name','_normalizeResponseHeadings','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.','delta','adapter','abort','decode','define','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.','resolve','editor','filter','aiAssistant.requestParameters.stream','document','string','push','locale','top_p','stream','read','user','split','text/html','stringify','message','_cleanUpData','length','[DONE]','element','_prepareMessages','aiAssistant.requestParameters.top_p','includes','AIRequestError','replace','aiAssistant','_requestParameters','data:\x20','data','content','system','gpt-3.5-turbo','aborted','Bearer\x20','aiconnector-send-prompt-failed','processor','authKey','model','_readStaticResponse','pluginName','editing','toModel','aiAssistant.requestParameters.temperature','_abortController','\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a','_domParser','signal','startsWith','get','body','parse','AI_ERROR_MODERATION','_readStreamableResponse','sendPrompt','_authKey','_isBufferIncomplete','config','aiAssistant.apiUrl','reject'];(function(_0x20b061,_0x535770){const _0x3073fe=function(_0x139457){while(--_0x139457){_0x20b061['push'](_0x20b061['shift']());}};_0x3073fe(++_0x535770);}(_0x5357,0xed));const _0x3073=function(_0x20b061,_0x535770){_0x20b061=_0x20b061-0x0;let _0x3073fe=_0x5357[_0x20b061];return _0x3073fe;};import{Matcher as _0x58a4e2,UpcastWriter as _0x3c2952}from'ckeditor5/src/engine';import{Plugin as _0x2453ff}from'ckeditor5/src/core';import{CKEditorError as _0x1041d2}from'ckeditor5/src/utils';import{getTranslation as _0x5c3586}from'./utils/common-translations';export default class o extends _0x2453ff{static get[_0x3073('0x4')](){return _0x3073('0x21');}constructor(_0x2bf5ed){super(_0x2bf5ed),_0x2bf5ed[_0x3073('0x15')][_0x3073('0x32')](_0x3073('0x16'),_0x3073('0x22')),_0x2bf5ed['config'][_0x3073('0x32')]('aiAssistant.requestParameters.model',_0x3073('0x53')),_0x2bf5ed['config'][_0x3073('0x32')]('aiAssistant.requestParameters.max_tokens',0x7d0),_0x2bf5ed['config'][_0x3073('0x32')](_0x3073('0x7'),0x1),_0x2bf5ed[_0x3073('0x15')][_0x3073('0x32')](_0x3073('0x49'),0x1),_0x2bf5ed['config'][_0x3073('0x32')](_0x3073('0x37'),!0x0);const _0x457faf=_0x2bf5ed[_0x3073('0x15')]['get'](_0x3073('0x16')),_0x18d6f3=_0x2bf5ed[_0x3073('0x15')]['get'](_0x3073('0x4d'))[_0x3073('0x1')],_0x33d5bf=_0x2bf5ed[_0x3073('0x15')][_0x3073('0xd')]('aiAssistant.requestParameters');this[_0x3073('0x8')]=new AbortController(),this[_0x3073('0x2f')]=new OpenAIAdapter(_0x2bf5ed,_0x457faf,_0x33d5bf,_0x18d6f3);}async[_0x3073('0x28')](_0x18a37d,_0x2a0853,_0x507ef9){const {systemMessage:_0x5e6a5c,userMessage:_0x11d248}=this[_0x3073('0x48')](_0x18a37d,_0x2a0853);return this[_0x3073('0x2f')]['sendPrompt'](_0x5e6a5c,_0x11d248,this['_abortController'][_0x3073('0xb')],_0x507ef9)['catch'](_0x2e52b9=>{if(_0x2e52b9 instanceof AIRequestError)return Promise[_0x3073('0x17')](_0x2e52b9);if('AbortError'==_0x2e52b9['name'])return Promise[_0x3073('0x34')]();throw console[_0x3073('0x27')](_0x2e52b9),new _0x1041d2(_0x3073('0x56'),null);});}[_0x3073('0x30')](){this['_abortController'][_0x3073('0xb')][_0x3073('0x54')]||(this['_abortController'][_0x3073('0x30')](),this[_0x3073('0x8')]=new AbortController());}[_0x3073('0x48')](_0x51a036,_0x1f8fa6){let _0x237fbf,_0x585d62;return _0x1f8fa6?(_0x237fbf=_0x3073('0x33'),_0x585d62=_0x3073('0x1d')+_0x51a036+_0x3073('0x9')+(_0x1f8fa6[_0x3073('0xc')]('<')?_0x1f8fa6:'<span>'+_0x1f8fa6+'</span>')):(_0x237fbf=_0x3073('0x2d'),_0x585d62=_0x51a036),{'systemMessage':_0x237fbf,'userMessage':_0x585d62};}}export class OpenAIAdapter{constructor(_0x178ffa,_0x2980ed,_0x1134d6,_0x3f22e2){this[_0x3073('0x35')]=_0x178ffa,this[_0x3073('0x26')]=_0x2980ed,this['_authKey']=_0x3f22e2,this['_requestParameters']=_0x1134d6,this[_0x3073('0xa')]=new DOMParser(),this['_xmlSerializer']=new XMLSerializer();}async[_0x3073('0x12')](_0x153a02,_0x4d8058,_0x2e917f,_0x53e0ea){const _0x490919=this['editor'][_0x3073('0x3b')],_0x5d1336={'Content-Type':'application/json'};if(_0x3073('0x39')==typeof this[_0x3073('0x13')])_0x5d1336[_0x3073('0x19')]=_0x3073('0x55')+this[_0x3073('0x13')];else{if(this[_0x3073('0x13')])try{const _0x1d3aa8=await this[_0x3073('0x13')]();_0x5d1336[_0x3073('0x19')]=_0x3073('0x55')+_0x1d3aa8;}catch(_0x48148b){return Promise[_0x3073('0x17')](new AIRequestError(_0x5c3586(_0x490919,_0x3073('0x1a'))));}}const _0xb5225e={'model':this['_requestParameters'][_0x3073('0x2')],'messages':[{'role':_0x3073('0x52'),'content':_0x153a02},{'role':_0x3073('0x3f'),'content':_0x4d8058}],'stream':this[_0x3073('0x4e')][_0x3073('0x3d')],'max_tokens':this[_0x3073('0x4e')][_0x3073('0x1b')],'temperature':this[_0x3073('0x4e')][_0x3073('0x25')],'top_p':this['_requestParameters'][_0x3073('0x3c')]};this[_0x3073('0x4e')][_0x3073('0x3f')]&&(_0xb5225e[_0x3073('0x3f')]=this[_0x3073('0x4e')]['user']);const _0x9ee9cf={'method':_0x3073('0x20'),'headers':_0x5d1336,'body':JSON[_0x3073('0x42')](_0xb5225e),'signal':_0x2e917f},_0x15a3bd=await fetch(this['_apiUrl'],_0x9ee9cf);if(_0x15a3bd['ok'])return this[_0x3073('0x4e')]['stream']?await this[_0x3073('0x11')](_0x15a3bd,_0x53e0ea):await this[_0x3073('0x3')](_0x15a3bd,_0x53e0ea),Promise['resolve']();{const _0x1f6886=await _0x15a3bd['text']();return _0x1f6886[_0x3073('0x4a')]('context_length_exceeded')?Promise[_0x3073('0x17')](new AIRequestError(_0x5c3586(_0x490919,_0x3073('0x2a')))):_0x1f6886['includes'](_0x3073('0x24'))?Promise[_0x3073('0x17')](new AIRequestError(_0x5c3586(_0x490919,_0x3073('0x10')))):Promise[_0x3073('0x17')](new Error(_0x1f6886));}}async[_0x3073('0x11')](_0x28a0df,_0x1b3578){const _0x197289=_0x28a0df[_0x3073('0xe')]['getReader'](),_0x1e9ebd=new TextDecoder();let _0x30b635='',_0x55e165='',_0x4ade8b='',_0x484fab=!0x1;for(;!_0x484fab;){const {done:_0x4807e3,value:_0x5e0350}=await _0x197289[_0x3073('0x3e')](),_0x16e508=_0x30b635+_0x1e9ebd[_0x3073('0x31')](_0x5e0350);let _0x302ebb='';_0x484fab=_0x4807e3;try{_0x302ebb=this[_0x3073('0x44')](_0x16e508),_0x30b635='';}catch(_0x3f0478){_0x30b635=_0x16e508;continue;}_0x55e165+=_0x302ebb,!_0x4807e3&&this[_0x3073('0x14')](_0x55e165)||_0x55e165&&(_0x4ade8b+=_0x55e165,_0x1b3578(this['_parseAndNormalizeContent'](_0x4ade8b)),_0x55e165='');}return Promise[_0x3073('0x34')]();}async[_0x3073('0x3')](_0x57f59b,_0x23627b){const _0x18d5e9=(await _0x57f59b[_0x3073('0x1f')]())[_0x3073('0x1e')][0x0][_0x3073('0x43')][_0x3073('0x51')];return _0x23627b(this[_0x3073('0x23')](_0x18d5e9)),Promise[_0x3073('0x34')]();}[_0x3073('0x14')](_0x583dbe){const _0x476c1a=_0x583dbe[_0x3073('0x40')]('<')[_0x3073('0x45')]!==_0x583dbe[_0x3073('0x40')]('>')[_0x3073('0x45')],_0x121474=_0x583dbe[_0x3073('0x45')]<0x1e;return _0x476c1a&&_0x121474;}[_0x3073('0x23')](_0x17dbdf){const _0x1abdab=this['_domParser']['parseFromString'](_0x17dbdf,_0x3073('0x41')),_0x4553fa=this[_0x3073('0x35')]['data'][_0x3073('0x0')]['toView'](this['_xmlSerializer'][_0x3073('0x29')](_0x1abdab['body']));return this[_0x3073('0x2c')](_0x4553fa),this[_0x3073('0x35')][_0x3073('0x50')]['stringify'](this['editor'][_0x3073('0x50')][_0x3073('0x6')](_0x4553fa));}[_0x3073('0x2c')](_0x39f11e){const _0x5efe76=new _0x3c2952(this[_0x3073('0x35')][_0x3073('0x5')]['view'][_0x3073('0x38')]),_0x47437c=new _0x58a4e2({'name':/^h[1-5]$/}),_0x48808f=[];let _0x30c5e4=!0x1;for(const _0x36df4e of _0x39f11e)_0x36df4e['is'](_0x3073('0x47'))&&_0x47437c['match'](_0x36df4e)&&(_0x48808f[_0x3073('0x3a')](_0x36df4e),'h1'==_0x36df4e[_0x3073('0x2b')]&&(_0x30c5e4=!0x0));if(_0x30c5e4)for(const _0x132f41 of _0x48808f)_0x5efe76[_0x3073('0x18')]('h'+(parseInt(_0x132f41[_0x3073('0x2b')][0x1])+0x1),_0x132f41);}[_0x3073('0x44')](_0x344ee6){return _0x344ee6[_0x3073('0x40')](/\n(?![^{]*\})/g)['map'](_0x58a5ee=>_0x58a5ee[_0x3073('0x4c')](_0x3073('0x4f'),''))[_0x3073('0x36')](_0xe6ac1e=>_0xe6ac1e&&_0xe6ac1e[_0x3073('0x45')]>0x0&&_0x3073('0x46')!==_0xe6ac1e)['map'](_0x5b4acb=>{const {choices:_0x2200d3}=JSON[_0x3073('0xf')](_0x5b4acb);if(_0x2200d3[0x0]&&_0x2200d3[0x0][_0x3073('0x2e')]&&_0x2200d3[0x0]['delta'][_0x3073('0x51')])return _0x2200d3[0x0][_0x3073('0x2e')][_0x3073('0x51')];})[_0x3073('0x36')](_0x1a85bb=>_0x1a85bb)[_0x3073('0x1c')]('');}}export class AIRequestError extends Error{constructor(_0x1152aa){super(_0x1152aa),this[_0x3073('0x2b')]=_0x3073('0x4b');}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x5071=['div','processPrompt','isRendered','createElement','abort','editing','editor','bind','previousPrompt','once','finishProcessing','_sanitizeHTML','listenTo','stopProcessing','destroy','mainAction','initialContext','_updateValue','reset','set','prompt','domConverter','_sanitizationContainer','currentContext','message','_handlePrompt','updateView','isProcessing','view','handleError','submitPrompt','connector','value','render','previousContext','previousLabel'];(function(_0x99c626,_0x507115){const _0x438598=function(_0x55986b){while(--_0x55986b){_0x99c626['push'](_0x99c626['shift']());}};_0x438598(++_0x507115);}(_0x5071,0x8c));const _0x4385=function(_0x99c626,_0x507115){_0x99c626=_0x99c626-0x0;let _0x438598=_0x5071[_0x99c626];return _0x438598;};import{ObservableMixin as _0x47af75}from'ckeditor5/src/utils';import{AIRequestError as _0x1af2e4}from'../aiconnector';export default class g extends _0x47af75(){constructor(_0x4ff858,_0x14e47f,_0x27597c){super(),this[_0x4385('0xa')]=_0x4ff858,this['connector']=_0x14e47f,this[_0x4385('0x1a')]=document[_0x4385('0x7')](_0x4385('0x4')),this['view']=_0x27597c,this[_0x4385('0x17')]({'initialContext':'','currentContext':'','previousContext':void 0x0,'previousPrompt':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['view'][_0x4385('0xb')](_0x4385('0x0'))['to'](this,'currentContext',this['_sanitizeHTML'][_0x4385('0xb')](this)),this['listenTo'](this['view'],_0x4385('0x22'),(_0x28a722,_0x3ba38c)=>{const _0x240c07=this[_0x4385('0x1b')]||this[_0x4385('0x14')];this[_0x4385('0x1d')](_0x3ba38c,_0x240c07);}),this[_0x4385('0x10')](this[_0x4385('0x20')],'tryAgainEvent',()=>{this[_0x4385('0x20')][_0x4385('0x18')]=this[_0x4385('0x3')],this[_0x4385('0x1d')](this[_0x4385('0xc')],this[_0x4385('0x2')],this[_0x4385('0x3')]);}),this['listenTo'](this[_0x4385('0x20')],_0x4385('0x11'),()=>{this[_0x4385('0x11')]();});}[_0x4385('0x12')](){this['stopListening']();}async[_0x4385('0x1e')]({prompt:_0x1daaff,htmlContent:_0x4d01d6,label:_0x341e75,mainAction:_0x9c4632}){this[_0x4385('0x20')]['prompt']=_0x341e75,this[_0x4385('0x20')][_0x4385('0x13')]=_0x9c4632,this['initialContext']=_0x4d01d6,_0x1daaff&&(this[_0x4385('0x20')][_0x4385('0x6')]?this[_0x4385('0x1d')](_0x1daaff,_0x4d01d6,_0x341e75):this['view'][_0x4385('0xd')](_0x4385('0x1'),()=>{this[_0x4385('0x1d')](_0x1daaff,_0x4d01d6,_0x341e75);}));}[_0x4385('0x11')](){this[_0x4385('0x1f')]&&(this[_0x4385('0x1f')]=!0x1,this[_0x4385('0x20')][_0x4385('0xe')](),this[_0x4385('0x23')][_0x4385('0x8')]());}['reset'](){this[_0x4385('0x14')]='',this[_0x4385('0x1b')]='',this[_0x4385('0x2')]='',this[_0x4385('0xc')]='',this['previousLabel']='',this[_0x4385('0x20')][_0x4385('0x16')](),this[_0x4385('0x11')]();}async[_0x4385('0x1d')](_0x503cdd,_0x42925e,_0x4f2117){return this[_0x4385('0x1f')]=!0x0,this[_0x4385('0x20')]['startProcessing'](),this[_0x4385('0x2')]=_0x42925e,this['previousPrompt']=_0x503cdd,this['previousLabel']=_0x4f2117||_0x503cdd,new Promise(_0x6ddf54=>{this[_0x4385('0x23')][_0x4385('0x5')](_0x503cdd,_0x42925e,_0x1cdea1=>this[_0x4385('0x15')](_0x1cdea1))['catch'](_0x5123fb=>{_0x5123fb instanceof _0x1af2e4?this[_0x4385('0x20')][_0x4385('0x21')](_0x5123fb[_0x4385('0x1c')]):this[_0x4385('0x20')][_0x4385('0x21')](),_0x6ddf54();})['finally'](()=>{this[_0x4385('0x11')](),_0x6ddf54();});});}[_0x4385('0x15')](_0x3ca18d){this[_0x4385('0x1b')]=''+_0x3ca18d;}[_0x4385('0xf')](_0x41d308){return this[_0x4385('0xa')][_0x4385('0x9')][_0x4385('0x20')][_0x4385('0x19')]['setContentOf'](this['_sanitizationContainer'],_0x41d308),this[_0x4385('0x1a')]['innerHTML'];}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x58ff=['children','first','match','isVisible','filter','label','highlightText','labelView','length','items'];(function(_0x3489d1,_0x58ff09){const _0x521ee0=function(_0x3f2fe2){while(--_0x3f2fe2){_0x3489d1['push'](_0x3489d1['shift']());}};_0x521ee0(++_0x58ff09);}(_0x58ff,0x140));const _0x521e=function(_0x3489d1,_0x58ff09){_0x3489d1=_0x3489d1-0x0;let _0x521ee0=_0x58ff[_0x3489d1];return _0x521ee0;};import{ListView as _0x1f7cb6}from'ckeditor5/src/ui';export default class y extends _0x1f7cb6{[_0x521e('0x4')](_0x489b4f){let _0x1a670b=0x0,_0x6f6d84=0x0;for(const _0x2c0a46 of this[_0x521e('0x9')]){const _0x429f72=_0x2c0a46,_0x164fa7=_0x489b4f&&!!_0x429f72[_0x521e('0x5')][_0x521e('0x2')](_0x489b4f);_0x429f72[_0x521e('0x7')]['highlightText'](_0x164fa7?_0x489b4f:null);for(const _0x2919c2 of _0x429f72[_0x521e('0x9')]){const _0x53d332=_0x2919c2[_0x521e('0x0')][_0x521e('0x1')],_0x1aeef7=_0x53d332[_0x521e('0x7')];if(_0x489b4f){const _0x417cb0=!!_0x53d332[_0x521e('0x5')]['match'](_0x489b4f);_0x1aeef7['highlightText'](_0x417cb0?_0x489b4f:null),_0x2919c2['isVisible']=_0x164fa7||_0x417cb0;}else _0x2919c2[_0x521e('0x3')]=!0x0,_0x1aeef7[_0x521e('0x6')](null);}const _0x1730b5=_0x429f72[_0x521e('0x9')][_0x521e('0x4')](_0x3596f2=>_0x3596f2['isVisible'])[_0x521e('0x8')];_0x1a670b+=_0x429f72[_0x521e('0x9')][_0x521e('0x8')],_0x6f6d84+=_0x164fa7?_0x429f72[_0x521e('0x9')]['length']:_0x1730b5,_0x429f72[_0x521e('0x3')]=_0x164fa7||!!_0x1730b5;}return{'resultsCount':_0x6f6d84,'totalItemsCount':_0x1a670b};}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x106b=['extendTemplate','style','set'];(function(_0x261993,_0x106b45){const _0x30856d=function(_0x15f2c4){while(--_0x15f2c4){_0x261993['push'](_0x261993['shift']());}};_0x30856d(++_0x106b45);}(_0x106b,0x104));const _0x3085=function(_0x261993,_0x106b45){_0x261993=_0x261993-0x0;let _0x30856d=_0x106b[_0x261993];return _0x30856d;};import{HighlightedTextView as _0x58594d}from'ckeditor5/src/ui';export default class C extends _0x58594d{constructor(){super(),this[_0x3085('0x0')]({'style':void 0x0,'text':void 0x0,'id':void 0x0});const _0x4ddbb9=this['bindTemplate'];this[_0x3085('0x1')]({'attributes':{'class':['ck-button__label'],'style':_0x4ddbb9['to'](_0x3085('0x2')),'id':_0x4ddbb9['to']('id')}});}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x589b=['bindTemplate','extendTemplate','ck-label','for'];(function(_0x45b1a6,_0x589b8e){const _0x8a851e=function(_0xd57259){while(--_0xd57259){_0x45b1a6['push'](_0x45b1a6['shift']());}};_0x8a851e(++_0x589b8e);}(_0x589b,0x189));const _0x8a85=function(_0x45b1a6,_0x589b8e){_0x45b1a6=_0x45b1a6-0x0;let _0x8a851e=_0x589b[_0x45b1a6];return _0x8a851e;};import{HighlightedTextView as _0x22b7c8}from'ckeditor5/src/ui';import{uid as _0x540385}from'ckeditor5/src/utils';export default class k extends _0x22b7c8{constructor(){super(),this['set'](_0x8a85('0x2'),void 0x0);const _0x5e4608=this[_0x8a85('0x3')];this['id']='ck-editor__label_'+_0x540385(),this[_0x8a85('0x0')]({'attributes':{'class':['ck',_0x8a85('0x1')],'id':this['id'],'for':_0x5e4608['to'](_0x8a85('0x2'))}});}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x48af=['focus','locale','textContent','AI\x20is\x20writing...','appendChild','absolute','createElement','loaderView','isVisible','text/plain','div','bind','ck-content','getSelection','copyButtonView','_copyHTMLToClipboard','class','body','position','element','mousedown','icon','isProcessing','ck-hidden','style','ck-ai-form__copy-button-wrapper','remove','innerHTML','left','setContent','setStartAfter','ck-ai-form__content-area--processing','ck-ai-form__loader','isEnabled','render','check','<span>[</span>','\x20ck-ai-form__copy-button--copied','ck-ai-form__copy-button','ck-ai-form__content-area','contentFieldView','value','set','setTemplate','copy','clipboard','_createLoader','lastElementChild','appendLoader','addRange','_createCopyButton','ck-ai-form__content-area-wrapper','smooth','Copy','execute','<span>]</span>','text/html','-9999px'];(function(_0x4d12ba,_0x48af29){const _0x560089=function(_0x1a61f4){while(--_0x1a61f4){_0x4d12ba['push'](_0x4d12ba['shift']());}};_0x560089(++_0x48af29);}(_0x48af,0x1a8));const _0x5600=function(_0x4d12ba,_0x48af29){_0x4d12ba=_0x4d12ba-0x0;let _0x560089=_0x48af[_0x4d12ba];return _0x560089;};import{global as _0x58d22e}from'ckeditor5/src/utils';import{View as _0x85ecf5,ButtonView as _0x324b98,SpinnerView as _0x533b4c}from'ckeditor5/src/ui';import _0x54346d from'../../../theme/icons/copy.svg';import{getTranslation as _0x4b9808}from'../../utils/common-translations';import{icons as _0x50a7f3}from'ckeditor5/src/core';export default class J extends _0x85ecf5{constructor(_0xf4f1ac,_0x39a1c7=''){super(_0xf4f1ac),this[_0x5600('0x18')]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5f3bd5=this['bindTemplate'];this['contentFieldView']=new ContentFieldView(_0xf4f1ac,_0x39a1c7),this[_0x5600('0x36')]=this[_0x5600('0x20')](),this[_0x5600('0x19')]({'tag':_0x5600('0x32'),'attributes':{'class':['ck',_0x5600('0x21'),_0x5f3bd5['if']('isVisible',_0x5600('0x5'),_0x1e9754=>!_0x1e9754)],'tabindex':'-1'},'children':[{'tag':_0x5600('0x32'),'attributes':{'class':['ck',_0x5600('0x15'),_0x5f3bd5['if']('isProcessing',_0x5600('0xd'))]},'children':[this[_0x5600('0x16')],{'tag':_0x5600('0x32'),'attributes':{'class':['ck',_0x5600('0x7')]},'children':[this['copyButtonView']]}]}]});}[_0x5600('0x10')](){super['render'](),this[_0x5600('0x17')]&&this[_0x5600('0x16')][_0x5600('0xb')](this[_0x5600('0x17')]);let _0x1be7eb=!0x1;this['on']('change:value',(_0x13604e,_0x1df4bd,_0xd5f521)=>{const _0x40dd39=!this['contentFieldView'][_0x5600('0x1')]['querySelector']('.ck-ai-form__loader');this[_0x5600('0x16')][_0x5600('0xb')](_0xd5f521),this[_0x5600('0x4')]&&_0x40dd39&&!_0x1be7eb&&this['element']['scrollTo']({'top':this[_0x5600('0x1')]['scrollHeight'],'behavior':_0x5600('0x22')});}),this['on']('change:isProcessing',(_0x30107a,_0x373ff6,_0x81cbc5)=>{_0x1be7eb=!0x1,_0x81cbc5?(this[_0x5600('0x17')]=null,this[_0x5600('0x16')][_0x5600('0x1e')]()):this[_0x5600('0x17')]||this['contentFieldView'][_0x5600('0xb')]('');}),this['listenTo'](this[_0x5600('0x1')],'wheel',()=>{_0x1be7eb=!0x0;}),this['listenTo'](this['element'],_0x5600('0x2'),()=>{_0x1be7eb=!0x0;});}[_0x5600('0x28')](){this[_0x5600('0x1')]['focus']();}[_0x5600('0x20')](){const _0x90ed4d=this[_0x5600('0x29')],_0x28680f=new _0x324b98(this['locale']),_0x51101c=_0x5600('0x14');return _0x28680f[_0x5600('0x18')]({'label':_0x4b9808(_0x90ed4d,_0x5600('0x23')),'icon':_0x54346d,'class':_0x51101c,'tooltip':!0x0}),_0x28680f[_0x5600('0x33')](_0x5600('0x30'))['to'](this,_0x5600('0x17'),_0x39f8e6=>!!_0x39f8e6),_0x28680f[_0x5600('0x33')](_0x5600('0xf'))['to'](this,_0x5600('0x4'),_0x4c789e=>!_0x4c789e),_0x28680f['on'](_0x5600('0x24'),()=>{this[_0x5600('0x37')](this[_0x5600('0x16')][_0x5600('0x1')]),_0x28680f[_0x5600('0x3')]=_0x50a7f3[_0x5600('0x11')],_0x28680f[_0x5600('0x38')]=_0x51101c+_0x5600('0x13'),this[_0x5600('0x28')](),setTimeout(()=>{_0x28680f[_0x5600('0x3')]=_0x54346d,_0x28680f[_0x5600('0x38')]=_0x51101c;},0x3e8);}),_0x28680f;}[_0x5600('0x37')](_0x3e7af5){const {window:_0xe6d407,document:_0x5e9f2d}=_0x58d22e;if(_0xe6d407['ClipboardItem']){const {Blob:_0x215028,ClipboardItem:_0x390c54}=_0xe6d407,_0x5b4b9b=[new _0x390c54({'text/html':new _0x215028([_0x3e7af5[_0x5600('0x9')]],{'type':_0x5600('0x26')}),'text/plain':new _0x215028([_0x3e7af5[_0x5600('0x2a')]||''],{'type':_0x5600('0x31')})})];navigator[_0x5600('0x1b')]['write'](_0x5b4b9b);}else{const _0x34750b=_0x5e9f2d[_0x5600('0x2e')]('div');_0x34750b[_0x5600('0x6')][_0x5600('0x0')]=_0x5600('0x2d'),_0x34750b[_0x5600('0x6')][_0x5600('0xa')]=_0x5600('0x27'),_0x34750b[_0x5600('0x9')]=_0x5600('0x12')+_0x3e7af5[_0x5600('0x9')]+_0x5600('0x25'),_0x5e9f2d[_0x5600('0x39')][_0x5600('0x2c')](_0x34750b);const _0x4a370b=_0x5e9f2d['createRange']();_0x4a370b[_0x5600('0xc')](_0x34750b['firstElementChild']),_0x4a370b['setEndBefore'](_0x34750b[_0x5600('0x1d')]);const _0x44054a=_0xe6d407[_0x5600('0x35')]();_0x44054a['removeAllRanges'](),_0x44054a[_0x5600('0x1f')](_0x4a370b),_0x5e9f2d['execCommand'](_0x5600('0x1a')),_0x34750b[_0x5600('0x8')]();}}}export class ContentFieldView extends _0x85ecf5{constructor(_0x1670ec,_0x33d465=''){super(_0x1670ec),this['loaderView']=this[_0x5600('0x1c')](),this[_0x5600('0x19')]({'tag':_0x5600('0x32'),'attributes':{'class':['ck',_0x5600('0x34'),_0x33d465,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2169ff){this[_0x5600('0x1')]['innerHTML']=_0x2169ff;}[_0x5600('0x1e')](){this[_0x5600('0x1')]['appendChild'](this[_0x5600('0x2f')][_0x5600('0x1')]);}['_createLoader'](){const _0x349526=new _0x85ecf5(),_0x10b213=this[_0x5600('0x29')],_0x1d1c9b=new _0x533b4c();return _0x1d1c9b[_0x5600('0x30')]=!0x0,_0x349526['setTemplate']({'tag':_0x5600('0x32'),'attributes':{'class':['ck',_0x5600('0xe')]},'children':[_0x1d1c9b,{'text':_0x4b9808(_0x10b213,_0x5600('0x2b'))}]}),_0x349526['render'](),_0x349526;}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x3c06=['ck-ai-form__error','text','content','setTemplate','div','set'];(function(_0x2e21c7,_0x3c06b2){const _0x458e59=function(_0x52cf51){while(--_0x52cf51){_0x2e21c7['push'](_0x2e21c7['shift']());}};_0x458e59(++_0x3c06b2);}(_0x3c06,0x125));const _0x458e=function(_0x2e21c7,_0x3c06b2){_0x2e21c7=_0x2e21c7-0x0;let _0x458e59=_0x3c06[_0x2e21c7];return _0x458e59;};import{View as _0x390bb0,IconView as _0x59d79c}from'ckeditor5/src/ui';import _0x49421d from'../../../theme/icons/error.svg';export default class Q extends _0x390bb0{constructor(_0x4aa2b8,_0x463d2c=''){super(_0x4aa2b8);const _0x24153c=new _0x59d79c(),_0x449d77=this['bindTemplate'];this[_0x458e('0x0')]('text',_0x463d2c),_0x24153c[_0x458e('0x3')]=_0x49421d,this[_0x458e('0x4')]({'tag':_0x458e('0x5'),'attributes':{'class':['ck',_0x458e('0x1')]},'children':[_0x24153c,{'text':_0x449d77['to'](_0x458e('0x2'))}]});}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2a63=['fire','execute','Submit','isEnabled','submit','isOn','bind','isVisible','_createSubmitButton','minRows','update','element','filteredView','resultsView','maxRows','enter','ck-ai-form__submit','width','style','focusableChildren','History','queryView','uiLanguageDirection','window','focus','showHistoryButtonView','fieldView','children','focusCycler','add','focusFirst','render','submitButtonView','excludeScrollbarsAndBorders','_createShowHistoryButton','history','locale','set','right'];(function(_0x2985b9,_0x2a6378){const _0x4a52bf=function(_0x120dfc){while(--_0x120dfc){_0x2985b9['push'](_0x2985b9['shift']());}};_0x4a52bf(++_0x2a6378);}(_0x2a63,0x112));const _0x4a52=function(_0x2985b9,_0x2a6378){_0x2985b9=_0x2985b9-0x0;let _0x4a52bf=_0x2a63[_0x2985b9];return _0x4a52bf;};import{Rect as _0x4260e5,global as _0x360c93,isVisible as _0x5dd3a1}from'ckeditor5/src/utils';import{AutocompleteView as _0x293f22,ButtonView as _0x32e6cc}from'ckeditor5/src/ui';import{icons as _0x27b4a6}from'ckeditor5/src/core';import{escape as _0x1ab461}from'lodash-es';import{getTranslation as _0x53b34b}from'../../utils/common-translations';import _0xc8943 from'../../../theme/icons/submit.svg';export default class tt extends _0x293f22{constructor(_0x56e939,_0x23ac24){super(_0x56e939,_0x23ac24),this[_0x4a52('0x14')][_0x4a52('0x19')][_0x4a52('0x8')]=0x1,this[_0x4a52('0x14')][_0x4a52('0x19')][_0x4a52('0xd')]=0x3,this[_0x4a52('0x1f')]=this[_0x4a52('0x7')](),this[_0x4a52('0x18')]=this[_0x4a52('0x21')](),this[_0x4a52('0x12')][_0x4a52('0x1c')](this[_0x4a52('0x18')],0x1),this[_0x4a52('0x12')][_0x4a52('0x1c')](this[_0x4a52('0x1f')]);}['render'](){super[_0x4a52('0x1e')](),this[_0x4a52('0x14')]['fieldWrapperChildren'][_0x4a52('0x1c')](this[_0x4a52('0x18')]),this[_0x4a52('0x1a')][_0x4a52('0x1c')](this['submitButtonView']),this['keystrokes'][_0x4a52('0x24')](_0x4a52('0xe'),(_0x1efab2,_0x2cff1b)=>{_0x1efab2['target']==this[_0x4a52('0x14')][_0x4a52('0x19')][_0x4a52('0xa')]&&(this['submit'](),_0x2cff1b());});}[_0x4a52('0x7')](){const _0xae229=new _0x32e6cc(this[_0x4a52('0x23')]),_0x129bad=this[_0x4a52('0x23')];return _0xae229[_0x4a52('0x24')]({'icon':_0xc8943,'label':_0x53b34b(_0x129bad,_0x4a52('0x1')),'isVisible':!0x0,'tooltip':!0x0,'class':_0x4a52('0xf')}),_0xae229['on'](_0x4a52('0x0'),()=>{this[_0x4a52('0x3')]();}),_0xae229[_0x4a52('0x5')](_0x4a52('0x2'))['to'](this[_0x4a52('0x14')][_0x4a52('0x19')],'isEmpty',this,_0x4a52('0x2'),(_0x46cbca,_0x2316c7)=>!_0x46cbca&&_0x2316c7),_0xae229;}[_0x4a52('0x21')](){const _0x5e97be=new _0x32e6cc(this[_0x4a52('0x23')]),_0x23007a=this[_0x4a52('0xc')],_0x12c2fe=this[_0x4a52('0x23')];_0x5e97be[_0x4a52('0x24')]({'label':_0x53b34b(_0x12c2fe,_0x4a52('0x13')),'withText':!0x1,'icon':_0x27b4a6[_0x4a52('0x22')],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x5e97be[_0x4a52('0x5')](_0x4a52('0x4'))['to'](_0x23007a,'isVisible'),_0x5e97be[_0x4a52('0x5')](_0x4a52('0x2'))['to'](this,'isEnabled'),_0x5e97be['on'](_0x4a52('0x0'),()=>{_0x23007a[_0x4a52('0x6')]=!_0x23007a['isVisible'],_0x23007a[_0x4a52('0x6')]?this[_0x4a52('0xb')][_0x4a52('0x17')]():this[_0x4a52('0x17')]();});const _0x3f8d35=()=>{_0x360c93[_0x4a52('0x16')]['requestAnimationFrame'](()=>{if(_0x5dd3a1(this[_0x4a52('0xa')])){const _0x37b798=new _0x4260e5(this[_0x4a52('0x14')][_0x4a52('0x19')]['element']),_0x10de73=_0x37b798[_0x4a52('0x10')],_0x2b47d1='rtl'===_0x12c2fe[_0x4a52('0x15')]?'left':_0x4a52('0x25');_0x37b798[_0x4a52('0x20')](),_0x5e97be[_0x4a52('0xa')][_0x4a52('0x11')][_0x2b47d1]=_0x10de73-_0x37b798[_0x4a52('0x10')]+0x1+'px';}});};return this['queryView'][_0x4a52('0x19')]['on'](_0x4a52('0x9'),_0x3f8d35),this['on'](_0x4a52('0x1e'),_0x3f8d35),_0x5e97be;}['submit'](){const _0xe284e2=this[_0x4a52('0x14')][_0x4a52('0x19')][_0x4a52('0xa')]['value'];this[_0x4a52('0x26')](_0x4a52('0x3'),_0x1ab461(_0xe284e2));}[_0x4a52('0x17')](_0xa18ac4){-0x1===_0xa18ac4?this[_0x4a52('0x1b')]['focusLast']():this['focusCycler'][_0x4a52('0x1d')]();}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1aa5=['ck-button-action','isVisible','ck-ai-form__toolbar','_CONTENT','insert','replaceButton','items','addMany','Stop','bind','set','tryAgainButton','REPLACE','mainAction','insertButton','_createButton','extendTemplate','ck-hidden','Insert\x20below','INSERT','Try\x20again','bindTemplate','label'];(function(_0x43c1f0,_0x1aa59b){const _0x38e489=function(_0x1378aa){while(--_0x1378aa){_0x43c1f0['push'](_0x43c1f0['shift']());}};_0x38e489(++_0x1aa59b);}(_0x1aa5,0x180));const _0x38e4=function(_0x43c1f0,_0x1aa59b){_0x43c1f0=_0x43c1f0-0x0;let _0x38e489=_0x1aa5[_0x43c1f0];return _0x38e489;};import{ToolbarView as _0x32a90b,ButtonView as _0x3caba0}from'ckeditor5/src/ui';import{getTranslation as _0x26e7ac}from'../../utils/common-translations';export var AIFormToolbarViewMainAction;!function(_0xb39dea){_0xb39dea['REPLACE']='replace',_0xb39dea[_0x38e4('0x3')]=_0x38e4('0xb');}(AIFormToolbarViewMainAction||(AIFormToolbarViewMainAction={}));export default class ti extends _0x32a90b{constructor(_0x47ed92){super(_0x47ed92),this['set'](_0x38e4('0x8'),!0x1),this[_0x38e4('0x11')]('mainAction',AIFormToolbarViewMainAction[_0x38e4('0x13')]),this[_0x38e4('0xc')]=this['_createButton']('',_0x38e4('0x7')),this['replaceButton'][_0x38e4('0x10')](_0x38e4('0x6'))['to'](this,_0x38e4('0x14'),_0x525450=>_0x26e7ac(_0x47ed92,'AI_'+_0x525450['toUpperCase']()+_0x38e4('0xa'))),this[_0x38e4('0x15')]=this[_0x38e4('0x16')](_0x26e7ac(_0x47ed92,_0x38e4('0x2'))),this[_0x38e4('0x12')]=this[_0x38e4('0x16')](_0x26e7ac(_0x47ed92,_0x38e4('0x4'))),this['stopButton']=this['_createButton'](_0x26e7ac(_0x47ed92,_0x38e4('0xf')));const _0x5f12a6=this[_0x38e4('0x5')];this[_0x38e4('0x0')]({'attributes':{'class':[_0x38e4('0x9'),_0x5f12a6['if'](_0x38e4('0x8'),_0x38e4('0x1'),_0x5d8e56=>!_0x5d8e56)]}}),this[_0x38e4('0xd')][_0x38e4('0xe')]([this['replaceButton'],this['insertButton'],this[_0x38e4('0x12')],this['stopButton']]);}[_0x38e4('0x16')](_0x4e5992,_0x553f0c){const _0x4c8bfc=new _0x3caba0(this['locale']);return _0x4c8bfc['set']({'label':_0x4e5992,'class':_0x553f0c||'','isVisible':!0x0,'withText':!0x0}),_0x4c8bfc;}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x4c5a=['mainAction','search','stopButton','isError','_createHistoryView','submit','tryAgainEvent','listenTo','focus','setTemplate','header','isVisible','handleError','replaceContent','keystrokes','backwardCycle','_promptHistory','forwardCycle','bind','contentArea','historyGroupView','ck-hidden','_focusCycler','focusCycler','queryView','promptView','_createToolbar','locale','render','replaceButton','clearHistory','tryAgainButton','isEnabled','_createPromptView','insertContentBelow','fire','focusPrevious','set','insertButton','Ask\x20AI\x20to\x20improve\x20generated\x20text','stop','copyButtonView','focusFirst','AI_ERROR_FAILED','div','errorView','execute','focusTracker','finishProcessing','focusNext','trim','prompt','submitPrompt','delegate','shift\x20+\x20tab','ck-ai-form-content','createCollection','REPLACE','isProcessing','bindTemplate','add','bindTo','reset','toolbar','clear','stopProcessing','element','ck-ai-form','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.','tab','value'];(function(_0x274964,_0x4c5a62){const _0x13a584=function(_0x1c22f1){while(--_0x1c22f1){_0x274964['push'](_0x274964['shift']());}};_0x13a584(++_0x4c5a62);}(_0x4c5a,0x109));const _0x13a5=function(_0x274964,_0x4c5a62){_0x274964=_0x274964-0x0;let _0x13a584=_0x4c5a[_0x274964];return _0x13a584;};import{FocusTracker as _0x464bd0,KeystrokeHandler as _0x37d17c}from'ckeditor5/src/utils';import{View as _0x370055,FocusCycler as _0x31da5a,createLabeledTextarea as _0x2fda5d,FormHeaderView as _0x26efff}from'ckeditor5/src/ui';import _0x22b5ba,{AIFormToolbarViewMainAction as _0x5cbd95}from'./aiformtoolbarview';import _0x364710 from'./aiformcontentarea';import _0x16431e from'./aiformerrorview';import _0x5b0174 from'./aiformpromptview';import _0x16fc3b from'./aihistorylistview';import _0x381f16 from'./aihistorylistitemview';import _0x3eef5d from'./prompthistory';import{getTranslation as _0x118f43}from'../../utils/common-translations';import _0x32f037 from'../../../theme/icons/robot-pencil.svg';export default class v extends _0x370055{constructor(_0x547dbb,_0x1ad8a7,_0x5e0074=''){super(_0x547dbb),this['set'](_0x13a5('0x33'),!0x0),this[_0x13a5('0x38')](_0x13a5('0x6'),!0x1),this[_0x13a5('0x38')]('prompt',''),this[_0x13a5('0x38')]('value',''),this[_0x13a5('0x38')](_0x13a5('0x16'),!0x1),this[_0x13a5('0x38')](_0x13a5('0x13'),_0x5cbd95[_0x13a5('0x5')]),this[_0x13a5('0x23')]=new _0x3eef5d(),this[_0x13a5('0x40')]=new _0x16431e(_0x547dbb),this[_0x13a5('0x1d')]=new _0x26efff(_0x547dbb,{'label':_0x118f43(_0x547dbb,'AI\x20Assistant'),'icon':_0x32f037}),this['contentArea']=new _0x364710(_0x547dbb,_0x5e0074),this[_0x13a5('0x26')][_0x13a5('0x25')](_0x13a5('0x6'))['to'](this),this[_0x13a5('0x26')][_0x13a5('0x25')](_0x13a5('0x12'))['to'](this),this[_0x13a5('0xb')]=this['_createToolbar'](),this[_0x13a5('0xb')][_0x13a5('0x25')]('mainAction')['to'](this),this[_0x13a5('0x2c')]=this[_0x13a5('0x34')](),this[_0x13a5('0x42')]=new _0x464bd0(),this[_0x13a5('0x21')]=new _0x37d17c(),this['_focusables']=this[_0x13a5('0x4')]([this[_0x13a5('0x26')],this[_0x13a5('0x26')][_0x13a5('0x3c')],this[_0x13a5('0xb')],this[_0x13a5('0x2c')]]),this[_0x13a5('0x29')]=new _0x31da5a({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':_0x13a5('0x2'),'focusNext':_0x13a5('0x11')}}),this['promptView'][_0x13a5('0x2a')]['on'](_0x13a5('0x24'),_0x386b03=>{this[_0x13a5('0x29')][_0x13a5('0x44')](),_0x386b03[_0x13a5('0x3b')]();}),this[_0x13a5('0x2c')][_0x13a5('0x2a')]['on'](_0x13a5('0x22'),_0x3b8c3f=>{this[_0x13a5('0x29')][_0x13a5('0x37')](),_0x3b8c3f[_0x13a5('0x3b')]();}),this[_0x13a5('0x2c')][_0x13a5('0x2b')]['fieldView'][_0x13a5('0x25')]('value')['to'](this,_0x13a5('0x46'));const _0x218de1=this[_0x13a5('0x7')];this[_0x13a5('0x1c')]({'tag':_0x13a5('0x3f'),'attributes':{'class':['ck',_0x13a5('0xf'),_0x1ad8a7],'tabindex':'-1'},'children':[this['header'],{'tag':'div','attributes':{'class':['ck',_0x13a5('0x3')]},'children':[{'tag':_0x13a5('0x3f'),'attributes':{'class':[_0x218de1['if'](_0x13a5('0x16'),_0x13a5('0x28'),_0xc5826b=>!_0xc5826b)]},'children':[this['errorView']]},this[_0x13a5('0x26')],this[_0x13a5('0xb')],this[_0x13a5('0x2c')]]}]});}[_0x13a5('0x2f')](){super[_0x13a5('0x2f')](),this[_0x13a5('0x42')][_0x13a5('0x8')](this[_0x13a5('0x26')][_0x13a5('0xe')]),this[_0x13a5('0x42')][_0x13a5('0x8')](this[_0x13a5('0x26')][_0x13a5('0x3c')][_0x13a5('0xe')]),this['focusTracker'][_0x13a5('0x8')](this['toolbar'][_0x13a5('0xe')]),this[_0x13a5('0x42')][_0x13a5('0x8')](this[_0x13a5('0x2c')][_0x13a5('0xe')]),this[_0x13a5('0x21')][_0x13a5('0x1a')](this['element']);}[_0x13a5('0x1b')](){this[_0x13a5('0x29')][_0x13a5('0x3d')]();}[_0x13a5('0xa')](){this[_0x13a5('0x46')]='',this[_0x13a5('0x12')]='',this[_0x13a5('0x2c')][_0x13a5('0xa')](),this['contentArea'][_0x13a5('0x1e')]=!0x1,this[_0x13a5('0xb')][_0x13a5('0x1e')]=!0x1;}[_0x13a5('0x34')](){const _0x4d4d31=this[_0x13a5('0x2e')],_0x4e35e5=new _0x5b0174(_0x4d4d31,{'queryView':{'label':_0x118f43(_0x4d4d31,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x2fda5d,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_0x118f43(_0x4d4d31,'Empty\x20history'),'secondary':_0x118f43(_0x4d4d31,_0x13a5('0x10'))}}},'filteredView':this[_0x13a5('0x17')](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4e35e5[_0x13a5('0x25')]('isEnabled')['to'](this,_0x13a5('0x33'),this,_0x13a5('0x6'),(_0x52a1e3,_0x591d03)=>_0x52a1e3&&!_0x591d03),this['listenTo'](_0x4e35e5,_0x13a5('0x18'),(_0x30ee1d,_0x593e32)=>{this[_0x13a5('0x46')]=_0x593e32,this[_0x13a5('0x36')](_0x13a5('0x0'),this[_0x13a5('0x46')]),_0x593e32[_0x13a5('0x45')]()&&this[_0x13a5('0x23')][_0x13a5('0x8')]({'prompt':_0x593e32[_0x13a5('0x45')]()},0x0);},{'priority':'high'}),_0x4e35e5;}['_createHistoryView'](){const _0x428ef5=new _0x16fc3b(this['locale']);return _0x428ef5[_0x13a5('0x27')]['items'][_0x13a5('0x9')](this[_0x13a5('0x23')])['as'](_0x381f16),_0x428ef5['on'](_0x13a5('0x31'),()=>{this[_0x13a5('0x23')][_0x13a5('0xc')](),this[_0x13a5('0x2c')][_0x13a5('0x14')](''),this[_0x13a5('0x2c')]['focus']();}),_0x428ef5;}[_0x13a5('0x2d')](){const _0x10836c=new _0x22b5ba(this[_0x13a5('0x2e')]);return _0x10836c[_0x13a5('0x30')][_0x13a5('0x25')](_0x13a5('0x33'))['to'](this,_0x13a5('0x33'),this,_0x13a5('0x6'),this,_0x13a5('0x12'),(_0x49cb77,_0x59e1a4,_0x35db21)=>_0x49cb77&&!_0x59e1a4&&!!_0x35db21),_0x10836c[_0x13a5('0x30')][_0x13a5('0x1')](_0x13a5('0x41'))['to'](this,_0x13a5('0x20')),_0x10836c[_0x13a5('0x39')][_0x13a5('0x25')]('isEnabled')['to'](this,_0x13a5('0x33'),this,_0x13a5('0x6'),this,_0x13a5('0x12'),(_0x345944,_0x21390e,_0x371f2e)=>_0x345944&&!_0x21390e&&!!_0x371f2e),_0x10836c[_0x13a5('0x39')]['delegate'](_0x13a5('0x41'))['to'](this,_0x13a5('0x35')),_0x10836c['tryAgainButton'][_0x13a5('0x25')](_0x13a5('0x33'))['to'](this,'isEnabled',this,_0x13a5('0x6'),(_0x48c0c8,_0x3f6a4e)=>_0x48c0c8&&!_0x3f6a4e),_0x10836c[_0x13a5('0x32')]['delegate'](_0x13a5('0x41'))['to'](this,_0x13a5('0x19')),_0x10836c[_0x13a5('0x15')][_0x13a5('0x25')](_0x13a5('0x33'))['to'](this,'isProcessing'),_0x10836c[_0x13a5('0x15')][_0x13a5('0x1')]('execute')['to'](this,_0x13a5('0xd')),_0x10836c;}['startProcessing'](){this[_0x13a5('0x12')]='',this[_0x13a5('0x16')]=!0x1,this[_0x13a5('0x6')]=!0x0,this['contentArea'][_0x13a5('0x1e')]=!0x0,this[_0x13a5('0xb')][_0x13a5('0x1e')]=!0x0,this[_0x13a5('0x26')]['focus']();}[_0x13a5('0x43')](){const _0x4e0255=this[_0x13a5('0x2e')];this[_0x13a5('0x6')]=!0x1,this['prompt']='',this[_0x13a5('0x2c')][_0x13a5('0xa')](),this[_0x13a5('0x12')]&&(this[_0x13a5('0x2c')][_0x13a5('0x2b')]['label']=_0x118f43(_0x4e0255,_0x13a5('0x3a')));}[_0x13a5('0x1f')](_0x48997d){const _0x416518=this['locale'];this[_0x13a5('0x43')](),this[_0x13a5('0x16')]=!0x0,this['errorView']['text']=_0x48997d||_0x118f43(_0x416518,_0x13a5('0x3e')),this[_0x13a5('0x12')]||(this[_0x13a5('0x26')][_0x13a5('0x1e')]=!0x1);}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2f99=['locale','prompt','fire','execute','children','add'];(function(_0x19dea0,_0x2f99e2){const _0xffa860=function(_0x1881e7){while(--_0x1881e7){_0x19dea0['push'](_0x19dea0['shift']());}};_0xffa860(++_0x2f99e2);}(_0x2f99,0x6a));const _0xffa8=function(_0x19dea0,_0x2f99e2){_0x19dea0=_0x19dea0-0x0;let _0xffa860=_0x2f99[_0x19dea0];return _0xffa860;};import{ListItemView as _0x45402a,ButtonView as _0x271287}from'ckeditor5/src/ui';import _0xde7ba6 from'../dropdown/buttonlabelwithhighlightview';import{unescape as _0x58b2a0}from'lodash-es';export default class nt extends _0x45402a{constructor(_0xac05a2){super();const _0x2163e8=new _0xde7ba6(),_0x318309=new _0x271287(this[_0xffa8('0x2')],_0x2163e8);this[_0xffa8('0x0')][_0xffa8('0x1')](_0x318309),_0x318309['set']({'label':_0xac05a2[_0xffa8('0x3')],'withText':!0x0}),_0x318309['on'](_0xffa8('0x5'),()=>{this[_0xffa8('0x4')](_0xffa8('0x5'),{'value':_0x58b2a0(_0xac05a2[_0xffa8('0x3')])});});}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0xdbae=['_createClearHistoryButton','Prompt\x20history','length','label','add','locale','filter','clearHistoryButton','execute','historyGroupView','fire','Clear','items','delegate'];(function(_0x426b60,_0xdbaead){const _0x541586=function(_0xc17a0a){while(--_0xc17a0a){_0x426b60['push'](_0x426b60['shift']());}};_0x541586(++_0xdbaead);}(_0xdbae,0x17b));const _0x5415=function(_0x426b60,_0xdbaead){_0x426b60=_0x426b60-0x0;let _0x541586=_0xdbae[_0x426b60];return _0x541586;};import{ListView as _0x2d34c5,ListItemGroupView as _0x3d9336,ButtonView as _0x5c5e90}from'ckeditor5/src/ui';import{getTranslation as _0xb69122}from'../../utils/common-translations';export default class ot extends _0x2d34c5{constructor(_0x26ce3f){super(_0x26ce3f),this[_0x5415('0x6')]=this[_0x5415('0xd')](),this[_0x5415('0x8')]=new _0x3d9336(),this[_0x5415('0x8')]['children']['add'](this[_0x5415('0x6')],0x1),this[_0x5415('0x8')][_0x5415('0x2')]=_0xb69122(_0x26ce3f,_0x5415('0x0')),this['historyGroupView'][_0x5415('0xb')][_0x5415('0xc')](_0x5415('0x7'))['to'](this),this[_0x5415('0xb')][_0x5415('0x3')](this[_0x5415('0x8')]);}[_0x5415('0x5')](){let _0x41014b=0x0;for(const _0x45c632 of this['items'])_0x41014b+=_0x45c632[_0x5415('0xb')][_0x5415('0x1')];return{'resultsCount':_0x41014b,'totalItemsCount':_0x41014b};}[_0x5415('0xd')](){const _0x3d15f9=this[_0x5415('0x4')],_0x4a7dac=new _0x5c5e90(this['locale']);return _0x4a7dac['set']({'label':'('+_0xb69122(_0x3d15f9,_0x5415('0xa'))+')','withText':!0x0}),_0x4a7dac['on'](_0x5415('0x7'),()=>this[_0x5415('0x9')]('clearHistory')),_0x4a7dac;}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x43c2=['add','parse','trim','_loadFromSessionStorage','length','map','toLowerCase','remove','getItem','setItem','CKEditor/AIFormView/PromptHistory','_saveToSessionStorage'];(function(_0x32f160,_0x43c200){const _0x3482fb=function(_0x182976){while(--_0x182976){_0x32f160['push'](_0x32f160['shift']());}};_0x3482fb(++_0x43c200);}(_0x43c2,0x13a));const _0x3482=function(_0x32f160,_0x43c200){_0x32f160=_0x32f160-0x0;let _0x3482fb=_0x43c2[_0x32f160];return _0x3482fb;};import{Collection as _0xa9cae6}from'ckeditor5/src/utils';const ts=_0x3482('0x8');export default class at extends _0xa9cae6{constructor(){super(),this[_0x3482('0x1')](),this['on'](_0x3482('0xa'),(_0x44e0e0,_0x56027a)=>{const _0x56f936=os(_0x56027a['prompt']);for(const _0x9e2d2c of this)if(_0x9e2d2c!=_0x56027a&&os(_0x9e2d2c['prompt'])===_0x56f936){this[_0x3482('0x5')](_0x9e2d2c);break;}this[_0x3482('0x2')]>0x14&&this['remove'](this['last']),this[_0x3482('0x9')]();}),this['on'](_0x3482('0x5'),()=>{this[_0x3482('0x9')]();});}[_0x3482('0x1')](){const _0x38f539=sessionStorage[_0x3482('0x6')](ts)||'[]';this['addMany'](JSON[_0x3482('0xb')](_0x38f539));}[_0x3482('0x9')](){sessionStorage[_0x3482('0x7')](ts,JSON['stringify'](this[_0x3482('0x3')](_0x22ee76=>_0x22ee76)));}}function os(_0x3c2d0d){return _0x3c2d0d[_0x3482('0x4')]()[_0x3482('0x0')]();}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2d25=['editor','model','refresh','execute','getRanges','includes','isEnabled','get','config','aiAssistant.disabledElements','showUI','selection','document','getItems','element'];(function(_0x1d5e69,_0x2d25f8){const _0x3fdffb=function(_0x21984c){while(--_0x21984c){_0x1d5e69['push'](_0x1d5e69['shift']());}};_0x3fdffb(++_0x2d25f8);}(_0x2d25,0xdf));const _0x3fdf=function(_0x1d5e69,_0x2d25f8){_0x1d5e69=_0x1d5e69-0x0;let _0x3fdffb=_0x2d25[_0x1d5e69];return _0x3fdffb;};import{Command as _0x5cd704}from'ckeditor5/src/core';import _0x7bd4f from'../aiassistantui';export default class I extends _0x5cd704{[_0x3fdf('0x4')](){const _0x13632a=this[_0x3fdf('0x2')][_0x3fdf('0x3')][_0x3fdf('0xe')][_0x3fdf('0xd')],_0x543193=this[_0x3fdf('0x2')][_0x3fdf('0xa')][_0x3fdf('0x9')](_0x3fdf('0xb'));for(const _0x163a3f of _0x13632a[_0x3fdf('0x6')]())for(const _0x2ceb86 of _0x163a3f[_0x3fdf('0x0')]())if(_0x2ceb86['is'](_0x3fdf('0x1'))&&_0x543193[_0x3fdf('0x7')](_0x2ceb86['name']))return void(this[_0x3fdf('0x8')]=!0x1);this[_0x3fdf('0x8')]=!0x0;}[_0x3fdf('0x5')](_0xa1253d='',_0x1ac167=''){this['editor']['plugins'][_0x3fdf('0x9')](_0x7bd4f)[_0x3fdf('0xc')](_0xa1253d,_0x1ac167);}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export function getTranslation(
|
|
23
|
+
export function getTranslation(_0x472a84,_0x23dec0,_0x34537a){const t=_0x472a84['t'];switch(_0x23dec0){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'Translate\x20to\x20%0':return t('Translate\x20to\x20%0',_0x34537a);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'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'Search\x20AI\x20command':return t('Search\x20AI\x20command');case'No\x20commands\x20found':return t('No\x20commands\x20found');case'No\x20commands\x20available':return t('No\x20commands\x20available');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_AUTH_REQUEST':return t({'id':'AI_ERROR_AUTH_REQUEST','string':'Authorization\x20request\x20failed'});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 _0x23dec0;}}
|