@ckeditor/ckeditor5-ai 0.0.0-nightly-20231103.0 → 0.0.0-nightly-20231105.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/LICENSE.md +2 -2
- 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 _0x4913=['text/html','signal','editor','reject','choices','text','stringify','toModel','data:\x20','get','_prepareMessages','authKey','name','aiAssistant.requestParameters','abort','parseFromString','decode','_normalizeResponseHeadings','_parseAndNormalizeContent','_xmlSerializer','max_tokens','delta','AI_ERROR_AUTH_REQUEST','document','data','split','top_p','Bearer\x20','aiconnector-send-prompt-failed','_requestParameters','model','toView','aiAssistant.requestParameters.temperature','sendPrompt','AIConnector','_domParser','aiAssistant.requestParameters.stream','json','https://api.openai.com/v1/chat/completions','AbortError','pluginName','parse','temperature','filter','view','<span>','adapter','AI_ERROR_MODERATION','Authorization','replace','gpt-3.5-turbo','getReader','serializeToString','AI_ERROR_CONTEXT_LENGTH','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.','user','system','match','Instruction:\x0a','define','_abortController','join','_authKey','_cleanUpData','</span>','body','config','_isBufferIncomplete','aiAssistant','_readStaticResponse','Moderation','push','element','rename','_apiUrl','includes','content','length','POST','\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a','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','error','editing','aiAssistant.requestParameters.max_tokens','stream','map','processor','aiAssistant.apiUrl','read','_readStreamableResponse','resolve','aborted','catch'];(function(_0x2895fe,_0x49137f){const _0x140d47=function(_0x6ebcd7){while(--_0x6ebcd7){_0x2895fe['push'](_0x2895fe['shift']());}};_0x140d47(++_0x49137f);}(_0x4913,0x10e));const _0x140d=function(_0x2895fe,_0x49137f){_0x2895fe=_0x2895fe-0x0;let _0x140d47=_0x4913[_0x2895fe];return _0x140d47;};import{Matcher as _0x146414,UpcastWriter as _0x28ac95}from'ckeditor5/src/engine';import{Plugin as _0x51cb65}from'ckeditor5/src/core';import{CKEditorError as _0x28fbfc}from'ckeditor5/src/utils';import{getTranslation as _0x92b88c}from'./utils/common-translations';export default class o extends _0x51cb65{static get[_0x140d('0x34')](){return _0x140d('0x2e');}constructor(_0x8dada2){super(_0x8dada2),_0x8dada2[_0x140d('0x4e')]['define'](_0x140d('0x6'),_0x140d('0x32')),_0x8dada2['config'][_0x140d('0x47')]('aiAssistant.requestParameters.model',_0x140d('0x3e')),_0x8dada2[_0x140d('0x4e')]['define'](_0x140d('0x2'),0x7d0),_0x8dada2[_0x140d('0x4e')][_0x140d('0x47')](_0x140d('0x2c'),0x1),_0x8dada2['config']['define']('aiAssistant.requestParameters.top_p',0x1),_0x8dada2['config'][_0x140d('0x47')](_0x140d('0x30'),!0x0);const _0x402947=_0x8dada2[_0x140d('0x4e')][_0x140d('0x15')](_0x140d('0x6')),_0x420215=_0x8dada2[_0x140d('0x4e')]['get'](_0x140d('0x50'))[_0x140d('0x17')],_0x27bf4c=_0x8dada2[_0x140d('0x4e')][_0x140d('0x15')](_0x140d('0x19'));this['_abortController']=new AbortController(),this[_0x140d('0x3a')]=new OpenAIAdapter(_0x8dada2,_0x402947,_0x27bf4c,_0x420215);}async['processPrompt'](_0x190a16,_0x52c0a0,_0x26b7ff){const {systemMessage:_0x4724b8,userMessage:_0xfe425a}=this['_prepareMessages'](_0x190a16,_0x52c0a0);return this[_0x140d('0x3a')]['sendPrompt'](_0x4724b8,_0xfe425a,this[_0x140d('0x48')][_0x140d('0xd')],_0x26b7ff)[_0x140d('0xb')](_0x415c30=>{if(_0x415c30 instanceof AIRequestError)return Promise[_0x140d('0xf')](_0x415c30);if(_0x140d('0x33')==_0x415c30[_0x140d('0x18')])return Promise[_0x140d('0x9')]();throw console[_0x140d('0x0')](_0x415c30),new _0x28fbfc(_0x140d('0x28'),null);});}[_0x140d('0x1a')](){this[_0x140d('0x48')][_0x140d('0xd')][_0x140d('0xa')]||(this['_abortController']['abort'](),this[_0x140d('0x48')]=new AbortController());}[_0x140d('0x16')](_0xe1af52,_0x93534f){let _0x127b80,_0x24e113;return _0x93534f?(_0x127b80=_0x140d('0x42'),_0x24e113=_0x140d('0x46')+_0xe1af52+_0x140d('0x5b')+(_0x93534f['startsWith']('<')?_0x93534f:_0x140d('0x39')+_0x93534f+_0x140d('0x4c'))):(_0x127b80=_0x140d('0x5c'),_0x24e113=_0xe1af52),{'systemMessage':_0x127b80,'userMessage':_0x24e113};}}export class OpenAIAdapter{constructor(_0x232c91,_0x361977,_0x4be6e6,_0x3bc824){this[_0x140d('0xe')]=_0x232c91,this['_apiUrl']=_0x361977,this[_0x140d('0x4a')]=_0x3bc824,this[_0x140d('0x29')]=_0x4be6e6,this[_0x140d('0x2f')]=new DOMParser(),this[_0x140d('0x1f')]=new XMLSerializer();}async[_0x140d('0x2d')](_0x5bbdfa,_0x424cf1,_0x213905,_0x1aad7b){const _0x333da8=this['editor']['locale'],_0x44511d={'Content-Type':_0x140d('0x5d')};if('string'==typeof this[_0x140d('0x4a')])_0x44511d['Authorization']=_0x140d('0x27')+this['_authKey'];else{if(this[_0x140d('0x4a')])try{const _0x4d7157=await this['_authKey']();_0x44511d[_0x140d('0x3c')]=_0x140d('0x27')+_0x4d7157;}catch(_0x299a6b){return Promise[_0x140d('0xf')](new AIRequestError(_0x92b88c(_0x333da8,_0x140d('0x22'))));}}const _0x236868={'model':this[_0x140d('0x29')][_0x140d('0x2a')],'messages':[{'role':_0x140d('0x44'),'content':_0x5bbdfa},{'role':_0x140d('0x43'),'content':_0x424cf1}],'stream':this[_0x140d('0x29')][_0x140d('0x3')],'max_tokens':this[_0x140d('0x29')][_0x140d('0x20')],'temperature':this['_requestParameters'][_0x140d('0x36')],'top_p':this['_requestParameters'][_0x140d('0x26')]};this[_0x140d('0x29')]['user']&&(_0x236868['user']=this['_requestParameters'][_0x140d('0x43')]);const _0x3c257f={'method':_0x140d('0x5a'),'headers':_0x44511d,'body':JSON[_0x140d('0x12')](_0x236868),'signal':_0x213905},_0x1c10b1=await fetch(this[_0x140d('0x56')],_0x3c257f);if(_0x1c10b1['ok'])return this['_requestParameters']['stream']?await this[_0x140d('0x8')](_0x1c10b1,_0x1aad7b):await this[_0x140d('0x51')](_0x1c10b1,_0x1aad7b),Promise['resolve']();{const _0x209f9f=await _0x1c10b1[_0x140d('0x11')]();return _0x209f9f[_0x140d('0x57')]('context_length_exceeded')?Promise[_0x140d('0xf')](new AIRequestError(_0x92b88c(_0x333da8,_0x140d('0x41')))):_0x209f9f['includes'](_0x140d('0x52'))?Promise[_0x140d('0xf')](new AIRequestError(_0x92b88c(_0x333da8,_0x140d('0x3b')))):Promise[_0x140d('0xf')](new Error(_0x209f9f));}}async['_readStreamableResponse'](_0x48f34f,_0x5d2673){const _0x556799=_0x48f34f[_0x140d('0x4d')][_0x140d('0x3f')](),_0x66268=new TextDecoder();let _0x582e2c='',_0x98443c='',_0x113e9b='',_0x242675=!0x1;for(;!_0x242675;){const {done:_0x31d0c5,value:_0xdb98f9}=await _0x556799[_0x140d('0x7')](),_0x53db81=_0x582e2c+_0x66268[_0x140d('0x1c')](_0xdb98f9);let _0x1cb768='';_0x242675=_0x31d0c5;try{_0x1cb768=this['_cleanUpData'](_0x53db81),_0x582e2c='';}catch(_0x28ac83){_0x582e2c+=_0x53db81;continue;}_0x98443c+=_0x1cb768,!_0x31d0c5&&this['_isBufferIncomplete'](_0x98443c)||_0x98443c&&(_0x113e9b+=_0x98443c,_0x5d2673(this[_0x140d('0x1e')](_0x113e9b)),_0x98443c='');}return Promise[_0x140d('0x9')]();}async[_0x140d('0x51')](_0x206e3f,_0x14a0da){const _0x1f63db=(await _0x206e3f[_0x140d('0x31')]())[_0x140d('0x10')][0x0]['message'][_0x140d('0x58')];return _0x14a0da(this[_0x140d('0x1e')](_0x1f63db)),Promise[_0x140d('0x9')]();}[_0x140d('0x4f')](_0x49159f){const _0x5ca9de=_0x49159f[_0x140d('0x25')]('<')[_0x140d('0x59')]!==_0x49159f[_0x140d('0x25')]('>')[_0x140d('0x59')],_0x1c7100=_0x49159f[_0x140d('0x59')]<0x1e;return _0x5ca9de&&_0x1c7100;}[_0x140d('0x1e')](_0x1bb7bb){const _0x3a8dab=this[_0x140d('0x2f')][_0x140d('0x1b')](_0x1bb7bb,_0x140d('0xc')),_0x24761f=this[_0x140d('0xe')][_0x140d('0x24')][_0x140d('0x5')][_0x140d('0x2b')](this[_0x140d('0x1f')][_0x140d('0x40')](_0x3a8dab[_0x140d('0x4d')]));return this[_0x140d('0x1d')](_0x24761f),this[_0x140d('0xe')][_0x140d('0x24')][_0x140d('0x12')](this[_0x140d('0xe')][_0x140d('0x24')][_0x140d('0x13')](_0x24761f));}[_0x140d('0x1d')](_0x243815){const _0x551bd4=new _0x28ac95(this[_0x140d('0xe')][_0x140d('0x1')][_0x140d('0x38')][_0x140d('0x23')]),_0x475467=new _0x146414({'name':/^h[1-5]$/}),_0x3d5ec5=[];let _0x53e0c3=!0x1;for(const _0x274c3e of _0x243815)_0x274c3e['is'](_0x140d('0x54'))&&_0x475467[_0x140d('0x45')](_0x274c3e)&&(_0x3d5ec5[_0x140d('0x53')](_0x274c3e),'h1'==_0x274c3e[_0x140d('0x18')]&&(_0x53e0c3=!0x0));if(_0x53e0c3)for(const _0x2fd3a9 of _0x3d5ec5)_0x551bd4[_0x140d('0x55')]('h'+(parseInt(_0x2fd3a9[_0x140d('0x18')][0x1])+0x1),_0x2fd3a9);}[_0x140d('0x4b')](_0x521f5f){return _0x521f5f[_0x140d('0x25')](/\n(?![^{]*\})/g)[_0x140d('0x4')](_0x1829e1=>_0x1829e1[_0x140d('0x3d')](_0x140d('0x14'),''))[_0x140d('0x37')](_0x22bbcd=>_0x22bbcd&&_0x22bbcd[_0x140d('0x59')]>0x0&&'[DONE]'!==_0x22bbcd)[_0x140d('0x4')](_0x2ce428=>{const {choices:_0x46ad5e}=JSON[_0x140d('0x35')](_0x2ce428);if(_0x46ad5e[0x0]&&_0x46ad5e[0x0]['delta']&&_0x46ad5e[0x0][_0x140d('0x21')][_0x140d('0x58')])return _0x46ad5e[0x0][_0x140d('0x21')]['content'];})[_0x140d('0x37')](_0x50a459=>_0x50a459)[_0x140d('0x49')]('');}}export class AIRequestError extends Error{constructor(_0x1fd4e5){super(_0x1fd4e5),this[_0x140d('0x18')]='AIRequestError';}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0xf168=['finishProcessing','submitPrompt','set','currentContext','handleError','isProcessing','processPrompt','connector','previousPrompt','once','catch','message','prompt','stopProcessing','_updateValue','stopListening','listenTo','render','mainAction','bind','finally','initialContext','startProcessing','updateView','previousContext','previousLabel','view','_handlePrompt'];(function(_0x23c5f0,_0xf16889){const _0x5b9f2d=function(_0x2d2391){while(--_0x2d2391){_0x23c5f0['push'](_0x23c5f0['shift']());}};_0x5b9f2d(++_0xf16889);}(_0xf168,0x6d));const _0x5b9f=function(_0x23c5f0,_0xf16889){_0x23c5f0=_0x23c5f0-0x0;let _0x5b9f2d=_0xf168[_0x23c5f0];return _0x5b9f2d;};import{ObservableMixin as _0x385e77}from'ckeditor5/src/utils';import{AIRequestError as _0x30d011}from'../aiconnector';export default class g extends _0x385e77(){constructor(_0x5282a2,_0x4c64ab){super(),this['connector']=_0x5282a2,this['view']=_0x4c64ab,this[_0x5b9f('0x5')]({'initialContext':'','currentContext':'','previousContext':void 0x0,'previousPrompt':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this[_0x5b9f('0x1')][_0x5b9f('0x16')]('value')['to'](this,_0x5b9f('0x6')),this[_0x5b9f('0x13')](this[_0x5b9f('0x1')],_0x5b9f('0x4'),(_0x5bdb93,_0x2b0985)=>{const _0x589424=this[_0x5b9f('0x6')]||this[_0x5b9f('0x18')];this[_0x5b9f('0x2')](_0x2b0985,_0x589424);}),this[_0x5b9f('0x13')](this[_0x5b9f('0x1')],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this[_0x5b9f('0x2')](this[_0x5b9f('0xb')],this[_0x5b9f('0x1b')],this[_0x5b9f('0x0')]);}),this[_0x5b9f('0x13')](this[_0x5b9f('0x1')],_0x5b9f('0x10'),()=>{this[_0x5b9f('0x10')]();});}['destroy'](){this[_0x5b9f('0x12')]();}async[_0x5b9f('0x1a')]({prompt:_0xba11e,htmlContent:_0x57e218,label:_0x16e239,mainAction:_0x26a119}){this[_0x5b9f('0x1')][_0x5b9f('0xf')]=_0x16e239,this[_0x5b9f('0x1')][_0x5b9f('0x15')]=_0x26a119,this[_0x5b9f('0x18')]=_0x57e218,_0xba11e&&(this[_0x5b9f('0x1')]['isRendered']?this[_0x5b9f('0x2')](_0xba11e,_0x57e218,_0x16e239):this[_0x5b9f('0x1')][_0x5b9f('0xc')](_0x5b9f('0x14'),()=>{this[_0x5b9f('0x2')](_0xba11e,_0x57e218,_0x16e239);}));}[_0x5b9f('0x10')](){this[_0x5b9f('0x8')]&&(this[_0x5b9f('0x8')]=!0x1,this[_0x5b9f('0x1')][_0x5b9f('0x3')](),this[_0x5b9f('0xa')]['abort']());}['reset'](){this[_0x5b9f('0x18')]='',this['currentContext']='',this[_0x5b9f('0x1b')]='',this[_0x5b9f('0xb')]='',this['previousLabel']='',this[_0x5b9f('0x1')]['reset'](),this[_0x5b9f('0x10')]();}async[_0x5b9f('0x2')](_0x2c2808,_0x5c9a5d,_0x3478c6){return this[_0x5b9f('0x8')]=!0x0,this[_0x5b9f('0x1')][_0x5b9f('0x19')](),this[_0x5b9f('0x1b')]=_0x5c9a5d,this['previousPrompt']=_0x2c2808,this['previousLabel']=_0x3478c6||_0x2c2808,new Promise(_0x1401bb=>{this[_0x5b9f('0xa')][_0x5b9f('0x9')](_0x2c2808,_0x5c9a5d,_0x379765=>this[_0x5b9f('0x11')](_0x379765))[_0x5b9f('0xd')](_0x54c6fa=>{_0x54c6fa instanceof _0x30d011?this[_0x5b9f('0x1')][_0x5b9f('0x7')](_0x54c6fa[_0x5b9f('0xe')]):this['view'][_0x5b9f('0x7')](),_0x1401bb();})[_0x5b9f('0x17')](()=>{this[_0x5b9f('0x10')](),_0x1401bb();});});}[_0x5b9f('0x11')](_0x3d233d){this[_0x5b9f('0x6')]=''+_0x3d233d;}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x49a5=['label','children','filter','items','labelView','highlightText','length','match','first','isVisible'];(function(_0x4f6d3a,_0x49a5fa){const _0x4ab482=function(_0x34af1d){while(--_0x34af1d){_0x4f6d3a['push'](_0x4f6d3a['shift']());}};_0x4ab482(++_0x49a5fa);}(_0x49a5,0x1b1));const _0x4ab4=function(_0x4f6d3a,_0x49a5fa){_0x4f6d3a=_0x4f6d3a-0x0;let _0x4ab482=_0x49a5[_0x4f6d3a];return _0x4ab482;};import{ListView as _0x3265bb}from'ckeditor5/src/ui';export default class v extends _0x3265bb{['filter'](_0x28b7b7){let _0x7c680e=0x0,_0x465fac=0x0;for(const _0x2c1149 of this[_0x4ab4('0x0')]){const _0x35dbb3=_0x2c1149,_0x2172ac=_0x28b7b7&&!!_0x35dbb3['label'][_0x4ab4('0x4')](_0x28b7b7);_0x35dbb3[_0x4ab4('0x1')]['highlightText'](_0x2172ac?_0x28b7b7:null);for(const _0x389517 of _0x35dbb3[_0x4ab4('0x0')]){const _0x2008f7=_0x389517[_0x4ab4('0x8')][_0x4ab4('0x5')],_0x1aa077=_0x2008f7[_0x4ab4('0x1')];if(_0x28b7b7){const _0x3f45f1=!!_0x2008f7[_0x4ab4('0x7')][_0x4ab4('0x4')](_0x28b7b7);_0x1aa077[_0x4ab4('0x2')](_0x3f45f1?_0x28b7b7:null),_0x389517[_0x4ab4('0x6')]=_0x2172ac||_0x3f45f1;}else _0x389517[_0x4ab4('0x6')]=!0x0,_0x1aa077[_0x4ab4('0x2')](null);}const _0x4489ab=_0x35dbb3[_0x4ab4('0x0')][_0x4ab4('0x9')](_0x1ba175=>_0x1ba175[_0x4ab4('0x6')])[_0x4ab4('0x3')];_0x7c680e+=_0x35dbb3[_0x4ab4('0x0')]['length'],_0x465fac+=_0x2172ac?_0x35dbb3[_0x4ab4('0x0')][_0x4ab4('0x3')]:_0x4489ab,_0x35dbb3[_0x4ab4('0x6')]=_0x2172ac||!!_0x4489ab;}return{'resultsCount':_0x465fac,'totalItemsCount':_0x7c680e};}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x4228=['ck-button__label','bindTemplate'];(function(_0x3a2c07,_0x42285b){const _0x2bb5b9=function(_0x3f6e13){while(--_0x3f6e13){_0x3a2c07['push'](_0x3a2c07['shift']());}};_0x2bb5b9(++_0x42285b);}(_0x4228,0x158));const _0x2bb5=function(_0x3a2c07,_0x42285b){_0x3a2c07=_0x3a2c07-0x0;let _0x2bb5b9=_0x4228[_0x3a2c07];return _0x2bb5b9;};import{HighlightedTextView as _0x1aec0d}from'ckeditor5/src/ui';export default class C extends _0x1aec0d{constructor(){super(),this['set']({'style':void 0x0,'text':void 0x0,'id':void 0x0});const _0x4b4adc=this[_0x2bb5('0x1')];this['extendTemplate']({'attributes':{'class':[_0x2bb5('0x0')],'style':_0x4b4adc['to']('style'),'id':_0x4b4adc['to']('id')}});}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1461=['extendTemplate','ck-editor__label_','for','bindTemplate','ck-label'];(function(_0x13a852,_0x146116){const _0x125659=function(_0x534373){while(--_0x534373){_0x13a852['push'](_0x13a852['shift']());}};_0x125659(++_0x146116);}(_0x1461,0xb6));const _0x1256=function(_0x13a852,_0x146116){_0x13a852=_0x13a852-0x0;let _0x125659=_0x1461[_0x13a852];return _0x125659;};import{HighlightedTextView as _0x274faa}from'ckeditor5/src/ui';import{uid as _0x4ccfa4}from'ckeditor5/src/utils';export default class k extends _0x274faa{constructor(){super(),this['set'](_0x1256('0x0'),void 0x0);const _0x1979a5=this[_0x1256('0x1')];this['id']=_0x1256('0x4')+_0x4ccfa4(),this[_0x1256('0x3')]({'attributes':{'class':['ck',_0x1256('0x2')],'id':this['id'],'for':_0x1979a5['to'](_0x1256('0x0'))}});}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0xcce2=['div','textContent','setContent','-9999px','position','left','addRange','ck-ai-form__content-field','text/html','_copyHTMLToClipboard','bindTemplate','wheel','check','loaderView','element','icon','clipboard','AI\x20is\x20writing...','smooth','mousedown','ck-ai-form__loader','bind','change:isProcessing','isVisible','selectNodeContents','contentFieldView','body','class','removeAllRanges','ck-ai-form__copy-button-wrapper','render','change:value','set','innerHTML','isProcessing','appendChild','createElement','appendLoader','ck-ai-form__content-area','copyButtonView','execCommand','locale','value','scrollTo','execute','isEnabled','ck-ai-form__copy-button','.ck-ai-form__loader','remove','_createLoader','focus','style','setTemplate','listenTo','_createCopyButton','ck-reset_all-excluded'];(function(_0x13c87f,_0xcce2f5){const _0x1cd8c1=function(_0x41107d){while(--_0x41107d){_0x13c87f['push'](_0x13c87f['shift']());}};_0x1cd8c1(++_0xcce2f5);}(_0xcce2,0xb7));const _0x1cd8=function(_0x13c87f,_0xcce2f5){_0x13c87f=_0x13c87f-0x0;let _0x1cd8c1=_0xcce2[_0x13c87f];return _0x1cd8c1;};import{global as _0x50cfe2}from'ckeditor5/src/utils';import{View as _0x276f9d,ButtonView as _0x3675db,SpinnerView as _0x1fe79b}from'ckeditor5/src/ui';import _0x4e94ae from'../../../theme/icons/copy.svg';import{getTranslation as _0x2df8b1}from'../../utils/common-translations';import{icons as _0x54a06e}from'ckeditor5/src/core';export default class D extends _0x276f9d{constructor(_0x9de0ac,_0x4eaf3f=''){super(_0x9de0ac),this[_0x1cd8('0x11')]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x4c57f9=this[_0x1cd8('0x33')];this[_0x1cd8('0xa')]=new ContentFieldView(_0x9de0ac,_0x4eaf3f),this[_0x1cd8('0x18')]=this[_0x1cd8('0x27')](),this[_0x1cd8('0x25')]({'tag':_0x1cd8('0x29'),'attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x4c57f9['if'](_0x1cd8('0x8'),'ck-hidden',_0x24cc23=>!_0x24cc23)],'tabindex':'-1'},'children':[{'tag':_0x1cd8('0x29'),'attributes':{'class':['ck',_0x1cd8('0x17'),_0x4c57f9['if'](_0x1cd8('0x13'),'ck-ai-form__content-area--processing')]},'children':[this[_0x1cd8('0xa')],{'tag':_0x1cd8('0x29'),'attributes':{'class':['ck',_0x1cd8('0xe')]},'children':[this[_0x1cd8('0x18')]]}]}]});}[_0x1cd8('0xf')](){super[_0x1cd8('0xf')](),this['value']&&this['contentFieldView'][_0x1cd8('0x2b')](this['value']);let _0x56aecf=!0x1;this['on'](_0x1cd8('0x10'),(_0x28a36d,_0x4e2360,_0x4308eb)=>{const _0x373285=!this['contentFieldView']['element']['querySelector'](_0x1cd8('0x20'));this['contentFieldView'][_0x1cd8('0x2b')](_0x4308eb),this[_0x1cd8('0x13')]&&_0x373285&&!_0x56aecf&&this[_0x1cd8('0x37')][_0x1cd8('0x1c')]({'top':this[_0x1cd8('0x37')]['scrollHeight'],'behavior':_0x1cd8('0x3')});}),this['on'](_0x1cd8('0x7'),(_0x1d9159,_0x1abecf,_0x3680a1)=>{_0x56aecf=!0x1,_0x3680a1?(this[_0x1cd8('0x1b')]=null,this[_0x1cd8('0xa')][_0x1cd8('0x16')]()):this[_0x1cd8('0x1b')]||this[_0x1cd8('0xa')][_0x1cd8('0x2b')]('');}),this[_0x1cd8('0x26')](this['element'],_0x1cd8('0x34'),()=>{_0x56aecf=!0x0;}),this['listenTo'](this[_0x1cd8('0x37')],_0x1cd8('0x4'),()=>{_0x56aecf=!0x0;});}[_0x1cd8('0x23')](){this[_0x1cd8('0x37')][_0x1cd8('0x23')]();}[_0x1cd8('0x27')](){const _0x31f34c=this[_0x1cd8('0x1a')],_0x3b87b3=new _0x3675db(this[_0x1cd8('0x1a')]),_0x23fadd=_0x1cd8('0x1f');return _0x3b87b3[_0x1cd8('0x11')]({'label':_0x2df8b1(_0x31f34c,'Copy'),'icon':_0x4e94ae,'class':_0x23fadd,'tooltip':!0x0}),_0x3b87b3[_0x1cd8('0x6')](_0x1cd8('0x8'))['to'](this,_0x1cd8('0x1b'),_0x24f8f7=>!!_0x24f8f7),_0x3b87b3[_0x1cd8('0x6')](_0x1cd8('0x1e'))['to'](this,_0x1cd8('0x13'),_0x333999=>!_0x333999),_0x3b87b3['on'](_0x1cd8('0x1d'),()=>{this[_0x1cd8('0x32')](this[_0x1cd8('0xa')][_0x1cd8('0x37')]),_0x3b87b3[_0x1cd8('0x0')]=_0x54a06e[_0x1cd8('0x35')],_0x3b87b3['class']=_0x23fadd+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x3b87b3[_0x1cd8('0x0')]=_0x4e94ae,_0x3b87b3[_0x1cd8('0xc')]=_0x23fadd;},0x3e8);}),_0x3b87b3;}['_copyHTMLToClipboard'](_0x5e5a75){const {window:_0x32beed,document:_0x43dd2a}=_0x50cfe2;if(_0x32beed['ClipboardItem']){const {Blob:_0x540f0a,ClipboardItem:_0x24a7c8}=_0x32beed,_0x319203=[new _0x24a7c8({'text/html':new _0x540f0a([_0x5e5a75[_0x1cd8('0x12')]],{'type':_0x1cd8('0x31')}),'text/plain':new _0x540f0a([_0x5e5a75[_0x1cd8('0x2a')]||''],{'type':'text/plain'})})];navigator[_0x1cd8('0x1')]['write'](_0x319203);}else{const _0x20edf6=_0x43dd2a[_0x1cd8('0x15')](_0x1cd8('0x29'));_0x20edf6[_0x1cd8('0x24')][_0x1cd8('0x2d')]='absolute',_0x20edf6[_0x1cd8('0x24')][_0x1cd8('0x2e')]=_0x1cd8('0x2c'),_0x20edf6[_0x1cd8('0x12')]=_0x5e5a75[_0x1cd8('0x12')],_0x43dd2a[_0x1cd8('0xb')][_0x1cd8('0x14')](_0x20edf6);const _0x2bcda1=_0x43dd2a['createRange']();_0x2bcda1[_0x1cd8('0x9')](_0x20edf6);const _0x33b0bc=_0x32beed['getSelection']();_0x33b0bc[_0x1cd8('0xd')](),_0x33b0bc[_0x1cd8('0x2f')](_0x2bcda1),_0x43dd2a[_0x1cd8('0x19')]('copy'),_0x20edf6[_0x1cd8('0x21')]();}}}export class ContentFieldView extends _0x276f9d{constructor(_0x5b064b,_0x30ef93=''){super(_0x5b064b),this[_0x1cd8('0x36')]=this[_0x1cd8('0x22')](),this[_0x1cd8('0x25')]({'tag':'div','attributes':{'class':['ck','ck-content',_0x30ef93,_0x1cd8('0x28'),_0x1cd8('0x30')]}});}['setContent'](_0x24c5b0){this[_0x1cd8('0x37')][_0x1cd8('0x12')]=_0x24c5b0;}[_0x1cd8('0x16')](){this[_0x1cd8('0x37')][_0x1cd8('0x14')](this[_0x1cd8('0x36')][_0x1cd8('0x37')]);}[_0x1cd8('0x22')](){const _0x582e8b=new _0x276f9d(),_0x103080=this[_0x1cd8('0x1a')],_0x2f917f=new _0x1fe79b();return _0x2f917f[_0x1cd8('0x8')]=!0x0,_0x582e8b[_0x1cd8('0x25')]({'tag':_0x1cd8('0x29'),'attributes':{'class':['ck',_0x1cd8('0x5')]},'children':[_0x2f917f,{'text':_0x2df8b1(_0x103080,_0x1cd8('0x2'))}]}),_0x582e8b[_0x1cd8('0xf')](),_0x582e8b;}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2c04=['div','bindTemplate','setTemplate','ck-ai-form__error','set','text'];(function(_0x8e2b38,_0x2c04b3){const _0x12f329=function(_0x2ff616){while(--_0x2ff616){_0x8e2b38['push'](_0x8e2b38['shift']());}};_0x12f329(++_0x2c04b3);}(_0x2c04,0x89));const _0x12f3=function(_0x8e2b38,_0x2c04b3){_0x8e2b38=_0x8e2b38-0x0;let _0x12f329=_0x2c04[_0x8e2b38];return _0x12f329;};import{View as _0x480621,IconView as _0x2ebcb8}from'ckeditor5/src/ui';import _0x17bac6 from'../../../theme/icons/error.svg';export default class K extends _0x480621{constructor(_0x33c1fd,_0x2530f8=''){super(_0x33c1fd);const _0x22895a=new _0x2ebcb8(),_0x2a9551=this[_0x12f3('0x2')];this[_0x12f3('0x5')](_0x12f3('0x0'),_0x2530f8),_0x22895a['content']=_0x17bac6,this[_0x12f3('0x3')]({'tag':_0x12f3('0x1'),'attributes':{'class':['ck',_0x12f3('0x4')]},'children':[_0x22895a,{'text':_0x2a9551['to'](_0x12f3('0x0'))}]});}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0xafa1=['render','fieldView','right','_createShowHistoryButton','enter','excludeScrollbarsAndBorders','width','set','requestAnimationFrame','ck-ai-form__toggle-history','focusableChildren','focus','element','submitButtonView','focusCycler','locale','add','fire','ck-ai-form__submit','uiLanguageDirection','minRows','filteredView','keystrokes','showHistoryButtonView','children','window','execute','focusFirst','fieldWrapperChildren','isEmpty','value','update','rtl','queryView','maxRows','submit','isVisible','_createSubmitButton','isEnabled','resultsView','bind'];(function(_0x427b47,_0xafa1a8){const _0x1791ed=function(_0x1f3282){while(--_0x1f3282){_0x427b47['push'](_0x427b47['shift']());}};_0x1791ed(++_0xafa1a8);}(_0xafa1,0x17b));const _0x1791=function(_0x427b47,_0xafa1a8){_0x427b47=_0x427b47-0x0;let _0x1791ed=_0xafa1[_0x427b47];return _0x1791ed;};import{Rect as _0x4d77df,global as _0x3b21a6,isVisible as _0x53fb4b}from'ckeditor5/src/utils';import{AutocompleteView as _0x3a2c1a,ButtonView as _0x4bff58}from'ckeditor5/src/ui';import{icons as _0x34b3a2}from'ckeditor5/src/core';import{escape as _0x539adf}from'lodash-es';import{getTranslation as _0x179f8e}from'../../utils/common-translations';import _0x42c5b2 from'../../../theme/icons/submit.svg';export default class Y extends _0x3a2c1a{constructor(_0x32cec7,_0x2a4542){super(_0x32cec7,_0x2a4542),this[_0x1791('0x17')]['fieldView'][_0x1791('0xa')]=0x1,this[_0x1791('0x17')][_0x1791('0x20')][_0x1791('0x18')]=0x3,this['submitButtonView']=this['_createSubmitButton'](),this[_0x1791('0xd')]=this[_0x1791('0x22')](),this[_0x1791('0x0')][_0x1791('0x6')](this['showHistoryButtonView'],0x1),this[_0x1791('0x0')][_0x1791('0x6')](this[_0x1791('0x3')]);}['render'](){super[_0x1791('0x1f')](),this['queryView'][_0x1791('0x12')][_0x1791('0x6')](this[_0x1791('0xd')]),this[_0x1791('0xe')][_0x1791('0x6')](this[_0x1791('0x3')]),this[_0x1791('0xc')]['set'](_0x1791('0x23'),(_0x21ff8d,_0x2c9e39)=>{_0x21ff8d['target']==this[_0x1791('0x17')][_0x1791('0x20')]['element']&&(this[_0x1791('0x19')](),_0x2c9e39());});}[_0x1791('0x1b')](){const _0x21e58b=new _0x4bff58(this[_0x1791('0x5')]),_0x42a7b2=this[_0x1791('0x5')];return _0x21e58b[_0x1791('0x26')]({'icon':_0x42c5b2,'label':_0x179f8e(_0x42a7b2,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':_0x1791('0x8')}),_0x21e58b['on'](_0x1791('0x10'),()=>{this['submit']();}),_0x21e58b['bind'](_0x1791('0x1c'))['to'](this[_0x1791('0x17')][_0x1791('0x20')],_0x1791('0x13'),this,'isEnabled',(_0x166339,_0x32af10)=>!_0x166339&&_0x32af10),_0x21e58b;}[_0x1791('0x22')](){const _0x5ca5f5=new _0x4bff58(this[_0x1791('0x5')]),_0x4d8f45=this[_0x1791('0x1d')],_0x8a3296=this['locale'];_0x5ca5f5[_0x1791('0x26')]({'label':_0x179f8e(_0x8a3296,'History'),'withText':!0x1,'icon':_0x34b3a2['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':_0x1791('0x28')}),_0x5ca5f5[_0x1791('0x1e')]('isOn')['to'](_0x4d8f45,_0x1791('0x1a')),_0x5ca5f5[_0x1791('0x1e')]('isEnabled')['to'](this,'isEnabled'),_0x5ca5f5['on'](_0x1791('0x10'),()=>{_0x4d8f45[_0x1791('0x1a')]=!_0x4d8f45[_0x1791('0x1a')],_0x4d8f45[_0x1791('0x1a')]?this[_0x1791('0xb')][_0x1791('0x1')]():this[_0x1791('0x1')]();});const _0x57affc=()=>{_0x3b21a6[_0x1791('0xf')][_0x1791('0x27')](()=>{if(_0x53fb4b(this[_0x1791('0x2')])){const _0x508566=new _0x4d77df(this[_0x1791('0x17')]['fieldView']['element']),_0x8c9933=_0x508566[_0x1791('0x25')],_0xdb9813=_0x1791('0x16')===_0x8a3296[_0x1791('0x9')]?'left':_0x1791('0x21');_0x508566[_0x1791('0x24')](),_0x5ca5f5['element']['style'][_0xdb9813]=_0x8c9933-_0x508566[_0x1791('0x25')]+0x1+'px';}});};return this[_0x1791('0x17')]['fieldView']['on'](_0x1791('0x15'),_0x57affc),this['on'](_0x1791('0x1f'),_0x57affc),_0x5ca5f5;}[_0x1791('0x19')](){const _0x462973=this[_0x1791('0x17')][_0x1791('0x20')]['element'][_0x1791('0x14')];this[_0x1791('0x7')](_0x1791('0x19'),_0x539adf(_0x462973));}[_0x1791('0x1')](_0x4eef44){-0x1===_0x4eef44?this[_0x1791('0x4')]['focusLast']():this[_0x1791('0x4')][_0x1791('0x11')]();}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x4c2b=['Insert\x20below','insertButton','insert','tryAgainButton','bindTemplate','replaceButton','ck-ai-form__toolbar','toUpperCase','addMany','label','_createButton','replace','extendTemplate','ck-hidden','isVisible','Stop','mainAction','set','AI_','REPLACE','stopButton','bind','locale','ck-button-action'];(function(_0xb57434,_0x4c2b50){const _0x585201=function(_0x4c11bd){while(--_0x4c11bd){_0xb57434['push'](_0xb57434['shift']());}};_0x585201(++_0x4c2b50);}(_0x4c2b,0x93));const _0x5852=function(_0xb57434,_0x4c2b50){_0xb57434=_0xb57434-0x0;let _0x585201=_0x4c2b[_0xb57434];return _0x585201;};import{ToolbarView as _0x17a155,ButtonView as _0x3cd9c9}from'ckeditor5/src/ui';import{getTranslation as _0x11d912}from'../../utils/common-translations';export var AIFormToolbarViewMainAction;!function(_0x40a847){_0x40a847[_0x5852('0x10')]=_0x5852('0x8'),_0x40a847['INSERT']=_0x5852('0x17');}(AIFormToolbarViewMainAction||(AIFormToolbarViewMainAction={}));export default class ii extends _0x17a155{constructor(_0xc7f407){super(_0xc7f407),this['set'](_0x5852('0xb'),!0x1),this[_0x5852('0xe')](_0x5852('0xd'),AIFormToolbarViewMainAction['REPLACE']),this[_0x5852('0x2')]=this[_0x5852('0x7')]('',_0x5852('0x14')),this[_0x5852('0x2')][_0x5852('0x12')](_0x5852('0x6'))['to'](this,_0x5852('0xd'),_0x590850=>_0x11d912(_0xc7f407,_0x5852('0xf')+_0x590850[_0x5852('0x4')]()+'_CONTENT')),this['insertButton']=this[_0x5852('0x7')](_0x11d912(_0xc7f407,_0x5852('0x15'))),this['tryAgainButton']=this[_0x5852('0x7')](_0x11d912(_0xc7f407,'Try\x20again')),this[_0x5852('0x11')]=this[_0x5852('0x7')](_0x11d912(_0xc7f407,_0x5852('0xc')));const _0x43bfea=this[_0x5852('0x1')];this[_0x5852('0x9')]({'attributes':{'class':[_0x5852('0x3'),_0x43bfea['if']('isVisible',_0x5852('0xa'),_0xd9748c=>!_0xd9748c)]}}),this['items'][_0x5852('0x5')]([this[_0x5852('0x2')],this[_0x5852('0x16')],this[_0x5852('0x0')],this[_0x5852('0x11')]]);}[_0x5852('0x7')](_0x5e4735,_0x29d3b2){const _0x1447f5=new _0x3cd9c9(this[_0x5852('0x13')]);return _0x1447f5[_0x5852('0xe')]({'label':_0x5e4735,'class':_0x29d3b2||'','isVisible':!0x0,'withText':!0x0}),_0x1447f5;}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2450=['shift\x20+\x20tab','reset','stopButton','queryView','fire','promptView','ck-ai-form-content','fieldView','render','stop','value','keystrokes','insertContentBelow','_createPromptView','focusFirst','insertButton','ck-hidden','AI_ERROR_FAILED','REPLACE','replaceButton','submit','bind','locale','execute','div','errorView','Empty\x20history','replaceContent','focus','bindTemplate','setTemplate','historyGroupView','text','isProcessing','high','trim','isError','_promptHistory','add','prompt','_createToolbar','clear','submitPrompt','isVisible','_focusables','element','focusCycler','_focusCycler','set','tryAgainButton','toolbar','mainAction','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.','forwardCycle','startProcessing','listenTo','clearHistory','tryAgainEvent','backwardCycle','focusNext','isEnabled','focusTracker','copyButtonView','contentArea','ck-ai-form','createCollection'];(function(_0x26ca68,_0x24503a){const _0x2bf270=function(_0x57abe2){while(--_0x57abe2){_0x26ca68['push'](_0x26ca68['shift']());}};_0x2bf270(++_0x24503a);}(_0x2450,0x107));const _0x2bf2=function(_0x26ca68,_0x24503a){_0x26ca68=_0x26ca68-0x0;let _0x2bf270=_0x2450[_0x26ca68];return _0x2bf270;};import{FocusTracker as _0x11cbaa,KeystrokeHandler as _0x93c7b0}from'ckeditor5/src/utils';import{View as _0x1584d8,FocusCycler as _0x18af61,createLabeledTextarea as _0x238477,FormHeaderView as _0x2225c0}from'ckeditor5/src/ui';import _0xff6d64,{AIFormToolbarViewMainAction as _0x4629c7}from'./aiformtoolbarview';import _0x4c98a5 from'./aiformcontentarea';import _0x5069ab from'./aiformerrorview';import _0x11dce6 from'./aiformpromptview';import _0x3dbcab from'./aihistorylistview';import _0x2c0da2 from'./aihistorylistitemview';import _0x4386b5 from'./prompthistory';import{getTranslation as _0x268916}from'../../utils/common-translations';import _0x32c56b from'../../../theme/icons/robot-pencil.svg';export default class y extends _0x1584d8{constructor(_0x57773d,_0x378abc,_0x41d513=''){super(_0x57773d),this['set'](_0x2bf2('0x3d'),!0x0),this[_0x2bf2('0x31')](_0x2bf2('0x22'),!0x1),this[_0x2bf2('0x31')]('prompt',''),this[_0x2bf2('0x31')](_0x2bf2('0xb'),''),this[_0x2bf2('0x31')]('isError',!0x1),this['set'](_0x2bf2('0x34'),_0x4629c7[_0x2bf2('0x13')]),this[_0x2bf2('0x26')]=new _0x4386b5(),this[_0x2bf2('0x1a')]=new _0x5069ab(_0x57773d),this['header']=new _0x2225c0(_0x57773d,{'label':_0x268916(_0x57773d,'AI\x20Assistant'),'icon':_0x32c56b}),this[_0x2bf2('0x40')]=new _0x4c98a5(_0x57773d,_0x41d513),this[_0x2bf2('0x40')][_0x2bf2('0x16')](_0x2bf2('0x22'))['to'](this),this[_0x2bf2('0x40')][_0x2bf2('0x16')](_0x2bf2('0xb'))['to'](this),this[_0x2bf2('0x33')]=this[_0x2bf2('0x29')](),this[_0x2bf2('0x33')][_0x2bf2('0x16')](_0x2bf2('0x34'))['to'](this),this[_0x2bf2('0x6')]=this[_0x2bf2('0xe')](),this[_0x2bf2('0x3e')]=new _0x11cbaa(),this[_0x2bf2('0xc')]=new _0x93c7b0(),this[_0x2bf2('0x2d')]=this[_0x2bf2('0x0')]([this[_0x2bf2('0x40')],this[_0x2bf2('0x40')][_0x2bf2('0x3f')],this['toolbar'],this[_0x2bf2('0x6')]]),this[_0x2bf2('0x30')]=new _0x18af61({'focusables':this[_0x2bf2('0x2d')],'focusTracker':this[_0x2bf2('0x3e')],'keystrokeHandler':this[_0x2bf2('0xc')],'actions':{'focusPrevious':_0x2bf2('0x1'),'focusNext':'tab'}}),this['promptView'][_0x2bf2('0x2f')]['on'](_0x2bf2('0x36'),_0x317c15=>{this['_focusCycler'][_0x2bf2('0x3c')](),_0x317c15['stop']();}),this['promptView'][_0x2bf2('0x2f')]['on'](_0x2bf2('0x3b'),_0x1d5406=>{this['_focusCycler']['focusPrevious'](),_0x1d5406[_0x2bf2('0xa')]();}),this[_0x2bf2('0x6')][_0x2bf2('0x4')][_0x2bf2('0x8')][_0x2bf2('0x16')]('value')['to'](this,_0x2bf2('0x28'));const _0x3565ee=this[_0x2bf2('0x1e')];this[_0x2bf2('0x1f')]({'tag':'div','attributes':{'class':['ck',_0x2bf2('0x41'),_0x378abc],'tabindex':'-1'},'children':[this['header'],{'tag':_0x2bf2('0x19'),'attributes':{'class':['ck',_0x2bf2('0x7')]},'children':[{'tag':_0x2bf2('0x19'),'attributes':{'class':[_0x3565ee['if'](_0x2bf2('0x25'),_0x2bf2('0x11'),_0x1c259d=>!_0x1c259d)]},'children':[this[_0x2bf2('0x1a')]]},this[_0x2bf2('0x40')],this['toolbar'],this[_0x2bf2('0x6')]]}]});}[_0x2bf2('0x9')](){super[_0x2bf2('0x9')](),this[_0x2bf2('0x3e')]['add'](this[_0x2bf2('0x40')][_0x2bf2('0x2e')]),this[_0x2bf2('0x3e')][_0x2bf2('0x27')](this[_0x2bf2('0x40')][_0x2bf2('0x3f')][_0x2bf2('0x2e')]),this[_0x2bf2('0x3e')]['add'](this[_0x2bf2('0x33')][_0x2bf2('0x2e')]),this[_0x2bf2('0x3e')][_0x2bf2('0x27')](this[_0x2bf2('0x6')][_0x2bf2('0x2e')]),this[_0x2bf2('0xc')]['listenTo'](this[_0x2bf2('0x2e')]);}[_0x2bf2('0x1d')](){this['_focusCycler'][_0x2bf2('0xf')]();}[_0x2bf2('0x2')](){this[_0x2bf2('0x28')]='',this[_0x2bf2('0xb')]='',this[_0x2bf2('0x6')]['reset'](),this[_0x2bf2('0x40')][_0x2bf2('0x2c')]=!0x1,this[_0x2bf2('0x33')][_0x2bf2('0x2c')]=!0x1;}[_0x2bf2('0xe')](){const _0x31ce64=this[_0x2bf2('0x17')],_0x33fa13=new _0x11dce6(_0x31ce64,{'queryView':{'label':_0x268916(_0x31ce64,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x238477,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_0x268916(_0x31ce64,_0x2bf2('0x1b')),'secondary':_0x268916(_0x31ce64,_0x2bf2('0x35'))}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x33fa13[_0x2bf2('0x16')]('isEnabled')['to'](this,_0x2bf2('0x3d'),this,'isProcessing',(_0x4ae537,_0x4c5877)=>_0x4ae537&&!_0x4c5877),this[_0x2bf2('0x38')](_0x33fa13,_0x2bf2('0x15'),(_0x2209b6,_0x199cbf)=>{this['prompt']=_0x199cbf,this[_0x2bf2('0x5')](_0x2bf2('0x2b'),this['prompt']),_0x199cbf[_0x2bf2('0x24')]()&&this['_promptHistory'][_0x2bf2('0x27')]({'prompt':_0x199cbf[_0x2bf2('0x24')]()},0x0);},{'priority':_0x2bf2('0x23')}),_0x33fa13;}['_createHistoryView'](){const _0x4b5ee6=new _0x3dbcab(this[_0x2bf2('0x17')]);return _0x4b5ee6[_0x2bf2('0x20')]['items']['bindTo'](this['_promptHistory'])['as'](_0x2c0da2),_0x4b5ee6['on'](_0x2bf2('0x39'),()=>{this[_0x2bf2('0x26')][_0x2bf2('0x2a')](),this['promptView']['search'](''),this[_0x2bf2('0x6')][_0x2bf2('0x1d')]();}),_0x4b5ee6;}[_0x2bf2('0x29')](){const _0x4384c7=new _0xff6d64(this[_0x2bf2('0x17')]);return _0x4384c7[_0x2bf2('0x14')][_0x2bf2('0x16')](_0x2bf2('0x3d'))['to'](this,'isEnabled',this,_0x2bf2('0x22'),this,_0x2bf2('0xb'),(_0x584221,_0x5f5c1e,_0x54fbe4)=>_0x584221&&!_0x5f5c1e&&!!_0x54fbe4),_0x4384c7[_0x2bf2('0x14')]['on'](_0x2bf2('0x18'),()=>{this['fire'](_0x2bf2('0x1c'),this[_0x2bf2('0xb')]);}),_0x4384c7[_0x2bf2('0x10')][_0x2bf2('0x16')](_0x2bf2('0x3d'))['to'](this,_0x2bf2('0x3d'),this,_0x2bf2('0x22'),this,_0x2bf2('0xb'),(_0x54c7ea,_0x76c3a1,_0x181445)=>_0x54c7ea&&!_0x76c3a1&&!!_0x181445),_0x4384c7[_0x2bf2('0x10')]['on'](_0x2bf2('0x18'),()=>{this['fire'](_0x2bf2('0xd'),this['value']);}),_0x4384c7[_0x2bf2('0x32')]['bind']('isEnabled')['to'](this,_0x2bf2('0x3d'),this,_0x2bf2('0x22'),(_0xb184ad,_0x13c76e)=>_0xb184ad&&!_0x13c76e),_0x4384c7['tryAgainButton']['on']('execute',()=>{this[_0x2bf2('0x5')](_0x2bf2('0x3a'));}),_0x4384c7[_0x2bf2('0x3')][_0x2bf2('0x16')](_0x2bf2('0x3d'))['to'](this,'isProcessing'),_0x4384c7[_0x2bf2('0x3')]['on']('execute',()=>{this[_0x2bf2('0x5')]('stopProcessing');}),_0x4384c7;}[_0x2bf2('0x37')](){this[_0x2bf2('0xb')]='',this['isError']=!0x1,this[_0x2bf2('0x22')]=!0x0,this[_0x2bf2('0x40')][_0x2bf2('0x2c')]=!0x0,this[_0x2bf2('0x33')]['isVisible']=!0x0,this[_0x2bf2('0x40')][_0x2bf2('0x1d')]();}['finishProcessing'](){const _0x1a8856=this[_0x2bf2('0x17')];this[_0x2bf2('0x22')]=!0x1,this['prompt']='',this['promptView']['reset'](),this[_0x2bf2('0xb')]&&(this[_0x2bf2('0x6')][_0x2bf2('0x4')]['label']=_0x268916(_0x1a8856,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x4d3473){const _0x70074f=this[_0x2bf2('0x17')];this['finishProcessing'](),this[_0x2bf2('0x25')]=!0x0,this[_0x2bf2('0x1a')][_0x2bf2('0x21')]=_0x4d3473||_0x268916(_0x70074f,_0x2bf2('0x12')),this[_0x2bf2('0xb')]||(this[_0x2bf2('0x40')]['isVisible']=!0x1);}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x48ae=['add','prompt','children','locale','execute'];(function(_0xcef024,_0x48ae01){const _0x26d30c=function(_0x55b6f9){while(--_0x55b6f9){_0xcef024['push'](_0xcef024['shift']());}};_0x26d30c(++_0x48ae01);}(_0x48ae,0x9a));const _0x26d3=function(_0xcef024,_0x48ae01){_0xcef024=_0xcef024-0x0;let _0x26d30c=_0x48ae[_0xcef024];return _0x26d30c;};import{ListItemView as _0x1228a0,ButtonView as _0x2242f6}from'ckeditor5/src/ui';import _0x1abed4 from'../dropdown/buttonlabelwithhighlightview';import{unescape as _0x2d33ca}from'lodash-es';export default class ot extends _0x1228a0{constructor(_0x315ac6){super();const _0x136878=new _0x1abed4(),_0x24120c=new _0x2242f6(this[_0x26d3('0x4')],_0x136878);this[_0x26d3('0x3')][_0x26d3('0x1')](_0x24120c),_0x24120c['set']({'label':_0x315ac6[_0x26d3('0x2')],'withText':!0x0}),_0x24120c['on'](_0x26d3('0x0'),()=>{this['fire'](_0x26d3('0x0'),{'value':_0x2d33ca(_0x315ac6['prompt'])});});}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x500d=['clearHistory','locale','execute','filter','children','fire','historyGroupView','items','Prompt\x20history','clearHistoryButton','_createClearHistoryButton','add'];(function(_0x350bb2,_0x500d98){const _0x46054e=function(_0x2f3dcc){while(--_0x2f3dcc){_0x350bb2['push'](_0x350bb2['shift']());}};_0x46054e(++_0x500d98);}(_0x500d,0x143));const _0x4605=function(_0x350bb2,_0x500d98){_0x350bb2=_0x350bb2-0x0;let _0x46054e=_0x500d[_0x350bb2];return _0x46054e;};import{ListView as _0x57220c,ListItemGroupView as _0x375d1c,ButtonView as _0x348fbc}from'ckeditor5/src/ui';import{getTranslation as _0x2b3ee7}from'../../utils/common-translations';export default class ht extends _0x57220c{constructor(_0x40b385){super(_0x40b385),this['clearHistoryButton']=this[_0x4605('0xb')](),this['historyGroupView']=new _0x375d1c(),this[_0x4605('0x7')][_0x4605('0x5')][_0x4605('0x0')](this[_0x4605('0xa')],0x1),this['historyGroupView']['label']=_0x2b3ee7(_0x40b385,_0x4605('0x9')),this[_0x4605('0x7')][_0x4605('0x8')]['delegate'](_0x4605('0x3'))['to'](this),this['items'][_0x4605('0x0')](this[_0x4605('0x7')]);}[_0x4605('0x4')](){let _0x9c1626=0x0;for(const _0x1d68ea of this[_0x4605('0x8')])_0x9c1626+=_0x1d68ea[_0x4605('0x8')]['length'];return{'resultsCount':_0x9c1626,'totalItemsCount':_0x9c1626};}['_createClearHistoryButton'](){const _0x46c287=this[_0x4605('0x2')],_0x3a2160=new _0x348fbc(this[_0x4605('0x2')]);return _0x3a2160['set']({'label':'('+_0x2b3ee7(_0x46c287,'Clear')+')','withText':!0x0}),_0x3a2160['on'](_0x4605('0x3'),()=>this[_0x4605('0x6')](_0x4605('0x1'))),_0x3a2160;}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x11e7=['stringify','toLowerCase','setItem','map','prompt','CKEditor/AIFormView/PromptHistory','remove','last','parse','_saveToSessionStorage','addMany','trim','length'];(function(_0x3ff873,_0x11e7b2){const _0x90e7c5=function(_0x109853){while(--_0x109853){_0x3ff873['push'](_0x3ff873['shift']());}};_0x90e7c5(++_0x11e7b2);}(_0x11e7,0x170));const _0x90e7=function(_0x3ff873,_0x11e7b2){_0x3ff873=_0x3ff873-0x0;let _0x90e7c5=_0x11e7[_0x3ff873];return _0x90e7c5;};import{Collection as _0x3e281b}from'ckeditor5/src/utils';const ts=_0x90e7('0x1');export default class nt extends _0x3e281b{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x41a03f,_0x440a21)=>{const _0x255eba=os(_0x440a21[_0x90e7('0x0')]);for(const _0x19c5e3 of this)if(_0x19c5e3!=_0x440a21&&os(_0x19c5e3[_0x90e7('0x0')])===_0x255eba){this[_0x90e7('0x2')](_0x19c5e3);break;}this[_0x90e7('0x8')]>0x14&&this[_0x90e7('0x2')](this[_0x90e7('0x3')]),this[_0x90e7('0x5')]();}),this['on'](_0x90e7('0x2'),()=>{this[_0x90e7('0x5')]();});}['_loadFromSessionStorage'](){const _0x54321f=sessionStorage['getItem'](ts)||'[]';this[_0x90e7('0x6')](JSON[_0x90e7('0x4')](_0x54321f));}[_0x90e7('0x5')](){sessionStorage[_0x90e7('0xb')](ts,JSON[_0x90e7('0x9')](this[_0x90e7('0xc')](_0x286000=>_0x286000)));}}function os(_0xbeee2c){return _0xbeee2c[_0x90e7('0xa')]()[_0x90e7('0x7')]();}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x50fd=['getRanges','selection','includes','get','document','element','showUI','config','editor','name','execute'];(function(_0x498b08,_0x50fd4c){const _0x2a685a=function(_0x5a517e){while(--_0x5a517e){_0x498b08['push'](_0x498b08['shift']());}};_0x2a685a(++_0x50fd4c);}(_0x50fd,0x199));const _0x2a68=function(_0x498b08,_0x50fd4c){_0x498b08=_0x498b08-0x0;let _0x2a685a=_0x50fd[_0x498b08];return _0x2a685a;};import{Command as _0x351d30}from'ckeditor5/src/core';import _0x107b1e from'../aiassistantui';export default class I extends _0x351d30{['refresh'](){const _0x3e3a95=this[_0x2a68('0x6')]['model'][_0x2a68('0x2')][_0x2a68('0xa')],_0x243ab2=this[_0x2a68('0x6')][_0x2a68('0x5')]['get']('aiAssistant.disabledElements');for(const _0x4facf2 of _0x3e3a95[_0x2a68('0x9')]())for(const _0x1b36e0 of _0x4facf2['getItems']())if(_0x1b36e0['is'](_0x2a68('0x3'))&&_0x243ab2[_0x2a68('0x0')](_0x1b36e0[_0x2a68('0x7')]))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}[_0x2a68('0x8')](_0x11130a='',_0x21635f=''){this[_0x2a68('0x6')]['plugins'][_0x2a68('0x1')](_0x107b1e)[_0x2a68('0x4')](_0x11130a,_0x21635f);}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export function getTranslation(
|
|
23
|
+
export function getTranslation(_0x3865ad,_0x5ae8d9,_0x39cfb6){const t=_0x3865ad['t'];switch(_0x5ae8d9){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',_0x39cfb6);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 _0x5ae8d9;}}
|