@ckeditor/ckeditor5-ai 0.0.0-nightly-20231016.0 → 0.0.0-nightly-20231017.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.
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2a08=['length','abort','config','adapter','stringify','aborted','reject','map','data:\x20','AIConnector','aiAssistant.apiUrl','_domParser','catch','push','Authorization','user','<span>','POST','includes','_xmlSerializer','body','join','delta','get','aiAssistant.requestParameters.top_p','_cleanUpData','AI_ERROR_CONTEXT_LENGTH','split','filter','match','resolve','serializeToString','AIRequestError','top_p','Moderation','editor','_normalizeResponseHeadings','aiAssistant.requestParameters.model','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.','data','getReader','pluginName','AbortError','temperature','_parseAndNormalizeContent','name','define','_abortController','_authKey','signal','element','toModel','max_tokens','_prepareMessages','rename','text/html','parseFromString','_processStream','view','sendPrompt','string','processor','authKey','gpt-3.5-turbo','</span>','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.','_apiUrl','_requestParameters','decode','AI_ERROR_AUTH_REQUEST','aiAssistant.requestParameters','context_length_exceeded','startsWith','document','_isBufferIncomplete','read','content','Instruction:\x0a','[DONE]','Bearer\x20'];(function(_0x4b77ce,_0x2a083f){const _0x2ef1ff=function(_0x4bed0f){while(--_0x4bed0f){_0x4b77ce['push'](_0x4b77ce['shift']());}};_0x2ef1ff(++_0x2a083f);}(_0x2a08,0x1a1));const _0x2ef1=function(_0x4b77ce,_0x2a083f){_0x4b77ce=_0x4b77ce-0x0;let _0x2ef1ff=_0x2a08[_0x4b77ce];return _0x2ef1ff;};import{Matcher as _0x55f1cb,UpcastWriter as _0x2fc019}from'ckeditor5/src/engine';import{Plugin as _0x3f6ea5}from'ckeditor5/src/core';import{CKEditorError as _0x5e6858}from'ckeditor5/src/utils';import{getTranslation as _0x35081a}from'./utils/common-translations';export default class o extends _0x3f6ea5{static get[_0x2ef1('0x18')](){return _0x2ef1('0x48');}constructor(_0x111c94){super(_0x111c94),_0x111c94[_0x2ef1('0x41')][_0x2ef1('0x1d')](_0x2ef1('0x49'),'https://api.openai.com/v1/chat/completions'),_0x111c94[_0x2ef1('0x41')][_0x2ef1('0x1d')](_0x2ef1('0x14'),_0x2ef1('0x2e')),_0x111c94[_0x2ef1('0x41')][_0x2ef1('0x1d')]('aiAssistant.requestParameters.max_tokens',0x7d0),_0x111c94[_0x2ef1('0x41')][_0x2ef1('0x1d')]('aiAssistant.requestParameters.temperature',0x1),_0x111c94['config']['define'](_0x2ef1('0x7'),0x1);const _0x130cda=_0x111c94['config'][_0x2ef1('0x6')](_0x2ef1('0x49')),_0x18e9e7=_0x111c94[_0x2ef1('0x41')][_0x2ef1('0x6')]('aiAssistant')[_0x2ef1('0x2d')],_0x418c46=_0x111c94[_0x2ef1('0x41')][_0x2ef1('0x6')](_0x2ef1('0x35'));this[_0x2ef1('0x1e')]=new AbortController(),this[_0x2ef1('0x42')]=new OpenAIAdapter(_0x111c94,_0x130cda,_0x418c46,_0x18e9e7);}async['processPrompt'](_0x423f95,_0x2179f7,_0x2e7651){const {systemMessage:_0x434cf8,userMessage:_0x35ddc6}=this['_prepareMessages'](_0x423f95,_0x2179f7);return this[_0x2ef1('0x42')]['sendPrompt'](_0x434cf8,_0x35ddc6,this[_0x2ef1('0x1e')][_0x2ef1('0x20')],_0x2e7651)[_0x2ef1('0x4b')](_0x133fb2=>{if(_0x133fb2 instanceof AIRequestError)return Promise[_0x2ef1('0x45')](_0x133fb2);if(_0x2ef1('0x19')==_0x133fb2[_0x2ef1('0x1c')])return Promise['resolve']();throw console['error'](_0x133fb2),new _0x5e6858('aiconnector-send-prompt-failed',null);});}[_0x2ef1('0x40')](){this['_abortController']['signal'][_0x2ef1('0x44')]||(this[_0x2ef1('0x1e')][_0x2ef1('0x40')](),this[_0x2ef1('0x1e')]=new AbortController());}[_0x2ef1('0x24')](_0x45c841,_0x10a029){let _0x3aa064,_0x369b24;return _0x10a029?(_0x3aa064=_0x2ef1('0x15'),_0x369b24=_0x2ef1('0x3c')+_0x45c841+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+(_0x10a029[_0x2ef1('0x37')]('<')?_0x10a029:_0x2ef1('0x4f')+_0x10a029+_0x2ef1('0x2f'))):(_0x3aa064=_0x2ef1('0x30'),_0x369b24=_0x45c841),{'systemMessage':_0x3aa064,'userMessage':_0x369b24};}}export class OpenAIAdapter{constructor(_0x569238,_0x34881e,_0x3da12d,_0x514466){this[_0x2ef1('0x12')]=_0x569238,this[_0x2ef1('0x31')]=_0x34881e,this[_0x2ef1('0x1f')]=_0x514466,this[_0x2ef1('0x32')]=_0x3da12d,this[_0x2ef1('0x4a')]=new DOMParser(),this[_0x2ef1('0x2')]=new XMLSerializer();}async[_0x2ef1('0x2a')](_0x1b6704,_0xa24b59,_0x243409,_0x20f151){const _0x2715e6=this[_0x2ef1('0x12')]['locale'],_0x295ea0={'Content-Type':'application/json'};if(_0x2ef1('0x2b')==typeof this[_0x2ef1('0x1f')])_0x295ea0['Authorization']=_0x2ef1('0x3e')+this[_0x2ef1('0x1f')];else{if(this[_0x2ef1('0x1f')])try{const _0x2fcb27=await this[_0x2ef1('0x1f')]();_0x295ea0[_0x2ef1('0x4d')]=_0x2ef1('0x3e')+_0x2fcb27;}catch(_0x3a1b4f){return Promise['reject'](new AIRequestError(_0x35081a(_0x2715e6,_0x2ef1('0x34'))));}}const _0x514b28={'model':this[_0x2ef1('0x32')]['model'],'messages':[{'role':'system','content':_0x1b6704},{'role':_0x2ef1('0x4e'),'content':_0xa24b59}],'stream':!0x0,'max_tokens':this['_requestParameters'][_0x2ef1('0x23')],'temperature':this[_0x2ef1('0x32')][_0x2ef1('0x1a')],'top_p':this['_requestParameters'][_0x2ef1('0x10')]};this[_0x2ef1('0x32')][_0x2ef1('0x4e')]&&(_0x514b28[_0x2ef1('0x4e')]=this[_0x2ef1('0x32')][_0x2ef1('0x4e')]);const _0x25b948={'method':_0x2ef1('0x0'),'headers':_0x295ea0,'body':JSON[_0x2ef1('0x43')](_0x514b28),'signal':_0x243409},_0x10fefd=await fetch(this[_0x2ef1('0x31')],_0x25b948);if(_0x10fefd['ok']){const _0x3b4942=_0x10fefd[_0x2ef1('0x3')];return await this[_0x2ef1('0x28')](_0x3b4942,_0x20f151),Promise[_0x2ef1('0xd')]();}{const _0xe50692=await _0x10fefd['text']();return _0xe50692[_0x2ef1('0x1')](_0x2ef1('0x36'))?Promise['reject'](new AIRequestError(_0x35081a(_0x2715e6,_0x2ef1('0x9')))):_0xe50692[_0x2ef1('0x1')](_0x2ef1('0x11'))?Promise['reject'](new AIRequestError(_0x35081a(_0x2715e6,'AI_ERROR_MODERATION'))):Promise[_0x2ef1('0x45')](new Error(_0xe50692));}}async[_0x2ef1('0x28')](_0x1fa74e,_0x52d741){const _0xebbde9=_0x1fa74e[_0x2ef1('0x17')](),_0x8da3c=new TextDecoder();let _0x226c16='',_0x1f8d2f='',_0x1afce2='',_0x49f123=!0x1;for(;!_0x49f123;){const {done:_0x3ea938,value:_0x17d04f}=await _0xebbde9[_0x2ef1('0x3a')](),_0x3949f5=_0x226c16+_0x8da3c[_0x2ef1('0x33')](_0x17d04f);let _0xab1344='';_0x49f123=_0x3ea938;try{_0xab1344=this[_0x2ef1('0x8')](_0x3949f5),_0x226c16='';}catch(_0xc2de1){_0x226c16+=_0x3949f5;continue;}_0x1f8d2f+=_0xab1344,!_0x3ea938&&this[_0x2ef1('0x39')](_0x1f8d2f)||_0x1f8d2f&&(_0x1afce2+=_0x1f8d2f,_0x52d741(this[_0x2ef1('0x1b')](_0x1afce2)),_0x1f8d2f='');}return Promise[_0x2ef1('0xd')]();}[_0x2ef1('0x39')](_0x1fdc3a){const _0x4a348a=_0x1fdc3a[_0x2ef1('0xa')]('<')[_0x2ef1('0x3f')]!==_0x1fdc3a[_0x2ef1('0xa')]('>')[_0x2ef1('0x3f')],_0x4ee428=_0x1fdc3a[_0x2ef1('0x3f')]<0x1e;return _0x4a348a&&_0x4ee428;}['_parseAndNormalizeContent'](_0x44d2fd){const _0x243857=this['_domParser'][_0x2ef1('0x27')](_0x44d2fd,_0x2ef1('0x26')),_0x5eb945=this[_0x2ef1('0x12')][_0x2ef1('0x16')][_0x2ef1('0x2c')]['toView'](this[_0x2ef1('0x2')][_0x2ef1('0xe')](_0x243857[_0x2ef1('0x3')]));return this[_0x2ef1('0x13')](_0x5eb945),this['editor']['data']['stringify'](this[_0x2ef1('0x12')]['data'][_0x2ef1('0x22')](_0x5eb945));}[_0x2ef1('0x13')](_0x344ff0){const _0x5c60c3=new _0x2fc019(this[_0x2ef1('0x12')]['editing'][_0x2ef1('0x29')][_0x2ef1('0x38')]),_0x5e1c0f=new _0x55f1cb({'name':/^h[1-5]$/}),_0x45e1f5=[];let _0x172769=!0x1;for(const _0x5c5298 of _0x344ff0)_0x5c5298['is'](_0x2ef1('0x21'))&&_0x5e1c0f[_0x2ef1('0xc')](_0x5c5298)&&(_0x45e1f5[_0x2ef1('0x4c')](_0x5c5298),'h1'==_0x5c5298[_0x2ef1('0x1c')]&&(_0x172769=!0x0));if(_0x172769)for(const _0x246f94 of _0x45e1f5)_0x5c60c3[_0x2ef1('0x25')]('h'+(parseInt(_0x246f94[_0x2ef1('0x1c')][0x1])+0x1),_0x246f94);}[_0x2ef1('0x8')](_0x2c8587){return _0x2c8587[_0x2ef1('0xa')](/\n(?![^{]*\})/g)['map'](_0x21943f=>_0x21943f['replace'](_0x2ef1('0x47'),''))['filter'](_0x1ac66d=>_0x1ac66d&&_0x1ac66d[_0x2ef1('0x3f')]>0x0&&_0x2ef1('0x3d')!==_0x1ac66d)[_0x2ef1('0x46')](_0x2b6f5c=>{const {choices:_0x5680c4}=JSON['parse'](_0x2b6f5c);if(_0x5680c4[0x0]&&_0x5680c4[0x0][_0x2ef1('0x5')]&&_0x5680c4[0x0][_0x2ef1('0x5')][_0x2ef1('0x3b')])return _0x5680c4[0x0]['delta']['content'];})[_0x2ef1('0xb')](_0x23fd09=>_0x23fd09)[_0x2ef1('0x4')]('');}}export class AIRequestError extends Error{constructor(_0x17c3f5){super(_0x17c3f5),this[_0x2ef1('0x1c')]=_0x2ef1('0xf');}}
23
+ const _0x3e2a=['editing','pluginName','processor','toView','error','signal','startsWith','replace','_processStream','AIRequestError','aborted','text','split','getReader','aiAssistant.requestParameters','processPrompt','user','text/html','_parseAndNormalizeContent','get','aiAssistant.requestParameters.temperature','aiAssistant','config','_requestParameters','_apiUrl','view','aiAssistant.requestParameters.max_tokens','top_p','filter','_domParser','catch','Instruction:\x0a','Bearer\x20','parseFromString','delta','sendPrompt','rename','<span>','_normalizeResponseHeadings','\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a','stringify','AbortError','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.','_cleanUpData','locale','name','string','join','body','aiAssistant.apiUrl','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.','application/json','reject','Authorization','aiAssistant.requestParameters.top_p','https://api.openai.com/v1/chat/completions','max_tokens','POST','editor','_isBufferIncomplete','resolve','</span>','_prepareMessages','AI_ERROR_CONTEXT_LENGTH','define','aiAssistant.requestParameters.model','length','_abortController','decode','gpt-3.5-turbo','map','aiconnector-send-prompt-failed','push','abort','adapter','system','includes','data','_xmlSerializer','_authKey','model'];(function(_0xb29998,_0x3e2a13){const _0x18e5f4=function(_0x51cb76){while(--_0x51cb76){_0xb29998['push'](_0xb29998['shift']());}};_0x18e5f4(++_0x3e2a13);}(_0x3e2a,0x92));const _0x18e5=function(_0xb29998,_0x3e2a13){_0xb29998=_0xb29998-0x0;let _0x18e5f4=_0x3e2a[_0xb29998];return _0x18e5f4;};import{Matcher as _0x230560,UpcastWriter as _0x24dad4}from'ckeditor5/src/engine';import{Plugin as _0x42834d}from'ckeditor5/src/core';import{CKEditorError as _0x1f6465}from'ckeditor5/src/utils';import{getTranslation as _0x5bd207}from'./utils/common-translations';export default class o extends _0x42834d{static get[_0x18e5('0x11')](){return'AIConnector';}constructor(_0x38997c){super(_0x38997c),_0x38997c[_0x18e5('0x26')][_0x18e5('0x50')](_0x18e5('0x41'),_0x18e5('0x47')),_0x38997c['config'][_0x18e5('0x50')](_0x18e5('0x0'),_0x18e5('0x4')),_0x38997c['config'][_0x18e5('0x50')](_0x18e5('0x2a'),0x7d0),_0x38997c[_0x18e5('0x26')][_0x18e5('0x50')](_0x18e5('0x24'),0x1),_0x38997c[_0x18e5('0x26')][_0x18e5('0x50')](_0x18e5('0x46'),0x1);const _0x31f9e3=_0x38997c[_0x18e5('0x26')][_0x18e5('0x23')]('aiAssistant.apiUrl'),_0x571ca3=_0x38997c[_0x18e5('0x26')][_0x18e5('0x23')](_0x18e5('0x25'))['authKey'],_0x2aae4c=_0x38997c[_0x18e5('0x26')][_0x18e5('0x23')](_0x18e5('0x1e'));this['_abortController']=new AbortController(),this[_0x18e5('0x9')]=new OpenAIAdapter(_0x38997c,_0x31f9e3,_0x2aae4c,_0x571ca3);}async[_0x18e5('0x1f')](_0x4b60ac,_0x13314d,_0x3c8730){const {systemMessage:_0x3c90c7,userMessage:_0x3d85fa}=this[_0x18e5('0x4e')](_0x4b60ac,_0x13314d);return this[_0x18e5('0x9')][_0x18e5('0x33')](_0x3c90c7,_0x3d85fa,this['_abortController'][_0x18e5('0x15')],_0x3c8730)[_0x18e5('0x2e')](_0x33cdc6=>{if(_0x33cdc6 instanceof AIRequestError)return Promise[_0x18e5('0x44')](_0x33cdc6);if(_0x18e5('0x39')==_0x33cdc6[_0x18e5('0x3d')])return Promise['resolve']();throw console[_0x18e5('0x14')](_0x33cdc6),new _0x1f6465(_0x18e5('0x6'),null);});}['abort'](){this['_abortController'][_0x18e5('0x15')][_0x18e5('0x1a')]||(this[_0x18e5('0x2')][_0x18e5('0x8')](),this[_0x18e5('0x2')]=new AbortController());}[_0x18e5('0x4e')](_0x36d22f,_0x2b1ada){let _0x39af63,_0x717c76;return _0x2b1ada?(_0x39af63=_0x18e5('0x3a'),_0x717c76=_0x18e5('0x2f')+_0x36d22f+_0x18e5('0x37')+(_0x2b1ada[_0x18e5('0x16')]('<')?_0x2b1ada:_0x18e5('0x35')+_0x2b1ada+_0x18e5('0x4d'))):(_0x39af63=_0x18e5('0x42'),_0x717c76=_0x36d22f),{'systemMessage':_0x39af63,'userMessage':_0x717c76};}}export class OpenAIAdapter{constructor(_0x402c42,_0x13d7f5,_0x22ba3b,_0x1fd388){this['editor']=_0x402c42,this['_apiUrl']=_0x13d7f5,this[_0x18e5('0xe')]=_0x1fd388,this[_0x18e5('0x27')]=_0x22ba3b,this[_0x18e5('0x2d')]=new DOMParser(),this[_0x18e5('0xd')]=new XMLSerializer();}async[_0x18e5('0x33')](_0x42acd4,_0x3bcc32,_0x2508a3,_0x2fb7d9){const _0xadf9b0=this['editor'][_0x18e5('0x3c')],_0x2445b8={'Content-Type':_0x18e5('0x43')};if(_0x18e5('0x3e')==typeof this[_0x18e5('0xe')])_0x2445b8[_0x18e5('0x45')]=_0x18e5('0x30')+this['_authKey'];else{if(this['_authKey'])try{const _0x30e07a=await this['_authKey']();_0x2445b8[_0x18e5('0x45')]=_0x18e5('0x30')+_0x30e07a;}catch(_0x25c65c){return Promise[_0x18e5('0x44')](new AIRequestError(_0x5bd207(_0xadf9b0,'AI_ERROR_AUTH_REQUEST')));}}const _0x44dc18={'model':this['_requestParameters'][_0x18e5('0xf')],'messages':[{'role':_0x18e5('0xa'),'content':_0x42acd4},{'role':_0x18e5('0x20'),'content':_0x3bcc32}],'stream':!0x0,'max_tokens':this[_0x18e5('0x27')][_0x18e5('0x48')],'temperature':this[_0x18e5('0x27')]['temperature'],'top_p':this[_0x18e5('0x27')][_0x18e5('0x2b')]};this['_requestParameters'][_0x18e5('0x20')]&&(_0x44dc18[_0x18e5('0x20')]=this[_0x18e5('0x27')][_0x18e5('0x20')]);const _0x8288e5={'method':_0x18e5('0x49'),'headers':_0x2445b8,'body':JSON[_0x18e5('0x38')](_0x44dc18),'signal':_0x2508a3},_0xf2be44=await fetch(this[_0x18e5('0x28')],_0x8288e5);if(_0xf2be44['ok']){const _0x1129b2=_0xf2be44[_0x18e5('0x40')];return await this[_0x18e5('0x18')](_0x1129b2,_0x2fb7d9),Promise[_0x18e5('0x4c')]();}{const _0x1b616e=await _0xf2be44[_0x18e5('0x1b')]();return _0x1b616e[_0x18e5('0xb')]('context_length_exceeded')?Promise[_0x18e5('0x44')](new AIRequestError(_0x5bd207(_0xadf9b0,_0x18e5('0x4f')))):_0x1b616e['includes']('Moderation')?Promise[_0x18e5('0x44')](new AIRequestError(_0x5bd207(_0xadf9b0,'AI_ERROR_MODERATION'))):Promise[_0x18e5('0x44')](new Error(_0x1b616e));}}async[_0x18e5('0x18')](_0x1e3327,_0x344f4d){const _0x4e6629=_0x1e3327[_0x18e5('0x1d')](),_0x2e1356=new TextDecoder();let _0x5cf351='',_0x4c1fb2='',_0x1b4af3='',_0x1e1ae2=!0x1;for(;!_0x1e1ae2;){const {done:_0x100b37,value:_0x115d28}=await _0x4e6629['read'](),_0x3dcc30=_0x5cf351+_0x2e1356[_0x18e5('0x3')](_0x115d28);let _0x530a20='';_0x1e1ae2=_0x100b37;try{_0x530a20=this[_0x18e5('0x3b')](_0x3dcc30),_0x5cf351='';}catch(_0x3499bb){_0x5cf351+=_0x3dcc30;continue;}_0x4c1fb2+=_0x530a20,!_0x100b37&&this[_0x18e5('0x4b')](_0x4c1fb2)||_0x4c1fb2&&(_0x1b4af3+=_0x4c1fb2,_0x344f4d(this[_0x18e5('0x22')](_0x1b4af3)),_0x4c1fb2='');}return Promise['resolve']();}['_isBufferIncomplete'](_0x259d3c){const _0x41f5d0=_0x259d3c[_0x18e5('0x1c')]('<')[_0x18e5('0x1')]!==_0x259d3c[_0x18e5('0x1c')]('>')[_0x18e5('0x1')],_0xf2addf=_0x259d3c['length']<0x1e;return _0x41f5d0&&_0xf2addf;}[_0x18e5('0x22')](_0x10f223){const _0x1937ac=this[_0x18e5('0x2d')][_0x18e5('0x31')](_0x10f223,_0x18e5('0x21')),_0x783317=this[_0x18e5('0x4a')][_0x18e5('0xc')][_0x18e5('0x12')][_0x18e5('0x13')](this[_0x18e5('0xd')]['serializeToString'](_0x1937ac[_0x18e5('0x40')]));return this[_0x18e5('0x36')](_0x783317),this[_0x18e5('0x4a')][_0x18e5('0xc')][_0x18e5('0x38')](this[_0x18e5('0x4a')]['data']['toModel'](_0x783317));}[_0x18e5('0x36')](_0xeaa508){const _0x59684b=new _0x24dad4(this[_0x18e5('0x4a')][_0x18e5('0x10')][_0x18e5('0x29')]['document']),_0x28ca63=new _0x230560({'name':/^h[1-5]$/}),_0x3bf079=[];let _0x4df615=!0x1;for(const _0x5ecfc6 of _0xeaa508)_0x5ecfc6['is']('element')&&_0x28ca63['match'](_0x5ecfc6)&&(_0x3bf079[_0x18e5('0x7')](_0x5ecfc6),'h1'==_0x5ecfc6[_0x18e5('0x3d')]&&(_0x4df615=!0x0));if(_0x4df615)for(const _0x402407 of _0x3bf079)_0x59684b[_0x18e5('0x34')]('h'+(parseInt(_0x402407['name'][0x1])+0x1),_0x402407);}[_0x18e5('0x3b')](_0x2fb98a){return _0x2fb98a['split'](/\n(?![^{]*\})/g)[_0x18e5('0x5')](_0x4085e3=>_0x4085e3[_0x18e5('0x17')]('data:\x20',''))[_0x18e5('0x2c')](_0x485f62=>_0x485f62&&_0x485f62['length']>0x0&&'[DONE]'!==_0x485f62)[_0x18e5('0x5')](_0x53bcf7=>{const {choices:_0xff46f4}=JSON['parse'](_0x53bcf7);if(_0xff46f4[0x0]&&_0xff46f4[0x0]['delta']&&_0xff46f4[0x0][_0x18e5('0x32')]['content'])return _0xff46f4[0x0][_0x18e5('0x32')]['content'];})[_0x18e5('0x2c')](_0x1c4d6d=>_0x1c4d6d)[_0x18e5('0x3f')]('');}}export class AIRequestError extends Error{constructor(_0x33ad06){super(_0x33ad06),this[_0x18e5('0x3d')]=_0x18e5('0x19');}}
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import { type default as AIConnector } from '../aiconnector';
6
6
  import type { default as AIFormView } from './form/aiformview';
7
+ import type { AIFormToolbarViewMainAction } from './form/aiformtoolbarview';
7
8
  declare const AIAssistantController_base: {
8
9
  new (): import("ckeditor5/src/utils").Observable;
9
10
  prototype: import("ckeditor5/src/utils").Observable;
@@ -74,10 +75,17 @@ export default class AIAssistantController extends AIAssistantController_base {
74
75
  *
75
76
  * This function should be called whenever the AI balloon is displayed.
76
77
  *
77
- * @param htmlContent The selected HTML content on which the AI should base.
78
- * @param prompt The initial prompt that causes the processing to start.
79
- * @param label The label that will be displayed in the view.
78
+ * @param options
79
+ * @param options.htmlContent The selected HTML content on which the AI should base.
80
+ * @param options.prompt The initial prompt that causes the processing to start.
81
+ * @param options.label The label that will be displayed in the view.
82
+ * @param options.mainAction The action name for the main insertion button.
80
83
  */
81
- updateView(prompt: string, htmlContent: string, label: string): Promise<void>;
84
+ updateView({ prompt, htmlContent, label, mainAction }: {
85
+ prompt: string;
86
+ htmlContent: string;
87
+ label: string;
88
+ mainAction: AIFormToolbarViewMainAction;
89
+ }): Promise<void>;
82
90
  }
83
91
  export {};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x9414=['startProcessing','isRendered','set','catch','currentContext','once','_handlePrompt','view','reset','render','connector','destroy','stopListening','listenTo','previousLabel','finishProcessing','message','previousPrompt','updateView','isProcessing','tryAgainEvent','finally','initialContext','prompt','previousContext','stopProcessing','_updateValue','processPrompt','value','abort','handleError'];(function(_0x416f0e,_0x9414ef){const _0x178df6=function(_0x35645c){while(--_0x35645c){_0x416f0e['push'](_0x416f0e['shift']());}};_0x178df6(++_0x9414ef);}(_0x9414,0x75));const _0x178d=function(_0x416f0e,_0x9414ef){_0x416f0e=_0x416f0e-0x0;let _0x178df6=_0x9414[_0x416f0e];return _0x178df6;};import{ObservableMixin as _0x5870fe}from'ckeditor5/src/utils';import{AIRequestError as _0x28086b}from'../aiconnector';export default class I extends _0x5870fe(){constructor(_0x2f4f2b,_0x440d36){super(),this[_0x178d('0x11')]=_0x2f4f2b,this[_0x178d('0xe')]=_0x440d36,this[_0x178d('0x9')]({'initialContext':'','currentContext':'','previousContext':void 0x0,'previousPrompt':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['view']['bind'](_0x178d('0x4'))['to'](this,'currentContext'),this[_0x178d('0x14')](this['view'],'submitPrompt',(_0x2bb49a,_0x3a5106)=>{const _0x55d6a1=this[_0x178d('0xb')]||this['initialContext'];this[_0x178d('0xd')](_0x3a5106,_0x55d6a1);}),this[_0x178d('0x14')](this[_0x178d('0xe')],_0x178d('0x1b'),()=>{this['view'][_0x178d('0x1e')]=this[_0x178d('0x15')],this[_0x178d('0xd')](this[_0x178d('0x18')],this[_0x178d('0x0')],this[_0x178d('0x15')]);}),this['listenTo'](this['view'],_0x178d('0x1'),()=>{this['stopProcessing']();});}[_0x178d('0x12')](){this[_0x178d('0x13')]();}async[_0x178d('0x19')](_0x4b9bbc,_0xd9e508,_0x3ef69f){this[_0x178d('0xe')]['prompt']=_0x3ef69f,this[_0x178d('0x1d')]=_0xd9e508,_0x4b9bbc&&(this[_0x178d('0xe')][_0x178d('0x8')]?this[_0x178d('0xd')](_0x4b9bbc,_0xd9e508,_0x3ef69f):this[_0x178d('0xe')][_0x178d('0xc')](_0x178d('0x10'),()=>{this['_handlePrompt'](_0x4b9bbc,_0xd9e508,_0x3ef69f);}));}['stopProcessing'](){this['isProcessing']&&(this[_0x178d('0x1a')]=!0x1,this[_0x178d('0xe')][_0x178d('0x16')](),this[_0x178d('0x11')][_0x178d('0x5')]());}[_0x178d('0xf')](){this[_0x178d('0x1d')]='',this[_0x178d('0xb')]='',this[_0x178d('0x0')]='',this['previousPrompt']='',this['previousLabel']='',this[_0x178d('0xe')][_0x178d('0xf')](),this['stopProcessing']();}async[_0x178d('0xd')](_0x2d2812,_0x1788e3,_0x3208d2){return this['isProcessing']=!0x0,this[_0x178d('0xe')][_0x178d('0x7')](),this[_0x178d('0x0')]=_0x1788e3,this[_0x178d('0x18')]=_0x2d2812,this[_0x178d('0x15')]=_0x3208d2||_0x2d2812,new Promise(_0x35874f=>{this[_0x178d('0x11')][_0x178d('0x3')](_0x2d2812,_0x1788e3,_0x45a35f=>this[_0x178d('0x2')](_0x45a35f))[_0x178d('0xa')](_0x2c6cbe=>{_0x2c6cbe instanceof _0x28086b?this[_0x178d('0xe')]['handleError'](_0x2c6cbe[_0x178d('0x17')]):this[_0x178d('0xe')][_0x178d('0x6')](),_0x35874f();})[_0x178d('0x1c')](()=>{this[_0x178d('0x1')](),_0x35874f();});});}[_0x178d('0x2')](_0x23e014){this[_0x178d('0xb')]=''+_0x23e014;}}
23
+ const _0x3227=['listenTo','handleError','previousContext','stopProcessing','destroy','render','bind','stopListening','_updateValue','value','previousPrompt','previousLabel','isProcessing','processPrompt','reset','prompt','isRendered','message','_handlePrompt','initialContext','once','view','connector','catch','currentContext','tryAgainEvent'];(function(_0x255cb,_0x3227ce){const _0x174ee5=function(_0x518764){while(--_0x518764){_0x255cb['push'](_0x255cb['shift']());}};_0x174ee5(++_0x3227ce);}(_0x3227,0x64));const _0x174e=function(_0x255cb,_0x3227ce){_0x255cb=_0x255cb-0x0;let _0x174ee5=_0x3227[_0x255cb];return _0x174ee5;};import{ObservableMixin as _0x1ed53f}from'ckeditor5/src/utils';import{AIRequestError as _0x4ad8b0}from'../aiconnector';export default class y extends _0x1ed53f(){constructor(_0x35974e,_0x472d24){super(),this[_0x174e('0x0')]=_0x35974e,this[_0x174e('0x19')]=_0x472d24,this['set']({'initialContext':'','currentContext':'','previousContext':void 0x0,'previousPrompt':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this[_0x174e('0x19')][_0x174e('0xa')](_0x174e('0xd'))['to'](this,_0x174e('0x2')),this['listenTo'](this['view'],'submitPrompt',(_0xc3144b,_0x883976)=>{const _0x15b382=this[_0x174e('0x2')]||this[_0x174e('0x17')];this[_0x174e('0x16')](_0x883976,_0x15b382);}),this[_0x174e('0x4')](this[_0x174e('0x19')],_0x174e('0x3'),()=>{this['view'][_0x174e('0x13')]=this[_0x174e('0xf')],this[_0x174e('0x16')](this[_0x174e('0xe')],this['previousContext'],this['previousLabel']);}),this[_0x174e('0x4')](this[_0x174e('0x19')],_0x174e('0x7'),()=>{this[_0x174e('0x7')]();});}[_0x174e('0x8')](){this[_0x174e('0xb')]();}async['updateView']({prompt:_0x4a8cc2,htmlContent:_0x5daaaf,label:_0xaea18d,mainAction:_0x227eb7}){this['view']['prompt']=_0xaea18d,this['view']['mainAction']=_0x227eb7,this[_0x174e('0x17')]=_0x5daaaf,_0x4a8cc2&&(this[_0x174e('0x19')][_0x174e('0x14')]?this['_handlePrompt'](_0x4a8cc2,_0x5daaaf,_0xaea18d):this[_0x174e('0x19')][_0x174e('0x18')](_0x174e('0x9'),()=>{this['_handlePrompt'](_0x4a8cc2,_0x5daaaf,_0xaea18d);}));}[_0x174e('0x7')](){this[_0x174e('0x10')]&&(this[_0x174e('0x10')]=!0x1,this[_0x174e('0x19')]['finishProcessing'](),this[_0x174e('0x0')]['abort']());}['reset'](){this[_0x174e('0x17')]='',this[_0x174e('0x2')]='',this['previousContext']='',this[_0x174e('0xe')]='',this[_0x174e('0xf')]='',this[_0x174e('0x19')][_0x174e('0x12')](),this[_0x174e('0x7')]();}async[_0x174e('0x16')](_0x409819,_0x26aec3,_0x2a9a78){return this[_0x174e('0x10')]=!0x0,this[_0x174e('0x19')]['startProcessing'](),this[_0x174e('0x6')]=_0x26aec3,this[_0x174e('0xe')]=_0x409819,this['previousLabel']=_0x2a9a78||_0x409819,new Promise(_0x3bbbf5=>{this['connector'][_0x174e('0x11')](_0x409819,_0x26aec3,_0x29b168=>this[_0x174e('0xc')](_0x29b168))[_0x174e('0x1')](_0x3a0903=>{_0x3a0903 instanceof _0x4ad8b0?this['view']['handleError'](_0x3a0903[_0x174e('0x15')]):this[_0x174e('0x19')][_0x174e('0x5')](),_0x3bbbf5();})['finally'](()=>{this[_0x174e('0x7')](),_0x3bbbf5();});});}[_0x174e('0xc')](_0x508732){this[_0x174e('0x2')]=''+_0x508732;}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x550d=['length','match','items','highlightText','filter','isVisible','children','label'];(function(_0x16e9eb,_0x550d00){const _0x27efc4=function(_0x5cb04b){while(--_0x5cb04b){_0x16e9eb['push'](_0x16e9eb['shift']());}};_0x27efc4(++_0x550d00);}(_0x550d,0xc4));const _0x27ef=function(_0x16e9eb,_0x550d00){_0x16e9eb=_0x16e9eb-0x0;let _0x27efc4=_0x550d[_0x16e9eb];return _0x27efc4;};import{ListView as _0x2c312c}from'ckeditor5/src/ui';export default class y extends _0x2c312c{[_0x27ef('0x0')](_0x17e3c8){let _0x74044c=0x0,_0x186e70=0x0;for(const _0x297f7c of this[_0x27ef('0x6')]){const _0x26a83b=_0x297f7c;for(const _0x33f961 of _0x26a83b[_0x27ef('0x6')]){const _0xcda9c=_0x33f961[_0x27ef('0x2')]['first'],_0x37ad5c=_0xcda9c['labelView'];_0x17e3c8?(_0x33f961[_0x27ef('0x1')]=!!_0xcda9c[_0x27ef('0x3')][_0x27ef('0x5')](_0x17e3c8),_0x33f961[_0x27ef('0x1')]&&(_0x37ad5c[_0x27ef('0x7')](_0x17e3c8),_0x186e70++)):(_0x33f961[_0x27ef('0x1')]=!0x0,_0x37ad5c[_0x27ef('0x7')](null),_0x186e70++),_0x74044c++;}_0x26a83b[_0x27ef('0x1')]=!!_0x26a83b[_0x27ef('0x6')][_0x27ef('0x0')](_0x1bf4fc=>_0x1bf4fc['isVisible'])[_0x27ef('0x4')];}return{'resultsCount':_0x186e70,'totalItemsCount':_0x74044c};}}
23
+ const _0xeda7=['first','labelView','highlightText','label','isVisible','items','filter'];(function(_0x3b4f4f,_0xeda70b){const _0xc14e06=function(_0x30e653){while(--_0x30e653){_0x3b4f4f['push'](_0x3b4f4f['shift']());}};_0xc14e06(++_0xeda70b);}(_0xeda7,0x73));const _0xc14e=function(_0x3b4f4f,_0xeda70b){_0x3b4f4f=_0x3b4f4f-0x0;let _0xc14e06=_0xeda7[_0x3b4f4f];return _0xc14e06;};import{ListView as _0x15a030}from'ckeditor5/src/ui';export default class C extends _0x15a030{[_0xc14e('0x3')](_0x320ab8){let _0x1c36f0=0x0,_0x13faad=0x0;for(const _0x106e28 of this[_0xc14e('0x2')]){const _0x329a88=_0x106e28;for(const _0x33e79b of _0x329a88[_0xc14e('0x2')]){const _0x230a5c=_0x33e79b['children'][_0xc14e('0x4')],_0x3bf2de=_0x230a5c[_0xc14e('0x5')];_0x320ab8?(_0x33e79b[_0xc14e('0x1')]=!!_0x230a5c[_0xc14e('0x0')]['match'](_0x320ab8),_0x33e79b[_0xc14e('0x1')]&&(_0x3bf2de[_0xc14e('0x6')](_0x320ab8),_0x13faad++)):(_0x33e79b[_0xc14e('0x1')]=!0x0,_0x3bf2de[_0xc14e('0x6')](null),_0x13faad++),_0x1c36f0++;}_0x329a88['isVisible']=!!_0x329a88[_0xc14e('0x2')][_0xc14e('0x3')](_0x8d25c1=>_0x8d25c1[_0xc14e('0x1')])['length'];}return{'resultsCount':_0x13faad,'totalItemsCount':_0x1c36f0};}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2dcf=['bindTemplate','style','set','ck-button__label'];(function(_0xe28941,_0x2dcf26){const _0x34b0ca=function(_0x5999ed){while(--_0x5999ed){_0xe28941['push'](_0xe28941['shift']());}};_0x34b0ca(++_0x2dcf26);}(_0x2dcf,0x9f));const _0x34b0=function(_0xe28941,_0x2dcf26){_0xe28941=_0xe28941-0x0;let _0x34b0ca=_0x2dcf[_0xe28941];return _0x34b0ca;};import{HighlightedTextView as _0x3416b5}from'ckeditor5/src/ui';export default class C extends _0x3416b5{constructor(){super(),this[_0x34b0('0x3')]({'style':void 0x0,'text':void 0x0,'id':void 0x0});const _0x1b4291=this[_0x34b0('0x1')];this['extendTemplate']({'attributes':{'class':[_0x34b0('0x0')],'style':_0x1b4291['to'](_0x34b0('0x2')),'id':_0x1b4291['to']('id')}});}}
23
+ const _0x2cf2=['set','bindTemplate','extendTemplate'];(function(_0x1ba5c4,_0x2cf2df){const _0x3a7959=function(_0x25c5c8){while(--_0x25c5c8){_0x1ba5c4['push'](_0x1ba5c4['shift']());}};_0x3a7959(++_0x2cf2df);}(_0x2cf2,0xd8));const _0x3a79=function(_0x1ba5c4,_0x2cf2df){_0x1ba5c4=_0x1ba5c4-0x0;let _0x3a7959=_0x2cf2[_0x1ba5c4];return _0x3a7959;};import{HighlightedTextView as _0x472863}from'ckeditor5/src/ui';export default class v extends _0x472863{constructor(){super(),this[_0x3a79('0x0')]({'style':void 0x0,'text':void 0x0,'id':void 0x0});const _0x4b5f30=this[_0x3a79('0x1')];this[_0x3a79('0x2')]({'attributes':{'class':['ck-button__label'],'style':_0x4b5f30['to']('style'),'id':_0x4b5f30['to']('id')}});}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x5917=['icon','class','-9999px','_copyHTMLToClipboard','isEnabled','removeAllRanges','bindTemplate','appendLoader','text/html','_createCopyButton','render','execute','getSelection','check','querySelector','absolute','ck-ai-form__copy-button-wrapper','scrollHeight','createElement','innerHTML','body','bind','\x20ck-ai-form__copy-button--copied','ck-ai-form__copy-button','write','position','smooth','isProcessing','div','locale','wheel','appendChild','ck-ai-form__content-area-wrapper','ClipboardItem','listenTo','mousedown','ck-hidden','remove','setContent','change:value','ck-ai-form__loader','contentFieldView','isVisible','scrollTo','change:isProcessing','textContent','element','.ck-ai-form__loader','ck-reset_all-excluded','setTemplate','selectNodeContents','Copy','ck-ai-form__content-area--processing','set','text/plain','style','ck-content','_createLoader','loaderView','value','copyButtonView','ck-ai-form__content-area','focus','execCommand','clipboard'];(function(_0x18d5da,_0x5917b9){const _0x447e7f=function(_0x5c636){while(--_0x5c636){_0x18d5da['push'](_0x18d5da['shift']());}};_0x447e7f(++_0x5917b9);}(_0x5917,0xcc));const _0x447e=function(_0x18d5da,_0x5917b9){_0x18d5da=_0x18d5da-0x0;let _0x447e7f=_0x5917[_0x18d5da];return _0x447e7f;};import{global as _0x268868}from'ckeditor5/src/utils';import{View as _0x24e068,ButtonView as _0x12cc5e,SpinnerView as _0x300ddb}from'ckeditor5/src/ui';import _0x47c4e7 from'../../../theme/icons/copy.svg';import{getTranslation as _0x39506b}from'../../utils/common-translations';import{icons as _0x12abd4}from'ckeditor5/src/core';export default class M extends _0x24e068{constructor(_0x564212,_0x411d15=''){super(_0x564212),this[_0x447e('0x2c')]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2404c2=this[_0x447e('0x3e')];this[_0x447e('0x20')]=new ContentFieldView(_0x564212,_0x411d15),this[_0x447e('0x33')]=this['_createCopyButton'](),this[_0x447e('0x28')]({'tag':_0x447e('0x13'),'attributes':{'class':['ck',_0x447e('0x17'),_0x2404c2['if'](_0x447e('0x21'),_0x447e('0x1b'),_0xf83168=>!_0xf83168)],'tabindex':'-1'},'children':[{'tag':_0x447e('0x13'),'attributes':{'class':['ck',_0x447e('0x34'),_0x2404c2['if']('isProcessing',_0x447e('0x2b'))]},'children':[this[_0x447e('0x20')],{'tag':_0x447e('0x13'),'attributes':{'class':['ck',_0x447e('0x7')]},'children':[this[_0x447e('0x33')]]}]}]});}[_0x447e('0x1')](){super['render'](),this[_0x447e('0x32')]&&this['contentFieldView'][_0x447e('0x1d')](this[_0x447e('0x32')]);let _0x1e32de=!0x1;this['on'](_0x447e('0x1e'),(_0x15f96e,_0x1ed0de,_0x1eb3a9)=>{const _0x544275=!this[_0x447e('0x20')][_0x447e('0x25')][_0x447e('0x5')](_0x447e('0x26'));this[_0x447e('0x20')][_0x447e('0x1d')](_0x1eb3a9),this[_0x447e('0x12')]&&_0x544275&&!_0x1e32de&&this[_0x447e('0x25')][_0x447e('0x22')]({'top':this[_0x447e('0x25')][_0x447e('0x8')],'behavior':_0x447e('0x11')});}),this['on'](_0x447e('0x23'),(_0x2a68fb,_0x577eb5,_0x34c8cd)=>{_0x1e32de=!0x1,_0x34c8cd?(this[_0x447e('0x32')]=null,this['contentFieldView'][_0x447e('0x3f')]()):this[_0x447e('0x32')]||this[_0x447e('0x20')][_0x447e('0x1d')]('');}),this[_0x447e('0x19')](this[_0x447e('0x25')],_0x447e('0x15'),()=>{_0x1e32de=!0x0;}),this[_0x447e('0x19')](this['element'],_0x447e('0x1a'),()=>{_0x1e32de=!0x0;});}[_0x447e('0x35')](){this[_0x447e('0x25')][_0x447e('0x35')]();}[_0x447e('0x0')](){const _0x24b0df=this['locale'],_0x4d1514=new _0x12cc5e(this['locale']),_0x5f2128=_0x447e('0xe');return _0x4d1514[_0x447e('0x2c')]({'label':_0x39506b(_0x24b0df,_0x447e('0x2a')),'icon':_0x47c4e7,'class':_0x5f2128,'tooltip':!0x0}),_0x4d1514[_0x447e('0xc')](_0x447e('0x21'))['to'](this,_0x447e('0x32'),_0x5065a3=>!!_0x5065a3),_0x4d1514[_0x447e('0xc')](_0x447e('0x3c'))['to'](this,_0x447e('0x12'),_0xb359bd=>!_0xb359bd),_0x4d1514['on'](_0x447e('0x2'),()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4d1514[_0x447e('0x38')]=_0x12abd4[_0x447e('0x4')],_0x4d1514[_0x447e('0x39')]=_0x5f2128+_0x447e('0xd'),this[_0x447e('0x35')](),setTimeout(()=>{_0x4d1514[_0x447e('0x38')]=_0x47c4e7,_0x4d1514['class']=_0x5f2128;},0x3e8);}),_0x4d1514;}[_0x447e('0x3b')](_0x446207){const {window:_0x49ce24,document:_0x5b755c}=_0x268868;if(_0x49ce24[_0x447e('0x18')]){const {Blob:_0x524c2c,ClipboardItem:_0x56e12d}=_0x49ce24,_0x45d62a=[new _0x56e12d({'text/html':new _0x524c2c([_0x446207[_0x447e('0xa')]],{'type':_0x447e('0x40')}),'text/plain':new _0x524c2c([_0x446207[_0x447e('0x24')]||''],{'type':_0x447e('0x2d')})})];navigator[_0x447e('0x37')][_0x447e('0xf')](_0x45d62a);}else{const _0x382df2=_0x5b755c[_0x447e('0x9')](_0x447e('0x13'));_0x382df2['style'][_0x447e('0x10')]=_0x447e('0x6'),_0x382df2[_0x447e('0x2e')]['left']=_0x447e('0x3a'),_0x382df2['innerHTML']=_0x446207['innerHTML'],_0x5b755c[_0x447e('0xb')][_0x447e('0x16')](_0x382df2);const _0x2a3252=_0x5b755c['createRange']();_0x2a3252[_0x447e('0x29')](_0x382df2);const _0xfc63d7=_0x49ce24[_0x447e('0x3')]();_0xfc63d7[_0x447e('0x3d')](),_0xfc63d7['addRange'](_0x2a3252),_0x5b755c[_0x447e('0x36')]('copy'),_0x382df2[_0x447e('0x1c')]();}}}export class ContentFieldView extends _0x24e068{constructor(_0x9927b4,_0x5dedde=''){super(_0x9927b4),this[_0x447e('0x31')]=this['_createLoader'](),this['setTemplate']({'tag':_0x447e('0x13'),'attributes':{'class':['ck',_0x447e('0x2f'),_0x5dedde,_0x447e('0x27'),'ck-ai-form__content-field']}});}[_0x447e('0x1d')](_0xc3092){this[_0x447e('0x25')][_0x447e('0xa')]=_0xc3092;}[_0x447e('0x3f')](){this[_0x447e('0x25')][_0x447e('0x16')](this[_0x447e('0x31')][_0x447e('0x25')]);}[_0x447e('0x30')](){const _0x8160c=new _0x24e068(),_0x2e397c=this[_0x447e('0x14')],_0x29ff27=new _0x300ddb();return _0x29ff27[_0x447e('0x21')]=!0x0,_0x8160c[_0x447e('0x28')]({'tag':_0x447e('0x13'),'attributes':{'class':['ck',_0x447e('0x1f')]},'children':[_0x29ff27,{'text':_0x39506b(_0x2e397c,'AI\x20is\x20writing...')}]}),_0x8160c[_0x447e('0x1')](),_0x8160c;}}
23
+ const _0x185d=['-9999px','value','createRange','icon','ck-ai-form__content-area-wrapper','ck-ai-form__copy-button-wrapper','class','clipboard','_createCopyButton','ck-ai-form__content-area--processing','text/plain','position','ck-ai-form__loader','_createLoader','isProcessing','selectNodeContents','absolute','ck-reset_all-excluded','setContent','createElement','scrollTo','style','element','innerHTML','set','smooth','div','execute','ClipboardItem','textContent','locale','ck-content','appendChild','scrollHeight','copy','copyButtonView','bind','.ck-ai-form__loader','isVisible','text/html','body','loaderView','execCommand','remove','appendLoader','check','left','_copyHTMLToClipboard','render','mousedown','Copy','contentFieldView','write','isEnabled','setTemplate','ck-hidden','ck-ai-form__copy-button','focus','querySelector','change:isProcessing','ck-ai-form__content-area','listenTo'];(function(_0x5dd066,_0x185d83){const _0x5217cf=function(_0x1341c2){while(--_0x1341c2){_0x5dd066['push'](_0x5dd066['shift']());}};_0x5217cf(++_0x185d83);}(_0x185d,0x1ee));const _0x5217=function(_0x5dd066,_0x185d83){_0x5dd066=_0x5dd066-0x0;let _0x5217cf=_0x185d[_0x5dd066];return _0x5217cf;};import{global as _0x12799f}from'ckeditor5/src/utils';import{View as _0x140dac,ButtonView as _0x55c68c,SpinnerView as _0x9cdb5a}from'ckeditor5/src/ui';import _0x4e0f78 from'../../../theme/icons/copy.svg';import{getTranslation as _0x14b4f5}from'../../utils/common-translations';import{icons as _0x10a7a5}from'ckeditor5/src/core';export default class M extends _0x140dac{constructor(_0x788627,_0x43d4bf=''){super(_0x788627),this[_0x5217('0x1a')]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2e8908=this['bindTemplate'];this[_0x5217('0x35')]=new ContentFieldView(_0x788627,_0x43d4bf),this[_0x5217('0x25')]=this['_createCopyButton'](),this['setTemplate']({'tag':_0x5217('0x1c'),'attributes':{'class':['ck',_0x5217('0x6'),_0x2e8908['if']('isVisible',_0x5217('0x39'),_0x55d60=>!_0x55d60)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck',_0x5217('0x0'),_0x2e8908['if']('isProcessing',_0x5217('0xb'))]},'children':[this['contentFieldView'],{'tag':_0x5217('0x1c'),'attributes':{'class':['ck',_0x5217('0x7')]},'children':[this['copyButtonView']]}]}]});}['render'](){super[_0x5217('0x32')](),this['value']&&this[_0x5217('0x35')][_0x5217('0x14')](this[_0x5217('0x3')]);let _0x5a427c=!0x1;this['on']('change:value',(_0x1653bc,_0x19338a,_0x39ac0f)=>{const _0x10de61=!this[_0x5217('0x35')][_0x5217('0x18')][_0x5217('0x3c')](_0x5217('0x27'));this['contentFieldView'][_0x5217('0x14')](_0x39ac0f),this['isProcessing']&&_0x10de61&&!_0x5a427c&&this['element'][_0x5217('0x16')]({'top':this[_0x5217('0x18')][_0x5217('0x23')],'behavior':_0x5217('0x1b')});}),this['on'](_0x5217('0x3d'),(_0x2f0b59,_0x53b455,_0x4295c1)=>{_0x5a427c=!0x1,_0x4295c1?(this[_0x5217('0x3')]=null,this['contentFieldView']['appendLoader']()):this[_0x5217('0x3')]||this[_0x5217('0x35')][_0x5217('0x14')]('');}),this[_0x5217('0x1')](this[_0x5217('0x18')],'wheel',()=>{_0x5a427c=!0x0;}),this[_0x5217('0x1')](this[_0x5217('0x18')],_0x5217('0x33'),()=>{_0x5a427c=!0x0;});}[_0x5217('0x3b')](){this[_0x5217('0x18')][_0x5217('0x3b')]();}[_0x5217('0xa')](){const _0xe4c2f5=this[_0x5217('0x20')],_0x3f2281=new _0x55c68c(this[_0x5217('0x20')]),_0xab699=_0x5217('0x3a');return _0x3f2281[_0x5217('0x1a')]({'label':_0x14b4f5(_0xe4c2f5,_0x5217('0x34')),'icon':_0x4e0f78,'class':_0xab699,'tooltip':!0x0}),_0x3f2281[_0x5217('0x26')](_0x5217('0x28'))['to'](this,_0x5217('0x3'),_0x2b838b=>!!_0x2b838b),_0x3f2281[_0x5217('0x26')](_0x5217('0x37'))['to'](this,_0x5217('0x10'),_0xe7852e=>!_0xe7852e),_0x3f2281['on'](_0x5217('0x1d'),()=>{this[_0x5217('0x31')](this[_0x5217('0x35')]['element']),_0x3f2281['icon']=_0x10a7a5[_0x5217('0x2f')],_0x3f2281[_0x5217('0x8')]=_0xab699+'\x20ck-ai-form__copy-button--copied',this[_0x5217('0x3b')](),setTimeout(()=>{_0x3f2281[_0x5217('0x5')]=_0x4e0f78,_0x3f2281[_0x5217('0x8')]=_0xab699;},0x3e8);}),_0x3f2281;}[_0x5217('0x31')](_0x527538){const {window:_0x54c8fc,document:_0x4ee8b0}=_0x12799f;if(_0x54c8fc[_0x5217('0x1e')]){const {Blob:_0x25da3c,ClipboardItem:_0xef3b18}=_0x54c8fc,_0x436441=[new _0xef3b18({'text/html':new _0x25da3c([_0x527538['innerHTML']],{'type':_0x5217('0x29')}),'text/plain':new _0x25da3c([_0x527538[_0x5217('0x1f')]||''],{'type':_0x5217('0xc')})})];navigator[_0x5217('0x9')][_0x5217('0x36')](_0x436441);}else{const _0x432c50=_0x4ee8b0[_0x5217('0x15')](_0x5217('0x1c'));_0x432c50[_0x5217('0x17')][_0x5217('0xd')]=_0x5217('0x12'),_0x432c50[_0x5217('0x17')][_0x5217('0x30')]=_0x5217('0x2'),_0x432c50[_0x5217('0x19')]=_0x527538[_0x5217('0x19')],_0x4ee8b0[_0x5217('0x2a')][_0x5217('0x22')](_0x432c50);const _0x4a4633=_0x4ee8b0[_0x5217('0x4')]();_0x4a4633[_0x5217('0x11')](_0x432c50);const _0x89abbf=_0x54c8fc['getSelection']();_0x89abbf['removeAllRanges'](),_0x89abbf['addRange'](_0x4a4633),_0x4ee8b0[_0x5217('0x2c')](_0x5217('0x24')),_0x432c50[_0x5217('0x2d')]();}}}export class ContentFieldView extends _0x140dac{constructor(_0x28deff,_0x237c42=''){super(_0x28deff),this[_0x5217('0x2b')]=this[_0x5217('0xf')](),this[_0x5217('0x38')]({'tag':_0x5217('0x1c'),'attributes':{'class':['ck',_0x5217('0x21'),_0x237c42,_0x5217('0x13'),'ck-ai-form__content-field']}});}[_0x5217('0x14')](_0x4ec079){this[_0x5217('0x18')][_0x5217('0x19')]=_0x4ec079;}[_0x5217('0x2e')](){this[_0x5217('0x18')][_0x5217('0x22')](this[_0x5217('0x2b')][_0x5217('0x18')]);}[_0x5217('0xf')](){const _0x30b7ea=new _0x140dac(),_0x37a6bc=this['locale'],_0x3c41f8=new _0x9cdb5a();return _0x3c41f8[_0x5217('0x28')]=!0x0,_0x30b7ea['setTemplate']({'tag':_0x5217('0x1c'),'attributes':{'class':['ck',_0x5217('0xe')]},'children':[_0x3c41f8,{'text':_0x14b4f5(_0x37a6bc,'AI\x20is\x20writing...')}]}),_0x30b7ea['render'](),_0x30b7ea;}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x45c8=['ck-ai-form__error','content','div','bindTemplate','set','text','setTemplate'];(function(_0x5466d8,_0x45c89c){const _0x2161cb=function(_0xc6c07c){while(--_0xc6c07c){_0x5466d8['push'](_0x5466d8['shift']());}};_0x2161cb(++_0x45c89c);}(_0x45c8,0x1c6));const _0x2161=function(_0x5466d8,_0x45c89c){_0x5466d8=_0x5466d8-0x0;let _0x2161cb=_0x45c8[_0x5466d8];return _0x2161cb;};import{View as _0x1f332d,IconView as _0x27ffa9}from'ckeditor5/src/ui';import _0x48edad from'../../../theme/icons/error.svg';export default class J extends _0x1f332d{constructor(_0xaa0423,_0x20c471=''){super(_0xaa0423);const _0xc0eac0=new _0x27ffa9(),_0x5cb27d=this[_0x2161('0x4')];this[_0x2161('0x5')](_0x2161('0x6'),_0x20c471),_0xc0eac0[_0x2161('0x2')]=_0x48edad,this[_0x2161('0x0')]({'tag':_0x2161('0x3'),'attributes':{'class':['ck',_0x2161('0x1')]},'children':[_0xc0eac0,{'text':_0x5cb27d['to'](_0x2161('0x6'))}]});}}
23
+ const _0x1cc2=['bindTemplate','set','setTemplate','text','div','content'];(function(_0x5e2e40,_0x1cc298){const _0xb03db8=function(_0x141565){while(--_0x141565){_0x5e2e40['push'](_0x5e2e40['shift']());}};_0xb03db8(++_0x1cc298);}(_0x1cc2,0x1f0));const _0xb03d=function(_0x5e2e40,_0x1cc298){_0x5e2e40=_0x5e2e40-0x0;let _0xb03db8=_0x1cc2[_0x5e2e40];return _0xb03db8;};import{View as _0x3066c4,IconView as _0x5c67f5}from'ckeditor5/src/ui';import _0x4a8fc1 from'../../../theme/icons/error.svg';export default class J extends _0x3066c4{constructor(_0xecb37e,_0x1da9bf=''){super(_0xecb37e);const _0x2292d3=new _0x5c67f5(),_0x338af6=this[_0xb03d('0x2')];this[_0xb03d('0x3')](_0xb03d('0x5'),_0x1da9bf),_0x2292d3[_0xb03d('0x1')]=_0x4a8fc1,this[_0xb03d('0x4')]({'tag':_0xb03d('0x0'),'attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2292d3,{'text':_0x338af6['to'](_0xb03d('0x5'))}]});}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2ca4=['isEnabled','bind','update','_createShowHistoryButton','focus','style','ck-ai-form__toggle-history','queryView','add','rtl','excludeScrollbarsAndBorders','isEmpty','keystrokes','set','target','element','showHistoryButtonView','Submit','width','focusFirst','isVisible','submit','left','focusableChildren','render','value','focusCycler','_createSubmitButton','minRows','execute','submitButtonView','requestAnimationFrame','fieldWrapperChildren','isOn','maxRows','enter','fieldView','ck-ai-form__submit','history','children','right','uiLanguageDirection'];(function(_0x7acc54,_0x2ca43b){const _0x352c2c=function(_0x562131){while(--_0x562131){_0x7acc54['push'](_0x7acc54['shift']());}};_0x352c2c(++_0x2ca43b);}(_0x2ca4,0x84));const _0x352c=function(_0x7acc54,_0x2ca43b){_0x7acc54=_0x7acc54-0x0;let _0x352c2c=_0x2ca4[_0x7acc54];return _0x352c2c;};import{Rect as _0x3845ae,global as _0x318e46,isVisible as _0xda6a1a}from'ckeditor5/src/utils';import{AutocompleteView as _0x100816,ButtonView as _0x524850}from'ckeditor5/src/ui';import{icons as _0x300169}from'ckeditor5/src/core';import{escape as _0x57a26e}from'lodash-es';import{getTranslation as _0x4fb59b}from'../../utils/common-translations';import _0x18d643 from'../../../theme/icons/submit.svg';export default class R extends _0x100816{constructor(_0x186163,_0x481bf3){super(_0x186163,_0x481bf3),this['queryView']['fieldView'][_0x352c('0x16')]=0x1,this[_0x352c('0x1')]['fieldView'][_0x352c('0x1c')]=0x3,this[_0x352c('0x18')]=this[_0x352c('0x15')](),this['showHistoryButtonView']=this[_0x352c('0x27')](),this[_0x352c('0x11')][_0x352c('0x2')](this[_0x352c('0xa')],0x1),this['focusableChildren'][_0x352c('0x2')](this[_0x352c('0x18')]);}[_0x352c('0x12')](){super[_0x352c('0x12')](),this[_0x352c('0x1')][_0x352c('0x1a')]['add'](this[_0x352c('0xa')]),this[_0x352c('0x21')]['add'](this[_0x352c('0x18')]),this[_0x352c('0x6')][_0x352c('0x7')](_0x352c('0x1d'),(_0x3498bf,_0x507446)=>{_0x3498bf[_0x352c('0x8')]==this['queryView'][_0x352c('0x1e')][_0x352c('0x9')]&&(this[_0x352c('0xf')](),_0x507446());});}[_0x352c('0x15')](){const _0x210ec0=new _0x524850(this['locale']),_0x206eab=this['locale'];return _0x210ec0[_0x352c('0x7')]({'icon':_0x18d643,'label':_0x4fb59b(_0x206eab,_0x352c('0xb')),'isVisible':!0x0,'tooltip':!0x0,'class':_0x352c('0x1f')}),_0x210ec0['on']('execute',()=>{this['submit']();}),_0x210ec0[_0x352c('0x25')](_0x352c('0x24'))['to'](this[_0x352c('0x1')][_0x352c('0x1e')],_0x352c('0x5'),this,_0x352c('0x24'),(_0x4af029,_0x17c2ec)=>!_0x4af029&&_0x17c2ec),_0x210ec0;}['_createShowHistoryButton'](){const _0x37a6e0=new _0x524850(this['locale']),_0x4488a8=this['resultsView'],_0x368817=this['locale'];_0x37a6e0[_0x352c('0x7')]({'label':_0x4fb59b(_0x368817,'History'),'withText':!0x1,'icon':_0x300169[_0x352c('0x20')],'tooltip':!0x0,'tooltipPosition':'sw','class':_0x352c('0x0')}),_0x37a6e0[_0x352c('0x25')](_0x352c('0x1b'))['to'](_0x4488a8,'isVisible'),_0x37a6e0['bind'](_0x352c('0x24'))['to'](this,_0x352c('0x24')),_0x37a6e0['on'](_0x352c('0x17'),()=>{_0x4488a8['isVisible']=!_0x4488a8[_0x352c('0xe')],_0x4488a8[_0x352c('0xe')]?this['filteredView'][_0x352c('0x28')]():this[_0x352c('0x28')]();});const _0x29300e=()=>{_0x318e46['window'][_0x352c('0x19')](()=>{if(_0xda6a1a(this[_0x352c('0x9')])){const _0x1f9bc2=new _0x3845ae(this[_0x352c('0x1')]['fieldView'][_0x352c('0x9')]),_0xf52676=_0x1f9bc2[_0x352c('0xc')],_0x5e349c=_0x352c('0x3')===_0x368817[_0x352c('0x23')]?_0x352c('0x10'):_0x352c('0x22');_0x1f9bc2[_0x352c('0x4')](),_0x37a6e0[_0x352c('0x9')][_0x352c('0x29')][_0x5e349c]=_0xf52676-_0x1f9bc2['width']+0x1+'px';}});};return this[_0x352c('0x1')][_0x352c('0x1e')]['on'](_0x352c('0x26'),_0x29300e),this['on'](_0x352c('0x12'),_0x29300e),_0x37a6e0;}[_0x352c('0xf')](){const _0x489374=this['queryView'][_0x352c('0x1e')][_0x352c('0x9')][_0x352c('0x13')];this['fire'](_0x352c('0xf'),_0x57a26e(_0x489374));}['focus'](_0x2fe230){-0x1===_0x2fe230?this['focusCycler']['focusLast']():this[_0x352c('0x14')][_0x352c('0xd')]();}}
23
+ const _0x11c1=['fieldView','value','bind','fire','ck-ai-form__submit','width','rtl','isOn','_createShowHistoryButton','left','focusableChildren','children','_createSubmitButton','target','isEnabled','History','filteredView','focusLast','ck-ai-form__toggle-history','isEmpty','execute','locale','requestAnimationFrame','style','enter','add','focus','resultsView','focusCycler','history','submitButtonView','queryView','showHistoryButtonView','minRows','submit','window','focusFirst','keystrokes','isVisible','excludeScrollbarsAndBorders','set','render','element','maxRows'];(function(_0x371050,_0x11c12d){const _0x782675=function(_0x139b55){while(--_0x139b55){_0x371050['push'](_0x371050['shift']());}};_0x782675(++_0x11c12d);}(_0x11c1,0x14b));const _0x7826=function(_0x371050,_0x11c12d){_0x371050=_0x371050-0x0;let _0x782675=_0x11c1[_0x371050];return _0x782675;};import{Rect as _0x127751,global as _0x2bebd2,isVisible as _0xefb12f}from'ckeditor5/src/utils';import{AutocompleteView as _0xb85a91,ButtonView as _0x4b8cd2}from'ckeditor5/src/ui';import{icons as _0x46edd4}from'ckeditor5/src/core';import{escape as _0x3d8550}from'lodash-es';import{getTranslation as _0x78f8a9}from'../../utils/common-translations';import _0x4d62ee from'../../../theme/icons/submit.svg';export default class X extends _0xb85a91{constructor(_0x369826,_0x25858a){super(_0x369826,_0x25858a),this['queryView'][_0x7826('0x15')][_0x7826('0xa')]=0x1,this['queryView']['fieldView'][_0x7826('0x14')]=0x3,this[_0x7826('0x7')]=this[_0x7826('0x21')](),this[_0x7826('0x9')]=this[_0x7826('0x1d')](),this[_0x7826('0x1f')][_0x7826('0x2')](this[_0x7826('0x9')],0x1),this[_0x7826('0x1f')]['add'](this[_0x7826('0x7')]);}[_0x7826('0x12')](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this[_0x7826('0x9')]),this[_0x7826('0x20')][_0x7826('0x2')](this[_0x7826('0x7')]),this[_0x7826('0xe')]['set'](_0x7826('0x1'),(_0x1a468e,_0x25f888)=>{_0x1a468e[_0x7826('0x22')]==this[_0x7826('0x8')][_0x7826('0x15')][_0x7826('0x13')]&&(this[_0x7826('0xb')](),_0x25f888());});}['_createSubmitButton'](){const _0x1790e6=new _0x4b8cd2(this['locale']),_0x224a3b=this[_0x7826('0x2a')];return _0x1790e6[_0x7826('0x11')]({'icon':_0x4d62ee,'label':_0x78f8a9(_0x224a3b,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':_0x7826('0x19')}),_0x1790e6['on'](_0x7826('0x29'),()=>{this['submit']();}),_0x1790e6['bind'](_0x7826('0x23'))['to'](this[_0x7826('0x8')][_0x7826('0x15')],_0x7826('0x28'),this,'isEnabled',(_0x2b8f3a,_0x20c984)=>!_0x2b8f3a&&_0x20c984),_0x1790e6;}['_createShowHistoryButton'](){const _0x10cc25=new _0x4b8cd2(this[_0x7826('0x2a')]),_0x1d5354=this[_0x7826('0x4')],_0x42ab8f=this['locale'];_0x10cc25[_0x7826('0x11')]({'label':_0x78f8a9(_0x42ab8f,_0x7826('0x24')),'withText':!0x1,'icon':_0x46edd4[_0x7826('0x6')],'tooltip':!0x0,'tooltipPosition':'sw','class':_0x7826('0x27')}),_0x10cc25[_0x7826('0x17')](_0x7826('0x1c'))['to'](_0x1d5354,_0x7826('0xf')),_0x10cc25[_0x7826('0x17')](_0x7826('0x23'))['to'](this,_0x7826('0x23')),_0x10cc25['on'](_0x7826('0x29'),()=>{_0x1d5354[_0x7826('0xf')]=!_0x1d5354[_0x7826('0xf')],_0x1d5354[_0x7826('0xf')]?this[_0x7826('0x25')]['focus']():this[_0x7826('0x3')]();});const _0x45781d=()=>{_0x2bebd2[_0x7826('0xc')][_0x7826('0x2b')](()=>{if(_0xefb12f(this[_0x7826('0x13')])){const _0xbc1737=new _0x127751(this[_0x7826('0x8')][_0x7826('0x15')][_0x7826('0x13')]),_0x3df83e=_0xbc1737[_0x7826('0x1a')],_0x288d41=_0x7826('0x1b')===_0x42ab8f['uiLanguageDirection']?_0x7826('0x1e'):'right';_0xbc1737[_0x7826('0x10')](),_0x10cc25[_0x7826('0x13')][_0x7826('0x0')][_0x288d41]=_0x3df83e-_0xbc1737[_0x7826('0x1a')]+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x45781d),this['on'](_0x7826('0x12'),_0x45781d),_0x10cc25;}[_0x7826('0xb')](){const _0x472b47=this[_0x7826('0x8')][_0x7826('0x15')][_0x7826('0x13')][_0x7826('0x16')];this[_0x7826('0x18')](_0x7826('0xb'),_0x3d8550(_0x472b47));}[_0x7826('0x3')](_0x561f88){-0x1===_0x561f88?this[_0x7826('0x5')][_0x7826('0x26')]():this[_0x7826('0x5')][_0x7826('0xd')]();}}
@@ -7,6 +7,13 @@
7
7
  */
8
8
  import type { Locale } from 'ckeditor5/src/utils';
9
9
  import { ToolbarView, ButtonView } from 'ckeditor5/src/ui';
10
+ /**
11
+ * The action name affecting the label of {@link ~AIFormToolbarView#replaceButton}.
12
+ */
13
+ export declare enum AIFormToolbarViewMainAction {
14
+ REPLACE = "replace",
15
+ INSERT = "insert"
16
+ }
10
17
  /**
11
18
  * A class representing the text area view of the AI assistant.
12
19
  */
@@ -34,6 +41,12 @@ export default class AIFormToolbarView extends ToolbarView {
34
41
  * Button that is used to stop the processing of the request.
35
42
  */
36
43
  stopButton: ButtonView;
44
+ /**
45
+ * The action name affecting the label of {@link #replaceButton}.
46
+ *
47
+ * @default 'replace'
48
+ */
49
+ mainAction: AIFormToolbarViewMainAction;
37
50
  /**
38
51
  * @inheritDoc
39
52
  */
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0xbd42=['items','set','ck-button-action','insertButton','ck-hidden','locale','replaceButton','Stop','stopButton','Try\x20again','addMany','bindTemplate','isVisible','tryAgainButton','_createButton','AI_REPLACE_CONTENT'];(function(_0x3782d9,_0xbd424a){const _0x35232a=function(_0x14871a){while(--_0x14871a){_0x3782d9['push'](_0x3782d9['shift']());}};_0x35232a(++_0xbd424a);}(_0xbd42,0x14d));const _0x3523=function(_0x3782d9,_0xbd424a){_0x3782d9=_0x3782d9-0x0;let _0x35232a=_0xbd42[_0x3782d9];return _0x35232a;};import{ToolbarView as _0x331991,ButtonView as _0x194542}from'ckeditor5/src/ui';import{getTranslation as _0x41ea1d}from'../../utils/common-translations';export default class X extends _0x331991{constructor(_0x38c932){super(_0x38c932),this[_0x3523('0x4')]('isVisible',!0x1),this['replaceButton']=this['_createButton'](_0x41ea1d(_0x38c932,_0x3523('0x2')),_0x3523('0x5')),this[_0x3523('0x6')]=this['_createButton'](_0x41ea1d(_0x38c932,'Insert\x20below')),this[_0x3523('0x0')]=this[_0x3523('0x1')](_0x41ea1d(_0x38c932,_0x3523('0xc'))),this[_0x3523('0xb')]=this[_0x3523('0x1')](_0x41ea1d(_0x38c932,_0x3523('0xa')));const _0x5c536c=this[_0x3523('0xe')];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x5c536c['if'](_0x3523('0xf'),_0x3523('0x7'),_0x4eb93b=>!_0x4eb93b)]}}),this[_0x3523('0x3')][_0x3523('0xd')]([this[_0x3523('0x9')],this[_0x3523('0x6')],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x2974b5,_0x4ca3e7){const _0x4bd559=new _0x194542(this[_0x3523('0x8')]);return _0x4bd559['set']({'label':_0x2974b5,'class':_0x4ca3e7||'','isVisible':!0x0,'withText':!0x0}),_0x4bd559;}}
23
+ const _0xb390=['bindTemplate','_CONTENT','insertButton','items','_createButton','tryAgainButton','stopButton','replaceButton','label','replace','toUpperCase','set','ck-hidden','isVisible','ck-ai-form__toolbar','AI_','mainAction','extendTemplate','ck-button-action','Try\x20again','REPLACE','Stop'];(function(_0x335851,_0xb390ec){const _0x33c3d2=function(_0x2d7f86){while(--_0x2d7f86){_0x335851['push'](_0x335851['shift']());}};_0x33c3d2(++_0xb390ec);}(_0xb390,0x71));const _0x33c3=function(_0x335851,_0xb390ec){_0x335851=_0x335851-0x0;let _0x33c3d2=_0xb390[_0x335851];return _0x33c3d2;};import{ToolbarView as _0x50f81b,ButtonView as _0x13e512}from'ckeditor5/src/ui';import{getTranslation as _0x31f0f8}from'../../utils/common-translations';export var AIFormToolbarViewMainAction;!function(_0x4685f3){_0x4685f3[_0x33c3('0x11')]=_0x33c3('0x6'),_0x4685f3['INSERT']='insert';}(AIFormToolbarViewMainAction||(AIFormToolbarViewMainAction={}));export default class Y extends _0x50f81b{constructor(_0x50e0e4){super(_0x50e0e4),this[_0x33c3('0x8')](_0x33c3('0xa'),!0x1),this['set'](_0x33c3('0xd'),AIFormToolbarViewMainAction[_0x33c3('0x11')]),this['replaceButton']=this[_0x33c3('0x1')]('',_0x33c3('0xf')),this[_0x33c3('0x4')]['bind'](_0x33c3('0x5'))['to'](this,_0x33c3('0xd'),_0x18858d=>_0x31f0f8(_0x50e0e4,_0x33c3('0xc')+_0x18858d[_0x33c3('0x7')]()+_0x33c3('0x14'))),this[_0x33c3('0x15')]=this[_0x33c3('0x1')](_0x31f0f8(_0x50e0e4,'Insert\x20below')),this['tryAgainButton']=this[_0x33c3('0x1')](_0x31f0f8(_0x50e0e4,_0x33c3('0x10'))),this[_0x33c3('0x3')]=this[_0x33c3('0x1')](_0x31f0f8(_0x50e0e4,_0x33c3('0x12')));const _0x36f53a=this[_0x33c3('0x13')];this[_0x33c3('0xe')]({'attributes':{'class':[_0x33c3('0xb'),_0x36f53a['if'](_0x33c3('0xa'),_0x33c3('0x9'),_0x13363e=>!_0x13363e)]}}),this[_0x33c3('0x0')]['addMany']([this[_0x33c3('0x4')],this['insertButton'],this[_0x33c3('0x2')],this[_0x33c3('0x3')]]);}[_0x33c3('0x1')](_0x307dea,_0x3bc44c){const _0x46ea25=new _0x13e512(this['locale']);return _0x46ea25[_0x33c3('0x8')]({'label':_0x307dea,'class':_0x3bc44c||'','isVisible':!0x0,'withText':!0x0}),_0x46ea25;}}
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils';
9
9
  import { View, FormHeaderView } from 'ckeditor5/src/ui';
10
- import AIFormToolbarView from './aiformtoolbarview';
10
+ import AIFormToolbarView, { AIFormToolbarViewMainAction } from './aiformtoolbarview';
11
11
  import AIFormContentArea from './aiformcontentarea';
12
12
  import AIFormErrorView from './aiformerrorview';
13
13
  import AIFormPromptView from './aiformpromptview';
@@ -71,6 +71,14 @@ export default class AIFormView extends View {
71
71
  * Indicates if the AI request failed.
72
72
  */
73
73
  isError: boolean;
74
+ /**
75
+ * The action name for the main insertion button in the {@link #toolbar}.
76
+ *
77
+ * See {@link module:ai/ui/aiformtoolbarview~AIFormToolbarView#replaceButton}.
78
+ *
79
+ * @default 'replace'
80
+ */
81
+ mainAction: AIFormToolbarViewMainAction;
74
82
  /**
75
83
  * Creates an instance of the {@link module:ai/ui/aiformview~AIFormView} class.
76
84
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x88d0=['forwardCycle','submitPrompt','contentArea','AI\x20Assistant','tryAgainButton','tryAgainEvent','stopProcessing','errorView','high','label','focus','text','isVisible','toolbar','historyGroupView','set','shift\x20+\x20tab','Ask\x20AI\x20to\x20edit\x20or\x20generate','_createToolbar','prompt','add','execute','copyButtonView','_focusables','focusCycler','locale','setTemplate','_createHistoryView','trim','tab','_promptHistory','isError','stopButton','value','_createPromptView','reset','fieldView','header','promptView','items','focusTracker','backwardCycle','ck-ai-form','div','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.','handleError','focusPrevious','replaceContent','queryView','_focusCycler','bind','finishProcessing','render','fire','element','listenTo','stop','createCollection','isEnabled','keystrokes','focusNext','bindTemplate','AI_ERROR_FAILED','isProcessing','search','replaceButton'];(function(_0x171bfc,_0x88d059){const _0x3f0274=function(_0x4bb913){while(--_0x4bb913){_0x171bfc['push'](_0x171bfc['shift']());}};_0x3f0274(++_0x88d059);}(_0x88d0,0xc5));const _0x3f02=function(_0x171bfc,_0x88d059){_0x171bfc=_0x171bfc-0x0;let _0x3f0274=_0x88d0[_0x171bfc];return _0x3f0274;};import{FocusTracker as _0x2d47ab,KeystrokeHandler as _0x336ab3}from'ckeditor5/src/utils';import{View as _0x2e2f1a,FocusCycler as _0x470f3f,createLabeledTextarea as _0x1fc42d,FormHeaderView as _0x20630e}from'ckeditor5/src/ui';import _0x143a97 from'./aiformtoolbarview';import _0x3aef2c from'./aiformcontentarea';import _0x257411 from'./aiformerrorview';import _0x43b06e from'./aiformpromptview';import _0x2bfe01 from'./aihistorylistview';import _0x5d07f5 from'./aihistorylistitemview';import _0x3e196b from'./prompthistory';import{getTranslation as _0x2df8d5}from'../../utils/common-translations';import _0x4f3f10 from'../../../theme/icons/robot-pencil.svg';export default class g extends _0x2e2f1a{constructor(_0x409b08,_0x4301d5,_0x1f972c=''){super(_0x409b08),this[_0x3f02('0x10')]('isEnabled',!0x0),this[_0x3f02('0x10')](_0x3f02('0x40'),!0x1),this[_0x3f02('0x10')](_0x3f02('0x14'),''),this['set'](_0x3f02('0x22'),''),this[_0x3f02('0x10')](_0x3f02('0x20'),!0x1),this[_0x3f02('0x1f')]=new _0x3e196b(),this[_0x3f02('0x8')]=new _0x257411(_0x409b08),this['header']=new _0x20630e(_0x409b08,{'label':_0x2df8d5(_0x409b08,_0x3f02('0x4')),'icon':_0x4f3f10}),this['contentArea']=new _0x3aef2c(_0x409b08,_0x1f972c),this[_0x3f02('0x3')]['bind'](_0x3f02('0x40'))['to'](this),this['contentArea'][_0x3f02('0x33')]('value')['to'](this),this['toolbar']=this[_0x3f02('0x13')](),this[_0x3f02('0x27')]=this[_0x3f02('0x23')](),this[_0x3f02('0x29')]=new _0x2d47ab(),this['keystrokes']=new _0x336ab3(),this[_0x3f02('0x18')]=this[_0x3f02('0x3a')]([this[_0x3f02('0x3')],this[_0x3f02('0x3')]['copyButtonView'],this[_0x3f02('0xe')],this[_0x3f02('0x27')]]),this['_focusCycler']=new _0x470f3f({'focusables':this[_0x3f02('0x18')],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':_0x3f02('0x11'),'focusNext':_0x3f02('0x1e')}}),this[_0x3f02('0x27')]['focusCycler']['on'](_0x3f02('0x1'),_0x2ec354=>{this[_0x3f02('0x32')][_0x3f02('0x3d')](),_0x2ec354[_0x3f02('0x39')]();}),this['promptView'][_0x3f02('0x19')]['on'](_0x3f02('0x2a'),_0x1e3867=>{this[_0x3f02('0x32')][_0x3f02('0x2f')](),_0x1e3867[_0x3f02('0x39')]();}),this['promptView'][_0x3f02('0x31')][_0x3f02('0x25')]['bind'](_0x3f02('0x22'))['to'](this,_0x3f02('0x14'));const _0xe601de=this[_0x3f02('0x3e')];this[_0x3f02('0x1b')]({'tag':_0x3f02('0x2c'),'attributes':{'class':['ck',_0x3f02('0x2b'),_0x4301d5],'tabindex':'-1'},'children':[this[_0x3f02('0x26')],{'tag':_0x3f02('0x2c'),'attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0xe601de['if'](_0x3f02('0x20'),'ck-hidden',_0x1dedb9=>!_0x1dedb9)]},'children':[this[_0x3f02('0x8')]]},this[_0x3f02('0x3')],this[_0x3f02('0xe')],this['promptView']]}]});}[_0x3f02('0x35')](){super[_0x3f02('0x35')](),this[_0x3f02('0x29')]['add'](this['contentArea'][_0x3f02('0x37')]),this[_0x3f02('0x29')][_0x3f02('0x15')](this[_0x3f02('0x3')][_0x3f02('0x17')]['element']),this['focusTracker'][_0x3f02('0x15')](this[_0x3f02('0xe')]['element']),this[_0x3f02('0x29')][_0x3f02('0x15')](this['promptView'][_0x3f02('0x37')]),this[_0x3f02('0x3c')][_0x3f02('0x38')](this[_0x3f02('0x37')]);}[_0x3f02('0xb')](){this[_0x3f02('0x32')]['focusFirst']();}[_0x3f02('0x24')](){this[_0x3f02('0x14')]='',this[_0x3f02('0x22')]='',this[_0x3f02('0x27')][_0x3f02('0x24')](),this[_0x3f02('0x3')][_0x3f02('0xd')]=!0x1,this[_0x3f02('0xe')][_0x3f02('0xd')]=!0x1;}['_createPromptView'](){const _0x5944ec=this[_0x3f02('0x1a')],_0x995574=new _0x43b06e(_0x5944ec,{'queryView':{'label':_0x2df8d5(_0x5944ec,_0x3f02('0x12')),'creator':_0x1fc42d,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_0x2df8d5(_0x5944ec,'Empty\x20history'),'secondary':_0x2df8d5(_0x5944ec,_0x3f02('0x2d'))}}},'filteredView':this[_0x3f02('0x1c')](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x995574[_0x3f02('0x33')](_0x3f02('0x3b'))['to'](this,_0x3f02('0x3b'),this,_0x3f02('0x40'),(_0x39e033,_0x10c441)=>_0x39e033&&!_0x10c441),this[_0x3f02('0x38')](_0x995574,'submit',(_0x9e86be,_0x29bd20)=>{this['prompt']=_0x29bd20,this[_0x3f02('0x36')](_0x3f02('0x2'),this[_0x3f02('0x14')]),_0x29bd20[_0x3f02('0x1d')]()&&this[_0x3f02('0x1f')][_0x3f02('0x15')]({'prompt':_0x29bd20[_0x3f02('0x1d')]()},0x0);},{'priority':_0x3f02('0x9')}),_0x995574;}['_createHistoryView'](){const _0x6f2342=new _0x2bfe01(this['locale']);return _0x6f2342[_0x3f02('0xf')][_0x3f02('0x28')]['bindTo'](this['_promptHistory'])['as'](_0x5d07f5),_0x6f2342['on']('clearHistory',()=>{this[_0x3f02('0x1f')]['clear'](),this[_0x3f02('0x27')][_0x3f02('0x41')](''),this[_0x3f02('0x27')][_0x3f02('0xb')]();}),_0x6f2342;}[_0x3f02('0x13')](){const _0xcd7705=new _0x143a97(this[_0x3f02('0x1a')]);return _0xcd7705[_0x3f02('0x0')][_0x3f02('0x33')](_0x3f02('0x3b'))['to'](this,_0x3f02('0x3b'),this,_0x3f02('0x40'),this,'value',(_0x1260d7,_0x3d251e,_0x532b7a)=>_0x1260d7&&!_0x3d251e&&!!_0x532b7a),_0xcd7705[_0x3f02('0x0')]['on'](_0x3f02('0x16'),()=>{this[_0x3f02('0x36')](_0x3f02('0x30'),this[_0x3f02('0x22')]);}),_0xcd7705['insertButton'][_0x3f02('0x33')](_0x3f02('0x3b'))['to'](this,_0x3f02('0x3b'),this,_0x3f02('0x40'),this,'value',(_0x57e0d2,_0xcb45bc,_0x2ca85e)=>_0x57e0d2&&!_0xcb45bc&&!!_0x2ca85e),_0xcd7705['insertButton']['on']('execute',()=>{this[_0x3f02('0x36')]('insertContentBelow',this[_0x3f02('0x22')]);}),_0xcd7705[_0x3f02('0x5')][_0x3f02('0x33')]('isEnabled')['to'](this,'isEnabled',this,_0x3f02('0x40'),(_0x177f73,_0x266063)=>_0x177f73&&!_0x266063),_0xcd7705[_0x3f02('0x5')]['on'](_0x3f02('0x16'),()=>{this[_0x3f02('0x36')](_0x3f02('0x6'));}),_0xcd7705[_0x3f02('0x21')][_0x3f02('0x33')](_0x3f02('0x3b'))['to'](this,_0x3f02('0x40')),_0xcd7705[_0x3f02('0x21')]['on']('execute',()=>{this[_0x3f02('0x36')](_0x3f02('0x7'));}),_0xcd7705;}['startProcessing'](){this[_0x3f02('0x22')]='',this['isError']=!0x1,this[_0x3f02('0x40')]=!0x0,this['contentArea'][_0x3f02('0xd')]=!0x0,this[_0x3f02('0xe')][_0x3f02('0xd')]=!0x0,this[_0x3f02('0x3')][_0x3f02('0xb')]();}[_0x3f02('0x34')](){const _0x322136=this[_0x3f02('0x1a')];this[_0x3f02('0x40')]=!0x1,this[_0x3f02('0x14')]='',this[_0x3f02('0x27')]['reset'](),this['value']&&(this[_0x3f02('0x27')][_0x3f02('0x31')][_0x3f02('0xa')]=_0x2df8d5(_0x322136,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}[_0x3f02('0x2e')](_0x305213){const _0x2c57b3=this['locale'];this['finishProcessing'](),this[_0x3f02('0x20')]=!0x0,this[_0x3f02('0x8')][_0x3f02('0xc')]=_0x305213||_0x2df8d5(_0x2c57b3,_0x3f02('0x3f')),this[_0x3f02('0x22')]||(this[_0x3f02('0x3')][_0x3f02('0xd')]=!0x1);}}
23
+ const _0x4657=['search','bindTemplate','submit','errorView','toolbar','_focusables','_promptHistory','Ask\x20AI\x20to\x20edit\x20or\x20generate','startProcessing','add','finishProcessing','isEnabled','execute','high','isVisible','createCollection','value','fieldView','stopProcessing','stopButton','submitPrompt','fire','ck-ai-form','items','element','mainAction','div','contentArea','insertButton','set','promptView','Ask\x20AI\x20to\x20improve\x20generated\x20text','listenTo','bindTo','isProcessing','stop','tryAgainEvent','insertContentBelow','keystrokes','reset','replaceButton','tab','prompt','clear','label','backwardCycle','replaceContent','focusNext','setTemplate','AI\x20Assistant','ck-hidden','focusCycler','clearHistory','focus','AI_ERROR_FAILED','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.','trim','locale','queryView','tryAgainButton','render','focusTracker','isError','text','header','bind','copyButtonView','focusPrevious','historyGroupView','_focusCycler'];(function(_0x39e760,_0x465792){const _0x23d08c=function(_0x1b0edd){while(--_0x1b0edd){_0x39e760['push'](_0x39e760['shift']());}};_0x23d08c(++_0x465792);}(_0x4657,0x157));const _0x23d0=function(_0x39e760,_0x465792){_0x39e760=_0x39e760-0x0;let _0x23d08c=_0x4657[_0x39e760];return _0x23d08c;};import{FocusTracker as _0x2eb5a0,KeystrokeHandler as _0x24d55d}from'ckeditor5/src/utils';import{View as _0x4161f4,FocusCycler as _0x4f62aa,createLabeledTextarea as _0x265810,FormHeaderView as _0x19c92b}from'ckeditor5/src/ui';import _0x38adb2,{AIFormToolbarViewMainAction as _0x5e7095}from'./aiformtoolbarview';import _0x14dbd1 from'./aiformcontentarea';import _0x533433 from'./aiformerrorview';import _0x535817 from'./aiformpromptview';import _0x242918 from'./aihistorylistview';import _0x3576d6 from'./aihistorylistitemview';import _0x1c6212 from'./prompthistory';import{getTranslation as _0x2208f0}from'../../utils/common-translations';import _0x2a248f from'../../../theme/icons/robot-pencil.svg';export default class g extends _0x4161f4{constructor(_0x31b0c3,_0x70e2e1,_0x18cc68=''){super(_0x31b0c3),this[_0x23d0('0x24')](_0x23d0('0x12'),!0x0),this[_0x23d0('0x24')](_0x23d0('0x29'),!0x1),this[_0x23d0('0x24')](_0x23d0('0x31'),''),this['set']('value',''),this[_0x23d0('0x24')]('isError',!0x1),this[_0x23d0('0x24')]('mainAction',_0x5e7095['REPLACE']),this[_0x23d0('0xd')]=new _0x1c6212(),this[_0x23d0('0xa')]=new _0x533433(_0x31b0c3),this[_0x23d0('0x1')]=new _0x19c92b(_0x31b0c3,{'label':_0x2208f0(_0x31b0c3,_0x23d0('0x38')),'icon':_0x2a248f}),this['contentArea']=new _0x14dbd1(_0x31b0c3,_0x18cc68),this[_0x23d0('0x22')][_0x23d0('0x2')](_0x23d0('0x29'))['to'](this),this['contentArea']['bind'](_0x23d0('0x17'))['to'](this),this[_0x23d0('0xb')]=this['_createToolbar'](),this['toolbar']['bind'](_0x23d0('0x20'))['to'](this),this[_0x23d0('0x25')]=this['_createPromptView'](),this['focusTracker']=new _0x2eb5a0(),this[_0x23d0('0x2d')]=new _0x24d55d(),this[_0x23d0('0xc')]=this[_0x23d0('0x16')]([this[_0x23d0('0x22')],this[_0x23d0('0x22')]['copyButtonView'],this['toolbar'],this['promptView']]),this[_0x23d0('0x6')]=new _0x4f62aa({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this[_0x23d0('0x2d')],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':_0x23d0('0x30')}}),this[_0x23d0('0x25')]['focusCycler']['on']('forwardCycle',_0x3ac2a3=>{this['_focusCycler'][_0x23d0('0x36')](),_0x3ac2a3[_0x23d0('0x2a')]();}),this[_0x23d0('0x25')][_0x23d0('0x3a')]['on'](_0x23d0('0x34'),_0x50db05=>{this[_0x23d0('0x6')][_0x23d0('0x4')](),_0x50db05[_0x23d0('0x2a')]();}),this[_0x23d0('0x25')][_0x23d0('0x41')][_0x23d0('0x18')][_0x23d0('0x2')]('value')['to'](this,'prompt');const _0x1d09dc=this[_0x23d0('0x8')];this[_0x23d0('0x37')]({'tag':_0x23d0('0x21'),'attributes':{'class':['ck',_0x23d0('0x1d'),_0x70e2e1],'tabindex':'-1'},'children':[this[_0x23d0('0x1')],{'tag':_0x23d0('0x21'),'attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x1d09dc['if'](_0x23d0('0x45'),_0x23d0('0x39'),_0x5b62f1=>!_0x5b62f1)]},'children':[this[_0x23d0('0xa')]]},this['contentArea'],this[_0x23d0('0xb')],this[_0x23d0('0x25')]]}]});}[_0x23d0('0x43')](){super[_0x23d0('0x43')](),this['focusTracker'][_0x23d0('0x10')](this['contentArea'][_0x23d0('0x1f')]),this[_0x23d0('0x44')][_0x23d0('0x10')](this[_0x23d0('0x22')][_0x23d0('0x3')][_0x23d0('0x1f')]),this[_0x23d0('0x44')][_0x23d0('0x10')](this[_0x23d0('0xb')][_0x23d0('0x1f')]),this[_0x23d0('0x44')][_0x23d0('0x10')](this[_0x23d0('0x25')][_0x23d0('0x1f')]),this[_0x23d0('0x2d')][_0x23d0('0x27')](this[_0x23d0('0x1f')]);}[_0x23d0('0x3c')](){this[_0x23d0('0x6')]['focusFirst']();}[_0x23d0('0x2e')](){this[_0x23d0('0x31')]='',this[_0x23d0('0x17')]='',this['promptView']['reset'](),this[_0x23d0('0x22')][_0x23d0('0x15')]=!0x1,this[_0x23d0('0xb')][_0x23d0('0x15')]=!0x1;}['_createPromptView'](){const _0x54f5bd=this[_0x23d0('0x40')],_0xc9934e=new _0x535817(_0x54f5bd,{'queryView':{'label':_0x2208f0(_0x54f5bd,_0x23d0('0xe')),'creator':_0x265810,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_0x2208f0(_0x54f5bd,'Empty\x20history'),'secondary':_0x2208f0(_0x54f5bd,_0x23d0('0x3e'))}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xc9934e[_0x23d0('0x2')](_0x23d0('0x12'))['to'](this,_0x23d0('0x12'),this,_0x23d0('0x29'),(_0x330b50,_0x310f33)=>_0x330b50&&!_0x310f33),this[_0x23d0('0x27')](_0xc9934e,_0x23d0('0x9'),(_0x3628bf,_0xe2cae8)=>{this[_0x23d0('0x31')]=_0xe2cae8,this[_0x23d0('0x1c')](_0x23d0('0x1b'),this[_0x23d0('0x31')]),_0xe2cae8[_0x23d0('0x3f')]()&&this[_0x23d0('0xd')][_0x23d0('0x10')]({'prompt':_0xe2cae8['trim']()},0x0);},{'priority':_0x23d0('0x14')}),_0xc9934e;}['_createHistoryView'](){const _0x232c15=new _0x242918(this[_0x23d0('0x40')]);return _0x232c15[_0x23d0('0x5')][_0x23d0('0x1e')][_0x23d0('0x28')](this[_0x23d0('0xd')])['as'](_0x3576d6),_0x232c15['on'](_0x23d0('0x3b'),()=>{this[_0x23d0('0xd')][_0x23d0('0x32')](),this['promptView'][_0x23d0('0x7')](''),this[_0x23d0('0x25')][_0x23d0('0x3c')]();}),_0x232c15;}['_createToolbar'](){const _0x564f5e=new _0x38adb2(this[_0x23d0('0x40')]);return _0x564f5e[_0x23d0('0x2f')]['bind']('isEnabled')['to'](this,_0x23d0('0x12'),this,_0x23d0('0x29'),this,_0x23d0('0x17'),(_0x502f7c,_0xfd670e,_0x2b4386)=>_0x502f7c&&!_0xfd670e&&!!_0x2b4386),_0x564f5e[_0x23d0('0x2f')]['on']('execute',()=>{this[_0x23d0('0x1c')](_0x23d0('0x35'),this[_0x23d0('0x17')]);}),_0x564f5e[_0x23d0('0x23')][_0x23d0('0x2')]('isEnabled')['to'](this,_0x23d0('0x12'),this,'isProcessing',this,_0x23d0('0x17'),(_0x1e0989,_0x203534,_0x23968d)=>_0x1e0989&&!_0x203534&&!!_0x23968d),_0x564f5e[_0x23d0('0x23')]['on']('execute',()=>{this['fire'](_0x23d0('0x2c'),this[_0x23d0('0x17')]);}),_0x564f5e[_0x23d0('0x42')][_0x23d0('0x2')]('isEnabled')['to'](this,_0x23d0('0x12'),this,'isProcessing',(_0x3d8506,_0x376649)=>_0x3d8506&&!_0x376649),_0x564f5e[_0x23d0('0x42')]['on'](_0x23d0('0x13'),()=>{this[_0x23d0('0x1c')](_0x23d0('0x2b'));}),_0x564f5e[_0x23d0('0x1a')]['bind'](_0x23d0('0x12'))['to'](this,_0x23d0('0x29')),_0x564f5e[_0x23d0('0x1a')]['on'](_0x23d0('0x13'),()=>{this[_0x23d0('0x1c')](_0x23d0('0x19'));}),_0x564f5e;}[_0x23d0('0xf')](){this['value']='',this[_0x23d0('0x45')]=!0x1,this[_0x23d0('0x29')]=!0x0,this[_0x23d0('0x22')][_0x23d0('0x15')]=!0x0,this[_0x23d0('0xb')]['isVisible']=!0x0,this[_0x23d0('0x22')][_0x23d0('0x3c')]();}[_0x23d0('0x11')](){const _0xd3c62a=this[_0x23d0('0x40')];this[_0x23d0('0x29')]=!0x1,this['prompt']='',this['promptView']['reset'](),this[_0x23d0('0x17')]&&(this[_0x23d0('0x25')][_0x23d0('0x41')][_0x23d0('0x33')]=_0x2208f0(_0xd3c62a,_0x23d0('0x26')));}['handleError'](_0x402174){const _0x3b99ac=this['locale'];this[_0x23d0('0x11')](),this['isError']=!0x0,this[_0x23d0('0xa')][_0x23d0('0x0')]=_0x402174||_0x2208f0(_0x3b99ac,_0x23d0('0x3d')),this[_0x23d0('0x17')]||(this['contentArea'][_0x23d0('0x15')]=!0x1);}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x5701=['set','fire','locale','execute','prompt','add','children'];(function(_0x305311,_0x570140){const _0x44f801=function(_0x23a2f1){while(--_0x23a2f1){_0x305311['push'](_0x305311['shift']());}};_0x44f801(++_0x570140);}(_0x5701,0x70));const _0x44f8=function(_0x305311,_0x570140){_0x305311=_0x305311-0x0;let _0x44f801=_0x5701[_0x305311];return _0x44f801;};import{ListItemView as _0x48278e,ButtonView as _0x22dbbc}from'ckeditor5/src/ui';import _0x5cd01e from'../dropdown/buttonlabelwithhighlightview';import{unescape as _0x40adb0}from'lodash-es';export default class et extends _0x48278e{constructor(_0x287ce5){super();const _0xdb8b51=new _0x5cd01e(),_0x176d96=new _0x22dbbc(this[_0x44f8('0x2')],_0xdb8b51);this[_0x44f8('0x6')][_0x44f8('0x5')](_0x176d96),_0x176d96[_0x44f8('0x0')]({'label':_0x287ce5['prompt'],'withText':!0x0}),_0x176d96['on'](_0x44f8('0x3'),()=>{this[_0x44f8('0x1')](_0x44f8('0x3'),{'value':_0x40adb0(_0x287ce5[_0x44f8('0x4')])});});}}
23
+ const _0x15b6=['prompt','locale','add','set','fire','execute'];(function(_0x23193d,_0x15b683){const _0x3aa2ec=function(_0x58d1a6){while(--_0x58d1a6){_0x23193d['push'](_0x23193d['shift']());}};_0x3aa2ec(++_0x15b683);}(_0x15b6,0xf7));const _0x3aa2=function(_0x23193d,_0x15b683){_0x23193d=_0x23193d-0x0;let _0x3aa2ec=_0x15b6[_0x23193d];return _0x3aa2ec;};import{ListItemView as _0x40d288,ButtonView as _0x311dc5}from'ckeditor5/src/ui';import _0x5915aa from'../dropdown/buttonlabelwithhighlightview';import{unescape as _0x7098a}from'lodash-es';export default class ht extends _0x40d288{constructor(_0x828031){super();const _0x48d225=new _0x5915aa(),_0x44d2f8=new _0x311dc5(this[_0x3aa2('0x0')],_0x48d225);this['children'][_0x3aa2('0x1')](_0x44d2f8),_0x44d2f8[_0x3aa2('0x2')]({'label':_0x828031[_0x3aa2('0x5')],'withText':!0x0}),_0x44d2f8['on'](_0x3aa2('0x4'),()=>{this[_0x3aa2('0x3')](_0x3aa2('0x4'),{'value':_0x7098a(_0x828031[_0x3aa2('0x5')])});});}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4d8d=['clearHistoryButton','_createClearHistoryButton','Prompt\x20history','items','label','delegate','add','historyGroupView','set','locale','fire','length','Clear','children','execute','clearHistory'];(function(_0x4c1aa9,_0x4d8d7b){const _0x39dfb=function(_0xbabbf9){while(--_0xbabbf9){_0x4c1aa9['push'](_0x4c1aa9['shift']());}};_0x39dfb(++_0x4d8d7b);}(_0x4d8d,0x77));const _0x39df=function(_0x4c1aa9,_0x4d8d7b){_0x4c1aa9=_0x4c1aa9-0x0;let _0x39dfb=_0x4d8d[_0x4c1aa9];return _0x39dfb;};import{ListView as _0xb90ba3,ListItemGroupView as _0x27f5d9,ButtonView as _0x2ac1e0}from'ckeditor5/src/ui';import{getTranslation as _0x4177db}from'../../utils/common-translations';export default class it extends _0xb90ba3{constructor(_0x84f2f0){super(_0x84f2f0),this[_0x39df('0x9')]=this[_0x39df('0xa')](),this[_0x39df('0x0')]=new _0x27f5d9(),this[_0x39df('0x0')][_0x39df('0x6')][_0x39df('0xf')](this[_0x39df('0x9')],0x1),this[_0x39df('0x0')][_0x39df('0xd')]=_0x4177db(_0x84f2f0,_0x39df('0xb')),this[_0x39df('0x0')][_0x39df('0xc')][_0x39df('0xe')](_0x39df('0x7'))['to'](this),this[_0x39df('0xc')][_0x39df('0xf')](this[_0x39df('0x0')]);}['filter'](){let _0x75c126=0x0;for(const _0xc51aa7 of this['items'])_0x75c126+=_0xc51aa7[_0x39df('0xc')][_0x39df('0x4')];return{'resultsCount':_0x75c126,'totalItemsCount':_0x75c126};}[_0x39df('0xa')](){const _0x51c235=this[_0x39df('0x2')],_0x26dae7=new _0x2ac1e0(this[_0x39df('0x2')]);return _0x26dae7[_0x39df('0x1')]({'label':'('+_0x4177db(_0x51c235,_0x39df('0x5'))+')','withText':!0x0}),_0x26dae7['on'](_0x39df('0x7'),()=>this[_0x39df('0x3')](_0x39df('0x8'))),_0x26dae7;}}
23
+ const _0x508c=['set','add','historyGroupView','fire','Prompt\x20history','locale','items','Clear','length','clearHistoryButton','execute','children','_createClearHistoryButton','filter','label'];(function(_0x89ee3f,_0x508c12){const _0x22773a=function(_0x529601){while(--_0x529601){_0x89ee3f['push'](_0x89ee3f['shift']());}};_0x22773a(++_0x508c12);}(_0x508c,0x88));const _0x2277=function(_0x89ee3f,_0x508c12){_0x89ee3f=_0x89ee3f-0x0;let _0x22773a=_0x508c[_0x89ee3f];return _0x22773a;};import{ListView as _0x1a0835,ListItemGroupView as _0x322254,ButtonView as _0x4a1c42}from'ckeditor5/src/ui';import{getTranslation as _0x2ddc1a}from'../../utils/common-translations';export default class rt extends _0x1a0835{constructor(_0x225c0b){super(_0x225c0b),this[_0x2277('0x8')]=this['_createClearHistoryButton'](),this[_0x2277('0x1')]=new _0x322254(),this['historyGroupView'][_0x2277('0xa')][_0x2277('0x0')](this[_0x2277('0x8')],0x1),this[_0x2277('0x1')][_0x2277('0xd')]=_0x2ddc1a(_0x225c0b,_0x2277('0x3')),this[_0x2277('0x1')][_0x2277('0x5')]['delegate'](_0x2277('0x9'))['to'](this),this[_0x2277('0x5')][_0x2277('0x0')](this['historyGroupView']);}[_0x2277('0xc')](){let _0x1e45f8=0x0;for(const _0x4aed71 of this['items'])_0x1e45f8+=_0x4aed71[_0x2277('0x5')][_0x2277('0x7')];return{'resultsCount':_0x1e45f8,'totalItemsCount':_0x1e45f8};}[_0x2277('0xb')](){const _0x40937d=this['locale'],_0x52172a=new _0x4a1c42(this[_0x2277('0x4')]);return _0x52172a[_0x2277('0xe')]({'label':'('+_0x2ddc1a(_0x40937d,_0x2277('0x6'))+')','withText':!0x0}),_0x52172a['on'](_0x2277('0x9'),()=>this[_0x2277('0x2')]('clearHistory')),_0x52172a;}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x242a=['getItem','CKEditor/AIFormView/PromptHistory','setItem','stringify','map','parse','length','toLowerCase','last','remove','add','prompt','_loadFromSessionStorage','trim','_saveToSessionStorage'];(function(_0x4a29b1,_0x242ad5){const _0x50e878=function(_0x3bfe1b){while(--_0x3bfe1b){_0x4a29b1['push'](_0x4a29b1['shift']());}};_0x50e878(++_0x242ad5);}(_0x242a,0x19b));const _0x50e8=function(_0x4a29b1,_0x242ad5){_0x4a29b1=_0x4a29b1-0x0;let _0x50e878=_0x242a[_0x4a29b1];return _0x50e878;};import{Collection as _0x2479a6}from'ckeditor5/src/utils';const ts=_0x50e8('0xa');export default class rt extends _0x2479a6{constructor(){super(),this[_0x50e8('0x6')](),this['on'](_0x50e8('0x4'),(_0x15e7fd,_0xaa078)=>{const _0x36da25=os(_0xaa078[_0x50e8('0x5')]);for(const _0x951389 of this)if(_0x951389!=_0xaa078&&os(_0x951389[_0x50e8('0x5')])===_0x36da25){this[_0x50e8('0x3')](_0x951389);break;}this[_0x50e8('0x0')]>0x14&&this[_0x50e8('0x3')](this[_0x50e8('0x2')]),this[_0x50e8('0x8')]();}),this['on'](_0x50e8('0x3'),()=>{this[_0x50e8('0x8')]();});}[_0x50e8('0x6')](){const _0x5d6630=sessionStorage[_0x50e8('0x9')](ts)||'[]';this['addMany'](JSON[_0x50e8('0xe')](_0x5d6630));}[_0x50e8('0x8')](){sessionStorage[_0x50e8('0xb')](ts,JSON[_0x50e8('0xc')](this[_0x50e8('0xd')](_0x440cf8=>_0x440cf8)));}}function os(_0x246266){return _0x246266[_0x50e8('0x1')]()[_0x50e8('0x7')]();}
23
+ const _0x4267=['prompt','remove','trim','_saveToSessionStorage','add','map','length','parse','addMany','setItem','last','CKEditor/AIFormView/PromptHistory'];(function(_0x248379,_0x426736){const _0xc010c3=function(_0x20cde5){while(--_0x20cde5){_0x248379['push'](_0x248379['shift']());}};_0xc010c3(++_0x426736);}(_0x4267,0xfd));const _0xc010=function(_0x248379,_0x426736){_0x248379=_0x248379-0x0;let _0xc010c3=_0x4267[_0x248379];return _0xc010c3;};import{Collection as _0x15d5fa}from'ckeditor5/src/utils';const ts=_0xc010('0xa');export default class ot extends _0x15d5fa{constructor(){super(),this['_loadFromSessionStorage'](),this['on'](_0xc010('0x3'),(_0x59d1f3,_0x18232c)=>{const _0x325ae7=os(_0x18232c['prompt']);for(const _0x27db30 of this)if(_0x27db30!=_0x18232c&&os(_0x27db30[_0xc010('0xb')])===_0x325ae7){this[_0xc010('0x0')](_0x27db30);break;}this[_0xc010('0x5')]>0x14&&this[_0xc010('0x0')](this[_0xc010('0x9')]),this[_0xc010('0x2')]();}),this['on']('remove',()=>{this[_0xc010('0x2')]();});}['_loadFromSessionStorage'](){const _0x418270=sessionStorage['getItem'](ts)||'[]';this[_0xc010('0x7')](JSON[_0xc010('0x6')](_0x418270));}[_0xc010('0x2')](){sessionStorage[_0xc010('0x8')](ts,JSON['stringify'](this[_0xc010('0x4')](_0x37e3b3=>_0x37e3b3)));}}function os(_0x5179ce){return _0x5179ce['toLowerCase']()[_0xc010('0x1')]();}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x45a7=['refresh','selection','getRanges','document','isEnabled','get','includes','name','editor','getItems','element','execute'];(function(_0x1c73dd,_0x45a719){const _0x56871=function(_0x4c8318){while(--_0x4c8318){_0x1c73dd['push'](_0x1c73dd['shift']());}};_0x56871(++_0x45a719);}(_0x45a7,0xdb));const _0x5687=function(_0x1c73dd,_0x45a719){_0x1c73dd=_0x1c73dd-0x0;let _0x56871=_0x45a7[_0x1c73dd];return _0x56871;};import{Command as _0x5cb8e1}from'ckeditor5/src/core';import _0x31f8c7 from'../aiassistantui';export default class A extends _0x5cb8e1{[_0x5687('0x9')](){const _0x2f7c92=this['editor']['model'][_0x5687('0x0')][_0x5687('0xa')],_0x3264c4=this[_0x5687('0x5')]['config'][_0x5687('0x2')]('aiAssistant.disabledElements');for(const _0x59ab8a of _0x2f7c92[_0x5687('0xb')]())for(const _0x141cd9 of _0x59ab8a[_0x5687('0x6')]())if(_0x141cd9['is'](_0x5687('0x7'))&&_0x3264c4[_0x5687('0x3')](_0x141cd9[_0x5687('0x4')]))return void(this[_0x5687('0x1')]=!0x1);this[_0x5687('0x1')]=!0x0;}[_0x5687('0x8')](_0x5c549b='',_0x41ef6b=''){this[_0x5687('0x5')]['plugins'][_0x5687('0x2')](_0x31f8c7)['showUI'](_0x5c549b,_0x41ef6b);}}
23
+ const _0x1828=['plugins','aiAssistant.disabledElements','refresh','isEnabled','document','selection','name','getRanges','showUI','get','editor','element','includes','execute'];(function(_0x2dde35,_0x182861){const _0x16c727=function(_0xcbcc73){while(--_0xcbcc73){_0x2dde35['push'](_0x2dde35['shift']());}};_0x16c727(++_0x182861);}(_0x1828,0x124));const _0x16c7=function(_0x2dde35,_0x182861){_0x2dde35=_0x2dde35-0x0;let _0x16c727=_0x1828[_0x2dde35];return _0x16c727;};import{Command as _0x2e697a}from'ckeditor5/src/core';import _0x2ce4a3 from'../aiassistantui';export default class I extends _0x2e697a{[_0x16c7('0x4')](){const _0x48998d=this['editor']['model'][_0x16c7('0x6')][_0x16c7('0x7')],_0x2d4c8b=this[_0x16c7('0xc')]['config'][_0x16c7('0xb')](_0x16c7('0x3'));for(const _0x3e9807 of _0x48998d[_0x16c7('0x9')]())for(const _0x446d24 of _0x3e9807['getItems']())if(_0x446d24['is'](_0x16c7('0xd'))&&_0x2d4c8b[_0x16c7('0x0')](_0x446d24[_0x16c7('0x8')]))return void(this[_0x16c7('0x5')]=!0x1);this['isEnabled']=!0x0;}[_0x16c7('0x1')](_0x64062a='',_0x335ee8=''){this['editor'][_0x16c7('0x2')][_0x16c7('0xb')](_0x2ce4a3)[_0x16c7('0xa')](_0x64062a,_0x335ee8);}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export function getTranslation(_0x5d76ab,_0xbfabf1,_0x11e408){const t=_0x5d76ab['t'];switch(_0xbfabf1){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',_0x11e408);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_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 _0xbfabf1;}}
23
+ export function getTranslation(_0x522b2b,_0x44be26,_0x3e3d10){const t=_0x522b2b['t'];switch(_0x44be26){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',_0x3e3d10);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 _0x44be26;}}