@ckeditor/ckeditor5-ai 40.1.0 → 40.2.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.
Files changed (148) hide show
  1. package/README.md +1 -1
  2. package/build/ai.js +77 -2
  3. package/build/translations/af.js +1 -1
  4. package/build/translations/ar.js +1 -1
  5. package/build/translations/bg.js +1 -1
  6. package/build/translations/bn.js +1 -1
  7. package/build/translations/bs.js +1 -1
  8. package/build/translations/ca.js +1 -1
  9. package/build/translations/cs.js +1 -1
  10. package/build/translations/da.js +1 -1
  11. package/build/translations/de-ch.js +1 -1
  12. package/build/translations/de.js +1 -1
  13. package/build/translations/el.js +1 -1
  14. package/build/translations/en-au.js +1 -1
  15. package/build/translations/es-co.js +1 -1
  16. package/build/translations/es.js +1 -1
  17. package/build/translations/et.js +1 -1
  18. package/build/translations/fa.js +1 -1
  19. package/build/translations/fi.js +1 -1
  20. package/build/translations/fr.js +1 -1
  21. package/build/translations/gl.js +1 -1
  22. package/build/translations/he.js +1 -1
  23. package/build/translations/hi.js +1 -1
  24. package/build/translations/hr.js +1 -1
  25. package/build/translations/hu.js +1 -1
  26. package/build/translations/id.js +1 -1
  27. package/build/translations/it.js +1 -1
  28. package/build/translations/ja.js +1 -1
  29. package/build/translations/jv.js +1 -1
  30. package/build/translations/ko.js +1 -1
  31. package/build/translations/lt.js +1 -1
  32. package/build/translations/lv.js +1 -1
  33. package/build/translations/ms.js +1 -1
  34. package/build/translations/nl.js +1 -1
  35. package/build/translations/no.js +1 -1
  36. package/build/translations/pl.js +1 -1
  37. package/build/translations/pt-br.js +1 -1
  38. package/build/translations/pt.js +1 -1
  39. package/build/translations/ro.js +1 -1
  40. package/build/translations/ru.js +1 -1
  41. package/build/translations/sk.js +1 -1
  42. package/build/translations/sr-latn.js +1 -1
  43. package/build/translations/sr.js +1 -1
  44. package/build/translations/sv.js +1 -1
  45. package/build/translations/th.js +1 -1
  46. package/build/translations/tk.js +1 -1
  47. package/build/translations/tr.js +1 -1
  48. package/build/translations/ug.js +1 -1
  49. package/build/translations/uk.js +1 -1
  50. package/build/translations/ur.js +1 -1
  51. package/build/translations/uz.js +1 -1
  52. package/build/translations/vi.js +1 -1
  53. package/build/translations/zh-cn.js +1 -1
  54. package/build/translations/zh.js +1 -1
  55. package/ckeditor5-metadata.json +1 -1
  56. package/lang/contexts.json +3 -1
  57. package/lang/translations/af.po +2 -2
  58. package/lang/translations/ar.po +3 -3
  59. package/lang/translations/bg.po +3 -3
  60. package/lang/translations/bn.po +3 -3
  61. package/lang/translations/bs.po +2 -2
  62. package/lang/translations/ca.po +3 -3
  63. package/lang/translations/cs.po +3 -3
  64. package/lang/translations/da.po +3 -3
  65. package/lang/translations/de-ch.po +2 -2
  66. package/lang/translations/de.po +3 -3
  67. package/lang/translations/el.po +3 -3
  68. package/lang/translations/en-au.po +2 -2
  69. package/lang/translations/en.po +3 -3
  70. package/lang/translations/es-co.po +2 -2
  71. package/lang/translations/es.po +3 -3
  72. package/lang/translations/et.po +3 -3
  73. package/lang/translations/fa.po +2 -2
  74. package/lang/translations/fi.po +3 -3
  75. package/lang/translations/fr.po +3 -3
  76. package/lang/translations/gl.po +50 -50
  77. package/lang/translations/he.po +3 -3
  78. package/lang/translations/hi.po +3 -3
  79. package/lang/translations/hr.po +2 -2
  80. package/lang/translations/hu.po +3 -3
  81. package/lang/translations/id.po +3 -3
  82. package/lang/translations/it.po +3 -3
  83. package/lang/translations/ja.po +3 -3
  84. package/lang/translations/jv.po +2 -2
  85. package/lang/translations/ko.po +3 -3
  86. package/lang/translations/lt.po +3 -3
  87. package/lang/translations/lv.po +3 -3
  88. package/lang/translations/ms.po +3 -3
  89. package/lang/translations/nl.po +3 -3
  90. package/lang/translations/no.po +3 -3
  91. package/lang/translations/pl.po +3 -3
  92. package/lang/translations/pt-br.po +3 -3
  93. package/lang/translations/pt.po +3 -3
  94. package/lang/translations/ro.po +3 -3
  95. package/lang/translations/ru.po +3 -3
  96. package/lang/translations/sk.po +3 -3
  97. package/lang/translations/sr-latn.po +50 -50
  98. package/lang/translations/sr.po +3 -3
  99. package/lang/translations/sv.po +3 -3
  100. package/lang/translations/th.po +3 -3
  101. package/lang/translations/tk.po +2 -2
  102. package/lang/translations/tr.po +3 -3
  103. package/lang/translations/ug.po +15 -15
  104. package/lang/translations/uk.po +3 -3
  105. package/lang/translations/ur.po +2 -2
  106. package/lang/translations/uz.po +2 -2
  107. package/lang/translations/vi.po +3 -3
  108. package/lang/translations/zh-cn.po +3 -3
  109. package/lang/translations/zh.po +3 -3
  110. package/package.json +4 -3
  111. package/src/adapters/aiadapter.d.ts +48 -0
  112. package/src/adapters/aiadapter.js +23 -0
  113. package/src/adapters/aitextadapter.d.ts +146 -0
  114. package/src/adapters/aitextadapter.js +23 -0
  115. package/src/adapters/awstextadapter.d.ts +178 -0
  116. package/src/adapters/awstextadapter.js +23 -0
  117. package/src/adapters/openaitextadapter.d.ts +181 -0
  118. package/src/adapters/openaitextadapter.js +23 -0
  119. package/src/aiassistant.d.ts +44 -116
  120. package/src/aiassistant.js +1 -1
  121. package/src/aiassistantediting.js +1 -1
  122. package/src/aiassistantui.d.ts +12 -4
  123. package/src/aiassistantui.js +1 -1
  124. package/src/aiconfig.d.ts +69 -0
  125. package/src/aiconfig.js +23 -0
  126. package/src/augmentation.d.ts +6 -5
  127. package/src/index.d.ts +4 -0
  128. package/src/index.js +1 -1
  129. package/src/ui/aiassistantcontroller.d.ts +32 -19
  130. package/src/ui/aiassistantcontroller.js +1 -1
  131. package/src/ui/dropdown/aicommandslistview.js +1 -1
  132. package/src/ui/dropdown/buttonlabelwithhighlightview.js +1 -1
  133. package/src/ui/dropdown/labelwithhighlightview.js +1 -1
  134. package/src/ui/form/aiformcontentarea.js +1 -1
  135. package/src/ui/form/aiformerrorview.js +1 -1
  136. package/src/ui/form/aiformpromptview.js +1 -1
  137. package/src/ui/form/aiformtoolbarview.d.ts +2 -2
  138. package/src/ui/form/aiformtoolbarview.js +1 -1
  139. package/src/ui/form/aiformview.d.ts +2 -2
  140. package/src/ui/form/aiformview.js +1 -1
  141. package/src/ui/form/aihistorylistitemview.js +1 -1
  142. package/src/ui/form/aihistorylistview.js +1 -1
  143. package/src/ui/form/prompthistory.js +1 -1
  144. package/src/ui/showaiassistantcommand.d.ts +6 -3
  145. package/src/ui/showaiassistantcommand.js +1 -1
  146. package/src/utils/common-translations.js +1 -1
  147. package/src/aiconnector.d.ts +0 -45
  148. package/src/aiconnector.js +0 -23
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x50ac=['div','initialContext','currentContext','innerHTML','isProcessing','stopListening','startProcessing','previousPrompt','finishProcessing','destroy','connector','_updateValue','handleError','once','tryAgainEvent','prompt','processPrompt','catch','stopProcessing','mainAction','_sanitizationContainer','domConverter','previousLabel','bind','listenTo','submitPrompt','previousContext','view','createElement','_sanitizeHTML','set','setContentOf','editor','reset','abort','message','_handlePrompt'];(function(_0x1c6470,_0x50acb2){const _0x589874=function(_0x4cb4ec){while(--_0x4cb4ec){_0x1c6470['push'](_0x1c6470['shift']());}};_0x589874(++_0x50acb2);}(_0x50ac,0xdb));const _0x5898=function(_0x1c6470,_0x50acb2){_0x1c6470=_0x1c6470-0x0;let _0x589874=_0x50ac[_0x1c6470];return _0x589874;};import{ObservableMixin as _0x55829f}from'ckeditor5/src/utils';import{AIRequestError as _0x1b0948}from'../aiconnector';export default class g extends _0x55829f(){constructor(_0x2eee64,_0x23b8ec,_0x3e1db1){super(),this[_0x5898('0x23')]=_0x2eee64,this[_0x5898('0xd')]=_0x23b8ec,this[_0x5898('0x17')]=document[_0x5898('0x1f')](_0x5898('0x3')),this['view']=_0x3e1db1,this[_0x5898('0x21')]({'initialContext':'','currentContext':'','previousContext':void 0x0,'previousPrompt':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['view'][_0x5898('0x1a')]('value')['to'](this,'currentContext',this['_sanitizeHTML'][_0x5898('0x1a')](this)),this[_0x5898('0x1b')](this[_0x5898('0x1e')],_0x5898('0x1c'),(_0x527a1e,_0x37c1f7)=>{const _0x228bba=this[_0x5898('0x5')]||this['initialContext'];this[_0x5898('0x2')](_0x37c1f7,_0x228bba);}),this[_0x5898('0x1b')](this[_0x5898('0x1e')],_0x5898('0x11'),()=>{this['view'][_0x5898('0x12')]=this['previousLabel'],this[_0x5898('0x2')](this[_0x5898('0xa')],this['previousContext'],this[_0x5898('0x19')]);}),this[_0x5898('0x1b')](this[_0x5898('0x1e')],_0x5898('0x15'),()=>{this[_0x5898('0x15')]();});}[_0x5898('0xc')](){this[_0x5898('0x8')]();}async['updateView']({prompt:_0x25bebd,htmlContent:_0x302c0a,label:_0x22790c,mainAction:_0x3cb4f4}){this[_0x5898('0x1e')]['prompt']=_0x22790c,this[_0x5898('0x1e')][_0x5898('0x16')]=_0x3cb4f4,this[_0x5898('0x4')]=_0x302c0a,_0x25bebd&&(this[_0x5898('0x1e')]['isRendered']?this[_0x5898('0x2')](_0x25bebd,_0x302c0a,_0x22790c):this['view'][_0x5898('0x10')]('render',()=>{this[_0x5898('0x2')](_0x25bebd,_0x302c0a,_0x22790c);}));}[_0x5898('0x15')](){this['isProcessing']&&(this[_0x5898('0x7')]=!0x1,this[_0x5898('0x1e')][_0x5898('0xb')](),this[_0x5898('0xd')][_0x5898('0x0')]());}[_0x5898('0x24')](){this[_0x5898('0x4')]='',this[_0x5898('0x5')]='',this[_0x5898('0x1d')]='',this['previousPrompt']='',this[_0x5898('0x19')]='',this[_0x5898('0x1e')]['reset'](),this[_0x5898('0x15')]();}async[_0x5898('0x2')](_0x2119bc,_0x5403bc,_0x368803){return this[_0x5898('0x7')]=!0x0,this[_0x5898('0x1e')][_0x5898('0x9')](),this[_0x5898('0x1d')]=_0x5403bc,this[_0x5898('0xa')]=_0x2119bc,this[_0x5898('0x19')]=_0x368803||_0x2119bc,new Promise(_0x1de4af=>{this[_0x5898('0xd')][_0x5898('0x13')](_0x2119bc,_0x5403bc,_0xb23dc3=>this[_0x5898('0xe')](_0xb23dc3))[_0x5898('0x14')](_0x192d70=>{_0x192d70 instanceof _0x1b0948?this[_0x5898('0x1e')]['handleError'](_0x192d70[_0x5898('0x1')]):this[_0x5898('0x1e')][_0x5898('0xf')](),_0x1de4af();})['finally'](()=>{this[_0x5898('0x15')](),_0x1de4af();});});}['_updateValue'](_0x553d43){this[_0x5898('0x5')]=''+_0x553d43;}[_0x5898('0x20')](_0xe31135){return this[_0x5898('0x23')]['editing']['view'][_0x5898('0x18')][_0x5898('0x22')](this['_sanitizationContainer'],_0xe31135),this[_0x5898('0x17')][_0x5898('0x6')];}}
23
+ const _0x5c73=['startProcessing','_normalizeResponseHeadings','isProcessing','textAdapter','rename','bind','push','domConverter','text/html','_xmlSerializer','currentContext','_domParser','_parseAndNormalizeContent','substring','isRendered','stopProcessing','handleError','previousQuery','updateView','stringify','editing','listenTo','length','childNodes','body','previousLabel','_handleQuery','processor','prompt','reset','makeRequest','element','finally','match','custom','_sanitizationContainer','toModel','tryAgainEvent','set','mainAction','finishProcessing','currentResponse','remove','innerHTML','exec','createElement','view','previousActionId','destroy','abort','editor','initialContext','data','previousContext','parseFromString','serializeToString','document','ELEMENT_NODE','div','nodeType','then','_sanitizeHTML'];(function(_0x44a658,_0x5c73f0){const _0x1d1e24=function(_0x4b3aae){while(--_0x4b3aae){_0x44a658['push'](_0x44a658['shift']());}};_0x1d1e24(++_0x5c73f0);}(_0x5c73,0x184));const _0x1d1e=function(_0x44a658,_0x5c73f0){_0x44a658=_0x44a658-0x0;let _0x1d1e24=_0x5c73[_0x44a658];return _0x1d1e24;};import{ObservableMixin as _0x504da8}from'ckeditor5/src/utils';import{AIRequestError as _0x4d4690}from'../adapters/aiadapter';import{Matcher as _0x32f5dd,UpcastWriter as _0x5644b7}from'ckeditor5/src/engine';const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');export default class g extends _0x504da8(){constructor(_0x5a22f7,_0x18ae04,_0x26b422){super(),this[_0x1d1e('0x22')]=_0x5a22f7,this[_0x1d1e('0x31')]=_0x18ae04,this[_0x1d1e('0x13')]=document[_0x1d1e('0x1d')](_0x1d1e('0x2a')),this[_0x1d1e('0x39')]=new DOMParser(),this[_0x1d1e('0x37')]=new XMLSerializer(),this[_0x1d1e('0x1e')]=_0x26b422,this[_0x1d1e('0x16')]({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['view'][_0x1d1e('0x33')]('value')['to'](this,_0x1d1e('0x38'),this['_sanitizeHTML'][_0x1d1e('0x33')](this)),this[_0x1d1e('0x5')](this[_0x1d1e('0x1e')],'submitPrompt',(_0x40414c,_0x1f475c)=>{const _0x91cc86=this[_0x1d1e('0x38')]||this[_0x1d1e('0x23')];this[_0x1d1e('0xa')](_0x1f475c,_0x91cc86,_0x1d1e('0x12'));}),this[_0x1d1e('0x5')](this['view'],_0x1d1e('0x15'),()=>{this['view'][_0x1d1e('0xc')]=this[_0x1d1e('0x9')],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this[_0x1d1e('0x5')](this[_0x1d1e('0x1e')],_0x1d1e('0x3d'),()=>{this[_0x1d1e('0x3d')]();});}[_0x1d1e('0x20')](){this['stopListening']();}async[_0x1d1e('0x2')]({actionId:_0x2ef7c8,query:_0x3a4f5d,htmlContent:_0x4e4131,label:_0x3690a7,mainActionLabel:_0x5935dc}){this[_0x1d1e('0x1e')][_0x1d1e('0xc')]=_0x3690a7,this[_0x1d1e('0x1e')][_0x1d1e('0x17')]=_0x5935dc,this[_0x1d1e('0x23')]=_0x4e4131,_0x3a4f5d&&(this[_0x1d1e('0x1e')][_0x1d1e('0x3c')]?this[_0x1d1e('0xa')](_0x3a4f5d,_0x4e4131,_0x2ef7c8,_0x3690a7):this['view']['once']('render',()=>{this[_0x1d1e('0xa')](_0x3a4f5d,_0x4e4131,_0x2ef7c8,_0x3690a7);}));}[_0x1d1e('0x3d')](){this['isProcessing']&&(this[_0x1d1e('0x30')]=!0x1,this[_0x1d1e('0x1e')][_0x1d1e('0x18')](),this[_0x1d1e('0x31')][_0x1d1e('0x21')]());}['reset'](){this['initialContext']='',this[_0x1d1e('0x38')]='',this[_0x1d1e('0x19')]='',this[_0x1d1e('0x25')]='',this[_0x1d1e('0x1')]='',this[_0x1d1e('0x9')]='',this['previousActionId']=void 0x0,this[_0x1d1e('0x1e')][_0x1d1e('0xd')](),this[_0x1d1e('0x3d')]();}async[_0x1d1e('0xa')](_0x2eff3d,_0x4e156c,_0x266348,_0xae26e6){return this[_0x1d1e('0x30')]=!0x0,this[_0x1d1e('0x1e')][_0x1d1e('0x2e')](),this[_0x1d1e('0x25')]=_0x4e156c,this['previousQuery']=_0x2eff3d,this[_0x1d1e('0x9')]=_0xae26e6||_0x2eff3d,this[_0x1d1e('0x1f')]=_0x266348,new Promise(_0x4895c0=>{this[_0x1d1e('0x31')][_0x1d1e('0xe')]({'query':_0x2eff3d,'context':_0x4e156c,'onData':_0x5d4109=>{this[_0x1d1e('0x19')]=_0x5d4109,this['currentContext']=this[_0x1d1e('0x3a')](this[_0x1d1e('0x19')]);},'actionId':_0x266348})[_0x1d1e('0x2c')](()=>{!this[_0x1d1e('0x38')]&&this[_0x1d1e('0x19')]&&(this[_0x1d1e('0x38')]=this['_parseAndNormalizeContent'](this[_0x1d1e('0x19')],!0x0));})['catch'](_0x1a3d46=>{_0x1a3d46 instanceof _0x4d4690?this[_0x1d1e('0x1e')][_0x1d1e('0x0')](_0x1a3d46['message']):this['view'][_0x1d1e('0x0')](),_0x4895c0();})[_0x1d1e('0x10')](()=>{this[_0x1d1e('0x3d')](),_0x4895c0();});});}[_0x1d1e('0x3a')](_0x3862a7,_0x5a0ee7=!0x1){const _0x4813f8=Z[_0x1d1e('0x1c')](_0x3862a7);_0x4813f8?_0x3862a7=_0x3862a7[_0x1d1e('0x3b')](_0x4813f8[0x1][_0x1d1e('0x6')]):_0x3862a7['length']<0x64&&!_0x5a0ee7&&(_0x3862a7='');const _0x4b7dda=this[_0x1d1e('0x39')][_0x1d1e('0x26')](_0x3862a7,_0x1d1e('0x36'));if(_0x4813f8)for(const _0x388c83 of _0x4b7dda[_0x1d1e('0x8')][_0x1d1e('0x7')])_0x388c83[_0x1d1e('0x2b')]!=Node[_0x1d1e('0x29')]&&_0x388c83[_0x1d1e('0x1a')]();const _0x27b105=this[_0x1d1e('0x22')]['data'][_0x1d1e('0xb')]['toView'](this[_0x1d1e('0x37')][_0x1d1e('0x27')](_0x4b7dda[_0x1d1e('0x8')]));return this[_0x1d1e('0x2f')](_0x27b105),this['editor']['data'][_0x1d1e('0x3')](this[_0x1d1e('0x22')][_0x1d1e('0x24')][_0x1d1e('0x14')](_0x27b105));}[_0x1d1e('0x2f')](_0x52232d){const _0x2060e2=new _0x5644b7(this['editor'][_0x1d1e('0x4')][_0x1d1e('0x1e')][_0x1d1e('0x28')]),_0x396d49=new _0x32f5dd({'name':/^h[1-5]$/}),_0x11755e=[];let _0xaf0d77=!0x1;for(const _0x538722 of _0x52232d)_0x538722['is'](_0x1d1e('0xf'))&&_0x396d49[_0x1d1e('0x11')](_0x538722)&&(_0x11755e[_0x1d1e('0x34')](_0x538722),'h1'==_0x538722['name']&&(_0xaf0d77=!0x0));if(_0xaf0d77)for(const _0x132255 of _0x11755e)_0x2060e2[_0x1d1e('0x32')]('h'+(parseInt(_0x132255['name'][0x1])+0x1),_0x132255);}[_0x1d1e('0x2d')](_0x55edd3){return this[_0x1d1e('0x22')][_0x1d1e('0x4')]['view'][_0x1d1e('0x35')]['setContentOf'](this['_sanitizationContainer'],_0x55edd3),this[_0x1d1e('0x13')][_0x1d1e('0x1b')];}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x3a61=['label','isVisible','labelView','match','items','children','first','filter','highlightText','length'];(function(_0x3c831d,_0x3a613b){const _0x14e51c=function(_0x12bff9){while(--_0x12bff9){_0x3c831d['push'](_0x3c831d['shift']());}};_0x14e51c(++_0x3a613b);}(_0x3a61,0x73));const _0x14e5=function(_0x3c831d,_0x3a613b){_0x3c831d=_0x3c831d-0x0;let _0x14e51c=_0x3a61[_0x3c831d];return _0x14e51c;};import{ListView as _0xf20607}from'ckeditor5/src/ui';export default class y extends _0xf20607{[_0x14e5('0x2')](_0x38f928){let _0x1ae765=0x0,_0x22eee1=0x0;for(const _0x424eb5 of this['items']){const _0x45c5b1=_0x424eb5,_0x446b45=_0x38f928&&!!_0x45c5b1[_0x14e5('0x5')][_0x14e5('0x8')](_0x38f928);_0x45c5b1[_0x14e5('0x7')][_0x14e5('0x3')](_0x446b45?_0x38f928:null);for(const _0x4187a4 of _0x45c5b1['items']){const _0xca2fb9=_0x4187a4[_0x14e5('0x0')][_0x14e5('0x1')],_0x31bfa7=_0xca2fb9[_0x14e5('0x7')];if(_0x38f928){const _0x46fd7d=!!_0xca2fb9[_0x14e5('0x5')][_0x14e5('0x8')](_0x38f928);_0x31bfa7[_0x14e5('0x3')](_0x46fd7d?_0x38f928:null),_0x4187a4[_0x14e5('0x6')]=_0x446b45||_0x46fd7d;}else _0x4187a4[_0x14e5('0x6')]=!0x0,_0x31bfa7[_0x14e5('0x3')](null);}const _0x568b20=_0x45c5b1[_0x14e5('0x9')][_0x14e5('0x2')](_0x47b189=>_0x47b189[_0x14e5('0x6')])[_0x14e5('0x4')];_0x1ae765+=_0x45c5b1['items']['length'],_0x22eee1+=_0x446b45?_0x45c5b1[_0x14e5('0x9')][_0x14e5('0x4')]:_0x568b20,_0x45c5b1[_0x14e5('0x6')]=_0x446b45||!!_0x568b20;}return{'resultsCount':_0x22eee1,'totalItemsCount':_0x1ae765};}}
23
+ const _0x11ab=['children','filter','length','labelView','label','highlightText','isVisible','items','match'];(function(_0x5ba5f6,_0x11ab10){const _0x25074b=function(_0x58dd3d){while(--_0x58dd3d){_0x5ba5f6['push'](_0x5ba5f6['shift']());}};_0x25074b(++_0x11ab10);}(_0x11ab,0x1e5));const _0x2507=function(_0x5ba5f6,_0x11ab10){_0x5ba5f6=_0x5ba5f6-0x0;let _0x25074b=_0x11ab[_0x5ba5f6];return _0x25074b;};import{ListView as _0x8274be}from'ckeditor5/src/ui';export default class y extends _0x8274be{[_0x2507('0x2')](_0x53833f){let _0x411229=0x0,_0x26b7ff=0x0;for(const _0x48e838 of this[_0x2507('0x8')]){const _0x21e993=_0x48e838,_0x452651=_0x21e993['items'],_0x187512=_0x53833f&&!!_0x21e993[_0x2507('0x5')][_0x2507('0x0')](_0x53833f);_0x21e993[_0x2507('0x4')][_0x2507('0x6')](_0x187512?_0x53833f:null);for(const _0x5150d6 of _0x452651){const _0x4fdb4b=_0x5150d6[_0x2507('0x1')]['first'],_0xc6fd64=_0x4fdb4b[_0x2507('0x4')];if(_0x53833f){const _0x98c58c=!!_0x4fdb4b[_0x2507('0x5')]['match'](_0x53833f);_0xc6fd64[_0x2507('0x6')](_0x98c58c?_0x53833f:null),_0x5150d6[_0x2507('0x7')]=_0x187512||_0x98c58c;}else _0x5150d6[_0x2507('0x7')]=!0x0,_0xc6fd64[_0x2507('0x6')](null);}const _0x24e342=_0x452651[_0x2507('0x2')](_0x3b02e8=>_0x3b02e8['isVisible'])[_0x2507('0x3')];_0x411229+=_0x21e993['items'][_0x2507('0x3')],_0x26b7ff+=_0x187512?_0x21e993[_0x2507('0x8')][_0x2507('0x3')]:_0x24e342,_0x21e993[_0x2507('0x7')]=_0x187512||!!_0x24e342;}return{'resultsCount':_0x26b7ff,'totalItemsCount':_0x411229};}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x58a3=['style','extendTemplate','set','ck-button__label'];(function(_0xaae97c,_0x58a3f3){const _0x52fdba=function(_0x288d54){while(--_0x288d54){_0xaae97c['push'](_0xaae97c['shift']());}};_0x52fdba(++_0x58a3f3);}(_0x58a3,0x90));const _0x52fd=function(_0xaae97c,_0x58a3f3){_0xaae97c=_0xaae97c-0x0;let _0x52fdba=_0x58a3[_0xaae97c];return _0x52fdba;};import{HighlightedTextView as _0x5d4807}from'ckeditor5/src/ui';export default class C extends _0x5d4807{constructor(){super(),this[_0x52fd('0x2')]({'style':void 0x0,'text':void 0x0,'id':void 0x0});const _0x234700=this['bindTemplate'];this[_0x52fd('0x1')]({'attributes':{'class':[_0x52fd('0x3')],'style':_0x234700['to'](_0x52fd('0x0')),'id':_0x234700['to']('id')}});}}
23
+ const _0x53a3=['bindTemplate','set','extendTemplate','ck-button__label','style'];(function(_0x6aa097,_0x53a357){const _0x365265=function(_0x314723){while(--_0x314723){_0x6aa097['push'](_0x6aa097['shift']());}};_0x365265(++_0x53a357);}(_0x53a3,0x7f));const _0x3652=function(_0x6aa097,_0x53a357){_0x6aa097=_0x6aa097-0x0;let _0x365265=_0x53a3[_0x6aa097];return _0x365265;};import{HighlightedTextView as _0x5501c6}from'ckeditor5/src/ui';export default class k extends _0x5501c6{constructor(){super(),this[_0x3652('0x4')]({'style':void 0x0,'text':void 0x0,'id':void 0x0});const _0x3dce57=this[_0x3652('0x3')];this[_0x3652('0x0')]({'attributes':{'class':[_0x3652('0x1')],'style':_0x3dce57['to'](_0x3652('0x2')),'id':_0x3dce57['to']('id')}});}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4e24=['for','set','bindTemplate','ck-label','ck-editor__label_'];(function(_0x46b2ac,_0x4e2413){const _0x567911=function(_0xff3b0c){while(--_0xff3b0c){_0x46b2ac['push'](_0x46b2ac['shift']());}};_0x567911(++_0x4e2413);}(_0x4e24,0x76));const _0x5679=function(_0x46b2ac,_0x4e2413){_0x46b2ac=_0x46b2ac-0x0;let _0x567911=_0x4e24[_0x46b2ac];return _0x567911;};import{HighlightedTextView as _0x2492ab}from'ckeditor5/src/ui';import{uid as _0x4ca17f}from'ckeditor5/src/utils';export default class k extends _0x2492ab{constructor(){super(),this[_0x5679('0x3')](_0x5679('0x2'),void 0x0);const _0x1c6f91=this[_0x5679('0x4')];this['id']=_0x5679('0x1')+_0x4ca17f(),this['extendTemplate']({'attributes':{'class':['ck',_0x5679('0x0')],'id':this['id'],'for':_0x1c6f91['to'](_0x5679('0x2'))}});}}
23
+ const _0x2d4d=['ck-label','ck-editor__label_','set','bindTemplate','extendTemplate'];(function(_0x8c3844,_0x2d4d59){const _0x5f068d=function(_0x9a9fb2){while(--_0x9a9fb2){_0x8c3844['push'](_0x8c3844['shift']());}};_0x5f068d(++_0x2d4d59);}(_0x2d4d,0x88));const _0x5f06=function(_0x8c3844,_0x2d4d59){_0x8c3844=_0x8c3844-0x0;let _0x5f068d=_0x2d4d[_0x8c3844];return _0x5f068d;};import{HighlightedTextView as _0xa94dca}from'ckeditor5/src/ui';import{uid as _0x139cc2}from'ckeditor5/src/utils';export default class C extends _0xa94dca{constructor(){super(),this[_0x5f06('0x1')]('for',void 0x0);const _0x3559be=this[_0x5f06('0x2')];this['id']=_0x5f06('0x0')+_0x139cc2(),this[_0x5f06('0x3')]({'attributes':{'class':['ck',_0x5f06('0x4')],'id':this['id'],'for':_0x3559be['to']('for')}});}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x37da=['left','focus','write','locale','.ck-ai-form__loader','copy','createRange','firstElementChild','listenTo','div','ck-ai-form__content-area--processing','ck-ai-form__content-area-wrapper','render','ck-ai-form__copy-button','appendChild','lastElementChild','remove','contentFieldView','_createLoader','-9999px','_createCopyButton','<span>]</span>','ck-ai-form__copy-button-wrapper','wheel','AI\x20is\x20writing...','scrollHeight','text/html','bind','value','bindTemplate','execute','setTemplate','ck-reset_all-excluded','absolute','isVisible','setContent','isProcessing','_copyHTMLToClipboard','body','ClipboardItem','change:isProcessing','class','Copy','execCommand','getSelection','isEnabled','ck-ai-form__loader','loaderView','element','text/plain','copyButtonView','addRange','textContent','style','\x20ck-ai-form__copy-button--copied','<span>[</span>','ck-ai-form__content-field','ck-ai-form__content-area','innerHTML','set','appendLoader','ck-hidden','mousedown','querySelector','createElement','ck-content'];(function(_0x1ef129,_0x37da3b){const _0x2d5b3f=function(_0xd91507){while(--_0xd91507){_0x1ef129['push'](_0x1ef129['shift']());}};_0x2d5b3f(++_0x37da3b);}(_0x37da,0xe6));const _0x2d5b=function(_0x1ef129,_0x37da3b){_0x1ef129=_0x1ef129-0x0;let _0x2d5b3f=_0x37da[_0x1ef129];return _0x2d5b3f;};import{global as _0x1881ef}from'ckeditor5/src/utils';import{View as _0x1a3271,ButtonView as _0x2837dc,SpinnerView as _0x46bf30}from'ckeditor5/src/ui';import _0x438ad8 from'../../../theme/icons/copy.svg';import{getTranslation as _0x3c0cad}from'../../utils/common-translations';import{icons as _0x257af4}from'ckeditor5/src/core';export default class J extends _0x1a3271{constructor(_0x406bcb,_0x3ee16e=''){super(_0x406bcb),this[_0x2d5b('0x1b')]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2d0334=this[_0x2d5b('0x3f')];this[_0x2d5b('0x33')]=new ContentFieldView(_0x406bcb,_0x3ee16e),this['copyButtonView']=this[_0x2d5b('0x36')](),this[_0x2d5b('0x41')]({'tag':_0x2d5b('0x2b'),'attributes':{'class':['ck',_0x2d5b('0x2d'),_0x2d0334['if']('isVisible',_0x2d5b('0x1d'),_0x3aabae=>!_0x3aabae)],'tabindex':'-1'},'children':[{'tag':_0x2d5b('0x2b'),'attributes':{'class':['ck',_0x2d5b('0x19'),_0x2d0334['if']('isProcessing',_0x2d5b('0x2c'))]},'children':[this[_0x2d5b('0x33')],{'tag':_0x2d5b('0x2b'),'attributes':{'class':['ck',_0x2d5b('0x38')]},'children':[this[_0x2d5b('0x12')]]}]}]});}[_0x2d5b('0x2e')](){super[_0x2d5b('0x2e')](),this[_0x2d5b('0x3e')]&&this['contentFieldView'][_0x2d5b('0x3')](this[_0x2d5b('0x3e')]);let _0x369a77=!0x1;this['on']('change:value',(_0x72c91e,_0x386ac2,_0x756b60)=>{const _0x7c885c=!this[_0x2d5b('0x33')][_0x2d5b('0x10')][_0x2d5b('0x1f')](_0x2d5b('0x26'));this[_0x2d5b('0x33')][_0x2d5b('0x3')](_0x756b60),this[_0x2d5b('0x4')]&&_0x7c885c&&!_0x369a77&&this[_0x2d5b('0x10')]['scrollTo']({'top':this[_0x2d5b('0x10')][_0x2d5b('0x3b')],'behavior':'smooth'});}),this['on'](_0x2d5b('0x8'),(_0x4156ab,_0x58f4f1,_0x38a753)=>{_0x369a77=!0x1,_0x38a753?(this[_0x2d5b('0x3e')]=null,this[_0x2d5b('0x33')][_0x2d5b('0x1c')]()):this[_0x2d5b('0x3e')]||this[_0x2d5b('0x33')][_0x2d5b('0x3')]('');}),this[_0x2d5b('0x2a')](this[_0x2d5b('0x10')],_0x2d5b('0x39'),()=>{_0x369a77=!0x0;}),this[_0x2d5b('0x2a')](this[_0x2d5b('0x10')],_0x2d5b('0x1e'),()=>{_0x369a77=!0x0;});}[_0x2d5b('0x23')](){this[_0x2d5b('0x10')]['focus']();}['_createCopyButton'](){const _0x423e8b=this['locale'],_0x44edf4=new _0x2837dc(this['locale']),_0x4b8c20=_0x2d5b('0x2f');return _0x44edf4[_0x2d5b('0x1b')]({'label':_0x3c0cad(_0x423e8b,_0x2d5b('0xa')),'icon':_0x438ad8,'class':_0x4b8c20,'tooltip':!0x0}),_0x44edf4['bind'](_0x2d5b('0x2'))['to'](this,'value',_0xa08e7e=>!!_0xa08e7e),_0x44edf4[_0x2d5b('0x3d')](_0x2d5b('0xd'))['to'](this,_0x2d5b('0x4'),_0x3824c8=>!_0x3824c8),_0x44edf4['on'](_0x2d5b('0x40'),()=>{this['_copyHTMLToClipboard'](this[_0x2d5b('0x33')][_0x2d5b('0x10')]),_0x44edf4['icon']=_0x257af4['check'],_0x44edf4[_0x2d5b('0x9')]=_0x4b8c20+_0x2d5b('0x16'),this[_0x2d5b('0x23')](),setTimeout(()=>{_0x44edf4['icon']=_0x438ad8,_0x44edf4['class']=_0x4b8c20;},0x3e8);}),_0x44edf4;}[_0x2d5b('0x5')](_0x2ae24e){const {window:_0x5a7dd7,document:_0x1a87b6}=_0x1881ef;if(_0x5a7dd7[_0x2d5b('0x7')]){const {Blob:_0x490df0,ClipboardItem:_0x3cc060}=_0x5a7dd7,_0x118cd8=[new _0x3cc060({'text/html':new _0x490df0([_0x2ae24e[_0x2d5b('0x1a')]],{'type':_0x2d5b('0x3c')}),'text/plain':new _0x490df0([_0x2ae24e[_0x2d5b('0x14')]||''],{'type':_0x2d5b('0x11')})})];navigator['clipboard'][_0x2d5b('0x24')](_0x118cd8);}else{const _0x56f4e0=_0x1a87b6[_0x2d5b('0x20')](_0x2d5b('0x2b'));_0x56f4e0[_0x2d5b('0x15')]['position']=_0x2d5b('0x1'),_0x56f4e0['style'][_0x2d5b('0x22')]=_0x2d5b('0x35'),_0x56f4e0[_0x2d5b('0x1a')]=_0x2d5b('0x17')+_0x2ae24e['innerHTML']+_0x2d5b('0x37'),_0x1a87b6[_0x2d5b('0x6')]['appendChild'](_0x56f4e0);const _0x322151=_0x1a87b6[_0x2d5b('0x28')]();_0x322151['setStartAfter'](_0x56f4e0[_0x2d5b('0x29')]),_0x322151['setEndBefore'](_0x56f4e0[_0x2d5b('0x31')]);const _0x583f1e=_0x5a7dd7[_0x2d5b('0xc')]();_0x583f1e['removeAllRanges'](),_0x583f1e[_0x2d5b('0x13')](_0x322151),_0x1a87b6[_0x2d5b('0xb')](_0x2d5b('0x27')),_0x56f4e0[_0x2d5b('0x32')]();}}}export class ContentFieldView extends _0x1a3271{constructor(_0xbdc529,_0x4efc61=''){super(_0xbdc529),this[_0x2d5b('0xf')]=this[_0x2d5b('0x34')](),this[_0x2d5b('0x41')]({'tag':'div','attributes':{'class':['ck',_0x2d5b('0x21'),_0x4efc61,_0x2d5b('0x0'),_0x2d5b('0x18')]}});}[_0x2d5b('0x3')](_0x5012f6){this[_0x2d5b('0x10')][_0x2d5b('0x1a')]=_0x5012f6;}[_0x2d5b('0x1c')](){this[_0x2d5b('0x10')][_0x2d5b('0x30')](this[_0x2d5b('0xf')][_0x2d5b('0x10')]);}[_0x2d5b('0x34')](){const _0x59fc02=new _0x1a3271(),_0x51a3f4=this[_0x2d5b('0x25')],_0x43144d=new _0x46bf30();return _0x43144d['isVisible']=!0x0,_0x59fc02[_0x2d5b('0x41')]({'tag':'div','attributes':{'class':['ck',_0x2d5b('0xe')]},'children':[_0x43144d,{'text':_0x3c0cad(_0x51a3f4,_0x2d5b('0x3a'))}]}),_0x59fc02[_0x2d5b('0x2e')](),_0x59fc02;}}
23
+ const _0x2e73=['set','execCommand','\x20ck-ai-form__copy-button--copied','.ck-ai-form__loader','setStartAfter','mousedown','addRange','icon','ck-ai-form__loader','firstElementChild','setEndBefore','render','querySelector','change:value','ck-ai-form__content-area-wrapper','body','textContent','appendChild','value','ck-ai-form__content-area--processing','style','innerHTML','absolute','focus','-9999px','ck-reset_all-excluded','listenTo','write','left','_copyHTMLToClipboard','createElement','element','bind','class','isVisible','position','_createCopyButton','ck-hidden','locale','wheel','_createLoader','<span>[</span>','smooth','ClipboardItem','setContent','ck-ai-form__content-area','copy','lastElementChild','ck-ai-form__copy-button-wrapper','check','scrollTo','<span>]</span>','loaderView','isProcessing','clipboard','div','copyButtonView','AI\x20is\x20writing...','appendLoader','contentFieldView','setTemplate'];(function(_0x21230e,_0x2e730){const _0x121250=function(_0x3b8050){while(--_0x3b8050){_0x21230e['push'](_0x21230e['shift']());}};_0x121250(++_0x2e730);}(_0x2e73,0xef));const _0x1212=function(_0x21230e,_0x2e730){_0x21230e=_0x21230e-0x0;let _0x121250=_0x2e73[_0x21230e];return _0x121250;};import{global as _0x3fc965}from'ckeditor5/src/utils';import{View as _0x449075,ButtonView as _0x5c57d3,SpinnerView as _0xd9e06f}from'ckeditor5/src/ui';import _0x2d2aaa from'../../../theme/icons/copy.svg';import{getTranslation as _0x186599}from'../../utils/common-translations';import{icons as _0x2b0e34}from'ckeditor5/src/core';export default class Y extends _0x449075{constructor(_0x553016,_0x1541d6=''){super(_0x553016),this[_0x1212('0x5')]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1c0c95=this['bindTemplate'];this[_0x1212('0x3')]=new ContentFieldView(_0x553016,_0x1541d6),this[_0x1212('0x0')]=this[_0x1212('0x29')](),this[_0x1212('0x4')]({'tag':_0x1212('0x3c'),'attributes':{'class':['ck',_0x1212('0x13'),_0x1c0c95['if'](_0x1212('0x27'),_0x1212('0x2a'),_0x4d1958=>!_0x4d1958)],'tabindex':'-1'},'children':[{'tag':_0x1212('0x3c'),'attributes':{'class':['ck',_0x1212('0x32'),_0x1c0c95['if'](_0x1212('0x3a'),_0x1212('0x18'))]},'children':[this[_0x1212('0x3')],{'tag':'div','attributes':{'class':['ck',_0x1212('0x35')]},'children':[this[_0x1212('0x0')]]}]}]});}['render'](){super[_0x1212('0x10')](),this[_0x1212('0x17')]&&this['contentFieldView'][_0x1212('0x31')](this[_0x1212('0x17')]);let _0x29276a=!0x1;this['on'](_0x1212('0x12'),(_0x3b768b,_0x3f9ad9,_0x466f85)=>{const _0x2c724a=!this[_0x1212('0x3')]['element'][_0x1212('0x11')](_0x1212('0x8'));this['contentFieldView'][_0x1212('0x31')](_0x466f85),this['isProcessing']&&_0x2c724a&&!_0x29276a&&this[_0x1212('0x24')][_0x1212('0x37')]({'top':this['element']['scrollHeight'],'behavior':_0x1212('0x2f')});}),this['on']('change:isProcessing',(_0x47a035,_0x869405,_0x2c8b28)=>{_0x29276a=!0x1,_0x2c8b28?(this['value']=null,this[_0x1212('0x3')][_0x1212('0x2')]()):this[_0x1212('0x17')]||this[_0x1212('0x3')][_0x1212('0x31')]('');}),this[_0x1212('0x1f')](this[_0x1212('0x24')],_0x1212('0x2c'),()=>{_0x29276a=!0x0;}),this[_0x1212('0x1f')](this[_0x1212('0x24')],_0x1212('0xa'),()=>{_0x29276a=!0x0;});}[_0x1212('0x1c')](){this['element'][_0x1212('0x1c')]();}[_0x1212('0x29')](){const _0x1d1656=this[_0x1212('0x2b')],_0x51f9cd=new _0x5c57d3(this[_0x1212('0x2b')]),_0x540f92='ck-ai-form__copy-button';return _0x51f9cd[_0x1212('0x5')]({'label':_0x186599(_0x1d1656,'Copy'),'icon':_0x2d2aaa,'class':_0x540f92,'tooltip':!0x0}),_0x51f9cd[_0x1212('0x25')](_0x1212('0x27'))['to'](this,_0x1212('0x17'),_0x5d6744=>!!_0x5d6744),_0x51f9cd[_0x1212('0x25')]('isEnabled')['to'](this,_0x1212('0x3a'),_0x18b7f6=>!_0x18b7f6),_0x51f9cd['on']('execute',()=>{this[_0x1212('0x22')](this[_0x1212('0x3')][_0x1212('0x24')]),_0x51f9cd[_0x1212('0xc')]=_0x2b0e34[_0x1212('0x36')],_0x51f9cd[_0x1212('0x26')]=_0x540f92+_0x1212('0x7'),this[_0x1212('0x1c')](),setTimeout(()=>{_0x51f9cd['icon']=_0x2d2aaa,_0x51f9cd[_0x1212('0x26')]=_0x540f92;},0x3e8);}),_0x51f9cd;}['_copyHTMLToClipboard'](_0x2d48da){const {window:_0x2791c5,document:_0x3711cc}=_0x3fc965;if(_0x2791c5[_0x1212('0x30')]){const {Blob:_0x18ead9,ClipboardItem:_0x2e5a4e}=_0x2791c5,_0x3fad8d=[new _0x2e5a4e({'text/html':new _0x18ead9([_0x2d48da['innerHTML']],{'type':'text/html'}),'text/plain':new _0x18ead9([_0x2d48da[_0x1212('0x15')]||''],{'type':'text/plain'})})];navigator[_0x1212('0x3b')][_0x1212('0x20')](_0x3fad8d);}else{const _0x488f56=_0x3711cc[_0x1212('0x23')](_0x1212('0x3c'));_0x488f56[_0x1212('0x19')][_0x1212('0x28')]=_0x1212('0x1b'),_0x488f56[_0x1212('0x19')][_0x1212('0x21')]=_0x1212('0x1d'),_0x488f56[_0x1212('0x1a')]=_0x1212('0x2e')+_0x2d48da[_0x1212('0x1a')]+_0x1212('0x38'),_0x3711cc[_0x1212('0x14')][_0x1212('0x16')](_0x488f56);const _0x545e1d=_0x3711cc['createRange']();_0x545e1d[_0x1212('0x9')](_0x488f56[_0x1212('0xe')]),_0x545e1d[_0x1212('0xf')](_0x488f56[_0x1212('0x34')]);const _0x212a88=_0x2791c5['getSelection']();_0x212a88['removeAllRanges'](),_0x212a88[_0x1212('0xb')](_0x545e1d),_0x3711cc[_0x1212('0x6')](_0x1212('0x33')),_0x488f56['remove']();}}}export class ContentFieldView extends _0x449075{constructor(_0x464e4e,_0x352374=''){super(_0x464e4e),this[_0x1212('0x39')]=this[_0x1212('0x2d')](),this[_0x1212('0x4')]({'tag':_0x1212('0x3c'),'attributes':{'class':['ck','ck-content',_0x352374,_0x1212('0x1e'),'ck-ai-form__content-field']}});}['setContent'](_0x59d545){this[_0x1212('0x24')][_0x1212('0x1a')]=_0x59d545;}[_0x1212('0x2')](){this[_0x1212('0x24')][_0x1212('0x16')](this['loaderView'][_0x1212('0x24')]);}['_createLoader'](){const _0x5409fb=new _0x449075(),_0x22af48=this[_0x1212('0x2b')],_0x1cf4ec=new _0xd9e06f();return _0x1cf4ec['isVisible']=!0x0,_0x5409fb['setTemplate']({'tag':_0x1212('0x3c'),'attributes':{'class':['ck',_0x1212('0xd')]},'children':[_0x1cf4ec,{'text':_0x186599(_0x22af48,_0x1212('0x1'))}]}),_0x5409fb[_0x1212('0x10')](),_0x5409fb;}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2199=['text','ck-ai-form__error','div','content','bindTemplate'];(function(_0x4ed82f,_0x2199a1){const _0xcf369a=function(_0x31f5d0){while(--_0x31f5d0){_0x4ed82f['push'](_0x4ed82f['shift']());}};_0xcf369a(++_0x2199a1);}(_0x2199,0x1af));const _0xcf36=function(_0x4ed82f,_0x2199a1){_0x4ed82f=_0x4ed82f-0x0;let _0xcf369a=_0x2199[_0x4ed82f];return _0xcf369a;};import{View as _0x3defb9,IconView as _0x641722}from'ckeditor5/src/ui';import _0x1e9c05 from'../../../theme/icons/error.svg';export default class Q extends _0x3defb9{constructor(_0x36e729,_0x5621a4=''){super(_0x36e729);const _0x4f2bbd=new _0x641722(),_0x32e241=this[_0xcf36('0x3')];this['set'](_0xcf36('0x4'),_0x5621a4),_0x4f2bbd[_0xcf36('0x2')]=_0x1e9c05,this['setTemplate']({'tag':_0xcf36('0x1'),'attributes':{'class':['ck',_0xcf36('0x0')]},'children':[_0x4f2bbd,{'text':_0x32e241['to'](_0xcf36('0x4'))}]});}}
23
+ const _0x12b7=['setTemplate','content','bindTemplate','text'];(function(_0x5e418a,_0x12b769){const _0x4dfc07=function(_0x3d92b3){while(--_0x3d92b3){_0x5e418a['push'](_0x5e418a['shift']());}};_0x4dfc07(++_0x12b769);}(_0x12b7,0x1f0));const _0x4dfc=function(_0x5e418a,_0x12b769){_0x5e418a=_0x5e418a-0x0;let _0x4dfc07=_0x12b7[_0x5e418a];return _0x4dfc07;};import{View as _0x3e1314,IconView as _0x1cf3ac}from'ckeditor5/src/ui';import _0x4798e9 from'../../../theme/icons/error.svg';export default class et extends _0x3e1314{constructor(_0x1d0821,_0x5ceb46=''){super(_0x1d0821);const _0xf91973=new _0x1cf3ac(),_0x50832d=this[_0x4dfc('0x2')];this['set'](_0x4dfc('0x3'),_0x5ceb46),_0xf91973[_0x4dfc('0x1')]=_0x4798e9,this[_0x4dfc('0x0')]({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0xf91973,{'text':_0x50832d['to'](_0x4dfc('0x3'))}]});}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4894=['width','locale','_createShowHistoryButton','resultsView','left','minRows','fieldView','queryView','value','focusCycler','uiLanguageDirection','add','excludeScrollbarsAndBorders','isEnabled','submitButtonView','ck-ai-form__toggle-history','style','bind','focus','right','_createSubmitButton','enter','execute','isVisible','focusLast','fire','window','showHistoryButtonView','submit','filteredView','set','history','render','keystrokes','focusableChildren','fieldWrapperChildren','update','rtl','isOn','element','focusFirst','ck-ai-form__submit'];(function(_0x551fda,_0x48948b){const _0x21646c=function(_0x47268c){while(--_0x47268c){_0x551fda['push'](_0x551fda['shift']());}};_0x21646c(++_0x48948b);}(_0x4894,0x1c9));const _0x2164=function(_0x551fda,_0x48948b){_0x551fda=_0x551fda-0x0;let _0x21646c=_0x4894[_0x551fda];return _0x21646c;};import{Rect as _0x3749bf,global as _0x455126,isVisible as _0x21dfb4}from'ckeditor5/src/utils';import{AutocompleteView as _0x1e9f0c,ButtonView as _0x2bbd04}from'ckeditor5/src/ui';import{icons as _0x5597ac}from'ckeditor5/src/core';import{escape as _0x4b24d0}from'lodash-es';import{getTranslation as _0x1b8e72}from'../../utils/common-translations';import _0x3884a5 from'../../../theme/icons/submit.svg';export default class tt extends _0x1e9f0c{constructor(_0x53cf65,_0x11f8b2){super(_0x53cf65,_0x11f8b2),this['queryView']['fieldView'][_0x2164('0xa')]=0x1,this['queryView']['fieldView']['maxRows']=0x3,this[_0x2164('0x13')]=this[_0x2164('0x19')](),this[_0x2164('0x20')]=this[_0x2164('0x7')](),this[_0x2164('0x27')][_0x2164('0x10')](this[_0x2164('0x20')],0x1),this[_0x2164('0x27')]['add'](this['submitButtonView']);}[_0x2164('0x25')](){super[_0x2164('0x25')](),this[_0x2164('0xc')][_0x2164('0x28')][_0x2164('0x10')](this['showHistoryButtonView']),this['children'][_0x2164('0x10')](this['submitButtonView']),this[_0x2164('0x26')][_0x2164('0x23')](_0x2164('0x1a'),(_0x492274,_0x256922)=>{_0x492274['target']==this[_0x2164('0xc')][_0x2164('0xb')][_0x2164('0x2')]&&(this[_0x2164('0x21')](),_0x256922());});}['_createSubmitButton'](){const _0x37df3f=new _0x2bbd04(this['locale']),_0x4e9f87=this[_0x2164('0x6')];return _0x37df3f[_0x2164('0x23')]({'icon':_0x3884a5,'label':_0x1b8e72(_0x4e9f87,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':_0x2164('0x4')}),_0x37df3f['on'](_0x2164('0x1b'),()=>{this[_0x2164('0x21')]();}),_0x37df3f[_0x2164('0x16')](_0x2164('0x12'))['to'](this[_0x2164('0xc')][_0x2164('0xb')],'isEmpty',this,_0x2164('0x12'),(_0xb3bb7c,_0x4b13e1)=>!_0xb3bb7c&&_0x4b13e1),_0x37df3f;}['_createShowHistoryButton'](){const _0x566d1f=new _0x2bbd04(this['locale']),_0x41b3fb=this[_0x2164('0x8')],_0xe11ff0=this['locale'];_0x566d1f[_0x2164('0x23')]({'label':_0x1b8e72(_0xe11ff0,'History'),'withText':!0x1,'icon':_0x5597ac[_0x2164('0x24')],'tooltip':!0x0,'tooltipPosition':'sw','class':_0x2164('0x14')}),_0x566d1f[_0x2164('0x16')](_0x2164('0x1'))['to'](_0x41b3fb,_0x2164('0x1c')),_0x566d1f[_0x2164('0x16')](_0x2164('0x12'))['to'](this,_0x2164('0x12')),_0x566d1f['on'](_0x2164('0x1b'),()=>{_0x41b3fb[_0x2164('0x1c')]=!_0x41b3fb[_0x2164('0x1c')],_0x41b3fb['isVisible']?this[_0x2164('0x22')][_0x2164('0x17')]():this['focus']();});const _0x1a4e11=()=>{_0x455126[_0x2164('0x1f')]['requestAnimationFrame'](()=>{if(_0x21dfb4(this[_0x2164('0x2')])){const _0x44dc56=new _0x3749bf(this['queryView']['fieldView'][_0x2164('0x2')]),_0x1d16aa=_0x44dc56[_0x2164('0x5')],_0x7dcde9=_0x2164('0x0')===_0xe11ff0[_0x2164('0xf')]?_0x2164('0x9'):_0x2164('0x18');_0x44dc56[_0x2164('0x11')](),_0x566d1f[_0x2164('0x2')][_0x2164('0x15')][_0x7dcde9]=_0x1d16aa-_0x44dc56[_0x2164('0x5')]+0x1+'px';}});};return this['queryView'][_0x2164('0xb')]['on'](_0x2164('0x29'),_0x1a4e11),this['on'](_0x2164('0x25'),_0x1a4e11),_0x566d1f;}['submit'](){const _0x5a30c2=this[_0x2164('0xc')][_0x2164('0xb')][_0x2164('0x2')][_0x2164('0xd')];this[_0x2164('0x1e')]('submit',_0x4b24d0(_0x5a30c2));}[_0x2164('0x17')](_0xcf91a8){-0x1===_0xcf91a8?this[_0x2164('0xe')][_0x2164('0x1d')]():this[_0x2164('0xe')][_0x2164('0x3')]();}}
23
+ const _0x3caf=['showHistoryButtonView','_createShowHistoryButton','History','left','execute','locale','minRows','ck-ai-form__submit','maxRows','focus','focusCycler','right','isEnabled','excludeScrollbarsAndBorders','children','set','isEmpty','target','focusableChildren','rtl','add','element','style','keystrokes','value','fieldWrapperChildren','update','submitButtonView','resultsView','filteredView','focusFirst','width','queryView','window','bind','fieldView','Submit','ck-ai-form__toggle-history','_createSubmitButton','render','enter','isVisible','submit'];(function(_0xca40dd,_0x3caf3d){const _0x4722d0=function(_0x24a6b0){while(--_0x24a6b0){_0xca40dd['push'](_0xca40dd['shift']());}};_0x4722d0(++_0x3caf3d);}(_0x3caf,0x99));const _0x4722=function(_0xca40dd,_0x3caf3d){_0xca40dd=_0xca40dd-0x0;let _0x4722d0=_0x3caf[_0xca40dd];return _0x4722d0;};import{Rect as _0x13a09b,global as _0x58e7ce,isVisible as _0xbaa3d2}from'ckeditor5/src/utils';import{AutocompleteView as _0x3216dc,ButtonView as _0x1a2c14}from'ckeditor5/src/ui';import{icons as _0x369b45}from'ckeditor5/src/core';import{getTranslation as _0x3e761c}from'../../utils/common-translations';import _0x2ef7f7 from'../../../theme/icons/submit.svg';export default class ht extends _0x3216dc{constructor(_0x1dc6d7,_0x478e21){super(_0x1dc6d7,_0x478e21),this[_0x4722('0x8')]['fieldView'][_0x4722('0x19')]=0x1,this[_0x4722('0x8')][_0x4722('0xb')][_0x4722('0x1b')]=0x3,this[_0x4722('0x3')]=this[_0x4722('0xe')](),this[_0x4722('0x13')]=this[_0x4722('0x14')](),this[_0x4722('0x25')][_0x4722('0x27')](this[_0x4722('0x13')],0x1),this[_0x4722('0x25')][_0x4722('0x27')](this[_0x4722('0x3')]);}[_0x4722('0xf')](){super[_0x4722('0xf')](),this[_0x4722('0x8')][_0x4722('0x1')][_0x4722('0x27')](this[_0x4722('0x13')]),this[_0x4722('0x21')][_0x4722('0x27')](this[_0x4722('0x3')]),this[_0x4722('0x2a')][_0x4722('0x22')](_0x4722('0x10'),(_0xe5512a,_0x760f74)=>{_0xe5512a[_0x4722('0x24')]==this['queryView'][_0x4722('0xb')][_0x4722('0x28')]&&(this[_0x4722('0x12')](),_0x760f74());});}[_0x4722('0xe')](){const _0x539210=new _0x1a2c14(this['locale']),_0x344b7a=this[_0x4722('0x18')];return _0x539210['set']({'icon':_0x2ef7f7,'label':_0x3e761c(_0x344b7a,_0x4722('0xc')),'isVisible':!0x0,'tooltip':!0x0,'class':_0x4722('0x1a')}),_0x539210['on']('execute',()=>{this[_0x4722('0x12')]();}),_0x539210['bind'](_0x4722('0x1f'))['to'](this[_0x4722('0x8')][_0x4722('0xb')],_0x4722('0x23'),this,_0x4722('0x1f'),(_0x31a693,_0x12321c)=>!_0x31a693&&_0x12321c),_0x539210;}['_createShowHistoryButton'](){const _0x8142d=new _0x1a2c14(this['locale']),_0x4bd683=this[_0x4722('0x4')],_0x187b63=this[_0x4722('0x18')];_0x8142d[_0x4722('0x22')]({'label':_0x3e761c(_0x187b63,_0x4722('0x15')),'withText':!0x1,'icon':_0x369b45['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':_0x4722('0xd')}),_0x8142d[_0x4722('0xa')]('isOn')['to'](_0x4bd683,_0x4722('0x11')),_0x8142d['bind']('isEnabled')['to'](this,_0x4722('0x1f')),_0x8142d['on'](_0x4722('0x17'),()=>{_0x4bd683[_0x4722('0x11')]=!_0x4bd683['isVisible'],_0x4bd683[_0x4722('0x11')]?this[_0x4722('0x5')][_0x4722('0x1c')]():this[_0x4722('0x1c')]();});const _0x13eb8b=()=>{_0x58e7ce[_0x4722('0x9')]['requestAnimationFrame'](()=>{if(_0xbaa3d2(this[_0x4722('0x28')])){const _0x5595d7=new _0x13a09b(this[_0x4722('0x8')][_0x4722('0xb')]['element']),_0xa75109=_0x5595d7[_0x4722('0x7')],_0x35b47c=_0x4722('0x26')===_0x187b63['uiLanguageDirection']?_0x4722('0x16'):_0x4722('0x1e');_0x5595d7[_0x4722('0x20')](),_0x8142d[_0x4722('0x28')][_0x4722('0x29')][_0x35b47c]=_0xa75109-_0x5595d7['width']+0x1+'px';}});};return this[_0x4722('0x8')][_0x4722('0xb')]['on'](_0x4722('0x2'),_0x13eb8b),this['on'](_0x4722('0xf'),_0x13eb8b),_0x8142d;}[_0x4722('0x12')](){const _0x383d0f=this[_0x4722('0x8')]['fieldView'][_0x4722('0x28')][_0x4722('0x0')];this['fire'](_0x4722('0x12'),_0x383d0f);}['focus'](_0x291896){-0x1===_0x291896?this[_0x4722('0x1d')]['focusLast']():this[_0x4722('0x1d')][_0x4722('0x6')]();}}
@@ -10,7 +10,7 @@ import { ToolbarView, ButtonView } from 'ckeditor5/src/ui';
10
10
  /**
11
11
  * The action name affecting the label of {@link ~AIFormToolbarView#replaceButton}.
12
12
  */
13
- export declare enum AIFormToolbarViewMainAction {
13
+ export declare enum AIFormToolbarViewMainActionLabel {
14
14
  REPLACE = "replace",
15
15
  INSERT = "insert"
16
16
  }
@@ -46,7 +46,7 @@ export default class AIFormToolbarView extends ToolbarView {
46
46
  *
47
47
  * @default 'replace'
48
48
  */
49
- mainAction: AIFormToolbarViewMainAction;
49
+ mainAction: AIFormToolbarViewMainActionLabel;
50
50
  /**
51
51
  * @inheritDoc
52
52
  */
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x48b8=['stopButton','insert','items','AI_','_createButton','Try\x20again','insertButton','tryAgainButton','locale','replaceButton','set','toUpperCase','isVisible','bindTemplate','ck-button-action','bind','Insert\x20below','REPLACE','mainAction','addMany','_CONTENT'];(function(_0x47e8d6,_0x48b88b){const _0x62d03=function(_0x5c84c0){while(--_0x5c84c0){_0x47e8d6['push'](_0x47e8d6['shift']());}};_0x62d03(++_0x48b88b);}(_0x48b8,0x192));const _0x62d0=function(_0x47e8d6,_0x48b88b){_0x47e8d6=_0x47e8d6-0x0;let _0x62d03=_0x48b8[_0x47e8d6];return _0x62d03;};import{ToolbarView as _0x52f42f,ButtonView as _0x34f683}from'ckeditor5/src/ui';import{getTranslation as _0x1db11e}from'../../utils/common-translations';export var AIFormToolbarViewMainAction;!function(_0x1dfb7d){_0x1dfb7d[_0x62d0('0xe')]='replace',_0x1dfb7d['INSERT']=_0x62d0('0x13');}(AIFormToolbarViewMainAction||(AIFormToolbarViewMainAction={}));export default class ti extends _0x52f42f{constructor(_0x194ad9){super(_0x194ad9),this[_0x62d0('0x7')](_0x62d0('0x9'),!0x1),this[_0x62d0('0x7')](_0x62d0('0xf'),AIFormToolbarViewMainAction[_0x62d0('0xe')]),this[_0x62d0('0x6')]=this[_0x62d0('0x1')]('',_0x62d0('0xb')),this['replaceButton'][_0x62d0('0xc')]('label')['to'](this,_0x62d0('0xf'),_0x683105=>_0x1db11e(_0x194ad9,_0x62d0('0x0')+_0x683105[_0x62d0('0x8')]()+_0x62d0('0x11'))),this[_0x62d0('0x3')]=this['_createButton'](_0x1db11e(_0x194ad9,_0x62d0('0xd'))),this[_0x62d0('0x4')]=this['_createButton'](_0x1db11e(_0x194ad9,_0x62d0('0x2'))),this[_0x62d0('0x12')]=this[_0x62d0('0x1')](_0x1db11e(_0x194ad9,'Stop'));const _0x5038a1=this[_0x62d0('0xa')];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x5038a1['if'](_0x62d0('0x9'),'ck-hidden',_0x5b0eca=>!_0x5b0eca)]}}),this[_0x62d0('0x14')][_0x62d0('0x10')]([this[_0x62d0('0x6')],this[_0x62d0('0x3')],this[_0x62d0('0x4')],this[_0x62d0('0x12')]]);}['_createButton'](_0x32fc28,_0x285a7b){const _0x2de9a0=new _0x34f683(this[_0x62d0('0x5')]);return _0x2de9a0['set']({'label':_0x32fc28,'class':_0x285a7b||'','isVisible':!0x0,'withText':!0x0}),_0x2de9a0;}}
23
+ const _0x48b2=['Stop','bindTemplate','stopButton','ck-button-action','insertButton','extendTemplate','ck-ai-form__toolbar','_CONTENT','bind','items','addMany','tryAgainButton','replaceButton','REPLACE','mainAction','Insert\x20below','toUpperCase','_createButton','set','INSERT','isVisible','insert'];(function(_0x2a1ae1,_0x48b261){const _0x2eada0=function(_0x49b414){while(--_0x49b414){_0x2a1ae1['push'](_0x2a1ae1['shift']());}};_0x2eada0(++_0x48b261);}(_0x48b2,0x115));const _0x2ead=function(_0x2a1ae1,_0x48b261){_0x2a1ae1=_0x2a1ae1-0x0;let _0x2eada0=_0x48b2[_0x2a1ae1];return _0x2eada0;};import{ToolbarView as _0xa1ba7,ButtonView as _0xb0b868}from'ckeditor5/src/ui';import{getTranslation as _0x4290d4}from'../../utils/common-translations';export var AIFormToolbarViewMainActionLabel;!function(_0x505ae7){_0x505ae7[_0x2ead('0x0')]='replace',_0x505ae7[_0x2ead('0x6')]=_0x2ead('0x8');}(AIFormToolbarViewMainActionLabel||(AIFormToolbarViewMainActionLabel={}));export default class ti extends _0xa1ba7{constructor(_0x2251e4){super(_0x2251e4),this[_0x2ead('0x5')]('isVisible',!0x1),this[_0x2ead('0x5')]('mainAction',AIFormToolbarViewMainActionLabel[_0x2ead('0x0')]),this[_0x2ead('0x15')]=this[_0x2ead('0x4')]('',_0x2ead('0xc')),this[_0x2ead('0x15')][_0x2ead('0x11')]('label')['to'](this,_0x2ead('0x1'),_0x4ae650=>_0x4290d4(_0x2251e4,'AI_'+_0x4ae650[_0x2ead('0x3')]()+_0x2ead('0x10'))),this[_0x2ead('0xd')]=this['_createButton'](_0x4290d4(_0x2251e4,_0x2ead('0x2'))),this[_0x2ead('0x14')]=this[_0x2ead('0x4')](_0x4290d4(_0x2251e4,'Try\x20again')),this[_0x2ead('0xb')]=this[_0x2ead('0x4')](_0x4290d4(_0x2251e4,_0x2ead('0x9')));const _0x4d8159=this[_0x2ead('0xa')];this[_0x2ead('0xe')]({'attributes':{'class':[_0x2ead('0xf'),_0x4d8159['if'](_0x2ead('0x7'),'ck-hidden',_0x3b1991=>!_0x3b1991)]}}),this[_0x2ead('0x12')][_0x2ead('0x13')]([this[_0x2ead('0x15')],this['insertButton'],this[_0x2ead('0x14')],this['stopButton']]);}[_0x2ead('0x4')](_0x1422c8,_0x5a39de){const _0x526411=new _0xb0b868(this['locale']);return _0x526411[_0x2ead('0x5')]({'label':_0x1422c8,'class':_0x5a39de||'','isVisible':!0x0,'withText':!0x0}),_0x526411;}}
@@ -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, { AIFormToolbarViewMainAction } from './aiformtoolbarview';
10
+ import AIFormToolbarView, { AIFormToolbarViewMainActionLabel } from './aiformtoolbarview';
11
11
  import AIFormContentArea from './aiformcontentarea';
12
12
  import AIFormErrorView from './aiformerrorview';
13
13
  import AIFormPromptView from './aiformpromptview';
@@ -78,7 +78,7 @@ export default class AIFormView extends View {
78
78
  *
79
79
  * @default 'replace'
80
80
  */
81
- mainAction: AIFormToolbarViewMainAction;
81
+ mainAction: AIFormToolbarViewMainActionLabel;
82
82
  /**
83
83
  * Creates an instance of the {@link module:ai/ui/aiformview~AIFormView} class.
84
84
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0xa281=['replaceButton','copyButtonView','focus','execute','div','locale','isEnabled','prompt','isProcessing','backwardCycle','trim','tryAgainEvent','clear','forwardCycle','Ask\x20AI\x20to\x20improve\x20generated\x20text','_focusCycler','createCollection','tryAgainButton','shift\x20+\x20tab','submitPrompt','header','clearHistory','tab','AI_ERROR_FAILED','focusFirst','isVisible','mainAction','isError','focusCycler','items','_promptHistory','keystrokes','_createToolbar','reset','stopButton','toolbar','focusPrevious','fieldView','insertButton','_focusables','errorView','label','promptView','bindTemplate','handleError','_createHistoryView','listenTo','search','high','focusTracker','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.','stop','value','element','add','delegate','bindTo','bind','insertContentBelow','contentArea','set','finishProcessing','setTemplate','Ask\x20AI\x20to\x20edit\x20or\x20generate','AI\x20Assistant','queryView','render'];(function(_0x450a90,_0xa28152){const _0x50fe49=function(_0x3c64e5){while(--_0x3c64e5){_0x450a90['push'](_0x450a90['shift']());}};_0x50fe49(++_0xa28152);}(_0xa281,0x186));const _0x50fe=function(_0x450a90,_0xa28152){_0x450a90=_0x450a90-0x0;let _0x50fe49=_0xa281[_0x450a90];return _0x50fe49;};import{FocusTracker as _0x24a234,KeystrokeHandler as _0x58ee63}from'ckeditor5/src/utils';import{View as _0x4886d6,FocusCycler as _0x35aec3,createLabeledTextarea as _0x25b4b0,FormHeaderView as _0x419d54}from'ckeditor5/src/ui';import _0x10fe6c,{AIFormToolbarViewMainAction as _0x2dcd77}from'./aiformtoolbarview';import _0x181bb8 from'./aiformcontentarea';import _0x1de56c from'./aiformerrorview';import _0x1a8634 from'./aiformpromptview';import _0x194eed from'./aihistorylistview';import _0x36ed0f from'./aihistorylistitemview';import _0x216e55 from'./prompthistory';import{getTranslation as _0x5205d6}from'../../utils/common-translations';import _0x52871c from'../../../theme/icons/robot-pencil.svg';export default class v extends _0x4886d6{constructor(_0x16ef1b,_0xfae830,_0x38736b=''){super(_0x16ef1b),this[_0x50fe('0x5')](_0x50fe('0x12'),!0x0),this[_0x50fe('0x5')](_0x50fe('0x14'),!0x1),this[_0x50fe('0x5')](_0x50fe('0x13'),''),this[_0x50fe('0x5')]('value',''),this[_0x50fe('0x5')]('isError',!0x1),this[_0x50fe('0x5')](_0x50fe('0x26'),_0x2dcd77['REPLACE']),this[_0x50fe('0x2a')]=new _0x216e55(),this[_0x50fe('0x34')]=new _0x1de56c(_0x16ef1b),this['header']=new _0x419d54(_0x16ef1b,{'label':_0x5205d6(_0x16ef1b,_0x50fe('0x9')),'icon':_0x52871c}),this['contentArea']=new _0x181bb8(_0x16ef1b,_0x38736b),this[_0x50fe('0x4')][_0x50fe('0x2')](_0x50fe('0x14'))['to'](this),this[_0x50fe('0x4')]['bind'](_0x50fe('0x40'))['to'](this),this[_0x50fe('0x2f')]=this['_createToolbar'](),this[_0x50fe('0x2f')][_0x50fe('0x2')](_0x50fe('0x26'))['to'](this),this[_0x50fe('0x36')]=this['_createPromptView'](),this[_0x50fe('0x3d')]=new _0x24a234(),this['keystrokes']=new _0x58ee63(),this[_0x50fe('0x33')]=this[_0x50fe('0x1c')]([this[_0x50fe('0x4')],this[_0x50fe('0x4')][_0x50fe('0xd')],this[_0x50fe('0x2f')],this[_0x50fe('0x36')]]),this[_0x50fe('0x1b')]=new _0x35aec3({'focusables':this[_0x50fe('0x33')],'focusTracker':this[_0x50fe('0x3d')],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':_0x50fe('0x1e'),'focusNext':_0x50fe('0x22')}}),this[_0x50fe('0x36')][_0x50fe('0x28')]['on'](_0x50fe('0x19'),_0x10cc63=>{this[_0x50fe('0x1b')]['focusNext'](),_0x10cc63[_0x50fe('0x3f')]();}),this[_0x50fe('0x36')][_0x50fe('0x28')]['on'](_0x50fe('0x15'),_0x1301b4=>{this['_focusCycler'][_0x50fe('0x30')](),_0x1301b4[_0x50fe('0x3f')]();}),this[_0x50fe('0x36')]['queryView'][_0x50fe('0x31')][_0x50fe('0x2')]('value')['to'](this,_0x50fe('0x13'));const _0x1cbedf=this[_0x50fe('0x37')];this[_0x50fe('0x7')]({'tag':_0x50fe('0x10'),'attributes':{'class':['ck','ck-ai-form',_0xfae830],'tabindex':'-1'},'children':[this[_0x50fe('0x20')],{'tag':_0x50fe('0x10'),'attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':_0x50fe('0x10'),'attributes':{'class':[_0x1cbedf['if']('isError','ck-hidden',_0x292036=>!_0x292036)]},'children':[this[_0x50fe('0x34')]]},this[_0x50fe('0x4')],this[_0x50fe('0x2f')],this[_0x50fe('0x36')]]}]});}[_0x50fe('0xb')](){super[_0x50fe('0xb')](),this[_0x50fe('0x3d')][_0x50fe('0x42')](this['contentArea'][_0x50fe('0x41')]),this[_0x50fe('0x3d')][_0x50fe('0x42')](this['contentArea']['copyButtonView'][_0x50fe('0x41')]),this[_0x50fe('0x3d')][_0x50fe('0x42')](this[_0x50fe('0x2f')]['element']),this[_0x50fe('0x3d')][_0x50fe('0x42')](this[_0x50fe('0x36')][_0x50fe('0x41')]),this[_0x50fe('0x2b')][_0x50fe('0x3a')](this[_0x50fe('0x41')]);}['focus'](){this[_0x50fe('0x1b')][_0x50fe('0x24')]();}[_0x50fe('0x2d')](){this[_0x50fe('0x13')]='',this[_0x50fe('0x40')]='',this[_0x50fe('0x36')][_0x50fe('0x2d')](),this[_0x50fe('0x4')][_0x50fe('0x25')]=!0x1,this[_0x50fe('0x2f')][_0x50fe('0x25')]=!0x1;}['_createPromptView'](){const _0x2ebf7e=this[_0x50fe('0x11')],_0x5bfc56=new _0x1a8634(_0x2ebf7e,{'queryView':{'label':_0x5205d6(_0x2ebf7e,_0x50fe('0x8')),'creator':_0x25b4b0,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_0x5205d6(_0x2ebf7e,'Empty\x20history'),'secondary':_0x5205d6(_0x2ebf7e,_0x50fe('0x3e'))}}},'filteredView':this[_0x50fe('0x39')](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5bfc56['bind'](_0x50fe('0x12'))['to'](this,'isEnabled',this,'isProcessing',(_0x186aba,_0x2ca2c3)=>_0x186aba&&!_0x2ca2c3),this[_0x50fe('0x3a')](_0x5bfc56,'submit',(_0x15b251,_0x59841a)=>{this[_0x50fe('0x13')]=_0x59841a,this['fire'](_0x50fe('0x1f'),this[_0x50fe('0x13')]),_0x59841a[_0x50fe('0x16')]()&&this[_0x50fe('0x2a')][_0x50fe('0x42')]({'prompt':_0x59841a[_0x50fe('0x16')]()},0x0);},{'priority':_0x50fe('0x3c')}),_0x5bfc56;}['_createHistoryView'](){const _0x1c055f=new _0x194eed(this[_0x50fe('0x11')]);return _0x1c055f['historyGroupView'][_0x50fe('0x29')][_0x50fe('0x1')](this[_0x50fe('0x2a')])['as'](_0x36ed0f),_0x1c055f['on'](_0x50fe('0x21'),()=>{this['_promptHistory'][_0x50fe('0x18')](),this[_0x50fe('0x36')][_0x50fe('0x3b')](''),this[_0x50fe('0x36')][_0x50fe('0xe')]();}),_0x1c055f;}[_0x50fe('0x2c')](){const _0x421df2=new _0x10fe6c(this[_0x50fe('0x11')]);return _0x421df2[_0x50fe('0xc')]['bind'](_0x50fe('0x12'))['to'](this,_0x50fe('0x12'),this,_0x50fe('0x14'),this,'value',(_0x5a503e,_0x268654,_0x45ed25)=>_0x5a503e&&!_0x268654&&!!_0x45ed25),_0x421df2[_0x50fe('0xc')][_0x50fe('0x0')](_0x50fe('0xf'))['to'](this,'replaceContent'),_0x421df2[_0x50fe('0x32')]['bind']('isEnabled')['to'](this,'isEnabled',this,_0x50fe('0x14'),this,_0x50fe('0x40'),(_0x347cb0,_0x15cdb1,_0x429280)=>_0x347cb0&&!_0x15cdb1&&!!_0x429280),_0x421df2[_0x50fe('0x32')]['delegate']('execute')['to'](this,_0x50fe('0x3')),_0x421df2[_0x50fe('0x1d')][_0x50fe('0x2')](_0x50fe('0x12'))['to'](this,_0x50fe('0x12'),this,_0x50fe('0x14'),(_0x13e098,_0x1a18d7)=>_0x13e098&&!_0x1a18d7),_0x421df2[_0x50fe('0x1d')][_0x50fe('0x0')](_0x50fe('0xf'))['to'](this,_0x50fe('0x17')),_0x421df2['stopButton'][_0x50fe('0x2')](_0x50fe('0x12'))['to'](this,_0x50fe('0x14')),_0x421df2[_0x50fe('0x2e')][_0x50fe('0x0')](_0x50fe('0xf'))['to'](this,'stopProcessing'),_0x421df2;}['startProcessing'](){this[_0x50fe('0x40')]='',this[_0x50fe('0x27')]=!0x1,this['isProcessing']=!0x0,this[_0x50fe('0x4')]['isVisible']=!0x0,this['toolbar'][_0x50fe('0x25')]=!0x0,this[_0x50fe('0x4')][_0x50fe('0xe')]();}[_0x50fe('0x6')](){const _0x35cda0=this[_0x50fe('0x11')];this[_0x50fe('0x14')]=!0x1,this[_0x50fe('0x13')]='',this[_0x50fe('0x36')]['reset'](),this[_0x50fe('0x40')]&&(this[_0x50fe('0x36')][_0x50fe('0xa')][_0x50fe('0x35')]=_0x5205d6(_0x35cda0,_0x50fe('0x1a')));}[_0x50fe('0x38')](_0x21537b){const _0x4272a0=this['locale'];this[_0x50fe('0x6')](),this['isError']=!0x0,this[_0x50fe('0x34')]['text']=_0x21537b||_0x5205d6(_0x4272a0,_0x50fe('0x23')),this[_0x50fe('0x40')]||(this[_0x50fe('0x4')][_0x50fe('0x25')]=!0x1);}}
23
+ const _0x1432=['backwardCycle','clear','_focusCycler','tryAgainButton','focus','_promptHistory','focusCycler','ck-ai-form-content','submit','stopProcessing','reset','listenTo','isProcessing','replaceContent','focusFirst','value','createCollection','execute','copyButtonView','finishProcessing','replaceButton','clearHistory','Ask\x20AI\x20to\x20edit\x20or\x20generate','focusPrevious','fire','stop','tryAgainEvent','tab','promptView','div','ck-ai-form','search','focusTracker','submitPrompt','REPLACE','toolbar','errorView','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.','mainAction','bindTo','ck-hidden','keystrokes','text','isEnabled','Empty\x20history','insertButton','locale','contentArea','element','handleError','queryView','_createPromptView','historyGroupView','setTemplate','render','_createToolbar','items','isError','header','add','_focusables','shift\x20+\x20tab','isVisible','set','trim','delegate','bind','startProcessing','stopButton','prompt','label'];(function(_0x35f6bf,_0x14322a){const _0x2e8e51=function(_0x19751b){while(--_0x19751b){_0x35f6bf['push'](_0x35f6bf['shift']());}};_0x2e8e51(++_0x14322a);}(_0x1432,0x146));const _0x2e8e=function(_0x35f6bf,_0x14322a){_0x35f6bf=_0x35f6bf-0x0;let _0x2e8e51=_0x1432[_0x35f6bf];return _0x2e8e51;};import{FocusTracker as _0x38f336,KeystrokeHandler as _0x57545c}from'ckeditor5/src/utils';import{View as _0x20c254,FocusCycler as _0x16f9b8,createLabeledTextarea as _0x46d577,FormHeaderView as _0x5f1b03}from'ckeditor5/src/ui';import _0x43b247,{AIFormToolbarViewMainActionLabel as _0x50a861}from'./aiformtoolbarview';import _0x2ca7d4 from'./aiformcontentarea';import _0x9afdb8 from'./aiformerrorview';import _0x3dc9a4 from'./aiformpromptview';import _0x28264f from'./aihistorylistview';import _0x467837 from'./aihistorylistitemview';import _0x5559e9 from'./prompthistory';import{getTranslation as _0x5b3276}from'../../utils/common-translations';import{escape as _0x4b01a5}from'lodash-es';import _0x417305 from'../../../theme/icons/robot-pencil.svg';export default class v extends _0x20c254{constructor(_0x13c276,_0x449b60,_0x43b598=''){super(_0x13c276),this[_0x2e8e('0x15')](_0x2e8e('0x1'),!0x0),this[_0x2e8e('0x15')]('isProcessing',!0x1),this[_0x2e8e('0x15')]('prompt',''),this['set']('value',''),this[_0x2e8e('0x15')](_0x2e8e('0xf'),!0x1),this['set'](_0x2e8e('0x43'),_0x50a861[_0x2e8e('0x3f')]),this['_promptHistory']=new _0x5559e9(),this[_0x2e8e('0x41')]=new _0x9afdb8(_0x13c276),this['header']=new _0x5f1b03(_0x13c276,{'label':_0x5b3276(_0x13c276,'AI\x20Assistant'),'icon':_0x417305}),this[_0x2e8e('0x5')]=new _0x2ca7d4(_0x13c276,_0x43b598),this[_0x2e8e('0x5')][_0x2e8e('0x18')](_0x2e8e('0x29'))['to'](this),this[_0x2e8e('0x5')][_0x2e8e('0x18')](_0x2e8e('0x2c'))['to'](this),this[_0x2e8e('0x40')]=this[_0x2e8e('0xd')](),this['toolbar'][_0x2e8e('0x18')](_0x2e8e('0x43'))['to'](this),this['promptView']=this[_0x2e8e('0x9')](),this[_0x2e8e('0x3d')]=new _0x38f336(),this[_0x2e8e('0x46')]=new _0x57545c(),this[_0x2e8e('0x12')]=this[_0x2e8e('0x2d')]([this[_0x2e8e('0x5')],this[_0x2e8e('0x5')][_0x2e8e('0x2f')],this['toolbar'],this[_0x2e8e('0x39')]]),this[_0x2e8e('0x1f')]=new _0x16f9b8({'focusables':this['_focusables'],'focusTracker':this[_0x2e8e('0x3d')],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':_0x2e8e('0x13'),'focusNext':_0x2e8e('0x38')}}),this['promptView']['focusCycler']['on']('forwardCycle',_0x52c668=>{this[_0x2e8e('0x1f')]['focusNext'](),_0x52c668['stop']();}),this[_0x2e8e('0x39')][_0x2e8e('0x23')]['on'](_0x2e8e('0x1d'),_0x103cef=>{this['_focusCycler'][_0x2e8e('0x34')](),_0x103cef[_0x2e8e('0x36')]();}),this[_0x2e8e('0x39')][_0x2e8e('0x8')]['fieldView'][_0x2e8e('0x18')](_0x2e8e('0x2c'))['to'](this,_0x2e8e('0x1b'));const _0x550057=this['bindTemplate'];this[_0x2e8e('0xb')]({'tag':_0x2e8e('0x3a'),'attributes':{'class':['ck',_0x2e8e('0x3b'),_0x449b60],'tabindex':'-1'},'children':[this[_0x2e8e('0x10')],{'tag':'div','attributes':{'class':['ck',_0x2e8e('0x24')]},'children':[{'tag':_0x2e8e('0x3a'),'attributes':{'class':[_0x550057['if']('isError',_0x2e8e('0x45'),_0x5d42c1=>!_0x5d42c1)]},'children':[this[_0x2e8e('0x41')]]},this[_0x2e8e('0x5')],this[_0x2e8e('0x40')],this[_0x2e8e('0x39')]]}]});}[_0x2e8e('0xc')](){super[_0x2e8e('0xc')](),this[_0x2e8e('0x3d')][_0x2e8e('0x11')](this['contentArea'][_0x2e8e('0x6')]),this[_0x2e8e('0x3d')][_0x2e8e('0x11')](this[_0x2e8e('0x5')][_0x2e8e('0x2f')]['element']),this[_0x2e8e('0x3d')][_0x2e8e('0x11')](this[_0x2e8e('0x40')]['element']),this[_0x2e8e('0x3d')][_0x2e8e('0x11')](this[_0x2e8e('0x39')]['element']),this['keystrokes']['listenTo'](this[_0x2e8e('0x6')]);}[_0x2e8e('0x21')](){this[_0x2e8e('0x1f')][_0x2e8e('0x2b')]();}[_0x2e8e('0x27')](){this['prompt']='',this['value']='',this[_0x2e8e('0xf')]=!0x1,this[_0x2e8e('0x39')]['reset'](),this['contentArea'][_0x2e8e('0x14')]=!0x1,this[_0x2e8e('0x40')][_0x2e8e('0x14')]=!0x1;}[_0x2e8e('0x9')](){const _0x29fdd4=this[_0x2e8e('0x4')],_0x1bbd3c=new _0x3dc9a4(_0x29fdd4,{'queryView':{'label':_0x5b3276(_0x29fdd4,_0x2e8e('0x33')),'creator':_0x46d577,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_0x5b3276(_0x29fdd4,_0x2e8e('0x2')),'secondary':_0x5b3276(_0x29fdd4,_0x2e8e('0x42'))}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x1bbd3c['bind']('isEnabled')['to'](this,_0x2e8e('0x1'),this,_0x2e8e('0x29'),(_0x5a1579,_0x43d480)=>_0x5a1579&&!_0x43d480),this[_0x2e8e('0x28')](_0x1bbd3c,_0x2e8e('0x25'),(_0x47a9e8,_0x30f37f)=>{this[_0x2e8e('0x1b')]=_0x30f37f;const _0x5994e3=_0x4b01a5(_0x30f37f);this[_0x2e8e('0x35')](_0x2e8e('0x3e'),_0x5994e3),_0x30f37f[_0x2e8e('0x16')]()&&this[_0x2e8e('0x22')][_0x2e8e('0x11')]({'prompt':_0x5994e3},0x0);},{'priority':'high'}),_0x1bbd3c;}['_createHistoryView'](){const _0x4e553a=new _0x28264f(this[_0x2e8e('0x4')]);return _0x4e553a[_0x2e8e('0xa')][_0x2e8e('0xe')][_0x2e8e('0x44')](this[_0x2e8e('0x22')])['as'](_0x467837),_0x4e553a['on'](_0x2e8e('0x32'),()=>{this[_0x2e8e('0x22')][_0x2e8e('0x1e')](),this['promptView'][_0x2e8e('0x3c')](''),this['promptView'][_0x2e8e('0x21')]();}),_0x4e553a;}[_0x2e8e('0xd')](){const _0x2aacde=new _0x43b247(this[_0x2e8e('0x4')]);return _0x2aacde['replaceButton'][_0x2e8e('0x18')](_0x2e8e('0x1'))['to'](this,_0x2e8e('0x1'),this,_0x2e8e('0x29'),this,_0x2e8e('0x2c'),(_0x9c7b20,_0x548fd2,_0x2b93bd)=>_0x9c7b20&&!_0x548fd2&&!!_0x2b93bd),_0x2aacde[_0x2e8e('0x31')][_0x2e8e('0x17')](_0x2e8e('0x2e'))['to'](this,_0x2e8e('0x2a')),_0x2aacde['insertButton'][_0x2e8e('0x18')]('isEnabled')['to'](this,'isEnabled',this,_0x2e8e('0x29'),this,'value',(_0x5e0aec,_0x568c11,_0x553bac)=>_0x5e0aec&&!_0x568c11&&!!_0x553bac),_0x2aacde[_0x2e8e('0x3')][_0x2e8e('0x17')](_0x2e8e('0x2e'))['to'](this,'insertContentBelow'),_0x2aacde[_0x2e8e('0x20')][_0x2e8e('0x18')](_0x2e8e('0x1'))['to'](this,'isEnabled',this,_0x2e8e('0x29'),(_0x473b09,_0x59663f)=>_0x473b09&&!_0x59663f),_0x2aacde[_0x2e8e('0x20')][_0x2e8e('0x17')]('execute')['to'](this,_0x2e8e('0x37')),_0x2aacde[_0x2e8e('0x1a')]['bind'](_0x2e8e('0x1'))['to'](this,_0x2e8e('0x29')),_0x2aacde['stopButton'][_0x2e8e('0x17')]('execute')['to'](this,_0x2e8e('0x26')),_0x2aacde;}[_0x2e8e('0x19')](){this[_0x2e8e('0x2c')]='',this[_0x2e8e('0xf')]=!0x1,this[_0x2e8e('0x29')]=!0x0,this['contentArea'][_0x2e8e('0x14')]=!0x0,this[_0x2e8e('0x40')][_0x2e8e('0x14')]=!0x0,this[_0x2e8e('0x5')][_0x2e8e('0x21')]();}[_0x2e8e('0x30')](){const _0x3e2a89=this['locale'];this[_0x2e8e('0x29')]=!0x1,this[_0x2e8e('0x1b')]='',this[_0x2e8e('0x39')][_0x2e8e('0x27')](),this[_0x2e8e('0x2c')]&&(this[_0x2e8e('0x39')][_0x2e8e('0x8')][_0x2e8e('0x1c')]=_0x5b3276(_0x3e2a89,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}[_0x2e8e('0x7')](_0xe23341){const _0x124401=this[_0x2e8e('0x4')];this[_0x2e8e('0x30')](),this['isError']=!0x0,this[_0x2e8e('0x41')][_0x2e8e('0x0')]=_0xe23341||_0x5b3276(_0x124401,'AI_ERROR_FAILED'),this[_0x2e8e('0x2c')]||(this[_0x2e8e('0x5')][_0x2e8e('0x14')]=!0x1);}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x5889=['prompt','add','fire','execute'];(function(_0x24ebea,_0x5889f4){const _0x31fa98=function(_0x3b64dc){while(--_0x3b64dc){_0x24ebea['push'](_0x24ebea['shift']());}};_0x31fa98(++_0x5889f4);}(_0x5889,0xff));const _0x31fa=function(_0x24ebea,_0x5889f4){_0x24ebea=_0x24ebea-0x0;let _0x31fa98=_0x5889[_0x24ebea];return _0x31fa98;};import{ListItemView as _0x1a0eb7,ButtonView as _0x107702}from'ckeditor5/src/ui';import _0x2a6888 from'../dropdown/buttonlabelwithhighlightview';import{unescape as _0x47b238}from'lodash-es';export default class nt extends _0x1a0eb7{constructor(_0x1131a3){super();const _0x5d2606=new _0x2a6888(),_0x2a8095=new _0x107702(this['locale'],_0x5d2606);this['children'][_0x31fa('0x2')](_0x2a8095),_0x2a8095['set']({'label':_0x1131a3[_0x31fa('0x1')],'withText':!0x0}),_0x2a8095['on'](_0x31fa('0x0'),()=>{this[_0x31fa('0x3')](_0x31fa('0x0'),{'value':_0x47b238(_0x1131a3[_0x31fa('0x1')])});});}}
23
+ const _0x35dc=['fire','locale','execute','children','prompt','add','set'];(function(_0x546f54,_0x35dc86){const _0x2f68e5=function(_0x13289d){while(--_0x13289d){_0x546f54['push'](_0x546f54['shift']());}};_0x2f68e5(++_0x35dc86);}(_0x35dc,0x7a));const _0x2f68=function(_0x546f54,_0x35dc86){_0x546f54=_0x546f54-0x0;let _0x2f68e5=_0x35dc[_0x546f54];return _0x2f68e5;};import{ListItemView as _0x56287e,ButtonView as _0x4fe861}from'ckeditor5/src/ui';import _0x5e63be from'../dropdown/buttonlabelwithhighlightview';import{unescape as _0x572a25}from'lodash-es';export default class pt extends _0x56287e{constructor(_0x429b4c){super();const _0x54e236=new _0x5e63be(),_0x524a0f=new _0x4fe861(this[_0x2f68('0x5')],_0x54e236);this[_0x2f68('0x0')][_0x2f68('0x2')](_0x524a0f),_0x524a0f[_0x2f68('0x3')]({'label':_0x429b4c[_0x2f68('0x1')],'withText':!0x0}),_0x524a0f['on'](_0x2f68('0x6'),()=>{this[_0x2f68('0x4')](_0x2f68('0x6'),{'value':_0x572a25(_0x429b4c[_0x2f68('0x1')])});});}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x433a=['Prompt\x20history','historyGroupView','delegate','clearHistoryButton','_createClearHistoryButton','length','filter','add','clearHistory','set','fire','locale','label','children','execute','items'];(function(_0x309933,_0x433a77){const _0x1114b9=function(_0x4687b4){while(--_0x4687b4){_0x309933['push'](_0x309933['shift']());}};_0x1114b9(++_0x433a77);}(_0x433a,0x130));const _0x1114=function(_0x309933,_0x433a77){_0x309933=_0x309933-0x0;let _0x1114b9=_0x433a[_0x309933];return _0x1114b9;};import{ListView as _0x39c127,ListItemGroupView as _0x355b6d,ButtonView as _0x3b2b3a}from'ckeditor5/src/ui';import{getTranslation as _0x2e3f47}from'../../utils/common-translations';export default class ot extends _0x39c127{constructor(_0x58fe50){super(_0x58fe50),this[_0x1114('0x3')]=this[_0x1114('0x4')](),this['historyGroupView']=new _0x355b6d(),this[_0x1114('0x1')][_0x1114('0xd')][_0x1114('0x7')](this[_0x1114('0x3')],0x1),this[_0x1114('0x1')][_0x1114('0xc')]=_0x2e3f47(_0x58fe50,_0x1114('0x0')),this['historyGroupView']['items'][_0x1114('0x2')](_0x1114('0xe'))['to'](this),this[_0x1114('0xf')][_0x1114('0x7')](this[_0x1114('0x1')]);}[_0x1114('0x6')](){let _0x222365=0x0;for(const _0x2102c2 of this[_0x1114('0xf')])_0x222365+=_0x2102c2[_0x1114('0xf')][_0x1114('0x5')];return{'resultsCount':_0x222365,'totalItemsCount':_0x222365};}[_0x1114('0x4')](){const _0x501d4a=this['locale'],_0x4c28d4=new _0x3b2b3a(this[_0x1114('0xb')]);return _0x4c28d4[_0x1114('0x9')]({'label':'('+_0x2e3f47(_0x501d4a,'Clear')+')','withText':!0x0}),_0x4c28d4['on']('execute',()=>this[_0x1114('0xa')](_0x1114('0x8'))),_0x4c28d4;}}
23
+ const _0x4f95=['locale','add','children','historyGroupView','execute','clearHistory','fire','items','_createClearHistoryButton','delegate','clearHistoryButton','Prompt\x20history','Clear'];(function(_0x23faf1,_0x4f952f){const _0x3ce790=function(_0x465884){while(--_0x465884){_0x23faf1['push'](_0x23faf1['shift']());}};_0x3ce790(++_0x4f952f);}(_0x4f95,0xfb));const _0x3ce7=function(_0x23faf1,_0x4f952f){_0x23faf1=_0x23faf1-0x0;let _0x3ce790=_0x4f95[_0x23faf1];return _0x3ce790;};import{ListView as _0x3276da,ListItemGroupView as _0x303995,ButtonView as _0x3e2e1d}from'ckeditor5/src/ui';import{getTranslation as _0x2aaab3}from'../../utils/common-translations';export default class ut extends _0x3276da{constructor(_0x548d1d){super(_0x548d1d),this[_0x3ce7('0x6')]=this[_0x3ce7('0x4')](),this['historyGroupView']=new _0x303995(),this[_0x3ce7('0xc')][_0x3ce7('0xb')][_0x3ce7('0xa')](this[_0x3ce7('0x6')],0x1),this[_0x3ce7('0xc')]['label']=_0x2aaab3(_0x548d1d,_0x3ce7('0x7')),this[_0x3ce7('0xc')][_0x3ce7('0x3')][_0x3ce7('0x5')](_0x3ce7('0x0'))['to'](this),this['items']['add'](this[_0x3ce7('0xc')]);}['filter'](){let _0x4a59f1=0x0;for(const _0x85ff85 of this[_0x3ce7('0x3')])_0x4a59f1+=_0x85ff85[_0x3ce7('0x3')]['length'];return{'resultsCount':_0x4a59f1,'totalItemsCount':_0x4a59f1};}[_0x3ce7('0x4')](){const _0xa17eaf=this['locale'],_0x1204b5=new _0x3e2e1d(this[_0x3ce7('0x9')]);return _0x1204b5['set']({'label':'('+_0x2aaab3(_0xa17eaf,_0x3ce7('0x8'))+')','withText':!0x0}),_0x1204b5['on']('execute',()=>this[_0x3ce7('0x2')](_0x3ce7('0x1'))),_0x1204b5;}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x1087=['length','map','addMany','last','stringify','setItem','getItem','CKEditor/AIFormView/PromptHistory','add','_saveToSessionStorage','parse','_loadFromSessionStorage','trim','remove','toLowerCase','prompt'];(function(_0x4a0ac9,_0x108718){const _0x359b4f=function(_0x12d1a4){while(--_0x12d1a4){_0x4a0ac9['push'](_0x4a0ac9['shift']());}};_0x359b4f(++_0x108718);}(_0x1087,0x19b));const _0x359b=function(_0x4a0ac9,_0x108718){_0x4a0ac9=_0x4a0ac9-0x0;let _0x359b4f=_0x1087[_0x4a0ac9];return _0x359b4f;};import{Collection as _0x1aa872}from'ckeditor5/src/utils';const ts=_0x359b('0xc');export default class at extends _0x1aa872{constructor(){super(),this[_0x359b('0x0')](),this['on'](_0x359b('0xd'),(_0x5d4b5e,_0x4de006)=>{const _0x223fa9=os(_0x4de006['prompt']);for(const _0xf48b6d of this)if(_0xf48b6d!=_0x4de006&&os(_0xf48b6d[_0x359b('0x4')])===_0x223fa9){this[_0x359b('0x2')](_0xf48b6d);break;}this[_0x359b('0x5')]>0x14&&this[_0x359b('0x2')](this[_0x359b('0x8')]),this[_0x359b('0xe')]();}),this['on'](_0x359b('0x2'),()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2b47b4=sessionStorage[_0x359b('0xb')](ts)||'[]';this[_0x359b('0x7')](JSON[_0x359b('0xf')](_0x2b47b4));}[_0x359b('0xe')](){sessionStorage[_0x359b('0xa')](ts,JSON[_0x359b('0x9')](this[_0x359b('0x6')](_0x4d35f6=>_0x4d35f6)));}}function os(_0x10acf3){return _0x10acf3[_0x359b('0x3')]()[_0x359b('0x1')]();}
23
+ const _0x249f=['_loadFromSessionStorage','add','map','last','remove','_saveToSessionStorage','toLowerCase','stringify','CKEditor/AIFormView/PromptHistory','length','addMany','trim','setItem','getItem','prompt'];(function(_0x25c4c3,_0x249fb7){const _0x516582=function(_0x9431f3){while(--_0x9431f3){_0x25c4c3['push'](_0x25c4c3['shift']());}};_0x516582(++_0x249fb7);}(_0x249f,0x102));const _0x5165=function(_0x25c4c3,_0x249fb7){_0x25c4c3=_0x25c4c3-0x0;let _0x516582=_0x249f[_0x25c4c3];return _0x516582;};import{Collection as _0x396808}from'ckeditor5/src/utils';const ts=_0x5165('0x5');export default class dt extends _0x396808{constructor(){super(),this[_0x5165('0xc')](),this['on'](_0x5165('0xd'),(_0x809c23,_0x2ab92e)=>{const _0x467a55=os(_0x2ab92e[_0x5165('0xb')]);for(const _0x26f08a of this)if(_0x26f08a!=_0x2ab92e&&os(_0x26f08a[_0x5165('0xb')])===_0x467a55){this['remove'](_0x26f08a);break;}this[_0x5165('0x6')]>0x14&&this['remove'](this[_0x5165('0x0')]),this[_0x5165('0x2')]();}),this['on'](_0x5165('0x1'),()=>{this[_0x5165('0x2')]();});}['_loadFromSessionStorage'](){const _0x3bbdee=sessionStorage[_0x5165('0xa')](ts)||'[]';this[_0x5165('0x7')](JSON['parse'](_0x3bbdee));}[_0x5165('0x2')](){sessionStorage[_0x5165('0x9')](ts,JSON[_0x5165('0x4')](this[_0x5165('0xe')](_0x530358=>_0x530358)));}}function os(_0xb5b7b2){return _0xb5b7b2[_0x5165('0x3')]()[_0x5165('0x8')]();}
@@ -18,9 +18,12 @@ export default class ShowAIAssistantCommand extends Command {
18
18
  /**
19
19
  * Opens AI Assistant user interface for the current document selection.
20
20
  *
21
- * @param prompt The initial prompt. If set, the AI assistant will automatically submit given prompt to the AI service.
22
- * @param label Label to be displayed in the AI assistant query input field while the AI assistant processes the initial prompt.
21
+ * @param query The initial query. If set, the AI assistant will automatically submit given query to the AI service.
22
+ * @param label Label to be displayed in the AI assistant query input field while the AI assistant processes the initial query.
23
+ * @param actionId The id of the executed action. It can be used in extended and custom adapters to customize the request. It
24
+ * will be prefixed with `aiAssistant:`. See also
25
+ * {@link module:ai/adapters/aitextadapter~AITextAdapterRequestData#actionId `AITextAdapterRequestData#actionId`}.
23
26
  * @fires execute
24
27
  */
25
- execute(prompt?: string, label?: string): void;
28
+ execute(query?: string, label?: string, actionId?: string): void;
26
29
  }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2af0=['aiAssistant.disabledElements','config','document','includes','selection','showUI','element','model','refresh','isEnabled','editor','plugins','get','name'];(function(_0x3c511d,_0x2af0a6){const _0x317296=function(_0x397cac){while(--_0x397cac){_0x3c511d['push'](_0x3c511d['shift']());}};_0x317296(++_0x2af0a6);}(_0x2af0,0x161));const _0x3172=function(_0x3c511d,_0x2af0a6){_0x3c511d=_0x3c511d-0x0;let _0x317296=_0x2af0[_0x3c511d];return _0x317296;};import{Command as _0x20ea57}from'ckeditor5/src/core';import _0x2a1a3d from'../aiassistantui';export default class I extends _0x20ea57{[_0x3172('0x5')](){const _0x3e53d4=this['editor'][_0x3172('0x4')][_0x3172('0xd')][_0x3172('0x1')],_0x544306=this[_0x3172('0x7')][_0x3172('0xc')][_0x3172('0x9')](_0x3172('0xb'));for(const _0x1db871 of _0x3e53d4['getRanges']())for(const _0x37c4be of _0x1db871['getItems']())if(_0x37c4be['is'](_0x3172('0x3'))&&_0x544306[_0x3172('0x0')](_0x37c4be[_0x3172('0xa')]))return void(this['isEnabled']=!0x1);this[_0x3172('0x6')]=!0x0;}['execute'](_0xfb3456='',_0x3c0a25=''){this[_0x3172('0x7')][_0x3172('0x8')][_0x3172('0x9')](_0x2a1a3d)[_0x3172('0x2')](_0xfb3456,_0x3c0a25);}}
23
+ const _0x218c=['model','showUI','getRanges','get','selection','editor','element','ai.aiAssistant.disabledElements','getItems','custom','plugins','isEnabled','includes','document'];(function(_0x4b9bee,_0x218c26){const _0x34e3a9=function(_0x52c64e){while(--_0x52c64e){_0x4b9bee['push'](_0x4b9bee['shift']());}};_0x34e3a9(++_0x218c26);}(_0x218c,0x1a1));const _0x34e3=function(_0x4b9bee,_0x218c26){_0x4b9bee=_0x4b9bee-0x0;let _0x34e3a9=_0x218c[_0x4b9bee];return _0x34e3a9;};import{Command as _0x4a67c9}from'ckeditor5/src/core';import _0x23b8a8 from'../aiassistantui';export default class I extends _0x4a67c9{['refresh'](){const _0x467a38=this['editor'][_0x34e3('0x3')][_0x34e3('0x2')][_0x34e3('0x7')],_0x56b682=this[_0x34e3('0x8')]['config'][_0x34e3('0x6')](_0x34e3('0xa'));for(const _0x2562e3 of _0x467a38[_0x34e3('0x5')]())for(const _0x4bb82d of _0x2562e3[_0x34e3('0xb')]())if(_0x4bb82d['is'](_0x34e3('0x9'))&&_0x56b682[_0x34e3('0x1')](_0x4bb82d['name']))return void(this[_0x34e3('0x0')]=!0x1);this[_0x34e3('0x0')]=!0x0;}['execute'](_0x49c74f='',_0x41faf0='',_0x1c3269=_0x34e3('0xc')){this[_0x34e3('0x8')][_0x34e3('0xd')]['get'](_0x23b8a8)[_0x34e3('0x4')](_0x49c74f,_0x41faf0,_0x1c3269);}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export function getTranslation(_0x2e53a6,_0x3aee86,_0x52ed40){const t=_0x2e53a6['t'];switch(_0x3aee86){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',_0x52ed40);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 _0x3aee86;}}
23
+ export function getTranslation(_0x28a569,_0x40dec0,_0x17b838){const t=_0x28a569['t'];switch(_0x40dec0){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',_0x17b838);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_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x17b838);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 _0x40dec0;}}
@@ -1,45 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- import { Plugin, type Editor } from 'ckeditor5/src/core';
6
- /**
7
- * The AI handler plugin that is responsible for the whole communication with AI.
8
- * It uses the Adapter for OpenAI by default.
9
- */
10
- export default class AIConnector extends Plugin {
11
- /**
12
- * The adapter instance which is used to handle the communication with AI API.
13
- */
14
- adapter: Adapter;
15
- /**
16
- * @inheritDoc
17
- */
18
- static get pluginName(): "AIConnector";
19
- /**
20
- * @inheritDoc
21
- */
22
- constructor(editor: Editor);
23
- /**
24
- * Processes a user prompt and sends it to the AI API.
25
- *
26
- * @param prompt The user's prompt to be processed.
27
- * @param context The context on which the prompt is used.
28
- * @param onDataCallback The callback that is called after receiving content from AI API.
29
- * @returns A Promise that resolves with the AI-generated response.
30
- * @throws If sending the prompt to the AI API fails.
31
- */
32
- processPrompt(prompt: string, context: string, onDataCallback: (content: string) => any): Promise<void>;
33
- /**
34
- * The method that stops the current request and then recreates the abort controller instance.
35
- */
36
- abort(): void;
37
- }
38
- interface Adapter {
39
- sendPrompt(systemMessage: string, userMessage: string, abortSignal: AbortSignal, onDataCallback: DataCallback): Promise<void>;
40
- }
41
- type DataCallback = (content: string) => any;
42
- export declare class AIRequestError extends Error {
43
- constructor(message: string);
44
- }
45
- export {};
@@ -1,23 +0,0 @@
1
- /*
2
- * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- *
4
- *
5
- *
6
- *
7
- * +---------------------------------------------------------------------------------+
8
- * | |
9
- * | Hello stranger! |
10
- * | |
11
- * | |
12
- * | What you're currently looking at is the source code of a legally protected, |
13
- * | proprietary software. Any attempts to deobfuscate / disassemble this code |
14
- * | are forbidden and will result in legal consequences. |
15
- * | |
16
- * | |
17
- * +---------------------------------------------------------------------------------+
18
- *
19
- *
20
- *
21
- *
22
- */
23
- const _0x39c6=['AI_ERROR_AUTH_REQUEST','length','https://api.openai.com/v1/chat/completions','data','define','AIConnector','locale','aiAssistant.requestParameters.temperature','text','POST','catch','replace','pluginName','[DONE]','system','reject','_apiUrl','AIRequestError','Instruction:\x0a','content','toView','aiAssistant.requestParameters.stream','model','aiAssistant.requestParameters.model','sendPrompt','adapter','text/html','includes','name','Authorization','user','push','_normalizeResponseHeadings','string','get','aiAssistant','_xmlSerializer','aborted','max_tokens','_abortController','stream','split','aiAssistant.apiUrl','config','Bearer\x20','abort','match','delta','aiconnector-send-prompt-failed','document','editor','resolve','filter','_requestParameters','parseFromString','json','AI_ERROR_CONTEXT_LENGTH','application/json','serializeToString','stringify','_prepareMessages','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.','startsWith','_isBufferIncomplete','_parseAndNormalizeContent','top_p','_readStreamableResponse','signal','rename','view','processor','context_length_exceeded','_authKey','AbortError','decode','_domParser','authKey','temperature','element'];(function(_0x3098e0,_0x39c667){const _0x65b673=function(_0x9aaf15){while(--_0x9aaf15){_0x3098e0['push'](_0x3098e0['shift']());}};_0x65b673(++_0x39c667);}(_0x39c6,0x130));const _0x65b6=function(_0x3098e0,_0x39c667){_0x3098e0=_0x3098e0-0x0;let _0x65b673=_0x39c6[_0x3098e0];return _0x65b673;};import{Matcher as _0x4f7254,UpcastWriter as _0x39b3c6}from'ckeditor5/src/engine';import{Plugin as _0x21cb0}from'ckeditor5/src/core';import{CKEditorError as _0x3b4eb1}from'ckeditor5/src/utils';import{getTranslation as _0x2b2adc}from'./utils/common-translations';export default class o extends _0x21cb0{static get[_0x65b6('0x18')](){return _0x65b6('0x11');}constructor(_0x18a1a9){super(_0x18a1a9),_0x18a1a9[_0x65b6('0x37')][_0x65b6('0x10')](_0x65b6('0x36'),_0x65b6('0xe')),_0x18a1a9[_0x65b6('0x37')][_0x65b6('0x10')](_0x65b6('0x23'),'gpt-3.5-turbo'),_0x18a1a9['config'][_0x65b6('0x10')]('aiAssistant.requestParameters.max_tokens',0x7d0),_0x18a1a9['config'][_0x65b6('0x10')](_0x65b6('0x13'),0x1),_0x18a1a9[_0x65b6('0x37')]['define']('aiAssistant.requestParameters.top_p',0x1),_0x18a1a9[_0x65b6('0x37')][_0x65b6('0x10')](_0x65b6('0x21'),!0x0);const _0x51e90f=_0x18a1a9[_0x65b6('0x37')][_0x65b6('0x2e')](_0x65b6('0x36')),_0x512f44=_0x18a1a9[_0x65b6('0x37')][_0x65b6('0x2e')](_0x65b6('0x2f'))[_0x65b6('0x9')],_0x212542=_0x18a1a9['config']['get']('aiAssistant.requestParameters');this[_0x65b6('0x33')]=new AbortController(),this[_0x65b6('0x25')]=new OpenAIAdapter(_0x18a1a9,_0x51e90f,_0x212542,_0x512f44);}async['processPrompt'](_0x52ed1d,_0x5287ee,_0x4f6b65){const {systemMessage:_0x33a0d7,userMessage:_0x52464d}=this[_0x65b6('0x48')](_0x52ed1d,_0x5287ee);return this[_0x65b6('0x25')]['sendPrompt'](_0x33a0d7,_0x52464d,this[_0x65b6('0x33')]['signal'],_0x4f6b65)[_0x65b6('0x16')](_0x2a4420=>{if(_0x2a4420 instanceof AIRequestError)return Promise['reject'](_0x2a4420);if(_0x65b6('0x6')==_0x2a4420[_0x65b6('0x28')])return Promise[_0x65b6('0x3f')]();throw console['error'](_0x2a4420),new _0x3b4eb1(_0x65b6('0x3c'),null);});}['abort'](){this[_0x65b6('0x33')][_0x65b6('0x0')][_0x65b6('0x31')]||(this[_0x65b6('0x33')][_0x65b6('0x39')](),this[_0x65b6('0x33')]=new AbortController());}[_0x65b6('0x48')](_0x537a50,_0x38cd2b){let _0x157be6,_0x314411;return _0x38cd2b?(_0x157be6='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.',_0x314411=_0x65b6('0x1e')+_0x537a50+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+(_0x38cd2b[_0x65b6('0x4a')]('<')?_0x38cd2b:'<span>'+_0x38cd2b+'</span>')):(_0x157be6=_0x65b6('0x49'),_0x314411=_0x537a50),{'systemMessage':_0x157be6,'userMessage':_0x314411};}}export class OpenAIAdapter{constructor(_0x507bc3,_0xadb0ae,_0x233da0,_0xcc79e6){this['editor']=_0x507bc3,this[_0x65b6('0x1c')]=_0xadb0ae,this['_authKey']=_0xcc79e6,this[_0x65b6('0x41')]=_0x233da0,this[_0x65b6('0x8')]=new DOMParser(),this[_0x65b6('0x30')]=new XMLSerializer();}async[_0x65b6('0x24')](_0x503a49,_0x312b89,_0x6bcbc3,_0x17377d){const _0xffe5b9=this[_0x65b6('0x3e')][_0x65b6('0x12')],_0x262e62={'Content-Type':_0x65b6('0x45')};if(_0x65b6('0x2d')==typeof this[_0x65b6('0x5')])_0x262e62[_0x65b6('0x29')]=_0x65b6('0x38')+this[_0x65b6('0x5')];else{if(this[_0x65b6('0x5')])try{const _0x1dda20=await this[_0x65b6('0x5')]();_0x262e62[_0x65b6('0x29')]=_0x65b6('0x38')+_0x1dda20;}catch(_0x4ea7b6){return Promise['reject'](new AIRequestError(_0x2b2adc(_0xffe5b9,_0x65b6('0xc'))));}}const _0x5c7398={'model':this[_0x65b6('0x41')][_0x65b6('0x22')],'messages':[{'role':_0x65b6('0x1a'),'content':_0x503a49},{'role':_0x65b6('0x2a'),'content':_0x312b89}],'stream':this[_0x65b6('0x41')][_0x65b6('0x34')],'max_tokens':this['_requestParameters'][_0x65b6('0x32')],'temperature':this[_0x65b6('0x41')][_0x65b6('0xa')],'top_p':this[_0x65b6('0x41')][_0x65b6('0x4d')]};this[_0x65b6('0x41')][_0x65b6('0x2a')]&&(_0x5c7398[_0x65b6('0x2a')]=this[_0x65b6('0x41')]['user']);const _0x494c90={'method':_0x65b6('0x15'),'headers':_0x262e62,'body':JSON[_0x65b6('0x47')](_0x5c7398),'signal':_0x6bcbc3},_0x158531=await fetch(this[_0x65b6('0x1c')],_0x494c90);if(_0x158531['ok'])return this[_0x65b6('0x41')][_0x65b6('0x34')]?await this[_0x65b6('0x4e')](_0x158531,_0x17377d):await this['_readStaticResponse'](_0x158531,_0x17377d),Promise['resolve']();{const _0x12103d=await _0x158531[_0x65b6('0x14')]();return _0x12103d[_0x65b6('0x27')](_0x65b6('0x4'))?Promise[_0x65b6('0x1b')](new AIRequestError(_0x2b2adc(_0xffe5b9,_0x65b6('0x44')))):_0x12103d[_0x65b6('0x27')]('Moderation')?Promise['reject'](new AIRequestError(_0x2b2adc(_0xffe5b9,'AI_ERROR_MODERATION'))):Promise[_0x65b6('0x1b')](new Error(_0x12103d));}}async[_0x65b6('0x4e')](_0x18e6db,_0x575cac){const _0x56ff28=_0x18e6db['body']['getReader'](),_0x58e27e=new TextDecoder();let _0x397e39='',_0x16b17f='',_0x101df0='',_0x539dc3=!0x1;for(;!_0x539dc3;){const {done:_0xbf7326,value:_0x372788}=await _0x56ff28['read'](),_0x47f273=_0x397e39+_0x58e27e[_0x65b6('0x7')](_0x372788);let _0x1e8251='';_0x539dc3=_0xbf7326;try{_0x1e8251=this['_cleanUpData'](_0x47f273),_0x397e39='';}catch(_0x111e50){_0x397e39=_0x47f273;continue;}_0x16b17f+=_0x1e8251,!_0xbf7326&&this[_0x65b6('0x4b')](_0x16b17f)||_0x16b17f&&(_0x101df0+=_0x16b17f,_0x575cac(this[_0x65b6('0x4c')](_0x101df0)),_0x16b17f='');}return Promise[_0x65b6('0x3f')]();}async['_readStaticResponse'](_0x4db35e,_0x431310){const _0xcdd692=(await _0x4db35e[_0x65b6('0x43')]())['choices'][0x0]['message'][_0x65b6('0x1f')];return _0x431310(this[_0x65b6('0x4c')](_0xcdd692)),Promise[_0x65b6('0x3f')]();}[_0x65b6('0x4b')](_0x524a58){const _0x589b14=_0x524a58[_0x65b6('0x35')]('<')[_0x65b6('0xd')]!==_0x524a58[_0x65b6('0x35')]('>')['length'],_0x2ce645=_0x524a58[_0x65b6('0xd')]<0x1e;return _0x589b14&&_0x2ce645;}[_0x65b6('0x4c')](_0x251a1f){const _0x24ff3f=this[_0x65b6('0x8')][_0x65b6('0x42')](_0x251a1f,_0x65b6('0x26')),_0x3ef796=this['editor']['data'][_0x65b6('0x3')][_0x65b6('0x20')](this[_0x65b6('0x30')][_0x65b6('0x46')](_0x24ff3f['body']));return this[_0x65b6('0x2c')](_0x3ef796),this[_0x65b6('0x3e')][_0x65b6('0xf')]['stringify'](this['editor'][_0x65b6('0xf')]['toModel'](_0x3ef796));}[_0x65b6('0x2c')](_0x23f2dd){const _0x4d949f=new _0x39b3c6(this[_0x65b6('0x3e')]['editing'][_0x65b6('0x2')][_0x65b6('0x3d')]),_0x500409=new _0x4f7254({'name':/^h[1-5]$/}),_0x253fea=[];let _0x5bb8e2=!0x1;for(const _0x9910b2 of _0x23f2dd)_0x9910b2['is'](_0x65b6('0xb'))&&_0x500409[_0x65b6('0x3a')](_0x9910b2)&&(_0x253fea[_0x65b6('0x2b')](_0x9910b2),'h1'==_0x9910b2[_0x65b6('0x28')]&&(_0x5bb8e2=!0x0));if(_0x5bb8e2)for(const _0x4c86dc of _0x253fea)_0x4d949f[_0x65b6('0x1')]('h'+(parseInt(_0x4c86dc[_0x65b6('0x28')][0x1])+0x1),_0x4c86dc);}['_cleanUpData'](_0x5a61e4){return _0x5a61e4[_0x65b6('0x35')](/\n(?![^{]*\})/g)['map'](_0x30c92d=>_0x30c92d[_0x65b6('0x17')]('data:\x20',''))[_0x65b6('0x40')](_0x24d774=>_0x24d774&&_0x24d774[_0x65b6('0xd')]>0x0&&_0x65b6('0x19')!==_0x24d774)['map'](_0x5b6442=>{const {choices:_0x18b946}=JSON['parse'](_0x5b6442);if(_0x18b946[0x0]&&_0x18b946[0x0][_0x65b6('0x3b')]&&_0x18b946[0x0][_0x65b6('0x3b')][_0x65b6('0x1f')])return _0x18b946[0x0][_0x65b6('0x3b')][_0x65b6('0x1f')];})['filter'](_0x514e37=>_0x514e37)['join']('');}}export class AIRequestError extends Error{constructor(_0x57ca2c){super(_0x57ca2c),this['name']=_0x65b6('0x1d');}}